@yourgoods/ui-smart 0.49.0 → 0.50.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.
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as ie, ref as x, reactive as Z, watch as Y, computed as b, toRefs as ce, createElementBlock as I, openBlock as w, createElementVNode as B, createCommentVNode as D, toDisplayString as ee, createVNode as $, unref as u, isRef as te, withCtx as G, createTextVNode as ne, Fragment as Ae, createBlock as _, resolveDynamicComponent as he, onMounted as Fe } from "vue";
2
- import { T as ve, c as $e, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-_WymxlzB.js";
3
- import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-3V186vCD.js";
2
+ import { T as ve, c as $e, u as Re, a as ze, P as Te, b as We } from "./useRateLimitToast-BDwiUmEF.js";
3
+ import { C as R, _ as He, B as _e, p as H, g as qe } from "./index-B03tgxbV.js";
4
4
  import { PInput as J, IconMailMd as pe, PButton as se, IconEyeMd as Me, IconEyeClosedMd as Ve, PDialog as je, PTopBar as Ge, IconCrossMd as Ye } from "@profeat/ui-kit";
5
5
  const Je = { class: "dialogDefaultContainerInsideContent" }, Ke = { class: "dialogDefaultContainerTextHint" }, Qe = {
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-3V186vCD.js";
2
+ import { C as I, p as D, g as Ve } from "./index-B03tgxbV.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,7 +1,7 @@
1
- import { createElementBlock as x, openBlock as p, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as O, toRefs as Ce, computed as L, createCommentVNode as B, createVNode as b, toDisplayString as G, createBlock as J, createTextVNode as Z, unref as i, isRef as le, withCtx as X, onMounted as We, Fragment as je } from "vue";
2
- import { T as we, c as Ae, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-_WymxlzB.js";
3
- import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Ke, IconMailMd as Ne, PButton as qe, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
4
- import { C as j, t as De, p as te, g as Re } from "./index-3V186vCD.js";
1
+ import { createElementBlock as S, openBlock as v, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as O, toRefs as Ce, computed as L, createCommentVNode as B, createVNode as x, toDisplayString as G, createBlock as J, createTextVNode as Z, unref as r, isRef as le, withCtx as X, onMounted as We, Fragment as je } from "vue";
2
+ import { T as we, c as Ae, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-BDwiUmEF.js";
3
+ import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Ke, IconMailMd as Ne, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
4
+ import { C as j, t as De, p as te, g as Re } from "./index-B03tgxbV.js";
5
5
  const _e = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
@@ -9,7 +9,7 @@ const _e = {
9
9
  fill: "none"
10
10
  };
11
11
  function et(U, V) {
12
- return p(), x("svg", _e, V[0] || (V[0] = [
12
+ return v(), S("svg", _e, V[0] || (V[0] = [
13
13
  H("path", {
14
14
  fill: "#1C7EF1",
15
15
  "fill-rule": "evenodd",
@@ -43,85 +43,85 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
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
45
  setup(U, { emit: V }) {
46
- const E = U, r = V, u = ve({
46
+ const E = U, u = V, p = ve({
47
47
  touched: { phone: !1, code: !1 },
48
48
  phoneModel: E.phone,
49
49
  codeModel: E.code
50
50
  });
51
51
  _(
52
- () => u.phoneModel,
53
- (h) => r("update:phone", h)
52
+ () => p.phoneModel,
53
+ (m) => u("update:phone", m)
54
54
  ), _(
55
- () => u.codeModel,
56
- (h) => r("update:code", h)
55
+ () => p.codeModel,
56
+ (m) => u("update:code", m)
57
57
  );
58
- const v = (h) => {
59
- u.touched[h] = !0;
58
+ const y = (m) => {
59
+ p.touched[m] = !0;
60
60
  };
61
- let c = O("");
62
- const z = (h) => {
63
- const m = h.target;
64
- let d = ((m == null ? void 0 : m.value) ?? "").replace(/\D/g, "");
65
- d.length < 4 && r("on-clear-code-error"), d.length > 4 && (d = d.slice(0, 4)), k.value = d, m && m.value !== d && (m.value = d), d.length === 4 && d !== c.value && (c.value = d, r("on-match-code", { phone: e.value, code: d }));
66
- }, Y = () => r("on-send-code-again", { phone: u.phoneModel }), K = () => {
67
- console.debug("onSendCodeViaSms"), r("on-send-only-sms", { phone: u.phoneModel });
68
- }, { phoneModel: e, codeModel: k, touched: T } = Ce(u), g = L(() => T.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), D = L(() => E.isNotMatchCode ? "Неверный код" : T.value.code ? k.value.trim() ? E.codeError ?? null : "Введите код" : "");
69
- return (h, m) => (p(), x("div", tt, [
61
+ let h = O("");
62
+ const z = (m) => {
63
+ const g = m.target;
64
+ let i = ((g == null ? void 0 : g.value) ?? "").replace(/\D/g, "");
65
+ i.length < 4 && u("on-clear-code-error"), i.length > 4 && (i = i.slice(0, 4)), k.value = i, g && g.value !== i && (g.value = i), i.length === 4 && i !== h.value && (h.value = i, u("on-match-code", { phone: e.value, code: i }));
66
+ }, Y = () => u("on-send-code-again", { phone: p.phoneModel }), K = () => {
67
+ console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: p.phoneModel });
68
+ }, { phoneModel: e, codeModel: k, touched: P } = Ce(p), C = L(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), D = L(() => E.isNotMatchCode ? "Неверный код" : P.value.code ? k.value.trim() ? E.codeError ?? null : "Введите код" : "");
69
+ return (m, g) => (v(), S("div", tt, [
70
70
  H("div", ot, [
71
- H("div", nt, G(h.hintText), 1),
71
+ H("div", nt, G(m.hintText), 1),
72
72
  H("div", at, [
73
- h.isTg ? (p(), J(i(Pe), { key: 0 })) : (p(), J(i(de), {
73
+ m.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
74
74
  key: 1,
75
75
  style: { "margin-left": "5px" }
76
76
  })),
77
- Z(" " + G(h.isTg ? "Telegram" : "СМС"), 1)
77
+ Z(" " + G(m.isTg ? "Telegram" : "СМС"), 1)
78
78
  ])
79
79
  ]),
80
- h.showPhone ? (p(), x("div", lt, [
81
- b(i(se), {
82
- modelValue: i(e),
83
- "onUpdate:modelValue": m[0] || (m[0] = (d) => le(e) ? e.value = d : null),
80
+ m.showPhone ? (v(), S("div", lt, [
81
+ x(r(se), {
82
+ modelValue: r(e),
83
+ "onUpdate:modelValue": g[0] || (g[0] = (i) => le(e) ? e.value = i : null),
84
84
  size: "large",
85
85
  "text-size": "medium",
86
86
  label: "Телефон",
87
87
  type: "tel",
88
- error: g.value,
88
+ error: C.value,
89
89
  disabled: !0,
90
- onBlur: m[1] || (m[1] = (d) => v("phone")),
91
- onInput: m[2] || (m[2] = (d) => v("phone"))
90
+ onBlur: g[1] || (g[1] = (i) => y("phone")),
91
+ onInput: g[2] || (g[2] = (i) => y("phone"))
92
92
  }, null, 8, ["modelValue", "error"]),
93
- b(i(Ke), {
93
+ x(r(Ke), {
94
94
  class: "icon-locked",
95
- onClick: m[3] || (m[3] = (d) => h.$emit("edit", "phone"))
95
+ onClick: g[3] || (g[3] = (i) => m.$emit("edit", "phone"))
96
96
  })
97
97
  ])) : B("", !0),
98
- h.showCode ? (p(), x("div", st, [
99
- b(i(se), {
100
- modelValue: i(k),
101
- "onUpdate:modelValue": m[4] || (m[4] = (d) => le(k) ? k.value = d : null),
98
+ m.showCode ? (v(), S("div", st, [
99
+ x(r(se), {
100
+ modelValue: r(k),
101
+ "onUpdate:modelValue": g[4] || (g[4] = (i) => le(k) ? k.value = i : null),
102
102
  size: "large",
103
103
  "text-size": "medium",
104
104
  label: "Код",
105
105
  type: "text",
106
106
  error: D.value,
107
107
  onInput: z,
108
- onBlur: m[5] || (m[5] = (d) => v("code"))
108
+ onBlur: g[5] || (g[5] = (i) => y("code"))
109
109
  }, null, 8, ["modelValue", "error"])
110
110
  ])) : B("", !0),
111
- b(we, {
112
- loading: h.loading,
113
- "rate-limit-text": h.rateLimitText,
114
- "is-final-limit": h.isFinalLimit,
111
+ x(we, {
112
+ loading: m.loading,
113
+ "rate-limit-text": m.rateLimitText,
114
+ "is-final-limit": m.isFinalLimit,
115
115
  "on-send-again": Y
116
116
  }, {
117
117
  extra: X(() => [
118
- h.isTg ? (p(), x("span", {
118
+ m.isTg ? (v(), S("span", {
119
119
  key: 0,
120
120
  class: "dialogDefaultContainerSendCodeBySmsText",
121
121
  onClick: K
122
122
  }, [
123
- Z(G(h.sendCodeBySmsText) + " ", 1),
124
- b(i(de), { style: { "margin-left": "5px" } })
123
+ Z(G(m.sendCodeBySmsText) + " ", 1),
124
+ x(r(de), { style: { "margin-left": "5px" } })
125
125
  ])) : B("", !0)
126
126
  ]),
127
127
  _: 1
@@ -167,77 +167,77 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
167
167
  },
168
168
  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
169
  setup(U, { emit: V }) {
170
- const E = U, r = V, u = O(!1), v = O(""), c = ve({
170
+ const E = U, u = V, p = O(!1), y = O(""), h = ve({
171
171
  touched: { phone: !1, code: !1 },
172
172
  phoneModel: "",
173
173
  codeModel: ""
174
174
  });
175
175
  _(
176
- () => c.phoneModel,
176
+ () => h.phoneModel,
177
177
  (t) => {
178
- r("update:phone", t), v.value = "";
178
+ u("update:phone", t), y.value = "";
179
179
  }
180
180
  ), _(
181
- () => c.codeModel,
182
- (t) => r("update:code", t)
181
+ () => h.codeModel,
182
+ (t) => u("update:code", t)
183
183
  );
184
- const z = (t) => c.touched[t] = !0, Y = (t) => c.touched[t] = !1, K = () => {
185
- v.value = "", Y("phone");
184
+ const z = (t) => h.touched[t] = !0, Y = (t) => h.touched[t] = !1, K = () => {
185
+ y.value = "", Y("phone");
186
186
  }, e = L(() => {
187
- const n = c.phoneModel.trim().replace(/[()\-\s]/g, "");
187
+ const n = h.phoneModel.trim().replace(/[()\-\s]/g, "");
188
188
  return /^\+?\d{10,15}$/.test(n);
189
- }), k = L(() => !e.value || !!v.value), T = async () => {
189
+ }), k = L(() => !e.value || !!y.value), P = async () => {
190
190
  var t;
191
191
  try {
192
192
  if (z("phone"), !e.value) {
193
- v.value = "Это не похоже на номер телефона";
193
+ y.value = "Это не похоже на номер телефона";
194
194
  return;
195
195
  }
196
- const n = await Ae(void 0, F(c.phoneModel)), { data: s } = n.data;
196
+ const n = await Ae(void 0, F(h.phoneModel)), { data: s } = n.data;
197
197
  if (console.debug("result for checkAvailability: ", {
198
198
  res: n,
199
199
  data: s
200
200
  }), !(((t = s.data[0]) == null ? void 0 : t.available) ?? !1)) {
201
- v.value = "Такой номер уже используется";
201
+ y.value = "Такой номер уже используется";
202
202
  return;
203
203
  }
204
- v.value = "", r("on-send-code", { phone: c.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), u.value = !0;
204
+ y.value = "", u("on-send-code", { phone: h.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), p.value = !0;
205
205
  } catch (n) {
206
- console.error("Неизвестная ошибка при проверке доступности телефона:", n), v.value = "Это не похоже на номер телефона";
206
+ console.error("Неизвестная ошибка при проверке доступности телефона:", n), y.value = "Это не похоже на номер телефона";
207
207
  }
208
208
  };
209
- let g = O("");
209
+ let C = O("");
210
210
  const D = (t) => {
211
211
  const n = t.target;
212
212
  let s = ((n == null ? void 0 : n.value) ?? "").replace(/\D/g, "");
213
- s.length < 4 && r("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), I.value = s, n && n.value !== s && (n.value = s), s.length === 4 && s !== g.value && (g.value = s, r("on-match-code", { phone: d.value, code: s }));
214
- }, h = () => {
215
- r("on-send-code-again", { phone: c.phoneModel });
213
+ s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), I.value = s, n && n.value !== s && (n.value = s), s.length === 4 && s !== C.value && (C.value = s, u("on-match-code", { phone: i.value, code: s }));
216
214
  }, m = () => {
217
- console.debug("onSendCodeViaSms"), r("on-send-only-sms", { phone: c.phoneModel });
218
- }, { phoneModel: d, codeModel: I, touched: ie } = Ce(c), R = L(() => {
219
- if (v.value) return v.value;
220
- if (c.touched.phone) {
221
- if (!c.phoneModel.trim()) return "Введите номер телефона";
215
+ u("on-send-code-again", { phone: h.phoneModel });
216
+ }, g = () => {
217
+ console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: h.phoneModel });
218
+ }, { phoneModel: i, codeModel: I, touched: ie } = Ce(h), R = L(() => {
219
+ if (y.value) return y.value;
220
+ if (h.touched.phone) {
221
+ if (!h.phoneModel.trim()) return "Введите номер телефона";
222
222
  if (!e.value) return "Это не похоже на номер телефона";
223
223
  }
224
224
  return E.phoneError || "";
225
225
  }), Q = L(() => E.isNotMatchCode ? "Неверный код" : ie.value.code ? I.value.trim() ? E.codeError ?? null : "Введите код" : "");
226
- return (t, n) => (p(), x("div", it, [
226
+ return (t, n) => (v(), S("div", it, [
227
227
  H("div", rt, [
228
- H("div", ut, G(u.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
229
- u.value ? (p(), x("div", ct, [
230
- t.isTg ? (p(), J(i(Pe), { key: 0 })) : (p(), J(i(de), {
228
+ H("div", ut, G(p.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
229
+ p.value ? (v(), S("div", ct, [
230
+ t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
231
231
  key: 1,
232
232
  style: { "margin-left": "5px" }
233
233
  })),
234
234
  Z(" " + G(t.isTg ? "Telegram" : "СМС"), 1)
235
235
  ])) : B("", !0)
236
236
  ]),
237
- t.showPhone ? (p(), x("div", pt, [
238
- b(i(se), {
239
- modelValue: i(d),
240
- "onUpdate:modelValue": n[0] || (n[0] = (s) => le(d) ? d.value = s : null),
237
+ t.showPhone ? (v(), S("div", pt, [
238
+ x(r(se), {
239
+ modelValue: r(i),
240
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => le(i) ? i.value = s : null),
241
241
  size: "large",
242
242
  "text-size": "medium",
243
243
  label: "Телефон",
@@ -246,16 +246,16 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
246
246
  onBlur: n[1] || (n[1] = (s) => z("phone")),
247
247
  onInput: K
248
248
  }, null, 8, ["modelValue", "error"]),
249
- b(i(Ne), {
249
+ x(r(Ne), {
250
250
  class: "icon-locked",
251
251
  onClick: n[2] || (n[2] = (s) => t.$emit("edit", "phone"))
252
252
  })
253
253
  ])) : B("", !0),
254
- u.value ? B("", !0) : (p(), x("div", ht, [
255
- b(i(qe), {
254
+ p.value ? B("", !0) : (v(), S("div", ht, [
255
+ x(r(ze), {
256
256
  style: { width: "100%" },
257
257
  disabled: k.value,
258
- onClick: T
258
+ onClick: P
259
259
  }, {
260
260
  default: X(() => n[5] || (n[5] = [
261
261
  Z(" Отправить код ")
@@ -264,9 +264,9 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
264
264
  __: [5]
265
265
  }, 8, ["disabled"])
266
266
  ])),
267
- u.value ? (p(), x("div", vt, [
268
- b(i(se), {
269
- modelValue: i(I),
267
+ p.value ? (v(), S("div", vt, [
268
+ x(r(se), {
269
+ modelValue: r(I),
270
270
  "onUpdate:modelValue": n[3] || (n[3] = (s) => le(I) ? I.value = s : null),
271
271
  size: "large",
272
272
  "text-size": "medium",
@@ -277,21 +277,21 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
277
277
  onBlur: n[4] || (n[4] = (s) => z("code"))
278
278
  }, null, 8, ["modelValue", "error"])
279
279
  ])) : B("", !0),
280
- !t.loading && u.value ? (p(), x("div", mt, [
281
- b(we, {
280
+ !t.loading && p.value ? (v(), S("div", mt, [
281
+ x(we, {
282
282
  loading: t.loading,
283
283
  "rate-limit-text": t.rateLimitText,
284
284
  "is-final-limit": t.isFinalLimit,
285
- "on-send-again": h
285
+ "on-send-again": m
286
286
  }, {
287
287
  extra: X(() => [
288
- t.isTg ? (p(), x("span", {
288
+ t.isTg ? (v(), S("span", {
289
289
  key: 0,
290
290
  class: "dialogDefaultContainerSendCodeBySmsText",
291
- onClick: m
291
+ onClick: g
292
292
  }, [
293
293
  Z(G(t.sendCodeBySmsText) + " ", 1),
294
- b(i(de), { style: { "margin-left": "5px" } })
294
+ x(r(de), { style: { "margin-left": "5px" } })
295
295
  ])) : B("", !0)
296
296
  ]),
297
297
  _: 1
@@ -329,74 +329,74 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
329
329
  },
330
330
  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"],
331
331
  setup(U, { emit: V }) {
332
- const E = U, r = V, u = O(!1), v = O(""), c = ve({
332
+ const E = U, u = V, p = O(!1), y = O(""), h = ve({
333
333
  touched: { phone: !1, code: !1 },
334
334
  phoneModel: "",
335
335
  codeModel: ""
336
336
  });
337
337
  _(
338
- () => c.phoneModel,
338
+ () => h.phoneModel,
339
339
  (t) => {
340
- r("update:phone", t), v.value = "";
340
+ u("update:phone", t), y.value = "";
341
341
  }
342
342
  ), _(
343
- () => c.codeModel,
344
- (t) => r("update:code", t)
343
+ () => h.codeModel,
344
+ (t) => u("update:code", t)
345
345
  );
346
- const z = (t) => c.touched[t] = !0, Y = (t) => c.touched[t] = !1, K = () => {
347
- v.value = "", Y("phone");
346
+ const z = (t) => h.touched[t] = !0, Y = (t) => h.touched[t] = !1, K = () => {
347
+ y.value = "", Y("phone");
348
348
  }, e = L(() => {
349
- const n = c.phoneModel.trim().replace(/[()\-\s]/g, "");
349
+ const n = h.phoneModel.trim().replace(/[()\-\s]/g, "");
350
350
  return /^\+?\d{10,15}$/.test(n);
351
- }), k = L(() => !e.value || !!v.value), T = async () => {
351
+ }), k = L(() => !e.value || !!y.value), P = async () => {
352
352
  var t;
353
353
  try {
354
354
  if (z("phone"), !e.value) {
355
- v.value = "Это не похоже на номер телефона";
355
+ y.value = "Это не похоже на номер телефона";
356
356
  return;
357
357
  }
358
- const n = await Ae(void 0, F(c.phoneModel)), { data: s } = n.data;
358
+ const n = await Ae(void 0, F(h.phoneModel)), { data: s } = n.data;
359
359
  if (!(((t = s.data[0]) == null ? void 0 : t.available) ?? !1)) {
360
- v.value = "Такой номер уже используется";
360
+ y.value = "Такой номер уже используется";
361
361
  return;
362
362
  }
363
- v.value = "", r("on-send-code", { phone: c.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), u.value = !0;
363
+ y.value = "", u("on-send-code", { phone: h.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), p.value = !0;
364
364
  } catch (n) {
365
- console.error("Неизвестная ошибка при проверке доступности телефона:", n), v.value = "Это не похоже на номер телефона";
365
+ console.error("Неизвестная ошибка при проверке доступности телефона:", n), y.value = "Это не похоже на номер телефона";
366
366
  }
367
367
  };
368
- let g = "";
368
+ let C = "";
369
369
  const D = (t) => {
370
370
  const n = t.target;
371
371
  let s = n.value.replace(/\D/g, "");
372
- s.length < 4 && r("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4), n.value = s), c.codeModel = s, s.length === 4 && s !== g && (g = s, r("on-match-code", { phone: c.phoneModel, code: s }));
373
- }, h = () => {
374
- r("on-send-code-again", { phone: c.phoneModel });
372
+ s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4), n.value = s), h.codeModel = s, s.length === 4 && s !== C && (C = s, u("on-match-code", { phone: h.phoneModel, code: s }));
375
373
  }, m = () => {
376
- console.debug("onSendCodeViaSms"), r("on-send-only-sms", { phone: c.phoneModel });
377
- }, { phoneModel: d, codeModel: I, touched: ie } = Ce(c), R = L(() => {
378
- if (v.value) return v.value;
379
- if (c.touched.phone) {
380
- if (!c.phoneModel.trim()) return "Введите номер телефона";
374
+ u("on-send-code-again", { phone: h.phoneModel });
375
+ }, g = () => {
376
+ console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: h.phoneModel });
377
+ }, { phoneModel: i, codeModel: I, touched: ie } = Ce(h), R = L(() => {
378
+ if (y.value) return y.value;
379
+ if (h.touched.phone) {
380
+ if (!h.phoneModel.trim()) return "Введите номер телефона";
381
381
  if (!e.value) return "Это не похоже на номер телефона";
382
382
  }
383
383
  return E.phoneError || "";
384
- }), Q = L(() => E.isNotMatchCode ? "Неверный код" : c.touched.code ? I.value.trim() ? E.codeError ?? null : "Введите код" : "");
385
- return (t, n) => (p(), x("div", yt, [
384
+ }), Q = L(() => E.isNotMatchCode ? "Неверный код" : h.touched.code ? I.value.trim() ? E.codeError ?? null : "Введите код" : "");
385
+ return (t, n) => (v(), S("div", yt, [
386
386
  H("div", gt, [
387
- H("div", Ct, G(u.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
388
- u.value ? (p(), x("div", wt, [
389
- t.isTg ? (p(), J(i(Pe), { key: 0 })) : (p(), J(i(de), {
387
+ H("div", Ct, G(p.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
388
+ p.value ? (v(), S("div", wt, [
389
+ t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
390
390
  key: 1,
391
391
  style: { "margin-left": "5px" }
392
392
  })),
393
393
  Z(" " + G(t.isTg ? "Telegram" : "СМС"), 1)
394
394
  ])) : B("", !0)
395
395
  ]),
396
- t.showPhone ? (p(), x("div", Pt, [
397
- b(i(se), {
398
- modelValue: i(d),
399
- "onUpdate:modelValue": n[0] || (n[0] = (s) => le(d) ? d.value = s : null),
396
+ t.showPhone ? (v(), S("div", Pt, [
397
+ x(r(se), {
398
+ modelValue: r(i),
399
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => le(i) ? i.value = s : null),
400
400
  size: "large",
401
401
  "text-size": "medium",
402
402
  label: "Телефон",
@@ -405,16 +405,16 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
405
405
  onBlur: n[1] || (n[1] = (s) => z("phone")),
406
406
  onInput: K
407
407
  }, null, 8, ["modelValue", "error"]),
408
- b(i(Ne), {
408
+ x(r(Ne), {
409
409
  class: "icon-locked",
410
410
  onClick: n[2] || (n[2] = (s) => t.$emit("edit", "phone"))
411
411
  })
412
412
  ])) : B("", !0),
413
- u.value ? B("", !0) : (p(), x("div", Tt, [
414
- b(i(qe), {
413
+ p.value ? B("", !0) : (v(), S("div", Tt, [
414
+ x(r(ze), {
415
415
  style: { width: "100%" },
416
416
  disabled: k.value,
417
- onClick: T
417
+ onClick: P
418
418
  }, {
419
419
  default: X(() => n[5] || (n[5] = [
420
420
  Z(" Отправить код ")
@@ -423,9 +423,9 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
423
423
  __: [5]
424
424
  }, 8, ["disabled"])
425
425
  ])),
426
- u.value ? (p(), x("div", St, [
427
- b(i(se), {
428
- modelValue: i(I),
426
+ p.value ? (v(), S("div", St, [
427
+ x(r(se), {
428
+ modelValue: r(I),
429
429
  "onUpdate:modelValue": n[3] || (n[3] = (s) => le(I) ? I.value = s : null),
430
430
  size: "large",
431
431
  "text-size": "medium",
@@ -436,21 +436,21 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
436
436
  onBlur: n[4] || (n[4] = (s) => z("code"))
437
437
  }, null, 8, ["modelValue", "error"])
438
438
  ])) : B("", !0),
439
- u.value ? (p(), x("div", Mt, [
440
- b(we, {
439
+ p.value ? (v(), S("div", Mt, [
440
+ x(we, {
441
441
  loading: t.loading,
442
442
  "rate-limit-text": t.rateLimitText,
443
443
  "is-final-limit": t.isFinalLimit,
444
- "on-send-again": h
444
+ "on-send-again": m
445
445
  }, {
446
446
  extra: X(() => [
447
- t.isTg ? (p(), x("span", {
447
+ t.isTg ? (v(), S("span", {
448
448
  key: 0,
449
449
  class: "dialogDefaultContainerSendCodeBySmsText",
450
- onClick: m
450
+ onClick: g
451
451
  }, [
452
452
  Z(G(t.sendCodeBySmsText) + " ", 1),
453
- b(i(de), { style: { "margin-left": "5px" } })
453
+ x(r(de), { style: { "margin-left": "5px" } })
454
454
  ])) : B("", !0)
455
455
  ]),
456
456
  _: 1
@@ -477,18 +477,18 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
477
477
  },
478
478
  emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
479
479
  setup(U, { expose: V, emit: E }) {
480
- const r = U, u = E, v = O(r.modelValue);
480
+ const u = U, p = E, y = O(u.modelValue);
481
481
  _(
482
- () => r.modelValue,
483
- (a) => v.value = a
484
- ), _(v, (a) => u("update:modelValue", a));
485
- const c = L(() => r.language ?? "ru"), z = (a) => De[c.value] && De[c.value][a] || (r.title ?? a), Y = L(() => r.title ?? z("Смена номера телефона")), K = L(() => r.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
486
- oldPhone: r.initialPhone ?? "",
482
+ () => u.modelValue,
483
+ (a) => y.value = a
484
+ ), _(y, (a) => p("update:modelValue", a));
485
+ const h = L(() => u.language ?? "ru"), z = (a) => De[h.value] && De[h.value][a] || (u.title ?? a), Y = L(() => u.title ?? z("Смена номера телефона")), K = L(() => u.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
486
+ oldPhone: u.initialPhone ?? "",
487
487
  newPhone: "",
488
488
  code: "",
489
489
  addPhone: "",
490
490
  addCode: ""
491
- }), k = O(j.OLD), T = O(null), g = O(!1), D = O(!1), h = O("tg"), m = L(() => h.value === "tg"), d = O(!1), { startTimer: I, remainingSeconds: ie, isAvailableForSendAgain: R, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: n } = Je(u), { isEditFlow: s, getFlow: me } = Ge(O(r.mode)), re = L(() => R.value ? "Повторить" : `${ie.value}`), oe = O(ae), ue = L(() => oe.value === 0), ze = (a) => new Promise((l) => setTimeout(l, a));
491
+ }), k = O(j.OLD), P = O(null), C = O(!1), D = O(!1), m = O("tg"), g = L(() => m.value === "tg"), i = O(!1), { startTimer: I, remainingSeconds: ie, isAvailableForSendAgain: R, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: n } = Je(p), { isEditFlow: s, getFlow: me } = Ge(O(u.mode)), re = L(() => R.value ? "Повторить" : `${ie.value}`), oe = O(ae), ue = L(() => oe.value === 0), Fe = (a) => new Promise((l) => setTimeout(l, a));
492
492
  async function fe(a = "email") {
493
493
  var o;
494
494
  return (o = (await Re("/users/profile/session/get-edit-session", { params: { field: a } })).data) == null ? void 0 : o.data;
@@ -497,14 +497,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
497
497
  var $;
498
498
  const o = ($ = (await te("/users/profile/session/create-if-not-exists", {
499
499
  field: a,
500
- oldValue: F(r.initialPhone)
500
+ oldValue: F(u.initialPhone)
501
501
  })).data) == null ? void 0 : $.data;
502
- return T.value = (o == null ? void 0 : o.sessionId) ?? null, k.value = (o == null ? void 0 : o.step) ?? j.OLD, e.oldPhone = (o == null ? void 0 : o.oldValue) ?? "", e.newPhone = (o == null ? void 0 : o.newValue) ?? "", o;
502
+ return P.value = (o == null ? void 0 : o.sessionId) ?? null, k.value = (o == null ? void 0 : o.step) ?? j.OLD, e.oldPhone = (o == null ? void 0 : o.oldValue) ?? "", e.newPhone = (o == null ? void 0 : o.newValue) ?? "", o;
503
503
  }
504
- async function Fe() {
504
+ async function Ue() {
505
505
  try {
506
506
  const a = await fe("phone");
507
- return T.value = a.sessionId, k.value = a.step, e.oldPhone = a.oldValue ?? "", a.sessionId ? a : await Te("phone");
507
+ return P.value = a.sessionId, k.value = a.step, e.oldPhone = a.oldValue ?? "", a.sessionId ? a : await Te("phone");
508
508
  } catch {
509
509
  return await Te("phone");
510
510
  }
@@ -521,29 +521,29 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
521
521
  },
522
522
  {
523
523
  headers: {
524
- "x-only-sms": d.value ?? !1
524
+ "x-only-sms": i.value ?? !1
525
525
  }
526
526
  }
527
527
  );
528
- await ze(1e3);
529
- const S = (o = $.data) == null ? void 0 : o.data;
530
- return S ? (S.restTimeSec > 0 ? (I(S.restTimeSec), R.value = !1, Q.value = S.attempts.total, t.value = S.attempts.total - S.attempts.available, oe.value = S.attempts.available ?? ae) : R.value = !0, S) : null;
528
+ await Fe(1e3);
529
+ const T = (o = $.data) == null ? void 0 : o.data;
530
+ return T ? (T.restTimeSec > 0 ? (I(T.restTimeSec), R.value = !1, Q.value = T.attempts.total, t.value = T.attempts.total - T.attempts.available, oe.value = T.attempts.available ?? ae) : R.value = !0, T) : null;
531
531
  } catch {
532
532
  return null;
533
533
  }
534
534
  }
535
- const ye = async ({ phone: a }) => (d.value = !0, await ee({ value: a, isOnlySms: !0 })), ee = async ({ value: a, isOnlySms: l, offLoading: o } = {}) => {
536
- var $, S, A, N, W, f;
537
- g.value = !0;
535
+ const ye = async ({ phone: a }) => (i.value = !0, await ee({ value: a, isOnlySms: !0 })), ee = async ({ value: a, isOnlySms: l, offLoading: o } = {}) => {
536
+ var $, T, A, N, q, W, w;
537
+ C.value = !0;
538
538
  try {
539
- const y = a ?? e.oldPhone, C = await te(
539
+ const f = a ?? e.oldPhone, c = await te(
540
540
  "/users/profile/phone/contact/send-code",
541
541
  {
542
- sessionId: T.value,
543
- phone: F(y),
544
- value: F(y),
542
+ sessionId: P.value,
543
+ phone: F(f),
544
+ value: F(f),
545
545
  oldValue: e.oldPhone ? F(e.oldPhone) : void 0,
546
- provider: r.provider,
546
+ provider: u.provider,
547
547
  isOnlySms: l ?? !1
548
548
  },
549
549
  {
@@ -552,58 +552,58 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
552
552
  }
553
553
  }
554
554
  );
555
- console.debug("response sendContactCode: ", C);
556
- const w = (S = ($ = C == null ? void 0 : C.data) == null ? void 0 : $.data) == null ? void 0 : S.deliveryType;
557
- if ((w === "tg" || w === "sms") && (h.value = w, w === "tg" && (d.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", C), (C == null ? void 0 : C.status) === 403 && ((A = C.data) != null && A.tooManyRequests)) {
558
- console.debug("sendContactCode IN обработка 403 tooManyRequests", C);
559
- const M = (W = (N = C.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : W.type;
560
- h.value = M;
561
- const P = C.data.tooManyRequests;
562
- return P.restTimeSec > 0 ? (I(P.restTimeSec), Q.value = P.attempts.total, t.value = P.attempts.total - P.attempts.available, oe.value = P.attempts.available ?? ae) : R.value = !0, C;
555
+ console.debug("response sendContactCode: ", c);
556
+ const d = (T = ($ = c == null ? void 0 : c.data) == null ? void 0 : $.data) == null ? void 0 : T.deliveryType;
557
+ if ((d === "tg" || d === "sms") && (m.value = d, d === "tg" && (i.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", c), (c == null ? void 0 : c.status) === 403 && ((A = c.data) != null && A.tooManyRequests)) {
558
+ console.debug("sendContactCode IN обработка 403 tooManyRequests", c);
559
+ const M = (q = (N = c.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : q.type;
560
+ m.value = M;
561
+ const b = c.data.tooManyRequests;
562
+ return b.restTimeSec > 0 ? (I(b.restTimeSec), Q.value = b.attempts.total, t.value = b.attempts.total - b.attempts.available, oe.value = b.attempts.available ?? ae) : R.value = !0, c;
563
563
  }
564
- return console.debug("sendContactCode after обработка 403 tooManyRequests", C), C;
565
- } catch (y) {
566
- if ((y == null ? void 0 : y.status) === 403 && ((f = y == null ? void 0 : y.data) != null && f.tooManyRequests)) {
567
- const C = y.data.tooManyRequests.type;
568
- h.value = C;
569
- const w = y.data.tooManyRequests;
570
- return w.restTimeSec > 0 ? (I(w.restTimeSec), Q.value = w.attempts.total, t.value = w.attempts.total - w.attempts.available, oe.value = w.attempts.available ?? ae) : R.value = !0, y;
564
+ return console.debug("sendContactCode after обработка 403 tooManyRequests", c), c;
565
+ } catch (f) {
566
+ if (console.error("sendContactCode catch error: ", f), console.debug("sendContactCode catch error: ", f), (f == null ? void 0 : f.status) === 403 && ((w = (W = f == null ? void 0 : f.response) == null ? void 0 : W.data) != null && w.tooManyRequests)) {
567
+ const c = f.response.data.tooManyRequests.type;
568
+ m.value = c;
569
+ const d = f.response.data.tooManyRequests;
570
+ return d.restTimeSec > 0 ? (I(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : R.value = !0, f;
571
571
  }
572
- throw y;
572
+ throw f;
573
573
  } finally {
574
- await Se(a ?? e.oldPhone), g.value = !1, o && (g.value = !1);
574
+ await Se(a ?? e.oldPhone), C.value = !1, o && (C.value = !1);
575
575
  }
576
576
  }, Me = async (a, l) => {
577
- var o, $, S, A, N, W, f, y, C, w, M;
578
- g.value = !0;
577
+ var o, $, T, A, N, q, W, w, f, c, d;
578
+ C.value = !0;
579
579
  try {
580
- const P = await fe("phone");
581
- T.value = P.sessionId, k.value = P.step, e.oldPhone = P.oldValue ?? e.oldPhone, e.newPhone = P.newValue ?? e.newPhone;
582
- const q = await te("/users/profile/change/phone/match-code", {
580
+ const M = await fe("phone");
581
+ P.value = M.sessionId, k.value = M.step, e.oldPhone = M.oldValue ?? e.oldPhone, e.newPhone = M.newValue ?? e.newPhone;
582
+ const b = await te("/users/profile/change/phone/match-code", {
583
583
  phone: l === j.NEW ? F(e.newPhone) : F(e.oldPhone),
584
- sessionId: T.value,
584
+ sessionId: P.value,
585
585
  code: a,
586
586
  step: l
587
- }), ne = ((o = q.data) == null ? void 0 : o.nextStep) ?? ((S = ($ = q.data) == null ? void 0 : $.data) == null ? void 0 : S.nextStep), pe = ((N = (A = q.data) == null ? void 0 : A.data) == null ? void 0 : N.rateLimit) ?? ((W = q.data) == null ? void 0 : W.rateLimit) ?? null;
588
- if (!(((f = q.data) == null ? void 0 : f.data.success) ?? ((y = q.data) == null ? void 0 : y.success))) {
587
+ }), ne = ((o = b.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = b.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((N = (A = b.data) == null ? void 0 : A.data) == null ? void 0 : N.rateLimit) ?? ((q = b.data) == null ? void 0 : q.rateLimit) ?? null;
588
+ if (!(((W = b.data) == null ? void 0 : W.data.success) ?? ((w = b.data) == null ? void 0 : w.success))) {
589
589
  n(pe), D.value = !0;
590
590
  return;
591
591
  }
592
- if (!ne) return q;
592
+ if (!ne) return b;
593
593
  if (k.value = ne, ne === j.NEW) {
594
594
  const Le = await fe("phone");
595
595
  e.oldPhone = Le.oldValue ?? e.oldPhone, e.newPhone = Le.newValue ?? e.newPhone, e.code = "";
596
596
  }
597
- return ne === j.COMPLETED && (e.code = "", u("update-phone-field", e.addPhone), u("submit-phone", { phone: e.oldPhone, code: a }), u("on-toast", { color: "success", text: "Номер телефона изменён" }), u("on-update-jwt", "phone", "edit", e.newPhone), T.value = null, u("close")), q;
598
- } catch (P) {
599
- const q = (w = (C = P == null ? void 0 : P.response) == null ? void 0 : C.data) == null ? void 0 : w.rateLimit;
600
- if (((M = P == null ? void 0 : P.response) == null ? void 0 : M.status) === 429 && q) {
601
- n(q), D.value = !0;
597
+ return ne === j.COMPLETED && (e.code = "", p("update-phone-field", e.addPhone), p("submit-phone", { phone: e.oldPhone, code: a }), p("on-toast", { color: "success", text: "Номер телефона изменён" }), p("on-update-jwt", "phone", "edit", e.newPhone), P.value = null, p("close")), b;
598
+ } catch (M) {
599
+ const b = (c = (f = M == null ? void 0 : M.response) == null ? void 0 : f.data) == null ? void 0 : c.rateLimit;
600
+ if (((d = M == null ? void 0 : M.response) == null ? void 0 : d.status) === 429 && b) {
601
+ n(b), D.value = !0;
602
602
  return;
603
603
  }
604
- throw P;
604
+ throw M;
605
605
  } finally {
606
- g.value = !1;
606
+ C.value = !1;
607
607
  }
608
608
  }, xe = ({ code: a }) => Me(a, j.OLD);
609
609
  function be(a) {
@@ -612,7 +612,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
612
612
  function Ve(a) {
613
613
  }
614
614
  const ce = () => {
615
- u("close"), v.value = !1;
615
+ p("close"), y.value = !1;
616
616
  };
617
617
  async function $e(a = "phone") {
618
618
  var o;
@@ -623,25 +623,25 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
623
623
  field: l = "phone",
624
624
  offLoading: o = !0
625
625
  }) {
626
- var $, S, A;
627
- g.value = !0;
626
+ var $, T, A;
627
+ C.value = !0;
628
628
  try {
629
- if (!T.value) {
629
+ if (!P.value) {
630
630
  const N = await te("/users/profile/session/bind/create", {
631
631
  field: l,
632
632
  newValue: F(a || e.addPhone)
633
633
  });
634
- if (T.value = ((S = ($ = N.data) == null ? void 0 : $.data) == null ? void 0 : S.sessionId) ?? ((A = N.data) == null ? void 0 : A.sessionId) ?? null, !T.value)
634
+ if (P.value = ((T = ($ = N.data) == null ? void 0 : $.data) == null ? void 0 : T.sessionId) ?? ((A = N.data) == null ? void 0 : A.sessionId) ?? null, !P.value)
635
635
  throw new Error("не удалось создать bind-сессию (sessionId отсутствует)");
636
636
  }
637
637
  } finally {
638
- o && (g.value = !1);
638
+ o && (C.value = !1);
639
639
  }
640
640
  }
641
- async function Ue() {
641
+ async function qe() {
642
642
  try {
643
643
  const a = await $e("phone");
644
- T.value = a.sessionId, k.value = a.step, e.addPhone = a.newValue ?? "", a.sessionId || await Be({ field: "phone", value: e.addPhone });
644
+ P.value = a.sessionId, k.value = a.step, e.addPhone = a.newValue ?? "", a.sessionId || await Be({ field: "phone", value: e.addPhone });
645
645
  } catch {
646
646
  await Be({ field: "phone", value: e.addPhone });
647
647
  }
@@ -652,17 +652,17 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
652
652
  isOnlySms: o = !1,
653
653
  offLoading: $ = !0
654
654
  } = {}) => {
655
- var S, A, N, W;
656
- g.value = !0;
655
+ var T, A, N, q, W;
656
+ C.value = !0;
657
657
  try {
658
- if (!T.value)
658
+ if (!P.value)
659
659
  throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
660
- const f = a ?? e.addPhone, y = await te(
660
+ const w = a ?? e.addPhone, f = await te(
661
661
  `/users/profile/bind/contact/send-code/${l}`,
662
662
  {
663
- sessionId: T.value,
664
- phone: F(f),
665
- provider: r.provider,
663
+ sessionId: P.value,
664
+ phone: F(w),
665
+ provider: u.provider,
666
666
  isOnlySms: o ?? !1
667
667
  },
668
668
  {
@@ -670,67 +670,69 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
670
670
  "x-only-sms": o ?? !1
671
671
  }
672
672
  }
673
- ), C = (A = (S = y == null ? void 0 : y.data) == null ? void 0 : S.data) == null ? void 0 : A.deliveryType;
674
- (C === "tg" || C === "sms") && (h.value = C, C === "tg" && (d.value = !1));
675
- const w = (N = y.data) == null ? void 0 : N.tooManyRequests;
676
- if (y.status === 403 && w) {
677
- const M = w == null ? void 0 : w.type;
678
- return h.value = M, w.restTimeSec > 0 ? (I(w.restTimeSec), Q.value = w.attempts.total, t.value = w.attempts.total - w.attempts.available, oe.value = w.attempts.available ?? ae) : R.value = !0, y;
673
+ ), c = (A = (T = f == null ? void 0 : f.data) == null ? void 0 : T.data) == null ? void 0 : A.deliveryType;
674
+ (c === "tg" || c === "sms") && (m.value = c, c === "tg" && (i.value = !1));
675
+ const d = (N = f.data) == null ? void 0 : N.tooManyRequests;
676
+ if (f.status === 403 && d) {
677
+ const M = d == null ? void 0 : d.type;
678
+ return m.value = M, d.restTimeSec > 0 ? (I(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : R.value = !0, f;
679
679
  }
680
- return y;
681
- } catch (f) {
682
- if ((f == null ? void 0 : f.status) === 403 && ((W = f == null ? void 0 : f.data) != null && W.tooManyRequests)) {
683
- const y = f.data.tooManyRequests.type;
684
- return h.value = y, f.data.tooManyRequests.restTimeSec > 0 ? (I(f.data.tooManyRequests.restTimeSec), Q.value = f.data.tooManyRequests.attempts.total, t.value = f.data.tooManyRequests.attempts.total - f.data.tooManyRequests.attempts.available, oe.value = f.data.tooManyRequests.attempts.available ?? ae, R.value = !1) : R.value = !0, f;
680
+ return f;
681
+ } catch (w) {
682
+ if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((W = (q = w == null ? void 0 : w.response) == null ? void 0 : q.data) != null && W.tooManyRequests)) {
683
+ const f = w.response.data.tooManyRequests.type;
684
+ m.value = f;
685
+ const c = w.response.data.tooManyRequests;
686
+ return c.restTimeSec > 0 ? (I(c.restTimeSec), Q.value = c.attempts.total, t.value = c.attempts.total - c.attempts.available, oe.value = c.attempts.available ?? ae, R.value = !1) : R.value = !0, w;
685
687
  }
686
- throw f;
688
+ throw w;
687
689
  } finally {
688
- const f = await Se(a ?? e.addPhone);
689
- f && f.restTimeSec > 0 ? (I(f.restTimeSec), R.value = !1) : R.value = !0, $ && (g.value = !1);
690
+ const w = await Se(a ?? e.addPhone);
691
+ w && w.restTimeSec > 0 ? (I(w.restTimeSec), R.value = !1) : R.value = !0, $ && (C.value = !1);
690
692
  }
691
693
  }, Ee = async ({ code: a }) => {
692
- var l, o, $, S, A, N, W, f, y, C, w;
693
- g.value = !0;
694
+ var l, o, $, T, A, N, q, W, w, f, c;
695
+ C.value = !0;
694
696
  try {
695
- if (!T.value) {
697
+ if (!P.value) {
696
698
  const pe = await $e("phone");
697
- T.value = pe.sessionId, e.addPhone = pe.newValue ?? e.addPhone;
699
+ P.value = pe.sessionId, e.addPhone = pe.newValue ?? e.addPhone;
698
700
  }
699
- const M = await te("/users/profile/bind/phone/match-code", {
701
+ const d = await te("/users/profile/bind/phone/match-code", {
700
702
  phone: F(e.addPhone),
701
- sessionId: T.value,
703
+ sessionId: P.value,
702
704
  code: a
703
- }), P = ((l = M.data) == null ? void 0 : l.nextStep) ?? (($ = (o = M.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), q = ((A = (S = M.data) == null ? void 0 : S.data) == null ? void 0 : A.rateLimit) ?? ((N = M.data) == null ? void 0 : N.rateLimit) ?? null;
704
- if (!(((W = M.data) == null ? void 0 : W.data.success) ?? ((f = M.data) == null ? void 0 : f.success))) {
705
- n(q), D.value = !0;
705
+ }), M = ((l = d.data) == null ? void 0 : l.nextStep) ?? (($ = (o = d.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), b = ((A = (T = d.data) == null ? void 0 : T.data) == null ? void 0 : A.rateLimit) ?? ((N = d.data) == null ? void 0 : N.rateLimit) ?? null;
706
+ if (!(((q = d.data) == null ? void 0 : q.data.success) ?? ((W = d.data) == null ? void 0 : W.success))) {
707
+ n(b), D.value = !0;
706
708
  return;
707
709
  }
708
- return P && P === j.COMPLETED && (e.code = "", u("update-phone-field", e.addPhone), u("submit-phone", { phone: e.addPhone, code: a }), u("on-update-jwt", "phone", "bind", e.addPhone), u("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), T.value = null, u("close")), M;
709
- } catch (M) {
710
- const P = (C = (y = M == null ? void 0 : M.response) == null ? void 0 : y.data) == null ? void 0 : C.rateLimit;
711
- if (((w = M == null ? void 0 : M.response) == null ? void 0 : w.status) === 429 && P) {
712
- n(P), D.value = !0;
710
+ return M && M === j.COMPLETED && (e.code = "", p("update-phone-field", e.addPhone), p("submit-phone", { phone: e.addPhone, code: a }), p("on-update-jwt", "phone", "bind", e.addPhone), p("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), P.value = null, p("close")), d;
711
+ } catch (d) {
712
+ const M = (f = (w = d == null ? void 0 : d.response) == null ? void 0 : w.data) == null ? void 0 : f.rateLimit;
713
+ if (((c = d == null ? void 0 : d.response) == null ? void 0 : c.status) === 429 && M) {
714
+ n(M), D.value = !0;
713
715
  return;
714
716
  }
715
- throw M;
717
+ throw d;
716
718
  } finally {
717
- g.value = !1;
719
+ C.value = !1;
718
720
  }
719
721
  }, Ie = async () => {
720
722
  };
721
723
  return We(async () => {
722
- g.value = !0;
724
+ C.value = !0;
723
725
  const a = await me("phone");
724
- if (r.mode === "bind" && a === "bind") {
725
- await Ue(), g.value = !1;
726
+ if (u.mode === "bind" && a === "bind") {
727
+ await qe(), C.value = !1;
726
728
  return;
727
729
  }
728
- (await Fe()).step === "old" && await ee({}), g.value = !1;
730
+ (await Ue()).step === "old" && await ee({}), C.value = !1;
729
731
  }), V({
730
- localVisible: v,
732
+ localVisible: y,
731
733
  form: e,
732
734
  currentStep: k,
733
- loading: g,
735
+ loading: C,
734
736
  rateLimitText: re,
735
737
  isAvailable: ue,
736
738
  title: Y,
@@ -744,11 +746,11 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
744
746
  handleNewCodeError: Ve,
745
747
  matchBindCode: Ee,
746
748
  matchBindCodeError: Ie
747
- }), (a, l) => (p(), x(je, null, [
748
- b(i(Qe), {
749
- modelValue: v.value,
749
+ }), (a, l) => (v(), S(je, null, [
750
+ x(r(Qe), {
751
+ modelValue: y.value,
750
752
  "onUpdate:modelValue": [
751
- l[15] || (l[15] = (o) => v.value = o),
753
+ l[15] || (l[15] = (o) => y.value = o),
752
754
  ce
753
755
  ],
754
756
  width: "small",
@@ -758,17 +760,17 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
758
760
  }, {
759
761
  header: X(() => [
760
762
  H("div", bt, [
761
- b(i(Xe), {
763
+ x(r(Xe), {
762
764
  "slot-left": !1,
763
765
  size: "small",
764
766
  borded: !0,
765
767
  "no-padding": !1
766
768
  }, {
767
769
  title: X(() => [
768
- H("span", kt, G(i(s) ? Y.value : "Добавление номера телефона"), 1)
770
+ H("span", kt, G(r(s) ? Y.value : "Добавление номера телефона"), 1)
769
771
  ]),
770
772
  "right-button": X(() => [
771
- b(i(Ye), {
773
+ x(r(Ye), {
772
774
  class: "cross",
773
775
  onClick: ce
774
776
  })
@@ -778,9 +780,9 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
778
780
  ])
779
781
  ]),
780
782
  default: X(() => [
781
- i(s) ? (p(), x("div", Vt, [
782
- g.value ? (p(), J(Oe, { key: 0 })) : B("", !0),
783
- k.value === i(j).OLD ? (p(), J(dt, {
783
+ r(s) ? (v(), S("div", Vt, [
784
+ C.value ? (v(), J(Oe, { key: 0 })) : B("", !0),
785
+ k.value === r(j).OLD ? (v(), J(dt, {
784
786
  key: 1,
785
787
  phone: e.oldPhone,
786
788
  "onUpdate:phone": l[0] || (l[0] = (o) => e.oldPhone = o),
@@ -789,14 +791,14 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
789
791
  "rate-limit-text": re.value,
790
792
  "is-final-limit": ue.value,
791
793
  "is-not-match-code": D.value,
792
- loading: g.value,
793
- "is-tg": m.value,
794
+ loading: C.value,
795
+ "is-tg": g.value,
794
796
  onOnSendCode: l[2] || (l[2] = (o) => ee({ value: e.oldPhone })),
795
- onOnSendCodeAgain: l[3] || (l[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !m.value && d.value })),
797
+ onOnSendCodeAgain: l[3] || (l[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !g.value && i.value })),
796
798
  onOnSendOnlySms: ye,
797
799
  onOnMatchCode: xe,
798
800
  onOnMatchCodeError: be
799
- }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value === i(j).NEW ? (p(), J(ft, {
801
+ }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value === r(j).NEW ? (v(), J(ft, {
800
802
  key: 2,
801
803
  phone: e.newPhone,
802
804
  "onUpdate:phone": l[4] || (l[4] = (o) => e.newPhone = o),
@@ -808,34 +810,34 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
808
810
  "rate-limit-text": re.value,
809
811
  "is-final-limit": ue.value,
810
812
  "is-not-match-code": D.value,
811
- loading: g.value,
812
- "is-tg": m.value,
813
+ loading: C.value,
814
+ "is-tg": g.value,
813
815
  onOnSendCode: l[7] || (l[7] = (o) => ee({ value: e.newPhone })),
814
- onOnSendCodeAgain: l[8] || (l[8] = (o) => ee({ value: e.newPhone, isOnlySms: !m.value && d.value })),
816
+ onOnSendCodeAgain: l[8] || (l[8] = (o) => ee({ value: e.newPhone, isOnlySms: !g.value && i.value })),
815
817
  onOnSendOnlySms: ye,
816
818
  onOnMatchCode: ke,
817
819
  onOnMatchCodeError: Ve,
818
820
  onOnClearCodeError: l[9] || (l[9] = (o) => D.value = !1)
819
- }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value === i(j).COMPLETED ? (p(), x("div", $t, [
821
+ }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : k.value === r(j).COMPLETED ? (v(), S("div", $t, [
820
822
  H("p", null, G(z("Телефон успешно изменен")), 1)
821
823
  ])) : B("", !0)
822
- ])) : (p(), x("div", Bt, [
823
- g.value ? (p(), J(Oe, { key: 0 })) : B("", !0),
824
- b(xt, {
824
+ ])) : (v(), S("div", Bt, [
825
+ C.value ? (v(), J(Oe, { key: 0 })) : B("", !0),
826
+ x(xt, {
825
827
  phone: e.addPhone,
826
828
  "onUpdate:phone": l[10] || (l[10] = (o) => e.addPhone = o),
827
829
  oldPhone: e.oldPhone,
828
830
  "onUpdate:oldPhone": l[11] || (l[11] = (o) => e.oldPhone = o),
829
831
  code: e.addCode,
830
832
  "onUpdate:code": l[12] || (l[12] = (o) => e.addCode = o),
831
- "hint-text": i(s) ? K.value : "Чтобы продолжить, введите новый номер",
833
+ "hint-text": r(s) ? K.value : "Чтобы продолжить, введите новый номер",
832
834
  "rate-limit-text": re.value,
833
835
  "is-final-limit": ue.value,
834
836
  "is-not-match-code": D.value,
835
- loading: g.value,
836
- "is-tg": m.value,
837
+ loading: C.value,
838
+ "is-tg": g.value,
837
839
  onOnSendCode: l[13] || (l[13] = (o) => ge({ value: e.addPhone, field: "phone" })),
838
- onOnSendCodeAgain: l[14] || (l[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !m.value && d.value })),
840
+ onOnSendCodeAgain: l[14] || (l[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !g.value && i.value })),
839
841
  onOnSendOnlySms: ye,
840
842
  onOnMatchCode: Ee,
841
843
  onOnMatchCodeError: Ie
@@ -844,7 +846,7 @@ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
844
846
  ]),
845
847
  _: 1
846
848
  }, 8, ["modelValue"]),
847
- b(i(Ze))
849
+ x(r(Ze))
848
850
  ], 64));
849
851
  }
850
852
  });
@@ -216,9 +216,9 @@ const ra = {
216
216
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
217
217
  setup(s, { emit: n }) {
218
218
  const r = n, u = h(!0), { currentDialog: v, dialogPayload: c, closeDialog: U } = X(), l = {
219
- email: J(() => import("./ProfileEmailDialog-sZkCbkOn.js")),
220
- phone: J(() => import("./ProfilePhoneDialog-BF5sey9V.js")),
221
- password: J(() => import("./ProfilePasswordDialog-LdM_8zVG.js"))
219
+ email: J(() => import("./ProfileEmailDialog-rzPRsM0B.js")),
220
+ phone: J(() => import("./ProfilePhoneDialog-DyDCK0A6.js")),
221
+ password: J(() => import("./ProfilePasswordDialog-FRHBCNZO.js"))
222
222
  }, i = ({ email: y }) => {
223
223
  r("update-email-field", y);
224
224
  }, 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-input[data-v-7d90f646] .p-input-file .overlay{visibility:hidden}.avatar-input[data-v-7d90f646] .p-input-file:hover .overlay{visibility:visible}.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-3V186vCD.js";
2
+ import { a as o } from "./index-B03tgxbV.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 d, 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-3V186vCD.js";
3
+ import { _ as g, g as R, p as h } from "./index-B03tgxbV.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")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourgoods/ui-smart",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",