research-agent-ui 0.1.354 → 0.1.355

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.
@@ -5,28 +5,26 @@ import v, { Suspense as y, createContext as b, forwardRef as x, lazy as S, useCa
5
5
  import { useParams as k, usePathname as A, useRouter as j, useSearchParams as M } from "next/navigation";
6
6
  import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
7
7
  import { AnimatePresence as I, motion as L } from "motion/react";
8
- import { AlertCircle as R, Archive as z, ArrowUp as B, BadgePercent as V, BookMarked as H, BookOpen as U, Bot as ee, Building2 as W, CalendarDays as te, Check as ne, CheckIcon as re, ChevronDown as ie, ChevronRightIcon as ae, Clipboard as oe, Clock as se, Cloud as ce, CloudIcon as le, Copy as ue, Cpu as de, Download as fe, ExternalLink as pe, EyeOff as me, File as he, FileDown as ge, FileSpreadsheet as _e, FileText as ve, FileType as ye, FolderOpen as be, Globe as xe, HelpCircle as Se, Highlighter as Ce, History as we, Info as Te, LayoutGrid as Ee, Link as De, Loader2 as G, Lock as Oe, LogIn as ke, LogOut as Ae, Mail as je, MessageCircle as Me, MessageCircleQuestion as Ne, MessageSquare as Pe, Mic as Fe, Newspaper as Ie, Paperclip as Le, Pencil as Re, Pin as ze, Plus as Be, Search as Ve, Settings as He, Settings2 as Ue, Share2 as We, SlidersHorizontal as Ge, Sparkles as Ke, Square as qe, SquarePen as Je, Star as Ye, Sun as Xe, SwatchBook as Ze, Trash as Qe, Trash2 as $e, Upload as et, Volume2 as tt, X as nt, ZoomIn as rt, ZoomOut as it } from "lucide-react";
9
- import { Toaster as at, toast as K } from "sonner";
10
- import q from "grab-url";
11
- import { agentChat as ot, autocomplete as st, createDocument as ct, deleteAllChats as lt, deleteChatById as ut, deleteUploadedFile as dt, getChatById as ft, getGoogleDriveFile as pt, getGoogleToken as mt, googleDocsAuth as ht, googleDocsAuthStatus as gt, listChats as _t, listProviders as vt, saveMessage as yt, searchChats as bt, shareChat as xt, uploadFiles as St } from "qwksearch-api-client";
12
- import { LiveTranscriber as Ct } from "use-voice-control/client";
13
- import { SpokenPhraseOverlay as wt } from "use-voice-control/react";
14
- import * as J from "@radix-ui/react-dropdown-menu";
15
- import Tt from "next/link";
16
- import { Slot as Et } from "@radix-ui/react-slot";
17
- import { cva as Dt } from "class-variance-authority";
18
- import Ot from "quantum-sphere-loading-icon/react";
19
- import kt from "dompurify";
20
- import { TOCProvider as At, TOCScrollArea as jt } from "fumadocs-ui/components/toc";
21
- import { TOCEmpty as Mt, TOCItem as Nt, TOCItems as Pt } from "fumadocs-ui/components/toc/clerk";
22
- import { Streamdown as Ft } from "streamdown";
23
- import { FaReddit as It, FaYoutube as Lt } from "react-icons/fa";
24
- import { ThemeProvider as Rt } from "shadcn-theme-menu";
25
- import { CategoryDock as zt, CategoryDockProvider as Bt, DropdownMenuItem as Vt, DropdownMenuSeparator as Ht, ThemeMenu as Ut } from "shadcn-app-dock";
26
- import Wt from "next/image";
27
- import { CookieConsent as Gt } from "legal-terms-privacy-policy/react";
8
+ import { AlertCircle as R, Archive as z, ArrowUp as B, BadgePercent as V, BookMarked as H, BookOpen as ee, Bot as te, Building2 as U, CalendarDays as ne, Check as re, CheckIcon as ie, ChevronDown as ae, ChevronRightIcon as oe, Clipboard as se, Clock as ce, Cloud as le, CloudIcon as ue, Copy as de, Cpu as fe, Download as pe, ExternalLink as me, EyeOff as he, File as ge, FileDown as _e, FileSpreadsheet as ve, FileText as ye, FileType as be, FolderOpen as xe, Globe as Se, HelpCircle as Ce, Highlighter as we, History as Te, Info as Ee, LayoutGrid as De, Link as Oe, Loader2 as W, Lock as ke, LogIn as Ae, LogOut as je, Mail as Me, MessageCircle as Ne, MessageCircleQuestion as Pe, MessageSquare as Fe, Mic as Ie, Newspaper as Le, Paperclip as Re, Pencil as ze, Pin as Be, Plus as Ve, Search as He, Settings as Ue, Settings2 as We, Share2 as Ge, SlidersHorizontal as Ke, Sparkles as qe, Square as Je, SquarePen as Ye, Star as Xe, Sun as Ze, SwatchBook as Qe, Trash as $e, Trash2 as et, Upload as tt, Volume2 as nt, X as rt, ZoomIn as it, ZoomOut as at } from "lucide-react";
9
+ import { Toaster as ot, toast as G } from "sonner";
10
+ import K from "grab-url";
11
+ import { agentChat as st, autocomplete as ct, createDocument as lt, deleteAllChats as ut, deleteChatById as dt, deleteUploadedFile as ft, getChatById as pt, getGoogleDriveFile as mt, getGoogleToken as ht, googleDocsAuth as gt, googleDocsAuthStatus as _t, listChats as vt, listProviders as yt, saveMessage as bt, searchChats as xt, shareChat as St, uploadFiles as Ct } from "qwksearch-api-client";
12
+ import { LiveTranscriber as wt } from "use-voice-control/client";
13
+ import { SpokenPhraseOverlay as Tt } from "use-voice-control/react";
14
+ import * as q from "@radix-ui/react-dropdown-menu";
15
+ import Et from "next/link";
16
+ import { Slot as Dt } from "@radix-ui/react-slot";
17
+ import { cva as Ot } from "class-variance-authority";
18
+ import kt from "quantum-sphere-loading-icon/react";
19
+ import At from "dompurify";
20
+ import { Streamdown as jt } from "streamdown";
21
+ import { FaReddit as Mt, FaYoutube as Nt } from "react-icons/fa";
22
+ import { ThemeProvider as Pt } from "shadcn-theme-menu";
23
+ import { CategoryDock as Ft, CategoryDockProvider as It, DropdownMenuItem as Lt, DropdownMenuSeparator as Rt, ThemeMenu as zt } from "shadcn-app-dock";
24
+ import Bt from "next/image";
25
+ import { CookieConsent as Vt } from "legal-terms-privacy-policy/react";
28
26
  // src/ui/gradient-blur.tsx
29
- function Kt({ radius: e = 60, opacityDecay: t = .025, backgroundColor: n = "transparent", color: r, colorGenerator: i }) {
27
+ function Ht({ radius: e = 60, opacityDecay: t = .025, backgroundColor: n = "transparent", color: r, colorGenerator: i }) {
30
28
  let a = D(null), o = D({
31
29
  x: 0,
32
30
  y: 0
@@ -85,8 +83,8 @@ function Kt({ radius: e = 60, opacityDecay: t = .025, backgroundColor: n = "tran
85
83
  });
86
84
  }
87
85
  // ../search-autocomplete/dist/react.mjs
88
- var qt = "w-full text-left px-4 py-1.5 text-[15px] flex items-center gap-3 transition-colors", Jt = "bg-bg-200 text-text-100", Yt = "text-text-200 hover:bg-bg-100 dark:hover:bg-[#3A3A38]", Xt = "w-5 h-5 flex items-center justify-center rounded bg-bg-200 dark:bg-[#3A3A38] text-[11px] font-semibold text-text-400 shrink-0";
89
- function Zt({ open: e, suggestions: t, domains: n, placement: r, highlightedIndex: i, setHighlightedIndex: a, selectSuggestion: o, selectDomain: s, className: c = "left-2 right-2 md:left-0 md:right-0" }) {
86
+ var Ut = "w-full text-left px-4 py-1.5 text-[15px] flex items-center gap-3 transition-colors", Wt = "bg-bg-200 text-text-100", Gt = "text-text-200 hover:bg-bg-100 dark:hover:bg-[#3A3A38]", Kt = "w-5 h-5 flex items-center justify-center rounded bg-bg-200 dark:bg-[#3A3A38] text-[11px] font-semibold text-text-400 shrink-0";
87
+ function qt({ open: e, suggestions: t, domains: n, placement: r, highlightedIndex: i, setHighlightedIndex: a, selectSuggestion: o, selectDomain: s, className: c = "left-2 right-2 md:left-0 md:right-0" }) {
90
88
  let l = r === "above" ? 4 : -4;
91
89
  return /* @__PURE__ */ P(I, { children: e && n.length + t.length > 0 && /* @__PURE__ */ P(L.div, {
92
90
  initial: {
@@ -114,10 +112,10 @@ function Zt({ open: e, suggestions: t, domains: n, placement: r, highlightedInde
114
112
  type: "button",
115
113
  onMouseEnter: () => a(t),
116
114
  onClick: () => s(e),
117
- className: `${qt} ${t === i ? Jt : Yt}`,
115
+ className: `${Ut} ${t === i ? Wt : Gt}`,
118
116
  children: [
119
117
  /* @__PURE__ */ P("span", {
120
- className: Xt,
118
+ className: Kt,
121
119
  children: t + 1
122
120
  }),
123
121
  /* @__PURE__ */ P("img", {
@@ -148,13 +146,13 @@ function Zt({ open: e, suggestions: t, domains: n, placement: r, highlightedInde
148
146
  type: "button",
149
147
  onMouseEnter: () => a(r),
150
148
  onClick: () => o(e),
151
- className: `${qt} ${r === i ? Jt : Yt}`,
149
+ className: `${Ut} ${r === i ? Wt : Gt}`,
152
150
  children: [
153
151
  /* @__PURE__ */ P("span", {
154
- className: Xt,
152
+ className: Kt,
155
153
  children: r + 1
156
154
  }),
157
- /* @__PURE__ */ P(Ve, { className: "w-4 h-4 text-text-400 shrink-0" }),
155
+ /* @__PURE__ */ P(He, { className: "w-4 h-4 text-text-400 shrink-0" }),
158
156
  /* @__PURE__ */ P("span", {
159
157
  className: "truncate",
160
158
  children: e
@@ -166,8 +164,8 @@ function Zt({ open: e, suggestions: t, domains: n, placement: r, highlightedInde
166
164
  })
167
165
  }) });
168
166
  }
169
- var Qt = "/api/agent/autocomplete";
170
- function $t(e, t = 4) {
167
+ var Jt = "/api/agent/autocomplete";
168
+ function Yt(e, t = 4) {
171
169
  let n = e.trimEnd();
172
170
  if (!n) return {
173
171
  prefix: "",
@@ -179,7 +177,7 @@ function $t(e, t = 4) {
179
177
  query: a
180
178
  };
181
179
  }
182
- function en(e, t) {
180
+ function Xt(e, t) {
183
181
  return async (n, { signal: r, limit: i }) => {
184
182
  let a = new URLSearchParams({
185
183
  q: n,
@@ -190,10 +188,10 @@ function en(e, t) {
190
188
  return s.ok ? await s.json() : null;
191
189
  };
192
190
  }
193
- var tn = 36, nn = 288;
194
- function rn(e) {
195
- let { value: t, onChange: n, enabled: r = !0, endpoint: i = Qt, engine: a, limit: o = 8, debounceMs: s = 180, minChars: c = 2, maxWords: l = 4, anchorRef: u, inputRef: d } = e, [f, p] = O([]), [m, h] = O([]), [g, _] = O(!1), [v, y] = O("below"), [b, x] = O(-1), S = D(!1), w = D(null), E = D(e.fetchSuggestions ?? en(i, a));
196
- E.current = e.fetchSuggestions ?? en(i, a);
191
+ var Zt = 36, Qt = 288;
192
+ function $t(e) {
193
+ let { value: t, onChange: n, enabled: r = !0, endpoint: i = Jt, engine: a, limit: o = 8, debounceMs: s = 180, minChars: c = 2, maxWords: l = 4, anchorRef: u, inputRef: d } = e, [f, p] = O([]), [m, h] = O([]), [g, _] = O(!1), [v, y] = O("below"), [b, x] = O(-1), S = D(!1), w = D(null), E = D(e.fetchSuggestions ?? Xt(i, a));
194
+ E.current = e.fetchSuggestions ?? Xt(i, a);
197
195
  let k = D(e.onSelectDomain);
198
196
  k.current = e.onSelectDomain;
199
197
  let A = C(() => {
@@ -204,7 +202,7 @@ function rn(e) {
204
202
  S.current = !1;
205
203
  return;
206
204
  }
207
- let { query: e } = $t(t, l);
205
+ let { query: e } = Yt(t, l);
208
206
  if (!r || e.length < c) {
209
207
  w.current?.abort(), p([]), h([]), A();
210
208
  return;
@@ -223,7 +221,7 @@ function rn(e) {
223
221
  p(r), h(i);
224
222
  let a = r.length + i.length;
225
223
  if (a > 0 && u?.current && typeof window < "u") {
226
- let e = u.current.getBoundingClientRect(), t = window.innerHeight - e.bottom, n = e.top, r = Math.min(nn, a * tn);
224
+ let e = u.current.getBoundingClientRect(), t = window.innerHeight - e.bottom, n = e.top, r = Math.min(Qt, a * Zt);
227
225
  y(t < r && n > t ? "above" : "below");
228
226
  }
229
227
  _(a > 0), x(-1);
@@ -244,7 +242,7 @@ function rn(e) {
244
242
  ]), T(() => () => w.current?.abort(), []);
245
243
  let j = C((e) => {
246
244
  S.current = !0;
247
- let { prefix: r } = $t(t, l);
245
+ let { prefix: r } = Yt(t, l);
248
246
  n(r + e), p([]), h([]), A(), d?.current?.focus();
249
247
  }, [
250
248
  t,
@@ -296,13 +294,13 @@ function rn(e) {
296
294
  };
297
295
  }
298
296
  // src/components/MessageComposer/MessageInputIconSet.tsx
299
- var Y = {
300
- Plus: Be,
301
- Paperclip: Le,
302
- Cloud: ce,
303
- Upload: et,
304
- File: he,
305
- SquarePen: Je,
297
+ var J = {
298
+ Plus: Ve,
299
+ Paperclip: Re,
300
+ Cloud: le,
301
+ Upload: tt,
302
+ File: ge,
303
+ SquarePen: Ye,
306
304
  Thinking: (e) => /* @__PURE__ */ P("svg", {
307
305
  width: "20",
308
306
  height: "20",
@@ -312,15 +310,15 @@ var Y = {
312
310
  ...e,
313
311
  children: /* @__PURE__ */ P("path", { d: "M10.3857 2.50977C14.3486 2.71054 17.5 5.98724 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 9.72386 2.72386 9.5 3 9.5C3.27614 9.5 3.5 9.72386 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.5225 13.7691 3.68312 10.335 3.50879L10 3.5L9.89941 3.49023C9.67145 3.44371 9.5 3.24171 9.5 3C9.5 2.72386 9.72386 2.5 10 2.5L10.3857 2.50977ZM10 5.5C10.2761 5.5 10.5 5.72386 10.5 6V9.69043L13.2236 11.0527C13.4706 11.1762 13.5708 11.4766 13.4473 11.7236C13.3392 11.9397 13.0957 12.0435 12.8711 11.9834L12.7764 11.9473L9.77637 10.4473C9.60698 10.3626 9.5 10.1894 9.5 10V6C9.5 5.72386 9.72386 5.5 10 5.5ZM3.66211 6.94141C4.0273 6.94159 4.32303 7.23735 4.32324 7.60254C4.32324 7.96791 4.02743 8.26446 3.66211 8.26465C3.29663 8.26465 3 7.96802 3 7.60254C3.00021 7.23723 3.29676 6.94141 3.66211 6.94141ZM4.95605 4.29395C5.32146 4.29404 5.61719 4.59063 5.61719 4.95605C5.6171 5.3214 5.3214 5.61709 4.95605 5.61719C4.59063 5.61719 4.29403 5.32146 4.29395 4.95605C4.29395 4.59057 4.59057 4.29395 4.95605 4.29395ZM7.60254 3C7.96802 3 8.26465 3.29663 8.26465 3.66211C8.26446 4.02743 7.96791 4.32324 7.60254 4.32324C7.23736 4.32302 6.94159 4.0273 6.94141 3.66211C6.94141 3.29676 7.23724 3.00022 7.60254 3Z" })
314
312
  }),
315
- SelectArrow: ie,
313
+ SelectArrow: ae,
316
314
  ArrowUp: B,
317
- X: nt,
318
- FileText: ve,
319
- Loader2: G,
320
- Check: ne,
315
+ X: rt,
316
+ FileText: ye,
317
+ Loader2: W,
318
+ Check: re,
321
319
  Archive: z,
322
- Mic: Fe,
323
- Stop: qe,
320
+ Mic: Ie,
321
+ Stop: Je,
324
322
  Clock: (e) => /* @__PURE__ */ P("svg", {
325
323
  xmlns: "http://www.w3.org/2000/svg",
326
324
  width: "20",
@@ -330,7 +328,7 @@ var Y = {
330
328
  ...e,
331
329
  children: /* @__PURE__ */ P("path", { d: "M10.3857 2.50977C14.3486 2.71054 17.5 5.98724 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 9.72386 2.72386 9.5 3 9.5C3.27614 9.5 3.5 9.72386 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.5225 13.7691 3.68312 10.335 3.50879L10 3.5L9.89941 3.49023C9.67145 3.44371 9.5 3.24171 9.5 3C9.5 2.72386 9.72386 2.5 10 2.5L10.3857 2.50977ZM10 5.5C10.2761 5.5 10.5 5.72386 10.5 6V9.69043L13.2236 11.0527C13.4706 11.1762 13.5708 11.4766 13.4473 11.7236C13.3392 11.9397 13.0957 12.0435 12.8711 11.9834L12.7764 11.9473L9.77637 10.4473C9.60698 10.3626 9.5 10.1894 9.5 10V6C9.5 5.72386 9.72386 5.5 10 5.5ZM3.66211 6.94141C4.0273 6.94159 4.32303 7.23735 4.32324 7.60254C4.32324 7.96791 4.02743 8.26446 3.66211 8.26465C3.29663 8.26465 3 7.96802 3 7.60254C3.00021 7.23723 3.29676 6.94141 3.66211 6.94141ZM4.95605 4.29395C5.32146 4.29404 5.61719 4.59063 5.61719 4.95605C5.6171 5.3214 5.3214 5.61709 4.95605 5.61719C4.59063 5.61719 4.29403 5.32146 4.29395 4.95605C4.29395 4.59057 4.59057 4.29395 4.95605 4.29395ZM7.60254 3C7.96802 3 8.26465 3.29663 8.26465 3.66211C8.26446 4.02743 7.96791 4.32324 7.60254 4.32324C7.23736 4.32302 6.94159 4.0273 6.94141 3.66211C6.94141 3.29676 7.23724 3.00022 7.60254 3Z" })
332
330
  })
333
- }, an = (e) => {
331
+ }, en = (e) => {
334
332
  if (e === 0) return "0 Bytes";
335
333
  let t = 1024, n = [
336
334
  "Bytes",
@@ -339,7 +337,7 @@ var Y = {
339
337
  "GB"
340
338
  ], r = Math.floor(Math.log(e) / Math.log(t));
341
339
  return parseFloat((e / t ** r).toFixed(2)) + " " + n[r];
342
- }, on = ({ file: e, onRemove: t }) => {
340
+ }, tn = ({ file: e, onRemove: t }) => {
343
341
  let n = e.type.startsWith("image/") && e.preview;
344
342
  return /* @__PURE__ */ F("div", {
345
343
  className: "relative group flex-shrink-0 w-24 h-24 rounded-xl overflow-hidden border border-bg-300 bg-bg-200 animate-fade-in transition-all hover:border-text-400",
@@ -356,7 +354,7 @@ var Y = {
356
354
  /* @__PURE__ */ P("span", {
357
355
  className: "absolute bottom-1 left-1 px-1.5 py-0.5 rounded-md bg-black/60 text-white text-[10px] font-medium leading-none backdrop-blur-sm pointer-events-none",
358
356
  title: e.file.name,
359
- children: an(e.file.size)
357
+ children: en(e.file.size)
360
358
  })
361
359
  ]
362
360
  }) : /* @__PURE__ */ F("div", {
@@ -365,7 +363,7 @@ var Y = {
365
363
  className: "flex items-center gap-2",
366
364
  children: [/* @__PURE__ */ P("div", {
367
365
  className: "p-1.5 bg-bg-300 rounded",
368
- children: /* @__PURE__ */ P(Y.FileText, { className: "w-4 h-4 text-text-300" })
366
+ children: /* @__PURE__ */ P(J.FileText, { className: "w-4 h-4 text-text-300" })
369
367
  }), /* @__PURE__ */ P("span", {
370
368
  className: "text-[10px] font-medium text-text-400 uppercase tracking-wider truncate",
371
369
  children: e.file.name.split(".").pop()
@@ -378,26 +376,26 @@ var Y = {
378
376
  children: e.file.name
379
377
  }), /* @__PURE__ */ P("p", {
380
378
  className: "text-[10px] text-text-500",
381
- children: an(e.file.size)
379
+ children: en(e.file.size)
382
380
  })]
383
381
  })]
384
382
  }),
385
383
  /* @__PURE__ */ P("button", {
386
384
  onClick: () => t(e.id),
387
385
  className: "absolute top-1 right-1 p-1 bg-black/50 hover:bg-black/70 rounded-full text-white opacity-0 group-hover:opacity-100 transition-opacity",
388
- children: /* @__PURE__ */ P(Y.X, { className: "w-3 h-3" })
386
+ children: /* @__PURE__ */ P(J.X, { className: "w-3 h-3" })
389
387
  }),
390
388
  e.uploadStatus === "uploading" && /* @__PURE__ */ P("div", {
391
389
  className: "absolute inset-0 bg-black/40 flex items-center justify-center",
392
- children: /* @__PURE__ */ P(Y.Loader2, { className: "w-5 h-5 text-white animate-spin" })
390
+ children: /* @__PURE__ */ P(J.Loader2, { className: "w-5 h-5 text-white animate-spin" })
393
391
  }),
394
392
  e.uploadStatus === "error" && /* @__PURE__ */ P("div", {
395
393
  className: "absolute inset-0 bg-red-900/60 flex items-center justify-center",
396
- children: /* @__PURE__ */ P(Y.X, { className: "w-5 h-5 text-red-300" })
394
+ children: /* @__PURE__ */ P(J.X, { className: "w-5 h-5 text-red-300" })
397
395
  })
398
396
  ]
399
397
  });
400
- }, sn = ({ content: e, onRemove: t }) => /* @__PURE__ */ F("div", {
398
+ }, nn = ({ content: e, onRemove: t }) => /* @__PURE__ */ F("div", {
401
399
  className: "relative group flex-shrink-0 w-28 h-28 rounded-2xl overflow-hidden border border-[#E5E5E5] dark:border-[#30302E] bg-white dark:bg-[#20201F] animate-fade-in p-3 flex flex-col justify-between shadow-[0_1px_2px_rgba(0,0,0,0.05)]",
402
400
  children: [
403
401
  /* @__PURE__ */ P("div", {
@@ -420,12 +418,12 @@ var Y = {
420
418
  /* @__PURE__ */ P("button", {
421
419
  onClick: () => t(e.id),
422
420
  className: "absolute top-2 right-2 p-[3px] bg-white dark:bg-[#30302E] border border-[#E5E5E5] dark:border-[#404040] rounded-full text-[#9CA3AF] hover:text-[#6B7280] dark:hover:text-white transition-colors shadow-sm opacity-0 group-hover:opacity-100",
423
- children: /* @__PURE__ */ P(Y.X, { className: "w-2 h-2" })
421
+ children: /* @__PURE__ */ P(J.X, { className: "w-2 h-2" })
424
422
  })
425
423
  ]
426
- }), cn = async (e, t, n) => {
424
+ }), rn = async (e, t, n) => {
427
425
  try {
428
- let n = localStorage.getItem("chatModelKey"), r = localStorage.getItem("chatModelProviderId"), i = (await q("agent/providers"))?.providers || [];
426
+ let n = localStorage.getItem("chatModelKey"), r = localStorage.getItem("chatModelProviderId"), i = (await K("agent/providers"))?.providers || [];
429
427
  if (!i || i.length === 0) {
430
428
  t(!0);
431
429
  return;
@@ -446,53 +444,53 @@ var Y = {
446
444
  providerId: r
447
445
  }), t(!0);
448
446
  } catch (e) {
449
- console.error("An error occurred while checking the configuration:", e), K.error(`Could not load AI providers: ${e?.message ?? String(e)}`), t(!0);
447
+ console.error("An error occurred while checking the configuration:", e), G.error(`Could not load AI providers: ${e?.message ?? String(e)}`), t(!0);
450
448
  }
451
- }, ln = "qwksearch_guest_chats", un = typeof window < "u";
452
- function dn() {
453
- if (!un) return [];
449
+ }, an = "qwksearch_guest_chats", on = typeof window < "u";
450
+ function Y() {
451
+ if (!on) return [];
454
452
  try {
455
- let e = localStorage.getItem(ln);
453
+ let e = localStorage.getItem(an);
456
454
  return e ? JSON.parse(e).sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()) : [];
457
455
  } catch (e) {
458
456
  return console.error("Failed to get guest chats:", e), [];
459
457
  }
460
458
  }
461
- function fn(e) {
462
- return un && dn().find((t) => t.id === e) || null;
459
+ function sn(e) {
460
+ return on && Y().find((t) => t.id === e) || null;
463
461
  }
464
- function pn(e) {
465
- if (un) try {
466
- let t = dn(), n = t.findIndex((t) => t.id === e.id);
467
- n >= 0 ? t[n] = e : t.push(e), localStorage.setItem(ln, JSON.stringify(t));
462
+ function cn(e) {
463
+ if (on) try {
464
+ let t = Y(), n = t.findIndex((t) => t.id === e.id);
465
+ n >= 0 ? t[n] = e : t.push(e), localStorage.setItem(an, JSON.stringify(t));
468
466
  } catch (e) {
469
467
  console.error("Failed to save guest chat:", e);
470
468
  }
471
469
  }
472
- function mn(e) {
473
- if (un) try {
474
- let t = dn().filter((t) => t.id !== e);
475
- localStorage.setItem(ln, JSON.stringify(t));
470
+ function ln(e) {
471
+ if (on) try {
472
+ let t = Y().filter((t) => t.id !== e);
473
+ localStorage.setItem(an, JSON.stringify(t));
476
474
  } catch (e) {
477
475
  console.error("Failed to delete guest chat:", e);
478
476
  }
479
477
  }
480
- function hn() {
481
- if (un) try {
482
- localStorage.removeItem(ln);
478
+ function un() {
479
+ if (on) try {
480
+ localStorage.removeItem(an);
483
481
  } catch (e) {
484
482
  console.error("Failed to clear guest chats:", e);
485
483
  }
486
484
  }
487
- function gn(e, t) {
488
- if (!un) return;
489
- let n = fn(e);
490
- n && (n.title = t, pn(n));
485
+ function dn(e, t) {
486
+ if (!on) return;
487
+ let n = sn(e);
488
+ n && (n.title = t, cn(n));
491
489
  }
492
490
  // src/hooks/useChat/chatMessages.ts
493
- var _n = async (e, t, n, r, i, a, o, s, c) => {
491
+ var fn = async (e, t, n, r, i, a, o, s, c) => {
494
492
  if (!t) {
495
- let t = fn(e);
493
+ let t = sn(e);
496
494
  if (t) {
497
495
  n(t.messages);
498
496
  let e = t.messages.filter((e) => e.role === "user" || e.role === "assistant"), o = e.map((e) => [e.role, e.content]);
@@ -500,7 +498,7 @@ var _n = async (e, t, n, r, i, a, o, s, c) => {
500
498
  return;
501
499
  }
502
500
  try {
503
- let { data: t, error: l } = await ft({ path: { id: e } });
501
+ let { data: t, error: l } = await pt({ path: { id: e } });
504
502
  if (l) {
505
503
  let e = l.status;
506
504
  if (e === 404 || e === 403) {
@@ -530,7 +528,7 @@ var _n = async (e, t, n, r, i, a, o, s, c) => {
530
528
  }
531
529
  }
532
530
  try {
533
- let { data: t, error: l } = await ft({ path: { id: e } });
531
+ let { data: t, error: l } = await pt({ path: { id: e } });
534
532
  if (l) {
535
533
  let e = l.status;
536
534
  if (e === 404 || e === 401 || e === 403) {
@@ -556,7 +554,7 @@ var _n = async (e, t, n, r, i, a, o, s, c) => {
556
554
  } catch (e) {
557
555
  console.error("[chatMessages] Failed to load chat:", e), o(!0), r(!0);
558
556
  }
559
- }, vn = (e) => {
557
+ }, pn = (e) => {
560
558
  let t = [];
561
559
  return e.forEach((n, r) => {
562
560
  if (n.role === "user") {
@@ -588,10 +586,10 @@ var _n = async (e, t, n, r, i, a, o, s, c) => {
588
586
  });
589
587
  }
590
588
  }), t;
591
- }, yn = async (e) => {
589
+ }, mn = async (e) => {
592
590
  let t = localStorage.getItem("chatModelKey"), n = localStorage.getItem("chatModelProviderId"), r = parseInt(localStorage.getItem("maxFollowupQuestions") || "4"), i = localStorage.getItem("followUpQuestionsPrompt")?.trim() || void 0, a = e.filter((e) => e.role === "user" || e.role === "assistant");
593
591
  try {
594
- let e = await q("agent/suggestions", {
592
+ let e = await K("agent/suggestions", {
595
593
  method: "POST",
596
594
  body: JSON.stringify({
597
595
  chatHistory: a,
@@ -607,18 +605,18 @@ var _n = async (e, t, n, r, i, a, o, s, c) => {
607
605
  } catch {
608
606
  return [];
609
607
  }
610
- }, bn = 3, xn = "Analyze the uploaded file(s) and summarize the key points.", Sn = () => Array.from(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(7)), (e) => e.toString(16).padStart(2, "0")).join(""), Cn = "sourceExtractionEnabled", wn = "thinkingTimeLimit";
611
- async function Tn(e, n) {
612
- let { message: r, messageId: i, rewrite: a = !1 } = e, { chatId: o, loading: s, messages: c, fileIds: l, files: u, focusMode: d, category: f, optimizationMode: p, chatHistory: m, chatModelProvider: h, isAuthenticated: g, messagesRef: _, abortControllerRef: v, setLoading: y, setMessageAppeared: b, setMessages: x, setChatHistory: S, setChatModelProvider: C } = n, w = typeof window < "u" && localStorage.getItem(Cn) === "true", T = typeof window < "u" && Number(localStorage.getItem(wn) ?? "0") || 0;
608
+ }, hn = 3, gn = "Analyze the uploaded file(s) and summarize the key points.", _n = () => Array.from(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(7)), (e) => e.toString(16).padStart(2, "0")).join(""), vn = "sourceExtractionEnabled", yn = "thinkingTimeLimit";
609
+ async function bn(e, n) {
610
+ let { message: r, messageId: i, rewrite: a = !1 } = e, { chatId: o, loading: s, messages: c, fileIds: l, files: u, focusMode: d, category: f, optimizationMode: p, chatHistory: m, chatModelProvider: h, isAuthenticated: g, messagesRef: _, abortControllerRef: v, setLoading: y, setMessageAppeared: b, setMessages: x, setChatHistory: S, setChatModelProvider: C } = n, w = typeof window < "u" && localStorage.getItem(vn) === "true", T = typeof window < "u" && Number(localStorage.getItem(yn) ?? "0") || 0;
613
611
  if (s) return;
614
612
  let E = r?.trim() ?? "", D = Array.isArray(l) && l.length > 0;
615
613
  if (!E && !D) return;
616
- let O = E ? r : xn, k = new AbortController();
614
+ let O = E ? r : gn, k = new AbortController();
617
615
  if (v.current = k, y(!0), b(!1), c.length <= 1 && !t.onOpenChat) {
618
616
  let e = new URL(window.location.href);
619
617
  e.searchParams.set("chat", o), window.history.replaceState(null, "", `${e.pathname}?${e.searchParams.toString()}${e.hash}`);
620
618
  }
621
- let A = "", j = !1, M = !1, N = [], P = Date.now(), F = T > 0, I = "", L = "", R = i ?? Sn(), z = Array.isArray(u) ? [...u] : [];
619
+ let A = "", j = !1, M = !1, N = [], P = Date.now(), F = T > 0, I = "", L = "", R = i ?? _n(), z = Array.isArray(u) ? [...u] : [];
622
620
  x((e) => [...e, {
623
621
  content: O,
624
622
  messageId: R,
@@ -630,7 +628,7 @@ async function Tn(e, n) {
630
628
  let B = (e) => {
631
629
  x((t) => [...t, {
632
630
  content: `⚠️ **The response failed:** ${e}`,
633
- messageId: Sn(),
631
+ messageId: _n(),
634
632
  chatId: o,
635
633
  role: "assistant",
636
634
  createdAt: /* @__PURE__ */ new Date()
@@ -641,7 +639,7 @@ async function Tn(e, n) {
641
639
  typeof t == "string" && (t.includes("no longer available") || t.includes("deprecated") || t.includes("410")) && (localStorage.removeItem("chatModelKey"), localStorage.removeItem("chatModelProviderId"), C?.({
642
640
  key: "",
643
641
  providerId: ""
644
- })), K.error(t), B(t), y(!1);
642
+ })), G.error(t), B(t), y(!1);
645
643
  } else {
646
644
  if (e.type === "searching") {
647
645
  let t = e.data;
@@ -685,9 +683,9 @@ async function Tn(e, n) {
685
683
  role: "source",
686
684
  sources: N,
687
685
  createdAt: /* @__PURE__ */ new Date()
688
- }]), N.length > 0 && (b(!0), N.slice(0, bn).forEach((e) => {
686
+ }]), N.length > 0 && (b(!0), N.slice(0, hn).forEach((e) => {
689
687
  let t = e?.metadata?.url;
690
- t && t !== "File" && q(`doc/article?url=${encodeURIComponent(t)}`).catch(() => {});
688
+ t && t !== "File" && K(`doc/article?url=${encodeURIComponent(t)}`).catch(() => {});
691
689
  }))), e.type === "message" && (A += e.data, F ? (I += e.data, L ||= e.messageId, j = !0) : j ? x((t) => t.map((t) => t.messageId === e.messageId && t.role === "assistant" ? {
692
690
  ...t,
693
691
  content: t.content + e.data
@@ -713,7 +711,7 @@ async function Tn(e, n) {
713
711
  let e = _.current[_.current.length - 1];
714
712
  if (t.getAutoMediaSearch() && (document.getElementById(`search-images-${e.messageId}`)?.click(), document.getElementById(`search-videos-${e.messageId}`)?.click()), !M) {
715
713
  M = !0;
716
- let e = await yn(_.current), t = Sn();
714
+ let e = await mn(_.current), t = _n();
717
715
  if (x((n) => [...n, {
718
716
  role: "suggestion",
719
717
  suggestions: e,
@@ -721,7 +719,7 @@ async function Tn(e, n) {
721
719
  createdAt: /* @__PURE__ */ new Date(),
722
720
  messageId: t
723
721
  }]), g && e.length > 0) try {
724
- await yt({ body: {
722
+ await bt({ body: {
725
723
  chatId: o,
726
724
  messageId: t,
727
725
  role: "suggestion",
@@ -741,7 +739,7 @@ async function Tn(e, n) {
741
739
  }
742
740
  }, H = c.findIndex((e) => e.messageId === R);
743
741
  try {
744
- let { stream: e } = await ot({
742
+ let { stream: e } = await st({
745
743
  signal: k.signal,
746
744
  body: {
747
745
  message: {
@@ -767,7 +765,7 @@ async function Tn(e, n) {
767
765
  sseMaxRetryAttempts: 1,
768
766
  onSseError: (e) => {
769
767
  let t = e instanceof Error ? e.message : String(e);
770
- t.includes("401") && g ? (K.error("Your session has expired. Please sign in again."), y(!1), window.location.href = "/") : (K.error("Failed to send message. Please try again."), B(`${t}. Please try again.`), y(!1));
768
+ t.includes("401") && g ? (G.error("Your session has expired. Please sign in again."), y(!1), window.location.href = "/") : (G.error("Failed to send message. Please try again."), B(`${t}. Please try again.`), y(!1));
771
769
  }
772
770
  });
773
771
  for await (let t of e) await V(t);
@@ -791,11 +789,11 @@ async function Tn(e, n) {
791
789
  v.current = null;
792
790
  }
793
791
  // src/hooks/useChat/useChatState.ts
794
- function En(e) {
792
+ function xn(e) {
795
793
  let [t, n] = O(e), [r, i] = O(!1), [a, o] = O(!1), [s, c] = O(!1), [l, u] = O(!1), [d, f] = O(!1), [p, m] = O(!1), [h, g] = O(!1), [_, v] = O(!1), [y, b] = O([]), [x, S] = O([]), [C, w] = O([]), [T, k] = O([]), [A, j] = O("webSearch"), [M, N] = O("general"), [P, F] = O("speed"), [I, L] = O({
796
794
  key: "",
797
795
  providerId: ""
798
- }), R = D([]), z = E(() => x.filter((e) => e.role === "user" || e.role === "assistant"), [x]), B = E(() => vn(x), [x]);
796
+ }), R = D([]), z = E(() => x.filter((e) => e.role === "user" || e.role === "assistant"), [x]), B = E(() => pn(x), [x]);
799
797
  return {
800
798
  state: {
801
799
  chatId: t,
@@ -841,14 +839,14 @@ function En(e) {
841
839
  };
842
840
  }
843
841
  // src/lib/chatTitle.ts
844
- var Dn = async (e, t) => {
842
+ var Sn = async (e, t) => {
845
843
  let n = localStorage.getItem("chatModelKey"), r = localStorage.getItem("chatModelProviderId"), i = t.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
846
844
  role: e.role,
847
845
  content: e.content ?? ""
848
846
  }));
849
847
  if (i.length === 0) return "";
850
848
  try {
851
- let t = await q("agent/chat-title", {
849
+ let t = await K("agent/chat-title", {
852
850
  method: "POST",
853
851
  body: JSON.stringify({
854
852
  chatId: e,
@@ -865,16 +863,16 @@ var Dn = async (e, t) => {
865
863
  }
866
864
  };
867
865
  // src/hooks/useChat/ChatProvider.tsx
868
- function On({ children: e }) {
869
- let t = k(), r = M(), a = j(), o = r.get("q"), { isAuthenticated: s, isLoading: c } = n(), { state: l, setters: u, messagesRef: d, chatTurns: f, sections: p } = En(t.chatId), m = D(null), [h, g] = O(!1), _ = D({}), v = D(/* @__PURE__ */ new Set());
866
+ function Cn({ children: e }) {
867
+ let t = k(), r = M(), a = j(), o = r.get("q"), { isAuthenticated: s, isLoading: c } = n(), { state: l, setters: u, messagesRef: d, chatTurns: f, sections: p } = xn(t.chatId), m = D(null), [h, g] = O(!1), _ = D({}), v = D(/* @__PURE__ */ new Set());
870
868
  T(() => {
871
- cn(u.setChatModelProvider, u.setIsConfigReady, u.setHasError);
869
+ rn(u.setChatModelProvider, u.setIsConfigReady, u.setHasError);
872
870
  }, []), T(() => {
873
871
  t.chatId && t.chatId !== l.chatId && (u.setChatId(t.chatId), u.setMessages([]), u.setChatHistory([]), u.setFiles([]), u.setFileIds([]), u.setIsMessagesLoaded(!1), u.setNotFound(!1), u.setNewChatCreated(!1));
874
872
  }, [t.chatId, l.chatId]), T(() => {
875
873
  if (l.chatId && !l.newChatCreated && !l.isMessagesLoaded && l.messages.length === 0) {
876
874
  if (c) return;
877
- _n(l.chatId, s, u.setMessages, u.setIsMessagesLoaded, u.setChatHistory, u.setFocusMode, u.setNotFound, u.setFiles, u.setFileIds);
875
+ fn(l.chatId, s, u.setMessages, u.setIsMessagesLoaded, u.setChatHistory, u.setFocusMode, u.setNotFound, u.setFiles, u.setFileIds);
878
876
  } else l.chatId || (u.setNewChatCreated(!0), u.setIsMessagesLoaded(!0), u.setChatId(crypto.randomUUID()));
879
877
  }, [
880
878
  l.chatId,
@@ -888,7 +886,7 @@ function On({ children: e }) {
888
886
  let e = l.messages.filter((e) => e.role === "user" || e.role === "assistant");
889
887
  if (e.length > 0) {
890
888
  let t = _.current[l.chatId] ?? e[0].content.slice(0, 50);
891
- pn({
889
+ cn({
892
890
  id: l.chatId,
893
891
  title: t,
894
892
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -908,8 +906,8 @@ function On({ children: e }) {
908
906
  if (h || !l.chatId || !l.isMessagesLoaded || !l.newChatCreated || l.loading || f.filter((e) => e.role === "user").length < 2) return;
909
907
  let e = l.chatId;
910
908
  v.current.has(e) || (v.current.add(e), (async () => {
911
- let t = await Dn(e, l.messages);
912
- t ? (_.current[e] = t, s || gn(e, t)) : v.current.delete(e);
909
+ let t = await Sn(e, l.messages);
910
+ t ? (_.current[e] = t, s || dn(e, t)) : v.current.delete(e);
913
911
  })());
914
912
  }, [
915
913
  f,
@@ -932,7 +930,7 @@ function On({ children: e }) {
932
930
  o
933
931
  ]);
934
932
  let y = C(async (e, t, n = !1) => {
935
- l.chatId && await Tn({
933
+ l.chatId && await bn({
936
934
  message: e,
937
935
  messageId: t,
938
936
  rewrite: n
@@ -988,10 +986,10 @@ function On({ children: e }) {
988
986
  } : t;
989
987
  }));
990
988
  try {
991
- let { error: t } = await dt({ query: { fileId: e } });
989
+ let { error: t } = await ft({ query: { fileId: e } });
992
990
  if (t) throw Error(t.message ?? "Delete failed");
993
991
  } catch (e) {
994
- console.error("[ChatProvider] Failed to delete uploaded file:", e), K.error("Removed from the chat, but the file could not be deleted from storage.");
992
+ console.error("[ChatProvider] Failed to delete uploaded file:", e), G.error("Removed from the chat, but the file could not be deleted from storage.");
995
993
  }
996
994
  }, [l.files, l.fileIds]), S = C(() => {
997
995
  m.current &&= (m.current.abort(), null);
@@ -1041,10 +1039,10 @@ function On({ children: e }) {
1041
1039
  });
1042
1040
  }
1043
1041
  // src/hooks/voice/useSpeechToTranscript.ts
1044
- function kn() {
1042
+ function wn() {
1045
1043
  return typeof window > "u" ? !1 : !!(window.SpeechRecognition || window.webkitSpeechRecognition);
1046
1044
  }
1047
- function An(e, t, n = {}) {
1045
+ function Tn(e, t, n = {}) {
1048
1046
  let [r, i] = O(!1), [a, o] = O(""), [s, c] = O(""), [l, u] = O(0), d = D(null), f = D(null), p = D([]), m = D({
1049
1047
  onTranscript: e,
1050
1048
  onEnd: t,
@@ -1055,7 +1053,7 @@ function An(e, t, n = {}) {
1055
1053
  onEnd: t,
1056
1054
  onPartial: n.onPartial
1057
1055
  };
1058
- let h = E(() => new Ct({
1056
+ let h = E(() => new wt({
1059
1057
  engine: "webspeech",
1060
1058
  language: n.language ?? "en-US",
1061
1059
  onStateChange: i,
@@ -1066,19 +1064,19 @@ function An(e, t, n = {}) {
1066
1064
  o(""), c(e), u((e) => e + 1), m.current.onTranscript(e);
1067
1065
  },
1068
1066
  onError: () => {
1069
- K.error("Speech recognition stopped unexpectedly.");
1067
+ G.error("Speech recognition stopped unexpectedly.");
1070
1068
  }
1071
1069
  }), [n.language]), g = C(() => {
1072
1070
  let e = d.current;
1073
1071
  e && e.state !== "inactive" ? e.stop() : (f.current?.getTracks().forEach((e) => e.stop()), f.current = null, d.current = null);
1074
1072
  }, []), _ = async (e) => {
1075
1073
  let t = new FormData();
1076
- return t.append("file", e, "speech-input.webm"), t.append("languageCode", "en"), ((await q("agent/transcript", {
1074
+ return t.append("file", e, "speech-input.webm"), t.append("languageCode", "en"), ((await K("agent/transcript", {
1077
1075
  method: "POST",
1078
1076
  body: t
1079
1077
  }))?.text ?? "").trim();
1080
1078
  }, v = C(async () => {
1081
- if (typeof navigator > "u" || !navigator.mediaDevices?.getUserMedia || typeof MediaRecorder > "u") K.error("Speech input is not supported in this browser", { duration: 5e3 }), i(!1), m.current.onEnd();
1079
+ if (typeof navigator > "u" || !navigator.mediaDevices?.getUserMedia || typeof MediaRecorder > "u") G.error("Speech input is not supported in this browser", { duration: 5e3 }), i(!1), m.current.onEnd();
1082
1080
  else try {
1083
1081
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 }), t = new MediaRecorder(e);
1084
1082
  p.current = [], f.current = e, d.current = t, t.ondataavailable = (e) => {
@@ -1090,18 +1088,18 @@ function An(e, t, n = {}) {
1090
1088
  let e = new Blob(p.current, { type: "audio/webm" });
1091
1089
  if (p.current = [], f.current?.getTracks().forEach((e) => e.stop()), f.current = null, d.current = null, i(!1), e.size === 0) return;
1092
1090
  let t = await _(e);
1093
- t ? (c(t), u((e) => e + 1), m.current.onTranscript(t)) : K.error("No speech detected. Please try again.");
1091
+ t ? (c(t), u((e) => e + 1), m.current.onTranscript(t)) : G.error("No speech detected. Please try again.");
1094
1092
  } catch {
1095
- K.error("Unable to transcribe audio.");
1093
+ G.error("Unable to transcribe audio.");
1096
1094
  } finally {
1097
1095
  m.current.onEnd();
1098
1096
  }
1099
1097
  }, t.start();
1100
1098
  } catch {
1101
- K.error("Microphone access is required for speech input."), i(!1), m.current.onEnd();
1099
+ G.error("Microphone access is required for speech input."), i(!1), m.current.onEnd();
1102
1100
  }
1103
1101
  }, []), y = C(async () => {
1104
- h.isListening() ? (await h.stop(), o(""), m.current.onEnd()) : d.current ? g() : kn() ? await h.start() : await v();
1102
+ h.isListening() ? (await h.stop(), o(""), m.current.onEnd()) : d.current ? g() : wn() ? await h.start() : await v();
1105
1103
  }, [
1106
1104
  h,
1107
1105
  v,
@@ -1119,48 +1117,48 @@ function An(e, t, n = {}) {
1119
1117
  return {
1120
1118
  isListening: r,
1121
1119
  toggleSpeech: y,
1122
- isSpeechSupported: kn() || b,
1120
+ isSpeechSupported: wn() || b,
1123
1121
  partial: a,
1124
1122
  lastPhrase: s,
1125
1123
  phraseId: l
1126
1124
  };
1127
1125
  }
1128
1126
  // src/lib/voiceAutoStart.ts
1129
- var jn = "voiceAutoStart", Mn = "voiceAutoStartTriggered", Nn = typeof window < "u";
1130
- function Pn() {
1131
- return Nn ? localStorage.getItem(jn) === "true" : !1;
1127
+ var En = "voiceAutoStart", Dn = "voiceAutoStartTriggered", On = typeof window < "u";
1128
+ function kn() {
1129
+ return On ? localStorage.getItem(En) === "true" : !1;
1132
1130
  }
1133
- function Fn(e) {
1134
- Nn && localStorage.setItem(jn, String(e));
1131
+ function An(e) {
1132
+ On && localStorage.setItem(En, String(e));
1135
1133
  }
1136
- function In() {
1137
- Nn && localStorage.setItem(Mn, "true");
1134
+ function jn() {
1135
+ On && localStorage.setItem(Dn, "true");
1138
1136
  }
1139
- function Ln({ enabled: e, isSpeechSupported: t, isListening: n }, r) {
1137
+ function Mn({ enabled: e, isSpeechSupported: t, isListening: n }, r) {
1140
1138
  return e && t && !n && !r;
1141
1139
  }
1142
- function Rn() {
1143
- return Nn ? localStorage.getItem(Mn) === "true" : !1;
1140
+ function Nn() {
1141
+ return On ? localStorage.getItem(Dn) === "true" : !1;
1144
1142
  }
1145
1143
  // src/hooks/voice/useVoiceAutoStart.ts
1146
- function zn({ isSpeechSupported: e, isListening: t, toggleSpeech: n }) {
1144
+ function Pn({ isSpeechSupported: e, isListening: t, toggleSpeech: n }) {
1147
1145
  T(() => {
1148
- Ln({
1149
- enabled: Pn(),
1146
+ Mn({
1147
+ enabled: kn(),
1150
1148
  isSpeechSupported: e,
1151
1149
  isListening: t
1152
- }, Rn()) && (In(), n());
1150
+ }, Nn()) && (jn(), n());
1153
1151
  }, [e]);
1154
1152
  }
1155
1153
  // src/components/FileUpload/useFileHandling.ts
1156
- var Bn = [
1154
+ var Fn = [
1157
1155
  "pdf",
1158
1156
  "docx",
1159
1157
  "txt",
1160
1158
  "md",
1161
1159
  "html",
1162
1160
  "htm"
1163
- ], Vn = [
1161
+ ], In = [
1164
1162
  "png",
1165
1163
  "jpg",
1166
1164
  "jpeg",
@@ -1169,21 +1167,21 @@ var Bn = [
1169
1167
  "svg",
1170
1168
  "bmp",
1171
1169
  "avif"
1172
- ], Hn = [...Bn, ...Vn], Un = 10, Wn = 52428800, Gn = (e, t) => {
1170
+ ], Ln = [...Fn, ...In], Rn = 10, zn = 52428800, Bn = (e, t) => {
1173
1171
  if (e && typeof e == "object") {
1174
1172
  let t = e.message ?? e.error ?? e.data?.message;
1175
1173
  if (typeof t == "string" && t.length > 0) return t;
1176
1174
  }
1177
1175
  return typeof e == "string" && e.length > 0 ? e : t;
1178
1176
  };
1179
- function Kn({ setMessage: e, contextFiles: t, contextFileIds: n, setContextFiles: r, setContextFileIds: i }) {
1177
+ function Vn({ setMessage: e, contextFiles: t, contextFileIds: n, setContextFiles: r, setContextFileIds: i }) {
1180
1178
  let [a, o] = O([]), [s, c] = O([]), [l, u] = O(!1), [d, f] = O(!1), p = C(async (e) => {
1181
1179
  let a = Array.from(e);
1182
- a.length > Un && (K.error(`You can attach up to ${Un} files at a time.`), a = a.slice(0, Un));
1183
- let s = a.filter((e) => e.size > Wn);
1184
- if (s.length > 0 && (K.error(`${s.map((e) => e.name).join(", ")} exceed${s.length === 1 ? "s" : ""} the 50 MB per-file limit.`), a = a.filter((e) => e.size <= Wn)), a.length === 0) return;
1180
+ a.length > Rn && (G.error(`You can attach up to ${Rn} files at a time.`), a = a.slice(0, Rn));
1181
+ let s = a.filter((e) => e.size > zn);
1182
+ if (s.length > 0 && (G.error(`${s.map((e) => e.name).join(", ")} exceed${s.length === 1 ? "s" : ""} the 50 MB per-file limit.`), a = a.filter((e) => e.size <= zn)), a.length === 0) return;
1185
1183
  let c = a.map((e) => {
1186
- let t = e.type.startsWith("image/") || /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(e.name), n = e.name.split(".").pop()?.toLowerCase() ?? "", r = Hn.includes(n);
1184
+ let t = e.type.startsWith("image/") || /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(e.name), n = e.name.split(".").pop()?.toLowerCase() ?? "", r = Ln.includes(n);
1187
1185
  return {
1188
1186
  id: Math.random().toString(36).substr(2, 9),
1189
1187
  file: e,
@@ -1193,7 +1191,7 @@ function Kn({ setMessage: e, contextFiles: t, contextFileIds: n, setContextFiles
1193
1191
  _ext: n
1194
1192
  };
1195
1193
  });
1196
- o((e) => [...e, ...c]), c.filter((e) => !Hn.includes(e._ext)).forEach((e) => {
1194
+ o((e) => [...e, ...c]), c.filter((e) => !Ln.includes(e._ext)).forEach((e) => {
1197
1195
  setTimeout(() => {
1198
1196
  o((t) => t.map((t) => t.id === e.id ? {
1199
1197
  ...t,
@@ -1201,16 +1199,16 @@ function Kn({ setMessage: e, contextFiles: t, contextFileIds: n, setContextFiles
1201
1199
  } : t));
1202
1200
  }, 600 + Math.random() * 600);
1203
1201
  });
1204
- let l = c.filter((e) => Hn.includes(e._ext));
1202
+ let l = c.filter((e) => Ln.includes(e._ext));
1205
1203
  if (l.length !== 0) try {
1206
- let { data: e, error: a } = await St({ body: { files: l.map((e) => e.file) } });
1207
- if (a || !e?.files) throw Error(Gn(a ?? e, "Upload failed."));
1204
+ let { data: e, error: a } = await Ct({ body: { files: l.map((e) => e.file) } });
1205
+ if (a || !e?.files) throw Error(Bn(a ?? e, "Upload failed."));
1208
1206
  o((e) => e.map((e) => l.some((t) => t.id === e.id) ? {
1209
1207
  ...e,
1210
1208
  uploadStatus: "complete"
1211
1209
  } : e)), r([...t, ...e.files]), i([...n, ...e.files.map((e) => e.fileId)]);
1212
1210
  } catch (e) {
1213
- K.error(Gn(e, "Failed to upload files.")), o((e) => e.map((e) => l.some((t) => t.id === e.id) ? {
1211
+ G.error(Bn(e, "Failed to upload files.")), o((e) => e.map((e) => l.some((t) => t.id === e.id) ? {
1214
1212
  ...e,
1215
1213
  uploadStatus: "error"
1216
1214
  } : e));
@@ -1232,7 +1230,7 @@ function Kn({ setMessage: e, contextFiles: t, contextFileIds: n, setContextFiles
1232
1230
  handleFiles: p,
1233
1231
  extractUrl: C(async (e) => {
1234
1232
  let a = e.trim();
1235
- if (!/^https?:\/\//i.test(a)) return K.error("Enter a valid http(s) URL."), !1;
1233
+ if (!/^https?:\/\//i.test(a)) return G.error("Enter a valid http(s) URL."), !1;
1236
1234
  f(!0);
1237
1235
  try {
1238
1236
  let e = await (await fetch("/api/doc/uploads", {
@@ -1240,10 +1238,10 @@ function Kn({ setMessage: e, contextFiles: t, contextFileIds: n, setContextFiles
1240
1238
  headers: { "Content-Type": "application/json" },
1241
1239
  body: JSON.stringify({ url: a })
1242
1240
  })).json();
1243
- if (!e?.files || e.files.length === 0) throw Error(Gn(e, `Could not extract content from ${a}`));
1244
- return r([...t, ...e.files]), i([...n, ...e.files.map((e) => e.fileId)]), K.success(`Added "${e.files[0].fileName}" as context.`), !0;
1241
+ if (!e?.files || e.files.length === 0) throw Error(Bn(e, `Could not extract content from ${a}`));
1242
+ return r([...t, ...e.files]), i([...n, ...e.files.map((e) => e.fileId)]), G.success(`Added "${e.files[0].fileName}" as context.`), !0;
1245
1243
  } catch (e) {
1246
- return K.error(Gn(e, "Failed to extract URL.")), !1;
1244
+ return G.error(Bn(e, "Failed to extract URL.")), !1;
1247
1245
  } finally {
1248
1246
  f(!1);
1249
1247
  }
@@ -1289,20 +1287,20 @@ function Kn({ setMessage: e, contextFiles: t, contextFileIds: n, setContextFiles
1289
1287
  };
1290
1288
  }
1291
1289
  // src/ui/dropdown-menu.tsx
1292
- function qn({ ...e }) {
1293
- return /* @__PURE__ */ P(J.Root, {
1290
+ function Hn({ ...e }) {
1291
+ return /* @__PURE__ */ P(q.Root, {
1294
1292
  "data-slot": "dropdown-menu",
1295
1293
  ...e
1296
1294
  });
1297
1295
  }
1298
- function Jn({ ...e }) {
1299
- return /* @__PURE__ */ P(J.Trigger, {
1296
+ function Un({ ...e }) {
1297
+ return /* @__PURE__ */ P(q.Trigger, {
1300
1298
  "data-slot": "dropdown-menu-trigger",
1301
1299
  ...e
1302
1300
  });
1303
1301
  }
1304
- function Yn({ className: e, sideOffset: t = 4, ...n }) {
1305
- return /* @__PURE__ */ P(J.Portal, { children: /* @__PURE__ */ P(J.Content, {
1302
+ function Wn({ className: e, sideOffset: t = 4, ...n }) {
1303
+ return /* @__PURE__ */ P(q.Portal, { children: /* @__PURE__ */ P(q.Content, {
1306
1304
  "data-slot": "dropdown-menu-content",
1307
1305
  sideOffset: t,
1308
1306
  className: h("bg-card text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl border p-1 shadow-md", e),
@@ -1310,7 +1308,7 @@ function Yn({ className: e, sideOffset: t = 4, ...n }) {
1310
1308
  }) });
1311
1309
  }
1312
1310
  function X({ className: e, inset: t, variant: n = "default", ...r }) {
1313
- return /* @__PURE__ */ P(J.Item, {
1311
+ return /* @__PURE__ */ P(q.Item, {
1314
1312
  "data-slot": "dropdown-menu-item",
1315
1313
  "data-inset": t,
1316
1314
  "data-variant": n,
@@ -1318,20 +1316,20 @@ function X({ className: e, inset: t, variant: n = "default", ...r }) {
1318
1316
  ...r
1319
1317
  });
1320
1318
  }
1321
- function Xn({ className: e, children: t, checked: n, ...r }) {
1322
- return /* @__PURE__ */ F(J.CheckboxItem, {
1319
+ function Gn({ className: e, children: t, checked: n, ...r }) {
1320
+ return /* @__PURE__ */ F(q.CheckboxItem, {
1323
1321
  "data-slot": "dropdown-menu-checkbox-item",
1324
1322
  className: h("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-2xl py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
1325
1323
  checked: n,
1326
1324
  ...r,
1327
1325
  children: [/* @__PURE__ */ P("span", {
1328
1326
  className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
1329
- children: /* @__PURE__ */ P(J.ItemIndicator, { children: /* @__PURE__ */ P(re, { className: "size-4" }) })
1327
+ children: /* @__PURE__ */ P(q.ItemIndicator, { children: /* @__PURE__ */ P(ie, { className: "size-4" }) })
1330
1328
  }), t]
1331
1329
  });
1332
1330
  }
1333
- function Zn({ className: e, inset: t, ...n }) {
1334
- return /* @__PURE__ */ P(J.Label, {
1331
+ function Kn({ className: e, inset: t, ...n }) {
1332
+ return /* @__PURE__ */ P(q.Label, {
1335
1333
  "data-slot": "dropdown-menu-label",
1336
1334
  "data-inset": t,
1337
1335
  className: h("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", e),
@@ -1339,60 +1337,60 @@ function Zn({ className: e, inset: t, ...n }) {
1339
1337
  });
1340
1338
  }
1341
1339
  function Z({ className: e, ...t }) {
1342
- return /* @__PURE__ */ P(J.Separator, {
1340
+ return /* @__PURE__ */ P(q.Separator, {
1343
1341
  "data-slot": "dropdown-menu-separator",
1344
1342
  className: h("bg-border -mx-1 my-1 h-px", e),
1345
1343
  ...t
1346
1344
  });
1347
1345
  }
1348
- function Qn({ ...e }) {
1349
- return /* @__PURE__ */ P(J.Sub, {
1346
+ function qn({ ...e }) {
1347
+ return /* @__PURE__ */ P(q.Sub, {
1350
1348
  "data-slot": "dropdown-menu-sub",
1351
1349
  ...e
1352
1350
  });
1353
1351
  }
1354
- function $n({ className: e, inset: t, children: n, ...r }) {
1355
- return /* @__PURE__ */ F(J.SubTrigger, {
1352
+ function Jn({ className: e, inset: t, children: n, ...r }) {
1353
+ return /* @__PURE__ */ F(q.SubTrigger, {
1356
1354
  "data-slot": "dropdown-menu-sub-trigger",
1357
1355
  "data-inset": t,
1358
1356
  className: h("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-2xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", e),
1359
1357
  ...r,
1360
- children: [n, /* @__PURE__ */ P(ae, { className: "ml-auto size-4" })]
1358
+ children: [n, /* @__PURE__ */ P(oe, { className: "ml-auto size-4" })]
1361
1359
  });
1362
1360
  }
1363
- function er({ className: e, ...t }) {
1364
- return /* @__PURE__ */ P(J.SubContent, {
1361
+ function Yn({ className: e, ...t }) {
1362
+ return /* @__PURE__ */ P(q.SubContent, {
1365
1363
  "data-slot": "dropdown-menu-sub-content",
1366
1364
  className: h("bg-card text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-2xl border p-1 shadow-lg", e),
1367
1365
  ...t
1368
1366
  });
1369
1367
  }
1370
1368
  // src/components/FileUpload/GoogleDrivePicker.tsx
1371
- var tr = () => window.gapi, nr = () => window.google, rr = null;
1372
- function ir(e) {
1369
+ var Xn = () => window.gapi, Zn = () => window.google, Qn = null;
1370
+ function $n(e) {
1373
1371
  return new Promise((t, n) => {
1374
1372
  let r = document.createElement("script");
1375
1373
  r.src = e, r.async = !0, r.onload = () => t(), r.onerror = () => n(/* @__PURE__ */ Error(`Failed to load ${e}`)), document.body.appendChild(r);
1376
1374
  });
1377
1375
  }
1378
- function ar() {
1379
- if (tr() && nr()?.picker) return Promise.resolve();
1380
- if (!rr) {
1381
- let e = (tr() ? Promise.resolve() : ir("https://apis.google.com/js/api.js")).then(() => new Promise((e) => tr().load("client:picker", () => e()))), t = nr()?.picker ? Promise.resolve() : ir("https://www.google.com/jsapi");
1382
- rr = Promise.all([e, t]).then(() => void 0), rr.catch(() => {
1383
- rr = null;
1376
+ function er() {
1377
+ if (Xn() && Zn()?.picker) return Promise.resolve();
1378
+ if (!Qn) {
1379
+ let e = (Xn() ? Promise.resolve() : $n("https://apis.google.com/js/api.js")).then(() => new Promise((e) => Xn().load("client:picker", () => e()))), t = Zn()?.picker ? Promise.resolve() : $n("https://www.google.com/jsapi");
1380
+ Qn = Promise.all([e, t]).then(() => void 0), Qn.catch(() => {
1381
+ Qn = null;
1384
1382
  });
1385
1383
  }
1386
- return rr;
1384
+ return Qn;
1387
1385
  }
1388
- var or = () => ({ openPicker: async (e, n, r) => {
1386
+ var tr = () => ({ openPicker: async (e, n, r) => {
1389
1387
  try {
1390
- await ar();
1388
+ await er();
1391
1389
  } catch {
1392
1390
  r?.("Google Picker API could not be loaded. Please try again.");
1393
1391
  return;
1394
1392
  }
1395
- let i = nr();
1393
+ let i = Zn();
1396
1394
  if (!i?.picker) r?.("Google Picker API not loaded yet. Please try again.");
1397
1395
  else try {
1398
1396
  let { picker: r } = i, a = new r.PickerBuilder().addView(r.ViewId.DOCS).addView(r.ViewId.DOCS_IMAGES).addView(r.ViewId.DOCS_VIDEOS).addView(new r.DocsView().setIncludeFolders(!0).setMimeTypes("application/pdf,application/vnd.google-apps.document,application/vnd.google-apps.spreadsheet,text/plain,image/jpeg,image/png")).setOAuthToken(e).setDeveloperKey(t.googleApiKey);
@@ -1407,7 +1405,7 @@ var or = () => ({ openPicker: async (e, n, r) => {
1407
1405
  }
1408
1406
  } });
1409
1407
  // src/icons/IconSearchWeb.tsx
1410
- function sr(e) {
1408
+ function nr(e) {
1411
1409
  return /* @__PURE__ */ F("svg", {
1412
1410
  xmlns: "http://www.w3.org/2000/svg",
1413
1411
  xmlnsXlink: "http://www.w3.org/1999/xlink",
@@ -1448,7 +1446,7 @@ function sr(e) {
1448
1446
  });
1449
1447
  }
1450
1448
  // src/icons/IconSearchNews.tsx
1451
- function cr(e) {
1449
+ function rr(e) {
1452
1450
  return /* @__PURE__ */ F("svg", {
1453
1451
  version: "1.1",
1454
1452
  xmlns: "http://www.w3.org/2000/svg",
@@ -1523,7 +1521,7 @@ function cr(e) {
1523
1521
  });
1524
1522
  }
1525
1523
  // src/icons/IconSearchVideos.tsx
1526
- function lr(e) {
1524
+ function ir(e) {
1527
1525
  return /* @__PURE__ */ F("svg", {
1528
1526
  version: "1.1",
1529
1527
  xmlns: "http://www.w3.org/2000/svg",
@@ -1763,7 +1761,7 @@ function lr(e) {
1763
1761
  });
1764
1762
  }
1765
1763
  // src/icons/IconSearchImages.tsx
1766
- function ur(e) {
1764
+ function ar(e) {
1767
1765
  return /* @__PURE__ */ P("svg", {
1768
1766
  width: "800px",
1769
1767
  height: "800px",
@@ -1827,7 +1825,7 @@ function ur(e) {
1827
1825
  });
1828
1826
  }
1829
1827
  // src/icons/IconSearchAcademic.tsx
1830
- function dr(e) {
1828
+ function or(e) {
1831
1829
  return /* @__PURE__ */ F("svg", {
1832
1830
  width: "800px",
1833
1831
  height: "800px",
@@ -1872,7 +1870,7 @@ function dr(e) {
1872
1870
  });
1873
1871
  }
1874
1872
  // src/icons/IconSearchFiles.tsx
1875
- function fr(e) {
1873
+ function sr(e) {
1876
1874
  return /* @__PURE__ */ F("svg", {
1877
1875
  height: "800px",
1878
1876
  width: "800px",
@@ -1924,7 +1922,7 @@ function fr(e) {
1924
1922
  });
1925
1923
  }
1926
1924
  // src/icons/IconSearchTech.tsx
1927
- function pr(e) {
1925
+ function cr(e) {
1928
1926
  return /* @__PURE__ */ F("svg", {
1929
1927
  height: "800px",
1930
1928
  width: "800px",
@@ -2050,49 +2048,49 @@ function pr(e) {
2050
2048
  });
2051
2049
  }
2052
2050
  // src/components/SearchConfig/categories.ts
2053
- var mr = [
2051
+ var lr = [
2054
2052
  {
2055
2053
  code: "general",
2056
- icon: sr,
2054
+ icon: nr,
2057
2055
  name: "Web"
2058
2056
  },
2059
2057
  {
2060
2058
  code: "news",
2061
- icon: cr,
2059
+ icon: rr,
2062
2060
  name: "News"
2063
2061
  },
2064
2062
  {
2065
2063
  code: "videos",
2066
- icon: lr,
2064
+ icon: ir,
2067
2065
  name: "Videos"
2068
2066
  },
2069
2067
  {
2070
2068
  code: "images",
2071
- icon: ur,
2069
+ icon: ar,
2072
2070
  name: "Images"
2073
2071
  },
2074
2072
  {
2075
2073
  code: "science",
2076
- icon: dr,
2074
+ icon: or,
2077
2075
  name: "Academic"
2078
2076
  },
2079
2077
  {
2080
2078
  code: "files",
2081
- icon: fr,
2079
+ icon: sr,
2082
2080
  name: "Files"
2083
2081
  },
2084
2082
  {
2085
2083
  code: "it",
2086
- icon: pr,
2084
+ icon: cr,
2087
2085
  name: "Tech"
2088
2086
  }
2089
- ], hr = () => {
2087
+ ], ur = () => {
2090
2088
  let { chatModelProvider: e, setChatModelProvider: t } = u(), [n, r] = O([]), [i, a] = O(!0), o = j();
2091
2089
  T(() => {
2092
2090
  (async () => {
2093
2091
  try {
2094
2092
  a(!0);
2095
- let { data: n } = await vt(), i = n?.providers ?? [];
2093
+ let { data: n } = await yt(), i = n?.providers ?? [];
2096
2094
  if (r(i), !e.key && i.length > 0) {
2097
2095
  let e = localStorage.getItem("chatModelKey"), n = localStorage.getItem("chatModelProviderId");
2098
2096
  if (e && n) t({
@@ -2127,27 +2125,27 @@ var mr = [
2127
2125
  key: n
2128
2126
  }), localStorage.setItem("chatModelProviderId", e), localStorage.setItem("chatModelKey", n);
2129
2127
  };
2130
- return /* @__PURE__ */ F(Qn, { children: [/* @__PURE__ */ F($n, {
2128
+ return /* @__PURE__ */ F(qn, { children: [/* @__PURE__ */ F(Jn, {
2131
2129
  className: "gap-2",
2132
2130
  children: [
2133
- /* @__PURE__ */ P(de, { className: "w-4 h-4 flex-shrink-0 text-sky-500" }),
2131
+ /* @__PURE__ */ P(fe, { className: "w-4 h-4 flex-shrink-0 text-sky-500" }),
2134
2132
  /* @__PURE__ */ P("span", { children: "Model" }),
2135
2133
  /* @__PURE__ */ P("span", {
2136
2134
  className: "ml-auto text-xs text-muted-foreground truncate max-w-[55px]",
2137
2135
  children: s
2138
2136
  })
2139
2137
  ]
2140
- }), /* @__PURE__ */ F(er, {
2138
+ }), /* @__PURE__ */ F(Yn, {
2141
2139
  className: "w-52 max-h-[400px] overflow-y-auto",
2142
2140
  children: [
2143
2141
  i ? /* @__PURE__ */ P("div", {
2144
2142
  className: "flex items-center justify-center py-4",
2145
- children: /* @__PURE__ */ P(G, { className: "h-4 w-4 animate-spin text-muted-foreground" })
2143
+ children: /* @__PURE__ */ P(W, { className: "h-4 w-4 animate-spin text-muted-foreground" })
2146
2144
  }) : n.length === 0 ? /* @__PURE__ */ P("div", {
2147
2145
  className: "px-3 py-2 text-xs text-muted-foreground",
2148
2146
  children: "No models configured"
2149
2147
  }) : n.map((t, r) => /* @__PURE__ */ F("div", { children: [
2150
- /* @__PURE__ */ P(Zn, {
2148
+ /* @__PURE__ */ P(Kn, {
2151
2149
  className: "text-[10px] uppercase tracking-wider text-muted-foreground font-medium",
2152
2150
  children: t.name
2153
2151
  }),
@@ -2155,7 +2153,7 @@ var mr = [
2155
2153
  onSelect: () => c(t.id, n.key),
2156
2154
  className: h("gap-2", e?.providerId === t.id && e?.key === n.key && "bg-secondary"),
2157
2155
  children: [
2158
- /* @__PURE__ */ P(de, { className: h("h-3.5 w-3.5 flex-shrink-0", e?.providerId === t.id && e?.key === n.key ? "text-sky-500" : "text-muted-foreground") }),
2156
+ /* @__PURE__ */ P(fe, { className: h("h-3.5 w-3.5 flex-shrink-0", e?.providerId === t.id && e?.key === n.key ? "text-sky-500" : "text-muted-foreground") }),
2159
2157
  /* @__PURE__ */ P("span", {
2160
2158
  className: "truncate",
2161
2159
  children: n.name
@@ -2180,13 +2178,13 @@ var mr = [
2180
2178
  /* @__PURE__ */ F(X, {
2181
2179
  onSelect: () => o.push("/settings?section=models"),
2182
2180
  className: "gap-2",
2183
- children: [/* @__PURE__ */ P(Be, { className: "h-3.5 w-3.5 text-sky-500 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Add model" })]
2181
+ children: [/* @__PURE__ */ P(Ve, { className: "h-3.5 w-3.5 text-sky-500 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Add model" })]
2184
2182
  })
2185
2183
  ]
2186
2184
  })] });
2187
2185
  };
2188
2186
  // src/components/ChatHistoryDropdown/useRecentChats.ts
2189
- function gr(e) {
2187
+ function dr(e) {
2190
2188
  let t = e.messages?.[e.messages.length - 1], n = t && "createdAt" in t ? t.createdAt : void 0;
2191
2189
  if (n) {
2192
2190
  let e = new Date(n).getTime();
@@ -2194,27 +2192,27 @@ function gr(e) {
2194
2192
  }
2195
2193
  return e.createdAt;
2196
2194
  }
2197
- var _r = (e) => new Date(e.lastMessageAt || e.createdAt).getTime();
2198
- function vr() {
2199
- return dn().map((e) => ({
2195
+ var fr = (e) => new Date(e.lastMessageAt || e.createdAt).getTime();
2196
+ function pr() {
2197
+ return Y().map((e) => ({
2200
2198
  ...e,
2201
2199
  messageCount: e.messages?.filter((e) => e.role === "user").length ?? 0,
2202
- lastMessageAt: gr(e)
2200
+ lastMessageAt: dr(e)
2203
2201
  }));
2204
2202
  }
2205
- function yr(e = 10) {
2203
+ function mr(e = 10) {
2206
2204
  let [t, r] = O([]), [i, a] = O(!1), { isAuthenticated: o, isLoading: s } = n(), c = D(!1), l = C(async (e = !1) => {
2207
2205
  if (!s && (!c.current || e)) {
2208
2206
  c.current = !0, a(!0);
2209
2207
  try {
2210
2208
  if (o) {
2211
- let { data: e, error: t } = await _t();
2209
+ let { data: e, error: t } = await vt();
2212
2210
  if (t) {
2213
- r(vr());
2211
+ r(pr());
2214
2212
  return;
2215
2213
  }
2216
2214
  r(Array.isArray(e?.chats) ? e.chats : []);
2217
- } else r(vr());
2215
+ } else r(pr());
2218
2216
  } catch (e) {
2219
2217
  console.error("Failed to fetch recent chats:", e), r([]);
2220
2218
  } finally {
@@ -2223,13 +2221,13 @@ function yr(e = 10) {
2223
2221
  }
2224
2222
  }, [o, s]);
2225
2223
  return {
2226
- recentChats: [...t].sort((e, t) => _r(t) - _r(e)).slice(0, e),
2224
+ recentChats: [...t].sort((e, t) => fr(t) - fr(e)).slice(0, e),
2227
2225
  loading: i,
2228
2226
  load: l
2229
2227
  };
2230
2228
  }
2231
2229
  // src/lib/relative-time.ts
2232
- function br(e) {
2230
+ function hr(e) {
2233
2231
  let t = new Date(e).getTime();
2234
2232
  if (Number.isNaN(t)) return "";
2235
2233
  let n = Math.round((Date.now() - t) / 1e3);
@@ -2249,34 +2247,34 @@ function br(e) {
2249
2247
  return `${c} year${c === 1 ? "" : "s"}`;
2250
2248
  }
2251
2249
  // src/components/ChatHistoryDropdown/HistorySubmenu.tsx
2252
- var xr = 10, Sr = () => {
2253
- let e = j(), { incognito: n, setIncognito: r } = u(), { recentChats: i, loading: a, load: o } = yr(xr), s = (e) => {
2254
- r(e), K.success(e ? "Private mode on — messages won't be saved" : "Private mode off");
2250
+ var gr = 10, _r = () => {
2251
+ let e = j(), { incognito: n, setIncognito: r } = u(), { recentChats: i, loading: a, load: o } = mr(gr), s = (e) => {
2252
+ r(e), G.success(e ? "Private mode on — messages won't be saved" : "Private mode off");
2255
2253
  }, c = (n) => {
2256
2254
  t.onOpenChat?.(n) || e.push(`/c/${n}`);
2257
2255
  };
2258
- return /* @__PURE__ */ F(Qn, {
2256
+ return /* @__PURE__ */ F(qn, {
2259
2257
  onOpenChange: (e) => {
2260
2258
  e && o();
2261
2259
  },
2262
- children: [/* @__PURE__ */ F($n, {
2260
+ children: [/* @__PURE__ */ F(Jn, {
2263
2261
  className: "gap-2",
2264
- children: [/* @__PURE__ */ P(we, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "History" })]
2265
- }), /* @__PURE__ */ F(er, {
2262
+ children: [/* @__PURE__ */ P(Te, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "History" })]
2263
+ }), /* @__PURE__ */ F(Yn, {
2266
2264
  className: "w-64 max-h-[70vh] overflow-y-auto",
2267
2265
  children: [
2268
- /* @__PURE__ */ F(Xn, {
2266
+ /* @__PURE__ */ F(Gn, {
2269
2267
  checked: n,
2270
2268
  onCheckedChange: s,
2271
2269
  onSelect: (e) => e.preventDefault(),
2272
2270
  className: "gap-2",
2273
- children: [/* @__PURE__ */ P(me, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Private" })]
2271
+ children: [/* @__PURE__ */ P(he, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Private" })]
2274
2272
  }),
2275
2273
  /* @__PURE__ */ P(Z, {}),
2276
2274
  a ? /* @__PURE__ */ F(X, {
2277
2275
  disabled: !0,
2278
2276
  className: "gap-2",
2279
- children: [/* @__PURE__ */ P(G, { className: "w-3.5 h-3.5 animate-spin flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Loading…" })]
2277
+ children: [/* @__PURE__ */ P(W, { className: "w-3.5 h-3.5 animate-spin flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Loading…" })]
2280
2278
  }) : i.length === 0 ? /* @__PURE__ */ P(X, {
2281
2279
  disabled: !0,
2282
2280
  children: /* @__PURE__ */ P("span", {
@@ -2284,7 +2282,7 @@ var xr = 10, Sr = () => {
2284
2282
  children: "No recent chats"
2285
2283
  })
2286
2284
  }) : i.map((e) => {
2287
- let t = br(e.lastMessageAt || e.createdAt);
2285
+ let t = hr(e.lastMessageAt || e.createdAt);
2288
2286
  return /* @__PURE__ */ F(X, {
2289
2287
  onSelect: () => c(e.id),
2290
2288
  className: "gap-2",
@@ -2302,15 +2300,15 @@ var xr = 10, Sr = () => {
2302
2300
  /* @__PURE__ */ F(X, {
2303
2301
  onSelect: () => e.push("/library"),
2304
2302
  className: "gap-2",
2305
- children: [/* @__PURE__ */ P(we, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "All history" })]
2303
+ children: [/* @__PURE__ */ P(Te, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "All history" })]
2306
2304
  })
2307
2305
  ]
2308
2306
  })]
2309
2307
  });
2310
- }, Cr = /* @__PURE__ */ new Map();
2311
- function wr(e) {
2308
+ }, vr = /* @__PURE__ */ new Map();
2309
+ function yr(e) {
2312
2310
  if (typeof window > "u") return Promise.reject(/* @__PURE__ */ Error("CDN scripts require a browser environment"));
2313
- let t = Cr.get(e);
2311
+ let t = vr.get(e);
2314
2312
  if (t) return t;
2315
2313
  let n = new Promise((t, n) => {
2316
2314
  let r = document.querySelector(`script[data-cdn-loader="${e}"]`);
@@ -2322,34 +2320,34 @@ function wr(e) {
2322
2320
  i.src = e, i.async = !0, i.dataset.cdnLoader = e, i.onload = () => {
2323
2321
  i.dataset.loaded = "true", t();
2324
2322
  }, i.onerror = () => {
2325
- Cr.delete(e), n(/* @__PURE__ */ Error(`Failed to load ${e}`));
2323
+ vr.delete(e), n(/* @__PURE__ */ Error(`Failed to load ${e}`));
2326
2324
  }, document.head.appendChild(i);
2327
2325
  });
2328
- return Cr.set(e, n), n;
2326
+ return vr.set(e, n), n;
2329
2327
  }
2330
- var Tr = "https://cdn.jsdelivr.net/npm/jspdf@2.5.2/dist/jspdf.umd.min.js", Er = "https://cdn.jsdelivr.net/npm/docx@9.5.1/build/index.umd.min.js";
2331
- async function Dr() {
2332
- await wr(Tr);
2328
+ var br = "https://cdn.jsdelivr.net/npm/jspdf@2.5.2/dist/jspdf.umd.min.js", xr = "https://cdn.jsdelivr.net/npm/docx@9.5.1/build/index.umd.min.js";
2329
+ async function Sr() {
2330
+ await yr(br);
2333
2331
  let e = window.jspdf?.jsPDF;
2334
2332
  if (!e) throw Error("jsPDF global not found after CDN load");
2335
2333
  return e;
2336
2334
  }
2337
- async function Or() {
2338
- await wr(Er);
2335
+ async function Cr() {
2336
+ await yr(xr);
2339
2337
  let e = window.docx;
2340
2338
  if (!e) throw Error("docx global not found after CDN load");
2341
2339
  return e;
2342
2340
  }
2343
2341
  // src/lib/export.ts
2344
- async function kr(e, t) {
2342
+ async function wr(e, t) {
2345
2343
  let { default: n } = await import("turndown");
2346
- Nr(`# ${e}\n\n${new n({
2344
+ Or(`# ${e}\n\n${new n({
2347
2345
  headingStyle: "atx",
2348
2346
  codeBlockStyle: "fenced"
2349
2347
  }).turndown(t)}`, `${e}.md`, "text/markdown");
2350
2348
  }
2351
- async function Ar(e, t) {
2352
- let { Document: n, Paragraph: r, TextRun: i, HeadingLevel: a, Packer: o } = await Or(), s = new DOMParser().parseFromString(t, "text/html"), c = [];
2349
+ async function Tr(e, t) {
2350
+ let { Document: n, Paragraph: r, TextRun: i, HeadingLevel: a, Packer: o } = await Cr(), s = new DOMParser().parseFromString(t, "text/html"), c = [];
2353
2351
  c.push(new r({
2354
2352
  text: e,
2355
2353
  heading: a.HEADING_1,
@@ -2423,14 +2421,14 @@ async function Ar(e, t) {
2423
2421
  }] }), d = await o.toBlob(u), f = URL.createObjectURL(d), p = document.createElement("a");
2424
2422
  p.href = f, p.download = `${e}.docx`, p.click(), URL.revokeObjectURL(f);
2425
2423
  }
2426
- async function jr(e, t) {
2424
+ async function Er(e, t) {
2427
2425
  let n = document.createElement("div");
2428
2426
  n.style.position = "absolute", n.style.left = "-9999px", n.style.width = "210mm", n.style.padding = "20mm", n.style.backgroundColor = "white", n.style.fontFamily = "Arial, sans-serif", n.style.fontSize = "12pt", n.style.lineHeight = "1.6", n.innerHTML = `
2429
2427
  <h1 style="font-size: 24pt; margin-bottom: 20px;">${e}</h1>
2430
2428
  ${t}
2431
2429
  `, document.body.appendChild(n);
2432
2430
  try {
2433
- let [t, { default: r }] = await Promise.all([Dr(), import("html2canvas")]), i = await r(n, {
2431
+ let [t, { default: r }] = await Promise.all([Sr(), import("html2canvas")]), i = await r(n, {
2434
2432
  scale: 2,
2435
2433
  useCORS: !0,
2436
2434
  logging: !1
@@ -2445,7 +2443,7 @@ async function jr(e, t) {
2445
2443
  document.body.removeChild(n);
2446
2444
  }
2447
2445
  }
2448
- async function Mr(e, t) {
2446
+ async function Dr(e, t) {
2449
2447
  try {
2450
2448
  let { default: n } = await import("turndown"), r = `${e}\n\n${new n().turndown(t)}`;
2451
2449
  await navigator.clipboard.writeText(r), window.open("https://docs.google.com/document/create", "_blank"), alert("Content copied to clipboard! Paste it into the new Google Doc.");
@@ -2453,12 +2451,12 @@ async function Mr(e, t) {
2453
2451
  console.error("Failed to export to Google Docs:", e), alert("Failed to copy content to clipboard. Please try again.");
2454
2452
  }
2455
2453
  }
2456
- function Nr(e, t, n) {
2454
+ function Or(e, t, n) {
2457
2455
  let r = new Blob([e], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
2458
2456
  a.href = i, a.download = t, a.click(), URL.revokeObjectURL(i);
2459
2457
  }
2460
2458
  // src/components/FileUpload/FileUploadDropdown.tsx
2461
- var Pr = [
2459
+ var kr = [
2462
2460
  {
2463
2461
  label: "5s",
2464
2462
  value: 5
@@ -2483,28 +2481,28 @@ var Pr = [
2483
2481
  label: "Unlimited",
2484
2482
  value: 0
2485
2483
  }
2486
- ], Fr = [
2484
+ ], Ar = [
2487
2485
  "pdf",
2488
2486
  "docx",
2489
2487
  "txt",
2490
2488
  "md",
2491
2489
  "html",
2492
2490
  "htm"
2493
- ], Ir = /* @__PURE__ */ "markdown.js.jsx.ts.tsx.py.rb.go.rs.java.c.cpp.h.hpp.cs.swift.kt.sh.bash.zsh.json.yaml.yml.toml.ini.cfg.conf.xml.csv.tsv.log.env.sql.graphql.vue.svelte.astro.css.scss.less.sass.tex.bib.rst.adoc.org".split("."), Lr = ({ onFileSelect: e, disabled: r = !1 }) => {
2494
- let i = j(), { category: a, setCategory: o, sections: s, chatId: c } = u(), { isAuthenticated: l } = n(), d = a ? a.split(",").filter(Boolean) : ["general"], f = mr.find((e) => e.code === d[0]) || mr[0], p = (e) => {
2491
+ ], jr = /* @__PURE__ */ "markdown.js.jsx.ts.tsx.py.rb.go.rs.java.c.cpp.h.hpp.cs.swift.kt.sh.bash.zsh.json.yaml.yml.toml.ini.cfg.conf.xml.csv.tsv.log.env.sql.graphql.vue.svelte.astro.css.scss.less.sass.tex.bib.rst.adoc.org".split("."), Mr = ({ onFileSelect: e, disabled: r = !1 }) => {
2492
+ let i = j(), { category: a, setCategory: o, sections: s, chatId: c } = u(), { isAuthenticated: l } = n(), d = a ? a.split(",").filter(Boolean) : ["general"], f = lr.find((e) => e.code === d[0]) || lr[0], p = (e) => {
2495
2493
  let t = a ? a.split(",").filter(Boolean) : ["general"], n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
2496
2494
  o(n.length > 0 ? n.join(",") : "general");
2497
2495
  }, [m, g] = O(!1), [_, y] = O(!1), [b, x] = O(!1), [S, C] = O(!1), [w, E] = O(() => {
2498
2496
  if (typeof window > "u") return 5;
2499
2497
  let e = Number(localStorage.getItem("thinkingTimeLimit") ?? "5");
2500
2498
  return Number.isFinite(e) ? e : 5;
2501
- }), D = v.useRef(null), { openPicker: k } = or();
2499
+ }), D = v.useRef(null), { openPicker: k } = tr();
2502
2500
  T(() => {
2503
2501
  A();
2504
2502
  }, []);
2505
2503
  let A = async () => {
2506
2504
  try {
2507
- let { data: e } = await gt();
2505
+ let { data: e } = await _t();
2508
2506
  g(e?.isConnected || !1);
2509
2507
  } catch {}
2510
2508
  }, M = (e) => {
@@ -2542,8 +2540,8 @@ var Pr = [
2542
2540
  let n = [];
2543
2541
  for await (let r of e.values()) if (r.kind === "file") {
2544
2542
  let e = await r.getFile(), i = e.name.split(".").pop()?.toLowerCase() ?? "";
2545
- if (Fr.includes(i)) n.push(e);
2546
- else if (Ir.includes(i)) try {
2543
+ if (Ar.includes(i)) n.push(e);
2544
+ else if (jr.includes(i)) try {
2547
2545
  let r = await e.text(), i = t ? `${t}/${e.name}` : e.name;
2548
2546
  n.push(new File([r], `${i.replace(/[/\\]/g, "_")}.txt`, { type: "text/plain" }));
2549
2547
  } catch {}
@@ -2570,7 +2568,7 @@ var Pr = [
2570
2568
  }, z = async () => {
2571
2569
  y(!0);
2572
2570
  try {
2573
- let { data: e } = await ht();
2571
+ let { data: e } = await gt();
2574
2572
  if (e?.success && e?.data?.authUrl) {
2575
2573
  let t = e.data.authUrl, n = window.screenX + (window.outerWidth - 600) / 2, r = window.screenY + (window.outerHeight - 700) / 2, i = window.open(t, "Google Drive Authorization", `width=600,height=700,left=${n},top=${r}`), a = (e) => {
2576
2574
  e.data.type === "google-drive-connected" && (g(!0), i?.close(), window.removeEventListener("message", a));
@@ -2584,14 +2582,14 @@ var Pr = [
2584
2582
  }
2585
2583
  }, B = async () => {
2586
2584
  try {
2587
- let { data: t } = await mt();
2585
+ let { data: t } = await ht();
2588
2586
  if (!t?.success || !t.accessToken) throw Error("Failed to get access token");
2589
2587
  await k(t.accessToken, async (t) => {
2590
2588
  x(!0);
2591
2589
  try {
2592
2590
  let n = [];
2593
2591
  for (let e of t) {
2594
- let { data: t } = await pt({ query: { fileId: e.id } });
2592
+ let { data: t } = await mt({ query: { fileId: e.id } });
2595
2593
  if (t?.success && t?.file) {
2596
2594
  let e = atob(t.file.content), r = new Uint8Array(e.length);
2597
2595
  for (let t = 0; t < e.length; t++) r[t] = e.charCodeAt(t);
@@ -2610,32 +2608,32 @@ var Pr = [
2610
2608
  } catch (e) {
2611
2609
  alert(e.message || "Failed to open Google Drive picker");
2612
2610
  }
2613
- }, V = Pr.find((e) => e.value === w)?.label ?? "Unlimited";
2611
+ }, V = kr.find((e) => e.value === w)?.label ?? "Unlimited";
2614
2612
  return /* @__PURE__ */ F(N, { children: [
2615
2613
  /* @__PURE__ */ F("div", {
2616
2614
  className: "relative flex shrink min-w-8 !shrink-0 group",
2617
- children: [/* @__PURE__ */ F(qn, { children: [/* @__PURE__ */ P(Jn, {
2615
+ children: [/* @__PURE__ */ F(Hn, { children: [/* @__PURE__ */ P(Un, {
2618
2616
  asChild: !0,
2619
2617
  children: /* @__PURE__ */ P("button", {
2620
2618
  disabled: r,
2621
2619
  className: "inline-flex items-center justify-center relative shrink-0 transition-colors duration-200 h-8 w-8 rounded-lg active:scale-95 text-text-400 hover:text-text-200 hover:bg-bg-200 disabled:opacity-50 disabled:cursor-not-allowed group-active:scale-95",
2622
2620
  type: "button",
2623
2621
  "aria-label": "Search options",
2624
- children: /* @__PURE__ */ P(Ge, { className: "w-5 h-5" })
2622
+ children: /* @__PURE__ */ P(Ke, { className: "w-5 h-5" })
2625
2623
  })
2626
- }), /* @__PURE__ */ F(Yn, {
2624
+ }), /* @__PURE__ */ F(Wn, {
2627
2625
  align: "start",
2628
2626
  side: "top",
2629
2627
  sideOffset: 8,
2630
2628
  className: "w-44",
2631
2629
  children: [
2632
- /* @__PURE__ */ F(Qn, { children: [/* @__PURE__ */ F($n, {
2630
+ /* @__PURE__ */ F(qn, { children: [/* @__PURE__ */ F(Jn, {
2633
2631
  className: "gap-2",
2634
2632
  children: [f && /* @__PURE__ */ P(f.icon, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Category" })]
2635
- }), /* @__PURE__ */ F(er, {
2633
+ }), /* @__PURE__ */ F(Yn, {
2636
2634
  className: "w-44",
2637
2635
  children: [
2638
- /* @__PURE__ */ F(Xn, {
2636
+ /* @__PURE__ */ F(Gn, {
2639
2637
  checked: d.length === 0,
2640
2638
  onCheckedChange: () => o("general"),
2641
2639
  onSelect: (e) => e.preventDefault(),
@@ -2643,7 +2641,7 @@ var Pr = [
2643
2641
  children: [/* @__PURE__ */ P("div", { className: "w-3.5 h-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "None" })]
2644
2642
  }),
2645
2643
  /* @__PURE__ */ P(Z, {}),
2646
- mr.map((e) => /* @__PURE__ */ F(Xn, {
2644
+ lr.map((e) => /* @__PURE__ */ F(Gn, {
2647
2645
  checked: d.includes(e.code),
2648
2646
  onCheckedChange: () => p(e.code),
2649
2647
  onSelect: (e) => e.preventDefault(),
@@ -2652,19 +2650,19 @@ var Pr = [
2652
2650
  }, e.code))
2653
2651
  ]
2654
2652
  })] }),
2655
- /* @__PURE__ */ F(Qn, { children: [/* @__PURE__ */ F($n, {
2653
+ /* @__PURE__ */ F(qn, { children: [/* @__PURE__ */ F(Jn, {
2656
2654
  className: "gap-2",
2657
2655
  children: [
2658
- /* @__PURE__ */ P(se, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }),
2656
+ /* @__PURE__ */ P(ce, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }),
2659
2657
  /* @__PURE__ */ P("span", { children: "Speed" }),
2660
2658
  /* @__PURE__ */ P("span", {
2661
2659
  className: "ml-auto text-xs text-muted-foreground",
2662
2660
  children: V
2663
2661
  })
2664
2662
  ]
2665
- }), /* @__PURE__ */ P(er, {
2663
+ }), /* @__PURE__ */ P(Yn, {
2666
2664
  className: "w-36",
2667
- children: Pr.map((e) => /* @__PURE__ */ F(X, {
2665
+ children: kr.map((e) => /* @__PURE__ */ F(X, {
2668
2666
  onSelect: () => M(e.value),
2669
2667
  className: h("justify-between", w === e.value && "bg-secondary"),
2670
2668
  children: [/* @__PURE__ */ P("span", { children: e.label }), w === e.value && /* @__PURE__ */ P("svg", {
@@ -2682,27 +2680,27 @@ var Pr = [
2682
2680
  }, e.value))
2683
2681
  })] }),
2684
2682
  /* @__PURE__ */ P(Z, {}),
2685
- /* @__PURE__ */ P(hr, {}),
2683
+ /* @__PURE__ */ P(ur, {}),
2686
2684
  /* @__PURE__ */ P(Z, {}),
2687
- /* @__PURE__ */ F(Qn, { children: [/* @__PURE__ */ F($n, {
2685
+ /* @__PURE__ */ F(qn, { children: [/* @__PURE__ */ F(Jn, {
2688
2686
  className: "gap-2",
2689
- children: [/* @__PURE__ */ P(et, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Upload" })]
2690
- }), /* @__PURE__ */ F(er, {
2687
+ children: [/* @__PURE__ */ P(tt, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Upload" })]
2688
+ }), /* @__PURE__ */ F(Yn, {
2691
2689
  className: "w-44",
2692
2690
  children: [
2693
2691
  /* @__PURE__ */ F(X, {
2694
2692
  onSelect: I,
2695
2693
  className: "gap-2",
2696
- children: [/* @__PURE__ */ P(et, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Your Device" })]
2694
+ children: [/* @__PURE__ */ P(tt, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Your Device" })]
2697
2695
  }),
2698
2696
  /* @__PURE__ */ F(X, {
2699
2697
  onSelect: R,
2700
2698
  disabled: S,
2701
2699
  className: "gap-2",
2702
- children: [S ? /* @__PURE__ */ P(G, { className: "h-3.5 w-3.5 animate-spin flex-shrink-0" }) : /* @__PURE__ */ P(be, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: S ? "Scanning…" : "Local Folder" })]
2700
+ children: [S ? /* @__PURE__ */ P(W, { className: "h-3.5 w-3.5 animate-spin flex-shrink-0" }) : /* @__PURE__ */ P(xe, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: S ? "Scanning…" : "Local Folder" })]
2703
2701
  }),
2704
2702
  /* @__PURE__ */ P(Z, {}),
2705
- /* @__PURE__ */ P(Zn, {
2703
+ /* @__PURE__ */ P(Kn, {
2706
2704
  className: "text-xs font-normal text-muted-foreground",
2707
2705
  children: "Cloud"
2708
2706
  }),
@@ -2710,44 +2708,44 @@ var Pr = [
2710
2708
  onSelect: B,
2711
2709
  disabled: b,
2712
2710
  className: "gap-2",
2713
- children: [b ? /* @__PURE__ */ P(G, { className: "h-3.5 w-3.5 animate-spin flex-shrink-0" }) : /* @__PURE__ */ P(le, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: b ? "Loading…" : "Google Drive" })]
2711
+ children: [b ? /* @__PURE__ */ P(W, { className: "h-3.5 w-3.5 animate-spin flex-shrink-0" }) : /* @__PURE__ */ P(ue, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: b ? "Loading…" : "Google Drive" })]
2714
2712
  }) : /* @__PURE__ */ F(X, {
2715
2713
  onSelect: z,
2716
2714
  disabled: _,
2717
2715
  className: "gap-2",
2718
- children: [_ ? /* @__PURE__ */ P(G, { className: "h-3.5 w-3.5 animate-spin flex-shrink-0" }) : /* @__PURE__ */ P(le, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: _ ? "Connecting…" : "Connect Google Drive" })]
2716
+ children: [_ ? /* @__PURE__ */ P(W, { className: "h-3.5 w-3.5 animate-spin flex-shrink-0" }) : /* @__PURE__ */ P(ue, { className: "h-3.5 w-3.5 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: _ ? "Connecting…" : "Connect Google Drive" })]
2719
2717
  })
2720
2718
  ]
2721
2719
  })] }),
2722
2720
  /* @__PURE__ */ P(Z, {}),
2723
- s.length > 0 && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F(Qn, { children: [/* @__PURE__ */ F($n, {
2721
+ s.length > 0 && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F(qn, { children: [/* @__PURE__ */ F(Jn, {
2724
2722
  className: "gap-2",
2725
- children: [/* @__PURE__ */ P(We, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Share" })]
2726
- }), /* @__PURE__ */ F(er, {
2723
+ children: [/* @__PURE__ */ P(Ge, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Share" })]
2724
+ }), /* @__PURE__ */ F(Yn, {
2727
2725
  className: "w-48",
2728
2726
  children: [
2729
2727
  /* @__PURE__ */ F(X, {
2730
2728
  onSelect: async () => {
2731
- if (!c) K.error("No chat to share");
2732
- else if (!l) K.error("Please sign in to share chats");
2729
+ if (!c) G.error("No chat to share");
2730
+ else if (!l) G.error("Please sign in to share chats");
2733
2731
  else try {
2734
- let { data: e, error: t } = await xt({ body: { chatId: c } });
2735
- if (!t && e?.success && e?.data?.shareUrl) await navigator.clipboard.writeText(e.data.shareUrl), K.success("Chat is now public - link copied to clipboard");
2732
+ let { data: e, error: t } = await St({ body: { chatId: c } });
2733
+ if (!t && e?.success && e?.data?.shareUrl) await navigator.clipboard.writeText(e.data.shareUrl), G.success("Chat is now public - link copied to clipboard");
2736
2734
  else throw Error(t?.error || "Failed to share chat");
2737
2735
  } catch (e) {
2738
2736
  console.error("Error sharing chat:", e);
2739
2737
  let t = e instanceof Error ? e.message : "Failed to share chat";
2740
- K.error(t);
2738
+ G.error(t);
2741
2739
  }
2742
2740
  },
2743
2741
  className: "gap-2",
2744
- children: [/* @__PURE__ */ P(De, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Copy link" })]
2742
+ children: [/* @__PURE__ */ P(Oe, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Copy link" })]
2745
2743
  }),
2746
2744
  /* @__PURE__ */ F(X, {
2747
2745
  onSelect: async () => {
2748
2746
  let e = s[0]?.userMessage?.content || "Chat", t = s.map((e) => `## ${e.userMessage.content}\n\n${e.assistantMessage?.content || ""}`).join("\n\n---\n\n");
2749
2747
  try {
2750
- await ct({ body: {
2748
+ await lt({ body: {
2751
2749
  title: e,
2752
2750
  name: e,
2753
2751
  content: t,
@@ -2755,9 +2753,9 @@ var Pr = [
2755
2753
  source: "chat",
2756
2754
  chatId: window.location.pathname
2757
2755
  }
2758
- } }), K.success("Saved to QwkDocs");
2756
+ } }), G.success("Saved to QwkDocs");
2759
2757
  } catch {
2760
- K.error("Failed to save to QwkDocs");
2758
+ G.error("Failed to save to QwkDocs");
2761
2759
  }
2762
2760
  },
2763
2761
  className: "gap-2",
@@ -2766,41 +2764,41 @@ var Pr = [
2766
2764
  /* @__PURE__ */ P(Z, {}),
2767
2765
  /* @__PURE__ */ F(X, {
2768
2766
  onSelect: () => {
2769
- kr(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2767
+ wr(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2770
2768
  },
2771
2769
  className: "gap-2",
2772
- children: [/* @__PURE__ */ P(ve, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export as Markdown" })]
2770
+ children: [/* @__PURE__ */ P(ye, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export as Markdown" })]
2773
2771
  }),
2774
2772
  /* @__PURE__ */ F(X, {
2775
2773
  onSelect: () => {
2776
- jr(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2774
+ Er(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2777
2775
  },
2778
2776
  className: "gap-2",
2779
- children: [/* @__PURE__ */ P(ye, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export as PDF" })]
2777
+ children: [/* @__PURE__ */ P(be, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export as PDF" })]
2780
2778
  }),
2781
2779
  /* @__PURE__ */ F(X, {
2782
2780
  onSelect: () => {
2783
- Ar(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2781
+ Tr(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2784
2782
  },
2785
2783
  className: "gap-2",
2786
- children: [/* @__PURE__ */ P(ge, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export as DOCX" })]
2784
+ children: [/* @__PURE__ */ P(_e, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export as DOCX" })]
2787
2785
  }),
2788
2786
  /* @__PURE__ */ F(X, {
2789
2787
  onSelect: () => {
2790
- Mr(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2788
+ Dr(s[0]?.userMessage?.content || "Chat", s.map((e) => `<h2>${e.userMessage.content}</h2>${e.assistantMessage?.content || ""}`).join("\n"));
2791
2789
  },
2792
2790
  className: "gap-2",
2793
- children: [/* @__PURE__ */ P(_e, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export to Google Docs" })]
2791
+ children: [/* @__PURE__ */ P(ve, { className: "w-4 h-4 flex-shrink-0" }), /* @__PURE__ */ P("span", { children: "Export to Google Docs" })]
2794
2792
  })
2795
2793
  ]
2796
2794
  })] }), /* @__PURE__ */ P(Z, {})] }),
2797
- /* @__PURE__ */ P(Sr, {}),
2795
+ /* @__PURE__ */ P(_r, {}),
2798
2796
  /* @__PURE__ */ F(X, {
2799
2797
  onSelect: () => {
2800
2798
  t.onOpenSettings?.() || i.push("/settings");
2801
2799
  },
2802
2800
  className: "gap-2",
2803
- children: [/* @__PURE__ */ P(He, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Settings" })]
2801
+ children: [/* @__PURE__ */ P(Ue, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), /* @__PURE__ */ P("span", { children: "Settings" })]
2804
2802
  })
2805
2803
  ]
2806
2804
  })] }), /* @__PURE__ */ P("div", {
@@ -2819,7 +2817,7 @@ var Pr = [
2819
2817
  onClick: I,
2820
2818
  "aria-label": "Attach files",
2821
2819
  className: "inline-flex items-center justify-center relative shrink-0 transition-colors duration-200 h-7 w-7 rounded-md active:scale-95 text-text-400 hover:text-text-200 hover:bg-bg-200 disabled:opacity-50 disabled:cursor-not-allowed group-active:scale-95",
2822
- children: /* @__PURE__ */ P(Le, { className: "w-[18px] h-[18px]" })
2820
+ children: /* @__PURE__ */ P(Re, { className: "w-[18px] h-[18px]" })
2823
2821
  }), /* @__PURE__ */ P("div", {
2824
2822
  className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-[#1F1E1D] dark:bg-[#EEEEEC] text-[11px] font-medium rounded-[6px] opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-50 shadow-sm tracking-wide",
2825
2823
  children: /* @__PURE__ */ P("span", {
@@ -2838,7 +2836,7 @@ var Pr = [
2838
2836
  className: "hidden"
2839
2837
  })
2840
2838
  ] });
2841
- }, Rr = x(({ active: e = !1, processing: t = !1, barWidth: n = 3, barHeight: r = 4, barGap: i = 1, barRadius: a = 1.5, barColor: o, fadeEdges: s = !0, fadeWidth: c = 24, height: l = 64, sensitivity: u = 1, smoothingTimeConstant: d = .8, fftSize: f = 256, historySize: p = 60, updateRate: m = 30, mode: h = "static", onError: g, onStreamReady: _, onStreamEnd: v, className: y, ...b }, x) => {
2839
+ }, Nr = x(({ active: e = !1, processing: t = !1, barWidth: n = 3, barHeight: r = 4, barGap: i = 1, barRadius: a = 1.5, barColor: o, fadeEdges: s = !0, fadeWidth: c = 24, height: l = 64, sensitivity: u = 1, smoothingTimeConstant: d = .8, fftSize: f = 256, historySize: p = 60, updateRate: m = 30, mode: h = "static", onError: g, onStreamReady: _, onStreamEnd: v, className: y, ...b }, x) => {
2842
2840
  let S = D(null), w = D(null), E = D(null), O = D(null), k = D(null), A = D(0), j = D([]), M = D(0), N = D(0), F = C(() => {
2843
2841
  A.current &&= (cancelAnimationFrame(A.current), 0), k.current &&= (k.current.disconnect(), null), O.current &&= (O.current.getTracks().forEach((e) => e.stop()), null), w.current &&= (w.current.close().catch(() => {}), null), E.current = null, j.current = [], v?.();
2844
2842
  }, [v]), I = C((e, t, o, s, c) => {
@@ -2984,10 +2982,10 @@ var Pr = [
2984
2982
  })
2985
2983
  });
2986
2984
  });
2987
- Rr.displayName = "LiveWaveform";
2985
+ Nr.displayName = "LiveWaveform";
2988
2986
  // src/components/MessageComposer/ChatInputBox.tsx
2989
- var zr = async (e, { signal: t, limit: n }) => {
2990
- let { data: r, error: i } = await st({
2987
+ var Pr = async (e, { signal: t, limit: n }) => {
2988
+ let { data: r, error: i } = await ct({
2991
2989
  query: {
2992
2990
  q: e,
2993
2991
  limit: n
@@ -2998,20 +2996,20 @@ var zr = async (e, { signal: t, limit: n }) => {
2998
2996
  suggestions: r?.suggestions ?? [],
2999
2997
  domains: r?.domains ?? []
3000
2998
  };
3001
- }, Br = [
2999
+ }, Fr = [
3002
3000
  "What are you curious to research?",
3003
3001
  "Search the latest news...",
3004
3002
  "Analyze a video, doc, or URL...",
3005
3003
  "Find academic research on...",
3006
3004
  "Compare products to buy..."
3007
- ], Vr = {
3005
+ ], Ir = {
3008
3006
  initial: {},
3009
3007
  animate: { transition: { staggerChildren: .025 } },
3010
3008
  exit: { transition: {
3011
3009
  staggerChildren: .015,
3012
3010
  staggerDirection: -1
3013
3011
  } }
3014
- }, Hr = {
3012
+ }, Lr = {
3015
3013
  initial: {
3016
3014
  opacity: 0,
3017
3015
  filter: "blur(12px)",
@@ -3045,8 +3043,8 @@ var zr = async (e, { signal: t, limit: n }) => {
3045
3043
  }
3046
3044
  }
3047
3045
  }
3048
- }, Ur = ({ onNewChat: e }) => {
3049
- let { loading: t, sendMessage: n, stopStreaming: r, files: i, fileIds: a, setFiles: o, setFileIds: s, newChat: c, sections: l } = u(), [d, f] = O(""), p = D(null), m = D(null), { files: h, setFiles: g, pastedContent: _, setPastedContent: v, isDragging: y, handleFiles: b, onDragOver: x, onDragLeave: S, onDrop: C, handlePaste: w, resetAttachments: E } = Kn({
3046
+ }, Rr = ({ onNewChat: e }) => {
3047
+ let { loading: t, sendMessage: n, stopStreaming: r, files: i, fileIds: a, setFiles: o, setFileIds: s, newChat: c, sections: l } = u(), [d, f] = O(""), p = D(null), m = D(null), { files: h, setFiles: g, pastedContent: _, setPastedContent: v, isDragging: y, handleFiles: b, onDragOver: x, onDragLeave: S, onDrop: C, handlePaste: w, resetAttachments: E } = Vn({
3050
3048
  setMessage: f,
3051
3049
  contextFiles: i,
3052
3050
  contextFileIds: a,
@@ -3054,7 +3052,7 @@ var zr = async (e, { signal: t, limit: n }) => {
3054
3052
  setContextFileIds: s
3055
3053
  }), k = () => {
3056
3054
  f(""), E(), p.current && (p.current.style.height = "auto");
3057
- }, A = D(""), j = (e, t) => e && !/\s$/.test(e) ? `${e} ${t}` : `${e}${t}`, { isListening: M, toggleSpeech: N, isSpeechSupported: R, lastPhrase: z, phraseId: B } = An((e) => {
3055
+ }, A = D(""), j = (e, t) => e && !/\s$/.test(e) ? `${e} ${t}` : `${e}${t}`, { isListening: M, toggleSpeech: N, isSpeechSupported: R, lastPhrase: z, phraseId: B } = Tn((e) => {
3058
3056
  f(() => {
3059
3057
  let t = `${j(A.current, e)} `;
3060
3058
  return A.current = t, t;
@@ -3066,40 +3064,40 @@ var zr = async (e, { signal: t, limit: n }) => {
3066
3064
  }, { onPartial: (e) => f(e ? j(A.current, e) : A.current) });
3067
3065
  T(() => {
3068
3066
  M && (A.current = d);
3069
- }, [M]), zn({
3067
+ }, [M]), Pn({
3070
3068
  isSpeechSupported: R,
3071
3069
  isListening: M,
3072
3070
  toggleSpeech: N
3073
3071
  });
3074
- let [V, H] = O(0), [U, ee] = O(!0), [W, te] = O(!1), { handleKeyDown: ne, ...re } = rn({
3072
+ let [V, H] = O(0), [ee, te] = O(!0), [U, ne] = O(!1), { handleKeyDown: re, ...ie } = $t({
3075
3073
  value: d,
3076
3074
  onChange: f,
3077
- enabled: W,
3078
- fetchSuggestions: zr,
3075
+ enabled: U,
3076
+ fetchSuggestions: Pr,
3079
3077
  anchorRef: m,
3080
3078
  inputRef: p
3081
3079
  });
3082
3080
  T(() => {
3083
- if (W || d) return;
3081
+ if (U || d) return;
3084
3082
  let e = setInterval(() => {
3085
- ee(!1), setTimeout(() => {
3086
- H((e) => (e + 1) % Br.length), ee(!0);
3083
+ te(!1), setTimeout(() => {
3084
+ H((e) => (e + 1) % Fr.length), te(!0);
3087
3085
  }, 400);
3088
3086
  }, 3e3);
3089
3087
  return () => clearInterval(e);
3090
- }, [W, d]), T(() => {
3088
+ }, [U, d]), T(() => {
3091
3089
  let e = (e) => {
3092
- m.current && !m.current.contains(e.target) && (d || te(!1));
3090
+ m.current && !m.current.contains(e.target) && (d || ne(!1));
3093
3091
  };
3094
3092
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
3095
3093
  }, [d]), T(() => {
3096
3094
  p.current && (p.current.style.height = "auto", p.current.style.height = Math.min(p.current.scrollHeight, 384) + "px");
3097
3095
  }, [d]);
3098
- let ie = () => {
3096
+ let ae = () => {
3099
3097
  t || (d.trim() || h.length !== 0 || _.length !== 0) && (n(d), k());
3100
- }, ae = (e) => {
3101
- ne(e) || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), ie());
3102
- }, oe = !!(d.trim() || h.length > 0 || _.length > 0);
3098
+ }, oe = (e) => {
3099
+ re(e) || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), ae());
3100
+ }, se = !!(d.trim() || h.length > 0 || _.length > 0);
3103
3101
  return /* @__PURE__ */ F("div", {
3104
3102
  className: "relative w-full max-w-2xl mx-auto transition-all duration-300 font-sans",
3105
3103
  onDragOver: x,
@@ -3109,27 +3107,27 @@ var zr = async (e, { signal: t, limit: n }) => {
3109
3107
  /* @__PURE__ */ F(L.div, {
3110
3108
  ref: m,
3111
3109
  className: "!box-content flex flex-col mx-2 md:mx-0 items-stretch relative z-10 rounded-[28px] bg-gray-50 dark:bg-[#30302E] border border-bg-300 dark:border-transparent cursor-text font-sans antialiased",
3112
- animate: { boxShadow: W || d ? "0 8px 32px 0 rgba(0,0,0,0.16)" : "0 2px 8px 0 rgba(0,0,0,0.08)" },
3110
+ animate: { boxShadow: U || d ? "0 8px 32px 0 rgba(0,0,0,0.16)" : "0 2px 8px 0 rgba(0,0,0,0.08)" },
3113
3111
  transition: {
3114
3112
  type: "spring",
3115
3113
  stiffness: 120,
3116
3114
  damping: 18
3117
3115
  },
3118
- onClick: () => te(!0),
3116
+ onClick: () => ne(!0),
3119
3117
  children: [
3120
3118
  (h.length > 0 || _.length > 0) && /* @__PURE__ */ F("div", {
3121
3119
  className: "flex gap-3 overflow-x-auto custom-scrollbar px-3 pt-3 pb-1",
3122
- children: [_.map((e) => /* @__PURE__ */ P(sn, {
3120
+ children: [_.map((e) => /* @__PURE__ */ P(nn, {
3123
3121
  content: e,
3124
3122
  onRemove: (e) => v((t) => t.filter((t) => t.id !== e))
3125
- }, e.id)), h.map((e) => /* @__PURE__ */ P(on, {
3123
+ }, e.id)), h.map((e) => /* @__PURE__ */ P(tn, {
3126
3124
  file: e,
3127
3125
  onRemove: (e) => g((t) => t.filter((t) => t.id !== e))
3128
3126
  }, e.id))]
3129
3127
  }),
3130
3128
  M && /* @__PURE__ */ P("div", {
3131
3129
  className: "px-3 pt-2",
3132
- children: /* @__PURE__ */ P(Rr, {
3130
+ children: /* @__PURE__ */ P(Nr, {
3133
3131
  active: M,
3134
3132
  mode: "static",
3135
3133
  height: 48,
@@ -3141,7 +3139,7 @@ var zr = async (e, { signal: t, limit: n }) => {
3141
3139
  className: "w-full rounded-lg"
3142
3140
  })
3143
3141
  }),
3144
- /* @__PURE__ */ P(wt, {
3142
+ /* @__PURE__ */ P(Tt, {
3145
3143
  phrase: z,
3146
3144
  phraseId: B,
3147
3145
  visible: M
@@ -3149,7 +3147,7 @@ var zr = async (e, { signal: t, limit: n }) => {
3149
3147
  /* @__PURE__ */ F("div", {
3150
3148
  className: "flex items-center gap-2 p-3",
3151
3149
  children: [
3152
- /* @__PURE__ */ P(Lr, {
3150
+ /* @__PURE__ */ P(Mr, {
3153
3151
  onFileSelect: b,
3154
3152
  disabled: t
3155
3153
  }),
@@ -3162,8 +3160,8 @@ var zr = async (e, { signal: t, limit: n }) => {
3162
3160
  value: d,
3163
3161
  onChange: (e) => f(e.target.value),
3164
3162
  onPaste: w,
3165
- onKeyDown: ae,
3166
- onFocus: () => te(!0),
3163
+ onKeyDown: oe,
3164
+ onFocus: () => ne(!0),
3167
3165
  className: "w-full bg-transparent border-0 outline-none text-text-200 dark:text-text-100 text-[16px] resize-none overflow-hidden py-1 leading-relaxed block font-normal antialiased",
3168
3166
  rows: 1,
3169
3167
  autoFocus: !0,
@@ -3173,19 +3171,19 @@ var zr = async (e, { signal: t, limit: n }) => {
3173
3171
  className: "absolute left-0 top-0 w-full h-full pointer-events-none flex items-center",
3174
3172
  children: /* @__PURE__ */ P(I, {
3175
3173
  mode: "wait",
3176
- children: U && !W && !d && /* @__PURE__ */ P(L.span, {
3174
+ children: ee && !U && !d && /* @__PURE__ */ P(L.span, {
3177
3175
  className: "absolute left-0 top-1/2 -translate-y-1/2 text-text-400 select-none pointer-events-none text-[16px] font-normal",
3178
3176
  style: {
3179
3177
  whiteSpace: "nowrap",
3180
3178
  overflow: "hidden",
3181
3179
  textOverflow: "ellipsis"
3182
3180
  },
3183
- variants: Vr,
3181
+ variants: Ir,
3184
3182
  initial: "initial",
3185
3183
  animate: "animate",
3186
3184
  exit: "exit",
3187
- children: Br[V].split("").map((e, t) => /* @__PURE__ */ P(L.span, {
3188
- variants: Hr,
3185
+ children: Fr[V].split("").map((e, t) => /* @__PURE__ */ P(L.span, {
3186
+ variants: Lr,
3189
3187
  style: { display: "inline-block" },
3190
3188
  children: e === " " ? "\xA0" : e
3191
3189
  }, t))
@@ -3204,7 +3202,7 @@ var zr = async (e, { signal: t, limit: n }) => {
3204
3202
  ${M ? "text-red-500 bg-red-500/10 animate-pulse" : "text-text-400 hover:text-text-200 hover:bg-bg-200"}
3205
3203
  `,
3206
3204
  "aria-label": M ? "Stop listening" : "Voice input",
3207
- children: /* @__PURE__ */ P(Y.Mic, { className: "w-5 h-5" })
3205
+ children: /* @__PURE__ */ P(J.Mic, { className: "w-5 h-5" })
3208
3206
  }), /* @__PURE__ */ P("div", {
3209
3207
  className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-[#1F1E1D] dark:bg-[#EEEEEC] text-[11px] font-medium rounded-[6px] opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-50 shadow-sm tracking-wide",
3210
3208
  children: /* @__PURE__ */ P("span", {
@@ -3222,7 +3220,7 @@ var zr = async (e, { signal: t, limit: n }) => {
3222
3220
  disabled: t,
3223
3221
  className: "transition-all duration-200 h-8 w-8 flex items-center justify-center rounded-full active:scale-95 text-text-400 hover:text-text-200 hover:bg-bg-200",
3224
3222
  "aria-label": "New chat",
3225
- children: /* @__PURE__ */ P(Y.SquarePen, { className: "w-5 h-5" })
3223
+ children: /* @__PURE__ */ P(J.SquarePen, { className: "w-5 h-5" })
3226
3224
  }), /* @__PURE__ */ P("div", {
3227
3225
  className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-[#1F1E1D] dark:bg-[#EEEEEC] text-[11px] font-medium rounded-[6px] opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-50 shadow-sm tracking-wide",
3228
3226
  children: /* @__PURE__ */ P("span", {
@@ -3240,18 +3238,18 @@ var zr = async (e, { signal: t, limit: n }) => {
3240
3238
  className: "inline-flex items-center justify-center shrink-0 transition-colors h-8 w-8 rounded-full active:scale-95 bg-red-500 text-white hover:bg-red-600 shadow-md",
3241
3239
  type: "button",
3242
3240
  "aria-label": "Stop generating",
3243
- children: /* @__PURE__ */ P(Y.Stop, { className: "w-3.5 h-3.5 fill-current" })
3241
+ children: /* @__PURE__ */ P(J.Stop, { className: "w-3.5 h-3.5 fill-current" })
3244
3242
  }) : /* @__PURE__ */ P("button", {
3245
3243
  onClick: (e) => {
3246
- e.stopPropagation(), ie();
3244
+ e.stopPropagation(), ae();
3247
3245
  },
3248
- disabled: !oe,
3246
+ disabled: !se,
3249
3247
  className: `inline-flex items-center justify-center shrink-0 transition-all duration-200 h-8 w-8 rounded-full active:scale-95
3250
- ${oe ? "bg-accent text-bg-0 hover:bg-accent-hover shadow-md" : "bg-bg-300 text-text-400 cursor-default opacity-50"}
3248
+ ${se ? "bg-accent text-bg-0 hover:bg-accent-hover shadow-md" : "bg-bg-300 text-text-400 cursor-default opacity-50"}
3251
3249
  `,
3252
3250
  type: "button",
3253
3251
  "aria-label": "Send message",
3254
- children: /* @__PURE__ */ P(Y.ArrowUp, { className: "w-4 h-4" })
3252
+ children: /* @__PURE__ */ P(J.ArrowUp, { className: "w-4 h-4" })
3255
3253
  }), /* @__PURE__ */ P("div", {
3256
3254
  className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-[#1F1E1D] dark:bg-[#EEEEEC] text-[11px] font-medium rounded-[6px] opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none z-50 shadow-sm tracking-wide",
3257
3255
  children: /* @__PURE__ */ P("span", {
@@ -3264,42 +3262,42 @@ var zr = async (e, { signal: t, limit: n }) => {
3264
3262
  })
3265
3263
  ]
3266
3264
  }),
3267
- /* @__PURE__ */ P(Zt, { ...re }),
3265
+ /* @__PURE__ */ P(qt, { ...ie }),
3268
3266
  y && /* @__PURE__ */ F("div", {
3269
3267
  className: "absolute inset-0 bg-bg-200/90 border-2 border-dashed border-accent rounded-[28px] z-50 flex flex-col items-center justify-center backdrop-blur-sm pointer-events-none",
3270
- children: [/* @__PURE__ */ P(Y.Archive, { className: "w-10 h-10 text-accent mb-2 animate-bounce" }), /* @__PURE__ */ P("p", {
3268
+ children: [/* @__PURE__ */ P(J.Archive, { className: "w-10 h-10 text-accent mb-2 animate-bounce" }), /* @__PURE__ */ P("p", {
3271
3269
  className: "text-accent font-medium",
3272
3270
  children: "Drop files to upload"
3273
3271
  })]
3274
3272
  })
3275
3273
  ]
3276
3274
  });
3277
- }, Wr = 200, Gr = [
3275
+ }, zr = 200, Br = [
3278
3276
  "message",
3279
3277
  "error",
3280
3278
  "detail"
3281
3279
  ];
3282
- function Kr(e) {
3283
- return e.length > Wr ? `${e.slice(0, 199).trimEnd()}…` : e;
3280
+ function Vr(e) {
3281
+ return e.length > zr ? `${e.slice(0, 199).trimEnd()}…` : e;
3284
3282
  }
3285
- function qr(e, t) {
3283
+ function Hr(e, t) {
3286
3284
  let n = t ? `HTTP ${t}` : "Unknown error";
3287
3285
  if (typeof e == "string") {
3288
3286
  let t = e.trim();
3289
- return !t || t.startsWith("<") ? n : Kr(t);
3287
+ return !t || t.startsWith("<") ? n : Vr(t);
3290
3288
  }
3291
3289
  if (e && typeof e == "object") {
3292
3290
  let t = e;
3293
- for (let e of Gr) {
3291
+ for (let e of Br) {
3294
3292
  let n = t[e];
3295
- if (typeof n == "string" && n.trim()) return Kr(n.trim());
3293
+ if (typeof n == "string" && n.trim()) return Vr(n.trim());
3296
3294
  }
3297
3295
  }
3298
3296
  return n;
3299
3297
  }
3300
3298
  // src/components/ChatHistoryDropdown/useHistoryState.ts
3301
- var Jr = "qwksearch_pinned_chats";
3302
- function Yr(e) {
3299
+ var Ur = "qwksearch_pinned_chats";
3300
+ function Wr(e) {
3303
3301
  let t = e.messages?.[e.messages.length - 1], n = t && "createdAt" in t ? t.createdAt : void 0;
3304
3302
  if (n) {
3305
3303
  let e = new Date(n).getTime();
@@ -3307,27 +3305,27 @@ function Yr(e) {
3307
3305
  }
3308
3306
  return e.createdAt;
3309
3307
  }
3310
- function Xr() {
3308
+ function Gr() {
3311
3309
  if (typeof window > "u") return [];
3312
3310
  try {
3313
- let e = localStorage.getItem(Jr);
3311
+ let e = localStorage.getItem(Ur);
3314
3312
  return e ? JSON.parse(e) : [];
3315
3313
  } catch {
3316
3314
  return [];
3317
3315
  }
3318
3316
  }
3319
- function Zr(e) {
3320
- typeof window < "u" && localStorage.setItem(Jr, JSON.stringify(e));
3317
+ function Kr(e) {
3318
+ typeof window < "u" && localStorage.setItem(Ur, JSON.stringify(e));
3321
3319
  }
3322
- function Qr() {
3320
+ function qr() {
3323
3321
  let [e, t] = O([]), [r, i] = O(!0), [a, o] = O(!1), [s, c] = O(null), [l, d] = O(!1), [f, p] = O(!1), [m, h] = O(!1), [g, _] = O([]), [v, y] = O(""), [b, x] = O([]), [S, w] = O(!1), { isAuthenticated: D, isLoading: k } = n(), { incognito: A, setIncognito: j } = u();
3324
3322
  T(() => {
3325
- _(Xr());
3323
+ _(Gr());
3326
3324
  }, []);
3327
3325
  let M = C((e, t) => {
3328
3326
  e.preventDefault(), e.stopPropagation(), _((e) => {
3329
3327
  let n = e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
3330
- return Zr(n), n;
3328
+ return Kr(n), n;
3331
3329
  });
3332
3330
  }, []), N = E(() => [...e].sort((e, t) => {
3333
3331
  let n = g.includes(e.id), r = g.includes(t.id);
@@ -3341,27 +3339,27 @@ function Qr() {
3341
3339
  i(!0);
3342
3340
  try {
3343
3341
  if (D) {
3344
- let { data: e, error: n, response: r } = await _t();
3342
+ let { data: e, error: n, response: r } = await vt();
3345
3343
  if (n && r?.status === 401) {
3346
- let e = dn().map((e) => ({
3344
+ let e = Y().map((e) => ({
3347
3345
  ...e,
3348
3346
  messageCount: e.messages?.filter((e) => e.role === "user").length ?? 0,
3349
- lastMessageAt: Yr(e)
3347
+ lastMessageAt: Wr(e)
3350
3348
  }));
3351
3349
  t(e);
3352
3350
  return;
3353
3351
  }
3354
- if (n) throw Error(`Failed to fetch chats: ${qr(n, r?.status)}`);
3352
+ if (n) throw Error(`Failed to fetch chats: ${Hr(n, r?.status)}`);
3355
3353
  t(Array.isArray(e?.chats) ? e.chats : []);
3356
3354
  } else {
3357
- let e = dn().map((e) => ({
3355
+ let e = Y().map((e) => ({
3358
3356
  ...e,
3359
3357
  messageCount: e.messages?.filter((e) => e.role === "user").length ?? 0
3360
3358
  }));
3361
3359
  t(e);
3362
3360
  }
3363
3361
  } catch (e) {
3364
- console.error("Failed to fetch chat history:", e), t([]), K.error("Failed to load chat history");
3362
+ console.error("Failed to fetch chat history:", e), t([]), G.error("Failed to load chat history");
3365
3363
  } finally {
3366
3364
  i(!1);
3367
3365
  }
@@ -3377,12 +3375,12 @@ function Qr() {
3377
3375
  d(!0);
3378
3376
  try {
3379
3377
  if (D) {
3380
- let { error: e, response: t } = await ut({ path: { id: s } });
3381
- if (e) throw Error(`Failed to delete chat: ${qr(e, t?.status)}`);
3382
- } else mn(s);
3383
- t((e) => e.filter((e) => e.id !== s)), K.success("Chat deleted");
3378
+ let { error: e, response: t } = await dt({ path: { id: s } });
3379
+ if (e) throw Error(`Failed to delete chat: ${Hr(e, t?.status)}`);
3380
+ } else ln(s);
3381
+ t((e) => e.filter((e) => e.id !== s)), G.success("Chat deleted");
3384
3382
  } catch (e) {
3385
- K.error(e.message || "Failed to delete chat");
3383
+ G.error(e.message || "Failed to delete chat");
3386
3384
  } finally {
3387
3385
  o(!1), c(null), d(!1);
3388
3386
  }
@@ -3393,39 +3391,39 @@ function Qr() {
3393
3391
  h(!0);
3394
3392
  try {
3395
3393
  if (D) {
3396
- let { error: e, response: t } = await lt();
3397
- if (e) throw Error(`Failed to clear history: ${qr(e, t?.status)}`);
3398
- } else hn();
3399
- t([]), K.success("All history cleared");
3394
+ let { error: e, response: t } = await ut();
3395
+ if (e) throw Error(`Failed to clear history: ${Hr(e, t?.status)}`);
3396
+ } else un();
3397
+ t([]), G.success("All history cleared");
3400
3398
  } catch (e) {
3401
- K.error(e.message || "Failed to clear history");
3399
+ G.error(e.message || "Failed to clear history");
3402
3400
  } finally {
3403
3401
  p(!1), h(!1);
3404
3402
  }
3405
3403
  }, B = () => {
3406
- j(!A), K.success(A ? "Private mode off" : "Private mode on — messages won't be saved");
3404
+ j(!A), G.success(A ? "Private mode off" : "Private mode on — messages won't be saved");
3407
3405
  }, V = C(async (e) => {
3408
3406
  if (!e.trim()) x([]), w(!1);
3409
3407
  else {
3410
3408
  w(!0);
3411
3409
  try {
3412
3410
  if (D) {
3413
- let { data: t, error: n, response: r } = await bt({ query: { q: e } });
3414
- if (n) throw Error(`Failed to search chats: ${qr(n, r?.status)}`);
3411
+ let { data: t, error: n, response: r } = await xt({ query: { q: e } });
3412
+ if (n) throw Error(`Failed to search chats: ${Hr(n, r?.status)}`);
3415
3413
  x(Array.isArray(t?.chats) ? t.chats : []);
3416
3414
  } else {
3417
- let t = dn().filter((t) => {
3415
+ let t = Y().filter((t) => {
3418
3416
  let n = t.title.toLowerCase().includes(e.toLowerCase()), r = t.messages?.some((t) => "content" in t && t.content?.toLowerCase().includes(e.toLowerCase()));
3419
3417
  return n || r;
3420
3418
  });
3421
3419
  x(t.map((e) => ({
3422
3420
  ...e,
3423
3421
  messageCount: e.messages?.filter((e) => e.role === "user").length ?? 0,
3424
- lastMessageAt: Yr(e)
3422
+ lastMessageAt: Wr(e)
3425
3423
  })));
3426
3424
  }
3427
3425
  } catch (e) {
3428
- console.error("Failed to search chat history:", e), x([]), K.error("Failed to search chat history");
3426
+ console.error("Failed to search chat history:", e), x([]), G.error("Failed to search chat history");
3429
3427
  } finally {
3430
3428
  w(!1);
3431
3429
  }
@@ -3466,7 +3464,7 @@ function Qr() {
3466
3464
  };
3467
3465
  }
3468
3466
  // src/components/ChatHistoryDropdown/HistoryHeader.tsx
3469
- function $r({ incognito: e, onToggleIncognito: t, showClearAll: n, onClearAll: r, searchQuery: i, onSearchChange: a }) {
3467
+ function Jr({ incognito: e, onToggleIncognito: t, showClearAll: n, onClearAll: r, searchQuery: i, onSearchChange: a }) {
3470
3468
  return /* @__PURE__ */ F("div", {
3471
3469
  className: "mb-2 pb-2 border-b border-border space-y-2",
3472
3470
  children: [/* @__PURE__ */ F("div", {
@@ -3480,18 +3478,18 @@ function $r({ incognito: e, onToggleIncognito: t, showClearAll: n, onClearAll: r
3480
3478
  onClick: t,
3481
3479
  className: `flex items-center gap-1 px-2 py-1 text-xs rounded-lg transition-colors duration-200 ${e ? "text-primary bg-primary/10" : "text-muted-foreground hover:text-foreground hover:bg-secondary"}`,
3482
3480
  title: e ? "Private mode on" : "Private mode",
3483
- children: [/* @__PURE__ */ P(Oe, { size: 12 }), /* @__PURE__ */ P("span", { children: "Private" })]
3481
+ children: [/* @__PURE__ */ P(ke, { size: 12 }), /* @__PURE__ */ P("span", { children: "Private" })]
3484
3482
  }), n && /* @__PURE__ */ F("button", {
3485
3483
  onClick: r,
3486
3484
  className: "flex items-center gap-1 px-2 py-1 text-xs text-muted-foreground hover:text-red-500 hover:bg-red-500/10 rounded-lg transition-colors duration-200",
3487
3485
  title: "Clear all history",
3488
- children: [/* @__PURE__ */ P($e, { size: 12 }), /* @__PURE__ */ P("span", { children: "Clear All" })]
3486
+ children: [/* @__PURE__ */ P(et, { size: 12 }), /* @__PURE__ */ P("span", { children: "Clear All" })]
3489
3487
  })]
3490
3488
  })]
3491
3489
  }), /* @__PURE__ */ F("div", {
3492
3490
  className: "relative",
3493
3491
  children: [
3494
- /* @__PURE__ */ P(Ve, {
3492
+ /* @__PURE__ */ P(He, {
3495
3493
  className: "absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground",
3496
3494
  size: 14
3497
3495
  }),
@@ -3505,14 +3503,14 @@ function $r({ incognito: e, onToggleIncognito: t, showClearAll: n, onClearAll: r
3505
3503
  i && /* @__PURE__ */ P("button", {
3506
3504
  onClick: () => a(""),
3507
3505
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
3508
- children: /* @__PURE__ */ P(nt, { size: 14 })
3506
+ children: /* @__PURE__ */ P(rt, { size: 14 })
3509
3507
  })
3510
3508
  ]
3511
3509
  })]
3512
3510
  });
3513
3511
  }
3514
3512
  // src/ui/badge.tsx
3515
- var ei = Dt("inline-flex items-center justify-center rounded-2xl border px-3 py-1.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
3513
+ var Yr = Ot("inline-flex items-center justify-center rounded-2xl border px-3 py-1.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
3516
3514
  variants: { variant: {
3517
3515
  default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
3518
3516
  secondary: "border-transparent bg-gray-100 text-gray-700 [a&]:hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:[a&]:hover:bg-gray-700",
@@ -3524,20 +3522,20 @@ var ei = Dt("inline-flex items-center justify-center rounded-2xl border px-3 py-
3524
3522
  } },
3525
3523
  defaultVariants: { variant: "default" }
3526
3524
  });
3527
- function ti({ className: e, variant: t, asChild: n = !1, ...r }) {
3528
- return /* @__PURE__ */ P(n ? Et : "span", {
3525
+ function Xr({ className: e, variant: t, asChild: n = !1, ...r }) {
3526
+ return /* @__PURE__ */ P(n ? Dt : "span", {
3529
3527
  "data-slot": "badge",
3530
- className: h(ei({ variant: t }), e),
3528
+ className: h(Yr({ variant: t }), e),
3531
3529
  ...r
3532
3530
  });
3533
3531
  }
3534
3532
  // src/components/ChatHistoryDropdown/HistoryChatItem.tsx
3535
- function ni({ chat: e, isPinned: n, onTogglePin: r, onDelete: i }) {
3533
+ function Zr({ chat: e, isPinned: n, onTogglePin: r, onDelete: i }) {
3536
3534
  let a = e.messageCount ?? 0;
3537
3535
  return /* @__PURE__ */ F("div", {
3538
3536
  className: "group flex items-center gap-1 px-2 py-1 rounded-lg hover:bg-secondary transition-colors duration-200",
3539
3537
  children: [
3540
- /* @__PURE__ */ F(Tt, {
3538
+ /* @__PURE__ */ F(Et, {
3541
3539
  href: `/c/${e.id}`,
3542
3540
  onClick: (n) => {
3543
3541
  t.onOpenChat?.(e.id) && n.preventDefault();
@@ -3545,16 +3543,16 @@ function ni({ chat: e, isPinned: n, onTogglePin: r, onDelete: i }) {
3545
3543
  className: "flex-1 min-w-0 flex items-center gap-1.5",
3546
3544
  children: [/* @__PURE__ */ F("span", {
3547
3545
  className: "flex items-center gap-1 shrink-0",
3548
- children: [a > 0 && /* @__PURE__ */ F(ti, {
3546
+ children: [a > 0 && /* @__PURE__ */ F(Xr, {
3549
3547
  className: "px-1.5 py-0 text-[10px] font-medium bg-zinc-200 text-zinc-700 hover:bg-zinc-200 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-700 border-0 rounded-md",
3550
3548
  children: [a, "Q"]
3551
- }), /* @__PURE__ */ P(ti, {
3549
+ }), /* @__PURE__ */ P(Xr, {
3552
3550
  className: "px-1.5 py-0 text-[10px] font-medium bg-zinc-100 text-zinc-500 hover:bg-zinc-100 dark:bg-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-800 border-0 rounded-md",
3553
3551
  children: f(/* @__PURE__ */ new Date(), e.createdAt)
3554
3552
  })]
3555
3553
  }), /* @__PURE__ */ F("p", {
3556
3554
  className: "text-xs text-popover-foreground truncate",
3557
- children: [n && /* @__PURE__ */ P(ze, {
3555
+ children: [n && /* @__PURE__ */ P(Be, {
3558
3556
  size: 10,
3559
3557
  className: "inline mr-1 text-primary"
3560
3558
  }), e.title]
@@ -3564,19 +3562,19 @@ function ni({ chat: e, isPinned: n, onTogglePin: r, onDelete: i }) {
3564
3562
  onClick: (t) => r(t, e.id),
3565
3563
  className: `p-1.5 rounded-lg transition-all duration-200 ${n ? "opacity-100 text-primary hover:bg-primary/10" : "opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-primary hover:bg-primary/10"}`,
3566
3564
  title: n ? "Unpin chat" : "Pin chat",
3567
- children: /* @__PURE__ */ P(ze, { size: 14 })
3565
+ children: /* @__PURE__ */ P(Be, { size: 14 })
3568
3566
  }),
3569
3567
  /* @__PURE__ */ P("button", {
3570
3568
  onClick: (t) => i(t, e.id),
3571
3569
  className: "opacity-0 group-hover:opacity-100 p-1.5 rounded-lg hover:bg-red-500/10 text-muted-foreground hover:text-red-500 transition-all duration-200",
3572
3570
  title: "Delete chat",
3573
- children: /* @__PURE__ */ P(Qe, { size: 14 })
3571
+ children: /* @__PURE__ */ P($e, { size: 14 })
3574
3572
  })
3575
3573
  ]
3576
3574
  });
3577
3575
  }
3578
3576
  // src/components/ChatHistoryDropdown/HistoryDialogs.tsx
3579
- function ri({ open: e, onOpenChange: t, title: n, description: r, confirmLabel: i, loadingLabel: a, loading: o, onConfirm: s }) {
3577
+ function Qr({ open: e, onOpenChange: t, title: n, description: r, confirmLabel: i, loadingLabel: a, loading: o, onConfirm: s }) {
3580
3578
  return /* @__PURE__ */ P(_, {
3581
3579
  open: e,
3582
3580
  onOpenChange: (e) => {
@@ -3612,8 +3610,8 @@ function ri({ open: e, onOpenChange: t, title: n, description: r, confirmLabel:
3612
3610
  })
3613
3611
  });
3614
3612
  }
3615
- function ii({ deleteDialogOpen: e, setDeleteDialogOpen: t, chatToDelete: n, setChatToDelete: r, deleting: i, onConfirmDelete: a, clearAllDialogOpen: o, setClearAllDialogOpen: s, clearingAll: c, onConfirmClearAll: l }) {
3616
- return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(ri, {
3613
+ function $r({ deleteDialogOpen: e, setDeleteDialogOpen: t, chatToDelete: n, setChatToDelete: r, deleting: i, onConfirmDelete: a, clearAllDialogOpen: o, setClearAllDialogOpen: s, clearingAll: c, onConfirmClearAll: l }) {
3614
+ return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Qr, {
3617
3615
  open: e,
3618
3616
  onOpenChange: (e) => {
3619
3617
  t(e), e || r(null);
@@ -3624,7 +3622,7 @@ function ii({ deleteDialogOpen: e, setDeleteDialogOpen: t, chatToDelete: n, setC
3624
3622
  loadingLabel: "Deleting...",
3625
3623
  loading: i,
3626
3624
  onConfirm: a
3627
- }), /* @__PURE__ */ P(ri, {
3625
+ }), /* @__PURE__ */ P(Qr, {
3628
3626
  open: o,
3629
3627
  onOpenChange: s,
3630
3628
  title: "Clear All History",
@@ -3636,13 +3634,13 @@ function ii({ deleteDialogOpen: e, setDeleteDialogOpen: t, chatToDelete: n, setC
3636
3634
  })] });
3637
3635
  }
3638
3636
  // src/components/ChatHistoryDropdown/HistoryDropdown.tsx
3639
- var ai = {
3640
- Today: /* @__PURE__ */ P(Xe, { size: 12 }),
3641
- Yesterday: /* @__PURE__ */ P(se, { size: 12 }),
3642
- "This Week": /* @__PURE__ */ P(te, { size: 12 }),
3637
+ var ei = {
3638
+ Today: /* @__PURE__ */ P(Ze, { size: 12 }),
3639
+ Yesterday: /* @__PURE__ */ P(ce, { size: 12 }),
3640
+ "This Week": /* @__PURE__ */ P(ne, { size: 12 }),
3643
3641
  Older: /* @__PURE__ */ P(z, { size: 12 })
3644
3642
  };
3645
- function oi(e) {
3643
+ function ti(e) {
3646
3644
  let t = /* @__PURE__ */ new Date(), n = new Date(t.getFullYear(), t.getMonth(), t.getDate()), r = /* @__PURE__ */ new Date(n.getTime() - 864e5), i = /* @__PURE__ */ new Date(n.getTime() - 5184e5), a = {
3647
3645
  Today: [],
3648
3646
  Yesterday: [],
@@ -3663,11 +3661,11 @@ function oi(e) {
3663
3661
  chats: a[e]
3664
3662
  }));
3665
3663
  }
3666
- var si = ({ showLabel: e = !1 }) => {
3667
- let t = Qr();
3664
+ var ni = ({ showLabel: e = !1 }) => {
3665
+ let t = qr();
3668
3666
  return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F(_, { children: [/* @__PURE__ */ F(d, {
3669
3667
  className: e ? "inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs text-muted-foreground bg-secondary hover:bg-secondary/80 hover:text-foreground transition-colors duration-150" : "p-2 text-muted-foreground rounded-2xl bg-background/60 backdrop-blur-md hover:bg-secondary/80 transition duration-200 hover:text-foreground border border-border/30",
3670
- children: [/* @__PURE__ */ P(we, { size: e ? 14 : 18 }), e && /* @__PURE__ */ P("span", { children: "History" })]
3668
+ children: [/* @__PURE__ */ P(Te, { size: e ? 14 : 18 }), e && /* @__PURE__ */ P("span", { children: "History" })]
3671
3669
  }), /* @__PURE__ */ F(m, {
3672
3670
  className: "max-w-[420px] p-3",
3673
3671
  children: [
@@ -3675,7 +3673,7 @@ var si = ({ showLabel: e = !1 }) => {
3675
3673
  className: "sr-only",
3676
3674
  children: "Chat History"
3677
3675
  }),
3678
- /* @__PURE__ */ P($r, {
3676
+ /* @__PURE__ */ P(Jr, {
3679
3677
  incognito: t.incognito,
3680
3678
  onToggleIncognito: t.toggleIncognito,
3681
3679
  showClearAll: t.chats.length > 0 && !t.loading,
@@ -3713,15 +3711,15 @@ var si = ({ showLabel: e = !1 }) => {
3713
3711
  })
3714
3712
  }) : /* @__PURE__ */ P("div", {
3715
3713
  className: "space-y-1 max-h-[500px] overflow-y-auto",
3716
- children: t.searchQuery.trim() ? t.displayChats.map((e) => /* @__PURE__ */ P(ni, {
3714
+ children: t.searchQuery.trim() ? t.displayChats.map((e) => /* @__PURE__ */ P(Zr, {
3717
3715
  chat: e,
3718
3716
  isPinned: t.pinnedIds.includes(e.id),
3719
3717
  onTogglePin: t.togglePin,
3720
3718
  onDelete: t.handleDeleteClick
3721
- }, e.id)) : oi(t.displayChats).map(({ label: e, chats: n }) => /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ F("div", {
3719
+ }, e.id)) : ti(t.displayChats).map(({ label: e, chats: n }) => /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ F("div", {
3722
3720
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold text-muted-foreground/70 uppercase tracking-wider",
3723
- children: [ai[e], e]
3724
- }), n.map((e) => /* @__PURE__ */ P(ni, {
3721
+ children: [ei[e], e]
3722
+ }), n.map((e) => /* @__PURE__ */ P(Zr, {
3725
3723
  chat: e,
3726
3724
  isPinned: t.pinnedIds.includes(e.id),
3727
3725
  onTogglePin: t.togglePin,
@@ -3730,14 +3728,14 @@ var si = ({ showLabel: e = !1 }) => {
3730
3728
  }),
3731
3729
  t.chats.length > 0 && /* @__PURE__ */ P("div", {
3732
3730
  className: "mt-2 pt-2 border-t border-border",
3733
- children: /* @__PURE__ */ P(Tt, {
3731
+ children: /* @__PURE__ */ P(Et, {
3734
3732
  href: "/library",
3735
3733
  className: "block text-center text-xs text-primary hover:underline",
3736
3734
  children: "View all chats"
3737
3735
  })
3738
3736
  })
3739
3737
  ]
3740
- })] }), /* @__PURE__ */ P(ii, {
3738
+ })] }), /* @__PURE__ */ P($r, {
3741
3739
  deleteDialogOpen: t.deleteDialogOpen,
3742
3740
  setDeleteDialogOpen: t.setDeleteDialogOpen,
3743
3741
  chatToDelete: t.chatToDelete,
@@ -3749,14 +3747,14 @@ var si = ({ showLabel: e = !1 }) => {
3749
3747
  clearingAll: t.clearingAll,
3750
3748
  onConfirmClearAll: t.handleConfirmClearAll
3751
3749
  })] });
3752
- }, ci = (e) => new Date(e.lastMessageAt || e.createdAt).getTime();
3753
- function li() {
3754
- let { chats: e, loading: n } = Qr(), r = [...e].sort((e, t) => ci(t) - ci(e)).slice(0, 5);
3750
+ }, ri = (e) => new Date(e.lastMessageAt || e.createdAt).getTime();
3751
+ function ii() {
3752
+ let { chats: e, loading: n } = qr(), r = [...e].sort((e, t) => ri(t) - ri(e)).slice(0, 5);
3755
3753
  return n || r.length === 0 ? null : /* @__PURE__ */ F("div", {
3756
3754
  className: "flex flex-row items-center justify-center gap-2 flex-wrap",
3757
- children: [/* @__PURE__ */ P(si, { showLabel: !0 }), r.map((e) => {
3758
- let n = br(e.lastMessageAt || e.createdAt);
3759
- return /* @__PURE__ */ F(Tt, {
3755
+ children: [/* @__PURE__ */ P(ni, { showLabel: !0 }), r.map((e) => {
3756
+ let n = hr(e.lastMessageAt || e.createdAt);
3757
+ return /* @__PURE__ */ F(Et, {
3760
3758
  href: `/c/${e.id}`,
3761
3759
  onClick: (n) => {
3762
3760
  t.onOpenChat?.(e.id) && n.preventDefault();
@@ -3775,25 +3773,25 @@ function li() {
3775
3773
  });
3776
3774
  }
3777
3775
  // src/components/Footer.tsx
3778
- var ui = {
3779
- Bot: ee,
3780
- BookOpen: U,
3781
- Building2: W,
3782
- Download: fe,
3783
- HelpCircle: Se,
3784
- Info: Te,
3785
- Lock: Oe,
3786
- Mail: je,
3787
- MessageCircle: Me,
3788
- Newspaper: Ie,
3789
- Sparkles: Ke
3776
+ var ai = {
3777
+ Bot: te,
3778
+ BookOpen: ee,
3779
+ Building2: U,
3780
+ Download: pe,
3781
+ HelpCircle: Ce,
3782
+ Info: Ee,
3783
+ Lock: ke,
3784
+ Mail: Me,
3785
+ MessageCircle: Ne,
3786
+ Newspaper: Le,
3787
+ Sparkles: qe
3790
3788
  };
3791
- function di({ name: e }) {
3792
- let t = ui[e];
3789
+ function oi({ name: e }) {
3790
+ let t = ai[e];
3793
3791
  return t ? /* @__PURE__ */ P(t, { size: 14 }) : null;
3794
3792
  }
3795
- var fi = "relative group inline-flex items-center gap-1 px-[3px] sm:px-1.5 py-0.5 rounded-md whitespace-nowrap transition-all duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:text-white hover:bg-white/10 hover:-translate-y-0.5 hover:scale-110 hover:drop-shadow-[0_0_8px_rgba(255,255,255,0.8)] active:scale-95 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/60";
3796
- function pi({ listFooterLinks: e = [], optionShowIcons: t = !0, optionBackgroundColor: n = "bg-black/40" }) {
3793
+ var si = "relative group inline-flex items-center gap-1 px-[3px] sm:px-1.5 py-0.5 rounded-md whitespace-nowrap transition-all duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)] hover:text-white hover:bg-white/10 hover:-translate-y-0.5 hover:scale-110 hover:drop-shadow-[0_0_8px_rgba(255,255,255,0.8)] active:scale-95 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/60";
3794
+ function ci({ listFooterLinks: e = [], optionShowIcons: t = !0, optionBackgroundColor: n = "bg-black/40" }) {
3797
3795
  return e.length === 0 ? null : /* @__PURE__ */ P("nav", {
3798
3796
  "aria-label": "Footer",
3799
3797
  className: `relative z-20 mx-auto flex w-max flex-nowrap items-center justify-center gap-0 sm:gap-1 max-w-full text-slate-200 ${n} backdrop-blur-sm rounded-full px-1 sm:px-1.5 py-0.5 shadow-lg hover:shadow-xl transition-shadow duration-300`,
@@ -3804,7 +3802,7 @@ function pi({ listFooterLinks: e = [], optionShowIcons: t = !0, optionBackground
3804
3802
  } : {}, s = /* @__PURE__ */ F(N, { children: [
3805
3803
  t && r && /* @__PURE__ */ P("span", {
3806
3804
  className: "hidden sm:inline-flex transition-transform duration-300 group-hover:-rotate-12 group-hover:scale-125",
3807
- children: /* @__PURE__ */ P(di, { name: r })
3805
+ children: /* @__PURE__ */ P(oi, { name: r })
3808
3806
  }),
3809
3807
  /* @__PURE__ */ P("span", {
3810
3808
  className: "font-semibold tracking-wide text-[11px] sm:text-xs",
@@ -3816,83 +3814,83 @@ function pi({ listFooterLinks: e = [], optionShowIcons: t = !0, optionBackground
3816
3814
  return i ? /* @__PURE__ */ P("button", {
3817
3815
  type: "button",
3818
3816
  onClick: i,
3819
- className: fi,
3817
+ className: si,
3820
3818
  children: s
3821
3819
  }, e) : a ? /* @__PURE__ */ P("a", {
3822
3820
  href: e,
3823
3821
  ...o,
3824
- className: fi,
3822
+ className: si,
3825
3823
  children: s
3826
- }, e) : /* @__PURE__ */ P(Tt, {
3824
+ }, e) : /* @__PURE__ */ P(Et, {
3827
3825
  href: e,
3828
- className: fi,
3826
+ className: si,
3829
3827
  children: s
3830
3828
  }, e);
3831
3829
  })
3832
3830
  });
3833
3831
  }
3834
3832
  // src/components/ArticleReader/ArticleReaderMount.tsx
3835
- var mi = S(() => import("./ArticleExtractPanel-Dce2hQz6.js"));
3836
- function hi() {
3833
+ var li = S(() => import("./ArticleExtractPanel-B6tyR_bs.js"));
3834
+ function ui() {
3837
3835
  let e = o()?.isOpen ?? !1, [t, n] = O(!1);
3838
3836
  return T(() => {
3839
3837
  e && n(!0);
3840
3838
  }, [e]), !t && !e ? null : /* @__PURE__ */ P(y, {
3841
3839
  fallback: null,
3842
- children: /* @__PURE__ */ P(mi, {})
3840
+ children: /* @__PURE__ */ P(li, {})
3843
3841
  });
3844
3842
  }
3845
- var gi = (/* @__PURE__ */ "hyZbH3n.mp4,iOeZcCk.mp4,dUZlxYE.mp4,GpWeP6E.gif,LuKUsLE.png,w7X11Dd.png,MHmVtCr.png,HmnUAee.png,vKP22VU.png,l1lsV39.png,Ku8F2qc.png,KUEXtwm.png,vvKFPmY.png,5p8eaEf.png,VAKuJcG.png,sTMPtQW.png,m0gHbZZ.png,cKu7dWQ.png,ogfefYD.png,ey5vAae.png,twuLrvk.png,ELILiYt.png,9el5qpP.png,Up6xTkk.png,W1XKBo0.png,1Y6xvW0.png,JXOytMz.png,DNiI6pp.png,XDv5s6p.jpeg,eRwiRJ9.jpeg,DRAfJoc.jpeg,ASVRQ1G.jpeg,35svwUT.jpeg,81xLiVI.jpeg,6kod2Em.jpeg,eU0C8zt.jpeg,Bv0PBY8.jpeg,DQNbjIZ.jpeg,2uACPqZ.jpeg,XEKltMF.jpeg,WHgLfBm.jpeg,QFYM0Fw.jpeg,K12HCao.jpeg,oN8rtsE.jpeg,9fGnrns.jpeg,2ONJJeW.jpeg,DO23Va7.jpeg,QaKeoXk.jpeg,QU5oCBR.jpeg,MhlYZmh.jpeg,ylL1ToB.jpeg,AWWsCv8.jpeg,Tk9Tzzj.jpeg".split(",")).map((e) => "https://i.imgur.com/" + e), _i = "qwksearch-background-art-v1", vi = "backgroundArtCache", yi = (e) => typeof e == "string" && gi.includes(e);
3846
- function bi() {
3843
+ var di = (/* @__PURE__ */ "hyZbH3n.mp4,iOeZcCk.mp4,dUZlxYE.mp4,GpWeP6E.gif,LuKUsLE.png,w7X11Dd.png,MHmVtCr.png,HmnUAee.png,vKP22VU.png,l1lsV39.png,Ku8F2qc.png,KUEXtwm.png,vvKFPmY.png,5p8eaEf.png,VAKuJcG.png,sTMPtQW.png,m0gHbZZ.png,cKu7dWQ.png,ogfefYD.png,ey5vAae.png,twuLrvk.png,ELILiYt.png,9el5qpP.png,Up6xTkk.png,W1XKBo0.png,1Y6xvW0.png,JXOytMz.png,DNiI6pp.png,XDv5s6p.jpeg,eRwiRJ9.jpeg,DRAfJoc.jpeg,ASVRQ1G.jpeg,35svwUT.jpeg,81xLiVI.jpeg,6kod2Em.jpeg,eU0C8zt.jpeg,Bv0PBY8.jpeg,DQNbjIZ.jpeg,2uACPqZ.jpeg,XEKltMF.jpeg,WHgLfBm.jpeg,QFYM0Fw.jpeg,K12HCao.jpeg,oN8rtsE.jpeg,9fGnrns.jpeg,2ONJJeW.jpeg,DO23Va7.jpeg,QaKeoXk.jpeg,QU5oCBR.jpeg,MhlYZmh.jpeg,ylL1ToB.jpeg,AWWsCv8.jpeg,Tk9Tzzj.jpeg".split(",")).map((e) => "https://i.imgur.com/" + e), fi = "qwksearch-background-art-v1", pi = "backgroundArtCache", mi = (e) => typeof e == "string" && di.includes(e);
3844
+ function hi() {
3847
3845
  try {
3848
3846
  let e = JSON.parse(localStorage.getItem("backgroundArtCache") || "[]");
3849
- return Array.isArray(e) ? [...new Set(e.filter(yi))] : [];
3847
+ return Array.isArray(e) ? [...new Set(e.filter(mi))] : [];
3850
3848
  } catch {
3851
3849
  return [];
3852
3850
  }
3853
3851
  }
3854
- function xi(e) {
3852
+ function gi(e) {
3855
3853
  try {
3856
- localStorage.setItem(vi, JSON.stringify(e));
3854
+ localStorage.setItem(pi, JSON.stringify(e));
3857
3855
  } catch {}
3858
3856
  }
3859
- function Si(e) {
3860
- let t = bi().filter((t) => t !== e);
3857
+ function _i(e) {
3858
+ let t = hi().filter((t) => t !== e);
3861
3859
  t.push(e);
3862
3860
  let n = t.splice(0, Math.max(0, t.length - 10));
3863
- return xi(t), n;
3861
+ return gi(t), n;
3864
3862
  }
3865
- function Ci(e) {
3866
- xi(bi().filter((t) => t !== e));
3863
+ function vi(e) {
3864
+ gi(hi().filter((t) => t !== e));
3867
3865
  }
3868
- var wi = (e) => e.length ? e[Math.floor(Math.random() * e.length)] : null;
3869
- function Ti(e) {
3870
- return wi(bi().filter((t) => t !== e));
3866
+ var yi = (e) => e.length ? e[Math.floor(Math.random() * e.length)] : null;
3867
+ function bi(e) {
3868
+ return yi(hi().filter((t) => t !== e));
3871
3869
  }
3872
- function Ei() {
3873
- let e = new Set(bi());
3874
- return wi(gi.filter((t) => !e.has(t)));
3870
+ function xi() {
3871
+ let e = new Set(hi());
3872
+ return yi(di.filter((t) => !e.has(t)));
3875
3873
  }
3876
- async function Di() {
3874
+ async function Si() {
3877
3875
  if (typeof caches > "u") return null;
3878
3876
  try {
3879
- return await caches.open(_i);
3877
+ return await caches.open(fi);
3880
3878
  } catch {
3881
3879
  return null;
3882
3880
  }
3883
3881
  }
3884
- async function Oi(e) {
3885
- let t = await Di();
3882
+ async function Ci(e) {
3883
+ let t = await Si();
3886
3884
  if (!t) return null;
3887
3885
  try {
3888
3886
  let n = await t.match(e);
3889
- return n ? URL.createObjectURL(await n.blob()) : (Ci(e), null);
3887
+ return n ? URL.createObjectURL(await n.blob()) : (vi(e), null);
3890
3888
  } catch {
3891
3889
  return null;
3892
3890
  }
3893
3891
  }
3894
- async function ki(e) {
3895
- let t = await Di();
3892
+ async function wi(e) {
3893
+ let t = await Si();
3896
3894
  if (!t) return e;
3897
3895
  let n;
3898
3896
  try {
@@ -3907,17 +3905,17 @@ async function ki(e) {
3907
3905
  }
3908
3906
  if (n.size <= 15728640) try {
3909
3907
  await t.put(e, new Response(n, { headers: { "Content-Type": n.type } }));
3910
- let r = Si(e);
3908
+ let r = _i(e);
3911
3909
  await Promise.all(r.map((e) => t.delete(e)));
3912
3910
  } catch {}
3913
3911
  return URL.createObjectURL(n);
3914
3912
  }
3915
3913
  // src/components/ChatConversation/ChatHomepage.tsx
3916
- var Ai = S(() => import("use-weather-forecast").then((e) => ({ default: e.WeatherForecast }))), ji = S(() => import("trending-news-api").then((e) => ({ default: e.TrendingNews }))), Mi = S(() => import("education-playlists").then((e) => ({ default: e.EducationPlaylists }))), Ni = S(() => import("./DownloadsDialog-D71PJHTm.js")), Pi = 15;
3917
- function Fi(e) {
3914
+ var Ti = S(() => import("use-weather-forecast").then((e) => ({ default: e.WeatherForecast }))), Ei = S(() => import("trending-news-api").then((e) => ({ default: e.TrendingNews }))), Di = S(() => import("education-playlists").then((e) => ({ default: e.EducationPlaylists }))), Oi = S(() => import("./DownloadsDialog-D71PJHTm.js")), ki = 15;
3915
+ function Ai(e) {
3918
3916
  return e ? e.split(/[,\n]/).map((e) => e.trim()).filter(Boolean) : [];
3919
3917
  }
3920
- function Ii(e) {
3918
+ function ji(e) {
3921
3919
  return e ? e.split(/\r?\n/).map((e) => e.trim()).filter(Boolean).map((e) => {
3922
3920
  let t = e.split(",").map((e) => e.trim()), n = Number(t[t.length - 2]), r = Number(t[t.length - 1]);
3923
3921
  return t.length >= 2 && t[t.length - 2] !== "" && t[t.length - 1] !== "" && Number.isFinite(n) && Number.isFinite(r) ? {
@@ -3927,36 +3925,36 @@ function Ii(e) {
3927
3925
  } : { label: e };
3928
3926
  }) : [];
3929
3927
  }
3930
- var Li = (e) => e.endsWith(".webm") || e.endsWith(".mp4"), Ri = (e) => e.startsWith("blob:");
3931
- function zi({ url: e, src: t }) {
3932
- return Li(e) ? Promise.resolve(!0) : new Promise((e) => {
3928
+ var Mi = (e) => e.endsWith(".webm") || e.endsWith(".mp4"), Ni = (e) => e.startsWith("blob:");
3929
+ function Pi({ url: e, src: t }) {
3930
+ return Mi(e) ? Promise.resolve(!0) : new Promise((e) => {
3933
3931
  let n = new Image();
3934
3932
  n.decoding = "async", n.onload = () => e(!0), n.onerror = () => e(!1), n.src = t;
3935
3933
  });
3936
3934
  }
3937
- function Bi() {
3938
- let { sendMessage: e } = u(), n = o(), r = n ? (e) => n.openPanel(e.url, "", { suggestQuestions: !0 }) : void 0, [i, a] = O(null), [s, c] = O(null), [l, d] = O(!1), [f, p] = O(!1), [m, h] = O(!1), [g, _] = O([]), [v, b] = O(!0), [x, S] = O(5), [C, w] = O(12), [E, D] = O("fahrenheit"), [k, A] = O(null), [j, M] = O(!0), [N, I] = O(null), [L, R] = O(null), [z, B] = O([]), [V, H] = O("trending"), [U, ee] = O(null), [W, te] = O(!0), [ne, re] = O(!1), [ie, ae] = O(!1), [oe, se] = O(!1), ce = t.footerLinks.map((e) => e.url === "/#downloads" ? {
3935
+ function Fi() {
3936
+ let { sendMessage: e } = u(), n = o(), r = n ? (e) => n.openPanel(e.url, "", { suggestQuestions: !0 }) : void 0, [i, a] = O(null), [s, c] = O(null), [l, d] = O(!1), [f, p] = O(!1), [m, h] = O(!1), [g, _] = O([]), [v, b] = O(!0), [x, S] = O(5), [C, w] = O(12), [E, D] = O("fahrenheit"), [k, A] = O(null), [j, M] = O(!0), [N, I] = O(null), [L, R] = O(null), [z, B] = O([]), [V, H] = O("trending"), [ee, te] = O(null), [U, ne] = O(!0), [re, ie] = O(!1), [ae, oe] = O(!1), [se, ce] = O(!1), le = t.footerLinks.map((e) => e.url === "/#downloads" ? {
3939
3937
  ...e,
3940
3938
  onClick: () => {
3941
3939
  h(!0), p(!0);
3942
3940
  }
3943
- } : e), le = k || t.trendingNewsApiUrl, ue = U?.enabled !== !1, de = U?.allowUserTopics === !1 ? [] : z, fe = N ?? U?.maxTopics ?? 6, pe = L ?? U?.showImages ?? !0, me = j && ue;
3941
+ } : e), ue = k || t.trendingNewsApiUrl, de = ee?.enabled !== !1, fe = ee?.allowUserTopics === !1 ? [] : z, pe = N ?? ee?.maxTopics ?? 6, me = L ?? ee?.showImages ?? !0, he = j && de;
3944
3942
  T(() => {
3945
3943
  let e = t.trendingNewsSettingsUrl;
3946
3944
  if (!e) return;
3947
3945
  let n = !0;
3948
3946
  return fetch(e).then((e) => e.ok ? e.json() : null).then((e) => {
3949
- n && e && ee(e);
3947
+ n && e && te(e);
3950
3948
  }).catch(() => {}), () => {
3951
3949
  n = !1;
3952
3950
  };
3953
3951
  }, []), T(() => {
3954
3952
  let e = () => {
3955
- _(Ii(localStorage.getItem("weatherLocations"))), b(localStorage.getItem("showWeatherWidget") !== "false"), S(Number(localStorage.getItem("weatherForecastDays")) || 5), w(Number(localStorage.getItem("weatherForecastHours")) || 12), D(localStorage.getItem("weatherTemperatureUnit") === "celsius" ? "celsius" : "fahrenheit"), A(localStorage.getItem("trendingNewsApiUrl")), M(localStorage.getItem("showTrendingNewsWidget") !== "false");
3953
+ _(ji(localStorage.getItem("weatherLocations"))), b(localStorage.getItem("showWeatherWidget") !== "false"), S(Number(localStorage.getItem("weatherForecastDays")) || 5), w(Number(localStorage.getItem("weatherForecastHours")) || 12), D(localStorage.getItem("weatherTemperatureUnit") === "celsius" ? "celsius" : "fahrenheit"), A(localStorage.getItem("trendingNewsApiUrl")), M(localStorage.getItem("showTrendingNewsWidget") !== "false");
3956
3954
  let e = localStorage.getItem("trendingNewsMaxTopics");
3957
3955
  I(e && Number(e) || null);
3958
3956
  let t = localStorage.getItem("trendingNewsShowImages");
3959
- R(t === null ? null : t !== "false"), B(Fi(localStorage.getItem("trendingNewsCustomTopics"))), H(localStorage.getItem("trendingNewsSource") === "hckrnews" ? "hckrnews" : "trending"), te(localStorage.getItem("showEducationPlaylistsWidget") !== "false"), ae(localStorage.getItem("orbHoverGlow") === "true"), se(localStorage.getItem("cursorGlowTrail") === "true");
3957
+ R(t === null ? null : t !== "false"), B(Ai(localStorage.getItem("trendingNewsCustomTopics"))), H(localStorage.getItem("trendingNewsSource") === "hckrnews" ? "hckrnews" : "trending"), ne(localStorage.getItem("showEducationPlaylistsWidget") !== "false"), oe(localStorage.getItem("orbHoverGlow") === "true"), ce(localStorage.getItem("cursorGlowTrail") === "true");
3960
3958
  };
3961
3959
  return e(), window.addEventListener("client-config-changed", e), window.addEventListener("storage", e), () => {
3962
3960
  window.removeEventListener("client-config-changed", e), window.removeEventListener("storage", e);
@@ -3964,10 +3962,10 @@ function Bi() {
3964
3962
  }, []), T(() => {
3965
3963
  let e, t = () => {
3966
3964
  if (typeof window.requestIdleCallback == "function") {
3967
- let t = window.requestIdleCallback(() => re(!0), { timeout: 2500 });
3965
+ let t = window.requestIdleCallback(() => ie(!0), { timeout: 2500 });
3968
3966
  e = () => window.cancelIdleCallback(t);
3969
3967
  } else {
3970
- let t = window.setTimeout(() => re(!0), 800);
3968
+ let t = window.setTimeout(() => ie(!0), 800);
3971
3969
  e = () => window.clearTimeout(t);
3972
3970
  }
3973
3971
  };
@@ -3976,25 +3974,25 @@ function Bi() {
3976
3974
  };
3977
3975
  }, []), T(() => {
3978
3976
  if (localStorage.getItem("showBackgroundArt") === "false") return;
3979
- let e = !1, t, n, r, i = null, o = null, s = /* @__PURE__ */ new Set(), l = (e) => (e && Ri(e.src) && s.add(e.src), e), u = (e) => {
3980
- e && Ri(e.src) && (URL.revokeObjectURL(e.src), s.delete(e.src));
3981
- }, f = async (t) => t ? e || !await zi(t) ? (u(t), null) : t : null, p = async (e) => {
3977
+ let e = !1, t, n, r, i = null, o = null, s = /* @__PURE__ */ new Set(), l = (e) => (e && Ni(e.src) && s.add(e.src), e), u = (e) => {
3978
+ e && Ni(e.src) && (URL.revokeObjectURL(e.src), s.delete(e.src));
3979
+ }, f = async (t) => t ? e || !await Pi(t) ? (u(t), null) : t : null, p = async (e) => {
3982
3980
  if (!e) return null;
3983
- let t = await Oi(e);
3981
+ let t = await Ci(e);
3984
3982
  return f(l(t ? {
3985
3983
  url: e,
3986
3984
  src: t
3987
3985
  } : null));
3988
3986
  }, m = async (e) => {
3989
- let t = bi().length < 10 ? Ei() : null;
3987
+ let t = hi().length < 10 ? xi() : null;
3990
3988
  if (t) {
3991
- let e = await ki(t), n = await f(l(e ? {
3989
+ let e = await wi(t), n = await f(l(e ? {
3992
3990
  url: t,
3993
3991
  src: e
3994
3992
  } : null));
3995
3993
  if (n) return n;
3996
3994
  }
3997
- return p(Ti(e?.url));
3995
+ return p(bi(e?.url));
3998
3996
  }, h = (e) => {
3999
3997
  let t = i;
4000
3998
  i = e, t ? (c(e), d(!0), n = setTimeout(() => {
@@ -4005,7 +4003,7 @@ function Bi() {
4005
4003
  g = !0;
4006
4004
  let t = await (o ?? m(i));
4007
4005
  o = null, g = !1, e || (t && h(t), o = m(i));
4008
- }, v = p(Ti()).then((t) => {
4006
+ }, v = p(bi()).then((t) => {
4009
4007
  t && !e && h(t);
4010
4008
  }), y = () => {
4011
4009
  v.then(() => {
@@ -4025,7 +4023,7 @@ function Bi() {
4025
4023
  for (let e of s) URL.revokeObjectURL(e);
4026
4024
  };
4027
4025
  }, []);
4028
- let he = ({ url: e, src: t }, n) => Li(e) ? /* @__PURE__ */ P("video", {
4026
+ let ge = ({ url: e, src: t }, n) => Mi(e) ? /* @__PURE__ */ P("video", {
4029
4027
  src: t,
4030
4028
  autoPlay: !0,
4031
4029
  loop: !0,
@@ -4044,9 +4042,9 @@ function Bi() {
4044
4042
  /* @__PURE__ */ F("div", {
4045
4043
  className: "absolute inset-0 z-0",
4046
4044
  children: [
4047
- i && he(i, l ? "opacity-0" : "opacity-30"),
4048
- s && he(s, l ? "opacity-30" : "opacity-0"),
4049
- oe && /* @__PURE__ */ P(Kt, {})
4045
+ i && ge(i, l ? "opacity-0" : "opacity-30"),
4046
+ s && ge(s, l ? "opacity-30" : "opacity-0"),
4047
+ se && /* @__PURE__ */ P(Ht, {})
4050
4048
  ]
4051
4049
  }),
4052
4050
  /* @__PURE__ */ P("div", {
@@ -4061,8 +4059,8 @@ function Bi() {
4061
4059
  alignItems: "center",
4062
4060
  justifyContent: "center"
4063
4061
  },
4064
- className: ie ? void 0 : "pointer-events-none",
4065
- children: /* @__PURE__ */ P(Ot, {
4062
+ className: ae ? void 0 : "pointer-events-none",
4063
+ children: /* @__PURE__ */ P(kt, {
4066
4064
  autoRandomize: !0,
4067
4065
  onSphereClick: () => console.log("Sphere clicked"),
4068
4066
  className: "my-custom-class"
@@ -4070,14 +4068,14 @@ function Bi() {
4070
4068
  }), /* @__PURE__ */ F("div", {
4071
4069
  className: "w-full max-w-2xl mt-2 space-y-2",
4072
4070
  children: [
4073
- /* @__PURE__ */ P(li, {}),
4074
- /* @__PURE__ */ P(Ur, {}),
4075
- ne && (W || v || me) && /* @__PURE__ */ P(y, {
4071
+ /* @__PURE__ */ P(ii, {}),
4072
+ /* @__PURE__ */ P(Rr, {}),
4073
+ re && (U || v || he) && /* @__PURE__ */ P(y, {
4076
4074
  fallback: null,
4077
4075
  children: /* @__PURE__ */ F("div", {
4078
4076
  className: "flex flex-col gap-2 w-full",
4079
4077
  children: [
4080
- W && /* @__PURE__ */ P(Mi, {
4078
+ U && /* @__PURE__ */ P(Di, {
4081
4079
  compact: !0,
4082
4080
  planEndpoint: t.educationPlaylistsApiUrl || void 0,
4083
4081
  openHref: t.educationPlaylistsPageUrl || void 0,
@@ -4091,16 +4089,16 @@ function Bi() {
4091
4089
  maxWidth: "100%"
4092
4090
  }
4093
4091
  }),
4094
- me && /* @__PURE__ */ P(ji, {
4092
+ he && /* @__PURE__ */ P(Ei, {
4095
4093
  compact: !0,
4096
4094
  expandable: !0,
4097
- maxTopics: fe,
4098
- expandedMaxTopics: Pi,
4099
- showImages: pe,
4100
- apiEndpoint: le,
4101
- topics: de,
4095
+ maxTopics: pe,
4096
+ expandedMaxTopics: ki,
4097
+ showImages: me,
4098
+ apiEndpoint: ue,
4099
+ topics: fe,
4102
4100
  source: V,
4103
- limit: Pi,
4101
+ limit: ki,
4104
4102
  className: "rounded-2xl w-full",
4105
4103
  style: {
4106
4104
  background: "rgba(255,255,255,0.08)",
@@ -4110,7 +4108,7 @@ function Bi() {
4110
4108
  maxWidth: "100%"
4111
4109
  }
4112
4110
  }),
4113
- v && /* @__PURE__ */ P(Ai, {
4111
+ v && /* @__PURE__ */ P(Ti, {
4114
4112
  compact: !0,
4115
4113
  forecastDays: x,
4116
4114
  forecastHours: C,
@@ -4127,24 +4125,24 @@ function Bi() {
4127
4125
  ]
4128
4126
  })
4129
4127
  }),
4130
- /* @__PURE__ */ P(pi, { listFooterLinks: ce })
4128
+ /* @__PURE__ */ P(ci, { listFooterLinks: le })
4131
4129
  ]
4132
4130
  })]
4133
4131
  })
4134
4132
  }),
4135
4133
  m && /* @__PURE__ */ P(y, {
4136
4134
  fallback: null,
4137
- children: /* @__PURE__ */ P(Ni, {
4135
+ children: /* @__PURE__ */ P(Oi, {
4138
4136
  open: f,
4139
4137
  onOpenChange: p
4140
4138
  })
4141
4139
  }),
4142
- /* @__PURE__ */ P(hi, {})
4140
+ /* @__PURE__ */ P(ui, {})
4143
4141
  ]
4144
4142
  });
4145
4143
  }
4146
4144
  // src/ui/Loader.tsx
4147
- var Vi = () => /* @__PURE__ */ F("svg", {
4145
+ var Ii = () => /* @__PURE__ */ F("svg", {
4148
4146
  "aria-hidden": "true",
4149
4147
  className: "w-8 h-8 text-border fill-secondary animate-spin",
4150
4148
  viewBox: "0 0 100 101",
@@ -4159,7 +4157,7 @@ var Vi = () => /* @__PURE__ */ F("svg", {
4159
4157
  })]
4160
4158
  });
4161
4159
  // src/components/ConfigError.tsx
4162
- function Hi() {
4160
+ function Li() {
4163
4161
  return /* @__PURE__ */ P("div", {
4164
4162
  className: "flex min-h-screen flex-col items-center justify-center p-8",
4165
4163
  children: /* @__PURE__ */ F("div", {
@@ -4276,15 +4274,15 @@ function Hi() {
4276
4274
  });
4277
4275
  }
4278
4276
  // src/components/ChatConversation/ChatWindow.tsx
4279
- var Ui = () => import("./ChatConversationThread-CEsCKbEo.js"), Wi = S(Ui), Gi = () => {
4277
+ var Ri = () => import("./ChatConversationThread-B70yZMw_.js"), zi = S(Ri), Bi = () => {
4280
4278
  let e = j(), { hasError: t, isReady: r, notFound: i, messages: a } = u(), { isAuthenticated: o } = n(), s = r && !i && a.length === 0;
4281
4279
  return T(() => {
4282
4280
  if (!s) return;
4283
4281
  if (typeof window.requestIdleCallback == "function") {
4284
- let e = window.requestIdleCallback(() => void Ui(), { timeout: 5e3 });
4282
+ let e = window.requestIdleCallback(() => void Ri(), { timeout: 5e3 });
4285
4283
  return () => window.cancelIdleCallback(e);
4286
4284
  }
4287
- let e = window.setTimeout(() => void Ui(), 3e3);
4285
+ let e = window.setTimeout(() => void Ri(), 3e3);
4288
4286
  return () => window.clearTimeout(e);
4289
4287
  }, [s]), T(() => {
4290
4288
  r && i && !o && e.replace("/");
@@ -4293,9 +4291,9 @@ var Ui = () => import("./ChatConversationThread-CEsCKbEo.js"), Wi = S(Ui), Gi =
4293
4291
  i,
4294
4292
  o,
4295
4293
  e
4296
- ]), t ? /* @__PURE__ */ P(Hi, {}) : r && i && !o ? /* @__PURE__ */ P("div", {
4294
+ ]), t ? /* @__PURE__ */ P(Li, {}) : r && i && !o ? /* @__PURE__ */ P("div", {
4297
4295
  className: "flex flex-row items-center justify-center min-h-screen",
4298
- children: /* @__PURE__ */ P(Vi, {})
4296
+ children: /* @__PURE__ */ P(Ii, {})
4299
4297
  }) : r ? i ? /* @__PURE__ */ F("div", {
4300
4298
  className: "flex min-h-screen flex-col items-center justify-center gap-3 px-4 text-center",
4301
4299
  children: [/* @__PURE__ */ P("p", {
@@ -4310,15 +4308,15 @@ var Ui = () => import("./ChatConversationThread-CEsCKbEo.js"), Wi = S(Ui), Gi =
4310
4308
  }) : /* @__PURE__ */ P("div", { children: a.length > 0 ? /* @__PURE__ */ P(N, { children: /* @__PURE__ */ P(y, {
4311
4309
  fallback: /* @__PURE__ */ P("div", {
4312
4310
  className: "flex flex-row items-center justify-center min-h-screen",
4313
- children: /* @__PURE__ */ P(Vi, {})
4311
+ children: /* @__PURE__ */ P(Ii, {})
4314
4312
  }),
4315
- children: /* @__PURE__ */ P(Wi, {})
4316
- }) }) : /* @__PURE__ */ P(Bi, {}) }) : /* @__PURE__ */ P("div", {
4313
+ children: /* @__PURE__ */ P(zi, {})
4314
+ }) }) : /* @__PURE__ */ P(Fi, {}) }) : /* @__PURE__ */ P("div", {
4317
4315
  className: "flex flex-row items-center justify-center min-h-screen",
4318
- children: /* @__PURE__ */ P(Vi, {})
4316
+ children: /* @__PURE__ */ P(Ii, {})
4319
4317
  });
4320
- }, Ki = "https://qwksearch.com", qi = null, Ji = Ki, Yi = !1;
4321
- function Xi(e, t) {
4318
+ }, Vi = "https://qwksearch.com", Hi = null, Ui = Vi, Wi = !1;
4319
+ function Gi(e, t) {
4322
4320
  let n;
4323
4321
  n = typeof e == "string" ? e : e instanceof URL ? e.href : e.url;
4324
4322
  try {
@@ -4328,32 +4326,32 @@ function Xi(e, t) {
4328
4326
  return !1;
4329
4327
  }
4330
4328
  }
4331
- function Zi() {
4332
- if (Yi || typeof window > "u" || typeof window.fetch != "function") return;
4333
- Yi = !0;
4329
+ function Ki() {
4330
+ if (Wi || typeof window > "u" || typeof window.fetch != "function") return;
4331
+ Wi = !0;
4334
4332
  let e = window.fetch.bind(window);
4335
4333
  window.fetch = (t, n) => {
4336
- if (!qi || !Xi(t, Ji)) return e(t, n);
4334
+ if (!Hi || !Gi(t, Ui)) return e(t, n);
4337
4335
  let r = new Headers(n?.headers ?? (t instanceof Request ? t.headers : void 0));
4338
- return !r.has("x-api-key") && !r.has("authorization") && r.set("X-API-Key", qi), e(t, {
4336
+ return !r.has("x-api-key") && !r.has("authorization") && r.set("X-API-Key", Hi), e(t, {
4339
4337
  ...n,
4340
4338
  headers: r
4341
4339
  });
4342
4340
  };
4343
4341
  }
4344
- function Qi(e, t = Ki) {
4345
- qi = e || null, Ji = t.replace(/\/+$/, ""), qi && Zi();
4342
+ function qi(e, t = Vi) {
4343
+ Hi = e || null, Ui = t.replace(/\/+$/, ""), Hi && Ki();
4346
4344
  }
4347
- function $i() {
4348
- return qi;
4345
+ function Ji() {
4346
+ return Hi;
4349
4347
  }
4350
- function ea(e, t) {
4348
+ function Yi(e, t) {
4351
4349
  let n = t ?? (typeof window < "u" ? `${window.location.pathname}${window.location.search}` : "/");
4352
4350
  return `${e}${e.includes("?") ? "&" : "?"}returnTo=${encodeURIComponent(n)}`;
4353
4351
  }
4354
- function ta(e) {
4352
+ function Xi(e) {
4355
4353
  let t = e.qwksearchOrigin ?? "https://qwksearch.com", n = { connected: !1 }, r = /* @__PURE__ */ new Set(), i = (i) => {
4356
- n = i, Qi(i.connected ? i.apiKey ?? null : null, t), e.onSession?.(i), r.forEach((e) => e());
4354
+ n = i, qi(i.connected ? i.apiKey ?? null : null, t), e.onSession?.(i), r.forEach((e) => e());
4357
4355
  }, a = null, o = () => (a ??= fetch(e.sessionUrl, {
4358
4356
  credentials: "same-origin",
4359
4357
  headers: { Accept: "application/json" }
@@ -4370,7 +4368,7 @@ function ta(e) {
4370
4368
  },
4371
4369
  oneTap: (e) => {},
4372
4370
  signIn: { social: (t) => {
4373
- typeof window < "u" && window.location.assign(ea(e.connectUrl));
4371
+ typeof window < "u" && window.location.assign(Yi(e.connectUrl));
4374
4372
  } },
4375
4373
  signOut: async (t) => {
4376
4374
  try {
@@ -4386,14 +4384,14 @@ function ta(e) {
4386
4384
  };
4387
4385
  }
4388
4386
  // src/components/ArticleReader/ArticlePanelHeader.tsx
4389
- var na = ({ onClose: e }) => /* @__PURE__ */ P("div", {
4387
+ var Zi = ({ onClose: e }) => /* @__PURE__ */ P("div", {
4390
4388
  className: "flex items-center justify-between bg-secondary px-4 py-3 border-b border-border",
4391
4389
  children: /* @__PURE__ */ P("button", {
4392
4390
  onClick: e,
4393
4391
  className: "rounded-md p-1 hover:bg-accent transition-colors",
4394
- children: /* @__PURE__ */ P(nt, { className: "h-5 w-5" })
4392
+ children: /* @__PURE__ */ P(rt, { className: "h-5 w-5" })
4395
4393
  })
4396
- }), ra = Dt("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-2xl text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
4394
+ }), Qi = Ot("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-2xl text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
4397
4395
  variants: {
4398
4396
  variant: {
4399
4397
  default: "bg-primary text-primary-foreground hover:bg-primary/90",
@@ -4416,9 +4414,9 @@ var na = ({ onClose: e }) => /* @__PURE__ */ P("div", {
4416
4414
  }
4417
4415
  });
4418
4416
  function Q({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
4419
- return /* @__PURE__ */ P(r ? Et : "button", {
4417
+ return /* @__PURE__ */ P(r ? Dt : "button", {
4420
4418
  "data-slot": "button",
4421
- className: h(ra({
4419
+ className: h(Qi({
4422
4420
  variant: t,
4423
4421
  size: n,
4424
4422
  className: e
@@ -4427,7 +4425,7 @@ function Q({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
4427
4425
  });
4428
4426
  }
4429
4427
  // src/components/ArticleReader/ArticleActionButtons.tsx
4430
- var ia = {
4428
+ var $i = {
4431
4429
  ask: {
4432
4430
  alt: !0,
4433
4431
  key: "a"
@@ -4468,12 +4466,12 @@ var ia = {
4468
4466
  alt: !1,
4469
4467
  key: "Escape"
4470
4468
  }
4471
- }, aa = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "");
4472
- function oa(e) {
4473
- let { alt: t, key: n } = ia[e], r = n === "Escape" ? "Esc" : n.length === 1 ? n.toUpperCase() : n;
4474
- return t ? aa ? `⌥${r}` : `Alt+${r}` : r;
4469
+ }, ea = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || "");
4470
+ function ta(e) {
4471
+ let { alt: t, key: n } = $i[e], r = n === "Escape" ? "Esc" : n.length === 1 ? n.toUpperCase() : n;
4472
+ return t ? ea ? `⌥${r}` : `Alt+${r}` : r;
4475
4473
  }
4476
- var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80 hover:text-foreground text-muted-foreground"), $ = ({ label: e, action: t, children: n }) => /* @__PURE__ */ F(l, { children: [/* @__PURE__ */ P(s, {
4474
+ var na = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80 hover:text-foreground text-muted-foreground"), $ = ({ label: e, action: t, children: n }) => /* @__PURE__ */ F(l, { children: [/* @__PURE__ */ P(s, {
4477
4475
  asChild: !0,
4478
4476
  children: n
4479
4477
  }), /* @__PURE__ */ P(a, {
@@ -4482,10 +4480,10 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4482
4480
  className: "flex items-center gap-1.5",
4483
4481
  children: [/* @__PURE__ */ P("span", { children: e }), t && /* @__PURE__ */ P("kbd", {
4484
4482
  className: "rounded bg-primary-foreground/20 px-1 py-0.5 text-[10px] font-semibold leading-none tracking-wide",
4485
- children: oa(t)
4483
+ children: ta(t)
4486
4484
  })]
4487
4485
  })
4488
- })] }), ca = ({ isLoadingAI: e, isLoadingFollowups: t, isLoadingFavorite: n, isFavorited: r, isHighlightMode: i, articleUrl: a, fontScale: o, onAskClick: s, onSuggestClick: c, onCopyClick: l, onShareClick: u, onFavoriteClick: d, onHighlightToggle: f, onZoomIn: p, onZoomOut: m, onZoomReset: g, onClose: _ }) => {
4486
+ })] }), ra = ({ isLoadingAI: e, isLoadingFollowups: t, isLoadingFavorite: n, isFavorited: r, isHighlightMode: i, articleUrl: a, fontScale: o, onAskClick: s, onSuggestClick: c, onCopyClick: l, onShareClick: u, onFavoriteClick: d, onHighlightToggle: f, onZoomIn: p, onZoomOut: m, onZoomReset: g, onClose: _ }) => {
4489
4487
  let v = p || m, y = Math.round((o ?? 1) * 100);
4490
4488
  return /* @__PURE__ */ F("div", {
4491
4489
  className: "flex flex-nowrap items-center gap-1 rounded-2xl border border-muted bg-gradient-to-b from-background to-muted/30 p-1 shadow-sm",
@@ -4499,7 +4497,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4499
4497
  variant: "ghost",
4500
4498
  size: "sm",
4501
4499
  className: h("flex items-center gap-2 px-3 h-9 rounded-xl transition-all duration-200", "hover:bg-muted/80 hover:text-foreground text-muted-foreground"),
4502
- children: [/* @__PURE__ */ P(ee, { className: "size-4" }), /* @__PURE__ */ P("span", {
4500
+ children: [/* @__PURE__ */ P(te, { className: "size-4" }), /* @__PURE__ */ P("span", {
4503
4501
  className: "font-medium",
4504
4502
  children: e ? "..." : "Ask"
4505
4503
  })]
@@ -4514,7 +4512,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4514
4512
  variant: "ghost",
4515
4513
  size: "sm",
4516
4514
  className: h("flex items-center gap-2 px-3 h-9 rounded-xl transition-all duration-200", "hover:bg-muted/80 hover:text-foreground text-muted-foreground"),
4517
- children: [/* @__PURE__ */ P(Ne, { className: "size-4" }), /* @__PURE__ */ P("span", {
4515
+ children: [/* @__PURE__ */ P(Pe, { className: "size-4" }), /* @__PURE__ */ P("span", {
4518
4516
  className: "font-medium",
4519
4517
  children: "Suggest"
4520
4518
  })]
@@ -4527,8 +4525,8 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4527
4525
  onClick: l,
4528
4526
  variant: "ghost",
4529
4527
  size: "icon",
4530
- className: sa,
4531
- children: /* @__PURE__ */ P(oe, { className: "size-4" })
4528
+ className: na,
4529
+ children: /* @__PURE__ */ P(se, { className: "size-4" })
4532
4530
  })
4533
4531
  }),
4534
4532
  /* @__PURE__ */ P($, {
@@ -4537,8 +4535,8 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4537
4535
  onClick: u,
4538
4536
  variant: "ghost",
4539
4537
  size: "icon",
4540
- className: sa,
4541
- children: /* @__PURE__ */ P(We, { className: "size-4" })
4538
+ className: na,
4539
+ children: /* @__PURE__ */ P(Ge, { className: "size-4" })
4542
4540
  })
4543
4541
  }),
4544
4542
  /* @__PURE__ */ P($, {
@@ -4549,7 +4547,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4549
4547
  variant: "ghost",
4550
4548
  size: "icon",
4551
4549
  className: h("h-9 w-9 rounded-xl transition-all duration-200", i ? "text-yellow-500 bg-yellow-50 dark:bg-yellow-950/30 hover:bg-yellow-100 dark:hover:bg-yellow-950/50" : "hover:bg-muted/80 hover:text-foreground text-muted-foreground"),
4552
- children: /* @__PURE__ */ P(Ce, { className: "size-4" })
4550
+ children: /* @__PURE__ */ P(we, { className: "size-4" })
4553
4551
  })
4554
4552
  }),
4555
4553
  /* @__PURE__ */ P($, {
@@ -4561,7 +4559,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4561
4559
  variant: "ghost",
4562
4560
  size: "icon",
4563
4561
  className: h("h-9 w-9 rounded-xl transition-all duration-200", r ? "text-yellow-500 hover:text-yellow-600 hover:bg-yellow-50 dark:hover:bg-yellow-950/30" : "hover:bg-muted/80 hover:text-foreground text-muted-foreground"),
4564
- children: /* @__PURE__ */ P(Ye, { className: h("size-4", r && "fill-yellow-400") })
4562
+ children: /* @__PURE__ */ P(Xe, { className: h("size-4", r && "fill-yellow-400") })
4565
4563
  })
4566
4564
  }),
4567
4565
  a && /* @__PURE__ */ P($, {
@@ -4571,12 +4569,12 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4571
4569
  asChild: !0,
4572
4570
  variant: "ghost",
4573
4571
  size: "icon",
4574
- className: sa,
4572
+ className: na,
4575
4573
  children: /* @__PURE__ */ P("a", {
4576
4574
  href: a,
4577
4575
  target: "_blank",
4578
4576
  rel: "noopener noreferrer",
4579
- children: /* @__PURE__ */ P(pe, { className: "size-4" })
4577
+ children: /* @__PURE__ */ P(me, { className: "size-4" })
4580
4578
  })
4581
4579
  })
4582
4580
  }),
@@ -4591,7 +4589,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4591
4589
  variant: "ghost",
4592
4590
  size: "icon",
4593
4591
  className: "h-8 w-8 rounded-lg text-muted-foreground transition-all duration-200 hover:bg-muted/80 hover:text-foreground",
4594
- children: /* @__PURE__ */ P(it, { className: "size-4" })
4592
+ children: /* @__PURE__ */ P(at, { className: "size-4" })
4595
4593
  })
4596
4594
  }),
4597
4595
  /* @__PURE__ */ P($, {
@@ -4612,7 +4610,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4612
4610
  variant: "ghost",
4613
4611
  size: "icon",
4614
4612
  className: "h-8 w-8 rounded-lg text-muted-foreground transition-all duration-200 hover:bg-muted/80 hover:text-foreground",
4615
- children: /* @__PURE__ */ P(rt, { className: "size-4" })
4613
+ children: /* @__PURE__ */ P(it, { className: "size-4" })
4616
4614
  })
4617
4615
  })
4618
4616
  ]
@@ -4624,13 +4622,13 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4624
4622
  onClick: _,
4625
4623
  variant: "ghost",
4626
4624
  size: "icon",
4627
- className: h(sa, !v && "ml-auto"),
4628
- children: /* @__PURE__ */ P(nt, { className: "size-4" })
4625
+ className: h(na, !v && "ml-auto"),
4626
+ children: /* @__PURE__ */ P(rt, { className: "size-4" })
4629
4627
  })
4630
4628
  })
4631
4629
  ]
4632
4630
  });
4633
- }, la = ({ value: e, onChange: t, onSubmit: n }) => /* @__PURE__ */ P("div", {
4631
+ }, ia = ({ value: e, onChange: t, onSubmit: n }) => /* @__PURE__ */ P("div", {
4634
4632
  className: "relative",
4635
4633
  children: /* @__PURE__ */ P("input", {
4636
4634
  value: e,
@@ -4640,7 +4638,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4640
4638
  placeholder: "Ask AI any question...",
4641
4639
  className: "w-full px-3 py-2 text-sm rounded-md border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
4642
4640
  })
4643
- }), ua = ({ questions: e, isLoading: n, error: r, onQuestionClick: i }) => {
4641
+ }), aa = ({ questions: e, isLoading: n, error: r, onQuestionClick: i }) => {
4644
4642
  let a = v.useMemo(() => {
4645
4643
  let t = [];
4646
4644
  return e.forEach((e) => {
@@ -4677,7 +4675,7 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4677
4675
  children: r
4678
4676
  })
4679
4677
  ] });
4680
- }, da = ({ response: e, isLoading: t, error: n }) => /* @__PURE__ */ F(N, { children: [
4678
+ }, oa = ({ response: e, isLoading: t, error: n }) => /* @__PURE__ */ F(N, { children: [
4681
4679
  t && /* @__PURE__ */ P("div", {
4682
4680
  className: "flex justify-center",
4683
4681
  children: /* @__PURE__ */ P("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500" })
@@ -4691,47 +4689,13 @@ var sa = h("h-9 w-9 rounded-xl transition-all duration-200", "hover:bg-muted/80
4691
4689
  className: "bg-red-500 text-white p-2 rounded-md text-sm",
4692
4690
  children: n
4693
4691
  })
4694
- ] }), fa = "h1, h2, h3", pa = /^[A-Za-z][\w:.-]*$/;
4695
- function ma(e) {
4696
- return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48) || "section";
4697
- }
4698
- function ha(e) {
4699
- if (!e || typeof DOMParser > "u") return {
4700
- html: e,
4701
- items: []
4702
- };
4703
- let t = new DOMParser().parseFromString(`<body>${e}</body>`, "text/html"), n = Array.from(t.body.querySelectorAll(fa)).filter((e) => (e.textContent ?? "").trim() !== "");
4704
- if (n.length === 0) return {
4705
- html: e,
4706
- items: []
4707
- };
4708
- let r = new Set(n.map((e) => e.id).filter((e) => pa.test(e))), i = /* @__PURE__ */ new Set(), a = n.map((e, t) => {
4709
- let n = e.id;
4710
- if (!pa.test(n) || i.has(n)) {
4711
- let a = (e.textContent ?? "").trim();
4712
- for (n = `outline-${t + 1}-${ma(a)}`; r.has(n) || i.has(n);) n = `${n}-x`;
4713
- e.id = n;
4714
- }
4715
- return i.add(n), {
4716
- title: (e.textContent ?? "").replace(/\s+/g, " ").trim(),
4717
- url: `#${n}`,
4718
- depth: Number(e.tagName.slice(1))
4719
- };
4720
- });
4721
- return {
4722
- html: t.body.innerHTML,
4723
- items: a
4724
- };
4725
- }
4726
- // src/components/ArticleReader/LexicalArticleViewer.tsx
4727
- var ga = ({ html: e, isHighlightMode: t = !1, fontScale: n = 1, onOutlineChange: r }) => {
4728
- let [i, a] = O(""), o = D(r);
4729
- return o.current = r, T(() => {
4730
- let t = ha(kt.sanitize(e || "", {
4692
+ ] }), sa = ({ html: e, isHighlightMode: t = !1, fontScale: n = 1 }) => {
4693
+ let [r, i] = O("");
4694
+ return T(() => {
4695
+ i(At.sanitize(e || "", {
4731
4696
  ADD_TAGS: ["figure", "figcaption"],
4732
4697
  ADD_ATTR: ["loading"]
4733
4698
  }));
4734
- a(t.html), o.current?.(t.items);
4735
4699
  }, [e]), /* @__PURE__ */ P("div", {
4736
4700
  className: [
4737
4701
  "prose prose-neutral dark:prose-invert max-w-none",
@@ -4746,9 +4710,9 @@ var ga = ({ html: e, isHighlightMode: t = !1, fontScale: n = 1, onOutlineChange:
4746
4710
  fontSize: `${n}em`,
4747
4711
  fontFamily: "ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif"
4748
4712
  },
4749
- dangerouslySetInnerHTML: { __html: i }
4713
+ dangerouslySetInnerHTML: { __html: r }
4750
4714
  });
4751
- }, _a = ({ article: e, isHighlightMode: t, fontScale: n = 1, onOutlineChange: r }) => /* @__PURE__ */ P("div", {
4715
+ }, ca = ({ article: e, isHighlightMode: t, fontScale: n = 1 }) => /* @__PURE__ */ P("div", {
4752
4716
  className: "border-t border-border pt-6",
4753
4717
  children: /* @__PURE__ */ F("div", { children: [
4754
4718
  /* @__PURE__ */ P("div", { className: "flex items-start justify-between mb-2" }),
@@ -4769,93 +4733,24 @@ var ga = ({ html: e, isHighlightMode: t = !1, fontScale: n = 1, onOutlineChange:
4769
4733
  }),
4770
4734
  /* @__PURE__ */ P("div", {
4771
4735
  id: "article-content",
4772
- children: /* @__PURE__ */ P(ga, {
4736
+ children: /* @__PURE__ */ P(sa, {
4773
4737
  html: e.html || "",
4774
4738
  isHighlightMode: t,
4775
- fontScale: n,
4776
- onOutlineChange: r
4739
+ fontScale: n
4777
4740
  })
4778
4741
  })
4779
4742
  ] })
4780
- });
4781
- // src/components/ArticleReader/ArticleOutline.tsx
4782
- function va() {
4783
- return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
4784
- }
4785
- function ya(e) {
4786
- let t = decodeURIComponent((e.currentTarget.getAttribute("href") ?? "").slice(1)), n = t ? document.getElementById(t) : null;
4787
- n && (e.preventDefault(), n.scrollIntoView({
4788
- behavior: va() ? "auto" : "smooth",
4789
- block: "start"
4790
- }), n.hasAttribute("tabindex") || n.setAttribute("tabindex", "-1"), n.focus({ preventScroll: !0 }));
4791
- }
4792
- var ba = ({ items: e }) => {
4793
- let t = C(ya, []);
4794
- return e.length === 0 ? /* @__PURE__ */ P(Mt, {}) : /* @__PURE__ */ P(At, {
4795
- toc: e,
4796
- children: /* @__PURE__ */ P(jt, { children: /* @__PURE__ */ P(Pt, { children: e.map((e) => /* @__PURE__ */ P(Nt, {
4797
- item: e,
4798
- onClick: t
4799
- }, e.url)) }) })
4800
- });
4801
- }, xa = [{
4802
- value: "questions",
4803
- label: "Questions"
4804
- }, {
4805
- value: "outline",
4806
- label: "Outline"
4807
- }];
4808
- function Sa(e, t) {
4809
- return {
4810
- tab: `${e}-tab-${t}`,
4811
- panel: `${e}-panel-${t}`
4812
- };
4813
- }
4814
- var Ca = ({ value: e, onValueChange: t, idBase: n }) => {
4815
- let r = D({}), i = (e) => {
4816
- t(e), r.current[e]?.focus();
4817
- }, a = (e, t) => {
4818
- let n = xa.length - 1, r = e.key === "ArrowRight" ? t === n ? 0 : t + 1 : e.key === "ArrowLeft" ? t === 0 ? n : t - 1 : e.key === "Home" ? 0 : e.key === "End" ? n : null;
4819
- r !== null && (e.preventDefault(), i(xa[r].value));
4820
- };
4821
- return /* @__PURE__ */ P("div", {
4822
- role: "tablist",
4823
- "aria-label": "Article sidebar",
4824
- className: "flex gap-1 border-b border-border",
4825
- children: xa.map((i, o) => {
4826
- let s = i.value === e, c = Sa(n, i.value);
4827
- return /* @__PURE__ */ P("button", {
4828
- ref: (e) => {
4829
- r.current[i.value] = e;
4830
- },
4831
- type: "button",
4832
- role: "tab",
4833
- id: c.tab,
4834
- "aria-selected": s,
4835
- "aria-controls": c.panel,
4836
- tabIndex: s ? 0 : -1,
4837
- onClick: () => t(i.value),
4838
- onKeyDown: (e) => a(e, o),
4839
- className: [
4840
- "-mb-px rounded-t-md border-b-2 px-3 py-1.5 text-sm font-medium transition-colors",
4841
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
4842
- s ? "border-primary text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
4843
- ].join(" "),
4844
- children: i.label
4845
- }, i.value);
4846
- })
4847
- });
4848
- }, wa = /(?:https?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g, Ta = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
4849
- function Ea(e) {
4743
+ }), la = /(?:https?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)/g, ua = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
4744
+ function da(e) {
4850
4745
  return e.includes("](") || e.includes(")[") ? !1 : /\.(com|org|net|io|dev|co|uk|de|fr|it|es|jp|cn|in|br|au|ca|us|gov|edu|mil|int|xyz|info|app|tech|online|site|website|store|shop|blog|news|tv|me|cc|ws|name|mobi|asia|tel|travel|jobs|pro|museum|coop|aero|arpa|biz|cat|jobs|post|tel|xxx|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)(?:\/|$)/i.test(e);
4851
4746
  }
4852
- function Da(e) {
4747
+ function fa(e) {
4853
4748
  return /^https?:\/\//i.test(e) ? e : `https://${e}`;
4854
4749
  }
4855
- function Oa(e) {
4750
+ function pa(e) {
4856
4751
  if (!e || typeof e != "string") return e;
4857
4752
  let t = e, n = [], r;
4858
- for (Ta.lastIndex = 0; (r = Ta.exec(t)) !== null;) {
4753
+ for (ua.lastIndex = 0; (r = ua.exec(t)) !== null;) {
4859
4754
  let e = r[0], i = r.index, a = t.substring(0, i), o = t.substring(i + e.length);
4860
4755
  !a.endsWith("](") && !o.startsWith(")") && n.push({
4861
4756
  email: e,
@@ -4867,9 +4762,9 @@ function Oa(e) {
4867
4762
  t = t.substring(0, i) + `[${r}](mailto:${r})` + t.substring(i + r.length);
4868
4763
  }
4869
4764
  let i = [], a;
4870
- for (wa.lastIndex = 0; (a = wa.exec(t)) !== null;) {
4765
+ for (la.lastIndex = 0; (a = la.exec(t)) !== null;) {
4871
4766
  let e = a[0], n = a.index;
4872
- if (Ta.test(e)) continue;
4767
+ if (ua.test(e)) continue;
4873
4768
  let r = t.substring(0, n), o = t.substring(n + e.length);
4874
4769
  if (r.endsWith("](") || o.startsWith(")") || (r.match(/```/g) || []).length % 2 != 0) continue;
4875
4770
  let s = r.lastIndexOf("`");
@@ -4877,22 +4772,22 @@ function Oa(e) {
4877
4772
  let e = t.substring(s + 1).indexOf("`");
4878
4773
  if (e !== -1 && e > n - s - 1) continue;
4879
4774
  }
4880
- Ea(e) && i.push({
4775
+ da(e) && i.push({
4881
4776
  url: e,
4882
4777
  index: n
4883
4778
  });
4884
4779
  }
4885
4780
  for (let e = i.length - 1; e >= 0; e--) {
4886
- let { url: n, index: r } = i[e], a = Da(n);
4781
+ let { url: n, index: r } = i[e], a = fa(n);
4887
4782
  t = t.substring(0, r) + `[${n}](${a})` + t.substring(r + n.length);
4888
4783
  }
4889
4784
  return t;
4890
4785
  }
4891
4786
  // src/components/ArticleReader/unified-markdown.tsx
4892
- function ka(e) {
4787
+ function ma(e) {
4893
4788
  return !e || e.startsWith("http://") || e.startsWith("https://") || e.includes("://") ? !1 : e.startsWith("/") || e.startsWith("#");
4894
4789
  }
4895
- function Aa(e, t) {
4790
+ function ha(e, t) {
4896
4791
  if (t.startsWith("#")) {
4897
4792
  e.preventDefault();
4898
4793
  let n = t.substring(1), r = document.getElementById(n);
@@ -4902,7 +4797,7 @@ function Aa(e, t) {
4902
4797
  });
4903
4798
  }
4904
4799
  }
4905
- function ja({ code: e }) {
4800
+ function ga({ code: e }) {
4906
4801
  let [t, n] = O(!1), r = C(async () => {
4907
4802
  try {
4908
4803
  await navigator.clipboard.writeText(e), n(!0), setTimeout(() => n(!1), 2e3);
@@ -4914,10 +4809,10 @@ function ja({ code: e }) {
4914
4809
  onClick: r,
4915
4810
  className: h("absolute top-3 right-3 p-1.5 rounded-md", "opacity-0 group-hover:opacity-100 transition-opacity duration-150", "bg-zinc-200/80 hover:bg-zinc-300 dark:bg-zinc-700/80 dark:hover:bg-zinc-600", "text-zinc-600 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200", "focus:outline-none focus:ring-1 focus:ring-zinc-400 dark:focus:ring-zinc-500"),
4916
4811
  "aria-label": t ? "Copied!" : "Copy code",
4917
- children: t ? /* @__PURE__ */ P(ne, { className: "h-4 w-4 text-green-600 dark:text-green-400" }) : /* @__PURE__ */ P(ue, { className: "h-4 w-4" })
4812
+ children: t ? /* @__PURE__ */ P(re, { className: "h-4 w-4 text-green-600 dark:text-green-400" }) : /* @__PURE__ */ P(de, { className: "h-4 w-4" })
4918
4813
  });
4919
4814
  }
4920
- function Ma({ children: e }) {
4815
+ function _a({ children: e }) {
4921
4816
  let t = D(null), [n, r] = O("");
4922
4817
  return T(() => {
4923
4818
  if (t.current) {
@@ -4933,18 +4828,18 @@ function Ma({ children: e }) {
4933
4828
  ref: t,
4934
4829
  className: h("p-4 rounded-xl overflow-x-auto", "bg-zinc-100 dark:bg-zinc-900", "border border-zinc-200 dark:border-zinc-800", "text-[13px] font-mono leading-relaxed", "text-zinc-800 dark:text-zinc-200", "[&_code]:bg-transparent [&_code]:text-inherit [&_code]:p-0"),
4935
4830
  children: e
4936
- }), n && /* @__PURE__ */ P(ja, { code: n })]
4831
+ }), n && /* @__PURE__ */ P(ga, { code: n })]
4937
4832
  });
4938
4833
  }
4939
- var Na = v.memo(({ content: e, className: t, isStreaming: n = !1 }) => {
4834
+ var va = v.memo(({ content: e, className: t, isStreaming: n = !1 }) => {
4940
4835
  if (!e) return /* @__PURE__ */ P("div", {
4941
4836
  className: h("text-muted-foreground text-sm", t),
4942
4837
  children: "No content"
4943
4838
  });
4944
- let r = Oa(e);
4839
+ let r = pa(e);
4945
4840
  return /* @__PURE__ */ P("div", {
4946
4841
  className: h("kortix-markdown", t),
4947
- children: /* @__PURE__ */ P(Ft, {
4842
+ children: /* @__PURE__ */ P(jt, {
4948
4843
  isAnimating: n,
4949
4844
  components: {
4950
4845
  h1: ({ children: e }) => /* @__PURE__ */ P("h1", {
@@ -4988,13 +4883,13 @@ var Na = v.memo(({ content: e, className: t, isStreaming: n = !1 }) => {
4988
4883
  children: e
4989
4884
  }),
4990
4885
  a: ({ href: e, children: t }) => {
4991
- let n = ka(e), r = e?.startsWith("#"), i = h("font-medium text-foreground", "underline decoration-foreground/30 underline-offset-[3px] decoration-[1px]", "hover:decoration-foreground/60 transition-colors duration-150");
4886
+ let n = ma(e), r = e?.startsWith("#"), i = h("font-medium text-foreground", "underline decoration-foreground/30 underline-offset-[3px] decoration-[1px]", "hover:decoration-foreground/60 transition-colors duration-150");
4992
4887
  return r ? /* @__PURE__ */ P("a", {
4993
4888
  href: e,
4994
- onClick: (t) => Aa(t, e),
4889
+ onClick: (t) => ha(t, e),
4995
4890
  className: i,
4996
4891
  children: t
4997
- }) : n ? /* @__PURE__ */ P(Tt, {
4892
+ }) : n ? /* @__PURE__ */ P(Et, {
4998
4893
  href: e || "#",
4999
4894
  className: i,
5000
4895
  children: t
@@ -5013,7 +4908,7 @@ var Na = v.memo(({ content: e, className: t, isStreaming: n = !1 }) => {
5013
4908
  className: "px-2 py-1 rounded-md text-[13px] font-mono bg-card dark:bg-[#161618] border border-neutral-200 dark:border-neutral-700/50 text-foreground",
5014
4909
  children: e
5015
4910
  }),
5016
- pre: ({ children: e }) => /* @__PURE__ */ P(Ma, { children: e }),
4911
+ pre: ({ children: e }) => /* @__PURE__ */ P(_a, { children: e }),
5017
4912
  blockquote: ({ children: e }) => /* @__PURE__ */ P("blockquote", {
5018
4913
  className: h("my-5 pl-4 py-1 text-sm", "border-l-2 border-border", "text-muted-foreground", "[&>p]:my-2"),
5019
4914
  children: e
@@ -5094,17 +4989,17 @@ var Na = v.memo(({ content: e, className: t, isStreaming: n = !1 }) => {
5094
4989
  })
5095
4990
  });
5096
4991
  });
5097
- Na.displayName = "UnifiedMarkdown";
4992
+ va.displayName = "UnifiedMarkdown";
5098
4993
  // src/app/MainViewProvider.tsx
5099
- var Pa = b(null), Fa = "qwksearch-main-view";
5100
- function Ia({ children: e, docsEnabled: t = !0 }) {
4994
+ var ya = b(null), ba = "qwksearch-main-view";
4995
+ function xa({ children: e, docsEnabled: t = !0 }) {
5101
4996
  let [n, r] = O("research"), [i, a] = O(0), o = C((e) => r(t ? e : "research"), [t]);
5102
4997
  T(() => {
5103
4998
  if (typeof window > "u" || !t) return;
5104
- let e = window.localStorage.getItem(Fa);
4999
+ let e = window.localStorage.getItem(ba);
5105
5000
  (e === "research" || e === "docs") && r(e);
5106
5001
  }, [t]), T(() => {
5107
- typeof window < "u" && t && window.localStorage.setItem(Fa, n);
5002
+ typeof window < "u" && t && window.localStorage.setItem(ba, n);
5108
5003
  }, [n, t]);
5109
5004
  let s = E(() => ({
5110
5005
  activeView: n,
@@ -5120,12 +5015,12 @@ function Ia({ children: e, docsEnabled: t = !0 }) {
5120
5015
  t,
5121
5016
  i
5122
5017
  ]);
5123
- return /* @__PURE__ */ P(Pa.Provider, {
5018
+ return /* @__PURE__ */ P(ya.Provider, {
5124
5019
  value: s,
5125
5020
  children: e
5126
5021
  });
5127
5022
  }
5128
- var La = Object.freeze({
5023
+ var Sa = Object.freeze({
5129
5024
  activeView: "research",
5130
5025
  setActiveView: () => {},
5131
5026
  docsEnabled: !1,
@@ -5133,12 +5028,12 @@ var La = Object.freeze({
5133
5028
  toggleToResearch: () => {},
5134
5029
  filesSidebarRequestId: 0,
5135
5030
  requestFilesSidebar: () => {}
5136
- }), Ra = !1;
5137
- function za() {
5138
- return w(Pa) || (!Ra && process.env.NODE_ENV !== "production" && (Ra = !0, console.error("useMainView was called outside a MainViewProvider. The component is rendering with view switching disabled — mount it inside MainViewProvider (see QwkSearchProviders).")), La);
5031
+ }), Ca = !1;
5032
+ function wa() {
5033
+ return w(ya) || (!Ca && process.env.NODE_ENV !== "production" && (Ca = !0, console.error("useMainView was called outside a MainViewProvider. The component is rendering with view switching disabled — mount it inside MainViewProvider (see QwkSearchProviders).")), Sa);
5139
5034
  }
5140
5035
  // src/settings/sections.json
5141
- var Ba = [
5036
+ var Ta = [
5142
5037
  {
5143
5038
  key: "account",
5144
5039
  name: "Account",
@@ -5202,24 +5097,24 @@ var Ba = [
5202
5097
  icon: "Volume2",
5203
5098
  dataAdd: "voice"
5204
5099
  }
5205
- ], Va = [
5100
+ ], Ea = [
5206
5101
  {
5207
5102
  key: "webSearch",
5208
5103
  title: "All",
5209
5104
  description: "Searches across all of the internet",
5210
- icon: /* @__PURE__ */ P(xe, { size: 16 })
5105
+ icon: /* @__PURE__ */ P(Se, { size: 16 })
5211
5106
  },
5212
5107
  {
5213
5108
  key: "academicSearch",
5214
5109
  title: "Academic",
5215
5110
  description: "Search in published academic papers",
5216
- icon: /* @__PURE__ */ P(Ze, { size: 16 })
5111
+ icon: /* @__PURE__ */ P(Qe, { size: 16 })
5217
5112
  },
5218
5113
  {
5219
5114
  key: "writingAssistant",
5220
5115
  title: "Writing",
5221
5116
  description: "Chat without searching the web",
5222
- icon: /* @__PURE__ */ P(Re, { size: 16 })
5117
+ icon: /* @__PURE__ */ P(ze, { size: 16 })
5223
5118
  },
5224
5119
  {
5225
5120
  key: "wolframAlphaSearch",
@@ -5231,15 +5126,15 @@ var Ba = [
5231
5126
  key: "youtubeSearch",
5232
5127
  title: "Youtube",
5233
5128
  description: "Search and watch videos",
5234
- icon: /* @__PURE__ */ P(Lt, { className: "h-[16px] w-auto mr-0.5" })
5129
+ icon: /* @__PURE__ */ P(Nt, { className: "h-[16px] w-auto mr-0.5" })
5235
5130
  },
5236
5131
  {
5237
5132
  key: "redditSearch",
5238
5133
  title: "Reddit",
5239
5134
  description: "Search for discussions and opinions",
5240
- icon: /* @__PURE__ */ P(It, { className: "h-[16px] w-auto mr-0.5" })
5135
+ icon: /* @__PURE__ */ P(Mt, { className: "h-[16px] w-auto mr-0.5" })
5241
5136
  }
5242
- ], Ha = [
5137
+ ], Da = [
5243
5138
  {
5244
5139
  href: "/",
5245
5140
  label: "Research",
@@ -5297,9 +5192,9 @@ var Ba = [
5297
5192
  }
5298
5193
  ];
5299
5194
  // src/components/SpotlightPalette/spotlightItems.ts
5300
- function Ua(e) {
5301
- let t = (e) => e === "/" ? Ve : e === "/workspace" ? ve : e === "/settings" ? He : e === "/docs" ? U : Ee;
5302
- return Ha.filter((t) => !t.docsOnly || e.docsEnabled).map((n) => ({
5195
+ function Oa(e) {
5196
+ let t = (e) => e === "/" ? He : e === "/workspace" ? ye : e === "/settings" ? Ue : e === "/docs" ? ee : De;
5197
+ return Da.filter((t) => !t.docsOnly || e.docsEnabled).map((n) => ({
5303
5198
  id: `page:${n.href}`,
5304
5199
  source: "page",
5305
5200
  name: n.label,
@@ -5309,7 +5204,7 @@ function Ua(e) {
5309
5204
  run: () => e.navigate(n.href)
5310
5205
  }));
5311
5206
  }
5312
- function Wa(e, t) {
5207
+ function ka(e, t) {
5313
5208
  let n = /* @__PURE__ */ new Date();
5314
5209
  return e.map((e) => ({
5315
5210
  id: `chat:${e.id}`,
@@ -5317,23 +5212,23 @@ function Wa(e, t) {
5317
5212
  name: e.title || "Untitled chat",
5318
5213
  meta: `${e.messageCount ?? 0} question${(e.messageCount ?? 0) === 1 ? "" : "s"}`,
5319
5214
  keywords: e.focusMode ?? "",
5320
- icon: Pe,
5215
+ icon: Fe,
5321
5216
  hint: f(n, e.lastMessageAt || e.createdAt),
5322
5217
  run: () => t.openChat(e.id)
5323
5218
  }));
5324
5219
  }
5325
- function Ga(e) {
5326
- return Ba.map((t) => ({
5220
+ function Aa(e) {
5221
+ return Ta.map((t) => ({
5327
5222
  id: `setting:${t.key}`,
5328
5223
  source: "setting",
5329
5224
  name: t.name,
5330
5225
  meta: t.description,
5331
5226
  keywords: `settings ${t.key}`,
5332
- icon: Ge,
5227
+ icon: Ke,
5333
5228
  run: () => e.openSettings(t.key)
5334
5229
  }));
5335
5230
  }
5336
- function Ka(e) {
5231
+ function ja(e) {
5337
5232
  let t = [
5338
5233
  {
5339
5234
  id: "action:new-chat",
@@ -5341,7 +5236,7 @@ function Ka(e) {
5341
5236
  name: "New chat",
5342
5237
  meta: "Start a fresh conversation",
5343
5238
  keywords: "clear reset blank",
5344
- icon: Be,
5239
+ icon: Ve,
5345
5240
  run: e.newChat
5346
5241
  },
5347
5242
  {
@@ -5350,7 +5245,7 @@ function Ka(e) {
5350
5245
  name: "Open settings",
5351
5246
  meta: "Models, connectors, search sources and preferences",
5352
5247
  keywords: "preferences configure",
5353
- icon: He,
5248
+ icon: Ue,
5354
5249
  run: () => e.openSettings()
5355
5250
  },
5356
5251
  {
@@ -5359,18 +5254,18 @@ function Ka(e) {
5359
5254
  name: e.incognito ? "Turn off incognito" : "Turn on incognito",
5360
5255
  meta: "Stop saving this conversation to history",
5361
5256
  keywords: "private incognito history off",
5362
- icon: me,
5257
+ icon: he,
5363
5258
  hint: e.incognito ? "on" : "off",
5364
5259
  run: () => e.setIncognito(!e.incognito)
5365
5260
  }
5366
5261
  ];
5367
- for (let n of Va) t.push({
5262
+ for (let n of Ea) t.push({
5368
5263
  id: `action:focus:${n.key}`,
5369
5264
  source: "action",
5370
5265
  name: `Focus: ${n.title}`,
5371
5266
  meta: n.description,
5372
5267
  keywords: `focus mode ${n.key}`,
5373
- icon: xe,
5268
+ icon: Se,
5374
5269
  hint: e.focusMode === n.key ? "current" : void 0,
5375
5270
  run: () => e.setFocusMode(n.key)
5376
5271
  });
@@ -5380,7 +5275,7 @@ function Ka(e) {
5380
5275
  name: "Switch to documents",
5381
5276
  meta: "Open the REASON editor view",
5382
5277
  keywords: "reason editor write docs",
5383
- icon: ve,
5278
+ icon: ye,
5384
5279
  run: () => e.setActiveView("docs")
5385
5280
  }, {
5386
5281
  id: "action:view-research",
@@ -5388,7 +5283,7 @@ function Ka(e) {
5388
5283
  name: "Switch to research",
5389
5284
  meta: "Back to the search and chat view",
5390
5285
  keywords: "chat search",
5391
- icon: Ve,
5286
+ icon: He,
5392
5287
  run: () => e.setActiveView("research")
5393
5288
  }, {
5394
5289
  id: "action:files-sidebar",
@@ -5396,7 +5291,7 @@ function Ka(e) {
5396
5291
  name: "Show files sidebar",
5397
5292
  meta: "Browse REASON documents",
5398
5293
  keywords: "files documents sidebar",
5399
- icon: ve,
5294
+ icon: ye,
5400
5295
  run: () => {
5401
5296
  e.setActiveView("docs"), e.requestFilesSidebar();
5402
5297
  }
@@ -5406,7 +5301,7 @@ function Ka(e) {
5406
5301
  name: "Sign out",
5407
5302
  meta: "End this session",
5408
5303
  keywords: "logout log out",
5409
- icon: Ae,
5304
+ icon: je,
5410
5305
  run: e.signOut
5411
5306
  } : {
5412
5307
  id: "action:sign-in",
@@ -5414,24 +5309,24 @@ function Ka(e) {
5414
5309
  name: "Sign in",
5415
5310
  meta: "Sync chats and settings across devices",
5416
5311
  keywords: "login log in account",
5417
- icon: ke,
5312
+ icon: Ae,
5418
5313
  run: e.signIn
5419
5314
  }), t;
5420
5315
  }
5421
- function qa(e, t) {
5316
+ function Ma(e, t) {
5422
5317
  let n = e.trim();
5423
5318
  return n ? {
5424
5319
  id: "search:ask",
5425
5320
  source: "search",
5426
5321
  name: n,
5427
5322
  meta: `Ask ${t.appName} — searches the web and answers with sources`,
5428
- icon: Ke,
5323
+ icon: qe,
5429
5324
  hint: "Enter",
5430
5325
  run: () => t.ask(n)
5431
5326
  } : null;
5432
5327
  }
5433
5328
  // src/components/SpotlightPalette/spotlightMatch.ts
5434
- var Ja = [
5329
+ var Na = [
5435
5330
  {
5436
5331
  prefix: "c",
5437
5332
  source: "chat",
@@ -5458,10 +5353,10 @@ var Ja = [
5458
5353
  label: "web"
5459
5354
  }
5460
5355
  ];
5461
- function Ya(e) {
5356
+ function Pa(e) {
5462
5357
  let t = e.match(/^([a-zA-Z])\s+(.*)$/);
5463
5358
  if (t) {
5464
- let e = t[1].toLowerCase(), n = Ja.find((t) => t.prefix === e);
5359
+ let e = t[1].toLowerCase(), n = Na.find((t) => t.prefix === e);
5465
5360
  if (n) return {
5466
5361
  prefix: n.prefix,
5467
5362
  query: t[2]
@@ -5472,11 +5367,11 @@ function Ya(e) {
5472
5367
  query: e
5473
5368
  };
5474
5369
  }
5475
- var Xa = 18;
5476
- function Za(e) {
5370
+ var Fa = 18;
5371
+ function Ia(e) {
5477
5372
  return `${e.meta ?? ""} ${e.keywords ?? ""}`.toLowerCase();
5478
5373
  }
5479
- function Qa(e, t) {
5374
+ function La(e, t) {
5480
5375
  let n = t.toLowerCase().split(/\s+/).filter(Boolean);
5481
5376
  if (n.length === 0) return e.map((e) => ({
5482
5377
  item: e,
@@ -5488,7 +5383,7 @@ function Qa(e, t) {
5488
5383
  let e = t.name.toLowerCase();
5489
5384
  if (n.every((t) => e.includes(t))) r.push(t);
5490
5385
  else {
5491
- let r = `${e} ${Za(t)}`;
5386
+ let r = `${e} ${Ia(t)}`;
5492
5387
  n.every((e) => r.includes(e)) && i.push(t);
5493
5388
  }
5494
5389
  }
@@ -5500,32 +5395,32 @@ function Qa(e, t) {
5500
5395
  })), ...i.map((e) => ({
5501
5396
  item: e,
5502
5397
  matchedName: !1,
5503
- snippet: $a(Za(e), a)
5398
+ snippet: Ra(Ia(e), a)
5504
5399
  }))];
5505
5400
  }
5506
- function $a(e, t) {
5401
+ function Ra(e, t) {
5507
5402
  let n = e.indexOf(t);
5508
5403
  if (n < 0) return "";
5509
- let r = Math.max(0, n - Xa), i = Math.min(e.length, n + t.length + Xa), a = e.slice(r, i).replace(/\s+/g, " ").trim();
5404
+ let r = Math.max(0, n - Fa), i = Math.min(e.length, n + t.length + Fa), a = e.slice(r, i).replace(/\s+/g, " ").trim();
5510
5405
  return r > 0 && (a = "…" + a), i < e.length && (a += "…"), a;
5511
5406
  }
5512
5407
  // src/components/SpotlightPalette/SpotlightPalette.tsx
5513
- var eo = "qwksearch:open-spotlight", to = 100, no = 6, ro = 40;
5514
- function io() {
5515
- typeof window < "u" && window.dispatchEvent(new Event(eo));
5408
+ var za = "qwksearch:open-spotlight", Ba = 100, Va = 6, Ha = 40;
5409
+ function Ua() {
5410
+ typeof window < "u" && window.dispatchEvent(new Event(za));
5516
5411
  }
5517
- function ao(e) {
5412
+ function Wa(e) {
5518
5413
  return e.ctrlKey && !e.metaKey && !e.altKey && (e.code === "Space" || e.key === " ");
5519
5414
  }
5520
- var oo = {
5415
+ var Ga = {
5521
5416
  search: "ask",
5522
5417
  chat: "chat",
5523
5418
  page: "page",
5524
5419
  setting: "setting",
5525
5420
  action: "action"
5526
5421
  };
5527
- function so() {
5528
- let [e, r] = O(!1), [i, a] = O(""), [o, s] = O(0), c = j(), l = u(), { isAuthenticated: d, signIn: f, signOut: p } = n(), { docsEnabled: m, setActiveView: g, requestFilesSidebar: _ } = za(), { recentChats: v, load: y } = yr(to), b = D(null), x = D(null), S = D(null), w = C(() => r(!1), []), k = D(y);
5422
+ function Ka() {
5423
+ let [e, r] = O(!1), [i, a] = O(""), [o, s] = O(0), c = j(), l = u(), { isAuthenticated: d, signIn: f, signOut: p } = n(), { docsEnabled: m, setActiveView: g, requestFilesSidebar: _ } = wa(), { recentChats: v, load: y } = mr(Ba), b = D(null), x = D(null), S = D(null), w = C(() => r(!1), []), k = D(y);
5529
5424
  T(() => {
5530
5425
  k.current = y;
5531
5426
  }, [y]);
@@ -5565,30 +5460,30 @@ function so() {
5565
5460
  m,
5566
5461
  g,
5567
5462
  _
5568
- ]), { prefix: M, query: N } = Ya(i), I = N.trim(), L = E(() => ({
5569
- chat: Wa(v, A),
5570
- page: Ua(A),
5571
- setting: Ga(A),
5572
- action: Ka(A)
5463
+ ]), { prefix: M, query: N } = Pa(i), I = N.trim(), L = E(() => ({
5464
+ chat: ka(v, A),
5465
+ page: Oa(A),
5466
+ setting: Aa(A),
5467
+ action: ja(A)
5573
5468
  }), [v, A]), R = E(() => {
5574
- let e = qa(N, A);
5469
+ let e = Ma(N, A);
5575
5470
  if (M === "w") return e ? [e] : [];
5576
5471
  if (M) {
5577
- let e = Ja.find((e) => e.prefix === M).source;
5578
- return Qa(L[e], N).map((e) => e.item).slice(0, ro);
5472
+ let e = Na.find((e) => e.prefix === M).source;
5473
+ return La(L[e], N).map((e) => e.item).slice(0, Ha);
5579
5474
  }
5580
5475
  if (!I) return [
5581
- ...L.chat.slice(0, no),
5476
+ ...L.chat.slice(0, Va),
5582
5477
  ...L.action,
5583
5478
  ...L.page
5584
- ].slice(0, ro);
5585
- let t = Qa([
5479
+ ].slice(0, Ha);
5480
+ let t = La([
5586
5481
  ...L.action,
5587
5482
  ...L.page,
5588
5483
  ...L.setting,
5589
5484
  ...L.chat
5590
5485
  ], N).map((e) => e.item);
5591
- return [...e ? [e] : [], ...t].slice(0, ro);
5486
+ return [...e ? [e] : [], ...t].slice(0, Ha);
5592
5487
  }, [
5593
5488
  M,
5594
5489
  N,
@@ -5598,10 +5493,10 @@ function so() {
5598
5493
  ]);
5599
5494
  T(() => {
5600
5495
  let e = (e) => {
5601
- ao(e) && (e.preventDefault(), r((e) => !e));
5496
+ Wa(e) && (e.preventDefault(), r((e) => !e));
5602
5497
  }, t = () => r(!0);
5603
- return window.addEventListener("keydown", e), window.addEventListener(eo, t), () => {
5604
- window.removeEventListener("keydown", e), window.removeEventListener(eo, t);
5498
+ return window.addEventListener("keydown", e), window.addEventListener(za, t), () => {
5499
+ window.removeEventListener("keydown", e), window.removeEventListener(za, t);
5605
5500
  };
5606
5501
  }, []), T(() => {
5607
5502
  e ? (s(0), k.current(), x.current?.focus()) : (a(""), s(0));
@@ -5619,7 +5514,7 @@ function so() {
5619
5514
  let z = C((e) => {
5620
5515
  e && (w(), e.run());
5621
5516
  }, [w]), B = C(() => {
5622
- let e = Ja.map((e) => e.prefix), t = e[((M ? e.indexOf(M) : -1) + 1) % e.length];
5517
+ let e = Na.map((e) => e.prefix), t = e[((M ? e.indexOf(M) : -1) + 1) % e.length];
5623
5518
  a(`${t} ${N}`), s(0);
5624
5519
  }, [M, N]), V = (e) => {
5625
5520
  switch (e.key) {
@@ -5639,7 +5534,7 @@ function so() {
5639
5534
  }
5640
5535
  };
5641
5536
  if (!e) return null;
5642
- let H = M ? Ja.find((e) => e.prefix === M) : null;
5537
+ let H = M ? Na.find((e) => e.prefix === M) : null;
5643
5538
  return /* @__PURE__ */ P("div", {
5644
5539
  className: "fixed inset-0 z-[10000] flex items-start justify-center bg-black/40 backdrop-blur-[2px] px-4 pt-[12vh]",
5645
5540
  role: "presentation",
@@ -5653,7 +5548,7 @@ function so() {
5653
5548
  /* @__PURE__ */ F("div", {
5654
5549
  className: "flex items-center gap-3 border-b border-border px-4",
5655
5550
  children: [
5656
- /* @__PURE__ */ P(Ve, {
5551
+ /* @__PURE__ */ P(He, {
5657
5552
  size: 18,
5658
5553
  className: "shrink-0 text-muted-foreground"
5659
5554
  }),
@@ -5721,7 +5616,7 @@ function so() {
5721
5616
  }),
5722
5617
  /* @__PURE__ */ P("span", {
5723
5618
  className: "shrink-0 rounded-md bg-secondary px-1.5 py-0 text-[10px] text-muted-foreground",
5724
- children: oo[e.source]
5619
+ children: Ga[e.source]
5725
5620
  })
5726
5621
  ]
5727
5622
  }, e.id);
@@ -5736,7 +5631,7 @@ function so() {
5736
5631
  /* @__PURE__ */ P("span", { children: "esc close" }),
5737
5632
  /* @__PURE__ */ P("span", {
5738
5633
  className: "ml-auto",
5739
- children: Ja.map((e) => `${e.prefix} ${e.label}`).join(" · ")
5634
+ children: Na.map((e) => `${e.prefix} ${e.label}`).join(" · ")
5740
5635
  })
5741
5636
  ]
5742
5637
  })
@@ -5745,57 +5640,57 @@ function so() {
5745
5640
  });
5746
5641
  }
5747
5642
  // src/lib/kokoro.ts
5748
- var co = {
5643
+ var qa = {
5749
5644
  device: "webgpu",
5750
5645
  dtype: "fp32"
5751
- }, lo = {
5646
+ }, Ja = {
5752
5647
  device: "wasm",
5753
5648
  dtype: "q8"
5754
- }, uo = "hexgrad/Kokoro-82M", fo = null, po = null;
5755
- function mo() {
5649
+ }, Ya = "hexgrad/Kokoro-82M", Xa = null, Za = null;
5650
+ function Qa() {
5756
5651
  return typeof navigator < "u" && "gpu" in navigator;
5757
5652
  }
5758
- async function ho() {
5759
- if (!mo()) return !1;
5653
+ async function $a() {
5654
+ if (!Qa()) return !1;
5760
5655
  try {
5761
5656
  return await navigator.gpu.requestAdapter() != null;
5762
5657
  } catch {
5763
5658
  return !1;
5764
5659
  }
5765
5660
  }
5766
- async function go(e) {
5661
+ async function eo(e) {
5767
5662
  let t = [];
5768
- await ho() && t.push(co), t.push(lo);
5663
+ await $a() && t.push(qa), t.push(Ja);
5769
5664
  let { KokoroTTS: n } = await import("kokoro-js"), r;
5770
5665
  for (let i of t) try {
5771
- let t = await n.from_pretrained(uo, {
5666
+ let t = await n.from_pretrained(Ya, {
5772
5667
  device: i.device,
5773
5668
  dtype: i.dtype,
5774
5669
  progress_callback: e
5775
5670
  });
5776
- return po = i.device, t;
5671
+ return Za = i.device, t;
5777
5672
  } catch (e) {
5778
5673
  r = e, console.warn(`Kokoro model failed to load on "${i.device}" backend:`, e);
5779
5674
  }
5780
5675
  throw r instanceof Error ? r : /* @__PURE__ */ Error("Failed to load Kokoro model");
5781
5676
  }
5782
- async function _o(e) {
5783
- return fo ||= go(e).catch((e) => {
5784
- throw fo = null, e;
5785
- }), fo;
5677
+ async function to(e) {
5678
+ return Xa ||= eo(e).catch((e) => {
5679
+ throw Xa = null, e;
5680
+ }), Xa;
5786
5681
  }
5787
- async function vo(e) {
5788
- return _o(e);
5682
+ async function no(e) {
5683
+ return to(e);
5789
5684
  }
5790
- async function yo() {
5791
- let e = await vo();
5685
+ async function ro() {
5686
+ let e = await no();
5792
5687
  return Object.keys(e.voices);
5793
5688
  }
5794
- function bo() {
5795
- return po;
5689
+ function io() {
5690
+ return Za;
5796
5691
  }
5797
5692
  // src/hooks/voice/useKokoroTTS.ts
5798
- function xo(e, t) {
5693
+ function ao(e, t) {
5799
5694
  let [n, r] = O("idle"), [i, a] = O(!1), [o, s] = O([]), [c, l] = O("af_heart"), [u, d] = O(null), [f, p] = O(null), m = D(null), h = D(null);
5800
5695
  T(() => {
5801
5696
  t?.autoPreload && !i && _();
@@ -5809,10 +5704,10 @@ function xo(e, t) {
5809
5704
  m.current &&= (m.current.pause(), m.current.src.startsWith("blob:") && URL.revokeObjectURL(m.current.src), null), h.current?.abort(), h.current = null;
5810
5705
  }, []), _ = C(async () => {
5811
5706
  try {
5812
- r("loading"), d(null), p(null), await _o((e) => {
5707
+ r("loading"), d(null), p(null), await to((e) => {
5813
5708
  p(e);
5814
5709
  });
5815
- let e = await yo();
5710
+ let e = await ro();
5816
5711
  s(e), e.length && !e.includes(c) && l(e[0]), a(!0), r("idle");
5817
5712
  } catch (e) {
5818
5713
  let t = e instanceof Error ? e.message : "Failed to load model";
@@ -5834,7 +5729,7 @@ function xo(e, t) {
5834
5729
  g(), r("generating"), d(null);
5835
5730
  let t = new AbortController();
5836
5731
  h.current = t;
5837
- let n = (await (await vo()).generate(e.slice(0, 5e3), { voice: c })).toWav(), i = new Blob([n], { type: "audio/wav" }), a = URL.createObjectURL(i), o = new Audio(a);
5732
+ let n = (await (await no()).generate(e.slice(0, 5e3), { voice: c })).toWav(), i = new Blob([n], { type: "audio/wav" }), a = URL.createObjectURL(i), o = new Audio(a);
5838
5733
  m.current = o, o.onended = () => {
5839
5734
  r("idle"), URL.revokeObjectURL(a), m.current = null;
5840
5735
  }, o.onerror = () => {
@@ -5859,11 +5754,11 @@ function xo(e, t) {
5859
5754
  changeVoice: C((e) => {
5860
5755
  l(e), localStorage.setItem("kokoroVoice", e);
5861
5756
  }, []),
5862
- backend: bo()
5757
+ backend: io()
5863
5758
  };
5864
5759
  }
5865
5760
  // src/hooks/voice/useTextToVoice.ts
5866
- function So(e, t) {
5761
+ function oo(e, t) {
5867
5762
  let [n, r] = O("stopped"), [i, a] = O(!1), o = D(null), s = D(null), c = D(null), l = D(t);
5868
5763
  l.current = t;
5869
5764
  let u = C(() => {
@@ -5895,7 +5790,7 @@ function So(e, t) {
5895
5790
  try {
5896
5791
  let n = localStorage.getItem("useTTSKokoro");
5897
5792
  if (n === null || n !== "false") try {
5898
- let t = await vo((e) => {
5793
+ let t = await no((e) => {
5899
5794
  (e.status === "progress_total" || e.status === "progress" || e.status === "download") && console.log(`[Kokoro] Loading: ${Math.round(e.progress ?? 0)}%`);
5900
5795
  }), n = localStorage.getItem("kokoroVoice") || "af_heart", i = (await t.generate(e.slice(0, 5e3), { voice: n })).toWav(), s = new Blob([i], { type: "audio/wav" }), c = URL.createObjectURL(s), l = new Audio(c);
5901
5796
  o.current = l, l.onended = () => {
@@ -5908,7 +5803,7 @@ function So(e, t) {
5908
5803
  console.debug("Kokoro TTS unavailable, using server-side TTS:", e instanceof Error ? e.message : String(e)), a(!1);
5909
5804
  }
5910
5805
  a(!1);
5911
- let i = await q("agent/voice", {
5806
+ let i = await K("agent/voice", {
5912
5807
  method: "POST",
5913
5808
  body: {
5914
5809
  text: e.slice(0, 5e3),
@@ -5938,7 +5833,7 @@ function So(e, t) {
5938
5833
  };
5939
5834
  }
5940
5835
  // src/components/VoiceSettings/KokoroVoiceSelector.tsx
5941
- var Co = {
5836
+ var so = {
5942
5837
  af_heart: "American Female - Heart",
5943
5838
  af_bella: "American Female - Bella",
5944
5839
  af_nicole: "American Female - Nicole",
@@ -5950,8 +5845,8 @@ var Co = {
5950
5845
  bm_george: "British Male - George",
5951
5846
  bm_thomas: "British Male - Thomas"
5952
5847
  };
5953
- function wo({ preloadOnMount: e = !1 }) {
5954
- let { status: t, modelReady: n, voices: r, selectedVoice: i, error: o, progress: c, warmupModel: u, changeVoice: d, backend: f } = xo("", { autoPreload: e }), [p, m] = O(!1), g = t === "loading", _ = t === "error";
5848
+ function co({ preloadOnMount: e = !1 }) {
5849
+ let { status: t, modelReady: n, voices: r, selectedVoice: i, error: o, progress: c, warmupModel: u, changeVoice: d, backend: f } = ao("", { autoPreload: e }), [p, m] = O(!1), g = t === "loading", _ = t === "error";
5955
5850
  return /* @__PURE__ */ F("div", {
5956
5851
  className: "flex flex-col gap-3",
5957
5852
  children: [/* @__PURE__ */ F("div", {
@@ -5963,10 +5858,10 @@ function wo({ preloadOnMount: e = !1 }) {
5963
5858
  onClick: u,
5964
5859
  disabled: g || n,
5965
5860
  className: h("p-2 rounded-full transition duration-200", n ? "bg-green-500/10 text-green-600 dark:text-green-400" : "bg-white/10 dark:bg-black/10 text-muted-foreground hover:bg-white/20 dark:hover:bg-black/20", g && "opacity-70 cursor-not-allowed"),
5966
- children: g ? /* @__PURE__ */ P(G, {
5861
+ children: g ? /* @__PURE__ */ P(W, {
5967
5862
  size: 18,
5968
5863
  className: "animate-spin"
5969
- }) : /* @__PURE__ */ P(fe, { size: 18 })
5864
+ }) : /* @__PURE__ */ P(pe, { size: 18 })
5970
5865
  })
5971
5866
  }), /* @__PURE__ */ P(a, {
5972
5867
  side: "bottom",
@@ -6013,7 +5908,7 @@ function wo({ preloadOnMount: e = !1 }) {
6013
5908
  className: "w-full text-left px-3 py-2 rounded-md bg-white/5 dark:bg-black/5 hover:bg-white/10 dark:hover:bg-black/10 transition text-sm font-medium",
6014
5909
  children: /* @__PURE__ */ F("div", {
6015
5910
  className: "flex items-center gap-2",
6016
- children: [/* @__PURE__ */ P(tt, { size: 16 }), Co[i] || i]
5911
+ children: [/* @__PURE__ */ P(nt, { size: 16 }), so[i] || i]
6017
5912
  })
6018
5913
  }), p && /* @__PURE__ */ P("div", {
6019
5914
  className: "grid grid-cols-2 gap-2 p-2 bg-white/5 dark:bg-black/5 rounded-md max-h-64 overflow-y-auto",
@@ -6022,23 +5917,23 @@ function wo({ preloadOnMount: e = !1 }) {
6022
5917
  d(e), m(!1);
6023
5918
  },
6024
5919
  className: h("p-2 text-left text-sm rounded transition duration-200", i === e ? "bg-blue-500/20 text-blue-600 dark:text-blue-400 font-medium" : "bg-white/5 dark:bg-black/5 text-foreground hover:bg-white/10 dark:hover:bg-black/10"),
6025
- children: Co[e] || e
5920
+ children: so[e] || e
6026
5921
  }, e))
6027
5922
  })]
6028
5923
  })]
6029
5924
  });
6030
5925
  }
6031
5926
  // src/components/VoiceSettings/VoiceSettingsPanel.tsx
6032
- function To() {
5927
+ function lo() {
6033
5928
  let [e, t] = O(!1), [n, r] = O(() => {
6034
5929
  let e = localStorage.getItem("useTTSKokoro");
6035
5930
  return e === null || e !== "false";
6036
- }), [i, o] = O(() => localStorage.getItem("ttsSpeaker") || "angus"), [c, u] = O(() => Pn()), { start: d, speechStatus: f } = So("This is a preview of the selected voice.", { enableInterrupt: !1 }), p = (e) => {
5931
+ }), [i, o] = O(() => localStorage.getItem("ttsSpeaker") || "angus"), [c, u] = O(() => kn()), { start: d, speechStatus: f } = oo("This is a preview of the selected voice.", { enableInterrupt: !1 }), p = (e) => {
6037
5932
  r(e), localStorage.setItem("useTTSKokoro", String(e));
6038
5933
  }, m = (e) => {
6039
5934
  o(e), localStorage.setItem("ttsSpeaker", e);
6040
5935
  }, g = (e) => {
6041
- u(e), Fn(e);
5936
+ u(e), An(e);
6042
5937
  };
6043
5938
  return /* @__PURE__ */ F("div", {
6044
5939
  className: "space-y-4",
@@ -6046,7 +5941,7 @@ function To() {
6046
5941
  className: "flex items-center justify-between",
6047
5942
  children: [/* @__PURE__ */ F("div", {
6048
5943
  className: "flex items-center gap-2",
6049
- children: [/* @__PURE__ */ P(Ue, { size: 18 }), /* @__PURE__ */ P("h3", {
5944
+ children: [/* @__PURE__ */ P(We, { size: 18 }), /* @__PURE__ */ P("h3", {
6050
5945
  className: "font-semibold",
6051
5946
  children: "Voice Settings"
6052
5947
  })]
@@ -6085,7 +5980,7 @@ function To() {
6085
5980
  children: "Runs locally in your browser. No server requests, lower latency, and multiple voice options."
6086
5981
  })] })
6087
5982
  ]
6088
- }), n && /* @__PURE__ */ P(wo, { preloadOnMount: !1 })]
5983
+ }), n && /* @__PURE__ */ P(co, { preloadOnMount: !1 })]
6089
5984
  }),
6090
5985
  /* @__PURE__ */ F("div", {
6091
5986
  className: "space-y-2",
@@ -6142,7 +6037,7 @@ function To() {
6142
6037
  onClick: () => d(),
6143
6038
  disabled: f === "started",
6144
6039
  className: h("w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition", f === "started" ? "bg-gray-500/20 text-gray-600 dark:text-gray-400 cursor-not-allowed" : "bg-blue-500/20 text-blue-600 dark:text-blue-400 hover:bg-blue-500/30"),
6145
- children: [/* @__PURE__ */ P(tt, { size: 16 }), f === "started" ? "Playing..." : "Preview"]
6040
+ children: [/* @__PURE__ */ P(nt, { size: 16 }), f === "started" ? "Playing..." : "Preview"]
6146
6041
  })]
6147
6042
  })]
6148
6043
  }),
@@ -6184,18 +6079,18 @@ function To() {
6184
6079
  });
6185
6080
  }
6186
6081
  // src/icons/icon-read.svg
6187
- var Eo = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23FE5022;'%20d='M438.802,390.609V278.595h55.174c9.938,0,18.023,8.085,18.023,18.023v75.967%20c0,9.938-8.086,18.024-18.023,18.024L438.802,390.609L438.802,390.609z'/%3e%3cpath%20style='fill:%23ECE5DD;'%20d='M28.107,511.637C12.609,511.637,0,499.027,0,483.529V134.326c0-1.441,0-12.123,0-12.123%20L121.715,0.363c0,0,10.8,0,12.248,0h271.569c15.498,0,28.107,12.609,28.107,28.106v455.059c0,15.499-12.609,28.108-28.107,28.108%20H28.107V511.637z'/%3e%3cpath%20style='fill:%23D9CBBD;'%20d='M405.533,0.363h-31.991c15.498,0,28.107,12.609,28.107,28.107v455.059%20c0,15.499-12.609,28.108-28.107,28.108h31.991c15.498,0,28.107-12.609,28.107-28.108V28.469%20C433.64,12.972,421.031,0.363,405.533,0.363z'/%3e%3cg%3e%3cpath%20style='fill:%23BABABA;'%20d='M167.639,132.2h133.086c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318H167.639%20c-4.594,0-8.318,3.723-8.318,8.318C159.321,128.477,163.045,132.2,167.639,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M356.178,132.2h22.181c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318h-22.181%20c-4.594,0-8.318,3.723-8.318,8.318C347.86,128.477,351.584,132.2,356.178,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M242.5,212.606c0-4.595-3.724-8.318-8.318-8.318H56.734c-4.594,0-8.318,3.723-8.318,8.318%20s3.724,8.318,8.318,8.318h177.449C238.776,220.924,242.5,217.201,242.5,212.606z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M378.359,204.288h-99.815c-4.594,0-8.318,3.723-8.318,8.318s3.724,8.318,8.318,8.318h99.815%20c4.594,0,8.318-3.723,8.318-8.318S382.953,204.288,378.359,204.288z'/%3e%3c/g%3e%3cpath%20style='fill:%23D9CBBD;'%20d='M0.726,123.171L122.442,1.331l1.39,105.939c0,9.465-7.7,17.166-17.166,17.166L0.726,123.171z'/%3e%3cpath%20style='fill:%23FFB656;'%20d='M270.226,401.7V267.504H456.87c5.938,0,10.768,4.83,10.768,10.768v112.659%20c0,5.938-4.83,10.769-10.768,10.769H270.226z'/%3e%3cpath%20style='fill:%23D9CBBD;'%20d='M367.785,335.156c-12.822,0-23.252-10.431-23.252-23.254v-44.399h89.833v44.399%20c0,12.823-10.431,23.254-23.252,23.254H367.785z'/%3e%3cg%3e%3cpath%20style='fill:%23BABABA;'%20d='M167.639,132.2h133.086c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318H167.639%20c-4.594,0-8.318,3.723-8.318,8.318C159.321,128.477,163.045,132.2,167.639,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M356.178,132.2h22.181c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318h-22.181%20c-4.594,0-8.318,3.723-8.318,8.318C347.86,128.477,351.584,132.2,356.178,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M242.5,212.606c0-4.595-3.724-8.318-8.318-8.318H56.734c-4.594,0-8.318,3.723-8.318,8.318%20s3.724,8.318,8.318,8.318h177.449C238.776,220.924,242.5,217.201,242.5,212.606z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M378.359,204.288h-99.815c-4.594,0-8.318,3.723-8.318,8.318s3.724,8.318,8.318,8.318h99.815%20c4.594,0,8.318-3.723,8.318-8.318S382.953,204.288,378.359,204.288z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M345.087,448.28H101.096c-4.594,0-8.318,3.723-8.318,8.318c0,4.595,3.724,8.318,8.318,8.318h243.992%20c4.594,0,8.318-3.723,8.318-8.318C353.405,452.003,349.681,448.28,345.087,448.28z'/%3e%3c/g%3e%3cpath%20style='fill:%23FE5022;'%20d='M163.689,357.337c-3.692,0-6.094-3.886-4.443-7.189l16.225-32.451%20c1.799-3.597,5.416-5.833,9.438-5.833h44.282v45.471h-65.503V357.337z'/%3e%3cpolygon%20style='fill:%23FFB656;'%20points='256.918,278.252%20211.447,300.988%20211.447,368.216%20256.918,390.953%20284.321,390.953%20284.321,278.214%20'/%3e%3cg%3e%3cpath%20style='fill:%23FE5022;'%20d='M268.64,401.7c-7.075,0-12.832-5.756-12.832-12.832V280.336c0-7.075,5.756-12.831,12.832-12.831%20h19.808c7.075,0,12.832,5.756,12.832,12.831v108.532c0,7.076-5.756,12.832-12.832,12.832H268.64z'/%3e%3cpath%20style='fill:%23FE5022;'%20d='M104.156,379.377H26.143V301.33h91.398c8.546,0,14.88,7.936,12.986,16.27l-11.313,49.758%20C117.615,374.388,111.366,379.377,104.156,379.377z'/%3e%3c/g%3e%3c/svg%3e", Do = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2064%2064'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%2376C2AF;}%20.st1{fill:%234F5D73;}%20.st2{opacity:0.2;}%20.st3{fill:%23231F20;}%20.st4{fill:%23FFFFFF;}%20%3c/style%3e%3cg%20id='Layer_1'%3e%3cg%3e%3ccircle%20class='st0'%20cx='32'%20cy='32'%20r='32'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st1'%20d='M32,52c-1.1,0-2-0.9-2-2V18c0-1.1,0.9-2,2-2l0,0c1.1,0,2,0.9,2,2v32C34,51.1,33.1,52,32,52L32,52z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st1'%20d='M46,52c-1.1,0-2-0.9-2-2V18c0-1.1,0.9-2,2-2l0,0c1.1,0,2,0.9,2,2v32C48,51.1,47.1,52,46,52L46,52z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st1'%20d='M18,52c-1.1,0-2-0.9-2-2V18c0-1.1,0.9-2,2-2l0,0c1.1,0,2,0.9,2,2v32C20,51.1,19.1,52,18,52L18,52z'/%3e%3c/g%3e%3cg%20class='st2'%3e%3ccircle%20class='st3'%20cx='45.9'%20cy='38'%20r='4'/%3e%3c/g%3e%3cg%20class='st2'%3e%3ccircle%20class='st3'%20cx='32'%20cy='27'%20r='4'/%3e%3c/g%3e%3cg%20class='st2'%3e%3ccircle%20class='st3'%20cx='18'%20cy='44'%20r='4'/%3e%3c/g%3e%3cg%3e%3ccircle%20class='st4'%20cx='45.9'%20cy='36'%20r='4'/%3e%3c/g%3e%3cg%3e%3ccircle%20class='st4'%20cx='32'%20cy='25'%20r='4'/%3e%3c/g%3e%3cg%3e%3ccircle%20class='st4'%20cx='18'%20cy='42'%20r='4'/%3e%3c/g%3e%3c/g%3e%3cg%20id='Layer_2'%3e%3c/g%3e%3c/svg%3e";
6082
+ var uo = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23FE5022;'%20d='M438.802,390.609V278.595h55.174c9.938,0,18.023,8.085,18.023,18.023v75.967%20c0,9.938-8.086,18.024-18.023,18.024L438.802,390.609L438.802,390.609z'/%3e%3cpath%20style='fill:%23ECE5DD;'%20d='M28.107,511.637C12.609,511.637,0,499.027,0,483.529V134.326c0-1.441,0-12.123,0-12.123%20L121.715,0.363c0,0,10.8,0,12.248,0h271.569c15.498,0,28.107,12.609,28.107,28.106v455.059c0,15.499-12.609,28.108-28.107,28.108%20H28.107V511.637z'/%3e%3cpath%20style='fill:%23D9CBBD;'%20d='M405.533,0.363h-31.991c15.498,0,28.107,12.609,28.107,28.107v455.059%20c0,15.499-12.609,28.108-28.107,28.108h31.991c15.498,0,28.107-12.609,28.107-28.108V28.469%20C433.64,12.972,421.031,0.363,405.533,0.363z'/%3e%3cg%3e%3cpath%20style='fill:%23BABABA;'%20d='M167.639,132.2h133.086c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318H167.639%20c-4.594,0-8.318,3.723-8.318,8.318C159.321,128.477,163.045,132.2,167.639,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M356.178,132.2h22.181c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318h-22.181%20c-4.594,0-8.318,3.723-8.318,8.318C347.86,128.477,351.584,132.2,356.178,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M242.5,212.606c0-4.595-3.724-8.318-8.318-8.318H56.734c-4.594,0-8.318,3.723-8.318,8.318%20s3.724,8.318,8.318,8.318h177.449C238.776,220.924,242.5,217.201,242.5,212.606z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M378.359,204.288h-99.815c-4.594,0-8.318,3.723-8.318,8.318s3.724,8.318,8.318,8.318h99.815%20c4.594,0,8.318-3.723,8.318-8.318S382.953,204.288,378.359,204.288z'/%3e%3c/g%3e%3cpath%20style='fill:%23D9CBBD;'%20d='M0.726,123.171L122.442,1.331l1.39,105.939c0,9.465-7.7,17.166-17.166,17.166L0.726,123.171z'/%3e%3cpath%20style='fill:%23FFB656;'%20d='M270.226,401.7V267.504H456.87c5.938,0,10.768,4.83,10.768,10.768v112.659%20c0,5.938-4.83,10.769-10.768,10.769H270.226z'/%3e%3cpath%20style='fill:%23D9CBBD;'%20d='M367.785,335.156c-12.822,0-23.252-10.431-23.252-23.254v-44.399h89.833v44.399%20c0,12.823-10.431,23.254-23.252,23.254H367.785z'/%3e%3cg%3e%3cpath%20style='fill:%23BABABA;'%20d='M167.639,132.2h133.086c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318H167.639%20c-4.594,0-8.318,3.723-8.318,8.318C159.321,128.477,163.045,132.2,167.639,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M356.178,132.2h22.181c4.594,0,8.318-3.723,8.318-8.318c0-4.595-3.724-8.318-8.318-8.318h-22.181%20c-4.594,0-8.318,3.723-8.318,8.318C347.86,128.477,351.584,132.2,356.178,132.2z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M242.5,212.606c0-4.595-3.724-8.318-8.318-8.318H56.734c-4.594,0-8.318,3.723-8.318,8.318%20s3.724,8.318,8.318,8.318h177.449C238.776,220.924,242.5,217.201,242.5,212.606z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M378.359,204.288h-99.815c-4.594,0-8.318,3.723-8.318,8.318s3.724,8.318,8.318,8.318h99.815%20c4.594,0,8.318-3.723,8.318-8.318S382.953,204.288,378.359,204.288z'/%3e%3cpath%20style='fill:%23BABABA;'%20d='M345.087,448.28H101.096c-4.594,0-8.318,3.723-8.318,8.318c0,4.595,3.724,8.318,8.318,8.318h243.992%20c4.594,0,8.318-3.723,8.318-8.318C353.405,452.003,349.681,448.28,345.087,448.28z'/%3e%3c/g%3e%3cpath%20style='fill:%23FE5022;'%20d='M163.689,357.337c-3.692,0-6.094-3.886-4.443-7.189l16.225-32.451%20c1.799-3.597,5.416-5.833,9.438-5.833h44.282v45.471h-65.503V357.337z'/%3e%3cpolygon%20style='fill:%23FFB656;'%20points='256.918,278.252%20211.447,300.988%20211.447,368.216%20256.918,390.953%20284.321,390.953%20284.321,278.214%20'/%3e%3cg%3e%3cpath%20style='fill:%23FE5022;'%20d='M268.64,401.7c-7.075,0-12.832-5.756-12.832-12.832V280.336c0-7.075,5.756-12.831,12.832-12.831%20h19.808c7.075,0,12.832,5.756,12.832,12.831v108.532c0,7.076-5.756,12.832-12.832,12.832H268.64z'/%3e%3cpath%20style='fill:%23FE5022;'%20d='M104.156,379.377H26.143V301.33h91.398c8.546,0,14.88,7.936,12.986,16.27l-11.313,49.758%20C117.615,374.388,111.366,379.377,104.156,379.377z'/%3e%3c/g%3e%3c/svg%3e", fo = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2064%2064'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%2376C2AF;}%20.st1{fill:%234F5D73;}%20.st2{opacity:0.2;}%20.st3{fill:%23231F20;}%20.st4{fill:%23FFFFFF;}%20%3c/style%3e%3cg%20id='Layer_1'%3e%3cg%3e%3ccircle%20class='st0'%20cx='32'%20cy='32'%20r='32'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st1'%20d='M32,52c-1.1,0-2-0.9-2-2V18c0-1.1,0.9-2,2-2l0,0c1.1,0,2,0.9,2,2v32C34,51.1,33.1,52,32,52L32,52z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st1'%20d='M46,52c-1.1,0-2-0.9-2-2V18c0-1.1,0.9-2,2-2l0,0c1.1,0,2,0.9,2,2v32C48,51.1,47.1,52,46,52L46,52z'/%3e%3c/g%3e%3cg%3e%3cpath%20class='st1'%20d='M18,52c-1.1,0-2-0.9-2-2V18c0-1.1,0.9-2,2-2l0,0c1.1,0,2,0.9,2,2v32C20,51.1,19.1,52,18,52L18,52z'/%3e%3c/g%3e%3cg%20class='st2'%3e%3ccircle%20class='st3'%20cx='45.9'%20cy='38'%20r='4'/%3e%3c/g%3e%3cg%20class='st2'%3e%3ccircle%20class='st3'%20cx='32'%20cy='27'%20r='4'/%3e%3c/g%3e%3cg%20class='st2'%3e%3ccircle%20class='st3'%20cx='18'%20cy='44'%20r='4'/%3e%3c/g%3e%3cg%3e%3ccircle%20class='st4'%20cx='45.9'%20cy='36'%20r='4'/%3e%3c/g%3e%3cg%3e%3ccircle%20class='st4'%20cx='32'%20cy='25'%20r='4'/%3e%3c/g%3e%3cg%3e%3ccircle%20class='st4'%20cx='18'%20cy='42'%20r='4'/%3e%3c/g%3e%3c/g%3e%3cg%20id='Layer_2'%3e%3c/g%3e%3c/svg%3e";
6188
6083
  // src/app/CategoryDock.tsx
6189
- function Oo() {
6190
- let e = A(), r = j(), { isAuthenticated: i, signIn: a, signOut: o } = n(), { newChat: s } = u(), { activeView: c, setActiveView: l, docsEnabled: d, requestFilesSidebar: f } = za(), p = [{
6084
+ function po() {
6085
+ let e = A(), r = j(), { isAuthenticated: i, signIn: a, signOut: o } = n(), { newChat: s } = u(), { activeView: c, setActiveView: l, docsEnabled: d, requestFilesSidebar: f } = wa(), p = [{
6191
6086
  href: "/",
6192
6087
  label: "Research",
6193
6088
  icon: t.appIconUrl
6194
6089
  }, ...d ? [{
6195
6090
  href: "/workspace",
6196
6091
  label: "Docs",
6197
- icon: /* @__PURE__ */ P(Wt, {
6198
- src: Eo,
6092
+ icon: /* @__PURE__ */ P(Bt, {
6093
+ src: uo,
6199
6094
  alt: "Docs",
6200
6095
  width: 24,
6201
6096
  height: 24,
@@ -6215,7 +6110,7 @@ function Oo() {
6215
6110
  ...d ? [{
6216
6111
  key: "files",
6217
6112
  label: "Files",
6218
- icon: /* @__PURE__ */ P(ve, { className: "w-full h-full p-1" }),
6113
+ icon: /* @__PURE__ */ P(ye, { className: "w-full h-full p-1" }),
6219
6114
  onClick: () => {
6220
6115
  l("docs"), f();
6221
6116
  }
@@ -6223,8 +6118,8 @@ function Oo() {
6223
6118
  {
6224
6119
  key: "settings",
6225
6120
  label: "Settings",
6226
- icon: /* @__PURE__ */ P(Wt, {
6227
- src: Do,
6121
+ icon: /* @__PURE__ */ P(Bt, {
6122
+ src: fo,
6228
6123
  alt: "Settings",
6229
6124
  width: 24,
6230
6125
  height: 24,
@@ -6232,11 +6127,11 @@ function Oo() {
6232
6127
  className: "w-full h-full"
6233
6128
  }),
6234
6129
  menu: { renderContent: () => /* @__PURE__ */ F(N, { children: [
6235
- /* @__PURE__ */ F(Vt, {
6236
- onClick: () => io(),
6130
+ /* @__PURE__ */ F(Lt, {
6131
+ onClick: () => Ua(),
6237
6132
  className: "cursor-pointer py-1 h-7",
6238
6133
  children: [
6239
- /* @__PURE__ */ P(Ve, { className: "mr-2 h-3.5 w-3.5" }),
6134
+ /* @__PURE__ */ P(He, { className: "mr-2 h-3.5 w-3.5" }),
6240
6135
  /* @__PURE__ */ P("span", {
6241
6136
  className: "text-sm",
6242
6137
  children: "Search"
@@ -6247,36 +6142,36 @@ function Oo() {
6247
6142
  })
6248
6143
  ]
6249
6144
  }),
6250
- /* @__PURE__ */ F(Vt, {
6145
+ /* @__PURE__ */ F(Lt, {
6251
6146
  onClick: () => {
6252
6147
  t.onOpenSettings?.() || r.push("/settings");
6253
6148
  },
6254
6149
  className: "cursor-pointer py-1 h-7",
6255
- children: [/* @__PURE__ */ P(He, { className: "mr-2 h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
6150
+ children: [/* @__PURE__ */ P(Ue, { className: "mr-2 h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
6256
6151
  className: "text-sm",
6257
6152
  children: "Settings"
6258
6153
  })]
6259
6154
  }),
6260
- i ? /* @__PURE__ */ F(Vt, {
6155
+ i ? /* @__PURE__ */ F(Lt, {
6261
6156
  onClick: () => o(),
6262
6157
  className: "cursor-pointer py-1 h-7",
6263
- children: [/* @__PURE__ */ P(Ae, { className: "mr-2 h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
6158
+ children: [/* @__PURE__ */ P(je, { className: "mr-2 h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
6264
6159
  className: "text-sm",
6265
6160
  children: "Logout"
6266
6161
  })]
6267
- }) : /* @__PURE__ */ F(Vt, {
6162
+ }) : /* @__PURE__ */ F(Lt, {
6268
6163
  onClick: () => a(),
6269
6164
  className: "cursor-pointer py-1 h-7",
6270
- children: [/* @__PURE__ */ P(ke, { className: "mr-2 h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
6165
+ children: [/* @__PURE__ */ P(Ae, { className: "mr-2 h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
6271
6166
  className: "text-sm",
6272
6167
  children: "Login"
6273
6168
  })]
6274
6169
  }),
6275
- /* @__PURE__ */ P(Ht, {}),
6276
- /* @__PURE__ */ P(Ut, {})
6170
+ /* @__PURE__ */ P(Rt, {}),
6171
+ /* @__PURE__ */ P(zt, {})
6277
6172
  ] }) }
6278
6173
  }
6279
- ], g = h.filter((e) => e.key !== "files"), _ = (e, t, n) => /* @__PURE__ */ P(Wt, {
6174
+ ], g = h.filter((e) => e.key !== "files"), _ = (e, t, n) => /* @__PURE__ */ P(Bt, {
6280
6175
  src: e,
6281
6176
  alt: t,
6282
6177
  width: n,
@@ -6284,7 +6179,7 @@ function Oo() {
6284
6179
  unoptimized: !0,
6285
6180
  className: "w-full h-full"
6286
6181
  });
6287
- return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(zt, {
6182
+ return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Ft, {
6288
6183
  items: g,
6289
6184
  enableKeyboardShortcuts: !0,
6290
6185
  placements: {
@@ -6292,7 +6187,7 @@ function Oo() {
6292
6187
  mobile: !1
6293
6188
  },
6294
6189
  renderImage: _
6295
- }), /* @__PURE__ */ P(zt, {
6190
+ }), /* @__PURE__ */ P(Ft, {
6296
6191
  items: h,
6297
6192
  placements: {
6298
6193
  desktop: !1,
@@ -6303,42 +6198,42 @@ function Oo() {
6303
6198
  })] });
6304
6199
  }
6305
6200
  // src/app/CookieConsent.tsx
6306
- function ko() {
6307
- return /* @__PURE__ */ P(Gt, {
6201
+ function mo() {
6202
+ return /* @__PURE__ */ P(Vt, {
6308
6203
  appName: t.appName,
6309
6204
  links: t.footerLinks,
6310
6205
  heightVar: "--qs-bottom-right-inset"
6311
6206
  });
6312
6207
  }
6313
6208
  // src/app/useChunkErrorReload.ts
6314
- var Ao = "qwk:chunk-error-reload", jo = 6e4, Mo = /Loading (CSS )?chunk|ChunkLoadError|Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;
6315
- function No(e) {
6316
- if (typeof e == "string") return Mo.test(e);
6209
+ var ho = "qwk:chunk-error-reload", go = 6e4, _o = /Loading (CSS )?chunk|ChunkLoadError|Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;
6210
+ function vo(e) {
6211
+ if (typeof e == "string") return _o.test(e);
6317
6212
  if (e && typeof e == "object") {
6318
6213
  let { name: t, message: n } = e;
6319
- return t === "ChunkLoadError" || typeof n == "string" && Mo.test(n);
6214
+ return t === "ChunkLoadError" || typeof n == "string" && _o.test(n);
6320
6215
  }
6321
6216
  return !1;
6322
6217
  }
6323
- function Po(e) {
6324
- if (typeof window > "u" || !No(e)) return !1;
6218
+ function yo(e) {
6219
+ if (typeof window > "u" || !vo(e)) return !1;
6325
6220
  try {
6326
- let e = Number(window.sessionStorage.getItem(Ao));
6327
- if (e && Date.now() - e < jo) return !1;
6328
- window.sessionStorage.setItem(Ao, String(Date.now()));
6221
+ let e = Number(window.sessionStorage.getItem(ho));
6222
+ if (e && Date.now() - e < go) return !1;
6223
+ window.sessionStorage.setItem(ho, String(Date.now()));
6329
6224
  } catch {
6330
6225
  return !1;
6331
6226
  }
6332
6227
  return window.location.reload(), !0;
6333
6228
  }
6334
- function Fo() {
6229
+ function bo() {
6335
6230
  T(() => {
6336
6231
  let e = (e) => {
6337
- Po(e.error ?? e.message);
6232
+ yo(e.error ?? e.message);
6338
6233
  }, t = (e) => {
6339
- Po(e.reason);
6234
+ yo(e.reason);
6340
6235
  }, n = (e) => {
6341
- Po(e.payload ?? "Loading chunk") && e.preventDefault();
6236
+ yo(e.payload ?? "Loading chunk") && e.preventDefault();
6342
6237
  };
6343
6238
  return window.addEventListener("error", e), window.addEventListener("unhandledrejection", t), window.addEventListener("vite:preloadError", n), () => {
6344
6239
  window.removeEventListener("error", e), window.removeEventListener("unhandledrejection", t), window.removeEventListener("vite:preloadError", n);
@@ -6346,8 +6241,8 @@ function Fo() {
6346
6241
  }, []);
6347
6242
  }
6348
6243
  // src/app/QwkSearchProviders.tsx
6349
- var Io = ({ children: e }) => /* @__PURE__ */ P(N, { children: e });
6350
- function Lo(e) {
6244
+ var xo = ({ children: e }) => /* @__PURE__ */ P(N, { children: e });
6245
+ function So(e) {
6351
6246
  let [t, n] = O(e === !0);
6352
6247
  return T(() => {
6353
6248
  if (e !== "auto") {
@@ -6355,7 +6250,7 @@ function Lo(e) {
6355
6250
  return;
6356
6251
  }
6357
6252
  let t = !1;
6358
- return q("auth/providers").then((e) => {
6253
+ return K("auth/providers").then((e) => {
6359
6254
  t || n(!!e.providers?.includes("google"));
6360
6255
  }).catch(() => {
6361
6256
  t || n(!1);
@@ -6364,10 +6259,10 @@ function Lo(e) {
6364
6259
  };
6365
6260
  }, [e]), t;
6366
6261
  }
6367
- function Ro({ children: t, authClient: n, config: i, googleOneTap: a = "auto", docsEnabled: o = !0, ChromeProvider: s = Io, showDock: l = !0, showCookieConsent: u = !0, showToaster: d = !0, showSpotlight: f = !0 }) {
6262
+ function Co({ children: t, authClient: n, config: i, googleOneTap: a = "auto", docsEnabled: o = !0, ChromeProvider: s = xo, showDock: l = !0, showCookieConsent: u = !0, showToaster: d = !0, showSpotlight: f = !0 }) {
6368
6263
  i && e(i);
6369
- let p = Lo(a);
6370
- return Fo(), /* @__PURE__ */ P(Rt, {
6264
+ let p = So(a);
6265
+ return bo(), /* @__PURE__ */ P(Pt, {
6371
6266
  attribute: "class",
6372
6267
  defaultTheme: "system",
6373
6268
  enableSystem: !0,
@@ -6375,54 +6270,54 @@ function Ro({ children: t, authClient: n, config: i, googleOneTap: a = "auto", d
6375
6270
  children: /* @__PURE__ */ P(c, {
6376
6271
  authClient: n,
6377
6272
  enableGoogleOneTap: p,
6378
- children: /* @__PURE__ */ P(r, { children: /* @__PURE__ */ P(On, { children: /* @__PURE__ */ P(Ia, {
6273
+ children: /* @__PURE__ */ P(r, { children: /* @__PURE__ */ P(Cn, { children: /* @__PURE__ */ P(xa, {
6379
6274
  docsEnabled: o,
6380
- children: /* @__PURE__ */ P(Bt, { children: /* @__PURE__ */ F(s, { children: [
6275
+ children: /* @__PURE__ */ P(It, { children: /* @__PURE__ */ F(s, { children: [
6381
6276
  /* @__PURE__ */ F("div", {
6382
6277
  id: "app-scroll-root",
6383
6278
  className: "w-screen h-screen overflow-y-auto overflow-x-hidden pb-[calc(60px+env(safe-area-inset-bottom,0px))] md:pb-0",
6384
- children: [l && /* @__PURE__ */ P(Oo, {}), /* @__PURE__ */ P("main", {
6279
+ children: [l && /* @__PURE__ */ P(po, {}), /* @__PURE__ */ P("main", {
6385
6280
  className: "bg-light-primary dark:bg-dark-primary min-h-screen",
6386
6281
  children: t
6387
6282
  })]
6388
6283
  }),
6389
- d && /* @__PURE__ */ P(at, { toastOptions: {
6284
+ d && /* @__PURE__ */ P(ot, { toastOptions: {
6390
6285
  unstyled: !0,
6391
6286
  classNames: { toast: "bg-light-secondary dark:bg-dark-secondary dark:text-white/70 text-black-70 rounded-lg p-4 flex flex-row items-center space-x-2" }
6392
6287
  } }),
6393
- u && /* @__PURE__ */ P(ko, {}),
6394
- f && /* @__PURE__ */ P(so, {})
6288
+ u && /* @__PURE__ */ P(mo, {}),
6289
+ f && /* @__PURE__ */ P(Ka, {})
6395
6290
  ] }) })
6396
6291
  }) }) })
6397
6292
  })
6398
6293
  });
6399
6294
  }
6400
6295
  // src/app/QwkSearchApp.tsx
6401
- function zo(e) {
6402
- return /* @__PURE__ */ P(Ro, {
6296
+ function wo(e) {
6297
+ return /* @__PURE__ */ P(Co, {
6403
6298
  ...e,
6404
6299
  docsEnabled: !1,
6405
- children: /* @__PURE__ */ P(Gi, {})
6300
+ children: /* @__PURE__ */ P(Bi, {})
6406
6301
  });
6407
6302
  }
6408
6303
  // src/app/useChatTabs.ts
6409
- var Bo = "qwksearch-open-chat-tabs", Vo = 50;
6410
- function Ho() {
6304
+ var To = "qwksearch-open-chat-tabs", Eo = 50;
6305
+ function Do() {
6411
6306
  if (typeof window > "u") return [];
6412
6307
  try {
6413
- let e = window.localStorage.getItem(Bo);
6308
+ let e = window.localStorage.getItem(To);
6414
6309
  return e ? JSON.parse(e) : [];
6415
6310
  } catch {
6416
6311
  return [];
6417
6312
  }
6418
6313
  }
6419
- function Uo() {
6420
- let { chatId: e, chatTurns: t, startNewChat: n, switchToChat: r } = u(), [i, a] = O(Ho), o = D(null);
6314
+ function Oo() {
6315
+ let { chatId: e, chatTurns: t, startNewChat: n, switchToChat: r } = u(), [i, a] = O(Do), o = D(null);
6421
6316
  T(() => {
6422
- window.localStorage.setItem(Bo, JSON.stringify(i));
6317
+ window.localStorage.setItem(To, JSON.stringify(i));
6423
6318
  }, [i]), T(() => {
6424
6319
  if (!e) return;
6425
- let n = t[0]?.content?.slice(0, Vo), r = t.length > 0;
6320
+ let n = t[0]?.content?.slice(0, Eo), r = t.length > 0;
6426
6321
  a((t) => {
6427
6322
  let i = t.find((t) => t.id === e);
6428
6323
  return !i && e === o.current && !r ? t : i ? n && i.title !== n || i.hasMessages !== r ? t.map((t) => t.id === e ? {
@@ -6485,4 +6380,4 @@ function Uo() {
6485
6380
  closeChats: d
6486
6381
  };
6487
6382
  }
6488
- export { qn as $, la as A, Qi as B, Sa as C, ha as D, ga as E, Ki as F, ti as G, hi as H, ea as I, Ar as J, Qr as K, ta as L, ca as M, oa as N, da as O, na as P, mr as Q, $i as R, Ca as S, _a as T, si as U, Gi as V, ii as W, jr as X, kr as Y, Mr as Z, Ya as _, Po as a, Y as at, za as b, Oo as c, So as d, Yn as et, xo as f, Qa as g, Ja as h, No as i, En as it, ia as j, ua as k, To as l, io as m, zo as n, Jn as nt, Fo as o, so as p, Ur as q, Ro as r, On as rt, ko as s, Uo as t, X as tt, wo as u, Ha as v, ba as w, Na as x, Ia as y, Xi as z };
6383
+ export { Cn as $, Zi as A, $r as B, sa as C, $i as D, ia as E, Gi as F, wr as G, qr as H, qi as I, lr as J, Er as K, Bi as L, Yi as M, Xi as N, ra as O, Ji as P, Un as Q, ui as R, ca as S, aa as T, Rr as U, Xr as V, Tr as W, Wn as X, Hn as Y, X as Z, Pa as _, yo as a, wa as b, po as c, oo as d, xn as et, ao as f, La as g, Na as h, vo as i, Vi as j, ta as k, lo as l, Ua as m, wo as n, bo as o, Ka as p, Dr as q, Co as r, mo as s, Oo as t, J as tt, co as u, Da as v, oa as w, va as x, xa as y, ni as z };