@ozdao/prometheus-framework 0.1.90 → 0.1.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
  2. package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +22 -22
  3. package/dist/prometheus-framework/node_modules/@capacitor/preferences/dist/esm/index.cjs +1 -0
  4. package/dist/prometheus-framework/node_modules/@capacitor/preferences/dist/esm/index.js +7 -0
  5. package/dist/prometheus-framework/node_modules/@capacitor/preferences/dist/esm/web.cjs +1 -0
  6. package/dist/prometheus-framework/node_modules/@capacitor/preferences/dist/esm/web.js +54 -0
  7. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Button/Button.vue.js +224 -2
  9. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +2 -224
  11. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +1 -1
  13. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +72 -2
  15. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  16. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -72
  17. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/components/Select/Select.vue.js +78 -2
  19. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -78
  21. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +44 -2
  23. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +2 -44
  25. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  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 +2 -2
  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 +60 -65
  39. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  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/events/components/elements/ButtonJoin.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  49. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +3 -3
  51. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  53. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  55. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  63. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
  65. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +3 -3
  67. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -4
  69. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  73. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/organizations/components/sections/FeedDepartments.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  77. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersList.vue.js +1 -1
  79. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +4 -4
  81. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  83. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/spots/components/sections/Feed.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  89. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  91. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileOrganizations.vue.js +1 -1
  95. package/dist/style.css +1 -1
  96. package/package.json +2 -1
  97. package/src/modules/auth/store/auth.js +32 -38
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Tab.vue.cjs");const m={class:""},v={class:"flex-nowrap flex-v-center flex"},p=["onClick"],k={__name:"Tab",props:{tabs:Array,selected:String,callback:Function},emits:["update:selected"],setup(s,{emit:o}){const i=o,l=s,a=e.ref(0);if(l.selected){const t=l.tabs.findIndex(c=>c.value===l.selected);t!==-1&&(a.value=t)}function u(t,c){a.value=t,i("update:selected",c.value),l.callback&&l.callback()}function d(t){return`${100/l.tabs.length*t}%`}function f(){return`${100/l.tabs.length}%`}const b=e.computed(()=>({left:d(a.value),width:f()}));return(t,c)=>(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tabs,(r,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,onClick:_=>u(n,r),class:e.normalizeClass([{"t-transp":n!==a.value},"z-index-1 t-center pd-small w-100"])},[e.createElementVNode("label",null,e.toDisplayString(r.name),1)],10,p))),128)),e.createElementVNode("div",{style:e.normalizeStyle(b.value),class:"radius-extra bg-main t-white tab-selector"},null,4)])]))}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,46 +1,4 @@
1
- import { ref as v, computed as h, openBlock as c, createElementBlock as s, createElementVNode as r, Fragment as _, renderList as g, normalizeClass as k, toDisplayString as x, normalizeStyle as y } from "vue";
2
- import "./Tab.vue.js";
3
- const S = { class: "" }, T = { class: "flex-nowrap flex-v-center flex" }, w = ["onClick"], W = {
4
- __name: "Tab",
5
- props: {
6
- tabs: Array,
7
- selected: String,
8
- callback: Function
9
- },
10
- emits: ["update:selected"],
11
- setup(o, { emit: d }) {
12
- const u = d, t = o, a = v(0);
13
- if (t.selected) {
14
- const e = t.tabs.findIndex((l) => l.value === t.selected);
15
- e !== -1 && (a.value = e);
16
- }
17
- function f(e, l) {
18
- a.value = e, u("update:selected", l.value), t.callback && t.callback();
19
- }
20
- function b(e) {
21
- return `${100 / t.tabs.length * e}%`;
22
- }
23
- function m() {
24
- return `${100 / t.tabs.length}%`;
25
- }
26
- const p = h(() => ({ left: b(a.value), width: m() }));
27
- return (e, l) => (c(), s("div", S, [
28
- r("div", T, [
29
- (c(!0), s(_, null, g(o.tabs, (i, n) => (c(), s("div", {
30
- key: n,
31
- onClick: (z) => f(n, i),
32
- class: k([{ "t-transp": n !== a.value }, "z-index-1 t-center pd-small w-100"])
33
- }, [
34
- r("label", null, x(i.name), 1)
35
- ], 10, w))), 128)),
36
- r("div", {
37
- style: y(p.value),
38
- class: "radius-extra bg-main t-white tab-selector"
39
- }, null, 4)
40
- ])
41
- ]));
42
- }
43
- };
1
+ const e = "";
44
2
  export {
45
- W as default
3
+ e as default
46
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../../../../node_modules/vue3-carousel/dist/carousel.css.cjs");require("vue-i18n");require("../../../../../../node_modules/vue3-carousel/dist/carousel.es.cjs");require("../sections/SliderFeatures.vue2.cjs");const r=require("vue-router");require("../../store/auth.cjs");require("../../../middlewares/client/inputs.validation.cjs");const u={class:"cols-2-1_2 gap-small pd-small bg-white"},n=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",u,[e.createVNode(t,{class:"pd-medium br-solid br-1px br-grey radius-big w-m-66r t-center"},{default:e.withCtx(({Component:i,route:l})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{ref:"page",key:l.path,localPosition:o.localPosition},null,8,["localPosition"]))]),_:2},1024)]),_:1}),n])}}};exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Button/Button.vue2.cjs");require("../../../../../../node_modules/vue3-carousel/dist/carousel.css.cjs");require("vue-i18n");require("../../../../../../node_modules/vue3-carousel/dist/carousel.es.cjs");require("../sections/SliderFeatures.vue2.cjs");const r=require("vue-router");require("../../store/auth.cjs");require("../../../middlewares/client/inputs.validation.cjs");const u={class:"cols-2-1_2 gap-small pd-small bg-white"},n=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",u,[e.createVNode(t,{class:"pd-medium br-solid br-1px br-grey radius-big w-m-66r t-center"},{default:e.withCtx(({Component:i,route:l})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i),{ref:"page",key:l.path,localPosition:o.localPosition},null,8,["localPosition"]))]),_:2},1024)]),_:1}),n])}}};exports.default=s;
@@ -1,7 +1,7 @@
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
- import "../../../../components/Tab/Tab.vue.js";
2
+ import "../../../../components/Tab/Tab.vue2.js";
3
3
  import "../../../../components/Field/Field.vue.js";
