@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,11 +1,11 @@
1
- import { ref as h, shallowRef as Oe, defineComponent as H, defineAsyncComponent as J, watch as ze, createBlock as S, createCommentVNode as b, unref as d, openBlock as w, resolveDynamicComponent as Me, mergeProps as Re, computed as T, reactive as q, onMounted as Ge, createElementBlock as k, Fragment as de, createVNode as f, createElementVNode as _, withCtx as D, toDisplayString as I, createTextVNode as Y, Teleport as ue, Transition as je, withDirectives as Je, vShow as qe } from "vue";
2
- import _e from "axios";
3
- import { PInputFileUploader as Ye, PInput as O, IconFilledEditMd as z, PButton as me, PImageCropper as We, PToast as Ke, PTeleportContainer as pe, PToastContainer as Ze } from "@profeat/ui-kit";
4
- function He(s, n = 2) {
5
- if (s === 0)
1
+ import { ref as w, shallowRef as Le, defineComponent as H, defineAsyncComponent as J, watch as ze, createBlock as I, createCommentVNode as C, unref as m, openBlock as y, resolveDynamicComponent as Me, mergeProps as Re, computed as T, reactive as q, onMounted as Ge, createElementBlock as k, Fragment as me, createVNode as g, createElementVNode as Y, withCtx as A, toDisplayString as F, createTextVNode as _, Teleport as ue, Transition as je, withDirectives as Je, vShow as qe } from "vue";
2
+ import Ye from "axios";
3
+ import { PInputFileUploader as _e, PInput as L, IconFilledEditMd as z, PButton as de, PImageCropper as We, PToast as Ke, PTeleportContainer as pe, PToastContainer as Ze } from "@profeat/ui-kit";
4
+ function He(l, r = 2) {
5
+ if (l === 0)
6
6
  return "0 B";
7
- const r = 1024, u = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], v = Math.floor(Math.log(s) / Math.log(r));
8
- return `${Number.parseFloat((s / r ** v).toFixed(n))} ${u[v]}`;
7
+ const n = 1024, u = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], v = Math.floor(Math.log(l) / Math.log(n));
8
+ return `${Number.parseFloat((l / n ** v).toFixed(r))} ${u[v]}`;
9
9
  }
