@better-auth-ui/heroui 1.6.20 → 1.6.21
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/index.js +295 -295
- package/dist/plugins.js +899 -911
- package/package.json +10 -10
- package/src/components/auth/additional-field.tsx +11 -9
- package/src/components/auth/organization/organization-invitations.tsx +10 -33
- package/src/components/auth/organization/organization-members.tsx +6 -29
- package/src/components/auth/sign-in.tsx +6 -6
- package/src/components/auth/theme/appearance.tsx +6 -6
- package/src/components/auth/username/sign-in-username.tsx +6 -6
package/dist/plugins.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as e, r as t, t as n } from "./user-view--47tVtJ3.js";
|
|
3
3
|
import { authMutationKeys as r, authQueryKeys as i, createAuthPlugin as a, fileToBase64 as o } from "@better-auth-ui/core";
|
|
4
|
-
import { ThemePreviewDark as s, ThemePreviewLight as c, ThemePreviewSystem as l, useAcceptInvitation as u, useActiveOrganization as d, useAddPasskey as f, useAuth as p, useAuthPlugin as m, useAuthenticate as h, useCancelInvitation as g, useCheckSlug as _, useCreateApiKey as v, useCreateOrganization as y, useDeleteApiKey as b, useDeleteOrganization as x, useDeletePasskey as S, useDeleteUser as C, useFetchOptions as
|
|
5
|
-
import { ArrowRightArrowLeft as
|
|
6
|
-
import { AlertDialog as
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { useIsMutating as
|
|
10
|
-
import { apiKeyPlugin as
|
|
11
|
-
import { buttonVariants as
|
|
12
|
-
import { useDebouncer as
|
|
4
|
+
import { ThemePreviewDark as s, ThemePreviewLight as c, ThemePreviewSystem as l, useAcceptInvitation as u, useActiveOrganization as d, useAddPasskey as f, useAuth as p, useAuthPlugin as m, useAuthenticate as h, useCancelInvitation as g, useCheckSlug as _, useCreateApiKey as v, useCreateOrganization as y, useDeleteApiKey as b, useDeleteOrganization as x, useDeletePasskey as S, useDeleteUser as C, useFetchOptions as w, useHasPermission as T, useInviteMember as ee, useIsUsernameAvailable as te, useLeaveOrganization as ne, useListAccounts as re, useListApiKeys as ie, useListDeviceSessions as ae, useListOrganizationInvitations as oe, useListOrganizationMembers as se, useListOrganizations as ce, useListPasskeys as le, useListUserInvitations as ue, useRejectInvitation as de, useRemoveMember as fe, useRevokeMultiSession as pe, useSendVerificationEmail as me, useSession as E, useSetActiveOrganization as he, useSetActiveSession as ge, useSignInEmail as _e, useSignInMagicLink as ve, useSignInPasskey as ye, useSignInUsername as be, useUpdateMemberRole as xe, useUpdateOrganization as Se, useUser as Ce } from "@better-auth-ui/react";
|
|
5
|
+
import { ArrowRightArrowLeft as we, ArrowRightFromSquare as Te, Briefcase as Ee, Check as De, ChevronsExpandVertical as Oe, CirclePlus as ke, Clock as Ae, CloudArrowUpIn as je, Copy as Me, Display as Ne, Ellipsis as Pe, Envelope as Fe, Fingerprint as Ie, Funnel as Le, Gear as Re, Key as ze, Lock as Be, Moon as Ve, Palette as He, PaperPlane as Ue, Pencil as We, Person as Ge, PersonPlus as Ke, Sun as qe, TrashBin as Je, TriangleExclamation as Ye, Xmark as D } from "@gravity-ui/icons";
|
|
6
|
+
import { AlertDialog as O, Avatar as Xe, Button as k, Card as A, Checkbox as Ze, Chip as j, Description as Qe, Dropdown as M, EmptyState as $e, FieldError as N, Form as P, Input as F, InputGroup as I, Label as L, Link as et, ListBox as tt, Radio as R, RadioGroup as nt, SearchField as z, Select as rt, Skeleton as B, Spinner as V, Table as H, Tabs as U, TextField as W, cn as G, toast as K, useIsHydrated as it } from "@heroui/react";
|
|
7
|
+
import { useEffect as at, useMemo as ot, useRef as st, useState as q } from "react";
|
|
8
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
9
|
+
import { useIsMutating as Z, useQueryClient as ct } from "@tanstack/react-query";
|
|
10
|
+
import { apiKeyPlugin as lt, deleteUserPlugin as ut, magicLinkPlugin as dt, multiSessionPlugin as ft, organizationPlugin as pt, passkeyPlugin as mt, themePlugin as ht, usernamePlugin as gt } from "@better-auth-ui/core/plugins";
|
|
11
|
+
import { buttonVariants as _t } from "@heroui/styles";
|
|
12
|
+
import { useDebouncer as vt } from "@tanstack/react-pacer";
|
|
13
13
|
//#region src/components/auth/api-key/organization-api-keys.tsx
|
|
14
|
-
function
|
|
15
|
-
let { authClient: n } = p(), { data: r } =
|
|
16
|
-
return o?.members.some((e) => e.role === "owner" && e.userId === r?.user.id) ? /* @__PURE__ */
|
|
14
|
+
function yt({ className: e, variant: t }) {
|
|
15
|
+
let { authClient: n } = p(), { data: r } = E(n), { data: i, isPending: a } = d(n), { data: o } = se(n);
|
|
16
|
+
return o?.members.some((e) => e.role === "owner" && e.userId === r?.user.id) ? /* @__PURE__ */ Y(Dt, {
|
|
17
17
|
className: e,
|
|
18
18
|
variant: t,
|
|
19
19
|
organizationId: i?.id,
|
|
@@ -22,55 +22,55 @@ function xt({ className: e, variant: t }) {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/lib/auth/api-key-plugin.ts
|
|
25
|
-
var
|
|
26
|
-
let t =
|
|
25
|
+
var bt = a(lt.id, (e = {}) => {
|
|
26
|
+
let t = lt(e);
|
|
27
27
|
return {
|
|
28
28
|
...t,
|
|
29
|
-
securityCards: [
|
|
30
|
-
...t.organization ? { organizationCards: [
|
|
29
|
+
securityCards: [Dt],
|
|
30
|
+
...t.organization ? { organizationCards: [yt] } : {}
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/components/auth/api-key/delete-api-key-dialog.tsx
|
|
35
|
-
function
|
|
36
|
-
let { authClient: i, localization: a } = p(), { localization: o } = m(
|
|
37
|
-
return /* @__PURE__ */
|
|
35
|
+
function xt({ isOpen: e, onOpenChange: t, apiKey: n, organizationId: r }) {
|
|
36
|
+
let { authClient: i, localization: a } = p(), { localization: o } = m(bt), s = `${n.start}${"*".repeat(16)}`, { mutate: c, isPending: l } = b(i, { onSuccess: () => t(!1) });
|
|
37
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
38
38
|
isOpen: e,
|
|
39
39
|
onOpenChange: t,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
41
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
42
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
43
43
|
status: "danger",
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ Y(ze, {})
|
|
45
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: o.deleteApiKey })] }),
|
|
46
|
+
/* @__PURE__ */ X(O.Body, {
|
|
47
47
|
className: "flex flex-col gap-4 overflow-visible",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
49
49
|
className: "text-muted text-sm",
|
|
50
50
|
children: o.deleteApiKeyWarning
|
|
51
|
-
}), /* @__PURE__ */
|
|
51
|
+
}), /* @__PURE__ */ X(W, {
|
|
52
52
|
value: s,
|
|
53
53
|
className: "font-mono text-xs",
|
|
54
54
|
variant: "secondary",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ Y(L, { children: n.name || o.apiKey }), /* @__PURE__ */ Y(F, {
|
|
56
56
|
readOnly: !0,
|
|
57
57
|
className: "font-mono text-xs"
|
|
58
58
|
})]
|
|
59
59
|
})]
|
|
60
60
|
}),
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
62
62
|
slot: "close",
|
|
63
63
|
variant: "tertiary",
|
|
64
64
|
isDisabled: l,
|
|
65
65
|
children: a.settings.cancel
|
|
66
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ X(k, {
|
|
67
67
|
variant: "danger",
|
|
68
68
|
onPress: () => c({
|
|
69
69
|
keyId: n.id,
|
|
70
70
|
...r ? { configId: "organization" } : {}
|
|
71
71
|
}),
|
|
72
72
|
isPending: l,
|
|
73
|
-
children: [l && /* @__PURE__ */
|
|
73
|
+
children: [l && /* @__PURE__ */ Y(V, {
|
|
74
74
|
color: "current",
|
|
75
75
|
size: "sm"
|
|
76
76
|
}), o.deleteApiKey]
|
|
@@ -80,27 +80,27 @@ function Ct({ isOpen: e, onOpenChange: t, apiKey: n, organizationId: r }) {
|
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/components/auth/api-key/api-key.tsx
|
|
83
|
-
function
|
|
84
|
-
let { localization: r } = p(), { localization: i } = m(
|
|
85
|
-
return /* @__PURE__ */
|
|
83
|
+
function St({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
84
|
+
let { localization: r } = p(), { localization: i } = m(bt), [a, o] = q(!1), s = `${e.start}${"*".repeat(16)}`;
|
|
85
|
+
return /* @__PURE__ */ X("div", {
|
|
86
86
|
className: "flex items-center gap-3",
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ Y("div", {
|
|
89
89
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ Y(ze, { className: "size-4.5" })
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ X("div", {
|
|
93
93
|
className: "flex flex-col min-w-0",
|
|
94
94
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ Y("span", {
|
|
96
96
|
className: "text-sm font-medium leading-tight truncate",
|
|
97
97
|
children: e.name || i.apiKey
|
|
98
98
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ Y("span", {
|
|
100
100
|
className: "text-xs text-muted font-mono truncate",
|
|
101
101
|
children: s
|
|
102
102
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ Y("span", {
|
|
104
104
|
className: "text-xs text-muted",
|
|
105
105
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
106
106
|
dateStyle: "medium",
|
|
@@ -109,14 +109,14 @@ function wt({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
|
109
109
|
})
|
|
110
110
|
]
|
|
111
111
|
}),
|
|
112
|
-
!t && /* @__PURE__ */
|
|
112
|
+
!t && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(k, {
|
|
113
113
|
className: "ml-auto shrink-0",
|
|
114
114
|
variant: "outline",
|
|
115
115
|
size: "sm",
|
|
116
116
|
onPress: () => o(!0),
|
|
117
117
|
"aria-label": i.deleteApiKey,
|
|
118
|
-
children: [/* @__PURE__ */
|
|
119
|
-
}), /* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ Y(D, {}), r.settings.delete]
|
|
119
|
+
}), /* @__PURE__ */ Y(xt, {
|
|
120
120
|
isOpen: a,
|
|
121
121
|
onOpenChange: o,
|
|
122
122
|
apiKey: e,
|
|
@@ -127,17 +127,17 @@ function wt({ apiKey: e, hideDelete: t, organizationId: n }) {
|
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/components/auth/api-key/api-key-skeleton.tsx
|
|
130
|
-
function
|
|
131
|
-
return /* @__PURE__ */
|
|
130
|
+
function Ct() {
|
|
131
|
+
return /* @__PURE__ */ Y("div", {
|
|
132
132
|
className: "flex items-center justify-between",
|
|
133
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ X("div", {
|
|
134
134
|
className: "flex items-center gap-3",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ Y(B, { className: "size-10 rounded-xl" }), /* @__PURE__ */ X("div", {
|
|
136
136
|
className: "flex flex-col gap-1",
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ Y(B, { className: "h-4 w-28 rounded-lg" }),
|
|
139
|
+
/* @__PURE__ */ Y(B, { className: "h-3 w-36 rounded-lg" }),
|
|
140
|
+
/* @__PURE__ */ Y(B, { className: "h-3 w-32 rounded-lg" })
|
|
141
141
|
]
|
|
142
142
|
})]
|
|
143
143
|
})
|
|
@@ -145,26 +145,26 @@ function Tt() {
|
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region src/components/auth/api-key/api-keys-empty.tsx
|
|
148
|
-
function
|
|
149
|
-
let { localization: n } = m(
|
|
150
|
-
return /* @__PURE__ */
|
|
148
|
+
function wt({ onCreatePress: e, hideCreate: t }) {
|
|
149
|
+
let { localization: n } = m(bt);
|
|
150
|
+
return /* @__PURE__ */ X("div", {
|
|
151
151
|
className: "flex flex-col items-center justify-center gap-4",
|
|
152
152
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ Y("div", {
|
|
154
154
|
className: "flex size-10 items-center justify-center rounded-xl bg-surface-secondary",
|
|
155
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ Y(ze, { className: "size-4.5" })
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ X("div", {
|
|
158
158
|
className: "flex flex-col items-center justify-center gap-1 text-center",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
160
160
|
className: "text-sm font-semibold",
|
|
161
161
|
children: n.noApiKeys
|
|
162
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ Y("p", {
|
|
163
163
|
className: "text-muted text-xs",
|
|
164
164
|
children: n.apiKeysDescription
|
|
165
165
|
})]
|
|
166
166
|
}),
|
|
167
|
-
!t && /* @__PURE__ */
|
|
167
|
+
!t && /* @__PURE__ */ Y(k, {
|
|
168
168
|
size: "sm",
|
|
169
169
|
onPress: e,
|
|
170
170
|
children: n.createApiKey
|
|
@@ -174,33 +174,33 @@ function Et({ onCreatePress: e, hideCreate: t }) {
|
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
176
|
//#region src/components/auth/api-key/new-api-key-dialog.tsx
|
|
177
|
-
function
|
|
178
|
-
let { localization: i } = p(), { localization: a } = m(
|
|
179
|
-
return /* @__PURE__ */
|
|
177
|
+
function Tt({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
178
|
+
let { localization: i } = p(), { localization: a } = m(bt), [o, s] = q(!1);
|
|
179
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
180
180
|
isOpen: e,
|
|
181
181
|
onOpenChange: t,
|
|
182
|
-
children: /* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
183
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
184
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
185
185
|
status: "warning",
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ Y(ze, {})
|
|
187
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: a.newApiKey })] }),
|
|
188
|
+
/* @__PURE__ */ X(O.Body, {
|
|
189
189
|
className: "flex flex-col gap-4 overflow-visible",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
191
191
|
className: "text-muted text-sm",
|
|
192
192
|
children: a.newApiKeyWarning
|
|
193
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ X(W, {
|
|
194
194
|
value: r ?? "",
|
|
195
195
|
className: "font-mono text-xs",
|
|
196
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ Y(L, { children: n || a.apiKey }), /* @__PURE__ */ X(I, {
|
|
197
197
|
variant: "secondary",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ Y(I.Input, {
|
|
199
199
|
readOnly: !0,
|
|
200
200
|
className: "font-mono text-xs"
|
|
201
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ Y(I.Suffix, {
|
|
202
202
|
className: "px-0",
|
|
203
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ Y(k, {
|
|
204
204
|
isIconOnly: !0,
|
|
205
205
|
"aria-label": i.settings.copyToClipboard,
|
|
206
206
|
size: "sm",
|
|
@@ -209,16 +209,16 @@ function Dt({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
|
209
209
|
if (r) try {
|
|
210
210
|
await navigator.clipboard.writeText(r), s(!0), setTimeout(() => s(!1), 1500);
|
|
211
211
|
} catch (e) {
|
|
212
|
-
|
|
212
|
+
K.danger(e instanceof Error ? e.message : String(e));
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
children:
|
|
215
|
+
children: Y(o ? De : Me, {})
|
|
216
216
|
})
|
|
217
217
|
})]
|
|
218
218
|
})]
|
|
219
219
|
})]
|
|
220
220
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ Y(O.Footer, { children: /* @__PURE__ */ Y(k, {
|
|
222
222
|
slot: "close",
|
|
223
223
|
children: a.dismissNewKey
|
|
224
224
|
}) })
|
|
@@ -227,14 +227,14 @@ function Dt({ isOpen: e, onOpenChange: t, name: n, secretKey: r }) {
|
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region src/components/auth/api-key/create-api-key-dialog.tsx
|
|
230
|
-
function
|
|
231
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
230
|
+
function Et({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
231
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(bt), { mutate: o, isPending: s } = v(r), [c, l] = q(!1), [u, d] = q(null), [f, h] = q(null), g = (e) => {
|
|
232
232
|
e || (d(null), h(null)), t(e);
|
|
233
233
|
};
|
|
234
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(O.Backdrop, {
|
|
235
235
|
isOpen: e,
|
|
236
236
|
onOpenChange: g,
|
|
237
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
238
238
|
onSubmit: (e) => {
|
|
239
239
|
e.preventDefault();
|
|
240
240
|
let t = new FormData(e.target).get("name")?.trim();
|
|
@@ -249,48 +249,48 @@ function Ot({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
|
249
249
|
} });
|
|
250
250
|
},
|
|
251
251
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
253
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
254
254
|
status: "default",
|
|
255
|
-
children: /* @__PURE__ */
|
|
256
|
-
}), /* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ Y(ze, {})
|
|
256
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: a.createApiKey })] }),
|
|
257
|
+
/* @__PURE__ */ X(O.Body, {
|
|
258
258
|
className: "overflow-visible",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
259
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
260
260
|
className: "text-muted text-sm",
|
|
261
261
|
children: a.apiKeysDescription
|
|
262
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ X(W, {
|
|
263
263
|
className: "mt-4",
|
|
264
264
|
id: "name",
|
|
265
265
|
name: "name",
|
|
266
266
|
isDisabled: s,
|
|
267
267
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ Y(L, { children: a.name }),
|
|
269
|
+
/* @__PURE__ */ Y(F, {
|
|
270
270
|
autoFocus: !0,
|
|
271
271
|
placeholder: i.settings.optional,
|
|
272
272
|
variant: "secondary"
|
|
273
273
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ Y(N, {})
|
|
275
275
|
]
|
|
276
276
|
})]
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
279
279
|
slot: "close",
|
|
280
280
|
variant: "tertiary",
|
|
281
281
|
isDisabled: s,
|
|
282
282
|
children: i.settings.cancel
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ X(k, {
|
|
284
284
|
type: "submit",
|
|
285
285
|
isPending: s,
|
|
286
|
-
children: [s && /* @__PURE__ */
|
|
286
|
+
children: [s && /* @__PURE__ */ Y(V, {
|
|
287
287
|
color: "current",
|
|
288
288
|
size: "sm"
|
|
289
289
|
}), a.createApiKey]
|
|
290
290
|
})] })
|
|
291
291
|
]
|
|
292
292
|
}) }) })
|
|
293
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ Y(Tt, {
|
|
294
294
|
isOpen: c,
|
|
295
295
|
onOpenChange: l,
|
|
296
296
|
secretKey: f,
|
|
@@ -299,23 +299,23 @@ function Ot({ isOpen: e, onOpenChange: t, organizationId: n }) {
|
|
|
299
299
|
}
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region src/components/auth/api-key/api-keys.tsx
|
|
302
|
-
function
|
|
303
|
-
let { authClient: o } = p(), { localization: s } = m(
|
|
302
|
+
function Dt({ className: e, variant: t, organizationId: n, isPending: r, hideCreate: i, hideDelete: a }) {
|
|
303
|
+
let { authClient: o } = p(), { localization: s } = m(bt), { data: c, isPending: l } = ie(o, {
|
|
304
304
|
enabled: !r,
|
|
305
305
|
...n ? { query: {
|
|
306
306
|
organizationId: n,
|
|
307
307
|
configId: "organization"
|
|
308
308
|
} } : {}
|
|
309
|
-
}), u = r || l, [d, f] =
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
className:
|
|
309
|
+
}), u = r || l, [d, f] = q(!1);
|
|
310
|
+
return /* @__PURE__ */ X("div", {
|
|
311
|
+
className: G("flex flex-col gap-3", e),
|
|
312
312
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ X("div", {
|
|
314
314
|
className: "flex items-end justify-between gap-3",
|
|
315
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
316
316
|
className: "text-sm font-semibold truncate",
|
|
317
317
|
children: s.apiKeys
|
|
318
|
-
}), !i && /* @__PURE__ */
|
|
318
|
+
}), !i && /* @__PURE__ */ Y(k, {
|
|
319
319
|
className: "shrink-0",
|
|
320
320
|
size: "sm",
|
|
321
321
|
isDisabled: u,
|
|
@@ -323,18 +323,18 @@ function kt({ className: e, variant: t, organizationId: n, isPending: r, hideCre
|
|
|
323
323
|
children: s.createApiKey
|
|
324
324
|
})]
|
|
325
325
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ Y(A, {
|
|
327
327
|
variant: t,
|
|
328
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ Y(A.Content, { children: u ? /* @__PURE__ */ Y(Ct, {}) : c?.apiKeys.length ? c?.apiKeys.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(St, {
|
|
329
329
|
apiKey: e,
|
|
330
330
|
hideDelete: a,
|
|
331
331
|
organizationId: n
|
|
332
|
-
})] }, e.id)) : /* @__PURE__ */
|
|
332
|
+
})] }, e.id)) : /* @__PURE__ */ Y(wt, {
|
|
333
333
|
onCreatePress: () => f(!0),
|
|
334
334
|
hideCreate: i
|
|
335
335
|
}) })
|
|
336
336
|
}),
|
|
337
|
-
!i && /* @__PURE__ */
|
|
337
|
+
!i && /* @__PURE__ */ Y(Et, {
|
|
338
338
|
isOpen: d,
|
|
339
339
|
onOpenChange: f,
|
|
340
340
|
organizationId: n
|
|
@@ -344,58 +344,58 @@ function kt({ className: e, variant: t, organizationId: n, isPending: r, hideCre
|
|
|
344
344
|
}
|
|
345
345
|
//#endregion
|
|
346
346
|
//#region src/lib/auth/delete-user-plugin.ts
|
|
347
|
-
var
|
|
348
|
-
...
|
|
349
|
-
securityCards: [
|
|
347
|
+
var Ot = a(ut.id, (e = {}) => ({
|
|
348
|
+
...ut(e),
|
|
349
|
+
securityCards: [At]
|
|
350
350
|
}));
|
|
351
351
|
//#endregion
|
|
352
352
|
//#region src/components/auth/delete-user/delete-account.tsx
|
|
353
|
-
function
|
|
354
|
-
let { authClient: r, basePaths: a, localization: o, navigate: s, viewPaths: c } = p(), { localization: l, sendDeleteAccountVerification: u } = m(
|
|
353
|
+
function kt({ className: e, variant: t, ...n }) {
|
|
354
|
+
let { authClient: r, basePaths: a, localization: o, navigate: s, viewPaths: c } = p(), { localization: l, sendDeleteAccountVerification: u } = m(Ot), { data: d } = re(r), f = ct(), [h, g] = q(!1), [_, v] = q(""), y = d?.some((e) => e.providerId === "credential"), b = !u && y, { mutate: x, isPending: S } = C(r), w = (e) => {
|
|
355
355
|
g(e), v("");
|
|
356
|
-
},
|
|
356
|
+
}, T = async (e) => {
|
|
357
357
|
e.preventDefault(), x({ ...b ? { password: _ } : {} }, { onSuccess: () => {
|
|
358
|
-
g(!1), v(""), u ?
|
|
358
|
+
g(!1), v(""), u ? K.success(l.deleteUserVerificationSent) : (K.success(l.deleteUserSuccess), f.removeQueries({ queryKey: i.all }), s({
|
|
359
359
|
to: `${a.auth}/${c.auth.signIn}`,
|
|
360
360
|
replace: !0
|
|
361
361
|
}));
|
|
362
362
|
} });
|
|
363
363
|
};
|
|
364
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ Y(A, {
|
|
365
365
|
className: e,
|
|
366
366
|
variant: t,
|
|
367
367
|
...n,
|
|
368
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ X(A.Content, {
|
|
369
369
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
371
371
|
className: "text-sm font-medium leading-tight",
|
|
372
372
|
children: l.deleteAccount
|
|
373
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ Y("p", {
|
|
374
374
|
className: "text-muted text-xs mt-0.5",
|
|
375
375
|
children: l.deleteAccountDescription
|
|
376
|
-
})] }), /* @__PURE__ */
|
|
376
|
+
})] }), /* @__PURE__ */ X(O, { children: [/* @__PURE__ */ Y(k, {
|
|
377
377
|
isDisabled: !d,
|
|
378
378
|
size: "sm",
|
|
379
379
|
variant: "danger-soft",
|
|
380
380
|
onPress: () => g(!0),
|
|
381
381
|
children: l.deleteAccount
|
|
382
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ Y(O.Backdrop, {
|
|
383
383
|
isOpen: h,
|
|
384
|
-
onOpenChange:
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
-
onSubmit:
|
|
384
|
+
onOpenChange: w,
|
|
385
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
386
|
+
onSubmit: T,
|
|
387
387
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
389
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
390
390
|
status: "danger",
|
|
391
|
-
children: /* @__PURE__ */
|
|
392
|
-
}), /* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ Y(Ye, {})
|
|
392
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: l.deleteAccount })] }),
|
|
393
|
+
/* @__PURE__ */ X(O.Body, {
|
|
394
394
|
className: "overflow-visible",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
396
396
|
className: "text-muted text-sm",
|
|
397
397
|
children: l.deleteAccountDescription
|
|
398
|
-
}), b && /* @__PURE__ */
|
|
398
|
+
}), b && /* @__PURE__ */ X(W, {
|
|
399
399
|
className: "mt-4",
|
|
400
400
|
name: "password",
|
|
401
401
|
type: "password",
|
|
@@ -403,27 +403,27 @@ function jt({ className: e, variant: t, ...n }) {
|
|
|
403
403
|
value: _,
|
|
404
404
|
onChange: v,
|
|
405
405
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ Y(L, { children: o.auth.password }),
|
|
407
|
+
/* @__PURE__ */ Y(F, {
|
|
408
408
|
autoComplete: "current-password",
|
|
409
409
|
placeholder: o.auth.passwordPlaceholder,
|
|
410
410
|
required: !0,
|
|
411
411
|
variant: "secondary"
|
|
412
412
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ Y(N, {})
|
|
414
414
|
]
|
|
415
415
|
})]
|
|
416
416
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
418
418
|
slot: "close",
|
|
419
419
|
variant: "tertiary",
|
|
420
420
|
isDisabled: S,
|
|
421
421
|
children: o.settings.cancel
|
|
422
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ X(k, {
|
|
423
423
|
type: "submit",
|
|
424
424
|
variant: "danger",
|
|
425
425
|
isPending: S,
|
|
426
|
-
children: [S && /* @__PURE__ */
|
|
426
|
+
children: [S && /* @__PURE__ */ Y(V, {
|
|
427
427
|
color: "current",
|
|
428
428
|
size: "sm"
|
|
429
429
|
}), l.deleteAccount]
|
|
@@ -436,63 +436,63 @@ function jt({ className: e, variant: t, ...n }) {
|
|
|
436
436
|
}
|
|
437
437
|
//#endregion
|
|
438
438
|
//#region src/components/auth/delete-user/danger-zone.tsx
|
|
439
|
-
function
|
|
439
|
+
function At({ className: e, variant: t, ...n }) {
|
|
440
440
|
let { localization: r } = p();
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
className:
|
|
441
|
+
return /* @__PURE__ */ X("div", {
|
|
442
|
+
className: G("flex w-full flex-col", e),
|
|
443
443
|
...n,
|
|
444
|
-
children: [/* @__PURE__ */
|
|
445
|
-
className:
|
|
444
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
445
|
+
className: G("text-sm font-semibold mb-3 text-danger"),
|
|
446
446
|
children: r.settings.dangerZone
|
|
447
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ Y(kt, { variant: t })]
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region src/components/auth/magic-link/magic-link-button.tsx
|
|
452
|
-
function
|
|
453
|
-
let { basePaths: t, emailAndPassword: n, viewPaths: i, localization: a } = p(), o =
|
|
454
|
-
return l && !n?.enabled ? null : /* @__PURE__ */
|
|
452
|
+
function jt({ view: e }) {
|
|
453
|
+
let { basePaths: t, emailAndPassword: n, viewPaths: i, localization: a } = p(), o = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0, { localization: s, viewPaths: c } = m(Mt), l = e === "magicLink";
|
|
454
|
+
return l && !n?.enabled ? null : /* @__PURE__ */ X(et, {
|
|
455
455
|
href: `${t.auth}/${l ? i.auth.signIn : c.auth.magicLink}`,
|
|
456
456
|
isDisabled: o,
|
|
457
|
-
className:
|
|
458
|
-
children: [
|
|
457
|
+
className: G(_t({ variant: "tertiary" }), "w-full gap-2", o && "status-disabled"),
|
|
458
|
+
children: [Y(l ? Be : Fe, {}), a.auth.continueWith.replace("{{provider}}", l ? a.auth.password : s.magicLink)]
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
//#endregion
|
|
462
462
|
//#region src/lib/auth/magic-link-plugin.ts
|
|
463
|
-
var
|
|
464
|
-
...
|
|
465
|
-
authButtons: [
|
|
466
|
-
views: { auth: { magicLink:
|
|
467
|
-
fallbackViews: { auth: { signIn:
|
|
463
|
+
var Mt = a(dt.id, (e = {}) => ({
|
|
464
|
+
...dt(e),
|
|
465
|
+
authButtons: [jt],
|
|
466
|
+
views: { auth: { magicLink: Nt } },
|
|
467
|
+
fallbackViews: { auth: { signIn: Nt } }
|
|
468
468
|
}));
|
|
469
469
|
//#endregion
|
|
470
470
|
//#region src/components/auth/magic-link/magic-link.tsx
|
|
471
|
-
function
|
|
472
|
-
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _ } = p(), { localization: v } = m(
|
|
473
|
-
b(""),
|
|
474
|
-
} }), C =
|
|
471
|
+
function Nt({ className: n, socialLayout: i, socialPosition: a = "bottom", variant: o }) {
|
|
472
|
+
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _ } = p(), { localization: v } = m(Mt), [y, b] = q(""), { mutate: x, isPending: S } = ve(s, { onSuccess: () => {
|
|
473
|
+
b(""), K.success(v.magicLinkSent);
|
|
474
|
+
} }), C = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0, w = (e) => {
|
|
475
475
|
e.preventDefault(), x({
|
|
476
476
|
email: y,
|
|
477
477
|
callbackURL: `${l}${h}`
|
|
478
478
|
});
|
|
479
|
-
},
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
className:
|
|
479
|
+
}, T = !!g?.length;
|
|
480
|
+
return /* @__PURE__ */ X(A, {
|
|
481
|
+
className: G("w-full max-w-sm gap-4 md:p-6", n),
|
|
482
482
|
variant: o,
|
|
483
483
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ Y(A.Header, { children: /* @__PURE__ */ Y(A.Title, {
|
|
485
485
|
className: "text-xl font-semibold mb-1",
|
|
486
486
|
children: d.auth.signIn
|
|
487
487
|
}) }),
|
|
488
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ X(A.Content, {
|
|
489
489
|
className: "gap-4",
|
|
490
490
|
children: [
|
|
491
|
-
a === "top" && /* @__PURE__ */
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
onSubmit:
|
|
491
|
+
a === "top" && /* @__PURE__ */ X(J, { children: [!!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i }), T && /* @__PURE__ */ Y(e, { children: d.auth.or })] }),
|
|
492
|
+
/* @__PURE__ */ X(P, {
|
|
493
|
+
onSubmit: w,
|
|
494
494
|
className: "flex flex-col gap-4",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ X(W, {
|
|
496
496
|
name: "email",
|
|
497
497
|
type: "email",
|
|
498
498
|
autoComplete: "email",
|
|
@@ -500,38 +500,38 @@ function Ft({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
500
500
|
value: y,
|
|
501
501
|
onChange: b,
|
|
502
502
|
children: [
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ Y(L, { children: d.auth.email }),
|
|
504
|
+
/* @__PURE__ */ Y(F, {
|
|
505
505
|
placeholder: d.auth.emailPlaceholder,
|
|
506
506
|
required: !0,
|
|
507
507
|
variant: o === "transparent" ? "primary" : "secondary"
|
|
508
508
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ Y(N, {})
|
|
510
510
|
]
|
|
511
|
-
}), /* @__PURE__ */
|
|
511
|
+
}), /* @__PURE__ */ X("div", {
|
|
512
512
|
className: "flex flex-col gap-3",
|
|
513
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ X(k, {
|
|
514
514
|
type: "submit",
|
|
515
515
|
className: "w-full",
|
|
516
516
|
isPending: C,
|
|
517
|
-
children: [S && /* @__PURE__ */
|
|
517
|
+
children: [S && /* @__PURE__ */ Y(V, {
|
|
518
518
|
color: "current",
|
|
519
519
|
size: "sm"
|
|
520
520
|
}), v.sendMagicLink]
|
|
521
|
-
}), f.flatMap((e) => (e.authButtons ?? []).map((t, n) => /* @__PURE__ */
|
|
521
|
+
}), f.flatMap((e) => (e.authButtons ?? []).map((t, n) => /* @__PURE__ */ Y(t, { view: "magicLink" }, `${e.id}-${n.toString()}`)))]
|
|
522
522
|
})]
|
|
523
523
|
}),
|
|
524
|
-
a === "bottom" && /* @__PURE__ */
|
|
524
|
+
a === "bottom" && /* @__PURE__ */ X(J, { children: [T && /* @__PURE__ */ Y(e, { children: d.auth.or }), !!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i })] })
|
|
525
525
|
]
|
|
526
526
|
}),
|
|
527
|
-
u?.enabled && /* @__PURE__ */
|
|
527
|
+
u?.enabled && /* @__PURE__ */ Y(A.Footer, {
|
|
528
528
|
className: "flex-col gap-3",
|
|
529
|
-
children: /* @__PURE__ */
|
|
529
|
+
children: /* @__PURE__ */ X(Qe, {
|
|
530
530
|
className: "text-sm",
|
|
531
531
|
children: [
|
|
532
532
|
d.auth.needToCreateAnAccount,
|
|
533
533
|
" ",
|
|
534
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ Y(et, {
|
|
535
535
|
href: `${c.auth}/${_.auth.signUp}`,
|
|
536
536
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
537
537
|
children: d.auth.signUp
|
|
@@ -544,8 +544,8 @@ function Ft({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
544
544
|
}
|
|
545
545
|
//#endregion
|
|
546
546
|
//#region src/components/auth/multi-session/manage-accounts.tsx
|
|
547
|
-
function
|
|
548
|
-
let { authClient: r } = p(), { localization: i } = m(
|
|
547
|
+
function Pt({ className: e, variant: t, ...n }) {
|
|
548
|
+
let { authClient: r } = p(), { localization: i } = m(Rt), { data: a } = E(r), { data: o, isPending: s } = ae(r), c = o?.filter((e) => e.session.id !== a?.session.id), l = [{
|
|
549
549
|
key: a?.session.id ?? "current",
|
|
550
550
|
deviceSession: s ? null : a,
|
|
551
551
|
isPending: s
|
|
@@ -554,16 +554,16 @@ function It({ className: e, variant: t, ...n }) {
|
|
|
554
554
|
deviceSession: e,
|
|
555
555
|
isPending: !1
|
|
556
556
|
})) ?? []];
|
|
557
|
-
return /* @__PURE__ */
|
|
558
|
-
className:
|
|
557
|
+
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h2", {
|
|
558
|
+
className: G("text-sm font-semibold mb-3"),
|
|
559
559
|
children: i.manageAccounts
|
|
560
|
-
}), /* @__PURE__ */
|
|
561
|
-
className:
|
|
560
|
+
}), /* @__PURE__ */ Y(A, {
|
|
561
|
+
className: G(e),
|
|
562
562
|
variant: t,
|
|
563
563
|
...n,
|
|
564
|
-
children: /* @__PURE__ */
|
|
564
|
+
children: /* @__PURE__ */ Y(A.Content, {
|
|
565
565
|
className: "gap-0",
|
|
566
|
-
children: l.map((e, t) => /* @__PURE__ */
|
|
566
|
+
children: l.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(zt, {
|
|
567
567
|
deviceSession: e.deviceSession,
|
|
568
568
|
isPending: e.isPending
|
|
569
569
|
})] }, e.key))
|
|
@@ -572,16 +572,16 @@ function It({ className: e, variant: t, ...n }) {
|
|
|
572
572
|
}
|
|
573
573
|
//#endregion
|
|
574
574
|
//#region src/components/auth/multi-session/switch-account-submenu-item.tsx
|
|
575
|
-
function
|
|
576
|
-
let { authClient: r } = p(), { mutate: i, isPending: a } =
|
|
577
|
-
return /* @__PURE__ */
|
|
575
|
+
function Ft({ deviceSession: e, hideSubtitle: t }) {
|
|
576
|
+
let { authClient: r } = p(), { mutate: i, isPending: a } = ge(r, { onSuccess: () => window.scrollTo({ top: 0 }) });
|
|
577
|
+
return /* @__PURE__ */ X(M.Item, {
|
|
578
578
|
className: "px-2",
|
|
579
579
|
isDisabled: a,
|
|
580
580
|
onPress: () => i({ sessionToken: e.session.token }),
|
|
581
|
-
children: [/* @__PURE__ */
|
|
581
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
582
582
|
user: e.user,
|
|
583
583
|
hideSubtitle: t
|
|
584
|
-
}), a && /* @__PURE__ */
|
|
584
|
+
}), a && /* @__PURE__ */ Y(V, {
|
|
585
585
|
color: "current",
|
|
586
586
|
size: "sm",
|
|
587
587
|
className: "ml-auto"
|
|
@@ -590,106 +590,106 @@ function Lt({ deviceSession: e, hideSubtitle: t }) {
|
|
|
590
590
|
}
|
|
591
591
|
//#endregion
|
|
592
592
|
//#region src/components/auth/multi-session/switch-account-submenu-content.tsx
|
|
593
|
-
function
|
|
594
|
-
let { authClient: t, basePaths: r, viewPaths: i } = p(), { localization: a } = m(
|
|
595
|
-
return /* @__PURE__ */
|
|
593
|
+
function It({ hideSubtitle: e }) {
|
|
594
|
+
let { authClient: t, basePaths: r, viewPaths: i } = p(), { localization: a } = m(Rt), { data: o } = E(t), { data: s, isPending: c } = ae(t);
|
|
595
|
+
return /* @__PURE__ */ Y(M.Popover, {
|
|
596
596
|
className: "min-w-40 md:min-w-56 max-w-[48svw]",
|
|
597
|
-
children: /* @__PURE__ */
|
|
598
|
-
/* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ X(M.Menu, { children: [
|
|
598
|
+
/* @__PURE__ */ X(M.Item, {
|
|
599
599
|
className: "px-2",
|
|
600
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ Y(n, {
|
|
601
601
|
isPending: c,
|
|
602
602
|
hideSubtitle: e
|
|
603
|
-
}), !c && /* @__PURE__ */
|
|
603
|
+
}), !c && /* @__PURE__ */ Y(De, { className: "ml-auto" })]
|
|
604
604
|
}),
|
|
605
|
-
s?.filter((e) => e.session.id !== o?.session?.id).map((t) => /* @__PURE__ */
|
|
605
|
+
s?.filter((e) => e.session.id !== o?.session?.id).map((t) => /* @__PURE__ */ Y(Ft, {
|
|
606
606
|
deviceSession: t,
|
|
607
607
|
hideSubtitle: e
|
|
608
608
|
}, t.session.id)),
|
|
609
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ X(M.Item, {
|
|
610
610
|
textValue: a.addAccount,
|
|
611
611
|
href: `${r.auth}/${i.auth.signIn}`,
|
|
612
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ Y(ke, { className: "text-muted" }), /* @__PURE__ */ Y(L, { children: a.addAccount })]
|
|
613
613
|
})
|
|
614
614
|
] })
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
617
|
//#endregion
|
|
618
618
|
//#region src/components/auth/multi-session/switch-account-submenu.tsx
|
|
619
|
-
function
|
|
620
|
-
let { authClient: n } = p(), { data: r } =
|
|
621
|
-
return r ? /* @__PURE__ */
|
|
619
|
+
function Lt({ className: e, hideSubtitle: t }) {
|
|
620
|
+
let { authClient: n } = p(), { data: r } = E(n), { localization: i } = m(Rt);
|
|
621
|
+
return r ? /* @__PURE__ */ X(M.SubmenuTrigger, { children: [/* @__PURE__ */ X(M.Item, {
|
|
622
622
|
className: e,
|
|
623
623
|
textValue: i.switchAccount,
|
|
624
624
|
children: [
|
|
625
|
-
/* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ Y(we, { className: "text-muted" }),
|
|
626
|
+
/* @__PURE__ */ Y(L, { children: i.switchAccount }),
|
|
627
|
+
/* @__PURE__ */ Y(M.SubmenuIndicator, {})
|
|
628
628
|
]
|
|
629
|
-
}), /* @__PURE__ */
|
|
629
|
+
}), /* @__PURE__ */ Y(M.Popover, {
|
|
630
630
|
className: "min-w-40 md:min-w-56 max-w-[48svw]",
|
|
631
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ Y(It, { hideSubtitle: t })
|
|
632
632
|
})] }) : null;
|
|
633
633
|
}
|
|
634
634
|
//#endregion
|
|
635
635
|
//#region src/lib/auth/multi-session-plugin.ts
|
|
636
|
-
var
|
|
637
|
-
...
|
|
638
|
-
accountCards: [
|
|
639
|
-
userMenuItems: [
|
|
636
|
+
var Rt = a(ft.id, (e = {}) => ({
|
|
637
|
+
...ft(e),
|
|
638
|
+
accountCards: [Pt],
|
|
639
|
+
userMenuItems: [Lt]
|
|
640
640
|
}));
|
|
641
641
|
//#endregion
|
|
642
642
|
//#region src/components/auth/multi-session/manage-account.tsx
|
|
643
|
-
function
|
|
644
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
645
|
-
return /* @__PURE__ */
|
|
643
|
+
function zt({ deviceSession: e, isPending: t }) {
|
|
644
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(Rt), { data: o } = Ce(r), { mutate: s, isPending: c } = ge(r, { onSuccess: () => window.scrollTo({ top: 0 }) }), { mutate: l, isPending: u } = pe(r, { onSuccess: () => K.success(i.settings.revokeSessionSuccess) }), d = e?.session.userId === o?.id, f = c || u;
|
|
645
|
+
return /* @__PURE__ */ X("div", {
|
|
646
646
|
className: "flex items-center justify-between gap-3",
|
|
647
647
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ Y(n, {
|
|
649
649
|
user: e?.user,
|
|
650
650
|
isPending: t,
|
|
651
651
|
size: "md"
|
|
652
652
|
}),
|
|
653
|
-
e && d && /* @__PURE__ */
|
|
653
|
+
e && d && /* @__PURE__ */ X(k, {
|
|
654
654
|
className: "shrink-0",
|
|
655
655
|
variant: "outline",
|
|
656
656
|
size: "sm",
|
|
657
657
|
onPress: () => l({ sessionToken: e.session.token }),
|
|
658
658
|
isDisabled: f,
|
|
659
|
-
children: [u ? /* @__PURE__ */
|
|
659
|
+
children: [u ? /* @__PURE__ */ Y(V, {
|
|
660
660
|
color: "current",
|
|
661
661
|
size: "sm"
|
|
662
|
-
}) : /* @__PURE__ */
|
|
662
|
+
}) : /* @__PURE__ */ Y(Te, {}), i.auth.signOut]
|
|
663
663
|
}),
|
|
664
|
-
e && !d && /* @__PURE__ */
|
|
664
|
+
e && !d && /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ Y(k, {
|
|
665
665
|
isIconOnly: !0,
|
|
666
666
|
variant: "ghost",
|
|
667
667
|
className: "shrink-0",
|
|
668
668
|
size: "sm",
|
|
669
669
|
isDisabled: f,
|
|
670
|
-
children: /* @__PURE__ */
|
|
671
|
-
}), /* @__PURE__ */
|
|
670
|
+
children: /* @__PURE__ */ Y(Pe, {})
|
|
671
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, { children: [/* @__PURE__ */ X(M.Item, {
|
|
672
672
|
textValue: a.switchAccount,
|
|
673
673
|
onAction: () => s({ sessionToken: e.session.token }),
|
|
674
|
-
children: [/* @__PURE__ */
|
|
675
|
-
}), /* @__PURE__ */
|
|
674
|
+
children: [/* @__PURE__ */ Y(we, { className: "text-muted" }), a.switchAccount]
|
|
675
|
+
}), /* @__PURE__ */ X(M.Item, {
|
|
676
676
|
textValue: i.auth.signOut,
|
|
677
677
|
onAction: () => l({ sessionToken: e.session.token }),
|
|
678
|
-
children: [/* @__PURE__ */
|
|
678
|
+
children: [/* @__PURE__ */ Y(Te, { className: "text-muted" }), i.auth.signOut]
|
|
679
679
|
})] }) })] })
|
|
680
680
|
]
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/components/auth/organization/slug-field.tsx
|
|
685
|
-
function
|
|
685
|
+
function Bt(e) {
|
|
686
686
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
let { authClient: a, localization: o } = p(), { localization: s, checkSlug: c } = m(
|
|
688
|
+
function Vt({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
689
|
+
let { authClient: a, localization: o } = p(), { localization: s, checkSlug: c } = m($), { mutate: l, data: u, error: d, reset: f } = _(a), h = vt((e) => {
|
|
690
690
|
!c || !e.trim() || e.trim() === n || l({ slug: e.trim() });
|
|
691
691
|
}, { wait: 500 });
|
|
692
|
-
|
|
692
|
+
at(() => {
|
|
693
693
|
c && (f(), h.maybeExecute(e));
|
|
694
694
|
}, [
|
|
695
695
|
c,
|
|
@@ -698,9 +698,9 @@ function Ut({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
|
698
698
|
f
|
|
699
699
|
]);
|
|
700
700
|
let g = (e) => {
|
|
701
|
-
t(
|
|
701
|
+
t(Bt(e));
|
|
702
702
|
};
|
|
703
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ X(W, {
|
|
704
704
|
id: "slug",
|
|
705
705
|
name: "slug",
|
|
706
706
|
...i,
|
|
@@ -710,36 +710,36 @@ function Ut({ value: e, onChange: t, currentSlug: n, variant: r, ...i }) {
|
|
|
710
710
|
if (!e) return o.auth.fieldRequired;
|
|
711
711
|
},
|
|
712
712
|
children: [
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ Y(L, { children: s.slug }),
|
|
714
|
+
/* @__PURE__ */ X(I, {
|
|
715
715
|
variant: r,
|
|
716
|
-
children: [/* @__PURE__ */
|
|
716
|
+
children: [/* @__PURE__ */ Y(I.Input, {
|
|
717
717
|
placeholder: s.slugPlaceholder,
|
|
718
718
|
required: !0
|
|
719
|
-
}), c && !!e.trim() && e.trim() !== n && /* @__PURE__ */
|
|
719
|
+
}), c && !!e.trim() && e.trim() !== n && /* @__PURE__ */ Y(I.Suffix, {
|
|
720
720
|
className: "px-2",
|
|
721
|
-
children: u?.status ? /* @__PURE__ */
|
|
721
|
+
children: u?.status ? /* @__PURE__ */ Y(De, { className: "text-success" }) : d ? /* @__PURE__ */ Y(D, { className: "text-danger" }) : /* @__PURE__ */ Y(V, {
|
|
722
722
|
size: "sm",
|
|
723
723
|
color: "current"
|
|
724
724
|
})
|
|
725
725
|
})]
|
|
726
726
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ Y(N, {})
|
|
728
728
|
]
|
|
729
729
|
});
|
|
730
730
|
}
|
|
731
731
|
//#endregion
|
|
732
732
|
//#region src/components/auth/organization/create-organization-dialog.tsx
|
|
733
|
-
function
|
|
734
|
-
let { authClient: n, localization: r } = p(), { localization: i } = m(
|
|
735
|
-
return
|
|
733
|
+
function Ht({ isOpen: e, onOpenChange: t }) {
|
|
734
|
+
let { authClient: n, localization: r } = p(), { localization: i } = m($), [a, o] = q(""), [s, c] = q(""), { mutate: l, isPending: u } = y(n, { onSuccess: () => t(!1) });
|
|
735
|
+
return at(() => {
|
|
736
736
|
e || (c(""), o(""));
|
|
737
|
-
}, [e]),
|
|
738
|
-
c(
|
|
739
|
-
}, [a]), /* @__PURE__ */
|
|
737
|
+
}, [e]), at(() => {
|
|
738
|
+
c(Bt(a));
|
|
739
|
+
}, [a]), /* @__PURE__ */ Y(O.Backdrop, {
|
|
740
740
|
isOpen: e,
|
|
741
741
|
onOpenChange: t,
|
|
742
|
-
children: /* @__PURE__ */
|
|
742
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
743
743
|
onSubmit: (e) => {
|
|
744
744
|
e.preventDefault(), l({
|
|
745
745
|
name: a,
|
|
@@ -747,19 +747,19 @@ function Wt({ isOpen: e, onOpenChange: t }) {
|
|
|
747
747
|
});
|
|
748
748
|
},
|
|
749
749
|
children: [
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
751
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
752
752
|
status: "default",
|
|
753
|
-
children: /* @__PURE__ */
|
|
754
|
-
}), /* @__PURE__ */
|
|
755
|
-
/* @__PURE__ */
|
|
753
|
+
children: /* @__PURE__ */ Y(Ee, {})
|
|
754
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: i.createOrganization })] }),
|
|
755
|
+
/* @__PURE__ */ X(O.Body, {
|
|
756
756
|
className: "flex flex-col gap-4 overflow-visible",
|
|
757
757
|
children: [
|
|
758
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ Y("p", {
|
|
759
759
|
className: "text-muted text-sm",
|
|
760
760
|
children: i.organizationsDescription
|
|
761
761
|
}),
|
|
762
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ X(W, {
|
|
763
763
|
id: "name",
|
|
764
764
|
name: "name",
|
|
765
765
|
isDisabled: u,
|
|
@@ -769,17 +769,17 @@ function Wt({ isOpen: e, onOpenChange: t }) {
|
|
|
769
769
|
if (!e) return r.auth.fieldRequired;
|
|
770
770
|
},
|
|
771
771
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ Y(L, { children: i.name }),
|
|
773
|
+
/* @__PURE__ */ Y(F, {
|
|
774
774
|
required: !0,
|
|
775
775
|
autoFocus: !0,
|
|
776
776
|
placeholder: i.namePlaceholder,
|
|
777
777
|
variant: "secondary"
|
|
778
778
|
}),
|
|
779
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ Y(N, {})
|
|
780
780
|
]
|
|
781
781
|
}),
|
|
782
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ Y(Vt, {
|
|
783
783
|
value: s,
|
|
784
784
|
onChange: c,
|
|
785
785
|
isDisabled: u,
|
|
@@ -787,15 +787,15 @@ function Wt({ isOpen: e, onOpenChange: t }) {
|
|
|
787
787
|
})
|
|
788
788
|
]
|
|
789
789
|
}),
|
|
790
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
791
791
|
slot: "close",
|
|
792
792
|
variant: "tertiary",
|
|
793
793
|
isDisabled: u,
|
|
794
794
|
children: r.settings.cancel
|
|
795
|
-
}), /* @__PURE__ */
|
|
795
|
+
}), /* @__PURE__ */ X(k, {
|
|
796
796
|
type: "submit",
|
|
797
797
|
isPending: u,
|
|
798
|
-
children: [u && /* @__PURE__ */
|
|
798
|
+
children: [u && /* @__PURE__ */ Y(V, {
|
|
799
799
|
color: "current",
|
|
800
800
|
size: "sm"
|
|
801
801
|
}), i.createOrganization]
|
|
@@ -806,75 +806,75 @@ function Wt({ isOpen: e, onOpenChange: t }) {
|
|
|
806
806
|
}
|
|
807
807
|
//#endregion
|
|
808
808
|
//#region src/components/auth/organization/organization-logo.tsx
|
|
809
|
-
function
|
|
810
|
-
if (n && !r) return /* @__PURE__ */
|
|
811
|
-
className:
|
|
809
|
+
function Ut({ className: e, fallback: t, isPending: n, organization: r, size: i = "sm", style: a, ...o }) {
|
|
810
|
+
if (n && !r) return /* @__PURE__ */ Y(B, {
|
|
811
|
+
className: G("rounded-full", i === "sm" ? "size-8" : i === "md" ? "size-10" : "size-12", e),
|
|
812
812
|
style: a
|
|
813
813
|
});
|
|
814
814
|
let s = r?.name?.slice(0, 2).toUpperCase();
|
|
815
|
-
return /* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ X(Xe, {
|
|
816
816
|
size: i,
|
|
817
|
-
className:
|
|
817
|
+
className: G("rounded-full", e),
|
|
818
818
|
style: a,
|
|
819
819
|
...o,
|
|
820
|
-
children: [/* @__PURE__ */
|
|
820
|
+
children: [/* @__PURE__ */ Y(Xe.Image, {
|
|
821
821
|
alt: r?.name ?? "Organization",
|
|
822
822
|
src: r?.logo ?? void 0
|
|
823
|
-
}), /* @__PURE__ */
|
|
824
|
-
className:
|
|
823
|
+
}), /* @__PURE__ */ Y(Xe.Fallback, {
|
|
824
|
+
className: G(i === "lg" ? "text-xl" : i === "md" ? "text-base" : "text-sm"),
|
|
825
825
|
delayMs: r?.logo ? 600 : void 0,
|
|
826
|
-
children: t || s || /* @__PURE__ */
|
|
826
|
+
children: t || s || /* @__PURE__ */ Y(Ee, { className: "size-4" })
|
|
827
827
|
})]
|
|
828
828
|
});
|
|
829
829
|
}
|
|
830
830
|
//#endregion
|
|
831
831
|
//#region src/components/auth/organization/organization-view-skeleton.tsx
|
|
832
|
-
function
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
className:
|
|
832
|
+
function Wt({ className: e, hideSlug: t, size: n = "md", ...r }) {
|
|
833
|
+
return /* @__PURE__ */ X("div", {
|
|
834
|
+
className: G("flex min-w-0 items-center gap-2", e),
|
|
835
835
|
...r,
|
|
836
|
-
children: [/* @__PURE__ */
|
|
836
|
+
children: [/* @__PURE__ */ Y(Ut, {
|
|
837
837
|
isPending: !0,
|
|
838
838
|
className: n === "sm" ? "size-5" : void 0,
|
|
839
839
|
size: n === "lg" ? "md" : "sm"
|
|
840
|
-
}), /* @__PURE__ */
|
|
840
|
+
}), /* @__PURE__ */ X("div", {
|
|
841
841
|
className: "flex flex-col min-w-0 gap-1",
|
|
842
|
-
children: [/* @__PURE__ */
|
|
842
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-3.5 w-20 rounded-lg" }), !t && /* @__PURE__ */ Y(B, { className: "h-3 w-28 rounded-lg mt-[0.5px] mb-0.5" })]
|
|
843
843
|
})]
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
846
|
//#endregion
|
|
847
847
|
//#region src/components/auth/organization/organization-view.tsx
|
|
848
|
-
function
|
|
849
|
-
let { authClient: s } = p(), { roles: c } = m(
|
|
848
|
+
function Q({ className: e, isPending: t, size: n = "md", hideSlug: r, hideRole: i, organization: a, ...o }) {
|
|
849
|
+
let { authClient: s } = p(), { roles: c } = m($), { data: l } = E(s), { data: u, isPending: f } = d(s, { enabled: !a && !t }), h = a ?? u, { data: g, isPending: _ } = se(s, {
|
|
850
850
|
query: { organizationId: h?.id },
|
|
851
851
|
enabled: !!h?.id && !i
|
|
852
852
|
}), v = g?.members?.find((e) => e.userId === l?.user.id);
|
|
853
|
-
return t || !a && f || !i && h?.id && _ ? /* @__PURE__ */
|
|
853
|
+
return t || !a && f || !i && h?.id && _ ? /* @__PURE__ */ Y(Wt, {
|
|
854
854
|
className: e,
|
|
855
855
|
hideSlug: r,
|
|
856
856
|
size: n,
|
|
857
857
|
...o
|
|
858
|
-
}) : /* @__PURE__ */
|
|
859
|
-
className:
|
|
858
|
+
}) : /* @__PURE__ */ X("div", {
|
|
859
|
+
className: G("flex min-w-0 items-center gap-2", e),
|
|
860
860
|
...o,
|
|
861
|
-
children: [/* @__PURE__ */
|
|
861
|
+
children: [/* @__PURE__ */ Y(Ut, {
|
|
862
862
|
organization: h,
|
|
863
863
|
className: n === "sm" ? "size-5 [&>span]:text-xs" : void 0,
|
|
864
864
|
size: n === "lg" ? "md" : "sm"
|
|
865
|
-
}), /* @__PURE__ */
|
|
865
|
+
}), /* @__PURE__ */ X("div", {
|
|
866
866
|
className: "flex flex-col min-w-0",
|
|
867
|
-
children: [/* @__PURE__ */
|
|
867
|
+
children: [/* @__PURE__ */ X("div", {
|
|
868
868
|
className: "flex min-w-0 items-center gap-2",
|
|
869
|
-
children: [/* @__PURE__ */
|
|
869
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
870
870
|
className: "text-foreground text-sm font-medium truncate leading-tight",
|
|
871
871
|
children: h?.name
|
|
872
|
-
}), !i && !!v && /* @__PURE__ */
|
|
872
|
+
}), !i && !!v && /* @__PURE__ */ Y(j, {
|
|
873
873
|
className: "shrink-0 -my-0.5",
|
|
874
874
|
size: "sm",
|
|
875
875
|
children: c?.[v.role] ?? v.role
|
|
876
876
|
})]
|
|
877
|
-
}), !r && /* @__PURE__ */
|
|
877
|
+
}), !r && /* @__PURE__ */ Y("p", {
|
|
878
878
|
className: "text-muted text-xs truncate overflow-x-hidden font-mono leading-tight",
|
|
879
879
|
children: h?.slug
|
|
880
880
|
})]
|
|
@@ -883,51 +883,51 @@ function Z({ className: e, isPending: t, size: n = "md", hideSlug: r, hideRole:
|
|
|
883
883
|
}
|
|
884
884
|
//#endregion
|
|
885
885
|
//#region src/components/auth/organization/organization-row.tsx
|
|
886
|
-
function
|
|
887
|
-
let { authClient: t, basePaths: n, navigate: r } = p(), { localization: i, viewPaths: a, slug: o } = m(
|
|
886
|
+
function Gt({ organization: e }) {
|
|
887
|
+
let { authClient: t, basePaths: n, navigate: r } = p(), { localization: i, viewPaths: a, slug: o } = m($), { mutate: s, isPending: c } = he(t, { onSuccess: () => {
|
|
888
888
|
r({ to: `${n.organization}/${a.organization.settings}` });
|
|
889
889
|
} });
|
|
890
890
|
function l() {
|
|
891
891
|
o === void 0 ? s({ organizationId: e.id }) : r({ to: `${n.organization}/${e.slug}/${a.organization.settings}` });
|
|
892
892
|
}
|
|
893
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ X("div", {
|
|
894
894
|
className: "flex items-center gap-3",
|
|
895
|
-
children: [/* @__PURE__ */
|
|
895
|
+
children: [/* @__PURE__ */ Y(Q, { organization: e }), /* @__PURE__ */ X(k, {
|
|
896
896
|
className: "ml-auto shrink-0",
|
|
897
897
|
variant: "outline",
|
|
898
898
|
size: "sm",
|
|
899
899
|
isPending: c,
|
|
900
900
|
onPress: l,
|
|
901
901
|
"aria-label": i.manage,
|
|
902
|
-
children: [c ? /* @__PURE__ */
|
|
902
|
+
children: [c ? /* @__PURE__ */ Y(V, {
|
|
903
903
|
color: "current",
|
|
904
904
|
size: "sm"
|
|
905
|
-
}) : /* @__PURE__ */
|
|
905
|
+
}) : /* @__PURE__ */ Y(Re, {}), i.manage]
|
|
906
906
|
})]
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
909
|
//#endregion
|
|
910
910
|
//#region src/components/auth/organization/organizations-empty.tsx
|
|
911
|
-
function
|
|
912
|
-
let { localization: t } = m(
|
|
913
|
-
return /* @__PURE__ */
|
|
911
|
+
function Kt({ onCreatePress: e }) {
|
|
912
|
+
let { localization: t } = m($);
|
|
913
|
+
return /* @__PURE__ */ X($e, {
|
|
914
914
|
className: "flex flex-col items-center gap-4 text-center",
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ Y("div", {
|
|
917
917
|
className: "flex size-12 items-center justify-center rounded-full bg-surface-secondary",
|
|
918
|
-
children: /* @__PURE__ */
|
|
918
|
+
children: /* @__PURE__ */ Y(Ee, { className: "size-5" })
|
|
919
919
|
}),
|
|
920
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ X("div", {
|
|
921
921
|
className: "flex flex-col gap-2",
|
|
922
|
-
children: [/* @__PURE__ */
|
|
922
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
923
923
|
className: "text-sm font-semibold text-foreground",
|
|
924
924
|
children: t.noOrganizations
|
|
925
|
-
}), /* @__PURE__ */
|
|
925
|
+
}), /* @__PURE__ */ Y("span", {
|
|
926
926
|
className: "text-sm text-muted",
|
|
927
927
|
children: t.organizationsDescription
|
|
928
928
|
})]
|
|
929
929
|
}),
|
|
930
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ Y(k, {
|
|
931
931
|
size: "sm",
|
|
932
932
|
onPress: e,
|
|
933
933
|
children: t.createOrganization
|
|
@@ -937,57 +937,57 @@ function Jt({ onCreatePress: e }) {
|
|
|
937
937
|
}
|
|
938
938
|
//#endregion
|
|
939
939
|
//#region src/components/auth/organization/organizations.tsx
|
|
940
|
-
function
|
|
941
|
-
let { authClient: t } = p(), { localization: n } = m(
|
|
942
|
-
return /* @__PURE__ */
|
|
940
|
+
function qt({ variant: e }) {
|
|
941
|
+
let { authClient: t } = p(), { localization: n } = m($), [r, i] = q(!1), { data: a, isPending: o } = ce(t);
|
|
942
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X("div", {
|
|
943
943
|
className: "flex flex-col gap-3",
|
|
944
|
-
children: [/* @__PURE__ */
|
|
944
|
+
children: [/* @__PURE__ */ X("div", {
|
|
945
945
|
className: "flex items-end justify-between gap-3",
|
|
946
|
-
children: [/* @__PURE__ */
|
|
946
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
947
947
|
className: "truncate text-sm font-semibold",
|
|
948
948
|
children: n.organizations
|
|
949
|
-
}), /* @__PURE__ */
|
|
949
|
+
}), /* @__PURE__ */ Y(k, {
|
|
950
950
|
className: "shrink-0",
|
|
951
951
|
size: "sm",
|
|
952
952
|
isDisabled: o,
|
|
953
953
|
onPress: () => i(!0),
|
|
954
954
|
children: n.createOrganization
|
|
955
955
|
})]
|
|
956
|
-
}), /* @__PURE__ */
|
|
956
|
+
}), /* @__PURE__ */ Y(A, {
|
|
957
957
|
variant: e,
|
|
958
|
-
children: /* @__PURE__ */
|
|
958
|
+
children: /* @__PURE__ */ Y(A.Content, {
|
|
959
959
|
className: "gap-0",
|
|
960
|
-
children: o ? /* @__PURE__ */
|
|
960
|
+
children: o ? /* @__PURE__ */ Y(Wt, {}) : a?.length ? a.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "-mx-4 my-4 border-b border-dashed" }), /* @__PURE__ */ Y(Gt, { organization: e })] }, e.id)) : /* @__PURE__ */ Y(Kt, { onCreatePress: () => i(!0) })
|
|
961
961
|
})
|
|
962
962
|
})]
|
|
963
|
-
}), /* @__PURE__ */
|
|
963
|
+
}), /* @__PURE__ */ Y(Ht, {
|
|
964
964
|
isOpen: r,
|
|
965
965
|
onOpenChange: i
|
|
966
966
|
})] });
|
|
967
967
|
}
|
|
968
968
|
//#endregion
|
|
969
969
|
//#region src/components/auth/organization/user-invitation-row.tsx
|
|
970
|
-
function
|
|
971
|
-
let { authClient: t } = p(), { localization: n, roles: r } = m(
|
|
972
|
-
return /* @__PURE__ */
|
|
970
|
+
function Jt({ invitation: e }) {
|
|
971
|
+
let { authClient: t } = p(), { localization: n, roles: r } = m($), { mutate: i, isPending: a } = u(t), { mutate: o, isPending: s } = de(t);
|
|
972
|
+
return /* @__PURE__ */ X("div", {
|
|
973
973
|
className: "flex items-center gap-3",
|
|
974
974
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ Y("div", {
|
|
976
976
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
977
|
-
children: /* @__PURE__ */
|
|
977
|
+
children: /* @__PURE__ */ Y(Ae, { className: "size-4.5" })
|
|
978
978
|
}),
|
|
979
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ X("div", {
|
|
980
980
|
className: "flex flex-col",
|
|
981
|
-
children: [/* @__PURE__ */
|
|
981
|
+
children: [/* @__PURE__ */ X("div", {
|
|
982
982
|
className: "flex items-center gap-1.5",
|
|
983
|
-
children: [/* @__PURE__ */
|
|
983
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
984
984
|
className: "truncate text-sm font-medium leading-tight",
|
|
985
985
|
children: e.organizationName
|
|
986
|
-
}), /* @__PURE__ */
|
|
986
|
+
}), /* @__PURE__ */ Y(j, {
|
|
987
987
|
size: "sm",
|
|
988
988
|
children: r?.[e.role] ?? e.role
|
|
989
989
|
})]
|
|
990
|
-
}), /* @__PURE__ */
|
|
990
|
+
}), /* @__PURE__ */ Y("span", {
|
|
991
991
|
className: "truncate text-muted text-xs",
|
|
992
992
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
993
993
|
dateStyle: "medium",
|
|
@@ -995,19 +995,19 @@ function Xt({ invitation: e }) {
|
|
|
995
995
|
})
|
|
996
996
|
})]
|
|
997
997
|
}),
|
|
998
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ X("div", {
|
|
999
999
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
1000
|
-
children: [/* @__PURE__ */
|
|
1000
|
+
children: [/* @__PURE__ */ X(k, {
|
|
1001
1001
|
variant: "outline",
|
|
1002
1002
|
size: "sm",
|
|
1003
1003
|
isPending: a,
|
|
1004
1004
|
isDisabled: s,
|
|
1005
1005
|
onPress: () => i({ invitationId: e.id }),
|
|
1006
|
-
children: [a ? /* @__PURE__ */
|
|
1006
|
+
children: [a ? /* @__PURE__ */ Y(V, {
|
|
1007
1007
|
color: "current",
|
|
1008
1008
|
size: "sm"
|
|
1009
|
-
}) : /* @__PURE__ */
|
|
1010
|
-
}), /* @__PURE__ */
|
|
1009
|
+
}) : /* @__PURE__ */ Y(De, {}), n.accept]
|
|
1010
|
+
}), /* @__PURE__ */ Y(k, {
|
|
1011
1011
|
variant: "danger-soft",
|
|
1012
1012
|
size: "sm",
|
|
1013
1013
|
isIconOnly: !0,
|
|
@@ -1015,10 +1015,10 @@ function Xt({ invitation: e }) {
|
|
|
1015
1015
|
isDisabled: a,
|
|
1016
1016
|
onPress: () => o({ invitationId: e.id }),
|
|
1017
1017
|
"aria-label": n.rejectInvitation,
|
|
1018
|
-
children: s ? /* @__PURE__ */
|
|
1018
|
+
children: s ? /* @__PURE__ */ Y(V, {
|
|
1019
1019
|
color: "current",
|
|
1020
1020
|
size: "sm"
|
|
1021
|
-
}) : /* @__PURE__ */
|
|
1021
|
+
}) : /* @__PURE__ */ Y(D, {})
|
|
1022
1022
|
})]
|
|
1023
1023
|
})
|
|
1024
1024
|
]
|
|
@@ -1026,30 +1026,30 @@ function Xt({ invitation: e }) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
//#endregion
|
|
1028
1028
|
//#region src/components/auth/organization/user-invitation-row-skeleton.tsx
|
|
1029
|
-
function
|
|
1030
|
-
return /* @__PURE__ */
|
|
1029
|
+
function Yt() {
|
|
1030
|
+
return /* @__PURE__ */ X("div", {
|
|
1031
1031
|
className: "flex items-center gap-3",
|
|
1032
|
-
children: [/* @__PURE__ */
|
|
1032
|
+
children: [/* @__PURE__ */ Y(B, { className: "size-10 shrink-0 rounded-xl" }), /* @__PURE__ */ X("div", {
|
|
1033
1033
|
className: "flex flex-col gap-1",
|
|
1034
|
-
children: [/* @__PURE__ */
|
|
1034
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-4 w-40 rounded-lg" }), /* @__PURE__ */ Y(B, { className: "h-3 w-28 rounded-lg" })]
|
|
1035
1035
|
})]
|
|
1036
1036
|
});
|
|
1037
1037
|
}
|
|
1038
1038
|
//#endregion
|
|
1039
1039
|
//#region src/components/auth/organization/user-invitations-empty.tsx
|
|
1040
|
-
function
|
|
1041
|
-
let { localization: e } = m(
|
|
1042
|
-
return /* @__PURE__ */
|
|
1040
|
+
function Xt() {
|
|
1041
|
+
let { localization: e } = m($);
|
|
1042
|
+
return /* @__PURE__ */ X($e, {
|
|
1043
1043
|
className: "flex flex-col items-center gap-4 text-center",
|
|
1044
|
-
children: [/* @__PURE__ */
|
|
1044
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
1045
1045
|
className: "flex size-12 items-center justify-center rounded-full bg-surface-secondary",
|
|
1046
|
-
children: /* @__PURE__ */
|
|
1047
|
-
}), /* @__PURE__ */
|
|
1046
|
+
children: /* @__PURE__ */ Y(Ue, { className: "size-5" })
|
|
1047
|
+
}), /* @__PURE__ */ X("div", {
|
|
1048
1048
|
className: "flex flex-col gap-2",
|
|
1049
|
-
children: [/* @__PURE__ */
|
|
1049
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1050
1050
|
className: "text-sm font-semibold text-foreground",
|
|
1051
1051
|
children: e.noInvitations
|
|
1052
|
-
}), /* @__PURE__ */
|
|
1052
|
+
}), /* @__PURE__ */ Y("span", {
|
|
1053
1053
|
className: "text-sm text-muted",
|
|
1054
1054
|
children: e.userInvitationsEmptyDescription
|
|
1055
1055
|
})]
|
|
@@ -1058,46 +1058,46 @@ function Qt() {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
//#endregion
|
|
1060
1060
|
//#region src/components/auth/organization/user-invitations.tsx
|
|
1061
|
-
function
|
|
1062
|
-
let { authClient: t } = p(), { localization: n } = m(
|
|
1063
|
-
return /* @__PURE__ */
|
|
1061
|
+
function Zt({ variant: e }) {
|
|
1062
|
+
let { authClient: t } = p(), { localization: n } = m($), { data: r, isPending: i } = ue(t);
|
|
1063
|
+
return /* @__PURE__ */ X("div", {
|
|
1064
1064
|
className: "flex flex-col gap-3",
|
|
1065
|
-
children: [/* @__PURE__ */
|
|
1065
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
1066
1066
|
className: "truncate text-sm font-semibold",
|
|
1067
1067
|
children: n.invitations
|
|
1068
|
-
}), /* @__PURE__ */
|
|
1068
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1069
1069
|
variant: e,
|
|
1070
|
-
children: /* @__PURE__ */
|
|
1070
|
+
children: /* @__PURE__ */ Y(A.Content, { children: i ? /* @__PURE__ */ Y(Yt, {}) : r?.length ? r?.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(Jt, { invitation: e })] }, e.id)) : /* @__PURE__ */ Y(Xt, {}) })
|
|
1071
1071
|
})]
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
1074
1074
|
//#endregion
|
|
1075
1075
|
//#region src/components/auth/organization/organizations-settings.tsx
|
|
1076
|
-
function
|
|
1077
|
-
return /* @__PURE__ */
|
|
1078
|
-
className:
|
|
1076
|
+
function Qt({ className: e, variant: t, ...n }) {
|
|
1077
|
+
return /* @__PURE__ */ X("div", {
|
|
1078
|
+
className: G("flex w-full flex-col gap-4 md:gap-6", e),
|
|
1079
1079
|
...n,
|
|
1080
|
-
children: [/* @__PURE__ */
|
|
1080
|
+
children: [/* @__PURE__ */ Y(qt, { variant: t }), /* @__PURE__ */ Y(Zt, { variant: t })]
|
|
1081
1081
|
});
|
|
1082
1082
|
}
|
|
1083
1083
|
//#endregion
|
|
1084
1084
|
//#region src/lib/auth/organization-plugin.tsx
|
|
1085
|
-
var
|
|
1086
|
-
let t =
|
|
1085
|
+
var $ = a(pt.id, (e = {}) => {
|
|
1086
|
+
let t = pt(e);
|
|
1087
1087
|
return {
|
|
1088
1088
|
...t,
|
|
1089
1089
|
localization: t.localization,
|
|
1090
1090
|
settingsTabs: [{
|
|
1091
1091
|
view: "organizations",
|
|
1092
|
-
label: /* @__PURE__ */
|
|
1093
|
-
component:
|
|
1092
|
+
label: /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(Ee, { className: "text-muted" }), t.localization.organizations] }),
|
|
1093
|
+
component: Qt
|
|
1094
1094
|
}]
|
|
1095
1095
|
};
|
|
1096
1096
|
});
|
|
1097
1097
|
//#endregion
|
|
1098
1098
|
//#region src/components/auth/organization/change-organization-logo.tsx
|
|
1099
|
-
function
|
|
1100
|
-
let { authClient: t } = p(), { logo: n, localization: r } = m(
|
|
1099
|
+
function $t({ className: e }) {
|
|
1100
|
+
let { authClient: t } = p(), { logo: n, localization: r } = m($), { data: i, isPending: a } = d(t), { mutate: s, isPending: c } = Se(t), l = st(null), [u, f] = q(!1), [h, g] = q(!1), _ = c || u || h;
|
|
1101
1101
|
async function v(e) {
|
|
1102
1102
|
let t = e.target.files?.[0];
|
|
1103
1103
|
if (!(!t || !i)) {
|
|
@@ -1105,11 +1105,11 @@ function tn({ className: e }) {
|
|
|
1105
1105
|
try {
|
|
1106
1106
|
let e = await n.resize?.(t, n.size, n.extension) || t;
|
|
1107
1107
|
s({ data: { logo: await n.upload?.(e) || await o(e) } }, {
|
|
1108
|
-
onSuccess: () =>
|
|
1108
|
+
onSuccess: () => K.success(r.logoChangedSuccess),
|
|
1109
1109
|
onSettled: () => f(!1)
|
|
1110
1110
|
});
|
|
1111
1111
|
} catch (e) {
|
|
1112
|
-
f(!1), e instanceof Error &&
|
|
1112
|
+
f(!1), e instanceof Error && K.danger(e.message);
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
@@ -1117,64 +1117,64 @@ function tn({ className: e }) {
|
|
|
1117
1117
|
let e = i?.logo;
|
|
1118
1118
|
s({ data: { logo: "" } }, { onSuccess: async () => {
|
|
1119
1119
|
if (!e) {
|
|
1120
|
-
|
|
1120
|
+
K.success(r.logoDeletedSuccess);
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
1123
|
g(!0);
|
|
1124
1124
|
try {
|
|
1125
|
-
await n.delete?.(e),
|
|
1125
|
+
await n.delete?.(e), K.success(r.logoDeletedSuccess);
|
|
1126
1126
|
} catch (e) {
|
|
1127
|
-
e instanceof Error &&
|
|
1127
|
+
e instanceof Error && K.danger(e.message);
|
|
1128
1128
|
} finally {
|
|
1129
1129
|
g(!1);
|
|
1130
1130
|
}
|
|
1131
1131
|
} });
|
|
1132
1132
|
}
|
|
1133
|
-
return n.enabled ? /* @__PURE__ */
|
|
1134
|
-
className:
|
|
1133
|
+
return n.enabled ? /* @__PURE__ */ X("div", {
|
|
1134
|
+
className: G("flex flex-col gap-1", e),
|
|
1135
1135
|
children: [
|
|
1136
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ Y(L, {
|
|
1137
1137
|
isDisabled: !i,
|
|
1138
1138
|
children: r.logo
|
|
1139
1139
|
}),
|
|
1140
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ Y("input", {
|
|
1141
1141
|
ref: l,
|
|
1142
1142
|
type: "file",
|
|
1143
1143
|
accept: "image/*",
|
|
1144
1144
|
className: "hidden",
|
|
1145
1145
|
onChange: v
|
|
1146
1146
|
}),
|
|
1147
|
-
/* @__PURE__ */
|
|
1147
|
+
/* @__PURE__ */ X("div", {
|
|
1148
1148
|
className: "flex items-center gap-4",
|
|
1149
|
-
children: [/* @__PURE__ */
|
|
1149
|
+
children: [/* @__PURE__ */ Y(k, {
|
|
1150
1150
|
type: "button",
|
|
1151
1151
|
isIconOnly: !0,
|
|
1152
1152
|
variant: "ghost",
|
|
1153
1153
|
className: "p-0 h-auto w-auto rounded-full",
|
|
1154
1154
|
isDisabled: !i || _,
|
|
1155
1155
|
onPress: () => l.current?.click(),
|
|
1156
|
-
children: /* @__PURE__ */
|
|
1156
|
+
children: /* @__PURE__ */ Y(Ut, {
|
|
1157
1157
|
size: "lg",
|
|
1158
1158
|
isPending: a,
|
|
1159
1159
|
organization: i
|
|
1160
1160
|
})
|
|
1161
|
-
}), /* @__PURE__ */
|
|
1161
|
+
}), /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1162
1162
|
isDisabled: !i || _,
|
|
1163
1163
|
size: "sm",
|
|
1164
1164
|
variant: "secondary",
|
|
1165
|
-
children: [_ && /* @__PURE__ */
|
|
1166
|
-
}), /* @__PURE__ */
|
|
1165
|
+
children: [_ && /* @__PURE__ */ Y(V, { size: "sm" }), r.changeLogo]
|
|
1166
|
+
}), /* @__PURE__ */ Y(M.Popover, {
|
|
1167
1167
|
className: "min-w-fit",
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1168
|
+
children: /* @__PURE__ */ X(M.Menu, { children: [/* @__PURE__ */ X(M.Item, {
|
|
1169
1169
|
textValue: r.uploadLogo,
|
|
1170
1170
|
onAction: () => l.current?.click(),
|
|
1171
|
-
children: [/* @__PURE__ */
|
|
1172
|
-
}), /* @__PURE__ */
|
|
1171
|
+
children: [/* @__PURE__ */ Y(je, { className: "text-muted" }), /* @__PURE__ */ Y(L, { children: r.uploadLogo })]
|
|
1172
|
+
}), /* @__PURE__ */ X(M.Item, {
|
|
1173
1173
|
textValue: r.deleteLogo,
|
|
1174
1174
|
isDisabled: !i?.logo,
|
|
1175
1175
|
onAction: y,
|
|
1176
1176
|
variant: "danger",
|
|
1177
|
-
children: [/* @__PURE__ */
|
|
1177
|
+
children: [/* @__PURE__ */ Y(Je, { className: "text-danger" }), /* @__PURE__ */ Y(L, { children: r.deleteLogo })]
|
|
1178
1178
|
})] })
|
|
1179
1179
|
})] })]
|
|
1180
1180
|
})
|
|
@@ -1183,9 +1183,9 @@ function tn({ className: e }) {
|
|
|
1183
1183
|
}
|
|
1184
1184
|
//#endregion
|
|
1185
1185
|
//#region src/components/auth/organization/delete-organization-dialog.tsx
|
|
1186
|
-
function
|
|
1187
|
-
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(
|
|
1188
|
-
t(!1),
|
|
1186
|
+
function en({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
1187
|
+
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m($), { mutate: l, isPending: u } = x(r, { onSuccess: () => {
|
|
1188
|
+
t(!1), K.success(s.organizationDeleted), o({
|
|
1189
1189
|
to: `${i.settings}/${c.settings.organizations}`,
|
|
1190
1190
|
replace: !0
|
|
1191
1191
|
});
|
|
@@ -1193,40 +1193,40 @@ function nn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1193
1193
|
function d(e) {
|
|
1194
1194
|
e.preventDefault(), l({ organizationId: n.id });
|
|
1195
1195
|
}
|
|
1196
|
-
return /* @__PURE__ */
|
|
1196
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1197
1197
|
isOpen: e,
|
|
1198
1198
|
onOpenChange: t,
|
|
1199
|
-
children: /* @__PURE__ */
|
|
1199
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
1200
1200
|
onSubmit: d,
|
|
1201
1201
|
children: [
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1203
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1204
1204
|
status: "danger",
|
|
1205
|
-
children: /* @__PURE__ */
|
|
1206
|
-
}), /* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1205
|
+
children: /* @__PURE__ */ Y(Ye, {})
|
|
1206
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: s.deleteOrganization })] }),
|
|
1207
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1208
1208
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1209
|
-
children: [/* @__PURE__ */
|
|
1209
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1210
1210
|
className: "text-muted text-sm",
|
|
1211
1211
|
children: s.deleteOrganizationDescription
|
|
1212
|
-
}), /* @__PURE__ */
|
|
1212
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1213
1213
|
variant: "secondary",
|
|
1214
|
-
children: /* @__PURE__ */
|
|
1214
|
+
children: /* @__PURE__ */ Y(A.Content, { children: /* @__PURE__ */ Y(Q, {
|
|
1215
1215
|
organization: n,
|
|
1216
1216
|
hideRole: !0
|
|
1217
1217
|
}) })
|
|
1218
1218
|
})]
|
|
1219
1219
|
}),
|
|
1220
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1221
1221
|
slot: "close",
|
|
1222
1222
|
variant: "tertiary",
|
|
1223
1223
|
isDisabled: u,
|
|
1224
1224
|
children: a.settings.cancel
|
|
1225
|
-
}), /* @__PURE__ */
|
|
1225
|
+
}), /* @__PURE__ */ X(k, {
|
|
1226
1226
|
type: "submit",
|
|
1227
1227
|
variant: "danger",
|
|
1228
1228
|
isPending: u,
|
|
1229
|
-
children: [u && /* @__PURE__ */
|
|
1229
|
+
children: [u && /* @__PURE__ */ Y(V, {
|
|
1230
1230
|
color: "current",
|
|
1231
1231
|
size: "sm"
|
|
1232
1232
|
}), s.deleteOrganization]
|
|
@@ -1237,34 +1237,34 @@ function nn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
//#endregion
|
|
1239
1239
|
//#region src/components/auth/organization/delete-organization-skeleton.tsx
|
|
1240
|
-
function
|
|
1241
|
-
return /* @__PURE__ */
|
|
1240
|
+
function tn() {
|
|
1241
|
+
return /* @__PURE__ */ X("div", {
|
|
1242
1242
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1243
|
-
children: [/* @__PURE__ */
|
|
1243
|
+
children: [/* @__PURE__ */ X("div", {
|
|
1244
1244
|
className: "flex flex-col gap-1",
|
|
1245
|
-
children: [/* @__PURE__ */
|
|
1246
|
-
}), /* @__PURE__ */
|
|
1245
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-3.5 w-40 rounded-lg" }), /* @__PURE__ */ Y(B, { className: "h-3 w-64 rounded-lg" })]
|
|
1246
|
+
}), /* @__PURE__ */ Y(B, { className: "h-8 w-36 shrink-0 rounded-full" })]
|
|
1247
1247
|
});
|
|
1248
1248
|
}
|
|
1249
1249
|
//#endregion
|
|
1250
1250
|
//#region src/components/auth/organization/delete-organization.tsx
|
|
1251
|
-
function
|
|
1252
|
-
let { authClient: e } = p(), { localization: t } = m(
|
|
1253
|
-
return i ? /* @__PURE__ */
|
|
1251
|
+
function nn() {
|
|
1252
|
+
let { authClient: e } = p(), { localization: t } = m($), { data: n } = d(e), { data: r, isPending: i } = T(e, { permissions: { organization: ["delete"] } }), [a, o] = q(!1);
|
|
1253
|
+
return i ? /* @__PURE__ */ Y(tn, {}) : r?.success ? /* @__PURE__ */ X("div", {
|
|
1254
1254
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1255
|
-
children: [/* @__PURE__ */
|
|
1255
|
+
children: [/* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
1256
1256
|
className: "text-sm font-medium leading-tight",
|
|
1257
1257
|
children: t.deleteOrganization
|
|
1258
|
-
}), /* @__PURE__ */
|
|
1258
|
+
}), /* @__PURE__ */ Y("p", {
|
|
1259
1259
|
className: "text-muted mt-0.5 text-xs",
|
|
1260
1260
|
children: t.deleteOrganizationDescription
|
|
1261
|
-
})] }), /* @__PURE__ */
|
|
1261
|
+
})] }), /* @__PURE__ */ X(O, { children: [/* @__PURE__ */ Y(k, {
|
|
1262
1262
|
isDisabled: !n,
|
|
1263
1263
|
size: "sm",
|
|
1264
1264
|
variant: "danger-soft",
|
|
1265
1265
|
onPress: () => o(!0),
|
|
1266
1266
|
children: t.deleteOrganization
|
|
1267
|
-
}), n && /* @__PURE__ */
|
|
1267
|
+
}), n && /* @__PURE__ */ Y(en, {
|
|
1268
1268
|
isOpen: a,
|
|
1269
1269
|
onOpenChange: o,
|
|
1270
1270
|
organization: n
|
|
@@ -1273,22 +1273,22 @@ function an() {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
//#endregion
|
|
1275
1275
|
//#region src/components/auth/organization/invite-member-dialog.tsx
|
|
1276
|
-
var
|
|
1277
|
-
function
|
|
1278
|
-
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(
|
|
1279
|
-
|
|
1276
|
+
var rn = (e) => e.includes("member") ? "member" : e.at(-1) ?? "";
|
|
1277
|
+
function an({ isOpen: e, onOpenChange: t }) {
|
|
1278
|
+
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m($), [o, s] = q(() => rn(Object.keys(a)));
|
|
1279
|
+
at(() => {
|
|
1280
1280
|
s((e) => {
|
|
1281
1281
|
let t = Object.keys(a);
|
|
1282
|
-
return t.includes(e) ? e :
|
|
1282
|
+
return t.includes(e) ? e : rn(t);
|
|
1283
1283
|
});
|
|
1284
1284
|
}, [a]);
|
|
1285
|
-
let { mutate: c, isPending: l } =
|
|
1286
|
-
t(!1),
|
|
1285
|
+
let { mutate: c, isPending: l } = ee(n, { onSuccess: () => {
|
|
1286
|
+
t(!1), K.success(i.inviteMemberSuccess);
|
|
1287
1287
|
} }), u = Object.keys(a).includes(o);
|
|
1288
|
-
return /* @__PURE__ */
|
|
1288
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1289
1289
|
isOpen: e,
|
|
1290
1290
|
onOpenChange: t,
|
|
1291
|
-
children: /* @__PURE__ */
|
|
1291
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
1292
1292
|
onSubmit: (e) => {
|
|
1293
1293
|
e.preventDefault(), u && c({
|
|
1294
1294
|
email: new FormData(e.target).get("email").trim(),
|
|
@@ -1296,19 +1296,19 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1296
1296
|
});
|
|
1297
1297
|
},
|
|
1298
1298
|
children: [
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1299
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1300
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1301
1301
|
status: "default",
|
|
1302
|
-
children: /* @__PURE__ */
|
|
1303
|
-
}), /* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1302
|
+
children: /* @__PURE__ */ Y(Ke, {})
|
|
1303
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: i.inviteMember })] }),
|
|
1304
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1305
1305
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1306
1306
|
children: [
|
|
1307
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ Y("p", {
|
|
1308
1308
|
className: "text-muted text-sm",
|
|
1309
1309
|
children: i.inviteMemberDescription
|
|
1310
1310
|
}),
|
|
1311
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ X(W, {
|
|
1312
1312
|
id: "email",
|
|
1313
1313
|
name: "email",
|
|
1314
1314
|
type: "email",
|
|
@@ -1318,17 +1318,17 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1318
1318
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) return r.auth.invalidEmail;
|
|
1319
1319
|
},
|
|
1320
1320
|
children: [
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ Y(L, { children: r.auth.email }),
|
|
1322
|
+
/* @__PURE__ */ Y(F, {
|
|
1323
1323
|
autoFocus: !0,
|
|
1324
1324
|
placeholder: r.auth.email,
|
|
1325
1325
|
variant: "secondary",
|
|
1326
1326
|
required: !0
|
|
1327
1327
|
}),
|
|
1328
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ Y(N, {})
|
|
1329
1329
|
]
|
|
1330
1330
|
}),
|
|
1331
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ X(rt, {
|
|
1332
1332
|
name: "role",
|
|
1333
1333
|
value: o,
|
|
1334
1334
|
onChange: (e) => {
|
|
@@ -1338,28 +1338,28 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1338
1338
|
variant: "secondary",
|
|
1339
1339
|
fullWidth: !0,
|
|
1340
1340
|
children: [
|
|
1341
|
-
/* @__PURE__ */
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ Y(L, { children: i.role }),
|
|
1342
|
+
/* @__PURE__ */ X(rt.Trigger, { children: [/* @__PURE__ */ Y(rt.Value, {}), /* @__PURE__ */ Y(rt.Indicator, {})] }),
|
|
1343
|
+
/* @__PURE__ */ Y(rt.Popover, { children: /* @__PURE__ */ Y(tt, { children: Object.entries(a).map(([e, t]) => /* @__PURE__ */ X(tt.Item, {
|
|
1344
1344
|
id: e,
|
|
1345
1345
|
textValue: t,
|
|
1346
|
-
children: [t, /* @__PURE__ */
|
|
1346
|
+
children: [t, /* @__PURE__ */ Y(tt.ItemIndicator, {})]
|
|
1347
1347
|
}, e)) }) }),
|
|
1348
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ Y(N, {})
|
|
1349
1349
|
]
|
|
1350
1350
|
})
|
|
1351
1351
|
]
|
|
1352
1352
|
}),
|
|
1353
|
-
/* @__PURE__ */
|
|
1353
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1354
1354
|
slot: "close",
|
|
1355
1355
|
variant: "tertiary",
|
|
1356
1356
|
isDisabled: l,
|
|
1357
1357
|
children: r.settings.cancel
|
|
1358
|
-
}), /* @__PURE__ */
|
|
1358
|
+
}), /* @__PURE__ */ X(k, {
|
|
1359
1359
|
type: "submit",
|
|
1360
1360
|
isPending: l,
|
|
1361
1361
|
isDisabled: !u,
|
|
1362
|
-
children: [l && /* @__PURE__ */
|
|
1362
|
+
children: [l && /* @__PURE__ */ Y(V, {
|
|
1363
1363
|
color: "current",
|
|
1364
1364
|
size: "sm"
|
|
1365
1365
|
}), i.inviteMember]
|
|
@@ -1370,45 +1370,45 @@ function sn({ isOpen: e, onOpenChange: t }) {
|
|
|
1370
1370
|
}
|
|
1371
1371
|
//#endregion
|
|
1372
1372
|
//#region src/components/auth/organization/leave-organization-dialog.tsx
|
|
1373
|
-
function
|
|
1374
|
-
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m(
|
|
1375
|
-
t(!1),
|
|
1373
|
+
function on({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
1374
|
+
let { authClient: r, basePaths: i, localization: a, navigate: o } = p(), { localization: s, viewPaths: c } = m($), { mutate: l, isPending: u } = ne(r, { onSuccess: () => {
|
|
1375
|
+
t(!1), K.success(s.leftOrganization), o({
|
|
1376
1376
|
to: `${i.settings}/${c.settings.organizations}`,
|
|
1377
1377
|
replace: !0
|
|
1378
1378
|
});
|
|
1379
1379
|
} });
|
|
1380
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1381
1381
|
isOpen: e,
|
|
1382
1382
|
onOpenChange: t,
|
|
1383
|
-
children: /* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1383
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
1384
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1385
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1386
1386
|
status: "danger",
|
|
1387
|
-
children: /* @__PURE__ */
|
|
1388
|
-
}), /* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1387
|
+
children: /* @__PURE__ */ Y(Te, {})
|
|
1388
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: s.leaveOrganization })] }),
|
|
1389
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1390
1390
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1391
|
-
children: [/* @__PURE__ */
|
|
1391
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1392
1392
|
className: "text-muted text-sm",
|
|
1393
1393
|
children: s.leaveOrganizationDescription
|
|
1394
|
-
}), /* @__PURE__ */
|
|
1394
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1395
1395
|
variant: "secondary",
|
|
1396
|
-
children: /* @__PURE__ */
|
|
1396
|
+
children: /* @__PURE__ */ Y(A.Content, { children: /* @__PURE__ */ Y(Q, {
|
|
1397
1397
|
organization: n,
|
|
1398
1398
|
hideRole: !0
|
|
1399
1399
|
}) })
|
|
1400
1400
|
})]
|
|
1401
1401
|
}),
|
|
1402
|
-
/* @__PURE__ */
|
|
1402
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1403
1403
|
slot: "close",
|
|
1404
1404
|
variant: "tertiary",
|
|
1405
1405
|
isDisabled: u,
|
|
1406
1406
|
children: a.settings.cancel
|
|
1407
|
-
}), /* @__PURE__ */
|
|
1407
|
+
}), /* @__PURE__ */ X(k, {
|
|
1408
1408
|
variant: "danger",
|
|
1409
1409
|
isPending: u,
|
|
1410
1410
|
onPress: () => l({ organizationId: n.id }),
|
|
1411
|
-
children: [u && /* @__PURE__ */
|
|
1411
|
+
children: [u && /* @__PURE__ */ Y(V, {
|
|
1412
1412
|
color: "current",
|
|
1413
1413
|
size: "sm"
|
|
1414
1414
|
}), s.leaveOrganization]
|
|
@@ -1418,23 +1418,23 @@ function cn({ isOpen: e, onOpenChange: t, organization: n }) {
|
|
|
1418
1418
|
}
|
|
1419
1419
|
//#endregion
|
|
1420
1420
|
//#region src/components/auth/organization/leave-organization.tsx
|
|
1421
|
-
function
|
|
1422
|
-
let { authClient: e } = p(), { localization: t } = m(
|
|
1423
|
-
return /* @__PURE__ */
|
|
1421
|
+
function sn() {
|
|
1422
|
+
let { authClient: e } = p(), { localization: t } = m($), { data: n } = d(e), [r, i] = q(!1);
|
|
1423
|
+
return /* @__PURE__ */ X("div", {
|
|
1424
1424
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
1425
|
-
children: [/* @__PURE__ */
|
|
1425
|
+
children: [/* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("p", {
|
|
1426
1426
|
className: "text-sm font-medium leading-tight",
|
|
1427
1427
|
children: t.leaveOrganization
|
|
1428
|
-
}), /* @__PURE__ */
|
|
1428
|
+
}), /* @__PURE__ */ Y("p", {
|
|
1429
1429
|
className: "text-muted mt-0.5 text-xs",
|
|
1430
1430
|
children: t.leaveOrganizationDescription
|
|
1431
|
-
})] }), /* @__PURE__ */
|
|
1431
|
+
})] }), /* @__PURE__ */ X(O, { children: [/* @__PURE__ */ Y(k, {
|
|
1432
1432
|
isDisabled: !n,
|
|
1433
1433
|
size: "sm",
|
|
1434
1434
|
variant: "danger-soft",
|
|
1435
1435
|
onPress: () => i(!0),
|
|
1436
1436
|
children: t.leaveOrganization
|
|
1437
|
-
}), n && /* @__PURE__ */
|
|
1437
|
+
}), n && /* @__PURE__ */ Y(on, {
|
|
1438
1438
|
isOpen: r,
|
|
1439
1439
|
onOpenChange: i,
|
|
1440
1440
|
organization: n
|
|
@@ -1443,80 +1443,80 @@ function ln() {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
//#endregion
|
|
1445
1445
|
//#region src/components/auth/organization/organization-invitation-row-skeleton.tsx
|
|
1446
|
-
function
|
|
1447
|
-
return /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1446
|
+
function cn() {
|
|
1447
|
+
return /* @__PURE__ */ X(H.Row, { children: [
|
|
1448
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-48 rounded-lg" }) }),
|
|
1449
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-36 rounded-lg" }) }),
|
|
1450
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-16 rounded-lg" }) }),
|
|
1451
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-14 rounded-full" }) }),
|
|
1452
|
+
/* @__PURE__ */ Y(H.Cell, {})
|
|
1453
1453
|
] });
|
|
1454
1454
|
}
|
|
1455
1455
|
//#endregion
|
|
1456
1456
|
//#region src/components/auth/organization/organization-invitation-row.tsx
|
|
1457
|
-
function
|
|
1458
|
-
let { authClient: t } = p(), { localization: n, roles: r } = m(
|
|
1459
|
-
return a ? /* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */
|
|
1457
|
+
function ln({ invitation: e }) {
|
|
1458
|
+
let { authClient: t } = p(), { localization: n, roles: r } = m($), { data: i, isPending: a } = T(t, { permissions: { invitation: ["cancel"] } }), { mutate: o, isPending: s } = g(t), c = r?.[e.role] ?? e.role, l = n[e.status] ?? e.status, u = e.status === "pending" ? "warning" : e.status === "accepted" ? "success" : e.status === "rejected" ? "danger" : "default";
|
|
1459
|
+
return a ? /* @__PURE__ */ Y(cn, {}) : /* @__PURE__ */ X(H.Row, { children: [
|
|
1460
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1461
1461
|
className: "font-medium text-sm",
|
|
1462
1462
|
children: e.email
|
|
1463
1463
|
}),
|
|
1464
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1465
1465
|
className: "text-muted text-xs tabular-nums whitespace-nowrap",
|
|
1466
1466
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
1467
1467
|
dateStyle: "short",
|
|
1468
1468
|
timeStyle: "short"
|
|
1469
1469
|
})
|
|
1470
1470
|
}),
|
|
1471
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1472
1472
|
className: "text-sm",
|
|
1473
1473
|
children: c
|
|
1474
1474
|
}),
|
|
1475
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1476
1476
|
className: "text-sm",
|
|
1477
|
-
children: /* @__PURE__ */
|
|
1477
|
+
children: /* @__PURE__ */ Y(j, {
|
|
1478
1478
|
color: u,
|
|
1479
1479
|
size: "sm",
|
|
1480
1480
|
variant: "soft",
|
|
1481
1481
|
children: l
|
|
1482
1482
|
})
|
|
1483
1483
|
}),
|
|
1484
|
-
/* @__PURE__ */
|
|
1484
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1485
1485
|
className: "text-end",
|
|
1486
|
-
children: i?.success && e.status === "pending" && /* @__PURE__ */
|
|
1486
|
+
children: i?.success && e.status === "pending" && /* @__PURE__ */ Y(k, {
|
|
1487
1487
|
isIconOnly: !0,
|
|
1488
1488
|
size: "sm",
|
|
1489
1489
|
variant: "danger-soft",
|
|
1490
1490
|
isPending: s,
|
|
1491
1491
|
onPress: () => o({ invitationId: e.id }),
|
|
1492
1492
|
"aria-label": n.cancelInvitation,
|
|
1493
|
-
children: s ? /* @__PURE__ */
|
|
1493
|
+
children: s ? /* @__PURE__ */ Y(V, {
|
|
1494
1494
|
color: "current",
|
|
1495
1495
|
size: "sm"
|
|
1496
|
-
}) : /* @__PURE__ */
|
|
1496
|
+
}) : /* @__PURE__ */ Y(D, {})
|
|
1497
1497
|
})
|
|
1498
1498
|
})
|
|
1499
1499
|
] });
|
|
1500
1500
|
}
|
|
1501
1501
|
//#endregion
|
|
1502
1502
|
//#region src/components/auth/organization/organization-invitations-empty.tsx
|
|
1503
|
-
function
|
|
1504
|
-
let { localization: t } = m(
|
|
1505
|
-
return /* @__PURE__ */
|
|
1503
|
+
function un({ onInvitePress: e }) {
|
|
1504
|
+
let { localization: t } = m($);
|
|
1505
|
+
return /* @__PURE__ */ X($e, {
|
|
1506
1506
|
className: "flex flex-col items-center gap-4 text-center p-4",
|
|
1507
1507
|
children: [
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ Y(Ue, { className: "size-6 text-muted" }),
|
|
1509
|
+
/* @__PURE__ */ X("div", {
|
|
1510
1510
|
className: "flex flex-col gap-2",
|
|
1511
|
-
children: [/* @__PURE__ */
|
|
1511
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1512
1512
|
className: "text-sm font-semibold text-foreground",
|
|
1513
1513
|
children: t.noInvitations
|
|
1514
|
-
}), /* @__PURE__ */
|
|
1514
|
+
}), /* @__PURE__ */ Y("span", {
|
|
1515
1515
|
className: "text-sm text-muted",
|
|
1516
1516
|
children: t.organizationInvitationsEmptyDescription
|
|
1517
1517
|
})]
|
|
1518
1518
|
}),
|
|
1519
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ Y(k, {
|
|
1520
1520
|
size: "sm",
|
|
1521
1521
|
onPress: e,
|
|
1522
1522
|
children: t.inviteMember
|
|
@@ -1526,256 +1526,250 @@ function fn({ onInvitePress: e }) {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
//#endregion
|
|
1528
1528
|
//#region src/components/auth/organization/organization-invitations.tsx
|
|
1529
|
-
function
|
|
1530
|
-
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m(
|
|
1529
|
+
function dn({ className: e, ...t }) {
|
|
1530
|
+
let { authClient: n, localization: r } = p(), { localization: i, roles: a } = m($), { data: o, isPending: s } = oe(n), { isPending: c } = T(n, { permissions: { invitation: ["cancel"] } }), l = s || c, [u, d] = q(), [f, h] = q("all"), [g, _] = q("all"), [v, y] = q(""), b = ot(() => o?.filter((e) => (f === "all" || e.role === f) && (g === "all" || e.status === g) && e.email.toLowerCase().includes(v.toLowerCase())), [
|
|
1531
1531
|
v,
|
|
1532
1532
|
o,
|
|
1533
1533
|
f,
|
|
1534
1534
|
g
|
|
1535
|
-
]), x =
|
|
1535
|
+
]), x = ot(() => !u || !b ? b : [...b].sort((e, t) => {
|
|
1536
1536
|
let n = u.column, r = 0;
|
|
1537
1537
|
return r = n === "createdAt" ? new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime() : String(e[n]).localeCompare(String(t[n])), u.direction === "descending" && (r *= -1), r;
|
|
1538
|
-
}), [u, b]), [S, C] =
|
|
1539
|
-
return /* @__PURE__ */
|
|
1540
|
-
className:
|
|
1538
|
+
}), [u, b]), [S, C] = q(!1);
|
|
1539
|
+
return /* @__PURE__ */ X("div", {
|
|
1540
|
+
className: G("flex flex-col gap-3", e),
|
|
1541
1541
|
...t,
|
|
1542
1542
|
children: [
|
|
1543
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ Y("h3", {
|
|
1544
1544
|
className: "truncate text-sm font-semibold",
|
|
1545
1545
|
children: i.invitations
|
|
1546
1546
|
}),
|
|
1547
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ X("div", {
|
|
1548
1548
|
className: "flex flex-col gap-4",
|
|
1549
1549
|
children: [
|
|
1550
|
-
/* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ X("div", {
|
|
1551
1551
|
className: "flex items-center gap-3",
|
|
1552
1552
|
children: [
|
|
1553
|
-
/* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ Y(z, {
|
|
1554
1554
|
className: "min-w-0",
|
|
1555
1555
|
"aria-label": i.search,
|
|
1556
1556
|
value: v,
|
|
1557
1557
|
onChange: y,
|
|
1558
1558
|
isDisabled: l,
|
|
1559
|
-
children: /* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
/* @__PURE__ */
|
|
1559
|
+
children: /* @__PURE__ */ X(z.Group, { children: [
|
|
1560
|
+
/* @__PURE__ */ Y(z.SearchIcon, {}),
|
|
1561
|
+
/* @__PURE__ */ Y(z.Input, {
|
|
1562
1562
|
placeholder: i.search,
|
|
1563
1563
|
className: "sm:w-[200px]"
|
|
1564
1564
|
}),
|
|
1565
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ Y(z.ClearButton, {})
|
|
1566
1566
|
] })
|
|
1567
1567
|
}),
|
|
1568
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1569
1569
|
size: "sm",
|
|
1570
1570
|
variant: "secondary",
|
|
1571
1571
|
isDisabled: l,
|
|
1572
|
-
children: [/* @__PURE__ */
|
|
1573
|
-
}), /* @__PURE__ */
|
|
1572
|
+
children: [/* @__PURE__ */ Y(Le, {}), i.role]
|
|
1573
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, {
|
|
1574
1574
|
selectionMode: "single",
|
|
1575
1575
|
selectedKeys: new Set([f]),
|
|
1576
1576
|
onSelectionChange: (e) => {
|
|
1577
1577
|
let t = [...e][0];
|
|
1578
1578
|
h(t ?? "all");
|
|
1579
1579
|
},
|
|
1580
|
-
children: [/* @__PURE__ */
|
|
1580
|
+
children: [/* @__PURE__ */ X(M.Item, {
|
|
1581
1581
|
id: "all",
|
|
1582
1582
|
textValue: i.all,
|
|
1583
|
-
children: [/* @__PURE__ */
|
|
1584
|
-
}), Object.entries(a).map(([e, t]) => /* @__PURE__ */
|
|
1583
|
+
children: [/* @__PURE__ */ Y(L, { children: i.all }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1584
|
+
}), Object.entries(a).map(([e, t]) => /* @__PURE__ */ X(M.Item, {
|
|
1585
1585
|
id: e,
|
|
1586
1586
|
textValue: t,
|
|
1587
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ Y(L, { children: t }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1588
1588
|
}, e))]
|
|
1589
1589
|
}) })] }),
|
|
1590
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1591
1591
|
size: "sm",
|
|
1592
1592
|
variant: "secondary",
|
|
1593
1593
|
isDisabled: l,
|
|
1594
|
-
children: [/* @__PURE__ */
|
|
1595
|
-
}), /* @__PURE__ */
|
|
1594
|
+
children: [/* @__PURE__ */ Y(Le, {}), i.status]
|
|
1595
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, {
|
|
1596
1596
|
selectionMode: "single",
|
|
1597
1597
|
selectedKeys: new Set([g]),
|
|
1598
1598
|
onSelectionChange: (e) => {
|
|
1599
1599
|
let t = [...e][0];
|
|
1600
1600
|
_(t ?? "all");
|
|
1601
1601
|
},
|
|
1602
|
-
children: [/* @__PURE__ */
|
|
1602
|
+
children: [/* @__PURE__ */ X(M.Item, {
|
|
1603
1603
|
id: "all",
|
|
1604
1604
|
textValue: i.all,
|
|
1605
|
-
children: [/* @__PURE__ */
|
|
1605
|
+
children: [/* @__PURE__ */ Y(L, { children: i.all }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1606
1606
|
}), [
|
|
1607
1607
|
"pending",
|
|
1608
1608
|
"accepted",
|
|
1609
1609
|
"rejected",
|
|
1610
1610
|
"canceled"
|
|
1611
|
-
].map((e) => /* @__PURE__ */
|
|
1611
|
+
].map((e) => /* @__PURE__ */ X(M.Item, {
|
|
1612
1612
|
id: e,
|
|
1613
1613
|
textValue: i[e] ?? e,
|
|
1614
|
-
children: [/* @__PURE__ */
|
|
1614
|
+
children: [/* @__PURE__ */ Y(L, { children: i[e] ?? e }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1615
1615
|
}, e))]
|
|
1616
1616
|
}) })] })
|
|
1617
1617
|
]
|
|
1618
1618
|
}),
|
|
1619
|
-
(f !== "all" || g !== "all") && /* @__PURE__ */
|
|
1619
|
+
(f !== "all" || g !== "all") && /* @__PURE__ */ X("div", {
|
|
1620
1620
|
className: "flex flex-wrap gap-2",
|
|
1621
|
-
children: [f !== "all" && /* @__PURE__ */
|
|
1621
|
+
children: [f !== "all" && /* @__PURE__ */ X(j, {
|
|
1622
1622
|
size: "sm",
|
|
1623
1623
|
variant: "secondary",
|
|
1624
1624
|
className: "w-fit",
|
|
1625
|
-
children: [/* @__PURE__ */
|
|
1625
|
+
children: [/* @__PURE__ */ X(j.Label, { children: [
|
|
1626
1626
|
i.role,
|
|
1627
1627
|
":",
|
|
1628
1628
|
" ",
|
|
1629
|
-
/* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ Y("span", {
|
|
1630
1630
|
className: "capitalize",
|
|
1631
1631
|
children: a?.[f] ?? f
|
|
1632
1632
|
})
|
|
1633
|
-
] }), /* @__PURE__ */
|
|
1633
|
+
] }), /* @__PURE__ */ Y("button", {
|
|
1634
1634
|
type: "button",
|
|
1635
1635
|
"aria-label": i.clear,
|
|
1636
1636
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1637
1637
|
onClick: () => h("all"),
|
|
1638
|
-
children: /* @__PURE__ */
|
|
1638
|
+
children: /* @__PURE__ */ Y(D, { className: "size-3" })
|
|
1639
1639
|
})]
|
|
1640
|
-
}), g !== "all" && /* @__PURE__ */
|
|
1640
|
+
}), g !== "all" && /* @__PURE__ */ X(j, {
|
|
1641
1641
|
size: "sm",
|
|
1642
1642
|
variant: "secondary",
|
|
1643
1643
|
className: "w-fit",
|
|
1644
|
-
children: [/* @__PURE__ */
|
|
1644
|
+
children: [/* @__PURE__ */ X(j.Label, { children: [
|
|
1645
1645
|
i.status,
|
|
1646
1646
|
":",
|
|
1647
1647
|
" ",
|
|
1648
1648
|
i[g] ?? g
|
|
1649
|
-
] }), /* @__PURE__ */
|
|
1649
|
+
] }), /* @__PURE__ */ Y("button", {
|
|
1650
1650
|
type: "button",
|
|
1651
1651
|
"aria-label": i.clear,
|
|
1652
1652
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1653
1653
|
onClick: () => _("all"),
|
|
1654
|
-
children: /* @__PURE__ */
|
|
1654
|
+
children: /* @__PURE__ */ Y(D, { className: "size-3" })
|
|
1655
1655
|
})]
|
|
1656
1656
|
})]
|
|
1657
1657
|
}),
|
|
1658
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ Y(H, { children: /* @__PURE__ */ Y(H.ScrollContainer, { children: /* @__PURE__ */ X(H.Content, {
|
|
1659
1659
|
"aria-label": i.invitations,
|
|
1660
1660
|
sortDescriptor: u,
|
|
1661
1661
|
onSortChange: (e) => {
|
|
1662
1662
|
d(u?.column === e.column && e.direction === "ascending" ? void 0 : e);
|
|
1663
1663
|
},
|
|
1664
|
-
children: [/* @__PURE__ */
|
|
1665
|
-
/* @__PURE__ */
|
|
1664
|
+
children: [/* @__PURE__ */ X(H.Header, { children: [
|
|
1665
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1666
1666
|
allowsSorting: !0,
|
|
1667
1667
|
isRowHeader: !0,
|
|
1668
1668
|
id: "email",
|
|
1669
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1669
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1670
1670
|
sortDirection: e,
|
|
1671
1671
|
children: r.auth.email
|
|
1672
1672
|
})
|
|
1673
1673
|
}),
|
|
1674
|
-
/* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1675
1675
|
allowsSorting: !0,
|
|
1676
1676
|
id: "createdAt",
|
|
1677
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1677
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1678
1678
|
sortDirection: e,
|
|
1679
1679
|
children: i.invitedAt
|
|
1680
1680
|
})
|
|
1681
1681
|
}),
|
|
1682
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1683
1683
|
allowsSorting: !0,
|
|
1684
1684
|
id: "role",
|
|
1685
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1685
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1686
1686
|
sortDirection: e,
|
|
1687
1687
|
children: i.role
|
|
1688
1688
|
})
|
|
1689
1689
|
}),
|
|
1690
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1691
1691
|
allowsSorting: !0,
|
|
1692
1692
|
id: "status",
|
|
1693
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1693
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1694
1694
|
sortDirection: e,
|
|
1695
1695
|
children: i.status
|
|
1696
1696
|
})
|
|
1697
1697
|
}),
|
|
1698
|
-
/* @__PURE__ */
|
|
1698
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1699
1699
|
className: "text-end",
|
|
1700
1700
|
children: i.actions
|
|
1701
1701
|
})
|
|
1702
|
-
] }), /* @__PURE__ */
|
|
1703
|
-
renderEmptyState: () => /* @__PURE__ */
|
|
1704
|
-
children: l ? /* @__PURE__ */
|
|
1702
|
+
] }), /* @__PURE__ */ Y(H.Body, {
|
|
1703
|
+
renderEmptyState: () => /* @__PURE__ */ Y(un, { onInvitePress: () => C(!0) }),
|
|
1704
|
+
children: l ? /* @__PURE__ */ Y(cn, {}) : x?.map((e) => /* @__PURE__ */ Y(ln, { invitation: e }, e.id))
|
|
1705
1705
|
})]
|
|
1706
1706
|
}) }) })
|
|
1707
1707
|
]
|
|
1708
1708
|
}),
|
|
1709
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ Y(an, {
|
|
1710
1710
|
isOpen: S,
|
|
1711
1711
|
onOpenChange: C
|
|
1712
1712
|
})
|
|
1713
1713
|
]
|
|
1714
1714
|
});
|
|
1715
1715
|
}
|
|
1716
|
-
function mn({ children: e, sortDirection: t }) {
|
|
1717
|
-
return /* @__PURE__ */ Y("span", {
|
|
1718
|
-
className: "flex items-center justify-between",
|
|
1719
|
-
children: [e, !!t && /* @__PURE__ */ J(ke, { className: W("size-3 transform transition-transform duration-100 ease-out", t === "descending" ? "rotate-180" : "") })]
|
|
1720
|
-
});
|
|
1721
|
-
}
|
|
1722
1716
|
//#endregion
|
|
1723
1717
|
//#region src/components/auth/organization/organization-member-row-skeleton.tsx
|
|
1724
|
-
function
|
|
1725
|
-
return /* @__PURE__ */
|
|
1726
|
-
/* @__PURE__ */
|
|
1727
|
-
/* @__PURE__ */
|
|
1728
|
-
/* @__PURE__ */
|
|
1718
|
+
function fn() {
|
|
1719
|
+
return /* @__PURE__ */ X(H.Row, { children: [
|
|
1720
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(n, { isPending: !0 }) }),
|
|
1721
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(B, { className: "h-4 w-18 rounded-lg" }) }),
|
|
1722
|
+
/* @__PURE__ */ Y(H.Cell, {
|
|
1729
1723
|
className: "flex justify-end",
|
|
1730
|
-
children: /* @__PURE__ */
|
|
1724
|
+
children: /* @__PURE__ */ Y(B, { className: "size-8 rounded-full" })
|
|
1731
1725
|
})
|
|
1732
1726
|
] });
|
|
1733
1727
|
}
|
|
1734
1728
|
//#endregion
|
|
1735
1729
|
//#region src/components/auth/organization/remove-member-dialog.tsx
|
|
1736
|
-
function
|
|
1737
|
-
let { authClient: i, localization: a } = p(), { localization: o, roles: s } = m(
|
|
1738
|
-
t(!1),
|
|
1730
|
+
function pn({ isOpen: e, onOpenChange: t, member: r }) {
|
|
1731
|
+
let { authClient: i, localization: a } = p(), { localization: o, roles: s } = m($), { mutate: c, isPending: l } = fe(i, { onSuccess: () => {
|
|
1732
|
+
t(!1), K.success(o.memberRemoved);
|
|
1739
1733
|
} });
|
|
1740
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
1741
1735
|
isOpen: e,
|
|
1742
1736
|
onOpenChange: t,
|
|
1743
|
-
children: /* @__PURE__ */
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1737
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
1738
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
1739
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
1746
1740
|
status: "danger",
|
|
1747
|
-
children: /* @__PURE__ */
|
|
1748
|
-
}), /* @__PURE__ */
|
|
1749
|
-
/* @__PURE__ */
|
|
1741
|
+
children: /* @__PURE__ */ Y(Je, {})
|
|
1742
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: o.removeMember })] }),
|
|
1743
|
+
/* @__PURE__ */ X(O.Body, {
|
|
1750
1744
|
className: "flex flex-col gap-4 overflow-visible",
|
|
1751
|
-
children: [/* @__PURE__ */
|
|
1745
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
1752
1746
|
className: "text-muted text-sm",
|
|
1753
1747
|
children: o.removeMemberWarning
|
|
1754
|
-
}), /* @__PURE__ */
|
|
1748
|
+
}), /* @__PURE__ */ Y(A, {
|
|
1755
1749
|
variant: "secondary",
|
|
1756
|
-
children: /* @__PURE__ */
|
|
1750
|
+
children: /* @__PURE__ */ X(A.Content, {
|
|
1757
1751
|
className: "justify-between flex-row items-center gap-2",
|
|
1758
|
-
children: [/* @__PURE__ */
|
|
1752
|
+
children: [/* @__PURE__ */ Y(n, { user: r.user }), /* @__PURE__ */ Y(j, {
|
|
1759
1753
|
size: "sm",
|
|
1760
1754
|
variant: "tertiary",
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ Y(j.Label, { children: s?.[r.role] ?? r.role })
|
|
1762
1756
|
})]
|
|
1763
1757
|
})
|
|
1764
1758
|
})]
|
|
1765
1759
|
}),
|
|
1766
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
1767
1761
|
slot: "close",
|
|
1768
1762
|
variant: "tertiary",
|
|
1769
1763
|
isDisabled: l,
|
|
1770
1764
|
children: a.settings.cancel
|
|
1771
|
-
}), /* @__PURE__ */
|
|
1765
|
+
}), /* @__PURE__ */ X(k, {
|
|
1772
1766
|
variant: "danger",
|
|
1773
1767
|
isPending: l,
|
|
1774
1768
|
onPress: () => c({
|
|
1775
1769
|
memberIdOrEmail: r.id,
|
|
1776
1770
|
organizationId: r.organizationId
|
|
1777
1771
|
}),
|
|
1778
|
-
children: [l && /* @__PURE__ */
|
|
1772
|
+
children: [l && /* @__PURE__ */ Y(V, {
|
|
1779
1773
|
color: "current",
|
|
1780
1774
|
size: "sm"
|
|
1781
1775
|
}), o.removeMember]
|
|
@@ -1785,54 +1779,54 @@ function gn({ isOpen: e, onOpenChange: t, member: r }) {
|
|
|
1785
1779
|
}
|
|
1786
1780
|
//#endregion
|
|
1787
1781
|
//#region src/components/auth/organization/organization-member-row.tsx
|
|
1788
|
-
function
|
|
1789
|
-
let { authClient: i } = p(), { localization: a, roles: o } = m(
|
|
1790
|
-
return f ? /* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1792
|
-
/* @__PURE__ */
|
|
1793
|
-
/* @__PURE__ */
|
|
1782
|
+
function mn({ member: e, isOwner: t, organization: r }) {
|
|
1783
|
+
let { authClient: i } = p(), { localization: a, roles: o } = m($), { data: s } = E(i), { data: c, isPending: l } = T(i, { permissions: { member: ["update"] } }), { data: u, isPending: d } = T(i, { permissions: { member: ["delete"] } }), f = l || d, { mutate: h, isPending: g } = xe(i, { onSuccess: () => K.success(a.memberRoleUpdated) }), _ = o?.[e.role] ?? e.role, v = Object.entries(o).filter(([e]) => t || e !== "owner"), y = s?.user.id === e.userId, [b, x] = q(!1), [S, C] = q(!1);
|
|
1784
|
+
return f ? /* @__PURE__ */ Y(fn, {}) : /* @__PURE__ */ X(H.Row, { children: [
|
|
1785
|
+
/* @__PURE__ */ Y(H.Cell, { children: /* @__PURE__ */ Y(n, { user: e.user }) }),
|
|
1786
|
+
/* @__PURE__ */ Y(H.Cell, { children: _ }),
|
|
1787
|
+
/* @__PURE__ */ X(H.Cell, { children: [/* @__PURE__ */ X("div", {
|
|
1794
1788
|
className: "flex items-center justify-end gap-1",
|
|
1795
|
-
children: [c?.success && /* @__PURE__ */
|
|
1789
|
+
children: [c?.success && /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ Y(k, {
|
|
1796
1790
|
isIconOnly: !0,
|
|
1797
1791
|
size: "sm",
|
|
1798
1792
|
variant: "tertiary",
|
|
1799
1793
|
isDisabled: g,
|
|
1800
1794
|
"aria-label": a.changeMemberRole,
|
|
1801
|
-
children: g ? /* @__PURE__ */
|
|
1795
|
+
children: g ? /* @__PURE__ */ Y(V, {
|
|
1802
1796
|
color: "current",
|
|
1803
1797
|
size: "sm"
|
|
1804
|
-
}) : /* @__PURE__ */
|
|
1805
|
-
}), /* @__PURE__ */
|
|
1798
|
+
}) : /* @__PURE__ */ Y(We, {})
|
|
1799
|
+
}), /* @__PURE__ */ Y(M.Popover, {
|
|
1806
1800
|
className: "min-w-fit",
|
|
1807
|
-
children: /* @__PURE__ */
|
|
1801
|
+
children: /* @__PURE__ */ Y(M.Menu, { children: v.map(([t, n]) => /* @__PURE__ */ Y(M.Item, {
|
|
1808
1802
|
textValue: n,
|
|
1809
1803
|
isDisabled: e.role === t,
|
|
1810
1804
|
onAction: () => h({
|
|
1811
1805
|
memberId: e.id,
|
|
1812
1806
|
role: t
|
|
1813
1807
|
}),
|
|
1814
|
-
children: /* @__PURE__ */
|
|
1808
|
+
children: /* @__PURE__ */ Y(L, { children: n })
|
|
1815
1809
|
}, t)) })
|
|
1816
|
-
})] }), y ? /* @__PURE__ */
|
|
1810
|
+
})] }), y ? /* @__PURE__ */ Y(k, {
|
|
1817
1811
|
isIconOnly: !0,
|
|
1818
1812
|
size: "sm",
|
|
1819
1813
|
variant: "danger-soft",
|
|
1820
1814
|
"aria-label": a.leaveOrganization,
|
|
1821
1815
|
onPress: () => C(!0),
|
|
1822
|
-
children: /* @__PURE__ */
|
|
1823
|
-
}) : u?.success && /* @__PURE__ */
|
|
1816
|
+
children: /* @__PURE__ */ Y(Te, {})
|
|
1817
|
+
}) : u?.success && /* @__PURE__ */ Y(k, {
|
|
1824
1818
|
isIconOnly: !0,
|
|
1825
1819
|
size: "sm",
|
|
1826
1820
|
variant: "danger-soft",
|
|
1827
1821
|
"aria-label": a.removeMember,
|
|
1828
1822
|
onPress: () => x(!0),
|
|
1829
|
-
children: /* @__PURE__ */
|
|
1823
|
+
children: /* @__PURE__ */ Y(Je, {})
|
|
1830
1824
|
})]
|
|
1831
|
-
}), y && r ? /* @__PURE__ */
|
|
1825
|
+
}), y && r ? /* @__PURE__ */ Y(on, {
|
|
1832
1826
|
isOpen: S,
|
|
1833
1827
|
onOpenChange: C,
|
|
1834
1828
|
organization: r
|
|
1835
|
-
}) : u?.success && /* @__PURE__ */
|
|
1829
|
+
}) : u?.success && /* @__PURE__ */ Y(pn, {
|
|
1836
1830
|
isOpen: b,
|
|
1837
1831
|
onOpenChange: x,
|
|
1838
1832
|
member: e
|
|
@@ -1841,179 +1835,173 @@ function _n({ member: e, isOwner: t, organization: r }) {
|
|
|
1841
1835
|
}
|
|
1842
1836
|
//#endregion
|
|
1843
1837
|
//#region src/components/auth/organization/organization-members.tsx
|
|
1844
|
-
function
|
|
1845
|
-
let { authClient: n } = p(), { localization: r, roles: i } = m(
|
|
1838
|
+
function hn({ className: e, ...t }) {
|
|
1839
|
+
let { authClient: n } = p(), { localization: r, roles: i } = m($), { data: a } = E(n), { data: o, isPending: s } = d(n), { data: c, isPending: l } = se(n), { isPending: u } = T(n, { permissions: { member: ["update"] } }), { isPending: f } = T(n, { permissions: { member: ["delete"] } }), h = s || l || u || f, [g, _] = q(), [v, y] = q("all"), [b, x] = q(""), S = ot(() => c?.members.filter((e) => (v === "all" || e.role === v) && (e.user.name.toLowerCase().includes(b.toLowerCase()) || e.user.email.toLowerCase().includes(b.toLowerCase()))), [
|
|
1846
1840
|
b,
|
|
1847
1841
|
c?.members,
|
|
1848
1842
|
v
|
|
1849
|
-
]), C =
|
|
1843
|
+
]), C = ot(() => !g || !S ? S : [...S].sort((e, t) => {
|
|
1850
1844
|
let n = g.column, r = n === "user" ? e.user.name || e.user.email : String(e[n]), i = n === "user" ? t.user.name || t.user.email : String(t[n]), a = r.localeCompare(i);
|
|
1851
1845
|
return g.direction === "descending" && (a *= -1), a;
|
|
1852
|
-
}), [g, S]), [
|
|
1853
|
-
return /* @__PURE__ */
|
|
1854
|
-
className:
|
|
1846
|
+
}), [g, S]), [w, ee] = q(!1), te = c?.members.some((e) => e.role === "owner" && e.userId === a?.user.id);
|
|
1847
|
+
return /* @__PURE__ */ X("div", {
|
|
1848
|
+
className: G("flex flex-col gap-3", e),
|
|
1855
1849
|
...t,
|
|
1856
1850
|
children: [
|
|
1857
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ X("div", {
|
|
1858
1852
|
className: "flex items-end justify-between gap-3",
|
|
1859
|
-
children: [/* @__PURE__ */
|
|
1853
|
+
children: [/* @__PURE__ */ Y("h3", {
|
|
1860
1854
|
className: "truncate text-sm font-semibold",
|
|
1861
1855
|
children: r.members
|
|
1862
|
-
}), /* @__PURE__ */
|
|
1856
|
+
}), /* @__PURE__ */ Y(k, {
|
|
1863
1857
|
className: "shrink-0",
|
|
1864
1858
|
size: "sm",
|
|
1865
1859
|
isDisabled: h,
|
|
1866
|
-
onPress: () =>
|
|
1860
|
+
onPress: () => ee(!0),
|
|
1867
1861
|
children: r.inviteMember
|
|
1868
1862
|
})]
|
|
1869
1863
|
}),
|
|
1870
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ X("div", {
|
|
1871
1865
|
className: "flex flex-col gap-4",
|
|
1872
1866
|
children: [
|
|
1873
|
-
/* @__PURE__ */
|
|
1867
|
+
/* @__PURE__ */ X("div", {
|
|
1874
1868
|
className: "flex items-center gap-3",
|
|
1875
|
-
children: [/* @__PURE__ */
|
|
1869
|
+
children: [/* @__PURE__ */ Y(z, {
|
|
1876
1870
|
className: "min-w-0",
|
|
1877
1871
|
"aria-label": r.search,
|
|
1878
1872
|
value: b,
|
|
1879
1873
|
onChange: x,
|
|
1880
1874
|
isDisabled: h,
|
|
1881
|
-
children: /* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
-
/* @__PURE__ */
|
|
1875
|
+
children: /* @__PURE__ */ X(z.Group, { children: [
|
|
1876
|
+
/* @__PURE__ */ Y(z.SearchIcon, {}),
|
|
1877
|
+
/* @__PURE__ */ Y(z.Input, {
|
|
1884
1878
|
placeholder: r.search,
|
|
1885
1879
|
className: "sm:w-[200px]"
|
|
1886
1880
|
}),
|
|
1887
|
-
/* @__PURE__ */
|
|
1881
|
+
/* @__PURE__ */ Y(z.ClearButton, {})
|
|
1888
1882
|
] })
|
|
1889
|
-
}), /* @__PURE__ */
|
|
1883
|
+
}), /* @__PURE__ */ X(M, { children: [/* @__PURE__ */ X(k, {
|
|
1890
1884
|
size: "sm",
|
|
1891
1885
|
variant: "secondary",
|
|
1892
1886
|
isDisabled: h,
|
|
1893
|
-
children: [/* @__PURE__ */
|
|
1894
|
-
}), /* @__PURE__ */
|
|
1887
|
+
children: [/* @__PURE__ */ Y(Le, {}), r.role]
|
|
1888
|
+
}), /* @__PURE__ */ Y(M.Popover, { children: /* @__PURE__ */ X(M.Menu, {
|
|
1895
1889
|
selectionMode: "single",
|
|
1896
1890
|
selectedKeys: new Set([v]),
|
|
1897
1891
|
onSelectionChange: (e) => {
|
|
1898
1892
|
let t = [...e][0];
|
|
1899
1893
|
y(t ?? "all");
|
|
1900
1894
|
},
|
|
1901
|
-
children: [/* @__PURE__ */
|
|
1895
|
+
children: [/* @__PURE__ */ X(M.Item, {
|
|
1902
1896
|
id: "all",
|
|
1903
1897
|
textValue: r.all,
|
|
1904
|
-
children: [/* @__PURE__ */
|
|
1905
|
-
}), Object.entries(i).map(([e, t]) => /* @__PURE__ */
|
|
1898
|
+
children: [/* @__PURE__ */ Y(L, { children: r.all }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1899
|
+
}), Object.entries(i).map(([e, t]) => /* @__PURE__ */ X(M.Item, {
|
|
1906
1900
|
id: e,
|
|
1907
1901
|
textValue: t,
|
|
1908
|
-
children: [/* @__PURE__ */
|
|
1902
|
+
children: [/* @__PURE__ */ Y(L, { children: t }), /* @__PURE__ */ Y(M.ItemIndicator, {})]
|
|
1909
1903
|
}, e))]
|
|
1910
1904
|
}) })] })]
|
|
1911
1905
|
}),
|
|
1912
|
-
v !== "all" && /* @__PURE__ */
|
|
1906
|
+
v !== "all" && /* @__PURE__ */ X(j, {
|
|
1913
1907
|
size: "sm",
|
|
1914
1908
|
variant: "secondary",
|
|
1915
1909
|
className: "w-fit",
|
|
1916
|
-
children: [/* @__PURE__ */
|
|
1910
|
+
children: [/* @__PURE__ */ X(j.Label, { children: [
|
|
1917
1911
|
r.role,
|
|
1918
1912
|
":",
|
|
1919
1913
|
" ",
|
|
1920
|
-
/* @__PURE__ */
|
|
1914
|
+
/* @__PURE__ */ Y("span", {
|
|
1921
1915
|
className: "capitalize",
|
|
1922
1916
|
children: i?.[v] ?? v
|
|
1923
1917
|
})
|
|
1924
|
-
] }), /* @__PURE__ */
|
|
1918
|
+
] }), /* @__PURE__ */ Y("button", {
|
|
1925
1919
|
type: "button",
|
|
1926
1920
|
"aria-label": r.clear,
|
|
1927
1921
|
className: "text-muted hover:text-foreground inline-flex cursor-pointer items-center",
|
|
1928
1922
|
onClick: () => y("all"),
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1923
|
+
children: /* @__PURE__ */ Y(D, { className: "size-3" })
|
|
1930
1924
|
})]
|
|
1931
1925
|
}),
|
|
1932
|
-
/* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ Y(H, { children: /* @__PURE__ */ Y(H.ScrollContainer, { children: /* @__PURE__ */ X(H.Content, {
|
|
1933
1927
|
"aria-label": r.members,
|
|
1934
1928
|
sortDescriptor: g,
|
|
1935
1929
|
onSortChange: (e) => {
|
|
1936
1930
|
_(g?.column === e.column && e.direction === "ascending" ? void 0 : e);
|
|
1937
1931
|
},
|
|
1938
|
-
children: [/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1932
|
+
children: [/* @__PURE__ */ X(H.Header, { children: [
|
|
1933
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1940
1934
|
allowsSorting: !0,
|
|
1941
1935
|
isRowHeader: !0,
|
|
1942
1936
|
id: "user",
|
|
1943
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1937
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1944
1938
|
sortDirection: e,
|
|
1945
1939
|
children: r.member
|
|
1946
1940
|
})
|
|
1947
1941
|
}),
|
|
1948
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1949
1943
|
allowsSorting: !0,
|
|
1950
1944
|
id: "role",
|
|
1951
|
-
children: ({ sortDirection: e }) => /* @__PURE__ */
|
|
1945
|
+
children: ({ sortDirection: e }) => /* @__PURE__ */ Y(H.SortableColumnHeader, {
|
|
1952
1946
|
sortDirection: e,
|
|
1953
1947
|
children: r.role
|
|
1954
1948
|
})
|
|
1955
1949
|
}),
|
|
1956
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ Y(H.Column, {
|
|
1957
1951
|
className: "text-end",
|
|
1958
1952
|
children: r.actions
|
|
1959
1953
|
})
|
|
1960
|
-
] }), /* @__PURE__ */
|
|
1954
|
+
] }), /* @__PURE__ */ Y(H.Body, { children: h ? /* @__PURE__ */ Y(fn, {}) : !!o && C?.map((e) => /* @__PURE__ */ Y(mn, {
|
|
1961
1955
|
member: e,
|
|
1962
|
-
isOwner:
|
|
1956
|
+
isOwner: te,
|
|
1963
1957
|
organization: o
|
|
1964
1958
|
}, e.id)) })]
|
|
1965
1959
|
}) }) })
|
|
1966
1960
|
]
|
|
1967
1961
|
}),
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
isOpen:
|
|
1970
|
-
onOpenChange:
|
|
1962
|
+
/* @__PURE__ */ Y(an, {
|
|
1963
|
+
isOpen: w,
|
|
1964
|
+
onOpenChange: ee
|
|
1971
1965
|
})
|
|
1972
1966
|
]
|
|
1973
1967
|
});
|
|
1974
1968
|
}
|
|
1975
|
-
function yn({ children: e, sortDirection: t }) {
|
|
1976
|
-
return /* @__PURE__ */ Y("span", {
|
|
1977
|
-
className: "flex items-center justify-between",
|
|
1978
|
-
children: [e, !!t && /* @__PURE__ */ J(ke, { className: W("size-3 transform transition-transform duration-100 ease-out", t === "descending" ? "rotate-180" : "") })]
|
|
1979
|
-
});
|
|
1980
|
-
}
|
|
1981
1969
|
//#endregion
|
|
1982
1970
|
//#region src/components/auth/organization/organization-people.tsx
|
|
1983
|
-
function
|
|
1984
|
-
return /* @__PURE__ */
|
|
1985
|
-
className:
|
|
1971
|
+
function gn({ className: e, ...t }) {
|
|
1972
|
+
return /* @__PURE__ */ X("div", {
|
|
1973
|
+
className: G("flex flex-col gap-4 md:gap-6", e),
|
|
1986
1974
|
...t,
|
|
1987
|
-
children: [/* @__PURE__ */
|
|
1975
|
+
children: [/* @__PURE__ */ Y(hn, {}), /* @__PURE__ */ Y(dn, {})]
|
|
1988
1976
|
});
|
|
1989
1977
|
}
|
|
1990
1978
|
//#endregion
|
|
1991
1979
|
//#region src/components/auth/organization/organization-danger-zone.tsx
|
|
1992
|
-
function
|
|
1993
|
-
let { authClient: r, localization: i } = p(), { data: a, isPending: o } =
|
|
1994
|
-
return /* @__PURE__ */
|
|
1995
|
-
className:
|
|
1980
|
+
function _n({ className: e, variant: t, ...n }) {
|
|
1981
|
+
let { authClient: r, localization: i } = p(), { data: a, isPending: o } = T(r, { permissions: { organization: ["delete"] } }), s = !!a?.success;
|
|
1982
|
+
return /* @__PURE__ */ X("div", {
|
|
1983
|
+
className: G("flex w-full flex-col", e),
|
|
1996
1984
|
...n,
|
|
1997
|
-
children: [/* @__PURE__ */
|
|
1998
|
-
className:
|
|
1985
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
1986
|
+
className: G("mb-3 text-sm font-semibold text-danger"),
|
|
1999
1987
|
children: i.settings.dangerZone
|
|
2000
|
-
}), /* @__PURE__ */
|
|
1988
|
+
}), /* @__PURE__ */ Y(A, {
|
|
2001
1989
|
variant: t,
|
|
2002
|
-
children: /* @__PURE__ */
|
|
1990
|
+
children: /* @__PURE__ */ Y(A.Content, {
|
|
2003
1991
|
className: "gap-0",
|
|
2004
|
-
children: o ? /* @__PURE__ */
|
|
1992
|
+
children: o ? /* @__PURE__ */ Y(tn, {}) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(sn, {}), s && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(nn, {})] })] })
|
|
2005
1993
|
})
|
|
2006
1994
|
})]
|
|
2007
1995
|
});
|
|
2008
1996
|
}
|
|
2009
1997
|
//#endregion
|
|
2010
1998
|
//#region src/components/auth/organization/organization-profile.tsx
|
|
2011
|
-
function
|
|
2012
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
2013
|
-
|
|
1999
|
+
function vn({ className: e, variant: t, ...n }) {
|
|
2000
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m($), { data: o } = d(r), [s, c] = q(o?.slug ?? "");
|
|
2001
|
+
at(() => {
|
|
2014
2002
|
c(o?.slug ?? "");
|
|
2015
2003
|
}, [o?.slug]);
|
|
2016
|
-
let { mutate: l, isPending: u } =
|
|
2004
|
+
let { mutate: l, isPending: u } = Se(r, { onSuccess: () => K.success(a.organizationUpdatedSuccess) });
|
|
2017
2005
|
function f(e) {
|
|
2018
2006
|
e.preventDefault(), o && l({ data: {
|
|
2019
2007
|
name: new FormData(e.currentTarget).get("name"),
|
|
@@ -2021,51 +2009,51 @@ function Sn({ className: e, variant: t, ...n }) {
|
|
|
2021
2009
|
} });
|
|
2022
2010
|
}
|
|
2023
2011
|
let h = t === "transparent" ? "primary" : "secondary";
|
|
2024
|
-
return /* @__PURE__ */
|
|
2025
|
-
className:
|
|
2012
|
+
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h2", {
|
|
2013
|
+
className: G("mb-3 text-sm font-semibold"),
|
|
2026
2014
|
children: a.organizationProfile
|
|
2027
|
-
}), /* @__PURE__ */
|
|
2028
|
-
className:
|
|
2015
|
+
}), /* @__PURE__ */ Y(A, {
|
|
2016
|
+
className: G(e),
|
|
2029
2017
|
variant: t,
|
|
2030
2018
|
...n,
|
|
2031
|
-
children: /* @__PURE__ */
|
|
2019
|
+
children: /* @__PURE__ */ Y(A.Content, { children: /* @__PURE__ */ X(P, {
|
|
2032
2020
|
onSubmit: f,
|
|
2033
2021
|
className: "flex flex-col gap-4",
|
|
2034
2022
|
children: [
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2023
|
+
/* @__PURE__ */ Y($t, {}),
|
|
2024
|
+
/* @__PURE__ */ X(W, {
|
|
2037
2025
|
name: "name",
|
|
2038
2026
|
defaultValue: o?.name,
|
|
2039
2027
|
isDisabled: u || !o,
|
|
2040
2028
|
children: [
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
className:
|
|
2029
|
+
/* @__PURE__ */ Y(L, { children: a.name }),
|
|
2030
|
+
/* @__PURE__ */ Y(F, {
|
|
2031
|
+
className: G(!o && "hidden"),
|
|
2044
2032
|
autoComplete: "organization",
|
|
2045
2033
|
placeholder: a.namePlaceholder,
|
|
2046
2034
|
variant: h
|
|
2047
2035
|
}),
|
|
2048
|
-
!o && /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2036
|
+
!o && /* @__PURE__ */ Y(B, { className: "h-10 w-full rounded-xl md:h-9" }),
|
|
2037
|
+
/* @__PURE__ */ Y(N, {})
|
|
2050
2038
|
]
|
|
2051
2039
|
}, `${o?.id}-${o?.name}-name`),
|
|
2052
|
-
o ? /* @__PURE__ */
|
|
2040
|
+
o ? /* @__PURE__ */ Y(Vt, {
|
|
2053
2041
|
value: s,
|
|
2054
2042
|
onChange: c,
|
|
2055
2043
|
currentSlug: o.slug,
|
|
2056
2044
|
isDisabled: u,
|
|
2057
2045
|
variant: h
|
|
2058
|
-
}) : /* @__PURE__ */
|
|
2046
|
+
}) : /* @__PURE__ */ X(W, {
|
|
2059
2047
|
isDisabled: !0,
|
|
2060
|
-
children: [/* @__PURE__ */
|
|
2048
|
+
children: [/* @__PURE__ */ Y(L, { children: a.slug }), /* @__PURE__ */ Y(B, { className: "h-10 w-full rounded-xl md:h-9" })]
|
|
2061
2049
|
}),
|
|
2062
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ X(k, {
|
|
2063
2051
|
type: "submit",
|
|
2064
2052
|
isPending: u,
|
|
2065
2053
|
isDisabled: !o,
|
|
2066
2054
|
size: "sm",
|
|
2067
2055
|
className: "mt-1",
|
|
2068
|
-
children: [u && /* @__PURE__ */
|
|
2056
|
+
children: [u && /* @__PURE__ */ Y(V, {
|
|
2069
2057
|
color: "current",
|
|
2070
2058
|
size: "sm"
|
|
2071
2059
|
}), i.settings.saveChanges]
|
|
@@ -2076,26 +2064,26 @@ function Sn({ className: e, variant: t, ...n }) {
|
|
|
2076
2064
|
}
|
|
2077
2065
|
//#endregion
|
|
2078
2066
|
//#region src/components/auth/organization/organization-settings.tsx
|
|
2079
|
-
function
|
|
2067
|
+
function yn({ className: e, variant: t, ...n }) {
|
|
2080
2068
|
let { plugins: r } = p();
|
|
2081
|
-
return /* @__PURE__ */
|
|
2082
|
-
className:
|
|
2069
|
+
return /* @__PURE__ */ X("div", {
|
|
2070
|
+
className: G("flex flex-col gap-4 md:gap-6", e),
|
|
2083
2071
|
...n,
|
|
2084
2072
|
children: [
|
|
2085
|
-
/* @__PURE__ */
|
|
2086
|
-
r.flatMap((e) => e.organizationCards?.map((n, r) => /* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ Y(vn, { variant: t }),
|
|
2074
|
+
r.flatMap((e) => e.organizationCards?.map((n, r) => /* @__PURE__ */ Y(n, { variant: t }, `${e.id}-${r.toString()}`))),
|
|
2075
|
+
/* @__PURE__ */ Y(_n, { variant: t })
|
|
2088
2076
|
]
|
|
2089
2077
|
});
|
|
2090
2078
|
}
|
|
2091
2079
|
//#endregion
|
|
2092
2080
|
//#region src/components/auth/organization/organization.tsx
|
|
2093
|
-
function
|
|
2081
|
+
function bn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
2094
2082
|
if (!i && !n) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
|
|
2095
2083
|
let { authClient: o, basePaths: s, localization: c, navigate: l } = p();
|
|
2096
2084
|
h(o);
|
|
2097
|
-
let { localization: u, viewPaths: f, slug: g } = m(
|
|
2098
|
-
|
|
2085
|
+
let { localization: u, viewPaths: f, slug: g } = m($), { data: _, isPending: v } = d(o);
|
|
2086
|
+
at(() => {
|
|
2099
2087
|
!v && !_ && l({
|
|
2100
2088
|
to: `${s.settings}/${f.settings?.organizations}`,
|
|
2101
2089
|
replace: !0
|
|
@@ -2107,7 +2095,7 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2107
2095
|
f.settings?.organizations,
|
|
2108
2096
|
_
|
|
2109
2097
|
]);
|
|
2110
|
-
let y =
|
|
2098
|
+
let y = ot(() => i || Object.entries(f.organization).find(([, e]) => e === n)?.[0], [
|
|
2111
2099
|
i,
|
|
2112
2100
|
n,
|
|
2113
2101
|
f.organization
|
|
@@ -2116,16 +2104,16 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2116
2104
|
let e = Object.values(f.organization).join(", ");
|
|
2117
2105
|
throw Error(`[Better Auth UI] Unknown organization path "${n}". Valid paths are: ${e}`);
|
|
2118
2106
|
}
|
|
2119
|
-
return !v && !_ ? null : /* @__PURE__ */
|
|
2120
|
-
className:
|
|
2107
|
+
return !v && !_ ? null : /* @__PURE__ */ X(U, {
|
|
2108
|
+
className: G(e),
|
|
2121
2109
|
orientation: "horizontal",
|
|
2122
2110
|
selectedKey: y,
|
|
2123
2111
|
...a,
|
|
2124
2112
|
children: [
|
|
2125
|
-
!t && /* @__PURE__ */
|
|
2113
|
+
!t && /* @__PURE__ */ Y(U.ListContainer, { children: /* @__PURE__ */ X(U.List, {
|
|
2126
2114
|
"aria-label": c.settings.settings,
|
|
2127
2115
|
className: "max-w-fit overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
2128
|
-
children: [/* @__PURE__ */
|
|
2116
|
+
children: [/* @__PURE__ */ X(U.Tab, {
|
|
2129
2117
|
id: "settings",
|
|
2130
2118
|
href: g ? `${s.organization}/${g}/${f.organization.settings}` : `${s.organization}/${f.organization.settings}`,
|
|
2131
2119
|
className: "gap-2",
|
|
@@ -2134,11 +2122,11 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2134
2122
|
inline: "center"
|
|
2135
2123
|
}),
|
|
2136
2124
|
children: [
|
|
2137
|
-
/* @__PURE__ */
|
|
2125
|
+
/* @__PURE__ */ Y(Re, { className: "text-muted" }),
|
|
2138
2126
|
c.settings.settings,
|
|
2139
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ Y(U.Indicator, {})
|
|
2140
2128
|
]
|
|
2141
|
-
}), /* @__PURE__ */
|
|
2129
|
+
}), /* @__PURE__ */ X(U.Tab, {
|
|
2142
2130
|
id: "people",
|
|
2143
2131
|
href: g ? `${s.organization}/${g}/${f.organization.people}` : `${s.organization}/${f.organization.people}`,
|
|
2144
2132
|
className: "gap-2",
|
|
@@ -2147,189 +2135,189 @@ function wn({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
|
2147
2135
|
inline: "center"
|
|
2148
2136
|
}),
|
|
2149
2137
|
children: [
|
|
2150
|
-
/* @__PURE__ */
|
|
2138
|
+
/* @__PURE__ */ Y(Ge, { className: "text-muted" }),
|
|
2151
2139
|
u.people,
|
|
2152
|
-
/* @__PURE__ */
|
|
2140
|
+
/* @__PURE__ */ Y(U.Indicator, {})
|
|
2153
2141
|
]
|
|
2154
2142
|
})]
|
|
2155
2143
|
}) }),
|
|
2156
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ Y(U.Panel, {
|
|
2157
2145
|
id: "settings",
|
|
2158
2146
|
className: "px-0",
|
|
2159
|
-
children: /* @__PURE__ */
|
|
2147
|
+
children: /* @__PURE__ */ Y(yn, { variant: r })
|
|
2160
2148
|
}),
|
|
2161
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ Y(U.Panel, {
|
|
2162
2150
|
id: "people",
|
|
2163
2151
|
className: "px-0",
|
|
2164
|
-
children: /* @__PURE__ */
|
|
2152
|
+
children: /* @__PURE__ */ Y(gn, {})
|
|
2165
2153
|
})
|
|
2166
2154
|
]
|
|
2167
2155
|
});
|
|
2168
2156
|
}
|
|
2169
2157
|
//#endregion
|
|
2170
2158
|
//#region src/components/auth/organization/organization-switcher.tsx
|
|
2171
|
-
function
|
|
2172
|
-
let { authClient: h, navigate: g, basePaths: _, localization: v, viewPaths: y } = p(), { data: b, isPending: x } =
|
|
2173
|
-
function
|
|
2174
|
-
o ? o(e) :
|
|
2159
|
+
function xn({ className: e, hideCreate: t, hidePersonal: r, hideSettings: i, hideSlug: a = !0, setActive: o, placement: s, variant: c = "ghost", size: l = "md", trigger: u, ...f }) {
|
|
2160
|
+
let { authClient: h, navigate: g, basePaths: _, localization: v, viewPaths: y } = p(), { data: b, isPending: x } = E(h), { localization: S, viewPaths: C, slug: w } = m($), { data: T, isPending: ee } = d(h), { data: te, isPending: ne } = ce(h), { mutate: re } = he(h), ie = x || !!b && (ne || ee), [ae, oe] = q(!1), [se, le] = q(!1);
|
|
2161
|
+
function ue(e) {
|
|
2162
|
+
o ? o(e) : w === void 0 ? re({ organizationId: e?.id ?? null }) : g({ to: e ? `${_.organization}/${e.slug}/${C.organization.settings}` : `${_.settings}/${y.settings.account}` });
|
|
2175
2163
|
}
|
|
2176
|
-
return /* @__PURE__ */
|
|
2177
|
-
isOpen:
|
|
2178
|
-
onOpenChange:
|
|
2179
|
-
children: [u ? /* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ X(M, {
|
|
2165
|
+
isOpen: se,
|
|
2166
|
+
onOpenChange: le,
|
|
2167
|
+
children: [u ? /* @__PURE__ */ Y(M.Trigger, { children: u }) : /* @__PURE__ */ X(k, {
|
|
2180
2168
|
variant: c,
|
|
2181
|
-
className:
|
|
2182
|
-
isDisabled: !b ||
|
|
2169
|
+
className: G("h-auto px-2 py-2 text-left", e),
|
|
2170
|
+
isDisabled: !b || ie,
|
|
2183
2171
|
"aria-label": S.organization,
|
|
2184
2172
|
...f,
|
|
2185
|
-
children: [
|
|
2173
|
+
children: [ie ? /* @__PURE__ */ Y(Q, {
|
|
2186
2174
|
size: l,
|
|
2187
2175
|
isPending: !0,
|
|
2188
2176
|
hideRole: !0,
|
|
2189
2177
|
hideSlug: a
|
|
2190
|
-
}) :
|
|
2178
|
+
}) : T ? /* @__PURE__ */ Y(Q, {
|
|
2191
2179
|
size: l,
|
|
2192
2180
|
hideRole: !0,
|
|
2193
2181
|
hideSlug: a
|
|
2194
|
-
}) : b && !r ? /* @__PURE__ */
|
|
2182
|
+
}) : b && !r ? /* @__PURE__ */ Y(n, {
|
|
2195
2183
|
size: l,
|
|
2196
2184
|
hideSubtitle: a
|
|
2197
|
-
}) : /* @__PURE__ */
|
|
2185
|
+
}) : /* @__PURE__ */ Y(Q, {
|
|
2198
2186
|
size: l,
|
|
2199
2187
|
hideRole: !0,
|
|
2200
2188
|
hideSlug: a,
|
|
2201
2189
|
organization: { name: S.organization }
|
|
2202
|
-
}), /* @__PURE__ */
|
|
2203
|
-
}), /* @__PURE__ */
|
|
2190
|
+
}), /* @__PURE__ */ Y(Oe, { className: "size-3 shrink-0 text-muted" })]
|
|
2191
|
+
}), /* @__PURE__ */ X(M.Popover, {
|
|
2204
2192
|
placement: s,
|
|
2205
2193
|
className: "max-w-svw",
|
|
2206
|
-
children: [
|
|
2194
|
+
children: [T ? /* @__PURE__ */ X("div", {
|
|
2207
2195
|
className: "flex items-center justify-between gap-4 px-4 pt-3",
|
|
2208
|
-
children: [/* @__PURE__ */
|
|
2196
|
+
children: [/* @__PURE__ */ Y(Q, {
|
|
2209
2197
|
hideRole: !0,
|
|
2210
2198
|
hideSlug: a,
|
|
2211
|
-
organization:
|
|
2212
|
-
}), !i && /* @__PURE__ */
|
|
2213
|
-
href:
|
|
2214
|
-
className:
|
|
2199
|
+
organization: T
|
|
2200
|
+
}), !i && /* @__PURE__ */ X(et, {
|
|
2201
|
+
href: w ? `${_.organization}/${w}/${C.organization.settings}` : `${_.organization}/${C.organization.settings}`,
|
|
2202
|
+
className: G(_t({
|
|
2215
2203
|
variant: "outline",
|
|
2216
2204
|
size: "sm"
|
|
2217
2205
|
}), "shrink-0 gap-2"),
|
|
2218
|
-
onPress: () =>
|
|
2219
|
-
children: [/* @__PURE__ */
|
|
2206
|
+
onPress: () => le(!1),
|
|
2207
|
+
children: [/* @__PURE__ */ Y(Re, { className: "text-muted" }), S.manage]
|
|
2220
2208
|
})]
|
|
2221
|
-
}) : !
|
|
2209
|
+
}) : !ie && b?.user && !r ? /* @__PURE__ */ X("div", {
|
|
2222
2210
|
className: "flex items-center justify-between gap-4 px-4 pt-3",
|
|
2223
|
-
children: [/* @__PURE__ */
|
|
2211
|
+
children: [/* @__PURE__ */ Y(n, { hideSubtitle: a }), !i && /* @__PURE__ */ X(et, {
|
|
2224
2212
|
href: `${_.settings}/${y.settings.account}`,
|
|
2225
|
-
className:
|
|
2213
|
+
className: G(_t({
|
|
2226
2214
|
variant: "outline",
|
|
2227
2215
|
size: "sm"
|
|
2228
2216
|
}), "shrink-0 gap-2"),
|
|
2229
|
-
onPress: () =>
|
|
2230
|
-
children: [/* @__PURE__ */
|
|
2217
|
+
onPress: () => le(!1),
|
|
2218
|
+
children: [/* @__PURE__ */ Y(Re, { className: "text-muted" }), v.settings.settings]
|
|
2231
2219
|
})]
|
|
2232
|
-
}) : null, /* @__PURE__ */
|
|
2233
|
-
!!
|
|
2220
|
+
}) : null, /* @__PURE__ */ X(M.Menu, { children: [
|
|
2221
|
+
!!T && !r && /* @__PURE__ */ Y(M.Item, {
|
|
2234
2222
|
textValue: S.personalAccount,
|
|
2235
|
-
onPress: () =>
|
|
2236
|
-
children: /* @__PURE__ */
|
|
2223
|
+
onPress: () => ue(null),
|
|
2224
|
+
children: /* @__PURE__ */ Y(n, { hideSubtitle: a })
|
|
2237
2225
|
}),
|
|
2238
|
-
|
|
2226
|
+
te?.filter((e) => e.id !== T?.id)?.map((e) => /* @__PURE__ */ Y(M.Item, {
|
|
2239
2227
|
textValue: e.name,
|
|
2240
|
-
onPress: () =>
|
|
2241
|
-
children: /* @__PURE__ */
|
|
2228
|
+
onPress: () => ue(e),
|
|
2229
|
+
children: /* @__PURE__ */ Y(Q, {
|
|
2242
2230
|
hideRole: !0,
|
|
2243
2231
|
hideSlug: a,
|
|
2244
2232
|
organization: e
|
|
2245
2233
|
})
|
|
2246
2234
|
}, e.id)),
|
|
2247
|
-
!t && /* @__PURE__ */
|
|
2235
|
+
!t && /* @__PURE__ */ X(M.Item, {
|
|
2248
2236
|
textValue: S.createOrganization,
|
|
2249
|
-
onPress: () =>
|
|
2250
|
-
children: [/* @__PURE__ */
|
|
2237
|
+
onPress: () => oe(!0),
|
|
2238
|
+
children: [/* @__PURE__ */ Y(ke, { className: "text-muted" }), /* @__PURE__ */ Y(L, { children: S.createOrganization })]
|
|
2251
2239
|
})
|
|
2252
2240
|
] })]
|
|
2253
2241
|
})]
|
|
2254
|
-
}), /* @__PURE__ */
|
|
2255
|
-
isOpen:
|
|
2256
|
-
onOpenChange:
|
|
2242
|
+
}), /* @__PURE__ */ Y(Ht, {
|
|
2243
|
+
isOpen: ae,
|
|
2244
|
+
onOpenChange: oe
|
|
2257
2245
|
})] });
|
|
2258
2246
|
}
|
|
2259
2247
|
//#endregion
|
|
2260
2248
|
//#region src/components/auth/passkey/passkey-button.tsx
|
|
2261
|
-
function
|
|
2262
|
-
let { authClient: t, localization: n, redirectTo: i, navigate: a } = p(), { localization: o } = m(
|
|
2263
|
-
return e === "signUp" ? null : /* @__PURE__ */
|
|
2249
|
+
function Sn({ view: e }) {
|
|
2250
|
+
let { authClient: t, localization: n, redirectTo: i, navigate: a } = p(), { localization: o } = m(Cn), { mutate: s, isPending: c } = ye(t, { onSuccess: () => a({ to: i }) }), l = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0;
|
|
2251
|
+
return e === "signUp" ? null : /* @__PURE__ */ X(k, {
|
|
2264
2252
|
className: "w-full",
|
|
2265
2253
|
variant: "tertiary",
|
|
2266
2254
|
isDisabled: l,
|
|
2267
2255
|
isPending: c,
|
|
2268
2256
|
onPress: () => s(),
|
|
2269
|
-
children: [c ? /* @__PURE__ */
|
|
2257
|
+
children: [c ? /* @__PURE__ */ Y(V, {
|
|
2270
2258
|
color: "current",
|
|
2271
2259
|
size: "sm"
|
|
2272
|
-
}) : /* @__PURE__ */
|
|
2260
|
+
}) : /* @__PURE__ */ Y(Ie, {}), n.auth.continueWith.replace("{{provider}}", o.passkey)]
|
|
2273
2261
|
});
|
|
2274
2262
|
}
|
|
2275
2263
|
//#endregion
|
|
2276
2264
|
//#region src/lib/auth/passkey-plugin.ts
|
|
2277
|
-
var
|
|
2278
|
-
...
|
|
2279
|
-
authButtons: [
|
|
2280
|
-
securityCards: [
|
|
2265
|
+
var Cn = a(mt.id, (e = {}) => ({
|
|
2266
|
+
...mt(e),
|
|
2267
|
+
authButtons: [Sn],
|
|
2268
|
+
securityCards: [kn]
|
|
2281
2269
|
}));
|
|
2282
2270
|
//#endregion
|
|
2283
2271
|
//#region src/components/auth/passkey/add-passkey-dialog.tsx
|
|
2284
|
-
function
|
|
2285
|
-
let { authClient: n, localization: r } = p(), { localization: i } = m(
|
|
2272
|
+
function wn({ isOpen: e, onOpenChange: t }) {
|
|
2273
|
+
let { authClient: n, localization: r } = p(), { localization: i } = m(Cn), { mutate: a, isPending: o } = f(n), s = (e) => {
|
|
2286
2274
|
t(e);
|
|
2287
2275
|
};
|
|
2288
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
2289
2277
|
isOpen: e,
|
|
2290
2278
|
onOpenChange: s,
|
|
2291
|
-
children: /* @__PURE__ */
|
|
2279
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ Y(O.Dialog, { children: /* @__PURE__ */ X(P, {
|
|
2292
2280
|
onSubmit: (e) => {
|
|
2293
2281
|
e.preventDefault();
|
|
2294
2282
|
let t = new FormData(e.target).get("name")?.trim();
|
|
2295
2283
|
a(t ? { name: t } : void 0, { onSuccess: () => s(!1) });
|
|
2296
2284
|
},
|
|
2297
2285
|
children: [
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
2287
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
2300
2288
|
status: "default",
|
|
2301
|
-
children: /* @__PURE__ */
|
|
2302
|
-
}), /* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2289
|
+
children: /* @__PURE__ */ Y(Ie, {})
|
|
2290
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: i.addPasskey })] }),
|
|
2291
|
+
/* @__PURE__ */ X(O.Body, {
|
|
2304
2292
|
className: "overflow-visible",
|
|
2305
|
-
children: [/* @__PURE__ */
|
|
2293
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
2306
2294
|
className: "text-muted text-sm",
|
|
2307
2295
|
children: i.passkeysDescription
|
|
2308
|
-
}), /* @__PURE__ */
|
|
2296
|
+
}), /* @__PURE__ */ X(W, {
|
|
2309
2297
|
className: "mt-4",
|
|
2310
2298
|
id: "name",
|
|
2311
2299
|
name: "name",
|
|
2312
2300
|
isDisabled: o,
|
|
2313
2301
|
children: [
|
|
2314
|
-
/* @__PURE__ */
|
|
2315
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ Y(L, { children: i.name }),
|
|
2303
|
+
/* @__PURE__ */ Y(F, {
|
|
2316
2304
|
autoFocus: !0,
|
|
2317
2305
|
placeholder: r.settings.optional,
|
|
2318
2306
|
variant: "secondary"
|
|
2319
2307
|
}),
|
|
2320
|
-
/* @__PURE__ */
|
|
2308
|
+
/* @__PURE__ */ Y(N, {})
|
|
2321
2309
|
]
|
|
2322
2310
|
})]
|
|
2323
2311
|
}),
|
|
2324
|
-
/* @__PURE__ */
|
|
2312
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
2325
2313
|
slot: "close",
|
|
2326
2314
|
variant: "tertiary",
|
|
2327
2315
|
isDisabled: o,
|
|
2328
2316
|
children: r.settings.cancel
|
|
2329
|
-
}), /* @__PURE__ */
|
|
2317
|
+
}), /* @__PURE__ */ X(k, {
|
|
2330
2318
|
type: "submit",
|
|
2331
2319
|
isPending: o,
|
|
2332
|
-
children: [o && /* @__PURE__ */
|
|
2320
|
+
children: [o && /* @__PURE__ */ Y(V, {
|
|
2333
2321
|
color: "current",
|
|
2334
2322
|
size: "sm"
|
|
2335
2323
|
}), i.addPasskey]
|
|
@@ -2340,38 +2328,38 @@ function Dn({ isOpen: e, onOpenChange: t }) {
|
|
|
2340
2328
|
}
|
|
2341
2329
|
//#endregion
|
|
2342
2330
|
//#region src/components/auth/passkey/delete-passkey-dialog.tsx
|
|
2343
|
-
function
|
|
2344
|
-
let { authClient: r, localization: i } = p(), { localization: a } = m(
|
|
2345
|
-
return /* @__PURE__ */
|
|
2331
|
+
function Tn({ isOpen: e, onOpenChange: t, passkey: n }) {
|
|
2332
|
+
let { authClient: r, localization: i } = p(), { localization: a } = m(Cn), o = n.name || a.passkey, { mutate: s, isPending: c } = S(r, { onSuccess: () => t(!1) });
|
|
2333
|
+
return /* @__PURE__ */ Y(O.Backdrop, {
|
|
2346
2334
|
isOpen: e,
|
|
2347
2335
|
onOpenChange: t,
|
|
2348
|
-
children: /* @__PURE__ */
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */
|
|
2336
|
+
children: /* @__PURE__ */ Y(O.Container, { children: /* @__PURE__ */ X(O.Dialog, { children: [
|
|
2337
|
+
/* @__PURE__ */ Y(O.CloseTrigger, {}),
|
|
2338
|
+
/* @__PURE__ */ X(O.Header, { children: [/* @__PURE__ */ Y(O.Icon, {
|
|
2351
2339
|
status: "danger",
|
|
2352
|
-
children: /* @__PURE__ */
|
|
2353
|
-
}), /* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2340
|
+
children: /* @__PURE__ */ Y(Ie, {})
|
|
2341
|
+
}), /* @__PURE__ */ Y(O.Heading, { children: a.deletePasskeyTitle })] }),
|
|
2342
|
+
/* @__PURE__ */ X(O.Body, {
|
|
2355
2343
|
className: "flex flex-col gap-4 overflow-visible",
|
|
2356
|
-
children: [/* @__PURE__ */
|
|
2344
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
2357
2345
|
className: "text-muted text-sm",
|
|
2358
2346
|
children: a.deletePasskeyWarning
|
|
2359
|
-
}), /* @__PURE__ */
|
|
2347
|
+
}), /* @__PURE__ */ X(W, {
|
|
2360
2348
|
value: o,
|
|
2361
2349
|
variant: "secondary",
|
|
2362
|
-
children: [/* @__PURE__ */
|
|
2350
|
+
children: [/* @__PURE__ */ Y(L, { children: n.name || a.passkey }), /* @__PURE__ */ Y(F, { readOnly: !0 })]
|
|
2363
2351
|
})]
|
|
2364
2352
|
}),
|
|
2365
|
-
/* @__PURE__ */
|
|
2353
|
+
/* @__PURE__ */ X(O.Footer, { children: [/* @__PURE__ */ Y(k, {
|
|
2366
2354
|
slot: "close",
|
|
2367
2355
|
variant: "tertiary",
|
|
2368
2356
|
isDisabled: c,
|
|
2369
2357
|
children: i.settings.cancel
|
|
2370
|
-
}), /* @__PURE__ */
|
|
2358
|
+
}), /* @__PURE__ */ X(k, {
|
|
2371
2359
|
variant: "danger",
|
|
2372
2360
|
onPress: () => s({ id: n.id }),
|
|
2373
2361
|
isPending: c,
|
|
2374
|
-
children: [c && /* @__PURE__ */
|
|
2362
|
+
children: [c && /* @__PURE__ */ Y(V, {
|
|
2375
2363
|
color: "current",
|
|
2376
2364
|
size: "sm"
|
|
2377
2365
|
}), a.deletePasskeyTitle]
|
|
@@ -2381,21 +2369,21 @@ function On({ isOpen: e, onOpenChange: t, passkey: n }) {
|
|
|
2381
2369
|
}
|
|
2382
2370
|
//#endregion
|
|
2383
2371
|
//#region src/components/auth/passkey/passkey.tsx
|
|
2384
|
-
function
|
|
2385
|
-
let { localization: t } = p(), { localization: n } = m(
|
|
2386
|
-
return /* @__PURE__ */
|
|
2372
|
+
function En({ passkey: e }) {
|
|
2373
|
+
let { localization: t } = p(), { localization: n } = m(Cn), [r, i] = q(!1), a = e.name || n.passkey;
|
|
2374
|
+
return /* @__PURE__ */ X("div", {
|
|
2387
2375
|
className: "flex items-center gap-3",
|
|
2388
2376
|
children: [
|
|
2389
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ Y("div", {
|
|
2390
2378
|
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
2391
|
-
children: /* @__PURE__ */
|
|
2379
|
+
children: /* @__PURE__ */ Y(Ie, { className: "size-4.5" })
|
|
2392
2380
|
}),
|
|
2393
|
-
/* @__PURE__ */
|
|
2381
|
+
/* @__PURE__ */ X("div", {
|
|
2394
2382
|
className: "flex min-w-0 flex-col",
|
|
2395
|
-
children: [/* @__PURE__ */
|
|
2383
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
2396
2384
|
className: "truncate text-sm font-medium leading-tight",
|
|
2397
2385
|
children: a
|
|
2398
|
-
}), /* @__PURE__ */
|
|
2386
|
+
}), /* @__PURE__ */ Y("span", {
|
|
2399
2387
|
className: "text-xs text-muted",
|
|
2400
2388
|
children: new Date(e.createdAt).toLocaleString(void 0, {
|
|
2401
2389
|
dateStyle: "medium",
|
|
@@ -2403,15 +2391,15 @@ function kn({ passkey: e }) {
|
|
|
2403
2391
|
})
|
|
2404
2392
|
})]
|
|
2405
2393
|
}),
|
|
2406
|
-
/* @__PURE__ */
|
|
2394
|
+
/* @__PURE__ */ X(k, {
|
|
2407
2395
|
className: "ml-auto shrink-0",
|
|
2408
2396
|
variant: "outline",
|
|
2409
2397
|
size: "sm",
|
|
2410
2398
|
onPress: () => i(!0),
|
|
2411
2399
|
"aria-label": n.deletePasskey.replace("{{name}}", a),
|
|
2412
|
-
children: [/* @__PURE__ */
|
|
2400
|
+
children: [/* @__PURE__ */ Y(D, {}), t.settings.delete]
|
|
2413
2401
|
}),
|
|
2414
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ Y(Tn, {
|
|
2415
2403
|
isOpen: r,
|
|
2416
2404
|
onOpenChange: i,
|
|
2417
2405
|
passkey: e
|
|
@@ -2421,40 +2409,40 @@ function kn({ passkey: e }) {
|
|
|
2421
2409
|
}
|
|
2422
2410
|
//#endregion
|
|
2423
2411
|
//#region src/components/auth/passkey/passkey-skeleton.tsx
|
|
2424
|
-
function
|
|
2425
|
-
return /* @__PURE__ */
|
|
2412
|
+
function Dn() {
|
|
2413
|
+
return /* @__PURE__ */ Y("div", {
|
|
2426
2414
|
className: "flex items-center justify-between",
|
|
2427
|
-
children: /* @__PURE__ */
|
|
2415
|
+
children: /* @__PURE__ */ X("div", {
|
|
2428
2416
|
className: "flex items-center gap-3",
|
|
2429
|
-
children: [/* @__PURE__ */
|
|
2417
|
+
children: [/* @__PURE__ */ Y(B, { className: "size-10 rounded-xl" }), /* @__PURE__ */ X("div", {
|
|
2430
2418
|
className: "flex flex-col gap-1",
|
|
2431
|
-
children: [/* @__PURE__ */
|
|
2419
|
+
children: [/* @__PURE__ */ Y(B, { className: "h-4 w-28 rounded-lg" }), /* @__PURE__ */ Y(B, { className: "h-3 w-32 rounded-lg" })]
|
|
2432
2420
|
})]
|
|
2433
2421
|
})
|
|
2434
2422
|
});
|
|
2435
2423
|
}
|
|
2436
2424
|
//#endregion
|
|
2437
2425
|
//#region src/components/auth/passkey/passkeys-empty.tsx
|
|
2438
|
-
function
|
|
2439
|
-
let { localization: t } = m(
|
|
2440
|
-
return /* @__PURE__ */
|
|
2426
|
+
function On({ onAddPress: e }) {
|
|
2427
|
+
let { localization: t } = m(Cn);
|
|
2428
|
+
return /* @__PURE__ */ X("div", {
|
|
2441
2429
|
className: "flex flex-col items-center justify-center gap-4",
|
|
2442
2430
|
children: [
|
|
2443
|
-
/* @__PURE__ */
|
|
2431
|
+
/* @__PURE__ */ Y("div", {
|
|
2444
2432
|
className: "flex size-10 items-center justify-center rounded-xl bg-surface-secondary",
|
|
2445
|
-
children: /* @__PURE__ */
|
|
2433
|
+
children: /* @__PURE__ */ Y(Ie, { className: "size-4.5" })
|
|
2446
2434
|
}),
|
|
2447
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ X("div", {
|
|
2448
2436
|
className: "flex flex-col items-center justify-center gap-1 text-center",
|
|
2449
|
-
children: [/* @__PURE__ */
|
|
2437
|
+
children: [/* @__PURE__ */ Y("p", {
|
|
2450
2438
|
className: "text-sm font-semibold",
|
|
2451
2439
|
children: t.noPasskeys
|
|
2452
|
-
}), /* @__PURE__ */
|
|
2440
|
+
}), /* @__PURE__ */ Y("p", {
|
|
2453
2441
|
className: "text-muted text-xs",
|
|
2454
2442
|
children: t.passkeysDescription
|
|
2455
2443
|
})]
|
|
2456
2444
|
}),
|
|
2457
|
-
/* @__PURE__ */
|
|
2445
|
+
/* @__PURE__ */ Y(k, {
|
|
2458
2446
|
size: "sm",
|
|
2459
2447
|
onPress: e,
|
|
2460
2448
|
children: t.addPasskey
|
|
@@ -2464,17 +2452,17 @@ function jn({ onAddPress: e }) {
|
|
|
2464
2452
|
}
|
|
2465
2453
|
//#endregion
|
|
2466
2454
|
//#region src/components/auth/passkey/passkeys.tsx
|
|
2467
|
-
function
|
|
2468
|
-
let { authClient: r } = p(), { localization: i } = m(
|
|
2469
|
-
return /* @__PURE__ */
|
|
2470
|
-
className:
|
|
2455
|
+
function kn({ className: e, variant: t, ...n }) {
|
|
2456
|
+
let { authClient: r } = p(), { localization: i } = m(Cn), { data: a, isPending: o } = le(r), [s, c] = q(!1);
|
|
2457
|
+
return /* @__PURE__ */ X("div", {
|
|
2458
|
+
className: G("flex flex-col gap-3", e),
|
|
2471
2459
|
children: [
|
|
2472
|
-
/* @__PURE__ */
|
|
2460
|
+
/* @__PURE__ */ X("div", {
|
|
2473
2461
|
className: "flex items-end justify-between gap-3",
|
|
2474
|
-
children: [/* @__PURE__ */
|
|
2462
|
+
children: [/* @__PURE__ */ Y("h2", {
|
|
2475
2463
|
className: "text-sm font-semibold truncate",
|
|
2476
2464
|
children: i.passkeys
|
|
2477
|
-
}), /* @__PURE__ */
|
|
2465
|
+
}), /* @__PURE__ */ Y(k, {
|
|
2478
2466
|
className: "shrink-0",
|
|
2479
2467
|
size: "sm",
|
|
2480
2468
|
isDisabled: o,
|
|
@@ -2482,12 +2470,12 @@ function Mn({ className: e, variant: t, ...n }) {
|
|
|
2482
2470
|
children: i.addPasskey
|
|
2483
2471
|
})]
|
|
2484
2472
|
}),
|
|
2485
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ Y(A, {
|
|
2486
2474
|
variant: t,
|
|
2487
2475
|
...n,
|
|
2488
|
-
children: /* @__PURE__ */
|
|
2476
|
+
children: /* @__PURE__ */ Y(A.Content, { children: o ? /* @__PURE__ */ Y(Dn, {}) : a?.length ? a.map((e, t) => /* @__PURE__ */ X("div", { children: [t > 0 && /* @__PURE__ */ Y("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Y(En, { passkey: e })] }, e.id)) : /* @__PURE__ */ Y(On, { onAddPress: () => c(!0) }) })
|
|
2489
2477
|
}),
|
|
2490
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ Y(wn, {
|
|
2491
2479
|
isOpen: s,
|
|
2492
2480
|
onOpenChange: c
|
|
2493
2481
|
})
|
|
@@ -2496,23 +2484,23 @@ function Mn({ className: e, variant: t, ...n }) {
|
|
|
2496
2484
|
}
|
|
2497
2485
|
//#endregion
|
|
2498
2486
|
//#region src/components/auth/theme/theme-toggle-item.tsx
|
|
2499
|
-
var
|
|
2500
|
-
function
|
|
2501
|
-
let { useTheme: e, localization: t } = m(
|
|
2502
|
-
return /* @__PURE__ */
|
|
2487
|
+
var An = "[role=\"tab\"][aria-selected=\"true\"]";
|
|
2488
|
+
function jn() {
|
|
2489
|
+
let { useTheme: e, localization: t } = m(Mn), { theme: n, setTheme: r, themes: i = [] } = e();
|
|
2490
|
+
return /* @__PURE__ */ X(M.Item, {
|
|
2503
2491
|
className: "py-1 pe-2",
|
|
2504
2492
|
onFocus: (e) => {
|
|
2505
|
-
e.target === e.currentTarget && e.currentTarget.querySelector(
|
|
2493
|
+
e.target === e.currentTarget && e.currentTarget.querySelector(An)?.focus({ preventScroll: !0 });
|
|
2506
2494
|
},
|
|
2507
2495
|
shouldCloseOnSelect: !1,
|
|
2508
2496
|
children: [
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ Y(He, { className: "text-muted" }),
|
|
2498
|
+
/* @__PURE__ */ Y(L, { children: t.theme }),
|
|
2499
|
+
/* @__PURE__ */ Y(U, {
|
|
2512
2500
|
className: "ml-auto",
|
|
2513
2501
|
selectedKey: n,
|
|
2514
2502
|
onSelectionChange: (e) => r(e),
|
|
2515
|
-
children: /* @__PURE__ */
|
|
2503
|
+
children: /* @__PURE__ */ Y(U.ListContainer, {
|
|
2516
2504
|
onKeyDown: (e) => {
|
|
2517
2505
|
if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
2518
2506
|
let t = e.target;
|
|
@@ -2524,24 +2512,24 @@ function Pn() {
|
|
|
2524
2512
|
let o = i[e.key === "ArrowDown" ? a + 1 : a - 1];
|
|
2525
2513
|
o && (e.preventDefault(), o.focus());
|
|
2526
2514
|
},
|
|
2527
|
-
children: /* @__PURE__ */
|
|
2515
|
+
children: /* @__PURE__ */ X(U.List, {
|
|
2528
2516
|
"aria-label": t.theme,
|
|
2529
2517
|
className: "*:h-5 *:w-5 *:p-0",
|
|
2530
2518
|
children: [
|
|
2531
|
-
i.includes("system") && /* @__PURE__ */
|
|
2519
|
+
i.includes("system") && /* @__PURE__ */ X(U.Tab, {
|
|
2532
2520
|
id: "system",
|
|
2533
2521
|
"aria-label": t.system,
|
|
2534
|
-
children: [/* @__PURE__ */
|
|
2522
|
+
children: [/* @__PURE__ */ Y(Ne, { className: "size-3" }), /* @__PURE__ */ Y(U.Indicator, {})]
|
|
2535
2523
|
}),
|
|
2536
|
-
i.includes("light") && /* @__PURE__ */
|
|
2524
|
+
i.includes("light") && /* @__PURE__ */ X(U.Tab, {
|
|
2537
2525
|
id: "light",
|
|
2538
2526
|
"aria-label": t.light,
|
|
2539
|
-
children: [/* @__PURE__ */
|
|
2527
|
+
children: [/* @__PURE__ */ Y(qe, { className: "size-3" }), /* @__PURE__ */ Y(U.Indicator, {})]
|
|
2540
2528
|
}),
|
|
2541
|
-
i.includes("dark") && /* @__PURE__ */
|
|
2529
|
+
i.includes("dark") && /* @__PURE__ */ X(U.Tab, {
|
|
2542
2530
|
id: "dark",
|
|
2543
2531
|
"aria-label": t.dark,
|
|
2544
|
-
children: [/* @__PURE__ */
|
|
2532
|
+
children: [/* @__PURE__ */ Y(Ve, { className: "size-3" }), /* @__PURE__ */ Y(U.Indicator, {})]
|
|
2545
2533
|
})
|
|
2546
2534
|
]
|
|
2547
2535
|
})
|
|
@@ -2552,8 +2540,8 @@ function Pn() {
|
|
|
2552
2540
|
}
|
|
2553
2541
|
//#endregion
|
|
2554
2542
|
//#region src/lib/auth/theme-plugin.ts
|
|
2555
|
-
var
|
|
2556
|
-
let n =
|
|
2543
|
+
var Mn = a(ht.id, ({ useTheme: e, ...t }) => {
|
|
2544
|
+
let n = ht({
|
|
2557
2545
|
setTheme: () => {},
|
|
2558
2546
|
...t
|
|
2559
2547
|
});
|
|
@@ -2564,69 +2552,69 @@ var Fn = a(_t.id, ({ useTheme: e, ...t }) => {
|
|
|
2564
2552
|
setTheme: n.setTheme,
|
|
2565
2553
|
themes: n.themes
|
|
2566
2554
|
})),
|
|
2567
|
-
userMenuItems: [
|
|
2568
|
-
accountCards: [
|
|
2555
|
+
userMenuItems: [jn],
|
|
2556
|
+
accountCards: [Nn]
|
|
2569
2557
|
};
|
|
2570
2558
|
});
|
|
2571
2559
|
//#endregion
|
|
2572
2560
|
//#region src/components/auth/theme/appearance.tsx
|
|
2573
|
-
function
|
|
2574
|
-
let { useTheme: r, localization: i } = m(
|
|
2575
|
-
return /* @__PURE__ */
|
|
2576
|
-
className:
|
|
2561
|
+
function Nn({ className: e, variant: t, ...n }) {
|
|
2562
|
+
let { useTheme: r, localization: i } = m(Mn), { theme: a, setTheme: o, themes: u = [] } = r(), d = it();
|
|
2563
|
+
return /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("h2", {
|
|
2564
|
+
className: G("text-sm font-semibold mb-3"),
|
|
2577
2565
|
children: i.appearance
|
|
2578
|
-
}), /* @__PURE__ */
|
|
2579
|
-
className:
|
|
2566
|
+
}), /* @__PURE__ */ Y(A, {
|
|
2567
|
+
className: G("p-4 gap-4", e),
|
|
2580
2568
|
variant: t,
|
|
2581
2569
|
...n,
|
|
2582
|
-
children: /* @__PURE__ */
|
|
2570
|
+
children: /* @__PURE__ */ X(A.Content, { children: [/* @__PURE__ */ Y(L, { children: i.theme }), /* @__PURE__ */ Y(nt, {
|
|
2583
2571
|
variant: t === "transparent" ? "secondary" : "primary",
|
|
2584
2572
|
value: d ? a : "",
|
|
2585
2573
|
onChange: o,
|
|
2586
2574
|
isDisabled: !d || !a,
|
|
2587
|
-
children: /* @__PURE__ */
|
|
2575
|
+
children: /* @__PURE__ */ X("div", {
|
|
2588
2576
|
className: "grid gap-3 grid-cols-2 sm:grid-cols-3",
|
|
2589
2577
|
children: [
|
|
2590
|
-
u.includes("system") && /* @__PURE__ */
|
|
2578
|
+
u.includes("system") && /* @__PURE__ */ Y(R, {
|
|
2591
2579
|
value: "system",
|
|
2592
|
-
className:
|
|
2593
|
-
children: /* @__PURE__ */
|
|
2580
|
+
className: G("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2581
|
+
children: /* @__PURE__ */ X(R.Content, {
|
|
2594
2582
|
className: "gap-2",
|
|
2595
|
-
children: [/* @__PURE__ */
|
|
2583
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2596
2584
|
className: "flex gap-2 justify-between",
|
|
2597
|
-
children: [/* @__PURE__ */
|
|
2585
|
+
children: [/* @__PURE__ */ X("span", {
|
|
2598
2586
|
className: "flex gap-2 items-center",
|
|
2599
|
-
children: [/* @__PURE__ */
|
|
2600
|
-
}), /* @__PURE__ */
|
|
2601
|
-
}), /* @__PURE__ */
|
|
2587
|
+
children: [/* @__PURE__ */ Y(Ne, { className: "text-muted" }), i.system]
|
|
2588
|
+
}), /* @__PURE__ */ Y(R.Control, { children: /* @__PURE__ */ Y(R.Indicator, {}) })]
|
|
2589
|
+
}), /* @__PURE__ */ Y(l, { className: "w-full" })]
|
|
2602
2590
|
})
|
|
2603
2591
|
}),
|
|
2604
|
-
u.includes("light") && /* @__PURE__ */
|
|
2592
|
+
u.includes("light") && /* @__PURE__ */ Y(R, {
|
|
2605
2593
|
value: "light",
|
|
2606
|
-
className:
|
|
2607
|
-
children: /* @__PURE__ */
|
|
2594
|
+
className: G("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2595
|
+
children: /* @__PURE__ */ X(R.Content, {
|
|
2608
2596
|
className: "gap-2",
|
|
2609
|
-
children: [/* @__PURE__ */
|
|
2597
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2610
2598
|
className: "flex gap-2 justify-between",
|
|
2611
|
-
children: [/* @__PURE__ */
|
|
2599
|
+
children: [/* @__PURE__ */ X("span", {
|
|
2612
2600
|
className: "flex gap-2 items-center",
|
|
2613
|
-
children: [/* @__PURE__ */
|
|
2614
|
-
}), /* @__PURE__ */
|
|
2615
|
-
}), /* @__PURE__ */
|
|
2601
|
+
children: [/* @__PURE__ */ Y(qe, { className: "text-muted" }), i.light]
|
|
2602
|
+
}), /* @__PURE__ */ Y(R.Control, { children: /* @__PURE__ */ Y(R.Indicator, {}) })]
|
|
2603
|
+
}), /* @__PURE__ */ Y(c, { className: "w-full" })]
|
|
2616
2604
|
})
|
|
2617
2605
|
}),
|
|
2618
|
-
u.includes("dark") && /* @__PURE__ */
|
|
2606
|
+
u.includes("dark") && /* @__PURE__ */ Y(R, {
|
|
2619
2607
|
value: "dark",
|
|
2620
|
-
className:
|
|
2621
|
-
children: /* @__PURE__ */
|
|
2608
|
+
className: G("mt-0 px-4 pb-4 pt-3 rounded-xl", "border border-transparent data-[selected=true]:border-accent data-[selected=true]:bg-accent/10", "data-[focus-visible=true]:border-accent data-[focus-visible=true]:bg-accent/10", t === "transparent" ? "bg-surface" : "bg-surface-secondary"),
|
|
2609
|
+
children: /* @__PURE__ */ X(R.Content, {
|
|
2622
2610
|
className: "gap-2",
|
|
2623
|
-
children: [/* @__PURE__ */
|
|
2611
|
+
children: [/* @__PURE__ */ X("div", {
|
|
2624
2612
|
className: "flex gap-2 justify-between",
|
|
2625
|
-
children: [/* @__PURE__ */
|
|
2613
|
+
children: [/* @__PURE__ */ X("span", {
|
|
2626
2614
|
className: "flex gap-2 items-center",
|
|
2627
|
-
children: [/* @__PURE__ */
|
|
2628
|
-
}), /* @__PURE__ */
|
|
2629
|
-
}), /* @__PURE__ */
|
|
2615
|
+
children: [/* @__PURE__ */ Y(Ve, { className: "text-muted" }), i.dark]
|
|
2616
|
+
}), /* @__PURE__ */ Y(R.Control, { children: /* @__PURE__ */ Y(R.Indicator, {}) })]
|
|
2617
|
+
}), /* @__PURE__ */ Y(s, { className: "w-full" })]
|
|
2630
2618
|
})
|
|
2631
2619
|
})
|
|
2632
2620
|
]
|
|
@@ -2636,8 +2624,8 @@ function In({ className: e, variant: t, ...n }) {
|
|
|
2636
2624
|
}
|
|
2637
2625
|
//#endregion
|
|
2638
2626
|
//#region src/components/auth/username/username-field.tsx
|
|
2639
|
-
function
|
|
2640
|
-
let { authClient: i } = p(), { localization: a, minUsernameLength: o, maxUsernameLength: s, isUsernameAvailable: c } = m(
|
|
2627
|
+
function Pn({ name: e, field: t, isPending: n, variant: r }) {
|
|
2628
|
+
let { authClient: i } = p(), { localization: a, minUsernameLength: o, maxUsernameLength: s, isUsernameAvailable: c } = m(Fn), l = String(t.defaultValue ?? ""), [u, d] = q(l), { mutate: f, data: h, error: g, reset: _ } = te(i, { onError: () => {} }), v = vt((e) => {
|
|
2641
2629
|
let t = e.trim();
|
|
2642
2630
|
if (!t || t === l) {
|
|
2643
2631
|
_();
|
|
@@ -2649,7 +2637,7 @@ function Ln({ name: e, field: t, isPending: n, variant: r }) {
|
|
|
2649
2637
|
d(e), _(), c && v.maybeExecute(e);
|
|
2650
2638
|
}
|
|
2651
2639
|
let b = !!c && !!u.trim() && u.trim() !== l, { localization: x } = p();
|
|
2652
|
-
return /* @__PURE__ */
|
|
2640
|
+
return /* @__PURE__ */ X(W, {
|
|
2653
2641
|
name: e,
|
|
2654
2642
|
type: "text",
|
|
2655
2643
|
autoComplete: "username",
|
|
@@ -2665,117 +2653,117 @@ function Ln({ name: e, field: t, isPending: n, variant: r }) {
|
|
|
2665
2653
|
if (s && e.length > s) return x.auth.tooLong.replace("{{max}}", String(s));
|
|
2666
2654
|
},
|
|
2667
2655
|
children: [
|
|
2668
|
-
/* @__PURE__ */
|
|
2669
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ Y(L, { children: t.label }),
|
|
2657
|
+
/* @__PURE__ */ X(I, {
|
|
2670
2658
|
variant: r === "transparent" ? "primary" : "secondary",
|
|
2671
|
-
children: [/* @__PURE__ */
|
|
2659
|
+
children: [/* @__PURE__ */ Y(I.Input, {
|
|
2672
2660
|
placeholder: t.placeholder,
|
|
2673
2661
|
required: t.required
|
|
2674
|
-
}), b && /* @__PURE__ */
|
|
2662
|
+
}), b && /* @__PURE__ */ Y(I.Suffix, {
|
|
2675
2663
|
"aria-label": h?.available ? a.usernameAvailable : h?.available === !1 ? a.usernameTaken : void 0,
|
|
2676
2664
|
className: "px-2",
|
|
2677
|
-
children: h?.available ? /* @__PURE__ */
|
|
2665
|
+
children: h?.available ? /* @__PURE__ */ Y(De, { className: "text-success" }) : g || h?.available === !1 ? /* @__PURE__ */ Y(D, { className: "text-danger" }) : /* @__PURE__ */ Y(V, {
|
|
2678
2666
|
size: "sm",
|
|
2679
2667
|
color: "current"
|
|
2680
2668
|
})
|
|
2681
2669
|
})]
|
|
2682
2670
|
}),
|
|
2683
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ Y(N, {})
|
|
2684
2672
|
]
|
|
2685
2673
|
});
|
|
2686
2674
|
}
|
|
2687
2675
|
//#endregion
|
|
2688
2676
|
//#region src/lib/auth/username-plugin.tsx
|
|
2689
|
-
var
|
|
2690
|
-
let t =
|
|
2677
|
+
var Fn = a(gt.id, (e = {}) => {
|
|
2678
|
+
let t = gt(e);
|
|
2691
2679
|
return {
|
|
2692
2680
|
...t,
|
|
2693
2681
|
additionalFields: t.additionalFields?.map((e) => e.name === "username" ? {
|
|
2694
2682
|
...e,
|
|
2695
|
-
render:
|
|
2683
|
+
render: Pn
|
|
2696
2684
|
} : e),
|
|
2697
|
-
views: { auth: { signIn:
|
|
2685
|
+
views: { auth: { signIn: In } }
|
|
2698
2686
|
};
|
|
2699
2687
|
});
|
|
2700
2688
|
//#endregion
|
|
2701
2689
|
//#region src/components/auth/username/sign-in-username.tsx
|
|
2702
|
-
function
|
|
2703
|
-
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _, navigate: v } = p(), { fetchOptions: y, resetFetchOptions: b } =
|
|
2704
|
-
function
|
|
2690
|
+
function In({ className: n, socialLayout: i, socialPosition: a = "bottom", variant: o }) {
|
|
2691
|
+
let { authClient: s, basePaths: c, baseURL: l, emailAndPassword: u, localization: d, plugins: f, redirectTo: h, socialProviders: g, viewPaths: _, navigate: v } = p(), { fetchOptions: y, resetFetchOptions: b } = w(), { localization: x } = m(Fn), [S, C] = q(""), { mutate: T } = me(s, { onSuccess: () => K.success(d.auth.verificationEmailSent) });
|
|
2692
|
+
function ee(e) {
|
|
2705
2693
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
2706
2694
|
}
|
|
2707
|
-
let { mutate:
|
|
2695
|
+
let { mutate: te, isPending: ne } = _e(s, {
|
|
2708
2696
|
onError: (e, { email: t }) => {
|
|
2709
|
-
C(""), e.error?.code === "EMAIL_NOT_VERIFIED" &&
|
|
2697
|
+
C(""), e.error?.code === "EMAIL_NOT_VERIFIED" && K.danger(e.error?.message || e.message, { actionProps: {
|
|
2710
2698
|
children: d.auth.resend,
|
|
2711
|
-
onClick: () =>
|
|
2699
|
+
onClick: () => T({
|
|
2712
2700
|
email: t,
|
|
2713
2701
|
callbackURL: `${l}${h}`
|
|
2714
2702
|
})
|
|
2715
2703
|
} }), b();
|
|
2716
2704
|
},
|
|
2717
2705
|
onSuccess: () => v({ to: h })
|
|
2718
|
-
}), { mutate:
|
|
2706
|
+
}), { mutate: re, isPending: ie } = be(s, {
|
|
2719
2707
|
onError: () => {
|
|
2720
2708
|
C(""), b();
|
|
2721
2709
|
},
|
|
2722
2710
|
onSuccess: () => v({ to: h })
|
|
2723
|
-
}),
|
|
2711
|
+
}), ae = (e) => {
|
|
2724
2712
|
e.preventDefault();
|
|
2725
2713
|
let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
|
|
2726
|
-
|
|
2714
|
+
ee(n) ? te({
|
|
2727
2715
|
email: n,
|
|
2728
2716
|
password: S,
|
|
2729
2717
|
...u?.rememberMe ? { rememberMe: r } : {},
|
|
2730
2718
|
fetchOptions: y
|
|
2731
|
-
}) :
|
|
2719
|
+
}) : re({
|
|
2732
2720
|
username: n,
|
|
2733
2721
|
password: S,
|
|
2734
2722
|
...u?.rememberMe ? { rememberMe: r } : {},
|
|
2735
2723
|
fetchOptions: y
|
|
2736
2724
|
});
|
|
2737
|
-
},
|
|
2738
|
-
return /* @__PURE__ */
|
|
2739
|
-
className:
|
|
2725
|
+
}, oe = Z({ mutationKey: r.signIn.all }) + Z({ mutationKey: r.signUp.all }) > 0, se = ne || ie, ce = f.find((e) => e.captchaComponent)?.captchaComponent, le = u?.enabled && !!g?.length;
|
|
2726
|
+
return /* @__PURE__ */ X(A, {
|
|
2727
|
+
className: G("w-full max-w-sm gap-4 md:p-6", n),
|
|
2740
2728
|
variant: o,
|
|
2741
2729
|
children: [
|
|
2742
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ Y(A.Header, { children: /* @__PURE__ */ Y(A.Title, {
|
|
2743
2731
|
className: "text-xl font-semibold mb-1",
|
|
2744
2732
|
children: d.auth.signIn
|
|
2745
2733
|
}) }),
|
|
2746
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ X(A.Content, {
|
|
2747
2735
|
className: "gap-4",
|
|
2748
2736
|
children: [
|
|
2749
|
-
a === "top" && /* @__PURE__ */
|
|
2750
|
-
u?.enabled && /* @__PURE__ */
|
|
2751
|
-
onSubmit:
|
|
2737
|
+
a === "top" && /* @__PURE__ */ X(J, { children: [!!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i }), le && /* @__PURE__ */ Y(e, { children: d.auth.or })] }),
|
|
2738
|
+
u?.enabled && /* @__PURE__ */ X(P, {
|
|
2739
|
+
onSubmit: ae,
|
|
2752
2740
|
className: "flex flex-col gap-4",
|
|
2753
2741
|
children: [
|
|
2754
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ X(W, {
|
|
2755
2743
|
name: "email",
|
|
2756
2744
|
type: "text",
|
|
2757
2745
|
autoComplete: "username email",
|
|
2758
|
-
isDisabled:
|
|
2746
|
+
isDisabled: oe,
|
|
2759
2747
|
validate: (e) => {
|
|
2760
2748
|
if (!e) return d.auth.fieldRequired;
|
|
2761
2749
|
},
|
|
2762
2750
|
children: [
|
|
2763
|
-
/* @__PURE__ */
|
|
2764
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ Y(L, { children: x.username }),
|
|
2752
|
+
/* @__PURE__ */ Y(F, {
|
|
2765
2753
|
placeholder: x.usernameOrEmailPlaceholder,
|
|
2766
2754
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2767
2755
|
required: !0
|
|
2768
2756
|
}),
|
|
2769
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ Y(N, {})
|
|
2770
2758
|
]
|
|
2771
2759
|
}),
|
|
2772
|
-
/* @__PURE__ */
|
|
2760
|
+
/* @__PURE__ */ X(W, {
|
|
2773
2761
|
minLength: u?.minPasswordLength,
|
|
2774
2762
|
maxLength: u?.maxPasswordLength,
|
|
2775
2763
|
name: "password",
|
|
2776
2764
|
type: "password",
|
|
2777
2765
|
autoComplete: "current-password",
|
|
2778
|
-
isDisabled:
|
|
2766
|
+
isDisabled: oe,
|
|
2779
2767
|
value: S,
|
|
2780
2768
|
onChange: C,
|
|
2781
2769
|
validate: (e) => {
|
|
@@ -2785,54 +2773,54 @@ function zn({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
2785
2773
|
if (n && e.length > n) return d.auth.tooLong.replace("{{max}}", String(n));
|
|
2786
2774
|
},
|
|
2787
2775
|
children: [
|
|
2788
|
-
/* @__PURE__ */
|
|
2789
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ Y(L, { children: d.auth.password }),
|
|
2777
|
+
/* @__PURE__ */ Y(F, {
|
|
2790
2778
|
placeholder: d.auth.passwordPlaceholder,
|
|
2791
2779
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2792
2780
|
required: !0
|
|
2793
2781
|
}),
|
|
2794
|
-
/* @__PURE__ */
|
|
2782
|
+
/* @__PURE__ */ Y(N, {})
|
|
2795
2783
|
]
|
|
2796
2784
|
}),
|
|
2797
|
-
u?.rememberMe && /* @__PURE__ */ Y(
|
|
2785
|
+
u?.rememberMe && /* @__PURE__ */ Y(Ze, {
|
|
2798
2786
|
name: "rememberMe",
|
|
2799
|
-
isDisabled:
|
|
2787
|
+
isDisabled: oe,
|
|
2800
2788
|
variant: o === "transparent" ? "primary" : "secondary",
|
|
2801
|
-
children:
|
|
2789
|
+
children: /* @__PURE__ */ X(Ze.Content, { children: [/* @__PURE__ */ Y(Ze.Control, { children: /* @__PURE__ */ Y(Ze.Indicator, {}) }), d.auth.rememberMe] })
|
|
2802
2790
|
}),
|
|
2803
|
-
|
|
2791
|
+
ce && /* @__PURE__ */ Y("div", {
|
|
2804
2792
|
className: "flex justify-center",
|
|
2805
|
-
children:
|
|
2793
|
+
children: ce
|
|
2806
2794
|
}),
|
|
2807
|
-
/* @__PURE__ */
|
|
2795
|
+
/* @__PURE__ */ X("div", {
|
|
2808
2796
|
className: "flex flex-col gap-3",
|
|
2809
|
-
children: [/* @__PURE__ */
|
|
2797
|
+
children: [/* @__PURE__ */ X(k, {
|
|
2810
2798
|
type: "submit",
|
|
2811
2799
|
className: "w-full",
|
|
2812
|
-
isPending:
|
|
2813
|
-
children: [
|
|
2800
|
+
isPending: se || oe,
|
|
2801
|
+
children: [se && /* @__PURE__ */ Y(V, {
|
|
2814
2802
|
color: "current",
|
|
2815
2803
|
size: "sm"
|
|
2816
2804
|
}), d.auth.signIn]
|
|
2817
|
-
}), f.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */
|
|
2805
|
+
}), f.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ Y(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
|
|
2818
2806
|
})
|
|
2819
2807
|
]
|
|
2820
2808
|
}),
|
|
2821
|
-
a === "bottom" && /* @__PURE__ */
|
|
2809
|
+
a === "bottom" && /* @__PURE__ */ X(J, { children: [le && /* @__PURE__ */ Y(e, { children: d.auth.or }), !!g?.length && /* @__PURE__ */ Y(t, { socialLayout: i })] })
|
|
2822
2810
|
]
|
|
2823
2811
|
}),
|
|
2824
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ X(A.Footer, {
|
|
2825
2813
|
className: "flex-col gap-3",
|
|
2826
|
-
children: [u?.enabled && u?.forgotPassword && /* @__PURE__ */
|
|
2814
|
+
children: [u?.enabled && u?.forgotPassword && /* @__PURE__ */ Y(et, {
|
|
2827
2815
|
href: `${c.auth}/${_.auth.forgotPassword}`,
|
|
2828
|
-
className: "no-underline hover:underline",
|
|
2816
|
+
className: "text-sm no-underline hover:underline",
|
|
2829
2817
|
children: d.auth.forgotPasswordLink
|
|
2830
|
-
}), u?.enabled && /* @__PURE__ */
|
|
2818
|
+
}), u?.enabled && /* @__PURE__ */ X(Qe, {
|
|
2831
2819
|
className: "text-sm",
|
|
2832
2820
|
children: [
|
|
2833
2821
|
d.auth.needToCreateAnAccount,
|
|
2834
2822
|
" ",
|
|
2835
|
-
/* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ Y(et, {
|
|
2836
2824
|
href: `${c.auth}/${_.auth.signUp}`,
|
|
2837
2825
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
2838
2826
|
children: d.auth.signUp
|
|
@@ -2844,4 +2832,4 @@ function zn({ className: n, socialLayout: i, socialPosition: a = "bottom", varia
|
|
|
2844
2832
|
});
|
|
2845
2833
|
}
|
|
2846
2834
|
//#endregion
|
|
2847
|
-
export {
|
|
2835
|
+
export { Dt as ApiKeys, Nn as Appearance, $t as ChangeOrganizationLogo, Ht as CreateOrganizationDialog, At as DangerZone, kt as DeleteAccount, nn as DeleteOrganization, tn as DeleteOrganizationSkeleton, an as InviteMemberDialog, sn as LeaveOrganization, Nt as MagicLink, zt as ManageAccount, Pt as ManageAccounts, bn as Organization, yt as OrganizationApiKeys, _n as OrganizationDangerZone, dn as OrganizationInvitations, un as OrganizationInvitationsEmpty, Ut as OrganizationLogo, hn as OrganizationMembers, gn as OrganizationPeople, vn as OrganizationProfile, Gt as OrganizationRow, yn as OrganizationSettings, xn as OrganizationSwitcher, Q as OrganizationView, Wt as OrganizationViewSkeleton, qt as Organizations, Qt as OrganizationsSettings, kn as Passkeys, In as SignInUsername, Lt as SwitchAccountSubmenu, It as SwitchAccountSubmenuContent, Ft as SwitchAccountSubmenuItem, jn as ThemeToggleItem, Zt as UserInvitations, Pn as UsernameField, bt as apiKeyPlugin, Ot as deleteUserPlugin, Mt as magicLinkPlugin, Rt as multiSessionPlugin, $ as organizationPlugin, Cn as passkeyPlugin, Mn as themePlugin, Fn as usernamePlugin };
|