@better-auth-ui/heroui 1.6.9 → 1.6.11
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/additional-field.d.ts +2 -2
- package/dist/components/auth/api-key/api-key.d.ts +1 -1
- package/dist/components/auth/api-key/api-keys.d.ts +1 -1
- package/dist/components/auth/api-key/delete-api-key-dialog.d.ts +1 -1
- package/dist/components/auth/api-key/organization-api-keys.d.ts +1 -1
- package/dist/components/auth/auth-provider.d.ts +1 -1
- package/dist/components/auth/auth.d.ts +3 -3
- package/dist/components/auth/delete-user/danger-zone.d.ts +2 -2
- package/dist/components/auth/delete-user/delete-account.d.ts +1 -1
- package/dist/components/auth/email/email-changed-email.d.ts +2 -2
- package/dist/components/auth/email/email-verification-email.d.ts +2 -2
- package/dist/components/auth/email/magic-link-email.d.ts +2 -2
- package/dist/components/auth/email/new-device-email.d.ts +2 -2
- package/dist/components/auth/email/organization-invitation-email.d.ts +2 -2
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/password-changed-email.d.ts +2 -2
- package/dist/components/auth/email/reset-password-email.d.ts +2 -2
- package/dist/components/auth/field-separator.d.ts +1 -1
- package/dist/components/auth/forgot-password.d.ts +1 -1
- package/dist/components/auth/magic-link/magic-link-button.d.ts +1 -1
- package/dist/components/auth/magic-link/magic-link.d.ts +2 -2
- package/dist/components/auth/multi-session/manage-account.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-accounts.d.ts +1 -1
- package/dist/components/auth/multi-session/switch-account-submenu-item.d.ts +1 -1
- package/dist/components/auth/organization/delete-organization-dialog.d.ts +1 -1
- package/dist/components/auth/organization/leave-organization-dialog.d.ts +1 -1
- package/dist/components/auth/organization/organization-danger-zone.d.ts +2 -2
- package/dist/components/auth/organization/organization-invitation-row.d.ts +1 -1
- package/dist/components/auth/organization/organization-invitations.d.ts +1 -1
- package/dist/components/auth/organization/organization-logo.d.ts +3 -3
- package/dist/components/auth/organization/organization-member-row.d.ts +1 -1
- package/dist/components/auth/organization/organization-members.d.ts +1 -1
- package/dist/components/auth/organization/organization-people.d.ts +1 -1
- package/dist/components/auth/organization/organization-profile.d.ts +1 -1
- package/dist/components/auth/organization/organization-row.d.ts +1 -1
- package/dist/components/auth/organization/organization-settings.d.ts +2 -2
- package/dist/components/auth/organization/organization-switcher.d.ts +3 -3
- package/dist/components/auth/organization/organization-view-skeleton.d.ts +2 -2
- package/dist/components/auth/organization/organization-view.d.ts +3 -3
- package/dist/components/auth/organization/organization.d.ts +3 -3
- package/dist/components/auth/organization/organizations-settings.d.ts +2 -2
- package/dist/components/auth/organization/organizations.d.ts +1 -1
- package/dist/components/auth/organization/remove-member-dialog.d.ts +1 -1
- package/dist/components/auth/organization/slug-field.d.ts +1 -1
- package/dist/components/auth/organization/user-invitation-row.d.ts +1 -1
- package/dist/components/auth/organization/user-invitations.d.ts +1 -1
- package/dist/components/auth/passkey/passkey-button.d.ts +1 -1
- package/dist/components/auth/passkey/passkey.d.ts +1 -1
- package/dist/components/auth/passkey/passkeys.d.ts +1 -1
- package/dist/components/auth/provider-button.d.ts +2 -2
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/settings/account/account-settings.d.ts +2 -2
- package/dist/components/auth/settings/account/change-email.d.ts +1 -1
- package/dist/components/auth/settings/account/user-profile.d.ts +1 -1
- package/dist/components/auth/settings/security/active-session.d.ts +1 -1
- package/dist/components/auth/settings/security/active-sessions.d.ts +1 -1
- package/dist/components/auth/settings/security/change-password.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-account.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-accounts.d.ts +1 -1
- package/dist/components/auth/settings/security/security-settings.d.ts +2 -2
- package/dist/components/auth/settings/settings.d.ts +3 -3
- package/dist/components/auth/sign-in.d.ts +2 -2
- package/dist/components/auth/sign-up.d.ts +2 -2
- package/dist/components/auth/theme/appearance.d.ts +1 -1
- package/dist/components/auth/user/user-avatar.d.ts +3 -3
- package/dist/components/auth/user/user-button.d.ts +2 -2
- package/dist/components/auth/user/user-view.d.ts +3 -3
- package/dist/components/auth/username/sign-in-username.d.ts +2 -2
- package/dist/components/auth/username/username-field.d.ts +1 -1
- package/dist/email.d.ts +8 -8
- package/dist/email.js +211 -8
- package/dist/index.d.ts +21 -21
- package/dist/index.js +3393 -21
- package/dist/lib/auth/api-key-plugin.d.ts +3 -3
- package/dist/lib/auth/auth-plugin.d.ts +5 -5
- package/dist/lib/auth/delete-user-plugin.d.ts +2 -2
- package/dist/lib/auth/magic-link-plugin.d.ts +3 -3
- package/dist/lib/auth/multi-session-plugin.d.ts +3 -3
- package/dist/lib/auth/organization-plugin.d.ts +2 -2
- package/dist/lib/auth/passkey-plugin.d.ts +3 -3
- package/dist/lib/auth/theme-plugin.d.ts +3 -3
- package/dist/lib/auth/username-plugin.d.ts +3 -3
- package/dist/plugins.d.ts +46 -46
- package/dist/plugins.js +2824 -47
- package/dist/user-view--47tVtJ3.js +113 -0
- package/package.json +3 -5
- package/dist/components/auth/additional-field.js +0 -137
- package/dist/components/auth/api-key/api-key-skeleton.js +0 -5
- package/dist/components/auth/api-key/api-key.js +0 -17
- package/dist/components/auth/api-key/api-keys-empty.js +0 -9
- package/dist/components/auth/api-key/api-keys.js +0 -22
- package/dist/components/auth/api-key/create-api-key-dialog.js +0 -44
- package/dist/components/auth/api-key/delete-api-key-dialog.js +0 -17
- package/dist/components/auth/api-key/new-api-key-dialog.js +0 -24
- package/dist/components/auth/api-key/organization-api-keys.js +0 -22
- package/dist/components/auth/auth-provider.js +0 -11
- package/dist/components/auth/auth.js +0 -88
- package/dist/components/auth/delete-user/danger-zone.js +0 -12
- package/dist/components/auth/delete-user/delete-account.js +0 -50
- package/dist/components/auth/email/email-changed-email.js +0 -23
- package/dist/components/auth/email/email-verification-email.js +0 -23
- package/dist/components/auth/email/magic-link-email.js +0 -23
- package/dist/components/auth/email/new-device-email.js +0 -23
- package/dist/components/auth/email/organization-invitation-email.js +0 -23
- package/dist/components/auth/email/otp-email.js +0 -22
- package/dist/components/auth/email/password-changed-email.js +0 -23
- package/dist/components/auth/email/reset-password-email.js +0 -23
- package/dist/components/auth/error-toaster.js +0 -33
- package/dist/components/auth/field-separator.js +0 -5
- package/dist/components/auth/forgot-password.js +0 -37
- package/dist/components/auth/magic-link/magic-link-button.js +0 -34
- package/dist/components/auth/magic-link/magic-link.js +0 -40
- package/dist/components/auth/multi-session/manage-account.js +0 -33
- package/dist/components/auth/multi-session/manage-accounts.js +0 -33
- package/dist/components/auth/multi-session/switch-account-submenu-content.js +0 -25
- package/dist/components/auth/multi-session/switch-account-submenu-item.js +0 -17
- package/dist/components/auth/multi-session/switch-account-submenu.js +0 -24
- package/dist/components/auth/organization/change-organization-logo.js +0 -69
- package/dist/components/auth/organization/create-organization-dialog.js +0 -37
- package/dist/components/auth/organization/delete-organization-dialog.js +0 -25
- package/dist/components/auth/organization/delete-organization-skeleton.js +0 -8
- package/dist/components/auth/organization/delete-organization.js +0 -27
- package/dist/components/auth/organization/invite-member-dialog.js +0 -47
- package/dist/components/auth/organization/leave-organization-dialog.js +0 -21
- package/dist/components/auth/organization/leave-organization.js +0 -16
- package/dist/components/auth/organization/organization-danger-zone.js +0 -23
- package/dist/components/auth/organization/organization-invitation-row-skeleton.js +0 -9
- package/dist/components/auth/organization/organization-invitation-row.js +0 -31
- package/dist/components/auth/organization/organization-invitations-empty.js +0 -13
- package/dist/components/auth/organization/organization-invitations.js +0 -66
- package/dist/components/auth/organization/organization-logo.js +0 -14
- package/dist/components/auth/organization/organization-member-row-skeleton.js +0 -9
- package/dist/components/auth/organization/organization-member-row.js +0 -34
- package/dist/components/auth/organization/organization-members.js +0 -67
- package/dist/components/auth/organization/organization-people.js +0 -11
- package/dist/components/auth/organization/organization-profile.js +0 -34
- package/dist/components/auth/organization/organization-row.js +0 -31
- package/dist/components/auth/organization/organization-settings.js +0 -13
- package/dist/components/auth/organization/organization-switcher.js +0 -48
- package/dist/components/auth/organization/organization-view-skeleton.js +0 -9
- package/dist/components/auth/organization/organization-view.js +0 -31
- package/dist/components/auth/organization/organization.js +0 -60
- package/dist/components/auth/organization/organizations-empty.js +0 -9
- package/dist/components/auth/organization/organizations-settings.js +0 -17
- package/dist/components/auth/organization/organizations.js +0 -21
- package/dist/components/auth/organization/remove-member-dialog.js +0 -20
- package/dist/components/auth/organization/slug-field.js +0 -38
- package/dist/components/auth/organization/user-invitation-row-skeleton.js +0 -8
- package/dist/components/auth/organization/user-invitation-row.js +0 -22
- package/dist/components/auth/organization/user-invitations-empty.js +0 -12
- package/dist/components/auth/organization/user-invitations.js +0 -18
- package/dist/components/auth/passkey/add-passkey-dialog.js +0 -22
- package/dist/components/auth/passkey/delete-passkey-dialog.js +0 -14
- package/dist/components/auth/passkey/passkey-button.js +0 -25
- package/dist/components/auth/passkey/passkey-skeleton.js +0 -5
- package/dist/components/auth/passkey/passkey.js +0 -17
- package/dist/components/auth/passkey/passkeys-empty.js +0 -9
- package/dist/components/auth/passkey/passkeys.js +0 -16
- package/dist/components/auth/provider-button.js +0 -29
- package/dist/components/auth/provider-buttons.js +0 -29
- package/dist/components/auth/reset-password.js +0 -57
- package/dist/components/auth/settings/account/account-settings.js +0 -22
- package/dist/components/auth/settings/account/change-avatar.js +0 -54
- package/dist/components/auth/settings/account/change-email.js +0 -28
- package/dist/components/auth/settings/account/user-profile.js +0 -65
- package/dist/components/auth/settings/security/active-session.js +0 -52
- package/dist/components/auth/settings/security/active-sessions.js +0 -23
- package/dist/components/auth/settings/security/change-password.js +0 -79
- package/dist/components/auth/settings/security/linked-account.js +0 -38
- package/dist/components/auth/settings/security/linked-accounts.js +0 -36
- package/dist/components/auth/settings/security/security-settings.js +0 -20
- package/dist/components/auth/settings/settings.js +0 -53
- package/dist/components/auth/sign-in.js +0 -64
- package/dist/components/auth/sign-out.js +0 -33
- package/dist/components/auth/sign-up.js +0 -98
- package/dist/components/auth/theme/appearance.js +0 -24
- package/dist/components/auth/theme/theme-toggle-item.js +0 -57
- package/dist/components/auth/user/user-avatar.js +0 -32
- package/dist/components/auth/user/user-button.js +0 -40
- package/dist/components/auth/user/user-view.js +0 -27
- package/dist/components/auth/username/sign-in-username.js +0 -88
- package/dist/components/auth/username/username-field.js +0 -45
- package/dist/lib/auth/api-key-plugin.js +0 -12
- package/dist/lib/auth/auth-plugin.js +0 -1
- package/dist/lib/auth/delete-user-plugin.js +0 -7
- package/dist/lib/auth/magic-link-plugin.js +0 -18
- package/dist/lib/auth/multi-session-plugin.js +0 -9
- package/dist/lib/auth/organization-plugin.js +0 -19
- package/dist/lib/auth/passkey-plugin.js +0 -9
- package/dist/lib/auth/theme-plugin.js +0 -26
- package/dist/lib/auth/username-plugin.js +0 -19
package/dist/index.js
CHANGED
|
@@ -1,22 +1,3394 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
import { a as e, i as t, n, r, t as i } from "./user-view--47tVtJ3.js";
|
|
3
|
+
import { authMutationKeys as a, authQueryKeys as o, fileToBase64 as s, getProviderName as c, parseAdditionalFieldValue as l, resolveInputType as u } from "@better-auth-ui/core";
|
|
4
|
+
import { AuthProvider as d, providerIcons as f, useAccountInfo as p, useAuth as m, useAuthenticate as h, useChangeEmail as g, useChangePassword as _, useFetchOptions as v, useLinkSocial as y, useListAccounts as b, useListSessions as ee, useRequestPasswordReset as te, useResetPassword as x, useRevokeSession as S, useSendVerificationEmail as ne, useSession as C, useSignInEmail as re, useSignOut as ie, useSignUpEmail as ae, useUnlinkAccount as w, useUpdateUser as T } from "@better-auth-ui/react";
|
|
5
|
+
import { ArrowRightFromSquare as E, ArrowRightToSquare as oe, Check as D, ChevronsExpandVertical as se, CloudArrowUpIn as ce, Copy as le, Display as ue, Eye as O, EyeSlash as k, Gear as de, Link as fe, LinkSlash as pe, Person as me, PersonPlus as he, PlugConnection as ge, Shield as _e, Smartphone as ve, TrashBin as ye, Xmark as be } from "@gravity-ui/icons";
|
|
6
|
+
import { Button as A, Calendar as j, Card as M, Checkbox as N, Chip as xe, ComboBox as Se, DateField as Ce, DatePicker as we, Description as Te, Dropdown as P, FieldError as F, Fieldset as I, Form as L, Input as R, InputGroup as z, Label as B, Link as V, ListBox as H, NumberField as U, RouterProvider as Ee, Select as De, Skeleton as W, Slider as Oe, Spinner as G, Switch as ke, Tabs as K, TextArea as Ae, TextField as q, TimeField as je, cn as J, toast as Y } from "@heroui/react";
|
|
7
|
+
import { fromDate as Me, getLocalTimeZone as Ne, parseDate as Pe, parseDateTime as Fe, toCalendarDate as Ie, toCalendarDateTime as Le } from "@internationalized/date";
|
|
8
|
+
import { isValidElement as Re, useEffect as ze, useMemo as Be, useRef as Ve, useState as X } from "react";
|
|
9
|
+
import { Fragment as Z, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
10
|
+
import { matchMutation as He, matchQuery as Ue, useIsMutating as We, useQueryClient as Ge } from "@tanstack/react-query";
|
|
11
|
+
//#region \0rolldown/runtime.js
|
|
12
|
+
var Ke = Object.create, qe = Object.defineProperty, Je = Object.getOwnPropertyDescriptor, Ye = Object.getOwnPropertyNames, Xe = Object.getPrototypeOf, Ze = Object.prototype.hasOwnProperty, Qe = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), $e = (e, t, n, r) => {
|
|
13
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = Ye(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !Ze.call(e, s) && s !== n && qe(e, s, {
|
|
14
|
+
get: ((e) => t[e]).bind(null, s),
|
|
15
|
+
enumerable: !(r = Je(t, s)) || r.enumerable
|
|
16
|
+
});
|
|
17
|
+
return e;
|
|
18
|
+
}, et = (e, t, n) => (n = e == null ? {} : Ke(Xe(e)), $e(t || !e || !e.__esModule ? qe(n, "default", {
|
|
19
|
+
value: e,
|
|
20
|
+
enumerable: !0
|
|
21
|
+
}) : n, e));
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/auth/additional-field.tsx
|
|
24
|
+
function tt(e) {
|
|
25
|
+
if (e instanceof Date) return Ie(Me(e, Ne()));
|
|
26
|
+
if (typeof e == "string") try {
|
|
27
|
+
return Pe(e.slice(0, 10));
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function nt(e) {
|
|
33
|
+
if (e instanceof Date) return Le(Me(e, Ne()));
|
|
34
|
+
if (typeof e == "string") try {
|
|
35
|
+
return Fe(e.replace(/(Z|[+-]\d{2}:?\d{2})$/, ""));
|
|
36
|
+
} catch {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function rt({ getValue: e, isDisabled: t }) {
|
|
41
|
+
let { localization: n } = m(), [r, i] = X(!1);
|
|
42
|
+
async function a() {
|
|
43
|
+
let t = e();
|
|
44
|
+
if (t) try {
|
|
45
|
+
await navigator.clipboard.writeText(t), i(!0), setTimeout(() => i(!1), 1500);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
Y.danger(e instanceof Error ? e.message : String(e));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ Q(A, {
|
|
51
|
+
isIconOnly: !0,
|
|
52
|
+
"aria-label": n.settings.copyToClipboard,
|
|
53
|
+
size: "sm",
|
|
54
|
+
variant: "ghost",
|
|
55
|
+
isDisabled: t,
|
|
56
|
+
onPress: a,
|
|
57
|
+
children: Q(r ? D : le, { className: "size-4" })
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function it({ name: e, field: t, isPending: n, variant: r }) {
|
|
61
|
+
let { localization: i } = m(), a = u(t), o = r === "transparent" ? "primary" : "secondary", s = Ve(null);
|
|
62
|
+
if (t.render) return /* @__PURE__ */ Q(Z, { children: t.render({
|
|
63
|
+
name: e,
|
|
64
|
+
field: t,
|
|
65
|
+
isPending: n,
|
|
66
|
+
variant: r
|
|
67
|
+
}) });
|
|
68
|
+
if (a === "hidden") return /* @__PURE__ */ Q("input", {
|
|
69
|
+
type: "hidden",
|
|
70
|
+
name: e,
|
|
71
|
+
value: t.defaultValue == null ? "" : t.defaultValue instanceof Date ? t.defaultValue.toISOString() : String(t.defaultValue)
|
|
72
|
+
});
|
|
73
|
+
if (a === "textarea") return /* @__PURE__ */ $(q, {
|
|
74
|
+
name: e,
|
|
75
|
+
defaultValue: t.defaultValue == null ? void 0 : String(t.defaultValue),
|
|
76
|
+
isDisabled: n,
|
|
77
|
+
isReadOnly: t.readOnly,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ Q(B, { children: t.label }),
|
|
80
|
+
/* @__PURE__ */ Q(Ae, {
|
|
81
|
+
placeholder: t.placeholder,
|
|
82
|
+
required: t.required,
|
|
83
|
+
variant: o
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ Q(F, {})
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
if (a === "number") {
|
|
89
|
+
let r = t.formatOptions?.maximumFractionDigits;
|
|
90
|
+
return /* @__PURE__ */ $(U, {
|
|
91
|
+
name: e,
|
|
92
|
+
defaultValue: typeof t.defaultValue == "number" ? t.defaultValue : t.defaultValue != null && t.defaultValue !== "" ? Number(t.defaultValue) : void 0,
|
|
93
|
+
minValue: t.min,
|
|
94
|
+
maxValue: t.max,
|
|
95
|
+
step: t.step ?? (r ? 1 / 10 ** r : 1),
|
|
96
|
+
formatOptions: t.formatOptions,
|
|
97
|
+
isDisabled: n,
|
|
98
|
+
isReadOnly: t.readOnly,
|
|
99
|
+
variant: o,
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ Q(B, { children: t.label }),
|
|
102
|
+
/* @__PURE__ */ $(U.Group, { children: [
|
|
103
|
+
/* @__PURE__ */ Q(U.DecrementButton, {}),
|
|
104
|
+
/* @__PURE__ */ Q(U.Input, {
|
|
105
|
+
placeholder: t.placeholder,
|
|
106
|
+
required: t.required
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ Q(U.IncrementButton, {})
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ Q(F, {})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (a === "slider") {
|
|
115
|
+
let r = t.formatOptions?.maximumFractionDigits;
|
|
116
|
+
return /* @__PURE__ */ $(Oe, {
|
|
117
|
+
defaultValue: typeof t.defaultValue == "number" ? t.defaultValue : t.defaultValue == null ? void 0 : Number(t.defaultValue),
|
|
118
|
+
minValue: t.min ?? 0,
|
|
119
|
+
maxValue: t.max ?? 100,
|
|
120
|
+
step: t.step ?? (r ? 1 / 10 ** r : 1),
|
|
121
|
+
formatOptions: t.formatOptions,
|
|
122
|
+
isDisabled: n || t.readOnly,
|
|
123
|
+
className: "flex flex-col gap-2",
|
|
124
|
+
children: [/* @__PURE__ */ $("div", {
|
|
125
|
+
className: "flex items-center justify-between gap-2",
|
|
126
|
+
children: [/* @__PURE__ */ Q(B, { children: t.label }), /* @__PURE__ */ Q(Oe.Output, { className: "text-sm text-muted" })]
|
|
127
|
+
}), /* @__PURE__ */ $(Oe.Track, { children: [/* @__PURE__ */ Q(Oe.Fill, {}), /* @__PURE__ */ Q(Oe.Thumb, { name: e })] })]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (a === "switch") return /* @__PURE__ */ $(ke, {
|
|
131
|
+
name: e,
|
|
132
|
+
defaultSelected: t.defaultValue === !0 || t.defaultValue === "true",
|
|
133
|
+
isDisabled: n,
|
|
134
|
+
isReadOnly: t.readOnly,
|
|
135
|
+
children: [/* @__PURE__ */ Q(ke.Control, { children: /* @__PURE__ */ Q(ke.Thumb, {}) }), /* @__PURE__ */ Q(B, { children: t.label })]
|
|
136
|
+
});
|
|
137
|
+
if (a === "checkbox") return /* @__PURE__ */ $(N, {
|
|
138
|
+
name: e,
|
|
139
|
+
defaultSelected: t.defaultValue === !0 || t.defaultValue === "true",
|
|
140
|
+
isDisabled: n,
|
|
141
|
+
isReadOnly: t.readOnly,
|
|
142
|
+
isRequired: t.required,
|
|
143
|
+
variant: o,
|
|
144
|
+
children: [/* @__PURE__ */ Q(N.Control, { children: /* @__PURE__ */ Q(N.Indicator, {}) }), /* @__PURE__ */ Q(N.Content, { children: /* @__PURE__ */ Q(B, { children: t.label }) })]
|
|
145
|
+
});
|
|
146
|
+
if (a === "select") return /* @__PURE__ */ $(De, {
|
|
147
|
+
className: "[&[data-required=true]>.label]:after:content-none",
|
|
148
|
+
name: e,
|
|
149
|
+
defaultValue: t.defaultValue == null ? void 0 : String(t.defaultValue),
|
|
150
|
+
placeholder: t.placeholder,
|
|
151
|
+
isDisabled: n || t.readOnly,
|
|
152
|
+
isRequired: t.required,
|
|
153
|
+
variant: o,
|
|
154
|
+
fullWidth: !0,
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ Q(B, { children: t.label }),
|
|
157
|
+
/* @__PURE__ */ $(De.Trigger, { children: [/* @__PURE__ */ Q(De.Value, {}), /* @__PURE__ */ Q(De.Indicator, {})] }),
|
|
158
|
+
/* @__PURE__ */ Q(De.Popover, { children: /* @__PURE__ */ Q(H, { children: t.options?.map((e) => /* @__PURE__ */ $(H.Item, {
|
|
159
|
+
id: e.value,
|
|
160
|
+
textValue: typeof e.label == "string" ? e.label : e.value,
|
|
161
|
+
children: [e.label, /* @__PURE__ */ Q(H.ItemIndicator, {})]
|
|
162
|
+
}, e.value)) }) }),
|
|
163
|
+
/* @__PURE__ */ Q(F, {})
|
|
164
|
+
]
|
|
165
|
+
});
|
|
166
|
+
if (a === "combobox") return /* @__PURE__ */ $(Se, {
|
|
167
|
+
className: "[&[data-required=true]>.label]:after:content-none",
|
|
168
|
+
name: e,
|
|
169
|
+
defaultSelectedKey: t.defaultValue == null ? void 0 : String(t.defaultValue),
|
|
170
|
+
isDisabled: n,
|
|
171
|
+
isReadOnly: t.readOnly,
|
|
172
|
+
isRequired: t.required,
|
|
173
|
+
variant: o,
|
|
174
|
+
fullWidth: !0,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ Q(B, { children: t.label }),
|
|
177
|
+
/* @__PURE__ */ $(Se.InputGroup, { children: [/* @__PURE__ */ Q(R, { placeholder: t.placeholder }), /* @__PURE__ */ Q(Se.Trigger, {})] }),
|
|
178
|
+
/* @__PURE__ */ Q(Se.Popover, { children: /* @__PURE__ */ Q(H, { children: t.options?.map((e) => /* @__PURE__ */ $(H.Item, {
|
|
179
|
+
id: e.value,
|
|
180
|
+
textValue: typeof e.label == "string" ? e.label : e.value,
|
|
181
|
+
children: [e.label, /* @__PURE__ */ Q(H.ItemIndicator, {})]
|
|
182
|
+
}, e.value)) }) }),
|
|
183
|
+
/* @__PURE__ */ Q(F, {})
|
|
184
|
+
]
|
|
185
|
+
});
|
|
186
|
+
if (a === "date" || a === "datetime") {
|
|
187
|
+
let r = a === "datetime";
|
|
188
|
+
return /* @__PURE__ */ Q(we, {
|
|
189
|
+
className: "w-full [&[data-required=true]>.label]:after:content-none",
|
|
190
|
+
name: e,
|
|
191
|
+
defaultValue: r ? nt(t.defaultValue) : tt(t.defaultValue),
|
|
192
|
+
granularity: r ? "minute" : "day",
|
|
193
|
+
isDisabled: n,
|
|
194
|
+
isReadOnly: t.readOnly,
|
|
195
|
+
isRequired: t.required,
|
|
196
|
+
children: ({ state: n }) => /* @__PURE__ */ $(Z, { children: [
|
|
197
|
+
/* @__PURE__ */ Q(B, { children: t.label }),
|
|
198
|
+
/* @__PURE__ */ $(Ce.Group, {
|
|
199
|
+
variant: o,
|
|
200
|
+
fullWidth: !0,
|
|
201
|
+
children: [/* @__PURE__ */ Q(Ce.Input, { children: (e) => /* @__PURE__ */ Q(Ce.Segment, { segment: e }) }), /* @__PURE__ */ Q(Ce.Suffix, { children: /* @__PURE__ */ Q(we.Trigger, { children: /* @__PURE__ */ Q(we.TriggerIndicator, {}) }) })]
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ Q(F, {}),
|
|
204
|
+
/* @__PURE__ */ $(we.Popover, {
|
|
205
|
+
className: "flex flex-col gap-3",
|
|
206
|
+
children: [/* @__PURE__ */ $(j, {
|
|
207
|
+
"aria-label": typeof t.label == "string" ? t.label : e,
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ $(j.Header, { children: [
|
|
210
|
+
/* @__PURE__ */ $(j.YearPickerTrigger, { children: [/* @__PURE__ */ Q(j.YearPickerTriggerHeading, {}), /* @__PURE__ */ Q(j.YearPickerTriggerIndicator, {})] }),
|
|
211
|
+
/* @__PURE__ */ Q(j.NavButton, { slot: "previous" }),
|
|
212
|
+
/* @__PURE__ */ Q(j.NavButton, { slot: "next" })
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ $(j.Grid, { children: [/* @__PURE__ */ Q(j.GridHeader, { children: (e) => /* @__PURE__ */ Q(j.HeaderCell, { children: e }) }), /* @__PURE__ */ Q(j.GridBody, { children: (e) => /* @__PURE__ */ Q(j.Cell, { date: e }) })] }),
|
|
215
|
+
/* @__PURE__ */ Q(j.YearPickerGrid, { children: /* @__PURE__ */ Q(j.YearPickerGridBody, { children: ({ year: e }) => /* @__PURE__ */ Q(j.YearPickerCell, { year: e }) }) })
|
|
216
|
+
]
|
|
217
|
+
}), r && /* @__PURE__ */ $("div", {
|
|
218
|
+
className: "flex items-center justify-between",
|
|
219
|
+
children: [/* @__PURE__ */ Q(B, { children: i.settings.time }), /* @__PURE__ */ Q(je, {
|
|
220
|
+
"aria-label": i.settings.time,
|
|
221
|
+
granularity: "minute",
|
|
222
|
+
value: n.timeValue,
|
|
223
|
+
onChange: (e) => n.setTimeValue(e),
|
|
224
|
+
children: /* @__PURE__ */ Q(je.Group, {
|
|
225
|
+
variant: "secondary",
|
|
226
|
+
children: /* @__PURE__ */ Q(je.Input, { children: (e) => /* @__PURE__ */ Q(je.Segment, { segment: e }) })
|
|
227
|
+
})
|
|
228
|
+
})]
|
|
229
|
+
})]
|
|
230
|
+
})
|
|
231
|
+
] })
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
let c = t.prefix != null, l = t.suffix != null || t.copyable, d = t.type === "number", f = t.formatOptions?.maximumFractionDigits, p = d ? "number" : void 0, h = d ? f ? "decimal" : "numeric" : void 0, g = f ? 1 / 10 ** f : void 0;
|
|
235
|
+
return c || l ? /* @__PURE__ */ $(q, {
|
|
236
|
+
name: e,
|
|
237
|
+
defaultValue: t.defaultValue == null ? void 0 : String(t.defaultValue),
|
|
238
|
+
isDisabled: n,
|
|
239
|
+
isReadOnly: t.readOnly,
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ Q(B, { children: t.label }),
|
|
242
|
+
/* @__PURE__ */ $(z, {
|
|
243
|
+
variant: o,
|
|
244
|
+
children: [
|
|
245
|
+
c && /* @__PURE__ */ Q(z.Prefix, { children: t.prefix }),
|
|
246
|
+
/* @__PURE__ */ Q(z.Input, {
|
|
247
|
+
ref: s,
|
|
248
|
+
placeholder: t.placeholder,
|
|
249
|
+
required: t.required,
|
|
250
|
+
type: p,
|
|
251
|
+
inputMode: h,
|
|
252
|
+
step: g
|
|
253
|
+
}),
|
|
254
|
+
t.copyable ? /* @__PURE__ */ Q(z.Suffix, {
|
|
255
|
+
className: "px-0",
|
|
256
|
+
children: /* @__PURE__ */ Q(rt, {
|
|
257
|
+
getValue: () => s.current?.value,
|
|
258
|
+
isDisabled: n
|
|
259
|
+
})
|
|
260
|
+
}) : t.suffix != null && /* @__PURE__ */ Q(z.Suffix, { children: t.suffix })
|
|
261
|
+
]
|
|
262
|
+
}),
|
|
263
|
+
/* @__PURE__ */ Q(F, {})
|
|
264
|
+
]
|
|
265
|
+
}) : /* @__PURE__ */ $(q, {
|
|
266
|
+
name: e,
|
|
267
|
+
defaultValue: t.defaultValue == null ? void 0 : String(t.defaultValue),
|
|
268
|
+
isDisabled: n,
|
|
269
|
+
isReadOnly: t.readOnly,
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ Q(B, { children: t.label }),
|
|
272
|
+
/* @__PURE__ */ Q(R, {
|
|
273
|
+
placeholder: t.placeholder,
|
|
274
|
+
required: t.required,
|
|
275
|
+
variant: o,
|
|
276
|
+
type: p,
|
|
277
|
+
inputMode: h,
|
|
278
|
+
step: g
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ Q(F, {})
|
|
281
|
+
]
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/components/auth/forgot-password.tsx
|
|
286
|
+
function at({ className: e, variant: t, ...n }) {
|
|
287
|
+
let { authClient: r, baseURL: i, basePaths: a, localization: o, viewPaths: s, navigate: c, plugins: l } = m(), { fetchOptions: u, resetFetchOptions: d } = v(), { mutate: f, isPending: p } = te(r, {
|
|
288
|
+
onError: (e) => {
|
|
289
|
+
Y.danger(e.error?.message || e.message), d();
|
|
290
|
+
},
|
|
291
|
+
onSuccess: () => {
|
|
292
|
+
Y.success(o.auth.passwordResetEmailSent), c({ to: `${a.auth}/${s.auth.signIn}` });
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
function h(e) {
|
|
296
|
+
e.preventDefault(), f({
|
|
297
|
+
email: new FormData(e.currentTarget).get("email"),
|
|
298
|
+
redirectTo: `${i}${a.auth}/${s.auth.resetPassword}`,
|
|
299
|
+
fetchOptions: u
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
let g = l.find((e) => e.captchaComponent)?.captchaComponent;
|
|
303
|
+
return /* @__PURE__ */ $(M, {
|
|
304
|
+
className: J("w-full max-w-sm gap-4 md:p-6", e),
|
|
305
|
+
variant: t,
|
|
306
|
+
...n,
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ Q(M.Header, { children: /* @__PURE__ */ Q(M.Title, {
|
|
309
|
+
className: "text-xl font-semibold mb-1",
|
|
310
|
+
children: o.auth.forgotPassword
|
|
311
|
+
}) }),
|
|
312
|
+
/* @__PURE__ */ Q(M.Content, {
|
|
313
|
+
className: "gap-4",
|
|
314
|
+
children: /* @__PURE__ */ $(L, {
|
|
315
|
+
onSubmit: h,
|
|
316
|
+
className: "flex flex-col gap-4",
|
|
317
|
+
children: [
|
|
318
|
+
/* @__PURE__ */ $(q, {
|
|
319
|
+
name: "email",
|
|
320
|
+
type: "email",
|
|
321
|
+
autoComplete: "email",
|
|
322
|
+
isDisabled: p,
|
|
323
|
+
children: [
|
|
324
|
+
/* @__PURE__ */ Q(B, { children: o.auth.email }),
|
|
325
|
+
/* @__PURE__ */ Q(R, {
|
|
326
|
+
placeholder: o.auth.emailPlaceholder,
|
|
327
|
+
required: !0,
|
|
328
|
+
variant: t === "transparent" ? "primary" : "secondary"
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ Q(F, {})
|
|
331
|
+
]
|
|
332
|
+
}),
|
|
333
|
+
g && /* @__PURE__ */ Q("div", {
|
|
334
|
+
className: "flex justify-center",
|
|
335
|
+
children: g
|
|
336
|
+
}),
|
|
337
|
+
/* @__PURE__ */ Q("div", {
|
|
338
|
+
className: "flex flex-col gap-3",
|
|
339
|
+
children: /* @__PURE__ */ $(A, {
|
|
340
|
+
type: "submit",
|
|
341
|
+
className: "w-full",
|
|
342
|
+
isPending: p,
|
|
343
|
+
children: [p && /* @__PURE__ */ Q(G, {
|
|
344
|
+
color: "current",
|
|
345
|
+
size: "sm"
|
|
346
|
+
}), o.auth.sendResetLink]
|
|
347
|
+
})
|
|
348
|
+
})
|
|
349
|
+
]
|
|
350
|
+
})
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ Q(M.Footer, {
|
|
353
|
+
className: "flex-col gap-3",
|
|
354
|
+
children: /* @__PURE__ */ $(Te, {
|
|
355
|
+
className: "text-sm",
|
|
356
|
+
children: [
|
|
357
|
+
o.auth.rememberYourPassword,
|
|
358
|
+
" ",
|
|
359
|
+
/* @__PURE__ */ Q(V, {
|
|
360
|
+
href: `${a.auth}/${s.auth.signIn}`,
|
|
361
|
+
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
362
|
+
children: o.auth.signIn
|
|
363
|
+
})
|
|
364
|
+
]
|
|
365
|
+
})
|
|
366
|
+
})
|
|
367
|
+
]
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region src/components/auth/reset-password.tsx
|
|
372
|
+
function ot({ className: e, variant: t, ...n }) {
|
|
373
|
+
let { authClient: r, basePaths: i, emailAndPassword: a, localization: o, viewPaths: s, navigate: c } = m(), { mutate: l, isPending: u } = x(r, { onSuccess: () => {
|
|
374
|
+
Y.success(o.auth.passwordResetSuccess), c({ to: `${i.auth}/${s.auth.signIn}` });
|
|
375
|
+
} }), [d, f] = X(!1), [p, h] = X(!1);
|
|
376
|
+
ze(() => {
|
|
377
|
+
new URLSearchParams(window.location.search).get("token") || (Y.danger(o.auth.invalidResetPasswordToken), c({ to: `${i.auth}/${s.auth.signIn}` }));
|
|
378
|
+
}, [
|
|
379
|
+
i.auth,
|
|
380
|
+
o.auth.invalidResetPasswordToken,
|
|
381
|
+
s.auth.signIn,
|
|
382
|
+
c
|
|
383
|
+
]);
|
|
384
|
+
function g(e) {
|
|
385
|
+
e.preventDefault();
|
|
386
|
+
let t = new URLSearchParams(window.location.search).get("token");
|
|
387
|
+
if (!t) {
|
|
388
|
+
Y.danger(o.auth.invalidResetPasswordToken), c({ to: `${i.auth}/${s.auth.signIn}` });
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
let n = new FormData(e.currentTarget), r = n.get("password"), u = n.get("confirmPassword");
|
|
392
|
+
if (a?.confirmPassword && r !== u) {
|
|
393
|
+
Y.danger(o.auth.passwordsDoNotMatch);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
l({
|
|
397
|
+
token: t,
|
|
398
|
+
newPassword: r
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
return /* @__PURE__ */ $(M, {
|
|
402
|
+
className: J("w-full max-w-sm gap-4 md:p-6", e),
|
|
403
|
+
variant: t,
|
|
404
|
+
...n,
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ Q(M.Header, { children: /* @__PURE__ */ Q(M.Title, {
|
|
407
|
+
className: "text-xl font-semibold mb-1",
|
|
408
|
+
children: o.auth.resetPassword
|
|
409
|
+
}) }),
|
|
410
|
+
/* @__PURE__ */ Q(M.Content, {
|
|
411
|
+
className: "gap-4",
|
|
412
|
+
children: /* @__PURE__ */ $(L, {
|
|
413
|
+
onSubmit: g,
|
|
414
|
+
className: "flex flex-col gap-4",
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ $(q, {
|
|
417
|
+
minLength: a?.minPasswordLength,
|
|
418
|
+
maxLength: a?.maxPasswordLength,
|
|
419
|
+
name: "password",
|
|
420
|
+
autoComplete: "new-password",
|
|
421
|
+
isDisabled: u,
|
|
422
|
+
children: [
|
|
423
|
+
/* @__PURE__ */ Q(B, { children: o.auth.password }),
|
|
424
|
+
/* @__PURE__ */ $(z, {
|
|
425
|
+
variant: t === "transparent" ? "primary" : "secondary",
|
|
426
|
+
children: [/* @__PURE__ */ Q(z.Input, {
|
|
427
|
+
name: "password",
|
|
428
|
+
placeholder: o.auth.newPasswordPlaceholder,
|
|
429
|
+
type: d ? "text" : "password",
|
|
430
|
+
required: !0
|
|
431
|
+
}), /* @__PURE__ */ Q(z.Suffix, {
|
|
432
|
+
className: "px-0",
|
|
433
|
+
children: /* @__PURE__ */ Q(A, {
|
|
434
|
+
isIconOnly: !0,
|
|
435
|
+
"aria-label": d ? o.auth.hidePassword : o.auth.showPassword,
|
|
436
|
+
size: "sm",
|
|
437
|
+
variant: "ghost",
|
|
438
|
+
onPress: () => f(!d),
|
|
439
|
+
isDisabled: u,
|
|
440
|
+
children: Q(d ? k : O, {})
|
|
441
|
+
})
|
|
442
|
+
})]
|
|
443
|
+
}),
|
|
444
|
+
/* @__PURE__ */ Q(F, {})
|
|
445
|
+
]
|
|
446
|
+
}),
|
|
447
|
+
a?.confirmPassword && /* @__PURE__ */ $(q, {
|
|
448
|
+
minLength: a?.minPasswordLength,
|
|
449
|
+
maxLength: a?.maxPasswordLength,
|
|
450
|
+
name: "confirmPassword",
|
|
451
|
+
autoComplete: "new-password",
|
|
452
|
+
isDisabled: u,
|
|
453
|
+
children: [
|
|
454
|
+
/* @__PURE__ */ Q(B, { children: o.auth.confirmPassword }),
|
|
455
|
+
/* @__PURE__ */ $(z, {
|
|
456
|
+
variant: t === "transparent" ? "primary" : "secondary",
|
|
457
|
+
children: [/* @__PURE__ */ Q(z.Input, {
|
|
458
|
+
placeholder: o.auth.confirmPasswordPlaceholder,
|
|
459
|
+
type: p ? "text" : "password",
|
|
460
|
+
required: !0,
|
|
461
|
+
name: "confirmPassword"
|
|
462
|
+
}), /* @__PURE__ */ Q(z.Suffix, {
|
|
463
|
+
className: "px-0",
|
|
464
|
+
children: /* @__PURE__ */ Q(A, {
|
|
465
|
+
isIconOnly: !0,
|
|
466
|
+
"aria-label": p ? o.auth.hidePassword : o.auth.showPassword,
|
|
467
|
+
size: "sm",
|
|
468
|
+
variant: "ghost",
|
|
469
|
+
onPress: () => h(!p),
|
|
470
|
+
isDisabled: u,
|
|
471
|
+
children: Q(p ? k : O, {})
|
|
472
|
+
})
|
|
473
|
+
})]
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ Q(F, {})
|
|
476
|
+
]
|
|
477
|
+
}),
|
|
478
|
+
/* @__PURE__ */ Q("div", {
|
|
479
|
+
className: "flex flex-col gap-3",
|
|
480
|
+
children: /* @__PURE__ */ $(A, {
|
|
481
|
+
type: "submit",
|
|
482
|
+
className: "w-full",
|
|
483
|
+
isPending: u,
|
|
484
|
+
children: [u && /* @__PURE__ */ Q(G, {
|
|
485
|
+
color: "current",
|
|
486
|
+
size: "sm"
|
|
487
|
+
}), o.auth.resetPassword]
|
|
488
|
+
})
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
})
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ Q(M.Footer, {
|
|
494
|
+
className: "flex-col gap-3",
|
|
495
|
+
children: /* @__PURE__ */ $(Te, {
|
|
496
|
+
className: "text-sm",
|
|
497
|
+
children: [
|
|
498
|
+
o.auth.rememberYourPassword,
|
|
499
|
+
" ",
|
|
500
|
+
/* @__PURE__ */ Q(V, {
|
|
501
|
+
href: `${i.auth}/${s.auth.signIn}`,
|
|
502
|
+
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
503
|
+
children: o.auth.signIn
|
|
504
|
+
})
|
|
505
|
+
]
|
|
506
|
+
})
|
|
507
|
+
})
|
|
508
|
+
]
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
//#endregion
|
|
512
|
+
//#region src/components/auth/sign-in.tsx
|
|
513
|
+
function st({ className: t, socialLayout: n, socialPosition: i = "bottom", variant: o, ...s }) {
|
|
514
|
+
let { authClient: c, basePaths: l, baseURL: u, emailAndPassword: d, localization: f, plugins: p, redirectTo: h, socialProviders: g, viewPaths: _, navigate: y } = m(), { fetchOptions: b, resetFetchOptions: ee } = v(), [te, x] = X(""), { mutate: S } = ne(c, { onSuccess: () => Y.success(f.auth.verificationEmailSent) }), { mutate: C, isPending: ie } = re(c, {
|
|
515
|
+
onError: (e, { email: t }) => {
|
|
516
|
+
x(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? Y.danger(e.error?.message || e.message, { actionProps: {
|
|
517
|
+
children: f.auth.resend,
|
|
518
|
+
onClick: () => S({
|
|
519
|
+
email: t,
|
|
520
|
+
callbackURL: `${u}${h}`
|
|
521
|
+
})
|
|
522
|
+
} }) : Y.danger(e.error?.message || e.message), ee();
|
|
523
|
+
},
|
|
524
|
+
onSuccess: () => y({ to: h })
|
|
525
|
+
}), ae = (e) => {
|
|
526
|
+
e.preventDefault();
|
|
527
|
+
let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
|
|
528
|
+
C({
|
|
529
|
+
email: n,
|
|
530
|
+
password: te,
|
|
531
|
+
...d?.rememberMe ? { rememberMe: r } : {},
|
|
532
|
+
fetchOptions: b
|
|
533
|
+
});
|
|
534
|
+
}, w = We({ mutationKey: a.signIn.all }) + We({ mutationKey: a.signUp.all }) > 0, T = p.find((e) => e.captchaComponent)?.captchaComponent, E = d?.enabled && !!g?.length;
|
|
535
|
+
return /* @__PURE__ */ $(M, {
|
|
536
|
+
className: J("w-full max-w-sm gap-4 md:p-6", t),
|
|
537
|
+
variant: o,
|
|
538
|
+
...s,
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ Q(M.Header, { children: /* @__PURE__ */ Q(M.Title, {
|
|
541
|
+
className: "text-xl font-semibold mb-1",
|
|
542
|
+
children: f.auth.signIn
|
|
543
|
+
}) }),
|
|
544
|
+
/* @__PURE__ */ $(M.Content, {
|
|
545
|
+
className: "gap-4",
|
|
546
|
+
children: [
|
|
547
|
+
i === "top" && /* @__PURE__ */ $(Z, { children: [!!g?.length && /* @__PURE__ */ Q(r, { socialLayout: n }), E && /* @__PURE__ */ Q(e, { children: f.auth.or })] }),
|
|
548
|
+
d?.enabled && /* @__PURE__ */ $(L, {
|
|
549
|
+
onSubmit: ae,
|
|
550
|
+
className: "flex flex-col gap-4",
|
|
551
|
+
children: [
|
|
552
|
+
/* @__PURE__ */ $(q, {
|
|
553
|
+
name: "email",
|
|
554
|
+
type: "email",
|
|
555
|
+
autoComplete: "email",
|
|
556
|
+
isDisabled: w,
|
|
557
|
+
children: [
|
|
558
|
+
/* @__PURE__ */ Q(B, { children: f.auth.email }),
|
|
559
|
+
/* @__PURE__ */ Q(R, {
|
|
560
|
+
placeholder: f.auth.emailPlaceholder,
|
|
561
|
+
variant: o === "transparent" ? "primary" : "secondary",
|
|
562
|
+
required: !0
|
|
563
|
+
}),
|
|
564
|
+
/* @__PURE__ */ Q(F, {})
|
|
565
|
+
]
|
|
566
|
+
}),
|
|
567
|
+
/* @__PURE__ */ $(q, {
|
|
568
|
+
minLength: d?.minPasswordLength,
|
|
569
|
+
maxLength: d?.maxPasswordLength,
|
|
570
|
+
name: "password",
|
|
571
|
+
type: "password",
|
|
572
|
+
autoComplete: "current-password",
|
|
573
|
+
isDisabled: w,
|
|
574
|
+
value: te,
|
|
575
|
+
onChange: x,
|
|
576
|
+
children: [
|
|
577
|
+
/* @__PURE__ */ Q(B, { children: f.auth.password }),
|
|
578
|
+
/* @__PURE__ */ Q(R, {
|
|
579
|
+
placeholder: f.auth.passwordPlaceholder,
|
|
580
|
+
variant: o === "transparent" ? "primary" : "secondary",
|
|
581
|
+
required: !0
|
|
582
|
+
}),
|
|
583
|
+
/* @__PURE__ */ Q(F, {})
|
|
584
|
+
]
|
|
585
|
+
}),
|
|
586
|
+
d?.rememberMe && /* @__PURE__ */ $(N, {
|
|
587
|
+
name: "rememberMe",
|
|
588
|
+
isDisabled: w,
|
|
589
|
+
variant: o === "transparent" ? "primary" : "secondary",
|
|
590
|
+
children: [/* @__PURE__ */ Q(N.Control, { children: /* @__PURE__ */ Q(N.Indicator, {}) }), /* @__PURE__ */ Q(N.Content, { children: /* @__PURE__ */ Q(B, { children: f.auth.rememberMe }) })]
|
|
591
|
+
}),
|
|
592
|
+
T && /* @__PURE__ */ Q("div", {
|
|
593
|
+
className: "flex justify-center",
|
|
594
|
+
children: T
|
|
595
|
+
}),
|
|
596
|
+
/* @__PURE__ */ $("div", {
|
|
597
|
+
className: "flex flex-col gap-3",
|
|
598
|
+
children: [/* @__PURE__ */ $(A, {
|
|
599
|
+
type: "submit",
|
|
600
|
+
className: "w-full",
|
|
601
|
+
isPending: w,
|
|
602
|
+
children: [ie && /* @__PURE__ */ Q(G, {
|
|
603
|
+
color: "current",
|
|
604
|
+
size: "sm"
|
|
605
|
+
}), f.auth.signIn]
|
|
606
|
+
}), p.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ Q(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
|
|
607
|
+
})
|
|
608
|
+
]
|
|
609
|
+
}),
|
|
610
|
+
i === "bottom" && /* @__PURE__ */ $(Z, { children: [E && /* @__PURE__ */ Q(e, { children: f.auth.or }), !!g?.length && /* @__PURE__ */ Q(r, { socialLayout: n })] })
|
|
611
|
+
]
|
|
612
|
+
}),
|
|
613
|
+
/* @__PURE__ */ $(M.Footer, {
|
|
614
|
+
className: "flex-col gap-3",
|
|
615
|
+
children: [d?.forgotPassword && /* @__PURE__ */ Q(V, {
|
|
616
|
+
href: `${l.auth}/${_.auth.forgotPassword}`,
|
|
617
|
+
className: "no-underline hover:underline",
|
|
618
|
+
children: f.auth.forgotPasswordLink
|
|
619
|
+
}), d?.enabled && /* @__PURE__ */ $(Te, {
|
|
620
|
+
className: "text-sm",
|
|
621
|
+
children: [
|
|
622
|
+
f.auth.needToCreateAnAccount,
|
|
623
|
+
" ",
|
|
624
|
+
/* @__PURE__ */ Q(V, {
|
|
625
|
+
href: `${l.auth}/${_.auth.signUp}`,
|
|
626
|
+
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
627
|
+
children: f.auth.signUp
|
|
628
|
+
})
|
|
629
|
+
]
|
|
630
|
+
})]
|
|
631
|
+
})
|
|
632
|
+
]
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region src/components/auth/sign-out.tsx
|
|
637
|
+
function ct({ className: e }) {
|
|
638
|
+
let { authClient: t, basePaths: n, navigate: r, viewPaths: i } = m(), { mutate: a } = ie(t, {
|
|
639
|
+
onError: (e) => {
|
|
640
|
+
Y.danger(e.error?.message || e.message), r({
|
|
641
|
+
to: `${n.auth}/${i.auth.signIn}`,
|
|
642
|
+
replace: !0
|
|
643
|
+
});
|
|
644
|
+
},
|
|
645
|
+
onSuccess: () => r({
|
|
646
|
+
to: `${n.auth}/${i.auth.signIn}`,
|
|
647
|
+
replace: !0
|
|
648
|
+
})
|
|
649
|
+
}), o = Ve(!1);
|
|
650
|
+
return ze(() => {
|
|
651
|
+
o.current || (o.current = !0, a());
|
|
652
|
+
}, [a]), /* @__PURE__ */ Q(G, {
|
|
653
|
+
className: J("mx-auto my-auto", e),
|
|
654
|
+
color: "current"
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
//#endregion
|
|
658
|
+
//#region src/components/auth/sign-up.tsx
|
|
659
|
+
function lt({ className: t, socialLayout: n, socialPosition: i = "bottom", variant: o, ...s }) {
|
|
660
|
+
let { additionalFields: c, authClient: u, basePaths: d, emailAndPassword: f, localization: p, plugins: h, redirectTo: g, socialProviders: _, viewPaths: y, navigate: b } = m(), { fetchOptions: ee, resetFetchOptions: te } = v(), [x, S] = X(""), [ne, C] = X(""), { mutate: re, isPending: ie } = ae(u, {
|
|
661
|
+
onError: (e) => {
|
|
662
|
+
S(""), C(""), Y.danger(e.error?.message || e.message), te();
|
|
663
|
+
},
|
|
664
|
+
onSuccess: () => {
|
|
665
|
+
f?.requireEmailVerification ? (Y.success(p.auth.verifyYourEmail), b({ to: `${d.auth}/${y.auth.signIn}` })) : b({ to: g });
|
|
666
|
+
}
|
|
667
|
+
}), [w, T] = X(!1), [E, oe] = X(!1), D = We({ mutationKey: a.signIn.all }) + We({ mutationKey: a.signUp.all }) > 0, se = h.find((e) => e.captchaComponent)?.captchaComponent, ce = async (e) => {
|
|
668
|
+
e.preventDefault();
|
|
669
|
+
let t = new FormData(e.currentTarget), n = t.get("name") ?? "", r = t.get("email");
|
|
670
|
+
if (f?.confirmPassword && x !== ne) {
|
|
671
|
+
Y.danger(p.auth.passwordsDoNotMatch), S(""), C("");
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
let i = {};
|
|
675
|
+
for (let e of c ?? []) {
|
|
676
|
+
if (!e.signUp || e.readOnly) continue;
|
|
677
|
+
let n = l(e, t.get(e.name));
|
|
678
|
+
if (e.validate) try {
|
|
679
|
+
await e.validate(n);
|
|
680
|
+
} catch (e) {
|
|
681
|
+
Y.danger(e instanceof Error ? e.message : String(e));
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
n !== void 0 && (i[e.name] = n);
|
|
685
|
+
}
|
|
686
|
+
re({
|
|
687
|
+
name: n,
|
|
688
|
+
email: r,
|
|
689
|
+
password: x,
|
|
690
|
+
...i,
|
|
691
|
+
fetchOptions: ee
|
|
692
|
+
});
|
|
693
|
+
}, le = f?.enabled && !!_?.length;
|
|
694
|
+
return /* @__PURE__ */ $(M, {
|
|
695
|
+
className: J("w-full max-w-sm gap-4 md:p-6", t),
|
|
696
|
+
variant: o,
|
|
697
|
+
...s,
|
|
698
|
+
children: [
|
|
699
|
+
/* @__PURE__ */ Q(M.Header, { children: /* @__PURE__ */ Q(M.Title, {
|
|
700
|
+
className: "text-xl font-semibold mb-1",
|
|
701
|
+
children: p.auth.signUp
|
|
702
|
+
}) }),
|
|
703
|
+
/* @__PURE__ */ $(M.Content, {
|
|
704
|
+
className: "gap-4",
|
|
705
|
+
children: [
|
|
706
|
+
i === "top" && /* @__PURE__ */ $(Z, { children: [!!_?.length && /* @__PURE__ */ Q(r, { socialLayout: n }), le && /* @__PURE__ */ Q(e, { children: p.auth.or })] }),
|
|
707
|
+
f?.enabled && /* @__PURE__ */ $(L, {
|
|
708
|
+
onSubmit: ce,
|
|
709
|
+
className: "flex flex-col gap-4",
|
|
710
|
+
children: [
|
|
711
|
+
f.name !== !1 && /* @__PURE__ */ $(q, {
|
|
712
|
+
name: "name",
|
|
713
|
+
type: "text",
|
|
714
|
+
autoComplete: "name",
|
|
715
|
+
isDisabled: D,
|
|
716
|
+
children: [
|
|
717
|
+
/* @__PURE__ */ Q(B, { children: p.auth.name }),
|
|
718
|
+
/* @__PURE__ */ Q(R, {
|
|
719
|
+
placeholder: p.auth.namePlaceholder,
|
|
720
|
+
required: !0,
|
|
721
|
+
variant: o === "transparent" ? "primary" : "secondary"
|
|
722
|
+
}),
|
|
723
|
+
/* @__PURE__ */ Q(F, {})
|
|
724
|
+
]
|
|
725
|
+
}),
|
|
726
|
+
/* @__PURE__ */ $(q, {
|
|
727
|
+
name: "email",
|
|
728
|
+
type: "email",
|
|
729
|
+
autoComplete: "email",
|
|
730
|
+
isDisabled: D,
|
|
731
|
+
children: [
|
|
732
|
+
/* @__PURE__ */ Q(B, { children: p.auth.email }),
|
|
733
|
+
/* @__PURE__ */ Q(R, {
|
|
734
|
+
placeholder: p.auth.emailPlaceholder,
|
|
735
|
+
required: !0,
|
|
736
|
+
variant: o === "transparent" ? "primary" : "secondary"
|
|
737
|
+
}),
|
|
738
|
+
/* @__PURE__ */ Q(F, {})
|
|
739
|
+
]
|
|
740
|
+
}),
|
|
741
|
+
c?.map((e) => e.signUp === "above" && /* @__PURE__ */ Q(it, {
|
|
742
|
+
name: e.name,
|
|
743
|
+
field: e,
|
|
744
|
+
isPending: D,
|
|
745
|
+
variant: o
|
|
746
|
+
}, e.name)),
|
|
747
|
+
/* @__PURE__ */ $(q, {
|
|
748
|
+
minLength: f?.minPasswordLength,
|
|
749
|
+
maxLength: f?.maxPasswordLength,
|
|
750
|
+
name: "password",
|
|
751
|
+
autoComplete: "new-password",
|
|
752
|
+
isDisabled: D,
|
|
753
|
+
value: x,
|
|
754
|
+
onChange: S,
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ Q(B, { children: p.auth.password }),
|
|
757
|
+
/* @__PURE__ */ $(z, {
|
|
758
|
+
variant: o === "transparent" ? "primary" : "secondary",
|
|
759
|
+
children: [/* @__PURE__ */ Q(z.Input, {
|
|
760
|
+
placeholder: p.auth.passwordPlaceholder,
|
|
761
|
+
type: w ? "text" : "password",
|
|
762
|
+
name: "password",
|
|
763
|
+
required: !0
|
|
764
|
+
}), /* @__PURE__ */ Q(z.Suffix, {
|
|
765
|
+
className: "px-0",
|
|
766
|
+
children: /* @__PURE__ */ Q(A, {
|
|
767
|
+
isIconOnly: !0,
|
|
768
|
+
"aria-label": w ? p.auth.hidePassword : p.auth.showPassword,
|
|
769
|
+
size: "sm",
|
|
770
|
+
variant: "ghost",
|
|
771
|
+
onPress: () => T(!w),
|
|
772
|
+
isDisabled: D,
|
|
773
|
+
children: Q(w ? k : O, {})
|
|
774
|
+
})
|
|
775
|
+
})]
|
|
776
|
+
}),
|
|
777
|
+
/* @__PURE__ */ Q(F, {})
|
|
778
|
+
]
|
|
779
|
+
}),
|
|
780
|
+
f?.confirmPassword && /* @__PURE__ */ $(q, {
|
|
781
|
+
minLength: f?.minPasswordLength,
|
|
782
|
+
maxLength: f?.maxPasswordLength,
|
|
783
|
+
name: "confirmPassword",
|
|
784
|
+
autoComplete: "new-password",
|
|
785
|
+
isDisabled: D,
|
|
786
|
+
value: ne,
|
|
787
|
+
onChange: C,
|
|
788
|
+
children: [
|
|
789
|
+
/* @__PURE__ */ Q(B, { children: p.auth.confirmPassword }),
|
|
790
|
+
/* @__PURE__ */ $(z, {
|
|
791
|
+
variant: o === "transparent" ? "primary" : "secondary",
|
|
792
|
+
children: [/* @__PURE__ */ Q(z.Input, {
|
|
793
|
+
name: "confirmPassword",
|
|
794
|
+
placeholder: p.auth.confirmPasswordPlaceholder,
|
|
795
|
+
type: E ? "text" : "password",
|
|
796
|
+
required: !0
|
|
797
|
+
}), /* @__PURE__ */ Q(z.Suffix, {
|
|
798
|
+
className: "px-0",
|
|
799
|
+
children: /* @__PURE__ */ Q(A, {
|
|
800
|
+
isIconOnly: !0,
|
|
801
|
+
"aria-label": E ? p.auth.hidePassword : p.auth.showPassword,
|
|
802
|
+
size: "sm",
|
|
803
|
+
variant: "ghost",
|
|
804
|
+
onPress: () => oe(!E),
|
|
805
|
+
isDisabled: D,
|
|
806
|
+
children: Q(E ? k : O, {})
|
|
807
|
+
})
|
|
808
|
+
})]
|
|
809
|
+
}),
|
|
810
|
+
/* @__PURE__ */ Q(F, {})
|
|
811
|
+
]
|
|
812
|
+
}),
|
|
813
|
+
c?.map((e) => e.signUp && e.signUp !== "above" && /* @__PURE__ */ Q(it, {
|
|
814
|
+
name: e.name,
|
|
815
|
+
field: e,
|
|
816
|
+
isPending: D,
|
|
817
|
+
variant: o
|
|
818
|
+
}, e.name)),
|
|
819
|
+
se && /* @__PURE__ */ Q("div", {
|
|
820
|
+
className: "flex justify-center",
|
|
821
|
+
children: se
|
|
822
|
+
}),
|
|
823
|
+
/* @__PURE__ */ $("div", {
|
|
824
|
+
className: "flex flex-col gap-3",
|
|
825
|
+
children: [/* @__PURE__ */ $(A, {
|
|
826
|
+
type: "submit",
|
|
827
|
+
className: "w-full",
|
|
828
|
+
isPending: D,
|
|
829
|
+
children: [ie && /* @__PURE__ */ Q(G, {
|
|
830
|
+
color: "current",
|
|
831
|
+
size: "sm"
|
|
832
|
+
}), p.auth.signUp]
|
|
833
|
+
}), h.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ Q(t, { view: "signUp" }, `${e.id}-${n.toString()}`)))]
|
|
834
|
+
})
|
|
835
|
+
]
|
|
836
|
+
}),
|
|
837
|
+
i === "bottom" && /* @__PURE__ */ $(Z, { children: [le && /* @__PURE__ */ Q(e, { children: p.auth.or }), !!_?.length && /* @__PURE__ */ Q(r, { socialLayout: n })] })
|
|
838
|
+
]
|
|
839
|
+
}),
|
|
840
|
+
/* @__PURE__ */ Q(M.Footer, {
|
|
841
|
+
className: "flex-col gap-3",
|
|
842
|
+
children: /* @__PURE__ */ $(Te, {
|
|
843
|
+
className: "text-sm",
|
|
844
|
+
children: [
|
|
845
|
+
p.auth.alreadyHaveAnAccount,
|
|
846
|
+
" ",
|
|
847
|
+
/* @__PURE__ */ Q(V, {
|
|
848
|
+
href: `${d.auth}/${y.auth.signIn}`,
|
|
849
|
+
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
850
|
+
children: p.auth.signIn
|
|
851
|
+
})
|
|
852
|
+
]
|
|
853
|
+
})
|
|
854
|
+
})
|
|
855
|
+
]
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
//#endregion
|
|
859
|
+
//#region src/components/auth/auth.tsx
|
|
860
|
+
var ut = [
|
|
861
|
+
"signUp",
|
|
862
|
+
"forgotPassword",
|
|
863
|
+
"resetPassword"
|
|
864
|
+
], dt = {
|
|
865
|
+
signIn: st,
|
|
866
|
+
signOut: ct,
|
|
867
|
+
signUp: lt,
|
|
868
|
+
forgotPassword: at,
|
|
869
|
+
resetPassword: ot
|
|
870
|
+
};
|
|
871
|
+
function ft({ path: e, socialLayout: t, socialPosition: n, view: r, ...i }) {
|
|
872
|
+
let { basePaths: a, emailAndPassword: o, plugins: s, viewPaths: c, navigate: l } = m();
|
|
873
|
+
if (!r && !e) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
|
|
874
|
+
let u = r || Object.keys(c.auth).find((t) => c.auth[t] === e), d = !o?.enabled && u && ut.includes(u);
|
|
875
|
+
if (ze(() => {
|
|
876
|
+
d && l({
|
|
877
|
+
to: `${a.auth}/${c.auth.signIn}`,
|
|
878
|
+
replace: !0
|
|
879
|
+
});
|
|
880
|
+
}, [
|
|
881
|
+
d,
|
|
882
|
+
l,
|
|
883
|
+
a.auth,
|
|
884
|
+
c.auth.signIn
|
|
885
|
+
]), d) return null;
|
|
886
|
+
for (let a of s) {
|
|
887
|
+
let o = a.viewPaths?.auth, s = r ?? u ?? (o && Object.keys(o).find((t) => o[t] === e));
|
|
888
|
+
if (!s) continue;
|
|
889
|
+
let c = a.views?.auth?.[s];
|
|
890
|
+
if (c) return /* @__PURE__ */ Q(c, {
|
|
891
|
+
socialLayout: t,
|
|
892
|
+
socialPosition: n,
|
|
893
|
+
...i
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
if (u === "signIn" && !o?.enabled) {
|
|
897
|
+
let e = s.find((e) => e.fallbackViews?.auth?.signIn)?.fallbackViews?.auth?.signIn;
|
|
898
|
+
if (e) return /* @__PURE__ */ Q(e, {
|
|
899
|
+
socialLayout: t,
|
|
900
|
+
socialPosition: n,
|
|
901
|
+
...i
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
let f = u ? dt[u] : void 0;
|
|
905
|
+
if (!f) throw Error(`[Better Auth UI] Unknown view "${u}". Valid views are: ${Object.keys(dt).join(", ")}`);
|
|
906
|
+
return /* @__PURE__ */ Q(f, {
|
|
907
|
+
socialLayout: t,
|
|
908
|
+
socialPosition: n,
|
|
909
|
+
...i
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
//#endregion
|
|
913
|
+
//#region src/components/auth/error-toaster.tsx
|
|
914
|
+
function pt() {
|
|
915
|
+
let e = Ge();
|
|
916
|
+
return ze(() => {
|
|
917
|
+
let t = e.getQueryCache().subscribe((e) => {
|
|
918
|
+
if (e.type !== "updated" || e.action.type !== "error" || !Ue({ queryKey: o.all }, e.query)) return;
|
|
919
|
+
let t = e.action.error;
|
|
920
|
+
t?.error && Y.danger(t.error.message);
|
|
921
|
+
}), n = e.getMutationCache().subscribe((e) => {
|
|
922
|
+
if (e.type !== "updated" || e.action.type !== "error" || !He({ mutationKey: a.all }, e.mutation)) return;
|
|
923
|
+
let t = e.action.error;
|
|
924
|
+
Y.danger(t.error?.message || t.message);
|
|
925
|
+
});
|
|
926
|
+
return () => {
|
|
927
|
+
t(), n();
|
|
928
|
+
};
|
|
929
|
+
}, [e]), null;
|
|
930
|
+
}
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region src/components/auth/auth-provider.tsx
|
|
933
|
+
function mt({ children: e, navigate: t, ...n }) {
|
|
934
|
+
return /* @__PURE__ */ Q(d, {
|
|
935
|
+
navigate: t,
|
|
936
|
+
...n,
|
|
937
|
+
children: /* @__PURE__ */ $(Ee, {
|
|
938
|
+
navigate: (e) => t({ to: e }),
|
|
939
|
+
children: [e, /* @__PURE__ */ Q(pt, {})]
|
|
940
|
+
})
|
|
941
|
+
});
|
|
942
|
+
}
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region src/components/auth/settings/account/change-email.tsx
|
|
945
|
+
function ht({ className: e, variant: t, ...n }) {
|
|
946
|
+
let { authClient: r, localization: i, baseURL: a, viewPaths: o } = m(), { data: s } = C(r), { mutate: c, isPending: l } = g(r, { onSuccess: () => Y.success(i.settings.changeEmailSuccess) });
|
|
947
|
+
function u(e) {
|
|
948
|
+
e.preventDefault(), c({
|
|
949
|
+
newEmail: new FormData(e.currentTarget).get("email"),
|
|
950
|
+
callbackURL: `${a}/${o.settings.account}`
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
|
|
954
|
+
className: J("text-sm font-semibold mb-3"),
|
|
955
|
+
children: i.settings.changeEmail
|
|
956
|
+
}), /* @__PURE__ */ Q(M, {
|
|
957
|
+
className: J("p-4 gap-4", e),
|
|
958
|
+
variant: t,
|
|
959
|
+
...n,
|
|
960
|
+
children: /* @__PURE__ */ Q(M.Content, { children: /* @__PURE__ */ Q(L, {
|
|
961
|
+
onSubmit: u,
|
|
962
|
+
children: /* @__PURE__ */ $(I, {
|
|
963
|
+
className: "w-full gap-4",
|
|
964
|
+
children: [/* @__PURE__ */ Q(I.Group, { children: /* @__PURE__ */ $(q, {
|
|
965
|
+
name: "email",
|
|
966
|
+
type: "email",
|
|
967
|
+
defaultValue: s?.user.email,
|
|
968
|
+
isDisabled: l || !s,
|
|
969
|
+
children: [
|
|
970
|
+
/* @__PURE__ */ Q(B, { children: i.auth.email }),
|
|
971
|
+
s ? /* @__PURE__ */ Q(R, {
|
|
972
|
+
required: !0,
|
|
973
|
+
variant: t === "transparent" ? "primary" : "secondary",
|
|
974
|
+
autoComplete: "email",
|
|
975
|
+
placeholder: i.auth.emailPlaceholder
|
|
976
|
+
}) : /* @__PURE__ */ Q(W, { className: "h-10 md:h-9 w-full rounded-xl" }),
|
|
977
|
+
/* @__PURE__ */ Q(F, {})
|
|
978
|
+
]
|
|
979
|
+
}, `${s?.user.id}-${s?.user.email}-email`) }), /* @__PURE__ */ Q(I.Actions, { children: /* @__PURE__ */ $(A, {
|
|
980
|
+
type: "submit",
|
|
981
|
+
isPending: l,
|
|
982
|
+
isDisabled: !s,
|
|
983
|
+
size: "sm",
|
|
984
|
+
children: [l && /* @__PURE__ */ Q(G, {
|
|
985
|
+
color: "current",
|
|
986
|
+
size: "sm"
|
|
987
|
+
}), i.settings.updateEmail]
|
|
988
|
+
}) })]
|
|
989
|
+
})
|
|
990
|
+
}) })
|
|
991
|
+
})] });
|
|
992
|
+
}
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region src/components/auth/settings/account/change-avatar.tsx
|
|
995
|
+
function gt({ className: e }) {
|
|
996
|
+
let { authClient: t, localization: r, avatar: i } = m(), { data: a } = C(t), { mutate: o, isPending: c } = T(t), l = Ve(null), [u, d] = X(!1), [f, p] = X(!1), h = c || u || f;
|
|
997
|
+
async function g(e) {
|
|
998
|
+
let t = e.target.files?.[0];
|
|
999
|
+
if (t) {
|
|
1000
|
+
e.target.value = "", d(!0);
|
|
1001
|
+
try {
|
|
1002
|
+
let e = await i.resize?.(t, i.size, i.extension) || t;
|
|
1003
|
+
o({ image: await i.upload?.(e) || await s(e) }, { onSuccess: () => Y.success(r.settings.avatarChangedSuccess) });
|
|
1004
|
+
} catch (e) {
|
|
1005
|
+
e instanceof Error && Y.danger(e.message);
|
|
1006
|
+
}
|
|
1007
|
+
d(!1);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
async function _() {
|
|
1011
|
+
let e = a?.user.image;
|
|
1012
|
+
o({ image: null }, { onSuccess: async () => {
|
|
1013
|
+
if (e) {
|
|
1014
|
+
p(!0);
|
|
1015
|
+
try {
|
|
1016
|
+
await i.delete?.(e);
|
|
1017
|
+
} finally {
|
|
1018
|
+
p(!1);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
Y.success(r.settings.avatarDeletedSuccess);
|
|
1022
|
+
} });
|
|
1023
|
+
}
|
|
1024
|
+
return /* @__PURE__ */ $("div", {
|
|
1025
|
+
className: J("flex flex-col gap-1", e),
|
|
1026
|
+
children: [
|
|
1027
|
+
/* @__PURE__ */ Q(B, {
|
|
1028
|
+
isDisabled: !a,
|
|
1029
|
+
children: r.settings.avatar
|
|
1030
|
+
}),
|
|
1031
|
+
/* @__PURE__ */ Q("input", {
|
|
1032
|
+
ref: l,
|
|
1033
|
+
type: "file",
|
|
1034
|
+
accept: "image/*",
|
|
1035
|
+
className: "hidden",
|
|
1036
|
+
onChange: g
|
|
1037
|
+
}),
|
|
1038
|
+
/* @__PURE__ */ $("div", {
|
|
1039
|
+
className: "flex items-center gap-4",
|
|
1040
|
+
children: [/* @__PURE__ */ Q(A, {
|
|
1041
|
+
type: "button",
|
|
1042
|
+
isIconOnly: !0,
|
|
1043
|
+
variant: "ghost",
|
|
1044
|
+
className: "p-0 h-auto w-auto rounded-full",
|
|
1045
|
+
isDisabled: !a || h,
|
|
1046
|
+
onPress: () => l.current?.click(),
|
|
1047
|
+
children: /* @__PURE__ */ Q(n, {
|
|
1048
|
+
size: "lg",
|
|
1049
|
+
isPending: h
|
|
1050
|
+
})
|
|
1051
|
+
}), /* @__PURE__ */ $(P, { children: [/* @__PURE__ */ $(A, {
|
|
1052
|
+
isDisabled: !a || h,
|
|
1053
|
+
size: "sm",
|
|
1054
|
+
variant: "secondary",
|
|
1055
|
+
children: [h && /* @__PURE__ */ Q(G, { size: "sm" }), r.settings.changeAvatar]
|
|
1056
|
+
}), /* @__PURE__ */ Q(P.Popover, {
|
|
1057
|
+
className: "min-w-fit",
|
|
1058
|
+
children: /* @__PURE__ */ $(P.Menu, { children: [/* @__PURE__ */ $(P.Item, {
|
|
1059
|
+
textValue: r.settings.uploadAvatar,
|
|
1060
|
+
onAction: () => l.current?.click(),
|
|
1061
|
+
children: [/* @__PURE__ */ Q(ce, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: r.settings.uploadAvatar })]
|
|
1062
|
+
}), /* @__PURE__ */ $(P.Item, {
|
|
1063
|
+
textValue: r.settings.deleteAvatar,
|
|
1064
|
+
isDisabled: !a?.user.image,
|
|
1065
|
+
onAction: _,
|
|
1066
|
+
variant: "danger",
|
|
1067
|
+
children: [/* @__PURE__ */ Q(ye, { className: "text-danger" }), /* @__PURE__ */ Q(B, { children: r.settings.deleteAvatar })]
|
|
1068
|
+
})] })
|
|
1069
|
+
})] })]
|
|
1070
|
+
})
|
|
1071
|
+
]
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
//#endregion
|
|
1075
|
+
//#region src/components/auth/settings/account/user-profile.tsx
|
|
1076
|
+
function _t({ className: e, variant: t, ...n }) {
|
|
1077
|
+
let { additionalFields: r, authClient: i, localization: a } = m(), { data: o } = C(i), { mutate: s, isPending: c } = T(i, { onSuccess: () => Y.success(a.settings.profileUpdatedSuccess) });
|
|
1078
|
+
async function u(e) {
|
|
1079
|
+
e.preventDefault();
|
|
1080
|
+
let t = new FormData(e.currentTarget), n = t.get("name"), i = {};
|
|
1081
|
+
for (let e of r ?? []) {
|
|
1082
|
+
if (e.profile === !1 || e.readOnly) continue;
|
|
1083
|
+
let n = l(e, t.get(e.name));
|
|
1084
|
+
if (e.validate) try {
|
|
1085
|
+
await e.validate(n);
|
|
1086
|
+
} catch (e) {
|
|
1087
|
+
Y.danger(e instanceof Error ? e.message : String(e));
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
n !== void 0 && (i[e.name] = n);
|
|
1091
|
+
}
|
|
1092
|
+
s({
|
|
1093
|
+
name: n,
|
|
1094
|
+
...i
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
|
|
1098
|
+
className: J("text-sm font-semibold mb-3"),
|
|
1099
|
+
children: a.settings.userProfile
|
|
1100
|
+
}), /* @__PURE__ */ Q(M, {
|
|
1101
|
+
className: J("p-4 gap-4", e),
|
|
1102
|
+
variant: t,
|
|
1103
|
+
...n,
|
|
1104
|
+
children: /* @__PURE__ */ Q(M.Content, { children: /* @__PURE__ */ $(L, {
|
|
1105
|
+
onSubmit: u,
|
|
1106
|
+
className: "flex flex-col gap-4",
|
|
1107
|
+
children: [
|
|
1108
|
+
/* @__PURE__ */ Q(gt, {}),
|
|
1109
|
+
/* @__PURE__ */ $(q, {
|
|
1110
|
+
name: "name",
|
|
1111
|
+
defaultValue: o?.user.name,
|
|
1112
|
+
isDisabled: c || !o,
|
|
1113
|
+
children: [
|
|
1114
|
+
/* @__PURE__ */ Q(B, { children: a.auth.name }),
|
|
1115
|
+
/* @__PURE__ */ Q(R, {
|
|
1116
|
+
className: J(!o && "hidden"),
|
|
1117
|
+
autoComplete: "name",
|
|
1118
|
+
placeholder: a.auth.name,
|
|
1119
|
+
variant: t === "transparent" ? "primary" : "secondary"
|
|
1120
|
+
}),
|
|
1121
|
+
!o && /* @__PURE__ */ Q(W, { className: "h-10 md:h-9 w-full rounded-xl" }),
|
|
1122
|
+
/* @__PURE__ */ Q(F, {})
|
|
1123
|
+
]
|
|
1124
|
+
}, `${o?.user?.id}-${o?.user?.name}-name`),
|
|
1125
|
+
r?.filter((e) => e.profile !== !1).map((e) => {
|
|
1126
|
+
if (!o) return e.inputType === "hidden" ? null : /* @__PURE__ */ Q(W, { className: "h-10 md:h-9 w-full rounded-xl" }, e.name);
|
|
1127
|
+
let n = o.user[e.name], r = `${o.user.id}-${e.name}-${n instanceof Date ? n.toISOString() : String(n ?? "")}`;
|
|
1128
|
+
return /* @__PURE__ */ Q(it, {
|
|
1129
|
+
name: e.name,
|
|
1130
|
+
field: {
|
|
1131
|
+
...e,
|
|
1132
|
+
defaultValue: n
|
|
1133
|
+
},
|
|
1134
|
+
isPending: c,
|
|
1135
|
+
variant: t
|
|
1136
|
+
}, r);
|
|
1137
|
+
}),
|
|
1138
|
+
/* @__PURE__ */ $(A, {
|
|
1139
|
+
type: "submit",
|
|
1140
|
+
isPending: c,
|
|
1141
|
+
isDisabled: !o,
|
|
1142
|
+
size: "sm",
|
|
1143
|
+
className: "self-start mt-1",
|
|
1144
|
+
children: [c && /* @__PURE__ */ Q(G, {
|
|
1145
|
+
color: "current",
|
|
1146
|
+
size: "sm"
|
|
1147
|
+
}), a.settings.saveChanges]
|
|
1148
|
+
})
|
|
1149
|
+
]
|
|
1150
|
+
}) })
|
|
1151
|
+
})] });
|
|
1152
|
+
}
|
|
1153
|
+
//#endregion
|
|
1154
|
+
//#region src/components/auth/settings/account/account-settings.tsx
|
|
1155
|
+
function vt({ className: e, variant: t, ...n }) {
|
|
1156
|
+
let { emailAndPassword: r, plugins: i } = m(), a = i.some((e) => e.id === "magicLink");
|
|
1157
|
+
return /* @__PURE__ */ $("div", {
|
|
1158
|
+
className: J("flex w-full flex-col gap-4 md:gap-6", e),
|
|
1159
|
+
...n,
|
|
1160
|
+
children: [
|
|
1161
|
+
/* @__PURE__ */ Q(_t, { variant: t }),
|
|
1162
|
+
(r?.enabled || a) && /* @__PURE__ */ Q(ht, { variant: t }),
|
|
1163
|
+
i.flatMap((e) => e.accountCards?.map((n, r) => /* @__PURE__ */ Q(n, { variant: t }, `${e.id}-${r.toString()}`)))
|
|
1164
|
+
]
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
//#endregion
|
|
1168
|
+
//#region src/components/auth/settings/security/active-session.tsx
|
|
1169
|
+
var yt = /* @__PURE__ */ et((/* @__PURE__ */ Qe(((e, t) => {
|
|
1170
|
+
(function(n, r) {
|
|
1171
|
+
typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define([], r) : typeof e == "object" ? e.bowser = r() : n.bowser = r();
|
|
1172
|
+
})(e, (function() {
|
|
1173
|
+
return function(e) {
|
|
1174
|
+
var t = {};
|
|
1175
|
+
function n(r) {
|
|
1176
|
+
if (t[r]) return t[r].exports;
|
|
1177
|
+
var i = t[r] = {
|
|
1178
|
+
i: r,
|
|
1179
|
+
l: !1,
|
|
1180
|
+
exports: {}
|
|
1181
|
+
};
|
|
1182
|
+
return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
|
|
1183
|
+
}
|
|
1184
|
+
return n.m = e, n.c = t, n.d = function(e, t, r) {
|
|
1185
|
+
n.o(e, t) || Object.defineProperty(e, t, {
|
|
1186
|
+
enumerable: !0,
|
|
1187
|
+
get: r
|
|
1188
|
+
});
|
|
1189
|
+
}, n.r = function(e) {
|
|
1190
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1191
|
+
}, n.t = function(e, t) {
|
|
1192
|
+
if (1 & t && (e = n(e)), 8 & t || 4 & t && typeof e == "object" && e && e.__esModule) return e;
|
|
1193
|
+
var r = Object.create(null);
|
|
1194
|
+
if (n.r(r), Object.defineProperty(r, "default", {
|
|
1195
|
+
enumerable: !0,
|
|
1196
|
+
value: e
|
|
1197
|
+
}), 2 & t && typeof e != "string") for (var i in e) n.d(r, i, function(t) {
|
|
1198
|
+
return e[t];
|
|
1199
|
+
}.bind(null, i));
|
|
1200
|
+
return r;
|
|
1201
|
+
}, n.n = function(e) {
|
|
1202
|
+
var t = e && e.__esModule ? function() {
|
|
1203
|
+
return e.default;
|
|
1204
|
+
} : function() {
|
|
1205
|
+
return e;
|
|
1206
|
+
};
|
|
1207
|
+
return n.d(t, "a", t), t;
|
|
1208
|
+
}, n.o = function(e, t) {
|
|
1209
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
1210
|
+
}, n.p = "", n(n.s = 90);
|
|
1211
|
+
}({
|
|
1212
|
+
17: function(e, t, n) {
|
|
1213
|
+
t.__esModule = !0, t.default = void 0;
|
|
1214
|
+
var r = n(18);
|
|
1215
|
+
t.default = function() {
|
|
1216
|
+
function e() {}
|
|
1217
|
+
return e.getFirstMatch = function(e, t) {
|
|
1218
|
+
var n = t.match(e);
|
|
1219
|
+
return n && n.length > 0 && n[1] || "";
|
|
1220
|
+
}, e.getSecondMatch = function(e, t) {
|
|
1221
|
+
var n = t.match(e);
|
|
1222
|
+
return n && n.length > 1 && n[2] || "";
|
|
1223
|
+
}, e.matchAndReturnConst = function(e, t, n) {
|
|
1224
|
+
if (e.test(t)) return n;
|
|
1225
|
+
}, e.getWindowsVersionName = function(e) {
|
|
1226
|
+
switch (e) {
|
|
1227
|
+
case "NT": return "NT";
|
|
1228
|
+
case "XP": return "XP";
|
|
1229
|
+
case "NT 5.0": return "2000";
|
|
1230
|
+
case "NT 5.1": return "XP";
|
|
1231
|
+
case "NT 5.2": return "2003";
|
|
1232
|
+
case "NT 6.0": return "Vista";
|
|
1233
|
+
case "NT 6.1": return "7";
|
|
1234
|
+
case "NT 6.2": return "8";
|
|
1235
|
+
case "NT 6.3": return "8.1";
|
|
1236
|
+
case "NT 10.0": return "10";
|
|
1237
|
+
default: return;
|
|
1238
|
+
}
|
|
1239
|
+
}, e.getMacOSVersionName = function(e) {
|
|
1240
|
+
var t = e.split(".").splice(0, 2).map((function(e) {
|
|
1241
|
+
return parseInt(e, 10) || 0;
|
|
1242
|
+
}));
|
|
1243
|
+
t.push(0);
|
|
1244
|
+
var n = t[0], r = t[1];
|
|
1245
|
+
if (n === 10) switch (r) {
|
|
1246
|
+
case 5: return "Leopard";
|
|
1247
|
+
case 6: return "Snow Leopard";
|
|
1248
|
+
case 7: return "Lion";
|
|
1249
|
+
case 8: return "Mountain Lion";
|
|
1250
|
+
case 9: return "Mavericks";
|
|
1251
|
+
case 10: return "Yosemite";
|
|
1252
|
+
case 11: return "El Capitan";
|
|
1253
|
+
case 12: return "Sierra";
|
|
1254
|
+
case 13: return "High Sierra";
|
|
1255
|
+
case 14: return "Mojave";
|
|
1256
|
+
case 15: return "Catalina";
|
|
1257
|
+
default: return;
|
|
1258
|
+
}
|
|
1259
|
+
switch (n) {
|
|
1260
|
+
case 11: return "Big Sur";
|
|
1261
|
+
case 12: return "Monterey";
|
|
1262
|
+
case 13: return "Ventura";
|
|
1263
|
+
case 14: return "Sonoma";
|
|
1264
|
+
case 15: return "Sequoia";
|
|
1265
|
+
default: return;
|
|
1266
|
+
}
|
|
1267
|
+
}, e.getAndroidVersionName = function(e) {
|
|
1268
|
+
var t = e.split(".").splice(0, 2).map((function(e) {
|
|
1269
|
+
return parseInt(e, 10) || 0;
|
|
1270
|
+
}));
|
|
1271
|
+
if (t.push(0), !(t[0] === 1 && t[1] < 5)) return t[0] === 1 && t[1] < 6 ? "Cupcake" : t[0] === 1 && t[1] >= 6 ? "Donut" : t[0] === 2 && t[1] < 2 ? "Eclair" : t[0] === 2 && t[1] === 2 ? "Froyo" : t[0] === 2 && t[1] > 2 ? "Gingerbread" : t[0] === 3 ? "Honeycomb" : t[0] === 4 && t[1] < 1 ? "Ice Cream Sandwich" : t[0] === 4 && t[1] < 4 ? "Jelly Bean" : t[0] === 4 && t[1] >= 4 ? "KitKat" : t[0] === 5 ? "Lollipop" : t[0] === 6 ? "Marshmallow" : t[0] === 7 ? "Nougat" : t[0] === 8 ? "Oreo" : t[0] === 9 ? "Pie" : void 0;
|
|
1272
|
+
}, e.getVersionPrecision = function(e) {
|
|
1273
|
+
return e.split(".").length;
|
|
1274
|
+
}, e.compareVersions = function(t, n, r) {
|
|
1275
|
+
r === void 0 && (r = !1);
|
|
1276
|
+
var i = e.getVersionPrecision(t), a = e.getVersionPrecision(n), o = Math.max(i, a), s = 0, c = e.map([t, n], (function(t) {
|
|
1277
|
+
var n = o - e.getVersionPrecision(t), r = t + Array(n + 1).join(".0");
|
|
1278
|
+
return e.map(r.split("."), (function(e) {
|
|
1279
|
+
return Array(20 - e.length).join("0") + e;
|
|
1280
|
+
})).reverse();
|
|
1281
|
+
}));
|
|
1282
|
+
for (r && (s = o - Math.min(i, a)), --o; o >= s;) {
|
|
1283
|
+
if (c[0][o] > c[1][o]) return 1;
|
|
1284
|
+
if (c[0][o] === c[1][o]) {
|
|
1285
|
+
if (o === s) return 0;
|
|
1286
|
+
--o;
|
|
1287
|
+
} else if (c[0][o] < c[1][o]) return -1;
|
|
1288
|
+
}
|
|
1289
|
+
}, e.map = function(e, t) {
|
|
1290
|
+
var n, r = [];
|
|
1291
|
+
if (Array.prototype.map) return Array.prototype.map.call(e, t);
|
|
1292
|
+
for (n = 0; n < e.length; n += 1) r.push(t(e[n]));
|
|
1293
|
+
return r;
|
|
1294
|
+
}, e.find = function(e, t) {
|
|
1295
|
+
var n, r;
|
|
1296
|
+
if (Array.prototype.find) return Array.prototype.find.call(e, t);
|
|
1297
|
+
for (n = 0, r = e.length; n < r; n += 1) {
|
|
1298
|
+
var i = e[n];
|
|
1299
|
+
if (t(i, n)) return i;
|
|
1300
|
+
}
|
|
1301
|
+
}, e.assign = function(e) {
|
|
1302
|
+
for (var t, n, r = e, i = arguments.length, a = Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++) a[o - 1] = arguments[o];
|
|
1303
|
+
if (Object.assign) return Object.assign.apply(Object, [e].concat(a));
|
|
1304
|
+
var s = function() {
|
|
1305
|
+
var e = a[t];
|
|
1306
|
+
typeof e == "object" && e && Object.keys(e).forEach((function(t) {
|
|
1307
|
+
r[t] = e[t];
|
|
1308
|
+
}));
|
|
1309
|
+
};
|
|
1310
|
+
for (t = 0, n = a.length; t < n; t += 1) s();
|
|
1311
|
+
return e;
|
|
1312
|
+
}, e.getBrowserAlias = function(e) {
|
|
1313
|
+
return r.BROWSER_ALIASES_MAP[e];
|
|
1314
|
+
}, e.getBrowserTypeByAlias = function(e) {
|
|
1315
|
+
return r.BROWSER_MAP[e] || "";
|
|
1316
|
+
}, e;
|
|
1317
|
+
}(), e.exports = t.default;
|
|
1318
|
+
},
|
|
1319
|
+
18: function(e, t, n) {
|
|
1320
|
+
t.__esModule = !0, t.ENGINE_MAP = t.OS_MAP = t.PLATFORMS_MAP = t.BROWSER_MAP = t.BROWSER_ALIASES_MAP = void 0, t.BROWSER_ALIASES_MAP = {
|
|
1321
|
+
AmazonBot: "amazonbot",
|
|
1322
|
+
"Amazon Silk": "amazon_silk",
|
|
1323
|
+
"Android Browser": "android",
|
|
1324
|
+
BaiduSpider: "baiduspider",
|
|
1325
|
+
Bada: "bada",
|
|
1326
|
+
BingCrawler: "bingcrawler",
|
|
1327
|
+
Brave: "brave",
|
|
1328
|
+
BlackBerry: "blackberry",
|
|
1329
|
+
"ChatGPT-User": "chatgpt_user",
|
|
1330
|
+
Chrome: "chrome",
|
|
1331
|
+
ClaudeBot: "claudebot",
|
|
1332
|
+
Chromium: "chromium",
|
|
1333
|
+
Diffbot: "diffbot",
|
|
1334
|
+
DuckDuckBot: "duckduckbot",
|
|
1335
|
+
DuckDuckGo: "duckduckgo",
|
|
1336
|
+
Electron: "electron",
|
|
1337
|
+
Epiphany: "epiphany",
|
|
1338
|
+
FacebookExternalHit: "facebookexternalhit",
|
|
1339
|
+
Firefox: "firefox",
|
|
1340
|
+
Focus: "focus",
|
|
1341
|
+
Generic: "generic",
|
|
1342
|
+
"Google Search": "google_search",
|
|
1343
|
+
Googlebot: "googlebot",
|
|
1344
|
+
GPTBot: "gptbot",
|
|
1345
|
+
"Internet Explorer": "ie",
|
|
1346
|
+
InternetArchiveCrawler: "internetarchivecrawler",
|
|
1347
|
+
"K-Meleon": "k_meleon",
|
|
1348
|
+
LibreWolf: "librewolf",
|
|
1349
|
+
Linespider: "linespider",
|
|
1350
|
+
Maxthon: "maxthon",
|
|
1351
|
+
"Meta-ExternalAds": "meta_externalads",
|
|
1352
|
+
"Meta-ExternalAgent": "meta_externalagent",
|
|
1353
|
+
"Meta-ExternalFetcher": "meta_externalfetcher",
|
|
1354
|
+
"Meta-WebIndexer": "meta_webindexer",
|
|
1355
|
+
"Microsoft Edge": "edge",
|
|
1356
|
+
"MZ Browser": "mz",
|
|
1357
|
+
"NAVER Whale Browser": "naver",
|
|
1358
|
+
"OAI-SearchBot": "oai_searchbot",
|
|
1359
|
+
Omgilibot: "omgilibot",
|
|
1360
|
+
Opera: "opera",
|
|
1361
|
+
"Opera Coast": "opera_coast",
|
|
1362
|
+
"Pale Moon": "pale_moon",
|
|
1363
|
+
PerplexityBot: "perplexitybot",
|
|
1364
|
+
"Perplexity-User": "perplexity_user",
|
|
1365
|
+
PhantomJS: "phantomjs",
|
|
1366
|
+
PingdomBot: "pingdombot",
|
|
1367
|
+
Puffin: "puffin",
|
|
1368
|
+
QQ: "qq",
|
|
1369
|
+
QQLite: "qqlite",
|
|
1370
|
+
QupZilla: "qupzilla",
|
|
1371
|
+
Roku: "roku",
|
|
1372
|
+
Safari: "safari",
|
|
1373
|
+
Sailfish: "sailfish",
|
|
1374
|
+
"Samsung Internet for Android": "samsung_internet",
|
|
1375
|
+
SlackBot: "slackbot",
|
|
1376
|
+
SeaMonkey: "seamonkey",
|
|
1377
|
+
Sleipnir: "sleipnir",
|
|
1378
|
+
"Sogou Browser": "sogou",
|
|
1379
|
+
Swing: "swing",
|
|
1380
|
+
Tizen: "tizen",
|
|
1381
|
+
"UC Browser": "uc",
|
|
1382
|
+
Vivaldi: "vivaldi",
|
|
1383
|
+
"WebOS Browser": "webos",
|
|
1384
|
+
WeChat: "wechat",
|
|
1385
|
+
YahooSlurp: "yahooslurp",
|
|
1386
|
+
"Yandex Browser": "yandex",
|
|
1387
|
+
YandexBot: "yandexbot",
|
|
1388
|
+
YouBot: "youbot"
|
|
1389
|
+
}, t.BROWSER_MAP = {
|
|
1390
|
+
amazonbot: "AmazonBot",
|
|
1391
|
+
amazon_silk: "Amazon Silk",
|
|
1392
|
+
android: "Android Browser",
|
|
1393
|
+
baiduspider: "BaiduSpider",
|
|
1394
|
+
bada: "Bada",
|
|
1395
|
+
bingcrawler: "BingCrawler",
|
|
1396
|
+
blackberry: "BlackBerry",
|
|
1397
|
+
brave: "Brave",
|
|
1398
|
+
chatgpt_user: "ChatGPT-User",
|
|
1399
|
+
chrome: "Chrome",
|
|
1400
|
+
claudebot: "ClaudeBot",
|
|
1401
|
+
chromium: "Chromium",
|
|
1402
|
+
diffbot: "Diffbot",
|
|
1403
|
+
duckduckbot: "DuckDuckBot",
|
|
1404
|
+
duckduckgo: "DuckDuckGo",
|
|
1405
|
+
edge: "Microsoft Edge",
|
|
1406
|
+
electron: "Electron",
|
|
1407
|
+
epiphany: "Epiphany",
|
|
1408
|
+
facebookexternalhit: "FacebookExternalHit",
|
|
1409
|
+
firefox: "Firefox",
|
|
1410
|
+
focus: "Focus",
|
|
1411
|
+
generic: "Generic",
|
|
1412
|
+
google_search: "Google Search",
|
|
1413
|
+
googlebot: "Googlebot",
|
|
1414
|
+
gptbot: "GPTBot",
|
|
1415
|
+
ie: "Internet Explorer",
|
|
1416
|
+
internetarchivecrawler: "InternetArchiveCrawler",
|
|
1417
|
+
k_meleon: "K-Meleon",
|
|
1418
|
+
librewolf: "LibreWolf",
|
|
1419
|
+
linespider: "Linespider",
|
|
1420
|
+
maxthon: "Maxthon",
|
|
1421
|
+
meta_externalads: "Meta-ExternalAds",
|
|
1422
|
+
meta_externalagent: "Meta-ExternalAgent",
|
|
1423
|
+
meta_externalfetcher: "Meta-ExternalFetcher",
|
|
1424
|
+
meta_webindexer: "Meta-WebIndexer",
|
|
1425
|
+
mz: "MZ Browser",
|
|
1426
|
+
naver: "NAVER Whale Browser",
|
|
1427
|
+
oai_searchbot: "OAI-SearchBot",
|
|
1428
|
+
omgilibot: "Omgilibot",
|
|
1429
|
+
opera: "Opera",
|
|
1430
|
+
opera_coast: "Opera Coast",
|
|
1431
|
+
pale_moon: "Pale Moon",
|
|
1432
|
+
perplexitybot: "PerplexityBot",
|
|
1433
|
+
perplexity_user: "Perplexity-User",
|
|
1434
|
+
phantomjs: "PhantomJS",
|
|
1435
|
+
pingdombot: "PingdomBot",
|
|
1436
|
+
puffin: "Puffin",
|
|
1437
|
+
qq: "QQ Browser",
|
|
1438
|
+
qqlite: "QQ Browser Lite",
|
|
1439
|
+
qupzilla: "QupZilla",
|
|
1440
|
+
roku: "Roku",
|
|
1441
|
+
safari: "Safari",
|
|
1442
|
+
sailfish: "Sailfish",
|
|
1443
|
+
samsung_internet: "Samsung Internet for Android",
|
|
1444
|
+
seamonkey: "SeaMonkey",
|
|
1445
|
+
slackbot: "SlackBot",
|
|
1446
|
+
sleipnir: "Sleipnir",
|
|
1447
|
+
sogou: "Sogou Browser",
|
|
1448
|
+
swing: "Swing",
|
|
1449
|
+
tizen: "Tizen",
|
|
1450
|
+
uc: "UC Browser",
|
|
1451
|
+
vivaldi: "Vivaldi",
|
|
1452
|
+
webos: "WebOS Browser",
|
|
1453
|
+
wechat: "WeChat",
|
|
1454
|
+
yahooslurp: "YahooSlurp",
|
|
1455
|
+
yandex: "Yandex Browser",
|
|
1456
|
+
yandexbot: "YandexBot",
|
|
1457
|
+
youbot: "YouBot"
|
|
1458
|
+
}, t.PLATFORMS_MAP = {
|
|
1459
|
+
bot: "bot",
|
|
1460
|
+
desktop: "desktop",
|
|
1461
|
+
mobile: "mobile",
|
|
1462
|
+
tablet: "tablet",
|
|
1463
|
+
tv: "tv"
|
|
1464
|
+
}, t.OS_MAP = {
|
|
1465
|
+
Android: "Android",
|
|
1466
|
+
Bada: "Bada",
|
|
1467
|
+
BlackBerry: "BlackBerry",
|
|
1468
|
+
ChromeOS: "Chrome OS",
|
|
1469
|
+
HarmonyOS: "HarmonyOS",
|
|
1470
|
+
iOS: "iOS",
|
|
1471
|
+
Linux: "Linux",
|
|
1472
|
+
MacOS: "macOS",
|
|
1473
|
+
PlayStation4: "PlayStation 4",
|
|
1474
|
+
Roku: "Roku",
|
|
1475
|
+
Tizen: "Tizen",
|
|
1476
|
+
WebOS: "WebOS",
|
|
1477
|
+
Windows: "Windows",
|
|
1478
|
+
WindowsPhone: "Windows Phone"
|
|
1479
|
+
}, t.ENGINE_MAP = {
|
|
1480
|
+
Blink: "Blink",
|
|
1481
|
+
EdgeHTML: "EdgeHTML",
|
|
1482
|
+
Gecko: "Gecko",
|
|
1483
|
+
Presto: "Presto",
|
|
1484
|
+
Trident: "Trident",
|
|
1485
|
+
WebKit: "WebKit"
|
|
1486
|
+
};
|
|
1487
|
+
},
|
|
1488
|
+
90: function(e, t, n) {
|
|
1489
|
+
t.__esModule = !0, t.default = void 0;
|
|
1490
|
+
var r, i = (r = n(91)) && r.__esModule ? r : { default: r }, a = n(18);
|
|
1491
|
+
function o(e, t) {
|
|
1492
|
+
for (var n = 0; n < t.length; n++) {
|
|
1493
|
+
var r = t[n];
|
|
1494
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
t.default = function() {
|
|
1498
|
+
function e() {}
|
|
1499
|
+
var t, n, r;
|
|
1500
|
+
return e.getParser = function(e, t, n) {
|
|
1501
|
+
if (t === void 0 && (t = !1), n === void 0 && (n = null), typeof e != "string") throw Error("UserAgent should be a string");
|
|
1502
|
+
return new i.default(e, t, n);
|
|
1503
|
+
}, e.parse = function(e, t) {
|
|
1504
|
+
return t === void 0 && (t = null), new i.default(e, t).getResult();
|
|
1505
|
+
}, t = e, r = [
|
|
1506
|
+
{
|
|
1507
|
+
key: "BROWSER_MAP",
|
|
1508
|
+
get: function() {
|
|
1509
|
+
return a.BROWSER_MAP;
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
key: "ENGINE_MAP",
|
|
1514
|
+
get: function() {
|
|
1515
|
+
return a.ENGINE_MAP;
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
key: "OS_MAP",
|
|
1520
|
+
get: function() {
|
|
1521
|
+
return a.OS_MAP;
|
|
1522
|
+
}
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
key: "PLATFORMS_MAP",
|
|
1526
|
+
get: function() {
|
|
1527
|
+
return a.PLATFORMS_MAP;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
], (n = null) && o(t.prototype, n), r && o(t, r), e;
|
|
1531
|
+
}(), e.exports = t.default;
|
|
1532
|
+
},
|
|
1533
|
+
91: function(e, t, n) {
|
|
1534
|
+
t.__esModule = !0, t.default = void 0;
|
|
1535
|
+
var r = c(n(92)), i = c(n(93)), a = c(n(94)), o = c(n(95)), s = c(n(17));
|
|
1536
|
+
function c(e) {
|
|
1537
|
+
return e && e.__esModule ? e : { default: e };
|
|
1538
|
+
}
|
|
1539
|
+
t.default = function() {
|
|
1540
|
+
function e(e, t, n) {
|
|
1541
|
+
if (t === void 0 && (t = !1), n === void 0 && (n = null), e == null || e === "") throw Error("UserAgent parameter can't be empty");
|
|
1542
|
+
this._ua = e;
|
|
1543
|
+
var r = !1;
|
|
1544
|
+
typeof t == "boolean" ? (r = t, this._hints = n) : this._hints = typeof t == "object" && t ? t : null, this.parsedResult = {}, !0 !== r && this.parse();
|
|
1545
|
+
}
|
|
1546
|
+
var t = e.prototype;
|
|
1547
|
+
return t.getHints = function() {
|
|
1548
|
+
return this._hints;
|
|
1549
|
+
}, t.hasBrand = function(e) {
|
|
1550
|
+
if (!this._hints || !Array.isArray(this._hints.brands)) return !1;
|
|
1551
|
+
var t = e.toLowerCase();
|
|
1552
|
+
return this._hints.brands.some((function(e) {
|
|
1553
|
+
return e.brand && e.brand.toLowerCase() === t;
|
|
1554
|
+
}));
|
|
1555
|
+
}, t.getBrandVersion = function(e) {
|
|
1556
|
+
if (this._hints && Array.isArray(this._hints.brands)) {
|
|
1557
|
+
var t = e.toLowerCase(), n = this._hints.brands.find((function(e) {
|
|
1558
|
+
return e.brand && e.brand.toLowerCase() === t;
|
|
1559
|
+
}));
|
|
1560
|
+
return n ? n.version : void 0;
|
|
1561
|
+
}
|
|
1562
|
+
}, t.getUA = function() {
|
|
1563
|
+
return this._ua;
|
|
1564
|
+
}, t.test = function(e) {
|
|
1565
|
+
return e.test(this._ua);
|
|
1566
|
+
}, t.parseBrowser = function() {
|
|
1567
|
+
var e = this;
|
|
1568
|
+
this.parsedResult.browser = {};
|
|
1569
|
+
var t = s.default.find(r.default, (function(t) {
|
|
1570
|
+
if (typeof t.test == "function") return t.test(e);
|
|
1571
|
+
if (Array.isArray(t.test)) return t.test.some((function(t) {
|
|
1572
|
+
return e.test(t);
|
|
1573
|
+
}));
|
|
1574
|
+
throw Error("Browser's test function is not valid");
|
|
1575
|
+
}));
|
|
1576
|
+
return t && (this.parsedResult.browser = t.describe(this.getUA(), this)), this.parsedResult.browser;
|
|
1577
|
+
}, t.getBrowser = function() {
|
|
1578
|
+
return this.parsedResult.browser ? this.parsedResult.browser : this.parseBrowser();
|
|
1579
|
+
}, t.getBrowserName = function(e) {
|
|
1580
|
+
return e ? String(this.getBrowser().name).toLowerCase() || "" : this.getBrowser().name || "";
|
|
1581
|
+
}, t.getBrowserVersion = function() {
|
|
1582
|
+
return this.getBrowser().version;
|
|
1583
|
+
}, t.getOS = function() {
|
|
1584
|
+
return this.parsedResult.os ? this.parsedResult.os : this.parseOS();
|
|
1585
|
+
}, t.parseOS = function() {
|
|
1586
|
+
var e = this;
|
|
1587
|
+
this.parsedResult.os = {};
|
|
1588
|
+
var t = s.default.find(i.default, (function(t) {
|
|
1589
|
+
if (typeof t.test == "function") return t.test(e);
|
|
1590
|
+
if (Array.isArray(t.test)) return t.test.some((function(t) {
|
|
1591
|
+
return e.test(t);
|
|
1592
|
+
}));
|
|
1593
|
+
throw Error("Browser's test function is not valid");
|
|
1594
|
+
}));
|
|
1595
|
+
return t && (this.parsedResult.os = t.describe(this.getUA())), this.parsedResult.os;
|
|
1596
|
+
}, t.getOSName = function(e) {
|
|
1597
|
+
var t = this.getOS().name;
|
|
1598
|
+
return e ? String(t).toLowerCase() || "" : t || "";
|
|
1599
|
+
}, t.getOSVersion = function() {
|
|
1600
|
+
return this.getOS().version;
|
|
1601
|
+
}, t.getPlatform = function() {
|
|
1602
|
+
return this.parsedResult.platform ? this.parsedResult.platform : this.parsePlatform();
|
|
1603
|
+
}, t.getPlatformType = function(e) {
|
|
1604
|
+
e === void 0 && (e = !1);
|
|
1605
|
+
var t = this.getPlatform().type;
|
|
1606
|
+
return e ? String(t).toLowerCase() || "" : t || "";
|
|
1607
|
+
}, t.parsePlatform = function() {
|
|
1608
|
+
var e = this;
|
|
1609
|
+
this.parsedResult.platform = {};
|
|
1610
|
+
var t = s.default.find(a.default, (function(t) {
|
|
1611
|
+
if (typeof t.test == "function") return t.test(e);
|
|
1612
|
+
if (Array.isArray(t.test)) return t.test.some((function(t) {
|
|
1613
|
+
return e.test(t);
|
|
1614
|
+
}));
|
|
1615
|
+
throw Error("Browser's test function is not valid");
|
|
1616
|
+
}));
|
|
1617
|
+
return t && (this.parsedResult.platform = t.describe(this.getUA())), this.parsedResult.platform;
|
|
1618
|
+
}, t.getEngine = function() {
|
|
1619
|
+
return this.parsedResult.engine ? this.parsedResult.engine : this.parseEngine();
|
|
1620
|
+
}, t.getEngineName = function(e) {
|
|
1621
|
+
return e ? String(this.getEngine().name).toLowerCase() || "" : this.getEngine().name || "";
|
|
1622
|
+
}, t.parseEngine = function() {
|
|
1623
|
+
var e = this;
|
|
1624
|
+
this.parsedResult.engine = {};
|
|
1625
|
+
var t = s.default.find(o.default, (function(t) {
|
|
1626
|
+
if (typeof t.test == "function") return t.test(e);
|
|
1627
|
+
if (Array.isArray(t.test)) return t.test.some((function(t) {
|
|
1628
|
+
return e.test(t);
|
|
1629
|
+
}));
|
|
1630
|
+
throw Error("Browser's test function is not valid");
|
|
1631
|
+
}));
|
|
1632
|
+
return t && (this.parsedResult.engine = t.describe(this.getUA())), this.parsedResult.engine;
|
|
1633
|
+
}, t.parse = function() {
|
|
1634
|
+
return this.parseBrowser(), this.parseOS(), this.parsePlatform(), this.parseEngine(), this;
|
|
1635
|
+
}, t.getResult = function() {
|
|
1636
|
+
return s.default.assign({}, this.parsedResult);
|
|
1637
|
+
}, t.satisfies = function(e) {
|
|
1638
|
+
var t = this, n = {}, r = 0, i = {}, a = 0;
|
|
1639
|
+
if (Object.keys(e).forEach((function(t) {
|
|
1640
|
+
var o = e[t];
|
|
1641
|
+
typeof o == "string" ? (i[t] = o, a += 1) : typeof o == "object" && (n[t] = o, r += 1);
|
|
1642
|
+
})), r > 0) {
|
|
1643
|
+
var o = Object.keys(n), c = s.default.find(o, (function(e) {
|
|
1644
|
+
return t.isOS(e);
|
|
1645
|
+
}));
|
|
1646
|
+
if (c) {
|
|
1647
|
+
var l = this.satisfies(n[c]);
|
|
1648
|
+
if (l !== void 0) return l;
|
|
1649
|
+
}
|
|
1650
|
+
var u = s.default.find(o, (function(e) {
|
|
1651
|
+
return t.isPlatform(e);
|
|
1652
|
+
}));
|
|
1653
|
+
if (u) {
|
|
1654
|
+
var d = this.satisfies(n[u]);
|
|
1655
|
+
if (d !== void 0) return d;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
if (a > 0) {
|
|
1659
|
+
var f = Object.keys(i), p = s.default.find(f, (function(e) {
|
|
1660
|
+
return t.isBrowser(e, !0);
|
|
1661
|
+
}));
|
|
1662
|
+
if (p !== void 0) return this.compareVersion(i[p]);
|
|
1663
|
+
}
|
|
1664
|
+
}, t.isBrowser = function(e, t) {
|
|
1665
|
+
t === void 0 && (t = !1);
|
|
1666
|
+
var n = this.getBrowserName().toLowerCase(), r = e.toLowerCase(), i = s.default.getBrowserTypeByAlias(r);
|
|
1667
|
+
return t && i && (r = i.toLowerCase()), r === n;
|
|
1668
|
+
}, t.compareVersion = function(e) {
|
|
1669
|
+
var t = [0], n = e, r = !1, i = this.getBrowserVersion();
|
|
1670
|
+
if (typeof i == "string") return e[0] === ">" || e[0] === "<" ? (n = e.substr(1), e[1] === "=" ? (r = !0, n = e.substr(2)) : t = [], e[0] === ">" ? t.push(1) : t.push(-1)) : e[0] === "=" ? n = e.substr(1) : e[0] === "~" && (r = !0, n = e.substr(1)), t.indexOf(s.default.compareVersions(i, n, r)) > -1;
|
|
1671
|
+
}, t.isOS = function(e) {
|
|
1672
|
+
return this.getOSName(!0) === String(e).toLowerCase();
|
|
1673
|
+
}, t.isPlatform = function(e) {
|
|
1674
|
+
return this.getPlatformType(!0) === String(e).toLowerCase();
|
|
1675
|
+
}, t.isEngine = function(e) {
|
|
1676
|
+
return this.getEngineName(!0) === String(e).toLowerCase();
|
|
1677
|
+
}, t.is = function(e, t) {
|
|
1678
|
+
return t === void 0 && (t = !1), this.isBrowser(e, t) || this.isOS(e) || this.isPlatform(e);
|
|
1679
|
+
}, t.some = function(e) {
|
|
1680
|
+
var t = this;
|
|
1681
|
+
return e === void 0 && (e = []), e.some((function(e) {
|
|
1682
|
+
return t.is(e);
|
|
1683
|
+
}));
|
|
1684
|
+
}, e;
|
|
1685
|
+
}(), e.exports = t.default;
|
|
1686
|
+
},
|
|
1687
|
+
92: function(e, t, n) {
|
|
1688
|
+
t.__esModule = !0, t.default = void 0;
|
|
1689
|
+
var r, i = (r = n(17)) && r.__esModule ? r : { default: r }, a = /version\/(\d+(\.?_?\d+)+)/i;
|
|
1690
|
+
t.default = [
|
|
1691
|
+
{
|
|
1692
|
+
test: [/gptbot/i],
|
|
1693
|
+
describe: function(e) {
|
|
1694
|
+
var t = { name: "GPTBot" }, n = i.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1695
|
+
return n && (t.version = n), t;
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
test: [/chatgpt-user/i],
|
|
1700
|
+
describe: function(e) {
|
|
1701
|
+
var t = { name: "ChatGPT-User" }, n = i.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1702
|
+
return n && (t.version = n), t;
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
test: [/oai-searchbot/i],
|
|
1707
|
+
describe: function(e) {
|
|
1708
|
+
var t = { name: "OAI-SearchBot" }, n = i.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1709
|
+
return n && (t.version = n), t;
|
|
1710
|
+
}
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
test: [
|
|
1714
|
+
/claudebot/i,
|
|
1715
|
+
/claude-web/i,
|
|
1716
|
+
/claude-user/i,
|
|
1717
|
+
/claude-searchbot/i
|
|
1718
|
+
],
|
|
1719
|
+
describe: function(e) {
|
|
1720
|
+
var t = { name: "ClaudeBot" }, n = i.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1721
|
+
return n && (t.version = n), t;
|
|
1722
|
+
}
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
test: [/omgilibot/i, /webzio-extended/i],
|
|
1726
|
+
describe: function(e) {
|
|
1727
|
+
var t = { name: "Omgilibot" }, n = i.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1728
|
+
return n && (t.version = n), t;
|
|
1729
|
+
}
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
test: [/diffbot/i],
|
|
1733
|
+
describe: function(e) {
|
|
1734
|
+
var t = { name: "Diffbot" }, n = i.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1735
|
+
return n && (t.version = n), t;
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
test: [/perplexitybot/i],
|
|
1740
|
+
describe: function(e) {
|
|
1741
|
+
var t = { name: "PerplexityBot" }, n = i.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1742
|
+
return n && (t.version = n), t;
|
|
1743
|
+
}
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
test: [/perplexity-user/i],
|
|
1747
|
+
describe: function(e) {
|
|
1748
|
+
var t = { name: "Perplexity-User" }, n = i.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1749
|
+
return n && (t.version = n), t;
|
|
1750
|
+
}
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
test: [/youbot/i],
|
|
1754
|
+
describe: function(e) {
|
|
1755
|
+
var t = { name: "YouBot" }, n = i.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1756
|
+
return n && (t.version = n), t;
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
test: [/meta-webindexer/i],
|
|
1761
|
+
describe: function(e) {
|
|
1762
|
+
var t = { name: "Meta-WebIndexer" }, n = i.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1763
|
+
return n && (t.version = n), t;
|
|
1764
|
+
}
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
test: [/meta-externalads/i],
|
|
1768
|
+
describe: function(e) {
|
|
1769
|
+
var t = { name: "Meta-ExternalAds" }, n = i.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1770
|
+
return n && (t.version = n), t;
|
|
1771
|
+
}
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
test: [/meta-externalagent/i],
|
|
1775
|
+
describe: function(e) {
|
|
1776
|
+
var t = { name: "Meta-ExternalAgent" }, n = i.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1777
|
+
return n && (t.version = n), t;
|
|
1778
|
+
}
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
test: [/meta-externalfetcher/i],
|
|
1782
|
+
describe: function(e) {
|
|
1783
|
+
var t = { name: "Meta-ExternalFetcher" }, n = i.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1784
|
+
return n && (t.version = n), t;
|
|
1785
|
+
}
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
test: [/googlebot/i],
|
|
1789
|
+
describe: function(e) {
|
|
1790
|
+
var t = { name: "Googlebot" }, n = i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, e) || i.default.getFirstMatch(a, e);
|
|
1791
|
+
return n && (t.version = n), t;
|
|
1792
|
+
}
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
test: [/linespider/i],
|
|
1796
|
+
describe: function(e) {
|
|
1797
|
+
var t = { name: "Linespider" }, n = i.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1798
|
+
return n && (t.version = n), t;
|
|
1799
|
+
}
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
test: [/amazonbot/i],
|
|
1803
|
+
describe: function(e) {
|
|
1804
|
+
var t = { name: "AmazonBot" }, n = i.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1805
|
+
return n && (t.version = n), t;
|
|
1806
|
+
}
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
test: [/bingbot/i],
|
|
1810
|
+
describe: function(e) {
|
|
1811
|
+
var t = { name: "BingCrawler" }, n = i.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1812
|
+
return n && (t.version = n), t;
|
|
1813
|
+
}
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
test: [/baiduspider/i],
|
|
1817
|
+
describe: function(e) {
|
|
1818
|
+
var t = { name: "BaiduSpider" }, n = i.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1819
|
+
return n && (t.version = n), t;
|
|
1820
|
+
}
|
|
1821
|
+
},
|
|
1822
|
+
{
|
|
1823
|
+
test: [/duckduckbot/i],
|
|
1824
|
+
describe: function(e) {
|
|
1825
|
+
var t = { name: "DuckDuckBot" }, n = i.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1826
|
+
return n && (t.version = n), t;
|
|
1827
|
+
}
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
test: [/ia_archiver/i],
|
|
1831
|
+
describe: function(e) {
|
|
1832
|
+
var t = { name: "InternetArchiveCrawler" }, n = i.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1833
|
+
return n && (t.version = n), t;
|
|
1834
|
+
}
|
|
1835
|
+
},
|
|
1836
|
+
{
|
|
1837
|
+
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
|
1838
|
+
describe: function() {
|
|
1839
|
+
return { name: "FacebookExternalHit" };
|
|
1840
|
+
}
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
test: [/slackbot/i, /slack-imgProxy/i],
|
|
1844
|
+
describe: function(e) {
|
|
1845
|
+
var t = { name: "SlackBot" }, n = i.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1846
|
+
return n && (t.version = n), t;
|
|
1847
|
+
}
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
test: [/yahoo!?[\s/]*slurp/i],
|
|
1851
|
+
describe: function() {
|
|
1852
|
+
return { name: "YahooSlurp" };
|
|
1853
|
+
}
|
|
1854
|
+
},
|
|
1855
|
+
{
|
|
1856
|
+
test: [/yandexbot/i, /yandexmobilebot/i],
|
|
1857
|
+
describe: function() {
|
|
1858
|
+
return { name: "YandexBot" };
|
|
1859
|
+
}
|
|
1860
|
+
},
|
|
1861
|
+
{
|
|
1862
|
+
test: [/pingdom/i],
|
|
1863
|
+
describe: function() {
|
|
1864
|
+
return { name: "PingdomBot" };
|
|
1865
|
+
}
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
test: [/opera/i],
|
|
1869
|
+
describe: function(e) {
|
|
1870
|
+
var t = { name: "Opera" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1871
|
+
return n && (t.version = n), t;
|
|
1872
|
+
}
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
test: [/opr\/|opios/i],
|
|
1876
|
+
describe: function(e) {
|
|
1877
|
+
var t = { name: "Opera" }, n = i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1878
|
+
return n && (t.version = n), t;
|
|
1879
|
+
}
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
test: [/SamsungBrowser/i],
|
|
1883
|
+
describe: function(e) {
|
|
1884
|
+
var t = { name: "Samsung Internet for Android" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1885
|
+
return n && (t.version = n), t;
|
|
1886
|
+
}
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
test: [/Whale/i],
|
|
1890
|
+
describe: function(e) {
|
|
1891
|
+
var t = { name: "NAVER Whale Browser" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i, e);
|
|
1892
|
+
return n && (t.version = n), t;
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
test: [/PaleMoon/i],
|
|
1897
|
+
describe: function(e) {
|
|
1898
|
+
var t = { name: "Pale Moon" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i, e);
|
|
1899
|
+
return n && (t.version = n), t;
|
|
1900
|
+
}
|
|
1901
|
+
},
|
|
1902
|
+
{
|
|
1903
|
+
test: [/MZBrowser/i],
|
|
1904
|
+
describe: function(e) {
|
|
1905
|
+
var t = { name: "MZ Browser" }, n = i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1906
|
+
return n && (t.version = n), t;
|
|
1907
|
+
}
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
test: [/focus/i],
|
|
1911
|
+
describe: function(e) {
|
|
1912
|
+
var t = { name: "Focus" }, n = i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1913
|
+
return n && (t.version = n), t;
|
|
1914
|
+
}
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
test: [/swing/i],
|
|
1918
|
+
describe: function(e) {
|
|
1919
|
+
var t = { name: "Swing" }, n = i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1920
|
+
return n && (t.version = n), t;
|
|
1921
|
+
}
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
test: [/coast/i],
|
|
1925
|
+
describe: function(e) {
|
|
1926
|
+
var t = { name: "Opera Coast" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1927
|
+
return n && (t.version = n), t;
|
|
1928
|
+
}
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
test: [/opt\/\d+(?:.?_?\d+)+/i],
|
|
1932
|
+
describe: function(e) {
|
|
1933
|
+
var t = { name: "Opera Touch" }, n = i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1934
|
+
return n && (t.version = n), t;
|
|
1935
|
+
}
|
|
1936
|
+
},
|
|
1937
|
+
{
|
|
1938
|
+
test: [/yabrowser/i],
|
|
1939
|
+
describe: function(e) {
|
|
1940
|
+
var t = { name: "Yandex Browser" }, n = i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1941
|
+
return n && (t.version = n), t;
|
|
1942
|
+
}
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
test: [/ucbrowser/i],
|
|
1946
|
+
describe: function(e) {
|
|
1947
|
+
var t = { name: "UC Browser" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1948
|
+
return n && (t.version = n), t;
|
|
1949
|
+
}
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
test: [/Maxthon|mxios/i],
|
|
1953
|
+
describe: function(e) {
|
|
1954
|
+
var t = { name: "Maxthon" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1955
|
+
return n && (t.version = n), t;
|
|
1956
|
+
}
|
|
1957
|
+
},
|
|
1958
|
+
{
|
|
1959
|
+
test: [/epiphany/i],
|
|
1960
|
+
describe: function(e) {
|
|
1961
|
+
var t = { name: "Epiphany" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1962
|
+
return n && (t.version = n), t;
|
|
1963
|
+
}
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
test: [/puffin/i],
|
|
1967
|
+
describe: function(e) {
|
|
1968
|
+
var t = { name: "Puffin" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1969
|
+
return n && (t.version = n), t;
|
|
1970
|
+
}
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
test: [/sleipnir/i],
|
|
1974
|
+
describe: function(e) {
|
|
1975
|
+
var t = { name: "Sleipnir" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1976
|
+
return n && (t.version = n), t;
|
|
1977
|
+
}
|
|
1978
|
+
},
|
|
1979
|
+
{
|
|
1980
|
+
test: [/k-meleon/i],
|
|
1981
|
+
describe: function(e) {
|
|
1982
|
+
var t = { name: "K-Meleon" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
1983
|
+
return n && (t.version = n), t;
|
|
1984
|
+
}
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
test: [/micromessenger/i],
|
|
1988
|
+
describe: function(e) {
|
|
1989
|
+
var t = { name: "WeChat" }, n = i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1990
|
+
return n && (t.version = n), t;
|
|
1991
|
+
}
|
|
1992
|
+
},
|
|
1993
|
+
{
|
|
1994
|
+
test: [/qqbrowser/i],
|
|
1995
|
+
describe: function(e) {
|
|
1996
|
+
var t = { name: /qqbrowserlite/i.test(e) ? "QQ Browser Lite" : "QQ Browser" }, n = i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
1997
|
+
return n && (t.version = n), t;
|
|
1998
|
+
}
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
test: [/msie|trident/i],
|
|
2002
|
+
describe: function(e) {
|
|
2003
|
+
var t = { name: "Internet Explorer" }, n = i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, e);
|
|
2004
|
+
return n && (t.version = n), t;
|
|
2005
|
+
}
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
test: [/\sedg\//i],
|
|
2009
|
+
describe: function(e) {
|
|
2010
|
+
var t = { name: "Microsoft Edge" }, n = i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, e);
|
|
2011
|
+
return n && (t.version = n), t;
|
|
2012
|
+
}
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
test: [/edg([ea]|ios)/i],
|
|
2016
|
+
describe: function(e) {
|
|
2017
|
+
var t = { name: "Microsoft Edge" }, n = i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, e);
|
|
2018
|
+
return n && (t.version = n), t;
|
|
2019
|
+
}
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
test: [/vivaldi/i],
|
|
2023
|
+
describe: function(e) {
|
|
2024
|
+
var t = { name: "Vivaldi" }, n = i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, e);
|
|
2025
|
+
return n && (t.version = n), t;
|
|
2026
|
+
}
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
test: [/seamonkey/i],
|
|
2030
|
+
describe: function(e) {
|
|
2031
|
+
var t = { name: "SeaMonkey" }, n = i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i, e);
|
|
2032
|
+
return n && (t.version = n), t;
|
|
2033
|
+
}
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
test: [/sailfish/i],
|
|
2037
|
+
describe: function(e) {
|
|
2038
|
+
var t = { name: "Sailfish" }, n = i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i, e);
|
|
2039
|
+
return n && (t.version = n), t;
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
{
|
|
2043
|
+
test: [/silk/i],
|
|
2044
|
+
describe: function(e) {
|
|
2045
|
+
var t = { name: "Amazon Silk" }, n = i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, e);
|
|
2046
|
+
return n && (t.version = n), t;
|
|
2047
|
+
}
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
test: [/phantom/i],
|
|
2051
|
+
describe: function(e) {
|
|
2052
|
+
var t = { name: "PhantomJS" }, n = i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i, e);
|
|
2053
|
+
return n && (t.version = n), t;
|
|
2054
|
+
}
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
test: [/slimerjs/i],
|
|
2058
|
+
describe: function(e) {
|
|
2059
|
+
var t = { name: "SlimerJS" }, n = i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, e);
|
|
2060
|
+
return n && (t.version = n), t;
|
|
2061
|
+
}
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
|
|
2065
|
+
describe: function(e) {
|
|
2066
|
+
var t = { name: "BlackBerry" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i, e);
|
|
2067
|
+
return n && (t.version = n), t;
|
|
2068
|
+
}
|
|
2069
|
+
},
|
|
2070
|
+
{
|
|
2071
|
+
test: [/(web|hpw)[o0]s/i],
|
|
2072
|
+
describe: function(e) {
|
|
2073
|
+
var t = { name: "WebOS Browser" }, n = i.default.getFirstMatch(a, e) || i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i, e);
|
|
2074
|
+
return n && (t.version = n), t;
|
|
2075
|
+
}
|
|
2076
|
+
},
|
|
2077
|
+
{
|
|
2078
|
+
test: [/bada/i],
|
|
2079
|
+
describe: function(e) {
|
|
2080
|
+
var t = { name: "Bada" }, n = i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, e);
|
|
2081
|
+
return n && (t.version = n), t;
|
|
2082
|
+
}
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
test: [/tizen/i],
|
|
2086
|
+
describe: function(e) {
|
|
2087
|
+
var t = { name: "Tizen" }, n = i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
2088
|
+
return n && (t.version = n), t;
|
|
2089
|
+
}
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
test: [/qupzilla/i],
|
|
2093
|
+
describe: function(e) {
|
|
2094
|
+
var t = { name: "QupZilla" }, n = i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
2095
|
+
return n && (t.version = n), t;
|
|
2096
|
+
}
|
|
2097
|
+
},
|
|
2098
|
+
{
|
|
2099
|
+
test: [/librewolf/i],
|
|
2100
|
+
describe: function(e) {
|
|
2101
|
+
var t = { name: "LibreWolf" }, n = i.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
2102
|
+
return n && (t.version = n), t;
|
|
2103
|
+
}
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
test: [/firefox|iceweasel|fxios/i],
|
|
2107
|
+
describe: function(e) {
|
|
2108
|
+
var t = { name: "Firefox" }, n = i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
2109
|
+
return n && (t.version = n), t;
|
|
2110
|
+
}
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
test: [/electron/i],
|
|
2114
|
+
describe: function(e) {
|
|
2115
|
+
var t = { name: "Electron" }, n = i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, e);
|
|
2116
|
+
return n && (t.version = n), t;
|
|
2117
|
+
}
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
test: [
|
|
2121
|
+
/sogoumobilebrowser/i,
|
|
2122
|
+
/metasr/i,
|
|
2123
|
+
/se 2\.[x]/i
|
|
2124
|
+
],
|
|
2125
|
+
describe: function(e) {
|
|
2126
|
+
var t = { name: "Sogou Browser" }, n = i.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i, e), r = i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, e), a = i.default.getFirstMatch(/se ([\d.]+)x/i, e), o = n || r || a;
|
|
2127
|
+
return o && (t.version = o), t;
|
|
2128
|
+
}
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
test: [/MiuiBrowser/i],
|
|
2132
|
+
describe: function(e) {
|
|
2133
|
+
var t = { name: "Miui" }, n = i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i, e);
|
|
2134
|
+
return n && (t.version = n), t;
|
|
2135
|
+
}
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
test: function(e) {
|
|
2139
|
+
return !!e.hasBrand("DuckDuckGo") || e.test(/\sDdg\/[\d.]+$/i);
|
|
2140
|
+
},
|
|
2141
|
+
describe: function(e, t) {
|
|
2142
|
+
var n = { name: "DuckDuckGo" };
|
|
2143
|
+
if (t) {
|
|
2144
|
+
var r = t.getBrandVersion("DuckDuckGo");
|
|
2145
|
+
if (r) return n.version = r, n;
|
|
2146
|
+
}
|
|
2147
|
+
var a = i.default.getFirstMatch(/\sDdg\/([\d.]+)$/i, e);
|
|
2148
|
+
return a && (n.version = a), n;
|
|
2149
|
+
}
|
|
2150
|
+
},
|
|
2151
|
+
{
|
|
2152
|
+
test: function(e) {
|
|
2153
|
+
return e.hasBrand("Brave");
|
|
2154
|
+
},
|
|
2155
|
+
describe: function(e, t) {
|
|
2156
|
+
var n = { name: "Brave" };
|
|
2157
|
+
if (t) {
|
|
2158
|
+
var r = t.getBrandVersion("Brave");
|
|
2159
|
+
if (r) return n.version = r, n;
|
|
2160
|
+
}
|
|
2161
|
+
return n;
|
|
2162
|
+
}
|
|
2163
|
+
},
|
|
2164
|
+
{
|
|
2165
|
+
test: [/chromium/i],
|
|
2166
|
+
describe: function(e) {
|
|
2167
|
+
var t = { name: "Chromium" }, n = i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, e) || i.default.getFirstMatch(a, e);
|
|
2168
|
+
return n && (t.version = n), t;
|
|
2169
|
+
}
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
test: [/chrome|crios|crmo/i],
|
|
2173
|
+
describe: function(e) {
|
|
2174
|
+
var t = { name: "Chrome" }, n = i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, e);
|
|
2175
|
+
return n && (t.version = n), t;
|
|
2176
|
+
}
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
test: [/GSA/i],
|
|
2180
|
+
describe: function(e) {
|
|
2181
|
+
var t = { name: "Google Search" }, n = i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, e);
|
|
2182
|
+
return n && (t.version = n), t;
|
|
2183
|
+
}
|
|
2184
|
+
},
|
|
2185
|
+
{
|
|
2186
|
+
test: function(e) {
|
|
2187
|
+
var t = !e.test(/like android/i), n = e.test(/android/i);
|
|
2188
|
+
return t && n;
|
|
2189
|
+
},
|
|
2190
|
+
describe: function(e) {
|
|
2191
|
+
var t = { name: "Android Browser" }, n = i.default.getFirstMatch(a, e);
|
|
2192
|
+
return n && (t.version = n), t;
|
|
2193
|
+
}
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
test: [/playstation 4/i],
|
|
2197
|
+
describe: function(e) {
|
|
2198
|
+
var t = { name: "PlayStation 4" }, n = i.default.getFirstMatch(a, e);
|
|
2199
|
+
return n && (t.version = n), t;
|
|
2200
|
+
}
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
test: [/safari|applewebkit/i],
|
|
2204
|
+
describe: function(e) {
|
|
2205
|
+
var t = { name: "Safari" }, n = i.default.getFirstMatch(a, e);
|
|
2206
|
+
return n && (t.version = n), t;
|
|
2207
|
+
}
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
test: [/.*/i],
|
|
2211
|
+
describe: function(e) {
|
|
2212
|
+
var t = e.search("\\(") === -1 ? /^(.*)\/(.*) / : /^(.*)\/(.*)[ \t]\((.*)/;
|
|
2213
|
+
return {
|
|
2214
|
+
name: i.default.getFirstMatch(t, e),
|
|
2215
|
+
version: i.default.getSecondMatch(t, e)
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
], e.exports = t.default;
|
|
2220
|
+
},
|
|
2221
|
+
93: function(e, t, n) {
|
|
2222
|
+
t.__esModule = !0, t.default = void 0;
|
|
2223
|
+
var r, i = (r = n(17)) && r.__esModule ? r : { default: r }, a = n(18);
|
|
2224
|
+
t.default = [
|
|
2225
|
+
{
|
|
2226
|
+
test: [/Roku\/DVP/],
|
|
2227
|
+
describe: function(e) {
|
|
2228
|
+
var t = i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, e);
|
|
2229
|
+
return {
|
|
2230
|
+
name: a.OS_MAP.Roku,
|
|
2231
|
+
version: t
|
|
2232
|
+
};
|
|
2233
|
+
}
|
|
2234
|
+
},
|
|
2235
|
+
{
|
|
2236
|
+
test: [/windows phone/i],
|
|
2237
|
+
describe: function(e) {
|
|
2238
|
+
var t = i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i, e);
|
|
2239
|
+
return {
|
|
2240
|
+
name: a.OS_MAP.WindowsPhone,
|
|
2241
|
+
version: t
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
},
|
|
2245
|
+
{
|
|
2246
|
+
test: [/windows /i],
|
|
2247
|
+
describe: function(e) {
|
|
2248
|
+
var t = i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, e), n = i.default.getWindowsVersionName(t);
|
|
2249
|
+
return {
|
|
2250
|
+
name: a.OS_MAP.Windows,
|
|
2251
|
+
version: t,
|
|
2252
|
+
versionName: n
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
test: [/Macintosh(.*?) FxiOS(.*?)\//],
|
|
2258
|
+
describe: function(e) {
|
|
2259
|
+
var t = { name: a.OS_MAP.iOS }, n = i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/, e);
|
|
2260
|
+
return n && (t.version = n), t;
|
|
2261
|
+
}
|
|
2262
|
+
},
|
|
2263
|
+
{
|
|
2264
|
+
test: [/macintosh/i],
|
|
2265
|
+
describe: function(e) {
|
|
2266
|
+
var t = i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, e).replace(/[_\s]/g, "."), n = i.default.getMacOSVersionName(t), r = {
|
|
2267
|
+
name: a.OS_MAP.MacOS,
|
|
2268
|
+
version: t
|
|
2269
|
+
};
|
|
2270
|
+
return n && (r.versionName = n), r;
|
|
2271
|
+
}
|
|
2272
|
+
},
|
|
2273
|
+
{
|
|
2274
|
+
test: [/(ipod|iphone|ipad)/i],
|
|
2275
|
+
describe: function(e) {
|
|
2276
|
+
var t = i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, e).replace(/[_\s]/g, ".");
|
|
2277
|
+
return {
|
|
2278
|
+
name: a.OS_MAP.iOS,
|
|
2279
|
+
version: t
|
|
2280
|
+
};
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
{
|
|
2284
|
+
test: [/OpenHarmony/i],
|
|
2285
|
+
describe: function(e) {
|
|
2286
|
+
var t = i.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i, e);
|
|
2287
|
+
return {
|
|
2288
|
+
name: a.OS_MAP.HarmonyOS,
|
|
2289
|
+
version: t
|
|
2290
|
+
};
|
|
2291
|
+
}
|
|
2292
|
+
},
|
|
2293
|
+
{
|
|
2294
|
+
test: function(e) {
|
|
2295
|
+
var t = !e.test(/like android/i), n = e.test(/android/i);
|
|
2296
|
+
return t && n;
|
|
2297
|
+
},
|
|
2298
|
+
describe: function(e) {
|
|
2299
|
+
var t = i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i, e), n = i.default.getAndroidVersionName(t), r = {
|
|
2300
|
+
name: a.OS_MAP.Android,
|
|
2301
|
+
version: t
|
|
2302
|
+
};
|
|
2303
|
+
return n && (r.versionName = n), r;
|
|
2304
|
+
}
|
|
2305
|
+
},
|
|
2306
|
+
{
|
|
2307
|
+
test: [/(web|hpw)[o0]s/i],
|
|
2308
|
+
describe: function(e) {
|
|
2309
|
+
var t = i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i, e), n = { name: a.OS_MAP.WebOS };
|
|
2310
|
+
return t && t.length && (n.version = t), n;
|
|
2311
|
+
}
|
|
2312
|
+
},
|
|
2313
|
+
{
|
|
2314
|
+
test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
|
|
2315
|
+
describe: function(e) {
|
|
2316
|
+
var t = i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i, e) || i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i, e) || i.default.getFirstMatch(/\bbb(\d+)/i, e);
|
|
2317
|
+
return {
|
|
2318
|
+
name: a.OS_MAP.BlackBerry,
|
|
2319
|
+
version: t
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
},
|
|
2323
|
+
{
|
|
2324
|
+
test: [/bada/i],
|
|
2325
|
+
describe: function(e) {
|
|
2326
|
+
var t = i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, e);
|
|
2327
|
+
return {
|
|
2328
|
+
name: a.OS_MAP.Bada,
|
|
2329
|
+
version: t
|
|
2330
|
+
};
|
|
2331
|
+
}
|
|
2332
|
+
},
|
|
2333
|
+
{
|
|
2334
|
+
test: [/tizen/i],
|
|
2335
|
+
describe: function(e) {
|
|
2336
|
+
var t = i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, e);
|
|
2337
|
+
return {
|
|
2338
|
+
name: a.OS_MAP.Tizen,
|
|
2339
|
+
version: t
|
|
2340
|
+
};
|
|
2341
|
+
}
|
|
2342
|
+
},
|
|
2343
|
+
{
|
|
2344
|
+
test: [/linux/i],
|
|
2345
|
+
describe: function() {
|
|
2346
|
+
return { name: a.OS_MAP.Linux };
|
|
2347
|
+
}
|
|
2348
|
+
},
|
|
2349
|
+
{
|
|
2350
|
+
test: [/CrOS/],
|
|
2351
|
+
describe: function() {
|
|
2352
|
+
return { name: a.OS_MAP.ChromeOS };
|
|
2353
|
+
}
|
|
2354
|
+
},
|
|
2355
|
+
{
|
|
2356
|
+
test: [/PlayStation 4/],
|
|
2357
|
+
describe: function(e) {
|
|
2358
|
+
var t = i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i, e);
|
|
2359
|
+
return {
|
|
2360
|
+
name: a.OS_MAP.PlayStation4,
|
|
2361
|
+
version: t
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
], e.exports = t.default;
|
|
2366
|
+
},
|
|
2367
|
+
94: function(e, t, n) {
|
|
2368
|
+
t.__esModule = !0, t.default = void 0;
|
|
2369
|
+
var r, i = (r = n(17)) && r.__esModule ? r : { default: r }, a = n(18);
|
|
2370
|
+
t.default = [
|
|
2371
|
+
{
|
|
2372
|
+
test: [/googlebot/i],
|
|
2373
|
+
describe: function() {
|
|
2374
|
+
return {
|
|
2375
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2376
|
+
vendor: "Google"
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
},
|
|
2380
|
+
{
|
|
2381
|
+
test: [/linespider/i],
|
|
2382
|
+
describe: function() {
|
|
2383
|
+
return {
|
|
2384
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2385
|
+
vendor: "Line"
|
|
2386
|
+
};
|
|
2387
|
+
}
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
test: [/amazonbot/i],
|
|
2391
|
+
describe: function() {
|
|
2392
|
+
return {
|
|
2393
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2394
|
+
vendor: "Amazon"
|
|
2395
|
+
};
|
|
2396
|
+
}
|
|
2397
|
+
},
|
|
2398
|
+
{
|
|
2399
|
+
test: [/gptbot/i],
|
|
2400
|
+
describe: function() {
|
|
2401
|
+
return {
|
|
2402
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2403
|
+
vendor: "OpenAI"
|
|
2404
|
+
};
|
|
2405
|
+
}
|
|
2406
|
+
},
|
|
2407
|
+
{
|
|
2408
|
+
test: [/chatgpt-user/i],
|
|
2409
|
+
describe: function() {
|
|
2410
|
+
return {
|
|
2411
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2412
|
+
vendor: "OpenAI"
|
|
2413
|
+
};
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
test: [/oai-searchbot/i],
|
|
2418
|
+
describe: function() {
|
|
2419
|
+
return {
|
|
2420
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2421
|
+
vendor: "OpenAI"
|
|
2422
|
+
};
|
|
2423
|
+
}
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
test: [/baiduspider/i],
|
|
2427
|
+
describe: function() {
|
|
2428
|
+
return {
|
|
2429
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2430
|
+
vendor: "Baidu"
|
|
2431
|
+
};
|
|
2432
|
+
}
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
test: [/bingbot/i],
|
|
2436
|
+
describe: function() {
|
|
2437
|
+
return {
|
|
2438
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2439
|
+
vendor: "Bing"
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
},
|
|
2443
|
+
{
|
|
2444
|
+
test: [/duckduckbot/i],
|
|
2445
|
+
describe: function() {
|
|
2446
|
+
return {
|
|
2447
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2448
|
+
vendor: "DuckDuckGo"
|
|
2449
|
+
};
|
|
2450
|
+
}
|
|
2451
|
+
},
|
|
2452
|
+
{
|
|
2453
|
+
test: [
|
|
2454
|
+
/claudebot/i,
|
|
2455
|
+
/claude-web/i,
|
|
2456
|
+
/claude-user/i,
|
|
2457
|
+
/claude-searchbot/i
|
|
2458
|
+
],
|
|
2459
|
+
describe: function() {
|
|
2460
|
+
return {
|
|
2461
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2462
|
+
vendor: "Anthropic"
|
|
2463
|
+
};
|
|
2464
|
+
}
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
test: [/omgilibot/i, /webzio-extended/i],
|
|
2468
|
+
describe: function() {
|
|
2469
|
+
return {
|
|
2470
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2471
|
+
vendor: "Webz.io"
|
|
2472
|
+
};
|
|
2473
|
+
}
|
|
2474
|
+
},
|
|
2475
|
+
{
|
|
2476
|
+
test: [/diffbot/i],
|
|
2477
|
+
describe: function() {
|
|
2478
|
+
return {
|
|
2479
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2480
|
+
vendor: "Diffbot"
|
|
2481
|
+
};
|
|
2482
|
+
}
|
|
2483
|
+
},
|
|
2484
|
+
{
|
|
2485
|
+
test: [/perplexitybot/i],
|
|
2486
|
+
describe: function() {
|
|
2487
|
+
return {
|
|
2488
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2489
|
+
vendor: "Perplexity AI"
|
|
2490
|
+
};
|
|
2491
|
+
}
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
test: [/perplexity-user/i],
|
|
2495
|
+
describe: function() {
|
|
2496
|
+
return {
|
|
2497
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2498
|
+
vendor: "Perplexity AI"
|
|
2499
|
+
};
|
|
2500
|
+
}
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
test: [/youbot/i],
|
|
2504
|
+
describe: function() {
|
|
2505
|
+
return {
|
|
2506
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2507
|
+
vendor: "You.com"
|
|
2508
|
+
};
|
|
2509
|
+
}
|
|
2510
|
+
},
|
|
2511
|
+
{
|
|
2512
|
+
test: [/ia_archiver/i],
|
|
2513
|
+
describe: function() {
|
|
2514
|
+
return {
|
|
2515
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2516
|
+
vendor: "Internet Archive"
|
|
2517
|
+
};
|
|
2518
|
+
}
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
test: [/meta-webindexer/i],
|
|
2522
|
+
describe: function() {
|
|
2523
|
+
return {
|
|
2524
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2525
|
+
vendor: "Meta"
|
|
2526
|
+
};
|
|
2527
|
+
}
|
|
2528
|
+
},
|
|
2529
|
+
{
|
|
2530
|
+
test: [/meta-externalads/i],
|
|
2531
|
+
describe: function() {
|
|
2532
|
+
return {
|
|
2533
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2534
|
+
vendor: "Meta"
|
|
2535
|
+
};
|
|
2536
|
+
}
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
test: [/meta-externalagent/i],
|
|
2540
|
+
describe: function() {
|
|
2541
|
+
return {
|
|
2542
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2543
|
+
vendor: "Meta"
|
|
2544
|
+
};
|
|
2545
|
+
}
|
|
2546
|
+
},
|
|
2547
|
+
{
|
|
2548
|
+
test: [/meta-externalfetcher/i],
|
|
2549
|
+
describe: function() {
|
|
2550
|
+
return {
|
|
2551
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2552
|
+
vendor: "Meta"
|
|
2553
|
+
};
|
|
2554
|
+
}
|
|
2555
|
+
},
|
|
2556
|
+
{
|
|
2557
|
+
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
|
2558
|
+
describe: function() {
|
|
2559
|
+
return {
|
|
2560
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2561
|
+
vendor: "Meta"
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
},
|
|
2565
|
+
{
|
|
2566
|
+
test: [/slackbot/i, /slack-imgProxy/i],
|
|
2567
|
+
describe: function() {
|
|
2568
|
+
return {
|
|
2569
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2570
|
+
vendor: "Slack"
|
|
2571
|
+
};
|
|
2572
|
+
}
|
|
2573
|
+
},
|
|
2574
|
+
{
|
|
2575
|
+
test: [/yahoo/i],
|
|
2576
|
+
describe: function() {
|
|
2577
|
+
return {
|
|
2578
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2579
|
+
vendor: "Yahoo"
|
|
2580
|
+
};
|
|
2581
|
+
}
|
|
2582
|
+
},
|
|
2583
|
+
{
|
|
2584
|
+
test: [/yandexbot/i, /yandexmobilebot/i],
|
|
2585
|
+
describe: function() {
|
|
2586
|
+
return {
|
|
2587
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2588
|
+
vendor: "Yandex"
|
|
2589
|
+
};
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
test: [/pingdom/i],
|
|
2594
|
+
describe: function() {
|
|
2595
|
+
return {
|
|
2596
|
+
type: a.PLATFORMS_MAP.bot,
|
|
2597
|
+
vendor: "Pingdom"
|
|
2598
|
+
};
|
|
2599
|
+
}
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
test: [/huawei/i],
|
|
2603
|
+
describe: function(e) {
|
|
2604
|
+
var t = i.default.getFirstMatch(/(can-l01)/i, e) && "Nova", n = {
|
|
2605
|
+
type: a.PLATFORMS_MAP.mobile,
|
|
2606
|
+
vendor: "Huawei"
|
|
2607
|
+
};
|
|
2608
|
+
return t && (n.model = t), n;
|
|
2609
|
+
}
|
|
2610
|
+
},
|
|
2611
|
+
{
|
|
2612
|
+
test: [/nexus\s*(?:7|8|9|10).*/i],
|
|
2613
|
+
describe: function() {
|
|
2614
|
+
return {
|
|
2615
|
+
type: a.PLATFORMS_MAP.tablet,
|
|
2616
|
+
vendor: "Nexus"
|
|
2617
|
+
};
|
|
2618
|
+
}
|
|
2619
|
+
},
|
|
2620
|
+
{
|
|
2621
|
+
test: [/ipad/i],
|
|
2622
|
+
describe: function() {
|
|
2623
|
+
return {
|
|
2624
|
+
type: a.PLATFORMS_MAP.tablet,
|
|
2625
|
+
vendor: "Apple",
|
|
2626
|
+
model: "iPad"
|
|
2627
|
+
};
|
|
2628
|
+
}
|
|
2629
|
+
},
|
|
2630
|
+
{
|
|
2631
|
+
test: [/Macintosh(.*?) FxiOS(.*?)\//],
|
|
2632
|
+
describe: function() {
|
|
2633
|
+
return {
|
|
2634
|
+
type: a.PLATFORMS_MAP.tablet,
|
|
2635
|
+
vendor: "Apple",
|
|
2636
|
+
model: "iPad"
|
|
2637
|
+
};
|
|
2638
|
+
}
|
|
2639
|
+
},
|
|
2640
|
+
{
|
|
2641
|
+
test: [/kftt build/i],
|
|
2642
|
+
describe: function() {
|
|
2643
|
+
return {
|
|
2644
|
+
type: a.PLATFORMS_MAP.tablet,
|
|
2645
|
+
vendor: "Amazon",
|
|
2646
|
+
model: "Kindle Fire HD 7"
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
test: [/silk/i],
|
|
2652
|
+
describe: function() {
|
|
2653
|
+
return {
|
|
2654
|
+
type: a.PLATFORMS_MAP.tablet,
|
|
2655
|
+
vendor: "Amazon"
|
|
2656
|
+
};
|
|
2657
|
+
}
|
|
2658
|
+
},
|
|
2659
|
+
{
|
|
2660
|
+
test: [/tablet(?! pc)/i],
|
|
2661
|
+
describe: function() {
|
|
2662
|
+
return { type: a.PLATFORMS_MAP.tablet };
|
|
2663
|
+
}
|
|
2664
|
+
},
|
|
2665
|
+
{
|
|
2666
|
+
test: function(e) {
|
|
2667
|
+
var t = e.test(/ipod|iphone/i), n = e.test(/like (ipod|iphone)/i);
|
|
2668
|
+
return t && !n;
|
|
2669
|
+
},
|
|
2670
|
+
describe: function(e) {
|
|
2671
|
+
var t = i.default.getFirstMatch(/(ipod|iphone)/i, e);
|
|
2672
|
+
return {
|
|
2673
|
+
type: a.PLATFORMS_MAP.mobile,
|
|
2674
|
+
vendor: "Apple",
|
|
2675
|
+
model: t
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
},
|
|
2679
|
+
{
|
|
2680
|
+
test: [/nexus\s*[0-6].*/i, /galaxy nexus/i],
|
|
2681
|
+
describe: function() {
|
|
2682
|
+
return {
|
|
2683
|
+
type: a.PLATFORMS_MAP.mobile,
|
|
2684
|
+
vendor: "Nexus"
|
|
2685
|
+
};
|
|
2686
|
+
}
|
|
2687
|
+
},
|
|
2688
|
+
{
|
|
2689
|
+
test: [/Nokia/i],
|
|
2690
|
+
describe: function(e) {
|
|
2691
|
+
var t = i.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i, e), n = {
|
|
2692
|
+
type: a.PLATFORMS_MAP.mobile,
|
|
2693
|
+
vendor: "Nokia"
|
|
2694
|
+
};
|
|
2695
|
+
return t && (n.model = t), n;
|
|
2696
|
+
}
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
test: [/[^-]mobi/i],
|
|
2700
|
+
describe: function() {
|
|
2701
|
+
return { type: a.PLATFORMS_MAP.mobile };
|
|
2702
|
+
}
|
|
2703
|
+
},
|
|
2704
|
+
{
|
|
2705
|
+
test: function(e) {
|
|
2706
|
+
return e.getBrowserName(!0) === "blackberry";
|
|
2707
|
+
},
|
|
2708
|
+
describe: function() {
|
|
2709
|
+
return {
|
|
2710
|
+
type: a.PLATFORMS_MAP.mobile,
|
|
2711
|
+
vendor: "BlackBerry"
|
|
2712
|
+
};
|
|
2713
|
+
}
|
|
2714
|
+
},
|
|
2715
|
+
{
|
|
2716
|
+
test: function(e) {
|
|
2717
|
+
return e.getBrowserName(!0) === "bada";
|
|
2718
|
+
},
|
|
2719
|
+
describe: function() {
|
|
2720
|
+
return { type: a.PLATFORMS_MAP.mobile };
|
|
2721
|
+
}
|
|
2722
|
+
},
|
|
2723
|
+
{
|
|
2724
|
+
test: function(e) {
|
|
2725
|
+
return e.getBrowserName() === "windows phone";
|
|
2726
|
+
},
|
|
2727
|
+
describe: function() {
|
|
2728
|
+
return {
|
|
2729
|
+
type: a.PLATFORMS_MAP.mobile,
|
|
2730
|
+
vendor: "Microsoft"
|
|
2731
|
+
};
|
|
2732
|
+
}
|
|
2733
|
+
},
|
|
2734
|
+
{
|
|
2735
|
+
test: function(e) {
|
|
2736
|
+
var t = Number(String(e.getOSVersion()).split(".")[0]);
|
|
2737
|
+
return e.getOSName(!0) === "android" && t >= 3;
|
|
2738
|
+
},
|
|
2739
|
+
describe: function() {
|
|
2740
|
+
return { type: a.PLATFORMS_MAP.tablet };
|
|
2741
|
+
}
|
|
2742
|
+
},
|
|
2743
|
+
{
|
|
2744
|
+
test: function(e) {
|
|
2745
|
+
return e.getOSName(!0) === "android";
|
|
2746
|
+
},
|
|
2747
|
+
describe: function() {
|
|
2748
|
+
return { type: a.PLATFORMS_MAP.mobile };
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
{
|
|
2752
|
+
test: [/smart-?tv|smarttv/i],
|
|
2753
|
+
describe: function() {
|
|
2754
|
+
return { type: a.PLATFORMS_MAP.tv };
|
|
2755
|
+
}
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
test: [/netcast/i],
|
|
2759
|
+
describe: function() {
|
|
2760
|
+
return { type: a.PLATFORMS_MAP.tv };
|
|
2761
|
+
}
|
|
2762
|
+
},
|
|
2763
|
+
{
|
|
2764
|
+
test: function(e) {
|
|
2765
|
+
return e.getOSName(!0) === "macos";
|
|
2766
|
+
},
|
|
2767
|
+
describe: function() {
|
|
2768
|
+
return {
|
|
2769
|
+
type: a.PLATFORMS_MAP.desktop,
|
|
2770
|
+
vendor: "Apple"
|
|
2771
|
+
};
|
|
2772
|
+
}
|
|
2773
|
+
},
|
|
2774
|
+
{
|
|
2775
|
+
test: function(e) {
|
|
2776
|
+
return e.getOSName(!0) === "windows";
|
|
2777
|
+
},
|
|
2778
|
+
describe: function() {
|
|
2779
|
+
return { type: a.PLATFORMS_MAP.desktop };
|
|
2780
|
+
}
|
|
2781
|
+
},
|
|
2782
|
+
{
|
|
2783
|
+
test: function(e) {
|
|
2784
|
+
return e.getOSName(!0) === "linux";
|
|
2785
|
+
},
|
|
2786
|
+
describe: function() {
|
|
2787
|
+
return { type: a.PLATFORMS_MAP.desktop };
|
|
2788
|
+
}
|
|
2789
|
+
},
|
|
2790
|
+
{
|
|
2791
|
+
test: function(e) {
|
|
2792
|
+
return e.getOSName(!0) === "playstation 4";
|
|
2793
|
+
},
|
|
2794
|
+
describe: function() {
|
|
2795
|
+
return { type: a.PLATFORMS_MAP.tv };
|
|
2796
|
+
}
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
test: function(e) {
|
|
2800
|
+
return e.getOSName(!0) === "roku";
|
|
2801
|
+
},
|
|
2802
|
+
describe: function() {
|
|
2803
|
+
return { type: a.PLATFORMS_MAP.tv };
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
], e.exports = t.default;
|
|
2807
|
+
},
|
|
2808
|
+
95: function(e, t, n) {
|
|
2809
|
+
t.__esModule = !0, t.default = void 0;
|
|
2810
|
+
var r, i = (r = n(17)) && r.__esModule ? r : { default: r }, a = n(18);
|
|
2811
|
+
t.default = [
|
|
2812
|
+
{
|
|
2813
|
+
test: function(e) {
|
|
2814
|
+
return e.getBrowserName(!0) === "microsoft edge";
|
|
2815
|
+
},
|
|
2816
|
+
describe: function(e) {
|
|
2817
|
+
if (/\sedg\//i.test(e)) return { name: a.ENGINE_MAP.Blink };
|
|
2818
|
+
var t = i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, e);
|
|
2819
|
+
return {
|
|
2820
|
+
name: a.ENGINE_MAP.EdgeHTML,
|
|
2821
|
+
version: t
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
},
|
|
2825
|
+
{
|
|
2826
|
+
test: [/trident/i],
|
|
2827
|
+
describe: function(e) {
|
|
2828
|
+
var t = { name: a.ENGINE_MAP.Trident }, n = i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, e);
|
|
2829
|
+
return n && (t.version = n), t;
|
|
2830
|
+
}
|
|
2831
|
+
},
|
|
2832
|
+
{
|
|
2833
|
+
test: function(e) {
|
|
2834
|
+
return e.test(/presto/i);
|
|
2835
|
+
},
|
|
2836
|
+
describe: function(e) {
|
|
2837
|
+
var t = { name: a.ENGINE_MAP.Presto }, n = i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, e);
|
|
2838
|
+
return n && (t.version = n), t;
|
|
2839
|
+
}
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
test: function(e) {
|
|
2843
|
+
var t = e.test(/gecko/i), n = e.test(/like gecko/i);
|
|
2844
|
+
return t && !n;
|
|
2845
|
+
},
|
|
2846
|
+
describe: function(e) {
|
|
2847
|
+
var t = { name: a.ENGINE_MAP.Gecko }, n = i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, e);
|
|
2848
|
+
return n && (t.version = n), t;
|
|
2849
|
+
}
|
|
2850
|
+
},
|
|
2851
|
+
{
|
|
2852
|
+
test: [/(apple)?webkit\/537\.36/i],
|
|
2853
|
+
describe: function() {
|
|
2854
|
+
return { name: a.ENGINE_MAP.Blink };
|
|
2855
|
+
}
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
test: [/(apple)?webkit/i],
|
|
2859
|
+
describe: function(e) {
|
|
2860
|
+
var t = { name: a.ENGINE_MAP.WebKit }, n = i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, e);
|
|
2861
|
+
return n && (t.version = n), t;
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
], e.exports = t.default;
|
|
2865
|
+
}
|
|
2866
|
+
});
|
|
2867
|
+
}));
|
|
2868
|
+
})))(), 1);
|
|
2869
|
+
function bt(e) {
|
|
2870
|
+
let t = Math.floor((Date.now() - e.getTime()) / 1e3), n = new Intl.RelativeTimeFormat(void 0, { numeric: "auto" });
|
|
2871
|
+
for (let [e, r] of [
|
|
2872
|
+
["year", 31536e3],
|
|
2873
|
+
["month", 2592e3],
|
|
2874
|
+
["week", 604800],
|
|
2875
|
+
["day", 86400],
|
|
2876
|
+
["hour", 3600],
|
|
2877
|
+
["minute", 60],
|
|
2878
|
+
["second", 1]
|
|
2879
|
+
]) if (t >= r) return n.format(-Math.floor(t / r), e);
|
|
2880
|
+
return n.format(0, "second");
|
|
2881
|
+
}
|
|
2882
|
+
function xt({ activeSession: e }) {
|
|
2883
|
+
let { authClient: t, basePaths: n, localization: r, viewPaths: i, navigate: a } = m(), { data: o } = C(t, { refetchOnMount: !1 }), { mutate: s, isPending: c } = S(t, { onSuccess: () => Y.success(r.settings.revokeSessionSuccess) }), l = e.token === o?.session.token, u = yt.default.parse(e.userAgent || "");
|
|
2884
|
+
return /* @__PURE__ */ $("div", {
|
|
2885
|
+
className: "flex items-center gap-3",
|
|
2886
|
+
children: [
|
|
2887
|
+
/* @__PURE__ */ Q("div", {
|
|
2888
|
+
className: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary",
|
|
2889
|
+
children: u.platform.type === "mobile" || u.platform.type === "tablet" ? /* @__PURE__ */ Q(ve, { className: "size-4.5" }) : /* @__PURE__ */ Q(ue, { className: "size-4.5" })
|
|
2890
|
+
}),
|
|
2891
|
+
/* @__PURE__ */ $("div", {
|
|
2892
|
+
className: "flex flex-col min-w-0",
|
|
2893
|
+
children: [/* @__PURE__ */ $("span", {
|
|
2894
|
+
className: "text-sm font-medium truncate",
|
|
2895
|
+
children: [u.browser.name || "Unknown Browser", u.os.name ? `, ${u.os.name}` : ""]
|
|
2896
|
+
}), l ? /* @__PURE__ */ Q(xe, {
|
|
2897
|
+
color: "accent",
|
|
2898
|
+
size: "sm",
|
|
2899
|
+
children: r.settings.currentSession
|
|
2900
|
+
}) : e.createdAt && /* @__PURE__ */ Q("span", {
|
|
2901
|
+
className: "text-xs text-muted capitalize",
|
|
2902
|
+
children: bt(e.createdAt)
|
|
2903
|
+
})]
|
|
2904
|
+
}),
|
|
2905
|
+
/* @__PURE__ */ $(A, {
|
|
2906
|
+
className: "ml-auto shrink-0",
|
|
2907
|
+
variant: "outline",
|
|
2908
|
+
size: "sm",
|
|
2909
|
+
onPress: () => l ? a({ to: `${n.auth}/${i.auth.signOut}` }) : s(e),
|
|
2910
|
+
isPending: c,
|
|
2911
|
+
"aria-label": l ? r.auth.signOut : r.settings.revokeSession,
|
|
2912
|
+
children: [c ? /* @__PURE__ */ Q(G, {
|
|
2913
|
+
color: "current",
|
|
2914
|
+
size: "sm"
|
|
2915
|
+
}) : Q(l ? E : be, {}), l ? r.auth.signOut : r.settings.revoke]
|
|
2916
|
+
})
|
|
2917
|
+
]
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
//#endregion
|
|
2921
|
+
//#region src/components/auth/settings/security/active-sessions.tsx
|
|
2922
|
+
function St({ className: e, variant: t, ...n }) {
|
|
2923
|
+
let { authClient: r, localization: i } = m(), { data: a } = C(r), { data: o, isPending: s } = ee(r), c = o && [...o].sort((e, t) => e.id === a?.session.id ? -1 : +(t.id === a?.session.id));
|
|
2924
|
+
return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
|
|
2925
|
+
className: J("text-sm font-semibold mb-3"),
|
|
2926
|
+
children: i.settings.activeSessions
|
|
2927
|
+
}), /* @__PURE__ */ Q(M, {
|
|
2928
|
+
className: J(e),
|
|
2929
|
+
variant: t,
|
|
2930
|
+
...n,
|
|
2931
|
+
children: /* @__PURE__ */ Q(M.Content, {
|
|
2932
|
+
className: "gap-0",
|
|
2933
|
+
children: s ? /* @__PURE__ */ Q(Ct, {}) : c?.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(xt, { activeSession: e })] }, e.id))
|
|
2934
|
+
})
|
|
2935
|
+
})] });
|
|
2936
|
+
}
|
|
2937
|
+
function Ct() {
|
|
2938
|
+
return /* @__PURE__ */ Q("div", {
|
|
2939
|
+
className: "flex items-center justify-between",
|
|
2940
|
+
children: /* @__PURE__ */ $("div", {
|
|
2941
|
+
className: "flex items-center gap-3",
|
|
2942
|
+
children: [/* @__PURE__ */ Q(W, { className: "size-10 rounded-xl" }), /* @__PURE__ */ $("div", {
|
|
2943
|
+
className: "flex flex-col gap-1",
|
|
2944
|
+
children: [/* @__PURE__ */ Q(W, { className: "h-4 w-32 rounded-lg" }), /* @__PURE__ */ Q(W, { className: "h-3 w-24 rounded-lg" })]
|
|
2945
|
+
})]
|
|
2946
|
+
})
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
//#endregion
|
|
2950
|
+
//#region src/components/auth/settings/security/change-password.tsx
|
|
2951
|
+
function wt({ className: e, variant: t, ...n }) {
|
|
2952
|
+
let { authClient: r, emailAndPassword: i, localization: a } = m(), { data: o } = C(r), { data: s, isPending: c } = b(r), l = s?.some((e) => e.providerId === "credential");
|
|
2953
|
+
return !c && !l ? /* @__PURE__ */ Q(Tt, {
|
|
2954
|
+
className: e,
|
|
2955
|
+
variant: t,
|
|
2956
|
+
...n
|
|
2957
|
+
}) : /* @__PURE__ */ Q(Et, {
|
|
2958
|
+
className: e,
|
|
2959
|
+
variant: t,
|
|
2960
|
+
emailAndPassword: i,
|
|
2961
|
+
localization: a,
|
|
2962
|
+
session: c ? void 0 : o,
|
|
2963
|
+
...n
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
function Tt({ className: e, variant: t, ...n }) {
|
|
2967
|
+
let { authClient: r, localization: i } = m(), { data: a } = C(r), { mutate: o, isPending: s } = te(r, { onSuccess: () => Y.success(i.auth.passwordResetEmailSent) }), c = () => {
|
|
2968
|
+
a?.user.email && o({ email: a.user.email });
|
|
2969
|
+
};
|
|
2970
|
+
return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
|
|
2971
|
+
className: J("text-sm font-semibold mb-3"),
|
|
2972
|
+
children: i.settings.changePassword
|
|
2973
|
+
}), /* @__PURE__ */ Q(M, {
|
|
2974
|
+
className: J(e),
|
|
2975
|
+
variant: t,
|
|
2976
|
+
...n,
|
|
2977
|
+
children: /* @__PURE__ */ $(M.Content, {
|
|
2978
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
2979
|
+
children: [/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("p", {
|
|
2980
|
+
className: "text-sm font-medium leading-tight",
|
|
2981
|
+
children: i.settings.setPassword
|
|
2982
|
+
}), /* @__PURE__ */ Q("p", {
|
|
2983
|
+
className: "text-muted text-xs mt-0.5",
|
|
2984
|
+
children: i.settings.setPasswordDescription
|
|
2985
|
+
})] }), /* @__PURE__ */ $(A, {
|
|
2986
|
+
size: "sm",
|
|
2987
|
+
isPending: s,
|
|
2988
|
+
isDisabled: !a,
|
|
2989
|
+
onPress: c,
|
|
2990
|
+
children: [s && /* @__PURE__ */ Q(G, {
|
|
2991
|
+
color: "current",
|
|
2992
|
+
size: "sm"
|
|
2993
|
+
}), i.auth.sendResetLink]
|
|
2994
|
+
})]
|
|
2995
|
+
})
|
|
2996
|
+
})] });
|
|
2997
|
+
}
|
|
2998
|
+
function Et({ className: e, variant: t, emailAndPassword: n, localization: r, session: i, ...a }) {
|
|
2999
|
+
let { authClient: o } = m(), [s, c] = X(""), [l, u] = X(""), [d, f] = X(""), { mutate: p, isPending: h } = _(o, {
|
|
3000
|
+
onError: (e) => {
|
|
3001
|
+
c(""), u(""), f(""), Y.danger(e.error?.message || e.message);
|
|
3002
|
+
},
|
|
3003
|
+
onSuccess: () => {
|
|
3004
|
+
c(""), u(""), f(""), Y.success(r.settings.changePasswordSuccess);
|
|
3005
|
+
}
|
|
3006
|
+
}), [g, v] = X(!1), [y, b] = X(!1), ee = (e) => {
|
|
3007
|
+
if (e.preventDefault(), n?.confirmPassword && l !== d) {
|
|
3008
|
+
c(""), u(""), f(""), Y.danger(r.auth.passwordsDoNotMatch);
|
|
3009
|
+
return;
|
|
3010
|
+
}
|
|
3011
|
+
p({
|
|
3012
|
+
currentPassword: s,
|
|
3013
|
+
newPassword: l,
|
|
3014
|
+
revokeOtherSessions: !0
|
|
3015
|
+
});
|
|
3016
|
+
};
|
|
3017
|
+
return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
|
|
3018
|
+
className: J("text-sm font-semibold mb-3"),
|
|
3019
|
+
children: r.settings.changePassword
|
|
3020
|
+
}), /* @__PURE__ */ Q(M, {
|
|
3021
|
+
className: J("p-4 gap-4", e),
|
|
3022
|
+
variant: t,
|
|
3023
|
+
...a,
|
|
3024
|
+
children: /* @__PURE__ */ Q(M.Content, { children: /* @__PURE__ */ Q(L, {
|
|
3025
|
+
onSubmit: ee,
|
|
3026
|
+
children: /* @__PURE__ */ $(I, {
|
|
3027
|
+
className: "w-full gap-4",
|
|
3028
|
+
children: [/* @__PURE__ */ $(I.Group, { children: [
|
|
3029
|
+
/* @__PURE__ */ $(q, {
|
|
3030
|
+
name: "currentPassword",
|
|
3031
|
+
type: "password",
|
|
3032
|
+
isDisabled: h || !i,
|
|
3033
|
+
defaultValue: "",
|
|
3034
|
+
value: s,
|
|
3035
|
+
onChange: c,
|
|
3036
|
+
children: [
|
|
3037
|
+
/* @__PURE__ */ Q(B, { children: r.settings.currentPassword }),
|
|
3038
|
+
/* @__PURE__ */ Q(R, {
|
|
3039
|
+
className: J(!i && "hidden"),
|
|
3040
|
+
autoComplete: "current-password",
|
|
3041
|
+
placeholder: r.settings.currentPasswordPlaceholder,
|
|
3042
|
+
required: !0,
|
|
3043
|
+
variant: t === "transparent" ? "primary" : "secondary"
|
|
3044
|
+
}),
|
|
3045
|
+
!i && /* @__PURE__ */ Q(W, { className: "h-10 md:h-9 w-full rounded-xl" }),
|
|
3046
|
+
/* @__PURE__ */ Q(F, {})
|
|
3047
|
+
]
|
|
3048
|
+
}),
|
|
3049
|
+
/* @__PURE__ */ $(q, {
|
|
3050
|
+
minLength: n?.minPasswordLength,
|
|
3051
|
+
maxLength: n?.maxPasswordLength,
|
|
3052
|
+
isDisabled: h || !i,
|
|
3053
|
+
value: l,
|
|
3054
|
+
onChange: u,
|
|
3055
|
+
children: [
|
|
3056
|
+
/* @__PURE__ */ Q(B, { children: r.auth.newPassword }),
|
|
3057
|
+
/* @__PURE__ */ $(z, {
|
|
3058
|
+
className: J(!i && "hidden"),
|
|
3059
|
+
variant: t === "transparent" ? "primary" : "secondary",
|
|
3060
|
+
children: [/* @__PURE__ */ Q(z.Input, {
|
|
3061
|
+
name: "newPassword",
|
|
3062
|
+
type: g ? "text" : "password",
|
|
3063
|
+
autoComplete: "new-password",
|
|
3064
|
+
placeholder: r.auth.newPasswordPlaceholder,
|
|
3065
|
+
required: !0
|
|
3066
|
+
}), /* @__PURE__ */ Q(z.Suffix, {
|
|
3067
|
+
className: "px-0",
|
|
3068
|
+
children: /* @__PURE__ */ Q(A, {
|
|
3069
|
+
isIconOnly: !0,
|
|
3070
|
+
"aria-label": g ? r.auth.hidePassword : r.auth.showPassword,
|
|
3071
|
+
size: "sm",
|
|
3072
|
+
variant: "ghost",
|
|
3073
|
+
onPress: () => v(!g),
|
|
3074
|
+
isDisabled: h,
|
|
3075
|
+
children: Q(g ? k : O, {})
|
|
3076
|
+
})
|
|
3077
|
+
})]
|
|
3078
|
+
}),
|
|
3079
|
+
!i && /* @__PURE__ */ Q(W, { className: "h-10 md:h-9 w-full rounded-xl" }),
|
|
3080
|
+
/* @__PURE__ */ Q(F, {})
|
|
3081
|
+
]
|
|
3082
|
+
}),
|
|
3083
|
+
n?.confirmPassword && /* @__PURE__ */ $(q, {
|
|
3084
|
+
minLength: n?.minPasswordLength,
|
|
3085
|
+
maxLength: n?.maxPasswordLength,
|
|
3086
|
+
isDisabled: h || !i,
|
|
3087
|
+
isRequired: !0,
|
|
3088
|
+
value: d,
|
|
3089
|
+
onChange: f,
|
|
3090
|
+
children: [
|
|
3091
|
+
/* @__PURE__ */ Q(B, { children: r.auth.confirmPassword }),
|
|
3092
|
+
/* @__PURE__ */ $(z, {
|
|
3093
|
+
className: J(!i && "hidden"),
|
|
3094
|
+
variant: t === "transparent" ? "primary" : "secondary",
|
|
3095
|
+
children: [/* @__PURE__ */ Q(z.Input, {
|
|
3096
|
+
name: "confirmPassword",
|
|
3097
|
+
type: y ? "text" : "password",
|
|
3098
|
+
autoComplete: "new-password",
|
|
3099
|
+
placeholder: r.auth.confirmPasswordPlaceholder,
|
|
3100
|
+
required: !0
|
|
3101
|
+
}), /* @__PURE__ */ Q(z.Suffix, {
|
|
3102
|
+
className: "px-0",
|
|
3103
|
+
children: /* @__PURE__ */ Q(A, {
|
|
3104
|
+
isIconOnly: !0,
|
|
3105
|
+
"aria-label": y ? r.auth.hidePassword : r.auth.showPassword,
|
|
3106
|
+
size: "sm",
|
|
3107
|
+
variant: "ghost",
|
|
3108
|
+
onPress: () => b(!y),
|
|
3109
|
+
isDisabled: h,
|
|
3110
|
+
children: Q(y ? k : O, {})
|
|
3111
|
+
})
|
|
3112
|
+
})]
|
|
3113
|
+
}),
|
|
3114
|
+
!i && /* @__PURE__ */ Q(W, { className: "h-10 md:h-9 w-full rounded-xl" }),
|
|
3115
|
+
/* @__PURE__ */ Q(F, {})
|
|
3116
|
+
]
|
|
3117
|
+
})
|
|
3118
|
+
] }), /* @__PURE__ */ Q(I.Actions, { children: /* @__PURE__ */ $(A, {
|
|
3119
|
+
type: "submit",
|
|
3120
|
+
isPending: h,
|
|
3121
|
+
isDisabled: !i,
|
|
3122
|
+
size: "sm",
|
|
3123
|
+
children: [h && /* @__PURE__ */ Q(G, {
|
|
3124
|
+
color: "current",
|
|
3125
|
+
size: "sm"
|
|
3126
|
+
}), r.settings.updatePassword]
|
|
3127
|
+
}) })]
|
|
3128
|
+
})
|
|
3129
|
+
}) })
|
|
3130
|
+
})] });
|
|
3131
|
+
}
|
|
3132
|
+
//#endregion
|
|
3133
|
+
//#region src/components/auth/settings/security/linked-account.tsx
|
|
3134
|
+
function Dt({ account: e, provider: t }) {
|
|
3135
|
+
let { authClient: n, baseURL: r, localization: i } = m(), { data: a, isPending: o } = p(n, { query: { accountId: e?.accountId } }), { mutate: s, isPending: l } = y(n), { mutate: u, isPending: d } = w(n, { onSuccess: () => Y.success(i.settings.accountUnlinked) }), h = f[t], g = c(t), _ = a?.data?.login || a?.data?.username || a?.user?.email || a?.user?.name || e?.accountId;
|
|
3136
|
+
return /* @__PURE__ */ $("div", {
|
|
3137
|
+
className: "flex items-center gap-3",
|
|
3138
|
+
children: [
|
|
3139
|
+
/* @__PURE__ */ Q("div", {
|
|
3140
|
+
className: J("flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-secondary"),
|
|
3141
|
+
children: Q(h || ge, { className: "size-4.5" })
|
|
3142
|
+
}),
|
|
3143
|
+
/* @__PURE__ */ $("div", {
|
|
3144
|
+
className: "flex flex-col min-w-0",
|
|
3145
|
+
children: [/* @__PURE__ */ Q("span", {
|
|
3146
|
+
className: "text-sm font-medium leading-tight",
|
|
3147
|
+
children: g
|
|
3148
|
+
}), e && o ? /* @__PURE__ */ Q(W, { className: "h-3 w-24 my-0.5 rounded-lg" }) : /* @__PURE__ */ Q("span", {
|
|
3149
|
+
className: "text-xs text-muted truncate",
|
|
3150
|
+
children: e ? _ : i.settings.linkProvider.replace("{{provider}}", g)
|
|
3151
|
+
})]
|
|
3152
|
+
}),
|
|
3153
|
+
e ? /* @__PURE__ */ $(A, {
|
|
3154
|
+
className: "ml-auto shrink-0",
|
|
3155
|
+
variant: "outline",
|
|
3156
|
+
size: "sm",
|
|
3157
|
+
onPress: () => u({ providerId: e.providerId }),
|
|
3158
|
+
isPending: d,
|
|
3159
|
+
"aria-label": i.settings.unlinkProvider.replace("{{provider}}", g),
|
|
3160
|
+
children: [d ? /* @__PURE__ */ Q(G, {
|
|
3161
|
+
color: "current",
|
|
3162
|
+
size: "sm"
|
|
3163
|
+
}) : /* @__PURE__ */ Q(pe, {}), i.settings.unlinkProvider.replace("{{provider}}", "").trim()]
|
|
3164
|
+
}) : /* @__PURE__ */ $(A, {
|
|
3165
|
+
className: "ml-auto shrink-0",
|
|
3166
|
+
variant: "outline",
|
|
3167
|
+
size: "sm",
|
|
3168
|
+
onPress: () => s({
|
|
3169
|
+
provider: t,
|
|
3170
|
+
callbackURL: `${r}${window.location.pathname}`
|
|
3171
|
+
}),
|
|
3172
|
+
isPending: l,
|
|
3173
|
+
"aria-label": i.settings.linkProvider.replace("{{provider}}", g),
|
|
3174
|
+
children: [l ? /* @__PURE__ */ Q(G, {
|
|
3175
|
+
color: "current",
|
|
3176
|
+
size: "sm"
|
|
3177
|
+
}) : /* @__PURE__ */ Q(fe, {}), i.settings.link]
|
|
3178
|
+
})
|
|
3179
|
+
]
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3182
|
+
//#endregion
|
|
3183
|
+
//#region src/components/auth/settings/security/linked-accounts.tsx
|
|
3184
|
+
function Ot({ className: e, variant: t, ...n }) {
|
|
3185
|
+
let { authClient: r, localization: i, socialProviders: a } = m(), { data: o, isPending: s } = b(r), c = [...(o?.filter((e) => e.providerId !== "credential"))?.map((e) => ({
|
|
3186
|
+
key: e.id,
|
|
3187
|
+
account: e,
|
|
3188
|
+
provider: e.providerId
|
|
3189
|
+
})) ?? [], ...a?.map((e) => ({
|
|
3190
|
+
key: e,
|
|
3191
|
+
account: void 0,
|
|
3192
|
+
provider: e
|
|
3193
|
+
})) ?? []];
|
|
3194
|
+
return /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("h2", {
|
|
3195
|
+
className: J("text-sm font-semibold mb-3"),
|
|
3196
|
+
children: i.settings.linkedAccounts
|
|
3197
|
+
}), /* @__PURE__ */ Q(M, {
|
|
3198
|
+
className: J(e),
|
|
3199
|
+
variant: t,
|
|
3200
|
+
...n,
|
|
3201
|
+
children: /* @__PURE__ */ Q(M.Content, {
|
|
3202
|
+
className: "gap-0",
|
|
3203
|
+
children: s ? a?.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(kt, {})] }, e)) : c.map((e, t) => /* @__PURE__ */ $("div", { children: [t > 0 && /* @__PURE__ */ Q("div", { className: "border-b border-dashed -mx-4 my-4" }), /* @__PURE__ */ Q(Dt, {
|
|
3204
|
+
account: e.account,
|
|
3205
|
+
provider: e.provider
|
|
3206
|
+
})] }, e.key))
|
|
3207
|
+
})
|
|
3208
|
+
})] });
|
|
3209
|
+
}
|
|
3210
|
+
function kt() {
|
|
3211
|
+
return /* @__PURE__ */ Q("div", {
|
|
3212
|
+
className: "flex items-center justify-between",
|
|
3213
|
+
children: /* @__PURE__ */ $("div", {
|
|
3214
|
+
className: "flex items-center gap-3",
|
|
3215
|
+
children: [/* @__PURE__ */ Q(W, { className: "size-10 rounded-xl" }), /* @__PURE__ */ $("div", {
|
|
3216
|
+
className: "flex flex-col gap-1",
|
|
3217
|
+
children: [/* @__PURE__ */ Q(W, { className: "h-4 w-20 rounded-lg" }), /* @__PURE__ */ Q(W, { className: "h-3 w-32 rounded-lg" })]
|
|
3218
|
+
})]
|
|
3219
|
+
})
|
|
3220
|
+
});
|
|
3221
|
+
}
|
|
3222
|
+
//#endregion
|
|
3223
|
+
//#region src/components/auth/settings/security/security-settings.tsx
|
|
3224
|
+
function At({ className: e, variant: t, ...n }) {
|
|
3225
|
+
let { emailAndPassword: r, plugins: i, socialProviders: a } = m();
|
|
3226
|
+
return /* @__PURE__ */ $("div", {
|
|
3227
|
+
className: J("flex w-full flex-col gap-4 md:gap-6", e),
|
|
3228
|
+
...n,
|
|
3229
|
+
children: [
|
|
3230
|
+
r?.enabled && /* @__PURE__ */ Q(wt, { variant: t }),
|
|
3231
|
+
!!a?.length && /* @__PURE__ */ Q(Ot, { variant: t }),
|
|
3232
|
+
/* @__PURE__ */ Q(St, { variant: t }),
|
|
3233
|
+
i.flatMap((e) => e.securityCards?.map((n, r) => /* @__PURE__ */ Q(n, { variant: t }, `${e.id}-${r.toString()}`)))
|
|
3234
|
+
]
|
|
3235
|
+
});
|
|
3236
|
+
}
|
|
3237
|
+
//#endregion
|
|
3238
|
+
//#region src/components/auth/settings/settings.tsx
|
|
3239
|
+
function jt({ className: e, hideNav: t, path: n, variant: r, view: i, ...a }) {
|
|
3240
|
+
if (!i && !n) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
|
|
3241
|
+
let { authClient: o, basePaths: s, localization: c, viewPaths: l, plugins: u } = m();
|
|
3242
|
+
h(o);
|
|
3243
|
+
let d = Be(() => {
|
|
3244
|
+
if (i) return i;
|
|
3245
|
+
if (n) return [l.settings, ...u.map((e) => e.viewPaths?.settings)].flatMap((e) => Object.entries(e ?? {})).find(([, e]) => e === n)?.[0];
|
|
3246
|
+
}, [
|
|
3247
|
+
i,
|
|
3248
|
+
n,
|
|
3249
|
+
l.settings,
|
|
3250
|
+
u
|
|
3251
|
+
]);
|
|
3252
|
+
if (!d) {
|
|
3253
|
+
let e = [l.settings, ...u.map((e) => e.viewPaths?.settings)].flatMap((e) => Object.values(e ?? {})).join(", ");
|
|
3254
|
+
throw Error(`[Better Auth UI] Unknown settings path "${n}". Valid paths are: ${e}`);
|
|
3255
|
+
}
|
|
3256
|
+
return /* @__PURE__ */ $(K, {
|
|
3257
|
+
className: J(e),
|
|
3258
|
+
orientation: "horizontal",
|
|
3259
|
+
selectedKey: d,
|
|
3260
|
+
...a,
|
|
3261
|
+
children: [
|
|
3262
|
+
/* @__PURE__ */ Q(K.ListContainer, { children: /* @__PURE__ */ $(K.List, {
|
|
3263
|
+
"aria-label": c.settings.settings,
|
|
3264
|
+
className: "max-w-fit overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
3265
|
+
children: [
|
|
3266
|
+
/* @__PURE__ */ $(K.Tab, {
|
|
3267
|
+
id: "account",
|
|
3268
|
+
href: `${s.settings}/${l.settings.account}`,
|
|
3269
|
+
className: "gap-2",
|
|
3270
|
+
onPress: (e) => e.target.scrollIntoView({
|
|
3271
|
+
behavior: "smooth",
|
|
3272
|
+
inline: "center"
|
|
3273
|
+
}),
|
|
3274
|
+
children: [
|
|
3275
|
+
/* @__PURE__ */ Q(me, { className: "text-muted" }),
|
|
3276
|
+
c.settings.account,
|
|
3277
|
+
/* @__PURE__ */ Q(K.Indicator, {})
|
|
3278
|
+
]
|
|
3279
|
+
}),
|
|
3280
|
+
/* @__PURE__ */ $(K.Tab, {
|
|
3281
|
+
id: "security",
|
|
3282
|
+
href: `${s.settings}/${l.settings.security}`,
|
|
3283
|
+
className: "gap-2",
|
|
3284
|
+
onPress: (e) => e.target.scrollIntoView({
|
|
3285
|
+
behavior: "smooth",
|
|
3286
|
+
inline: "center"
|
|
3287
|
+
}),
|
|
3288
|
+
children: [
|
|
3289
|
+
/* @__PURE__ */ Q(_e, { className: "text-muted" }),
|
|
3290
|
+
c.settings.security,
|
|
3291
|
+
/* @__PURE__ */ Q(K.Indicator, {})
|
|
3292
|
+
]
|
|
3293
|
+
}),
|
|
3294
|
+
u.flatMap((e) => e.settingsTabs?.map((t, n) => /* @__PURE__ */ $(K.Tab, {
|
|
3295
|
+
id: t.view,
|
|
3296
|
+
href: `${s.settings}/${e.viewPaths?.settings?.[t.view]}`,
|
|
3297
|
+
className: "gap-2",
|
|
3298
|
+
onPress: (e) => e.target.scrollIntoView({
|
|
3299
|
+
behavior: "smooth",
|
|
3300
|
+
inline: "center"
|
|
3301
|
+
}),
|
|
3302
|
+
children: [t.label, /* @__PURE__ */ Q(K.Indicator, {})]
|
|
3303
|
+
}, `${e.id}-${n.toString()}`)) ?? [])
|
|
3304
|
+
]
|
|
3305
|
+
}) }),
|
|
3306
|
+
/* @__PURE__ */ Q(K.Panel, {
|
|
3307
|
+
id: "account",
|
|
3308
|
+
className: "px-0",
|
|
3309
|
+
children: /* @__PURE__ */ Q(vt, { variant: r })
|
|
3310
|
+
}),
|
|
3311
|
+
/* @__PURE__ */ Q(K.Panel, {
|
|
3312
|
+
id: "security",
|
|
3313
|
+
className: "px-0",
|
|
3314
|
+
children: /* @__PURE__ */ Q(At, { variant: r })
|
|
3315
|
+
}),
|
|
3316
|
+
u.flatMap((e) => e.settingsTabs?.map((t, n) => /* @__PURE__ */ Q(K.Panel, {
|
|
3317
|
+
id: t.view,
|
|
3318
|
+
className: "px-0",
|
|
3319
|
+
children: /* @__PURE__ */ Q(t.component, { variant: r })
|
|
3320
|
+
}, `${e.id}-${n.toString()}`)))
|
|
3321
|
+
]
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3324
|
+
//#endregion
|
|
3325
|
+
//#region src/components/auth/user/user-button.tsx
|
|
3326
|
+
function Mt(e, t) {
|
|
3327
|
+
if (Re(e)) return e;
|
|
3328
|
+
let { label: n, href: r, icon: i, variant: a } = e;
|
|
3329
|
+
return /* @__PURE__ */ $(P.Item, {
|
|
3330
|
+
href: r,
|
|
3331
|
+
variant: a,
|
|
3332
|
+
textValue: typeof n == "string" ? n : void 0,
|
|
3333
|
+
children: [i, /* @__PURE__ */ Q(B, { children: n })]
|
|
3334
|
+
}, t);
|
|
3335
|
+
}
|
|
3336
|
+
function Nt({ className: e, placement: t, size: r = "default", variant: a = "ghost", links: o, hideSettings: s, hideSubtitle: c }) {
|
|
3337
|
+
let { authClient: l, basePaths: u, viewPaths: d, localization: f, plugins: p } = m(), { data: h, isPending: g } = C(l), _ = p.flatMap((e) => e.userMenuItems?.map((t, n) => /* @__PURE__ */ Q(t, { hideSubtitle: c }, `${e.id}-${n.toString()}`)) ?? []), v = o?.flatMap((e, t) => {
|
|
3338
|
+
if (!Re(e)) {
|
|
3339
|
+
let t = e.visibility ?? "always";
|
|
3340
|
+
if (t === "authenticated" && !h || t === "unauthenticated" && h) return [];
|
|
3341
|
+
}
|
|
3342
|
+
return [Mt(e, `user-button-link-${t.toString()}`)];
|
|
3343
|
+
});
|
|
3344
|
+
return /* @__PURE__ */ $(P, { children: [r === "icon" ? /* @__PURE__ */ Q(P.Trigger, {
|
|
3345
|
+
className: J("rounded-full", e),
|
|
3346
|
+
children: /* @__PURE__ */ Q(n, {})
|
|
3347
|
+
}) : /* @__PURE__ */ $(A, {
|
|
3348
|
+
variant: a,
|
|
3349
|
+
className: J("h-auto font-normal justify-start px-2 py-2 text-left", e),
|
|
3350
|
+
children: [h || g ? /* @__PURE__ */ Q(i, {
|
|
3351
|
+
isPending: g,
|
|
3352
|
+
hideSubtitle: c
|
|
3353
|
+
}) : /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(n, {}), /* @__PURE__ */ Q("p", {
|
|
3354
|
+
className: "text-sm font-medium",
|
|
3355
|
+
children: f.auth.account
|
|
3356
|
+
})] }), /* @__PURE__ */ Q(se, { className: "ml-auto size-3 text-muted" })]
|
|
3357
|
+
}), /* @__PURE__ */ $(P.Popover, {
|
|
3358
|
+
placement: t,
|
|
3359
|
+
className: "min-w-40 md:min-w-56 max-w-[48svw]",
|
|
3360
|
+
children: [h && /* @__PURE__ */ Q("div", {
|
|
3361
|
+
className: "px-3 pt-3 pb-1",
|
|
3362
|
+
children: /* @__PURE__ */ Q(i, { hideSubtitle: c })
|
|
3363
|
+
}), /* @__PURE__ */ Q(P.Menu, { children: h ? /* @__PURE__ */ $(Z, { children: [
|
|
3364
|
+
v,
|
|
3365
|
+
!s && /* @__PURE__ */ $(P.Item, {
|
|
3366
|
+
textValue: f.settings.settings,
|
|
3367
|
+
href: `${u.settings}/${d.settings.account}`,
|
|
3368
|
+
children: [/* @__PURE__ */ Q(de, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: f.settings.settings })]
|
|
3369
|
+
}),
|
|
3370
|
+
_,
|
|
3371
|
+
/* @__PURE__ */ $(P.Item, {
|
|
3372
|
+
textValue: f.auth.signOut,
|
|
3373
|
+
href: `${u.auth}/${d.auth.signOut}`,
|
|
3374
|
+
variant: "danger",
|
|
3375
|
+
children: [/* @__PURE__ */ Q(E, { className: "text-danger" }), /* @__PURE__ */ Q(B, { children: f.auth.signOut })]
|
|
3376
|
+
})
|
|
3377
|
+
] }) : /* @__PURE__ */ $(Z, { children: [
|
|
3378
|
+
v,
|
|
3379
|
+
/* @__PURE__ */ $(P.Item, {
|
|
3380
|
+
textValue: f.auth.signIn,
|
|
3381
|
+
href: `${u.auth}/${d.auth.signIn}`,
|
|
3382
|
+
children: [/* @__PURE__ */ Q(oe, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: f.auth.signIn })]
|
|
3383
|
+
}),
|
|
3384
|
+
/* @__PURE__ */ $(P.Item, {
|
|
3385
|
+
textValue: f.auth.signUp,
|
|
3386
|
+
href: `${u.auth}/${d.auth.signUp}`,
|
|
3387
|
+
children: [/* @__PURE__ */ Q(he, { className: "text-muted" }), /* @__PURE__ */ Q(B, { children: f.auth.signUp })]
|
|
3388
|
+
}),
|
|
3389
|
+
_
|
|
3390
|
+
] }) })]
|
|
3391
|
+
})] });
|
|
3392
|
+
}
|
|
3393
|
+
//#endregion
|
|
3394
|
+
export { vt as AccountSettings, St as ActiveSessions, it as AdditionalField, ft as Auth, mt as AuthProvider, ht as ChangeEmail, wt as ChangePassword, at as ForgotPassword, Ot as LinkedAccounts, t as ProviderButton, r as ProviderButtons, ot as ResetPassword, At as SecuritySettings, jt as Settings, st as SignIn, ct as SignOut, lt as SignUp, n as UserAvatar, Nt as UserButton, _t as UserProfile, i as UserView };
|