@pagelines/sdk 1.0.528 → 1.0.530

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