@yourgoods/ui-smart 0.16.0 → 0.18.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-C-VILfMk.js → ProfileEmailDialog-Dk-u5rNg.js} +2 -2
- package/dist/{ProfilePasswordDialog-ChBlpHrr.js → ProfilePasswordDialog-Xat_KwgU.js} +1 -1
- package/dist/{ProfilePhoneDialog-CFmeID9l.js → ProfilePhoneDialog-CuGntlD2.js} +228 -238
- package/dist/{index-C8iis0sD.js → index-CeaygNy8.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast-C_i3W5B-.js → useRateLimitToast-ZCD0_37E.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as Z, ref as M, reactive as J, watch as j, computed as V, toRefs as se, createElementBlock as k, openBlock as y, createElementVNode as S, createCommentVNode as P, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as q, createTextVNode as te, Fragment as De, createBlock as R, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
|
|
2
|
-
import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-
|
|
3
|
-
import { C as D, _ as ze, B as We, p as F, g as He } from "./index-
|
|
2
|
+
import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-ZCD0_37E.js";
|
|
3
|
+
import { C as D, _ as ze, B as We, p as F, g as He } from "./index-CeaygNy8.js";
|
|
4
4
|
import { PInput as G, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as Ge } from "@profeat/ui-kit";
|
|
5
5
|
const Ye = { class: "dialogDefaultContainerInsideContent" }, _e = { class: "dialogDefaultContainerTextHint" }, Je = {
|
|
6
6
|
key: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
|
|
2
|
-
import { C as I, p as D, g as Ve } from "./index-
|
|
2
|
+
import { C as I, p as D, g as Ve } from "./index-CeaygNy8.js";
|
|
3
3
|
import { PDialog as be, PInput as M, IconEyeMd as O, IconEyeClosedMd as U, PButton as F, PTopBar as Te, IconCrossMd as Ie, PTeleportContainer as xe } from "@profeat/ui-kit";
|
|
4
4
|
function ke(b) {
|
|
5
5
|
return { showPasswordRateLimitToast: (P) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createElementBlock as T, openBlock as p, createElementVNode as
|
|
2
|
-
import { T as ge, c as Le, a as qe, u as We, P as Be, b as
|
|
3
|
-
import { IconTelegramSm as ye, PInput as
|
|
4
|
-
import { C as j, t as Ie, p as
|
|
1
|
+
import { createElementBlock as T, openBlock as p, createElementVNode as z, defineComponent as ue, reactive as ce, watch as Y, ref as O, toRefs as fe, computed as A, createCommentVNode as E, createVNode as S, toDisplayString as q, createBlock as H, createTextVNode as X, unref as r, isRef as oe, withCtx as K, onMounted as Ue, Fragment as je } from "vue";
|
|
2
|
+
import { T as ge, c as Le, a as qe, u as We, P as Be, b as He } from "./useRateLimitToast-ZCD0_37E.js";
|
|
3
|
+
import { IconTelegramSm as ye, PInput as ne, IconPhoneMd as Ge, IconMailMd as De, PButton as Ae, PDialog as Je, PTopBar as Ke, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
|
|
4
|
+
import { C as j, t as Ie, p as ee, g as Oe } from "./index-CeaygNy8.js";
|
|
5
5
|
const Ye = {
|
|
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 Ze(
|
|
11
|
+
function Ze(N, b) {
|
|
12
12
|
return p(), T("svg", Ye, b[0] || (b[0] = [
|
|
13
|
-
|
|
13
|
+
z("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 Ze(z, b) {
|
|
|
18
18
|
}, null, -1)
|
|
19
19
|
]));
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const ae = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }, et = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, tt = { class: "dialogDefaultContainerTextHint" }, ot = { class: "chip" }, nt = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "input-wrapper"
|
|
24
|
-
},
|
|
24
|
+
}, at = {
|
|
25
25
|
key: 1,
|
|
26
26
|
class: "input-wrapper"
|
|
27
|
-
},
|
|
27
|
+
}, lt = /* @__PURE__ */ ue({
|
|
28
28
|
__name: "OldPhoneContent",
|
|
29
29
|
props: {
|
|
30
30
|
phone: {},
|
|
@@ -42,16 +42,16 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
42
42
|
isTg: { type: Boolean }
|
|
43
43
|
},
|
|
44
44
|
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(
|
|
46
|
-
const k =
|
|
45
|
+
setup(N, { emit: b }) {
|
|
46
|
+
const k = N, u = b, c = ce({
|
|
47
47
|
touched: { phone: !1, code: !1 },
|
|
48
48
|
phoneModel: k.phone,
|
|
49
49
|
codeModel: k.code
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
Y(
|
|
52
52
|
() => c.phoneModel,
|
|
53
53
|
(i) => u("update:phone", i)
|
|
54
|
-
),
|
|
54
|
+
), Y(
|
|
55
55
|
() => c.codeModel,
|
|
56
56
|
(i) => u("update:code", i)
|
|
57
57
|
);
|
|
@@ -64,24 +64,24 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
64
64
|
const h = i.target;
|
|
65
65
|
let v = ((h == null ? void 0 : h.value) ?? "").replace(/\D/g, "");
|
|
66
66
|
v.length > 4 && (v = v.slice(0, 4)), M.value = v, h && h.value !== v && (h.value = v), v.length === 4 && v !== f.value && (f.value = v, u("on-match-code", { phone: e.value, code: v }));
|
|
67
|
-
}, W = () => u("on-send-code-again", { phone: c.phoneModel }),
|
|
67
|
+
}, W = () => u("on-send-code-again", { phone: c.phoneModel }), G = () => {
|
|
68
68
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: c.phoneModel });
|
|
69
69
|
}, { phoneModel: e, codeModel: M, touched: C } = fe(c), y = A(() => C.value.phone && !e.value.trim() ? "Введите телефон" : k.phoneError), x = A(() => k.isNotMatchCode ? "Неверный код" : C.value.code ? M.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
70
70
|
return (i, h) => (p(), T("div", _e, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
i.isTg ? (p(),
|
|
71
|
+
z("div", et, [
|
|
72
|
+
z("div", tt, q(i.hintText), 1),
|
|
73
|
+
z("div", ot, [
|
|
74
|
+
i.isTg ? (p(), H(r(ye), { key: 0 })) : (p(), H(r(ae), {
|
|
75
75
|
key: 1,
|
|
76
76
|
style: { "margin-left": "5px" }
|
|
77
77
|
})),
|
|
78
|
-
|
|
78
|
+
X(" " + q(i.isTg ? "Telegram" : "СМС"), 1)
|
|
79
79
|
])
|
|
80
80
|
]),
|
|
81
|
-
i.showPhone ? (p(), T("div",
|
|
82
|
-
S(r(
|
|
81
|
+
i.showPhone ? (p(), T("div", nt, [
|
|
82
|
+
S(r(ne), {
|
|
83
83
|
modelValue: r(e),
|
|
84
|
-
"onUpdate:modelValue": h[0] || (h[0] = (v) =>
|
|
84
|
+
"onUpdate:modelValue": h[0] || (h[0] = (v) => oe(e) ? e.value = v : null),
|
|
85
85
|
size: "large",
|
|
86
86
|
"text-size": "medium",
|
|
87
87
|
label: "Телефон",
|
|
@@ -91,15 +91,15 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
91
91
|
onBlur: h[1] || (h[1] = (v) => g("phone")),
|
|
92
92
|
onInput: h[2] || (h[2] = (v) => g("phone"))
|
|
93
93
|
}, null, 8, ["modelValue", "error"]),
|
|
94
|
-
S(r(
|
|
94
|
+
S(r(Ge), {
|
|
95
95
|
class: "icon-locked",
|
|
96
96
|
onClick: h[3] || (h[3] = (v) => i.$emit("edit", "phone"))
|
|
97
97
|
})
|
|
98
98
|
])) : E("", !0),
|
|
99
|
-
i.showCode ? (p(), T("div",
|
|
100
|
-
S(r(
|
|
99
|
+
i.showCode ? (p(), T("div", at, [
|
|
100
|
+
S(r(ne), {
|
|
101
101
|
modelValue: r(M),
|
|
102
|
-
"onUpdate:modelValue": h[4] || (h[4] = (v) =>
|
|
102
|
+
"onUpdate:modelValue": h[4] || (h[4] = (v) => oe(M) ? M.value = v : null),
|
|
103
103
|
size: "large",
|
|
104
104
|
"text-size": "medium",
|
|
105
105
|
label: "Код",
|
|
@@ -115,42 +115,42 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
115
115
|
"is-final-limit": i.isFinalLimit,
|
|
116
116
|
"on-send-again": W
|
|
117
117
|
}, {
|
|
118
|
-
extra:
|
|
118
|
+
extra: K(() => [
|
|
119
119
|
i.isTg ? (p(), T("span", {
|
|
120
120
|
key: 0,
|
|
121
121
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
122
|
-
onClick:
|
|
122
|
+
onClick: G
|
|
123
123
|
}, [
|
|
124
|
-
|
|
125
|
-
S(r(
|
|
124
|
+
X(q(i.sendCodeBySmsText) + " ", 1),
|
|
125
|
+
S(r(ae), { style: { "margin-left": "5px" } })
|
|
126
126
|
])) : E("", !0)
|
|
127
127
|
]),
|
|
128
128
|
_: 1
|
|
129
129
|
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
130
130
|
]));
|
|
131
131
|
}
|
|
132
|
-
}),
|
|
133
|
-
const b =
|
|
132
|
+
}), R = (N) => {
|
|
133
|
+
const b = N.replace(/\D/g, "");
|
|
134
134
|
if (b.length >= 10 && b.length <= 15) {
|
|
135
135
|
if (b.startsWith("8"))
|
|
136
136
|
return `+7${b.slice(1)}`;
|
|
137
137
|
if (b.startsWith("7"))
|
|
138
138
|
return `+${b}`;
|
|
139
139
|
}
|
|
140
|
-
return
|
|
141
|
-
},
|
|
140
|
+
return N.trim().startsWith("+") ? N.trim() : `+${b}`;
|
|
141
|
+
}, st = { class: "dialogDefaultContainerInsideContent" }, it = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, dt = { class: "dialogDefaultContainerTextHint" }, rt = {
|
|
142
142
|
key: 0,
|
|
143
143
|
class: "chip"
|
|
144
|
-
},
|
|
144
|
+
}, ut = {
|
|
145
145
|
key: 0,
|
|
146
146
|
class: "input-wrapper"
|
|
147
|
-
},
|
|
147
|
+
}, ct = {
|
|
148
148
|
key: 1,
|
|
149
149
|
class: "input-wrapper"
|
|
150
|
-
},
|
|
150
|
+
}, pt = {
|
|
151
151
|
key: 2,
|
|
152
152
|
class: "input-wrapper"
|
|
153
|
-
},
|
|
153
|
+
}, ht = { key: 3 }, vt = /* @__PURE__ */ ue({
|
|
154
154
|
__name: "NewPhoneContent",
|
|
155
155
|
props: {
|
|
156
156
|
phone: {},
|
|
@@ -167,46 +167,41 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
167
167
|
isTg: { type: Boolean }
|
|
168
168
|
},
|
|
169
169
|
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"],
|
|
170
|
-
setup(
|
|
171
|
-
const k =
|
|
170
|
+
setup(N, { emit: b }) {
|
|
171
|
+
const k = N, u = b, c = O(!1), g = O(""), f = ce({
|
|
172
172
|
touched: { phone: !1, code: !1 },
|
|
173
173
|
phoneModel: "",
|
|
174
174
|
codeModel: ""
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
Y(
|
|
177
177
|
() => f.phoneModel,
|
|
178
178
|
(n) => {
|
|
179
179
|
u("update:phone", n), g.value = "";
|
|
180
180
|
}
|
|
181
|
-
),
|
|
181
|
+
), Y(
|
|
182
182
|
() => f.codeModel,
|
|
183
183
|
(n) => u("update:code", n)
|
|
184
184
|
);
|
|
185
185
|
const B = (n) => f.touched[n] = !0, W = A(() => {
|
|
186
|
-
const
|
|
187
|
-
return /^\+?\d{10,15}$/.test(
|
|
188
|
-
}),
|
|
189
|
-
var
|
|
186
|
+
const o = f.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
187
|
+
return /^\+?\d{10,15}$/.test(o);
|
|
188
|
+
}), G = async () => {
|
|
189
|
+
var Q;
|
|
190
190
|
if (B("phone"), !W.value) {
|
|
191
191
|
g.value = "Это не похоже на номер телефона";
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
const {
|
|
195
|
-
data: { data: n, success:
|
|
196
|
-
} = await Le(void 0,
|
|
197
|
-
if (!
|
|
198
|
-
|
|
199
|
-
if (
|
|
200
|
-
"Телефон должен быть в формате",
|
|
201
|
-
"phone must be a valid phone number"
|
|
202
|
-
].some(
|
|
203
|
-
(J) => _.includes(J)
|
|
204
|
-
)) {
|
|
195
|
+
data: { data: n, success: o, message: l }
|
|
196
|
+
} = await Le(void 0, R(f.phoneModel));
|
|
197
|
+
if (!o && l) {
|
|
198
|
+
const Z = Array.isArray(l) ? l.join(" ") : String(l);
|
|
199
|
+
if (/Телефон должен быть в формате|valid phone number/i.test(Z)) {
|
|
205
200
|
g.value = "Это не похоже на номер телефона";
|
|
206
201
|
return;
|
|
207
202
|
}
|
|
208
203
|
}
|
|
209
|
-
if (!(((
|
|
204
|
+
if (!(((Q = n == null ? void 0 : n[0]) == null ? void 0 : Q.available) ?? !1)) {
|
|
210
205
|
g.value = "Такой номер уже используется";
|
|
211
206
|
return;
|
|
212
207
|
}
|
|
@@ -215,83 +210,83 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
215
210
|
let e = O("");
|
|
216
211
|
const M = (n) => {
|
|
217
212
|
u("on-clear-code-error");
|
|
218
|
-
const
|
|
219
|
-
let l = ((
|
|
220
|
-
l.length > 4 && (l = l.slice(0, 4)), i.value = l,
|
|
213
|
+
const o = n.target;
|
|
214
|
+
let l = ((o == null ? void 0 : o.value) ?? "").replace(/\D/g, "");
|
|
215
|
+
l.length > 4 && (l = l.slice(0, 4)), i.value = l, o && o.value !== l && (o.value = l), l.length === 4 && l !== e.value && (e.value = l, u("on-match-code", { phone: x.value, code: l }));
|
|
221
216
|
}, C = () => {
|
|
222
217
|
u("on-send-code-again", { phone: f.phoneModel });
|
|
223
218
|
}, y = () => {
|
|
224
219
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: f.phoneModel });
|
|
225
|
-
}, { phoneModel: x, codeModel: i, touched: h } = fe(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""),
|
|
226
|
-
return (n,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
c.value ? (p(), T("div",
|
|
230
|
-
n.isTg ? (p(),
|
|
220
|
+
}, { phoneModel: x, codeModel: i, touched: h } = fe(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), J = A(() => k.isNotMatchCode ? "Неверный код" : h.value.code ? i.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
221
|
+
return (n, o) => (p(), T("div", st, [
|
|
222
|
+
z("div", it, [
|
|
223
|
+
z("div", dt, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : n.hintText), 1),
|
|
224
|
+
c.value ? (p(), T("div", rt, [
|
|
225
|
+
n.isTg ? (p(), H(r(ye), { key: 0 })) : (p(), H(r(ae), {
|
|
231
226
|
key: 1,
|
|
232
227
|
style: { "margin-left": "5px" }
|
|
233
228
|
})),
|
|
234
|
-
|
|
229
|
+
X(" " + q(n.isTg ? "Telegram" : "СМС"), 1)
|
|
235
230
|
])) : E("", !0)
|
|
236
231
|
]),
|
|
237
|
-
n.showPhone ? (p(), T("div",
|
|
238
|
-
S(r(
|
|
232
|
+
n.showPhone ? (p(), T("div", ut, [
|
|
233
|
+
S(r(ne), {
|
|
239
234
|
modelValue: r(x),
|
|
240
|
-
"onUpdate:modelValue":
|
|
235
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => oe(x) ? x.value = l : null),
|
|
241
236
|
size: "large",
|
|
242
237
|
"text-size": "medium",
|
|
243
238
|
label: "Телефон",
|
|
244
239
|
type: "tel",
|
|
245
240
|
error: v.value,
|
|
246
|
-
onBlur:
|
|
247
|
-
onInput:
|
|
241
|
+
onBlur: o[1] || (o[1] = (l) => B("phone")),
|
|
242
|
+
onInput: o[2] || (o[2] = (l) => B("phone"))
|
|
248
243
|
}, null, 8, ["modelValue", "error"]),
|
|
249
244
|
S(r(De), {
|
|
250
245
|
class: "icon-locked",
|
|
251
|
-
onClick:
|
|
246
|
+
onClick: o[3] || (o[3] = (l) => n.$emit("edit", "phone"))
|
|
252
247
|
})
|
|
253
248
|
])) : E("", !0),
|
|
254
|
-
c.value ? E("", !0) : (p(), T("div",
|
|
249
|
+
c.value ? E("", !0) : (p(), T("div", ct, [
|
|
255
250
|
S(r(Ae), {
|
|
256
251
|
style: { width: "100%" },
|
|
257
252
|
disabled: !W.value,
|
|
258
|
-
onClick:
|
|
253
|
+
onClick: G
|
|
259
254
|
}, {
|
|
260
|
-
default:
|
|
261
|
-
|
|
255
|
+
default: K(() => o[6] || (o[6] = [
|
|
256
|
+
X(" Отправить код ")
|
|
262
257
|
])),
|
|
263
258
|
_: 1,
|
|
264
259
|
__: [6]
|
|
265
260
|
}, 8, ["disabled"])
|
|
266
261
|
])),
|
|
267
|
-
c.value ? (p(), T("div",
|
|
268
|
-
S(r(
|
|
262
|
+
c.value ? (p(), T("div", pt, [
|
|
263
|
+
S(r(ne), {
|
|
269
264
|
modelValue: r(i),
|
|
270
|
-
"onUpdate:modelValue":
|
|
265
|
+
"onUpdate:modelValue": o[4] || (o[4] = (l) => oe(i) ? i.value = l : null),
|
|
271
266
|
size: "large",
|
|
272
267
|
"text-size": "medium",
|
|
273
268
|
label: "Код",
|
|
274
269
|
type: "text",
|
|
275
|
-
error:
|
|
270
|
+
error: J.value,
|
|
276
271
|
onInput: M,
|
|
277
|
-
onBlur:
|
|
272
|
+
onBlur: o[5] || (o[5] = (l) => B("code"))
|
|
278
273
|
}, null, 8, ["modelValue", "error"])
|
|
279
274
|
])) : E("", !0),
|
|
280
|
-
!n.loading && c.value ? (p(), T("div",
|
|
275
|
+
!n.loading && c.value ? (p(), T("div", ht, [
|
|
281
276
|
S(ge, {
|
|
282
277
|
loading: n.loading,
|
|
283
278
|
"rate-limit-text": n.rateLimitText,
|
|
284
279
|
"is-final-limit": n.isFinalLimit,
|
|
285
280
|
"on-send-again": C
|
|
286
281
|
}, {
|
|
287
|
-
extra:
|
|
282
|
+
extra: K(() => [
|
|
288
283
|
n.isTg ? (p(), T("span", {
|
|
289
284
|
key: 0,
|
|
290
285
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
291
286
|
onClick: y
|
|
292
287
|
}, [
|
|
293
|
-
|
|
294
|
-
S(r(
|
|
288
|
+
X(q(n.sendCodeBySmsText) + " ", 1),
|
|
289
|
+
S(r(ae), { style: { "margin-left": "5px" } })
|
|
295
290
|
])) : E("", !0)
|
|
296
291
|
]),
|
|
297
292
|
_: 1
|
|
@@ -299,16 +294,16 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
299
294
|
])) : E("", !0)
|
|
300
295
|
]));
|
|
301
296
|
}
|
|
302
|
-
}),
|
|
297
|
+
}), mt = { class: "dialogDefaultContainerInsideContent" }, ft = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, gt = { class: "dialogDefaultContainerTextHint" }, yt = { class: "chip" }, Ct = {
|
|
303
298
|
key: 0,
|
|
304
299
|
class: "input-wrapper"
|
|
305
|
-
},
|
|
300
|
+
}, wt = {
|
|
306
301
|
key: 1,
|
|
307
302
|
class: "input-wrapper"
|
|
308
|
-
},
|
|
303
|
+
}, Pt = {
|
|
309
304
|
key: 2,
|
|
310
305
|
class: "input-wrapper"
|
|
311
|
-
},
|
|
306
|
+
}, Tt = { key: 3 }, St = /* @__PURE__ */ ue({
|
|
312
307
|
__name: "AddNewPhoneContent",
|
|
313
308
|
props: {
|
|
314
309
|
phone: {},
|
|
@@ -325,46 +320,41 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
325
320
|
isTg: { type: Boolean }
|
|
326
321
|
},
|
|
327
322
|
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(
|
|
329
|
-
const k =
|
|
323
|
+
setup(N, { emit: b }) {
|
|
324
|
+
const k = N, u = b, c = O(!1), g = O(""), f = ce({
|
|
330
325
|
touched: { phone: !1, code: !1 },
|
|
331
326
|
phoneModel: "",
|
|
332
327
|
codeModel: ""
|
|
333
328
|
});
|
|
334
|
-
|
|
329
|
+
Y(
|
|
335
330
|
() => f.phoneModel,
|
|
336
331
|
(n) => {
|
|
337
332
|
u("update:phone", n), g.value = "";
|
|
338
333
|
}
|
|
339
|
-
),
|
|
334
|
+
), Y(
|
|
340
335
|
() => f.codeModel,
|
|
341
336
|
(n) => u("update:code", n)
|
|
342
337
|
);
|
|
343
338
|
const B = (n) => f.touched[n] = !0, W = A(() => {
|
|
344
|
-
const
|
|
345
|
-
return /^\+?\d{10,15}$/.test(
|
|
346
|
-
}),
|
|
347
|
-
var
|
|
339
|
+
const o = f.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
340
|
+
return /^\+?\d{10,15}$/.test(o);
|
|
341
|
+
}), G = async () => {
|
|
342
|
+
var Q;
|
|
348
343
|
if (B("phone"), !W.value) {
|
|
349
344
|
g.value = "Это не похоже на номер телефона";
|
|
350
345
|
return;
|
|
351
346
|
}
|
|
352
347
|
const {
|
|
353
|
-
data: { data: n, success:
|
|
354
|
-
} = await Le(void 0,
|
|
355
|
-
if (!
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
"Телефон должен быть в формате",
|
|
359
|
-
"phone must be a valid phone number"
|
|
360
|
-
].some(
|
|
361
|
-
(J) => _.includes(J)
|
|
362
|
-
)) {
|
|
348
|
+
data: { data: n, success: o, message: l }
|
|
349
|
+
} = await Le(void 0, R(f.phoneModel));
|
|
350
|
+
if (!o && l) {
|
|
351
|
+
const Z = Array.isArray(l) ? l.join(" ") : String(l);
|
|
352
|
+
if (/Телефон должен быть в формате|valid phone number/i.test(Z)) {
|
|
363
353
|
g.value = "Это не похоже на номер телефона";
|
|
364
354
|
return;
|
|
365
355
|
}
|
|
366
356
|
}
|
|
367
|
-
if (!(((
|
|
357
|
+
if (!(((Q = n == null ? void 0 : n[0]) == null ? void 0 : Q.available) ?? !1)) {
|
|
368
358
|
g.value = "Такой номер уже используется";
|
|
369
359
|
return;
|
|
370
360
|
}
|
|
@@ -373,83 +363,83 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
373
363
|
let e = "";
|
|
374
364
|
const M = (n) => {
|
|
375
365
|
u("on-clear-code-error");
|
|
376
|
-
const
|
|
377
|
-
let l =
|
|
378
|
-
l.length > 4 && (l = l.slice(0, 4),
|
|
366
|
+
const o = n.target;
|
|
367
|
+
let l = o.value.replace(/\D/g, "");
|
|
368
|
+
l.length > 4 && (l = l.slice(0, 4), o.value = l), f.codeModel = l, l.length === 4 && l !== e && (e = l, u("on-match-code", { phone: f.phoneModel, code: l }));
|
|
379
369
|
}, C = () => {
|
|
380
370
|
u("on-send-code-again", { phone: f.phoneModel });
|
|
381
371
|
}, y = () => {
|
|
382
372
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: f.phoneModel });
|
|
383
|
-
}, { phoneModel: x, codeModel: i, touched: h } = fe(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""),
|
|
384
|
-
return (n,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
n.isTg ? (p(),
|
|
373
|
+
}, { phoneModel: x, codeModel: i, touched: h } = fe(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), J = A(() => k.isNotMatchCode ? "Неверный код" : f.touched.code ? i.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
374
|
+
return (n, o) => (p(), T("div", mt, [
|
|
375
|
+
z("div", ft, [
|
|
376
|
+
z("div", gt, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : n.hintText), 1),
|
|
377
|
+
z("div", yt, [
|
|
378
|
+
n.isTg ? (p(), H(r(ye), { key: 0 })) : (p(), H(r(ae), {
|
|
389
379
|
key: 1,
|
|
390
380
|
style: { "margin-left": "5px" }
|
|
391
381
|
})),
|
|
392
|
-
|
|
382
|
+
X(" " + q(n.isTg ? "Telegram" : "СМС"), 1)
|
|
393
383
|
])
|
|
394
384
|
]),
|
|
395
|
-
n.showPhone ? (p(), T("div",
|
|
396
|
-
S(r(
|
|
385
|
+
n.showPhone ? (p(), T("div", Ct, [
|
|
386
|
+
S(r(ne), {
|
|
397
387
|
modelValue: r(x),
|
|
398
|
-
"onUpdate:modelValue":
|
|
388
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => oe(x) ? x.value = l : null),
|
|
399
389
|
size: "large",
|
|
400
390
|
"text-size": "medium",
|
|
401
391
|
label: "Телефон",
|
|
402
392
|
type: "tel",
|
|
403
393
|
error: v.value,
|
|
404
|
-
onBlur:
|
|
405
|
-
onInput:
|
|
394
|
+
onBlur: o[1] || (o[1] = (l) => B("phone")),
|
|
395
|
+
onInput: o[2] || (o[2] = (l) => B("phone"))
|
|
406
396
|
}, null, 8, ["modelValue", "error"]),
|
|
407
397
|
S(r(De), {
|
|
408
398
|
class: "icon-locked",
|
|
409
|
-
onClick:
|
|
399
|
+
onClick: o[3] || (o[3] = (l) => n.$emit("edit", "phone"))
|
|
410
400
|
})
|
|
411
401
|
])) : E("", !0),
|
|
412
|
-
c.value ? E("", !0) : (p(), T("div",
|
|
402
|
+
c.value ? E("", !0) : (p(), T("div", wt, [
|
|
413
403
|
S(r(Ae), {
|
|
414
404
|
style: { width: "100%" },
|
|
415
405
|
disabled: !W.value,
|
|
416
|
-
onClick:
|
|
406
|
+
onClick: G
|
|
417
407
|
}, {
|
|
418
|
-
default:
|
|
419
|
-
|
|
408
|
+
default: K(() => o[6] || (o[6] = [
|
|
409
|
+
X(" Отправить код ")
|
|
420
410
|
])),
|
|
421
411
|
_: 1,
|
|
422
412
|
__: [6]
|
|
423
413
|
}, 8, ["disabled"])
|
|
424
414
|
])),
|
|
425
|
-
c.value ? (p(), T("div",
|
|
426
|
-
S(r(
|
|
415
|
+
c.value ? (p(), T("div", Pt, [
|
|
416
|
+
S(r(ne), {
|
|
427
417
|
modelValue: r(i),
|
|
428
|
-
"onUpdate:modelValue":
|
|
418
|
+
"onUpdate:modelValue": o[4] || (o[4] = (l) => oe(i) ? i.value = l : null),
|
|
429
419
|
size: "large",
|
|
430
420
|
"text-size": "medium",
|
|
431
421
|
label: "Код",
|
|
432
422
|
type: "text",
|
|
433
|
-
error:
|
|
423
|
+
error: J.value,
|
|
434
424
|
onInput: M,
|
|
435
|
-
onBlur:
|
|
425
|
+
onBlur: o[5] || (o[5] = (l) => B("code"))
|
|
436
426
|
}, null, 8, ["modelValue", "error"])
|
|
437
427
|
])) : E("", !0),
|
|
438
|
-
c.value ? (p(), T("div",
|
|
428
|
+
c.value ? (p(), T("div", Tt, [
|
|
439
429
|
S(ge, {
|
|
440
430
|
loading: n.loading,
|
|
441
431
|
"rate-limit-text": n.rateLimitText,
|
|
442
432
|
"is-final-limit": n.isFinalLimit,
|
|
443
433
|
"on-send-again": C
|
|
444
434
|
}, {
|
|
445
|
-
extra:
|
|
435
|
+
extra: K(() => [
|
|
446
436
|
n.isTg ? (p(), T("span", {
|
|
447
437
|
key: 0,
|
|
448
438
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
449
439
|
onClick: y
|
|
450
440
|
}, [
|
|
451
|
-
|
|
452
|
-
S(r(
|
|
441
|
+
X(q(n.sendCodeBySmsText) + " ", 1),
|
|
442
|
+
S(r(ae), { style: { "margin-left": "5px" } })
|
|
453
443
|
])) : E("", !0)
|
|
454
444
|
]),
|
|
455
445
|
_: 1
|
|
@@ -457,13 +447,13 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
457
447
|
])) : E("", !0)
|
|
458
448
|
]));
|
|
459
449
|
}
|
|
460
|
-
}),
|
|
450
|
+
}), Mt = { class: "text-center w-full" }, xt = { class: "dialogTitle" }, bt = {
|
|
461
451
|
key: 0,
|
|
462
452
|
class: "dialogDefaultContainer"
|
|
463
|
-
},
|
|
453
|
+
}, Vt = { key: 3 }, kt = {
|
|
464
454
|
key: 1,
|
|
465
455
|
class: "dialogDefaultContainer"
|
|
466
|
-
},
|
|
456
|
+
}, se = 3, Ot = /* @__PURE__ */ ue({
|
|
467
457
|
__name: "ProfilePhoneDialog",
|
|
468
458
|
props: {
|
|
469
459
|
modelValue: { type: Boolean },
|
|
@@ -475,32 +465,32 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
475
465
|
mode: { default: void 0 }
|
|
476
466
|
},
|
|
477
467
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
478
|
-
setup(
|
|
479
|
-
const u =
|
|
480
|
-
|
|
468
|
+
setup(N, { expose: b, emit: k }) {
|
|
469
|
+
const u = N, c = k, g = O(u.modelValue);
|
|
470
|
+
Y(
|
|
481
471
|
() => u.modelValue,
|
|
482
472
|
(s) => g.value = s
|
|
483
|
-
),
|
|
484
|
-
const f = A(() => u.language ?? "ru"), B = (s) => Ie[f.value] && Ie[f.value][s] || (u.title ?? s), W = A(() => u.title ?? B("Смена номера телефона")),
|
|
473
|
+
), Y(g, (s) => c("update:modelValue", s));
|
|
474
|
+
const f = A(() => u.language ?? "ru"), B = (s) => Ie[f.value] && Ie[f.value][s] || (u.title ?? s), W = A(() => u.title ?? B("Смена номера телефона")), G = A(() => u.hintText ?? B("Чтобы продолжить, введите новый номер")), e = ce({
|
|
485
475
|
oldPhone: u.initialPhone ?? "",
|
|
486
476
|
newPhone: "",
|
|
487
477
|
code: "",
|
|
488
478
|
addPhone: "",
|
|
489
479
|
addCode: ""
|
|
490
|
-
}), M = O(j.OLD), C = O(null), y = O(!1), x = O(!1), i = O("tg"), h = A(() => i.value === "tg"), v = O(!1), { startTimer:
|
|
480
|
+
}), M = O(j.OLD), C = O(null), y = O(!1), x = O(!1), i = O("tg"), h = A(() => i.value === "tg"), v = O(!1), { startTimer: J, remainingSeconds: n, isAvailableForSendAgain: o, totalRateAttempts: l, currentRateAttempt: te } = qe(), { showRateLimitToast: Q } = He(c), { isEditFlow: Z, getFlow: pe } = We(O(u.mode)), ie = A(() => o.value ? "Повторить" : `${n.value}`), le = O(se), de = A(() => le.value === 0), Re = (s) => new Promise((a) => setTimeout(a, s));
|
|
491
481
|
async function he(s = "email") {
|
|
492
|
-
var
|
|
493
|
-
return (
|
|
482
|
+
var t;
|
|
483
|
+
return (t = (await Oe("/users/profile/session/get-edit-session", { params: { field: s } })).data) == null ? void 0 : t.data;
|
|
494
484
|
}
|
|
495
485
|
async function Ce(s = "phone") {
|
|
496
486
|
var V;
|
|
497
|
-
const
|
|
487
|
+
const t = (V = (await ee("/users/profile/session/create-if-not-exists", {
|
|
498
488
|
field: s,
|
|
499
|
-
oldValue:
|
|
489
|
+
oldValue: R(u.initialPhone)
|
|
500
490
|
})).data) == null ? void 0 : V.data;
|
|
501
|
-
C.value = (
|
|
491
|
+
C.value = (t == null ? void 0 : t.sessionId) ?? null, M.value = (t == null ? void 0 : t.step) ?? j.OLD, e.oldPhone = (t == null ? void 0 : t.oldValue) ?? "", e.newPhone = (t == null ? void 0 : t.newValue) ?? "";
|
|
502
492
|
}
|
|
503
|
-
async function
|
|
493
|
+
async function Ne() {
|
|
504
494
|
try {
|
|
505
495
|
const s = await he("phone");
|
|
506
496
|
C.value = s.sessionId, M.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
|
|
@@ -509,13 +499,13 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
509
499
|
}
|
|
510
500
|
}
|
|
511
501
|
async function we(s, a = !1) {
|
|
512
|
-
var
|
|
502
|
+
var t;
|
|
513
503
|
try {
|
|
514
|
-
const V = await
|
|
504
|
+
const V = await ee(
|
|
515
505
|
"/users/profile/check-throttler",
|
|
516
506
|
{
|
|
517
507
|
method: "sms",
|
|
518
|
-
phone:
|
|
508
|
+
phone: R(s),
|
|
519
509
|
isInvite: a
|
|
520
510
|
},
|
|
521
511
|
{
|
|
@@ -524,24 +514,24 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
524
514
|
}
|
|
525
515
|
}
|
|
526
516
|
);
|
|
527
|
-
await
|
|
528
|
-
const w = (
|
|
529
|
-
return w ? (w.restTimeSec > 0 ? (
|
|
517
|
+
await Re(1e3);
|
|
518
|
+
const w = (t = V.data) == null ? void 0 : t.data;
|
|
519
|
+
return w ? (w.restTimeSec > 0 ? (J(w.restTimeSec), o.value = !1, l.value = w.attempts.total, te.value = w.attempts.total - w.attempts.available, le.value = w.attempts.available ?? se) : o.value = !0, w) : null;
|
|
530
520
|
} catch {
|
|
531
521
|
return null;
|
|
532
522
|
}
|
|
533
523
|
}
|
|
534
|
-
const ve = async ({ phone: s }) => (v.value = !0, await
|
|
535
|
-
var V, w, L, D,
|
|
524
|
+
const ve = async ({ phone: s }) => (v.value = !0, await _({ value: s, isOnlySms: !0 })), _ = async ({ value: s, isOnlySms: a, offLoading: t } = {}) => {
|
|
525
|
+
var V, w, L, D, F, $;
|
|
536
526
|
y.value = !0;
|
|
537
527
|
try {
|
|
538
|
-
const m = s ?? e.oldPhone, d = await
|
|
528
|
+
const m = s ?? e.oldPhone, d = await ee(
|
|
539
529
|
"/users/profile/phone/contact/send-code",
|
|
540
530
|
{
|
|
541
531
|
sessionId: C.value,
|
|
542
|
-
phone:
|
|
543
|
-
value:
|
|
544
|
-
oldValue:
|
|
532
|
+
phone: R(m),
|
|
533
|
+
value: R(m),
|
|
534
|
+
oldValue: R(e.oldPhone),
|
|
545
535
|
provider: u.provider,
|
|
546
536
|
isOnlySms: a ?? !1
|
|
547
537
|
},
|
|
@@ -555,35 +545,35 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
555
545
|
const P = (w = (V = d == null ? void 0 : d.data) == null ? void 0 : V.data) == null ? void 0 : w.deliveryType;
|
|
556
546
|
if ((P === "tg" || P === "sms") && (i.value = P, P === "tg" && (v.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", d), (d == null ? void 0 : d.status) === 403 && ((L = d.data) != null && L.tooManyRequests)) {
|
|
557
547
|
console.debug("sendContactCode IN обработка 403 tooManyRequests", d);
|
|
558
|
-
const I = (
|
|
548
|
+
const I = (F = (D = d.data) == null ? void 0 : D.tooManyRequests) == null ? void 0 : F.type;
|
|
559
549
|
i.value = I;
|
|
560
550
|
const U = d.data.tooManyRequests;
|
|
561
|
-
return U.restTimeSec > 0 ? (
|
|
551
|
+
return U.restTimeSec > 0 ? (J(U.restTimeSec), l.value = U.attempts.total, te.value = U.attempts.total - U.attempts.available, le.value = U.attempts.available ?? se) : o.value = !0, d;
|
|
562
552
|
}
|
|
563
553
|
return console.debug("sendContactCode after обработка 403 tooManyRequests", d), await we(m), d;
|
|
564
554
|
} catch (m) {
|
|
565
555
|
const d = ($ = m == null ? void 0 : m.data) == null ? void 0 : $.tooManyRequests;
|
|
566
556
|
if ((m == null ? void 0 : m.status) === 403 && d) {
|
|
567
557
|
const { restTimeSec: P, attempts: I } = d;
|
|
568
|
-
return P > 0 ? (
|
|
558
|
+
return P > 0 ? (J(P), l.value = I.total, te.value = I.total - I.available, le.value = I.available ?? se) : o.value = !0, m;
|
|
569
559
|
}
|
|
570
560
|
throw m;
|
|
571
561
|
} finally {
|
|
572
|
-
y.value = !1,
|
|
562
|
+
y.value = !1, t && (y.value = !1);
|
|
573
563
|
}
|
|
574
564
|
}, Pe = async (s, a) => {
|
|
575
|
-
var
|
|
565
|
+
var t, V, w, L, D, F, $, m;
|
|
576
566
|
y.value = !0;
|
|
577
567
|
try {
|
|
578
568
|
const d = await he("phone");
|
|
579
569
|
C.value = d.sessionId, M.value = d.step, e.oldPhone = d.oldValue ?? e.oldPhone, e.newPhone = d.newValue ?? e.newPhone;
|
|
580
|
-
const P = await
|
|
581
|
-
phone: a === j.NEW ?
|
|
570
|
+
const P = await ee("/users/profile/change/phone/match-code", {
|
|
571
|
+
phone: a === j.NEW ? R(e.newPhone) : R(e.oldPhone),
|
|
582
572
|
sessionId: C.value,
|
|
583
573
|
code: s,
|
|
584
574
|
step: a
|
|
585
|
-
}), I = ((
|
|
586
|
-
if (
|
|
575
|
+
}), I = ((t = P.data) == null ? void 0 : t.nextStep) ?? ((w = (V = P.data) == null ? void 0 : V.data) == null ? void 0 : w.nextStep), U = ((D = (L = P.data) == null ? void 0 : L.data) == null ? void 0 : D.rateLimit) ?? ((F = P.data) == null ? void 0 : F.rateLimit) ?? null, Fe = (($ = P.data) == null ? void 0 : $.data.success) ?? ((m = P.data) == null ? void 0 : m.success);
|
|
576
|
+
if (Q(U), !Fe) {
|
|
587
577
|
x.value = !0;
|
|
588
578
|
return;
|
|
589
579
|
}
|
|
@@ -606,30 +596,30 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
606
596
|
c("close"), g.value = !1;
|
|
607
597
|
};
|
|
608
598
|
async function be(s = "phone") {
|
|
609
|
-
var
|
|
610
|
-
return (
|
|
599
|
+
var t;
|
|
600
|
+
return (t = (await Oe("/users/profile/session/get-bind-session", { params: { field: s } })).data) == null ? void 0 : t.data;
|
|
611
601
|
}
|
|
612
602
|
async function Ve({
|
|
613
603
|
value: s,
|
|
614
604
|
field: a = "phone",
|
|
615
|
-
offLoading:
|
|
605
|
+
offLoading: t = !0
|
|
616
606
|
}) {
|
|
617
607
|
var V, w, L;
|
|
618
608
|
y.value = !0;
|
|
619
609
|
try {
|
|
620
610
|
if (!C.value) {
|
|
621
|
-
const D = await
|
|
611
|
+
const D = await ee("/users/profile/session/bind/create", {
|
|
622
612
|
field: a,
|
|
623
|
-
newValue:
|
|
613
|
+
newValue: R(s || e.addPhone)
|
|
624
614
|
});
|
|
625
615
|
if (C.value = ((w = (V = D.data) == null ? void 0 : V.data) == null ? void 0 : w.sessionId) ?? ((L = D.data) == null ? void 0 : L.sessionId) ?? null, !C.value)
|
|
626
616
|
throw new Error("не удалось создать bind-сессию (sessionId отсутствует)");
|
|
627
617
|
}
|
|
628
618
|
} finally {
|
|
629
|
-
|
|
619
|
+
t && (y.value = !1);
|
|
630
620
|
}
|
|
631
621
|
}
|
|
632
|
-
async function
|
|
622
|
+
async function ze() {
|
|
633
623
|
try {
|
|
634
624
|
const s = await be("phone");
|
|
635
625
|
C.value = s.sessionId, M.value = s.step, e.addPhone = s.newValue ?? "", s.sessionId || await Ve({ field: "phone", value: e.addPhone });
|
|
@@ -640,7 +630,7 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
640
630
|
const me = async ({
|
|
641
631
|
value: s,
|
|
642
632
|
field: a = "phone",
|
|
643
|
-
isOnlySms:
|
|
633
|
+
isOnlySms: t = !1,
|
|
644
634
|
offLoading: V = !0
|
|
645
635
|
} = {}) => {
|
|
646
636
|
var w, L, D;
|
|
@@ -648,17 +638,17 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
648
638
|
try {
|
|
649
639
|
if (!C.value)
|
|
650
640
|
throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
|
|
651
|
-
const
|
|
641
|
+
const F = s ?? e.addPhone, $ = await ee(
|
|
652
642
|
`/users/profile/bind/contact/send-code/${a}`,
|
|
653
643
|
{
|
|
654
644
|
sessionId: C.value,
|
|
655
|
-
phone:
|
|
645
|
+
phone: R(F),
|
|
656
646
|
provider: u.provider,
|
|
657
|
-
isOnlySms:
|
|
647
|
+
isOnlySms: t ?? !1
|
|
658
648
|
},
|
|
659
649
|
{
|
|
660
650
|
headers: {
|
|
661
|
-
"x-only-sms":
|
|
651
|
+
"x-only-sms": t ?? !1
|
|
662
652
|
}
|
|
663
653
|
}
|
|
664
654
|
), m = (L = (w = $ == null ? void 0 : $.data) == null ? void 0 : w.data) == null ? void 0 : L.deliveryType;
|
|
@@ -666,27 +656,27 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
666
656
|
const d = (D = $.data) == null ? void 0 : D.tooManyRequests;
|
|
667
657
|
if ($.status === 403 && d) {
|
|
668
658
|
const I = d == null ? void 0 : d.type;
|
|
669
|
-
return i.value = I, d.restTimeSec > 0 ? (
|
|
659
|
+
return i.value = I, d.restTimeSec > 0 ? (J(d.restTimeSec), l.value = d.attempts.total, te.value = d.attempts.total - d.attempts.available, le.value = d.attempts.available ?? se) : o.value = !0, $;
|
|
670
660
|
}
|
|
671
|
-
const P = await we(
|
|
672
|
-
return P && P.restTimeSec > 0 ? (
|
|
661
|
+
const P = await we(F);
|
|
662
|
+
return P && P.restTimeSec > 0 ? (J(P.restTimeSec), o.value = !1) : o.value = !0, $;
|
|
673
663
|
} finally {
|
|
674
664
|
V && (y.value = !1);
|
|
675
665
|
}
|
|
676
666
|
}, ke = async ({ code: s }) => {
|
|
677
|
-
var a,
|
|
667
|
+
var a, t, V, w, L, D, F, $;
|
|
678
668
|
y.value = !0;
|
|
679
669
|
try {
|
|
680
670
|
if (!C.value) {
|
|
681
671
|
const U = await be("phone");
|
|
682
672
|
C.value = U.sessionId, e.addPhone = U.newValue ?? e.addPhone;
|
|
683
673
|
}
|
|
684
|
-
const m = await
|
|
685
|
-
phone:
|
|
674
|
+
const m = await ee("/users/profile/bind/phone/match-code", {
|
|
675
|
+
phone: R(e.addPhone),
|
|
686
676
|
sessionId: C.value,
|
|
687
677
|
code: s
|
|
688
|
-
}), d = ((a = m.data) == null ? void 0 : a.nextStep) ?? ((V = (
|
|
689
|
-
if (
|
|
678
|
+
}), d = ((a = m.data) == null ? void 0 : a.nextStep) ?? ((V = (t = m.data) == null ? void 0 : t.data) == null ? void 0 : V.nextStep), P = ((L = (w = m.data) == null ? void 0 : w.data) == null ? void 0 : L.rateLimit) ?? ((D = m.data) == null ? void 0 : D.rateLimit) ?? null, I = ((F = m.data) == null ? void 0 : F.data.success) ?? (($ = m.data) == null ? void 0 : $.success);
|
|
679
|
+
if (Q(P), !I) {
|
|
690
680
|
x.value = !0;
|
|
691
681
|
return;
|
|
692
682
|
}
|
|
@@ -700,21 +690,21 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
700
690
|
y.value = !0;
|
|
701
691
|
const s = await pe("phone");
|
|
702
692
|
if (u.mode === "bind" && s === "bind") {
|
|
703
|
-
await
|
|
693
|
+
await ze(), y.value = !1;
|
|
704
694
|
return;
|
|
705
695
|
}
|
|
706
|
-
await
|
|
696
|
+
await Ne(), await _({});
|
|
707
697
|
}), b({
|
|
708
698
|
localVisible: g,
|
|
709
699
|
form: e,
|
|
710
700
|
currentStep: M,
|
|
711
701
|
loading: y,
|
|
712
|
-
rateLimitText:
|
|
702
|
+
rateLimitText: ie,
|
|
713
703
|
isAvailable: de,
|
|
714
704
|
title: W,
|
|
715
|
-
hintText:
|
|
705
|
+
hintText: G,
|
|
716
706
|
handleClose: re,
|
|
717
|
-
sendContactCode:
|
|
707
|
+
sendContactCode: _,
|
|
718
708
|
sendBindContactCode: me,
|
|
719
709
|
handleOldCodeSuccess: Te,
|
|
720
710
|
handleOldCodeError: Se,
|
|
@@ -723,10 +713,10 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
723
713
|
matchBindCode: ke,
|
|
724
714
|
matchBindCodeError: Ee
|
|
725
715
|
}), (s, a) => (p(), T(je, null, [
|
|
726
|
-
S(r(
|
|
716
|
+
S(r(Je), {
|
|
727
717
|
modelValue: g.value,
|
|
728
718
|
"onUpdate:modelValue": [
|
|
729
|
-
a[15] || (a[15] = (
|
|
719
|
+
a[15] || (a[15] = (t) => g.value = t),
|
|
730
720
|
re
|
|
731
721
|
],
|
|
732
722
|
width: "small",
|
|
@@ -734,18 +724,18 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
734
724
|
"close-on-click-outside": !0,
|
|
735
725
|
"onClick:outside": re
|
|
736
726
|
}, {
|
|
737
|
-
header:
|
|
738
|
-
|
|
739
|
-
S(r(
|
|
727
|
+
header: K(() => [
|
|
728
|
+
z("div", Mt, [
|
|
729
|
+
S(r(Ke), {
|
|
740
730
|
"slot-left": !1,
|
|
741
731
|
size: "small",
|
|
742
732
|
borded: !0,
|
|
743
733
|
"no-padding": !1
|
|
744
734
|
}, {
|
|
745
|
-
title:
|
|
746
|
-
|
|
735
|
+
title: K(() => [
|
|
736
|
+
z("span", xt, q(r(Z) ? W.value : "Добавление номера телефона"), 1)
|
|
747
737
|
]),
|
|
748
|
-
"right-button":
|
|
738
|
+
"right-button": K(() => [
|
|
749
739
|
S(r(Qe), {
|
|
750
740
|
class: "cross",
|
|
751
741
|
onClick: re
|
|
@@ -755,65 +745,65 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
755
745
|
})
|
|
756
746
|
])
|
|
757
747
|
]),
|
|
758
|
-
default:
|
|
759
|
-
r(
|
|
760
|
-
y.value ? (p(),
|
|
761
|
-
M.value === r(j).OLD ? (p(),
|
|
748
|
+
default: K(() => [
|
|
749
|
+
r(Z) ? (p(), T("div", bt, [
|
|
750
|
+
y.value ? (p(), H(Be, { key: 0 })) : E("", !0),
|
|
751
|
+
M.value === r(j).OLD ? (p(), H(lt, {
|
|
762
752
|
key: 1,
|
|
763
753
|
phone: e.oldPhone,
|
|
764
|
-
"onUpdate:phone": a[0] || (a[0] = (
|
|
754
|
+
"onUpdate:phone": a[0] || (a[0] = (t) => e.oldPhone = t),
|
|
765
755
|
code: e.code,
|
|
766
|
-
"onUpdate:code": a[1] || (a[1] = (
|
|
767
|
-
"rate-limit-text":
|
|
756
|
+
"onUpdate:code": a[1] || (a[1] = (t) => e.code = t),
|
|
757
|
+
"rate-limit-text": ie.value,
|
|
768
758
|
"is-final-limit": de.value,
|
|
769
759
|
"is-not-match-code": x.value,
|
|
770
760
|
loading: y.value,
|
|
771
761
|
"is-tg": h.value,
|
|
772
|
-
onOnSendCode: a[2] || (a[2] = (
|
|
773
|
-
onOnSendCodeAgain: a[3] || (a[3] = (
|
|
762
|
+
onOnSendCode: a[2] || (a[2] = (t) => _({ value: e.oldPhone })),
|
|
763
|
+
onOnSendCodeAgain: a[3] || (a[3] = (t) => _({ value: e.oldPhone, isOnlySms: !h.value && v.value })),
|
|
774
764
|
onOnSendOnlySms: ve,
|
|
775
765
|
onOnMatchCode: Te,
|
|
776
766
|
onOnMatchCodeError: Se
|
|
777
|
-
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(j).NEW ? (p(),
|
|
767
|
+
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(j).NEW ? (p(), H(vt, {
|
|
778
768
|
key: 2,
|
|
779
769
|
phone: e.newPhone,
|
|
780
|
-
"onUpdate:phone": a[4] || (a[4] = (
|
|
770
|
+
"onUpdate:phone": a[4] || (a[4] = (t) => e.newPhone = t),
|
|
781
771
|
oldPhone: e.oldPhone,
|
|
782
|
-
"onUpdate:oldPhone": a[5] || (a[5] = (
|
|
772
|
+
"onUpdate:oldPhone": a[5] || (a[5] = (t) => e.oldPhone = t),
|
|
783
773
|
code: e.code,
|
|
784
|
-
"onUpdate:code": a[6] || (a[6] = (
|
|
785
|
-
"hint-text":
|
|
786
|
-
"rate-limit-text":
|
|
774
|
+
"onUpdate:code": a[6] || (a[6] = (t) => e.code = t),
|
|
775
|
+
"hint-text": G.value,
|
|
776
|
+
"rate-limit-text": ie.value,
|
|
787
777
|
"is-final-limit": de.value,
|
|
788
778
|
"is-not-match-code": x.value,
|
|
789
779
|
loading: y.value,
|
|
790
780
|
"is-tg": h.value,
|
|
791
|
-
onOnSendCode: a[7] || (a[7] = (
|
|
792
|
-
onOnSendCodeAgain: a[8] || (a[8] = (
|
|
781
|
+
onOnSendCode: a[7] || (a[7] = (t) => _({ value: e.newPhone })),
|
|
782
|
+
onOnSendCodeAgain: a[8] || (a[8] = (t) => _({ value: e.newPhone, isOnlySms: !h.value && v.value })),
|
|
793
783
|
onOnSendOnlySms: ve,
|
|
794
784
|
onOnMatchCode: Me,
|
|
795
785
|
onOnMatchCodeError: xe,
|
|
796
|
-
onOnClearCodeError: a[9] || (a[9] = (
|
|
797
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(j).COMPLETED ? (p(), T("div",
|
|
798
|
-
|
|
786
|
+
onOnClearCodeError: a[9] || (a[9] = (t) => x.value = !1)
|
|
787
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(j).COMPLETED ? (p(), T("div", Vt, [
|
|
788
|
+
z("p", null, q(B("Телефон успешно изменен")), 1)
|
|
799
789
|
])) : E("", !0)
|
|
800
|
-
])) : (p(), T("div",
|
|
801
|
-
y.value ? (p(),
|
|
802
|
-
S(
|
|
790
|
+
])) : (p(), T("div", kt, [
|
|
791
|
+
y.value ? (p(), H(Be, { key: 0 })) : E("", !0),
|
|
792
|
+
S(St, {
|
|
803
793
|
phone: e.addPhone,
|
|
804
|
-
"onUpdate:phone": a[10] || (a[10] = (
|
|
794
|
+
"onUpdate:phone": a[10] || (a[10] = (t) => e.addPhone = t),
|
|
805
795
|
oldPhone: e.oldPhone,
|
|
806
|
-
"onUpdate:oldPhone": a[11] || (a[11] = (
|
|
796
|
+
"onUpdate:oldPhone": a[11] || (a[11] = (t) => e.oldPhone = t),
|
|
807
797
|
code: e.addCode,
|
|
808
|
-
"onUpdate:code": a[12] || (a[12] = (
|
|
809
|
-
"hint-text": r(
|
|
810
|
-
"rate-limit-text":
|
|
798
|
+
"onUpdate:code": a[12] || (a[12] = (t) => e.addCode = t),
|
|
799
|
+
"hint-text": r(Z) ? G.value : "Чтобы продолжить, введите новый номер",
|
|
800
|
+
"rate-limit-text": ie.value,
|
|
811
801
|
"is-final-limit": de.value,
|
|
812
802
|
"is-not-match-code": x.value,
|
|
813
803
|
loading: y.value,
|
|
814
804
|
"is-tg": h.value,
|
|
815
|
-
onOnSendCode: a[13] || (a[13] = (
|
|
816
|
-
onOnSendCodeAgain: a[14] || (a[14] = (
|
|
805
|
+
onOnSendCode: a[13] || (a[13] = (t) => me({ value: e.addPhone, field: "phone" })),
|
|
806
|
+
onOnSendCodeAgain: a[14] || (a[14] = (t) => me({ value: e.addPhone, field: "phone", isOnlySms: !h.value && v.value })),
|
|
817
807
|
onOnSendOnlySms: ve,
|
|
818
808
|
onOnMatchCode: ke,
|
|
819
809
|
onOnMatchCodeError: Ee
|
|
@@ -827,5 +817,5 @@ const se = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
827
817
|
}
|
|
828
818
|
});
|
|
829
819
|
export {
|
|
830
|
-
|
|
820
|
+
Ot as default
|
|
831
821
|
};
|
|
@@ -213,9 +213,9 @@ const Ze = {
|
|
|
213
213
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
214
214
|
setup(m, { emit: r }) {
|
|
215
215
|
const n = r, s = h(!0), { currentDialog: v, dialogPayload: g, closeDialog: U } = K(), l = {
|
|
216
|
-
email: G(() => import("./ProfileEmailDialog-
|
|
217
|
-
phone: G(() => import("./ProfilePhoneDialog-
|
|
218
|
-
password: G(() => import("./ProfilePasswordDialog-
|
|
216
|
+
email: G(() => import("./ProfileEmailDialog-Dk-u5rNg.js")),
|
|
217
|
+
phone: G(() => import("./ProfilePhoneDialog-CuGntlD2.js")),
|
|
218
|
+
password: G(() => import("./ProfilePasswordDialog-Xat_KwgU.js"))
|
|
219
219
|
}, d = ({ email: y }) => {
|
|
220
220
|
n("update-email-field", y);
|
|
221
221
|
}, p = ({ phone: y }) => {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-wrapper[data-v-0fcb1c3e] .p-avatar__overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-0fcb1c3e]:hover .p-avatar__overlay{opacity:1!important}.avatar-wrapper[data-v-0fcb1c3e] .wide-img .overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-0fcb1c3e]:hover .wide-img .overlay{opacity:1!important}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { a as o } from "./index-
|
|
2
|
+
import { a as o } from "./index-CeaygNy8.js";
|
|
3
3
|
export {
|
|
4
4
|
o as PEditUserContact
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as l, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as r, createVNode as E, unref as F, computed as T, renderSlot as m, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
|
|
2
2
|
import { PLoader as w } from "@profeat/ui-kit";
|
|
3
|
-
import { _ as g, g as R, p as h } from "./index-
|
|
3
|
+
import { _ as g, g as R, p as h } from "./index-CeaygNy8.js";
|
|
4
4
|
function C(e) {
|
|
5
5
|
const t = Math.floor(e / 60), a = e % 60;
|
|
6
6
|
return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|