@pagelines/sdk 1.0.473 → 1.0.475

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