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