gentiq 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- import { jsx as e, jsxs as r, Fragment as rt } from "react/jsx-runtime";
2
- import { useState as y, useEffect as H, useMemo as ge, useRef as at } from "react";
3
- import ut from "i18next";
4
- import { useTranslation as F, initReactI18next as mt, I18nextProvider as ht } from "react-i18next";
5
- import { G as Ke, u as xe, p as Je, z as nt, S as X, t as Y, v as ee, w as te, x as E, aa as pt, R as Ge, i as Ce, q as Ze, P as ke, D as Se, s as qe, K as je, M as Te, N as Ae, L as U, I as se, ab as De, ac as Le, B as ne, O as Ue, ad as ze, r as gt, m as Oe, n as Ee, o as Fe, E as ft, F as bt, H as xt, J as vt, ae as yt, d as _t, T as Nt } from "./checkbox-DIJkKoC9.js";
6
- import { useNavigate as wt, useLocation as kt, Routes as Ct, Route as me, Navigate as Xe } from "react-router-dom";
7
- import { Share2 as St, Info as Lt, ArrowUpDown as qt, ArrowUp as jt, ArrowDown as Tt, UsersRound as At, Globe as Pe, RefreshCcw as st, Palette as Dt, Keyboard as It, Wrench as Rt, Play as Be, History as Mt, Terminal as $t, ChevronDown as ot, Loader2 as Ve, AlertTriangle as Ot, Ban as Et, Plus as Ft, Hash as Pt, Wallet as Jt, Languages as Ut, ShieldAlert as zt, Monitor as Ye, Moon as Bt, Sun as Vt, LogOut as Ht } from "lucide-react";
8
- import { toast as be } from "sonner";
9
- import { useQuery as oe, useQueryClient as Ne, useMutation as ae, keepPreviousData as Wt } from "@tanstack/react-query";
10
- import * as et from "@radix-ui/react-switch";
11
- const tt = "/api";
12
- class Qt {
1
+ import { jsx as e, jsxs as r, Fragment as et } from "react/jsx-runtime";
2
+ import { useState as y, useEffect as H, useMemo as he, useRef as tt } from "react";
3
+ import ct from "i18next";
4
+ import { useTranslation as F, initReactI18next as ut, I18nextProvider as mt } from "react-i18next";
5
+ import { G as Ke, u as be, p as Pe, z as rt, S as X, t as Y, v as ee, w as te, x as E, i as ke, q as Qe, P as we, D as Ce, s as Le, K as qe, M as je, N as Te, L as U, I as se, aa as Ae, ab as Se, B as ne, O as Je, ac as Ue, r as ht, m as $e, n as Oe, o as Ee, E as pt, F as gt, H as ft, J as bt, ad as xt, d as vt, T as yt } from "./checkbox-Bk6TjhJn.js";
6
+ import { useNavigate as _t, useLocation as Nt, Routes as wt, Route as ue, Navigate as Ge } from "react-router-dom";
7
+ import { Share2 as kt, Info as Ct, ArrowUpDown as St, ArrowUp as Lt, ArrowDown as qt, UsersRound as jt, Globe as Fe, RefreshCcw as at, Palette as Tt, Keyboard as At, Wrench as Dt, Play as ze, History as It, Terminal as Rt, ChevronDown as nt, Loader2 as Be, AlertTriangle as Mt, Ban as $t, Plus as Ot, Hash as Et, Wallet as Ft, Languages as Pt, ShieldAlert as Jt, Monitor as Ze, Moon as Ut, Sun as zt, LogOut as Bt } from "lucide-react";
8
+ import { toast as fe } from "sonner";
9
+ import { useQuery as oe, useQueryClient as _e, useMutation as ae, keepPreviousData as Vt } from "@tanstack/react-query";
10
+ import * as Xe from "@radix-ui/react-switch";
11
+ const Ye = "/api";
12
+ class Ht {
13
13
  token = null;
14
14
  constructor() {
15
15
  this.token = localStorage.getItem("admin_token");
@@ -26,7 +26,7 @@ class Qt {
26
26
  async request(a, s = {}) {
27
27
  const d = new Headers(s.headers);
28
28
  d.has("Content-Type") || d.set("Content-Type", "application/json"), this.token && d.set("Authorization", `Bearer ${this.token}`);
29
- const o = await fetch(`${tt}${a}`, {
29
+ const o = await fetch(`${Ye}${a}`, {
30
30
  ...s,
31
31
  headers: d
32
32
  });
@@ -230,7 +230,7 @@ class Qt {
230
230
  async getAttachmentBlob(a) {
231
231
  const s = {};
232
232
  this.token && (s.Authorization = `Bearer ${this.token}`);
233
- const d = await fetch(`${tt}/admin/chat-history/attachments/${a}`, {
233
+ const d = await fetch(`${Ye}/admin/chat-history/attachments/${a}`, {
234
234
  method: "GET",
235
235
  headers: s
236
236
  });
@@ -241,9 +241,9 @@ class Qt {
241
241
  return d.blob();
242
242
  }
243
243
  }
244
- const T = new Qt();
245
- function Kt({ onLoginSuccess: t }) {
246
- const { t: a, i18n: s } = F(["admin", "translation"]), { app: d } = xe(), { theme: o } = Je(), [n, l] = y(""), [g, _] = y(""), [S, w] = y(""), [x, i] = y(""), [b, h] = y(!1), [N, D] = y(null), [p, R] = y("light");
244
+ const T = new Ht();
245
+ function Wt({ onLoginSuccess: t }) {
246
+ const { t: a, i18n: s } = F(["admin", "translation"]), { app: d } = be(), { theme: o } = Pe(), [n, l] = y(""), [g, _] = y(""), [S, w] = y(""), [x, i] = y(""), [b, h] = y(!1), [N, D] = y(null), [p, R] = y("light");
247
247
  H(() => {
248
248
  if (o === "system") {
249
249
  const v = window.matchMedia("(prefers-color-scheme: dark)").matches;
@@ -251,7 +251,7 @@ function Kt({ onLoginSuccess: t }) {
251
251
  } else
252
252
  R(o);
253
253
  }, [o]);
254
- const u = ge(() => d?.logo ? typeof d.logo == "string" ? d.logo : p === "dark" ? d.logo.dark : d.logo.light : nt, [d?.logo, p]), f = d?.adminTitle || d?.name, C = s.language === "fa";
254
+ const c = he(() => d?.logo ? typeof d.logo == "string" ? d.logo : p === "dark" ? d.logo.dark : d.logo.light : rt, [d?.logo, p]), f = d?.adminTitle || d?.name, C = s.language === "fa";
255
255
  H(() => {
256
256
  T.checkSetupStatus().then((v) => D(v.needs_setup)).catch(() => D(!1));
257
257
  }, []);
@@ -299,7 +299,7 @@ function Kt({ onLoginSuccess: t }) {
299
299
  /* @__PURE__ */ r("div", { className: "glass rounded-3xl p-10 shadow-2xl", children: [
300
300
  /* @__PURE__ */ r("div", { className: "text-center mb-10", children: [
301
301
  /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-4 mb-6", children: [
302
- /* @__PURE__ */ e("img", { src: u, alt: f, className: "size-16 object-contain" }),
302
+ /* @__PURE__ */ e("img", { src: c, alt: f, className: "size-16 object-contain" }),
303
303
  /* @__PURE__ */ e("h1", { className: "text-3xl font-black bg-gradient-to-l from-primary to-primary/60 bg-clip-text text-transparent", children: N ? a("login.setup_title") : f })
304
304
  ] }),
305
305
  N && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mt-3", children: a("login.setup_description") })
@@ -451,18 +451,18 @@ function Kt({ onLoginSuccess: t }) {
451
451
  );
452
452
  }
453
453
  const re = "gentiq_admin";
454
- function Gt(t = 0, a = 100, s = "", d = "name", o = "asc", n = "human") {
454
+ function Kt(t = 0, a = 100, s = "", d = "name", o = "asc", n = "human") {
455
455
  return oe({
456
456
  queryKey: [re, "users", t, a, s, d, o, n],
457
457
  queryFn: () => T.listUsers(t, a, s, d, o, n),
458
458
  // Infinite scroll grows `limit`, which changes the query key. Keep the previous
459
459
  // (smaller) page mounted while the larger one loads so the list never collapses to
460
460
  // empty — otherwise the scroll container resets to the top on every "load more".
461
- placeholderData: Wt
461
+ placeholderData: Vt
462
462
  });
463
463
  }
464
- function Zt() {
465
- const t = Ne(), a = () => {
464
+ function Qt() {
465
+ const t = _e(), a = () => {
466
466
  t.invalidateQueries({ queryKey: [re, "users"] });
467
467
  }, s = ae({
468
468
  mutationFn: (g) => T.createUser(
@@ -499,20 +499,20 @@ function Zt() {
499
499
  });
500
500
  return { createUser: s, updateUser: d, deleteUser: o, updateBalance: n, refreshToken: l };
501
501
  }
502
- function Xt(t = 30, a = "human") {
502
+ function Gt(t = 30, a = "human") {
503
503
  return oe({
504
504
  queryKey: [re, "analytics", t, a],
505
505
  queryFn: () => T.getAnalytics(t, a)
506
506
  });
507
507
  }
508
- function Yt() {
508
+ function Zt() {
509
509
  return oe({
510
510
  queryKey: [re, "admins"],
511
511
  queryFn: () => T.listAdmins()
512
512
  });
513
513
  }
514
- function er() {
515
- const t = Ne(), a = () => {
514
+ function Xt() {
515
+ const t = _e(), a = () => {
516
516
  t.invalidateQueries({ queryKey: [re, "admins"] });
517
517
  }, s = ae({
518
518
  mutationFn: (n) => T.register(n.username, n.password, n.name, n.permissions),
@@ -529,20 +529,20 @@ function er() {
529
529
  });
530
530
  return { createAdmin: s, updateAdmin: d, deleteAdmin: o };
531
531
  }
532
- function tr(t = 0, a = 50, s, d, o = "human") {
532
+ function Yt(t = 0, a = 50, s, d, o = "human") {
533
533
  return oe({
534
534
  queryKey: [re, "threads", t, a, s, d, o],
535
535
  queryFn: () => T.listThreads(t, a, s, d, o)
536
536
  });
537
537
  }
538
- function rr(t) {
538
+ function er(t) {
539
539
  return oe({
540
540
  queryKey: [re, "threadItems", t],
541
541
  queryFn: () => T.getThreadItems(t),
542
542
  enabled: !!t
543
543
  });
544
544
  }
545
- function Ur(t = 20, a) {
545
+ function Pr(t = 20, a) {
546
546
  return oe({
547
547
  queryKey: [re, "jobs", t, a],
548
548
  queryFn: () => T.listJobs(t, a),
@@ -550,8 +550,8 @@ function Ur(t = 20, a) {
550
550
  // Auto-refresh jobs every 5 seconds
551
551
  });
552
552
  }
553
- function zr() {
554
- const t = Ne();
553
+ function Jr() {
554
+ const t = _e();
555
555
  return { cancelJob: ae({
556
556
  mutationFn: (d) => T.cancelJob(d),
557
557
  onSuccess: () => {
@@ -559,14 +559,14 @@ function zr() {
559
559
  }
560
560
  }) };
561
561
  }
562
- function ar(t = !0) {
562
+ function tr(t = !0) {
563
563
  return oe({
564
564
  queryKey: [re, "registeredJobs"],
565
565
  queryFn: () => T.listRegisteredJobs(),
566
566
  enabled: t
567
567
  });
568
568
  }
569
- function nr(t = {}, a = !0) {
569
+ function rr(t = {}, a = !0) {
570
570
  return oe({
571
571
  queryKey: [re, "jobRuns", t],
572
572
  queryFn: () => T.listJobRuns(t),
@@ -575,7 +575,7 @@ function nr(t = {}, a = !0) {
575
575
  enabled: a
576
576
  });
577
577
  }
578
- function sr(t, a = !1) {
578
+ function ar(t, a = !1) {
579
579
  return oe({
580
580
  queryKey: [re, "jobRun", t],
581
581
  queryFn: () => T.getJobRun(t),
@@ -583,8 +583,8 @@ function sr(t, a = !1) {
583
583
  refetchInterval: a ? 2e3 : !1
584
584
  });
585
585
  }
586
- function He() {
587
- const t = Ne(), a = () => t.invalidateQueries({ queryKey: [re, "jobRuns"] }), s = ae({
586
+ function Ve() {
587
+ const t = _e(), a = () => t.invalidateQueries({ queryKey: [re, "jobRuns"] }), s = ae({
588
588
  mutationFn: (n) => T.runRegisteredJob(n.jobId, {
589
589
  params: n.params,
590
590
  dry_run: n.dry_run,
@@ -600,7 +600,7 @@ function He() {
600
600
  });
601
601
  return { runRegisteredJob: s, runRawJob: d, cancelJobRun: o };
602
602
  }
603
- function Br() {
603
+ function Ur() {
604
604
  return {
605
605
  login: async (t, a) => T.login(t, a),
606
606
  logout: () => T.clearToken(),
@@ -608,7 +608,7 @@ function Br() {
608
608
  isAuthenticated: !!T.getToken()
609
609
  };
610
610
  }
611
- function it(t, a, s) {
611
+ function st(t, a, s) {
612
612
  const d = (t || 0) / 1e6;
613
613
  try {
614
614
  return new Intl.NumberFormat(s, {
@@ -621,7 +621,7 @@ function it(t, a, s) {
621
621
  return `${a} ${d.toLocaleString(s, { maximumFractionDigits: 6 })}`;
622
622
  }
623
623
  }
624
- function pe(t, a, s) {
624
+ function me(t, a, s) {
625
625
  const d = (t || 0) / 1e6;
626
626
  try {
627
627
  return new Intl.NumberFormat(s, {
@@ -637,58 +637,58 @@ function pe(t, a, s) {
637
637
  })}`;
638
638
  }
639
639
  }
640
- function or() {
641
- const { t, i18n: a } = F(["admin", "translation"]), { app: s } = xe(), d = s?.userMetadataFields || [], [o, n] = y(null), [l, g] = y(""), [_, S] = y(""), [w, x] = y(""), [i, b] = y("human"), [h, N] = y(0), [D, p] = y([]), [R, u] = y(!0), [f, C] = y(""), L = a.language === "fa", $ = L ? "fa-IR" : "en-US";
640
+ function nr() {
641
+ const { t, i18n: a } = F(["admin", "translation"]), { app: s } = be(), d = s?.userMetadataFields || [], [o, n] = y(null), [l, g] = y(""), [_, S] = y(""), [w, x] = y(""), [i, b] = y("human"), [h, N] = y(0), [D, p] = y([]), [R, c] = y(!0), [f, C] = y(""), L = a.language === "fa", $ = L ? "fa-IR" : "en-US";
642
642
  H(() => {
643
- const c = setTimeout(() => S(l), 500);
644
- return () => clearTimeout(c);
643
+ const u = setTimeout(() => S(l), 500);
644
+ return () => clearTimeout(u);
645
645
  }, [l]);
646
- const v = tr(
646
+ const v = Yt(
647
647
  h,
648
648
  50,
649
649
  _ || void 0,
650
650
  w || void 0,
651
651
  i
652
- ), O = rr(o?.id ?? "");
652
+ ), O = er(o?.id ?? "");
653
653
  H(() => {
654
- N(0), p([]), u(!0);
654
+ N(0), p([]), c(!0);
655
655
  }, [_, w, i]), H(() => {
656
- const c = v.data?.threads;
657
- c && (p((q) => h === 0 ? c : [...q, ...c]), u(c.length === 50));
656
+ const u = v.data?.threads;
657
+ u && (p((j) => h === 0 ? u : [...j, ...u]), c(u.length === 50));
658
658
  }, [v.data, h]);
659
- const P = O.data?.items ?? [], Z = v.isLoading, k = v.isFetching && h > 0, m = O.isLoading, j = f || (v.error instanceof Error ? v.error.message : "") || (O.error instanceof Error ? O.error.message : "") || (v.error || O.error ? t("error_loading") : ""), A = (c) => {
660
- n(c);
661
- }, Q = () => {
662
- N((c) => c + 50);
663
- }, M = async (c, q) => {
664
- c.stopPropagation();
659
+ const P = O.data?.items ?? [], Z = v.isLoading, k = v.isFetching && h > 0, m = O.isLoading, q = f || (v.error instanceof Error ? v.error.message : "") || (O.error instanceof Error ? O.error.message : "") || (v.error || O.error ? t("error_loading") : ""), A = (u) => {
660
+ n(u);
661
+ }, K = () => {
662
+ N((u) => u + 50);
663
+ }, M = async (u, j) => {
664
+ u.stopPropagation();
665
665
  try {
666
- const I = await T.shareThread(q.id), B = `${window.location.origin}${I.url}`;
667
- navigator.clipboard.writeText(B), be.success(t("sidebar:share_success"), {
666
+ const I = await T.shareThread(j.id), V = `${window.location.origin}${I.url}`;
667
+ navigator.clipboard.writeText(V), fe.success(t("sidebar:share_success"), {
668
668
  description: t("sidebar:share_description")
669
669
  });
670
670
  } catch {
671
- be.error(t("sidebar:share_failed"));
671
+ fe.error(t("sidebar:share_failed"));
672
672
  }
673
- }, z = (c) => {
674
- const q = new Date(c);
673
+ }, z = (u) => {
674
+ const j = new Date(u);
675
675
  return new Intl.DateTimeFormat(L ? "fa-IR" : "en-US", {
676
676
  year: "numeric",
677
677
  month: "long",
678
678
  day: "numeric",
679
679
  hour: "2-digit",
680
680
  minute: "2-digit"
681
- }).format(q);
682
- }, K = (c) => {
683
- if (typeof c == "string")
681
+ }).format(j);
682
+ }, Q = (u) => {
683
+ if (typeof u == "string")
684
684
  try {
685
- return JSON.stringify(JSON.parse(c), null, 2);
685
+ return JSON.stringify(JSON.parse(u), null, 2);
686
686
  } catch {
687
- return c;
687
+ return u;
688
688
  }
689
- return JSON.stringify(c, null, 2);
690
- }, W = ({ part: c, idx: q }) => {
691
- const [I, B] = y(!1), G = c.tool_name || (c.type && c.type.startsWith("tool-") ? c.type.slice(5) : "tool");
689
+ return JSON.stringify(u, null, 2);
690
+ }, W = ({ part: u, idx: j }) => {
691
+ const [I, V] = y(!1), G = u.tool_name || (u.type && u.type.startsWith("tool-") ? u.type.slice(5) : "tool");
692
692
  return /* @__PURE__ */ r(
693
693
  "div",
694
694
  {
@@ -698,7 +698,7 @@ function or() {
698
698
  /* @__PURE__ */ r(
699
699
  "div",
700
700
  {
701
- onClick: () => B(!I),
701
+ onClick: () => V(!I),
702
702
  className: "px-2.5 py-1.5 bg-muted/50 border-b border-border/50 flex items-center justify-between cursor-pointer hover:bg-accent transition-colors",
703
703
  children: [
704
704
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
@@ -726,8 +726,8 @@ function or() {
726
726
  /* @__PURE__ */ e(
727
727
  "span",
728
728
  {
729
- className: `text-[10px] px-2 py-0.5 rounded-full ${c.state === "output-available" ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"}`,
730
- children: c.state === "output-available" ? t("chat_history.output_available") : t("chat_history.running")
729
+ className: `text-[10px] px-2 py-0.5 rounded-full ${u.state === "output-available" ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"}`,
730
+ children: u.state === "output-available" ? t("chat_history.output_available") : t("chat_history.running")
731
731
  }
732
732
  )
733
733
  ]
@@ -736,52 +736,35 @@ function or() {
736
736
  I && /* @__PURE__ */ r("div", { className: "p-2.5 space-y-2.5 animate-in fade-in slide-in-from-top-1 duration-200", children: [
737
737
  /* @__PURE__ */ r("div", { children: [
738
738
  /* @__PURE__ */ e("div", { className: "text-[10px] uppercase font-bold text-muted-foreground mb-1", children: "Input" }),
739
- /* @__PURE__ */ e("pre", { className: "text-xs bg-black/5 dark:bg-black/20 p-2 rounded-lg overflow-x-auto", children: K(c.input) })
739
+ /* @__PURE__ */ e("pre", { className: "text-xs bg-black/5 dark:bg-black/20 p-2 rounded-lg overflow-x-auto", children: Q(u.input) })
740
740
  ] }),
741
- (c.output || c.error_text || c.errorText) && /* @__PURE__ */ r("div", { children: [
742
- /* @__PURE__ */ e("div", { className: "text-[10px] uppercase font-bold text-muted-foreground mb-1", children: c.error_text || c.errorText ? "Error" : "Output" }),
741
+ (u.output || u.error_text || u.errorText) && /* @__PURE__ */ r("div", { children: [
742
+ /* @__PURE__ */ e("div", { className: "text-[10px] uppercase font-bold text-muted-foreground mb-1", children: u.error_text || u.errorText ? "Error" : "Output" }),
743
743
  /* @__PURE__ */ e(
744
744
  "pre",
745
745
  {
746
- className: `text-xs p-2 rounded-lg overflow-x-auto ${c.error_text || c.errorText ? "bg-destructive/10 text-destructive" : "bg-primary/5 text-foreground/80"}`,
747
- children: K(c.output || c.error_text || c.errorText)
746
+ className: `text-xs p-2 rounded-lg overflow-x-auto ${u.error_text || u.errorText ? "bg-destructive/10 text-destructive" : "bg-primary/5 text-foreground/80"}`,
747
+ children: Q(u.output || u.error_text || u.errorText)
748
748
  }
749
749
  )
750
750
  ] })
751
751
  ] })
752
752
  ]
753
753
  },
754
- q
754
+ j
755
755
  );
756
- }, V = async (c, q) => {
756
+ }, B = async (u, j) => {
757
757
  try {
758
- const I = await T.getAttachmentBlob(c), B = window.URL.createObjectURL(I), G = document.createElement("a");
759
- G.href = B, G.download = q || c.split("/").pop() || "download", document.body.appendChild(G), G.click(), window.URL.revokeObjectURL(B), document.body.removeChild(G);
758
+ const I = await T.getAttachmentBlob(u), V = window.URL.createObjectURL(I), G = document.createElement("a");
759
+ G.href = V, G.download = j || u.split("/").pop() || "download", document.body.appendChild(G), G.click(), window.URL.revokeObjectURL(V), document.body.removeChild(G);
760
760
  } catch (I) {
761
761
  console.error("Download failed:", I), C(I instanceof Error ? I.message : "Download failed");
762
762
  }
763
- }, ce = (c, q) => {
764
- if (typeof c == "string") return /* @__PURE__ */ e("div", { children: c }, q);
765
- if (c.type === "text") {
766
- const I = pt(c.text);
767
- return I ? /* @__PURE__ */ e(
768
- Ge,
769
- {
770
- part: {
771
- type: "data-choice-question",
772
- data: I
773
- },
774
- message: {
775
- id: `admin-choice-${q}`,
776
- role: "assistant",
777
- parts: [c]
778
- },
779
- disabled: !0
780
- },
781
- q
782
- ) : /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", dir: "auto", children: c.text }, q);
783
- }
784
- if (c.type === "reasoning")
763
+ }, de = (u, j) => {
764
+ if (typeof u == "string") return /* @__PURE__ */ e("div", { children: u }, j);
765
+ if (u.type === "text")
766
+ return /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", dir: "auto", children: u.text }, j);
767
+ if (u.type === "reasoning")
785
768
  return /* @__PURE__ */ r(
786
769
  "div",
787
770
  {
@@ -789,13 +772,13 @@ function or() {
789
772
  dir: "auto",
790
773
  children: [
791
774
  /* @__PURE__ */ e("div", { className: "font-bold mb-1 uppercase tracking-tighter opacity-70", children: "Reasoning" }),
792
- c.text
775
+ u.text
793
776
  ]
794
777
  },
795
- q
778
+ j
796
779
  );
797
- if (c.type === "data-reference") {
798
- const I = c.data || c.reference;
780
+ if (u.type === "data-reference") {
781
+ const I = u.data || u.reference;
799
782
  return /* @__PURE__ */ r(
800
783
  "div",
801
784
  {
@@ -806,18 +789,10 @@ function or() {
806
789
  /* @__PURE__ */ e("div", { className: "text-muted-foreground line-clamp-3", children: I?.excerpt || t("chat.source_unavailable", "Source unavailable") })
807
790
  ]
808
791
  },
809
- q
792
+ j
810
793
  );
811
794
  }
812
- return c.type === "data-choice-question" ? /* @__PURE__ */ e(
813
- Ge,
814
- {
815
- part: c,
816
- message: { id: `admin-choice-${q}`, role: "assistant", parts: [c] },
817
- disabled: !0
818
- },
819
- q
820
- ) : c.type === "dynamic-tool" || c.type && c.type.startsWith("tool-") || c.tool_call_id ? /* @__PURE__ */ e(W, { part: c, idx: q }, q) : c.type === "file" ? /* @__PURE__ */ r(
795
+ return u.type === "data-choice-question" ? /* @__PURE__ */ e("pre", { className: "text-xs font-mono bg-muted/40 p-2.5 rounded-xl", dir: "ltr", children: JSON.stringify(u.data ?? u, null, 2) }, j) : u.type === "dynamic-tool" || u.type && u.type.startsWith("tool-") || u.tool_call_id ? /* @__PURE__ */ e(W, { part: u, idx: j }, j) : u.type === "file" ? /* @__PURE__ */ r(
821
796
  "div",
822
797
  {
823
798
  className: "my-2 flex items-center justify-between p-2.5 bg-muted/40 rounded-xl border border-border group hover:border-primary/30 transition-all",
@@ -829,17 +804,17 @@ function or() {
829
804
  "span",
830
805
  {
831
806
  className: "text-sm text-foreground font-medium truncate",
832
- title: c.filename || "File",
833
- children: c.filename || t("chat_history.unnamed_file")
807
+ title: u.filename || "File",
808
+ children: u.filename || t("chat_history.unnamed_file")
834
809
  }
835
810
  ),
836
- /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground uppercase tracking-wider font-bold", children: c.media_type || c.mime_type || c.mediaType || "file" })
811
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground uppercase tracking-wider font-bold", children: u.media_type || u.mime_type || u.mediaType || "file" })
837
812
  ] })
838
813
  ] }),
839
- c.object_name && /* @__PURE__ */ e(
814
+ u.object_name && /* @__PURE__ */ e(
840
815
  "button",
841
816
  {
842
- onClick: () => V(c.object_name, c.filename),
817
+ onClick: () => B(u.object_name, u.filename),
843
818
  className: "flex-shrink-0 p-2 hover:bg-card rounded-lg border border-transparent hover:border-border transition-all text-muted-foreground hover:text-primary",
844
819
  title: t("chat_history.download_file", "Download File"),
845
820
  children: /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
@@ -855,18 +830,18 @@ function or() {
855
830
  )
856
831
  ]
857
832
  },
858
- q
833
+ j
859
834
  ) : /* @__PURE__ */ e(
860
835
  "div",
861
836
  {
862
837
  className: "my-2 p-2 bg-muted/40 rounded-lg border border-border text-xs font-mono opacity-60",
863
- children: JSON.stringify(c)
838
+ children: JSON.stringify(u)
864
839
  },
865
- q
840
+ j
866
841
  );
867
- }, ve = (c) => {
868
- const { scrollTop: q, scrollHeight: I, clientHeight: B } = c.currentTarget;
869
- I - q <= B + 50 && !k && R && Q();
842
+ }, xe = (u) => {
843
+ const { scrollTop: j, scrollHeight: I, clientHeight: V } = u.currentTarget;
844
+ I - j <= V + 50 && !k && R && K();
870
845
  };
871
846
  return /* @__PURE__ */ r("div", { className: "p-5 h-full flex flex-col gap-4 overflow-hidden", dir: L ? "rtl" : "ltr", children: [
872
847
  /* @__PURE__ */ r("div", { className: "flex flex-col gap-3", children: [
@@ -876,8 +851,8 @@ function or() {
876
851
  /* @__PURE__ */ r(
877
852
  "form",
878
853
  {
879
- onSubmit: (c) => {
880
- c.preventDefault(), S(l);
854
+ onSubmit: (u) => {
855
+ u.preventDefault(), S(l);
881
856
  },
882
857
  className: "flex-1 min-w-[16rem] flex gap-2",
883
858
  children: [
@@ -886,7 +861,7 @@ function or() {
886
861
  {
887
862
  type: "text",
888
863
  value: l,
889
- onChange: (c) => g(c.target.value),
864
+ onChange: (u) => g(u.target.value),
890
865
  placeholder: t("chat_history.search_placeholder"),
891
866
  className: "flex-1 px-4 py-2.5 border-0 rounded-xl glass-surface text-foreground placeholder-muted-foreground focus:ring-2 focus:ring-primary/20 transition-all text-sm shadow-sm"
892
867
  }
@@ -906,7 +881,7 @@ function or() {
906
881
  X,
907
882
  {
908
883
  value: w || "all",
909
- onValueChange: (c) => x(c === "all" ? "" : c),
884
+ onValueChange: (u) => x(u === "all" ? "" : u),
910
885
  dir: L ? "rtl" : "ltr",
911
886
  children: [
912
887
  /* @__PURE__ */ e(Y, { className: "min-w-[160px] px-4 py-2 h-auto text-sm font-medium rounded-xl glass-surface border-0 text-foreground shadow-sm", children: /* @__PURE__ */ e(ee, {}) }),
@@ -923,17 +898,17 @@ function or() {
923
898
  X,
924
899
  {
925
900
  value: i,
926
- onValueChange: (c) => b(c),
901
+ onValueChange: (u) => b(u),
927
902
  dir: L ? "rtl" : "ltr",
928
903
  children: [
929
904
  /* @__PURE__ */ e(Y, { className: "min-w-[140px] px-4 py-2 h-auto text-sm font-medium rounded-xl glass-surface border-0 text-foreground shadow-sm", children: /* @__PURE__ */ e(ee, {}) }),
930
- /* @__PURE__ */ e(te, { className: "rounded-xl border-border bg-card", children: ["human", "service", "all"].map((c) => /* @__PURE__ */ e(E, { value: c, children: t(`chat_history.source_${c}`) }, c)) })
905
+ /* @__PURE__ */ e(te, { className: "rounded-xl border-border bg-card", children: ["human", "service", "all"].map((u) => /* @__PURE__ */ e(E, { value: u, children: t(`chat_history.source_${u}`) }, u)) })
931
906
  ]
932
907
  }
933
908
  )
934
909
  ] })
935
910
  ] }),
936
- j && /* @__PURE__ */ e("div", { className: "bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm backdrop-blur-sm", children: j })
911
+ q && /* @__PURE__ */ e("div", { className: "bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm backdrop-blur-sm", children: q })
937
912
  ] }),
938
913
  /* @__PURE__ */ r("div", { className: "grid grid-cols-1 lg:grid-cols-[380px_1fr] gap-4 flex-1 min-h-0", children: [
939
914
  /* @__PURE__ */ r("div", { className: "glass-surface rounded-2xl shadow-sm overflow-hidden flex flex-col min-w-0", children: [
@@ -943,97 +918,97 @@ function or() {
943
918
  (D.length || 0).toLocaleString($),
944
919
  ")"
945
920
  ] }) }),
946
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-2 custom-scrollbar", onScroll: ve, children: Z && D.length === 0 ? /* @__PURE__ */ e("div", { className: "p-8 text-center text-muted-foreground text-sm", children: t("chat_history.no_threads") }) : /* @__PURE__ */ r("div", { className: "space-y-1", children: [
947
- D.map((c) => /* @__PURE__ */ r(
921
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-2 custom-scrollbar", onScroll: xe, children: Z && D.length === 0 ? /* @__PURE__ */ e("div", { className: "p-8 text-center text-muted-foreground text-sm", children: t("chat_history.no_threads") }) : /* @__PURE__ */ r("div", { className: "space-y-1", children: [
922
+ D.map((u) => /* @__PURE__ */ r(
948
923
  "div",
949
924
  {
950
- onClick: () => A(c),
951
- className: `p-2.5 cursor-pointer transition-all rounded-xl border ${o?.id === c.id ? "bg-card border-border shadow-sm" : "border-transparent hover:bg-muted/50"}`,
925
+ onClick: () => A(u),
926
+ className: `p-2.5 cursor-pointer transition-all rounded-xl border ${o?.id === u.id ? "bg-card border-border shadow-sm" : "border-transparent hover:bg-muted/50"}`,
952
927
  children: [
953
928
  /* @__PURE__ */ r("div", { className: "flex justify-between items-start mb-1.5 gap-4", children: [
954
929
  /* @__PURE__ */ e(
955
930
  "h3",
956
931
  {
957
- className: `font-medium text-sm truncate flex-1 ${o?.id === c.id ? "text-primary" : "text-foreground"}`,
958
- title: c.title || t("chat_history.no_thread_title"),
959
- children: c.title || t("chat_history.no_thread_title")
932
+ className: `font-medium text-sm truncate flex-1 ${o?.id === u.id ? "text-primary" : "text-foreground"}`,
933
+ title: u.title || t("chat_history.no_thread_title"),
934
+ children: u.title || t("chat_history.no_thread_title")
960
935
  }
961
936
  ),
962
937
  /* @__PURE__ */ r("div", { className: "flex gap-1 items-center", children: [
963
- c.metadata?.external_user_id && /* @__PURE__ */ e(
938
+ u.metadata?.external_user_id && /* @__PURE__ */ e(
964
939
  "span",
965
940
  {
966
941
  className: "text-[10px] px-1.5 py-0.5 rounded-md bg-primary/10 text-primary font-medium truncate max-w-[120px]",
967
- title: `${t("chat_history.external_user_id")}: ${c.metadata.external_user_id}`,
968
- children: c.metadata.external_user_id
942
+ title: `${t("chat_history.external_user_id")}: ${u.metadata.external_user_id}`,
943
+ children: u.metadata.external_user_id
969
944
  }
970
945
  ),
971
- c.feedback_info && c.feedback_info.like > 0 && /* @__PURE__ */ e("span", { className: "text-xs", children: "👍" }),
972
- c.feedback_info && c.feedback_info.dislike > 0 && /* @__PURE__ */ e("span", { className: "text-xs", children: "👎" })
946
+ u.feedback_info && u.feedback_info.like > 0 && /* @__PURE__ */ e("span", { className: "text-xs", children: "👍" }),
947
+ u.feedback_info && u.feedback_info.dislike > 0 && /* @__PURE__ */ e("span", { className: "text-xs", children: "👎" })
973
948
  ] })
974
949
  ] }),
975
950
  /* @__PURE__ */ r("div", { className: "text-xs space-y-1.5 text-muted-foreground", children: [
976
- c.user_info && /* @__PURE__ */ r(
951
+ u.user_info && /* @__PURE__ */ r(
977
952
  "div",
978
953
  {
979
954
  className: "flex flex-col gap-0.5 min-w-0",
980
- title: `${[c.user_info.name, c.user_info.surname].filter(Boolean).join(" ")}${c.user_info.phone ? ` • ${c.user_info.phone}` : ""}${d.filter(
981
- (q) => c.user_info?.metadata?.[q.key] !== void 0 && c.user_info?.metadata?.[q.key] !== ""
982
- ).map((q) => {
983
- const I = c.user_info?.metadata?.[q.key];
984
- if (q.type === "select") {
985
- const B = q.options?.find(
955
+ title: `${[u.user_info.name, u.user_info.surname].filter(Boolean).join(" ")}${u.user_info.phone ? ` • ${u.user_info.phone}` : ""}${d.filter(
956
+ (j) => u.user_info?.metadata?.[j.key] !== void 0 && u.user_info?.metadata?.[j.key] !== ""
957
+ ).map((j) => {
958
+ const I = u.user_info?.metadata?.[j.key];
959
+ if (j.type === "select") {
960
+ const V = j.options?.find(
986
961
  (G) => String(G.value) === String(I)
987
962
  );
988
- return ` • ${B ? t(B.label) : I}`;
963
+ return ` • ${V ? t(V.label) : I}`;
989
964
  }
990
965
  return ` • ${I}`;
991
966
  }).join(
992
967
  ""
993
- )}${c.user_info.metadata?.values !== void 0 && !d.some((q) => q.key === "values") ? ` • ${c.user_info.metadata.values}` : ""}`,
968
+ )}${u.user_info.metadata?.values !== void 0 && !d.some((j) => j.key === "values") ? ` • ${u.user_info.metadata.values}` : ""}`,
994
969
  children: [
995
970
  /* @__PURE__ */ r("div", { className: "font-medium text-foreground truncate flex items-center gap-1.5", children: [
996
- /* @__PURE__ */ e("span", { children: [c.user_info.name, c.user_info.surname].filter(Boolean).join(" ") }),
997
- c.user_info.phone && /* @__PURE__ */ r("span", { className: "text-[11px] text-foreground/70 font-normal", children: [
971
+ /* @__PURE__ */ e("span", { children: [u.user_info.name, u.user_info.surname].filter(Boolean).join(" ") }),
972
+ u.user_info.phone && /* @__PURE__ */ r("span", { className: "text-[11px] text-foreground/70 font-normal", children: [
998
973
  "•",
999
974
  " ",
1000
- c.user_info.phone
975
+ u.user_info.phone
1001
976
  ] })
1002
977
  ] }),
1003
978
  /* @__PURE__ */ r("div", { className: "text-[10px] text-muted-foreground/70 truncate flex items-center gap-1", children: [
1004
- d.filter((q) => {
1005
- const I = c.user_info?.metadata?.[q.key];
979
+ d.filter((j) => {
980
+ const I = u.user_info?.metadata?.[j.key];
1006
981
  return I != null && I !== "";
1007
- }).map((q, I) => {
1008
- const B = c.user_info?.metadata?.[q.key];
1009
- let G = String(B);
1010
- if (q.type === "select") {
1011
- const he = q.options?.find(
1012
- (ie) => String(ie.value) === String(B)
982
+ }).map((j, I) => {
983
+ const V = u.user_info?.metadata?.[j.key];
984
+ let G = String(V);
985
+ if (j.type === "select") {
986
+ const pe = j.options?.find(
987
+ (De) => String(De.value) === String(V)
1013
988
  );
1014
- he && (G = t(he.label));
1015
- } else q.type === "checkbox" && (G = B ? "✓" : "✗");
989
+ pe && (G = t(pe.label));
990
+ } else j.type === "checkbox" && (G = V ? "✓" : "✗");
1016
991
  return /* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
1017
992
  I > 0 && /* @__PURE__ */ e("span", { className: "opacity-30", children: "|" }),
1018
993
  G
1019
- ] }, q.key);
994
+ ] }, j.key);
1020
995
  }),
1021
- c.user_info.metadata?.values !== void 0 && !d.some((q) => q.key === "values") && /* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
996
+ u.user_info.metadata?.values !== void 0 && !d.some((j) => j.key === "values") && /* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
1022
997
  d.some(
1023
- (q) => c.user_info?.metadata?.[q.key] !== void 0
998
+ (j) => u.user_info?.metadata?.[j.key] !== void 0
1024
999
  ) && /* @__PURE__ */ e("span", { className: "opacity-30", children: "|" }),
1025
- String(c.user_info.metadata.values)
1000
+ String(u.user_info.metadata.values)
1026
1001
  ] })
1027
1002
  ] })
1028
1003
  ]
1029
1004
  }
1030
1005
  ),
1031
- c.metadata?.usage && /* @__PURE__ */ r("div", { className: "flex gap-2 mt-2 pt-2 border-border/30", children: [
1006
+ u.metadata?.usage && /* @__PURE__ */ r("div", { className: "flex gap-2 mt-2 pt-2 border-border/30", children: [
1032
1007
  /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 bg-muted/30 px-2 py-0.5 rounded-md text-[9px] text-muted-foreground", children: t("chat_history.input_tokens", {
1033
- value: (c.metadata.usage.cumulative_input_tokens ?? c.metadata.usage.input_tokens ?? 0).toLocaleString($)
1008
+ value: (u.metadata.usage.cumulative_input_tokens ?? u.metadata.usage.input_tokens ?? 0).toLocaleString($)
1034
1009
  }) }),
1035
1010
  /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 bg-muted/30 px-2 py-0.5 rounded-md text-[9px] text-muted-foreground", children: t("chat_history.output_tokens", {
1036
- value: (c.metadata.usage.output_tokens || 0).toLocaleString(
1011
+ value: (u.metadata.usage.output_tokens || 0).toLocaleString(
1037
1012
  $
1038
1013
  )
1039
1014
  }) }),
@@ -1041,26 +1016,26 @@ function or() {
1041
1016
  "span",
1042
1017
  {
1043
1018
  className: "inline-flex items-center gap-1 bg-muted/30 px-2 py-0.5 rounded-md text-[9px] text-muted-foreground",
1044
- title: c.metadata.usage.cost_incomplete || c.metadata.usage.total_cost_microunits === void 0 ? void 0 : it(
1045
- c.metadata.usage.total_cost_microunits || 0,
1046
- c.metadata.usage.currency || "USD",
1019
+ title: u.metadata.usage.cost_incomplete || u.metadata.usage.total_cost_microunits === void 0 ? void 0 : st(
1020
+ u.metadata.usage.total_cost_microunits || 0,
1021
+ u.metadata.usage.currency || "USD",
1047
1022
  $
1048
1023
  ),
1049
- children: c.metadata.usage.cost_incomplete || c.metadata.usage.total_cost_microunits === void 0 ? t("chat_history.unpriced") : t("chat_history.cost", {
1050
- value: pe(
1051
- c.metadata.usage.total_cost_microunits || 0,
1052
- c.metadata.usage.currency || "USD",
1024
+ children: u.metadata.usage.cost_incomplete || u.metadata.usage.total_cost_microunits === void 0 ? t("chat_history.unpriced") : t("chat_history.cost", {
1025
+ value: me(
1026
+ u.metadata.usage.total_cost_microunits || 0,
1027
+ u.metadata.usage.currency || "USD",
1053
1028
  $
1054
1029
  )
1055
1030
  })
1056
1031
  }
1057
1032
  )
1058
1033
  ] }),
1059
- /* @__PURE__ */ e("div", { className: "text-[10px] text-muted-foreground mt-1", children: z(c.created_at) })
1034
+ /* @__PURE__ */ e("div", { className: "text-[10px] text-muted-foreground mt-1", children: z(u.created_at) })
1060
1035
  ] })
1061
1036
  ]
1062
1037
  },
1063
- c.id
1038
+ u.id
1064
1039
  )),
1065
1040
  k && /* @__PURE__ */ e("div", { className: "p-4 text-center text-muted-foreground text-xs", children: t("loading_more") })
1066
1041
  ] }) })
@@ -1073,37 +1048,35 @@ function or() {
1073
1048
  o && /* @__PURE__ */ e(
1074
1049
  "button",
1075
1050
  {
1076
- onClick: (c) => M(c, o),
1051
+ onClick: (u) => M(u, o),
1077
1052
  className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 text-primary flex items-center justify-center hover:bg-primary/20 transition-all shadow-sm",
1078
1053
  title: t("sidebar:share_conversation"),
1079
- children: /* @__PURE__ */ e(St, { className: "w-4 h-4" })
1054
+ children: /* @__PURE__ */ e(kt, { className: "w-4 h-4" })
1080
1055
  }
1081
1056
  )
1082
1057
  ] }),
1083
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4 custom-scrollbar", children: o ? m ? /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center text-muted-foreground text-sm", children: t("chat_history.loading_messages") }) : P.length === 0 ? /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center text-muted-foreground text-sm", children: t("chat_history.empty_thread") }) : /* @__PURE__ */ e("div", { className: "space-y-6", children: P.map((c) => {
1084
- const q = c.role === "user", I = c.role === "assistant", B = c.parts || [], he = B.some(
1085
- (ie) => ie?.type === "data-choice-question"
1086
- ) ? B.filter((ie) => ie?.type !== "text") : B;
1058
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4 custom-scrollbar", children: o ? m ? /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center text-muted-foreground text-sm", children: t("chat_history.loading_messages") }) : P.length === 0 ? /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center text-muted-foreground text-sm", children: t("chat_history.empty_thread") }) : /* @__PURE__ */ e("div", { className: "space-y-6", children: P.map((u) => {
1059
+ const j = u.role === "user", I = u.role === "assistant", V = u.parts || [];
1087
1060
  return /* @__PURE__ */ r(
1088
1061
  "div",
1089
1062
  {
1090
- className: `p-3.5 rounded-2xl transition-all relative ${q ? "bg-primary/10 ms-12 rounded-te-sm" : I ? "glass shadow-sm me-12 rounded-ts-sm" : "bg-muted/30 border border-border/50"}`,
1063
+ className: `p-3.5 rounded-2xl transition-all relative ${j ? "bg-primary/10 ms-12 rounded-te-sm" : I ? "glass shadow-sm me-12 rounded-ts-sm" : "bg-muted/30 border border-border/50"}`,
1091
1064
  children: [
1092
- c.feedback && /* @__PURE__ */ e("div", { className: "absolute -bottom-2 -left-2 flex items-center justify-center w-8 h-8 rounded-full shadow-md bg-card border border-border animate-in fade-in zoom-in duration-300 z-10", children: /* @__PURE__ */ e("span", { className: "text-base", children: c.feedback === "like" ? "👍" : "👎" }) }),
1065
+ u.feedback && /* @__PURE__ */ e("div", { className: "absolute -bottom-2 -left-2 flex items-center justify-center w-8 h-8 rounded-full shadow-md bg-card border border-border animate-in fade-in zoom-in duration-300 z-10", children: /* @__PURE__ */ e("span", { className: "text-base", children: u.feedback === "like" ? "👍" : "👎" }) }),
1093
1066
  /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-1.5", children: [
1094
1067
  /* @__PURE__ */ e(
1095
1068
  "span",
1096
1069
  {
1097
- className: `text-[10px] font-bold uppercase tracking-wider ${q || I ? "text-primary" : "text-muted-foreground"}`,
1098
- children: q ? o?.user_info?.name ? `${o.user_info.name} ${o.user_info.surname || ""}`.trim() : t("chat_history.user_label") : I ? t("chat_history.assistant_label") : `${c.role}`
1070
+ className: `text-[10px] font-bold uppercase tracking-wider ${j || I ? "text-primary" : "text-muted-foreground"}`,
1071
+ children: j ? o?.user_info?.name ? `${o.user_info.name} ${o.user_info.surname || ""}`.trim() : t("chat_history.user_label") : I ? t("chat_history.assistant_label") : `${u.role}`
1099
1072
  }
1100
1073
  ),
1101
- /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: z(c.created_at) })
1074
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: z(u.created_at) })
1102
1075
  ] }),
1103
- /* @__PURE__ */ e("div", { className: "text-sm text-foreground leading-relaxed", dir: "auto", children: he.length > 0 ? he.map((ie, Ie) => ce(ie, Ie)) : typeof c.content == "object" ? /* @__PURE__ */ e("pre", { className: "text-xs font-mono bg-muted/40 p-2.5 rounded-xl", dir: "ltr", children: JSON.stringify(c.content, null, 2) }) : c.content })
1076
+ /* @__PURE__ */ e("div", { className: "text-sm text-foreground leading-relaxed", dir: "auto", children: V.length > 0 ? V.map((G, pe) => de(G, pe)) : typeof u.content == "object" ? /* @__PURE__ */ e("pre", { className: "text-xs font-mono bg-muted/40 p-2.5 rounded-xl", dir: "ltr", children: JSON.stringify(u.content, null, 2) }) : u.content })
1104
1077
  ]
1105
1078
  },
1106
- c.id
1079
+ u.id
1107
1080
  );
1108
1081
  }) }) : /* @__PURE__ */ r("div", { className: "h-full flex flex-col items-center justify-center text-muted-foreground", children: [
1109
1082
  /* @__PURE__ */ e(
@@ -1130,11 +1103,11 @@ function or() {
1130
1103
  ] })
1131
1104
  ] });
1132
1105
  }
1133
- function ir() {
1134
- const { t, i18n: a } = F(["admin", "translation"]), [s, d] = y(""), [o, n] = y(!1), [l, g] = y(null), [_, S] = y(null), w = a.language === "fa", x = Yt(), i = x.data?.admins || [], b = x.isLoading, { createAdmin: h, updateAdmin: N, deleteAdmin: D } = er(), R = oe({
1106
+ function sr() {
1107
+ const { t, i18n: a } = F(["admin", "translation"]), [s, d] = y(""), [o, n] = y(!1), [l, g] = y(null), [_, S] = y(null), w = a.language === "fa", x = Zt(), i = x.data?.admins || [], b = x.isLoading, { createAdmin: h, updateAdmin: N, deleteAdmin: D } = Xt(), R = oe({
1135
1108
  queryKey: ["gentiq_admin", "permissions"],
1136
1109
  queryFn: () => T.listPermissions()
1137
- }).data?.permissions || [], u = s || (x.error ? x.error instanceof Error ? x.error.message : t("error_loading") : ""), [f, C] = y({
1110
+ }).data?.permissions || [], c = s || (x.error ? x.error instanceof Error ? x.error.message : t("error_loading") : ""), [f, C] = y({
1138
1111
  username: "",
1139
1112
  password: "",
1140
1113
  name: "",
@@ -1165,9 +1138,9 @@ function ir() {
1165
1138
  permissions: f.permissions
1166
1139
  };
1167
1140
  if (f.password && (m.password = f.password), await N.mutateAsync({ adminId: l.id, data: m }), l.id === _) {
1168
- const j = localStorage.getItem("admin_info");
1169
- if (j) {
1170
- const A = JSON.parse(j);
1141
+ const q = localStorage.getItem("admin_info");
1142
+ if (q) {
1143
+ const A = JSON.parse(q);
1171
1144
  A.name = f.name, A.permissions = f.permissions, localStorage.setItem("admin_info", JSON.stringify(A)), window.location.reload();
1172
1145
  return;
1173
1146
  }
@@ -1196,12 +1169,12 @@ function ir() {
1196
1169
  }, P = (k) => {
1197
1170
  C((m) => ({
1198
1171
  ...m,
1199
- permissions: m.permissions.includes(k) ? m.permissions.filter((j) => j !== k) : [...m.permissions, k]
1172
+ permissions: m.permissions.includes(k) ? m.permissions.filter((q) => q !== k) : [...m.permissions, k]
1200
1173
  }));
1201
1174
  }, Z = (k) => {
1202
- const m = `admins.perm_${k}`, j = t(m);
1203
- if (j !== m)
1204
- return j;
1175
+ const m = `admins.perm_${k}`, q = t(m);
1176
+ if (q !== m)
1177
+ return q;
1205
1178
  switch (k) {
1206
1179
  case "chat_history":
1207
1180
  return t("admins.perm_chat_history");
@@ -1234,7 +1207,7 @@ function ir() {
1234
1207
  )
1235
1208
  ] })
1236
1209
  ] }),
1237
- u && /* @__PURE__ */ e("div", { className: "bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm backdrop-blur-sm flex-shrink-0", children: u }),
1210
+ c && /* @__PURE__ */ e("div", { className: "bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm backdrop-blur-sm flex-shrink-0", children: c }),
1238
1211
  o && /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-background/20 backdrop-blur-md flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ r("div", { className: "bg-card rounded-2xl border border-border w-full max-w-md shadow-2xl overflow-hidden", children: [
1239
1212
  /* @__PURE__ */ e("div", { className: "px-6 py-5 border-b border-border bg-muted/20", children: /* @__PURE__ */ e("h3", { className: "text-lg font-bold text-foreground", children: t(l ? "admins.edit_admin" : "admins.add_admin") }) }),
1240
1213
  /* @__PURE__ */ e("div", { className: "p-8", children: /* @__PURE__ */ r(
@@ -1438,7 +1411,7 @@ function ir() {
1438
1411
  ] }) })
1439
1412
  ] });
1440
1413
  }
1441
- function lr({ message: t, onDismiss: a }) {
1414
+ function or({ message: t, onDismiss: a }) {
1442
1415
  return /* @__PURE__ */ r("div", { className: "bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm backdrop-blur-sm flex-shrink-0 flex justify-between items-center group", children: [
1443
1416
  /* @__PURE__ */ e("span", { children: t }),
1444
1417
  /* @__PURE__ */ e("button", { onClick: a, className: "opacity-50 hover:opacity-100 transition-opacity p-1", children: /* @__PURE__ */ e(
@@ -1455,7 +1428,7 @@ function lr({ message: t, onDismiss: a }) {
1455
1428
  ) })
1456
1429
  ] });
1457
1430
  }
1458
- function dr({
1431
+ function ir({
1459
1432
  users: t,
1460
1433
  loading: a,
1461
1434
  totalCount: s,
@@ -1470,7 +1443,7 @@ function dr({
1470
1443
  onCopyToken: x,
1471
1444
  onDelete: i
1472
1445
  }) {
1473
- const { t: b, i18n: h } = F(["admin", "translation"]), N = h.language === "fa", D = (p) => o !== p ? /* @__PURE__ */ e(qt, { className: "w-3.5 h-3.5 opacity-50" }) : n === "asc" ? /* @__PURE__ */ e(jt, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ e(Tt, { className: "w-3.5 h-3.5" });
1446
+ const { t: b, i18n: h } = F(["admin", "translation"]), N = h.language === "fa", D = (p) => o !== p ? /* @__PURE__ */ e(St, { className: "w-3.5 h-3.5 opacity-50" }) : n === "asc" ? /* @__PURE__ */ e(Lt, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ e(qt, { className: "w-3.5 h-3.5" });
1474
1447
  return /* @__PURE__ */ e("div", { className: "glass-surface border border-border rounded-2xl overflow-hidden shadow-sm flex-1 flex flex-col", children: /* @__PURE__ */ r(
1475
1448
  "div",
1476
1449
  {
@@ -1528,13 +1501,13 @@ function dr({
1528
1501
  ] }) }),
1529
1502
  /* @__PURE__ */ e("td", { className: "px-4 py-3 text-foreground/80", children: p.surname || /* @__PURE__ */ e("span", { className: "text-muted-foreground/50", children: "—" }) }),
1530
1503
  d.map((R) => {
1531
- const u = p.metadata?.[R.key];
1532
- let f = String(u ?? "");
1533
- if (R.type === "select" && u !== void 0) {
1534
- const C = R.options?.find((L) => String(L.value) === String(u));
1504
+ const c = p.metadata?.[R.key];
1505
+ let f = String(c ?? "");
1506
+ if (R.type === "select" && c !== void 0) {
1507
+ const C = R.options?.find((L) => String(L.value) === String(c));
1535
1508
  C && (f = b(C.label));
1536
1509
  }
1537
- return /* @__PURE__ */ e("td", { className: "px-4 py-3 text-foreground/80", children: R.type === "checkbox" ? u ? /* @__PURE__ */ e("span", { className: "text-emerald-500 font-bold", children: "✓" }) : /* @__PURE__ */ e("span", { className: "text-muted-foreground opacity-30", children: "✗" }) : f }, R.key);
1510
+ return /* @__PURE__ */ e("td", { className: "px-4 py-3 text-foreground/80", children: R.type === "checkbox" ? c ? /* @__PURE__ */ e("span", { className: "text-emerald-500 font-bold", children: "✓" }) : /* @__PURE__ */ e("span", { className: "text-muted-foreground opacity-30", children: "✗" }) : f }, R.key);
1538
1511
  }),
1539
1512
  /* @__PURE__ */ e("td", { className: "px-4 py-3 text-muted-foreground w-[120px]", children: p.balance ? /* @__PURE__ */ r("div", { className: "flex flex-col gap-3 min-w-0 py-1", children: [
1540
1513
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
@@ -1583,7 +1556,7 @@ function dr({
1583
1556
  onClick: () => _(p),
1584
1557
  className: "p-2 text-muted-foreground hover:text-primary hover:bg-primary/10 rounded-xl transition-all",
1585
1558
  title: b("users.usage_summary"),
1586
- children: /* @__PURE__ */ e(Lt, { className: "w-4 h-4" })
1559
+ children: /* @__PURE__ */ e(Ct, { className: "w-4 h-4" })
1587
1560
  }
1588
1561
  ),
1589
1562
  /* @__PURE__ */ e(
@@ -1736,7 +1709,7 @@ function dr({
1736
1709
  }
1737
1710
  ) });
1738
1711
  }
1739
- function lt(t, a = /* @__PURE__ */ new Date()) {
1712
+ function ot(t, a = /* @__PURE__ */ new Date()) {
1740
1713
  const s = new Date(a);
1741
1714
  switch (s.setMilliseconds(0), t) {
1742
1715
  case "minute":
@@ -1760,22 +1733,22 @@ function lt(t, a = /* @__PURE__ */ new Date()) {
1760
1733
  }
1761
1734
  return s.toISOString();
1762
1735
  }
1763
- function de({ className: t, ...a }) {
1736
+ function le({ className: t, ...a }) {
1764
1737
  return /* @__PURE__ */ e(
1765
- et.Root,
1738
+ Xe.Root,
1766
1739
  {
1767
1740
  "data-slot": "switch",
1768
1741
  dir: "ltr",
1769
- className: Ce(
1742
+ className: ke(
1770
1743
  "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
1771
1744
  t
1772
1745
  ),
1773
1746
  ...a,
1774
1747
  children: /* @__PURE__ */ e(
1775
- et.Thumb,
1748
+ Xe.Thumb,
1776
1749
  {
1777
1750
  "data-slot": "switch-thumb",
1778
- className: Ce(
1751
+ className: ke(
1779
1752
  "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
1780
1753
  )
1781
1754
  }
@@ -1783,8 +1756,8 @@ function de({ className: t, ...a }) {
1783
1756
  }
1784
1757
  );
1785
1758
  }
1786
- const cr = (t) => t.replace(/[^0-9]/g, "");
1787
- function ur({
1759
+ const lr = (t) => t.replace(/[^0-9]/g, "");
1760
+ function dr({
1788
1761
  editingUser: t,
1789
1762
  appSettings: a,
1790
1763
  userMetadataFields: s,
@@ -1824,10 +1797,10 @@ function ur({
1824
1797
  }
1825
1798
  ), [h, N] = y(() => {
1826
1799
  if (!t?.metadata) return {};
1827
- const u = {};
1800
+ const c = {};
1828
1801
  return s.forEach((f) => {
1829
- t.metadata?.[f.key] !== void 0 ? u[f.key] = t.metadata[f.key] : f.defaultValue !== void 0 && (u[f.key] = f.defaultValue);
1830
- }), u;
1802
+ t.metadata?.[f.key] !== void 0 ? c[f.key] = t.metadata[f.key] : f.defaultValue !== void 0 && (c[f.key] = f.defaultValue);
1803
+ }), c;
1831
1804
  });
1832
1805
  H(() => {
1833
1806
  try {
@@ -1836,26 +1809,26 @@ function ur({
1836
1809
  } catch {
1837
1810
  }
1838
1811
  }, [h]), H(() => {
1839
- const u = { ...h };
1812
+ const c = { ...h };
1840
1813
  let f = !1;
1841
1814
  s.forEach((C) => {
1842
- C.condition && !Ze(C.condition, h) && u[C.key] !== void 0 && (delete u[C.key], f = !0);
1843
- }), f && N(u);
1815
+ C.condition && !Qe(C.condition, h) && c[C.key] !== void 0 && (delete c[C.key], f = !0);
1816
+ }), f && N(c);
1844
1817
  }, [h, s]);
1845
1818
  const D = () => {
1846
1819
  if (!i.rechargeEnabled)
1847
1820
  return { enabled: !1 };
1848
- const u = Number(i.rechargeIntervalValue);
1849
- return !Number.isInteger(u) || u <= 0 ? (n(l("users.recharge_interval_invalid")), null) : {
1821
+ const c = Number(i.rechargeIntervalValue);
1822
+ return !Number.isInteger(c) || c <= 0 ? (n(l("users.recharge_interval_invalid")), null) : {
1850
1823
  enabled: !0,
1851
- interval_value: u,
1824
+ interval_value: c,
1852
1825
  interval_unit: i.rechargeIntervalUnit,
1853
1826
  // When blank, default to the next round boundary of the interval in the admin's
1854
1827
  // local time (e.g. next local midnight for daily) rather than the request time.
1855
- anchor_at: i.rechargeAnchorAt ? new Date(i.rechargeAnchorAt).toISOString() : lt(i.rechargeIntervalUnit)
1828
+ anchor_at: i.rechargeAnchorAt ? new Date(i.rechargeAnchorAt).toISOString() : ot(i.rechargeIntervalUnit)
1856
1829
  };
1857
- }, p = async (u) => {
1858
- u.preventDefault();
1830
+ }, p = async (c) => {
1831
+ c.preventDefault();
1859
1832
  const f = i.tokens ? parseInt(i.tokens) : 0, C = i.requests ? parseInt(i.requests) : 0, L = i.tokensLimit ? parseInt(i.tokensLimit) : f, $ = i.requestsLimit ? parseInt(i.requestsLimit) : C;
1860
1833
  if (f > L) {
1861
1834
  n(l("users.tokens_exceed_limit", "Tokens cannot exceed limit"));
@@ -1895,8 +1868,8 @@ function ur({
1895
1868
  x(!1);
1896
1869
  }
1897
1870
  }
1898
- }, R = async (u) => {
1899
- if (u.preventDefault(), !t) return;
1871
+ }, R = async (c) => {
1872
+ if (c.preventDefault(), !t) return;
1900
1873
  let f = {};
1901
1874
  if (i.metadata)
1902
1875
  try {
@@ -1944,7 +1917,7 @@ function ur({
1944
1917
  X,
1945
1918
  {
1946
1919
  value: i.accountType,
1947
- onValueChange: (u) => b({ ...i, accountType: u }),
1920
+ onValueChange: (c) => b({ ...i, accountType: c }),
1948
1921
  dir: _ ? "rtl" : "ltr",
1949
1922
  children: [
1950
1923
  /* @__PURE__ */ e(Y, { className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground transition-all text-sm h-[46px]", children: /* @__PURE__ */ e(ee, {}) }),
@@ -1971,7 +1944,7 @@ function ur({
1971
1944
  {
1972
1945
  type: "text",
1973
1946
  value: i.phone,
1974
- onChange: (u) => b({ ...i, phone: cr(u.target.value) }),
1947
+ onChange: (c) => b({ ...i, phone: lr(c.target.value) }),
1975
1948
  className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
1976
1949
  placeholder: l("users.phone_placeholder"),
1977
1950
  required: i.accountType === "human",
@@ -1988,7 +1961,7 @@ function ur({
1988
1961
  {
1989
1962
  type: "text",
1990
1963
  value: i.name,
1991
- onChange: (u) => b({ ...i, name: u.target.value }),
1964
+ onChange: (c) => b({ ...i, name: c.target.value }),
1992
1965
  className: `w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm ${S}`,
1993
1966
  placeholder: l("users.service_name_placeholder"),
1994
1967
  required: !0
@@ -2003,7 +1976,7 @@ function ur({
2003
1976
  {
2004
1977
  type: "text",
2005
1978
  value: i.name,
2006
- onChange: (u) => b({ ...i, name: u.target.value }),
1979
+ onChange: (c) => b({ ...i, name: c.target.value }),
2007
1980
  className: `w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm ${S}`,
2008
1981
  required: !0
2009
1982
  }
@@ -2016,7 +1989,7 @@ function ur({
2016
1989
  {
2017
1990
  type: "text",
2018
1991
  value: i.surname ?? "",
2019
- onChange: (u) => b({ ...i, surname: u.target.value }),
1992
+ onChange: (c) => b({ ...i, surname: c.target.value }),
2020
1993
  className: `w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm ${S}`,
2021
1994
  required: !0
2022
1995
  }
@@ -2034,7 +2007,7 @@ function ur({
2034
2007
  {
2035
2008
  type: "number",
2036
2009
  value: i.tokens,
2037
- onChange: (u) => b({ ...i, tokens: u.target.value }),
2010
+ onChange: (c) => b({ ...i, tokens: c.target.value }),
2038
2011
  className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2039
2012
  dir: "ltr",
2040
2013
  placeholder: "0"
@@ -2048,7 +2021,7 @@ function ur({
2048
2021
  {
2049
2022
  type: "number",
2050
2023
  value: i.tokensLimit,
2051
- onChange: (u) => b({ ...i, tokensLimit: u.target.value }),
2024
+ onChange: (c) => b({ ...i, tokensLimit: c.target.value }),
2052
2025
  className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2053
2026
  dir: "ltr",
2054
2027
  placeholder: i.tokens || String(a?.initial_balance_tokens ?? "250000")
@@ -2064,7 +2037,7 @@ function ur({
2064
2037
  {
2065
2038
  type: "number",
2066
2039
  value: i.requests,
2067
- onChange: (u) => b({ ...i, requests: u.target.value }),
2040
+ onChange: (c) => b({ ...i, requests: c.target.value }),
2068
2041
  className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2069
2042
  dir: "ltr",
2070
2043
  placeholder: i.requests || String(a?.initial_balance_requests ?? "0")
@@ -2078,7 +2051,7 @@ function ur({
2078
2051
  {
2079
2052
  type: "number",
2080
2053
  value: i.requestsLimit,
2081
- onChange: (u) => b({ ...i, requestsLimit: u.target.value }),
2054
+ onChange: (c) => b({ ...i, requestsLimit: c.target.value }),
2082
2055
  className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2083
2056
  dir: "ltr",
2084
2057
  placeholder: i.requests || String(a?.initial_balance_requests ?? "100")
@@ -2095,13 +2068,13 @@ function ur({
2095
2068
  ] }),
2096
2069
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 shrink-0 pt-0.5", children: [
2097
2070
  /* @__PURE__ */ e(
2098
- de,
2071
+ le,
2099
2072
  {
2100
2073
  id: "admin-recharge-enabled",
2101
2074
  checked: i.rechargeEnabled,
2102
- onCheckedChange: (u) => b({
2075
+ onCheckedChange: (c) => b({
2103
2076
  ...i,
2104
- rechargeEnabled: u
2077
+ rechargeEnabled: c
2105
2078
  }),
2106
2079
  "aria-label": l("users.auto_recharge")
2107
2080
  }
@@ -2127,7 +2100,7 @@ function ur({
2127
2100
  min: "1",
2128
2101
  step: "1",
2129
2102
  value: i.rechargeIntervalValue,
2130
- onChange: (u) => b({ ...i, rechargeIntervalValue: u.target.value }),
2103
+ onChange: (c) => b({ ...i, rechargeIntervalValue: c.target.value }),
2131
2104
  className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2132
2105
  required: !0,
2133
2106
  dir: "ltr"
@@ -2140,14 +2113,14 @@ function ur({
2140
2113
  X,
2141
2114
  {
2142
2115
  value: i.rechargeIntervalUnit,
2143
- onValueChange: (u) => b({
2116
+ onValueChange: (c) => b({
2144
2117
  ...i,
2145
- rechargeIntervalUnit: u
2118
+ rechargeIntervalUnit: c
2146
2119
  }),
2147
2120
  dir: _ ? "rtl" : "ltr",
2148
2121
  children: [
2149
2122
  /* @__PURE__ */ e(Y, { className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground transition-all text-sm h-[46px]", children: /* @__PURE__ */ e(ee, {}) }),
2150
- /* @__PURE__ */ e(te, { className: "rounded-xl border-border bg-card", children: ["minute", "hour", "day", "week", "month"].map((u) => /* @__PURE__ */ e(E, { value: u, children: l(`users.recharge_unit_${u}`) }, u)) })
2123
+ /* @__PURE__ */ e(te, { className: "rounded-xl border-border bg-card", children: ["minute", "hour", "day", "week", "month"].map((c) => /* @__PURE__ */ e(E, { value: c, children: l(`users.recharge_unit_${c}`) }, c)) })
2151
2124
  ]
2152
2125
  }
2153
2126
  )
@@ -2172,83 +2145,83 @@ function ur({
2172
2145
  ] }),
2173
2146
  s.length > 0 && /* @__PURE__ */ r("div", { className: "border-t border-border/50 pt-4 mt-4 space-y-4", children: [
2174
2147
  /* @__PURE__ */ e("h4", { className: "text-sm font-bold text-foreground/70", children: l("users.custom_fields") }),
2175
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: s.map((u) => Ze(u.condition, h) ? /* @__PURE__ */ r(
2148
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: s.map((c) => Qe(c.condition, h) ? /* @__PURE__ */ r(
2176
2149
  "div",
2177
2150
  {
2178
2151
  className: "animate-in fade-in slide-in-from-top-1 duration-200",
2179
2152
  children: [
2180
2153
  /* @__PURE__ */ r("label", { className: "block text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3", children: [
2181
- l(u.label),
2154
+ l(c.label),
2182
2155
  " ",
2183
- u.required && /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
2156
+ c.required && /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
2184
2157
  ] }),
2185
- u.type === "select" ? /* @__PURE__ */ r(
2158
+ c.type === "select" ? /* @__PURE__ */ r(
2186
2159
  X,
2187
2160
  {
2188
- value: String(h[u.key] || ""),
2161
+ value: String(h[c.key] || ""),
2189
2162
  onValueChange: (f) => N({
2190
2163
  ...h,
2191
- [u.key]: f
2164
+ [c.key]: f
2192
2165
  }),
2193
- required: u.required,
2166
+ required: c.required,
2194
2167
  dir: _ ? "rtl" : "ltr",
2195
2168
  children: [
2196
2169
  /* @__PURE__ */ e(
2197
2170
  Y,
2198
2171
  {
2199
- className: Ce(
2172
+ className: ke(
2200
2173
  "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground transition-all text-sm h-[46px]",
2201
2174
  S
2202
2175
  ),
2203
2176
  children: /* @__PURE__ */ e(
2204
2177
  ee,
2205
2178
  {
2206
- placeholder: l(u.placeholder || "select_placeholder")
2179
+ placeholder: l(c.placeholder || "select_placeholder")
2207
2180
  }
2208
2181
  )
2209
2182
  }
2210
2183
  ),
2211
- /* @__PURE__ */ e(te, { className: "rounded-xl border-border bg-card", children: u.options?.map((f) => /* @__PURE__ */ e(E, { value: String(f.value), children: l(f.label) }, String(f.value))) })
2184
+ /* @__PURE__ */ e(te, { className: "rounded-xl border-border bg-card", children: c.options?.map((f) => /* @__PURE__ */ e(E, { value: String(f.value), children: l(f.label) }, String(f.value))) })
2212
2185
  ]
2213
2186
  }
2214
- ) : u.type === "checkbox" ? /* @__PURE__ */ r("div", { className: "flex items-center gap-3 h-[46px] px-1", children: [
2187
+ ) : c.type === "checkbox" ? /* @__PURE__ */ r("div", { className: "flex items-center gap-3 h-[46px] px-1", children: [
2215
2188
  /* @__PURE__ */ e(
2216
- ke,
2189
+ we,
2217
2190
  {
2218
- id: `admin-md-${u.key}`,
2219
- checked: !!h[u.key],
2191
+ id: `admin-md-${c.key}`,
2192
+ checked: !!h[c.key],
2220
2193
  onCheckedChange: (f) => N({
2221
2194
  ...h,
2222
- [u.key]: !!f
2195
+ [c.key]: !!f
2223
2196
  }),
2224
- required: u.required
2197
+ required: c.required
2225
2198
  }
2226
2199
  ),
2227
2200
  /* @__PURE__ */ e(
2228
2201
  "label",
2229
2202
  {
2230
- htmlFor: `admin-md-${u.key}`,
2203
+ htmlFor: `admin-md-${c.key}`,
2231
2204
  className: "text-sm text-foreground/80 cursor-pointer select-none",
2232
- children: l(u.placeholder || u.label)
2205
+ children: l(c.placeholder || c.label)
2233
2206
  }
2234
2207
  )
2235
2208
  ] }) : /* @__PURE__ */ e(
2236
2209
  "input",
2237
2210
  {
2238
- type: u.type,
2239
- value: h[u.key] || "",
2211
+ type: c.type,
2212
+ value: h[c.key] || "",
2240
2213
  onChange: (f) => N({
2241
2214
  ...h,
2242
- [u.key]: f.target.value
2215
+ [c.key]: f.target.value
2243
2216
  }),
2244
2217
  className: `w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm ${S}`,
2245
- placeholder: l(u.placeholder || ""),
2246
- required: u.required
2218
+ placeholder: l(c.placeholder || ""),
2219
+ required: c.required
2247
2220
  }
2248
2221
  )
2249
2222
  ]
2250
2223
  },
2251
- u.key
2224
+ c.key
2252
2225
  ) : null) })
2253
2226
  ] }),
2254
2227
  /* @__PURE__ */ r("div", { className: "border-t border-border/50 pt-4 mt-4", children: [
@@ -2260,7 +2233,7 @@ function ur({
2260
2233
  "textarea",
2261
2234
  {
2262
2235
  value: i.metadata,
2263
- onChange: (u) => b({ ...i, metadata: u.target.value }),
2236
+ onChange: (c) => b({ ...i, metadata: c.target.value }),
2264
2237
  className: "w-full px-4 py-3 bg-input/50 border border-border rounded-xl text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-xs font-mono min-h-[100px] custom-scrollbar",
2265
2238
  placeholder: '{ "key": "value" }',
2266
2239
  dir: "ltr"
@@ -2293,7 +2266,7 @@ function ur({
2293
2266
  }
2294
2267
  );
2295
2268
  }
2296
- function dt({ onClick: t, label: a = "Close" }) {
2269
+ function it({ onClick: t, label: a = "Close" }) {
2297
2270
  return /* @__PURE__ */ e(
2298
2271
  "button",
2299
2272
  {
@@ -2316,17 +2289,17 @@ function dt({ onClick: t, label: a = "Close" }) {
2316
2289
  }
2317
2290
  );
2318
2291
  }
2319
- function mr({ user: t, onClose: a, onSaved: s, onError: d }) {
2292
+ function cr({ user: t, onClose: a, onSaved: s, onError: d }) {
2320
2293
  const { t: o } = F(["admin", "translation"]), [n, l] = y(!1), [g, _] = y(String(t.balance?.tokens || 0)), [S, w] = y(String(t.balance?.requests || 0)), [x, i] = y(String(t.balance?.token_limit || 0)), [b, h] = y(String(t.balance?.request_limit || 0)), N = () => {
2321
2294
  _(x || String(t.balance?.token_limit || 0)), w(b || String(t.balance?.request_limit || 0));
2322
2295
  }, D = async (p) => {
2323
2296
  p.preventDefault();
2324
- const R = parseInt(g) || 0, u = parseInt(S) || 0, f = x ? parseInt(x) : t.balance?.token_limit || 0, C = b ? parseInt(b) : t.balance?.request_limit || 0;
2297
+ const R = parseInt(g) || 0, c = parseInt(S) || 0, f = x ? parseInt(x) : t.balance?.token_limit || 0, C = b ? parseInt(b) : t.balance?.request_limit || 0;
2325
2298
  if (R > f) {
2326
2299
  d(o("users.tokens_exceed_limit", "Tokens cannot exceed limit"));
2327
2300
  return;
2328
2301
  }
2329
- if (u > C) {
2302
+ if (c > C) {
2330
2303
  d(o("users.requests_exceed_limit", "Requests cannot exceed limit"));
2331
2304
  return;
2332
2305
  }
@@ -2335,7 +2308,7 @@ function mr({ user: t, onClose: a, onSaved: s, onError: d }) {
2335
2308
  await T.updateUserBalance(
2336
2309
  t.id,
2337
2310
  R,
2338
- u,
2311
+ c,
2339
2312
  x ? parseInt(x) : void 0,
2340
2313
  b ? parseInt(b) : void 0
2341
2314
  ), s();
@@ -2359,7 +2332,7 @@ function mr({ user: t, onClose: a, onSaved: s, onError: d }) {
2359
2332
  " ",
2360
2333
  t.name
2361
2334
  ] }),
2362
- /* @__PURE__ */ e(dt, { onClick: a })
2335
+ /* @__PURE__ */ e(it, { onClick: a })
2363
2336
  ] }),
2364
2337
  /* @__PURE__ */ e("div", { className: "p-8", children: /* @__PURE__ */ r("form", { onSubmit: D, children: [
2365
2338
  /* @__PURE__ */ r("div", { className: "space-y-4", children: [
@@ -2449,7 +2422,7 @@ function mr({ user: t, onClose: a, onSaved: s, onError: d }) {
2449
2422
  }
2450
2423
  );
2451
2424
  }
2452
- const hr = {
2425
+ const ur = {
2453
2426
  applyBalance: !0,
2454
2427
  operation: "add",
2455
2428
  tokens: "",
@@ -2465,23 +2438,23 @@ const hr = {
2465
2438
  userIds: "",
2466
2439
  metadata: "{}"
2467
2440
  };
2468
- function pr({
2441
+ function mr({
2469
2442
  searchQuery: t,
2470
2443
  userMetadataFields: a,
2471
2444
  onClose: s,
2472
2445
  onApplied: d,
2473
2446
  onError: o
2474
2447
  }) {
2475
- const { t: n, i18n: l } = F(["admin", "translation"]), g = l.language === "fa", [_, S] = y(!1), [w, x] = y(null), [i, b] = y(hr), h = () => {
2476
- let u = {};
2448
+ const { t: n, i18n: l } = F(["admin", "translation"]), g = l.language === "fa", [_, S] = y(!1), [w, x] = y(null), [i, b] = y(ur), h = () => {
2449
+ let c = {};
2477
2450
  if (i.metadata.trim())
2478
2451
  try {
2479
- u = JSON.parse(i.metadata);
2452
+ c = JSON.parse(i.metadata);
2480
2453
  } catch {
2481
2454
  return o(n("users.invalid_json", "Invalid JSON format")), null;
2482
2455
  }
2483
2456
  const f = {};
2484
- Object.entries(u).forEach(([L, $]) => {
2457
+ Object.entries(c).forEach(([L, $]) => {
2485
2458
  Array.isArray($) ? f[L] = $ : $ !== "" && $ !== void 0 && $ !== null && (f[L] = [$]);
2486
2459
  });
2487
2460
  const C = i.userIds.split(/[\s,]+/).map((L) => L.trim()).filter(Boolean);
@@ -2490,7 +2463,7 @@ function pr({
2490
2463
  user_ids: C.length > 0 ? C : void 0,
2491
2464
  metadata_in: Object.keys(f).length > 0 ? f : void 0
2492
2465
  };
2493
- }, N = (u) => {
2466
+ }, N = (c) => {
2494
2467
  const f = h();
2495
2468
  return f ? {
2496
2469
  operation: i.operation,
@@ -2499,16 +2472,16 @@ function pr({
2499
2472
  token_limit: i.tokenLimit === "" ? void 0 : Number(i.tokenLimit),
2500
2473
  request_limit: i.requestLimit === "" ? void 0 : Number(i.requestLimit),
2501
2474
  filters: f,
2502
- dry_run: u
2475
+ dry_run: c
2503
2476
  } : null;
2504
- }, D = (u) => {
2477
+ }, D = (c) => {
2505
2478
  const f = h();
2506
2479
  if (!f) return null;
2507
2480
  if (!i.renewalEnabled)
2508
2481
  return {
2509
2482
  recharge_policy: { enabled: !1 },
2510
2483
  filters: f,
2511
- dry_run: u
2484
+ dry_run: c
2512
2485
  };
2513
2486
  const C = Number(i.renewalIntervalValue);
2514
2487
  return !Number.isInteger(C) || C <= 0 ? (o(n("users.recharge_interval_invalid")), null) : {
@@ -2518,20 +2491,20 @@ function pr({
2518
2491
  interval_unit: i.renewalIntervalUnit,
2519
2492
  // When blank, default to the next round boundary of the interval in the admin's
2520
2493
  // local time (e.g. next local midnight for daily) rather than the request time.
2521
- anchor_at: i.renewalAnchorAt ? new Date(i.renewalAnchorAt).toISOString() : lt(i.renewalIntervalUnit)
2494
+ anchor_at: i.renewalAnchorAt ? new Date(i.renewalAnchorAt).toISOString() : ot(i.renewalIntervalUnit)
2522
2495
  },
2523
2496
  filters: f,
2524
- dry_run: u
2497
+ dry_run: c
2525
2498
  };
2526
2499
  }, p = async () => {
2527
2500
  if (i.applyRenewal && !i.applyBalance) {
2528
2501
  const C = D(!0);
2529
2502
  return C ? (await T.bulkUpdateUserRenewal(C)).matched : null;
2530
2503
  }
2531
- const u = N(!0);
2532
- return u ? (await T.bulkUpdateUserBalance(u)).matched : null;
2533
- }, R = async (u) => {
2534
- if (u.preventDefault(), !i.applyBalance && !i.applyRenewal) {
2504
+ const c = N(!0);
2505
+ return c ? (await T.bulkUpdateUserBalance(c)).matched : null;
2506
+ }, R = async (c) => {
2507
+ if (c.preventDefault(), !i.applyBalance && !i.applyRenewal) {
2535
2508
  o(n("users.bulk_select_change"));
2536
2509
  return;
2537
2510
  }
@@ -2563,18 +2536,18 @@ function pr({
2563
2536
  /* @__PURE__ */ e("h3", { id: "bulk-balance-modal-title", className: "text-lg font-bold text-foreground", children: n("users.bulk_balance") }),
2564
2537
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-1", children: n("users.bulk_balance_help") })
2565
2538
  ] }),
2566
- /* @__PURE__ */ e(dt, { onClick: s })
2539
+ /* @__PURE__ */ e(it, { onClick: s })
2567
2540
  ] }),
2568
2541
  /* @__PURE__ */ r("form", { onSubmit: R, className: "flex min-h-0 flex-1 flex-col", children: [
2569
2542
  /* @__PURE__ */ r("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4 space-y-4 custom-scrollbar", children: [
2570
2543
  /* @__PURE__ */ r("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
2571
2544
  /* @__PURE__ */ r("label", { className: "flex items-center gap-3 rounded-lg border border-border bg-muted/10 px-3 py-2.5 text-sm text-foreground cursor-pointer", children: [
2572
2545
  /* @__PURE__ */ e(
2573
- ke,
2546
+ we,
2574
2547
  {
2575
2548
  checked: i.applyBalance,
2576
- onCheckedChange: (u) => {
2577
- b({ ...i, applyBalance: !!u }), x(null);
2549
+ onCheckedChange: (c) => {
2550
+ b({ ...i, applyBalance: !!c }), x(null);
2578
2551
  }
2579
2552
  }
2580
2553
  ),
@@ -2582,11 +2555,11 @@ function pr({
2582
2555
  ] }),
2583
2556
  /* @__PURE__ */ r("label", { className: "flex items-center gap-3 rounded-lg border border-border bg-muted/10 px-3 py-2.5 text-sm text-foreground cursor-pointer", children: [
2584
2557
  /* @__PURE__ */ e(
2585
- ke,
2558
+ we,
2586
2559
  {
2587
2560
  checked: i.applyRenewal,
2588
- onCheckedChange: (u) => {
2589
- b({ ...i, applyRenewal: !!u }), x(null);
2561
+ onCheckedChange: (c) => {
2562
+ b({ ...i, applyRenewal: !!c }), x(null);
2590
2563
  }
2591
2564
  }
2592
2565
  ),
@@ -2600,10 +2573,10 @@ function pr({
2600
2573
  X,
2601
2574
  {
2602
2575
  value: i.operation,
2603
- onValueChange: (u) => {
2576
+ onValueChange: (c) => {
2604
2577
  b({
2605
2578
  ...i,
2606
- operation: u
2579
+ operation: c
2607
2580
  }), x(null);
2608
2581
  },
2609
2582
  dir: g ? "rtl" : "ltr",
@@ -2620,12 +2593,12 @@ function pr({
2620
2593
  ] }),
2621
2594
  /* @__PURE__ */ r("div", { className: "flex items-center gap-3 md:pt-6", children: [
2622
2595
  /* @__PURE__ */ e(
2623
- ke,
2596
+ we,
2624
2597
  {
2625
2598
  id: "bulk-use-search",
2626
2599
  checked: i.useCurrentSearch,
2627
- onCheckedChange: (u) => {
2628
- b({ ...i, useCurrentSearch: !!u }), x(null);
2600
+ onCheckedChange: (c) => {
2601
+ b({ ...i, useCurrentSearch: !!c }), x(null);
2629
2602
  }
2630
2603
  }
2631
2604
  ),
@@ -2640,8 +2613,8 @@ function pr({
2640
2613
  {
2641
2614
  type: "number",
2642
2615
  value: i.tokens,
2643
- onChange: (u) => {
2644
- b({ ...i, tokens: u.target.value }), x(null);
2616
+ onChange: (c) => {
2617
+ b({ ...i, tokens: c.target.value }), x(null);
2645
2618
  },
2646
2619
  className: "w-full h-10 px-3 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2647
2620
  disabled: i.operation === "full_charge",
@@ -2657,8 +2630,8 @@ function pr({
2657
2630
  {
2658
2631
  type: "number",
2659
2632
  value: i.requests,
2660
- onChange: (u) => {
2661
- b({ ...i, requests: u.target.value }), x(null);
2633
+ onChange: (c) => {
2634
+ b({ ...i, requests: c.target.value }), x(null);
2662
2635
  },
2663
2636
  className: "w-full h-10 px-3 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2664
2637
  disabled: i.operation === "full_charge",
@@ -2674,8 +2647,8 @@ function pr({
2674
2647
  {
2675
2648
  type: "number",
2676
2649
  value: i.tokenLimit,
2677
- onChange: (u) => {
2678
- b({ ...i, tokenLimit: u.target.value }), x(null);
2650
+ onChange: (c) => {
2651
+ b({ ...i, tokenLimit: c.target.value }), x(null);
2679
2652
  },
2680
2653
  className: "w-full h-10 px-3 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2681
2654
  dir: "ltr"
@@ -2689,8 +2662,8 @@ function pr({
2689
2662
  {
2690
2663
  type: "number",
2691
2664
  value: i.requestLimit,
2692
- onChange: (u) => {
2693
- b({ ...i, requestLimit: u.target.value }), x(null);
2665
+ onChange: (c) => {
2666
+ b({ ...i, requestLimit: c.target.value }), x(null);
2694
2667
  },
2695
2668
  className: "w-full h-10 px-3 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2696
2669
  dir: "ltr"
@@ -2706,11 +2679,11 @@ function pr({
2706
2679
  ] }),
2707
2680
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
2708
2681
  /* @__PURE__ */ e(
2709
- de,
2682
+ le,
2710
2683
  {
2711
2684
  checked: i.renewalEnabled,
2712
- onCheckedChange: (u) => {
2713
- b({ ...i, renewalEnabled: u }), x(null);
2685
+ onCheckedChange: (c) => {
2686
+ b({ ...i, renewalEnabled: c }), x(null);
2714
2687
  }
2715
2688
  }
2716
2689
  ),
@@ -2727,8 +2700,8 @@ function pr({
2727
2700
  min: "1",
2728
2701
  step: "1",
2729
2702
  value: i.renewalIntervalValue,
2730
- onChange: (u) => {
2731
- b({ ...i, renewalIntervalValue: u.target.value }), x(null);
2703
+ onChange: (c) => {
2704
+ b({ ...i, renewalIntervalValue: c.target.value }), x(null);
2732
2705
  },
2733
2706
  className: "w-full h-10 px-3 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2734
2707
  required: !0,
@@ -2742,16 +2715,16 @@ function pr({
2742
2715
  X,
2743
2716
  {
2744
2717
  value: i.renewalIntervalUnit,
2745
- onValueChange: (u) => {
2718
+ onValueChange: (c) => {
2746
2719
  b({
2747
2720
  ...i,
2748
- renewalIntervalUnit: u
2721
+ renewalIntervalUnit: c
2749
2722
  }), x(null);
2750
2723
  },
2751
2724
  dir: g ? "rtl" : "ltr",
2752
2725
  children: [
2753
2726
  /* @__PURE__ */ e(Y, { className: "w-full px-3 bg-input/50 border border-border rounded-lg text-foreground transition-all text-sm h-10", children: /* @__PURE__ */ e(ee, {}) }),
2754
- /* @__PURE__ */ e(te, { className: "rounded-lg border-border bg-card", children: ["minute", "hour", "day", "week", "month"].map((u) => /* @__PURE__ */ e(E, { value: u, children: n(`users.recharge_unit_${u}`) }, u)) })
2727
+ /* @__PURE__ */ e(te, { className: "rounded-lg border-border bg-card", children: ["minute", "hour", "day", "week", "month"].map((c) => /* @__PURE__ */ e(E, { value: c, children: n(`users.recharge_unit_${c}`) }, c)) })
2755
2728
  ]
2756
2729
  }
2757
2730
  )
@@ -2763,8 +2736,8 @@ function pr({
2763
2736
  {
2764
2737
  type: "datetime-local",
2765
2738
  value: i.renewalAnchorAt,
2766
- onChange: (u) => {
2767
- b({ ...i, renewalAnchorAt: u.target.value }), x(null);
2739
+ onChange: (c) => {
2740
+ b({ ...i, renewalAnchorAt: c.target.value }), x(null);
2768
2741
  },
2769
2742
  className: "w-full h-10 px-3 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-sm text-left",
2770
2743
  dir: "ltr"
@@ -2780,8 +2753,8 @@ function pr({
2780
2753
  "textarea",
2781
2754
  {
2782
2755
  value: i.userIds,
2783
- onChange: (u) => {
2784
- b({ ...i, userIds: u.target.value }), x(null);
2756
+ onChange: (c) => {
2757
+ b({ ...i, userIds: c.target.value }), x(null);
2785
2758
  },
2786
2759
  className: "w-full px-3 py-2 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-xs font-mono min-h-[58px]",
2787
2760
  placeholder: "user_abc, user_xyz",
@@ -2795,8 +2768,8 @@ function pr({
2795
2768
  "textarea",
2796
2769
  {
2797
2770
  value: i.metadata,
2798
- onChange: (u) => {
2799
- b({ ...i, metadata: u.target.value }), x(null);
2771
+ onChange: (c) => {
2772
+ b({ ...i, metadata: c.target.value }), x(null);
2800
2773
  },
2801
2774
  className: "w-full px-3 py-2 bg-input/50 border border-border rounded-lg text-foreground focus:ring-2 focus:ring-ring focus:border-transparent transition-all text-xs font-mono min-h-[58px]",
2802
2775
  placeholder: '{ "grade": ["10", "11"], "major": ["math", "science"] }',
@@ -2807,7 +2780,7 @@ function pr({
2807
2780
  n("users.bulk_available_metadata"),
2808
2781
  ":",
2809
2782
  " ",
2810
- a.map((u) => u.key).join(", ")
2783
+ a.map((c) => c.key).join(", ")
2811
2784
  ] })
2812
2785
  ] })
2813
2786
  ] })
@@ -2829,7 +2802,7 @@ function pr({
2829
2802
  }
2830
2803
  );
2831
2804
  }
2832
- function gr({ user: t, onClose: a, onError: s }) {
2805
+ function hr({ user: t, onClose: a, onError: s }) {
2833
2806
  const { t: d, i18n: o } = F(["admin", "translation"]), n = o.language === "fa" ? "fa-IR" : "en-US", [l, g] = y(null), [_, S] = y(!1);
2834
2807
  return H(() => {
2835
2808
  if (!t) return;
@@ -2843,10 +2816,10 @@ function gr({ user: t, onClose: a, onError: s }) {
2843
2816
  }), () => {
2844
2817
  w = !0;
2845
2818
  };
2846
- }, [t]), /* @__PURE__ */ e(Se, { open: !!t, onOpenChange: (w) => !w && a(), children: /* @__PURE__ */ r(qe, { children: [
2847
- /* @__PURE__ */ r(je, { children: [
2848
- /* @__PURE__ */ e(Te, { children: d("users.usage_summary") }),
2849
- /* @__PURE__ */ e(Ae, { children: t ? `${t.name} ${t.surname}` : "" })
2819
+ }, [t]), /* @__PURE__ */ e(Ce, { open: !!t, onOpenChange: (w) => !w && a(), children: /* @__PURE__ */ r(Le, { children: [
2820
+ /* @__PURE__ */ r(qe, { children: [
2821
+ /* @__PURE__ */ e(je, { children: d("users.usage_summary") }),
2822
+ /* @__PURE__ */ e(Te, { children: t ? `${t.name} ${t.surname}` : "" })
2850
2823
  ] }),
2851
2824
  _ ? /* @__PURE__ */ e("div", { className: "py-10 flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-8 h-8 border-2 border-primary/20 border-t-primary rounded-full animate-spin" }) }) : l ? /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: [
2852
2825
  [d("users.input_tokens"), l.input_tokens.toLocaleString(n)],
@@ -2855,7 +2828,7 @@ function gr({ user: t, onClose: a, onError: s }) {
2855
2828
  [d("users.requests_made"), l.requests.toLocaleString(n)],
2856
2829
  [
2857
2830
  d("users.total_cost"),
2858
- it(l.total_cost_microunits, l.currency, n)
2831
+ st(l.total_cost_microunits, l.currency, n)
2859
2832
  ],
2860
2833
  [d("users.renewals"), l.renewal_count.toLocaleString(n)],
2861
2834
  [d("users.unpriced_requests"), l.unpriced_requests.toLocaleString(n)]
@@ -2865,14 +2838,14 @@ function gr({ user: t, onClose: a, onError: s }) {
2865
2838
  ] }, w)) }) : null
2866
2839
  ] }) });
2867
2840
  }
2868
- const Re = 25;
2869
- function fr() {
2870
- const { t, i18n: a } = F(["admin", "translation"]), { app: s } = xe(), d = Ne(), o = a.language === "fa", [n, l] = y(""), [g, _] = y(""), [S, w] = y(""), [x, i] = y("name"), [b, h] = y("asc"), [N, D] = y("human"), [p, R] = y(null), [u, f] = y(Re), [C, L] = y(!1), [$, v] = y(null), [O, P] = y(null), [Z, k] = y(null), [m, j] = y(!1), A = Zt(), Q = () => d.invalidateQueries({ queryKey: ["gentiq_admin", "users"] }), {
2841
+ const Ie = 25;
2842
+ function pr() {
2843
+ const { t, i18n: a } = F(["admin", "translation"]), { app: s } = be(), d = _e(), o = a.language === "fa", [n, l] = y(""), [g, _] = y(""), [S, w] = y(""), [x, i] = y("name"), [b, h] = y("asc"), [N, D] = y("human"), [p, R] = y(null), [c, f] = y(Ie), [C, L] = y(!1), [$, v] = y(null), [O, P] = y(null), [Z, k] = y(null), [m, q] = y(!1), A = Qt(), K = () => d.invalidateQueries({ queryKey: ["gentiq_admin", "users"] }), {
2871
2844
  data: M,
2872
2845
  isLoading: z,
2873
- isFetching: K,
2846
+ isFetching: Q,
2874
2847
  error: W
2875
- } = Gt(0, u, S, x, b, N), V = M?.users ?? [], ce = M?.count ?? 0, ve = z || K, c = W ? W instanceof Error ? W.message : t("error_loading") : "", q = n || c, I = ge(() => s?.userMetadataFields || [], [s?.userMetadataFields]);
2848
+ } = Kt(0, c, S, x, b, N), B = M?.users ?? [], de = M?.count ?? 0, xe = z || Q, u = W ? W instanceof Error ? W.message : t("error_loading") : "", j = n || u, I = he(() => s?.userMetadataFields || [], [s?.userMetadataFields]);
2876
2849
  H(() => {
2877
2850
  T.getSettings().then(R).catch((J) => console.error("Failed to load app settings", J));
2878
2851
  }, []), H(() => {
@@ -2881,33 +2854,33 @@ function fr() {
2881
2854
  }, 500);
2882
2855
  return () => clearTimeout(J);
2883
2856
  }, [g]), H(() => {
2884
- f(Re);
2857
+ f(Ie);
2885
2858
  }, [S, x, b, N]);
2886
- const B = (J) => {
2887
- x === J ? h((ue) => ue === "asc" ? "desc" : "asc") : (i(J), h("asc"));
2859
+ const V = (J) => {
2860
+ x === J ? h((ce) => ce === "asc" ? "desc" : "asc") : (i(J), h("asc"));
2888
2861
  }, G = async (J) => {
2889
2862
  if (confirm(t("users.confirm_delete_user")))
2890
2863
  try {
2891
2864
  await A.deleteUser.mutateAsync(J);
2892
- } catch (ue) {
2893
- l(ue instanceof Error ? ue.message : t("error_loading"));
2865
+ } catch (ce) {
2866
+ l(ce instanceof Error ? ce.message : t("error_loading"));
2894
2867
  }
2895
- }, he = async (J) => {
2868
+ }, pe = async (J) => {
2896
2869
  try {
2897
- const Qe = (await T.refreshUserToken(J.id))?.user?.token;
2898
- if (!Qe) {
2870
+ const We = (await T.refreshUserToken(J.id))?.user?.token;
2871
+ if (!We) {
2899
2872
  l(t("users.no_token"));
2900
2873
  return;
2901
2874
  }
2902
- await navigator.clipboard.writeText(Qe), alert(t("users.token_copied"));
2903
- } catch (ue) {
2904
- l(ue instanceof Error ? ue.message : t("error_loading"));
2875
+ await navigator.clipboard.writeText(We), alert(t("users.token_copied"));
2876
+ } catch (ce) {
2877
+ l(ce instanceof Error ? ce.message : t("error_loading"));
2905
2878
  }
2906
- }, ie = () => {
2879
+ }, De = () => {
2907
2880
  v(null), L(!0);
2908
- }, Ie = (J) => {
2881
+ }, dt = (J) => {
2909
2882
  v(J), L(!0);
2910
- }, We = () => {
2883
+ }, He = () => {
2911
2884
  L(!1), v(null);
2912
2885
  };
2913
2886
  return /* @__PURE__ */ r("div", { className: "h-full flex flex-col p-5 overflow-hidden gap-4", dir: o ? "rtl" : "ltr", children: [
@@ -2937,14 +2910,14 @@ function fr() {
2937
2910
  ]
2938
2911
  }
2939
2912
  ),
2940
- /* @__PURE__ */ e("div", { className: "glass-surface px-4 py-2.5 rounded-xl text-xs font-medium text-muted-foreground border border-border shadow-sm", children: t("users.user_count", { count: ce }) }),
2913
+ /* @__PURE__ */ e("div", { className: "glass-surface px-4 py-2.5 rounded-xl text-xs font-medium text-muted-foreground border border-border shadow-sm", children: t("users.user_count", { count: de }) }),
2941
2914
  /* @__PURE__ */ r(
2942
2915
  "button",
2943
2916
  {
2944
- onClick: () => j(!0),
2917
+ onClick: () => q(!0),
2945
2918
  className: "px-4 py-2.5 bg-secondary text-secondary-foreground border border-border rounded-xl text-sm font-semibold hover:bg-secondary/80 transition-all shadow-sm whitespace-nowrap inline-flex items-center gap-2",
2946
2919
  children: [
2947
- /* @__PURE__ */ e(At, { className: "w-4 h-4" }),
2920
+ /* @__PURE__ */ e(jt, { className: "w-4 h-4" }),
2948
2921
  t("users.bulk_balance")
2949
2922
  ]
2950
2923
  }
@@ -2952,7 +2925,7 @@ function fr() {
2952
2925
  /* @__PURE__ */ e(
2953
2926
  "button",
2954
2927
  {
2955
- onClick: ie,
2928
+ onClick: De,
2956
2929
  className: "px-4 py-2.5 bg-primary text-primary-foreground rounded-xl text-sm font-semibold hover:opacity-90 transition-all shadow-sm hover:shadow-md whitespace-nowrap",
2957
2930
  children: t("users.add_user")
2958
2931
  }
@@ -2960,71 +2933,71 @@ function fr() {
2960
2933
  ] })
2961
2934
  ] })
2962
2935
  ] }),
2963
- /* @__PURE__ */ e(gr, { user: Z, onClose: () => k(null), onError: l }),
2964
- q && /* @__PURE__ */ e(lr, { message: q, onDismiss: () => l("") }),
2936
+ /* @__PURE__ */ e(hr, { user: Z, onClose: () => k(null), onError: l }),
2937
+ j && /* @__PURE__ */ e(or, { message: j, onDismiss: () => l("") }),
2965
2938
  m && /* @__PURE__ */ e(
2966
- pr,
2939
+ mr,
2967
2940
  {
2968
2941
  searchQuery: g,
2969
2942
  userMetadataFields: I,
2970
2943
  onClose: () => {
2971
- j(!1), l("");
2944
+ q(!1), l("");
2972
2945
  },
2973
2946
  onApplied: () => {
2974
- j(!1), Q();
2947
+ q(!1), K();
2975
2948
  },
2976
2949
  onError: l
2977
2950
  }
2978
2951
  ),
2979
2952
  C && /* @__PURE__ */ e(
2980
- ur,
2953
+ dr,
2981
2954
  {
2982
2955
  editingUser: $,
2983
2956
  appSettings: p,
2984
2957
  userMetadataFields: I,
2985
- onClose: We,
2958
+ onClose: He,
2986
2959
  onSaved: () => {
2987
- Q(), We();
2960
+ K(), He();
2988
2961
  },
2989
2962
  onError: l
2990
2963
  }
2991
2964
  ),
2992
2965
  O && /* @__PURE__ */ e(
2993
- mr,
2966
+ cr,
2994
2967
  {
2995
2968
  user: O,
2996
2969
  onClose: () => {
2997
2970
  P(null), l("");
2998
2971
  },
2999
2972
  onSaved: () => {
3000
- Q(), P(null);
2973
+ K(), P(null);
3001
2974
  },
3002
2975
  onError: l
3003
2976
  }
3004
2977
  ),
3005
2978
  /* @__PURE__ */ e(
3006
- dr,
2979
+ ir,
3007
2980
  {
3008
- users: V,
3009
- loading: ve,
3010
- totalCount: ce,
2981
+ users: B,
2982
+ loading: xe,
2983
+ totalCount: de,
3011
2984
  userMetadataFields: I,
3012
2985
  sortBy: x,
3013
2986
  sortOrder: b,
3014
- onSort: B,
3015
- onLoadMore: () => f((J) => J + Re),
2987
+ onSort: V,
2988
+ onLoadMore: () => f((J) => J + Ie),
3016
2989
  onUsage: k,
3017
- onEdit: Ie,
2990
+ onEdit: dt,
3018
2991
  onRecharge: (J) => {
3019
2992
  P(J), l("");
3020
2993
  },
3021
- onCopyToken: he,
2994
+ onCopyToken: pe,
3022
2995
  onDelete: G
3023
2996
  }
3024
2997
  )
3025
2998
  ] });
3026
2999
  }
3027
- function we(t, a, s) {
3000
+ function Ne(t, a, s) {
3028
3001
  const d = [], o = /* @__PURE__ */ new Date(), n = t || [], l = new Map(n.map((g) => [g.date, g]));
3029
3002
  for (let g = a - 1; g >= 0; g--) {
3030
3003
  const S = new Date(o.getTime() - g * 24 * 60 * 60 * 1e3).toISOString().split("T")[0];
@@ -3037,13 +3010,13 @@ function we(t, a, s) {
3037
3010
  }
3038
3011
  return d;
3039
3012
  }
3040
- function br() {
3013
+ function gr() {
3041
3014
  const { t, i18n: a } = F(["admin", "translation"]), [s, d] = y(30), [o, n] = y("human"), {
3042
3015
  data: l,
3043
3016
  isLoading: g,
3044
3017
  error: _,
3045
3018
  refetch: S
3046
- } = Xt(s, o), [w, x] = y({}), i = at({}), b = a.language === "fa", h = b ? "fa-IR" : "en-US", N = b ? "fa-IR-u-ca-persian" : "en-US", D = _ ? _ instanceof Error ? _.message : t("analytics.error_loading") : "", p = ge(() => {
3019
+ } = Gt(s, o), [w, x] = y({}), i = tt({}), b = a.language === "fa", h = b ? "fa-IR" : "en-US", N = b ? "fa-IR-u-ca-persian" : "en-US", D = _ ? _ instanceof Error ? _.message : t("analytics.error_loading") : "", p = he(() => {
3047
3020
  if (!l) return null;
3048
3021
  const m = l;
3049
3022
  return {
@@ -3060,10 +3033,10 @@ function br() {
3060
3033
  },
3061
3034
  trends: {
3062
3035
  ...m.trends || {},
3063
- users: we(m.trends?.users, s, ["count"]),
3064
- threads: we(m.trends?.threads, s, ["count"]),
3065
- messages: we(m.trends?.messages, s, ["count"]),
3066
- token_usage: we(m.trends?.token_usage, s, [
3036
+ users: Ne(m.trends?.users, s, ["count"]),
3037
+ threads: Ne(m.trends?.threads, s, ["count"]),
3038
+ messages: Ne(m.trends?.messages, s, ["count"]),
3039
+ token_usage: Ne(m.trends?.token_usage, s, [
3067
3040
  "input_tokens",
3068
3041
  "output_tokens",
3069
3042
  "requests",
@@ -3083,43 +3056,43 @@ function br() {
3083
3056
  (A) => !!A[1]
3084
3057
  );
3085
3058
  if (m.length === 0) return;
3086
- const j = new ResizeObserver((A) => {
3087
- for (const Q of A) {
3088
- const M = Q.target.dataset.chartId;
3059
+ const q = new ResizeObserver((A) => {
3060
+ for (const K of A) {
3061
+ const M = K.target.dataset.chartId;
3089
3062
  M && x((z) => ({
3090
3063
  ...z,
3091
- [M]: Q.contentRect.width
3064
+ [M]: K.contentRect.width
3092
3065
  }));
3093
3066
  }
3094
3067
  });
3095
- return m.forEach(([, A]) => j.observe(A)), () => j.disconnect();
3068
+ return m.forEach(([, A]) => q.observe(A)), () => q.disconnect();
3096
3069
  }, [p]);
3097
- const R = (m) => (j) => {
3098
- i.current[m] = j;
3099
- }, u = (m, j = 0) => {
3070
+ const R = (m) => (q) => {
3071
+ i.current[m] = q;
3072
+ }, c = (m, q = 0) => {
3100
3073
  if (!m || m.length === 0) return null;
3101
- const A = m.length, Q = new Intl.DateTimeFormat(N, { month: "short" });
3074
+ const A = m.length, K = new Intl.DateTimeFormat(N, { month: "short" });
3102
3075
  let M = [];
3103
3076
  if (s <= 14)
3104
- M = Array.from({ length: A }, (z, K) => K);
3077
+ M = Array.from({ length: A }, (z, Q) => Q);
3105
3078
  else {
3106
- const z = b ? 45 : 35, K = j > 0 ? Math.floor(j / z) : 6, W = Math.max(1, Math.ceil(A / Math.max(1, K)));
3107
- for (let V = 0; V < A; V += W)
3108
- M.push(V);
3079
+ const z = b ? 45 : 35, Q = q > 0 ? Math.floor(q / z) : 6, W = Math.max(1, Math.ceil(A / Math.max(1, Q)));
3080
+ for (let B = 0; B < A; B += W)
3081
+ M.push(B);
3109
3082
  M.length > 0 && M[M.length - 1] !== A - 1 && (A - 1 - M[M.length - 1] > W / 2 ? M.push(A - 1) : M[M.length - 1] = A - 1);
3110
3083
  }
3111
3084
  return /* @__PURE__ */ e("div", { className: "relative w-full h-8 mt-2", dir: b ? "rtl" : "ltr", children: M.map((z) => {
3112
- const K = m[z];
3113
- if (!K) return null;
3114
- const W = new Date(K.date), V = W.toLocaleDateString(N, { day: "numeric" }), ce = Q.format(W), ve = A > 1 ? z / (A - 1) * 100 : 50;
3085
+ const Q = m[z];
3086
+ if (!Q) return null;
3087
+ const W = new Date(Q.date), B = W.toLocaleDateString(N, { day: "numeric" }), de = K.format(W), xe = A > 1 ? z / (A - 1) * 100 : 50;
3115
3088
  return /* @__PURE__ */ r(
3116
3089
  "div",
3117
3090
  {
3118
3091
  className: "absolute top-0 transform -translate-x-1/2 flex flex-col items-center",
3119
- style: { left: `${ve}%` },
3092
+ style: { left: `${xe}%` },
3120
3093
  children: [
3121
- /* @__PURE__ */ e("span", { className: "text-[10px] text-gray-600 dark:text-gray-400 font-medium leading-none", children: V }),
3122
- /* @__PURE__ */ e("span", { className: "text-[9px] text-gray-400 dark:text-gray-500 mt-1 leading-none whitespace-nowrap", children: ce })
3094
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-gray-600 dark:text-gray-400 font-medium leading-none", children: B }),
3095
+ /* @__PURE__ */ e("span", { className: "text-[9px] text-gray-400 dark:text-gray-500 mt-1 leading-none whitespace-nowrap", children: de })
3123
3096
  ]
3124
3097
  },
3125
3098
  z
@@ -3143,9 +3116,9 @@ function br() {
3143
3116
  if (!p) return null;
3144
3117
  const f = (m) => {
3145
3118
  if (m <= 0) return 10;
3146
- const j = m * 1.15, A = Math.pow(10, Math.floor(Math.log10(j))), Q = j / A;
3119
+ const q = m * 1.15, A = Math.pow(10, Math.floor(Math.log10(q))), K = q / A;
3147
3120
  let M;
3148
- return Q <= 1.2 ? M = 0.2 : Q <= 2.5 ? M = 0.5 : Q <= 5 ? M = 1 : M = 2, Math.ceil(j / (M * A)) * (M * A);
3121
+ return K <= 1.2 ? M = 0.2 : K <= 2.5 ? M = 0.5 : K <= 5 ? M = 1 : M = 2, Math.ceil(q / (M * A)) * (M * A);
3149
3122
  }, C = Math.max(...p.trends.threads.map((m) => m.count) || [1]), L = Math.max(...p.trends.messages.map((m) => m.count) || [1]), $ = Math.max(
3150
3123
  ...p.trends.token_usage.map((m) => (m.input_tokens || 0) + (m.output_tokens || 0)) || [1]
3151
3124
  ), v = Math.max(
@@ -3278,12 +3251,12 @@ function br() {
3278
3251
  "p",
3279
3252
  {
3280
3253
  className: "text-sm font-medium text-foreground",
3281
- title: pe(
3254
+ title: me(
3282
3255
  p.overview.total_cost_microunits,
3283
3256
  p.overview.currency,
3284
3257
  h
3285
3258
  ),
3286
- children: pe(
3259
+ children: me(
3287
3260
  p.overview.total_cost_microunits,
3288
3261
  p.overview.currency,
3289
3262
  h
@@ -3334,7 +3307,7 @@ function br() {
3334
3307
  /* @__PURE__ */ e("div", { className: "absolute top-6 left-0 right-0 border-t border-border/30 w-full" }),
3335
3308
  /* @__PURE__ */ e("div", { className: "absolute top-[calc(50%-4px)] left-0 right-0 border-t border-border/30 w-full" })
3336
3309
  ] }),
3337
- p.trends.threads.length > 0 ? p.trends.threads.map((m, j) => /* @__PURE__ */ e(
3310
+ p.trends.threads.length > 0 ? p.trends.threads.map((m, q) => /* @__PURE__ */ e(
3338
3311
  "div",
3339
3312
  {
3340
3313
  className: "w-1.5 group relative flex flex-col justify-end h-full",
@@ -3353,13 +3326,13 @@ function br() {
3353
3326
  }
3354
3327
  )
3355
3328
  },
3356
- j
3329
+ q
3357
3330
  )) : /* @__PURE__ */ e("p", { className: "w-full text-center text-muted-foreground py-8", children: t("no_data") })
3358
3331
  ] })
3359
3332
  ] }),
3360
3333
  /* @__PURE__ */ r("div", { className: "flex gap-2", dir: "ltr", children: [
3361
3334
  /* @__PURE__ */ e("div", { className: "min-w-[24px] invisible" }),
3362
- u(p.trends.threads, w.threads)
3335
+ c(p.trends.threads, w.threads)
3363
3336
  ] })
3364
3337
  ]
3365
3338
  }
@@ -3385,7 +3358,7 @@ function br() {
3385
3358
  /* @__PURE__ */ e("div", { className: "absolute top-6 left-0 right-0 border-t border-border/30 w-full" }),
3386
3359
  /* @__PURE__ */ e("div", { className: "absolute top-[calc(50%-4px)] left-0 right-0 border-t border-border/30 w-full" })
3387
3360
  ] }),
3388
- p.trends.messages.length > 0 ? p.trends.messages.map((m, j) => /* @__PURE__ */ e(
3361
+ p.trends.messages.length > 0 ? p.trends.messages.map((m, q) => /* @__PURE__ */ e(
3389
3362
  "div",
3390
3363
  {
3391
3364
  className: "w-1.5 group relative flex flex-col justify-end h-full",
@@ -3404,13 +3377,13 @@ function br() {
3404
3377
  }
3405
3378
  )
3406
3379
  },
3407
- j
3380
+ q
3408
3381
  )) : /* @__PURE__ */ e("p", { className: "w-full text-center text-muted-foreground py-8", children: t("no_data") })
3409
3382
  ] })
3410
3383
  ] }),
3411
3384
  /* @__PURE__ */ r("div", { className: "flex gap-2", dir: "ltr", children: [
3412
3385
  /* @__PURE__ */ e("div", { className: "min-w-[24px] invisible" }),
3413
- u(p.trends.messages, w.messages)
3386
+ c(p.trends.messages, w.messages)
3414
3387
  ] })
3415
3388
  ]
3416
3389
  }
@@ -3436,7 +3409,7 @@ function br() {
3436
3409
  /* @__PURE__ */ e("div", { className: "absolute top-6 left-0 right-0 border-t border-border/30 w-full" }),
3437
3410
  /* @__PURE__ */ e("div", { className: "absolute top-[calc(50%-4px)] left-0 right-0 border-t border-border/30 w-full" })
3438
3411
  ] }),
3439
- p.trends.token_usage.length > 0 ? p.trends.token_usage.map((m, j) => {
3412
+ p.trends.token_usage.length > 0 ? p.trends.token_usage.map((m, q) => {
3440
3413
  const A = (m.input_tokens || 0) + (m.output_tokens || 0);
3441
3414
  return /* @__PURE__ */ e(
3442
3415
  "div",
@@ -3457,14 +3430,14 @@ function br() {
3457
3430
  }
3458
3431
  )
3459
3432
  },
3460
- j
3433
+ q
3461
3434
  );
3462
3435
  }) : /* @__PURE__ */ e("p", { className: "w-full text-center text-muted-foreground py-8", children: t("no_data") })
3463
3436
  ] })
3464
3437
  ] }),
3465
3438
  /* @__PURE__ */ r("div", { className: "flex gap-2", dir: "ltr", children: [
3466
3439
  /* @__PURE__ */ e("div", { className: "min-w-[24px] invisible" }),
3467
- u(p.trends.token_usage, w["token-usage"])
3440
+ c(p.trends.token_usage, w["token-usage"])
3468
3441
  ] })
3469
3442
  ]
3470
3443
  }
@@ -3481,24 +3454,24 @@ function br() {
3481
3454
  children: [
3482
3455
  /* @__PURE__ */ r("div", { className: "flex-1 flex gap-2 min-h-0", dir: "ltr", children: [
3483
3456
  /* @__PURE__ */ r("div", { className: "flex flex-col justify-between text-[10px] text-muted-foreground pt-6 text-right min-w-[70px]", children: [
3484
- /* @__PURE__ */ e("span", { children: pe(
3457
+ /* @__PURE__ */ e("span", { children: me(
3485
3458
  k || 0,
3486
3459
  p.overview.currency,
3487
3460
  h
3488
3461
  ) }),
3489
- /* @__PURE__ */ e("span", { children: pe(
3462
+ /* @__PURE__ */ e("span", { children: me(
3490
3463
  Math.floor((k || 0) / 2),
3491
3464
  p.overview.currency,
3492
3465
  h
3493
3466
  ) }),
3494
- /* @__PURE__ */ e("span", { children: pe(0, p.overview.currency, h) })
3467
+ /* @__PURE__ */ e("span", { children: me(0, p.overview.currency, h) })
3495
3468
  ] }),
3496
3469
  /* @__PURE__ */ r("div", { className: "flex-1 relative flex items-end justify-between pt-6 border-b border-border/30", children: [
3497
3470
  /* @__PURE__ */ r("div", { className: "absolute inset-0 pt-6 pointer-events-none", children: [
3498
3471
  /* @__PURE__ */ e("div", { className: "absolute top-6 left-0 right-0 border-t border-border/30 w-full" }),
3499
3472
  /* @__PURE__ */ e("div", { className: "absolute top-[calc(50%-4px)] left-0 right-0 border-t border-border/30 w-full" })
3500
3473
  ] }),
3501
- p.trends.token_usage.length > 0 ? p.trends.token_usage.map((m, j) => /* @__PURE__ */ e(
3474
+ p.trends.token_usage.length > 0 ? p.trends.token_usage.map((m, q) => /* @__PURE__ */ e(
3502
3475
  "div",
3503
3476
  {
3504
3477
  className: "w-1.5 group relative flex flex-col justify-end h-full",
@@ -3510,7 +3483,7 @@ function br() {
3510
3483
  height: `${(m.cost_microunits || 0) / k * 100}%`
3511
3484
  },
3512
3485
  children: /* @__PURE__ */ r("div", { className: "absolute bottom-full mb-1 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-card px-2 py-1 rounded border border-border shadow-sm z-20 pointer-events-none flex flex-col items-center", children: [
3513
- /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-emerald-500 leading-none mb-0.5", children: pe(
3486
+ /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-emerald-500 leading-none mb-0.5", children: me(
3514
3487
  m.cost_microunits || 0,
3515
3488
  p.overview.currency,
3516
3489
  h
@@ -3523,13 +3496,13 @@ function br() {
3523
3496
  }
3524
3497
  )
3525
3498
  },
3526
- j
3499
+ q
3527
3500
  )) : /* @__PURE__ */ e("p", { className: "w-full text-center text-muted-foreground py-8", children: t("no_data") })
3528
3501
  ] })
3529
3502
  ] }),
3530
3503
  /* @__PURE__ */ r("div", { className: "flex gap-2", dir: "ltr", children: [
3531
3504
  /* @__PURE__ */ e("div", { className: "min-w-[70px] invisible" }),
3532
- u(p.trends.token_usage, w.cost)
3505
+ c(p.trends.token_usage, w.cost)
3533
3506
  ] })
3534
3507
  ]
3535
3508
  }
@@ -3543,11 +3516,11 @@ function br() {
3543
3516
  /* @__PURE__ */ r("div", { className: "relative w-56 h-56 lg:w-60 lg:h-60", children: [
3544
3517
  /* @__PURE__ */ e("svg", { viewBox: "0 0 100 100", className: "w-full h-full -rotate-90 drop-shadow-md", children: (() => {
3545
3518
  const m = p.distributions.feedback_sentiment.filter(
3546
- (V) => V.sentiment === "positive" || V.sentiment === "negative"
3547
- ), j = m.reduce((V, ce) => V + ce.count, 0);
3548
- if (j === 0) return null;
3549
- const A = m.find((V) => V.sentiment === "positive")?.count || 0, Q = m.find((V) => V.sentiment === "negative")?.count || 0, M = 40, z = 2 * Math.PI * M, K = A / j * 100, W = Q / j * 100;
3550
- return /* @__PURE__ */ r(rt, { children: [
3519
+ (B) => B.sentiment === "positive" || B.sentiment === "negative"
3520
+ ), q = m.reduce((B, de) => B + de.count, 0);
3521
+ if (q === 0) return null;
3522
+ const A = m.find((B) => B.sentiment === "positive")?.count || 0, K = m.find((B) => B.sentiment === "negative")?.count || 0, M = 40, z = 2 * Math.PI * M, Q = A / q * 100, W = K / q * 100;
3523
+ return /* @__PURE__ */ r(et, { children: [
3551
3524
  /* @__PURE__ */ e(
3552
3525
  "circle",
3553
3526
  {
@@ -3579,8 +3552,8 @@ function br() {
3579
3552
  fill: "transparent",
3580
3553
  stroke: "url(#posGradient)",
3581
3554
  strokeWidth: "10",
3582
- strokeDasharray: `${K / 100 * z} ${z}`,
3583
- strokeLinecap: K > 0 ? "round" : "butt",
3555
+ strokeDasharray: `${Q / 100 * z} ${z}`,
3556
+ strokeLinecap: Q > 0 ? "round" : "butt",
3584
3557
  className: "transition-all duration-1000 ease-out drop-shadow-sm"
3585
3558
  }
3586
3559
  ),
@@ -3594,7 +3567,7 @@ function br() {
3594
3567
  stroke: "url(#negGradient)",
3595
3568
  strokeWidth: "10",
3596
3569
  strokeDasharray: `${W / 100 * z} ${z}`,
3597
- strokeDashoffset: -(K / 100 * z),
3570
+ strokeDashoffset: -(Q / 100 * z),
3598
3571
  strokeLinecap: W > 0 ? "round" : "butt",
3599
3572
  className: "transition-all duration-1000 ease-out drop-shadow-sm"
3600
3573
  }
@@ -3602,16 +3575,16 @@ function br() {
3602
3575
  ] });
3603
3576
  })() }),
3604
3577
  /* @__PURE__ */ r("div", { className: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none", children: [
3605
- /* @__PURE__ */ e("span", { className: "text-3xl lg:text-4xl font-light text-foreground", children: p.distributions.feedback_sentiment.filter((m) => m.sentiment === "positive" || m.sentiment === "negative").reduce((m, j) => m + (j.count || 0), 0).toLocaleString(h) }),
3578
+ /* @__PURE__ */ e("span", { className: "text-3xl lg:text-4xl font-light text-foreground", children: p.distributions.feedback_sentiment.filter((m) => m.sentiment === "positive" || m.sentiment === "negative").reduce((m, q) => m + (q.count || 0), 0).toLocaleString(h) }),
3606
3579
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground uppercase tracking-widest mt-1", children: t("analytics.total_feedback") })
3607
3580
  ] })
3608
3581
  ] }),
3609
3582
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-4 min-w-[140px]", children: [...p.distributions.feedback_sentiment].filter(
3610
3583
  (m) => m.sentiment === "positive" || m.sentiment === "negative"
3611
- ).sort((m, j) => m.sentiment === "positive" ? -1 : 1).map((m) => {
3584
+ ).sort((m, q) => m.sentiment === "positive" ? -1 : 1).map((m) => {
3612
3585
  const A = p.distributions.feedback_sentiment.filter(
3613
3586
  (W) => W.sentiment === "positive" || W.sentiment === "negative"
3614
- ).reduce((W, V) => W + V.count, 0), Q = A > 0 ? m.count / A * 100 : 0, M = m.sentiment === "positive" ? t("analytics.positive") : t("analytics.negative"), z = m.sentiment === "positive" ? "bg-primary" : "bg-destructive", K = m.sentiment === "positive" ? "👍" : "👎";
3587
+ ).reduce((W, B) => W + B.count, 0), K = A > 0 ? m.count / A * 100 : 0, M = m.sentiment === "positive" ? t("analytics.positive") : t("analytics.negative"), z = m.sentiment === "positive" ? "bg-primary" : "bg-destructive", Q = m.sentiment === "positive" ? "👍" : "👎";
3615
3588
  return /* @__PURE__ */ r(
3616
3589
  "div",
3617
3590
  {
@@ -3627,12 +3600,12 @@ function br() {
3627
3600
  /* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground font-medium", children: [
3628
3601
  M,
3629
3602
  " ",
3630
- K
3603
+ Q
3631
3604
  ] })
3632
3605
  ] }),
3633
3606
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
3634
3607
  /* @__PURE__ */ r("span", { className: "text-sm font-semibold text-foreground bg-muted/50 px-2.5 py-1 rounded-lg min-w-[50px] text-center", children: [
3635
- (Q || 0).toLocaleString(h, {
3608
+ (K || 0).toLocaleString(h, {
3636
3609
  maximumFractionDigits: 0
3637
3610
  }),
3638
3611
  "%"
@@ -3674,7 +3647,7 @@ function br() {
3674
3647
  ] })
3675
3648
  ] });
3676
3649
  }
3677
- function _e({ title: t, icon: a }) {
3650
+ function ye({ title: t, icon: a }) {
3678
3651
  return /* @__PURE__ */ r("div", { className: "relative py-12", children: [
3679
3652
  /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center", "aria-hidden": "true", children: /* @__PURE__ */ e("div", { className: "w-full border-t border-border/60" }) }),
3680
3653
  /* @__PURE__ */ e("div", { className: "relative flex justify-center", children: /* @__PURE__ */ r("span", { className: "bg-background px-6 text-sm font-bold text-muted-foreground uppercase tracking-[0.2em] flex items-center gap-3", children: [
@@ -3683,7 +3656,7 @@ function _e({ title: t, icon: a }) {
3683
3656
  ] }) })
3684
3657
  ] });
3685
3658
  }
3686
- function ye({ value: t }) {
3659
+ function ve({ value: t }) {
3687
3660
  const { t: a } = F(["admin", "translation", "settings"]);
3688
3661
  if (!t || !t.includes(":") && !t.includes(".")) return null;
3689
3662
  const s = a(t);
@@ -3695,7 +3668,7 @@ function ye({ value: t }) {
3695
3668
  /* @__PURE__ */ e("span", { className: "text-[11px] font-medium text-foreground/70", children: s })
3696
3669
  ] });
3697
3670
  }
3698
- function xr({
3671
+ function fr({
3699
3672
  settings: t,
3700
3673
  setSettings: a,
3701
3674
  accentValue: s,
@@ -3703,7 +3676,7 @@ function xr({
3703
3676
  }) {
3704
3677
  const { t: o } = F(["admin", "translation", "settings"]);
3705
3678
  return /* @__PURE__ */ r("section", { children: [
3706
- /* @__PURE__ */ e(_e, { title: o("app_settings.sections.general"), icon: Pe }),
3679
+ /* @__PURE__ */ e(ye, { title: o("app_settings.sections.general"), icon: Fe }),
3707
3680
  /* @__PURE__ */ r("div", { className: "p-2 space-y-10", children: [
3708
3681
  /* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-10", children: [
3709
3682
  /* @__PURE__ */ r("div", { className: "space-y-2", children: [
@@ -3719,7 +3692,7 @@ function xr({
3719
3692
  dir: "auto"
3720
3693
  }
3721
3694
  ),
3722
- /* @__PURE__ */ e(ye, { value: t.app_name })
3695
+ /* @__PURE__ */ e(ve, { value: t.app_name })
3723
3696
  ] }),
3724
3697
  /* @__PURE__ */ r("div", { className: "space-y-2", children: [
3725
3698
  /* @__PURE__ */ e(U, { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground/60 ml-1", children: o("app_settings.general.admin_title") }),
@@ -3734,7 +3707,7 @@ function xr({
3734
3707
  dir: "auto"
3735
3708
  }
3736
3709
  ),
3737
- /* @__PURE__ */ e(ye, { value: t.admin_title || "" })
3710
+ /* @__PURE__ */ e(ve, { value: t.admin_title || "" })
3738
3711
  ] })
3739
3712
  ] }),
3740
3713
  /* @__PURE__ */ r("div", { className: "space-y-2", children: [
@@ -3754,13 +3727,13 @@ function xr({
3754
3727
  }
3755
3728
  ),
3756
3729
  /* @__PURE__ */ r("p", { className: "mt-3 text-[10px] text-muted-foreground/50 italic flex items-center gap-1.5 ml-1", children: [
3757
- /* @__PURE__ */ e(st, { className: "size-3" }),
3730
+ /* @__PURE__ */ e(at, { className: "size-3" }),
3758
3731
  o("app_settings.general.language_help")
3759
3732
  ] })
3760
3733
  ] }),
3761
3734
  /* @__PURE__ */ r("div", { className: "space-y-5 rounded-2xl border border-border/50 bg-muted/10 p-5", children: [
3762
3735
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
3763
- /* @__PURE__ */ e(Dt, { className: "size-4 text-primary" }),
3736
+ /* @__PURE__ */ e(Tt, { className: "size-4 text-primary" }),
3764
3737
  /* @__PURE__ */ r("div", { children: [
3765
3738
  /* @__PURE__ */ e("h3", { className: "text-sm font-bold text-foreground/80", children: o("app_settings.general.appearance") }),
3766
3739
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: o("app_settings.general.appearance_help") })
@@ -3827,7 +3800,7 @@ function xr({
3827
3800
  ] })
3828
3801
  ] });
3829
3802
  }
3830
- function le({
3803
+ function ie({
3831
3804
  title: t,
3832
3805
  help: a,
3833
3806
  checked: s,
@@ -3837,7 +3810,7 @@ function le({
3837
3810
  return /* @__PURE__ */ r(
3838
3811
  "div",
3839
3812
  {
3840
- className: Ce(
3813
+ className: ke(
3841
3814
  "p-5 border border-border/40 rounded-2xl flex items-center justify-between hover:bg-muted/5 transition-colors",
3842
3815
  o
3843
3816
  ),
@@ -3846,12 +3819,12 @@ function le({
3846
3819
  /* @__PURE__ */ e("p", { className: "text-xs font-bold text-foreground/80", children: t }),
3847
3820
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground/60 leading-relaxed mt-1", children: a })
3848
3821
  ] }),
3849
- /* @__PURE__ */ e(de, { checked: s, onCheckedChange: d })
3822
+ /* @__PURE__ */ e(le, { checked: s, onCheckedChange: d })
3850
3823
  ]
3851
3824
  }
3852
3825
  );
3853
3826
  }
3854
- function Me({
3827
+ function Re({
3855
3828
  title: t,
3856
3829
  fields: a,
3857
3830
  values: s,
@@ -3898,7 +3871,7 @@ function Me({
3898
3871
  )
3899
3872
  ] });
3900
3873
  }
3901
- function vr({
3874
+ function br({
3902
3875
  settings: t,
3903
3876
  setSettings: a,
3904
3877
  userMetadataFields: s,
@@ -3906,7 +3879,7 @@ function vr({
3906
3879
  }) {
3907
3880
  const { t: o } = F(["admin", "translation", "settings"]);
3908
3881
  return /* @__PURE__ */ r("section", { children: [
3909
- /* @__PURE__ */ e(_e, { title: o("app_settings.sections.chat"), icon: It }),
3882
+ /* @__PURE__ */ e(ye, { title: o("app_settings.sections.chat"), icon: At }),
3910
3883
  /* @__PURE__ */ r("div", { className: "p-2 space-y-10", children: [
3911
3884
  /* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-10", children: [
3912
3885
  /* @__PURE__ */ r("div", { className: "space-y-2", children: [
@@ -3922,7 +3895,7 @@ function vr({
3922
3895
  dir: "auto"
3923
3896
  }
3924
3897
  ),
3925
- /* @__PURE__ */ e(ye, { value: t.welcome_greeting || "" })
3898
+ /* @__PURE__ */ e(ve, { value: t.welcome_greeting || "" })
3926
3899
  ] }),
3927
3900
  /* @__PURE__ */ r("div", { className: "space-y-2", children: [
3928
3901
  /* @__PURE__ */ e(U, { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground/60 ml-1", children: o("app_settings.chat.welcome_subtitle") }),
@@ -3936,13 +3909,13 @@ function vr({
3936
3909
  dir: "auto"
3937
3910
  }
3938
3911
  ),
3939
- /* @__PURE__ */ e(ye, { value: t.welcome_subtitle || "" })
3912
+ /* @__PURE__ */ e(ve, { value: t.welcome_subtitle || "" })
3940
3913
  ] })
3941
3914
  ] }),
3942
3915
  /* @__PURE__ */ r("div", { className: "space-y-2", children: [
3943
3916
  /* @__PURE__ */ e(U, { className: "text-xs font-bold uppercase tracking-widest text-muted-foreground/60 ml-1", children: o("app_settings.chat.disclaimer") }),
3944
3917
  /* @__PURE__ */ e(
3945
- De,
3918
+ Ae,
3946
3919
  {
3947
3920
  value: t.disclaimer || "",
3948
3921
  onChange: (n) => a({ ...t, disclaimer: n.target.value }),
@@ -3950,11 +3923,11 @@ function vr({
3950
3923
  dir: "auto"
3951
3924
  }
3952
3925
  ),
3953
- /* @__PURE__ */ e(ye, { value: t.disclaimer || "" })
3926
+ /* @__PURE__ */ e(ve, { value: t.disclaimer || "" })
3954
3927
  ] }),
3955
3928
  /* @__PURE__ */ r("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-6 pt-2", children: [
3956
3929
  /* @__PURE__ */ e(
3957
- le,
3930
+ ie,
3958
3931
  {
3959
3932
  title: o("app_settings.chat.show_tool_details"),
3960
3933
  help: o("app_settings.chat.show_tool_details_help"),
@@ -3963,7 +3936,7 @@ function vr({
3963
3936
  }
3964
3937
  ),
3965
3938
  /* @__PURE__ */ e(
3966
- le,
3939
+ ie,
3967
3940
  {
3968
3941
  title: o("app_settings.chat.show_settings"),
3969
3942
  help: o("app_settings.chat.show_settings_help"),
@@ -3972,7 +3945,7 @@ function vr({
3972
3945
  }
3973
3946
  ),
3974
3947
  /* @__PURE__ */ e(
3975
- le,
3948
+ ie,
3976
3949
  {
3977
3950
  title: o("app_settings.chat.show_version_in_settings"),
3978
3951
  help: o("app_settings.chat.show_version_in_settings_help"),
@@ -3981,7 +3954,7 @@ function vr({
3981
3954
  }
3982
3955
  ),
3983
3956
  /* @__PURE__ */ e(
3984
- le,
3957
+ ie,
3985
3958
  {
3986
3959
  title: o("app_settings.chat.disable_signup"),
3987
3960
  help: o("app_settings.chat.disable_signup_help"),
@@ -3990,7 +3963,7 @@ function vr({
3990
3963
  }
3991
3964
  ),
3992
3965
  /* @__PURE__ */ e(
3993
- le,
3966
+ ie,
3994
3967
  {
3995
3968
  title: o("app_settings.chat.disable_auth_page"),
3996
3969
  help: o("app_settings.chat.disable_auth_page_help"),
@@ -4000,7 +3973,7 @@ function vr({
4000
3973
  }
4001
3974
  ),
4002
3975
  /* @__PURE__ */ e(
4003
- le,
3976
+ ie,
4004
3977
  {
4005
3978
  title: o("app_settings.chat.composer_attachments"),
4006
3979
  help: o("app_settings.chat.composer_attachments_help"),
@@ -4009,7 +3982,7 @@ function vr({
4009
3982
  }
4010
3983
  ),
4011
3984
  /* @__PURE__ */ e(
4012
- le,
3985
+ ie,
4013
3986
  {
4014
3987
  title: o("app_settings.chat.thread_actions_feedback"),
4015
3988
  help: o("app_settings.chat.thread_actions_feedback_help"),
@@ -4018,7 +3991,7 @@ function vr({
4018
3991
  }
4019
3992
  ),
4020
3993
  /* @__PURE__ */ e(
4021
- le,
3994
+ ie,
4022
3995
  {
4023
3996
  title: o("app_settings.chat.thread_actions_retry"),
4024
3997
  help: o("app_settings.chat.thread_actions_retry_help"),
@@ -4027,7 +4000,7 @@ function vr({
4027
4000
  }
4028
4001
  ),
4029
4002
  /* @__PURE__ */ e(
4030
- le,
4003
+ ie,
4031
4004
  {
4032
4005
  title: o("app_settings.chat.history_enabled"),
4033
4006
  help: o("app_settings.chat.history_enabled_help"),
@@ -4040,7 +4013,7 @@ function vr({
4040
4013
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
4041
4014
  /* @__PURE__ */ e(U, { className: "text-xs font-medium text-foreground/70", children: o("app_settings.chat.history_show_delete") }),
4042
4015
  /* @__PURE__ */ e(
4043
- de,
4016
+ le,
4044
4017
  {
4045
4018
  checked: t.history_show_delete,
4046
4019
  onCheckedChange: (n) => a({ ...t, history_show_delete: n })
@@ -4050,7 +4023,7 @@ function vr({
4050
4023
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
4051
4024
  /* @__PURE__ */ e(U, { className: "text-xs font-medium text-foreground/70", children: o("app_settings.chat.history_show_rename") }),
4052
4025
  /* @__PURE__ */ e(
4053
- de,
4026
+ le,
4054
4027
  {
4055
4028
  checked: t.history_show_rename,
4056
4029
  onCheckedChange: (n) => a({ ...t, history_show_rename: n })
@@ -4060,7 +4033,7 @@ function vr({
4060
4033
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
4061
4034
  /* @__PURE__ */ e(U, { className: "text-xs font-medium text-foreground/70", children: o("app_settings.chat.history_show_share") }),
4062
4035
  /* @__PURE__ */ e(
4063
- de,
4036
+ le,
4064
4037
  {
4065
4038
  checked: t.history_show_share,
4066
4039
  onCheckedChange: (n) => a({ ...t, history_show_share: n })
@@ -4070,7 +4043,7 @@ function vr({
4070
4043
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
4071
4044
  /* @__PURE__ */ e(U, { className: "text-xs font-medium text-foreground/70", children: o("app_settings.chat.history_show_pin") }),
4072
4045
  /* @__PURE__ */ e(
4073
- de,
4046
+ le,
4074
4047
  {
4075
4048
  checked: t.history_show_pin,
4076
4049
  onCheckedChange: (n) => a({ ...t, history_show_pin: n })
@@ -4122,7 +4095,7 @@ function vr({
4122
4095
  ] }),
4123
4096
  /* @__PURE__ */ r("div", { className: "space-y-10", children: [
4124
4097
  /* @__PURE__ */ e(
4125
- Me,
4098
+ Re,
4126
4099
  {
4127
4100
  title: o("app_settings.chat.general_tab"),
4128
4101
  fields: [
@@ -4139,7 +4112,7 @@ function vr({
4139
4112
  }
4140
4113
  ),
4141
4114
  /* @__PURE__ */ e(
4142
- Me,
4115
+ Re,
4143
4116
  {
4144
4117
  title: o("app_settings.chat.profile_tab"),
4145
4118
  fields: [
@@ -4160,7 +4133,7 @@ function vr({
4160
4133
  }
4161
4134
  ),
4162
4135
  /* @__PURE__ */ e(
4163
- Me,
4136
+ Re,
4164
4137
  {
4165
4138
  title: o("app_settings.chat.account_tab"),
4166
4139
  fields: [
@@ -4180,8 +4153,8 @@ function vr({
4180
4153
  ] })
4181
4154
  ] });
4182
4155
  }
4183
- const $e = "I understand this runs arbitrary code";
4184
- function yr() {
4156
+ const Me = "I understand this runs arbitrary code";
4157
+ function xr() {
4185
4158
  try {
4186
4159
  const t = localStorage.getItem("admin_info");
4187
4160
  return t ? JSON.parse(t).permissions || [] : [];
@@ -4189,10 +4162,10 @@ function yr() {
4189
4162
  return [];
4190
4163
  }
4191
4164
  }
4192
- function ct(t) {
4165
+ function lt(t) {
4193
4166
  return t === "destructive" ? "bg-destructive/10 text-destructive border-destructive/20" : t === "caution" ? "bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/20" : "bg-muted/40 text-muted-foreground border-border/50";
4194
4167
  }
4195
- function _r(t) {
4168
+ function vr(t) {
4196
4169
  switch (t) {
4197
4170
  case "completed":
4198
4171
  return "bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20";
@@ -4204,8 +4177,8 @@ function _r(t) {
4204
4177
  return "bg-primary/10 text-primary border-primary/20";
4205
4178
  }
4206
4179
  }
4207
- function Nr({ job: t, onClose: a }) {
4208
- const { t: s } = F(["admin"]), { runRegisteredJob: d } = He(), [o, n] = y(() => {
4180
+ function yr({ job: t, onClose: a }) {
4181
+ const { t: s } = F(["admin"]), { runRegisteredJob: d } = Ve(), [o, n] = y(() => {
4209
4182
  const h = {};
4210
4183
  for (const N of t.params) {
4211
4184
  const D = N.default, p = typeof D == "string" || typeof D == "number" || typeof D == "boolean";
@@ -4224,9 +4197,9 @@ function Nr({ job: t, onClose: a }) {
4224
4197
  params: h,
4225
4198
  dry_run: l,
4226
4199
  confirm: w ? _ : void 0
4227
- }), be.success(s("jobs.run_started", { name: t.name })), a();
4200
+ }), fe.success(s("jobs.run_started", { name: t.name })), a();
4228
4201
  } catch (N) {
4229
- be.error(N instanceof Error ? N.message : s("jobs.run_failed"));
4202
+ fe.error(N instanceof Error ? N.message : s("jobs.run_failed"));
4230
4203
  }
4231
4204
  };
4232
4205
  return (
@@ -4235,17 +4208,17 @@ function Nr({ job: t, onClose: a }) {
4235
4208
  // close button positions itself with `rtl:` utilities that key off the RTL <body>
4236
4209
  // ancestor, so force it back to the right edge for this LTR island.
4237
4210
  /* @__PURE__ */ r(
4238
- qe,
4211
+ Le,
4239
4212
  {
4240
4213
  dir: "ltr",
4241
4214
  className: "max-w-lg text-left [&_[data-slot=dialog-close]]:!right-4 [&_[data-slot=dialog-close]]:!left-auto",
4242
4215
  children: [
4243
- /* @__PURE__ */ r(je, { className: "text-left", children: [
4244
- /* @__PURE__ */ r(Te, { className: "flex items-center gap-2", children: [
4216
+ /* @__PURE__ */ r(qe, { className: "text-left", children: [
4217
+ /* @__PURE__ */ r(je, { className: "flex items-center gap-2", children: [
4245
4218
  t.name,
4246
- /* @__PURE__ */ e(Le, { variant: "outline", className: ct(t.danger), children: s(`jobs.danger.${t.danger}`) })
4219
+ /* @__PURE__ */ e(Se, { variant: "outline", className: lt(t.danger), children: s(`jobs.danger.${t.danger}`) })
4247
4220
  ] }),
4248
- t.description && /* @__PURE__ */ e(Ae, { children: t.description })
4221
+ t.description && /* @__PURE__ */ e(Te, { children: t.description })
4249
4222
  ] }),
4250
4223
  /* @__PURE__ */ r("div", { className: "space-y-4 py-2", children: [
4251
4224
  t.params.map((h) => /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
@@ -4254,7 +4227,7 @@ function Nr({ job: t, onClose: a }) {
4254
4227
  h.required && /* @__PURE__ */ e("span", { className: "text-destructive ml-1", children: "*" })
4255
4228
  ] }),
4256
4229
  h.type === "bool" ? /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(
4257
- de,
4230
+ le,
4258
4231
  {
4259
4232
  checked: o[h.name] === "true",
4260
4233
  onCheckedChange: (N) => i(h.name, N ? "true" : "false")
@@ -4271,7 +4244,7 @@ function Nr({ job: t, onClose: a }) {
4271
4244
  ]
4272
4245
  }
4273
4246
  ) : h.type === "text" ? /* @__PURE__ */ e(
4274
- De,
4247
+ Ae,
4275
4248
  {
4276
4249
  value: o[h.name],
4277
4250
  onChange: (N) => i(h.name, N.target.value),
@@ -4294,11 +4267,11 @@ function Nr({ job: t, onClose: a }) {
4294
4267
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s("jobs.dry_run") }),
4295
4268
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground/70", children: s("jobs.dry_run_help") })
4296
4269
  ] }),
4297
- /* @__PURE__ */ e(de, { checked: l, onCheckedChange: g })
4270
+ /* @__PURE__ */ e(le, { checked: l, onCheckedChange: g })
4298
4271
  ] }),
4299
4272
  w && /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
4300
4273
  /* @__PURE__ */ r(U, { className: "text-xs font-bold text-destructive flex items-center gap-1.5", children: [
4301
- /* @__PURE__ */ e(Ot, { className: "size-3.5" }),
4274
+ /* @__PURE__ */ e(Mt, { className: "size-3.5" }),
4302
4275
  s("jobs.confirm_destructive", { name: t.name })
4303
4276
  ] }),
4304
4277
  /* @__PURE__ */ e(
@@ -4312,8 +4285,8 @@ function Nr({ job: t, onClose: a }) {
4312
4285
  )
4313
4286
  ] })
4314
4287
  ] }),
4315
- /* @__PURE__ */ r(Ue, { children: [
4316
- /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(ne, { variant: "ghost", children: s("cancel") }) }),
4288
+ /* @__PURE__ */ r(Je, { children: [
4289
+ /* @__PURE__ */ e(Ue, { asChild: !0, children: /* @__PURE__ */ e(ne, { variant: "ghost", children: s("cancel") }) }),
4317
4290
  /* @__PURE__ */ r(
4318
4291
  ne,
4319
4292
  {
@@ -4321,7 +4294,7 @@ function Nr({ job: t, onClose: a }) {
4321
4294
  onClick: b,
4322
4295
  disabled: !x || d.isPending,
4323
4296
  children: [
4324
- d.isPending ? /* @__PURE__ */ e(Ve, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(Be, { className: "size-4" }),
4297
+ d.isPending ? /* @__PURE__ */ e(Be, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(ze, { className: "size-4" }),
4325
4298
  s(l ? "jobs.run_dry" : "jobs.run")
4326
4299
  ]
4327
4300
  }
@@ -4332,7 +4305,7 @@ function Nr({ job: t, onClose: a }) {
4332
4305
  )
4333
4306
  );
4334
4307
  }
4335
- function wr({ run: t }) {
4308
+ function _r({ run: t }) {
4336
4309
  const { t: a } = F(["admin"]), s = t.params && Object.keys(t.params).length > 0;
4337
4310
  return /* @__PURE__ */ r("div", { className: "space-y-3 pt-3", dir: "ltr", children: [
4338
4311
  (s || t.code) && /* @__PURE__ */ r("div", { children: [
@@ -4354,8 +4327,8 @@ ${a("jobs.output_truncated")}` : ""
4354
4327
  ] })
4355
4328
  ] });
4356
4329
  }
4357
- function kr({ summary: t }) {
4358
- const { t: a, i18n: s } = F(["admin"]), [d, o] = y(!1), n = t.status === "queued" || t.status === "processing", { data: l } = sr(d ? t.id : null, n), { cancelJobRun: g } = He(), _ = l ?? t, S = new Intl.DateTimeFormat(s.language === "fa" ? "fa-IR" : void 0, {
4330
+ function Nr({ summary: t }) {
4331
+ const { t: a, i18n: s } = F(["admin"]), [d, o] = y(!1), n = t.status === "queued" || t.status === "processing", { data: l } = ar(d ? t.id : null, n), { cancelJobRun: g } = Ve(), _ = l ?? t, S = new Intl.DateTimeFormat(s.language === "fa" ? "fa-IR" : void 0, {
4359
4332
  dateStyle: "short",
4360
4333
  timeStyle: "short"
4361
4334
  });
@@ -4369,12 +4342,12 @@ function kr({ summary: t }) {
4369
4342
  children: [
4370
4343
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 min-w-0", children: [
4371
4344
  /* @__PURE__ */ e(
4372
- ot,
4345
+ nt,
4373
4346
  {
4374
4347
  className: `size-3.5 text-muted-foreground/60 shrink-0 transition-transform ${d ? "" : "-rotate-90"}`
4375
4348
  }
4376
4349
  ),
4377
- /* @__PURE__ */ e(Le, { variant: "outline", className: _r(_.status), children: a(`jobs.status.${_.status}`) }),
4350
+ /* @__PURE__ */ e(Se, { variant: "outline", className: vr(_.status), children: a(`jobs.status.${_.status}`) }),
4378
4351
  /* @__PURE__ */ e("span", { className: "text-sm truncate", children: _.name }),
4379
4352
  _.dry_run && /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground/60", children: [
4380
4353
  "(",
@@ -4389,8 +4362,8 @@ function kr({ summary: t }) {
4389
4362
  ]
4390
4363
  }
4391
4364
  ),
4392
- d && /* @__PURE__ */ e("div", { className: "px-3 pb-3", children: l ? /* @__PURE__ */ r(rt, { children: [
4393
- /* @__PURE__ */ e(wr, { run: _ }),
4365
+ d && /* @__PURE__ */ e("div", { className: "px-3 pb-3", children: l ? /* @__PURE__ */ r(et, { children: [
4366
+ /* @__PURE__ */ e(_r, { run: _ }),
4394
4367
  n && /* @__PURE__ */ r(
4395
4368
  ne,
4396
4369
  {
@@ -4400,34 +4373,34 @@ function kr({ summary: t }) {
4400
4373
  onClick: () => g.mutate(_.id),
4401
4374
  disabled: g.isPending,
4402
4375
  children: [
4403
- /* @__PURE__ */ e(Et, { className: "size-3.5" }),
4376
+ /* @__PURE__ */ e($t, { className: "size-3.5" }),
4404
4377
  a("jobs.cancel_run")
4405
4378
  ]
4406
4379
  }
4407
4380
  )
4408
4381
  ] }) : /* @__PURE__ */ r("div", { className: "flex items-center gap-2 py-4 text-xs text-muted-foreground/60", children: [
4409
- /* @__PURE__ */ e(Ve, { className: "size-3.5 animate-spin" }),
4382
+ /* @__PURE__ */ e(Be, { className: "size-3.5 animate-spin" }),
4410
4383
  a("loading")
4411
4384
  ] }) })
4412
4385
  ] });
4413
4386
  }
4414
- function Cr({ runs: t }) {
4387
+ function wr({ runs: t }) {
4415
4388
  const { t: a } = F(["admin"]);
4416
- return /* @__PURE__ */ r(qe, { className: "max-w-2xl", children: [
4417
- /* @__PURE__ */ r(je, { children: [
4418
- /* @__PURE__ */ e(Te, { children: a("jobs.history") }),
4419
- /* @__PURE__ */ e(Ae, { children: a("jobs.history_help") })
4389
+ return /* @__PURE__ */ r(Le, { className: "max-w-2xl", children: [
4390
+ /* @__PURE__ */ r(qe, { children: [
4391
+ /* @__PURE__ */ e(je, { children: a("jobs.history") }),
4392
+ /* @__PURE__ */ e(Te, { children: a("jobs.history_help") })
4420
4393
  ] }),
4421
- t.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70 italic py-6 text-center", children: a("jobs.no_runs") }) : /* @__PURE__ */ e("div", { className: "max-h-[60vh] overflow-y-auto rounded-2xl border border-border/40 divide-y divide-border/40", children: t.map((s) => /* @__PURE__ */ e(kr, { summary: s }, s.id)) }),
4422
- /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(ne, { variant: "ghost", children: a("close") }) }) })
4394
+ t.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70 italic py-6 text-center", children: a("jobs.no_runs") }) : /* @__PURE__ */ e("div", { className: "max-h-[60vh] overflow-y-auto rounded-2xl border border-border/40 divide-y divide-border/40", children: t.map((s) => /* @__PURE__ */ e(Nr, { summary: s }, s.id)) }),
4395
+ /* @__PURE__ */ e(Je, { children: /* @__PURE__ */ e(Ue, { asChild: !0, children: /* @__PURE__ */ e(ne, { variant: "ghost", children: a("close") }) }) })
4423
4396
  ] });
4424
4397
  }
4425
- function Sr() {
4426
- const { t } = F(["admin"]), { runRawJob: a } = He(), [s, d] = y(!1), [o, n] = y(""), [l, g] = y(""), _ = o.trim() !== "" && l.trim() === $e, S = async () => {
4398
+ function kr() {
4399
+ const { t } = F(["admin"]), { runRawJob: a } = Ve(), [s, d] = y(!1), [o, n] = y(""), [l, g] = y(""), _ = o.trim() !== "" && l.trim() === Me, S = async () => {
4427
4400
  try {
4428
- await a.mutateAsync({ code: o, confirm_phrase: l }), be.success(t("jobs.run_started", { name: "Raw Python" })), n(""), g("");
4401
+ await a.mutateAsync({ code: o, confirm_phrase: l }), fe.success(t("jobs.run_started", { name: "Raw Python" })), n(""), g("");
4429
4402
  } catch (w) {
4430
- be.error(w instanceof Error ? w.message : t("jobs.run_failed"));
4403
+ fe.error(w instanceof Error ? w.message : t("jobs.run_failed"));
4431
4404
  }
4432
4405
  };
4433
4406
  return /* @__PURE__ */ r("div", { className: "rounded-2xl border border-destructive/30 bg-destructive/5 overflow-hidden", children: [
@@ -4439,11 +4412,11 @@ function Sr() {
4439
4412
  className: "w-full flex items-center justify-between gap-2 p-4 text-start",
4440
4413
  children: [
4441
4414
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
4442
- /* @__PURE__ */ e($t, { className: "size-4 text-destructive" }),
4415
+ /* @__PURE__ */ e(Rt, { className: "size-4 text-destructive" }),
4443
4416
  /* @__PURE__ */ e("h3", { className: "text-sm font-bold text-destructive", children: t("jobs.raw.title") })
4444
4417
  ] }),
4445
4418
  /* @__PURE__ */ e(
4446
- ot,
4419
+ nt,
4447
4420
  {
4448
4421
  className: `size-4 text-destructive/70 transition-transform ${s ? "" : "-rotate-90"}`
4449
4422
  }
@@ -4454,7 +4427,7 @@ function Sr() {
4454
4427
  s && /* @__PURE__ */ r("div", { className: "px-4 pb-4 space-y-4", children: [
4455
4428
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground/80", children: t("jobs.raw.warning") }),
4456
4429
  /* @__PURE__ */ e(
4457
- De,
4430
+ Ae,
4458
4431
  {
4459
4432
  dir: "ltr",
4460
4433
  value: o,
@@ -4467,14 +4440,14 @@ result = {"ok": True}`,
4467
4440
  }
4468
4441
  ),
4469
4442
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
4470
- /* @__PURE__ */ e(U, { className: "text-xs font-bold text-destructive", children: t("jobs.raw.confirm_label", { phrase: $e }) }),
4443
+ /* @__PURE__ */ e(U, { className: "text-xs font-bold text-destructive", children: t("jobs.raw.confirm_label", { phrase: Me }) }),
4471
4444
  /* @__PURE__ */ e(
4472
4445
  se,
4473
4446
  {
4474
4447
  dir: "ltr",
4475
4448
  value: l,
4476
4449
  onChange: (w) => g(w.target.value),
4477
- placeholder: $e,
4450
+ placeholder: Me,
4478
4451
  className: "border-destructive/30 text-left"
4479
4452
  }
4480
4453
  )
@@ -4486,7 +4459,7 @@ result = {"ok": True}`,
4486
4459
  onClick: S,
4487
4460
  disabled: !_ || a.isPending,
4488
4461
  children: [
4489
- a.isPending ? /* @__PURE__ */ e(Ve, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(Be, { className: "size-4" }),
4462
+ a.isPending ? /* @__PURE__ */ e(Be, { className: "size-4 animate-spin" }) : /* @__PURE__ */ e(ze, { className: "size-4" }),
4490
4463
  t("jobs.raw.run")
4491
4464
  ]
4492
4465
  }
@@ -4494,12 +4467,12 @@ result = {"ok": True}`,
4494
4467
  ] })
4495
4468
  ] });
4496
4469
  }
4497
- function Lr() {
4498
- const { t } = F(["admin"]), a = ge(() => yr(), []), s = a.includes("jobs"), d = a.includes("dangerous_jobs"), { data: o } = ar(s), { data: n } = nr({ limit: 50 }, s), [l, g] = y(null), [_, S] = y(!1);
4470
+ function Cr() {
4471
+ const { t } = F(["admin"]), a = he(() => xr(), []), s = a.includes("jobs"), d = a.includes("dangerous_jobs"), { data: o } = tr(s), { data: n } = rr({ limit: 50 }, s), [l, g] = y(null), [_, S] = y(!1);
4499
4472
  if (!s) return null;
4500
4473
  const w = o?.jobs || [], x = n?.runs || [];
4501
4474
  return /* @__PURE__ */ r("section", { children: [
4502
- /* @__PURE__ */ e(_e, { title: t("jobs.section_title"), icon: Rt }),
4475
+ /* @__PURE__ */ e(ye, { title: t("jobs.section_title"), icon: Dt }),
4503
4476
  /* @__PURE__ */ r("div", { className: "p-2 space-y-8", children: [
4504
4477
  /* @__PURE__ */ r("div", { className: "space-y-3 text-left", dir: "ltr", children: [
4505
4478
  w.length === 0 && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground/70 italic", children: t("jobs.no_jobs") }),
@@ -4511,12 +4484,12 @@ function Lr() {
4511
4484
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
4512
4485
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
4513
4486
  /* @__PURE__ */ e("p", { className: "text-sm font-bold truncate", children: i.name }),
4514
- /* @__PURE__ */ e(Le, { variant: "outline", className: ct(i.danger), children: t(`jobs.danger.${i.danger}`) })
4487
+ /* @__PURE__ */ e(Se, { variant: "outline", className: lt(i.danger), children: t(`jobs.danger.${i.danger}`) })
4515
4488
  ] }),
4516
4489
  i.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground/70 mt-0.5 line-clamp-2", children: i.description })
4517
4490
  ] }),
4518
4491
  /* @__PURE__ */ r(ne, { variant: "outline", size: "sm", onClick: () => g(i), children: [
4519
- /* @__PURE__ */ e(Be, { className: "size-3.5" }),
4492
+ /* @__PURE__ */ e(ze, { className: "size-3.5" }),
4520
4493
  t("jobs.run")
4521
4494
  ] })
4522
4495
  ]
@@ -4525,17 +4498,17 @@ function Lr() {
4525
4498
  ))
4526
4499
  ] }),
4527
4500
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ r(ne, { variant: "outline", size: "sm", onClick: () => S(!0), children: [
4528
- /* @__PURE__ */ e(Mt, { className: "size-3.5" }),
4501
+ /* @__PURE__ */ e(It, { className: "size-3.5" }),
4529
4502
  t("jobs.view_history"),
4530
- x.length > 0 && /* @__PURE__ */ e(Le, { variant: "secondary", className: "ml-1", children: x.length })
4503
+ x.length > 0 && /* @__PURE__ */ e(Se, { variant: "secondary", className: "ml-1", children: x.length })
4531
4504
  ] }) }),
4532
- d && /* @__PURE__ */ e(Sr, {})
4505
+ d && /* @__PURE__ */ e(kr, {})
4533
4506
  ] }),
4534
- /* @__PURE__ */ e(Se, { open: !!l, onOpenChange: (i) => !i && g(null), children: l && /* @__PURE__ */ e(Nr, { job: l, onClose: () => g(null) }) }),
4535
- /* @__PURE__ */ e(Se, { open: _, onOpenChange: S, children: _ && /* @__PURE__ */ e(Cr, { runs: x }) })
4507
+ /* @__PURE__ */ e(Ce, { open: !!l, onOpenChange: (i) => !i && g(null), children: l && /* @__PURE__ */ e(yr, { job: l, onClose: () => g(null) }) }),
4508
+ /* @__PURE__ */ e(Ce, { open: _, onOpenChange: S, children: _ && /* @__PURE__ */ e(wr, { runs: x }) })
4536
4509
  ] });
4537
4510
  }
4538
- function qr({ translations: t, onChange: a }) {
4511
+ function Sr({ translations: t, onChange: a }) {
4539
4512
  const { t: s } = F(["admin"]), [d, o] = y("fa"), [n, l] = y("translation"), [g, _] = y("{}"), [S, w] = y("");
4540
4513
  H(() => {
4541
4514
  const h = t?.[d]?.[n] || {};
@@ -4571,7 +4544,7 @@ function qr({ translations: t, onChange: a }) {
4571
4544
  return /* @__PURE__ */ r("div", { className: "border border-border/60 rounded-2xl overflow-hidden bg-background", children: [
4572
4545
  /* @__PURE__ */ r("div", { className: "p-6 border-b border-border/50 bg-muted/5 flex flex-col sm:flex-row items-center gap-4", children: [
4573
4546
  /* @__PURE__ */ r("div", { className: "flex-1 flex items-center gap-4 p-1.5 bg-background border border-border/60 rounded-xl w-full", children: [
4574
- /* @__PURE__ */ e("div", { className: "p-2 px-3 bg-muted/20 rounded-lg border border-border/40 ml-1", children: /* @__PURE__ */ e(Pe, { className: "size-4 text-muted-foreground" }) }),
4547
+ /* @__PURE__ */ e("div", { className: "p-2 px-3 bg-muted/20 rounded-lg border border-border/40 ml-1", children: /* @__PURE__ */ e(Fe, { className: "size-4 text-muted-foreground" }) }),
4575
4548
  /* @__PURE__ */ r(X, { value: d, onValueChange: o, children: [
4576
4549
  /* @__PURE__ */ e(
4577
4550
  Y,
@@ -4604,7 +4577,7 @@ function qr({ translations: t, onChange: a }) {
4604
4577
  onClick: i,
4605
4578
  title: "Add Language",
4606
4579
  className: "p-2.5 hover:bg-muted/30 rounded-xl transition-all border border-border/40",
4607
- children: /* @__PURE__ */ e(Ft, { className: "size-4" })
4580
+ children: /* @__PURE__ */ e(Ot, { className: "size-4" })
4608
4581
  }
4609
4582
  ),
4610
4583
  /* @__PURE__ */ e(
@@ -4614,7 +4587,7 @@ function qr({ translations: t, onChange: a }) {
4614
4587
  onClick: b,
4615
4588
  title: "Add Namespace",
4616
4589
  className: "p-2.5 hover:bg-muted/30 rounded-xl transition-all border border-border/40",
4617
- children: /* @__PURE__ */ e(Pe, { className: "size-4" })
4590
+ children: /* @__PURE__ */ e(Fe, { className: "size-4" })
4618
4591
  }
4619
4592
  )
4620
4593
  ] })
@@ -4622,10 +4595,10 @@ function qr({ translations: t, onChange: a }) {
4622
4595
  /* @__PURE__ */ r("div", { className: "relative p-6", children: [
4623
4596
  /* @__PURE__ */ r("div", { className: "absolute top-8 right-10 flex items-center gap-2", children: [
4624
4597
  /* @__PURE__ */ e("span", { className: "text-[10px] font-bold text-muted-foreground/40 uppercase tracking-widest", children: "JSON EDITOR" }),
4625
- /* @__PURE__ */ e(Pt, { className: "size-3 text-muted-foreground/30" })
4598
+ /* @__PURE__ */ e(Et, { className: "size-3 text-muted-foreground/30" })
4626
4599
  ] }),
4627
4600
  /* @__PURE__ */ e(
4628
- De,
4601
+ Ae,
4629
4602
  {
4630
4603
  value: g,
4631
4604
  onChange: (h) => x(h.target.value),
@@ -4645,7 +4618,7 @@ function qr({ translations: t, onChange: a }) {
4645
4618
  ] }) })
4646
4619
  ] });
4647
4620
  }
4648
- function jr() {
4621
+ function Lr() {
4649
4622
  const { t, i18n: a } = F(["admin", "translation", "settings"]), {
4650
4623
  app: s,
4651
4624
  welcome: d,
@@ -4655,7 +4628,7 @@ function jr() {
4655
4628
  composer: g,
4656
4629
  theme: _,
4657
4630
  settings: S
4658
- } = xe(), [w, x] = y(!1), [i, b] = y(!1), [h, N] = y(""), [D, p] = y(""), [R, u] = y(!1), f = ge(
4631
+ } = be(), [w, x] = y(!1), [i, b] = y(!1), [h, N] = y(""), [D, p] = y(""), [R, c] = y(!1), f = he(
4659
4632
  () => ({
4660
4633
  app_name: s?.name || "Gentiq",
4661
4634
  admin_title: s?.adminTitle || "",
@@ -4706,9 +4679,9 @@ function jr() {
4706
4679
  try {
4707
4680
  const m = await T.getSettings();
4708
4681
  if (m && Object.keys(m).length > 0) {
4709
- const j = JSON.parse(JSON.stringify(a.store.data));
4682
+ const q = JSON.parse(JSON.stringify(a.store.data));
4710
4683
  m.translations && Object.keys(m.translations).forEach((A) => {
4711
- j[A] || (j[A] = {}), Object.assign(j[A], m.translations[A]);
4684
+ q[A] || (q[A] = {}), Object.assign(q[A], m.translations[A]);
4712
4685
  }), L((A) => ({
4713
4686
  ...A,
4714
4687
  ...m,
@@ -4717,14 +4690,14 @@ function jr() {
4717
4690
  settings_general_fields: m.settings_general_fields ?? A.settings_general_fields,
4718
4691
  settings_profile_fields: m.settings_profile_fields ?? A.settings_profile_fields,
4719
4692
  settings_account_fields: m.settings_account_fields ?? A.settings_account_fields,
4720
- translations: j
4693
+ translations: q
4721
4694
  }));
4722
4695
  } else {
4723
- const j = {
4696
+ const q = {
4724
4697
  ...f,
4725
4698
  translations: a.store.data
4726
4699
  };
4727
- L(j), m || T.updateSettings(j).catch(console.error);
4700
+ L(q), m || T.updateSettings(q).catch(console.error);
4728
4701
  }
4729
4702
  } catch (m) {
4730
4703
  console.error("Failed to fetch settings", m), N(t("app_settings.save_error"));
@@ -4752,7 +4725,7 @@ function jr() {
4752
4725
  }, Z = async () => {
4753
4726
  x(!0), N("");
4754
4727
  try {
4755
- await T.resetSettings(), u(!1), window.location.reload();
4728
+ await T.resetSettings(), c(!1), window.location.reload();
4756
4729
  } catch (k) {
4757
4730
  N(k instanceof Error ? k.message : t("app_settings.save_error"));
4758
4731
  } finally {
@@ -4775,25 +4748,25 @@ function jr() {
4775
4748
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("app_settings.subtitle") })
4776
4749
  ] }),
4777
4750
  /* @__PURE__ */ r("div", { className: "flex items-center gap-4", children: [
4778
- /* @__PURE__ */ r(Se, { open: R, onOpenChange: u, children: [
4779
- /* @__PURE__ */ e(gt, { asChild: !0, children: /* @__PURE__ */ r(
4751
+ /* @__PURE__ */ r(Ce, { open: R, onOpenChange: c, children: [
4752
+ /* @__PURE__ */ e(ht, { asChild: !0, children: /* @__PURE__ */ r(
4780
4753
  "button",
4781
4754
  {
4782
4755
  type: "button",
4783
4756
  className: "px-4 py-2 bg-muted/20 text-muted-foreground hover:bg-muted/40 rounded-xl text-xs font-bold transition-all flex items-center gap-2 border border-border/50",
4784
4757
  children: [
4785
- /* @__PURE__ */ e(st, { className: "size-3.5" }),
4758
+ /* @__PURE__ */ e(at, { className: "size-3.5" }),
4786
4759
  t("app_settings.reset_button", { defaultValue: "Reset to Defaults" })
4787
4760
  ]
4788
4761
  }
4789
4762
  ) }),
4790
- /* @__PURE__ */ r(qe, { children: [
4791
- /* @__PURE__ */ r(je, { children: [
4792
- /* @__PURE__ */ e(Te, { children: t("app_settings.reset_confirm_title") }),
4793
- /* @__PURE__ */ e(Ae, { children: t("app_settings.reset_confirm_description") })
4763
+ /* @__PURE__ */ r(Le, { children: [
4764
+ /* @__PURE__ */ r(qe, { children: [
4765
+ /* @__PURE__ */ e(je, { children: t("app_settings.reset_confirm_title") }),
4766
+ /* @__PURE__ */ e(Te, { children: t("app_settings.reset_confirm_description") })
4794
4767
  ] }),
4795
- /* @__PURE__ */ r(Ue, { children: [
4796
- /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(ne, { variant: "ghost", children: t("cancel") }) }),
4768
+ /* @__PURE__ */ r(Je, { children: [
4769
+ /* @__PURE__ */ e(Ue, { asChild: !0, children: /* @__PURE__ */ e(ne, { variant: "ghost", children: t("cancel") }) }),
4797
4770
  /* @__PURE__ */ e(ne, { variant: "destructive", onClick: Z, children: t("app_settings.reset_button") })
4798
4771
  ] })
4799
4772
  ] })
@@ -4829,7 +4802,7 @@ function jr() {
4829
4802
  className: "space-y-16 animate-in fade-in slide-in-from-bottom-2 duration-500",
4830
4803
  children: [
4831
4804
  /* @__PURE__ */ e(
4832
- xr,
4805
+ fr,
4833
4806
  {
4834
4807
  settings: C,
4835
4808
  setSettings: L,
@@ -4838,7 +4811,7 @@ function jr() {
4838
4811
  }
4839
4812
  ),
4840
4813
  /* @__PURE__ */ e(
4841
- vr,
4814
+ br,
4842
4815
  {
4843
4816
  settings: C,
4844
4817
  setSettings: L,
@@ -4847,7 +4820,7 @@ function jr() {
4847
4820
  }
4848
4821
  ),
4849
4822
  /* @__PURE__ */ r("section", { children: [
4850
- /* @__PURE__ */ e(_e, { title: t("app_settings.sections.user_billing"), icon: Jt }),
4823
+ /* @__PURE__ */ e(ye, { title: t("app_settings.sections.user_billing"), icon: Ft }),
4851
4824
  /* @__PURE__ */ r("div", { className: "p-2 space-y-10", children: [
4852
4825
  /* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-10", children: [
4853
4826
  /* @__PURE__ */ r("div", { className: "space-y-2", children: [
@@ -4887,9 +4860,9 @@ function jr() {
4887
4860
  ] })
4888
4861
  ] }),
4889
4862
  /* @__PURE__ */ r("section", { children: [
4890
- /* @__PURE__ */ e(_e, { title: t("app_settings.translations_management"), icon: Ut }),
4863
+ /* @__PURE__ */ e(ye, { title: t("app_settings.translations_management"), icon: Pt }),
4891
4864
  /* @__PURE__ */ e(
4892
- qr,
4865
+ Sr,
4893
4866
  {
4894
4867
  translations: C.translations,
4895
4868
  onChange: (k) => L((m) => ({ ...m, translations: k }))
@@ -4899,11 +4872,11 @@ function jr() {
4899
4872
  ]
4900
4873
  }
4901
4874
  ),
4902
- /* @__PURE__ */ e("div", { className: "mt-16", children: /* @__PURE__ */ e(Lr, {}) })
4875
+ /* @__PURE__ */ e("div", { className: "mt-16", children: /* @__PURE__ */ e(Cr, {}) })
4903
4876
  ] }) })
4904
4877
  ] });
4905
4878
  }
4906
- function fe() {
4879
+ function ge() {
4907
4880
  const { t, i18n: a } = F(["admin"]), s = a.language === "fa";
4908
4881
  return /* @__PURE__ */ r(
4909
4882
  "div",
@@ -4911,7 +4884,7 @@ function fe() {
4911
4884
  className: "h-full flex flex-col items-center justify-center p-6 text-center gap-4 animate-in fade-in duration-500",
4912
4885
  dir: s ? "rtl" : "ltr",
4913
4886
  children: [
4914
- /* @__PURE__ */ e("div", { className: "bg-destructive/10 p-4 rounded-2xl border border-destructive/20 relative", children: /* @__PURE__ */ e(zt, { className: "size-10 text-destructive/70" }) }),
4887
+ /* @__PURE__ */ e("div", { className: "bg-destructive/10 p-4 rounded-2xl border border-destructive/20 relative", children: /* @__PURE__ */ e(Jt, { className: "size-10 text-destructive/70" }) }),
4915
4888
  /* @__PURE__ */ r("div", { className: "space-y-1 max-w-sm", children: [
4916
4889
  /* @__PURE__ */ e("h3", { className: "text-lg font-bold text-foreground tracking-tight", children: t("errors.access_denied_title", "Access Denied") }),
4917
4890
  /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground leading-relaxed", children: t("errors.access_denied_message", "You don't have permission to access this page.") })
@@ -4920,19 +4893,19 @@ function fe() {
4920
4893
  }
4921
4894
  );
4922
4895
  }
4923
- const Tr = ({ className: t }) => {
4924
- const { t: a } = F(["theme"]), { theme: s, setTheme: d } = Je(), o = () => {
4896
+ const qr = ({ className: t }) => {
4897
+ const { t: a } = F(["theme"]), { theme: s, setTheme: d } = Pe(), o = () => {
4925
4898
  d(s === "system" ? "light" : s === "light" ? "dark" : "system");
4926
4899
  }, n = () => {
4927
4900
  switch (s) {
4928
4901
  case "light":
4929
- return /* @__PURE__ */ e(Vt, { className: "h-[1.2rem] w-[1.2rem]" });
4902
+ return /* @__PURE__ */ e(zt, { className: "h-[1.2rem] w-[1.2rem]" });
4930
4903
  case "dark":
4931
- return /* @__PURE__ */ e(Bt, { className: "h-[1.2rem] w-[1.2rem]" });
4904
+ return /* @__PURE__ */ e(Ut, { className: "h-[1.2rem] w-[1.2rem]" });
4932
4905
  case "system":
4933
- return /* @__PURE__ */ e(Ye, { className: "h-[1.2rem] w-[1.2rem]" });
4906
+ return /* @__PURE__ */ e(Ze, { className: "h-[1.2rem] w-[1.2rem]" });
4934
4907
  default:
4935
- return /* @__PURE__ */ e(Ye, { className: "h-[1.2rem] w-[1.2rem]" });
4908
+ return /* @__PURE__ */ e(Ze, { className: "h-[1.2rem] w-[1.2rem]" });
4936
4909
  }
4937
4910
  }, l = () => {
4938
4911
  switch (s) {
@@ -4946,16 +4919,16 @@ const Tr = ({ className: t }) => {
4946
4919
  return a("toggle");
4947
4920
  }
4948
4921
  };
4949
- return /* @__PURE__ */ r(Oe, { children: [
4950
- /* @__PURE__ */ e(Ee, { asChild: !0, children: /* @__PURE__ */ r(ne, { variant: "ghost", size: "icon", onClick: o, className: t, children: [
4922
+ return /* @__PURE__ */ r($e, { children: [
4923
+ /* @__PURE__ */ e(Oe, { asChild: !0, children: /* @__PURE__ */ r(ne, { variant: "ghost", size: "icon", onClick: o, className: t, children: [
4951
4924
  n(),
4952
4925
  /* @__PURE__ */ e("span", { className: "sr-only", children: a("toggle") })
4953
4926
  ] }) }),
4954
- /* @__PURE__ */ e(Fe, { children: l() })
4927
+ /* @__PURE__ */ e(Ee, { children: l() })
4955
4928
  ] });
4956
4929
  };
4957
- function Ar({ extraPages: t = [], disabledPages: a = [] }) {
4958
- const s = wt(), d = kt(), { t: o, i18n: n } = F(["admin", "settings", "translation"]), { app: l } = xe(), { theme: g } = Je(), [_, S] = y([]), [w, x] = y(!1), i = at(!1), [b, h] = y("light");
4930
+ function jr({ extraPages: t = [], disabledPages: a = [] }) {
4931
+ const s = _t(), d = Nt(), { t: o, i18n: n } = F(["admin", "settings", "translation"]), { app: l } = be(), { theme: g } = Pe(), [_, S] = y([]), [w, x] = y(!1), i = tt(!1), [b, h] = y("light");
4959
4932
  H(() => {
4960
4933
  if (g === "system") {
4961
4934
  const v = window.matchMedia("(prefers-color-scheme: dark)").matches;
@@ -4963,7 +4936,7 @@ function Ar({ extraPages: t = [], disabledPages: a = [] }) {
4963
4936
  } else
4964
4937
  h(g);
4965
4938
  }, [g]);
4966
- const N = ge(() => l?.logo ? typeof l.logo == "string" ? l.logo : b === "dark" ? l.logo.dark : l.logo.light : nt, [l?.logo, b]), D = l?.adminTitle || l?.name, p = n.language === "fa";
4939
+ const N = he(() => l?.logo ? typeof l.logo == "string" ? l.logo : b === "dark" ? l.logo.dark : l.logo.light : rt, [l?.logo, b]), D = l?.adminTitle || l?.name, p = n.language === "fa";
4967
4940
  H(() => {
4968
4941
  const v = localStorage.getItem("admin_info");
4969
4942
  if (v)
@@ -4994,7 +4967,7 @@ function Ar({ extraPages: t = [], disabledPages: a = [] }) {
4994
4967
  }, [s, d.pathname]);
4995
4968
  const R = () => {
4996
4969
  T.clearToken(), window.location.reload();
4997
- }, u = (v) => _.includes(v), f = (v) => _.includes(v) && !a.includes(v), C = Object.keys(n.services?.resourceStore?.data || {}).filter(
4970
+ }, c = (v) => _.includes(v), f = (v) => _.includes(v) && !a.includes(v), C = Object.keys(n.services?.resourceStore?.data || {}).filter(
4998
4971
  (v) => v !== "dev"
4999
4972
  ), L = C.length > 0 ? C : ["en", "fa"], $ = (v) => {
5000
4973
  localStorage.setItem("gentiq-admin-language", v), n.changeLanguage(v), x(!1), document.activeElement instanceof HTMLElement && document.activeElement.blur();
@@ -5065,7 +5038,7 @@ function Ar({ extraPages: t = [], disabledPages: a = [] }) {
5065
5038
  ] }),
5066
5039
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 py-4 md:py-0", children: [
5067
5040
  /* @__PURE__ */ r(
5068
- ft,
5041
+ pt,
5069
5042
  {
5070
5043
  onOpenChange: (v) => {
5071
5044
  v ? x(!1) : (i.current = !0, setTimeout(() => {
@@ -5074,14 +5047,14 @@ function Ar({ extraPages: t = [], disabledPages: a = [] }) {
5074
5047
  },
5075
5048
  children: [
5076
5049
  /* @__PURE__ */ r(
5077
- Oe,
5050
+ $e,
5078
5051
  {
5079
5052
  open: w,
5080
5053
  onOpenChange: (v) => {
5081
5054
  v && i.current || x(v);
5082
5055
  },
5083
5056
  children: [
5084
- /* @__PURE__ */ e(Ee, { asChild: !0, children: /* @__PURE__ */ e(bt, { asChild: !0, children: /* @__PURE__ */ e(
5057
+ /* @__PURE__ */ e(Oe, { asChild: !0, children: /* @__PURE__ */ e(gt, { asChild: !0, children: /* @__PURE__ */ e(
5085
5058
  ne,
5086
5059
  {
5087
5060
  variant: "ghost",
@@ -5091,12 +5064,12 @@ function Ar({ extraPages: t = [], disabledPages: a = [] }) {
5091
5064
  children: (n.language?.split("-")[0] || "").toUpperCase()
5092
5065
  }
5093
5066
  ) }) }),
5094
- /* @__PURE__ */ e(Fe, { side: "bottom", className: "text-xs", children: o("dashboard.language", "Change Language") })
5067
+ /* @__PURE__ */ e(Ee, { side: "bottom", className: "text-xs", children: o("dashboard.language", "Change Language") })
5095
5068
  ]
5096
5069
  }
5097
5070
  ),
5098
- /* @__PURE__ */ e(xt, { align: "center", className: "min-w-[8rem]", children: L.map((v) => /* @__PURE__ */ e(
5099
- vt,
5071
+ /* @__PURE__ */ e(ft, { align: "center", className: "min-w-[8rem]", children: L.map((v) => /* @__PURE__ */ e(
5072
+ bt,
5100
5073
  {
5101
5074
  onClick: () => $(v),
5102
5075
  className: v === n.language ? "bg-primary/10" : "",
@@ -5107,79 +5080,79 @@ function Ar({ extraPages: t = [], disabledPages: a = [] }) {
5107
5080
  ]
5108
5081
  }
5109
5082
  ),
5110
- /* @__PURE__ */ e(Tr, { className: "size-9 !bg-transparent hover:bg-muted text-muted-foreground" }),
5083
+ /* @__PURE__ */ e(qr, { className: "size-9 !bg-transparent hover:bg-muted text-muted-foreground" }),
5111
5084
  /* @__PURE__ */ e("div", { className: "w-px h-5 bg-border mx-1" }),
5112
- /* @__PURE__ */ r(Oe, { children: [
5113
- /* @__PURE__ */ e(Ee, { asChild: !0, children: /* @__PURE__ */ e(
5085
+ /* @__PURE__ */ r($e, { children: [
5086
+ /* @__PURE__ */ e(Oe, { asChild: !0, children: /* @__PURE__ */ e(
5114
5087
  ne,
5115
5088
  {
5116
5089
  variant: "ghost",
5117
5090
  size: "icon",
5118
5091
  className: "hover:bg-destructive/10 hover:scale-105 active:scale-95 text-muted-foreground hover:text-destructive",
5119
5092
  onClick: R,
5120
- children: /* @__PURE__ */ e(Ht, { className: "size-5" })
5093
+ children: /* @__PURE__ */ e(Bt, { className: "size-5" })
5121
5094
  }
5122
5095
  ) }),
5123
- /* @__PURE__ */ e(Fe, { side: "bottom", className: "text-xs", children: o("dashboard.logout") })
5096
+ /* @__PURE__ */ e(Ee, { side: "bottom", className: "text-xs", children: o("dashboard.logout") })
5124
5097
  ] })
5125
5098
  ] })
5126
5099
  ] }) }) }),
5127
- /* @__PURE__ */ e("main", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e("div", { className: "absolute inset-0 overflow-hidden", children: /* @__PURE__ */ r(Ct, { children: [
5128
- /* @__PURE__ */ e(me, { path: "/", element: /* @__PURE__ */ e(Xe, { to: "/admin/analytics", replace: !0 }) }),
5100
+ /* @__PURE__ */ e("main", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e("div", { className: "absolute inset-0 overflow-hidden", children: /* @__PURE__ */ r(wt, { children: [
5101
+ /* @__PURE__ */ e(ue, { path: "/", element: /* @__PURE__ */ e(Ge, { to: "/admin/analytics", replace: !0 }) }),
5129
5102
  /* @__PURE__ */ e(
5130
- me,
5103
+ ue,
5131
5104
  {
5132
5105
  path: "/analytics",
5133
- element: f("analytics") ? /* @__PURE__ */ e(br, {}) : /* @__PURE__ */ e(fe, {})
5106
+ element: f("analytics") ? /* @__PURE__ */ e(gr, {}) : /* @__PURE__ */ e(ge, {})
5134
5107
  }
5135
5108
  ),
5136
5109
  /* @__PURE__ */ e(
5137
- me,
5110
+ ue,
5138
5111
  {
5139
5112
  path: "/chat-history",
5140
- element: f("chat_history") ? /* @__PURE__ */ e(or, {}) : /* @__PURE__ */ e(fe, {})
5113
+ element: f("chat_history") ? /* @__PURE__ */ e(nr, {}) : /* @__PURE__ */ e(ge, {})
5141
5114
  }
5142
5115
  ),
5143
5116
  /* @__PURE__ */ e(
5144
- me,
5117
+ ue,
5145
5118
  {
5146
5119
  path: "/admins",
5147
- element: f("admin_management") ? /* @__PURE__ */ e(ir, {}) : /* @__PURE__ */ e(fe, {})
5120
+ element: f("admin_management") ? /* @__PURE__ */ e(sr, {}) : /* @__PURE__ */ e(ge, {})
5148
5121
  }
5149
5122
  ),
5150
5123
  /* @__PURE__ */ e(
5151
- me,
5124
+ ue,
5152
5125
  {
5153
5126
  path: "/settings",
5154
- element: f("settings") ? /* @__PURE__ */ e(jr, {}) : /* @__PURE__ */ e(fe, {})
5127
+ element: f("settings") ? /* @__PURE__ */ e(Lr, {}) : /* @__PURE__ */ e(ge, {})
5155
5128
  }
5156
5129
  ),
5157
5130
  /* @__PURE__ */ e(
5158
- me,
5131
+ ue,
5159
5132
  {
5160
5133
  path: "/users",
5161
- element: f("user_management") ? /* @__PURE__ */ e(fr, {}) : /* @__PURE__ */ e(fe, {})
5134
+ element: f("user_management") ? /* @__PURE__ */ e(pr, {}) : /* @__PURE__ */ e(ge, {})
5162
5135
  }
5163
5136
  ),
5164
5137
  t.map((v) => /* @__PURE__ */ e(
5165
- me,
5138
+ ue,
5166
5139
  {
5167
5140
  path: `/${v.path}`,
5168
- element: v.permission && !u(v.permission) ? /* @__PURE__ */ e(fe, {}) : v.element
5141
+ element: v.permission && !c(v.permission) ? /* @__PURE__ */ e(ge, {}) : v.element
5169
5142
  },
5170
5143
  `route-${v.path}`
5171
5144
  )),
5172
- /* @__PURE__ */ e(me, { path: "*", element: /* @__PURE__ */ e(Xe, { to: "/admin/analytics", replace: !0 }) })
5145
+ /* @__PURE__ */ e(ue, { path: "*", element: /* @__PURE__ */ e(Ge, { to: "/admin/analytics", replace: !0 }) })
5173
5146
  ] }) }) })
5174
5147
  ]
5175
5148
  }
5176
5149
  );
5177
5150
  }
5178
- function Vr(t) {
5179
- const a = ge(() => {
5180
- const s = ut.createInstance();
5181
- return s.use(yt).use(mt).init({
5182
- resources: _t,
5151
+ function zr(t) {
5152
+ const a = he(() => {
5153
+ const s = ct.createInstance();
5154
+ return s.use(xt).use(ut).init({
5155
+ resources: vt,
5183
5156
  fallbackLng: "en",
5184
5157
  interpolation: { escapeValue: !1 },
5185
5158
  detection: {
@@ -5189,10 +5162,10 @@ function Vr(t) {
5189
5162
  }
5190
5163
  }), s;
5191
5164
  }, []);
5192
- return /* @__PURE__ */ e(ht, { i18n: a, children: /* @__PURE__ */ e(Dr, { ...t }) });
5165
+ return /* @__PURE__ */ e(mt, { i18n: a, children: /* @__PURE__ */ e(Tr, { ...t }) });
5193
5166
  }
5194
- function Dr({ extraPages: t, disabledPages: a = [] }) {
5195
- const { app: s, i18n: d } = xe(), { t: o, i18n: n } = F(["admin", "translation"]), [l, g] = y(!1), [_, S] = y(!0), [w, x] = y(!1);
5167
+ function Tr({ extraPages: t, disabledPages: a = [] }) {
5168
+ const { app: s, i18n: d } = be(), { t: o, i18n: n } = F(["admin", "translation"]), [l, g] = y(!1), [_, S] = y(!0), [w, x] = y(!1);
5196
5169
  H(() => {
5197
5170
  d?.resources && Object.entries(d.resources).forEach(([h, N]) => {
5198
5171
  Object.entries(N).forEach(([D, p]) => {
@@ -5210,22 +5183,22 @@ function Dr({ extraPages: t, disabledPages: a = [] }) {
5210
5183
  const i = () => {
5211
5184
  g(!0);
5212
5185
  };
5213
- return _ || !w ? /* @__PURE__ */ e("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: o("loading") }) }) : /* @__PURE__ */ e(Nt, { storageKey: "gentiq-admin-theme", children: l ? /* @__PURE__ */ e(Ar, { extraPages: t, disabledPages: a }) : /* @__PURE__ */ e(Kt, { onLoginSuccess: i }) });
5186
+ return _ || !w ? /* @__PURE__ */ e("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-muted-foreground", children: o("loading") }) }) : /* @__PURE__ */ e(yt, { storageKey: "gentiq-admin-theme", children: l ? /* @__PURE__ */ e(jr, { extraPages: t, disabledPages: a }) : /* @__PURE__ */ e(Wt, { onLoginSuccess: i }) });
5214
5187
  }
5215
5188
  export {
5216
- Vr as AdminPanel,
5217
- Yt as useAdminAdmins,
5218
- er as useAdminAdminsMutations,
5219
- Xt as useAdminAnalytics,
5220
- Br as useAdminAuth,
5221
- Ur as useAdminJobs,
5222
- zr as useAdminJobsMutations,
5223
- rr as useAdminThreadItems,
5224
- tr as useAdminThreads,
5225
- Gt as useAdminUsers,
5226
- Zt as useAdminUsersMutations,
5227
- He as useJobMutations,
5228
- sr as useJobRun,
5229
- nr as useJobRuns,
5230
- ar as useRegisteredJobs
5189
+ zr as AdminPanel,
5190
+ Zt as useAdminAdmins,
5191
+ Xt as useAdminAdminsMutations,
5192
+ Gt as useAdminAnalytics,
5193
+ Ur as useAdminAuth,
5194
+ Pr as useAdminJobs,
5195
+ Jr as useAdminJobsMutations,
5196
+ er as useAdminThreadItems,
5197
+ Yt as useAdminThreads,
5198
+ Kt as useAdminUsers,
5199
+ Qt as useAdminUsersMutations,
5200
+ Ve as useJobMutations,
5201
+ ar as useJobRun,
5202
+ rr as useJobRuns,
5203
+ tr as useRegisteredJobs
5231
5204
  };