@yourgoods/ui-smart 0.10.0 → 0.14.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,8 +1,8 @@
1
- import { defineComponent as Z, ref as M, reactive as J, watch as j, computed as V, toRefs as se, createElementBlock as k, openBlock as y, createElementVNode as S, createCommentVNode as P, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as q, createTextVNode as te, Fragment as Oe, createBlock as R, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
2
- import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-CE_s_ZHL.js";
3
- import { C as D, _ as ze, B as We, p as F, g as He } from "./index-CxaQqcNf.js";
4
- import { PInput as _, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as _e } from "@profeat/ui-kit";
5
- const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dialogDefaultContainerTextHint" }, Je = {
1
+ import { defineComponent as Z, ref as M, reactive as J, watch as j, computed as V, toRefs as se, createElementBlock as k, openBlock as y, createElementVNode as S, createCommentVNode as P, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as q, createTextVNode as te, Fragment as De, createBlock as R, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
2
+ import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-CBVGtgi4.js";
3
+ import { C as D, _ as ze, B as We, p as F, g as He } from "./index-DlfTVxHI.js";
4
+ import { PInput as G, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as Ge } from "@profeat/ui-kit";
5
+ const Ye = { class: "dialogDefaultContainerInsideContent" }, _e = { class: "dialogDefaultContainerTextHint" }, Je = {
6
6
  key: 0,
7
7
  class: "input-wrapper"
8
8
  }, Ke = {
@@ -63,14 +63,14 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
63
63
  }), v.value = !0;
64
64
  };
65
65
  let $ = "";
