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