@pagelines/sdk 1.0.474 → 1.0.476

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,22 +1,22 @@
1
1
  var Mn = Object.defineProperty;
2
- var Es = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var h = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
4
- var D = (a, t, e) => Es(a, typeof t != "symbol" ? t + "" : t, e);
5
- import { defineComponent as Le, openBlock as T, createElementBlock as S, createElementVNode as y, normalizeClass as A, ref as ee, watch as ct, computed as G, createCommentVNode as B, renderSlot as ts, onMounted as nn, Fragment as Te, renderList as at, withDirectives as ns, vModelText as ss, unref as Qt, toDisplayString as ie, nextTick as Wt, createVNode as qt, createTextVNode as Je, withModifiers as _s, shallowRef as Rs } from "vue";
6
- import { SettingsObject as Is, Agent as Tt, getDefaultAvatarUrl as rs, createLogger as Ds } from "@pagelines/core";
7
- import { P as Cs } from "./sdkClient.js";
8
- const Ms = { class: "spinner max-w-sm" }, Ls = {
2
+ var _s = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var p = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
4
+ var D = (a, t, e) => _s(a, typeof t != "symbol" ? t + "" : t, e);
5
+ import { defineComponent as Oe, openBlock as T, createElementBlock as S, createElementVNode as y, normalizeClass as A, ref as te, watch as ct, computed as G, createCommentVNode as B, renderSlot as ns, onMounted as nn, Fragment as Se, renderList as at, withDirectives as ss, vModelText as rs, unref as Qt, toDisplayString as ie, nextTick as Wt, createVNode as qt, createTextVNode as et, withModifiers as Rs, shallowRef as Is } from "vue";
6
+ import { SettingsObject as Ds, Agent as Tt, getDefaultAvatarUrl as is, createLogger as Cs } from "@pagelines/core";
7
+ import { P as Ms } from "./sdkClient.js";
8
+ const Ls = { class: "spinner max-w-sm" }, Os = {
9
9
  class: "ring-circular h-full w-full origin-center",
10
10
  viewBox: "25 25 50 50"
11
- }, Ln = /* @__PURE__ */ Le({
11
+ }, Ln = /* @__PURE__ */ Oe({
12
12
  __name: "FSpinner",
13
13
  props: {
14
14
  width: { type: String, default: "" },
15
15
  colorMode: { type: String, default: "primary" }
16
16
  },
17
17
  setup(a) {
18
- return (t, e) => (T(), S("div", Ms, [
19
- (T(), S("svg", Ls, [
18
+ return (t, e) => (T(), S("div", Ls, [
19
+ (T(), S("svg", Os, [
20
20
  y("circle", {
21
21
  class: A([a.colorMode, "ring-path"]),
22
22
  cx: "50",
@@ -30,10 +30,10 @@ const Ms = { class: "spinner max-w-sm" }, Ls = {
30
30
  ]))
31
31
  ]));
32
32
  }
33
- }), Os = [
33
+ }), zs = [
34
34
  { pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
35
35
  { pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
36
- ], zs = 9e4, dn = class dn extends Is {
36
+ ], Ps = 9e4, dn = class dn extends Ds {
37
37
  constructor(e) {
38
38
  super("AgentChatController", e);
39
39
  D(this, "isTextMode", !1);
@@ -41,14 +41,14 @@ const Ms = { class: "spinner max-w-sm" }, Ls = {
41
41
  D(this, "isConnecting", !1);
42
42
  // Chat conversation tracking (server-managed persistence)
43
43
  D(this, "conversationId");
44
- D(this, "textState", ee({
44
+ D(this, "textState", te({
45
45
  isActive: !1,
46
46
  isConnected: !1,
47
47
  isThinking: !1,
48
48
  connectionStatus: "disconnected"
49
49
  }));
50
- D(this, "agentMode", ee("self"));
51
- D(this, "sharedMessages", ee([]));
50
+ D(this, "agentMode", te("self"));
51
+ D(this, "sharedMessages", te([]));
52
52
  D(this, "_agent");
53
53
  this._agent = e.agent instanceof Tt ? e.agent : new Tt({ config: e.agent }), this.setupModeWatcher();
54
54
  }
@@ -72,28 +72,28 @@ const Ms = { class: "spinner max-w-sm" }, Ls = {
72
72
  return e.includes("timed out") || e.includes("starting up") || e.includes("503") || e.includes("429") || e.includes("[no-reply]") || e.includes("[stream-open]") || e.includes("[stream-read]") || e.includes("[api]");
73
73
  }
74
74
  isDuplicateMessage(e, n) {
75
- const s = `${n}:${e.toLowerCase().trim()}`, r = Date.now(), l = s === this.lastMessage.hash && r - this.lastMessage.time < 500;
76
- return l || (this.lastMessage = { hash: s, time: r }), l;
75
+ const r = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), o = r === this.lastMessage.hash && s - this.lastMessage.time < 500;
76
+ return o || (this.lastMessage = { hash: r, time: s }), o;
77
77
  }
78
- addMessage(e, n, s, r) {
78
+ addMessage(e, n, r, s) {
79
79
  this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
80
80
  ...this.sharedMessages.value,
81
- { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: s, ...r ? { issue: r } : {} }
81
+ { id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: r, ...s ? { issue: s } : {} }
82
82
  ]);
83
83
  }
84
84
  getDynamicSettings() {
85
85
  const { sdk: e } = this.settings;
86
86
  if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
87
- const n = e.activeUser.value, s = n?.agents?.find((l) => l.agentId === n.primaryAgentId), r = n ? `
87
+ const n = e.activeUser.value, r = n?.agents?.find((o) => o.agentId === n.primaryAgentId), s = n ? `
88
88
 
89
89
  Current User:
90
- - Name: ${s?.name || "Anonymous"}
90
+ - Name: ${r?.name || "Anonymous"}
91
91
  - Email: ${n.email}
92
- - Title: ${s?.title || ""}
93
- - About: ${s?.summary || ""}
92
+ - Title: ${r?.title || ""}
93
+ - About: ${r?.summary || ""}
94
94
  ` : "";
95
95
  return {
96
- context: `${this.settings.context || ""}${r}`.trim(),
96
+ context: `${this.settings.context || ""}${s}`.trim(),
97
97
  firstMessage: this.settings.firstMessage || ""
98
98
  };
99
99
  }
@@ -123,9 +123,9 @@ Current User:
123
123
  * agent/client.ts survive into the console line).
124
124
  */
125
125
  handleError(e, n) {
126
- const s = e.message;
127
- this.logger.error("Conversation error:", { message: s, raw: n, error: e }), this.addMessage(s, "system"), this.resetState(), this.updateState(this.textState, {
128
- error: s,
126
+ const r = e.message;
127
+ this.logger.error("Conversation error:", { message: r, raw: n, error: e }), this.addMessage(r, "system"), this.resetState(), this.updateState(this.textState, {
128
+ error: r,
129
129
  connectionStatus: "error"
130
130
  });
131
131
  }
@@ -183,84 +183,84 @@ Current User:
183
183
  async sendChatMessage(e, n) {
184
184
  if (!this.isTextMode)
185
185
  return;
186
- const { chatStreamFn: s } = this.settings;
186
+ const { chatStreamFn: r } = this.settings;
187
187
  if (!this.chatEnabled) {
188
188
  this.addMessage("Agent is currently offline.", "system");
189
189
  return;
190
190
  }
191
- const { sdk: r } = this.settings;
192
- if (!s && !this._agent.handle.value) {
191
+ const { sdk: s } = this.settings;
192
+ if (!r && !this._agent.handle.value) {
193
193
  this.handleError(new Error("Agent handle required for chat"));
194
194
  return;
195
195
  }
196
196
  this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
197
- const l = `stream-${Date.now()}`;
198
- let o = !1;
199
- const c = /* @__PURE__ */ h((f) => {
200
- o || (o = !0, this.sharedMessages.value = [
197
+ const o = `stream-${Date.now()}`;
198
+ let l = !1;
199
+ const f = /* @__PURE__ */ p((d) => {
200
+ l || (l = !0, this.sharedMessages.value = [
201
201
  ...this.sharedMessages.value,
202
- { id: l, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
202
+ { id: o, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
203
203
  ]);
204
- const m = this.sharedMessages.value, w = m[m.length - 1];
205
- w?.id === l && (w.text += f, this.sharedMessages.value = [...m]);
206
- }, "onDelta"), p = /* @__PURE__ */ h((f) => {
207
- if (!o) {
208
- g("empty_stream — assistant returned no content");
204
+ const g = this.sharedMessages.value, w = g[g.length - 1];
205
+ w?.id === o && (w.text += d, this.sharedMessages.value = [...g]);
206
+ }, "onDelta"), c = /* @__PURE__ */ p((d) => {
207
+ if (!l) {
208
+ x("empty_stream — assistant returned no content");
209
209
  return;
210
210
  }
211
- const m = this.sharedMessages.value, w = m[m.length - 1];
212
- if (w?.id === l && w.text) {
211
+ const g = this.sharedMessages.value, w = g[g.length - 1];
212
+ if (w?.id === o && w.text) {
213
213
  let E = w.text;
214
- for (const O of Os)
214
+ for (const O of zs)
215
215
  O.pattern.test(E) && (console.debug(`[chat] filtered directive: ${O.label}`), E = E.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
216
- E ? E !== w.text && (w.text = E, this.sharedMessages.value = [...m]) : this.sharedMessages.value = m.slice(0, -1);
217
- }
218
- f && (this.conversationId = f), this.updateState(this.textState, { isThinking: !1 });
219
- }, "onDone"), g = /* @__PURE__ */ h((f) => {
220
- const m = this.sharedMessages.value, w = m[m.length - 1];
221
- if (w?.id === l && !w.text && (this.sharedMessages.value = m.slice(0, -1)), typeof f == "object" && f.code && f.error) {
222
- const { bucket: U, actionUrl: ae, actionLabel: le, help: z } = f;
223
- if (U !== void 0 || (/* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP", "EMPTY_STREAM", "RATE_LIMIT"])).has(f.code)) {
224
- const V = U && ae && le ? { code: f.code, bucket: U, actionLabel: le, actionUrl: ae, ...z ? { help: z } : {} } : void 0;
225
- this.addMessage(f.error, "system", void 0, V), U === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
216
+ E ? E !== w.text && (w.text = E, this.sharedMessages.value = [...g]) : this.sharedMessages.value = g.slice(0, -1);
217
+ }
218
+ d && (this.conversationId = d), this.updateState(this.textState, { isThinking: !1 });
219
+ }, "onDone"), x = /* @__PURE__ */ p((d) => {
220
+ const g = this.sharedMessages.value, w = g[g.length - 1];
221
+ if (w?.id === o && !w.text && (this.sharedMessages.value = g.slice(0, -1)), typeof d == "object" && d.code && d.error) {
222
+ const { bucket: U, actionUrl: ae, actionLabel: le, help: z } = d;
223
+ if (U !== void 0 || (/* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP", "EMPTY_STREAM", "RATE_LIMIT"])).has(d.code)) {
224
+ const V = U && ae && le ? { code: d.code, bucket: U, actionLabel: le, actionUrl: ae, ...z ? { help: z } : {} } : void 0;
225
+ this.addMessage(d.error, "system", void 0, V), U === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
226
226
  } else
227
- this.handleError(new Error(f.error));
227
+ this.handleError(new Error(d.error));
228
228
  return;
229
229
  }
230
- const E = typeof f == "string" ? f : f.error, O = this.mapChatError(E);
230
+ const E = typeof d == "string" ? d : d.error, O = this.mapChatError(E);
231
231
  this.isTransientError(E) ? (this.logger.warn("Chat turn failed (transient):", { raw: E, friendly: O }), this.addMessage(O, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(O), E);
232
- }, "onError"), d = /* @__PURE__ */ h((f) => {
233
- this.addMessage(f, "system");
232
+ }, "onError"), h = /* @__PURE__ */ p((d) => {
233
+ this.addMessage(d, "system");
234
234
  }, "onStatus");
235
235
  try {
236
- const f = s ? s({
236
+ const d = r ? r({
237
237
  message: e,
238
238
  attachments: n,
239
239
  conversationId: this.conversationId,
240
240
  history: this.buildHistory(),
241
- onDelta: c,
242
- onDone: p,
243
- onError: g,
244
- onStatus: d
245
- }) : r.chatStream({
241
+ onDelta: f,
242
+ onDone: c,
243
+ onError: x,
244
+ onStatus: h
245
+ }) : s.chatStream({
246
246
  handle: this._agent.handle.value,
247
247
  message: e,
248
248
  attachments: n,
249
249
  conversationId: this.conversationId,
250
250
  history: this.buildHistory(),
251
- visitorId: r.generateAnonId(),
251
+ visitorId: s.generateAnonId(),
252
252
  context: this.getDynamicSettings().context || void 0,
253
- onDelta: c,
254
- onDone: p,
255
- onError: g,
256
- onStatus: d
253
+ onDelta: f,
254
+ onDone: c,
255
+ onError: x,
256
+ onStatus: h
257
257
  });
258
258
  await Promise.race([
259
- f,
260
- new Promise((m, w) => setTimeout(() => w(new Error("timed out")), zs))
259
+ d,
260
+ new Promise((g, w) => setTimeout(() => w(new Error("timed out")), Ps))
261
261
  ]);
262
- } catch (f) {
263
- g(f.message || "Something went wrong");
262
+ } catch (d) {
263
+ x(d.message || "Something went wrong");
264
264
  }
265
265
  }
266
266
  buildHistory() {
@@ -284,30 +284,30 @@ Current User:
284
284
  await this.endConversation();
285
285
  }
286
286
  };
287
- h(dn, "AgentChatController");
287
+ p(dn, "AgentChatController");
288
288
  let On = dn;
289
289
  function zn(a) {
290
290
  return a ? typeof a == "string" ? a : a.src || "" : "";
291
291
  }
292
- h(zn, "getImageSrc");
293
- function Hi(a) {
294
- return zn(a.cover) || zn(a.avatar) || rs(a.name);
292
+ p(zn, "getImageSrc");
293
+ function Gi(a) {
294
+ return zn(a.cover) || zn(a.avatar) || is(a.name);
295
295
  }
296
- h(Hi, "getAgentAvatarUrl");
296
+ p(Gi, "getAgentAvatarUrl");
297
297
  function Pn(a) {
298
298
  const t = a.target;
299
- t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = rs());
299
+ t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = is());
300
300
  }
301
- h(Pn, "handleImageError");
302
- function Gi(a) {
301
+ p(Pn, "handleImageError");
302
+ function ji(a) {
303
303
  const { template: t, agent: e } = a;
304
304
  return t.replace(/{name}/g, e.name || "Digital Agent").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
305
305
  }
306
- h(Gi, "parseButtonTemplate");
307
- const Ps = {
306
+ p(ji, "parseButtonTemplate");
307
+ const Ns = {
308
308
  key: 0,
309
309
  class: "absolute inset-0 flex items-center justify-center"
310
- }, ji = /* @__PURE__ */ Le({
310
+ }, Wi = /* @__PURE__ */ Oe({
311
311
  __name: "ElAgentButton",
312
312
  props: {
313
313
  theme: { default: "primary" },
@@ -331,10 +331,10 @@ const Ps = {
331
331
  md: "size-4",
332
332
  lg: "size-5"
333
333
  })[a.size]);
334
- return (s, r) => (T(), S("button", {
334
+ return (r, s) => (T(), S("button", {
335
335
  class: A(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
336
336
  }, [
337
- a.loading ? (T(), S("div", Ps, [...r[0] || (r[0] = [
337
+ a.loading ? (T(), S("div", Ns, [...s[0] || (s[0] = [
338
338
  y("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
339
339
  ])])) : B("", !0),
340
340
  y("span", {
@@ -344,7 +344,7 @@ const Ps = {
344
344
  key: 0,
345
345
  class: A([a.icon, n.value])
346
346
  }, null, 2)) : B("", !0),
347
- ts(s.$slots, "default"),
347
+ ns(r.$slots, "default"),
348
348
  a.iconAfter ? (T(), S("i", {
349
349
  key: 1,
350
350
  class: A([a.iconAfter, n.value])
@@ -352,7 +352,7 @@ const Ps = {
352
352
  ], 2)
353
353
  ], 2));
354
354
  }
355
- }), Ns = ["value"], Wi = /* @__PURE__ */ Le({
355
+ }), $s = ["value"], qi = /* @__PURE__ */ Oe({
356
356
  __name: "AgentInputEmail",
357
357
  props: {
358
358
  modelValue: { default: "" }
@@ -360,17 +360,17 @@ const Ps = {
360
360
  emits: ["update:modelValue"],
361
361
  setup(a, { emit: t }) {
362
362
  const e = t;
363
- return (n, s) => (T(), S("input", {
363
+ return (n, r) => (T(), S("input", {
364
364
  type: "email",
365
365
  autocomplete: "email",
366
366
  placeholder: "Enter Your Email",
367
367
  value: a.modelValue,
368
368
  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",
369
369
  style: { "font-size": "16px" },
370
- onInput: s[0] || (s[0] = (r) => e("update:modelValue", r.target.value))
371
- }, null, 40, Ns));
370
+ onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
371
+ }, null, 40, $s));
372
372
  }
373
- }), $s = { class: "flex gap-1.5 justify-center" }, Bs = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], qi = /* @__PURE__ */ Le({
373
+ }), Bs = { class: "flex gap-1.5 justify-center" }, Us = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Vi = /* @__PURE__ */ Oe({
374
374
  __name: "AgentInputOneTimeCode",
375
375
  props: {
376
376
  modelValue: {},
@@ -379,73 +379,73 @@ const Ps = {
379
379
  },
380
380
  emits: ["update:modelValue", "autoSubmit"],
381
381
  setup(a, { emit: t }) {
382
- const e = a, n = t, s = ee([]), r = ee(Array.from({ length: e.length }).fill("")), l = ee(!1);
382
+ const e = a, n = t, r = te([]), s = te(Array.from({ length: e.length }).fill("")), o = te(!1);
383
383
  nn(() => {
384
- e.modelValue && (r.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && s.value[0]?.focus();
385
- }), ct(() => e.modelValue, (d) => {
386
- r.value = d ? d.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
387
- }), ct(r, () => {
388
- const d = r.value.filter(Boolean).join("");
389
- n("update:modelValue", d), d.length === e.length && n("autoSubmit", d);
384
+ e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
385
+ }), ct(() => e.modelValue, (h) => {
386
+ s.value = h ? h.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
387
+ }), ct(s, () => {
388
+ const h = s.value.filter(Boolean).join("");
389
+ n("update:modelValue", h), h.length === e.length && n("autoSubmit", h);
390
390
  }, { deep: !0 });
391
- function o(d, f) {
392
- f.preventDefault(), l.value = !0;
393
- const m = (f.clipboardData?.getData("text") || "").replace(/\D/g, "");
394
- if (m.length === e.length)
395
- r.value = m.split(""), setTimeout(() => {
396
- s.value[e.length - 1]?.focus(), l.value = !1;
391
+ function l(h, d) {
392
+ d.preventDefault(), o.value = !0;
393
+ const g = (d.clipboardData?.getData("text") || "").replace(/\D/g, "");
394
+ if (g.length === e.length)
395
+ s.value = g.split(""), setTimeout(() => {
396
+ r.value[e.length - 1]?.focus(), o.value = !1;
397
397
  }, 10);
398
398
  else {
399
- const w = [...r.value];
400
- m.split("").slice(0, e.length - d).forEach((O, U) => {
401
- w[d + U] = O;
402
- }), r.value = w;
403
- const E = Math.min(d + m.length, e.length - 1);
399
+ const w = [...s.value];
400
+ g.split("").slice(0, e.length - h).forEach((O, U) => {
401
+ w[h + U] = O;
402
+ }), s.value = w;
403
+ const E = Math.min(h + g.length, e.length - 1);
404
404
  setTimeout(() => {
405
- s.value[E]?.focus(), l.value = !1;
405
+ r.value[E]?.focus(), o.value = !1;
406
406
  }, 10);
407
407
  }
408
408
  }
409
- h(o, "onPaste");
410
- function c(d, f) {
411
- const m = f.target.value.slice(-1).replace(/\D/g, "");
412
- r.value[d] = m, m && d < e.length - 1 && s.value[d + 1]?.focus();
409
+ p(l, "onPaste");
410
+ function f(h, d) {
411
+ const g = d.target.value.slice(-1).replace(/\D/g, "");
412
+ s.value[h] = g, g && h < e.length - 1 && r.value[h + 1]?.focus();
413
413
  }
414
- h(c, "onInput");
415
- function p(d, f) {
416
- f.key === "Backspace" ? (f.preventDefault(), r.value[d] = "", d > 0 && s.value[d - 1]?.focus()) : f.key === "ArrowLeft" && d > 0 ? s.value[d - 1]?.focus() : f.key === "ArrowRight" && d < e.length - 1 && s.value[d + 1]?.focus();
414
+ p(f, "onInput");
415
+ function c(h, d) {
416
+ d.key === "Backspace" ? (d.preventDefault(), s.value[h] = "", h > 0 && r.value[h - 1]?.focus()) : d.key === "ArrowLeft" && h > 0 ? r.value[h - 1]?.focus() : d.key === "ArrowRight" && h < e.length - 1 && r.value[h + 1]?.focus();
417
417
  }
418
- h(p, "onKeydown");
419
- function g(d) {
420
- if (s.value[d]?.select(), !l.value && r.value[d])
421
- for (let f = d; f < e.length; f++)
422
- r.value[f] = "";
418
+ p(c, "onKeydown");
419
+ function x(h) {
420
+ if (r.value[h]?.select(), !o.value && s.value[h])
421
+ for (let d = h; d < e.length; d++)
422
+ s.value[d] = "";
423
423
  }
424
- return h(g, "onFocus"), (d, f) => (T(), S("div", $s, [
425
- (T(!0), S(Te, null, at(a.length, (m) => ns((T(), S("input", {
426
- key: m,
424
+ return p(x, "onFocus"), (h, d) => (T(), S("div", Bs, [
425
+ (T(!0), S(Se, null, at(a.length, (g) => ss((T(), S("input", {
426
+ key: g,
427
427
  ref_for: !0,
428
- ref: /* @__PURE__ */ h((w) => s.value[m - 1] = w, "ref"),
429
- "onUpdate:modelValue": /* @__PURE__ */ h((w) => r.value[m - 1] = w, "onUpdate:modelValue"),
428
+ ref: /* @__PURE__ */ p((w) => r.value[g - 1] = w, "ref"),
429
+ "onUpdate:modelValue": /* @__PURE__ */ p((w) => s.value[g - 1] = w, "onUpdate:modelValue"),
430
430
  type: "text",
431
431
  inputmode: "numeric",
432
432
  autocomplete: "one-time-code",
433
433
  class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
434
434
  style: { "font-size": "16px" },
435
435
  maxlength: "1",
436
- onInput: /* @__PURE__ */ h((w) => c(m - 1, w), "onInput"),
437
- onKeydown: /* @__PURE__ */ h((w) => p(m - 1, w), "onKeydown"),
438
- onPaste: /* @__PURE__ */ h((w) => o(m - 1, w), "onPaste"),
439
- onFocus: /* @__PURE__ */ h((w) => g(m - 1), "onFocus")
440
- }, null, 40, Bs)), [
441
- [ss, r.value[m - 1]]
436
+ onInput: /* @__PURE__ */ p((w) => f(g - 1, w), "onInput"),
437
+ onKeydown: /* @__PURE__ */ p((w) => c(g - 1, w), "onKeydown"),
438
+ onPaste: /* @__PURE__ */ p((w) => l(g - 1, w), "onPaste"),
439
+ onFocus: /* @__PURE__ */ p((w) => x(g - 1), "onFocus")
440
+ }, null, 40, Us)), [
441
+ [rs, s.value[g - 1]]
442
442
  ])), 128))
443
443
  ]));
444
444
  }
445
- }), Us = { class: "relative flex-shrink-0" }, Fs = ["src", "alt"], Hs = { class: "absolute top-1 right-1" }, Gs = {
445
+ }), Fs = { class: "relative flex-shrink-0" }, Hs = ["src", "alt"], Gs = { class: "absolute top-1 right-1" }, js = {
446
446
  key: 1,
447
447
  class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
448
- }, js = { class: "min-w-0" }, Ws = /* @__PURE__ */ Le({
448
+ }, Ws = { class: "min-w-0" }, qs = /* @__PURE__ */ Oe({
449
449
  __name: "ElModeHeader",
450
450
  props: {
451
451
  agent: {},
@@ -459,7 +459,7 @@ const Ps = {
459
459
  a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
460
460
  ]])
461
461
  }, [
462
- y("div", Us, [
462
+ y("div", Fs, [
463
463
  y("div", {
464
464
  class: A(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
465
465
  }, [
@@ -469,19 +469,19 @@ const Ps = {
469
469
  class: "w-full h-full object-cover",
470
470
  onError: e[0] || (e[0] = //@ts-ignore
471
471
  (...n) => Qt(Pn) && Qt(Pn)(...n))
472
- }, null, 40, Fs)
472
+ }, null, 40, Hs)
473
473
  ], 2),
474
- y("div", Hs, [
475
- a.isOnline ? (T(), S(Te, { key: 0 }, [
474
+ y("div", Gs, [
475
+ a.isOnline ? (T(), S(Se, { key: 0 }, [
476
476
  e[1] || (e[1] = y("div", {
477
477
  class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
478
478
  style: { "animation-duration": "3s" }
479
479
  }, null, -1)),
480
480
  e[2] || (e[2] = y("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
481
- ], 64)) : (T(), S("div", Gs))
481
+ ], 64)) : (T(), S("div", js))
482
482
  ])
483
483
  ]),
484
- y("div", js, [
484
+ y("div", Ws, [
485
485
  y("h1", {
486
486
  class: A(["font-light text-white mb-1 truncate", [
487
487
  a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
@@ -499,187 +499,187 @@ const Ps = {
499
499
  }
500
500
  });
501
501
  const {
502
- entries: is,
502
+ entries: as,
503
503
  setPrototypeOf: Nn,
504
- isFrozen: qs,
505
- getPrototypeOf: Vs,
506
- getOwnPropertyDescriptor: Ys
504
+ isFrozen: Vs,
505
+ getPrototypeOf: Ys,
506
+ getOwnPropertyDescriptor: Zs
507
507
  } = Object;
508
508
  let {
509
509
  freeze: ne,
510
510
  seal: ue,
511
- create: Ue
511
+ create: Fe
512
512
  } = Object, {
513
513
  apply: Jt,
514
514
  construct: en
515
515
  } = typeof Reflect < "u" && Reflect;
516
- ne || (ne = /* @__PURE__ */ h(function(t) {
516
+ ne || (ne = /* @__PURE__ */ p(function(t) {
517
517
  return t;
518
518
  }, "freeze"));
519
- ue || (ue = /* @__PURE__ */ h(function(t) {
519
+ ue || (ue = /* @__PURE__ */ p(function(t) {
520
520
  return t;
521
521
  }, "seal"));
522
- Jt || (Jt = /* @__PURE__ */ h(function(t, e) {
523
- for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
524
- s[r - 2] = arguments[r];
525
- return t.apply(e, s);
522
+ Jt || (Jt = /* @__PURE__ */ p(function(t, e) {
523
+ for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
524
+ r[s - 2] = arguments[s];
525
+ return t.apply(e, r);
526
526
  }, "apply"));
527
- en || (en = /* @__PURE__ */ h(function(t) {
528
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
529
- n[s - 1] = arguments[s];
527
+ en || (en = /* @__PURE__ */ p(function(t) {
528
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
529
+ n[r - 1] = arguments[r];
530
530
  return new t(...n);
531
531
  }, "construct"));
532
- const et = j(Array.prototype.forEach), Zs = j(Array.prototype.lastIndexOf), $n = j(Array.prototype.pop), tt = j(Array.prototype.push), Xs = j(Array.prototype.splice), J = Array.isArray, lt = j(String.prototype.toLowerCase), Vt = j(String.prototype.toString), Bn = j(String.prototype.match), Be = j(String.prototype.replace), Un = j(String.prototype.indexOf), Ks = j(String.prototype.trim), Qs = j(Number.prototype.toString), Js = j(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : j(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : j(Symbol.prototype.toString), $ = j(Object.prototype.hasOwnProperty), nt = j(Object.prototype.toString), K = j(RegExp.prototype.test), wt = er(TypeError);
532
+ const tt = j(Array.prototype.forEach), Xs = j(Array.prototype.lastIndexOf), $n = j(Array.prototype.pop), nt = j(Array.prototype.push), Ks = j(Array.prototype.splice), ee = Array.isArray, lt = j(String.prototype.toLowerCase), Vt = j(String.prototype.toString), Bn = j(String.prototype.match), Ue = j(String.prototype.replace), Un = j(String.prototype.indexOf), Qs = j(String.prototype.trim), Js = j(Number.prototype.toString), er = j(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : j(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : j(Symbol.prototype.toString), $ = j(Object.prototype.hasOwnProperty), st = j(Object.prototype.toString), K = j(RegExp.prototype.test), wt = tr(TypeError);
533
533
  function j(a) {
534
534
  return function(t) {
535
535
  t instanceof RegExp && (t.lastIndex = 0);
536
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
537
- n[s - 1] = arguments[s];
536
+ for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
537
+ n[r - 1] = arguments[r];
538
538
  return Jt(a, t, n);
539
539
  };
540
540
  }
541
- h(j, "unapply");
542
- function er(a) {
541
+ p(j, "unapply");
542
+ function tr(a) {
543
543
  return function() {
544
544
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
545
545
  e[n] = arguments[n];
546
546
  return en(a, e);
547
547
  };
548
548
  }
549
- h(er, "unconstruct");
549
+ p(tr, "unconstruct");
550
550
  function R(a, t) {
551
551
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lt;
552
- if (Nn && Nn(a, null), !J(t))
552
+ if (Nn && Nn(a, null), !ee(t))
553
553
  return a;
554
554
  let n = t.length;
555
555
  for (; n--; ) {
556
- let s = t[n];
557
- if (typeof s == "string") {
558
- const r = e(s);
559
- r !== s && (qs(t) || (t[n] = r), s = r);
556
+ let r = t[n];
557
+ if (typeof r == "string") {
558
+ const s = e(r);
559
+ s !== r && (Vs(t) || (t[n] = s), r = s);
560
560
  }
561
- a[s] = !0;
561
+ a[r] = !0;
562
562
  }
563
563
  return a;
564
564
  }
565
- h(R, "addToSet");
566
- function tr(a) {
565
+ p(R, "addToSet");
566
+ function nr(a) {
567
567
  for (let t = 0; t < a.length; t++)
568
568
  $(a, t) || (a[t] = null);
569
569
  return a;
570
570
  }
571
- h(tr, "cleanArray");
571
+ p(nr, "cleanArray");
572
572
  function re(a) {
573
- const t = Ue(null);
574
- for (const [e, n] of is(a))
575
- $(a, e) && (J(n) ? t[e] = tr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = re(n) : t[e] = n);
573
+ const t = Fe(null);
574
+ for (const [e, n] of as(a))
575
+ $(a, e) && (ee(n) ? t[e] = nr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = re(n) : t[e] = n);
576
576
  return t;
577
577
  }
578
- h(re, "clone");
579
- function nr(a) {
578
+ p(re, "clone");
579
+ function sr(a) {
580
580
  switch (typeof a) {
581
581
  case "string":
582
582
  return a;
583
583
  case "number":
584
- return Qs(a);
585
- case "boolean":
586
584
  return Js(a);
585
+ case "boolean":
586
+ return er(a);
587
587
  case "bigint":
588
588
  return Fn ? Fn(a) : "0";
589
589
  case "symbol":
590
590
  return Hn ? Hn(a) : "Symbol()";
591
591
  case "undefined":
592
- return nt(a);
592
+ return st(a);
593
593
  case "function":
594
594
  case "object": {
595
595
  if (a === null)
596
- return nt(a);
597
- const t = a, e = Fe(t, "toString");
596
+ return st(a);
597
+ const t = a, e = He(t, "toString");
598
598
  if (typeof e == "function") {
599
599
  const n = e(t);
600
- return typeof n == "string" ? n : nt(n);
600
+ return typeof n == "string" ? n : st(n);
601
601
  }
602
- return nt(a);
602
+ return st(a);
603
603
  }
604
604
  default:
605
- return nt(a);
605
+ return st(a);
606
606
  }
607
607
  }
608
- h(nr, "stringifyValue");
609
- function Fe(a, t) {
608
+ p(sr, "stringifyValue");
609
+ function He(a, t) {
610
610
  for (; a !== null; ) {
611
- const n = Ys(a, t);
611
+ const n = Zs(a, t);
612
612
  if (n) {
613
613
  if (n.get)
614
614
  return j(n.get);
615
615
  if (typeof n.value == "function")
616
616
  return j(n.value);
617
617
  }
618
- a = Vs(a);
618
+ a = Ys(a);
619
619
  }
620
620
  function e() {
621
621
  return null;
622
622
  }
623
- return h(e, "fallbackValue"), e;
623
+ return p(e, "fallbackValue"), e;
624
624
  }
625
- h(Fe, "lookupGetter");
626
- function sr(a) {
625
+ p(He, "lookupGetter");
626
+ function rr(a) {
627
627
  try {
628
628
  return K(a, ""), !0;
629
629
  } catch {
630
630
  return !1;
631
631
  }
632
632
  }
633
- h(sr, "isRegex");
634
- const Gn = ne(["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"]), Yt = ne(["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"]), Zt = ne(["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"]), rr = ne(["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"]), Xt = ne(["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"]), ir = ne(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = ne(["#text"]), Wn = ne(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Kt = ne(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qn = ne(["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"]), yt = ne(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ar = ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm), lr = ue(/<%[\w\W]*|[\w\W]*%>/gm), or = ue(/\$\{[\w\W]*/gm), cr = ue(/^data-[\-\w.\u00B7-\uFFFF]+$/), ur = ue(/^aria-[\-\w]+$/), as = ue(
633
+ p(rr, "isRegex");
634
+ const Gn = ne(["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"]), Yt = ne(["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"]), Zt = ne(["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"]), ir = ne(["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"]), Xt = ne(["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 = ne(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = ne(["#text"]), Wn = ne(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Kt = ne(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qn = ne(["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"]), yt = ne(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), lr = ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm), or = ue(/<%[\w\W]*|[\w\W]*%>/gm), cr = ue(/\$\{[\w\W]*/gm), ur = ue(/^data-[\-\w.\u00B7-\uFFFF]+$/), hr = ue(/^aria-[\-\w]+$/), ls = ue(
635
635
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
636
636
  // eslint-disable-line no-useless-escape
637
- ), hr = ue(/^(?:\w+script|data):/i), pr = ue(
637
+ ), pr = ue(/^(?:\w+script|data):/i), dr = ue(
638
638
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
639
639
  // eslint-disable-line no-control-regex
640
- ), ls = ue(/^html$/i), dr = ue(/^[a-z][.\w]*(-[.\w]+)+$/i);
640
+ ), os = ue(/^html$/i), fr = ue(/^[a-z][.\w]*(-[.\w]+)+$/i);
641
641
  var Vn = /* @__PURE__ */ Object.freeze({
642
642
  __proto__: null,
643
- ARIA_ATTR: ur,
644
- ATTR_WHITESPACE: pr,
645
- CUSTOM_ELEMENT: dr,
646
- DATA_ATTR: cr,
647
- DOCTYPE_NAME: ls,
648
- ERB_EXPR: lr,
649
- IS_ALLOWED_URI: as,
650
- IS_SCRIPT_OR_DATA: hr,
651
- MUSTACHE_EXPR: ar,
652
- TMPLIT_EXPR: or
643
+ ARIA_ATTR: hr,
644
+ ATTR_WHITESPACE: dr,
645
+ CUSTOM_ELEMENT: fr,
646
+ DATA_ATTR: ur,
647
+ DOCTYPE_NAME: os,
648
+ ERB_EXPR: or,
649
+ IS_ALLOWED_URI: ls,
650
+ IS_SCRIPT_OR_DATA: pr,
651
+ MUSTACHE_EXPR: lr,
652
+ TMPLIT_EXPR: cr
653
653
  });
654
- const st = {
654
+ const rt = {
655
655
  element: 1,
656
656
  text: 3,
657
657
  // Deprecated
658
658
  progressingInstruction: 7,
659
659
  comment: 8,
660
660
  document: 9
661
- }, fr = /* @__PURE__ */ h(function() {
661
+ }, gr = /* @__PURE__ */ p(function() {
662
662
  return typeof window > "u" ? null : window;
663
- }, "getGlobal"), gr = /* @__PURE__ */ h(function(t, e) {
663
+ }, "getGlobal"), mr = /* @__PURE__ */ p(function(t, e) {
664
664
  if (typeof t != "object" || typeof t.createPolicy != "function")
665
665
  return null;
666
666
  let n = null;
667
- const s = "data-tt-policy-suffix";
668
- e && e.hasAttribute(s) && (n = e.getAttribute(s));
669
- const r = "dompurify" + (n ? "#" + n : "");
667
+ const r = "data-tt-policy-suffix";
668
+ e && e.hasAttribute(r) && (n = e.getAttribute(r));
669
+ const s = "dompurify" + (n ? "#" + n : "");
670
670
  try {
671
- return t.createPolicy(r, {
672
- createHTML(l) {
673
- return l;
671
+ return t.createPolicy(s, {
672
+ createHTML(o) {
673
+ return o;
674
674
  },
675
- createScriptURL(l) {
676
- return l;
675
+ createScriptURL(o) {
676
+ return o;
677
677
  }
678
678
  });
679
679
  } catch {
680
- return console.warn("TrustedTypes policy " + r + " could not be created."), null;
680
+ return console.warn("TrustedTypes policy " + s + " could not be created."), null;
681
681
  }
682
- }, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ h(function() {
682
+ }, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ p(function() {
683
683
  return {
684
684
  afterSanitizeAttributes: [],
685
685
  afterSanitizeElements: [],
@@ -692,26 +692,26 @@ const st = {
692
692
  uponSanitizeShadowNode: []
693
693
  };
694
694
  }, "_createHooksMap");
695
- function os() {
696
- let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fr();
697
- const t = /* @__PURE__ */ h((v) => os(v), "DOMPurify");
698
- if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== st.document || !a.Element)
695
+ function cs() {
696
+ let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : gr();
697
+ const t = /* @__PURE__ */ p((v) => cs(v), "DOMPurify");
698
+ if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== rt.document || !a.Element)
699
699
  return t.isSupported = !1, t;
700
700
  let {
701
701
  document: e
702
702
  } = a;
703
- const n = e, s = n.currentScript, {
704
- DocumentFragment: r,
705
- HTMLTemplateElement: l,
706
- Node: o,
707
- Element: c,
708
- NodeFilter: p,
709
- NamedNodeMap: g = a.NamedNodeMap || a.MozNamedAttrMap,
710
- HTMLFormElement: d,
711
- DOMParser: f,
712
- trustedTypes: m
713
- } = a, w = c.prototype, E = Fe(w, "cloneNode"), O = Fe(w, "remove"), U = Fe(w, "nextSibling"), ae = Fe(w, "childNodes"), le = Fe(w, "parentNode");
714
- if (typeof l == "function") {
703
+ const n = e, r = n.currentScript, {
704
+ DocumentFragment: s,
705
+ HTMLTemplateElement: o,
706
+ Node: l,
707
+ Element: f,
708
+ NodeFilter: c,
709
+ NamedNodeMap: x = a.NamedNodeMap || a.MozNamedAttrMap,
710
+ HTMLFormElement: h,
711
+ DOMParser: d,
712
+ trustedTypes: g
713
+ } = a, w = f.prototype, E = He(w, "cloneNode"), O = He(w, "remove"), U = He(w, "nextSibling"), ae = He(w, "childNodes"), le = He(w, "parentNode");
714
+ if (typeof o == "function") {
715
715
  const v = e.createElement("template");
716
716
  v.content && v.content.ownerDocument && (e = v.content.ownerDocument);
717
717
  }
@@ -720,18 +720,18 @@ function os() {
720
720
  implementation: me,
721
721
  createNodeIterator: V,
722
722
  createDocumentFragment: ht,
723
- getElementsByTagName: _e
723
+ getElementsByTagName: Re
724
724
  } = e, {
725
725
  importNode: It
726
726
  } = n;
727
727
  let Y = Yn();
728
- t.isSupported = typeof is == "function" && typeof le == "function" && me && me.createHTMLDocument !== void 0;
728
+ t.isSupported = typeof as == "function" && typeof le == "function" && me && me.createHTMLDocument !== void 0;
729
729
  const {
730
730
  MUSTACHE_EXPR: I,
731
- ERB_EXPR: Re,
731
+ ERB_EXPR: Ie,
732
732
  TMPLIT_EXPR: ve,
733
733
  DATA_ATTR: Dt,
734
- ARIA_ATTR: Ve,
734
+ ARIA_ATTR: Ye,
735
735
  IS_SCRIPT_OR_DATA: Ct,
736
736
  ATTR_WHITESPACE: pt,
737
737
  CUSTOM_ELEMENT: dt
@@ -741,8 +741,8 @@ function os() {
741
741
  } = Vn, F = null;
742
742
  const gt = R({}, [...Gn, ...Yt, ...Zt, ...Xt, ...jn]);
743
743
  let W = null;
744
- const Ye = R({}, [...Wn, ...Kt, ...qn, ...yt]);
745
- let P = Object.seal(Ue(null, {
744
+ const Ze = R({}, [...Wn, ...Kt, ...qn, ...yt]);
745
+ let P = Object.seal(Fe(null, {
746
746
  tagNameCheck: {
747
747
  writable: !0,
748
748
  configurable: !1,
@@ -761,8 +761,8 @@ function os() {
761
761
  enumerable: !0,
762
762
  value: !1
763
763
  }
764
- })), _ = null, x = null;
765
- const b = Object.seal(Ue(null, {
764
+ })), _ = null, b = null;
765
+ const m = Object.seal(Fe(null, {
766
766
  tagCheck: {
767
767
  writable: !0,
768
768
  configurable: !1,
@@ -776,49 +776,49 @@ function os() {
776
776
  value: null
777
777
  }
778
778
  }));
779
- let L = !0, Z = !0, we = !1, Ze = !0, he = !1, Xe = !0, Ie = !1, Mt = !1, Lt = !1, ze = !1, mt = !1, bt = !1, fn = !0, gn = !1;
779
+ let L = !0, Z = !0, we = !1, Xe = !0, he = !1, Ke = !0, De = !1, Mt = !1, Lt = !1, Pe = !1, mt = !1, bt = !1, fn = !0, gn = !1;
780
780
  const mn = "user-content-";
781
- let Ot = !0, Ke = !1, Pe = {}, be = null;
781
+ let Ot = !0, Qe = !1, Ne = {}, be = null;
782
782
  const zt = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
783
783
  let bn = null;
784
784
  const xn = R({}, ["audio", "video", "img", "source", "image", "track"]);
785
785
  let Pt = null;
786
786
  const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), xt = "http://www.w3.org/1998/Math/MathML", kt = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml";
787
- let Ne = xe, Nt = !1, $t = null;
788
- const ks = R({}, [xt, kt, xe], Vt);
787
+ let $e = xe, Nt = !1, $t = null;
788
+ const ws = R({}, [xt, kt, xe], Vt);
789
789
  let Bt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = R({}, ["annotation-xml"]);
790
- const ws = R({}, ["title", "style", "font", "a", "script"]);
791
- let Qe = null;
792
- const ys = ["application/xhtml+xml", "text/html"], vs = "text/html";
793
- let q = null, $e = null;
794
- const Ts = e.createElement("form"), wn = /* @__PURE__ */ h(function(i) {
790
+ const ys = R({}, ["title", "style", "font", "a", "script"]);
791
+ let Je = null;
792
+ const vs = ["application/xhtml+xml", "text/html"], Ts = "text/html";
793
+ let q = null, Be = null;
794
+ const Ss = e.createElement("form"), wn = /* @__PURE__ */ p(function(i) {
795
795
  return i instanceof RegExp || i instanceof Function;
796
- }, "isRegexOrFunction"), Ft = /* @__PURE__ */ h(function() {
796
+ }, "isRegexOrFunction"), Ft = /* @__PURE__ */ p(function() {
797
797
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
798
- if ($e && $e === i)
798
+ if (Be && Be === i)
799
799
  return;
800
- (!i || typeof i != "object") && (i = {}), i = re(i), Qe = // eslint-disable-next-line unicorn/prefer-includes
801
- ys.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? vs : i.PARSER_MEDIA_TYPE, q = Qe === "application/xhtml+xml" ? Vt : lt, F = $(i, "ALLOWED_TAGS") && J(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, q) : gt, W = $(i, "ALLOWED_ATTR") && J(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, q) : Ye, $t = $(i, "ALLOWED_NAMESPACES") && J(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Vt) : ks, Pt = $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, q) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && J(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, q) : xn, be = $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, q) : zt, _ = $(i, "FORBID_TAGS") && J(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, q) : re({}), x = $(i, "FORBID_ATTR") && J(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, q) : re({}), Pe = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, L = i.ALLOW_ARIA_ATTR !== !1, Z = i.ALLOW_DATA_ATTR !== !1, we = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Ze = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, he = i.SAFE_FOR_TEMPLATES || !1, Xe = i.SAFE_FOR_XML !== !1, Ie = i.WHOLE_DOCUMENT || !1, ze = i.RETURN_DOM || !1, mt = i.RETURN_DOM_FRAGMENT || !1, bt = i.RETURN_TRUSTED_TYPE || !1, Lt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Ot = i.KEEP_CONTENT !== !1, Ke = i.IN_PLACE || !1, ft = sr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : as, Ne = typeof i.NAMESPACE == "string" ? i.NAMESPACE : xe, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
802
- const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : Ue(null);
803
- if (P = Ue(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), he && (Z = !1), mt && (ze = !0), Pe && (F = R({}, jn), W = Ue(null), Pe.html === !0 && (R(F, Gn), R(W, Wn)), Pe.svg === !0 && (R(F, Yt), R(W, Kt), R(W, yt)), Pe.svgFilters === !0 && (R(F, Zt), R(W, Kt), R(W, yt)), Pe.mathMl === !0 && (R(F, Xt), R(W, qn), R(W, yt))), b.tagCheck = null, b.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? b.tagCheck = i.ADD_TAGS : J(i.ADD_TAGS) && (F === gt && (F = re(F)), R(F, i.ADD_TAGS, q))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? b.attributeCheck = i.ADD_ATTR : J(i.ADD_ATTR) && (W === Ye && (W = re(W)), R(W, i.ADD_ATTR, q))), $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, q), $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.FORBID_CONTENTS, q)), $(i, "ADD_FORBID_CONTENTS") && J(i.ADD_FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.ADD_FORBID_CONTENTS, q)), Ot && (F["#text"] = !0), Ie && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete _.tbody), i.TRUSTED_TYPES_POLICY) {
800
+ (!i || typeof i != "object") && (i = {}), i = re(i), Je = // eslint-disable-next-line unicorn/prefer-includes
801
+ vs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ts : i.PARSER_MEDIA_TYPE, q = Je === "application/xhtml+xml" ? Vt : lt, F = $(i, "ALLOWED_TAGS") && ee(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, q) : gt, W = $(i, "ALLOWED_ATTR") && ee(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, q) : Ze, $t = $(i, "ALLOWED_NAMESPACES") && ee(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Vt) : ws, Pt = $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, q) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && ee(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, q) : xn, be = $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, q) : zt, _ = $(i, "FORBID_TAGS") && ee(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, q) : re({}), b = $(i, "FORBID_ATTR") && ee(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, q) : re({}), Ne = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, L = i.ALLOW_ARIA_ATTR !== !1, Z = i.ALLOW_DATA_ATTR !== !1, we = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Xe = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, he = i.SAFE_FOR_TEMPLATES || !1, Ke = i.SAFE_FOR_XML !== !1, De = i.WHOLE_DOCUMENT || !1, Pe = i.RETURN_DOM || !1, mt = i.RETURN_DOM_FRAGMENT || !1, bt = i.RETURN_TRUSTED_TYPE || !1, Lt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Ot = i.KEEP_CONTENT !== !1, Qe = i.IN_PLACE || !1, ft = rr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : ls, $e = typeof i.NAMESPACE == "string" ? i.NAMESPACE : xe, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
802
+ const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : Fe(null);
803
+ if (P = Fe(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), he && (Z = !1), mt && (Pe = !0), Ne && (F = R({}, jn), W = Fe(null), Ne.html === !0 && (R(F, Gn), R(W, Wn)), Ne.svg === !0 && (R(F, Yt), R(W, Kt), R(W, yt)), Ne.svgFilters === !0 && (R(F, Zt), R(W, Kt), R(W, yt)), Ne.mathMl === !0 && (R(F, Xt), R(W, qn), R(W, yt))), m.tagCheck = null, m.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? m.tagCheck = i.ADD_TAGS : ee(i.ADD_TAGS) && (F === gt && (F = re(F)), R(F, i.ADD_TAGS, q))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? m.attributeCheck = i.ADD_ATTR : ee(i.ADD_ATTR) && (W === Ze && (W = re(W)), R(W, i.ADD_ATTR, q))), $(i, "ADD_URI_SAFE_ATTR") && ee(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, q), $(i, "FORBID_CONTENTS") && ee(i.FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.FORBID_CONTENTS, q)), $(i, "ADD_FORBID_CONTENTS") && ee(i.ADD_FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.ADD_FORBID_CONTENTS, q)), Ot && (F["#text"] = !0), De && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete _.tbody), i.TRUSTED_TYPES_POLICY) {
804
804
  if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
805
805
  throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
806
806
  if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
807
807
  throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
808
808
  z = i.TRUSTED_TYPES_POLICY, oe = z.createHTML("");
809
809
  } else
810
- z === void 0 && (z = gr(m, s)), z !== null && typeof oe == "string" && (oe = z.createHTML(""));
811
- ne && ne(i), $e = i;
812
- }, "_parseConfig"), yn = R({}, [...Yt, ...Zt, ...rr]), vn = R({}, [...Xt, ...ir]), Ss = /* @__PURE__ */ h(function(i) {
810
+ z === void 0 && (z = mr(g, r)), z !== null && typeof oe == "string" && (oe = z.createHTML(""));
811
+ ne && ne(i), Be = i;
812
+ }, "_parseConfig"), yn = R({}, [...Yt, ...Zt, ...ir]), vn = R({}, [...Xt, ...ar]), As = /* @__PURE__ */ p(function(i) {
813
813
  let u = le(i);
814
814
  (!u || !u.tagName) && (u = {
815
- namespaceURI: Ne,
815
+ namespaceURI: $e,
816
816
  tagName: "template"
817
817
  });
818
818
  const k = lt(i.tagName), N = lt(u.tagName);
819
- return $t[i.namespaceURI] ? i.namespaceURI === kt ? u.namespaceURI === xe ? k === "svg" : u.namespaceURI === xt ? k === "svg" && (N === "annotation-xml" || Bt[N]) : !!yn[k] : i.namespaceURI === xt ? u.namespaceURI === xe ? k === "math" : u.namespaceURI === kt ? k === "math" && Ut[N] : !!vn[k] : i.namespaceURI === xe ? u.namespaceURI === kt && !Ut[N] || u.namespaceURI === xt && !Bt[N] ? !1 : !vn[k] && (ws[k] || !yn[k]) : !!(Qe === "application/xhtml+xml" && $t[i.namespaceURI]) : !1;
820
- }, "_checkValidNamespace"), pe = /* @__PURE__ */ h(function(i) {
821
- tt(t.removed, {
819
+ return $t[i.namespaceURI] ? i.namespaceURI === kt ? u.namespaceURI === xe ? k === "svg" : u.namespaceURI === xt ? k === "svg" && (N === "annotation-xml" || Bt[N]) : !!yn[k] : i.namespaceURI === xt ? u.namespaceURI === xe ? k === "math" : u.namespaceURI === kt ? k === "math" && Ut[N] : !!vn[k] : i.namespaceURI === xe ? u.namespaceURI === kt && !Ut[N] || u.namespaceURI === xt && !Bt[N] ? !1 : !vn[k] && (ys[k] || !yn[k]) : !!(Je === "application/xhtml+xml" && $t[i.namespaceURI]) : !1;
820
+ }, "_checkValidNamespace"), pe = /* @__PURE__ */ p(function(i) {
821
+ nt(t.removed, {
822
822
  element: i
823
823
  });
824
824
  try {
@@ -826,20 +826,20 @@ function os() {
826
826
  } catch {
827
827
  O(i);
828
828
  }
829
- }, "_forceRemove"), De = /* @__PURE__ */ h(function(i, u) {
829
+ }, "_forceRemove"), Ce = /* @__PURE__ */ p(function(i, u) {
830
830
  try {
831
- tt(t.removed, {
831
+ nt(t.removed, {
832
832
  attribute: u.getAttributeNode(i),
833
833
  from: u
834
834
  });
835
835
  } catch {
836
- tt(t.removed, {
836
+ nt(t.removed, {
837
837
  attribute: null,
838
838
  from: u
839
839
  });
840
840
  }
841
841
  if (u.removeAttribute(i), i === "is")
842
- if (ze || mt)
842
+ if (Pe || mt)
843
843
  try {
844
844
  pe(u);
845
845
  } catch {
@@ -849,7 +849,7 @@ function os() {
849
849
  u.setAttribute(i, "");
850
850
  } catch {
851
851
  }
852
- }, "_removeAttribute"), Tn = /* @__PURE__ */ h(function(i) {
852
+ }, "_removeAttribute"), Tn = /* @__PURE__ */ p(function(i) {
853
853
  let u = null, k = null;
854
854
  if (Lt)
855
855
  i = "<remove></remove>" + i;
@@ -857,42 +857,42 @@ function os() {
857
857
  const H = Bn(i, /^[\r\n\t ]+/);
858
858
  k = H && H[0];
859
859
  }
860
- Qe === "application/xhtml+xml" && Ne === xe && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
860
+ Je === "application/xhtml+xml" && $e === xe && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
861
861
  const N = z ? z.createHTML(i) : i;
862
- if (Ne === xe)
862
+ if ($e === xe)
863
863
  try {
864
- u = new f().parseFromString(N, Qe);
864
+ u = new d().parseFromString(N, Je);
865
865
  } catch {
866
866
  }
867
867
  if (!u || !u.documentElement) {
868
- u = me.createDocument(Ne, "template", null);
868
+ u = me.createDocument($e, "template", null);
869
869
  try {
870
870
  u.documentElement.innerHTML = Nt ? oe : N;
871
871
  } catch {
872
872
  }
873
873
  }
874
874
  const Q = u.body || u.documentElement;
875
- return i && k && Q.insertBefore(e.createTextNode(k), Q.childNodes[0] || null), Ne === xe ? _e.call(u, Ie ? "html" : "body")[0] : Ie ? u.documentElement : Q;
876
- }, "_initDocument"), Sn = /* @__PURE__ */ h(function(i) {
875
+ return i && k && Q.insertBefore(e.createTextNode(k), Q.childNodes[0] || null), $e === xe ? Re.call(u, De ? "html" : "body")[0] : De ? u.documentElement : Q;
876
+ }, "_initDocument"), Sn = /* @__PURE__ */ p(function(i) {
877
877
  return V.call(
878
878
  i.ownerDocument || i,
879
879
  i,
880
880
  // eslint-disable-next-line no-bitwise
881
- p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
881
+ c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
882
882
  null
883
883
  );
884
- }, "_createNodeIterator"), Ht = /* @__PURE__ */ h(function(i) {
885
- return i instanceof d && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof g) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
886
- }, "_isClobbered"), Gt = /* @__PURE__ */ h(function(i) {
887
- return typeof o == "function" && i instanceof o;
884
+ }, "_createNodeIterator"), Ht = /* @__PURE__ */ p(function(i) {
885
+ return i instanceof h && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof x) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
886
+ }, "_isClobbered"), Gt = /* @__PURE__ */ p(function(i) {
887
+ return typeof l == "function" && i instanceof l;
888
888
  }, "_isNode");
889
889
  function ye(v, i, u) {
890
- et(v, (k) => {
891
- k.call(t, i, u, $e);
890
+ tt(v, (k) => {
891
+ k.call(t, i, u, Be);
892
892
  });
893
893
  }
894
- h(ye, "_executeHooks");
895
- const An = /* @__PURE__ */ h(function(i) {
894
+ p(ye, "_executeHooks");
895
+ const An = /* @__PURE__ */ p(function(i) {
896
896
  let u = null;
897
897
  if (ye(Y.beforeSanitizeElements, i, null), Ht(i))
898
898
  return pe(i), !0;
@@ -900,9 +900,9 @@ function os() {
900
900
  if (ye(Y.uponSanitizeElement, i, {
901
901
  tagName: k,
902
902
  allowedTags: F
903
- }), Xe && i.hasChildNodes() && !Gt(i.firstElementChild) && K(/<[/\w!]/g, i.innerHTML) && K(/<[/\w!]/g, i.textContent) || Xe && i.namespaceURI === xe && k === "style" && Gt(i.firstElementChild) || i.nodeType === st.progressingInstruction || Xe && i.nodeType === st.comment && K(/<[/\w]/g, i.data))
903
+ }), Ke && i.hasChildNodes() && !Gt(i.firstElementChild) && K(/<[/\w!]/g, i.innerHTML) && K(/<[/\w!]/g, i.textContent) || Ke && i.namespaceURI === xe && k === "style" && Gt(i.firstElementChild) || i.nodeType === rt.progressingInstruction || Ke && i.nodeType === rt.comment && K(/<[/\w]/g, i.data))
904
904
  return pe(i), !0;
905
- if (_[k] || !(b.tagCheck instanceof Function && b.tagCheck(k)) && !F[k]) {
905
+ if (_[k] || !(m.tagCheck instanceof Function && m.tagCheck(k)) && !F[k]) {
906
906
  if (!_[k] && _n(k) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, k) || P.tagNameCheck instanceof Function && P.tagNameCheck(k)))
907
907
  return !1;
908
908
  if (Ot && !be[k]) {
@@ -917,18 +917,18 @@ function os() {
917
917
  }
918
918
  return pe(i), !0;
919
919
  }
920
- return i instanceof c && !Ss(i) || (k === "noscript" || k === "noembed" || k === "noframes") && K(/<\/no(script|embed|frames)/i, i.innerHTML) ? (pe(i), !0) : (he && i.nodeType === st.text && (u = i.textContent, et([I, Re, ve], (N) => {
921
- u = Be(u, N, " ");
922
- }), i.textContent !== u && (tt(t.removed, {
920
+ return i instanceof f && !As(i) || (k === "noscript" || k === "noembed" || k === "noframes") && K(/<\/no(script|embed|frames)/i, i.innerHTML) ? (pe(i), !0) : (he && i.nodeType === rt.text && (u = i.textContent, tt([I, Ie, ve], (N) => {
921
+ u = Ue(u, N, " ");
922
+ }), i.textContent !== u && (nt(t.removed, {
923
923
  element: i.cloneNode()
924
924
  }), i.textContent = u)), ye(Y.afterSanitizeElements, i, null), !1);
925
- }, "_sanitizeElements"), En = /* @__PURE__ */ h(function(i, u, k) {
926
- if (x[u] || fn && (u === "id" || u === "name") && (k in e || k in Ts))
925
+ }, "_sanitizeElements"), En = /* @__PURE__ */ p(function(i, u, k) {
926
+ if (b[u] || fn && (u === "id" || u === "name") && (k in e || k in Ss))
927
927
  return !1;
928
- if (!(Z && !x[u] && K(Dt, u))) {
929
- if (!(L && K(Ve, u))) {
930
- if (!(b.attributeCheck instanceof Function && b.attributeCheck(u, i))) {
931
- if (!W[u] || x[u]) {
928
+ if (!(Z && !b[u] && K(Dt, u))) {
929
+ if (!(L && K(Ye, u))) {
930
+ if (!(m.attributeCheck instanceof Function && m.attributeCheck(u, i))) {
931
+ if (!W[u] || b[u]) {
932
932
  if (
933
933
  // First condition does a very basic check if a) it's basically a valid custom element tagname AND
934
934
  // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
@@ -938,9 +938,9 @@ function os() {
938
938
  u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, k) || P.tagNameCheck instanceof Function && P.tagNameCheck(k)))
939
939
  ) return !1;
940
940
  } else if (!Pt[u]) {
941
- if (!K(ft, Be(k, pt, ""))) {
941
+ if (!K(ft, Ue(k, pt, ""))) {
942
942
  if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Un(k, "data:") === 0 && bn[i])) {
943
- if (!(we && !K(Ct, Be(k, pt, "")))) {
943
+ if (!(we && !K(Ct, Ue(k, pt, "")))) {
944
944
  if (k)
945
945
  return !1;
946
946
  }
@@ -951,9 +951,9 @@ function os() {
951
951
  }
952
952
  }
953
953
  return !0;
954
- }, "_isValidAttribute"), As = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ h(function(i) {
955
- return !As[lt(i)] && K(dt, i);
956
- }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ h(function(i) {
954
+ }, "_isValidAttribute"), Es = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ p(function(i) {
955
+ return !Es[lt(i)] && K(dt, i);
956
+ }, "_isBasicCustomElement"), Rn = /* @__PURE__ */ p(function(i) {
957
957
  ye(Y.beforeSanitizeAttributes, i, null);
958
958
  const {
959
959
  attributes: u
@@ -974,35 +974,35 @@ function os() {
974
974
  namespaceURI: se,
975
975
  value: ce
976
976
  } = Q, de = q(H), jt = ce;
977
- let X = H === "value" ? jt : Ks(jt);
978
- if (k.attrName = de, k.attrValue = X, k.keepAttr = !0, k.forceKeepAttr = void 0, ye(Y.uponSanitizeAttribute, i, k), X = k.attrValue, gn && (de === "id" || de === "name") && Un(X, mn) !== 0 && (De(H, i), X = mn + X), Xe && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, X)) {
979
- De(H, i);
977
+ let X = H === "value" ? jt : Qs(jt);
978
+ if (k.attrName = de, k.attrValue = X, k.keepAttr = !0, k.forceKeepAttr = void 0, ye(Y.uponSanitizeAttribute, i, k), X = k.attrValue, gn && (de === "id" || de === "name") && Un(X, mn) !== 0 && (Ce(H, i), X = mn + X), Ke && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, X)) {
979
+ Ce(H, i);
980
980
  continue;
981
981
  }
982
982
  if (de === "attributename" && Bn(X, "href")) {
983
- De(H, i);
983
+ Ce(H, i);
984
984
  continue;
985
985
  }
986
986
  if (k.forceKeepAttr)
987
987
  continue;
988
988
  if (!k.keepAttr) {
989
- De(H, i);
989
+ Ce(H, i);
990
990
  continue;
991
991
  }
992
- if (!Ze && K(/\/>/i, X)) {
993
- De(H, i);
992
+ if (!Xe && K(/\/>/i, X)) {
993
+ Ce(H, i);
994
994
  continue;
995
995
  }
996
- he && et([I, Re, ve], (Cn) => {
997
- X = Be(X, Cn, " ");
996
+ he && tt([I, Ie, ve], (Cn) => {
997
+ X = Ue(X, Cn, " ");
998
998
  });
999
999
  const Dn = q(i.nodeName);
1000
1000
  if (!En(Dn, de, X)) {
1001
- De(H, i);
1001
+ Ce(H, i);
1002
1002
  continue;
1003
1003
  }
1004
- if (z && typeof m == "object" && typeof m.getAttributeType == "function" && !se)
1005
- switch (m.getAttributeType(Dn, de)) {
1004
+ if (z && typeof g == "object" && typeof g.getAttributeType == "function" && !se)
1005
+ switch (g.getAttributeType(Dn, de)) {
1006
1006
  case "TrustedHTML": {
1007
1007
  X = z.createHTML(X);
1008
1008
  break;
@@ -1016,51 +1016,51 @@ function os() {
1016
1016
  try {
1017
1017
  se ? i.setAttributeNS(se, H, X) : i.setAttribute(H, X), Ht(i) ? pe(i) : $n(t.removed);
1018
1018
  } catch {
1019
- De(H, i);
1019
+ Ce(H, i);
1020
1020
  }
1021
1021
  }
1022
1022
  ye(Y.afterSanitizeAttributes, i, null);
1023
- }, "_sanitizeAttributes"), In = /* @__PURE__ */ h(function(i) {
1023
+ }, "_sanitizeAttributes"), In = /* @__PURE__ */ p(function(i) {
1024
1024
  let u = null;
1025
1025
  const k = Sn(i);
1026
1026
  for (ye(Y.beforeSanitizeShadowDOM, i, null); u = k.nextNode(); )
1027
- ye(Y.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof r && In(u.content);
1027
+ ye(Y.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof s && In(u.content);
1028
1028
  ye(Y.afterSanitizeShadowDOM, i, null);
1029
1029
  }, "_sanitizeShadowDOM");
1030
1030
  return t.sanitize = function(v) {
1031
1031
  let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, k = null, N = null, Q = null;
1032
- if (Nt = !v, Nt && (v = "<!-->"), typeof v != "string" && !Gt(v) && (v = nr(v), typeof v != "string"))
1032
+ if (Nt = !v, Nt && (v = "<!-->"), typeof v != "string" && !Gt(v) && (v = sr(v), typeof v != "string"))
1033
1033
  throw wt("dirty is not a string, aborting");
1034
1034
  if (!t.isSupported)
1035
1035
  return v;
1036
- if (Mt || Ft(i), t.removed = [], typeof v == "string" && (Ke = !1), Ke) {
1036
+ if (Mt || Ft(i), t.removed = [], typeof v == "string" && (Qe = !1), Qe) {
1037
1037
  const ce = v.nodeName;
1038
1038
  if (typeof ce == "string") {
1039
1039
  const de = q(ce);
1040
1040
  if (!F[de] || _[de])
1041
1041
  throw wt("root node is forbidden and cannot be sanitized in-place");
1042
1042
  }
1043
- } else if (v instanceof o)
1044
- u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === st.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
1043
+ } else if (v instanceof l)
1044
+ u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === rt.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
1045
1045
  else {
1046
- if (!ze && !he && !Ie && // eslint-disable-next-line unicorn/prefer-includes
1046
+ if (!Pe && !he && !De && // eslint-disable-next-line unicorn/prefer-includes
1047
1047
  v.indexOf("<") === -1)
1048
1048
  return z && bt ? z.createHTML(v) : v;
1049
1049
  if (u = Tn(v), !u)
1050
- return ze ? null : bt ? oe : "";
1050
+ return Pe ? null : bt ? oe : "";
1051
1051
  }
1052
1052
  u && Lt && pe(u.firstChild);
1053
- const H = Sn(Ke ? v : u);
1053
+ const H = Sn(Qe ? v : u);
1054
1054
  for (; N = H.nextNode(); )
1055
- An(N), Rn(N), N.content instanceof r && In(N.content);
1056
- if (Ke)
1055
+ An(N), Rn(N), N.content instanceof s && In(N.content);
1056
+ if (Qe)
1057
1057
  return v;
1058
- if (ze) {
1058
+ if (Pe) {
1059
1059
  if (he) {
1060
1060
  u.normalize();
1061
1061
  let ce = u.innerHTML;
1062
- et([I, Re, ve], (de) => {
1063
- ce = Be(ce, de, " ");
1062
+ tt([I, Ie, ve], (de) => {
1063
+ ce = Ue(ce, de, " ");
1064
1064
  }), u.innerHTML = ce;
1065
1065
  }
1066
1066
  if (mt)
@@ -1070,26 +1070,26 @@ function os() {
1070
1070
  Q = u;
1071
1071
  return (W.shadowroot || W.shadowrootmode) && (Q = It.call(n, Q, !0)), Q;
1072
1072
  }
1073
- let se = Ie ? u.outerHTML : u.innerHTML;
1074
- return Ie && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(ls, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1075
- ` + se), he && et([I, Re, ve], (ce) => {
1076
- se = Be(se, ce, " ");
1073
+ let se = De ? u.outerHTML : u.innerHTML;
1074
+ return De && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(os, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
1075
+ ` + se), he && tt([I, Ie, ve], (ce) => {
1076
+ se = Ue(se, ce, " ");
1077
1077
  }), z && bt ? z.createHTML(se) : se;
1078
1078
  }, t.setConfig = function() {
1079
1079
  let v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1080
1080
  Ft(v), Mt = !0;
1081
1081
  }, t.clearConfig = function() {
1082
- $e = null, Mt = !1;
1082
+ Be = null, Mt = !1;
1083
1083
  }, t.isValidAttribute = function(v, i, u) {
1084
- $e || Ft({});
1084
+ Be || Ft({});
1085
1085
  const k = q(v), N = q(i);
1086
1086
  return En(k, N, u);
1087
1087
  }, t.addHook = function(v, i) {
1088
- typeof i == "function" && tt(Y[v], i);
1088
+ typeof i == "function" && nt(Y[v], i);
1089
1089
  }, t.removeHook = function(v, i) {
1090
1090
  if (i !== void 0) {
1091
- const u = Zs(Y[v], i);
1092
- return u === -1 ? void 0 : Xs(Y[v], u, 1)[0];
1091
+ const u = Xs(Y[v], i);
1092
+ return u === -1 ? void 0 : Ks(Y[v], u, 1)[0];
1093
1093
  }
1094
1094
  return $n(Y[v]);
1095
1095
  }, t.removeHooks = function(v) {
@@ -1098,72 +1098,80 @@ function os() {
1098
1098
  Y = Yn();
1099
1099
  }, t;
1100
1100
  }
1101
- h(os, "createDOMPurify");
1102
- var mr = os();
1101
+ p(cs, "createDOMPurify");
1102
+ var br = cs();
1103
1103
  function sn() {
1104
1104
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
1105
1105
  }
1106
- h(sn, "M");
1107
- var Oe = sn();
1108
- function cs(a) {
1109
- Oe = a;
1106
+ p(sn, "z");
1107
+ var ze = sn();
1108
+ function us(a) {
1109
+ ze = a;
1110
1110
  }
1111
- h(cs, "G");
1112
- var Ce = { exec: /* @__PURE__ */ h(() => null, "exec") };
1111
+ p(us, "G");
1112
+ var Me = { exec: /* @__PURE__ */ p(() => null, "exec") };
1113
1113
  function C(a, t = "") {
1114
- let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((s, r) => {
1115
- let l = typeof r == "string" ? r : r.source;
1116
- return l = l.replace(te.caret, "$1"), e = e.replace(s, l), n;
1117
- }, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
1114
+ let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ p((r, s) => {
1115
+ let o = typeof s == "string" ? s : s.source;
1116
+ return o = o.replace(J.caret, "$1"), e = e.replace(r, o), n;
1117
+ }, "replace"), getRegex: /* @__PURE__ */ p(() => new RegExp(e, t), "getRegex") };
1118
1118
  return n;
1119
1119
  }
1120
- h(C, "k");
1121
- var br = (() => {
1120
+ p(C, "k");
1121
+ var xr = ((a = "") => {
1122
1122
  try {
1123
- return !!new RegExp("(?<=1)(?<!1)");
1123
+ return !!new RegExp("(?<=1)(?<!1)" + a);
1124
1124
  } catch {
1125
1125
  return !1;
1126
1126
  }
1127
- })(), te = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, xr = /^(?:[ \t]*(?:\n|$))+/, kr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ut = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, yr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, us = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, hs = C(us).replace(/bull/g, rn).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(), vr = C(us).replace(/bull/g, rn).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(), an = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Tr = /^[^\n]+/, ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Sr = C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ar = C(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rn).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", on = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Er = C("^ {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", on).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ps = C(an).replace("hr", ut).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(), _r = C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ps).getRegex(), cn = { blockquote: _r, code: kr, def: Sr, fences: wr, heading: yr, hr: ut, html: Er, lheading: hs, list: Ar, newline: xr, paragraph: ps, table: Ce, text: Tr }, Zn = C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ut).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(), Rr = { ...cn, lheading: vr, table: Zn, paragraph: C(an).replace("hr", ut).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex() }, Ir = { ...cn, html: C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", on).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: Ce, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: C(an).replace("hr", ut).replace("heading", ` *#{1,6} *[^
1128
- ]`).replace("lheading", hs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Dr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Cr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ds = /^( {2,}|\\)\n(?!\s*$)/, Mr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, qe = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, un = /[^\s\p{P}\p{S}]/u, Lr = C(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), fs = /(?!~)[\p{P}\p{S}]/u, Or = /(?!~)[\s\p{P}\p{S}]/u, zr = /(?:[^\s\p{P}\p{S}]|~)/u, Pr = C(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", br ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), gs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Nr = C(gs, "u").replace(/punct/g, qe).getRegex(), $r = C(gs, "u").replace(/punct/g, fs).getRegex(), ms = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Br = C(ms, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, qe).getRegex(), Ur = C(ms, "gu").replace(/notPunctSpace/g, zr).replace(/punctSpace/g, Or).replace(/punct/g, fs).getRegex(), Fr = C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, qe).getRegex(), Hr = C(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, qe).getRegex(), Gr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", jr = C(Gr, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, qe).getRegex(), Wr = C(/\\(punct)/, "gu").replace(/punct/g, qe).getRegex(), qr = C(/^<(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(), Vr = C(on).replace("(?:-->|$)", "-->").getRegex(), Yr = C("^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", Vr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), St = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Zr = C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", St).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), bs = C(/^!?\[(label)\]\[(ref)\]/).replace("label", St).replace("ref", ln).getRegex(), xs = C(/^!?\[(ref)\](?:\[\])?/).replace("ref", ln).getRegex(), Xr = C("reflink|nolink(?!\\()", "g").replace("reflink", bs).replace("nolink", xs).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, hn = { _backpedal: Ce, anyPunctuation: Wr, autolink: qr, blockSkip: Pr, br: ds, code: Cr, del: Ce, delLDelim: Ce, delRDelim: Ce, emStrongLDelim: Nr, emStrongRDelimAst: Br, emStrongRDelimUnd: Fr, escape: Dr, link: Zr, nolink: xs, punctuation: Lr, reflink: bs, reflinkSearch: Xr, tag: Yr, text: Mr, url: Ce }, Kr = { ...hn, link: C(/^!?\[(label)\]\((.*?)\)/).replace("label", St).getRegex(), reflink: C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", St).getRegex() }, tn = { ...hn, emStrongRDelimAst: Ur, emStrongLDelim: $r, delLDelim: Hr, delRDelim: jr, url: C(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: C(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, Qr = { ...tn, br: C(ds).replace("{2,}", "*").getRegex(), text: C(tn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: cn, gfm: Rr, pedantic: Ir }, rt = { normal: hn, gfm: tn, breaks: Qr, pedantic: Kr }, Jr = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ h((a) => Jr[a], "ke");
1127
+ })(), 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__ */ p((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ p((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, kr = /^(?:[ \t]*(?:\n|$))+/, wr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, yr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ut = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, vr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, hs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ps = C(hs).replace(/bull/g, rn).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(), Tr = C(hs).replace(/bull/g, rn).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(), an = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Sr = /^[^\n]+/, ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ar = C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Er = C(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rn).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", on = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _r = C("^ {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", on).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ds = C(an).replace("hr", ut).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(), Rr = C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ds).getRegex(), cn = { blockquote: Rr, code: wr, def: Ar, fences: yr, heading: vr, hr: ut, html: _r, lheading: ps, list: Er, newline: kr, paragraph: ds, table: Me, text: Sr }, Zn = C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ut).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(), Ir = { ...cn, lheading: Tr, table: Zn, paragraph: C(an).replace("hr", ut).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex() }, Dr = { ...cn, html: C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", on).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: C(an).replace("hr", ut).replace("heading", ` *#{1,6} *[^
1128
+ ]`).replace("lheading", ps).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Cr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Mr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, fs = /^( {2,}|\\)\n(?!\s*$)/, Lr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ve = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, un = /[^\s\p{P}\p{S}]/u, Or = C(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), gs = /(?!~)[\p{P}\p{S}]/u, zr = /(?!~)[\s\p{P}\p{S}]/u, Pr = /(?:[^\s\p{P}\p{S}]|~)/u, Nr = C(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ms = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, $r = C(ms, "u").replace(/punct/g, Ve).getRegex(), Br = C(ms, "u").replace(/punct/g, gs).getRegex(), bs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ur = C(bs, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), Fr = C(bs, "gu").replace(/notPunctSpace/g, Pr).replace(/punctSpace/g, zr).replace(/punct/g, gs).getRegex(), Hr = C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), Gr = C(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ve).getRegex(), jr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Wr = C(jr, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, Ve).getRegex(), qr = C(/\\(punct)/, "gu").replace(/punct/g, Ve).getRegex(), Vr = C(/^<(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(), Yr = C(on).replace("(?:-->|$)", "-->").getRegex(), Zr = C("^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", Yr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), St = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Xr = C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", St).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), xs = C(/^!?\[(label)\]\[(ref)\]/).replace("label", St).replace("ref", ln).getRegex(), ks = C(/^!?\[(ref)\](?:\[\])?/).replace("ref", ln).getRegex(), Kr = C("reflink|nolink(?!\\()", "g").replace("reflink", xs).replace("nolink", ks).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, hn = { _backpedal: Me, anyPunctuation: qr, autolink: Vr, blockSkip: Nr, br: fs, code: Mr, del: Me, delLDelim: Me, delRDelim: Me, emStrongLDelim: $r, emStrongRDelimAst: Ur, emStrongRDelimUnd: Hr, escape: Cr, link: Xr, nolink: ks, punctuation: Or, reflink: xs, reflinkSearch: Kr, tag: Zr, text: Lr, url: Me }, Qr = { ...hn, link: C(/^!?\[(label)\]\((.*?)\)/).replace("label", St).getRegex(), reflink: C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", St).getRegex() }, tn = { ...hn, emStrongRDelimAst: Fr, emStrongLDelim: Br, delLDelim: Gr, delRDelim: Wr, url: C(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: C(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, Jr = { ...tn, br: C(fs).replace("{2,}", "*").getRegex(), text: C(tn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: cn, gfm: Ir, pedantic: Dr }, it = { normal: hn, gfm: tn, breaks: Jr, pedantic: Qr }, ei = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, Kn = /* @__PURE__ */ p((a) => ei[a], "de");
1129
1129
  function ke(a, t) {
1130
1130
  if (t) {
1131
- if (te.escapeTest.test(a)) return a.replace(te.escapeReplace, Kn);
1132
- } else if (te.escapeTestNoEncode.test(a)) return a.replace(te.escapeReplaceNoEncode, Kn);
1131
+ if (J.escapeTest.test(a)) return a.replace(J.escapeReplace, Kn);
1132
+ } else if (J.escapeTestNoEncode.test(a)) return a.replace(J.escapeReplaceNoEncode, Kn);
1133
1133
  return a;
1134
1134
  }
1135
- h(ke, "T");
1135
+ p(ke, "O");
1136
1136
  function Qn(a) {
1137
1137
  try {
1138
- a = encodeURI(a).replace(te.percentDecode, "%");
1138
+ a = encodeURI(a).replace(J.percentDecode, "%");
1139
1139
  } catch {
1140
1140
  return null;
1141
1141
  }
1142
1142
  return a;
1143
1143
  }
1144
- h(Qn, "J");
1144
+ p(Qn, "J");
1145
1145
  function Jn(a, t) {
1146
- let e = a.replace(te.findPipe, (r, l, o) => {
1147
- let c = !1, p = l;
1148
- for (; --p >= 0 && o[p] === "\\"; ) c = !c;
1149
- return c ? "|" : " |";
1150
- }), n = e.split(te.splitPipe), s = 0;
1146
+ let e = a.replace(J.findPipe, (s, o, l) => {
1147
+ let f = !1, c = o;
1148
+ for (; --c >= 0 && l[c] === "\\"; ) f = !f;
1149
+ return f ? "|" : " |";
1150
+ }), n = e.split(J.splitPipe), r = 0;
1151
1151
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1152
1152
  else for (; n.length < t; ) n.push("");
1153
- for (; s < n.length; s++) n[s] = n[s].trim().replace(te.slashPipe, "|");
1153
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(J.slashPipe, "|");
1154
1154
  return n;
1155
1155
  }
1156
- h(Jn, "V");
1157
- function it(a, t, e) {
1156
+ p(Jn, "V");
1157
+ function Te(a, t, e) {
1158
1158
  let n = a.length;
1159
1159
  if (n === 0) return "";
1160
- let s = 0;
1161
- for (; s < n && a.charAt(n - s - 1) === t; )
1162
- s++;
1163
- return a.slice(0, n - s);
1160
+ let r = 0;
1161
+ for (; r < n && a.charAt(n - r - 1) === t; )
1162
+ r++;
1163
+ return a.slice(0, n - r);
1164
1164
  }
1165
- h(it, "I");
1166
- function ei(a, t) {
1165
+ p(Te, "$");
1166
+ function es(a) {
1167
+ let t = a.split(`
1168
+ `), e = t.length - 1;
1169
+ for (; e >= 0 && J.blankLine.test(t[e]); ) e--;
1170
+ return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
1171
+ `);
1172
+ }
1173
+ p(es, "Y");
1174
+ function ti(a, t) {
1167
1175
  if (a.indexOf(t[1]) === -1) return -1;
1168
1176
  let e = 0;
1169
1177
  for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
@@ -1171,43 +1179,43 @@ function ei(a, t) {
1171
1179
  else if (a[n] === t[1] && (e--, e < 0)) return n;
1172
1180
  return e > 0 ? -2 : -1;
1173
1181
  }
1174
- h(ei, "de");
1175
- function ti(a, t = 0) {
1182
+ p(ti, "ge");
1183
+ function ni(a, t = 0) {
1176
1184
  let e = t, n = "";
1177
- for (let s of a) if (s === " ") {
1178
- let r = 4 - e % 4;
1179
- n += " ".repeat(r), e += r;
1180
- } else n += s, e++;
1185
+ for (let r of a) if (r === " ") {
1186
+ let s = 4 - e % 4;
1187
+ n += " ".repeat(s), e += s;
1188
+ } else n += r, e++;
1181
1189
  return n;
1182
1190
  }
1183
- h(ti, "ge");
1184
- function es(a, t, e, n, s) {
1185
- let r = t.href, l = t.title || null, o = a[1].replace(s.other.outputLinkReplace, "$1");
1191
+ p(ni, "fe");
1192
+ function ts(a, t, e, n, r) {
1193
+ let s = t.href, o = t.title || null, l = a[1].replace(r.other.outputLinkReplace, "$1");
1186
1194
  n.state.inLink = !0;
1187
- let c = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: r, title: l, text: o, tokens: n.inlineTokens(o) };
1188
- return n.state.inLink = !1, c;
1195
+ let f = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: o, text: l, tokens: n.inlineTokens(l) };
1196
+ return n.state.inLink = !1, f;
1189
1197
  }
1190
- h(es, "fe");
1191
- function ni(a, t, e) {
1198
+ p(ts, "me");
1199
+ function si(a, t, e) {
1192
1200
  let n = a.match(e.other.indentCodeCompensation);
1193
1201
  if (n === null) return t;
1194
- let s = n[1];
1202
+ let r = n[1];
1195
1203
  return t.split(`
1196
- `).map((r) => {
1197
- let l = r.match(e.other.beginningSpace);
1198
- if (l === null) return r;
1199
- let [o] = l;
1200
- return o.length >= s.length ? r.slice(s.length) : r;
1204
+ `).map((s) => {
1205
+ let o = s.match(e.other.beginningSpace);
1206
+ if (o === null) return s;
1207
+ let [l] = o;
1208
+ return l.length >= r.length ? s.slice(r.length) : s;
1201
1209
  }).join(`
1202
1210
  `);
1203
1211
  }
1204
- h(ni, "nt");
1205
- var He, At = (He = class {
1212
+ p(si, "rt");
1213
+ var Ge, At = (Ge = class {
1206
1214
  constructor(t) {
1207
1215
  D(this, "options");
1208
1216
  D(this, "rules");
1209
1217
  D(this, "lexer");
1210
- this.options = t || Oe;
1218
+ this.options = t || ze;
1211
1219
  }
1212
1220
  space(t) {
1213
1221
  let e = this.rules.block.newline.exec(t);
@@ -1216,16 +1224,15 @@ var He, At = (He = class {
1216
1224
  code(t) {
1217
1225
  let e = this.rules.block.code.exec(t);
1218
1226
  if (e) {
1219
- let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
1220
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : it(n, `
1221
- `) };
1227
+ let n = this.options.pedantic ? e[0] : es(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
1228
+ return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
1222
1229
  }
1223
1230
  }
1224
1231
  fences(t) {
1225
1232
  let e = this.rules.block.fences.exec(t);
1226
1233
  if (e) {
1227
- let n = e[0], s = ni(n, e[3] || "", this.rules);
1228
- return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
1234
+ let n = e[0], r = si(n, e[3] || "", this.rules);
1235
+ return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
1229
1236
  }
1230
1237
  }
1231
1238
  heading(t) {
@@ -1233,149 +1240,156 @@ var He, At = (He = class {
1233
1240
  if (e) {
1234
1241
  let n = e[2].trim();
1235
1242
  if (this.rules.other.endingHash.test(n)) {
1236
- let s = it(n, "#");
1237
- (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
1243
+ let r = Te(n, "#");
1244
+ (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
1238
1245
  }
1239
- return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1246
+ return { type: "heading", raw: Te(e[0], `
1247
+ `), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
1240
1248
  }
1241
1249
  }
1242
1250
  hr(t) {
1243
1251
  let e = this.rules.block.hr.exec(t);
1244
- if (e) return { type: "hr", raw: it(e[0], `
1252
+ if (e) return { type: "hr", raw: Te(e[0], `
1245
1253
  `) };
1246
1254
  }
1247
1255
  blockquote(t) {
1248
1256
  let e = this.rules.block.blockquote.exec(t);
1249
1257
  if (e) {
1250
- let n = it(e[0], `
1258
+ let n = Te(e[0], `
1251
1259
  `).split(`
1252
- `), s = "", r = "", l = [];
1260
+ `), r = "", s = "", o = [];
1253
1261
  for (; n.length > 0; ) {
1254
- let o = !1, c = [], p;
1255
- for (p = 0; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) c.push(n[p]), o = !0;
1256
- else if (!o) c.push(n[p]);
1262
+ let l = !1, f = [], c;
1263
+ for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) f.push(n[c]), l = !0;
1264
+ else if (!l) f.push(n[c]);
1257
1265
  else break;
1258
- n = n.slice(p);
1259
- let g = c.join(`
1260
- `), d = g.replace(this.rules.other.blockquoteSetextReplace, `
1266
+ n = n.slice(c);
1267
+ let x = f.join(`
1268
+ `), h = x.replace(this.rules.other.blockquoteSetextReplace, `
1261
1269
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
1262
- s = s ? `${s}
1263
- ${g}` : g, r = r ? `${r}
1264
- ${d}` : d;
1265
- let f = this.lexer.state.top;
1266
- if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = f, n.length === 0) break;
1267
- let m = l.at(-1);
1268
- if (m?.type === "code") break;
1269
- if (m?.type === "blockquote") {
1270
- let w = m, E = w.raw + `
1270
+ r = r ? `${r}
1271
+ ${x}` : x, s = s ? `${s}
1272
+ ${h}` : h;
1273
+ let d = this.lexer.state.top;
1274
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(h, o, !0), this.lexer.state.top = d, n.length === 0) break;
1275
+ let g = o.at(-1);
1276
+ if (g?.type === "code") break;
1277
+ if (g?.type === "blockquote") {
1278
+ let w = g, E = w.raw + `
1271
1279
  ` + n.join(`
1272
1280
  `), O = this.blockquote(E);
1273
- l[l.length - 1] = O, s = s.substring(0, s.length - w.raw.length) + O.raw, r = r.substring(0, r.length - w.text.length) + O.text;
1281
+ o[o.length - 1] = O, r = r.substring(0, r.length - w.raw.length) + O.raw, s = s.substring(0, s.length - w.text.length) + O.text;
1274
1282
  break;
1275
- } else if (m?.type === "list") {
1276
- let w = m, E = w.raw + `
1283
+ } else if (g?.type === "list") {
1284
+ let w = g, E = w.raw + `
1277
1285
  ` + n.join(`
1278
1286
  `), O = this.list(E);
1279
- l[l.length - 1] = O, s = s.substring(0, s.length - m.raw.length) + O.raw, r = r.substring(0, r.length - w.raw.length) + O.raw, n = E.substring(l.at(-1).raw.length).split(`
1287
+ o[o.length - 1] = O, r = r.substring(0, r.length - g.raw.length) + O.raw, s = s.substring(0, s.length - w.raw.length) + O.raw, n = E.substring(o.at(-1).raw.length).split(`
1280
1288
  `);
1281
1289
  continue;
1282
1290
  }
1283
1291
  }
1284
- return { type: "blockquote", raw: s, tokens: l, text: r };
1292
+ return { type: "blockquote", raw: r, tokens: o, text: s };
1285
1293
  }
1286
1294
  }
1287
1295
  list(t) {
1288
1296
  let e = this.rules.block.list.exec(t);
1289
1297
  if (e) {
1290
- let n = e[1].trim(), s = n.length > 1, r = { type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: [] };
1291
- n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
1292
- let l = this.rules.other.listItemRegex(n), o = !1;
1298
+ let n = e[1].trim(), r = n.length > 1, s = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
1299
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1300
+ let o = this.rules.other.listItemRegex(n), l = !1;
1293
1301
  for (; t; ) {
1294
- let p = !1, g = "", d = "";
1295
- if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
1296
- g = e[0], t = t.substring(g.length);
1297
- let f = ti(e[2].split(`
1298
- `, 1)[0], e[1].length), m = t.split(`
1299
- `, 1)[0], w = !f.trim(), E = 0;
1300
- if (this.options.pedantic ? (E = 2, d = f.trimStart()) : w ? E = e[1].length + 1 : (E = f.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, d = f.slice(E), E += e[1].length), w && this.rules.other.blankLine.test(m) && (g += m + `
1301
- `, t = t.substring(m.length + 1), p = !0), !p) {
1302
+ let c = !1, x = "", h = "";
1303
+ if (!(e = o.exec(t)) || this.rules.block.hr.test(t)) break;
1304
+ x = e[0], t = t.substring(x.length);
1305
+ let d = ni(e[2].split(`
1306
+ `, 1)[0], e[1].length), g = t.split(`
1307
+ `, 1)[0], w = !d.trim(), E = 0;
1308
+ if (this.options.pedantic ? (E = 2, h = d.trimStart()) : w ? E = e[1].length + 1 : (E = d.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, h = d.slice(E), E += e[1].length), w && this.rules.other.blankLine.test(g) && (x += g + `
1309
+ `, t = t.substring(g.length + 1), c = !0), !c) {
1302
1310
  let O = this.rules.other.nextBulletRegex(E), U = this.rules.other.hrRegex(E), ae = this.rules.other.fencesBeginRegex(E), le = this.rules.other.headingBeginRegex(E), z = this.rules.other.htmlBeginRegex(E), oe = this.rules.other.blockquoteBeginRegex(E);
1303
1311
  for (; t; ) {
1304
1312
  let me = t.split(`
1305
1313
  `, 1)[0], V;
1306
- if (m = me, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), V = m) : V = m.replace(this.rules.other.tabCharGlobal, " "), ae.test(m) || le.test(m) || z.test(m) || oe.test(m) || O.test(m) || U.test(m)) break;
1307
- if (V.search(this.rules.other.nonSpaceChar) >= E || !m.trim()) d += `
1314
+ if (g = me, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), V = g) : V = g.replace(this.rules.other.tabCharGlobal, " "), ae.test(g) || le.test(g) || z.test(g) || oe.test(g) || O.test(g) || U.test(g)) break;
1315
+ if (V.search(this.rules.other.nonSpaceChar) >= E || !g.trim()) h += `
1308
1316
  ` + V.slice(E);
1309
1317
  else {
1310
- if (w || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ae.test(f) || le.test(f) || U.test(f)) break;
1311
- d += `
1312
- ` + m;
1318
+ if (w || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ae.test(d) || le.test(d) || U.test(d)) break;
1319
+ h += `
1320
+ ` + g;
1313
1321
  }
1314
- w = !m.trim(), g += me + `
1315
- `, t = t.substring(me.length + 1), f = V.slice(E);
1322
+ w = !g.trim(), x += me + `
1323
+ `, t = t.substring(me.length + 1), d = V.slice(E);
1316
1324
  }
1317
1325
  }
1318
- r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (o = !0)), r.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), r.raw += g;
1326
+ s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(x) && (l = !0)), s.items.push({ type: "list_item", raw: x, task: !!this.options.gfm && this.rules.other.listIsTask.test(h), loose: !1, text: h, tokens: [] }), s.raw += x;
1319
1327
  }
1320
- let c = r.items.at(-1);
1321
- if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
1328
+ let f = s.items.at(-1);
1329
+ if (f) f.raw = f.raw.trimEnd(), f.text = f.text.trimEnd();
1322
1330
  else return;
1323
- r.raw = r.raw.trimEnd();
1324
- for (let p of r.items) {
1325
- if (this.lexer.state.top = !1, p.tokens = this.lexer.blockTokens(p.text, []), p.task) {
1326
- if (p.text = p.text.replace(this.rules.other.listReplaceTask, ""), p.tokens[0]?.type === "text" || p.tokens[0]?.type === "paragraph") {
1327
- p.tokens[0].raw = p.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), p.tokens[0].text = p.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
1328
- for (let d = this.lexer.inlineQueue.length - 1; d >= 0; d--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)) {
1329
- this.lexer.inlineQueue[d].src = this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask, "");
1331
+ s.raw = s.raw.trimEnd();
1332
+ for (let c of s.items) {
1333
+ if (this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []), c.task) {
1334
+ if (c.text = c.text.replace(this.rules.other.listReplaceTask, ""), c.tokens[0]?.type === "text" || c.tokens[0]?.type === "paragraph") {
1335
+ c.tokens[0].raw = c.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), c.tokens[0].text = c.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
1336
+ for (let h = this.lexer.inlineQueue.length - 1; h >= 0; h--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)) {
1337
+ this.lexer.inlineQueue[h].src = this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask, "");
1330
1338
  break;
1331
1339
  }
1332
1340
  }
1333
- let g = this.rules.other.listTaskCheckbox.exec(p.raw);
1334
- if (g) {
1335
- let d = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
1336
- p.checked = d.checked, r.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = d.raw + p.tokens[0].raw, p.tokens[0].text = d.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(d)) : p.tokens.unshift({ type: "paragraph", raw: d.raw, text: d.raw, tokens: [d] }) : p.tokens.unshift(d);
1341
+ let x = this.rules.other.listTaskCheckbox.exec(c.raw);
1342
+ if (x) {
1343
+ let h = { type: "checkbox", raw: x[0] + " ", checked: x[0] !== "[ ]" };
1344
+ c.checked = h.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 = h.raw + c.tokens[0].raw, c.tokens[0].text = h.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(h)) : c.tokens.unshift({ type: "paragraph", raw: h.raw, text: h.raw, tokens: [h] }) : c.tokens.unshift(h);
1337
1345
  }
1338
1346
  }
1339
- if (!r.loose) {
1340
- let g = p.tokens.filter((f) => f.type === "space"), d = g.length > 0 && g.some((f) => this.rules.other.anyLine.test(f.raw));
1341
- r.loose = d;
1347
+ if (!s.loose) {
1348
+ let x = c.tokens.filter((d) => d.type === "space"), h = x.length > 0 && x.some((d) => this.rules.other.anyLine.test(d.raw));
1349
+ s.loose = h;
1342
1350
  }
1343
1351
  }
1344
- if (r.loose) for (let p of r.items) {
1345
- p.loose = !0;
1346
- for (let g of p.tokens) g.type === "text" && (g.type = "paragraph");
1352
+ if (s.loose) for (let c of s.items) {
1353
+ c.loose = !0;
1354
+ for (let x of c.tokens) x.type === "text" && (x.type = "paragraph");
1347
1355
  }
1348
- return r;
1356
+ return s;
1349
1357
  }
1350
1358
  }
1351
1359
  html(t) {
1352
1360
  let e = this.rules.block.html.exec(t);
1353
- if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
1361
+ if (e) {
1362
+ let n = es(e[0]);
1363
+ return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
1364
+ }
1354
1365
  }
1355
1366
  def(t) {
1356
1367
  let e = this.rules.block.def.exec(t);
1357
1368
  if (e) {
1358
- let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
1359
- return { type: "def", tag: n, raw: e[0], href: s, title: r };
1369
+ 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];
1370
+ return { type: "def", tag: n, raw: Te(e[0], `
1371
+ `), href: r, title: s };
1360
1372
  }
1361
1373
  }
1362
1374
  table(t) {
1363
1375
  let e = this.rules.block.table.exec(t);
1364
1376
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
1365
- let n = Jn(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1366
- `) : [], l = { type: "table", raw: e[0], header: [], align: [], rows: [] };
1367
- if (n.length === s.length) {
1368
- for (let o of s) 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);
1369
- 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] });
1370
- for (let o of r) l.rows.push(Jn(o, l.header.length).map((c, p) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: l.align[p] })));
1371
- return l;
1377
+ let n = Jn(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
1378
+ `) : [], o = { type: "table", raw: Te(e[0], `
1379
+ `), header: [], align: [], rows: [] };
1380
+ if (n.length === r.length) {
1381
+ for (let l of r) this.rules.other.tableAlignRight.test(l) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? o.align.push("left") : o.align.push(null);
1382
+ for (let l = 0; l < n.length; l++) o.header.push({ text: n[l], tokens: this.lexer.inline(n[l]), header: !0, align: o.align[l] });
1383
+ for (let l of s) o.rows.push(Jn(l, o.header.length).map((f, c) => ({ text: f, tokens: this.lexer.inline(f), header: !1, align: o.align[c] })));
1384
+ return o;
1372
1385
  }
1373
1386
  }
1374
1387
  lheading(t) {
1375
1388
  let e = this.rules.block.lheading.exec(t);
1376
1389
  if (e) {
1377
1390
  let n = e[1].trim();
1378
- return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1391
+ return { type: "heading", raw: Te(e[0], `
1392
+ `), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
1379
1393
  }
1380
1394
  }
1381
1395
  paragraph(t) {
@@ -1404,65 +1418,65 @@ ${d}` : d;
1404
1418
  let n = e[2].trim();
1405
1419
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
1406
1420
  if (!this.rules.other.endAngleBracket.test(n)) return;
1407
- let l = it(n.slice(0, -1), "\\");
1408
- if ((n.length - l.length) % 2 === 0) return;
1421
+ let o = Te(n.slice(0, -1), "\\");
1422
+ if ((n.length - o.length) % 2 === 0) return;
1409
1423
  } else {
1410
- let l = ei(e[2], "()");
1411
- if (l === -2) return;
1412
- if (l > -1) {
1413
- let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
1414
- e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
1424
+ let o = ti(e[2], "()");
1425
+ if (o === -2) return;
1426
+ if (o > -1) {
1427
+ let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + o;
1428
+ e[2] = e[2].substring(0, o), e[0] = e[0].substring(0, l).trim(), e[3] = "";
1415
1429
  }
1416
1430
  }
1417
- let s = e[2], r = "";
1431
+ let r = e[2], s = "";
1418
1432
  if (this.options.pedantic) {
1419
- let l = this.rules.other.pedanticHrefTitle.exec(s);
1420
- l && (s = l[1], r = l[3]);
1421
- } else r = e[3] ? e[3].slice(1, -1) : "";
1422
- return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), es(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: r && r.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
1433
+ let o = this.rules.other.pedanticHrefTitle.exec(r);
1434
+ o && (r = o[1], s = o[3]);
1435
+ } else s = e[3] ? e[3].slice(1, -1) : "";
1436
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ts(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
1423
1437
  }
1424
1438
  }
1425
1439
  reflink(t, e) {
1426
1440
  let n;
1427
1441
  if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
1428
- let s = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r = e[s.toLowerCase()];
1429
- if (!r) {
1430
- let l = n[0].charAt(0);
1431
- return { type: "text", raw: l, text: l };
1442
+ let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[r.toLowerCase()];
1443
+ if (!s) {
1444
+ let o = n[0].charAt(0);
1445
+ return { type: "text", raw: o, text: o };
1432
1446
  }
1433
- return es(n, r, n[0], this.lexer, this.rules);
1447
+ return ts(n, s, n[0], this.lexer, this.rules);
1434
1448
  }
1435
1449
  }
1436
1450
  emStrong(t, e, n = "") {
1437
- let s = this.rules.inline.emStrongLDelim.exec(t);
1438
- if (!(!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1439
- let r = [...s[0]].length - 1, l, o, c = r, p = 0, g = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1440
- for (g.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = g.exec(e)) !== null; ) {
1441
- if (l = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !l) continue;
1442
- if (o = [...l].length, s[3] || s[4]) {
1443
- c += o;
1451
+ let r = this.rules.inline.emStrongLDelim.exec(t);
1452
+ 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))) {
1453
+ let s = [...r[0]].length - 1, o, l, f = s, c = 0, x = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1454
+ for (x.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = x.exec(e)) !== null; ) {
1455
+ if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
1456
+ if (l = [...o].length, r[3] || r[4]) {
1457
+ f += l;
1444
1458
  continue;
1445
- } else if ((s[5] || s[6]) && r % 3 && !((r + o) % 3)) {
1446
- p += o;
1459
+ } else if ((r[5] || r[6]) && s % 3 && !((s + l) % 3)) {
1460
+ c += l;
1447
1461
  continue;
1448
1462
  }
1449
- if (c -= o, c > 0) continue;
1450
- o = Math.min(o, o + c + p);
1451
- let d = [...s[0]][0].length, f = t.slice(0, r + s.index + d + o);
1452
- if (Math.min(r, o) % 2) {
1453
- let w = f.slice(1, -1);
1454
- return { type: "em", raw: f, text: w, tokens: this.lexer.inlineTokens(w) };
1463
+ if (f -= l, f > 0) continue;
1464
+ l = Math.min(l, l + f + c);
1465
+ let h = [...r[0]][0].length, d = t.slice(0, s + r.index + h + l);
1466
+ if (Math.min(s, l) % 2) {
1467
+ let w = d.slice(1, -1);
1468
+ return { type: "em", raw: d, text: w, tokens: this.lexer.inlineTokens(w) };
1455
1469
  }
1456
- let m = f.slice(2, -2);
1457
- return { type: "strong", raw: f, text: m, tokens: this.lexer.inlineTokens(m) };
1470
+ let g = d.slice(2, -2);
1471
+ return { type: "strong", raw: d, text: g, tokens: this.lexer.inlineTokens(g) };
1458
1472
  }
1459
1473
  }
1460
1474
  }
1461
1475
  codespan(t) {
1462
1476
  let e = this.rules.inline.code.exec(t);
1463
1477
  if (e) {
1464
- let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
1465
- return s && r && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1478
+ let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
1479
+ return r && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
1466
1480
  }
1467
1481
  }
1468
1482
  br(t) {
@@ -1470,42 +1484,42 @@ ${d}` : d;
1470
1484
  if (e) return { type: "br", raw: e[0] };
1471
1485
  }
1472
1486
  del(t, e, n = "") {
1473
- let s = this.rules.inline.delLDelim.exec(t);
1474
- if (s && (!s[1] || !n || this.rules.inline.punctuation.exec(n))) {
1475
- let r = [...s[0]].length - 1, l, o, c = r, p = this.rules.inline.delRDelim;
1476
- for (p.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = p.exec(e)) !== null; ) {
1477
- if (l = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !l || (o = [...l].length, o !== r)) continue;
1478
- if (s[3] || s[4]) {
1479
- c += o;
1487
+ let r = this.rules.inline.delLDelim.exec(t);
1488
+ if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1489
+ let s = [...r[0]].length - 1, o, l, f = s, c = this.rules.inline.delRDelim;
1490
+ for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) !== null; ) {
1491
+ if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o || (l = [...o].length, l !== s)) continue;
1492
+ if (r[3] || r[4]) {
1493
+ f += l;
1480
1494
  continue;
1481
1495
  }
1482
- if (c -= o, c > 0) continue;
1483
- o = Math.min(o, o + c);
1484
- let g = [...s[0]][0].length, d = t.slice(0, r + s.index + g + o), f = d.slice(r, -r);
1485
- return { type: "del", raw: d, text: f, tokens: this.lexer.inlineTokens(f) };
1496
+ if (f -= l, f > 0) continue;
1497
+ l = Math.min(l, l + f);
1498
+ let x = [...r[0]][0].length, h = t.slice(0, s + r.index + x + l), d = h.slice(s, -s);
1499
+ return { type: "del", raw: h, text: d, tokens: this.lexer.inlineTokens(d) };
1486
1500
  }
1487
1501
  }
1488
1502
  }
1489
1503
  autolink(t) {
1490
1504
  let e = this.rules.inline.autolink.exec(t);
1491
1505
  if (e) {
1492
- let n, s;
1493
- return e[2] === "@" ? (n = e[1], s = "mailto:" + n) : (n = e[1], s = n), { type: "link", raw: e[0], text: n, href: s, tokens: [{ type: "text", raw: n, text: n }] };
1506
+ let n, r;
1507
+ return e[2] === "@" ? (n = e[1], r = "mailto:" + n) : (n = e[1], r = n), { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
1494
1508
  }
1495
1509
  }
1496
1510
  url(t) {
1497
1511
  let e;
1498
1512
  if (e = this.rules.inline.url.exec(t)) {
1499
- let n, s;
1500
- if (e[2] === "@") n = e[0], s = "mailto:" + n;
1513
+ let n, r;
1514
+ if (e[2] === "@") n = e[0], r = "mailto:" + n;
1501
1515
  else {
1502
- let r;
1516
+ let s;
1503
1517
  do
1504
- r = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
1505
- while (r !== e[0]);
1506
- n = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
1518
+ s = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
1519
+ while (s !== e[0]);
1520
+ n = e[0], e[1] === "www." ? r = "http://" + e[0] : r = e[0];
1507
1521
  }
1508
- return { type: "link", raw: e[0], text: n, href: s, tokens: [{ type: "text", raw: n, text: n }] };
1522
+ return { type: "link", raw: e[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
1509
1523
  }
1510
1524
  }
1511
1525
  inlineText(t) {
@@ -1515,28 +1529,28 @@ ${d}` : d;
1515
1529
  return { type: "text", raw: e[0], text: e[0], escaped: n };
1516
1530
  }
1517
1531
  }
1518
- }, h(He, "w"), He), Ae, fe = (Ae = class {
1532
+ }, p(Ge, "w"), Ge), Ee, fe = (Ee = class {
1519
1533
  constructor(t) {
1520
1534
  D(this, "tokens");
1521
1535
  D(this, "options");
1522
1536
  D(this, "state");
1523
1537
  D(this, "inlineQueue");
1524
1538
  D(this, "tokenizer");
1525
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Oe, this.options.tokenizer = this.options.tokenizer || new At(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1526
- let e = { other: te, block: vt.normal, inline: rt.normal };
1527
- this.options.pedantic ? (e.block = vt.pedantic, e.inline = rt.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = rt.breaks : e.inline = rt.gfm), this.tokenizer.rules = e;
1539
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || ze, this.options.tokenizer = this.options.tokenizer || new At(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1540
+ let e = { other: J, block: vt.normal, inline: it.normal };
1541
+ this.options.pedantic ? (e.block = vt.pedantic, e.inline = it.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = it.breaks : e.inline = it.gfm), this.tokenizer.rules = e;
1528
1542
  }
1529
1543
  static get rules() {
1530
- return { block: vt, inline: rt };
1544
+ return { block: vt, inline: it };
1531
1545
  }
1532
1546
  static lex(t, e) {
1533
- return new Ae(e).lex(t);
1547
+ return new Ee(e).lex(t);
1534
1548
  }
1535
1549
  static lexInline(t, e) {
1536
- return new Ae(e).inlineTokens(t);
1550
+ return new Ee(e).inlineTokens(t);
1537
1551
  }
1538
1552
  lex(t) {
1539
- t = t.replace(te.carriageReturn, `
1553
+ t = t.replace(J.carriageReturn, `
1540
1554
  `), this.blockTokens(t, this.tokens);
1541
1555
  for (let e = 0; e < this.inlineQueue.length; e++) {
1542
1556
  let n = this.inlineQueue[e];
@@ -1545,7 +1559,14 @@ ${d}` : d;
1545
1559
  return this.inlineQueue = [], this.tokens;
1546
1560
  }
1547
1561
  blockTokens(t, e = [], n = !1) {
1548
- for (this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(te.tabCharGlobal, " ").replace(te.spaceLine, "")); t; ) {
1562
+ this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(J.tabCharGlobal, " ").replace(J.spaceLine, ""));
1563
+ let r = 1 / 0;
1564
+ for (; t; ) {
1565
+ if (t.length < r) r = t.length;
1566
+ else {
1567
+ this.infiniteLoopError(t.charCodeAt(0));
1568
+ break;
1569
+ }
1549
1570
  let s;
1550
1571
  if (this.options.extensions?.block?.some((l) => (s = l.call({ lexer: this }, t, e)) ? (t = t.substring(s.raw.length), e.push(s), !0) : !1)) continue;
1551
1572
  if (s = this.tokenizer.space(t)) {
@@ -1605,19 +1626,19 @@ ${d}` : d;
1605
1626
  t = t.substring(s.raw.length), e.push(s);
1606
1627
  continue;
1607
1628
  }
1608
- let r = t;
1629
+ let o = t;
1609
1630
  if (this.options.extensions?.startBlock) {
1610
- let l = 1 / 0, o = t.slice(1), c;
1611
- this.options.extensions.startBlock.forEach((p) => {
1612
- c = p.call({ lexer: this }, o), typeof c == "number" && c >= 0 && (l = Math.min(l, c));
1613
- }), l < 1 / 0 && l >= 0 && (r = t.substring(0, l + 1));
1631
+ let l = 1 / 0, f = t.slice(1), c;
1632
+ this.options.extensions.startBlock.forEach((x) => {
1633
+ c = x.call({ lexer: this }, f), typeof c == "number" && c >= 0 && (l = Math.min(l, c));
1634
+ }), l < 1 / 0 && l >= 0 && (o = t.substring(0, l + 1));
1614
1635
  }
1615
- if (this.state.top && (s = this.tokenizer.paragraph(r))) {
1636
+ if (this.state.top && (s = this.tokenizer.paragraph(o))) {
1616
1637
  let l = e.at(-1);
1617
1638
  n && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
1618
1639
  `) ? "" : `
1619
1640
  `) + s.raw, l.text += `
1620
- ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : e.push(s), n = r.length !== t.length, t = t.substring(s.raw.length);
1641
+ ` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : e.push(s), n = o.length !== t.length, t = t.substring(s.raw.length);
1621
1642
  continue;
1622
1643
  }
1623
1644
  if (s = this.tokenizer.text(t)) {
@@ -1630,11 +1651,8 @@ ${d}` : d;
1630
1651
  continue;
1631
1652
  }
1632
1653
  if (t) {
1633
- let l = "Infinite loop on byte: " + t.charCodeAt(0);
1634
- if (this.options.silent) {
1635
- console.error(l);
1636
- break;
1637
- } else throw new Error(l);
1654
+ this.infiniteLoopError(t.charCodeAt(0));
1655
+ break;
1638
1656
  }
1639
1657
  }
1640
1658
  return this.state.top = !0, e;
@@ -1644,20 +1662,25 @@ ${d}` : d;
1644
1662
  }
1645
1663
  inlineTokens(t, e = []) {
1646
1664
  this.tokenizer.lexer = this;
1647
- let n = t, s = null;
1665
+ let n = t, r = null;
1648
1666
  if (this.tokens.links) {
1649
1667
  let c = Object.keys(this.tokens.links);
1650
- if (c.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1668
+ if (c.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1651
1669
  }
1652
- for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, s.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1653
- let r;
1654
- for (; (s = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) r = s[2] ? s[2].length : 0, n = n.slice(0, s.index + r) + "[" + "a".repeat(s[0].length - r - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1670
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1671
+ let s;
1672
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = r[2] ? r[2].length : 0, n = n.slice(0, r.index + s) + "[" + "a".repeat(r[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1655
1673
  n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1656
- let l = !1, o = "";
1674
+ let o = !1, l = "", f = 1 / 0;
1657
1675
  for (; t; ) {
1658
- l || (o = ""), l = !1;
1676
+ if (t.length < f) f = t.length;
1677
+ else {
1678
+ this.infiniteLoopError(t.charCodeAt(0));
1679
+ break;
1680
+ }
1681
+ o || (l = ""), o = !1;
1659
1682
  let c;
1660
- if (this.options.extensions?.inline?.some((g) => (c = g.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1683
+ if (this.options.extensions?.inline?.some((h) => (c = h.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
1661
1684
  if (c = this.tokenizer.escape(t)) {
1662
1685
  t = t.substring(c.raw.length), e.push(c);
1663
1686
  continue;
@@ -1672,11 +1695,11 @@ ${d}` : d;
1672
1695
  }
1673
1696
  if (c = this.tokenizer.reflink(t, this.tokens.links)) {
1674
1697
  t = t.substring(c.raw.length);
1675
- let g = e.at(-1);
1676
- c.type === "text" && g?.type === "text" ? (g.raw += c.raw, g.text += c.text) : e.push(c);
1698
+ let h = e.at(-1);
1699
+ c.type === "text" && h?.type === "text" ? (h.raw += c.raw, h.text += c.text) : e.push(c);
1677
1700
  continue;
1678
1701
  }
1679
- if (c = this.tokenizer.emStrong(t, n, o)) {
1702
+ if (c = this.tokenizer.emStrong(t, n, l)) {
1680
1703
  t = t.substring(c.raw.length), e.push(c);
1681
1704
  continue;
1682
1705
  }
@@ -1688,7 +1711,7 @@ ${d}` : d;
1688
1711
  t = t.substring(c.raw.length), e.push(c);
1689
1712
  continue;
1690
1713
  }
1691
- if (c = this.tokenizer.del(t, n, o)) {
1714
+ if (c = this.tokenizer.del(t, n, l)) {
1692
1715
  t = t.substring(c.raw.length), e.push(c);
1693
1716
  continue;
1694
1717
  }
@@ -1700,43 +1723,45 @@ ${d}` : d;
1700
1723
  t = t.substring(c.raw.length), e.push(c);
1701
1724
  continue;
1702
1725
  }
1703
- let p = t;
1726
+ let x = t;
1704
1727
  if (this.options.extensions?.startInline) {
1705
- let g = 1 / 0, d = t.slice(1), f;
1706
- this.options.extensions.startInline.forEach((m) => {
1707
- f = m.call({ lexer: this }, d), typeof f == "number" && f >= 0 && (g = Math.min(g, f));
1708
- }), g < 1 / 0 && g >= 0 && (p = t.substring(0, g + 1));
1709
- }
1710
- if (c = this.tokenizer.inlineText(p)) {
1711
- t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
1712
- let g = e.at(-1);
1713
- g?.type === "text" ? (g.raw += c.raw, g.text += c.text) : e.push(c);
1728
+ let h = 1 / 0, d = t.slice(1), g;
1729
+ this.options.extensions.startInline.forEach((w) => {
1730
+ g = w.call({ lexer: this }, d), typeof g == "number" && g >= 0 && (h = Math.min(h, g));
1731
+ }), h < 1 / 0 && h >= 0 && (x = t.substring(0, h + 1));
1732
+ }
1733
+ if (c = this.tokenizer.inlineText(x)) {
1734
+ t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (l = c.raw.slice(-1)), o = !0;
1735
+ let h = e.at(-1);
1736
+ h?.type === "text" ? (h.raw += c.raw, h.text += c.text) : e.push(c);
1714
1737
  continue;
1715
1738
  }
1716
1739
  if (t) {
1717
- let g = "Infinite loop on byte: " + t.charCodeAt(0);
1718
- if (this.options.silent) {
1719
- console.error(g);
1720
- break;
1721
- } else throw new Error(g);
1740
+ this.infiniteLoopError(t.charCodeAt(0));
1741
+ break;
1722
1742
  }
1723
1743
  }
1724
1744
  return e;
1725
1745
  }
1726
- }, h(Ae, "u"), Ae), Ge, Et = (Ge = class {
1746
+ infiniteLoopError(t) {
1747
+ let e = "Infinite loop on byte: " + t;
1748
+ if (this.options.silent) console.error(e);
1749
+ else throw new Error(e);
1750
+ }
1751
+ }, p(Ee, "l"), Ee), je, Et = (je = class {
1727
1752
  constructor(t) {
1728
1753
  D(this, "options");
1729
1754
  D(this, "parser");
1730
- this.options = t || Oe;
1755
+ this.options = t || ze;
1731
1756
  }
1732
1757
  space(t) {
1733
1758
  return "";
1734
1759
  }
1735
1760
  code({ text: t, lang: e, escaped: n }) {
1736
- let s = (e || "").match(te.notSpaceStart)?.[0], r = t.replace(te.endingNewline, "") + `
1761
+ let r = (e || "").match(J.notSpaceStart)?.[0], s = t.replace(J.endingNewline, "") + `
1737
1762
  `;
1738
- return s ? '<pre><code class="language-' + ke(s) + '">' + (n ? r : ke(r, !0)) + `</code></pre>
1739
- ` : "<pre><code>" + (n ? r : ke(r, !0)) + `</code></pre>
1763
+ return r ? '<pre><code class="language-' + ke(r) + '">' + (n ? s : ke(s, !0)) + `</code></pre>
1764
+ ` : "<pre><code>" + (n ? s : ke(s, !0)) + `</code></pre>
1740
1765
  `;
1741
1766
  }
1742
1767
  blockquote({ tokens: t }) {
@@ -1759,14 +1784,14 @@ ${this.parser.parse(t)}</blockquote>
1759
1784
  `;
1760
1785
  }
1761
1786
  list(t) {
1762
- let e = t.ordered, n = t.start, s = "";
1763
- for (let o = 0; o < t.items.length; o++) {
1764
- let c = t.items[o];
1765
- s += this.listitem(c);
1766
- }
1767
- let r = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
1768
- return "<" + r + l + `>
1769
- ` + s + "</" + r + `>
1787
+ let e = t.ordered, n = t.start, r = "";
1788
+ for (let l = 0; l < t.items.length; l++) {
1789
+ let f = t.items[l];
1790
+ r += this.listitem(f);
1791
+ }
1792
+ let s = e ? "ol" : "ul", o = e && n !== 1 ? ' start="' + n + '"' : "";
1793
+ return "<" + s + o + `>
1794
+ ` + r + "</" + s + `>
1770
1795
  `;
1771
1796
  }
1772
1797
  listitem(t) {
@@ -1782,19 +1807,19 @@ ${this.parser.parse(t)}</blockquote>
1782
1807
  }
1783
1808
  table(t) {
1784
1809
  let e = "", n = "";
1785
- for (let r = 0; r < t.header.length; r++) n += this.tablecell(t.header[r]);
1810
+ for (let s = 0; s < t.header.length; s++) n += this.tablecell(t.header[s]);
1786
1811
  e += this.tablerow({ text: n });
1787
- let s = "";
1788
- for (let r = 0; r < t.rows.length; r++) {
1789
- let l = t.rows[r];
1812
+ let r = "";
1813
+ for (let s = 0; s < t.rows.length; s++) {
1814
+ let o = t.rows[s];
1790
1815
  n = "";
1791
- for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
1792
- s += this.tablerow({ text: n });
1816
+ for (let l = 0; l < o.length; l++) n += this.tablecell(o[l]);
1817
+ r += this.tablerow({ text: n });
1793
1818
  }
1794
- return s && (s = `<tbody>${s}</tbody>`), `<table>
1819
+ return r && (r = `<tbody>${r}</tbody>`), `<table>
1795
1820
  <thead>
1796
1821
  ` + e + `</thead>
1797
- ` + s + `</table>
1822
+ ` + r + `</table>
1798
1823
  `;
1799
1824
  }
1800
1825
  tablerow({ text: t }) {
@@ -1823,24 +1848,24 @@ ${t}</tr>
1823
1848
  return `<del>${this.parser.parseInline(t)}</del>`;
1824
1849
  }
1825
1850
  link({ href: t, title: e, tokens: n }) {
1826
- let s = this.parser.parseInline(n), r = Qn(t);
1827
- if (r === null) return s;
1828
- t = r;
1829
- let l = '<a href="' + t + '"';
1830
- return e && (l += ' title="' + ke(e) + '"'), l += ">" + s + "</a>", l;
1831
- }
1832
- image({ href: t, title: e, text: n, tokens: s }) {
1833
- s && (n = this.parser.parseInline(s, this.parser.textRenderer));
1834
- let r = Qn(t);
1835
- if (r === null) return ke(n);
1836
- t = r;
1837
- let l = `<img src="${t}" alt="${ke(n)}"`;
1838
- return e && (l += ` title="${ke(e)}"`), l += ">", l;
1851
+ let r = this.parser.parseInline(n), s = Qn(t);
1852
+ if (s === null) return r;
1853
+ t = s;
1854
+ let o = '<a href="' + t + '"';
1855
+ return e && (o += ' title="' + ke(e) + '"'), o += ">" + r + "</a>", o;
1856
+ }
1857
+ image({ href: t, title: e, text: n, tokens: r }) {
1858
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1859
+ let s = Qn(t);
1860
+ if (s === null) return ke(n);
1861
+ t = s;
1862
+ let o = `<img src="${t}" alt="${ke(n)}"`;
1863
+ return e && (o += ` title="${ke(e)}"`), o += ">", o;
1839
1864
  }
1840
1865
  text(t) {
1841
1866
  return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : ke(t.text);
1842
1867
  }
1843
- }, h(Ge, "y"), Ge), je, pn = (je = class {
1868
+ }, p(je, "y"), je), We, pn = (We = class {
1844
1869
  strong({ text: t }) {
1845
1870
  return t;
1846
1871
  }
@@ -1871,85 +1896,85 @@ ${t}</tr>
1871
1896
  checkbox({ raw: t }) {
1872
1897
  return t;
1873
1898
  }
1874
- }, h(je, "$"), je), Ee, ge = (Ee = class {
1899
+ }, p(We, "L"), We), _e, ge = (_e = class {
1875
1900
  constructor(t) {
1876
1901
  D(this, "options");
1877
1902
  D(this, "renderer");
1878
1903
  D(this, "textRenderer");
1879
- this.options = t || Oe, this.options.renderer = this.options.renderer || new Et(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new pn();
1904
+ this.options = t || ze, this.options.renderer = this.options.renderer || new Et(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new pn();
1880
1905
  }
1881
1906
  static parse(t, e) {
1882
- return new Ee(e).parse(t);
1907
+ return new _e(e).parse(t);
1883
1908
  }
1884
1909
  static parseInline(t, e) {
1885
- return new Ee(e).parseInline(t);
1910
+ return new _e(e).parseInline(t);
1886
1911
  }
1887
1912
  parse(t) {
1888
1913
  this.renderer.parser = this;
1889
1914
  let e = "";
1890
1915
  for (let n = 0; n < t.length; n++) {
1891
- let s = t[n];
1892
- if (this.options.extensions?.renderers?.[s.type]) {
1893
- let l = s, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1894
- if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
1895
- e += o || "";
1916
+ let r = t[n];
1917
+ if (this.options.extensions?.renderers?.[r.type]) {
1918
+ let o = r, l = this.options.extensions.renderers[o.type].call({ parser: this }, o);
1919
+ if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o.type)) {
1920
+ e += l || "";
1896
1921
  continue;
1897
1922
  }
1898
1923
  }
1899
- let r = s;
1900
- switch (r.type) {
1924
+ let s = r;
1925
+ switch (s.type) {
1901
1926
  case "space": {
1902
- e += this.renderer.space(r);
1927
+ e += this.renderer.space(s);
1903
1928
  break;
1904
1929
  }
1905
1930
  case "hr": {
1906
- e += this.renderer.hr(r);
1931
+ e += this.renderer.hr(s);
1907
1932
  break;
1908
1933
  }
1909
1934
  case "heading": {
1910
- e += this.renderer.heading(r);
1935
+ e += this.renderer.heading(s);
1911
1936
  break;
1912
1937
  }
1913
1938
  case "code": {
1914
- e += this.renderer.code(r);
1939
+ e += this.renderer.code(s);
1915
1940
  break;
1916
1941
  }
1917
1942
  case "table": {
1918
- e += this.renderer.table(r);
1943
+ e += this.renderer.table(s);
1919
1944
  break;
1920
1945
  }
1921
1946
  case "blockquote": {
1922
- e += this.renderer.blockquote(r);
1947
+ e += this.renderer.blockquote(s);
1923
1948
  break;
1924
1949
  }
1925
1950
  case "list": {
1926
- e += this.renderer.list(r);
1951
+ e += this.renderer.list(s);
1927
1952
  break;
1928
1953
  }
1929
1954
  case "checkbox": {
1930
- e += this.renderer.checkbox(r);
1955
+ e += this.renderer.checkbox(s);
1931
1956
  break;
1932
1957
  }
1933
1958
  case "html": {
1934
- e += this.renderer.html(r);
1959
+ e += this.renderer.html(s);
1935
1960
  break;
1936
1961
  }
1937
1962
  case "def": {
1938
- e += this.renderer.def(r);
1963
+ e += this.renderer.def(s);
1939
1964
  break;
1940
1965
  }
1941
1966
  case "paragraph": {
1942
- e += this.renderer.paragraph(r);
1967
+ e += this.renderer.paragraph(s);
1943
1968
  break;
1944
1969
  }
1945
1970
  case "text": {
1946
- e += this.renderer.text(r);
1971
+ e += this.renderer.text(s);
1947
1972
  break;
1948
1973
  }
1949
1974
  default: {
1950
- let l = 'Token with "' + r.type + '" type was not found.';
1951
- if (this.options.silent) return console.error(l), "";
1952
- throw new Error(l);
1975
+ let o = 'Token with "' + s.type + '" type was not found.';
1976
+ if (this.options.silent) return console.error(o), "";
1977
+ throw new Error(o);
1953
1978
  }
1954
1979
  }
1955
1980
  }
@@ -1958,75 +1983,75 @@ ${t}</tr>
1958
1983
  parseInline(t, e = this.renderer) {
1959
1984
  this.renderer.parser = this;
1960
1985
  let n = "";
1961
- for (let s = 0; s < t.length; s++) {
1962
- let r = t[s];
1963
- if (this.options.extensions?.renderers?.[r.type]) {
1964
- let o = this.options.extensions.renderers[r.type].call({ parser: this }, r);
1965
- if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
1966
- n += o || "";
1986
+ for (let r = 0; r < t.length; r++) {
1987
+ let s = t[r];
1988
+ if (this.options.extensions?.renderers?.[s.type]) {
1989
+ let l = this.options.extensions.renderers[s.type].call({ parser: this }, s);
1990
+ if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
1991
+ n += l || "";
1967
1992
  continue;
1968
1993
  }
1969
1994
  }
1970
- let l = r;
1971
- switch (l.type) {
1995
+ let o = s;
1996
+ switch (o.type) {
1972
1997
  case "escape": {
1973
- n += e.text(l);
1998
+ n += e.text(o);
1974
1999
  break;
1975
2000
  }
1976
2001
  case "html": {
1977
- n += e.html(l);
2002
+ n += e.html(o);
1978
2003
  break;
1979
2004
  }
1980
2005
  case "link": {
1981
- n += e.link(l);
2006
+ n += e.link(o);
1982
2007
  break;
1983
2008
  }
1984
2009
  case "image": {
1985
- n += e.image(l);
2010
+ n += e.image(o);
1986
2011
  break;
1987
2012
  }
1988
2013
  case "checkbox": {
1989
- n += e.checkbox(l);
2014
+ n += e.checkbox(o);
1990
2015
  break;
1991
2016
  }
1992
2017
  case "strong": {
1993
- n += e.strong(l);
2018
+ n += e.strong(o);
1994
2019
  break;
1995
2020
  }
1996
2021
  case "em": {
1997
- n += e.em(l);
2022
+ n += e.em(o);
1998
2023
  break;
1999
2024
  }
2000
2025
  case "codespan": {
2001
- n += e.codespan(l);
2026
+ n += e.codespan(o);
2002
2027
  break;
2003
2028
  }
2004
2029
  case "br": {
2005
- n += e.br(l);
2030
+ n += e.br(o);
2006
2031
  break;
2007
2032
  }
2008
2033
  case "del": {
2009
- n += e.del(l);
2034
+ n += e.del(o);
2010
2035
  break;
2011
2036
  }
2012
2037
  case "text": {
2013
- n += e.text(l);
2038
+ n += e.text(o);
2014
2039
  break;
2015
2040
  }
2016
2041
  default: {
2017
- let o = 'Token with "' + l.type + '" type was not found.';
2018
- if (this.options.silent) return console.error(o), "";
2019
- throw new Error(o);
2042
+ let l = 'Token with "' + o.type + '" type was not found.';
2043
+ if (this.options.silent) return console.error(l), "";
2044
+ throw new Error(l);
2020
2045
  }
2021
2046
  }
2022
2047
  }
2023
2048
  return n;
2024
2049
  }
2025
- }, h(Ee, "u"), Ee), Se, ot = (Se = class {
2050
+ }, p(_e, "l"), _e), Ae, ot = (Ae = class {
2026
2051
  constructor(t) {
2027
2052
  D(this, "options");
2028
2053
  D(this, "block");
2029
- this.options = t || Oe;
2054
+ this.options = t || ze;
2030
2055
  }
2031
2056
  preprocess(t) {
2032
2057
  return t;
@@ -2046,7 +2071,7 @@ ${t}</tr>
2046
2071
  provideParser(t = this.block) {
2047
2072
  return t ? ge.parse : ge.parseInline;
2048
2073
  }
2049
- }, h(Se, "P"), D(Se, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(Se, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Se), We, si = (We = class {
2074
+ }, p(Ae, "P"), D(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), qe, ri = (qe = class {
2050
2075
  constructor(...t) {
2051
2076
  D(this, "defaults", sn());
2052
2077
  D(this, "options", this.setOptions);
@@ -2062,24 +2087,24 @@ ${t}</tr>
2062
2087
  }
2063
2088
  walkTokens(t, e) {
2064
2089
  let n = [];
2065
- for (let s of t) switch (n = n.concat(e.call(this, s)), s.type) {
2090
+ for (let r of t) switch (n = n.concat(e.call(this, r)), r.type) {
2066
2091
  case "table": {
2067
- let r = s;
2068
- for (let l of r.header) n = n.concat(this.walkTokens(l.tokens, e));
2069
- for (let l of r.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
2092
+ let s = r;
2093
+ for (let o of s.header) n = n.concat(this.walkTokens(o.tokens, e));
2094
+ for (let o of s.rows) for (let l of o) n = n.concat(this.walkTokens(l.tokens, e));
2070
2095
  break;
2071
2096
  }
2072
2097
  case "list": {
2073
- let r = s;
2074
- n = n.concat(this.walkTokens(r.items, e));
2098
+ let s = r;
2099
+ n = n.concat(this.walkTokens(s.items, e));
2075
2100
  break;
2076
2101
  }
2077
2102
  default: {
2078
- let r = s;
2079
- this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((l) => {
2080
- let o = r[l].flat(1 / 0);
2081
- n = n.concat(this.walkTokens(o, e));
2082
- }) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, e)));
2103
+ let s = r;
2104
+ this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((o) => {
2105
+ let l = s[o].flat(1 / 0);
2106
+ n = n.concat(this.walkTokens(l, e));
2107
+ }) : s.tokens && (n = n.concat(this.walkTokens(s.tokens, e)));
2083
2108
  }
2084
2109
  }
2085
2110
  return n;
@@ -2087,80 +2112,80 @@ ${t}</tr>
2087
2112
  use(...t) {
2088
2113
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
2089
2114
  return t.forEach((n) => {
2090
- let s = { ...n };
2091
- if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r) => {
2092
- if (!r.name) throw new Error("extension name required");
2093
- if ("renderer" in r) {
2094
- let l = e.renderers[r.name];
2095
- l ? e.renderers[r.name] = function(...o) {
2096
- let c = r.renderer.apply(this, o);
2097
- return c === !1 && (c = l.apply(this, o)), c;
2098
- } : e.renderers[r.name] = r.renderer;
2115
+ let r = { ...n };
2116
+ if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
2117
+ if (!s.name) throw new Error("extension name required");
2118
+ if ("renderer" in s) {
2119
+ let o = e.renderers[s.name];
2120
+ o ? e.renderers[s.name] = function(...l) {
2121
+ let f = s.renderer.apply(this, l);
2122
+ return f === !1 && (f = o.apply(this, l)), f;
2123
+ } : e.renderers[s.name] = s.renderer;
2099
2124
  }
2100
- if ("tokenizer" in r) {
2101
- if (!r.level || r.level !== "block" && r.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
2102
- let l = e[r.level];
2103
- l ? l.unshift(r.tokenizer) : e[r.level] = [r.tokenizer], r.start && (r.level === "block" ? e.startBlock ? e.startBlock.push(r.start) : e.startBlock = [r.start] : r.level === "inline" && (e.startInline ? e.startInline.push(r.start) : e.startInline = [r.start]));
2125
+ if ("tokenizer" in s) {
2126
+ if (!s.level || s.level !== "block" && s.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
2127
+ let o = e[s.level];
2128
+ o ? o.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
2104
2129
  }
2105
- "childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
2106
- }), s.extensions = e), n.renderer) {
2107
- let r = this.defaults.renderer || new Et(this.defaults);
2108
- for (let l in n.renderer) {
2109
- if (!(l in r)) throw new Error(`renderer '${l}' does not exist`);
2110
- if (["options", "parser"].includes(l)) continue;
2111
- let o = l, c = n.renderer[o], p = r[o];
2112
- r[o] = (...g) => {
2113
- let d = c.apply(r, g);
2114
- return d === !1 && (d = p.apply(r, g)), d || "";
2130
+ "childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
2131
+ }), r.extensions = e), n.renderer) {
2132
+ let s = this.defaults.renderer || new Et(this.defaults);
2133
+ for (let o in n.renderer) {
2134
+ if (!(o in s)) throw new Error(`renderer '${o}' does not exist`);
2135
+ if (["options", "parser"].includes(o)) continue;
2136
+ let l = o, f = n.renderer[l], c = s[l];
2137
+ s[l] = (...x) => {
2138
+ let h = f.apply(s, x);
2139
+ return h === !1 && (h = c.apply(s, x)), h || "";
2115
2140
  };
2116
2141
  }
2117
- s.renderer = r;
2142
+ r.renderer = s;
2118
2143
  }
2119
2144
  if (n.tokenizer) {
2120
- let r = this.defaults.tokenizer || new At(this.defaults);
2121
- for (let l in n.tokenizer) {
2122
- if (!(l in r)) throw new Error(`tokenizer '${l}' does not exist`);
2123
- if (["options", "rules", "lexer"].includes(l)) continue;
2124
- let o = l, c = n.tokenizer[o], p = r[o];
2125
- r[o] = (...g) => {
2126
- let d = c.apply(r, g);
2127
- return d === !1 && (d = p.apply(r, g)), d;
2145
+ let s = this.defaults.tokenizer || new At(this.defaults);
2146
+ for (let o in n.tokenizer) {
2147
+ if (!(o in s)) throw new Error(`tokenizer '${o}' does not exist`);
2148
+ if (["options", "rules", "lexer"].includes(o)) continue;
2149
+ let l = o, f = n.tokenizer[l], c = s[l];
2150
+ s[l] = (...x) => {
2151
+ let h = f.apply(s, x);
2152
+ return h === !1 && (h = c.apply(s, x)), h;
2128
2153
  };
2129
2154
  }
2130
- s.tokenizer = r;
2155
+ r.tokenizer = s;
2131
2156
  }
2132
2157
  if (n.hooks) {
2133
- let r = this.defaults.hooks || new ot();
2134
- for (let l in n.hooks) {
2135
- if (!(l in r)) throw new Error(`hook '${l}' does not exist`);
2136
- if (["options", "block"].includes(l)) continue;
2137
- let o = l, c = n.hooks[o], p = r[o];
2138
- ot.passThroughHooks.has(l) ? r[o] = (g) => {
2139
- if (this.defaults.async && ot.passThroughHooksRespectAsync.has(l)) return (async () => {
2140
- let f = await c.call(r, g);
2141
- return p.call(r, f);
2158
+ let s = this.defaults.hooks || new ot();
2159
+ for (let o in n.hooks) {
2160
+ if (!(o in s)) throw new Error(`hook '${o}' does not exist`);
2161
+ if (["options", "block"].includes(o)) continue;
2162
+ let l = o, f = n.hooks[l], c = s[l];
2163
+ ot.passThroughHooks.has(o) ? s[l] = (x) => {
2164
+ if (this.defaults.async && ot.passThroughHooksRespectAsync.has(o)) return (async () => {
2165
+ let d = await f.call(s, x);
2166
+ return c.call(s, d);
2142
2167
  })();
2143
- let d = c.call(r, g);
2144
- return p.call(r, d);
2145
- } : r[o] = (...g) => {
2168
+ let h = f.call(s, x);
2169
+ return c.call(s, h);
2170
+ } : s[l] = (...x) => {
2146
2171
  if (this.defaults.async) return (async () => {
2147
- let f = await c.apply(r, g);
2148
- return f === !1 && (f = await p.apply(r, g)), f;
2172
+ let d = await f.apply(s, x);
2173
+ return d === !1 && (d = await c.apply(s, x)), d;
2149
2174
  })();
2150
- let d = c.apply(r, g);
2151
- return d === !1 && (d = p.apply(r, g)), d;
2175
+ let h = f.apply(s, x);
2176
+ return h === !1 && (h = c.apply(s, x)), h;
2152
2177
  };
2153
2178
  }
2154
- s.hooks = r;
2179
+ r.hooks = s;
2155
2180
  }
2156
2181
  if (n.walkTokens) {
2157
- let r = this.defaults.walkTokens, l = n.walkTokens;
2158
- s.walkTokens = function(o) {
2159
- let c = [];
2160
- return c.push(l.call(this, o)), r && (c = c.concat(r.call(this, o))), c;
2182
+ let s = this.defaults.walkTokens, o = n.walkTokens;
2183
+ r.walkTokens = function(l) {
2184
+ let f = [];
2185
+ return f.push(o.call(this, l)), s && (f = f.concat(s.call(this, l))), f;
2161
2186
  };
2162
2187
  }
2163
- this.defaults = { ...this.defaults, ...s };
2188
+ this.defaults = { ...this.defaults, ...r };
2164
2189
  }), this;
2165
2190
  }
2166
2191
  setOptions(t) {
@@ -2174,24 +2199,24 @@ ${t}</tr>
2174
2199
  }
2175
2200
  parseMarkdown(t) {
2176
2201
  return (e, n) => {
2177
- let s = { ...n }, r = { ...this.defaults, ...s }, l = this.onError(!!r.silent, !!r.async);
2178
- if (this.defaults.async === !0 && s.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2179
- if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
2180
- if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2181
- if (r.hooks && (r.hooks.options = r, r.hooks.block = t), r.async) return (async () => {
2182
- let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(o, r), p = r.hooks ? await r.hooks.processAllTokens(c) : c;
2183
- r.walkTokens && await Promise.all(this.walkTokens(p, r.walkTokens));
2184
- let g = await (r.hooks ? await r.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(p, r);
2185
- return r.hooks ? await r.hooks.postprocess(g) : g;
2186
- })().catch(l);
2202
+ let r = { ...n }, s = { ...this.defaults, ...r }, o = this.onError(!!s.silent, !!s.async);
2203
+ if (this.defaults.async === !0 && r.async === !1) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2204
+ if (typeof e > "u" || e === null) return o(new Error("marked(): input parameter is undefined or null"));
2205
+ if (typeof e != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
2206
+ if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
2207
+ let l = s.hooks ? await s.hooks.preprocess(e) : e, f = await (s.hooks ? await s.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(l, s), c = s.hooks ? await s.hooks.processAllTokens(f) : f;
2208
+ s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
2209
+ let x = await (s.hooks ? await s.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(c, s);
2210
+ return s.hooks ? await s.hooks.postprocess(x) : x;
2211
+ })().catch(o);
2187
2212
  try {
2188
- r.hooks && (e = r.hooks.preprocess(e));
2189
- let o = (r.hooks ? r.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(e, r);
2190
- r.hooks && (o = r.hooks.processAllTokens(o)), r.walkTokens && this.walkTokens(o, r.walkTokens);
2191
- let c = (r.hooks ? r.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(o, r);
2192
- return r.hooks && (c = r.hooks.postprocess(c)), c;
2193
- } catch (o) {
2194
- return l(o);
2213
+ s.hooks && (e = s.hooks.preprocess(e));
2214
+ let l = (s.hooks ? s.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(e, s);
2215
+ s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
2216
+ let f = (s.hooks ? s.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(l, s);
2217
+ return s.hooks && (f = s.hooks.postprocess(f)), f;
2218
+ } catch (l) {
2219
+ return o(l);
2195
2220
  }
2196
2221
  };
2197
2222
  }
@@ -2199,30 +2224,30 @@ ${t}</tr>
2199
2224
  return (n) => {
2200
2225
  if (n.message += `
2201
2226
  Please report this to https://github.com/markedjs/marked.`, t) {
2202
- let s = "<p>An error occurred:</p><pre>" + ke(n.message + "", !0) + "</pre>";
2203
- return e ? Promise.resolve(s) : s;
2227
+ let r = "<p>An error occurred:</p><pre>" + ke(n.message + "", !0) + "</pre>";
2228
+ return e ? Promise.resolve(r) : r;
2204
2229
  }
2205
2230
  if (e) return Promise.reject(n);
2206
2231
  throw n;
2207
2232
  };
2208
2233
  }
2209
- }, h(We, "D"), We), Me = new si();
2234
+ }, p(qe, "D"), qe), Le = new ri();
2210
2235
  function M(a, t) {
2211
- return Me.parse(a, t);
2236
+ return Le.parse(a, t);
2212
2237
  }
2213
- h(M, "g");
2238
+ p(M, "g");
2214
2239
  M.options = M.setOptions = function(a) {
2215
- return Me.setOptions(a), M.defaults = Me.defaults, cs(M.defaults), M;
2240
+ return Le.setOptions(a), M.defaults = Le.defaults, us(M.defaults), M;
2216
2241
  };
2217
2242
  M.getDefaults = sn;
2218
- M.defaults = Oe;
2243
+ M.defaults = ze;
2219
2244
  M.use = function(...a) {
2220
- return Me.use(...a), M.defaults = Me.defaults, cs(M.defaults), M;
2245
+ return Le.use(...a), M.defaults = Le.defaults, us(M.defaults), M;
2221
2246
  };
2222
2247
  M.walkTokens = function(a, t) {
2223
- return Me.walkTokens(a, t);
2248
+ return Le.walkTokens(a, t);
2224
2249
  };
2225
- M.parseInline = Me.parseInline;
2250
+ M.parseInline = Le.parseInline;
2226
2251
  M.Parser = ge;
2227
2252
  M.parser = ge.parse;
2228
2253
  M.Renderer = Et;
@@ -2239,40 +2264,40 @@ M.walkTokens;
2239
2264
  M.parseInline;
2240
2265
  ge.parse;
2241
2266
  fe.lex;
2242
- const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2267
+ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
2243
2268
  key: 0,
2244
2269
  class: "pb-4"
2245
- }, ai = {
2270
+ }, li = {
2246
2271
  key: 0,
2247
2272
  class: "flex flex-col items-center justify-center px-4 min-h-full"
2248
- }, li = { class: "relative mb-4 size-20 @sm/chat:size-24" }, oi = ["src", "alt"], ci = {
2273
+ }, oi = { class: "relative mb-4 size-20 @sm/chat:size-24" }, ci = ["src", "alt"], ui = {
2249
2274
  key: 0,
2250
2275
  class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
2251
- }, ui = ["onClick"], hi = ["title"], pi = {
2276
+ }, hi = ["onClick"], pi = ["title"], di = {
2252
2277
  key: 1,
2253
2278
  class: "flex justify-end px-2 pb-2"
2254
- }, di = {
2279
+ }, fi = {
2255
2280
  key: 0,
2256
2281
  class: "flex items-center gap-3 py-3 px-2"
2257
- }, fi = ["data-issue-code", "data-issue-bucket"], gi = { class: "flex flex-col gap-1 min-w-0" }, mi = ["href"], bi = ["data-test"], xi = {
2282
+ }, gi = ["data-issue-code", "data-issue-bucket"], mi = { class: "flex flex-col gap-1 min-w-0" }, bi = ["href"], xi = ["data-test"], ki = {
2258
2283
  key: 0,
2259
2284
  class: "flex-shrink-0 size-7 @sm/chat:size-8"
2260
- }, ki = ["src", "alt"], wi = ["src", "alt"], yi = ["src"], vi = ["href"], Ti = ["innerHTML"], Si = {
2285
+ }, wi = ["src", "alt"], yi = ["src", "alt"], vi = ["src"], Ti = ["href"], Si = ["innerHTML"], Ai = {
2261
2286
  key: 2,
2262
2287
  class: "flex gap-2 justify-start items-center mb-4"
2263
- }, Ai = ["src", "alt"], Ei = {
2288
+ }, Ei = ["src", "alt"], _i = {
2264
2289
  key: 0,
2265
2290
  class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
2266
- }, _i = ["src", "alt"], Ri = { class: "max-w-20 truncate" }, Ii = ["onClick"], Di = {
2291
+ }, Ri = ["src", "alt"], Ii = { class: "max-w-20 truncate" }, Di = ["onClick"], Ci = {
2267
2292
  key: 0,
2268
2293
  class: "shrink-0 flex items-center justify-center size-14"
2269
- }, Ci = ["disabled"], Mi = {
2294
+ }, Mi = ["disabled"], Li = {
2270
2295
  key: 0,
2271
2296
  class: "i-svg-spinners-ring-resize size-4"
2272
- }, Li = {
2297
+ }, Oi = {
2273
2298
  key: 1,
2274
2299
  class: "i-tabler-paperclip size-5"
2275
- }, Oi = ["placeholder", "disabled"], zi = ["disabled"], Vi = /* @__PURE__ */ Le({
2300
+ }, zi = ["placeholder", "disabled"], Pi = ["disabled"], Yi = /* @__PURE__ */ Oe({
2276
2301
  __name: "ElAgentChat",
2277
2302
  props: {
2278
2303
  chatController: {},
@@ -2287,47 +2312,47 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2287
2312
  },
2288
2313
  setup(a) {
2289
2314
  const t = new M.Renderer();
2290
- t.link = ({ href: _, text: x }) => {
2291
- let b = !1;
2315
+ t.link = ({ href: _, text: b }) => {
2316
+ let m = !1;
2292
2317
  if (typeof window < "u")
2293
2318
  try {
2294
- b = new URL(_, window.location.href).origin === window.location.origin;
2319
+ m = new URL(_, window.location.href).origin === window.location.origin;
2295
2320
  } catch {
2296
- b = !1;
2321
+ m = !1;
2297
2322
  }
2298
- return b ? `<a href="${_}">${x}</a>` : `<a href="${_}" target="_blank" rel="noopener noreferrer">${x}</a>`;
2323
+ return m ? `<a href="${_}">${b}</a>` : `<a href="${_}" target="_blank" rel="noopener noreferrer">${b}</a>`;
2299
2324
  }, M.setOptions({ breaks: !0, gfm: !0, renderer: t });
2300
2325
  function e(_) {
2301
2326
  if (!_)
2302
2327
  return "";
2303
- const x = M.parse(_, { async: !1 });
2304
- return mr.sanitize(x, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2328
+ const b = M.parse(_, { async: !1 });
2329
+ return br.sanitize(b, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
2305
2330
  }
2306
- h(e, "renderMarkdown");
2331
+ p(e, "renderMarkdown");
2307
2332
  const n = {
2308
2333
  private: "",
2309
2334
  org: "",
2310
2335
  public: ""
2311
- }, s = {
2336
+ }, r = {
2312
2337
  private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
2313
2338
  org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
2314
2339
  public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
2315
- }, r = [
2340
+ }, s = [
2316
2341
  "Brief me on tomorrow",
2317
2342
  "Triage my inbox",
2318
2343
  "What's on my plate this week"
2319
- ], l = G(
2320
- () => a.starterPrompts ?? r
2321
- ), o = G(() => a.setupHint ?? n[a.scope]), c = G(() => {
2322
- const _ = { ...s[a.scope] };
2344
+ ], o = G(
2345
+ () => a.starterPrompts ?? s
2346
+ ), l = G(() => a.setupHint ?? n[a.scope]), f = G(() => {
2347
+ const _ = { ...r[a.scope] };
2323
2348
  return a.scope === "org" && a.scopeName && (_.label = a.scopeName, _.tooltip = `Visible to ${a.scopeName} members`), _;
2324
- }), p = ee(""), g = ee(!1), d = ee(), f = ee(), m = ee(), w = ee([]), E = ee(!1);
2325
- function O(_, x) {
2326
- const b = _[x], L = _[x + 1];
2327
- return !L || L.sender !== b.sender;
2349
+ }), c = te(""), x = te(!1), h = te(), d = te(), g = te(), w = te([]), E = te(!1);
2350
+ function O(_, b) {
2351
+ const m = _[b], L = _[b + 1];
2352
+ return !L || L.sender !== m.sender;
2328
2353
  }
2329
- h(O, "shouldShowAvatar");
2330
- const U = G(() => a.chatController?.textState.value), ae = G(() => U.value?.isConnected ?? !1), le = G(() => U.value?.isThinking ?? !1), z = G(() => U.value?.connectionStatus === "disconnected" && !!U.value?.error), oe = G(() => U.value?.connectionStatus !== "connected" && !U.value?.error), me = G(() => U.value?.error), V = G(() => a.chatController?.sharedMessages.value ?? []), ht = G(() => U.value?.accountGated ?? !1), _e = G(() => !ae.value || ht.value), It = G(() => z.value ? "Agent is offline" : oe.value ? "Connecting..." : ht.value ? "Resolve the billing issue above to continue" : "Message"), Y = G(() => (p.value.trim() || w.value.length > 0) && !_e.value && !E.value), I = G(() => a.variant === "light"), Re = G(
2354
+ p(O, "shouldShowAvatar");
2355
+ const U = G(() => a.chatController?.textState.value), ae = G(() => U.value?.isConnected ?? !1), le = G(() => U.value?.isThinking ?? !1), z = G(() => U.value?.connectionStatus === "disconnected" && !!U.value?.error), oe = G(() => U.value?.connectionStatus !== "connected" && !U.value?.error), me = G(() => U.value?.error), V = G(() => a.chatController?.sharedMessages.value ?? []), ht = G(() => U.value?.accountGated ?? !1), Re = G(() => !ae.value || ht.value), It = G(() => z.value ? "Agent is offline" : oe.value ? "Connecting..." : ht.value ? "Resolve the billing issue above to continue" : "Message"), Y = G(() => (c.value.trim() || w.value.length > 0) && !Re.value && !E.value), I = G(() => a.variant === "light"), Ie = G(
2331
2356
  () => I.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
2332
2357
  ), ve = G(() => I.value ? "text-theme-300" : "text-white/30");
2333
2358
  nn(async () => {
@@ -2341,91 +2366,91 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2341
2366
  function Dt() {
2342
2367
  a.chatController?.newConversation();
2343
2368
  }
2344
- h(Dt, "startNewConversation");
2345
- async function Ve() {
2346
- const _ = p.value.trim(), x = w.value.length > 0;
2347
- if (!_ && !x || !a.chatController || !ae.value || E.value)
2369
+ p(Dt, "startNewConversation");
2370
+ async function Ye() {
2371
+ const _ = c.value.trim(), b = w.value.length > 0;
2372
+ if (!_ && !b || !a.chatController || !ae.value || E.value)
2348
2373
  return;
2349
- const b = p.value, L = x ? [...w.value] : void 0;
2350
- p.value = "", w.value = [], f.value && (f.value.style.height = "auto", f.value.focus());
2374
+ const m = c.value, L = b ? [...w.value] : void 0;
2375
+ c.value = "", w.value = [], d.value && (d.value.style.height = "auto", d.value.focus());
2351
2376
  try {
2352
- await a.chatController.sendChatMessage(b, L), dt();
2377
+ await a.chatController.sendChatMessage(m, L), dt();
2353
2378
  } catch (Z) {
2354
2379
  console.error("Error sending message:", Z);
2355
2380
  }
2356
2381
  }
2357
- h(Ve, "sendMessage");
2358
- function Ct(_) {
2359
- _e.value || (p.value = _, Ve());
2382
+ p(Ye, "sendMessage");
2383
+ async function Ct(_) {
2384
+ Re.value || (c.value = _, await Ye());
2360
2385
  }
2361
- h(Ct, "sendStarterPrompt");
2362
- function pt(_) {
2363
- _.key === "Enter" && !_.shiftKey && (_.preventDefault(), Ve());
2386
+ p(Ct, "sendStarterPrompt");
2387
+ async function pt(_) {
2388
+ _.key === "Enter" && !_.shiftKey && (_.preventDefault(), await Ye());
2364
2389
  }
2365
- h(pt, "handleKeydown");
2390
+ p(pt, "handleKeydown");
2366
2391
  function dt() {
2367
- d.value && Wt(() => {
2368
- d.value.scrollTop = d.value.scrollHeight;
2392
+ h.value && Wt(() => {
2393
+ h.value.scrollTop = h.value.scrollHeight;
2369
2394
  });
2370
2395
  }
2371
- h(dt, "scrollToBottom");
2396
+ p(dt, "scrollToBottom");
2372
2397
  function ft() {
2373
- f.value && (f.value.style.height = "auto", f.value.style.height = `${Math.min(f.value.scrollHeight, 150)}px`);
2398
+ d.value && (d.value.style.height = "auto", d.value.style.height = `${Math.min(d.value.scrollHeight, 150)}px`);
2374
2399
  }
2375
- h(ft, "adjustTextareaHeight"), ct(p, () => Wt(() => ft()));
2400
+ p(ft, "adjustTextareaHeight"), ct(c, () => Wt(() => ft()));
2376
2401
  function F() {
2377
- m.value?.click();
2402
+ g.value?.click();
2378
2403
  }
2379
- h(F, "triggerFileInput");
2404
+ p(F, "triggerFileInput");
2380
2405
  async function gt(_) {
2381
- const x = _.target, b = x.files?.[0];
2382
- if (!(!b || !a.uploadFn)) {
2406
+ const b = _.target, m = b.files?.[0];
2407
+ if (!(!m || !a.uploadFn)) {
2383
2408
  E.value = !0;
2384
2409
  try {
2385
- const L = await a.uploadFn(b);
2410
+ const L = await a.uploadFn(m);
2386
2411
  w.value = [...w.value, L];
2387
2412
  } catch (L) {
2388
2413
  console.error("Upload failed:", L);
2389
2414
  } finally {
2390
- E.value = !1, x.value = "";
2415
+ E.value = !1, b.value = "";
2391
2416
  }
2392
2417
  }
2393
2418
  }
2394
- h(gt, "handleFileSelect");
2419
+ p(gt, "handleFileSelect");
2395
2420
  function W(_) {
2396
- w.value = w.value.filter((x, b) => b !== _);
2421
+ w.value = w.value.filter((b, m) => m !== _);
2397
2422
  }
2398
- h(W, "removeAttachment");
2399
- function Ye(_, x) {
2400
- if (x === 0) {
2401
- const he = _[x];
2423
+ p(W, "removeAttachment");
2424
+ function Ze(_, b) {
2425
+ if (b === 0) {
2426
+ const he = _[b];
2402
2427
  return he?.timestamp ? P(new Date(he.timestamp)) : null;
2403
2428
  }
2404
- const b = _[x - 1], L = _[x];
2405
- if (!b?.timestamp || !L?.timestamp) return null;
2406
- const Z = new Date(b.timestamp).getTime();
2429
+ const m = _[b - 1], L = _[b];
2430
+ if (!m?.timestamp || !L?.timestamp) return null;
2431
+ const Z = new Date(m.timestamp).getTime();
2407
2432
  return new Date(L.timestamp).getTime() - Z > 36e5 ? P(new Date(L.timestamp)) : null;
2408
2433
  }
2409
- h(Ye, "shouldShowTimeDivider");
2434
+ p(Ze, "shouldShowTimeDivider");
2410
2435
  function P(_) {
2411
- const x = /* @__PURE__ */ new Date(), b = _.toDateString() === x.toDateString(), L = new Date(x);
2436
+ const b = /* @__PURE__ */ new Date(), m = _.toDateString() === b.toDateString(), L = new Date(b);
2412
2437
  L.setDate(L.getDate() - 1);
2413
2438
  const Z = _.toDateString() === L.toDateString(), we = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
2414
- if (b) return we;
2439
+ if (m) return we;
2415
2440
  if (Z) return `Yesterday, ${we}`;
2416
- const Ze = _.getFullYear() === x.getFullYear();
2441
+ const Xe = _.getFullYear() === b.getFullYear();
2417
2442
  return `${_.toLocaleDateString("en-US", {
2418
2443
  weekday: "long",
2419
2444
  month: "short",
2420
2445
  day: "numeric",
2421
- ...Ze ? {} : { year: "numeric" }
2446
+ ...Xe ? {} : { year: "numeric" }
2422
2447
  })}, ${we}`;
2423
2448
  }
2424
- return h(P, "formatTimeDivider"), ct(V, (_) => {
2449
+ return p(P, "formatTimeDivider"), ct(V, (_) => {
2425
2450
  _.length > 0 && Wt(() => dt());
2426
- }, { immediate: !0, deep: !0 }), (_, x) => (T(), S("div", ri, [
2427
- I.value ? B("", !0) : (T(), S("div", ii, [
2428
- qt(Ws, {
2451
+ }, { immediate: !0, deep: !0 }), (_, b) => (T(), S("div", ii, [
2452
+ I.value ? B("", !0) : (T(), S("div", ai, [
2453
+ qt(qs, {
2429
2454
  agent: a.agent,
2430
2455
  "is-online": ae.value
2431
2456
  }, null, 8, ["agent", "is-online"])
@@ -2443,29 +2468,29 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2443
2468
  class: A(["py-16 flex flex-col items-center justify-center gap-2 text-sm", I.value ? "text-theme-400" : "text-theme-600"])
2444
2469
  }, [
2445
2470
  qt(Ln, { class: "size-4" })
2446
- ], 2)) : o.value ? (T(), S("div", {
2471
+ ], 2)) : l.value ? (T(), S("div", {
2447
2472
  key: 3,
2448
2473
  class: A(["flex items-center justify-center gap-1.5 py-2 text-[11px]", ve.value])
2449
2474
  }, [
2450
- x[6] || (x[6] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
2451
- y("span", null, ie(o.value), 1)
2475
+ b[6] || (b[6] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
2476
+ y("span", null, ie(l.value), 1)
2452
2477
  ], 2)) : B("", !0),
2453
2478
  y("div", {
2454
2479
  ref_key: "messagesContainer",
2455
- ref: d,
2480
+ ref: h,
2456
2481
  class: "flex-1 overflow-y-auto overflow-x-hidden pt-4 pb-[120px] px-3 space-y-1 min-h-0 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
2457
2482
  }, [
2458
- V.value.length === 0 && !oe.value && !z.value ? (T(), S("div", ai, [
2459
- y("div", li, [
2483
+ V.value.length === 0 && !oe.value && !z.value ? (T(), S("div", li, [
2484
+ y("div", oi, [
2460
2485
  y("img", {
2461
2486
  src: a.agent.avatarUrl.value,
2462
2487
  alt: a.agent.displayName.value,
2463
2488
  class: A(["size-full rounded-full object-cover ring-1", I.value ? "ring-black/5" : "ring-white/10"])
2464
- }, null, 10, oi),
2489
+ }, null, 10, ci),
2465
2490
  ae.value ? (T(), S("span", {
2466
2491
  key: 0,
2467
2492
  class: A(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", I.value ? "bg-white" : "bg-theme-900"])
2468
- }, [...x[7] || (x[7] = [
2493
+ }, [...b[7] || (b[7] = [
2469
2494
  y("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
2470
2495
  ])], 2)) : B("", !0)
2471
2496
  ]),
@@ -2475,145 +2500,145 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2475
2500
  y("p", {
2476
2501
  class: A(["mt-1 text-center text-xs @sm/chat:text-sm", ve.value])
2477
2502
  }, ie(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
2478
- l.value.length > 0 && !_e.value ? (T(), S("div", ci, [
2479
- (T(!0), S(Te, null, at(l.value, (b) => (T(), S("button", {
2480
- key: b,
2503
+ o.value.length > 0 && !Re.value ? (T(), S("div", ui, [
2504
+ (T(!0), S(Se, null, at(o.value, (m) => (T(), S("button", {
2505
+ key: m,
2481
2506
  type: "button",
2482
2507
  "data-test": "chat-starter-prompt",
2483
2508
  class: A(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", I.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
2484
- onClick: /* @__PURE__ */ h((L) => Ct(b), "onClick")
2485
- }, ie(b), 11, ui))), 128))
2509
+ onClick: /* @__PURE__ */ p((L) => Ct(m), "onClick")
2510
+ }, ie(m), 11, hi))), 128))
2486
2511
  ])) : B("", !0),
2487
2512
  y("div", {
2488
2513
  class: A(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", I.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
2489
- title: c.value.tooltip
2514
+ title: f.value.tooltip
2490
2515
  }, [
2491
2516
  y("i", {
2492
- class: A([c.value.icon, "size-3"])
2517
+ class: A([f.value.icon, "size-3"])
2493
2518
  }, null, 2),
2494
- y("span", null, ie(c.value.label), 1)
2495
- ], 10, hi)
2519
+ y("span", null, ie(f.value.label), 1)
2520
+ ], 10, pi)
2496
2521
  ])) : B("", !0),
2497
- V.value.length > 0 ? (T(), S("div", pi, [
2522
+ V.value.length > 0 ? (T(), S("div", di, [
2498
2523
  y("button", {
2499
2524
  type: "button",
2500
2525
  "data-test": "chat-new-session",
2501
2526
  class: A(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", I.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
2502
2527
  onClick: Dt
2503
- }, [...x[8] || (x[8] = [
2528
+ }, [...b[8] || (b[8] = [
2504
2529
  y("i", { class: "i-tabler-refresh size-3" }, null, -1),
2505
2530
  y("span", null, "New chat", -1)
2506
2531
  ])], 2)
2507
2532
  ])) : B("", !0),
2508
- (T(!0), S(Te, null, at(V.value, (b, L) => (T(), S(Te, {
2509
- key: b.id
2533
+ (T(!0), S(Se, null, at(V.value, (m, L) => (T(), S(Se, {
2534
+ key: m.id
2510
2535
  }, [
2511
- Ye(V.value, L) ? (T(), S("div", di, [
2536
+ Ze(V.value, L) ? (T(), S("div", fi, [
2512
2537
  y("div", {
2513
- class: A(["flex-1 h-px", Re.value])
2538
+ class: A(["flex-1 h-px", Ie.value])
2514
2539
  }, null, 2),
2515
2540
  y("span", {
2516
2541
  class: A(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", ve.value])
2517
- }, ie(Ye(V.value, L)), 3),
2542
+ }, ie(Ze(V.value, L)), 3),
2518
2543
  y("div", {
2519
- class: A(["flex-1 h-px", Re.value])
2544
+ class: A(["flex-1 h-px", Ie.value])
2520
2545
  }, null, 2)
2521
2546
  ])) : B("", !0),
2522
- b.sender === "system" ? (T(), S("div", {
2547
+ m.sender === "system" ? (T(), S("div", {
2523
2548
  key: 1,
2524
2549
  "data-test": "messaging-system-msg",
2525
- "data-issue-code": b.issue?.code,
2526
- "data-issue-bucket": b.issue?.bucket,
2550
+ "data-issue-code": m.issue?.code,
2551
+ "data-issue-bucket": m.issue?.bucket,
2527
2552
  class: A(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", I.value ? "text-theme-500" : "text-white/70"])
2528
2553
  }, [
2529
2554
  y("i", {
2530
- class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", b.issue?.bucket === "account" ? I.value ? "text-amber-500" : "text-amber-300" : I.value ? "text-red-500" : "text-red-300"])
2555
+ class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", m.issue?.bucket === "account" ? I.value ? "text-amber-500" : "text-amber-300" : I.value ? "text-red-500" : "text-red-300"])
2531
2556
  }, null, 2),
2532
- y("div", gi, [
2533
- y("span", null, ie(b.text), 1),
2534
- b.issue?.help ? (T(), S("span", {
2557
+ y("div", mi, [
2558
+ y("span", null, ie(m.text), 1),
2559
+ m.issue?.help ? (T(), S("span", {
2535
2560
  key: 0,
2536
2561
  class: A(["text-[12px]", I.value ? "text-theme-400" : "text-white/55"])
2537
- }, ie(b.issue.help), 3)) : B("", !0),
2538
- b.issue?.actionUrl ? (T(), S("a", {
2562
+ }, ie(m.issue.help), 3)) : B("", !0),
2563
+ m.issue?.actionUrl ? (T(), S("a", {
2539
2564
  key: 1,
2540
- href: b.issue.actionUrl,
2565
+ href: m.issue.actionUrl,
2541
2566
  "data-test": "messaging-system-msg-action",
2542
2567
  class: A(["text-[12px] font-medium inline-flex items-center gap-1", I.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
2543
2568
  }, [
2544
- Je(ie(b.issue.actionLabel) + " ", 1),
2545
- x[9] || (x[9] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2546
- ], 10, mi)) : B("", !0)
2569
+ et(ie(m.issue.actionLabel) + " ", 1),
2570
+ b[9] || (b[9] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
2571
+ ], 10, bi)) : B("", !0)
2547
2572
  ])
2548
- ], 10, fi)) : (T(), S("div", {
2573
+ ], 10, gi)) : (T(), S("div", {
2549
2574
  key: 2,
2550
- "data-test": b.sender === "agent" ? "messaging-assistant-msg" : b.sender === "user" ? "messaging-user-msg" : void 0,
2575
+ "data-test": m.sender === "agent" ? "messaging-assistant-msg" : m.sender === "user" ? "messaging-user-msg" : void 0,
2551
2576
  class: A(["flex gap-2 items-end", {
2552
- "justify-end": b.sender === "user",
2553
- "justify-start": b.sender === "agent",
2577
+ "justify-end": m.sender === "user",
2578
+ "justify-start": m.sender === "agent",
2554
2579
  "mb-4": O(V.value, L)
2555
2580
  }])
2556
2581
  }, [
2557
- b.sender === "agent" ? (T(), S("div", xi, [
2582
+ m.sender === "agent" ? (T(), S("div", ki, [
2558
2583
  O(V.value, L) ? (T(), S("img", {
2559
2584
  key: 0,
2560
2585
  src: a.agent.avatarUrl.value,
2561
2586
  alt: a.agent.displayName.value,
2562
2587
  class: A(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2563
- }, null, 10, ki)) : B("", !0)
2588
+ }, null, 10, wi)) : B("", !0)
2564
2589
  ])) : B("", !0),
2565
2590
  y("div", {
2566
- class: A(b.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2591
+ class: A(m.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
2567
2592
  }, [
2568
- b.attachments?.length ? (T(), S("div", {
2593
+ m.attachments?.length ? (T(), S("div", {
2569
2594
  key: 0,
2570
- class: A(["mb-1 space-y-1", b.sender === "user" ? "flex flex-col items-end" : ""])
2595
+ class: A(["mb-1 space-y-1", m.sender === "user" ? "flex flex-col items-end" : ""])
2571
2596
  }, [
2572
- (T(!0), S(Te, null, at(b.attachments, (Z, we) => (T(), S(Te, { key: we }, [
2597
+ (T(!0), S(Se, null, at(m.attachments, (Z, we) => (T(), S(Se, { key: we }, [
2573
2598
  Z.type === "image" ? (T(), S("img", {
2574
2599
  key: 0,
2575
2600
  src: Z.url,
2576
2601
  alt: Z.name,
2577
2602
  class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
2578
- }, null, 8, wi)) : Z.type === "audio" ? (T(), S("audio", {
2603
+ }, null, 8, yi)) : Z.type === "audio" ? (T(), S("audio", {
2579
2604
  key: 1,
2580
2605
  src: Z.url,
2581
2606
  controls: "",
2582
2607
  class: "max-w-full"
2583
- }, null, 8, yi)) : (T(), S("a", {
2608
+ }, null, 8, vi)) : (T(), S("a", {
2584
2609
  key: 2,
2585
2610
  href: Z.url,
2586
2611
  target: "_blank",
2587
2612
  rel: "noopener",
2588
2613
  class: A(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", I.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
2589
2614
  }, [
2590
- x[10] || (x[10] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2591
- Je(" " + ie(Z.name), 1)
2592
- ], 10, vi))
2615
+ b[10] || (b[10] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
2616
+ et(" " + ie(Z.name), 1)
2617
+ ], 10, Ti))
2593
2618
  ], 64))), 128))
2594
2619
  ], 2)) : B("", !0),
2595
- b.text ? (T(), S("div", {
2620
+ m.text ? (T(), S("div", {
2596
2621
  key: 1,
2597
2622
  class: A(["rounded-2xl px-3.5 py-2", [
2598
- b.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : I.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
2623
+ m.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : I.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
2599
2624
  ]])
2600
2625
  }, [
2601
2626
  y("div", {
2602
- class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", b.sender === "user" || !I.value ? "chat-msg-prose-invert" : ""]),
2603
- innerHTML: e(b.text),
2604
- onClick: x[0] || (x[0] = _s(() => {
2627
+ class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", m.sender === "user" || !I.value ? "chat-msg-prose-invert" : ""]),
2628
+ innerHTML: e(m.text),
2629
+ onClick: b[0] || (b[0] = Rs(() => {
2605
2630
  }, ["stop"]))
2606
- }, null, 10, Ti)
2631
+ }, null, 10, Si)
2607
2632
  ], 2)) : B("", !0)
2608
2633
  ], 2)
2609
- ], 10, bi))
2634
+ ], 10, xi))
2610
2635
  ], 64))), 128)),
2611
- le.value ? (T(), S("div", Si, [
2636
+ le.value ? (T(), S("div", Ai, [
2612
2637
  y("img", {
2613
2638
  src: a.agent.avatarUrl.value,
2614
2639
  alt: a.agent.displayName.value,
2615
2640
  class: A(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
2616
- }, null, 10, Ai),
2641
+ }, null, 10, Ei),
2617
2642
  y("div", {
2618
2643
  class: A(["rounded-2xl px-3.5 py-2.5 flex items-center", I.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
2619
2644
  }, [
@@ -2626,45 +2651,45 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2626
2651
  y("div", {
2627
2652
  class: A(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", I.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
2628
2653
  }, [
2629
- w.value.length > 0 ? (T(), S("div", Ei, [
2630
- (T(!0), S(Te, null, at(w.value, (b, L) => (T(), S("div", {
2654
+ w.value.length > 0 ? (T(), S("div", _i, [
2655
+ (T(!0), S(Se, null, at(w.value, (m, L) => (T(), S("div", {
2631
2656
  key: L,
2632
2657
  class: "relative shrink-0 group"
2633
2658
  }, [
2634
- b.type === "image" ? (T(), S("img", {
2659
+ m.type === "image" ? (T(), S("img", {
2635
2660
  key: 0,
2636
- src: b.url,
2637
- alt: b.name,
2661
+ src: m.url,
2662
+ alt: m.name,
2638
2663
  class: A(["size-14 rounded-xl object-cover border", I.value ? "border-black/10" : "border-white/20"])
2639
- }, null, 10, _i)) : (T(), S("div", {
2664
+ }, null, 10, Ri)) : (T(), S("div", {
2640
2665
  key: 1,
2641
2666
  class: A(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", I.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
2642
2667
  }, [
2643
- x[11] || (x[11] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
2644
- y("span", Ri, ie(b.name), 1)
2668
+ b[11] || (b[11] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
2669
+ y("span", Ii, ie(m.name), 1)
2645
2670
  ], 2)),
2646
2671
  y("button", {
2647
2672
  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",
2648
- onClick: /* @__PURE__ */ h((Z) => W(L), "onClick")
2649
- }, [...x[12] || (x[12] = [
2673
+ onClick: /* @__PURE__ */ p((Z) => W(L), "onClick")
2674
+ }, [...b[12] || (b[12] = [
2650
2675
  y("i", { class: "i-tabler-x size-3" }, null, -1)
2651
- ])], 8, Ii)
2676
+ ])], 8, Di)
2652
2677
  ]))), 128)),
2653
- E.value ? (T(), S("div", Di, [
2678
+ E.value ? (T(), S("div", Ci, [
2654
2679
  qt(Ln, { class: "size-5" })
2655
2680
  ])) : B("", !0)
2656
2681
  ])) : B("", !0),
2657
2682
  a.uploadFn ? (T(), S("input", {
2658
2683
  key: 1,
2659
2684
  ref_key: "fileInput",
2660
- ref: m,
2685
+ ref: g,
2661
2686
  type: "file",
2662
2687
  accept: "image/*,audio/*,video/*",
2663
2688
  class: "hidden",
2664
2689
  onChange: gt
2665
2690
  }, null, 544)) : B("", !0),
2666
2691
  y("div", {
2667
- class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", I.value ? g.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : g.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2692
+ class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", I.value ? x.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : x.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
2668
2693
  }, [
2669
2694
  y("button", {
2670
2695
  class: A(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
@@ -2672,57 +2697,57 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2672
2697
  I.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
2673
2698
  E.value ? "opacity-50 pointer-events-none" : ""
2674
2699
  ]]),
2675
- disabled: _e.value || E.value || !a.uploadFn,
2676
- onClick: x[1] || (x[1] = (b) => a.uploadFn && F())
2700
+ disabled: Re.value || E.value || !a.uploadFn,
2701
+ onClick: b[1] || (b[1] = (m) => a.uploadFn && F())
2677
2702
  }, [
2678
- E.value ? (T(), S("i", Mi)) : (T(), S("i", Li))
2679
- ], 10, Ci),
2680
- ns(y("textarea", {
2703
+ E.value ? (T(), S("i", Li)) : (T(), S("i", Oi))
2704
+ ], 10, Mi),
2705
+ ss(y("textarea", {
2681
2706
  ref_key: "textarea",
2682
- ref: f,
2683
- "onUpdate:modelValue": x[2] || (x[2] = (b) => p.value = b),
2707
+ ref: d,
2708
+ "onUpdate:modelValue": b[2] || (b[2] = (m) => c.value = m),
2684
2709
  "data-test": "messaging-input",
2685
2710
  rows: "1",
2686
2711
  enterkeyhint: "send",
2687
2712
  placeholder: It.value,
2688
- disabled: _e.value,
2713
+ disabled: Re.value,
2689
2714
  style: { fontSize: "16px", resize: "none" },
2690
2715
  class: A(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", I.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
2691
2716
  onKeydown: pt,
2692
- onFocus: x[3] || (x[3] = (b) => g.value = !0),
2693
- onBlur: x[4] || (x[4] = (b) => g.value = !1)
2694
- }, null, 42, Oi), [
2695
- [ss, p.value]
2717
+ onFocus: b[3] || (b[3] = (m) => x.value = !0),
2718
+ onBlur: b[4] || (b[4] = (m) => x.value = !1)
2719
+ }, null, 42, zi), [
2720
+ [rs, c.value]
2696
2721
  ]),
2697
2722
  y("button", {
2698
2723
  "data-test": "messaging-send-btn",
2699
2724
  class: A(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", Y.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : I.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
2700
2725
  disabled: !Y.value,
2701
- onClick: x[5] || (x[5] = (b) => Ve())
2702
- }, [...x[13] || (x[13] = [
2726
+ onClick: b[5] || (b[5] = (m) => Ye())
2727
+ }, [...b[13] || (b[13] = [
2703
2728
  y("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
2704
- ])], 10, zi)
2729
+ ])], 10, Pi)
2705
2730
  ], 2),
2706
2731
  y("div", {
2707
2732
  class: A(["text-[10px] text-center mt-2.5 select-none opacity-70", I.value ? "text-theme-400" : "text-white/50"])
2708
2733
  }, [
2709
- x[14] || (x[14] = Je(" Press ", -1)),
2734
+ b[14] || (b[14] = et(" Press ", -1)),
2710
2735
  y("kbd", {
2711
2736
  class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2712
2737
  }, "Enter", 2),
2713
- x[15] || (x[15] = Je(" to send, ", -1)),
2738
+ b[15] || (b[15] = et(" to send, ", -1)),
2714
2739
  y("kbd", {
2715
2740
  class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
2716
2741
  }, "Shift+Enter", 2),
2717
- x[16] || (x[16] = Je(" for new line ", -1))
2742
+ b[16] || (b[16] = et(" for new line ", -1))
2718
2743
  ], 2)
2719
2744
  ], 2)
2720
2745
  ]));
2721
2746
  }
2722
- }), Pi = { class: "agent-wrap" }, Ni = {
2747
+ }), Ni = { class: "agent-wrap" }, $i = {
2723
2748
  key: 0,
2724
2749
  class: "flex items-center justify-center h-full"
2725
- }, Yi = /* @__PURE__ */ Le({
2750
+ }, Zi = /* @__PURE__ */ Oe({
2726
2751
  __name: "AgentWrap",
2727
2752
  props: {
2728
2753
  sdk: {},
@@ -2736,20 +2761,20 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2736
2761
  apiBase: {}
2737
2762
  },
2738
2763
  setup(a) {
2739
- const t = Ds("AgentWrap"), e = a, n = e.sdk || Cs.getInstance({
2764
+ const t = Cs("AgentWrap"), e = a, n = e.sdk || Ms.getInstance({
2740
2765
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
2741
2766
  ...e.apiBase && { apiBase: e.apiBase }
2742
- }), s = ee(!e.agent), r = Rs(e.agent ? new Tt({ config: e.agent }) : void 0), l = ee();
2767
+ }), r = te(!e.agent), s = Is(e.agent ? new Tt({ config: e.agent }) : void 0), o = te();
2743
2768
  return nn(async () => {
2744
2769
  if (e.agent) {
2745
2770
  t.debug("Agent provided via props, skipping fetch", {
2746
2771
  agentId: e.agent.agentId,
2747
2772
  handle: e.agent.handle
2748
- }), s.value = !1;
2773
+ }), r.value = !1;
2749
2774
  return;
2750
2775
  }
2751
2776
  if (!e.handle) {
2752
- l.value = "No handle or agent provided", t.warn("AgentWrap mounted without handle or agent", {
2777
+ o.value = "No handle or agent provided", t.warn("AgentWrap mounted without handle or agent", {
2753
2778
  propsReceived: {
2754
2779
  handle: e.handle,
2755
2780
  agent: e.agent,
@@ -2760,22 +2785,22 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2760
2785
  isDev: n.isDev,
2761
2786
  apiBase: n.apiBase
2762
2787
  }
2763
- }), s.value = !1;
2788
+ }), r.value = !1;
2764
2789
  return;
2765
2790
  }
2766
2791
  try {
2767
- s.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2768
- const o = await n.getPublicAgent({ handle: e.handle });
2769
- o ? (r.value = new Tt({ config: o }), t.debug("Successfully fetched public agent", {
2770
- agentId: o.agentId,
2771
- handle: o.handle
2772
- }), o.agentId && n.track({
2792
+ r.value = !0, t.debug("Fetching public agent", { handle: e.handle });
2793
+ const l = await n.getPublicAgent({ handle: e.handle });
2794
+ l ? (s.value = new Tt({ config: l }), t.debug("Successfully fetched public agent", {
2795
+ agentId: l.agentId,
2796
+ handle: l.handle
2797
+ }), l.agentId && n.track({
2773
2798
  event: "view_profile",
2774
- agentId: o.agentId,
2799
+ agentId: l.agentId,
2775
2800
  properties: {
2776
2801
  viewSource: "widget"
2777
2802
  }
2778
- })) : (l.value = n.error.value || "Agent not found", t.error("Failed to fetch public agent - no data returned", {
2803
+ })) : (o.value = n.error.value || "Agent not found", t.error("Failed to fetch public agent - no data returned", {
2779
2804
  handle: e.handle,
2780
2805
  sdkError: n.error.value,
2781
2806
  sdkState: {
@@ -2784,13 +2809,13 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2784
2809
  loading: n.loading.value
2785
2810
  }
2786
2811
  }));
2787
- } catch (o) {
2788
- l.value = o instanceof Error ? o.message : "Failed to fetch agent", t.error("Exception while fetching public agent", {
2812
+ } catch (l) {
2813
+ o.value = l instanceof Error ? l.message : "Failed to fetch agent", t.error("Exception while fetching public agent", {
2789
2814
  handle: e.handle,
2790
- error: o instanceof Error ? {
2791
- message: o.message,
2792
- stack: o.stack
2793
- } : o,
2815
+ error: l instanceof Error ? {
2816
+ message: l.message,
2817
+ stack: l.stack
2818
+ } : l,
2794
2819
  sdkState: {
2795
2820
  isDev: n.isDev,
2796
2821
  apiBase: n.apiBase,
@@ -2798,11 +2823,11 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2798
2823
  }
2799
2824
  });
2800
2825
  } finally {
2801
- s.value = !1, r.value || t.debug("AgentWrap component will render empty (silent failure)", {
2826
+ r.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
2802
2827
  state: {
2803
- loading: s.value,
2804
- hasAgent: !!r.value,
2805
- error: l.value
2828
+ loading: r.value,
2829
+ hasAgent: !!s.value,
2830
+ error: o.value
2806
2831
  },
2807
2832
  props: {
2808
2833
  handle: e.handle,
@@ -2816,33 +2841,33 @@ const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
2816
2841
  }
2817
2842
  });
2818
2843
  }
2819
- }), (o, c) => (T(), S("div", Pi, [
2820
- s.value ? (T(), S("div", Ni, [...c[0] || (c[0] = [
2844
+ }), (l, f) => (T(), S("div", Ni, [
2845
+ r.value ? (T(), S("div", $i, [...f[0] || (f[0] = [
2821
2846
  y("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
2822
- ])])) : r.value ? ts(o.$slots, "default", {
2847
+ ])])) : s.value ? ns(l.$slots, "default", {
2823
2848
  key: 1,
2824
2849
  sdk: Qt(n),
2825
- agent: r.value,
2850
+ agent: s.value,
2826
2851
  context: a.context,
2827
2852
  firstMessage: a.firstMessage,
2828
2853
  buttonText: a.buttonText,
2829
2854
  buttonIcon: a.buttonIcon,
2830
- loading: s.value
2855
+ loading: r.value
2831
2856
  }) : B("", !0)
2832
2857
  ]));
2833
2858
  }
2834
2859
  });
2835
2860
  export {
2836
2861
  On as A,
2837
- Yi as _,
2838
- Vi as a,
2839
- Wi as b,
2840
- ji as c,
2841
- qi as d,
2862
+ Zi as _,
2863
+ Yi as a,
2864
+ qi as b,
2865
+ Wi as c,
2866
+ Vi as d,
2842
2867
  Ln as e,
2843
- Ws as f,
2844
- Hi as g,
2868
+ qs as f,
2869
+ Gi as g,
2845
2870
  Pn as h,
2846
- Gi as p
2871
+ ji as p
2847
2872
  };
2848
2873
  //# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map