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