4
- import "../../../../components/Button/Button.vue.js";
4
+ import "../../../../components/Button/Button.vue2.js";
5
5
  import "../../../../../../node_modules/vue3-carousel/dist/carousel.css.js";
6
6
  import "vue-i18n";
7
7
  import "../../../../../../node_modules/vue3-carousel/dist/carousel.es.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),h=require("vue-i18n"),t=require("../../store/auth.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs"),w=require("../../localization/EnterPassword.json.cjs");require("./EnterPassword.vue2.cjs");const y={class:"t-left pd-medium"},_={class:"mn-small"},g={key:0,class:"mn-semi t-transp"},k={key:1,class:"mn-semi t-transp"},q={class:"mn-semi radius-small o-hidden"},B={key:2,class:"p-medium t-semi mn-semi"},E=e.createElementVNode("a",{class:"t-second",href:"https://thecommunephuket.com/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),P={key:0},v={key:1},b={__name:"EnterPassword",setup(V){const n=e.ref(null),{t:s}=h.useI18n(w.default),r=d.useRoute(),u=d.useRouter();e.ref("phone");async function c(){try{await i.validateInputs(n,i.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",y,[e.createElementVNode("h3",_,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",k,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",q,[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-grey pd-small radius-small mn-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-grey pd-small radius-small mn-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",B,[e.createTextVNode(" By registering, you agree to our "),E])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:c,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",v,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),d=require("vue-router"),h=require("vue-i18n"),t=require("../../store/auth.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs"),w=require("../../localization/EnterPassword.json.cjs");require("./EnterPassword.vue2.cjs");const y={class:"t-left pd-medium"},_={class:"mn-small"},g={key:0,class:"mn-semi t-transp"},k={key:1,class:"mn-semi t-transp"},q={class:"mn-semi radius-small o-hidden"},B={key:2,class:"p-medium t-semi mn-semi"},E=e.createElementVNode("a",{class:"t-second",href:"https://thecommunephuket.com/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),P={key:0},v={key:1},b={__name:"EnterPassword",setup(V){const n=e.ref(null),{t:s}=h.useI18n(w.default),r=d.useRoute(),u=d.useRouter();e.ref("phone");async function c(){try{await i.validateInputs(n,i.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",y,[e.createElementVNode("h3",_,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",k,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",q,[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-grey pd-small radius-small mn-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-grey pd-small radius-small mn-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",B,[e.createTextVNode(" By registering, you agree to our "),E])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:c,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",v,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};exports.default=b;
@@ -1,7 +1,7 @@
1
1
  import { ref as u, openBlock as o, createElementBlock as a, createElementVNode as m, toDisplayString as d, unref as e, createVNode as l, createTextVNode as g, createCommentVNode as P, withCtx as k } from "vue";
2
- import "../../../../components/Tab/Tab.vue.js";
2
+ import "../../../../components/Tab/Tab.vue2.js";
3
3
  import c from "../../../../components/Field/Field.vue2.js";
4
- import q from "../../../../components/Button/Button.vue2.js";
4
+ import q from "../../../../components/Button/Button.vue.js";
5
5
  import { useRoute as b, 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");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),t=require("../../store/auth.cjs"),u=require("../../store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");require("./Invite.vue2.cjs");const h={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),y=e.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),b={class:"mn-semi radius-small o-hidden"},q={key:0},k={key:1},B={__name:"Invite",async setup(E){let r,n;const i=e.ref(null),s=d.useRoute(),p=d.useRouter();[r,n]=e.withAsyncContext(()=>u.actions.readOne(s.query.inviteCode)),await r,n();async function m(){try{await c.validateInputs(i,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}await t.actions.signup(t.state.user,s.query.type,s.query.inviteCode)}function _(){p.push({name:"Dashboard"})}return(w,a)=>(e.openBlock(),e.createElementBlock("section",h,[v,y,e.createElementVNode("div",b,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":a[0]||(a[0]=o=>t.state.user.password=o),type:"password",validation:i.value,label:"Пароль",placeholder:"******",class:"bg-white radius-small mn-small"},null,8,["field","validation"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":a[1]||(a[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Повторите пароль",placeholder:"******",class:"bg-white radius-small mn-semi"},null,8,["field"])]),e.createVNode(f.default,{disabled:u.state.invite===null,submit:m,callback:_,class:"mn-big"},{default:e.withCtx(()=>[e.unref(s).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",q,"Поменять пароль")):(e.openBlock(),e.createElementBlock("span",k,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}};exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue2.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),d=require("vue-router"),t=require("../../store/auth.cjs"),u=require("../../store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");require("./Invite.vue2.cjs");const h={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-small"},"Вы были пригилашены в организацию",-1),y=e.createElementVNode("p",{class:"mn-semi t-transp"},"Пожалуйста, укажите пароль, на этом регистрация будет закочена.",-1),b={class:"mn-semi radius-small o-hidden"},q={key:0},k={key:1},B={__name:"Invite",async setup(E){let r,n;const i=e.ref(null),s=d.useRoute(),p=d.useRouter();[r,n]=e.withAsyncContext(()=>u.actions.readOne(s.query.inviteCode)),await r,n();async function m(){try{await c.validateInputs(i,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}await t.actions.signup(t.state.user,s.query.type,s.query.inviteCode)}function _(){p.push({name:"Dashboard"})}return(w,a)=>(e.openBlock(),e.createElementBlock("section",h,[v,y,e.createElementVNode("div",b,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":a[0]||(a[0]=o=>t.state.user.password=o),type:"password",validation:i.value,label:"Пароль",placeholder:"******",class:"bg-white radius-small mn-small"},null,8,["field","validation"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":a[1]||(a[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Повторите пароль",placeholder:"******",class:"bg-white radius-small mn-semi"},null,8,["field"])]),e.createVNode(f.default,{disabled:u.state.invite===null,submit:m,callback:_,class:"mn-big"},{default:e.withCtx(()=>[e.unref(s).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",q,"Поменять пароль")):(e.openBlock(),e.createElementBlock("span",k,"Зарегистрироваться"))]),_:1},8,["disabled"])]))}};exports.default=B;