66
- const O = (i) => {
66
+ const N = (i) => {
67
67
  r("on-clear-code-error");
68
68
  const l = i.target;
69
69
  let d = l.value.replace(/\D/g, "");
70
70
  d.length > 4 && (d = d.slice(0, 4)), l.value = d, n.codeModel = d, d.length === 4 && d !== $ && ($ = d, r("on-match-code", { email: n.emailModel, code: d }));
71
71
  }, B = () => {
72
72
  r("on-send-code-again", { email: n.emailModel });
73
- }, N = V(() => {
73
+ }, O = V(() => {
74
74
  if (e.value) return e.value;
75
75
  if (n.touched.email) {
76
76
  if (!n.emailModel.trim()) return "Введите e-mail";
@@ -80,17 +80,17 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
80
80
  }), E = V(() => p.isNotMatchCode ? "Неверный код" : n.touched.code ? h.value.trim() ? p.codeError ?? null : "Введите код" : ""), { emailModel: m, codeModel: h } = se(n);
81
81
  return (i, l) => {
82
82
  const d = de;
83
- return y(), k("div", Ge, [
84
- S("div", Ye, K(v.value ? "Введите код подтверждения" : i.hintText), 1),
83
+ return y(), k("div", Ye, [
84
+ S("div", _e, K(v.value ? "Введите код подтверждения" : i.hintText), 1),
85
85
  i.showEmail ? (y(), k("div", Je, [
86
- b(c(_), {
86
+ b(c(G), {
87
87
  modelValue: c(m),
88
88
  "onUpdate:modelValue": l[0] || (l[0] = (C) => Q(m) ? m.value = C : null),
89
89
  size: "large",
90
90
  "text-size": "medium",
91
91
  label: "Почта",
92
92
  type: "email",
93
- error: N.value,
93
+ error: O.value,
94
94
  onBlur: l[1] || (l[1] = (C) => g("email")),
95
95
  onInput: l[2] || (l[2] = (C) => g("email"))
96
96
  }, null, 8, ["modelValue", "error"]),
@@ -113,7 +113,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
113
113
  }, 8, ["disabled"])
114
114
  ])),
115
115
  v.value ? (y(), k("div", Qe, [
116
- b(c(_), {
116
+ b(c(G), {
117
117
  modelValue: c(h),
118
118
  "onUpdate:modelValue": l[4] || (l[4] = (C) => Q(h) ? h.value = C : null),
119
119
  size: "large",
@@ -121,7 +121,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
121
121
  label: "Код",
122
122
  type: "text",
123
123
  error: E.value,
124
- onInput: O,
124
+ onInput: N,
125
125
  onBlur: l[5] || (l[5] = (C) => g("code"))
126
126
  }, null, 8, ["modelValue", "error"])
127
127
  ])) : P("", !0),
@@ -152,23 +152,23 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
152
152
  const p = U, r = M(!1), v = M(""), e = M(""), n = J({
153
153
  newPassword: !1,
154
154
  newPasswordConfirm: !1
155
- }), g = M(D.NEW), s = M(!1), u = M(!1), $ = V(() => s.value ? "text" : "password"), O = V(() => u.value ? "text" : "password"), B = () => {
155
+ }), g = M(D.NEW), s = M(!1), u = M(!1), $ = V(() => s.value ? "text" : "password"), N = V(() => u.value ? "text" : "password"), B = () => {
156
156
  s.value = !s.value;
157
- }, N = () => {
157
+ }, O = () => {
158
158
  u.value = !u.value;
159
159
  }, E = V(() => n.newPassword ? v.value.trim() ? v.value.trim().length < Te ? `Пароль слишком короткий. Введите хотя бы ${Te} символов` : "" : "Введите пароль" : ""), m = V(() => n.newPasswordConfirm ? e.value.trim() ? e.value !== v.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), h = V(() => !!(E.value || m.value)), i = V(() => r.value || !v.value.trim() || !e.value.trim() ? !0 : h.value), l = () => {
160
160
  p("update:modelValue", !1), p("close");
161
161
  }, d = async () => {
162
162
  p("update-user", v.value);
163
163
  };
164
- return (C, f) => (y(), k(Oe, null, [
164
+ return (C, f) => (y(), k(De, null, [
165
165
  S("div", et, [
166
166
  S("div", tt, [
167
167
  f[7] || (f[7] = S("div", { class: "dialogDefaultContainerTextHint" }, K("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
168
168
  S("div", lt, [
169
- b(c(_), {
169
+ b(c(G), {
170
170
  modelValue: v.value,
171
- "onUpdate:modelValue": f[0] || (f[0] = (G) => v.value = G),
171
+ "onUpdate:modelValue": f[0] || (f[0] = (Y) => v.value = Y),
172
172
  size: "large",
173
173
  "text-size": "medium",
174
174
  label: "Новый пароль",
@@ -183,20 +183,20 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
183
183
  }))
184
184
  ]),
185
185
  S("div", at, [
186
- b(c(_), {
186
+ b(c(G), {
187
187
  modelValue: e.value,
188
- "onUpdate:modelValue": f[3] || (f[3] = (G) => e.value = G),
188
+ "onUpdate:modelValue": f[3] || (f[3] = (Y) => e.value = Y),
189
189
  size: "large",
190
190
  "text-size": "medium",
191
191
  label: "Повторите новый пароль",
192
- type: O.value,
192
+ type: N.value,
193
193
  error: m.value,
194
194
  onBlur: f[4] || (f[4] = () => n.newPasswordConfirm = !0),
195
195
  onInput: f[5] || (f[5] = () => n.newPasswordConfirm = !0)
196
196
  }, null, 8, ["modelValue", "type", "error"]),
197
197
  (y(), R(Ce(u.value ? c(ge) : c(he)), {
198
198
  class: "icon-locked",
199
- onClick: N
199
+ onClick: O
200
200
  }))
201
201
  ]),
202
202
  S("div", ot, [
@@ -280,13 +280,13 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
280
280
  h.length > 4 && (h = h.slice(0, 4)), $.value = h, m && m.value !== h && (m.value = h), h.length === 4 && h !== n.value && (n.value = h, r("on-match-code", { email: u.value, code: h }));
281
281
  }, s = () => {
282
282
  r("on-send-code-again", { email: u.value });
283
- }, { emailModel: u, codeModel: $, touched: O } = se(v), B = V(() => O.value.email && !u.value.trim() ? "Введите e-mail" : p.emailError), N = V(() => p.isNotMatchCode ? "Неверный код" : O.value.code ? $.value.trim() ? p.codeError ?? null : "Введите код" : "");
283
+ }, { emailModel: u, codeModel: $, touched: N } = se(v), B = V(() => N.value.email && !u.value.trim() ? "Введите e-mail" : p.emailError), O = V(() => p.isNotMatchCode ? "Неверный код" : N.value.code ? $.value.trim() ? p.codeError ?? null : "Введите код" : "");
284
284
  return (E, m) => {
285
285
  const h = de;
286
286
  return y(), k("div", rt, [
287
287
  S("div", ut, K(E.hintText), 1),
288
288
  E.showEmail ? (y(), k("div", mt, [
289
- b(c(_), {
289
+ b(c(G), {
290
290
  modelValue: c(u),
291
291
  "onUpdate:modelValue": m[0] || (m[0] = (i) => Q(u) ? u.value = i : null),
292
292
  size: "large",
@@ -304,14 +304,14 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
304
304
  })
305
305
  ])) : P("", !0),
306
306
  E.showCode ? (y(), k("div", ct, [
307
- b(c(_), {
307
+ b(c(G), {
308
308
  modelValue: c($),
309
309
  "onUpdate:modelValue": m[4] || (m[4] = (i) => Q($) ? $.value = i : null),
310
310
  size: "large",
311
311
  "text-size": "medium",
312
312
  label: "Код",
313
313
  type: "text",
314
- error: N.value,
314
+ error: O.value,
315
315
  onInput: g,
316
316
  onBlur: m[5] || (m[5] = (i) => e("code"))
317
317
  }, null, 8, ["modelValue", "error"])
@@ -380,14 +380,14 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
380
380
  e.value = "", r("on-send-code", { email: n.emailModel, prevEmail: p.oldEmail, offLoading: !0 }), v.value = !0;
381
381
  };
382
382
  let $ = "";
383
- const O = (l) => {
383
+ const N = (l) => {
384
384
  r("on-clear-code-error");
385
385
  const d = l.target;
386
386
  let C = d.value.replace(/\D/g, "");
387
387
  C.length > 4 && (C = C.slice(0, 4), d.value = C), n.codeModel = C, C.length === 4 && C !== $ && ($ = C, r("on-match-code", { email: n.emailModel, code: C }));
388
388
  }, B = () => {
389
389
  r("on-send-code-again", { email: n.emailModel });
390
- }, { emailModel: N, codeModel: E, touched: m } = se(n), h = V(() => {
390
+ }, { emailModel: O, codeModel: E, touched: m } = se(n), h = V(() => {
391
391
  if (e.value) return e.value;
392
392
  if (n.touched.email) {
393
393
  if (!n.emailModel.trim()) return "Введите e-mail";
@@ -400,9 +400,9 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
400
400
  return y(), k("div", ft, [
401
401
  S("div", Et, K(v.value ? "Введите код подтверждения" : l.hintText), 1),
402
402
  l.showEmail ? (y(), k("div", wt, [
403
- b(c(_), {
404
- modelValue: c(N),
405
- "onUpdate:modelValue": d[0] || (d[0] = (f) => Q(N) ? N.value = f : null),
403
+ b(c(G), {
404
+ modelValue: c(O),
405
+ "onUpdate:modelValue": d[0] || (d[0] = (f) => Q(O) ? O.value = f : null),
406
406
  size: "large",
407
407
  "text-size": "medium",
408
408
  label: "Почта",
@@ -430,7 +430,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
430
430
  }, 8, ["disabled"])
431
431
  ])),
432
432
  v.value ? (y(), k("div", yt, [
433
- b(c(_), {
433
+ b(c(G), {
434
434
  modelValue: c(E),
435
435
  "onUpdate:modelValue": d[4] || (d[4] = (f) => Q(E) ? E.value = f : null),
436
436
  size: "large",
@@ -438,7 +438,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
438
438
  label: "Код",
439
439
  type: "text",
440
440
  error: i.value,
441
- onInput: O,
441
+ onInput: N,
442
442
  onBlur: d[5] || (d[5] = (f) => g("code"))
443
443
  }, null, 8, ["modelValue", "error"])
444
444
  ])) : P("", !0),
@@ -478,7 +478,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
478
478
  code: "",
479
479
  addEmail: "",
480
480
  addCode: ""
481
- }), n = J({ email: !1, code: !1 }), g = M(D.OLD), s = M(null), u = M(!1), $ = M(!1), O = M(!1), B = M(We.VERIFY_EMAIL), N = V(() => B.value === "password-flow"), E = V(() => C.value ? p.title : N.value ? "Добавление пароля" : "Добавление почты"), { startTimer: m, remainingSeconds: h, isAvailableForSendAgain: i, totalRateAttempts: l, currentRateAttempt: d } = Fe(), { isEditFlow: C, getFlow: f } = Ae(M(p.mode ?? "edit")), { showRateLimitToast: G } = Re(r), ue = V(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), me = V(() => n.code && !e.code.trim() ? "Введите код" : ""), ae = V(() => i.value ? "Повторить" : `${h.value}`), W = M(Me), be = V(() => W.value === 0), $e = (a) => new Promise((t) => setTimeout(t, a));
481
+ }), n = J({ email: !1, code: !1 }), g = M(D.OLD), s = M(null), u = M(!1), $ = M(!1), N = M(!1), B = M(We.VERIFY_EMAIL), O = V(() => B.value === "password-flow"), E = V(() => C.value ? p.title : O.value ? "Добавление пароля" : "Добавление почты"), { startTimer: m, remainingSeconds: h, isAvailableForSendAgain: i, totalRateAttempts: l, currentRateAttempt: d } = Fe(), { isEditFlow: C, getFlow: f } = Ae(M(p.mode ?? "edit")), { showRateLimitToast: Y } = Re(r), ue = V(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), me = V(() => n.code && !e.code.trim() ? "Введите код" : ""), ae = V(() => i.value ? "Повторить" : `${h.value}`), W = M(Me), be = V(() => W.value === 0), $e = (a) => new Promise((t) => setTimeout(t, a));
482
482
  j(
483
483
  () => p.modelValue,
484
484
  (a) => v.value = a
@@ -553,15 +553,15 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
553
553
  sessionId: s.value,
554
554
  code: a,
555
555
  step: t
556
- }), ee = ((o = A.data) == null ? void 0 : o.nextStep) ?? ((T = (w = A.data) == null ? void 0 : w.data) == null ? void 0 : T.nextStep) ?? null, Ne = ((x = (I = A.data) == null ? void 0 : I.data) == null ? void 0 : x.rateLimit) ?? ((H = A.data) == null ? void 0 : H.rateLimit) ?? null, De = A.data.data.success ?? A.data.success;
557
- if (G(Ne), !De) {
556
+ }), ee = ((o = A.data) == null ? void 0 : o.nextStep) ?? ((T = (w = A.data) == null ? void 0 : w.data) == null ? void 0 : T.nextStep) ?? null, Ne = ((x = (I = A.data) == null ? void 0 : I.data) == null ? void 0 : x.rateLimit) ?? ((H = A.data) == null ? void 0 : H.rateLimit) ?? null, Oe = A.data.data.success ?? A.data.success;
557
+ if (Y(Ne), !Oe) {
558
558
  $.value = !0;
559
559
  return;
560
560
  }
561
561
  if (ee) {
562
562
  if (g.value = ee, g.value === D.NEW) {
563
- const Y = await ie();
564
- e.oldEmail = (Y == null ? void 0 : Y.oldValue) ?? e.oldEmail, e.newEmail = (Y == null ? void 0 : Y.newValue) ?? e.newEmail, e.code = "";
563
+ const _ = await ie();
564
+ e.oldEmail = (_ == null ? void 0 : _.oldValue) ?? e.oldEmail, e.newEmail = (_ == null ? void 0 : _.newValue) ?? e.newEmail, e.code = "";
565
565
  }
566
566
  g.value === D.COMPLETED && (e.code = "", r("submit-email", { email: e.addEmail, code: a }), r("on-toast", { color: "success", text: "E-mail изменён" }), r("on-update-jwt", "email", "edit", e.newEmail), s.value = null, r("close"));
567
567
  }
@@ -626,8 +626,8 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
626
626
  }), H = ((a = x.data) == null ? void 0 : a.nextStep) ?? ((o = (t = x.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
627
627
  B.value = H ?? B.value;
628
628
  const L = ((T = (w = x.data) == null ? void 0 : w.data) == null ? void 0 : T.rateLimit) ?? ((I = x.data) == null ? void 0 : I.rateLimit) ?? null, A = x.data.data.success ?? x.data.success;
629
- if (G(L), !A) {
630
- O.value = !0;
629
+ if (Y(L), !A) {
630
+ N.value = !0;
631
631
  return;
632
632
  }
633
633
  } catch {
@@ -664,7 +664,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
664
664
  }), (a, t) => (y(), R(c(qe), {
665
665
  modelValue: v.value,
666
666
  "onUpdate:modelValue": [
667
- t[17] || (t[17] = (o) => v.value = o),
667
+ t[18] || (t[18] = (o) => v.value = o),
668
668
  oe
669
669
  ],
670
670
  width: "small",
@@ -684,7 +684,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
684
684
  S("span", Mt, K(E.value), 1)
685
685
  ]),
686
686
  "right-button": q(() => [
687
- b(c(_e), {
687
+ b(c(Ge), {
688
688
  class: "cross",
689
689
  onClick: oe
690
690
  })
@@ -740,11 +740,11 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
740
740
  }, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : P("", !0)
741
741
  ])) : (y(), k("div", bt, [
742
742
  u.value ? (y(), R(ye, { key: 0 })) : P("", !0),
743
- N.value ? (y(), R(dt, {
743
+ O.value ? (y(), R(dt, {
744
744
  key: 2,
745
745
  "model-value": v.value,
746
746
  "email-session-id": s.value,
747
- "onUpdate:modelValue": t[16] || (t[16] = (o) => r("update:modelValue", o)),
747
+ "onUpdate:modelValue": t[17] || (t[17] = (o) => r("update:modelValue", o)),
748
748
  onUpdateUser: Pe,
749
749
  onClose: ke
750
750
  }, null, 8, ["model-value", "email-session-id"])) : (y(), R(Ze, {
@@ -758,12 +758,13 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
758
758
  "hint-text": c(C) ? a.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
759
759
  "rate-limit-text": ae.value,
760
760
  "is-final-limit": be.value,
761
- "is-not-match-code": O.value,
761
+ "is-not-match-code": N.value,
762
762
  loading: u.value,
763
763
  onOnSendCode: t[14] || (t[14] = (o) => we({ value: e.addEmail, field: "email" })),
764
764
  onOnSendCodeAgain: t[15] || (t[15] = (o) => we({ value: e.addEmail, field: "email" })),
765
765
  onOnMatchCode: Be,
766
- onOnMatchCodeError: Le
766
+ onOnMatchCodeError: Le,
767
+ onOnClearCodeError: t[16] || (t[16] = (o) => N.value = !1)
767
768
  }, null, 8, ["email", "oldEmail", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"]))
768
769
  ]))
769
770
  ])
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
2
- import { C as I, p as D, g as Ve } from "./index-CxaQqcNf.js";
2
+ import { C as I, p as D, g as Ve } from "./index-DlfTVxHI.js";
3
3
  import { PDialog as be, PInput as M, IconEyeMd as O, IconEyeClosedMd as U, PButton as F, PTopBar as Te, IconCrossMd as Ie, PTeleportContainer as xe } from "@profeat/ui-kit";
4
4
  function ke(b) {
5
5
  return { showPasswordRateLimitToast: (P) => {
@@ -1,7 +1,7 @@
1
1
  import { createElementBlock as T, openBlock as p, createElementVNode as F, defineComponent as re, reactive as ue, watch as Y, ref as O, toRefs as me, computed as A, createCommentVNode as $, createVNode as S, toDisplayString as W, createBlock as H, createTextVNode as X, unref as r, isRef as te, withCtx as K, onMounted as Ue, Fragment as qe } from "vue";
2
- import { T as fe, c as Oe, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-CE_s_ZHL.js";
2
+ import { T as fe, c as Oe, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-CBVGtgi4.js";
3
3
  import { IconTelegramSm as ge, PInput as oe, IconPhoneMd as Ge, IconMailMd as Le, PButton as De, PDialog as Je, PTopBar as Ke, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
4
- import { C as q, t as Be, p as _, g as Ie } from "./index-CxaQqcNf.js";
4
+ import { C as q, t as Be, p as _, g as Ie } from "./index-DlfTVxHI.js";
5
5
  const Ye = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
@@ -1,13 +1,13 @@
1
- import { ref as h, shallowRef as Ve, defineComponent as Y, defineAsyncComponent as R, watch as le, createBlock as I, createCommentVNode as N, unref as u, openBlock as w, resolveDynamicComponent as xe, mergeProps as Ae, computed as b, reactive as G, onMounted as $e, createElementBlock as P, Fragment as ie, createVNode as v, createElementVNode as $, withCtx as F, toDisplayString as D, createTextVNode as _, Teleport as re, Transition as Se, withDirectives as Oe, vShow as Me } from "vue";
1
+ import { ref as h, shallowRef as xe, defineComponent as W, defineAsyncComponent as G, 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 _, onMounted as Se, createElementBlock as P, Fragment as ie, createVNode as f, createElementVNode as $, withCtx as D, toDisplayString as F, createTextVNode as J, Teleport as re, Transition as Oe, withDirectives as Me, vShow as Le } from "vue";
2
2
  import ze from "axios";
3
- import { PInputFileUploader as Le, PInput as S, IconFilledEditMd as O, PButton as se, PImageCropper as Re, PToast as Ge, PTeleportContainer as ue, PToastContainer as _e } from "@profeat/ui-kit";
4
- function Je(m, r = 2) {
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) {
5
5
  if (m === 0)
6
6
  return "0 B";
7
- const n = 1024, l = ["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))} ${l[g]}`;
7
+ const n = 1024, s = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], v = Math.floor(Math.log(m) / Math.log(n));
8
+ return `${Number.parseFloat((m / n ** v).toFixed(r))} ${s[v]}`;
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(m) {
18
+ function Ye(m) {
19
19
  return m.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 fa = {
24
+ const ga = {
25
25
  OLD: "old",
26
26
  NEW: "new",
27
27
  COMPLETED: "completed"
28
28
  }, va = {
29
29
  VERIFY_EMAIL: "verify-email"
30
30
  };
31
- let j = null;
32
- function Ye(m, r) {
33
- j = ze.create({
31
+ let q = null;
32
+ function We(m, r) {
33
+ q = ze.create({
34
34
  baseURL: r,
35
35
  headers: {
36
36
  Authorization: `Bearer ${m}`,
@@ -41,37 +41,37 @@ function Ye(m, r) {
41
41
  });
42
42
  }
43
43
  function me() {
44
- if (!j)
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
- async function q(m, r, n) {
48
+ async function Y(m, r, n) {
49
49
  return me().post(m, r, n);
50
50
  }
51
- async function ga(m, r) {
51
+ async function ha(m, r) {
52
52
  return me().get(m, r);
53
53
  }
54
- async function We(m) {
55
- const r = await q("/users/profile/me", m);
54
+ async function Ke(m) {
55
+ const r = await Y("/users/profile/me", m);
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 M = h(null), J = Ve(null);
61
- function W() {
60
+ const M = h(null), j = xe(null);
61
+ function K() {
62
62
  return {
63
63
  currentDialog: M,
64
- dialogPayload: J,
65
- openDialog: (l, g) => {
66
- M.value = l, J.value = g ?? null;
64
+ dialogPayload: j,
65
+ openDialog: (s, v) => {
66
+ M.value = s, j.value = v ?? null;
67
67
  },
68
68
  closeDialog: () => {
69
- M.value = null, J.value = null;
69
+ M.value = null, j.value = null;
70
70
  },
71
- isDialogOpen: (l) => M.value === l
71
+ isDialogOpen: (s) => M.value === s
72
72
  };
73
73
  }
74
- const Ke = {
74
+ const Ze = {
75
75
  ru: {
76
76
  Имя: "Имя",
77
77
  Фамилия: "Фамилия",
@@ -204,7 +204,7 @@ const Ke = {
204
204
  "Введите новый номер телефона": "Enter a new phone number",
205
205
  "Телефон успешно изменен": "Phone number successfully changed"
206
206
  }
207
- }, Ze = /* @__PURE__ */ Y({
207
+ }, He = /* @__PURE__ */ W({
208
208
  __name: "DialogManager",
209
209
  props: {
210
210
  language: {},
@@ -212,49 +212,49 @@ const Ke = {
212
212
  },
213
213
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
214
214
  setup(m, { emit: r }) {
215
- const n = r, l = h(!0), { currentDialog: g, dialogPayload: c, closeDialog: B } = W(), s = {
216
- email: R(() => import("./ProfileEmailDialog-BalhmKXS.js")),
217
- phone: R(() => import("./ProfilePhoneDialog--qBmcmSR.js")),
218
- password: R(() => import("./ProfilePasswordDialog-HjwcA_jN.js"))
215
+ const n = r, s = h(!0), { currentDialog: v, dialogPayload: g, closeDialog: U } = K(), l = {
216
+ email: G(() => import("./ProfileEmailDialog-DmOmsn0E.js")),
217
+ phone: G(() => import("./ProfilePhoneDialog-7benuN8H.js")),
218
+ password: G(() => import("./ProfilePasswordDialog-Ca595Tn-.js"))
219
219
  }, d = ({ email: y }) => {
220
220
  n("update-email-field", y);
221
221
  }, p = ({ phone: y }) => {
222
222
  n("update-phone-field", y);
223
223
  };
224
- return le(g, (y) => {
225
- l.value = !!y;
226
- }), (y, i) => u(g) ? (w(), I(xe(s[u(g)]), Ae({
224
+ return se(v, (y) => {
225
+ s.value = !!y;
226
+ }), (y, i) => u(v) ? (w(), I(Ae(l[u(v)]), $e({
227
227
  key: 0,
228
- modelValue: l.value,
229
- "onUpdate:modelValue": i[0] || (i[0] = (f) => l.value = f),
228
+ modelValue: s.value,
229
+ "onUpdate:modelValue": i[0] || (i[0] = (c) => s.value = c),
230
230
  language: y.language,
231
231
  provider: y.provider
232
- }, u(c), {
233
- onClose: u(B),
234
- onCleanInputErrors: i[1] || (i[1] = (f) => n("clean-input-errors")),
235
- onOnUpdateJwt: i[2] || (i[2] = (f, E, o) => n("on-update-jwt", f, E, o)),
232
+ }, u(g), {
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)),
236
236
  onSubmitEmail: d,
237
237
  onSubmitPhone: p,
238
- onOnPasswordError: i[3] || (i[3] = (f, E) => n("on-password-error", f, E)),
239
- onOnToast: i[4] || (i[4] = (f) => n("on-toast", f))
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
240
  }), null, 16, ["modelValue", "language", "provider", "onClose"])) : N("", !0);
241
241
  }
242
- }), He = { class: "base-container" }, Qe = { class: "avatar-wrapper" }, Xe = { key: 0 }, ea = { key: 1 }, aa = {
242
+ }), Qe = { class: "base-container" }, Xe = { class: "avatar-wrapper" }, ea = { key: 0 }, aa = { key: 1 }, ta = {
243
243
  key: 0,
244
244
  class: "input-wrapper"
245
- }, ta = {
245
+ }, oa = {
246
246
  key: 1,
247
247
  class: "input-wrapper"
248
- }, oa = {
248
+ }, na = {
249
249
  key: 2,
250
250
  class: "input-wrapper"
251
- }, na = {
251
+ }, ra = {
252
252
  key: 3,
253
253
  class: "input-wrapper"
254
- }, ra = { class: "buttons-container" }, sa = {
254
+ }, la = { class: "buttons-container" }, sa = {
255
255
  key: 0,
256
256
  class: "centered-overlay"
257
- }, la = { class: "toastWrapper" }, ia = /* @__PURE__ */ Y({
257
+ }, ia = { class: "toastWrapper" }, ua = /* @__PURE__ */ W({
258
258
  __name: "PEditUserContact",
259
259
  props: {
260
260
  language: {},
@@ -267,7 +267,7 @@ const Ke = {
267
267
  },
268
268
  emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
269
269
  setup(m, { emit: r }) {
270
- const n = m, l = r, g = b(() => n.language ?? "ru"), c = (e) => Ke[g.value][e] || e, { openDialog: B } = W(), s = G({ firstName: "", lastName: "" }), d = h({ firstName: "", lastName: "" }), p = G({ firstName: !1, lastName: !1, email: !1, phone: !1 }), y = h(""), i = h(""), f = h(""), E = h(!1), o = G({
270
+ const n = m, s = r, v = b(() => n.language ?? "ru"), g = (e) => Ze[v.value][e] || e, { openDialog: U } = K(), l = _({ 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
271
  value: null,
272
272
  loading: !1,
273
273
  accept: ["image/png", "image/jpeg"],
@@ -275,49 +275,47 @@ const Ke = {
275
275
  // 10mb вроде
276
276
  imageBinary: null,
277
277
  imageContent: ""
278
- }), K = h(!1), V = h(!1), x = h(!1), Z = h(!0), H = h(!0), Q = h(void 0), X = h(""), de = b(() => ae(s.firstName, p.firstName)), pe = b(() => ae(s.lastName, p.lastName)), ce = b(() => p.email && !i.value.trim() ? "Введите e-mail" : ""), fe = b(() => p.phone && !f.value.trim() ? "Введите номер телефона" : ""), U = (e) => n.fields.some((a) => a.key === e), ee = (e) => e && e.trim() ? "edit" : "bind", z = () => setTimeout(() => {
278
+ }), L = h(!1), V = h(!1), x = h(!1), Z = h(!0), H = 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", z = () => setTimeout(() => {
279
279
  var e;
280
280
  return (e = document.activeElement) == null ? void 0 : e.blur();
281
- }, 0), ve = b(() => !!(i.value && i.value.trim() !== ""));
282
- b(() => o.imageContent ? c("Загрузить другое фото") : c("Загрузить фото"));
283
- const ae = (e, a) => {
281
+ }, 0), ge = b(() => !!(i.value && i.value.trim() !== "")), ve = b(() => o.imageContent ? g("Загрузить другое фото") : g("Загрузить фото")), ae = (e, a) => {
284
282
  if (!a) return "";
285
283
  const t = e.trim();
286
284
  return t ? t.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
287
- }, ge = (e) => B("email", { mode: e ? "edit" : "bind", initialEmail: e }), he = () => {
288
- z(), l("open-email-dialog", i.value, ee(i.value)), ge(i.value);
289
- }, we = () => {
290
- z(), l("open-phone-dialog", f.value, ee(f.value));
291
- }, ye = async (e, a, t) => {
292
- e === "email" && t && (i.value = t), e === "phone" && t && (f.value = t), l("on-update-jwt");
293
- }, Ee = (e) => {
294
- f.value = e;
285
+ }, he = (e) => U("email", { mode: e ? "edit" : "bind", initialEmail: e }), we = () => {
286
+ z(), s("open-email-dialog", i.value, ee(i.value)), he(i.value);
287
+ }, ye = () => {
288
+ z(), 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");
295
291
  }, Ne = (e) => {
296
- i.value = e;
297
- }, Pe = (e, a) => {
298
- x.value = !0, l("on-password-error", e, a);
299
- }, Ce = () => {
292
+ c.value = e;
293
+ }, Pe = (e) => {
294
+ 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 = () => {
300
298
  Z.value = !1, H.value = !1;
301
- }, L = (e) => {
299
+ }, R = (e) => {
302
300
  x.value = !0, Q.value = e.color ?? "", X.value = e.text ?? "";
303
301
  }, A = (e) => {
304
302
  if (p[e] = !0, e === "firstName" || e === "lastName") {
305
- const a = s[e];
306
- a.length > 40 && (s[e] = a.slice(0, 40), console.debug(`[Input Limit] Поле '${e}' достигло 40 символов. Ввод обрезан.`));
303
+ const a = l[e];
304
+ a.length > 40 && (l[e] = a.slice(0, 40), console.debug(`[Input Limit] Поле '${e}' достигло 40 символов. Ввод обрезан.`));
307
305
  }
308
- }, be = (e) => {
306
+ }, ke = (e) => {
309
307
  if (!e) {
310
308
  o.imageContent = "", o.imageBinary = null, o.value = null;
311
309
  return;
312
310
  }
313
311
  o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", E.value = !0;
314
- }, ke = () => {
315
- K.value = !0;
312
+ }, Te = () => {
313
+ L.value = !0;
316
314
  }, te = async (e, a, t = "image/png") => {
317
315
  if (!e) return null;
318
316
  const T = await (await fetch(e)).blob();
319
317
  return new File([T], a, { type: t });
320
- }, Te = () => {
318
+ }, Ue = () => {
321
319
  o.value = null, o.imageBinary = null, o.imageContent = "", E.value = !1;
322
320
  }, Be = async (e) => {
323
321
  if (E.value = !1, o.imageContent = e, !o.imageBinary) return;
@@ -326,13 +324,13 @@ const Ke = {
326
324
  try {
327
325
  o.loading = !0;
328
326
  const t = new FormData();
329
- t.append("file", a), await q(`/users/profile/avatar/${y.value}`, t, { headers: { "Content-Type": void 0 } });
327
+ t.append("file", a), await Y(`/users/profile/avatar/${y.value}`, t, { headers: { "Content-Type": void 0 } });
330
328
  } catch (t) {
331
329
  console.error(t);
332
330
  } finally {
333
- o.loading = !1;
331
+ L.value = !1, o.loading = !1;
334
332
  }
335
- }, Ue = async (e) => {
333
+ }, De = async (e) => {
336
334
  o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await te(
337
335
  e ?? "",
338
336
  o.imageBinary.name,
@@ -340,14 +338,14 @@ const Ke = {
340
338
  ));
341
339
  }, oe = h(!1), ne = async (e) => {
342
340
  var t, k;
343
- const a = (t = s[e]) == null ? void 0 : t.trim();
341
+ const a = (t = l[e]) == null ? void 0 : t.trim();
344
342
  if (a)
345
343
  try {
346
344
  oe.value = !0;
347
- const C = (k = (await q("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : k.data;
348
- C != null && C.user && (s.firstName = C.user.firstName ?? s.firstName, s.lastName = C.user.lastName ?? s.lastName, d.value = {
349
- firstName: s.firstName,
350
- lastName: s.lastName
345
+ const C = (k = (await Y("/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
351
349
  });
352
350
  } catch (T) {
353
351
  throw T;
@@ -358,104 +356,104 @@ const Ke = {
358
356
  var e;
359
357
  if (!n.accessToken) throw new Error("Access token не передан в props");
360
358
  try {
361
- const t = (e = (await We({
359
+ const t = (e = (await Ke({
362
360
  accessToken: n.accessToken,
363
361
  refreshToken: n.refreshToken ?? "",
364
362
  excludeFields: []
365
363
  })).data) == null ? void 0 : e.user;
366
364
  if (!t) throw new Error("user data отсутствует в response");
367
- y.value = t.userId ?? "", s.firstName = t.privateFirstName ?? "", s.lastName = t.privateLastName ?? "", i.value = t.email ?? "", f.value = t.phoneNumber ?? "", o.imageContent = t.avatar ?? "", d.value = { firstName: t.privateFirstName ?? "", lastName: t.privateLastName ?? "" };
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 ?? "" };
368
366
  } catch {
369
367
  }
370
368
  };
371
- le(
372
- () => [s.firstName, s.lastName],
369
+ se(
370
+ () => [l.firstName, l.lastName],
373
371
  ([e, a]) => {
374
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;
375
373
  V.value = T && C;
376
374
  },
377
375
  { immediate: !0 }
378
376
  );
379
- const De = async () => {
377
+ const Ie = async () => {
380
378
  if (V.value)
381
379
  try {
382
- await Promise.all([ne("firstName"), ne("lastName")]), V.value = !1, l("on-update-jwt"), L({ color: "success", text: "Изменения сохранены" });
380
+ await Promise.all([ne("firstName"), ne("lastName")]), V.value = !1, s("on-update-jwt"), R({ color: "success", text: "Изменения сохранены" });
383
381
  } catch (e) {
384
- console.error(e), L({
382
+ console.error(e), R({
385
383
  color: "error",
386
- text: c("Не удалось сохранить изменения. Попробуйте позже")
384
+ text: g("Не удалось сохранить изменения. Попробуйте позже")
387
385
  });
388
386
  }
389
- }, Ie = () => {
390
- z(), l("open-password-dialog");
387
+ }, Ve = () => {
388
+ z(), s("open-password-dialog");
391
389
  };
392
- return $e(async () => {
390
+ return Se(async () => {
393
391
  if (!n.accessToken) throw new Error("Access token не передан в props");
394
392
  if (!n.requestUrl) throw new Error("auth-backend url не передан в props");
395
- Ye(n.accessToken, n.requestUrl), await Fe();
393
+ We(n.accessToken, n.requestUrl), await Fe();
396
394
  }), (e, a) => (w(), P(ie, null, [
397
- v(Ze, {
398
- language: g.value,
395
+ f(He, {
396
+ language: v.value,
399
397
  provider: e.provider,
400
- onCleanInputErrors: Ce,
401
- onOnUpdateJwt: ye,
402
- onUpdatePhoneField: Ee,
403
- onUpdateEmailField: Ne,
404
- onOnPasswordError: Pe,
405
- onOnToast: L
398
+ onCleanInputErrors: be,
399
+ onOnUpdateJwt: Ee,
400
+ onUpdatePhoneField: Ne,
401
+ onUpdateEmailField: Pe,
402
+ onOnPasswordError: Ce,
403
+ onOnToast: R
406
404
  }, null, 8, ["language", "provider"]),
407
- $("div", He, [
408
- $("div", Qe, [
409
- U("avatar") ? (w(), I(u(Le), {
405
+ $("div", Qe, [
406
+ $("div", Xe, [
407
+ B("avatar") ? (w(), I(u(Re), {
410
408
  key: 0,
411
409
  modelValue: o.value,
412
410
  "onUpdate:modelValue": [
413
411
  a[0] || (a[0] = (t) => o.value = t),
414
- a[1] || (a[1] = (t) => be(t))
412
+ a[1] || (a[1] = (t) => ke(t))
415
413
  ],
416
414
  type: "img",
417
415
  src: o.imageContent,
418
416
  accept: o.accept,
419
417
  loading: o.loading,
420
- label: c("Загрузить фото"),
418
+ label: g("Загрузить фото"),
421
419
  "upload-limit": o.uploadLimit,
422
- "onChange:error": ke
420
+ "onChange:error": Te
423
421
  }, {
424
- afterLoadLabel: F(() => [
425
- _(D(c("Загрузить фото")), 1)
422
+ afterLoadLabel: D(() => [
423
+ J(F(ve.value), 1)
426
424
  ]),
427
- subtext: F(() => [
428
- K.value ? (w(), P("span", Xe, D("Размер фото слишком большой. Загрузите JPEG, PNG до 10 MB"))) : (w(), P("span", ea, D(`${c("Формат")} ${u(qe)(o.accept).join(", ")} ${c("до")} ${u(Je)(o.uploadLimit)}`), 1))
425
+ subtext: D(() => [
426
+ L.value ? (w(), P("span", ea, F("Размер фото слишком большой. Загрузите JPEG, PNG до 10 MB"))) : (w(), P("span", aa, F(`${g("Формат")} ${u(Ye)(o.accept).join(", ")} ${g("до")} ${u(je)(o.uploadLimit)}`), 1))
429
427
  ]),
430
428
  _: 1
431
429
  }, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) : N("", !0)
432
430
  ]),
433
- U("firstName") ? (w(), P("div", aa, [
434
- v(u(S), {
435
- modelValue: s.firstName,
436
- "onUpdate:modelValue": a[2] || (a[2] = (t) => s.firstName = t),
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),
437
435
  size: "large",
438
- label: c("Имя"),
436
+ label: g("Имя"),
439
437
  error: de.value,
440
438
  onBlur: a[3] || (a[3] = (t) => p.firstName = !0),
441
439
  onInput: a[4] || (a[4] = (t) => A("firstName"))
442
440
  }, null, 8, ["modelValue", "label", "error"]),
443
- v(u(O), { class: "icon-locked" })
441
+ f(u(O), { class: "icon-locked" })
444
442
  ])) : N("", !0),
445
- U("lastName") ? (w(), P("div", ta, [
446
- v(u(S), {
447
- modelValue: s.lastName,
448
- "onUpdate:modelValue": a[5] || (a[5] = (t) => s.lastName = t),
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),
449
447
  size: "large",
450
- label: c("Фамилия"),
448
+ label: g("Фамилия"),
451
449
  error: pe.value,
452
450
  onBlur: a[6] || (a[6] = (t) => p.lastName = !0),
453
451
  onInput: a[7] || (a[7] = (t) => A("lastName"))
454
452
  }, null, 8, ["modelValue", "label", "error"]),
455
- v(u(O), { class: "icon-locked" })
453
+ f(u(O), { class: "icon-locked" })
456
454
  ])) : N("", !0),
457
- U("email") ? (w(), P("div", oa, [
458
- v(u(S), {
455
+ B("email") ? (w(), P("div", na, [
456
+ f(u(S), {
459
457
  modelValue: i.value,
460
458
  "onUpdate:modelValue": a[8] || (a[8] = (t) => i.value = t),
461
459
  size: "large",
@@ -467,44 +465,44 @@ const Ke = {
467
465
  error: ce.value && H.value,
468
466
  onBlur: a[9] || (a[9] = (t) => p.email = !0),
469
467
  onInput: a[10] || (a[10] = (t) => A("email")),
470
- onClick: he
468
+ onClick: we
471
469
  }, null, 8, ["modelValue", "error"]),
472
- v(u(O), { class: "icon-locked" })
470
+ f(u(O), { class: "icon-locked" })
473
471
  ])) : N("", !0),
474
- U("phone") ? (w(), P("div", na, [
475
- v(u(S), {
476
- modelValue: f.value,
477
- "onUpdate:modelValue": a[11] || (a[11] = (t) => f.value = t),
472
+ B("phone") ? (w(), P("div", ra, [
473
+ f(u(S), {
474
+ modelValue: c.value,
475
+ "onUpdate:modelValue": a[11] || (a[11] = (t) => c.value = t),
478
476
  size: "large",
479
477
  "text-size": "medium",
480
- label: c("Номер телефона"),
478
+ label: g("Номер телефона"),
481
479
  type: "tel",
482
480
  readonly: "",
483
481
  style: { cursor: "pointer" },
484
482
  error: fe.value && Z.value,
485
483
  onBlur: a[12] || (a[12] = (t) => p.phone = !0),
486
484
  onInput: a[13] || (a[13] = (t) => A("phone")),
487
- onClick: we
485
+ onClick: ye
488
486
  }, null, 8, ["modelValue", "label", "error"]),
489
- v(u(O), { class: "icon-locked" })
487
+ f(u(O), { class: "icon-locked" })
490
488
  ])) : N("", !0),
491
- $("div", ra, [
492
- ve.value ? (w(), I(u(se), {
489
+ $("div", la, [
490
+ ge.value ? (w(), I(u(le), {
493
491
  key: 0,
494
492
  color: "secondary",
495
- onClick: Ie
493
+ onClick: Ve
496
494
  }, {
497
- default: F(() => [
498
- _(D(c("Сменить пароль")), 1)
495
+ default: D(() => [
496
+ J(F(g("Сменить пароль")), 1)
499
497
  ]),
500
498
  _: 1
501
499
  })) : N("", !0),
502
- v(u(se), {
500
+ f(u(le), {
503
501
  disabled: !V.value,
504
- onClick: De
502
+ onClick: Ie
505
503
  }, {
506
- default: F(() => [
507
- _(D(c("Сохранить")), 1)
504
+ default: D(() => [
505
+ J(F(g("Сохранить")), 1)
508
506
  ]),
509
507
  _: 1
510
508
  }, 8, ["disabled"])
@@ -515,41 +513,41 @@ const Ke = {
515
513
  to: "body"
516
514
  }, [
517
515
  E.value ? (w(), P("div", sa, [
518
- v(u(Re), {
516
+ f(u(Ge), {
519
517
  "circle-mode": !0,
520
518
  "model-value": o.imageContent,
521
- onClose: Te,
519
+ onClose: Ue,
522
520
  onSave: a[14] || (a[14] = (t) => Be(t)),
523
- "onUpdate:modelValue": a[15] || (a[15] = (t) => Ue(t))
521
+ "onUpdate:modelValue": a[15] || (a[15] = (t) => De(t))
524
522
  }, null, 8, ["model-value"])
525
523
  ])) : N("", !0)
526
524
  ])) : N("", !0),
527
525
  (w(), I(re, { to: "#toast-root" }, [
528
- $("div", la, [
529
- v(Se, { name: "list" }, {
530
- default: F(() => [
531
- Oe(v(u(Ge), {
526
+ $("div", ia, [
527
+ f(Oe, { name: "list" }, {
528
+ default: D(() => [
529
+ Me(f(u(_e), {
532
530
  class: "toast",
533
531
  color: Q.value,
534
532
  text: X.value,
535
533
  onClose: a[16] || (a[16] = (t) => x.value = !1)
536
534
  }, null, 8, ["color", "text"]), [
537
- [Me, x.value]
535
+ [Le, x.value]
538
536
  ])
539
537
  ]),
540
538
  _: 1
541
539
  })
542
540
  ])
543
541
  ])),
544
- v(u(ue))
542
+ f(u(ue))
545
543
  ], 64));
546
544
  }
547
- }), ua = (m, r) => {
545
+ }), ma = (m, r) => {
548
546
  const n = m.__vccOpts || m;
549
- for (const [l, g] of r)
550
- n[l] = g;
547
+ for (const [s, v] of r)
548
+ n[s] = v;
551
549
  return n;
552
- }, ma = /* @__PURE__ */ ua(ia, [["__scopeId", "data-v-72acd104"]]), ha = /* @__PURE__ */ Y({
550
+ }, da = /* @__PURE__ */ ma(ua, [["__scopeId", "data-v-0fcb1c3e"]]), wa = /* @__PURE__ */ W({
553
551
  __name: "index",
554
552
  props: {
555
553
  throttlerPrefix: {},
@@ -562,18 +560,18 @@ const Ke = {
562
560
  },
563
561
  emits: ["on-update-jwt", "update-tokens"],
564
562
  setup(m, { emit: r }) {
565
- const n = r, { openDialog: l } = W(), g = (d, p) => {
566
- l("email", { initialEmail: d, mode: p });
567
- }, c = (d, p) => {
568
- l("phone", { initialPhone: d, mode: p });
569
- }, B = () => {
570
- l("password");
571
- }, s = (d, p, y) => {
563
+ const n = r, { openDialog: s } = K(), v = (d, p) => {
564
+ s("email", { initialEmail: d, mode: p });
565
+ }, g = (d, p) => {
566
+ s("phone", { initialPhone: d, mode: p });
567
+ }, U = () => {
568
+ s("password");
569
+ }, l = (d, p, y) => {
572
570
  n("on-update-jwt", d, p, y);
573
571
  };
574
572
  return (d, p) => (w(), P(ie, null, [
575
- v(u(_e)),
576
- v(ma, {
573
+ f(u(Je)),
574
+ f(da, {
577
575
  "throttler-prefix": d.throttlerPrefix,
578
576
  provider: d.provider,
579
577
  "request-url": d.requestUrl,
@@ -581,21 +579,21 @@ const Ke = {
581
579
  fields: d.fields,
582
580
  "access-token": d.accessToken,
583
581
  "refresh-token": d.refreshToken,
584
- onOpenEmailDialog: g,
585
- onOpenPhoneDialog: c,
586
- onOpenPasswordDialog: B,
587
- onOnUpdateJwt: s
582
+ onOpenEmailDialog: v,
583
+ onOpenPhoneDialog: g,
584
+ onOpenPasswordDialog: U,
585
+ onOnUpdateJwt: l
588
586
  }, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token"]),
589
- v(u(ue))
587
+ f(u(ue))
590
588
  ], 64));
591
589
  }
592
590
  });
593
591
  export {
594
592
  va as B,
595
- fa as C,
596
- ua as _,
597
- ha as a,
598
- ga as g,
599
- q as p,
600
- Ke as t
593
+ ga as C,
594
+ ma as _,
595
+ wa as a,
596
+ ha as g,
597
+ Y as p,
598
+ Ze as t
601
599
  };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".avatar-wrapper[data-v-72acd104] .p-avatar__overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-72acd104]:hover .p-avatar__overlay{opacity:1!important}.avatar-wrapper[data-v-72acd104] .wide-img .overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-72acd104]:hover .wide-img .overlay{opacity:1!important}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { a as o } from "./index-CxaQqcNf.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-wrapper[data-v-0fcb1c3e] .p-avatar__overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-0fcb1c3e]:hover .p-avatar__overlay{opacity:1!important}.avatar-wrapper[data-v-0fcb1c3e] .wide-img .overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-0fcb1c3e]:hover .wide-img .overlay{opacity:1!important}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { a as o } from "./index-DlfTVxHI.js";
3
3
  export {
4
4
  o as PEditUserContact
5
5
  };
@@ -1,6 +1,6 @@
1
1
  import { ref as l, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as r, createVNode as E, unref as F, computed as T, renderSlot as m, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
2
2
  import { PLoader as w } from "@profeat/ui-kit";
3
- import { _ as g, g as R, p as h } from "./index-CxaQqcNf.js";
3
+ import { _ as g, g as R, p as h } from "./index-DlfTVxHI.js";
4
4
  function C(e) {
5
5
  const t = Math.floor(e / 60), a = e % 60;
6
6
  return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourgoods/ui-smart",
3
- "version": "0.10.0",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",