@ozdao/prometheus-framework 0.2.90 → 0.2.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. package/dist/auth.server.js +1 -0
  2. package/dist/auth.server.mjs +1 -0
  3. package/dist/main-BQisDfLk.js +92 -0
  4. package/dist/main-DTlUA63C.mjs +13617 -0
  5. package/dist/main.css +1 -1
  6. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  7. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  8. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  9. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -102
  10. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  12. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  14. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  16. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +17 -16
  18. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
  20. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
  22. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +1 -36
  24. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +36 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +9 -8
  28. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +28 -29
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +65 -65
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +38 -39
  40. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/store/auth.js +35 -37
  42. package/dist/prometheus-framework/src/modules/auth/store/twofa.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/store/twofa.js +3 -3
  44. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +12 -11
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  56. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  57. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  58. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  68. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +4 -3
  78. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +5 -4
  80. package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.js +10 -13
  82. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
  84. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +3 -3
  86. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
  88. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  90. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +2 -2
  96. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +3 -3
  102. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  104. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +5 -4
  106. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  108. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -5
  110. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  120. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  122. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +9 -8
  128. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  134. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +5 -4
  136. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  138. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -4
  140. package/dist/prometheus-framework.cjs.js +1 -1
  141. package/dist/prometheus-framework.es.js +1 -1
  142. package/dist/style.css +1 -1
  143. package/dist/web-CXzcKdk4.mjs +54 -0
  144. package/dist/web-D9Cfcy5k.js +1 -0
  145. package/package.json +1 -1
  146. package/src/components/Button/Button.vue +5 -8
  147. package/src/components/FieldPhone/FieldPhone.vue +4 -0
  148. package/src/modules/auth/components/pages/ResetPassword.vue +1 -1
  149. package/src/modules/auth/components/pages/SignIn.vue +3 -3
  150. package/src/modules/auth/components/pages/SignUp.vue +1 -1
  151. package/src/modules/auth/controllers/auth.controller.js +1 -0
  152. package/src/modules/auth/store/auth.js +3 -5
  153. package/src/modules/auth/store/twofa.js +1 -1
  154. package/src/modules/middlewares/client/inputs.validation.js +0 -13
@@ -1,50 +1,50 @@
1
- import { ref as p, onMounted as k, resolveComponent as C, openBlock as E, createElementBlock as I, createElementVNode as a, createTextVNode as c, toDisplayString as d, unref as s, createVNode as i, withCtx as u, Transition as b, withDirectives as g, vShow as w } from "vue";
1
+ import { ref as m, onMounted as k, resolveComponent as E, openBlock as V, createElementBlock as I, createElementVNode as l, createTextVNode as c, toDisplayString as r, unref as s, createVNode as o, withCtx as d, Transition as b, withDirectives as g, vShow as w } from "vue";
2
2
  import q from "../../../../components/Tab/Tab.vue2.js";
3
- import y from "../../../../components/Field/Field.vue2.js";
3
+ import y from "../../../../components/Field/Field.vue.js";
4
4
  import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import j from "../../../../components/Button/Button.vue2.js";
6
- import { useRoute as A, useRouter as F } from "vue-router";
7
- import { useI18n as N } from "vue-i18n";
8
- import O from "../../localization/SignIn.json.js";
9
- import { state as l, actions as T } from "../../store/auth.js";
5
+ import O from "../../../../components/Button/Button.vue.js";
6
+ import { useRoute as j, useRouter as A } from "vue-router";
7
+ import { useI18n as F } from "vue-i18n";
8
+ import N from "../../localization/SignIn.json.js";
9
+ import { state as i, actions as T } from "../../store/auth.js";
10
10
  import { validateInputs as S, validatePhone as B, validateEmail as R } from "../../../middlewares/client/inputs.validation.js";
11
11
  import "./SignIn.vue2.js";
