gentiq 0.7.24 → 0.7.25

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.
@@ -4,7 +4,7 @@ import { useState as C, useMemo as j, useEffect as $, useRef as ee, useCallback
4
4
  import { QueryClient as We, QueryClientProvider as Xe, useQueryClient as pe, useQuery as Je, useInfiniteQuery as Ye } from "@tanstack/react-query";
5
5
  import { I18nextProvider as Ze, useTranslation as le } from "react-i18next";
6
6
  import { Trans as Xa, Translation as Ja, useTranslation as Ya, withTranslation as Za } from "react-i18next";
7
- import { g as et, u as T, d as tt, C as ze, T as at, a as te, b as Re, j as fe, G as rt, c as ie, e as p, f as qe, h as Fe, i as Oe, k as je, B as Y, l as $e, m as he, D as Be, n as nt, o as Ue, L as Q, I as V, S as be, p as ve, q as xe, r as ye, s as me, t as st, v as Se, w as ot, x as it, y as lt, z as de, A as ct, E as dt, F as ut, H as mt, J as ht, K as pt } from "./checkbox-iAFtpOFJ.js";
7
+ import { g as et, u as T, d as tt, C as ze, T as at, a as te, b as Re, j as fe, G as rt, c as ie, e as g, f as qe, h as Fe, i as Oe, k as je, B as Y, l as $e, m as he, D as Be, n as nt, o as Ue, L as Q, I as G, S as be, p as ve, q as xe, r as ye, s as me, t as st, v as Se, w as ot, x as it, y as lt, z as de, A as ct, E as dt, F as ut, H as mt, J as ht, K as pt } from "./checkbox-iAFtpOFJ.js";
8
8
  import { M as tr, N as ar, P as rr, O as nr, R as sr, Q as or, U as ir, V as lr, W as cr, X as dr, Y as ur, Z as mr, _ as hr } from "./checkbox-iAFtpOFJ.js";
9
9
  import { Loader2Icon as gt, OctagonXIcon as ft, TriangleAlertIcon as bt, InfoIcon as vt, CircleCheckIcon as xt, XIcon as yt, PanelLeftIcon as wt, Layers as Pe, User as Nt, ShieldCheck as kt, Settings as we, Smartphone as Ct, Lock as _t, Save as St, Sun as Pt, Moon as Mt, Monitor as Tt, Zap as Me, Globe as It, Coins as Dt, LogOut as Et, CirclePlus as Lt, Plus as At, Search as zt, Check as Rt, X as qt, Pin as Te, MoreVertical as Ft, PinOff as Ot, Share2 as jt, Pencil as $t, Trash as Bt } from "lucide-react";
10
10
  import { useTheme as Ut } from "next-themes";
@@ -49,7 +49,7 @@ function Ua({
49
49
  components: i,
50
50
  history: c,
51
51
  welcome: m,
52
- threadActions: g,
52
+ threadActions: p,
53
53
  composer: u,
54
54
  theme: w,
55
55
  disclaimer: b,
@@ -96,10 +96,10 @@ function Ua({
96
96
  showShare: l.history_show_share ?? c?.showShare,
97
97
  showPin: l.history_show_pin ?? c?.showPin
98
98
  } : c, [c, l]), E = j(() => l ? {
99
- ...g,
100
- feedback: l.thread_actions_feedback ?? g?.feedback,
101
- retry: l.thread_actions_retry ?? g?.retry
102
- } : g, [g, l]), z = j(() => l ? {
99
+ ...p,
100
+ feedback: l.thread_actions_feedback ?? p?.feedback,
101
+ retry: l.thread_actions_retry ?? p?.retry
102
+ } : p, [p, l]), z = j(() => l ? {
103
103
  ...u,
104
104
  attachments: {
105
105
  ...u?.attachments,
@@ -203,8 +203,8 @@ function Yt() {
203
203
  }
204
204
  function Ce() {
205
205
  const r = Ke(), t = ke(), d = T.getConfig().app?.basePath || "/", i = j(() => {
206
- const m = r.pathname, g = m.endsWith("/") && m !== "/" ? m.slice(0, -1) : m, u = d.endsWith("/") && d !== "/" ? d.slice(0, -1) : d;
207
- if (g === (u || "/")) return "/";
206
+ const m = r.pathname, p = m.endsWith("/") && m !== "/" ? m.slice(0, -1) : m, u = d.endsWith("/") && d !== "/" ? d.slice(0, -1) : d;
207
+ if (p === (u || "/")) return "/";
208
208
  if (m.startsWith(u) && u !== "/") {
209
209
  let w = m.slice(u.length);
210
210
  return w.startsWith("/") || (w = "/" + w), w;
@@ -216,11 +216,11 @@ function Ce() {
216
216
  return [i, c];
217
217
  }
218
218
  function Zt({ onFinish: r } = {}) {
219
- const { t } = le(["chat", "errors"]), o = pe(), d = T.getConfig(), i = d.app?.cacheNamespace || "gentiq", [c, m] = Ce(), [g, u] = C(() => ue()), w = ee(/* @__PURE__ */ new Set());
219
+ const { t } = le(["chat", "errors"]), o = pe(), d = T.getConfig(), i = d.app?.cacheNamespace || "gentiq", [c, m] = Ce(), [p, u] = C(() => ue()), w = ee(/* @__PURE__ */ new Set());
220
220
  $(() => {
221
- c === "/" ? u(ue()) : g && c !== `/${g}` && u(ue());
221
+ c === "/" ? u(ue()) : p && c !== `/${p}` && u(ue());
222
222
  }, [c]);
223
- const b = j(() => c === "/" ? g : c.replace(/^\//, ""), [c, g]), v = J((f) => (w.current.add(f), f), []), l = J(() => {
223
+ const b = j(() => c === "/" ? p : c.replace(/^\//, ""), [c, p]), v = J((f) => (w.current.add(f), f), []), l = J(() => {
224
224
  w.current.forEach((f) => URL.revokeObjectURL(f)), w.current.clear();
225
225
  }, []);
226
226
  $(() => () => l(), [l]);
@@ -232,11 +232,11 @@ function Zt({ onFinish: r } = {}) {
232
232
  queryKey: [i, "threadMessages", b],
233
233
  queryFn: async () => {
234
234
  if (c === "/") return [];
235
- if (c === `/${g}`) return [];
235
+ if (c === `/${p}`) return [];
236
236
  const f = await T.getThreadMessages(b);
237
237
  return !f.items || !Array.isArray(f.items) ? [] : Promise.all(
238
238
  f.items.map(async (s) => {
239
- const x = typeof s.content == "string" ? s.content : s.content?.text || JSON.stringify(s.content), A = [...Array.isArray(s.parts) && s.parts.length > 0 ? s.parts : [{ type: "text", text: x }]].sort((N, R) => N.type === "file" && R.type !== "file" ? -1 : N.type !== "file" && R.type === "file" ? 1 : 0), G = await Promise.all(
239
+ const x = typeof s.content == "string" ? s.content : s.content?.text || JSON.stringify(s.content), A = [...Array.isArray(s.parts) && s.parts.length > 0 ? s.parts : [{ type: "text", text: x }]].sort((N, R) => N.type === "file" && R.type !== "file" ? -1 : N.type !== "file" && R.type === "file" ? 1 : 0), V = await Promise.all(
240
240
  A.map(async (N) => {
241
241
  if (N.type === "file" && N.object_name && !N.url)
242
242
  try {
@@ -251,7 +251,7 @@ function Zt({ onFinish: r } = {}) {
251
251
  return {
252
252
  id: s.id || ue(),
253
253
  role: s.role,
254
- parts: G,
254
+ parts: V,
255
255
  metadata: { feedback: s.feedback }
256
256
  };
257
257
  })
@@ -267,7 +267,7 @@ function Zt({ onFinish: r } = {}) {
267
267
  Object.entries(D).forEach(([R, W]) => {
268
268
  x.set(R, W);
269
269
  }), x.set("X-Thread-Id", b);
270
- const A = d.api?.basePath || "/api", G = typeof f == "string" && !f.startsWith("http") ? `${A}${f.startsWith("/") ? f : "/" + f}` : f, N = await fetch(G, { ...s, headers: x });
270
+ const A = d.api?.basePath || "/api", V = typeof f == "string" && !f.startsWith("http") ? `${A}${f.startsWith("/") ? f : "/" + f}` : f, N = await fetch(V, { ...s, headers: x });
271
271
  if (!N.ok) {
272
272
  const R = await N.json().catch(() => ({}));
273
273
  if (R.error && (R.error.code || R.error.message))
@@ -287,17 +287,17 @@ function Zt({ onFinish: r } = {}) {
287
287
  I(null);
288
288
  }, []);
289
289
  $(() => {
290
- S && (c === `/${g}` || (y.setMessages(S), E("ready")));
291
- }, [S, y.setMessages, c, g]), $(() => {
290
+ S && (c === `/${p}` || (y.setMessages(S), E("ready")));
291
+ }, [S, y.setMessages, c, p]), $(() => {
292
292
  c === "/" && (y.setMessages([]), E("idle"));
293
293
  }, [c, y.setMessages]), $(() => {
294
294
  if (c === "/") {
295
295
  E("idle");
296
296
  return;
297
297
  }
298
- const f = c === `/${g}`;
298
+ const f = c === `/${p}`;
299
299
  _ && !f ? E("loading-history") : q || z || y.error ? E("error") : y.status === "streaming" || y.status === "submitted" ? E(y.status) : E("ready");
300
- }, [_, q, y.status, z, y.error, c, g]), $(() => () => {
300
+ }, [_, q, y.status, z, y.error, c, p]), $(() => () => {
301
301
  y.stop();
302
302
  }, [b, y.stop]);
303
303
  const B = ee(/* @__PURE__ */ new Set()), F = j(() => y.messages.filter((f) => f.role === "assistant"), [y.messages]);
@@ -315,9 +315,9 @@ function Zt({ onFinish: r } = {}) {
315
315
  if (!(!D && (!s || s.length === 0)) && !(h === "loading-history" || h === "streaming" || h === "submitted")) {
316
316
  if (y.stop(), x) {
317
317
  m(`/${b}`);
318
- const A = D || t("attach_file"), G = A.length > 30 ? A.slice(0, 30) + "..." : A;
318
+ const A = D || t("attach_file"), V = A.length > 30 ? A.slice(0, 30) + "..." : A;
319
319
  o.setQueryData([i, "conversations"], (N) => {
320
- const R = { id: `/${b}`, firstMessage: G, timestamp: Date.now() };
320
+ const R = { id: `/${b}`, firstMessage: V, timestamp: Date.now() };
321
321
  return N && Array.isArray(N.pages) ? {
322
322
  ...N,
323
323
  pages: N.pages.map((W, ce) => ce === 0 ? {
@@ -332,8 +332,8 @@ function Zt({ onFinish: r } = {}) {
332
332
  await y.sendMessage({ text: D, files: s });
333
333
  } catch (A) {
334
334
  console.error("Failed to send message:", A);
335
- const G = ie(A, t);
336
- I(new Error(G)), E("error");
335
+ const V = ie(A, t);
336
+ I(new Error(V)), E("error");
337
337
  }
338
338
  }
339
339
  }, [y, m, c, b, t, o, h, i]), U = J(() => {
@@ -360,7 +360,7 @@ function Zt({ onFinish: r } = {}) {
360
360
  }), [y, L, U, H, K, h, q, c]);
361
361
  }
362
362
  function ea({ classNames: r = {}, disclaimer: t }) {
363
- const { t: o, i18n: d } = le(["chat", "translation"]), i = Zt(), { messages: c, status: m, regenerate: g, error: u, clearError: w, stop: b, isLoadingHistory: v, conversationId: l, sendMessage: S } = i, { MessageList: _, PromptInput: q, disclaimer: O } = te(), P = t ?? O, y = d.exists("chat:disclaimer") ? o("chat:disclaimer") : null, h = typeof P == "string" ? o(P) : P ?? y, [E, z] = C(null), I = ee(m);
363
+ const { t: o, i18n: d } = le(["chat", "translation"]), i = Zt(), { messages: c, status: m, regenerate: p, error: u, clearError: w, stop: b, isLoadingHistory: v, conversationId: l, sendMessage: S } = i, { MessageList: _, PromptInput: q, disclaimer: O } = te(), P = t ?? O, y = d.exists("chat:disclaimer") ? o("chat:disclaimer") : null, h = typeof P == "string" ? o(P) : P ?? y, [E, z] = C(null), I = ee(m);
364
364
  Ve(() => {
365
365
  u && w();
366
366
  }, [l, w, u]);
@@ -369,7 +369,7 @@ function ea({ classNames: r = {}, disclaimer: t }) {
369
369
  m === "error" && I.current !== "error" && E !== l ? z(l) : m === "submitted" && E !== null && z(null), I.current = m;
370
370
  }, [m, l]);
371
371
  const F = m === "error" && (l === "/" || E === l);
372
- return /* @__PURE__ */ n("div", { className: p("relative flex flex-col h-full overflow-hidden", r.container), children: [
372
+ return /* @__PURE__ */ n("div", { className: g("relative flex flex-col h-full overflow-hidden", r.container), children: [
373
373
  /* @__PURE__ */ e(
374
374
  _,
375
375
  {
@@ -378,10 +378,10 @@ function ea({ classNames: r = {}, disclaimer: t }) {
378
378
  isLoadingHistory: v,
379
379
  error: F ? u : null,
380
380
  conversationId: l,
381
- regen: (L) => g({ messageId: L }),
381
+ regen: (L) => p({ messageId: L }),
382
382
  onSuggestionClick: (L) => S(L),
383
383
  chat: i,
384
- className: p("flex-1", r.messageList)
384
+ className: g("flex-1", r.messageList)
385
385
  }
386
386
  ),
387
387
  /* @__PURE__ */ n("div", { className: "absolute bottom-0 left-0 right-0 z-10 pointer-events-none flex flex-col items-stretch", children: [
@@ -394,7 +394,7 @@ function ea({ classNames: r = {}, disclaimer: t }) {
394
394
  stop: b,
395
395
  isErrorVisible: F,
396
396
  conversationId: l,
397
- className: p("pointer-events-auto", r.inputArea, h && "pb-0 md:pb-0")
397
+ className: g("pointer-events-auto", r.inputArea, h && "pb-0 md:pb-0")
398
398
  }
399
399
  ),
400
400
  h && /* @__PURE__ */ n("div", { className: "relative py-1 px-4 flex justify-center items-center pointer-events-auto", children: [
@@ -412,7 +412,7 @@ const ta = ({
412
412
  composer: i,
413
413
  theme: c,
414
414
  disclaimer: m,
415
- ...g
415
+ ...p
416
416
  }) => {
417
417
  const u = te(), w = j(() => ({
418
418
  ...u,
@@ -435,7 +435,7 @@ const ta = ({
435
435
  app: u.app,
436
436
  i18n: u.i18n,
437
437
  settings: u.settings,
438
- children: /* @__PURE__ */ e(ea, { ...g })
438
+ children: /* @__PURE__ */ e(ea, { ...p })
439
439
  }
440
440
  );
441
441
  }, ge = 768;
@@ -461,7 +461,7 @@ function sa({ className: r, ...t }) {
461
461
  re.Overlay,
462
462
  {
463
463
  "data-slot": "sheet-overlay",
464
- className: p(
464
+ className: g(
465
465
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
466
466
  r
467
467
  ),
@@ -481,7 +481,7 @@ function oa({
481
481
  re.Content,
482
482
  {
483
483
  "data-slot": "sheet-content",
484
- className: p(
484
+ className: g(
485
485
  "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
486
486
  o === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
487
487
  o === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
@@ -502,14 +502,14 @@ function oa({
502
502
  ] });
503
503
  }
504
504
  function ia({ className: r, ...t }) {
505
- return /* @__PURE__ */ e("div", { "data-slot": "sheet-header", className: p("flex flex-col gap-1.5 p-4", r), ...t });
505
+ return /* @__PURE__ */ e("div", { "data-slot": "sheet-header", className: g("flex flex-col gap-1.5 p-4", r), ...t });
506
506
  }
507
507
  function la({ className: r, ...t }) {
508
508
  return /* @__PURE__ */ e(
509
509
  re.Title,
510
510
  {
511
511
  "data-slot": "sheet-title",
512
- className: p("text-foreground font-semibold", r),
512
+ className: g("text-foreground font-semibold", r),
513
513
  ...t
514
514
  }
515
515
  );
@@ -519,7 +519,7 @@ function ca({ className: r, ...t }) {
519
519
  re.Description,
520
520
  {
521
521
  "data-slot": "sheet-description",
522
- className: p("text-muted-foreground text-sm", r),
522
+ className: g("text-muted-foreground text-sm", r),
523
523
  ...t
524
524
  }
525
525
  );
@@ -540,15 +540,15 @@ function fa({
540
540
  children: c,
541
541
  ...m
542
542
  }) {
543
- const g = aa(), [u, w] = Z.useState(!1), [b, v] = Z.useState(r), l = t ?? b, S = Z.useCallback(
543
+ const p = aa(), [u, w] = Z.useState(!1), [b, v] = Z.useState(r), l = t ?? b, S = Z.useCallback(
544
544
  (P) => {
545
545
  const y = typeof P == "function" ? P(l) : P;
546
546
  o ? o(y) : v(y), document.cookie = `${da}=${y}; path=/; max-age=${ua}`;
547
547
  },
548
548
  [o, l]
549
549
  ), _ = Z.useCallback(() => {
550
- g ? w((P) => !P) : S((P) => !P);
551
- }, [g, S, w]);
550
+ p ? w((P) => !P) : S((P) => !P);
551
+ }, [p, S, w]);
552
552
  Z.useEffect(() => {
553
553
  const P = (y) => {
554
554
  y.key === ga && (y.metaKey || y.ctrlKey) && (y.preventDefault(), _());
@@ -562,12 +562,12 @@ function fa({
562
562
  state: q,
563
563
  open: l,
564
564
  setOpen: S,
565
- isMobile: g,
565
+ isMobile: p,
566
566
  openMobile: u,
567
567
  setOpenMobile: w,
568
568
  toggleSidebar: _
569
569
  }),
570
- [q, l, S, g, u, w, _]
570
+ [q, l, S, p, u, w, _]
571
571
  );
572
572
  return /* @__PURE__ */ e(He.Provider, { value: O, children: /* @__PURE__ */ e(qe, { delayDuration: 0, children: /* @__PURE__ */ e(
573
573
  "div",
@@ -578,7 +578,7 @@ function fa({
578
578
  "--sidebar-width-icon": pa,
579
579
  ...i
580
580
  },
581
- className: p("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", d),
581
+ className: g("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", d),
582
582
  ...m,
583
583
  children: c
584
584
  }
@@ -592,12 +592,12 @@ function ba({
592
592
  children: i,
593
593
  ...c
594
594
  }) {
595
- const { isMobile: m, state: g, openMobile: u, setOpenMobile: w } = _e();
595
+ const { isMobile: m, state: p, openMobile: u, setOpenMobile: w } = _e();
596
596
  return o === "none" ? /* @__PURE__ */ e(
597
597
  "div",
598
598
  {
599
599
  "data-slot": "sidebar",
600
- className: p("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", d),
600
+ className: g("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", d),
601
601
  ...c,
602
602
  children: i
603
603
  }
@@ -625,8 +625,8 @@ function ba({
625
625
  "div",
626
626
  {
627
627
  className: "group peer text-sidebar-foreground hidden md:block",
628
- "data-state": g,
629
- "data-collapsible": g === "collapsed" ? o : "",
628
+ "data-state": p,
629
+ "data-collapsible": p === "collapsed" ? o : "",
630
630
  "data-variant": t,
631
631
  "data-side": r,
632
632
  "data-slot": "sidebar",
@@ -635,7 +635,7 @@ function ba({
635
635
  "div",
636
636
  {
637
637
  "data-slot": "sidebar-gap",
638
- className: p(
638
+ className: g(
639
639
  "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
640
640
  "group-data-[collapsible=offcanvas]:w-0",
641
641
  "group-data-[side=right]:rotate-180",
@@ -647,7 +647,7 @@ function ba({
647
647
  "div",
648
648
  {
649
649
  "data-slot": "sidebar-container",
650
- className: p(
650
+ className: g(
651
651
  "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
652
652
  r === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
653
653
  // Adjust the padding for floating and inset variants.
@@ -679,7 +679,7 @@ function va({ className: r, onClick: t, ...o }) {
679
679
  "data-slot": "sidebar-trigger",
680
680
  variant: "ghost",
681
681
  size: "icon",
682
- className: p("size-7", r),
682
+ className: g("size-7", r),
683
683
  onClick: (i) => {
684
684
  t?.(i), d();
685
685
  },
@@ -697,7 +697,7 @@ function xa({ className: r, ...t }) {
697
697
  {
698
698
  "data-slot": "sidebar-footer",
699
699
  "data-sidebar": "footer",
700
- className: p("flex flex-col gap-2 p-2", r),
700
+ className: g("flex flex-col gap-2 p-2", r),
701
701
  ...t
702
702
  }
703
703
  );
@@ -708,7 +708,7 @@ function ya({ className: r, ...t }) {
708
708
  {
709
709
  "data-slot": "sidebar-content",
710
710
  "data-sidebar": "content",
711
- className: p(
711
+ className: g(
712
712
  "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
713
713
  r
714
714
  ),
@@ -722,7 +722,7 @@ function wa({ className: r, ...t }) {
722
722
  {
723
723
  "data-slot": "sidebar-group",
724
724
  "data-sidebar": "group",
725
- className: p("relative flex w-full min-w-0 flex-col p-2", r),
725
+ className: g("relative flex w-full min-w-0 flex-col p-2", r),
726
726
  ...t
727
727
  }
728
728
  );
@@ -733,7 +733,7 @@ function Ie({ className: r, ...t }) {
733
733
  {
734
734
  "data-slot": "sidebar-group-content",
735
735
  "data-sidebar": "group-content",
736
- className: p("w-full text-sm", r),
736
+ className: g("w-full text-sm", r),
737
737
  ...t
738
738
  }
739
739
  );
@@ -744,7 +744,7 @@ function De({ className: r, ...t }) {
744
744
  {
745
745
  "data-slot": "sidebar-menu",
746
746
  "data-sidebar": "menu",
747
- className: p("flex w-full min-w-0 flex-col gap-1", r),
747
+ className: g("flex w-full min-w-0 flex-col gap-1", r),
748
748
  ...t
749
749
  }
750
750
  );
@@ -755,7 +755,7 @@ function Ee({ className: r, ...t }) {
755
755
  {
756
756
  "data-slot": "sidebar-menu-item",
757
757
  "data-sidebar": "menu-item",
758
- className: p("group/menu-item relative", r),
758
+ className: g("group/menu-item relative", r),
759
759
  ...t
760
760
  }
761
761
  );
@@ -789,14 +789,14 @@ function Le({
789
789
  className: c,
790
790
  ...m
791
791
  }) {
792
- const g = r ? Wt : "button", { isMobile: u, state: w } = _e(), b = /* @__PURE__ */ e(
793
- g,
792
+ const p = r ? Wt : "button", { isMobile: u, state: w } = _e(), b = /* @__PURE__ */ e(
793
+ p,
794
794
  {
795
795
  "data-slot": "sidebar-menu-button",
796
796
  "data-sidebar": "menu-button",
797
797
  "data-size": d,
798
798
  "data-active": t,
799
- className: p(Na({ variant: o, size: d }), c),
799
+ className: g(Na({ variant: o, size: d }), c),
800
800
  ...m
801
801
  }
802
802
  );
@@ -808,7 +808,7 @@ function Le({
808
808
  ] })) : b;
809
809
  }
810
810
  function ka({ trigger: r }) {
811
- const { t, i18n: o } = le(["settings", "translation"]), { app: d, settings: i } = te(), { theme: c, setTheme: m, accent: g, setAccent: u, radius: w, setRadius: b } = $e(), [v, l] = C(null), [S, _] = C(!1), q = ee(null), O = j(() => [
811
+ const { t, i18n: o } = le(["settings", "translation"]), { app: d, settings: i } = te(), { theme: c, setTheme: m, accent: p, setAccent: u, radius: w, setRadius: b } = $e(), [v, l] = C(null), [S, _] = C(!1), q = ee(null), O = j(() => [
812
812
  { id: "general", label: t("sections.general", "General"), icon: Pe },
813
813
  { id: "profile", label: t("sections.profile", "Profile"), icon: Nt },
814
814
  { id: "account", label: t("sections.account", "Account"), icon: kt }
@@ -818,7 +818,7 @@ function ka({ trigger: r }) {
818
818
  }), [t, i]), [P, y] = C(O[0]?.id || "general"), h = J((a, k, M = "editable") => {
819
819
  const se = i?.sections?.[a]?.fields;
820
820
  return se && se[k] || M;
821
- }, [i]), [E, z] = C(""), [I, H] = C(""), [B, F] = C(""), [L, U] = C(""), K = j(() => d?.userMetadataFields?.filter((a) => a.showInProfile) || [], [d?.userMetadataFields]), [f, s] = C({}), [x, D] = C(!1), A = o.language === "fa", G = A ? "text-right" : "text-left", N = J(async () => {
821
+ }, [i]), [E, z] = C(""), [I, H] = C(""), [B, F] = C(""), [L, U] = C(""), K = j(() => d?.userMetadataFields?.filter((a) => a.showInProfile) || [], [d?.userMetadataFields]), [f, s] = C({}), [x, D] = C(!1), A = o.language === "fa", V = A ? "text-right" : "text-left", N = J(async () => {
822
822
  try {
823
823
  const a = await T.getMe();
824
824
  l(a), z(a.name || ""), H(a.surname || ""), F(a.phone || "");
@@ -864,7 +864,7 @@ function ka({ trigger: r }) {
864
864
  Ue,
865
865
  {
866
866
  dir: A ? "rtl" : "ltr",
867
- className: p(
867
+ className: g(
868
868
  "w-full sm:w-[95vw] sm:max-w-[700px] p-0 gap-0 overflow-hidden rounded-t-2xl sm:rounded-3xl border-none shadow-2xl bg-background/95 backdrop-blur-md h-[90vh] sm:h-[750px]",
869
869
  A && "rtl"
870
870
  ),
@@ -878,13 +878,13 @@ function ka({ trigger: r }) {
878
878
  "button",
879
879
  {
880
880
  onClick: () => y(a.id),
881
- className: p(
881
+ className: g(
882
882
  "flex items-center gap-1.5 sm:gap-2 pb-2 sm:pb-3 pt-1 px-2 sm:px-1 text-sm sm:text-base font-medium transition-all border-b-2 whitespace-nowrap shrink-0",
883
883
  P === a.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border",
884
884
  i?.sections?.[a.id]?.mode === "faded" && "opacity-50 pointer-events-none select-none"
885
885
  ),
886
886
  children: [
887
- /* @__PURE__ */ e(a.icon, { className: p(
887
+ /* @__PURE__ */ e(a.icon, { className: g(
888
888
  "h-3.5 w-3.5 sm:h-4 sm:w-4 transition-transform",
889
889
  P === a.id && "scale-110"
890
890
  ) }),
@@ -902,56 +902,56 @@ function ka({ trigger: r }) {
902
902
  ] }),
903
903
  /* @__PURE__ */ n("div", { className: "grid gap-6", children: [
904
904
  /* @__PURE__ */ n("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
905
- h("profile", "name") !== "hidden" && /* @__PURE__ */ n("div", { className: p("flex flex-col gap-3", h("profile", "name") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
905
+ h("profile", "name") !== "hidden" && /* @__PURE__ */ n("div", { className: g("flex flex-col gap-3", h("profile", "name") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
906
906
  /* @__PURE__ */ e(Q, { htmlFor: "name", className: "px-1", children: t("profile.name", "First Name") }),
907
907
  /* @__PURE__ */ e(
908
- V,
908
+ G,
909
909
  {
910
910
  id: "name",
911
911
  value: E,
912
912
  onChange: (a) => z(a.target.value),
913
913
  disabled: h("profile", "name") === "faded",
914
- className: p("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", G)
914
+ className: g("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", V)
915
915
  }
916
916
  )
917
917
  ] }),
918
- h("profile", "surname") !== "hidden" && /* @__PURE__ */ n("div", { className: p("flex flex-col gap-3", h("profile", "surname") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
918
+ h("profile", "surname") !== "hidden" && /* @__PURE__ */ n("div", { className: g("flex flex-col gap-3", h("profile", "surname") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
919
919
  /* @__PURE__ */ e(Q, { htmlFor: "surname", className: "px-1", children: t("profile.surname", "Last Name") }),
920
920
  /* @__PURE__ */ e(
921
- V,
921
+ G,
922
922
  {
923
923
  id: "surname",
924
924
  value: I,
925
925
  onChange: (a) => H(a.target.value),
926
926
  disabled: h("profile", "surname") === "faded",
927
- className: p("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", G)
927
+ className: g("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", V)
928
928
  }
929
929
  )
930
930
  ] })
931
931
  ] }),
932
- h("profile", "phone") !== "hidden" && /* @__PURE__ */ n("div", { className: p("flex flex-col gap-3", h("profile", "phone") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
933
- /* @__PURE__ */ e(Q, { htmlFor: "phone", className: "px-1", children: t("profile.phone", "Phone Number") }),
932
+ h("profile", "phone") !== "hidden" && /* @__PURE__ */ n("div", { className: g("flex flex-col gap-3", h("profile", "phone") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
933
+ /* @__PURE__ */ e(Q, { htmlFor: "phone", className: "px-1 text-left", children: t("profile.phone", "Phone Number") }),
934
934
  /* @__PURE__ */ n("div", { className: "relative", children: [
935
- /* @__PURE__ */ e(Ct, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground start-3" }),
935
+ /* @__PURE__ */ e(Ct, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground left-3" }),
936
936
  /* @__PURE__ */ e(
937
- V,
937
+ G,
938
938
  {
939
939
  id: "phone",
940
940
  value: B,
941
941
  onChange: (a) => F(a.target.value),
942
942
  disabled: h("profile", "phone") === "faded",
943
- className: p("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary ps-10 pe-3", G),
943
+ className: "bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary pl-10 pr-3 text-left",
944
944
  dir: "ltr"
945
945
  }
946
946
  )
947
947
  ] })
948
948
  ] }),
949
- h("profile", "password") !== "hidden" && /* @__PURE__ */ n("div", { className: p("flex flex-col gap-3", h("profile", "password") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
950
- /* @__PURE__ */ e(Q, { htmlFor: "pass", className: "px-1", children: t("profile.password", "New Password") }),
949
+ h("profile", "password") !== "hidden" && /* @__PURE__ */ n("div", { className: g("flex flex-col gap-3", h("profile", "password") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
950
+ /* @__PURE__ */ e(Q, { htmlFor: "pass", className: "px-1 text-left", children: t("profile.password", "New Password") }),
951
951
  /* @__PURE__ */ n("div", { className: "relative", children: [
952
- /* @__PURE__ */ e(_t, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground start-3" }),
952
+ /* @__PURE__ */ e(_t, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground left-3" }),
953
953
  /* @__PURE__ */ e(
954
- V,
954
+ G,
955
955
  {
956
956
  id: "pass",
957
957
  type: "password",
@@ -959,7 +959,7 @@ function ka({ trigger: r }) {
959
959
  onChange: (a) => U(a.target.value),
960
960
  disabled: h("profile", "password") === "faded",
961
961
  placeholder: t("profile.password_placeholder", "Leave empty to keep current"),
962
- className: p("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary ps-10 pe-3", G),
962
+ className: "bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary pl-10 pr-3 text-left",
963
963
  dir: "ltr"
964
964
  }
965
965
  )
@@ -967,7 +967,7 @@ function ka({ trigger: r }) {
967
967
  ] }),
968
968
  K.map((a) => {
969
969
  const k = h("profile", a.key, a.mode || "editable");
970
- return k === "hidden" || !he(a.condition, f) ? null : /* @__PURE__ */ n("div", { className: p("flex flex-col gap-3 animate-in fade-in slide-in-from-top-1 duration-200", k === "faded" && "opacity-50 pointer-events-none select-none"), children: [
970
+ return k === "hidden" || !he(a.condition, f) ? null : /* @__PURE__ */ n("div", { className: g("flex flex-col gap-3 animate-in fade-in slide-in-from-top-1 duration-200", k === "faded" && "opacity-50 pointer-events-none select-none"), children: [
971
971
  /* @__PURE__ */ e(Q, { htmlFor: `profile-${a.key}`, className: "px-1", children: t(a.label) }),
972
972
  a.type === "select" ? /* @__PURE__ */ n(
973
973
  be,
@@ -995,7 +995,7 @@ function ka({ trigger: r }) {
995
995
  ),
996
996
  /* @__PURE__ */ e(Q, { htmlFor: `profile-${a.key}`, className: "text-sm font-medium text-muted-foreground cursor-pointer", children: t(a.placeholder || a.label) })
997
997
  ] }) : /* @__PURE__ */ e(
998
- V,
998
+ G,
999
999
  {
1000
1000
  id: `profile-${a.key}`,
1001
1001
  type: a.type,
@@ -1003,12 +1003,12 @@ function ka({ trigger: r }) {
1003
1003
  disabled: k === "faded",
1004
1004
  onChange: (M) => s({ ...f, [a.key]: M.target.value }),
1005
1005
  placeholder: t(a.placeholder || ""),
1006
- className: p("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", G)
1006
+ className: g("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", V)
1007
1007
  }
1008
1008
  )
1009
1009
  ] }, a.key);
1010
1010
  }),
1011
- /* @__PURE__ */ e("div", { className: "pt-4", children: /* @__PURE__ */ n(
1011
+ /* @__PURE__ */ e("div", { className: "pt-4 flex justify-center", children: /* @__PURE__ */ n(
1012
1012
  Y,
1013
1013
  {
1014
1014
  onClick: R,
@@ -1028,7 +1028,7 @@ function ka({ trigger: r }) {
1028
1028
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("general.subtitle", "Configure look and feel and language.") })
1029
1029
  ] }),
1030
1030
  /* @__PURE__ */ n("div", { className: "space-y-8", children: [
1031
- h("general", "theme") !== "hidden" && /* @__PURE__ */ n("div", { className: p("space-y-3", h("general", "theme") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
1031
+ h("general", "theme") !== "hidden" && /* @__PURE__ */ n("div", { className: g("space-y-3", h("general", "theme") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
1032
1032
  /* @__PURE__ */ n(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
1033
1033
  /* @__PURE__ */ e(Pe, { className: "h-4 w-4 text-primary" }),
1034
1034
  t("general.theme", "Theme")
@@ -1039,7 +1039,7 @@ function ka({ trigger: r }) {
1039
1039
  {
1040
1040
  onClick: () => m("light"),
1041
1041
  disabled: h("general", "theme") === "faded",
1042
- className: p(
1042
+ className: g(
1043
1043
  "flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
1044
1044
  c === "light" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
1045
1045
  ),
@@ -1054,7 +1054,7 @@ function ka({ trigger: r }) {
1054
1054
  {
1055
1055
  onClick: () => m("dark"),
1056
1056
  disabled: h("general", "theme") === "faded",
1057
- className: p(
1057
+ className: g(
1058
1058
  "flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
1059
1059
  c === "dark" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
1060
1060
  ),
@@ -1069,7 +1069,7 @@ function ka({ trigger: r }) {
1069
1069
  {
1070
1070
  onClick: () => m("system"),
1071
1071
  disabled: h("general", "theme") === "faded",
1072
- className: p(
1072
+ className: g(
1073
1073
  "flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
1074
1074
  c === "system" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
1075
1075
  ),
@@ -1081,7 +1081,7 @@ function ka({ trigger: r }) {
1081
1081
  )
1082
1082
  ] })
1083
1083
  ] }),
1084
- h("general", "accent") !== "hidden" && /* @__PURE__ */ n("div", { className: p("space-y-4", h("general", "accent") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
1084
+ h("general", "accent") !== "hidden" && /* @__PURE__ */ n("div", { className: g("space-y-4", h("general", "accent") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
1085
1085
  /* @__PURE__ */ n(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
1086
1086
  /* @__PURE__ */ e(Me, { className: "h-4 w-4 text-primary" }),
1087
1087
  t("general.accent", "Accent Color")
@@ -1104,13 +1104,13 @@ function ka({ trigger: r }) {
1104
1104
  "oklch(0.552 0.016 285.938)"
1105
1105
  // Slate
1106
1106
  ].map((a) => {
1107
- const k = (g || "oklch(0.623 0.214 259.815)") === a;
1107
+ const k = (p || "oklch(0.623 0.214 259.815)") === a;
1108
1108
  return /* @__PURE__ */ e(
1109
1109
  "button",
1110
1110
  {
1111
1111
  onClick: () => u(a),
1112
1112
  disabled: h("general", "accent") === "faded",
1113
- className: p(
1113
+ className: g(
1114
1114
  "h-8 w-8 rounded-full border-2 transition-all hover:scale-110 active:scale-95 shadow-sm",
1115
1115
  k ? "border-foreground" : "border-transparent"
1116
1116
  ),
@@ -1120,7 +1120,7 @@ function ka({ trigger: r }) {
1120
1120
  );
1121
1121
  }) })
1122
1122
  ] }),
1123
- h("general", "radius") !== "hidden" && /* @__PURE__ */ n("div", { className: p("space-y-4", h("general", "radius") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
1123
+ h("general", "radius") !== "hidden" && /* @__PURE__ */ n("div", { className: g("space-y-4", h("general", "radius") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
1124
1124
  /* @__PURE__ */ n(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
1125
1125
  /* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-md border-2 border-primary" }),
1126
1126
  t("general.radius", "Rounded Corners")
@@ -1135,7 +1135,7 @@ function ka({ trigger: r }) {
1135
1135
  {
1136
1136
  onClick: () => b(a.value),
1137
1137
  disabled: h("general", "radius") === "faded",
1138
- className: p(
1138
+ className: g(
1139
1139
  "flex-1 py-2 rounded-xl transition-all text-sm font-medium",
1140
1140
  k ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
1141
1141
  ),
@@ -1145,7 +1145,7 @@ function ka({ trigger: r }) {
1145
1145
  );
1146
1146
  }) })
1147
1147
  ] }),
1148
- h("general", "language") !== "hidden" && /* @__PURE__ */ n("div", { className: p("space-y-3", h("general", "language") === "faded" && "opacity-50"), children: [
1148
+ h("general", "language") !== "hidden" && /* @__PURE__ */ n("div", { className: g("space-y-3", h("general", "language") === "faded" && "opacity-50"), children: [
1149
1149
  /* @__PURE__ */ n(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
1150
1150
  /* @__PURE__ */ e(It, { className: "h-4 w-4 text-primary" }),
1151
1151
  t("general.language", "Language")
@@ -1181,7 +1181,7 @@ function ka({ trigger: r }) {
1181
1181
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("account.subtitle", "Monitor your quotas and manage your session.") })
1182
1182
  ] }),
1183
1183
  /* @__PURE__ */ n("div", { className: "space-y-6", children: [
1184
- h("account", "balance") !== "hidden" && /* @__PURE__ */ n("div", { className: p("p-6 bg-muted/30 rounded-3xl border border-border/40 space-y-6", h("account", "balance") === "faded" && "opacity-50"), children: [
1184
+ h("account", "balance") !== "hidden" && /* @__PURE__ */ n("div", { className: g("p-6 bg-muted/30 rounded-3xl border border-border/40 space-y-6", h("account", "balance") === "faded" && "opacity-50"), children: [
1185
1185
  /* @__PURE__ */ n(Q, { className: "text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2", children: [
1186
1186
  /* @__PURE__ */ e(Dt, { className: "h-4 w-4" }),
1187
1187
  t("account.balance", "Current Balance")
@@ -1198,7 +1198,7 @@ function ka({ trigger: r }) {
1198
1198
  /* @__PURE__ */ e("div", { className: "h-2.5 w-full bg-muted/50 rounded-full overflow-hidden border border-border/20 p-0.5", dir: "ltr", children: /* @__PURE__ */ e(
1199
1199
  "div",
1200
1200
  {
1201
- className: p(
1201
+ className: g(
1202
1202
  "h-full rounded-full transition-all duration-1000 shadow-sm",
1203
1203
  ae > 60 ? "bg-emerald-500 shadow-emerald-500/20" : ae > 20 ? "bg-amber-500 shadow-amber-500/20" : "bg-destructive shadow-destructive/20"
1204
1204
  ),
@@ -1220,7 +1220,7 @@ function ka({ trigger: r }) {
1220
1220
  /* @__PURE__ */ e("div", { className: "h-2.5 w-full bg-muted/50 rounded-full overflow-hidden border border-border/20 p-0.5", dir: "ltr", children: /* @__PURE__ */ e(
1221
1221
  "div",
1222
1222
  {
1223
- className: p(
1223
+ className: g(
1224
1224
  "h-full rounded-full transition-all duration-1000 shadow-sm",
1225
1225
  ne > 60 ? "bg-emerald-500 shadow-emerald-500/20" : ne > 20 ? "bg-amber-500 shadow-amber-500/20" : "bg-destructive shadow-destructive/20"
1226
1226
  ),
@@ -1242,7 +1242,7 @@ function ka({ trigger: r }) {
1242
1242
  variant: "destructive",
1243
1243
  onClick: W,
1244
1244
  disabled: h("account", "logout") === "faded",
1245
- className: p("rounded-2xl gap-2 font-bold h-12 shadow-lg shadow-destructive/10 transition-all active:scale-[0.98]", h("account", "logout") === "faded" && "opacity-50 pointer-events-none"),
1245
+ className: g("rounded-2xl gap-2 font-bold h-12 shadow-lg shadow-destructive/10 transition-all active:scale-[0.98]", h("account", "logout") === "faded" && "opacity-50 pointer-events-none"),
1246
1246
  children: [
1247
1247
  /* @__PURE__ */ e(Et, { className: "h-4 w-4" }),
1248
1248
  t("account.logout", "Logout from Account")
@@ -1259,7 +1259,7 @@ function ka({ trigger: r }) {
1259
1259
  ] });
1260
1260
  }
1261
1261
  function Qe({ hideActions: r = !1 }) {
1262
- const [, t] = Ce(), { t: o } = le(["sidebar", "chat"]), { history: d, app: i } = te(), { theme: c } = $e(), m = !r && (d?.enabled ?? !0), [g, u] = C("light");
1262
+ const [, t] = Ce(), { t: o } = le(["sidebar", "chat"]), { history: d, app: i } = te(), { theme: c } = $e(), m = !r && (d?.enabled ?? !0), [p, u] = C("light");
1263
1263
  $(() => {
1264
1264
  if (c === "system") {
1265
1265
  const v = window.matchMedia("(prefers-color-scheme: dark)").matches;
@@ -1267,7 +1267,7 @@ function Qe({ hideActions: r = !1 }) {
1267
1267
  } else
1268
1268
  u(c);
1269
1269
  }, [c]);
1270
- const w = j(() => i?.logo ? typeof i.logo == "string" ? i.logo : g === "dark" ? i.logo.dark : i.logo.light : st, [i?.logo, g]), b = i?.name || "Gentiq";
1270
+ const w = j(() => i?.logo ? typeof i.logo == "string" ? i.logo : p === "dark" ? i.logo.dark : i.logo.light : st, [i?.logo, p]), b = i?.name || "Gentiq";
1271
1271
  return /* @__PURE__ */ n("header", { className: "relative flex items-center justify-between px-3 md:px-4 h-14 sticky top-0 z-40 w-full glass border-b border-border/30 transition-all duration-300", children: [
1272
1272
  /* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 md:gap-2 min-w-[36px] md:min-w-[80px]", children: m && /* @__PURE__ */ e(va, { className: "hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 rounded-lg size-9" }) }),
1273
1273
  /* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2.5 select-none animate-in fade-in zoom-in-95 duration-500", children: /* @__PURE__ */ e(
@@ -1284,7 +1284,7 @@ function Qe({ hideActions: r = !1 }) {
1284
1284
  "button",
1285
1285
  {
1286
1286
  type: "button",
1287
- className: p(
1287
+ className: g(
1288
1288
  "flex items-center justify-center size-9 rounded-lg hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 text-muted-foreground hover:text-primary",
1289
1289
  m && "md:hidden"
1290
1290
  ),
@@ -1350,7 +1350,7 @@ function Sa({ side: r = "left" }) {
1350
1350
  fetchNextPage: i,
1351
1351
  hasNextPage: c,
1352
1352
  isFetchingNextPage: m,
1353
- isLoading: g
1353
+ isLoading: p
1354
1354
  } = Ca(), { history: u, app: w } = te(), b = w?.basePath || "/", v = u?.enabled ?? !1, l = d?.pages.flatMap((a) => a.threads) ?? [], [S, _] = Ce(), q = pe(), O = ee(null), P = J(
1355
1355
  (a) => {
1356
1356
  O.current && (O.current.disconnect(), O.current = null), a && c && !m && (O.current = new IntersectionObserver(
@@ -1374,7 +1374,7 @@ function Sa({ side: r = "left" }) {
1374
1374
  } catch {
1375
1375
  X.error(t("pin_failed"));
1376
1376
  }
1377
- }, G = async (a) => {
1377
+ }, V = async (a) => {
1378
1378
  try {
1379
1379
  const k = await T.shareThread(a.id.replace(/^\//, "")), M = `${window.location.origin}${k.url}`;
1380
1380
  navigator.clipboard.writeText(M), X.success(t("share_success"), {
@@ -1432,7 +1432,7 @@ function Sa({ side: r = "left" }) {
1432
1432
  v && /* @__PURE__ */ e(Ie, { className: "group-data-[collapsible=icon]:hidden mb-6 px-2", children: /* @__PURE__ */ n("div", { className: "relative group/search", children: [
1433
1433
  /* @__PURE__ */ e(zt, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 opacity-40 group-focus-within/search:opacity-70 transition-opacity" }),
1434
1434
  /* @__PURE__ */ e(
1435
- V,
1435
+ G,
1436
1436
  {
1437
1437
  placeholder: t("search_conversations"),
1438
1438
  value: B,
@@ -1447,7 +1447,7 @@ function Sa({ side: r = "left" }) {
1447
1447
  const M = L === a.id, se = Se(a.firstMessage ?? ""), Ge = se === "rtl";
1448
1448
  return /* @__PURE__ */ e(Ee, { className: "group/sidebar-menu-item relative", children: M ? /* @__PURE__ */ n("div", { className: "flex items-center gap-1 px-2 py-1.5 w-full", children: [
1449
1449
  /* @__PURE__ */ e(
1450
- V,
1450
+ G,
1451
1451
  {
1452
1452
  ref: s,
1453
1453
  value: K,
@@ -1466,7 +1466,7 @@ function Sa({ side: r = "left" }) {
1466
1466
  Le,
1467
1467
  {
1468
1468
  asChild: !0,
1469
- className: p("h-auto py-2.5 px-3", {
1469
+ className: g("h-auto py-2.5 px-3", {
1470
1470
  "bg-accent opacity-100 pointer-events-none": a.id === S,
1471
1471
  "opacity-70 hover:opacity-100": a.id !== S
1472
1472
  }),
@@ -1476,16 +1476,16 @@ function Sa({ side: r = "left" }) {
1476
1476
  href: fe(b, a.id),
1477
1477
  onClick: (oe) => x(oe, a.id),
1478
1478
  dir: se,
1479
- className: p("flex flex-col gap-0.5 w-full overflow-hidden", Ge ? "items-end" : "items-start"),
1479
+ className: g("flex flex-col gap-0.5 w-full overflow-hidden", Ge ? "items-end" : "items-start"),
1480
1480
  children: [
1481
- /* @__PURE__ */ e("span", { className: p("truncate w-full font-medium text-[0.9375rem]", o.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: a.firstMessage }),
1482
- /* @__PURE__ */ e("div", { className: p("text-[10px] opacity-40 w-full", o.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: ne(a.timestamp) })
1481
+ /* @__PURE__ */ e("span", { className: g("truncate w-full font-medium text-[0.9375rem]", o.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: a.firstMessage }),
1482
+ /* @__PURE__ */ e("div", { className: g("text-[10px] opacity-40 w-full", o.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: ne(a.timestamp) })
1483
1483
  ]
1484
1484
  }
1485
1485
  )
1486
1486
  }
1487
1487
  ),
1488
- /* @__PURE__ */ n("div", { className: p(
1488
+ /* @__PURE__ */ n("div", { className: g(
1489
1489
  "absolute top-1/2 -translate-y-1/2 flex items-center gap-1 transition-all duration-200 z-10",
1490
1490
  o.language === "fa" ? "left-2" : "right-1.5"
1491
1491
  ), children: [
@@ -1510,7 +1510,7 @@ function Sa({ side: r = "left" }) {
1510
1510
  a.pinned ? /* @__PURE__ */ e(Ot, { className: "size-4" }) : /* @__PURE__ */ e(Te, { className: "size-4" }),
1511
1511
  /* @__PURE__ */ e("span", { children: a.pinned ? t("unpin_conversation") : t("pin_conversation") })
1512
1512
  ] }),
1513
- u?.showShare !== !1 && /* @__PURE__ */ n(de, { onSelect: () => G(a), className: "cursor-pointer flex items-center gap-2", children: [
1513
+ u?.showShare !== !1 && /* @__PURE__ */ n(de, { onSelect: () => V(a), className: "cursor-pointer flex items-center gap-2", children: [
1514
1514
  /* @__PURE__ */ e(jt, { className: "size-4" }),
1515
1515
  /* @__PURE__ */ e("span", { children: t("share_conversation") })
1516
1516
  ] }),
@@ -1536,7 +1536,7 @@ function Sa({ side: r = "left" }) {
1536
1536
  ] })
1537
1537
  ] }) }, k);
1538
1538
  }),
1539
- !g && l.length === 0 && !B && /* @__PURE__ */ e("div", { className: "px-4 py-8 text-center text-sm opacity-40", children: t("no_conversations") })
1539
+ !p && l.length === 0 && !B && /* @__PURE__ */ e("div", { className: "px-4 py-8 text-center text-sm opacity-40", children: t("no_conversations") })
1540
1540
  ] }),
1541
1541
  /* @__PURE__ */ e("div", { ref: P, className: "h-4 w-full" }),
1542
1542
  m && /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-2 p-4 pt-0 opacity-60", children: [
@@ -1576,7 +1576,7 @@ function Sa({ side: r = "left" }) {
1576
1576
  ] }) });
1577
1577
  }
1578
1578
  function Ka({ sidebar: r, header: t, components: o, classNames: d, disclaimer: i, welcome: c }) {
1579
- const { config: m } = Re(), { history: g } = te(), u = m?.language === "fa" ? "right" : "left", w = g?.enabled ?? !0;
1579
+ const { config: m } = Re(), { history: p } = te(), u = m?.language === "fa" ? "right" : "left", w = p?.enabled ?? !0;
1580
1580
  return /* @__PURE__ */ n(fa, { defaultOpen: w, children: [
1581
1581
  r !== void 0 ? r : w ? /* @__PURE__ */ e(Sa, { side: u }) : null,
1582
1582
  /* @__PURE__ */ n("div", { className: "flex flex-col flex-1 h-dvh overflow-hidden relative", children: [
@@ -1584,7 +1584,7 @@ function Ka({ sidebar: r, header: t, components: o, classNames: d, disclaimer: i
1584
1584
  /* @__PURE__ */ e(
1585
1585
  "div",
1586
1586
  {
1587
- className: p(
1587
+ className: g(
1588
1588
  "flex flex-col relative w-full flex-1 min-h-0 overflow-hidden",
1589
1589
  "has-[.stick-to-bottom:empty]:overflow-visible has-[.stick-to-bottom:empty]:flex-initial transition-[flex] duration-200"
1590
1590
  ),
@@ -1606,11 +1606,11 @@ function Ha({ children: r }) {
1606
1606
  const [t, o] = C(null), d = Ke(), i = ke(), c = pe();
1607
1607
  return $(() => {
1608
1608
  (async () => {
1609
- const g = new URLSearchParams(d.search), u = g.get("token");
1609
+ const p = new URLSearchParams(d.search), u = p.get("token");
1610
1610
  if (u)
1611
1611
  try {
1612
- T.setToken(u), await T.getBalance(), g.delete("token");
1613
- const b = g.toString(), v = d.pathname + (b ? `?${b}` : "");
1612
+ T.setToken(u), await T.getBalance(), p.delete("token");
1613
+ const b = p.toString(), v = d.pathname + (b ? `?${b}` : "");
1614
1614
  i(v, { replace: !0 }), o(!0);
1615
1615
  return;
1616
1616
  } catch (b) {
@@ -1630,7 +1630,7 @@ function Ha({ children: r }) {
1630
1630
  }, [d.search, i, d.pathname, c]), t === null ? /* @__PURE__ */ e("div", { className: "flex h-screen w-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "size-8 rounded-full border-4 border-primary border-t-transparent animate-spin" }) }) : t ? /* @__PURE__ */ e(Ne, { children: r }) : /* @__PURE__ */ e(Gt, { to: "/login", replace: !0 });
1631
1631
  }
1632
1632
  function Qa() {
1633
- const { t: r, i18n: t } = le(["login", "translation"]), { app: o } = te(), d = t.dir() === "rtl", i = d ? "text-right" : "text-left", c = ke(), m = pe(), [g, u] = C("login"), [w, b] = C(""), [v, l] = C(""), [S, _] = C(""), [q, O] = C(""), [P, y] = C(""), [h, E] = C(""), z = j(() => o?.userMetadataFields?.filter((s) => s.showInSignup) || [], [o?.userMetadataFields]), [I, H] = C(() => {
1633
+ const { t: r, i18n: t } = le(["login", "translation"]), { app: o } = te(), d = t.dir() === "rtl", i = d ? "text-right" : "text-left", c = ke(), m = pe(), [p, u] = C("login"), [w, b] = C(""), [v, l] = C(""), [S, _] = C(""), [q, O] = C(""), [P, y] = C(""), [h, E] = C(""), z = j(() => o?.userMetadataFields?.filter((s) => s.showInSignup) || [], [o?.userMetadataFields]), [I, H] = C(() => {
1634
1634
  const s = {};
1635
1635
  return z.forEach((x) => {
1636
1636
  x.defaultValue !== void 0 && (s[x.key] = x.defaultValue);
@@ -1672,7 +1672,7 @@ function Qa() {
1672
1672
  onClick: () => {
1673
1673
  u("login"), F("");
1674
1674
  },
1675
- className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${g === "login" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1675
+ className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${p === "login" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1676
1676
  children: r("login_tab", "Login")
1677
1677
  }
1678
1678
  ),
@@ -1683,16 +1683,16 @@ function Qa() {
1683
1683
  onClick: () => {
1684
1684
  u("register"), F("");
1685
1685
  },
1686
- className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${g === "register" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1686
+ className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${p === "register" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
1687
1687
  children: r("signup_tab", "Sign Up")
1688
1688
  }
1689
1689
  )
1690
1690
  ] }),
1691
- g === "login" && /* @__PURE__ */ n("form", { onSubmit: K, className: "space-y-4", children: [
1691
+ p === "login" && /* @__PURE__ */ n("form", { onSubmit: K, className: "space-y-4", children: [
1692
1692
  /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1693
1693
  /* @__PURE__ */ e(Q, { htmlFor: "login-phone", children: r("phone", "Phone") }),
1694
1694
  /* @__PURE__ */ e(
1695
- V,
1695
+ G,
1696
1696
  {
1697
1697
  id: "login-phone",
1698
1698
  type: "tel",
@@ -1708,7 +1708,7 @@ function Qa() {
1708
1708
  /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1709
1709
  /* @__PURE__ */ e(Q, { htmlFor: "login-pass", children: r("password", "Password") }),
1710
1710
  /* @__PURE__ */ e(
1711
- V,
1711
+ G,
1712
1712
  {
1713
1713
  id: "login-pass",
1714
1714
  type: "password",
@@ -1732,11 +1732,11 @@ function Qa() {
1732
1732
  }
1733
1733
  )
1734
1734
  ] }),
1735
- g === "register" && /* @__PURE__ */ n("form", { onSubmit: f, className: "space-y-4", children: [
1735
+ p === "register" && /* @__PURE__ */ n("form", { onSubmit: f, className: "space-y-4", children: [
1736
1736
  /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1737
1737
  /* @__PURE__ */ e(Q, { htmlFor: "reg-phone", children: r("phone", "Phone") }),
1738
1738
  /* @__PURE__ */ e(
1739
- V,
1739
+ G,
1740
1740
  {
1741
1741
  id: "reg-phone",
1742
1742
  type: "tel",
@@ -1752,7 +1752,7 @@ function Qa() {
1752
1752
  /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1753
1753
  /* @__PURE__ */ e(Q, { htmlFor: "reg-pass", children: r("password", "Password") }),
1754
1754
  /* @__PURE__ */ e(
1755
- V,
1755
+ G,
1756
1756
  {
1757
1757
  id: "reg-pass",
1758
1758
  type: "password",
@@ -1769,7 +1769,7 @@ function Qa() {
1769
1769
  /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1770
1770
  /* @__PURE__ */ e(Q, { htmlFor: "reg-name", children: r("name", "Name") }),
1771
1771
  /* @__PURE__ */ e(
1772
- V,
1772
+ G,
1773
1773
  {
1774
1774
  id: "reg-name",
1775
1775
  type: "text",
@@ -1784,7 +1784,7 @@ function Qa() {
1784
1784
  /* @__PURE__ */ n("div", { className: "space-y-3", children: [
1785
1785
  /* @__PURE__ */ e(Q, { htmlFor: "reg-surname", children: r("surname", "Surname") }),
1786
1786
  /* @__PURE__ */ e(
1787
- V,
1787
+ G,
1788
1788
  {
1789
1789
  id: "reg-surname",
1790
1790
  type: "text",
@@ -1807,7 +1807,7 @@ function Qa() {
1807
1807
  required: s.required,
1808
1808
  dir: d ? "rtl" : "ltr",
1809
1809
  children: [
1810
- /* @__PURE__ */ e(ve, { className: p("bg-background", i), children: /* @__PURE__ */ e(xe, { placeholder: r(s.placeholder || "select_placeholder") }) }),
1810
+ /* @__PURE__ */ e(ve, { className: g("bg-background", i), children: /* @__PURE__ */ e(xe, { placeholder: r(s.placeholder || "select_placeholder") }) }),
1811
1811
  /* @__PURE__ */ e(ye, { className: "rounded-xl", children: s.options?.map((x) => /* @__PURE__ */ e(me, { value: String(x.value), children: r(x.label) }, String(x.value))) })
1812
1812
  ]
1813
1813
  }
@@ -1823,7 +1823,7 @@ function Qa() {
1823
1823
  ),
1824
1824
  /* @__PURE__ */ e("label", { htmlFor: `signup-${s.key}`, className: "text-sm text-muted-foreground cursor-pointer select-none", children: r(s.placeholder || s.label) })
1825
1825
  ] }) : /* @__PURE__ */ e(
1826
- V,
1826
+ G,
1827
1827
  {
1828
1828
  id: `signup-${s.key}`,
1829
1829
  type: s.type,
@@ -1849,7 +1849,7 @@ function Qa() {
1849
1849
  ] }) });
1850
1850
  }
1851
1851
  function Pa() {
1852
- const { shareId: r } = Vt(), [t, o] = C(null), [d, i] = C(!0), [c, m] = C(null), { MessageList: g } = te(), u = ee(/* @__PURE__ */ new Set());
1852
+ const { shareId: r } = Vt(), [t, o] = C(null), [d, i] = C(!0), [c, m] = C(null), { MessageList: p } = te(), u = ee(/* @__PURE__ */ new Set());
1853
1853
  return $(() => () => {
1854
1854
  u.current.forEach((w) => URL.revokeObjectURL(w)), u.current.clear();
1855
1855
  }, []), $(() => {
@@ -1888,7 +1888,7 @@ function Pa() {
1888
1888
  ] }) : /* @__PURE__ */ n("div", { className: "relative flex flex-col h-dvh overflow-hidden bg-background", children: [
1889
1889
  /* @__PURE__ */ e(Qe, { hideActions: !0 }),
1890
1890
  /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 overflow-hidden relative flex flex-col", children: /* @__PURE__ */ e(
1891
- g,
1891
+ p,
1892
1892
  {
1893
1893
  messages: t.items || [],
1894
1894
  status: "ready",