@ozdao/prometheus-framework 0.2.91 → 0.2.93

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. package/dist/events.server.js +19 -9
  2. package/dist/events.server.mjs +19 -9
  3. package/dist/main-CX2ISR43.mjs +13629 -0
  4. package/dist/main-cffh4bbv.js +92 -0
  5. package/dist/main.css +1 -1
  6. package/dist/orders.server.js +32 -18
  7. package/dist/orders.server.mjs +32 -18
  8. package/dist/organizations.server.js +2 -1
  9. package/dist/organizations.server.mjs +2 -1
  10. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +46 -48
  12. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
  14. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
  16. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
  18. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
  20. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  22. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  24. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  26. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  27. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  28. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  29. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  30. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
  32. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  34. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +14 -48
  36. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  38. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +85 -25
  40. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  42. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  44. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +74 -63
  46. package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.cjs +1 -0
  47. package/dist/prometheus-framework/src/modules/landing/components/sections/SectionFeatures.vue.js +74 -0
  48. package/dist/prometheus-framework/src/modules/landing/landing.client.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/landing/landing.client.js +4 -2
  50. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  51. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
  52. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
  54. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
  55. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
  56. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
  57. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
  58. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
  60. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +28 -28
  62. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +99 -70
  64. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
  70. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +7 -9
  74. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
  76. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
  78. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
  80. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +27 -25
  82. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +11 -11
  84. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +46 -43
  86. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +162 -168
  88. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +27 -26
  90. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +7 -7
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
  100. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  102. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +37 -26
  104. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  106. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +14 -15
  110. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +22 -20
  112. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
  116. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
  120. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
  122. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
  124. package/dist/prometheus-framework.cjs.js +1 -1
  125. package/dist/prometheus-framework.es.js +1 -1
  126. package/dist/style.css +1 -1
  127. package/dist/web-CQQEUA9l.js +1 -0
  128. package/dist/web-D2Em-p-C.mjs +54 -0
  129. package/package.json +1 -1
  130. package/src/components/Address/Address.vue +23 -34
  131. package/src/components/LocationMarker/LocationMarker.vue +6 -1
  132. package/src/components/LocationSelection/LocationSelection.vue +4 -0
  133. package/src/components/Map/Map.vue +29 -15
  134. package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
  135. package/src/modules/events/components/layouts/layoutEvents.vue +2 -59
  136. package/src/modules/events/components/pages/Events.vue +106 -23
  137. package/src/modules/events/controllers/events.controller.js +10 -7
  138. package/src/modules/globals/components/blocks/CardHeader.vue +31 -6
  139. package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
  140. package/src/modules/landing/components/pages/Farming.vue +226 -0
  141. package/src/modules/landing/components/pages/Governance.vue +3 -5
  142. package/src/modules/landing/components/pages/Home.vue +0 -3
  143. package/src/modules/landing/components/pages/Hotel.vue +1 -3
  144. package/src/modules/landing/components/pages/Page.vue +0 -3
  145. package/src/modules/landing/components/sections/Examples.vue +4 -56
  146. package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
  147. package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
  148. package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
  149. package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
  150. package/src/modules/landing/landing.client.js +3 -1
  151. package/src/modules/landing/router/landing.js +11 -0
  152. package/src/modules/marketplace/components/sections/Filters.vue +26 -23
  153. package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
  154. package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
  155. package/src/modules/orders/components/pages/Order.vue +2 -6
  156. package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
  157. package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
  158. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
  159. package/src/modules/orders/components/pages/Orders.vue +60 -11
  160. package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
  161. package/src/modules/orders/components/sections/SubscribeNewsletter.vue +2 -2
  162. package/src/modules/orders/controllers/orders.controller.js +29 -18
  163. package/src/modules/orders/models/order.model.js +8 -2
  164. package/src/modules/orders/router/orders.backoffice.router.js +3 -5
  165. package/src/modules/orders/router/orders.router.js +2 -2
  166. package/src/modules/orders/store/orders.js +3 -7
  167. package/src/modules/orders/store/shopcart.js +1 -1
  168. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
  169. package/src/modules/organizations/components/pages/Department.vue +5 -1
  170. package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
  171. package/src/modules/organizations/components/pages/Members.vue +2 -1
  172. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  173. package/src/modules/organizations/controllers/memberships.controller.js +3 -1
  174. package/src/modules/organizations/store/memberships.js +1 -1
  175. package/src/modules/products/components/blocks/CardProduct.vue +32 -22
  176. package/src/modules/products/components/pages/ProductEdit.vue +10 -13
  177. package/src/modules/products/components/pages/Products.vue +2 -0
  178. package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
  179. package/src/modules/products/store/products.js +25 -2
  180. package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
  181. package/src/modules/users/components/blocks/CardUser.vue +1 -0
  182. package/src/modules/landing/components/sections/AboutSection.vue +0 -69
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../globals/store/globals.cjs");const t=r.reactive({organization:null,positions:[],currentState:!1}),s={toggleShopcart(){t.currentState=!t.currentState},setShopcart(){try{const o=localStorage.getItem("shopcart");if(o){const i=JSON.parse(o);t.positions=i.positions,t.organization=i.organization}}catch(o){throw console.error(o),o}},addProductToCart(o,i){const e=t.positions.find(n=>n._id===o._id);e?e.quantity++:t.positions.push({_id:o._id,images:o.images,name:o.name,price:o.price,quantity:1,org_id:i}),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:i}))},removeProduct(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},decrementItemQuantity(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(i.quantity--,i.quantity<1&&t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},incrementItemQuantity(o){const i=t.positions.find(e=>e._id===o);i&&(i.quantity++,localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},resetShopcart({state:o}){o.positions=[],localStorage.removeItem("shopcart")}},a={cartTotalPrice:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.price*i.quantity,0))),cartTotalAmount:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.quantity,0))),getStoreCartState:r.computed(()=>Number(t.currentState))};r.watch(t,(o,i)=>{});exports.actions=s;exports.getters=a;exports.state=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../globals/store/globals.cjs");const t=r.reactive({organization:null,positions:[],currentState:!1}),s={toggleShopcart(){t.currentState=!t.currentState},setShopcart(){try{const o=localStorage.getItem("shopcart");if(o){const i=JSON.parse(o);t.positions=i.positions,t.organization=i.organization}}catch(o){throw console.error(o),o}},addProductToCart(o,i){const e=t.positions.find(n=>n._id===o._id);e?e.quantity++:t.positions.push({_id:o._id,images:o.images,name:o.name,price:o.price,quantity:1,org_id:i}),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:i}))},removeProduct(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},decrementItemQuantity(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(i.quantity--,i.quantity<1&&t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},incrementItemQuantity(o){const i=t.positions.find(e=>e._id===o);i&&(i.quantity++,localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},resetShopcart(){t.positions=[],localStorage.removeItem("shopcart")}},a={cartTotalPrice:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.price*i.quantity,0))),cartTotalAmount:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.quantity,0))),getStoreCartState:r.computed(()=>Number(t.currentState))};r.watch(t,(o,i)=>{});exports.actions=s;exports.getters=a;exports.state=t;
@@ -1,82 +1,82 @@
1
1
  import { reactive as s, computed as r, watch as a } from "vue";
