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