@neuctra/authix 1.1.43 → 1.1.45
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/neuctra-authix.es.js +326 -310
- package/dist/neuctra-authix.umd.js +15 -15
- package/dist/react/Provider/AuthixProvider.d.ts +12 -0
- package/dist/react/Provider/AuthixProvider.d.ts.map +1 -0
- package/dist/react/SignedIn.d.ts.map +1 -1
- package/dist/react/SignedOut.d.ts.map +1 -1
- package/dist/sdk/index.d.ts +9 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Le, { forwardRef as Nt, createElement as Xe, useState as
|
|
1
|
+
import Le, { forwardRef as Nt, createElement as Xe, useState as P, useEffect as te, useRef as xt } from "react";
|
|
2
2
|
function Dt(t, e) {
|
|
3
3
|
return function() {
|
|
4
4
|
return t.apply(e, arguments);
|
|
@@ -283,8 +283,8 @@ Object.defineProperties(L, Vt);
|
|
|
283
283
|
Object.defineProperty(Ht, "isAxiosError", { value: !0 });
|
|
284
284
|
L.from = (t, e, r, s, a, i) => {
|
|
285
285
|
const o = Object.create(Ht);
|
|
286
|
-
p.toFlatObject(t, o, function(
|
|
287
|
-
return
|
|
286
|
+
p.toFlatObject(t, o, function(c) {
|
|
287
|
+
return c !== Error.prototype;
|
|
288
288
|
}, (d) => d !== "isAxiosError");
|
|
289
289
|
const l = t && t.message ? t.message : "Error", h = e == null && t ? t.code : e;
|
|
290
290
|
return L.call(o, l, h, r, s, a), t && o.cause == null && Object.defineProperty(o, "cause", { value: t, configurable: !0 }), o.name = t && t.name || "Error", i && Object.assign(o, i), o;
|
|
@@ -317,25 +317,25 @@ function Be(t, e, r) {
|
|
|
317
317
|
}, !1, function(j, m) {
|
|
318
318
|
return !p.isUndefined(m[j]);
|
|
319
319
|
});
|
|
320
|
-
const s = r.metaTokens, a = r.visitor ||
|
|
320
|
+
const s = r.metaTokens, a = r.visitor || c, i = r.dots, o = r.indexes, h = (r.Blob || typeof Blob < "u" && Blob) && p.isSpecCompliantForm(e);
|
|
321
321
|
if (!p.isFunction(a))
|
|
322
322
|
throw new TypeError("visitor must be a function");
|
|
323
|
-
function d(
|
|
324
|
-
if (
|
|
325
|
-
if (p.isDate(
|
|
326
|
-
return
|
|
327
|
-
if (p.isBoolean(
|
|
328
|
-
return
|
|
329
|
-
if (!h && p.isBlob(
|
|
323
|
+
function d(u) {
|
|
324
|
+
if (u === null) return "";
|
|
325
|
+
if (p.isDate(u))
|
|
326
|
+
return u.toISOString();
|
|
327
|
+
if (p.isBoolean(u))
|
|
328
|
+
return u.toString();
|
|
329
|
+
if (!h && p.isBlob(u))
|
|
330
330
|
throw new L("Blob is not supported. Use a Buffer instead.");
|
|
331
|
-
return p.isArrayBuffer(
|
|
331
|
+
return p.isArrayBuffer(u) || p.isTypedArray(u) ? h && typeof Blob == "function" ? new Blob([u]) : Buffer.from(u) : u;
|
|
332
332
|
}
|
|
333
|
-
function u
|
|
334
|
-
let $ =
|
|
335
|
-
if (
|
|
333
|
+
function c(u, j, m) {
|
|
334
|
+
let $ = u;
|
|
335
|
+
if (u && !m && typeof u == "object") {
|
|
336
336
|
if (p.endsWith(j, "{}"))
|
|
337
|
-
j = s ? j : j.slice(0, -2),
|
|
338
|
-
else if (p.isArray(
|
|
337
|
+
j = s ? j : j.slice(0, -2), u = JSON.stringify(u);
|
|
338
|
+
else if (p.isArray(u) && Qr(u) || (p.isFileList(u) || p.endsWith(j, "[]")) && ($ = p.toArray(u)))
|
|
339
339
|
return j = Yt(j), $.forEach(function(z, C) {
|
|
340
340
|
!(p.isUndefined(z) || z === null) && e.append(
|
|
341
341
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -344,18 +344,18 @@ function Be(t, e, r) {
|
|
|
344
344
|
);
|
|
345
345
|
}), !1;
|
|
346
346
|
}
|
|
347
|
-
return Qe(
|
|
347
|
+
return Qe(u) ? !0 : (e.append(gt(m, j, i), d(u)), !1);
|
|
348
348
|
}
|
|
349
349
|
const b = [], y = Object.assign(en, {
|
|
350
|
-
defaultVisitor:
|
|
350
|
+
defaultVisitor: c,
|
|
351
351
|
convertValue: d,
|
|
352
352
|
isVisitable: Qe
|
|
353
353
|
});
|
|
354
|
-
function w(
|
|
355
|
-
if (!p.isUndefined(
|
|
356
|
-
if (b.indexOf(
|
|
354
|
+
function w(u, j) {
|
|
355
|
+
if (!p.isUndefined(u)) {
|
|
356
|
+
if (b.indexOf(u) !== -1)
|
|
357
357
|
throw Error("Circular reference detected in " + j.join("."));
|
|
358
|
-
b.push(
|
|
358
|
+
b.push(u), p.forEach(u, function($, I) {
|
|
359
359
|
(!(p.isUndefined($) || $ === null) && a.call(
|
|
360
360
|
e,
|
|
361
361
|
$,
|
|
@@ -680,23 +680,23 @@ let ne = class {
|
|
|
680
680
|
set(e, r, s) {
|
|
681
681
|
const a = this;
|
|
682
682
|
function i(l, h, d) {
|
|
683
|
-
const
|
|
684
|
-
if (!
|
|
683
|
+
const c = Se(h);
|
|
684
|
+
if (!c)
|
|
685
685
|
throw new Error("header name must be a non-empty string");
|
|
686
|
-
const b = p.findKey(a,
|
|
686
|
+
const b = p.findKey(a, c);
|
|
687
687
|
(!b || a[b] === void 0 || d === !0 || d === void 0 && a[b] !== !1) && (a[b || h] = $e(l));
|
|
688
688
|
}
|
|
689
|
-
const o = (l, h) => p.forEach(l, (d,
|
|
689
|
+
const o = (l, h) => p.forEach(l, (d, c) => i(d, c, h));
|
|
690
690
|
if (p.isPlainObject(e) || e instanceof this.constructor)
|
|
691
691
|
o(e, r);
|
|
692
692
|
else if (p.isString(e) && (e = e.trim()) && !yn(e))
|
|
693
693
|
o(gn(e), r);
|
|
694
694
|
else if (p.isObject(e) && p.isIterable(e)) {
|
|
695
695
|
let l = {}, h, d;
|
|
696
|
-
for (const
|
|
697
|
-
if (!p.isArray(
|
|
696
|
+
for (const c of e) {
|
|
697
|
+
if (!p.isArray(c))
|
|
698
698
|
throw TypeError("Object iterator must return a key-value pair");
|
|
699
|
-
l[d =
|
|
699
|
+
l[d = c[0]] = (h = l[d]) ? p.isArray(h) ? [...h, c[1]] : [h, c[1]] : c[1];
|
|
700
700
|
}
|
|
701
701
|
o(l, r);
|
|
702
702
|
} else
|
|
@@ -845,25 +845,25 @@ function vn(t, e) {
|
|
|
845
845
|
const r = new Array(t), s = new Array(t);
|
|
846
846
|
let a = 0, i = 0, o;
|
|
847
847
|
return e = e !== void 0 ? e : 1e3, function(h) {
|
|
848
|
-
const d = Date.now(),
|
|
848
|
+
const d = Date.now(), c = s[i];
|
|
849
849
|
o || (o = d), r[a] = h, s[a] = d;
|
|
850
850
|
let b = i, y = 0;
|
|
851
851
|
for (; b !== a; )
|
|
852
852
|
y += r[b++], b = b % t;
|
|
853
853
|
if (a = (a + 1) % t, a === i && (i = (i + 1) % t), d - o < e)
|
|
854
854
|
return;
|
|
855
|
-
const w =
|
|
855
|
+
const w = c && d - c;
|
|
856
856
|
return w ? Math.round(y * 1e3 / w) : void 0;
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
function Sn(t, e) {
|
|
860
860
|
let r = 0, s = 1e3 / e, a, i;
|
|
861
|
-
const o = (d,
|
|
862
|
-
r =
|
|
861
|
+
const o = (d, c = Date.now()) => {
|
|
862
|
+
r = c, a = null, i && (clearTimeout(i), i = null), t(...d);
|
|
863
863
|
};
|
|
864
864
|
return [(...d) => {
|
|
865
|
-
const
|
|
866
|
-
b >= s ? o(d,
|
|
865
|
+
const c = Date.now(), b = c - r;
|
|
866
|
+
b >= s ? o(d, c) : (a = d, i || (i = setTimeout(() => {
|
|
867
867
|
i = null, o(a);
|
|
868
868
|
}, s - b)));
|
|
869
869
|
}, () => a && o(a)];
|
|
@@ -872,7 +872,7 @@ const Ue = (t, e, r = 3) => {
|
|
|
872
872
|
let s = 0;
|
|
873
873
|
const a = vn(50, 250);
|
|
874
874
|
return Sn((i) => {
|
|
875
|
-
const o = i.loaded, l = i.lengthComputable ? i.total : void 0, h = o - s, d = a(h),
|
|
875
|
+
const o = i.loaded, l = i.lengthComputable ? i.total : void 0, h = o - s, d = a(h), c = o <= l;
|
|
876
876
|
s = o;
|
|
877
877
|
const b = {
|
|
878
878
|
loaded: o,
|
|
@@ -880,7 +880,7 @@ const Ue = (t, e, r = 3) => {
|
|
|
880
880
|
progress: l ? o / l : void 0,
|
|
881
881
|
bytes: h,
|
|
882
882
|
rate: d || void 0,
|
|
883
|
-
estimated: d && l &&
|
|
883
|
+
estimated: d && l && c ? (l - o) / d : void 0,
|
|
884
884
|
event: i,
|
|
885
885
|
lengthComputable: l != null,
|
|
886
886
|
[e ? "download" : "upload"]: !0
|
|
@@ -938,28 +938,28 @@ const vt = (t) => t instanceof ne ? { ...t } : t;
|
|
|
938
938
|
function he(t, e) {
|
|
939
939
|
e = e || {};
|
|
940
940
|
const r = {};
|
|
941
|
-
function s(d,
|
|
942
|
-
return p.isPlainObject(d) && p.isPlainObject(
|
|
941
|
+
function s(d, c, b, y) {
|
|
942
|
+
return p.isPlainObject(d) && p.isPlainObject(c) ? p.merge.call({ caseless: y }, d, c) : p.isPlainObject(c) ? p.merge({}, c) : p.isArray(c) ? c.slice() : c;
|
|
943
943
|
}
|
|
944
|
-
function a(d,
|
|
945
|
-
if (p.isUndefined(
|
|
944
|
+
function a(d, c, b, y) {
|
|
945
|
+
if (p.isUndefined(c)) {
|
|
946
946
|
if (!p.isUndefined(d))
|
|
947
947
|
return s(void 0, d, b, y);
|
|
948
|
-
} else return s(d,
|
|
948
|
+
} else return s(d, c, b, y);
|
|
949
949
|
}
|
|
950
|
-
function i(d,
|
|
951
|
-
if (!p.isUndefined(
|
|
952
|
-
return s(void 0,
|
|
950
|
+
function i(d, c) {
|
|
951
|
+
if (!p.isUndefined(c))
|
|
952
|
+
return s(void 0, c);
|
|
953
953
|
}
|
|
954
|
-
function o(d,
|
|
955
|
-
if (p.isUndefined(
|
|
954
|
+
function o(d, c) {
|
|
955
|
+
if (p.isUndefined(c)) {
|
|
956
956
|
if (!p.isUndefined(d))
|
|
957
957
|
return s(void 0, d);
|
|
958
|
-
} else return s(void 0,
|
|
958
|
+
} else return s(void 0, c);
|
|
959
959
|
}
|
|
960
|
-
function l(d,
|
|
960
|
+
function l(d, c, b) {
|
|
961
961
|
if (b in e)
|
|
962
|
-
return s(d,
|
|
962
|
+
return s(d, c);
|
|
963
963
|
if (b in t)
|
|
964
964
|
return s(void 0, d);
|
|
965
965
|
}
|
|
@@ -992,11 +992,11 @@ function he(t, e) {
|
|
|
992
992
|
socketPath: o,
|
|
993
993
|
responseEncoding: o,
|
|
994
994
|
validateStatus: l,
|
|
995
|
-
headers: (d,
|
|
995
|
+
headers: (d, c, b) => a(vt(d), vt(c), b, !0)
|
|
996
996
|
};
|
|
997
|
-
return p.forEach(Object.keys({ ...t, ...e }), function(
|
|
998
|
-
const b = h[
|
|
999
|
-
p.isUndefined(y) && b !== l || (r[
|
|
997
|
+
return p.forEach(Object.keys({ ...t, ...e }), function(c) {
|
|
998
|
+
const b = h[c] || a, y = b(t[c], e[c], c);
|
|
999
|
+
p.isUndefined(y) && b !== l || (r[c] = y);
|
|
1000
1000
|
}), r;
|
|
1001
1001
|
}
|
|
1002
1002
|
const tr = (t) => {
|
|
@@ -1010,8 +1010,8 @@ const tr = (t) => {
|
|
|
1010
1010
|
o.setContentType(void 0);
|
|
1011
1011
|
else if (p.isFunction(r.getHeaders)) {
|
|
1012
1012
|
const h = r.getHeaders(), d = ["content-type", "content-length"];
|
|
1013
|
-
Object.entries(h).forEach(([
|
|
1014
|
-
d.includes(
|
|
1013
|
+
Object.entries(h).forEach(([c, b]) => {
|
|
1014
|
+
d.includes(c.toLowerCase()) && o.set(c, b);
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
@@ -1025,9 +1025,9 @@ const tr = (t) => {
|
|
|
1025
1025
|
const a = tr(t);
|
|
1026
1026
|
let i = a.data;
|
|
1027
1027
|
const o = ne.from(a.headers).normalize();
|
|
1028
|
-
let { responseType: l, onUploadProgress: h, onDownloadProgress: d } = a,
|
|
1028
|
+
let { responseType: l, onUploadProgress: h, onDownloadProgress: d } = a, c, b, y, w, u;
|
|
1029
1029
|
function j() {
|
|
1030
|
-
w && w(),
|
|
1030
|
+
w && w(), u && u(), a.cancelToken && a.cancelToken.unsubscribe(c), a.signal && a.signal.removeEventListener("abort", c);
|
|
1031
1031
|
}
|
|
1032
1032
|
let m = new XMLHttpRequest();
|
|
1033
1033
|
m.open(a.method.toUpperCase(), a.url, !0), m.timeout = a.timeout;
|
|
@@ -1068,9 +1068,9 @@ const tr = (t) => {
|
|
|
1068
1068
|
)), m = null;
|
|
1069
1069
|
}, i === void 0 && o.setContentType(null), "setRequestHeader" in m && p.forEach(o.toJSON(), function(C, q) {
|
|
1070
1070
|
m.setRequestHeader(q, C);
|
|
1071
|
-
}), p.isUndefined(a.withCredentials) || (m.withCredentials = !!a.withCredentials), l && l !== "json" && (m.responseType = a.responseType), d && ([y,
|
|
1071
|
+
}), p.isUndefined(a.withCredentials) || (m.withCredentials = !!a.withCredentials), l && l !== "json" && (m.responseType = a.responseType), d && ([y, u] = Ue(d, !0), m.addEventListener("progress", y)), h && m.upload && ([b, w] = Ue(h), m.upload.addEventListener("progress", b), m.upload.addEventListener("loadend", w)), (a.cancelToken || a.signal) && (c = (z) => {
|
|
1072
1072
|
m && (s(!z || z.type ? new je(null, t, m) : z), m.abort(), m = null);
|
|
1073
|
-
}, a.cancelToken && a.cancelToken.subscribe(
|
|
1073
|
+
}, a.cancelToken && a.cancelToken.subscribe(c), a.signal && (a.signal.aborted ? c() : a.signal.addEventListener("abort", c)));
|
|
1074
1074
|
const I = jn(a.url);
|
|
1075
1075
|
if (I && ee.protocols.indexOf(I) === -1) {
|
|
1076
1076
|
s(new L("Unsupported protocol " + I + ":", L.ERR_BAD_REQUEST, t));
|
|
@@ -1085,8 +1085,8 @@ const tr = (t) => {
|
|
|
1085
1085
|
const i = function(d) {
|
|
1086
1086
|
if (!a) {
|
|
1087
1087
|
a = !0, l();
|
|
1088
|
-
const
|
|
1089
|
-
s.abort(
|
|
1088
|
+
const c = d instanceof Error ? d : this.reason;
|
|
1089
|
+
s.abort(c instanceof L ? c : new je(c instanceof Error ? c.message : c));
|
|
1090
1090
|
}
|
|
1091
1091
|
};
|
|
1092
1092
|
let o = e && setTimeout(() => {
|
|
@@ -1137,17 +1137,17 @@ const tr = (t) => {
|
|
|
1137
1137
|
return new ReadableStream({
|
|
1138
1138
|
async pull(h) {
|
|
1139
1139
|
try {
|
|
1140
|
-
const { done: d, value:
|
|
1140
|
+
const { done: d, value: c } = await a.next();
|
|
1141
1141
|
if (d) {
|
|
1142
1142
|
l(), h.close();
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
1145
|
-
let b =
|
|
1145
|
+
let b = c.byteLength;
|
|
1146
1146
|
if (r) {
|
|
1147
1147
|
let y = i += b;
|
|
1148
1148
|
r(y);
|
|
1149
1149
|
}
|
|
1150
|
-
h.enqueue(new Uint8Array(
|
|
1150
|
+
h.enqueue(new Uint8Array(c));
|
|
1151
1151
|
} catch (d) {
|
|
1152
1152
|
throw l(d), d;
|
|
1153
1153
|
}
|
|
@@ -1177,46 +1177,46 @@ const tr = (t) => {
|
|
|
1177
1177
|
const { fetch: e, Request: r, Response: s } = t, a = e ? Oe(e) : typeof fetch == "function", i = Oe(r), o = Oe(s);
|
|
1178
1178
|
if (!a)
|
|
1179
1179
|
return !1;
|
|
1180
|
-
const l = a && Oe(Et), h = a && (typeof Ct == "function" ? /* @__PURE__ */ ((
|
|
1181
|
-
let
|
|
1180
|
+
const l = a && Oe(Et), h = a && (typeof Ct == "function" ? /* @__PURE__ */ ((u) => (j) => u.encode(j))(new Ct()) : async (u) => new Uint8Array(await new r(u).arrayBuffer())), d = i && l && Tt(() => {
|
|
1181
|
+
let u = !1;
|
|
1182
1182
|
const j = new r(ee.origin, {
|
|
1183
1183
|
body: new Et(),
|
|
1184
1184
|
method: "POST",
|
|
1185
1185
|
get duplex() {
|
|
1186
|
-
return
|
|
1186
|
+
return u = !0, "half";
|
|
1187
1187
|
}
|
|
1188
1188
|
}).headers.has("Content-Type");
|
|
1189
|
-
return
|
|
1190
|
-
}),
|
|
1191
|
-
stream:
|
|
1189
|
+
return u && !j;
|
|
1190
|
+
}), c = o && l && Tt(() => p.isReadableStream(new s("").body)), b = {
|
|
1191
|
+
stream: c && ((u) => u.body)
|
|
1192
1192
|
};
|
|
1193
|
-
a && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1194
|
-
!b[
|
|
1195
|
-
let $ = j && j[
|
|
1193
|
+
a && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((u) => {
|
|
1194
|
+
!b[u] && (b[u] = (j, m) => {
|
|
1195
|
+
let $ = j && j[u];
|
|
1196
1196
|
if ($)
|
|
1197
1197
|
return $.call(j);
|
|
1198
|
-
throw new L(`Response type '${
|
|
1198
|
+
throw new L(`Response type '${u}' is not supported`, L.ERR_NOT_SUPPORT, m);
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
|
-
const y = async (
|
|
1202
|
-
if (
|
|
1201
|
+
const y = async (u) => {
|
|
1202
|
+
if (u == null)
|
|
1203
1203
|
return 0;
|
|
1204
|
-
if (p.isBlob(
|
|
1205
|
-
return
|
|
1206
|
-
if (p.isSpecCompliantForm(
|
|
1204
|
+
if (p.isBlob(u))
|
|
1205
|
+
return u.size;
|
|
1206
|
+
if (p.isSpecCompliantForm(u))
|
|
1207
1207
|
return (await new r(ee.origin, {
|
|
1208
1208
|
method: "POST",
|
|
1209
|
-
body:
|
|
1209
|
+
body: u
|
|
1210
1210
|
}).arrayBuffer()).byteLength;
|
|
1211
|
-
if (p.isArrayBufferView(
|
|
1212
|
-
return
|
|
1213
|
-
if (p.isURLSearchParams(
|
|
1214
|
-
return (await h(
|
|
1215
|
-
}, w = async (
|
|
1216
|
-
const m = p.toFiniteNumber(
|
|
1211
|
+
if (p.isArrayBufferView(u) || p.isArrayBuffer(u))
|
|
1212
|
+
return u.byteLength;
|
|
1213
|
+
if (p.isURLSearchParams(u) && (u = u + ""), p.isString(u))
|
|
1214
|
+
return (await h(u)).byteLength;
|
|
1215
|
+
}, w = async (u, j) => {
|
|
1216
|
+
const m = p.toFiniteNumber(u.getContentLength());
|
|
1217
1217
|
return m ?? y(j);
|
|
1218
1218
|
};
|
|
1219
|
-
return async (
|
|
1219
|
+
return async (u) => {
|
|
1220
1220
|
let {
|
|
1221
1221
|
url: j,
|
|
1222
1222
|
method: m,
|
|
@@ -1230,7 +1230,7 @@ const tr = (t) => {
|
|
|
1230
1230
|
headers: v,
|
|
1231
1231
|
withCredentials: D = "same-origin",
|
|
1232
1232
|
fetchOptions: B
|
|
1233
|
-
} = tr(
|
|
1233
|
+
} = tr(u), F = e || fetch;
|
|
1234
1234
|
R = R ? (R + "").toLowerCase() : "text";
|
|
1235
1235
|
let V = Pn([I, z && z.toAbortSignal()], C), Z = null;
|
|
1236
1236
|
const T = V && V.unsubscribe && (() => {
|
|
@@ -1253,7 +1253,7 @@ const tr = (t) => {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
1255
|
p.isString(D) || (D = D ? "include" : "omit");
|
|
1256
|
-
const A = i && "credentials" in r.prototype,
|
|
1256
|
+
const A = i && "credentials" in r.prototype, O = {
|
|
1257
1257
|
...B,
|
|
1258
1258
|
signal: V,
|
|
1259
1259
|
method: m.toUpperCase(),
|
|
@@ -1262,10 +1262,10 @@ const tr = (t) => {
|
|
|
1262
1262
|
duplex: "half",
|
|
1263
1263
|
credentials: A ? D : void 0
|
|
1264
1264
|
};
|
|
1265
|
-
Z = i && new r(j,
|
|
1266
|
-
let K = await (i ? F(Z, B) : F(j,
|
|
1267
|
-
const Q =
|
|
1268
|
-
if (
|
|
1265
|
+
Z = i && new r(j, O);
|
|
1266
|
+
let K = await (i ? F(Z, B) : F(j, O));
|
|
1267
|
+
const Q = c && (R === "stream" || R === "response");
|
|
1268
|
+
if (c && (q || Q && T)) {
|
|
1269
1269
|
const f = {};
|
|
1270
1270
|
["status", "statusText", "headers"].forEach((_) => {
|
|
1271
1271
|
f[_] = K[_];
|
|
@@ -1282,24 +1282,24 @@ const tr = (t) => {
|
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
1284
|
R = R || "text";
|
|
1285
|
-
let G = await b[p.findKey(b, R) || "text"](K,
|
|
1285
|
+
let G = await b[p.findKey(b, R) || "text"](K, u);
|
|
1286
1286
|
return !Q && T && T(), await new Promise((f, S) => {
|
|
1287
1287
|
Qt(f, S, {
|
|
1288
1288
|
data: G,
|
|
1289
1289
|
headers: ne.from(K.headers),
|
|
1290
1290
|
status: K.status,
|
|
1291
1291
|
statusText: K.statusText,
|
|
1292
|
-
config:
|
|
1292
|
+
config: u,
|
|
1293
1293
|
request: Z
|
|
1294
1294
|
});
|
|
1295
1295
|
});
|
|
1296
1296
|
} catch (A) {
|
|
1297
1297
|
throw T && T(), A && A.name === "TypeError" && /Load failed|fetch/i.test(A.message) ? Object.assign(
|
|
1298
|
-
new L("Network Error", L.ERR_NETWORK,
|
|
1298
|
+
new L("Network Error", L.ERR_NETWORK, u, Z),
|
|
1299
1299
|
{
|
|
1300
1300
|
cause: A.cause || A
|
|
1301
1301
|
}
|
|
1302
|
-
) : L.from(A, A && A.code,
|
|
1302
|
+
) : L.from(A, A && A.code, u, Z);
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
1305
|
}, Nn = /* @__PURE__ */ new Map(), rr = (t) => {
|
|
@@ -1309,9 +1309,9 @@ const tr = (t) => {
|
|
|
1309
1309
|
a,
|
|
1310
1310
|
r
|
|
1311
1311
|
];
|
|
1312
|
-
let o = i.length, l = o, h, d,
|
|
1312
|
+
let o = i.length, l = o, h, d, c = Nn;
|
|
1313
1313
|
for (; l--; )
|
|
1314
|
-
h = i[l], d =
|
|
1314
|
+
h = i[l], d = c.get(h), d === void 0 && c.set(h, d = l ? /* @__PURE__ */ new Map() : _n(e)), c = d;
|
|
1315
1315
|
return d;
|
|
1316
1316
|
};
|
|
1317
1317
|
rr();
|
|
@@ -1487,8 +1487,8 @@ let xe = class {
|
|
|
1487
1487
|
);
|
|
1488
1488
|
i && p.forEach(
|
|
1489
1489
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1490
|
-
(
|
|
1491
|
-
delete i[
|
|
1490
|
+
(u) => {
|
|
1491
|
+
delete i[u];
|
|
1492
1492
|
}
|
|
1493
1493
|
), r.headers = ne.concat(o, i);
|
|
1494
1494
|
const l = [];
|
|
@@ -1500,32 +1500,32 @@ let xe = class {
|
|
|
1500
1500
|
this.interceptors.response.forEach(function(j) {
|
|
1501
1501
|
d.push(j.fulfilled, j.rejected);
|
|
1502
1502
|
});
|
|
1503
|
-
let
|
|
1503
|
+
let c, b = 0, y;
|
|
1504
1504
|
if (!h) {
|
|
1505
|
-
const
|
|
1506
|
-
for (
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1505
|
+
const u = [Rt.bind(this), void 0];
|
|
1506
|
+
for (u.unshift(...l), u.push(...d), y = u.length, c = Promise.resolve(r); b < y; )
|
|
1507
|
+
c = c.then(u[b++], u[b++]);
|
|
1508
|
+
return c;
|
|
1509
1509
|
}
|
|
1510
1510
|
y = l.length;
|
|
1511
1511
|
let w = r;
|
|
1512
1512
|
for (; b < y; ) {
|
|
1513
|
-
const
|
|
1513
|
+
const u = l[b++], j = l[b++];
|
|
1514
1514
|
try {
|
|
1515
|
-
w =
|
|
1515
|
+
w = u(w);
|
|
1516
1516
|
} catch (m) {
|
|
1517
1517
|
j.call(this, m);
|
|
1518
1518
|
break;
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
1521
|
try {
|
|
1522
|
-
|
|
1523
|
-
} catch (
|
|
1524
|
-
return Promise.reject(
|
|
1522
|
+
c = Rt.call(this, w);
|
|
1523
|
+
} catch (u) {
|
|
1524
|
+
return Promise.reject(u);
|
|
1525
1525
|
}
|
|
1526
1526
|
for (b = 0, y = d.length; b < y; )
|
|
1527
|
-
|
|
1528
|
-
return
|
|
1527
|
+
c = c.then(d[b++], d[b++]);
|
|
1528
|
+
return c;
|
|
1529
1529
|
}
|
|
1530
1530
|
getUri(e) {
|
|
1531
1531
|
e = he(this.defaults, e);
|
|
@@ -1768,8 +1768,10 @@ class ca {
|
|
|
1768
1768
|
"Content-Type": "application/json",
|
|
1769
1769
|
...this.apiKey ? { "x-api-key": this.apiKey } : {}
|
|
1770
1770
|
},
|
|
1771
|
-
timeout:
|
|
1771
|
+
timeout: 3e4,
|
|
1772
1772
|
// 10s timeout
|
|
1773
|
+
withCredentials: !0
|
|
1774
|
+
// 🔥 REQUIRED FOR SESSION COOKIES
|
|
1773
1775
|
});
|
|
1774
1776
|
}
|
|
1775
1777
|
/**
|
|
@@ -1826,6 +1828,29 @@ class ca {
|
|
|
1826
1828
|
appId: a || this.appId
|
|
1827
1829
|
});
|
|
1828
1830
|
}
|
|
1831
|
+
/**
|
|
1832
|
+
* 🔐 Check current authentication session (cookie-based)
|
|
1833
|
+
* Automatically detects logged-in / logged-out state
|
|
1834
|
+
*/
|
|
1835
|
+
async checkSession() {
|
|
1836
|
+
if (typeof window > "u")
|
|
1837
|
+
return { authenticated: !1 };
|
|
1838
|
+
const e = localStorage.getItem("authix_token");
|
|
1839
|
+
if (!e || e === "undefined" || e === "null")
|
|
1840
|
+
return { authenticated: !1 };
|
|
1841
|
+
try {
|
|
1842
|
+
return await this.request(
|
|
1843
|
+
"GET",
|
|
1844
|
+
"/users/session",
|
|
1845
|
+
void 0,
|
|
1846
|
+
{
|
|
1847
|
+
Authorization: `Bearer ${e}`
|
|
1848
|
+
}
|
|
1849
|
+
);
|
|
1850
|
+
} catch {
|
|
1851
|
+
return { authenticated: !1 };
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1829
1854
|
/**
|
|
1830
1855
|
* Update an existing user
|
|
1831
1856
|
* @param params fields to update
|
|
@@ -2327,14 +2352,14 @@ function Bn() {
|
|
|
2327
2352
|
}
|
|
2328
2353
|
function h() {
|
|
2329
2354
|
var f = t(this.type);
|
|
2330
|
-
return
|
|
2355
|
+
return O[f] || (O[f] = !0, console.error(
|
|
2331
2356
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
2332
2357
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
2333
2358
|
}
|
|
2334
2359
|
function d(f, S, x, k, _, N) {
|
|
2335
2360
|
var Y = x.ref;
|
|
2336
2361
|
return f = {
|
|
2337
|
-
$$typeof:
|
|
2362
|
+
$$typeof: u,
|
|
2338
2363
|
type: f,
|
|
2339
2364
|
key: S,
|
|
2340
2365
|
props: x,
|
|
@@ -2364,7 +2389,7 @@ function Bn() {
|
|
|
2364
2389
|
value: N
|
|
2365
2390
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
2366
2391
|
}
|
|
2367
|
-
function
|
|
2392
|
+
function c(f, S, x, k, _, N) {
|
|
2368
2393
|
var Y = S.children;
|
|
2369
2394
|
if (Y !== void 0)
|
|
2370
2395
|
if (k)
|
|
@@ -2416,9 +2441,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2416
2441
|
y(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === D && (f._payload.status === "fulfilled" ? y(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
2417
2442
|
}
|
|
2418
2443
|
function y(f) {
|
|
2419
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
2444
|
+
return typeof f == "object" && f !== null && f.$$typeof === u;
|
|
2420
2445
|
}
|
|
2421
|
-
var w = Le,
|
|
2446
|
+
var w = Le, u = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), C = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), V = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, T = Array.isArray, J = console.createTask ? console.createTask : function() {
|
|
2422
2447
|
return null;
|
|
2423
2448
|
};
|
|
2424
2449
|
w = {
|
|
@@ -2426,13 +2451,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2426
2451
|
return f();
|
|
2427
2452
|
}
|
|
2428
2453
|
};
|
|
2429
|
-
var A,
|
|
2454
|
+
var A, O = {}, K = w.react_stack_bottom_frame.bind(
|
|
2430
2455
|
w,
|
|
2431
2456
|
i
|
|
2432
2457
|
)(), Q = J(s(i)), G = {};
|
|
2433
2458
|
Ee.Fragment = m, Ee.jsx = function(f, S, x) {
|
|
2434
2459
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2435
|
-
return
|
|
2460
|
+
return c(
|
|
2436
2461
|
f,
|
|
2437
2462
|
S,
|
|
2438
2463
|
x,
|
|
@@ -2442,7 +2467,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2442
2467
|
);
|
|
2443
2468
|
}, Ee.jsxs = function(f, S, x) {
|
|
2444
2469
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2445
|
-
return
|
|
2470
|
+
return c(
|
|
2446
2471
|
f,
|
|
2447
2472
|
S,
|
|
2448
2473
|
x,
|
|
@@ -2459,7 +2484,7 @@ function Wn() {
|
|
|
2459
2484
|
}
|
|
2460
2485
|
var n = Wn();
|
|
2461
2486
|
const Hn = async (t, e) => {
|
|
2462
|
-
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive: d = !0, role:
|
|
2487
|
+
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive: d = !0, role: c = "user" } = t, { baseUrl: b, apiKey: y } = e;
|
|
2463
2488
|
if (!y)
|
|
2464
2489
|
throw new Error("API key is required for signup");
|
|
2465
2490
|
if (!r || !s || !a || !i)
|
|
@@ -2476,7 +2501,7 @@ const Hn = async (t, e) => {
|
|
|
2476
2501
|
address: l,
|
|
2477
2502
|
avatarUrl: h,
|
|
2478
2503
|
isActive: d,
|
|
2479
|
-
role:
|
|
2504
|
+
role: c
|
|
2480
2505
|
},
|
|
2481
2506
|
{
|
|
2482
2507
|
headers: {
|
|
@@ -2487,15 +2512,15 @@ const Hn = async (t, e) => {
|
|
|
2487
2512
|
);
|
|
2488
2513
|
return w.data?.user && localStorage.setItem("userInfo", JSON.stringify(w.data.user)), w.data.user;
|
|
2489
2514
|
} catch (w) {
|
|
2490
|
-
const
|
|
2491
|
-
if (console.error("Signup API Error:",
|
|
2492
|
-
if (
|
|
2515
|
+
const u = w.response?.data?.message || w.message || "Signup failed";
|
|
2516
|
+
if (console.error("Signup API Error:", u), w.response?.status === 400) {
|
|
2517
|
+
if (u.includes("already exists"))
|
|
2493
2518
|
throw {
|
|
2494
2519
|
success: !1,
|
|
2495
2520
|
message: "User with this email already exists for this app",
|
|
2496
2521
|
status: 400
|
|
2497
2522
|
};
|
|
2498
|
-
if (
|
|
2523
|
+
if (u.includes("inactive"))
|
|
2499
2524
|
throw {
|
|
2500
2525
|
success: !1,
|
|
2501
2526
|
message: "Cannot signup under an inactive app",
|
|
@@ -2508,7 +2533,7 @@ const Hn = async (t, e) => {
|
|
|
2508
2533
|
status: 404
|
|
2509
2534
|
} : {
|
|
2510
2535
|
success: !1,
|
|
2511
|
-
message:
|
|
2536
|
+
message: u,
|
|
2512
2537
|
status: w.response?.status || 500
|
|
2513
2538
|
};
|
|
2514
2539
|
}
|
|
@@ -2577,7 +2602,7 @@ const Gn = Nt(
|
|
|
2577
2602
|
...l
|
|
2578
2603
|
},
|
|
2579
2604
|
[
|
|
2580
|
-
...o.map(([d,
|
|
2605
|
+
...o.map(([d, c]) => Xe(d, c)),
|
|
2581
2606
|
...Array.isArray(i) ? i : [i]
|
|
2582
2607
|
]
|
|
2583
2608
|
)
|
|
@@ -3031,19 +3056,19 @@ const Ls = [
|
|
|
3031
3056
|
showAvatar: h = !1,
|
|
3032
3057
|
roles: d = [],
|
|
3033
3058
|
// 🔥 FIXED
|
|
3034
|
-
showRoleSelector:
|
|
3059
|
+
showRoleSelector: c = !1,
|
|
3035
3060
|
// 🔥 FIXED
|
|
3036
3061
|
loginUrl: b,
|
|
3037
3062
|
onSuccess: y,
|
|
3038
3063
|
onError: w
|
|
3039
3064
|
}) => {
|
|
3040
|
-
const { baseUrl:
|
|
3065
|
+
const { baseUrl: u, apiKey: j, appId: m } = ge(), $ = {
|
|
3041
3066
|
name: "",
|
|
3042
3067
|
email: "",
|
|
3043
3068
|
password: "",
|
|
3044
3069
|
role: d.length ? d[0] : "user",
|
|
3045
3070
|
...h && { avatarUrl: "" }
|
|
3046
|
-
}, [I, z] =
|
|
3071
|
+
}, [I, z] = P($), [C, q] = P(!1), [g, R] = P(!1), [v, D] = P(null), [B, F] = P({}), [V, Z] = P(!1), T = l ? "#ffffff" : "#111827", J = l ? "#a1a1aa" : "#6b7280", A = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", O = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
3047
3072
|
Le.useEffect(() => {
|
|
3048
3073
|
if (typeof window < "u") {
|
|
3049
3074
|
const S = () => Z(window.innerWidth < 768);
|
|
@@ -3063,7 +3088,7 @@ const Ls = [
|
|
|
3063
3088
|
const x = {
|
|
3064
3089
|
...I,
|
|
3065
3090
|
appId: m
|
|
3066
|
-
}, k = await Hn(x, { baseUrl:
|
|
3091
|
+
}, k = await Hn(x, { baseUrl: u, apiKey: j });
|
|
3067
3092
|
D({ type: "success", text: "Account created successfully!" }), y && y(k);
|
|
3068
3093
|
} catch (x) {
|
|
3069
3094
|
const k = x.message || "Signup failed. Please try again.";
|
|
@@ -3076,7 +3101,7 @@ const Ls = [
|
|
|
3076
3101
|
width: "100%",
|
|
3077
3102
|
padding: V ? "10px 14px 10px 44px" : "10px 16px 10px 44px",
|
|
3078
3103
|
backgroundColor: A,
|
|
3079
|
-
border: `1px solid ${
|
|
3104
|
+
border: `1px solid ${O}`,
|
|
3080
3105
|
borderRadius: "10px",
|
|
3081
3106
|
color: T,
|
|
3082
3107
|
fontSize: "15px",
|
|
@@ -3200,7 +3225,7 @@ const Ls = [
|
|
|
3200
3225
|
onSubmit: G,
|
|
3201
3226
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3202
3227
|
children: [
|
|
3203
|
-
|
|
3228
|
+
c && d && d.length === 2 && /* @__PURE__ */ n.jsxs(
|
|
3204
3229
|
"div",
|
|
3205
3230
|
{
|
|
3206
3231
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -3223,7 +3248,7 @@ const Ls = [
|
|
|
3223
3248
|
position: "relative",
|
|
3224
3249
|
display: "flex",
|
|
3225
3250
|
borderRadius: "10px",
|
|
3226
|
-
border: `1px solid ${
|
|
3251
|
+
border: `1px solid ${O}`,
|
|
3227
3252
|
backgroundColor: A,
|
|
3228
3253
|
overflow: "hidden",
|
|
3229
3254
|
cursor: "pointer",
|
|
@@ -3337,7 +3362,7 @@ const Ls = [
|
|
|
3337
3362
|
onChange: K,
|
|
3338
3363
|
style: {
|
|
3339
3364
|
...f,
|
|
3340
|
-
borderColor: B.name ? "#ef4444" :
|
|
3365
|
+
borderColor: B.name ? "#ef4444" : O
|
|
3341
3366
|
}
|
|
3342
3367
|
}
|
|
3343
3368
|
)
|
|
@@ -3392,7 +3417,7 @@ const Ls = [
|
|
|
3392
3417
|
onChange: K,
|
|
3393
3418
|
style: {
|
|
3394
3419
|
...f,
|
|
3395
|
-
borderColor: B.email ? "#ef4444" :
|
|
3420
|
+
borderColor: B.email ? "#ef4444" : O
|
|
3396
3421
|
}
|
|
3397
3422
|
}
|
|
3398
3423
|
)
|
|
@@ -3447,7 +3472,7 @@ const Ls = [
|
|
|
3447
3472
|
onChange: K,
|
|
3448
3473
|
style: {
|
|
3449
3474
|
...f,
|
|
3450
|
-
borderColor: B.password ? "#ef4444" :
|
|
3475
|
+
borderColor: B.password ? "#ef4444" : O
|
|
3451
3476
|
}
|
|
3452
3477
|
}
|
|
3453
3478
|
),
|
|
@@ -3671,14 +3696,14 @@ const Ls = [
|
|
|
3671
3696
|
darkMode: l = !0,
|
|
3672
3697
|
signupUrl: h,
|
|
3673
3698
|
onSuccess: d,
|
|
3674
|
-
onError:
|
|
3699
|
+
onError: c
|
|
3675
3700
|
}) => {
|
|
3676
|
-
const { baseUrl: b, apiKey: y, appId: w } = ge(), [
|
|
3701
|
+
const { baseUrl: b, apiKey: y, appId: w } = ge(), [u, j] = P("login"), [m, $] = P(1), [I, z] = P(!1), [C, q] = P(!1), [g, R] = P(null), [v, D] = P(""), [B, F] = P(""), [V, Z] = P({
|
|
3677
3702
|
email: "",
|
|
3678
3703
|
otp: "",
|
|
3679
3704
|
newPassword: "",
|
|
3680
3705
|
appId: w
|
|
3681
|
-
}), [T, J] =
|
|
3706
|
+
}), [T, J] = P(!1), A = l ? "#ffffff" : "#111827", O = l ? "#a1a1aa" : "#6b7280", K = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", Q = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
3682
3707
|
Le.useEffect(() => {
|
|
3683
3708
|
if (typeof window < "u") {
|
|
3684
3709
|
const _ = () => J(window.innerWidth < 768);
|
|
@@ -3695,7 +3720,7 @@ const Ls = [
|
|
|
3695
3720
|
R({ type: "success", text: `Welcome ${N.name}` }), d?.(N);
|
|
3696
3721
|
} catch (N) {
|
|
3697
3722
|
const Y = N.message || "Login failed";
|
|
3698
|
-
R({ type: "error", text: Y }),
|
|
3723
|
+
R({ type: "error", text: Y }), c?.(N);
|
|
3699
3724
|
} finally {
|
|
3700
3725
|
q(!1);
|
|
3701
3726
|
}
|
|
@@ -3817,7 +3842,7 @@ const Ls = [
|
|
|
3817
3842
|
color: A,
|
|
3818
3843
|
margin: 0
|
|
3819
3844
|
},
|
|
3820
|
-
children:
|
|
3845
|
+
children: u === "login" ? r : m === 1 ? "Forgot Password" : "Reset Password"
|
|
3821
3846
|
}
|
|
3822
3847
|
),
|
|
3823
3848
|
/* @__PURE__ */ n.jsx(
|
|
@@ -3825,15 +3850,15 @@ const Ls = [
|
|
|
3825
3850
|
{
|
|
3826
3851
|
style: {
|
|
3827
3852
|
fontSize: "14px",
|
|
3828
|
-
color:
|
|
3853
|
+
color: O
|
|
3829
3854
|
},
|
|
3830
|
-
children:
|
|
3855
|
+
children: u === "login" ? s : "Follow the steps to reset your password"
|
|
3831
3856
|
}
|
|
3832
3857
|
)
|
|
3833
3858
|
]
|
|
3834
3859
|
}
|
|
3835
3860
|
),
|
|
3836
|
-
|
|
3861
|
+
u === "login" && /* @__PURE__ */ n.jsxs(
|
|
3837
3862
|
"form",
|
|
3838
3863
|
{
|
|
3839
3864
|
onSubmit: G,
|
|
@@ -3866,7 +3891,7 @@ const Ls = [
|
|
|
3866
3891
|
left: "14px",
|
|
3867
3892
|
top: "50%",
|
|
3868
3893
|
transform: "translateY(-50%)",
|
|
3869
|
-
color:
|
|
3894
|
+
color: O
|
|
3870
3895
|
}
|
|
3871
3896
|
}
|
|
3872
3897
|
),
|
|
@@ -3912,7 +3937,7 @@ const Ls = [
|
|
|
3912
3937
|
left: "14px",
|
|
3913
3938
|
top: "50%",
|
|
3914
3939
|
transform: "translateY(-50%)",
|
|
3915
|
-
color:
|
|
3940
|
+
color: O
|
|
3916
3941
|
}
|
|
3917
3942
|
}
|
|
3918
3943
|
),
|
|
@@ -3940,7 +3965,7 @@ const Ls = [
|
|
|
3940
3965
|
transform: "translateY(-50%)",
|
|
3941
3966
|
background: "transparent",
|
|
3942
3967
|
border: "none",
|
|
3943
|
-
color:
|
|
3968
|
+
color: O,
|
|
3944
3969
|
cursor: "pointer"
|
|
3945
3970
|
},
|
|
3946
3971
|
children: I ? /* @__PURE__ */ n.jsx(it, { size: 20 }) : /* @__PURE__ */ n.jsx(lt, { size: 20 })
|
|
@@ -4009,7 +4034,7 @@ const Ls = [
|
|
|
4009
4034
|
]
|
|
4010
4035
|
}
|
|
4011
4036
|
),
|
|
4012
|
-
|
|
4037
|
+
u === "forgot" && /* @__PURE__ */ n.jsxs(
|
|
4013
4038
|
"form",
|
|
4014
4039
|
{
|
|
4015
4040
|
onSubmit: m === 1 ? S : x,
|
|
@@ -4042,7 +4067,7 @@ const Ls = [
|
|
|
4042
4067
|
left: "14px",
|
|
4043
4068
|
top: "50%",
|
|
4044
4069
|
transform: "translateY(-50%)",
|
|
4045
|
-
color:
|
|
4070
|
+
color: O
|
|
4046
4071
|
}
|
|
4047
4072
|
}
|
|
4048
4073
|
),
|
|
@@ -4093,7 +4118,7 @@ const Ls = [
|
|
|
4093
4118
|
left: "14px",
|
|
4094
4119
|
top: "50%",
|
|
4095
4120
|
transform: "translateY(-50%)",
|
|
4096
|
-
color:
|
|
4121
|
+
color: O
|
|
4097
4122
|
}
|
|
4098
4123
|
}
|
|
4099
4124
|
),
|
|
@@ -4144,7 +4169,7 @@ const Ls = [
|
|
|
4144
4169
|
left: "14px",
|
|
4145
4170
|
top: "50%",
|
|
4146
4171
|
transform: "translateY(-50%)",
|
|
4147
|
-
color:
|
|
4172
|
+
color: O
|
|
4148
4173
|
}
|
|
4149
4174
|
}
|
|
4150
4175
|
),
|
|
@@ -4193,7 +4218,7 @@ const Ls = [
|
|
|
4193
4218
|
background: "none",
|
|
4194
4219
|
border: "none",
|
|
4195
4220
|
fontSize: "14px",
|
|
4196
|
-
color:
|
|
4221
|
+
color: O,
|
|
4197
4222
|
marginTop: "6px",
|
|
4198
4223
|
cursor: "pointer"
|
|
4199
4224
|
},
|
|
@@ -4230,7 +4255,7 @@ const Ls = [
|
|
|
4230
4255
|
style: {
|
|
4231
4256
|
textAlign: "center",
|
|
4232
4257
|
fontSize: "12px",
|
|
4233
|
-
color:
|
|
4258
|
+
color: O,
|
|
4234
4259
|
marginTop: "16px",
|
|
4235
4260
|
padding: "0 4px"
|
|
4236
4261
|
},
|
|
@@ -4249,35 +4274,33 @@ const Ls = [
|
|
|
4249
4274
|
}, xa = ({
|
|
4250
4275
|
children: t,
|
|
4251
4276
|
fallback: e = null,
|
|
4252
|
-
className: r,
|
|
4277
|
+
className: r = "",
|
|
4253
4278
|
width: s,
|
|
4254
4279
|
height: a
|
|
4255
4280
|
}) => {
|
|
4256
|
-
const [i, o] =
|
|
4257
|
-
|
|
4281
|
+
const [i, o] = P(!1), [l, h] = P(!1);
|
|
4282
|
+
return te(() => {
|
|
4283
|
+
o(!0);
|
|
4258
4284
|
try {
|
|
4259
|
-
const
|
|
4260
|
-
|
|
4285
|
+
const c = localStorage.getItem("userInfo");
|
|
4286
|
+
h(
|
|
4287
|
+
!!(c && c !== "undefined" && c !== "null")
|
|
4288
|
+
);
|
|
4261
4289
|
} catch {
|
|
4262
|
-
|
|
4290
|
+
h(!1);
|
|
4263
4291
|
}
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
} catch {
|
|
4274
|
-
o(!1);
|
|
4275
|
-
}
|
|
4276
|
-
};
|
|
4277
|
-
return window.addEventListener("storage", l), () => {
|
|
4278
|
-
window.removeEventListener("storage", l);
|
|
4292
|
+
const d = () => {
|
|
4293
|
+
try {
|
|
4294
|
+
const c = localStorage.getItem("userInfo");
|
|
4295
|
+
h(
|
|
4296
|
+
!!(c && c !== "undefined" && c !== "null")
|
|
4297
|
+
);
|
|
4298
|
+
} catch {
|
|
4299
|
+
h(!1);
|
|
4300
|
+
}
|
|
4279
4301
|
};
|
|
4280
|
-
|
|
4302
|
+
return window.addEventListener("storage", d), () => window.removeEventListener("storage", d);
|
|
4303
|
+
}, []), i ? l ? /* @__PURE__ */ n.jsx(
|
|
4281
4304
|
"div",
|
|
4282
4305
|
{
|
|
4283
4306
|
className: r,
|
|
@@ -4289,36 +4312,29 @@ const Ls = [
|
|
|
4289
4312
|
},
|
|
4290
4313
|
children: t
|
|
4291
4314
|
}
|
|
4292
|
-
) : typeof e == "function" ? e() : e;
|
|
4315
|
+
) : typeof e == "function" ? e() : e : null;
|
|
4293
4316
|
}, ha = ({
|
|
4294
4317
|
children: t,
|
|
4295
4318
|
fallback: e = null,
|
|
4296
|
-
className: r,
|
|
4319
|
+
className: r = "",
|
|
4297
4320
|
width: s,
|
|
4298
4321
|
height: a
|
|
4299
4322
|
}) => {
|
|
4300
|
-
const [i, o] =
|
|
4301
|
-
if (typeof window > "u") return !0;
|
|
4302
|
-
try {
|
|
4303
|
-
const l = localStorage.getItem("userInfo");
|
|
4304
|
-
return !l || l === "undefined" || l === "null";
|
|
4305
|
-
} catch {
|
|
4306
|
-
return !0;
|
|
4307
|
-
}
|
|
4308
|
-
});
|
|
4323
|
+
const [i, o] = P(!1), [l, h] = P(!0);
|
|
4309
4324
|
return te(() => {
|
|
4310
|
-
|
|
4325
|
+
o(!0);
|
|
4326
|
+
const d = () => {
|
|
4311
4327
|
try {
|
|
4312
|
-
const
|
|
4313
|
-
|
|
4314
|
-
!
|
|
4328
|
+
const c = localStorage.getItem("userInfo");
|
|
4329
|
+
h(
|
|
4330
|
+
!c || c === "undefined" || c === "null"
|
|
4315
4331
|
);
|
|
4316
4332
|
} catch {
|
|
4317
|
-
|
|
4333
|
+
h(!0);
|
|
4318
4334
|
}
|
|
4319
4335
|
};
|
|
4320
|
-
return
|
|
4321
|
-
}, []), i ? /* @__PURE__ */ n.jsx(
|
|
4336
|
+
return d(), window.addEventListener("storage", d), () => window.removeEventListener("storage", d);
|
|
4337
|
+
}, []), i ? l ? /* @__PURE__ */ n.jsx(
|
|
4322
4338
|
"div",
|
|
4323
4339
|
{
|
|
4324
4340
|
className: r,
|
|
@@ -4330,7 +4346,7 @@ const Ls = [
|
|
|
4330
4346
|
},
|
|
4331
4347
|
children: t
|
|
4332
4348
|
}
|
|
4333
|
-
) : typeof e == "function" ? e() : e;
|
|
4349
|
+
) : typeof e == "function" ? e() : e : null;
|
|
4334
4350
|
}, qs = ({
|
|
4335
4351
|
isOpen: t,
|
|
4336
4352
|
onClose: e,
|
|
@@ -4340,7 +4356,7 @@ const Ls = [
|
|
|
4340
4356
|
token: i,
|
|
4341
4357
|
colors: o
|
|
4342
4358
|
}) => {
|
|
4343
|
-
const { baseUrl: l, apiKey: h, appId: d } = ge(), [
|
|
4359
|
+
const { baseUrl: l, apiKey: h, appId: d } = ge(), [c, b] = P(!1), [y, w] = P(""), [u, j] = P("warning"), [m, $] = P(!1);
|
|
4344
4360
|
if (te(() => {
|
|
4345
4361
|
if (typeof window > "u") return;
|
|
4346
4362
|
const g = () => {
|
|
@@ -4366,9 +4382,9 @@ const Ls = [
|
|
|
4366
4382
|
b(!1);
|
|
4367
4383
|
}
|
|
4368
4384
|
}, z = y.toLowerCase() === "delete my account", C = (g) => {
|
|
4369
|
-
g.target === g.currentTarget &&
|
|
4385
|
+
g.target === g.currentTarget && u !== "processing" && u !== "success" && e();
|
|
4370
4386
|
}, q = () => {
|
|
4371
|
-
switch (
|
|
4387
|
+
switch (u) {
|
|
4372
4388
|
case "warning":
|
|
4373
4389
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
4374
4390
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -4768,7 +4784,7 @@ const Ls = [
|
|
|
4768
4784
|
"button",
|
|
4769
4785
|
{
|
|
4770
4786
|
onClick: I,
|
|
4771
|
-
disabled: !z ||
|
|
4787
|
+
disabled: !z || c,
|
|
4772
4788
|
style: {
|
|
4773
4789
|
padding: "10px 24px",
|
|
4774
4790
|
borderRadius: "10px",
|
|
@@ -4777,22 +4793,22 @@ const Ls = [
|
|
|
4777
4793
|
color: "white",
|
|
4778
4794
|
fontSize: "14px",
|
|
4779
4795
|
fontWeight: 600,
|
|
4780
|
-
cursor: !z ||
|
|
4796
|
+
cursor: !z || c ? "not-allowed" : "pointer",
|
|
4781
4797
|
flex: m ? "none" : 1,
|
|
4782
4798
|
minWidth: m ? "100%" : "140px",
|
|
4783
|
-
opacity: !z ||
|
|
4799
|
+
opacity: !z || c ? 0.6 : 1,
|
|
4784
4800
|
display: "flex",
|
|
4785
4801
|
alignItems: "center",
|
|
4786
4802
|
justifyContent: "center",
|
|
4787
4803
|
gap: "8px",
|
|
4788
4804
|
transition: "all 0.2s ease",
|
|
4789
|
-
boxShadow: !z ||
|
|
4805
|
+
boxShadow: !z || c ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
|
|
4790
4806
|
},
|
|
4791
4807
|
onMouseOver: (g) => {
|
|
4792
|
-
z && !
|
|
4808
|
+
z && !c && (g.currentTarget.style.transform = "translateY(-1px)", g.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
|
|
4793
4809
|
},
|
|
4794
4810
|
onMouseOut: (g) => {
|
|
4795
|
-
z && !
|
|
4811
|
+
z && !c && (g.currentTarget.style.transform = "translateY(0)", g.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
|
|
4796
4812
|
},
|
|
4797
4813
|
children: [
|
|
4798
4814
|
/* @__PURE__ */ n.jsx(Ne, { size: 16 }),
|
|
@@ -5192,20 +5208,20 @@ const Ls = [
|
|
|
5192
5208
|
onUpdate: r,
|
|
5193
5209
|
colors: s
|
|
5194
5210
|
}) => {
|
|
5195
|
-
const [a, i] =
|
|
5211
|
+
const [a, i] = P(""), [o, l] = P(!1), [h, d] = P(!1), [c, b] = P({ isValid: !1, message: "", type: null });
|
|
5196
5212
|
if (te(() => {
|
|
5197
5213
|
if (typeof window > "u") return;
|
|
5198
|
-
const
|
|
5214
|
+
const u = () => {
|
|
5199
5215
|
d(window.innerWidth < 640);
|
|
5200
5216
|
};
|
|
5201
|
-
return
|
|
5217
|
+
return u(), window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
|
|
5202
5218
|
}, []), te(() => {
|
|
5203
5219
|
if (!a.trim()) {
|
|
5204
5220
|
b({ isValid: !1, message: "", type: null });
|
|
5205
5221
|
return;
|
|
5206
5222
|
}
|
|
5207
5223
|
try {
|
|
5208
|
-
const
|
|
5224
|
+
const u = new URL(a), j = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(u.pathname);
|
|
5209
5225
|
b(j ? {
|
|
5210
5226
|
isValid: !0,
|
|
5211
5227
|
message: "Valid image URL",
|
|
@@ -5224,7 +5240,7 @@ const Ls = [
|
|
|
5224
5240
|
}
|
|
5225
5241
|
}, [a]), !t) return null;
|
|
5226
5242
|
const y = async () => {
|
|
5227
|
-
if (!(!a || !
|
|
5243
|
+
if (!(!a || !c.isValid)) {
|
|
5228
5244
|
l(!0);
|
|
5229
5245
|
try {
|
|
5230
5246
|
await r(a) && (i(""), e());
|
|
@@ -5232,8 +5248,8 @@ const Ls = [
|
|
|
5232
5248
|
l(!1);
|
|
5233
5249
|
}
|
|
5234
5250
|
}
|
|
5235
|
-
}, w = (
|
|
5236
|
-
|
|
5251
|
+
}, w = (u) => {
|
|
5252
|
+
u.target === u.currentTarget && e();
|
|
5237
5253
|
};
|
|
5238
5254
|
return /* @__PURE__ */ n.jsxs(
|
|
5239
5255
|
"div",
|
|
@@ -5340,11 +5356,11 @@ const Ls = [
|
|
|
5340
5356
|
flexShrink: 0,
|
|
5341
5357
|
transition: "all 0.2s ease"
|
|
5342
5358
|
},
|
|
5343
|
-
onMouseOver: (
|
|
5344
|
-
|
|
5359
|
+
onMouseOver: (u) => {
|
|
5360
|
+
u.currentTarget.style.backgroundColor = s.border, u.currentTarget.style.color = s.textPrimary;
|
|
5345
5361
|
},
|
|
5346
|
-
onMouseOut: (
|
|
5347
|
-
|
|
5362
|
+
onMouseOut: (u) => {
|
|
5363
|
+
u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.color = s.textTertiary;
|
|
5348
5364
|
},
|
|
5349
5365
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20 })
|
|
5350
5366
|
}
|
|
@@ -5389,13 +5405,13 @@ const Ls = [
|
|
|
5389
5405
|
id: "avatar-url",
|
|
5390
5406
|
placeholder: "https://example.com/your-avatar.jpg",
|
|
5391
5407
|
value: a,
|
|
5392
|
-
onChange: (
|
|
5408
|
+
onChange: (u) => i(u.target.value),
|
|
5393
5409
|
style: {
|
|
5394
5410
|
width: "100%",
|
|
5395
5411
|
padding: "14px 16px",
|
|
5396
5412
|
paddingLeft: "44px",
|
|
5397
5413
|
borderRadius: "12px",
|
|
5398
|
-
border: `1.5px solid ${
|
|
5414
|
+
border: `1.5px solid ${c.type === "error" ? s.error : c.type === "success" ? s.success : s.border}`,
|
|
5399
5415
|
backgroundColor: "transparent",
|
|
5400
5416
|
color: s.textPrimary,
|
|
5401
5417
|
fontSize: "15px",
|
|
@@ -5403,11 +5419,11 @@ const Ls = [
|
|
|
5403
5419
|
transition: "all 0.2s ease",
|
|
5404
5420
|
boxSizing: "border-box"
|
|
5405
5421
|
},
|
|
5406
|
-
onFocus: (
|
|
5407
|
-
|
|
5422
|
+
onFocus: (u) => {
|
|
5423
|
+
u.target.style.borderColor = s.accent, u.target.style.boxShadow = `0 0 0 3px ${s.accent}20`;
|
|
5408
5424
|
},
|
|
5409
|
-
onBlur: (
|
|
5410
|
-
|
|
5425
|
+
onBlur: (u) => {
|
|
5426
|
+
u.target.style.borderColor = c.type === "error" ? s.error : c.type === "success" ? s.success : s.border, u.target.style.boxShadow = "none";
|
|
5411
5427
|
},
|
|
5412
5428
|
disabled: o
|
|
5413
5429
|
}
|
|
@@ -5426,7 +5442,7 @@ const Ls = [
|
|
|
5426
5442
|
}
|
|
5427
5443
|
)
|
|
5428
5444
|
] }),
|
|
5429
|
-
|
|
5445
|
+
c.message && /* @__PURE__ */ n.jsxs(
|
|
5430
5446
|
"div",
|
|
5431
5447
|
{
|
|
5432
5448
|
style: {
|
|
@@ -5435,18 +5451,18 @@ const Ls = [
|
|
|
5435
5451
|
gap: "6px",
|
|
5436
5452
|
marginTop: "8px",
|
|
5437
5453
|
fontSize: "13px",
|
|
5438
|
-
color:
|
|
5454
|
+
color: c.type === "success" ? s.success : c.type === "error" ? s.error : s.textTertiary
|
|
5439
5455
|
},
|
|
5440
5456
|
children: [
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5457
|
+
c.type === "success" && /* @__PURE__ */ n.jsx(de, { size: 14 }),
|
|
5458
|
+
c.type === "error" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5459
|
+
c.type === "warning" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5460
|
+
c.message
|
|
5445
5461
|
]
|
|
5446
5462
|
}
|
|
5447
5463
|
)
|
|
5448
5464
|
] }),
|
|
5449
|
-
a &&
|
|
5465
|
+
a && c.type === "success" && /* @__PURE__ */ n.jsxs(
|
|
5450
5466
|
"div",
|
|
5451
5467
|
{
|
|
5452
5468
|
style: {
|
|
@@ -5482,8 +5498,8 @@ const Ls = [
|
|
|
5482
5498
|
border: `2px solid ${s.success}40`,
|
|
5483
5499
|
margin: "0 auto"
|
|
5484
5500
|
},
|
|
5485
|
-
onError: (
|
|
5486
|
-
|
|
5501
|
+
onError: (u) => {
|
|
5502
|
+
u.currentTarget.style.display = "none";
|
|
5487
5503
|
}
|
|
5488
5504
|
}
|
|
5489
5505
|
)
|
|
@@ -5524,11 +5540,11 @@ const Ls = [
|
|
|
5524
5540
|
opacity: o ? 0.6 : 1,
|
|
5525
5541
|
transition: "all 0.2s ease"
|
|
5526
5542
|
},
|
|
5527
|
-
onMouseOver: (
|
|
5528
|
-
o || (
|
|
5543
|
+
onMouseOver: (u) => {
|
|
5544
|
+
o || (u.currentTarget.style.backgroundColor = s.border, u.currentTarget.style.transform = "translateY(-1px)");
|
|
5529
5545
|
},
|
|
5530
|
-
onMouseOut: (
|
|
5531
|
-
o || (
|
|
5546
|
+
onMouseOut: (u) => {
|
|
5547
|
+
o || (u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.transform = "translateY(0)");
|
|
5532
5548
|
},
|
|
5533
5549
|
children: "Cancel"
|
|
5534
5550
|
}
|
|
@@ -5537,7 +5553,7 @@ const Ls = [
|
|
|
5537
5553
|
"button",
|
|
5538
5554
|
{
|
|
5539
5555
|
onClick: y,
|
|
5540
|
-
disabled: o || !
|
|
5556
|
+
disabled: o || !c.isValid,
|
|
5541
5557
|
style: {
|
|
5542
5558
|
padding: "10px 24px",
|
|
5543
5559
|
borderRadius: "10px",
|
|
@@ -5546,22 +5562,22 @@ const Ls = [
|
|
|
5546
5562
|
color: "#fff",
|
|
5547
5563
|
fontSize: "14px",
|
|
5548
5564
|
fontWeight: 600,
|
|
5549
|
-
cursor: o || !
|
|
5565
|
+
cursor: o || !c.isValid ? "not-allowed" : "pointer",
|
|
5550
5566
|
flex: h ? "none" : 1,
|
|
5551
5567
|
minWidth: h ? "100%" : "140px",
|
|
5552
|
-
opacity: o || !
|
|
5568
|
+
opacity: o || !c.isValid ? 0.6 : 1,
|
|
5553
5569
|
display: "flex",
|
|
5554
5570
|
alignItems: "center",
|
|
5555
5571
|
justifyContent: "center",
|
|
5556
5572
|
gap: "8px",
|
|
5557
5573
|
transition: "all 0.2s ease",
|
|
5558
|
-
boxShadow: o || !
|
|
5574
|
+
boxShadow: o || !c.isValid ? "none" : `0 4px 12px ${s.accent}40`
|
|
5559
5575
|
},
|
|
5560
|
-
onMouseOver: (
|
|
5561
|
-
!o &&
|
|
5576
|
+
onMouseOver: (u) => {
|
|
5577
|
+
!o && c.isValid && (u.currentTarget.style.transform = "translateY(-1px)", u.currentTarget.style.boxShadow = `0 6px 20px ${s.accent}60`);
|
|
5562
5578
|
},
|
|
5563
|
-
onMouseOut: (
|
|
5564
|
-
!o &&
|
|
5579
|
+
onMouseOut: (u) => {
|
|
5580
|
+
!o && c.isValid && (u.currentTarget.style.transform = "translateY(0)", u.currentTarget.style.boxShadow = `0 4px 12px ${s.accent}40`);
|
|
5565
5581
|
},
|
|
5566
5582
|
children: o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
5567
5583
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5646,15 +5662,15 @@ const Ls = [
|
|
|
5646
5662
|
userId: a,
|
|
5647
5663
|
colors: i
|
|
5648
5664
|
}) => {
|
|
5649
|
-
const { baseUrl: o, apiKey: l, appId: h } = ge(), [d,
|
|
5665
|
+
const { baseUrl: o, apiKey: l, appId: h } = ge(), [d, c] = P({
|
|
5650
5666
|
currentPassword: "",
|
|
5651
5667
|
newPassword: "",
|
|
5652
5668
|
confirmPassword: ""
|
|
5653
|
-
}), [b, y] =
|
|
5669
|
+
}), [b, y] = P({}), [w, u] = P(!1), [j, m] = P({
|
|
5654
5670
|
currentPassword: !1,
|
|
5655
5671
|
newPassword: !1,
|
|
5656
5672
|
confirmPassword: !1
|
|
5657
|
-
}), [$, I] =
|
|
5673
|
+
}), [$, I] = P(!1);
|
|
5658
5674
|
if (Le.useEffect(() => {
|
|
5659
5675
|
if (typeof window > "u") return;
|
|
5660
5676
|
const v = () => {
|
|
@@ -5664,7 +5680,7 @@ const Ls = [
|
|
|
5664
5680
|
}, []), !t) return null;
|
|
5665
5681
|
const z = (v) => {
|
|
5666
5682
|
const { name: D, value: B } = v.target;
|
|
5667
|
-
|
|
5683
|
+
c((F) => ({ ...F, [D]: B })), b[D] && y((F) => ({ ...F, [D]: "" }));
|
|
5668
5684
|
}, C = (v) => {
|
|
5669
5685
|
m((D) => ({ ...D, [v]: !D[v] }));
|
|
5670
5686
|
}, q = () => {
|
|
@@ -5672,7 +5688,7 @@ const Ls = [
|
|
|
5672
5688
|
return d.currentPassword || (v.currentPassword = "Current password is required"), d.newPassword ? d.newPassword.length < 6 && (v.newPassword = "Password must be at least 6 characters") : v.newPassword = "New password is required", d.newPassword !== d.confirmPassword && (v.confirmPassword = "Passwords do not match"), y(v), Object.keys(v).length === 0;
|
|
5673
5689
|
}, g = async (v) => {
|
|
5674
5690
|
if (v.preventDefault(), !!q()) {
|
|
5675
|
-
|
|
5691
|
+
u(!0);
|
|
5676
5692
|
try {
|
|
5677
5693
|
const { data: D } = await M.put(
|
|
5678
5694
|
`${o}/users/change-password/${a}`,
|
|
@@ -5687,7 +5703,7 @@ const Ls = [
|
|
|
5687
5703
|
}
|
|
5688
5704
|
}
|
|
5689
5705
|
);
|
|
5690
|
-
D.success ? (r(D.message || "Password updated successfully"),
|
|
5706
|
+
D.success ? (r(D.message || "Password updated successfully"), c({
|
|
5691
5707
|
currentPassword: "",
|
|
5692
5708
|
newPassword: "",
|
|
5693
5709
|
confirmPassword: ""
|
|
@@ -5695,7 +5711,7 @@ const Ls = [
|
|
|
5695
5711
|
} catch (D) {
|
|
5696
5712
|
s(D.response?.data?.message || "Something went wrong");
|
|
5697
5713
|
} finally {
|
|
5698
|
-
|
|
5714
|
+
u(!1);
|
|
5699
5715
|
}
|
|
5700
5716
|
}
|
|
5701
5717
|
}, R = [
|
|
@@ -6094,7 +6110,7 @@ const Ls = [
|
|
|
6094
6110
|
verifying: l,
|
|
6095
6111
|
user: h,
|
|
6096
6112
|
colors: d,
|
|
6097
|
-
darkMode:
|
|
6113
|
+
darkMode: c
|
|
6098
6114
|
}) => {
|
|
6099
6115
|
if (!t) return null;
|
|
6100
6116
|
const b = () => {
|
|
@@ -6105,7 +6121,7 @@ const Ls = [
|
|
|
6105
6121
|
{
|
|
6106
6122
|
className: "modal-overlay",
|
|
6107
6123
|
style: {
|
|
6108
|
-
backgroundColor:
|
|
6124
|
+
backgroundColor: c ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.5)"
|
|
6109
6125
|
},
|
|
6110
6126
|
children: [
|
|
6111
6127
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -6264,7 +6280,7 @@ const Ls = [
|
|
|
6264
6280
|
}
|
|
6265
6281
|
|
|
6266
6282
|
.close-btn:hover {
|
|
6267
|
-
background-color: ${
|
|
6283
|
+
background-color: ${c ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"};
|
|
6268
6284
|
}
|
|
6269
6285
|
|
|
6270
6286
|
.verify-form {
|
|
@@ -6375,11 +6391,11 @@ const Ls = [
|
|
|
6375
6391
|
onVerify: i,
|
|
6376
6392
|
primaryColor: o = "#00C212"
|
|
6377
6393
|
}) => {
|
|
6378
|
-
const { baseUrl: l, apiKey: h, appId: d } = ge(), [
|
|
6394
|
+
const { baseUrl: l, apiKey: h, appId: d } = ge(), [c, b] = P(null), [y, w] = P(e), [u, j] = P(!0), [m, $] = P(!1), [I, z] = P(!1), [C, q] = P(!1), [g, R] = P(!1), [v, D] = P(!1), [B, F] = P(!1), [V, Z] = P(!1), [T, J] = P(!1), [A, O] = P(null), [K, Q] = P(!1), [G, f] = P({
|
|
6379
6395
|
email: "",
|
|
6380
6396
|
otp: "",
|
|
6381
6397
|
appId: d
|
|
6382
|
-
}), [S, x] =
|
|
6398
|
+
}), [S, x] = P(!1), [k, _] = P(!1);
|
|
6383
6399
|
te(() => {
|
|
6384
6400
|
if (typeof window < "u") {
|
|
6385
6401
|
const E = () => b(window.innerWidth);
|
|
@@ -6387,7 +6403,7 @@ const Ls = [
|
|
|
6387
6403
|
}
|
|
6388
6404
|
}, []);
|
|
6389
6405
|
const N = (E, H) => {
|
|
6390
|
-
|
|
6406
|
+
O({ type: E, message: H }), setTimeout(() => O(null), 3e3);
|
|
6391
6407
|
}, Y = () => {
|
|
6392
6408
|
J(!0);
|
|
6393
6409
|
const E = setTimeout(() => {
|
|
@@ -6547,7 +6563,7 @@ const Ls = [
|
|
|
6547
6563
|
border: "#e4e4e7",
|
|
6548
6564
|
warning: "#d97706"
|
|
6549
6565
|
};
|
|
6550
|
-
if (
|
|
6566
|
+
if (u)
|
|
6551
6567
|
return /* @__PURE__ */ n.jsx(
|
|
6552
6568
|
"div",
|
|
6553
6569
|
{
|
|
@@ -6715,14 +6731,14 @@ const Ls = [
|
|
|
6715
6731
|
display: "grid",
|
|
6716
6732
|
gap: "24px",
|
|
6717
6733
|
gridTemplateColumns: "1fr",
|
|
6718
|
-
...
|
|
6734
|
+
...c && window.innerWidth >= 1024 && {
|
|
6719
6735
|
gridTemplateColumns: "1fr 2fr",
|
|
6720
6736
|
gap: "10px"
|
|
6721
6737
|
},
|
|
6722
|
-
...
|
|
6738
|
+
...c && window.innerWidth >= 768 && c && window.innerWidth < 1024 && {
|
|
6723
6739
|
gap: "10px"
|
|
6724
6740
|
},
|
|
6725
|
-
...
|
|
6741
|
+
...c && window.innerWidth >= 600 && c && window.innerWidth < 768 && {
|
|
6726
6742
|
gap: "28px"
|
|
6727
6743
|
}
|
|
6728
6744
|
},
|
|
@@ -6907,7 +6923,7 @@ const Ls = [
|
|
|
6907
6923
|
gap: "8px",
|
|
6908
6924
|
textDecoration: "none",
|
|
6909
6925
|
minHeight: "36px",
|
|
6910
|
-
flex:
|
|
6926
|
+
flex: c && window.innerWidth < 1024 ? "1" : "auto"
|
|
6911
6927
|
},
|
|
6912
6928
|
children: [
|
|
6913
6929
|
/* @__PURE__ */ n.jsx(Pe, { size: 16, "aria-hidden": "true" }),
|
|
@@ -6937,7 +6953,7 @@ const Ls = [
|
|
|
6937
6953
|
gap: "8px",
|
|
6938
6954
|
textDecoration: "none",
|
|
6939
6955
|
minHeight: "36px",
|
|
6940
|
-
flex:
|
|
6956
|
+
flex: c && window.innerWidth < 1024 ? "1" : "auto"
|
|
6941
6957
|
},
|
|
6942
6958
|
children: [
|
|
6943
6959
|
I ? /* @__PURE__ */ n.jsx(
|
|
@@ -6973,7 +6989,7 @@ const Ls = [
|
|
|
6973
6989
|
gap: "8px",
|
|
6974
6990
|
textDecoration: "none",
|
|
6975
6991
|
minHeight: "36px",
|
|
6976
|
-
flex:
|
|
6992
|
+
flex: c && window.innerWidth < 1024 ? "1" : "auto"
|
|
6977
6993
|
},
|
|
6978
6994
|
children: [
|
|
6979
6995
|
/* @__PURE__ */ n.jsx(Es, { size: 16, "aria-hidden": "true" }),
|
|
@@ -7003,7 +7019,7 @@ const Ls = [
|
|
|
7003
7019
|
gap: "8px",
|
|
7004
7020
|
minHeight: "36px",
|
|
7005
7021
|
opacity: K ? 0.7 : 1,
|
|
7006
|
-
flex:
|
|
7022
|
+
flex: c && window.innerWidth < 1024 ? "1" : "auto"
|
|
7007
7023
|
},
|
|
7008
7024
|
children: [
|
|
7009
7025
|
K ? /* @__PURE__ */ n.jsx(
|
|
@@ -7213,7 +7229,7 @@ const Ls = [
|
|
|
7213
7229
|
display: "grid",
|
|
7214
7230
|
gap: "20px",
|
|
7215
7231
|
gridTemplateColumns: "1fr",
|
|
7216
|
-
...
|
|
7232
|
+
...c && window.innerWidth >= 600 && {
|
|
7217
7233
|
gridTemplateColumns: "1fr 1fr",
|
|
7218
7234
|
gap: "20px"
|
|
7219
7235
|
}
|
|
@@ -7592,14 +7608,14 @@ const Ls = [
|
|
|
7592
7608
|
// Menu item visibility with defaults
|
|
7593
7609
|
showProfileMenuItem: h = !0,
|
|
7594
7610
|
showSettingsMenuItem: d = !0,
|
|
7595
|
-
showViewProfileMenuItem:
|
|
7611
|
+
showViewProfileMenuItem: c = !0,
|
|
7596
7612
|
// Custom labels with defaults
|
|
7597
7613
|
profileLabel: b = "My Profile",
|
|
7598
7614
|
settingsLabel: y = "Settings",
|
|
7599
7615
|
viewProfileLabel: w = "View Profile",
|
|
7600
|
-
logoutLabel:
|
|
7616
|
+
logoutLabel: u = "Sign Out"
|
|
7601
7617
|
}) => {
|
|
7602
|
-
const { baseUrl: j, apiKey: m, appId: $ } = ge(), [I, z] =
|
|
7618
|
+
const { baseUrl: j, apiKey: m, appId: $ } = ge(), [I, z] = P(!1), [C, q] = P(null), [g, R] = P(!0), [v, D] = P(null), B = xt(null), F = xt(null), [V, Z] = P(!1), [T, J] = P(!1);
|
|
7603
7619
|
te(() => {
|
|
7604
7620
|
if (typeof window > "u") return;
|
|
7605
7621
|
const x = () => {
|
|
@@ -7679,7 +7695,7 @@ const Ls = [
|
|
|
7679
7695
|
accent: e,
|
|
7680
7696
|
accentHover: `${e}e6`,
|
|
7681
7697
|
error: "#ef4444"
|
|
7682
|
-
},
|
|
7698
|
+
}, O = {
|
|
7683
7699
|
wrapper: {
|
|
7684
7700
|
position: "relative",
|
|
7685
7701
|
display: "inline-block"
|
|
@@ -7895,7 +7911,7 @@ const Ls = [
|
|
|
7895
7911
|
return /* @__PURE__ */ n.jsxs(
|
|
7896
7912
|
"div",
|
|
7897
7913
|
{
|
|
7898
|
-
style:
|
|
7914
|
+
style: O.wrapper,
|
|
7899
7915
|
ref: B,
|
|
7900
7916
|
className: i,
|
|
7901
7917
|
role: "menu",
|
|
@@ -7956,7 +7972,7 @@ const Ls = [
|
|
|
7956
7972
|
"div",
|
|
7957
7973
|
{
|
|
7958
7974
|
ref: F,
|
|
7959
|
-
style:
|
|
7975
|
+
style: O.avatarButton,
|
|
7960
7976
|
onClick: () => z((x) => !x),
|
|
7961
7977
|
onKeyDown: (x) => Q(x, () => z((k) => !k)),
|
|
7962
7978
|
tabIndex: 0,
|
|
@@ -7979,7 +7995,7 @@ const Ls = [
|
|
|
7979
7995
|
{
|
|
7980
7996
|
src: C.avatarUrl,
|
|
7981
7997
|
alt: `${C.name}'s avatar`,
|
|
7982
|
-
style:
|
|
7998
|
+
style: O.avatarImage,
|
|
7983
7999
|
loading: "lazy",
|
|
7984
8000
|
onError: (x) => {
|
|
7985
8001
|
const k = x.target;
|
|
@@ -7991,33 +8007,33 @@ const Ls = [
|
|
|
7991
8007
|
{
|
|
7992
8008
|
src: "https://api.dicebear.com/9.x/glass/svg?seed=Kingston",
|
|
7993
8009
|
alt: "Default user avatar",
|
|
7994
|
-
style:
|
|
8010
|
+
style: O.avatarImage,
|
|
7995
8011
|
loading: "lazy"
|
|
7996
8012
|
}
|
|
7997
8013
|
),
|
|
7998
|
-
!T && /* @__PURE__ */ n.jsxs("div", { style:
|
|
7999
|
-
/* @__PURE__ */ n.jsx("div", { style:
|
|
8000
|
-
C?.email && /* @__PURE__ */ n.jsx("div", { style:
|
|
8014
|
+
!T && /* @__PURE__ */ n.jsxs("div", { style: O.userInfo, children: [
|
|
8015
|
+
/* @__PURE__ */ n.jsx("div", { style: O.userName, title: C?.name, children: C?.name || "Guest" }),
|
|
8016
|
+
C?.email && /* @__PURE__ */ n.jsx("div", { style: O.userEmail, title: C.email, children: C.email })
|
|
8001
8017
|
] }),
|
|
8002
8018
|
/* @__PURE__ */ n.jsx(
|
|
8003
8019
|
Qn,
|
|
8004
8020
|
{
|
|
8005
8021
|
size: T ? 14 : 16,
|
|
8006
|
-
style:
|
|
8022
|
+
style: O.chevron,
|
|
8007
8023
|
"aria-hidden": "true"
|
|
8008
8024
|
}
|
|
8009
8025
|
)
|
|
8010
8026
|
]
|
|
8011
8027
|
}
|
|
8012
8028
|
),
|
|
8013
|
-
I && /* @__PURE__ */ n.jsx("div", { style:
|
|
8014
|
-
/* @__PURE__ */ n.jsxs("div", { style:
|
|
8029
|
+
I && /* @__PURE__ */ n.jsx("div", { style: O.dropdown, role: "menu", "aria-label": "User options", children: g ? /* @__PURE__ */ n.jsx("div", { style: O.loadingText, role: "status", "aria-live": "polite", children: "Loading user information..." }) : C ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
8030
|
+
/* @__PURE__ */ n.jsxs("div", { style: O.userSection, children: [
|
|
8015
8031
|
C?.avatarUrl ? /* @__PURE__ */ n.jsx(
|
|
8016
8032
|
"img",
|
|
8017
8033
|
{
|
|
8018
8034
|
src: C.avatarUrl,
|
|
8019
8035
|
alt: `${C.name}'s profile picture`,
|
|
8020
|
-
style:
|
|
8036
|
+
style: O.dropdownAvatar,
|
|
8021
8037
|
loading: "lazy",
|
|
8022
8038
|
onError: (x) => {
|
|
8023
8039
|
const k = x.target;
|
|
@@ -8029,20 +8045,20 @@ const Ls = [
|
|
|
8029
8045
|
{
|
|
8030
8046
|
src: `https://api.dicebear.com/9.x/initials/svg?seed=${C.name}`,
|
|
8031
8047
|
alt: `${C.name}'s default avatar`,
|
|
8032
|
-
style:
|
|
8048
|
+
style: O.dropdownAvatar,
|
|
8033
8049
|
loading: "lazy"
|
|
8034
8050
|
}
|
|
8035
8051
|
),
|
|
8036
|
-
/* @__PURE__ */ n.jsxs("div", { style:
|
|
8037
|
-
/* @__PURE__ */ n.jsx("div", { style:
|
|
8038
|
-
/* @__PURE__ */ n.jsx("div", { style:
|
|
8052
|
+
/* @__PURE__ */ n.jsxs("div", { style: O.dropdownUserInfo, children: [
|
|
8053
|
+
/* @__PURE__ */ n.jsx("div", { style: O.dropdownUserName, title: C.name, children: C.name }),
|
|
8054
|
+
/* @__PURE__ */ n.jsx("div", { style: O.dropdownUserEmail, title: C.email, children: C.email })
|
|
8039
8055
|
] })
|
|
8040
8056
|
] }),
|
|
8041
|
-
/* @__PURE__ */ n.jsxs("div", { style:
|
|
8057
|
+
/* @__PURE__ */ n.jsxs("div", { style: O.dropdownSection, children: [
|
|
8042
8058
|
h && G() && /* @__PURE__ */ n.jsxs(
|
|
8043
8059
|
"button",
|
|
8044
8060
|
{
|
|
8045
|
-
style:
|
|
8061
|
+
style: O.menuItem,
|
|
8046
8062
|
onClick: f,
|
|
8047
8063
|
onMouseOver: (x) => {
|
|
8048
8064
|
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
@@ -8054,15 +8070,15 @@ const Ls = [
|
|
|
8054
8070
|
role: "menuitem",
|
|
8055
8071
|
tabIndex: 0,
|
|
8056
8072
|
children: [
|
|
8057
|
-
/* @__PURE__ */ n.jsx(be, { style:
|
|
8058
|
-
/* @__PURE__ */ n.jsx("span", { style:
|
|
8073
|
+
/* @__PURE__ */ n.jsx(be, { style: O.icon, "aria-hidden": "true" }),
|
|
8074
|
+
/* @__PURE__ */ n.jsx("span", { style: O.menuItemText, children: b })
|
|
8059
8075
|
]
|
|
8060
8076
|
}
|
|
8061
8077
|
),
|
|
8062
8078
|
d && l && /* @__PURE__ */ n.jsxs(
|
|
8063
8079
|
"button",
|
|
8064
8080
|
{
|
|
8065
|
-
style:
|
|
8081
|
+
style: O.menuItem,
|
|
8066
8082
|
onClick: S,
|
|
8067
8083
|
onMouseOver: (x) => {
|
|
8068
8084
|
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
@@ -8074,18 +8090,18 @@ const Ls = [
|
|
|
8074
8090
|
role: "menuitem",
|
|
8075
8091
|
tabIndex: 0,
|
|
8076
8092
|
children: [
|
|
8077
|
-
/* @__PURE__ */ n.jsx(As, { style:
|
|
8078
|
-
/* @__PURE__ */ n.jsx("span", { style:
|
|
8093
|
+
/* @__PURE__ */ n.jsx(As, { style: O.icon, "aria-hidden": "true" }),
|
|
8094
|
+
/* @__PURE__ */ n.jsx("span", { style: O.menuItemText, children: y })
|
|
8079
8095
|
]
|
|
8080
8096
|
}
|
|
8081
8097
|
),
|
|
8082
|
-
|
|
8098
|
+
c && C.profileUrl && /* @__PURE__ */ n.jsxs(
|
|
8083
8099
|
"a",
|
|
8084
8100
|
{
|
|
8085
8101
|
href: C.profileUrl,
|
|
8086
8102
|
target: "_self",
|
|
8087
8103
|
rel: "noopener noreferrer",
|
|
8088
|
-
style:
|
|
8104
|
+
style: O.menuItem,
|
|
8089
8105
|
onMouseOver: (x) => {
|
|
8090
8106
|
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
8091
8107
|
},
|
|
@@ -8095,16 +8111,16 @@ const Ls = [
|
|
|
8095
8111
|
role: "menuitem",
|
|
8096
8112
|
tabIndex: 0,
|
|
8097
8113
|
children: [
|
|
8098
|
-
/* @__PURE__ */ n.jsx(ce, { style:
|
|
8099
|
-
/* @__PURE__ */ n.jsx("span", { style:
|
|
8114
|
+
/* @__PURE__ */ n.jsx(ce, { style: O.icon, "aria-hidden": "true" }),
|
|
8115
|
+
/* @__PURE__ */ n.jsx("span", { style: O.menuItemText, children: w })
|
|
8100
8116
|
]
|
|
8101
8117
|
}
|
|
8102
8118
|
)
|
|
8103
8119
|
] }),
|
|
8104
|
-
/* @__PURE__ */ n.jsx("div", { style:
|
|
8120
|
+
/* @__PURE__ */ n.jsx("div", { style: O.dropdownSection, children: /* @__PURE__ */ n.jsxs(
|
|
8105
8121
|
"button",
|
|
8106
8122
|
{
|
|
8107
|
-
style:
|
|
8123
|
+
style: O.logoutButton,
|
|
8108
8124
|
onClick: r,
|
|
8109
8125
|
onMouseOver: (x) => {
|
|
8110
8126
|
x.currentTarget.style.backgroundColor = A.surfaceHover;
|
|
@@ -8119,15 +8135,15 @@ const Ls = [
|
|
|
8119
8135
|
/* @__PURE__ */ n.jsx(
|
|
8120
8136
|
ct,
|
|
8121
8137
|
{
|
|
8122
|
-
style: { ...
|
|
8138
|
+
style: { ...O.icon, color: A.error },
|
|
8123
8139
|
"aria-hidden": "true"
|
|
8124
8140
|
}
|
|
8125
8141
|
),
|
|
8126
|
-
/* @__PURE__ */ n.jsx("span", { style:
|
|
8142
|
+
/* @__PURE__ */ n.jsx("span", { style: O.menuItemText, children: u })
|
|
8127
8143
|
]
|
|
8128
8144
|
}
|
|
8129
8145
|
) })
|
|
8130
|
-
] }) : /* @__PURE__ */ n.jsxs("div", { style:
|
|
8146
|
+
] }) : /* @__PURE__ */ n.jsxs("div", { style: O.errorState, role: "alert", children: [
|
|
8131
8147
|
/* @__PURE__ */ n.jsxs(
|
|
8132
8148
|
"div",
|
|
8133
8149
|
{
|
|
@@ -8141,7 +8157,7 @@ const Ls = [
|
|
|
8141
8157
|
v && v !== "Not signed in" && /* @__PURE__ */ n.jsx(
|
|
8142
8158
|
"button",
|
|
8143
8159
|
{
|
|
8144
|
-
style:
|
|
8160
|
+
style: O.retryButton,
|
|
8145
8161
|
onClick: K,
|
|
8146
8162
|
onMouseOver: (x) => {
|
|
8147
8163
|
x.currentTarget.style.backgroundColor = A.accentHover;
|
|
@@ -8162,11 +8178,11 @@ const Ls = [
|
|
|
8162
8178
|
primaryColor: r = "#00C212",
|
|
8163
8179
|
onVerify: s
|
|
8164
8180
|
}) => {
|
|
8165
|
-
const { appId: a, baseUrl: i, apiKey: o } = ge(), [l, h] =
|
|
8181
|
+
const { appId: a, baseUrl: i, apiKey: o } = ge(), [l, h] = P({
|
|
8166
8182
|
email: t?.email || "",
|
|
8167
8183
|
otp: "",
|
|
8168
8184
|
appId: a
|
|
8169
|
-
}), [d,
|
|
8185
|
+
}), [d, c] = P(!1), [b, y] = P(!1), [w, u] = P(null), j = (g, R) => {
|
|
8170
8186
|
let v = parseInt(g.replace("#", ""), 16), D = (v >> 16) + R, B = (v >> 8 & 255) + R, F = (v & 255) + R;
|
|
8171
8187
|
return D = Math.min(255, Math.max(0, D)), B = Math.min(255, Math.max(0, B)), F = Math.min(255, Math.max(0, F)), `#${(F | B << 8 | D << 16).toString(16).padStart(6, "0")}`;
|
|
8172
8188
|
}, m = e ? {
|
|
@@ -8196,7 +8212,7 @@ const Ls = [
|
|
|
8196
8212
|
t?.email && h((g) => ({ ...g, email: t.email }));
|
|
8197
8213
|
}, [t?.email]);
|
|
8198
8214
|
const $ = (g, R) => {
|
|
8199
|
-
|
|
8215
|
+
u({ type: g, message: R }), setTimeout(() => u(null), 3e3);
|
|
8200
8216
|
}, I = async () => {
|
|
8201
8217
|
if (!l.email || !/\S+@\S+\.\S+/.test(l.email)) {
|
|
8202
8218
|
$("error", "Please enter a valid email");
|
|
@@ -8209,7 +8225,7 @@ const Ls = [
|
|
|
8209
8225
|
{ email: l.email },
|
|
8210
8226
|
{ headers: { "x-api-key": o, "x-app-id": a } }
|
|
8211
8227
|
);
|
|
8212
|
-
g.data.success ? ($("success", g.data.message || "OTP sent!"),
|
|
8228
|
+
g.data.success ? ($("success", g.data.message || "OTP sent!"), c(!0)) : $("error", g.data.message || "Failed to send OTP");
|
|
8213
8229
|
} catch (g) {
|
|
8214
8230
|
$("error", g.response?.data?.message || "Server error");
|
|
8215
8231
|
} finally {
|
|
@@ -8225,7 +8241,7 @@ const Ls = [
|
|
|
8225
8241
|
const R = await M.post(`${i}/users/verify-email`, l);
|
|
8226
8242
|
if (R.data.success && t) {
|
|
8227
8243
|
const v = { ...t, isVerified: !0 };
|
|
8228
|
-
s?.(v), $("success", R.data.message || "Email verified!"),
|
|
8244
|
+
s?.(v), $("success", R.data.message || "Email verified!"), c(!1), h({ email: t.email, otp: "", appId: a });
|
|
8229
8245
|
} else
|
|
8230
8246
|
$("error", R.data.message || "Verification failed");
|
|
8231
8247
|
} catch (R) {
|