@cuadra-ai/uikit 0.1.20 → 0.1.21

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,14 +1,14 @@
1
- var hr = Object.defineProperty;
2
- var mr = (e, r, t) => r in e ? hr(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var pe = (e, r, t) => mr(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { jsx as d, jsxs as v, Fragment as H } from "react/jsx-runtime";
5
- import rt, { forwardRef as wt, createElement as Fe, useMemo as F, useState as N, useEffect as P, useCallback as ee, memo as pr, useRef as je, createContext as gr } from "react";
6
- import { createPortal as ze } from "react-dom";
7
- import { useThreadListItem as vt, RuntimeAdapterProvider as br, useLocalRuntime as Ct, AssistantRuntimeProvider as Tt, unstable_useRemoteThreadListRuntime as yr, useThreadRuntime as xr, ThreadPrimitive as ne, ComposerPrimitive as ie, useAssistantState as At, AttachmentPrimitive as kr, useAssistantApi as wr, MessagePrimitive as oe, ThreadListPrimitive as Se, useThread as vr, ThreadListItemPrimitive as Le } from "@assistant-ui/react";
8
- import { unstable_memoizeMarkdownComponents as Cr, useIsMarkdownCodeBlock as Tr, MarkdownTextPrimitive as Ar } from "@assistant-ui/react-markdown";
9
- let ce = !1, at = !1;
10
- function nt() {
11
- if (at || (at = !0, typeof document > "u" || typeof window > "u"))
1
+ var mr = Object.defineProperty;
2
+ var pr = (e, r, t) => r in e ? mr(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var pe = (e, r, t) => pr(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { jsx as d, jsxs as C, Fragment as q } from "react/jsx-runtime";
5
+ import at, { forwardRef as vt, createElement as je, useMemo as z, useState as S, useEffect as E, useCallback as ee, memo as gr, useRef as ze, createContext as br } from "react";
6
+ import { createPortal as $e } from "react-dom";
7
+ import { useThreadListItem as Ct, RuntimeAdapterProvider as yr, useLocalRuntime as Tt, AssistantRuntimeProvider as At, unstable_useRemoteThreadListRuntime as xr, useThreadRuntime as kr, ThreadPrimitive as ne, ComposerPrimitive as ie, useAssistantState as Nt, AttachmentPrimitive as wr, useAssistantApi as vr, MessagePrimitive as oe, ThreadListPrimitive as Me, useThread as Cr, ThreadListItemPrimitive as Le } from "@assistant-ui/react";
8
+ import { unstable_memoizeMarkdownComponents as Tr, useIsMarkdownCodeBlock as Ar, MarkdownTextPrimitive as Nr } from "@assistant-ui/react-markdown";
9
+ let ce = !1, nt = !1;
10
+ function it() {
11
+ if (nt || (nt = !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) {
@@ -25,9 +25,9 @@ function nt() {
25
25
  }
26
26
  } catch {
27
27
  }
28
- Nr();
28
+ Ir();
29
29
  }
30
- function Nr() {
30
+ function Ir() {
31
31
  if (ce)
32
32
  return;
33
33
  const e = document.createElement("link");
@@ -54,19 +54,19 @@ function Nr() {
54
54
  a();
55
55
  }, document.head.appendChild(e);
56
56
  }
57
- typeof document < "u" && typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", nt) : nt());
58
- const Ir = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Sr = (e) => e.replace(
57
+ typeof document < "u" && typeof window < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", it) : it());
58
+ const Sr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Mr = (e) => e.replace(
59
59
  /^([A-Z])|[\s-_]+(\w)/g,
60
60
  (r, t, a) => a ? a.toUpperCase() : t.toLowerCase()
61
- ), it = (e) => {
62
- const r = Sr(e);
61
+ ), ot = (e) => {
62
+ const r = Mr(e);
63
63
  return r.charAt(0).toUpperCase() + r.slice(1);
64
- }, Nt = (...e) => e.filter((r, t, a) => !!r && r.trim() !== "" && a.indexOf(r) === t).join(" ").trim(), Lr = (e) => {
64
+ }, It = (...e) => e.filter((r, t, a) => !!r && r.trim() !== "" && a.indexOf(r) === t).join(" ").trim(), Lr = (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 Mr = {
69
+ var Dr = {
70
70
  xmlns: "http://www.w3.org/2000/svg",
71
71
  width: 24,
72
72
  height: 24,
@@ -77,7 +77,7 @@ var Mr = {
77
77
  strokeLinecap: "round",
78
78
  strokeLinejoin: "round"
79
79
  };
80
- const Dr = wt(
80
+ const Rr = vt(
81
81
  ({
82
82
  color: e = "currentColor",
83
83
  size: r = 24,
@@ -87,71 +87,71 @@ const Dr = wt(
87
87
  children: o,
88
88
  iconNode: n,
89
89
  ...u
90
- }, c) => Fe(
90
+ }, c) => je(
91
91
  "svg",
92
92
  {
93
93
  ref: c,
94
- ...Mr,
94
+ ...Dr,
95
95
  width: r,
96
96
  height: r,
97
97
  stroke: e,
98
98
  strokeWidth: a ? Number(t) * 24 / Number(r) : t,
99
- className: Nt("lucide", i),
99
+ className: It("lucide", i),
100
100
  ...!o && !Lr(u) && { "aria-hidden": "true" },
101
101
  ...u
102
102
  },
103
103
  [
104
- ...n.map(([s, f]) => Fe(s, f)),
104
+ ...n.map(([s, f]) => je(s, f)),
105
105
  ...Array.isArray(o) ? o : [o]
106
106
  ]
107
107
  )
108
108
  );
109
- const _ = (e, r) => {
110
- const t = wt(
111
- ({ className: a, ...i }, o) => Fe(Dr, {
109
+ const F = (e, r) => {
110
+ const t = vt(
111
+ ({ className: a, ...i }, o) => je(Rr, {
112
112
  ref: o,
113
113
  iconNode: r,
114
- className: Nt(
115
- `lucide-${Ir(it(e))}`,
114
+ className: It(
115
+ `lucide-${Sr(ot(e))}`,
116
116
  `lucide-${e}`,
117
117
  a
118
118
  ),
119
119
  ...i
120
120
  })
121
121
  );
122
- return t.displayName = it(e), t;
122
+ return t.displayName = ot(e), t;
123
123
  };
124
- const Rr = [
124
+ const Pr = [
125
125
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
126
126
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
127
- ], Pr = _("arrow-up", Rr);
128
- const Er = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], _r = _("check", Er);
129
- const Fr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ot = _("chevron-down", Fr);
130
- const jr = [
127
+ ], Er = F("arrow-up", Pr);
128
+ const _r = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Fr = F("check", _r);
129
+ const jr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ct = F("chevron-down", jr);
130
+ const zr = [
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
- ], zr = _("contrast", jr);
134
- const $r = [
133
+ ], $r = F("contrast", zr);
134
+ const Or = [
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
- ], Or = _("copy", $r);
138
- const Ur = [
137
+ ], Ur = F("copy", Or);
138
+ const Wr = [
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
- ], Wr = _("ellipsis-vertical", Ur);
143
- const Br = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], It = _("loader-circle", Br);
144
- const Hr = [
142
+ ], Br = F("ellipsis-vertical", Wr);
143
+ const Hr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], St = F("loader-circle", Hr);
144
+ const qr = [
145
145
  ["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
146
146
  ["path", { d: "M21 12H9", key: "dn1m92" }],
147
147
  ["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
148
- ], qr = _("log-out", Hr);
149
- const Vr = [
148
+ ], Vr = F("log-out", qr);
149
+ const Xr = [
150
150
  ["path", { d: "M4 5h16", key: "1tepv9" }],
151
151
  ["path", { d: "M4 12h16", key: "1lakjw" }],
152
152
  ["path", { d: "M4 19h16", key: "1djgab" }]
153
- ], Xr = _("menu", Vr);
154
- const Kr = [
153
+ ], Kr = F("menu", Xr);
154
+ const Gr = [
155
155
  [
156
156
  "path",
157
157
  {
@@ -159,15 +159,15 @@ const Kr = [
159
159
  key: "1miecu"
160
160
  }
161
161
  ]
162
- ], St = _("paperclip", Kr);
163
- const Gr = [
162
+ ], Mt = F("paperclip", Gr);
163
+ const Zr = [
164
164
  ["path", { d: "M5 12h14", key: "1ays0h" }],
165
165
  ["path", { d: "M12 5v14", key: "s699le" }]
166
- ], Zr = _("plus", Gr);
167
- const Jr = [
166
+ ], Jr = F("plus", Zr);
167
+ const Qr = [
168
168
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
169
169
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
170
- ], Ue = _("x", Jr);
170
+ ], We = F("x", Qr);
171
171
  class Lt {
172
172
  constructor(r, t, a = !1) {
173
173
  pe(this, "baseUrl");
@@ -405,7 +405,7 @@ class Lt {
405
405
  return c.json();
406
406
  }
407
407
  }
408
- async function* Qr(e, r) {
408
+ async function* Yr(e, r) {
409
409
  const t = e.getReader(), a = new TextDecoder();
410
410
  let i = "";
411
411
  try {
@@ -438,7 +438,7 @@ async function* Qr(e, r) {
438
438
  t.releaseLock();
439
439
  }
440
440
  }
441
- function Yr(e) {
441
+ function ea(e) {
442
442
  return e.map((r) => {
443
443
  let t = "";
444
444
  if (typeof r.content == "string")
@@ -454,7 +454,7 @@ function Yr(e) {
454
454
  };
455
455
  });
456
456
  }
457
- function ea(e) {
457
+ function ta(e) {
458
458
  return {
459
459
  id: e.id,
460
460
  role: e.role,
@@ -486,51 +486,8 @@ function ea(e) {
486
486
  }
487
487
  };
488
488
  }
489
- function Mt(e, r) {
490
- const { modelId: t, systemPrompt: a, ephemeral: i, onChatCreated: o, onUserMessage: n, onThreadIdUpdate: u } = r;
491
- return {
492
- async *run(c) {
493
- const { messages: s, abortSignal: f, context: l } = c, p = l?.threadId;
494
- n?.();
495
- const h = {
496
- messages: Yr(s),
497
- chatId: null,
498
- // Thread ID will be set by runtime if needed
499
- systemPrompt: a,
500
- ephemeral: i,
501
- stream: !0
502
- };
503
- t && t.trim() !== "" && (h.modelId = t);
504
- const x = await e.createOrContinueChat(h, f);
505
- let g = "", b;
506
- for await (const k of Qr(x, f)) {
507
- if (f?.aborted)
508
- throw new Error("Request aborted");
509
- const w = k.id;
510
- w && !b && (b = w, o?.(w), p && u && u(p, w));
511
- const A = k.delta;
512
- if (A != null && (g += A), k.type === "message" || k.content) {
513
- const T = k.content || "";
514
- g += T;
515
- }
516
- if (k.message && (g += k.message.content || ""), k.tool_calls, k.finished) {
517
- g && (yield {
518
- content: [{ type: "text", text: g }]
519
- });
520
- break;
521
- }
522
- g && (yield {
523
- content: [{ type: "text", text: g }]
524
- });
525
- }
526
- g && (yield {
527
- content: [{ type: "text", text: g }]
528
- });
529
- }
530
- };
531
- }
532
- const ct = /* @__PURE__ */ new Map();
533
- function ta(e, r) {
489
+ const ye = /* @__PURE__ */ new Map();
490
+ function ra(e, r) {
534
491
  return {
535
492
  async list() {
536
493
  const t = [];
@@ -551,7 +508,7 @@ function ta(e, r) {
551
508
  }).filter((u) => u !== null) };
552
509
  },
553
510
  async initialize(t) {
554
- return { remoteId: ct.get(t) || t, externalId: void 0 };
511
+ return { remoteId: ye.get(t) || t, externalId: void 0 };
555
512
  },
556
513
  async rename(t, a) {
557
514
  await e.updateChat(t, { title: a });
@@ -587,17 +544,17 @@ function ta(e, r) {
587
544
  },
588
545
  // Add a method to update the remoteId mapping when chat ID is received
589
546
  updateRemoteId(t, a) {
590
- ct.set(t, a), r?.(t, a);
547
+ ye.set(t, a), r?.(t, a);
591
548
  },
592
549
  // Provider component that adds thread-specific history adapter
593
550
  unstable_Provider: ({ children: t }) => {
594
- const i = vt()?.remoteId, o = rt.useMemo(
551
+ const i = Ct()?.remoteId, o = at.useMemo(
595
552
  () => ({
596
553
  async load() {
597
554
  if (!i) return { messages: [] };
598
555
  try {
599
556
  const u = await e.getChat(i);
600
- return !u.messages || u.messages.length === 0 ? { messages: [] } : { messages: u.messages.map((s) => ea(s)) };
557
+ return !u.messages || u.messages.length === 0 ? { messages: [] } : { messages: u.messages.map((s) => ta(s)) };
601
558
  } catch (u) {
602
559
  return console.error("Failed to load messages for thread:", i, u), { messages: [] };
603
560
  }
@@ -606,12 +563,70 @@ function ta(e, r) {
606
563
  }
607
564
  }),
608
565
  [i, e]
609
- ), n = rt.useMemo(() => ({ history: o }), [o]);
610
- return /* @__PURE__ */ d(br, { adapters: n, children: t });
566
+ ), n = at.useMemo(() => ({ history: o }), [o]);
567
+ return /* @__PURE__ */ d(yr, { adapters: n, children: t });
611
568
  }
612
569
  };
613
570
  }
614
- function Dt() {
571
+ const ut = /* @__PURE__ */ new Map();
572
+ function Dt(e, r) {
573
+ const { modelId: t, systemPrompt: a, ephemeral: i, onChatCreated: o, onUserMessage: n, onThreadIdUpdate: u } = r;
574
+ let c;
575
+ return {
576
+ async *run(s) {
577
+ const { messages: f, abortSignal: l, context: p } = s, b = p?.threadId;
578
+ let h = b;
579
+ if (!h && f.length > 0) {
580
+ const w = f.find((I) => I.role === "user");
581
+ w && (h = (typeof w.content == "string" ? w.content : Array.isArray(w.content) && w.content.find((P) => P.type === "text")?.text || "").substring(0, 50));
582
+ }
583
+ let x;
584
+ b && (x = ye.get(b)), !x && h && (x = ut.get(h)), !x && c && (x = c), n?.();
585
+ let y = f, g = -1;
586
+ for (let w = f.length - 1; w >= 0; w--)
587
+ if (f[w].role === "assistant") {
588
+ g = w;
589
+ break;
590
+ }
591
+ (x || g >= 0) && g >= 0 && (y = f.slice(g + 1));
592
+ const v = {
593
+ messages: ea(y),
594
+ chatId: x || null,
595
+ // Use server chatId if available
596
+ systemPrompt: a,
597
+ ephemeral: i,
598
+ stream: !0
599
+ };
600
+ t && t.trim() !== "" && (v.modelId = t);
601
+ const M = await e.createOrContinueChat(v, l);
602
+ let N = "", A;
603
+ for await (const w of Yr(M, l)) {
604
+ if (l?.aborted)
605
+ throw new Error("Request aborted");
606
+ const I = w.id || w.chatId;
607
+ I && !A && (A = I, c = I, o?.(I), b && u && (u(b, I), ye.set(b, I)), h && ut.set(h, I));
608
+ const P = w.delta;
609
+ if (P != null && (N += P), w.type === "message" || w.content) {
610
+ const j = w.content || "";
611
+ N += j;
612
+ }
613
+ if (w.message && (N += w.message.content || ""), w.tool_calls, w.finished) {
614
+ N && (yield {
615
+ content: [{ type: "text", text: N }]
616
+ });
617
+ break;
618
+ }
619
+ N && (yield {
620
+ content: [{ type: "text", text: N }]
621
+ });
622
+ }
623
+ N && (yield {
624
+ content: [{ type: "text", text: N }]
625
+ });
626
+ }
627
+ };
628
+ }
629
+ function Rt() {
615
630
  return {
616
631
  accept: ".pdf,.docx,.txt,.md,.csv,.json,image/*",
617
632
  async add({ file: e }) {
@@ -652,7 +667,7 @@ function Dt() {
652
667
  }
653
668
  };
654
669
  }
655
- function ra({
670
+ function aa({
656
671
  children: e,
657
672
  baseUrl: r,
658
673
  sessionToken: t,
@@ -666,68 +681,68 @@ function ra({
666
681
  onError: f,
667
682
  onChatCreated: l,
668
683
  onUserMessage: p,
669
- onThreadIdUpdate: y,
684
+ onThreadIdUpdate: b,
670
685
  onChatsLoaded: h,
671
686
  enableAttachments: x = !1
672
687
  }) {
673
- const g = F(
688
+ const y = z(
674
689
  () => new Lt(r, t || void 0, a),
675
690
  [r, t, a]
676
- ), [b, k] = N(o || null);
677
- P(() => {
691
+ ), [g, k] = S(o || null);
692
+ E(() => {
678
693
  o && k(o);
679
694
  }, [o]);
680
- const w = ee(
681
- (T) => {
682
- l?.(T);
695
+ const v = ee(
696
+ (A) => {
697
+ l?.(A);
683
698
  },
684
699
  [l]
685
- ), A = ee(
686
- (T, S) => {
687
- y?.(T, S);
700
+ ), M = ee(
701
+ (A, w) => {
702
+ b?.(A, w);
688
703
  },
689
- [y]
690
- ), I = F(() => Mt(g, {
691
- modelId: b || void 0,
704
+ [b]
705
+ ), N = z(() => Dt(y, {
706
+ modelId: g || void 0,
692
707
  // Pass undefined if not set (backend resolves it)
693
708
  systemPrompt: c,
694
709
  ephemeral: u,
695
- onChatCreated: w,
710
+ onChatCreated: v,
696
711
  onUserMessage: p
697
- }), [g, b, c, u, w, p]);
698
- return i === "singleChat" ? /* @__PURE__ */ d(aa, { modelAdapter: I, enableAttachments: x, children: e }) : /* @__PURE__ */ d(
699
- na,
712
+ }), [y, g, c, u, v, p]);
713
+ return i === "singleChat" ? /* @__PURE__ */ d(na, { modelAdapter: N, enableAttachments: x, children: e }) : /* @__PURE__ */ d(
714
+ ia,
700
715
  {
701
- client: g,
716
+ client: y,
702
717
  modelAdapterOptions: {
703
- modelId: b || void 0,
718
+ modelId: g || void 0,
704
719
  systemPrompt: c,
705
720
  ephemeral: u,
706
- onChatCreated: w,
721
+ onChatCreated: v,
707
722
  onUserMessage: p
708
723
  },
709
724
  initialThreadId: s,
710
725
  onChatsLoaded: h,
711
- onThreadIdUpdate: A,
726
+ onThreadIdUpdate: M,
712
727
  onError: f,
713
728
  enableAttachments: x,
714
729
  children: e
715
730
  }
716
731
  );
717
732
  }
718
- function aa({
733
+ function na({
719
734
  modelAdapter: e,
720
735
  enableAttachments: r,
721
736
  children: t
722
737
  }) {
723
- const a = F(() => r ? Dt() : void 0, [r]), i = Ct(e, {
738
+ const a = z(() => r ? Rt() : void 0, [r]), i = Tt(e, {
724
739
  adapters: {
725
740
  ...a && { attachments: a }
726
741
  }
727
742
  });
728
- return /* @__PURE__ */ d(Tt, { runtime: i, children: t });
743
+ return /* @__PURE__ */ d(At, { runtime: i, children: t });
729
744
  }
730
- function na({
745
+ function ia({
731
746
  client: e,
732
747
  modelAdapterOptions: r,
733
748
  initialThreadId: t,
@@ -737,39 +752,39 @@ function na({
737
752
  enableAttachments: n,
738
753
  children: u
739
754
  }) {
740
- const c = F(() => ta(e, (x, g) => {
741
- i?.(x, g);
755
+ const c = z(() => ra(e, (x, y) => {
756
+ i?.(x, y);
742
757
  }), [e, i]), s = ee(
743
- (x, g) => {
744
- c.updateRemoteId && c.updateRemoteId(x, g), i?.(x, g);
758
+ (x, y) => {
759
+ c.updateRemoteId && c.updateRemoteId(x, y), i?.(x, y);
745
760
  },
746
761
  [c, i]
747
- ), f = F(() => ({
762
+ ), f = z(() => ({
748
763
  ...c,
749
764
  async list() {
750
765
  const x = await c.list();
751
766
  return a?.(), x;
752
767
  }
753
768
  }), [c, a]);
754
- P(() => {
769
+ E(() => {
755
770
  window.__cuadraThreadListAdapter = f, window.__cuadraThreadListRuntime = null;
756
771
  }, [f]);
757
- const l = F(() => Mt(e, {
772
+ const l = z(() => Dt(e, {
758
773
  ...r,
759
774
  onThreadIdUpdate: s
760
- }), [e, r, s]), p = F(() => n ? Dt() : void 0, [n]), y = ee(() => Ct(l, {
775
+ }), [e, r, s]), p = z(() => n ? Rt() : void 0, [n]), b = ee(() => Tt(l, {
761
776
  adapters: {
762
777
  ...p && { attachments: p }
763
778
  }
764
- }), [l, p]), h = yr({
779
+ }), [l, p]), h = xr({
765
780
  adapter: f,
766
- runtimeHook: y
781
+ runtimeHook: b
767
782
  });
768
- return P(() => {
783
+ return E(() => {
769
784
  window.__cuadraThreadListRuntime = h;
770
- }, [h]), /* @__PURE__ */ d(Tt, { runtime: h, children: u });
785
+ }, [h]), /* @__PURE__ */ d(At, { runtime: h, children: u });
771
786
  }
772
- function ut(e, r) {
787
+ function st(e, r) {
773
788
  const t = String(e);
774
789
  if (typeof r != "string")
775
790
  throw new TypeError("Expected character");
@@ -778,8 +793,8 @@ function ut(e, r) {
778
793
  a++, i = t.indexOf(r, i + r.length);
779
794
  return a;
780
795
  }
781
- const ue = we(/[A-Za-z]/), We = we(/[\dA-Za-z]/);
782
- function ia(e) {
796
+ const ue = ve(/[A-Za-z]/), Be = ve(/[\dA-Za-z]/);
797
+ function oa(e) {
783
798
  return (
784
799
  // Special whitespace codes (which have negative values), C0 and Control
785
800
  // character DEL
@@ -789,25 +804,25 @@ function ia(e) {
789
804
  function Y(e) {
790
805
  return e !== null && e < -2;
791
806
  }
792
- function E(e) {
807
+ function _(e) {
793
808
  return e !== null && (e < 0 || e === 32);
794
809
  }
795
- function W(e) {
810
+ function B(e) {
796
811
  return e === -2 || e === -1 || e === 32;
797
812
  }
798
- const ke = we(/\p{P}|\p{S}/u), K = we(/\s/);
799
- function we(e) {
813
+ const we = ve(/\p{P}|\p{S}/u), K = ve(/\s/);
814
+ function ve(e) {
800
815
  return r;
801
816
  function r(t) {
802
817
  return t !== null && t > -1 && e.test(String.fromCharCode(t));
803
818
  }
804
819
  }
805
- function oa(e) {
820
+ function ca(e) {
806
821
  if (typeof e != "string")
807
822
  throw new TypeError("Expected a string");
808
823
  return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
809
824
  }
810
- const ve = (
825
+ const Ce = (
811
826
  // Note: overloads in JSDoc can’t yet use different `@template`s.
812
827
  /**
813
828
  * @type {(
@@ -824,29 +839,29 @@ const ve = (
824
839
  */
825
840
  (function(e) {
826
841
  if (e == null)
827
- return la;
842
+ return da;
828
843
  if (typeof e == "function")
829
- return Ce(e);
844
+ return Te(e);
830
845
  if (typeof e == "object")
831
- return Array.isArray(e) ? ca(e) : (
846
+ return Array.isArray(e) ? ua(e) : (
832
847
  // Cast because `ReadonlyArray` goes into the above but `isArray`
833
848
  // narrows to `Array`.
834
- ua(
849
+ sa(
835
850
  /** @type {Props} */
836
851
  e
837
852
  )
838
853
  );
839
854
  if (typeof e == "string")
840
- return sa(e);
855
+ return la(e);
841
856
  throw new Error("Expected function, string, or object as test");
842
857
  })
843
858
  );
844
- function ca(e) {
859
+ function ua(e) {
845
860
  const r = [];
846
861
  let t = -1;
847
862
  for (; ++t < e.length; )
848
- r[t] = ve(e[t]);
849
- return Ce(a);
863
+ r[t] = Ce(e[t]);
864
+ return Te(a);
850
865
  function a(...i) {
851
866
  let o = -1;
852
867
  for (; ++o < r.length; )
@@ -854,12 +869,12 @@ function ca(e) {
854
869
  return !1;
855
870
  }
856
871
  }
857
- function ua(e) {
872
+ function sa(e) {
858
873
  const r = (
859
874
  /** @type {Record<string, unknown>} */
860
875
  e
861
876
  );
862
- return Ce(t);
877
+ return Te(t);
863
878
  function t(a) {
864
879
  const i = (
865
880
  /** @type {Record<string, unknown>} */
@@ -872,16 +887,16 @@ function ua(e) {
872
887
  return !0;
873
888
  }
874
889
  }
875
- function sa(e) {
876
- return Ce(r);
890
+ function la(e) {
891
+ return Te(r);
877
892
  function r(t) {
878
893
  return t && t.type === e;
879
894
  }
880
895
  }
881
- function Ce(e) {
896
+ function Te(e) {
882
897
  return r;
883
898
  function r(t, a, i) {
884
- return !!(da(t) && e.call(
899
+ return !!(fa(t) && e.call(
885
900
  this,
886
901
  t,
887
902
  typeof a == "number" ? a : void 0,
@@ -889,17 +904,17 @@ function Ce(e) {
889
904
  ));
890
905
  }
891
906
  }
892
- function la() {
907
+ function da() {
893
908
  return !0;
894
909
  }
895
- function da(e) {
910
+ function fa(e) {
896
911
  return e !== null && typeof e == "object" && "type" in e;
897
912
  }
898
- const Rt = [], fa = !0, $e = !1, ha = "skip";
899
- function Pt(e, r, t, a) {
913
+ const Pt = [], ha = !0, Oe = !1, ma = "skip";
914
+ function Et(e, r, t, a) {
900
915
  let i;
901
916
  typeof r == "function" && typeof t != "function" ? (a = t, t = r) : i = r;
902
- const o = ve(i), n = a ? -1 : 1;
917
+ const o = Ce(i), n = a ? -1 : 1;
903
918
  u(e, void 0, [])();
904
919
  function u(c, s, f) {
905
920
  const l = (
@@ -907,7 +922,7 @@ function Pt(e, r, t, a) {
907
922
  c && typeof c == "object" ? c : {}
908
923
  );
909
924
  if (typeof l.type == "string") {
910
- const y = (
925
+ const b = (
911
926
  // `hast`
912
927
  typeof l.tagName == "string" ? l.tagName : (
913
928
  // `xast`
@@ -915,79 +930,79 @@ function Pt(e, r, t, a) {
915
930
  )
916
931
  );
917
932
  Object.defineProperty(p, "name", {
918
- value: "node (" + (c.type + (y ? "<" + y + ">" : "")) + ")"
933
+ value: "node (" + (c.type + (b ? "<" + b + ">" : "")) + ")"
919
934
  });
920
935
  }
921
936
  return p;
922
937
  function p() {
923
- let y = Rt, h, x, g;
924
- if ((!r || o(c, s, f[f.length - 1] || void 0)) && (y = ma(t(c, f)), y[0] === $e))
925
- return y;
938
+ let b = Pt, h, x, y;
939
+ if ((!r || o(c, s, f[f.length - 1] || void 0)) && (b = pa(t(c, f)), b[0] === Oe))
940
+ return b;
926
941
  if ("children" in c && c.children) {
927
- const b = (
942
+ const g = (
928
943
  /** @type {UnistParent} */
929
944
  c
930
945
  );
931
- if (b.children && y[0] !== ha)
932
- for (x = (a ? b.children.length : -1) + n, g = f.concat(b); x > -1 && x < b.children.length; ) {
933
- const k = b.children[x];
934
- if (h = u(k, x, g)(), h[0] === $e)
946
+ if (g.children && b[0] !== ma)
947
+ for (x = (a ? g.children.length : -1) + n, y = f.concat(g); x > -1 && x < g.children.length; ) {
948
+ const k = g.children[x];
949
+ if (h = u(k, x, y)(), h[0] === Oe)
935
950
  return h;
936
951
  x = typeof h[1] == "number" ? h[1] : x + n;
937
952
  }
938
953
  }
939
- return y;
954
+ return b;
940
955
  }
941
956
  }
942
957
  }
943
- function ma(e) {
944
- return Array.isArray(e) ? e : typeof e == "number" ? [fa, e] : e == null ? Rt : [e];
958
+ function pa(e) {
959
+ return Array.isArray(e) ? e : typeof e == "number" ? [ha, e] : e == null ? Pt : [e];
945
960
  }
946
- function pa(e, r, t) {
947
- const i = ve((t || {}).ignore || []), o = ga(r);
961
+ function ga(e, r, t) {
962
+ const i = Ce((t || {}).ignore || []), o = ba(r);
948
963
  let n = -1;
949
964
  for (; ++n < o.length; )
950
- Pt(e, "text", u);
965
+ Et(e, "text", u);
951
966
  function u(s, f) {
952
967
  let l = -1, p;
953
968
  for (; ++l < f.length; ) {
954
- const y = f[l], h = p ? p.children : void 0;
969
+ const b = f[l], h = p ? p.children : void 0;
955
970
  if (i(
956
- y,
957
- h ? h.indexOf(y) : void 0,
971
+ b,
972
+ h ? h.indexOf(b) : void 0,
958
973
  p
959
974
  ))
960
975
  return;
961
- p = y;
976
+ p = b;
962
977
  }
963
978
  if (p)
964
979
  return c(s, f);
965
980
  }
966
981
  function c(s, f) {
967
- const l = f[f.length - 1], p = o[n][0], y = o[n][1];
982
+ const l = f[f.length - 1], p = o[n][0], b = o[n][1];
968
983
  let h = 0;
969
- const g = l.children.indexOf(s);
970
- let b = !1, k = [];
984
+ const y = l.children.indexOf(s);
985
+ let g = !1, k = [];
971
986
  p.lastIndex = 0;
972
- let w = p.exec(s.value);
973
- for (; w; ) {
974
- const A = w.index, I = {
975
- index: w.index,
976
- input: w.input,
987
+ let v = p.exec(s.value);
988
+ for (; v; ) {
989
+ const M = v.index, N = {
990
+ index: v.index,
991
+ input: v.input,
977
992
  stack: [...f, s]
978
993
  };
979
- let T = y(...w, I);
980
- if (typeof T == "string" && (T = T.length > 0 ? { type: "text", value: T } : void 0), T === !1 ? p.lastIndex = A + 1 : (h !== A && k.push({
994
+ let A = b(...v, N);
995
+ if (typeof A == "string" && (A = A.length > 0 ? { type: "text", value: A } : void 0), A === !1 ? p.lastIndex = M + 1 : (h !== M && k.push({
981
996
  type: "text",
982
- value: s.value.slice(h, A)
983
- }), Array.isArray(T) ? k.push(...T) : T && k.push(T), h = A + w[0].length, b = !0), !p.global)
997
+ value: s.value.slice(h, M)
998
+ }), Array.isArray(A) ? k.push(...A) : A && k.push(A), h = M + v[0].length, g = !0), !p.global)
984
999
  break;
985
- w = p.exec(s.value);
1000
+ v = p.exec(s.value);
986
1001
  }
987
- return b ? (h < s.value.length && k.push({ type: "text", value: s.value.slice(h) }), l.children.splice(g, 1, ...k)) : k = [s], g + k.length;
1002
+ return g ? (h < s.value.length && k.push({ type: "text", value: s.value.slice(h) }), l.children.splice(y, 1, ...k)) : k = [s], y + k.length;
988
1003
  }
989
1004
  }
990
- function ga(e) {
1005
+ function ba(e) {
991
1006
  const r = [];
992
1007
  if (!Array.isArray(e))
993
1008
  throw new TypeError("Expected find and replace tuple or list of tuples");
@@ -995,98 +1010,98 @@ function ga(e) {
995
1010
  let a = -1;
996
1011
  for (; ++a < t.length; ) {
997
1012
  const i = t[a];
998
- r.push([ba(i[0]), ya(i[1])]);
1013
+ r.push([ya(i[0]), xa(i[1])]);
999
1014
  }
1000
1015
  return r;
1001
1016
  }
1002
- function ba(e) {
1003
- return typeof e == "string" ? new RegExp(oa(e), "g") : e;
1004
- }
1005
1017
  function ya(e) {
1018
+ return typeof e == "string" ? new RegExp(ca(e), "g") : e;
1019
+ }
1020
+ function xa(e) {
1006
1021
  return typeof e == "function" ? e : function() {
1007
1022
  return e;
1008
1023
  };
1009
1024
  }
1010
- const Me = "phrasing", De = ["autolink", "link", "image", "label"];
1011
- function xa() {
1025
+ const De = "phrasing", Re = ["autolink", "link", "image", "label"];
1026
+ function ka() {
1012
1027
  return {
1013
- transforms: [Na],
1028
+ transforms: [Ia],
1014
1029
  enter: {
1015
- literalAutolink: wa,
1016
- literalAutolinkEmail: Re,
1017
- literalAutolinkHttp: Re,
1018
- literalAutolinkWww: Re
1030
+ literalAutolink: va,
1031
+ literalAutolinkEmail: Pe,
1032
+ literalAutolinkHttp: Pe,
1033
+ literalAutolinkWww: Pe
1019
1034
  },
1020
1035
  exit: {
1021
- literalAutolink: Aa,
1022
- literalAutolinkEmail: Ta,
1023
- literalAutolinkHttp: va,
1024
- literalAutolinkWww: Ca
1036
+ literalAutolink: Na,
1037
+ literalAutolinkEmail: Aa,
1038
+ literalAutolinkHttp: Ca,
1039
+ literalAutolinkWww: Ta
1025
1040
  }
1026
1041
  };
1027
1042
  }
1028
- function ka() {
1043
+ function wa() {
1029
1044
  return {
1030
1045
  unsafe: [
1031
1046
  {
1032
1047
  character: "@",
1033
1048
  before: "[+\\-.\\w]",
1034
1049
  after: "[\\-.\\w]",
1035
- inConstruct: Me,
1036
- notInConstruct: De
1050
+ inConstruct: De,
1051
+ notInConstruct: Re
1037
1052
  },
1038
1053
  {
1039
1054
  character: ".",
1040
1055
  before: "[Ww]",
1041
1056
  after: "[\\-.\\w]",
1042
- inConstruct: Me,
1043
- notInConstruct: De
1057
+ inConstruct: De,
1058
+ notInConstruct: Re
1044
1059
  },
1045
1060
  {
1046
1061
  character: ":",
1047
1062
  before: "[ps]",
1048
1063
  after: "\\/",
1049
- inConstruct: Me,
1050
- notInConstruct: De
1064
+ inConstruct: De,
1065
+ notInConstruct: Re
1051
1066
  }
1052
1067
  ]
1053
1068
  };
1054
1069
  }
1055
- function wa(e) {
1070
+ function va(e) {
1056
1071
  this.enter({ type: "link", title: null, url: "", children: [] }, e);
1057
1072
  }
1058
- function Re(e) {
1073
+ function Pe(e) {
1059
1074
  this.config.enter.autolinkProtocol.call(this, e);
1060
1075
  }
1061
- function va(e) {
1076
+ function Ca(e) {
1062
1077
  this.config.exit.autolinkProtocol.call(this, e);
1063
1078
  }
1064
- function Ca(e) {
1079
+ function Ta(e) {
1065
1080
  this.config.exit.data.call(this, e);
1066
1081
  const r = this.stack[this.stack.length - 1];
1067
1082
  r.type, r.url = "http://" + this.sliceSerialize(e);
1068
1083
  }
1069
- function Ta(e) {
1084
+ function Aa(e) {
1070
1085
  this.config.exit.autolinkEmail.call(this, e);
1071
1086
  }
1072
- function Aa(e) {
1087
+ function Na(e) {
1073
1088
  this.exit(e);
1074
1089
  }
1075
- function Na(e) {
1076
- pa(
1090
+ function Ia(e) {
1091
+ ga(
1077
1092
  e,
1078
1093
  [
1079
- [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Ia],
1080
- [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Sa]
1094
+ [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Sa],
1095
+ [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Ma]
1081
1096
  ],
1082
1097
  { ignore: ["link", "linkReference"] }
1083
1098
  );
1084
1099
  }
1085
- function Ia(e, r, t, a, i) {
1100
+ function Sa(e, r, t, a, i) {
1086
1101
  let o = "";
1087
- if (!Et(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !La(t)))
1102
+ if (!_t(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !La(t)))
1088
1103
  return !1;
1089
- const n = Ma(t + a);
1104
+ const n = Da(t + a);
1090
1105
  if (!n[0]) return !1;
1091
1106
  const u = {
1092
1107
  type: "link",
@@ -1096,10 +1111,10 @@ function Ia(e, r, t, a, i) {
1096
1111
  };
1097
1112
  return n[1] ? [u, { type: "text", value: n[1] }] : u;
1098
1113
  }
1099
- function Sa(e, r, t, a) {
1114
+ function Ma(e, r, t, a) {
1100
1115
  return (
1101
1116
  // Not an expected previous character.
1102
- !Et(a, !0) || // Label ends in not allowed character.
1117
+ !_t(a, !0) || // Label ends in not allowed character.
1103
1118
  /[-\d_]$/.test(t) ? !1 : {
1104
1119
  type: "link",
1105
1120
  title: null,
@@ -1112,64 +1127,64 @@ function La(e) {
1112
1127
  const r = e.split(".");
1113
1128
  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])));
1114
1129
  }
1115
- function Ma(e) {
1130
+ function Da(e) {
1116
1131
  const r = /[!"&'),.:;<>?\]}]+$/.exec(e);
1117
1132
  if (!r)
1118
1133
  return [e, void 0];
1119
1134
  e = e.slice(0, r.index);
1120
1135
  let t = r[0], a = t.indexOf(")");
1121
- const i = ut(e, "(");
1122
- let o = ut(e, ")");
1136
+ const i = st(e, "(");
1137
+ let o = st(e, ")");
1123
1138
  for (; a !== -1 && i > o; )
1124
1139
  e += t.slice(0, a + 1), t = t.slice(a + 1), a = t.indexOf(")"), o++;
1125
1140
  return [e, t];
1126
1141
  }
1127
- function Et(e, r) {
1142
+ function _t(e, r) {
1128
1143
  const t = e.input.charCodeAt(e.index - 1);
1129
- return (e.index === 0 || K(t) || ke(t)) && // If it’s an email, the previous character should not be a slash.
1144
+ return (e.index === 0 || K(t) || we(t)) && // If it’s an email, the previous character should not be a slash.
1130
1145
  (!r || t !== 47);
1131
1146
  }
1132
1147
  function le(e) {
1133
1148
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
1134
1149
  }
1135
- _t.peek = $a;
1136
- function Da() {
1150
+ Ft.peek = Oa;
1151
+ function Ra() {
1137
1152
  this.buffer();
1138
1153
  }
1139
- function Ra(e) {
1154
+ function Pa(e) {
1140
1155
  this.enter({ type: "footnoteReference", identifier: "", label: "" }, e);
1141
1156
  }
1142
- function Pa() {
1157
+ function Ea() {
1143
1158
  this.buffer();
1144
1159
  }
1145
- function Ea(e) {
1160
+ function _a(e) {
1146
1161
  this.enter(
1147
1162
  { type: "footnoteDefinition", identifier: "", label: "", children: [] },
1148
1163
  e
1149
1164
  );
1150
1165
  }
1151
- function _a(e) {
1166
+ function Fa(e) {
1152
1167
  const r = this.resume(), t = this.stack[this.stack.length - 1];
1153
1168
  t.type, t.identifier = le(
1154
1169
  this.sliceSerialize(e)
1155
1170
  ).toLowerCase(), t.label = r;
1156
1171
  }
1157
- function Fa(e) {
1172
+ function ja(e) {
1158
1173
  this.exit(e);
1159
1174
  }
1160
- function ja(e) {
1175
+ function za(e) {
1161
1176
  const r = this.resume(), t = this.stack[this.stack.length - 1];
1162
1177
  t.type, t.identifier = le(
1163
1178
  this.sliceSerialize(e)
1164
1179
  ).toLowerCase(), t.label = r;
1165
1180
  }
1166
- function za(e) {
1181
+ function $a(e) {
1167
1182
  this.exit(e);
1168
1183
  }
1169
- function $a() {
1184
+ function Oa() {
1170
1185
  return "[";
1171
1186
  }
1172
- function _t(e, r, t, a) {
1187
+ function Ft(e, r, t, a) {
1173
1188
  const i = t.createTracker(a);
1174
1189
  let o = i.move("[^");
1175
1190
  const n = t.enter("footnoteReference"), u = t.enter("reference");
@@ -1177,26 +1192,26 @@ function _t(e, r, t, a) {
1177
1192
  t.safe(t.associationId(e), { after: "]", before: o })
1178
1193
  ), u(), n(), o += i.move("]"), o;
1179
1194
  }
1180
- function Oa() {
1195
+ function Ua() {
1181
1196
  return {
1182
1197
  enter: {
1183
- gfmFootnoteCallString: Da,
1184
- gfmFootnoteCall: Ra,
1185
- gfmFootnoteDefinitionLabelString: Pa,
1186
- gfmFootnoteDefinition: Ea
1198
+ gfmFootnoteCallString: Ra,
1199
+ gfmFootnoteCall: Pa,
1200
+ gfmFootnoteDefinitionLabelString: Ea,
1201
+ gfmFootnoteDefinition: _a
1187
1202
  },
1188
1203
  exit: {
1189
- gfmFootnoteCallString: _a,
1190
- gfmFootnoteCall: Fa,
1191
- gfmFootnoteDefinitionLabelString: ja,
1192
- gfmFootnoteDefinition: za
1204
+ gfmFootnoteCallString: Fa,
1205
+ gfmFootnoteCall: ja,
1206
+ gfmFootnoteDefinitionLabelString: za,
1207
+ gfmFootnoteDefinition: $a
1193
1208
  }
1194
1209
  };
1195
1210
  }
1196
- function Ua(e) {
1211
+ function Wa(e) {
1197
1212
  let r = !1;
1198
1213
  return e && e.firstLineBlank && (r = !0), {
1199
- handlers: { footnoteDefinition: t, footnoteReference: _t },
1214
+ handlers: { footnoteDefinition: t, footnoteReference: Ft },
1200
1215
  // This is on by default already.
1201
1216
  unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
1202
1217
  };
@@ -1210,18 +1225,18 @@ function Ua(e) {
1210
1225
  (r ? `
1211
1226
  ` : " ") + o.indentLines(
1212
1227
  o.containerFlow(a, u.current()),
1213
- r ? Ft : Wa
1228
+ r ? jt : Ba
1214
1229
  )
1215
1230
  )), s(), c;
1216
1231
  }
1217
1232
  }
1218
- function Wa(e, r, t) {
1219
- return r === 0 ? e : Ft(e, r, t);
1233
+ function Ba(e, r, t) {
1234
+ return r === 0 ? e : jt(e, r, t);
1220
1235
  }
1221
- function Ft(e, r, t) {
1236
+ function jt(e, r, t) {
1222
1237
  return (t ? "" : " ") + e;
1223
1238
  }
1224
- const Ba = [
1239
+ const Ha = [
1225
1240
  "autolink",
1226
1241
  "destinationLiteral",
1227
1242
  "destinationRaw",
@@ -1229,33 +1244,33 @@ const Ba = [
1229
1244
  "titleQuote",
1230
1245
  "titleApostrophe"
1231
1246
  ];
1232
- jt.peek = Ka;
1233
- function Ha() {
1247
+ zt.peek = Ga;
1248
+ function qa() {
1234
1249
  return {
1235
1250
  canContainEols: ["delete"],
1236
- enter: { strikethrough: Va },
1237
- exit: { strikethrough: Xa }
1251
+ enter: { strikethrough: Xa },
1252
+ exit: { strikethrough: Ka }
1238
1253
  };
1239
1254
  }
1240
- function qa() {
1255
+ function Va() {
1241
1256
  return {
1242
1257
  unsafe: [
1243
1258
  {
1244
1259
  character: "~",
1245
1260
  inConstruct: "phrasing",
1246
- notInConstruct: Ba
1261
+ notInConstruct: Ha
1247
1262
  }
1248
1263
  ],
1249
- handlers: { delete: jt }
1264
+ handlers: { delete: zt }
1250
1265
  };
1251
1266
  }
1252
- function Va(e) {
1267
+ function Xa(e) {
1253
1268
  this.enter({ type: "delete", children: [] }, e);
1254
1269
  }
1255
- function Xa(e) {
1270
+ function Ka(e) {
1256
1271
  this.exit(e);
1257
1272
  }
1258
- function jt(e, r, t, a) {
1273
+ function zt(e, r, t, a) {
1259
1274
  const i = t.createTracker(a), o = t.enter("strikethrough");
1260
1275
  let n = i.move("~~");
1261
1276
  return n += t.containerPhrasing(e, {
@@ -1264,97 +1279,97 @@ function jt(e, r, t, a) {
1264
1279
  after: "~"
1265
1280
  }), n += i.move("~~"), o(), n;
1266
1281
  }
1267
- function Ka() {
1282
+ function Ga() {
1268
1283
  return "~";
1269
1284
  }
1270
- function Ga(e) {
1285
+ function Za(e) {
1271
1286
  return e.length;
1272
1287
  }
1273
- function Za(e, r) {
1274
- const t = r || {}, a = (t.align || []).concat(), i = t.stringLength || Ga, o = [], n = [], u = [], c = [];
1288
+ function Ja(e, r) {
1289
+ const t = r || {}, a = (t.align || []).concat(), i = t.stringLength || Za, o = [], n = [], u = [], c = [];
1275
1290
  let s = 0, f = -1;
1276
1291
  for (; ++f < e.length; ) {
1277
- const x = [], g = [];
1278
- let b = -1;
1279
- for (e[f].length > s && (s = e[f].length); ++b < e[f].length; ) {
1280
- const k = Ja(e[f][b]);
1292
+ const x = [], y = [];
1293
+ let g = -1;
1294
+ for (e[f].length > s && (s = e[f].length); ++g < e[f].length; ) {
1295
+ const k = Qa(e[f][g]);
1281
1296
  if (t.alignDelimiters !== !1) {
1282
- const w = i(k);
1283
- g[b] = w, (c[b] === void 0 || w > c[b]) && (c[b] = w);
1297
+ const v = i(k);
1298
+ y[g] = v, (c[g] === void 0 || v > c[g]) && (c[g] = v);
1284
1299
  }
1285
1300
  x.push(k);
1286
1301
  }
1287
- n[f] = x, u[f] = g;
1302
+ n[f] = x, u[f] = y;
1288
1303
  }
1289
1304
  let l = -1;
1290
1305
  if (typeof a == "object" && "length" in a)
1291
1306
  for (; ++l < s; )
1292
- o[l] = st(a[l]);
1307
+ o[l] = lt(a[l]);
1293
1308
  else {
1294
- const x = st(a);
1309
+ const x = lt(a);
1295
1310
  for (; ++l < s; )
1296
1311
  o[l] = x;
1297
1312
  }
1298
1313
  l = -1;
1299
- const p = [], y = [];
1314
+ const p = [], b = [];
1300
1315
  for (; ++l < s; ) {
1301
1316
  const x = o[l];
1302
- let g = "", b = "";
1303
- x === 99 ? (g = ":", b = ":") : x === 108 ? g = ":" : x === 114 && (b = ":");
1317
+ let y = "", g = "";
1318
+ x === 99 ? (y = ":", g = ":") : x === 108 ? y = ":" : x === 114 && (g = ":");
1304
1319
  let k = t.alignDelimiters === !1 ? 1 : Math.max(
1305
1320
  1,
1306
- c[l] - g.length - b.length
1321
+ c[l] - y.length - g.length
1307
1322
  );
1308
- const w = g + "-".repeat(k) + b;
1309
- t.alignDelimiters !== !1 && (k = g.length + k + b.length, k > c[l] && (c[l] = k), y[l] = k), p[l] = w;
1323
+ const v = y + "-".repeat(k) + g;
1324
+ t.alignDelimiters !== !1 && (k = y.length + k + g.length, k > c[l] && (c[l] = k), b[l] = k), p[l] = v;
1310
1325
  }
1311
- n.splice(1, 0, p), u.splice(1, 0, y), f = -1;
1326
+ n.splice(1, 0, p), u.splice(1, 0, b), f = -1;
1312
1327
  const h = [];
1313
1328
  for (; ++f < n.length; ) {
1314
- const x = n[f], g = u[f];
1329
+ const x = n[f], y = u[f];
1315
1330
  l = -1;
1316
- const b = [];
1331
+ const g = [];
1317
1332
  for (; ++l < s; ) {
1318
1333
  const k = x[l] || "";
1319
- let w = "", A = "";
1334
+ let v = "", M = "";
1320
1335
  if (t.alignDelimiters !== !1) {
1321
- const I = c[l] - (g[l] || 0), T = o[l];
1322
- T === 114 ? w = " ".repeat(I) : T === 99 ? I % 2 ? (w = " ".repeat(I / 2 + 0.5), A = " ".repeat(I / 2 - 0.5)) : (w = " ".repeat(I / 2), A = w) : A = " ".repeat(I);
1336
+ const N = c[l] - (y[l] || 0), A = o[l];
1337
+ A === 114 ? v = " ".repeat(N) : A === 99 ? N % 2 ? (v = " ".repeat(N / 2 + 0.5), M = " ".repeat(N / 2 - 0.5)) : (v = " ".repeat(N / 2), M = v) : M = " ".repeat(N);
1323
1338
  }
1324
- t.delimiterStart !== !1 && !l && b.push("|"), t.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
1339
+ t.delimiterStart !== !1 && !l && g.push("|"), t.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
1325
1340
  // empty: there will be a closing space.
1326
- !(t.alignDelimiters === !1 && k === "") && (t.delimiterStart !== !1 || l) && b.push(" "), t.alignDelimiters !== !1 && b.push(w), b.push(k), t.alignDelimiters !== !1 && b.push(A), t.padding !== !1 && b.push(" "), (t.delimiterEnd !== !1 || l !== s - 1) && b.push("|");
1341
+ !(t.alignDelimiters === !1 && k === "") && (t.delimiterStart !== !1 || l) && g.push(" "), t.alignDelimiters !== !1 && g.push(v), g.push(k), t.alignDelimiters !== !1 && g.push(M), t.padding !== !1 && g.push(" "), (t.delimiterEnd !== !1 || l !== s - 1) && g.push("|");
1327
1342
  }
1328
1343
  h.push(
1329
- t.delimiterEnd === !1 ? b.join("").replace(/ +$/, "") : b.join("")
1344
+ t.delimiterEnd === !1 ? g.join("").replace(/ +$/, "") : g.join("")
1330
1345
  );
1331
1346
  }
1332
1347
  return h.join(`
1333
1348
  `);
1334
1349
  }
1335
- function Ja(e) {
1350
+ function Qa(e) {
1336
1351
  return e == null ? "" : String(e);
1337
1352
  }
1338
- function st(e) {
1353
+ function lt(e) {
1339
1354
  const r = typeof e == "string" ? e.codePointAt(0) : 0;
1340
1355
  return r === 67 || r === 99 ? 99 : r === 76 || r === 108 ? 108 : r === 82 || r === 114 ? 114 : 0;
1341
1356
  }
1342
- function Qa(e, r, t, a) {
1357
+ function Ya(e, r, t, a) {
1343
1358
  const i = t.enter("blockquote"), o = t.createTracker(a);
1344
1359
  o.move("> "), o.shift(2);
1345
1360
  const n = t.indentLines(
1346
1361
  t.containerFlow(e, o.current()),
1347
- Ya
1362
+ en
1348
1363
  );
1349
1364
  return i(), n;
1350
1365
  }
1351
- function Ya(e, r, t) {
1366
+ function en(e, r, t) {
1352
1367
  return ">" + (t ? "" : " ") + e;
1353
1368
  }
1354
- function en(e, r) {
1355
- return lt(e, r.inConstruct, !0) && !lt(e, r.notInConstruct, !1);
1369
+ function tn(e, r) {
1370
+ return dt(e, r.inConstruct, !0) && !dt(e, r.notInConstruct, !1);
1356
1371
  }
1357
- function lt(e, r, t) {
1372
+ function dt(e, r, t) {
1358
1373
  if (typeof r == "string" && (r = [r]), !r || r.length === 0)
1359
1374
  return t;
1360
1375
  let a = -1;
@@ -1363,16 +1378,16 @@ function lt(e, r, t) {
1363
1378
  return !0;
1364
1379
  return !1;
1365
1380
  }
1366
- function dt(e, r, t, a) {
1381
+ function ft(e, r, t, a) {
1367
1382
  let i = -1;
1368
1383
  for (; ++i < t.unsafe.length; )
1369
1384
  if (t.unsafe[i].character === `
1370
- ` && en(t.stack, t.unsafe[i]))
1385
+ ` && tn(t.stack, t.unsafe[i]))
1371
1386
  return /[ \t]/.test(a.before) ? "" : " ";
1372
1387
  return `\\
1373
1388
  `;
1374
1389
  }
1375
- function tn(e, r) {
1390
+ function rn(e, r) {
1376
1391
  const t = String(e);
1377
1392
  let a = t.indexOf(r), i = a, o = 0, n = 0;
1378
1393
  if (typeof r != "string")
@@ -1381,13 +1396,13 @@ function tn(e, r) {
1381
1396
  a === i ? ++o > n && (n = o) : o = 1, i = a + r.length, a = t.indexOf(r, i);
1382
1397
  return n;
1383
1398
  }
1384
- function rn(e, r) {
1399
+ function an(e, r) {
1385
1400
  return !!(r.options.fences === !1 && e.value && // If there’s no info…
1386
1401
  !e.lang && // And there’s a non-whitespace character…
1387
1402
  /[^ \r\n]/.test(e.value) && // And the value doesn’t start or end in a blank…
1388
1403
  !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value));
1389
1404
  }
1390
- function an(e) {
1405
+ function nn(e) {
1391
1406
  const r = e.options.fence || "`";
1392
1407
  if (r !== "`" && r !== "~")
1393
1408
  throw new Error(
@@ -1395,13 +1410,13 @@ function an(e) {
1395
1410
  );
1396
1411
  return r;
1397
1412
  }
1398
- function nn(e, r, t, a) {
1399
- const i = an(t), o = e.value || "", n = i === "`" ? "GraveAccent" : "Tilde";
1400
- if (rn(e, t)) {
1401
- const l = t.enter("codeIndented"), p = t.indentLines(o, on);
1413
+ function on(e, r, t, a) {
1414
+ const i = nn(t), o = e.value || "", n = i === "`" ? "GraveAccent" : "Tilde";
1415
+ if (an(e, t)) {
1416
+ const l = t.enter("codeIndented"), p = t.indentLines(o, cn);
1402
1417
  return l(), p;
1403
1418
  }
1404
- const u = t.createTracker(a), c = i.repeat(Math.max(tn(o, i) + 1, 3)), s = t.enter("codeFenced");
1419
+ const u = t.createTracker(a), c = i.repeat(Math.max(rn(o, i) + 1, 3)), s = t.enter("codeFenced");
1405
1420
  let f = u.move(c);
1406
1421
  if (e.lang) {
1407
1422
  const l = t.enter(`codeFencedLang${n}`);
@@ -1430,10 +1445,10 @@ function nn(e, r, t, a) {
1430
1445
  `), o && (f += u.move(o + `
1431
1446
  `)), f += u.move(c), s(), f;
1432
1447
  }
1433
- function on(e, r, t) {
1448
+ function cn(e, r, t) {
1434
1449
  return (t ? "" : " ") + e;
1435
1450
  }
1436
- function Be(e) {
1451
+ function He(e) {
1437
1452
  const r = e.options.quote || '"';
1438
1453
  if (r !== '"' && r !== "'")
1439
1454
  throw new Error(
@@ -1441,8 +1456,8 @@ function Be(e) {
1441
1456
  );
1442
1457
  return r;
1443
1458
  }
1444
- function cn(e, r, t, a) {
1445
- const i = Be(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("definition");
1459
+ function un(e, r, t, a) {
1460
+ const i = He(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("definition");
1446
1461
  let u = t.enter("label");
1447
1462
  const c = t.createTracker(a);
1448
1463
  let s = c.move("[");
@@ -1471,7 +1486,7 @@ function cn(e, r, t, a) {
1471
1486
  })
1472
1487
  ), s += c.move(i), u()), n(), s;
1473
1488
  }
1474
- function un(e) {
1489
+ function sn(e) {
1475
1490
  const r = e.options.emphasis || "*";
1476
1491
  if (r !== "*" && r !== "_")
1477
1492
  throw new Error(
@@ -1482,14 +1497,14 @@ function un(e) {
1482
1497
  function se(e) {
1483
1498
  return "&#x" + e.toString(16).toUpperCase() + ";";
1484
1499
  }
1485
- function ye(e) {
1486
- if (e === null || E(e) || K(e))
1500
+ function xe(e) {
1501
+ if (e === null || _(e) || K(e))
1487
1502
  return 1;
1488
- if (ke(e))
1503
+ if (we(e))
1489
1504
  return 2;
1490
1505
  }
1491
- function xe(e, r, t) {
1492
- const a = ye(e), i = ye(r);
1506
+ function ke(e, r, t) {
1507
+ const a = xe(e), i = xe(r);
1493
1508
  return a === void 0 ? i === void 0 ? (
1494
1509
  // Letter inside:
1495
1510
  // we have to encode *both* letters for `_` as it is looser.
@@ -1521,9 +1536,9 @@ function xe(e, r, t) {
1521
1536
  { inside: !1, outside: !1 }
1522
1537
  );
1523
1538
  }
1524
- zt.peek = sn;
1525
- function zt(e, r, t, a) {
1526
- const i = un(t), o = t.enter("emphasis"), n = t.createTracker(a), u = n.move(i);
1539
+ $t.peek = ln;
1540
+ function $t(e, r, t, a) {
1541
+ const i = sn(t), o = t.enter("emphasis"), n = t.createTracker(a), u = n.move(i);
1527
1542
  let c = n.move(
1528
1543
  t.containerPhrasing(e, {
1529
1544
  after: i,
@@ -1531,67 +1546,67 @@ function zt(e, r, t, a) {
1531
1546
  ...n.current()
1532
1547
  })
1533
1548
  );
1534
- const s = c.charCodeAt(0), f = xe(
1549
+ const s = c.charCodeAt(0), f = ke(
1535
1550
  a.before.charCodeAt(a.before.length - 1),
1536
1551
  s,
1537
1552
  i
1538
1553
  );
1539
1554
  f.inside && (c = se(s) + c.slice(1));
1540
- const l = c.charCodeAt(c.length - 1), p = xe(a.after.charCodeAt(0), l, i);
1555
+ const l = c.charCodeAt(c.length - 1), p = ke(a.after.charCodeAt(0), l, i);
1541
1556
  p.inside && (c = c.slice(0, -1) + se(l));
1542
- const y = n.move(i);
1557
+ const b = n.move(i);
1543
1558
  return o(), t.attentionEncodeSurroundingInfo = {
1544
1559
  after: p.outside,
1545
1560
  before: f.outside
1546
- }, u + c + y;
1561
+ }, u + c + b;
1547
1562
  }
1548
- function sn(e, r, t) {
1563
+ function ln(e, r, t) {
1549
1564
  return t.options.emphasis || "*";
1550
1565
  }
1551
- function ln(e, r, t, a) {
1566
+ function dn(e, r, t, a) {
1552
1567
  let i, o, n;
1553
- typeof r == "function" && typeof t != "function" ? (o = void 0, n = r, i = t) : (o = r, n = t, i = a), Pt(e, o, u, i);
1568
+ typeof r == "function" && typeof t != "function" ? (o = void 0, n = r, i = t) : (o = r, n = t, i = a), Et(e, o, u, i);
1554
1569
  function u(c, s) {
1555
1570
  const f = s[s.length - 1], l = f ? f.children.indexOf(c) : void 0;
1556
1571
  return n(c, l, f);
1557
1572
  }
1558
1573
  }
1559
- const dn = {};
1560
- function $t(e, r) {
1561
- const t = dn, a = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1562
- return Ot(e, a, i);
1574
+ const fn = {};
1575
+ function Ot(e, r) {
1576
+ const t = fn, a = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1577
+ return Ut(e, a, i);
1563
1578
  }
1564
- function Ot(e, r, t) {
1565
- if (fn(e)) {
1579
+ function Ut(e, r, t) {
1580
+ if (hn(e)) {
1566
1581
  if ("value" in e)
1567
1582
  return e.type === "html" && !t ? "" : e.value;
1568
1583
  if (r && "alt" in e && e.alt)
1569
1584
  return e.alt;
1570
1585
  if ("children" in e)
1571
- return ft(e.children, r, t);
1586
+ return ht(e.children, r, t);
1572
1587
  }
1573
- return Array.isArray(e) ? ft(e, r, t) : "";
1588
+ return Array.isArray(e) ? ht(e, r, t) : "";
1574
1589
  }
1575
- function ft(e, r, t) {
1590
+ function ht(e, r, t) {
1576
1591
  const a = [];
1577
1592
  let i = -1;
1578
1593
  for (; ++i < e.length; )
1579
- a[i] = Ot(e[i], r, t);
1594
+ a[i] = Ut(e[i], r, t);
1580
1595
  return a.join("");
1581
1596
  }
1582
- function fn(e) {
1597
+ function hn(e) {
1583
1598
  return !!(e && typeof e == "object");
1584
1599
  }
1585
- function hn(e, r) {
1600
+ function mn(e, r) {
1586
1601
  let t = !1;
1587
- return ln(e, function(a) {
1602
+ return dn(e, function(a) {
1588
1603
  if ("value" in a && /\r?\n|\r/.test(a.value) || a.type === "break")
1589
- return t = !0, $e;
1590
- }), !!((!e.depth || e.depth < 3) && $t(e) && (r.options.setext || t));
1604
+ return t = !0, Oe;
1605
+ }), !!((!e.depth || e.depth < 3) && Ot(e) && (r.options.setext || t));
1591
1606
  }
1592
- function mn(e, r, t, a) {
1607
+ function pn(e, r, t, a) {
1593
1608
  const i = Math.max(Math.min(6, e.depth || 1), 1), o = t.createTracker(a);
1594
- if (hn(e, t)) {
1609
+ if (mn(e, t)) {
1595
1610
  const f = t.enter("headingSetext"), l = t.enter("phrasing"), p = t.containerPhrasing(e, {
1596
1611
  ...o.current(),
1597
1612
  before: `
@@ -1618,16 +1633,16 @@ function mn(e, r, t, a) {
1618
1633
  });
1619
1634
  return /^[\t ]/.test(s) && (s = se(s.charCodeAt(0)) + s.slice(1)), s = s ? n + " " + s : n, t.options.closeAtx && (s += " " + n), c(), u(), s;
1620
1635
  }
1621
- Ut.peek = pn;
1622
- function Ut(e) {
1636
+ Wt.peek = gn;
1637
+ function Wt(e) {
1623
1638
  return e.value || "";
1624
1639
  }
1625
- function pn() {
1640
+ function gn() {
1626
1641
  return "<";
1627
1642
  }
1628
- Wt.peek = gn;
1629
- function Wt(e, r, t, a) {
1630
- const i = Be(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("image");
1643
+ Bt.peek = bn;
1644
+ function Bt(e, r, t, a) {
1645
+ const i = He(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.enter("image");
1631
1646
  let u = t.enter("label");
1632
1647
  const c = t.createTracker(a);
1633
1648
  let s = c.move("![");
@@ -1651,11 +1666,11 @@ function Wt(e, r, t, a) {
1651
1666
  })
1652
1667
  ), s += c.move(i), u()), s += c.move(")"), n(), s;
1653
1668
  }
1654
- function gn() {
1669
+ function bn() {
1655
1670
  return "!";
1656
1671
  }
1657
- Bt.peek = bn;
1658
- function Bt(e, r, t, a) {
1672
+ Ht.peek = yn;
1673
+ function Ht(e, r, t, a) {
1659
1674
  const i = e.referenceType, o = t.enter("imageReference");
1660
1675
  let n = t.enter("label");
1661
1676
  const u = t.createTracker(a);
@@ -1675,11 +1690,11 @@ function Bt(e, r, t, a) {
1675
1690
  });
1676
1691
  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;
1677
1692
  }
1678
- function bn() {
1693
+ function yn() {
1679
1694
  return "!";
1680
1695
  }
1681
- Ht.peek = yn;
1682
- function Ht(e, r, t) {
1696
+ qt.peek = xn;
1697
+ function qt(e, r, t) {
1683
1698
  let a = e.value || "", i = "`", o = -1;
1684
1699
  for (; new RegExp("(^|[^`])" + i + "([^`]|$)").test(a); )
1685
1700
  i += "`";
@@ -1694,11 +1709,11 @@ function Ht(e, r, t) {
1694
1709
  }
1695
1710
  return i + a + i;
1696
1711
  }
1697
- function yn() {
1712
+ function xn() {
1698
1713
  return "`";
1699
1714
  }
1700
- function qt(e, r) {
1701
- const t = $t(e);
1715
+ function Vt(e, r) {
1716
+ const t = Ot(e);
1702
1717
  return !!(!r.options.resourceLink && // If there’s a url…
1703
1718
  e.url && // And there’s a no title…
1704
1719
  !e.title && // And the content of `node` is a single text node…
@@ -1708,11 +1723,11 @@ function qt(e, r) {
1708
1723
  // references don’t work), space, or angle brackets…
1709
1724
  !/[\0- <>\u007F]/.test(e.url));
1710
1725
  }
1711
- Vt.peek = xn;
1712
- function Vt(e, r, t, a) {
1713
- const i = Be(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.createTracker(a);
1726
+ Xt.peek = kn;
1727
+ function Xt(e, r, t, a) {
1728
+ const i = He(t), o = i === '"' ? "Quote" : "Apostrophe", n = t.createTracker(a);
1714
1729
  let u, c;
1715
- if (qt(e, t)) {
1730
+ if (Vt(e, t)) {
1716
1731
  const f = t.stack;
1717
1732
  t.stack = [], u = t.enter("autolink");
1718
1733
  let l = n.move("<");
@@ -1750,11 +1765,11 @@ function Vt(e, r, t, a) {
1750
1765
  })
1751
1766
  ), s += n.move(i), c()), s += n.move(")"), u(), s;
1752
1767
  }
1753
- function xn(e, r, t) {
1754
- return qt(e, t) ? "<" : "[";
1768
+ function kn(e, r, t) {
1769
+ return Vt(e, t) ? "<" : "[";
1755
1770
  }
1756
- Xt.peek = kn;
1757
- function Xt(e, r, t, a) {
1771
+ Kt.peek = wn;
1772
+ function Kt(e, r, t, a) {
1758
1773
  const i = e.referenceType, o = t.enter("linkReference");
1759
1774
  let n = t.enter("label");
1760
1775
  const u = t.createTracker(a);
@@ -1774,10 +1789,10 @@ function Xt(e, r, t, a) {
1774
1789
  });
1775
1790
  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;
1776
1791
  }
1777
- function kn() {
1792
+ function wn() {
1778
1793
  return "[";
1779
1794
  }
1780
- function He(e) {
1795
+ function qe(e) {
1781
1796
  const r = e.options.bullet || "*";
1782
1797
  if (r !== "*" && r !== "+" && r !== "-")
1783
1798
  throw new Error(
@@ -1785,8 +1800,8 @@ function He(e) {
1785
1800
  );
1786
1801
  return r;
1787
1802
  }
1788
- function wn(e) {
1789
- const r = He(e), t = e.options.bulletOther;
1803
+ function vn(e) {
1804
+ const r = qe(e), t = e.options.bulletOther;
1790
1805
  if (!t)
1791
1806
  return r === "*" ? "-" : "*";
1792
1807
  if (t !== "*" && t !== "+" && t !== "-")
@@ -1799,7 +1814,7 @@ function wn(e) {
1799
1814
  );
1800
1815
  return t;
1801
1816
  }
1802
- function vn(e) {
1817
+ function Cn(e) {
1803
1818
  const r = e.options.bulletOrdered || ".";
1804
1819
  if (r !== "." && r !== ")")
1805
1820
  throw new Error(
@@ -1807,7 +1822,7 @@ function vn(e) {
1807
1822
  );
1808
1823
  return r;
1809
1824
  }
1810
- function Kt(e) {
1825
+ function Gt(e) {
1811
1826
  const r = e.options.rule || "*";
1812
1827
  if (r !== "*" && r !== "-" && r !== "_")
1813
1828
  throw new Error(
@@ -1815,10 +1830,10 @@ function Kt(e) {
1815
1830
  );
1816
1831
  return r;
1817
1832
  }
1818
- function Cn(e, r, t, a) {
1833
+ function Tn(e, r, t, a) {
1819
1834
  const i = t.enter("list"), o = t.bulletCurrent;
1820
- let n = e.ordered ? vn(t) : He(t);
1821
- const u = e.ordered ? n === "." ? ")" : "." : wn(t);
1835
+ let n = e.ordered ? Cn(t) : qe(t);
1836
+ const u = e.ordered ? n === "." ? ")" : "." : vn(t);
1822
1837
  let c = r && t.bulletLastUsed ? n === t.bulletLastUsed : !1;
1823
1838
  if (!e.ordered) {
1824
1839
  const f = e.children ? e.children[0] : void 0;
@@ -1827,7 +1842,7 @@ function Cn(e, r, t, a) {
1827
1842
  (n === "*" || n === "-") && // Empty first list item:
1828
1843
  f && (!f.children || !f.children[0]) && // Directly in two other list items:
1829
1844
  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.
1830
- t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (c = !0), Kt(t) === n && f
1845
+ t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (c = !0), Gt(t) === n && f
1831
1846
  ) {
1832
1847
  let l = -1;
1833
1848
  for (; ++l < e.children.length; ) {
@@ -1843,7 +1858,7 @@ function Cn(e, r, t, a) {
1843
1858
  const s = t.containerFlow(e, a);
1844
1859
  return t.bulletLastUsed = n, t.bulletCurrent = o, i(), s;
1845
1860
  }
1846
- function Tn(e) {
1861
+ function An(e) {
1847
1862
  const r = e.options.listItemIndent || "one";
1848
1863
  if (r !== "tab" && r !== "one" && r !== "mixed")
1849
1864
  throw new Error(
@@ -1851,9 +1866,9 @@ function Tn(e) {
1851
1866
  );
1852
1867
  return r;
1853
1868
  }
1854
- function An(e, r, t, a) {
1855
- const i = Tn(t);
1856
- let o = t.bulletCurrent || He(t);
1869
+ function Nn(e, r, t, a) {
1870
+ const i = An(t);
1871
+ let o = t.bulletCurrent || qe(t);
1857
1872
  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);
1858
1873
  let n = o.length + 1;
1859
1874
  (i === "tab" || i === "mixed" && (r && r.type === "list" && r.spread || e.spread)) && (n = Math.ceil(n / 4) * 4);
@@ -1864,17 +1879,17 @@ function An(e, r, t, a) {
1864
1879
  f
1865
1880
  );
1866
1881
  return c(), s;
1867
- function f(l, p, y) {
1868
- return p ? (y ? "" : " ".repeat(n)) + l : (y ? o : o + " ".repeat(n - o.length)) + l;
1882
+ function f(l, p, b) {
1883
+ return p ? (b ? "" : " ".repeat(n)) + l : (b ? o : o + " ".repeat(n - o.length)) + l;
1869
1884
  }
1870
1885
  }
1871
- function Nn(e, r, t, a) {
1886
+ function In(e, r, t, a) {
1872
1887
  const i = t.enter("paragraph"), o = t.enter("phrasing"), n = t.containerPhrasing(e, a);
1873
1888
  return o(), i(), n;
1874
1889
  }
1875
- const In = (
1890
+ const Sn = (
1876
1891
  /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
1877
- ve([
1892
+ Ce([
1878
1893
  "break",
1879
1894
  "delete",
1880
1895
  "emphasis",
@@ -1898,9 +1913,9 @@ const In = (
1898
1913
  "textDirective"
1899
1914
  ])
1900
1915
  );
1901
- function Sn(e, r, t, a) {
1916
+ function Mn(e, r, t, a) {
1902
1917
  return (e.children.some(function(n) {
1903
- return In(n);
1918
+ return Sn(n);
1904
1919
  }) ? t.containerPhrasing : t.containerFlow).call(t, e, a);
1905
1920
  }
1906
1921
  function Ln(e) {
@@ -1911,8 +1926,8 @@ function Ln(e) {
1911
1926
  );
1912
1927
  return r;
1913
1928
  }
1914
- Gt.peek = Mn;
1915
- function Gt(e, r, t, a) {
1929
+ Zt.peek = Dn;
1930
+ function Zt(e, r, t, a) {
1916
1931
  const i = Ln(t), o = t.enter("strong"), n = t.createTracker(a), u = n.move(i + i);
1917
1932
  let c = n.move(
1918
1933
  t.containerPhrasing(e, {
@@ -1921,27 +1936,27 @@ function Gt(e, r, t, a) {
1921
1936
  ...n.current()
1922
1937
  })
1923
1938
  );
1924
- const s = c.charCodeAt(0), f = xe(
1939
+ const s = c.charCodeAt(0), f = ke(
1925
1940
  a.before.charCodeAt(a.before.length - 1),
1926
1941
  s,
1927
1942
  i
1928
1943
  );
1929
1944
  f.inside && (c = se(s) + c.slice(1));
1930
- const l = c.charCodeAt(c.length - 1), p = xe(a.after.charCodeAt(0), l, i);
1945
+ const l = c.charCodeAt(c.length - 1), p = ke(a.after.charCodeAt(0), l, i);
1931
1946
  p.inside && (c = c.slice(0, -1) + se(l));
1932
- const y = n.move(i + i);
1947
+ const b = n.move(i + i);
1933
1948
  return o(), t.attentionEncodeSurroundingInfo = {
1934
1949
  after: p.outside,
1935
1950
  before: f.outside
1936
- }, u + c + y;
1951
+ }, u + c + b;
1937
1952
  }
1938
- function Mn(e, r, t) {
1953
+ function Dn(e, r, t) {
1939
1954
  return t.options.strong || "*";
1940
1955
  }
1941
- function Dn(e, r, t, a) {
1956
+ function Rn(e, r, t, a) {
1942
1957
  return t.safe(e.value, a);
1943
1958
  }
1944
- function Rn(e) {
1959
+ function Pn(e) {
1945
1960
  const r = e.options.ruleRepetition || 3;
1946
1961
  if (r < 3)
1947
1962
  throw new Error(
@@ -1949,50 +1964,50 @@ function Rn(e) {
1949
1964
  );
1950
1965
  return r;
1951
1966
  }
1952
- function Pn(e, r, t) {
1953
- const a = (Kt(t) + (t.options.ruleSpaces ? " " : "")).repeat(Rn(t));
1967
+ function En(e, r, t) {
1968
+ const a = (Gt(t) + (t.options.ruleSpaces ? " " : "")).repeat(Pn(t));
1954
1969
  return t.options.ruleSpaces ? a.slice(0, -1) : a;
1955
1970
  }
1956
- const Zt = {
1957
- blockquote: Qa,
1958
- break: dt,
1959
- code: nn,
1960
- definition: cn,
1961
- emphasis: zt,
1962
- hardBreak: dt,
1963
- heading: mn,
1964
- html: Ut,
1965
- image: Wt,
1966
- imageReference: Bt,
1967
- inlineCode: Ht,
1968
- link: Vt,
1969
- linkReference: Xt,
1970
- list: Cn,
1971
- listItem: An,
1972
- paragraph: Nn,
1973
- root: Sn,
1974
- strong: Gt,
1975
- text: Dn,
1976
- thematicBreak: Pn
1971
+ const Jt = {
1972
+ blockquote: Ya,
1973
+ break: ft,
1974
+ code: on,
1975
+ definition: un,
1976
+ emphasis: $t,
1977
+ hardBreak: ft,
1978
+ heading: pn,
1979
+ html: Wt,
1980
+ image: Bt,
1981
+ imageReference: Ht,
1982
+ inlineCode: qt,
1983
+ link: Xt,
1984
+ linkReference: Kt,
1985
+ list: Tn,
1986
+ listItem: Nn,
1987
+ paragraph: In,
1988
+ root: Mn,
1989
+ strong: Zt,
1990
+ text: Rn,
1991
+ thematicBreak: En
1977
1992
  };
1978
- function En() {
1993
+ function _n() {
1979
1994
  return {
1980
1995
  enter: {
1981
- table: _n,
1982
- tableData: ht,
1983
- tableHeader: ht,
1984
- tableRow: jn
1996
+ table: Fn,
1997
+ tableData: mt,
1998
+ tableHeader: mt,
1999
+ tableRow: zn
1985
2000
  },
1986
2001
  exit: {
1987
- codeText: zn,
1988
- table: Fn,
1989
- tableData: Pe,
1990
- tableHeader: Pe,
1991
- tableRow: Pe
2002
+ codeText: $n,
2003
+ table: jn,
2004
+ tableData: Ee,
2005
+ tableHeader: Ee,
2006
+ tableRow: Ee
1992
2007
  }
1993
2008
  };
1994
2009
  }
1995
- function _n(e) {
2010
+ function Fn(e) {
1996
2011
  const r = e._align;
1997
2012
  this.enter(
1998
2013
  {
@@ -2005,28 +2020,28 @@ function _n(e) {
2005
2020
  e
2006
2021
  ), this.data.inTable = !0;
2007
2022
  }
2008
- function Fn(e) {
2023
+ function jn(e) {
2009
2024
  this.exit(e), this.data.inTable = void 0;
2010
2025
  }
2011
- function jn(e) {
2026
+ function zn(e) {
2012
2027
  this.enter({ type: "tableRow", children: [] }, e);
2013
2028
  }
2014
- function Pe(e) {
2029
+ function Ee(e) {
2015
2030
  this.exit(e);
2016
2031
  }
2017
- function ht(e) {
2032
+ function mt(e) {
2018
2033
  this.enter({ type: "tableCell", children: [] }, e);
2019
2034
  }
2020
- function zn(e) {
2035
+ function $n(e) {
2021
2036
  let r = this.resume();
2022
- this.data.inTable && (r = r.replace(/\\([\\|])/g, $n));
2037
+ this.data.inTable && (r = r.replace(/\\([\\|])/g, On));
2023
2038
  const t = this.stack[this.stack.length - 1];
2024
2039
  t.type, t.value = r, this.exit(e);
2025
2040
  }
2026
- function $n(e, r) {
2041
+ function On(e, r) {
2027
2042
  return r === "|" ? r : e;
2028
2043
  }
2029
- function On(e) {
2044
+ function Un(e) {
2030
2045
  const r = e || {}, t = r.tableCellPadding, a = r.tablePipeAlign, i = r.stringLength, o = t ? " " : "|";
2031
2046
  return {
2032
2047
  unsafe: [
@@ -2055,24 +2070,24 @@ function On(e) {
2055
2070
  tableRow: u
2056
2071
  }
2057
2072
  };
2058
- function n(y, h, x, g) {
2059
- return s(f(y, x, g), y.align);
2073
+ function n(b, h, x, y) {
2074
+ return s(f(b, x, y), b.align);
2060
2075
  }
2061
- function u(y, h, x, g) {
2062
- const b = l(y, x, g), k = s([b]);
2076
+ function u(b, h, x, y) {
2077
+ const g = l(b, x, y), k = s([g]);
2063
2078
  return k.slice(0, k.indexOf(`
2064
2079
  `));
2065
2080
  }
2066
- function c(y, h, x, g) {
2067
- const b = x.enter("tableCell"), k = x.enter("phrasing"), w = x.containerPhrasing(y, {
2068
- ...g,
2081
+ function c(b, h, x, y) {
2082
+ const g = x.enter("tableCell"), k = x.enter("phrasing"), v = x.containerPhrasing(b, {
2083
+ ...y,
2069
2084
  before: o,
2070
2085
  after: o
2071
2086
  });
2072
- return k(), b(), w;
2087
+ return k(), g(), v;
2073
2088
  }
2074
- function s(y, h) {
2075
- return Za(y, {
2089
+ function s(b, h) {
2090
+ return Ja(b, {
2076
2091
  align: h,
2077
2092
  // @ts-expect-error: `markdown-table` types should support `null`.
2078
2093
  alignDelimiters: a,
@@ -2082,47 +2097,47 @@ function On(e) {
2082
2097
  stringLength: i
2083
2098
  });
2084
2099
  }
2085
- function f(y, h, x) {
2086
- const g = y.children;
2087
- let b = -1;
2088
- const k = [], w = h.enter("table");
2089
- for (; ++b < g.length; )
2090
- k[b] = l(g[b], h, x);
2091
- return w(), k;
2100
+ function f(b, h, x) {
2101
+ const y = b.children;
2102
+ let g = -1;
2103
+ const k = [], v = h.enter("table");
2104
+ for (; ++g < y.length; )
2105
+ k[g] = l(y[g], h, x);
2106
+ return v(), k;
2092
2107
  }
2093
- function l(y, h, x) {
2094
- const g = y.children;
2095
- let b = -1;
2096
- const k = [], w = h.enter("tableRow");
2097
- for (; ++b < g.length; )
2098
- k[b] = c(g[b], y, h, x);
2099
- return w(), k;
2108
+ function l(b, h, x) {
2109
+ const y = b.children;
2110
+ let g = -1;
2111
+ const k = [], v = h.enter("tableRow");
2112
+ for (; ++g < y.length; )
2113
+ k[g] = c(y[g], b, h, x);
2114
+ return v(), k;
2100
2115
  }
2101
- function p(y, h, x) {
2102
- let g = Zt.inlineCode(y, h, x);
2103
- return x.stack.includes("tableCell") && (g = g.replace(/\|/g, "\\$&")), g;
2116
+ function p(b, h, x) {
2117
+ let y = Jt.inlineCode(b, h, x);
2118
+ return x.stack.includes("tableCell") && (y = y.replace(/\|/g, "\\$&")), y;
2104
2119
  }
2105
2120
  }
2106
- function Un() {
2121
+ function Wn() {
2107
2122
  return {
2108
2123
  exit: {
2109
- taskListCheckValueChecked: mt,
2110
- taskListCheckValueUnchecked: mt,
2111
- paragraph: Bn
2124
+ taskListCheckValueChecked: pt,
2125
+ taskListCheckValueUnchecked: pt,
2126
+ paragraph: Hn
2112
2127
  }
2113
2128
  };
2114
2129
  }
2115
- function Wn() {
2130
+ function Bn() {
2116
2131
  return {
2117
2132
  unsafe: [{ atBreak: !0, character: "-", after: "[:|-]" }],
2118
- handlers: { listItem: Hn }
2133
+ handlers: { listItem: qn }
2119
2134
  };
2120
2135
  }
2121
- function mt(e) {
2136
+ function pt(e) {
2122
2137
  const r = this.stack[this.stack.length - 2];
2123
2138
  r.type, r.checked = e.type === "taskListCheckValueChecked";
2124
2139
  }
2125
- function Bn(e) {
2140
+ function Hn(e) {
2126
2141
  const r = this.stack[this.stack.length - 2];
2127
2142
  if (r && r.type === "listItem" && typeof r.checked == "boolean") {
2128
2143
  const t = this.stack[this.stack.length - 1];
@@ -2143,10 +2158,10 @@ function Bn(e) {
2143
2158
  }
2144
2159
  this.exit(e);
2145
2160
  }
2146
- function Hn(e, r, t, a) {
2161
+ function qn(e, r, t, a) {
2147
2162
  const i = e.children[0], o = typeof e.checked == "boolean" && i && i.type === "paragraph", n = "[" + (e.checked ? "x" : " ") + "] ", u = t.createTracker(a);
2148
2163
  o && u.move(n);
2149
- let c = Zt.listItem(e, r, t, {
2164
+ let c = Jt.listItem(e, r, t, {
2150
2165
  ...a,
2151
2166
  ...u.current()
2152
2167
  });
@@ -2155,23 +2170,23 @@ function Hn(e, r, t, a) {
2155
2170
  return f + n;
2156
2171
  }
2157
2172
  }
2158
- function qn() {
2173
+ function Vn() {
2159
2174
  return [
2160
- xa(),
2161
- Oa(),
2162
- Ha(),
2163
- En(),
2164
- Un()
2175
+ ka(),
2176
+ Ua(),
2177
+ qa(),
2178
+ _n(),
2179
+ Wn()
2165
2180
  ];
2166
2181
  }
2167
- function Vn(e) {
2182
+ function Xn(e) {
2168
2183
  return {
2169
2184
  extensions: [
2170
- ka(),
2171
- Ua(e),
2172
- qa(),
2173
- On(e),
2174
- Wn()
2185
+ wa(),
2186
+ Wa(e),
2187
+ Va(),
2188
+ Un(e),
2189
+ Bn()
2175
2190
  ]
2176
2191
  };
2177
2192
  }
@@ -2184,24 +2199,24 @@ function be(e, r, t, a) {
2184
2199
  for (t && e.splice(r, t); o < a.length; )
2185
2200
  n = a.slice(o, o + 1e4), n.unshift(r, 0), e.splice(...n), o += 1e4, r += 1e4;
2186
2201
  }
2187
- const pt = {}.hasOwnProperty;
2188
- function Xn(e) {
2202
+ const gt = {}.hasOwnProperty;
2203
+ function Kn(e) {
2189
2204
  const r = {};
2190
2205
  let t = -1;
2191
2206
  for (; ++t < e.length; )
2192
- Kn(r, e[t]);
2207
+ Gn(r, e[t]);
2193
2208
  return r;
2194
2209
  }
2195
- function Kn(e, r) {
2210
+ function Gn(e, r) {
2196
2211
  let t;
2197
2212
  for (t in r) {
2198
- const i = (pt.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
2213
+ const i = (gt.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
2199
2214
  let n;
2200
2215
  if (o)
2201
2216
  for (n in o) {
2202
- pt.call(i, n) || (i[n] = []);
2217
+ gt.call(i, n) || (i[n] = []);
2203
2218
  const u = o[n];
2204
- Gn(
2219
+ Zn(
2205
2220
  // @ts-expect-error Looks like a list.
2206
2221
  i[n],
2207
2222
  Array.isArray(u) ? u : u ? [u] : []
@@ -2209,17 +2224,14 @@ function Kn(e, r) {
2209
2224
  }
2210
2225
  }
2211
2226
  }
2212
- function Gn(e, r) {
2227
+ function Zn(e, r) {
2213
2228
  let t = -1;
2214
2229
  const a = [];
2215
2230
  for (; ++t < r.length; )
2216
2231
  (r[t].add === "after" ? e : a).push(r[t]);
2217
2232
  be(e, 0, 0, a);
2218
2233
  }
2219
- const Zn = {
2220
- tokenize: ri,
2221
- partial: !0
2222
- }, Jt = {
2234
+ const Jn = {
2223
2235
  tokenize: ai,
2224
2236
  partial: !0
2225
2237
  }, Qt = {
@@ -2228,50 +2240,53 @@ const Zn = {
2228
2240
  }, Yt = {
2229
2241
  tokenize: ii,
2230
2242
  partial: !0
2231
- }, Jn = {
2243
+ }, er = {
2232
2244
  tokenize: oi,
2233
2245
  partial: !0
2234
- }, er = {
2235
- name: "wwwAutolink",
2236
- tokenize: ei,
2237
- previous: rr
2246
+ }, Qn = {
2247
+ tokenize: ci,
2248
+ partial: !0
2238
2249
  }, tr = {
2239
- name: "protocolAutolink",
2250
+ name: "wwwAutolink",
2240
2251
  tokenize: ti,
2241
2252
  previous: ar
2242
- }, q = {
2243
- name: "emailAutolink",
2244
- tokenize: Yn,
2253
+ }, rr = {
2254
+ name: "protocolAutolink",
2255
+ tokenize: ri,
2245
2256
  previous: nr
2246
- }, j = {};
2247
- function Qn() {
2257
+ }, V = {
2258
+ name: "emailAutolink",
2259
+ tokenize: ei,
2260
+ previous: ir
2261
+ }, $ = {};
2262
+ function Yn() {
2248
2263
  return {
2249
- text: j
2264
+ text: $
2250
2265
  };
2251
2266
  }
2252
2267
  let X = 48;
2253
2268
  for (; X < 123; )
2254
- j[X] = q, X++, X === 58 ? X = 65 : X === 91 && (X = 97);
2255
- j[43] = q;
2256
- j[45] = q;
2257
- j[46] = q;
2258
- j[95] = q;
2259
- j[72] = [q, tr];
2260
- j[104] = [q, tr];
2261
- j[87] = [q, er];
2262
- j[119] = [q, er];
2263
- function Yn(e, r, t) {
2269
+ $[X] = V, X++, X === 58 ? X = 65 : X === 91 && (X = 97);
2270
+ $[43] = V;
2271
+ $[45] = V;
2272
+ $[46] = V;
2273
+ $[95] = V;
2274
+ $[72] = [V, rr];
2275
+ $[104] = [V, rr];
2276
+ $[87] = [V, tr];
2277
+ $[119] = [V, tr];
2278
+ function ei(e, r, t) {
2264
2279
  const a = this;
2265
2280
  let i, o;
2266
2281
  return n;
2267
2282
  function n(l) {
2268
- return !Oe(l) || !nr.call(a, a.previous) || qe(a.events) ? t(l) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(l));
2283
+ return !Ue(l) || !ir.call(a, a.previous) || Ve(a.events) ? t(l) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(l));
2269
2284
  }
2270
2285
  function u(l) {
2271
- return Oe(l) ? (e.consume(l), u) : l === 64 ? (e.consume(l), c) : t(l);
2286
+ return Ue(l) ? (e.consume(l), u) : l === 64 ? (e.consume(l), c) : t(l);
2272
2287
  }
2273
2288
  function c(l) {
2274
- return l === 46 ? e.check(Jn, f, s)(l) : l === 45 || l === 95 || We(l) ? (o = !0, e.consume(l), c) : f(l);
2289
+ return l === 46 ? e.check(Qn, f, s)(l) : l === 45 || l === 95 || Be(l) ? (o = !0, e.consume(l), c) : f(l);
2275
2290
  }
2276
2291
  function s(l) {
2277
2292
  return e.consume(l), i = !0, c;
@@ -2280,22 +2295,22 @@ function Yn(e, r, t) {
2280
2295
  return o && i && ue(a.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(l)) : t(l);
2281
2296
  }
2282
2297
  }
2283
- function ei(e, r, t) {
2298
+ function ti(e, r, t) {
2284
2299
  const a = this;
2285
2300
  return i;
2286
2301
  function i(n) {
2287
- return n !== 87 && n !== 119 || !rr.call(a, a.previous) || qe(a.events) ? t(n) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(Zn, e.attempt(Jt, e.attempt(Qt, o), t), t)(n));
2302
+ return n !== 87 && n !== 119 || !ar.call(a, a.previous) || Ve(a.events) ? t(n) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(Jn, e.attempt(Qt, e.attempt(Yt, o), t), t)(n));
2288
2303
  }
2289
2304
  function o(n) {
2290
2305
  return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), r(n);
2291
2306
  }
2292
2307
  }
2293
- function ti(e, r, t) {
2308
+ function ri(e, r, t) {
2294
2309
  const a = this;
2295
2310
  let i = "", o = !1;
2296
2311
  return n;
2297
2312
  function n(l) {
2298
- return (l === 72 || l === 104) && ar.call(a, a.previous) && !qe(a.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(l), e.consume(l), u) : t(l);
2313
+ return (l === 72 || l === 104) && nr.call(a, a.previous) && !Ve(a.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(l), e.consume(l), u) : t(l);
2299
2314
  }
2300
2315
  function u(l) {
2301
2316
  if (ue(l) && i.length < 5)
@@ -2311,13 +2326,13 @@ function ti(e, r, t) {
2311
2326
  return l === 47 ? (e.consume(l), o ? s : (o = !0, c)) : t(l);
2312
2327
  }
2313
2328
  function s(l) {
2314
- return l === null || ia(l) || E(l) || K(l) || ke(l) ? t(l) : e.attempt(Jt, e.attempt(Qt, f), t)(l);
2329
+ return l === null || oa(l) || _(l) || K(l) || we(l) ? t(l) : e.attempt(Qt, e.attempt(Yt, f), t)(l);
2315
2330
  }
2316
2331
  function f(l) {
2317
2332
  return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), r(l);
2318
2333
  }
2319
2334
  }
2320
- function ri(e, r, t) {
2335
+ function ai(e, r, t) {
2321
2336
  let a = 0;
2322
2337
  return i;
2323
2338
  function i(n) {
@@ -2327,11 +2342,11 @@ function ri(e, r, t) {
2327
2342
  return n === null ? t(n) : r(n);
2328
2343
  }
2329
2344
  }
2330
- function ai(e, r, t) {
2345
+ function ni(e, r, t) {
2331
2346
  let a, i, o;
2332
2347
  return n;
2333
2348
  function n(s) {
2334
- return s === 46 || s === 95 ? e.check(Yt, c, u)(s) : s === null || E(s) || K(s) || s !== 45 && ke(s) ? c(s) : (o = !0, e.consume(s), n);
2349
+ return s === 46 || s === 95 ? e.check(er, c, u)(s) : s === null || _(s) || K(s) || s !== 45 && we(s) ? c(s) : (o = !0, e.consume(s), n);
2335
2350
  }
2336
2351
  function u(s) {
2337
2352
  return s === 95 ? a = !0 : (i = a, a = void 0), e.consume(s), n;
@@ -2340,27 +2355,27 @@ function ai(e, r, t) {
2340
2355
  return i || a || !o ? t(s) : r(s);
2341
2356
  }
2342
2357
  }
2343
- function ni(e, r) {
2358
+ function ii(e, r) {
2344
2359
  let t = 0, a = 0;
2345
2360
  return i;
2346
2361
  function i(n) {
2347
- 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(Yt, r, o)(n) : n === null || E(n) || K(n) ? r(n) : (e.consume(n), i);
2362
+ 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(er, r, o)(n) : n === null || _(n) || K(n) ? r(n) : (e.consume(n), i);
2348
2363
  }
2349
2364
  function o(n) {
2350
2365
  return n === 41 && a++, e.consume(n), i;
2351
2366
  }
2352
2367
  }
2353
- function ii(e, r, t) {
2368
+ function oi(e, r, t) {
2354
2369
  return a;
2355
2370
  function a(u) {
2356
2371
  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) : (
2357
2372
  // `<` is an end.
2358
2373
  u === 60 || // So is whitespace.
2359
- u === null || E(u) || K(u) ? r(u) : t(u)
2374
+ u === null || _(u) || K(u) ? r(u) : t(u)
2360
2375
  );
2361
2376
  }
2362
2377
  function i(u) {
2363
- return u === null || u === 40 || u === 91 || E(u) || K(u) ? r(u) : a(u);
2378
+ return u === null || u === 40 || u === 91 || _(u) || K(u) ? r(u) : a(u);
2364
2379
  }
2365
2380
  function o(u) {
2366
2381
  return ue(u) ? n(u) : t(u);
@@ -2369,28 +2384,28 @@ function ii(e, r, t) {
2369
2384
  return u === 59 ? (e.consume(u), a) : ue(u) ? (e.consume(u), n) : t(u);
2370
2385
  }
2371
2386
  }
2372
- function oi(e, r, t) {
2387
+ function ci(e, r, t) {
2373
2388
  return a;
2374
2389
  function a(o) {
2375
2390
  return e.consume(o), i;
2376
2391
  }
2377
2392
  function i(o) {
2378
- return We(o) ? t(o) : r(o);
2393
+ return Be(o) ? t(o) : r(o);
2379
2394
  }
2380
2395
  }
2381
- function rr(e) {
2382
- return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || E(e);
2383
- }
2384
2396
  function ar(e) {
2385
- return !ue(e);
2397
+ return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || _(e);
2386
2398
  }
2387
2399
  function nr(e) {
2388
- return !(e === 47 || Oe(e));
2400
+ return !ue(e);
2389
2401
  }
2390
- function Oe(e) {
2391
- return e === 43 || e === 45 || e === 46 || e === 95 || We(e);
2402
+ function ir(e) {
2403
+ return !(e === 47 || Ue(e));
2392
2404
  }
2393
- function qe(e) {
2405
+ function Ue(e) {
2406
+ return e === 43 || e === 45 || e === 46 || e === 95 || Be(e);
2407
+ }
2408
+ function Ve(e) {
2394
2409
  let r = e.length, t = !1;
2395
2410
  for (; r--; ) {
2396
2411
  const a = e[r][1];
@@ -2405,7 +2420,7 @@ function qe(e) {
2405
2420
  }
2406
2421
  return e.length > 0 && !t && (e[e.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), t;
2407
2422
  }
2408
- function ci(e, r, t) {
2423
+ function ui(e, r, t) {
2409
2424
  const a = [];
2410
2425
  let i = -1;
2411
2426
  for (; ++i < e.length; ) {
@@ -2414,61 +2429,61 @@ function ci(e, r, t) {
2414
2429
  }
2415
2430
  return r;
2416
2431
  }
2417
- function B(e, r, t, a) {
2432
+ function H(e, r, t, a) {
2418
2433
  const i = a ? a - 1 : Number.POSITIVE_INFINITY;
2419
2434
  let o = 0;
2420
2435
  return n;
2421
2436
  function n(c) {
2422
- return W(c) ? (e.enter(t), u(c)) : r(c);
2437
+ return B(c) ? (e.enter(t), u(c)) : r(c);
2423
2438
  }
2424
2439
  function u(c) {
2425
- return W(c) && o++ < i ? (e.consume(c), u) : (e.exit(t), r(c));
2440
+ return B(c) && o++ < i ? (e.consume(c), u) : (e.exit(t), r(c));
2426
2441
  }
2427
2442
  }
2428
- const ui = {
2443
+ const si = {
2429
2444
  partial: !0,
2430
- tokenize: si
2445
+ tokenize: li
2431
2446
  };
2432
- function si(e, r, t) {
2447
+ function li(e, r, t) {
2433
2448
  return a;
2434
2449
  function a(o) {
2435
- return W(o) ? B(e, i, "linePrefix")(o) : i(o);
2450
+ return B(o) ? H(e, i, "linePrefix")(o) : i(o);
2436
2451
  }
2437
2452
  function i(o) {
2438
2453
  return o === null || Y(o) ? r(o) : t(o);
2439
2454
  }
2440
2455
  }
2441
- const li = {
2442
- tokenize: yi,
2456
+ const di = {
2457
+ tokenize: xi,
2443
2458
  partial: !0
2444
2459
  };
2445
- function di() {
2460
+ function fi() {
2446
2461
  return {
2447
2462
  document: {
2448
2463
  91: {
2449
2464
  name: "gfmFootnoteDefinition",
2450
- tokenize: pi,
2465
+ tokenize: gi,
2451
2466
  continuation: {
2452
- tokenize: gi
2467
+ tokenize: bi
2453
2468
  },
2454
- exit: bi
2469
+ exit: yi
2455
2470
  }
2456
2471
  },
2457
2472
  text: {
2458
2473
  91: {
2459
2474
  name: "gfmFootnoteCall",
2460
- tokenize: mi
2475
+ tokenize: pi
2461
2476
  },
2462
2477
  93: {
2463
2478
  name: "gfmPotentialFootnoteCall",
2464
2479
  add: "after",
2465
- tokenize: fi,
2466
- resolveTo: hi
2480
+ tokenize: hi,
2481
+ resolveTo: mi
2467
2482
  }
2468
2483
  }
2469
2484
  };
2470
2485
  }
2471
- function fi(e, r, t) {
2486
+ function hi(e, r, t) {
2472
2487
  const a = this;
2473
2488
  let i = a.events.length;
2474
2489
  const o = a.parser.gfmFootnotes || (a.parser.gfmFootnotes = []);
@@ -2493,7 +2508,7 @@ function fi(e, r, t) {
2493
2508
  return s.codePointAt(0) !== 94 || !o.includes(s.slice(1)) ? t(c) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), r(c));
2494
2509
  }
2495
2510
  }
2496
- function hi(e, r) {
2511
+ function mi(e, r) {
2497
2512
  let t = e.length;
2498
2513
  for (; t--; )
2499
2514
  if (e[t][1].type === "labelImage" && e[t][0] === "enter") {
@@ -2543,7 +2558,7 @@ function hi(e, r) {
2543
2558
  ];
2544
2559
  return e.splice(t, e.length - t + 1, ...u), e;
2545
2560
  }
2546
- function mi(e, r, t) {
2561
+ function pi(e, r, t) {
2547
2562
  const a = this, i = a.parser.gfmFootnotes || (a.parser.gfmFootnotes = []);
2548
2563
  let o = 0, n;
2549
2564
  return u;
@@ -2559,7 +2574,7 @@ function mi(e, r, t) {
2559
2574
  o > 999 || // Closing brace with nothing.
2560
2575
  l === 93 && !n || // Space or tab is not supported by GFM for some reason.
2561
2576
  // `\n` and `[` not being supported makes sense.
2562
- l === null || l === 91 || E(l)
2577
+ l === null || l === 91 || _(l)
2563
2578
  )
2564
2579
  return t(l);
2565
2580
  if (l === 93) {
@@ -2567,13 +2582,13 @@ function mi(e, r, t) {
2567
2582
  const p = e.exit("gfmFootnoteCallString");
2568
2583
  return i.includes(le(a.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(l);
2569
2584
  }
2570
- return E(l) || (n = !0), o++, e.consume(l), l === 92 ? f : s;
2585
+ return _(l) || (n = !0), o++, e.consume(l), l === 92 ? f : s;
2571
2586
  }
2572
2587
  function f(l) {
2573
2588
  return l === 91 || l === 92 || l === 93 ? (e.consume(l), o++, s) : s(l);
2574
2589
  }
2575
2590
  }
2576
- function pi(e, r, t) {
2591
+ function gi(e, r, t) {
2577
2592
  const a = this, i = a.parser.gfmFootnotes || (a.parser.gfmFootnotes = []);
2578
2593
  let o, n = 0, u;
2579
2594
  return c;
@@ -2589,7 +2604,7 @@ function pi(e, r, t) {
2589
2604
  n > 999 || // Closing brace with nothing.
2590
2605
  h === 93 && !u || // Space or tab is not supported by GFM for some reason.
2591
2606
  // `\n` and `[` not being supported makes sense.
2592
- h === null || h === 91 || E(h)
2607
+ h === null || h === 91 || _(h)
2593
2608
  )
2594
2609
  return t(h);
2595
2610
  if (h === 93) {
@@ -2597,33 +2612,33 @@ function pi(e, r, t) {
2597
2612
  const x = e.exit("gfmFootnoteDefinitionLabelString");
2598
2613
  return o = le(a.sliceSerialize(x)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
2599
2614
  }
2600
- return E(h) || (u = !0), n++, e.consume(h), h === 92 ? l : f;
2615
+ return _(h) || (u = !0), n++, e.consume(h), h === 92 ? l : f;
2601
2616
  }
2602
2617
  function l(h) {
2603
2618
  return h === 91 || h === 92 || h === 93 ? (e.consume(h), n++, f) : f(h);
2604
2619
  }
2605
2620
  function p(h) {
2606
- return h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), i.includes(o) || i.push(o), B(e, y, "gfmFootnoteDefinitionWhitespace")) : t(h);
2621
+ return h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), i.includes(o) || i.push(o), H(e, b, "gfmFootnoteDefinitionWhitespace")) : t(h);
2607
2622
  }
2608
- function y(h) {
2623
+ function b(h) {
2609
2624
  return r(h);
2610
2625
  }
2611
2626
  }
2612
- function gi(e, r, t) {
2613
- return e.check(ui, r, e.attempt(li, r, t));
2627
+ function bi(e, r, t) {
2628
+ return e.check(si, r, e.attempt(di, r, t));
2614
2629
  }
2615
- function bi(e) {
2630
+ function yi(e) {
2616
2631
  e.exit("gfmFootnoteDefinition");
2617
2632
  }
2618
- function yi(e, r, t) {
2633
+ function xi(e, r, t) {
2619
2634
  const a = this;
2620
- return B(e, i, "gfmFootnoteDefinitionIndent", 5);
2635
+ return H(e, i, "gfmFootnoteDefinitionIndent", 5);
2621
2636
  function i(o) {
2622
2637
  const n = a.events[a.events.length - 1];
2623
2638
  return n && n[1].type === "gfmFootnoteDefinitionIndent" && n[2].sliceSerialize(n[1], !0).length === 4 ? r(o) : t(o);
2624
2639
  }
2625
2640
  }
2626
- function xi(e) {
2641
+ function ki(e) {
2627
2642
  let t = (e || {}).singleTilde;
2628
2643
  const a = {
2629
2644
  name: "strikethrough",
@@ -2658,8 +2673,8 @@ function xi(e) {
2658
2673
  type: "strikethroughText",
2659
2674
  start: Object.assign({}, n[s][1].end),
2660
2675
  end: Object.assign({}, n[c][1].start)
2661
- }, p = [["enter", f, u], ["enter", n[s][1], u], ["exit", n[s][1], u], ["enter", l, u]], y = u.parser.constructs.insideSpan.null;
2662
- y && be(p, p.length, 0, ci(y, n.slice(s + 1, c), u)), be(p, p.length, 0, [["exit", l, u], ["enter", n[c][1], u], ["exit", n[c][1], u], ["exit", f, u]]), be(n, s - 1, c - s + 3, p), c = s + p.length - 2;
2676
+ }, p = [["enter", f, u], ["enter", n[s][1], u], ["exit", n[s][1], u], ["enter", l, u]], b = u.parser.constructs.insideSpan.null;
2677
+ b && be(p, p.length, 0, ui(b, n.slice(s + 1, c), u)), be(p, p.length, 0, [["exit", l, u], ["enter", n[c][1], u], ["exit", n[c][1], u], ["exit", f, u]]), be(n, s - 1, c - s + 3, p), c = s + p.length - 2;
2663
2678
  break;
2664
2679
  }
2665
2680
  }
@@ -2672,19 +2687,19 @@ function xi(e) {
2672
2687
  let l = 0;
2673
2688
  return p;
2674
2689
  function p(h) {
2675
- return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? c(h) : (n.enter("strikethroughSequenceTemporary"), y(h));
2690
+ return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? c(h) : (n.enter("strikethroughSequenceTemporary"), b(h));
2676
2691
  }
2677
- function y(h) {
2678
- const x = ye(s);
2692
+ function b(h) {
2693
+ const x = xe(s);
2679
2694
  if (h === 126)
2680
- return l > 1 ? c(h) : (n.consume(h), l++, y);
2695
+ return l > 1 ? c(h) : (n.consume(h), l++, b);
2681
2696
  if (l < 2 && !t) return c(h);
2682
- const g = n.exit("strikethroughSequenceTemporary"), b = ye(h);
2683
- return g._open = !b || b === 2 && !!x, g._close = !x || x === 2 && !!b, u(h);
2697
+ const y = n.exit("strikethroughSequenceTemporary"), g = xe(h);
2698
+ return y._open = !g || g === 2 && !!x, y._close = !x || x === 2 && !!g, u(h);
2684
2699
  }
2685
2700
  }
2686
2701
  }
2687
- class ki {
2702
+ class wi {
2688
2703
  /**
2689
2704
  * Create a new edit map.
2690
2705
  */
@@ -2700,7 +2715,7 @@ class ki {
2700
2715
  * @returns {undefined}
2701
2716
  */
2702
2717
  add(r, t, a) {
2703
- wi(this, r, t, a);
2718
+ vi(this, r, t, a);
2704
2719
  }
2705
2720
  // To do: add this when moving to `micromark`.
2706
2721
  // /**
@@ -2739,7 +2754,7 @@ class ki {
2739
2754
  this.map.length = 0;
2740
2755
  }
2741
2756
  }
2742
- function wi(e, r, t, a) {
2757
+ function vi(e, r, t, a) {
2743
2758
  let i = 0;
2744
2759
  if (!(t === 0 && a.length === 0)) {
2745
2760
  for (; i < e.map.length; ) {
@@ -2752,7 +2767,7 @@ function wi(e, r, t, a) {
2752
2767
  e.map.push([r, t, a]);
2753
2768
  }
2754
2769
  }
2755
- function vi(e, r) {
2770
+ function Ci(e, r) {
2756
2771
  let t = !1;
2757
2772
  const a = [];
2758
2773
  for (; r < e.length; ) {
@@ -2772,31 +2787,31 @@ function vi(e, r) {
2772
2787
  }
2773
2788
  return a;
2774
2789
  }
2775
- function Ci() {
2790
+ function Ti() {
2776
2791
  return {
2777
2792
  flow: {
2778
2793
  null: {
2779
2794
  name: "table",
2780
- tokenize: Ti,
2781
- resolveAll: Ai
2795
+ tokenize: Ai,
2796
+ resolveAll: Ni
2782
2797
  }
2783
2798
  }
2784
2799
  };
2785
2800
  }
2786
- function Ti(e, r, t) {
2801
+ function Ai(e, r, t) {
2787
2802
  const a = this;
2788
2803
  let i = 0, o = 0, n;
2789
2804
  return u;
2790
2805
  function u(m) {
2791
- let V = a.events.length - 1;
2792
- for (; V > -1; ) {
2793
- const O = a.events[V][1].type;
2794
- if (O === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
2795
- O === "linePrefix") V--;
2806
+ let j = a.events.length - 1;
2807
+ for (; j > -1; ) {
2808
+ const U = a.events[j][1].type;
2809
+ if (U === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
2810
+ U === "linePrefix") j--;
2796
2811
  else break;
2797
2812
  }
2798
- const $ = V > -1 ? a.events[V][1].type : null, G = $ === "tableHead" || $ === "tableRow" ? T : c;
2799
- return G === T && a.parser.lazy[a.now().line] ? t(m) : G(m);
2813
+ const O = j > -1 ? a.events[j][1].type : null, G = O === "tableHead" || O === "tableRow" ? A : c;
2814
+ return G === A && a.parser.lazy[a.now().line] ? t(m) : G(m);
2800
2815
  }
2801
2816
  function c(m) {
2802
2817
  return e.enter("tableHead"), e.enter("tableRow"), s(m);
@@ -2805,60 +2820,60 @@ function Ti(e, r, t) {
2805
2820
  return m === 124 || (n = !0, o += 1), f(m);
2806
2821
  }
2807
2822
  function f(m) {
2808
- return m === null ? t(m) : Y(m) ? o > 1 ? (o = 0, a.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), y) : t(m) : W(m) ? B(e, f, "whitespace")(m) : (o += 1, n && (n = !1, i += 1), m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), n = !0, f) : (e.enter("data"), l(m)));
2823
+ return m === null ? t(m) : Y(m) ? o > 1 ? (o = 0, a.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), b) : t(m) : B(m) ? H(e, f, "whitespace")(m) : (o += 1, n && (n = !1, i += 1), m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), n = !0, f) : (e.enter("data"), l(m)));
2809
2824
  }
2810
2825
  function l(m) {
2811
- return m === null || m === 124 || E(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : l);
2826
+ return m === null || m === 124 || _(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : l);
2812
2827
  }
2813
2828
  function p(m) {
2814
2829
  return m === 92 || m === 124 ? (e.consume(m), l) : l(m);
2815
2830
  }
2816
- function y(m) {
2817
- return a.interrupt = !1, a.parser.lazy[a.now().line] ? t(m) : (e.enter("tableDelimiterRow"), n = !1, W(m) ? B(e, h, "linePrefix", a.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : h(m));
2831
+ function b(m) {
2832
+ return a.interrupt = !1, a.parser.lazy[a.now().line] ? t(m) : (e.enter("tableDelimiterRow"), n = !1, B(m) ? H(e, h, "linePrefix", a.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : h(m));
2818
2833
  }
2819
2834
  function h(m) {
2820
- return m === 45 || m === 58 ? g(m) : m === 124 ? (n = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), x) : I(m);
2835
+ return m === 45 || m === 58 ? y(m) : m === 124 ? (n = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), x) : N(m);
2821
2836
  }
2822
2837
  function x(m) {
2823
- return W(m) ? B(e, g, "whitespace")(m) : g(m);
2838
+ return B(m) ? H(e, y, "whitespace")(m) : y(m);
2824
2839
  }
2825
- function g(m) {
2826
- return m === 58 ? (o += 1, n = !0, e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), b) : m === 45 ? (o += 1, b(m)) : m === null || Y(m) ? A(m) : I(m);
2840
+ function y(m) {
2841
+ return m === 58 ? (o += 1, n = !0, e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), g) : m === 45 ? (o += 1, g(m)) : m === null || Y(m) ? M(m) : N(m);
2827
2842
  }
2828
- function b(m) {
2829
- return m === 45 ? (e.enter("tableDelimiterFiller"), k(m)) : I(m);
2843
+ function g(m) {
2844
+ return m === 45 ? (e.enter("tableDelimiterFiller"), k(m)) : N(m);
2830
2845
  }
2831
2846
  function k(m) {
2832
- return m === 45 ? (e.consume(m), k) : m === 58 ? (n = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), w) : (e.exit("tableDelimiterFiller"), w(m));
2847
+ return m === 45 ? (e.consume(m), k) : m === 58 ? (n = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), v) : (e.exit("tableDelimiterFiller"), v(m));
2833
2848
  }
2834
- function w(m) {
2835
- return W(m) ? B(e, A, "whitespace")(m) : A(m);
2849
+ function v(m) {
2850
+ return B(m) ? H(e, M, "whitespace")(m) : M(m);
2836
2851
  }
2837
- function A(m) {
2838
- return m === 124 ? h(m) : m === null || Y(m) ? !n || i !== o ? I(m) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(m)) : I(m);
2852
+ function M(m) {
2853
+ return m === 124 ? h(m) : m === null || Y(m) ? !n || i !== o ? N(m) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(m)) : N(m);
2839
2854
  }
2840
- function I(m) {
2855
+ function N(m) {
2841
2856
  return t(m);
2842
2857
  }
2843
- function T(m) {
2844
- return e.enter("tableRow"), S(m);
2858
+ function A(m) {
2859
+ return e.enter("tableRow"), w(m);
2845
2860
  }
2846
- function S(m) {
2847
- return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), S) : m === null || Y(m) ? (e.exit("tableRow"), r(m)) : W(m) ? B(e, S, "whitespace")(m) : (e.enter("data"), L(m));
2861
+ function w(m) {
2862
+ return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), w) : m === null || Y(m) ? (e.exit("tableRow"), r(m)) : B(m) ? H(e, w, "whitespace")(m) : (e.enter("data"), I(m));
2848
2863
  }
2849
- function L(m) {
2850
- return m === null || m === 124 || E(m) ? (e.exit("data"), S(m)) : (e.consume(m), m === 92 ? z : L);
2864
+ function I(m) {
2865
+ return m === null || m === 124 || _(m) ? (e.exit("data"), w(m)) : (e.consume(m), m === 92 ? P : I);
2851
2866
  }
2852
- function z(m) {
2853
- return m === 92 || m === 124 ? (e.consume(m), L) : L(m);
2867
+ function P(m) {
2868
+ return m === 92 || m === 124 ? (e.consume(m), I) : I(m);
2854
2869
  }
2855
2870
  }
2856
- function Ai(e, r) {
2871
+ function Ni(e, r) {
2857
2872
  let t = -1, a = !0, i = 0, o = [0, 0, 0, 0], n = [0, 0, 0, 0], u = !1, c = 0, s, f, l;
2858
- const p = new ki();
2873
+ const p = new wi();
2859
2874
  for (; ++t < e.length; ) {
2860
- const y = e[t], h = y[1];
2861
- y[0] === "enter" ? h.type === "tableHead" ? (u = !1, c !== 0 && (gt(p, r, c, s, f), f = void 0, c = 0), s = {
2875
+ const b = e[t], h = b[1];
2876
+ b[0] === "enter" ? h.type === "tableHead" ? (u = !1, c !== 0 && (bt(p, r, c, s, f), f = void 0, c = 0), s = {
2862
2877
  type: "table",
2863
2878
  start: Object.assign({}, h.start),
2864
2879
  // Note: correct end is set later.
@@ -2870,9 +2885,9 @@ function Ai(e, r) {
2870
2885
  end: Object.assign({}, h.end)
2871
2886
  }, p.add(t, 0, [["enter", f, r]])), i = h.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") ? (a = !1, n[2] === 0 && (o[1] !== 0 && (n[0] = n[1], l = ge(p, r, o, i, void 0, l), o = [0, 0, 0, 0]), n[2] = t)) : h.type === "tableCellDivider" && (a ? a = !1 : (o[1] !== 0 && (n[0] = n[1], l = ge(p, r, o, i, void 0, l)), o = n, n = [o[1], t, 0, 0])) : h.type === "tableHead" ? (u = !0, c = t) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (c = t, o[1] !== 0 ? (n[0] = n[1], l = ge(p, r, o, i, t, l)) : n[1] !== 0 && (l = ge(p, r, n, i, t, l)), i = 0) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") && (n[3] = t);
2872
2887
  }
2873
- for (c !== 0 && gt(p, r, c, s, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
2874
- const y = r.events[t];
2875
- y[0] === "enter" && y[1].type === "table" && (y[1]._align = vi(r.events, t));
2888
+ for (c !== 0 && bt(p, r, c, s, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
2889
+ const b = r.events[t];
2890
+ b[0] === "enter" && b[1].type === "table" && (b[1]._align = Ci(r.events, t));
2876
2891
  }
2877
2892
  return e;
2878
2893
  }
@@ -2892,8 +2907,8 @@ function ge(e, r, t, a, i, o) {
2892
2907
  end: Object.assign({}, f)
2893
2908
  };
2894
2909
  if (e.add(t[2], 0, [["enter", l, r]]), a !== 2) {
2895
- const p = r.events[t[2]], y = r.events[t[3]];
2896
- if (p[1].end = Object.assign({}, y[1].end), p[1].type = "chunkText", p[1].contentType = "text", t[3] > t[2] + 1) {
2910
+ const p = r.events[t[2]], b = r.events[t[3]];
2911
+ if (p[1].end = Object.assign({}, b[1].end), p[1].type = "chunkText", p[1].contentType = "text", t[3] > t[2] + 1) {
2897
2912
  const h = t[2] + 1, x = t[3] - t[2] - 1;
2898
2913
  e.add(h, x, []);
2899
2914
  }
@@ -2902,7 +2917,7 @@ function ge(e, r, t, a, i, o) {
2902
2917
  }
2903
2918
  return i !== void 0 && (o.end = Object.assign({}, Q(r.events, i)), e.add(i, 0, [["exit", o, r]]), o = void 0), o;
2904
2919
  }
2905
- function gt(e, r, t, a, i) {
2920
+ function bt(e, r, t, a, i) {
2906
2921
  const o = [], n = Q(r.events, t);
2907
2922
  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);
2908
2923
  }
@@ -2910,18 +2925,18 @@ function Q(e, r) {
2910
2925
  const t = e[r], a = t[0] === "enter" ? "start" : "end";
2911
2926
  return t[1][a];
2912
2927
  }
2913
- const Ni = {
2928
+ const Ii = {
2914
2929
  name: "tasklistCheck",
2915
- tokenize: Si
2930
+ tokenize: Mi
2916
2931
  };
2917
- function Ii() {
2932
+ function Si() {
2918
2933
  return {
2919
2934
  text: {
2920
- 91: Ni
2935
+ 91: Ii
2921
2936
  }
2922
2937
  };
2923
2938
  }
2924
- function Si(e, r, t) {
2939
+ function Mi(e, r, t) {
2925
2940
  const a = this;
2926
2941
  return i;
2927
2942
  function i(c) {
@@ -2933,56 +2948,56 @@ function Si(e, r, t) {
2933
2948
  );
2934
2949
  }
2935
2950
  function o(c) {
2936
- return E(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);
2951
+ return _(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);
2937
2952
  }
2938
2953
  function n(c) {
2939
2954
  return c === 93 ? (e.enter("taskListCheckMarker"), e.consume(c), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(c);
2940
2955
  }
2941
2956
  function u(c) {
2942
- return Y(c) ? r(c) : W(c) ? e.check({
2957
+ return Y(c) ? r(c) : B(c) ? e.check({
2943
2958
  tokenize: Li
2944
2959
  }, r, t)(c) : t(c);
2945
2960
  }
2946
2961
  }
2947
2962
  function Li(e, r, t) {
2948
- return B(e, a, "whitespace");
2963
+ return H(e, a, "whitespace");
2949
2964
  function a(i) {
2950
2965
  return i === null ? t(i) : r(i);
2951
2966
  }
2952
2967
  }
2953
- function Mi(e) {
2954
- return Xn([
2955
- Qn(),
2956
- di(),
2957
- xi(e),
2958
- Ci(),
2959
- Ii()
2968
+ function Di(e) {
2969
+ return Kn([
2970
+ Yn(),
2971
+ fi(),
2972
+ ki(e),
2973
+ Ti(),
2974
+ Si()
2960
2975
  ]);
2961
2976
  }
2962
- const Di = {};
2963
- function Ri(e) {
2977
+ const Ri = {};
2978
+ function Pi(e) {
2964
2979
  const r = (
2965
2980
  /** @type {Processor<Root>} */
2966
2981
  this
2967
- ), t = e || Di, a = r.data(), i = a.micromarkExtensions || (a.micromarkExtensions = []), o = a.fromMarkdownExtensions || (a.fromMarkdownExtensions = []), n = a.toMarkdownExtensions || (a.toMarkdownExtensions = []);
2968
- i.push(Mi(t)), o.push(qn()), n.push(Vn(t));
2982
+ ), t = e || Ri, a = r.data(), i = a.micromarkExtensions || (a.micromarkExtensions = []), o = a.fromMarkdownExtensions || (a.fromMarkdownExtensions = []), n = a.toMarkdownExtensions || (a.toMarkdownExtensions = []);
2983
+ i.push(Di(t)), o.push(Vn()), n.push(Xn(t));
2969
2984
  }
2970
- function M(...e) {
2985
+ function L(...e) {
2971
2986
  return e.filter(Boolean).join(" ");
2972
2987
  }
2973
- const Pi = ({ content: e }) => /* @__PURE__ */ d(
2974
- Ar,
2988
+ const Ei = ({ content: e }) => /* @__PURE__ */ d(
2989
+ Nr,
2975
2990
  {
2976
- remarkPlugins: [Ri],
2991
+ remarkPlugins: [Pi],
2977
2992
  className: "cuadra-aui-md",
2978
- components: Fi,
2993
+ components: ji,
2979
2994
  children: e
2980
2995
  }
2981
- ), ir = pr(Pi), Ei = ({ language: e, code: r }) => {
2982
- const { isCopied: t, copyToClipboard: a } = _i();
2983
- return /* @__PURE__ */ v("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: [
2996
+ ), or = gr(Ei), _i = ({ language: e, code: r }) => {
2997
+ const { isCopied: t, copyToClipboard: a } = Fi();
2998
+ return /* @__PURE__ */ C("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: [
2984
2999
  /* @__PURE__ */ d("span", { className: "cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand", children: e }),
2985
- /* @__PURE__ */ v(
3000
+ /* @__PURE__ */ C(
2986
3001
  "button",
2987
3002
  {
2988
3003
  onClick: () => {
@@ -2991,33 +3006,33 @@ const Pi = ({ content: e }) => /* @__PURE__ */ d(
2991
3006
  className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-muted cuadra-transition-colors",
2992
3007
  "aria-label": "Copy code",
2993
3008
  children: [
2994
- !t && /* @__PURE__ */ d(Or, { className: "cuadra-h-4 cuadra-w-4" }),
2995
- t && /* @__PURE__ */ d(_r, { className: "cuadra-h-4 cuadra-w-4" })
3009
+ !t && /* @__PURE__ */ d(Ur, { className: "cuadra-h-4 cuadra-w-4" }),
3010
+ t && /* @__PURE__ */ d(Fr, { className: "cuadra-h-4 cuadra-w-4" })
2996
3011
  ]
2997
3012
  }
2998
3013
  )
2999
3014
  ] });
3000
- }, _i = ({
3015
+ }, Fi = ({
3001
3016
  copiedDuration: e = 3e3
3002
3017
  } = {}) => {
3003
- const [r, t] = N(!1);
3018
+ const [r, t] = S(!1);
3004
3019
  return { isCopied: r, copyToClipboard: (i) => {
3005
3020
  i && navigator.clipboard.writeText(i).then(() => {
3006
3021
  t(!0), setTimeout(() => t(!1), e);
3007
3022
  });
3008
3023
  } };
3009
- }, Fi = Cr({
3024
+ }, ji = Tr({
3010
3025
  h1: ({ className: e, ...r }) => /* @__PURE__ */ d(
3011
3026
  "h1",
3012
3027
  {
3013
- className: M("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
3028
+ className: L("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
3014
3029
  ...r
3015
3030
  }
3016
3031
  ),
3017
3032
  h2: ({ className: e, ...r }) => /* @__PURE__ */ d(
3018
3033
  "h2",
3019
3034
  {
3020
- className: M(
3035
+ className: L(
3021
3036
  "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",
3022
3037
  e
3023
3038
  ),
@@ -3027,7 +3042,7 @@ const Pi = ({ content: e }) => /* @__PURE__ */ d(
3027
3042
  h3: ({ className: e, ...r }) => /* @__PURE__ */ d(
3028
3043
  "h3",
3029
3044
  {
3030
- className: M(
3045
+ className: L(
3031
3046
  "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",
3032
3047
  e
3033
3048
  ),
@@ -3037,38 +3052,38 @@ const Pi = ({ content: e }) => /* @__PURE__ */ d(
3037
3052
  h4: ({ className: e, ...r }) => /* @__PURE__ */ d(
3038
3053
  "h4",
3039
3054
  {
3040
- className: M(
3055
+ className: L(
3041
3056
  "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",
3042
3057
  e
3043
3058
  ),
3044
3059
  ...r
3045
3060
  }
3046
3061
  ),
3047
- h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className: M("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3048
- h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className: M("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
3049
- p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className: M("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3062
+ h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className: L("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3063
+ h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className: L("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
3064
+ p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className: L("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
3050
3065
  a: ({ className: e, ...r }) => /* @__PURE__ */ d(
3051
3066
  "a",
3052
3067
  {
3053
- className: M("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
3068
+ className: L("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
3054
3069
  ...r
3055
3070
  }
3056
3071
  ),
3057
- blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className: M("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
3058
- ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className: M("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3059
- ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className: M("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3060
- hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className: M("cuadra-my-5 cuadra-border-b", e), ...r }),
3072
+ blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className: L("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
3073
+ ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className: L("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3074
+ ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className: L("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
3075
+ hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className: L("cuadra-my-5 cuadra-border-b", e), ...r }),
3061
3076
  table: ({ className: e, ...r }) => /* @__PURE__ */ d(
3062
3077
  "table",
3063
3078
  {
3064
- className: M("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
3079
+ className: L("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
3065
3080
  ...r
3066
3081
  }
3067
3082
  ),
3068
3083
  th: ({ className: e, ...r }) => /* @__PURE__ */ d(
3069
3084
  "th",
3070
3085
  {
3071
- className: M(
3086
+ className: L(
3072
3087
  "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",
3073
3088
  e
3074
3089
  ),
@@ -3078,7 +3093,7 @@ const Pi = ({ content: e }) => /* @__PURE__ */ d(
3078
3093
  td: ({ className: e, ...r }) => /* @__PURE__ */ d(
3079
3094
  "td",
3080
3095
  {
3081
- className: M(
3096
+ className: L(
3082
3097
  "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",
3083
3098
  e
3084
3099
  ),
@@ -3088,18 +3103,18 @@ const Pi = ({ content: e }) => /* @__PURE__ */ d(
3088
3103
  tr: ({ className: e, ...r }) => /* @__PURE__ */ d(
3089
3104
  "tr",
3090
3105
  {
3091
- className: M(
3106
+ className: L(
3092
3107
  "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",
3093
3108
  e
3094
3109
  ),
3095
3110
  ...r
3096
3111
  }
3097
3112
  ),
3098
- sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className: M("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
3113
+ sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className: L("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
3099
3114
  pre: ({ className: e, ...r }) => /* @__PURE__ */ d(
3100
3115
  "pre",
3101
3116
  {
3102
- className: M(
3117
+ className: L(
3103
3118
  "cuadra-overflow-x-auto cuadra-rounded-b-lg !cuadra-rounded-t-none cuadra-bg-muted cuadra-p-4 cuadra-text-foreground font-brand",
3104
3119
  e
3105
3120
  ),
@@ -3107,40 +3122,40 @@ const Pi = ({ content: e }) => /* @__PURE__ */ d(
3107
3122
  }
3108
3123
  ),
3109
3124
  code: function({ className: r, ...t }) {
3110
- const a = Tr();
3125
+ const a = Ar();
3111
3126
  return /* @__PURE__ */ d(
3112
3127
  "code",
3113
3128
  {
3114
- className: M(!a && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
3129
+ className: L(!a && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
3115
3130
  ...t
3116
3131
  }
3117
3132
  );
3118
3133
  },
3119
- CodeHeader: Ei
3120
- }), bt = [
3134
+ CodeHeader: _i
3135
+ }), yt = [
3121
3136
  "Sending question…",
3122
3137
  "Understanding your need…",
3123
3138
  "Scanning data…",
3124
3139
  "Comparing results…",
3125
3140
  "Composing answer…"
3126
3141
  ];
3127
- function ji({ active: e }) {
3128
- const [r, t] = N(0);
3129
- return P(() => {
3142
+ function zi({ active: e }) {
3143
+ const [r, t] = S(0);
3144
+ return E(() => {
3130
3145
  if (!e) {
3131
3146
  t(0);
3132
3147
  return;
3133
3148
  }
3134
3149
  const a = window.setInterval(() => {
3135
- t((i) => i >= bt.length - 1 ? (window.clearInterval(a), i) : i + 1);
3150
+ t((i) => i >= yt.length - 1 ? (window.clearInterval(a), i) : i + 1);
3136
3151
  }, 2500);
3137
3152
  return () => window.clearInterval(a);
3138
- }, [e]), e ? /* @__PURE__ */ v("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-font-brand", children: [
3153
+ }, [e]), e ? /* @__PURE__ */ C("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-font-brand", children: [
3139
3154
  "Thinking… ",
3140
- bt[r]
3155
+ yt[r]
3141
3156
  ] }) : null;
3142
3157
  }
3143
- function yt({
3158
+ function xt({
3144
3159
  welcomeTitle: e = "Hi, how can I help you today?",
3145
3160
  welcomeSubtitle: r = "Start exploring our platform and discover what you can build.",
3146
3161
  extraTopPadding: t,
@@ -3148,33 +3163,33 @@ function yt({
3148
3163
  inputPlaceholder: i = "Type your message...",
3149
3164
  enableAttachments: o = !1
3150
3165
  } = {}) {
3151
- const n = xr(), [u, c] = N(!1), [s, f] = N(null), [l, p] = N(!1);
3152
- return P(() => {
3166
+ const n = kr(), [u, c] = S(!1), [s, f] = S(null), [l, p] = S(!1);
3167
+ return E(() => {
3153
3168
  if (!n) {
3154
3169
  c(!1);
3155
3170
  return;
3156
3171
  }
3157
3172
  try {
3158
- const y = n?.store;
3159
- if (!y) {
3173
+ const b = n?.store;
3174
+ if (!b) {
3160
3175
  c(!1);
3161
3176
  return;
3162
3177
  }
3163
- const h = y.subscribe?.((g) => {
3164
- const b = g?.threadId, k = g?.messages || [], w = g?.isLoadingHistory || !1, A = k.length;
3165
- b && b !== s && f(b), c(w && A === 0);
3166
- const T = k.some(
3167
- (S) => S.role === "assistant" && !!S.content && (Array.isArray(S.content) ? S.content.some((L) => typeof L == "object" && L?.text ? L.text.trim().length > 0 : !1) : typeof S.content == "string" ? S.content.trim().length > 0 : !1)
3178
+ const h = b.subscribe?.((y) => {
3179
+ const g = y?.threadId, k = y?.messages || [], v = y?.isLoadingHistory || !1, M = k.length;
3180
+ g && g !== s && f(g), c(v && M === 0);
3181
+ const A = k.some(
3182
+ (w) => w.role === "assistant" && !!w.content && (Array.isArray(w.content) ? w.content.some((I) => typeof I == "object" && I?.text ? I.text.trim().length > 0 : !1) : typeof w.content == "string" ? w.content.trim().length > 0 : !1)
3168
3183
  );
3169
- p(T);
3170
- }), x = y.getState?.();
3184
+ p(A);
3185
+ }), x = b.getState?.();
3171
3186
  if (x) {
3172
- const g = x?.threadId, b = x?.messages || [], k = x?.isLoadingHistory || !1, w = b.length;
3173
- g && g !== s && f(g), c(k && w === 0);
3174
- const I = b.some(
3175
- (T) => T.role === "assistant" && !!T.content && (Array.isArray(T.content) ? T.content.some((S) => typeof S == "object" && S?.text ? S.text.trim().length > 0 : !1) : typeof T.content == "string" ? T.content.trim().length > 0 : !1)
3187
+ const y = x?.threadId, g = x?.messages || [], k = x?.isLoadingHistory || !1, v = g.length;
3188
+ y && y !== s && f(y), c(k && v === 0);
3189
+ const N = g.some(
3190
+ (A) => A.role === "assistant" && !!A.content && (Array.isArray(A.content) ? A.content.some((w) => typeof w == "object" && w?.text ? w.text.trim().length > 0 : !1) : typeof A.content == "string" ? A.content.trim().length > 0 : !1)
3176
3191
  );
3177
- p(I);
3192
+ p(N);
3178
3193
  }
3179
3194
  return () => {
3180
3195
  h && h();
@@ -3182,18 +3197,18 @@ function yt({
3182
3197
  } catch {
3183
3198
  c(!1);
3184
3199
  }
3185
- }, [n, s]), /* @__PURE__ */ v(ne.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
3200
+ }, [n, s]), /* @__PURE__ */ C(ne.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
3186
3201
  /* @__PURE__ */ d(
3187
3202
  ne.Viewport,
3188
3203
  {
3189
3204
  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",
3190
3205
  style: t ? { paddingTop: t } : void 0,
3191
- children: u ? /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
3192
- /* @__PURE__ */ d(It, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
3206
+ children: u ? /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ C("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
3207
+ /* @__PURE__ */ d(St, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
3193
3208
  /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-muted-foreground font-brand", children: "Loading messages..." })
3194
- ] }) }) : /* @__PURE__ */ v(H, { children: [
3209
+ ] }) }) : /* @__PURE__ */ C(q, { children: [
3195
3210
  /* @__PURE__ */ d(ne.Empty, { children: /* @__PURE__ */ d(
3196
- zi,
3211
+ $i,
3197
3212
  {
3198
3213
  title: e,
3199
3214
  subtitle: r,
@@ -3204,31 +3219,31 @@ function yt({
3204
3219
  ne.Messages,
3205
3220
  {
3206
3221
  components: {
3207
- UserMessage: $i,
3208
- AssistantMessage: Oi
3222
+ UserMessage: Oi,
3223
+ AssistantMessage: Ui
3209
3224
  }
3210
3225
  }
3211
3226
  ),
3212
- /* @__PURE__ */ d(ne.If, { running: !0, children: !l && /* @__PURE__ */ d("div", { className: "cuadra-mt-2 cuadra-max-w-2xl", children: /* @__PURE__ */ d(ji, { active: !0 }) }) })
3227
+ /* @__PURE__ */ d(ne.If, { running: !0, children: !l && /* @__PURE__ */ d("div", { className: "cuadra-mt-2 cuadra-max-w-2xl", children: /* @__PURE__ */ d(zi, { active: !0 }) }) })
3213
3228
  ] })
3214
3229
  }
3215
3230
  ),
3216
- /* @__PURE__ */ v("div", { className: "cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4", children: [
3231
+ /* @__PURE__ */ C("div", { className: "cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4", children: [
3217
3232
  o && /* @__PURE__ */ d(
3218
3233
  ie.Attachments,
3219
3234
  {
3220
3235
  components: {
3221
3236
  Attachment: () => {
3222
- const y = At(({ attachment: h }) => h);
3223
- return y ? /* @__PURE__ */ v("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: [
3224
- /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground font-brand", children: y.name || "Attachment" }),
3225
- /* @__PURE__ */ d(kr.Remove, { asChild: !0, children: /* @__PURE__ */ d(
3237
+ const b = Nt(({ attachment: h }) => h);
3238
+ return b ? /* @__PURE__ */ C("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: [
3239
+ /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground font-brand", children: b.name || "Attachment" }),
3240
+ /* @__PURE__ */ d(wr.Remove, { asChild: !0, children: /* @__PURE__ */ d(
3226
3241
  "button",
3227
3242
  {
3228
3243
  type: "button",
3229
3244
  className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-size-4 cuadra-rounded hover:cuadra-bg-background cuadra-transition-colors",
3230
3245
  "aria-label": "Remove attachment",
3231
- children: /* @__PURE__ */ d(Ue, { className: "cuadra-h-3 cuadra-w-3 cuadra-text-muted-foreground" })
3246
+ children: /* @__PURE__ */ d(We, { className: "cuadra-h-3 cuadra-w-3 cuadra-text-muted-foreground" })
3232
3247
  }
3233
3248
  ) })
3234
3249
  ] }) : null;
@@ -3236,7 +3251,7 @@ function yt({
3236
3251
  }
3237
3252
  }
3238
3253
  ),
3239
- /* @__PURE__ */ v(ie.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
3254
+ /* @__PURE__ */ C(ie.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
3240
3255
  /* @__PURE__ */ d(
3241
3256
  ie.Input,
3242
3257
  {
@@ -3272,7 +3287,7 @@ function yt({
3272
3287
  right: "3rem"
3273
3288
  },
3274
3289
  "aria-label": "Attach file",
3275
- children: /* @__PURE__ */ d(St, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground", strokeWidth: 1.5 })
3290
+ children: /* @__PURE__ */ d(Mt, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground", strokeWidth: 1.5 })
3276
3291
  }
3277
3292
  )
3278
3293
  }
@@ -3290,22 +3305,22 @@ function yt({
3290
3305
  },
3291
3306
  "aria-label": "Send message",
3292
3307
  type: "button",
3293
- children: /* @__PURE__ */ d(Pr, { className: "cuadra-h-4 cuadra-w-4" })
3308
+ children: /* @__PURE__ */ d(Er, { className: "cuadra-h-4 cuadra-w-4" })
3294
3309
  }
3295
3310
  ) })
3296
3311
  ] })
3297
3312
  ] })
3298
3313
  ] });
3299
3314
  }
3300
- function zi({ title: e, subtitle: r, suggestions: t }) {
3301
- const a = wr(), i = async (o) => {
3315
+ function $i({ title: e, subtitle: r, suggestions: t }) {
3316
+ const a = vr(), i = async (o) => {
3302
3317
  try {
3303
3318
  a.composer().setText(o), await new Promise((n) => setTimeout(n, 10)), a.composer().send();
3304
3319
  } catch {
3305
3320
  }
3306
3321
  };
3307
- 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__ */ v("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: [
3308
- /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8", children: [
3322
+ 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__ */ C("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: [
3323
+ /* @__PURE__ */ C("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8", children: [
3309
3324
  /* @__PURE__ */ d("h2", { className: "cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand", children: e }),
3310
3325
  /* @__PURE__ */ d("p", { className: "cuadra-text-muted-foreground font-brand", children: r })
3311
3326
  ] }),
@@ -3322,14 +3337,14 @@ function zi({ title: e, subtitle: r, suggestions: t }) {
3322
3337
  )) })
3323
3338
  ] }) });
3324
3339
  }
3325
- function $i() {
3326
- return /* @__PURE__ */ v(oe.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: [
3340
+ function Oi() {
3341
+ return /* @__PURE__ */ C(oe.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: [
3327
3342
  /* @__PURE__ */ d(
3328
3343
  oe.Attachments,
3329
3344
  {
3330
3345
  components: {
3331
3346
  Attachment: () => {
3332
- const e = At(({ attachment: o }) => o);
3347
+ const e = Nt(({ attachment: o }) => o);
3333
3348
  if (!e) return null;
3334
3349
  const r = e.type === "image", t = e.file, a = e.content?.find((o) => o.type === "image"), i = t ? URL.createObjectURL(t) : a?.image;
3335
3350
  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(
@@ -3340,8 +3355,8 @@ function $i() {
3340
3355
  className: "cuadra-rounded-lg cuadra-border cuadra-border-border cuadra-max-h-64 cuadra-max-w-full cuadra-object-contain",
3341
3356
  style: { borderWidth: "1px" }
3342
3357
  }
3343
- ) : /* @__PURE__ */ v("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: [
3344
- /* @__PURE__ */ d(St, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3358
+ ) : /* @__PURE__ */ C("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: [
3359
+ /* @__PURE__ */ d(Mt, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3345
3360
  /* @__PURE__ */ d("span", { className: "cuadra-text-sm cuadra-text-foreground font-brand", children: e.name || "Attachment" })
3346
3361
  ] }) });
3347
3362
  }
@@ -3368,7 +3383,7 @@ function $i() {
3368
3383
  oe.Parts,
3369
3384
  {
3370
3385
  components: {
3371
- Text: ({ text: e }) => /* @__PURE__ */ d(ir, { content: e || "" })
3386
+ Text: ({ text: e }) => /* @__PURE__ */ d(or, { content: e || "" })
3372
3387
  }
3373
3388
  }
3374
3389
  )
@@ -3376,7 +3391,7 @@ function $i() {
3376
3391
  )
3377
3392
  ] });
3378
3393
  }
3379
- function Oi() {
3394
+ function Ui() {
3380
3395
  return /* @__PURE__ */ d(oe.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__ */ d(
3381
3396
  "div",
3382
3397
  {
@@ -3390,14 +3405,14 @@ function Oi() {
3390
3405
  oe.Parts,
3391
3406
  {
3392
3407
  components: {
3393
- Text: ({ text: e }) => /* @__PURE__ */ d(ir, { content: e || "" })
3408
+ Text: ({ text: e }) => /* @__PURE__ */ d(or, { content: e || "" })
3394
3409
  }
3395
3410
  }
3396
3411
  )
3397
3412
  }
3398
3413
  ) });
3399
3414
  }
3400
- const or = ({ className: e = "", theme: r = "system" }) => {
3415
+ const cr = ({ className: e = "", theme: r = "system" }) => {
3401
3416
  const t = () => {
3402
3417
  if (typeof window > "u") return "light";
3403
3418
  if (r === "system") {
@@ -3405,10 +3420,10 @@ const or = ({ className: e = "", theme: r = "system" }) => {
3405
3420
  return n || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
3406
3421
  }
3407
3422
  return r;
3408
- }, [a, i] = N(t);
3409
- return P(() => {
3423
+ }, [a, i] = S(t);
3424
+ return E(() => {
3410
3425
  r !== "system" && i(r);
3411
- }, [r]), P(() => {
3426
+ }, [r]), E(() => {
3412
3427
  const n = document.documentElement;
3413
3428
  n.classList.remove("light", "dark"), n.classList.add(a), r === "system" && localStorage.setItem("theme", a);
3414
3429
  }, [a, r]), /* @__PURE__ */ d(
@@ -3422,7 +3437,7 @@ const or = ({ className: e = "", theme: r = "system" }) => {
3422
3437
  disabled: r !== "system",
3423
3438
  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}`,
3424
3439
  children: /* @__PURE__ */ d(
3425
- zr,
3440
+ $r,
3426
3441
  {
3427
3442
  className: `cuadra-h-4 cuadra-w-4 cuadra-transition-colors ${a === "dark" ? "cuadra-text-primary" : "cuadra-text-gray-400"}`
3428
3443
  }
@@ -3430,23 +3445,23 @@ const or = ({ className: e = "", theme: r = "system" }) => {
3430
3445
  }
3431
3446
  );
3432
3447
  };
3433
- function Ui({ onThreadSelect: e }) {
3434
- const r = vt(), t = vr((g) => g.threadId), [a, i] = N(null), o = r?.id === t, n = a === r?.id, [u, c] = N(!1), [s, f] = N(r?.title || ""), [l, p] = N(!1), [y, h] = N(!1), x = async () => {
3448
+ function Wi({ onThreadSelect: e }) {
3449
+ const r = Ct(), t = Cr((y) => y.threadId), [a, i] = S(null), o = r?.id === t, n = a === r?.id, [u, c] = S(!1), [s, f] = S(r?.title || ""), [l, p] = S(!1), [b, h] = S(!1), x = async () => {
3435
3450
  if (!r?.remoteId || !s || s === r.title) {
3436
3451
  c(!1);
3437
3452
  return;
3438
3453
  }
3439
3454
  try {
3440
3455
  h(!0);
3441
- const g = window.__cuadraThreadListAdapter;
3442
- g && typeof g.rename == "function" && await g.rename(r.remoteId, s), c(!1), p(!1);
3456
+ const y = window.__cuadraThreadListAdapter;
3457
+ y && typeof y.rename == "function" && await y.rename(r.remoteId, s), c(!1), p(!1);
3443
3458
  } catch {
3444
3459
  c(!1), p(!1);
3445
3460
  } finally {
3446
3461
  h(!1);
3447
3462
  }
3448
3463
  };
3449
- return P(() => {
3464
+ return E(() => {
3450
3465
  r?.title && !u && f(r.title);
3451
3466
  }, [r?.title, u]), r ? /* @__PURE__ */ d(
3452
3467
  Le.Root,
@@ -3455,7 +3470,7 @@ function Ui({ onThreadSelect: e }) {
3455
3470
  style: { marginBottom: "0.5rem" },
3456
3471
  onMouseEnter: () => i(r.id),
3457
3472
  onMouseLeave: () => i(null),
3458
- children: /* @__PURE__ */ v(
3473
+ children: /* @__PURE__ */ C(
3459
3474
  Le.Trigger,
3460
3475
  {
3461
3476
  className: "cuadra-p-3 cuadra-flex-1 cuadra-flex cuadra-items-center cuadra-justify-between cuadra-w-full cuadra-min-w-0 cuadra-cursor-pointer",
@@ -3466,31 +3481,31 @@ function Ui({ onThreadSelect: e }) {
3466
3481
  {
3467
3482
  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",
3468
3483
  value: s,
3469
- onChange: (g) => f(g.target.value),
3470
- onKeyDown: (g) => {
3471
- g.key === "Enter" && x(), g.key === "Escape" && (c(!1), f(r.title || ""));
3484
+ onChange: (y) => f(y.target.value),
3485
+ onKeyDown: (y) => {
3486
+ y.key === "Enter" && x(), y.key === "Escape" && (c(!1), f(r.title || ""));
3472
3487
  },
3473
- disabled: y,
3488
+ disabled: b,
3474
3489
  autoFocus: !0,
3475
- onClick: (g) => g.stopPropagation()
3490
+ onClick: (y) => y.stopPropagation()
3476
3491
  }
3477
- ) : /* @__PURE__ */ v(H, { children: [
3492
+ ) : /* @__PURE__ */ C(q, { children: [
3478
3493
  /* @__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" }),
3479
3494
  r.updatedAt && /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand", children: new Date(r.updatedAt).toLocaleDateString() })
3480
3495
  ] }) }),
3481
- /* @__PURE__ */ d("div", { className: "cuadra-ml-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center", children: (n || o || l) && /* @__PURE__ */ v("div", { className: "cuadra-relative", children: [
3496
+ /* @__PURE__ */ d("div", { className: "cuadra-ml-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center", children: (n || o || l) && /* @__PURE__ */ C("div", { className: "cuadra-relative", children: [
3482
3497
  /* @__PURE__ */ d(
3483
3498
  "button",
3484
3499
  {
3485
3500
  className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-background/50 cuadra-transition-colors",
3486
- onClick: (g) => {
3487
- g.stopPropagation(), p(!l);
3501
+ onClick: (y) => {
3502
+ y.stopPropagation(), p(!l);
3488
3503
  },
3489
3504
  "aria-label": "Thread options",
3490
- children: /* @__PURE__ */ d(Wr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3505
+ children: /* @__PURE__ */ d(Br, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3491
3506
  }
3492
3507
  ),
3493
- l && /* @__PURE__ */ v(H, { children: [
3508
+ l && /* @__PURE__ */ C(q, { children: [
3494
3509
  /* @__PURE__ */ d(
3495
3510
  "div",
3496
3511
  {
@@ -3502,19 +3517,19 @@ function Ui({ onThreadSelect: e }) {
3502
3517
  "button",
3503
3518
  {
3504
3519
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",
3505
- onClick: (g) => {
3506
- g.stopPropagation(), x();
3520
+ onClick: (y) => {
3521
+ y.stopPropagation(), x();
3507
3522
  },
3508
- disabled: y,
3523
+ disabled: b,
3509
3524
  children: "Save"
3510
3525
  }
3511
- ) : /* @__PURE__ */ v(H, { children: [
3526
+ ) : /* @__PURE__ */ C(q, { children: [
3512
3527
  /* @__PURE__ */ d(
3513
3528
  "button",
3514
3529
  {
3515
3530
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",
3516
- onClick: (g) => {
3517
- g.stopPropagation(), c(!0), f(r.title || ""), p(!1);
3531
+ onClick: (y) => {
3532
+ y.stopPropagation(), c(!0), f(r.title || ""), p(!1);
3518
3533
  },
3519
3534
  children: "Rename"
3520
3535
  }
@@ -3524,8 +3539,8 @@ function Ui({ onThreadSelect: e }) {
3524
3539
  "button",
3525
3540
  {
3526
3541
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left cuadra-text-destructive hover:cuadra-bg-muted cuadra-transition-colors font-brand",
3527
- onClick: (g) => {
3528
- g.stopPropagation(), p(!1);
3542
+ onClick: (y) => {
3543
+ y.stopPropagation(), p(!1);
3529
3544
  },
3530
3545
  children: "Delete"
3531
3546
  }
@@ -3539,13 +3554,13 @@ function Ui({ onThreadSelect: e }) {
3539
3554
  }
3540
3555
  ) : null;
3541
3556
  }
3542
- function xt({
3557
+ function kt({
3543
3558
  onThreadSelect: e,
3544
3559
  showThemeToggle: r,
3545
3560
  theme: t,
3546
3561
  onLogout: a
3547
3562
  }) {
3548
- return /* @__PURE__ */ v(Se.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: [
3563
+ return /* @__PURE__ */ C(Me.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: [
3549
3564
  /* @__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(
3550
3565
  "button",
3551
3566
  {
@@ -3553,32 +3568,32 @@ function xt({
3553
3568
  onClick: e,
3554
3569
  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",
3555
3570
  "aria-label": "Close",
3556
- children: /* @__PURE__ */ d(Ue, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3571
+ children: /* @__PURE__ */ d(We, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3557
3572
  }
3558
3573
  ) }),
3559
- /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin", children: [
3574
+ /* @__PURE__ */ C("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin", children: [
3560
3575
  /* @__PURE__ */ d(
3561
- Se.New,
3576
+ Me.New,
3562
3577
  {
3563
3578
  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",
3564
3579
  onClick: () => e?.(),
3565
- children: /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-min-w-0", children: /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3566
- /* @__PURE__ */ d(Zr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3580
+ children: /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-min-w-0", children: /* @__PURE__ */ C("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3581
+ /* @__PURE__ */ d(Jr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3567
3582
  /* @__PURE__ */ d("h4", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand", children: "New Chat" })
3568
3583
  ] }) })
3569
3584
  }
3570
3585
  ),
3571
3586
  /* @__PURE__ */ d("div", { className: "cuadra-my-2 cuadra-border-t cuadra-border-border" }),
3572
3587
  /* @__PURE__ */ d(
3573
- Se.Items,
3588
+ Me.Items,
3574
3589
  {
3575
3590
  components: {
3576
- ThreadListItem: (i) => /* @__PURE__ */ d(Ui, { ...i, onThreadSelect: e })
3591
+ ThreadListItem: (i) => /* @__PURE__ */ d(Wi, { ...i, onThreadSelect: e })
3577
3592
  }
3578
3593
  }
3579
3594
  )
3580
3595
  ] }),
3581
- (r || a) && /* @__PURE__ */ v("div", { className: "cuadra-border-t cuadra-border-border cuadra-flex md:cuadra-hidden cuadra-items-center cuadra-justify-between cuadra-px-4 cuadra-py-4", children: [
3596
+ (r || a) && /* @__PURE__ */ C("div", { className: "cuadra-border-t cuadra-border-border cuadra-flex md:cuadra-hidden cuadra-items-center cuadra-justify-between cuadra-px-4 cuadra-py-4", children: [
3582
3597
  a && /* @__PURE__ */ d(
3583
3598
  "button",
3584
3599
  {
@@ -3586,18 +3601,18 @@ function xt({
3586
3601
  onClick: a,
3587
3602
  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",
3588
3603
  "aria-label": "Logout",
3589
- children: /* @__PURE__ */ d(qr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3604
+ children: /* @__PURE__ */ d(Vr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3590
3605
  }
3591
3606
  ),
3592
- r && /* @__PURE__ */ d(or, { theme: t })
3607
+ r && /* @__PURE__ */ d(cr, { theme: t })
3593
3608
  ] })
3594
3609
  ] });
3595
3610
  }
3596
- const Wi = `
3611
+ const Bi = `
3597
3612
  @keyframes rotate {
3598
3613
  100% { transform: rotate(1turn); }
3599
3614
  }
3600
- `, Ee = ({
3615
+ `, _e = ({
3601
3616
  children: e,
3602
3617
  className: r = "",
3603
3618
  paddingX: t = "px-0",
@@ -3606,9 +3621,9 @@ const Wi = `
3606
3621
  style: o,
3607
3622
  contentStyle: n,
3608
3623
  rotating: u = !1
3609
- }) => /* @__PURE__ */ v(H, { children: [
3610
- /* @__PURE__ */ d("style", { children: Wi }),
3611
- /* @__PURE__ */ v(
3624
+ }) => /* @__PURE__ */ C(q, { children: [
3625
+ /* @__PURE__ */ d("style", { children: Bi }),
3626
+ /* @__PURE__ */ C(
3612
3627
  "div",
3613
3628
  {
3614
3629
  className: `cuadra-relative cuadra-bg-background md:cuadra-rounded-xl cuadra-overflow-hidden ${r}`,
@@ -3652,7 +3667,7 @@ const Wi = `
3652
3667
  ]
3653
3668
  }
3654
3669
  )
3655
- ] }), kt = ({
3670
+ ] }), wt = ({
3656
3671
  currentModel: e,
3657
3672
  models: r,
3658
3673
  modelsLoading: t,
@@ -3664,20 +3679,20 @@ const Wi = `
3664
3679
  onMobileMenuClick: c,
3665
3680
  showMobileMenuButton: s = !1
3666
3681
  }) => {
3667
- const [f, l] = N(!1), [p, y] = N(!1), h = je(null);
3668
- P(() => {
3669
- const b = (k) => {
3682
+ const [f, l] = S(!1), [p, b] = S(!1), h = ze(null);
3683
+ E(() => {
3684
+ const g = (k) => {
3670
3685
  h.current && !h.current.contains(k.target) && l(!1);
3671
3686
  };
3672
- return f && document.addEventListener("mousedown", b), () => {
3673
- document.removeEventListener("mousedown", b);
3687
+ return f && document.addEventListener("mousedown", g), () => {
3688
+ document.removeEventListener("mousedown", g);
3674
3689
  };
3675
3690
  }, [f]);
3676
- const x = r.find((b) => b.id === e), g = (b) => {
3677
- i(b), l(!1), y(!1);
3691
+ const x = r.find((g) => g.id === e), y = (g) => {
3692
+ i(g), l(!1), b(!1);
3678
3693
  };
3679
- return /* @__PURE__ */ v("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: [
3680
- /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3694
+ return /* @__PURE__ */ C("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: [
3695
+ /* @__PURE__ */ C("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3681
3696
  s && /* @__PURE__ */ d(
3682
3697
  "button",
3683
3698
  {
@@ -3685,16 +3700,16 @@ const Wi = `
3685
3700
  onClick: c,
3686
3701
  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",
3687
3702
  "aria-label": "Toggle thread list",
3688
- children: /* @__PURE__ */ d(Xr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3703
+ children: /* @__PURE__ */ d(Kr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3689
3704
  }
3690
3705
  ),
3691
- n && /* @__PURE__ */ d("div", { className: "cuadra-hidden md:cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(or, { theme: u }) })
3706
+ n && /* @__PURE__ */ d("div", { className: "cuadra-hidden md:cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(cr, { theme: u }) })
3692
3707
  ] }),
3693
- /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
3708
+ /* @__PURE__ */ C("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
3694
3709
  !o && /* @__PURE__ */ d("label", { className: "cuadra-hidden md:cuadra-inline cuadra-text-sm cuadra-text-muted-foreground cuadra-font-brand", children: "Model" }),
3695
- 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__ */ v(H, { children: [
3696
- /* @__PURE__ */ v("div", { ref: h, className: "cuadra-hidden md:cuadra-block cuadra-relative cuadra-w-48", children: [
3697
- /* @__PURE__ */ v(
3710
+ 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__ */ C(q, { children: [
3711
+ /* @__PURE__ */ C("div", { ref: h, className: "cuadra-hidden md:cuadra-block cuadra-relative cuadra-w-48", children: [
3712
+ /* @__PURE__ */ C(
3698
3713
  "button",
3699
3714
  {
3700
3715
  type: "button",
@@ -3703,18 +3718,18 @@ const Wi = `
3703
3718
  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",
3704
3719
  children: [
3705
3720
  /* @__PURE__ */ d("span", { className: x ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: x?.name || "Select model" }),
3706
- /* @__PURE__ */ d(ot, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3721
+ /* @__PURE__ */ d(ct, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3707
3722
  ]
3708
3723
  }
3709
3724
  ),
3710
- f && r.length > 0 && /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md", children: /* @__PURE__ */ d("div", { className: "cuadra-p-1", children: r.map((b) => /* @__PURE__ */ v(
3725
+ f && r.length > 0 && /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md", children: /* @__PURE__ */ d("div", { className: "cuadra-p-1", children: r.map((g) => /* @__PURE__ */ C(
3711
3726
  "button",
3712
3727
  {
3713
3728
  type: "button",
3714
- onClick: () => g(b.id),
3715
- className: `cuadra-relative cuadra-flex cuadra-w-full cuadra-cursor-pointer cuadra-select-none cuadra-items-center cuadra-rounded-sm cuadra-py-1.5 cuadra-pl-8 cuadra-pr-2 cuadra-text-sm cuadra-outline-none focus:cuadra-bg-secondary focus:cuadra-text-secondary-foreground font-brand cuadra-transition-colors ${e === b.id ? "cuadra-bg-secondary cuadra-text-secondary-foreground" : "hover:cuadra-bg-secondary/50"}`,
3729
+ onClick: () => y(g.id),
3730
+ className: `cuadra-relative cuadra-flex cuadra-w-full cuadra-cursor-pointer cuadra-select-none cuadra-items-center cuadra-rounded-sm cuadra-py-1.5 cuadra-pl-8 cuadra-pr-2 cuadra-text-sm cuadra-outline-none focus:cuadra-bg-secondary focus:cuadra-text-secondary-foreground font-brand cuadra-transition-colors ${e === g.id ? "cuadra-bg-secondary cuadra-text-secondary-foreground" : "hover:cuadra-bg-secondary/50"}`,
3716
3731
  children: [
3717
- e === b.id && /* @__PURE__ */ d("span", { className: "cuadra-absolute cuadra-left-2 cuadra-flex cuadra-h-3.5 cuadra-w-3.5 cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ d(
3732
+ e === g.id && /* @__PURE__ */ d("span", { className: "cuadra-absolute cuadra-left-2 cuadra-flex cuadra-h-3.5 cuadra-w-3.5 cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ d(
3718
3733
  "svg",
3719
3734
  {
3720
3735
  xmlns: "http://www.w3.org/2000/svg",
@@ -3733,57 +3748,57 @@ const Wi = `
3733
3748
  )
3734
3749
  }
3735
3750
  ) }),
3736
- /* @__PURE__ */ d("span", { children: b.name })
3751
+ /* @__PURE__ */ d("span", { children: g.name })
3737
3752
  ]
3738
3753
  },
3739
- b.id
3754
+ g.id
3740
3755
  )) }) })
3741
3756
  ] }),
3742
- /* @__PURE__ */ v(
3757
+ /* @__PURE__ */ C(
3743
3758
  "button",
3744
3759
  {
3745
3760
  type: "button",
3746
- onClick: () => y(!0),
3761
+ onClick: () => b(!0),
3747
3762
  disabled: t || r.length === 0 || !!a,
3748
3763
  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",
3749
3764
  children: [
3750
3765
  /* @__PURE__ */ d("span", { className: x ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: x?.name || "Select model" }),
3751
- /* @__PURE__ */ d(ot, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3766
+ /* @__PURE__ */ d(ct, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3752
3767
  ]
3753
3768
  }
3754
3769
  ),
3755
- p && typeof document < "u" && ze(
3756
- /* @__PURE__ */ v(H, { children: [
3770
+ p && typeof document < "u" && $e(
3771
+ /* @__PURE__ */ C(q, { children: [
3757
3772
  /* @__PURE__ */ d(
3758
3773
  "div",
3759
3774
  {
3760
3775
  className: "cuadra-fixed cuadra-inset-0 cuadra-bg-black/50 cuadra-z-50 md:cuadra-hidden",
3761
- onClick: () => y(!1)
3776
+ onClick: () => b(!1)
3762
3777
  }
3763
3778
  ),
3764
- /* @__PURE__ */ v("div", { className: "cuadra-fixed cuadra-inset-0 cuadra-z-50 cuadra-flex cuadra-flex-col cuadra-bg-background md:cuadra-hidden", children: [
3765
- /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-between cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-4", children: [
3779
+ /* @__PURE__ */ C("div", { className: "cuadra-fixed cuadra-inset-0 cuadra-z-50 cuadra-flex cuadra-flex-col cuadra-bg-background md:cuadra-hidden", children: [
3780
+ /* @__PURE__ */ C("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-between cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-4", children: [
3766
3781
  /* @__PURE__ */ d("h2", { className: "cuadra-text-lg cuadra-font-normal cuadra-text-foreground font-brand", children: "Select Model" }),
3767
3782
  /* @__PURE__ */ d(
3768
3783
  "button",
3769
3784
  {
3770
3785
  type: "button",
3771
- onClick: () => y(!1),
3786
+ onClick: () => b(!1),
3772
3787
  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",
3773
3788
  "aria-label": "Close",
3774
- children: /* @__PURE__ */ d(Ue, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3789
+ children: /* @__PURE__ */ d(We, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3775
3790
  }
3776
3791
  )
3777
3792
  ] }),
3778
- /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-4", children: t ? /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading models..." }) }) : a ? /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8", children: /* @__PURE__ */ d("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : r.length === 0 ? /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "No models available" }) }) : /* @__PURE__ */ d("div", { className: "cuadra-space-y-2", children: r.map((b) => /* @__PURE__ */ v(
3793
+ /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-4", children: t ? /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading models..." }) }) : a ? /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8", children: /* @__PURE__ */ d("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : r.length === 0 ? /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-py-8", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "No models available" }) }) : /* @__PURE__ */ d("div", { className: "cuadra-space-y-2", children: r.map((g) => /* @__PURE__ */ C(
3779
3794
  "button",
3780
3795
  {
3781
3796
  type: "button",
3782
- onClick: () => g(b.id),
3783
- className: `cuadra-w-full cuadra-flex cuadra-items-center cuadra-justify-between cuadra-rounded-lg cuadra-border cuadra-px-4 cuadra-py-4 cuadra-text-left cuadra-transition-colors font-brand cuadra-bg-background cuadra-text-foreground cuadra-border-border hover:cuadra-bg-muted ${e === b.id ? "cuadra-border-primary" : ""}`,
3797
+ onClick: () => y(g.id),
3798
+ className: `cuadra-w-full cuadra-flex cuadra-items-center cuadra-justify-between cuadra-rounded-lg cuadra-border cuadra-px-4 cuadra-py-4 cuadra-text-left cuadra-transition-colors font-brand cuadra-bg-background cuadra-text-foreground cuadra-border-border hover:cuadra-bg-muted ${e === g.id ? "cuadra-border-primary" : ""}`,
3784
3799
  children: [
3785
- /* @__PURE__ */ d("span", { className: "cuadra-text-base cuadra-font-normal", children: b.name }),
3786
- e === b.id && /* @__PURE__ */ d(
3800
+ /* @__PURE__ */ d("span", { className: "cuadra-text-base cuadra-font-normal", children: g.name }),
3801
+ e === g.id && /* @__PURE__ */ d(
3787
3802
  "svg",
3788
3803
  {
3789
3804
  xmlns: "http://www.w3.org/2000/svg",
@@ -3805,7 +3820,7 @@ const Wi = `
3805
3820
  )
3806
3821
  ]
3807
3822
  },
3808
- b.id
3823
+ g.id
3809
3824
  )) }) })
3810
3825
  ] })
3811
3826
  ] }),
@@ -3814,9 +3829,9 @@ const Wi = `
3814
3829
  ] })
3815
3830
  ] })
3816
3831
  ] });
3817
- }, Bi = gr(void 0), _e = ({ children: e, value: r }) => /* @__PURE__ */ d(Bi.Provider, { value: r, children: e });
3818
- function Hi() {
3819
- P(() => {
3832
+ }, Hi = br(void 0), Fe = ({ children: e, value: r }) => /* @__PURE__ */ d(Hi.Provider, { value: r, children: e });
3833
+ function qi() {
3834
+ E(() => {
3820
3835
  if (document.querySelector("style[data-cuadra-uikit]"))
3821
3836
  return;
3822
3837
  const r = document.createElement("div");
@@ -3838,8 +3853,8 @@ function Hi() {
3838
3853
  }, document.head.appendChild(a), o) break;
3839
3854
  }, []);
3840
3855
  }
3841
- const qi = ({ config: e }) => {
3842
- Hi();
3856
+ const Vi = ({ config: e }) => {
3857
+ qi();
3843
3858
  const {
3844
3859
  baseUrl: r,
3845
3860
  proxyUrl: t,
@@ -3853,83 +3868,83 @@ const qi = ({ config: e }) => {
3853
3868
  initialThreadId: f,
3854
3869
  welcomeTitle: l,
3855
3870
  welcomeSubtitle: p,
3856
- extraTopPadding: y,
3871
+ extraTopPadding: b,
3857
3872
  suggestions: h,
3858
3873
  inputPlaceholder: x,
3859
- showThemeToggle: g = !0,
3860
- theme: b = "system",
3874
+ showThemeToggle: y = !0,
3875
+ theme: g = "system",
3861
3876
  onError: k,
3862
- onChatCreated: w,
3863
- onUserMessage: A,
3864
- onThreadIdUpdate: I,
3865
- onLogout: T,
3866
- enableAttachments: S = !1
3867
- } = e, [L, z] = N(!1), [m, V] = N(null), [$, G] = N(null), [O, Te] = N(!1), Ae = je(null), de = (C) => {
3868
- if (C < 30) return !0;
3869
- if (Ae.current) {
3870
- const D = Ae.current.getBoundingClientRect();
3871
- if (C - D.left < 30) return !0;
3877
+ onChatCreated: v,
3878
+ onUserMessage: M,
3879
+ onThreadIdUpdate: N,
3880
+ onLogout: A,
3881
+ enableAttachments: w = !1
3882
+ } = e, [I, P] = S(!1), [m, j] = S(null), [O, G] = S(null), [U, Ae] = S(!1), Ne = ze(null), de = (T) => {
3883
+ if (T < 30) return !0;
3884
+ if (Ne.current) {
3885
+ const D = Ne.current.getBoundingClientRect();
3886
+ if (T - D.left < 30) return !0;
3872
3887
  }
3873
3888
  return !1;
3874
- }, Ve = (C) => {
3875
- const R = C.touches[0].clientX;
3876
- (de(R) || L) && (V(R), G(R), Te(!0));
3877
- }, Xe = (C) => {
3878
- if (m === null || !O) return;
3879
- const D = C.touches[0];
3889
+ }, Xe = (T) => {
3890
+ const R = T.touches[0].clientX;
3891
+ (de(R) || I) && (j(R), G(R), Ae(!0));
3892
+ }, Ke = (T) => {
3893
+ if (m === null || !U) return;
3894
+ const D = T.touches[0];
3880
3895
  G(D.clientX);
3881
- }, Ke = () => {
3882
- if (m === null || $ === null) {
3883
- Te(!1);
3896
+ }, Ge = () => {
3897
+ if (m === null || O === null) {
3898
+ Ae(!1);
3884
3899
  return;
3885
3900
  }
3886
- const C = $ - m, D = 50, R = 0.3, tt = Math.abs(C) / 300;
3887
- C > D && !L && m !== null ? de(m) && z(!0) : ((C < -D || C < 0 && tt > R) && L || L && C < -20 && tt > R) && z(!1), V(null), G(null), Te(!1);
3888
- }, ur = () => {
3889
- if (O && m !== null && $ !== null) {
3890
- const C = $ - m;
3891
- if (L)
3892
- return `translateX(${Math.min(0, C)}px)`;
3901
+ const T = O - m, D = 50, R = 0.3, rt = Math.abs(T) / 300;
3902
+ T > D && !I && m !== null ? de(m) && P(!0) : ((T < -D || T < 0 && rt > R) && I || I && T < -20 && rt > R) && P(!1), j(null), G(null), Ae(!1);
3903
+ }, sr = () => {
3904
+ if (U && m !== null && O !== null) {
3905
+ const T = O - m;
3906
+ if (I)
3907
+ return `translateX(${Math.min(0, T)}px)`;
3893
3908
  if (m !== null && de(m))
3894
- return `translateX(${Math.min(0, -320 + C)}px)`;
3909
+ return `translateX(${Math.min(0, -320 + T)}px)`;
3895
3910
  }
3896
- return L ? "translateX(0)" : "translateX(-100%)";
3897
- }, sr = () => {
3898
- if (!O || m === null || $ === null)
3899
- return L ? 0.5 : 0;
3900
- const D = $ - m;
3901
- return L ? Math.max(0, Math.min(1, (320 + D) / 320)) * 0.5 : m !== null && de(m) ? Math.max(0, Math.min(1, (D + 320) / 320)) * 0.5 : 0;
3902
- }, fe = t || r || "", he = !!t, Ge = F(
3911
+ return I ? "translateX(0)" : "translateX(-100%)";
3912
+ }, lr = () => {
3913
+ if (!U || m === null || O === null)
3914
+ return I ? 0.5 : 0;
3915
+ const D = O - m;
3916
+ return I ? Math.max(0, Math.min(1, (320 + D) / 320)) * 0.5 : m !== null && de(m) ? Math.max(0, Math.min(1, (D + 320) / 320)) * 0.5 : 0;
3917
+ }, fe = t || r || "", he = !!t, Ze = z(
3903
3918
  () => new Lt(fe, a || void 0, he),
3904
3919
  [fe, a, he]
3905
- ), [Z, lr] = N(null), [te, Ze] = N(!1), [re, Je] = N(null), [dr, Qe] = N(!1);
3906
- P(() => {
3907
- i === "multiChat" && Qe(!0);
3920
+ ), [Z, dr] = S(null), [te, Je] = S(!1), [re, Qe] = S(null), [fr, Ye] = S(!1);
3921
+ E(() => {
3922
+ i === "multiChat" && Ye(!0);
3908
3923
  }, [i]);
3909
3924
  const J = ee(async () => {
3910
3925
  if (o === "selector") {
3911
- Ze(!0), Je(null);
3926
+ Je(!0), Qe(null);
3912
3927
  try {
3913
- const C = await Ge.listModels();
3914
- lr(C);
3915
- } catch (C) {
3916
- Je(C instanceof Error ? C : new Error("Failed to load models"));
3928
+ const T = await Ze.listModels();
3929
+ dr(T);
3930
+ } catch (T) {
3931
+ Qe(T instanceof Error ? T : new Error("Failed to load models"));
3917
3932
  } finally {
3918
- Ze(!1);
3933
+ Je(!1);
3919
3934
  }
3920
3935
  }
3921
- }, [Ge, o]);
3922
- P(() => {
3936
+ }, [Ze, o]);
3937
+ E(() => {
3923
3938
  o === "selector" && J();
3924
- }, [o, J]), P(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = J), () => {
3939
+ }, [o, J]), E(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = J), () => {
3925
3940
  typeof window < "u" && delete window.__cuadraUIKitRefetchModels;
3926
3941
  }), [J]);
3927
- const [U, Ye] = N(
3942
+ const [W, et] = S(
3928
3943
  o === "fixed" && n || null
3929
- ), et = je(U), ae = ee(
3930
- (C) => {
3931
- const D = et.current;
3932
- Ye(C), et.current = C, u?.(C), D !== null && D !== C && i === "multiChat" && setTimeout(() => {
3944
+ ), tt = ze(W), ae = ee(
3945
+ (T) => {
3946
+ const D = tt.current;
3947
+ et(T), tt.current = T, u?.(T), D !== null && D !== T && i === "multiChat" && setTimeout(() => {
3933
3948
  const R = window.__cuadraThreadListRuntime;
3934
3949
  if (R?.threads?.switchToNewThread)
3935
3950
  try {
@@ -3950,52 +3965,52 @@ const qi = ({ config: e }) => {
3950
3965
  },
3951
3966
  [u, i]
3952
3967
  );
3953
- P(() => {
3954
- if (o === "selector" && Z?.items && Z.items.length > 0 && !U) {
3955
- const C = Z.items[0];
3956
- if (C?.id) {
3957
- const D = C.id;
3958
- Ye(D), u?.(D);
3968
+ E(() => {
3969
+ if (o === "selector" && Z?.items && Z.items.length > 0 && !W) {
3970
+ const T = Z.items[0];
3971
+ if (T?.id) {
3972
+ const D = T.id;
3973
+ et(D), u?.(D);
3959
3974
  }
3960
3975
  }
3961
- }, [o, Z?.items, U, u]);
3962
- const fr = o === "fixed" ? !!n : !!U, me = F(
3963
- () => (Z?.items || []).filter((C) => C?.id && C?.displayName).map((C) => ({ id: C.id, name: C.displayName })),
3976
+ }, [o, Z?.items, W, u]);
3977
+ const hr = o === "fixed" ? !!n : !!W, me = z(
3978
+ () => (Z?.items || []).filter((T) => T?.id && T?.displayName).map((T) => ({ id: T.id, name: T.displayName })),
3964
3979
  [Z]
3965
- ), Ne = F(
3980
+ ), Ie = z(
3966
3981
  () => ({
3967
- currentModelId: U || "",
3982
+ currentModelId: W || "",
3968
3983
  models: me,
3969
3984
  modelsLoading: te,
3970
3985
  modelsError: re,
3971
3986
  onModelChange: ae,
3972
3987
  refetchModels: J
3973
3988
  }),
3974
- [U, me, te, re, ae, J]
3989
+ [W, me, te, re, ae, J]
3975
3990
  );
3976
- return o === "selector" && te || i === "multiChat" && dr ? /* @__PURE__ */ d(_e, { value: Ne, children: /* @__PURE__ */ d(Ee, { 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(It, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : o === "selector" && !fr && re ? /* @__PURE__ */ d(_e, { value: Ne, children: /* @__PURE__ */ d(Ee, { 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(_e, { value: Ne, children: /* @__PURE__ */ d(
3977
- ra,
3991
+ return o === "selector" && te || i === "multiChat" && fr ? /* @__PURE__ */ d(Fe, { value: Ie, children: /* @__PURE__ */ d(_e, { 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(St, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : o === "selector" && !hr && re ? /* @__PURE__ */ d(Fe, { value: Ie, children: /* @__PURE__ */ d(_e, { 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(Fe, { value: Ie, children: /* @__PURE__ */ d(
3992
+ aa,
3978
3993
  {
3979
3994
  baseUrl: he ? fe : r || fe,
3980
3995
  sessionToken: a,
3981
3996
  isProxyMode: he,
3982
3997
  mode: i,
3983
3998
  modelMode: o,
3984
- modelId: U || n || void 0,
3999
+ modelId: W || n || void 0,
3985
4000
  onModelChange: ae,
3986
4001
  ephemeral: c,
3987
4002
  systemPrompt: s,
3988
4003
  initialThreadId: f,
3989
- enableAttachments: S,
4004
+ enableAttachments: w,
3990
4005
  onError: k,
3991
- onChatCreated: w,
3992
- onUserMessage: A,
3993
- onThreadIdUpdate: I,
4006
+ onChatCreated: v,
4007
+ onUserMessage: M,
4008
+ onThreadIdUpdate: N,
3994
4009
  onChatsLoaded: () => {
3995
- i === "multiChat" && Qe(!1);
4010
+ i === "multiChat" && Ye(!1);
3996
4011
  },
3997
4012
  children: /* @__PURE__ */ d(
3998
- Ee,
4013
+ _e,
3999
4014
  {
4000
4015
  paddingX: "cuadra-px-0",
4001
4016
  paddingY: "cuadra-py-0",
@@ -4007,58 +4022,58 @@ const qi = ({ config: e }) => {
4007
4022
  {
4008
4023
  className: "cuadra-h-full cuadra-flex cuadra-relative",
4009
4024
  style: { height: "100%" },
4010
- onTouchStart: Ve,
4011
- onTouchMove: Xe,
4012
- onTouchEnd: Ke,
4013
- children: i === "multiChat" ? /* @__PURE__ */ v(H, { children: [
4014
- typeof document < "u" && ze(
4025
+ onTouchStart: Xe,
4026
+ onTouchMove: Ke,
4027
+ onTouchEnd: Ge,
4028
+ children: i === "multiChat" ? /* @__PURE__ */ C(q, { children: [
4029
+ typeof document < "u" && $e(
4015
4030
  /* @__PURE__ */ d(
4016
4031
  "div",
4017
4032
  {
4018
- className: `cuadra-fixed cuadra-inset-0 cuadra-bg-black cuadra-z-40 md:cuadra-hidden cuadra-transition-opacity cuadra-duration-300 ${L || O ? "" : "cuadra-pointer-events-none"}`,
4019
- style: { opacity: sr() },
4020
- onClick: () => z(!1)
4033
+ className: `cuadra-fixed cuadra-inset-0 cuadra-bg-black cuadra-z-40 md:cuadra-hidden cuadra-transition-opacity cuadra-duration-300 ${I || U ? "" : "cuadra-pointer-events-none"}`,
4034
+ style: { opacity: lr() },
4035
+ onClick: () => P(!1)
4021
4036
  }
4022
4037
  ),
4023
4038
  document.body
4024
4039
  ),
4025
- typeof document < "u" && /* @__PURE__ */ v(H, { children: [
4040
+ typeof document < "u" && /* @__PURE__ */ C(q, { children: [
4026
4041
  /* @__PURE__ */ d(
4027
4042
  "div",
4028
4043
  {
4029
4044
  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",
4030
4045
  style: { borderRightWidth: "1px", height: "100%" },
4031
4046
  children: /* @__PURE__ */ d(
4032
- xt,
4047
+ kt,
4033
4048
  {
4034
- onThreadSelect: () => z(!1),
4035
- showThemeToggle: g,
4036
- theme: b,
4037
- onLogout: T
4049
+ onThreadSelect: () => P(!1),
4050
+ showThemeToggle: y,
4051
+ theme: g,
4052
+ onLogout: A
4038
4053
  }
4039
4054
  )
4040
4055
  }
4041
4056
  ),
4042
- typeof document < "u" && ze(
4057
+ typeof document < "u" && $e(
4043
4058
  /* @__PURE__ */ d(
4044
4059
  "div",
4045
4060
  {
4046
- 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 ${L || O ? "" : "cuadra-pointer-events-none"}`,
4061
+ 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 ${I || U ? "" : "cuadra-pointer-events-none"}`,
4047
4062
  style: {
4048
4063
  borderRightWidth: "1px",
4049
- transform: ur(),
4050
- transition: O ? "none" : "transform 0.3s ease-in-out"
4064
+ transform: sr(),
4065
+ transition: U ? "none" : "transform 0.3s ease-in-out"
4051
4066
  },
4052
- onTouchStart: Ve,
4053
- onTouchMove: Xe,
4054
- onTouchEnd: Ke,
4067
+ onTouchStart: Xe,
4068
+ onTouchMove: Ke,
4069
+ onTouchEnd: Ge,
4055
4070
  children: /* @__PURE__ */ d(
4056
- xt,
4071
+ kt,
4057
4072
  {
4058
- onThreadSelect: () => z(!1),
4059
- showThemeToggle: g,
4060
- theme: b,
4061
- onLogout: T
4073
+ onThreadSelect: () => P(!1),
4074
+ showThemeToggle: y,
4075
+ theme: g,
4076
+ onLogout: A
4062
4077
  }
4063
4078
  )
4064
4079
  }
@@ -4066,52 +4081,52 @@ const qi = ({ config: e }) => {
4066
4081
  document.body
4067
4082
  )
4068
4083
  ] }),
4069
- /* @__PURE__ */ v("div", { ref: Ae, className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
4084
+ /* @__PURE__ */ C("div", { ref: Ne, className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
4070
4085
  o === "selector" && /* @__PURE__ */ d(
4071
- kt,
4086
+ wt,
4072
4087
  {
4073
- currentModel: U || "",
4088
+ currentModel: W || "",
4074
4089
  models: me,
4075
4090
  modelsLoading: te,
4076
4091
  modelsError: re,
4077
4092
  onModelChange: ae,
4078
- showThemeToggle: g,
4079
- theme: b,
4080
- onMobileMenuClick: () => z(!L),
4093
+ showThemeToggle: y,
4094
+ theme: g,
4095
+ onMobileMenuClick: () => P(!I),
4081
4096
  showMobileMenuButton: i === "multiChat"
4082
4097
  }
4083
4098
  ),
4084
4099
  /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
4085
- yt,
4100
+ xt,
4086
4101
  {
4087
4102
  welcomeTitle: l,
4088
4103
  welcomeSubtitle: p,
4089
- extraTopPadding: y,
4104
+ extraTopPadding: b,
4090
4105
  suggestions: h,
4091
4106
  inputPlaceholder: x,
4092
- enableAttachments: S
4107
+ enableAttachments: w
4093
4108
  }
4094
4109
  ) })
4095
4110
  ] })
4096
- ] }) : /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
4111
+ ] }) : /* @__PURE__ */ C("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
4097
4112
  o === "selector" && /* @__PURE__ */ d(
4098
- kt,
4113
+ wt,
4099
4114
  {
4100
- currentModel: U || "",
4115
+ currentModel: W || "",
4101
4116
  models: me,
4102
4117
  modelsLoading: te,
4103
4118
  modelsError: re,
4104
4119
  onModelChange: ae,
4105
- showThemeToggle: g,
4106
- theme: b
4120
+ showThemeToggle: y,
4121
+ theme: g
4107
4122
  }
4108
4123
  ),
4109
4124
  /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
4110
- yt,
4125
+ xt,
4111
4126
  {
4112
4127
  welcomeTitle: l,
4113
4128
  welcomeSubtitle: p,
4114
- extraTopPadding: y,
4129
+ extraTopPadding: b,
4115
4130
  suggestions: h,
4116
4131
  inputPlaceholder: x
4117
4132
  }
@@ -4124,18 +4139,18 @@ const qi = ({ config: e }) => {
4124
4139
  }
4125
4140
  ) }) });
4126
4141
  };
4127
- function Vi(e, r = ":root") {
4142
+ function Xi(e, r = ":root") {
4128
4143
  if (typeof document > "u")
4129
4144
  return;
4130
4145
  const t = document.documentElement;
4131
- if (e.light && Ki(e.light, t), e.dark) {
4146
+ if (e.light && Gi(e.light, t), e.dark) {
4132
4147
  let a = document.getElementById("cuadra-theme-dark");
4133
4148
  a || (a = document.createElement("style"), a.id = "cuadra-theme-dark", document.head.appendChild(a));
4134
- const i = Gi(e.dark);
4149
+ const i = Zi(e.dark);
4135
4150
  a.textContent = `.dark { ${i} }`;
4136
4151
  }
4137
4152
  }
4138
- const Xi = {
4153
+ const Ki = {
4139
4154
  background: "background",
4140
4155
  foreground: "foreground",
4141
4156
  card: "card",
@@ -4164,22 +4179,22 @@ const Xi = {
4164
4179
  warning: "warning",
4165
4180
  warningForeground: "warning-foreground"
4166
4181
  };
4167
- function cr(e) {
4168
- const r = Xi[e];
4182
+ function ur(e) {
4183
+ const r = Ki[e];
4169
4184
  return r ? `--cuadra-${r}` : `--cuadra-${e.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
4170
4185
  }
4171
- function Ki(e, r) {
4186
+ function Gi(e, r) {
4172
4187
  Object.entries(e).forEach(([t, a]) => {
4173
4188
  if (a) {
4174
- const i = cr(t);
4189
+ const i = ur(t);
4175
4190
  r.style.setProperty(i, a);
4176
4191
  }
4177
4192
  });
4178
4193
  }
4179
- function Gi(e) {
4180
- return Object.entries(e).map(([r, t]) => t ? `${cr(r)}: ${t};` : "").filter(Boolean).join(" ");
4194
+ function Zi(e) {
4195
+ return Object.entries(e).map(([r, t]) => t ? `${ur(r)}: ${t};` : "").filter(Boolean).join(" ");
4181
4196
  }
4182
- function ao() {
4197
+ function no() {
4183
4198
  if (typeof document > "u")
4184
4199
  return;
4185
4200
  const e = document.documentElement;
@@ -4187,9 +4202,9 @@ function ao() {
4187
4202
  const t = document.getElementById("cuadra-theme-dark");
4188
4203
  t && t.remove();
4189
4204
  }
4190
- function no(e) {
4191
- P(() => {
4192
- e.customTheme && Vi(e.customTheme);
4205
+ function io(e) {
4206
+ E(() => {
4207
+ e.customTheme && Xi(e.customTheme);
4193
4208
  }, [e.customTheme]);
4194
4209
  const r = {
4195
4210
  baseUrl: e.baseUrl,
@@ -4218,11 +4233,11 @@ function no(e) {
4218
4233
  enableAttachments: e.enableAttachments,
4219
4234
  containerClass: e.className
4220
4235
  };
4221
- return /* @__PURE__ */ d(qi, { config: r });
4236
+ return /* @__PURE__ */ d(Vi, { config: r });
4222
4237
  }
4223
4238
  export {
4224
- no as CuadraChat,
4225
- Vi as applyTheme,
4226
- ao as removeTheme
4239
+ io as CuadraChat,
4240
+ Xi as applyTheme,
4241
+ no as removeTheme
4227
4242
  };
4228
4243
  //# sourceMappingURL=index.mjs.map