10
10
  const Qe = {
11
11
  "image/jpeg": "JPEG",
@@ -15,13 +15,13 @@ const Qe = {
15
15
  "application/zip": "ZIP Archive"
16
16
  // ...
17
17
  };
18
- function Xe(s) {
19
- return s.map((n) => {
20
- var r;
21
- return Qe[n] || ((r = n.split("/")[1]) == null ? void 0 : r.toUpperCase());
18
+ function Xe(l) {
19
+ return l.map((r) => {
20
+ var n;
21
+ return Qe[r] || ((n = r.split("/")[1]) == null ? void 0 : n.toUpperCase());
22
22
  });
23
23
  }
24
- const Ca = {
24
+ const ba = {
25
25
  OLD: "old",
26
26
  NEW: "new",
27
27
  COMPLETED: "completed"
@@ -29,15 +29,15 @@ const Ca = {
29
29
  VERIFY_EMAIL: "verify-email"
30
30
  };
31
31
  let K = null;
32
- function ea(s, n) {
33
- K = _e.create({
34
- baseURL: n,
32
+ function ea(l, r) {
33
+ K = Ye.create({
34
+ baseURL: r,
35
35
  headers: {
36
- Authorization: `Bearer ${s}`,
36
+ Authorization: `Bearer ${l}`,
37
37
  // 'Content-Type': 'application/json',
38
38
  "x-throttler-prefix": "throttler_profile_edit"
39
39
  },
40
- validateStatus: (r) => r >= 200 && r < 300
40
+ validateStatus: (n) => n >= 200 && n < 300
41
41
  });
42
42
  }
43
43
  function Q() {
@@ -45,22 +45,22 @@ function Q() {
45
45
  throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
46
46
  return K;
47
47
  }
48
- async function Z(s, n, r) {
49
- return Q().post(s, n, r);
48
+ async function Z(l, r, n) {
49
+ return Q().post(l, r, n);
50
50
  }
51
- async function aa(s, n) {
52
- return Q().get(s, n);
51
+ async function aa(l, r) {
52
+ return Q().get(l, r);
53
53
  }
54
- async function ta(s, n) {
55
- return Q().delete(s, n);
54
+ async function ta(l, r) {
55
+ return Q().delete(l, r);
56
56
  }
57
- async function oa(s) {
58
- const n = await Z("/users/profile/me", s);
59
- if (console.log("---res: ", n), n.status !== 200 && n.status !== 201 || !n.data)
57
+ async function oa(l) {
58
+ const r = await Z("/users/profile/me", l);
59
+ if (r.status !== 200 && r.status !== 201 || !r.data)
60
60
  throw new Error("Ошибка при получении профиля пользователя");
61
- return n.data;
61
+ return r.data;
62
62
  }
63
- const M = h(null), W = Oe(null);
63
+ const M = w(null), W = Le(null);
64
64
  function X() {
65
65
  return {
66
66
  currentDialog: M,
@@ -74,7 +74,7 @@ function X() {
74
74
  isDialogOpen: (u) => M.value === u
75
75
  };
76
76
  }
77
- const ra = {
77
+ const na = {
78
78
  ru: {
79
79
  Имя: "Имя",
80
80
  Фамилия: "Фамилия",
@@ -207,40 +207,42 @@ const ra = {
207
207
  "Введите новый номер телефона": "Enter a new phone number",
208
208
  "Телефон успешно изменен": "Phone number successfully changed"
209
209
  }
210
- }, na = /* @__PURE__ */ H({
210
+ }, ra = /* @__PURE__ */ H({
211
211
  __name: "DialogManager",
212
212
  props: {
213
213
  language: {},
214
- provider: {}
214
+ provider: {},
215
+ onDisableAddPhone: { type: Boolean }
215
216
  },
216
217
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
217
- setup(s, { emit: n }) {
218
- const r = n, u = h(!0), { currentDialog: v, dialogPayload: c, closeDialog: U } = X(), l = {
219
- email: J(() => import("./ProfileEmailDialog-rzPRsM0B.js")),
220
- phone: J(() => import("./ProfilePhoneDialog-DyDCK0A6.js")),
221
- password: J(() => import("./ProfilePasswordDialog-FRHBCNZO.js"))
222
- }, i = ({ email: y }) => {
223
- r("update-email-field", y);
224
- }, p = ({ phone: y }) => {
225
- r("update-phone-field", y);
218
+ setup(l, { emit: r }) {
219
+ const n = r, u = w(!0), { currentDialog: v, dialogPayload: c, closeDialog: U } = X(), i = {
220
+ email: J(() => import("./ProfileEmailDialog-CLM-pIRG.js")),
221
+ phone: J(() => import("./ProfilePhoneDialog-BdAKmUji.js")),
222
+ password: J(() => import("./ProfilePasswordDialog-BY5VAdH3.js"))
223
+ }, s = ({ email: h }) => {
224
+ n("update-email-field", h);
225
+ }, p = ({ phone: h }) => {
226
+ n("update-phone-field", h);
226
227
  };
227
- return ze(v, (y) => {
228
- u.value = !!y;
229
- }), (y, m) => d(v) ? (w(), S(Me(l[d(v)]), Re({
228
+ return ze(v, (h) => {
229
+ u.value = !!h;
230
+ }), (h, d) => m(v) ? (y(), I(Me(i[m(v)]), Re({
230
231
  key: 0,
231
232
  modelValue: u.value,
232
- "onUpdate:modelValue": m[0] || (m[0] = (g) => u.value = g),
233
- language: y.language,
234
- provider: y.provider
235
- }, d(c), {
236
- onClose: d(U),
237
- onCleanInputErrors: m[1] || (m[1] = (g) => r("clean-input-errors")),
238
- onOnUpdateJwt: m[2] || (m[2] = (g, C, o) => r("on-update-jwt", g, C, o)),
239
- onSubmitEmail: i,
233
+ "onUpdate:modelValue": d[0] || (d[0] = (f) => u.value = f),
234
+ language: h.language,
235
+ provider: h.provider,
236
+ "on-disable-add-phone": h.onDisableAddPhone
237
+ }, m(c), {
238
+ onClose: m(U),
239
+ onCleanInputErrors: d[1] || (d[1] = (f) => n("clean-input-errors")),
240
+ onOnUpdateJwt: d[2] || (d[2] = (f, b, o) => n("on-update-jwt", f, b, o)),
241
+ onSubmitEmail: s,
240
242
  onSubmitPhone: p,
241
- onOnPasswordError: m[3] || (m[3] = (g, C) => r("on-password-error", g, C)),
242
- onOnToast: m[4] || (m[4] = (g) => r("on-toast", g))
243
- }), null, 16, ["modelValue", "language", "provider", "onClose"])) : b("", !0);
243
+ onOnPasswordError: d[3] || (d[3] = (f, b) => n("on-password-error", f, b)),
244
+ onOnToast: d[4] || (d[4] = (f) => n("on-toast", f))
245
+ }), null, 16, ["modelValue", "language", "provider", "on-disable-add-phone", "onClose"])) : C("", !0);
244
246
  }
245
247
  }), sa = { class: "base-container" }, la = {
246
248
  key: 0,
@@ -248,19 +250,19 @@ const ra = {
248
250
  }, ia = { key: 1 }, ua = {
249
251
  key: 1,
250
252
  class: "input-wrapper"
251
- }, ma = {
253
+ }, da = {
252
254
  key: 2,
253
255
  class: "input-wrapper"
254
- }, da = {
256
+ }, ma = {
255
257
  key: 3,
256
258
  class: "input-wrapper"
257
259
  }, pa = {
258
260
  key: 4,
259
261
  class: "input-wrapper"
260
- }, ca = { class: "buttons-container" }, ga = {
262
+ }, ca = { class: "buttons-container" }, fa = {
261
263
  key: 0,
262
264
  class: "centered-overlay"
263
- }, fa = { class: "toastWrapper" }, va = /* @__PURE__ */ H({
265
+ }, ga = { class: "toastWrapper" }, va = /* @__PURE__ */ H({
264
266
  __name: "PEditUserContact",
265
267
  props: {
266
268
  language: {},
@@ -270,11 +272,12 @@ const ra = {
270
272
  accessToken: {},
271
273
  refreshToken: {},
272
274
  fields: {},
273
- awsStorageUrl: {}
275
+ awsStorageUrl: {},
276
+ onDisableAddPhone: { type: Boolean }
274
277
  },
275
278
  emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
276
- setup(s, { emit: n }) {
277
- const r = s, u = n, v = T(() => r.language ?? "ru"), c = (e) => ra[v.value][e] || e, { openDialog: U } = X(), l = q({ firstName: "", lastName: "" }), i = h({ firstName: "", lastName: "" }), p = q({ firstName: !1, lastName: !1, email: !1, phone: !1 }), y = h(""), m = h(""), g = h(""), C = h(!1), o = q({
279
+ setup(l, { emit: r }) {
280
+ const n = l, u = r, v = T(() => n.language ?? "ru"), c = (e) => na[v.value][e] || e, { openDialog: U } = X(), i = q({ firstName: "", lastName: "" }), s = w({ firstName: "", lastName: "" }), p = q({ firstName: !1, lastName: !1, email: !1, phone: !1 }), h = w(""), d = w(""), f = w(""), b = w(!1), o = q({
278
281
  value: null,
279
282
  loading: !1,
280
283
  accept: ["image/png", "image/jpeg"],
@@ -282,68 +285,68 @@ const ra = {
282
285
  // 10 MB
283
286
  imageBinary: null,
284
287
  imageContent: ""
285
- }), B = h(""), A = h(!1), R = h(!0), G = h(!0), ee = h(void 0), ae = h(""), ce = T(() => oe(l.firstName, p.firstName)), ge = T(() => oe(l.lastName, p.lastName)), fe = T(() => p.email && !m.value.trim() ? "Введите e-mail" : ""), ve = T(() => p.phone && !g.value.trim() ? "Введите номер телефона" : ""), F = (e) => r.fields.some((a) => a.key === e), te = (e) => e && e.trim() ? "edit" : "bind", j = () => setTimeout(() => {
288
+ }), B = w(""), S = w(!1), R = w(!0), G = w(!0), ee = w(void 0), ae = w(""), ce = T(() => oe(i.firstName, p.firstName)), fe = T(() => oe(i.lastName, p.lastName)), ge = T(() => p.email && !d.value.trim() ? "Введите e-mail" : ""), ve = T(() => p.phone && !f.value.trim() ? "Введите номер телефона" : ""), D = (e) => n.fields.some((a) => a.key === e), te = (e) => e && e.trim() ? "edit" : "bind", j = () => setTimeout(() => {
286
289
  var e;
287
290
  return (e = document.activeElement) == null ? void 0 : e.blur();
288
- }, 0), he = T(() => !!(m.value && m.value.trim() !== "")), we = T(() => o.imageContent ? c("Загрузить другое фото") : c("Загрузить фото")), oe = (e, a) => {
291
+ }, 0), he = T(() => !!(d.value && d.value.trim() !== "")), we = T(() => o.imageContent ? c("Загрузить другое фото") : c("Загрузить фото")), oe = (e, a) => {
289
292
  if (!a) return "";
290
293
  const t = e.trim();
291
294
  return t ? t.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
292
295
  }, ye = (e) => U("email", { mode: e ? "edit" : "bind", initialEmail: e }), Ee = () => {
293
- j(), p.email = !1, G.value = !1, u("open-email-dialog", m.value, te(m.value)), ye(m.value);
296
+ j(), p.email = !1, G.value = !1, u("open-email-dialog", d.value, te(d.value)), ye(d.value);
294
297
  }, Ne = () => {
295
- j(), p.phone = !1, R.value = !1, u("open-phone-dialog", g.value, te(g.value));
296
- }, Ce = async (e, a, t) => {
297
- e === "email" && t && (m.value = t), e === "phone" && t && (g.value = t), u("on-update-jwt");
298
+ j(), p.phone = !1, R.value = !1, u("open-phone-dialog", f.value, te(f.value));
299
+ }, be = async (e, a, t) => {
300
+ e === "email" && t && (d.value = t), e === "phone" && t && (f.value = t), u("on-update-jwt");
298
301
  }, Pe = (e) => {
299
- g.value = e;
300
- }, be = (e) => {
301
- console.debug("emitUpdateEmailField, цепочка такая: profileEmailDialog -> DialogManager -> PEditUserContact", e), m.value = e;
302
+ f.value = e;
303
+ }, Ce = (e) => {
304
+ d.value = e;
302
305
  }, ke = (e, a) => {
303
- A.value = !0, u("on-password-error", e, a);
306
+ S.value = !0, u("on-password-error", e, a);
304
307
  }, Te = () => {
305
308
  R.value = !1, G.value = !1;
306
309
  }, V = (e) => {
307
- A.value = !0, ee.value = e.color ?? "", ae.value = e.text ?? "";
310
+ S.value = !0, ee.value = e.color ?? "", ae.value = e.text ?? "";
308
311
  }, x = (e) => {
309
312
  if (p[e] = !0, e === "firstName" || e === "lastName") {
310
- const a = l[e];
311
- a.length > 40 && (l[e] = a.slice(0, 40), console.debug(`[Input Limit] Поле '${e}' достигло 40 символов. Ввод обрезан.`));
313
+ const a = i[e];
314
+ a.length > 40 && (i[e] = a.slice(0, 40));
312
315
  }
313
316
  }, Ue = (e) => {
314
- var $, L;
317
+ var $, O;
315
318
  if (B.value = "", !e) {
316
- re();
319
+ ne();
317
320
  return;
318
321
  }
319
- const a = (($ = e.fileBinary) == null ? void 0 : $.type) ?? "", t = ((L = e.fileBinary) == null ? void 0 : L.size) ?? 0, P = !["image/png", "image/jpeg"].includes(a), N = t > o.uploadLimit;
322
+ const a = (($ = e.fileBinary) == null ? void 0 : $.type) ?? "", t = ((O = e.fileBinary) == null ? void 0 : O.size) ?? 0, P = !["image/png", "image/jpeg"].includes(a), N = t > o.uploadLimit;
320
323
  if (P || N) {
321
- B.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", re();
324
+ B.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", ne();
322
325
  return;
323
326
  }
324
- o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", C.value = !0;
325
- }, re = () => {
326
- o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
327
+ o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", b.value = !0;
328
+ }, ne = () => {
329
+ o.value = null, o.imageBinary = null, o.imageContent = "", b.value = !1;
327
330
  }, Be = async () => {
328
331
  try {
329
332
  const a = (await ta("/users/profile/delete/avatar")).data;
330
- return (a == null ? void 0 : a.success) !== !0 ? (console.warn("Сервер не подтвердил успешное удаление аватара."), console.warn("Ответ сервера:", a), !1) : !0;
333
+ return (a == null ? void 0 : a.success) === !0;
331
334
  } catch (e) {
332
335
  return console.error("Ошибка при удалении аватара:", e), !1;
333
336
  }
334
- }, Fe = () => {
335
- B.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
336
- }, ne = async (e, a, t = "image/png") => {
337
+ }, De = () => {
338
+ B.value = "Файл не подходит. Пожалуйста, загрузите PNG или JPEG размером до 10 МБ", o.value = null, o.imageBinary = null, o.imageContent = "", b.value = !1;
339
+ }, re = async (e, a, t = "image/png") => {
337
340
  if (!e) return null;
338
341
  const P = await (await fetch(e)).blob();
339
342
  return new File([P], a, { type: t });
340
- }, De = () => {
341
- o.value = null, o.imageBinary = null, o.imageContent = "", C.value = !1;
342
- }, Ie = async (e) => {
343
- C.value = !1;
343
+ }, Ae = () => {
344
+ o.value = null, o.imageBinary = null, o.imageContent = "", b.value = !1;
345
+ }, Fe = async (e) => {
346
+ b.value = !1;
344
347
  const a = o.imageContent;
345
348
  if (o.imageContent = e, !o.imageBinary) return;
346
- const t = await ne(
349
+ const t = await re(
347
350
  e,
348
351
  o.imageBinary.name,
349
352
  o.imageBinary.type || "image/png"
@@ -355,7 +358,7 @@ const ra = {
355
358
  try {
356
359
  o.loading = !0;
357
360
  const E = new FormData();
358
- E.append("file", t), await Z(`/users/profile/avatar/${y.value}`, E, { headers: { "Content-Type": void 0 } });
361
+ E.append("file", t), await Z(`/users/profile/avatar/${h.value}`, E, { headers: { "Content-Type": void 0 } });
359
362
  } catch (E) {
360
363
  console.error(E), V({
361
364
  color: "error",
@@ -364,36 +367,36 @@ const ra = {
364
367
  } finally {
365
368
  o.loading = !1;
366
369
  }
367
- }, Se = async (e) => {
368
- o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await ne(
370
+ }, Ie = async (e) => {
371
+ o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await re(
369
372
  e ?? "",
370
373
  o.imageBinary.name,
371
374
  o.imageBinary.type || "image/png"
372
375
  ));
373
- }, se = h(!1), le = async (e) => {
376
+ }, se = w(!1), le = async (e) => {
374
377
  var t, E;
375
- const a = (t = l[e]) == null ? void 0 : t.trim();
378
+ const a = (t = i[e]) == null ? void 0 : t.trim();
376
379
  if (a)
377
380
  try {
378
381
  se.value = !0;
379
382
  const N = (E = (await Z("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : E.data;
380
- N != null && N.user && (l.firstName = N.user.firstName ?? l.firstName, l.lastName = N.user.lastName ?? l.lastName, i.value = {
381
- firstName: l.firstName,
382
- lastName: l.lastName
383
+ N != null && N.user && (i.firstName = N.user.firstName ?? i.firstName, i.lastName = N.user.lastName ?? i.lastName, s.value = {
384
+ firstName: i.firstName,
385
+ lastName: i.lastName
383
386
  });
384
387
  } catch (P) {
385
388
  throw P;
386
389
  } finally {
387
390
  se.value = !1;
388
391
  }
389
- }, Ae = async () => {
392
+ }, Se = async () => {
390
393
  var e;
391
- if (!r.accessToken)
394
+ if (!n.accessToken)
392
395
  throw console.error("Access token не передан в props"), new Error("Access token is required");
393
396
  try {
394
397
  const t = (e = (await oa({
395
- accessToken: r.accessToken,
396
- refreshToken: r.refreshToken ?? "",
398
+ accessToken: n.accessToken,
399
+ refreshToken: n.refreshToken ?? "",
397
400
  excludeFields: []
398
401
  })).data) == null ? void 0 : e.user;
399
402
  if (!t)
@@ -403,9 +406,9 @@ const ra = {
403
406
  privateFirstName: P,
404
407
  privateLastName: N,
405
408
  email: $,
406
- phoneNumber: L
409
+ phoneNumber: O
407
410
  } = t;
408
- y.value = E ?? "", l.firstName = P ?? "", l.lastName = N ?? "", m.value = $ ?? "", g.value = L ?? "", o.imageContent = await Ve(), i.value = {
411
+ h.value = E ?? "", i.firstName = P ?? "", i.lastName = N ?? "", d.value = $ ?? "", f.value = O ?? "", o.imageContent = await Ve(), s.value = {
409
412
  firstName: P ?? "",
410
413
  lastName: N ?? ""
411
414
  };
@@ -416,7 +419,7 @@ const ra = {
416
419
  var e;
417
420
  try {
418
421
  const t = (e = (await aa("/users/profile/avatar")).data) == null ? void 0 : e.data;
419
- return t ? xe(t) : (console.warn("Метаданные аватара отсутствуют в ответе."), "");
422
+ return t ? xe(t) : "";
420
423
  } catch (a) {
421
424
  return console.error("Ошибка при загрузке метаданных аватара:", a), "";
422
425
  }
@@ -425,15 +428,15 @@ const ra = {
425
428
  if (!e)
426
429
  return "";
427
430
  try {
428
- return new URL(e.key, r.awsStorageUrl).toString();
431
+ return new URL(e.key, n.awsStorageUrl).toString();
429
432
  } catch (a) {
430
433
  return console.error("Ошибка при составлении URL аватара:", a), "";
431
434
  }
432
435
  }
433
436
  const ie = T(() => {
434
- if (!i.value.firstName && !i.value.lastName)
437
+ if (!s.value.firstName && !s.value.lastName)
435
438
  return !1;
436
- const e = l.firstName.trim(), a = l.lastName.trim(), t = i.value.firstName.trim(), E = i.value.lastName.trim(), P = e !== t || a !== E, N = e.length >= 2 && a.length >= 2;
439
+ const e = i.firstName.trim(), a = i.lastName.trim(), t = s.value.firstName.trim(), E = s.value.lastName.trim(), P = e !== t || a !== E, N = e.length >= 2 && a.length >= 2;
437
440
  return P && N;
438
441
  }), $e = async () => {
439
442
  if (ie.value)
@@ -445,26 +448,27 @@ const ra = {
445
448
  text: c("Не удалось сохранить изменения. Попробуйте позже")
446
449
  });
447
450
  }
448
- }, Le = () => {
451
+ }, Oe = () => {
449
452
  j(), u("open-password-dialog");
450
453
  };
451
454
  return Ge(async () => {
452
- if (!r.accessToken) throw new Error("Access token не передан в props");
453
- if (!r.requestUrl) throw new Error("auth-backend url не передан в props");
454
- ea(r.accessToken, r.requestUrl), await Ae();
455
- }), (e, a) => (w(), k(de, null, [
456
- f(na, {
455
+ if (!n.accessToken) throw new Error("Access token не передан в props");
456
+ if (!n.requestUrl) throw new Error("auth-backend url не передан в props");
457
+ ea(n.accessToken, n.requestUrl), await Se();
458
+ }), (e, a) => (y(), k(me, null, [
459
+ g(ra, {
457
460
  language: v.value,
458
461
  provider: e.provider,
462
+ "on-disable-add-phone": e.onDisableAddPhone,
459
463
  onCleanInputErrors: Te,
460
- onOnUpdateJwt: Ce,
464
+ onOnUpdateJwt: be,
461
465
  onUpdatePhoneField: Pe,
462
- onUpdateEmailField: be,
466
+ onUpdateEmailField: Ce,
463
467
  onOnPasswordError: ke,
464
468
  onOnToast: V
465
- }, null, 8, ["language", "provider"]),
466
- _("div", sa, [
467
- F("avatar") ? (w(), S(d(Ye), {
469
+ }, null, 8, ["language", "provider", "on-disable-add-phone"]),
470
+ Y("div", sa, [
471
+ D("avatar") ? (y(), I(m(_e), {
468
472
  key: 0,
469
473
  modelValue: o.value,
470
474
  "onUpdate:modelValue": [
@@ -479,61 +483,61 @@ const ra = {
479
483
  "upload-limit": o.uploadLimit,
480
484
  accept: "image/jpeg, image/png",
481
485
  onDelete: Be,
482
- "onChange:error": Fe
486
+ "onChange:error": De
483
487
  }, {
484
- afterLoadLabel: D(() => [
485
- Y(I(we.value), 1)
488
+ afterLoadLabel: A(() => [
489
+ _(F(we.value), 1)
486
490
  ]),
487
- subtext: D(() => [
488
- B.value ? (w(), k("span", la, I(B.value), 1)) : (w(), k("span", ia, I(`${c("Формат")} ${d(Xe)(o.accept).join(", ")} ${c("до")} ${d(He)(o.uploadLimit)}`), 1))
491
+ subtext: A(() => [
492
+ B.value ? (y(), k("span", la, F(B.value), 1)) : (y(), k("span", ia, F(`${c("Формат")} ${m(Xe)(o.accept).join(", ")} ${c("до")} ${m(He)(o.uploadLimit)}`), 1))
489
493
  ]),
490
494
  _: 1
491
- }, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : b("", !0),
492
- F("firstName") ? (w(), k("div", ua, [
493
- f(d(O), {
494
- modelValue: l.firstName,
495
- "onUpdate:modelValue": a[2] || (a[2] = (t) => l.firstName = t),
495
+ }, 8, ["modelValue", "src", "loading", "label", "upload-limit"])) : C("", !0),
496
+ D("firstName") ? (y(), k("div", ua, [
497
+ g(m(L), {
498
+ modelValue: i.firstName,
499
+ "onUpdate:modelValue": a[2] || (a[2] = (t) => i.firstName = t),
496
500
  size: "large",
497
501
  label: c("Имя"),
498
502
  error: ce.value,
499
503
  onBlur: a[3] || (a[3] = (t) => p.firstName = !0),
500
504
  onInput: a[4] || (a[4] = (t) => x("firstName"))
501
505
  }, null, 8, ["modelValue", "label", "error"]),
502
- f(d(z), { class: "icon-locked" })
503
- ])) : b("", !0),
504
- F("lastName") ? (w(), k("div", ma, [
505
- f(d(O), {
506
- modelValue: l.lastName,
507
- "onUpdate:modelValue": a[5] || (a[5] = (t) => l.lastName = t),
506
+ g(m(z), { class: "icon-locked" })
507
+ ])) : C("", !0),
508
+ D("lastName") ? (y(), k("div", da, [
509
+ g(m(L), {
510
+ modelValue: i.lastName,
511
+ "onUpdate:modelValue": a[5] || (a[5] = (t) => i.lastName = t),
508
512
  size: "large",
509
513
  label: c("Фамилия"),
510
- error: ge.value,
514
+ error: fe.value,
511
515
  onBlur: a[6] || (a[6] = (t) => p.lastName = !0),
512
516
  onInput: a[7] || (a[7] = (t) => x("lastName"))
513
517
  }, null, 8, ["modelValue", "label", "error"]),
514
- f(d(z), { class: "icon-locked" })
515
- ])) : b("", !0),
516
- F("email") ? (w(), k("div", da, [
517
- f(d(O), {
518
- modelValue: m.value,
519
- "onUpdate:modelValue": a[8] || (a[8] = (t) => m.value = t),
518
+ g(m(z), { class: "icon-locked" })
519
+ ])) : C("", !0),
520
+ D("email") ? (y(), k("div", ma, [
521
+ g(m(L), {
522
+ modelValue: d.value,
523
+ "onUpdate:modelValue": a[8] || (a[8] = (t) => d.value = t),
520
524
  size: "large",
521
525
  "text-size": "medium",
522
526
  label: "E-mail",
523
527
  type: "email",
524
528
  readonly: "",
525
529
  style: { cursor: "pointer" },
526
- error: fe.value && G.value,
530
+ error: ge.value && G.value,
527
531
  onBlur: a[9] || (a[9] = (t) => p.email = !0),
528
532
  onInput: a[10] || (a[10] = (t) => x("email")),
529
533
  onClick: Ee
530
534
  }, null, 8, ["modelValue", "error"]),
531
- f(d(z), { class: "icon-locked" })
532
- ])) : b("", !0),
533
- F("phone") ? (w(), k("div", pa, [
534
- f(d(O), {
535
- modelValue: g.value,
536
- "onUpdate:modelValue": a[11] || (a[11] = (t) => g.value = t),
535
+ g(m(z), { class: "icon-locked" })
536
+ ])) : C("", !0),
537
+ D("phone") ? (y(), k("div", pa, [
538
+ g(m(L), {
539
+ modelValue: f.value,
540
+ "onUpdate:modelValue": a[11] || (a[11] = (t) => f.value = t),
537
541
  size: "large",
538
542
  "text-size": "medium",
539
543
  label: c("Номер телефона"),
@@ -545,70 +549,70 @@ const ra = {
545
549
  onInput: a[13] || (a[13] = (t) => x("phone")),
546
550
  onClick: Ne
547
551
  }, null, 8, ["modelValue", "label", "error"]),
548
- f(d(z), { class: "icon-locked" })
549
- ])) : b("", !0),
550
- _("div", ca, [
551
- he.value ? (w(), S(d(me), {
552
+ g(m(z), { class: "icon-locked" })
553
+ ])) : C("", !0),
554
+ Y("div", ca, [
555
+ he.value ? (y(), I(m(de), {
552
556
  key: 0,
553
557
  color: "secondary",
554
- onClick: Le
558
+ onClick: Oe
555
559
  }, {
556
- default: D(() => [
557
- Y(I(c("Сменить пароль")), 1)
560
+ default: A(() => [
561
+ _(F(c("Сменить пароль")), 1)
558
562
  ]),
559
563
  _: 1
560
- })) : b("", !0),
561
- f(d(me), {
564
+ })) : C("", !0),
565
+ g(m(de), {
562
566
  disabled: !ie.value,
563
567
  onClick: $e
564
568
  }, {
565
- default: D(() => [
566
- Y(I(c("Сохранить")), 1)
569
+ default: A(() => [
570
+ _(F(c("Сохранить")), 1)
567
571
  ]),
568
572
  _: 1
569
573
  }, 8, ["disabled"])
570
574
  ])
571
575
  ]),
572
- C.value ? (w(), S(ue, {
576
+ b.value ? (y(), I(ue, {
573
577
  key: 0,
574
578
  to: "body"
575
579
  }, [
576
- C.value ? (w(), k("div", ga, [
577
- f(d(We), {
580
+ b.value ? (y(), k("div", fa, [
581
+ g(m(We), {
578
582
  "circle-mode": !0,
579
583
  "model-value": o.imageContent,
580
- onClose: De,
581
- onSave: a[14] || (a[14] = (t) => Ie(t)),
582
- "onUpdate:modelValue": a[15] || (a[15] = (t) => Se(t))
584
+ onClose: Ae,
585
+ onSave: a[14] || (a[14] = (t) => Fe(t)),
586
+ "onUpdate:modelValue": a[15] || (a[15] = (t) => Ie(t))
583
587
  }, null, 8, ["model-value"])
584
- ])) : b("", !0)
585
- ])) : b("", !0),
586
- (w(), S(ue, { to: "#toast-root" }, [
587
- _("div", fa, [
588
- f(je, { name: "list" }, {
589
- default: D(() => [
590
- Je(f(d(Ke), {
588
+ ])) : C("", !0)
589
+ ])) : C("", !0),
590
+ (y(), I(ue, { to: "#toast-root" }, [
591
+ Y("div", ga, [
592
+ g(je, { name: "list" }, {
593
+ default: A(() => [
594
+ Je(g(m(Ke), {
591
595
  class: "toast",
592
596
  color: ee.value,
593
597
  text: ae.value,
594
- onClose: a[16] || (a[16] = (t) => A.value = !1)
598
+ onClose: a[16] || (a[16] = (t) => S.value = !1)
595
599
  }, null, 8, ["color", "text"]), [
596
- [qe, A.value]
600
+ [qe, S.value]
597
601
  ])
598
602
  ]),
599
603
  _: 1
600
604
  })
601
605
  ])
602
606
  ])),
603
- f(d(pe))
607
+ g(m(pe))
604
608
  ], 64));
605
609
  }
606
- }), ha = (s, n) => {
607
- const r = s.__vccOpts || s;
608
- for (const [u, v] of n)
609
- r[u] = v;
610
- return r;
611
- }, wa = /* @__PURE__ */ ha(va, [["__scopeId", "data-v-7d90f646"]]), ba = /* @__PURE__ */ H({
610
+ }), ha = (l, r) => {
611
+ const n = l.__vccOpts || l;
612
+ for (const [u, v] of r)
613
+ n[u] = v;
614
+ return n;
615
+ }, wa = /* @__PURE__ */ ha(va, [["__scopeId", "data-v-05cc0841"]]), Ca = /* @__PURE__ */ H({
612
616
  __name: "index",
613
617
  props: {
614
618
  throttlerPrefix: {},
@@ -618,45 +622,47 @@ const ra = {
618
622
  refreshToken: {},
619
623
  language: {},
620
624
  fields: {},
621
- awsStorageUrl: {}
625
+ awsStorageUrl: {},
626
+ onDisableAddPhone: { type: Boolean }
622
627
  },
623
628
  emits: ["on-update-jwt", "update-tokens"],
624
- setup(s, { emit: n }) {
625
- const r = n, { openDialog: u } = X(), v = (i, p) => {
626
- u("email", { initialEmail: i, mode: p });
627
- }, c = (i, p) => {
628
- u("phone", { initialPhone: i, mode: p });
629
+ setup(l, { emit: r }) {
630
+ const n = r, { openDialog: u } = X(), v = (s, p) => {
631
+ u("email", { initialEmail: s, mode: p });
632
+ }, c = (s, p) => {
633
+ u("phone", { initialPhone: s, mode: p });
629
634
  }, U = () => {
630
635
  u("password");
631
- }, l = (i, p, y) => {
632
- r("on-update-jwt", i, p, y);
636
+ }, i = (s, p, h) => {
637
+ n("on-update-jwt", s, p, h);
633
638
  };
634
- return (i, p) => (w(), k(de, null, [
635
- f(d(Ze)),
636
- f(wa, {
637
- "throttler-prefix": i.throttlerPrefix,
638
- provider: i.provider,
639
- "request-url": i.requestUrl,
640
- language: i.language,
641
- fields: i.fields,
642
- "access-token": i.accessToken,
643
- "refresh-token": i.refreshToken,
644
- "aws-storage-url": i.awsStorageUrl,
639
+ return (s, p) => (y(), k(me, null, [
640
+ g(m(Ze)),
641
+ g(wa, {
642
+ "throttler-prefix": s.throttlerPrefix,
643
+ provider: s.provider,
644
+ "request-url": s.requestUrl,
645
+ language: s.language,
646
+ fields: s.fields,
647
+ "access-token": s.accessToken,
648
+ "refresh-token": s.refreshToken,
649
+ "aws-storage-url": s.awsStorageUrl,
650
+ "on-disable-add-phone": s.onDisableAddPhone,
645
651
  onOpenEmailDialog: v,
646
652
  onOpenPhoneDialog: c,
647
653
  onOpenPasswordDialog: U,
648
- onOnUpdateJwt: l
649
- }, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url"]),
650
- f(d(pe))
654
+ onOnUpdateJwt: i
655
+ }, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token", "aws-storage-url", "on-disable-add-phone"]),
656
+ g(m(pe))
651
657
  ], 64));
652
658
  }
653
659
  });
654
660
  export {
655
661
  Pa as B,
656
- Ca as C,
662
+ ba as C,
657
663
  ha as _,
658
- ba as a,
664
+ Ca as a,
659
665
  aa as g,
660
666
  Z as p,
661
- ra as t
667
+ na as t
662
668
  };