@pagelines/sdk 1.0.550 → 1.0.552

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- var Bn = Object.defineProperty;
2
- var Bs = (i, t, e) => t in i ? Bn(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var h = (i, t) => Bn(i, "name", { value: t, configurable: !0 });
4
- var O = (i, t, e) => Bs(i, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as ke, openBlock as T, createElementBlock as A, createElementVNode as S, normalizeClass as _, ref as Q, watch as Je, computed as U, createCommentVNode as q, renderSlot as ln, onMounted as Mt, Fragment as De, renderList as Rt, withDirectives as ds, vModelText as fs, unref as nn, toDisplayString as ce, shallowRef as gs, onBeforeUnmount as ms, nextTick as Fs, createVNode as He, withCtx as Us, createBlock as Fn, withModifiers as Tt, createTextVNode as Un } from "vue";
6
- import { SettingsObject as Hs, Agent as It, getDefaultAvatarUrl as xs, createLogger as js } from "@pagelines/core";
7
- import { P as Gs } from "./sdkClient.js";
8
- const Ws = { class: "spinner max-w-sm" }, qs = {
1
+ var Fn = Object.defineProperty;
2
+ var Fs = (a, t, e) => t in a ? Fn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var h = (a, t) => Fn(a, "name", { value: t, configurable: !0 });
4
+ var O = (a, t, e) => Fs(a, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as ve, openBlock as v, createElementBlock as S, createElementVNode as T, normalizeClass as _, ref as ee, watch as tt, computed as W, createCommentVNode as Y, renderSlot as on, onMounted as zt, Fragment as Oe, renderList as Dt, withDirectives as fs, vModelText as gs, unref as sn, toDisplayString as he, shallowRef as ms, onBeforeUnmount as bs, nextTick as Us, createVNode as We, withCtx as Hs, createBlock as Un, withModifiers as _t, createTextVNode as Hn } from "vue";
6
+ import { SettingsObject as js, Agent as Ot, getDefaultAvatarUrl as xs, createLogger as Gs } from "@pagelines/core";
7
+ import { P as Ws } from "./sdkClient.js";
8
+ const qs = { class: "spinner max-w-sm" }, Vs = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, Hn = /* @__PURE__ */ ke({
11
+ }, jn = /* @__PURE__ */ ve({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
- setup(i) {
18
- return (t, e) => (T(), A("div", Ws, [
19
- (T(), A("svg", qs, [
20
- S("circle", {
21
- class: _([i.colorMode, "ring-path"]),
17
+ setup(a) {
18
+ return (t, e) => (v(), S("div", qs, [
19
+ (v(), S("svg", Vs, [
20
+ T("circle", {
21
+ class: _([a.colorMode, "ring-path"]),
22
22
  cx: "50",
23
23
  cy: "50",
24
24
  r: "20",
@@ -30,10 +30,10 @@ const Ws = { class: "spinner max-w-sm" }, qs = {
30
30
  ]))
31
31
  ]));
32
32
  }
33
- }), Vs = [
33
+ }), Ys = [
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
- ], Ys = 9e4, bs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Zs = /* @__PURE__ */ new Set([...bs, "EMPTY_STREAM", "RATE_LIMIT"]), jn = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), xn = class xn extends Hs {
36
+ ], Zs = 9e4, ks = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Xs = /* @__PURE__ */ new Set([...ks, "EMPTY_STREAM", "RATE_LIMIT"]), Gn = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), xn = class xn extends js {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
39
  O(this, "isTextMode", !1);
@@ -41,16 +41,16 @@ const Ws = { class: "spinner max-w-sm" }, qs = {
41
41
  O(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
43
  O(this, "conversationId");
44
- O(this, "textState", Q({
44
+ O(this, "textState", ee({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- O(this, "agentMode", Q("self"));
51
- O(this, "sharedMessages", Q([]));
50
+ O(this, "agentMode", ee("self"));
51
+ O(this, "sharedMessages", ee([]));
52
52
  O(this, "_agent");
53
- this._agent = e.agent instanceof It ? e.agent : new It({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
53
+ this._agent = e.agent instanceof Ot ? e.agent : new Ot({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
54
54
  }
55
55
  get chatEnabled() {
56
56
  const e = this._agent.state.value.lifecycle;
@@ -127,12 +127,12 @@ Current User:
127
127
  });
128
128
  }
129
129
  setupModeWatcher() {
130
- Je(this.agentMode, async (e, n) => {
130
+ tt(this.agentMode, async (e, n) => {
131
131
  this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
132
132
  });
133
133
  }
134
134
  setupAvailabilityWatcher() {
135
- Je(() => this.chatEnabled, (e) => {
135
+ tt(() => this.chatEnabled, (e) => {
136
136
  if (!(!this.isTextMode || this.isConnecting)) {
137
137
  if (e) {
138
138
  this.textState.value.isConnected || this.updateState(this.textState, {
@@ -218,73 +218,73 @@ Current User:
218
218
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
219
219
  const l = `stream-${Date.now()}`;
220
220
  let o = !1, p = !1;
221
- const c = /* @__PURE__ */ h((f, v = "assistant") => {
221
+ const c = /* @__PURE__ */ h((g, A = "assistant") => {
222
222
  o || (o = !0, this.sharedMessages.value = [
223
223
  ...this.sharedMessages.value,
224
- { id: l, text: "", sender: v === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
224
+ { id: l, text: "", sender: A === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
225
225
  ]);
226
- const C = this.sharedMessages.value, z = C[C.length - 1];
227
- z?.id === l && (z.text += f, this.sharedMessages.value = [...C]);
228
- }, "onDelta"), b = /* @__PURE__ */ h((f) => {
226
+ const I = this.sharedMessages.value, N = I[I.length - 1];
227
+ N?.id === l && (N.text += g, this.sharedMessages.value = [...I]);
228
+ }, "onDelta"), x = /* @__PURE__ */ h((g) => {
229
229
  p = !0, o = !0;
230
- const v = this.sharedMessages.value, C = v.findIndex((z) => z.id === f.id);
231
- if (C >= 0)
230
+ const A = this.sharedMessages.value, I = A.findIndex((N) => N.id === g.id);
231
+ if (I >= 0)
232
232
  this.sharedMessages.value = [
233
- ...v.slice(0, C),
234
- f,
235
- ...v.slice(C + 1)
233
+ ...A.slice(0, I),
234
+ g,
235
+ ...A.slice(I + 1)
236
236
  ];
237
237
  else {
238
- const z = v[v.length - 1];
239
- this.sharedMessages.value = z?.id === l ? [...v.slice(0, -1), f] : [...v, f];
238
+ const N = A[A.length - 1];
239
+ this.sharedMessages.value = N?.id === l ? [...A.slice(0, -1), g] : [...A, g];
240
240
  }
241
- f.sender === "system" && f.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : f.sender === "system" && f.issue?.code && jn.has(f.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
242
- }, "onMessage"), d = /* @__PURE__ */ h((f) => {
241
+ g.sender === "system" && g.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : g.sender === "system" && g.issue?.code && Gn.has(g.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
242
+ }, "onMessage"), d = /* @__PURE__ */ h((g) => {
243
243
  if (!o && !p) {
244
- m("empty_stream — assistant returned no content");
244
+ f("empty_stream — assistant returned no content");
245
245
  return;
246
246
  }
247
- const v = this.sharedMessages.value, C = v[v.length - 1];
248
- if (C?.id === l && C.sender === "agent" && C.text) {
249
- let z = C.text;
250
- for (const ee of Vs)
251
- ee.pattern.test(z) && (console.debug(`[chat] filtered directive: ${ee.label}`), z = z.replace(ee.pattern, "").trim(), ee.pattern.lastIndex = 0);
252
- z ? z !== C.text && (C.text = z, this.sharedMessages.value = [...v]) : this.sharedMessages.value = v.slice(0, -1);
253
- }
254
- f && (this.conversationId = f), this.updateState(this.textState, { isThinking: !1 });
255
- }, "onDone"), m = /* @__PURE__ */ h((f) => {
256
- const v = this.sharedMessages.value, C = v[v.length - 1];
257
- if (C?.id === l && !C.text && (this.sharedMessages.value = v.slice(0, -1)), typeof f == "object" && f.code && f.error) {
258
- const { bucket: te, actionUrl: re, actionLabel: ge, help: $ } = f;
259
- if (te !== void 0 || Zs.has(f.code)) {
260
- const me = te ?? (bs.has(f.code) ? "account" : "error"), ye = {
261
- code: f.code,
262
- bucket: me,
263
- ...ge ? { actionLabel: ge } : {},
264
- ...re ? { actionUrl: re } : {},
265
- ...$ ? { help: $ } : {}
247
+ const A = this.sharedMessages.value, I = A[A.length - 1];
248
+ if (I?.id === l && I.sender === "agent" && I.text) {
249
+ let N = I.text;
250
+ for (const Z of Ys)
251
+ Z.pattern.test(N) && (console.debug(`[chat] filtered directive: ${Z.label}`), N = N.replace(Z.pattern, "").trim(), Z.pattern.lastIndex = 0);
252
+ N ? N !== I.text && (I.text = N, this.sharedMessages.value = [...A]) : this.sharedMessages.value = A.slice(0, -1);
253
+ }
254
+ g && (this.conversationId = g), this.updateState(this.textState, { isThinking: !1 });
255
+ }, "onDone"), f = /* @__PURE__ */ h((g) => {
256
+ const A = this.sharedMessages.value, I = A[A.length - 1];
257
+ if (I?.id === l && !I.text && (this.sharedMessages.value = A.slice(0, -1)), typeof g == "object" && g.code && g.error) {
258
+ const { bucket: se, actionUrl: j, actionLabel: ae, help: B } = g;
259
+ if (se !== void 0 || Xs.has(g.code)) {
260
+ const ye = se ?? (ks.has(g.code) ? "account" : "error"), Te = {
261
+ code: g.code,
262
+ bucket: ye,
263
+ ...ae ? { actionLabel: ae } : {},
264
+ ...j ? { actionUrl: j } : {},
265
+ ...B ? { help: B } : {}
266
266
  };
267
- this.addMessage(f.error, "system", void 0, ye), me === "account" ? this.updateState(this.textState, { isThinking: !1, sendBlockedReason: "account" }) : jn.has(f.code) ? this.updateState(this.textState, { isThinking: !1, sendBlockedReason: "agent_deleted" }) : this.updateState(this.textState, { isThinking: !1 });
267
+ this.addMessage(g.error, "system", void 0, Te), ye === "account" ? this.updateState(this.textState, { isThinking: !1, sendBlockedReason: "account" }) : Gn.has(g.code) ? this.updateState(this.textState, { isThinking: !1, sendBlockedReason: "agent_deleted" }) : this.updateState(this.textState, { isThinking: !1 });
268
268
  } else
269
- this.handleError(new Error(f.error));
269
+ this.handleError(new Error(g.error));
270
270
  return;
271
271
  }
272
- const z = typeof f == "string" ? f : f.error, ee = this.mapChatError(z);
273
- this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly: ee }), this.addMessage(ee, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(ee), z);
274
- }, "onError"), x = /* @__PURE__ */ h((f) => {
275
- this.addMessage(f, "system");
272
+ const N = typeof g == "string" ? g : g.error, Z = this.mapChatError(N);
273
+ this.isTransientError(N) ? (this.logger.warn("Chat turn failed (transient):", { raw: N, friendly: Z }), this.addMessage(Z, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(Z), N);
274
+ }, "onError"), b = /* @__PURE__ */ h((g) => {
275
+ this.addMessage(g, "system");
276
276
  }, "onStatus");
277
277
  try {
278
- const f = r ? r({
278
+ const g = r ? r({
279
279
  message: e,
280
280
  attachments: n,
281
281
  conversationId: this.conversationId,
282
282
  history: this.buildHistory(),
283
283
  onDelta: c,
284
- onMessage: b,
284
+ onMessage: x,
285
285
  onDone: d,
286
- onError: m,
287
- onStatus: x
286
+ onError: f,
287
+ onStatus: b
288
288
  }) : s.chat.chatStreamPublic({
289
289
  handle: this._agent.handle.value,
290
290
  message: e,
@@ -292,17 +292,17 @@ Current User:
292
292
  anonymousId: s.user.generateAnonId(),
293
293
  context: this.getDynamicSettings().context || void 0,
294
294
  onDelta: c,
295
- onMessage: b,
295
+ onMessage: x,
296
296
  onDone: d,
297
- onError: m,
298
- onStatus: x
297
+ onError: f,
298
+ onStatus: b
299
299
  });
300
300
  await Promise.race([
301
- f,
302
- new Promise((v, C) => setTimeout(() => C(new Error("timed out")), Ys))
301
+ g,
302
+ new Promise((A, I) => setTimeout(() => I(new Error("timed out")), Zs))
303
303
  ]);
304
- } catch (f) {
305
- m(f.message || "Something went wrong");
304
+ } catch (g) {
305
+ f(g.message || "Something went wrong");
306
306
  }
307
307
  }
308
308
  buildHistory() {
@@ -323,29 +323,29 @@ Current User:
323
323
  }
324
324
  };
325
325
  h(xn, "AgentChatController");
326
- let Gn = xn;
327
- function Wn(i) {
328
- return i ? typeof i == "string" ? i : i.src || "" : "";
326
+ let Wn = xn;
327
+ function qn(a) {
328
+ return a ? typeof a == "string" ? a : a.src || "" : "";
329
329
  }
330
- h(Wn, "getImageSrc");
331
- function oa(i) {
332
- return Wn(i.cover) || Wn(i.avatar) || xs(i.name);
330
+ h(qn, "getImageSrc");
331
+ function ca(a) {
332
+ return qn(a.cover) || qn(a.avatar) || xs(a.name);
333
333
  }
334
- h(oa, "getAgentAvatarUrl");
335
- function qn(i) {
336
- const t = i.target;
334
+ h(ca, "getAgentAvatarUrl");
335
+ function Vn(a) {
336
+ const t = a.target;
337
337
  t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = xs());
338
338
  }
339
- h(qn, "handleImageError");
340
- function ca(i) {
341
- const { template: t, agent: e } = i;
339
+ h(Vn, "handleImageError");
340
+ function ua(a) {
341
+ const { template: t, agent: e } = a;
342
342
  return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
343
343
  }
344
- h(ca, "parseButtonTemplate");
345
- const Xs = {
344
+ h(ua, "parseButtonTemplate");
345
+ const Ks = {
346
346
  key: 0,
347
347
  class: "absolute inset-0 flex items-center justify-center"
348
- }, ua = /* @__PURE__ */ ke({
348
+ }, ha = /* @__PURE__ */ ve({
349
349
  __name: "ElAgentButton",
350
350
  props: {
351
351
  theme: { default: "primary" },
@@ -354,61 +354,61 @@ const Xs = {
354
354
  icon: {},
355
355
  iconAfter: {}
356
356
  },
357
- setup(i) {
358
- const t = U(() => ({
357
+ setup(a) {
358
+ const t = W(() => ({
359
359
  primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
360
360
  green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
361
361
  red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
362
362
  default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
363
- })[i.theme]), e = U(() => ({
363
+ })[a.theme]), e = W(() => ({
364
364
  sm: "px-4 py-2 text-sm",
365
365
  md: "px-6 py-3 text-base",
366
366
  lg: "px-8 py-4 text-base"
367
- })[i.size]), n = U(() => ({
367
+ })[a.size]), n = W(() => ({
368
368
  sm: "size-4",
369
369
  md: "size-4",
370
370
  lg: "size-5"
371
- })[i.size]);
372
- return (r, s) => (T(), A("button", {
371
+ })[a.size]);
372
+ return (r, s) => (v(), S("button", {
373
373
  class: _(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
374
374
  }, [
375
- i.loading ? (T(), A("div", Xs, [...s[0] || (s[0] = [
376
- S("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
377
- ])])) : q("", !0),
378
- S("span", {
379
- class: _(["flex items-center gap-2 transition-opacity duration-200", i.loading ? "opacity-0" : "opacity-100"])
375
+ a.loading ? (v(), S("div", Ks, [...s[0] || (s[0] = [
376
+ T("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
377
+ ])])) : Y("", !0),
378
+ T("span", {
379
+ class: _(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
380
380
  }, [
381
- i.icon ? (T(), A("i", {
381
+ a.icon ? (v(), S("i", {
382
382
  key: 0,
383
- class: _([i.icon, n.value])
384
- }, null, 2)) : q("", !0),
385
- ln(r.$slots, "default"),
386
- i.iconAfter ? (T(), A("i", {
383
+ class: _([a.icon, n.value])
384
+ }, null, 2)) : Y("", !0),
385
+ on(r.$slots, "default"),
386
+ a.iconAfter ? (v(), S("i", {
387
387
  key: 1,
388
- class: _([i.iconAfter, n.value])
389
- }, null, 2)) : q("", !0)
388
+ class: _([a.iconAfter, n.value])
389
+ }, null, 2)) : Y("", !0)
390
390
  ], 2)
391
391
  ], 2));
392
392
  }
393
- }), Ks = ["value"], ha = /* @__PURE__ */ ke({
393
+ }), Qs = ["value"], pa = /* @__PURE__ */ ve({
394
394
  __name: "AgentInputEmail",
395
395
  props: {
396
396
  modelValue: { default: "" }
397
397
  },
398
398
  emits: ["update:modelValue"],
399
- setup(i, { emit: t }) {
399
+ setup(a, { emit: t }) {
400
400
  const e = t;
401
- return (n, r) => (T(), A("input", {
401
+ return (n, r) => (v(), S("input", {
402
402
  type: "email",
403
403
  autocomplete: "email",
404
404
  placeholder: "Enter your email",
405
- value: i.modelValue,
405
+ value: a.modelValue,
406
406
  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",
407
407
  style: { "font-size": "16px" },
408
408
  onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
409
- }, null, 40, Ks));
409
+ }, null, 40, Qs));
410
410
  }
411
- }), Qs = { class: "flex gap-1.5 justify-center" }, Js = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], pa = /* @__PURE__ */ ke({
411
+ }), Js = { class: "flex gap-1.5 justify-center" }, er = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], da = /* @__PURE__ */ ve({
412
412
  __name: "AgentInputOneTimeCode",
413
413
  props: {
414
414
  modelValue: {},
@@ -416,74 +416,74 @@ const Xs = {
416
416
  focusFirst: { type: Boolean }
417
417
  },
418
418
  emits: ["update:modelValue", "autoSubmit"],
419
- setup(i, { emit: t }) {
420
- const e = i, n = t, r = Q([]), s = Q(Array.from({ length: e.length }).fill("")), l = Q(!1);
421
- Mt(() => {
419
+ setup(a, { emit: t }) {
420
+ const e = a, n = t, r = ee([]), s = ee(Array.from({ length: e.length }).fill("")), l = ee(!1);
421
+ zt(() => {
422
422
  e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
423
- }), Je(() => e.modelValue, (d) => {
423
+ }), tt(() => e.modelValue, (d) => {
424
424
  s.value = d ? d.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
425
- }), Je(s, () => {
425
+ }), tt(s, () => {
426
426
  const d = s.value.filter(Boolean).join("");
427
427
  n("update:modelValue", d), d.length === e.length && n("autoSubmit", d);
428
428
  }, { deep: !0 });
429
- function o(d, m) {
430
- m.preventDefault(), l.value = !0;
431
- const x = (m.clipboardData?.getData("text") || "").replace(/\D/g, "");
432
- if (x.length === e.length)
433
- s.value = x.split(""), setTimeout(() => {
429
+ function o(d, f) {
430
+ f.preventDefault(), l.value = !0;
431
+ const b = (f.clipboardData?.getData("text") || "").replace(/\D/g, "");
432
+ if (b.length === e.length)
433
+ s.value = b.split(""), setTimeout(() => {
434
434
  r.value[e.length - 1]?.focus(), l.value = !1;
435
435
  }, 10);
436
436
  else {
437
- const f = [...s.value];
438
- x.split("").slice(0, e.length - d).forEach((C, z) => {
439
- f[d + z] = C;
440
- }), s.value = f;
441
- const v = Math.min(d + x.length, e.length - 1);
437
+ const g = [...s.value];
438
+ b.split("").slice(0, e.length - d).forEach((I, N) => {
439
+ g[d + N] = I;
440
+ }), s.value = g;
441
+ const A = Math.min(d + b.length, e.length - 1);
442
442
  setTimeout(() => {
443
- r.value[v]?.focus(), l.value = !1;
443
+ r.value[A]?.focus(), l.value = !1;
444
444
  }, 10);
445
445
  }
446
446
  }
447
447
  h(o, "onPaste");
448
- function p(d, m) {
449
- const x = m.target.value.slice(-1).replace(/\D/g, "");
450
- s.value[d] = x, x && d < e.length - 1 && r.value[d + 1]?.focus();
448
+ function p(d, f) {
449
+ const b = f.target.value.slice(-1).replace(/\D/g, "");
450
+ s.value[d] = b, b && d < e.length - 1 && r.value[d + 1]?.focus();
451
451
  }
452
452
  h(p, "onInput");
453
- function c(d, m) {
454
- m.key === "Backspace" ? (m.preventDefault(), s.value[d] = "", d > 0 && r.value[d - 1]?.focus()) : m.key === "ArrowLeft" && d > 0 ? r.value[d - 1]?.focus() : m.key === "ArrowRight" && d < e.length - 1 && r.value[d + 1]?.focus();
453
+ function c(d, f) {
454
+ f.key === "Backspace" ? (f.preventDefault(), s.value[d] = "", d > 0 && r.value[d - 1]?.focus()) : f.key === "ArrowLeft" && d > 0 ? r.value[d - 1]?.focus() : f.key === "ArrowRight" && d < e.length - 1 && r.value[d + 1]?.focus();
455
455
  }
456
456
  h(c, "onKeydown");
457
- function b(d) {
457
+ function x(d) {
458
458
  if (r.value[d]?.select(), !l.value && s.value[d])
459
- for (let m = d; m < e.length; m++)
460
- s.value[m] = "";
459
+ for (let f = d; f < e.length; f++)
460
+ s.value[f] = "";
461
461
  }
462
- return h(b, "onFocus"), (d, m) => (T(), A("div", Qs, [
463
- (T(!0), A(De, null, Rt(i.length, (x) => ds((T(), A("input", {
464
- key: x,
462
+ return h(x, "onFocus"), (d, f) => (v(), S("div", Js, [
463
+ (v(!0), S(Oe, null, Dt(a.length, (b) => fs((v(), S("input", {
464
+ key: b,
465
465
  ref_for: !0,
466
- ref: /* @__PURE__ */ h((f) => r.value[x - 1] = f, "ref"),
467
- "onUpdate:modelValue": /* @__PURE__ */ h((f) => s.value[x - 1] = f, "onUpdate:modelValue"),
466
+ ref: /* @__PURE__ */ h((g) => r.value[b - 1] = g, "ref"),
467
+ "onUpdate:modelValue": /* @__PURE__ */ h((g) => s.value[b - 1] = g, "onUpdate:modelValue"),
468
468
  type: "text",
469
469
  inputmode: "numeric",
470
470
  autocomplete: "one-time-code",
471
471
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
472
472
  style: { "font-size": "16px" },
473
473
  maxlength: "1",
474
- onInput: /* @__PURE__ */ h((f) => p(x - 1, f), "onInput"),
475
- onKeydown: /* @__PURE__ */ h((f) => c(x - 1, f), "onKeydown"),
476
- onPaste: /* @__PURE__ */ h((f) => o(x - 1, f), "onPaste"),
477
- onFocus: /* @__PURE__ */ h((f) => b(x - 1), "onFocus")
478
- }, null, 40, Js)), [
479
- [fs, s.value[x - 1]]
474
+ onInput: /* @__PURE__ */ h((g) => p(b - 1, g), "onInput"),
475
+ onKeydown: /* @__PURE__ */ h((g) => c(b - 1, g), "onKeydown"),
476
+ onPaste: /* @__PURE__ */ h((g) => o(b - 1, g), "onPaste"),
477
+ onFocus: /* @__PURE__ */ h((g) => x(b - 1), "onFocus")
478
+ }, null, 40, er)), [
479
+ [gs, s.value[b - 1]]
480
480
  ])), 128))
481
481
  ]));
482
482
  }
483
- }), er = { class: "relative flex-shrink-0" }, tr = ["src", "alt"], nr = { class: "absolute top-1 right-1" }, sr = {
483
+ }), tr = { class: "relative flex-shrink-0" }, nr = ["src", "alt"], sr = { class: "absolute top-1 right-1" }, rr = {
484
484
  key: 1,
485
485
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
486
- }, rr = { class: "min-w-0" }, ir = /* @__PURE__ */ ke({
486
+ }, ir = { class: "min-w-0" }, ar = /* @__PURE__ */ ve({
487
487
  __name: "ElModeHeader",
488
488
  props: {
489
489
  agent: {},
@@ -491,69 +491,69 @@ const Xs = {
491
491
  isOnline: { type: Boolean, default: !1 },
492
492
  layout: { default: "centered" }
493
493
  },
494
- setup(i) {
495
- return (t, e) => (T(), A("div", {
494
+ setup(a) {
495
+ return (t, e) => (v(), S("div", {
496
496
  class: _(["flex gap-4", [
497
- i.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
497
+ a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
498
498
  ]])
499
499
  }, [
500
- S("div", er, [
501
- S("div", {
502
- class: _(["rounded-full overflow-hidden border-white", i.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
500
+ T("div", tr, [
501
+ T("div", {
502
+ class: _(["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"])
503
503
  }, [
504
- S("img", {
505
- src: i.agent.avatarUrl.value,
506
- alt: i.agent.displayName.value,
504
+ T("img", {
505
+ src: a.agent.avatarUrl.value,
506
+ alt: a.agent.displayName.value,
507
507
  class: "w-full h-full object-cover",
508
508
  onError: e[0] || (e[0] = //@ts-ignore
509
- (...n) => nn(qn) && nn(qn)(...n))
510
- }, null, 40, tr)
509
+ (...n) => sn(Vn) && sn(Vn)(...n))
510
+ }, null, 40, nr)
511
511
  ], 2),
512
- S("div", nr, [
513
- i.isOnline ? (T(), A(De, { key: 0 }, [
514
- e[1] || (e[1] = S("div", {
512
+ T("div", sr, [
513
+ a.isOnline ? (v(), S(Oe, { key: 0 }, [
514
+ e[1] || (e[1] = T("div", {
515
515
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
516
516
  style: { "animation-duration": "3s" }
517
517
  }, null, -1)),
518
- e[2] || (e[2] = S("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
519
- ], 64)) : (T(), A("div", sr))
518
+ e[2] || (e[2] = T("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
519
+ ], 64)) : (v(), S("div", rr))
520
520
  ])
521
521
  ]),
522
- S("div", rr, [
523
- S("h1", {
522
+ T("div", ir, [
523
+ T("h1", {
524
524
  class: _(["font-light text-white mb-1 truncate", [
525
- i.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
526
- i.layout === "horizontal" ? "text-white/95" : ""
525
+ a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
526
+ a.layout === "horizontal" ? "text-white/95" : ""
527
527
  ]])
528
- }, ce(i.agent.displayName.value), 3),
529
- S("p", {
528
+ }, he(a.agent.displayName.value), 3),
529
+ T("p", {
530
530
  class: _(["font-light line-clamp-1", [
531
- i.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
532
- i.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
531
+ a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
532
+ a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
533
533
  ]])
534
- }, ce(i.layout === "horizontal" ? i.agent.title.value || "Assistant" : i.agent.title.value), 3)
534
+ }, he(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
535
535
  ])
536
536
  ], 2));
537
537
  }
538
538
  });
539
- function Vn(i, t) {
540
- (t == null || t > i.length) && (t = i.length);
541
- for (var e = 0, n = Array(t); e < t; e++) n[e] = i[e];
539
+ function Yn(a, t) {
540
+ (t == null || t > a.length) && (t = a.length);
541
+ for (var e = 0, n = Array(t); e < t; e++) n[e] = a[e];
542
542
  return n;
543
543
  }
544
- h(Vn, "_arrayLikeToArray");
545
- function ar(i) {
546
- if (Array.isArray(i)) return i;
544
+ h(Yn, "_arrayLikeToArray");
545
+ function lr(a) {
546
+ if (Array.isArray(a)) return a;
547
547
  }
548
- h(ar, "_arrayWithHoles");
549
- function lr(i, t) {
550
- var e = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
548
+ h(lr, "_arrayWithHoles");
549
+ function or(a, t) {
550
+ var e = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
551
551
  if (e != null) {
552
552
  var n, r, s, l, o = [], p = !0, c = !1;
553
553
  try {
554
- if (s = (e = e.call(i)).next, t !== 0) for (; !(p = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); p = !0) ;
555
- } catch (b) {
556
- c = !0, r = b;
554
+ if (s = (e = e.call(a)).next, t !== 0) for (; !(p = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); p = !0) ;
555
+ } catch (x) {
556
+ c = !0, r = x;
557
557
  } finally {
558
558
  try {
559
559
  if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
@@ -564,163 +564,172 @@ function lr(i, t) {
564
564
  return o;
565
565
  }
566
566
  }
567
- h(lr, "_iterableToArrayLimit");
568
- function or() {
567
+ h(or, "_iterableToArrayLimit");
568
+ function cr() {
569
569
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
570
570
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
571
571
  }
572
- h(or, "_nonIterableRest");
573
- function cr(i, t) {
574
- return ar(i) || lr(i, t) || ur(i, t) || or();
572
+ h(cr, "_nonIterableRest");
573
+ function ur(a, t) {
574
+ return lr(a) || or(a, t) || hr(a, t) || cr();
575
575
  }
576
- h(cr, "_slicedToArray");
577
- function ur(i, t) {
578
- if (i) {
579
- if (typeof i == "string") return Vn(i, t);
580
- var e = {}.toString.call(i).slice(8, -1);
581
- return e === "Object" && i.constructor && (e = i.constructor.name), e === "Map" || e === "Set" ? Array.from(i) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Vn(i, t) : void 0;
576
+ h(ur, "_slicedToArray");
577
+ function hr(a, t) {
578
+ if (a) {
579
+ if (typeof a == "string") return Yn(a, t);
580
+ var e = {}.toString.call(a).slice(8, -1);
581
+ return e === "Object" && a.constructor && (e = a.constructor.name), e === "Map" || e === "Set" ? Array.from(a) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Yn(a, t) : void 0;
582
582
  }
583
583
  }
584
- h(ur, "_unsupportedIterableToArray");
585
- const ks = Object.entries, Yn = Object.setPrototypeOf, hr = Object.isFrozen, pr = Object.getPrototypeOf, dr = Object.getOwnPropertyDescriptor;
586
- let se = Object.freeze, le = Object.seal, Ye = Object.create, ys = typeof Reflect < "u" && Reflect, sn = ys.apply, rn = ys.construct;
587
- se || (se = /* @__PURE__ */ h(function(t) {
584
+ h(hr, "_unsupportedIterableToArray");
585
+ const ys = Object.entries, Zn = Object.setPrototypeOf, pr = Object.isFrozen, dr = Object.getPrototypeOf, fr = Object.getOwnPropertyDescriptor;
586
+ let ie = Object.freeze, oe = Object.seal, Xe = Object.create, ws = typeof Reflect < "u" && Reflect, rn = ws.apply, an = ws.construct;
587
+ ie || (ie = /* @__PURE__ */ h(function(t) {
588
588
  return t;
589
589
  }, "freeze"));
590
- le || (le = /* @__PURE__ */ h(function(t) {
590
+ oe || (oe = /* @__PURE__ */ h(function(t) {
591
591
  return t;
592
592
  }, "seal"));
593
- sn || (sn = /* @__PURE__ */ h(function(t, e) {
593
+ rn || (rn = /* @__PURE__ */ h(function(t, e) {
594
594
  for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
595
595
  r[s - 2] = arguments[s];
596
596
  return t.apply(e, r);
597
597
  }, "apply"));
598
- rn || (rn = /* @__PURE__ */ h(function(t) {
598
+ an || (an = /* @__PURE__ */ h(function(t) {
599
599
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
600
600
  n[r - 1] = arguments[r];
601
601
  return new t(...n);
602
602
  }, "construct"));
603
- const je = G(Array.prototype.forEach), fr = G(Array.prototype.lastIndexOf), Zn = G(Array.prototype.pop), Ge = G(Array.prototype.push), gr = G(Array.prototype.splice), ne = Array.isArray, ct = G(String.prototype.toLowerCase), Kt = G(String.prototype.toString), Xn = G(String.prototype.match), We = G(String.prototype.replace), Kn = G(String.prototype.indexOf), mr = G(String.prototype.trim), xr = G(Number.prototype.toString), br = G(Boolean.prototype.toString), Qn = typeof BigInt > "u" ? null : G(BigInt.prototype.toString), Jn = typeof Symbol > "u" ? null : G(Symbol.prototype.toString), F = G(Object.prototype.hasOwnProperty), lt = G(Object.prototype.toString), K = G(RegExp.prototype.test), St = kr(TypeError);
604
- function G(i) {
603
+ const qe = V(Array.prototype.forEach), gr = V(Array.prototype.lastIndexOf), Xn = V(Array.prototype.pop), Ve = V(Array.prototype.push), mr = V(Array.prototype.splice), re = Array.isArray, pt = V(String.prototype.toLowerCase), Qt = V(String.prototype.toString), Kn = V(String.prototype.match), Ye = V(String.prototype.replace), Qn = V(String.prototype.indexOf), br = V(String.prototype.trim), xr = V(Number.prototype.toString), kr = V(Boolean.prototype.toString), Jn = typeof BigInt > "u" ? null : V(BigInt.prototype.toString), es = typeof Symbol > "u" ? null : V(Symbol.prototype.toString), H = V(Object.prototype.hasOwnProperty), ct = V(Object.prototype.toString), J = V(RegExp.prototype.test), ut = yr(TypeError);
604
+ function V(a) {
605
605
  return function(t) {
606
606
  t instanceof RegExp && (t.lastIndex = 0);
607
607
  for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
608
608
  n[r - 1] = arguments[r];
609
- return sn(i, t, n);
609
+ return rn(a, t, n);
610
610
  };
611
611
  }
612
- h(G, "unapply");
613
- function kr(i) {
612
+ h(V, "unapply");
613
+ function yr(a) {
614
614
  return function() {
615
615
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
616
616
  e[n] = arguments[n];
617
- return rn(i, e);
617
+ return an(a, e);
618
618
  };
619
619
  }
620
- h(kr, "unconstruct");
621
- function R(i, t) {
622
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct;
623
- if (Yn && Yn(i, null), !ne(t))
624
- return i;
620
+ h(yr, "unconstruct");
621
+ function R(a, t) {
622
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : pt;
623
+ if (Zn && Zn(a, null), !re(t))
624
+ return a;
625
625
  let n = t.length;
626
626
  for (; n--; ) {
627
627
  let r = t[n];
628
628
  if (typeof r == "string") {
629
629
  const s = e(r);
630
- s !== r && (hr(t) || (t[n] = s), r = s);
630
+ s !== r && (pr(t) || (t[n] = s), r = s);
631
631
  }
632
- i[r] = !0;
632
+ a[r] = !0;
633
633
  }
634
- return i;
634
+ return a;
635
635
  }
636
636
  h(R, "addToSet");
637
- function yr(i) {
638
- for (let t = 0; t < i.length; t++)
639
- F(i, t) || (i[t] = null);
640
- return i;
637
+ function wr(a) {
638
+ for (let t = 0; t < a.length; t++)
639
+ H(a, t) || (a[t] = null);
640
+ return a;
641
641
  }
642
- h(yr, "cleanArray");
643
- function ae(i) {
644
- const t = Ye(null);
645
- for (const n of ks(i)) {
646
- var e = cr(n, 2);
642
+ h(wr, "cleanArray");
643
+ function te(a) {
644
+ const t = Xe(null);
645
+ for (const n of ys(a)) {
646
+ var e = ur(n, 2);
647
647
  const r = e[0], s = e[1];
648
- F(i, r) && (ne(s) ? t[r] = yr(s) : s && typeof s == "object" && s.constructor === Object ? t[r] = ae(s) : t[r] = s);
648
+ H(a, r) && (re(s) ? t[r] = wr(s) : s && typeof s == "object" && s.constructor === Object ? t[r] = te(s) : t[r] = s);
649
649
  }
650
650
  return t;
651
651
  }
652
- h(ae, "clone");
653
- function wr(i) {
654
- switch (typeof i) {
652
+ h(te, "clone");
653
+ function vr(a) {
654
+ switch (typeof a) {
655
655
  case "string":
656
- return i;
656
+ return a;
657
657
  case "number":
658
- return xr(i);
658
+ return xr(a);
659
659
  case "boolean":
660
- return br(i);
660
+ return kr(a);
661
661
  case "bigint":
662
- return Qn ? Qn(i) : "0";
662
+ return Jn ? Jn(a) : "0";
663
663
  case "symbol":
664
- return Jn ? Jn(i) : "Symbol()";
664
+ return es ? es(a) : "Symbol()";
665
665
  case "undefined":
666
- return lt(i);
666
+ return ct(a);
667
667
  case "function":
668
668
  case "object": {
669
- if (i === null)
670
- return lt(i);
671
- const t = i, e = Ce(t, "toString");
669
+ if (a === null)
670
+ return ct(a);
671
+ const t = a, e = xe(t, "toString");
672
672
  if (typeof e == "function") {
673
673
  const n = e(t);
674
- return typeof n == "string" ? n : lt(n);
674
+ return typeof n == "string" ? n : ct(n);
675
675
  }
676
- return lt(i);
676
+ return ct(a);
677
677
  }
678
678
  default:
679
- return lt(i);
679
+ return ct(a);
680
680
  }
681
681
  }
682
- h(wr, "stringifyValue");
683
- function Ce(i, t) {
684
- for (; i !== null; ) {
685
- const n = dr(i, t);
682
+ h(vr, "stringifyValue");
683
+ function xe(a, t) {
684
+ for (; a !== null; ) {
685
+ const n = fr(a, t);
686
686
  if (n) {
687
687
  if (n.get)
688
- return G(n.get);
688
+ return V(n.get);
689
689
  if (typeof n.value == "function")
690
- return G(n.value);
690
+ return V(n.value);
691
691
  }
692
- i = pr(i);
692
+ a = dr(a);
693
693
  }
694
694
  function e() {
695
695
  return null;
696
696
  }
697
697
  return h(e, "fallbackValue"), e;
698
698
  }
699
- h(Ce, "lookupGetter");
700
- function vr(i) {
699
+ h(xe, "lookupGetter");
700
+ function Tr(a) {
701
701
  try {
702
- return K(i, ""), !0;
702
+ return J(a, ""), !0;
703
703
  } catch {
704
704
  return !1;
705
705
  }
706
706
  }
707
- h(vr, "isRegex");
708
- const es = se(["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 = se(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Jt = se(["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"]), Tr = se(["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"]), en = se(["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"]), Sr = se(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ts = se(["#text"]), ns = se(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), tn = se(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), ss = se(["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"]), At = se(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ar = le(/{{[\w\W]*|^[\w\W]*}}/g), Er = le(/<%[\w\W]*|^[\w\W]*%>/g), _r = le(/\${[\w\W]*/g), Rr = le(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ir = le(/^aria-[\-\w]+$/), rs = le(
707
+ h(Tr, "isRegex");
708
+ const ts = ie(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Jt = ie(["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"]), en = ie(["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"]), Sr = ie(["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"]), tn = ie(["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"]), Ar = ie(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ns = ie(["#text"]), ss = ie(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), nn = ie(["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"]), rs = ie(["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"]), Rt = ie(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Er = oe(/{{[\w\W]*|^[\w\W]*}}/g), _r = oe(/<%[\w\W]*|^[\w\W]*%>/g), Rr = oe(/\${[\w\W]*/g), Ir = oe(/^data-[\-\w.\u00B7-\uFFFF]+$/), Cr = oe(/^aria-[\-\w]+$/), is = oe(
709
709
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
710
710
  // eslint-disable-line no-useless-escape
711
- ), Cr = le(/^(?:\w+script|data):/i), Dr = le(
711
+ ), Dr = oe(/^(?:\w+script|data):/i), Or = oe(
712
712
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
713
713
  // eslint-disable-line no-control-regex
714
- ), Or = le(/^html$/i), Mr = le(/^[a-z][.\w]*(-[.\w]+)+$/i), qe = {
714
+ ), Mr = oe(/^html$/i), Lr = oe(/^[a-z][.\w]*(-[.\w]+)+$/i), be = {
715
715
  element: 1,
716
+ attribute: 2,
716
717
  text: 3,
718
+ cdataSection: 4,
719
+ entityReference: 5,
720
+ // Deprecated
721
+ entityNode: 6,
717
722
  // Deprecated
718
723
  progressingInstruction: 7,
719
724
  comment: 8,
720
- document: 9
721
- }, Lr = /* @__PURE__ */ h(function() {
725
+ document: 9,
726
+ documentType: 10,
727
+ documentFragment: 11,
728
+ notation: 12
729
+ // Deprecated
730
+ }, Nr = /* @__PURE__ */ h(function() {
722
731
  return typeof window > "u" ? null : window;
723
- }, "getGlobal"), Nr = /* @__PURE__ */ h(function(t, e) {
732
+ }, "getGlobal"), zr = /* @__PURE__ */ h(function(t, e) {
724
733
  if (typeof t != "object" || typeof t.createPolicy != "function")
725
734
  return null;
726
735
  let n = null;
@@ -739,7 +748,7 @@ const es = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
739
748
  } catch {
740
749
  return console.warn("TrustedTypes policy " + s + " could not be created."), null;
741
750
  }
742
- }, "_createTrustedTypesPolicy"), is = /* @__PURE__ */ h(function() {
751
+ }, "_createTrustedTypesPolicy"), as = /* @__PURE__ */ h(function() {
743
752
  return {
744
753
  afterSanitizeAttributes: [],
745
754
  afterSanitizeElements: [],
@@ -752,27 +761,31 @@ const es = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
752
761
  uponSanitizeShadowNode: []
753
762
  };
754
763
  }, "_createHooksMap");
755
- function ws() {
756
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Lr();
757
- const t = /* @__PURE__ */ h((w) => ws(w), "DOMPurify");
758
- if (t.version = "3.4.5", t.removed = [], !i || !i.document || i.document.nodeType !== qe.document || !i.Element)
764
+ function vs() {
765
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Nr();
766
+ const t = /* @__PURE__ */ h((y) => vs(y), "DOMPurify");
767
+ if (t.version = "3.4.7", t.removed = [], !a || !a.document || a.document.nodeType !== be.document || !a.Element)
759
768
  return t.isSupported = !1, t;
760
- let e = i.document;
761
- const n = e, r = n.currentScript, s = i.DocumentFragment, l = i.HTMLTemplateElement, o = i.Node, p = i.Element, c = i.NodeFilter, b = i.NamedNodeMap, d = b === void 0 ? i.NamedNodeMap || i.MozNamedAttrMap : b, m = i.HTMLFormElement, x = i.DOMParser, f = i.trustedTypes, v = p.prototype, C = Ce(v, "cloneNode"), z = Ce(v, "remove"), ee = Ce(v, "nextSibling"), te = Ce(v, "childNodes"), re = Ce(v, "parentNode"), ge = o && o.prototype ? Ce(o.prototype, "nodeType") : null;
762
- if (typeof l == "function") {
763
- const w = e.createElement("template");
764
- w.content && w.content.ownerDocument && (e = w.content.ownerDocument);
765
- }
766
- let $, Y = "";
767
- const me = e, ye = me.implementation, M = me.createNodeIterator, pt = me.createDocumentFragment, tt = me.getElementsByTagName, dt = n.importNode;
768
- let Z = is();
769
- t.isSupported = typeof ks == "function" && typeof re == "function" && ye && ye.createHTMLDocument !== void 0;
770
- const Ne = Ar, ze = Er, $e = _r, zt = Rr, ft = Ir, gt = Cr, I = Dr, k = Mr;
771
- let y = rs, E = null;
772
- const X = R({}, [...es, ...Qt, ...Jt, ...en, ...ts]);
773
- let B = null;
774
- const nt = R({}, [...ns, ...tn, ...ss, ...At]);
775
- let P = Object.seal(Ye(null, {
769
+ let e = a.document;
770
+ const n = e, r = n.currentScript;
771
+ a.DocumentFragment;
772
+ const s = a.HTMLTemplateElement, l = a.Node, o = a.Element, p = a.NodeFilter, c = a.NamedNodeMap;
773
+ c === void 0 && (a.NamedNodeMap || a.MozNamedAttrMap), a.HTMLFormElement;
774
+ const x = a.DOMParser, d = a.trustedTypes, f = o.prototype, b = xe(f, "cloneNode"), g = xe(f, "remove"), A = xe(f, "nextSibling"), I = xe(f, "childNodes"), N = xe(f, "parentNode"), Z = xe(f, "shadowRoot"), se = xe(f, "attributes"), j = l && l.prototype ? xe(l.prototype, "nodeType") : null, ae = l && l.prototype ? xe(l.prototype, "nodeName") : null;
775
+ if (typeof s == "function") {
776
+ const y = e.createElement("template");
777
+ y.content && y.content.ownerDocument && (e = y.content.ownerDocument);
778
+ }
779
+ let B, Q = "";
780
+ const ye = e, Te = ye.implementation, M = ye.createNodeIterator, gt = ye.createDocumentFragment, st = ye.getElementsByTagName, mt = n.importNode;
781
+ let q = as();
782
+ t.isSupported = typeof ys == "function" && typeof N == "function" && Te && Te.createHTMLDocument !== void 0;
783
+ const ze = Er, $e = _r, Pe = Rr, Bt = Ir, bt = Cr, xt = Dr, C = Or, k = Lr;
784
+ let w = is, E = null;
785
+ const X = R({}, [...ts, ...Jt, ...en, ...tn, ...ns]);
786
+ let P = null;
787
+ const Be = R({}, [...ss, ...nn, ...rs, ...Rt]);
788
+ let F = Object.seal(Xe(null, {
776
789
  tagNameCheck: {
777
790
  writable: !0,
778
791
  configurable: !1,
@@ -791,8 +804,8 @@ function ws() {
791
804
  enumerable: !0,
792
805
  value: !1
793
806
  }
794
- })), st = null, mt = null;
795
- const we = Object.seal(Ye(null, {
807
+ })), rt = null, kt = null;
808
+ const Se = Object.seal(Xe(null, {
796
809
  tagCheck: {
797
810
  writable: !0,
798
811
  configurable: !1,
@@ -806,194 +819,226 @@ function ws() {
806
819
  value: null
807
820
  }
808
821
  }));
809
- let bn = !0, $t = !0, kn = !1, yn = !0, ve = !1, rt = !0, Re = !1, Pt = !1, Bt = !1, Pe = !1, xt = !1, bt = !1, wn = !0, vn = !1;
810
- const Tn = "user-content-";
811
- let Ft = !0, it = !1, Be = {}, pe = null;
812
- const Ut = 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"]);
813
- let Sn = null;
814
- const An = R({}, ["audio", "video", "img", "source", "image", "track"]);
815
- let Ht = null;
816
- const En = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), kt = "http://www.w3.org/1998/Math/MathML", yt = "http://www.w3.org/2000/svg", de = "http://www.w3.org/1999/xhtml";
817
- let Fe = de, jt = !1, Gt = null;
818
- const Os = R({}, [kt, yt, de], Kt);
819
- let Wt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), qt = R({}, ["annotation-xml"]);
820
- const Ms = R({}, ["title", "style", "font", "a", "script"]);
821
- let at = null;
822
- const Ls = ["application/xhtml+xml", "text/html"], Ns = "text/html";
823
- let W = null, Ue = null;
824
- const zs = e.createElement("form"), _n = /* @__PURE__ */ h(function(a) {
825
- return a instanceof RegExp || a instanceof Function;
826
- }, "isRegexOrFunction"), Vt = /* @__PURE__ */ h(function() {
827
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
828
- if (Ue && Ue === a)
822
+ let kn = !0, Ft = !0, yn = !1, wn = !0, Ae = !1, it = !0, Ce = !1, Ut = !1, Ht = !1, Fe = !1, yt = !1, wt = !1, vn = !0, Tn = !1;
823
+ const Sn = "user-content-";
824
+ let jt = !0, at = !1, Ue = {}, fe = null;
825
+ const Gt = 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"]);
826
+ let An = null;
827
+ const En = R({}, ["audio", "video", "img", "source", "image", "track"]);
828
+ let Wt = null;
829
+ const _n = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), vt = "http://www.w3.org/1998/Math/MathML", Tt = "http://www.w3.org/2000/svg", ge = "http://www.w3.org/1999/xhtml";
830
+ let He = ge, qt = !1, Vt = null;
831
+ const Ms = R({}, [vt, Tt, ge], Qt);
832
+ let Yt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Zt = R({}, ["annotation-xml"]);
833
+ const Ls = R({}, ["title", "style", "font", "a", "script"]);
834
+ let lt = null;
835
+ const Ns = ["application/xhtml+xml", "text/html"], zs = "text/html";
836
+ let G = null, je = null;
837
+ const $s = e.createElement("form"), Rn = /* @__PURE__ */ h(function(i) {
838
+ return i instanceof RegExp || i instanceof Function;
839
+ }, "isRegexOrFunction"), Xt = /* @__PURE__ */ h(function() {
840
+ let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
841
+ if (je && je === i)
829
842
  return;
830
- (!a || typeof a != "object") && (a = {}), a = ae(a), at = // eslint-disable-next-line unicorn/prefer-includes
831
- Ls.indexOf(a.PARSER_MEDIA_TYPE) === -1 ? Ns : a.PARSER_MEDIA_TYPE, W = at === "application/xhtml+xml" ? Kt : ct, E = F(a, "ALLOWED_TAGS") && ne(a.ALLOWED_TAGS) ? R({}, a.ALLOWED_TAGS, W) : X, B = F(a, "ALLOWED_ATTR") && ne(a.ALLOWED_ATTR) ? R({}, a.ALLOWED_ATTR, W) : nt, Gt = F(a, "ALLOWED_NAMESPACES") && ne(a.ALLOWED_NAMESPACES) ? R({}, a.ALLOWED_NAMESPACES, Kt) : Os, Ht = F(a, "ADD_URI_SAFE_ATTR") && ne(a.ADD_URI_SAFE_ATTR) ? R(ae(En), a.ADD_URI_SAFE_ATTR, W) : En, Sn = F(a, "ADD_DATA_URI_TAGS") && ne(a.ADD_DATA_URI_TAGS) ? R(ae(An), a.ADD_DATA_URI_TAGS, W) : An, pe = F(a, "FORBID_CONTENTS") && ne(a.FORBID_CONTENTS) ? R({}, a.FORBID_CONTENTS, W) : Ut, st = F(a, "FORBID_TAGS") && ne(a.FORBID_TAGS) ? R({}, a.FORBID_TAGS, W) : ae({}), mt = F(a, "FORBID_ATTR") && ne(a.FORBID_ATTR) ? R({}, a.FORBID_ATTR, W) : ae({}), Be = F(a, "USE_PROFILES") ? a.USE_PROFILES && typeof a.USE_PROFILES == "object" ? ae(a.USE_PROFILES) : a.USE_PROFILES : !1, bn = a.ALLOW_ARIA_ATTR !== !1, $t = a.ALLOW_DATA_ATTR !== !1, kn = a.ALLOW_UNKNOWN_PROTOCOLS || !1, yn = a.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ve = a.SAFE_FOR_TEMPLATES || !1, rt = a.SAFE_FOR_XML !== !1, Re = a.WHOLE_DOCUMENT || !1, Pe = a.RETURN_DOM || !1, xt = a.RETURN_DOM_FRAGMENT || !1, bt = a.RETURN_TRUSTED_TYPE || !1, Bt = a.FORCE_BODY || !1, wn = a.SANITIZE_DOM !== !1, vn = a.SANITIZE_NAMED_PROPS || !1, Ft = a.KEEP_CONTENT !== !1, it = a.IN_PLACE || !1, y = vr(a.ALLOWED_URI_REGEXP) ? a.ALLOWED_URI_REGEXP : rs, Fe = typeof a.NAMESPACE == "string" ? a.NAMESPACE : de, Wt = F(a, "MATHML_TEXT_INTEGRATION_POINTS") && a.MATHML_TEXT_INTEGRATION_POINTS && typeof a.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ae(a.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), qt = F(a, "HTML_INTEGRATION_POINTS") && a.HTML_INTEGRATION_POINTS && typeof a.HTML_INTEGRATION_POINTS == "object" ? ae(a.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
832
- const u = F(a, "CUSTOM_ELEMENT_HANDLING") && a.CUSTOM_ELEMENT_HANDLING && typeof a.CUSTOM_ELEMENT_HANDLING == "object" ? ae(a.CUSTOM_ELEMENT_HANDLING) : Ye(null);
833
- if (P = Ye(null), F(u, "tagNameCheck") && _n(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), F(u, "attributeNameCheck") && _n(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), F(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), ve && ($t = !1), xt && (Pe = !0), Be && (E = R({}, ts), B = Ye(null), Be.html === !0 && (R(E, es), R(B, ns)), Be.svg === !0 && (R(E, Qt), R(B, tn), R(B, At)), Be.svgFilters === !0 && (R(E, Jt), R(B, tn), R(B, At)), Be.mathMl === !0 && (R(E, en), R(B, ss), R(B, At))), we.tagCheck = null, we.attributeCheck = null, F(a, "ADD_TAGS") && (typeof a.ADD_TAGS == "function" ? we.tagCheck = a.ADD_TAGS : ne(a.ADD_TAGS) && (E === X && (E = ae(E)), R(E, a.ADD_TAGS, W))), F(a, "ADD_ATTR") && (typeof a.ADD_ATTR == "function" ? we.attributeCheck = a.ADD_ATTR : ne(a.ADD_ATTR) && (B === nt && (B = ae(B)), R(B, a.ADD_ATTR, W))), F(a, "ADD_URI_SAFE_ATTR") && ne(a.ADD_URI_SAFE_ATTR) && R(Ht, a.ADD_URI_SAFE_ATTR, W), F(a, "FORBID_CONTENTS") && ne(a.FORBID_CONTENTS) && (pe === Ut && (pe = ae(pe)), R(pe, a.FORBID_CONTENTS, W)), F(a, "ADD_FORBID_CONTENTS") && ne(a.ADD_FORBID_CONTENTS) && (pe === Ut && (pe = ae(pe)), R(pe, a.ADD_FORBID_CONTENTS, W)), Ft && (E["#text"] = !0), Re && R(E, ["html", "head", "body"]), E.table && (R(E, ["tbody"]), delete st.tbody), a.TRUSTED_TYPES_POLICY) {
834
- if (typeof a.TRUSTED_TYPES_POLICY.createHTML != "function")
835
- throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
836
- if (typeof a.TRUSTED_TYPES_POLICY.createScriptURL != "function")
837
- throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
838
- $ = a.TRUSTED_TYPES_POLICY, Y = $.createHTML("");
843
+ (!i || typeof i != "object") && (i = {}), i = te(i), lt = // eslint-disable-next-line unicorn/prefer-includes
844
+ Ns.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? zs : i.PARSER_MEDIA_TYPE, G = lt === "application/xhtml+xml" ? Qt : pt, E = H(i, "ALLOWED_TAGS") && re(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, G) : X, P = H(i, "ALLOWED_ATTR") && re(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, G) : Be, Vt = H(i, "ALLOWED_NAMESPACES") && re(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Qt) : Ms, Wt = H(i, "ADD_URI_SAFE_ATTR") && re(i.ADD_URI_SAFE_ATTR) ? R(te(_n), i.ADD_URI_SAFE_ATTR, G) : _n, An = H(i, "ADD_DATA_URI_TAGS") && re(i.ADD_DATA_URI_TAGS) ? R(te(En), i.ADD_DATA_URI_TAGS, G) : En, fe = H(i, "FORBID_CONTENTS") && re(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, G) : Gt, rt = H(i, "FORBID_TAGS") && re(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, G) : te({}), kt = H(i, "FORBID_ATTR") && re(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, G) : te({}), Ue = H(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? te(i.USE_PROFILES) : i.USE_PROFILES : !1, kn = i.ALLOW_ARIA_ATTR !== !1, Ft = i.ALLOW_DATA_ATTR !== !1, yn = i.ALLOW_UNKNOWN_PROTOCOLS || !1, wn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ae = i.SAFE_FOR_TEMPLATES || !1, it = i.SAFE_FOR_XML !== !1, Ce = i.WHOLE_DOCUMENT || !1, Fe = i.RETURN_DOM || !1, yt = i.RETURN_DOM_FRAGMENT || !1, wt = i.RETURN_TRUSTED_TYPE || !1, Ht = i.FORCE_BODY || !1, vn = i.SANITIZE_DOM !== !1, Tn = i.SANITIZE_NAMED_PROPS || !1, jt = i.KEEP_CONTENT !== !1, at = i.IN_PLACE || !1, w = Tr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : is, He = typeof i.NAMESPACE == "string" ? i.NAMESPACE : ge, Yt = H(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? te(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Zt = H(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? te(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
845
+ const u = H(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? te(i.CUSTOM_ELEMENT_HANDLING) : Xe(null);
846
+ if (F = Xe(null), H(u, "tagNameCheck") && Rn(u.tagNameCheck) && (F.tagNameCheck = u.tagNameCheck), H(u, "attributeNameCheck") && Rn(u.attributeNameCheck) && (F.attributeNameCheck = u.attributeNameCheck), H(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (F.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), Ae && (Ft = !1), yt && (Fe = !0), Ue && (E = R({}, ns), P = Xe(null), Ue.html === !0 && (R(E, ts), R(P, ss)), Ue.svg === !0 && (R(E, Jt), R(P, nn), R(P, Rt)), Ue.svgFilters === !0 && (R(E, en), R(P, nn), R(P, Rt)), Ue.mathMl === !0 && (R(E, tn), R(P, rs), R(P, Rt))), Se.tagCheck = null, Se.attributeCheck = null, H(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? Se.tagCheck = i.ADD_TAGS : re(i.ADD_TAGS) && (E === X && (E = te(E)), R(E, i.ADD_TAGS, G))), H(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? Se.attributeCheck = i.ADD_ATTR : re(i.ADD_ATTR) && (P === Be && (P = te(P)), R(P, i.ADD_ATTR, G))), H(i, "ADD_URI_SAFE_ATTR") && re(i.ADD_URI_SAFE_ATTR) && R(Wt, i.ADD_URI_SAFE_ATTR, G), H(i, "FORBID_CONTENTS") && re(i.FORBID_CONTENTS) && (fe === Gt && (fe = te(fe)), R(fe, i.FORBID_CONTENTS, G)), H(i, "ADD_FORBID_CONTENTS") && re(i.ADD_FORBID_CONTENTS) && (fe === Gt && (fe = te(fe)), R(fe, i.ADD_FORBID_CONTENTS, G)), jt && (E["#text"] = !0), Ce && R(E, ["html", "head", "body"]), E.table && (R(E, ["tbody"]), delete rt.tbody), i.TRUSTED_TYPES_POLICY) {
847
+ if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
848
+ throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
849
+ if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
850
+ throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
851
+ B = i.TRUSTED_TYPES_POLICY, Q = B.createHTML("");
839
852
  } else
840
- $ === void 0 && ($ = Nr(f, r)), $ !== null && typeof Y == "string" && (Y = $.createHTML(""));
841
- se && se(a), Ue = a;
842
- }, "_parseConfig"), Rn = R({}, [...Qt, ...Jt, ...Tr]), In = R({}, [...en, ...Sr]), $s = /* @__PURE__ */ h(function(a) {
843
- let u = re(a);
853
+ B === void 0 && (B = zr(d, r)), B !== null && typeof Q == "string" && (Q = B.createHTML(""));
854
+ (q.uponSanitizeElement.length > 0 || q.uponSanitizeAttribute.length > 0) && E === X && (E = te(E)), q.uponSanitizeAttribute.length > 0 && P === Be && (P = te(P)), ie && ie(i), je = i;
855
+ }, "_parseConfig"), In = R({}, [...Jt, ...en, ...Sr]), Cn = R({}, [...tn, ...Ar]), Ps = /* @__PURE__ */ h(function(i) {
856
+ let u = N(i);
844
857
  (!u || !u.tagName) && (u = {
845
- namespaceURI: Fe,
858
+ namespaceURI: He,
846
859
  tagName: "template"
847
860
  });
848
- const g = ct(a.tagName), D = ct(u.tagName);
849
- return Gt[a.namespaceURI] ? a.namespaceURI === yt ? u.namespaceURI === de ? g === "svg" : u.namespaceURI === kt ? g === "svg" && (D === "annotation-xml" || Wt[D]) : !!Rn[g] : a.namespaceURI === kt ? u.namespaceURI === de ? g === "math" : u.namespaceURI === yt ? g === "math" && qt[D] : !!In[g] : a.namespaceURI === de ? u.namespaceURI === yt && !qt[D] || u.namespaceURI === kt && !Wt[D] ? !1 : !In[g] && (Ms[g] || !Rn[g]) : !!(at === "application/xhtml+xml" && Gt[a.namespaceURI]) : !1;
850
- }, "_checkValidNamespace"), oe = /* @__PURE__ */ h(function(a) {
851
- Ge(t.removed, {
852
- element: a
861
+ const m = pt(i.tagName), $ = pt(u.tagName);
862
+ return Vt[i.namespaceURI] ? i.namespaceURI === Tt ? u.namespaceURI === ge ? m === "svg" : u.namespaceURI === vt ? m === "svg" && ($ === "annotation-xml" || Yt[$]) : !!In[m] : i.namespaceURI === vt ? u.namespaceURI === ge ? m === "math" : u.namespaceURI === Tt ? m === "math" && Zt[$] : !!Cn[m] : i.namespaceURI === ge ? u.namespaceURI === Tt && !Zt[$] || u.namespaceURI === vt && !Yt[$] ? !1 : !Cn[m] && (Ls[m] || !In[m]) : !!(lt === "application/xhtml+xml" && Vt[i.namespaceURI]) : !1;
863
+ }, "_checkValidNamespace"), ce = /* @__PURE__ */ h(function(i) {
864
+ Ve(t.removed, {
865
+ element: i
853
866
  });
854
867
  try {
855
- re(a).removeChild(a);
868
+ N(i).removeChild(i);
856
869
  } catch {
857
- z(a);
870
+ g(i);
858
871
  }
859
- }, "_forceRemove"), Ie = /* @__PURE__ */ h(function(a, u) {
872
+ }, "_forceRemove"), De = /* @__PURE__ */ h(function(i, u) {
860
873
  try {
861
- Ge(t.removed, {
862
- attribute: u.getAttributeNode(a),
874
+ Ve(t.removed, {
875
+ attribute: u.getAttributeNode(i),
863
876
  from: u
864
877
  });
865
878
  } catch {
866
- Ge(t.removed, {
879
+ Ve(t.removed, {
867
880
  attribute: null,
868
881
  from: u
869
882
  });
870
883
  }
871
- if (u.removeAttribute(a), a === "is")
872
- if (Pe || xt)
884
+ if (u.removeAttribute(i), i === "is")
885
+ if (Fe || yt)
873
886
  try {
874
- oe(u);
887
+ ce(u);
875
888
  } catch {
876
889
  }
877
890
  else
878
891
  try {
879
- u.setAttribute(a, "");
892
+ u.setAttribute(i, "");
880
893
  } catch {
881
894
  }
882
- }, "_removeAttribute"), Cn = /* @__PURE__ */ h(function(a) {
883
- let u = null, g = null;
884
- if (Bt)
885
- a = "<remove></remove>" + a;
895
+ }, "_removeAttribute"), Dn = /* @__PURE__ */ h(function(i) {
896
+ let u = null, m = null;
897
+ if (Ht)
898
+ i = "<remove></remove>" + i;
886
899
  else {
887
- const j = Xn(a, /^[\r\n\t ]+/);
888
- g = j && j[0];
900
+ const U = Kn(i, /^[\r\n\t ]+/);
901
+ m = U && U[0];
889
902
  }
890
- at === "application/xhtml+xml" && Fe === de && (a = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + a + "</body></html>");
891
- const D = $ ? $.createHTML(a) : a;
892
- if (Fe === de)
903
+ lt === "application/xhtml+xml" && He === ge && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
904
+ const $ = B ? B.createHTML(i) : i;
905
+ if (He === ge)
893
906
  try {
894
- u = new x().parseFromString(D, at);
907
+ u = new x().parseFromString($, lt);
895
908
  } catch {
896
909
  }
897
910
  if (!u || !u.documentElement) {
898
- u = ye.createDocument(Fe, "template", null);
911
+ u = Te.createDocument(He, "template", null);
899
912
  try {
900
- u.documentElement.innerHTML = jt ? Y : D;
913
+ u.documentElement.innerHTML = qt ? Q : $;
901
914
  } catch {
902
915
  }
903
916
  }
904
- const H = u.body || u.documentElement;
905
- return a && g && H.insertBefore(e.createTextNode(g), H.childNodes[0] || null), Fe === de ? tt.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : H;
906
- }, "_initDocument"), Dn = /* @__PURE__ */ h(function(a) {
917
+ const D = u.body || u.documentElement;
918
+ return i && m && D.insertBefore(e.createTextNode(m), D.childNodes[0] || null), He === ge ? st.call(u, Ce ? "html" : "body")[0] : Ce ? u.documentElement : D;
919
+ }, "_initDocument"), On = /* @__PURE__ */ h(function(i) {
907
920
  return M.call(
908
- a.ownerDocument || a,
909
- a,
921
+ i.ownerDocument || i,
922
+ i,
910
923
  // eslint-disable-next-line no-bitwise
911
- c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
924
+ p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
912
925
  null
913
926
  );
914
- }, "_createNodeIterator"), On = /* @__PURE__ */ h(function(a) {
915
- a.normalize();
927
+ }, "_createNodeIterator"), Mn = /* @__PURE__ */ h(function(i) {
928
+ i.normalize();
916
929
  const u = M.call(
917
- a.ownerDocument || a,
918
- a,
930
+ i.ownerDocument || i,
931
+ i,
919
932
  // eslint-disable-next-line no-bitwise
920
- c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION,
933
+ p.SHOW_TEXT | p.SHOW_COMMENT | p.SHOW_CDATA_SECTION | p.SHOW_PROCESSING_INSTRUCTION,
921
934
  null
922
935
  );
923
- let g = u.nextNode();
924
- for (; g; ) {
925
- let D = g.data;
926
- je([Ne, ze, $e], (H) => {
927
- D = We(D, H, " ");
928
- }), g.data = D, g = u.nextNode();
929
- }
930
- }, "_scrubTemplateExpressions"), Yt = /* @__PURE__ */ h(function(a) {
931
- return a instanceof m && (typeof a.nodeName != "string" || typeof a.textContent != "string" || typeof a.removeChild != "function" || !(a.attributes instanceof d) || typeof a.removeAttribute != "function" || typeof a.setAttribute != "function" || typeof a.namespaceURI != "string" || typeof a.insertBefore != "function" || typeof a.hasChildNodes != "function");
932
- }, "_isClobbered"), wt = /* @__PURE__ */ h(function(a) {
933
- if (!ge || typeof a != "object" || a === null)
936
+ let m = u.nextNode();
937
+ for (; m; ) {
938
+ let $ = m.data;
939
+ qe([ze, $e, Pe], (D) => {
940
+ $ = Ye($, D, " ");
941
+ }), m.data = $, m = u.nextNode();
942
+ }
943
+ }, "_scrubTemplateExpressions"), St = /* @__PURE__ */ h(function(i) {
944
+ const u = ae ? ae(i) : null;
945
+ return typeof u != "string" || G(u) !== "form" ? !1 : typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || // Realm-safe NamedNodeMap detection: equality against the cached
946
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
947
+ // makes the direct read diverge from the cached read; a clean form
948
+ // (same-realm OR foreign-realm) has both reads pointing at the same
949
+ // canonical NamedNodeMap.
950
+ i.attributes !== se(i) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function" || // NodeType clobbering probe. Cached Node.prototype.nodeType getter
951
+ // returns the integer 1 for any Element regardless of realm; direct
952
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
953
+ // the named child element. Cheap addition — nodeType is read from
954
+ // an internal slot, no serialization cost — and removes a residual
955
+ // clobbering surface used by several mXSS / PI / comment branches
956
+ // in _sanitizeElements that compare currentNode.nodeType directly.
957
+ i.nodeType !== j(i) || // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
958
+ // "childNodes" shadows the prototype getter. Direct reads of
959
+ // form.childNodes from a clobbered form return the named child
960
+ // instead of the real NodeList, so any walk that reads it directly
961
+ // skips the form's real children. Compare the direct read to the
962
+ // cached Node.prototype getter — when the form's named-property
963
+ // getter intercepts the read, the two values differ and we flag
964
+ // the form. This catches every clobbering child type (input,
965
+ // select, etc.) regardless of whether the named child happens to
966
+ // carry a numeric .length, which a typeof-based probe would miss
967
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
968
+ i.childNodes !== I(i);
969
+ }, "_isClobbered"), ot = /* @__PURE__ */ h(function(i) {
970
+ if (!j || typeof i != "object" || i === null)
934
971
  return !1;
935
972
  try {
936
- return typeof ge(a) == "number";
973
+ return j(i) === be.documentFragment;
974
+ } catch {
975
+ return !1;
976
+ }
977
+ }, "_isDocumentFragment"), At = /* @__PURE__ */ h(function(i) {
978
+ if (!j || typeof i != "object" || i === null)
979
+ return !1;
980
+ try {
981
+ return typeof j(i) == "number";
937
982
  } catch {
938
983
  return !1;
939
984
  }
940
985
  }, "_isNode");
941
- function xe(w, a, u) {
942
- je(w, (g) => {
943
- g.call(t, a, u, Ue);
986
+ function we(y, i, u) {
987
+ qe(y, (m) => {
988
+ m.call(t, i, u, je);
944
989
  });
945
990
  }
946
- h(xe, "_executeHooks");
947
- const Mn = /* @__PURE__ */ h(function(a) {
991
+ h(we, "_executeHooks");
992
+ const Ln = /* @__PURE__ */ h(function(i) {
948
993
  let u = null;
949
- if (xe(Z.beforeSanitizeElements, a, null), Yt(a))
950
- return oe(a), !0;
951
- const g = W(a.nodeName);
952
- if (xe(Z.uponSanitizeElement, a, {
953
- tagName: g,
994
+ if (we(q.beforeSanitizeElements, i, null), St(i))
995
+ return ce(i), !0;
996
+ const m = G(i.nodeName);
997
+ if (we(q.uponSanitizeElement, i, {
998
+ tagName: m,
954
999
  allowedTags: E
955
- }), rt && a.hasChildNodes() && !wt(a.firstElementChild) && K(/<[/\w!]/g, a.innerHTML) && K(/<[/\w!]/g, a.textContent) || rt && a.namespaceURI === de && g === "style" && wt(a.firstElementChild) || a.nodeType === qe.progressingInstruction || rt && a.nodeType === qe.comment && K(/<[/\w]/g, a.data))
956
- return oe(a), !0;
957
- if (st[g] || !(we.tagCheck instanceof Function && we.tagCheck(g)) && !E[g]) {
958
- if (!st[g] && Nn(g) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
1000
+ }), it && i.hasChildNodes() && !At(i.firstElementChild) && J(/<[/\w!]/g, i.innerHTML) && J(/<[/\w!]/g, i.textContent) || it && i.namespaceURI === ge && m === "style" && At(i.firstElementChild) || i.nodeType === be.progressingInstruction || it && i.nodeType === be.comment && J(/<[/\w]/g, i.data))
1001
+ return ce(i), !0;
1002
+ if (rt[m] || !(Se.tagCheck instanceof Function && Se.tagCheck(m)) && !E[m]) {
1003
+ if (!rt[m] && zn(m) && (F.tagNameCheck instanceof RegExp && J(F.tagNameCheck, m) || F.tagNameCheck instanceof Function && F.tagNameCheck(m)))
959
1004
  return !1;
960
- if (Ft && !pe[g]) {
961
- const D = re(a) || a.parentNode, H = te(a) || a.childNodes;
962
- if (H && D) {
963
- const j = H.length;
964
- for (let ie = j - 1; ie >= 0; --ie) {
965
- const Te = C(H[ie], !0);
966
- D.insertBefore(Te, ee(a));
1005
+ if (jt && !fe[m]) {
1006
+ const D = N(i), U = I(i);
1007
+ if (U && D) {
1008
+ const le = U.length;
1009
+ for (let me = le - 1; me >= 0; --me) {
1010
+ const ue = b(U[me], !0);
1011
+ D.insertBefore(ue, A(i));
967
1012
  }
968
1013
  }
969
1014
  }
970
- return oe(a), !0;
1015
+ return ce(i), !0;
971
1016
  }
972
- return a instanceof p && !$s(a) || (g === "noscript" || g === "noembed" || g === "noframes") && K(/<\/no(script|embed|frames)/i, a.innerHTML) ? (oe(a), !0) : (ve && a.nodeType === qe.text && (u = a.textContent, je([Ne, ze, $e], (D) => {
973
- u = We(u, D, " ");
974
- }), a.textContent !== u && (Ge(t.removed, {
975
- element: a.cloneNode()
976
- }), a.textContent = u)), xe(Z.afterSanitizeElements, a, null), !1);
977
- }, "_sanitizeElements"), Ln = /* @__PURE__ */ h(function(a, u, g) {
978
- if (mt[u] || wn && (u === "id" || u === "name") && (g in e || g in zs))
1017
+ return (j ? j(i) : i.nodeType) === be.element && !Ps(i) || (m === "noscript" || m === "noembed" || m === "noframes") && J(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ce(i), !0) : (Ae && i.nodeType === be.text && (u = i.textContent, qe([ze, $e, Pe], (D) => {
1018
+ u = Ye(u, D, " ");
1019
+ }), i.textContent !== u && (Ve(t.removed, {
1020
+ element: i.cloneNode()
1021
+ }), i.textContent = u)), we(q.afterSanitizeElements, i, null), !1);
1022
+ }, "_sanitizeElements"), Nn = /* @__PURE__ */ h(function(i, u, m) {
1023
+ if (kt[u] || vn && (u === "id" || u === "name") && (m in e || m in $s))
979
1024
  return !1;
980
- const D = B[u] || we.attributeCheck instanceof Function && we.attributeCheck(u, a);
981
- if (!($t && !mt[u] && K(zt, u))) {
982
- if (!(bn && K(ft, u))) {
983
- if (!D || mt[u]) {
1025
+ const $ = P[u] || Se.attributeCheck instanceof Function && Se.attributeCheck(u, i);
1026
+ if (!(Ft && !kt[u] && J(Bt, u))) {
1027
+ if (!(kn && J(bt, u))) {
1028
+ if (!$ || kt[u]) {
984
1029
  if (
985
1030
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
986
1031
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
987
1032
  // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
988
- !(Nn(a) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, a) || P.tagNameCheck instanceof Function && P.tagNameCheck(a)) && (P.attributeNameCheck instanceof RegExp && K(P.attributeNameCheck, u) || P.attributeNameCheck instanceof Function && P.attributeNameCheck(u, a)) || // Alternative, second condition checks if it's an `is`-attribute, AND
1033
+ !(zn(i) && (F.tagNameCheck instanceof RegExp && J(F.tagNameCheck, i) || F.tagNameCheck instanceof Function && F.tagNameCheck(i)) && (F.attributeNameCheck instanceof RegExp && J(F.attributeNameCheck, u) || F.attributeNameCheck instanceof Function && F.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
989
1034
  // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
990
- u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
1035
+ u === "is" && F.allowCustomizedBuiltInElements && (F.tagNameCheck instanceof RegExp && J(F.tagNameCheck, m) || F.tagNameCheck instanceof Function && F.tagNameCheck(m)))
991
1036
  ) return !1;
992
- } else if (!Ht[u]) {
993
- if (!K(y, We(g, I, ""))) {
994
- if (!((u === "src" || u === "xlink:href" || u === "href") && a !== "script" && Kn(g, "data:") === 0 && Sn[a])) {
995
- if (!(kn && !K(gt, We(g, I, "")))) {
996
- if (g)
1037
+ } else if (!Wt[u]) {
1038
+ if (!J(w, Ye(m, C, ""))) {
1039
+ if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Qn(m, "data:") === 0 && An[i])) {
1040
+ if (!(yn && !J(xt, Ye(m, C, "")))) {
1041
+ if (m)
997
1042
  return !1;
998
1043
  }
999
1044
  }
@@ -1002,263 +1047,276 @@ function ws() {
1002
1047
  }
1003
1048
  }
1004
1049
  return !0;
1005
- }, "_isValidAttribute"), Ps = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Nn = /* @__PURE__ */ h(function(a) {
1006
- return !Ps[ct(a)] && K(k, a);
1007
- }, "_isBasicCustomElement"), zn = /* @__PURE__ */ h(function(a) {
1008
- xe(Z.beforeSanitizeAttributes, a, null);
1009
- const u = a.attributes;
1010
- if (!u || Yt(a))
1050
+ }, "_isValidAttribute"), Bs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), zn = /* @__PURE__ */ h(function(i) {
1051
+ return !Bs[pt(i)] && J(k, i);
1052
+ }, "_isBasicCustomElement"), $n = /* @__PURE__ */ h(function(i) {
1053
+ we(q.beforeSanitizeAttributes, i, null);
1054
+ const u = i.attributes;
1055
+ if (!u || St(i))
1011
1056
  return;
1012
- const g = {
1057
+ const m = {
1013
1058
  attrName: "",
1014
1059
  attrValue: "",
1015
1060
  keepAttr: !0,
1016
- allowedAttributes: B,
1061
+ allowedAttributes: P,
1017
1062
  forceKeepAttr: void 0
1018
1063
  };
1019
- let D = u.length;
1020
- for (; D--; ) {
1021
- const H = u[D], j = H.name, ie = H.namespaceURI, Te = H.value, be = W(j), Xt = Te;
1022
- let V = j === "value" ? Xt : mr(Xt);
1023
- if (g.attrName = be, g.attrValue = V, g.keepAttr = !0, g.forceKeepAttr = void 0, xe(Z.uponSanitizeAttribute, a, g), V = g.attrValue, vn && (be === "id" || be === "name") && Kn(V, Tn) !== 0 && (Ie(j, a), V = Tn + V), rt && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
1024
- Ie(j, a);
1064
+ let $ = u.length;
1065
+ for (; $--; ) {
1066
+ const D = u[$], U = D.name, le = D.namespaceURI, me = D.value, ue = G(U), Kt = me;
1067
+ let K = U === "value" ? Kt : br(Kt);
1068
+ if (m.attrName = ue, m.attrValue = K, m.keepAttr = !0, m.forceKeepAttr = void 0, we(q.uponSanitizeAttribute, i, m), K = m.attrValue, Tn && (ue === "id" || ue === "name") && Qn(K, Sn) !== 0 && (De(U, i), K = Sn + K), it && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, K)) {
1069
+ De(U, i);
1025
1070
  continue;
1026
1071
  }
1027
- if (be === "attributename" && Xn(V, "href")) {
1028
- Ie(j, a);
1072
+ if (ue === "attributename" && Kn(K, "href")) {
1073
+ De(U, i);
1029
1074
  continue;
1030
1075
  }
1031
- if (g.forceKeepAttr)
1076
+ if (m.forceKeepAttr)
1032
1077
  continue;
1033
- if (!g.keepAttr) {
1034
- Ie(j, a);
1078
+ if (!m.keepAttr) {
1079
+ De(U, i);
1035
1080
  continue;
1036
1081
  }
1037
- if (!yn && K(/\/>/i, V)) {
1038
- Ie(j, a);
1082
+ if (!wn && J(/\/>/i, K)) {
1083
+ De(U, i);
1039
1084
  continue;
1040
1085
  }
1041
- ve && je([Ne, ze, $e], (Pn) => {
1042
- V = We(V, Pn, " ");
1086
+ Ae && qe([ze, $e, Pe], (Bn) => {
1087
+ K = Ye(K, Bn, " ");
1043
1088
  });
1044
- const $n = W(a.nodeName);
1045
- if (!Ln($n, be, V)) {
1046
- Ie(j, a);
1089
+ const Pn = G(i.nodeName);
1090
+ if (!Nn(Pn, ue, K)) {
1091
+ De(U, i);
1047
1092
  continue;
1048
1093
  }
1049
- if ($ && typeof f == "object" && typeof f.getAttributeType == "function" && !ie)
1050
- switch (f.getAttributeType($n, be)) {
1094
+ if (B && typeof d == "object" && typeof d.getAttributeType == "function" && !le)
1095
+ switch (d.getAttributeType(Pn, ue)) {
1051
1096
  case "TrustedHTML": {
1052
- V = $.createHTML(V);
1097
+ K = B.createHTML(K);
1053
1098
  break;
1054
1099
  }
1055
1100
  case "TrustedScriptURL": {
1056
- V = $.createScriptURL(V);
1101
+ K = B.createScriptURL(K);
1057
1102
  break;
1058
1103
  }
1059
1104
  }
1060
- if (V !== Xt)
1105
+ if (K !== Kt)
1061
1106
  try {
1062
- ie ? a.setAttributeNS(ie, j, V) : a.setAttribute(j, V), Yt(a) ? oe(a) : Zn(t.removed);
1107
+ le ? i.setAttributeNS(le, U, K) : i.setAttribute(U, K), St(i) ? ce(i) : Xn(t.removed);
1063
1108
  } catch {
1064
- Ie(j, a);
1109
+ De(U, i);
1065
1110
  }
1066
1111
  }
1067
- xe(Z.afterSanitizeAttributes, a, null);
1068
- }, "_sanitizeAttributes"), Zt = /* @__PURE__ */ h(function(a) {
1112
+ we(q.afterSanitizeAttributes, i, null);
1113
+ }, "_sanitizeAttributes"), Et = /* @__PURE__ */ h(function(i) {
1069
1114
  let u = null;
1070
- const g = Dn(a);
1071
- for (xe(Z.beforeSanitizeShadowDOM, a, null); u = g.nextNode(); )
1072
- xe(Z.uponSanitizeShadowNode, u, null), Mn(u), zn(u), u.content instanceof s && Zt(u.content);
1073
- xe(Z.afterSanitizeShadowDOM, a, null);
1074
- }, "_sanitizeShadowDOM"), vt = /* @__PURE__ */ h(function(a) {
1075
- if (a.nodeType === qe.element && a.shadowRoot instanceof s) {
1076
- const D = a.shadowRoot;
1077
- vt(D), Zt(D);
1078
- }
1079
- const u = a.childNodes;
1080
- if (!u)
1115
+ const m = On(i);
1116
+ for (we(q.beforeSanitizeShadowDOM, i, null); u = m.nextNode(); )
1117
+ if (we(q.uponSanitizeShadowNode, u, null), Ln(u), $n(u), ot(u.content) && Et(u.content), (j ? j(u) : u.nodeType) === be.element) {
1118
+ const D = Z ? Z(u) : u.shadowRoot;
1119
+ ot(D) && (Ge(D), Et(D));
1120
+ }
1121
+ we(q.afterSanitizeShadowDOM, i, null);
1122
+ }, "_sanitizeShadowDOM"), Ge = /* @__PURE__ */ h(function(i) {
1123
+ const u = j ? j(i) : i.nodeType;
1124
+ if (u === be.element) {
1125
+ const D = Z ? Z(i) : i.shadowRoot;
1126
+ ot(D) && (Ge(D), Et(D));
1127
+ }
1128
+ const m = I ? I(i) : i.childNodes;
1129
+ if (!m)
1081
1130
  return;
1082
- const g = [];
1083
- je(u, (D) => {
1084
- Ge(g, D);
1131
+ const $ = [];
1132
+ qe(m, (D) => {
1133
+ Ve($, D);
1085
1134
  });
1086
- for (const D of g)
1087
- vt(D);
1135
+ for (const D of $)
1136
+ Ge(D);
1137
+ if (u === be.element) {
1138
+ const D = ae ? ae(i) : null;
1139
+ if (typeof D == "string" && G(D) === "template") {
1140
+ const U = i.content;
1141
+ ot(U) && Ge(U);
1142
+ }
1143
+ }
1088
1144
  }, "_sanitizeAttachedShadowRoots");
1089
- return t.sanitize = function(w) {
1090
- let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, g = null, D = null, H = null;
1091
- if (jt = !w, jt && (w = "<!-->"), typeof w != "string" && !wt(w) && (w = wr(w), typeof w != "string"))
1092
- throw St("dirty is not a string, aborting");
1145
+ return t.sanitize = function(y) {
1146
+ let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, m = null, $ = null, D = null;
1147
+ if (qt = !y, qt && (y = "<!-->"), typeof y != "string" && !At(y) && (y = vr(y), typeof y != "string"))
1148
+ throw ut("dirty is not a string, aborting");
1093
1149
  if (!t.isSupported)
1094
- return w;
1095
- if (Pt || Vt(a), t.removed = [], typeof w == "string" && (it = !1), it) {
1096
- const Te = w.nodeName;
1097
- if (typeof Te == "string") {
1098
- const be = W(Te);
1099
- if (!E[be] || st[be])
1100
- throw St("root node is forbidden and cannot be sanitized in-place");
1101
- }
1102
- vt(w);
1103
- } else if (wt(w))
1104
- u = Cn("<!---->"), g = u.ownerDocument.importNode(w, !0), g.nodeType === qe.element && g.nodeName === "BODY" || g.nodeName === "HTML" ? u = g : u.appendChild(g), vt(g);
1150
+ return y;
1151
+ if (Ut || Xt(i), t.removed = [], typeof y == "string" && (at = !1), at) {
1152
+ const me = ae ? ae(y) : y.nodeName;
1153
+ if (typeof me == "string") {
1154
+ const ue = G(me);
1155
+ if (!E[ue] || rt[ue])
1156
+ throw ut("root node is forbidden and cannot be sanitized in-place");
1157
+ }
1158
+ if (St(y))
1159
+ throw ut("root node is clobbered and cannot be sanitized in-place");
1160
+ Ge(y);
1161
+ } else if (At(y))
1162
+ u = Dn("<!---->"), m = u.ownerDocument.importNode(y, !0), m.nodeType === be.element && m.nodeName === "BODY" || m.nodeName === "HTML" ? u = m : u.appendChild(m), Ge(m);
1105
1163
  else {
1106
- if (!Pe && !ve && !Re && // eslint-disable-next-line unicorn/prefer-includes
1107
- w.indexOf("<") === -1)
1108
- return $ && bt ? $.createHTML(w) : w;
1109
- if (u = Cn(w), !u)
1110
- return Pe ? null : bt ? Y : "";
1111
- }
1112
- u && Bt && oe(u.firstChild);
1113
- const j = Dn(it ? w : u);
1114
- for (; D = j.nextNode(); )
1115
- Mn(D), zn(D), D.content instanceof s && Zt(D.content);
1116
- if (it)
1117
- return ve && On(w), w;
1118
- if (Pe) {
1119
- if (ve && On(u), xt)
1120
- for (H = pt.call(u.ownerDocument); u.firstChild; )
1121
- H.appendChild(u.firstChild);
1164
+ if (!Fe && !Ae && !Ce && // eslint-disable-next-line unicorn/prefer-includes
1165
+ y.indexOf("<") === -1)
1166
+ return B && wt ? B.createHTML(y) : y;
1167
+ if (u = Dn(y), !u)
1168
+ return Fe ? null : wt ? Q : "";
1169
+ }
1170
+ u && Ht && ce(u.firstChild);
1171
+ const U = On(at ? y : u);
1172
+ for (; $ = U.nextNode(); )
1173
+ Ln($), $n($), ot($.content) && Et($.content);
1174
+ if (at)
1175
+ return Ae && Mn(y), y;
1176
+ if (Fe) {
1177
+ if (Ae && Mn(u), yt)
1178
+ for (D = gt.call(u.ownerDocument); u.firstChild; )
1179
+ D.appendChild(u.firstChild);
1122
1180
  else
1123
- H = u;
1124
- return (B.shadowroot || B.shadowrootmode) && (H = dt.call(n, H, !0)), H;
1125
- }
1126
- let ie = Re ? u.outerHTML : u.innerHTML;
1127
- return Re && E["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(Or, u.ownerDocument.doctype.name) && (ie = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1128
- ` + ie), ve && je([Ne, ze, $e], (Te) => {
1129
- ie = We(ie, Te, " ");
1130
- }), $ && bt ? $.createHTML(ie) : ie;
1181
+ D = u;
1182
+ return (P.shadowroot || P.shadowrootmode) && (D = mt.call(n, D, !0)), D;
1183
+ }
1184
+ let le = Ce ? u.outerHTML : u.innerHTML;
1185
+ return Ce && E["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && J(Mr, u.ownerDocument.doctype.name) && (le = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1186
+ ` + le), Ae && qe([ze, $e, Pe], (me) => {
1187
+ le = Ye(le, me, " ");
1188
+ }), B && wt ? B.createHTML(le) : le;
1131
1189
  }, t.setConfig = function() {
1132
- let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1133
- Vt(w), Pt = !0;
1190
+ let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1191
+ Xt(y), Ut = !0;
1134
1192
  }, t.clearConfig = function() {
1135
- Ue = null, Pt = !1;
1136
- }, t.isValidAttribute = function(w, a, u) {
1137
- Ue || Vt({});
1138
- const g = W(w), D = W(a);
1139
- return Ln(g, D, u);
1140
- }, t.addHook = function(w, a) {
1141
- typeof a == "function" && Ge(Z[w], a);
1142
- }, t.removeHook = function(w, a) {
1143
- if (a !== void 0) {
1144
- const u = fr(Z[w], a);
1145
- return u === -1 ? void 0 : gr(Z[w], u, 1)[0];
1146
- }
1147
- return Zn(Z[w]);
1148
- }, t.removeHooks = function(w) {
1149
- Z[w] = [];
1193
+ je = null, Ut = !1;
1194
+ }, t.isValidAttribute = function(y, i, u) {
1195
+ je || Xt({});
1196
+ const m = G(y), $ = G(i);
1197
+ return Nn(m, $, u);
1198
+ }, t.addHook = function(y, i) {
1199
+ typeof i == "function" && Ve(q[y], i);
1200
+ }, t.removeHook = function(y, i) {
1201
+ if (i !== void 0) {
1202
+ const u = gr(q[y], i);
1203
+ return u === -1 ? void 0 : mr(q[y], u, 1)[0];
1204
+ }
1205
+ return Xn(q[y]);
1206
+ }, t.removeHooks = function(y) {
1207
+ q[y] = [];
1150
1208
  }, t.removeAllHooks = function() {
1151
- Z = is();
1209
+ q = as();
1152
1210
  }, t;
1153
1211
  }
1154
- h(ws, "createDOMPurify");
1155
- var zr = ws();
1156
- function on() {
1212
+ h(vs, "createDOMPurify");
1213
+ var $r = vs();
1214
+ function cn() {
1157
1215
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1158
1216
  }
1159
- h(on, "M");
1160
- var Le = on();
1161
- function vs(i) {
1162
- Le = i;
1217
+ h(cn, "M");
1218
+ var Ne = cn();
1219
+ function Ts(a) {
1220
+ Ne = a;
1163
1221
  }
1164
- h(vs, "N");
1165
- var Oe = { exec: /* @__PURE__ */ h(() => null, "exec") };
1166
- function Ve(i) {
1222
+ h(Ts, "N");
1223
+ var Me = { exec: /* @__PURE__ */ h(() => null, "exec") };
1224
+ function Ze(a) {
1167
1225
  let t = [];
1168
1226
  return (e) => {
1169
1227
  let n = Math.max(0, Math.min(3, e - 1)), r = t[n];
1170
- return r || (r = i(n), t[n] = r), r;
1228
+ return r || (r = a(n), t[n] = r), r;
1171
1229
  };
1172
1230
  }
1173
- h(Ve, "E");
1174
- function L(i, t = "") {
1175
- let e = typeof i == "string" ? i : i.source, n = { replace: /* @__PURE__ */ h((r, s) => {
1231
+ h(Ze, "E");
1232
+ function L(a, t = "") {
1233
+ let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((r, s) => {
1176
1234
  let l = typeof s == "string" ? s : s.source;
1177
- return l = l.replace(J.caret, "$1"), e = e.replace(r, l), n;
1235
+ return l = l.replace(ne.caret, "$1"), e = e.replace(r, l), n;
1178
1236
  }, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
1179
1237
  return n;
1180
1238
  }
1181
1239
  h(L, "d");
1182
- var $r = ((i = "") => {
1240
+ var Pr = ((a = "") => {
1183
1241
  try {
1184
- return !!new RegExp("(?<=1)(?<!1)" + i);
1242
+ return !!new RegExp("(?<=1)(?<!1)" + a);
1185
1243
  } catch {
1186
1244
  return !1;
1187
1245
  }
1188
- })(), J = { 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((i) => new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: Ve((i) => new RegExp(`^ {0,${i}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:\`\`\`|~~~)`)), headingBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}#`)), htmlBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}>`)) }, Pr = /^(?:[ \t]*(?:\n|$))+/, Br = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Fr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ht = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ur = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, cn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ts = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ss = L(Ts).replace(/bull/g, cn).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(), Hr = L(Ts).replace(/bull/g, cn).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(), un = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, jr = /^[^\n]+/, hn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Gr = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", hn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Wr = L(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, cn).getRegex(), Lt = "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", pn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, qr = L("^ {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", pn).replace("tag", Lt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), As = L(un).replace("hr", ht).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", Lt).getRegex(), Vr = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", As).getRegex(), dn = { blockquote: Vr, code: Br, def: Gr, fences: Fr, heading: Ur, hr: ht, html: qr, lheading: Ss, list: Wr, newline: Pr, paragraph: As, table: Oe, text: jr }, as = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ht).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", Lt).getRegex(), Yr = { ...dn, lheading: Hr, table: as, paragraph: L(un).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", as).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", Lt).getRegex() }, Zr = { ...dn, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", pn).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: Oe, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(un).replace("hr", ht).replace("heading", ` *#{1,6} *[^
1189
- ]`).replace("lheading", Ss).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Xr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Kr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Es = /^( {2,}|\\)\n(?!\s*$)/, Qr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, et = /[\p{P}\p{S}]/u, Nt = /[\s\p{P}\p{S}]/u, fn = /[^\s\p{P}\p{S}]/u, Jr = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Nt).getRegex(), _s = /(?!~)[\p{P}\p{S}]/u, ei = /(?!~)[\s\p{P}\p{S}]/u, ti = /(?:[^\s\p{P}\p{S}]|~)/u, ni = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", $r ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, si = L(Rs, "u").replace(/punct/g, et).getRegex(), ri = L(Rs, "u").replace(/punct/g, _s).getRegex(), Is = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ii = L(Is, "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), ai = L(Is, "gu").replace(/notPunctSpace/g, ti).replace(/punctSpace/g, ei).replace(/punct/g, _s).getRegex(), li = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), oi = L(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, et).getRegex(), ci = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", ui = L(ci, "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), hi = L(/\\(punct)/, "gu").replace(/punct/g, et).getRegex(), pi = L(/^<(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(), di = L(pn).replace("(?:-->|$)", "-->").getRegex(), fi = L("^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", di).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ct = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, gi = L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Ct).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Cs = L(/^!?\[(label)\]\[(ref)\]/).replace("label", Ct).replace("ref", hn).getRegex(), Ds = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", hn).getRegex(), mi = L("reflink|nolink(?!\\()", "g").replace("reflink", Cs).replace("nolink", Ds).getRegex(), ls = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, gn = { _backpedal: Oe, anyPunctuation: hi, autolink: pi, blockSkip: ni, br: Es, code: Kr, del: Oe, delLDelim: Oe, delRDelim: Oe, emStrongLDelim: si, emStrongRDelimAst: ii, emStrongRDelimUnd: li, escape: Xr, link: gi, nolink: Ds, punctuation: Jr, reflink: Cs, reflinkSearch: mi, tag: fi, text: Qr, url: Oe }, xi = { ...gn, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", Ct).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ct).getRegex() }, an = { ...gn, emStrongRDelimAst: ai, emStrongLDelim: ri, delLDelim: oi, delRDelim: ui, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ls).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ls).getRegex() }, bi = { ...an, br: L(Es).replace("{2,}", "*").getRegex(), text: L(an.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, Et = { normal: dn, gfm: Yr, pedantic: Zr }, ot = { normal: gn, gfm: an, breaks: bi, pedantic: xi }, ki = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, os = /* @__PURE__ */ h((i) => ki[i], "ge");
1190
- function fe(i, t) {
1246
+ })(), ne = { 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: Ze((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: Ze((a) => new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: Ze((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)), headingBeginRegex: Ze((a) => new RegExp(`^ {0,${a}}#`)), htmlBeginRegex: Ze((a) => new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: Ze((a) => new RegExp(`^ {0,${a}}>`)) }, Br = /^(?:[ \t]*(?:\n|$))+/, Fr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ur = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ft = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Hr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, un = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ss = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, As = L(Ss).replace(/bull/g, un).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(), jr = L(Ss).replace(/bull/g, un).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(), hn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Gr = /^[^\n]+/, pn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Wr = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", pn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qr = L(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, un).getRegex(), $t = "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", dn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Vr = L("^ {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", dn).replace("tag", $t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Es = L(hn).replace("hr", ft).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", $t).getRegex(), Yr = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Es).getRegex(), fn = { blockquote: Yr, code: Fr, def: Wr, fences: Ur, heading: Hr, hr: ft, html: Vr, lheading: As, list: qr, newline: Br, paragraph: Es, table: Me, text: Gr }, ls = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ft).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", $t).getRegex(), Zr = { ...fn, lheading: jr, table: ls, paragraph: L(hn).replace("hr", ft).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ls).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", $t).getRegex() }, Xr = { ...fn, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", dn).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: Me, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(hn).replace("hr", ft).replace("heading", ` *#{1,6} *[^
1247
+ ]`).replace("lheading", As).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Kr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Qr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _s = /^( {2,}|\\)\n(?!\s*$)/, Jr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, nt = /[\p{P}\p{S}]/u, Pt = /[\s\p{P}\p{S}]/u, gn = /[^\s\p{P}\p{S}]/u, ei = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Pt).getRegex(), Rs = /(?!~)[\p{P}\p{S}]/u, ti = /(?!~)[\s\p{P}\p{S}]/u, ni = /(?:[^\s\p{P}\p{S}]|~)/u, si = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Pr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Is = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ri = L(Is, "u").replace(/punct/g, nt).getRegex(), ii = L(Is, "u").replace(/punct/g, Rs).getRegex(), Cs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ai = L(Cs, "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, Pt).replace(/punct/g, nt).getRegex(), li = L(Cs, "gu").replace(/notPunctSpace/g, ni).replace(/punctSpace/g, ti).replace(/punct/g, Rs).getRegex(), oi = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, Pt).replace(/punct/g, nt).getRegex(), ci = L(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, nt).getRegex(), ui = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", hi = L(ui, "gu").replace(/notPunctSpace/g, gn).replace(/punctSpace/g, Pt).replace(/punct/g, nt).getRegex(), pi = L(/\\(punct)/, "gu").replace(/punct/g, nt).getRegex(), di = L(/^<(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(), fi = L(dn).replace("(?:-->|$)", "-->").getRegex(), gi = L("^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", fi).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Mt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, mi = L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Mt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ds = L(/^!?\[(label)\]\[(ref)\]/).replace("label", Mt).replace("ref", pn).getRegex(), Os = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", pn).getRegex(), bi = L("reflink|nolink(?!\\()", "g").replace("reflink", Ds).replace("nolink", Os).getRegex(), os = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, mn = { _backpedal: Me, anyPunctuation: pi, autolink: di, blockSkip: si, br: _s, code: Qr, del: Me, delLDelim: Me, delRDelim: Me, emStrongLDelim: ri, emStrongRDelimAst: ai, emStrongRDelimUnd: oi, escape: Kr, link: mi, nolink: Os, punctuation: ei, reflink: Ds, reflinkSearch: bi, tag: gi, text: Jr, url: Me }, xi = { ...mn, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", Mt).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Mt).getRegex() }, ln = { ...mn, emStrongRDelimAst: li, emStrongLDelim: ii, delLDelim: ci, delRDelim: hi, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", os).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", os).getRegex() }, ki = { ...ln, br: L(_s).replace("{2,}", "*").getRegex(), text: L(ln.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, It = { normal: fn, gfm: Zr, pedantic: Xr }, ht = { normal: mn, gfm: ln, breaks: ki, pedantic: xi }, yi = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, cs = /* @__PURE__ */ h((a) => yi[a], "ge");
1248
+ function ke(a, t) {
1191
1249
  if (t) {
1192
- if (J.escapeTest.test(i)) return i.replace(J.escapeReplace, os);
1193
- } else if (J.escapeTestNoEncode.test(i)) return i.replace(J.escapeReplaceNoEncode, os);
1194
- return i;
1250
+ if (ne.escapeTest.test(a)) return a.replace(ne.escapeReplace, cs);
1251
+ } else if (ne.escapeTestNoEncode.test(a)) return a.replace(ne.escapeReplaceNoEncode, cs);
1252
+ return a;
1195
1253
  }
1196
- h(fe, "O");
1197
- function cs(i) {
1254
+ h(ke, "O");
1255
+ function us(a) {
1198
1256
  try {
1199
- i = encodeURI(i).replace(J.percentDecode, "%");
1257
+ a = encodeURI(a).replace(ne.percentDecode, "%");
1200
1258
  } catch {
1201
1259
  return null;
1202
1260
  }
1203
- return i;
1261
+ return a;
1204
1262
  }
1205
- h(cs, "V");
1206
- function us(i, t) {
1207
- let e = i.replace(J.findPipe, (s, l, o) => {
1263
+ h(us, "V");
1264
+ function hs(a, t) {
1265
+ let e = a.replace(ne.findPipe, (s, l, o) => {
1208
1266
  let p = !1, c = l;
1209
1267
  for (; --c >= 0 && o[c] === "\\"; ) p = !p;
1210
1268
  return p ? "|" : " |";
1211
- }), n = e.split(J.splitPipe), r = 0;
1269
+ }), n = e.split(ne.splitPipe), r = 0;
1212
1270
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1213
1271
  else for (; n.length < t; ) n.push("");
1214
- for (; r < n.length; r++) n[r] = n[r].trim().replace(J.slashPipe, "|");
1272
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(ne.slashPipe, "|");
1215
1273
  return n;
1216
1274
  }
1217
- h(us, "Y");
1218
- function Se(i, t, e) {
1219
- let n = i.length;
1275
+ h(hs, "Y");
1276
+ function Ee(a, t, e) {
1277
+ let n = a.length;
1220
1278
  if (n === 0) return "";
1221
1279
  let r = 0;
1222
- for (; r < n && i.charAt(n - r - 1) === t; )
1280
+ for (; r < n && a.charAt(n - r - 1) === t; )
1223
1281
  r++;
1224
- return i.slice(0, n - r);
1282
+ return a.slice(0, n - r);
1225
1283
  }
1226
- h(Se, "$");
1227
- function hs(i) {
1228
- let t = i.split(`
1284
+ h(Ee, "$");
1285
+ function ps(a) {
1286
+ let t = a.split(`
1229
1287
  `), e = t.length - 1;
1230
- for (; e >= 0 && J.blankLine.test(t[e]); ) e--;
1231
- return t.length - e <= 2 ? i : t.slice(0, e + 1).join(`
1288
+ for (; e >= 0 && ne.blankLine.test(t[e]); ) e--;
1289
+ return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
1232
1290
  `);
1233
1291
  }
1234
- h(hs, "ee");
1235
- function yi(i, t) {
1236
- if (i.indexOf(t[1]) === -1) return -1;
1292
+ h(ps, "ee");
1293
+ function wi(a, t) {
1294
+ if (a.indexOf(t[1]) === -1) return -1;
1237
1295
  let e = 0;
1238
- for (let n = 0; n < i.length; n++) if (i[n] === "\\") n++;
1239
- else if (i[n] === t[0]) e++;
1240
- else if (i[n] === t[1] && (e--, e < 0)) return n;
1296
+ for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
1297
+ else if (a[n] === t[0]) e++;
1298
+ else if (a[n] === t[1] && (e--, e < 0)) return n;
1241
1299
  return e > 0 ? -2 : -1;
1242
1300
  }
1243
- h(yi, "fe");
1244
- function wi(i, t = 0) {
1301
+ h(wi, "fe");
1302
+ function vi(a, t = 0) {
1245
1303
  let e = t, n = "";
1246
- for (let r of i) if (r === " ") {
1304
+ for (let r of a) if (r === " ") {
1247
1305
  let s = 4 - e % 4;
1248
1306
  n += " ".repeat(s), e += s;
1249
1307
  } else n += r, e++;
1250
1308
  return n;
1251
1309
  }
1252
- h(wi, "me");
1253
- function ps(i, t, e, n, r) {
1254
- let s = t.href, l = t.title || null, o = i[1].replace(r.other.outputLinkReplace, "$1");
1310
+ h(vi, "me");
1311
+ function ds(a, t, e, n, r) {
1312
+ let s = t.href, l = t.title || null, o = a[1].replace(r.other.outputLinkReplace, "$1");
1255
1313
  n.state.inLink = !0;
1256
- let p = { type: i[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1314
+ let p = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
1257
1315
  return n.state.inLink = !1, p;
1258
1316
  }
1259
- h(ps, "xe");
1260
- function vi(i, t, e) {
1261
- let n = i.match(e.other.indentCodeCompensation);
1317
+ h(ds, "xe");
1318
+ function Ti(a, t, e) {
1319
+ let n = a.match(e.other.indentCodeCompensation);
1262
1320
  if (n === null) return t;
1263
1321
  let r = n[1];
1264
1322
  return t.split(`
@@ -1270,13 +1328,13 @@ function vi(i, t, e) {
1270
1328
  }).join(`
1271
1329
  `);
1272
1330
  }
1273
- h(vi, "st");
1274
- var Ze, Dt = (Ze = class {
1331
+ h(Ti, "st");
1332
+ var Ke, Lt = (Ke = class {
1275
1333
  constructor(t) {
1276
1334
  O(this, "options");
1277
1335
  O(this, "rules");
1278
1336
  O(this, "lexer");
1279
- this.options = t || Le;
1337
+ this.options = t || Ne;
1280
1338
  }
1281
1339
  space(t) {
1282
1340
  let e = this.rules.block.newline.exec(t);
@@ -1285,14 +1343,14 @@ var Ze, Dt = (Ze = class {
1285
1343
  code(t) {
1286
1344
  let e = this.rules.block.code.exec(t);
1287
1345
  if (e) {
1288
- let n = this.options.pedantic ? e[0] : hs(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
1346
+ let n = this.options.pedantic ? e[0] : ps(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
1289
1347
  return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
1290
1348
  }
1291
1349
  }
1292
1350
  fences(t) {
1293
1351
  let e = this.rules.block.fences.exec(t);
1294
1352
  if (e) {
1295
- let n = e[0], r = vi(n, e[3] || "", this.rules);
1353
+ let n = e[0], r = Ti(n, e[3] || "", this.rules);
1296
1354
  return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
1297
1355
  }
1298
1356
  }
@@ -1301,22 +1359,22 @@ var Ze, Dt = (Ze = class {
1301
1359
  if (e) {
1302
1360
  let n = e[2].trim();
1303
1361
  if (this.rules.other.endingHash.test(n)) {
1304
- let r = Se(n, "#");
1362
+ let r = Ee(n, "#");
1305
1363
  (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1306
1364
  }
1307
- return { type: "heading", raw: Se(e[0], `
1365
+ return { type: "heading", raw: Ee(e[0], `
1308
1366
  `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1309
1367
  }
1310
1368
  }
1311
1369
  hr(t) {
1312
1370
  let e = this.rules.block.hr.exec(t);
1313
- if (e) return { type: "hr", raw: Se(e[0], `
1371
+ if (e) return { type: "hr", raw: Ee(e[0], `
1314
1372
  `) };
1315
1373
  }
1316
1374
  blockquote(t) {
1317
1375
  let e = this.rules.block.blockquote.exec(t);
1318
1376
  if (e) {
1319
- let n = Se(e[0], `
1377
+ let n = Ee(e[0], `
1320
1378
  `).split(`
1321
1379
  `), r = "", s = "", l = [];
1322
1380
  for (; n.length > 0; ) {
@@ -1325,27 +1383,27 @@ var Ze, Dt = (Ze = class {
1325
1383
  else if (!o) p.push(n[c]);
1326
1384
  else break;
1327
1385
  n = n.slice(c);
1328
- let b = p.join(`
1329
- `), d = b.replace(this.rules.other.blockquoteSetextReplace, `
1386
+ let x = p.join(`
1387
+ `), d = x.replace(this.rules.other.blockquoteSetextReplace, `
1330
1388
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1331
1389
  r = r ? `${r}
1332
- ${b}` : b, s = s ? `${s}
1390
+ ${x}` : x, s = s ? `${s}
1333
1391
  ${d}` : d;
1334
- let m = this.lexer.state.top;
1335
- if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = m, n.length === 0) break;
1336
- let x = l.at(-1);
1337
- if (x?.type === "code") break;
1338
- if (x?.type === "blockquote") {
1339
- let f = x, v = f.raw + `
1392
+ let f = this.lexer.state.top;
1393
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = f, n.length === 0) break;
1394
+ let b = l.at(-1);
1395
+ if (b?.type === "code") break;
1396
+ if (b?.type === "blockquote") {
1397
+ let g = b, A = g.raw + `
1340
1398
  ` + n.join(`
1341
- `), C = this.blockquote(v);
1342
- l[l.length - 1] = C, r = r.substring(0, r.length - f.raw.length) + C.raw, s = s.substring(0, s.length - f.text.length) + C.text;
1399
+ `), I = this.blockquote(A);
1400
+ l[l.length - 1] = I, r = r.substring(0, r.length - g.raw.length) + I.raw, s = s.substring(0, s.length - g.text.length) + I.text;
1343
1401
  break;
1344
- } else if (x?.type === "list") {
1345
- let f = x, v = f.raw + `
1402
+ } else if (b?.type === "list") {
1403
+ let g = b, A = g.raw + `
1346
1404
  ` + n.join(`
1347
- `), C = this.list(v);
1348
- l[l.length - 1] = C, r = r.substring(0, r.length - x.raw.length) + C.raw, s = s.substring(0, s.length - f.raw.length) + C.raw, n = v.substring(l.at(-1).raw.length).split(`
1405
+ `), I = this.list(A);
1406
+ l[l.length - 1] = I, r = r.substring(0, r.length - b.raw.length) + I.raw, s = s.substring(0, s.length - g.raw.length) + I.raw, n = A.substring(l.at(-1).raw.length).split(`
1349
1407
  `);
1350
1408
  continue;
1351
1409
  }
@@ -1360,31 +1418,31 @@ ${d}` : d;
1360
1418
  n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1361
1419
  let l = this.rules.other.listItemRegex(n), o = !1;
1362
1420
  for (; t; ) {
1363
- let c = !1, b = "", d = "";
1421
+ let c = !1, x = "", d = "";
1364
1422
  if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
1365
- b = e[0], t = t.substring(b.length);
1366
- let m = wi(e[2].split(`
1367
- `, 1)[0], e[1].length), x = t.split(`
1368
- `, 1)[0], f = !m.trim(), v = 0;
1369
- if (this.options.pedantic ? (v = 2, d = m.trimStart()) : f ? v = e[1].length + 1 : (v = m.search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, d = m.slice(v), v += e[1].length), f && this.rules.other.blankLine.test(x) && (b += x + `
1370
- `, t = t.substring(x.length + 1), c = !0), !c) {
1371
- let C = this.rules.other.nextBulletRegex(v), z = this.rules.other.hrRegex(v), ee = this.rules.other.fencesBeginRegex(v), te = this.rules.other.headingBeginRegex(v), re = this.rules.other.htmlBeginRegex(v), ge = this.rules.other.blockquoteBeginRegex(v);
1423
+ x = e[0], t = t.substring(x.length);
1424
+ let f = vi(e[2].split(`
1425
+ `, 1)[0], e[1].length), b = t.split(`
1426
+ `, 1)[0], g = !f.trim(), A = 0;
1427
+ if (this.options.pedantic ? (A = 2, d = f.trimStart()) : g ? A = e[1].length + 1 : (A = f.search(this.rules.other.nonSpaceChar), A = A > 4 ? 1 : A, d = f.slice(A), A += e[1].length), g && this.rules.other.blankLine.test(b) && (x += b + `
1428
+ `, t = t.substring(b.length + 1), c = !0), !c) {
1429
+ let I = this.rules.other.nextBulletRegex(A), N = this.rules.other.hrRegex(A), Z = this.rules.other.fencesBeginRegex(A), se = this.rules.other.headingBeginRegex(A), j = this.rules.other.htmlBeginRegex(A), ae = this.rules.other.blockquoteBeginRegex(A);
1372
1430
  for (; t; ) {
1373
- let $ = t.split(`
1374
- `, 1)[0], Y;
1375
- if (x = $, this.options.pedantic ? (x = x.replace(this.rules.other.listReplaceNesting, " "), Y = x) : Y = x.replace(this.rules.other.tabCharGlobal, " "), ee.test(x) || te.test(x) || re.test(x) || ge.test(x) || C.test(x) || z.test(x)) break;
1376
- if (Y.search(this.rules.other.nonSpaceChar) >= v || !x.trim()) d += `
1377
- ` + Y.slice(v);
1431
+ let B = t.split(`
1432
+ `, 1)[0], Q;
1433
+ if (b = B, this.options.pedantic ? (b = b.replace(this.rules.other.listReplaceNesting, " "), Q = b) : Q = b.replace(this.rules.other.tabCharGlobal, " "), Z.test(b) || se.test(b) || j.test(b) || ae.test(b) || I.test(b) || N.test(b)) break;
1434
+ if (Q.search(this.rules.other.nonSpaceChar) >= A || !b.trim()) d += `
1435
+ ` + Q.slice(A);
1378
1436
  else {
1379
- if (f || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(m) || te.test(m) || z.test(m)) break;
1437
+ if (g || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Z.test(f) || se.test(f) || N.test(f)) break;
1380
1438
  d += `
1381
- ` + x;
1439
+ ` + b;
1382
1440
  }
1383
- f = !x.trim(), b += $ + `
1384
- `, t = t.substring($.length + 1), m = Y.slice(v);
1441
+ g = !b.trim(), x += B + `
1442
+ `, t = t.substring(B.length + 1), f = Q.slice(A);
1385
1443
  }
1386
1444
  }
1387
- 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(d), loose: !1, text: d, tokens: [] }), s.raw += b;
1445
+ s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(x) && (o = !0)), s.items.push({ type: "list_item", raw: x, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), s.raw += x;
1388
1446
  }
1389
1447
  let p = s.items.at(-1);
1390
1448
  if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
@@ -1392,27 +1450,27 @@ ${d}` : d;
1392
1450
  s.raw = s.raw.trimEnd();
1393
1451
  for (let c of s.items) {
1394
1452
  this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
1395
- let b = c.tokens[0];
1396
- if (c.task && (b?.type === "text" || b?.type === "paragraph")) {
1397
- c.text = c.text.replace(this.rules.other.listReplaceTask, ""), b.raw = b.raw.replace(this.rules.other.listReplaceTask, ""), b.text = b.text.replace(this.rules.other.listReplaceTask, "");
1398
- for (let m = this.lexer.inlineQueue.length - 1; m >= 0; m--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)) {
1399
- this.lexer.inlineQueue[m].src = this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask, "");
1453
+ let x = c.tokens[0];
1454
+ if (c.task && (x?.type === "text" || x?.type === "paragraph")) {
1455
+ c.text = c.text.replace(this.rules.other.listReplaceTask, ""), x.raw = x.raw.replace(this.rules.other.listReplaceTask, ""), x.text = x.text.replace(this.rules.other.listReplaceTask, "");
1456
+ for (let f = this.lexer.inlineQueue.length - 1; f >= 0; f--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)) {
1457
+ this.lexer.inlineQueue[f].src = this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask, "");
1400
1458
  break;
1401
1459
  }
1402
1460
  let d = this.rules.other.listTaskCheckbox.exec(c.raw);
1403
1461
  if (d) {
1404
- let m = { type: "checkbox", raw: d[0] + " ", checked: d[0] !== "[ ]" };
1405
- c.checked = m.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 = m.raw + c.tokens[0].raw, c.tokens[0].text = m.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(m)) : c.tokens.unshift({ type: "paragraph", raw: m.raw, text: m.raw, tokens: [m] }) : c.tokens.unshift(m);
1462
+ let f = { type: "checkbox", raw: d[0] + " ", checked: d[0] !== "[ ]" };
1463
+ c.checked = f.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 = f.raw + c.tokens[0].raw, c.tokens[0].text = f.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(f)) : c.tokens.unshift({ type: "paragraph", raw: f.raw, text: f.raw, tokens: [f] }) : c.tokens.unshift(f);
1406
1464
  }
1407
1465
  } else c.task && (c.task = !1);
1408
1466
  if (!s.loose) {
1409
- let d = c.tokens.filter((x) => x.type === "space"), m = d.length > 0 && d.some((x) => this.rules.other.anyLine.test(x.raw));
1410
- s.loose = m;
1467
+ let d = c.tokens.filter((b) => b.type === "space"), f = d.length > 0 && d.some((b) => this.rules.other.anyLine.test(b.raw));
1468
+ s.loose = f;
1411
1469
  }
1412
1470
  }
1413
1471
  if (s.loose) for (let c of s.items) {
1414
1472
  c.loose = !0;
1415
- for (let b of c.tokens) b.type === "text" && (b.type = "paragraph");
1473
+ for (let x of c.tokens) x.type === "text" && (x.type = "paragraph");
1416
1474
  }
1417
1475
  return s;
1418
1476
  }
@@ -1420,7 +1478,7 @@ ${d}` : d;
1420
1478
  html(t) {
1421
1479
  let e = this.rules.block.html.exec(t);
1422
1480
  if (e) {
1423
- let n = hs(e[0]);
1481
+ let n = ps(e[0]);
1424
1482
  return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
1425
1483
  }
1426
1484
  }
@@ -1428,20 +1486,20 @@ ${d}` : d;
1428
1486
  let e = this.rules.block.def.exec(t);
1429
1487
  if (e) {
1430
1488
  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];
1431
- return { type: "def", tag: n, raw: Se(e[0], `
1489
+ return { type: "def", tag: n, raw: Ee(e[0], `
1432
1490
  `), href: r, title: s };
1433
1491
  }
1434
1492
  }
1435
1493
  table(t) {
1436
1494
  let e = this.rules.block.table.exec(t);
1437
1495
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1438
- let n = us(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1439
- `) : [], l = { type: "table", raw: Se(e[0], `
1496
+ let n = hs(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1497
+ `) : [], l = { type: "table", raw: Ee(e[0], `
1440
1498
  `), header: [], align: [], rows: [] };
1441
1499
  if (n.length === r.length) {
1442
1500
  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);
1443
1501
  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] });
1444
- for (let o of s) l.rows.push(us(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
1502
+ for (let o of s) l.rows.push(hs(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
1445
1503
  return l;
1446
1504
  }
1447
1505
  }
@@ -1449,7 +1507,7 @@ ${d}` : d;
1449
1507
  let e = this.rules.block.lheading.exec(t);
1450
1508
  if (e) {
1451
1509
  let n = e[1].trim();
1452
- return { type: "heading", raw: Se(e[0], `
1510
+ return { type: "heading", raw: Ee(e[0], `
1453
1511
  `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1454
1512
  }
1455
1513
  }
@@ -1479,10 +1537,10 @@ ${d}` : d;
1479
1537
  let n = e[2].trim();
1480
1538
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1481
1539
  if (!this.rules.other.endAngleBracket.test(n)) return;
1482
- let l = Se(n.slice(0, -1), "\\");
1540
+ let l = Ee(n.slice(0, -1), "\\");
1483
1541
  if ((n.length - l.length) % 2 === 0) return;
1484
1542
  } else {
1485
- let l = yi(e[2], "()");
1543
+ let l = wi(e[2], "()");
1486
1544
  if (l === -2) return;
1487
1545
  if (l > -1) {
1488
1546
  let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
@@ -1494,7 +1552,7 @@ ${d}` : d;
1494
1552
  let l = this.rules.other.pedanticHrefTitle.exec(r);
1495
1553
  l && (r = l[1], s = l[3]);
1496
1554
  } else s = e[3] ? e[3].slice(1, -1) : "";
1497
- 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)), ps(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);
1555
+ 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)), ds(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);
1498
1556
  }
1499
1557
  }
1500
1558
  reflink(t, e) {
@@ -1505,14 +1563,14 @@ ${d}` : d;
1505
1563
  let l = n[0].charAt(0);
1506
1564
  return { type: "text", raw: l, text: l };
1507
1565
  }
1508
- return ps(n, s, n[0], this.lexer, this.rules);
1566
+ return ds(n, s, n[0], this.lexer, this.rules);
1509
1567
  }
1510
1568
  }
1511
1569
  emStrong(t, e, n = "") {
1512
1570
  let r = this.rules.inline.emStrongLDelim.exec(t);
1513
1571
  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))) {
1514
- let s = [...r[0]].length - 1, l, o, p = s, c = 0, b = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1515
- for (b.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = b.exec(e)) !== null; ) {
1572
+ let s = [...r[0]].length - 1, l, o, p = s, c = 0, x = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1573
+ for (x.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = x.exec(e)) !== null; ) {
1516
1574
  if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
1517
1575
  if (o = [...l].length, r[3] || r[4]) {
1518
1576
  p += o;
@@ -1523,13 +1581,13 @@ ${d}` : d;
1523
1581
  }
1524
1582
  if (p -= o, p > 0) continue;
1525
1583
  o = Math.min(o, o + p + c);
1526
- let d = [...r[0]][0].length, m = t.slice(0, s + r.index + d + o);
1584
+ let d = [...r[0]][0].length, f = t.slice(0, s + r.index + d + o);
1527
1585
  if (Math.min(s, o) % 2) {
1528
- let f = m.slice(1, -1);
1529
- return { type: "em", raw: m, text: f, tokens: this.lexer.inlineTokens(f) };
1586
+ let g = f.slice(1, -1);
1587
+ return { type: "em", raw: f, text: g, tokens: this.lexer.inlineTokens(g) };
1530
1588
  }
1531
- let x = m.slice(2, -2);
1532
- return { type: "strong", raw: m, text: x, tokens: this.lexer.inlineTokens(x) };
1589
+ let b = f.slice(2, -2);
1590
+ return { type: "strong", raw: f, text: b, tokens: this.lexer.inlineTokens(b) };
1533
1591
  }
1534
1592
  }
1535
1593
  }
@@ -1556,8 +1614,8 @@ ${d}` : d;
1556
1614
  }
1557
1615
  if (p -= o, p > 0) continue;
1558
1616
  o = Math.min(o, o + p);
1559
- let b = [...r[0]][0].length, d = t.slice(0, s + r.index + b + o), m = d.slice(s, -s);
1560
- return { type: "del", raw: d, text: m, tokens: this.lexer.inlineTokens(m) };
1617
+ let x = [...r[0]][0].length, d = t.slice(0, s + r.index + x + o), f = d.slice(s, -s);
1618
+ return { type: "del", raw: d, text: f, tokens: this.lexer.inlineTokens(f) };
1561
1619
  }
1562
1620
  }
1563
1621
  }
@@ -1590,28 +1648,28 @@ ${d}` : d;
1590
1648
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1591
1649
  }
1592
1650
  }
1593
- }, h(Ze, "w"), Ze), Ee, ue = (Ee = class {
1651
+ }, h(Ke, "w"), Ke), Re, pe = (Re = class {
1594
1652
  constructor(t) {
1595
1653
  O(this, "tokens");
1596
1654
  O(this, "options");
1597
1655
  O(this, "state");
1598
1656
  O(this, "inlineQueue");
1599
1657
  O(this, "tokenizer");
1600
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new Dt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1601
- let e = { other: J, block: Et.normal, inline: ot.normal };
1602
- this.options.pedantic ? (e.block = Et.pedantic, e.inline = ot.pedantic) : this.options.gfm && (e.block = Et.gfm, this.options.breaks ? e.inline = ot.breaks : e.inline = ot.gfm), this.tokenizer.rules = e;
1658
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Ne, this.options.tokenizer = this.options.tokenizer || new Lt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1659
+ let e = { other: ne, block: It.normal, inline: ht.normal };
1660
+ this.options.pedantic ? (e.block = It.pedantic, e.inline = ht.pedantic) : this.options.gfm && (e.block = It.gfm, this.options.breaks ? e.inline = ht.breaks : e.inline = ht.gfm), this.tokenizer.rules = e;
1603
1661
  }
1604
1662
  static get rules() {
1605
- return { block: Et, inline: ot };
1663
+ return { block: It, inline: ht };
1606
1664
  }
1607
1665
  static lex(t, e) {
1608
- return new Ee(e).lex(t);
1666
+ return new Re(e).lex(t);
1609
1667
  }
1610
1668
  static lexInline(t, e) {
1611
- return new Ee(e).inlineTokens(t);
1669
+ return new Re(e).inlineTokens(t);
1612
1670
  }
1613
1671
  lex(t) {
1614
- t = t.replace(J.carriageReturn, `
1672
+ t = t.replace(ne.carriageReturn, `
1615
1673
  `), this.blockTokens(t, this.tokens);
1616
1674
  for (let e = 0; e < this.inlineQueue.length; e++) {
1617
1675
  let n = this.inlineQueue[e];
@@ -1620,7 +1678,7 @@ ${d}` : d;
1620
1678
  return this.inlineQueue = [], this.tokens;
1621
1679
  }
1622
1680
  blockTokens(t, e = [], n = !1) {
1623
- this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(J.tabCharGlobal, " ").replace(J.spaceLine, ""));
1681
+ this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(ne.tabCharGlobal, " ").replace(ne.spaceLine, ""));
1624
1682
  let r = 1 / 0;
1625
1683
  for (; t; ) {
1626
1684
  if (t.length < r) r = t.length;
@@ -1690,8 +1748,8 @@ ${d}` : d;
1690
1748
  let l = t;
1691
1749
  if (this.options.extensions?.startBlock) {
1692
1750
  let o = 1 / 0, p = t.slice(1), c;
1693
- this.options.extensions.startBlock.forEach((b) => {
1694
- c = b.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1751
+ this.options.extensions.startBlock.forEach((x) => {
1752
+ c = x.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
1695
1753
  }), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
1696
1754
  }
1697
1755
  if (this.state.top && (s = this.tokenizer.paragraph(l))) {
@@ -1784,14 +1842,14 @@ ${d}` : d;
1784
1842
  t = t.substring(c.raw.length), e.push(c);
1785
1843
  continue;
1786
1844
  }
1787
- let b = t;
1845
+ let x = t;
1788
1846
  if (this.options.extensions?.startInline) {
1789
- let d = 1 / 0, m = t.slice(1), x;
1790
- this.options.extensions.startInline.forEach((f) => {
1791
- x = f.call({ lexer: this }, m), typeof x == "number" && x >= 0 && (d = Math.min(d, x));
1792
- }), d < 1 / 0 && d >= 0 && (b = t.substring(0, d + 1));
1847
+ let d = 1 / 0, f = t.slice(1), b;
1848
+ this.options.extensions.startInline.forEach((g) => {
1849
+ b = g.call({ lexer: this }, f), typeof b == "number" && b >= 0 && (d = Math.min(d, b));
1850
+ }), d < 1 / 0 && d >= 0 && (x = t.substring(0, d + 1));
1793
1851
  }
1794
- if (c = this.tokenizer.inlineText(b)) {
1852
+ if (c = this.tokenizer.inlineText(x)) {
1795
1853
  t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
1796
1854
  let d = e.at(-1);
1797
1855
  d?.type === "text" ? (d.raw += c.raw, d.text += c.text) : e.push(c);
@@ -1809,20 +1867,20 @@ ${d}` : d;
1809
1867
  if (this.options.silent) console.error(e);
1810
1868
  else throw new Error(e);
1811
1869
  }
1812
- }, h(Ee, "l"), Ee), Xe, Ot = (Xe = class {
1870
+ }, h(Re, "l"), Re), Qe, Nt = (Qe = class {
1813
1871
  constructor(t) {
1814
1872
  O(this, "options");
1815
1873
  O(this, "parser");
1816
- this.options = t || Le;
1874
+ this.options = t || Ne;
1817
1875
  }
1818
1876
  space(t) {
1819
1877
  return "";
1820
1878
  }
1821
1879
  code({ text: t, lang: e, escaped: n }) {
1822
- let r = (e || "").match(J.notSpaceStart)?.[0], s = t.replace(J.endingNewline, "") + `
1880
+ let r = (e || "").match(ne.notSpaceStart)?.[0], s = t.replace(ne.endingNewline, "") + `
1823
1881
  `;
1824
- return r ? '<pre><code class="language-' + fe(r) + '">' + (n ? s : fe(s, !0)) + `</code></pre>
1825
- ` : "<pre><code>" + (n ? s : fe(s, !0)) + `</code></pre>
1882
+ return r ? '<pre><code class="language-' + ke(r) + '">' + (n ? s : ke(s, !0)) + `</code></pre>
1883
+ ` : "<pre><code>" + (n ? s : ke(s, !0)) + `</code></pre>
1826
1884
  `;
1827
1885
  }
1828
1886
  blockquote({ tokens: t }) {
@@ -1900,7 +1958,7 @@ ${t}</tr>
1900
1958
  return `<em>${this.parser.parseInline(t)}</em>`;
1901
1959
  }
1902
1960
  codespan({ text: t }) {
1903
- return `<code>${fe(t, !0)}</code>`;
1961
+ return `<code>${ke(t, !0)}</code>`;
1904
1962
  }
1905
1963
  br(t) {
1906
1964
  return "<br>";
@@ -1909,24 +1967,24 @@ ${t}</tr>
1909
1967
  return `<del>${this.parser.parseInline(t)}</del>`;
1910
1968
  }
1911
1969
  link({ href: t, title: e, tokens: n }) {
1912
- let r = this.parser.parseInline(n), s = cs(t);
1970
+ let r = this.parser.parseInline(n), s = us(t);
1913
1971
  if (s === null) return r;
1914
1972
  t = s;
1915
1973
  let l = '<a href="' + t + '"';
1916
- return e && (l += ' title="' + fe(e) + '"'), l += ">" + r + "</a>", l;
1974
+ return e && (l += ' title="' + ke(e) + '"'), l += ">" + r + "</a>", l;
1917
1975
  }
1918
1976
  image({ href: t, title: e, text: n, tokens: r }) {
1919
1977
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1920
- let s = cs(t);
1921
- if (s === null) return fe(n);
1978
+ let s = us(t);
1979
+ if (s === null) return ke(n);
1922
1980
  t = s;
1923
- let l = `<img src="${t}" alt="${fe(n)}"`;
1924
- return e && (l += ` title="${fe(e)}"`), l += ">", l;
1981
+ let l = `<img src="${t}" alt="${ke(n)}"`;
1982
+ return e && (l += ` title="${ke(e)}"`), l += ">", l;
1925
1983
  }
1926
1984
  text(t) {
1927
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : fe(t.text);
1985
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : ke(t.text);
1928
1986
  }
1929
- }, h(Xe, "y"), Xe), Ke, mn = (Ke = class {
1987
+ }, h(Qe, "y"), Qe), Je, bn = (Je = class {
1930
1988
  strong({ text: t }) {
1931
1989
  return t;
1932
1990
  }
@@ -1957,18 +2015,18 @@ ${t}</tr>
1957
2015
  checkbox({ raw: t }) {
1958
2016
  return t;
1959
2017
  }
1960
- }, h(Ke, "L"), Ke), _e, he = (_e = class {
2018
+ }, h(Je, "L"), Je), Ie, de = (Ie = class {
1961
2019
  constructor(t) {
1962
2020
  O(this, "options");
1963
2021
  O(this, "renderer");
1964
2022
  O(this, "textRenderer");
1965
- this.options = t || Le, this.options.renderer = this.options.renderer || new Ot(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new mn();
2023
+ this.options = t || Ne, this.options.renderer = this.options.renderer || new Nt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new bn();
1966
2024
  }
1967
2025
  static parse(t, e) {
1968
- return new _e(e).parse(t);
2026
+ return new Ie(e).parse(t);
1969
2027
  }
1970
2028
  static parseInline(t, e) {
1971
- return new _e(e).parseInline(t);
2029
+ return new Ie(e).parseInline(t);
1972
2030
  }
1973
2031
  parse(t) {
1974
2032
  this.renderer.parser = this;
@@ -2108,11 +2166,11 @@ ${t}</tr>
2108
2166
  }
2109
2167
  return n;
2110
2168
  }
2111
- }, h(_e, "l"), _e), Ae, ut = (Ae = class {
2169
+ }, h(Ie, "l"), Ie), _e, dt = (_e = class {
2112
2170
  constructor(t) {
2113
2171
  O(this, "options");
2114
2172
  O(this, "block");
2115
- this.options = t || Le;
2173
+ this.options = t || Ne;
2116
2174
  }
2117
2175
  preprocess(t) {
2118
2176
  return t;
@@ -2127,23 +2185,23 @@ ${t}</tr>
2127
2185
  return t;
2128
2186
  }
2129
2187
  provideLexer(t = this.block) {
2130
- return t ? ue.lex : ue.lexInline;
2188
+ return t ? pe.lex : pe.lexInline;
2131
2189
  }
2132
2190
  provideParser(t = this.block) {
2133
- return t ? he.parse : he.parseInline;
2191
+ return t ? de.parse : de.parseInline;
2134
2192
  }
2135
- }, h(Ae, "P"), O(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), O(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), Qe, Ti = (Qe = class {
2193
+ }, h(_e, "P"), O(_e, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), O(_e, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _e), et, Si = (et = class {
2136
2194
  constructor(...t) {
2137
- O(this, "defaults", on());
2195
+ O(this, "defaults", cn());
2138
2196
  O(this, "options", this.setOptions);
2139
2197
  O(this, "parse", this.parseMarkdown(!0));
2140
2198
  O(this, "parseInline", this.parseMarkdown(!1));
2141
- O(this, "Parser", he);
2142
- O(this, "Renderer", Ot);
2143
- O(this, "TextRenderer", mn);
2144
- O(this, "Lexer", ue);
2145
- O(this, "Tokenizer", Dt);
2146
- O(this, "Hooks", ut);
2199
+ O(this, "Parser", de);
2200
+ O(this, "Renderer", Nt);
2201
+ O(this, "TextRenderer", bn);
2202
+ O(this, "Lexer", pe);
2203
+ O(this, "Tokenizer", Lt);
2204
+ O(this, "Hooks", dt);
2147
2205
  this.use(...t);
2148
2206
  }
2149
2207
  walkTokens(t, e) {
@@ -2190,51 +2248,51 @@ ${t}</tr>
2190
2248
  }
2191
2249
  "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2192
2250
  }), r.extensions = e), n.renderer) {
2193
- let s = this.defaults.renderer || new Ot(this.defaults);
2251
+ let s = this.defaults.renderer || new Nt(this.defaults);
2194
2252
  for (let l in n.renderer) {
2195
2253
  if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
2196
2254
  if (["options", "parser"].includes(l)) continue;
2197
2255
  let o = l, p = n.renderer[o], c = s[o];
2198
- s[o] = (...b) => {
2199
- let d = p.apply(s, b);
2200
- return d === !1 && (d = c.apply(s, b)), d || "";
2256
+ s[o] = (...x) => {
2257
+ let d = p.apply(s, x);
2258
+ return d === !1 && (d = c.apply(s, x)), d || "";
2201
2259
  };
2202
2260
  }
2203
2261
  r.renderer = s;
2204
2262
  }
2205
2263
  if (n.tokenizer) {
2206
- let s = this.defaults.tokenizer || new Dt(this.defaults);
2264
+ let s = this.defaults.tokenizer || new Lt(this.defaults);
2207
2265
  for (let l in n.tokenizer) {
2208
2266
  if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
2209
2267
  if (["options", "rules", "lexer"].includes(l)) continue;
2210
2268
  let o = l, p = n.tokenizer[o], c = s[o];
2211
- s[o] = (...b) => {
2212
- let d = p.apply(s, b);
2213
- return d === !1 && (d = c.apply(s, b)), d;
2269
+ s[o] = (...x) => {
2270
+ let d = p.apply(s, x);
2271
+ return d === !1 && (d = c.apply(s, x)), d;
2214
2272
  };
2215
2273
  }
2216
2274
  r.tokenizer = s;
2217
2275
  }
2218
2276
  if (n.hooks) {
2219
- let s = this.defaults.hooks || new ut();
2277
+ let s = this.defaults.hooks || new dt();
2220
2278
  for (let l in n.hooks) {
2221
2279
  if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
2222
2280
  if (["options", "block"].includes(l)) continue;
2223
2281
  let o = l, p = n.hooks[o], c = s[o];
2224
- ut.passThroughHooks.has(l) ? s[o] = (b) => {
2225
- if (this.defaults.async && ut.passThroughHooksRespectAsync.has(l)) return (async () => {
2226
- let m = await p.call(s, b);
2227
- return c.call(s, m);
2282
+ dt.passThroughHooks.has(l) ? s[o] = (x) => {
2283
+ if (this.defaults.async && dt.passThroughHooksRespectAsync.has(l)) return (async () => {
2284
+ let f = await p.call(s, x);
2285
+ return c.call(s, f);
2228
2286
  })();
2229
- let d = p.call(s, b);
2287
+ let d = p.call(s, x);
2230
2288
  return c.call(s, d);
2231
- } : s[o] = (...b) => {
2289
+ } : s[o] = (...x) => {
2232
2290
  if (this.defaults.async) return (async () => {
2233
- let m = await p.apply(s, b);
2234
- return m === !1 && (m = await c.apply(s, b)), m;
2291
+ let f = await p.apply(s, x);
2292
+ return f === !1 && (f = await c.apply(s, x)), f;
2235
2293
  })();
2236
- let d = p.apply(s, b);
2237
- return d === !1 && (d = c.apply(s, b)), d;
2294
+ let d = p.apply(s, x);
2295
+ return d === !1 && (d = c.apply(s, x)), d;
2238
2296
  };
2239
2297
  }
2240
2298
  r.hooks = s;
@@ -2253,10 +2311,10 @@ ${t}</tr>
2253
2311
  return this.defaults = { ...this.defaults, ...t }, this;
2254
2312
  }
2255
2313
  lexer(t, e) {
2256
- return ue.lex(t, e ?? this.defaults);
2314
+ return pe.lex(t, e ?? this.defaults);
2257
2315
  }
2258
2316
  parser(t, e) {
2259
- return he.parse(t, e ?? this.defaults);
2317
+ return de.parse(t, e ?? this.defaults);
2260
2318
  }
2261
2319
  parseMarkdown(t) {
2262
2320
  return (e, n) => {
@@ -2265,16 +2323,16 @@ ${t}</tr>
2265
2323
  if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
2266
2324
  if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2267
2325
  if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2268
- let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? ue.lex : ue.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
2326
+ let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? pe.lex : pe.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
2269
2327
  s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2270
- let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? he.parse : he.parseInline)(c, s);
2271
- return s.hooks ? await s.hooks.postprocess(b) : b;
2328
+ let x = await (s.hooks ? await s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(c, s);
2329
+ return s.hooks ? await s.hooks.postprocess(x) : x;
2272
2330
  })().catch(l);
2273
2331
  try {
2274
2332
  s.hooks && (e = s.hooks.preprocess(e));
2275
- let o = (s.hooks ? s.hooks.provideLexer(t) : t ? ue.lex : ue.lexInline)(e, s);
2333
+ let o = (s.hooks ? s.hooks.provideLexer(t) : t ? pe.lex : pe.lexInline)(e, s);
2276
2334
  s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
2277
- let p = (s.hooks ? s.hooks.provideParser(t) : t ? he.parse : he.parseInline)(o, s);
2335
+ let p = (s.hooks ? s.hooks.provideParser(t) : t ? de.parse : de.parseInline)(o, s);
2278
2336
  return s.hooks && (p = s.hooks.postprocess(p)), p;
2279
2337
  } catch (o) {
2280
2338
  return l(o);
@@ -2285,57 +2343,57 @@ ${t}</tr>
2285
2343
  return (n) => {
2286
2344
  if (n.message += `
2287
2345
  Please report this to https://github.com/markedjs/marked.`, t) {
2288
- let r = "<p>An error occurred:</p><pre>" + fe(n.message + "", !0) + "</pre>";
2346
+ let r = "<p>An error occurred:</p><pre>" + ke(n.message + "", !0) + "</pre>";
2289
2347
  return e ? Promise.resolve(r) : r;
2290
2348
  }
2291
2349
  if (e) return Promise.reject(n);
2292
2350
  throw n;
2293
2351
  };
2294
2352
  }
2295
- }, h(Qe, "q"), Qe), Me = new Ti();
2296
- function N(i, t) {
2297
- return Me.parse(i, t);
2353
+ }, h(et, "q"), et), Le = new Si();
2354
+ function z(a, t) {
2355
+ return Le.parse(a, t);
2298
2356
  }
2299
- h(N, "g");
2300
- N.options = N.setOptions = function(i) {
2301
- return Me.setOptions(i), N.defaults = Me.defaults, vs(N.defaults), N;
2357
+ h(z, "g");
2358
+ z.options = z.setOptions = function(a) {
2359
+ return Le.setOptions(a), z.defaults = Le.defaults, Ts(z.defaults), z;
2302
2360
  };
2303
- N.getDefaults = on;
2304
- N.defaults = Le;
2305
- N.use = function(...i) {
2306
- return Me.use(...i), N.defaults = Me.defaults, vs(N.defaults), N;
2361
+ z.getDefaults = cn;
2362
+ z.defaults = Ne;
2363
+ z.use = function(...a) {
2364
+ return Le.use(...a), z.defaults = Le.defaults, Ts(z.defaults), z;
2307
2365
  };
2308
- N.walkTokens = function(i, t) {
2309
- return Me.walkTokens(i, t);
2366
+ z.walkTokens = function(a, t) {
2367
+ return Le.walkTokens(a, t);
2310
2368
  };
2311
- N.parseInline = Me.parseInline;
2312
- N.Parser = he;
2313
- N.parser = he.parse;
2314
- N.Renderer = Ot;
2315
- N.TextRenderer = mn;
2316
- N.Lexer = ue;
2317
- N.lexer = ue.lex;
2318
- N.Tokenizer = Dt;
2319
- N.Hooks = ut;
2320
- N.parse = N;
2321
- N.options;
2322
- N.setOptions;
2323
- N.use;
2324
- N.walkTokens;
2325
- N.parseInline;
2326
- he.parse;
2327
- ue.lex;
2328
- const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2369
+ z.parseInline = Le.parseInline;
2370
+ z.Parser = de;
2371
+ z.parser = de.parse;
2372
+ z.Renderer = Nt;
2373
+ z.TextRenderer = bn;
2374
+ z.Lexer = pe;
2375
+ z.lexer = pe.lex;
2376
+ z.Tokenizer = Lt;
2377
+ z.Hooks = dt;
2378
+ z.parse = z;
2379
+ z.options;
2380
+ z.setOptions;
2381
+ z.use;
2382
+ z.walkTokens;
2383
+ z.parseInline;
2384
+ de.parse;
2385
+ pe.lex;
2386
+ const Ai = ["innerHTML"], Ct = /* @__PURE__ */ ve({
2329
2387
  __name: "ChatRichText",
2330
2388
  props: {
2331
2389
  text: {},
2332
2390
  inverted: { type: Boolean },
2333
2391
  streaming: { type: Boolean }
2334
2392
  },
2335
- setup(i) {
2336
- const t = i, e = gs(t.text);
2393
+ setup(a) {
2394
+ const t = a, e = ms(t.text);
2337
2395
  let n;
2338
- Je(
2396
+ tt(
2339
2397
  [() => t.text, () => t.streaming],
2340
2398
  ([l, o]) => {
2341
2399
  if (!o) {
@@ -2346,10 +2404,10 @@ const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2346
2404
  n = void 0, e.value = t.text;
2347
2405
  }));
2348
2406
  }
2349
- ), ms(() => {
2407
+ ), bs(() => {
2350
2408
  n !== void 0 && cancelAnimationFrame(n);
2351
2409
  });
2352
- const r = new N.Renderer();
2410
+ const r = new z.Renderer();
2353
2411
  r.link = ({ href: l, text: o }) => {
2354
2412
  const p = l.trim();
2355
2413
  if (!p || p === "#")
@@ -2362,22 +2420,22 @@ const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2362
2420
  c = !1;
2363
2421
  }
2364
2422
  return c ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
2365
- }, N.setOptions({ breaks: !0, gfm: !0, renderer: r });
2366
- const s = U(() => {
2423
+ }, z.setOptions({ breaks: !0, gfm: !0, renderer: r });
2424
+ const s = W(() => {
2367
2425
  const l = e.value;
2368
2426
  if (!l) return "";
2369
- const o = N.parse(l, { async: !1 });
2370
- return zr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2427
+ const o = z.parse(l, { async: !1 });
2428
+ return $r.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2371
2429
  });
2372
- return (l, o) => (T(), A("div", {
2373
- class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", i.inverted ? "chat-msg-prose-invert" : ""]),
2430
+ return (l, o) => (v(), S("div", {
2431
+ class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
2374
2432
  innerHTML: s.value
2375
- }, null, 10, Si));
2433
+ }, null, 10, Ai));
2376
2434
  }
2377
- }), Ai = 80, Ei = /* @__PURE__ */ ke({
2435
+ }), Ei = 80, _i = /* @__PURE__ */ ve({
2378
2436
  __name: "ChatScroller",
2379
- setup(i, { expose: t }) {
2380
- const e = Q(), n = Q();
2437
+ setup(a, { expose: t }) {
2438
+ const e = ee(), n = ee();
2381
2439
  let r = !0, s;
2382
2440
  function l() {
2383
2441
  const c = e.value;
@@ -2386,63 +2444,63 @@ const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2386
2444
  h(l, "scrollToBottom");
2387
2445
  function o() {
2388
2446
  const c = e.value;
2389
- c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= Ai);
2447
+ c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= Ei);
2390
2448
  }
2391
2449
  h(o, "onScroll");
2392
2450
  function p() {
2393
2451
  r = !0, l();
2394
2452
  }
2395
- return h(p, "pin"), t({ pin: p }), Mt(() => {
2453
+ return h(p, "pin"), t({ pin: p }), zt(() => {
2396
2454
  requestAnimationFrame(() => {
2397
2455
  l(), requestAnimationFrame(l);
2398
2456
  }), n.value && (s = new ResizeObserver(() => {
2399
2457
  r && l();
2400
2458
  }), s.observe(n.value));
2401
- }), ms(() => {
2459
+ }), bs(() => {
2402
2460
  s?.disconnect();
2403
- }), (c, b) => (T(), A("div", {
2461
+ }), (c, x) => (v(), S("div", {
2404
2462
  ref_key: "viewport",
2405
2463
  ref: e,
2406
2464
  class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
2407
2465
  onScrollPassive: o
2408
2466
  }, [
2409
- S("div", {
2467
+ T("div", {
2410
2468
  ref_key: "content",
2411
2469
  ref: n
2412
2470
  }, [
2413
- ln(c.$slots, "default")
2471
+ on(c.$slots, "default")
2414
2472
  ], 512)
2415
2473
  ], 544));
2416
2474
  }
2417
- }), _i = { class: "@container/chat flex flex-col h-full relative" }, Ri = {
2475
+ }), Ri = { class: "@container/chat flex flex-col h-full relative" }, Ii = {
2418
2476
  key: 0,
2419
2477
  class: "pb-4"
2420
- }, Ii = { class: "pt-4 pb-[120px] px-3 space-y-1" }, Ci = {
2478
+ }, Ci = { class: "pt-4 pb-[120px] px-3 space-y-1" }, Di = {
2421
2479
  key: 0,
2422
2480
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2423
- }, Di = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Oi = ["src", "alt"], Mi = ["title"], Li = {
2481
+ }, Oi = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Mi = ["src", "alt"], Li = ["title"], Ni = {
2424
2482
  key: 0,
2425
2483
  class: "flex items-center gap-3 py-3 px-2"
2426
- }, Ni = ["data-issue-code", "data-issue-bucket"], zi = { class: "max-w-[85%] min-w-0" }, $i = ["href"], Pi = ["data-test"], Bi = {
2484
+ }, zi = ["data-issue-code", "data-issue-bucket"], $i = { class: "max-w-[85%] min-w-0" }, Pi = ["href"], Bi = ["data-test"], Fi = {
2427
2485
  key: 0,
2428
2486
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2429
- }, Fi = ["src", "alt"], Ui = ["src", "alt"], Hi = ["src"], ji = ["href"], Gi = {
2487
+ }, Ui = ["src", "alt"], Hi = ["src", "alt"], ji = ["src"], Gi = ["href"], Wi = {
2430
2488
  key: 1,
2431
2489
  "data-test": "messaging-thinking-indicator",
2432
2490
  class: "flex gap-2 justify-start items-center mb-4"
2433
- }, Wi = ["src", "alt"], qi = {
2491
+ }, qi = ["src", "alt"], Vi = {
2434
2492
  key: 0,
2435
2493
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
2436
- }, Vi = ["src", "alt"], Yi = { class: "max-w-20 truncate" }, Zi = ["onClick"], Xi = {
2494
+ }, Yi = ["src", "alt"], Zi = { class: "max-w-20 truncate" }, Xi = ["onClick"], Ki = {
2437
2495
  key: 0,
2438
2496
  class: "shrink-0 flex items-center justify-center size-14"
2439
- }, Ki = ["disabled"], Qi = {
2497
+ }, Qi = ["disabled"], Ji = {
2440
2498
  key: 0,
2441
2499
  class: "i-svg-spinners-ring-resize size-4"
2442
- }, Ji = {
2500
+ }, ea = {
2443
2501
  key: 1,
2444
2502
  class: "i-tabler-paperclip size-5"
2445
- }, ea = ["placeholder", "disabled"], ta = ["disabled"], da = /* @__PURE__ */ ke({
2503
+ }, ta = ["placeholder", "disabled"], na = ["disabled"], fa = /* @__PURE__ */ ve({
2446
2504
  __name: "ElAgentChat",
2447
2505
  props: {
2448
2506
  chatController: {},
@@ -2454,401 +2512,401 @@ const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2454
2512
  setupHint: {},
2455
2513
  emptyStateMessage: {}
2456
2514
  },
2457
- setup(i) {
2515
+ setup(a) {
2458
2516
  const t = {
2459
2517
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2460
2518
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2461
2519
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2462
- }, e = U(() => {
2463
- const I = { ...t[i.scope] };
2464
- return i.scope === "org" && i.scopeName && (I.label = i.scopeName, I.tooltip = `Visible to ${i.scopeName} members`), I;
2465
- }), n = Q(""), r = Q(!1), s = Q(), l = Q(), o = Q(), p = Q([]), c = Q(!1);
2466
- function b(I) {
2467
- return I ? /\[[^\]]+\]\([^)]+\)/.test(I) : !1;
2520
+ }, e = W(() => {
2521
+ const C = { ...t[a.scope] };
2522
+ return a.scope === "org" && a.scopeName && (C.label = a.scopeName, C.tooltip = `Visible to ${a.scopeName} members`), C;
2523
+ }), n = ee(""), r = ee(!1), s = ee(), l = ee(), o = ee(), p = ee([]), c = ee(!1);
2524
+ function x(C) {
2525
+ return C ? /\[[^\]]+\]\([^)]+\)/.test(C) : !1;
2468
2526
  }
2469
- h(b, "containsMarkdownLink");
2470
- function d(I) {
2471
- return I.sender === "system" && (!!I.issue || I.id === re.value);
2527
+ h(x, "containsMarkdownLink");
2528
+ function d(C) {
2529
+ return C.sender === "system" && (!!C.issue || C.id === j.value);
2472
2530
  }
2473
2531
  h(d, "isSystemExplainerMessage");
2474
- function m(I, k) {
2475
- const y = I[k], E = I[k + 1];
2476
- return !E || E.sender !== y.sender;
2477
- }
2478
- h(m, "shouldShowAvatar");
2479
- const x = U(() => i.chatController?.textState.value), f = U(() => x.value?.isConnected ?? !1), v = U(() => x.value?.isThinking ?? !1), C = U(() => x.value?.connectionStatus === "disconnected" && !!x.value?.error), z = U(() => x.value?.connectionStatus !== "connected" && !x.value?.error), ee = U(() => x.value?.error), te = U(() => i.chatController?.sharedMessages.value ?? []), re = U(() => {
2480
- if (!v.value) return;
2481
- const I = te.value, k = I[I.length - 1];
2532
+ function f(C, k) {
2533
+ const w = C[k], E = C[k + 1];
2534
+ return !E || E.sender !== w.sender;
2535
+ }
2536
+ h(f, "shouldShowAvatar");
2537
+ const b = W(() => a.chatController?.textState.value), g = W(() => b.value?.isConnected ?? !1), A = W(() => b.value?.isThinking ?? !1), I = W(() => b.value?.connectionStatus === "disconnected" && !!b.value?.error), N = W(() => b.value?.connectionStatus !== "connected" && !b.value?.error), Z = W(() => b.value?.error), se = W(() => a.chatController?.sharedMessages.value ?? []), j = W(() => {
2538
+ if (!A.value) return;
2539
+ const C = se.value, k = C[C.length - 1];
2482
2540
  return k?.sender === "agent" || k?.sender === "system" ? k.id : void 0;
2483
- }), ge = U(() => v.value ? re.value === void 0 : !1), $ = U(() => x.value?.sendBlockedReason), Y = U(() => !f.value || $.value !== void 0), me = U(() => C.value ? "Agent is offline" : z.value ? "Connecting..." : $.value === "agent_deleted" ? "This assistant was deleted" : $.value === "account" ? "Resolve the billing issue above to continue" : "Message"), ye = U(() => (n.value.trim() || p.value.length > 0) && !Y.value && !c.value), M = U(() => i.variant === "light"), pt = U(
2541
+ }), ae = W(() => A.value ? j.value === void 0 : !1), B = W(() => b.value?.sendBlockedReason), Q = W(() => !g.value || B.value !== void 0), ye = W(() => I.value ? "Agent is offline" : N.value ? "Connecting..." : B.value === "agent_deleted" ? "This assistant was deleted" : B.value === "account" ? "Resolve the billing issue above to continue" : "Message"), Te = W(() => (n.value.trim() || p.value.length > 0) && !Q.value && !c.value), M = W(() => a.variant === "light"), gt = W(
2484
2542
  () => M.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2485
- ), tt = U(() => M.value ? "text-theme-300" : "text-white/30");
2486
- Mt(async () => {
2487
- i.chatController && !f.value && await i.chatController.startTextConversation();
2543
+ ), st = W(() => M.value ? "text-theme-300" : "text-white/30");
2544
+ zt(async () => {
2545
+ a.chatController && !g.value && await a.chatController.startTextConversation();
2488
2546
  });
2489
- async function dt() {
2490
- const I = n.value.trim(), k = p.value.length > 0;
2491
- if (!I && !k || !i.chatController || Y.value || c.value)
2547
+ async function mt() {
2548
+ const C = n.value.trim(), k = p.value.length > 0;
2549
+ if (!C && !k || !a.chatController || Q.value || c.value)
2492
2550
  return;
2493
- const y = n.value, E = k ? [...p.value] : void 0;
2494
- n.value = "", p.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await i.chatController.sendChatMessage(y, E);
2551
+ const w = n.value, E = k ? [...p.value] : void 0;
2552
+ n.value = "", p.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await a.chatController.sendChatMessage(w, E);
2495
2553
  }
2496
- h(dt, "sendMessage");
2497
- async function Z(I) {
2498
- I.key === "Enter" && !I.shiftKey && (I.preventDefault(), await dt());
2554
+ h(mt, "sendMessage");
2555
+ async function q(C) {
2556
+ C.key === "Enter" && !C.shiftKey && (C.preventDefault(), await mt());
2499
2557
  }
2500
- h(Z, "handleKeydown");
2501
- function Ne() {
2558
+ h(q, "handleKeydown");
2559
+ function ze() {
2502
2560
  l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
2503
2561
  }
2504
- h(Ne, "adjustTextareaHeight"), Je(n, () => Fs(() => Ne()));
2505
- function ze() {
2562
+ h(ze, "adjustTextareaHeight"), tt(n, () => Us(() => ze()));
2563
+ function $e() {
2506
2564
  o.value?.click();
2507
2565
  }
2508
- h(ze, "triggerFileInput");
2509
- async function $e(I) {
2510
- const k = I.target, y = k.files?.[0];
2511
- if (!(!y || !i.uploadFn)) {
2566
+ h($e, "triggerFileInput");
2567
+ async function Pe(C) {
2568
+ const k = C.target, w = k.files?.[0];
2569
+ if (!(!w || !a.uploadFn)) {
2512
2570
  c.value = !0;
2513
2571
  try {
2514
- const E = await i.uploadFn(y);
2572
+ const E = await a.uploadFn(w);
2515
2573
  p.value = [...p.value, E];
2516
2574
  } catch (E) {
2517
2575
  const X = E instanceof Error ? E.message : "Couldn't attach that file.";
2518
- i.chatController?.notify(`Upload failed — ${X}`);
2576
+ a.chatController?.notify(`Upload failed — ${X}`);
2519
2577
  } finally {
2520
2578
  c.value = !1, k.value = "";
2521
2579
  }
2522
2580
  }
2523
2581
  }
2524
- h($e, "handleFileSelect");
2525
- function zt(I) {
2526
- p.value = p.value.filter((k, y) => y !== I);
2582
+ h(Pe, "handleFileSelect");
2583
+ function Bt(C) {
2584
+ p.value = p.value.filter((k, w) => w !== C);
2527
2585
  }
2528
- h(zt, "removeAttachment");
2529
- function ft(I, k) {
2586
+ h(Bt, "removeAttachment");
2587
+ function bt(C, k) {
2530
2588
  if (k === 0) {
2531
- const P = I[k];
2532
- return P?.timestamp ? gt(new Date(P.timestamp)) : null;
2589
+ const F = C[k];
2590
+ return F?.timestamp ? xt(new Date(F.timestamp)) : null;
2533
2591
  }
2534
- const y = I[k - 1], E = I[k];
2535
- if (!y?.timestamp || !E?.timestamp) return null;
2536
- const X = new Date(y.timestamp).getTime();
2537
- return new Date(E.timestamp).getTime() - X > 36e5 ? gt(new Date(E.timestamp)) : null;
2592
+ const w = C[k - 1], E = C[k];
2593
+ if (!w?.timestamp || !E?.timestamp) return null;
2594
+ const X = new Date(w.timestamp).getTime();
2595
+ return new Date(E.timestamp).getTime() - X > 36e5 ? xt(new Date(E.timestamp)) : null;
2538
2596
  }
2539
- h(ft, "shouldShowTimeDivider");
2540
- function gt(I) {
2541
- const k = /* @__PURE__ */ new Date(), y = I.toDateString() === k.toDateString(), E = new Date(k);
2597
+ h(bt, "shouldShowTimeDivider");
2598
+ function xt(C) {
2599
+ const k = /* @__PURE__ */ new Date(), w = C.toDateString() === k.toDateString(), E = new Date(k);
2542
2600
  E.setDate(E.getDate() - 1);
2543
- const X = I.toDateString() === E.toDateString(), B = I.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2544
- if (y) return B;
2545
- if (X) return `Yesterday, ${B}`;
2546
- const nt = I.getFullYear() === k.getFullYear();
2547
- return `${I.toLocaleDateString("en-US", {
2601
+ const X = C.toDateString() === E.toDateString(), P = C.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2602
+ if (w) return P;
2603
+ if (X) return `Yesterday, ${P}`;
2604
+ const Be = C.getFullYear() === k.getFullYear();
2605
+ return `${C.toLocaleDateString("en-US", {
2548
2606
  weekday: "long",
2549
2607
  month: "short",
2550
2608
  day: "numeric",
2551
- ...nt ? {} : { year: "numeric" }
2552
- })}, ${B}`;
2553
- }
2554
- return h(gt, "formatTimeDivider"), (I, k) => (T(), A("div", _i, [
2555
- M.value ? q("", !0) : (T(), A("div", Ri, [
2556
- He(ir, {
2557
- agent: i.agent,
2558
- "is-online": f.value
2609
+ ...Be ? {} : { year: "numeric" }
2610
+ })}, ${P}`;
2611
+ }
2612
+ return h(xt, "formatTimeDivider"), (C, k) => (v(), S("div", Ri, [
2613
+ M.value ? Y("", !0) : (v(), S("div", Ii, [
2614
+ We(ar, {
2615
+ agent: a.agent,
2616
+ "is-online": g.value
2559
2617
  }, null, 8, ["agent", "is-online"])
2560
2618
  ])),
2561
- C.value ? (T(), A("div", {
2619
+ I.value ? (v(), S("div", {
2562
2620
  key: 1,
2563
2621
  class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", M.value ? "text-theme-400" : "text-white/60"])
2564
2622
  }, [
2565
- S("i", {
2623
+ T("i", {
2566
2624
  class: _(["i-heroicons-cloud-arrow-down size-8", M.value ? "text-theme-300" : "text-white/40"])
2567
2625
  }, null, 2),
2568
- S("span", null, ce(ee.value), 1)
2569
- ], 2)) : z.value ? (T(), A("div", {
2626
+ T("span", null, he(Z.value), 1)
2627
+ ], 2)) : N.value ? (v(), S("div", {
2570
2628
  key: 2,
2571
2629
  class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", M.value ? "text-theme-400" : "text-theme-600"])
2572
2630
  }, [
2573
- He(Hn, { class: "size-4" })
2574
- ], 2)) : i.setupHint ? (T(), A("div", {
2631
+ We(jn, { class: "size-4" })
2632
+ ], 2)) : a.setupHint ? (v(), S("div", {
2575
2633
  key: 3,
2576
- class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", tt.value])
2634
+ class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", st.value])
2577
2635
  }, [
2578
- k[9] || (k[9] = S("i", { class: "i-tabler-tool size-3" }, null, -1)),
2579
- S("span", null, ce(i.setupHint), 1)
2580
- ], 2)) : q("", !0),
2581
- He(Ei, {
2636
+ k[9] || (k[9] = T("i", { class: "i-tabler-tool size-3" }, null, -1)),
2637
+ T("span", null, he(a.setupHint), 1)
2638
+ ], 2)) : Y("", !0),
2639
+ We(_i, {
2582
2640
  ref_key: "chatScroller",
2583
2641
  ref: s,
2584
2642
  class: "flex-1"
2585
2643
  }, {
2586
- default: Us(() => [
2587
- S("div", Ii, [
2588
- te.value.length === 0 && !z.value && !C.value ? (T(), A("div", Ci, [
2589
- S("div", Di, [
2590
- S("img", {
2591
- src: i.agent.avatarUrl.value,
2592
- alt: i.agent.displayName.value,
2644
+ default: Hs(() => [
2645
+ T("div", Ci, [
2646
+ se.value.length === 0 && !N.value && !I.value ? (v(), S("div", Di, [
2647
+ T("div", Oi, [
2648
+ T("img", {
2649
+ src: a.agent.avatarUrl.value,
2650
+ alt: a.agent.displayName.value,
2593
2651
  class: _(["size-full rounded-full object-cover ring-1", M.value ? "ring-black/5" : "ring-white/10"])
2594
- }, null, 10, Oi),
2595
- f.value ? (T(), A("span", {
2652
+ }, null, 10, Mi),
2653
+ g.value ? (v(), S("span", {
2596
2654
  key: 0,
2597
2655
  class: _(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", M.value ? "bg-white" : "bg-theme-900"])
2598
2656
  }, [...k[10] || (k[10] = [
2599
- S("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2600
- ])], 2)) : q("", !0)
2657
+ T("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2658
+ ])], 2)) : Y("", !0)
2601
2659
  ]),
2602
- S("div", {
2660
+ T("div", {
2603
2661
  class: _(["text-base @sm/chat:text-lg font-semibold", M.value ? "text-theme-900" : "text-white"])
2604
- }, ce(i.agent.displayName.value), 3),
2605
- S("p", {
2606
- class: _(["mt-1 text-center text-xs @sm/chat:text-sm", tt.value])
2607
- }, ce(i.emptyStateMessage || "Type your message to get started."), 3),
2608
- S("div", {
2662
+ }, he(a.agent.displayName.value), 3),
2663
+ T("p", {
2664
+ class: _(["mt-1 text-center text-xs @sm/chat:text-sm", st.value])
2665
+ }, he(a.emptyStateMessage || "Type your message to get started."), 3),
2666
+ T("div", {
2609
2667
  class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", M.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2610
2668
  title: e.value.tooltip
2611
2669
  }, [
2612
- S("i", {
2670
+ T("i", {
2613
2671
  class: _([e.value.icon, "size-3"])
2614
2672
  }, null, 2),
2615
- S("span", null, ce(e.value.label), 1)
2616
- ], 10, Mi)
2617
- ])) : q("", !0),
2618
- (T(!0), A(De, null, Rt(te.value, (y, E) => (T(), A(De, {
2619
- key: y.id
2673
+ T("span", null, he(e.value.label), 1)
2674
+ ], 10, Li)
2675
+ ])) : Y("", !0),
2676
+ (v(!0), S(Oe, null, Dt(se.value, (w, E) => (v(), S(Oe, {
2677
+ key: w.id
2620
2678
  }, [
2621
- ft(te.value, E) ? (T(), A("div", Li, [
2622
- S("div", {
2623
- class: _(["flex-1 h-px", pt.value])
2679
+ bt(se.value, E) ? (v(), S("div", Ni, [
2680
+ T("div", {
2681
+ class: _(["flex-1 h-px", gt.value])
2624
2682
  }, null, 2),
2625
- S("span", {
2626
- class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", tt.value])
2627
- }, ce(ft(te.value, E)), 3),
2628
- S("div", {
2629
- class: _(["flex-1 h-px", pt.value])
2683
+ T("span", {
2684
+ class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", st.value])
2685
+ }, he(bt(se.value, E)), 3),
2686
+ T("div", {
2687
+ class: _(["flex-1 h-px", gt.value])
2630
2688
  }, null, 2)
2631
- ])) : q("", !0),
2632
- d(y) ? (T(), A("div", {
2689
+ ])) : Y("", !0),
2690
+ d(w) ? (v(), S("div", {
2633
2691
  key: 1,
2634
2692
  "data-test": "messaging-system-msg",
2635
- "data-issue-code": y.issue?.code,
2636
- "data-issue-bucket": y.issue?.bucket,
2693
+ "data-issue-code": w.issue?.code,
2694
+ "data-issue-bucket": w.issue?.bucket,
2637
2695
  class: "flex gap-2 items-end justify-start mb-4"
2638
2696
  }, [
2639
- S("div", zi, [
2640
- S("div", {
2697
+ T("div", $i, [
2698
+ T("div", {
2641
2699
  class: _(["mb-1 pl-1 text-[11px] font-medium", M.value ? "text-theme-500" : "text-white/45"])
2642
2700
  }, " System Message ", 2),
2643
- S("div", {
2701
+ T("div", {
2644
2702
  class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", M.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
2645
2703
  }, [
2646
- y.text ? (T(), Fn(_t, {
2704
+ w.text ? (v(), Un(Ct, {
2647
2705
  key: 0,
2648
- text: y.text,
2706
+ text: w.text,
2649
2707
  inverted: !M.value,
2650
- streaming: y.id === re.value,
2651
- onClick: k[0] || (k[0] = Tt(() => {
2708
+ streaming: w.id === j.value,
2709
+ onClick: k[0] || (k[0] = _t(() => {
2652
2710
  }, ["stop"]))
2653
- }, null, 8, ["text", "inverted", "streaming"])) : y.issue?.help ? (T(), Fn(_t, {
2711
+ }, null, 8, ["text", "inverted", "streaming"])) : w.issue?.help ? (v(), Un(Ct, {
2654
2712
  key: 1,
2655
- text: y.issue.help,
2713
+ text: w.issue.help,
2656
2714
  inverted: !M.value
2657
- }, null, 8, ["text", "inverted"])) : q("", !0),
2658
- y.issue?.actionUrl && !b(y.text) ? (T(), A("a", {
2715
+ }, null, 8, ["text", "inverted"])) : Y("", !0),
2716
+ w.issue?.actionUrl && !x(w.text) ? (v(), S("a", {
2659
2717
  key: 2,
2660
- href: y.issue.actionUrl,
2718
+ href: w.issue.actionUrl,
2661
2719
  "data-test": "messaging-system-msg-action",
2662
2720
  class: _(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", M.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
2663
- onClick: k[1] || (k[1] = Tt(() => {
2721
+ onClick: k[1] || (k[1] = _t(() => {
2664
2722
  }, ["stop"]))
2665
2723
  }, [
2666
- Un(ce(y.issue.actionLabel) + " ", 1),
2667
- k[11] || (k[11] = S("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2668
- ], 10, $i)) : q("", !0)
2724
+ Hn(he(w.issue.actionLabel) + " ", 1),
2725
+ k[11] || (k[11] = T("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2726
+ ], 10, Pi)) : Y("", !0)
2669
2727
  ], 2)
2670
2728
  ])
2671
- ], 8, Ni)) : y.sender === "system" ? (T(), A("div", {
2729
+ ], 8, zi)) : w.sender === "system" ? (v(), S("div", {
2672
2730
  key: 2,
2673
2731
  "data-test": "messaging-system-status-msg",
2674
2732
  class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", M.value ? "text-theme-500" : "text-white/60"])
2675
2733
  }, [
2676
- k[12] || (k[12] = S("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
2677
- He(_t, {
2678
- text: y.text,
2734
+ k[12] || (k[12] = T("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
2735
+ We(Ct, {
2736
+ text: w.text,
2679
2737
  inverted: !M.value,
2680
- onClick: k[2] || (k[2] = Tt(() => {
2738
+ onClick: k[2] || (k[2] = _t(() => {
2681
2739
  }, ["stop"]))
2682
2740
  }, null, 8, ["text", "inverted"])
2683
- ], 2)) : (T(), A("div", {
2741
+ ], 2)) : (v(), S("div", {
2684
2742
  key: 3,
2685
- "data-test": y.sender === "agent" ? "messaging-assistant-msg" : y.sender === "user" ? "messaging-user-msg" : void 0,
2743
+ "data-test": w.sender === "agent" ? "messaging-assistant-msg" : w.sender === "user" ? "messaging-user-msg" : void 0,
2686
2744
  class: _(["flex gap-2 items-end", {
2687
- "justify-end": y.sender === "user",
2688
- "justify-start": y.sender === "agent",
2689
- "mb-4": m(te.value, E)
2745
+ "justify-end": w.sender === "user",
2746
+ "justify-start": w.sender === "agent",
2747
+ "mb-4": f(se.value, E)
2690
2748
  }])
2691
2749
  }, [
2692
- y.sender === "agent" ? (T(), A("div", Bi, [
2693
- m(te.value, E) ? (T(), A("img", {
2750
+ w.sender === "agent" ? (v(), S("div", Fi, [
2751
+ f(se.value, E) ? (v(), S("img", {
2694
2752
  key: 0,
2695
- src: i.agent.avatarUrl.value,
2696
- alt: i.agent.displayName.value,
2753
+ src: a.agent.avatarUrl.value,
2754
+ alt: a.agent.displayName.value,
2697
2755
  class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", M.value ? "ring-1 ring-black/5" : ""])
2698
- }, null, 10, Fi)) : q("", !0)
2699
- ])) : q("", !0),
2700
- S("div", {
2701
- class: _(y.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2756
+ }, null, 10, Ui)) : Y("", !0)
2757
+ ])) : Y("", !0),
2758
+ T("div", {
2759
+ class: _(w.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2702
2760
  }, [
2703
- y.attachments?.length ? (T(), A("div", {
2761
+ w.attachments?.length ? (v(), S("div", {
2704
2762
  key: 0,
2705
- class: _(["mb-1 space-y-1", y.sender === "user" ? "flex flex-col items-end" : ""])
2763
+ class: _(["mb-1 space-y-1", w.sender === "user" ? "flex flex-col items-end" : ""])
2706
2764
  }, [
2707
- (T(!0), A(De, null, Rt(y.attachments, (X, B) => (T(), A(De, { key: B }, [
2708
- X.type === "image" ? (T(), A("img", {
2765
+ (v(!0), S(Oe, null, Dt(w.attachments, (X, P) => (v(), S(Oe, { key: P }, [
2766
+ X.type === "image" ? (v(), S("img", {
2709
2767
  key: 0,
2710
2768
  src: X.src,
2711
2769
  alt: X.filename,
2712
2770
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2713
- }, null, 8, Ui)) : X.type === "audio" ? (T(), A("audio", {
2771
+ }, null, 8, Hi)) : X.type === "audio" ? (v(), S("audio", {
2714
2772
  key: 1,
2715
2773
  src: X.src,
2716
2774
  controls: "",
2717
2775
  class: "max-w-full"
2718
- }, null, 8, Hi)) : (T(), A("a", {
2776
+ }, null, 8, ji)) : (v(), S("a", {
2719
2777
  key: 2,
2720
2778
  href: X.src,
2721
2779
  target: "_blank",
2722
2780
  rel: "noopener",
2723
2781
  class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", M.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2724
2782
  }, [
2725
- k[13] || (k[13] = S("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2726
- Un(" " + ce(X.filename), 1)
2727
- ], 10, ji))
2783
+ k[13] || (k[13] = T("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2784
+ Hn(" " + he(X.filename), 1)
2785
+ ], 10, Gi))
2728
2786
  ], 64))), 128))
2729
- ], 2)) : q("", !0),
2730
- y.text ? (T(), A("div", {
2787
+ ], 2)) : Y("", !0),
2788
+ w.text ? (v(), S("div", {
2731
2789
  key: 1,
2732
2790
  class: _(["rounded-2xl px-3.5 py-2", [
2733
- y.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : M.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]"
2791
+ w.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : M.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]"
2734
2792
  ]])
2735
2793
  }, [
2736
- He(_t, {
2737
- text: y.text,
2738
- inverted: y.sender === "user" || !M.value,
2739
- streaming: y.id === re.value,
2740
- onClick: k[3] || (k[3] = Tt(() => {
2794
+ We(Ct, {
2795
+ text: w.text,
2796
+ inverted: w.sender === "user" || !M.value,
2797
+ streaming: w.id === j.value,
2798
+ onClick: k[3] || (k[3] = _t(() => {
2741
2799
  }, ["stop"]))
2742
2800
  }, null, 8, ["text", "inverted", "streaming"])
2743
- ], 2)) : q("", !0)
2801
+ ], 2)) : Y("", !0)
2744
2802
  ], 2)
2745
- ], 10, Pi))
2803
+ ], 10, Bi))
2746
2804
  ], 64))), 128)),
2747
- ge.value ? (T(), A("div", Gi, [
2748
- S("img", {
2749
- src: i.agent.avatarUrl.value,
2750
- alt: i.agent.displayName.value,
2805
+ ae.value ? (v(), S("div", Wi, [
2806
+ T("img", {
2807
+ src: a.agent.avatarUrl.value,
2808
+ alt: a.agent.displayName.value,
2751
2809
  class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", M.value ? "ring-1 ring-black/5" : ""])
2752
- }, null, 10, Wi),
2753
- S("div", {
2810
+ }, null, 10, qi),
2811
+ T("div", {
2754
2812
  class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", M.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2755
2813
  }, [
2756
- S("i", {
2814
+ T("i", {
2757
2815
  class: _(["i-svg-spinners-3-dots-bounce size-7", M.value ? "text-theme-400" : "text-white/50"])
2758
2816
  }, null, 2)
2759
2817
  ], 2)
2760
- ])) : q("", !0)
2818
+ ])) : Y("", !0)
2761
2819
  ])
2762
2820
  ]),
2763
2821
  _: 1
2764
2822
  }, 512),
2765
- S("div", {
2823
+ T("div", {
2766
2824
  class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", M.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2767
2825
  }, [
2768
- p.value.length > 0 ? (T(), A("div", qi, [
2769
- (T(!0), A(De, null, Rt(p.value, (y, E) => (T(), A("div", {
2826
+ p.value.length > 0 ? (v(), S("div", Vi, [
2827
+ (v(!0), S(Oe, null, Dt(p.value, (w, E) => (v(), S("div", {
2770
2828
  key: E,
2771
2829
  class: "relative shrink-0 group"
2772
2830
  }, [
2773
- y.type === "image" ? (T(), A("img", {
2831
+ w.type === "image" ? (v(), S("img", {
2774
2832
  key: 0,
2775
- src: y.src,
2776
- alt: y.filename,
2833
+ src: w.src,
2834
+ alt: w.filename,
2777
2835
  class: _(["size-14 rounded-xl object-cover border", M.value ? "border-black/10" : "border-white/20"])
2778
- }, null, 10, Vi)) : (T(), A("div", {
2836
+ }, null, 10, Yi)) : (v(), S("div", {
2779
2837
  key: 1,
2780
2838
  class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", M.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2781
2839
  }, [
2782
- k[14] || (k[14] = S("i", { class: "i-tabler-file size-4" }, null, -1)),
2783
- S("span", Yi, ce(y.filename), 1)
2840
+ k[14] || (k[14] = T("i", { class: "i-tabler-file size-4" }, null, -1)),
2841
+ T("span", Zi, he(w.filename), 1)
2784
2842
  ], 2)),
2785
- S("button", {
2843
+ T("button", {
2786
2844
  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",
2787
- onClick: /* @__PURE__ */ h((X) => zt(E), "onClick")
2845
+ onClick: /* @__PURE__ */ h((X) => Bt(E), "onClick")
2788
2846
  }, [...k[15] || (k[15] = [
2789
- S("i", { class: "i-tabler-x size-3" }, null, -1)
2790
- ])], 8, Zi)
2847
+ T("i", { class: "i-tabler-x size-3" }, null, -1)
2848
+ ])], 8, Xi)
2791
2849
  ]))), 128)),
2792
- c.value ? (T(), A("div", Xi, [
2793
- He(Hn, { class: "size-5" })
2794
- ])) : q("", !0)
2795
- ])) : q("", !0),
2796
- i.uploadFn ? (T(), A("input", {
2850
+ c.value ? (v(), S("div", Ki, [
2851
+ We(jn, { class: "size-5" })
2852
+ ])) : Y("", !0)
2853
+ ])) : Y("", !0),
2854
+ a.uploadFn ? (v(), S("input", {
2797
2855
  key: 1,
2798
2856
  ref_key: "fileInput",
2799
2857
  ref: o,
2800
2858
  type: "file",
2801
2859
  accept: "image/*,audio/*,video/*",
2802
2860
  class: "hidden",
2803
- onChange: $e
2804
- }, null, 544)) : q("", !0),
2805
- S("div", {
2861
+ onChange: Pe
2862
+ }, null, 544)) : Y("", !0),
2863
+ T("div", {
2806
2864
  class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", M.value ? r.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2807
2865
  }, [
2808
- S("button", {
2866
+ T("button", {
2809
2867
  class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
2810
- i.uploadFn ? "cursor-pointer" : "cursor-default",
2868
+ a.uploadFn ? "cursor-pointer" : "cursor-default",
2811
2869
  M.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2812
2870
  c.value ? "opacity-50 pointer-events-none" : ""
2813
2871
  ]]),
2814
- disabled: Y.value || c.value || !i.uploadFn,
2815
- onClick: k[4] || (k[4] = (y) => i.uploadFn && ze())
2872
+ disabled: Q.value || c.value || !a.uploadFn,
2873
+ onClick: k[4] || (k[4] = (w) => a.uploadFn && $e())
2816
2874
  }, [
2817
- c.value ? (T(), A("i", Qi)) : (T(), A("i", Ji))
2818
- ], 10, Ki),
2819
- ds(S("textarea", {
2875
+ c.value ? (v(), S("i", Ji)) : (v(), S("i", ea))
2876
+ ], 10, Qi),
2877
+ fs(T("textarea", {
2820
2878
  ref_key: "textarea",
2821
2879
  ref: l,
2822
- "onUpdate:modelValue": k[5] || (k[5] = (y) => n.value = y),
2880
+ "onUpdate:modelValue": k[5] || (k[5] = (w) => n.value = w),
2823
2881
  "data-test": "messaging-input",
2824
2882
  rows: "1",
2825
2883
  enterkeyhint: "send",
2826
- placeholder: me.value,
2827
- disabled: Y.value,
2884
+ placeholder: ye.value,
2885
+ disabled: Q.value,
2828
2886
  style: { fontSize: "16px", resize: "none" },
2829
2887
  class: _(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", M.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2830
- onKeydown: Z,
2831
- onFocus: k[6] || (k[6] = (y) => r.value = !0),
2832
- onBlur: k[7] || (k[7] = (y) => r.value = !1)
2833
- }, null, 42, ea), [
2834
- [fs, n.value]
2888
+ onKeydown: q,
2889
+ onFocus: k[6] || (k[6] = (w) => r.value = !0),
2890
+ onBlur: k[7] || (k[7] = (w) => r.value = !1)
2891
+ }, null, 42, ta), [
2892
+ [gs, n.value]
2835
2893
  ]),
2836
- S("button", {
2894
+ T("button", {
2837
2895
  "data-test": "messaging-send-btn",
2838
- class: _(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", ye.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : M.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2839
- disabled: !ye.value,
2840
- onClick: k[8] || (k[8] = (y) => dt())
2896
+ class: _(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", Te.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : M.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2897
+ disabled: !Te.value,
2898
+ onClick: k[8] || (k[8] = (w) => mt())
2841
2899
  }, [...k[16] || (k[16] = [
2842
- S("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2843
- ])], 10, ta)
2900
+ T("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2901
+ ])], 10, na)
2844
2902
  ], 2)
2845
2903
  ], 2)
2846
2904
  ]));
2847
2905
  }
2848
- }), na = { class: "agent-wrap" }, sa = {
2906
+ }), sa = { class: "agent-wrap" }, ra = {
2849
2907
  key: 0,
2850
2908
  class: "flex items-center justify-center h-full"
2851
- }, fa = /* @__PURE__ */ ke({
2909
+ }, ga = /* @__PURE__ */ ve({
2852
2910
  __name: "AgentWrap",
2853
2911
  props: {
2854
2912
  sdk: {},
@@ -2861,12 +2919,12 @@ const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2861
2919
  hasClose: { type: Boolean },
2862
2920
  apiBase: {}
2863
2921
  },
2864
- setup(i) {
2865
- const t = js("AgentWrap"), e = i, n = e.sdk || Gs.getInstance({
2922
+ setup(a) {
2923
+ const t = Gs("AgentWrap"), e = a, n = e.sdk || Ws.getInstance({
2866
2924
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2867
2925
  ...e.apiBase && { apiBase: e.apiBase }
2868
- }), r = Q(!e.agent), s = gs(e.agent ? new It({ config: e.agent }) : void 0), l = Q();
2869
- return Mt(async () => {
2926
+ }), r = ee(!e.agent), s = ms(e.agent ? new Ot({ config: e.agent }) : void 0), l = ee();
2927
+ return zt(async () => {
2870
2928
  if (e.agent) {
2871
2929
  t.debug("Agent provided via props, skipping fetch", {
2872
2930
  agentId: e.agent.agentId,
@@ -2892,7 +2950,7 @@ const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2892
2950
  try {
2893
2951
  r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2894
2952
  const o = await n.user.getPublicAgent({ handle: e.handle });
2895
- o ? (s.value = new It({ config: o }), t.debug("Successfully fetched public agent", {
2953
+ o ? (s.value = new Ot({ config: o }), t.debug("Successfully fetched public agent", {
2896
2954
  agentId: o.agentId,
2897
2955
  handle: o.handle
2898
2956
  }), o.agentId && n.user.track({
@@ -2942,33 +3000,33 @@ const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
2942
3000
  }
2943
3001
  });
2944
3002
  }
2945
- }), (o, p) => (T(), A("div", na, [
2946
- r.value ? (T(), A("div", sa, [...p[0] || (p[0] = [
2947
- S("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2948
- ])])) : s.value ? ln(o.$slots, "default", {
3003
+ }), (o, p) => (v(), S("div", sa, [
3004
+ r.value ? (v(), S("div", ra, [...p[0] || (p[0] = [
3005
+ T("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
3006
+ ])])) : s.value ? on(o.$slots, "default", {
2949
3007
  key: 1,
2950
- sdk: nn(n),
3008
+ sdk: sn(n),
2951
3009
  agent: s.value,
2952
- context: i.context,
2953
- firstMessage: i.firstMessage,
2954
- buttonText: i.buttonText,
2955
- buttonIcon: i.buttonIcon,
3010
+ context: a.context,
3011
+ firstMessage: a.firstMessage,
3012
+ buttonText: a.buttonText,
3013
+ buttonIcon: a.buttonIcon,
2956
3014
  loading: r.value
2957
- }) : q("", !0)
3015
+ }) : Y("", !0)
2958
3016
  ]));
2959
3017
  }
2960
3018
  });
2961
3019
  export {
2962
- Gn as A,
2963
- fa as _,
2964
- da as a,
2965
- ha as b,
2966
- ua as c,
2967
- pa as d,
2968
- Hn as e,
2969
- ir as f,
2970
- oa as g,
2971
- qn as h,
2972
- ca as p
3020
+ Wn as A,
3021
+ ga as _,
3022
+ fa as a,
3023
+ pa as b,
3024
+ ha as c,
3025
+ da as d,
3026
+ jn as e,
3027
+ ar as f,
3028
+ ca as g,
3029
+ Vn as h,
3030
+ ua as p
2973
3031
  };
2974
3032
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map