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