@versini/sassysaint 7.0.0 → 7.1.0
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/chunks/{App.D7zkk9cs.js → App.Ds0uId3o.js} +2246 -2172
- package/dist/chunks/{ChatBubbleAssistant.DUyDXsSm.js → ChatBubbleAssistant.Dp-agOTo.js} +3 -3
- package/dist/chunks/{index.DOnA1L7J.js → HeaderEntry.BwH4Isxn.js} +538 -529
- package/dist/chunks/{MarkdownWithExtra.LAUBYRhn.js → MarkdownWithExtra.Co7kRLuz.js} +2 -2
- package/dist/chunks/{index.Ckh_vJwX.js → index.Ct43f1gn.js} +80 -81
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as i, jsx as e, Fragment as
|
|
2
|
-
import { f as $, un as
|
|
3
|
-
import { i as me, useServerCapabilities as
|
|
4
|
-
import
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import { f as $, un as F, R as H, CARDS as N, renderDataAsList as de, pluralize as ue, ABOUT_TITLE as Qe, INFINITE_SCROLL_LIMIT as ve, INFINITE_SCROLL_THRESHOLD as Se, LOCAL_STORAGE_PREFIX as ke, LOCAL_STORAGE_SORT as Ze, re as se, ACTION_SORT as Ae, LOCAL_STORAGE_SEARCH as Je, HISTORY_TITLE as et, fe as be, C as q, ACTION_SEARCH as tt, debounce as rt, M as at, isElectron as nt, L as Q, j as O, l as Ie, durationFormatter as ot, PROFILE_TITLE as st, PROMPTS_DESCRIPTION as lt, DEFAULT_AI_PROVIDER as ct, LOCAL_STORAGE_CHAT_DETAILS as it, SETTINGS_TITLE as dt, PROVIDER_OPENAI as X, PROVIDER_ANTHROPIC as te, APP_NAME as ut, getCurrentGeoLocation as mt, LOG_OUT as _e } from "./index.Ct43f1gn.js";
|
|
3
|
+
import { i as me, useServerCapabilities as ht, Ze as ie, HistoryContext as Pe, ChatContext as Oe, E as Ce, ConfirmationPanel as Me, Ue as ft, je as pt, Fe as ge, Le as P, De as gt, $e as yt, p as bt, z as xt, We as kt, serviceCall as le, SERVICE_TYPES as ce, setNewProvider as Ct, CHAT_RESTORE as Tt, B as re, useChatsHistory as Et, useUserChatStats as Nt, useUserPreferences as ze, m as wt, _e as vt, me as St, R as ae, P as At } from "./App.Ds0uId3o.js";
|
|
4
|
+
import It, { useRef as S, useState as k, useContext as he, useCallback as Be, useEffect as U, Fragment as _t, useLayoutEffect as ne, useMemo as He, useId as Rt, useReducer as Lt } from "react";
|
|
5
5
|
import y from "clsx";
|
|
6
|
-
const
|
|
6
|
+
const Pt = ({
|
|
7
7
|
className: t,
|
|
8
8
|
viewBox: o,
|
|
9
|
-
title:
|
|
10
|
-
monotone:
|
|
9
|
+
title: n,
|
|
10
|
+
monotone: a,
|
|
11
11
|
...r
|
|
12
12
|
}) => /* @__PURE__ */ i(
|
|
13
13
|
$,
|
|
@@ -16,24 +16,24 @@ const Rt = ({
|
|
|
16
16
|
size: "size-5",
|
|
17
17
|
viewBox: o,
|
|
18
18
|
className: t,
|
|
19
|
-
title:
|
|
19
|
+
title: n || "Back",
|
|
20
20
|
...r,
|
|
21
21
|
children: [
|
|
22
22
|
/* @__PURE__ */ e(
|
|
23
23
|
"path",
|
|
24
24
|
{
|
|
25
25
|
d: "M66.6 320c0 1.8.1 3.5.4 5.3C84.9 431.3 177 512 288 512c123.7 0 224-100.3 224-224 0-111-80.7-203.1-186.7-220.9-1.8-.3-3.6-.4-5.3-.4-15.3 0-28.9 11.1-31.5 26.7-2.9 17.4 8.8 33.9 26.3 36.9C390.4 142.9 448 208.8 448 288c0 88.4-71.6 160-160 160-79.2 0-145.1-57.6-157.8-133.3-2.9-17.4-19.4-29.2-36.9-26.3-15.6 2.6-26.7 16.2-26.7 31.5z",
|
|
26
|
-
opacity:
|
|
26
|
+
opacity: a ? "1" : "0.4"
|
|
27
27
|
}
|
|
28
28
|
),
|
|
29
29
|
/* @__PURE__ */ e("path", { d: "M32 0h160c17.7 0 32 14.3 32 32s-14.3 32-32 32h-82.7l233.3 233.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L64 109.3V192c0 17.7-14.3 32-32 32S0 209.7 0 192V32C0 14.3 14.3 0 32 0" })
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
|
-
),
|
|
32
|
+
), Ot = ({
|
|
33
33
|
className: t,
|
|
34
34
|
viewBox: o,
|
|
35
|
-
title:
|
|
36
|
-
monotone:
|
|
35
|
+
title: n,
|
|
36
|
+
monotone: a,
|
|
37
37
|
...r
|
|
38
38
|
}) => /* @__PURE__ */ i(
|
|
39
39
|
$,
|
|
@@ -42,24 +42,24 @@ const Rt = ({
|
|
|
42
42
|
size: "size-5",
|
|
43
43
|
viewBox: o,
|
|
44
44
|
className: t,
|
|
45
|
-
title:
|
|
45
|
+
title: n || "Delete",
|
|
46
46
|
...r,
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ e(
|
|
49
49
|
"path",
|
|
50
50
|
{
|
|
51
51
|
d: "M32 96v352c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V96zm80 80c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16zm96 0c0-8.8 7.2-16 16-16s16 7.2 16 16v224c0 8.8-7.2 16-16 16s-16-7.2-16-16z",
|
|
52
|
-
opacity:
|
|
52
|
+
opacity: a ? "1" : "0.4"
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
55
|
/* @__PURE__ */ e("path", { d: "M163.8 0c-12.1 0-23.2 6.8-28.6 17.7L128 32H32C14.3 32 0 46.3 0 64s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32h-96l-7.2-14.3C307.4 6.8 296.3 0 284.2 0z" })
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
|
-
),
|
|
58
|
+
), Mt = ({
|
|
59
59
|
className: t,
|
|
60
60
|
viewBox: o,
|
|
61
|
-
title:
|
|
62
|
-
monotone:
|
|
61
|
+
title: n,
|
|
62
|
+
monotone: a,
|
|
63
63
|
...r
|
|
64
64
|
}) => /* @__PURE__ */ i(
|
|
65
65
|
$,
|
|
@@ -68,24 +68,24 @@ const Rt = ({
|
|
|
68
68
|
size: "size-5",
|
|
69
69
|
viewBox: o,
|
|
70
70
|
className: t,
|
|
71
|
-
title:
|
|
71
|
+
title: n || "History",
|
|
72
72
|
...r,
|
|
73
73
|
children: [
|
|
74
74
|
/* @__PURE__ */ e(
|
|
75
75
|
"path",
|
|
76
76
|
{
|
|
77
77
|
d: "M0 57.9V168c0 13.3 10.7 24 24 24h110.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75L41 41C25.9 25.9 0 36.6 0 57.9",
|
|
78
|
-
opacity:
|
|
78
|
+
opacity: a ? "1" : "0.4"
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
81
|
/* @__PURE__ */ e("path", { d: "M256 128c13.3 0 24 10.7 24 24v94.1l65 65c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-72-72c-4.5-4.5-7-10.6-7-17V152c0-13.3 10.7-24 24-24z" })
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
|
-
),
|
|
84
|
+
), zt = ({
|
|
85
85
|
className: t,
|
|
86
86
|
viewBox: o,
|
|
87
|
-
title:
|
|
88
|
-
monotone:
|
|
87
|
+
title: n,
|
|
88
|
+
monotone: a,
|
|
89
89
|
...r
|
|
90
90
|
}) => /* @__PURE__ */ i(
|
|
91
91
|
$,
|
|
@@ -94,7 +94,7 @@ const Rt = ({
|
|
|
94
94
|
size: "size-5",
|
|
95
95
|
viewBox: o,
|
|
96
96
|
className: t,
|
|
97
|
-
title:
|
|
97
|
+
title: n || "Info",
|
|
98
98
|
...r,
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ e(
|
|
@@ -107,11 +107,11 @@ const Rt = ({
|
|
|
107
107
|
/* @__PURE__ */ e("path", { d: "M256 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64m-64 120c0-13.3 10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24h-80c-13.3 0-24-10.7-24-24s10.7-24 24-24h24v-64h-24c-13.3 0-24-10.7-24-24" })
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
|
-
),
|
|
110
|
+
), Bt = ({
|
|
111
111
|
className: t,
|
|
112
112
|
viewBox: o,
|
|
113
|
-
title:
|
|
114
|
-
monotone:
|
|
113
|
+
title: n,
|
|
114
|
+
monotone: a,
|
|
115
115
|
...r
|
|
116
116
|
}) => /* @__PURE__ */ i(
|
|
117
117
|
$,
|
|
@@ -120,7 +120,7 @@ const Rt = ({
|
|
|
120
120
|
size: "size-5",
|
|
121
121
|
viewBox: o,
|
|
122
122
|
className: t,
|
|
123
|
-
title:
|
|
123
|
+
title: n || "Profile",
|
|
124
124
|
...r,
|
|
125
125
|
children: [
|
|
126
126
|
/* @__PURE__ */ e(
|
|
@@ -133,11 +133,11 @@ const Rt = ({
|
|
|
133
133
|
/* @__PURE__ */ e("path", { d: "M176 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128m-32 32c-44.2 0-80 35.8-80 80 0 8.8 7.2 16 16 16h192c8.8 0 16-7.2 16-16 0-44.2-35.8-80-80-80z" })
|
|
134
134
|
]
|
|
135
135
|
}
|
|
136
|
-
),
|
|
136
|
+
), Ht = ({
|
|
137
137
|
className: t,
|
|
138
138
|
viewBox: o,
|
|
139
|
-
title:
|
|
140
|
-
monotone:
|
|
139
|
+
title: n,
|
|
140
|
+
monotone: a,
|
|
141
141
|
...r
|
|
142
142
|
}) => /* @__PURE__ */ i(
|
|
143
143
|
$,
|
|
@@ -146,24 +146,24 @@ const Rt = ({
|
|
|
146
146
|
size: "size-5",
|
|
147
147
|
viewBox: o,
|
|
148
148
|
className: t,
|
|
149
|
-
title:
|
|
149
|
+
title: n || "Restore",
|
|
150
150
|
...r,
|
|
151
151
|
children: [
|
|
152
152
|
/* @__PURE__ */ e(
|
|
153
153
|
"path",
|
|
154
154
|
{
|
|
155
155
|
d: "M128 80v16h64V80c0-8.8 7.2-16 16-16h224c8.8 0 16 7.2 16 16v224c0 8.8-7.2 16-16 16h-16v64h16c44.2 0 80-35.8 80-80V80c0-44.2-35.8-80-80-80H208c-44.2 0-80 35.8-80 80",
|
|
156
|
-
opacity:
|
|
156
|
+
opacity: a ? "1" : "0.4"
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
159
|
/* @__PURE__ */ e("path", { d: "M64 128c-35.3 0-64 28.7-64 64v256c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64zm32 64h192c17.7 0 32 14.3 32 32s-14.3 32-32 32H96c-17.7 0-32-14.3-32-32s14.3-32 32-32" })
|
|
160
160
|
]
|
|
161
161
|
}
|
|
162
|
-
),
|
|
162
|
+
), Dt = ({
|
|
163
163
|
className: t,
|
|
164
164
|
viewBox: o,
|
|
165
|
-
title:
|
|
166
|
-
monotone:
|
|
165
|
+
title: n,
|
|
166
|
+
monotone: a,
|
|
167
167
|
...r
|
|
168
168
|
}) => /* @__PURE__ */ e(
|
|
169
169
|
$,
|
|
@@ -172,15 +172,15 @@ const Rt = ({
|
|
|
172
172
|
size: "size-5",
|
|
173
173
|
viewBox: o,
|
|
174
174
|
className: t,
|
|
175
|
-
title:
|
|
175
|
+
title: n || "Settings",
|
|
176
176
|
...r,
|
|
177
177
|
children: /* @__PURE__ */ e("path", { d: "M432 256a48 48 0 1 1-96 0 48 48 0 1 1 96 0m-160 0a48 48 0 1 1-96 0 48 48 0 1 1 96 0M64 304a48 48 0 1 1 0-96 48 48 0 1 1 0 96" })
|
|
178
178
|
}
|
|
179
|
-
),
|
|
179
|
+
), Vt = ({
|
|
180
180
|
className: t,
|
|
181
181
|
viewBox: o,
|
|
182
|
-
title:
|
|
183
|
-
monotone:
|
|
182
|
+
title: n,
|
|
183
|
+
monotone: a,
|
|
184
184
|
...r
|
|
185
185
|
}) => /* @__PURE__ */ i(
|
|
186
186
|
$,
|
|
@@ -189,141 +189,148 @@ const Rt = ({
|
|
|
189
189
|
size: "size-5",
|
|
190
190
|
viewBox: o,
|
|
191
191
|
className: t,
|
|
192
|
-
title:
|
|
192
|
+
title: n || "Sliders",
|
|
193
193
|
...r,
|
|
194
194
|
children: [
|
|
195
195
|
/* @__PURE__ */ e(
|
|
196
196
|
"path",
|
|
197
197
|
{
|
|
198
198
|
d: "M0 96c0-17.7 14.3-32 32-32h86.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m0 160c0-17.7 14.3-32 32-32h246.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m0 160c0-17.7 14.3-32 32-32h54.7c-2.1 4.9-3.8 10.1-4.9 15.4-.6 2.7-1 5.4-1.3 8.2-.1 1.4-.3 2.8-.3 4.2s-.1 2.8-.1 4.2c0 11.4 2.4 22.2 6.7 32H32c-17.7 0-32-14.3-32-32m233.3-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H233.3c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32zm32-320H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H265.3c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32zm160 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32h-54.7c2.1-4.9 3.8-10.1 4.9-15.4.6-2.7 1-5.4 1.3-8.2.1-1.4.3-2.8.3-4.2s.1-2.8.1-4.2c0-11.4-2.4-22.2-6.7-32z",
|
|
199
|
-
opacity:
|
|
199
|
+
opacity: a ? "1" : "0.4"
|
|
200
200
|
}
|
|
201
201
|
),
|
|
202
202
|
/* @__PURE__ */ e("path", { d: "M128 416a32 32 0 1 1 64 0 32 32 0 1 1-64 0m112 0a80 80 0 1 0-160 0 80 80 0 1 0 160 0m80-160a32 32 0 1 1 64 0 32 32 0 1 1-64 0m112 0a80 80 0 1 0-160 0 80 80 0 1 0 160 0M192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64m0-112a80 80 0 1 0 0 160 80 80 0 1 0 0-160" })
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
205
|
), $t = () => {
|
|
206
|
-
const { getAccessToken: t } =
|
|
207
|
-
data:
|
|
206
|
+
const { getAccessToken: t } = F(), o = me(), n = me(), {
|
|
207
|
+
data: a,
|
|
208
208
|
error: r,
|
|
209
209
|
isLoading: c
|
|
210
|
-
} =
|
|
210
|
+
} = ht({
|
|
211
211
|
getAccessToken: t
|
|
212
|
-
}), s = (
|
|
213
|
-
return /* @__PURE__ */ i(
|
|
212
|
+
}), s = (a == null ? void 0 : a.plugins) || [], d = (a == null ? void 0 : a.version) || "", m = (a == null ? void 0 : a.models) || [];
|
|
213
|
+
return /* @__PURE__ */ i(B, { children: [
|
|
214
214
|
/* @__PURE__ */ e("div", { className: "mb-4", children: /* @__PURE__ */ e(
|
|
215
|
-
|
|
215
|
+
H,
|
|
216
216
|
{
|
|
217
|
-
header:
|
|
217
|
+
header: N.ABOUT.TITLE_CLIENT,
|
|
218
218
|
className: "prose-dark dark:prose-lighter",
|
|
219
219
|
children: de(o, {
|
|
220
|
-
[
|
|
221
|
-
[
|
|
220
|
+
[N.ABOUT.VERSION]: "7.1.0",
|
|
221
|
+
[N.ABOUT.BUILD_TIMESTAMP]: "02/08/2025 04:03 PM EST"
|
|
222
222
|
})
|
|
223
223
|
}
|
|
224
224
|
) }),
|
|
225
225
|
r || c ? null : /* @__PURE__ */ e(
|
|
226
|
-
|
|
226
|
+
H,
|
|
227
227
|
{
|
|
228
|
-
header:
|
|
228
|
+
header: N.ABOUT.TITLE_SERVER,
|
|
229
229
|
className: "prose-dark dark:prose-lighter",
|
|
230
|
-
children: de(
|
|
231
|
-
[
|
|
232
|
-
[ue(
|
|
233
|
-
[ue(
|
|
230
|
+
children: de(n, {
|
|
231
|
+
[N.ABOUT.VERSION]: d,
|
|
232
|
+
[ue(N.ABOUT.PROVIDER, m.length)]: /* @__PURE__ */ e(B, { children: m.map((h) => /* @__PURE__ */ e("div", { className: "text-right", children: h }, h)) }),
|
|
233
|
+
[ue(N.ABOUT.PLUGIN, s.length)]: /* @__PURE__ */ e(B, { children: s.map((h) => /* @__PURE__ */ e("div", { className: "text-right", children: h }, h)) })
|
|
234
234
|
})
|
|
235
235
|
}
|
|
236
236
|
)
|
|
237
237
|
] });
|
|
238
|
-
},
|
|
238
|
+
}, Ft = ({
|
|
239
239
|
open: t,
|
|
240
240
|
onOpenChange: o
|
|
241
|
-
}) => /* @__PURE__ */ e(
|
|
241
|
+
}) => /* @__PURE__ */ e(ie, { open: t, onOpenChange: o, title: Qe, children: /* @__PURE__ */ e($t, {}) }), Ut = async (t, o, n, a, r, c) => {
|
|
242
242
|
try {
|
|
243
|
-
const
|
|
244
|
-
accessToken:
|
|
245
|
-
type:
|
|
243
|
+
const s = await le({
|
|
244
|
+
accessToken: a,
|
|
245
|
+
type: ce.GET_CHAT,
|
|
246
246
|
params: {
|
|
247
247
|
id: t.id
|
|
248
248
|
}
|
|
249
249
|
});
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
s.status === 200 && (s.data.provider !== c && await Ct({
|
|
251
|
+
provider: s.data.provider,
|
|
252
|
+
accessToken: a,
|
|
253
|
+
username: r
|
|
254
|
+
}), o({
|
|
255
|
+
type: Tt,
|
|
252
256
|
payload: {
|
|
253
257
|
id: t.id,
|
|
254
|
-
model:
|
|
255
|
-
|
|
256
|
-
|
|
258
|
+
model: s.data.model,
|
|
259
|
+
provider: s.data.provider,
|
|
260
|
+
usage: s.data.usage,
|
|
261
|
+
messages: s.data.messages
|
|
257
262
|
}
|
|
258
|
-
}),
|
|
263
|
+
}), n(!1));
|
|
259
264
|
} catch {
|
|
260
265
|
}
|
|
261
266
|
}, Gt = ({
|
|
262
267
|
filteredHistory: t,
|
|
263
268
|
dispatch: o,
|
|
264
|
-
onOpenChange:
|
|
265
|
-
mutate:
|
|
269
|
+
onOpenChange: n,
|
|
270
|
+
mutate: a
|
|
266
271
|
}) => {
|
|
267
272
|
var I;
|
|
268
|
-
const { user: r, getAccessToken: c } =
|
|
273
|
+
const { user: r, getAccessToken: c } = F(), s = S(null), d = S({
|
|
269
274
|
id: 0,
|
|
270
275
|
timestamp: "",
|
|
271
276
|
message: ""
|
|
272
|
-
}), [m, h] = k(!1), [
|
|
273
|
-
|
|
274
|
-
), { state: C, dispatch: l } =
|
|
275
|
-
|
|
277
|
+
}), [m, h] = k(!1), [f, b] = k(
|
|
278
|
+
ve + Se
|
|
279
|
+
), { state: C, dispatch: l } = he(Pe), {
|
|
280
|
+
state: { provider: p }
|
|
281
|
+
} = he(Oe), [, T] = Ce({
|
|
282
|
+
key: ke + Ze,
|
|
276
283
|
initialValue: C.sortDirection
|
|
277
|
-
}),
|
|
284
|
+
}), E = (u) => {
|
|
278
285
|
switch (C.sortDirection) {
|
|
279
|
-
case
|
|
280
|
-
|
|
286
|
+
case re.ASC:
|
|
287
|
+
T(re.DESC), l({
|
|
281
288
|
type: Ae,
|
|
282
289
|
payload: {
|
|
283
290
|
sortedCell: u,
|
|
284
|
-
sortDirection:
|
|
291
|
+
sortDirection: re.DESC
|
|
285
292
|
}
|
|
286
293
|
});
|
|
287
294
|
break;
|
|
288
295
|
default:
|
|
289
|
-
|
|
296
|
+
T(re.ASC), l({
|
|
290
297
|
type: Ae,
|
|
291
298
|
payload: {
|
|
292
299
|
sortedCell: u,
|
|
293
|
-
sortDirection:
|
|
300
|
+
sortDirection: re.ASC
|
|
294
301
|
}
|
|
295
302
|
});
|
|
296
303
|
break;
|
|
297
304
|
}
|
|
298
|
-
},
|
|
305
|
+
}, g = async () => {
|
|
299
306
|
const u = d.current;
|
|
300
307
|
try {
|
|
301
|
-
await
|
|
308
|
+
await le({
|
|
302
309
|
accessToken: await c(),
|
|
303
|
-
type:
|
|
310
|
+
type: ce.DELETE_CHAT,
|
|
304
311
|
params: {
|
|
305
312
|
userId: (r == null ? void 0 : r.username) || "",
|
|
306
313
|
id: u.id
|
|
307
314
|
}
|
|
308
|
-
}),
|
|
315
|
+
}), a();
|
|
309
316
|
} catch {
|
|
310
317
|
}
|
|
311
|
-
},
|
|
312
|
-
u[0].isIntersecting && b((
|
|
318
|
+
}, R = Be((u) => {
|
|
319
|
+
u[0].isIntersecting && b((M) => M + ve);
|
|
313
320
|
}, []);
|
|
314
|
-
return
|
|
321
|
+
return U(() => {
|
|
315
322
|
const u = {
|
|
316
323
|
// root: null,
|
|
317
324
|
rootMargin: "20px"
|
|
318
|
-
}, w = new IntersectionObserver(
|
|
325
|
+
}, w = new IntersectionObserver(R, u);
|
|
319
326
|
s.current && w.observe(s.current);
|
|
320
|
-
}), /* @__PURE__ */ i(
|
|
327
|
+
}), /* @__PURE__ */ i(B, { children: [
|
|
321
328
|
/* @__PURE__ */ i(
|
|
322
|
-
|
|
329
|
+
Me,
|
|
323
330
|
{
|
|
324
331
|
showConfirmation: m,
|
|
325
332
|
setShowConfirmation: h,
|
|
326
|
-
action:
|
|
333
|
+
action: g,
|
|
327
334
|
customStrings: {
|
|
328
335
|
confirmAction: "Delete",
|
|
329
336
|
cancelAction: "Cancel",
|
|
@@ -346,11 +353,11 @@ const Rt = ({
|
|
|
346
353
|
]
|
|
347
354
|
}
|
|
348
355
|
),
|
|
349
|
-
/* @__PURE__ */ i(
|
|
350
|
-
/* @__PURE__ */ e(
|
|
351
|
-
/* @__PURE__ */ e(
|
|
356
|
+
/* @__PURE__ */ i(ft, { stickyHeader: !0, stickyFooter: !0, compact: !0, children: [
|
|
357
|
+
/* @__PURE__ */ e(pt, { children: /* @__PURE__ */ i(ge, { children: [
|
|
358
|
+
/* @__PURE__ */ e(P, { className: "sr-only", children: "Row" }),
|
|
352
359
|
/* @__PURE__ */ e(
|
|
353
|
-
|
|
360
|
+
gt,
|
|
354
361
|
{
|
|
355
362
|
buttonClassName: "text-xs sm:text-sm",
|
|
356
363
|
cellId: "timestamp",
|
|
@@ -358,24 +365,24 @@ const Rt = ({
|
|
|
358
365
|
sortDirection: C.sortDirection,
|
|
359
366
|
sortedCell: C.sortedCell,
|
|
360
367
|
onClick: () => {
|
|
361
|
-
|
|
368
|
+
E("timestamp");
|
|
362
369
|
},
|
|
363
370
|
children: "Date"
|
|
364
371
|
}
|
|
365
372
|
),
|
|
366
|
-
/* @__PURE__ */ e(
|
|
367
|
-
/* @__PURE__ */ e(
|
|
368
|
-
/* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e(P, { className: "text-xs sm:text-sm", children: "Summary" }),
|
|
374
|
+
/* @__PURE__ */ e(P, { className: "text-xs sm:text-sm", children: "Provider" }),
|
|
375
|
+
/* @__PURE__ */ e(P, { className: "text-xs sm:text-sm text-right", children: "Actions" })
|
|
369
376
|
] }) }),
|
|
370
|
-
/* @__PURE__ */ e(
|
|
371
|
-
var
|
|
372
|
-
const
|
|
373
|
-
return ((
|
|
374
|
-
w ===
|
|
375
|
-
/* @__PURE__ */ i(
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
+
/* @__PURE__ */ e(yt, { children: t.slice(0, f).map((u, w) => {
|
|
378
|
+
var D, v;
|
|
379
|
+
const M = u.summary || (u.messages.length > 0 ? (D = u.messages[0]) == null ? void 0 : D.content : "");
|
|
380
|
+
return ((v = u == null ? void 0 : u.messages) == null ? void 0 : v.length) > 0 ? /* @__PURE__ */ i(_t, { children: [
|
|
381
|
+
w === f - Se && /* @__PURE__ */ e("tr", { ref: s }),
|
|
382
|
+
/* @__PURE__ */ i(ge, { children: [
|
|
383
|
+
/* @__PURE__ */ e(P, { children: w + 1 }),
|
|
377
384
|
/* @__PURE__ */ e(
|
|
378
|
-
|
|
385
|
+
P,
|
|
379
386
|
{
|
|
380
387
|
component: "th",
|
|
381
388
|
scope: "row",
|
|
@@ -384,125 +391,127 @@ const Rt = ({
|
|
|
384
391
|
}
|
|
385
392
|
),
|
|
386
393
|
/* @__PURE__ */ e(
|
|
387
|
-
|
|
394
|
+
P,
|
|
388
395
|
{
|
|
389
396
|
className: "max-w-[100px] text-white sm:max-w-full text-xs sm:text-sm",
|
|
390
397
|
style: {
|
|
391
398
|
wordBreak: "break-word"
|
|
392
399
|
},
|
|
393
|
-
children:
|
|
400
|
+
children: M
|
|
394
401
|
}
|
|
395
402
|
),
|
|
396
403
|
/* @__PURE__ */ i(
|
|
397
|
-
|
|
404
|
+
P,
|
|
398
405
|
{
|
|
399
406
|
component: "th",
|
|
400
407
|
scope: "row",
|
|
401
408
|
className: "text-gray-400",
|
|
402
409
|
align: "center",
|
|
403
410
|
children: [
|
|
404
|
-
u.model && u.model.startsWith("claude") && /* @__PURE__ */ e(
|
|
405
|
-
u.model && u.model.startsWith("gpt") && /* @__PURE__ */ e(
|
|
411
|
+
u.model && u.model.startsWith("claude") && /* @__PURE__ */ e(bt, { size: "size-4 sm:size-5" }),
|
|
412
|
+
u.model && u.model.startsWith("gpt") && /* @__PURE__ */ e(xt, { size: "size-4 sm:size-5" })
|
|
406
413
|
]
|
|
407
414
|
}
|
|
408
415
|
),
|
|
409
|
-
/* @__PURE__ */ i(
|
|
416
|
+
/* @__PURE__ */ i(P, { align: "right", children: [
|
|
410
417
|
/* @__PURE__ */ e(
|
|
411
|
-
|
|
418
|
+
se,
|
|
412
419
|
{
|
|
413
420
|
className: "mr-2",
|
|
414
421
|
focusMode: "alt-system",
|
|
415
422
|
noBorder: !0,
|
|
416
423
|
label: "Restore chat",
|
|
417
424
|
onClick: async () => {
|
|
418
|
-
const
|
|
419
|
-
|
|
425
|
+
const z = await c();
|
|
426
|
+
Ut(
|
|
420
427
|
u,
|
|
421
428
|
o,
|
|
422
|
-
|
|
423
|
-
|
|
429
|
+
n,
|
|
430
|
+
z,
|
|
431
|
+
(r == null ? void 0 : r.username) || "",
|
|
432
|
+
p
|
|
424
433
|
);
|
|
425
434
|
},
|
|
426
|
-
children: /* @__PURE__ */ e(
|
|
435
|
+
children: /* @__PURE__ */ e(Ht, { size: "size-3", monotone: !0 })
|
|
427
436
|
}
|
|
428
437
|
),
|
|
429
438
|
/* @__PURE__ */ e(
|
|
430
|
-
|
|
439
|
+
se,
|
|
431
440
|
{
|
|
432
441
|
focusMode: "alt-system",
|
|
433
442
|
noBorder: !0,
|
|
434
443
|
label: "Delete chat",
|
|
435
444
|
onClick: () => {
|
|
436
|
-
var
|
|
445
|
+
var z;
|
|
437
446
|
d.current = {
|
|
438
447
|
id: u.id,
|
|
439
448
|
timestamp: u.timestamp,
|
|
440
|
-
message: u.messages.length > 0 ? (
|
|
449
|
+
message: u.messages.length > 0 ? (z = u.messages[0]) == null ? void 0 : z.content : ""
|
|
441
450
|
}, h(!m);
|
|
442
451
|
},
|
|
443
|
-
children: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ e(
|
|
452
|
+
children: /* @__PURE__ */ e("div", { className: "text-red-400", children: /* @__PURE__ */ e(Ot, { size: "size-3", monotone: !0 }) })
|
|
444
453
|
}
|
|
445
454
|
)
|
|
446
455
|
] })
|
|
447
456
|
] })
|
|
448
|
-
] }, `${
|
|
457
|
+
] }, `${N.HISTORY.TITLE}-${u.id}-${w}`) : null;
|
|
449
458
|
}) }),
|
|
450
|
-
/* @__PURE__ */ e(
|
|
459
|
+
/* @__PURE__ */ e(kt, { children: /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ e(P, { colSpan: 1e3, children: /* @__PURE__ */ e("div", { children: ue(
|
|
451
460
|
`${t.length} chat`,
|
|
452
461
|
t.length
|
|
453
462
|
) }) }) }) })
|
|
454
463
|
] })
|
|
455
464
|
] });
|
|
456
|
-
},
|
|
465
|
+
}, Yt = ({
|
|
457
466
|
open: t,
|
|
458
467
|
onOpenChange: o
|
|
459
468
|
}) => {
|
|
460
|
-
const { getAccessToken:
|
|
469
|
+
const { getAccessToken: n, user: a } = F(), {
|
|
461
470
|
state: { lastTriggeredTimestamp: r },
|
|
462
471
|
dispatch: c
|
|
463
|
-
} =
|
|
472
|
+
} = he(Oe), { state: s, dispatch: d } = he(Pe), { data: m, mutate: h } = Et({
|
|
464
473
|
keys: [
|
|
465
|
-
|
|
474
|
+
a == null ? void 0 : a.username,
|
|
466
475
|
s.searchString,
|
|
467
476
|
s.sortDirection,
|
|
468
477
|
r || 0
|
|
469
478
|
],
|
|
470
|
-
getAccessToken:
|
|
471
|
-
}),
|
|
472
|
-
key: ke +
|
|
479
|
+
getAccessToken: n
|
|
480
|
+
}), f = S(null), [, b] = Ce({
|
|
481
|
+
key: ke + Je,
|
|
473
482
|
initialValue: s.searchString
|
|
474
483
|
}), [C, l] = k([]);
|
|
475
|
-
|
|
484
|
+
U(() => {
|
|
476
485
|
m && l(m);
|
|
477
486
|
}, [m]);
|
|
478
|
-
const
|
|
487
|
+
const p = async (g) => {
|
|
479
488
|
b(g), d({
|
|
480
|
-
type:
|
|
489
|
+
type: tt,
|
|
481
490
|
payload: { searchString: g }
|
|
482
491
|
});
|
|
483
|
-
},
|
|
484
|
-
|
|
492
|
+
}, T = rt((g) => {
|
|
493
|
+
p(g.target.value.trim());
|
|
485
494
|
}, 500);
|
|
486
|
-
return /* @__PURE__ */ e(
|
|
495
|
+
return /* @__PURE__ */ e(ie, { open: t, onOpenChange: o, title: et, children: /* @__PURE__ */ i(B, { children: [
|
|
487
496
|
/* @__PURE__ */ e("form", { autoComplete: "off", onSubmit: async (g) => {
|
|
488
497
|
g.preventDefault();
|
|
489
498
|
}, children: /* @__PURE__ */ e(
|
|
490
|
-
|
|
499
|
+
be,
|
|
491
500
|
{
|
|
492
501
|
autoCapitalize: "off",
|
|
493
502
|
autoComplete: "off",
|
|
494
503
|
autoCorrect: "off",
|
|
495
|
-
ref:
|
|
504
|
+
ref: f,
|
|
496
505
|
defaultValue: s.searchString,
|
|
497
506
|
focusMode: "light",
|
|
498
507
|
mode: "dark",
|
|
499
508
|
name: "Search",
|
|
500
509
|
label: "Search",
|
|
501
|
-
onChange:
|
|
510
|
+
onChange: T,
|
|
502
511
|
className: "mt-2 mb-2",
|
|
503
512
|
...s.searchString && {
|
|
504
513
|
rightElement: /* @__PURE__ */ e(
|
|
505
|
-
|
|
514
|
+
q,
|
|
506
515
|
{
|
|
507
516
|
type: "button",
|
|
508
517
|
disabled: !s.searchString,
|
|
@@ -512,7 +521,7 @@ const Rt = ({
|
|
|
512
521
|
size: "small",
|
|
513
522
|
onClick: () => {
|
|
514
523
|
var g;
|
|
515
|
-
|
|
524
|
+
p(""), (g = f.current) != null && g.value && (f.current.value = "", f.current.focus());
|
|
516
525
|
},
|
|
517
526
|
children: "Reset"
|
|
518
527
|
}
|
|
@@ -530,37 +539,37 @@ const Rt = ({
|
|
|
530
539
|
}
|
|
531
540
|
) })
|
|
532
541
|
] }) });
|
|
533
|
-
},
|
|
534
|
-
const { isAuthenticated: o, user:
|
|
535
|
-
return o && d ? /* @__PURE__ */ i(
|
|
542
|
+
}, jt = ({ stats: t }) => {
|
|
543
|
+
const { isAuthenticated: o, user: n, registeringForPasskey: a, authenticationType: r } = F(), c = me(), s = me(), d = (n == null ? void 0 : n.username) || "";
|
|
544
|
+
return o && d ? /* @__PURE__ */ i(B, { children: [
|
|
536
545
|
/* @__PURE__ */ e(
|
|
537
|
-
|
|
546
|
+
H,
|
|
538
547
|
{
|
|
539
|
-
header:
|
|
548
|
+
header: N.PREFERENCES.TITLE,
|
|
540
549
|
className: "prose-dark dark:prose-lighter",
|
|
541
550
|
children: de(c, {
|
|
542
|
-
[
|
|
543
|
-
[
|
|
551
|
+
[N.PREFERENCES.NAME]: d,
|
|
552
|
+
[N.PREFERENCES.EMAIL]: (n == null ? void 0 : n.email) || ""
|
|
544
553
|
})
|
|
545
554
|
}
|
|
546
555
|
),
|
|
547
|
-
r !==
|
|
548
|
-
|
|
556
|
+
r !== at.PASSKEY && !nt() && /* @__PURE__ */ i(
|
|
557
|
+
H,
|
|
549
558
|
{
|
|
550
559
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
551
|
-
header: /* @__PURE__ */ e("h2", { className: "m-0", children: /* @__PURE__ */ i(
|
|
552
|
-
/* @__PURE__ */ e(
|
|
553
|
-
/* @__PURE__ */ e(
|
|
560
|
+
header: /* @__PURE__ */ e("h2", { className: "m-0", children: /* @__PURE__ */ i(Q, { columnGap: 3, alignVertical: "center", children: [
|
|
561
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(Ie, { size: "size-8" }) }),
|
|
562
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e("div", { children: N.PREFERENCES.PASSKEY_TITLE }) })
|
|
554
563
|
] }) }),
|
|
555
564
|
children: [
|
|
556
|
-
/* @__PURE__ */ e("p", { children:
|
|
565
|
+
/* @__PURE__ */ e("p", { children: N.PREFERENCES.PASSKEY_INSTRUCTIONS }),
|
|
557
566
|
/* @__PURE__ */ e(
|
|
558
|
-
|
|
567
|
+
se,
|
|
559
568
|
{
|
|
560
569
|
size: "small",
|
|
561
570
|
className: "mt-2",
|
|
562
|
-
onClick:
|
|
563
|
-
labelLeft:
|
|
571
|
+
onClick: a,
|
|
572
|
+
labelLeft: N.PREFERENCES.PASSKEY_BUTTON,
|
|
564
573
|
children: /* @__PURE__ */ e(Ie, { size: "size-5", monotone: !0 })
|
|
565
574
|
}
|
|
566
575
|
)
|
|
@@ -568,32 +577,32 @@ const Rt = ({
|
|
|
568
577
|
}
|
|
569
578
|
),
|
|
570
579
|
/* @__PURE__ */ e(
|
|
571
|
-
|
|
580
|
+
H,
|
|
572
581
|
{
|
|
573
|
-
header:
|
|
582
|
+
header: N.MAIN_STATISTICS.TITLE,
|
|
574
583
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
575
584
|
children: de(s, {
|
|
576
|
-
[ue(
|
|
577
|
-
[
|
|
585
|
+
[ue(N.MAIN_STATISTICS.TOTAL, t.totalChats)]: t.totalChats,
|
|
586
|
+
[N.MAIN_STATISTICS.PROCESSING_TIME]: ot(
|
|
578
587
|
t.averageProcessingTimes
|
|
579
588
|
)
|
|
580
589
|
})
|
|
581
590
|
}
|
|
582
591
|
)
|
|
583
592
|
] }) : null;
|
|
584
|
-
},
|
|
593
|
+
}, Kt = ({
|
|
585
594
|
open: t,
|
|
586
595
|
onOpenChange: o
|
|
587
596
|
}) => {
|
|
588
|
-
const { getAccessToken:
|
|
597
|
+
const { getAccessToken: n, user: a } = F(), {
|
|
589
598
|
data: r,
|
|
590
599
|
error: c,
|
|
591
600
|
isLoading: s
|
|
592
|
-
} =
|
|
593
|
-
keys: [
|
|
594
|
-
getAccessToken:
|
|
601
|
+
} = Nt({
|
|
602
|
+
keys: [a == null ? void 0 : a.username],
|
|
603
|
+
getAccessToken: n
|
|
595
604
|
});
|
|
596
|
-
return c || s ? null : /* @__PURE__ */ e(
|
|
605
|
+
return c || s ? null : /* @__PURE__ */ e(ie, { open: t, onOpenChange: o, title: st, children: /* @__PURE__ */ e(jt, { stats: r }) });
|
|
597
606
|
};
|
|
598
607
|
/*!
|
|
599
608
|
@versini/ui-textarea v3.0.13
|
|
@@ -608,22 +617,22 @@ try {
|
|
|
608
617
|
});
|
|
609
618
|
} catch {
|
|
610
619
|
}
|
|
611
|
-
const
|
|
612
|
-
function
|
|
613
|
-
const t =
|
|
614
|
-
return
|
|
620
|
+
const De = "av-text-area", Wt = "av-text-area-wrapper", ye = "av-text-area-helper-text", Xt = "av-text-area__control--right", qt = "av-text-area__control--left";
|
|
621
|
+
function Qt() {
|
|
622
|
+
const t = S(!1);
|
|
623
|
+
return U(() => (t.current = !0, () => {
|
|
615
624
|
t.current = !1;
|
|
616
|
-
}), []),
|
|
625
|
+
}), []), Be(() => t.current, []);
|
|
617
626
|
}
|
|
618
|
-
function
|
|
619
|
-
return
|
|
627
|
+
function Zt(t) {
|
|
628
|
+
return He(() => t.every((o) => o == null) ? () => {
|
|
620
629
|
} : (o) => {
|
|
621
|
-
t.forEach((
|
|
622
|
-
typeof
|
|
630
|
+
t.forEach((n) => {
|
|
631
|
+
typeof n == "function" ? n(o) : n != null && (n.current = o);
|
|
623
632
|
});
|
|
624
633
|
}, t);
|
|
625
634
|
}
|
|
626
|
-
const
|
|
635
|
+
const Jt = {
|
|
627
636
|
x: 0,
|
|
628
637
|
y: 0,
|
|
629
638
|
width: 0,
|
|
@@ -633,48 +642,48 @@ const Zt = {
|
|
|
633
642
|
bottom: 0,
|
|
634
643
|
right: 0
|
|
635
644
|
};
|
|
636
|
-
function
|
|
637
|
-
const o =
|
|
645
|
+
function Re(t) {
|
|
646
|
+
const o = Qt(), n = S(0), a = S(null), [r, c] = k(Jt), s = He(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
|
|
638
647
|
const m = d[0];
|
|
639
|
-
m && (cancelAnimationFrame(
|
|
640
|
-
|
|
648
|
+
m && (cancelAnimationFrame(n.current), n.current = requestAnimationFrame(() => {
|
|
649
|
+
a.current && o() && c(m.contentRect);
|
|
641
650
|
}));
|
|
642
651
|
}), [o]);
|
|
643
|
-
return
|
|
644
|
-
s == null || s.disconnect(),
|
|
645
|
-
}), [s, t]), [
|
|
652
|
+
return U(() => (a.current && (s == null || s.observe(a.current, t)), () => {
|
|
653
|
+
s == null || s.disconnect(), n.current && cancelAnimationFrame(n.current);
|
|
654
|
+
}), [s, t]), [a, r];
|
|
646
655
|
}
|
|
647
|
-
function
|
|
656
|
+
function er({
|
|
648
657
|
value: t,
|
|
649
658
|
defaultValue: o,
|
|
650
|
-
finalValue:
|
|
651
|
-
onChange:
|
|
659
|
+
finalValue: n,
|
|
660
|
+
onChange: a = () => {
|
|
652
661
|
},
|
|
653
662
|
initialControlledDelay: r = 0
|
|
654
663
|
}) {
|
|
655
664
|
const [c, s] = k(!1), [d, m] = k(
|
|
656
|
-
o !== void 0 ? o :
|
|
657
|
-
), h = (
|
|
658
|
-
m(
|
|
665
|
+
o !== void 0 ? o : n
|
|
666
|
+
), h = (f) => {
|
|
667
|
+
m(f), a == null || a(f);
|
|
659
668
|
};
|
|
660
|
-
return
|
|
669
|
+
return U(() => {
|
|
661
670
|
(async () => t !== void 0 && !c && r > 0 && (await new Promise(
|
|
662
|
-
(
|
|
671
|
+
(f) => setTimeout(f, r)
|
|
663
672
|
), s(!0)))();
|
|
664
|
-
}, [t, r, c]), t !== void 0 ? !c && r > 0 ? ["",
|
|
673
|
+
}, [t, r, c]), t !== void 0 ? !c && r > 0 ? ["", a, !0] : [t, a, !0] : [d, h, !1];
|
|
665
674
|
}
|
|
666
|
-
function
|
|
667
|
-
const o =
|
|
675
|
+
function tr(t) {
|
|
676
|
+
const o = Rt();
|
|
668
677
|
if (!t)
|
|
669
678
|
return o;
|
|
670
679
|
if (typeof t == "number" || typeof t == "string")
|
|
671
680
|
return `${t}${o}`;
|
|
672
681
|
if (typeof t == "object") {
|
|
673
|
-
const { id:
|
|
674
|
-
return typeof
|
|
682
|
+
const { id: n, prefix: a = "" } = t;
|
|
683
|
+
return typeof n == "number" || typeof n == "string" ? `${a}${n}` : `${a}${o}`;
|
|
675
684
|
}
|
|
676
685
|
}
|
|
677
|
-
const
|
|
686
|
+
const Ve = "SET_ANNOUNCEMENT", $e = "CLEAR_ANNOUNCEMENT", rr = {
|
|
678
687
|
alert: null,
|
|
679
688
|
alertdialog: null,
|
|
680
689
|
log: "polite",
|
|
@@ -682,9 +691,9 @@ const De = "SET_ANNOUNCEMENT", $e = "CLEAR_ANNOUNCEMENT", tr = {
|
|
|
682
691
|
progressbar: null,
|
|
683
692
|
status: "polite",
|
|
684
693
|
timer: "assertive"
|
|
685
|
-
},
|
|
694
|
+
}, ar = (t, o) => {
|
|
686
695
|
switch (o == null ? void 0 : o.type) {
|
|
687
|
-
case
|
|
696
|
+
case Ve:
|
|
688
697
|
return {
|
|
689
698
|
...t,
|
|
690
699
|
announcement: o.payload
|
|
@@ -704,68 +713,68 @@ const De = "SET_ANNOUNCEMENT", $e = "CLEAR_ANNOUNCEMENT", tr = {
|
|
|
704
713
|
o({
|
|
705
714
|
type: $e
|
|
706
715
|
}), typeof t == "function" && t();
|
|
707
|
-
},
|
|
716
|
+
}, Le = ({
|
|
708
717
|
children: t,
|
|
709
718
|
clearAnnouncementDelay: o,
|
|
710
|
-
clearAnnouncementTimeoutRef:
|
|
711
|
-
onAnnouncementClear:
|
|
719
|
+
clearAnnouncementTimeoutRef: n,
|
|
720
|
+
onAnnouncementClear: a,
|
|
712
721
|
dispatch: r
|
|
713
722
|
}) => {
|
|
714
|
-
clearTimeout(
|
|
715
|
-
type:
|
|
723
|
+
clearTimeout(n.current), t !== null && r({
|
|
724
|
+
type: Ve,
|
|
716
725
|
payload: t
|
|
717
|
-
}), o && (
|
|
726
|
+
}), o && (n.current = setTimeout(
|
|
718
727
|
() => nr({
|
|
719
|
-
onAnnouncementClear:
|
|
728
|
+
onAnnouncementClear: a,
|
|
720
729
|
dispatch: r
|
|
721
730
|
}),
|
|
722
731
|
o
|
|
723
732
|
));
|
|
724
|
-
},
|
|
733
|
+
}, or = ({
|
|
725
734
|
children: t,
|
|
726
735
|
announcementTimeoutRef: o,
|
|
727
|
-
announcementDelay:
|
|
728
|
-
clearAnnouncementDelay:
|
|
736
|
+
announcementDelay: n,
|
|
737
|
+
clearAnnouncementDelay: a,
|
|
729
738
|
clearAnnouncementTimeoutRef: r,
|
|
730
739
|
onAnnouncementClear: c,
|
|
731
740
|
dispatch: s
|
|
732
741
|
}) => {
|
|
733
|
-
clearTimeout(o.current),
|
|
742
|
+
clearTimeout(o.current), n ? o.current = setTimeout(Le, n, {
|
|
734
743
|
children: t,
|
|
735
|
-
clearAnnouncementDelay:
|
|
744
|
+
clearAnnouncementDelay: a,
|
|
736
745
|
clearAnnouncementTimeoutRef: r,
|
|
737
746
|
onAnnouncementClear: c,
|
|
738
747
|
dispatch: s
|
|
739
|
-
}) :
|
|
748
|
+
}) : Le({
|
|
740
749
|
children: t,
|
|
741
|
-
clearAnnouncementDelay:
|
|
750
|
+
clearAnnouncementDelay: a,
|
|
742
751
|
clearAnnouncementTimeoutRef: r,
|
|
743
752
|
onAnnouncementClear: c,
|
|
744
753
|
dispatch: s
|
|
745
754
|
});
|
|
746
755
|
};
|
|
747
|
-
function
|
|
756
|
+
function sr({
|
|
748
757
|
children: t,
|
|
749
758
|
className: o,
|
|
750
|
-
politeness:
|
|
751
|
-
role:
|
|
759
|
+
politeness: n,
|
|
760
|
+
role: a = null,
|
|
752
761
|
announcementDelay: r,
|
|
753
762
|
clearAnnouncementDelay: c,
|
|
754
763
|
onAnnouncementClear: s,
|
|
755
764
|
visible: d,
|
|
756
765
|
...m
|
|
757
766
|
}) {
|
|
758
|
-
const h =
|
|
767
|
+
const h = S(null), f = S(null), [b, C] = Lt(ar, {
|
|
759
768
|
announcement: null
|
|
760
769
|
});
|
|
761
|
-
let l =
|
|
762
|
-
typeof l > "u" && (l =
|
|
763
|
-
|
|
770
|
+
let l = n;
|
|
771
|
+
typeof l > "u" && (l = a ? rr[a] : "assertive"), U(() => {
|
|
772
|
+
or({
|
|
764
773
|
announcementTimeoutRef: h,
|
|
765
774
|
announcementDelay: r,
|
|
766
775
|
children: t,
|
|
767
776
|
clearAnnouncementDelay: c,
|
|
768
|
-
clearAnnouncementTimeoutRef:
|
|
777
|
+
clearAnnouncementTimeoutRef: f,
|
|
769
778
|
onAnnouncementClear: s,
|
|
770
779
|
dispatch: C
|
|
771
780
|
});
|
|
@@ -775,15 +784,15 @@ function or({
|
|
|
775
784
|
c,
|
|
776
785
|
s
|
|
777
786
|
]);
|
|
778
|
-
const
|
|
787
|
+
const p = y(o, {
|
|
779
788
|
"sr-only": !d
|
|
780
789
|
});
|
|
781
790
|
return /* @__PURE__ */ e(
|
|
782
791
|
"div",
|
|
783
792
|
{
|
|
784
793
|
"aria-live": l,
|
|
785
|
-
...
|
|
786
|
-
className:
|
|
794
|
+
...a && { role: a },
|
|
795
|
+
className: p,
|
|
787
796
|
...m,
|
|
788
797
|
children: b.announcement
|
|
789
798
|
}
|
|
@@ -802,19 +811,19 @@ try {
|
|
|
802
811
|
});
|
|
803
812
|
} catch {
|
|
804
813
|
}
|
|
805
|
-
const
|
|
814
|
+
const lr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", cr = ({ mode: t }) => y({
|
|
806
815
|
"bg-surface-darker text-copy-lighter caret-copy-light": t === "dark",
|
|
807
816
|
"bg-surface-lighter text-copy-dark caret-copy-dark": t === "light",
|
|
808
817
|
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": t === "system",
|
|
809
818
|
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": t === "alt-system"
|
|
810
|
-
}),
|
|
819
|
+
}), ir = ({
|
|
811
820
|
focusMode: t
|
|
812
821
|
}) => y("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
813
822
|
"focus:outline-focus-dark": t === "dark",
|
|
814
823
|
"focus:outline-focus-light": t === "light",
|
|
815
824
|
"focus:outline-focus-light dark:focus:outline-focus-dark": t === "alt-system",
|
|
816
825
|
"focus:outline-focus-dark dark:focus:outline-focus-light": t === "system"
|
|
817
|
-
}),
|
|
826
|
+
}), dr = ({
|
|
818
827
|
noBorder: t,
|
|
819
828
|
error: o
|
|
820
829
|
}) => y("border-2", {
|
|
@@ -822,11 +831,11 @@ const sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
822
831
|
"focus:border-border-dark": !t && o,
|
|
823
832
|
"border-border-error-dark": !t && o,
|
|
824
833
|
"border-transparent": t
|
|
825
|
-
}),
|
|
834
|
+
}), ur = ({
|
|
826
835
|
disabled: t,
|
|
827
836
|
raw: o,
|
|
828
|
-
error:
|
|
829
|
-
mode:
|
|
837
|
+
error: n,
|
|
838
|
+
mode: a,
|
|
830
839
|
leftElement: r,
|
|
831
840
|
rightElement: c
|
|
832
841
|
}) => {
|
|
@@ -839,60 +848,60 @@ const sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
839
848
|
"translate-x-[12px]": c === !0 && !r || !c && !r
|
|
840
849
|
}
|
|
841
850
|
);
|
|
842
|
-
if (!
|
|
851
|
+
if (!n)
|
|
843
852
|
return y(
|
|
844
853
|
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
|
845
854
|
{
|
|
846
855
|
"translate-x-[12px]": c === !0 && !r || !c && !r,
|
|
847
|
-
"text-copy-medium":
|
|
848
|
-
"text-copy-dark":
|
|
849
|
-
"text-copy-dark dark:text-copy-medium":
|
|
850
|
-
"text-copy-medium dark:text-copy-dark":
|
|
856
|
+
"text-copy-medium": a === "dark",
|
|
857
|
+
"text-copy-dark": a === "light",
|
|
858
|
+
"text-copy-dark dark:text-copy-medium": a === "system",
|
|
859
|
+
"text-copy-medium dark:text-copy-dark": a === "alt-system"
|
|
851
860
|
}
|
|
852
861
|
);
|
|
853
|
-
if (
|
|
862
|
+
if (n)
|
|
854
863
|
return y(
|
|
855
864
|
"absolute px-2 cursor-text font-medium transform translate-y-0 scale-100",
|
|
856
865
|
{
|
|
857
866
|
"translate-x-[12px]": c === !0 && !r || !c && !r,
|
|
858
|
-
"text-copy-medium":
|
|
859
|
-
"text-copy-error-dark":
|
|
860
|
-
"text-copy-error-dark dark:text-copy-error-light":
|
|
861
|
-
"text-copy-medium dark:text-copy-error-dark":
|
|
867
|
+
"text-copy-medium": a === "dark",
|
|
868
|
+
"text-copy-error-dark": a === "light",
|
|
869
|
+
"text-copy-error-dark dark:text-copy-error-light": a === "system",
|
|
870
|
+
"text-copy-medium dark:text-copy-error-dark": a === "alt-system"
|
|
862
871
|
}
|
|
863
872
|
);
|
|
864
|
-
},
|
|
873
|
+
}, mr = ({
|
|
865
874
|
error: t,
|
|
866
875
|
raw: o,
|
|
867
|
-
mode:
|
|
868
|
-
disabled:
|
|
876
|
+
mode: n,
|
|
877
|
+
disabled: a
|
|
869
878
|
}) => {
|
|
870
879
|
if (o)
|
|
871
880
|
return "";
|
|
872
|
-
if (
|
|
881
|
+
if (a)
|
|
873
882
|
return y(
|
|
874
|
-
|
|
883
|
+
ye,
|
|
875
884
|
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
876
885
|
);
|
|
877
886
|
if (!t)
|
|
878
|
-
return y(
|
|
879
|
-
"text-copy-medium":
|
|
880
|
-
"text-copy-dark":
|
|
881
|
-
"text-copy-dark dark:text-copy-medium":
|
|
882
|
-
"text-copy-medium dark:text-copy-dark":
|
|
887
|
+
return y(ye, "absolute px-2 font-medium", {
|
|
888
|
+
"text-copy-medium": n === "dark",
|
|
889
|
+
"text-copy-dark": n === "light",
|
|
890
|
+
"text-copy-dark dark:text-copy-medium": n === "system",
|
|
891
|
+
"text-copy-medium dark:text-copy-dark": n === "alt-system"
|
|
883
892
|
});
|
|
884
893
|
if (t)
|
|
885
|
-
return y(
|
|
886
|
-
"text-copy-error-light":
|
|
887
|
-
"text-copy-error-dark":
|
|
888
|
-
"text-copy-error-dark dark:text-copy-error-light":
|
|
889
|
-
"dark:text-copy-error-dark text-copy-error-light":
|
|
894
|
+
return y(ye, "absolute px-2 font-medium", {
|
|
895
|
+
"text-copy-error-light": n === "dark",
|
|
896
|
+
"text-copy-error-dark": n === "light",
|
|
897
|
+
"text-copy-error-dark dark:text-copy-error-light": n === "system",
|
|
898
|
+
"dark:text-copy-error-dark text-copy-error-light": n === "alt-system"
|
|
890
899
|
});
|
|
891
|
-
},
|
|
900
|
+
}, hr = ({
|
|
892
901
|
className: t,
|
|
893
902
|
textAreaClassName: o,
|
|
894
|
-
raw:
|
|
895
|
-
focusMode:
|
|
903
|
+
raw: n,
|
|
904
|
+
focusMode: a,
|
|
896
905
|
disabled: r,
|
|
897
906
|
noBorder: c,
|
|
898
907
|
error: s,
|
|
@@ -900,93 +909,93 @@ const sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
900
909
|
leftElement: m,
|
|
901
910
|
rightElement: h
|
|
902
911
|
}) => {
|
|
903
|
-
const
|
|
912
|
+
const f = n ? t : y(
|
|
904
913
|
"relative flex w-full flex-col justify-center",
|
|
905
|
-
|
|
914
|
+
Wt,
|
|
906
915
|
t
|
|
907
|
-
), b =
|
|
908
|
-
|
|
916
|
+
), b = n ? y(o) : y(
|
|
917
|
+
De,
|
|
909
918
|
o,
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
919
|
+
lr(),
|
|
920
|
+
cr({ mode: d }),
|
|
921
|
+
ir({ focusMode: a }),
|
|
922
|
+
dr({
|
|
914
923
|
noBorder: c,
|
|
915
924
|
error: s
|
|
916
925
|
}),
|
|
917
926
|
{
|
|
918
927
|
"disabled:cursor-not-allowed disabled:opacity-50": r
|
|
919
928
|
}
|
|
920
|
-
), C =
|
|
929
|
+
), C = n ? void 0 : "sr-only", l = ur({
|
|
921
930
|
disabled: r,
|
|
922
|
-
raw:
|
|
931
|
+
raw: n,
|
|
923
932
|
error: s,
|
|
924
933
|
mode: d,
|
|
925
934
|
rightElement: h,
|
|
926
935
|
leftElement: m
|
|
927
|
-
}),
|
|
936
|
+
}), p = mr({
|
|
928
937
|
error: s,
|
|
929
|
-
raw:
|
|
938
|
+
raw: n,
|
|
930
939
|
mode: d,
|
|
931
940
|
disabled: r
|
|
932
|
-
}),
|
|
941
|
+
}), T = n ? void 0 : y(Xt, "absolute"), E = n ? void 0 : y(qt, "absolute");
|
|
933
942
|
return {
|
|
934
|
-
wrapper:
|
|
943
|
+
wrapper: f,
|
|
935
944
|
textArea: b,
|
|
936
945
|
accessibleLabel: C,
|
|
937
946
|
visibleLabel: l,
|
|
938
|
-
helperText:
|
|
939
|
-
rightElement:
|
|
947
|
+
helperText: p,
|
|
948
|
+
rightElement: T,
|
|
940
949
|
leftElement: E
|
|
941
950
|
};
|
|
942
|
-
},
|
|
951
|
+
}, fr = ({
|
|
943
952
|
scrollHeight: t,
|
|
944
953
|
currentHeight: o,
|
|
945
|
-
currentLabelOffset:
|
|
946
|
-
currentHelperTextOffset:
|
|
954
|
+
currentLabelOffset: n = 0,
|
|
955
|
+
currentHelperTextOffset: a = 0
|
|
947
956
|
}) => {
|
|
948
957
|
let r, c;
|
|
949
958
|
if (t > 0 && t !== o) {
|
|
950
959
|
const s = t - o, d = Math.abs(s / 24);
|
|
951
|
-
r =
|
|
960
|
+
r = n + -1 * Math.sign(s) * (12 * d), c = a + Math.sign(s) * (12 * d);
|
|
952
961
|
}
|
|
953
962
|
return {
|
|
954
963
|
labelOffset: r,
|
|
955
964
|
helperTextOffset: c,
|
|
956
965
|
scrollHeight: t
|
|
957
966
|
};
|
|
958
|
-
}, xe =
|
|
967
|
+
}, xe = It.forwardRef(
|
|
959
968
|
({
|
|
960
969
|
id: t,
|
|
961
970
|
name: o,
|
|
962
|
-
label:
|
|
963
|
-
error:
|
|
971
|
+
label: n,
|
|
972
|
+
error: a = !1,
|
|
964
973
|
raw: r = !1,
|
|
965
974
|
className: c,
|
|
966
975
|
textAreaClassName: s,
|
|
967
976
|
mode: d = "system",
|
|
968
977
|
focusMode: m = "system",
|
|
969
978
|
value: h,
|
|
970
|
-
defaultValue:
|
|
979
|
+
defaultValue: f,
|
|
971
980
|
disabled: b = !1,
|
|
972
981
|
noBorder: C = !1,
|
|
973
982
|
labelId: l,
|
|
974
|
-
helperText:
|
|
975
|
-
helperTextOnFocus:
|
|
983
|
+
helperText: p = "",
|
|
984
|
+
helperTextOnFocus: T = !1,
|
|
976
985
|
rightElement: E,
|
|
977
986
|
leftElement: g,
|
|
978
|
-
onChange:
|
|
979
|
-
onFocus:
|
|
980
|
-
onBlur:
|
|
981
|
-
...
|
|
982
|
-
},
|
|
983
|
-
var
|
|
984
|
-
const
|
|
985
|
-
!!(!
|
|
986
|
-
),
|
|
987
|
+
onChange: R,
|
|
988
|
+
onFocus: I,
|
|
989
|
+
onBlur: u,
|
|
990
|
+
...w
|
|
991
|
+
}, M) => {
|
|
992
|
+
var D;
|
|
993
|
+
const v = S(null), z = Zt([M, v]), [x, _] = Re(), [Z, G] = Re(), W = S(80), Y = S(-25), L = S(null), J = S(30), ee = S(null), j = tr({ id: t, prefix: `${De}-` }), [Te, Fe] = k(0), [Ee, Ue] = k(0), [Ge, Ne] = k(
|
|
994
|
+
!!(!T && p)
|
|
995
|
+
), Ye = `${o} error, ${p}`, K = hr({
|
|
987
996
|
className: c,
|
|
988
997
|
textAreaClassName: s,
|
|
989
|
-
error:
|
|
998
|
+
error: a,
|
|
990
999
|
raw: r,
|
|
991
1000
|
focusMode: m,
|
|
992
1001
|
disabled: b,
|
|
@@ -994,131 +1003,131 @@ const sr = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hi
|
|
|
994
1003
|
mode: d,
|
|
995
1004
|
rightElement: !!E,
|
|
996
1005
|
leftElement: !!g
|
|
997
|
-
}), [
|
|
1006
|
+
}), [V, je] = er({
|
|
998
1007
|
value: h,
|
|
999
1008
|
initialControlledDelay: 20,
|
|
1000
|
-
defaultValue:
|
|
1009
|
+
defaultValue: f,
|
|
1001
1010
|
onChange: (A) => {
|
|
1002
|
-
|
|
1011
|
+
R && R({
|
|
1003
1012
|
target: {
|
|
1004
1013
|
value: A
|
|
1005
1014
|
}
|
|
1006
1015
|
});
|
|
1007
1016
|
}
|
|
1008
|
-
}),
|
|
1009
|
-
|
|
1010
|
-
}, Ke = (A) => {
|
|
1011
|
-
N && f && Ne(!0), u && u(A);
|
|
1017
|
+
}), Ke = (A) => {
|
|
1018
|
+
je(A.target.value);
|
|
1012
1019
|
}, We = (A) => {
|
|
1013
|
-
|
|
1020
|
+
T && p && Ne(!0), I && I(A);
|
|
1021
|
+
}, Xe = (A) => {
|
|
1022
|
+
T && p && !V && Ne(!1), u && u(A);
|
|
1014
1023
|
};
|
|
1015
1024
|
return ne(() => {
|
|
1016
|
-
_ && _.width &&
|
|
1025
|
+
_ && _.width && Fe(_.width + 18 + 10);
|
|
1017
1026
|
}, [_]), ne(() => {
|
|
1018
|
-
G && G.width &&
|
|
1027
|
+
G && G.width && Ue(G.width + 18 + 10);
|
|
1019
1028
|
}, [G]), ne(() => {
|
|
1020
|
-
r ||
|
|
1021
|
-
}, [
|
|
1029
|
+
r || v && v.current && V !== void 0 && (v.current.style.height = "inherit", v.current.style.height = v.current.scrollHeight + "px");
|
|
1030
|
+
}, [V, r]), ne(() => {
|
|
1022
1031
|
r || setTimeout(() => {
|
|
1023
1032
|
var A;
|
|
1024
|
-
(A =
|
|
1033
|
+
(A = L == null ? void 0 : L.current) == null || A.style.setProperty(
|
|
1025
1034
|
"--av-text-area-wrapper-transition",
|
|
1026
|
-
|
|
1035
|
+
V ? "none" : "all 0.2s ease-out"
|
|
1027
1036
|
);
|
|
1028
1037
|
}, 0);
|
|
1029
|
-
}, [
|
|
1030
|
-
var A,
|
|
1031
|
-
if (!r &&
|
|
1032
|
-
const { labelOffset:
|
|
1033
|
-
scrollHeight:
|
|
1034
|
-
currentHeight:
|
|
1035
|
-
currentLabelOffset:
|
|
1036
|
-
currentHelperTextOffset:
|
|
1038
|
+
}, [V, r]), ne(() => {
|
|
1039
|
+
var A, we;
|
|
1040
|
+
if (!r && v && v.current && V !== void 0) {
|
|
1041
|
+
const { labelOffset: fe, helperTextOffset: pe, scrollHeight: qe } = fr({
|
|
1042
|
+
scrollHeight: v.current.scrollHeight,
|
|
1043
|
+
currentHeight: W.current,
|
|
1044
|
+
currentLabelOffset: Y.current,
|
|
1045
|
+
currentHelperTextOffset: J.current
|
|
1037
1046
|
});
|
|
1038
|
-
|
|
1047
|
+
fe && (Y.current = fe, (A = L == null ? void 0 : L.current) == null || A.style.setProperty(
|
|
1039
1048
|
"--av-text-area-label",
|
|
1040
|
-
`${he}px`
|
|
1041
|
-
)), fe && (Z.current = fe, (Se = J == null ? void 0 : J.current) == null || Se.style.setProperty(
|
|
1042
|
-
"--av-text-area-helper-text",
|
|
1043
1049
|
`${fe}px`
|
|
1044
|
-
)),
|
|
1050
|
+
)), pe && (J.current = pe, (we = ee == null ? void 0 : ee.current) == null || we.style.setProperty(
|
|
1051
|
+
"--av-text-area-helper-text",
|
|
1052
|
+
`${pe}px`
|
|
1053
|
+
)), W.current = qe || W.current;
|
|
1045
1054
|
}
|
|
1046
|
-
}, [
|
|
1055
|
+
}, [V, r]), G.width > 0 && ((D = L == null ? void 0 : L.current) == null || D.style.setProperty(
|
|
1047
1056
|
"--tw-translate-x",
|
|
1048
1057
|
`${12 + G.width + 5}px`
|
|
1049
|
-
)), /* @__PURE__ */ i("div", { className:
|
|
1058
|
+
)), /* @__PURE__ */ i("div", { className: K.wrapper, children: [
|
|
1050
1059
|
/* @__PURE__ */ e(
|
|
1051
1060
|
"label",
|
|
1052
1061
|
{
|
|
1053
|
-
htmlFor:
|
|
1062
|
+
htmlFor: j,
|
|
1054
1063
|
id: l,
|
|
1055
|
-
className:
|
|
1056
|
-
children:
|
|
1064
|
+
className: K.accessibleLabel,
|
|
1065
|
+
children: n
|
|
1057
1066
|
}
|
|
1058
1067
|
),
|
|
1059
1068
|
g && /* @__PURE__ */ e(
|
|
1060
1069
|
"div",
|
|
1061
1070
|
{
|
|
1062
|
-
ref:
|
|
1063
|
-
className:
|
|
1071
|
+
ref: Z,
|
|
1072
|
+
className: K.leftElement,
|
|
1064
1073
|
children: g
|
|
1065
1074
|
}
|
|
1066
1075
|
),
|
|
1067
1076
|
/* @__PURE__ */ e(
|
|
1068
1077
|
"textarea",
|
|
1069
1078
|
{
|
|
1070
|
-
ref:
|
|
1071
|
-
id:
|
|
1079
|
+
ref: z,
|
|
1080
|
+
id: j,
|
|
1072
1081
|
name: o,
|
|
1073
1082
|
disabled: b,
|
|
1074
1083
|
placeholder: r ? void 0 : " ",
|
|
1075
|
-
className:
|
|
1084
|
+
className: K.textArea,
|
|
1076
1085
|
rows: 1,
|
|
1077
|
-
...
|
|
1078
|
-
...
|
|
1079
|
-
...E && !g && !r && { style: { paddingRight:
|
|
1080
|
-
...g && !E && !r && { style: { paddingLeft:
|
|
1086
|
+
...p && { "aria-describedby": `${j}-helper` },
|
|
1087
|
+
...a && { "aria-invalid": "true" },
|
|
1088
|
+
...E && !g && !r && { style: { paddingRight: Te } },
|
|
1089
|
+
...g && !E && !r && { style: { paddingLeft: Ee } },
|
|
1081
1090
|
...E && g && !r && {
|
|
1082
1091
|
style: {
|
|
1083
|
-
paddingRight:
|
|
1084
|
-
paddingLeft:
|
|
1092
|
+
paddingRight: Te,
|
|
1093
|
+
paddingLeft: Ee
|
|
1085
1094
|
}
|
|
1086
1095
|
},
|
|
1087
|
-
value:
|
|
1088
|
-
onChange:
|
|
1089
|
-
onFocus:
|
|
1090
|
-
onBlur:
|
|
1091
|
-
...
|
|
1096
|
+
value: V,
|
|
1097
|
+
onChange: Ke,
|
|
1098
|
+
onFocus: We,
|
|
1099
|
+
onBlur: Xe,
|
|
1100
|
+
...w
|
|
1092
1101
|
}
|
|
1093
1102
|
),
|
|
1094
1103
|
!r && /* @__PURE__ */ e(
|
|
1095
1104
|
"label",
|
|
1096
1105
|
{
|
|
1097
|
-
ref:
|
|
1106
|
+
ref: L,
|
|
1098
1107
|
"aria-hidden": !0,
|
|
1099
|
-
htmlFor:
|
|
1100
|
-
className: `${
|
|
1101
|
-
children:
|
|
1108
|
+
htmlFor: j,
|
|
1109
|
+
className: `${K.visibleLabel}`,
|
|
1110
|
+
children: n
|
|
1102
1111
|
}
|
|
1103
1112
|
),
|
|
1104
1113
|
Ge && /* @__PURE__ */ e(
|
|
1105
1114
|
"div",
|
|
1106
1115
|
{
|
|
1107
|
-
ref:
|
|
1108
|
-
id: `${
|
|
1109
|
-
className:
|
|
1110
|
-
children:
|
|
1116
|
+
ref: ee,
|
|
1117
|
+
id: `${j}-helper`,
|
|
1118
|
+
className: K.helperText,
|
|
1119
|
+
children: p
|
|
1111
1120
|
}
|
|
1112
1121
|
),
|
|
1113
1122
|
E && /* @__PURE__ */ e(
|
|
1114
1123
|
"div",
|
|
1115
1124
|
{
|
|
1116
1125
|
ref: x,
|
|
1117
|
-
className:
|
|
1126
|
+
className: K.rightElement,
|
|
1118
1127
|
children: E
|
|
1119
1128
|
}
|
|
1120
1129
|
),
|
|
1121
|
-
|
|
1130
|
+
a && p && /* @__PURE__ */ e(sr, { politeness: "polite", clearAnnouncementDelay: 500, children: Ye })
|
|
1122
1131
|
] });
|
|
1123
1132
|
}
|
|
1124
1133
|
);
|
|
@@ -1136,7 +1145,7 @@ try {
|
|
|
1136
1145
|
});
|
|
1137
1146
|
} catch {
|
|
1138
1147
|
}
|
|
1139
|
-
const
|
|
1148
|
+
const pr = "av-toggle", gr = () => y("peer", "h-6", "w-11", "rounded-full"), yr = ({
|
|
1140
1149
|
focusMode: t
|
|
1141
1150
|
}) => y(
|
|
1142
1151
|
"peer-focus:outline",
|
|
@@ -1148,14 +1157,14 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1148
1157
|
"peer-focus:outline-focus-light dark:peer-focus:outline-focus-dark": t === "alt-system",
|
|
1149
1158
|
"peer-focus:outline-focus-dark dark:peer-focus:outline-focus-light": t === "system"
|
|
1150
1159
|
}
|
|
1151
|
-
),
|
|
1160
|
+
), br = () => y(
|
|
1152
1161
|
"peer-checked:after:translate-x-full",
|
|
1153
1162
|
// background color when checked
|
|
1154
1163
|
"peer-checked:bg-violet-500",
|
|
1155
1164
|
// knob circle and border color when checked
|
|
1156
1165
|
"peer-checked:after:bg-white",
|
|
1157
1166
|
"peer-checked:after:border-white"
|
|
1158
|
-
),
|
|
1167
|
+
), xr = () => y(
|
|
1159
1168
|
"after:left-[2px]",
|
|
1160
1169
|
"after:top-[2px]",
|
|
1161
1170
|
"after:border",
|
|
@@ -1167,7 +1176,7 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1167
1176
|
"after:rounded-full",
|
|
1168
1177
|
"after:transition-all",
|
|
1169
1178
|
"after:content-['']"
|
|
1170
|
-
),
|
|
1179
|
+
), kr = ({
|
|
1171
1180
|
mode: t,
|
|
1172
1181
|
noBorder: o
|
|
1173
1182
|
}) => y({
|
|
@@ -1176,7 +1185,7 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1176
1185
|
"border-border-light bg-surface-darker": t === "dark",
|
|
1177
1186
|
"border-border-light bg-surface-darker dark:border-border-dark dark:bg-surface-medium": t === "alt-system",
|
|
1178
1187
|
"border-border-dark bg-surface-medium dark:border-border-light dark:bg-surface-darker": t === "system"
|
|
1179
|
-
}),
|
|
1188
|
+
}), Cr = ({
|
|
1180
1189
|
mode: t,
|
|
1181
1190
|
labelHidden: o
|
|
1182
1191
|
}) => o ? "sr-only" : y("ml-2 text-sm", {
|
|
@@ -1184,32 +1193,32 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1184
1193
|
"text-copy-lighter": t === "dark",
|
|
1185
1194
|
"text-copy-lighter dark:text-copy-dark": t === "alt-system",
|
|
1186
1195
|
"text-copy-dark dark:text-copy-lighter": t === "system"
|
|
1187
|
-
}),
|
|
1188
|
-
|
|
1196
|
+
}), Tr = ({ className: t }) => y(
|
|
1197
|
+
pr,
|
|
1189
1198
|
"relative flex cursor-pointer items-center",
|
|
1190
1199
|
t
|
|
1191
1200
|
), Er = ({
|
|
1192
1201
|
mode: t,
|
|
1193
1202
|
focusMode: o,
|
|
1194
|
-
labelHidden:
|
|
1195
|
-
className:
|
|
1203
|
+
labelHidden: n,
|
|
1204
|
+
className: a,
|
|
1196
1205
|
noBorder: r
|
|
1197
1206
|
}) => ({
|
|
1198
1207
|
toggle: y(
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1208
|
+
gr(),
|
|
1209
|
+
kr({ mode: t, noBorder: r }),
|
|
1210
|
+
yr({ focusMode: o }),
|
|
1211
|
+
xr(),
|
|
1212
|
+
br()
|
|
1204
1213
|
),
|
|
1205
|
-
label:
|
|
1214
|
+
label: Cr({ mode: t, labelHidden: n }),
|
|
1206
1215
|
input: "peer sr-only",
|
|
1207
|
-
wrapper:
|
|
1208
|
-
}),
|
|
1216
|
+
wrapper: Tr({ className: a })
|
|
1217
|
+
}), oe = ({
|
|
1209
1218
|
checked: t = !1,
|
|
1210
1219
|
onChange: o,
|
|
1211
|
-
label:
|
|
1212
|
-
labelHidden:
|
|
1220
|
+
label: n,
|
|
1221
|
+
labelHidden: a = !1,
|
|
1213
1222
|
name: r,
|
|
1214
1223
|
mode: c = "system",
|
|
1215
1224
|
focusMode: s = "system",
|
|
@@ -1219,10 +1228,10 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1219
1228
|
const h = Er({
|
|
1220
1229
|
mode: c,
|
|
1221
1230
|
focusMode: s,
|
|
1222
|
-
labelHidden:
|
|
1231
|
+
labelHidden: a,
|
|
1223
1232
|
className: d,
|
|
1224
1233
|
noBorder: m
|
|
1225
|
-
}),
|
|
1234
|
+
}), f = (b) => {
|
|
1226
1235
|
o == null || o(b.target.checked);
|
|
1227
1236
|
};
|
|
1228
1237
|
return /* @__PURE__ */ i("label", { className: h.wrapper, children: [
|
|
@@ -1233,58 +1242,58 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1233
1242
|
checked: t,
|
|
1234
1243
|
type: "checkbox",
|
|
1235
1244
|
className: h.input,
|
|
1236
|
-
onChange:
|
|
1245
|
+
onChange: f
|
|
1237
1246
|
}
|
|
1238
1247
|
),
|
|
1239
1248
|
/* @__PURE__ */ e("div", { className: h.toggle }),
|
|
1240
|
-
/* @__PURE__ */ e("span", { className: h.label, children:
|
|
1249
|
+
/* @__PURE__ */ e("span", { className: h.label, children: n })
|
|
1241
1250
|
] });
|
|
1242
|
-
},
|
|
1251
|
+
}, Nr = ({
|
|
1243
1252
|
open: t,
|
|
1244
1253
|
onOpenChange: o
|
|
1245
1254
|
}) => {
|
|
1246
|
-
const { getAccessToken:
|
|
1255
|
+
const { getAccessToken: n, user: a } = F(), {
|
|
1247
1256
|
data: r,
|
|
1248
1257
|
error: c,
|
|
1249
1258
|
isLoading: s,
|
|
1250
1259
|
mutate: d
|
|
1251
|
-
} =
|
|
1252
|
-
keys: [
|
|
1253
|
-
getAccessToken:
|
|
1260
|
+
} = ze({
|
|
1261
|
+
keys: [a == null ? void 0 : a.username],
|
|
1262
|
+
getAccessToken: n,
|
|
1254
1263
|
isPaused: !0
|
|
1255
1264
|
}), [m, h] = k({
|
|
1256
1265
|
prompts: []
|
|
1257
|
-
}),
|
|
1266
|
+
}), f = ({
|
|
1258
1267
|
slot: l,
|
|
1259
|
-
checked:
|
|
1260
|
-
label:
|
|
1268
|
+
checked: p,
|
|
1269
|
+
label: T,
|
|
1261
1270
|
content: E,
|
|
1262
1271
|
privateChat: g = !1
|
|
1263
1272
|
}) => {
|
|
1264
|
-
h((
|
|
1265
|
-
const
|
|
1273
|
+
h((R) => {
|
|
1274
|
+
const I = R.prompts, u = {
|
|
1266
1275
|
slot: l,
|
|
1267
|
-
label:
|
|
1276
|
+
label: T,
|
|
1268
1277
|
content: E,
|
|
1269
|
-
enabled:
|
|
1278
|
+
enabled: p,
|
|
1270
1279
|
privateChat: g
|
|
1271
|
-
},
|
|
1272
|
-
return
|
|
1273
|
-
...
|
|
1274
|
-
prompts: [...
|
|
1275
|
-
} : (
|
|
1276
|
-
...
|
|
1277
|
-
prompts: [...
|
|
1280
|
+
}, w = I.findIndex((M) => M.slot === l);
|
|
1281
|
+
return w === -1 ? {
|
|
1282
|
+
...R,
|
|
1283
|
+
prompts: [...I, { ...u, slot: l }]
|
|
1284
|
+
} : (I[w] = u, {
|
|
1285
|
+
...R,
|
|
1286
|
+
prompts: [...I]
|
|
1278
1287
|
});
|
|
1279
1288
|
});
|
|
1280
1289
|
}, b = async (l) => {
|
|
1281
1290
|
l.preventDefault();
|
|
1282
1291
|
try {
|
|
1283
|
-
await
|
|
1284
|
-
accessToken: await
|
|
1285
|
-
type:
|
|
1292
|
+
await le({
|
|
1293
|
+
accessToken: await n(),
|
|
1294
|
+
type: ce.SET_USER_PREFERENCES,
|
|
1286
1295
|
params: {
|
|
1287
|
-
user:
|
|
1296
|
+
user: a == null ? void 0 : a.username,
|
|
1288
1297
|
tags: m.prompts
|
|
1289
1298
|
}
|
|
1290
1299
|
});
|
|
@@ -1293,23 +1302,23 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1293
1302
|
}, C = () => {
|
|
1294
1303
|
d({ ...r }), o(!1);
|
|
1295
1304
|
};
|
|
1296
|
-
return
|
|
1305
|
+
return U(() => {
|
|
1297
1306
|
r != null && r.tags && h({ prompts: r.tags });
|
|
1298
1307
|
}, [r]), c || s ? null : /* @__PURE__ */ i(
|
|
1299
|
-
|
|
1308
|
+
ie,
|
|
1300
1309
|
{
|
|
1301
1310
|
open: t,
|
|
1302
1311
|
onOpenChange: C,
|
|
1303
1312
|
title: "Prompts",
|
|
1304
1313
|
footer: /* @__PURE__ */ i(
|
|
1305
|
-
|
|
1314
|
+
Q,
|
|
1306
1315
|
{
|
|
1307
1316
|
columnGap: 2,
|
|
1308
1317
|
alignHorizontal: "flex-end",
|
|
1309
1318
|
className: "pb-8 sm:pb-0",
|
|
1310
1319
|
children: [
|
|
1311
|
-
/* @__PURE__ */ e(
|
|
1312
|
-
|
|
1320
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
1321
|
+
q,
|
|
1313
1322
|
{
|
|
1314
1323
|
mode: "dark",
|
|
1315
1324
|
variant: "secondary",
|
|
@@ -1318,8 +1327,8 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1318
1327
|
children: "Cancel"
|
|
1319
1328
|
}
|
|
1320
1329
|
) }),
|
|
1321
|
-
/* @__PURE__ */ e(
|
|
1322
|
-
|
|
1330
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
1331
|
+
q,
|
|
1323
1332
|
{
|
|
1324
1333
|
mode: "dark",
|
|
1325
1334
|
variant: "danger",
|
|
@@ -1334,58 +1343,58 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1334
1343
|
}
|
|
1335
1344
|
),
|
|
1336
1345
|
children: [
|
|
1337
|
-
/* @__PURE__ */ e("p", { children:
|
|
1346
|
+
/* @__PURE__ */ e("p", { children: lt }),
|
|
1338
1347
|
m.prompts && m.prompts.map((l) => /* @__PURE__ */ i(
|
|
1339
|
-
|
|
1348
|
+
H,
|
|
1340
1349
|
{
|
|
1341
1350
|
header: `Prompt ${l.slot + 1}`,
|
|
1342
1351
|
className: "prose-dark dark:prose-lighter mb-2",
|
|
1343
1352
|
children: [
|
|
1344
|
-
/* @__PURE__ */ i(
|
|
1345
|
-
/* @__PURE__ */ e(
|
|
1346
|
-
|
|
1353
|
+
/* @__PURE__ */ i(Q, { className: "mt-8 mb-6", columnGap: 2, rowGap: 6, children: [
|
|
1354
|
+
/* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(
|
|
1355
|
+
be,
|
|
1347
1356
|
{
|
|
1348
1357
|
label: "Label",
|
|
1349
1358
|
name: `prompt${l.slot}-label`,
|
|
1350
1359
|
value: l.label,
|
|
1351
|
-
onChange: (
|
|
1352
|
-
|
|
1360
|
+
onChange: (p) => {
|
|
1361
|
+
f({
|
|
1353
1362
|
slot: l.slot,
|
|
1354
1363
|
checked: l.enabled,
|
|
1355
|
-
label:
|
|
1364
|
+
label: p.target.value,
|
|
1356
1365
|
content: l.content
|
|
1357
1366
|
});
|
|
1358
1367
|
}
|
|
1359
1368
|
}
|
|
1360
1369
|
) }),
|
|
1361
|
-
/* @__PURE__ */ e(
|
|
1362
|
-
|
|
1370
|
+
/* @__PURE__ */ e(O, { span: 12, children: /* @__PURE__ */ e(
|
|
1371
|
+
be,
|
|
1363
1372
|
{
|
|
1364
1373
|
label: "Content",
|
|
1365
1374
|
name: `prompt${l.slot}-content`,
|
|
1366
1375
|
value: l.content,
|
|
1367
|
-
onChange: (
|
|
1368
|
-
|
|
1376
|
+
onChange: (p) => {
|
|
1377
|
+
f({
|
|
1369
1378
|
slot: l.slot,
|
|
1370
1379
|
checked: l.enabled,
|
|
1371
1380
|
label: l.label,
|
|
1372
|
-
content:
|
|
1381
|
+
content: p.target.value
|
|
1373
1382
|
});
|
|
1374
1383
|
}
|
|
1375
1384
|
}
|
|
1376
1385
|
) })
|
|
1377
1386
|
] }),
|
|
1378
1387
|
/* @__PURE__ */ e(
|
|
1379
|
-
|
|
1388
|
+
oe,
|
|
1380
1389
|
{
|
|
1381
1390
|
className: "mt-2",
|
|
1382
1391
|
noBorder: !0,
|
|
1383
1392
|
label: "Enabled",
|
|
1384
1393
|
name: l.slot.toString(),
|
|
1385
|
-
onChange: (
|
|
1386
|
-
|
|
1394
|
+
onChange: (p) => {
|
|
1395
|
+
f({
|
|
1387
1396
|
slot: l.slot,
|
|
1388
|
-
checked:
|
|
1397
|
+
checked: p,
|
|
1389
1398
|
label: l.label,
|
|
1390
1399
|
content: l.content
|
|
1391
1400
|
});
|
|
@@ -1394,19 +1403,19 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1394
1403
|
}
|
|
1395
1404
|
),
|
|
1396
1405
|
/* @__PURE__ */ e(
|
|
1397
|
-
|
|
1406
|
+
oe,
|
|
1398
1407
|
{
|
|
1399
1408
|
className: "mt-2",
|
|
1400
1409
|
noBorder: !0,
|
|
1401
1410
|
label: "Temporary Chat",
|
|
1402
1411
|
name: `private-${l.slot.toString()}`,
|
|
1403
|
-
onChange: (
|
|
1404
|
-
|
|
1412
|
+
onChange: (p) => {
|
|
1413
|
+
f({
|
|
1405
1414
|
slot: l.slot,
|
|
1406
1415
|
checked: l.enabled,
|
|
1407
1416
|
label: l.label,
|
|
1408
1417
|
content: l.content,
|
|
1409
|
-
privateChat:
|
|
1418
|
+
privateChat: p
|
|
1410
1419
|
});
|
|
1411
1420
|
},
|
|
1412
1421
|
checked: l.privateChat
|
|
@@ -1419,106 +1428,106 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1419
1428
|
]
|
|
1420
1429
|
}
|
|
1421
1430
|
);
|
|
1422
|
-
},
|
|
1431
|
+
}, wr = ({
|
|
1423
1432
|
open: t,
|
|
1424
1433
|
onOpenChange: o
|
|
1425
1434
|
}) => {
|
|
1426
|
-
const { getAccessToken:
|
|
1435
|
+
const { getAccessToken: n, user: a } = F(), {
|
|
1427
1436
|
data: r,
|
|
1428
1437
|
error: c,
|
|
1429
1438
|
isLoading: s,
|
|
1430
1439
|
mutate: d
|
|
1431
|
-
} =
|
|
1432
|
-
keys: [
|
|
1433
|
-
getAccessToken:
|
|
1434
|
-
}), [m, h] = k(!1), [
|
|
1440
|
+
} = ze({
|
|
1441
|
+
keys: [a == null ? void 0 : a.username],
|
|
1442
|
+
getAccessToken: n
|
|
1443
|
+
}), [m, h] = k(!1), [f, b] = k({
|
|
1435
1444
|
loadingLocation: !1
|
|
1436
|
-
}), [C, l] = k(""), [
|
|
1437
|
-
key: ke +
|
|
1445
|
+
}), [C, l] = k(""), [p, T] = k(""), [E, g] = k(ct), [R, I] = Ce({
|
|
1446
|
+
key: ke + it,
|
|
1438
1447
|
initialValue: !1
|
|
1439
|
-
}),
|
|
1440
|
-
|
|
1441
|
-
},
|
|
1448
|
+
}), u = (x) => {
|
|
1449
|
+
I(x);
|
|
1450
|
+
}, w = async (x) => {
|
|
1442
1451
|
x.preventDefault();
|
|
1443
1452
|
try {
|
|
1444
|
-
await
|
|
1445
|
-
accessToken: await
|
|
1446
|
-
type:
|
|
1453
|
+
await le({
|
|
1454
|
+
accessToken: await n(),
|
|
1455
|
+
type: ce.SET_USER_PREFERENCES,
|
|
1447
1456
|
params: {
|
|
1448
|
-
user:
|
|
1457
|
+
user: a == null ? void 0 : a.username,
|
|
1449
1458
|
instructions: C,
|
|
1450
|
-
location:
|
|
1451
|
-
|
|
1459
|
+
location: p,
|
|
1460
|
+
provider: E
|
|
1452
1461
|
}
|
|
1453
1462
|
}), d(), b({
|
|
1454
1463
|
loadingLocation: !1
|
|
1455
1464
|
});
|
|
1456
1465
|
} catch {
|
|
1457
1466
|
}
|
|
1458
|
-
},
|
|
1467
|
+
}, M = async () => {
|
|
1459
1468
|
b({
|
|
1460
1469
|
loadingLocation: !0
|
|
1461
|
-
}),
|
|
1470
|
+
}), T("...");
|
|
1462
1471
|
try {
|
|
1463
|
-
const x = Date.now(), _ = await
|
|
1464
|
-
accessToken: await
|
|
1465
|
-
type:
|
|
1472
|
+
const x = Date.now(), _ = await mt(), Z = await le({
|
|
1473
|
+
accessToken: await n(),
|
|
1474
|
+
type: ce.GET_LOCATION,
|
|
1466
1475
|
params: {
|
|
1467
1476
|
latitude: _.latitude,
|
|
1468
1477
|
longitude: _.longitude
|
|
1469
1478
|
}
|
|
1470
|
-
}),
|
|
1471
|
-
if (
|
|
1472
|
-
const { city:
|
|
1479
|
+
}), W = Date.now() - x;
|
|
1480
|
+
if (W < 2e3 && await new Promise((Y) => setTimeout(Y, 2e3 - W)), Z.status === 200) {
|
|
1481
|
+
const { city: Y, state: L, country: J, displayName: ee } = Z.data, j = Y && L && J ? `${Y}, ${L}, ${J}` : ee;
|
|
1473
1482
|
b({
|
|
1474
1483
|
loadingLocation: !1
|
|
1475
|
-
}),
|
|
1484
|
+
}), T(j);
|
|
1476
1485
|
} else
|
|
1477
1486
|
b({
|
|
1478
1487
|
loadingLocation: !1
|
|
1479
1488
|
});
|
|
1480
1489
|
} catch {
|
|
1481
1490
|
}
|
|
1482
|
-
},
|
|
1483
|
-
g(x ? _ : _ ===
|
|
1484
|
-
},
|
|
1491
|
+
}, D = (x, _) => {
|
|
1492
|
+
g(x ? _ : _ === X ? te : X);
|
|
1493
|
+
}, v = () => {
|
|
1485
1494
|
h(!m);
|
|
1486
|
-
},
|
|
1495
|
+
}, z = () => {
|
|
1487
1496
|
d({ ...r }), o(!1);
|
|
1488
1497
|
};
|
|
1489
|
-
return
|
|
1490
|
-
r != null && r.instructions && l(r.instructions), r != null && r.location &&
|
|
1498
|
+
return U(() => {
|
|
1499
|
+
r != null && r.instructions && l(r.instructions), r != null && r.location && T(r.location), r != null && r.provider && g(r.provider);
|
|
1491
1500
|
}, [r]), c || s ? null : /* @__PURE__ */ e(
|
|
1492
|
-
|
|
1501
|
+
ie,
|
|
1493
1502
|
{
|
|
1494
1503
|
open: t,
|
|
1495
|
-
onOpenChange:
|
|
1496
|
-
title:
|
|
1504
|
+
onOpenChange: z,
|
|
1505
|
+
title: dt,
|
|
1497
1506
|
footer: /* @__PURE__ */ i(
|
|
1498
|
-
|
|
1507
|
+
Q,
|
|
1499
1508
|
{
|
|
1500
1509
|
columnGap: 2,
|
|
1501
1510
|
alignHorizontal: "flex-end",
|
|
1502
1511
|
className: "pb-8 sm:pb-0",
|
|
1503
1512
|
children: [
|
|
1504
|
-
/* @__PURE__ */ e(
|
|
1505
|
-
|
|
1513
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
1514
|
+
q,
|
|
1506
1515
|
{
|
|
1507
1516
|
mode: "dark",
|
|
1508
1517
|
variant: "secondary",
|
|
1509
1518
|
focusMode: "light",
|
|
1510
|
-
onClick:
|
|
1519
|
+
onClick: z,
|
|
1511
1520
|
children: "Cancel"
|
|
1512
1521
|
}
|
|
1513
1522
|
) }),
|
|
1514
|
-
/* @__PURE__ */ e(
|
|
1515
|
-
|
|
1523
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
1524
|
+
q,
|
|
1516
1525
|
{
|
|
1517
1526
|
mode: "dark",
|
|
1518
1527
|
variant: "danger",
|
|
1519
1528
|
focusMode: "light",
|
|
1520
1529
|
onClick: async (x) => {
|
|
1521
|
-
o(!1), await
|
|
1530
|
+
o(!1), await w(x);
|
|
1522
1531
|
},
|
|
1523
1532
|
children: "Save"
|
|
1524
1533
|
}
|
|
@@ -1526,71 +1535,71 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1526
1535
|
]
|
|
1527
1536
|
}
|
|
1528
1537
|
),
|
|
1529
|
-
children: /* @__PURE__ */ i(
|
|
1530
|
-
m && /* @__PURE__ */ e(
|
|
1538
|
+
children: /* @__PURE__ */ i(B, { children: [
|
|
1539
|
+
m && /* @__PURE__ */ e(Nr, { open: m, onOpenChange: h }),
|
|
1531
1540
|
/* @__PURE__ */ i(
|
|
1532
|
-
|
|
1541
|
+
H,
|
|
1533
1542
|
{
|
|
1534
|
-
header:
|
|
1543
|
+
header: N.SETTINGS_PROVIDER.TITLE,
|
|
1535
1544
|
className: "prose-dark dark:prose-lighter",
|
|
1536
1545
|
children: [
|
|
1537
|
-
/* @__PURE__ */ e("p", { className: "text-sm", children: "Select the AI
|
|
1546
|
+
/* @__PURE__ */ e("p", { className: "text-sm", children: "Select the AI provider that will be used to generate responses." }),
|
|
1538
1547
|
/* @__PURE__ */ e(
|
|
1539
|
-
|
|
1548
|
+
oe,
|
|
1540
1549
|
{
|
|
1541
1550
|
noBorder: !0,
|
|
1542
|
-
label:
|
|
1543
|
-
name:
|
|
1544
|
-
onChange: (x) =>
|
|
1545
|
-
checked: E ===
|
|
1551
|
+
label: X,
|
|
1552
|
+
name: X,
|
|
1553
|
+
onChange: (x) => D(x, X),
|
|
1554
|
+
checked: E === X
|
|
1546
1555
|
}
|
|
1547
1556
|
),
|
|
1548
1557
|
/* @__PURE__ */ e(
|
|
1549
|
-
|
|
1558
|
+
oe,
|
|
1550
1559
|
{
|
|
1551
1560
|
className: "mt-2",
|
|
1552
1561
|
noBorder: !0,
|
|
1553
|
-
label:
|
|
1554
|
-
name:
|
|
1555
|
-
onChange: (x) =>
|
|
1556
|
-
checked: E ===
|
|
1562
|
+
label: te,
|
|
1563
|
+
name: te,
|
|
1564
|
+
onChange: (x) => D(x, te),
|
|
1565
|
+
checked: E === te
|
|
1557
1566
|
}
|
|
1558
1567
|
),
|
|
1559
1568
|
/* @__PURE__ */ e("p", { className: "text-sm", children: 'This "Show Message Statistics" option adds individual statistics for each messages under their respective bubbles, such as processing time, model name, and more.' }),
|
|
1560
1569
|
/* @__PURE__ */ e(
|
|
1561
|
-
|
|
1570
|
+
oe,
|
|
1562
1571
|
{
|
|
1563
1572
|
className: "mt-2",
|
|
1564
1573
|
noBorder: !0,
|
|
1565
1574
|
label: "Show Message Statistics",
|
|
1566
1575
|
name: "show-message-statistics",
|
|
1567
|
-
onChange:
|
|
1568
|
-
checked:
|
|
1576
|
+
onChange: u,
|
|
1577
|
+
checked: R
|
|
1569
1578
|
}
|
|
1570
1579
|
),
|
|
1571
1580
|
/* @__PURE__ */ e("h3", { className: "border-b-2 border-slate-400", children: "Prompts" }),
|
|
1572
1581
|
/* @__PURE__ */ e(
|
|
1573
|
-
|
|
1582
|
+
se,
|
|
1574
1583
|
{
|
|
1575
1584
|
className: "mt-2",
|
|
1576
1585
|
size: "small",
|
|
1577
|
-
onClick:
|
|
1586
|
+
onClick: v,
|
|
1578
1587
|
labelLeft: "Edit Custom Prompts",
|
|
1579
|
-
children: /* @__PURE__ */ e(
|
|
1588
|
+
children: /* @__PURE__ */ e(wt, { size: "size-3", monotone: !0 })
|
|
1580
1589
|
}
|
|
1581
1590
|
)
|
|
1582
1591
|
]
|
|
1583
1592
|
}
|
|
1584
1593
|
),
|
|
1585
1594
|
/* @__PURE__ */ i(
|
|
1586
|
-
|
|
1595
|
+
H,
|
|
1587
1596
|
{
|
|
1588
1597
|
header: "Custom Instructions",
|
|
1589
1598
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
1590
1599
|
children: [
|
|
1591
1600
|
/* @__PURE__ */ i("p", { className: "text-sm", children: [
|
|
1592
1601
|
"What would you like ",
|
|
1593
|
-
/* @__PURE__ */ e("em", { children:
|
|
1602
|
+
/* @__PURE__ */ e("em", { children: ut }),
|
|
1594
1603
|
" to know about you to provide better responses?"
|
|
1595
1604
|
] }),
|
|
1596
1605
|
/* @__PURE__ */ e(
|
|
@@ -1613,7 +1622,7 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1613
1622
|
}
|
|
1614
1623
|
),
|
|
1615
1624
|
/* @__PURE__ */ i(
|
|
1616
|
-
|
|
1625
|
+
H,
|
|
1617
1626
|
{
|
|
1618
1627
|
header: "Location",
|
|
1619
1628
|
className: "prose-dark dark:prose-lighter mt-4",
|
|
@@ -1625,22 +1634,22 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1625
1634
|
mode: "alt-system",
|
|
1626
1635
|
name: "location",
|
|
1627
1636
|
label: "Location",
|
|
1628
|
-
value:
|
|
1637
|
+
value: p,
|
|
1629
1638
|
onChange: (x) => {
|
|
1630
|
-
|
|
1639
|
+
T(x.target.value);
|
|
1631
1640
|
},
|
|
1632
1641
|
helperText: "Enter your location or press auto-detect."
|
|
1633
1642
|
}
|
|
1634
1643
|
),
|
|
1635
1644
|
/* @__PURE__ */ e(
|
|
1636
|
-
|
|
1645
|
+
q,
|
|
1637
1646
|
{
|
|
1638
1647
|
className: "mt-2",
|
|
1639
1648
|
size: "small",
|
|
1640
1649
|
noBorder: !0,
|
|
1641
|
-
disabled:
|
|
1642
|
-
onClick:
|
|
1643
|
-
children:
|
|
1650
|
+
disabled: f.loadingLocation,
|
|
1651
|
+
onClick: M,
|
|
1652
|
+
children: f.loadingLocation ? "Detecting..." : "Auto-detect"
|
|
1644
1653
|
}
|
|
1645
1654
|
)
|
|
1646
1655
|
]
|
|
@@ -1649,13 +1658,13 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1649
1658
|
] })
|
|
1650
1659
|
}
|
|
1651
1660
|
);
|
|
1652
|
-
},
|
|
1653
|
-
const { logout: o } =
|
|
1654
|
-
return /* @__PURE__ */ i(
|
|
1661
|
+
}, Rr = ({ isComponent: t = !1 }) => {
|
|
1662
|
+
const { logout: o } = F(), [n, a] = k(!1), [r, c] = k(!1), [s, d] = k(!1), [m, h] = k(!1), [f, b] = k(!1);
|
|
1663
|
+
return /* @__PURE__ */ i(B, { children: [
|
|
1655
1664
|
/* @__PURE__ */ e(
|
|
1656
|
-
|
|
1665
|
+
Me,
|
|
1657
1666
|
{
|
|
1658
|
-
showConfirmation:
|
|
1667
|
+
showConfirmation: f,
|
|
1659
1668
|
setShowConfirmation: b,
|
|
1660
1669
|
action: o,
|
|
1661
1670
|
customStrings: {
|
|
@@ -1666,74 +1675,74 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1666
1675
|
children: /* @__PURE__ */ e("p", { children: "Are you sure you want to log out?" })
|
|
1667
1676
|
}
|
|
1668
1677
|
),
|
|
1669
|
-
/* @__PURE__ */ e(
|
|
1670
|
-
/* @__PURE__ */ e(
|
|
1671
|
-
s && /* @__PURE__ */ e(
|
|
1672
|
-
/* @__PURE__ */ e(
|
|
1673
|
-
/* @__PURE__ */ e("div", { className: "bg-slate-900 py-4 px-4 rounded-t-md", children: /* @__PURE__ */ e(
|
|
1674
|
-
|
|
1678
|
+
/* @__PURE__ */ e(Kt, { open: n, onOpenChange: a }),
|
|
1679
|
+
/* @__PURE__ */ e(wr, { open: r, onOpenChange: c }),
|
|
1680
|
+
s && /* @__PURE__ */ e(Yt, { open: s, onOpenChange: d }),
|
|
1681
|
+
/* @__PURE__ */ e(Ft, { open: m, onOpenChange: h }),
|
|
1682
|
+
/* @__PURE__ */ e("div", { className: "bg-slate-900 py-4 px-4 rounded-t-md", children: /* @__PURE__ */ e(Q, { alignHorizontal: "flex-end", alignVertical: "center", children: /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(
|
|
1683
|
+
vt,
|
|
1675
1684
|
{
|
|
1676
1685
|
label: "Profile, Settings, etc.",
|
|
1677
1686
|
mode: "light",
|
|
1678
1687
|
placement: "left",
|
|
1679
1688
|
trigger: /* @__PURE__ */ i(
|
|
1680
|
-
|
|
1689
|
+
St,
|
|
1681
1690
|
{
|
|
1682
1691
|
mode: "dark",
|
|
1683
1692
|
focusMode: "light",
|
|
1684
|
-
trigger: /* @__PURE__ */ e(
|
|
1693
|
+
trigger: /* @__PURE__ */ e(se, { label: "Settings", children: /* @__PURE__ */ e(Dt, {}) }),
|
|
1685
1694
|
defaultPlacement: "bottom-end",
|
|
1686
1695
|
children: [
|
|
1687
1696
|
/* @__PURE__ */ e(
|
|
1688
|
-
|
|
1697
|
+
ae,
|
|
1689
1698
|
{
|
|
1690
1699
|
label: "Profile",
|
|
1691
1700
|
onClick: () => {
|
|
1692
|
-
|
|
1701
|
+
a(!n);
|
|
1693
1702
|
},
|
|
1694
|
-
icon: /* @__PURE__ */ e(
|
|
1703
|
+
icon: /* @__PURE__ */ e(Bt, {})
|
|
1695
1704
|
}
|
|
1696
1705
|
),
|
|
1697
1706
|
/* @__PURE__ */ e(
|
|
1698
|
-
|
|
1707
|
+
ae,
|
|
1699
1708
|
{
|
|
1700
1709
|
label: "Settings",
|
|
1701
1710
|
onClick: () => {
|
|
1702
1711
|
c(!r);
|
|
1703
1712
|
},
|
|
1704
|
-
icon: /* @__PURE__ */ e(
|
|
1713
|
+
icon: /* @__PURE__ */ e(Vt, {})
|
|
1705
1714
|
}
|
|
1706
1715
|
),
|
|
1707
1716
|
/* @__PURE__ */ e(
|
|
1708
|
-
|
|
1717
|
+
ae,
|
|
1709
1718
|
{
|
|
1710
1719
|
label: "History",
|
|
1711
1720
|
onClick: () => {
|
|
1712
1721
|
d(!s);
|
|
1713
1722
|
},
|
|
1714
|
-
icon: /* @__PURE__ */ e(
|
|
1723
|
+
icon: /* @__PURE__ */ e(Mt, {})
|
|
1715
1724
|
}
|
|
1716
1725
|
),
|
|
1717
1726
|
/* @__PURE__ */ e(
|
|
1718
|
-
|
|
1727
|
+
ae,
|
|
1719
1728
|
{
|
|
1720
1729
|
label: "About",
|
|
1721
1730
|
onClick: () => {
|
|
1722
1731
|
h(!m);
|
|
1723
1732
|
},
|
|
1724
|
-
icon: /* @__PURE__ */ e(
|
|
1733
|
+
icon: /* @__PURE__ */ e(zt, {})
|
|
1725
1734
|
}
|
|
1726
1735
|
),
|
|
1727
|
-
!t && /* @__PURE__ */ i(
|
|
1728
|
-
/* @__PURE__ */ e(
|
|
1736
|
+
!t && /* @__PURE__ */ i(B, { children: [
|
|
1737
|
+
/* @__PURE__ */ e(At, {}),
|
|
1729
1738
|
/* @__PURE__ */ e(
|
|
1730
|
-
|
|
1739
|
+
ae,
|
|
1731
1740
|
{
|
|
1732
1741
|
label: "Log out",
|
|
1733
1742
|
onClick: () => {
|
|
1734
|
-
b(!
|
|
1743
|
+
b(!f);
|
|
1735
1744
|
},
|
|
1736
|
-
icon: /* @__PURE__ */ e("div", { className: "text-red-700", children: /* @__PURE__ */ e(
|
|
1745
|
+
icon: /* @__PURE__ */ e("div", { className: "text-red-700", children: /* @__PURE__ */ e(Pt, { monotone: !0 }) })
|
|
1737
1746
|
}
|
|
1738
1747
|
)
|
|
1739
1748
|
] })
|
|
@@ -1745,5 +1754,5 @@ const fr = "av-toggle", pr = () => y("peer", "h-6", "w-11", "rounded-full"), gr
|
|
|
1745
1754
|
] });
|
|
1746
1755
|
};
|
|
1747
1756
|
export {
|
|
1748
|
-
|
|
1757
|
+
Rr as default
|
|
1749
1758
|
};
|