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