@ozdao/prometheus-framework 0.2.138 → 0.2.139

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. package/dist/auth.server.js +29 -14
  2. package/dist/auth.server.mjs +29 -14
  3. package/dist/community.server.js +3 -3
  4. package/dist/community.server.mjs +3 -3
  5. package/dist/events.server.js +3 -3
  6. package/dist/events.server.mjs +3 -3
  7. package/dist/files.server.js +3 -3
  8. package/dist/files.server.mjs +3 -3
  9. package/dist/gallery.server.js +4 -4
  10. package/dist/gallery.server.mjs +4 -4
  11. package/dist/index-DNI4aUP2.js +259 -0
  12. package/dist/index-Tcyehi73.mjs +260 -0
  13. package/dist/orders.server.js +9 -8
  14. package/dist/orders.server.mjs +9 -8
  15. package/dist/organizations.server.js +31 -15
  16. package/dist/organizations.server.mjs +31 -15
  17. package/dist/products.server.js +37 -5
  18. package/dist/products.server.mjs +37 -5
  19. package/dist/prometheus-framework/src/components/Completion/Completion.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Completion/Completion.vue.js +19 -19
  21. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  25. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  29. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +32 -31
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  37. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/auth/store/auth.js +50 -47
  39. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  41. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  43. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  53. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  55. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  57. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  63. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.js +1 -1
  65. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +14 -14
  67. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +4 -4
  69. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +41 -38
  75. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  77. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  79. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +121 -112
  81. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  83. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +15 -14
  85. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  87. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +120 -60
  89. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  91. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +25 -24
  93. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  95. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  97. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  99. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  101. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  103. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  105. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  107. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  109. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  111. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  115. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  117. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +3 -3
  119. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +66 -67
  121. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
  123. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  125. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +78 -74
  127. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
  131. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
  133. package/dist/reports.server.js +0 -3
  134. package/dist/reports.server.mjs +0 -3
  135. package/dist/style.css +1 -1
  136. package/dist/wallet.server.js +5 -5
  137. package/dist/wallet.server.mjs +8 -8
  138. package/package.json +1 -1
  139. package/src/components/Completion/Completion.vue +29 -30
  140. package/src/modules/auth/components/pages/Invite.vue +4 -2
  141. package/src/modules/auth/controllers/auth.controller.js +30 -12
  142. package/src/modules/auth/middlewares/authJwt.js +80 -0
  143. package/src/modules/{middlewares/server → auth/middlewares}/index.js +1 -3
  144. package/src/modules/{middlewares/server → auth/middlewares}/verifyAccesses.js +1 -1
  145. package/src/modules/auth/routes/auth.routes.js +2 -2
  146. package/src/modules/auth/routes/twofa.routes.js +1 -1
  147. package/src/modules/auth/store/auth.js +9 -0
  148. package/src/modules/chats/routes/chats.routes.js +1 -1
  149. package/src/modules/community/routes/blog.routes.js +2 -2
  150. package/src/modules/events/routes/events.routes.js +2 -2
  151. package/src/modules/files/routes/files.routes.js +2 -2
  152. package/src/modules/gallery/routes/gallery.routes.js +4 -5
  153. package/src/modules/globals/services/globals.crud.js +2 -2
  154. package/src/modules/marketplace/store/marketplace.js +1 -1
  155. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -2
  156. package/src/modules/orders/components/sections/FormAddCustomer.vue +2 -2
  157. package/src/modules/orders/controllers/orders.controller.js +1 -0
  158. package/src/modules/orders/routes/applications.routes.js +2 -2
  159. package/src/modules/orders/routes/orders.routes.js +2 -2
  160. package/src/modules/organizations/components/blocks/CardOrganization.vue +9 -7
  161. package/src/modules/organizations/components/pages/Members.vue +26 -15
  162. package/src/modules/organizations/components/sections/DetailsTab.vue +1 -1
  163. package/src/modules/organizations/components/sections/MembersAdd.vue +101 -43
  164. package/src/modules/organizations/controllers/invites.controller.js +18 -13
  165. package/src/modules/organizations/controllers/memberships.controller.js +16 -9
  166. package/src/modules/organizations/controllers/organizations.controller.js +3 -4
  167. package/src/modules/organizations/models/membership.model.js +2 -0
  168. package/src/modules/organizations/models/organization.model.js +4 -0
  169. package/src/modules/organizations/routes/invites.routes.js +2 -2
  170. package/src/modules/organizations/store/invites.js +2 -1
  171. package/src/modules/products/controllers/leftovers.controller.js +1 -1
  172. package/src/modules/products/middlewares/index.js +11 -0
  173. package/src/modules/products/routes/categories.routes.js +2 -2
  174. package/src/modules/reports/routes/reports.routes.js +2 -2
  175. package/src/modules/spots/components/layouts/Spots.vue +2 -2
  176. package/src/modules/spots/components/pages/Map.vue +79 -78
  177. package/src/modules/users/components/pages/ProfileEdit.vue +37 -22
  178. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -2
  179. package/src/modules/wallet/controllers/routes/rewards.routes.js +2 -2
  180. package/src/modules/middlewares/server/authJwt.js +0 -68
  181. /package/src/modules/{middlewares/server → auth/middlewares}/authSecret.js +0 -0
  182. /package/src/modules/{middlewares/server → auth/middlewares}/verifyInvites.js +0 -0
  183. /package/src/modules/{middlewares/server → auth/middlewares}/verifySignUp.js +0 -0
  184. /package/src/modules/{middlewares/server → auth/middlewares}/verifyUser.js +0 -0
  185. /package/src/modules/globals/services/{globals.cashe.js → globals.cache.js} +0 -0
  186. /package/src/modules/{middlewares/server → products/middlewares}/verifyCategory.js +0 -0
@@ -6,7 +6,6 @@ require("uuid");
6
6
  const require$$0 = require("mongoose");
7
7
  require("path");
8
8
  const require$$3 = require("openai");
9
- const index = require("./index-CDbtWkBj.js");
10
9
  const queryProcessor = require("./queryProcessor-iewDZq_f.js");
