gentiq 0.7.26 → 0.7.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{checkbox-D3JJhc0K.js → checkbox-DIJ7BlxY.js} +1084 -1062
- package/dist/gentiq-admin.es.js +1042 -947
- package/dist/gentiq-index.es.js +1018 -1022
- package/dist/gentiq.css +1 -1
- package/dist/src/locales/en.json.d.ts +8 -1
- package/dist/src/locales/fa.json.d.ts +8 -1
- package/package.json +1 -1
package/dist/gentiq-index.es.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { QueryClient as
|
|
5
|
-
import { I18nextProvider as
|
|
6
|
-
import { Trans as
|
|
7
|
-
import { g as
|
|
8
|
-
import {
|
|
9
|
-
import { Loader2Icon as
|
|
10
|
-
import { useTheme as
|
|
11
|
-
import { Toaster as
|
|
12
|
-
import { useChat as
|
|
13
|
-
import { DefaultChatTransport as
|
|
14
|
-
import { useLocation as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import * as ne from "react";
|
|
3
|
+
import { useState as _, useMemo as O, useEffect as $, useRef as te, useCallback as Y, useLayoutEffect as Je } from "react";
|
|
4
|
+
import { QueryClient as Ye, QueryClientProvider as Ze, useQueryClient as pe, useQuery as et, useInfiniteQuery as tt } from "@tanstack/react-query";
|
|
5
|
+
import { I18nextProvider as at, useTranslation as ce } from "react-i18next";
|
|
6
|
+
import { Trans as Ya, Translation as Za, useTranslation as er, withTranslation as tr } from "react-i18next";
|
|
7
|
+
import { g as rt, u as M, d as nt, C as Fe, T as st, a as re, b as je, j as be, G as Pe, c as le, e as f, f as ot, h as Oe, i as $e, k as Be, l as Ue, B as Z, m as Ke, n as he, D as He, o as it, p as Qe, L as Q, I as W, S as ve, q as xe, r as ye, s as we, t as me, v as lt, w as Te, x as ct, y as dt, z as ut, A as de, E as mt, F as ht, H as pt, J as gt, K as ft, M as bt } from "./checkbox-DIJ7BlxY.js";
|
|
8
|
+
import { N as rr, O as nr, P as sr, Q as or, R as ir, U as lr, V as cr, W as dr, X as ur, Y as mr, Z as hr, _ as pr, $ as gr } from "./checkbox-DIJ7BlxY.js";
|
|
9
|
+
import { Loader2Icon as vt, OctagonXIcon as xt, TriangleAlertIcon as yt, InfoIcon as wt, CircleCheckIcon as Nt, XIcon as kt, PanelLeftIcon as Ct, Layers as Me, User as _t, ShieldCheck as St, Settings as Ne, Smartphone as Pt, Lock as Tt, Save as Mt, Sun as Dt, Moon as It, Monitor as Et, Zap as De, Globe as Lt, Coins as At, LogOut as zt, CirclePlus as Rt, Plus as qt, Search as Ft, Check as jt, X as Ot, Pin as Ie, MoreVertical as $t, PinOff as Bt, Share2 as Ut, Pencil as Kt, Trash as Ht } from "lucide-react";
|
|
10
|
+
import { useTheme as Qt } from "next-themes";
|
|
11
|
+
import { Toaster as Vt, toast as J } from "sonner";
|
|
12
|
+
import { useChat as Gt } from "@ai-sdk/react";
|
|
13
|
+
import { DefaultChatTransport as Wt } from "ai";
|
|
14
|
+
import { useLocation as Ve, useNavigate as Ce, Navigate as Xt, useParams as Jt } from "react-router-dom";
|
|
15
15
|
import { nanoid as ue } from "nanoid";
|
|
16
|
-
import { Slot as
|
|
17
|
-
import { cva as
|
|
16
|
+
import { Slot as Yt } from "@radix-ui/react-slot";
|
|
17
|
+
import { cva as Zt } from "class-variance-authority";
|
|
18
18
|
import "@radix-ui/react-separator";
|
|
19
|
-
import * as
|
|
20
|
-
const
|
|
21
|
-
const { theme: t = "system" } =
|
|
19
|
+
import * as se from "@radix-ui/react-dialog";
|
|
20
|
+
const ea = ({ ...a }) => {
|
|
21
|
+
const { theme: t = "system" } = Qt();
|
|
22
22
|
return /* @__PURE__ */ e(
|
|
23
|
-
|
|
23
|
+
Vt,
|
|
24
24
|
{
|
|
25
25
|
theme: t,
|
|
26
26
|
className: "toaster group",
|
|
27
27
|
icons: {
|
|
28
|
-
success: /* @__PURE__ */ e(
|
|
29
|
-
info: /* @__PURE__ */ e(
|
|
30
|
-
warning: /* @__PURE__ */ e(
|
|
31
|
-
error: /* @__PURE__ */ e(
|
|
32
|
-
loading: /* @__PURE__ */ e(
|
|
28
|
+
success: /* @__PURE__ */ e(Nt, { className: "size-4" }),
|
|
29
|
+
info: /* @__PURE__ */ e(wt, { className: "size-4" }),
|
|
30
|
+
warning: /* @__PURE__ */ e(yt, { className: "size-4" }),
|
|
31
|
+
error: /* @__PURE__ */ e(xt, { className: "size-4" }),
|
|
32
|
+
loading: /* @__PURE__ */ e(vt, { className: "size-4 animate-spin" })
|
|
33
33
|
},
|
|
34
34
|
style: {
|
|
35
35
|
"--normal-bg": "var(--popover)",
|
|
@@ -37,107 +37,107 @@ const Jt = ({ ...r }) => {
|
|
|
37
37
|
"--normal-border": "var(--border)",
|
|
38
38
|
"--border-radius": "var(--radius)"
|
|
39
39
|
},
|
|
40
|
-
...
|
|
40
|
+
...a
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
};
|
|
44
|
-
function
|
|
45
|
-
children:
|
|
44
|
+
function Ha({
|
|
45
|
+
children: a,
|
|
46
46
|
api: t,
|
|
47
|
-
app:
|
|
48
|
-
i18n:
|
|
49
|
-
components:
|
|
50
|
-
history:
|
|
51
|
-
welcome:
|
|
47
|
+
app: i,
|
|
48
|
+
i18n: u,
|
|
49
|
+
components: l,
|
|
50
|
+
history: d,
|
|
51
|
+
welcome: h,
|
|
52
52
|
threadActions: p,
|
|
53
|
-
composer:
|
|
54
|
-
theme:
|
|
55
|
-
disclaimer:
|
|
56
|
-
settings:
|
|
53
|
+
composer: m,
|
|
54
|
+
theme: N,
|
|
55
|
+
disclaimer: v,
|
|
56
|
+
settings: y
|
|
57
57
|
}) {
|
|
58
|
-
const [
|
|
59
|
-
() =>
|
|
58
|
+
const [c, P] = _(null), S = O(
|
|
59
|
+
() => u?.instance ?? rt,
|
|
60
60
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
-
[
|
|
62
|
-
),
|
|
61
|
+
[u?.instance]
|
|
62
|
+
), R = t || {};
|
|
63
63
|
$(() => {
|
|
64
|
-
|
|
64
|
+
M.getAppConfig().then((n) => P(n)).catch((n) => console.debug("Gentiq: No dynamic settings available or fetch failed", n));
|
|
65
65
|
}, []), $(() => {
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
const
|
|
69
|
-
const
|
|
66
|
+
c?.app_name && (document.title = S.t(c.app_name));
|
|
67
|
+
}, [c, S]);
|
|
68
|
+
const B = O(() => {
|
|
69
|
+
const n = {
|
|
70
70
|
basePath: "/",
|
|
71
71
|
cacheNamespace: "gentiq",
|
|
72
|
-
...
|
|
72
|
+
...i
|
|
73
73
|
};
|
|
74
|
-
return
|
|
75
|
-
...
|
|
76
|
-
name: (
|
|
77
|
-
adminTitle: (
|
|
78
|
-
showSettings:
|
|
79
|
-
showToolDetails:
|
|
80
|
-
settingsGeneralMode:
|
|
81
|
-
settingsProfileMode:
|
|
82
|
-
settingsAccountMode:
|
|
83
|
-
} :
|
|
84
|
-
}, [
|
|
85
|
-
...
|
|
86
|
-
greeting:
|
|
87
|
-
subtitle:
|
|
88
|
-
} :
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
}, [
|
|
92
|
-
...
|
|
93
|
-
enabled:
|
|
94
|
-
showDelete:
|
|
95
|
-
showRename:
|
|
96
|
-
showShare:
|
|
97
|
-
showPin:
|
|
98
|
-
} :
|
|
74
|
+
return c ? {
|
|
75
|
+
...n,
|
|
76
|
+
name: (c.app_name ? S.t(c.app_name) : null) || n.name,
|
|
77
|
+
adminTitle: (c.admin_title ? S.t(c.admin_title) : null) || n.adminTitle,
|
|
78
|
+
showSettings: c.show_settings ?? n.showSettings,
|
|
79
|
+
showToolDetails: c.show_tool_details ?? n.showToolDetails,
|
|
80
|
+
settingsGeneralMode: c.settings_general_mode || n.settingsGeneralMode,
|
|
81
|
+
settingsProfileMode: c.settings_profile_mode || n.settingsProfileMode,
|
|
82
|
+
settingsAccountMode: c.settings_account_mode || n.settingsAccountMode
|
|
83
|
+
} : n;
|
|
84
|
+
}, [i, c, S]), C = O(() => c ? {
|
|
85
|
+
...h,
|
|
86
|
+
greeting: c.welcome_greeting || h?.greeting,
|
|
87
|
+
subtitle: c.welcome_subtitle || h?.subtitle
|
|
88
|
+
} : h, [h, c]), x = O(() => {
|
|
89
|
+
const n = c?.disclaimer || v;
|
|
90
|
+
return n && S.t(n);
|
|
91
|
+
}, [v, c, S]), g = O(() => c ? {
|
|
92
|
+
...d,
|
|
93
|
+
enabled: c.history_enabled ?? d?.enabled,
|
|
94
|
+
showDelete: c.history_show_delete ?? d?.showDelete,
|
|
95
|
+
showRename: c.history_show_rename ?? d?.showRename,
|
|
96
|
+
showShare: c.history_show_share ?? d?.showShare,
|
|
97
|
+
showPin: c.history_show_pin ?? d?.showPin
|
|
98
|
+
} : d, [d, c]), A = O(() => c ? {
|
|
99
99
|
...p,
|
|
100
|
-
feedback:
|
|
101
|
-
retry:
|
|
102
|
-
} : p, [p,
|
|
103
|
-
...
|
|
100
|
+
feedback: c.thread_actions_feedback ?? p?.feedback,
|
|
101
|
+
retry: c.thread_actions_retry ?? p?.retry
|
|
102
|
+
} : p, [p, c]), q = O(() => c ? {
|
|
103
|
+
...m,
|
|
104
104
|
attachments: {
|
|
105
|
-
...
|
|
106
|
-
enabled:
|
|
105
|
+
...m?.attachments,
|
|
106
|
+
enabled: c.composer_attachments ?? m?.attachments?.enabled
|
|
107
107
|
}
|
|
108
|
-
} :
|
|
109
|
-
...
|
|
108
|
+
} : m, [m, c]), I = O(() => c ? {
|
|
109
|
+
...y,
|
|
110
110
|
sections: {
|
|
111
|
-
...
|
|
111
|
+
...y?.sections,
|
|
112
112
|
general: {
|
|
113
|
-
...
|
|
114
|
-
mode:
|
|
115
|
-
enabled:
|
|
113
|
+
...y?.sections?.general,
|
|
114
|
+
mode: c.settings_general_mode || y?.sections?.general?.mode,
|
|
115
|
+
enabled: y?.sections?.general?.enabled ?? !0,
|
|
116
116
|
fields: {
|
|
117
|
-
...
|
|
118
|
-
...
|
|
117
|
+
...y?.sections?.general?.fields,
|
|
118
|
+
...c.settings_general_fields
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
profile: {
|
|
122
|
-
...
|
|
123
|
-
mode:
|
|
124
|
-
enabled:
|
|
122
|
+
...y?.sections?.profile,
|
|
123
|
+
mode: c.settings_profile_mode || y?.sections?.profile?.mode,
|
|
124
|
+
enabled: y?.sections?.profile?.enabled ?? !0,
|
|
125
125
|
fields: {
|
|
126
|
-
...
|
|
127
|
-
...
|
|
126
|
+
...y?.sections?.profile?.fields,
|
|
127
|
+
...c.settings_profile_fields
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
account: {
|
|
131
|
-
...
|
|
132
|
-
mode:
|
|
133
|
-
enabled:
|
|
131
|
+
...y?.sections?.account,
|
|
132
|
+
mode: c.settings_account_mode || y?.sections?.account?.mode,
|
|
133
|
+
enabled: y?.sections?.account?.enabled ?? !0,
|
|
134
134
|
fields: {
|
|
135
|
-
...
|
|
136
|
-
...
|
|
135
|
+
...y?.sections?.account?.fields,
|
|
136
|
+
...c.settings_account_fields
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
} :
|
|
140
|
+
} : y, [y, c]), j = O(() => new Ye({
|
|
141
141
|
defaultOptions: {
|
|
142
142
|
queries: {
|
|
143
143
|
staleTime: 5e3,
|
|
@@ -146,354 +146,349 @@ function Ua({
|
|
|
146
146
|
}
|
|
147
147
|
}), []);
|
|
148
148
|
$(() => {
|
|
149
|
-
|
|
150
|
-
api:
|
|
151
|
-
app:
|
|
149
|
+
M.init({
|
|
150
|
+
api: R,
|
|
151
|
+
app: B
|
|
152
152
|
});
|
|
153
|
-
}, [
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
Object.entries(
|
|
157
|
-
|
|
153
|
+
}, [B]);
|
|
154
|
+
const U = te(null), z = u?.resources;
|
|
155
|
+
z !== U.current && (U.current = z, z && Object.entries(z).forEach(([n, w]) => {
|
|
156
|
+
Object.entries(w).forEach(([D, E]) => {
|
|
157
|
+
S.addResourceBundle(n, D, E, !0, !0);
|
|
158
158
|
});
|
|
159
159
|
}));
|
|
160
|
-
const L =
|
|
161
|
-
|
|
162
|
-
Object.entries(
|
|
163
|
-
|
|
160
|
+
const L = te(null), V = c?.translations;
|
|
161
|
+
V && V !== L.current && (L.current = V, Object.entries(V).forEach(([n, w]) => {
|
|
162
|
+
Object.entries(w).forEach(([D, E]) => {
|
|
163
|
+
S.addResourceBundle(n, D, E, !0, !0);
|
|
164
164
|
});
|
|
165
165
|
}));
|
|
166
|
-
const K =
|
|
167
|
-
return
|
|
168
|
-
Object.entries(
|
|
169
|
-
|
|
166
|
+
const K = te(null), b = u?.instance;
|
|
167
|
+
return b && b !== K.current && (K.current = b, Object.entries(nt).forEach(([n, w]) => {
|
|
168
|
+
Object.entries(w).forEach(([D, E]) => {
|
|
169
|
+
b.hasResourceBundle(n, D) || b.addResourceBundle(n, D, E, !0, !1);
|
|
170
170
|
});
|
|
171
|
-
})), /* @__PURE__ */ e(
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
|
|
171
|
+
})), /* @__PURE__ */ e(at, { i18n: S, children: /* @__PURE__ */ r(Ze, { client: j, children: [
|
|
172
|
+
/* @__PURE__ */ r(
|
|
173
|
+
Fe,
|
|
174
174
|
{
|
|
175
|
-
components:
|
|
176
|
-
history:
|
|
177
|
-
welcome:
|
|
178
|
-
threadActions:
|
|
179
|
-
composer:
|
|
180
|
-
theme:
|
|
181
|
-
disclaimer:
|
|
182
|
-
app:
|
|
183
|
-
i18n:
|
|
175
|
+
components: l,
|
|
176
|
+
history: g,
|
|
177
|
+
welcome: C,
|
|
178
|
+
threadActions: A,
|
|
179
|
+
composer: q,
|
|
180
|
+
theme: N,
|
|
181
|
+
disclaimer: x,
|
|
182
|
+
app: B,
|
|
183
|
+
i18n: u,
|
|
184
184
|
settings: I,
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */ e(
|
|
187
|
-
/* @__PURE__ */ e(
|
|
186
|
+
/* @__PURE__ */ e(ta, {}),
|
|
187
|
+
/* @__PURE__ */ e(st, { defaultTheme: "system", storageKey: "chatbot-theme", config: N, children: a })
|
|
188
188
|
]
|
|
189
189
|
}
|
|
190
190
|
),
|
|
191
|
-
/* @__PURE__ */ e(
|
|
191
|
+
/* @__PURE__ */ e(ea, { richColors: !0 })
|
|
192
192
|
] }) });
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
const { app:
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
-
}, [
|
|
199
|
-
if (!
|
|
194
|
+
function ta() {
|
|
195
|
+
const { app: a } = re();
|
|
196
|
+
return je(), $(() => {
|
|
197
|
+
a?.name && (document.title = a.name);
|
|
198
|
+
}, [a?.name]), $(() => {
|
|
199
|
+
if (!a?.favicon) return;
|
|
200
200
|
let t = document.querySelector("link[rel~='icon']");
|
|
201
|
-
t || (t = document.createElement("link"), t.rel = "icon", document.head.appendChild(t)), t.href =
|
|
202
|
-
}, [
|
|
201
|
+
t || (t = document.createElement("link"), t.rel = "icon", document.head.appendChild(t)), t.href = a.favicon;
|
|
202
|
+
}, [a?.favicon]), null;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
const
|
|
206
|
-
const
|
|
207
|
-
if (p === (
|
|
208
|
-
if (
|
|
209
|
-
let
|
|
210
|
-
return
|
|
204
|
+
function _e() {
|
|
205
|
+
const a = Ve(), t = Ce(), u = M.getConfig().app?.basePath || "/", l = O(() => {
|
|
206
|
+
const h = a.pathname, p = h.endsWith("/") && h !== "/" ? h.slice(0, -1) : h, m = u.endsWith("/") && u !== "/" ? u.slice(0, -1) : u;
|
|
207
|
+
if (p === (m || "/")) return "/";
|
|
208
|
+
if (h.startsWith(m) && m !== "/") {
|
|
209
|
+
let N = h.slice(m.length);
|
|
210
|
+
return N.startsWith("/") || (N = "/" + N), N;
|
|
211
211
|
}
|
|
212
|
-
return
|
|
213
|
-
}, [
|
|
214
|
-
t(
|
|
215
|
-
}, [t,
|
|
216
|
-
return [
|
|
212
|
+
return m === "/" ? h : "/";
|
|
213
|
+
}, [a.pathname, u]), d = Y((h) => {
|
|
214
|
+
t(be(u, h || "/"), { replace: !1 });
|
|
215
|
+
}, [t, u]);
|
|
216
|
+
return [l, d];
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
const { t } =
|
|
218
|
+
function aa({ onFinish: a } = {}) {
|
|
219
|
+
const { t } = ce(["chat", "errors"]), i = pe(), u = M.getConfig(), l = u.app?.cacheNamespace || "gentiq", [d, h] = _e(), [p, m] = _(() => ue()), N = te(/* @__PURE__ */ new Set());
|
|
220
220
|
$(() => {
|
|
221
|
-
|
|
222
|
-
}, [
|
|
223
|
-
const
|
|
224
|
-
|
|
221
|
+
d === "/" ? m(ue()) : p && d !== `/${p}` && m(ue());
|
|
222
|
+
}, [d]);
|
|
223
|
+
const v = O(() => d === "/" ? p : d.replace(/^\//, ""), [d, p]), y = Y((b) => (N.current.add(b), b), []), c = Y(() => {
|
|
224
|
+
N.current.forEach((b) => URL.revokeObjectURL(b)), N.current.clear();
|
|
225
225
|
}, []);
|
|
226
|
-
$(() => () =>
|
|
226
|
+
$(() => () => c(), [c]);
|
|
227
227
|
const {
|
|
228
|
-
data:
|
|
229
|
-
isLoading:
|
|
230
|
-
isError:
|
|
231
|
-
} =
|
|
232
|
-
queryKey: [
|
|
228
|
+
data: P,
|
|
229
|
+
isLoading: S,
|
|
230
|
+
isError: R
|
|
231
|
+
} = et({
|
|
232
|
+
queryKey: [l, "threadMessages", v],
|
|
233
233
|
queryFn: async () => {
|
|
234
|
-
if (
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
return !
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
if (
|
|
234
|
+
if (d === "/") return [];
|
|
235
|
+
if (d === `/${p}`) return [];
|
|
236
|
+
const b = await M.getThreadMessages(v);
|
|
237
|
+
return !b.items || !Array.isArray(b.items) ? [] : Promise.all(
|
|
238
|
+
b.items.map(async (n) => {
|
|
239
|
+
const w = typeof n.content == "string" ? n.content : n.content?.text || JSON.stringify(n.content), E = [...Array.isArray(n.parts) && n.parts.length > 0 ? n.parts : [{ type: "text", text: w }]].sort((k, T) => k.type === "file" && T.type !== "file" ? -1 : k.type !== "file" && T.type === "file" ? 1 : 0), X = await Promise.all(
|
|
240
|
+
E.map(async (k) => {
|
|
241
|
+
if (k.type === "file" && k.object_name && !k.url)
|
|
242
242
|
try {
|
|
243
|
-
const
|
|
244
|
-
return { ...
|
|
245
|
-
} catch (
|
|
246
|
-
return console.warn("Load attachment failed:",
|
|
243
|
+
const T = await M.getAttachmentBlobUrl(k.object_name);
|
|
244
|
+
return { ...k, url: y(T), mediaType: k.mediaType || k.media_type };
|
|
245
|
+
} catch (T) {
|
|
246
|
+
return console.warn("Load attachment failed:", k.object_name, T), { ...k, mediaType: k.mediaType || k.media_type };
|
|
247
247
|
}
|
|
248
|
-
return
|
|
248
|
+
return k;
|
|
249
249
|
})
|
|
250
250
|
);
|
|
251
251
|
return {
|
|
252
|
-
id:
|
|
253
|
-
role:
|
|
254
|
-
parts:
|
|
255
|
-
metadata: { feedback:
|
|
252
|
+
id: n.id || ue(),
|
|
253
|
+
role: n.role,
|
|
254
|
+
parts: X,
|
|
255
|
+
metadata: { feedback: n.feedback }
|
|
256
256
|
};
|
|
257
257
|
})
|
|
258
258
|
);
|
|
259
259
|
},
|
|
260
|
-
enabled:
|
|
260
|
+
enabled: d !== "/",
|
|
261
261
|
staleTime: 5e3
|
|
262
262
|
// Keep history fresh for 5 seconds
|
|
263
|
-
}),
|
|
264
|
-
api:
|
|
265
|
-
fetch: async (
|
|
266
|
-
const
|
|
267
|
-
Object.entries(D).forEach(([
|
|
268
|
-
|
|
269
|
-
}),
|
|
270
|
-
const
|
|
271
|
-
if (!
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
throw new
|
|
275
|
-
|
|
276
|
-
throw
|
|
263
|
+
}), B = O(() => new Wt({
|
|
264
|
+
api: M.getEndpoint("chat", "/chat"),
|
|
265
|
+
fetch: async (b, n) => {
|
|
266
|
+
const w = new Headers(n?.headers), D = M.getHeaders();
|
|
267
|
+
Object.entries(D).forEach(([T, G]) => {
|
|
268
|
+
w.set(T, G);
|
|
269
|
+
}), w.set("X-Thread-Id", v);
|
|
270
|
+
const E = u.api?.basePath || "/api", X = typeof b == "string" && !b.startsWith("http") ? `${E}${b.startsWith("/") ? b : "/" + b}` : b, k = await fetch(X, { ...n, headers: w });
|
|
271
|
+
if (!k.ok) {
|
|
272
|
+
const T = await k.json().catch(() => ({}));
|
|
273
|
+
if (T.error && (typeof T.error.code == "string" || typeof T.error.message == "string"))
|
|
274
|
+
throw new Pe(T, k.status);
|
|
275
|
+
let G = k.statusText || `HTTP ${k.status}`, ae = "error", ee = null;
|
|
276
|
+
throw typeof T.detail == "string" ? G = T.detail : typeof T.message == "string" ? G = T.message : typeof T.error == "string" ? G = T.error : Array.isArray(T.detail) ? (G = "Validation failed", ee = T.detail, ae = "validation_error") : T.error && typeof T.error.message == "string" && (G = T.error.message), new Pe({
|
|
277
|
+
error: {
|
|
278
|
+
code: ae,
|
|
279
|
+
message: G,
|
|
280
|
+
details: ee
|
|
281
|
+
}
|
|
282
|
+
}, k.status);
|
|
277
283
|
}
|
|
278
|
-
return
|
|
284
|
+
return k;
|
|
279
285
|
}
|
|
280
|
-
}), [
|
|
281
|
-
|
|
282
|
-
}, [
|
|
283
|
-
id:
|
|
284
|
-
onFinish:
|
|
285
|
-
transport:
|
|
286
|
-
}), [
|
|
286
|
+
}), [v, u.api?.basePath]), C = Y(() => {
|
|
287
|
+
A("ready"), i.invalidateQueries({ queryKey: [l, "conversations"] }), a?.();
|
|
288
|
+
}, [i, a, l]), x = Gt({
|
|
289
|
+
id: v,
|
|
290
|
+
onFinish: C,
|
|
291
|
+
transport: B
|
|
292
|
+
}), [g, A] = _("idle"), [q, I] = _(null), j = Y(() => {
|
|
287
293
|
I(null);
|
|
288
294
|
}, []);
|
|
289
295
|
$(() => {
|
|
290
|
-
|
|
291
|
-
}, [
|
|
292
|
-
|
|
293
|
-
}, [
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
+
P && (d === `/${p}` || (x.setMessages(P), A("ready")));
|
|
297
|
+
}, [P, x.setMessages, d, p]), $(() => {
|
|
298
|
+
d === "/" && (x.setMessages([]), A("idle"));
|
|
299
|
+
}, [d, x.setMessages]), $(() => {
|
|
300
|
+
if (d === "/") {
|
|
301
|
+
A("idle");
|
|
296
302
|
return;
|
|
297
303
|
}
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
}, [
|
|
301
|
-
|
|
302
|
-
}, [
|
|
303
|
-
const
|
|
304
|
+
const b = d === `/${p}`;
|
|
305
|
+
S && !b ? A("loading-history") : R || q || x.error ? A("error") : x.status === "streaming" || x.status === "submitted" ? A(x.status) : A("ready");
|
|
306
|
+
}, [S, R, x.status, q, x.error, d, p]), $(() => () => {
|
|
307
|
+
x.stop();
|
|
308
|
+
}, [v, x.stop]);
|
|
309
|
+
const U = te(/* @__PURE__ */ new Set()), z = O(() => x.messages.filter((b) => b.role === "assistant"), [x.messages]);
|
|
304
310
|
$(() => {
|
|
305
|
-
let
|
|
306
|
-
for (const
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
|
|
311
|
+
let b = !1;
|
|
312
|
+
for (const n of z) {
|
|
313
|
+
if (U.current.has(n.id)) continue;
|
|
314
|
+
const w = n.parts.find((D) => D.type === "data-title");
|
|
315
|
+
w && w.data?.[0]?.title && (U.current.add(n.id), b = !0);
|
|
310
316
|
}
|
|
311
|
-
|
|
312
|
-
}, [
|
|
313
|
-
const L =
|
|
314
|
-
const
|
|
315
|
-
if (!(!D && (!
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
const
|
|
321
|
-
return
|
|
322
|
-
...
|
|
323
|
-
pages:
|
|
324
|
-
...
|
|
325
|
-
threads: [
|
|
326
|
-
} :
|
|
327
|
-
} : [
|
|
317
|
+
b && i.invalidateQueries({ queryKey: [l, "conversations"] });
|
|
318
|
+
}, [z, i, l]);
|
|
319
|
+
const L = Y(async (b, n) => {
|
|
320
|
+
const w = d === "/", D = b.trim();
|
|
321
|
+
if (!(!D && (!n || n.length === 0)) && !(g === "loading-history" || g === "streaming" || g === "submitted")) {
|
|
322
|
+
if (x.stop(), w) {
|
|
323
|
+
h(`/${v}`);
|
|
324
|
+
const E = D || t("attach_file"), X = E.length > 30 ? E.slice(0, 30) + "..." : E;
|
|
325
|
+
i.setQueryData([l, "conversations"], (k) => {
|
|
326
|
+
const T = { id: `/${v}`, firstMessage: X, timestamp: Date.now() };
|
|
327
|
+
return k && Array.isArray(k.pages) ? {
|
|
328
|
+
...k,
|
|
329
|
+
pages: k.pages.map((G, ae) => ae === 0 ? {
|
|
330
|
+
...G,
|
|
331
|
+
threads: [T, ...G.threads || []]
|
|
332
|
+
} : G)
|
|
333
|
+
} : [T, ...Array.isArray(k) ? k : []];
|
|
328
334
|
});
|
|
329
335
|
}
|
|
330
|
-
|
|
336
|
+
A("submitted"), I(null);
|
|
331
337
|
try {
|
|
332
|
-
await
|
|
333
|
-
} catch (
|
|
334
|
-
console.error("Failed to send message:",
|
|
335
|
-
const
|
|
336
|
-
I(new Error(
|
|
338
|
+
await x.sendMessage({ text: D, files: n });
|
|
339
|
+
} catch (E) {
|
|
340
|
+
console.error("Failed to send message:", E);
|
|
341
|
+
const X = le(E, t);
|
|
342
|
+
I(new Error(X)), A("error");
|
|
337
343
|
}
|
|
338
344
|
}
|
|
339
|
-
}, [
|
|
340
|
-
|
|
341
|
-
}, [
|
|
342
|
-
if (
|
|
343
|
-
if (
|
|
344
|
-
const
|
|
345
|
-
return new Error(
|
|
345
|
+
}, [x, h, d, v, t, i, g, l]), V = Y(() => {
|
|
346
|
+
x.stop(), A("ready"), i.invalidateQueries({ queryKey: [l, "conversations"] });
|
|
347
|
+
}, [x.stop, i, l]), K = O(() => {
|
|
348
|
+
if (q) return q;
|
|
349
|
+
if (x.error) {
|
|
350
|
+
const b = le(x.error, t);
|
|
351
|
+
return new Error(b);
|
|
346
352
|
}
|
|
347
353
|
return null;
|
|
348
|
-
}, [
|
|
349
|
-
return
|
|
350
|
-
...
|
|
354
|
+
}, [q, x.error, t]);
|
|
355
|
+
return O(() => ({
|
|
356
|
+
...x,
|
|
351
357
|
sendMessage: L,
|
|
352
|
-
stop:
|
|
353
|
-
clearError:
|
|
358
|
+
stop: V,
|
|
359
|
+
clearError: j,
|
|
354
360
|
error: K,
|
|
355
|
-
status:
|
|
361
|
+
status: g,
|
|
356
362
|
// Cast to any to satisfy Chat.tsx expectations of AI SDK statuses
|
|
357
|
-
isLoadingHistory:
|
|
358
|
-
isErrorHistory:
|
|
359
|
-
conversationId:
|
|
360
|
-
}), [
|
|
363
|
+
isLoadingHistory: g === "loading-history",
|
|
364
|
+
isErrorHistory: g === "error" || !!K || R,
|
|
365
|
+
conversationId: d
|
|
366
|
+
}), [x, L, V, j, K, g, R, d]);
|
|
361
367
|
}
|
|
362
|
-
function
|
|
363
|
-
const { t:
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}, [
|
|
367
|
-
const
|
|
368
|
+
function ra({ classNames: a = {}, disclaimer: t }) {
|
|
369
|
+
const { t: i, i18n: u } = ce(["chat", "translation"]), l = aa(), { messages: d, status: h, regenerate: p, error: m, clearError: N, stop: v, isLoadingHistory: y, conversationId: c, sendMessage: P } = l, { MessageList: S, PromptInput: R, disclaimer: B } = re(), C = t ?? B, x = u.exists("chat:disclaimer") ? i("chat:disclaimer") : null, g = typeof C == "string" ? i(C) : C ?? x, [A, q] = _(null), I = te(h);
|
|
370
|
+
Je(() => {
|
|
371
|
+
m && N();
|
|
372
|
+
}, [c, N, m]);
|
|
373
|
+
const j = d[d.length - 1], U = j?.role === "assistant" && (h === "ready" || j.parts.some((L) => L.type === "data-chat-finished"));
|
|
368
374
|
$(() => {
|
|
369
|
-
|
|
370
|
-
}, [
|
|
371
|
-
const
|
|
372
|
-
return /* @__PURE__ */
|
|
375
|
+
h === "error" && I.current !== "error" && A !== c ? q(c) : h === "submitted" && A !== null && q(null), I.current = h;
|
|
376
|
+
}, [h, c]);
|
|
377
|
+
const z = h === "error" && (c === "/" || A === c);
|
|
378
|
+
return /* @__PURE__ */ r("div", { className: f("relative flex flex-col h-full overflow-hidden", a.container), children: [
|
|
373
379
|
/* @__PURE__ */ e(
|
|
374
|
-
|
|
380
|
+
S,
|
|
375
381
|
{
|
|
376
|
-
messages:
|
|
377
|
-
status:
|
|
378
|
-
isLoadingHistory:
|
|
379
|
-
error:
|
|
380
|
-
conversationId:
|
|
382
|
+
messages: d,
|
|
383
|
+
status: h,
|
|
384
|
+
isLoadingHistory: y,
|
|
385
|
+
error: z ? m : null,
|
|
386
|
+
conversationId: c,
|
|
381
387
|
regen: (L) => p({ messageId: L }),
|
|
382
|
-
onSuggestionClick: (L) =>
|
|
383
|
-
chat:
|
|
384
|
-
className:
|
|
388
|
+
onSuggestionClick: (L) => P(L),
|
|
389
|
+
chat: l,
|
|
390
|
+
className: f("flex-1", a.messageList)
|
|
385
391
|
}
|
|
386
392
|
),
|
|
387
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ r("div", { className: "absolute bottom-0 left-0 right-0 z-10 pointer-events-none flex flex-col items-stretch", children: [
|
|
388
394
|
/* @__PURE__ */ e(
|
|
389
|
-
|
|
395
|
+
R,
|
|
390
396
|
{
|
|
391
|
-
onSend:
|
|
392
|
-
status:
|
|
393
|
-
isLastMessageFinished:
|
|
394
|
-
stop:
|
|
395
|
-
isErrorVisible:
|
|
396
|
-
conversationId:
|
|
397
|
-
className:
|
|
397
|
+
onSend: P,
|
|
398
|
+
status: h,
|
|
399
|
+
isLastMessageFinished: U,
|
|
400
|
+
stop: v,
|
|
401
|
+
isErrorVisible: z,
|
|
402
|
+
conversationId: c,
|
|
403
|
+
className: f("pointer-events-auto", a.inputArea, g && "pb-0 md:pb-0")
|
|
398
404
|
}
|
|
399
405
|
),
|
|
400
|
-
|
|
406
|
+
g && /* @__PURE__ */ r("div", { className: "relative py-1 px-4 flex justify-center items-center pointer-events-auto", children: [
|
|
401
407
|
/* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 top-[-20px] bg-background/80 backdrop-blur-sm [mask-image:linear-gradient(to_top,black_60%,transparent)] pointer-events-none -z-10" }),
|
|
402
|
-
/* @__PURE__ */ e("p", { className: "text-[10px] md:text-[11px] text-muted-foreground/60 select-none text-center leading-tight", children:
|
|
408
|
+
/* @__PURE__ */ e("p", { className: "text-[10px] md:text-[11px] text-muted-foreground/60 select-none text-center leading-tight", children: g })
|
|
403
409
|
] })
|
|
404
410
|
] })
|
|
405
411
|
] });
|
|
406
412
|
}
|
|
407
|
-
const
|
|
408
|
-
components:
|
|
413
|
+
const na = ({
|
|
414
|
+
components: a,
|
|
409
415
|
history: t,
|
|
410
|
-
welcome:
|
|
411
|
-
threadActions:
|
|
412
|
-
composer:
|
|
413
|
-
theme:
|
|
414
|
-
disclaimer:
|
|
416
|
+
welcome: i,
|
|
417
|
+
threadActions: u,
|
|
418
|
+
composer: l,
|
|
419
|
+
theme: d,
|
|
420
|
+
disclaimer: h,
|
|
415
421
|
...p
|
|
416
422
|
}) => {
|
|
417
|
-
const
|
|
418
|
-
...
|
|
419
|
-
...
|
|
423
|
+
const m = re(), N = O(() => ({
|
|
424
|
+
...m,
|
|
425
|
+
...a,
|
|
420
426
|
toolComponents: {
|
|
421
|
-
...
|
|
422
|
-
...
|
|
427
|
+
...m.toolComponents,
|
|
428
|
+
...a?.toolComponents
|
|
423
429
|
}
|
|
424
|
-
}), [
|
|
430
|
+
}), [m, a]);
|
|
425
431
|
return /* @__PURE__ */ e(
|
|
426
|
-
|
|
432
|
+
Fe,
|
|
427
433
|
{
|
|
428
|
-
components:
|
|
429
|
-
history: t ??
|
|
430
|
-
welcome:
|
|
431
|
-
threadActions:
|
|
432
|
-
composer:
|
|
433
|
-
theme:
|
|
434
|
-
disclaimer:
|
|
435
|
-
app:
|
|
436
|
-
i18n:
|
|
437
|
-
settings:
|
|
438
|
-
children: /* @__PURE__ */ e(
|
|
434
|
+
components: N,
|
|
435
|
+
history: t ?? m.history,
|
|
436
|
+
welcome: i ?? m.welcome,
|
|
437
|
+
threadActions: u ?? m.threadActions,
|
|
438
|
+
composer: l ?? m.composer,
|
|
439
|
+
theme: d ?? m.theme,
|
|
440
|
+
disclaimer: h ?? m.disclaimer,
|
|
441
|
+
app: m.app,
|
|
442
|
+
i18n: m.i18n,
|
|
443
|
+
settings: m.settings,
|
|
444
|
+
children: /* @__PURE__ */ e(ra, { ...p })
|
|
439
445
|
}
|
|
440
446
|
);
|
|
441
|
-
}
|
|
442
|
-
function
|
|
443
|
-
|
|
444
|
-
return Z.useEffect(() => {
|
|
445
|
-
const o = window.matchMedia(`(max-width: ${ge - 1}px)`), d = () => {
|
|
446
|
-
t(window.innerWidth < ge);
|
|
447
|
-
};
|
|
448
|
-
return o.addEventListener("change", d), t(window.innerWidth < ge), () => {
|
|
449
|
-
o.removeEventListener("change", d);
|
|
450
|
-
};
|
|
451
|
-
}, []), !!r;
|
|
452
|
-
}
|
|
453
|
-
function ra({ ...r }) {
|
|
454
|
-
return /* @__PURE__ */ e(re.Root, { "data-slot": "sheet", ...r });
|
|
447
|
+
};
|
|
448
|
+
function sa({ ...a }) {
|
|
449
|
+
return /* @__PURE__ */ e(se.Root, { "data-slot": "sheet", ...a });
|
|
455
450
|
}
|
|
456
|
-
function
|
|
457
|
-
return /* @__PURE__ */ e(
|
|
451
|
+
function oa({ ...a }) {
|
|
452
|
+
return /* @__PURE__ */ e(se.Portal, { "data-slot": "sheet-portal", ...a });
|
|
458
453
|
}
|
|
459
|
-
function
|
|
454
|
+
function ia({ className: a, ...t }) {
|
|
460
455
|
return /* @__PURE__ */ e(
|
|
461
|
-
|
|
456
|
+
se.Overlay,
|
|
462
457
|
{
|
|
463
458
|
"data-slot": "sheet-overlay",
|
|
464
|
-
className:
|
|
459
|
+
className: f(
|
|
465
460
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
466
|
-
|
|
461
|
+
a
|
|
467
462
|
),
|
|
468
463
|
...t
|
|
469
464
|
}
|
|
470
465
|
);
|
|
471
466
|
}
|
|
472
|
-
function
|
|
473
|
-
className:
|
|
467
|
+
function la({
|
|
468
|
+
className: a,
|
|
474
469
|
children: t,
|
|
475
|
-
side:
|
|
476
|
-
...
|
|
470
|
+
side: i = "right",
|
|
471
|
+
...u
|
|
477
472
|
}) {
|
|
478
|
-
return /* @__PURE__ */
|
|
479
|
-
/* @__PURE__ */ e(
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
|
|
473
|
+
return /* @__PURE__ */ r(oa, { children: [
|
|
474
|
+
/* @__PURE__ */ e(ia, {}),
|
|
475
|
+
/* @__PURE__ */ r(
|
|
476
|
+
se.Content,
|
|
482
477
|
{
|
|
483
478
|
"data-slot": "sheet-content",
|
|
484
|
-
className:
|
|
479
|
+
className: f(
|
|
485
480
|
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
481
|
+
i === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
482
|
+
i === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
483
|
+
i === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
484
|
+
i === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
485
|
+
a
|
|
491
486
|
),
|
|
492
|
-
...
|
|
487
|
+
...u,
|
|
493
488
|
children: [
|
|
494
489
|
t,
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */ e(
|
|
490
|
+
/* @__PURE__ */ r(se.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
491
|
+
/* @__PURE__ */ e(kt, { className: "size-4" }),
|
|
497
492
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
498
493
|
] })
|
|
499
494
|
]
|
|
@@ -501,141 +496,141 @@ function oa({
|
|
|
501
496
|
)
|
|
502
497
|
] });
|
|
503
498
|
}
|
|
504
|
-
function
|
|
505
|
-
return /* @__PURE__ */ e("div", { "data-slot": "sheet-header", className:
|
|
499
|
+
function ca({ className: a, ...t }) {
|
|
500
|
+
return /* @__PURE__ */ e("div", { "data-slot": "sheet-header", className: f("flex flex-col gap-1.5 p-4", a), ...t });
|
|
506
501
|
}
|
|
507
|
-
function
|
|
502
|
+
function da({ className: a, ...t }) {
|
|
508
503
|
return /* @__PURE__ */ e(
|
|
509
|
-
|
|
504
|
+
se.Title,
|
|
510
505
|
{
|
|
511
506
|
"data-slot": "sheet-title",
|
|
512
|
-
className:
|
|
507
|
+
className: f("text-foreground font-semibold", a),
|
|
513
508
|
...t
|
|
514
509
|
}
|
|
515
510
|
);
|
|
516
511
|
}
|
|
517
|
-
function
|
|
512
|
+
function ua({ className: a, ...t }) {
|
|
518
513
|
return /* @__PURE__ */ e(
|
|
519
|
-
|
|
514
|
+
se.Description,
|
|
520
515
|
{
|
|
521
516
|
"data-slot": "sheet-description",
|
|
522
|
-
className:
|
|
517
|
+
className: f("text-muted-foreground text-sm", a),
|
|
523
518
|
...t
|
|
524
519
|
}
|
|
525
520
|
);
|
|
526
521
|
}
|
|
527
|
-
const
|
|
528
|
-
function
|
|
529
|
-
const
|
|
530
|
-
if (!
|
|
522
|
+
const ma = "sidebar_state", ha = 3600 * 24 * 7, pa = "19rem", ga = "18rem", fa = "3rem", ba = "b", Ge = ne.createContext(null);
|
|
523
|
+
function ge() {
|
|
524
|
+
const a = ne.useContext(Ge);
|
|
525
|
+
if (!a)
|
|
531
526
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
532
|
-
return
|
|
527
|
+
return a;
|
|
533
528
|
}
|
|
534
|
-
function
|
|
535
|
-
defaultOpen:
|
|
529
|
+
function va({
|
|
530
|
+
defaultOpen: a = !0,
|
|
536
531
|
open: t,
|
|
537
|
-
onOpenChange:
|
|
538
|
-
className:
|
|
539
|
-
style:
|
|
540
|
-
children:
|
|
541
|
-
...
|
|
532
|
+
onOpenChange: i,
|
|
533
|
+
className: u,
|
|
534
|
+
style: l,
|
|
535
|
+
children: d,
|
|
536
|
+
...h
|
|
542
537
|
}) {
|
|
543
|
-
const p =
|
|
544
|
-
(
|
|
545
|
-
const
|
|
546
|
-
|
|
538
|
+
const p = ot(), [m, N] = ne.useState(!1), [v, y] = ne.useState(a), c = t ?? v, P = ne.useCallback(
|
|
539
|
+
(C) => {
|
|
540
|
+
const x = typeof C == "function" ? C(c) : C;
|
|
541
|
+
i ? i(x) : y(x), document.cookie = `${ma}=${x}; path=/; max-age=${ha}`;
|
|
547
542
|
},
|
|
548
|
-
[
|
|
549
|
-
),
|
|
550
|
-
p ?
|
|
551
|
-
}, [p,
|
|
552
|
-
|
|
553
|
-
const
|
|
554
|
-
|
|
543
|
+
[i, c]
|
|
544
|
+
), S = ne.useCallback(() => {
|
|
545
|
+
p ? N((C) => !C) : P((C) => !C);
|
|
546
|
+
}, [p, P, N]);
|
|
547
|
+
ne.useEffect(() => {
|
|
548
|
+
const C = (x) => {
|
|
549
|
+
x.key === ba && (x.metaKey || x.ctrlKey) && (x.preventDefault(), S());
|
|
555
550
|
};
|
|
556
|
-
return window.addEventListener("keydown",
|
|
557
|
-
window.removeEventListener("keydown",
|
|
551
|
+
return window.addEventListener("keydown", C), () => {
|
|
552
|
+
window.removeEventListener("keydown", C);
|
|
558
553
|
};
|
|
559
|
-
}, [
|
|
560
|
-
const
|
|
554
|
+
}, [S]);
|
|
555
|
+
const R = c ? "expanded" : "collapsed", B = ne.useMemo(
|
|
561
556
|
() => ({
|
|
562
|
-
state:
|
|
563
|
-
open:
|
|
564
|
-
setOpen:
|
|
557
|
+
state: R,
|
|
558
|
+
open: c,
|
|
559
|
+
setOpen: P,
|
|
565
560
|
isMobile: p,
|
|
566
|
-
openMobile:
|
|
567
|
-
setOpenMobile:
|
|
568
|
-
toggleSidebar:
|
|
561
|
+
openMobile: m,
|
|
562
|
+
setOpenMobile: N,
|
|
563
|
+
toggleSidebar: S
|
|
569
564
|
}),
|
|
570
|
-
[
|
|
565
|
+
[R, c, P, p, m, N, S]
|
|
571
566
|
);
|
|
572
|
-
return /* @__PURE__ */ e(
|
|
567
|
+
return /* @__PURE__ */ e(Ge.Provider, { value: B, children: /* @__PURE__ */ e(Oe, { delayDuration: 0, children: /* @__PURE__ */ e(
|
|
573
568
|
"div",
|
|
574
569
|
{
|
|
575
570
|
"data-slot": "sidebar-wrapper",
|
|
576
571
|
style: {
|
|
577
|
-
"--sidebar-width":
|
|
578
|
-
"--sidebar-width-icon":
|
|
579
|
-
...
|
|
572
|
+
"--sidebar-width": pa,
|
|
573
|
+
"--sidebar-width-icon": fa,
|
|
574
|
+
...l
|
|
580
575
|
},
|
|
581
|
-
className:
|
|
582
|
-
...
|
|
583
|
-
children:
|
|
576
|
+
className: f("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", u),
|
|
577
|
+
...h,
|
|
578
|
+
children: d
|
|
584
579
|
}
|
|
585
580
|
) }) });
|
|
586
581
|
}
|
|
587
|
-
function
|
|
588
|
-
side:
|
|
582
|
+
function xa({
|
|
583
|
+
side: a = "left",
|
|
589
584
|
variant: t = "sidebar",
|
|
590
|
-
collapsible:
|
|
591
|
-
className:
|
|
592
|
-
children:
|
|
593
|
-
...
|
|
585
|
+
collapsible: i = "offcanvas",
|
|
586
|
+
className: u,
|
|
587
|
+
children: l,
|
|
588
|
+
...d
|
|
594
589
|
}) {
|
|
595
|
-
const { isMobile:
|
|
596
|
-
return
|
|
590
|
+
const { isMobile: h, state: p, openMobile: m, setOpenMobile: N } = ge();
|
|
591
|
+
return i === "none" ? /* @__PURE__ */ e(
|
|
597
592
|
"div",
|
|
598
593
|
{
|
|
599
594
|
"data-slot": "sidebar",
|
|
600
|
-
className:
|
|
601
|
-
...
|
|
602
|
-
children:
|
|
595
|
+
className: f("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", u),
|
|
596
|
+
...d,
|
|
597
|
+
children: l
|
|
603
598
|
}
|
|
604
|
-
) :
|
|
605
|
-
|
|
599
|
+
) : h ? /* @__PURE__ */ e(sa, { open: m, onOpenChange: N, ...d, children: /* @__PURE__ */ r(
|
|
600
|
+
la,
|
|
606
601
|
{
|
|
607
|
-
onOpenAutoFocus: (
|
|
602
|
+
onOpenAutoFocus: (v) => v.preventDefault(),
|
|
608
603
|
"data-sidebar": "sidebar",
|
|
609
604
|
"data-slot": "sidebar",
|
|
610
605
|
"data-mobile": "true",
|
|
611
606
|
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
612
607
|
style: {
|
|
613
|
-
"--sidebar-width":
|
|
608
|
+
"--sidebar-width": ga
|
|
614
609
|
},
|
|
615
|
-
side:
|
|
610
|
+
side: a,
|
|
616
611
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */ e(
|
|
619
|
-
/* @__PURE__ */ e(
|
|
612
|
+
/* @__PURE__ */ r(ca, { className: "sr-only", children: [
|
|
613
|
+
/* @__PURE__ */ e(da, { children: "Sidebar" }),
|
|
614
|
+
/* @__PURE__ */ e(ua, { children: "Displays the mobile sidebar." })
|
|
620
615
|
] }),
|
|
621
|
-
/* @__PURE__ */ e("div", { className: "flex h-full w-full flex-col", children:
|
|
616
|
+
/* @__PURE__ */ e("div", { className: "flex h-full w-full flex-col", children: l })
|
|
622
617
|
]
|
|
623
618
|
}
|
|
624
|
-
) }) : /* @__PURE__ */
|
|
619
|
+
) }) : /* @__PURE__ */ r(
|
|
625
620
|
"div",
|
|
626
621
|
{
|
|
627
622
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
628
623
|
"data-state": p,
|
|
629
|
-
"data-collapsible": p === "collapsed" ?
|
|
624
|
+
"data-collapsible": p === "collapsed" ? i : "",
|
|
630
625
|
"data-variant": t,
|
|
631
|
-
"data-side":
|
|
626
|
+
"data-side": a,
|
|
632
627
|
"data-slot": "sidebar",
|
|
633
628
|
children: [
|
|
634
629
|
/* @__PURE__ */ e(
|
|
635
630
|
"div",
|
|
636
631
|
{
|
|
637
632
|
"data-slot": "sidebar-gap",
|
|
638
|
-
className:
|
|
633
|
+
className: f(
|
|
639
634
|
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
640
635
|
"group-data-[collapsible=offcanvas]:w-0",
|
|
641
636
|
"group-data-[side=right]:rotate-180",
|
|
@@ -647,21 +642,21 @@ function ba({
|
|
|
647
642
|
"div",
|
|
648
643
|
{
|
|
649
644
|
"data-slot": "sidebar-container",
|
|
650
|
-
className:
|
|
645
|
+
className: f(
|
|
651
646
|
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
652
|
-
|
|
647
|
+
a === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
653
648
|
// Adjust the padding for floating and inset variants.
|
|
654
649
|
t === "floating" || t === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
655
|
-
|
|
650
|
+
u
|
|
656
651
|
),
|
|
657
|
-
...
|
|
652
|
+
...d,
|
|
658
653
|
children: /* @__PURE__ */ e(
|
|
659
654
|
"div",
|
|
660
655
|
{
|
|
661
656
|
"data-sidebar": "sidebar",
|
|
662
657
|
"data-slot": "sidebar-inner",
|
|
663
658
|
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
664
|
-
children:
|
|
659
|
+
children: l
|
|
665
660
|
}
|
|
666
661
|
)
|
|
667
662
|
}
|
|
@@ -670,97 +665,97 @@ function ba({
|
|
|
670
665
|
}
|
|
671
666
|
);
|
|
672
667
|
}
|
|
673
|
-
function
|
|
674
|
-
const { toggleSidebar:
|
|
675
|
-
return /* @__PURE__ */
|
|
676
|
-
|
|
668
|
+
function ya({ className: a, onClick: t, ...i }) {
|
|
669
|
+
const { toggleSidebar: u } = ge();
|
|
670
|
+
return /* @__PURE__ */ r(
|
|
671
|
+
Z,
|
|
677
672
|
{
|
|
678
673
|
"data-sidebar": "trigger",
|
|
679
674
|
"data-slot": "sidebar-trigger",
|
|
680
675
|
variant: "ghost",
|
|
681
676
|
size: "icon",
|
|
682
|
-
className:
|
|
683
|
-
onClick: (
|
|
684
|
-
t?.(
|
|
677
|
+
className: f("size-7", a),
|
|
678
|
+
onClick: (l) => {
|
|
679
|
+
t?.(l), u();
|
|
685
680
|
},
|
|
686
|
-
...
|
|
681
|
+
...i,
|
|
687
682
|
children: [
|
|
688
|
-
/* @__PURE__ */ e(
|
|
683
|
+
/* @__PURE__ */ e(Ct, {}),
|
|
689
684
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
690
685
|
]
|
|
691
686
|
}
|
|
692
687
|
);
|
|
693
688
|
}
|
|
694
|
-
function
|
|
689
|
+
function wa({ className: a, ...t }) {
|
|
695
690
|
return /* @__PURE__ */ e(
|
|
696
691
|
"div",
|
|
697
692
|
{
|
|
698
693
|
"data-slot": "sidebar-footer",
|
|
699
694
|
"data-sidebar": "footer",
|
|
700
|
-
className:
|
|
695
|
+
className: f("flex flex-col gap-2 p-2", a),
|
|
701
696
|
...t
|
|
702
697
|
}
|
|
703
698
|
);
|
|
704
699
|
}
|
|
705
|
-
function
|
|
700
|
+
function Na({ className: a, ...t }) {
|
|
706
701
|
return /* @__PURE__ */ e(
|
|
707
702
|
"div",
|
|
708
703
|
{
|
|
709
704
|
"data-slot": "sidebar-content",
|
|
710
705
|
"data-sidebar": "content",
|
|
711
|
-
className:
|
|
706
|
+
className: f(
|
|
712
707
|
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
713
|
-
|
|
708
|
+
a
|
|
714
709
|
),
|
|
715
710
|
...t
|
|
716
711
|
}
|
|
717
712
|
);
|
|
718
713
|
}
|
|
719
|
-
function
|
|
714
|
+
function ka({ className: a, ...t }) {
|
|
720
715
|
return /* @__PURE__ */ e(
|
|
721
716
|
"div",
|
|
722
717
|
{
|
|
723
718
|
"data-slot": "sidebar-group",
|
|
724
719
|
"data-sidebar": "group",
|
|
725
|
-
className:
|
|
720
|
+
className: f("relative flex w-full min-w-0 flex-col p-2", a),
|
|
726
721
|
...t
|
|
727
722
|
}
|
|
728
723
|
);
|
|
729
724
|
}
|
|
730
|
-
function
|
|
725
|
+
function Ee({ className: a, ...t }) {
|
|
731
726
|
return /* @__PURE__ */ e(
|
|
732
727
|
"div",
|
|
733
728
|
{
|
|
734
729
|
"data-slot": "sidebar-group-content",
|
|
735
730
|
"data-sidebar": "group-content",
|
|
736
|
-
className:
|
|
731
|
+
className: f("w-full text-sm", a),
|
|
737
732
|
...t
|
|
738
733
|
}
|
|
739
734
|
);
|
|
740
735
|
}
|
|
741
|
-
function
|
|
736
|
+
function Le({ className: a, ...t }) {
|
|
742
737
|
return /* @__PURE__ */ e(
|
|
743
738
|
"ul",
|
|
744
739
|
{
|
|
745
740
|
"data-slot": "sidebar-menu",
|
|
746
741
|
"data-sidebar": "menu",
|
|
747
|
-
className:
|
|
742
|
+
className: f("flex w-full min-w-0 flex-col gap-1", a),
|
|
748
743
|
...t
|
|
749
744
|
}
|
|
750
745
|
);
|
|
751
746
|
}
|
|
752
|
-
function
|
|
747
|
+
function Ae({ className: a, ...t }) {
|
|
753
748
|
return /* @__PURE__ */ e(
|
|
754
749
|
"li",
|
|
755
750
|
{
|
|
756
751
|
"data-slot": "sidebar-menu-item",
|
|
757
752
|
"data-sidebar": "menu-item",
|
|
758
|
-
className:
|
|
753
|
+
className: f("group/menu-item relative", a),
|
|
759
754
|
...t
|
|
760
755
|
}
|
|
761
756
|
);
|
|
762
757
|
}
|
|
763
|
-
const
|
|
758
|
+
const Ca = Zt(
|
|
764
759
|
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-start text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
765
760
|
{
|
|
766
761
|
variants: {
|
|
@@ -780,184 +775,184 @@ const Na = Xt(
|
|
|
780
775
|
}
|
|
781
776
|
}
|
|
782
777
|
);
|
|
783
|
-
function
|
|
784
|
-
asChild:
|
|
778
|
+
function ze({
|
|
779
|
+
asChild: a = !1,
|
|
785
780
|
isActive: t = !1,
|
|
786
|
-
variant:
|
|
787
|
-
size:
|
|
788
|
-
tooltip:
|
|
789
|
-
className:
|
|
790
|
-
...
|
|
781
|
+
variant: i = "default",
|
|
782
|
+
size: u = "default",
|
|
783
|
+
tooltip: l,
|
|
784
|
+
className: d,
|
|
785
|
+
...h
|
|
791
786
|
}) {
|
|
792
|
-
const p =
|
|
787
|
+
const p = a ? Yt : "button", { isMobile: m, state: N } = ge(), v = /* @__PURE__ */ e(
|
|
793
788
|
p,
|
|
794
789
|
{
|
|
795
790
|
"data-slot": "sidebar-menu-button",
|
|
796
791
|
"data-sidebar": "menu-button",
|
|
797
|
-
"data-size":
|
|
792
|
+
"data-size": u,
|
|
798
793
|
"data-active": t,
|
|
799
|
-
className:
|
|
800
|
-
...
|
|
794
|
+
className: f(Ca({ variant: i, size: u }), d),
|
|
795
|
+
...h
|
|
801
796
|
}
|
|
802
797
|
);
|
|
803
|
-
return
|
|
804
|
-
children:
|
|
805
|
-
}), /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */ e(
|
|
807
|
-
/* @__PURE__ */ e(
|
|
808
|
-
] })) :
|
|
798
|
+
return l ? (typeof l == "string" && (l = {
|
|
799
|
+
children: l
|
|
800
|
+
}), /* @__PURE__ */ r($e, { children: [
|
|
801
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: v }),
|
|
802
|
+
/* @__PURE__ */ e(Ue, { side: "right", align: "center", hidden: N !== "collapsed" || m, ...l })
|
|
803
|
+
] })) : v;
|
|
809
804
|
}
|
|
810
|
-
function
|
|
811
|
-
const { t, i18n:
|
|
812
|
-
{ id: "general", label: t("sections.general", "General"), icon:
|
|
813
|
-
{ id: "profile", label: t("sections.profile", "Profile"), icon:
|
|
814
|
-
{ id: "account", label: t("sections.account", "Account"), icon:
|
|
815
|
-
].filter((
|
|
816
|
-
const
|
|
817
|
-
return (
|
|
818
|
-
}), [t,
|
|
819
|
-
const
|
|
820
|
-
return
|
|
821
|
-
}, [
|
|
805
|
+
function _a({ trigger: a }) {
|
|
806
|
+
const { t, i18n: i } = ce(["settings", "translation"]), { app: u, settings: l } = re(), { theme: d, setTheme: h, accent: p, setAccent: m, radius: N, setRadius: v } = Ke(), [y, c] = _(null), [P, S] = _(!1), R = te(null), B = O(() => [
|
|
807
|
+
{ id: "general", label: t("sections.general", "General"), icon: Me },
|
|
808
|
+
{ id: "profile", label: t("sections.profile", "Profile"), icon: _t },
|
|
809
|
+
{ id: "account", label: t("sections.account", "Account"), icon: St }
|
|
810
|
+
].filter((F) => {
|
|
811
|
+
const s = l?.sections?.[F.id];
|
|
812
|
+
return (s?.mode ?? (s?.enabled === !1 ? "hidden" : "editable")) !== "hidden";
|
|
813
|
+
}), [t, l]), [C, x] = _(B[0]?.id || "general"), g = Y((o, F, s = "editable") => {
|
|
814
|
+
const H = l?.sections?.[o]?.fields;
|
|
815
|
+
return H && H[F] || s;
|
|
816
|
+
}, [l]), [A, q] = _(""), [I, j] = _(""), [U, z] = _(""), [L, V] = _(""), K = O(() => u?.userMetadataFields?.filter((o) => o.showInProfile) || [], [u?.userMetadataFields]), [b, n] = _({}), [w, D] = _(!1), E = i.language === "fa", X = E ? "text-right" : "text-left", k = Y(async () => {
|
|
822
817
|
try {
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
const
|
|
826
|
-
K.forEach((
|
|
827
|
-
|
|
828
|
-
}),
|
|
829
|
-
} catch (
|
|
830
|
-
console.error("Failed to fetch user:",
|
|
818
|
+
const o = await M.getMe();
|
|
819
|
+
c(o), q(o.name || ""), j(o.surname || ""), z(o.phone || "");
|
|
820
|
+
const F = {};
|
|
821
|
+
K.forEach((s) => {
|
|
822
|
+
F[s.key] = o.metadata?.[s.key] ?? s.defaultValue ?? "";
|
|
823
|
+
}), n(F);
|
|
824
|
+
} catch (o) {
|
|
825
|
+
console.error("Failed to fetch user:", o), J.error(le(o, t));
|
|
831
826
|
}
|
|
832
827
|
}, [t, K]);
|
|
833
828
|
$(() => {
|
|
834
|
-
if (!
|
|
835
|
-
|
|
829
|
+
if (!P) {
|
|
830
|
+
R.current = null;
|
|
836
831
|
return;
|
|
837
832
|
}
|
|
838
|
-
(
|
|
839
|
-
}, [
|
|
840
|
-
const
|
|
841
|
-
let
|
|
842
|
-
K.forEach((
|
|
843
|
-
|
|
844
|
-
}),
|
|
845
|
-
}, [
|
|
846
|
-
const
|
|
833
|
+
(R.current === null || C === "account") && k(), R.current = C;
|
|
834
|
+
}, [P, C, k]), $(() => {
|
|
835
|
+
const o = { ...b };
|
|
836
|
+
let F = !1;
|
|
837
|
+
K.forEach((s) => {
|
|
838
|
+
s.condition && !he(s.condition, b) && o[s.key] !== void 0 && (delete o[s.key], F = !0);
|
|
839
|
+
}), F && n(o);
|
|
840
|
+
}, [b, K]);
|
|
841
|
+
const T = async () => {
|
|
847
842
|
D(!0);
|
|
848
843
|
try {
|
|
849
|
-
const
|
|
850
|
-
L && (
|
|
851
|
-
} catch (
|
|
852
|
-
|
|
844
|
+
const o = { name: A, surname: I, phone: U, metadata: b };
|
|
845
|
+
L && (o.password = L), await M.updateMe(o), J.success(t("profile.success", "Profile updated successfully")), V(""), k();
|
|
846
|
+
} catch (o) {
|
|
847
|
+
J.error(le(o, t));
|
|
853
848
|
} finally {
|
|
854
849
|
D(!1);
|
|
855
850
|
}
|
|
856
|
-
},
|
|
857
|
-
window.confirm(t("account.logout_confirm", "Are you sure you want to logout?")) && (
|
|
858
|
-
},
|
|
859
|
-
|
|
860
|
-
},
|
|
861
|
-
return /* @__PURE__ */
|
|
862
|
-
/* @__PURE__ */ e(
|
|
851
|
+
}, G = () => {
|
|
852
|
+
window.confirm(t("account.logout_confirm", "Are you sure you want to logout?")) && (M.clearToken(), window.location.reload());
|
|
853
|
+
}, ae = (o) => {
|
|
854
|
+
i.changeLanguage(o);
|
|
855
|
+
}, ee = y ? Math.max(0, Math.min(100, y.balance.tokens / (y.balance.token_limit || 1) * 100)) : 0, oe = y ? Math.max(0, Math.min(100, y.balance.requests / (y.balance.request_limit || 1) * 100)) : 0;
|
|
856
|
+
return /* @__PURE__ */ r(He, { open: P, onOpenChange: S, children: [
|
|
857
|
+
/* @__PURE__ */ e(it, { asChild: !0, children: a || /* @__PURE__ */ e(Z, { variant: "ghost", size: "icon", className: "rounded-full", children: /* @__PURE__ */ e(Ne, { className: "h-5 w-5" }) }) }),
|
|
863
858
|
/* @__PURE__ */ e(
|
|
864
|
-
|
|
859
|
+
Qe,
|
|
865
860
|
{
|
|
866
|
-
dir:
|
|
867
|
-
className:
|
|
861
|
+
dir: E ? "rtl" : "ltr",
|
|
862
|
+
className: f(
|
|
868
863
|
"w-full sm:w-[95vw] sm:max-w-[700px] p-0 gap-0 overflow-hidden rounded-t-2xl sm:rounded-3xl border-none shadow-2xl bg-background/95 backdrop-blur-md h-[90vh] sm:h-[750px]",
|
|
869
|
-
|
|
864
|
+
E && "rtl"
|
|
870
865
|
),
|
|
871
|
-
children: /* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between px-4 sm:px-6 mb-2 sm:mb-4", children: /* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */ e("div", { className: "bg-primary/10 p-1.5 rounded-lg", children: /* @__PURE__ */ e(
|
|
866
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col h-full w-full min-h-0 overflow-hidden", children: [
|
|
867
|
+
/* @__PURE__ */ r("div", { className: "w-full bg-muted/20 sm:bg-muted/30 border-b border-border/40 pt-12 sm:pt-6 flex flex-col shrink-0", children: [
|
|
868
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between px-4 sm:px-6 mb-2 sm:mb-4", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
869
|
+
/* @__PURE__ */ e("div", { className: "bg-primary/10 p-1.5 rounded-lg", children: /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-primary" }) }),
|
|
875
870
|
/* @__PURE__ */ e("span", { className: "font-bold text-lg", children: t("title", "Settings") })
|
|
876
871
|
] }) }),
|
|
877
|
-
/* @__PURE__ */ e("div", { className: "w-full overflow-x-auto no-scrollbar pt-2 px-2 sm:px-4", children: /* @__PURE__ */ e("nav", { className: "flex items-center gap-2 sm:gap-6 w-max", children:
|
|
872
|
+
/* @__PURE__ */ e("div", { className: "w-full overflow-x-auto no-scrollbar pt-2 px-2 sm:px-4", children: /* @__PURE__ */ e("nav", { className: "flex items-center gap-2 sm:gap-6 w-max", children: B.map((o) => /* @__PURE__ */ r(
|
|
878
873
|
"button",
|
|
879
874
|
{
|
|
880
|
-
onClick: () =>
|
|
881
|
-
className:
|
|
875
|
+
onClick: () => x(o.id),
|
|
876
|
+
className: f(
|
|
882
877
|
"flex items-center gap-1.5 sm:gap-2 pb-2 sm:pb-3 pt-1 px-2 sm:px-1 text-sm sm:text-base font-medium transition-all border-b-2 whitespace-nowrap shrink-0",
|
|
883
|
-
|
|
884
|
-
|
|
878
|
+
C === o.id ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border",
|
|
879
|
+
l?.sections?.[o.id]?.mode === "faded" && "opacity-50 pointer-events-none select-none"
|
|
885
880
|
),
|
|
886
881
|
children: [
|
|
887
|
-
/* @__PURE__ */ e(
|
|
882
|
+
/* @__PURE__ */ e(o.icon, { className: f(
|
|
888
883
|
"h-3.5 w-3.5 sm:h-4 sm:w-4 transition-transform",
|
|
889
|
-
|
|
884
|
+
C === o.id && "scale-110"
|
|
890
885
|
) }),
|
|
891
|
-
|
|
886
|
+
o.label
|
|
892
887
|
]
|
|
893
888
|
},
|
|
894
|
-
|
|
889
|
+
o.id
|
|
895
890
|
)) }) })
|
|
896
891
|
] }),
|
|
897
|
-
/* @__PURE__ */ e("div", { className: "flex-1 relative min-h-0 h-full bg-background", children: /* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ e("div", { className: "flex-1 relative min-h-0 h-full bg-background", children: /* @__PURE__ */ r("div", { className: "absolute inset-0 overflow-y-auto p-5 sm:p-8 pt-12 sm:pt-12 custom-scrollbar", children: [
|
|
893
|
+
C === "profile" && /* @__PURE__ */ r("div", { className: "space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-300", children: [
|
|
894
|
+
/* @__PURE__ */ r("div", { children: [
|
|
900
895
|
/* @__PURE__ */ e("h2", { className: "text-xl font-bold tracking-tight", children: t("profile.title", "Profile Information") }),
|
|
901
896
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("profile.subtitle", "Update your personal details below.") })
|
|
902
897
|
] }),
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
|
|
898
|
+
/* @__PURE__ */ r("div", { className: "grid gap-6", children: [
|
|
899
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
900
|
+
g("profile", "name") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "name") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
906
901
|
/* @__PURE__ */ e(Q, { htmlFor: "name", className: "px-1", children: t("profile.name", "First Name") }),
|
|
907
902
|
/* @__PURE__ */ e(
|
|
908
|
-
|
|
903
|
+
W,
|
|
909
904
|
{
|
|
910
905
|
id: "name",
|
|
911
|
-
value:
|
|
912
|
-
onChange: (
|
|
913
|
-
disabled:
|
|
914
|
-
className:
|
|
906
|
+
value: A,
|
|
907
|
+
onChange: (o) => q(o.target.value),
|
|
908
|
+
disabled: g("profile", "name") === "faded",
|
|
909
|
+
className: f("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", X)
|
|
915
910
|
}
|
|
916
911
|
)
|
|
917
912
|
] }),
|
|
918
|
-
|
|
913
|
+
g("profile", "surname") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "surname") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
919
914
|
/* @__PURE__ */ e(Q, { htmlFor: "surname", className: "px-1", children: t("profile.surname", "Last Name") }),
|
|
920
915
|
/* @__PURE__ */ e(
|
|
921
|
-
|
|
916
|
+
W,
|
|
922
917
|
{
|
|
923
918
|
id: "surname",
|
|
924
919
|
value: I,
|
|
925
|
-
onChange: (
|
|
926
|
-
disabled:
|
|
927
|
-
className:
|
|
920
|
+
onChange: (o) => j(o.target.value),
|
|
921
|
+
disabled: g("profile", "surname") === "faded",
|
|
922
|
+
className: f("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", X)
|
|
928
923
|
}
|
|
929
924
|
)
|
|
930
925
|
] })
|
|
931
926
|
] }),
|
|
932
|
-
|
|
927
|
+
g("profile", "phone") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "phone") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
933
928
|
/* @__PURE__ */ e(Q, { htmlFor: "phone", className: "px-1 text-left", children: t("profile.phone", "Phone Number") }),
|
|
934
|
-
/* @__PURE__ */
|
|
935
|
-
/* @__PURE__ */ e(
|
|
929
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
930
|
+
/* @__PURE__ */ e(Pt, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground left-3" }),
|
|
936
931
|
/* @__PURE__ */ e(
|
|
937
|
-
|
|
932
|
+
W,
|
|
938
933
|
{
|
|
939
934
|
id: "phone",
|
|
940
|
-
value:
|
|
941
|
-
onChange: (
|
|
942
|
-
disabled:
|
|
935
|
+
value: U,
|
|
936
|
+
onChange: (o) => z(o.target.value),
|
|
937
|
+
disabled: g("profile", "phone") === "faded",
|
|
943
938
|
className: "bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary pl-10 pr-3 text-left",
|
|
944
939
|
dir: "ltr"
|
|
945
940
|
}
|
|
946
941
|
)
|
|
947
942
|
] })
|
|
948
943
|
] }),
|
|
949
|
-
|
|
944
|
+
g("profile", "password") !== "hidden" && /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3", g("profile", "password") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
950
945
|
/* @__PURE__ */ e(Q, { htmlFor: "pass", className: "px-1 text-left", children: t("profile.password", "New Password") }),
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */ e(
|
|
946
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
947
|
+
/* @__PURE__ */ e(Tt, { className: "absolute top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground left-3" }),
|
|
953
948
|
/* @__PURE__ */ e(
|
|
954
|
-
|
|
949
|
+
W,
|
|
955
950
|
{
|
|
956
951
|
id: "pass",
|
|
957
952
|
type: "password",
|
|
958
953
|
value: L,
|
|
959
|
-
onChange: (
|
|
960
|
-
disabled:
|
|
954
|
+
onChange: (o) => V(o.target.value),
|
|
955
|
+
disabled: g("profile", "password") === "faded",
|
|
961
956
|
placeholder: t("profile.password_placeholder", "Leave empty to keep current"),
|
|
962
957
|
className: "bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary pl-10 pr-3 text-left",
|
|
963
958
|
dir: "ltr"
|
|
@@ -965,125 +960,125 @@ function ka({ trigger: r }) {
|
|
|
965
960
|
)
|
|
966
961
|
] })
|
|
967
962
|
] }),
|
|
968
|
-
K.map((
|
|
969
|
-
const
|
|
970
|
-
return
|
|
971
|
-
/* @__PURE__ */ e(Q, { htmlFor: `profile-${
|
|
972
|
-
|
|
973
|
-
|
|
963
|
+
K.map((o) => {
|
|
964
|
+
const F = g("profile", o.key, o.mode || "editable");
|
|
965
|
+
return F === "hidden" || !he(o.condition, b) ? null : /* @__PURE__ */ r("div", { className: f("flex flex-col gap-3 animate-in fade-in slide-in-from-top-1 duration-200", F === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
966
|
+
/* @__PURE__ */ e(Q, { htmlFor: `profile-${o.key}`, className: "px-1", children: t(o.label) }),
|
|
967
|
+
o.type === "select" ? /* @__PURE__ */ r(
|
|
968
|
+
ve,
|
|
974
969
|
{
|
|
975
|
-
value: String(
|
|
976
|
-
onValueChange: (
|
|
977
|
-
disabled:
|
|
978
|
-
dir:
|
|
970
|
+
value: String(b[o.key] || ""),
|
|
971
|
+
onValueChange: (s) => n({ ...b, [o.key]: s }),
|
|
972
|
+
disabled: F === "faded",
|
|
973
|
+
dir: E ? "rtl" : "ltr",
|
|
979
974
|
children: [
|
|
980
|
-
/* @__PURE__ */ e(
|
|
981
|
-
/* @__PURE__ */ e(
|
|
975
|
+
/* @__PURE__ */ e(xe, { className: "bg-muted/30 border-border/50 rounded-xl focus:ring-primary h-11", children: /* @__PURE__ */ e(ye, { placeholder: t(o.placeholder || "profile.select_placeholder") }) }),
|
|
976
|
+
/* @__PURE__ */ e(we, { className: "rounded-xl border-border/40 shadow-xl bg-background/95 backdrop-blur-md", children: o.options?.map((s) => /* @__PURE__ */ e(me, { value: String(s.value), className: "rounded-lg focus:bg-primary/10", children: t(s.label) }, String(s.value))) })
|
|
982
977
|
]
|
|
983
978
|
}
|
|
984
|
-
) :
|
|
979
|
+
) : o.type === "checkbox" ? /* @__PURE__ */ r("div", { className: "flex items-center gap-3 px-1 py-1", children: [
|
|
985
980
|
/* @__PURE__ */ e(
|
|
986
981
|
"input",
|
|
987
982
|
{
|
|
988
|
-
id: `profile-${
|
|
983
|
+
id: `profile-${o.key}`,
|
|
989
984
|
type: "checkbox",
|
|
990
|
-
checked: !!
|
|
991
|
-
disabled:
|
|
992
|
-
onChange: (
|
|
985
|
+
checked: !!b[o.key],
|
|
986
|
+
disabled: F === "faded",
|
|
987
|
+
onChange: (s) => n({ ...b, [o.key]: s.target.checked }),
|
|
993
988
|
className: "h-5 w-5 rounded-md border-border/50 bg-muted/30 text-primary focus:ring-primary transition-all cursor-pointer"
|
|
994
989
|
}
|
|
995
990
|
),
|
|
996
|
-
/* @__PURE__ */ e(Q, { htmlFor: `profile-${
|
|
991
|
+
/* @__PURE__ */ e(Q, { htmlFor: `profile-${o.key}`, className: "text-sm font-medium text-muted-foreground cursor-pointer", children: t(o.placeholder || o.label) })
|
|
997
992
|
] }) : /* @__PURE__ */ e(
|
|
998
|
-
|
|
993
|
+
W,
|
|
999
994
|
{
|
|
1000
|
-
id: `profile-${
|
|
1001
|
-
type:
|
|
1002
|
-
value:
|
|
1003
|
-
disabled:
|
|
1004
|
-
onChange: (
|
|
1005
|
-
placeholder: t(
|
|
1006
|
-
className:
|
|
995
|
+
id: `profile-${o.key}`,
|
|
996
|
+
type: o.type,
|
|
997
|
+
value: b[o.key] || "",
|
|
998
|
+
disabled: F === "faded",
|
|
999
|
+
onChange: (s) => n({ ...b, [o.key]: s.target.value }),
|
|
1000
|
+
placeholder: t(o.placeholder || ""),
|
|
1001
|
+
className: f("bg-muted/30 border-border/50 rounded-xl focus-visible:ring-primary h-11", X)
|
|
1007
1002
|
}
|
|
1008
1003
|
)
|
|
1009
|
-
] },
|
|
1004
|
+
] }, o.key);
|
|
1010
1005
|
}),
|
|
1011
|
-
/* @__PURE__ */ e("div", { className: "pt-4 flex justify-center", children: /* @__PURE__ */
|
|
1012
|
-
|
|
1006
|
+
/* @__PURE__ */ e("div", { className: "pt-4 flex justify-center", children: /* @__PURE__ */ r(
|
|
1007
|
+
Z,
|
|
1013
1008
|
{
|
|
1014
|
-
onClick:
|
|
1015
|
-
disabled:
|
|
1009
|
+
onClick: T,
|
|
1010
|
+
disabled: w,
|
|
1016
1011
|
className: "w-full sm:w-auto px-8 rounded-xl gap-2 font-semibold shadow-lg shadow-primary/20 h-11 transition-all active:scale-[0.98]",
|
|
1017
1012
|
children: [
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1019
|
-
|
|
1013
|
+
/* @__PURE__ */ e(Mt, { className: "h-4 w-4" }),
|
|
1014
|
+
w ? t("profile.saving", "Saving...") : t("profile.save", "Save Changes")
|
|
1020
1015
|
]
|
|
1021
1016
|
}
|
|
1022
1017
|
) })
|
|
1023
1018
|
] })
|
|
1024
1019
|
] }),
|
|
1025
|
-
|
|
1026
|
-
/* @__PURE__ */
|
|
1020
|
+
C === "general" && /* @__PURE__ */ r("div", { className: "space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300", children: [
|
|
1021
|
+
/* @__PURE__ */ r("div", { children: [
|
|
1027
1022
|
/* @__PURE__ */ e("h2", { className: "text-xl font-bold tracking-tight", children: t("general.title", "General Settings") }),
|
|
1028
1023
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("general.subtitle", "Configure look and feel and language.") })
|
|
1029
1024
|
] }),
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */ e(
|
|
1025
|
+
/* @__PURE__ */ r("div", { className: "space-y-8", children: [
|
|
1026
|
+
g("general", "theme") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-3", g("general", "theme") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
1027
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1028
|
+
/* @__PURE__ */ e(Me, { className: "h-4 w-4 text-primary" }),
|
|
1034
1029
|
t("general.theme", "Theme")
|
|
1035
1030
|
] }),
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ r("div", { className: "flex p-1 bg-muted/50 rounded-2xl border border-border/40 w-full", children: [
|
|
1032
|
+
/* @__PURE__ */ r(
|
|
1038
1033
|
"button",
|
|
1039
1034
|
{
|
|
1040
|
-
onClick: () =>
|
|
1041
|
-
disabled:
|
|
1042
|
-
className:
|
|
1035
|
+
onClick: () => h("light"),
|
|
1036
|
+
disabled: g("general", "theme") === "faded",
|
|
1037
|
+
className: f(
|
|
1043
1038
|
"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
|
|
1044
|
-
|
|
1039
|
+
d === "light" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1045
1040
|
),
|
|
1046
1041
|
children: [
|
|
1047
|
-
/* @__PURE__ */ e(
|
|
1042
|
+
/* @__PURE__ */ e(Dt, { className: "h-4 w-4" }),
|
|
1048
1043
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: t("general.themes.light", "Light") })
|
|
1049
1044
|
]
|
|
1050
1045
|
}
|
|
1051
1046
|
),
|
|
1052
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ r(
|
|
1053
1048
|
"button",
|
|
1054
1049
|
{
|
|
1055
|
-
onClick: () =>
|
|
1056
|
-
disabled:
|
|
1057
|
-
className:
|
|
1050
|
+
onClick: () => h("dark"),
|
|
1051
|
+
disabled: g("general", "theme") === "faded",
|
|
1052
|
+
className: f(
|
|
1058
1053
|
"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
|
|
1059
|
-
|
|
1054
|
+
d === "dark" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1060
1055
|
),
|
|
1061
1056
|
children: [
|
|
1062
|
-
/* @__PURE__ */ e(
|
|
1057
|
+
/* @__PURE__ */ e(It, { className: "h-4 w-4" }),
|
|
1063
1058
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: t("general.themes.dark", "Dark") })
|
|
1064
1059
|
]
|
|
1065
1060
|
}
|
|
1066
1061
|
),
|
|
1067
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ r(
|
|
1068
1063
|
"button",
|
|
1069
1064
|
{
|
|
1070
|
-
onClick: () =>
|
|
1071
|
-
disabled:
|
|
1072
|
-
className:
|
|
1065
|
+
onClick: () => h("system"),
|
|
1066
|
+
disabled: g("general", "theme") === "faded",
|
|
1067
|
+
className: f(
|
|
1073
1068
|
"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl transition-all",
|
|
1074
|
-
|
|
1069
|
+
d === "system" ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1075
1070
|
),
|
|
1076
1071
|
children: [
|
|
1077
|
-
/* @__PURE__ */ e(
|
|
1072
|
+
/* @__PURE__ */ e(Et, { className: "h-4 w-4" }),
|
|
1078
1073
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: t("general.themes.system", "System") })
|
|
1079
1074
|
]
|
|
1080
1075
|
}
|
|
1081
1076
|
)
|
|
1082
1077
|
] })
|
|
1083
1078
|
] }),
|
|
1084
|
-
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */ e(
|
|
1079
|
+
g("general", "accent") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-4", g("general", "accent") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
1080
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1081
|
+
/* @__PURE__ */ e(De, { className: "h-4 w-4 text-primary" }),
|
|
1087
1082
|
t("general.accent", "Accent Color")
|
|
1088
1083
|
] }),
|
|
1089
1084
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 sm:grid-cols-8 gap-3 w-full", children: [
|
|
@@ -1103,68 +1098,68 @@ function ka({ trigger: r }) {
|
|
|
1103
1098
|
// Teal
|
|
1104
1099
|
"oklch(0.552 0.016 285.938)"
|
|
1105
1100
|
// Slate
|
|
1106
|
-
].map((
|
|
1107
|
-
const
|
|
1101
|
+
].map((o) => {
|
|
1102
|
+
const F = (p || "oklch(0.623 0.214 259.815)") === o;
|
|
1108
1103
|
return /* @__PURE__ */ e(
|
|
1109
1104
|
"button",
|
|
1110
1105
|
{
|
|
1111
|
-
onClick: () =>
|
|
1112
|
-
disabled:
|
|
1113
|
-
className:
|
|
1106
|
+
onClick: () => m(o),
|
|
1107
|
+
disabled: g("general", "accent") === "faded",
|
|
1108
|
+
className: f(
|
|
1114
1109
|
"h-8 w-8 rounded-full border-2 transition-all hover:scale-110 active:scale-95 shadow-sm",
|
|
1115
|
-
|
|
1110
|
+
F ? "border-foreground" : "border-transparent"
|
|
1116
1111
|
),
|
|
1117
|
-
style: { backgroundColor:
|
|
1112
|
+
style: { backgroundColor: o }
|
|
1118
1113
|
},
|
|
1119
|
-
|
|
1114
|
+
o
|
|
1120
1115
|
);
|
|
1121
1116
|
}) })
|
|
1122
1117
|
] }),
|
|
1123
|
-
|
|
1124
|
-
/* @__PURE__ */
|
|
1118
|
+
g("general", "radius") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-4", g("general", "radius") === "faded" && "opacity-50 pointer-events-none select-none"), children: [
|
|
1119
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1125
1120
|
/* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-md border-2 border-primary" }),
|
|
1126
1121
|
t("general.radius", "Rounded Corners")
|
|
1127
1122
|
] }),
|
|
1128
1123
|
/* @__PURE__ */ e("div", { className: "flex p-1 bg-muted/50 rounded-2xl border border-border/40 w-full", children: [
|
|
1129
1124
|
{ id: "sharp", value: "0.3rem" },
|
|
1130
1125
|
{ id: "round", value: "1.25rem" }
|
|
1131
|
-
].map((
|
|
1132
|
-
const
|
|
1126
|
+
].map((o) => {
|
|
1127
|
+
const F = (N || "1.25rem") === o.value;
|
|
1133
1128
|
return /* @__PURE__ */ e(
|
|
1134
1129
|
"button",
|
|
1135
1130
|
{
|
|
1136
|
-
onClick: () =>
|
|
1137
|
-
disabled:
|
|
1138
|
-
className:
|
|
1131
|
+
onClick: () => v(o.value),
|
|
1132
|
+
disabled: g("general", "radius") === "faded",
|
|
1133
|
+
className: f(
|
|
1139
1134
|
"flex-1 py-2 rounded-xl transition-all text-sm font-medium",
|
|
1140
|
-
|
|
1135
|
+
F ? "bg-background shadow-md text-primary" : "text-muted-foreground hover:text-foreground"
|
|
1141
1136
|
),
|
|
1142
|
-
children: t(`general.radius_levels.${
|
|
1137
|
+
children: t(`general.radius_levels.${o.id}`)
|
|
1143
1138
|
},
|
|
1144
|
-
|
|
1139
|
+
o.id
|
|
1145
1140
|
);
|
|
1146
1141
|
}) })
|
|
1147
1142
|
] }),
|
|
1148
|
-
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */ e(
|
|
1143
|
+
g("general", "language") !== "hidden" && /* @__PURE__ */ r("div", { className: f("space-y-3", g("general", "language") === "faded" && "opacity-50"), children: [
|
|
1144
|
+
/* @__PURE__ */ r(Q, { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
1145
|
+
/* @__PURE__ */ e(Lt, { className: "h-4 w-4 text-primary" }),
|
|
1151
1146
|
t("general.language", "Language")
|
|
1152
1147
|
] }),
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
|
|
1148
|
+
/* @__PURE__ */ r(
|
|
1149
|
+
ve,
|
|
1155
1150
|
{
|
|
1156
|
-
value:
|
|
1157
|
-
onValueChange:
|
|
1158
|
-
disabled:
|
|
1159
|
-
dir:
|
|
1151
|
+
value: i.language,
|
|
1152
|
+
onValueChange: ae,
|
|
1153
|
+
disabled: g("general", "language") === "faded",
|
|
1154
|
+
dir: E ? "rtl" : "ltr",
|
|
1160
1155
|
children: [
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */ e(me, { value: "en", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ e(xe, { className: "w-full bg-muted/50 rounded-2xl border-border/40 h-11 focus:ring-primary/20", children: /* @__PURE__ */ e(ye, { placeholder: t("general.language_placeholder", "Select language") }) }),
|
|
1157
|
+
/* @__PURE__ */ r(we, { className: "rounded-2xl border-border/40 shadow-xl bg-background/95 backdrop-blur-md", children: [
|
|
1158
|
+
/* @__PURE__ */ e(me, { value: "en", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
1164
1159
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-muted-foreground mr-1", children: "EN" }),
|
|
1165
1160
|
t("general.languages.en", "English")
|
|
1166
1161
|
] }) }),
|
|
1167
|
-
/* @__PURE__ */ e(me, { value: "fa", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ e(me, { value: "fa", className: "rounded-xl focus:bg-primary/10", children: /* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
1168
1163
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold text-muted-foreground mr-1", children: "FA" }),
|
|
1169
1164
|
t("general.languages.fa", "Persian")
|
|
1170
1165
|
] }) })
|
|
@@ -1175,76 +1170,76 @@ function ka({ trigger: r }) {
|
|
|
1175
1170
|
] })
|
|
1176
1171
|
] })
|
|
1177
1172
|
] }),
|
|
1178
|
-
|
|
1179
|
-
/* @__PURE__ */
|
|
1173
|
+
C === "account" && /* @__PURE__ */ r("div", { className: "space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300", children: [
|
|
1174
|
+
/* @__PURE__ */ r("div", { children: [
|
|
1180
1175
|
/* @__PURE__ */ e("h2", { className: "text-xl font-bold tracking-tight", children: t("account.title", "Account & Usage") }),
|
|
1181
1176
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t("account.subtitle", "Monitor your quotas and manage your session.") })
|
|
1182
1177
|
] }),
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */ e(
|
|
1178
|
+
/* @__PURE__ */ r("div", { className: "space-y-6", children: [
|
|
1179
|
+
g("account", "balance") !== "hidden" && /* @__PURE__ */ r("div", { className: f("p-6 bg-muted/30 rounded-3xl border border-border/40 space-y-6", g("account", "balance") === "faded" && "opacity-50"), children: [
|
|
1180
|
+
/* @__PURE__ */ r(Q, { className: "text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2", children: [
|
|
1181
|
+
/* @__PURE__ */ e(At, { className: "h-4 w-4" }),
|
|
1187
1182
|
t("account.balance", "Current Balance")
|
|
1188
1183
|
] }),
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
1184
|
+
/* @__PURE__ */ r("div", { className: "space-y-5", children: [
|
|
1185
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
1186
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm mb-1", children: [
|
|
1192
1187
|
/* @__PURE__ */ e("span", { className: "font-medium text-muted-foreground", children: t("account.tokens", "Tokens") }),
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
|
|
1188
|
+
/* @__PURE__ */ r("span", { className: "font-bold text-primary", children: [
|
|
1189
|
+
ee.toLocaleString(i.language, { maximumFractionDigits: 0 }),
|
|
1195
1190
|
"%"
|
|
1196
1191
|
] })
|
|
1197
1192
|
] }),
|
|
1198
1193
|
/* @__PURE__ */ e("div", { className: "h-2.5 w-full bg-muted/50 rounded-full overflow-hidden border border-border/20 p-0.5", dir: "ltr", children: /* @__PURE__ */ e(
|
|
1199
1194
|
"div",
|
|
1200
1195
|
{
|
|
1201
|
-
className:
|
|
1196
|
+
className: f(
|
|
1202
1197
|
"h-full rounded-full transition-all duration-1000 shadow-sm",
|
|
1203
|
-
|
|
1198
|
+
ee > 60 ? "bg-emerald-500 shadow-emerald-500/20" : ee > 20 ? "bg-amber-500 shadow-amber-500/20" : "bg-destructive shadow-destructive/20"
|
|
1204
1199
|
),
|
|
1205
|
-
style: { width: `${
|
|
1200
|
+
style: { width: `${ee}%` }
|
|
1206
1201
|
}
|
|
1207
1202
|
) })
|
|
1208
1203
|
] }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */ e(
|
|
1204
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
1205
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm mb-1", children: [
|
|
1206
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-muted-foreground flex items-center gap-1.5 focus:outline-none", children: [
|
|
1207
|
+
/* @__PURE__ */ e(De, { className: "h-3.5 w-3.5 text-blue-500" }),
|
|
1213
1208
|
t("account.requests", "Requests")
|
|
1214
1209
|
] }),
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
|
|
1210
|
+
/* @__PURE__ */ r("span", { className: "font-bold text-primary", children: [
|
|
1211
|
+
oe.toLocaleString(i.language, { maximumFractionDigits: 0 }),
|
|
1217
1212
|
"%"
|
|
1218
1213
|
] })
|
|
1219
1214
|
] }),
|
|
1220
1215
|
/* @__PURE__ */ e("div", { className: "h-2.5 w-full bg-muted/50 rounded-full overflow-hidden border border-border/20 p-0.5", dir: "ltr", children: /* @__PURE__ */ e(
|
|
1221
1216
|
"div",
|
|
1222
1217
|
{
|
|
1223
|
-
className:
|
|
1218
|
+
className: f(
|
|
1224
1219
|
"h-full rounded-full transition-all duration-1000 shadow-sm",
|
|
1225
|
-
|
|
1220
|
+
oe > 60 ? "bg-emerald-500 shadow-emerald-500/20" : oe > 20 ? "bg-amber-500 shadow-amber-500/20" : "bg-destructive shadow-destructive/20"
|
|
1226
1221
|
),
|
|
1227
|
-
style: { width: `${
|
|
1222
|
+
style: { width: `${oe}%` }
|
|
1228
1223
|
}
|
|
1229
1224
|
) })
|
|
1230
1225
|
] })
|
|
1231
1226
|
] })
|
|
1232
1227
|
] }),
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
|
|
1228
|
+
/* @__PURE__ */ r("div", { className: "pt-2 flex flex-col gap-3", children: [
|
|
1229
|
+
y?.balance.updated_at && g("account", "balance") !== "hidden" && /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground px-1", children: [
|
|
1235
1230
|
t("account.last_recharge", "Last balance update on"),
|
|
1236
1231
|
": ",
|
|
1237
|
-
new Date(
|
|
1232
|
+
new Date(y.balance.updated_at).toLocaleDateString(i.language)
|
|
1238
1233
|
] }),
|
|
1239
|
-
|
|
1240
|
-
|
|
1234
|
+
g("account", "logout") !== "hidden" && /* @__PURE__ */ r(
|
|
1235
|
+
Z,
|
|
1241
1236
|
{
|
|
1242
1237
|
variant: "destructive",
|
|
1243
|
-
onClick:
|
|
1244
|
-
disabled:
|
|
1245
|
-
className:
|
|
1238
|
+
onClick: G,
|
|
1239
|
+
disabled: g("account", "logout") === "faded",
|
|
1240
|
+
className: f("rounded-2xl gap-2 font-bold h-12 shadow-lg shadow-destructive/10 transition-all active:scale-[0.98]", g("account", "logout") === "faded" && "opacity-50 pointer-events-none"),
|
|
1246
1241
|
children: [
|
|
1247
|
-
/* @__PURE__ */ e(
|
|
1242
|
+
/* @__PURE__ */ e(zt, { className: "h-4 w-4" }),
|
|
1248
1243
|
t("account.logout", "Logout from Account")
|
|
1249
1244
|
]
|
|
1250
1245
|
}
|
|
@@ -1258,53 +1253,53 @@ function ka({ trigger: r }) {
|
|
|
1258
1253
|
)
|
|
1259
1254
|
] });
|
|
1260
1255
|
}
|
|
1261
|
-
function
|
|
1262
|
-
const [, t] =
|
|
1256
|
+
function We({ hideActions: a = !1 }) {
|
|
1257
|
+
const [, t] = _e(), { t: i } = ce(["sidebar", "chat"]), { history: u, app: l } = re(), { theme: d } = Ke(), h = !a && (u?.enabled ?? !0), [p, m] = _("light");
|
|
1263
1258
|
$(() => {
|
|
1264
|
-
if (
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1259
|
+
if (d === "system") {
|
|
1260
|
+
const y = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1261
|
+
m(y ? "dark" : "light");
|
|
1267
1262
|
} else
|
|
1268
|
-
|
|
1269
|
-
}, [
|
|
1270
|
-
const
|
|
1271
|
-
return /* @__PURE__ */
|
|
1272
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 md:gap-2 min-w-[36px] md:min-w-[80px]", children:
|
|
1263
|
+
m(d);
|
|
1264
|
+
}, [d]);
|
|
1265
|
+
const N = O(() => l?.logo ? typeof l.logo == "string" ? l.logo : p === "dark" ? l.logo.dark : l.logo.light : lt, [l?.logo, p]), v = l?.name || "Gentiq";
|
|
1266
|
+
return /* @__PURE__ */ r("header", { className: "relative flex items-center justify-between px-3 md:px-4 h-14 sticky top-0 z-40 w-full glass border-b border-border/30 transition-all duration-300", children: [
|
|
1267
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 md:gap-2 min-w-[36px] md:min-w-[80px]", children: h && /* @__PURE__ */ e(ya, { className: "hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 rounded-lg size-9" }) }),
|
|
1273
1268
|
/* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2.5 select-none animate-in fade-in zoom-in-95 duration-500", children: /* @__PURE__ */ e(
|
|
1274
1269
|
"img",
|
|
1275
1270
|
{
|
|
1276
|
-
src:
|
|
1277
|
-
alt:
|
|
1271
|
+
src: N,
|
|
1272
|
+
alt: v,
|
|
1278
1273
|
className: "size-8 object-contain"
|
|
1279
1274
|
}
|
|
1280
1275
|
) }) }),
|
|
1281
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-[36px] md:min-w-[80px] justify-end", children: !
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
/* @__PURE__ */ e(
|
|
1276
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1.5 min-w-[36px] md:min-w-[80px] justify-end", children: !a && /* @__PURE__ */ r(ke, { children: [
|
|
1277
|
+
/* @__PURE__ */ r($e, { children: [
|
|
1278
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1284
1279
|
"button",
|
|
1285
1280
|
{
|
|
1286
1281
|
type: "button",
|
|
1287
|
-
className:
|
|
1282
|
+
className: f(
|
|
1288
1283
|
"flex items-center justify-center size-9 rounded-lg hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 text-muted-foreground hover:text-primary",
|
|
1289
|
-
|
|
1284
|
+
h && "md:hidden"
|
|
1290
1285
|
),
|
|
1291
1286
|
onClick: () => {
|
|
1292
1287
|
t("/");
|
|
1293
1288
|
},
|
|
1294
|
-
children: /* @__PURE__ */ e(
|
|
1289
|
+
children: /* @__PURE__ */ e(Rt, { className: "size-5" })
|
|
1295
1290
|
}
|
|
1296
1291
|
) }),
|
|
1297
|
-
/* @__PURE__ */ e(
|
|
1292
|
+
/* @__PURE__ */ e(Ue, { side: "bottom", className: "text-xs", children: i("new_chat") })
|
|
1298
1293
|
] }),
|
|
1299
|
-
|
|
1300
|
-
|
|
1294
|
+
l?.showSettings !== !1 && /* @__PURE__ */ e(
|
|
1295
|
+
_a,
|
|
1301
1296
|
{
|
|
1302
1297
|
trigger: /* @__PURE__ */ e(
|
|
1303
1298
|
"button",
|
|
1304
1299
|
{
|
|
1305
1300
|
type: "button",
|
|
1306
1301
|
className: "flex items-center justify-center size-9 rounded-lg hover:bg-accent/60 transition-all duration-200 hover:scale-105 active:scale-95 text-muted-foreground hover:text-primary",
|
|
1307
|
-
children: /* @__PURE__ */ e(
|
|
1302
|
+
children: /* @__PURE__ */ e(Ne, { className: "size-5" })
|
|
1308
1303
|
}
|
|
1309
1304
|
)
|
|
1310
1305
|
}
|
|
@@ -1312,219 +1307,219 @@ function Qe({ hideActions: r = !1 }) {
|
|
|
1312
1307
|
] }) })
|
|
1313
1308
|
] });
|
|
1314
1309
|
}
|
|
1315
|
-
const
|
|
1316
|
-
function
|
|
1317
|
-
const t =
|
|
1318
|
-
return
|
|
1310
|
+
const Re = 20;
|
|
1311
|
+
function Sa() {
|
|
1312
|
+
const t = M.getConfig().app?.cacheNamespace || "gentiq";
|
|
1313
|
+
return tt({
|
|
1319
1314
|
queryKey: [t, "conversations"],
|
|
1320
|
-
queryFn: async ({ pageParam:
|
|
1321
|
-
const
|
|
1315
|
+
queryFn: async ({ pageParam: i = 0 }) => {
|
|
1316
|
+
const u = await M.getHistory(i, Re);
|
|
1322
1317
|
return {
|
|
1323
|
-
threads:
|
|
1324
|
-
id: `/${
|
|
1325
|
-
firstMessage:
|
|
1326
|
-
timestamp: new Date(
|
|
1327
|
-
pinned: !!
|
|
1318
|
+
threads: u.threads.map((l) => ({
|
|
1319
|
+
id: `/${l.id}`,
|
|
1320
|
+
firstMessage: l.title || l.firstMessage || "Chat",
|
|
1321
|
+
timestamp: new Date(l.created_at).getTime(),
|
|
1322
|
+
pinned: !!l.pinned
|
|
1328
1323
|
})),
|
|
1329
|
-
nextSkip:
|
|
1330
|
-
hasMore:
|
|
1324
|
+
nextSkip: i + Re,
|
|
1325
|
+
hasMore: i + u.threads.length < (u.total_count ?? 0)
|
|
1331
1326
|
};
|
|
1332
1327
|
},
|
|
1333
1328
|
initialPageParam: 0,
|
|
1334
|
-
getNextPageParam: (
|
|
1329
|
+
getNextPageParam: (i) => i.hasMore ? i.nextSkip : void 0,
|
|
1335
1330
|
staleTime: 1e3 * 60 * 5
|
|
1336
1331
|
// 5 minutes
|
|
1337
1332
|
});
|
|
1338
1333
|
}
|
|
1339
|
-
async function
|
|
1340
|
-
const
|
|
1334
|
+
async function Pa(a, t, i, u) {
|
|
1335
|
+
const d = M.getConfig().app?.cacheNamespace || "gentiq";
|
|
1341
1336
|
try {
|
|
1342
|
-
await
|
|
1343
|
-
} catch (
|
|
1344
|
-
console.error("Failed to delete conversation:",
|
|
1337
|
+
await M.deleteThread(a), t.invalidateQueries({ queryKey: [d, "conversations"] }), u === a && i("/");
|
|
1338
|
+
} catch (h) {
|
|
1339
|
+
console.error("Failed to delete conversation:", h), J.error("Failed to delete conversation");
|
|
1345
1340
|
}
|
|
1346
1341
|
}
|
|
1347
|
-
function
|
|
1348
|
-
const { t, i18n:
|
|
1342
|
+
function Ta({ side: a = "left" }) {
|
|
1343
|
+
const { t, i18n: i } = ce(["sidebar", "translation"]), { setOpenMobile: u, isMobile: l } = ge(), {
|
|
1349
1344
|
data: d,
|
|
1350
|
-
fetchNextPage:
|
|
1351
|
-
hasNextPage:
|
|
1345
|
+
fetchNextPage: h,
|
|
1346
|
+
hasNextPage: p,
|
|
1352
1347
|
isFetchingNextPage: m,
|
|
1353
|
-
isLoading:
|
|
1354
|
-
} =
|
|
1355
|
-
(
|
|
1356
|
-
|
|
1357
|
-
(
|
|
1358
|
-
|
|
1348
|
+
isLoading: N
|
|
1349
|
+
} = Sa(), { history: v, app: y } = re(), c = y?.basePath || "/", P = v?.enabled ?? !1, S = d?.pages.flatMap((s) => s.threads) ?? [], [R, B] = _e(), C = pe(), x = te(null), g = Y(
|
|
1350
|
+
(s) => {
|
|
1351
|
+
x.current && (x.current.disconnect(), x.current = null), s && p && !m && (x.current = new IntersectionObserver(
|
|
1352
|
+
(H) => {
|
|
1353
|
+
H[0].isIntersecting && h();
|
|
1359
1354
|
},
|
|
1360
1355
|
{
|
|
1361
1356
|
threshold: 0,
|
|
1362
1357
|
rootMargin: "100px"
|
|
1363
1358
|
}
|
|
1364
|
-
),
|
|
1359
|
+
), x.current.observe(s));
|
|
1365
1360
|
},
|
|
1366
|
-
[
|
|
1367
|
-
),
|
|
1368
|
-
|
|
1369
|
-
}, [
|
|
1370
|
-
(
|
|
1371
|
-
).sort((
|
|
1361
|
+
[p, h, m]
|
|
1362
|
+
), q = M.getConfig().app?.cacheNamespace || "gentiq", [I, j] = _(!1), [U, z] = _(null), [L, V] = _(""), [K, b] = _(null), [n, w] = _(""), D = te(null), E = Y((s, H) => {
|
|
1363
|
+
s.button !== 0 || s.metaKey || s.ctrlKey || (s.preventDefault(), B(H), l && u(!1));
|
|
1364
|
+
}, [B, l, u]), X = S.filter(
|
|
1365
|
+
(s) => s.firstMessage?.toLowerCase().includes(L.toLowerCase())
|
|
1366
|
+
).sort((s, H) => s.pinned && !H.pinned ? -1 : !s.pinned && H.pinned ? 1 : H.timestamp - s.timestamp), k = async (s) => {
|
|
1372
1367
|
try {
|
|
1373
|
-
await
|
|
1368
|
+
await M.pinThread(s.id.replace(/^\//, ""), !s.pinned), C.invalidateQueries({ queryKey: [q, "conversations"] }), J.success(s.pinned ? t("unpinned_success") : t("pinned_success"));
|
|
1374
1369
|
} catch {
|
|
1375
|
-
|
|
1370
|
+
J.error(t("pin_failed"));
|
|
1376
1371
|
}
|
|
1377
|
-
},
|
|
1372
|
+
}, T = async (s) => {
|
|
1378
1373
|
try {
|
|
1379
|
-
const
|
|
1380
|
-
navigator.clipboard.writeText(
|
|
1374
|
+
const H = await M.shareThread(s.id.replace(/^\//, "")), fe = `${window.location.origin}${H.url}`;
|
|
1375
|
+
navigator.clipboard.writeText(fe), J.success(t("share_success"), {
|
|
1381
1376
|
description: t("share_description")
|
|
1382
1377
|
});
|
|
1383
1378
|
} catch {
|
|
1384
|
-
|
|
1379
|
+
J.error(t("share_failed"));
|
|
1385
1380
|
}
|
|
1386
|
-
},
|
|
1387
|
-
|
|
1388
|
-
},
|
|
1389
|
-
|
|
1390
|
-
},
|
|
1391
|
-
if (
|
|
1381
|
+
}, G = (s) => {
|
|
1382
|
+
b(s.id), w(s.firstMessage ?? ""), setTimeout(() => D.current?.focus(), 0);
|
|
1383
|
+
}, ae = (s) => {
|
|
1384
|
+
s?.preventDefault(), s?.stopPropagation(), b(null), w("");
|
|
1385
|
+
}, ee = async (s) => {
|
|
1386
|
+
if (s?.preventDefault(), s && "stopPropagation" in s && s.stopPropagation(), !(!K || !n.trim()))
|
|
1392
1387
|
try {
|
|
1393
|
-
await
|
|
1388
|
+
await M.updateThreadTitle(K, n), C.invalidateQueries({ queryKey: [q, "conversations"] }), b(null), J.success(t("rename_success"));
|
|
1394
1389
|
} catch {
|
|
1395
|
-
|
|
1390
|
+
J.error(t("rename_failed"));
|
|
1396
1391
|
}
|
|
1397
|
-
},
|
|
1398
|
-
|
|
1399
|
-
},
|
|
1400
|
-
|
|
1401
|
-
},
|
|
1392
|
+
}, oe = (s) => {
|
|
1393
|
+
z(s), j(!0);
|
|
1394
|
+
}, o = () => {
|
|
1395
|
+
U && (Pa(U.id, C, B, R), j(!1), z(null), J.success(t("chat_deleted_success")));
|
|
1396
|
+
}, F = (s) => new Intl.DateTimeFormat(i.language, {
|
|
1402
1397
|
year: "numeric",
|
|
1403
1398
|
month: "short",
|
|
1404
1399
|
day: "numeric",
|
|
1405
1400
|
hour: "2-digit",
|
|
1406
1401
|
minute: "2-digit",
|
|
1407
|
-
calendar:
|
|
1408
|
-
}).format(new Date(
|
|
1409
|
-
return /* @__PURE__ */ e(
|
|
1410
|
-
/* @__PURE__ */ e(
|
|
1411
|
-
/* @__PURE__ */ e(
|
|
1412
|
-
|
|
1402
|
+
calendar: i.language === "fa" ? "persian" : "gregory"
|
|
1403
|
+
}).format(new Date(s));
|
|
1404
|
+
return /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(xa, { collapsible: "icon", side: a, children: [
|
|
1405
|
+
/* @__PURE__ */ e(Na, { className: "custom-scrollbar", children: /* @__PURE__ */ r(ka, { children: [
|
|
1406
|
+
/* @__PURE__ */ e(Le, { className: "mt-2 mb-6 px-2 group-data-[collapsible=icon]:px-0", children: /* @__PURE__ */ e(Ae, { className: "group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center", children: /* @__PURE__ */ e(
|
|
1407
|
+
ze,
|
|
1413
1408
|
{
|
|
1414
1409
|
asChild: !0,
|
|
1415
1410
|
tooltip: t("tooltip_new_conversation"),
|
|
1416
1411
|
className: "h-[52px] rounded-2xl bg-white/40 dark:bg-white/5 border border-border/40 hover:border-primary/50 hover:bg-white/90 dark:hover:bg-white/10 text-foreground shadow-[0_4px_12px_-4px_rgba(0,0,0,0.1)] hover:shadow-[0_12px_30px_-10px_var(--glow)] transition-all duration-500 group-data-[collapsible=icon]:size-10 group-data-[collapsible=icon]:p-0! mb-2 group/new-chat overflow-hidden backdrop-blur-md group-data-[collapsible=icon]:mx-auto",
|
|
1417
|
-
children: /* @__PURE__ */
|
|
1412
|
+
children: /* @__PURE__ */ r(
|
|
1418
1413
|
"a",
|
|
1419
1414
|
{
|
|
1420
|
-
href:
|
|
1421
|
-
onClick: (
|
|
1415
|
+
href: be(c, "/"),
|
|
1416
|
+
onClick: (s) => E(s, "/"),
|
|
1422
1417
|
className: "px-5 group-data-[collapsible=icon]:px-0 group-data-[collapsible=icon]:justify-center flex items-center gap-3 active:scale-[0.96] w-full h-full relative",
|
|
1423
1418
|
children: [
|
|
1424
1419
|
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-linear-to-tr from-primary/10 via-transparent to-primary/5 opacity-0 group-hover/new-chat:opacity-100 transition-opacity duration-700" }),
|
|
1425
|
-
/* @__PURE__ */ e("div", { className: "relative size-8 rounded-xl bg-linear-to-br from-primary/20 to-primary/5 flex items-center justify-center shrink-0 group-hover/new-chat:from-primary/30 group-hover/new-chat:to-primary/10 transition-all duration-500 shadow-inner", children: /* @__PURE__ */ e(
|
|
1420
|
+
/* @__PURE__ */ e("div", { className: "relative size-8 rounded-xl bg-linear-to-br from-primary/20 to-primary/5 flex items-center justify-center shrink-0 group-hover/new-chat:from-primary/30 group-hover/new-chat:to-primary/10 transition-all duration-500 shadow-inner", children: /* @__PURE__ */ e(qt, { className: "size-5! text-primary transition-all duration-700 group-hover/new-chat:rotate-180 group-hover/new-chat:scale-110" }) }),
|
|
1426
1421
|
/* @__PURE__ */ e("span", { className: "font-bold text-[0.95rem] group-data-[collapsible=icon]:hidden tracking-tight bg-clip-text text-foreground/90 group-hover/new-chat:text-foreground transition-colors", children: t("new_conversation") })
|
|
1427
1422
|
]
|
|
1428
1423
|
}
|
|
1429
1424
|
)
|
|
1430
1425
|
}
|
|
1431
1426
|
) }) }),
|
|
1432
|
-
|
|
1433
|
-
/* @__PURE__ */ e(
|
|
1427
|
+
P && /* @__PURE__ */ e(Ee, { className: "group-data-[collapsible=icon]:hidden mb-6 px-2", children: /* @__PURE__ */ r("div", { className: "relative group/search", children: [
|
|
1428
|
+
/* @__PURE__ */ e(Ft, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 opacity-40 group-focus-within/search:opacity-70 transition-opacity" }),
|
|
1434
1429
|
/* @__PURE__ */ e(
|
|
1435
|
-
|
|
1430
|
+
W,
|
|
1436
1431
|
{
|
|
1437
1432
|
placeholder: t("search_conversations"),
|
|
1438
|
-
value:
|
|
1439
|
-
onChange: (
|
|
1433
|
+
value: L,
|
|
1434
|
+
onChange: (s) => V(s.target.value),
|
|
1440
1435
|
className: "pl-9 h-10 bg-accent/15 border border-border/40 focus-visible:ring-primary/20 rounded-xl transition-all"
|
|
1441
1436
|
}
|
|
1442
1437
|
)
|
|
1443
1438
|
] }) }),
|
|
1444
|
-
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
return /* @__PURE__ */ e(
|
|
1439
|
+
P && /* @__PURE__ */ r(Ee, { className: "group-data-[collapsible=icon]:hidden", children: [
|
|
1440
|
+
/* @__PURE__ */ r(Le, { children: [
|
|
1441
|
+
X.map((s, H) => {
|
|
1442
|
+
const fe = K === s.id, Se = Te(s.firstMessage ?? ""), Xe = Se === "rtl";
|
|
1443
|
+
return /* @__PURE__ */ e(Ae, { className: "group/sidebar-menu-item relative", children: fe ? /* @__PURE__ */ r("div", { className: "flex items-center gap-1 px-2 py-1.5 w-full", children: [
|
|
1449
1444
|
/* @__PURE__ */ e(
|
|
1450
|
-
|
|
1445
|
+
W,
|
|
1451
1446
|
{
|
|
1452
|
-
ref:
|
|
1453
|
-
value:
|
|
1454
|
-
onChange: (
|
|
1455
|
-
onKeyDown: (
|
|
1456
|
-
|
|
1447
|
+
ref: D,
|
|
1448
|
+
value: n,
|
|
1449
|
+
onChange: (ie) => w(ie.target.value),
|
|
1450
|
+
onKeyDown: (ie) => {
|
|
1451
|
+
ie.key === "Enter" && ee(), ie.key === "Escape" && ae();
|
|
1457
1452
|
},
|
|
1458
1453
|
className: "h-8 py-0 px-2 text-sm",
|
|
1459
|
-
dir:
|
|
1454
|
+
dir: Te(n)
|
|
1460
1455
|
}
|
|
1461
1456
|
),
|
|
1462
|
-
/* @__PURE__ */ e(
|
|
1463
|
-
/* @__PURE__ */ e(
|
|
1464
|
-
] }) : /* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ e(Z, { size: "icon", variant: "ghost", className: "size-8 shrink-0 text-green-600 hover:text-green-700 hover:bg-green-50", onClick: ee, children: /* @__PURE__ */ e(jt, { className: "size-4" }) }),
|
|
1458
|
+
/* @__PURE__ */ e(Z, { size: "icon", variant: "ghost", className: "size-8 shrink-0 text-destructive hover:bg-destructive/10", onClick: ae, children: /* @__PURE__ */ e(Ot, { className: "size-4" }) })
|
|
1459
|
+
] }) : /* @__PURE__ */ r(ke, { children: [
|
|
1465
1460
|
/* @__PURE__ */ e(
|
|
1466
|
-
|
|
1461
|
+
ze,
|
|
1467
1462
|
{
|
|
1468
1463
|
asChild: !0,
|
|
1469
|
-
className:
|
|
1470
|
-
"bg-accent opacity-100 pointer-events-none":
|
|
1471
|
-
"opacity-70 hover:opacity-100":
|
|
1464
|
+
className: f("h-auto py-2.5 px-3", {
|
|
1465
|
+
"bg-accent opacity-100 pointer-events-none": s.id === R,
|
|
1466
|
+
"opacity-70 hover:opacity-100": s.id !== R
|
|
1472
1467
|
}),
|
|
1473
|
-
children: /* @__PURE__ */
|
|
1468
|
+
children: /* @__PURE__ */ r(
|
|
1474
1469
|
"a",
|
|
1475
1470
|
{
|
|
1476
|
-
href:
|
|
1477
|
-
onClick: (
|
|
1478
|
-
dir:
|
|
1479
|
-
className:
|
|
1471
|
+
href: be(c, s.id),
|
|
1472
|
+
onClick: (ie) => E(ie, s.id),
|
|
1473
|
+
dir: Se,
|
|
1474
|
+
className: f("flex flex-col gap-0.5 w-full overflow-hidden", Xe ? "items-end" : "items-start"),
|
|
1480
1475
|
children: [
|
|
1481
|
-
/* @__PURE__ */ e("span", { className:
|
|
1482
|
-
/* @__PURE__ */ e("div", { className:
|
|
1476
|
+
/* @__PURE__ */ e("span", { className: f("truncate w-full font-medium text-[0.9375rem]", i.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: s.firstMessage }),
|
|
1477
|
+
/* @__PURE__ */ e("div", { className: f("text-[10px] opacity-40 w-full", i.language === "fa" ? "pl-16 text-right" : "pr-16 text-left"), children: F(s.timestamp) })
|
|
1483
1478
|
]
|
|
1484
1479
|
}
|
|
1485
1480
|
)
|
|
1486
1481
|
}
|
|
1487
1482
|
),
|
|
1488
|
-
/* @__PURE__ */
|
|
1483
|
+
/* @__PURE__ */ r("div", { className: f(
|
|
1489
1484
|
"absolute top-1/2 -translate-y-1/2 flex items-center gap-1 transition-all duration-200 z-10",
|
|
1490
|
-
|
|
1485
|
+
i.language === "fa" ? "left-2" : "right-1.5"
|
|
1491
1486
|
), children: [
|
|
1492
|
-
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */ e(
|
|
1495
|
-
|
|
1487
|
+
s.pinned && /* @__PURE__ */ e(Ie, { className: "size-3.5 text-primary opacity-70 md:absolute md:inset-0 md:m-auto md:group-hover/sidebar-menu-item:opacity-0 transition-opacity pointer-events-none" }),
|
|
1488
|
+
/* @__PURE__ */ r(ct, { dir: i.language === "fa" ? "rtl" : "ltr", children: [
|
|
1489
|
+
/* @__PURE__ */ e(dt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1490
|
+
Z,
|
|
1496
1491
|
{
|
|
1497
1492
|
variant: "ghost",
|
|
1498
1493
|
size: "icon",
|
|
1499
1494
|
className: "size-7 rounded-full opacity-100 md:opacity-0 md:group-hover/sidebar-menu-item:opacity-100 hover:bg-accent hover:text-accent-foreground data-[state=open]:opacity-100 transition-all",
|
|
1500
|
-
children: /* @__PURE__ */ e(
|
|
1495
|
+
children: /* @__PURE__ */ e($t, { className: "size-3.5" })
|
|
1501
1496
|
}
|
|
1502
1497
|
) }),
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
|
|
1498
|
+
/* @__PURE__ */ r(
|
|
1499
|
+
ut,
|
|
1505
1500
|
{
|
|
1506
1501
|
align: "end",
|
|
1507
1502
|
className: "min-w-[120px] p-1",
|
|
1508
1503
|
children: [
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
/* @__PURE__ */ e("span", { children:
|
|
1504
|
+
v?.showPin !== !1 && /* @__PURE__ */ r(de, { onSelect: () => k(s), className: "cursor-pointer flex items-center gap-2", children: [
|
|
1505
|
+
s.pinned ? /* @__PURE__ */ e(Bt, { className: "size-4" }) : /* @__PURE__ */ e(Ie, { className: "size-4" }),
|
|
1506
|
+
/* @__PURE__ */ e("span", { children: s.pinned ? t("unpin_conversation") : t("pin_conversation") })
|
|
1512
1507
|
] }),
|
|
1513
|
-
|
|
1514
|
-
/* @__PURE__ */ e(
|
|
1508
|
+
v?.showShare !== !1 && /* @__PURE__ */ r(de, { onSelect: () => T(s), className: "cursor-pointer flex items-center gap-2", children: [
|
|
1509
|
+
/* @__PURE__ */ e(Ut, { className: "size-4" }),
|
|
1515
1510
|
/* @__PURE__ */ e("span", { children: t("share_conversation") })
|
|
1516
1511
|
] }),
|
|
1517
|
-
(
|
|
1518
|
-
/* @__PURE__ */ e(
|
|
1512
|
+
(v?.showRename ?? !1) && /* @__PURE__ */ r(de, { onSelect: () => G(s), className: "cursor-pointer flex items-center gap-2", children: [
|
|
1513
|
+
/* @__PURE__ */ e(Kt, { className: "size-4" }),
|
|
1519
1514
|
/* @__PURE__ */ e("span", { children: t("rename_conversation") })
|
|
1520
1515
|
] }),
|
|
1521
|
-
(
|
|
1516
|
+
(v?.showDelete ?? !1) && /* @__PURE__ */ r(
|
|
1522
1517
|
de,
|
|
1523
1518
|
{
|
|
1524
1519
|
className: "text-destructive focus:text-destructive focus:bg-destructive/10 cursor-pointer flex items-center gap-2",
|
|
1525
|
-
onSelect: () =>
|
|
1520
|
+
onSelect: () => oe(s),
|
|
1526
1521
|
children: [
|
|
1527
|
-
/* @__PURE__ */ e(
|
|
1522
|
+
/* @__PURE__ */ e(Ht, { className: "size-4" }),
|
|
1528
1523
|
/* @__PURE__ */ e("span", { children: t("delete_conversation") })
|
|
1529
1524
|
]
|
|
1530
1525
|
}
|
|
@@ -1534,67 +1529,67 @@ function Sa({ side: r = "left" }) {
|
|
|
1534
1529
|
)
|
|
1535
1530
|
] })
|
|
1536
1531
|
] })
|
|
1537
|
-
] }) },
|
|
1532
|
+
] }) }, H);
|
|
1538
1533
|
}),
|
|
1539
|
-
!
|
|
1534
|
+
!N && S.length === 0 && !L && /* @__PURE__ */ e("div", { className: "px-4 py-8 text-center text-sm opacity-40", children: t("no_conversations") })
|
|
1540
1535
|
] }),
|
|
1541
|
-
/* @__PURE__ */ e("div", { ref:
|
|
1542
|
-
m && /* @__PURE__ */
|
|
1536
|
+
/* @__PURE__ */ e("div", { ref: g, className: "h-4 w-full" }),
|
|
1537
|
+
m && /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 p-4 pt-0 opacity-60", children: [
|
|
1543
1538
|
/* @__PURE__ */ e("div", { className: "size-4 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
|
|
1544
1539
|
/* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-wider font-medium", children: t("loading_more") })
|
|
1545
1540
|
] })
|
|
1546
1541
|
] })
|
|
1547
1542
|
] }) }),
|
|
1548
|
-
/* @__PURE__ */ e(
|
|
1549
|
-
/* @__PURE__ */ e(
|
|
1550
|
-
|
|
1543
|
+
/* @__PURE__ */ e(wa, {}),
|
|
1544
|
+
/* @__PURE__ */ e(He, { open: I, onOpenChange: j, children: /* @__PURE__ */ r(
|
|
1545
|
+
Qe,
|
|
1551
1546
|
{
|
|
1552
|
-
onKeyDown: (
|
|
1553
|
-
|
|
1547
|
+
onKeyDown: (s) => {
|
|
1548
|
+
s.key === "Enter" && (s.preventDefault(), o());
|
|
1554
1549
|
},
|
|
1555
1550
|
children: [
|
|
1556
|
-
/* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */ e(
|
|
1558
|
-
/* @__PURE__ */ e(
|
|
1551
|
+
/* @__PURE__ */ r(mt, { children: [
|
|
1552
|
+
/* @__PURE__ */ e(ht, { children: t("delete_confirm_title") }),
|
|
1553
|
+
/* @__PURE__ */ e(pt, { children: t("delete_confirm_description") })
|
|
1559
1554
|
] }),
|
|
1560
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ r(gt, { children: [
|
|
1561
1556
|
/* @__PURE__ */ e(
|
|
1562
|
-
|
|
1557
|
+
Z,
|
|
1563
1558
|
{
|
|
1564
1559
|
variant: "outline",
|
|
1565
1560
|
onClick: () => {
|
|
1566
|
-
|
|
1561
|
+
j(!1);
|
|
1567
1562
|
},
|
|
1568
1563
|
children: t("cancel")
|
|
1569
1564
|
}
|
|
1570
1565
|
),
|
|
1571
|
-
/* @__PURE__ */ e(
|
|
1566
|
+
/* @__PURE__ */ e(Z, { variant: "destructive", onClick: o, autoFocus: !0, children: t("delete") })
|
|
1572
1567
|
] })
|
|
1573
1568
|
]
|
|
1574
1569
|
}
|
|
1575
1570
|
) })
|
|
1576
1571
|
] }) });
|
|
1577
1572
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const { config:
|
|
1580
|
-
return /* @__PURE__ */
|
|
1581
|
-
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
t !== void 0 ? t : /* @__PURE__ */ e(
|
|
1573
|
+
function Qa({ sidebar: a, header: t, components: i, classNames: u, disclaimer: l, welcome: d }) {
|
|
1574
|
+
const { config: h } = je(), { history: p } = re(), m = h?.language === "fa" ? "right" : "left", N = p?.enabled ?? !0;
|
|
1575
|
+
return /* @__PURE__ */ r(va, { defaultOpen: N, children: [
|
|
1576
|
+
a !== void 0 ? a : N ? /* @__PURE__ */ e(Ta, { side: m }) : null,
|
|
1577
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col flex-1 h-dvh overflow-hidden relative", children: [
|
|
1578
|
+
t !== void 0 ? t : /* @__PURE__ */ e(We, {}),
|
|
1584
1579
|
/* @__PURE__ */ e(
|
|
1585
1580
|
"div",
|
|
1586
1581
|
{
|
|
1587
|
-
className:
|
|
1582
|
+
className: f(
|
|
1588
1583
|
"flex flex-col relative w-full flex-1 min-h-0 overflow-hidden",
|
|
1589
1584
|
"has-[.stick-to-bottom:empty]:overflow-visible has-[.stick-to-bottom:empty]:flex-initial transition-[flex] duration-200"
|
|
1590
1585
|
),
|
|
1591
1586
|
children: /* @__PURE__ */ e(
|
|
1592
|
-
|
|
1587
|
+
na,
|
|
1593
1588
|
{
|
|
1594
|
-
components:
|
|
1595
|
-
classNames:
|
|
1596
|
-
disclaimer:
|
|
1597
|
-
welcome:
|
|
1589
|
+
components: i,
|
|
1590
|
+
classNames: u,
|
|
1591
|
+
disclaimer: l,
|
|
1592
|
+
welcome: d
|
|
1598
1593
|
}
|
|
1599
1594
|
)
|
|
1600
1595
|
}
|
|
@@ -1602,78 +1597,79 @@ function Ka({ sidebar: r, header: t, components: o, classNames: d, disclaimer: i
|
|
|
1602
1597
|
] })
|
|
1603
1598
|
] });
|
|
1604
1599
|
}
|
|
1605
|
-
function
|
|
1606
|
-
const [t,
|
|
1600
|
+
function Va({ children: a }) {
|
|
1601
|
+
const [t, i] = _(null), u = Ve(), l = Ce(), d = pe();
|
|
1607
1602
|
return $(() => {
|
|
1608
1603
|
(async () => {
|
|
1609
|
-
const p = new URLSearchParams(
|
|
1610
|
-
if (
|
|
1604
|
+
const p = new URLSearchParams(u.search), m = p.get("token");
|
|
1605
|
+
if (m)
|
|
1611
1606
|
try {
|
|
1612
|
-
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1607
|
+
M.setToken(m), await M.getBalance(), p.delete("token");
|
|
1608
|
+
const v = p.toString(), y = u.pathname + (v ? `?${v}` : "");
|
|
1609
|
+
l(y, { replace: !0 }), i(!0);
|
|
1615
1610
|
return;
|
|
1616
|
-
} catch (
|
|
1617
|
-
console.error("Error validating token from URL:",
|
|
1611
|
+
} catch (v) {
|
|
1612
|
+
console.error("Error validating token from URL:", v), i(!1);
|
|
1618
1613
|
return;
|
|
1619
1614
|
}
|
|
1620
|
-
if (!
|
|
1621
|
-
|
|
1615
|
+
if (!M.getToken()) {
|
|
1616
|
+
i(!1);
|
|
1622
1617
|
return;
|
|
1623
1618
|
}
|
|
1624
1619
|
try {
|
|
1625
|
-
await
|
|
1626
|
-
} catch (
|
|
1627
|
-
console.error("Token validation failed:",
|
|
1620
|
+
await M.getBalance(), i(!0);
|
|
1621
|
+
} catch (v) {
|
|
1622
|
+
console.error("Token validation failed:", v), v.status === 401 ? (M.clearToken(), d.clear(), i(!1)) : i(!0);
|
|
1628
1623
|
}
|
|
1629
1624
|
})();
|
|
1630
|
-
}, [
|
|
1625
|
+
}, [u.search, l, u.pathname, d]), t === null ? /* @__PURE__ */ e("div", { className: "flex h-screen w-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "size-8 rounded-full border-4 border-primary border-t-transparent animate-spin" }) }) : t ? /* @__PURE__ */ e(ke, { children: a }) : /* @__PURE__ */ e(Xt, { to: "/login", replace: !0 });
|
|
1631
1626
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1627
|
+
const qe = (a) => a.replace(/[^0-9]/g, "");
|
|
1628
|
+
function Ga() {
|
|
1629
|
+
const { t: a, i18n: t } = ce(["login", "translation"]), { app: i } = re(), u = t.dir() === "rtl", l = u ? "text-right" : "text-left", d = Ce(), h = pe(), [p, m] = _("login"), [N, v] = _(""), [y, c] = _(""), [P, S] = _(""), [R, B] = _(""), [C, x] = _(""), [g, A] = _(""), q = O(() => i?.userMetadataFields?.filter((n) => n.showInSignup) || [], [i?.userMetadataFields]), [I, j] = _(() => {
|
|
1630
|
+
const n = {};
|
|
1631
|
+
return q.forEach((w) => {
|
|
1632
|
+
w.defaultValue !== void 0 && (n[w.key] = w.defaultValue);
|
|
1633
|
+
}), n;
|
|
1638
1634
|
});
|
|
1639
1635
|
$(() => {
|
|
1640
|
-
const
|
|
1641
|
-
let
|
|
1642
|
-
|
|
1643
|
-
D.condition && !he(D.condition, I) &&
|
|
1644
|
-
}),
|
|
1645
|
-
}, [I,
|
|
1646
|
-
const [
|
|
1647
|
-
|
|
1636
|
+
const n = { ...I };
|
|
1637
|
+
let w = !1;
|
|
1638
|
+
q.forEach((D) => {
|
|
1639
|
+
D.condition && !he(D.condition, I) && n[D.key] !== void 0 && (delete n[D.key], w = !0);
|
|
1640
|
+
}), w && j(n);
|
|
1641
|
+
}, [I, q]);
|
|
1642
|
+
const [U, z] = _(""), [L, V] = _(!1), K = async (n) => {
|
|
1643
|
+
n.preventDefault(), z(""), V(!0);
|
|
1648
1644
|
try {
|
|
1649
|
-
await
|
|
1650
|
-
} catch (
|
|
1651
|
-
|
|
1645
|
+
await M.login(N, y), h.clear(), d("/");
|
|
1646
|
+
} catch (w) {
|
|
1647
|
+
z(le(w, a));
|
|
1652
1648
|
} finally {
|
|
1653
|
-
|
|
1649
|
+
V(!1);
|
|
1654
1650
|
}
|
|
1655
|
-
},
|
|
1656
|
-
|
|
1651
|
+
}, b = async (n) => {
|
|
1652
|
+
n.preventDefault(), z(""), V(!0);
|
|
1657
1653
|
try {
|
|
1658
|
-
await
|
|
1659
|
-
} catch (
|
|
1660
|
-
|
|
1654
|
+
await M.register(P, R, C, g, I), h.clear(), d("/");
|
|
1655
|
+
} catch (w) {
|
|
1656
|
+
z(le(w, a));
|
|
1661
1657
|
} finally {
|
|
1662
|
-
|
|
1658
|
+
V(!1);
|
|
1663
1659
|
}
|
|
1664
1660
|
};
|
|
1665
|
-
return /* @__PURE__ */ e("div", { className: "min-h-screen bg-background flex flex-col items-center justify-center p-4", dir: t.dir(), children: /* @__PURE__ */
|
|
1666
|
-
/* @__PURE__ */ e("div", { className: "text-center mb-6", children: /* @__PURE__ */ e("h1", { className: "text-2xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent", children:
|
|
1667
|
-
/* @__PURE__ */
|
|
1661
|
+
return /* @__PURE__ */ e("div", { className: "min-h-screen bg-background flex flex-col items-center justify-center p-4", dir: t.dir(), children: /* @__PURE__ */ r("div", { className: "w-full max-w-md bg-card border border-border rounded-xl shadow-lg p-6", children: [
|
|
1662
|
+
/* @__PURE__ */ e("div", { className: "text-center mb-6", children: /* @__PURE__ */ e("h1", { className: "text-2xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent", children: i?.name }) }),
|
|
1663
|
+
/* @__PURE__ */ r("div", { className: "flex bg-muted p-1 rounded-lg mb-6", children: [
|
|
1668
1664
|
/* @__PURE__ */ e(
|
|
1669
1665
|
"button",
|
|
1670
1666
|
{
|
|
1671
1667
|
type: "button",
|
|
1672
1668
|
onClick: () => {
|
|
1673
|
-
|
|
1669
|
+
m("login"), z("");
|
|
1674
1670
|
},
|
|
1675
1671
|
className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${p === "login" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1676
|
-
children:
|
|
1672
|
+
children: a("login_tab", "Login")
|
|
1677
1673
|
}
|
|
1678
1674
|
),
|
|
1679
1675
|
/* @__PURE__ */ e(
|
|
@@ -1681,39 +1677,39 @@ function Qa() {
|
|
|
1681
1677
|
{
|
|
1682
1678
|
type: "button",
|
|
1683
1679
|
onClick: () => {
|
|
1684
|
-
|
|
1680
|
+
m("register"), z("");
|
|
1685
1681
|
},
|
|
1686
1682
|
className: `flex-1 py-2 text-sm font-medium rounded-md transition-all ${p === "register" ? "bg-background shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"}`,
|
|
1687
|
-
children:
|
|
1683
|
+
children: a("signup_tab", "Sign Up")
|
|
1688
1684
|
}
|
|
1689
1685
|
)
|
|
1690
1686
|
] }),
|
|
1691
|
-
p === "login" && /* @__PURE__ */
|
|
1692
|
-
/* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */ e(Q, { htmlFor: "login-phone", children:
|
|
1687
|
+
p === "login" && /* @__PURE__ */ r("form", { onSubmit: K, className: "space-y-4", children: [
|
|
1688
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1689
|
+
/* @__PURE__ */ e(Q, { htmlFor: "login-phone", children: a("phone", "Phone") }),
|
|
1694
1690
|
/* @__PURE__ */ e(
|
|
1695
|
-
|
|
1691
|
+
W,
|
|
1696
1692
|
{
|
|
1697
1693
|
id: "login-phone",
|
|
1698
1694
|
type: "tel",
|
|
1699
|
-
value:
|
|
1700
|
-
onChange: (
|
|
1695
|
+
value: N,
|
|
1696
|
+
onChange: (n) => v(qe(n.target.value)),
|
|
1701
1697
|
required: !0,
|
|
1702
1698
|
className: "text-left",
|
|
1703
|
-
placeholder:
|
|
1699
|
+
placeholder: a("phone_placeholder", "Phone number"),
|
|
1704
1700
|
dir: "ltr"
|
|
1705
1701
|
}
|
|
1706
1702
|
)
|
|
1707
1703
|
] }),
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
/* @__PURE__ */ e(Q, { htmlFor: "login-pass", children:
|
|
1704
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1705
|
+
/* @__PURE__ */ e(Q, { htmlFor: "login-pass", children: a("password", "Password") }),
|
|
1710
1706
|
/* @__PURE__ */ e(
|
|
1711
|
-
|
|
1707
|
+
W,
|
|
1712
1708
|
{
|
|
1713
1709
|
id: "login-pass",
|
|
1714
1710
|
type: "password",
|
|
1715
|
-
value:
|
|
1716
|
-
onChange: (
|
|
1711
|
+
value: y,
|
|
1712
|
+
onChange: (n) => c(n.target.value),
|
|
1717
1713
|
required: !0,
|
|
1718
1714
|
className: "text-left",
|
|
1719
1715
|
placeholder: "••••••••",
|
|
@@ -1721,43 +1717,43 @@ function Qa() {
|
|
|
1721
1717
|
}
|
|
1722
1718
|
)
|
|
1723
1719
|
] }),
|
|
1724
|
-
|
|
1720
|
+
U && /* @__PURE__ */ e("div", { className: "text-sm text-destructive", children: U }),
|
|
1725
1721
|
/* @__PURE__ */ e(
|
|
1726
|
-
|
|
1722
|
+
Z,
|
|
1727
1723
|
{
|
|
1728
1724
|
type: "submit",
|
|
1729
1725
|
disabled: L,
|
|
1730
1726
|
className: "w-full font-semibold",
|
|
1731
|
-
children: L ?
|
|
1727
|
+
children: L ? a("logging_in", "Logging in...") : a("login_button", "Login")
|
|
1732
1728
|
}
|
|
1733
1729
|
)
|
|
1734
1730
|
] }),
|
|
1735
|
-
p === "register" && /* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-phone", children:
|
|
1731
|
+
p === "register" && /* @__PURE__ */ r("form", { onSubmit: b, className: "space-y-4", children: [
|
|
1732
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1733
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-phone", children: a("phone", "Phone") }),
|
|
1738
1734
|
/* @__PURE__ */ e(
|
|
1739
|
-
|
|
1735
|
+
W,
|
|
1740
1736
|
{
|
|
1741
1737
|
id: "reg-phone",
|
|
1742
1738
|
type: "tel",
|
|
1743
|
-
value:
|
|
1744
|
-
onChange: (
|
|
1739
|
+
value: P,
|
|
1740
|
+
onChange: (n) => S(qe(n.target.value)),
|
|
1745
1741
|
required: !0,
|
|
1746
1742
|
className: "text-left",
|
|
1747
|
-
placeholder:
|
|
1743
|
+
placeholder: a("phone_placeholder", "Phone number"),
|
|
1748
1744
|
dir: "ltr"
|
|
1749
1745
|
}
|
|
1750
1746
|
)
|
|
1751
1747
|
] }),
|
|
1752
|
-
/* @__PURE__ */
|
|
1753
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-pass", children:
|
|
1748
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1749
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-pass", children: a("password", "Password") }),
|
|
1754
1750
|
/* @__PURE__ */ e(
|
|
1755
|
-
|
|
1751
|
+
W,
|
|
1756
1752
|
{
|
|
1757
1753
|
id: "reg-pass",
|
|
1758
1754
|
type: "password",
|
|
1759
|
-
value:
|
|
1760
|
-
onChange: (
|
|
1755
|
+
value: R,
|
|
1756
|
+
onChange: (n) => B(n.target.value),
|
|
1761
1757
|
required: !0,
|
|
1762
1758
|
className: "text-left",
|
|
1763
1759
|
placeholder: "••••••••",
|
|
@@ -1765,128 +1761,128 @@ function Qa() {
|
|
|
1765
1761
|
}
|
|
1766
1762
|
)
|
|
1767
1763
|
] }),
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
/* @__PURE__ */
|
|
1770
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-name", children:
|
|
1764
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
1765
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1766
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-name", children: a("name", "Name") }),
|
|
1771
1767
|
/* @__PURE__ */ e(
|
|
1772
|
-
|
|
1768
|
+
W,
|
|
1773
1769
|
{
|
|
1774
1770
|
id: "reg-name",
|
|
1775
1771
|
type: "text",
|
|
1776
|
-
value:
|
|
1777
|
-
onChange: (
|
|
1772
|
+
value: C,
|
|
1773
|
+
onChange: (n) => x(n.target.value),
|
|
1778
1774
|
required: !0,
|
|
1779
|
-
className:
|
|
1780
|
-
placeholder:
|
|
1775
|
+
className: l,
|
|
1776
|
+
placeholder: a("name_placeholder", "First Name")
|
|
1781
1777
|
}
|
|
1782
1778
|
)
|
|
1783
1779
|
] }),
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */ e(Q, { htmlFor: "reg-surname", children:
|
|
1780
|
+
/* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1781
|
+
/* @__PURE__ */ e(Q, { htmlFor: "reg-surname", children: a("surname", "Surname") }),
|
|
1786
1782
|
/* @__PURE__ */ e(
|
|
1787
|
-
|
|
1783
|
+
W,
|
|
1788
1784
|
{
|
|
1789
1785
|
id: "reg-surname",
|
|
1790
1786
|
type: "text",
|
|
1791
|
-
value:
|
|
1792
|
-
onChange: (
|
|
1787
|
+
value: g,
|
|
1788
|
+
onChange: (n) => A(n.target.value),
|
|
1793
1789
|
required: !0,
|
|
1794
|
-
className:
|
|
1795
|
-
placeholder:
|
|
1790
|
+
className: l,
|
|
1791
|
+
placeholder: a("surname_placeholder", "Last Name")
|
|
1796
1792
|
}
|
|
1797
1793
|
)
|
|
1798
1794
|
] })
|
|
1799
1795
|
] }),
|
|
1800
|
-
|
|
1801
|
-
/* @__PURE__ */ e(Q, { htmlFor: `signup-${
|
|
1802
|
-
|
|
1803
|
-
|
|
1796
|
+
q.map((n) => he(n.condition, I) ? /* @__PURE__ */ r("div", { className: "space-y-3 animate-in fade-in slide-in-from-top-1 duration-200", children: [
|
|
1797
|
+
/* @__PURE__ */ e(Q, { htmlFor: `signup-${n.key}`, children: a(n.label) }),
|
|
1798
|
+
n.type === "select" ? /* @__PURE__ */ r(
|
|
1799
|
+
ve,
|
|
1804
1800
|
{
|
|
1805
|
-
value: String(I[
|
|
1806
|
-
onValueChange: (
|
|
1807
|
-
required:
|
|
1808
|
-
dir:
|
|
1801
|
+
value: String(I[n.key] || ""),
|
|
1802
|
+
onValueChange: (w) => j({ ...I, [n.key]: w }),
|
|
1803
|
+
required: n.required,
|
|
1804
|
+
dir: u ? "rtl" : "ltr",
|
|
1809
1805
|
children: [
|
|
1810
|
-
/* @__PURE__ */ e(
|
|
1811
|
-
/* @__PURE__ */ e(
|
|
1806
|
+
/* @__PURE__ */ e(xe, { className: f("bg-background", l), children: /* @__PURE__ */ e(ye, { placeholder: a(n.placeholder || "select_placeholder") }) }),
|
|
1807
|
+
/* @__PURE__ */ e(we, { className: "rounded-xl", children: n.options?.map((w) => /* @__PURE__ */ e(me, { value: String(w.value), children: a(w.label) }, String(w.value))) })
|
|
1812
1808
|
]
|
|
1813
1809
|
}
|
|
1814
|
-
) :
|
|
1810
|
+
) : n.type === "checkbox" ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 py-2", children: [
|
|
1815
1811
|
/* @__PURE__ */ e(
|
|
1816
|
-
|
|
1812
|
+
ft,
|
|
1817
1813
|
{
|
|
1818
|
-
id: `signup-${
|
|
1819
|
-
checked: !!I[
|
|
1820
|
-
onCheckedChange: (
|
|
1821
|
-
required:
|
|
1814
|
+
id: `signup-${n.key}`,
|
|
1815
|
+
checked: !!I[n.key],
|
|
1816
|
+
onCheckedChange: (w) => j({ ...I, [n.key]: !!w }),
|
|
1817
|
+
required: n.required
|
|
1822
1818
|
}
|
|
1823
1819
|
),
|
|
1824
|
-
/* @__PURE__ */ e("label", { htmlFor: `signup-${
|
|
1820
|
+
/* @__PURE__ */ e("label", { htmlFor: `signup-${n.key}`, className: "text-sm text-muted-foreground cursor-pointer select-none", children: a(n.placeholder || n.label) })
|
|
1825
1821
|
] }) : /* @__PURE__ */ e(
|
|
1826
|
-
|
|
1822
|
+
W,
|
|
1827
1823
|
{
|
|
1828
|
-
id: `signup-${
|
|
1829
|
-
type:
|
|
1830
|
-
value: I[
|
|
1831
|
-
onChange: (
|
|
1832
|
-
required:
|
|
1833
|
-
className:
|
|
1834
|
-
placeholder:
|
|
1824
|
+
id: `signup-${n.key}`,
|
|
1825
|
+
type: n.type,
|
|
1826
|
+
value: I[n.key] || "",
|
|
1827
|
+
onChange: (w) => j({ ...I, [n.key]: w.target.value }),
|
|
1828
|
+
required: n.required,
|
|
1829
|
+
className: l,
|
|
1830
|
+
placeholder: a(n.placeholder || "")
|
|
1835
1831
|
}
|
|
1836
1832
|
)
|
|
1837
|
-
] },
|
|
1838
|
-
|
|
1833
|
+
] }, n.key) : null),
|
|
1834
|
+
U && /* @__PURE__ */ e("div", { className: "text-sm text-destructive", children: U }),
|
|
1839
1835
|
/* @__PURE__ */ e(
|
|
1840
|
-
|
|
1836
|
+
Z,
|
|
1841
1837
|
{
|
|
1842
1838
|
type: "submit",
|
|
1843
1839
|
disabled: L,
|
|
1844
1840
|
className: "w-full font-semibold",
|
|
1845
|
-
children: L ?
|
|
1841
|
+
children: L ? a("signing_up", "Signing up...") : a("signup_button", "Sign Up")
|
|
1846
1842
|
}
|
|
1847
1843
|
)
|
|
1848
1844
|
] })
|
|
1849
1845
|
] }) });
|
|
1850
1846
|
}
|
|
1851
|
-
function
|
|
1852
|
-
const { shareId:
|
|
1847
|
+
function Ma() {
|
|
1848
|
+
const { shareId: a } = Jt(), [t, i] = _(null), [u, l] = _(!0), [d, h] = _(null), { MessageList: p } = re(), m = te(/* @__PURE__ */ new Set());
|
|
1853
1849
|
return $(() => () => {
|
|
1854
|
-
|
|
1850
|
+
m.current.forEach((N) => URL.revokeObjectURL(N)), m.current.clear();
|
|
1855
1851
|
}, []), $(() => {
|
|
1856
|
-
if (!
|
|
1852
|
+
if (!a) return;
|
|
1857
1853
|
(async () => {
|
|
1858
1854
|
try {
|
|
1859
|
-
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
if (!
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1866
|
-
if (
|
|
1855
|
+
l(!0);
|
|
1856
|
+
const v = await M.getSharedThread(a);
|
|
1857
|
+
v.items && (v.items = await Promise.all(
|
|
1858
|
+
v.items.map(async (y) => {
|
|
1859
|
+
if (!y.parts) return y;
|
|
1860
|
+
const c = await Promise.all(
|
|
1861
|
+
y.parts.map(async (P) => {
|
|
1862
|
+
if (P.type === "file" && P.object_name && !P.url)
|
|
1867
1863
|
try {
|
|
1868
|
-
const
|
|
1869
|
-
return
|
|
1870
|
-
} catch (
|
|
1871
|
-
console.error("Failed to resolve shared attachment:",
|
|
1864
|
+
const S = await M.getPublicAttachmentBlobUrl(P.object_name);
|
|
1865
|
+
return m.current.add(S), { ...P, url: S };
|
|
1866
|
+
} catch (S) {
|
|
1867
|
+
console.error("Failed to resolve shared attachment:", P.object_name, S);
|
|
1872
1868
|
}
|
|
1873
|
-
return
|
|
1869
|
+
return P;
|
|
1874
1870
|
})
|
|
1875
1871
|
);
|
|
1876
|
-
return { ...
|
|
1872
|
+
return { ...y, parts: c };
|
|
1877
1873
|
})
|
|
1878
|
-
)),
|
|
1879
|
-
} catch (
|
|
1880
|
-
console.error("Failed to fetch shared chat:",
|
|
1874
|
+
)), i(v);
|
|
1875
|
+
} catch (v) {
|
|
1876
|
+
console.error("Failed to fetch shared chat:", v), h(v.message || "Failed to load shared chat");
|
|
1881
1877
|
} finally {
|
|
1882
|
-
|
|
1878
|
+
l(!1);
|
|
1883
1879
|
}
|
|
1884
1880
|
})();
|
|
1885
|
-
}, [
|
|
1881
|
+
}, [a]), u ? /* @__PURE__ */ e("div", { className: "flex h-dvh items-center justify-center", children: /* @__PURE__ */ e(bt, {}) }) : d || !t ? /* @__PURE__ */ r("div", { className: "flex h-dvh flex-col items-center justify-center p-4 text-center", children: [
|
|
1886
1882
|
/* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-destructive mb-2 font-display", children: "Shared Chat Not Found" }),
|
|
1887
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground max-w-md", children:
|
|
1888
|
-
] }) : /* @__PURE__ */
|
|
1889
|
-
/* @__PURE__ */ e(
|
|
1883
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground max-w-md", children: d || "This shared conversation might have been deleted or the link is invalid." })
|
|
1884
|
+
] }) : /* @__PURE__ */ r("div", { className: "relative flex flex-col h-dvh overflow-hidden bg-background", children: [
|
|
1885
|
+
/* @__PURE__ */ e(We, { hideActions: !0 }),
|
|
1890
1886
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0 overflow-hidden relative flex flex-col", children: /* @__PURE__ */ e(
|
|
1891
1887
|
p,
|
|
1892
1888
|
{
|
|
@@ -1905,42 +1901,42 @@ function Pa() {
|
|
|
1905
1901
|
) })
|
|
1906
1902
|
] });
|
|
1907
1903
|
}
|
|
1908
|
-
function
|
|
1909
|
-
return /* @__PURE__ */ e(
|
|
1904
|
+
function Wa() {
|
|
1905
|
+
return /* @__PURE__ */ e(Ma, {});
|
|
1910
1906
|
}
|
|
1911
1907
|
export {
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1908
|
+
Ta as AppSidebar,
|
|
1909
|
+
na as Chat,
|
|
1910
|
+
Qa as ChatUI,
|
|
1911
|
+
rr as FilePart,
|
|
1912
|
+
Ha as GentiqProvider,
|
|
1913
|
+
nr as MessageList,
|
|
1914
|
+
sr as Part,
|
|
1915
|
+
or as PromptInputArea,
|
|
1916
|
+
ir as ReasoningPart,
|
|
1917
|
+
Va as RequireAuth,
|
|
1918
|
+
ve as Select,
|
|
1919
|
+
we as SelectContent,
|
|
1920
|
+
lr as SelectGroup,
|
|
1925
1921
|
me as SelectItem,
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1922
|
+
cr as SelectLabel,
|
|
1923
|
+
dr as SelectScrollDownButton,
|
|
1924
|
+
ur as SelectScrollUpButton,
|
|
1925
|
+
mr as SelectSeparator,
|
|
1926
|
+
xe as SelectTrigger,
|
|
1927
|
+
ye as SelectValue,
|
|
1928
|
+
_a as SettingsDialog,
|
|
1929
|
+
Wa as SharedChatView,
|
|
1930
|
+
va as SidebarProvider,
|
|
1931
|
+
hr as TextPart,
|
|
1932
|
+
pr as ToolPart,
|
|
1933
|
+
Ya as Trans,
|
|
1934
|
+
Za as Translation,
|
|
1935
|
+
Ga as UserLoginPage,
|
|
1936
|
+
gr as WelcomeScreen,
|
|
1937
|
+
re as useComponents,
|
|
1938
|
+
aa as useGentiqChat,
|
|
1939
|
+
er as useTranslation,
|
|
1940
|
+
M as userAPI,
|
|
1941
|
+
tr as withTranslation
|
|
1946
1942
|
};
|