@yourgoods/ui-smart 0.31.0 → 0.32.0
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/{ProfileEmailDialog-eu5X-GFo.js → ProfileEmailDialog-BCBd_O2U.js} +271 -279
- package/dist/{ProfilePasswordDialog-C4IbTcxc.js → ProfilePasswordDialog-BceSLpxy.js} +1 -1
- package/dist/{ProfilePhoneDialog-W_8Fz3wA.js → ProfilePhoneDialog-6A8CraBl.js} +289 -297
- package/dist/{index-Cw7l0kGP.js → index-D8GpZOPw.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast-BgatZ5Cx.js → useRateLimitToast-DGG5L4f3.js} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as te, ref as b, reactive as Q, watch as Y, computed as M, toRefs as
|
|
2
|
-
import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-
|
|
3
|
-
import { C as
|
|
4
|
-
import { PInput as J, IconMailMd as me, PButton as
|
|
1
|
+
import { defineComponent as te, ref as b, reactive as Q, watch as Y, computed as M, toRefs as re, createElementBlock as k, openBlock as w, createElementVNode as S, createCommentVNode as N, toDisplayString as X, createVNode as $, unref as u, isRef as Z, withCtx as G, createTextVNode as oe, Fragment as Oe, createBlock as H, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
|
|
2
|
+
import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-DGG5L4f3.js";
|
|
3
|
+
import { C as F, _ as ze, B as We, p as W, g as He } from "./index-D8GpZOPw.js";
|
|
4
|
+
import { PInput as J, IconMailMd as me, PButton as ie, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as _e, PTopBar as qe, IconCrossMd as je } from "@profeat/ui-kit";
|
|
5
5
|
const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dialogDefaultContainerTextHint" }, Je = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "input-wrapper"
|
|
@@ -27,127 +27,123 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
27
27
|
},
|
|
28
28
|
emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
|
|
29
29
|
setup(_, { emit: R }) {
|
|
30
|
-
const v = _, s = R, m = b(!1), e = b(""),
|
|
30
|
+
const v = _, s = R, m = b(!1), e = b(""), i = Q({
|
|
31
31
|
emailModel: v.email || "",
|
|
32
32
|
codeModel: "",
|
|
33
33
|
touched: { email: !1, code: !1 }
|
|
34
34
|
});
|
|
35
35
|
Y(
|
|
36
|
-
() =>
|
|
36
|
+
() => i.emailModel,
|
|
37
37
|
(p) => {
|
|
38
38
|
s("update:email", p);
|
|
39
39
|
}
|
|
40
40
|
), Y(
|
|
41
|
-
() =>
|
|
41
|
+
() => i.codeModel,
|
|
42
42
|
(p) => s("update:code", p)
|
|
43
43
|
);
|
|
44
44
|
const y = (p) => {
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
e.value = "",
|
|
48
|
-
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
49
|
-
var p;
|
|
45
|
+
i.touched[p] = !0;
|
|
46
|
+
}, d = (p) => i.touched[p] = !1, r = () => {
|
|
47
|
+
e.value = "", d("email");
|
|
48
|
+
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), O = M(() => !V.value || !!e.value), B = async () => {
|
|
49
|
+
var p, a;
|
|
50
50
|
try {
|
|
51
51
|
if (y("email"), !V.value) {
|
|
52
52
|
e.value = "Это не похоже на e-mail";
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
if (!(((p =
|
|
55
|
+
const n = await Ve(i.emailModel), { data: f } = n.data;
|
|
56
|
+
if (!(((a = (p = f == null ? void 0 : f.data) == null ? void 0 : p[0]) == null ? void 0 : a.available) ?? !1)) {
|
|
57
57
|
e.value = "Такой email уже используется";
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
if (checkEmailFormatError(l)) {
|
|
61
|
-
e.value = "Это не похоже на e-mail";
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
60
|
e.value = "", s("on-send-code", {
|
|
65
|
-
email:
|
|
61
|
+
email: i.emailModel,
|
|
66
62
|
prevEmail: v.oldEmail,
|
|
67
63
|
offLoading: !0
|
|
68
64
|
}), m.value = !0;
|
|
69
|
-
} catch (
|
|
70
|
-
console.error("Неизвестная ошибка при проверке доступности email:",
|
|
65
|
+
} catch (n) {
|
|
66
|
+
console.error("Неизвестная ошибка при проверке доступности email:", n), e.value = "Это не похоже на e-mail";
|
|
71
67
|
}
|
|
72
68
|
};
|
|
73
|
-
let
|
|
69
|
+
let U = "";
|
|
74
70
|
const C = (p) => {
|
|
75
71
|
s("on-clear-code-error");
|
|
76
|
-
const
|
|
77
|
-
let
|
|
78
|
-
|
|
72
|
+
const a = p.target;
|
|
73
|
+
let n = a.value.replace(/\D/g, "");
|
|
74
|
+
n.length > 4 && (n = n.slice(0, 4)), a.value = n, i.codeModel = n, n.length === 4 && n !== U && (U = n, s("on-match-code", { email: i.emailModel, code: n }));
|
|
79
75
|
}, c = () => {
|
|
80
|
-
s("on-send-code-again", { email:
|
|
76
|
+
s("on-send-code-again", { email: i.emailModel });
|
|
81
77
|
}, T = M(() => {
|
|
82
78
|
if (e.value) return e.value;
|
|
83
|
-
if (
|
|
84
|
-
if (!
|
|
79
|
+
if (i.touched.email) {
|
|
80
|
+
if (!i.emailModel.trim()) return "Введите e-mail";
|
|
85
81
|
if (!V.value) return "Это не похоже на e-mail";
|
|
86
82
|
}
|
|
87
83
|
return v.emailError || "";
|
|
88
|
-
}), g = M(() => v.isNotMatchCode ? "Неверный код" :
|
|
89
|
-
return (p,
|
|
90
|
-
const
|
|
91
|
-
return w(),
|
|
84
|
+
}), g = M(() => v.isNotMatchCode ? "Неверный код" : i.touched.code ? A.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: L, codeModel: A } = re(i);
|
|
85
|
+
return (p, a) => {
|
|
86
|
+
const n = ue;
|
|
87
|
+
return w(), k("div", Ge, [
|
|
92
88
|
S("div", Ye, X(m.value ? "Введите код подтверждения" : p.hintText), 1),
|
|
93
|
-
p.showEmail ? (w(),
|
|
94
|
-
|
|
89
|
+
p.showEmail ? (w(), k("div", Je, [
|
|
90
|
+
$(u(J), {
|
|
95
91
|
modelValue: u(L),
|
|
96
|
-
"onUpdate:modelValue":
|
|
92
|
+
"onUpdate:modelValue": a[0] || (a[0] = (f) => Z(L) ? L.value = f : null),
|
|
97
93
|
size: "large",
|
|
98
94
|
"text-size": "medium",
|
|
99
95
|
label: "Почта",
|
|
100
96
|
type: "email",
|
|
101
97
|
error: T.value,
|
|
102
|
-
onBlur:
|
|
103
|
-
onInput:
|
|
98
|
+
onBlur: a[1] || (a[1] = (f) => y("email")),
|
|
99
|
+
onInput: r
|
|
104
100
|
}, null, 8, ["modelValue", "error"]),
|
|
105
|
-
|
|
101
|
+
$(u(me), {
|
|
106
102
|
class: "icon-locked",
|
|
107
|
-
onClick:
|
|
103
|
+
onClick: a[2] || (a[2] = (f) => p.$emit("edit", "email"))
|
|
108
104
|
})
|
|
109
|
-
])) :
|
|
110
|
-
m.value ?
|
|
111
|
-
|
|
105
|
+
])) : N("", !0),
|
|
106
|
+
m.value ? N("", !0) : (w(), k("div", Ke, [
|
|
107
|
+
$(u(ie), {
|
|
112
108
|
style: { width: "100%" },
|
|
113
|
-
disabled:
|
|
109
|
+
disabled: O.value,
|
|
114
110
|
onClick: B
|
|
115
111
|
}, {
|
|
116
|
-
default: G(() =>
|
|
117
|
-
|
|
112
|
+
default: G(() => a[5] || (a[5] = [
|
|
113
|
+
oe(" Отправить код ")
|
|
118
114
|
])),
|
|
119
115
|
_: 1,
|
|
120
116
|
__: [5]
|
|
121
117
|
}, 8, ["disabled"])
|
|
122
118
|
])),
|
|
123
|
-
m.value ? (w(),
|
|
124
|
-
|
|
125
|
-
modelValue: u(
|
|
126
|
-
"onUpdate:modelValue":
|
|
119
|
+
m.value ? (w(), k("div", Qe, [
|
|
120
|
+
$(u(J), {
|
|
121
|
+
modelValue: u(A),
|
|
122
|
+
"onUpdate:modelValue": a[3] || (a[3] = (f) => Z(A) ? A.value = f : null),
|
|
127
123
|
size: "large",
|
|
128
124
|
"text-size": "medium",
|
|
129
125
|
label: "Код",
|
|
130
126
|
type: "text",
|
|
131
127
|
error: g.value,
|
|
132
128
|
onInput: C,
|
|
133
|
-
onBlur:
|
|
129
|
+
onBlur: a[4] || (a[4] = (f) => y("code"))
|
|
134
130
|
}, null, 8, ["modelValue", "error"])
|
|
135
|
-
])) :
|
|
136
|
-
!p.loading && m.value ? (w(),
|
|
137
|
-
|
|
131
|
+
])) : N("", !0),
|
|
132
|
+
!p.loading && m.value ? (w(), k("div", Xe, [
|
|
133
|
+
$(n, {
|
|
138
134
|
loading: p.loading,
|
|
139
135
|
"rate-limit-text": p.rateLimitText,
|
|
140
136
|
"is-final-limit": p.isFinalLimit,
|
|
141
137
|
"on-send-again": c
|
|
142
138
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
143
|
-
])) :
|
|
139
|
+
])) : N("", !0)
|
|
144
140
|
]);
|
|
145
141
|
};
|
|
146
142
|
}
|
|
147
|
-
}), et = { class: "dialogDefaultContainer" }, tt = { class: "dialogDefaultContainerInsideContent" },
|
|
143
|
+
}), et = { class: "dialogDefaultContainer" }, tt = { class: "dialogDefaultContainerInsideContent" }, at = { class: "input-wrapper" }, lt = { class: "input-wrapper" }, ot = { style: { width: "100%", display: "flex" } }, it = {
|
|
148
144
|
key: 0,
|
|
149
145
|
class: "dialogDefaultContainer"
|
|
150
|
-
}, nt = { class: "dialogDefaultContainerInsideContent" }, st = { style: { "margin-top": "12px" } }, Te = 8,
|
|
146
|
+
}, nt = { class: "dialogDefaultContainerInsideContent" }, st = { style: { "margin-top": "12px" } }, Te = 8, dt = /* @__PURE__ */ te({
|
|
151
147
|
__name: "AddNewPasswordContent",
|
|
152
148
|
props: {
|
|
153
149
|
modelValue: { type: Boolean },
|
|
@@ -157,64 +153,64 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
157
153
|
},
|
|
158
154
|
emits: ["update:modelValue", "submit", "close", "update-user"],
|
|
159
155
|
setup(_, { emit: R }) {
|
|
160
|
-
const v = R, s = b(!1), m = b(""), e = b(""),
|
|
156
|
+
const v = R, s = b(!1), m = b(""), e = b(""), i = Q({
|
|
161
157
|
newPassword: !1,
|
|
162
158
|
newPasswordConfirm: !1
|
|
163
|
-
}), y = b(
|
|
164
|
-
r.value = !r.value;
|
|
165
|
-
}, O = () => {
|
|
159
|
+
}), y = b(F.NEW), d = b(!1), r = b(!1), V = M(() => d.value ? "text" : "password"), O = M(() => r.value ? "text" : "password"), B = () => {
|
|
166
160
|
d.value = !d.value;
|
|
167
|
-
},
|
|
161
|
+
}, U = () => {
|
|
162
|
+
r.value = !r.value;
|
|
163
|
+
}, C = M(() => i.newPassword ? m.value.trim() ? m.value.trim().length < Te ? `Пароль слишком короткий. Введите хотя бы ${Te} символов` : "" : "Введите пароль" : ""), c = M(() => i.newPasswordConfirm ? e.value.trim() ? e.value !== m.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), T = M(() => !!(C.value || c.value)), g = M(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : T.value), L = () => {
|
|
168
164
|
v("update:modelValue", !1), v("close");
|
|
169
|
-
},
|
|
165
|
+
}, A = async () => {
|
|
170
166
|
v("update-user", m.value);
|
|
171
167
|
};
|
|
172
|
-
return (p,
|
|
168
|
+
return (p, a) => (w(), k(Oe, null, [
|
|
173
169
|
S("div", et, [
|
|
174
170
|
S("div", tt, [
|
|
175
|
-
|
|
176
|
-
S("div",
|
|
177
|
-
|
|
171
|
+
a[7] || (a[7] = S("div", { class: "dialogDefaultContainerTextHint" }, X("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
|
|
172
|
+
S("div", at, [
|
|
173
|
+
$(u(J), {
|
|
178
174
|
modelValue: m.value,
|
|
179
|
-
"onUpdate:modelValue":
|
|
175
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => m.value = n),
|
|
180
176
|
size: "large",
|
|
181
177
|
"text-size": "medium",
|
|
182
178
|
label: "Новый пароль",
|
|
183
179
|
type: V.value,
|
|
184
180
|
error: C.value,
|
|
185
|
-
onBlur:
|
|
186
|
-
onInput:
|
|
181
|
+
onBlur: a[1] || (a[1] = () => i.newPassword = !0),
|
|
182
|
+
onInput: a[2] || (a[2] = () => i.newPassword = !0)
|
|
187
183
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
188
|
-
(w(), H(Ce(
|
|
184
|
+
(w(), H(Ce(d.value ? u(ge) : u(he)), {
|
|
189
185
|
class: "icon-locked",
|
|
190
186
|
onClick: B
|
|
191
187
|
}))
|
|
192
188
|
]),
|
|
193
|
-
S("div",
|
|
194
|
-
|
|
189
|
+
S("div", lt, [
|
|
190
|
+
$(u(J), {
|
|
195
191
|
modelValue: e.value,
|
|
196
|
-
"onUpdate:modelValue":
|
|
192
|
+
"onUpdate:modelValue": a[3] || (a[3] = (n) => e.value = n),
|
|
197
193
|
size: "large",
|
|
198
194
|
"text-size": "medium",
|
|
199
195
|
label: "Повторите новый пароль",
|
|
200
|
-
type:
|
|
196
|
+
type: O.value,
|
|
201
197
|
error: c.value,
|
|
202
|
-
onBlur:
|
|
203
|
-
onInput:
|
|
198
|
+
onBlur: a[4] || (a[4] = () => i.newPasswordConfirm = !0),
|
|
199
|
+
onInput: a[5] || (a[5] = () => i.newPasswordConfirm = !0)
|
|
204
200
|
}, null, 8, ["modelValue", "type", "error"]),
|
|
205
|
-
(w(), H(Ce(
|
|
201
|
+
(w(), H(Ce(r.value ? u(ge) : u(he)), {
|
|
206
202
|
class: "icon-locked",
|
|
207
|
-
onClick:
|
|
203
|
+
onClick: U
|
|
208
204
|
}))
|
|
209
205
|
]),
|
|
210
206
|
S("div", ot, [
|
|
211
|
-
|
|
207
|
+
$(u(ie), {
|
|
212
208
|
style: { width: "100%" },
|
|
213
209
|
disabled: g.value,
|
|
214
|
-
onClick:
|
|
210
|
+
onClick: A
|
|
215
211
|
}, {
|
|
216
|
-
default: G(() =>
|
|
217
|
-
|
|
212
|
+
default: G(() => a[6] || (a[6] = [
|
|
213
|
+
oe(X("Сохранить"))
|
|
218
214
|
])),
|
|
219
215
|
_: 1,
|
|
220
216
|
__: [6]
|
|
@@ -222,26 +218,26 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
222
218
|
])
|
|
223
219
|
])
|
|
224
220
|
]),
|
|
225
|
-
y.value === u(
|
|
221
|
+
y.value === u(F).COMPLETED ? (w(), k("div", it, [
|
|
226
222
|
S("div", nt, [
|
|
227
|
-
|
|
223
|
+
a[9] || (a[9] = S("p", null, "Пароль успешно установлен", -1)),
|
|
228
224
|
S("div", st, [
|
|
229
|
-
|
|
225
|
+
$(u(ie), {
|
|
230
226
|
style: { width: "100%" },
|
|
231
227
|
onClick: L
|
|
232
228
|
}, {
|
|
233
|
-
default: G(() =>
|
|
234
|
-
|
|
229
|
+
default: G(() => a[8] || (a[8] = [
|
|
230
|
+
oe("Закрыть")
|
|
235
231
|
])),
|
|
236
232
|
_: 1,
|
|
237
233
|
__: [8]
|
|
238
234
|
})
|
|
239
235
|
])
|
|
240
236
|
])
|
|
241
|
-
])) :
|
|
237
|
+
])) : N("", !0)
|
|
242
238
|
], 64));
|
|
243
239
|
}
|
|
244
|
-
}),
|
|
240
|
+
}), rt = { class: "dialogDefaultContainerInsideContent" }, ut = { class: "dialogDefaultContainerTextHint" }, mt = {
|
|
245
241
|
key: 0,
|
|
246
242
|
class: "input-wrapper"
|
|
247
243
|
}, ct = {
|
|
@@ -281,22 +277,22 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
281
277
|
);
|
|
282
278
|
const e = (C) => {
|
|
283
279
|
m.touched[C] = !0;
|
|
284
|
-
},
|
|
280
|
+
}, i = b(""), y = (C) => {
|
|
285
281
|
s("on-clear-code-error");
|
|
286
282
|
const c = C.target;
|
|
287
283
|
let T = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
|
|
288
|
-
T.length > 4 && (T = T.slice(0, 4)), V.value = T, c && c.value !== T && (c.value = T), T.length === 4 && T !==
|
|
289
|
-
},
|
|
290
|
-
s("on-send-code-again", { email:
|
|
291
|
-
}, { emailModel:
|
|
284
|
+
T.length > 4 && (T = T.slice(0, 4)), V.value = T, c && c.value !== T && (c.value = T), T.length === 4 && T !== i.value && (i.value = T, s("on-match-code", { email: r.value, code: T }));
|
|
285
|
+
}, d = () => {
|
|
286
|
+
s("on-send-code-again", { email: r.value });
|
|
287
|
+
}, { emailModel: r, codeModel: V, touched: O } = re(m), B = M(() => O.value.email && !r.value.trim() ? "Введите e-mail" : v.emailError), U = M(() => v.isNotMatchCode ? "Неверный код" : O.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
292
288
|
return (C, c) => {
|
|
293
289
|
const T = ue;
|
|
294
|
-
return w(),
|
|
290
|
+
return w(), k("div", rt, [
|
|
295
291
|
S("div", ut, X(C.hintText), 1),
|
|
296
|
-
C.showEmail ? (w(),
|
|
297
|
-
|
|
298
|
-
modelValue: u(
|
|
299
|
-
"onUpdate:modelValue": c[0] || (c[0] = (g) => Z(
|
|
292
|
+
C.showEmail ? (w(), k("div", mt, [
|
|
293
|
+
$(u(J), {
|
|
294
|
+
modelValue: u(r),
|
|
295
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => Z(r) ? r.value = g : null),
|
|
300
296
|
size: "large",
|
|
301
297
|
"text-size": "medium",
|
|
302
298
|
label: "Почта",
|
|
@@ -306,29 +302,29 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
306
302
|
onBlur: c[1] || (c[1] = (g) => e("email")),
|
|
307
303
|
onInput: c[2] || (c[2] = (g) => e("email"))
|
|
308
304
|
}, null, 8, ["modelValue", "error"]),
|
|
309
|
-
|
|
305
|
+
$(u(me), {
|
|
310
306
|
class: "icon-locked",
|
|
311
307
|
onClick: c[3] || (c[3] = (g) => C.$emit("edit", "email"))
|
|
312
308
|
})
|
|
313
|
-
])) :
|
|
314
|
-
C.showCode ? (w(),
|
|
315
|
-
|
|
309
|
+
])) : N("", !0),
|
|
310
|
+
C.showCode ? (w(), k("div", ct, [
|
|
311
|
+
$(u(J), {
|
|
316
312
|
modelValue: u(V),
|
|
317
313
|
"onUpdate:modelValue": c[4] || (c[4] = (g) => Z(V) ? V.value = g : null),
|
|
318
314
|
size: "large",
|
|
319
315
|
"text-size": "medium",
|
|
320
316
|
label: "Код",
|
|
321
317
|
type: "text",
|
|
322
|
-
error:
|
|
318
|
+
error: U.value,
|
|
323
319
|
onInput: y,
|
|
324
320
|
onBlur: c[5] || (c[5] = (g) => e("code"))
|
|
325
321
|
}, null, 8, ["modelValue", "error"])
|
|
326
|
-
])) :
|
|
327
|
-
|
|
322
|
+
])) : N("", !0),
|
|
323
|
+
$(T, {
|
|
328
324
|
loading: C.loading,
|
|
329
325
|
"rate-limit-text": C.rateLimitText,
|
|
330
326
|
"is-final-limit": C.isFinalLimit,
|
|
331
|
-
"on-send-again":
|
|
327
|
+
"on-send-again": d
|
|
332
328
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
333
329
|
]);
|
|
334
330
|
};
|
|
@@ -358,114 +354,110 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
358
354
|
},
|
|
359
355
|
emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
|
|
360
356
|
setup(_, { emit: R }) {
|
|
361
|
-
const v = _, s = R, m = b(!1), e = b(""),
|
|
357
|
+
const v = _, s = R, m = b(!1), e = b(""), i = Q({
|
|
362
358
|
touched: { email: !1, code: !1 },
|
|
363
359
|
emailModel: "",
|
|
364
360
|
codeModel: ""
|
|
365
361
|
});
|
|
366
362
|
Y(
|
|
367
|
-
() =>
|
|
368
|
-
(
|
|
369
|
-
s("update:email",
|
|
363
|
+
() => i.emailModel,
|
|
364
|
+
(a) => {
|
|
365
|
+
s("update:email", a);
|
|
370
366
|
}
|
|
371
367
|
), Y(
|
|
372
|
-
() =>
|
|
373
|
-
(
|
|
368
|
+
() => i.codeModel,
|
|
369
|
+
(a) => s("update:code", a)
|
|
374
370
|
);
|
|
375
|
-
const y = (
|
|
376
|
-
e.value = "",
|
|
377
|
-
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
378
|
-
var
|
|
371
|
+
const y = (a) => i.touched[a] = !0, d = (a) => i.touched[a] = !1, r = () => {
|
|
372
|
+
e.value = "", d("email");
|
|
373
|
+
}, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), O = M(() => !V.value || !!e.value), B = async () => {
|
|
374
|
+
var a, n;
|
|
379
375
|
try {
|
|
380
376
|
if (y("email"), !V.value) {
|
|
381
377
|
e.value = "Это не похоже на e-mail";
|
|
382
378
|
return;
|
|
383
379
|
}
|
|
384
|
-
const
|
|
385
|
-
if (!(((
|
|
380
|
+
const f = await Ve(i.emailModel), { data: P } = f.data;
|
|
381
|
+
if (!(((n = (a = P == null ? void 0 : P.data) == null ? void 0 : a[0]) == null ? void 0 : n.available) ?? !1)) {
|
|
386
382
|
e.value = "Такой email уже используется";
|
|
387
383
|
return;
|
|
388
384
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
e.value = "", s("on-send-code", { email: n.emailModel, prevEmail: v.oldEmail, offLoading: !0 }), m.value = !0;
|
|
394
|
-
} catch (i) {
|
|
395
|
-
console.error("Неизвестная ошибка при проверке доступности email:", i), e.value = "Это не похоже на e-mail";
|
|
385
|
+
e.value = "", s("on-send-code", { email: i.emailModel, prevEmail: v.oldEmail, offLoading: !0 }), m.value = !0;
|
|
386
|
+
} catch (f) {
|
|
387
|
+
console.error("Неизвестная ошибка при проверке доступности email:", f), e.value = "Это не похоже на e-mail";
|
|
396
388
|
}
|
|
397
389
|
};
|
|
398
|
-
let
|
|
399
|
-
const C = (
|
|
390
|
+
let U = "";
|
|
391
|
+
const C = (a) => {
|
|
400
392
|
s("on-clear-code-error");
|
|
401
|
-
const
|
|
402
|
-
let
|
|
403
|
-
|
|
393
|
+
const n = a.target;
|
|
394
|
+
let f = n.value.replace(/\D/g, "");
|
|
395
|
+
f.length > 4 && (f = f.slice(0, 4), n.value = f), i.codeModel = f, f.length === 4 && f !== U && (U = f, s("on-match-code", { email: i.emailModel, code: f }));
|
|
404
396
|
}, c = () => {
|
|
405
|
-
s("on-send-code-again", { email:
|
|
406
|
-
}, { emailModel: T, codeModel: g, touched: L } =
|
|
397
|
+
s("on-send-code-again", { email: i.emailModel });
|
|
398
|
+
}, { emailModel: T, codeModel: g, touched: L } = re(i), A = M(() => {
|
|
407
399
|
if (e.value) return e.value;
|
|
408
|
-
if (
|
|
409
|
-
if (!
|
|
400
|
+
if (i.touched.email) {
|
|
401
|
+
if (!i.emailModel.trim()) return "Введите e-mail";
|
|
410
402
|
if (!V.value) return "Это не похоже на e-mail";
|
|
411
403
|
}
|
|
412
404
|
return v.emailError || "";
|
|
413
405
|
}), p = M(() => v.isNotMatchCode ? "Неверный код" : L.value.code ? g.value.trim() ? v.codeError ?? null : "Введите код" : "");
|
|
414
|
-
return (
|
|
415
|
-
const
|
|
416
|
-
return w(),
|
|
417
|
-
S("div", Et, X(m.value ? "Введите код подтверждения" :
|
|
418
|
-
|
|
419
|
-
|
|
406
|
+
return (a, n) => {
|
|
407
|
+
const f = ue;
|
|
408
|
+
return w(), k("div", ft, [
|
|
409
|
+
S("div", Et, X(m.value ? "Введите код подтверждения" : a.hintText), 1),
|
|
410
|
+
a.showEmail ? (w(), k("div", wt, [
|
|
411
|
+
$(u(J), {
|
|
420
412
|
modelValue: u(T),
|
|
421
|
-
"onUpdate:modelValue":
|
|
413
|
+
"onUpdate:modelValue": n[0] || (n[0] = (P) => Z(T) ? T.value = P : null),
|
|
422
414
|
size: "large",
|
|
423
415
|
"text-size": "medium",
|
|
424
416
|
label: "Почта",
|
|
425
417
|
type: "email",
|
|
426
|
-
error:
|
|
427
|
-
onBlur:
|
|
428
|
-
onInput:
|
|
418
|
+
error: A.value,
|
|
419
|
+
onBlur: n[1] || (n[1] = (P) => y("email")),
|
|
420
|
+
onInput: r
|
|
429
421
|
}, null, 8, ["modelValue", "error"]),
|
|
430
|
-
|
|
422
|
+
$(u(me), {
|
|
431
423
|
class: "icon-locked",
|
|
432
|
-
onClick:
|
|
424
|
+
onClick: n[2] || (n[2] = (P) => a.$emit("edit", "email"))
|
|
433
425
|
})
|
|
434
|
-
])) :
|
|
435
|
-
m.value ?
|
|
436
|
-
|
|
426
|
+
])) : N("", !0),
|
|
427
|
+
m.value ? N("", !0) : (w(), k("div", Ct, [
|
|
428
|
+
$(u(ie), {
|
|
437
429
|
style: { width: "100%" },
|
|
438
|
-
disabled:
|
|
430
|
+
disabled: O.value,
|
|
439
431
|
onClick: B
|
|
440
432
|
}, {
|
|
441
|
-
default: G(() =>
|
|
442
|
-
|
|
433
|
+
default: G(() => n[5] || (n[5] = [
|
|
434
|
+
oe(" Отправить код ")
|
|
443
435
|
])),
|
|
444
436
|
_: 1,
|
|
445
437
|
__: [5]
|
|
446
438
|
}, 8, ["disabled"])
|
|
447
439
|
])),
|
|
448
|
-
m.value ? (w(),
|
|
449
|
-
|
|
440
|
+
m.value ? (w(), k("div", yt, [
|
|
441
|
+
$(u(J), {
|
|
450
442
|
modelValue: u(g),
|
|
451
|
-
"onUpdate:modelValue":
|
|
443
|
+
"onUpdate:modelValue": n[3] || (n[3] = (P) => Z(g) ? g.value = P : null),
|
|
452
444
|
size: "large",
|
|
453
445
|
"text-size": "medium",
|
|
454
446
|
label: "Код",
|
|
455
447
|
type: "text",
|
|
456
448
|
error: p.value,
|
|
457
449
|
onInput: C,
|
|
458
|
-
onBlur:
|
|
450
|
+
onBlur: n[4] || (n[4] = (P) => y("code"))
|
|
459
451
|
}, null, 8, ["modelValue", "error"])
|
|
460
|
-
])) :
|
|
461
|
-
m.value ? (w(),
|
|
462
|
-
|
|
463
|
-
loading:
|
|
464
|
-
"rate-limit-text":
|
|
465
|
-
"is-final-limit":
|
|
452
|
+
])) : N("", !0),
|
|
453
|
+
m.value ? (w(), k("div", gt, [
|
|
454
|
+
$(f, {
|
|
455
|
+
loading: a.loading,
|
|
456
|
+
"rate-limit-text": a.rateLimitText,
|
|
457
|
+
"is-final-limit": a.isFinalLimit,
|
|
466
458
|
"on-send-again": c
|
|
467
459
|
}, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
468
|
-
])) :
|
|
460
|
+
])) : N("", !0)
|
|
469
461
|
]);
|
|
470
462
|
};
|
|
471
463
|
}
|
|
@@ -494,53 +486,53 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
494
486
|
code: "",
|
|
495
487
|
addEmail: "",
|
|
496
488
|
addCode: ""
|
|
497
|
-
}),
|
|
489
|
+
}), i = Q({ email: !1, code: !1 }), y = b(F.OLD), d = b(null), r = b(!1), V = b(!1), O = b(!1), B = b(We.VERIFY_EMAIL), U = M(() => B.value === "password-flow"), C = M(() => p.value ? v.title : U.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: T, isAvailableForSendAgain: g, totalRateAttempts: L, currentRateAttempt: A } = Fe(), { isEditFlow: p, getFlow: a } = Ae(b(v.mode ?? "edit")), { showRateLimitToast: n } = Re(s), f = M(() => i.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), P = M(() => i.code && !e.code.trim() ? "Введите код" : ""), ae = M(() => g.value ? "Повторить" : `${T.value}`), q = b(Me), be = M(() => q.value === 0), $e = (l) => new Promise((t) => setTimeout(t, l));
|
|
498
490
|
Y(
|
|
499
491
|
() => v.modelValue,
|
|
500
|
-
(
|
|
501
|
-
), Y(m, (
|
|
492
|
+
(l) => m.value = l
|
|
493
|
+
), Y(m, (l) => s("update:modelValue", l));
|
|
502
494
|
const ne = () => {
|
|
503
495
|
s("close"), m.value = !1;
|
|
504
|
-
}, ce = (
|
|
505
|
-
async function ve(
|
|
496
|
+
}, ce = (l) => s("edit", l);
|
|
497
|
+
async function ve(l, t = !1) {
|
|
506
498
|
var o;
|
|
507
499
|
try {
|
|
508
|
-
const h = (o = (await W("/users/profile/check-throttler", { method: "email", email:
|
|
509
|
-
return h ? (await
|
|
500
|
+
const h = (o = (await W("/users/profile/check-throttler", { method: "email", email: l, isInvite: t })).data) == null ? void 0 : o.data;
|
|
501
|
+
return h ? (await $e(1e3), h.restTimeSec > 0 ? (c(h.restTimeSec), g.value = !1, L.value = h.attempts.total ?? L.value, A.value = (h.attempts.total ?? 0) - (h.attempts.available ?? 0), q.value = h.attempts.available ?? q.value) : g.value = !0, h) : null;
|
|
510
502
|
} catch {
|
|
511
503
|
return null;
|
|
512
504
|
}
|
|
513
505
|
}
|
|
514
|
-
async function se(
|
|
506
|
+
async function se(l = "email") {
|
|
515
507
|
var o;
|
|
516
|
-
return ((o = (await He("/users/profile/session/get-edit-session", { params: { field:
|
|
508
|
+
return ((o = (await He("/users/profile/session/get-edit-session", { params: { field: l } })).data) == null ? void 0 : o.data) ?? null;
|
|
517
509
|
}
|
|
518
|
-
async function
|
|
510
|
+
async function xe(l = "email") {
|
|
519
511
|
try {
|
|
520
|
-
const t = await se(
|
|
521
|
-
|
|
512
|
+
const t = await se(l);
|
|
513
|
+
d.value = (t == null ? void 0 : t.sessionId) ?? d.value, y.value = (t == null ? void 0 : t.step) ?? y.value, e.oldEmail = (t == null ? void 0 : t.oldValue) ?? e.oldEmail, t != null && t.sessionId || await pe(l);
|
|
522
514
|
} catch {
|
|
523
|
-
await pe(
|
|
515
|
+
await pe(l);
|
|
524
516
|
}
|
|
525
517
|
}
|
|
526
|
-
async function pe(
|
|
518
|
+
async function pe(l = "email") {
|
|
527
519
|
var t;
|
|
528
520
|
try {
|
|
529
|
-
const o = await W("/users/profile/session/create-if-not-exists", { field:
|
|
530
|
-
|
|
521
|
+
const o = await W("/users/profile/session/create-if-not-exists", { field: l, oldValue: v.initialEmail }), E = ((t = o.data) == null ? void 0 : t.data) ?? o.data;
|
|
522
|
+
d.value = (E == null ? void 0 : E.sessionId) ?? d.value, y.value = (E == null ? void 0 : E.step) ?? y.value, e.oldEmail = (E == null ? void 0 : E.oldValue) ?? e.oldEmail, e.newEmail = (E == null ? void 0 : E.newValue) ?? e.newEmail;
|
|
531
523
|
} catch {
|
|
532
524
|
}
|
|
533
525
|
}
|
|
534
|
-
async function ee({ value:
|
|
526
|
+
async function ee({ value: l, offLoading: t = !0 }) {
|
|
535
527
|
var o;
|
|
536
528
|
try {
|
|
537
|
-
|
|
538
|
-
const
|
|
529
|
+
r.value = !0;
|
|
530
|
+
const E = l ?? e.addEmail, h = await W(
|
|
539
531
|
"/users/profile/email/contact/send-code",
|
|
540
532
|
{
|
|
541
|
-
sessionId:
|
|
542
|
-
email:
|
|
543
|
-
value:
|
|
533
|
+
sessionId: d.value,
|
|
534
|
+
email: E,
|
|
535
|
+
value: E,
|
|
544
536
|
oldValue: e.oldEmail,
|
|
545
537
|
provider: v.provider
|
|
546
538
|
}
|
|
@@ -548,136 +540,136 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
548
540
|
);
|
|
549
541
|
if (h.status === 403 && ((o = h.data) != null && o.tooManyRequests)) {
|
|
550
542
|
const I = h.data.tooManyRequests;
|
|
551
|
-
return I.restTimeSec > 0 ? (c(I.restTimeSec), L.value = I.attempts.total ?? L.value,
|
|
543
|
+
return I.restTimeSec > 0 ? (c(I.restTimeSec), L.value = I.attempts.total ?? L.value, A.value = (I.attempts.total ?? 0) - (I.attempts.available ?? 0), q.value = I.attempts.available ?? q.value) : g.value = !0, h;
|
|
552
544
|
}
|
|
553
|
-
return await ve(
|
|
554
|
-
} catch (
|
|
555
|
-
throw console.error(
|
|
545
|
+
return await ve(l ?? e.oldEmail), h;
|
|
546
|
+
} catch (E) {
|
|
547
|
+
throw console.error(E), E;
|
|
556
548
|
} finally {
|
|
557
|
-
t && (
|
|
549
|
+
t && (r.value = !1);
|
|
558
550
|
}
|
|
559
551
|
}
|
|
560
|
-
const fe = async (
|
|
561
|
-
var o,
|
|
562
|
-
if (!e.oldEmail && t ===
|
|
552
|
+
const fe = async (l, t) => {
|
|
553
|
+
var o, E, h, I, x, j;
|
|
554
|
+
if (!e.oldEmail && t === F.OLD) throw new Error("oldEmail пустой — модель потерялась");
|
|
563
555
|
try {
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
556
|
+
r.value = !0;
|
|
557
|
+
const D = await se();
|
|
558
|
+
if (d.value = (D == null ? void 0 : D.sessionId) ?? d.value, y.value = (D == null ? void 0 : D.step) ?? y.value, e.oldEmail = (D == null ? void 0 : D.oldValue) ?? e.oldEmail, e.newEmail = (D == null ? void 0 : D.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
|
|
567
559
|
const z = await W("/users/profile/change/email/match-code", {
|
|
568
|
-
email: t ===
|
|
569
|
-
sessionId:
|
|
570
|
-
code:
|
|
560
|
+
email: t === F.NEW ? e.newEmail : e.oldEmail,
|
|
561
|
+
sessionId: d.value,
|
|
562
|
+
code: l,
|
|
571
563
|
step: t
|
|
572
|
-
}), le = ((o = z.data) == null ? void 0 : o.nextStep) ?? ((h = (
|
|
573
|
-
if (
|
|
564
|
+
}), le = ((o = z.data) == null ? void 0 : o.nextStep) ?? ((h = (E = z.data) == null ? void 0 : E.data) == null ? void 0 : h.nextStep) ?? null, De = ((x = (I = z.data) == null ? void 0 : I.data) == null ? void 0 : x.rateLimit) ?? ((j = z.data) == null ? void 0 : j.rateLimit) ?? null, Ne = z.data.data.success ?? z.data.success;
|
|
565
|
+
if (n(De), !Ne) {
|
|
574
566
|
V.value = !0;
|
|
575
567
|
return;
|
|
576
568
|
}
|
|
577
569
|
if (le) {
|
|
578
|
-
if (y.value = le, y.value ===
|
|
570
|
+
if (y.value = le, y.value === F.NEW) {
|
|
579
571
|
const K = await se();
|
|
580
572
|
e.oldEmail = (K == null ? void 0 : K.oldValue) ?? e.oldEmail, e.newEmail = (K == null ? void 0 : K.newValue) ?? e.newEmail, e.code = "";
|
|
581
573
|
}
|
|
582
|
-
y.value ===
|
|
574
|
+
y.value === F.COMPLETED && (e.code = "", s("submit-email", { email: e.addEmail, code: l }), s("on-toast", { color: "success", text: "E-mail изменён" }), s("on-update-jwt", "email", "edit", e.newEmail), d.value = null, s("close"));
|
|
583
575
|
}
|
|
584
576
|
return z;
|
|
585
577
|
} finally {
|
|
586
|
-
|
|
578
|
+
r.value = !1;
|
|
587
579
|
}
|
|
588
|
-
},
|
|
580
|
+
}, ke = async () => {
|
|
589
581
|
try {
|
|
590
|
-
const
|
|
591
|
-
sessionId:
|
|
582
|
+
const l = await W("/users/profile/bind/email/cancel", {
|
|
583
|
+
sessionId: d.value
|
|
592
584
|
});
|
|
593
|
-
if ((
|
|
585
|
+
if ((l.data.data ?? l.data).success) {
|
|
594
586
|
s("close");
|
|
595
587
|
return;
|
|
596
588
|
}
|
|
597
|
-
} catch (
|
|
598
|
-
console.error(
|
|
589
|
+
} catch (l) {
|
|
590
|
+
console.error(l);
|
|
599
591
|
}
|
|
600
592
|
};
|
|
601
|
-
async function Ie({ code:
|
|
602
|
-
await fe(
|
|
593
|
+
async function Ie({ code: l }) {
|
|
594
|
+
await fe(l, F.OLD);
|
|
603
595
|
}
|
|
604
|
-
function Ee(
|
|
596
|
+
function Ee(l) {
|
|
605
597
|
}
|
|
606
|
-
async function Se({ code:
|
|
607
|
-
await fe(
|
|
598
|
+
async function Se({ code: l }) {
|
|
599
|
+
await fe(l, F.NEW);
|
|
608
600
|
}
|
|
609
601
|
const we = async ({
|
|
610
|
-
value:
|
|
602
|
+
value: l,
|
|
611
603
|
field: t = "email",
|
|
612
604
|
offLoading: o = !0
|
|
613
605
|
}) => {
|
|
614
|
-
var
|
|
606
|
+
var E;
|
|
615
607
|
try {
|
|
616
|
-
if (
|
|
617
|
-
const h =
|
|
618
|
-
sessionId:
|
|
608
|
+
if (r.value = !0, !d.value) throw new Error("Bind-сессия не найдена. Создайте её через createBindSession.");
|
|
609
|
+
const h = l ?? e.addEmail, I = await W(`/users/profile/bind/contact/send-code/${t}`, {
|
|
610
|
+
sessionId: d.value,
|
|
619
611
|
email: h,
|
|
620
612
|
provider: v.provider
|
|
621
|
-
}),
|
|
622
|
-
if (I.status === 403 &&
|
|
623
|
-
|
|
613
|
+
}), x = (E = I.data) == null ? void 0 : E.tooManyRequests;
|
|
614
|
+
if (I.status === 403 && x) {
|
|
615
|
+
x.restTimeSec > 0 ? (c(x.restTimeSec), L.value = x.attempts.total ?? L.value, A.value = (x.attempts.total ?? 0) - (x.attempts.available ?? 0), q.value = x.attempts.available ?? Me) : g.value = !0;
|
|
624
616
|
return;
|
|
625
617
|
}
|
|
626
618
|
const j = await ve(h);
|
|
627
619
|
return j && j.restTimeSec > 0 ? c(j.restTimeSec) : g.value = !0, I;
|
|
628
620
|
} finally {
|
|
629
|
-
o && (
|
|
621
|
+
o && (r.value = !1);
|
|
630
622
|
}
|
|
631
623
|
}, Be = async () => {
|
|
632
|
-
var
|
|
624
|
+
var l, t, o, E, h, I;
|
|
633
625
|
try {
|
|
634
|
-
if (!
|
|
635
|
-
const le = await
|
|
636
|
-
|
|
626
|
+
if (!d.value) {
|
|
627
|
+
const le = await de();
|
|
628
|
+
d.value = le.sessionId ?? d.value;
|
|
637
629
|
}
|
|
638
|
-
const
|
|
630
|
+
const x = await W("/users/profile/bind/email/match-code", {
|
|
639
631
|
email: e.addEmail,
|
|
640
|
-
sessionId:
|
|
632
|
+
sessionId: d.value,
|
|
641
633
|
code: e.addCode
|
|
642
|
-
}), j = ((
|
|
634
|
+
}), j = ((l = x.data) == null ? void 0 : l.nextStep) ?? ((o = (t = x.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
|
|
643
635
|
B.value = j ?? B.value;
|
|
644
|
-
const
|
|
645
|
-
if (
|
|
646
|
-
|
|
636
|
+
const D = ((h = (E = x.data) == null ? void 0 : E.data) == null ? void 0 : h.rateLimit) ?? ((I = x.data) == null ? void 0 : I.rateLimit) ?? null, z = x.data.data.success ?? x.data.success;
|
|
637
|
+
if (n(D), !z) {
|
|
638
|
+
O.value = !0;
|
|
647
639
|
return;
|
|
648
640
|
}
|
|
649
641
|
} catch {
|
|
650
642
|
}
|
|
651
643
|
}, Le = async () => {
|
|
652
|
-
}, Pe = async (
|
|
653
|
-
if (!
|
|
654
|
-
const t = await
|
|
655
|
-
|
|
644
|
+
}, Pe = async (l) => {
|
|
645
|
+
if (!d.value) {
|
|
646
|
+
const t = await de();
|
|
647
|
+
d.value = t.sessionId ?? d.value;
|
|
656
648
|
}
|
|
657
|
-
|
|
649
|
+
r.value = !0;
|
|
658
650
|
try {
|
|
659
|
-
await W("/users/profile/bind/email/password/set", { sessionId:
|
|
651
|
+
await W("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), B.value = F.COMPLETED, s("on-toast", { color: "success", text: "E-mail успешно привязан к аккаунту" }), s("update-email-field", e.addEmail), s("submit-email", { email: e.addEmail, code: e.addCode }), s("on-update-jwt", "email", "bind", e.addEmail), s("close");
|
|
660
652
|
} finally {
|
|
661
|
-
|
|
653
|
+
r.value = !1;
|
|
662
654
|
}
|
|
663
|
-
},
|
|
664
|
-
|
|
655
|
+
}, de = async () => {
|
|
656
|
+
r.value = !0;
|
|
665
657
|
try {
|
|
666
|
-
const
|
|
667
|
-
return B.value = t.step ?? B.value,
|
|
658
|
+
const l = await W("/users/profile/bind/email/init", { email: "" }), t = l.data.data ?? l.data;
|
|
659
|
+
return B.value = t.step ?? B.value, d.value = t.sessionId ?? d.value, t;
|
|
668
660
|
} finally {
|
|
669
|
-
|
|
661
|
+
r.value = !1;
|
|
670
662
|
}
|
|
671
663
|
};
|
|
672
664
|
return Ue(async () => {
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
if (v.mode === "bind" &&
|
|
676
|
-
await
|
|
665
|
+
r.value = !0;
|
|
666
|
+
const l = await a("email");
|
|
667
|
+
if (v.mode === "bind" && l === "bind") {
|
|
668
|
+
await de(), r.value = !1;
|
|
677
669
|
return;
|
|
678
670
|
}
|
|
679
|
-
await
|
|
680
|
-
}), (
|
|
671
|
+
await xe(), e.oldEmail && await ee({ value: e.oldEmail }), r.value = !1;
|
|
672
|
+
}), (l, t) => (w(), H(u(_e), {
|
|
681
673
|
modelValue: m.value,
|
|
682
674
|
"onUpdate:modelValue": [
|
|
683
675
|
t[18] || (t[18] = (o) => m.value = o),
|
|
@@ -690,7 +682,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
690
682
|
}, {
|
|
691
683
|
header: G(() => [
|
|
692
684
|
S("div", Tt, [
|
|
693
|
-
|
|
685
|
+
$(u(qe), {
|
|
694
686
|
"slot-left": !1,
|
|
695
687
|
size: "small",
|
|
696
688
|
borded: !0,
|
|
@@ -700,7 +692,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
700
692
|
S("span", Mt, X(C.value), 1)
|
|
701
693
|
]),
|
|
702
694
|
"right-button": G(() => [
|
|
703
|
-
|
|
695
|
+
$(u(je), {
|
|
704
696
|
class: "cross",
|
|
705
697
|
onClick: ne
|
|
706
698
|
})
|
|
@@ -711,28 +703,28 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
711
703
|
]),
|
|
712
704
|
default: G(() => [
|
|
713
705
|
S("div", null, [
|
|
714
|
-
u(p) ? (w(),
|
|
715
|
-
|
|
716
|
-
y.value === u(
|
|
706
|
+
u(p) ? (w(), k("div", Vt, [
|
|
707
|
+
r.value ? (w(), H(ye, { key: 0 })) : N("", !0),
|
|
708
|
+
y.value === u(F).OLD ? (w(), H(pt, {
|
|
717
709
|
key: 1,
|
|
718
710
|
email: e.oldEmail,
|
|
719
711
|
"onUpdate:email": t[0] || (t[0] = (o) => e.oldEmail = o),
|
|
720
712
|
code: e.code,
|
|
721
713
|
"onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
|
|
722
|
-
"hint-text":
|
|
723
|
-
"email-error":
|
|
724
|
-
"code-error":
|
|
725
|
-
"rate-limit-text":
|
|
714
|
+
"hint-text": l.hintText,
|
|
715
|
+
"email-error": f.value,
|
|
716
|
+
"code-error": P.value,
|
|
717
|
+
"rate-limit-text": ae.value,
|
|
726
718
|
"is-final-limit": q.value === 0,
|
|
727
719
|
"is-not-match-code": V.value,
|
|
728
|
-
loading:
|
|
720
|
+
loading: r.value,
|
|
729
721
|
onEdit: ce,
|
|
730
722
|
onOnMatchCode: Ie,
|
|
731
723
|
onOnMatchCodeError: Ee,
|
|
732
724
|
onSendCode: t[2] || (t[2] = (o) => ee({ value: e.oldEmail })),
|
|
733
725
|
onOnSendCodeAgain: t[3] || (t[3] = (o) => ee({ value: e.oldEmail })),
|
|
734
726
|
onOnClearCodeError: t[4] || (t[4] = (o) => V.value = !1)
|
|
735
|
-
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : y.value === u(
|
|
727
|
+
}, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : y.value === u(F).NEW ? (w(), H(ht, {
|
|
736
728
|
key: 2,
|
|
737
729
|
email: e.newEmail,
|
|
738
730
|
"onUpdate:email": t[5] || (t[5] = (o) => e.newEmail = o),
|
|
@@ -741,28 +733,28 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
741
733
|
code: e.code,
|
|
742
734
|
"onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
|
|
743
735
|
"hint-text": "Введите новый адрес вашей почты",
|
|
744
|
-
"email-error":
|
|
745
|
-
"code-error":
|
|
746
|
-
"rate-limit-text":
|
|
736
|
+
"email-error": f.value,
|
|
737
|
+
"code-error": P.value,
|
|
738
|
+
"rate-limit-text": ae.value,
|
|
747
739
|
"is-final-limit": q.value === 0,
|
|
748
740
|
"is-not-match-code": V.value,
|
|
749
|
-
loading:
|
|
741
|
+
loading: r.value,
|
|
750
742
|
onEdit: ce,
|
|
751
743
|
onOnMatchCode: Se,
|
|
752
744
|
onOnMatchCodeError: Ee,
|
|
753
745
|
onOnSendCode: t[8] || (t[8] = (o) => ee({ value: e.newEmail })),
|
|
754
746
|
onOnSendCodeAgain: t[9] || (t[9] = (o) => ee({ value: e.newEmail })),
|
|
755
747
|
onOnClearCodeError: t[10] || (t[10] = (o) => V.value = !1)
|
|
756
|
-
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) :
|
|
757
|
-
])) : (w(),
|
|
758
|
-
|
|
759
|
-
|
|
748
|
+
}, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : N("", !0)
|
|
749
|
+
])) : (w(), k("div", bt, [
|
|
750
|
+
r.value ? (w(), H(ye, { key: 0 })) : N("", !0),
|
|
751
|
+
U.value ? (w(), H(dt, {
|
|
760
752
|
key: 2,
|
|
761
753
|
"model-value": m.value,
|
|
762
|
-
"email-session-id":
|
|
754
|
+
"email-session-id": d.value,
|
|
763
755
|
"onUpdate:modelValue": t[17] || (t[17] = (o) => s("update:modelValue", o)),
|
|
764
756
|
onUpdateUser: Pe,
|
|
765
|
-
onClose:
|
|
757
|
+
onClose: ke
|
|
766
758
|
}, null, 8, ["model-value", "email-session-id"])) : (w(), H(Ze, {
|
|
767
759
|
key: 1,
|
|
768
760
|
email: e.addEmail,
|
|
@@ -771,16 +763,16 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
|
|
|
771
763
|
"onUpdate:oldEmail": t[12] || (t[12] = (o) => e.addEmail = o),
|
|
772
764
|
code: e.addCode,
|
|
773
765
|
"onUpdate:code": t[13] || (t[13] = (o) => e.addCode = o),
|
|
774
|
-
"hint-text": u(p) ?
|
|
775
|
-
"rate-limit-text":
|
|
766
|
+
"hint-text": u(p) ? l.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
|
|
767
|
+
"rate-limit-text": ae.value,
|
|
776
768
|
"is-final-limit": be.value,
|
|
777
|
-
"is-not-match-code":
|
|
778
|
-
loading:
|
|
769
|
+
"is-not-match-code": O.value,
|
|
770
|
+
loading: r.value,
|
|
779
771
|
onOnSendCode: t[14] || (t[14] = (o) => we({ value: e.addEmail, field: "email" })),
|
|
780
772
|
onOnSendCodeAgain: t[15] || (t[15] = (o) => we({ value: e.addEmail, field: "email" })),
|
|
781
773
|
onOnMatchCode: Be,
|
|
782
774
|
onOnMatchCodeError: Le,
|
|
783
|
-
onOnClearCodeError: t[16] || (t[16] = (o) =>
|
|
775
|
+
onOnClearCodeError: t[16] || (t[16] = (o) => O.value = !1)
|
|
784
776
|
}, null, 8, ["email", "oldEmail", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"]))
|
|
785
777
|
]))
|
|
786
778
|
])
|