12
- const $ = { class: "" }, L = /* @__PURE__ */ a("img", {
12
+ const $ = { class: "" }, L = /* @__PURE__ */ l("img", {
13
13
  src: "/logo/logo.svg",
14
14
  class: "i-extra radius-small mn-b-small"
15
- }, null, -1), M = { class: "mn-b-medium" }, z = /* @__PURE__ */ a("br", null, null, -1), G = { class: "t-semi" }, H = { class: "mn-b-big" }, J = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, K = { class: "pos-relative" }, Q = { class: "mn-b-thin radius-small" }, W = { class: "mn-b-thin radius-small o-hidden" }, X = { class: "w-100 mn-b-big" }, ue = {
15
+ }, null, -1), M = { class: "mn-b-medium" }, z = /* @__PURE__ */ l("br", null, null, -1), G = { class: "t-semi" }, H = { class: "mn-b-big" }, J = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, K = { class: "pos-relative" }, Q = { class: "mn-b-thin radius-small" }, W = { class: "mn-b-thin radius-small o-hidden" }, X = { class: "w-100 mn-b-big" }, ue = {
16
16
  __name: "SignIn",
17
17
  setup(Y) {
18
- const h = p(null), U = p(null), f = p(null), _ = A(), v = F(), { t: o } = N({
18
+ const h = m(null), x = m(null), f = m(null), _ = j(), v = A(), { t: a } = F({
19
19
  useScope: "global",
20
- ...O
21
- }), n = p("phone"), V = (r) => new Promise((t, m) => {
20
+ ...N
21
+ }), n = m("phone"), C = (u) => new Promise((t, p) => {
22
22
  const e = document.createElement("script");
23
- e.type = "text/javascript", e.src = r, e.onload = t, e.onerror = m, document.head.appendChild(e);
23
+ e.type = "text/javascript", e.src = u, e.onload = t, e.onerror = p, document.head.appendChild(e);
24
24
  });
25
25
  k(async () => {
26
- await V("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
26
+ await C("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js");
27
27
  });
28
- async function x() {
28
+ async function P() {
29
29
  try {
30
30
  n.value === "phone" && await S(
31
31
  h,
32
32
  B,
33
- l.user.phone,
33
+ i.user.phone,
34
34
  "Некорректный телефон"
35
35
  ), n.value === "email" && await S(
36
36
  f,
37
37
  R,
38
- l.user.email,
38
+ i.user.email,
39
39
  "Некорректный email"
40
40
  );
41
41
  } catch {
42
42
  throw new Error();
43
43
  }
44
- const r = { ...l.user };
45
- r.phone = l.user.phone.number, await T.login(r, n.value);
44
+ const u = { ...i.user };
45
+ await T.login(u, n.value);
46
46
  }
47
- function P() {
47
+ function U() {
48
48
  _.query.returnUrl ? v.push({
49
49
  path: _.query.returnUrl,
50
50
  query: {
@@ -53,73 +53,73 @@ const $ = { class: "" }, L = /* @__PURE__ */ a("img", {
53
53
  }) : v.push({
54
54
  name: "User Profile",
55
55
  params: {
56
- _id: l.user._id
56
+ _id: i.user._id
57
57
  },
58
58
  query: {
59
59
  afterAuth: "true"
60
60
  }
61
61
  });
62
62
  }
63
- return (r, t) => {
64
- const m = C("router-link");
65
- return E(), I("section", $, [
63
+ return (u, t) => {
64
+ const p = E("router-link");
65
+ return V(), I("section", $, [
66
66
  L,
67
- a("h3", M, [
68
- c(d(s(o)("title")) + " ", 1),
67
+ l("h3", M, [
68
+ c(r(s(a)("title")) + " ", 1),
69
69
  z,
70
- a("span", G, d(s(o)("subtitle")), 1)
70
+ l("span", G, r(s(a)("subtitle")), 1)
71
71
  ]),
72
- a("p", H, [
73
- i(m, {
72
+ l("p", H, [
73
+ o(p, {
74
74
  to: { name: "Sign Up" },
75
75
  class: "underline t-second"
76
76
  }, {
77
- default: u(() => [
78
- c(d(s(o)("signup")), 1)
77
+ default: d(() => [
78
+ c(r(s(a)("signup")), 1)
79
79
  ]),
80
80
  _: 1
81
81
  })
82
82
  ]),
83
- a("div", J, [
84
- i(q, {
83
+ l("div", J, [
84
+ o(q, {
85
85
  selected: n.value,
86
86
  "onUpdate:selected": t[0] || (t[0] = (e) => n.value = e),
87
87
  tabs: [
88
- { name: s(o)("phone"), value: "phone" },
89
- { name: s(o)("email"), value: "email" }
88
+ { name: s(a)("phone"), value: "phone" },
89
+ { name: s(a)("email"), value: "email" }
90
90
  ]
91
91
  }, null, 8, ["selected", "tabs"])
92
92
  ]),
93
- a("div", K, [
94
- i(b, { name: "slide-fade" }, {
95
- default: u(() => [
96
- g(a("div", Q, [
97
- i(D, {
98
- modelValue: l.user.phone,
99
- "onUpdate:modelValue": t[1] || (t[1] = (e) => l.user.phone = e),
93
+ l("div", K, [
94
+ o(b, { name: "slide-fade" }, {
95
+ default: d(() => [
96
+ g(l("div", Q, [
97
+ o(D, {
98
+ onChange: t[1] || (t[1] = (e) => i.user.phone = e),
100
99
  dropdownOptions: {
101
100
  showDialCodeInSelection: !0,
102
101
  showFlags: !0,
103
102
  showDialCodeInList: !0
104
103
  },
104
+ validCharactersOnly: !0,
105
105
  validation: h.value,
106
106
  mode: "national",
107
- inputOptions: { placeholder: s(o)("phonePlaceholder") },
107
+ inputOptions: { placeholder: s(a)("phonePlaceholder"), type: "tel" },
108
108
  class: "bg-grey pd-small radius-small mn-b-thin"
109
- }, null, 8, ["modelValue", "validation", "inputOptions"])
109
+ }, null, 8, ["validation", "inputOptions"])
110
110
  ], 512), [
111
111
  [w, n.value === "phone"]
112
112
  ])
113
113
  ]),
114
114
  _: 1
115
115
  }),
116
- i(b, { name: "slide-fade" }, {
117
- default: u(() => [
118
- g(a("div", W, [
119
- i(y, {
120
- field: l.user.email,
121
- "onUpdate:field": t[2] || (t[2] = (e) => l.user.email = e),
122
- placeholder: s(o)("emailPlaceholder"),
116
+ o(b, { name: "slide-fade" }, {
117
+ default: d(() => [
118
+ g(l("div", W, [
119
+ o(y, {
120
+ field: i.user.email,
121
+ "onUpdate:field": t[2] || (t[2] = (e) => i.user.email = e),
122
+ placeholder: s(a)("emailPlaceholder"),
123
123
  validation: f.value,
124
124
  class: "bg-grey pd-medium radius-small"
125
125
  }, null, 8, ["field", "placeholder", "validation"])
@@ -130,32 +130,32 @@ const $ = { class: "" }, L = /* @__PURE__ */ a("img", {
130
130
  _: 1
131
131
  })
132
132
  ]),
133
- i(y, {
134
- field: l.user.password,
135
- "onUpdate:field": t[3] || (t[3] = (e) => l.user.password = e),
133
+ o(y, {
134
+ field: i.user.password,
135
+ "onUpdate:field": t[3] || (t[3] = (e) => i.user.password = e),
136
136
  type: "password",
137
- validation: U.value,
138
- placeholder: s(o)("passwordPlaceholder"),
137
+ validation: x.value,
138
+ placeholder: s(a)("passwordPlaceholder"),
139
139
  class: "bg-grey pd-medium radius-small mn-b-semi"
140
140
  }, null, 8, ["field", "validation", "placeholder"]),
141
- a("div", X, [
142
- i(m, {
141
+ l("div", X, [
142
+ o(p, {
143
143
  to: "/auth/reset-password",
144
144
  class: "underline d-block t-blue"
145
145
  }, {
146
- default: u(() => [
147
- c(d(s(o)("forgotPassword")), 1)
146
+ default: d(() => [
147
+ c(r(s(a)("forgotPassword")), 1)
148
148
  ]),
149
149
  _: 1
150
150
  })
151
151
  ]),
152
- i(j, {
153
- submit: x,
154
- callback: P,
152
+ o(O, {
153
+ submit: P,
154
+ callback: U,
155
155
  class: "w-100 bg-main mn-b-thin"
156
156
  }, {
157
- default: u(() => [
158
- c(d(s(o)("signin")), 1)
157
+ default: d(() => [
158
+ c(r(s(a)("signin")), 1)
159
159
  ]),
160
160
  _: 1
161
161
  })
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),l=require("../../store/auth.cjs"),V=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const N={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},y={class:"mn-b-semi radius-small"},C={class:"mn-b-small t-transp"},D={class:"mn-b-semi radius-small o-hidden"},x={class:"mn-b-small t-transp"},T={class:"w-100"},k={__name:"SignUp",setup(I){const{t}=g.useI18n({useScope:"global",...w.default}),i=e.ref(null),r=e.ref(null);d.useRoute();const c=d.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await V.sendCode(l.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(u,n)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",N,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("div",E,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",y,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{modelValue:l.state.user.phone,"onUpdate:modelValue":n[1]||(n[1]=o=>l.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-b-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:l.state.user.email,"onUpdate:field":n[2]||(n[2]=o=>l.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(b.default,{submit:m,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",T,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-b-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue.cjs"),d=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),o=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const V={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},y={class:"mn-b-semi radius-small"},C={class:"mn-b-small t-transp"},D={class:"mn-b-semi radius-small o-hidden"},x={class:"mn-b-small t-transp"},T={class:"w-100"},k={__name:"SignUp",setup(I){const{t}=g.useI18n({useScope:"global",...w.default}),i=e.ref(null),r=e.ref(null);d.useRoute();const c=d.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,o.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,o.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(o.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(u,n)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",V,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("div",E,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=l=>a.value=l),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",y,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{onChange:n[1]||(n[1]=l=>o.state.user.phone=l),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:o.state.user.email,"onUpdate:field":n[2]||(n[2]=l=>o.state.user.email=l),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(b.default,{submit:m,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",T,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-b-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=k;
@@ -1,32 +1,32 @@
1
- import { ref as d, resolveComponent as C, openBlock as k, createElementBlock as E, createElementVNode as o, toDisplayString as r, unref as t, createVNode as a, Transition as h, withCtx as m, withDirectives as f, vShow as _, createTextVNode as v } from "vue";
2
- import S from "../../../../components/Tab/Tab.vue2.js";
3
- import x from "../../../../components/Field/Field.vue2.js";
4
- import N from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import D from "../../../../components/Button/Button.vue2.js";
1
+ import { ref as d, resolveComponent as k, openBlock as E, createElementBlock as S, createElementVNode as o, toDisplayString as r, unref as t, createVNode as l, Transition as h, withCtx as m, withDirectives as f, vShow as _, createTextVNode as v } from "vue";
2
+ import x from "../../../../components/Tab/Tab.vue2.js";
3
+ import N from "../../../../components/Field/Field.vue.js";
4
+ import V from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
+ import D from "../../../../components/Button/Button.vue.js";
6
6
  import { useRoute as I, useRouter as P } from "vue-router";
7
- import { useI18n as U } from "vue-i18n";
8
- import F from "../../localization/SignUp.json.js";
7
+ import { useI18n as F } from "vue-i18n";
8
+ import O from "../../localization/SignUp.json.js";
9
9
  import { state as s } from "../../store/auth.js";
10
- import { sendCode as O } from "../../store/twofa.js";
11
- import { validateInputs as b, validatePhone as T, validateEmail as A } from "../../../middlewares/client/inputs.validation.js";
10
+ import { sendCode as T } from "../../store/twofa.js";
11
+ import { validateInputs as b, validatePhone as U, validateEmail as A } from "../../../middlewares/client/inputs.validation.js";
12
12
  import "./SignUp.vue2.js";
13
- const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, L = { class: "pos-relative" }, j = { class: "mn-b-semi radius-small" }, q = { class: "mn-b-small t-transp" }, z = { class: "mn-b-semi radius-small o-hidden" }, G = { class: "mn-b-small t-transp" }, H = { class: "w-100" }, se = {
13
+ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { class: "mn-b-small p-small uppercase t-semi bg-grey radius-big o-hidden" }, L = { class: "pos-relative" }, j = { class: "mn-b-semi radius-small" }, q = { class: "mn-b-small t-transp" }, z = { class: "mn-b-semi radius-small o-hidden" }, G = { class: "mn-b-small t-transp" }, H = { class: "w-100" }, ie = {
14
14
  __name: "SignUp",
15
15
  setup(J) {
16
- const { t: e } = U({
16
+ const { t: e } = F({
17
17
  useScope: "global",
18
- ...F
18
+ ...O
19
19
  }), u = d(null), c = d(null);
20
20
  I();
21
- const w = P(), l = d("phone");
22
- async function g() {
21
+ const g = P(), a = d("phone");
22
+ async function w() {
23
23
  try {
24
- l.value === "phone" && await b(
24
+ a.value === "phone" && await b(
25
25
  u,
26
- T,
26
+ U,
27
27
  s.user.phone,
28
28
  "Некорректный телефон"
29
- ), l.value === "email" && await b(
29
+ ), a.value === "email" && await b(
30
30
  c,
31
31
  A,
32
32
  s.user.email,
@@ -36,22 +36,22 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
36
36
  throw new Error();
37
37
  }
38
38
  try {
39
- await O(s.user, "signup", l.value);
39
+ await T(s.user, "signup", a.value);
40
40
  } catch {
41
41
  throw new Error();
42
42
  }
43
43
  }
44
- function V() {
45
- w.push({ name: "Enter Code" });
44
+ function C() {
45
+ g.push({ name: "Enter Code" });
46
46
  }
47
47
  return (p, i) => {
48
- const y = C("router-link");
49
- return k(), E("section", B, [
48
+ const y = k("router-link");
49
+ return E(), S("section", B, [
50
50
  o("h3", R, r(t(e)("title")), 1),
51
51
  o("div", $, [
52
- a(S, {
53
- selected: l.value,
54
- "onUpdate:selected": i[0] || (i[0] = (n) => l.value = n),
52
+ l(x, {
53
+ selected: a.value,
54
+ "onUpdate:selected": i[0] || (i[0] = (n) => a.value = n),
55
55
  tabs: [
56
56
  { name: t(e)("phone"), value: "phone" },
57
57
  { name: t(e)("email"), value: "email" }
@@ -59,13 +59,12 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
59
59
  }, null, 8, ["selected", "tabs"])
60
60
  ]),
61
61
  o("div", L, [
62
- a(h, { name: "slide-fade" }, {
62
+ l(h, { name: "slide-fade" }, {
63
63
  default: m(() => [
64
64
  f(o("div", j, [
65
65
  o("p", q, r(t(e)("smsNotice")), 1),
66
- a(N, {
67
- modelValue: s.user.phone,
68
- "onUpdate:modelValue": i[1] || (i[1] = (n) => s.user.phone = n),
66
+ l(V, {
67
+ onChange: i[1] || (i[1] = (n) => s.user.phone = n),
69
68
  dropdownOptions: {
70
69
  showDialCodeInSelection: !0,
71
70
  showFlags: !0,
@@ -75,18 +74,18 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
75
74
  mode: "national",
76
75
  inputOptions: { placeholder: t(e)("phonePlaceholder") },
77
76
  class: "bg-grey pd-small radius-small mn-b-thin"
78
- }, null, 8, ["modelValue", "validation", "inputOptions"])
77
+ }, null, 8, ["validation", "inputOptions"])
79
78
  ], 512), [
80
- [_, l.value === "phone"]
79
+ [_, a.value === "phone"]
81
80
  ])
82
81
  ]),
83
82
  _: 1
84
83
  }),
85
- a(h, { name: "slide-fade" }, {
84
+ l(h, { name: "slide-fade" }, {
86
85
  default: m(() => [
87
86
  f(o("div", z, [
88
87
  o("p", G, r(t(e)("emailNotice")), 1),
89
- a(x, {
88
+ l(N, {
90
89
  field: s.user.email,
91
90
  "onUpdate:field": i[2] || (i[2] = (n) => s.user.email = n),
92
91
  placeholder: t(e)("emailPlaceholder"),
@@ -94,15 +93,15 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
94
93
  class: "bg-grey pd-medium radius-small"
95
94
  }, null, 8, ["field", "placeholder", "validation"])
96
95
  ], 512), [
97
- [_, l.value === "email"]
96
+ [_, a.value === "email"]
98
97
  ])
99
98
  ]),
100
99
  _: 1
101
100
  })
102
101
  ]),
103
- a(D, {
104
- submit: g,
105
- callback: V,
102
+ l(D, {
103
+ submit: w,
104
+ callback: C,
106
105
  class: "w-100 bg-main mn-b-big"
107
106
  }, {
108
107
  default: m(() => [
@@ -111,7 +110,7 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
111
110
  _: 1
112
111
  }),
113
112
  o("div", H, [
114
- a(y, {
113
+ l(y, {
115
114
  to: "/auth/signin",
116
115
  class: "underline mn-b-medium d-block t-blue"
117
116
  }, {
@@ -126,5 +125,5 @@ const B = { class: "t-left pd-medium" }, R = { class: "mn-b-small" }, $ = { clas
126
125
  }
127
126
  };
128
127
  export {
129
- se as default
128
+ ie as default
130
129
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../node_modules/axios/lib/axios.cjs"),d=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),f=require("vue"),i=require("../../globals/store/globals.cjs"),g=require("./twofa.cjs"),u=w.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=f.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function O(){const e=await m("user");if(e){const{_id:t,email:s,phone:c,roles:o,accessToken:n}=e;Object.assign(a.user,{_id:t,email:s,phone:c}),Object.assign(a.access,{token:n,roles:o,status:!!n}),u.interceptors.request.use(r=>(n&&(r.headers["x-access-token"]=n),r),r=>Promise.reject(r))}}O();const h={async login(e,t){try{const s=await u.post("/api/auth/signin",{...e,type:t});return p("user",s.data),Object.assign(a.user,{...s.data}),Object.assign(a.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(a.access,{token:null,status:!1,roles:null}),i.setError(s),Promise.reject(s)}},async signup(e,t,s){var n;const{password:c,passwordRepeat:o}=a.user;if(console.log(c),console.log(o),c!==o){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw i.setError(r),new Error(r.response.status)}try{(n=e.phone)!=null&&n.number&&(e.phone=e.phone.number);const r=await u.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(r),r.data.accessToken&&p("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw i.setError(r),console.log("Sign up falied"),r}},logout(){P("user"),Object.assign(a.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(a.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await u.post("/api/auth/reset-password",{email:e.email,phone:e.phone.number,type:t});return Object.assign(g.state.code,{...s.data,isSended:!0}),s.data}catch(s){return i.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:c}=a.user;if(s!==c){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw i.setError(o),new Error(o.response.status)}try{const o=await u.post("/api/auth/update-password",{email:e.email,phone:e.phone.number,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return o.data.accessToken&&p("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return i.setError(o),Promise.reject(o)}}},k={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.API_URL,sameSite:"none",secure:!0}};async function m(e){if(process.env.MOBILE_APP){const{value:t}=await l.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=d.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?l.Preferences.set({key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),k[s])}function P(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};d.default.remove(e,s)}}f.watch(a,(e,t)=>{});exports.actions=h;exports.state=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../node_modules/axios/lib/axios.cjs"),d=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),w=require("vue"),c=require("../../globals/store/globals.cjs"),g=require("./twofa.cjs"),i=f.default.create({baseURL:process.env.API_URL,withCredentials:!0}),o=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function O(){const e=await P("user");if(e){const{_id:t,email:s,phone:n,roles:a,accessToken:r}=e;Object.assign(o.user,{_id:t,email:s,phone:n}),Object.assign(o.access,{token:r,roles:a,status:!!r}),i.interceptors.request.use(u=>(r&&(u.headers["x-access-token"]=r),u),u=>Promise.reject(u))}}O();const k={async login(e,t){try{const s=await i.post("/api/auth/signin",{...e,type:t});return p("user",s.data),Object.assign(o.user,{...s.data}),Object.assign(o.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(o.access,{token:null,status:!1,roles:null}),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:a}=o.user;if(console.log(n),console.log(a),n!==a){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(r),new Error(r.response.status)}try{const r=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(r),r.data.accessToken&&p("user",r.data),Object.assign(o.user,{...r.data}),Object.assign(o.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw c.setError(r),console.log("Sign up falied"),r}},logout(){j("user"),Object.assign(o.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(o.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await i.post("/api/auth/reset-password",{email:e.email,phone:e.phone,type:t});return Object.assign(g.state.code,{...s.data,isSended:!0}),s.data}catch(s){return c.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:n}=o.user;if(s!==n){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(a),new Error(a.response.status)}try{const a=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return a.data.accessToken&&p("user",a.data),Object.assign(o.user,{...a.data}),Object.assign(o.access,{token:a.data.accessToken,status:!0}),a.data}catch(a){return c.setError(a),Promise.reject(a)}}},h={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.API_URL,sameSite:"none",secure:!0}};async function P(e){if(process.env.MOBILE_APP){const{value:t}=await l.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=d.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?l.Preferences.set({key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),h[s])}function j(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};d.default.remove(e,s)}}w.watch(o,(e,t)=>{});exports.actions=k;exports.state=o;
@@ -1,10 +1,10 @@
1
- import m from "../../../../node_modules/axios/lib/axios.js";
1
+ import w from "../../../../node_modules/axios/lib/axios.js";
2
2
  import d from "../../../../../node_modules/js-cookie/dist/js.cookie.js";
3
3
  import { Preferences as l } from "../../../../node_modules/@capacitor/preferences/dist/esm/index.js";
4
- import { reactive as w, watch as f } from "vue";
5
- import { setError as i } from "../../globals/store/globals.js";
4
+ import { reactive as m, watch as f } from "vue";
5
+ import { setError as c } from "../../globals/store/globals.js";
6
6
  import { state as O } from "./twofa.js";
7
- const p = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = w({
7
+ const i = w.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = m({
8
8
  user: {
9
9
  _id: void 0,
10
10
  username: "",
@@ -22,15 +22,15 @@ const p = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = w
22
22
  async function g() {
23
23
  const e = await k("user");
24
24
  if (e) {
25
- const { _id: t, email: s, phone: c, roles: a, accessToken: n } = e;
26
- Object.assign(r.user, { _id: t, email: s, phone: c }), Object.assign(r.access, { token: n, roles: a, status: !!n }), p.interceptors.request.use((o) => (n && (o.headers["x-access-token"] = n), o), (o) => Promise.reject(o));
25
+ const { _id: t, email: s, phone: n, roles: o, accessToken: a } = e;
26
+ Object.assign(r.user, { _id: t, email: s, phone: n }), Object.assign(r.access, { token: a, roles: o, status: !!a }), i.interceptors.request.use((p) => (a && (p.headers["x-access-token"] = a), p), (p) => Promise.reject(p));
27
27
  }
28
28
  }
29
29
  g();
30
30
  const R = {
31
31
  async login(e, t) {
32
32
  try {
33
- const s = await p.post("/api/auth/signin", {
33
+ const s = await i.post("/api/auth/signin", {
34
34
  ...e,
35
35
  type: t
36
36
  });
@@ -46,36 +46,34 @@ const R = {
46
46
  token: null,
47
47
  status: !1,
48
48
  roles: null
49
- }), i(s), Promise.reject(s);
49
+ }), c(s), Promise.reject(s);
50
50
  }
51
51
  },
52
52
  async signup(e, t, s) {
53
- var n;
54
- const { password: c, passwordRepeat: a } = r.user;
55
- if (console.log(c), console.log(a), c !== a) {
56
- const o = {
53
+ const { password: n, passwordRepeat: o } = r.user;
54
+ if (console.log(n), console.log(o), n !== o) {
55
+ const a = {
57
56
  response: {
58
57
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
59
58
  }
60
59
  };
61
- throw i(o), new Error(o.response.status);
60
+ throw c(a), new Error(a.response.status);
62
61
  }
63
62
  try {
64
- (n = e.phone) != null && n.number && (e.phone = e.phone.number);
65
- const o = await p.post("/api/auth/signup", {
63
+ const a = await i.post("/api/auth/signup", {
66
64
  ...e,
67
65
  type: t,
68
66
  inviteCode: s
69
67
  });
70
- return console.log(o), o.data.accessToken && u("user", o.data), Object.assign(r.user, {
71
- ...o.data
68
+ return console.log(a), a.data.accessToken && u("user", a.data), Object.assign(r.user, {
69
+ ...a.data
72
70
  }), Object.assign(r.access, {
73
- token: o.data.accessToken,
71
+ token: a.data.accessToken,
74
72
  status: !0,
75
- roles: o.data.roles
76
- }), o.data;
77
- } catch (o) {
78
- throw i(o), console.log("Sign up falied"), o;
73
+ roles: a.data.roles
74
+ }), a.data;
75
+ } catch (a) {
76
+ throw c(a), console.log("Sign up falied"), a;
79
77
  }
80
78
  },
81
79
  logout() {
@@ -91,9 +89,9 @@ const R = {
91
89
  },
92
90
  async resetPassword(e, t) {
93
91
  try {
94
- const s = await p.post("/api/auth/reset-password", {
92
+ const s = await i.post("/api/auth/reset-password", {
95
93
  email: e.email,
96
- phone: e.phone.number,
94
+ phone: e.phone,
97
95
  type: t
98
96
  });
99
97
  return Object.assign(O.code, {
@@ -101,35 +99,35 @@ const R = {
101
99
  isSended: !0
102
100
  }), s.data;
103
101
  } catch (s) {
104
- return i(s), Promise.reject(s);
102
+ return c(s), Promise.reject(s);
105
103
  }
106
104
  },
107
105
  async updatePassword(e, t) {
108
- const { password: s, passwordRepeat: c } = r.user;
109
- if (s !== c) {
110
- const a = {
106
+ const { password: s, passwordRepeat: n } = r.user;
107
+ if (s !== n) {
108
+ const o = {
111
109
  response: {
112
110
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
113
111
  }
114
112
  };
115
- throw i(a), new Error(a.response.status);
113
+ throw c(o), new Error(o.response.status);
116
114
  }
117
115
  try {
118
- const a = await p.post("/api/auth/update-password", {
116
+ const o = await i.post("/api/auth/update-password", {
119
117
  email: e.email,
120
- phone: e.phone.number,
118
+ phone: e.phone,
121
119
  password: e.password,
122
120
  passwordRepeat: e.passwordRepeat,
123
121
  type: t
124
122
  });
125
- return a.data.accessToken && u("user", a.data), Object.assign(r.user, {
126
- ...a.data
123
+ return o.data.accessToken && u("user", o.data), Object.assign(r.user, {
124
+ ...o.data
127
125
  }), Object.assign(r.access, {
128
- token: a.data.accessToken,
126
+ token: o.data.accessToken,
129
127
  status: !0
130
- }), a.data;
131
- } catch (a) {
132
- return i(a), Promise.reject(a);
128
+ }), o.data;
129
+ } catch (o) {
130
+ return c(o), Promise.reject(o);
133
131
  }
134
132
  }
135
133
  }, h = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../../../node_modules/axios/lib/axios.cjs");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");const r=require("vue"),d=require("../../globals/store/globals.cjs"),c=n.default.create({baseURL:process.env.API_URL,withCredentials:!0}),t=r.reactive({code:{value:"",type:"",method:"",isSended:!1,isValid:!1}});async function l(a,o,i){let s="/api/twofa/sendcode";return o==="reset-password"&&(s="/api/twofa/sendcodereset"),await c.post(s,{phone:a.phone.number,email:a.email,method:o,type:i}).then(e=>(t.code=e.data,t.code.isSended=!0,Promise.resolve(e.data)),e=>(console.log(e),d.setError(e),Promise.reject(e)))}r.watch(t,(a,o)=>{});exports.sendCode=l;exports.state=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../../../node_modules/axios/lib/axios.cjs");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");const i=require("vue"),n=require("../../globals/store/globals.cjs"),c=d.default.create({baseURL:process.env.API_URL,withCredentials:!0}),t=i.reactive({code:{value:"",type:"",method:"",isSended:!1,isValid:!1}});async function l(a,o,r){let s="/api/twofa/sendcode";return o==="reset-password"&&(s="/api/twofa/sendcodereset"),await c.post(s,{phone:a.phone,email:a.email,method:o,type:r}).then(e=>(t.code=e.data,t.code.isSended=!0,Promise.resolve(e.data)),e=>(console.log(e),n.setError(e),Promise.reject(e)))}i.watch(t,(a,o)=>{});exports.sendCode=l;exports.state=t;
@@ -11,10 +11,10 @@ const p = r.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = d
11
11
  isValid: !1
12
12
  }
13
13
  });
14
- async function w(t, o, i) {
14
+ async function h(t, o, i) {
15
15
  let s = "/api/twofa/sendcode";
16
16
  return o === "reset-password" && (s = "/api/twofa/sendcodereset"), await p.post(s, {
17
- phone: t.phone.number,
17
+ phone: t.phone,
18
18
  email: t.email,
19
19
  method: o,
20
20
  type: i
@@ -26,6 +26,6 @@ async function w(t, o, i) {
26
26
  n(a, (t, o) => {
27
27
  });
28
28
  export {
29
- w as sendCode,
29
+ h as sendCode,
30
30
  a as state
31
31
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router"),f=require("../../../../components/Select/Select.vue.cjs"),g=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),x=require("../../../icons/entities/IconFeatured.vue.cjs"),b=require("../../../icons/entities/IconPopular.vue.cjs"),_=require("../../../icons/entities/IconRecent.vue.cjs"),w=require("../../../icons/entities/IconFollowing.vue.cjs"),m=require("../../store/blogposts.cjs"),l=require("../../../auth/store/auth.cjs"),c=require("../../../organizations/store/organizations.cjs"),k=require("../../../organizations/store/memberships.cjs"),N={style:{"grid-template-columns":"2fr 4fr 2fr"},class:"cols-3 gap-thin pd-thin"},V={class:"align-self-start pos-sticky pos-t-0 w-100 bg-grey radius-big pd-medium p-medium gap-thin flex-column flex-nowrap flex"},v={class:"pos-relative"},C={class:"bg-main t-black radius-big pd-medium pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex"},y={class:"pos-relative flex-v-center flex-nowrap flex"},B=e.createElementVNode("span",{class:"mn-r-small"},"Topics for ",-1),q={class:"align-self-start bg-grey radius-big pd-medium"},E={class:"gap-thin flex-nowrap flex"},z=e.createElementVNode("p",{class:"t-medium mn-b-small"},"Popular Communities",-1),T={__name:"Community",setup(F){const o=d.useRoute(),a=d.useRouter(),p=({membership:u,status:r,target:s},i,t)=>{k.mutations.handleMembershipUpdate(c.state.current,u,r,s,i,t)};return(u,r)=>{const s=e.resolveComponent("router-link"),i=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("ul",V,[e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="featured"},"cursor-pointer flex-v-center flex t-medium pd-thin radius-extra"]),onClick:r[0]||(r[0]=t=>e.unref(a).push({name:"Blog",params:{category:"featured"}}))},[e.createVNode(x.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Featured ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="popular"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[1]||(r[1]=t=>e.unref(a).push({name:"Blog",params:{category:"popular"}}))},[e.createVNode(b.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Popular ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="new"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[2]||(r[2]=t=>e.unref(a).push({name:"Blog",params:{category:"new"}}))},[e.createVNode(_.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Recent ")],2),l.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(o).params.category==="following"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[3]||(r[3]=t=>e.unref(a).push({name:"Blog",params:{category:"following"}}))},[e.createVNode(w.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Following ")],2)):e.createCommentVNode("",!0),e.createVNode(s,{to:{name:"Create BlogPost"},class:"button t-medium mn-t-small bg-main w-100"},{default:e.withCtx(()=>[e.createTextVNode(" Create Post ")]),_:1})]),e.createElementVNode("section",v,[e.createElementVNode("header",C,[e.createElementVNode("h2",y,[B,e.createVNode(f.default,{options:["today","week","month","year"],select:m.state.filter.period,"onUpdate:select":r[4]||(r[4]=t=>m.state.filter.period=t),placeholder:"Select type",class:"t-semi pos-relative w-max bg-main t-black pd-thin radius-medium h2 t-center br-solid br-2px br-black-transp-10"},null,8,["select"])])]),e.createVNode(i,null,{default:e.withCtx(({Component:t,route:n})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t),{ref:"page",key:n.query}))]),_:2},1024)]),_:1})]),e.createElementVNode("div",q,[e.createElementVNode("div",E,[z,l.state.user._id?(e.openBlock(),e.createBlock(s,{key:0,to:{name:"Create Organization"},class:"t-medium cursor-pointer hover-scale-1 radius-extra flex-center flex i-medium bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" + ")]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createVNode(g.default,{states:{empty:{title:"No Organization Found",description:"Currently, there are no organization available."}},store:{read:t=>c.actions.read(t),state:c.state},options:{user:l.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(h.default,{key:n._id,organization:n,user:l.state.user,showProducts:!1,showRating:!1,showFeatured:!1,showFollowers:!1,onUpdateMembership:p,class:"mn-b-thin w-100 pd-0 bg-white radius-big o-hidden"},null,8,["organization","user"]))),128))]),_:1},8,["store","options"])]),_:1})])])}}};exports.default=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router"),f=require("../../../../components/Select/Select.vue2.cjs"),g=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),x=require("../../../icons/entities/IconFeatured.vue.cjs"),b=require("../../../icons/entities/IconPopular.vue.cjs"),_=require("../../../icons/entities/IconRecent.vue.cjs"),w=require("../../../icons/entities/IconFollowing.vue.cjs"),m=require("../../store/blogposts.cjs"),l=require("../../../auth/store/auth.cjs"),c=require("../../../organizations/store/organizations.cjs"),k=require("../../../organizations/store/memberships.cjs"),N={style:{"grid-template-columns":"2fr 4fr 2fr"},class:"cols-3 gap-thin pd-thin"},V={class:"align-self-start pos-sticky pos-t-0 w-100 bg-grey radius-big pd-medium p-medium gap-thin flex-column flex-nowrap flex"},v={class:"pos-relative"},C={class:"bg-main t-black radius-big pd-medium pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex"},y={class:"pos-relative flex-v-center flex-nowrap flex"},B=e.createElementVNode("span",{class:"mn-r-small"},"Topics for ",-1),q={class:"align-self-start bg-grey radius-big pd-medium"},E={class:"gap-thin flex-nowrap flex"},z=e.createElementVNode("p",{class:"t-medium mn-b-small"},"Popular Communities",-1),T={__name:"Community",setup(F){const o=d.useRoute(),a=d.useRouter(),p=({membership:u,status:r,target:s},i,t)=>{k.mutations.handleMembershipUpdate(c.state.current,u,r,s,i,t)};return(u,r)=>{const s=e.resolveComponent("router-link"),i=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("ul",V,[e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="featured"},"cursor-pointer flex-v-center flex t-medium pd-thin radius-extra"]),onClick:r[0]||(r[0]=t=>e.unref(a).push({name:"Blog",params:{category:"featured"}}))},[e.createVNode(x.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Featured ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="popular"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[1]||(r[1]=t=>e.unref(a).push({name:"Blog",params:{category:"popular"}}))},[e.createVNode(b.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Popular ")],2),e.createElementVNode("li",{class:e.normalizeClass([{"t-black bg-white":e.unref(o).params.category==="new"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[2]||(r[2]=t=>e.unref(a).push({name:"Blog",params:{category:"new"}}))},[e.createVNode(_.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Recent ")],2),l.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(o).params.category==="following"},"cursor-pointer t-medium flex-v-center flex pd-thin radius-extra"]),onClick:r[3]||(r[3]=t=>e.unref(a).push({name:"Blog",params:{category:"following"}}))},[e.createVNode(w.default,{class:"i-medium mn-r-thin t-transp"}),e.createTextVNode(" Following ")],2)):e.createCommentVNode("",!0),e.createVNode(s,{to:{name:"Create BlogPost"},class:"button t-medium mn-t-small bg-main w-100"},{default:e.withCtx(()=>[e.createTextVNode(" Create Post ")]),_:1})]),e.createElementVNode("section",v,[e.createElementVNode("header",C,[e.createElementVNode("h2",y,[B,e.createVNode(f.default,{options:["today","week","month","year"],select:m.state.filter.period,"onUpdate:select":r[4]||(r[4]=t=>m.state.filter.period=t),placeholder:"Select type",class:"t-semi pos-relative w-max bg-main t-black pd-thin radius-medium h2 t-center br-solid br-2px br-black-transp-10"},null,8,["select"])])]),e.createVNode(i,null,{default:e.withCtx(({Component:t,route:n})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t),{ref:"page",key:n.query}))]),_:2},1024)]),_:1})]),e.createElementVNode("div",q,[e.createElementVNode("div",E,[z,l.state.user._id?(e.openBlock(),e.createBlock(s,{key:0,to:{name:"Create Organization"},class:"t-medium cursor-pointer hover-scale-1 radius-extra flex-center flex i-medium bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" + ")]),_:1})):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.createVNode(g.default,{states:{empty:{title:"No Organization Found",description:"Currently, there are no organization available."}},store:{read:t=>c.actions.read(t),state:c.state},options:{user:l.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(h.default,{key:n._id,organization:n,user:l.state.user,showProducts:!1,showRating:!1,showFeatured:!1,showFollowers:!1,onUpdateMembership:p,class:"mn-b-thin w-100 pd-0 bg-white radius-big o-hidden"},null,8,["organization","user"]))),128))]),_:1},8,["store","options"])]),_:1})])])}}};exports.default=T;