@erikey/react 0.4.30 → 0.4.31
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/ui/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
|
3
3
|
|
|
4
4
|
// ../../../node_modules/.pnpm/lucide-react@0.462.0_react@19.0.0/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
5
|
-
var toKebabCase = (
|
|
5
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
6
6
|
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
7
7
|
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
8
8
|
}).join(" ").trim();
|
|
@@ -736,32 +736,32 @@ function twJoin() {
|
|
|
736
736
|
let index = 0;
|
|
737
737
|
let argument;
|
|
738
738
|
let resolvedValue;
|
|
739
|
-
let
|
|
739
|
+
let string = "";
|
|
740
740
|
while (index < arguments.length) {
|
|
741
741
|
if (argument = arguments[index++]) {
|
|
742
742
|
if (resolvedValue = toValue(argument)) {
|
|
743
|
-
|
|
744
|
-
|
|
743
|
+
string && (string += " ");
|
|
744
|
+
string += resolvedValue;
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
|
-
return
|
|
748
|
+
return string;
|
|
749
749
|
}
|
|
750
750
|
var toValue = (mix) => {
|
|
751
751
|
if (typeof mix === "string") {
|
|
752
752
|
return mix;
|
|
753
753
|
}
|
|
754
754
|
let resolvedValue;
|
|
755
|
-
let
|
|
755
|
+
let string = "";
|
|
756
756
|
for (let k = 0; k < mix.length; k++) {
|
|
757
757
|
if (mix[k]) {
|
|
758
758
|
if (resolvedValue = toValue(mix[k])) {
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
string && (string += " ");
|
|
760
|
+
string += resolvedValue;
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
return
|
|
764
|
+
return string;
|
|
765
765
|
};
|
|
766
766
|
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
767
767
|
let configUtils;
|
|
@@ -2954,10 +2954,10 @@ var util;
|
|
|
2954
2954
|
return void 0;
|
|
2955
2955
|
};
|
|
2956
2956
|
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
2957
|
-
function
|
|
2957
|
+
function joinValues(array, separator = " | ") {
|
|
2958
2958
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
2959
2959
|
}
|
|
2960
|
-
util2.joinValues =
|
|
2960
|
+
util2.joinValues = joinValues;
|
|
2961
2961
|
util2.jsonStringifyReplacer = (_, value) => {
|
|
2962
2962
|
if (typeof value === "bigint") {
|
|
2963
2963
|
return value.toString();
|
|
@@ -3081,31 +3081,31 @@ var ZodError = class _ZodError extends Error {
|
|
|
3081
3081
|
this.issues = issues;
|
|
3082
3082
|
}
|
|
3083
3083
|
format(_mapper) {
|
|
3084
|
-
const mapper = _mapper || function(
|
|
3085
|
-
return
|
|
3084
|
+
const mapper = _mapper || function(issue) {
|
|
3085
|
+
return issue.message;
|
|
3086
3086
|
};
|
|
3087
3087
|
const fieldErrors = { _errors: [] };
|
|
3088
3088
|
const processError = (error) => {
|
|
3089
|
-
for (const
|
|
3090
|
-
if (
|
|
3091
|
-
|
|
3092
|
-
} else if (
|
|
3093
|
-
processError(
|
|
3094
|
-
} else if (
|
|
3095
|
-
processError(
|
|
3096
|
-
} else if (
|
|
3097
|
-
fieldErrors._errors.push(mapper(
|
|
3089
|
+
for (const issue of error.issues) {
|
|
3090
|
+
if (issue.code === "invalid_union") {
|
|
3091
|
+
issue.unionErrors.map(processError);
|
|
3092
|
+
} else if (issue.code === "invalid_return_type") {
|
|
3093
|
+
processError(issue.returnTypeError);
|
|
3094
|
+
} else if (issue.code === "invalid_arguments") {
|
|
3095
|
+
processError(issue.argumentsError);
|
|
3096
|
+
} else if (issue.path.length === 0) {
|
|
3097
|
+
fieldErrors._errors.push(mapper(issue));
|
|
3098
3098
|
} else {
|
|
3099
3099
|
let curr = fieldErrors;
|
|
3100
3100
|
let i3 = 0;
|
|
3101
|
-
while (i3 <
|
|
3102
|
-
const el =
|
|
3103
|
-
const terminal = i3 ===
|
|
3101
|
+
while (i3 < issue.path.length) {
|
|
3102
|
+
const el = issue.path[i3];
|
|
3103
|
+
const terminal = i3 === issue.path.length - 1;
|
|
3104
3104
|
if (!terminal) {
|
|
3105
3105
|
curr[el] = curr[el] || { _errors: [] };
|
|
3106
3106
|
} else {
|
|
3107
3107
|
curr[el] = curr[el] || { _errors: [] };
|
|
3108
|
-
curr[el]._errors.push(mapper(
|
|
3108
|
+
curr[el]._errors.push(mapper(issue));
|
|
3109
3109
|
}
|
|
3110
3110
|
curr = curr[el];
|
|
3111
3111
|
i3++;
|
|
@@ -3130,7 +3130,7 @@ var ZodError = class _ZodError extends Error {
|
|
|
3130
3130
|
get isEmpty() {
|
|
3131
3131
|
return this.issues.length === 0;
|
|
3132
3132
|
}
|
|
3133
|
-
flatten(mapper = (
|
|
3133
|
+
flatten(mapper = (issue) => issue.message) {
|
|
3134
3134
|
const fieldErrors = {};
|
|
3135
3135
|
const formErrors = [];
|
|
3136
3136
|
for (const sub of this.issues) {
|
|
@@ -3154,30 +3154,30 @@ ZodError.create = (issues) => {
|
|
|
3154
3154
|
};
|
|
3155
3155
|
|
|
3156
3156
|
// ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
3157
|
-
var errorMap = (
|
|
3157
|
+
var errorMap = (issue, _ctx) => {
|
|
3158
3158
|
let message;
|
|
3159
|
-
switch (
|
|
3159
|
+
switch (issue.code) {
|
|
3160
3160
|
case ZodIssueCode.invalid_type:
|
|
3161
|
-
if (
|
|
3161
|
+
if (issue.received === ZodParsedType.undefined) {
|
|
3162
3162
|
message = "Required";
|
|
3163
3163
|
} else {
|
|
3164
|
-
message = `Expected ${
|
|
3164
|
+
message = `Expected ${issue.expected}, received ${issue.received}`;
|
|
3165
3165
|
}
|
|
3166
3166
|
break;
|
|
3167
3167
|
case ZodIssueCode.invalid_literal:
|
|
3168
|
-
message = `Invalid literal value, expected ${JSON.stringify(
|
|
3168
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
|
|
3169
3169
|
break;
|
|
3170
3170
|
case ZodIssueCode.unrecognized_keys:
|
|
3171
|
-
message = `Unrecognized key(s) in object: ${util.joinValues(
|
|
3171
|
+
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
|
|
3172
3172
|
break;
|
|
3173
3173
|
case ZodIssueCode.invalid_union:
|
|
3174
3174
|
message = `Invalid input`;
|
|
3175
3175
|
break;
|
|
3176
3176
|
case ZodIssueCode.invalid_union_discriminator:
|
|
3177
|
-
message = `Invalid discriminator value. Expected ${util.joinValues(
|
|
3177
|
+
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
|
3178
3178
|
break;
|
|
3179
3179
|
case ZodIssueCode.invalid_enum_value:
|
|
3180
|
-
message = `Invalid enum value. Expected ${util.joinValues(
|
|
3180
|
+
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
|
3181
3181
|
break;
|
|
3182
3182
|
case ZodIssueCode.invalid_arguments:
|
|
3183
3183
|
message = `Invalid function arguments`;
|
|
@@ -3189,50 +3189,50 @@ var errorMap = (issue2, _ctx) => {
|
|
|
3189
3189
|
message = `Invalid date`;
|
|
3190
3190
|
break;
|
|
3191
3191
|
case ZodIssueCode.invalid_string:
|
|
3192
|
-
if (typeof
|
|
3193
|
-
if ("includes" in
|
|
3194
|
-
message = `Invalid input: must include "${
|
|
3195
|
-
if (typeof
|
|
3196
|
-
message = `${message} at one or more positions greater than or equal to ${
|
|
3192
|
+
if (typeof issue.validation === "object") {
|
|
3193
|
+
if ("includes" in issue.validation) {
|
|
3194
|
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
|
3195
|
+
if (typeof issue.validation.position === "number") {
|
|
3196
|
+
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
|
3197
3197
|
}
|
|
3198
|
-
} else if ("startsWith" in
|
|
3199
|
-
message = `Invalid input: must start with "${
|
|
3200
|
-
} else if ("endsWith" in
|
|
3201
|
-
message = `Invalid input: must end with "${
|
|
3198
|
+
} else if ("startsWith" in issue.validation) {
|
|
3199
|
+
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
|
3200
|
+
} else if ("endsWith" in issue.validation) {
|
|
3201
|
+
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
|
3202
3202
|
} else {
|
|
3203
|
-
util.assertNever(
|
|
3203
|
+
util.assertNever(issue.validation);
|
|
3204
3204
|
}
|
|
3205
|
-
} else if (
|
|
3206
|
-
message = `Invalid ${
|
|
3205
|
+
} else if (issue.validation !== "regex") {
|
|
3206
|
+
message = `Invalid ${issue.validation}`;
|
|
3207
3207
|
} else {
|
|
3208
3208
|
message = "Invalid";
|
|
3209
3209
|
}
|
|
3210
3210
|
break;
|
|
3211
3211
|
case ZodIssueCode.too_small:
|
|
3212
|
-
if (
|
|
3213
|
-
message = `Array must contain ${
|
|
3214
|
-
else if (
|
|
3215
|
-
message = `String must contain ${
|
|
3216
|
-
else if (
|
|
3217
|
-
message = `Number must be ${
|
|
3218
|
-
else if (
|
|
3219
|
-
message = `Number must be ${
|
|
3220
|
-
else if (
|
|
3221
|
-
message = `Date must be ${
|
|
3212
|
+
if (issue.type === "array")
|
|
3213
|
+
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
|
|
3214
|
+
else if (issue.type === "string")
|
|
3215
|
+
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
3216
|
+
else if (issue.type === "number")
|
|
3217
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
3218
|
+
else if (issue.type === "bigint")
|
|
3219
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
3220
|
+
else if (issue.type === "date")
|
|
3221
|
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
3222
3222
|
else
|
|
3223
3223
|
message = "Invalid input";
|
|
3224
3224
|
break;
|
|
3225
3225
|
case ZodIssueCode.too_big:
|
|
3226
|
-
if (
|
|
3227
|
-
message = `Array must contain ${
|
|
3228
|
-
else if (
|
|
3229
|
-
message = `String must contain ${
|
|
3230
|
-
else if (
|
|
3231
|
-
message = `Number must be ${
|
|
3232
|
-
else if (
|
|
3233
|
-
message = `BigInt must be ${
|
|
3234
|
-
else if (
|
|
3235
|
-
message = `Date must be ${
|
|
3226
|
+
if (issue.type === "array")
|
|
3227
|
+
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
|
|
3228
|
+
else if (issue.type === "string")
|
|
3229
|
+
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
|
3230
|
+
else if (issue.type === "number")
|
|
3231
|
+
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
3232
|
+
else if (issue.type === "bigint")
|
|
3233
|
+
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
|
3234
|
+
else if (issue.type === "date")
|
|
3235
|
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
|
3236
3236
|
else
|
|
3237
3237
|
message = "Invalid input";
|
|
3238
3238
|
break;
|
|
@@ -3243,14 +3243,14 @@ var errorMap = (issue2, _ctx) => {
|
|
|
3243
3243
|
message = `Intersection results could not be merged`;
|
|
3244
3244
|
break;
|
|
3245
3245
|
case ZodIssueCode.not_multiple_of:
|
|
3246
|
-
message = `Number must be a multiple of ${
|
|
3246
|
+
message = `Number must be a multiple of ${issue.multipleOf}`;
|
|
3247
3247
|
break;
|
|
3248
3248
|
case ZodIssueCode.not_finite:
|
|
3249
3249
|
message = "Number must be finite";
|
|
3250
3250
|
break;
|
|
3251
3251
|
default:
|
|
3252
3252
|
message = _ctx.defaultError;
|
|
3253
|
-
util.assertNever(
|
|
3253
|
+
util.assertNever(issue);
|
|
3254
3254
|
}
|
|
3255
3255
|
return { message };
|
|
3256
3256
|
};
|
|
@@ -3290,7 +3290,7 @@ var makeIssue = (params) => {
|
|
|
3290
3290
|
};
|
|
3291
3291
|
function addIssueToContext(ctx, issueData) {
|
|
3292
3292
|
const overrideMap = getErrorMap();
|
|
3293
|
-
const
|
|
3293
|
+
const issue = makeIssue({
|
|
3294
3294
|
issueData,
|
|
3295
3295
|
data: ctx.data,
|
|
3296
3296
|
path: ctx.path,
|
|
@@ -3305,7 +3305,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
3305
3305
|
// then global default map
|
|
3306
3306
|
].filter((x) => !!x)
|
|
3307
3307
|
});
|
|
3308
|
-
ctx.common.issues.push(
|
|
3308
|
+
ctx.common.issues.push(issue);
|
|
3309
3309
|
}
|
|
3310
3310
|
var ParseStatus = class _ParseStatus {
|
|
3311
3311
|
constructor() {
|
|
@@ -3763,11 +3763,11 @@ function datetimeRegex(args) {
|
|
|
3763
3763
|
regex = `${regex}(${opts.join("|")})`;
|
|
3764
3764
|
return new RegExp(`^${regex}$`);
|
|
3765
3765
|
}
|
|
3766
|
-
function isValidIP(ip,
|
|
3767
|
-
if ((
|
|
3766
|
+
function isValidIP(ip, version) {
|
|
3767
|
+
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
|
3768
3768
|
return true;
|
|
3769
3769
|
}
|
|
3770
|
-
if ((
|
|
3770
|
+
if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
|
|
3771
3771
|
return true;
|
|
3772
3772
|
}
|
|
3773
3773
|
return false;
|
|
@@ -3779,8 +3779,8 @@ function isValidJWT(jwt, alg) {
|
|
|
3779
3779
|
const [header] = jwt.split(".");
|
|
3780
3780
|
if (!header)
|
|
3781
3781
|
return false;
|
|
3782
|
-
const
|
|
3783
|
-
const decoded = JSON.parse(atob(
|
|
3782
|
+
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
3783
|
+
const decoded = JSON.parse(atob(base64));
|
|
3784
3784
|
if (typeof decoded !== "object" || decoded === null)
|
|
3785
3785
|
return false;
|
|
3786
3786
|
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
@@ -3794,11 +3794,11 @@ function isValidJWT(jwt, alg) {
|
|
|
3794
3794
|
return false;
|
|
3795
3795
|
}
|
|
3796
3796
|
}
|
|
3797
|
-
function isValidCidr(ip,
|
|
3798
|
-
if ((
|
|
3797
|
+
function isValidCidr(ip, version) {
|
|
3798
|
+
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
|
|
3799
3799
|
return true;
|
|
3800
3800
|
}
|
|
3801
|
-
if ((
|
|
3801
|
+
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
|
|
3802
3802
|
return true;
|
|
3803
3803
|
}
|
|
3804
3804
|
return false;
|
|
@@ -5263,9 +5263,9 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
5263
5263
|
...this._def,
|
|
5264
5264
|
unknownKeys: "strict",
|
|
5265
5265
|
...message !== void 0 ? {
|
|
5266
|
-
errorMap: (
|
|
5267
|
-
const defaultError = this._def.errorMap?.(
|
|
5268
|
-
if (
|
|
5266
|
+
errorMap: (issue, ctx) => {
|
|
5267
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
5268
|
+
if (issue.code === "unrecognized_keys")
|
|
5269
5269
|
return {
|
|
5270
5270
|
message: errorUtil.errToObj(message).message ?? defaultError
|
|
5271
5271
|
};
|
|
@@ -6796,9 +6796,9 @@ var coerce = {
|
|
|
6796
6796
|
function cn(...inputs) {
|
|
6797
6797
|
return twMerge(clsx(inputs));
|
|
6798
6798
|
}
|
|
6799
|
-
function isValidEmail(
|
|
6799
|
+
function isValidEmail(email) {
|
|
6800
6800
|
const emailRegex2 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
6801
|
-
return emailRegex2.test(
|
|
6801
|
+
return emailRegex2.test(email);
|
|
6802
6802
|
}
|
|
6803
6803
|
function getLocalizedError({
|
|
6804
6804
|
error,
|
|
@@ -8949,7 +8949,7 @@ var validateField = async (field, disabledFieldNames, formValues, validateAllFie
|
|
|
8949
8949
|
}
|
|
8950
8950
|
} else {
|
|
8951
8951
|
const valueDate = ref.valueAsDate || new Date(inputValue);
|
|
8952
|
-
const convertTimeToDate = (
|
|
8952
|
+
const convertTimeToDate = (time) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time);
|
|
8953
8953
|
const isTime = ref.type == "time";
|
|
8954
8954
|
const isWeek = ref.type == "week";
|
|
8955
8955
|
if (isString(maxOutput.value) && inputValue) {
|
|
@@ -10048,7 +10048,7 @@ function n(e) {
|
|
|
10048
10048
|
return e.replace(/\]|\[/g, "");
|
|
10049
10049
|
}
|
|
10050
10050
|
|
|
10051
|
-
// ../../../node_modules/.pnpm/zod@
|
|
10051
|
+
// ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/core.js
|
|
10052
10052
|
var NEVER = Object.freeze({
|
|
10053
10053
|
status: "aborted"
|
|
10054
10054
|
});
|
|
@@ -10108,7 +10108,7 @@ function config(newConfig) {
|
|
|
10108
10108
|
return globalConfig;
|
|
10109
10109
|
}
|
|
10110
10110
|
|
|
10111
|
-
// ../../../node_modules/.pnpm/zod@
|
|
10111
|
+
// ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js
|
|
10112
10112
|
function jsonStringifyReplacer(_, value) {
|
|
10113
10113
|
if (typeof value === "bigint")
|
|
10114
10114
|
return value.toString();
|
|
@@ -10127,8 +10127,7 @@ function cached(getter) {
|
|
|
10127
10127
|
}
|
|
10128
10128
|
};
|
|
10129
10129
|
}
|
|
10130
|
-
var
|
|
10131
|
-
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
10130
|
+
var captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {
|
|
10132
10131
|
};
|
|
10133
10132
|
var allowsEval = cached(() => {
|
|
10134
10133
|
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
@@ -10166,7 +10165,7 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
10166
10165
|
return full;
|
|
10167
10166
|
}
|
|
10168
10167
|
|
|
10169
|
-
// ../../../node_modules/.pnpm/zod@
|
|
10168
|
+
// ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/errors.js
|
|
10170
10169
|
var initializer = (inst, def) => {
|
|
10171
10170
|
inst.name = "$ZodError";
|
|
10172
10171
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -10177,7 +10176,13 @@ var initializer = (inst, def) => {
|
|
|
10177
10176
|
value: def,
|
|
10178
10177
|
enumerable: false
|
|
10179
10178
|
});
|
|
10180
|
-
|
|
10179
|
+
Object.defineProperty(inst, "message", {
|
|
10180
|
+
get() {
|
|
10181
|
+
return JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
10182
|
+
},
|
|
10183
|
+
enumerable: true
|
|
10184
|
+
// configurable: false,
|
|
10185
|
+
});
|
|
10181
10186
|
Object.defineProperty(inst, "toString", {
|
|
10182
10187
|
value: () => inst.message,
|
|
10183
10188
|
enumerable: false
|
|
@@ -10186,7 +10191,7 @@ var initializer = (inst, def) => {
|
|
|
10186
10191
|
var $ZodError = $constructor("$ZodError", initializer);
|
|
10187
10192
|
var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
10188
10193
|
|
|
10189
|
-
// ../../../node_modules/.pnpm/zod@
|
|
10194
|
+
// ../../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/parse.js
|
|
10190
10195
|
var _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
10191
10196
|
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
10192
10197
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -10215,14 +10220,6 @@ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
|
10215
10220
|
};
|
|
10216
10221
|
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
10217
10222
|
|
|
10218
|
-
// ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/regexes.js
|
|
10219
|
-
var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
10220
|
-
var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
10221
|
-
|
|
10222
|
-
// ../../../node_modules/.pnpm/zod@4.1.12/node_modules/zod/v4/core/registries.js
|
|
10223
|
-
var $output = Symbol("ZodOutput");
|
|
10224
|
-
var $input = Symbol("ZodInput");
|
|
10225
|
-
|
|
10226
10223
|
// ../../../node_modules/.pnpm/@hookform+resolvers@5.2.2_react-hook-form@7.66.1_react@19.0.0_/node_modules/@hookform/resolvers/zod/dist/zod.mjs
|
|
10227
10224
|
function t(r3, e) {
|
|
10228
10225
|
try {
|
|
@@ -11127,11 +11124,11 @@ function OTPInputGroup({
|
|
|
11127
11124
|
// src/ui/components/auth/forms/email-otp-form.tsx
|
|
11128
11125
|
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
11129
11126
|
function EmailOTPForm(props) {
|
|
11130
|
-
const [
|
|
11131
|
-
if (!
|
|
11127
|
+
const [email, setEmail] = useState7();
|
|
11128
|
+
if (!email) {
|
|
11132
11129
|
return /* @__PURE__ */ jsx13(EmailForm, { ...props, setEmail });
|
|
11133
11130
|
}
|
|
11134
|
-
return /* @__PURE__ */ jsx13(OTPForm, { ...props, email
|
|
11131
|
+
return /* @__PURE__ */ jsx13(OTPForm, { ...props, email });
|
|
11135
11132
|
}
|
|
11136
11133
|
function EmailForm({
|
|
11137
11134
|
className,
|
|
@@ -11165,14 +11162,14 @@ function EmailForm({
|
|
|
11165
11162
|
useEffect10(() => {
|
|
11166
11163
|
setIsSubmitting?.(form.formState.isSubmitting);
|
|
11167
11164
|
}, [form.formState.isSubmitting, setIsSubmitting]);
|
|
11168
|
-
async function sendEmailOTP({ email
|
|
11165
|
+
async function sendEmailOTP({ email }) {
|
|
11169
11166
|
const fetchOptions = {
|
|
11170
11167
|
throw: true,
|
|
11171
11168
|
headers: await getCaptchaHeaders("/email-otp/send-verification-otp")
|
|
11172
11169
|
};
|
|
11173
11170
|
try {
|
|
11174
11171
|
await authClient.emailOtp.sendVerificationOtp({
|
|
11175
|
-
email
|
|
11172
|
+
email,
|
|
11176
11173
|
type: "sign-in",
|
|
11177
11174
|
fetchOptions
|
|
11178
11175
|
});
|
|
@@ -11180,7 +11177,7 @@ function EmailForm({
|
|
|
11180
11177
|
variant: "success",
|
|
11181
11178
|
message: localization.EMAIL_OTP_VERIFICATION_SENT
|
|
11182
11179
|
});
|
|
11183
|
-
setEmail(
|
|
11180
|
+
setEmail(email);
|
|
11184
11181
|
} catch (error) {
|
|
11185
11182
|
toast({
|
|
11186
11183
|
variant: "error",
|
|
@@ -11253,7 +11250,7 @@ function OTPForm({
|
|
|
11253
11250
|
otpSeparators = 0,
|
|
11254
11251
|
redirectTo,
|
|
11255
11252
|
setIsSubmitting,
|
|
11256
|
-
email
|
|
11253
|
+
email
|
|
11257
11254
|
}) {
|
|
11258
11255
|
const {
|
|
11259
11256
|
authClient,
|
|
@@ -11285,7 +11282,7 @@ function OTPForm({
|
|
|
11285
11282
|
async function verifyCode({ code }) {
|
|
11286
11283
|
try {
|
|
11287
11284
|
await authClient.signIn.emailOtp({
|
|
11288
|
-
email
|
|
11285
|
+
email,
|
|
11289
11286
|
otp: code,
|
|
11290
11287
|
fetchOptions: { throw: true }
|
|
11291
11288
|
});
|
|
@@ -11387,7 +11384,7 @@ function EmailVerificationForm({
|
|
|
11387
11384
|
viewPaths
|
|
11388
11385
|
} = useContext12(AuthUIContext);
|
|
11389
11386
|
localization = { ...contextLocalization, ...localization };
|
|
11390
|
-
const
|
|
11387
|
+
const email = typeof window !== "undefined" ? new URLSearchParams(window.location.search).get("email") || "" : "";
|
|
11391
11388
|
const { onSuccess, isPending: transitionPending } = useOnSuccessTransition({
|
|
11392
11389
|
redirectTo
|
|
11393
11390
|
});
|
|
@@ -11419,7 +11416,7 @@ function EmailVerificationForm({
|
|
|
11419
11416
|
async function verifyCode({ code }) {
|
|
11420
11417
|
try {
|
|
11421
11418
|
const data = await authClient.emailOtp.verifyEmail({
|
|
11422
|
-
email
|
|
11419
|
+
email,
|
|
11423
11420
|
otp: code,
|
|
11424
11421
|
fetchOptions: { throw: true }
|
|
11425
11422
|
});
|
|
@@ -11452,7 +11449,7 @@ function EmailVerificationForm({
|
|
|
11452
11449
|
setCountdown(30);
|
|
11453
11450
|
try {
|
|
11454
11451
|
await authClient.emailOtp.sendVerificationOtp({
|
|
11455
|
-
email
|
|
11452
|
+
email,
|
|
11456
11453
|
type: "email-verification",
|
|
11457
11454
|
fetchOptions: { throw: true }
|
|
11458
11455
|
});
|
|
@@ -11473,7 +11470,7 @@ function EmailVerificationForm({
|
|
|
11473
11470
|
setCountdown(0);
|
|
11474
11471
|
}
|
|
11475
11472
|
}
|
|
11476
|
-
if (!
|
|
11473
|
+
if (!email) {
|
|
11477
11474
|
return /* @__PURE__ */ jsx14("div", { className: cn("grid w-full gap-6", className), children: /* @__PURE__ */ jsxs8("div", { className: "text-center", children: [
|
|
11478
11475
|
/* @__PURE__ */ jsx14("h2", { className: "font-semibold text-destructive text-lg", children: "Invalid Request" }),
|
|
11479
11476
|
/* @__PURE__ */ jsx14("p", { className: "text-muted-foreground text-sm", children: localization.EMAIL_REQUIRED || "Email address is required" })
|
|
@@ -11604,14 +11601,14 @@ function ForgotPasswordForm({
|
|
|
11604
11601
|
useEffect12(() => {
|
|
11605
11602
|
setIsSubmitting?.(form.formState.isSubmitting);
|
|
11606
11603
|
}, [form.formState.isSubmitting, setIsSubmitting]);
|
|
11607
|
-
async function forgotPassword({ email
|
|
11604
|
+
async function forgotPassword({ email }) {
|
|
11608
11605
|
try {
|
|
11609
11606
|
const fetchOptions = {
|
|
11610
11607
|
throw: true,
|
|
11611
11608
|
headers: await getCaptchaHeaders("/forget-password")
|
|
11612
11609
|
};
|
|
11613
11610
|
await authClient.requestPasswordReset({
|
|
11614
|
-
email
|
|
11611
|
+
email,
|
|
11615
11612
|
redirectTo: `${baseURL}${basePath}/${viewPaths.RESET_PASSWORD}`,
|
|
11616
11613
|
fetchOptions
|
|
11617
11614
|
});
|
|
@@ -11746,14 +11743,14 @@ function MagicLinkForm({
|
|
|
11746
11743
|
useEffect13(() => {
|
|
11747
11744
|
setIsSubmitting?.(form.formState.isSubmitting);
|
|
11748
11745
|
}, [form.formState.isSubmitting, setIsSubmitting]);
|
|
11749
|
-
async function sendMagicLink({ email
|
|
11746
|
+
async function sendMagicLink({ email }) {
|
|
11750
11747
|
try {
|
|
11751
11748
|
const fetchOptions = {
|
|
11752
11749
|
throw: true,
|
|
11753
11750
|
headers: await getCaptchaHeaders("/sign-in/magic-link")
|
|
11754
11751
|
};
|
|
11755
11752
|
await authClient.signIn.magicLink({
|
|
11756
|
-
email
|
|
11753
|
+
email,
|
|
11757
11754
|
callbackURL: getCallbackURL(),
|
|
11758
11755
|
fetchOptions
|
|
11759
11756
|
});
|
|
@@ -12245,19 +12242,19 @@ function SignInForm({
|
|
|
12245
12242
|
setIsSubmitting?.(form.formState.isSubmitting || transitionPending);
|
|
12246
12243
|
}, [form.formState.isSubmitting, transitionPending, setIsSubmitting]);
|
|
12247
12244
|
async function signIn({
|
|
12248
|
-
email
|
|
12245
|
+
email,
|
|
12249
12246
|
password,
|
|
12250
12247
|
rememberMe
|
|
12251
12248
|
}) {
|
|
12252
12249
|
try {
|
|
12253
12250
|
let response = {};
|
|
12254
|
-
if (usernameEnabled && !isValidEmail(
|
|
12251
|
+
if (usernameEnabled && !isValidEmail(email)) {
|
|
12255
12252
|
const fetchOptions = {
|
|
12256
12253
|
throw: true,
|
|
12257
12254
|
headers: await getCaptchaHeaders("/sign-in/username")
|
|
12258
12255
|
};
|
|
12259
12256
|
response = await authClient.signIn.username({
|
|
12260
|
-
username:
|
|
12257
|
+
username: email,
|
|
12261
12258
|
password,
|
|
12262
12259
|
rememberMe,
|
|
12263
12260
|
fetchOptions
|
|
@@ -12268,7 +12265,7 @@ function SignInForm({
|
|
|
12268
12265
|
headers: await getCaptchaHeaders("/sign-in/email")
|
|
12269
12266
|
};
|
|
12270
12267
|
response = await authClient.signIn.email({
|
|
12271
|
-
email
|
|
12268
|
+
email,
|
|
12272
12269
|
password,
|
|
12273
12270
|
rememberMe,
|
|
12274
12271
|
fetchOptions
|
|
@@ -12296,7 +12293,7 @@ function SignInForm({
|
|
|
12296
12293
|
});
|
|
12297
12294
|
if (emailVerification?.otp && error?.error?.code === "EMAIL_NOT_VERIFIED") {
|
|
12298
12295
|
navigate(
|
|
12299
|
-
`${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(
|
|
12296
|
+
`${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(email)}`
|
|
12300
12297
|
);
|
|
12301
12298
|
}
|
|
12302
12299
|
}
|
|
@@ -12476,10 +12473,10 @@ var sha256 = () => new Uint8Array(32);
|
|
|
12476
12473
|
var bytesToHex = (_bytes) => "";
|
|
12477
12474
|
|
|
12478
12475
|
// src/ui/lib/gravatar-utils.ts
|
|
12479
|
-
function getGravatarUrl(
|
|
12480
|
-
if (!
|
|
12476
|
+
function getGravatarUrl(email, options) {
|
|
12477
|
+
if (!email) return null;
|
|
12481
12478
|
try {
|
|
12482
|
-
const normalizedEmail =
|
|
12479
|
+
const normalizedEmail = email.trim().toLowerCase();
|
|
12483
12480
|
const encoder = new TextEncoder();
|
|
12484
12481
|
const emailBytes = encoder.encode(normalizedEmail);
|
|
12485
12482
|
const hash = bytesToHex(sha256(emailBytes));
|
|
@@ -12804,7 +12801,7 @@ function SignUpForm({
|
|
|
12804
12801
|
};
|
|
12805
12802
|
const openFileDialog = () => fileInputRef.current?.click();
|
|
12806
12803
|
async function signUp({
|
|
12807
|
-
email
|
|
12804
|
+
email,
|
|
12808
12805
|
password,
|
|
12809
12806
|
name,
|
|
12810
12807
|
username,
|
|
@@ -12840,7 +12837,7 @@ function SignUpForm({
|
|
|
12840
12837
|
additionalParams.image = image;
|
|
12841
12838
|
}
|
|
12842
12839
|
const data = await authClient.signUp.email({
|
|
12843
|
-
email
|
|
12840
|
+
email,
|
|
12844
12841
|
password,
|
|
12845
12842
|
name: name || "",
|
|
12846
12843
|
...additionalParams,
|
|
@@ -12854,9 +12851,9 @@ function SignUpForm({
|
|
|
12854
12851
|
);
|
|
12855
12852
|
} else if ("token" in data && data.token) {
|
|
12856
12853
|
await onSuccess();
|
|
12857
|
-
} else if (
|
|
12854
|
+
} else if (data.user && data.user.emailVerified === false) {
|
|
12858
12855
|
navigate(
|
|
12859
|
-
`${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(
|
|
12856
|
+
`${basePath}/${viewPaths.EMAIL_VERIFICATION}?email=${encodeURIComponent(email)}`
|
|
12860
12857
|
);
|
|
12861
12858
|
} else {
|
|
12862
12859
|
navigate(
|