@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,16 +1,16 @@
|
|
|
1
|
-
import { createElementBlock as S, openBlock as
|
|
2
|
-
import {
|
|
3
|
-
import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as
|
|
4
|
-
import { C as
|
|
1
|
+
import { createElementBlock as S, openBlock as v, createElementVNode as G, defineComponent as he, reactive as ve, watch as _, ref as D, toRefs as Ce, computed as I, createCommentVNode as B, createVNode as b, toDisplayString as q, createBlock as J, createTextVNode as X, unref as r, isRef as le, withCtx as Y, onMounted as We, Fragment as je } from "vue";
|
|
2
|
+
import { _ as we, c as Ne, a as He, u as Ge, P as De, b as Je } from "./useRateLimitToast-qLNKIH0n.js";
|
|
3
|
+
import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Re, IconMailMd as Ke, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
|
|
4
|
+
import { C as H, t as Oe, p as te, g as Ae } from "./index-DR9kwm5X.js";
|
|
5
5
|
const _e = {
|
|
6
6
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
7
|
width: "12",
|
|
8
8
|
height: "16",
|
|
9
9
|
fill: "none"
|
|
10
10
|
};
|
|
11
|
-
function et(U,
|
|
12
|
-
return
|
|
13
|
-
|
|
11
|
+
function et(U, V) {
|
|
12
|
+
return v(), S("svg", _e, V[0] || (V[0] = [
|
|
13
|
+
G("path", {
|
|
14
14
|
fill: "#1C7EF1",
|
|
15
15
|
"fill-rule": "evenodd",
|
|
16
16
|
d: "M1 0a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1zm1.5 2a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5zM6 13a1 1 0 1 0 0 2 1 1 0 0 0 0-2",
|
|
@@ -18,13 +18,13 @@ function et(U, b) {
|
|
|
18
18
|
}, null, -1)
|
|
19
19
|
]));
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }, ot = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, nt = { class: "dialogDefaultContainerTextHint" }, at = { class: "chip" }, lt = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "input-wrapper"
|
|
24
24
|
}, st = {
|
|
25
25
|
key: 1,
|
|
26
26
|
class: "input-wrapper"
|
|
27
|
-
},
|
|
27
|
+
}, dt = /* @__PURE__ */ he({
|
|
28
28
|
__name: "OldPhoneContent",
|
|
29
29
|
props: {
|
|
30
30
|
phone: {},
|
|
@@ -39,105 +39,107 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
39
39
|
isFinalLimit: { type: Boolean },
|
|
40
40
|
isNotMatchCode: { type: Boolean },
|
|
41
41
|
loading: { type: Boolean },
|
|
42
|
-
isTg: { type: Boolean }
|
|
42
|
+
isTg: { type: Boolean },
|
|
43
|
+
product: {}
|
|
43
44
|
},
|
|
44
45
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
45
|
-
setup(U, { emit:
|
|
46
|
-
const E = U, u =
|
|
46
|
+
setup(U, { emit: V }) {
|
|
47
|
+
const E = U, u = V, c = ve({
|
|
47
48
|
touched: { phone: !1, code: !1 },
|
|
48
49
|
phoneModel: E.phone,
|
|
49
50
|
codeModel: E.code
|
|
50
51
|
});
|
|
51
52
|
_(
|
|
52
53
|
() => c.phoneModel,
|
|
53
|
-
(
|
|
54
|
+
(h) => u("update:phone", h)
|
|
54
55
|
), _(
|
|
55
56
|
() => c.codeModel,
|
|
56
|
-
(
|
|
57
|
+
(h) => u("update:code", h)
|
|
57
58
|
);
|
|
58
|
-
const f = (
|
|
59
|
-
c.touched[
|
|
59
|
+
const f = (h) => {
|
|
60
|
+
c.touched[h] = !0;
|
|
60
61
|
};
|
|
61
|
-
let p =
|
|
62
|
-
const z = (
|
|
63
|
-
const y =
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
},
|
|
62
|
+
let p = D("");
|
|
63
|
+
const z = (h) => {
|
|
64
|
+
const y = h.target;
|
|
65
|
+
let i = ((y == null ? void 0 : y.value) ?? "").replace(/\D/g, "");
|
|
66
|
+
i.length < 4 && u("on-clear-code-error"), i.length > 4 && (i = i.slice(0, 4)), x.value = i, y && y.value !== i && (y.value = i), i.length === 4 && i !== p.value && (p.value = i, u("on-match-code", { phone: e.value, code: i }));
|
|
67
|
+
}, Z = () => u("on-send-code-again", { phone: c.phoneModel }), K = () => {
|
|
67
68
|
u("on-send-only-sms", { phone: c.phoneModel });
|
|
68
|
-
}, { phoneModel: e, codeModel:
|
|
69
|
-
return (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
}, { phoneModel: e, codeModel: x, touched: P } = Ce(c), C = I(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), O = I(() => E.isNotMatchCode ? "Неверный код" : P.value.code ? x.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
70
|
+
return (h, y) => (v(), S("div", tt, [
|
|
71
|
+
G("div", ot, [
|
|
72
|
+
G("div", nt, q(h.hintText), 1),
|
|
73
|
+
G("div", at, [
|
|
74
|
+
h.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
74
75
|
key: 1,
|
|
75
76
|
style: { "margin-left": "5px" }
|
|
76
77
|
})),
|
|
77
|
-
|
|
78
|
+
X(" " + q(h.isTg ? "Telegram" : "СМС"), 1)
|
|
78
79
|
])
|
|
79
80
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
h.showPhone ? (v(), S("div", lt, [
|
|
82
|
+
b(r(se), {
|
|
82
83
|
modelValue: r(e),
|
|
83
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
84
|
+
"onUpdate:modelValue": y[0] || (y[0] = (i) => le(e) ? e.value = i : null),
|
|
84
85
|
size: "large",
|
|
85
86
|
"text-size": "medium",
|
|
86
87
|
label: "Телефон",
|
|
87
88
|
type: "tel",
|
|
88
89
|
error: C.value,
|
|
89
90
|
disabled: !0,
|
|
90
|
-
onBlur: y[1] || (y[1] = (
|
|
91
|
-
onInput: y[2] || (y[2] = (
|
|
91
|
+
onBlur: y[1] || (y[1] = (i) => f("phone")),
|
|
92
|
+
onInput: y[2] || (y[2] = (i) => f("phone"))
|
|
92
93
|
}, null, 8, ["modelValue", "error"]),
|
|
93
|
-
|
|
94
|
+
b(r(Re), {
|
|
94
95
|
class: "icon-locked",
|
|
95
|
-
onClick: y[3] || (y[3] = (
|
|
96
|
+
onClick: y[3] || (y[3] = (i) => h.$emit("edit", "phone"))
|
|
96
97
|
})
|
|
97
98
|
])) : B("", !0),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
modelValue: r(
|
|
101
|
-
"onUpdate:modelValue": y[4] || (y[4] = (
|
|
99
|
+
h.showCode ? (v(), S("div", st, [
|
|
100
|
+
b(r(se), {
|
|
101
|
+
modelValue: r(x),
|
|
102
|
+
"onUpdate:modelValue": y[4] || (y[4] = (i) => le(x) ? x.value = i : null),
|
|
102
103
|
size: "large",
|
|
103
104
|
"text-size": "medium",
|
|
104
105
|
label: "Код",
|
|
105
106
|
type: "text",
|
|
106
|
-
error:
|
|
107
|
+
error: O.value,
|
|
107
108
|
onInput: z,
|
|
108
|
-
onBlur: y[5] || (y[5] = (
|
|
109
|
+
onBlur: y[5] || (y[5] = (i) => f("code"))
|
|
109
110
|
}, null, 8, ["modelValue", "error"])
|
|
110
111
|
])) : B("", !0),
|
|
111
|
-
|
|
112
|
-
loading:
|
|
113
|
-
"rate-limit-text":
|
|
114
|
-
"is-final-limit":
|
|
115
|
-
"on-send-again":
|
|
112
|
+
b(we, {
|
|
113
|
+
loading: h.loading,
|
|
114
|
+
"rate-limit-text": h.rateLimitText,
|
|
115
|
+
"is-final-limit": h.isFinalLimit,
|
|
116
|
+
"on-send-again": Z,
|
|
117
|
+
product: h.product
|
|
116
118
|
}, {
|
|
117
|
-
extra:
|
|
118
|
-
|
|
119
|
+
extra: Y(() => [
|
|
120
|
+
h.isTg ? (v(), S("span", {
|
|
119
121
|
key: 0,
|
|
120
122
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
121
123
|
onClick: K
|
|
122
124
|
}, [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
X(q(h.sendCodeBySmsText) + " ", 1),
|
|
126
|
+
b(r(de), { style: { "margin-left": "5px" } })
|
|
125
127
|
])) : B("", !0)
|
|
126
128
|
]),
|
|
127
129
|
_: 1
|
|
128
|
-
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
130
|
+
}, 8, ["loading", "rate-limit-text", "is-final-limit", "product"])
|
|
129
131
|
]));
|
|
130
132
|
}
|
|
131
133
|
}), F = (U) => {
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
135
|
-
return `+7${
|
|
136
|
-
if (
|
|
137
|
-
return `+${
|
|
134
|
+
const V = U.replace(/\D/g, "");
|
|
135
|
+
if (V.length >= 10 && V.length <= 15) {
|
|
136
|
+
if (V.startsWith("8"))
|
|
137
|
+
return `+7${V.slice(1)}`;
|
|
138
|
+
if (V.startsWith("7"))
|
|
139
|
+
return `+${V}`;
|
|
138
140
|
}
|
|
139
|
-
return U.trim().startsWith("+") ? U.trim() : `+${
|
|
140
|
-
},
|
|
141
|
+
return U.trim().startsWith("+") ? U.trim() : `+${V}`;
|
|
142
|
+
}, it = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, ut = { class: "dialogDefaultContainerTextHint" }, ct = {
|
|
141
143
|
key: 0,
|
|
142
144
|
class: "chip"
|
|
143
145
|
}, pt = {
|
|
@@ -163,11 +165,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
163
165
|
isFinalLimit: { type: Boolean },
|
|
164
166
|
isNotMatchCode: { type: Boolean, default: !1 },
|
|
165
167
|
loading: { type: Boolean },
|
|
166
|
-
isTg: { type: Boolean }
|
|
168
|
+
isTg: { type: Boolean },
|
|
169
|
+
product: {}
|
|
167
170
|
},
|
|
168
171
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
169
|
-
setup(U, { emit:
|
|
170
|
-
const E = U, u =
|
|
172
|
+
setup(U, { emit: V }) {
|
|
173
|
+
const E = U, u = V, c = D(!1), f = D(""), p = ve({
|
|
171
174
|
touched: { phone: !1, code: !1 },
|
|
172
175
|
phoneModel: "",
|
|
173
176
|
codeModel: ""
|
|
@@ -181,12 +184,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
181
184
|
() => p.codeModel,
|
|
182
185
|
(t) => u("update:code", t)
|
|
183
186
|
);
|
|
184
|
-
const z = (t) => p.touched[t] = !0,
|
|
185
|
-
f.value = "",
|
|
187
|
+
const z = (t) => p.touched[t] = !0, Z = (t) => p.touched[t] = !1, K = () => {
|
|
188
|
+
f.value = "", Z("phone");
|
|
186
189
|
}, e = I(() => {
|
|
187
190
|
const l = p.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
188
191
|
return /^\+?\d{10,15}$/.test(l);
|
|
189
|
-
}),
|
|
192
|
+
}), x = I(() => !e.value || !!f.value), P = async () => {
|
|
190
193
|
var t;
|
|
191
194
|
try {
|
|
192
195
|
if (z("phone"), !e.value) {
|
|
@@ -203,38 +206,38 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
203
206
|
console.error("Неизвестная ошибка при проверке доступности телефона:", l), f.value = "Это не похоже на номер телефона";
|
|
204
207
|
}
|
|
205
208
|
};
|
|
206
|
-
let C =
|
|
207
|
-
const
|
|
209
|
+
let C = D("");
|
|
210
|
+
const O = (t) => {
|
|
208
211
|
const l = t.target;
|
|
209
212
|
let s = ((l == null ? void 0 : l.value) ?? "").replace(/\D/g, "");
|
|
210
|
-
s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), L.value = s, l && l.value !== s && (l.value = s), s.length === 4 && s !== C.value && (C.value = s, u("on-match-code", { phone:
|
|
211
|
-
},
|
|
213
|
+
s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), L.value = s, l && l.value !== s && (l.value = s), s.length === 4 && s !== C.value && (C.value = s, u("on-match-code", { phone: i.value, code: s }));
|
|
214
|
+
}, h = () => {
|
|
212
215
|
u("on-send-code-again", { phone: p.phoneModel });
|
|
213
216
|
}, y = () => {
|
|
214
217
|
u("on-send-only-sms", { phone: p.phoneModel });
|
|
215
|
-
}, { phoneModel:
|
|
218
|
+
}, { phoneModel: i, codeModel: L, touched: ie } = Ce(p), A = I(() => {
|
|
216
219
|
if (f.value) return f.value;
|
|
217
220
|
if (p.touched.phone) {
|
|
218
221
|
if (!p.phoneModel.trim()) return "Введите номер телефона";
|
|
219
222
|
if (!e.value) return "Это не похоже на номер телефона";
|
|
220
223
|
}
|
|
221
224
|
return E.phoneError || "";
|
|
222
|
-
}), Q = I(() => E.isNotMatchCode ? "Неверный код" :
|
|
223
|
-
return (t, l) => (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
c.value ? (
|
|
227
|
-
t.isTg ? (
|
|
225
|
+
}), Q = I(() => E.isNotMatchCode ? "Неверный код" : ie.value.code ? L.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
226
|
+
return (t, l) => (v(), S("div", it, [
|
|
227
|
+
G("div", rt, [
|
|
228
|
+
G("div", ut, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
|
|
229
|
+
c.value ? (v(), S("div", ct, [
|
|
230
|
+
t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
228
231
|
key: 1,
|
|
229
232
|
style: { "margin-left": "5px" }
|
|
230
233
|
})),
|
|
231
|
-
|
|
234
|
+
X(" " + q(t.isTg ? "Telegram" : "СМС"), 1)
|
|
232
235
|
])) : B("", !0)
|
|
233
236
|
]),
|
|
234
|
-
t.showPhone ? (
|
|
235
|
-
|
|
236
|
-
modelValue: r(
|
|
237
|
-
"onUpdate:modelValue": l[0] || (l[0] = (s) => le(
|
|
237
|
+
t.showPhone ? (v(), S("div", pt, [
|
|
238
|
+
b(r(se), {
|
|
239
|
+
modelValue: r(i),
|
|
240
|
+
"onUpdate:modelValue": l[0] || (l[0] = (s) => le(i) ? i.value = s : null),
|
|
238
241
|
size: "large",
|
|
239
242
|
"text-size": "medium",
|
|
240
243
|
label: "Телефон",
|
|
@@ -243,26 +246,26 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
243
246
|
onBlur: l[1] || (l[1] = (s) => z("phone")),
|
|
244
247
|
onInput: K
|
|
245
248
|
}, null, 8, ["modelValue", "error"]),
|
|
246
|
-
|
|
249
|
+
b(r(Ke), {
|
|
247
250
|
class: "icon-locked",
|
|
248
251
|
onClick: l[2] || (l[2] = (s) => t.$emit("edit", "phone"))
|
|
249
252
|
})
|
|
250
253
|
])) : B("", !0),
|
|
251
|
-
c.value ? B("", !0) : (
|
|
252
|
-
|
|
254
|
+
c.value ? B("", !0) : (v(), S("div", ht, [
|
|
255
|
+
b(r(ze), {
|
|
253
256
|
style: { width: "100%" },
|
|
254
|
-
disabled:
|
|
257
|
+
disabled: x.value,
|
|
255
258
|
onClick: P
|
|
256
259
|
}, {
|
|
257
|
-
default:
|
|
258
|
-
|
|
260
|
+
default: Y(() => l[5] || (l[5] = [
|
|
261
|
+
X(" Отправить код ")
|
|
259
262
|
])),
|
|
260
263
|
_: 1,
|
|
261
264
|
__: [5]
|
|
262
265
|
}, 8, ["disabled"])
|
|
263
266
|
])),
|
|
264
|
-
c.value ? (
|
|
265
|
-
|
|
267
|
+
c.value ? (v(), S("div", vt, [
|
|
268
|
+
b(r(se), {
|
|
266
269
|
modelValue: r(L),
|
|
267
270
|
"onUpdate:modelValue": l[3] || (l[3] = (s) => le(L) ? L.value = s : null),
|
|
268
271
|
size: "large",
|
|
@@ -270,29 +273,30 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
270
273
|
label: "Код",
|
|
271
274
|
type: "text",
|
|
272
275
|
error: Q.value,
|
|
273
|
-
onInput:
|
|
276
|
+
onInput: O,
|
|
274
277
|
onBlur: l[4] || (l[4] = (s) => z("code"))
|
|
275
278
|
}, null, 8, ["modelValue", "error"])
|
|
276
279
|
])) : B("", !0),
|
|
277
|
-
!t.loading && c.value ? (
|
|
278
|
-
|
|
280
|
+
!t.loading && c.value ? (v(), S("div", mt, [
|
|
281
|
+
b(we, {
|
|
279
282
|
loading: t.loading,
|
|
280
283
|
"rate-limit-text": t.rateLimitText,
|
|
281
284
|
"is-final-limit": t.isFinalLimit,
|
|
282
|
-
"on-send-again":
|
|
285
|
+
"on-send-again": h,
|
|
286
|
+
product: t.product
|
|
283
287
|
}, {
|
|
284
|
-
extra:
|
|
285
|
-
t.isTg ? (
|
|
288
|
+
extra: Y(() => [
|
|
289
|
+
t.isTg ? (v(), S("span", {
|
|
286
290
|
key: 0,
|
|
287
291
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
288
292
|
onClick: y
|
|
289
293
|
}, [
|
|
290
|
-
|
|
291
|
-
|
|
294
|
+
X(q(t.sendCodeBySmsText) + " ", 1),
|
|
295
|
+
b(r(de), { style: { "margin-left": "5px" } })
|
|
292
296
|
])) : B("", !0)
|
|
293
297
|
]),
|
|
294
298
|
_: 1
|
|
295
|
-
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
299
|
+
}, 8, ["loading", "rate-limit-text", "is-final-limit", "product"])
|
|
296
300
|
])) : B("", !0)
|
|
297
301
|
]));
|
|
298
302
|
}
|
|
@@ -308,7 +312,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
308
312
|
}, St = {
|
|
309
313
|
key: 2,
|
|
310
314
|
class: "input-wrapper"
|
|
311
|
-
}, Mt = { key: 3 },
|
|
315
|
+
}, Mt = { key: 3 }, bt = /* @__PURE__ */ he({
|
|
312
316
|
__name: "AddNewPhoneContent",
|
|
313
317
|
props: {
|
|
314
318
|
phone: {},
|
|
@@ -322,11 +326,13 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
322
326
|
isFinalLimit: { type: Boolean },
|
|
323
327
|
isNotMatchCode: { type: Boolean },
|
|
324
328
|
loading: { type: Boolean },
|
|
325
|
-
isTg: { type: Boolean }
|
|
329
|
+
isTg: { type: Boolean },
|
|
330
|
+
product: {},
|
|
331
|
+
onDisableAddPhone: { type: Boolean, default: !1 }
|
|
326
332
|
},
|
|
327
333
|
emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
|
|
328
|
-
setup(U, { emit:
|
|
329
|
-
const E = U, u =
|
|
334
|
+
setup(U, { emit: V }) {
|
|
335
|
+
const E = U, u = V, c = D(!1), f = D(""), p = ve({
|
|
330
336
|
touched: { phone: !1, code: !1 },
|
|
331
337
|
phoneModel: "",
|
|
332
338
|
codeModel: ""
|
|
@@ -340,12 +346,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
340
346
|
() => p.codeModel,
|
|
341
347
|
(t) => u("update:code", t)
|
|
342
348
|
);
|
|
343
|
-
const z = (t) => p.touched[t] = !0,
|
|
344
|
-
f.value = "",
|
|
349
|
+
const z = (t) => p.touched[t] = !0, Z = (t) => p.touched[t] = !1, K = () => {
|
|
350
|
+
f.value = "", Z("phone");
|
|
345
351
|
}, e = I(() => {
|
|
346
352
|
const l = p.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
347
353
|
return /^\+?\d{10,15}$/.test(l);
|
|
348
|
-
}),
|
|
354
|
+
}), x = I(() => !e.value || !!f.value), P = async () => {
|
|
349
355
|
var t;
|
|
350
356
|
try {
|
|
351
357
|
if (z("phone"), !e.value) {
|
|
@@ -363,15 +369,15 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
363
369
|
}
|
|
364
370
|
};
|
|
365
371
|
let C = "";
|
|
366
|
-
const
|
|
372
|
+
const O = (t) => {
|
|
367
373
|
const l = t.target;
|
|
368
374
|
let s = l.value.replace(/\D/g, "");
|
|
369
375
|
s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4), l.value = s), p.codeModel = s, s.length === 4 && s !== C && (C = s, u("on-match-code", { phone: p.phoneModel, code: s }));
|
|
370
|
-
},
|
|
376
|
+
}, h = () => {
|
|
371
377
|
u("on-send-code-again", { phone: p.phoneModel });
|
|
372
378
|
}, y = () => {
|
|
373
379
|
u("on-send-only-sms", { phone: p.phoneModel });
|
|
374
|
-
}, { phoneModel:
|
|
380
|
+
}, { phoneModel: i, codeModel: L, touched: ie } = Ce(p), A = I(() => {
|
|
375
381
|
if (f.value) return f.value;
|
|
376
382
|
if (p.touched.phone) {
|
|
377
383
|
if (!p.phoneModel.trim()) return "Введите номер телефона";
|
|
@@ -379,49 +385,51 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
379
385
|
}
|
|
380
386
|
return E.phoneError || "";
|
|
381
387
|
}), Q = I(() => E.isNotMatchCode ? "Неверный код" : p.touched.code ? L.value.trim() ? E.codeError ?? null : "Введите код" : "");
|
|
382
|
-
return (t, l) => (
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
c.value ? (
|
|
386
|
-
t.isTg ? (
|
|
388
|
+
return (t, l) => (v(), S("div", yt, [
|
|
389
|
+
G("div", gt, [
|
|
390
|
+
G("div", Ct, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
|
|
391
|
+
c.value ? (v(), S("div", wt, [
|
|
392
|
+
t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
|
|
387
393
|
key: 1,
|
|
388
394
|
style: { "margin-left": "5px" }
|
|
389
395
|
})),
|
|
390
|
-
|
|
396
|
+
X(" " + q(t.isTg ? "Telegram" : "СМС"), 1)
|
|
391
397
|
])) : B("", !0)
|
|
392
398
|
]),
|
|
393
|
-
t.showPhone ? (
|
|
394
|
-
|
|
395
|
-
modelValue: r(
|
|
396
|
-
"onUpdate:modelValue": l[0] || (l[0] = (s) => le(
|
|
399
|
+
t.showPhone ? (v(), S("div", Pt, [
|
|
400
|
+
b(r(se), {
|
|
401
|
+
modelValue: r(i),
|
|
402
|
+
"onUpdate:modelValue": l[0] || (l[0] = (s) => le(i) ? i.value = s : null),
|
|
397
403
|
size: "large",
|
|
398
404
|
"text-size": "medium",
|
|
399
405
|
label: "Телефон",
|
|
400
406
|
type: "tel",
|
|
401
407
|
error: A.value,
|
|
408
|
+
disabled: !!t.onDisableAddPhone,
|
|
402
409
|
onBlur: l[1] || (l[1] = (s) => z("phone")),
|
|
403
410
|
onInput: K
|
|
404
|
-
}, null, 8, ["modelValue", "error"]),
|
|
405
|
-
|
|
411
|
+
}, null, 8, ["modelValue", "error", "disabled"]),
|
|
412
|
+
X(" " + q("fuck off: " + t.onDisableAddPhone) + " ", 1),
|
|
413
|
+
b(r(Re), {
|
|
406
414
|
class: "icon-locked",
|
|
407
415
|
onClick: l[2] || (l[2] = (s) => t.$emit("edit", "phone"))
|
|
408
416
|
})
|
|
409
417
|
])) : B("", !0),
|
|
410
|
-
c.value ? B("", !0) : (
|
|
411
|
-
|
|
418
|
+
c.value ? B("", !0) : (v(), S("div", Tt, [
|
|
419
|
+
b(r(ze), {
|
|
412
420
|
style: { width: "100%" },
|
|
413
|
-
disabled:
|
|
421
|
+
disabled: x.value,
|
|
414
422
|
onClick: P
|
|
415
423
|
}, {
|
|
416
|
-
default:
|
|
417
|
-
|
|
424
|
+
default: Y(() => l[5] || (l[5] = [
|
|
425
|
+
X(" Отправить код ")
|
|
418
426
|
])),
|
|
419
427
|
_: 1,
|
|
420
428
|
__: [5]
|
|
421
429
|
}, 8, ["disabled"])
|
|
422
430
|
])),
|
|
423
|
-
c.value ? (
|
|
424
|
-
|
|
431
|
+
c.value ? (v(), S("div", St, [
|
|
432
|
+
b(r(se), {
|
|
425
433
|
modelValue: r(L),
|
|
426
434
|
"onUpdate:modelValue": l[3] || (l[3] = (s) => le(L) ? L.value = s : null),
|
|
427
435
|
size: "large",
|
|
@@ -429,33 +437,34 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
429
437
|
label: "Код",
|
|
430
438
|
type: "text",
|
|
431
439
|
error: Q.value,
|
|
432
|
-
onInput:
|
|
440
|
+
onInput: O,
|
|
433
441
|
onBlur: l[4] || (l[4] = (s) => z("code"))
|
|
434
442
|
}, null, 8, ["modelValue", "error"])
|
|
435
443
|
])) : B("", !0),
|
|
436
|
-
c.value ? (
|
|
437
|
-
|
|
444
|
+
c.value ? (v(), S("div", Mt, [
|
|
445
|
+
b(we, {
|
|
438
446
|
loading: t.loading,
|
|
439
447
|
"rate-limit-text": t.rateLimitText,
|
|
440
448
|
"is-final-limit": t.isFinalLimit,
|
|
441
|
-
"on-send-again":
|
|
449
|
+
"on-send-again": h,
|
|
450
|
+
product: t.product
|
|
442
451
|
}, {
|
|
443
|
-
extra:
|
|
444
|
-
t.isTg ? (
|
|
452
|
+
extra: Y(() => [
|
|
453
|
+
t.isTg ? (v(), S("span", {
|
|
445
454
|
key: 0,
|
|
446
455
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
447
456
|
onClick: y
|
|
448
457
|
}, [
|
|
449
|
-
|
|
450
|
-
|
|
458
|
+
X(q(t.sendCodeBySmsText) + " ", 1),
|
|
459
|
+
b(r(de), { style: { "margin-left": "5px" } })
|
|
451
460
|
])) : B("", !0)
|
|
452
461
|
]),
|
|
453
462
|
_: 1
|
|
454
|
-
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
463
|
+
}, 8, ["loading", "rate-limit-text", "is-final-limit", "product"])
|
|
455
464
|
])) : B("", !0)
|
|
456
465
|
]));
|
|
457
466
|
}
|
|
458
|
-
}), kt = { class: "text-center w-full" },
|
|
467
|
+
}), kt = { class: "text-center w-full" }, xt = { class: "dialogTitle" }, Vt = {
|
|
459
468
|
key: 0,
|
|
460
469
|
class: "dialogDefaultContainer"
|
|
461
470
|
}, $t = { key: 3 }, Bt = {
|
|
@@ -470,22 +479,23 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
470
479
|
initialPhone: { default: "" },
|
|
471
480
|
language: {},
|
|
472
481
|
provider: {},
|
|
482
|
+
onDisableAddPhone: { type: Boolean, default: !1 },
|
|
473
483
|
mode: { default: void 0 }
|
|
474
484
|
},
|
|
475
485
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
476
|
-
setup(U, { expose:
|
|
477
|
-
const u = U, c = E, f =
|
|
486
|
+
setup(U, { expose: V, emit: E }) {
|
|
487
|
+
const u = U, c = E, f = D(u.modelValue);
|
|
478
488
|
_(
|
|
479
489
|
() => u.modelValue,
|
|
480
490
|
(n) => f.value = n
|
|
481
491
|
), _(f, (n) => c("update:modelValue", n));
|
|
482
|
-
const p = I(() => u.language ?? "ru"), z = (n) =>
|
|
492
|
+
const p = I(() => u.language ?? "ru"), z = (n) => Oe[p.value] && Oe[p.value][n] || (u.title ?? n), Z = I(() => u.title ?? z("Смена номера телефона")), K = I(() => u.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
|
|
483
493
|
oldPhone: u.initialPhone ?? "",
|
|
484
494
|
newPhone: "",
|
|
485
495
|
code: "",
|
|
486
496
|
addPhone: "",
|
|
487
497
|
addCode: ""
|
|
488
|
-
}),
|
|
498
|
+
}), x = D(H.OLD), P = D(null), C = D(!1), O = D(!1), h = D("tg"), y = I(() => h.value === "tg"), i = D(!1), { startTimer: L, remainingSeconds: ie, isAvailableForSendAgain: A, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: l } = Je(c), { isEditFlow: s, getFlow: me } = Ge(D(u.mode)), re = I(() => A.value ? "Повторить" : `${ie.value}`), oe = D(ae), ue = I(() => oe.value === 0), Fe = (n) => new Promise((a) => setTimeout(a, n));
|
|
489
499
|
async function fe(n = "email") {
|
|
490
500
|
var o;
|
|
491
501
|
return (o = (await Ae("/users/profile/session/get-edit-session", { params: { field: n } })).data) == null ? void 0 : o.data;
|
|
@@ -496,12 +506,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
496
506
|
field: n,
|
|
497
507
|
oldValue: F(u.initialPhone)
|
|
498
508
|
})).data) == null ? void 0 : $.data;
|
|
499
|
-
return P.value = (o == null ? void 0 : o.sessionId) ?? null,
|
|
509
|
+
return P.value = (o == null ? void 0 : o.sessionId) ?? null, x.value = (o == null ? void 0 : o.step) ?? H.OLD, e.oldPhone = (o == null ? void 0 : o.oldValue) ?? "", e.newPhone = (o == null ? void 0 : o.newValue) ?? "", o;
|
|
500
510
|
}
|
|
501
511
|
async function Ue() {
|
|
502
512
|
try {
|
|
503
513
|
const n = await fe("phone");
|
|
504
|
-
return P.value = n.sessionId,
|
|
514
|
+
return P.value = n.sessionId, x.value = n.step, e.oldPhone = n.oldValue ?? "", n.sessionId ? n : await Te("phone");
|
|
505
515
|
} catch {
|
|
506
516
|
return await Te("phone");
|
|
507
517
|
}
|
|
@@ -518,7 +528,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
518
528
|
},
|
|
519
529
|
{
|
|
520
530
|
headers: {
|
|
521
|
-
"x-only-sms":
|
|
531
|
+
"x-only-sms": i.value ?? !1
|
|
522
532
|
}
|
|
523
533
|
}
|
|
524
534
|
);
|
|
@@ -529,8 +539,8 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
529
539
|
return null;
|
|
530
540
|
}
|
|
531
541
|
}
|
|
532
|
-
const ye = async ({ phone: n }) => (
|
|
533
|
-
var $, T, N, R,
|
|
542
|
+
const ye = async ({ phone: n }) => (i.value = !0, await ee({ value: n, isOnlySms: !0 })), ee = async ({ value: n, isOnlySms: a, offLoading: o } = {}) => {
|
|
543
|
+
var $, T, N, R, W, j, w;
|
|
534
544
|
C.value = !0;
|
|
535
545
|
try {
|
|
536
546
|
const g = n ?? e.oldPhone, m = await te(
|
|
@@ -548,62 +558,62 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
548
558
|
"x-only-sms": a ?? !1
|
|
549
559
|
}
|
|
550
560
|
}
|
|
551
|
-
),
|
|
552
|
-
if ((
|
|
553
|
-
const M = (
|
|
554
|
-
|
|
561
|
+
), d = (T = ($ = m == null ? void 0 : m.data) == null ? void 0 : $.data) == null ? void 0 : T.deliveryType;
|
|
562
|
+
if ((d === "tg" || d === "sms") && (h.value = d, d === "tg" && (i.value = !1)), (m == null ? void 0 : m.status) === 403 && ((N = m.data) != null && N.tooManyRequests)) {
|
|
563
|
+
const M = (W = (R = m.data) == null ? void 0 : R.tooManyRequests) == null ? void 0 : W.type;
|
|
564
|
+
h.value = M;
|
|
555
565
|
const k = m.data.tooManyRequests;
|
|
556
566
|
return k.restTimeSec > 0 ? (L(k.restTimeSec), Q.value = k.attempts.total, t.value = k.attempts.total - k.attempts.available, oe.value = k.attempts.available ?? ae) : A.value = !0, m;
|
|
557
567
|
}
|
|
558
568
|
return m;
|
|
559
569
|
} catch (g) {
|
|
560
|
-
if ((g == null ? void 0 : g.status) === 403 && ((w = (
|
|
570
|
+
if ((g == null ? void 0 : g.status) === 403 && ((w = (j = g == null ? void 0 : g.response) == null ? void 0 : j.data) != null && w.tooManyRequests)) {
|
|
561
571
|
const m = g.response.data.tooManyRequests.type;
|
|
562
|
-
|
|
563
|
-
const
|
|
564
|
-
return
|
|
572
|
+
h.value = m;
|
|
573
|
+
const d = g.response.data.tooManyRequests;
|
|
574
|
+
return d.restTimeSec > 0 ? (L(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : A.value = !0, g;
|
|
565
575
|
}
|
|
566
576
|
throw g;
|
|
567
577
|
} finally {
|
|
568
578
|
await Se(n ?? e.oldPhone), C.value = !1, o && (C.value = !1);
|
|
569
579
|
}
|
|
570
580
|
}, Me = async (n, a) => {
|
|
571
|
-
var o, $, T, N, R,
|
|
581
|
+
var o, $, T, N, R, W, j, w, g, m, d;
|
|
572
582
|
C.value = !0;
|
|
573
583
|
try {
|
|
574
584
|
const M = await fe("phone");
|
|
575
|
-
P.value = M.sessionId,
|
|
585
|
+
P.value = M.sessionId, x.value = M.step, e.oldPhone = M.oldValue ?? e.oldPhone, e.newPhone = M.newValue ?? e.newPhone;
|
|
576
586
|
const k = await te("/users/profile/change/phone/match-code", {
|
|
577
|
-
phone: a ===
|
|
587
|
+
phone: a === H.NEW ? F(e.newPhone) : F(e.oldPhone),
|
|
578
588
|
sessionId: P.value,
|
|
579
589
|
code: n,
|
|
580
590
|
step: a
|
|
581
|
-
}), ne = ((o = k.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = k.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((R = (N = k.data) == null ? void 0 : N.data) == null ? void 0 : R.rateLimit) ?? ((
|
|
582
|
-
if (!(((
|
|
583
|
-
l(pe),
|
|
591
|
+
}), ne = ((o = k.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = k.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((R = (N = k.data) == null ? void 0 : N.data) == null ? void 0 : R.rateLimit) ?? ((W = k.data) == null ? void 0 : W.rateLimit) ?? null;
|
|
592
|
+
if (!(((j = k.data) == null ? void 0 : j.data.success) ?? ((w = k.data) == null ? void 0 : w.success))) {
|
|
593
|
+
l(pe), O.value = !0;
|
|
584
594
|
return;
|
|
585
595
|
}
|
|
586
596
|
if (!ne) return k;
|
|
587
|
-
if (
|
|
597
|
+
if (x.value = ne, ne === H.NEW) {
|
|
588
598
|
const Ie = await fe("phone");
|
|
589
599
|
e.oldPhone = Ie.oldValue ?? e.oldPhone, e.newPhone = Ie.newValue ?? e.newPhone, e.code = "";
|
|
590
600
|
}
|
|
591
|
-
return ne ===
|
|
601
|
+
return ne === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: n }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), P.value = null, c("close")), k;
|
|
592
602
|
} catch (M) {
|
|
593
603
|
const k = (m = (g = M == null ? void 0 : M.response) == null ? void 0 : g.data) == null ? void 0 : m.rateLimit;
|
|
594
|
-
if (((
|
|
595
|
-
l(k),
|
|
604
|
+
if (((d = M == null ? void 0 : M.response) == null ? void 0 : d.status) === 429 && k) {
|
|
605
|
+
l(k), O.value = !0;
|
|
596
606
|
return;
|
|
597
607
|
}
|
|
598
608
|
throw M;
|
|
599
609
|
} finally {
|
|
600
610
|
C.value = !1;
|
|
601
611
|
}
|
|
602
|
-
},
|
|
612
|
+
}, be = ({ code: n }) => Me(n, H.OLD);
|
|
603
613
|
function ke(n) {
|
|
604
614
|
}
|
|
605
|
-
const
|
|
606
|
-
function
|
|
615
|
+
const xe = ({ code: n }) => Me(n, H.NEW);
|
|
616
|
+
function Ve(n) {
|
|
607
617
|
}
|
|
608
618
|
const ce = () => {
|
|
609
619
|
c("close"), f.value = !1;
|
|
@@ -635,7 +645,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
635
645
|
async function qe() {
|
|
636
646
|
try {
|
|
637
647
|
const n = await $e("phone");
|
|
638
|
-
P.value = n.sessionId,
|
|
648
|
+
P.value = n.sessionId, x.value = n.step, e.addPhone = n.newValue ?? "", n.sessionId || await Be({ field: "phone", value: e.addPhone });
|
|
639
649
|
} catch {
|
|
640
650
|
await Be({ field: "phone", value: e.addPhone });
|
|
641
651
|
}
|
|
@@ -646,7 +656,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
646
656
|
isOnlySms: o = !1,
|
|
647
657
|
offLoading: $ = !0
|
|
648
658
|
} = {}) => {
|
|
649
|
-
var T, N, R,
|
|
659
|
+
var T, N, R, W, j;
|
|
650
660
|
C.value = !0;
|
|
651
661
|
try {
|
|
652
662
|
if (!P.value)
|
|
@@ -665,17 +675,17 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
665
675
|
}
|
|
666
676
|
}
|
|
667
677
|
), m = (N = (T = g == null ? void 0 : g.data) == null ? void 0 : T.data) == null ? void 0 : N.deliveryType;
|
|
668
|
-
(m === "tg" || m === "sms") && (
|
|
669
|
-
const
|
|
670
|
-
if (g.status === 403 &&
|
|
671
|
-
const M =
|
|
672
|
-
return
|
|
678
|
+
(m === "tg" || m === "sms") && (h.value = m, m === "tg" && (i.value = !1));
|
|
679
|
+
const d = (R = g.data) == null ? void 0 : R.tooManyRequests;
|
|
680
|
+
if (g.status === 403 && d) {
|
|
681
|
+
const M = d == null ? void 0 : d.type;
|
|
682
|
+
return h.value = M, d.restTimeSec > 0 ? (L(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : A.value = !0, g;
|
|
673
683
|
}
|
|
674
684
|
return g;
|
|
675
685
|
} catch (w) {
|
|
676
|
-
if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((
|
|
686
|
+
if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((j = (W = w == null ? void 0 : w.response) == null ? void 0 : W.data) != null && j.tooManyRequests)) {
|
|
677
687
|
const g = w.response.data.tooManyRequests.type;
|
|
678
|
-
|
|
688
|
+
h.value = g;
|
|
679
689
|
const m = w.response.data.tooManyRequests;
|
|
680
690
|
return m.restTimeSec > 0 ? (L(m.restTimeSec), Q.value = m.attempts.total, t.value = m.attempts.total - m.attempts.available, oe.value = m.attempts.available ?? ae, A.value = !1) : A.value = !0, w;
|
|
681
691
|
}
|
|
@@ -685,30 +695,30 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
685
695
|
w && w.restTimeSec > 0 ? (L(w.restTimeSec), A.value = !1) : A.value = !0, $ && (C.value = !1);
|
|
686
696
|
}
|
|
687
697
|
}, Ee = async ({ code: n }) => {
|
|
688
|
-
var a, o, $, T, N, R,
|
|
698
|
+
var a, o, $, T, N, R, W, j, w, g, m;
|
|
689
699
|
C.value = !0;
|
|
690
700
|
try {
|
|
691
701
|
if (!P.value) {
|
|
692
702
|
const pe = await $e("phone");
|
|
693
703
|
P.value = pe.sessionId, e.addPhone = pe.newValue ?? e.addPhone;
|
|
694
704
|
}
|
|
695
|
-
const
|
|
705
|
+
const d = await te("/users/profile/bind/phone/match-code", {
|
|
696
706
|
phone: F(e.addPhone),
|
|
697
707
|
sessionId: P.value,
|
|
698
708
|
code: n
|
|
699
|
-
}), M = ((a =
|
|
700
|
-
if (!(((
|
|
701
|
-
l(k),
|
|
709
|
+
}), M = ((a = d.data) == null ? void 0 : a.nextStep) ?? (($ = (o = d.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), k = ((N = (T = d.data) == null ? void 0 : T.data) == null ? void 0 : N.rateLimit) ?? ((R = d.data) == null ? void 0 : R.rateLimit) ?? null;
|
|
710
|
+
if (!(((W = d.data) == null ? void 0 : W.data.success) ?? ((j = d.data) == null ? void 0 : j.success))) {
|
|
711
|
+
l(k), O.value = !0;
|
|
702
712
|
return;
|
|
703
713
|
}
|
|
704
|
-
return M && M ===
|
|
705
|
-
} catch (
|
|
706
|
-
const M = (g = (w =
|
|
707
|
-
if (((m =
|
|
708
|
-
l(M),
|
|
714
|
+
return M && M === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: n }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), P.value = null, c("close")), d;
|
|
715
|
+
} catch (d) {
|
|
716
|
+
const M = (g = (w = d == null ? void 0 : d.response) == null ? void 0 : w.data) == null ? void 0 : g.rateLimit;
|
|
717
|
+
if (((m = d == null ? void 0 : d.response) == null ? void 0 : m.status) === 429 && M) {
|
|
718
|
+
l(M), O.value = !0;
|
|
709
719
|
return;
|
|
710
720
|
}
|
|
711
|
-
throw
|
|
721
|
+
throw d;
|
|
712
722
|
} finally {
|
|
713
723
|
C.value = !1;
|
|
714
724
|
}
|
|
@@ -722,26 +732,26 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
722
732
|
return;
|
|
723
733
|
}
|
|
724
734
|
(await Ue()).step === "old" && await ee({}), C.value = !1;
|
|
725
|
-
}),
|
|
735
|
+
}), V({
|
|
726
736
|
localVisible: f,
|
|
727
737
|
form: e,
|
|
728
|
-
currentStep:
|
|
738
|
+
currentStep: x,
|
|
729
739
|
loading: C,
|
|
730
740
|
rateLimitText: re,
|
|
731
741
|
isAvailable: ue,
|
|
732
|
-
title:
|
|
742
|
+
title: Z,
|
|
733
743
|
hintText: K,
|
|
734
744
|
handleClose: ce,
|
|
735
745
|
sendContactCode: ee,
|
|
736
746
|
sendBindContactCode: ge,
|
|
737
|
-
handleOldCodeSuccess:
|
|
747
|
+
handleOldCodeSuccess: be,
|
|
738
748
|
handleOldCodeError: ke,
|
|
739
|
-
handleNewCodeSuccess:
|
|
740
|
-
handleNewCodeError:
|
|
749
|
+
handleNewCodeSuccess: xe,
|
|
750
|
+
handleNewCodeError: Ve,
|
|
741
751
|
matchBindCode: Ee,
|
|
742
752
|
matchBindCodeError: Le
|
|
743
|
-
}), (n, a) => (
|
|
744
|
-
|
|
753
|
+
}), (n, a) => (v(), S(je, null, [
|
|
754
|
+
b(r(Qe), {
|
|
745
755
|
modelValue: f.value,
|
|
746
756
|
"onUpdate:modelValue": [
|
|
747
757
|
a[15] || (a[15] = (o) => f.value = o),
|
|
@@ -752,19 +762,19 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
752
762
|
"close-on-click-outside": !0,
|
|
753
763
|
"onClick:outside": ce
|
|
754
764
|
}, {
|
|
755
|
-
header:
|
|
756
|
-
|
|
757
|
-
|
|
765
|
+
header: Y(() => [
|
|
766
|
+
G("div", kt, [
|
|
767
|
+
b(r(Xe), {
|
|
758
768
|
"slot-left": !1,
|
|
759
769
|
size: "small",
|
|
760
770
|
borded: !0,
|
|
761
771
|
"no-padding": !1
|
|
762
772
|
}, {
|
|
763
|
-
title:
|
|
764
|
-
|
|
773
|
+
title: Y(() => [
|
|
774
|
+
G("span", xt, q(r(s) ? Z.value : "Добавление номера телефона"), 1)
|
|
765
775
|
]),
|
|
766
|
-
"right-button":
|
|
767
|
-
|
|
776
|
+
"right-button": Y(() => [
|
|
777
|
+
b(r(Ye), {
|
|
768
778
|
class: "cross",
|
|
769
779
|
onClick: ce
|
|
770
780
|
})
|
|
@@ -773,10 +783,10 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
773
783
|
})
|
|
774
784
|
])
|
|
775
785
|
]),
|
|
776
|
-
default:
|
|
777
|
-
r(s) ? (
|
|
778
|
-
C.value ? (
|
|
779
|
-
|
|
786
|
+
default: Y(() => [
|
|
787
|
+
r(s) ? (v(), S("div", Vt, [
|
|
788
|
+
C.value ? (v(), J(De, { key: 0 })) : B("", !0),
|
|
789
|
+
x.value === r(H).OLD ? (v(), J(dt, {
|
|
780
790
|
key: 1,
|
|
781
791
|
phone: e.oldPhone,
|
|
782
792
|
"onUpdate:phone": a[0] || (a[0] = (o) => e.oldPhone = o),
|
|
@@ -784,15 +794,16 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
784
794
|
"onUpdate:code": a[1] || (a[1] = (o) => e.code = o),
|
|
785
795
|
"rate-limit-text": re.value,
|
|
786
796
|
"is-final-limit": ue.value,
|
|
787
|
-
"is-not-match-code":
|
|
797
|
+
"is-not-match-code": O.value,
|
|
788
798
|
loading: C.value,
|
|
789
799
|
"is-tg": y.value,
|
|
800
|
+
product: n.provider,
|
|
790
801
|
onOnSendCode: a[2] || (a[2] = (o) => ee({ value: e.oldPhone })),
|
|
791
|
-
onOnSendCodeAgain: a[3] || (a[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !y.value &&
|
|
802
|
+
onOnSendCodeAgain: a[3] || (a[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !y.value && i.value })),
|
|
792
803
|
onOnSendOnlySms: ye,
|
|
793
|
-
onOnMatchCode:
|
|
804
|
+
onOnMatchCode: be,
|
|
794
805
|
onOnMatchCodeError: ke
|
|
795
|
-
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) :
|
|
806
|
+
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(H).NEW ? (v(), J(ft, {
|
|
796
807
|
key: 2,
|
|
797
808
|
phone: e.newPhone,
|
|
798
809
|
"onUpdate:phone": a[4] || (a[4] = (o) => e.newPhone = o),
|
|
@@ -803,21 +814,22 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
803
814
|
"hint-text": K.value,
|
|
804
815
|
"rate-limit-text": re.value,
|
|
805
816
|
"is-final-limit": ue.value,
|
|
806
|
-
"is-not-match-code":
|
|
817
|
+
"is-not-match-code": O.value,
|
|
807
818
|
loading: C.value,
|
|
808
819
|
"is-tg": y.value,
|
|
820
|
+
product: n.provider,
|
|
809
821
|
onOnSendCode: a[7] || (a[7] = (o) => ee({ value: e.newPhone })),
|
|
810
|
-
onOnSendCodeAgain: a[8] || (a[8] = (o) => ee({ value: e.newPhone, isOnlySms: !y.value &&
|
|
822
|
+
onOnSendCodeAgain: a[8] || (a[8] = (o) => ee({ value: e.newPhone, isOnlySms: !y.value && i.value })),
|
|
811
823
|
onOnSendOnlySms: ye,
|
|
812
|
-
onOnMatchCode:
|
|
813
|
-
onOnMatchCodeError:
|
|
814
|
-
onOnClearCodeError: a[9] || (a[9] = (o) =>
|
|
815
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) :
|
|
816
|
-
|
|
824
|
+
onOnMatchCode: xe,
|
|
825
|
+
onOnMatchCodeError: Ve,
|
|
826
|
+
onOnClearCodeError: a[9] || (a[9] = (o) => O.value = !1)
|
|
827
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(H).COMPLETED ? (v(), S("div", $t, [
|
|
828
|
+
G("p", null, q(z("Телефон успешно изменен")), 1)
|
|
817
829
|
])) : B("", !0)
|
|
818
|
-
])) : (
|
|
819
|
-
C.value ? (
|
|
820
|
-
|
|
830
|
+
])) : (v(), S("div", Bt, [
|
|
831
|
+
C.value ? (v(), J(De, { key: 0 })) : B("", !0),
|
|
832
|
+
b(bt, {
|
|
821
833
|
phone: e.addPhone,
|
|
822
834
|
"onUpdate:phone": a[10] || (a[10] = (o) => e.addPhone = o),
|
|
823
835
|
oldPhone: e.oldPhone,
|
|
@@ -827,20 +839,22 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
|
|
|
827
839
|
"hint-text": r(s) ? K.value : "Чтобы продолжить, введите новый номер",
|
|
828
840
|
"rate-limit-text": re.value,
|
|
829
841
|
"is-final-limit": ue.value,
|
|
830
|
-
"is-not-match-code":
|
|
842
|
+
"is-not-match-code": O.value,
|
|
831
843
|
loading: C.value,
|
|
832
844
|
"is-tg": y.value,
|
|
845
|
+
"on-disable-add-phone": n.onDisableAddPhone,
|
|
846
|
+
product: n.provider,
|
|
833
847
|
onOnSendCode: a[13] || (a[13] = (o) => ge({ value: e.addPhone, field: "phone" })),
|
|
834
|
-
onOnSendCodeAgain: a[14] || (a[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !y.value &&
|
|
848
|
+
onOnSendCodeAgain: a[14] || (a[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !y.value && i.value })),
|
|
835
849
|
onOnSendOnlySms: ye,
|
|
836
850
|
onOnMatchCode: Ee,
|
|
837
851
|
onOnMatchCodeError: Le
|
|
838
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])
|
|
852
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "on-disable-add-phone", "product"])
|
|
839
853
|
]))
|
|
840
854
|
]),
|
|
841
855
|
_: 1
|
|
842
856
|
}, 8, ["modelValue"]),
|
|
843
|
-
|
|
857
|
+
b(r(Ze))
|
|
844
858
|
], 64));
|
|
845
859
|
}
|
|
846
860
|
});
|