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