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