@yourgoods/ui-smart 0.30.0 → 0.32.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,7 +1,7 @@
1
- import { defineComponent as te, ref as b, reactive as Q, watch as Y, computed as M, toRefs as de, createElementBlock as x, openBlock as w, createElementVNode as S, createCommentVNode as D, toDisplayString as X, createVNode as k, unref as u, isRef as Z, withCtx as G, createTextVNode as ae, Fragment as Oe, createBlock as H, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
2
- import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-7uS9YHDn.js";
3
- import { C as A, _ as ze, B as We, p as W, g as He } from "./index-BVFeD92e.js";
4
- import { PInput as J, IconMailMd as me, PButton as oe, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as _e, PTopBar as qe, IconCrossMd as je } from "@profeat/ui-kit";
1
+ import { defineComponent as te, ref as b, reactive as Q, watch as Y, computed as M, toRefs as re, createElementBlock as k, openBlock as w, createElementVNode as S, createCommentVNode as N, toDisplayString as X, createVNode as $, unref as u, isRef as Z, withCtx as G, createTextVNode as oe, Fragment as Oe, createBlock as H, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
2
+ import { T as ue, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-DGG5L4f3.js";
3
+ import { C as F, _ as ze, B as We, p as W, g as He } from "./index-D8GpZOPw.js";
4
+ import { PInput as J, IconMailMd as me, PButton as ie, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as _e, PTopBar as qe, IconCrossMd as je } from "@profeat/ui-kit";
5
5
  const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dialogDefaultContainerTextHint" }, Je = {
6
6
  key: 0,
7
7
  class: "input-wrapper"
@@ -27,128 +27,123 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
27
27
  },
28
28
  emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
29
29
  setup(_, { emit: R }) {
30
- const v = _, s = R, m = b(!1), e = b(""), n = Q({
30
+ const v = _, s = R, m = b(!1), e = b(""), i = Q({
31
31
  emailModel: v.email || "",
32
32
  codeModel: "",
33
33
  touched: { email: !1, code: !1 }
34
34
  });
35
35
  Y(
36
- () => n.emailModel,
36
+ () => i.emailModel,
37
37
  (p) => {
38
38
  s("update:email", p);
39
39
  }
40
40
  ), Y(
41
- () => n.codeModel,
41
+ () => i.codeModel,
42
42
  (p) => s("update:code", p)
43
43
  );
44
44
  const y = (p) => {
45
- n.touched[p] = !0;
46
- }, r = (p) => n.touched[p] = !1, d = () => {
47
- e.value = "", r("email");
48
- }, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), N = M(() => !V.value || !!e.value), B = async () => {
49
- var p;
45
+ i.touched[p] = !0;
46
+ }, d = (p) => i.touched[p] = !1, r = () => {
47
+ e.value = "", d("email");
48
+ }, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), O = M(() => !V.value || !!e.value), B = async () => {
49
+ var p, a;
50
50
  try {
51
51
  if (y("email"), !V.value) {
52
52
  e.value = "Это не похоже на e-mail";
53
53
  return;
54
54
  }
55
- const l = await Ve(n.emailModel);
56
- if (checkEmailFormatError(l)) {
57
- e.value = "это не похоже на e-mail";
58
- return;
59
- }
60
- const { data: i } = l.data;
61
- if (!(((p = i == null ? void 0 : i[0]) == null ? void 0 : p.available) ?? !1)) {
55
+ const n = await Ve(i.emailModel), { data: f } = n.data;
56
+ if (!(((a = (p = f == null ? void 0 : f.data) == null ? void 0 : p[0]) == null ? void 0 : a.available) ?? !1)) {
62
57
  e.value = "Такой email уже используется";
63
58
  return;
64
59
  }
65
60
  e.value = "", s("on-send-code", {
66
- email: n.emailModel,
61
+ email: i.emailModel,
67
62
  prevEmail: v.oldEmail,
68
63
  offLoading: !0
69
64
  }), m.value = !0;
70
- } catch (l) {
71
- console.error("Неизвестная ошибка при проверке доступности email:", l), e.value = "это не похоже на e-mail";
65
+ } catch (n) {
66
+ console.error("Неизвестная ошибка при проверке доступности email:", n), e.value = "Это не похоже на e-mail";
72
67
  }
73
68
  };
74
- let O = "";
69
+ let U = "";
75
70
  const C = (p) => {
76
71
  s("on-clear-code-error");
77
- const l = p.target;
78
- let i = l.value.replace(/\D/g, "");
79
- i.length > 4 && (i = i.slice(0, 4)), l.value = i, n.codeModel = i, i.length === 4 && i !== O && (O = i, s("on-match-code", { email: n.emailModel, code: i }));
72
+ const a = p.target;
73
+ let n = a.value.replace(/\D/g, "");
74
+ n.length > 4 && (n = n.slice(0, 4)), a.value = n, i.codeModel = n, n.length === 4 && n !== U && (U = n, s("on-match-code", { email: i.emailModel, code: n }));
80
75
  }, c = () => {
81
- s("on-send-code-again", { email: n.emailModel });
76
+ s("on-send-code-again", { email: i.emailModel });
82
77
  }, T = M(() => {
83
78
  if (e.value) return e.value;
84
- if (n.touched.email) {
85
- if (!n.emailModel.trim()) return "Введите e-mail";
79
+ if (i.touched.email) {
80
+ if (!i.emailModel.trim()) return "Введите e-mail";
86
81
  if (!V.value) return "Это не похоже на e-mail";
87
82
  }
88
83
  return v.emailError || "";
89
- }), g = M(() => v.isNotMatchCode ? "Неверный код" : n.touched.code ? U.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: L, codeModel: U } = de(n);
90
- return (p, l) => {
91
- const i = ue;
92
- return w(), x("div", Ge, [
84
+ }), g = M(() => v.isNotMatchCode ? "Неверный код" : i.touched.code ? A.value.trim() ? v.codeError ?? null : "Введите код" : ""), { emailModel: L, codeModel: A } = re(i);
85
+ return (p, a) => {
86
+ const n = ue;
87
+ return w(), k("div", Ge, [
93
88
  S("div", Ye, X(m.value ? "Введите код подтверждения" : p.hintText), 1),
94
- p.showEmail ? (w(), x("div", Je, [
95
- k(u(J), {
89
+ p.showEmail ? (w(), k("div", Je, [
90
+ $(u(J), {
96
91
  modelValue: u(L),
97
- "onUpdate:modelValue": l[0] || (l[0] = (E) => Z(L) ? L.value = E : null),
92
+ "onUpdate:modelValue": a[0] || (a[0] = (f) => Z(L) ? L.value = f : null),
98
93
  size: "large",
99
94
  "text-size": "medium",
100
95
  label: "Почта",
101
96
  type: "email",
102
97
  error: T.value,
103
- onBlur: l[1] || (l[1] = (E) => y("email")),
104
- onInput: d
98
+ onBlur: a[1] || (a[1] = (f) => y("email")),
99
+ onInput: r
105
100
  }, null, 8, ["modelValue", "error"]),
106
- k(u(me), {
101
+ $(u(me), {
107
102
  class: "icon-locked",
108
- onClick: l[2] || (l[2] = (E) => p.$emit("edit", "email"))
103
+ onClick: a[2] || (a[2] = (f) => p.$emit("edit", "email"))
109
104
  })
110
- ])) : D("", !0),
111
- m.value ? D("", !0) : (w(), x("div", Ke, [
112
- k(u(oe), {
105
+ ])) : N("", !0),
106
+ m.value ? N("", !0) : (w(), k("div", Ke, [
107
+ $(u(ie), {
113
108
  style: { width: "100%" },
114
- disabled: N.value,
109
+ disabled: O.value,
115
110
  onClick: B
116
111
  }, {
117
- default: G(() => l[5] || (l[5] = [
118
- ae(" Отправить код ")
112
+ default: G(() => a[5] || (a[5] = [
113
+ oe(" Отправить код ")
119
114
  ])),
120
115
  _: 1,
121
116
  __: [5]
122
117
  }, 8, ["disabled"])
123
118
  ])),
124
- m.value ? (w(), x("div", Qe, [
125
- k(u(J), {
126
- modelValue: u(U),
127
- "onUpdate:modelValue": l[3] || (l[3] = (E) => Z(U) ? U.value = E : null),
119
+ m.value ? (w(), k("div", Qe, [
120
+ $(u(J), {
121
+ modelValue: u(A),
122
+ "onUpdate:modelValue": a[3] || (a[3] = (f) => Z(A) ? A.value = f : null),
128
123
  size: "large",
129
124
  "text-size": "medium",
130
125
  label: "Код",
131
126
  type: "text",
132
127
  error: g.value,
133
128
  onInput: C,
134
- onBlur: l[4] || (l[4] = (E) => y("code"))
129
+ onBlur: a[4] || (a[4] = (f) => y("code"))
135
130
  }, null, 8, ["modelValue", "error"])
136
- ])) : D("", !0),
137
- !p.loading && m.value ? (w(), x("div", Xe, [
138
- k(i, {
131
+ ])) : N("", !0),
132
+ !p.loading && m.value ? (w(), k("div", Xe, [
133
+ $(n, {
139
134
  loading: p.loading,
140
135
  "rate-limit-text": p.rateLimitText,
141
136
  "is-final-limit": p.isFinalLimit,
142
137
  "on-send-again": c
143
138
  }, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
144
- ])) : D("", !0)
139
+ ])) : N("", !0)
145
140
  ]);
146
141
  };
147
142
  }
148
- }), et = { class: "dialogDefaultContainer" }, tt = { class: "dialogDefaultContainerInsideContent" }, lt = { class: "input-wrapper" }, at = { class: "input-wrapper" }, ot = { style: { width: "100%", display: "flex" } }, it = {
143
+ }), et = { class: "dialogDefaultContainer" }, tt = { class: "dialogDefaultContainerInsideContent" }, at = { class: "input-wrapper" }, lt = { class: "input-wrapper" }, ot = { style: { width: "100%", display: "flex" } }, it = {
149
144
  key: 0,
150
145
  class: "dialogDefaultContainer"
151
- }, nt = { class: "dialogDefaultContainerInsideContent" }, st = { style: { "margin-top": "12px" } }, Te = 8, rt = /* @__PURE__ */ te({
146
+ }, nt = { class: "dialogDefaultContainerInsideContent" }, st = { style: { "margin-top": "12px" } }, Te = 8, dt = /* @__PURE__ */ te({
152
147
  __name: "AddNewPasswordContent",
153
148
  props: {
154
149
  modelValue: { type: Boolean },
@@ -158,64 +153,64 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
158
153
  },
159
154
  emits: ["update:modelValue", "submit", "close", "update-user"],
160
155
  setup(_, { emit: R }) {
161
- const v = R, s = b(!1), m = b(""), e = b(""), n = Q({
156
+ const v = R, s = b(!1), m = b(""), e = b(""), i = Q({
162
157
  newPassword: !1,
163
158
  newPasswordConfirm: !1
164
- }), y = b(A.NEW), r = b(!1), d = b(!1), V = M(() => r.value ? "text" : "password"), N = M(() => d.value ? "text" : "password"), B = () => {
165
- r.value = !r.value;
166
- }, O = () => {
159
+ }), y = b(F.NEW), d = b(!1), r = b(!1), V = M(() => d.value ? "text" : "password"), O = M(() => r.value ? "text" : "password"), B = () => {
167
160
  d.value = !d.value;
168
- }, C = M(() => n.newPassword ? m.value.trim() ? m.value.trim().length < Te ? `Пароль слишком короткий. Введите хотя бы ${Te} символов` : "" : "Введите пароль" : ""), c = M(() => n.newPasswordConfirm ? e.value.trim() ? e.value !== m.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), T = M(() => !!(C.value || c.value)), g = M(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : T.value), L = () => {
161
+ }, U = () => {
162
+ r.value = !r.value;
163
+ }, C = M(() => i.newPassword ? m.value.trim() ? m.value.trim().length < Te ? `Пароль слишком короткий. Введите хотя бы ${Te} символов` : "" : "Введите пароль" : ""), c = M(() => i.newPasswordConfirm ? e.value.trim() ? e.value !== m.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), T = M(() => !!(C.value || c.value)), g = M(() => s.value || !m.value.trim() || !e.value.trim() ? !0 : T.value), L = () => {
169
164
  v("update:modelValue", !1), v("close");
170
- }, U = async () => {
165
+ }, A = async () => {
171
166
  v("update-user", m.value);
172
167
  };
173
- return (p, l) => (w(), x(Oe, null, [
168
+ return (p, a) => (w(), k(Oe, null, [
174
169
  S("div", et, [
175
170
  S("div", tt, [
176
- l[7] || (l[7] = S("div", { class: "dialogDefaultContainerTextHint" }, X("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
177
- S("div", lt, [
178
- k(u(J), {
171
+ a[7] || (a[7] = S("div", { class: "dialogDefaultContainerTextHint" }, X("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
172
+ S("div", at, [
173
+ $(u(J), {
179
174
  modelValue: m.value,
180
- "onUpdate:modelValue": l[0] || (l[0] = (i) => m.value = i),
175
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => m.value = n),
181
176
  size: "large",
182
177
  "text-size": "medium",
183
178
  label: "Новый пароль",
184
179
  type: V.value,
185
180
  error: C.value,
186
- onBlur: l[1] || (l[1] = () => n.newPassword = !0),
187
- onInput: l[2] || (l[2] = () => n.newPassword = !0)
181
+ onBlur: a[1] || (a[1] = () => i.newPassword = !0),
182
+ onInput: a[2] || (a[2] = () => i.newPassword = !0)
188
183
  }, null, 8, ["modelValue", "type", "error"]),
189
- (w(), H(Ce(r.value ? u(ge) : u(he)), {
184
+ (w(), H(Ce(d.value ? u(ge) : u(he)), {
190
185
  class: "icon-locked",
191
186
  onClick: B
192
187
  }))
193
188
  ]),
194
- S("div", at, [
195
- k(u(J), {
189
+ S("div", lt, [
190
+ $(u(J), {
196
191
  modelValue: e.value,
197
- "onUpdate:modelValue": l[3] || (l[3] = (i) => e.value = i),
192
+ "onUpdate:modelValue": a[3] || (a[3] = (n) => e.value = n),
198
193
  size: "large",
199
194
  "text-size": "medium",
200
195
  label: "Повторите новый пароль",
201
- type: N.value,
196
+ type: O.value,
202
197
  error: c.value,
203
- onBlur: l[4] || (l[4] = () => n.newPasswordConfirm = !0),
204
- onInput: l[5] || (l[5] = () => n.newPasswordConfirm = !0)
198
+ onBlur: a[4] || (a[4] = () => i.newPasswordConfirm = !0),
199
+ onInput: a[5] || (a[5] = () => i.newPasswordConfirm = !0)
205
200
  }, null, 8, ["modelValue", "type", "error"]),
206
- (w(), H(Ce(d.value ? u(ge) : u(he)), {
201
+ (w(), H(Ce(r.value ? u(ge) : u(he)), {
207
202
  class: "icon-locked",
208
- onClick: O
203
+ onClick: U
209
204
  }))
210
205
  ]),
211
206
  S("div", ot, [
212
- k(u(oe), {
207
+ $(u(ie), {
213
208
  style: { width: "100%" },
214
209
  disabled: g.value,
215
- onClick: U
210
+ onClick: A
216
211
  }, {
217
- default: G(() => l[6] || (l[6] = [
218
- ae(X("Сохранить"))
212
+ default: G(() => a[6] || (a[6] = [
213
+ oe(X("Сохранить"))
219
214
  ])),
220
215
  _: 1,
221
216
  __: [6]
@@ -223,26 +218,26 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
223
218
  ])
224
219
  ])
225
220
  ]),
226
- y.value === u(A).COMPLETED ? (w(), x("div", it, [
221
+ y.value === u(F).COMPLETED ? (w(), k("div", it, [
227
222
  S("div", nt, [
228
- l[9] || (l[9] = S("p", null, "Пароль успешно установлен", -1)),
223
+ a[9] || (a[9] = S("p", null, "Пароль успешно установлен", -1)),
229
224
  S("div", st, [
230
- k(u(oe), {
225
+ $(u(ie), {
231
226
  style: { width: "100%" },
232
227
  onClick: L
233
228
  }, {
234
- default: G(() => l[8] || (l[8] = [
235
- ae("Закрыть")
229
+ default: G(() => a[8] || (a[8] = [
230
+ oe("Закрыть")
236
231
  ])),
237
232
  _: 1,
238
233
  __: [8]
239
234
  })
240
235
  ])
241
236
  ])
242
- ])) : D("", !0)
237
+ ])) : N("", !0)
243
238
  ], 64));
244
239
  }
245
- }), dt = { class: "dialogDefaultContainerInsideContent" }, ut = { class: "dialogDefaultContainerTextHint" }, mt = {
240
+ }), rt = { class: "dialogDefaultContainerInsideContent" }, ut = { class: "dialogDefaultContainerTextHint" }, mt = {
246
241
  key: 0,
247
242
  class: "input-wrapper"
248
243
  }, ct = {
@@ -282,22 +277,22 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
282
277
  );
283
278
  const e = (C) => {
284
279
  m.touched[C] = !0;
285
- }, n = b(""), y = (C) => {
280
+ }, i = b(""), y = (C) => {
286
281
  s("on-clear-code-error");
287
282
  const c = C.target;
288
283
  let T = ((c == null ? void 0 : c.value) ?? "").replace(/\D/g, "");
289
- T.length > 4 && (T = T.slice(0, 4)), V.value = T, c && c.value !== T && (c.value = T), T.length === 4 && T !== n.value && (n.value = T, s("on-match-code", { email: d.value, code: T }));
290
- }, r = () => {
291
- s("on-send-code-again", { email: d.value });
292
- }, { emailModel: d, codeModel: V, touched: N } = de(m), B = M(() => N.value.email && !d.value.trim() ? "Введите e-mail" : v.emailError), O = M(() => v.isNotMatchCode ? "Неверный код" : N.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
284
+ T.length > 4 && (T = T.slice(0, 4)), V.value = T, c && c.value !== T && (c.value = T), T.length === 4 && T !== i.value && (i.value = T, s("on-match-code", { email: r.value, code: T }));
285
+ }, d = () => {
286
+ s("on-send-code-again", { email: r.value });
287
+ }, { emailModel: r, codeModel: V, touched: O } = re(m), B = M(() => O.value.email && !r.value.trim() ? "Введите e-mail" : v.emailError), U = M(() => v.isNotMatchCode ? "Неверный код" : O.value.code ? V.value.trim() ? v.codeError ?? null : "Введите код" : "");
293
288
  return (C, c) => {
294
289
  const T = ue;
295
- return w(), x("div", dt, [
290
+ return w(), k("div", rt, [
296
291
  S("div", ut, X(C.hintText), 1),
297
- C.showEmail ? (w(), x("div", mt, [
298
- k(u(J), {
299
- modelValue: u(d),
300
- "onUpdate:modelValue": c[0] || (c[0] = (g) => Z(d) ? d.value = g : null),
292
+ C.showEmail ? (w(), k("div", mt, [
293
+ $(u(J), {
294
+ modelValue: u(r),
295
+ "onUpdate:modelValue": c[0] || (c[0] = (g) => Z(r) ? r.value = g : null),
301
296
  size: "large",
302
297
  "text-size": "medium",
303
298
  label: "Почта",
@@ -307,29 +302,29 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
307
302
  onBlur: c[1] || (c[1] = (g) => e("email")),
308
303
  onInput: c[2] || (c[2] = (g) => e("email"))
309
304
  }, null, 8, ["modelValue", "error"]),
310
- k(u(me), {
305
+ $(u(me), {
311
306
  class: "icon-locked",
312
307
  onClick: c[3] || (c[3] = (g) => C.$emit("edit", "email"))
313
308
  })
314
- ])) : D("", !0),
315
- C.showCode ? (w(), x("div", ct, [
316
- k(u(J), {
309
+ ])) : N("", !0),
310
+ C.showCode ? (w(), k("div", ct, [
311
+ $(u(J), {
317
312
  modelValue: u(V),
318
313
  "onUpdate:modelValue": c[4] || (c[4] = (g) => Z(V) ? V.value = g : null),
319
314
  size: "large",
320
315
  "text-size": "medium",
321
316
  label: "Код",
322
317
  type: "text",
323
- error: O.value,
318
+ error: U.value,
324
319
  onInput: y,
325
320
  onBlur: c[5] || (c[5] = (g) => e("code"))
326
321
  }, null, 8, ["modelValue", "error"])
327
- ])) : D("", !0),
328
- k(T, {
322
+ ])) : N("", !0),
323
+ $(T, {
329
324
  loading: C.loading,
330
325
  "rate-limit-text": C.rateLimitText,
331
326
  "is-final-limit": C.isFinalLimit,
332
- "on-send-again": r
327
+ "on-send-again": d
333
328
  }, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
334
329
  ]);
335
330
  };
@@ -359,115 +354,110 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
359
354
  },
360
355
  emits: ["update:email", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-clear-code-error"],
361
356
  setup(_, { emit: R }) {
362
- const v = _, s = R, m = b(!1), e = b(""), n = Q({
357
+ const v = _, s = R, m = b(!1), e = b(""), i = Q({
363
358
  touched: { email: !1, code: !1 },
364
359
  emailModel: "",
365
360
  codeModel: ""
366
361
  });
367
362
  Y(
368
- () => n.emailModel,
369
- (l) => {
370
- s("update:email", l);
363
+ () => i.emailModel,
364
+ (a) => {
365
+ s("update:email", a);
371
366
  }
372
367
  ), Y(
373
- () => n.codeModel,
374
- (l) => s("update:code", l)
368
+ () => i.codeModel,
369
+ (a) => s("update:code", a)
375
370
  );
376
- const y = (l) => n.touched[l] = !0, r = (l) => n.touched[l] = !1, d = () => {
377
- e.value = "", r("email");
378
- }, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.emailModel.trim())), N = M(() => !V.value || !!e.value), B = async () => {
379
- var l;
371
+ const y = (a) => i.touched[a] = !0, d = (a) => i.touched[a] = !1, r = () => {
372
+ e.value = "", d("email");
373
+ }, V = M(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i.emailModel.trim())), O = M(() => !V.value || !!e.value), B = async () => {
374
+ var a, n;
380
375
  try {
381
376
  if (y("email"), !V.value) {
382
377
  e.value = "Это не похоже на e-mail";
383
378
  return;
384
379
  }
385
- const i = await Ve(n.emailModel);
386
- if (checkEmailFormatError(i)) {
387
- e.value = "это не похоже на e-mail";
388
- return;
389
- }
390
- const { data: E } = i.data;
391
- if (!(((l = E == null ? void 0 : E[0]) == null ? void 0 : l.available) ?? !1)) {
380
+ const f = await Ve(i.emailModel), { data: P } = f.data;
381
+ if (!(((n = (a = P == null ? void 0 : P.data) == null ? void 0 : a[0]) == null ? void 0 : n.available) ?? !1)) {
392
382
  e.value = "Такой email уже используется";
393
383
  return;
394
384
  }
395
- e.value = "", s("on-send-code", { email: n.emailModel, prevEmail: v.oldEmail, offLoading: !0 }), m.value = !0;
396
- } catch (i) {
397
- console.error("Неизвестная ошибка при проверке доступности email:", i), e.value = "это не похоже на e-mail";
385
+ e.value = "", s("on-send-code", { email: i.emailModel, prevEmail: v.oldEmail, offLoading: !0 }), m.value = !0;
386
+ } catch (f) {
387
+ console.error("Неизвестная ошибка при проверке доступности email:", f), e.value = "Это не похоже на e-mail";
398
388
  }
399
389
  };
400
- let O = "";
401
- const C = (l) => {
390
+ let U = "";
391
+ const C = (a) => {
402
392
  s("on-clear-code-error");
403
- const i = l.target;
404
- let E = i.value.replace(/\D/g, "");
405
- E.length > 4 && (E = E.slice(0, 4), i.value = E), n.codeModel = E, E.length === 4 && E !== O && (O = E, s("on-match-code", { email: n.emailModel, code: E }));
393
+ const n = a.target;
394
+ let f = n.value.replace(/\D/g, "");
395
+ f.length > 4 && (f = f.slice(0, 4), n.value = f), i.codeModel = f, f.length === 4 && f !== U && (U = f, s("on-match-code", { email: i.emailModel, code: f }));
406
396
  }, c = () => {
407
- s("on-send-code-again", { email: n.emailModel });
408
- }, { emailModel: T, codeModel: g, touched: L } = de(n), U = M(() => {
397
+ s("on-send-code-again", { email: i.emailModel });
398
+ }, { emailModel: T, codeModel: g, touched: L } = re(i), A = M(() => {
409
399
  if (e.value) return e.value;
410
- if (n.touched.email) {
411
- if (!n.emailModel.trim()) return "Введите e-mail";
400
+ if (i.touched.email) {
401
+ if (!i.emailModel.trim()) return "Введите e-mail";
412
402
  if (!V.value) return "Это не похоже на e-mail";
413
403
  }
414
404
  return v.emailError || "";
415
405
  }), p = M(() => v.isNotMatchCode ? "Неверный код" : L.value.code ? g.value.trim() ? v.codeError ?? null : "Введите код" : "");
416
- return (l, i) => {
417
- const E = ue;
418
- return w(), x("div", ft, [
419
- S("div", Et, X(m.value ? "Введите код подтверждения" : l.hintText), 1),
420
- l.showEmail ? (w(), x("div", wt, [
421
- k(u(J), {
406
+ return (a, n) => {
407
+ const f = ue;
408
+ return w(), k("div", ft, [
409
+ S("div", Et, X(m.value ? "Введите код подтверждения" : a.hintText), 1),
410
+ a.showEmail ? (w(), k("div", wt, [
411
+ $(u(J), {
422
412
  modelValue: u(T),
423
- "onUpdate:modelValue": i[0] || (i[0] = (F) => Z(T) ? T.value = F : null),
413
+ "onUpdate:modelValue": n[0] || (n[0] = (P) => Z(T) ? T.value = P : null),
424
414
  size: "large",
425
415
  "text-size": "medium",
426
416
  label: "Почта",
427
417
  type: "email",
428
- error: U.value,
429
- onBlur: i[1] || (i[1] = (F) => y("email")),
430
- onInput: d
418
+ error: A.value,
419
+ onBlur: n[1] || (n[1] = (P) => y("email")),
420
+ onInput: r
431
421
  }, null, 8, ["modelValue", "error"]),
432
- k(u(me), {
422
+ $(u(me), {
433
423
  class: "icon-locked",
434
- onClick: i[2] || (i[2] = (F) => l.$emit("edit", "email"))
424
+ onClick: n[2] || (n[2] = (P) => a.$emit("edit", "email"))
435
425
  })
436
- ])) : D("", !0),
437
- m.value ? D("", !0) : (w(), x("div", Ct, [
438
- k(u(oe), {
426
+ ])) : N("", !0),
427
+ m.value ? N("", !0) : (w(), k("div", Ct, [
428
+ $(u(ie), {
439
429
  style: { width: "100%" },
440
- disabled: N.value,
430
+ disabled: O.value,
441
431
  onClick: B
442
432
  }, {
443
- default: G(() => i[5] || (i[5] = [
444
- ae(" Отправить код ")
433
+ default: G(() => n[5] || (n[5] = [
434
+ oe(" Отправить код ")
445
435
  ])),
446
436
  _: 1,
447
437
  __: [5]
448
438
  }, 8, ["disabled"])
449
439
  ])),
450
- m.value ? (w(), x("div", yt, [
451
- k(u(J), {
440
+ m.value ? (w(), k("div", yt, [
441
+ $(u(J), {
452
442
  modelValue: u(g),
453
- "onUpdate:modelValue": i[3] || (i[3] = (F) => Z(g) ? g.value = F : null),
443
+ "onUpdate:modelValue": n[3] || (n[3] = (P) => Z(g) ? g.value = P : null),
454
444
  size: "large",
455
445
  "text-size": "medium",
456
446
  label: "Код",
457
447
  type: "text",
458
448
  error: p.value,
459
449
  onInput: C,
460
- onBlur: i[4] || (i[4] = (F) => y("code"))
450
+ onBlur: n[4] || (n[4] = (P) => y("code"))
461
451
  }, null, 8, ["modelValue", "error"])
462
- ])) : D("", !0),
463
- m.value ? (w(), x("div", gt, [
464
- k(E, {
465
- loading: l.loading,
466
- "rate-limit-text": l.rateLimitText,
467
- "is-final-limit": l.isFinalLimit,
452
+ ])) : N("", !0),
453
+ m.value ? (w(), k("div", gt, [
454
+ $(f, {
455
+ loading: a.loading,
456
+ "rate-limit-text": a.rateLimitText,
457
+ "is-final-limit": a.isFinalLimit,
468
458
  "on-send-again": c
469
459
  }, null, 8, ["loading", "rate-limit-text", "is-final-limit"])
470
- ])) : D("", !0)
460
+ ])) : N("", !0)
471
461
  ]);
472
462
  };
473
463
  }
@@ -496,53 +486,53 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
496
486
  code: "",
497
487
  addEmail: "",
498
488
  addCode: ""
499
- }), n = Q({ email: !1, code: !1 }), y = b(A.OLD), r = b(null), d = b(!1), V = b(!1), N = b(!1), B = b(We.VERIFY_EMAIL), O = M(() => B.value === "password-flow"), C = M(() => p.value ? v.title : O.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: T, isAvailableForSendAgain: g, totalRateAttempts: L, currentRateAttempt: U } = Fe(), { isEditFlow: p, getFlow: l } = Ae(b(v.mode ?? "edit")), { showRateLimitToast: i } = Re(s), E = M(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), F = M(() => n.code && !e.code.trim() ? "Введите код" : ""), ie = M(() => g.value ? "Повторить" : `${T.value}`), q = b(Me), be = M(() => q.value === 0), ke = (a) => new Promise((t) => setTimeout(t, a));
489
+ }), i = Q({ email: !1, code: !1 }), y = b(F.OLD), d = b(null), r = b(!1), V = b(!1), O = b(!1), B = b(We.VERIFY_EMAIL), U = M(() => B.value === "password-flow"), C = M(() => p.value ? v.title : U.value ? "Добавление пароля" : "Добавление почты"), { startTimer: c, remainingSeconds: T, isAvailableForSendAgain: g, totalRateAttempts: L, currentRateAttempt: A } = Fe(), { isEditFlow: p, getFlow: a } = Ae(b(v.mode ?? "edit")), { showRateLimitToast: n } = Re(s), f = M(() => i.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), P = M(() => i.code && !e.code.trim() ? "Введите код" : ""), ae = M(() => g.value ? "Повторить" : `${T.value}`), q = b(Me), be = M(() => q.value === 0), $e = (l) => new Promise((t) => setTimeout(t, l));
500
490
  Y(
501
491
  () => v.modelValue,
502
- (a) => m.value = a
503
- ), Y(m, (a) => s("update:modelValue", a));
492
+ (l) => m.value = l
493
+ ), Y(m, (l) => s("update:modelValue", l));
504
494
  const ne = () => {
505
495
  s("close"), m.value = !1;
506
- }, ce = (a) => s("edit", a);
507
- async function ve(a, t = !1) {
496
+ }, ce = (l) => s("edit", l);
497
+ async function ve(l, t = !1) {
508
498
  var o;
509
499
  try {
510
- const h = (o = (await W("/users/profile/check-throttler", { method: "email", email: a, isInvite: t })).data) == null ? void 0 : o.data;
511
- return h ? (await ke(1e3), h.restTimeSec > 0 ? (c(h.restTimeSec), g.value = !1, L.value = h.attempts.total ?? L.value, U.value = (h.attempts.total ?? 0) - (h.attempts.available ?? 0), q.value = h.attempts.available ?? q.value) : g.value = !0, h) : null;
500
+ const h = (o = (await W("/users/profile/check-throttler", { method: "email", email: l, isInvite: t })).data) == null ? void 0 : o.data;
501
+ return h ? (await $e(1e3), h.restTimeSec > 0 ? (c(h.restTimeSec), g.value = !1, L.value = h.attempts.total ?? L.value, A.value = (h.attempts.total ?? 0) - (h.attempts.available ?? 0), q.value = h.attempts.available ?? q.value) : g.value = !0, h) : null;
512
502
  } catch {
513
503
  return null;
514
504
  }
515
505
  }
516
- async function se(a = "email") {
506
+ async function se(l = "email") {
517
507
  var o;
518
- return ((o = (await He("/users/profile/session/get-edit-session", { params: { field: a } })).data) == null ? void 0 : o.data) ?? null;
508
+ return ((o = (await He("/users/profile/session/get-edit-session", { params: { field: l } })).data) == null ? void 0 : o.data) ?? null;
519
509
  }
520
- async function $e(a = "email") {
510
+ async function xe(l = "email") {
521
511
  try {
522
- const t = await se(a);
523
- r.value = (t == null ? void 0 : t.sessionId) ?? r.value, y.value = (t == null ? void 0 : t.step) ?? y.value, e.oldEmail = (t == null ? void 0 : t.oldValue) ?? e.oldEmail, t != null && t.sessionId || await pe(a);
512
+ const t = await se(l);
513
+ d.value = (t == null ? void 0 : t.sessionId) ?? d.value, y.value = (t == null ? void 0 : t.step) ?? y.value, e.oldEmail = (t == null ? void 0 : t.oldValue) ?? e.oldEmail, t != null && t.sessionId || await pe(l);
524
514
  } catch {
525
- await pe(a);
515
+ await pe(l);
526
516
  }
527
517
  }
528
- async function pe(a = "email") {
518
+ async function pe(l = "email") {
529
519
  var t;
530
520
  try {
531
- const o = await W("/users/profile/session/create-if-not-exists", { field: a, oldValue: v.initialEmail }), f = ((t = o.data) == null ? void 0 : t.data) ?? o.data;
532
- r.value = (f == null ? void 0 : f.sessionId) ?? r.value, y.value = (f == null ? void 0 : f.step) ?? y.value, e.oldEmail = (f == null ? void 0 : f.oldValue) ?? e.oldEmail, e.newEmail = (f == null ? void 0 : f.newValue) ?? e.newEmail;
521
+ const o = await W("/users/profile/session/create-if-not-exists", { field: l, oldValue: v.initialEmail }), E = ((t = o.data) == null ? void 0 : t.data) ?? o.data;
522
+ d.value = (E == null ? void 0 : E.sessionId) ?? d.value, y.value = (E == null ? void 0 : E.step) ?? y.value, e.oldEmail = (E == null ? void 0 : E.oldValue) ?? e.oldEmail, e.newEmail = (E == null ? void 0 : E.newValue) ?? e.newEmail;
533
523
  } catch {
534
524
  }
535
525
  }
536
- async function ee({ value: a, offLoading: t = !0 }) {
526
+ async function ee({ value: l, offLoading: t = !0 }) {
537
527
  var o;
538
528
  try {
539
- d.value = !0;
540
- const f = a ?? e.addEmail, h = await W(
529
+ r.value = !0;
530
+ const E = l ?? e.addEmail, h = await W(
541
531
  "/users/profile/email/contact/send-code",
542
532
  {
543
- sessionId: r.value,
544
- email: f,
545
- value: f,
533
+ sessionId: d.value,
534
+ email: E,
535
+ value: E,
546
536
  oldValue: e.oldEmail,
547
537
  provider: v.provider
548
538
  }
@@ -550,136 +540,136 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
550
540
  );
551
541
  if (h.status === 403 && ((o = h.data) != null && o.tooManyRequests)) {
552
542
  const I = h.data.tooManyRequests;
553
- return I.restTimeSec > 0 ? (c(I.restTimeSec), L.value = I.attempts.total ?? L.value, U.value = (I.attempts.total ?? 0) - (I.attempts.available ?? 0), q.value = I.attempts.available ?? q.value) : g.value = !0, h;
543
+ return I.restTimeSec > 0 ? (c(I.restTimeSec), L.value = I.attempts.total ?? L.value, A.value = (I.attempts.total ?? 0) - (I.attempts.available ?? 0), q.value = I.attempts.available ?? q.value) : g.value = !0, h;
554
544
  }
555
- return await ve(a ?? e.oldEmail), h;
556
- } catch (f) {
557
- throw console.error(f), f;
545
+ return await ve(l ?? e.oldEmail), h;
546
+ } catch (E) {
547
+ throw console.error(E), E;
558
548
  } finally {
559
- t && (d.value = !1);
549
+ t && (r.value = !1);
560
550
  }
561
551
  }
562
- const fe = async (a, t) => {
563
- var o, f, h, I, $, j;
564
- if (!e.oldEmail && t === A.OLD) throw new Error("oldEmail пустой — модель потерялась");
552
+ const fe = async (l, t) => {
553
+ var o, E, h, I, x, j;
554
+ if (!e.oldEmail && t === F.OLD) throw new Error("oldEmail пустой — модель потерялась");
565
555
  try {
566
- d.value = !0;
567
- const P = await se();
568
- if (r.value = (P == null ? void 0 : P.sessionId) ?? r.value, y.value = (P == null ? void 0 : P.step) ?? y.value, e.oldEmail = (P == null ? void 0 : P.oldValue) ?? e.oldEmail, e.newEmail = (P == null ? void 0 : P.newValue) ?? e.newEmail, !r.value) throw new Error("Нет sessionId для match");
556
+ r.value = !0;
557
+ const D = await se();
558
+ if (d.value = (D == null ? void 0 : D.sessionId) ?? d.value, y.value = (D == null ? void 0 : D.step) ?? y.value, e.oldEmail = (D == null ? void 0 : D.oldValue) ?? e.oldEmail, e.newEmail = (D == null ? void 0 : D.newValue) ?? e.newEmail, !d.value) throw new Error("Нет sessionId для match");
569
559
  const z = await W("/users/profile/change/email/match-code", {
570
- email: t === A.NEW ? e.newEmail : e.oldEmail,
571
- sessionId: r.value,
572
- code: a,
560
+ email: t === F.NEW ? e.newEmail : e.oldEmail,
561
+ sessionId: d.value,
562
+ code: l,
573
563
  step: t
574
- }), le = ((o = z.data) == null ? void 0 : o.nextStep) ?? ((h = (f = z.data) == null ? void 0 : f.data) == null ? void 0 : h.nextStep) ?? null, De = (($ = (I = z.data) == null ? void 0 : I.data) == null ? void 0 : $.rateLimit) ?? ((j = z.data) == null ? void 0 : j.rateLimit) ?? null, Ne = z.data.data.success ?? z.data.success;
575
- if (i(De), !Ne) {
564
+ }), le = ((o = z.data) == null ? void 0 : o.nextStep) ?? ((h = (E = z.data) == null ? void 0 : E.data) == null ? void 0 : h.nextStep) ?? null, De = ((x = (I = z.data) == null ? void 0 : I.data) == null ? void 0 : x.rateLimit) ?? ((j = z.data) == null ? void 0 : j.rateLimit) ?? null, Ne = z.data.data.success ?? z.data.success;
565
+ if (n(De), !Ne) {
576
566
  V.value = !0;
577
567
  return;
578
568
  }
579
569
  if (le) {
580
- if (y.value = le, y.value === A.NEW) {
570
+ if (y.value = le, y.value === F.NEW) {
581
571
  const K = await se();
582
572
  e.oldEmail = (K == null ? void 0 : K.oldValue) ?? e.oldEmail, e.newEmail = (K == null ? void 0 : K.newValue) ?? e.newEmail, e.code = "";
583
573
  }
584
- y.value === A.COMPLETED && (e.code = "", s("submit-email", { email: e.addEmail, code: a }), s("on-toast", { color: "success", text: "E-mail изменён" }), s("on-update-jwt", "email", "edit", e.newEmail), r.value = null, s("close"));
574
+ y.value === F.COMPLETED && (e.code = "", s("submit-email", { email: e.addEmail, code: l }), s("on-toast", { color: "success", text: "E-mail изменён" }), s("on-update-jwt", "email", "edit", e.newEmail), d.value = null, s("close"));
585
575
  }
586
576
  return z;
587
577
  } finally {
588
- d.value = !1;
578
+ r.value = !1;
589
579
  }
590
- }, xe = async () => {
580
+ }, ke = async () => {
591
581
  try {
592
- const a = await W("/users/profile/bind/email/cancel", {
593
- sessionId: r.value
582
+ const l = await W("/users/profile/bind/email/cancel", {
583
+ sessionId: d.value
594
584
  });
595
- if ((a.data.data ?? a.data).success) {
585
+ if ((l.data.data ?? l.data).success) {
596
586
  s("close");
597
587
  return;
598
588
  }
599
- } catch (a) {
600
- console.error(a);
589
+ } catch (l) {
590
+ console.error(l);
601
591
  }
602
592
  };
603
- async function Ie({ code: a }) {
604
- await fe(a, A.OLD);
593
+ async function Ie({ code: l }) {
594
+ await fe(l, F.OLD);
605
595
  }
606
- function Ee(a) {
596
+ function Ee(l) {
607
597
  }
608
- async function Se({ code: a }) {
609
- await fe(a, A.NEW);
598
+ async function Se({ code: l }) {
599
+ await fe(l, F.NEW);
610
600
  }
611
601
  const we = async ({
612
- value: a,
602
+ value: l,
613
603
  field: t = "email",
614
604
  offLoading: o = !0
615
605
  }) => {
616
- var f;
606
+ var E;
617
607
  try {
618
- if (d.value = !0, !r.value) throw new Error("Bind-сессия не найдена. Создайте её через createBindSession.");
619
- const h = a ?? e.addEmail, I = await W(`/users/profile/bind/contact/send-code/${t}`, {
620
- sessionId: r.value,
608
+ if (r.value = !0, !d.value) throw new Error("Bind-сессия не найдена. Создайте её через createBindSession.");
609
+ const h = l ?? e.addEmail, I = await W(`/users/profile/bind/contact/send-code/${t}`, {
610
+ sessionId: d.value,
621
611
  email: h,
622
612
  provider: v.provider
623
- }), $ = (f = I.data) == null ? void 0 : f.tooManyRequests;
624
- if (I.status === 403 && $) {
625
- $.restTimeSec > 0 ? (c($.restTimeSec), L.value = $.attempts.total ?? L.value, U.value = ($.attempts.total ?? 0) - ($.attempts.available ?? 0), q.value = $.attempts.available ?? Me) : g.value = !0;
613
+ }), x = (E = I.data) == null ? void 0 : E.tooManyRequests;
614
+ if (I.status === 403 && x) {
615
+ x.restTimeSec > 0 ? (c(x.restTimeSec), L.value = x.attempts.total ?? L.value, A.value = (x.attempts.total ?? 0) - (x.attempts.available ?? 0), q.value = x.attempts.available ?? Me) : g.value = !0;
626
616
  return;
627
617
  }
628
618
  const j = await ve(h);
629
619
  return j && j.restTimeSec > 0 ? c(j.restTimeSec) : g.value = !0, I;
630
620
  } finally {
631
- o && (d.value = !1);
621
+ o && (r.value = !1);
632
622
  }
633
623
  }, Be = async () => {
634
- var a, t, o, f, h, I;
624
+ var l, t, o, E, h, I;
635
625
  try {
636
- if (!r.value) {
637
- const le = await re();
638
- r.value = le.sessionId ?? r.value;
626
+ if (!d.value) {
627
+ const le = await de();
628
+ d.value = le.sessionId ?? d.value;
639
629
  }
640
- const $ = await W("/users/profile/bind/email/match-code", {
630
+ const x = await W("/users/profile/bind/email/match-code", {
641
631
  email: e.addEmail,
642
- sessionId: r.value,
632
+ sessionId: d.value,
643
633
  code: e.addCode
644
- }), j = ((a = $.data) == null ? void 0 : a.nextStep) ?? ((o = (t = $.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
634
+ }), j = ((l = x.data) == null ? void 0 : l.nextStep) ?? ((o = (t = x.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
645
635
  B.value = j ?? B.value;
646
- const P = ((h = (f = $.data) == null ? void 0 : f.data) == null ? void 0 : h.rateLimit) ?? ((I = $.data) == null ? void 0 : I.rateLimit) ?? null, z = $.data.data.success ?? $.data.success;
647
- if (i(P), !z) {
648
- N.value = !0;
636
+ const D = ((h = (E = x.data) == null ? void 0 : E.data) == null ? void 0 : h.rateLimit) ?? ((I = x.data) == null ? void 0 : I.rateLimit) ?? null, z = x.data.data.success ?? x.data.success;
637
+ if (n(D), !z) {
638
+ O.value = !0;
649
639
  return;
650
640
  }
651
641
  } catch {
652
642
  }
653
643
  }, Le = async () => {
654
- }, Pe = async (a) => {
655
- if (!r.value) {
656
- const t = await re();
657
- r.value = t.sessionId ?? r.value;
644
+ }, Pe = async (l) => {
645
+ if (!d.value) {
646
+ const t = await de();
647
+ d.value = t.sessionId ?? d.value;
658
648
  }
659
- d.value = !0;
649
+ r.value = !0;
660
650
  try {
661
- await W("/users/profile/bind/email/password/set", { sessionId: r.value, newPassword: a }), B.value = A.COMPLETED, s("on-toast", { color: "success", text: "E-mail успешно привязан к аккаунту" }), s("update-email-field", e.addEmail), s("submit-email", { email: e.addEmail, code: e.addCode }), s("on-update-jwt", "email", "bind", e.addEmail), s("close");
651
+ await W("/users/profile/bind/email/password/set", { sessionId: d.value, newPassword: l }), B.value = F.COMPLETED, s("on-toast", { color: "success", text: "E-mail успешно привязан к аккаунту" }), s("update-email-field", e.addEmail), s("submit-email", { email: e.addEmail, code: e.addCode }), s("on-update-jwt", "email", "bind", e.addEmail), s("close");
662
652
  } finally {
663
- d.value = !1;
653
+ r.value = !1;
664
654
  }
665
- }, re = async () => {
666
- d.value = !0;
655
+ }, de = async () => {
656
+ r.value = !0;
667
657
  try {
668
- const a = await W("/users/profile/bind/email/init", { email: "" }), t = a.data.data ?? a.data;
669
- return B.value = t.step ?? B.value, r.value = t.sessionId ?? r.value, t;
658
+ const l = await W("/users/profile/bind/email/init", { email: "" }), t = l.data.data ?? l.data;
659
+ return B.value = t.step ?? B.value, d.value = t.sessionId ?? d.value, t;
670
660
  } finally {
671
- d.value = !1;
661
+ r.value = !1;
672
662
  }
673
663
  };
674
664
  return Ue(async () => {
675
- d.value = !0;
676
- const a = await l("email");
677
- if (v.mode === "bind" && a === "bind") {
678
- await re(), d.value = !1;
665
+ r.value = !0;
666
+ const l = await a("email");
667
+ if (v.mode === "bind" && l === "bind") {
668
+ await de(), r.value = !1;
679
669
  return;
680
670
  }
681
- await $e(), e.oldEmail && await ee({ value: e.oldEmail }), d.value = !1;
682
- }), (a, t) => (w(), H(u(_e), {
671
+ await xe(), e.oldEmail && await ee({ value: e.oldEmail }), r.value = !1;
672
+ }), (l, t) => (w(), H(u(_e), {
683
673
  modelValue: m.value,
684
674
  "onUpdate:modelValue": [
685
675
  t[18] || (t[18] = (o) => m.value = o),
@@ -692,7 +682,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
692
682
  }, {
693
683
  header: G(() => [
694
684
  S("div", Tt, [
695
- k(u(qe), {
685
+ $(u(qe), {
696
686
  "slot-left": !1,
697
687
  size: "small",
698
688
  borded: !0,
@@ -702,7 +692,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
702
692
  S("span", Mt, X(C.value), 1)
703
693
  ]),
704
694
  "right-button": G(() => [
705
- k(u(je), {
695
+ $(u(je), {
706
696
  class: "cross",
707
697
  onClick: ne
708
698
  })
@@ -713,28 +703,28 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
713
703
  ]),
714
704
  default: G(() => [
715
705
  S("div", null, [
716
- u(p) ? (w(), x("div", Vt, [
717
- d.value ? (w(), H(ye, { key: 0 })) : D("", !0),
718
- y.value === u(A).OLD ? (w(), H(pt, {
706
+ u(p) ? (w(), k("div", Vt, [
707
+ r.value ? (w(), H(ye, { key: 0 })) : N("", !0),
708
+ y.value === u(F).OLD ? (w(), H(pt, {
719
709
  key: 1,
720
710
  email: e.oldEmail,
721
711
  "onUpdate:email": t[0] || (t[0] = (o) => e.oldEmail = o),
722
712
  code: e.code,
723
713
  "onUpdate:code": t[1] || (t[1] = (o) => e.code = o),
724
- "hint-text": a.hintText,
725
- "email-error": E.value,
726
- "code-error": F.value,
727
- "rate-limit-text": ie.value,
714
+ "hint-text": l.hintText,
715
+ "email-error": f.value,
716
+ "code-error": P.value,
717
+ "rate-limit-text": ae.value,
728
718
  "is-final-limit": q.value === 0,
729
719
  "is-not-match-code": V.value,
730
- loading: d.value,
720
+ loading: r.value,
731
721
  onEdit: ce,
732
722
  onOnMatchCode: Ie,
733
723
  onOnMatchCodeError: Ee,
734
724
  onSendCode: t[2] || (t[2] = (o) => ee({ value: e.oldEmail })),
735
725
  onOnSendCodeAgain: t[3] || (t[3] = (o) => ee({ value: e.oldEmail })),
736
726
  onOnClearCodeError: t[4] || (t[4] = (o) => V.value = !1)
737
- }, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : y.value === u(A).NEW ? (w(), H(ht, {
727
+ }, null, 8, ["email", "code", "hint-text", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : y.value === u(F).NEW ? (w(), H(ht, {
738
728
  key: 2,
739
729
  email: e.newEmail,
740
730
  "onUpdate:email": t[5] || (t[5] = (o) => e.newEmail = o),
@@ -743,28 +733,28 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
743
733
  code: e.code,
744
734
  "onUpdate:code": t[7] || (t[7] = (o) => e.code = o),
745
735
  "hint-text": "Введите новый адрес вашей почты",
746
- "email-error": E.value,
747
- "code-error": F.value,
748
- "rate-limit-text": ie.value,
736
+ "email-error": f.value,
737
+ "code-error": P.value,
738
+ "rate-limit-text": ae.value,
749
739
  "is-final-limit": q.value === 0,
750
740
  "is-not-match-code": V.value,
751
- loading: d.value,
741
+ loading: r.value,
752
742
  onEdit: ce,
753
743
  onOnMatchCode: Se,
754
744
  onOnMatchCodeError: Ee,
755
745
  onOnSendCode: t[8] || (t[8] = (o) => ee({ value: e.newEmail })),
756
746
  onOnSendCodeAgain: t[9] || (t[9] = (o) => ee({ value: e.newEmail })),
757
747
  onOnClearCodeError: t[10] || (t[10] = (o) => V.value = !1)
758
- }, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : D("", !0)
759
- ])) : (w(), x("div", bt, [
760
- d.value ? (w(), H(ye, { key: 0 })) : D("", !0),
761
- O.value ? (w(), H(rt, {
748
+ }, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : N("", !0)
749
+ ])) : (w(), k("div", bt, [
750
+ r.value ? (w(), H(ye, { key: 0 })) : N("", !0),
751
+ U.value ? (w(), H(dt, {
762
752
  key: 2,
763
753
  "model-value": m.value,
764
- "email-session-id": r.value,
754
+ "email-session-id": d.value,
765
755
  "onUpdate:modelValue": t[17] || (t[17] = (o) => s("update:modelValue", o)),
766
756
  onUpdateUser: Pe,
767
- onClose: xe
757
+ onClose: ke
768
758
  }, null, 8, ["model-value", "email-session-id"])) : (w(), H(Ze, {
769
759
  key: 1,
770
760
  email: e.addEmail,
@@ -773,16 +763,16 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
773
763
  "onUpdate:oldEmail": t[12] || (t[12] = (o) => e.addEmail = o),
774
764
  code: e.addCode,
775
765
  "onUpdate:code": t[13] || (t[13] = (o) => e.addCode = o),
776
- "hint-text": u(p) ? a.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
777
- "rate-limit-text": ie.value,
766
+ "hint-text": u(p) ? l.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
767
+ "rate-limit-text": ae.value,
778
768
  "is-final-limit": be.value,
779
- "is-not-match-code": N.value,
780
- loading: d.value,
769
+ "is-not-match-code": O.value,
770
+ loading: r.value,
781
771
  onOnSendCode: t[14] || (t[14] = (o) => we({ value: e.addEmail, field: "email" })),
782
772
  onOnSendCodeAgain: t[15] || (t[15] = (o) => we({ value: e.addEmail, field: "email" })),
783
773
  onOnMatchCode: Be,
784
774
  onOnMatchCodeError: Le,
785
- onOnClearCodeError: t[16] || (t[16] = (o) => N.value = !1)
775
+ onOnClearCodeError: t[16] || (t[16] = (o) => O.value = !1)
786
776
  }, null, 8, ["email", "oldEmail", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"]))
787
777
  ]))
788
778
  ])