@cuadra-ai/uikit 0.1.26 → 0.1.28

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.
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
- var Sr = Object.defineProperty;
2
- var Lr = (e, r, t) => r in e ? Sr(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var ae = (e, r, t) => Lr(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { jsx as d, jsxs as w, Fragment as J } from "react/jsx-runtime";
5
- import kt, { forwardRef as ve, createElement as Je, useMemo as V, useState as R, useEffect as O, useCallback as X, memo as Pr, useImperativeHandle as at, useSyncExternalStore as Rr, useRef as de, createContext as Dr } from "react";
6
- import { createPortal as Ye } from "react-dom";
7
- import { useThreadListItem as zt, RuntimeAdapterProvider as _r, useLocalRuntime as jt, AssistantRuntimeProvider as $t, unstable_useRemoteThreadListRuntime as Er, useThreadRuntime as Fr, useAssistantApi as zr, ThreadPrimitive as Se, ComposerPrimitive as ge, useAssistantState as xe, AttachmentPrimitive as jr, MessagePrimitive as be, ThreadListPrimitive as He, useThread as $r, ThreadListItemPrimitive as qe } from "@assistant-ui/react";
8
- import { unstable_memoizeMarkdownComponents as Or, useIsMarkdownCodeBlock as Ur, MarkdownTextPrimitive as Br } from "@assistant-ui/react-markdown";
9
- let ye = !1, wt = !1;
10
- function vt() {
11
- if (wt || (wt = !0, typeof document > "u" || typeof window > "u"))
1
+ var Pr = Object.defineProperty;
2
+ var Rr = (e, r, t) => r in e ? Pr(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var oe = (e, r, t) => Rr(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { jsx as d, jsxs as w, Fragment as ae } from "react/jsx-runtime";
5
+ import vt, { forwardRef as Ae, createElement as tt, useMemo as Q, useState as R, useEffect as O, useCallback as G, memo as Dr, useImperativeHandle as ct, useSyncExternalStore as _r, useRef as pe, createContext as Er } from "react";
6
+ import { createPortal as rt } from "react-dom";
7
+ import { useThreadListItem as $t, RuntimeAdapterProvider as Fr, useLocalRuntime as Ot, AssistantRuntimeProvider as Ut, unstable_useRemoteThreadListRuntime as zr, useThreadRuntime as jr, useAssistantApi as $r, ThreadPrimitive as _e, ComposerPrimitive as ke, useAssistantState as Ce, AttachmentPrimitive as Or, MessagePrimitive as we, ThreadListPrimitive as Xe, useThread as Ur, ThreadListItemPrimitive as Ke } from "@assistant-ui/react";
8
+ import { unstable_memoizeMarkdownComponents as Br, useIsMarkdownCodeBlock as Wr, MarkdownTextPrimitive as qr } from "@assistant-ui/react-markdown";
9
+ let ve = !1, Ct = !1;
10
+ function Tt() {
11
+ if (Ct || (Ct = !0, typeof document > "u" || typeof window > "u"))
12
12
  return;
13
13
  const e = document.querySelector("link[data-cuadra-uikit-styles]"), r = document.querySelector("style[data-cuadra-uikit-styles]");
14
14
  if (e || r) {
15
- ye = !0;
15
+ ve = !0;
16
16
  return;
17
17
  }
18
18
  try {
@@ -20,15 +20,15 @@ function vt() {
20
20
  t.className = "cuadra-flex", t.style.visibility = "hidden", t.style.position = "absolute", t.style.pointerEvents = "none", document.body.appendChild(t);
21
21
  const a = window.getComputedStyle(t).display === "flex";
22
22
  if (document.body.removeChild(t), a) {
23
- ye = !0;
23
+ ve = !0;
24
24
  return;
25
25
  }
26
26
  } catch {
27
27
  }
28
- Wr();
28
+ Hr();
29
29
  }
30
- function Wr() {
31
- if (ye)
30
+ function Hr() {
31
+ if (ve)
32
32
  return;
33
33
  const e = document.createElement("link");
34
34
  e.setAttribute("data-cuadra-uikit-styles", "true"), e.rel = "stylesheet", e.type = "text/css";
@@ -39,7 +39,7 @@ function Wr() {
39
39
  e.href = "/node_modules/@cuadra-ai/uikit/dist/uikit.css";
40
40
  }
41
41
  e.onload = () => {
42
- ye = !0;
42
+ ve = !0;
43
43
  }, e.onerror = () => {
44
44
  const r = [
45
45
  "/node_modules/@cuadra-ai/uikit/dist/uikit.css",
@@ -48,25 +48,25 @@ function Wr() {
48
48
  let t = 0;
49
49
  const a = () => {
50
50
  t < r.length && (e.href = r[t++], e.onerror = a, e.onload = () => {
51
- ye = !0;
51
+ ve = !0;
52
52
  });
53
53
  };
54
54
  a();
55
55
  }, document.head.appendChild(e);
56
56
  }
57
- typeof document < "u" && typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", vt) : vt());
58
- const Hr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), qr = (e) => e.replace(
57
+ typeof document < "u" && typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Tt) : Tt());
58
+ const Vr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xr = (e) => e.replace(
59
59
  /^([A-Z])|[\s-_]+(\w)/g,
60
60
  (r, t, a) => a ? a.toUpperCase() : t.toLowerCase()
61
- ), Ct = (e) => {
62
- const r = qr(e);
61
+ ), Mt = (e) => {
62
+ const r = Xr(e);
63
63
  return r.charAt(0).toUpperCase() + r.slice(1);
64
- }, Ot = (...e) => e.filter((r, t, a) => !!r && r.trim() !== "" && a.indexOf(r) === t).join(" ").trim(), Vr = (e) => {
64
+ }, Bt = (...e) => e.filter((r, t, a) => !!r && r.trim() !== "" && a.indexOf(r) === t).join(" ").trim(), Kr = (e) => {
65
65
  for (const r in e)
66
66
  if (r.startsWith("aria-") || r === "role" || r === "title")
67
67
  return !0;
68
68
  };
69
- var Xr = {
69
+ var Qr = {
70
70
  xmlns: "http://www.w3.org/2000/svg",
71
71
  width: 24,
72
72
  height: 24,
@@ -77,7 +77,7 @@ var Xr = {
77
77
  strokeLinecap: "round",
78
78
  strokeLinejoin: "round"
79
79
  };
80
- const Kr = ve(
80
+ const Gr = Ae(
81
81
  ({
82
82
  color: e = "currentColor",
83
83
  size: r = 24,
@@ -86,61 +86,61 @@ const Kr = ve(
86
86
  className: i = "",
87
87
  children: o,
88
88
  iconNode: n,
89
- ...u
90
- }, c) => Je(
89
+ ...s
90
+ }, c) => tt(
91
91
  "svg",
92
92
  {
93
93
  ref: c,
94
- ...Xr,
94
+ ...Qr,
95
95
  width: r,
96
96
  height: r,
97
97
  stroke: e,
98
98
  strokeWidth: a ? Number(t) * 24 / Number(r) : t,
99
- className: Ot("lucide", i),
100
- ...!o && !Vr(u) && { "aria-hidden": "true" },
101
- ...u
99
+ className: Bt("lucide", i),
100
+ ...!o && !Kr(s) && { "aria-hidden": "true" },
101
+ ...s
102
102
  },
103
103
  [
104
- ...n.map(([s, f]) => Je(s, f)),
104
+ ...n.map(([u, f]) => tt(u, f)),
105
105
  ...Array.isArray(o) ? o : [o]
106
106
  ]
107
107
  )
108
108
  );
109
109
  const U = (e, r) => {
110
- const t = ve(
111
- ({ className: a, ...i }, o) => Je(Kr, {
110
+ const t = Ae(
111
+ ({ className: a, ...i }, o) => tt(Gr, {
112
112
  ref: o,
113
113
  iconNode: r,
114
- className: Ot(
115
- `lucide-${Hr(Ct(e))}`,
114
+ className: Bt(
115
+ `lucide-${Vr(Mt(e))}`,
116
116
  `lucide-${e}`,
117
117
  a
118
118
  ),
119
119
  ...i
120
120
  })
121
121
  );
122
- return t.displayName = Ct(e), t;
122
+ return t.displayName = Mt(e), t;
123
123
  };
124
- const Qr = [
124
+ const Zr = [
125
125
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
126
126
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
127
- ], Gr = U("arrow-up", Qr);
128
- const Zr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Jr = U("check", Zr);
129
- const Yr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], et = U("chevron-down", Yr);
130
- const ea = [
127
+ ], Jr = U("arrow-up", Zr);
128
+ const Yr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], ea = U("check", Yr);
129
+ const ta = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], at = U("chevron-down", ta);
130
+ const ra = [
131
131
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
132
132
  ["path", { d: "M12 18a6 6 0 0 0 0-12v12z", key: "j4l70d" }]
133
- ], ta = U("contrast", ea);
134
- const ra = [
133
+ ], aa = U("contrast", ra);
134
+ const na = [
135
135
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
136
136
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
137
- ], aa = U("copy", ra);
138
- const na = [
137
+ ], ia = U("copy", na);
138
+ const oa = [
139
139
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
140
140
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
141
141
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
142
- ], ia = U("ellipsis-vertical", na);
143
- const oa = [
142
+ ], ca = U("ellipsis-vertical", oa);
143
+ const sa = [
144
144
  [
145
145
  "path",
146
146
  {
@@ -153,8 +153,8 @@ const oa = [
153
153
  ["path", { d: "M14 13h2", key: "un5t4a" }],
154
154
  ["path", { d: "M8 17h2", key: "2yhykz" }],
155
155
  ["path", { d: "M14 17h2", key: "10kma7" }]
156
- ], ca = U("file-spreadsheet", oa);
157
- const ua = [
156
+ ], ua = U("file-spreadsheet", sa);
157
+ const la = [
158
158
  [
159
159
  "path",
160
160
  {
@@ -166,8 +166,8 @@ const ua = [
166
166
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
167
167
  ["path", { d: "M16 13H8", key: "t4e002" }],
168
168
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
169
- ], Ut = U("file-text", ua);
170
- const sa = [
169
+ ], Wt = U("file-text", la);
170
+ const da = [
171
171
  [
172
172
  "path",
173
173
  {
@@ -179,19 +179,19 @@ const sa = [
179
179
  ["path", { d: "M11 18h2", key: "12mj7e" }],
180
180
  ["path", { d: "M12 12v6", key: "3ahymv" }],
181
181
  ["path", { d: "M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5", key: "qbrxap" }]
182
- ], la = U("file-type", sa);
183
- const da = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Bt = U("loader-circle", da);
184
- const fa = [
182
+ ], fa = U("file-type", da);
183
+ const ha = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], qt = U("loader-circle", ha);
184
+ const ma = [
185
185
  ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
186
186
  ["path", { d: "M21 12H9", key: "dn1m92" }],
187
187
  ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
188
- ], ha = U("log-out", fa);
189
- const ma = [
188
+ ], pa = U("log-out", ma);
189
+ const ga = [
190
190
  ["path", { d: "M4 5h16", key: "1tepv9" }],
191
191
  ["path", { d: "M4 12h16", key: "1lakjw" }],
192
192
  ["path", { d: "M4 19h16", key: "1djgab" }]
193
- ], pa = U("menu", ma);
194
- const ga = [
193
+ ], ba = U("menu", ga);
194
+ const ya = [
195
195
  [
196
196
  "path",
197
197
  {
@@ -199,20 +199,20 @@ const ga = [
199
199
  key: "1miecu"
200
200
  }
201
201
  ]
202
- ], Wt = U("paperclip", ga);
203
- const ba = [
202
+ ], Ht = U("paperclip", ya);
203
+ const xa = [
204
204
  ["path", { d: "M5 12h14", key: "1ays0h" }],
205
205
  ["path", { d: "M12 5v14", key: "s699le" }]
206
- ], ya = U("plus", ba);
207
- const xa = [
206
+ ], ka = U("plus", xa);
207
+ const wa = [
208
208
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
209
209
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
210
- ], nt = U("x", xa);
211
- class Ht {
210
+ ], st = U("x", wa);
211
+ class Vt {
212
212
  constructor(r, t, a = !1) {
213
- ae(this, "baseUrl");
214
- ae(this, "sessionToken", null);
215
- ae(this, "isProxyMode", !1);
213
+ oe(this, "baseUrl");
214
+ oe(this, "sessionToken", null);
215
+ oe(this, "isProxyMode", !1);
216
216
  this.baseUrl = r.replace(/\/$/, ""), this.isProxyMode = a, t && (this.sessionToken = t);
217
217
  }
218
218
  /**
@@ -249,22 +249,22 @@ class Ht {
249
249
  const n = {
250
250
  ...r,
251
251
  stream: !0
252
- }, u = await fetch(a, {
252
+ }, s = await fetch(a, {
253
253
  method: "POST",
254
254
  headers: o,
255
255
  body: JSON.stringify(n),
256
256
  signal: t,
257
257
  cache: "no-store"
258
258
  });
259
- if (!u.ok) {
260
- const c = await u.json().catch(() => ({}));
259
+ if (!s.ok) {
260
+ const c = await s.json().catch(() => ({}));
261
261
  throw new Error(
262
- c.detail || c.message || `API error: ${u.status} ${u.statusText}`
262
+ c.detail || c.message || `API error: ${s.status} ${s.statusText}`
263
263
  );
264
264
  }
265
- if (!u.body)
265
+ if (!s.body)
266
266
  throw new Error("Response body is null");
267
- return u.body;
267
+ return s.body;
268
268
  }
269
269
  /**
270
270
  * Get a specific chat by ID
@@ -329,14 +329,14 @@ class Ht {
329
329
  * Update a chat
330
330
  */
331
331
  async updateChat(r, t) {
332
- const a = `/v1/chats/${r}`, i = this.getUrl(a), o = i.startsWith("/") || i.startsWith("./") ? new URL(i, window.location.origin) : new URL(i), u = {
332
+ const a = `/v1/chats/${r}`, i = this.getUrl(a), o = i.startsWith("/") || i.startsWith("./") ? new URL(i, window.location.origin) : new URL(i), s = {
333
333
  "Content-Type": "application/json",
334
334
  "Idempotency-Key": this.generateIdempotencyKey()
335
335
  };
336
- this.sessionToken && (u.Authorization = `Bearer ${this.sessionToken}`);
336
+ this.sessionToken && (s.Authorization = `Bearer ${this.sessionToken}`);
337
337
  const c = await fetch(o.toString(), {
338
338
  method: "PATCH",
339
- headers: u,
339
+ headers: s,
340
340
  body: JSON.stringify(t)
341
341
  });
342
342
  if (!c.ok) {
@@ -353,11 +353,11 @@ class Ht {
353
353
  }
354
354
  if (c.status === 204)
355
355
  return {};
356
- const s = await c.text();
357
- if (!s)
356
+ const u = await c.text();
357
+ if (!u)
358
358
  return {};
359
359
  try {
360
- return JSON.parse(s);
360
+ return JSON.parse(u);
361
361
  } catch {
362
362
  return {};
363
363
  }
@@ -371,14 +371,14 @@ class Ht {
371
371
  "Idempotency-Key": this.generateIdempotencyKey()
372
372
  };
373
373
  this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`);
374
- const u = await fetch(i.toString(), {
374
+ const s = await fetch(i.toString(), {
375
375
  method: "DELETE",
376
376
  headers: n
377
377
  });
378
- if (!u.ok) {
379
- const c = await u.json().catch(() => ({}));
378
+ if (!s.ok) {
379
+ const c = await s.json().catch(() => ({}));
380
380
  throw new Error(
381
- c.detail || c.message || `API error: ${u.status} ${u.statusText}`
381
+ c.detail || c.message || `API error: ${s.status} ${s.statusText}`
382
382
  );
383
383
  }
384
384
  }
@@ -436,25 +436,25 @@ class Ht {
436
436
  async uploadFile(r, t, a) {
437
437
  const i = this.getUrl("/v1/files"), o = this.generateIdempotencyKey(), n = new FormData();
438
438
  n.append("file", r), t && n.append("resource_type", t), a && n.append("resource_id", a);
439
- const u = {
439
+ const s = {
440
440
  "Idempotency-Key": o
441
441
  };
442
- this.sessionToken && (u.Authorization = `Bearer ${this.sessionToken}`);
442
+ this.sessionToken && (s.Authorization = `Bearer ${this.sessionToken}`);
443
443
  const c = await fetch(i, {
444
444
  method: "POST",
445
- headers: u,
445
+ headers: s,
446
446
  body: n
447
447
  });
448
448
  if (!c.ok) {
449
- const s = await c.json().catch(() => ({}));
449
+ const u = await c.json().catch(() => ({}));
450
450
  throw new Error(
451
- s.detail || s.message || `API error: ${c.status} ${c.statusText}`
451
+ u.detail || u.message || `API error: ${c.status} ${c.statusText}`
452
452
  );
453
453
  }
454
454
  return c.json();
455
455
  }
456
456
  }
457
- async function* ka(e, r) {
457
+ async function* va(e, r) {
458
458
  const t = e.getReader(), a = new TextDecoder();
459
459
  let i = "";
460
460
  try {
@@ -466,19 +466,19 @@ async function* ka(e, r) {
466
466
  const { done: o, value: n } = await t.read();
467
467
  if (o) break;
468
468
  i += a.decode(n, { stream: !0 });
469
- const u = i.split(`
469
+ const s = i.split(`
470
470
 
471
471
  `);
472
- i = u.pop() || "";
473
- for (const c of u)
472
+ i = s.pop() || "";
473
+ for (const c of s)
474
474
  if (c.startsWith("data: ")) {
475
- const s = c.slice(6);
476
- if (s.trim() === "[DONE]") {
475
+ const u = c.slice(6);
476
+ if (u.trim() === "[DONE]") {
477
477
  yield { done: !0 };
478
478
  continue;
479
479
  }
480
480
  try {
481
- yield JSON.parse(s);
481
+ yield JSON.parse(u);
482
482
  } catch {
483
483
  }
484
484
  }
@@ -487,7 +487,7 @@ async function* ka(e, r) {
487
487
  t.releaseLock();
488
488
  }
489
489
  }
490
- function wa(e) {
490
+ function Ca(e) {
491
491
  return e.map((r) => {
492
492
  let t = "";
493
493
  if (typeof r.content == "string")
@@ -503,7 +503,7 @@ function wa(e) {
503
503
  };
504
504
  });
505
505
  }
506
- function va(e) {
506
+ function Ta(e) {
507
507
  return {
508
508
  id: e.id,
509
509
  role: e.role,
@@ -535,29 +535,29 @@ function va(e) {
535
535
  }
536
536
  };
537
537
  }
538
- const De = /* @__PURE__ */ new Map();
539
- function Ca(e, r) {
538
+ const je = /* @__PURE__ */ new Map();
539
+ function Ma(e, r) {
540
540
  return {
541
541
  async list() {
542
542
  const t = [];
543
543
  let i, o = 0;
544
544
  do {
545
- const u = await e.listChats({ limit: 50, cursor: i }), c = u.items || [];
546
- Array.isArray(c) && c.length > 0 && t.push(...c), i = u.nextCursor || void 0, o++;
545
+ const s = await e.listChats({ limit: 50, cursor: i }), c = s.items || [];
546
+ Array.isArray(c) && c.length > 0 && t.push(...c), i = s.nextCursor || void 0, o++;
547
547
  } while (i && o < 50);
548
- return { threads: t.map((u) => {
549
- const c = u.id;
550
- return !c || u.deletedAt ? null : {
548
+ return { threads: t.map((s) => {
549
+ const c = s.id;
550
+ return !c || s.deletedAt ? null : {
551
551
  status: "regular",
552
552
  remoteId: c,
553
- title: u.title || "New Chat",
554
- createdAt: u.createdAt ? new Date(u.createdAt) : /* @__PURE__ */ new Date(),
555
- updatedAt: u.updatedAt ? new Date(u.updatedAt) : /* @__PURE__ */ new Date()
553
+ title: s.title || "New Chat",
554
+ createdAt: s.createdAt ? new Date(s.createdAt) : /* @__PURE__ */ new Date(),
555
+ updatedAt: s.updatedAt ? new Date(s.updatedAt) : /* @__PURE__ */ new Date()
556
556
  };
557
- }).filter((u) => u !== null) };
557
+ }).filter((s) => s !== null) };
558
558
  },
559
559
  async initialize(t) {
560
- return { remoteId: De.get(t) || t, externalId: void 0 };
560
+ return { remoteId: je.get(t) || t, externalId: void 0 };
561
561
  },
562
562
  async rename(t, a) {
563
563
  await e.updateChat(t, { title: a });
@@ -593,37 +593,37 @@ function Ca(e, r) {
593
593
  },
594
594
  // Add a method to update the remoteId mapping when chat ID is received
595
595
  updateRemoteId(t, a) {
596
- De.set(t, a), r?.(t, a);
596
+ je.set(t, a), r?.(t, a);
597
597
  },
598
598
  // Provider component that adds thread-specific history adapter
599
599
  unstable_Provider: ({ children: t }) => {
600
- const i = zt()?.remoteId, o = kt.useMemo(
600
+ const i = $t()?.remoteId, o = vt.useMemo(
601
601
  () => ({
602
602
  async load() {
603
603
  if (!i) return { messages: [] };
604
604
  try {
605
- const u = await e.getChat(i);
606
- return !u.messages || u.messages.length === 0 ? { messages: [] } : { messages: u.messages.map((s) => va(s)) };
605
+ const s = await e.getChat(i);
606
+ return !s.messages || s.messages.length === 0 ? { messages: [] } : { messages: s.messages.map((u) => Ta(u)) };
607
607
  } catch {
608
608
  return { messages: [] };
609
609
  }
610
610
  },
611
- async append(u) {
611
+ async append(s) {
612
612
  }
613
613
  }),
614
614
  [i, e]
615
- ), n = kt.useMemo(() => ({ history: o }), [o]);
616
- return /* @__PURE__ */ d(_r, { adapters: n, children: t });
615
+ ), n = vt.useMemo(() => ({ history: o }), [o]);
616
+ return /* @__PURE__ */ d(Fr, { adapters: n, children: t });
617
617
  }
618
618
  };
619
619
  }
620
- class Ta {
620
+ class Aa {
621
621
  constructor() {
622
622
  /** Per-message metadata, keyed by message ID */
623
- ae(this, "messageMetadata", /* @__PURE__ */ new Map());
623
+ oe(this, "messageMetadata", /* @__PURE__ */ new Map());
624
624
  /** Current streaming message ID */
625
- ae(this, "currentMessageId", null);
626
- ae(this, "listeners", /* @__PURE__ */ new Set());
625
+ oe(this, "currentMessageId", null);
626
+ oe(this, "listeners", /* @__PURE__ */ new Set());
627
627
  }
628
628
  /**
629
629
  * Set the current streaming message ID
@@ -677,128 +677,158 @@ class Ta {
677
677
  this.listeners.forEach((r) => r());
678
678
  }
679
679
  }
680
- const ie = new Ta(), Tt = /* @__PURE__ */ new Map(), qt = [];
681
- let Le = [];
682
- function Ma(e, r, t = 50, a = 800) {
683
- qt.push({ question: e, response: r, streamingSpeed: t, initialDelay: a });
680
+ const se = new Aa(), At = /* @__PURE__ */ new Map(), nt = [];
681
+ let Ee = [];
682
+ function Xt(e, r, t = 50, a = 800) {
683
+ nt.push({ question: e, response: r, streamingSpeed: t, initialDelay: a });
684
684
  }
685
- function Vt(e, r) {
686
- const { modelId: t, systemPrompt: a, ephemeral: i, enableReasoning: o, onChatCreated: n, onUserMessage: u, onThreadIdUpdate: c, onBeforeRequest: s } = r;
687
- let f;
685
+ function Kt(e, r) {
686
+ const { modelId: t, systemPrompt: a, ephemeral: i, enableReasoning: o, onChatCreated: n, onUserMessage: s, onThreadIdUpdate: c, onBeforeRequest: u, mockResponseOnBlocked: f } = r;
687
+ let l;
688
688
  return {
689
- async *run(l) {
690
- const { messages: p, abortSignal: g, context: m } = l, x = qt.shift();
691
- if (x) {
692
- u?.();
693
- const v = x.initialDelay ?? 800;
694
- if (v > 0 && await new Promise((P) => setTimeout(P, v)), g?.aborted)
689
+ async *run(p) {
690
+ const { messages: g, abortSignal: m, context: x } = p, b = nt.shift();
691
+ if (b) {
692
+ s?.();
693
+ const T = b.initialDelay ?? 800;
694
+ if (T > 0 && await new Promise((S) => setTimeout(S, T)), m?.aborted)
695
695
  throw new Error("Request aborted");
696
- const S = x.response.split(" ");
697
- let $ = "";
698
- const E = x.streamingSpeed || 50, ee = `premade-${Date.now()}`;
699
- i && n?.(ee);
700
- for (let P = 0; P < S.length; P++) {
701
- if (g?.aborted)
696
+ const N = b.response.split(" ");
697
+ let _ = "";
698
+ const L = b.streamingSpeed || 50, H = `premade-${Date.now()}`;
699
+ i && n?.(H);
700
+ for (let S = 0; S < N.length; S++) {
701
+ if (m?.aborted)
702
702
  throw new Error("Request aborted");
703
- $ += (P === 0 ? "" : " ") + S[P], yield {
704
- content: [{ type: "text", text: $ }]
705
- }, await new Promise((re) => setTimeout(re, E + Math.random() * (E * 0.5)));
703
+ _ += (S === 0 ? "" : " ") + N[S], yield {
704
+ content: [{ type: "text", text: _ }]
705
+ }, await new Promise((q) => setTimeout(q, L + Math.random() * (L * 0.5)));
706
706
  }
707
707
  yield {
708
- content: [{ type: "text", text: $ }]
709
- }, Le.push(
710
- { role: "user", content: x.question },
711
- { role: "assistant", content: x.response }
708
+ content: [{ type: "text", text: _ }]
709
+ }, Ee.push(
710
+ { role: "user", content: b.question },
711
+ { role: "assistant", content: b.response }
712
712
  );
713
713
  return;
714
714
  }
715
- const b = m?.threadId;
716
- let y = b;
717
- if (!y && p.length > 0) {
718
- const v = p.find((S) => S.role === "user");
719
- v && (y = (typeof v.content == "string" ? v.content : Array.isArray(v.content) && v.content.find(($) => $.type === "text")?.text || "").substring(0, 50));
715
+ const y = x?.threadId;
716
+ let k = y;
717
+ if (!k && g.length > 0) {
718
+ const T = g.find((N) => N.role === "user");
719
+ T && (k = (typeof T.content == "string" ? T.content : Array.isArray(T.content) && T.content.find((_) => _.type === "text")?.text || "").substring(0, 50));
720
720
  }
721
- let k;
722
- b && (k = De.get(b)), !k && y && (k = Tt.get(y)), !k && f && (k = f), u?.();
723
- let T = p, L = -1;
724
- for (let v = p.length - 1; v >= 0; v--)
725
- if (p[v].role === "assistant") {
726
- L = v;
721
+ let v;
722
+ y && (v = je.get(y)), !v && k && (v = At.get(k)), !v && l && (v = l), s?.();
723
+ let P = g, I = -1;
724
+ for (let T = g.length - 1; T >= 0; T--)
725
+ if (g[T].role === "assistant") {
726
+ I = T;
727
727
  break;
728
728
  }
729
- (k || L >= 0) && L >= 0 && (T = p.slice(L + 1));
730
- const I = wa(T);
731
- if (Le.length > 0 && !k) {
732
- const v = Le.map((S) => ({
733
- role: S.role,
734
- content: S.content
729
+ (v || I >= 0) && I >= 0 && (P = g.slice(I + 1));
730
+ const C = Ca(P);
731
+ if (Ee.length > 0 && !v) {
732
+ const T = Ee.map((N) => ({
733
+ role: N.role,
734
+ content: N.content
735
735
  }));
736
- I.unshift(...v), Le = [];
736
+ C.unshift(...T), Ee = [];
737
737
  }
738
- const C = {
739
- messages: I,
740
- chatId: k || null,
738
+ const D = {
739
+ messages: C,
740
+ chatId: v || null,
741
741
  // Use server chatId if available
742
742
  systemPrompt: a,
743
743
  ephemeral: i,
744
744
  enableReasoning: o,
745
745
  stream: !0
746
746
  };
747
- if (t && t.trim() !== "" && (C.modelId = t), s && !await s())
747
+ if (t && t.trim() !== "" && (D.modelId = t), u && !await u()) {
748
+ if (f) {
749
+ const N = typeof f == "function" ? f() : f, _ = g.filter((q) => q.role === "user"), L = _.length > 0 ? _[_.length - 1] : void 0;
750
+ let H = "Message";
751
+ L && (typeof L.content == "string" ? H = L.content : Array.isArray(L.content) && (H = L.content.find(
752
+ (V) => V.type === "text"
753
+ )?.text || "Message")), Xt(H, N, 40, 400);
754
+ const S = nt.shift();
755
+ if (S) {
756
+ s?.();
757
+ const q = S.initialDelay ?? 400;
758
+ if (q > 0 && await new Promise((Y) => setTimeout(Y, q)), m?.aborted)
759
+ throw new Error("Request aborted");
760
+ const V = S.response.split(" ");
761
+ let ie = "";
762
+ const le = S.streamingSpeed || 40, de = `mock-${Date.now()}`;
763
+ i && n?.(de);
764
+ for (let Y = 0; Y < V.length; Y++) {
765
+ if (m?.aborted)
766
+ throw new Error("Request aborted");
767
+ ie += (Y === 0 ? "" : " ") + V[Y], yield {
768
+ content: [{ type: "text", text: ie }]
769
+ }, await new Promise((Le) => setTimeout(Le, le + Math.random() * (le * 0.3)));
770
+ }
771
+ yield {
772
+ content: [{ type: "text", text: ie }]
773
+ };
774
+ return;
775
+ }
776
+ }
748
777
  throw new Error("Request blocked");
749
- const D = await e.createOrContinueChat(C, g);
750
- let A = "", N = "", h;
751
- const _ = [];
752
- let H = 0, W = !1;
753
- const te = `msg_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
754
- ie.clear(), ie.setCurrentMessage(te);
755
- const Te = () => {
756
- _.length !== H && (H = _.length, ie.update({
757
- sources: _.length > 0 ? [..._] : void 0
778
+ }
779
+ const E = await e.createOrContinueChat(D, m);
780
+ let A = "", h = "", B;
781
+ const z = [];
782
+ let X = 0, K = !1;
783
+ const Ie = `msg_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
784
+ se.clear(), se.setCurrentMessage(Ie);
785
+ const Se = () => {
786
+ z.length !== X && (X = z.length, se.update({
787
+ sources: z.length > 0 ? [...z] : void 0
758
788
  }));
759
- }, q = () => {
760
- Te();
761
- const v = [];
762
- return N && v.push({ type: "reasoning", text: N }), A && v.push({ type: "text", text: A }), v.length === 0 && v.push({ type: "text", text: "" }), { content: v };
789
+ }, J = () => {
790
+ Se();
791
+ const T = [];
792
+ return h && T.push({ type: "reasoning", text: h }), A && T.push({ type: "text", text: A }), T.length === 0 && T.push({ type: "text", text: "" }), { content: T };
763
793
  };
764
- for await (const v of ka(D, g)) {
765
- if (g?.aborted)
794
+ for await (const T of va(E, m)) {
795
+ if (m?.aborted)
766
796
  throw new Error("Request aborted");
767
- const S = v.id || v.chatId || v.messageId;
768
- S && !h && (h = S, f = S, n?.(S), b && c && (c(b, S), De.set(b, S)), y && Tt.set(y, S));
769
- const $ = v.sources;
770
- if ($ && Array.isArray($) && $.length > 0)
771
- for (const P of $)
772
- _.some((re) => re.sourceId === P.sourceId) || _.push({
773
- sourceId: P.sourceId,
774
- filename: P.filename || "Unknown",
775
- score: P.score ?? 1,
776
- chunkId: P.chunkId,
777
- datasetId: P.datasetId
797
+ const N = T.id || T.chatId || T.messageId;
798
+ N && !B && (B = N, l = N, n?.(N), y && c && (c(y, N), je.set(y, N)), k && At.set(k, N));
799
+ const _ = T.sources;
800
+ if (_ && Array.isArray(_) && _.length > 0)
801
+ for (const S of _)
802
+ z.some((q) => q.sourceId === S.sourceId) || z.push({
803
+ sourceId: S.sourceId,
804
+ filename: S.filename || "Unknown",
805
+ score: S.score ?? 1,
806
+ chunkId: S.chunkId,
807
+ datasetId: S.datasetId
778
808
  });
779
- const E = v.reasoning;
780
- if (E && E.length > 0 && (N += E, yield q()), v.type)
781
- switch (v.type) {
809
+ const L = T.reasoning;
810
+ if (L && L.length > 0 && (h += L, yield J()), T.type)
811
+ switch (T.type) {
782
812
  case "source-document":
783
- v.sourceId && _.push({
784
- sourceId: v.sourceId,
785
- filename: v.title || "Unknown",
813
+ T.sourceId && z.push({
814
+ sourceId: T.sourceId,
815
+ filename: T.title || "Unknown",
786
816
  score: 1
787
817
  });
788
818
  continue;
789
819
  case "reasoning-start":
790
820
  continue;
791
821
  case "reasoning-delta":
792
- v.delta && (N += v.delta), (A || N) && (yield q());
822
+ T.delta && (h += T.delta), (A || h) && (yield J());
793
823
  continue;
794
824
  case "reasoning-end":
795
- (A || N) && (yield q());
825
+ (A || h) && (yield J());
796
826
  continue;
797
827
  case "text-delta":
798
- v.delta && (N && !W && !A && (W = !0, await new Promise((P) => setTimeout(P, 400))), A += v.delta), A && (yield q());
828
+ T.delta && (h && !K && !A && (K = !0, await new Promise((S) => setTimeout(S, 400))), A += T.delta), A && (yield J());
799
829
  continue;
800
830
  case "error":
801
- throw new Error(v.errorText || "Stream error");
831
+ throw new Error(T.errorText || "Stream error");
802
832
  case "text-start":
803
833
  case "text-end":
804
834
  case "start":
@@ -807,18 +837,18 @@ function Vt(e, r) {
807
837
  case "finish":
808
838
  continue;
809
839
  }
810
- const ee = v.delta;
811
- if (ee != null && (N && !W && !A && (W = !0, await new Promise((P) => setTimeout(P, 400))), A += ee), v.content && (A += v.content), v.message && (A += v.message.content || ""), v.finished) {
812
- (A || N || _.length > 0) && (yield q());
840
+ const H = T.delta;
841
+ if (H != null && (h && !K && !A && (K = !0, await new Promise((S) => setTimeout(S, 400))), A += H), T.content && (A += T.content), T.message && (A += T.message.content || ""), T.finished) {
842
+ (A || h || z.length > 0) && (yield J());
813
843
  break;
814
844
  }
815
- (A || N || _.length > 0) && (yield q());
845
+ (A || h || z.length > 0) && (yield J());
816
846
  }
817
- (A || N || _.length > 0) && (yield q());
847
+ (A || h || z.length > 0) && (yield J());
818
848
  }
819
849
  };
820
850
  }
821
- function Xt() {
851
+ function Qt() {
822
852
  return {
823
853
  accept: ".pdf,.docx,.txt,.md,.csv,.json,image/*",
824
854
  async add({ file: e }) {
@@ -859,7 +889,7 @@ function Xt() {
859
889
  }
860
890
  };
861
891
  }
862
- function Aa({
892
+ function Na({
863
893
  children: e,
864
894
  baseUrl: r,
865
895
  sessionToken: t,
@@ -867,9 +897,9 @@ function Aa({
867
897
  mode: i = "multiChat",
868
898
  modelId: o,
869
899
  onModelChange: n,
870
- ephemeral: u = !1,
900
+ ephemeral: s = !1,
871
901
  systemPrompt: c,
872
- enableReasoning: s = !1,
902
+ enableReasoning: u = !1,
873
903
  initialThreadId: f,
874
904
  onError: l,
875
905
  onChatCreated: p,
@@ -877,70 +907,73 @@ function Aa({
877
907
  onThreadIdUpdate: m,
878
908
  onChatsLoaded: x,
879
909
  enableAttachments: b = !1,
880
- onBeforeRequest: y
910
+ onBeforeRequest: y,
911
+ mockResponseOnBlocked: k
881
912
  }) {
882
- const k = V(
883
- () => new Ht(r, t || void 0, a),
913
+ const v = Q(
914
+ () => new Vt(r, t || void 0, a),
884
915
  [r, t, a]
885
- ), [T, L] = R(o || null);
916
+ ), [P, I] = R(o || null);
886
917
  O(() => {
887
- o && L(o);
918
+ o && I(o);
888
919
  }, [o]);
889
- const I = X(
920
+ const C = G(
890
921
  (A) => {
891
922
  p?.(A);
892
923
  },
893
924
  [p]
894
- ), C = X(
895
- (A, N) => {
896
- m?.(A, N);
925
+ ), D = G(
926
+ (A, h) => {
927
+ m?.(A, h);
897
928
  },
898
929
  [m]
899
- ), D = V(() => Vt(k, {
900
- modelId: T || void 0,
930
+ ), E = Q(() => Kt(v, {
931
+ modelId: P || void 0,
901
932
  // Pass undefined if not set (backend resolves it)
902
933
  systemPrompt: c,
903
- ephemeral: u,
904
- enableReasoning: s,
905
- onChatCreated: I,
934
+ ephemeral: s,
935
+ enableReasoning: u,
936
+ onChatCreated: C,
906
937
  onUserMessage: g,
907
- onBeforeRequest: y
908
- }), [k, T, c, u, s, I, g, y]);
909
- return i === "singleChat" ? /* @__PURE__ */ d(Na, { modelAdapter: D, enableAttachments: b, children: e }) : /* @__PURE__ */ d(
910
- Ia,
938
+ onBeforeRequest: y,
939
+ mockResponseOnBlocked: k
940
+ }), [v, P, c, s, u, C, g, y, k]);
941
+ return i === "singleChat" ? /* @__PURE__ */ d(Ia, { modelAdapter: E, enableAttachments: b, children: e }) : /* @__PURE__ */ d(
942
+ Sa,
911
943
  {
912
- client: k,
944
+ client: v,
913
945
  modelAdapterOptions: {
914
- modelId: T || void 0,
946
+ modelId: P || void 0,
915
947
  systemPrompt: c,
916
- ephemeral: u,
917
- enableReasoning: s,
918
- onChatCreated: I,
948
+ ephemeral: s,
949
+ enableReasoning: u,
950
+ onChatCreated: C,
919
951
  onUserMessage: g,
920
- onBeforeRequest: y
952
+ onBeforeRequest: y,
953
+ mockResponseOnBlocked: k
921
954
  },
922
955
  initialThreadId: f,
923
956
  onChatsLoaded: x,
924
- onThreadIdUpdate: C,
957
+ onThreadIdUpdate: D,
925
958
  onError: l,
926
959
  enableAttachments: b,
927
960
  children: e
928
961
  }
929
962
  );
930
963
  }
931
- function Na({
964
+ function Ia({
932
965
  modelAdapter: e,
933
966
  enableAttachments: r,
934
967
  children: t
935
968
  }) {
936
- const a = V(() => r ? Xt() : void 0, [r]), i = jt(e, {
969
+ const a = Q(() => r ? Qt() : void 0, [r]), i = Ot(e, {
937
970
  adapters: {
938
971
  ...a && { attachments: a }
939
972
  }
940
973
  });
941
- return /* @__PURE__ */ d($t, { runtime: i, children: t });
974
+ return /* @__PURE__ */ d(Ut, { runtime: i, children: t });
942
975
  }
943
- function Ia({
976
+ function Sa({
944
977
  client: e,
945
978
  modelAdapterOptions: r,
946
979
  initialThreadId: t,
@@ -948,16 +981,16 @@ function Ia({
948
981
  onThreadIdUpdate: i,
949
982
  onError: o,
950
983
  enableAttachments: n,
951
- children: u
984
+ children: s
952
985
  }) {
953
- const c = V(() => Ca(e, (x, b) => {
986
+ const c = Q(() => Ma(e, (x, b) => {
954
987
  i?.(x, b);
955
- }), [e, i]), s = X(
988
+ }), [e, i]), u = G(
956
989
  (x, b) => {
957
990
  c.updateRemoteId && c.updateRemoteId(x, b), i?.(x, b);
958
991
  },
959
992
  [c, i]
960
- ), f = V(() => ({
993
+ ), f = Q(() => ({
961
994
  ...c,
962
995
  async list() {
963
996
  const x = await c.list();
@@ -967,22 +1000,22 @@ function Ia({
967
1000
  O(() => {
968
1001
  window.__cuadraThreadListAdapter = f, window.__cuadraThreadListRuntime = null;
969
1002
  }, [f]);
970
- const l = V(() => Vt(e, {
1003
+ const l = Q(() => Kt(e, {
971
1004
  ...r,
972
- onThreadIdUpdate: s
973
- }), [e, r, s]), p = V(() => n ? Xt() : void 0, [n]), g = X(() => jt(l, {
1005
+ onThreadIdUpdate: u
1006
+ }), [e, r, u]), p = Q(() => n ? Qt() : void 0, [n]), g = G(() => Ot(l, {
974
1007
  adapters: {
975
1008
  ...p && { attachments: p }
976
1009
  }
977
- }), [l, p]), m = Er({
1010
+ }), [l, p]), m = zr({
978
1011
  adapter: f,
979
1012
  runtimeHook: g
980
1013
  });
981
1014
  return O(() => {
982
1015
  window.__cuadraThreadListRuntime = m;
983
- }, [m]), /* @__PURE__ */ d($t, { runtime: m, children: u });
1016
+ }, [m]), /* @__PURE__ */ d(Ut, { runtime: m, children: s });
984
1017
  }
985
- function Mt(e, r) {
1018
+ function Nt(e, r) {
986
1019
  const t = String(e);
987
1020
  if (typeof r != "string")
988
1021
  throw new TypeError("Expected character");
@@ -991,36 +1024,36 @@ function Mt(e, r) {
991
1024
  a++, i = t.indexOf(r, i + r.length);
992
1025
  return a;
993
1026
  }
994
- const ke = ze(/[A-Za-z]/), it = ze(/[\dA-Za-z]/);
995
- function Sa(e) {
1027
+ const Te = Be(/[A-Za-z]/), ut = Be(/[\dA-Za-z]/);
1028
+ function La(e) {
996
1029
  return (
997
1030
  // Special whitespace codes (which have negative values), C0 and Control
998
1031
  // character DEL
999
1032
  e !== null && (e < 32 || e === 127)
1000
1033
  );
1001
1034
  }
1002
- function fe(e) {
1035
+ function ge(e) {
1003
1036
  return e !== null && e < -2;
1004
1037
  }
1005
- function B(e) {
1038
+ function W(e) {
1006
1039
  return e !== null && (e < 0 || e === 32);
1007
1040
  }
1008
- function G(e) {
1041
+ function te(e) {
1009
1042
  return e === -2 || e === -1 || e === 32;
1010
1043
  }
1011
- const Fe = ze(/\p{P}|\p{S}/u), oe = ze(/\s/);
1012
- function ze(e) {
1044
+ const Ue = Be(/\p{P}|\p{S}/u), ue = Be(/\s/);
1045
+ function Be(e) {
1013
1046
  return r;
1014
1047
  function r(t) {
1015
1048
  return t !== null && t > -1 && e.test(String.fromCharCode(t));
1016
1049
  }
1017
1050
  }
1018
- function La(e) {
1051
+ function Pa(e) {
1019
1052
  if (typeof e != "string")
1020
1053
  throw new TypeError("Expected a string");
1021
1054
  return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
1022
1055
  }
1023
- const je = (
1056
+ const We = (
1024
1057
  // Note: overloads in JSDoc can’t yet use different `@template`s.
1025
1058
  /**
1026
1059
  * @type {(
@@ -1037,29 +1070,29 @@ const je = (
1037
1070
  */
1038
1071
  (function(e) {
1039
1072
  if (e == null)
1040
- return _a;
1073
+ return Ea;
1041
1074
  if (typeof e == "function")
1042
- return $e(e);
1075
+ return qe(e);
1043
1076
  if (typeof e == "object")
1044
- return Array.isArray(e) ? Pa(e) : (
1077
+ return Array.isArray(e) ? Ra(e) : (
1045
1078
  // Cast because `ReadonlyArray` goes into the above but `isArray`
1046
1079
  // narrows to `Array`.
1047
- Ra(
1080
+ Da(
1048
1081
  /** @type {Props} */
1049
1082
  e
1050
1083
  )
1051
1084
  );
1052
1085
  if (typeof e == "string")
1053
- return Da(e);
1086
+ return _a(e);
1054
1087
  throw new Error("Expected function, string, or object as test");
1055
1088
  })
1056
1089
  );
1057
- function Pa(e) {
1090
+ function Ra(e) {
1058
1091
  const r = [];
1059
1092
  let t = -1;
1060
1093
  for (; ++t < e.length; )
1061
- r[t] = je(e[t]);
1062
- return $e(a);
1094
+ r[t] = We(e[t]);
1095
+ return qe(a);
1063
1096
  function a(...i) {
1064
1097
  let o = -1;
1065
1098
  for (; ++o < r.length; )
@@ -1067,12 +1100,12 @@ function Pa(e) {
1067
1100
  return !1;
1068
1101
  }
1069
1102
  }
1070
- function Ra(e) {
1103
+ function Da(e) {
1071
1104
  const r = (
1072
1105
  /** @type {Record<string, unknown>} */
1073
1106
  e
1074
1107
  );
1075
- return $e(t);
1108
+ return qe(t);
1076
1109
  function t(a) {
1077
1110
  const i = (
1078
1111
  /** @type {Record<string, unknown>} */
@@ -1085,16 +1118,16 @@ function Ra(e) {
1085
1118
  return !0;
1086
1119
  }
1087
1120
  }
1088
- function Da(e) {
1089
- return $e(r);
1121
+ function _a(e) {
1122
+ return qe(r);
1090
1123
  function r(t) {
1091
1124
  return t && t.type === e;
1092
1125
  }
1093
1126
  }
1094
- function $e(e) {
1127
+ function qe(e) {
1095
1128
  return r;
1096
1129
  function r(t, a, i) {
1097
- return !!(Ea(t) && e.call(
1130
+ return !!(Fa(t) && e.call(
1098
1131
  this,
1099
1132
  t,
1100
1133
  typeof a == "number" ? a : void 0,
@@ -1102,19 +1135,19 @@ function $e(e) {
1102
1135
  ));
1103
1136
  }
1104
1137
  }
1105
- function _a() {
1138
+ function Ea() {
1106
1139
  return !0;
1107
1140
  }
1108
- function Ea(e) {
1141
+ function Fa(e) {
1109
1142
  return e !== null && typeof e == "object" && "type" in e;
1110
1143
  }
1111
- const Kt = [], Fa = !0, tt = !1, za = "skip";
1112
- function Qt(e, r, t, a) {
1144
+ const Gt = [], za = !0, it = !1, ja = "skip";
1145
+ function Zt(e, r, t, a) {
1113
1146
  let i;
1114
1147
  typeof r == "function" && typeof t != "function" ? (a = t, t = r) : i = r;
1115
- const o = je(i), n = a ? -1 : 1;
1116
- u(e, void 0, [])();
1117
- function u(c, s, f) {
1148
+ const o = We(i), n = a ? -1 : 1;
1149
+ s(e, void 0, [])();
1150
+ function s(c, u, f) {
1118
1151
  const l = (
1119
1152
  /** @type {Record<string, unknown>} */
1120
1153
  c && typeof c == "object" ? c : {}
@@ -1133,18 +1166,18 @@ function Qt(e, r, t, a) {
1133
1166
  }
1134
1167
  return p;
1135
1168
  function p() {
1136
- let g = Kt, m, x, b;
1137
- if ((!r || o(c, s, f[f.length - 1] || void 0)) && (g = ja(t(c, f)), g[0] === tt))
1169
+ let g = Gt, m, x, b;
1170
+ if ((!r || o(c, u, f[f.length - 1] || void 0)) && (g = $a(t(c, f)), g[0] === it))
1138
1171
  return g;
1139
1172
  if ("children" in c && c.children) {
1140
1173
  const y = (
1141
1174
  /** @type {UnistParent} */
1142
1175
  c
1143
1176
  );
1144
- if (y.children && g[0] !== za)
1177
+ if (y.children && g[0] !== ja)
1145
1178
  for (x = (a ? y.children.length : -1) + n, b = f.concat(y); x > -1 && x < y.children.length; ) {
1146
1179
  const k = y.children[x];
1147
- if (m = u(k, x, b)(), m[0] === tt)
1180
+ if (m = s(k, x, b)(), m[0] === it)
1148
1181
  return m;
1149
1182
  x = typeof m[1] == "number" ? m[1] : x + n;
1150
1183
  }
@@ -1153,15 +1186,15 @@ function Qt(e, r, t, a) {
1153
1186
  }
1154
1187
  }
1155
1188
  }
1156
- function ja(e) {
1157
- return Array.isArray(e) ? e : typeof e == "number" ? [Fa, e] : e == null ? Kt : [e];
1189
+ function $a(e) {
1190
+ return Array.isArray(e) ? e : typeof e == "number" ? [za, e] : e == null ? Gt : [e];
1158
1191
  }
1159
- function $a(e, r, t) {
1160
- const i = je((t || {}).ignore || []), o = Oa(r);
1192
+ function Oa(e, r, t) {
1193
+ const i = We((t || {}).ignore || []), o = Ua(r);
1161
1194
  let n = -1;
1162
1195
  for (; ++n < o.length; )
1163
- Qt(e, "text", u);
1164
- function u(s, f) {
1196
+ Zt(e, "text", s);
1197
+ function s(u, f) {
1165
1198
  let l = -1, p;
1166
1199
  for (; ++l < f.length; ) {
1167
1200
  const g = f[l], m = p ? p.children : void 0;
@@ -1174,33 +1207,33 @@ function $a(e, r, t) {
1174
1207
  p = g;
1175
1208
  }
1176
1209
  if (p)
1177
- return c(s, f);
1210
+ return c(u, f);
1178
1211
  }
1179
- function c(s, f) {
1212
+ function c(u, f) {
1180
1213
  const l = f[f.length - 1], p = o[n][0], g = o[n][1];
1181
1214
  let m = 0;
1182
- const b = l.children.indexOf(s);
1215
+ const b = l.children.indexOf(u);
1183
1216
  let y = !1, k = [];
1184
1217
  p.lastIndex = 0;
1185
- let T = p.exec(s.value);
1186
- for (; T; ) {
1187
- const L = T.index, I = {
1188
- index: T.index,
1189
- input: T.input,
1190
- stack: [...f, s]
1218
+ let v = p.exec(u.value);
1219
+ for (; v; ) {
1220
+ const P = v.index, I = {
1221
+ index: v.index,
1222
+ input: v.input,
1223
+ stack: [...f, u]
1191
1224
  };
1192
- let C = g(...T, I);
1193
- if (typeof C == "string" && (C = C.length > 0 ? { type: "text", value: C } : void 0), C === !1 ? p.lastIndex = L + 1 : (m !== L && k.push({
1225
+ let C = g(...v, I);
1226
+ if (typeof C == "string" && (C = C.length > 0 ? { type: "text", value: C } : void 0), C === !1 ? p.lastIndex = P + 1 : (m !== P && k.push({
1194
1227
  type: "text",
1195
- value: s.value.slice(m, L)
1196
- }), Array.isArray(C) ? k.push(...C) : C && k.push(C), m = L + T[0].length, y = !0), !p.global)
1228
+ value: u.value.slice(m, P)
1229
+ }), Array.isArray(C) ? k.push(...C) : C && k.push(C), m = P + v[0].length, y = !0), !p.global)
1197
1230
  break;
1198
- T = p.exec(s.value);
1231
+ v = p.exec(u.value);
1199
1232
  }
1200
- return y ? (m < s.value.length && k.push({ type: "text", value: s.value.slice(m) }), l.children.splice(b, 1, ...k)) : k = [s], b + k.length;
1233
+ return y ? (m < u.value.length && k.push({ type: "text", value: u.value.slice(m) }), l.children.splice(b, 1, ...k)) : k = [u], b + k.length;
1201
1234
  }
1202
1235
  }
1203
- function Oa(e) {
1236
+ function Ua(e) {
1204
1237
  const r = [];
1205
1238
  if (!Array.isArray(e))
1206
1239
  throw new TypeError("Expected find and replace tuple or list of tuples");
@@ -1208,33 +1241,33 @@ function Oa(e) {
1208
1241
  let a = -1;
1209
1242
  for (; ++a < t.length; ) {
1210
1243
  const i = t[a];
1211
- r.push([Ua(i[0]), Ba(i[1])]);
1244
+ r.push([Ba(i[0]), Wa(i[1])]);
1212
1245
  }
1213
1246
  return r;
1214
1247
  }
1215
- function Ua(e) {
1216
- return typeof e == "string" ? new RegExp(La(e), "g") : e;
1217
- }
1218
1248
  function Ba(e) {
1249
+ return typeof e == "string" ? new RegExp(Pa(e), "g") : e;
1250
+ }
1251
+ function Wa(e) {
1219
1252
  return typeof e == "function" ? e : function() {
1220
1253
  return e;
1221
1254
  };
1222
1255
  }
1223
- const Ve = "phrasing", Xe = ["autolink", "link", "image", "label"];
1224
- function Wa() {
1256
+ const Qe = "phrasing", Ge = ["autolink", "link", "image", "label"];
1257
+ function qa() {
1225
1258
  return {
1226
- transforms: [Ga],
1259
+ transforms: [Za],
1227
1260
  enter: {
1228
- literalAutolink: qa,
1229
- literalAutolinkEmail: Ke,
1230
- literalAutolinkHttp: Ke,
1231
- literalAutolinkWww: Ke
1261
+ literalAutolink: Va,
1262
+ literalAutolinkEmail: Ze,
1263
+ literalAutolinkHttp: Ze,
1264
+ literalAutolinkWww: Ze
1232
1265
  },
1233
1266
  exit: {
1234
- literalAutolink: Qa,
1235
- literalAutolinkEmail: Ka,
1236
- literalAutolinkHttp: Va,
1237
- literalAutolinkWww: Xa
1267
+ literalAutolink: Ga,
1268
+ literalAutolinkEmail: Qa,
1269
+ literalAutolinkHttp: Xa,
1270
+ literalAutolinkWww: Ka
1238
1271
  }
1239
1272
  };
1240
1273
  }
@@ -1245,74 +1278,74 @@ function Ha() {
1245
1278
  character: "@",
1246
1279
  before: "[+\\-.\\w]",
1247
1280
  after: "[\\-.\\w]",
1248
- inConstruct: Ve,
1249
- notInConstruct: Xe
1281
+ inConstruct: Qe,
1282
+ notInConstruct: Ge
1250
1283
  },
1251
1284
  {
1252
1285
  character: ".",
1253
1286
  before: "[Ww]",
1254
1287
  after: "[\\-.\\w]",
1255
- inConstruct: Ve,
1256
- notInConstruct: Xe
1288
+ inConstruct: Qe,
1289
+ notInConstruct: Ge
1257
1290
  },
1258
1291
  {
1259
1292
  character: ":",
1260
1293
  before: "[ps]",
1261
1294
  after: "\\/",
1262
- inConstruct: Ve,
1263
- notInConstruct: Xe
1295
+ inConstruct: Qe,
1296
+ notInConstruct: Ge
1264
1297
  }
1265
1298
  ]
1266
1299
  };
1267
1300
  }
1268
- function qa(e) {
1301
+ function Va(e) {
1269
1302
  this.enter({ type: "link", title: null, url: "", children: [] }, e);
1270
1303
  }
1271
- function Ke(e) {
1304
+ function Ze(e) {
1272
1305
  this.config.enter.autolinkProtocol.call(this, e);
1273
1306
  }
1274
- function Va(e) {
1307
+ function Xa(e) {
1275
1308
  this.config.exit.autolinkProtocol.call(this, e);
1276
1309
  }
1277
- function Xa(e) {
1310
+ function Ka(e) {
1278
1311
  this.config.exit.data.call(this, e);
1279
1312
  const r = this.stack[this.stack.length - 1];
1280
1313
  r.type, r.url = "http://" + this.sliceSerialize(e);
1281
1314
  }
1282
- function Ka(e) {
1315
+ function Qa(e) {
1283
1316
  this.config.exit.autolinkEmail.call(this, e);
1284
1317
  }
1285
- function Qa(e) {
1318
+ function Ga(e) {
1286
1319
  this.exit(e);
1287
1320
  }
1288
- function Ga(e) {
1289
- $a(
1321
+ function Za(e) {
1322
+ Oa(
1290
1323
  e,
1291
1324
  [
1292
- [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Za],
1293
- [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Ja]
1325
+ [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Ja],
1326
+ [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Ya]
1294
1327
  ],
1295
1328
  { ignore: ["link", "linkReference"] }
1296
1329
  );
1297
1330
  }
1298
- function Za(e, r, t, a, i) {
1331
+ function Ja(e, r, t, a, i) {
1299
1332
  let o = "";
1300
- if (!Gt(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !Ya(t)))
1333
+ if (!Jt(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !en(t)))
1301
1334
  return !1;
1302
- const n = en(t + a);
1335
+ const n = tn(t + a);
1303
1336
  if (!n[0]) return !1;
1304
- const u = {
1337
+ const s = {
1305
1338
  type: "link",
1306
1339
  title: null,
1307
1340
  url: o + r + n[0],
1308
1341
  children: [{ type: "text", value: r + n[0] }]
1309
1342
  };
1310
- return n[1] ? [u, { type: "text", value: n[1] }] : u;
1343
+ return n[1] ? [s, { type: "text", value: n[1] }] : s;
1311
1344
  }
1312
- function Ja(e, r, t, a) {
1345
+ function Ya(e, r, t, a) {
1313
1346
  return (
1314
1347
  // Not an expected previous character.
1315
- !Gt(a, !0) || // Label ends in not allowed character.
1348
+ !Jt(a, !0) || // Label ends in not allowed character.
1316
1349
  /[-\d_]$/.test(t) ? !1 : {
1317
1350
  type: "link",
1318
1351
  title: null,
@@ -1321,120 +1354,120 @@ function Ja(e, r, t, a) {
1321
1354
  }
1322
1355
  );
1323
1356
  }
1324
- function Ya(e) {
1357
+ function en(e) {
1325
1358
  const r = e.split(".");
1326
1359
  return !(r.length < 2 || r[r.length - 1] && (/_/.test(r[r.length - 1]) || !/[a-zA-Z\d]/.test(r[r.length - 1])) || r[r.length - 2] && (/_/.test(r[r.length - 2]) || !/[a-zA-Z\d]/.test(r[r.length - 2])));
1327
1360
  }
1328
- function en(e) {
1361
+ function tn(e) {
1329
1362
  const r = /[!"&'),.:;<>?\]}]+$/.exec(e);
1330
1363
  if (!r)
1331
1364
  return [e, void 0];
1332
1365
  e = e.slice(0, r.index);
1333
1366
  let t = r[0], a = t.indexOf(")");
1334
- const i = Mt(e, "(");
1335
- let o = Mt(e, ")");
1367
+ const i = Nt(e, "(");
1368
+ let o = Nt(e, ")");
1336
1369
  for (; a !== -1 && i > o; )
1337
1370
  e += t.slice(0, a + 1), t = t.slice(a + 1), a = t.indexOf(")"), o++;
1338
1371
  return [e, t];
1339
1372
  }
1340
- function Gt(e, r) {
1373
+ function Jt(e, r) {
1341
1374
  const t = e.input.charCodeAt(e.index - 1);
1342
- return (e.index === 0 || oe(t) || Fe(t)) && // If it’s an email, the previous character should not be a slash.
1375
+ return (e.index === 0 || ue(t) || Ue(t)) && // If it’s an email, the previous character should not be a slash.
1343
1376
  (!r || t !== 47);
1344
1377
  }
1345
- function Ce(e) {
1378
+ function Ne(e) {
1346
1379
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
1347
1380
  }
1348
- Zt.peek = ln;
1349
- function tn() {
1381
+ Yt.peek = dn;
1382
+ function rn() {
1350
1383
  this.buffer();
1351
1384
  }
1352
- function rn(e) {
1385
+ function an(e) {
1353
1386
  this.enter({ type: "footnoteReference", identifier: "", label: "" }, e);
1354
1387
  }
1355
- function an() {
1388
+ function nn() {
1356
1389
  this.buffer();
1357
1390
  }
1358
- function nn(e) {
1391
+ function on(e) {
1359
1392
  this.enter(
1360
1393
  { type: "footnoteDefinition", identifier: "", label: "", children: [] },
1361
1394
  e
1362
1395
  );
1363
1396
  }
1364
- function on(e) {
1397
+ function cn(e) {
1365
1398
  const r = this.resume(), t = this.stack[this.stack.length - 1];
1366
- t.type, t.identifier = Ce(
1399
+ t.type, t.identifier = Ne(
1367
1400
  this.sliceSerialize(e)
1368
1401
  ).toLowerCase(), t.label = r;
1369
1402
  }
1370
- function cn(e) {
1403
+ function sn(e) {
1371
1404
  this.exit(e);
1372
1405
  }
1373
1406
  function un(e) {
1374
1407
  const r = this.resume(), t = this.stack[this.stack.length - 1];
1375
- t.type, t.identifier = Ce(
1408
+ t.type, t.identifier = Ne(
1376
1409
  this.sliceSerialize(e)
1377
1410
  ).toLowerCase(), t.label = r;
1378
1411
  }
1379
- function sn(e) {
1412
+ function ln(e) {
1380
1413
  this.exit(e);
1381
1414
  }
1382
- function ln() {
1415
+ function dn() {
1383
1416
  return "[";
1384
1417
  }
1385
- function Zt(e, r, t, a) {
1418
+ function Yt(e, r, t, a) {
1386
1419
  const i = t.createTracker(a);
1387
1420
  let o = i.move("[^");
1388
- const n = t.enter("footnoteReference"), u = t.enter("reference");
1421
+ const n = t.enter("footnoteReference"), s = t.enter("reference");
1389
1422
  return o += i.move(
1390
1423
  t.safe(t.associationId(e), { after: "]", before: o })
1391
- ), u(), n(), o += i.move("]"), o;
1424
+ ), s(), n(), o += i.move("]"), o;
1392
1425
  }
1393
- function dn() {
1426
+ function fn() {
1394
1427
  return {
1395
1428
  enter: {
1396
- gfmFootnoteCallString: tn,
1397
- gfmFootnoteCall: rn,
1398
- gfmFootnoteDefinitionLabelString: an,
1399
- gfmFootnoteDefinition: nn
1429
+ gfmFootnoteCallString: rn,
1430
+ gfmFootnoteCall: an,
1431
+ gfmFootnoteDefinitionLabelString: nn,
1432
+ gfmFootnoteDefinition: on
1400
1433
  },
1401
1434
  exit: {
1402
- gfmFootnoteCallString: on,
1403
- gfmFootnoteCall: cn,
1435
+ gfmFootnoteCallString: cn,
1436
+ gfmFootnoteCall: sn,
1404
1437
  gfmFootnoteDefinitionLabelString: un,
1405
- gfmFootnoteDefinition: sn
1438
+ gfmFootnoteDefinition: ln
1406
1439
  }
1407
1440
  };
1408
1441
  }
1409
- function fn(e) {
1442
+ function hn(e) {
1410
1443
  let r = !1;
1411
1444
  return e && e.firstLineBlank && (r = !0), {
1412
- handlers: { footnoteDefinition: t, footnoteReference: Zt },
1445
+ handlers: { footnoteDefinition: t, footnoteReference: Yt },
1413
1446
  // This is on by default already.
1414
1447
  unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
1415
1448
  };
1416
1449
  function t(a, i, o, n) {
1417
- const u = o.createTracker(n);
1418
- let c = u.move("[^");
1419
- const s = o.enter("footnoteDefinition"), f = o.enter("label");
1420
- return c += u.move(
1450
+ const s = o.createTracker(n);
1451
+ let c = s.move("[^");
1452
+ const u = o.enter("footnoteDefinition"), f = o.enter("label");
1453
+ return c += s.move(
1421
1454
  o.safe(o.associationId(a), { before: c, after: "]" })
1422
- ), f(), c += u.move("]:"), a.children && a.children.length > 0 && (u.shift(4), c += u.move(
1455
+ ), f(), c += s.move("]:"), a.children && a.children.length > 0 && (s.shift(4), c += s.move(
1423
1456
  (r ? `
1424
1457
  ` : " ") + o.indentLines(
1425
- o.containerFlow(a, u.current()),
1426
- r ? Jt : hn
1458
+ o.containerFlow(a, s.current()),
1459
+ r ? er : mn
1427
1460
  )
1428
- )), s(), c;
1461
+ )), u(), c;
1429
1462
  }
1430
1463
  }
1431
- function hn(e, r, t) {
1432
- return r === 0 ? e : Jt(e, r, t);
1464
+ function mn(e, r, t) {
1465
+ return r === 0 ? e : er(e, r, t);
1433
1466
  }
1434
- function Jt(e, r, t) {
1467
+ function er(e, r, t) {
1435
1468
  return (t ? "" : " ") + e;
1436
1469
  }
1437
- const mn = [
1470
+ const pn = [
1438
1471
  "autolink",
1439
1472
  "destinationLiteral",
1440
1473
  "destinationRaw",
@@ -1442,33 +1475,33 @@ const mn = [
1442
1475
  "titleQuote",
1443
1476
  "titleApostrophe"
1444
1477
  ];
1445
- Yt.peek = xn;
1446
- function pn() {
1478
+ tr.peek = kn;
1479
+ function gn() {
1447
1480
  return {
1448
1481
  canContainEols: ["delete"],
1449
- enter: { strikethrough: bn },
1450
- exit: { strikethrough: yn }
1482
+ enter: { strikethrough: yn },
1483
+ exit: { strikethrough: xn }
1451
1484
  };
1452
1485
  }
1453
- function gn() {
1486
+ function bn() {
1454
1487
  return {
1455
1488
  unsafe: [
1456
1489
  {
1457
1490
  character: "~",
1458
1491
  inConstruct: "phrasing",
1459
- notInConstruct: mn
1492
+ notInConstruct: pn
1460
1493
  }
1461
1494
  ],
1462
- handlers: { delete: Yt }
1495
+ handlers: { delete: tr }
1463
1496
  };
1464
1497
  }
1465
- function bn(e) {
1498
+ function yn(e) {
1466
1499
  this.enter({ type: "delete", children: [] }, e);
1467
1500
  }
1468
- function yn(e) {
1501
+ function xn(e) {
1469
1502
  this.exit(e);
1470
1503
  }
1471
- function Yt(e, r, t, a) {
1504
+ function tr(e, r, t, a) {
1472
1505
  const i = t.createTracker(a), o = t.enter("strikethrough");
1473
1506
  let n = i.move("~~");
1474
1507
  return n += t.containerPhrasing(e, {
@@ -1477,40 +1510,40 @@ function Yt(e, r, t, a) {
1477
1510
  after: "~"
1478
1511
  }), n += i.move("~~"), o(), n;
1479
1512
  }
1480
- function xn() {
1513
+ function kn() {
1481
1514
  return "~";
1482
1515
  }
1483
- function kn(e) {
1516
+ function wn(e) {
1484
1517
  return e.length;
1485
1518
  }
1486
- function wn(e, r) {
1487
- const t = r || {}, a = (t.align || []).concat(), i = t.stringLength || kn, o = [], n = [], u = [], c = [];
1488
- let s = 0, f = -1;
1519
+ function vn(e, r) {
1520
+ const t = r || {}, a = (t.align || []).concat(), i = t.stringLength || wn, o = [], n = [], s = [], c = [];
1521
+ let u = 0, f = -1;
1489
1522
  for (; ++f < e.length; ) {
1490
1523
  const x = [], b = [];
1491
1524
  let y = -1;
1492
- for (e[f].length > s && (s = e[f].length); ++y < e[f].length; ) {
1493
- const k = vn(e[f][y]);
1525
+ for (e[f].length > u && (u = e[f].length); ++y < e[f].length; ) {
1526
+ const k = Cn(e[f][y]);
1494
1527
  if (t.alignDelimiters !== !1) {
1495
- const T = i(k);
1496
- b[y] = T, (c[y] === void 0 || T > c[y]) && (c[y] = T);
1528
+ const v = i(k);
1529
+ b[y] = v, (c[y] === void 0 || v > c[y]) && (c[y] = v);
1497
1530
  }
1498
1531
  x.push(k);
1499
1532
  }
1500
- n[f] = x, u[f] = b;
1533
+ n[f] = x, s[f] = b;
1501
1534
  }
1502
1535
  let l = -1;
1503
1536
  if (typeof a == "object" && "length" in a)
1504
- for (; ++l < s; )
1505
- o[l] = At(a[l]);
1537
+ for (; ++l < u; )
1538
+ o[l] = It(a[l]);
1506
1539
  else {
1507
- const x = At(a);
1508
- for (; ++l < s; )
1540
+ const x = It(a);
1541
+ for (; ++l < u; )
1509
1542
  o[l] = x;
1510
1543
  }
1511
1544
  l = -1;
1512
1545
  const p = [], g = [];
1513
- for (; ++l < s; ) {
1546
+ for (; ++l < u; ) {
1514
1547
  const x = o[l];
1515
1548
  let b = "", y = "";
1516
1549
  x === 99 ? (b = ":", y = ":") : x === 108 ? b = ":" : x === 114 && (y = ":");
@@ -1518,25 +1551,25 @@ function wn(e, r) {
1518
1551
  1,
1519
1552
  c[l] - b.length - y.length
1520
1553
  );
1521
- const T = b + "-".repeat(k) + y;
1522
- t.alignDelimiters !== !1 && (k = b.length + k + y.length, k > c[l] && (c[l] = k), g[l] = k), p[l] = T;
1554
+ const v = b + "-".repeat(k) + y;
1555
+ t.alignDelimiters !== !1 && (k = b.length + k + y.length, k > c[l] && (c[l] = k), g[l] = k), p[l] = v;
1523
1556
  }
1524
- n.splice(1, 0, p), u.splice(1, 0, g), f = -1;
1557
+ n.splice(1, 0, p), s.splice(1, 0, g), f = -1;
1525
1558
  const m = [];
1526
1559
  for (; ++f < n.length; ) {
1527
- const x = n[f], b = u[f];
1560
+ const x = n[f], b = s[f];
1528
1561
  l = -1;
1529
1562
  const y = [];
1530
- for (; ++l < s; ) {
1563
+ for (; ++l < u; ) {
1531
1564
  const k = x[l] || "";
1532
- let T = "", L = "";
1565
+ let v = "", P = "";
1533
1566
  if (t.alignDelimiters !== !1) {
1534
1567
  const I = c[l] - (b[l] || 0), C = o[l];
1535
- C === 114 ? T = " ".repeat(I) : C === 99 ? I % 2 ? (T = " ".repeat(I / 2 + 0.5), L = " ".repeat(I / 2 - 0.5)) : (T = " ".repeat(I / 2), L = T) : L = " ".repeat(I);
1568
+ C === 114 ? v = " ".repeat(I) : C === 99 ? I % 2 ? (v = " ".repeat(I / 2 + 0.5), P = " ".repeat(I / 2 - 0.5)) : (v = " ".repeat(I / 2), P = v) : P = " ".repeat(I);
1536
1569
  }
1537
1570
  t.delimiterStart !== !1 && !l && y.push("|"), t.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
1538
1571
  // empty: there will be a closing space.
1539
- !(t.alignDelimiters === !1 && k === "") && (t.delimiterStart !== !1 || l) && y.push(" "), t.alignDelimiters !== !1 && y.push(T), y.push(k), t.alignDelimiters !== !1 && y.push(L), t.padding !== !1 && y.push(" "), (t.delimiterEnd !== !1 || l !== s - 1) && y.push("|");
1572
+ !(t.alignDelimiters === !1 && k === "") && (t.delimiterStart !== !1 || l) && y.push(" "), t.alignDelimiters !== !1 && y.push(v), y.push(k), t.alignDelimiters !== !1 && y.push(P), t.padding !== !1 && y.push(" "), (t.delimiterEnd !== !1 || l !== u - 1) && y.push("|");
1540
1573
  }
1541
1574
  m.push(
1542
1575
  t.delimiterEnd === !1 ? y.join("").replace(/ +$/, "") : y.join("")
@@ -1545,29 +1578,29 @@ function wn(e, r) {
1545
1578
  return m.join(`
1546
1579
  `);
1547
1580
  }
1548
- function vn(e) {
1581
+ function Cn(e) {
1549
1582
  return e == null ? "" : String(e);
1550
1583
  }
1551
- function At(e) {
1584
+ function It(e) {
1552
1585
  const r = typeof e == "string" ? e.codePointAt(0) : 0;
1553
1586
  return r === 67 || r === 99 ? 99 : r === 76 || r === 108 ? 108 : r === 82 || r === 114 ? 114 : 0;
1554
1587
  }
1555
- function Cn(e, r, t, a) {
1588
+ function Tn(e, r, t, a) {
1556
1589
  const i = t.enter("blockquote"), o = t.createTracker(a);
1557
1590
  o.move("> "), o.shift(2);
1558
1591
  const n = t.indentLines(
1559
1592
  t.containerFlow(e, o.current()),
1560
- Tn
1593
+ Mn
1561
1594
  );
1562
1595
  return i(), n;
1563
1596
  }
1564
- function Tn(e, r, t) {
1597
+ function Mn(e, r, t) {
1565
1598
  return ">" + (t ? "" : " ") + e;
1566
1599
  }
1567
- function Mn(e, r) {
1568
- return Nt(e, r.inConstruct, !0) && !Nt(e, r.notInConstruct, !1);
1600
+ function An(e, r) {
1601
+ return St(e, r.inConstruct, !0) && !St(e, r.notInConstruct, !1);
1569
1602
  }
1570
- function Nt(e, r, t) {
1603
+ function St(e, r, t) {
1571
1604
  if (typeof r == "string" && (r = [r]), !r || r.length === 0)
1572
1605
  return t;
1573
1606
  let a = -1;
@@ -1576,16 +1609,16 @@ function Nt(e, r, t) {
1576
1609
  return !0;
1577
1610
  return !1;
1578
1611
  }
1579
- function It(e, r, t, a) {
1612
+ function Lt(e, r, t, a) {
1580
1613
  let i = -1;
1581
1614
  for (; ++i < t.unsafe.length; )
1582
1615
  if (t.unsafe[i].character === `
1583
- ` && Mn(t.stack, t.unsafe[i]))
1616
+ ` && An(t.stack, t.unsafe[i]))
1584
1617
  return /[ \t]/.test(a.before) ? "" : " ";
1585
1618
  return `\\
1586
1619
  `;
1587
1620
  }
1588
- function An(e, r) {
1621
+ function Nn(e, r) {
1589
1622
  const t = String(e);
1590
1623
  let a = t.indexOf(r), i = a, o = 0, n = 0;
1591
1624
  if (typeof r != "string")
@@ -1594,13 +1627,13 @@ function An(e, r) {
1594
1627
  a === i ? ++o > n && (n = o) : o = 1, i = a + r.length, a = t.indexOf(r, i);
1595
1628
  return n;
1596
1629
  }
1597
- function Nn(e, r) {
1630
+ function In(e, r) {
1598
1631
  return !!(r.options.fences === !1 && e.value && // If there’s no info…
1599
1632
  !e.lang && // And there’s a non-whitespace character…
1600
1633
  /[^ \r\n]/.test(e.value) && // And the value doesn’t start or end in a blank…
1601
1634
  !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value));
1602
1635
  }
1603
- function In(e) {
1636
+ function Sn(e) {
1604
1637
  const r = e.options.fence || "`";
1605
1638
  if (r !== "`" && r !== "~")
1606
1639
  throw new Error(
@@ -1608,45 +1641,45 @@ function In(e) {
1608
1641
  );
1609
1642
  return r;
1610
1643
  }
1611
- function Sn(e, r, t, a) {
1612
- const i = In(t), o = e.value || "", n = i === "`" ? "GraveAccent" : "Tilde";
1613
- if (Nn(e, t)) {
1614
- const l = t.enter("codeIndented"), p = t.indentLines(o, Ln);
1644
+ function Ln(e, r, t, a) {
1645
+ const i = Sn(t), o = e.value || "", n = i === "`" ? "GraveAccent" : "Tilde";
1646
+ if (In(e, t)) {
1647
+ const l = t.enter("codeIndented"), p = t.indentLines(o, Pn);
1615
1648
  return l(), p;
1616
1649
  }
1617
- const u = t.createTracker(a), c = i.repeat(Math.max(An(o, i) + 1, 3)), s = t.enter("codeFenced");
1618
- let f = u.move(c);
1650
+ const s = t.createTracker(a), c = i.repeat(Math.max(Nn(o, i) + 1, 3)), u = t.enter("codeFenced");
1651
+ let f = s.move(c);
1619
1652
  if (e.lang) {
1620
1653
  const l = t.enter(`codeFencedLang${n}`);
1621
- f += u.move(
1654
+ f += s.move(
1622
1655
  t.safe(e.lang, {
1623
1656
  before: f,
1624
1657
  after: " ",
1625
1658
  encode: ["`"],
1626
- ...u.current()
1659
+ ...s.current()
1627
1660
  })
1628
1661
  ), l();
1629
1662
  }
1630
1663
  if (e.lang && e.meta) {
1631
1664
  const l = t.enter(`codeFencedMeta${n}`);
1632
- f += u.move(" "), f += u.move(
1665
+ f += s.move(" "), f += s.move(
1633
1666
  t.safe(e.meta, {
1634
1667
  before: f,
1635
1668
  after: `
1636
1669
  `,
1637
1670
  encode: ["`"],
1638
- ...u.current()
1671
+ ...s.current()
1639
1672
  })
1640
1673
  ), l();
1641
1674
  }
1642
- return f += u.move(`
1643
- `), o && (f += u.move(o + `
1644
- `)), f += u.move(c), s(), f;
1675
+ return f += s.move(`
1676
+ `), o && (f += s.move(o + `
1677
+ `)), f += s.move(c), u(), f;
1645
1678
  }
1646
- function Ln(e, r, t) {
1679
+ function Pn(e, r, t) {
1647
1680
  return (t ? "" : " ") + e;
1648
1681
  }
1649
- function ot(e) {
1682
+ function lt(e) {
1650
1683
  const r = e.options.quote || '"';
1651
1684
  if (r !== '"' && r !== "'")
1652
1685
  throw new Error(
@@ -1654,37 +1687,37 @@ function ot(e) {
1654
1687
  );
1655
1688
  return r;
1656
1689
  }
1657
- function Pn(e, r, t, a) {
1658
- const i = ot(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("definition");
1659
- let u = t.enter("label");
1690
+ function Rn(e, r, t, a) {
1691
+ const i = lt(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("definition");
1692
+ let s = t.enter("label");
1660
1693
  const c = t.createTracker(a);
1661
- let s = c.move("[");
1662
- return s += c.move(
1694
+ let u = c.move("[");
1695
+ return u += c.move(
1663
1696
  t.safe(t.associationId(e), {
1664
- before: s,
1697
+ before: u,
1665
1698
  after: "]",
1666
1699
  ...c.current()
1667
1700
  })
1668
- ), s += c.move("]: "), u(), // If there’s no url, or…
1701
+ ), u += c.move("]: "), s(), // If there’s no url, or…
1669
1702
  !e.url || // If there are control characters or whitespace.
1670
- /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), s += c.move("<"), s += c.move(
1671
- t.safe(e.url, { before: s, after: ">", ...c.current() })
1672
- ), s += c.move(">")) : (u = t.enter("destinationRaw"), s += c.move(
1703
+ /[\0- \u007F]/.test(e.url) ? (s = t.enter("destinationLiteral"), u += c.move("<"), u += c.move(
1704
+ t.safe(e.url, { before: u, after: ">", ...c.current() })
1705
+ ), u += c.move(">")) : (s = t.enter("destinationRaw"), u += c.move(
1673
1706
  t.safe(e.url, {
1674
- before: s,
1707
+ before: u,
1675
1708
  after: e.title ? " " : `
1676
1709
  `,
1677
1710
  ...c.current()
1678
1711
  })
1679
- )), u(), e.title && (u = t.enter(`title${o}`), s += c.move(" " + i), s += c.move(
1712
+ )), s(), e.title && (s = t.enter(`title${o}`), u += c.move(" " + i), u += c.move(
1680
1713
  t.safe(e.title, {
1681
- before: s,
1714
+ before: u,
1682
1715
  after: i,
1683
1716
  ...c.current()
1684
1717
  })
1685
- ), s += c.move(i), u()), n(), s;
1718
+ ), u += c.move(i), s()), n(), u;
1686
1719
  }
1687
- function Rn(e) {
1720
+ function Dn(e) {
1688
1721
  const r = e.options.emphasis || "*";
1689
1722
  if (r !== "*" && r !== "_")
1690
1723
  throw new Error(
@@ -1692,17 +1725,17 @@ function Rn(e) {
1692
1725
  );
1693
1726
  return r;
1694
1727
  }
1695
- function we(e) {
1728
+ function Me(e) {
1696
1729
  return "&#x" + e.toString(16).toUpperCase() + ";";
1697
1730
  }
1698
- function _e(e) {
1699
- if (e === null || B(e) || oe(e))
1731
+ function $e(e) {
1732
+ if (e === null || W(e) || ue(e))
1700
1733
  return 1;
1701
- if (Fe(e))
1734
+ if (Ue(e))
1702
1735
  return 2;
1703
1736
  }
1704
- function Ee(e, r, t) {
1705
- const a = _e(e), i = _e(r);
1737
+ function Oe(e, r, t) {
1738
+ const a = $e(e), i = $e(r);
1706
1739
  return a === void 0 ? i === void 0 ? (
1707
1740
  // Letter inside:
1708
1741
  // we have to encode *both* letters for `_` as it is looser.
@@ -1734,77 +1767,77 @@ function Ee(e, r, t) {
1734
1767
  { inside: !1, outside: !1 }
1735
1768
  );
1736
1769
  }
1737
- er.peek = Dn;
1738
- function er(e, r, t, a) {
1739
- const i = Rn(t), o = t.enter("emphasis"), n = t.createTracker(a), u = n.move(i);
1770
+ rr.peek = _n;
1771
+ function rr(e, r, t, a) {
1772
+ const i = Dn(t), o = t.enter("emphasis"), n = t.createTracker(a), s = n.move(i);
1740
1773
  let c = n.move(
1741
1774
  t.containerPhrasing(e, {
1742
1775
  after: i,
1743
- before: u,
1776
+ before: s,
1744
1777
  ...n.current()
1745
1778
  })
1746
1779
  );
1747
- const s = c.charCodeAt(0), f = Ee(
1780
+ const u = c.charCodeAt(0), f = Oe(
1748
1781
  a.before.charCodeAt(a.before.length - 1),
1749
- s,
1782
+ u,
1750
1783
  i
1751
1784
  );
1752
- f.inside && (c = we(s) + c.slice(1));
1753
- const l = c.charCodeAt(c.length - 1), p = Ee(a.after.charCodeAt(0), l, i);
1754
- p.inside && (c = c.slice(0, -1) + we(l));
1785
+ f.inside && (c = Me(u) + c.slice(1));
1786
+ const l = c.charCodeAt(c.length - 1), p = Oe(a.after.charCodeAt(0), l, i);
1787
+ p.inside && (c = c.slice(0, -1) + Me(l));
1755
1788
  const g = n.move(i);
1756
1789
  return o(), t.attentionEncodeSurroundingInfo = {
1757
1790
  after: p.outside,
1758
1791
  before: f.outside
1759
- }, u + c + g;
1792
+ }, s + c + g;
1760
1793
  }
1761
- function Dn(e, r, t) {
1794
+ function _n(e, r, t) {
1762
1795
  return t.options.emphasis || "*";
1763
1796
  }
1764
- function _n(e, r, t, a) {
1797
+ function En(e, r, t, a) {
1765
1798
  let i, o, n;
1766
- typeof r == "function" && typeof t != "function" ? (o = void 0, n = r, i = t) : (o = r, n = t, i = a), Qt(e, o, u, i);
1767
- function u(c, s) {
1768
- const f = s[s.length - 1], l = f ? f.children.indexOf(c) : void 0;
1799
+ typeof r == "function" && typeof t != "function" ? (o = void 0, n = r, i = t) : (o = r, n = t, i = a), Zt(e, o, s, i);
1800
+ function s(c, u) {
1801
+ const f = u[u.length - 1], l = f ? f.children.indexOf(c) : void 0;
1769
1802
  return n(c, l, f);
1770
1803
  }
1771
1804
  }
1772
- const En = {};
1773
- function tr(e, r) {
1774
- const t = En, a = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1775
- return rr(e, a, i);
1805
+ const Fn = {};
1806
+ function ar(e, r) {
1807
+ const t = Fn, a = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1808
+ return nr(e, a, i);
1776
1809
  }
1777
- function rr(e, r, t) {
1778
- if (Fn(e)) {
1810
+ function nr(e, r, t) {
1811
+ if (zn(e)) {
1779
1812
  if ("value" in e)
1780
1813
  return e.type === "html" && !t ? "" : e.value;
1781
1814
  if (r && "alt" in e && e.alt)
1782
1815
  return e.alt;
1783
1816
  if ("children" in e)
1784
- return St(e.children, r, t);
1817
+ return Pt(e.children, r, t);
1785
1818
  }
1786
- return Array.isArray(e) ? St(e, r, t) : "";
1819
+ return Array.isArray(e) ? Pt(e, r, t) : "";
1787
1820
  }
1788
- function St(e, r, t) {
1821
+ function Pt(e, r, t) {
1789
1822
  const a = [];
1790
1823
  let i = -1;
1791
1824
  for (; ++i < e.length; )
1792
- a[i] = rr(e[i], r, t);
1825
+ a[i] = nr(e[i], r, t);
1793
1826
  return a.join("");
1794
1827
  }
1795
- function Fn(e) {
1828
+ function zn(e) {
1796
1829
  return !!(e && typeof e == "object");
1797
1830
  }
1798
- function zn(e, r) {
1831
+ function jn(e, r) {
1799
1832
  let t = !1;
1800
- return _n(e, function(a) {
1833
+ return En(e, function(a) {
1801
1834
  if ("value" in a && /\r?\n|\r/.test(a.value) || a.type === "break")
1802
- return t = !0, tt;
1803
- }), !!((!e.depth || e.depth < 3) && tr(e) && (r.options.setext || t));
1835
+ return t = !0, it;
1836
+ }), !!((!e.depth || e.depth < 3) && ar(e) && (r.options.setext || t));
1804
1837
  }
1805
- function jn(e, r, t, a) {
1838
+ function $n(e, r, t, a) {
1806
1839
  const i = Math.max(Math.min(6, e.depth || 1), 1), o = t.createTracker(a);
1807
- if (zn(e, t)) {
1840
+ if (jn(e, t)) {
1808
1841
  const f = t.enter("headingSetext"), l = t.enter("phrasing"), p = t.containerPhrasing(e, {
1809
1842
  ...o.current(),
1810
1843
  before: `
@@ -1821,97 +1854,97 @@ function jn(e, r, t, a) {
1821
1854
  `)) + 1)
1822
1855
  );
1823
1856
  }
1824
- const n = "#".repeat(i), u = t.enter("headingAtx"), c = t.enter("phrasing");
1857
+ const n = "#".repeat(i), s = t.enter("headingAtx"), c = t.enter("phrasing");
1825
1858
  o.move(n + " ");
1826
- let s = t.containerPhrasing(e, {
1859
+ let u = t.containerPhrasing(e, {
1827
1860
  before: "# ",
1828
1861
  after: `
1829
1862
  `,
1830
1863
  ...o.current()
1831
1864
  });
1832
- return /^[\t ]/.test(s) && (s = we(s.charCodeAt(0)) + s.slice(1)), s = s ? n + " " + s : n, t.options.closeAtx && (s += " " + n), c(), u(), s;
1865
+ return /^[\t ]/.test(u) && (u = Me(u.charCodeAt(0)) + u.slice(1)), u = u ? n + " " + u : n, t.options.closeAtx && (u += " " + n), c(), s(), u;
1833
1866
  }
1834
- ar.peek = $n;
1835
- function ar(e) {
1867
+ ir.peek = On;
1868
+ function ir(e) {
1836
1869
  return e.value || "";
1837
1870
  }
1838
- function $n() {
1871
+ function On() {
1839
1872
  return "<";
1840
1873
  }
1841
- nr.peek = On;
1842
- function nr(e, r, t, a) {
1843
- const i = ot(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("image");
1844
- let u = t.enter("label");
1874
+ or.peek = Un;
1875
+ function or(e, r, t, a) {
1876
+ const i = lt(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("image");
1877
+ let s = t.enter("label");
1845
1878
  const c = t.createTracker(a);
1846
- let s = c.move("![");
1847
- return s += c.move(
1848
- t.safe(e.alt, { before: s, after: "]", ...c.current() })
1849
- ), s += c.move("]("), u(), // If there’s no url but there is a title…
1879
+ let u = c.move("![");
1880
+ return u += c.move(
1881
+ t.safe(e.alt, { before: u, after: "]", ...c.current() })
1882
+ ), u += c.move("]("), s(), // If there’s no url but there is a title…
1850
1883
  !e.url && e.title || // If there are control characters or whitespace.
1851
- /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), s += c.move("<"), s += c.move(
1852
- t.safe(e.url, { before: s, after: ">", ...c.current() })
1853
- ), s += c.move(">")) : (u = t.enter("destinationRaw"), s += c.move(
1884
+ /[\0- \u007F]/.test(e.url) ? (s = t.enter("destinationLiteral"), u += c.move("<"), u += c.move(
1885
+ t.safe(e.url, { before: u, after: ">", ...c.current() })
1886
+ ), u += c.move(">")) : (s = t.enter("destinationRaw"), u += c.move(
1854
1887
  t.safe(e.url, {
1855
- before: s,
1888
+ before: u,
1856
1889
  after: e.title ? " " : ")",
1857
1890
  ...c.current()
1858
1891
  })
1859
- )), u(), e.title && (u = t.enter(`title${o}`), s += c.move(" " + i), s += c.move(
1892
+ )), s(), e.title && (s = t.enter(`title${o}`), u += c.move(" " + i), u += c.move(
1860
1893
  t.safe(e.title, {
1861
- before: s,
1894
+ before: u,
1862
1895
  after: i,
1863
1896
  ...c.current()
1864
1897
  })
1865
- ), s += c.move(i), u()), s += c.move(")"), n(), s;
1898
+ ), u += c.move(i), s()), u += c.move(")"), n(), u;
1866
1899
  }
1867
- function On() {
1900
+ function Un() {
1868
1901
  return "!";
1869
1902
  }
1870
- ir.peek = Un;
1871
- function ir(e, r, t, a) {
1903
+ cr.peek = Bn;
1904
+ function cr(e, r, t, a) {
1872
1905
  const i = e.referenceType, o = t.enter("imageReference");
1873
1906
  let n = t.enter("label");
1874
- const u = t.createTracker(a);
1875
- let c = u.move("![");
1876
- const s = t.safe(e.alt, {
1907
+ const s = t.createTracker(a);
1908
+ let c = s.move("![");
1909
+ const u = t.safe(e.alt, {
1877
1910
  before: c,
1878
1911
  after: "]",
1879
- ...u.current()
1912
+ ...s.current()
1880
1913
  });
1881
- c += u.move(s + "]["), n();
1914
+ c += s.move(u + "]["), n();
1882
1915
  const f = t.stack;
1883
1916
  t.stack = [], n = t.enter("reference");
1884
1917
  const l = t.safe(t.associationId(e), {
1885
1918
  before: c,
1886
1919
  after: "]",
1887
- ...u.current()
1920
+ ...s.current()
1888
1921
  });
1889
- return n(), t.stack = f, o(), i === "full" || !s || s !== l ? c += u.move(l + "]") : i === "shortcut" ? c = c.slice(0, -1) : c += u.move("]"), c;
1922
+ return n(), t.stack = f, o(), i === "full" || !u || u !== l ? c += s.move(l + "]") : i === "shortcut" ? c = c.slice(0, -1) : c += s.move("]"), c;
1890
1923
  }
1891
- function Un() {
1924
+ function Bn() {
1892
1925
  return "!";
1893
1926
  }
1894
- or.peek = Bn;
1895
- function or(e, r, t) {
1927
+ sr.peek = Wn;
1928
+ function sr(e, r, t) {
1896
1929
  let a = e.value || "", i = "`", o = -1;
1897
1930
  for (; new RegExp("(^|[^`])" + i + "([^`]|$)").test(a); )
1898
1931
  i += "`";
1899
1932
  for (/[^ \r\n]/.test(a) && (/^[ \r\n]/.test(a) && /[ \r\n]$/.test(a) || /^`|`$/.test(a)) && (a = " " + a + " "); ++o < t.unsafe.length; ) {
1900
- const n = t.unsafe[o], u = t.compilePattern(n);
1933
+ const n = t.unsafe[o], s = t.compilePattern(n);
1901
1934
  let c;
1902
1935
  if (n.atBreak)
1903
- for (; c = u.exec(a); ) {
1904
- let s = c.index;
1905
- a.charCodeAt(s) === 10 && a.charCodeAt(s - 1) === 13 && s--, a = a.slice(0, s) + " " + a.slice(c.index + 1);
1936
+ for (; c = s.exec(a); ) {
1937
+ let u = c.index;
1938
+ a.charCodeAt(u) === 10 && a.charCodeAt(u - 1) === 13 && u--, a = a.slice(0, u) + " " + a.slice(c.index + 1);
1906
1939
  }
1907
1940
  }
1908
1941
  return i + a + i;
1909
1942
  }
1910
- function Bn() {
1943
+ function Wn() {
1911
1944
  return "`";
1912
1945
  }
1913
- function cr(e, r) {
1914
- const t = tr(e);
1946
+ function ur(e, r) {
1947
+ const t = ar(e);
1915
1948
  return !!(!r.options.resourceLink && // If there’s a url…
1916
1949
  e.url && // And there’s a no title…
1917
1950
  !e.title && // And the content of `node` is a single text node…
@@ -1921,13 +1954,13 @@ function cr(e, r) {
1921
1954
  // references don’t work), space, or angle brackets…
1922
1955
  !/[\0- <>\u007F]/.test(e.url));
1923
1956
  }
1924
- ur.peek = Wn;
1925
- function ur(e, r, t, a) {
1926
- const i = ot(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.createTracker(a);
1927
- let u, c;
1928
- if (cr(e, t)) {
1957
+ lr.peek = qn;
1958
+ function lr(e, r, t, a) {
1959
+ const i = lt(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.createTracker(a);
1960
+ let s, c;
1961
+ if (ur(e, t)) {
1929
1962
  const f = t.stack;
1930
- t.stack = [], u = t.enter("autolink");
1963
+ t.stack = [], s = t.enter("autolink");
1931
1964
  let l = n.move("<");
1932
1965
  return l += n.move(
1933
1966
  t.containerPhrasing(e, {
@@ -1935,62 +1968,62 @@ function ur(e, r, t, a) {
1935
1968
  after: ">",
1936
1969
  ...n.current()
1937
1970
  })
1938
- ), l += n.move(">"), u(), t.stack = f, l;
1971
+ ), l += n.move(">"), s(), t.stack = f, l;
1939
1972
  }
1940
- u = t.enter("link"), c = t.enter("label");
1941
- let s = n.move("[");
1942
- return s += n.move(
1973
+ s = t.enter("link"), c = t.enter("label");
1974
+ let u = n.move("[");
1975
+ return u += n.move(
1943
1976
  t.containerPhrasing(e, {
1944
- before: s,
1977
+ before: u,
1945
1978
  after: "](",
1946
1979
  ...n.current()
1947
1980
  })
1948
- ), s += n.move("]("), c(), // If there’s no url but there is a title…
1981
+ ), u += n.move("]("), c(), // If there’s no url but there is a title…
1949
1982
  !e.url && e.title || // If there are control characters or whitespace.
1950
- /[\0- \u007F]/.test(e.url) ? (c = t.enter("destinationLiteral"), s += n.move("<"), s += n.move(
1951
- t.safe(e.url, { before: s, after: ">", ...n.current() })
1952
- ), s += n.move(">")) : (c = t.enter("destinationRaw"), s += n.move(
1983
+ /[\0- \u007F]/.test(e.url) ? (c = t.enter("destinationLiteral"), u += n.move("<"), u += n.move(
1984
+ t.safe(e.url, { before: u, after: ">", ...n.current() })
1985
+ ), u += n.move(">")) : (c = t.enter("destinationRaw"), u += n.move(
1953
1986
  t.safe(e.url, {
1954
- before: s,
1987
+ before: u,
1955
1988
  after: e.title ? " " : ")",
1956
1989
  ...n.current()
1957
1990
  })
1958
- )), c(), e.title && (c = t.enter(`title${o}`), s += n.move(" " + i), s += n.move(
1991
+ )), c(), e.title && (c = t.enter(`title${o}`), u += n.move(" " + i), u += n.move(
1959
1992
  t.safe(e.title, {
1960
- before: s,
1993
+ before: u,
1961
1994
  after: i,
1962
1995
  ...n.current()
1963
1996
  })
1964
- ), s += n.move(i), c()), s += n.move(")"), u(), s;
1997
+ ), u += n.move(i), c()), u += n.move(")"), s(), u;
1965
1998
  }
1966
- function Wn(e, r, t) {
1967
- return cr(e, t) ? "<" : "[";
1999
+ function qn(e, r, t) {
2000
+ return ur(e, t) ? "<" : "[";
1968
2001
  }
1969
- sr.peek = Hn;
1970
- function sr(e, r, t, a) {
2002
+ dr.peek = Hn;
2003
+ function dr(e, r, t, a) {
1971
2004
  const i = e.referenceType, o = t.enter("linkReference");
1972
2005
  let n = t.enter("label");
1973
- const u = t.createTracker(a);
1974
- let c = u.move("[");
1975
- const s = t.containerPhrasing(e, {
2006
+ const s = t.createTracker(a);
2007
+ let c = s.move("[");
2008
+ const u = t.containerPhrasing(e, {
1976
2009
  before: c,
1977
2010
  after: "]",
1978
- ...u.current()
2011
+ ...s.current()
1979
2012
  });
1980
- c += u.move(s + "]["), n();
2013
+ c += s.move(u + "]["), n();
1981
2014
  const f = t.stack;
1982
2015
  t.stack = [], n = t.enter("reference");
1983
2016
  const l = t.safe(t.associationId(e), {
1984
2017
  before: c,
1985
2018
  after: "]",
1986
- ...u.current()
2019
+ ...s.current()
1987
2020
  });
1988
- return n(), t.stack = f, o(), i === "full" || !s || s !== l ? c += u.move(l + "]") : i === "shortcut" ? c = c.slice(0, -1) : c += u.move("]"), c;
2021
+ return n(), t.stack = f, o(), i === "full" || !u || u !== l ? c += s.move(l + "]") : i === "shortcut" ? c = c.slice(0, -1) : c += s.move("]"), c;
1989
2022
  }
1990
2023
  function Hn() {
1991
2024
  return "[";
1992
2025
  }
1993
- function ct(e) {
2026
+ function dt(e) {
1994
2027
  const r = e.options.bullet || "*";
1995
2028
  if (r !== "*" && r !== "+" && r !== "-")
1996
2029
  throw new Error(
@@ -1998,8 +2031,8 @@ function ct(e) {
1998
2031
  );
1999
2032
  return r;
2000
2033
  }
2001
- function qn(e) {
2002
- const r = ct(e), t = e.options.bulletOther;
2034
+ function Vn(e) {
2035
+ const r = dt(e), t = e.options.bulletOther;
2003
2036
  if (!t)
2004
2037
  return r === "*" ? "-" : "*";
2005
2038
  if (t !== "*" && t !== "+" && t !== "-")
@@ -2012,7 +2045,7 @@ function qn(e) {
2012
2045
  );
2013
2046
  return t;
2014
2047
  }
2015
- function Vn(e) {
2048
+ function Xn(e) {
2016
2049
  const r = e.options.bulletOrdered || ".";
2017
2050
  if (r !== "." && r !== ")")
2018
2051
  throw new Error(
@@ -2020,7 +2053,7 @@ function Vn(e) {
2020
2053
  );
2021
2054
  return r;
2022
2055
  }
2023
- function lr(e) {
2056
+ function fr(e) {
2024
2057
  const r = e.options.rule || "*";
2025
2058
  if (r !== "*" && r !== "-" && r !== "_")
2026
2059
  throw new Error(
@@ -2028,10 +2061,10 @@ function lr(e) {
2028
2061
  );
2029
2062
  return r;
2030
2063
  }
2031
- function Xn(e, r, t, a) {
2064
+ function Kn(e, r, t, a) {
2032
2065
  const i = t.enter("list"), o = t.bulletCurrent;
2033
- let n = e.ordered ? Vn(t) : ct(t);
2034
- const u = e.ordered ? n === "." ? ")" : "." : qn(t);
2066
+ let n = e.ordered ? Xn(t) : dt(t);
2067
+ const s = e.ordered ? n === "." ? ")" : "." : Vn(t);
2035
2068
  let c = r && t.bulletLastUsed ? n === t.bulletLastUsed : !1;
2036
2069
  if (!e.ordered) {
2037
2070
  const f = e.children ? e.children[0] : void 0;
@@ -2040,7 +2073,7 @@ function Xn(e, r, t, a) {
2040
2073
  (n === "*" || n === "-") && // Empty first list item:
2041
2074
  f && (!f.children || !f.children[0]) && // Directly in two other list items:
2042
2075
  t.stack[t.stack.length - 1] === "list" && t.stack[t.stack.length - 2] === "listItem" && t.stack[t.stack.length - 3] === "list" && t.stack[t.stack.length - 4] === "listItem" && // That are each the first child.
2043
- t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (c = !0), lr(t) === n && f
2076
+ t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (c = !0), fr(t) === n && f
2044
2077
  ) {
2045
2078
  let l = -1;
2046
2079
  for (; ++l < e.children.length; ) {
@@ -2052,11 +2085,11 @@ function Xn(e, r, t, a) {
2052
2085
  }
2053
2086
  }
2054
2087
  }
2055
- c && (n = u), t.bulletCurrent = n;
2056
- const s = t.containerFlow(e, a);
2057
- return t.bulletLastUsed = n, t.bulletCurrent = o, i(), s;
2088
+ c && (n = s), t.bulletCurrent = n;
2089
+ const u = t.containerFlow(e, a);
2090
+ return t.bulletLastUsed = n, t.bulletCurrent = o, i(), u;
2058
2091
  }
2059
- function Kn(e) {
2092
+ function Qn(e) {
2060
2093
  const r = e.options.listItemIndent || "one";
2061
2094
  if (r !== "tab" && r !== "one" && r !== "mixed")
2062
2095
  throw new Error(
@@ -2064,30 +2097,30 @@ function Kn(e) {
2064
2097
  );
2065
2098
  return r;
2066
2099
  }
2067
- function Qn(e, r, t, a) {
2068
- const i = Kn(t);
2069
- let o = t.bulletCurrent || ct(t);
2100
+ function Gn(e, r, t, a) {
2101
+ const i = Qn(t);
2102
+ let o = t.bulletCurrent || dt(t);
2070
2103
  r && r.type === "list" && r.ordered && (o = (typeof r.start == "number" && r.start > -1 ? r.start : 1) + (t.options.incrementListMarker === !1 ? 0 : r.children.indexOf(e)) + o);
2071
2104
  let n = o.length + 1;
2072
2105
  (i === "tab" || i === "mixed" && (r && r.type === "list" && r.spread || e.spread)) && (n = Math.ceil(n / 4) * 4);
2073
- const u = t.createTracker(a);
2074
- u.move(o + " ".repeat(n - o.length)), u.shift(n);
2075
- const c = t.enter("listItem"), s = t.indentLines(
2076
- t.containerFlow(e, u.current()),
2106
+ const s = t.createTracker(a);
2107
+ s.move(o + " ".repeat(n - o.length)), s.shift(n);
2108
+ const c = t.enter("listItem"), u = t.indentLines(
2109
+ t.containerFlow(e, s.current()),
2077
2110
  f
2078
2111
  );
2079
- return c(), s;
2112
+ return c(), u;
2080
2113
  function f(l, p, g) {
2081
2114
  return p ? (g ? "" : " ".repeat(n)) + l : (g ? o : o + " ".repeat(n - o.length)) + l;
2082
2115
  }
2083
2116
  }
2084
- function Gn(e, r, t, a) {
2117
+ function Zn(e, r, t, a) {
2085
2118
  const i = t.enter("paragraph"), o = t.enter("phrasing"), n = t.containerPhrasing(e, a);
2086
2119
  return o(), i(), n;
2087
2120
  }
2088
- const Zn = (
2121
+ const Jn = (
2089
2122
  /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
2090
- je([
2123
+ We([
2091
2124
  "break",
2092
2125
  "delete",
2093
2126
  "emphasis",
@@ -2111,12 +2144,12 @@ const Zn = (
2111
2144
  "textDirective"
2112
2145
  ])
2113
2146
  );
2114
- function Jn(e, r, t, a) {
2147
+ function Yn(e, r, t, a) {
2115
2148
  return (e.children.some(function(n) {
2116
- return Zn(n);
2149
+ return Jn(n);
2117
2150
  }) ? t.containerPhrasing : t.containerFlow).call(t, e, a);
2118
2151
  }
2119
- function Yn(e) {
2152
+ function ei(e) {
2120
2153
  const r = e.options.strong || "*";
2121
2154
  if (r !== "*" && r !== "_")
2122
2155
  throw new Error(
@@ -2124,37 +2157,37 @@ function Yn(e) {
2124
2157
  );
2125
2158
  return r;
2126
2159
  }
2127
- dr.peek = ei;
2128
- function dr(e, r, t, a) {
2129
- const i = Yn(t), o = t.enter("strong"), n = t.createTracker(a), u = n.move(i + i);
2160
+ hr.peek = ti;
2161
+ function hr(e, r, t, a) {
2162
+ const i = ei(t), o = t.enter("strong"), n = t.createTracker(a), s = n.move(i + i);
2130
2163
  let c = n.move(
2131
2164
  t.containerPhrasing(e, {
2132
2165
  after: i,
2133
- before: u,
2166
+ before: s,
2134
2167
  ...n.current()
2135
2168
  })
2136
2169
  );
2137
- const s = c.charCodeAt(0), f = Ee(
2170
+ const u = c.charCodeAt(0), f = Oe(
2138
2171
  a.before.charCodeAt(a.before.length - 1),
2139
- s,
2172
+ u,
2140
2173
  i
2141
2174
  );
2142
- f.inside && (c = we(s) + c.slice(1));
2143
- const l = c.charCodeAt(c.length - 1), p = Ee(a.after.charCodeAt(0), l, i);
2144
- p.inside && (c = c.slice(0, -1) + we(l));
2175
+ f.inside && (c = Me(u) + c.slice(1));
2176
+ const l = c.charCodeAt(c.length - 1), p = Oe(a.after.charCodeAt(0), l, i);
2177
+ p.inside && (c = c.slice(0, -1) + Me(l));
2145
2178
  const g = n.move(i + i);
2146
2179
  return o(), t.attentionEncodeSurroundingInfo = {
2147
2180
  after: p.outside,
2148
2181
  before: f.outside
2149
- }, u + c + g;
2182
+ }, s + c + g;
2150
2183
  }
2151
- function ei(e, r, t) {
2184
+ function ti(e, r, t) {
2152
2185
  return t.options.strong || "*";
2153
2186
  }
2154
- function ti(e, r, t, a) {
2187
+ function ri(e, r, t, a) {
2155
2188
  return t.safe(e.value, a);
2156
2189
  }
2157
- function ri(e) {
2190
+ function ai(e) {
2158
2191
  const r = e.options.ruleRepetition || 3;
2159
2192
  if (r < 3)
2160
2193
  throw new Error(
@@ -2162,50 +2195,50 @@ function ri(e) {
2162
2195
  );
2163
2196
  return r;
2164
2197
  }
2165
- function ai(e, r, t) {
2166
- const a = (lr(t) + (t.options.ruleSpaces ? " " : "")).repeat(ri(t));
2198
+ function ni(e, r, t) {
2199
+ const a = (fr(t) + (t.options.ruleSpaces ? " " : "")).repeat(ai(t));
2167
2200
  return t.options.ruleSpaces ? a.slice(0, -1) : a;
2168
2201
  }
2169
- const fr = {
2170
- blockquote: Cn,
2171
- break: It,
2172
- code: Sn,
2173
- definition: Pn,
2174
- emphasis: er,
2175
- hardBreak: It,
2176
- heading: jn,
2177
- html: ar,
2178
- image: nr,
2179
- imageReference: ir,
2180
- inlineCode: or,
2181
- link: ur,
2182
- linkReference: sr,
2183
- list: Xn,
2184
- listItem: Qn,
2185
- paragraph: Gn,
2186
- root: Jn,
2187
- strong: dr,
2188
- text: ti,
2189
- thematicBreak: ai
2202
+ const mr = {
2203
+ blockquote: Tn,
2204
+ break: Lt,
2205
+ code: Ln,
2206
+ definition: Rn,
2207
+ emphasis: rr,
2208
+ hardBreak: Lt,
2209
+ heading: $n,
2210
+ html: ir,
2211
+ image: or,
2212
+ imageReference: cr,
2213
+ inlineCode: sr,
2214
+ link: lr,
2215
+ linkReference: dr,
2216
+ list: Kn,
2217
+ listItem: Gn,
2218
+ paragraph: Zn,
2219
+ root: Yn,
2220
+ strong: hr,
2221
+ text: ri,
2222
+ thematicBreak: ni
2190
2223
  };
2191
- function ni() {
2224
+ function ii() {
2192
2225
  return {
2193
2226
  enter: {
2194
- table: ii,
2195
- tableData: Lt,
2196
- tableHeader: Lt,
2197
- tableRow: ci
2227
+ table: oi,
2228
+ tableData: Rt,
2229
+ tableHeader: Rt,
2230
+ tableRow: si
2198
2231
  },
2199
2232
  exit: {
2200
2233
  codeText: ui,
2201
- table: oi,
2202
- tableData: Qe,
2203
- tableHeader: Qe,
2204
- tableRow: Qe
2234
+ table: ci,
2235
+ tableData: Je,
2236
+ tableHeader: Je,
2237
+ tableRow: Je
2205
2238
  }
2206
2239
  };
2207
2240
  }
2208
- function ii(e) {
2241
+ function oi(e) {
2209
2242
  const r = e._align;
2210
2243
  this.enter(
2211
2244
  {
@@ -2218,28 +2251,28 @@ function ii(e) {
2218
2251
  e
2219
2252
  ), this.data.inTable = !0;
2220
2253
  }
2221
- function oi(e) {
2254
+ function ci(e) {
2222
2255
  this.exit(e), this.data.inTable = void 0;
2223
2256
  }
2224
- function ci(e) {
2257
+ function si(e) {
2225
2258
  this.enter({ type: "tableRow", children: [] }, e);
2226
2259
  }
2227
- function Qe(e) {
2260
+ function Je(e) {
2228
2261
  this.exit(e);
2229
2262
  }
2230
- function Lt(e) {
2263
+ function Rt(e) {
2231
2264
  this.enter({ type: "tableCell", children: [] }, e);
2232
2265
  }
2233
2266
  function ui(e) {
2234
2267
  let r = this.resume();
2235
- this.data.inTable && (r = r.replace(/\\([\\|])/g, si));
2268
+ this.data.inTable && (r = r.replace(/\\([\\|])/g, li));
2236
2269
  const t = this.stack[this.stack.length - 1];
2237
2270
  t.type, t.value = r, this.exit(e);
2238
2271
  }
2239
- function si(e, r) {
2272
+ function li(e, r) {
2240
2273
  return r === "|" ? r : e;
2241
2274
  }
2242
- function li(e) {
2275
+ function di(e) {
2243
2276
  const r = e || {}, t = r.tableCellPadding, a = r.tablePipeAlign, i = r.stringLength, o = t ? " " : "|";
2244
2277
  return {
2245
2278
  unsafe: [
@@ -2265,27 +2298,27 @@ function li(e) {
2265
2298
  inlineCode: p,
2266
2299
  table: n,
2267
2300
  tableCell: c,
2268
- tableRow: u
2301
+ tableRow: s
2269
2302
  }
2270
2303
  };
2271
2304
  function n(g, m, x, b) {
2272
- return s(f(g, x, b), g.align);
2305
+ return u(f(g, x, b), g.align);
2273
2306
  }
2274
- function u(g, m, x, b) {
2275
- const y = l(g, x, b), k = s([y]);
2307
+ function s(g, m, x, b) {
2308
+ const y = l(g, x, b), k = u([y]);
2276
2309
  return k.slice(0, k.indexOf(`
2277
2310
  `));
2278
2311
  }
2279
2312
  function c(g, m, x, b) {
2280
- const y = x.enter("tableCell"), k = x.enter("phrasing"), T = x.containerPhrasing(g, {
2313
+ const y = x.enter("tableCell"), k = x.enter("phrasing"), v = x.containerPhrasing(g, {
2281
2314
  ...b,
2282
2315
  before: o,
2283
2316
  after: o
2284
2317
  });
2285
- return k(), y(), T;
2318
+ return k(), y(), v;
2286
2319
  }
2287
- function s(g, m) {
2288
- return wn(g, {
2320
+ function u(g, m) {
2321
+ return vn(g, {
2289
2322
  align: m,
2290
2323
  // @ts-expect-error: `markdown-table` types should support `null`.
2291
2324
  alignDelimiters: a,
@@ -2298,44 +2331,44 @@ function li(e) {
2298
2331
  function f(g, m, x) {
2299
2332
  const b = g.children;
2300
2333
  let y = -1;
2301
- const k = [], T = m.enter("table");
2334
+ const k = [], v = m.enter("table");
2302
2335
  for (; ++y < b.length; )
2303
2336
  k[y] = l(b[y], m, x);
2304
- return T(), k;
2337
+ return v(), k;
2305
2338
  }
2306
2339
  function l(g, m, x) {
2307
2340
  const b = g.children;
2308
2341
  let y = -1;
2309
- const k = [], T = m.enter("tableRow");
2342
+ const k = [], v = m.enter("tableRow");
2310
2343
  for (; ++y < b.length; )
2311
2344
  k[y] = c(b[y], g, m, x);
2312
- return T(), k;
2345
+ return v(), k;
2313
2346
  }
2314
2347
  function p(g, m, x) {
2315
- let b = fr.inlineCode(g, m, x);
2348
+ let b = mr.inlineCode(g, m, x);
2316
2349
  return x.stack.includes("tableCell") && (b = b.replace(/\|/g, "\\$&")), b;
2317
2350
  }
2318
2351
  }
2319
- function di() {
2352
+ function fi() {
2320
2353
  return {
2321
2354
  exit: {
2322
- taskListCheckValueChecked: Pt,
2323
- taskListCheckValueUnchecked: Pt,
2324
- paragraph: hi
2355
+ taskListCheckValueChecked: Dt,
2356
+ taskListCheckValueUnchecked: Dt,
2357
+ paragraph: mi
2325
2358
  }
2326
2359
  };
2327
2360
  }
2328
- function fi() {
2361
+ function hi() {
2329
2362
  return {
2330
2363
  unsafe: [{ atBreak: !0, character: "-", after: "[:|-]" }],
2331
- handlers: { listItem: mi }
2364
+ handlers: { listItem: pi }
2332
2365
  };
2333
2366
  }
2334
- function Pt(e) {
2367
+ function Dt(e) {
2335
2368
  const r = this.stack[this.stack.length - 2];
2336
2369
  r.type, r.checked = e.type === "taskListCheckValueChecked";
2337
2370
  }
2338
- function hi(e) {
2371
+ function mi(e) {
2339
2372
  const r = this.stack[this.stack.length - 2];
2340
2373
  if (r && r.type === "listItem" && typeof r.checked == "boolean") {
2341
2374
  const t = this.stack[this.stack.length - 1];
@@ -2345,9 +2378,9 @@ function hi(e) {
2345
2378
  const i = r.children;
2346
2379
  let o = -1, n;
2347
2380
  for (; ++o < i.length; ) {
2348
- const u = i[o];
2349
- if (u.type === "paragraph") {
2350
- n = u;
2381
+ const s = i[o];
2382
+ if (s.type === "paragraph") {
2383
+ n = s;
2351
2384
  break;
2352
2385
  }
2353
2386
  }
@@ -2356,39 +2389,39 @@ function hi(e) {
2356
2389
  }
2357
2390
  this.exit(e);
2358
2391
  }
2359
- function mi(e, r, t, a) {
2360
- const i = e.children[0], o = typeof e.checked == "boolean" && i && i.type === "paragraph", n = "[" + (e.checked ? "x" : " ") + "] ", u = t.createTracker(a);
2361
- o && u.move(n);
2362
- let c = fr.listItem(e, r, t, {
2392
+ function pi(e, r, t, a) {
2393
+ const i = e.children[0], o = typeof e.checked == "boolean" && i && i.type === "paragraph", n = "[" + (e.checked ? "x" : " ") + "] ", s = t.createTracker(a);
2394
+ o && s.move(n);
2395
+ let c = mr.listItem(e, r, t, {
2363
2396
  ...a,
2364
- ...u.current()
2397
+ ...s.current()
2365
2398
  });
2366
- return o && (c = c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, s)), c;
2367
- function s(f) {
2399
+ return o && (c = c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, u)), c;
2400
+ function u(f) {
2368
2401
  return f + n;
2369
2402
  }
2370
2403
  }
2371
- function pi() {
2404
+ function gi() {
2372
2405
  return [
2373
- Wa(),
2374
- dn(),
2375
- pn(),
2376
- ni(),
2377
- di()
2406
+ qa(),
2407
+ fn(),
2408
+ gn(),
2409
+ ii(),
2410
+ fi()
2378
2411
  ];
2379
2412
  }
2380
- function gi(e) {
2413
+ function bi(e) {
2381
2414
  return {
2382
2415
  extensions: [
2383
2416
  Ha(),
2384
- fn(e),
2385
- gn(),
2386
- li(e),
2387
- fi()
2417
+ hn(e),
2418
+ bn(),
2419
+ di(e),
2420
+ hi()
2388
2421
  ]
2389
2422
  };
2390
2423
  }
2391
- function Re(e, r, t, a) {
2424
+ function ze(e, r, t, a) {
2392
2425
  const i = e.length;
2393
2426
  let o = 0, n;
2394
2427
  if (r < 0 ? r = -r > i ? 0 : i + r : r = r > i ? i : r, t = t > 0 ? t : 0, a.length < 1e4)
@@ -2397,122 +2430,122 @@ function Re(e, r, t, a) {
2397
2430
  for (t && e.splice(r, t); o < a.length; )
2398
2431
  n = a.slice(o, o + 1e4), n.unshift(r, 0), e.splice(...n), o += 1e4, r += 1e4;
2399
2432
  }
2400
- const Rt = {}.hasOwnProperty;
2401
- function bi(e) {
2433
+ const _t = {}.hasOwnProperty;
2434
+ function yi(e) {
2402
2435
  const r = {};
2403
2436
  let t = -1;
2404
2437
  for (; ++t < e.length; )
2405
- yi(r, e[t]);
2438
+ xi(r, e[t]);
2406
2439
  return r;
2407
2440
  }
2408
- function yi(e, r) {
2441
+ function xi(e, r) {
2409
2442
  let t;
2410
2443
  for (t in r) {
2411
- const i = (Rt.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
2444
+ const i = (_t.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
2412
2445
  let n;
2413
2446
  if (o)
2414
2447
  for (n in o) {
2415
- Rt.call(i, n) || (i[n] = []);
2416
- const u = o[n];
2417
- xi(
2448
+ _t.call(i, n) || (i[n] = []);
2449
+ const s = o[n];
2450
+ ki(
2418
2451
  // @ts-expect-error Looks like a list.
2419
2452
  i[n],
2420
- Array.isArray(u) ? u : u ? [u] : []
2453
+ Array.isArray(s) ? s : s ? [s] : []
2421
2454
  );
2422
2455
  }
2423
2456
  }
2424
2457
  }
2425
- function xi(e, r) {
2458
+ function ki(e, r) {
2426
2459
  let t = -1;
2427
2460
  const a = [];
2428
2461
  for (; ++t < r.length; )
2429
2462
  (r[t].add === "after" ? e : a).push(r[t]);
2430
- Re(e, 0, 0, a);
2463
+ ze(e, 0, 0, a);
2431
2464
  }
2432
- const ki = {
2433
- tokenize: Ai,
2434
- partial: !0
2435
- }, hr = {
2465
+ const wi = {
2436
2466
  tokenize: Ni,
2437
2467
  partial: !0
2438
- }, mr = {
2468
+ }, pr = {
2439
2469
  tokenize: Ii,
2440
2470
  partial: !0
2441
- }, pr = {
2471
+ }, gr = {
2442
2472
  tokenize: Si,
2443
2473
  partial: !0
2444
- }, wi = {
2474
+ }, br = {
2445
2475
  tokenize: Li,
2446
2476
  partial: !0
2447
- }, gr = {
2477
+ }, vi = {
2478
+ tokenize: Pi,
2479
+ partial: !0
2480
+ }, yr = {
2448
2481
  name: "wwwAutolink",
2449
- tokenize: Ti,
2450
- previous: yr
2451
- }, br = {
2452
- name: "protocolAutolink",
2453
2482
  tokenize: Mi,
2454
- previous: xr
2455
- }, Y = {
2456
- name: "emailAutolink",
2457
- tokenize: Ci,
2458
2483
  previous: kr
2459
- }, K = {};
2460
- function vi() {
2484
+ }, xr = {
2485
+ name: "protocolAutolink",
2486
+ tokenize: Ai,
2487
+ previous: wr
2488
+ }, ne = {
2489
+ name: "emailAutolink",
2490
+ tokenize: Ti,
2491
+ previous: vr
2492
+ }, Z = {};
2493
+ function Ci() {
2461
2494
  return {
2462
- text: K
2495
+ text: Z
2463
2496
  };
2464
2497
  }
2465
- let ne = 48;
2466
- for (; ne < 123; )
2467
- K[ne] = Y, ne++, ne === 58 ? ne = 65 : ne === 91 && (ne = 97);
2468
- K[43] = Y;
2469
- K[45] = Y;
2470
- K[46] = Y;
2471
- K[95] = Y;
2472
- K[72] = [Y, br];
2473
- K[104] = [Y, br];
2474
- K[87] = [Y, gr];
2475
- K[119] = [Y, gr];
2476
- function Ci(e, r, t) {
2498
+ let ce = 48;
2499
+ for (; ce < 123; )
2500
+ Z[ce] = ne, ce++, ce === 58 ? ce = 65 : ce === 91 && (ce = 97);
2501
+ Z[43] = ne;
2502
+ Z[45] = ne;
2503
+ Z[46] = ne;
2504
+ Z[95] = ne;
2505
+ Z[72] = [ne, xr];
2506
+ Z[104] = [ne, xr];
2507
+ Z[87] = [ne, yr];
2508
+ Z[119] = [ne, yr];
2509
+ function Ti(e, r, t) {
2477
2510
  const a = this;
2478
2511
  let i, o;
2479
2512
  return n;
2480
2513
  function n(l) {
2481
- return !rt(l) || !kr.call(a, a.previous) || ut(a.events) ? t(l) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(l));
2514
+ return !ot(l) || !vr.call(a, a.previous) || ft(a.events) ? t(l) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), s(l));
2482
2515
  }
2483
- function u(l) {
2484
- return rt(l) ? (e.consume(l), u) : l === 64 ? (e.consume(l), c) : t(l);
2516
+ function s(l) {
2517
+ return ot(l) ? (e.consume(l), s) : l === 64 ? (e.consume(l), c) : t(l);
2485
2518
  }
2486
2519
  function c(l) {
2487
- return l === 46 ? e.check(wi, f, s)(l) : l === 45 || l === 95 || it(l) ? (o = !0, e.consume(l), c) : f(l);
2520
+ return l === 46 ? e.check(vi, f, u)(l) : l === 45 || l === 95 || ut(l) ? (o = !0, e.consume(l), c) : f(l);
2488
2521
  }
2489
- function s(l) {
2522
+ function u(l) {
2490
2523
  return e.consume(l), i = !0, c;
2491
2524
  }
2492
2525
  function f(l) {
2493
- return o && i && ke(a.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(l)) : t(l);
2526
+ return o && i && Te(a.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(l)) : t(l);
2494
2527
  }
2495
2528
  }
2496
- function Ti(e, r, t) {
2529
+ function Mi(e, r, t) {
2497
2530
  const a = this;
2498
2531
  return i;
2499
2532
  function i(n) {
2500
- return n !== 87 && n !== 119 || !yr.call(a, a.previous) || ut(a.events) ? t(n) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(ki, e.attempt(hr, e.attempt(mr, o), t), t)(n));
2533
+ return n !== 87 && n !== 119 || !kr.call(a, a.previous) || ft(a.events) ? t(n) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(wi, e.attempt(pr, e.attempt(gr, o), t), t)(n));
2501
2534
  }
2502
2535
  function o(n) {
2503
2536
  return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), r(n);
2504
2537
  }
2505
2538
  }
2506
- function Mi(e, r, t) {
2539
+ function Ai(e, r, t) {
2507
2540
  const a = this;
2508
2541
  let i = "", o = !1;
2509
2542
  return n;
2510
2543
  function n(l) {
2511
- return (l === 72 || l === 104) && xr.call(a, a.previous) && !ut(a.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(l), e.consume(l), u) : t(l);
2544
+ return (l === 72 || l === 104) && wr.call(a, a.previous) && !ft(a.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(l), e.consume(l), s) : t(l);
2512
2545
  }
2513
- function u(l) {
2514
- if (ke(l) && i.length < 5)
2515
- return i += String.fromCodePoint(l), e.consume(l), u;
2546
+ function s(l) {
2547
+ if (Te(l) && i.length < 5)
2548
+ return i += String.fromCodePoint(l), e.consume(l), s;
2516
2549
  if (l === 58) {
2517
2550
  const p = i.toLowerCase();
2518
2551
  if (p === "http" || p === "https")
@@ -2521,16 +2554,16 @@ function Mi(e, r, t) {
2521
2554
  return t(l);
2522
2555
  }
2523
2556
  function c(l) {
2524
- return l === 47 ? (e.consume(l), o ? s : (o = !0, c)) : t(l);
2557
+ return l === 47 ? (e.consume(l), o ? u : (o = !0, c)) : t(l);
2525
2558
  }
2526
- function s(l) {
2527
- return l === null || Sa(l) || B(l) || oe(l) || Fe(l) ? t(l) : e.attempt(hr, e.attempt(mr, f), t)(l);
2559
+ function u(l) {
2560
+ return l === null || La(l) || W(l) || ue(l) || Ue(l) ? t(l) : e.attempt(pr, e.attempt(gr, f), t)(l);
2528
2561
  }
2529
2562
  function f(l) {
2530
2563
  return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), r(l);
2531
2564
  }
2532
2565
  }
2533
- function Ai(e, r, t) {
2566
+ function Ni(e, r, t) {
2534
2567
  let a = 0;
2535
2568
  return i;
2536
2569
  function i(n) {
@@ -2540,70 +2573,70 @@ function Ai(e, r, t) {
2540
2573
  return n === null ? t(n) : r(n);
2541
2574
  }
2542
2575
  }
2543
- function Ni(e, r, t) {
2576
+ function Ii(e, r, t) {
2544
2577
  let a, i, o;
2545
2578
  return n;
2546
- function n(s) {
2547
- return s === 46 || s === 95 ? e.check(pr, c, u)(s) : s === null || B(s) || oe(s) || s !== 45 && Fe(s) ? c(s) : (o = !0, e.consume(s), n);
2579
+ function n(u) {
2580
+ return u === 46 || u === 95 ? e.check(br, c, s)(u) : u === null || W(u) || ue(u) || u !== 45 && Ue(u) ? c(u) : (o = !0, e.consume(u), n);
2548
2581
  }
2549
- function u(s) {
2550
- return s === 95 ? a = !0 : (i = a, a = void 0), e.consume(s), n;
2582
+ function s(u) {
2583
+ return u === 95 ? a = !0 : (i = a, a = void 0), e.consume(u), n;
2551
2584
  }
2552
- function c(s) {
2553
- return i || a || !o ? t(s) : r(s);
2585
+ function c(u) {
2586
+ return i || a || !o ? t(u) : r(u);
2554
2587
  }
2555
2588
  }
2556
- function Ii(e, r) {
2589
+ function Si(e, r) {
2557
2590
  let t = 0, a = 0;
2558
2591
  return i;
2559
2592
  function i(n) {
2560
- return n === 40 ? (t++, e.consume(n), i) : n === 41 && a < t ? o(n) : n === 33 || n === 34 || n === 38 || n === 39 || n === 41 || n === 42 || n === 44 || n === 46 || n === 58 || n === 59 || n === 60 || n === 63 || n === 93 || n === 95 || n === 126 ? e.check(pr, r, o)(n) : n === null || B(n) || oe(n) ? r(n) : (e.consume(n), i);
2593
+ return n === 40 ? (t++, e.consume(n), i) : n === 41 && a < t ? o(n) : n === 33 || n === 34 || n === 38 || n === 39 || n === 41 || n === 42 || n === 44 || n === 46 || n === 58 || n === 59 || n === 60 || n === 63 || n === 93 || n === 95 || n === 126 ? e.check(br, r, o)(n) : n === null || W(n) || ue(n) ? r(n) : (e.consume(n), i);
2561
2594
  }
2562
2595
  function o(n) {
2563
2596
  return n === 41 && a++, e.consume(n), i;
2564
2597
  }
2565
2598
  }
2566
- function Si(e, r, t) {
2599
+ function Li(e, r, t) {
2567
2600
  return a;
2568
- function a(u) {
2569
- return u === 33 || u === 34 || u === 39 || u === 41 || u === 42 || u === 44 || u === 46 || u === 58 || u === 59 || u === 63 || u === 95 || u === 126 ? (e.consume(u), a) : u === 38 ? (e.consume(u), o) : u === 93 ? (e.consume(u), i) : (
2601
+ function a(s) {
2602
+ return s === 33 || s === 34 || s === 39 || s === 41 || s === 42 || s === 44 || s === 46 || s === 58 || s === 59 || s === 63 || s === 95 || s === 126 ? (e.consume(s), a) : s === 38 ? (e.consume(s), o) : s === 93 ? (e.consume(s), i) : (
2570
2603
  // `<` is an end.
2571
- u === 60 || // So is whitespace.
2572
- u === null || B(u) || oe(u) ? r(u) : t(u)
2604
+ s === 60 || // So is whitespace.
2605
+ s === null || W(s) || ue(s) ? r(s) : t(s)
2573
2606
  );
2574
2607
  }
2575
- function i(u) {
2576
- return u === null || u === 40 || u === 91 || B(u) || oe(u) ? r(u) : a(u);
2608
+ function i(s) {
2609
+ return s === null || s === 40 || s === 91 || W(s) || ue(s) ? r(s) : a(s);
2577
2610
  }
2578
- function o(u) {
2579
- return ke(u) ? n(u) : t(u);
2611
+ function o(s) {
2612
+ return Te(s) ? n(s) : t(s);
2580
2613
  }
2581
- function n(u) {
2582
- return u === 59 ? (e.consume(u), a) : ke(u) ? (e.consume(u), n) : t(u);
2614
+ function n(s) {
2615
+ return s === 59 ? (e.consume(s), a) : Te(s) ? (e.consume(s), n) : t(s);
2583
2616
  }
2584
2617
  }
2585
- function Li(e, r, t) {
2618
+ function Pi(e, r, t) {
2586
2619
  return a;
2587
2620
  function a(o) {
2588
2621
  return e.consume(o), i;
2589
2622
  }
2590
2623
  function i(o) {
2591
- return it(o) ? t(o) : r(o);
2624
+ return ut(o) ? t(o) : r(o);
2592
2625
  }
2593
2626
  }
2594
- function yr(e) {
2595
- return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || B(e);
2627
+ function kr(e) {
2628
+ return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || W(e);
2596
2629
  }
2597
- function xr(e) {
2598
- return !ke(e);
2630
+ function wr(e) {
2631
+ return !Te(e);
2599
2632
  }
2600
- function kr(e) {
2601
- return !(e === 47 || rt(e));
2633
+ function vr(e) {
2634
+ return !(e === 47 || ot(e));
2602
2635
  }
2603
- function rt(e) {
2604
- return e === 43 || e === 45 || e === 46 || e === 95 || it(e);
2636
+ function ot(e) {
2637
+ return e === 43 || e === 45 || e === 46 || e === 95 || ut(e);
2605
2638
  }
2606
- function ut(e) {
2639
+ function ft(e) {
2607
2640
  let r = e.length, t = !1;
2608
2641
  for (; r--; ) {
2609
2642
  const a = e[r][1];
@@ -2618,7 +2651,7 @@ function ut(e) {
2618
2651
  }
2619
2652
  return e.length > 0 && !t && (e[e.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), t;
2620
2653
  }
2621
- function Pi(e, r, t) {
2654
+ function Ri(e, r, t) {
2622
2655
  const a = [];
2623
2656
  let i = -1;
2624
2657
  for (; ++i < e.length; ) {
@@ -2627,61 +2660,61 @@ function Pi(e, r, t) {
2627
2660
  }
2628
2661
  return r;
2629
2662
  }
2630
- function Z(e, r, t, a) {
2663
+ function re(e, r, t, a) {
2631
2664
  const i = a ? a - 1 : Number.POSITIVE_INFINITY;
2632
2665
  let o = 0;
2633
2666
  return n;
2634
2667
  function n(c) {
2635
- return G(c) ? (e.enter(t), u(c)) : r(c);
2668
+ return te(c) ? (e.enter(t), s(c)) : r(c);
2636
2669
  }
2637
- function u(c) {
2638
- return G(c) && o++ < i ? (e.consume(c), u) : (e.exit(t), r(c));
2670
+ function s(c) {
2671
+ return te(c) && o++ < i ? (e.consume(c), s) : (e.exit(t), r(c));
2639
2672
  }
2640
2673
  }
2641
- const Ri = {
2674
+ const Di = {
2642
2675
  partial: !0,
2643
- tokenize: Di
2676
+ tokenize: _i
2644
2677
  };
2645
- function Di(e, r, t) {
2678
+ function _i(e, r, t) {
2646
2679
  return a;
2647
2680
  function a(o) {
2648
- return G(o) ? Z(e, i, "linePrefix")(o) : i(o);
2681
+ return te(o) ? re(e, i, "linePrefix")(o) : i(o);
2649
2682
  }
2650
2683
  function i(o) {
2651
- return o === null || fe(o) ? r(o) : t(o);
2684
+ return o === null || ge(o) ? r(o) : t(o);
2652
2685
  }
2653
2686
  }
2654
- const _i = {
2655
- tokenize: Bi,
2687
+ const Ei = {
2688
+ tokenize: Wi,
2656
2689
  partial: !0
2657
2690
  };
2658
- function Ei() {
2691
+ function Fi() {
2659
2692
  return {
2660
2693
  document: {
2661
2694
  91: {
2662
2695
  name: "gfmFootnoteDefinition",
2663
- tokenize: $i,
2696
+ tokenize: Oi,
2664
2697
  continuation: {
2665
- tokenize: Oi
2698
+ tokenize: Ui
2666
2699
  },
2667
- exit: Ui
2700
+ exit: Bi
2668
2701
  }
2669
2702
  },
2670
2703
  text: {
2671
2704
  91: {
2672
2705
  name: "gfmFootnoteCall",
2673
- tokenize: ji
2706
+ tokenize: $i
2674
2707
  },
2675
2708
  93: {
2676
2709
  name: "gfmPotentialFootnoteCall",
2677
2710
  add: "after",
2678
- tokenize: Fi,
2679
- resolveTo: zi
2711
+ tokenize: zi,
2712
+ resolveTo: ji
2680
2713
  }
2681
2714
  }
2682
2715
  };
2683
2716
  }
2684
- function Fi(e, r, t) {
2717
+ function zi(e, r, t) {
2685
2718
  const a = this;
2686
2719
  let i = a.events.length;
2687
2720
  const o = a.parser.gfmFootnotes || (a.parser.gfmFootnotes = []);
@@ -2695,18 +2728,18 @@ function Fi(e, r, t) {
2695
2728
  if (c.type === "gfmFootnoteCall" || c.type === "labelLink" || c.type === "label" || c.type === "image" || c.type === "link")
2696
2729
  break;
2697
2730
  }
2698
- return u;
2699
- function u(c) {
2731
+ return s;
2732
+ function s(c) {
2700
2733
  if (!n || !n._balanced)
2701
2734
  return t(c);
2702
- const s = Ce(a.sliceSerialize({
2735
+ const u = Ne(a.sliceSerialize({
2703
2736
  start: n.end,
2704
2737
  end: a.now()
2705
2738
  }));
2706
- return s.codePointAt(0) !== 94 || !o.includes(s.slice(1)) ? t(c) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), r(c));
2739
+ return u.codePointAt(0) !== 94 || !o.includes(u.slice(1)) ? t(c) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), r(c));
2707
2740
  }
2708
2741
  }
2709
- function zi(e, r) {
2742
+ function ji(e, r) {
2710
2743
  let t = e.length;
2711
2744
  for (; t--; )
2712
2745
  if (e[t][1].type === "labelImage" && e[t][0] === "enter") {
@@ -2733,7 +2766,7 @@ function zi(e, r) {
2733
2766
  contentType: "string",
2734
2767
  start: Object.assign({}, o.start),
2735
2768
  end: Object.assign({}, o.end)
2736
- }, u = [
2769
+ }, s = [
2737
2770
  // Take the `labelImageMarker` (now `data`, the `!`)
2738
2771
  e[t + 1],
2739
2772
  e[t + 2],
@@ -2754,89 +2787,89 @@ function zi(e, r) {
2754
2787
  e[e.length - 1],
2755
2788
  ["exit", a, r]
2756
2789
  ];
2757
- return e.splice(t, e.length - t + 1, ...u), e;
2790
+ return e.splice(t, e.length - t + 1, ...s), e;
2758
2791
  }
2759
- function ji(e, r, t) {
2792
+ function $i(e, r, t) {
2760
2793
  const a = this, i = a.parser.gfmFootnotes || (a.parser.gfmFootnotes = []);
2761
2794
  let o = 0, n;
2762
- return u;
2763
- function u(l) {
2795
+ return s;
2796
+ function s(l) {
2764
2797
  return e.enter("gfmFootnoteCall"), e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), c;
2765
2798
  }
2766
2799
  function c(l) {
2767
- return l !== 94 ? t(l) : (e.enter("gfmFootnoteCallMarker"), e.consume(l), e.exit("gfmFootnoteCallMarker"), e.enter("gfmFootnoteCallString"), e.enter("chunkString").contentType = "string", s);
2800
+ return l !== 94 ? t(l) : (e.enter("gfmFootnoteCallMarker"), e.consume(l), e.exit("gfmFootnoteCallMarker"), e.enter("gfmFootnoteCallString"), e.enter("chunkString").contentType = "string", u);
2768
2801
  }
2769
- function s(l) {
2802
+ function u(l) {
2770
2803
  if (
2771
2804
  // Too long.
2772
2805
  o > 999 || // Closing brace with nothing.
2773
2806
  l === 93 && !n || // Space or tab is not supported by GFM for some reason.
2774
2807
  // `\n` and `[` not being supported makes sense.
2775
- l === null || l === 91 || B(l)
2808
+ l === null || l === 91 || W(l)
2776
2809
  )
2777
2810
  return t(l);
2778
2811
  if (l === 93) {
2779
2812
  e.exit("chunkString");
2780
2813
  const p = e.exit("gfmFootnoteCallString");
2781
- return i.includes(Ce(a.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(l);
2814
+ return i.includes(Ne(a.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(l);
2782
2815
  }
2783
- return B(l) || (n = !0), o++, e.consume(l), l === 92 ? f : s;
2816
+ return W(l) || (n = !0), o++, e.consume(l), l === 92 ? f : u;
2784
2817
  }
2785
2818
  function f(l) {
2786
- return l === 91 || l === 92 || l === 93 ? (e.consume(l), o++, s) : s(l);
2819
+ return l === 91 || l === 92 || l === 93 ? (e.consume(l), o++, u) : u(l);
2787
2820
  }
2788
2821
  }
2789
- function $i(e, r, t) {
2822
+ function Oi(e, r, t) {
2790
2823
  const a = this, i = a.parser.gfmFootnotes || (a.parser.gfmFootnotes = []);
2791
- let o, n = 0, u;
2824
+ let o, n = 0, s;
2792
2825
  return c;
2793
2826
  function c(m) {
2794
- return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionLabelMarker"), s;
2827
+ return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionLabelMarker"), u;
2795
2828
  }
2796
- function s(m) {
2829
+ function u(m) {
2797
2830
  return m === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", f) : t(m);
2798
2831
  }
2799
2832
  function f(m) {
2800
2833
  if (
2801
2834
  // Too long.
2802
2835
  n > 999 || // Closing brace with nothing.
2803
- m === 93 && !u || // Space or tab is not supported by GFM for some reason.
2836
+ m === 93 && !s || // Space or tab is not supported by GFM for some reason.
2804
2837
  // `\n` and `[` not being supported makes sense.
2805
- m === null || m === 91 || B(m)
2838
+ m === null || m === 91 || W(m)
2806
2839
  )
2807
2840
  return t(m);
2808
2841
  if (m === 93) {
2809
2842
  e.exit("chunkString");
2810
2843
  const x = e.exit("gfmFootnoteDefinitionLabelString");
2811
- return o = Ce(a.sliceSerialize(x)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
2844
+ return o = Ne(a.sliceSerialize(x)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(m), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
2812
2845
  }
2813
- return B(m) || (u = !0), n++, e.consume(m), m === 92 ? l : f;
2846
+ return W(m) || (s = !0), n++, e.consume(m), m === 92 ? l : f;
2814
2847
  }
2815
2848
  function l(m) {
2816
2849
  return m === 91 || m === 92 || m === 93 ? (e.consume(m), n++, f) : f(m);
2817
2850
  }
2818
2851
  function p(m) {
2819
- return m === 58 ? (e.enter("definitionMarker"), e.consume(m), e.exit("definitionMarker"), i.includes(o) || i.push(o), Z(e, g, "gfmFootnoteDefinitionWhitespace")) : t(m);
2852
+ return m === 58 ? (e.enter("definitionMarker"), e.consume(m), e.exit("definitionMarker"), i.includes(o) || i.push(o), re(e, g, "gfmFootnoteDefinitionWhitespace")) : t(m);
2820
2853
  }
2821
2854
  function g(m) {
2822
2855
  return r(m);
2823
2856
  }
2824
2857
  }
2825
- function Oi(e, r, t) {
2826
- return e.check(Ri, r, e.attempt(_i, r, t));
2858
+ function Ui(e, r, t) {
2859
+ return e.check(Di, r, e.attempt(Ei, r, t));
2827
2860
  }
2828
- function Ui(e) {
2861
+ function Bi(e) {
2829
2862
  e.exit("gfmFootnoteDefinition");
2830
2863
  }
2831
- function Bi(e, r, t) {
2864
+ function Wi(e, r, t) {
2832
2865
  const a = this;
2833
- return Z(e, i, "gfmFootnoteDefinitionIndent", 5);
2866
+ return re(e, i, "gfmFootnoteDefinitionIndent", 5);
2834
2867
  function i(o) {
2835
2868
  const n = a.events[a.events.length - 1];
2836
2869
  return n && n[1].type === "gfmFootnoteDefinitionIndent" && n[2].sliceSerialize(n[1], !0).length === 4 ? r(o) : t(o);
2837
2870
  }
2838
2871
  }
2839
- function Wi(e) {
2872
+ function qi(e) {
2840
2873
  let t = (e || {}).singleTilde;
2841
2874
  const a = {
2842
2875
  name: "strikethrough",
@@ -2854,25 +2887,25 @@ function Wi(e) {
2854
2887
  null: [126]
2855
2888
  }
2856
2889
  };
2857
- function i(n, u) {
2890
+ function i(n, s) {
2858
2891
  let c = -1;
2859
2892
  for (; ++c < n.length; )
2860
2893
  if (n[c][0] === "enter" && n[c][1].type === "strikethroughSequenceTemporary" && n[c][1]._close) {
2861
- let s = c;
2862
- for (; s--; )
2863
- if (n[s][0] === "exit" && n[s][1].type === "strikethroughSequenceTemporary" && n[s][1]._open && // If the sizes are the same:
2864
- n[c][1].end.offset - n[c][1].start.offset === n[s][1].end.offset - n[s][1].start.offset) {
2865
- n[c][1].type = "strikethroughSequence", n[s][1].type = "strikethroughSequence";
2894
+ let u = c;
2895
+ for (; u--; )
2896
+ if (n[u][0] === "exit" && n[u][1].type === "strikethroughSequenceTemporary" && n[u][1]._open && // If the sizes are the same:
2897
+ n[c][1].end.offset - n[c][1].start.offset === n[u][1].end.offset - n[u][1].start.offset) {
2898
+ n[c][1].type = "strikethroughSequence", n[u][1].type = "strikethroughSequence";
2866
2899
  const f = {
2867
2900
  type: "strikethrough",
2868
- start: Object.assign({}, n[s][1].start),
2901
+ start: Object.assign({}, n[u][1].start),
2869
2902
  end: Object.assign({}, n[c][1].end)
2870
2903
  }, l = {
2871
2904
  type: "strikethroughText",
2872
- start: Object.assign({}, n[s][1].end),
2905
+ start: Object.assign({}, n[u][1].end),
2873
2906
  end: Object.assign({}, n[c][1].start)
2874
- }, p = [["enter", f, u], ["enter", n[s][1], u], ["exit", n[s][1], u], ["enter", l, u]], g = u.parser.constructs.insideSpan.null;
2875
- g && Re(p, p.length, 0, Pi(g, n.slice(s + 1, c), u)), Re(p, p.length, 0, [["exit", l, u], ["enter", n[c][1], u], ["exit", n[c][1], u], ["exit", f, u]]), Re(n, s - 1, c - s + 3, p), c = s + p.length - 2;
2907
+ }, p = [["enter", f, s], ["enter", n[u][1], s], ["exit", n[u][1], s], ["enter", l, s]], g = s.parser.constructs.insideSpan.null;
2908
+ g && ze(p, p.length, 0, Ri(g, n.slice(u + 1, c), s)), ze(p, p.length, 0, [["exit", l, s], ["enter", n[c][1], s], ["exit", n[c][1], s], ["exit", f, s]]), ze(n, u - 1, c - u + 3, p), c = u + p.length - 2;
2876
2909
  break;
2877
2910
  }
2878
2911
  }
@@ -2880,20 +2913,20 @@ function Wi(e) {
2880
2913
  n[c][1].type === "strikethroughSequenceTemporary" && (n[c][1].type = "data");
2881
2914
  return n;
2882
2915
  }
2883
- function o(n, u, c) {
2884
- const s = this.previous, f = this.events;
2916
+ function o(n, s, c) {
2917
+ const u = this.previous, f = this.events;
2885
2918
  let l = 0;
2886
2919
  return p;
2887
2920
  function p(m) {
2888
- return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? c(m) : (n.enter("strikethroughSequenceTemporary"), g(m));
2921
+ return u === 126 && f[f.length - 1][1].type !== "characterEscape" ? c(m) : (n.enter("strikethroughSequenceTemporary"), g(m));
2889
2922
  }
2890
2923
  function g(m) {
2891
- const x = _e(s);
2924
+ const x = $e(u);
2892
2925
  if (m === 126)
2893
2926
  return l > 1 ? c(m) : (n.consume(m), l++, g);
2894
2927
  if (l < 2 && !t) return c(m);
2895
- const b = n.exit("strikethroughSequenceTemporary"), y = _e(m);
2896
- return b._open = !y || y === 2 && !!x, b._close = !x || x === 2 && !!y, u(m);
2928
+ const b = n.exit("strikethroughSequenceTemporary"), y = $e(m);
2929
+ return b._open = !y || y === 2 && !!x, b._close = !x || x === 2 && !!y, s(m);
2897
2930
  }
2898
2931
  }
2899
2932
  }
@@ -2913,7 +2946,7 @@ class Hi {
2913
2946
  * @returns {undefined}
2914
2947
  */
2915
2948
  add(r, t, a) {
2916
- qi(this, r, t, a);
2949
+ Vi(this, r, t, a);
2917
2950
  }
2918
2951
  // To do: add this when moving to `micromark`.
2919
2952
  // /**
@@ -2952,7 +2985,7 @@ class Hi {
2952
2985
  this.map.length = 0;
2953
2986
  }
2954
2987
  }
2955
- function qi(e, r, t, a) {
2988
+ function Vi(e, r, t, a) {
2956
2989
  let i = 0;
2957
2990
  if (!(t === 0 && a.length === 0)) {
2958
2991
  for (; i < e.map.length; ) {
@@ -2965,7 +2998,7 @@ function qi(e, r, t, a) {
2965
2998
  e.map.push([r, t, a]);
2966
2999
  }
2967
3000
  }
2968
- function Vi(e, r) {
3001
+ function Xi(e, r) {
2969
3002
  let t = !1;
2970
3003
  const a = [];
2971
3004
  for (; r < e.length; ) {
@@ -2985,70 +3018,70 @@ function Vi(e, r) {
2985
3018
  }
2986
3019
  return a;
2987
3020
  }
2988
- function Xi() {
3021
+ function Ki() {
2989
3022
  return {
2990
3023
  flow: {
2991
3024
  null: {
2992
3025
  name: "table",
2993
- tokenize: Ki,
2994
- resolveAll: Qi
3026
+ tokenize: Qi,
3027
+ resolveAll: Gi
2995
3028
  }
2996
3029
  }
2997
3030
  };
2998
3031
  }
2999
- function Ki(e, r, t) {
3032
+ function Qi(e, r, t) {
3000
3033
  const a = this;
3001
3034
  let i = 0, o = 0, n;
3002
- return u;
3003
- function u(h) {
3004
- let _ = a.events.length - 1;
3005
- for (; _ > -1; ) {
3006
- const te = a.events[_][1].type;
3007
- if (te === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
3008
- te === "linePrefix") _--;
3035
+ return s;
3036
+ function s(h) {
3037
+ let B = a.events.length - 1;
3038
+ for (; B > -1; ) {
3039
+ const K = a.events[B][1].type;
3040
+ if (K === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
3041
+ K === "linePrefix") B--;
3009
3042
  else break;
3010
3043
  }
3011
- const H = _ > -1 ? a.events[_][1].type : null, W = H === "tableHead" || H === "tableRow" ? C : c;
3012
- return W === C && a.parser.lazy[a.now().line] ? t(h) : W(h);
3044
+ const z = B > -1 ? a.events[B][1].type : null, X = z === "tableHead" || z === "tableRow" ? C : c;
3045
+ return X === C && a.parser.lazy[a.now().line] ? t(h) : X(h);
3013
3046
  }
3014
3047
  function c(h) {
3015
- return e.enter("tableHead"), e.enter("tableRow"), s(h);
3048
+ return e.enter("tableHead"), e.enter("tableRow"), u(h);
3016
3049
  }
3017
- function s(h) {
3050
+ function u(h) {
3018
3051
  return h === 124 || (n = !0, o += 1), f(h);
3019
3052
  }
3020
3053
  function f(h) {
3021
- return h === null ? t(h) : fe(h) ? o > 1 ? (o = 0, a.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(h), e.exit("lineEnding"), g) : t(h) : G(h) ? Z(e, f, "whitespace")(h) : (o += 1, n && (n = !1, i += 1), h === 124 ? (e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), n = !0, f) : (e.enter("data"), l(h)));
3054
+ return h === null ? t(h) : ge(h) ? o > 1 ? (o = 0, a.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(h), e.exit("lineEnding"), g) : t(h) : te(h) ? re(e, f, "whitespace")(h) : (o += 1, n && (n = !1, i += 1), h === 124 ? (e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), n = !0, f) : (e.enter("data"), l(h)));
3022
3055
  }
3023
3056
  function l(h) {
3024
- return h === null || h === 124 || B(h) ? (e.exit("data"), f(h)) : (e.consume(h), h === 92 ? p : l);
3057
+ return h === null || h === 124 || W(h) ? (e.exit("data"), f(h)) : (e.consume(h), h === 92 ? p : l);
3025
3058
  }
3026
3059
  function p(h) {
3027
3060
  return h === 92 || h === 124 ? (e.consume(h), l) : l(h);
3028
3061
  }
3029
3062
  function g(h) {
3030
- return a.interrupt = !1, a.parser.lazy[a.now().line] ? t(h) : (e.enter("tableDelimiterRow"), n = !1, G(h) ? Z(e, m, "linePrefix", a.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(h) : m(h));
3063
+ return a.interrupt = !1, a.parser.lazy[a.now().line] ? t(h) : (e.enter("tableDelimiterRow"), n = !1, te(h) ? re(e, m, "linePrefix", a.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(h) : m(h));
3031
3064
  }
3032
3065
  function m(h) {
3033
3066
  return h === 45 || h === 58 ? b(h) : h === 124 ? (n = !0, e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), x) : I(h);
3034
3067
  }
3035
3068
  function x(h) {
3036
- return G(h) ? Z(e, b, "whitespace")(h) : b(h);
3069
+ return te(h) ? re(e, b, "whitespace")(h) : b(h);
3037
3070
  }
3038
3071
  function b(h) {
3039
- return h === 58 ? (o += 1, n = !0, e.enter("tableDelimiterMarker"), e.consume(h), e.exit("tableDelimiterMarker"), y) : h === 45 ? (o += 1, y(h)) : h === null || fe(h) ? L(h) : I(h);
3072
+ return h === 58 ? (o += 1, n = !0, e.enter("tableDelimiterMarker"), e.consume(h), e.exit("tableDelimiterMarker"), y) : h === 45 ? (o += 1, y(h)) : h === null || ge(h) ? P(h) : I(h);
3040
3073
  }
3041
3074
  function y(h) {
3042
3075
  return h === 45 ? (e.enter("tableDelimiterFiller"), k(h)) : I(h);
3043
3076
  }
3044
3077
  function k(h) {
3045
- return h === 45 ? (e.consume(h), k) : h === 58 ? (n = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(h), e.exit("tableDelimiterMarker"), T) : (e.exit("tableDelimiterFiller"), T(h));
3078
+ return h === 45 ? (e.consume(h), k) : h === 58 ? (n = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(h), e.exit("tableDelimiterMarker"), v) : (e.exit("tableDelimiterFiller"), v(h));
3046
3079
  }
3047
- function T(h) {
3048
- return G(h) ? Z(e, L, "whitespace")(h) : L(h);
3080
+ function v(h) {
3081
+ return te(h) ? re(e, P, "whitespace")(h) : P(h);
3049
3082
  }
3050
- function L(h) {
3051
- return h === 124 ? m(h) : h === null || fe(h) ? !n || i !== o ? I(h) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(h)) : I(h);
3083
+ function P(h) {
3084
+ return h === 124 ? m(h) : h === null || ge(h) ? !n || i !== o ? I(h) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(h)) : I(h);
3052
3085
  }
3053
3086
  function I(h) {
3054
3087
  return t(h);
@@ -3057,51 +3090,51 @@ function Ki(e, r, t) {
3057
3090
  return e.enter("tableRow"), D(h);
3058
3091
  }
3059
3092
  function D(h) {
3060
- return h === 124 ? (e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), D) : h === null || fe(h) ? (e.exit("tableRow"), r(h)) : G(h) ? Z(e, D, "whitespace")(h) : (e.enter("data"), A(h));
3093
+ return h === 124 ? (e.enter("tableCellDivider"), e.consume(h), e.exit("tableCellDivider"), D) : h === null || ge(h) ? (e.exit("tableRow"), r(h)) : te(h) ? re(e, D, "whitespace")(h) : (e.enter("data"), E(h));
3061
3094
  }
3062
- function A(h) {
3063
- return h === null || h === 124 || B(h) ? (e.exit("data"), D(h)) : (e.consume(h), h === 92 ? N : A);
3095
+ function E(h) {
3096
+ return h === null || h === 124 || W(h) ? (e.exit("data"), D(h)) : (e.consume(h), h === 92 ? A : E);
3064
3097
  }
3065
- function N(h) {
3066
- return h === 92 || h === 124 ? (e.consume(h), A) : A(h);
3098
+ function A(h) {
3099
+ return h === 92 || h === 124 ? (e.consume(h), E) : E(h);
3067
3100
  }
3068
3101
  }
3069
- function Qi(e, r) {
3070
- let t = -1, a = !0, i = 0, o = [0, 0, 0, 0], n = [0, 0, 0, 0], u = !1, c = 0, s, f, l;
3102
+ function Gi(e, r) {
3103
+ let t = -1, a = !0, i = 0, o = [0, 0, 0, 0], n = [0, 0, 0, 0], s = !1, c = 0, u, f, l;
3071
3104
  const p = new Hi();
3072
3105
  for (; ++t < e.length; ) {
3073
3106
  const g = e[t], m = g[1];
3074
- g[0] === "enter" ? m.type === "tableHead" ? (u = !1, c !== 0 && (Dt(p, r, c, s, f), f = void 0, c = 0), s = {
3107
+ g[0] === "enter" ? m.type === "tableHead" ? (s = !1, c !== 0 && (Et(p, r, c, u, f), f = void 0, c = 0), u = {
3075
3108
  type: "table",
3076
3109
  start: Object.assign({}, m.start),
3077
3110
  // Note: correct end is set later.
3078
3111
  end: Object.assign({}, m.end)
3079
- }, p.add(t, 0, [["enter", s, r]])) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (a = !0, l = void 0, o = [0, 0, 0, 0], n = [0, t + 1, 0, 0], u && (u = !1, f = {
3112
+ }, p.add(t, 0, [["enter", u, r]])) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (a = !0, l = void 0, o = [0, 0, 0, 0], n = [0, t + 1, 0, 0], s && (s = !1, f = {
3080
3113
  type: "tableBody",
3081
3114
  start: Object.assign({}, m.start),
3082
3115
  // Note: correct end is set later.
3083
3116
  end: Object.assign({}, m.end)
3084
- }, p.add(t, 0, [["enter", f, r]])), i = m.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") ? (a = !1, n[2] === 0 && (o[1] !== 0 && (n[0] = n[1], l = Pe(p, r, o, i, void 0, l), o = [0, 0, 0, 0]), n[2] = t)) : m.type === "tableCellDivider" && (a ? a = !1 : (o[1] !== 0 && (n[0] = n[1], l = Pe(p, r, o, i, void 0, l)), o = n, n = [o[1], t, 0, 0])) : m.type === "tableHead" ? (u = !0, c = t) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (c = t, o[1] !== 0 ? (n[0] = n[1], l = Pe(p, r, o, i, t, l)) : n[1] !== 0 && (l = Pe(p, r, n, i, t, l)), i = 0) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") && (n[3] = t);
3117
+ }, p.add(t, 0, [["enter", f, r]])), i = m.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") ? (a = !1, n[2] === 0 && (o[1] !== 0 && (n[0] = n[1], l = Fe(p, r, o, i, void 0, l), o = [0, 0, 0, 0]), n[2] = t)) : m.type === "tableCellDivider" && (a ? a = !1 : (o[1] !== 0 && (n[0] = n[1], l = Fe(p, r, o, i, void 0, l)), o = n, n = [o[1], t, 0, 0])) : m.type === "tableHead" ? (s = !0, c = t) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (c = t, o[1] !== 0 ? (n[0] = n[1], l = Fe(p, r, o, i, t, l)) : n[1] !== 0 && (l = Fe(p, r, n, i, t, l)), i = 0) : i && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") && (n[3] = t);
3085
3118
  }
3086
- for (c !== 0 && Dt(p, r, c, s, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
3119
+ for (c !== 0 && Et(p, r, c, u, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
3087
3120
  const g = r.events[t];
3088
- g[0] === "enter" && g[1].type === "table" && (g[1]._align = Vi(r.events, t));
3121
+ g[0] === "enter" && g[1].type === "table" && (g[1]._align = Xi(r.events, t));
3089
3122
  }
3090
3123
  return e;
3091
3124
  }
3092
- function Pe(e, r, t, a, i, o) {
3093
- const n = a === 1 ? "tableHeader" : a === 2 ? "tableDelimiter" : "tableData", u = "tableContent";
3094
- t[0] !== 0 && (o.end = Object.assign({}, le(r.events, t[0])), e.add(t[0], 0, [["exit", o, r]]));
3095
- const c = le(r.events, t[1]);
3125
+ function Fe(e, r, t, a, i, o) {
3126
+ const n = a === 1 ? "tableHeader" : a === 2 ? "tableDelimiter" : "tableData", s = "tableContent";
3127
+ t[0] !== 0 && (o.end = Object.assign({}, me(r.events, t[0])), e.add(t[0], 0, [["exit", o, r]]));
3128
+ const c = me(r.events, t[1]);
3096
3129
  if (o = {
3097
3130
  type: n,
3098
3131
  start: Object.assign({}, c),
3099
3132
  // Note: correct end is set later.
3100
3133
  end: Object.assign({}, c)
3101
3134
  }, e.add(t[1], 0, [["enter", o, r]]), t[2] !== 0) {
3102
- const s = le(r.events, t[2]), f = le(r.events, t[3]), l = {
3103
- type: u,
3104
- start: Object.assign({}, s),
3135
+ const u = me(r.events, t[2]), f = me(r.events, t[3]), l = {
3136
+ type: s,
3137
+ start: Object.assign({}, u),
3105
3138
  end: Object.assign({}, f)
3106
3139
  };
3107
3140
  if (e.add(t[2], 0, [["enter", l, r]]), a !== 2) {
@@ -3113,28 +3146,28 @@ function Pe(e, r, t, a, i, o) {
3113
3146
  }
3114
3147
  e.add(t[3] + 1, 0, [["exit", l, r]]);
3115
3148
  }
3116
- return i !== void 0 && (o.end = Object.assign({}, le(r.events, i)), e.add(i, 0, [["exit", o, r]]), o = void 0), o;
3149
+ return i !== void 0 && (o.end = Object.assign({}, me(r.events, i)), e.add(i, 0, [["exit", o, r]]), o = void 0), o;
3117
3150
  }
3118
- function Dt(e, r, t, a, i) {
3119
- const o = [], n = le(r.events, t);
3151
+ function Et(e, r, t, a, i) {
3152
+ const o = [], n = me(r.events, t);
3120
3153
  i && (i.end = Object.assign({}, n), o.push(["exit", i, r])), a.end = Object.assign({}, n), o.push(["exit", a, r]), e.add(t + 1, 0, o);
3121
3154
  }
3122
- function le(e, r) {
3155
+ function me(e, r) {
3123
3156
  const t = e[r], a = t[0] === "enter" ? "start" : "end";
3124
3157
  return t[1][a];
3125
3158
  }
3126
- const Gi = {
3159
+ const Zi = {
3127
3160
  name: "tasklistCheck",
3128
- tokenize: Ji
3161
+ tokenize: Yi
3129
3162
  };
3130
- function Zi() {
3163
+ function Ji() {
3131
3164
  return {
3132
3165
  text: {
3133
- 91: Gi
3166
+ 91: Zi
3134
3167
  }
3135
3168
  };
3136
3169
  }
3137
- function Ji(e, r, t) {
3170
+ function Yi(e, r, t) {
3138
3171
  const a = this;
3139
3172
  return i;
3140
3173
  function i(c) {
@@ -3146,53 +3179,53 @@ function Ji(e, r, t) {
3146
3179
  );
3147
3180
  }
3148
3181
  function o(c) {
3149
- return B(c) ? (e.enter("taskListCheckValueUnchecked"), e.consume(c), e.exit("taskListCheckValueUnchecked"), n) : c === 88 || c === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(c), e.exit("taskListCheckValueChecked"), n) : t(c);
3182
+ return W(c) ? (e.enter("taskListCheckValueUnchecked"), e.consume(c), e.exit("taskListCheckValueUnchecked"), n) : c === 88 || c === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(c), e.exit("taskListCheckValueChecked"), n) : t(c);
3150
3183
  }
3151
3184
  function n(c) {
3152
- return c === 93 ? (e.enter("taskListCheckMarker"), e.consume(c), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(c);
3185
+ return c === 93 ? (e.enter("taskListCheckMarker"), e.consume(c), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), s) : t(c);
3153
3186
  }
3154
- function u(c) {
3155
- return fe(c) ? r(c) : G(c) ? e.check({
3156
- tokenize: Yi
3187
+ function s(c) {
3188
+ return ge(c) ? r(c) : te(c) ? e.check({
3189
+ tokenize: eo
3157
3190
  }, r, t)(c) : t(c);
3158
3191
  }
3159
3192
  }
3160
- function Yi(e, r, t) {
3161
- return Z(e, a, "whitespace");
3193
+ function eo(e, r, t) {
3194
+ return re(e, a, "whitespace");
3162
3195
  function a(i) {
3163
3196
  return i === null ? t(i) : r(i);
3164
3197
  }
3165
3198
  }
3166
- function eo(e) {
3167
- return bi([
3168
- vi(),
3169
- Ei(),
3170
- Wi(e),
3171
- Xi(),
3172
- Zi()
3199
+ function to(e) {
3200
+ return yi([
3201
+ Ci(),
3202
+ Fi(),
3203
+ qi(e),
3204
+ Ki(),
3205
+ Ji()
3173
3206
  ]);
3174
3207
  }
3175
- const to = {};
3176
- function ro(e) {
3208
+ const ro = {};
3209
+ function ao(e) {
3177
3210
  const r = (
3178
3211
  /** @type {Processor<Root>} */
3179
3212
  this
3180
- ), t = e || to, a = r.data(), i = a.micromarkExtensions || (a.micromarkExtensions = []), o = a.fromMarkdownExtensions || (a.fromMarkdownExtensions = []), n = a.toMarkdownExtensions || (a.toMarkdownExtensions = []);
3181
- i.push(eo(t)), o.push(pi()), n.push(gi(t));
3213
+ ), t = e || ro, a = r.data(), i = a.micromarkExtensions || (a.micromarkExtensions = []), o = a.fromMarkdownExtensions || (a.fromMarkdownExtensions = []), n = a.toMarkdownExtensions || (a.toMarkdownExtensions = []);
3214
+ i.push(to(t)), o.push(gi()), n.push(bi(t));
3182
3215
  }
3183
- function j(...e) {
3216
+ function $(...e) {
3184
3217
  return e.filter(Boolean).join(" ");
3185
3218
  }
3186
- const ao = ({ content: e }) => /* @__PURE__ */ d(
3187
- Br,
3219
+ const no = ({ content: e }) => /* @__PURE__ */ d(
3220
+ qr,
3188
3221
  {
3189
- remarkPlugins: [ro],
3222
+ remarkPlugins: [ao],
3190
3223
  className: "cuadra-aui-md",
3191
- components: oo,
3224
+ components: co,
3192
3225
  children: e
3193
3226
  }
3194
- ), st = Pr(ao), no = ({ language: e, code: r }) => {
3195
- const { isCopied: t, copyToClipboard: a } = io();
3227
+ ), ht = Dr(no), io = ({ language: e, code: r }) => {
3228
+ const { isCopied: t, copyToClipboard: a } = oo();
3196
3229
  return /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-between cuadra-gap-4 cuadra-mt-4 cuadra-rounded-t-lg cuadra-bg-muted/50 cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-font-brand", children: [
3197
3230
  /* @__PURE__ */ d("span", { className: "cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand", children: e }),
3198
3231
  /* @__PURE__ */ w(
@@ -3204,13 +3237,13 @@ const ao = ({ content: e }) => /* @__PURE__ */ d(
3204
3237
  className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-muted cuadra-transition-colors",
3205
3238
  "aria-label": "Copy code",
3206
3239
  children: [
3207
- !t && /* @__PURE__ */ d(aa, { className: "cuadra-h-4 cuadra-w-4" }),
3208
- t && /* @__PURE__ */ d(Jr, { className: "cuadra-h-4 cuadra-w-4" })
3240
+ !t && /* @__PURE__ */ d(ia, { className: "cuadra-h-4 cuadra-w-4" }),
3241
+ t && /* @__PURE__ */ d(ea, { className: "cuadra-h-4 cuadra-w-4" })
3209
3242
  ]
3210
3243
  }
3211
3244
  )
3212
3245
  ] });
3213
- }, io = ({
3246
+ }, oo = ({
3214
3247
  copiedDuration: e = 3e3
3215
3248
  } = {}) => {
3216
3249
  const [r, t] = R(!1);
@@ -3219,18 +3252,18 @@ const ao = ({ content: e }) => /* @__PURE__ */ d(
3219
3252
  t(!0), setTimeout(() => t(!1), e);
3220
3253
  });
3221
3254
  } };
3222
- }, oo = Or({
3255
+ }, co = Br({
3223
3256
  h1: ({ className: e, ...r }) => /* @__PURE__ */ d(
3224
3257
  "h1",
3225
3258
  {
3226
- className: j("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
3259
+ className: $("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
3227
3260
  ...r
3228
3261
  }
3229
3262
  ),
3230
3263
  h2: ({ className: e, ...r }) => /* @__PURE__ */ d(
3231
3264
  "h2",
3232
3265
  {
3233
- className: j(
3266
+ className: $(
3234
3267
  "cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
3235
3268
  e
3236
3269
  ),
@@ -3240,7 +3273,7 @@ const ao = ({ content: e }) => /* @__PURE__ */ d(
3240
3273
  h3: ({ className: e, ...r }) => /* @__PURE__ */ d(
3241
3274
  "h3",
3242
3275
  {
3243
- className: j(
3276
+ className: $(
3244
3277
  "cuadra-mb-3 cuadra-mt-5 cuadra-scroll-m-20 cuadra-text-lg cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
3245
3278
  e
3246
3279
  ),
@@ -3250,38 +3283,38 @@ const ao = ({ content: e }) => /* @__PURE__ */ d(
3250
3283
  h4: ({ className: e, ...r }) => /* @__PURE__ */ d(
3251
3284
  "h4",
3252
3285
  {
3253
- className: j(
3286
+ className: $(
3254
3287
  "cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
3255
3288
  e
3256
3289
  ),
3257
3290
  ...r
3258
3291
  }
3259
3292
  ),
3260
- h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className: j("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3261
- h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className: j("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
3262
- p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className: j("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3293
+ h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className: $("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3294
+ h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className: $("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
3295
+ p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className: $("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3263
3296
  a: ({ className: e, ...r }) => /* @__PURE__ */ d(
3264
3297
  "a",
3265
3298
  {
3266
- className: j("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
3299
+ className: $("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
3267
3300
  ...r
3268
3301
  }
3269
3302
  ),
3270
- blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className: j("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
3271
- ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className: j("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3272
- ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className: j("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3273
- hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className: j("cuadra-my-5 cuadra-border-b", e), ...r }),
3303
+ blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className: $("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
3304
+ ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className: $("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3305
+ ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className: $("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3306
+ hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className: $("cuadra-my-5 cuadra-border-b", e), ...r }),
3274
3307
  table: ({ className: e, ...r }) => /* @__PURE__ */ d(
3275
3308
  "table",
3276
3309
  {
3277
- className: j("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
3310
+ className: $("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
3278
3311
  ...r
3279
3312
  }
3280
3313
  ),
3281
3314
  th: ({ className: e, ...r }) => /* @__PURE__ */ d(
3282
3315
  "th",
3283
3316
  {
3284
- className: j(
3317
+ className: $(
3285
3318
  "cuadra-bg-muted cuadra-px-4 cuadra-py-2 cuadra-text-left cuadra-font-normal first:cuadra-rounded-tl-lg last:cuadra-rounded-tr-lg [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
3286
3319
  e
3287
3320
  ),
@@ -3291,7 +3324,7 @@ const ao = ({ content: e }) => /* @__PURE__ */ d(
3291
3324
  td: ({ className: e, ...r }) => /* @__PURE__ */ d(
3292
3325
  "td",
3293
3326
  {
3294
- className: j(
3327
+ className: $(
3295
3328
  "cuadra-border-b cuadra-border-l cuadra-px-4 cuadra-py-2 cuadra-text-left last:cuadra-border-r [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
3296
3329
  e
3297
3330
  ),
@@ -3301,18 +3334,18 @@ const ao = ({ content: e }) => /* @__PURE__ */ d(
3301
3334
  tr: ({ className: e, ...r }) => /* @__PURE__ */ d(
3302
3335
  "tr",
3303
3336
  {
3304
- className: j(
3337
+ className: $(
3305
3338
  "cuadra-m-0 cuadra-border-b cuadra-p-0 first:cuadra-border-t [&:last-child>td:first-child]:cuadra-rounded-bl-lg [&:last-child>td:last-child]:cuadra-rounded-br-lg",
3306
3339
  e
3307
3340
  ),
3308
3341
  ...r
3309
3342
  }
3310
3343
  ),
3311
- sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className: j("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
3344
+ sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className: $("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
3312
3345
  pre: ({ className: e, ...r }) => /* @__PURE__ */ d(
3313
3346
  "pre",
3314
3347
  {
3315
- className: j(
3348
+ className: $(
3316
3349
  "cuadra-overflow-x-auto cuadra-rounded-b-lg !cuadra-rounded-t-none cuadra-bg-muted cuadra-p-4 cuadra-text-foreground font-brand",
3317
3350
  e
3318
3351
  ),
@@ -3320,18 +3353,18 @@ const ao = ({ content: e }) => /* @__PURE__ */ d(
3320
3353
  }
3321
3354
  ),
3322
3355
  code: function({ className: r, ...t }) {
3323
- const a = Ur();
3356
+ const a = Wr();
3324
3357
  return /* @__PURE__ */ d(
3325
3358
  "code",
3326
3359
  {
3327
- className: j(!a && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
3360
+ className: $(!a && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
3328
3361
  ...t
3329
3362
  }
3330
3363
  );
3331
3364
  },
3332
- CodeHeader: no
3365
+ CodeHeader: io
3333
3366
  });
3334
- function wr({ className: e = "", variant: r = "default", ...t }) {
3367
+ function Cr({ className: e = "", variant: r = "default", ...t }) {
3335
3368
  const a = "cuadra-inline-flex cuadra-items-center cuadra-rounded-md cuadra-px-3 cuadra-py-1.5 cuadra-text-xs cuadra-font-medium font-brand", i = {
3336
3369
  default: "cuadra-border cuadra-border-border cuadra-bg-muted cuadra-text-muted-foreground",
3337
3370
  subtle: "cuadra-border cuadra-border-border/50 cuadra-bg-muted/50 cuadra-text-muted-foreground",
@@ -3346,7 +3379,7 @@ function wr({ className: e = "", variant: r = "default", ...t }) {
3346
3379
  }
3347
3380
  );
3348
3381
  }
3349
- function co(e) {
3382
+ function so(e) {
3350
3383
  const r = /* @__PURE__ */ new Map();
3351
3384
  for (const t of e) {
3352
3385
  const a = r.get(t.filename);
@@ -3359,15 +3392,15 @@ function uo({
3359
3392
  maxVisible: r = 3
3360
3393
  }) {
3361
3394
  if (!e || e.length === 0) return null;
3362
- const t = co(e), a = t.slice(0, r), i = t.length - r;
3395
+ const t = so(e), a = t.slice(0, r), i = t.length - r;
3363
3396
  return /* @__PURE__ */ w("div", { className: "cuadra-mt-4 cuadra-pt-3 cuadra-border-t cuadra-border-border", children: [
3364
3397
  /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-1.5 cuadra-mb-2.5", children: [
3365
- /* @__PURE__ */ d(Ut, { className: "cuadra-h-3.5 cuadra-w-3.5 cuadra-text-muted-foreground" }),
3398
+ /* @__PURE__ */ d(Wt, { className: "cuadra-h-3.5 cuadra-w-3.5 cuadra-text-muted-foreground" }),
3366
3399
  /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-font-medium cuadra-text-muted-foreground font-brand", children: "Sources" })
3367
3400
  ] }),
3368
3401
  /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-flex-wrap cuadra-gap-2", children: [
3369
- a.map((o, n) => /* @__PURE__ */ d(lo, { source: o }, o.sourceId || n)),
3370
- i > 0 && /* @__PURE__ */ w(wr, { variant: "subtle", children: [
3402
+ a.map((o, n) => /* @__PURE__ */ d(fo, { source: o }, o.sourceId || n)),
3403
+ i > 0 && /* @__PURE__ */ w(Cr, { variant: "subtle", children: [
3371
3404
  "+",
3372
3405
  i,
3373
3406
  " more"
@@ -3375,23 +3408,23 @@ function uo({
3375
3408
  ] })
3376
3409
  ] });
3377
3410
  }
3378
- function so(e) {
3411
+ function lo(e) {
3379
3412
  switch (e.split(".").pop()?.toLowerCase()) {
3380
3413
  case "csv":
3381
3414
  case "xlsx":
3382
3415
  case "xls":
3383
- return ca;
3416
+ return ua;
3384
3417
  case "md":
3385
3418
  case "txt":
3386
- return la;
3419
+ return fa;
3387
3420
  default:
3388
- return Ut;
3421
+ return Wt;
3389
3422
  }
3390
3423
  }
3391
- function lo({ source: e }) {
3392
- const { filename: r, score: t } = e, a = so(r);
3424
+ function fo({ source: e }) {
3425
+ const { filename: r, score: t } = e, a = lo(r);
3393
3426
  return /* @__PURE__ */ w(
3394
- wr,
3427
+ Cr,
3395
3428
  {
3396
3429
  className: "cuadra-gap-2 cuadra-cursor-default",
3397
3430
  title: t < 1 ? `${Math.round(t * 100)}% relevant` : void 0,
@@ -3406,7 +3439,7 @@ function lo({ source: e }) {
3406
3439
  }
3407
3440
  );
3408
3441
  }
3409
- const _t = ve(
3442
+ const Ft = Ae(
3410
3443
  function({
3411
3444
  welcomeTitle: r = "Hi, how can I help you today?",
3412
3445
  welcomeSubtitle: t = "Start exploring our platform and discover what you can build.",
@@ -3414,50 +3447,50 @@ const _t = ve(
3414
3447
  suggestions: i,
3415
3448
  inputPlaceholder: o = "Type your message...",
3416
3449
  enableAttachments: n = !1,
3417
- preMadeResponseDelay: u = 1e3,
3450
+ preMadeResponseDelay: s = 1e3,
3418
3451
  streamingSpeed: c = 50
3419
- }, s) {
3420
- const f = Fr(), l = zr(), [p, g] = R(!1), [m, x] = R(null), [b, y] = R(!1), k = X((C, D, A) => {
3452
+ }, u) {
3453
+ const f = jr(), l = $r(), [p, g] = R(!1), [m, x] = R(null), [b, y] = R(!1), k = G((C, D, E) => {
3421
3454
  if (!b)
3422
3455
  try {
3423
- const N = A?.streamingSpeed ?? c, h = A?.delay ?? u;
3424
- Ma(C, D, N, h), l.composer().setText(C), setTimeout(() => {
3456
+ const A = E?.streamingSpeed ?? c, h = E?.delay ?? s;
3457
+ Xt(C, D, A, h), l.composer().setText(C), setTimeout(() => {
3425
3458
  l.composer().send();
3426
3459
  }, 10);
3427
3460
  } catch {
3428
3461
  }
3429
- }, [b, c, u, l]), T = X((C) => {
3462
+ }, [b, c, s, l]), v = G((C) => {
3430
3463
  try {
3431
3464
  l.composer().setText(C), setTimeout(() => {
3432
3465
  l.composer().send();
3433
3466
  }, 10);
3434
3467
  } catch {
3435
3468
  }
3436
- }, [l]), L = X(async (C) => {
3469
+ }, [l]), P = G(async (C) => {
3437
3470
  if (!(b || !f))
3438
3471
  try {
3439
3472
  if (C.response) {
3440
- const D = C.responseDelay ?? u;
3473
+ const D = C.responseDelay ?? s;
3441
3474
  await k(C.prompt, C.response, {
3442
3475
  delay: D,
3443
3476
  streamingSpeed: c
3444
3477
  });
3445
3478
  } else
3446
- T(C.prompt);
3479
+ v(C.prompt);
3447
3480
  } catch {
3448
3481
  }
3449
- }, [f, b, u, c, k, T]), I = X(() => {
3482
+ }, [f, b, s, c, k, v]), I = G(() => {
3450
3483
  try {
3451
3484
  const C = window.__cuadraThreadListRuntime;
3452
3485
  C?.switchToNewThread && C.switchToNewThread();
3453
3486
  } catch {
3454
3487
  }
3455
3488
  }, []);
3456
- return at(s, () => ({
3457
- sendMessage: T,
3489
+ return ct(u, () => ({
3490
+ sendMessage: v,
3458
3491
  sendPreMadeQA: k,
3459
3492
  clearChat: I
3460
- }), [T, k, I]), O(() => {
3493
+ }), [v, k, I]), O(() => {
3461
3494
  if (!f) {
3462
3495
  g(!1);
3463
3496
  return;
@@ -3468,13 +3501,13 @@ const _t = ve(
3468
3501
  g(!1);
3469
3502
  return;
3470
3503
  }
3471
- const D = C.subscribe?.((N) => {
3472
- const h = N?.threadId, _ = N?.messages || [], H = N?.isLoadingHistory || !1, W = _.length;
3473
- h && h !== m && x(h), g(H && W === 0);
3474
- }), A = C.getState?.();
3475
- if (A) {
3476
- const N = A?.threadId, h = A?.messages || [], _ = A?.isLoadingHistory || !1, H = h.length;
3477
- N && N !== m && x(N), g(_ && H === 0);
3504
+ const D = C.subscribe?.((A) => {
3505
+ const h = A?.threadId, B = A?.messages || [], z = A?.isLoadingHistory || !1, X = B.length;
3506
+ h && h !== m && x(h), g(z && X === 0);
3507
+ }), E = C.getState?.();
3508
+ if (E) {
3509
+ const A = E?.threadId, h = E?.messages || [], B = E?.isLoadingHistory || !1, z = h.length;
3510
+ A && A !== m && x(A), g(B && z === 0);
3478
3511
  }
3479
3512
  return () => {
3480
3513
  D && D();
@@ -3482,32 +3515,32 @@ const _t = ve(
3482
3515
  } catch {
3483
3516
  g(!1);
3484
3517
  }
3485
- }, [f, m]), /* @__PURE__ */ w(Se.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
3518
+ }, [f, m]), /* @__PURE__ */ w(_e.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
3486
3519
  /* @__PURE__ */ d(
3487
- Se.Viewport,
3520
+ _e.Viewport,
3488
3521
  {
3489
3522
  className: "cuadra-w-full cuadra-bg-inherit cuadra-px-4 cuadra-flex-1 cuadra-min-h-0 cuadra-overflow-y-auto cuadra-relative scrollbar-thin cuadra-pt-4",
3490
3523
  style: a ? { paddingTop: a } : void 0,
3491
3524
  children: p ? /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
3492
- /* @__PURE__ */ d(Bt, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
3525
+ /* @__PURE__ */ d(qt, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
3493
3526
  /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-muted-foreground font-brand", children: "Loading messages..." })
3494
- ] }) }) : /* @__PURE__ */ w(J, { children: [
3495
- /* @__PURE__ */ d(Se.Empty, { children: /* @__PURE__ */ d(
3496
- fo,
3527
+ ] }) }) : /* @__PURE__ */ w(ae, { children: [
3528
+ /* @__PURE__ */ d(_e.Empty, { children: /* @__PURE__ */ d(
3529
+ ho,
3497
3530
  {
3498
3531
  title: r,
3499
3532
  subtitle: t,
3500
3533
  suggestions: i,
3501
- onSuggestionClick: L,
3534
+ onSuggestionClick: P,
3502
3535
  isProcessing: b
3503
3536
  }
3504
3537
  ) }),
3505
3538
  /* @__PURE__ */ d(
3506
- Se.Messages,
3539
+ _e.Messages,
3507
3540
  {
3508
3541
  components: {
3509
- UserMessage: ho,
3510
- AssistantMessage: go
3542
+ UserMessage: mo,
3543
+ AssistantMessage: bo
3511
3544
  }
3512
3545
  }
3513
3546
  )
@@ -3516,20 +3549,20 @@ const _t = ve(
3516
3549
  ),
3517
3550
  /* @__PURE__ */ w("div", { className: "cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4", children: [
3518
3551
  n && /* @__PURE__ */ d(
3519
- ge.Attachments,
3552
+ ke.Attachments,
3520
3553
  {
3521
3554
  components: {
3522
3555
  Attachment: () => {
3523
- const C = xe(({ attachment: D }) => D);
3556
+ const C = Ce(({ attachment: D }) => D);
3524
3557
  return C ? /* @__PURE__ */ w("div", { className: "cuadra-relative cuadra-inline-flex cuadra-items-center cuadra-gap-2 cuadra-mb-2 cuadra-px-2 cuadra-py-1 cuadra-rounded-md cuadra-bg-muted cuadra-border cuadra-border-border", children: [
3525
3558
  /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground font-brand", children: C.name || "Attachment" }),
3526
- /* @__PURE__ */ d(jr.Remove, { asChild: !0, children: /* @__PURE__ */ d(
3559
+ /* @__PURE__ */ d(Or.Remove, { asChild: !0, children: /* @__PURE__ */ d(
3527
3560
  "button",
3528
3561
  {
3529
3562
  type: "button",
3530
3563
  className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-size-4 cuadra-rounded hover:cuadra-bg-background cuadra-transition-colors",
3531
3564
  "aria-label": "Remove attachment",
3532
- children: /* @__PURE__ */ d(nt, { className: "cuadra-h-3 cuadra-w-3 cuadra-text-muted-foreground" })
3565
+ children: /* @__PURE__ */ d(st, { className: "cuadra-h-3 cuadra-w-3 cuadra-text-muted-foreground" })
3533
3566
  }
3534
3567
  ) })
3535
3568
  ] }) : null;
@@ -3537,9 +3570,9 @@ const _t = ve(
3537
3570
  }
3538
3571
  }
3539
3572
  ),
3540
- /* @__PURE__ */ w(ge.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
3573
+ /* @__PURE__ */ w(ke.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
3541
3574
  /* @__PURE__ */ d(
3542
- ge.Input,
3575
+ ke.Input,
3543
3576
  {
3544
3577
  asChild: !0,
3545
3578
  children: /* @__PURE__ */ d(
@@ -3558,7 +3591,7 @@ const _t = ve(
3558
3591
  }
3559
3592
  ),
3560
3593
  n && /* @__PURE__ */ d(
3561
- ge.AddAttachment,
3594
+ ke.AddAttachment,
3562
3595
  {
3563
3596
  multiple: !0,
3564
3597
  asChild: !0,
@@ -3573,12 +3606,12 @@ const _t = ve(
3573
3606
  right: "3rem"
3574
3607
  },
3575
3608
  "aria-label": "Attach file",
3576
- children: /* @__PURE__ */ d(Wt, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground", strokeWidth: 1.5 })
3609
+ children: /* @__PURE__ */ d(Ht, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground", strokeWidth: 1.5 })
3577
3610
  }
3578
3611
  )
3579
3612
  }
3580
3613
  ),
3581
- /* @__PURE__ */ d(ge.Send, { asChild: !0, children: /* @__PURE__ */ d(
3614
+ /* @__PURE__ */ d(ke.Send, { asChild: !0, children: /* @__PURE__ */ d(
3582
3615
  "button",
3583
3616
  {
3584
3617
  className: "!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-rounded-md cuadra-shadow-sm hover:cuadra-opacity-90 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed cuadra-flex cuadra-items-center cuadra-justify-center",
@@ -3591,7 +3624,7 @@ const _t = ve(
3591
3624
  },
3592
3625
  "aria-label": "Send message",
3593
3626
  type: "button",
3594
- children: /* @__PURE__ */ d(Gr, { className: "cuadra-h-4 cuadra-w-4" })
3627
+ children: /* @__PURE__ */ d(Jr, { className: "cuadra-h-4 cuadra-w-4" })
3595
3628
  }
3596
3629
  ) })
3597
3630
  ] })
@@ -3599,7 +3632,7 @@ const _t = ve(
3599
3632
  ] });
3600
3633
  }
3601
3634
  );
3602
- function fo({ title: e, subtitle: r, suggestions: t, onSuggestionClick: a, isProcessing: i }) {
3635
+ function ho({ title: e, subtitle: r, suggestions: t, onSuggestionClick: a, isProcessing: i }) {
3603
3636
  return /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-h-full cuadra-py-12 cuadra-px-4 cuadra-overflow-y-auto scrollbar-hide", children: /* @__PURE__ */ w("div", { className: "cuadra-text-center cuadra-max-w-3xl cuadra-w-full cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-min-h-full", children: [
3604
3637
  /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8", children: [
3605
3638
  /* @__PURE__ */ d("h2", { className: "cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand", children: e }),
@@ -3619,14 +3652,14 @@ function fo({ title: e, subtitle: r, suggestions: t, onSuggestionClick: a, isPro
3619
3652
  )) })
3620
3653
  ] }) });
3621
3654
  }
3622
- function ho() {
3623
- return /* @__PURE__ */ w(be.Root, { className: "cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2", children: [
3655
+ function mo() {
3656
+ return /* @__PURE__ */ w(we.Root, { className: "cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2", children: [
3624
3657
  /* @__PURE__ */ d(
3625
- be.Attachments,
3658
+ we.Attachments,
3626
3659
  {
3627
3660
  components: {
3628
3661
  Attachment: () => {
3629
- const e = xe(({ attachment: o }) => o);
3662
+ const e = Ce(({ attachment: o }) => o);
3630
3663
  if (!e) return null;
3631
3664
  const r = e.type === "image", t = e.file, a = e.content?.find((o) => o.type === "image"), i = t ? URL.createObjectURL(t) : a?.image;
3632
3665
  return /* @__PURE__ */ d("div", { className: "cuadra-col-start-2 cuadra-row-start-1 cuadra-mb-2 cuadra-max-w-[calc(42rem*0.8)]", children: r && i ? /* @__PURE__ */ d(
@@ -3638,7 +3671,7 @@ function ho() {
3638
3671
  style: { borderWidth: "1px" }
3639
3672
  }
3640
3673
  ) : /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-bg-muted cuadra-px-3 cuadra-py-2", children: [
3641
- /* @__PURE__ */ d(Wt, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3674
+ /* @__PURE__ */ d(Ht, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3642
3675
  /* @__PURE__ */ d("span", { className: "cuadra-text-sm cuadra-text-foreground font-brand", children: e.name || "Attachment" })
3643
3676
  ] }) });
3644
3677
  }
@@ -3662,10 +3695,10 @@ function ho() {
3662
3695
  borderWidth: "1px"
3663
3696
  },
3664
3697
  children: /* @__PURE__ */ d(
3665
- be.Parts,
3698
+ we.Parts,
3666
3699
  {
3667
3700
  components: {
3668
- Text: ({ text: e }) => /* @__PURE__ */ d(st, { content: e || "" })
3701
+ Text: ({ text: e }) => /* @__PURE__ */ d(ht, { content: e || "" })
3669
3702
  }
3670
3703
  }
3671
3704
  )
@@ -3673,8 +3706,8 @@ function ho() {
3673
3706
  )
3674
3707
  ] });
3675
3708
  }
3676
- function mo({ text: e }) {
3677
- const [r, t] = R(!1), a = xe(({ message: i }) => i?.status?.type === "running");
3709
+ function po({ text: e }) {
3710
+ const [r, t] = R(!1), a = Ce(({ message: i }) => i?.status?.type === "running");
3678
3711
  return e ? a ? /* @__PURE__ */ d("div", { className: "cuadra-mb-3 cuadra-py-1", children: /* @__PURE__ */ d("div", { className: "cuadra-text-sm cuadra-text-muted-foreground cuadra-leading-relaxed font-brand cuadra-animate-text-shimmer", children: e }) }) : /* @__PURE__ */ w("div", { className: "cuadra-mb-3", children: [
3679
3712
  /* @__PURE__ */ w(
3680
3713
  "button",
@@ -3684,7 +3717,7 @@ function mo({ text: e }) {
3684
3717
  className: "cuadra-flex cuadra-items-center cuadra-gap-1.5 cuadra-py-1 cuadra-text-sm cuadra-text-muted-foreground hover:cuadra-text-foreground cuadra-transition-colors font-brand",
3685
3718
  children: [
3686
3719
  /* @__PURE__ */ d(
3687
- et,
3720
+ at,
3688
3721
  {
3689
3722
  className: `cuadra-h-3.5 cuadra-w-3.5 cuadra-shrink-0 cuadra-transition-transform cuadra-duration-200 ${r ? "" : "cuadra--rotate-90"}`
3690
3723
  }
@@ -3697,12 +3730,12 @@ function mo({ text: e }) {
3697
3730
  "div",
3698
3731
  {
3699
3732
  className: `cuadra-overflow-hidden cuadra-transition-all cuadra-duration-200 cuadra-ease-out ${r ? "cuadra-max-h-[2000px] cuadra-opacity-100" : "cuadra-max-h-0 cuadra-opacity-0"}`,
3700
- children: /* @__PURE__ */ d("div", { className: "cuadra-pl-5 cuadra-pt-2 cuadra-text-sm cuadra-text-muted-foreground cuadra-leading-relaxed font-brand", children: /* @__PURE__ */ d(st, { content: e }) })
3733
+ children: /* @__PURE__ */ d("div", { className: "cuadra-pl-5 cuadra-pt-2 cuadra-text-sm cuadra-text-muted-foreground cuadra-leading-relaxed font-brand", children: /* @__PURE__ */ d(ht, { content: e }) })
3701
3734
  }
3702
3735
  )
3703
3736
  ] }) : null;
3704
3737
  }
3705
- function po() {
3738
+ function go() {
3706
3739
  return /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 cuadra-text-muted-foreground cuadra-text-sm font-brand cuadra-py-2", children: [
3707
3740
  /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-1", children: [
3708
3741
  /* @__PURE__ */ d("span", { className: "cuadra-inline-block cuadra-w-1.5 cuadra-h-1.5 cuadra-bg-current cuadra-rounded-full cuadra-animate-bounce", style: { animationDelay: "0ms" } }),
@@ -3712,22 +3745,22 @@ function po() {
3712
3745
  /* @__PURE__ */ d("span", { children: "Thinking..." })
3713
3746
  ] });
3714
3747
  }
3715
- function go() {
3716
- const [e] = R(() => ie.getCurrentMessageId()), r = xe(({ message: i }) => i?.status?.type === "running"), t = xe(({ message: i }) => {
3748
+ function bo() {
3749
+ const [e] = R(() => se.getCurrentMessageId()), r = Ce(({ message: i }) => i?.status?.type === "running"), t = Ce(({ message: i }) => {
3717
3750
  const o = i?.content;
3718
3751
  return !o || !Array.isArray(o) ? !1 : o.some((n) => !!(n.type === "text" && n.text && n.text.length > 0 || n.type === "reasoning" && n.text && n.text.length > 0));
3719
- }), a = Rr(
3720
- (i) => ie.subscribe(i),
3752
+ }), a = _r(
3753
+ (i) => se.subscribe(i),
3721
3754
  () => {
3722
3755
  if (e) {
3723
- const i = ie.getForMessage(e);
3756
+ const i = se.getForMessage(e);
3724
3757
  if (i.sources?.length) return i.sources;
3725
3758
  }
3726
- return ie.get().sources || null;
3759
+ return se.get().sources || null;
3727
3760
  },
3728
3761
  () => null
3729
3762
  );
3730
- return /* @__PURE__ */ d(be.Root, { className: "cuadra-relative cuadra-grid cuadra-w-full cuadra-grid-cols-[auto_auto_1fr] cuadra-grid-rows-[auto_1fr] cuadra-py-3", children: /* @__PURE__ */ w(
3763
+ return /* @__PURE__ */ d(we.Root, { className: "cuadra-relative cuadra-grid cuadra-w-full cuadra-grid-cols-[auto_auto_1fr] cuadra-grid-rows-[auto_1fr] cuadra-py-3", children: /* @__PURE__ */ w(
3731
3764
  "div",
3732
3765
  {
3733
3766
  className: "cuadra-text-foreground cuadra-col-span-2 cuadra-col-start-2 cuadra-row-start-1 cuadra-my-1.5 cuadra-max-w-[90%] cuadra-break-words cuadra-leading-7 font-brand",
@@ -3738,21 +3771,21 @@ function go() {
3738
3771
  },
3739
3772
  children: [
3740
3773
  /* @__PURE__ */ d(
3741
- be.Parts,
3774
+ we.Parts,
3742
3775
  {
3743
3776
  components: {
3744
- Text: ({ text: i }) => /* @__PURE__ */ d(st, { content: i || "" }),
3745
- Reasoning: ({ text: i }) => /* @__PURE__ */ d(mo, { text: i || "" })
3777
+ Text: ({ text: i }) => /* @__PURE__ */ d(ht, { content: i || "" }),
3778
+ Reasoning: ({ text: i }) => /* @__PURE__ */ d(po, { text: i || "" })
3746
3779
  }
3747
3780
  }
3748
3781
  ),
3749
- r && !t && /* @__PURE__ */ d(po, {}),
3782
+ r && !t && /* @__PURE__ */ d(go, {}),
3750
3783
  a && a.length > 0 && /* @__PURE__ */ d(uo, { sources: a })
3751
3784
  ]
3752
3785
  }
3753
3786
  ) });
3754
3787
  }
3755
- const vr = ({ className: e = "", theme: r = "system" }) => {
3788
+ const Tr = ({ className: e = "", theme: r = "system" }) => {
3756
3789
  const t = () => {
3757
3790
  if (typeof window > "u") return "light";
3758
3791
  if (r === "system") {
@@ -3777,7 +3810,7 @@ const vr = ({ className: e = "", theme: r = "system" }) => {
3777
3810
  disabled: r !== "system",
3778
3811
  className: `cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed ${e}`,
3779
3812
  children: /* @__PURE__ */ d(
3780
- ta,
3813
+ aa,
3781
3814
  {
3782
3815
  className: `cuadra-h-4 cuadra-w-4 cuadra-transition-colors ${a === "dark" ? "cuadra-text-primary" : "cuadra-text-gray-400"}`
3783
3816
  }
@@ -3785,16 +3818,16 @@ const vr = ({ className: e = "", theme: r = "system" }) => {
3785
3818
  }
3786
3819
  );
3787
3820
  };
3788
- function bo({ onThreadSelect: e }) {
3789
- const r = zt(), t = $r((b) => b.threadId), [a, i] = R(null), o = r?.id === t, n = a === r?.id, [u, c] = R(!1), [s, f] = R(r?.title || ""), [l, p] = R(!1), [g, m] = R(!1), x = async () => {
3790
- if (!r?.remoteId || !s || s === r.title) {
3821
+ function yo({ onThreadSelect: e }) {
3822
+ const r = $t(), t = Ur((b) => b.threadId), [a, i] = R(null), o = r?.id === t, n = a === r?.id, [s, c] = R(!1), [u, f] = R(r?.title || ""), [l, p] = R(!1), [g, m] = R(!1), x = async () => {
3823
+ if (!r?.remoteId || !u || u === r.title) {
3791
3824
  c(!1);
3792
3825
  return;
3793
3826
  }
3794
3827
  try {
3795
3828
  m(!0);
3796
3829
  const b = window.__cuadraThreadListAdapter;
3797
- b && typeof b.rename == "function" && await b.rename(r.remoteId, s), c(!1), p(!1);
3830
+ b && typeof b.rename == "function" && await b.rename(r.remoteId, u), c(!1), p(!1);
3798
3831
  } catch {
3799
3832
  c(!1), p(!1);
3800
3833
  } finally {
@@ -3802,9 +3835,9 @@ function bo({ onThreadSelect: e }) {
3802
3835
  }
3803
3836
  };
3804
3837
  return O(() => {
3805
- r?.title && !u && f(r.title);
3806
- }, [r?.title, u]), r ? /* @__PURE__ */ w(
3807
- qe.Root,
3838
+ r?.title && !s && f(r.title);
3839
+ }, [r?.title, s]), r ? /* @__PURE__ */ w(
3840
+ Ke.Root,
3808
3841
  {
3809
3842
  className: `group cuadra-relative cuadra-flex cuadra-items-center cuadra-rounded-lg cuadra-transition-colors cuadra-cursor-pointer cuadra-border cuadra-mb-2 ${o ? "cuadra-bg-muted cuadra-border-border" : "cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border"}`,
3810
3843
  style: { marginBottom: "0.5rem" },
@@ -3812,15 +3845,15 @@ function bo({ onThreadSelect: e }) {
3812
3845
  onMouseLeave: () => i(null),
3813
3846
  children: [
3814
3847
  /* @__PURE__ */ d(
3815
- qe.Trigger,
3848
+ Ke.Trigger,
3816
3849
  {
3817
3850
  className: "cuadra-p-3 cuadra-flex-1 cuadra-flex cuadra-items-center cuadra-min-w-0 cuadra-cursor-pointer",
3818
3851
  onClick: () => e?.(),
3819
- children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-min-w-0 cuadra-flex-1 cuadra-items-start cuadra-text-left", children: u ? /* @__PURE__ */ d(
3852
+ children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-min-w-0 cuadra-flex-1 cuadra-items-start cuadra-text-left", children: s ? /* @__PURE__ */ d(
3820
3853
  "input",
3821
3854
  {
3822
3855
  className: "cuadra-flex cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 font-brand",
3823
- value: s,
3856
+ value: u,
3824
3857
  onChange: (b) => f(b.target.value),
3825
3858
  onKeyDown: (b) => {
3826
3859
  b.key === "Enter" && x(), b.key === "Escape" && (c(!1), f(r.title || ""));
@@ -3829,7 +3862,7 @@ function bo({ onThreadSelect: e }) {
3829
3862
  autoFocus: !0,
3830
3863
  onClick: (b) => b.stopPropagation()
3831
3864
  }
3832
- ) : /* @__PURE__ */ w(J, { children: [
3865
+ ) : /* @__PURE__ */ w(ae, { children: [
3833
3866
  /* @__PURE__ */ d("span", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-truncate font-brand", children: (r.title?.length || 0) > 60 ? `${r.title?.slice(0, 60)}…` : r.title || "Chat" }),
3834
3867
  r.updatedAt && /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand", children: new Date(r.updatedAt).toLocaleDateString() })
3835
3868
  ] }) })
@@ -3845,10 +3878,10 @@ function bo({ onThreadSelect: e }) {
3845
3878
  b.stopPropagation(), p(!l);
3846
3879
  },
3847
3880
  "aria-label": "Thread options",
3848
- children: /* @__PURE__ */ d(ia, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3881
+ children: /* @__PURE__ */ d(ca, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3849
3882
  }
3850
3883
  ),
3851
- l && /* @__PURE__ */ w(J, { children: [
3884
+ l && /* @__PURE__ */ w(ae, { children: [
3852
3885
  /* @__PURE__ */ d(
3853
3886
  "div",
3854
3887
  {
@@ -3856,7 +3889,7 @@ function bo({ onThreadSelect: e }) {
3856
3889
  onClick: () => p(!1)
3857
3890
  }
3858
3891
  ),
3859
- /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-right-0 cuadra-top-8 cuadra-z-50 cuadra-bg-background cuadra-border cuadra-border-border cuadra-rounded-lg cuadra-shadow-lg cuadra-min-w-[120px] cuadra-overflow-hidden", children: u ? /* @__PURE__ */ d(
3892
+ /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-right-0 cuadra-top-8 cuadra-z-50 cuadra-bg-background cuadra-border cuadra-border-border cuadra-rounded-lg cuadra-shadow-lg cuadra-min-w-[120px] cuadra-overflow-hidden", children: s ? /* @__PURE__ */ d(
3860
3893
  "button",
3861
3894
  {
3862
3895
  type: "button",
@@ -3867,7 +3900,7 @@ function bo({ onThreadSelect: e }) {
3867
3900
  disabled: g,
3868
3901
  children: "Save"
3869
3902
  }
3870
- ) : /* @__PURE__ */ w(J, { children: [
3903
+ ) : /* @__PURE__ */ w(ae, { children: [
3871
3904
  /* @__PURE__ */ d(
3872
3905
  "button",
3873
3906
  {
@@ -3880,7 +3913,7 @@ function bo({ onThreadSelect: e }) {
3880
3913
  }
3881
3914
  ),
3882
3915
  /* @__PURE__ */ d("div", { className: "cuadra-border-t cuadra-border-border" }),
3883
- /* @__PURE__ */ d(qe.Delete, { asChild: !0, children: /* @__PURE__ */ d(
3916
+ /* @__PURE__ */ d(Ke.Delete, { asChild: !0, children: /* @__PURE__ */ d(
3884
3917
  "button",
3885
3918
  {
3886
3919
  type: "button",
@@ -3898,13 +3931,13 @@ function bo({ onThreadSelect: e }) {
3898
3931
  }
3899
3932
  ) : null;
3900
3933
  }
3901
- function Et({
3934
+ function zt({
3902
3935
  onThreadSelect: e,
3903
3936
  showThemeToggle: r,
3904
3937
  theme: t,
3905
3938
  onLogout: a
3906
3939
  }) {
3907
- return /* @__PURE__ */ w(He.Root, { className: "!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80", style: { borderRightWidth: "1px" }, children: [
3940
+ return /* @__PURE__ */ w(Xe.Root, { className: "!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80", style: { borderRightWidth: "1px" }, children: [
3908
3941
  /* @__PURE__ */ d("div", { className: "cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-end cuadra-transition-all cuadra-duration-300 cuadra-h-16 cuadra-px-4", children: /* @__PURE__ */ d(
3909
3942
  "button",
3910
3943
  {
@@ -3912,27 +3945,27 @@ function Et({
3912
3945
  onClick: e,
3913
3946
  className: "cuadra-flex md:cuadra-hidden cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors",
3914
3947
  "aria-label": "Close",
3915
- children: /* @__PURE__ */ d(nt, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3948
+ children: /* @__PURE__ */ d(st, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3916
3949
  }
3917
3950
  ) }),
3918
3951
  /* @__PURE__ */ w("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin", children: [
3919
3952
  /* @__PURE__ */ d(
3920
- He.New,
3953
+ Xe.New,
3921
3954
  {
3922
3955
  className: "group cuadra-relative cuadra-flex cuadra-items-center cuadra-gap-3 cuadra-p-3 cuadra-rounded-lg cuadra-cursor-pointer cuadra-transition-colors cuadra-border cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border",
3923
3956
  onClick: () => e?.(),
3924
3957
  children: /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-min-w-0", children: /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3925
- /* @__PURE__ */ d(ya, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3958
+ /* @__PURE__ */ d(ka, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3926
3959
  /* @__PURE__ */ d("h4", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand", children: "New Chat" })
3927
3960
  ] }) })
3928
3961
  }
3929
3962
  ),
3930
3963
  /* @__PURE__ */ d("div", { className: "cuadra-my-2 cuadra-border-t cuadra-border-border" }),
3931
3964
  /* @__PURE__ */ d(
3932
- He.Items,
3965
+ Xe.Items,
3933
3966
  {
3934
3967
  components: {
3935
- ThreadListItem: (i) => /* @__PURE__ */ d(bo, { ...i, onThreadSelect: e })
3968
+ ThreadListItem: (i) => /* @__PURE__ */ d(yo, { ...i, onThreadSelect: e })
3936
3969
  }
3937
3970
  }
3938
3971
  )
@@ -3945,18 +3978,18 @@ function Et({
3945
3978
  onClick: a,
3946
3979
  className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors",
3947
3980
  "aria-label": "Logout",
3948
- children: /* @__PURE__ */ d(ha, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3981
+ children: /* @__PURE__ */ d(pa, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3949
3982
  }
3950
3983
  ),
3951
- r && /* @__PURE__ */ d(vr, { theme: t })
3984
+ r && /* @__PURE__ */ d(Tr, { theme: t })
3952
3985
  ] })
3953
3986
  ] });
3954
3987
  }
3955
- const yo = `
3988
+ const xo = `
3956
3989
  @keyframes rotate {
3957
3990
  100% { transform: rotate(1turn); }
3958
3991
  }
3959
- `, Ge = ({
3992
+ `, Ye = ({
3960
3993
  children: e,
3961
3994
  className: r = "",
3962
3995
  paddingX: t = "px-0",
@@ -3964,9 +3997,9 @@ const yo = `
3964
3997
  borderSizePx: i = 4,
3965
3998
  style: o,
3966
3999
  contentStyle: n,
3967
- rotating: u = !1
3968
- }) => /* @__PURE__ */ w(J, { children: [
3969
- /* @__PURE__ */ d("style", { children: yo }),
4000
+ rotating: s = !1
4001
+ }) => /* @__PURE__ */ w(ae, { children: [
4002
+ /* @__PURE__ */ d("style", { children: xo }),
3970
4003
  /* @__PURE__ */ w(
3971
4004
  "div",
3972
4005
  {
@@ -3976,8 +4009,8 @@ const yo = `
3976
4009
  /* @__PURE__ */ d(
3977
4010
  "div",
3978
4011
  {
3979
- className: `cuadra-absolute md:cuadra-rounded-xl cuadra-textured-card-border ${u ? "cuadra-textured-card-border-rotating" : ""}`,
3980
- style: u ? {
4012
+ className: `cuadra-absolute md:cuadra-rounded-xl cuadra-textured-card-border ${s ? "cuadra-textured-card-border-rotating" : ""}`,
4013
+ style: s ? {
3981
4014
  left: "-100%",
3982
4015
  top: "-100%",
3983
4016
  width: "300%",
@@ -4011,7 +4044,7 @@ const yo = `
4011
4044
  ]
4012
4045
  }
4013
4046
  )
4014
- ] }), Ft = ({
4047
+ ] }), jt = ({
4015
4048
  currentModel: e,
4016
4049
  models: r,
4017
4050
  modelsLoading: t,
@@ -4019,11 +4052,11 @@ const yo = `
4019
4052
  onModelChange: i,
4020
4053
  hideModelSelector: o = !1,
4021
4054
  showThemeToggle: n = !0,
4022
- theme: u = "system",
4055
+ theme: s = "system",
4023
4056
  onMobileMenuClick: c,
4024
- showMobileMenuButton: s = !1
4057
+ showMobileMenuButton: u = !1
4025
4058
  }) => {
4026
- const [f, l] = R(!1), [p, g] = R(!1), m = de(null);
4059
+ const [f, l] = R(!1), [p, g] = R(!1), m = pe(null);
4027
4060
  O(() => {
4028
4061
  const y = (k) => {
4029
4062
  m.current && !m.current.contains(k.target) && l(!1);
@@ -4037,21 +4070,21 @@ const yo = `
4037
4070
  };
4038
4071
  return /* @__PURE__ */ w("div", { className: "cuadra-h-16 cuadra-px-4 cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-bg-background", children: [
4039
4072
  /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
4040
- s && /* @__PURE__ */ d(
4073
+ u && /* @__PURE__ */ d(
4041
4074
  "button",
4042
4075
  {
4043
4076
  type: "button",
4044
4077
  onClick: c,
4045
4078
  className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed md:cuadra-hidden",
4046
4079
  "aria-label": "Toggle thread list",
4047
- children: /* @__PURE__ */ d(pa, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
4080
+ children: /* @__PURE__ */ d(ba, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
4048
4081
  }
4049
4082
  ),
4050
- n && /* @__PURE__ */ d("div", { className: "cuadra-hidden md:cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(vr, { theme: u }) })
4083
+ n && /* @__PURE__ */ d("div", { className: "cuadra-hidden md:cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(Tr, { theme: s }) })
4051
4084
  ] }),
4052
4085
  /* @__PURE__ */ w("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
4053
4086
  !o && /* @__PURE__ */ d("label", { className: "cuadra-hidden md:cuadra-inline cuadra-text-sm cuadra-text-muted-foreground cuadra-font-brand", children: "Model" }),
4054
- o ? null : t ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading..." }) }) : a ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10", children: /* @__PURE__ */ d("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : /* @__PURE__ */ w(J, { children: [
4087
+ o ? null : t ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading..." }) }) : a ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10", children: /* @__PURE__ */ d("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : /* @__PURE__ */ w(ae, { children: [
4055
4088
  /* @__PURE__ */ w("div", { ref: m, className: "cuadra-hidden md:cuadra-block cuadra-relative cuadra-w-48", children: [
4056
4089
  /* @__PURE__ */ w(
4057
4090
  "button",
@@ -4062,7 +4095,7 @@ const yo = `
4062
4095
  className: "cuadra-flex cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",
4063
4096
  children: [
4064
4097
  /* @__PURE__ */ d("span", { className: x ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: x?.name || "Select model" }),
4065
- /* @__PURE__ */ d(et, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
4098
+ /* @__PURE__ */ d(at, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
4066
4099
  ]
4067
4100
  }
4068
4101
  ),
@@ -4107,12 +4140,12 @@ const yo = `
4107
4140
  className: "cuadra-flex md:cuadra-hidden cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",
4108
4141
  children: [
4109
4142
  /* @__PURE__ */ d("span", { className: x ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: x?.name || "Select model" }),
4110
- /* @__PURE__ */ d(et, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
4143
+ /* @__PURE__ */ d(at, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
4111
4144
  ]
4112
4145
  }
4113
4146
  ),
4114
- p && typeof document < "u" && Ye(
4115
- /* @__PURE__ */ w(J, { children: [
4147
+ p && typeof document < "u" && rt(
4148
+ /* @__PURE__ */ w(ae, { children: [
4116
4149
  /* @__PURE__ */ d(
4117
4150
  "div",
4118
4151
  {
@@ -4130,7 +4163,7 @@ const yo = `
4130
4163
  onClick: () => g(!1),
4131
4164
  className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors",
4132
4165
  "aria-label": "Close",
4133
- children: /* @__PURE__ */ d(nt, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
4166
+ children: /* @__PURE__ */ d(st, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
4134
4167
  }
4135
4168
  )
4136
4169
  ] }),
@@ -4173,8 +4206,8 @@ const yo = `
4173
4206
  ] })
4174
4207
  ] })
4175
4208
  ] });
4176
- }, xo = Dr(void 0), Ze = ({ children: e, value: r }) => /* @__PURE__ */ d(xo.Provider, { value: r, children: e });
4177
- function ko() {
4209
+ }, ko = Er(void 0), et = ({ children: e, value: r }) => /* @__PURE__ */ d(ko.Provider, { value: r, children: e });
4210
+ function wo() {
4178
4211
  O(() => {
4179
4212
  if (document.querySelector("style[data-cuadra-uikit]"))
4180
4213
  return;
@@ -4197,15 +4230,15 @@ function ko() {
4197
4230
  }, document.head.appendChild(a), o) break;
4198
4231
  }, []);
4199
4232
  }
4200
- const wo = ve(
4233
+ const vo = Ae(
4201
4234
  function({ config: r }, t) {
4202
- ko();
4203
- const a = de(null), i = de(!1), {
4235
+ wo();
4236
+ const a = pe(null), i = pe(!1), {
4204
4237
  baseUrl: o,
4205
4238
  proxyUrl: n,
4206
- sessionToken: u,
4239
+ sessionToken: s,
4207
4240
  mode: c = "multiChat",
4208
- modelMode: s = "fixed",
4241
+ modelMode: u = "fixed",
4209
4242
  modelId: f,
4210
4243
  onModelChange: l,
4211
4244
  ephemeral: p = !1,
@@ -4215,28 +4248,29 @@ const wo = ve(
4215
4248
  welcomeTitle: b,
4216
4249
  welcomeSubtitle: y,
4217
4250
  extraTopPadding: k,
4218
- suggestions: T,
4219
- inputPlaceholder: L,
4251
+ suggestions: v,
4252
+ inputPlaceholder: P,
4220
4253
  preMadeResponseDelay: I = 1e3,
4221
4254
  streamingSpeed: C = 50,
4222
4255
  showThemeToggle: D = !0,
4223
- initialMessage: A,
4224
- initialPreMadeQA: N,
4256
+ initialMessage: E,
4257
+ initialPreMadeQA: A,
4225
4258
  theme: h = "system",
4226
- onError: _,
4227
- onChatCreated: H,
4228
- onUserMessage: W,
4229
- onThreadIdUpdate: te,
4230
- onLogout: Te,
4231
- enableAttachments: q = !1,
4232
- onBeforeRequest: v
4259
+ onError: B,
4260
+ onChatCreated: z,
4261
+ onUserMessage: X,
4262
+ onThreadIdUpdate: K,
4263
+ onLogout: Ie,
4264
+ enableAttachments: Se = !1,
4265
+ onBeforeRequest: J,
4266
+ mockResponseOnBlocked: T
4233
4267
  } = r;
4234
- at(t, () => ({
4268
+ ct(t, () => ({
4235
4269
  sendMessage: (M) => {
4236
4270
  a.current?.sendMessage(M);
4237
4271
  },
4238
- sendPreMadeQA: (M, F, z) => {
4239
- a.current?.sendPreMadeQA(M, F, z);
4272
+ sendPreMadeQA: (M, F, j) => {
4273
+ a.current?.sendPreMadeQA(M, F, j);
4240
4274
  },
4241
4275
  clearChat: () => {
4242
4276
  a.current?.clearChat();
@@ -4244,94 +4278,94 @@ const wo = ve(
4244
4278
  }), []), O(() => {
4245
4279
  if (i.current) return;
4246
4280
  const M = setTimeout(() => {
4247
- N ? (i.current = !0, a.current?.sendPreMadeQA(
4248
- N.question,
4249
- N.answer,
4281
+ A ? (i.current = !0, a.current?.sendPreMadeQA(
4282
+ A.question,
4283
+ A.answer,
4250
4284
  { delay: I, streamingSpeed: C }
4251
- )) : A && (i.current = !0, a.current?.sendMessage(A));
4285
+ )) : E && (i.current = !0, a.current?.sendMessage(E));
4252
4286
  }, 500);
4253
4287
  return () => clearTimeout(M);
4254
- }, [A, N, I, C]);
4255
- const [S, $] = R(!1), [E, ee] = R(null), [P, re] = R(null), [ce, Oe] = R(!1), Ue = de(null), Me = (M) => {
4288
+ }, [E, A, I, C]);
4289
+ const [N, _] = R(!1), [L, H] = R(null), [S, q] = R(null), [V, ie] = R(!1), le = pe(null), de = (M) => {
4256
4290
  if (M < 30) return !0;
4257
- if (Ue.current) {
4258
- const F = Ue.current.getBoundingClientRect();
4291
+ if (le.current) {
4292
+ const F = le.current.getBoundingClientRect();
4259
4293
  if (M - F.left < 30) return !0;
4260
4294
  }
4261
4295
  return !1;
4262
- }, lt = (M) => {
4263
- const z = M.touches[0].clientX;
4264
- (Me(z) || S) && (ee(z), re(z), Oe(!0));
4265
- }, dt = (M) => {
4266
- if (E === null || !ce) return;
4296
+ }, Y = (M) => {
4297
+ const j = M.touches[0].clientX;
4298
+ (de(j) || N) && (H(j), q(j), ie(!0));
4299
+ }, Le = (M) => {
4300
+ if (L === null || !V) return;
4267
4301
  const F = M.touches[0];
4268
- re(F.clientX);
4269
- }, ft = () => {
4270
- if (E === null || P === null) {
4271
- Oe(!1);
4302
+ q(F.clientX);
4303
+ }, mt = () => {
4304
+ if (L === null || S === null) {
4305
+ ie(!1);
4272
4306
  return;
4273
4307
  }
4274
- const M = P - E, F = 50, z = 0.3, xt = Math.abs(M) / 300;
4275
- M > F && !S && E !== null ? Me(E) && $(!0) : ((M < -F || M < 0 && xt > z) && S || S && M < -20 && xt > z) && $(!1), ee(null), re(null), Oe(!1);
4276
- }, Tr = () => {
4277
- if (ce && E !== null && P !== null) {
4278
- const M = P - E;
4279
- if (S)
4308
+ const M = S - L, F = 50, j = 0.3, wt = Math.abs(M) / 300;
4309
+ M > F && !N && L !== null ? de(L) && _(!0) : ((M < -F || M < 0 && wt > j) && N || N && M < -20 && wt > j) && _(!1), H(null), q(null), ie(!1);
4310
+ }, Ar = () => {
4311
+ if (V && L !== null && S !== null) {
4312
+ const M = S - L;
4313
+ if (N)
4280
4314
  return `translateX(${Math.min(0, M)}px)`;
4281
- if (E !== null && Me(E))
4315
+ if (L !== null && de(L))
4282
4316
  return `translateX(${Math.min(0, -320 + M)}px)`;
4283
4317
  }
4284
- return S ? "translateX(0)" : "translateX(-100%)";
4285
- }, Mr = () => {
4286
- if (!ce || E === null || P === null)
4287
- return S ? 0.5 : 0;
4288
- const F = P - E;
4289
- return S ? Math.max(0, Math.min(1, (320 + F) / 320)) * 0.5 : E !== null && Me(E) ? Math.max(0, Math.min(1, (F + 320) / 320)) * 0.5 : 0;
4290
- }, Ae = n || o || "", Ne = !!n, ht = V(
4291
- () => new Ht(Ae, u || void 0, Ne),
4292
- [Ae, u, Ne]
4293
- ), [ue, Ar] = R(null), [he, mt] = R(!1), [me, pt] = R(null), [Nr, gt] = R(!1);
4318
+ return N ? "translateX(0)" : "translateX(-100%)";
4319
+ }, Nr = () => {
4320
+ if (!V || L === null || S === null)
4321
+ return N ? 0.5 : 0;
4322
+ const F = S - L;
4323
+ return N ? Math.max(0, Math.min(1, (320 + F) / 320)) * 0.5 : L !== null && de(L) ? Math.max(0, Math.min(1, (F + 320) / 320)) * 0.5 : 0;
4324
+ }, Pe = n || o || "", Re = !!n, pt = Q(
4325
+ () => new Vt(Pe, s || void 0, Re),
4326
+ [Pe, s, Re]
4327
+ ), [fe, Ir] = R(null), [be, gt] = R(!1), [ye, bt] = R(null), [Sr, yt] = R(!1);
4294
4328
  O(() => {
4295
- c === "multiChat" && gt(!0);
4329
+ c === "multiChat" && yt(!0);
4296
4330
  }, [c]);
4297
- const se = X(async () => {
4298
- if (s === "selector") {
4299
- mt(!0), pt(null);
4331
+ const he = G(async () => {
4332
+ if (u === "selector") {
4333
+ gt(!0), bt(null);
4300
4334
  try {
4301
- const M = await ht.listModels();
4302
- Ar(M);
4335
+ const M = await pt.listModels();
4336
+ Ir(M);
4303
4337
  } catch (M) {
4304
- pt(M instanceof Error ? M : new Error("Failed to load models"));
4338
+ bt(M instanceof Error ? M : new Error("Failed to load models"));
4305
4339
  } finally {
4306
- mt(!1);
4340
+ gt(!1);
4307
4341
  }
4308
4342
  }
4309
- }, [ht, s]);
4343
+ }, [pt, u]);
4310
4344
  O(() => {
4311
- s === "selector" && se();
4312
- }, [s, se]), O(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = se), () => {
4345
+ u === "selector" && he();
4346
+ }, [u, he]), O(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = he), () => {
4313
4347
  typeof window < "u" && delete window.__cuadraUIKitRefetchModels;
4314
- }), [se]);
4315
- const [Q, bt] = R(
4316
- s === "fixed" && f || null
4317
- ), yt = de(Q), pe = X(
4348
+ }), [he]);
4349
+ const [ee, xt] = R(
4350
+ u === "fixed" && f || null
4351
+ ), kt = pe(ee), xe = G(
4318
4352
  (M) => {
4319
- const F = yt.current;
4320
- bt(M), yt.current = M, l?.(M), F !== null && F !== M && c === "multiChat" && setTimeout(() => {
4321
- const z = window.__cuadraThreadListRuntime;
4322
- if (z?.threads?.switchToNewThread)
4353
+ const F = kt.current;
4354
+ xt(M), kt.current = M, l?.(M), F !== null && F !== M && c === "multiChat" && setTimeout(() => {
4355
+ const j = window.__cuadraThreadListRuntime;
4356
+ if (j?.threads?.switchToNewThread)
4323
4357
  try {
4324
- z.threads.switchToNewThread();
4358
+ j.threads.switchToNewThread();
4325
4359
  } catch {
4326
4360
  }
4327
- else if (z?.threads?.createThread)
4361
+ else if (j?.threads?.createThread)
4328
4362
  try {
4329
- z.threads.createThread();
4363
+ j.threads.createThread();
4330
4364
  } catch {
4331
4365
  }
4332
- else if (z?.switchToNewThread)
4366
+ else if (j?.switchToNewThread)
4333
4367
  try {
4334
- z.switchToNewThread();
4368
+ j.switchToNewThread();
4335
4369
  } catch {
4336
4370
  }
4337
4371
  }, 100);
@@ -4339,53 +4373,54 @@ const wo = ve(
4339
4373
  [l, c]
4340
4374
  );
4341
4375
  O(() => {
4342
- if (s === "selector" && ue?.items && ue.items.length > 0 && !Q) {
4343
- const M = ue.items[0];
4376
+ if (u === "selector" && fe?.items && fe.items.length > 0 && !ee) {
4377
+ const M = fe.items[0];
4344
4378
  if (M?.id) {
4345
4379
  const F = M.id;
4346
- bt(F), l?.(F);
4380
+ xt(F), l?.(F);
4347
4381
  }
4348
4382
  }
4349
- }, [s, ue?.items, Q, l]);
4350
- const Ir = s === "fixed" ? !!f : !!Q, Ie = V(
4351
- () => (ue?.items || []).filter((M) => M?.id && M?.displayName).map((M) => ({ id: M.id, name: M.displayName })),
4352
- [ue]
4353
- ), Be = V(
4383
+ }, [u, fe?.items, ee, l]);
4384
+ const Lr = u === "fixed" ? !!f : !!ee, De = Q(
4385
+ () => (fe?.items || []).filter((M) => M?.id && M?.displayName).map((M) => ({ id: M.id, name: M.displayName })),
4386
+ [fe]
4387
+ ), He = Q(
4354
4388
  () => ({
4355
- currentModelId: Q || "",
4356
- models: Ie,
4357
- modelsLoading: he,
4358
- modelsError: me,
4359
- onModelChange: pe,
4360
- refetchModels: se
4389
+ currentModelId: ee || "",
4390
+ models: De,
4391
+ modelsLoading: be,
4392
+ modelsError: ye,
4393
+ onModelChange: xe,
4394
+ refetchModels: he
4361
4395
  }),
4362
- [Q, Ie, he, me, pe, se]
4396
+ [ee, De, be, ye, xe, he]
4363
4397
  );
4364
- return s === "selector" && he || c === "multiChat" && Nr ? /* @__PURE__ */ d(Ze, { value: Be, children: /* @__PURE__ */ d(Ge, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d(Bt, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : s === "selector" && !Ir && me ? /* @__PURE__ */ d(Ze, { value: Be, children: /* @__PURE__ */ d(Ge, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-destructive font-brand", children: "Failed to load models" }) }) }) }) }) : /* @__PURE__ */ d("div", { className: "cuadra-uikit cuadra-h-full cuadra-w-full", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ d(Ze, { value: Be, children: /* @__PURE__ */ d(
4365
- Aa,
4398
+ return u === "selector" && be || c === "multiChat" && Sr ? /* @__PURE__ */ d(et, { value: He, children: /* @__PURE__ */ d(Ye, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d(qt, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : u === "selector" && !Lr && ye ? /* @__PURE__ */ d(et, { value: He, children: /* @__PURE__ */ d(Ye, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-destructive font-brand", children: "Failed to load models" }) }) }) }) }) : /* @__PURE__ */ d("div", { className: "cuadra-uikit cuadra-h-full cuadra-w-full", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ d(et, { value: He, children: /* @__PURE__ */ d(
4399
+ Na,
4366
4400
  {
4367
- baseUrl: Ne ? Ae : o || Ae,
4368
- sessionToken: u,
4369
- isProxyMode: Ne,
4401
+ baseUrl: Re ? Pe : o || Pe,
4402
+ sessionToken: s,
4403
+ isProxyMode: Re,
4370
4404
  mode: c,
4371
- modelMode: s,
4372
- modelId: Q || f || void 0,
4373
- onModelChange: pe,
4405
+ modelMode: u,
4406
+ modelId: ee || f || void 0,
4407
+ onModelChange: xe,
4374
4408
  ephemeral: p,
4375
4409
  systemPrompt: g,
4376
4410
  enableReasoning: m,
4377
4411
  initialThreadId: x,
4378
- enableAttachments: q,
4379
- onError: _,
4380
- onChatCreated: H,
4381
- onUserMessage: W,
4382
- onThreadIdUpdate: te,
4383
- onBeforeRequest: v,
4412
+ enableAttachments: Se,
4413
+ onError: B,
4414
+ onChatCreated: z,
4415
+ onUserMessage: X,
4416
+ onThreadIdUpdate: K,
4417
+ onBeforeRequest: J,
4418
+ mockResponseOnBlocked: T,
4384
4419
  onChatsLoaded: () => {
4385
- c === "multiChat" && gt(!1);
4420
+ c === "multiChat" && yt(!1);
4386
4421
  },
4387
4422
  children: /* @__PURE__ */ d(
4388
- Ge,
4423
+ Ye,
4389
4424
  {
4390
4425
  paddingX: "cuadra-px-0",
4391
4426
  paddingY: "cuadra-py-0",
@@ -4397,58 +4432,58 @@ const wo = ve(
4397
4432
  {
4398
4433
  className: "cuadra-h-full cuadra-flex cuadra-relative",
4399
4434
  style: { height: "100%" },
4400
- onTouchStart: lt,
4401
- onTouchMove: dt,
4402
- onTouchEnd: ft,
4403
- children: c === "multiChat" ? /* @__PURE__ */ w(J, { children: [
4404
- typeof document < "u" && Ye(
4435
+ onTouchStart: Y,
4436
+ onTouchMove: Le,
4437
+ onTouchEnd: mt,
4438
+ children: c === "multiChat" ? /* @__PURE__ */ w(ae, { children: [
4439
+ typeof document < "u" && rt(
4405
4440
  /* @__PURE__ */ d(
4406
4441
  "div",
4407
4442
  {
4408
- className: `cuadra-fixed cuadra-inset-0 cuadra-bg-black cuadra-z-40 md:cuadra-hidden cuadra-transition-opacity cuadra-duration-300 ${S || ce ? "" : "cuadra-pointer-events-none"}`,
4409
- style: { opacity: Mr() },
4410
- onClick: () => $(!1)
4443
+ className: `cuadra-fixed cuadra-inset-0 cuadra-bg-black cuadra-z-40 md:cuadra-hidden cuadra-transition-opacity cuadra-duration-300 ${N || V ? "" : "cuadra-pointer-events-none"}`,
4444
+ style: { opacity: Nr() },
4445
+ onClick: () => _(!1)
4411
4446
  }
4412
4447
  ),
4413
4448
  document.body
4414
4449
  ),
4415
- typeof document < "u" && /* @__PURE__ */ w(J, { children: [
4450
+ typeof document < "u" && /* @__PURE__ */ w(ae, { children: [
4416
4451
  /* @__PURE__ */ d(
4417
4452
  "div",
4418
4453
  {
4419
4454
  className: "cuadra-hidden md:cuadra-block !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80 cuadra-relative",
4420
4455
  style: { borderRightWidth: "1px", height: "100%" },
4421
4456
  children: /* @__PURE__ */ d(
4422
- Et,
4457
+ zt,
4423
4458
  {
4424
- onThreadSelect: () => $(!1),
4459
+ onThreadSelect: () => _(!1),
4425
4460
  showThemeToggle: D,
4426
4461
  theme: h,
4427
- onLogout: Te
4462
+ onLogout: Ie
4428
4463
  }
4429
4464
  )
4430
4465
  }
4431
4466
  ),
4432
- typeof document < "u" && Ye(
4467
+ typeof document < "u" && rt(
4433
4468
  /* @__PURE__ */ d(
4434
4469
  "div",
4435
4470
  {
4436
- className: `cuadra-block md:cuadra-hidden !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-h-screen cuadra-w-80 cuadra-fixed cuadra-z-50 cuadra-top-0 cuadra-left-0 ${S || ce ? "" : "cuadra-pointer-events-none"}`,
4471
+ className: `cuadra-block md:cuadra-hidden !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-h-screen cuadra-w-80 cuadra-fixed cuadra-z-50 cuadra-top-0 cuadra-left-0 ${N || V ? "" : "cuadra-pointer-events-none"}`,
4437
4472
  style: {
4438
4473
  borderRightWidth: "1px",
4439
- transform: Tr(),
4440
- transition: ce ? "none" : "transform 0.3s ease-in-out"
4474
+ transform: Ar(),
4475
+ transition: V ? "none" : "transform 0.3s ease-in-out"
4441
4476
  },
4442
- onTouchStart: lt,
4443
- onTouchMove: dt,
4444
- onTouchEnd: ft,
4477
+ onTouchStart: Y,
4478
+ onTouchMove: Le,
4479
+ onTouchEnd: mt,
4445
4480
  children: /* @__PURE__ */ d(
4446
- Et,
4481
+ zt,
4447
4482
  {
4448
- onThreadSelect: () => $(!1),
4483
+ onThreadSelect: () => _(!1),
4449
4484
  showThemeToggle: D,
4450
4485
  theme: h,
4451
- onLogout: Te
4486
+ onLogout: Ie
4452
4487
  }
4453
4488
  )
4454
4489
  }
@@ -4456,58 +4491,58 @@ const wo = ve(
4456
4491
  document.body
4457
4492
  )
4458
4493
  ] }),
4459
- /* @__PURE__ */ w("div", { ref: Ue, className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
4460
- s === "selector" && /* @__PURE__ */ d(
4461
- Ft,
4494
+ /* @__PURE__ */ w("div", { ref: le, className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
4495
+ u === "selector" && /* @__PURE__ */ d(
4496
+ jt,
4462
4497
  {
4463
- currentModel: Q || "",
4464
- models: Ie,
4465
- modelsLoading: he,
4466
- modelsError: me,
4467
- onModelChange: pe,
4498
+ currentModel: ee || "",
4499
+ models: De,
4500
+ modelsLoading: be,
4501
+ modelsError: ye,
4502
+ onModelChange: xe,
4468
4503
  showThemeToggle: D,
4469
4504
  theme: h,
4470
- onMobileMenuClick: () => $(!S),
4505
+ onMobileMenuClick: () => _(!N),
4471
4506
  showMobileMenuButton: c === "multiChat"
4472
4507
  }
4473
4508
  ),
4474
4509
  /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
4475
- _t,
4510
+ Ft,
4476
4511
  {
4477
4512
  ref: a,
4478
4513
  welcomeTitle: b,
4479
4514
  welcomeSubtitle: y,
4480
4515
  extraTopPadding: k,
4481
- suggestions: T,
4482
- inputPlaceholder: L,
4483
- enableAttachments: q,
4516
+ suggestions: v,
4517
+ inputPlaceholder: P,
4518
+ enableAttachments: Se,
4484
4519
  preMadeResponseDelay: I,
4485
4520
  streamingSpeed: C
4486
4521
  }
4487
4522
  ) })
4488
4523
  ] })
4489
4524
  ] }) : /* @__PURE__ */ w("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
4490
- s === "selector" && /* @__PURE__ */ d(
4491
- Ft,
4525
+ u === "selector" && /* @__PURE__ */ d(
4526
+ jt,
4492
4527
  {
4493
- currentModel: Q || "",
4494
- models: Ie,
4495
- modelsLoading: he,
4496
- modelsError: me,
4497
- onModelChange: pe,
4528
+ currentModel: ee || "",
4529
+ models: De,
4530
+ modelsLoading: be,
4531
+ modelsError: ye,
4532
+ onModelChange: xe,
4498
4533
  showThemeToggle: D,
4499
4534
  theme: h
4500
4535
  }
4501
4536
  ),
4502
4537
  /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
4503
- _t,
4538
+ Ft,
4504
4539
  {
4505
4540
  ref: a,
4506
4541
  welcomeTitle: b,
4507
4542
  welcomeSubtitle: y,
4508
4543
  extraTopPadding: k,
4509
- suggestions: T,
4510
- inputPlaceholder: L,
4544
+ suggestions: v,
4545
+ inputPlaceholder: P,
4511
4546
  preMadeResponseDelay: I,
4512
4547
  streamingSpeed: C
4513
4548
  }
@@ -4521,18 +4556,18 @@ const wo = ve(
4521
4556
  ) }) });
4522
4557
  }
4523
4558
  );
4524
- function vo(e, r = ":root") {
4559
+ function Co(e, r = ":root") {
4525
4560
  if (typeof document > "u")
4526
4561
  return;
4527
4562
  const t = document.documentElement;
4528
- if (e.light && To(e.light, t), e.dark) {
4563
+ if (e.light && Mo(e.light, t), e.dark) {
4529
4564
  let a = document.getElementById("cuadra-theme-dark");
4530
4565
  a || (a = document.createElement("style"), a.id = "cuadra-theme-dark", document.head.appendChild(a));
4531
- const i = Mo(e.dark);
4566
+ const i = Ao(e.dark);
4532
4567
  a.textContent = `.dark { ${i} }`;
4533
4568
  }
4534
4569
  }
4535
- const Co = {
4570
+ const To = {
4536
4571
  background: "background",
4537
4572
  foreground: "foreground",
4538
4573
  card: "card",
@@ -4561,22 +4596,22 @@ const Co = {
4561
4596
  warning: "warning",
4562
4597
  warningForeground: "warning-foreground"
4563
4598
  };
4564
- function Cr(e) {
4565
- const r = Co[e];
4599
+ function Mr(e) {
4600
+ const r = To[e];
4566
4601
  return r ? `--cuadra-${r}` : `--cuadra-${e.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
4567
4602
  }
4568
- function To(e, r) {
4603
+ function Mo(e, r) {
4569
4604
  Object.entries(e).forEach(([t, a]) => {
4570
4605
  if (a) {
4571
- const i = Cr(t);
4606
+ const i = Mr(t);
4572
4607
  r.style.setProperty(i, a);
4573
4608
  }
4574
4609
  });
4575
4610
  }
4576
- function Mo(e) {
4577
- return Object.entries(e).map(([r, t]) => t ? `${Cr(r)}: ${t};` : "").filter(Boolean).join(" ");
4611
+ function Ao(e) {
4612
+ return Object.entries(e).map(([r, t]) => t ? `${Mr(r)}: ${t};` : "").filter(Boolean).join(" ");
4578
4613
  }
4579
- function Do() {
4614
+ function _o() {
4580
4615
  if (typeof document > "u")
4581
4616
  return;
4582
4617
  const e = document.documentElement;
@@ -4584,24 +4619,24 @@ function Do() {
4584
4619
  const t = document.getElementById("cuadra-theme-dark");
4585
4620
  t && t.remove();
4586
4621
  }
4587
- const _o = ve(
4622
+ const Eo = Ae(
4588
4623
  function(r, t) {
4589
- const a = de(null);
4624
+ const a = pe(null);
4590
4625
  O(() => {
4591
- r.customTheme && vo(r.customTheme);
4592
- }, [r.customTheme]), at(t, () => ({
4626
+ r.customTheme && Co(r.customTheme);
4627
+ }, [r.customTheme]), ct(t, () => ({
4593
4628
  sendMessage: (o) => {
4594
4629
  a.current?.sendMessage(o);
4595
4630
  },
4596
- sendPreMadeQA: (o, n, u) => {
4597
- a.current?.sendPreMadeQA(o, n, u);
4631
+ sendPreMadeQA: (o, n, s) => {
4632
+ a.current?.sendPreMadeQA(o, n, s);
4598
4633
  },
4599
4634
  clearChat: () => {
4600
4635
  a.current?.clearChat();
4601
4636
  }
4602
4637
  }), []), O(() => (typeof window < "u" && (window.__cuadraChatControls = {
4603
4638
  sendMessage: (o) => a.current?.sendMessage(o),
4604
- sendPreMadeQA: (o, n, u) => a.current?.sendPreMadeQA(o, n, u),
4639
+ sendPreMadeQA: (o, n, s) => a.current?.sendPreMadeQA(o, n, s),
4605
4640
  clearChat: () => a.current?.clearChat()
4606
4641
  }), () => {
4607
4642
  typeof window < "u" && delete window.__cuadraChatControls;
@@ -4637,17 +4672,18 @@ const _o = ve(
4637
4672
  containerClass: r.className,
4638
4673
  initialMessage: r.initialMessage,
4639
4674
  initialPreMadeQA: r.initialPreMadeQA,
4640
- onBeforeRequest: r.onBeforeRequest
4675
+ onBeforeRequest: r.onBeforeRequest,
4676
+ mockResponseOnBlocked: r.mockResponseOnBlocked
4641
4677
  };
4642
- return /* @__PURE__ */ d(wo, { ref: a, config: i });
4678
+ return /* @__PURE__ */ d(vo, { ref: a, config: i });
4643
4679
  }
4644
4680
  );
4645
4681
  export {
4646
- wr as Badge,
4647
- _o as CuadraChat,
4682
+ Cr as Badge,
4683
+ Eo as CuadraChat,
4648
4684
  uo as SourceCitations,
4649
- vo as applyTheme,
4650
- Do as removeTheme,
4651
- ie as streamingMetadataStore
4685
+ Co as applyTheme,
4686
+ _o as removeTheme,
4687
+ se as streamingMetadataStore
4652
4688
  };
4653
4689
  //# sourceMappingURL=index.mjs.map