@pagelines/sdk 1.0.516 → 1.0.517

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