2
2
  import "../../../../../node_modules/js-cookie/dist/js.cookie.js";
3
3
  import "../../globals/store/globals.js";
4
- const o = s({
4
+ const t = s({
5
5
  organization: null,
6
6
  positions: [],
7
7
  currentState: !1
8
8
  }), g = {
9
9
  toggleShopcart() {
10
- o.currentState = !o.currentState;
10
+ t.currentState = !t.currentState;
11
11
  },
12
12
  setShopcart() {
13
13
  try {
14
- const t = localStorage.getItem("shopcart");
15
- if (t) {
16
- const i = JSON.parse(t);
17
- o.positions = i.positions, o.organization = i.organization;
14
+ const o = localStorage.getItem("shopcart");
15
+ if (o) {
16
+ const i = JSON.parse(o);
17
+ t.positions = i.positions, t.organization = i.organization;
18
18
  }
19
- } catch (t) {
20
- throw console.error(t), t;
19
+ } catch (o) {
20
+ throw console.error(o), o;
21
21
  }
22
22
  },
23
- addProductToCart(t, i) {
24
- const e = o.positions.find(
25
- (n) => n._id === t._id
23
+ addProductToCart(o, i) {
24
+ const e = t.positions.find(
25
+ (n) => n._id === o._id
26
26
  );
27
- e ? e.quantity++ : o.positions.push({
28
- _id: t._id,
29
- images: t.images,
30
- name: t.name,
31
- price: t.price,
27
+ e ? e.quantity++ : t.positions.push({
28
+ _id: o._id,
29
+ images: o.images,
30
+ name: o.name,
31
+ price: o.price,
32
32
  quantity: 1,
33
33
  org_id: i
34
34
  // Добавляем _id организации к каждому продукту
35
35
  }), localStorage.setItem("shopcart", JSON.stringify({
36
- positions: o.positions,
36
+ positions: t.positions,
37
37
  organization: i
38
38
  // Сохраняем _id организации в корне объекта корзины
39
39
  }));
40
40
  },
41
- removeProduct(t) {
42
- const i = o.positions.find(
43
- (n) => n._id === t
44
- ), e = o.positions.indexOf(i);
45
- e > -1 && (o.positions.splice(e, 1), localStorage.setItem("shopcart", JSON.stringify({
46
- positions: o.positions,
47
- organization: o.organization
41
+ removeProduct(o) {
42
+ const i = t.positions.find(
43
+ (n) => n._id === o
44
+ ), e = t.positions.indexOf(i);
45
+ e > -1 && (t.positions.splice(e, 1), localStorage.setItem("shopcart", JSON.stringify({
46
+ positions: t.positions,
47
+ organization: t.organization
48
48
  })));
49
49
  },
50
- decrementItemQuantity(t) {
51
- const i = o.positions.find(
52
- (n) => n._id === t
53
- ), e = o.positions.indexOf(i);
54
- e > -1 && (i.quantity--, i.quantity < 1 && o.positions.splice(e, 1), localStorage.setItem("shopcart", JSON.stringify({
55
- positions: o.positions,
56
- organization: o.organization
50
+ decrementItemQuantity(o) {
51
+ const i = t.positions.find(
52
+ (n) => n._id === o
53
+ ), e = t.positions.indexOf(i);
54
+ e > -1 && (i.quantity--, i.quantity < 1 && t.positions.splice(e, 1), localStorage.setItem("shopcart", JSON.stringify({
55
+ positions: t.positions,
56
+ organization: t.organization
57
57
  })));
58
58
  },
59
- incrementItemQuantity(t) {
60
- const i = o.positions.find(
61
- (e) => e._id === t
59
+ incrementItemQuantity(o) {
60
+ const i = t.positions.find(
61
+ (e) => e._id === o
62
62
  );
63
63
  i && (i.quantity++, localStorage.setItem("shopcart", JSON.stringify({
64
- positions: o.positions,
65
- organization: o.organization
64
+ positions: t.positions,
65
+ organization: t.organization
66
66
  })));
67
67
  },
68
- resetShopcart({ state: t }) {
68
+ resetShopcart() {
69
69
  t.positions = [], localStorage.removeItem("shopcart");
70
70
  }
71
71
  }, u = {
72
- cartTotalPrice: r(() => Number(o.positions.reduce((t, i) => t + i.price * i.quantity, 0))),
73
- cartTotalAmount: r(() => Number(o.positions.reduce((t, i) => t + i.quantity, 0))),
74
- getStoreCartState: r(() => Number(o.currentState))
72
+ cartTotalPrice: r(() => Number(t.positions.reduce((o, i) => o + i.price * i.quantity, 0))),
73
+ cartTotalAmount: r(() => Number(t.positions.reduce((o, i) => o + i.quantity, 0))),
74
+ getStoreCartState: r(() => Number(t.currentState))
75
75
  };
76
- a(o, (t, i) => {
76
+ a(t, (o, i) => {
77
77
  });
78
78
  export {
79
79
  g as actions,
80
80
  u as getters,
81
- o as state
81
+ t as state
82
82
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("../../../icons/navigation/IconEdit.vue.cjs");require("../../../../components/Spoiler/Spoiler.vue.cjs");require("./DepartmentSub.vue2.cjs");const d=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),u=require("../../../users/components/blocks/CardUser.vue.cjs");require("./CardDepartment.vue2.cjs");const c={class:"radius-semi o-hidden cols-2-1_3"},m={class:"pd-medium w-100"},p=["innerHTML"],k={key:0},_={__name:"CardDepartment",props:{department:Object,organization:Object},setup(t){const n=t;return(o,a)=>{const s=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",m,[e.createVNode(s,{to:{name:"Department Edit",params:{_id:n.organization,department:t.department._id}},class:"cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"},{default:e.withCtx(()=>[e.createVNode(l.default,{class:"i-regular",classes:"fill-white"})]),_:1},8,["to"]),e.createElementVNode("h3",{onClick:a[0]||(a[0]=r=>o.$router.push(`/organizations/${n.organization}/departments/${t.department._id}`)),class:"mn-b-small w-100",innerHTML:t.department.profile.name},null,8,p),e.createElementVNode("ul",null,[t.department.members.length<1?(e.openBlock(),e.createElementBlock("li",k,"No members in department")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.department.members,(r,i)=>(e.openBlock(),e.createBlock(u.default,{class:"br-b br-solid br-grey",key:i,user:r.user,position:r.position,onClick:g=>o.$router.push(`/app/profile/${r.user._id}`)},null,8,["user","position","onClick"]))),128))])])])}}},b=d.default(_,[["__scopeId","data-v-5cb387b9"]]);exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("../../../icons/navigation/IconEdit.vue.cjs");require("../../../../components/Spoiler/Spoiler.vue.cjs");require("./DepartmentSub.vue2.cjs");const u=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),d=require("../../../users/components/blocks/CardUser.vue.cjs");require("./CardDepartment.vue2.cjs");const c={class:"radius-semi o-hidden cols-2-1_3"},p={class:"pd-medium w-100"},m=["innerHTML"],_={key:0},h={__name:"CardDepartment",props:{department:Object,organization:Object},setup(r){const o=r;return(n,s)=>{const a=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("div",p,[e.createVNode(a,{to:{name:"Department Edit",params:{_id:o.organization,department:r.department._id}},class:"cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"},{default:e.withCtx(()=>[e.createVNode(l.default,{class:"i-regular",classes:"fill-white"})]),_:1},8,["to"]),e.createElementVNode("h3",{onClick:s[0]||(s[0]=t=>n.$router.push(`/organizations/${o.organization}/departments/${r.department._id}`)),class:"mn-b-small w-100",innerHTML:r.department.profile.name},null,8,m),e.createElementVNode("ul",null,[r.department.members.length<1?(e.openBlock(),e.createElementBlock("li",_,"No members in department")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.department.members,(t,i)=>(e.openBlock(),e.createBlock(d.default,{class:"br-b br-solid br-grey",key:i,user:t.user,photo:t.user.profile.photo,name:t.user.profile.name||t.user.phone||t.user.email||t.user._id,position:t.position,onClick:g=>n.$router.push(`/app/profile/${t.user._id}`)},null,8,["user","photo","name","position","onClick"]))),128))])])])}}},k=u.default(h,[["__scopeId","data-v-213d8146"]]);exports.default=k;
@@ -1,60 +1,62 @@
1
- import { resolveComponent as p, openBlock as r, createElementBlock as n, createElementVNode as o, createVNode as m, withCtx as c, createCommentVNode as u, Fragment as _, renderList as f, createBlock as b } from "vue";
1
+ import { resolveComponent as m, openBlock as r, createElementBlock as o, createElementVNode as n, createVNode as l, withCtx as u, createCommentVNode as c, Fragment as _, renderList as f, createBlock as h } from "vue";
2
2
  import g from "../../../icons/navigation/IconEdit.vue.js";
3
3
  import "../../../../components/Spoiler/Spoiler.vue.js";
4
4
  import "./DepartmentSub.vue2.js";
5
- import h from "../../../../../../_virtual/_plugin-vue_export-helper.js";
6
- import k from "../../../users/components/blocks/CardUser.vue.js";
5
+ import k from "../../../../../../_virtual/_plugin-vue_export-helper.js";
6
+ import $ from "../../../users/components/blocks/CardUser.vue.js";
7
7
  import "./CardDepartment.vue2.js";
8
- const $ = { class: "radius-semi o-hidden cols-2-1_3" }, C = { class: "pd-medium w-100" }, v = ["innerHTML"], w = { key: 0 }, z = {
8
+ const C = { class: "radius-semi o-hidden cols-2-1_3" }, v = { class: "pd-medium w-100" }, b = ["innerHTML"], w = { key: 0 }, z = {
9
9
  __name: "CardDepartment",
10
10
  props: {
11
11
  department: Object,
12
12
  organization: Object
13
13
  },
14
- setup(e) {
15
- const s = e;
14
+ setup(t) {
15
+ const s = t;
16
16
  return (i, a) => {
17
- const l = p("router-link");
18
- return r(), n("div", $, [
19
- o("div", C, [
20
- m(l, {
17
+ const p = m("router-link");
18
+ return r(), o("div", C, [
19
+ n("div", v, [
20
+ l(p, {
21
21
  to: {
22
22
  name: "Department Edit",
23
23
  params: {
24
24
  _id: s.organization,
25
- department: e.department._id
25
+ department: t.department._id
26
26
  }
27
27
  },
28
28
  class: "cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"
29
29
  }, {
30
- default: c(() => [
31
- m(g, {
30
+ default: u(() => [
31
+ l(g, {
32
32
  class: "i-regular",
33
33
  classes: "fill-white"
34
34
  })
35
35
  ]),
36
36
  _: 1
37
37
  }, 8, ["to"]),
38
- o("h3", {
39
- onClick: a[0] || (a[0] = (t) => i.$router.push(`/organizations/${s.organization}/departments/${e.department._id}`)),
38
+ n("h3", {
39
+ onClick: a[0] || (a[0] = (e) => i.$router.push(`/organizations/${s.organization}/departments/${t.department._id}`)),
40
40
  class: "mn-b-small w-100",
41
- innerHTML: e.department.profile.name
42
- }, null, 8, v),
43
- o("ul", null, [
44
- e.department.members.length < 1 ? (r(), n("li", w, "No members in department")) : u("", !0),
45
- (r(!0), n(_, null, f(e.department.members, (t, d) => (r(), b(k, {
41
+ innerHTML: t.department.profile.name
42
+ }, null, 8, b),
43
+ n("ul", null, [
44
+ t.department.members.length < 1 ? (r(), o("li", w, "No members in department")) : c("", !0),
45
+ (r(!0), o(_, null, f(t.department.members, (e, d) => (r(), h($, {
46
46
  class: "br-b br-solid br-grey",
47
47
  key: d,
48
- user: t.user,
49
- position: t.position,
50
- onClick: (N) => i.$router.push(`/app/profile/${t.user._id}`)
51
- }, null, 8, ["user", "position", "onClick"]))), 128))
48
+ user: e.user,
49
+ photo: e.user.profile.photo,
50
+ name: e.user.profile.name || e.user.phone || e.user.email || e.user._id,
51
+ position: e.position,
52
+ onClick: (N) => i.$router.push(`/app/profile/${e.user._id}`)
53
+ }, null, 8, ["user", "photo", "name", "position", "onClick"]))), 128))
52
54
  ])
53
55
  ])
54
56
  ]);
55
57
  };
56
58
  }
57
- }, j = /* @__PURE__ */ h(z, [["__scopeId", "data-v-5cb387b9"]]);
59
+ }, j = /* @__PURE__ */ k(z, [["__scopeId", "data-v-213d8146"]]);
58
60
  export {
59
61
  j as default
60
62
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const b=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),f=require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue.cjs");const v=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../users/components/blocks/CardUser.vue.cjs"),k=require("../../store/memberships.cjs");require("../../../middlewares/client/inputs.validation.cjs");require("./DepartmentMemberModify.vue2.cjs");const g={class:"br-grey radius-small mn-small"},y={class:"bg-grey mn-b-thin h-min-10r h-max-10r o-scroll pd-medium radius-big"},_=["disabled"],q={__name:"DepartmentMemberModify",props:{isPopupOpen:Boolean,member:Number,members:Array,users:Array},emits:["callback","remove"],setup(i,{emit:m}){const r=i,u=m,n=e.ref(null),l=e.ref(null);r.member!==null&&(n.value=r.members[r.member]),e.ref(null);async function c(){r.member!==null?(r.members[r.member]=n,r.members[r.member].role=l.value,u("callback")):(r.members.push({...n.value,role:l.value}),u("callback"))}async function d(){r.members.splice(r.member,1),u("callback")}return(s,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",g,[e.createElementVNode("div",y,[e.createVNode(v.default,{states:{empty:{title:"No Members Found",description:"Currently, there are no members available."}},store:{read:o=>k.actions.read(o),state:null},options:{target:s.$route.params._id}},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(t,p)=>(e.openBlock(),e.createBlock(h.default,{key:p,photo:t.user.profile.photo,name:t.user.profile.name||t.user.phone||t.user.email||t.user._id,user:t,position:t.position,onClick:a[0]||(a[0]=N=>s.$router.push(`/app/profile/${s.user._id}`)),class:"mn-b-thin"},null,8,["photo","name","user","position"]))),128))]),_:1},8,["store","options"])]),e.createVNode(f.default,{field:l.value,"onUpdate:field":a[1]||(a[1]=o=>l.value=o),label:"Должность",placeholder:"Название должности",class:"bg-white",validation:s.organizationName},null,8,["field","validation"])]),e.createElementVNode("button",{disabled:!n.value||!l.value,onClick:c,class:"w-100 button bg-blue t-white"},e.toDisplayString(r.member!==null?"Редактировать участника":"Добавить участника"),9,_),r.member!==null?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d,class:"w-100 button bg-red t-white"}," Удалить участника ")):e.createCommentVNode("",!0)]))}},B=b.default(q,[["__scopeId","data-v-0d6c0d38"]]);exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const p=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),f=require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");const v=require("../../../../components/Feed/Feed.vue.cjs"),h=require("../../../users/components/blocks/CardUser.vue.cjs"),k=require("../../store/memberships.cjs");require("../../../middlewares/client/inputs.validation.cjs");require("./DepartmentMemberModify.vue2.cjs");const g={class:"br-grey radius-small mn-small"},y={class:"bg-grey mn-b-thin h-min-10r h-max-10r o-scroll pd-medium radius-big"},_=["disabled"],q={__name:"DepartmentMemberModify",props:{isPopupOpen:Boolean,member:Number,members:Array,users:Array},emits:["callback","remove"],setup(i,{emit:m}){const r=i,u=m,n=e.ref(null),t=e.ref(null);r.member!==null&&(n.value=r.members[r.member]),e.ref(null);async function c(){r.member!==null?(r.members[r.member]=n,r.members[r.member].role=t.value,u("callback")):(r.members.push({...n.value,role:t.value}),u("callback"))}async function d(){r.members.splice(r.member,1),u("callback")}return(s,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",g,[e.createElementVNode("div",y,[e.createVNode(v.default,{states:{empty:{title:"No Members Found",description:"Currently, there are no members available."}},store:{read:o=>k.actions.read(o),state:null},options:{target:s.$route.params._id}},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(l,b)=>(e.openBlock(),e.createBlock(h.default,{key:b,photo:l.user.profile.photo,name:l.user.profile.name||l.user.phone||l.user.email||l.user._id,user:l,position:l.position,onClick:a[0]||(a[0]=N=>s.$router.push(`/app/profile/${s.user._id}`)),class:"mn-b-thin"},null,8,["photo","name","user","position"]))),128))]),_:1},8,["store","options"])]),e.createVNode(f.default,{field:t.value,"onUpdate:field":a[1]||(a[1]=o=>t.value=o),label:"Должность",placeholder:"Название должности",class:"bg-white",validation:s.organizationName},null,8,["field","validation"])]),e.createElementVNode("button",{disabled:!n.value||!t.value,onClick:c,class:"w-100 button bg-blue t-white"},e.toDisplayString(r.member!==null?"Редактировать участника":"Добавить участника"),9,_),r.member!==null?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d,class:"w-100 button bg-red t-white"}," Удалить участника ")):e.createCommentVNode("",!0)]))}},B=p.default(q,[["__scopeId","data-v-0d6c0d38"]]);exports.default=B;
@@ -1,14 +1,14 @@
1
1
  import { ref as i, openBlock as n, createElementBlock as u, createElementVNode as p, createVNode as b, withCtx as _, Fragment as y, renderList as k, createBlock as g, toDisplayString as w, createCommentVNode as C } from "vue";
2
2
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
3
- import N from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
- import $ from "../../../../components/Field/Field.vue.js";
5
- import "../../../../components/Select/Select.vue.js";
6
- import M from "../../../../components/Feed/Feed.vue.js";
3
+ import M from "../../../../../../_virtual/_plugin-vue_export-helper.js";
4
+ import N from "../../../../components/Field/Field.vue.js";
5
+ import "../../../../components/Select/Select.vue2.js";
6
+ import $ from "../../../../components/Feed/Feed.vue.js";
7
7
  import B from "../../../users/components/blocks/CardUser.vue.js";
8
- import { actions as D } from "../../store/memberships.js";
8
+ import { actions as F } from "../../store/memberships.js";
9
9
  import "../../../middlewares/client/inputs.validation.js";
10
10
  import "./DepartmentMemberModify.vue2.js";
11
- const F = { class: "br-grey radius-small mn-small" }, I = { class: "bg-grey mn-b-thin h-min-10r h-max-10r o-scroll pd-medium radius-big" }, V = ["disabled"], A = {
11
+ const D = { class: "br-grey radius-small mn-small" }, I = { class: "bg-grey mn-b-thin h-min-10r h-max-10r o-scroll pd-medium radius-big" }, V = ["disabled"], A = {
12
12
  __name: "DepartmentMemberModify",
13
13
  props: {
14
14
  isPopupOpen: Boolean,
@@ -27,9 +27,9 @@ const F = { class: "br-grey radius-small mn-small" }, I = { class: "bg-grey mn-b
27
27
  e.members.splice(e.member, 1), a("callback");
28
28
  }
29
29
  return (s, m) => (n(), u("div", null, [
30
- p("div", F, [
30
+ p("div", D, [
31
31
  p("div", I, [
32
- b(M, {
32
+ b($, {
33
33
  states: {
34
34
  empty: {
35
35
  title: "No Members Found",
@@ -37,7 +37,7 @@ const F = { class: "br-grey radius-small mn-small" }, I = { class: "bg-grey mn-b
37
37
  }
38
38
  },
39
39
  store: {
40
- read: (t) => D.read(t),
40
+ read: (t) => F.read(t),
41
41
  state: null
42
42
  },
43
43
  options: {
@@ -60,7 +60,7 @@ const F = { class: "br-grey radius-small mn-small" }, I = { class: "bg-grey mn-b
60
60
  _: 1
61
61
  }, 8, ["store", "options"])
62
62
  ]),
63
- b($, {
63
+ b(N, {
64
64
  field: o.value,
65
65
  "onUpdate:field": m[1] || (m[1] = (t) => o.value = t),
66
66
  label: "Должность",
@@ -81,7 +81,7 @@ const F = { class: "br-grey radius-small mn-small" }, I = { class: "bg-grey mn-b
81
81
  }, " Удалить участника ")) : C("", !0)
82
82
  ]));
83
83
  }
84
- }, H = /* @__PURE__ */ N(A, [["__scopeId", "data-v-0d6c0d38"]]);
84
+ }, H = /* @__PURE__ */ M(A, [["__scopeId", "data-v-0d6c0d38"]]);
85
85
  export {
86
86
  H as default
87
87
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router");require("../../../../components/Spoiler/Spoiler.vue.cjs");const u=require("../blocks/DepartmentSub.vue.cjs"),p=require("../../../users/components/blocks/CardUser.vue.cjs"),t=require("../../store/departments.cjs"),_={class:"for-transition w-100"},h={key:0,id:"dash",class:"pd-medium bg-grey"},k={class:"mn-b-medium radius-medium pd-semi bg-white"},b={class:"flex-nowrap flex mn-b-small"},g={class:"w-100"},E=["innerHTML"],B={class:"mn-b-medium radius-medium pd-semi bg-white"},N=e.createElementVNode("h3",{class:"mn-b-regular"},"Команда",-1),V={key:0},f={class:"mn-b-medium radius-medium pd-semi bg-white"},y=e.createElementVNode("h3",{class:"mn-b-regular"},"Подотделы",-1),C={key:0},v={__name:"Department",async setup(w){let s,a;c.useRouter();const n=c.useRoute();return[s,a]=e.withAsyncContext(()=>t.actions.readOne(n.params.department)),await s,a(),(l,q)=>{const i=e.resolveComponent("IconEdit"),d=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",_,[t.state.department?(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("section",k,[e.createElementVNode("div",b,[e.createElementVNode("h2",g,e.toDisplayString(t.state.department.profile.name),1),e.createVNode(d,{to:{name:"Department Edit",params:{_id:e.unref(n).params._id,department:e.unref(n).params.department}},class:"cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"},{default:e.withCtx(()=>[e.createVNode(i,{class:"i-regular",classes:"fill-white"})]),_:1},8,["to"])]),e.createElementVNode("p",{class:"t-transp p-big",innerHTML:t.state.department.description},null,8,E)]),e.createElementVNode("section",B,[N,e.createElementVNode("ul",null,[t.state.department.members.length<1?(e.openBlock(),e.createElementBlock("li",V,"В отделе еще нет участников")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.members,(r,o)=>(e.openBlock(),e.createBlock(p.default,{class:"br-b br-solid br-grey",key:o,user:r,position:r.position,onClick:m=>l.$router.push(`/app/profile/${r.user._id}`)},null,8,["user","position","onClick"]))),128))])]),e.createElementVNode("section",f,[y,e.createElementVNode("ul",null,[t.state.department.subdepartments.length<1?(e.openBlock(),e.createElementBlock("li",C,"В отделе еще нет подотделов")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.subdepartments,(r,o)=>(e.openBlock(),e.createBlock(u.default,{onClick:m=>l.$router.push(`/app/organization/departments/${r._id}`),key:o,class:"br-b br-solid br-grey",department:r},null,8,["onClick","department"]))),128))])])])):e.createCommentVNode("",!0)])}}};exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("vue-router");require("../../../../components/Spoiler/Spoiler.vue.cjs");const u=require("../blocks/DepartmentSub.vue.cjs"),m=require("../../../users/components/blocks/CardUser.vue.cjs"),r=require("../../store/departments.cjs"),p=require("../../../icons/navigation/IconEdit.vue.cjs"),_={class:"for-transition w-100"},h={key:0,id:"dash",class:"pd-medium bg-grey"},k={class:"mn-b-medium radius-medium pd-semi bg-white"},g={class:"flex-nowrap flex mn-b-small"},b={class:"w-100"},E=["innerHTML"],f={class:"mn-b-medium radius-medium pd-semi bg-white"},B=e.createElementVNode("h3",{class:"mn-b-regular"},"Команда",-1),N={key:0},V={class:"mn-b-medium radius-medium pd-semi bg-white"},y=e.createElementVNode("h3",{class:"mn-b-regular"},"Подотделы",-1),C={key:0},v={__name:"Department",async setup(w){let s,a;i.useRouter();const n=i.useRoute();return[s,a]=e.withAsyncContext(()=>r.actions.readOne(n.params.department)),await s,a(),(l,q)=>{const c=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",_,[r.state.department?(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("section",k,[e.createElementVNode("div",g,[e.createElementVNode("h2",b,e.toDisplayString(r.state.department.profile.name),1),e.createVNode(c,{to:{name:"Department Edit",params:{_id:e.unref(n).params._id,department:e.unref(n).params.department}},class:"cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"},{default:e.withCtx(()=>[e.createVNode(p.default,{class:"i-regular",classes:"fill-white"})]),_:1},8,["to"])]),e.createElementVNode("p",{class:"t-transp p-big",innerHTML:r.state.department.description},null,8,E)]),e.createElementVNode("section",f,[B,e.createElementVNode("ul",null,[r.state.department.members.length<1?(e.openBlock(),e.createElementBlock("li",N,"В отделе еще нет участников")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.state.department.members,(t,o)=>(e.openBlock(),e.createBlock(m.default,{class:"br-b br-solid br-grey",key:o,user:t.user,photo:t.user.profile.photo,name:t.user.profile.name||t.user.phone||t.user.email||t.user._id,position:t.position,onClick:d=>l.$router.push(`/app/profile/${t.user._id}`)},null,8,["user","photo","name","position","onClick"]))),128))])]),e.createElementVNode("section",V,[y,e.createElementVNode("ul",null,[r.state.department.subdepartments.length<1?(e.openBlock(),e.createElementBlock("li",C,"В отделе еще нет подотделов")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.state.department.subdepartments,(t,o)=>(e.openBlock(),e.createBlock(u.default,{onClick:d=>l.$router.push(`/app/organization/departments/${t._id}`),key:o,class:"br-b br-solid br-grey",department:t},null,8,["onClick","department"]))),128))])])])):e.createCommentVNode("",!0)])}}};exports.default=v;
@@ -1,38 +1,39 @@
1
- import { withAsyncContext as y, resolveComponent as p, openBlock as t, createElementBlock as n, createElementVNode as e, toDisplayString as w, createVNode as c, unref as u, withCtx as C, createCommentVNode as a, Fragment as _, renderList as h, createBlock as b } from "vue";
2
- import { useRouter as $, useRoute as v } from "vue-router";
1
+ import { withAsyncContext as b, resolveComponent as k, openBlock as s, createElementBlock as o, createElementVNode as t, toDisplayString as y, createVNode as d, unref as u, withCtx as w, createCommentVNode as a, Fragment as c, renderList as _, createBlock as h } from "vue";
2
+ import { useRouter as C, useRoute as $ } from "vue-router";
3
3
  import "../../../../components/Spoiler/Spoiler.vue.js";
4
- import x from "../blocks/DepartmentSub.vue.js";
5
- import E from "../../../users/components/blocks/CardUser.vue.js";
6
- import { actions as D, state as s } from "../../store/departments.js";
7
- const B = { class: "for-transition w-100" }, L = {
4
+ import v from "../blocks/DepartmentSub.vue.js";
5
+ import x from "../../../users/components/blocks/CardUser.vue.js";
6
+ import { actions as D, state as r } from "../../store/departments.js";
7
+ import B from "../../../icons/navigation/IconEdit.vue.js";
8
+ const E = { class: "for-transition w-100" }, L = {
8
9
  key: 0,
9
10
  id: "dash",
10
11
  class: "pd-medium bg-grey"
11
- }, N = { class: "mn-b-medium radius-medium pd-semi bg-white" }, V = { class: "flex-nowrap flex mn-b-small" }, H = { class: "w-100" }, I = ["innerHTML"], M = { class: "mn-b-medium radius-medium pd-semi bg-white" }, R = /* @__PURE__ */ e("h3", { class: "mn-b-regular" }, "Команда", -1), S = { key: 0 }, T = { class: "mn-b-medium radius-medium pd-semi bg-white" }, z = /* @__PURE__ */ e("h3", { class: "mn-b-regular" }, "Подотделы", -1), A = { key: 0 }, Q = {
12
+ }, N = { class: "mn-b-medium radius-medium pd-semi bg-white" }, V = { class: "flex-nowrap flex mn-b-small" }, H = { class: "w-100" }, M = ["innerHTML"], R = { class: "mn-b-medium radius-medium pd-semi bg-white" }, S = /* @__PURE__ */ t("h3", { class: "mn-b-regular" }, "Команда", -1), T = { key: 0 }, z = { class: "mn-b-medium radius-medium pd-semi bg-white" }, A = /* @__PURE__ */ t("h3", { class: "mn-b-regular" }, "Подотделы", -1), F = { key: 0 }, U = {
12
13
  __name: "Department",
13
- async setup(F) {
14
- let m, l;
15
- $();
16
- const o = v();
17
- return [m, l] = y(() => D.readOne(o.params.department)), await m, l(), (d, O) => {
18
- const g = p("IconEdit"), f = p("router-link");
19
- return t(), n("div", B, [
20
- s.department ? (t(), n("div", L, [
21
- e("section", N, [
22
- e("div", V, [
23
- e("h2", H, w(s.department.profile.name), 1),
24
- c(f, {
14
+ async setup(O) {
15
+ let l, p;
16
+ C();
17
+ const n = $();
18
+ return [l, p] = b(() => D.readOne(n.params.department)), await l, p(), (m, j) => {
19
+ const f = k("router-link");
20
+ return s(), o("div", E, [
21
+ r.department ? (s(), o("div", L, [
22
+ t("section", N, [
23
+ t("div", V, [
24
+ t("h2", H, y(r.department.profile.name), 1),
25
+ d(f, {
25
26
  to: {
26
27
  name: "Department Edit",
27
28
  params: {
28
- _id: u(o).params._id,
29
- department: u(o).params.department
29
+ _id: u(n).params._id,
30
+ department: u(n).params.department
30
31
  }
31
32
  },
32
33
  class: "cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"
33
34
  }, {
34
- default: C(() => [
35
- c(g, {
35
+ default: w(() => [
36
+ d(B, {
36
37
  class: "i-regular",
37
38
  classes: "fill-white"
38
39
  })
@@ -40,33 +41,35 @@ const B = { class: "for-transition w-100" }, L = {
40
41
  _: 1
41
42
  }, 8, ["to"])
42
43
  ]),
43
- e("p", {
44
+ t("p", {
44
45
  class: "t-transp p-big",
45
- innerHTML: s.department.description
46
- }, null, 8, I)
46
+ innerHTML: r.department.description
47
+ }, null, 8, M)
47
48
  ]),
48
- e("section", M, [
49
- R,
50
- e("ul", null, [
51
- s.department.members.length < 1 ? (t(), n("li", S, "В отделе еще нет участников")) : a("", !0),
52
- (t(!0), n(_, null, h(s.department.members, (r, i) => (t(), b(E, {
49
+ t("section", R, [
50
+ S,
51
+ t("ul", null, [
52
+ r.department.members.length < 1 ? (s(), o("li", T, "В отделе еще нет участников")) : a("", !0),
53
+ (s(!0), o(c, null, _(r.department.members, (e, i) => (s(), h(x, {
53
54
  class: "br-b br-solid br-grey",
54
55
  key: i,
55
- user: r,
56
- position: r.position,
57
- onClick: (k) => d.$router.push(`/app/profile/${r.user._id}`)
58
- }, null, 8, ["user", "position", "onClick"]))), 128))
56
+ user: e.user,
57
+ photo: e.user.profile.photo,
58
+ name: e.user.profile.name || e.user.phone || e.user.email || e.user._id,
59
+ position: e.position,
60
+ onClick: (g) => m.$router.push(`/app/profile/${e.user._id}`)
61
+ }, null, 8, ["user", "photo", "name", "position", "onClick"]))), 128))
59
62
  ])
60
63
  ]),
61
- e("section", T, [
62
- z,
63
- e("ul", null, [
64
- s.department.subdepartments.length < 1 ? (t(), n("li", A, "В отделе еще нет подотделов")) : a("", !0),
65
- (t(!0), n(_, null, h(s.department.subdepartments, (r, i) => (t(), b(x, {
66
- onClick: (k) => d.$router.push(`/app/organization/departments/${r._id}`),
64
+ t("section", z, [
65
+ A,
66
+ t("ul", null, [
67
+ r.department.subdepartments.length < 1 ? (s(), o("li", F, "В отделе еще нет подотделов")) : a("", !0),
68
+ (s(!0), o(c, null, _(r.department.subdepartments, (e, i) => (s(), h(v, {
69
+ onClick: (g) => m.$router.push(`/app/organization/departments/${e._id}`),
67
70
  key: i,
68
71
  class: "br-b br-solid br-grey",
69
- department: r
72
+ department: e
70
73
  }, null, 8, ["onClick", "department"]))), 128))
71
74
  ])
72
75
  ])
@@ -76,5 +79,5 @@ const B = { class: "for-transition w-100" }, L = {
76
79
  }
77
80
  };
78
81
  export {
79
- Q as default
82
+ U as default
80
83
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const B=require("../../../../components/UploadImage/UploadImage.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const g=require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue.cjs");const d=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");require("../../../../components/Address/Address.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/LocationMarker/LocationMarker.vue.cjs");const V=require("../../../../components/Button/Button.vue.cjs"),_=require("../../../../components/Popup/Popup.vue.cjs"),w=require("../../../../components/Block/Block.vue.cjs");require("../blocks/EditArray.vue2.cjs");const C=require("../blocks/DepartmentSub.vue.cjs"),k=require("../blocks/DepartmentMemberModify.vue.cjs"),x=require("../../../users/components/blocks/CardUser.vue.cjs"),t=require("../../store/departments.cjs"),c=require("../../store/memberships.cjs"),U={class:"for-transition pd-thin w-100"},O={class:"mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big"},M={key:0,class:"mn-r-auto"},R={key:1,class:"mn-r-auto"},S={class:"flex-nowrap flex pd-thin"},T={class:"cols-2-fit-content"},z={class:"w-100 flex-child-grow-1 flex-child"},A={class:"cols-2 gap-thin"},F={class:"bg-grey pd-medium o-hidden radius-big"},$=e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1),L=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1),j={class:"cols-1 gap-thin"},H=e.createElementVNode("h4",null,"Products",-1),I={class:"bg-grey pd-medium o-hidden radius-big"},G=e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1),J=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1),K={class:"cols-1 gap-thin"},Q=e.createElementVNode("h4",null,"Products",-1),W=e.createElementVNode("h4",null,"Orders",-1),X=e.createElementVNode("h4",null,"Departments",-1),Y={key:1,class:"flex-nowrap flex pd-thin"},Z={id:"dash",class:"pd-medium bg-white"},ee={class:"mn-b-regular flex-v-center flex-nowrap flex"},te=e.createElementVNode("h3",{class:"mn-r-small"},"Подотделы ",-1),ae={class:"mn-b-small"},se={key:0},re={__name:"DepartmentEdit",setup(de){const v=N.useRouter(),r=N.useRoute();async function E(){r.params.department&&await c.actions.read({target:r.params._id}),e.ref(c.state.memberships),r.params.department&&await t.actions.readOne(r.params.department)}E();const o=e.ref(!1),i=e.ref(null);function u(n){o.value=!0,typeof n=="number"&&(i.value=n)}function f(){o.value=!1,i.value=null}const m=e.ref(!1),p=e.ref(null);function b(n){m.value=!0,typeof n=="number"&&(p.value=n)}function h(){m.value=!1,p.value=null}async function D(){r.params.department&&await t.actions.update(r.params._id,t.state.department),r.params.department||await t.actions.create(r.params._id,t.state.department)}function q(){v.replace({name:"Department",params:{_id:r.params._id,department:t.state.department._id}})}async function P(){await t.actions.delete(r.params._id,t.state.department)}return(n,a)=>(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("header",O,[e.unref(r).params.department?(e.openBlock(),e.createElementBlock("h1",M,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",R,"Create Department")),e.createElementVNode("section",S,[e.createVNode(V.default,{submit:D,callback:q,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save Department")]),_:1})])]),t.state.department.profile?(e.openBlock(),e.createBlock(w.default,{key:0,title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",T,[e.createVNode(B.default,{photo:t.state.department.profile.photo,"onUpdate:photo":a[0]||(a[0]=s=>t.state.department.profile.photo=s),uploadPath:"organizations/"+t.state.department.name+"/avatars",class:"w-8r aspect-1x1 o-hidden mn-r-small radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",z,[e.createVNode(g.default,{field:t.state.department.profile.name,"onUpdate:field":a[1]||(a[1]=s=>t.state.department.profile.name=s),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:n.organizationName},null,8,["field","validation"]),e.createVNode(g.default,{field:t.state.department.profile.description,"onUpdate:field":a[2]||(a[2]=s=>t.state.department.profile.description=s),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:n.organizationName},null,8,["field","validation"])])])]),_:1})):e.createCommentVNode("",!0),e.createVNode(w.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>u()}],class:"cols-1 gap-thin mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.members,(s,l)=>(e.openBlock(),e.createBlock(x.default,{class:"bg-grey o-hidden radius-small mn-b-thin",key:l,user:s.user,photo:s.user.profile.photo,name:s.user.profile.name||s.user.phone||s.user.email||s.user._id,position:s.position,onClick:y=>u(l)},null,8,["user","photo","name","position","onClick"]))),128))]),_:1},8,["actions"]),e.createVNode(_.default,{title:"Add member",onClosePopup:f,isPopupOpen:o.value,class:"bg-white w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(k.default,{members:t.state.department.members,member:i.value,users:c.state.memberships,onCallback:f},null,8,["members","member","users"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",A,[e.createElementVNode("div",F,[$,L,e.createElementVNode("div",j,[H,e.createVNode(d.default,{label:"Hidden department",name:"hidden",class:"w-100 mn-r-small bg-white radius-small pd-small","onUpdate:radio":a[3]||(a[3]=s=>t.state.department.hidden=!t.state.department.hidden),radio:t.state.department.hidden},null,8,["radio"])])]),e.createElementVNode("div",I,[G,J,e.createElementVNode("div",K,[Q,e.createVNode(d.default,{label:"Read products",name:"readProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.read,"onUpdate:radio":a[4]||(a[4]=s=>t.state.department.accesses.products.read=!t.state.department.accesses.products.read)},null,8,["radio"]),e.createVNode(d.default,{label:"Edit products",name:"editProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.edit,"onUpdate:radio":a[5]||(a[5]=s=>t.state.department.accesses.products.edit=!t.state.department.accesses.products.edit)},null,8,["radio"]),e.createVNode(d.default,{label:"Delete products",name:"deleteProducts",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.products.delete,"onUpdate:radio":a[6]||(a[6]=s=>t.state.department.accesses.products.delete=!t.state.department.accesses.products.delete)},null,8,["radio"]),W,e.createVNode(d.default,{label:"Read orders",name:"readOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.read,"onUpdate:radio":a[7]||(a[7]=s=>t.state.department.accesses.orders.read=!t.state.department.accesses.orders.read)},null,8,["radio"]),e.createVNode(d.default,{label:"Confirm orders",name:"confirmOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.confirm,"onUpdate:radio":a[8]||(a[8]=s=>t.state.department.accesses.orders.confirm=!t.state.department.accesses.orders.confirm)},null,8,["radio"]),e.createVNode(d.default,{label:"Delete orders",name:"deleteOrders",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.orders.delete,"onUpdate:radio":a[9]||(a[9]=s=>t.state.department.accesses.orders.delete=!t.state.department.accesses.orders.delete)},null,8,["radio"]),X,e.createVNode(d.default,{label:"Read departments",name:"readDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.read,"onUpdate:radio":a[10]||(a[10]=s=>t.state.department.accesses.departments.read=!t.state.department.accesses.departments.read)},null,8,["radio"]),e.createVNode(d.default,{label:"Edit departments",name:"editDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.edit,"onUpdate:radio":a[11]||(a[11]=s=>t.state.department.accesses.departments.edit=!t.state.department.accesses.departments.edit)},null,8,["radio"]),e.createVNode(d.default,{label:"Delete departments",name:"deleteDepartments",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.departments.delete,"onUpdate:radio":a[12]||(a[12]=s=>t.state.department.accesses.departments.delete=!t.state.department.accesses.departments.delete)},null,8,["radio"])])])]),e.unref(r).params.department?(e.openBlock(),e.createElementBlock("section",Y,[e.createVNode(V.default,{submit:P,callback:n.redirectToDash,class:"bg-grey"},{default:e.withCtx(()=>[e.createTextVNode("Delete Department")]),_:1},8,["callback"])])):e.createCommentVNode("",!0),e.createElementVNode("div",Z,[e.createVNode(_.default,{title:"Добавить подотдел",onClosePopup:h,isPopupOpen:m.value},{default:e.withCtx(()=>[e.createVNode(k.default,{departments:t.state.department.subdepartments,department:p.value,maindepartment:t.state.department,alldepartments:t.state.departments,onCallback:h},null,8,["departments","department","maindepartment","alldepartments"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",ee,[te,e.createElementVNode("div",null,[e.createElementVNode("a",{class:"t-main h5",onClick:a[13]||(a[13]=s=>b())},"+")])]),e.createElementVNode("ul",ae,[t.state.department.subdepartments.length<1?(e.openBlock(),e.createElementBlock("li",se,"В отделе еще нет подотделов")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.subdepartments,(s,l)=>(e.openBlock(),e.createBlock(C.default,{key:l,class:"bg-grey o-hidden radius-small mn-b-thin",department:s,onClick:y=>b(l)},null,8,["department","onClick"]))),128))])])]))}};exports.default=re;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const x=require("../../../../components/UploadImage/UploadImage.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const u=require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");const o=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");require("../../../../components/Address/Address.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/LocationMarker/LocationMarker.vue.cjs");const f=require("../../../../components/Button/Button.vue.cjs"),B=require("../../../../components/Popup/Popup.vue.cjs"),h=require("../../../../components/Block/Block.vue.cjs"),D=require("../../../../components/Feed/Feed.vue.cjs");require("../blocks/EditArray.vue2.cjs");require("../blocks/DepartmentSub.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const b=require("../../../users/components/blocks/CardUser.vue.cjs"),g=require("../../store/memberships.cjs");require("../../../middlewares/client/inputs.validation.cjs");require("../blocks/DepartmentMemberModify.vue2.cjs");const w=require("../../../globals/store/globals.cjs"),t=require("../../store/departments.cjs"),P={class:"for-transition pd-thin w-100"},C={class:"mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big"},U={key:0,class:"mn-r-auto"},O={key:1,class:"mn-r-auto"},M={class:"flex-nowrap flex gap-thin pd-thin"},R={class:"cols-2-fit-content"},S={class:"w-100 flex-child-grow-1 flex-child"},T={class:"cols-2 gap-thin"},A={class:"bg-grey pd-medium o-hidden radius-big"},F=e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1),z=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1),L={class:"cols-1 gap-thin"},j=e.createElementVNode("h4",null,"Products",-1),H={class:"bg-grey pd-medium o-hidden radius-big"},I=e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1),G=e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1),J={class:"cols-1 gap-thin"},K=e.createElementVNode("h4",null,"Products",-1),Q=e.createElementVNode("h4",null,"Orders",-1),W=e.createElementVNode("h4",null,"Departments",-1),X={__name:"DepartmentEdit",setup(Y){const N=c.useRouter(),r=c.useRoute();async function _(){e.ref(g.state.memberships),r.params.department&&await t.actions.readOne(r.params.department)}_();const n=e.ref(!1),V=e.ref(null);function k(l){n.value=!0}function i(){n.value=!1,V.value=null}e.ref(!1),e.ref(null);async function q(){r.params.department&&await t.actions.update(r.params._id,t.state.department),r.params.department||await t.actions.create(r.params._id,t.state.department)}function E(){N.replace({name:"Department",params:{_id:r.params._id,department:t.state.department._id}})}async function v(){confirm("Are you sure you want to delete this department?")&&await t.actions.delete(r.params._id,t.state.department)}function y(l){confirm("Are you sure you want to remove this member?")&&w.actions.delete(t.state.department.members,{_id:l.user._id})}return(l,s)=>(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("header",C,[e.unref(r).params.department?(e.openBlock(),e.createElementBlock("h1",U,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",O,"Create Department")),e.createElementVNode("section",M,[e.unref(r).params.department?(e.openBlock(),e.createBlock(f.default,{key:0,submit:v,callback:l.redirectToDash,class:"bg-red"},{default:e.withCtx(()=>[e.createTextVNode("Delete")]),_:1},8,["callback"])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:q,callback:E,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1})])]),t.state.department.profile?(e.openBlock(),e.createBlock(h.default,{key:0,title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",R,[e.createVNode(x.default,{photo:t.state.department.profile.photo,"onUpdate:photo":s[0]||(s[0]=a=>t.state.department.profile.photo=a),uploadPath:"organizations/"+t.state.department.name+"/avatars",class:"w-8r aspect-1x1 o-hidden mn-r-small radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",S,[e.createVNode(u.default,{field:t.state.department.profile.name,"onUpdate:field":s[1]||(s[1]=a=>t.state.department.profile.name=a),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:l.organizationName},null,8,["field","validation"]),e.createVNode(u.default,{field:t.state.department.profile.description,"onUpdate:field":s[2]||(s[2]=a=>t.state.department.profile.description=a),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:l.organizationName},null,8,["field","validation"])])])]),_:1})):e.createCommentVNode("",!0),e.createVNode(h.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>k()}],class:"cols-1 gap-thin mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.members,(a,d)=>(e.openBlock(),e.createBlock(b.default,{class:"bg-white pd-thin radius-medium w-100",key:d,user:a.user,photo:a.user.profile.photo,name:a.user.profile.name||a.user.phone||a.user.email||a.user._id,position:a.position,action:{label:"x",method:()=>y(a)}},null,8,["user","photo","name","position","action"]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add member",onClosePopup:i,isPopupOpen:n.value,class:"bg-white w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(D.default,{search:{placeholder:"Search customer...",class:"bg-grey mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:a=>g.actions.read(a),state:null},options:{target:e.unref(r).params._id},class:"bg-grey pd-medium w-min-20r w-max-40r radius-big h-max-20r o-scroll"},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(d,Z)=>{var m,p;return e.openBlock(),e.createBlock(b.default,{key:d._id,user:d.user,photo:(m=d.user.profile)==null?void 0:m.photo,name:((p=d.user.profile)==null?void 0:p.name)||d.user.phone||d.user.email,onClick:()=>{w.actions.add(t.state.department.members,{_id:d.user._id,user:d.user,position:"Member"}),i()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"])}),128))]),_:1},8,["store","options"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",T,[e.createElementVNode("div",A,[F,z,e.createElementVNode("div",L,[j,e.createVNode(o.default,{label:"Hidden department",name:"hidden",class:"w-100 mn-r-small bg-white radius-small pd-small","onUpdate:radio":s[3]||(s[3]=a=>t.state.department.hidden=!t.state.department.hidden),radio:t.state.department.hidden},null,8,["radio"])])]),e.createElementVNode("div",H,[I,G,e.createElementVNode("div",J,[K,e.createVNode(o.default,{label:"Read products",name:"readProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.read,"onUpdate:radio":s[4]||(s[4]=a=>t.state.department.accesses.products.read=!t.state.department.accesses.products.read)},null,8,["radio"]),e.createVNode(o.default,{label:"Edit products",name:"editProducts",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.products.edit,"onUpdate:radio":s[5]||(s[5]=a=>t.state.department.accesses.products.edit=!t.state.department.accesses.products.edit)},null,8,["radio"]),e.createVNode(o.default,{label:"Delete products",name:"deleteProducts",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.products.delete,"onUpdate:radio":s[6]||(s[6]=a=>t.state.department.accesses.products.delete=!t.state.department.accesses.products.delete)},null,8,["radio"]),Q,e.createVNode(o.default,{label:"Read orders",name:"readOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.read,"onUpdate:radio":s[7]||(s[7]=a=>t.state.department.accesses.orders.read=!t.state.department.accesses.orders.read)},null,8,["radio"]),e.createVNode(o.default,{label:"Confirm orders",name:"confirmOrders",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.orders.confirm,"onUpdate:radio":s[8]||(s[8]=a=>t.state.department.accesses.orders.confirm=!t.state.department.accesses.orders.confirm)},null,8,["radio"]),e.createVNode(o.default,{label:"Delete orders",name:"deleteOrders",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.orders.delete,"onUpdate:radio":s[9]||(s[9]=a=>t.state.department.accesses.orders.delete=!t.state.department.accesses.orders.delete)},null,8,["radio"]),W,e.createVNode(o.default,{label:"Read departments",name:"readDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.read,"onUpdate:radio":s[10]||(s[10]=a=>t.state.department.accesses.departments.read=!t.state.department.accesses.departments.read)},null,8,["radio"]),e.createVNode(o.default,{label:"Edit departments",name:"editDepartments",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.accesses.departments.edit,"onUpdate:radio":s[11]||(s[11]=a=>t.state.department.accesses.departments.edit=!t.state.department.accesses.departments.edit)},null,8,["radio"]),e.createVNode(o.default,{label:"Delete departments",name:"deleteDepartments",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.accesses.departments.delete,"onUpdate:radio":s[12]||(s[12]=a=>t.state.department.accesses.departments.delete=!t.state.department.accesses.departments.delete)},null,8,["radio"])])])])]))}};exports.default=X;