@@ -1,7 +1,7 @@
1
1
  import { ref as w, withAsyncContext as h, openBlock as o, createElementBlock as r, createElementVNode as n, createVNode as i, withCtx as y, unref as b } from "vue";
2
- import "../../../../components/Tab/Tab.vue.js";
2
+ import "../../../../components/Tab/Tab.vue2.js";
3
3
  import p from "../../../../components/Field/Field.vue2.js";
4
- import v from "../../../../components/Button/Button.vue2.js";
4
+ import v from "../../../../components/Button/Button.vue.js";
5
5
  import { useRoute as k, useRouter as g } from "vue-router";
6
6
  import { state as e, actions as q } from "../../store/auth.js";
7
7
  import { actions as x, state as C } from "../../store/invites.js";
@@ -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.vue2.cjs"),v=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),u=require("vue-router"),w=require("vue-i18n"),V=require("../../localization/ResetPassword.json.cjs"),s=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");require("./ResetPassword.vue2.cjs");const g={class:"t-left pd-medium"},y={class:"mn-small"},N={class:"mn-small t-transp"},b={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},E={key:0,class:"mn-semi radius-small o-hidden"},k={class:"mn-small t-transp"},C={key:0,class:"mn-semi radius-small o-hidden"},P={class:"mn-small t-transp"},S={__name:"ResetPassword",setup(I){const{t}=w.useI18n(V.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",g,[e.createElementVNode("h3",y,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",N,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",b,[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",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(v.default,{modelValue:s.state.user.phone,"onUpdate:modelValue":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-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("p",P,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-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(_.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Tab/Tab.vue.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),v=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),_=require("../../../../components/Button/Button.vue.cjs"),u=require("vue-router"),w=require("vue-i18n"),V=require("../../localization/ResetPassword.json.cjs"),s=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");require("./ResetPassword.vue2.cjs");const g={class:"t-left pd-medium"},y={class:"mn-small"},N={class:"mn-small t-transp"},b={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},E={key:0,class:"mn-semi radius-small o-hidden"},k={class:"mn-small t-transp"},C={key:0,class:"mn-semi radius-small o-hidden"},P={class:"mn-small t-transp"},S={__name:"ResetPassword",setup(I){const{t}=w.useI18n(V.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",g,[e.createElementVNode("h3",y,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",N,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",b,[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",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(v.default,{modelValue:s.state.user.phone,"onUpdate:modelValue":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-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("p",P,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-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(_.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};exports.default=S;
@@ -1,8 +1,8 @@
1
1
  import { ref as m, openBlock as u, createElementBlock as p, createElementVNode as l, toDisplayString as r, unref as t, createVNode as i, Transition as _, withCtx as c, createCommentVNode as v, createTextVNode as V } from "vue";
2
- import P from "../../../../components/Tab/Tab.vue2.js";
2
+ import P from "../../../../components/Tab/Tab.vue.js";
3
3
  import C from "../../../../components/Field/Field.vue2.js";
4
4
  import E from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import I from "../../../../components/Button/Button.vue2.js";
5
+ import I from "../../../../components/Button/Button.vue.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 T from "../../localization/ResetPassword.json.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Tab/Tab.vue2.cjs"),c=require("../../../../components/Field/Field.vue2.cjs"),V=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),w=require("../../../../components/Button/Button.vue2.cjs"),p=require("vue-router"),N=require("vue-i18n"),b=require("../../localization/SignIn.json.cjs"),a=require("../../store/auth.cjs"),r=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const y={class:""},S=["src"],E={class:"mn-medium"},q=e.createElementVNode("br",null,null,-1),x={class:"t-semi"},C={class:"mn-big"},D={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},P={class:"pos-relative"},T={class:"mn-thin radius-small"},I={class:"mn-thin radius-small o-hidden"},U={class:"w-100 mn-big"},k={__name:"SignIn",setup(j){const d=e.ref(null),m=e.ref(null),u=e.ref(null);p.useRoute();const h=p.useRouter(),{t:l}=N.useI18n(b.default),n=e.ref("phone"),f=o=>new Promise((s,i)=>{const t=document.createElement("script");t.type="text/javascript",t.src=o,t.onload=s,t.onerror=i,document.head.appendChild(t)});e.onMounted(async()=>{await f("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function v(){try{n.value==="phone"&&await r.validateInputs(d,r.validatePhone,a.state.user.phone,"Некорректный телефон"),n.value==="email"&&await r.validateInputs(u,r.validateEmail,a.state.user.email,"Некорректный email")}catch{throw new Error}const o={...a.state.user};o.phone=a.state.user.phone.number,await a.actions.login(o,n.value)}function _(){h.push({name:"User Profile",params:{_id:a.state.user._id},query:{afterAuth:"true"}})}return(o,s)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("img",{src:"/logo/logo_square.svg",class:"i-extra radius-small mn-small"},null,8,S),e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(l)("title"))+" ",1),q,e.createElementVNode("span",x,e.toDisplayString(e.unref(l)("subtitle")),1)]),e.createElementVNode("p",C,[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",D,[e.createVNode(g.default,{selected:n.value,"onUpdate:selected":s[0]||(s[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",P,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createVNode(V.default,{modelValue:a.state.user.phone,"onUpdate:modelValue":s[1]||(s[1]=t=>a.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(l)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,n.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(c.default,{field:a.state.user.email,"onUpdate:field":s[2]||(s[2]=t=>a.state.user.email=t),placeholder:e.unref(l)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,n.value==="email"]])]),_:1})]),e.createVNode(c.default,{field:a.state.user.password,"onUpdate:field":s[3]||(s[3]=t=>a.state.user.password=t),type:"password",validation:m.value,placeholder:e.unref(l)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",U,[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(w.default,{submit:v,callback:_,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signin")),1)]),_:1})])}}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("../../../../components/Tab/Tab.vue.cjs"),c=require("../../../../components/Field/Field.vue2.cjs"),V=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),w=require("../../../../components/Button/Button.vue.cjs"),p=require("vue-router"),N=require("vue-i18n"),b=require("../../localization/SignIn.json.cjs"),a=require("../../store/auth.cjs"),r=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const y={class:""},S=["src"],E={class:"mn-medium"},q=e.createElementVNode("br",null,null,-1),x={class:"t-semi"},C={class:"mn-big"},D={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},P={class:"pos-relative"},T={class:"mn-thin radius-small"},I={class:"mn-thin radius-small o-hidden"},U={class:"w-100 mn-big"},k={__name:"SignIn",setup(j){const d=e.ref(null),m=e.ref(null),u=e.ref(null);p.useRoute();const h=p.useRouter(),{t:l}=N.useI18n(b.default),n=e.ref("phone"),f=o=>new Promise((s,i)=>{const t=document.createElement("script");t.type="text/javascript",t.src=o,t.onload=s,t.onerror=i,document.head.appendChild(t)});e.onMounted(async()=>{await f("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function v(){try{n.value==="phone"&&await r.validateInputs(d,r.validatePhone,a.state.user.phone,"Некорректный телефон"),n.value==="email"&&await r.validateInputs(u,r.validateEmail,a.state.user.email,"Некорректный email")}catch{throw new Error}const o={...a.state.user};o.phone=a.state.user.phone.number,await a.actions.login(o,n.value)}function _(){h.push({name:"User Profile",params:{_id:a.state.user._id},query:{afterAuth:"true"}})}return(o,s)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",y,[e.createElementVNode("img",{src:"/logo/logo_square.svg",class:"i-extra radius-small mn-small"},null,8,S),e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(l)("title"))+" ",1),q,e.createElementVNode("span",x,e.toDisplayString(e.unref(l)("subtitle")),1)]),e.createElementVNode("p",C,[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",D,[e.createVNode(g.default,{selected:n.value,"onUpdate:selected":s[0]||(s[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",P,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",T,[e.createVNode(V.default,{modelValue:a.state.user.phone,"onUpdate:modelValue":s[1]||(s[1]=t=>a.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(l)("phonePlaceholder")},class:"bg-grey pd-small radius-small mn-thin"},null,8,["modelValue","validation","inputOptions"])],512),[[e.vShow,n.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(c.default,{field:a.state.user.email,"onUpdate:field":s[2]||(s[2]=t=>a.state.user.email=t),placeholder:e.unref(l)("emailPlaceholder"),validation:u.value,class:"bg-grey pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,n.value==="email"]])]),_:1})]),e.createVNode(c.default,{field:a.state.user.password,"onUpdate:field":s[3]||(s[3]=t=>a.state.user.password=t),type:"password",validation:m.value,placeholder:e.unref(l)("passwordPlaceholder"),class:"bg-grey pd-medium radius-small mn-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",U,[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(w.default,{submit:v,callback:_,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signin")),1)]),_:1})])}}};exports.default=k;
@@ -1,8 +1,8 @@
1
1
  import { ref as p, onMounted as U, resolveComponent as k, openBlock as C, createElementBlock as E, createElementVNode as l, createTextVNode as c, toDisplayString as d, unref as o, createVNode as i, withCtx as u, Transition as f, withDirectives as v, vShow as g } from "vue";
2
- import I from "../../../../components/Tab/Tab.vue2.js";
2
+ import I from "../../../../components/Tab/Tab.vue.js";
3
3
  import w from "../../../../components/Field/Field.vue2.js";
4
4
  import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import j from "../../../../components/Button/Button.vue2.js";
5
+ import j from "../../../../components/Button/Button.vue.js";
6
6
  import { useRoute as F, useRouter as N } from "vue-router";
7
7
  import { useI18n as O } from "vue-i18n";
8
8
  import T 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.vue2.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue2.cjs"),u=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),n=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const b={class:"t-left pd-medium"},E={class:"mn-small"},S={class:"mn-small t-transp"},y={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-semi radius-small"},D={class:"mn-small t-transp"},x={class:"mn-semi radius-small o-hidden"},T={class:"mn-small t-transp"},k={class:"w-100"},I={__name:"SignUp",setup(P){const{t}=g.useI18n(w.default),i=e.ref(null),r=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,n.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,n.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(n.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(d,l)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",b,[e.createElementVNode("h3",E,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("p",S,e.toDisplayString(e.unref(t)("description")),1),e.createElementVNode("div",y,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":l[0]||(l[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",D,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{modelValue:n.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=o=>n.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-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",x,[e.createElementVNode("p",T,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:n.state.user.email,"onUpdate:field":l[2]||(l[2]=o=>n.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(V.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",k,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=I;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue.cjs"),u=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),n=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),s=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const b={class:"t-left pd-medium"},E={class:"mn-small"},S={class:"mn-small t-transp"},y={class:"mn-small p-small uppercase t-semi bg-grey radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-semi radius-small"},D={class:"mn-small t-transp"},x={class:"mn-semi radius-small o-hidden"},T={class:"mn-small t-transp"},k={class:"w-100"},I={__name:"SignUp",setup(P){const{t}=g.useI18n(w.default),i=e.ref(null),r=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await s.validateInputs(i,s.validatePhone,n.state.user.phone,"Некорректный телефон"),a.value==="email"&&await s.validateInputs(r,s.validateEmail,n.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(n.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(d,l)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",b,[e.createElementVNode("h3",E,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("p",S,e.toDisplayString(e.unref(t)("description")),1),e.createElementVNode("div",y,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":l[0]||(l[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",D,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{modelValue:n.state.user.phone,"onUpdate:modelValue":l[1]||(l[1]=o=>n.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-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",x,[e.createElementVNode("p",T,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:n.state.user.email,"onUpdate:field":l[2]||(l[2]=o=>n.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(V.default,{submit:m,callback:p,class:"mn-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",k,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=I;
@@ -1,8 +1,8 @@
1
1
  import { ref as d, resolveComponent as C, openBlock as k, createElementBlock as E, createElementVNode as o, toDisplayString as n, unref as t, createVNode as a, Transition as h, withCtx as m, withDirectives as _, vShow as f, createTextVNode as v } from "vue";
2
- import x from "../../../../components/Tab/Tab.vue2.js";
2
+ import x from "../../../../components/Tab/Tab.vue.js";
3
3
  import N from "../../../../components/Field/Field.vue2.js";
4
4
  import S from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import D from "../../../../components/Button/Button.vue2.js";
5
+ import D from "../../../../components/Button/Button.vue.js";
6
6
  import { useRoute as I, useRouter as P } from "vue-router";
7
7
  import { useI18n as U } from "vue-i18n";
8
8
  import F from "../../localization/SignUp.json.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../../../node_modules/axios/lib/axios.cjs"),l=require("../../../../../node_modules/js-cookie/src/js.cookie.cjs"),d=require("../../../../node_modules/@capacitor/core/dist/index.cjs"),k=require("vue"),n=require("../../globals/store/globals.cjs"),g=require("./twofa.cjs"),i=w.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=k.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function O(){const e=await b("user");if(console.log("user cookie is "+e),e){const{_id:t,email:s,phone:c,roles:r,accessToken:o}=e;Object.assign(a.user,{_id:t,email:s,phone:c}),Object.assign(a.access,{token:o,roles:r,status:!!o}),i.interceptors.request.use(u=>(o&&(u.headers["x-access-token"]=o),u),u=>Promise.reject(u))}}O();const f={async login(e,t){try{const s=await i.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}),n.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:c,passwordRepeat:r}=a.user;if(c!==r){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(o),new Error(o.response.status)}try{e.phone=e.phone.number;const o=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return o.data.accessToken&&p("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0,roles:o.data.roles}),o.data}catch(o){throw n.setError(o),console.log("Sign up falied"),o}},logout(){m("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 i.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 n.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:c}=a.user;if(s!==c){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(r),new Error(r.response.status)}try{const r=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone.number,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return r.data.accessToken&&p("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0}),r.data}catch(r){return n.setError(r),Promise.reject(r)}}},h={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};async function b(e){if(process.env.MOBILE_APP){const t=await d.CapacitorCookies.getCookies();return console.log("capacitor cookie is "+t),console.log(t),console.log("zaebalo"),t?JSON.parse(t.user):null}else{const t=l.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.NODE_ENV){process.env.MOBILE_APP?d.CapacitorCookies.setCookie({key:e,value:JSON.stringify(t)}):l.default.set(e,JSON.stringify(t),h[s])}function m(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)d.CapacitorCookies.deleteCookie({url:process.env.API_URL,key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};l.default.remove(e,s)}}k.watch(a,(e,t)=>{});exports.actions=f;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/src/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),w=require("vue"),n=require("../../globals/store/globals.cjs"),O=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 g(){const e=await P("user");if(console.log("user cookie is "+e),e){const{_id:t,email:s,phone:c,roles:a,accessToken:r}=e;Object.assign(o.user,{_id:t,email:s,phone:c}),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))}}g();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}),n.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:c,passwordRepeat:a}=o.user;if(c!==a){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(r),new Error(r.response.status)}try{e.phone=e.phone.number;const r=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return 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 n.setError(r),console.log("Sign up falied"),r}},logout(){m("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.number,type:t});return Object.assign(O.state.code,{...s.data,isSended:!0}),s.data}catch(s){return n.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:c}=o.user;if(s!==c){const a={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(a),new Error(a.response.status)}try{const a=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone.number,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 n.setError(a),Promise.reject(a)}}},h={development:{secure:!1,expires:1},production:{expires:1,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.NODE_ENV){process.env.MOBILE_APP?l.Preferences.set({key:e,value:JSON.stringify(t)}):d.default.set(e,JSON.stringify(t),h[s])}function m(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
1
  import m from "../../../../node_modules/axios/lib/axios.js";
2
2
  import d from "../../../../../node_modules/js-cookie/src/js.cookie.js";
3
- import { CapacitorCookies as l } from "../../../../node_modules/@capacitor/core/dist/index.js";
4
- import { reactive as w, watch as k } from "vue";
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
5
  import { setError as n } from "../../globals/store/globals.js";
6
- import { state as f } from "./twofa.js";
7
- const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = w({
6
+ import { state as O } from "./twofa.js";
7
+ const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w({
8
8
  user: {
9
9
  _id: void 0,
10
10
  username: "",
@@ -22,80 +22,80 @@ const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = w
22
22
  async function g() {
23
23
  const e = await h("user");
24
24
  if (console.log("user cookie is " + e), e) {
25
- const { _id: o, email: s, phone: c, roles: a, accessToken: t } = e;
26
- Object.assign(r.user, { _id: o, email: s, phone: c }), Object.assign(r.access, { token: t, roles: a, status: !!t }), i.interceptors.request.use((p) => (t && (p.headers["x-access-token"] = t), p), (p) => Promise.reject(p));
25
+ const { _id: t, email: s, phone: c, roles: o, accessToken: r } = e;
26
+ Object.assign(a.user, { _id: t, email: s, phone: c }), Object.assign(a.access, { token: r, roles: o, status: !!r }), i.interceptors.request.use((p) => (r && (p.headers["x-access-token"] = r), p), (p) => Promise.reject(p));
27
27
  }
28
28
  }
29
29
  g();
30
- const y = {
31
- async login(e, o) {
30
+ const R = {
31
+ async login(e, t) {
32
32
  try {
33
33
  const s = await i.post("/api/auth/signin", {
34
34
  ...e,
35
- type: o
35
+ type: t
36
36
  });
37
- return u("user", s.data), Object.assign(r.user, {
37
+ return u("user", s.data), Object.assign(a.user, {
38
38
  ...s.data
39
- }), Object.assign(r.access, {
39
+ }), Object.assign(a.access, {
40
40
  token: s.data.accessToken,
41
41
  status: !0,
42
42
  roles: s.data.roles
43
43
  }), s.data;
44
44
  } catch (s) {
45
- return Object.assign(r.access, {
45
+ return Object.assign(a.access, {
46
46
  token: null,
47
47
  status: !1,
48
48
  roles: null
49
49
  }), n(s), Promise.reject(s);
50
50
  }
51
51
  },
52
- async signup(e, o, s) {
53
- const { password: c, passwordRepeat: a } = r.user;
54
- if (c !== a) {
55
- const t = {
52
+ async signup(e, t, s) {
53
+ const { password: c, passwordRepeat: o } = a.user;
54
+ if (c !== o) {
55
+ const r = {
56
56
  response: {
57
57
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
58
58
  }
59
59
  };
60
- throw n(t), new Error(t.response.status);
60
+ throw n(r), new Error(r.response.status);
61
61
  }
62
62
  try {
63
63
  e.phone = e.phone.number;
64
- const t = await i.post("/api/auth/signup", {
64
+ const r = await i.post("/api/auth/signup", {
65
65
  ...e,
66
- type: o,
66
+ type: t,
67
67
  inviteCode: s
68
68
  });
69
- return t.data.accessToken && u("user", t.data), Object.assign(r.user, {
70
- ...t.data
71
- }), Object.assign(r.access, {
72
- token: t.data.accessToken,
69
+ return r.data.accessToken && u("user", r.data), Object.assign(a.user, {
70
+ ...r.data
71
+ }), Object.assign(a.access, {
72
+ token: r.data.accessToken,
73
73
  status: !0,
74
- roles: t.data.roles
75
- }), t.data;
76
- } catch (t) {
77
- throw n(t), console.log("Sign up falied"), t;
74
+ roles: r.data.roles
75
+ }), r.data;
76
+ } catch (r) {
77
+ throw n(r), console.log("Sign up falied"), r;
78
78
  }
79
79
  },
80
80
  logout() {
81
- P("user"), Object.assign(r.user, {
81
+ P("user"), Object.assign(a.user, {
82
82
  email: "",
83
83
  phone: "",
84
84
  password: "",
85
85
  passwordRepeat: ""
86
- }), Object.assign(r.access, {
86
+ }), Object.assign(a.access, {
87
87
  token: null,
88
88
  status: !1
89
89
  });
90
90
  },
91
- async resetPassword(e, o) {
91
+ async resetPassword(e, t) {
92
92
  try {
93
93
  const s = await i.post("/api/auth/reset-password", {
94
94
  email: e.email,
95
95
  phone: e.phone.number,
96
- type: o
96
+ type: t
97
97
  });
98
- return Object.assign(f.code, {
98
+ return Object.assign(O.code, {
99
99
  ...s.data,
100
100
  isSended: !0
101
101
  }), s.data;
@@ -103,69 +103,64 @@ const y = {
103
103
  return n(s), Promise.reject(s);
104
104
  }
105
105
  },
106
- async updatePassword(e, o) {
107
- const { password: s, passwordRepeat: c } = r.user;
106
+ async updatePassword(e, t) {
107
+ const { password: s, passwordRepeat: c } = a.user;
108
108
  if (s !== c) {
109
- const a = {
109
+ const o = {
110
110
  response: {
111
111
  data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
112
112
  }
113
113
  };
114
- throw n(a), new Error(a.response.status);
114
+ throw n(o), new Error(o.response.status);
115
115
  }
116
116
  try {
117
- const a = await i.post("/api/auth/update-password", {
117
+ const o = await i.post("/api/auth/update-password", {
118
118
  email: e.email,
119
119
  phone: e.phone.number,
120
120
  password: e.password,
121
121
  passwordRepeat: e.passwordRepeat,
122
- type: o
122
+ type: t
123
123
  });
124
- return a.data.accessToken && u("user", a.data), Object.assign(r.user, {
125
- ...a.data
126
- }), Object.assign(r.access, {
127
- token: a.data.accessToken,
124
+ return o.data.accessToken && u("user", o.data), Object.assign(a.user, {
125
+ ...o.data
126
+ }), Object.assign(a.access, {
127
+ token: o.data.accessToken,
128
128
  status: !0
129
- }), a.data;
130
- } catch (a) {
131
- return n(a), Promise.reject(a);
129
+ }), o.data;
130
+ } catch (o) {
131
+ return n(o), Promise.reject(o);
132
132
  }
133
133
  }
134
- }, O = {
134
+ }, k = {
135
135
  development: { secure: !1, expires: 1 },
136
136
  production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
137
137
  };
138
138
  async function h(e) {
139
139
  if (process.env.MOBILE_APP) {
140
- const o = await l.getCookies();
141
- return console.log("capacitor cookie is " + o), console.log(o), console.log("zaebalo"), o ? JSON.parse(o.user) : null;
140
+ const { value: t } = await l.get({ key: e });
141
+ return t ? JSON.parse(t) : null;
142
142
  } else {
143
- const o = d.get(e);
144
- return o ? JSON.parse(o) : null;
143
+ const t = d.get(e);
144
+ return t ? JSON.parse(t) : null;
145
145
  }
146
146
  }
147
- function u(e, o, s = process.env.NODE_ENV) {
148
- process.env.MOBILE_APP ? l.setCookie({
149
- // url: process.env.API_URL, // используйте ваш API_URL
147
+ function u(e, t, s = process.env.NODE_ENV) {
148
+ process.env.MOBILE_APP ? l.set({
150
149
  key: e,
151
- value: JSON.stringify(o)
152
- }) : d.set(e, JSON.stringify(o), O[s]);
150
+ value: JSON.stringify(t)
151
+ }) : d.set(e, JSON.stringify(t), k[s]);
153
152
  }
154
- function P(e, o = process.env.NODE_ENV) {
153
+ function P(e, t = process.env.NODE_ENV) {
155
154
  if (process.env.MOBILE_APP)
156
- l.deleteCookie({
157
- url: process.env.API_URL,
158
- // используйте ваш API_URL
159
- key: e
160
- });
155
+ l.remove({ key: e });
161
156
  else {
162
- const s = o === "production" ? { domain: process.env.API_URL } : {};
157
+ const s = t === "production" ? { domain: process.env.API_URL } : {};
163
158
  d.remove(e, s);
164
159
  }
165
160
  }
166
- k(r, (e, o) => {
161
+ f(a, (e, t) => {
167
162
  });
168
163
  export {
169
- y as actions,
170
- r as state
164
+ R as actions,
165
+ a as state
171
166
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router"),u=require("../../../../components/Select/Select.vue2.cjs"),a=require("../../store/blogposts.cjs"),c=require("../../../auth/store/auth.cjs"),m={class:"min-h-100vh pd-thin"},d={class:"mn-thin flex-v-center t-left flex-nowrap flex"},p={class:"flex-v-center flex-nowrap flex t-left"},f=e.createElementVNode("span",{class:""},"Topics for ",-1),g={class:"w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex"},h={class:""},w={__name:"Community",setup(k){const l=n.useRoute(),r=n.useRouter();return(y,t)=>{const s=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",d,[e.createElementVNode("h2",p,[f,e.createVNode(u.default,{options:["today","week","month","year"],select:a.state.filter.period,"onUpdate:select":t[0]||(t[0]=o=>a.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",g,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="featured"},"t-medium pd-thin radius-small"]),onClick:t[1]||(t[1]=o=>e.unref(r).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="popular"},"t-medium pd-thin radius-small"]),onClick:t[2]||(t[2]=o=>e.unref(r).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="new"},"t-medium pd-thin radius-small"]),onClick:t[3]||(t[3]=o=>e.unref(r).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),c.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="following"},"t-medium pd-thin radius-small"]),onClick:t[4]||(t[4]=o=>e.unref(r).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",h,[e.createVNode(s,null,{default:e.withCtx(({Component:o,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:i.query}))]),_:2},1024)]),_:1})])])}}};exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router"),u=require("../../../../components/Select/Select.vue.cjs"),a=require("../../store/blogposts.cjs"),c=require("../../../auth/store/auth.cjs"),m={class:"min-h-100vh pd-thin"},d={class:"mn-thin flex-v-center t-left flex-nowrap flex"},p={class:"flex-v-center flex-nowrap flex t-left"},f=e.createElementVNode("span",{class:""},"Topics for ",-1),g={class:"w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex"},h={class:""},w={__name:"Community",setup(k){const l=n.useRoute(),r=n.useRouter();return(y,t)=>{const s=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("header",d,[e.createElementVNode("h2",p,[f,e.createVNode(u.default,{options:["today","week","month","year"],select:a.state.filter.period,"onUpdate:select":t[0]||(t[0]=o=>a.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",g,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="featured"},"t-medium pd-thin radius-small"]),onClick:t[1]||(t[1]=o=>e.unref(r).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="popular"},"t-medium pd-thin radius-small"]),onClick:t[2]||(t[2]=o=>e.unref(r).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="new"},"t-medium pd-thin radius-small"]),onClick:t[3]||(t[3]=o=>e.unref(r).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),c.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(l).params.category==="following"},"t-medium pd-thin radius-small"]),onClick:t[4]||(t[4]=o=>e.unref(r).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",h,[e.createVNode(s,null,{default:e.withCtx(({Component:o,route:i})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:i.query}))]),_:2},1024)]),_:1})])])}}};exports.default=w;
@@ -1,6 +1,6 @@
1
1
  import { resolveComponent as f, openBlock as n, createElementBlock as m, createElementVNode as o, createVNode as i, normalizeClass as r, unref as t, createCommentVNode as g, withCtx as p, Transition as h, createBlock as w, resolveDynamicComponent as y } from "vue";
2
2
  import { useRoute as _, useRouter as k } from "vue-router";
3
- import b from "../../../../components/Select/Select.vue2.js";
3
+ import b from "../../../../components/Select/Select.vue.js";
4
4
  import { state as c } from "../../store/blogposts.js";
5
5
  import { state as v } from "../../../auth/store/auth.js";
6
6
  const x = { class: "min-h-100vh pd-thin" }, C = { class: "mn-thin flex-v-center t-left flex-nowrap flex" }, B = { class: "flex-v-center flex-nowrap flex t-left" }, $ = /* @__PURE__ */ o("span", { class: "" }, "Topics for ", -1), N = { class: "w-100 bg-grey pd-small radius-big mn-semi gap-thin flex-nowrap flex" }, V = { class: "" }, D = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{if(s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function v(){d.value=!0}function h(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=A;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{if(s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function v(){d.value=!0}function h(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=A;
@@ -1,13 +1,13 @@
1
1
  import { ref as r, onMounted as V, computed as _, openBlock as u, createElementBlock as i, unref as a, createElementVNode as p, createVNode as n, createCommentVNode as m, withCtx as w, createTextVNode as z } from "vue";
2
2
  import D from "../../../constructor/components/elements/Textarea.vue.js";
3
3
  import N from "../../../constructor/components/sections/Constructor.vue.js";
4
- import O from "../../../../components/Popup/Popup.vue2.js";
4
+ import O from "../../../../components/Popup/Popup.vue.js";
5
5
  import "../../../../components/FieldTags/tag-input.vue.js";
6
6
  import "../../../../components/FieldTags/vue-tags-input.scss.js";
7
7
  import U from "../../../../components/FieldTags/BlockTags.vue.js";
8
8
  import A from "../../../../components/Checkbox/Checkbox.vue.js";
9
9
  import E from "../../../../components/SelectMulti/SelectMulti.vue.js";
10
- import L from "../../../../components/Button/Button.vue2.js";
10
+ import L from "../../../../components/Button/Button.vue.js";
11
11
  import { useRoute as M, useRouter as R } from "vue-router";
12
12
  import { read as S, clean as F, state as H, update as k, create as y, remove as j } from "../../store/blogposts.js";
13
13
  import { state as f } from "../../../auth/store/auth.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),p=require("../../../../components/Button/Button.vue2.cjs");require("../../../auth/store/auth.cjs");const s=require("../../store/tickets.cjs");require("./ButtonJoin.vue2.cjs");const g=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),k={__name:"ButtonJoin",props:{type:{type:String,required:!0},userId:{type:String,required:!0},hasTicket:{type:Boolean,required:!0},targetId:{type:String,required:!0}},emits:["updateTicket"],setup(o,{emit:c}){const n=c,t=o,u=async()=>{t.hasTicket?await l(t.targetId):await d(t.targetId)};async function d(i){try{const e={type:t.type,target:i,user:t.userId},r=await s.actions.create(e);n("updateTicket",{ticket:r,hasTicket:!0,targetId:t.targetId})}catch(e){throw console.log(e),e}}async function l(i){const e={type:t.type,target:i,user:t.userId};try{const r=await s.actions.delete(e);n("updateTicket",{ticket:r,hasTicket:!1,targetId:t.targetId})}catch(r){throw console.log(r),r}}return(i,e)=>(a.openBlock(),a.createBlock(p.default,{submit:u,class:"bg-main button-small radius-extra button"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(o.hasTicket?"Leave":"Join"),1)]),_:1}))}},y=g.default(k,[["__scopeId","data-v-872ff798"]]);exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),p=require("../../../../components/Button/Button.vue.cjs");require("../../../auth/store/auth.cjs");const s=require("../../store/tickets.cjs");require("./ButtonJoin.vue2.cjs");const g=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),k={__name:"ButtonJoin",props:{type:{type:String,required:!0},userId:{type:String,required:!0},hasTicket:{type:Boolean,required:!0},targetId:{type:String,required:!0}},emits:["updateTicket"],setup(o,{emit:c}){const n=c,t=o,u=async()=>{t.hasTicket?await l(t.targetId):await d(t.targetId)};async function d(i){try{const e={type:t.type,target:i,user:t.userId},r=await s.actions.create(e);n("updateTicket",{ticket:r,hasTicket:!0,targetId:t.targetId})}catch(e){throw console.log(e),e}}async function l(i){const e={type:t.type,target:i,user:t.userId};try{const r=await s.actions.delete(e);n("updateTicket",{ticket:r,hasTicket:!1,targetId:t.targetId})}catch(r){throw console.log(r),r}}return(i,e)=>(a.openBlock(),a.createBlock(p.default,{submit:u,class:"bg-main button-small radius-extra button"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(o.hasTicket?"Leave":"Join"),1)]),_:1}))}},y=g.default(k,[["__scopeId","data-v-872ff798"]]);exports.default=y;
@@ -1,5 +1,5 @@
1
1
  import { openBlock as d, createBlock as g, withCtx as m, createTextVNode as l, toDisplayString as k } from "vue";
2
- import f from "../../../../components/Button/Button.vue2.js";
2
+ import f from "../../../../components/Button/Button.vue.js";
3
3
  import "../../../auth/store/auth.js";
4
4
  import { actions as c } from "../../store/tickets.js";
5
5
  import "./ButtonJoin.vue2.js";