11
10
  var product_model = (mongoose) => {
12
11
  const ProductSchema = new mongoose.Schema({
@@ -803,11 +802,44 @@ const controllerFactory$3 = (db) => {
803
802
  };
804
803
  };
805
804
  var categories_controller = controllerFactory$3;
805
+ var verifyCategory;
806
+ var hasRequiredVerifyCategory;
807
+ function requireVerifyCategory() {
808
+ if (hasRequiredVerifyCategory) return verifyCategory;
809
+ hasRequiredVerifyCategory = 1;
810
+ const middlewareFactory = (db) => {
811
+ const Category = db.category;
812
+ const checkCategoryExistOrNot = async (req, res, next) => {
813
+ try {
814
+ const category = await Category.findOne({ url: req.body.url });
815
+ if (category) {
816
+ res.status(400).send({ message: "Failed! Category with this URL is already in use!" });
817
+ return;
818
+ }
819
+ next();
820
+ } catch (err) {
821
+ res.status(500).send({ message: err });
822
+ }
823
+ };
824
+ return {
825
+ checkCategoryExistOrNot
826
+ };
827
+ };
828
+ verifyCategory = middlewareFactory;
829
+ return verifyCategory;
830
+ }
831
+ const middlewareIndexFactory = (db) => {
832
+ const verifyCategory2 = requireVerifyCategory()(db);
833
+ return {
834
+ verifyCategory: verifyCategory2
835
+ };
836
+ };
837
+ var middlewares = middlewareIndexFactory;
806
838
  const controllerFactory$2 = categories_controller;
807
- const middlewareFactory = index.server;
839
+ const middlewareFactoryProducts = middlewares;
808
840
  var categories_routes = function(app, db) {
809
841
  const controller = controllerFactory$2(db);
810
- const { verifyCategory } = middlewareFactory(db);
842
+ const { verifyCategory: verifyCategory2 } = middlewareFactoryProducts(db);
811
843
  app.get(
812
844
  "/categories",
813
845
  controller.getCategories
@@ -823,7 +855,7 @@ var categories_routes = function(app, db) {
823
855
  app.post(
824
856
  "/categories/add",
825
857
  [
826
- verifyCategory.checkCategoryExistOrNot
858
+ verifyCategory2.checkCategoryExistOrNot
827
859
  ],
828
860
  controller.addCategory
829
861
  );
@@ -883,7 +915,7 @@ const controllerFactory$1 = (db) => {
883
915
  )
884
916
  ];
885
917
  const leftoveres = await Leftover.aggregate(stages).exec();
886
- if (!leftoveres.length) {
918
+ if (!leftoveres) {
887
919
  return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
888
920
  }
889
921
  res.status(200).send(leftoveres);
@@ -4,7 +4,6 @@ import "uuid";
4
4
  import require$$0 from "mongoose";
5
5
  import "path";
6
6
  import require$$3 from "openai";
7
- import { s as server } from "./index-C-8xOJnM.mjs";
8
7
  import { q as queryProcessor } from "./queryProcessor-DQSFR9YA.mjs";
9
8
  var product_model = (mongoose) => {
10
9
  const ProductSchema = new mongoose.Schema({
@@ -801,11 +800,44 @@ const controllerFactory$3 = (db) => {
801
800
  };
802
801
  };
803
802
  var categories_controller = controllerFactory$3;
803
+ var verifyCategory;
804
+ var hasRequiredVerifyCategory;
805
+ function requireVerifyCategory() {
806
+ if (hasRequiredVerifyCategory) return verifyCategory;
807
+ hasRequiredVerifyCategory = 1;
808
+ const middlewareFactory = (db) => {
809
+ const Category = db.category;
810
+ const checkCategoryExistOrNot = async (req, res, next) => {
811
+ try {
812
+ const category = await Category.findOne({ url: req.body.url });
813
+ if (category) {
814
+ res.status(400).send({ message: "Failed! Category with this URL is already in use!" });
815
+ return;
816
+ }
817
+ next();
818
+ } catch (err) {
819
+ res.status(500).send({ message: err });
820
+ }
821
+ };
822
+ return {
823
+ checkCategoryExistOrNot
824
+ };
825
+ };
826
+ verifyCategory = middlewareFactory;
827
+ return verifyCategory;
828
+ }
829
+ const middlewareIndexFactory = (db) => {
830
+ const verifyCategory2 = requireVerifyCategory()(db);
831
+ return {
832
+ verifyCategory: verifyCategory2
833
+ };
834
+ };
835
+ var middlewares = middlewareIndexFactory;
804
836
  const controllerFactory$2 = categories_controller;
805
- const middlewareFactory = server;
837
+ const middlewareFactoryProducts = middlewares;
806
838
  var categories_routes = function(app, db) {
807
839
  const controller = controllerFactory$2(db);
808
- const { verifyCategory } = middlewareFactory(db);
840
+ const { verifyCategory: verifyCategory2 } = middlewareFactoryProducts(db);
809
841
  app.get(
810
842
  "/categories",
811
843
  controller.getCategories
@@ -821,7 +853,7 @@ var categories_routes = function(app, db) {
821
853
  app.post(
822
854
  "/categories/add",
823
855
  [
824
- verifyCategory.checkCategoryExistOrNot
856
+ verifyCategory2.checkCategoryExistOrNot
825
857
  ],
826
858
  controller.addCategory
827
859
  );
@@ -881,7 +913,7 @@ const controllerFactory$1 = (db) => {
881
913
  )
882
914
  ];
883
915
  const leftoveres = await Leftover.aggregate(stages).exec();
884
- if (!leftoveres.length) {
916
+ if (!leftoveres) {
885
917
  return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
886
918
  }
887
919
  res.status(200).send(leftoveres);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d={class:"w-100 radius-big pd-medium bg-second t-black"},m={class:"mn-b-thin flex-v-center flex-nowrap flex"},g={class:"mn-l-thin uppercase radius-big t-semi t-medium t-white bg-black w-max pd-thin"},p={class:"w-100 h-2r pos-relative pd-nano bg-black radius-big"},h={__name:"Completion",props:{user:Object,target:Object,cta:Boolean,percentage:Number,text:String,text_cta:String},setup(a){const{user:f,cta:b,target:c}=a,l=e.ref(0),u=o=>{let r=0,i=0;function s(t){for(let n in t)t.hasOwnProperty(n)&&(t[n]&&typeof t[n]=="object"&&!Array.isArray(t[n])?s(t[n]):(r++,t[n]!=null&&t[n]!==""&&i++))}return s(o),r===0?0:Math.round(i/r*100)};return c&&(l.value=u(c)),(o,r)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",d,[e.createElementVNode("div",m,[e.createElementVNode("h3",null,e.toDisplayString(a.text),1),e.createElementVNode("h4",g,e.toDisplayString(a.percentage||l.value)+"% ",1),a.cta?(e.openBlock(),e.createBlock(i,{key:0,to:{name:"User Edit Profile",params:{_id:a.user}},class:"mn-l-auto uppercase radius-big t-semi t-medium t-white bg-black w-max pd-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.text_cta),1)]),_:1},8,["to"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",p,[e.createElementVNode("div",{style:e.normalizeStyle(`width: ${l.value}%`),class:"h-100 bg-second mn-b-thin radius-big"},null,4)])])}}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d={class:"w-100 radius-big pd-medium bg-second t-black"},m={class:"mn-b-thin flex-v-center flex-nowrap flex"},g={class:"mn-l-thin uppercase radius-big t-semi t-medium t-white bg-black w-max pd-thin"},p={class:"w-100 h-2r pos-relative pd-nano bg-black radius-big"},h={__name:"Completion",props:{user:Object,target:Object,cta:Boolean,percentage:Number,text:String,text_cta:String},setup(r){const{user:b,cta:f,target:l}=r,u=o=>{let a=0,i=0;function s(t){for(let n in t)t.hasOwnProperty(n)&&(t[n]&&typeof t[n]=="object"&&!Array.isArray(t[n])?s(t[n]):(a++,t[n]!=null&&t[n]!==""&&i++))}return s(o),a===0?0:Math.round(i/a*100)},c=e.computed(()=>l?u(l):0);return(o,a)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",d,[e.createElementVNode("div",m,[e.createElementVNode("h3",null,e.toDisplayString(r.text),1),e.createElementVNode("h4",g,e.toDisplayString(r.percentage||c.value)+"% ",1),r.cta?(e.openBlock(),e.createBlock(i,{key:0,to:{name:"User Edit Profile",params:{_id:r.user}},class:"mn-l-auto uppercase radius-big t-semi t-medium t-white bg-black w-max pd-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.text_cta),1)]),_:1},8,["to"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",p,[e.createElementVNode("div",{style:e.normalizeStyle(`width: ${c.value}%`),class:"h-100 bg-second mn-b-thin radius-big"},null,4)])])}}};exports.default=h;
@@ -1,5 +1,5 @@
1
- import { ref as h, resolveComponent as p, openBlock as d, createElementBlock as g, createElementVNode as n, toDisplayString as l, createBlock as f, withCtx as b, createTextVNode as x, createCommentVNode as k, normalizeStyle as _ } from "vue";
2
- const w = { class: "w-100 radius-big pd-medium bg-second t-black" }, v = { class: "mn-b-thin flex-v-center flex-nowrap flex" }, y = { class: "mn-l-thin uppercase radius-big t-semi t-medium t-white bg-black w-max pd-thin" }, C = { class: "w-100 h-2r pos-relative pd-nano bg-black radius-big" }, S = {
1
+ import { computed as h, resolveComponent as p, openBlock as d, createElementBlock as g, createElementVNode as a, toDisplayString as c, createBlock as f, withCtx as b, createTextVNode as x, createCommentVNode as k, normalizeStyle as _ } from "vue";
2
+ const w = { class: "w-100 radius-big pd-medium bg-second t-black" }, y = { class: "mn-b-thin flex-v-center flex-nowrap flex" }, v = { class: "mn-l-thin uppercase radius-big t-semi t-medium t-white bg-black w-max pd-thin" }, C = { class: "w-100 h-2r pos-relative pd-nano bg-black radius-big" }, S = {
3
3
  __name: "Completion",
4
4
  props: {
5
5
  user: Object,
@@ -9,38 +9,38 @@ const w = { class: "w-100 radius-big pd-medium bg-second t-black" }, v = { class
9
9
  text: String,
10
10
  text_cta: String
11
11
  },
12
- setup(a) {
13
- const { user: P, cta: B, target: s } = a, c = h(0), m = (o) => {
14
- let i = 0, r = 0;
12
+ setup(n) {
13
+ const { user: P, cta: B, target: l } = n, m = (o) => {
14
+ let r = 0, i = 0;
15
15
  function u(e) {
16
16
  for (let t in e)
17
- e.hasOwnProperty(t) && (e[t] && typeof e[t] == "object" && !Array.isArray(e[t]) ? u(e[t]) : (i++, e[t] != null && e[t] !== "" && r++));
17
+ e.hasOwnProperty(t) && (e[t] && typeof e[t] == "object" && !Array.isArray(e[t]) ? u(e[t]) : (r++, e[t] != null && e[t] !== "" && i++));
18
18
  }
19
- return u(o), i === 0 ? 0 : Math.round(r / i * 100);
20
- };
21
- return s && (c.value = m(s)), (o, i) => {
22
- const r = p("router-link");
19
+ return u(o), r === 0 ? 0 : Math.round(i / r * 100);
20
+ }, s = h(() => l ? m(l) : 0);
21
+ return (o, r) => {
22
+ const i = p("router-link");
23
23
  return d(), g("section", w, [
24
- n("div", v, [
25
- n("h3", null, l(a.text), 1),
26
- n("h4", y, l(a.percentage || c.value) + "% ", 1),
27
- a.cta ? (d(), f(r, {
24
+ a("div", y, [
25
+ a("h3", null, c(n.text), 1),
26
+ a("h4", v, c(n.percentage || s.value) + "% ", 1),
27
+ n.cta ? (d(), f(i, {
28
28
  key: 0,
29
29
  to: {
30
30
  name: "User Edit Profile",
31
- params: { _id: a.user }
31
+ params: { _id: n.user }
32
32
  },
33
33
  class: "mn-l-auto uppercase radius-big t-semi t-medium t-white bg-black w-max pd-thin"
34
34
  }, {
35
35
  default: b(() => [
36
- x(l(a.text_cta), 1)
36
+ x(c(n.text_cta), 1)
37
37
  ]),
38
38
  _: 1
39
39
  }, 8, ["to"])) : k("", !0)
40
40
  ]),
41
- n("div", C, [
42
- n("div", {
43
- style: _(`width: ${c.value}%`),
41
+ a("div", C, [
42
+ a("div", {
43
+ style: _(`width: ${s.value}%`),
44
44
  class: "h-100 bg-second mn-b-thin radius-big"
45
45
  }, null, 4)
46
46
  ])
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../Field/Field.vue.cjs"),k=require("../../modules/icons/navigation/IconArrow.vue.cjs"),B=require("vue-i18n"),S={class:"pd-thin radius-extra flex-nowrap flex"},F={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["Lowest THC, please!","Something with banana flavors?","I'm in the mood for trippy vibes."],ru:["Я хочу самый низкий THC","Я хочу чего-нибудь бананового","Я хочу курнуть хейза"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(s,{emit:y}){const t=s,{t:N,locale:c}=B.useI18n();let r=e.ref(0),a=e.ref(t.input),p=e.ref(t.placeholder),i=e.ref(t.enableTyping),d=e.ref(null),f=e.ref(""),o=e.ref(!0),v=null;const m=y;function b(){m("action")}function T(n){m("update:input",n),f.value=n}function g(){r.value=(r.value+1)%t.placeholderTexts[c.value].length}function I(){i.value=!1,clearInterval(d.value),p.value=t.placeholder,f.value||(a.value="")}function x(){!f.value&&t.enableTyping&&(i.value=!0,p.value="",h())}function h(){let n=t.placeholderTexts[c.value][r.value],l=0,u=!1;v=setInterval(()=>{o.value=!o.value},200),d.value=setInterval(()=>{i.value&&(u?(a.value=a.value.slice(0,-1),a.value=n.substring(0,l)+(o.value&&l%2?"|":""),l--):(a.value=n.substring(0,l)+(o.value&&l%2?"|":""),l++),l>n.length&&t.loopTyping&&setTimeout(()=>{u=!0,a.value=n.substring(0,l)},333),l===0&&u&&(u=!1,g(),n=t.placeholderTexts[c.value][r.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&h()}),e.watchEffect(()=>{i.value||(clearInterval(d.value),clearInterval(v))}),(n,l)=>(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(w.default,{field:e.unref(a),"onUpdate:field":[l[0]||(l[0]=u=>e.isRef(a)?a.value=u:a=u),T],placeholder:e.unref(i)?" ":e.unref(p),onInput:g,onFocus:I,onBlur:x,class:"w-100 p-medium t-regular uppercase pd-small"},null,8,["field","placeholder"]),s.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,class:"t-nowrap t-medium radius-big uppercase cursor-pointer flex flex-v-center pd-r-small pd-l-small w-max hover-bg-fifth t-semi transition-linear transition-timing-1 t-black bg-main"},[e.createElementVNode("span",null,e.toDisplayString(s.action),1),e.createVNode(k.default,{class:"mn-l-thin radius-extra bg-white i-medium"})])):e.createCommentVNode("",!0)]))}};exports.default=F;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../Field/Field.vue2.cjs"),k=require("../../modules/icons/navigation/IconArrow.vue.cjs"),B=require("vue-i18n"),S={class:"pd-thin radius-extra flex-nowrap flex"},F={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["Lowest THC, please!","Something with banana flavors?","I'm in the mood for trippy vibes."],ru:["Я хочу самый низкий THC","Я хочу чего-нибудь бананового","Я хочу курнуть хейза"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(s,{emit:y}){const t=s,{t:N,locale:c}=B.useI18n();let r=e.ref(0),a=e.ref(t.input),p=e.ref(t.placeholder),i=e.ref(t.enableTyping),d=e.ref(null),f=e.ref(""),o=e.ref(!0),v=null;const m=y;function b(){m("action")}function T(n){m("update:input",n),f.value=n}function g(){r.value=(r.value+1)%t.placeholderTexts[c.value].length}function I(){i.value=!1,clearInterval(d.value),p.value=t.placeholder,f.value||(a.value="")}function x(){!f.value&&t.enableTyping&&(i.value=!0,p.value="",h())}function h(){let n=t.placeholderTexts[c.value][r.value],l=0,u=!1;v=setInterval(()=>{o.value=!o.value},200),d.value=setInterval(()=>{i.value&&(u?(a.value=a.value.slice(0,-1),a.value=n.substring(0,l)+(o.value&&l%2?"|":""),l--):(a.value=n.substring(0,l)+(o.value&&l%2?"|":""),l++),l>n.length&&t.loopTyping&&setTimeout(()=>{u=!0,a.value=n.substring(0,l)},333),l===0&&u&&(u=!1,g(),n=t.placeholderTexts[c.value][r.value]))},t.typingSpeed)}return e.onMounted(()=>{t.enableTyping&&h()}),e.watchEffect(()=>{i.value||(clearInterval(d.value),clearInterval(v))}),(n,l)=>(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(w.default,{field:e.unref(a),"onUpdate:field":[l[0]||(l[0]=u=>e.isRef(a)?a.value=u:a=u),T],placeholder:e.unref(i)?" ":e.unref(p),onInput:g,onFocus:I,onBlur:x,class:"w-100 p-medium t-regular uppercase pd-small"},null,8,["field","placeholder"]),s.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:b,class:"t-nowrap t-medium radius-big uppercase cursor-pointer flex flex-v-center pd-r-small pd-l-small w-max hover-bg-fifth t-semi transition-linear transition-timing-1 t-black bg-main"},[e.createElementVNode("span",null,e.toDisplayString(s.action),1),e.createVNode(k.default,{class:"mn-l-thin radius-extra bg-white i-medium"})])):e.createCommentVNode("",!0)]))}};exports.default=F;
@@ -1,5 +1,5 @@
1
1
  import { ref as i, onMounted as _, watchEffect as C, openBlock as b, createElementBlock as x, createVNode as T, unref as v, isRef as F, createElementVNode as N, toDisplayString as V, createCommentVNode as E } from "vue";
2
- import A from "../Field/Field.vue.js";
2
+ import A from "../Field/Field.vue2.js";
3
3
  import H from "../../modules/icons/navigation/IconArrow.vue.js";
4
4
  import { useI18n as j } from "vue-i18n";
5
5
  const D = { class: "pd-thin radius-extra flex-nowrap flex" }, U = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */;/* empty css */require("vue-i18n");;/* empty css */const r=require("vue-router");require("../../store/auth.cjs");require("../../../middlewares/client/inputs.validation.cjs");const n={class:"cols-2-1_2 gap-small pd-small bg-white"},u=e.createElementVNode("section",{class:"w-100 desktop-only o-hidden radius-big bg-grad-main"},null,-1),s={__name:"Auth",setup(a){return e.ref(null),e.ref(null),e.ref(null),r.useRoute(),r.useRouter(),e.ref("email"),(o,c)=>{const t=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",n,[e.createVNode(t,{class:"pd-medium br-solid br-1px br-grey-transp-25 radius-big w-m-66r t-center"},{default:e.withCtx(({Component:l,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l),{ref:"page",key:i.path,localPosition:o.localPosition},null,8,["localPosition"]))]),_:2},1024)]),_:1}),u])}}};exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */;/* empty css */;/* empty css */;/* empty css */require("vue-i18n");;/* empty css */const r=require("vue-router");require("../../store/auth.cjs");require("../../../middlewares/client/inputs.validation.cjs");const n={class:"cols-2-1_2 gap-small pd-small bg-white"},u=e.createElementVNode("section",{class:"w-100 desktop-only o-hidden radius-big bg-grad-main"},null,-1),s={__name:"Auth",setup(a){return e.ref(null),e.ref(null),e.ref(null),r.useRoute(),r.useRouter(),e.ref("email"),(o,c)=>{const t=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",n,[e.createVNode(t,{class:"pd-medium br-solid br-1px br-grey-transp-25 radius-big w-m-66r t-center"},{default:e.withCtx(({Component:l,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l),{ref:"page",key:i.path,localPosition:o.localPosition},null,8,["localPosition"]))]),_:2},1024)]),_:1}),u])}}};exports.default=s;
@@ -1,8 +1,8 @@
1
1
  import { ref as e, resolveComponent as a, openBlock as o, createElementBlock as m, createVNode as t, withCtx as r, Transition as c, createBlock as p, resolveDynamicComponent as u, createElementVNode as d } from "vue";
2
2
  /* empty css */
3
- /* empty css */
3
+ /* empty css */
4
+ /* empty css */
4
5
  /* empty css */
5
- /* empty css */
6
6
  import "vue-i18n";
7
7
  /* empty css */
8
8
  import { useRoute as _, useRouter as f } from "vue-router";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue");;/* empty css */const f=require("vue-router"),w=require("vue-i18n"),E=require("../../store/auth.cjs"),p=require("../../store/twofa.cjs"),c=require("../../../globals/store/globals.cjs"),S=require("../../localization/EnterCode.json.cjs"),q={class:"t-center pd-medium"},D={class:"mn-b-medium"},I={class:"mn-b-big t-transp"},k={class:"w-100 mn-b-big flex-nowrap flex"},C={key:1},N={__name:"EnterCode",setup(V){const g=f.useRoute(),v=f.useRouter(),{t:d}=w.useI18n({useScope:"global",...S.default}),o=n.reactive({digits:["","","",""],error:null});n.watch(()=>o.digits[0],s=>{if(s&&String(s).length>1){let e=String(s).split("");console.log(e);let t=[...o.digits];e.forEach((l,r)=>{console.log(r),console.log(t[r]),console.log(l),t[r]=l}),o.digits=t,u(3)}});const m=n.ref(null),i=n.ref(0);async function y(){try{await p.sendCode(E.state.user,g.query.method,g.query.type),i.value=30;const s=setInterval(()=>{i.value>0?i.value-=1:clearInterval(s)},1e3)}catch{c.setError({response:{data:{errorCode:"CODE_NOT_SENT"}}})}}const a=(s,e)=>{if(s.key==="Backspace"&&(o.digits[e]===null||o.digits[e]===void 0||o.digits[e]==="")){s.preventDefault();const t=document.querySelectorAll("input"),l=e>0?t[e-1]:null;l&&(l.focus(),l.setSelectionRange(l.value.length,l.value.length))}},u=s=>{const e=document.querySelectorAll("input"),t=e[s+1],l=s>0?e[s-1]:null;if(o.digits[s]!==""&&o.digits[s]!==null&&o.digits[s]!==void 0&&s<4&&(s<3?t.focus():m.value.focus()),(o.digits[s]===null||o.digits[s]===void 0||o.digits[s]==="")&&s>0&&l.focus(),o.digits.every(r=>r!=="")){const r=o.digits.join(""),b=p.state.code.code.toString();r===b?(p.state.code.isValid=!0,v.push({path:"/auth/enter-password",query:{type:p.state.code.type,method:g.query.method}})):(c.setError({response:{data:{errorCode:"WRONG_CODE"}}}),m.value.focus(),o.digits=["","","",""])}};return(s,e)=>(n.openBlock(),n.createElementBlock("section",q,[n.createElementVNode("h3",D,n.toDisplayString(n.unref(d)("verifyNumberTitle")),1),n.createElementVNode("p",I,n.toDisplayString(n.unref(d)("instructions")),1),n.createElementVNode("div",k,[n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[0]||(e[0]=t=>o.digits[0]=t),ref_key:"firstInput",ref:m,maxlength:"1",onInput:e[1]||(e[1]=t=>u(0)),onPaste:e[2]||(e[2]=t=>s.onPaste(t,0)),onKeydown:e[3]||(e[3]=t=>a(t,0)),class:"w-100 h1 pd-small t-center bg-light radius-small mn-r-small"},null,544),[[n.vModelText,o.digits[0]]]),n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[4]||(e[4]=t=>o.digits[1]=t),maxlength:"1",onInput:e[5]||(e[5]=t=>u(1)),onPaste:e[6]||(e[6]=t=>s.onPaste(t,1)),onKeydown:e[7]||(e[7]=t=>a(t,1)),class:"w-100 h1 pd-small t-center bg-light radius-small mn-r-small"},null,544),[[n.vModelText,o.digits[1]]]),n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[8]||(e[8]=t=>o.digits[2]=t),maxlength:"1",onInput:e[9]||(e[9]=t=>u(2)),onPaste:e[10]||(e[10]=t=>s.onPaste(t,2)),onKeydown:e[11]||(e[11]=t=>a(t,2)),class:"w-100 h1 pd-small t-center bg-light radius-small mn-r-small"},null,544),[[n.vModelText,o.digits[2]]]),n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[12]||(e[12]=t=>o.digits[3]=t),maxlength:"1",onInput:e[13]||(e[13]=t=>u(3)),onPaste:e[14]||(e[14]=t=>s.onPaste(t,3)),onKeydown:e[15]||(e[15]=t=>a(t,3)),class:"w-100 h1 pd-small t-center bg-light radius-small"},null,544),[[n.vModelText,o.digits[3]]])]),i.value<1?(n.openBlock(),n.createElementBlock("a",{key:0,onClick:y,class:"t-blue"},n.toDisplayString(n.unref(d)("resendCode")),1)):(n.openBlock(),n.createElementBlock("span",C,n.toDisplayString(i.value)+" "+n.toDisplayString(n.unref(d)("secondsResend")),1))]))}};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue");;/* empty css */const f=require("vue-router"),w=require("vue-i18n"),E=require("../../store/auth.cjs"),p=require("../../store/twofa.cjs"),c=require("../../../globals/store/globals.cjs"),S=require("../../localization/EnterCode.json.cjs"),q={class:"t-center pd-medium"},D={class:"mn-b-medium"},I={class:"mn-b-big t-transp"},k={class:"w-100 mn-b-big flex-nowrap flex"},C={key:1},N={__name:"EnterCode",setup(V){const g=f.useRoute(),v=f.useRouter(),{t:d}=w.useI18n({useScope:"global",...S.default}),o=n.reactive({digits:["","","",""],error:null});n.watch(()=>o.digits[0],s=>{if(s&&String(s).length>1){let e=String(s).split("");console.log(e);let t=[...o.digits];e.forEach((l,r)=>{console.log(r),console.log(t[r]),console.log(l),t[r]=l}),o.digits=t,u(3)}});const m=n.ref(null),i=n.ref(0);async function y(){try{await p.sendCode(E.state.user,g.query.method,g.query.type),i.value=30;const s=setInterval(()=>{i.value>0?i.value-=1:clearInterval(s)},1e3)}catch{c.setError({response:{data:{errorCode:"CODE_NOT_SENT"}}})}}const a=(s,e)=>{if(s.key==="Backspace"&&(o.digits[e]===null||o.digits[e]===void 0||o.digits[e]==="")){s.preventDefault();const t=document.querySelectorAll("input"),l=e>0?t[e-1]:null;l&&(l.focus(),l.setSelectionRange(l.value.length,l.value.length))}},u=s=>{const e=document.querySelectorAll("input"),t=e[s+1],l=s>0?e[s-1]:null;if(o.digits[s]!==""&&o.digits[s]!==null&&o.digits[s]!==void 0&&s<4&&(s<3?t.focus():m.value.focus()),(o.digits[s]===null||o.digits[s]===void 0||o.digits[s]==="")&&s>0&&l.focus(),o.digits.every(r=>r!=="")){const r=o.digits.join(""),b=p.state.code.code.toString();r===b?(p.state.code.isValid=!0,v.push({path:"/auth/enter-password",query:{type:p.state.code.type,method:g.query.method}})):(c.setError({response:{data:{errorCode:"WRONG_CODE"}}}),m.value.focus(),o.digits=["","","",""])}};return(s,e)=>(n.openBlock(),n.createElementBlock("section",q,[n.createElementVNode("h3",D,n.toDisplayString(n.unref(d)("verifyNumberTitle")),1),n.createElementVNode("p",I,n.toDisplayString(n.unref(d)("instructions")),1),n.createElementVNode("div",k,[n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[0]||(e[0]=t=>o.digits[0]=t),ref_key:"firstInput",ref:m,maxlength:"1",onInput:e[1]||(e[1]=t=>u(0)),onPaste:e[2]||(e[2]=t=>s.onPaste(t,0)),onKeydown:e[3]||(e[3]=t=>a(t,0)),class:"w-100 h1 pd-small t-center bg-light radius-small mn-r-small"},null,544),[[n.vModelText,o.digits[0]]]),n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[4]||(e[4]=t=>o.digits[1]=t),maxlength:"1",onInput:e[5]||(e[5]=t=>u(1)),onPaste:e[6]||(e[6]=t=>s.onPaste(t,1)),onKeydown:e[7]||(e[7]=t=>a(t,1)),class:"w-100 h1 pd-small t-center bg-light radius-small mn-r-small"},null,544),[[n.vModelText,o.digits[1]]]),n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[8]||(e[8]=t=>o.digits[2]=t),maxlength:"1",onInput:e[9]||(e[9]=t=>u(2)),onPaste:e[10]||(e[10]=t=>s.onPaste(t,2)),onKeydown:e[11]||(e[11]=t=>a(t,2)),class:"w-100 h1 pd-small t-center bg-light radius-small mn-r-small"},null,544),[[n.vModelText,o.digits[2]]]),n.withDirectives(n.createElementVNode("input",{type:"number","onUpdate:modelValue":e[12]||(e[12]=t=>o.digits[3]=t),maxlength:"1",onInput:e[13]||(e[13]=t=>u(3)),onPaste:e[14]||(e[14]=t=>s.onPaste(t,3)),onKeydown:e[15]||(e[15]=t=>a(t,3)),class:"w-100 h1 pd-small t-center bg-light radius-small"},null,544),[[n.vModelText,o.digits[3]]])]),i.value<1?(n.openBlock(),n.createElementBlock("a",{key:0,onClick:y,class:"t-blue"},n.toDisplayString(n.unref(d)("resendCode")),1)):(n.openBlock(),n.createElementBlock("span",C,n.toDisplayString(i.value)+" "+n.toDisplayString(n.unref(d)("secondsResend")),1))]))}};exports.default=N;
@@ -1,5 +1,5 @@
1
1
  import { reactive as P, watch as D, ref as c, openBlock as b, createElementBlock as w, createElementVNode as r, toDisplayString as d, unref as m, withDirectives as g, vModelText as f } from "vue";
2
- /* empty css */
2
+ /* empty css */
3
3
  import { useRoute as q, useRouter as $ } from "vue-router";
4
4
  import { useI18n as K } from "vue-i18n";
5
5
  import { state as N } from "../../store/auth.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */const l=require("../../../../components/Field/Field.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),i=require("vue-router"),h=require("vue-i18n"),t=require("../../store/auth.cjs"),d=require("../../../middlewares/client/inputs.validation.cjs"),w=require("../../localization/EnterPassword.json.cjs");;/* empty css */const _={class:"t-left pd-medium"},y={class:"mn-b-small"},g={key:0,class:"mn-b-semi t-transp"},b={key:1,class:"mn-b-semi t-transp"},k={class:"mn-b-semi radius-small o-hidden"},q={key:2,class:"p-medium t-semi mn-b-semi"},B=e.createElementVNode("a",{class:"t-second",href:"/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),E={key:0},P={key:1},v={__name:"EnterPassword",setup(S){const n=e.ref(null),{t:s}=h.useI18n({useScope:"global",...w.default}),r=i.useRoute(),u=i.useRouter();e.ref("phone");async function c(){try{await d.validateInputs(n,d.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}r.query.method==="reset-password"&&await t.actions.updatePassword(t.state.user,r.query.type),r.query.method!=="reset-password"&&await t.actions.signup(t.state.user,r.query.type)}function p(){u.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(m,o)=>(e.openBlock(),e.createElementBlock("section",_,[e.createElementVNode("h3",y,e.toDisplayString(e.unref(s)("almostDone")),1),e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(e.unref(s)("newPasswordPrompt")),1)):(e.openBlock(),e.createElementBlock("p",b,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",k,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":o[0]||(o[0]=a=>t.state.user.password=a),type:"password",validation:n.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-light pd-small radius-small mn-b-thin"},null,8,["field","validation","placeholder"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":o[1]||(o[1]=a=>t.state.user.passwordRepeat=a),type:"password",placeholder:e.unref(s)("repeatPasswordPlaceholder"),class:"bg-light pd-small radius-small mn-b-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",q,[e.createTextVNode(" By registering, you agree to our "),B])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:c,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),i=require("vue-router"),h=require("vue-i18n"),t=require("../../store/auth.cjs"),d=require("../../../middlewares/client/inputs.validation.cjs"),w=require("../../localization/EnterPassword.json.cjs");;/* empty css */const _={class:"t-left pd-medium"},y={class:"mn-b-small"},g={key:0,class:"mn-b-semi t-transp"},b={key:1,class:"mn-b-semi t-transp"},k={class:"mn-b-semi radius-small o-hidden"},q={key:2,class:"p-medium t-semi mn-b-semi"},B=e.createElementVNode("a",{class:"t-second",href:"/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),E={key:0},P={key:1},v={__name:"EnterPassword",setup(S){const n=e.ref(null),{t:s}=h.useI18n({useScope:"global",...w.default}),r=i.useRoute(),u=i.useRouter();e.ref("phone");async function c(){try{await d.validateInputs(n,d.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}r.query.method==="reset-password"&&await t.actions.updatePassword(t.state.user,r.query.type),r.query.method!=="reset-password"&&await t.actions.signup(t.state.user,r.query.type)}function p(){u.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(m,o)=>(e.openBlock(),e.createElementBlock("section",_,[e.createElementVNode("h3",y,e.toDisplayString(e.unref(s)("almostDone")),1),e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(e.unref(s)("newPasswordPrompt")),1)):(e.openBlock(),e.createElementBlock("p",b,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",k,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":o[0]||(o[0]=a=>t.state.user.password=a),type:"password",validation:n.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-light pd-small radius-small mn-b-thin"},null,8,["field","validation","placeholder"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":o[1]||(o[1]=a=>t.state.user.passwordRepeat=a),type:"password",placeholder:e.unref(s)("repeatPasswordPlaceholder"),class:"bg-light pd-small radius-small mn-b-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",q,[e.createTextVNode(" By registering, you agree to our "),B])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:c,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};exports.default=v;
@@ -1,7 +1,7 @@
1
1
  import { ref as u, openBlock as o, createElementBlock as a, createElementVNode as m, toDisplayString as i, unref as e, createVNode as l, createTextVNode as g, createCommentVNode as b, withCtx as P } from "vue";
2
2
  /* empty css */
3
- import c from "../../../../components/Field/Field.vue.js";
4
- import k from "../../../../components/Button/Button.vue.js";
3
+ import c from "../../../../components/Field/Field.vue2.js";
4
+ import k from "../../../../components/Button/Button.vue2.js";
5
5
  import { useRoute as q, useRouter as v } from "vue-router";
6
6
  import { useI18n as E } from "vue-i18n";
7
7
  import { state as s, actions as h } from "../../store/auth.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */const d=require("../../../../components/Field/Field.vue.cjs"),h=require("../../../../components/Button/Button.vue.cjs"),u=require("vue-router"),t=require("../../store/auth.cjs"),w=require("../../../organizations/store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const f={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-b-small"},"You have been invited to the organization",-1),b=e.createElementVNode("p",{class:"mn-b-semi t-transp"},"Please provide a password to complete the registration.",-1),q={class:"mn-b-semi radius-small o-hidden"},y=e.createElementVNode("span",null,"Join",-1),g={__name:"Invite",async setup(V){let i,n;const l=e.ref(null),a=u.useRoute(),p=u.useRouter();[i,n]=e.withAsyncContext(()=>w.actions.readOne(a.query.inviteCode)),await i,n();async function m(){try{await c.validateInputs(l,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}try{await t.actions.signup(t.state.user,a.query.type,a.query.inviteCode)}catch(r){console.log(r)}}function _(){p.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(r,s)=>(e.openBlock(),e.createElementBlock("section",f,[v,b,e.createElementVNode("div",q,[e.createVNode(d.default,{field:t.state.user.password,"onUpdate:field":s[0]||(s[0]=o=>t.state.user.password=o),type:"password",validation:l.value,label:"Password",placeholder:"******",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field","validation"]),e.createVNode(d.default,{field:t.state.user.passwordRepeat,"onUpdate:field":s[1]||(s[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Repeat Password",placeholder:"******",class:"bg-light pd-medium radius-small"},null,8,["field"])]),e.createVNode(h.default,{submit:m,callback:_,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[y]),_:1})]))}};exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");;/* empty css */const n=require("../../../../components/Field/Field.vue2.cjs"),m=require("../../../../components/Button/Button.vue2.cjs"),l=require("vue-router"),t=require("../../store/auth.cjs"),_=require("../../../organizations/store/invites.cjs"),d=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const f={class:"t-left pd-medium"},h=e.createElementVNode("h3",{class:"mn-b-small"},"You have been invited to the organization",-1),w=e.createElementVNode("p",{class:"mn-b-semi t-transp"},"Please provide a password to complete the registration.",-1),v={class:"mn-b-semi radius-small o-hidden"},b=e.createElementVNode("span",null,"Join",-1),q={__name:"Invite",setup(g){const i=e.ref(null),a=l.useRoute(),u=l.useRouter();e.onMounted(async()=>{await _.actions.readOne(a.query.inviteCode)});async function c(){try{await d.validateInputs(i,d.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}try{await t.actions.signup(t.state.user,a.query.type,a.query.inviteCode)}catch(r){console.log(r)}}function p(){u.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(r,s)=>(e.openBlock(),e.createElementBlock("section",f,[h,w,e.createElementVNode("div",v,[e.createVNode(n.default,{field:t.state.user.password,"onUpdate:field":s[0]||(s[0]=o=>t.state.user.password=o),type:"password",validation:i.value,label:"Password",placeholder:"******",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field","validation"]),e.createVNode(n.default,{field:t.state.user.passwordRepeat,"onUpdate:field":s[1]||(s[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Repeat Password",placeholder:"******",class:"bg-light pd-medium radius-small"},null,8,["field"])]),e.createVNode(m.default,{submit:c,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[b]),_:1})]))}};exports.default=q;
@@ -1,23 +1,24 @@
1
- import { ref as _, withAsyncContext as f, openBlock as w, createElementBlock as h, createElementVNode as s, createVNode as i, withCtx as b } from "vue";
1
+ import { ref as u, onMounted as c, openBlock as f, createElementBlock as _, createElementVNode as s, createVNode as i, withCtx as w } from "vue";
2
2
  /* empty css */
3
- import m from "../../../../components/Field/Field.vue.js";
4
- import v from "../../../../components/Button/Button.vue.js";
5
- import { useRoute as y, useRouter as g } from "vue-router";
6
- import { state as e, actions as P } from "../../store/auth.js";
7
- import { actions as R } from "../../../organizations/store/invites.js";
8
- import { validateInputs as q, validatePassword as x } from "../../../middlewares/client/inputs.validation.js";
3
+ import l from "../../../../components/Field/Field.vue2.js";
4
+ import h from "../../../../components/Button/Button.vue2.js";
5
+ import { useRoute as b, useRouter as v } from "vue-router";
6
+ import { state as e, actions as y } from "../../store/auth.js";
7
+ import { actions as g } from "../../../organizations/store/invites.js";
8
+ import { validateInputs as P, validatePassword as R } from "../../../middlewares/client/inputs.validation.js";
9
9
  /* empty css */
10
- const C = { class: "t-left pd-medium" }, k = /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "You have been invited to the organization", -1), E = /* @__PURE__ */ s("p", { class: "mn-b-semi t-transp" }, "Please provide a password to complete the registration.", -1), U = { class: "mn-b-semi radius-small o-hidden" }, V = /* @__PURE__ */ s("span", null, "Join", -1), Y = {
10
+ const q = { class: "t-left pd-medium" }, k = /* @__PURE__ */ s("h3", { class: "mn-b-small" }, "You have been invited to the organization", -1), x = /* @__PURE__ */ s("p", { class: "mn-b-semi t-transp" }, "Please provide a password to complete the registration.", -1), C = { class: "mn-b-semi radius-small o-hidden" }, E = /* @__PURE__ */ s("span", null, "Join", -1), O = {
11
11
  __name: "Invite",
12
- async setup($) {
13
- let n, l;
14
- const d = _(null), o = y(), p = g();
15
- [n, l] = f(() => R.readOne(o.query.inviteCode)), await n, l();
16
- async function u() {
12
+ setup(U) {
13
+ const n = u(null), o = b(), d = v();
14
+ c(async () => {
15
+ await g.readOne(o.query.inviteCode);
16
+ });
17
+ async function m() {
17
18
  try {
18
- await q(
19
- d,
20
- x,
19
+ await P(
20
+ n,
21
+ R,
21
22
  e.user.password,
22
23
  "Некорректный пароль"
23
24
  );
@@ -25,13 +26,13 @@ const C = { class: "t-left pd-medium" }, k = /* @__PURE__ */ s("h3", { class: "m
25
26
  throw new Error();
26
27
  }
27
28
  try {
28
- await P.signup(e.user, o.query.type, o.query.inviteCode);
29
+ await y.signup(e.user, o.query.type, o.query.inviteCode);
29
30
  } catch (a) {
30
31
  console.log(a);
31
32
  }
32
33
  }
33
- function c() {
34
- p.push({
34
+ function p() {
35
+ d.push({
35
36
  name: "User Profile",
36
37
  params: {
37
38
  _id: e.user._id
@@ -41,20 +42,20 @@ const C = { class: "t-left pd-medium" }, k = /* @__PURE__ */ s("h3", { class: "m
41
42
  }
42
43
  });
43
44
  }
44
- return (a, t) => (w(), h("section", C, [
45
+ return (a, t) => (f(), _("section", q, [
45
46
  k,
46
- E,
47
- s("div", U, [
48
- i(m, {
47
+ x,
48
+ s("div", C, [
49
+ i(l, {
49
50
  field: e.user.password,
50
51
  "onUpdate:field": t[0] || (t[0] = (r) => e.user.password = r),
51
52
  type: "password",
52
- validation: d.value,
53
+ validation: n.value,
53
54
  label: "Password",
54
55
  placeholder: "******",
55
56
  class: "mn-b-thin bg-light pd-medium radius-small"
56
57
  }, null, 8, ["field", "validation"]),
57
- i(m, {
58
+ i(l, {
58
59
  field: e.user.passwordRepeat,
59
60
  "onUpdate:field": t[1] || (t[1] = (r) => e.user.passwordRepeat = r),
60
61
  type: "password",
@@ -63,13 +64,13 @@ const C = { class: "t-left pd-medium" }, k = /* @__PURE__ */ s("h3", { class: "m
63
64
  class: "bg-light pd-medium radius-small"
64
65
  }, null, 8, ["field"])
65
66
  ]),
66
- i(v, {
67
- submit: u,
68
- callback: c,
67
+ i(h, {
68
+ submit: m,
69
+ callback: p,
69
70
  class: "w-100 bg-main mn-b-big"
70
71
  }, {
71
- default: b(() => [
72
- V
72
+ default: w(() => [
73
+ E
73
74
  ]),
74
75
  _: 1
75
76
  })
@@ -77,5 +78,5 @@ const C = { class: "t-left pd-medium" }, k = /* @__PURE__ */ s("h3", { class: "m
77
78
  }
78
79
  };
79
80
  export {
80
- Y as default
81
+ O as default
81
82
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue.cjs"),v=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),_=require("../../../../components/Button/Button.vue.cjs"),u=require("vue-router"),b=require("vue-i18n"),g=require("../../localization/ResetPassword.json.cjs"),s=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const w={class:"t-left pd-medium"},V={class:"mn-b-small"},N={class:"mn-b-small t-transp"},q={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},y={class:"pos-relative"},E={key:0,class:"mn-b-semi radius-small o-hidden"},C={class:"mn-b-small t-transp"},S={key:0,class:"mn-b-semi radius-small o-hidden"},k={class:"mn-b-small t-transp"},P={__name:"ResetPassword",setup(I){const{t}=b.useI18n({useScope:"global",...g.default}),i=e.ref(null),d=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await n.validateInputs(i,n.validatePhone,s.state.user.phone,"Некорректный телефон"),a.value==="email"&&await n.validateInputs(d,n.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}try{await s.actions.resetPassword(s.state.user,a.value,"reset-password")}catch(r){throw console.log(r),new Error}}function p(){c.push({name:"Enter Code",query:{type:a.value,method:"reset-password"}})}return(r,o)=>(e.openBlock(),e.createElementBlock("section",w,[e.createElementVNode("h3",V,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",N,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",q,[e.createVNode(h.default,{selected:a.value,"onUpdate:selected":o[0]||(o[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",y,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(v.default,{onChange:o[1]||(o[1]=l=>s.state.user.phone=l),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("emailInfo")),1),e.createVNode(f.default,{field:s.state.user.email,"onUpdate:field":o[2]||(o[2]=l=>s.state.user.email=l),placeholder:e.unref(t)("emailPlaceholder"),validation:d.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(_.default,{submit:m,callback:p,class:"mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};exports.default=P;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),v=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),u=require("vue-router"),b=require("vue-i18n"),g=require("../../localization/ResetPassword.json.cjs"),s=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const w={class:"t-left pd-medium"},V={class:"mn-b-small"},N={class:"mn-b-small t-transp"},q={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},y={class:"pos-relative"},E={key:0,class:"mn-b-semi radius-small o-hidden"},C={class:"mn-b-small t-transp"},S={key:0,class:"mn-b-semi radius-small o-hidden"},k={class:"mn-b-small t-transp"},P={__name:"ResetPassword",setup(I){const{t}=b.useI18n({useScope:"global",...g.default}),i=e.ref(null),d=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await n.validateInputs(i,n.validatePhone,s.state.user.phone,"Некорректный телефон"),a.value==="email"&&await n.validateInputs(d,n.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}try{await s.actions.resetPassword(s.state.user,a.value,"reset-password")}catch(r){throw console.log(r),new Error}}function p(){c.push({name:"Enter Code",query:{type:a.value,method:"reset-password"}})}return(r,o)=>(e.openBlock(),e.createElementBlock("section",w,[e.createElementVNode("h3",V,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",N,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",q,[e.createVNode(h.default,{selected:a.value,"onUpdate:selected":o[0]||(o[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",y,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(v.default,{onChange:o[1]||(o[1]=l=>s.state.user.phone=l),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("emailInfo")),1),e.createVNode(f.default,{field:s.state.user.email,"onUpdate:field":o[2]||(o[2]=l=>s.state.user.email=l),placeholder:e.unref(t)("emailPlaceholder"),validation:d.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(_.default,{submit:m,callback:p,class:"mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};exports.default=P;
@@ -1,8 +1,8 @@
1
1
  import { ref as d, openBlock as u, createElementBlock as p, createElementVNode as a, toDisplayString as r, unref as t, createVNode as l, Transition as _, withCtx as c, createCommentVNode as v, createTextVNode as C } from "vue";
2
2
  import E from "../../../../components/Tab/Tab.vue2.js";
3
- import I from "../../../../components/Field/Field.vue.js";
3
+ import I from "../../../../components/Field/Field.vue2.js";
4
4
  import P from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import V from "../../../../components/Button/Button.vue.js";
5
+ import V from "../../../../components/Button/Button.vue2.js";
6
6
  import { useRoute as k, useRouter as x } from "vue-router";
7
7
  import { useI18n as N } from "vue-i18n";
8
8
  import S from "../../localization/ResetPassword.json.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Field/Field.vue.cjs"),w=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue.cjs"),h=require("vue-router"),N=require("vue-i18n"),y=require("../../localization/SignIn.json.cjs"),s=require("../../store/auth.cjs"),r=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const S={class:""},q=e.createElementVNode("img",{src:"/logo/logo.svg",class:"i-extra radius-small mn-b-small"},null,-1),E={class:"mn-b-medium"},x=e.createElementVNode("br",null,null,-1),C={class:"t-semi"},D={class:"mn-b-big"},P={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},T={class:"pos-relative"},I={class:"mn-b-thin radius-small"},U={class:"mn-b-thin radius-small o-hidden"},k={class:"w-100 mn-b-big"},O={__name:"SignIn",setup(j){const d=e.ref(null),f=e.ref(null),u=e.ref(null),c=h.useRoute(),p=h.useRouter(),{t:l}=N.useI18n({useScope:"global",...y.default}),n=e.ref("phone"),v=o=>new Promise((a,i)=>{const t=document.createElement("script");t.type="text/javascript",t.src=o,t.onload=a,t.onerror=i,document.head.appendChild(t)});e.onMounted(async()=>{await v("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function _(){try{n.value==="phone"&&await r.validateInputs(d,r.validatePhone,s.state.user.phone,"Некорректный телефон"),n.value==="email"&&await r.validateInputs(u,r.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}const o={...s.state.user};await s.actions.login(o,n.value)}function g(){c.query.returnUrl?p.push({path:c.query.returnUrl,query:{afterAuth:"true"}}):p.push({name:"User Profile",params:{_id:s.state.user._id},query:{afterAuth:"true"}})}return(o,a)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",S,[q,e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(l)("title"))+" ",1),x,e.createElementVNode("span",C,e.toDisplayString(e.unref(l)("subtitle")),1)]),e.createElementVNode("p",D,[e.createVNode(i,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signup")),1)]),_:1})]),e.createElementVNode("div",P,[e.createVNode(b.default,{selected:n.value,"onUpdate:selected":a[0]||(a[0]=t=>n.value=t),tabs:[{name:e.unref(l)("phone"),value:"phone"},{name:e.unref(l)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",T,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(w.default,{onChange:a[1]||(a[1]=t=>s.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validCharactersOnly:!0,validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(l)("phonePlaceholder"),type:"tel"},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,n.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",U,[e.createVNode(m.default,{field:s.state.user.email,"onUpdate:field":a[2]||(a[2]=t=>s.state.user.email=t),placeholder:e.unref(l)("emailPlaceholder"),validation:u.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,n.value==="email"]])]),_:1})]),e.createVNode(m.default,{field:s.state.user.password,"onUpdate:field":a[3]||(a[3]=t=>s.state.user.password=t),type:"password",validation:f.value,placeholder:e.unref(l)("passwordPlaceholder"),class:"bg-light pd-medium radius-small mn-b-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",k,[e.createVNode(i,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("forgotPassword")),1)]),_:1})]),e.createVNode(V.default,{submit:_,callback:g,class:"w-100 bg-main mn-b-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signin")),1)]),_:1})])}}};exports.default=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Field/Field.vue2.cjs"),w=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue2.cjs"),h=require("vue-router"),N=require("vue-i18n"),y=require("../../localization/SignIn.json.cjs"),s=require("../../store/auth.cjs"),r=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const S={class:""},q=e.createElementVNode("img",{src:"/logo/logo.svg",class:"i-extra radius-small mn-b-small"},null,-1),E={class:"mn-b-medium"},x=e.createElementVNode("br",null,null,-1),C={class:"t-semi"},D={class:"mn-b-big"},P={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},T={class:"pos-relative"},I={class:"mn-b-thin radius-small"},U={class:"mn-b-thin radius-small o-hidden"},k={class:"w-100 mn-b-big"},O={__name:"SignIn",setup(j){const d=e.ref(null),f=e.ref(null),u=e.ref(null),c=h.useRoute(),p=h.useRouter(),{t:l}=N.useI18n({useScope:"global",...y.default}),n=e.ref("phone"),v=o=>new Promise((a,i)=>{const t=document.createElement("script");t.type="text/javascript",t.src=o,t.onload=a,t.onerror=i,document.head.appendChild(t)});e.onMounted(async()=>{await v("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function _(){try{n.value==="phone"&&await r.validateInputs(d,r.validatePhone,s.state.user.phone,"Некорректный телефон"),n.value==="email"&&await r.validateInputs(u,r.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}const o={...s.state.user};await s.actions.login(o,n.value)}function g(){c.query.returnUrl?p.push({path:c.query.returnUrl,query:{afterAuth:"true"}}):p.push({name:"User Profile",params:{_id:s.state.user._id},query:{afterAuth:"true"}})}return(o,a)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",S,[q,e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(l)("title"))+" ",1),x,e.createElementVNode("span",C,e.toDisplayString(e.unref(l)("subtitle")),1)]),e.createElementVNode("p",D,[e.createVNode(i,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signup")),1)]),_:1})]),e.createElementVNode("div",P,[e.createVNode(b.default,{selected:n.value,"onUpdate:selected":a[0]||(a[0]=t=>n.value=t),tabs:[{name:e.unref(l)("phone"),value:"phone"},{name:e.unref(l)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",T,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(w.default,{onChange:a[1]||(a[1]=t=>s.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validCharactersOnly:!0,validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(l)("phonePlaceholder"),type:"tel"},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,n.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",U,[e.createVNode(m.default,{field:s.state.user.email,"onUpdate:field":a[2]||(a[2]=t=>s.state.user.email=t),placeholder:e.unref(l)("emailPlaceholder"),validation:u.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,n.value==="email"]])]),_:1})]),e.createVNode(m.default,{field:s.state.user.password,"onUpdate:field":a[3]||(a[3]=t=>s.state.user.password=t),type:"password",validation:f.value,placeholder:e.unref(l)("passwordPlaceholder"),class:"bg-light pd-medium radius-small mn-b-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",k,[e.createVNode(i,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("forgotPassword")),1)]),_:1})]),e.createVNode(V.default,{submit:_,callback:g,class:"w-100 bg-main mn-b-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signin")),1)]),_:1})])}}};exports.default=O;
@@ -1,8 +1,8 @@
1
1
  import { ref as p, 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.vue.js";
3
+ import y from "../../../../components/Field/Field.vue2.js";
4
4
  import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import O from "../../../../components/Button/Button.vue.js";
5
+ import O from "../../../../components/Button/Button.vue2.js";
6
6
  import { useRoute as $, useRouter as j } from "vue-router";
7
7
  import { useI18n as A } from "vue-i18n";
8
8
  import N from "../../localization/SignIn.json.js";
@@ -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.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"),l=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const V={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-b-semi radius-small"},y={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}),s=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 i.validateInputs(s,i.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await i.validateInputs(r,i.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.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",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]=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",C,[e.createElementVNode("p",y,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{onChange:n[1]||(n[1]=o=>l.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:s.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light 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: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-light 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.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"),N=require("../../store/twofa.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");;/* empty css */const V={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-b-semi radius-small"},y={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}),s=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 i.validateInputs(s,i.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await i.validateInputs(r,i.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.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",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]=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",C,[e.createElementVNode("p",y,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{onChange:n[1]||(n[1]=o=>l.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:s.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light 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: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-light 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,8 +1,8 @@
1
1
  import { ref as d, resolveComponent as E, openBlock as S, createElementBlock as x, createElementVNode as o, toDisplayString as r, unref as t, createVNode as l, Transition as h, withCtx as m, withDirectives as _, vShow as f, createTextVNode as v } from "vue";
2
2
  import N from "../../../../components/Tab/Tab.vue2.js";
3
- import V from "../../../../components/Field/Field.vue.js";
3
+ import V from "../../../../components/Field/Field.vue2.js";
4
4
  import y from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import D from "../../../../components/Button/Button.vue.js";
5
+ import D from "../../../../components/Button/Button.vue2.js";
6
6
  import { useRoute as I, useRouter as $ } from "vue-router";
7
7
  import { useI18n as O } from "vue-i18n";
8
8
  import P from "../../localization/SignUp.json.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("axios"),d=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),g=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),w=require("vue"),c=require("../../globals/store/globals.cjs"),k=require("./twofa.cjs"),u=l.create({baseURL:process.env.API_URL,withCredentials:!0}),a=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1},accesses:[]});async function O(){try{const e=await m("user");if(e){const{_id:t,email:s,phone:n,roles:o,accessToken:r}=e;l.interceptors.request.use(i=>(i.headers["x-access-token"]=r,i),i=>Promise.reject(i));const h=(await l.get("/api/auth/check-accesses")).data;Object.assign(a.user,{_id:t,email:s,phone:n}),Object.assign(a.access,{token:r,roles:o,status:!!r}),a.accesses=h}}catch(e){console.error("Error initializing app:",e),f("user"),a.accesses=[]}}O();const P={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}),console.log(s),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:o}=a.user;if(console.log(n),console.log(o),n!==o){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(r),new Error(r.response.status)}try{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 c.setError(r),console.log("Sign up falied"),r}},logout(){f("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,type:t});return Object.assign(k.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}=a.user;if(s!==n){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(o),new Error(o.response.status)}try{const o=await u.post("/api/auth/update-password",{email:e.email,phone:e.phone,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 c.setError(o),Promise.reject(o)}}},j={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.DOMAIN_URL,sameSite:"none",secure:!0}};async function m(e){if(process.env.MOBILE_APP){const{value:t}=await g.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?g.Preferences.set({key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),j[s])}function f(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)g.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.DOMAIN_URL}:{};d.default.remove(e,s)}}w.watch(a,(e,t)=>{});exports.actions=P;exports.initialize=O;exports.state=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("axios"),w=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),g=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),O=require("vue"),c=require("../../globals/store/globals.cjs"),k=require("./twofa.cjs"),u=d.create({baseURL:process.env.API_URL,withCredentials:!0}),r=O.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1},accesses:[]});async function p(){try{const e=await j("user");if(e){const{_id:t,email:s,phone:n,roles:o,accessToken:a}=e;d.interceptors.request.use(i=>(i.headers["x-access-token"]=a,i),i=>Promise.reject(i));const h=(await d.get("/api/auth/check-accesses")).data;Object.assign(r.user,{_id:t,email:s,phone:n}),Object.assign(r.access,{token:a,roles:o,status:!!a}),r.accesses=h}}catch(e){console.error("Error initializing app:",e),f("user"),r.accesses=[]}}p();const m={async login(e,t){try{const s=await u.post("/api/auth/signin",{...e,type:t});return l("user",s.data),Object.assign(r.user,{...s.data}),Object.assign(r.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),await p(),s.data}catch(s){return Object.assign(r.access,{token:null,status:!1,roles:null}),console.log(s),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:o}=r.user;if(console.log(n),console.log(o),n!==o){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(a),new Error(a.response.status)}try{const a=await u.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(a),a.data.accessToken&&l("user",a.data),Object.assign(r.user,{...a.data}),Object.assign(r.access,{token:a.data.accessToken,status:!0,roles:a.data.roles}),await p(),a.data}catch(a){throw c.setError(a),console.log("Sign up falied"),a}},logout(){f("user"),Object.assign(r.user,{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(r.access,{roles:null,token:null,status:!1}),r.accesses=[]},async resetPassword(e,t){try{const s=await u.post("/api/auth/reset-password",{email:e.email,phone:e.phone,type:t});return Object.assign(k.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}=r.user;if(s!==n){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(o),new Error(o.response.status)}try{const o=await u.post("/api/auth/update-password",{email:e.email,phone:e.phone,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return o.data.accessToken&&l("user",o.data),Object.assign(r.user,{...o.data}),Object.assign(r.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return c.setError(o),Promise.reject(o)}}},P={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.DOMAIN_URL,sameSite:"none",secure:!0}};async function j(e){if(process.env.MOBILE_APP){const{value:t}=await g.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=w.default.get(e);return t?JSON.parse(t):null}}function l(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?g.Preferences.set({key:e,value:JSON.stringify(t)}):w.default.set(e,JSON.stringify(t),P[s])}function f(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)g.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.DOMAIN_URL}:{};w.default.remove(e,s)}}O.watch(r,(e,t)=>{});exports.actions=m;exports.initialize=p;exports.state=r;