@ozdao/prometheus-framework 0.1.30 → 0.1.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/dist/BackofficeGallery-02c9721b.mjs +304 -0
  2. package/dist/BackofficeGallery-1d117a40.js +1 -0
  3. package/dist/BackofficeReports-cb4b180d.mjs +44 -0
  4. package/dist/BackofficeReports-d021871f.js +1 -0
  5. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-505c3ca5.js +1 -0
  6. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-b1873cb7.mjs +1945 -0
  7. package/dist/Button-2ca405bd.js +1 -0
  8. package/dist/Button-c59d387c.mjs +283 -0
  9. package/dist/Button.vue_vue_type_style_index_0_lang-0ea8fbf8.js +1 -0
  10. package/dist/Button.vue_vue_type_style_index_0_lang-4ed993c7.mjs +1 -0
  11. package/dist/ButtonFollow.vue_vue_type_style_index_0_scoped_0634d4a1_lang-0ea8fbf8.js +1 -0
  12. package/dist/ButtonFollow.vue_vue_type_style_index_0_scoped_0634d4a1_lang-4ed993c7.mjs +1 -0
  13. package/dist/CardOrganization-18c1e3fa.mjs +297 -0
  14. package/dist/CardOrganization-7d679e75.js +1 -0
  15. package/dist/Chips-2ada5eda.mjs +200 -0
  16. package/dist/Chips-8d0a1d2c.js +1 -0
  17. package/dist/Dashboard-239fb7a6.mjs +52 -0
  18. package/dist/Dashboard-94267906.js +1 -0
  19. package/dist/EULA-8265b0cf.mjs +4218 -0
  20. package/dist/EULA-cbb27503.js +1 -0
  21. package/dist/Feed-66095e66.js +1 -0
  22. package/dist/Feed-76fc4475.mjs +383 -0
  23. package/dist/Feed-e55bc6fa.js +1 -0
  24. package/dist/Feed-ef6c6ca3.mjs +371 -0
  25. package/dist/IconEdit-c98d3d06.mjs +339 -0
  26. package/dist/IconEdit-e4d0cc6e.js +1 -0
  27. package/dist/Image-052a3cc2.mjs +480 -0
  28. package/dist/Image-c90ee624.js +9 -0
  29. package/dist/MenuItem-0b249b94.mjs +93 -0
  30. package/dist/MenuItem-8b70d2cf.js +1 -0
  31. package/dist/Product-4b58701f.js +7 -0
  32. package/dist/Product-a6251018.mjs +844 -0
  33. package/dist/ProductEdit-3ff2af92.js +1 -0
  34. package/dist/ProductEdit-f901314c.mjs +306 -0
  35. package/dist/ProfileBlogposts-57931834.mjs +70 -0
  36. package/dist/ProfileBlogposts-af88ce98.js +1 -0
  37. package/dist/ProfileEvents-588eadf9.js +1 -0
  38. package/dist/ProfileEvents-ed7f9603.mjs +62 -0
  39. package/dist/ProfileOrganizations-7911deec.mjs +219 -0
  40. package/dist/ProfileOrganizations-ae258581.js +1 -0
  41. package/dist/Publics-50c0ff6c.js +1 -0
  42. package/dist/Publics-f34131bf.mjs +45 -0
  43. package/dist/Select-11ddabf5.mjs +79 -0
  44. package/dist/Select-3ca5ab39.js +1 -0
  45. package/dist/Socials-3fe01af1.mjs +275 -0
  46. package/dist/Socials-b19d0cb1.js +1 -0
  47. package/dist/addMembersQuantity-ea216f92.mjs +85 -0
  48. package/dist/addMembersQuantity-f922d82b.js +84 -0
  49. package/dist/auth-98fe3efb.mjs +612 -0
  50. package/dist/auth-acbe3ae1.js +7 -0
  51. package/dist/auth.client.cjs +7 -8
  52. package/dist/auth.client.js +435 -439
  53. package/dist/auth.validation-495e9d6d.js +1 -0
  54. package/dist/auth.validation-e265b496.mjs +23 -0
  55. package/dist/backoffice.client.cjs +1 -1
  56. package/dist/backoffice.client.js +55 -28
  57. package/dist/click-outside-0b0727d1.js +2 -0
  58. package/dist/click-outside-6101836c.mjs +19 -0
  59. package/dist/community.client.cjs +1 -1
  60. package/dist/community.client.js +121 -121
  61. package/dist/community.server.js +35 -5
  62. package/dist/community.server.mjs +35 -5
  63. package/dist/components/Button/Button.vue.d.ts +3 -0
  64. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  65. package/dist/components/CardHeader/CardHeader.vue.d.ts +3 -0
  66. package/dist/components/Dropdown/Dropdown.vue.d.ts +3 -0
  67. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  68. package/dist/components/Field/Field.vue.d.ts +1 -1
  69. package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
  70. package/dist/components/Popup/Popup.vue.d.ts +2 -1
  71. package/dist/components/Popup/Popup.vue.d.ts.map +1 -1
  72. package/dist/components/Select/Select.vue.d.ts +1 -1
  73. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  74. package/dist/components/Upload/Upload.vue.d.ts +1 -1
  75. package/dist/events.client.cjs +2 -2
  76. package/dist/events.client.js +219 -217
  77. package/dist/events.server.js +2 -9
  78. package/dist/events.server.mjs +2 -9
  79. package/dist/legal.client.cjs +1 -1
  80. package/dist/legal.client.js +2565 -2545
  81. package/dist/main.css +1 -1
  82. package/dist/main.d.ts +1 -1
  83. package/dist/modules/backoffice/components/pages/Dashboard.vue.d.ts +6 -0
  84. package/dist/modules/icons/navigation/IconCross.vue.d.ts +4 -0
  85. package/dist/modules/legal/components/pages/legal/EULA.vue.d.ts +2 -0
  86. package/dist/modules/organizations/components/elements/ButtonFollow.vue.d.ts +1 -1
  87. package/dist/modules/organizations/components/elements/ButtonToggleMembership.vue.d.ts +12 -0
  88. package/dist/modules/organizations/components/sections/DetailsTab.vue.d.ts +2 -58
  89. package/dist/modules/organizations/components/sections/Feed.vue.d.ts +1 -1
  90. package/dist/modules/reports/components/pages/BackofficeReports.vue.d.ts +2 -0
  91. package/dist/modules/reports/components/sections/FormReport.vue.d.ts +75 -0
  92. package/dist/modules/reports/store/reports.d.ts +41 -0
  93. package/dist/organizations-a241b21d.js +1 -0
  94. package/dist/organizations-ea9de495.mjs +122 -0
  95. package/dist/organizations.client-292e8444.js +3 -0
  96. package/dist/organizations.client-6fc91683.mjs +3072 -0
  97. package/dist/organizations.client.cjs +1 -1
  98. package/dist/organizations.client.js +51 -49
  99. package/dist/organizations.server.js +20 -28
  100. package/dist/organizations.server.mjs +20 -28
  101. package/dist/prometheus-framework.cjs.js +19 -19
  102. package/dist/prometheus-framework.es.js +1635 -1608
  103. package/dist/reports-270f69df.js +1 -0
  104. package/dist/reports-79cd9459.mjs +91 -0
  105. package/dist/reports.client.cjs +1 -0
  106. package/dist/reports.client.js +8 -0
  107. package/dist/reports.server.js +159 -0
  108. package/dist/reports.server.mjs +160 -0
  109. package/dist/states.validation-02ba0aee.js +1 -0
  110. package/dist/states.validation-e5f4fa3a.mjs +13 -0
  111. package/dist/style.css +1 -1
  112. package/dist/users.client.cjs +1 -1
  113. package/dist/users.client.js +286 -242
  114. package/dist/users.server.js +6 -18
  115. package/dist/users.server.mjs +6 -18
  116. package/package.json +9 -1
  117. package/src/components/Button/Button.vue +66 -60
  118. package/src/components/CardHeader/CardHeader.vue +51 -50
  119. package/src/components/Dropdown/Dropdown.vue +28 -12
  120. package/src/components/FieldPhone/click-outside.js +0 -48
  121. package/src/components/Popup/Popup.vue +74 -23
  122. package/src/components/Select/Select.vue +10 -6
  123. package/src/main.ts +1 -1
  124. package/src/modules/auth/components/pages/EnterPassword.vue +6 -0
  125. package/src/modules/auth/router/auth.js +1 -1
  126. package/src/modules/auth/store/auth.js +1 -1
  127. package/src/modules/backoffice/components/layouts/Backoffice.vue +3 -3
  128. package/src/modules/backoffice/components/pages/Dashboard.vue +62 -0
  129. package/src/modules/backoffice/router/backoffice.js +26 -0
  130. package/src/modules/community/components/blocks/CardBlogpost.vue +3 -0
  131. package/src/modules/community/components/layouts/Community.vue +4 -4
  132. package/src/modules/community/components/pages/CreateBlogPost.vue +27 -28
  133. package/src/modules/community/components/sections/Comments.vue +4 -2
  134. package/src/modules/community/components/sections/Feed.vue +1 -1
  135. package/src/modules/community/controllers/blog.controller.js +22 -3
  136. package/src/modules/community/controllers/comments.controller.js +23 -5
  137. package/src/modules/events/components/blocks/CardEvent.vue +4 -0
  138. package/src/modules/events/components/pages/EditEvent.vue +27 -28
  139. package/src/modules/events/components/sections/Feed.vue +1 -1
  140. package/src/modules/events/controllers/events.controller.js +3 -10
  141. package/src/modules/gallery/components/sections/BackofficeGallery.vue +7 -23
  142. package/src/modules/icons/navigation/IconCross.vue +22 -0
  143. package/src/modules/legal/components/pages/Legal.vue +3 -0
  144. package/src/modules/legal/components/pages/legal/EULA.vue +2148 -0
  145. package/src/modules/legal/router/legal.js +11 -4
  146. package/src/modules/middlewares/client/auth.validation.js +14 -0
  147. package/src/modules/mobile/components/Menu/Menu.vue +1 -1
  148. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  149. package/src/modules/organizations/components/elements/ButtonFollow.vue +9 -7
  150. package/src/modules/organizations/components/elements/ButtonToggleMembership.vue +101 -0
  151. package/src/modules/organizations/components/pages/Organization.vue +1 -34
  152. package/src/modules/organizations/components/sections/DetailsTab.vue +86 -8
  153. package/src/modules/organizations/controllers/memberships.controller.js +10 -7
  154. package/src/modules/organizations/controllers/organizations.controller.js +9 -20
  155. package/src/modules/organizations/controllers/utils/addMembersQuantity.js +21 -0
  156. package/src/modules/organizations/controllers/utils/addUserStatusFields.js +65 -0
  157. package/src/modules/organizations/controllers/utils/excludeBlockedMembers.js +18 -0
  158. package/src/modules/organizations/models/membership.model.js +5 -5
  159. package/src/modules/organizations/store/memberships.js +6 -6
  160. package/src/modules/organizations/store/organizations.js +0 -1
  161. package/src/modules/products/products.server.js +5 -0
  162. package/src/modules/reports/components/pages/BackofficeReports.vue +67 -0
  163. package/src/modules/reports/components/sections/FormReport.vue +114 -0
  164. package/src/modules/reports/controllers/reports.controller.js +67 -0
  165. package/src/modules/reports/models/report.model.js +58 -0
  166. package/src/modules/reports/reports.client.js +17 -0
  167. package/src/modules/reports/reports.server.js +13 -0
  168. package/src/modules/reports/routes/reports.routes.js +43 -0
  169. package/src/modules/reports/store/reports.js +118 -0
  170. package/src/modules/users/components/pages/Profile.vue +57 -10
  171. package/src/modules/users/controllers/users.controller.js +6 -19
  172. package/src/styles/base/all.scss +2 -0
  173. package/src/styles/layout.scss +39 -63
  174. package/src/styles/theme.scss +0 -1
  175. package/src/styles/components/popup.scss +0 -55
@@ -0,0 +1,3072 @@
1
+ import { computed as Z, resolveComponent as pe, openBlock as o, createElementBlock as c, Fragment as O, renderList as L, unref as k, normalizeClass as se, createCommentVNode as g, createBlock as y, withCtx as x, createTextVNode as W, toDisplayString as f, createElementVNode as a, Transition as H, createVNode as h, ref as b, renderSlot as P, reactive as ie, watch as F, onMounted as me, pushScopeId as he, popScopeId as _e, withAsyncContext as Y, withModifiers as de, watchEffect as ce, resolveDirective as Ie, normalizeProps as V, guardReactiveProps as I, resolveDynamicComponent as re, mergeProps as ye, toHandlers as Be, withDirectives as ne, vShow as we, toRefs as je, vModelText as $e } from "vue";
2
+ import { useRoute as E, useRouter as q } from "vue-router";
3
+ import { useI18n as Te } from "vue-i18n";
4
+ import { s as C } from "./globals-96ba60e4.mjs";
5
+ import { S as Fe, _ as qe, C as J } from "./Breadcrumbs.vue_vue_type_style_index_0_lang-b1873cb7.mjs";
6
+ import { _ as Me } from "./Tab-a243605d.mjs";
7
+ import "./Button.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
8
+ import { s as D } from "./auth-98fe3efb.mjs";
9
+ import { D as Re, _ as Ze, I as He, P as Ne, m as Ke, a as be, s as We } from "./IconEdit-c98d3d06.mjs";
10
+ import "./ButtonFollow.vue_vue_type_style_index_0_scoped_0634d4a1_lang-4ed993c7.mjs";
11
+ import { _ as Ye } from "./Feed-ef6c6ca3.mjs";
12
+ import { _ as Je } from "./Feed-76fc4475.mjs";
13
+ import { a as Qe, _ as Xe } from "./CardOrganization-18c1e3fa.mjs";
14
+ import { _ as Ce, a as Ge } from "./Socials-3fe01af1.mjs";
15
+ import { s as w, a as R } from "./organizations-ea9de495.mjs";
16
+ import { a as fe } from "./index-a661083c.mjs";
17
+ import { S as De } from "./Select-11ddabf5.mjs";
18
+ import { v as et, a as tt } from "./inputs.validation-14e8e01f.mjs";
19
+ import { _ as A } from "./_plugin-vue_export-helper-dad06003.mjs";
20
+ import "./reports-79cd9459.mjs";
21
+ import { F as M, _ as ue } from "./Button-c59d387c.mjs";
22
+ import { _ as Ae } from "./UploadImage-3c627d89.mjs";
23
+ import "./Publics-f34131bf.mjs";
24
+ import { a as Q } from "./auth.validation-e265b496.mjs";
25
+ const st = {
26
+ class: "breadcrumbs flex-row flex-nowrap flex-left flex",
27
+ "aria-label": "breadcrumbs"
28
+ }, at = {
29
+ key: 0,
30
+ class: "i-small mn-r-thin",
31
+ viewBox: "0 0 10 9",
32
+ fill: "none",
33
+ xmlns: "http://www.w3.org/2000/svg"
34
+ }, nt = /* @__PURE__ */ a("path", {
35
+ fill: "black",
36
+ d: "M0.494141 4.26391C0.494141 4.48862 0.659906 4.66912 0.928813 4.66912C1.05037 4.66912 1.16825 4.6065 1.27139 4.52177L1.64344 4.20866V7.56448C1.64344 8.13545 1.98971 8.47803 2.5791 8.47803H7.56678C8.15616 8.47803 8.50243 8.13545 8.50243 7.56448V4.19392L8.8929 4.52177C8.99604 4.6065 9.11392 4.66912 9.23916 4.66912C9.48597 4.66912 9.67015 4.5144 9.67015 4.27128C9.67015 4.1313 9.61121 4.01343 9.5007 3.92133L8.50243 3.08146V1.47538C8.50243 1.30961 8.3956 1.1991 8.22984 1.1991H7.63308C7.46732 1.1991 7.35313 1.30961 7.35313 1.47538V2.11634L5.66969 0.70181C5.31606 0.403433 4.85928 0.403433 4.50197 0.70181L0.663589 3.92133C0.553079 4.01711 0.494141 4.14235 0.494141 4.26391ZM6.13752 5.26219C6.13752 5.08906 6.02701 4.97855 5.85387 4.97855H4.31779C4.14097 4.97855 4.02678 5.08906 4.02678 5.26219V7.63447H2.83327C2.60856 7.63447 2.48332 7.50922 2.48332 7.28084V3.5014L4.90349 1.47538C5.01768 1.37592 5.15029 1.37592 5.26817 1.47538L7.66255 3.48298V7.28084C7.66255 7.50922 7.53731 7.63447 7.3126 7.63447H6.13752V5.26219Z"
37
+ }, null, -1), ot = [
38
+ nt
39
+ ], it = { key: 2 }, lt = {
40
+ key: 3,
41
+ class: "i-small chevron",
42
+ viewBox: "0 0 4 8",
43
+ fill: "none",
44
+ xmlns: "http://www.w3.org/2000/svg"
45
+ }, rt = /* @__PURE__ */ a("path", {
46
+ d: "M4 3.99992C4 3.83673 3.94307 3.70391 3.81025 3.57867L0.899431 0.732369C0.800759 0.629902 0.679317 0.580566 0.531309 0.580566C0.239089 0.580566 0 0.815861 0 1.10808C0 1.25229 0.0607211 1.38512 0.166983 1.49138L2.74763 3.99613L0.166983 6.50846C0.0607211 6.61093 0 6.74375 0 6.89176C0 7.18398 0.239089 7.41928 0.531309 7.41928C0.675522 7.41928 0.800759 7.36994 0.899431 7.26747L3.81025 4.42117C3.94307 4.29594 4 4.15931 4 3.99992Z",
47
+ fill: "black"
48
+ }, null, -1), dt = [
49
+ rt
50
+ ], ct = {
51
+ __name: "Breadcrumbs",
52
+ setup(e) {
53
+ const t = E(), { t: s, locale: n } = Te(), l = Z(() => t.matched.map((i) => {
54
+ var $, S, U;
55
+ const p = ($ = i.meta) == null ? void 0 : $.title, r = n == null ? void 0 : n.value, u = p && r && p[r], d = i.path.replace(/:.+?\//g, (N) => ""), m = (U = (S = i.meta) == null ? void 0 : S.breadcrumbs) == null ? void 0 : U.hidden;
56
+ return { name: u, path: d, isHidden: m };
57
+ }).filter((i) => i.name && !i.isHidden));
58
+ return (i, p) => {
59
+ const r = pe("router-link");
60
+ return o(), c("ol", st, [
61
+ (o(!0), c(O, null, L(k(l), (u, d) => (o(), c("li", {
62
+ key: d,
63
+ class: se(["flex-v-center flex-nowrap flex", { "t-main": d === k(l).length - 1 }])
64
+ }, [
65
+ d === 0 ? (o(), c("svg", at, ot)) : g("", !0),
66
+ d !== k(l).length - 1 ? (o(), y(r, {
67
+ key: 1,
68
+ to: d === 0 ? "/" : u.path
69
+ }, {
70
+ default: x(() => [
71
+ W(f(u.name), 1)
72
+ ]),
73
+ _: 2
74
+ }, 1032, ["to"])) : (o(), c("span", it, f(u.name), 1)),
75
+ d !== k(l).length - 1 ? (o(), c("svg", lt, dt)) : g("", !0)
76
+ ], 2))), 128))
77
+ ]);
78
+ };
79
+ }
80
+ }, ut = { class: "mn-small w-100" }, pt = ["href"], mt = /* @__PURE__ */ a("span", { class: "t-semi uppercase" }, "Website", -1), ht = [
81
+ mt
82
+ ], _t = ["href"], ft = /* @__PURE__ */ a("span", { class: "t-semi uppercase" }, "Phone", -1), gt = [
83
+ ft
84
+ ], bt = ["href"], vt = /* @__PURE__ */ a("span", { class: "t-semi uppercase" }, "Email", -1), yt = [
85
+ vt
86
+ ], wt = ["href"], $t = /* @__PURE__ */ a("span", { class: "t-semi uppercase" }, "Address", -1), Ct = [
87
+ $t
88
+ ], Si = {
89
+ __name: "Contacts",
90
+ props: {
91
+ website: String,
92
+ phone: String,
93
+ email: String,
94
+ address: String
95
+ },
96
+ setup(e) {
97
+ const t = e, s = Z(() => t.website ? !t.website.startsWith("http://") && !t.website.startsWith("https://") ? `http://${t.website}` : t.website : null), n = Z(() => t.address ? encodeURIComponent(t.address) : null);
98
+ return (l, i) => (o(), c("div", ut, [
99
+ k(s) ? (o(), c("a", {
100
+ key: 0,
101
+ href: k(s),
102
+ target: "_blank",
103
+ class: "w-100 br-2px br-solid br-grey radius-small pd-small flex-v-center flex-nowrap flex"
104
+ }, ht, 8, pt)) : g("", !0),
105
+ t.phone ? (o(), c("a", {
106
+ key: 1,
107
+ href: `tel:${t.phone}`,
108
+ class: "w-100 br-2px br-solid br-grey radius-small pd-small flex-v-center flex-nowrap flex"
109
+ }, gt, 8, _t)) : g("", !0),
110
+ t.email ? (o(), c("a", {
111
+ key: 2,
112
+ href: `mailto:${t.email}`,
113
+ target: "_blank",
114
+ class: "w-100 br-2px br-solid br-grey radius-small pd-small flex-v-center flex-nowrap flex"
115
+ }, yt, 8, bt)) : g("", !0),
116
+ k(n) ? (o(), c("a", {
117
+ key: 3,
118
+ href: `https://www.google.com/maps/search/?api=1&query=${k(n)}`,
119
+ target: "_blank",
120
+ class: "w-100 br-2px br-solid br-grey radius-small pd-small flex-v-center flex-nowrap flex"
121
+ }, Ct, 8, wt)) : g("", !0)
122
+ ]));
123
+ }
124
+ }, kt = { class: "w-100 mn-small star-container flex-v-center flex" }, xt = { class: "p-big t-semi mn-r-small" }, Ot = /* @__PURE__ */ a("path", {
125
+ fill: "#00FF88",
126
+ d: "M62.2406 5.85971L75.413 32.6098L105.203 36.8654C110.472 37.676 112.498 44.3636 108.648 48.0113L87.1668 68.8844L92.2331 98.2689C93.2464 103.741 87.5721 107.591 82.9111 105.159L56.3637 91.3788L29.8163 105.159C25.1553 107.794 19.4811 103.741 20.4944 98.4716L25.5607 68.8844L4.07956 48.0113C0.22917 44.3636 2.25569 37.676 7.52464 36.8654L37.3145 32.6098L50.4868 5.85971C52.9186 0.996063 59.8088 0.996063 62.2406 5.85971Z"
127
+ }, null, -1), Lt = [
128
+ Ot
129
+ ], St = { class: "" }, zi = {
130
+ __name: "Rating",
131
+ props: {
132
+ rating: {
133
+ type: Number,
134
+ required: !0
135
+ },
136
+ amount: {
137
+ type: Number,
138
+ required: !0
139
+ }
140
+ },
141
+ setup(e) {
142
+ return (t, s) => (o(), c("section", null, [
143
+ a("div", kt, [
144
+ a("span", xt, f(e.rating), 1),
145
+ (o(), c(O, null, L(5, (n) => a("svg", {
146
+ class: se(["i-semi mn-r-small", { "t-transp": n > e.rating }]),
147
+ width: "113",
148
+ height: "108",
149
+ viewBox: "0 0 113 108",
150
+ fill: "none",
151
+ xmlns: "http://www.w3.org/2000/svg"
152
+ }, Lt, 2)), 64))
153
+ ]),
154
+ a("p", St, "Based on " + f(e.amount) + " reviews", 1)
155
+ ]));
156
+ }
157
+ }, zt = { class: "t-center flex-center flex-column flex pd-medium radius-big bg-grey" }, Pt = { class: "bg-black pd-thin radius-small" }, Mt = /* @__PURE__ */ a("button", { class: "w-100 bg-black br-solid br-1px br-white-transp-20 t-white button-small button" }, " Report ", -1), Dt = ["src"], At = { class: "mn-thin" }, Vt = { class: "mn-medium p-big" }, Et = { class: "flex-center flex-wrap gap-thin flex mn-semi" }, Ut = { class: "pd-thin radius-small t-semi uppercase t-black bg-main p-medium" }, It = { class: "t-semi mn-small" }, Bt = {
158
+ key: 5,
159
+ class: "mn-t-small mn-thin"
160
+ }, jt = {
161
+ __name: "DetailsTab",
162
+ props: {
163
+ organization: Object,
164
+ user: Object
165
+ },
166
+ setup(e) {
167
+ const t = E(), s = ({ membership: n, status: l, target: i }, p, r) => {
168
+ Ke.handleMembershipUpdate(w.current, n, l, i, p, r);
169
+ };
170
+ return (n, l) => (o(), y(H, { name: "slide-fade" }, {
171
+ default: x(() => [
172
+ a("section", zt, [
173
+ e.user._id !== e.organization.owner ? (o(), y(Re, {
174
+ key: 0,
175
+ label: "...",
176
+ align: "right",
177
+ class: "cursor-pointer pos-absolute pos-r-0 pos-t-0 pd-thin radius-extra"
178
+ }, {
179
+ default: x(() => [
180
+ a("section", Pt, [
181
+ h(Ze, {
182
+ user: e.user._id,
183
+ type: "organization",
184
+ target: e.organization._id,
185
+ text: "Report",
186
+ class: "w-100"
187
+ }, {
188
+ default: x(() => [
189
+ Mt
190
+ ]),
191
+ _: 1
192
+ }, 8, ["user", "target"]),
193
+ e.user._id && e.user._id !== e.organization.owner ? (o(), y(Ce, {
194
+ key: 0,
195
+ user: e.user._id,
196
+ type: "organization",
197
+ role: "blocked",
198
+ target: e.organization._id,
199
+ status: e.organization.isBlocked,
200
+ text: { create: "Block", remove: "Unblock" },
201
+ onUpdateMembership: l[0] || (l[0] = (i) => s(i, "isBlocked")),
202
+ class: "t-white mn-t-thin bg-red"
203
+ }, null, 8, ["user", "target", "status"])) : g("", !0)
204
+ ])
205
+ ]),
206
+ _: 1
207
+ }, 8, ["label"])) : g("", !0),
208
+ e.user._id === e.organization.owner ? (o(), y(He, {
209
+ key: 1,
210
+ onClick: l[1] || (l[1] = (i) => n.$router.push({
211
+ name: "Organization Edit",
212
+ params: {
213
+ _id: e.organization._id
214
+ }
215
+ })),
216
+ class: "pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
217
+ })) : g("", !0),
218
+ e.organization.profile.photo ? (o(), c("img", {
219
+ key: 2,
220
+ src: (n.FILE_SERVER_URL || "") + e.organization.profile.photo,
221
+ class: "radius-big bg-grey flex-center flex mn-small i-extra"
222
+ }, null, 8, Dt)) : (o(), y(Ne, {
223
+ key: 3,
224
+ class: "radius-medium mn-small i-extra"
225
+ })),
226
+ a("h1", At, f(e.organization.profile.name), 1),
227
+ a("p", Vt, [
228
+ h(Qe, {
229
+ text: e.organization.profile.description ? e.organization.profile.description : "",
230
+ maxLen: 240
231
+ }, null, 8, ["text"])
232
+ ]),
233
+ a("div", Et, [
234
+ (o(!0), c(O, null, L(e.organization.profile.tags, (i) => (o(), c("span", Ut, f(i), 1))), 256))
235
+ ]),
236
+ a("p", It, " 👨‍👨‍👧‍👧 " + f(e.organization.numberOfSubscribers) + " followers ", 1),
237
+ e.user._id && k(t).params._id && k(t).params._id !== e.user._id && e.organization.owner !== e.user._id ? (o(), y(Ce, {
238
+ key: 4,
239
+ user: e.user._id,
240
+ type: "organization",
241
+ role: "subscriber",
242
+ target: e.organization._id,
243
+ status: e.organization.isSubscriber,
244
+ text: { create: "Follow", remove: "Unfollow" },
245
+ onUpdateMembership: l[2] || (l[2] = (i) => s(i, "isSubscriber", "numberOfSubscribers")),
246
+ class: "w-min mn-medium mn-r-auto mn-l-auto"
247
+ }, null, 8, ["user", "target", "status"])) : g("", !0),
248
+ Object.values(e.organization.socials).some((i) => i) ? (o(), c("h4", Bt, " Find us in socials ")) : g("", !0),
249
+ h(Ge, {
250
+ telegram: e.organization.socials.telegram,
251
+ facebook: e.organization.socials.facebook,
252
+ instagram: e.organization.socials.instagram,
253
+ twitter: e.organization.socials.twitter
254
+ }, null, 8, ["telegram", "facebook", "instagram", "twitter"])
255
+ ])
256
+ ]),
257
+ _: 1
258
+ }));
259
+ }
260
+ };
261
+ const Tt = {
262
+ key: 0,
263
+ class: "spoiler"
264
+ }, ke = {
265
+ __name: "Spoiler",
266
+ props: {
267
+ status: {
268
+ type: Boolean,
269
+ default: !1
270
+ }
271
+ },
272
+ setup(e) {
273
+ const t = e, s = b(!1);
274
+ return t.status && (s.value = t.status), (n, l) => (o(), c("div", null, [
275
+ a("div", {
276
+ onClick: l[0] || (l[0] = (i) => s.value = !s.value),
277
+ class: "flex-v-center flex-nowrap flex"
278
+ }, [
279
+ P(n.$slots, "header")
280
+ ]),
281
+ h(H, { name: "collapse" }, {
282
+ default: x(() => [
283
+ s.value ? (o(), c("div", Tt, [
284
+ P(n.$slots, "content")
285
+ ])) : g("", !0)
286
+ ]),
287
+ _: 3
288
+ })
289
+ ]));
290
+ }
291
+ }, B = fe.create({ baseURL: process.env.API_URL, withCredentials: !0 }), v = ie({
292
+ all: [],
293
+ current: {
294
+ recommendation: !1,
295
+ category: [],
296
+ status: "unpublished",
297
+ information: [],
298
+ coverImage: "",
299
+ images: [],
300
+ files: [],
301
+ image3d: !1,
302
+ name: "",
303
+ sale: 0,
304
+ price: 0,
305
+ localization: [],
306
+ modifications: [],
307
+ description: ""
308
+ }
309
+ }), Pi = {
310
+ async create(e, t) {
311
+ const s = {
312
+ ...t,
313
+ organization: e
314
+ };
315
+ return await B.post("/products/create", s).then(
316
+ (n) => (Ft(n.data, "current"), Promise.resolve(n.data)),
317
+ (n) => (C(n), Promise.reject(n))
318
+ );
319
+ },
320
+ async read(e = {}) {
321
+ e._id && (e.params = { _id: e._id }), e.category && (e.params = e.params || {}, e.params.category = e.category), e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 10, e.organization && (e.params.organization = e.organization), e.params.sort = "createdAt";
322
+ try {
323
+ console.log("Request params:" + e.params);
324
+ const t = await B.get("/products/read", { params: e.params });
325
+ return e._id ? v.current = t.data[0] : v.all = t.data, Promise.resolve(t.data);
326
+ } catch (t) {
327
+ return C(t), Promise.reject(t);
328
+ }
329
+ },
330
+ async update(e, t) {
331
+ return await B.post("/products/" + e, t).then(
332
+ (s) => Promise.resolve(s.data),
333
+ (s) => (C(s), Promise.reject(s))
334
+ );
335
+ },
336
+ async deleteProduct(e) {
337
+ return await B.delete("/products/" + e).then(
338
+ (t) => Promise.resolve(t.data),
339
+ (t) => (C(t), Promise.reject(t))
340
+ );
341
+ },
342
+ async submitMood(e = null) {
343
+ return console.log(e), B.post("/product/recommended", { mood: e }).then(
344
+ (t) => (v.current = t.data.product, v.current.recommendation = t.data.recommendationText, Promise.resolve(t.data)),
345
+ (t) => (console.log(t), C(t), Promise.reject(t))
346
+ );
347
+ },
348
+ async fetchProducts() {
349
+ return await B.get("/products").then(
350
+ (e) => (v.all = e.data, v.filtered = e.data.slice(), v.filteredPrice = v.filtered, v.filteredPrice.sort(function(t, s) {
351
+ return t[v.sort.current] > s[v.sort.current] ? v.sort.ascending ? 1 : -1 : t[v.sort.current] < s[v.sort.current] ? v.sort.ascending ? -1 : 1 : 0;
352
+ }), Promise.resolve(e.data)),
353
+ (e) => (C(e), Promise.reject(e))
354
+ );
355
+ },
356
+ async fetchProductsPopular() {
357
+ return await B.get("/products/popular").then(
358
+ (e) => (v.popular = e.data, Promise.resolve(e.data)),
359
+ (e) => (C(e), Promise.reject(e))
360
+ );
361
+ },
362
+ async fetchProductsPublished() {
363
+ return await B.get("/products").then(
364
+ (e) => {
365
+ let t = e.data.filter(function(s, n) {
366
+ return s.status !== "unpublished";
367
+ });
368
+ return v.all = t, v.filtered = t.slice(), v.filteredPrice = v.filtered, v.filteredPrice.sort(function(s, n) {
369
+ return s[v.sort.current] > n[v.sort.current] ? v.sort.ascending ? 1 : -1 : s[v.sort.current] < n[v.sort.current] ? v.sort.ascending ? -1 : 1 : 0;
370
+ }), Promise.resolve(e.data);
371
+ },
372
+ (e) => (C(e), Promise.reject(e))
373
+ );
374
+ },
375
+ async fetchProduct(e) {
376
+ return await B.get("/products/" + e).then(
377
+ (t) => (t.localization || (t.localization = []), v.current = t.data, Promise.resolve(t.data)),
378
+ (t) => (C(t), Promise.reject(t))
379
+ );
380
+ },
381
+ async fetchProductPopular() {
382
+ return await B.get("/products").then(
383
+ (e) => (v.all = e.data.slice(1, 5), Promise.resolve(e.data.slice(1, 5))),
384
+ (e) => (C(e), Promise.reject(e))
385
+ );
386
+ }
387
+ };
388
+ function Ft(e, t) {
389
+ v[t] = e;
390
+ }
391
+ F(v, (e, t) => {
392
+ });
393
+ const qt = process.env.API_URL, X = fe.create({ baseURL: qt, withCredentials: !0 }), j = ie({
394
+ all: [],
395
+ current: {
396
+ order: "1",
397
+ name: "",
398
+ url: "",
399
+ subcategories: [],
400
+ filters: [],
401
+ localization: []
402
+ }
403
+ }), Mi = {
404
+ async fetchCategories() {
405
+ return await X.get("/categories").then(
406
+ (e) => (j.all = e.data, Promise.resolve(e.data)),
407
+ (e) => (C(e), Promise.reject(e))
408
+ );
409
+ },
410
+ updateCategories(e) {
411
+ return X.post("/categories", e).then(
412
+ (t) => (j.all = e, Promise.resolve(e)),
413
+ (t) => (C(t), Promise.reject(t))
414
+ );
415
+ },
416
+ fetchCategory(e) {
417
+ return X.get("/categories/" + e).then(
418
+ (t) => (j.current = t.data, Promise.resolve(t.data)),
419
+ (t) => (C(t), Promise.reject(t))
420
+ );
421
+ },
422
+ addCategory() {
423
+ return X.post("/categories/add", j.current).then(
424
+ (e) => (j.all.push(e.data), Promise.resolve(e.data)),
425
+ (e) => (C(e), Promise.reject(e))
426
+ );
427
+ },
428
+ updateCategory(e) {
429
+ return X.post("/categories/" + e, j.current).then(
430
+ (t) => (j.current = t.data, Promise.resolve(t.data)),
431
+ (t) => (C(t), Promise.reject(t))
432
+ );
433
+ },
434
+ deleteCategory(e) {
435
+ return X.delete("/categories/" + e).then(
436
+ (t) => {
437
+ const s = j.all.findIndex((n) => n.url === e);
438
+ j.all.splice(s, 1);
439
+ },
440
+ (t) => {
441
+ C(t);
442
+ }
443
+ );
444
+ }
445
+ };
446
+ F(j, (e) => {
447
+ });
448
+ const Rt = { class: "mn-big radius-medium pd-big bg-white" }, Zt = { class: "mn-regular" }, Ht = { class: "mn-small t-transp p-medium" }, ge = {
449
+ __name: "EmptyState",
450
+ props: {
451
+ title: {
452
+ type: String,
453
+ default: "У вас еще нет организации"
454
+ },
455
+ description: {
456
+ type: String,
457
+ default: "Для использования сервиса, вам необходимо добавить вашу организацию."
458
+ },
459
+ action: {
460
+ type: String,
461
+ default: "Создать организацию"
462
+ },
463
+ callback: {
464
+ type: Function,
465
+ default: () => {
466
+ }
467
+ }
468
+ },
469
+ setup(e) {
470
+ return (t, s) => (o(), c("section", Rt, [
471
+ a("h3", Zt, f(e.title), 1),
472
+ a("p", Ht, f(e.description), 1),
473
+ a("button", {
474
+ onClick: s[0] || (s[0] = (...n) => e.callback && e.callback(...n)),
475
+ class: "t-white bg-second w-100 button"
476
+ }, f(e.action), 1)
477
+ ]));
478
+ }
479
+ };
480
+ const Nt = {
481
+ __name: "Map",
482
+ props: {
483
+ location: Object
484
+ },
485
+ setup(e) {
486
+ const t = e;
487
+ let s = b(null), n = null, l = null;
488
+ return me(async () => {
489
+ n = new google.maps.Map(s.value, {
490
+ zoom: 13,
491
+ center: {
492
+ lat: t.location.lat,
493
+ lng: t.location.lng
494
+ }
495
+ }), l = new google.maps.Marker({
496
+ position: {
497
+ lat: t.location.lat,
498
+ lng: t.location.lng
499
+ },
500
+ map: n
501
+ });
502
+ }), F(() => t.location, () => {
503
+ n && l && (l.setPosition(new google.maps.LatLng(t.location.lat, t.location.lng)), n.setCenter(new google.maps.LatLng(t.location.lat, t.location.lng)));
504
+ }, { deep: !0 }), (i, p) => (o(), c("div", {
505
+ ref_key: "gmap",
506
+ ref: s,
507
+ class: "gmap"
508
+ }, null, 512));
509
+ }
510
+ }, Kt = /* @__PURE__ */ A(Nt, [["__scopeId", "data-v-c194b4a5"]]);
511
+ const Wt = { class: "pd-small flex-nowrap flex" }, Yt = { class: "user-card__info" }, Jt = { class: "user-card__name" }, Qt = { class: "user-card__position" }, Xt = {
512
+ __name: "DepartmentSub",
513
+ props: {
514
+ department: {
515
+ type: Object,
516
+ required: !0
517
+ }
518
+ // Define other props here
519
+ },
520
+ setup(e) {
521
+ return (t, s) => (o(), c("div", Wt, [
522
+ a("div", Yt, [
523
+ a("p", Jt, f(e.department.name ? e.department.name : "Безымянный"), 1),
524
+ a("p", Qt, f(e.department.members ? e.department.members.length : "0") + " человек", 1)
525
+ ])
526
+ ]));
527
+ }
528
+ }, Ve = /* @__PURE__ */ A(Xt, [["__scopeId", "data-v-d65b1483"]]);
529
+ const Gt = { class: "pd-small flex-nowrap flex" }, es = { class: "user-card__info" }, ts = { class: "user-card__name" }, ss = { class: "t-transp" }, as = {
530
+ __name: "User",
531
+ props: {
532
+ user: {
533
+ type: Object,
534
+ required: !0
535
+ },
536
+ position: {
537
+ type: String,
538
+ required: !0
539
+ }
540
+ // Define other props here
541
+ },
542
+ setup(e) {
543
+ return (t, s) => (o(), c("div", Gt, [
544
+ a("div", es, [
545
+ a("p", ts, f(e.user.name ? e.user.name : "Безымянный"), 1),
546
+ a("p", ss, f(e.position), 1)
547
+ ])
548
+ ]));
549
+ }
550
+ }, Ee = /* @__PURE__ */ A(as, [["__scopeId", "data-v-a27accf5"]]);
551
+ const le = (e) => (he("data-v-1d33cf95"), e = e(), _e(), e), ns = { class: "radius-big o-hidden cols-2-1_3" }, os = { class: "pd-medium w-100" }, is = /* @__PURE__ */ le(() => /* @__PURE__ */ a("path", {
552
+ d: "M515.693 9.52082C510.095 3.91669 502.49 0.765625 494.563 0.765625C486.635 0.765625 479.036 3.91669 473.432 9.52082L48.7255 434.307C44.8244 438.214 42.0848 443.125 40.8088 448.496L0.939444 615.069C-1.47202 625.168 1.528 635.788 8.86652 643.132C16.2103 650.47 26.8305 653.47 36.9292 651.059L203.516 611.261H203.511C208.88 609.985 213.792 607.246 217.699 603.35L642.485 178.496C648.089 172.892 651.241 165.293 651.241 157.366C651.241 149.439 648.089 141.835 642.485 136.235L515.693 9.52082ZM113.76 453.708L388.307 179.161L472.828 263.682L198.281 538.229L113.76 453.708ZM87.1041 511.5L140.416 564.812L70.3014 581.614L87.1041 511.5ZM515.091 221.793L430.195 136.897L494.184 72.9075L579.08 157.429L515.091 221.793Z",
553
+ fill: "black"
554
+ }, null, -1)), ls = [
555
+ is
556
+ ], rs = ["innerHTML"], ds = ["innerHTML"], cs = { class: "pd-small flex-v-center flex-nowrap flex" }, us = /* @__PURE__ */ le(() => /* @__PURE__ */ a("h5", { class: "w-100" }, "Contacts ", -1)), ps = { class: "mn-r-small" }, ms = /* @__PURE__ */ le(() => /* @__PURE__ */ a("svg", {
557
+ width: "14",
558
+ height: "9",
559
+ viewBox: "0 0 14 9",
560
+ fill: "none",
561
+ xmlns: "http://www.w3.org/2000/svg"
562
+ }, [
563
+ /* @__PURE__ */ a("path", {
564
+ "fill-rule": "evenodd",
565
+ "clip-rule": "evenodd",
566
+ d: "M12.4697 0.469727L13.5304 1.53039L7.00006 8.06072L0.469727 1.53039L1.53039 0.469727L7.00006 5.9394L12.4697 0.469727Z",
567
+ fill: "#8A8A8A"
568
+ })
569
+ ], -1)), hs = { key: 0 }, _s = { class: "pd-small flex-v-center flex-nowrap flex" }, fs = /* @__PURE__ */ le(() => /* @__PURE__ */ a("h5", { class: "w-100" }, "Working Hours ", -1)), gs = { class: "mn-r-small" }, bs = /* @__PURE__ */ le(() => /* @__PURE__ */ a("svg", {
570
+ width: "14",
571
+ height: "9",
572
+ viewBox: "0 0 14 9",
573
+ fill: "none",
574
+ xmlns: "http://www.w3.org/2000/svg"
575
+ }, [
576
+ /* @__PURE__ */ a("path", {
577
+ "fill-rule": "evenodd",
578
+ "clip-rule": "evenodd",
579
+ d: "M12.4697 0.469727L13.5304 1.53039L7.00006 8.06072L0.469727 1.53039L1.53039 0.469727L7.00006 5.9394L12.4697 0.469727Z",
580
+ fill: "#8A8A8A"
581
+ })
582
+ ], -1)), vs = { key: 0 }, ys = {
583
+ __name: "Department",
584
+ props: {
585
+ department: Object,
586
+ organization: Object
587
+ },
588
+ setup(e) {
589
+ const t = e;
590
+ return (s, n) => (o(), c("div", ns, [
591
+ h(Kt, {
592
+ location: { lat: e.department.location.coordinates[1], lng: e.department.location.coordinates[0] },
593
+ class: ""
594
+ }, null, 8, ["location"]),
595
+ a("div", os, [
596
+ (o(), c("svg", {
597
+ onClick: n[0] || (n[0] = (l) => s.$router.push(`/app/organization/${t.organization._id}/departments/${e.department._id}/edit`)),
598
+ class: "i-regular pos-absolute pos-r-0 pos-t-0 t-transp",
599
+ width: "652",
600
+ height: "652",
601
+ viewBox: "0 0 652 652",
602
+ fill: "none",
603
+ xmlns: "http://www.w3.org/2000/svg"
604
+ }, ls)),
605
+ a("h3", {
606
+ onClick: n[1] || (n[1] = (l) => s.$router.push(`/app/organization/${t.organization._id}/departments/${e.department._id}`)),
607
+ class: "mn-small w-100",
608
+ innerHTML: e.department.profile.name
609
+ }, null, 8, rs),
610
+ a("p", {
611
+ onClick: n[2] || (n[2] = (l) => s.$router.push(`/app/organization/${t.organization._id}/departments/${e.department._id}`)),
612
+ class: "mn-small p-big w-100",
613
+ innerHTML: e.department.address
614
+ }, null, 8, ds),
615
+ h(ke, { class: "radius-small o-hidden br-1px br-solid br-grey mn-thin" }, {
616
+ header: x(() => [
617
+ a("div", cs, [
618
+ us,
619
+ a("p", ps, f(e.department.members.length) + " человек", 1),
620
+ ms
621
+ ])
622
+ ]),
623
+ content: x(() => [
624
+ a("ul", null, [
625
+ e.department.members.length < 1 ? (o(), c("li", hs, "В отделе еще нет участников")) : g("", !0),
626
+ (o(!0), c(O, null, L(e.department.members, (l, i) => (o(), y(Ee, {
627
+ class: "br-b br-solid br-grey",
628
+ key: i,
629
+ user: l.user,
630
+ position: l.position,
631
+ onClick: (p) => s.$router.push(`/app/profile/${l.user._id}`)
632
+ }, null, 8, ["user", "position", "onClick"]))), 128))
633
+ ])
634
+ ]),
635
+ _: 1
636
+ }),
637
+ h(ke, { class: "radius-small o-hidden br-1px br-solid br-grey mn-thin" }, {
638
+ header: x(() => [
639
+ a("div", _s, [
640
+ fs,
641
+ a("p", gs, f(e.department.subdepartments ? e.department.subdepartments.length : 0) + " отделов", 1),
642
+ bs
643
+ ])
644
+ ]),
645
+ content: x(() => [
646
+ a("ul", null, [
647
+ e.department.subdepartments.length < 1 ? (o(), c("li", vs, "В отделе еще нет подотделов")) : g("", !0),
648
+ (o(!0), c(O, null, L(e.department.subdepartments, (l, i) => (o(), y(Ve, {
649
+ onClick: (p) => s.$router.push(`/app/organization/departments/${l._id}`),
650
+ key: i,
651
+ class: "br-b br-solid br-grey",
652
+ department: l
653
+ }, null, 8, ["onClick", "department"]))), 128))
654
+ ])
655
+ ]),
656
+ _: 1
657
+ })
658
+ ])
659
+ ]));
660
+ }
661
+ }, ws = /* @__PURE__ */ A(ys, [["__scopeId", "data-v-1d33cf95"]]), ee = fe.create({ baseURL: process.env.API_URL, withCredentials: !0 });
662
+ ee.defaults.withCredentials = !0;
663
+ const _ = ie({
664
+ departments: [],
665
+ department: {
666
+ organization: "",
667
+ profile: {
668
+ photo: "",
669
+ name: "",
670
+ description: "",
671
+ categories: []
672
+ },
673
+ address: "",
674
+ location: {
675
+ lat: null,
676
+ lng: null
677
+ },
678
+ worktime: [],
679
+ delivery: [],
680
+ payment: [],
681
+ members: [],
682
+ subdepartments: []
683
+ },
684
+ error: null
685
+ }), K = {
686
+ async readOne(e) {
687
+ await ee.get(`/api/departments/get/${e}`).then((t) => {
688
+ _.department = t.data, _.error = null;
689
+ }).catch((t) => {
690
+ C(t);
691
+ });
692
+ },
693
+ async read(e) {
694
+ await ee.get(`/api/departments/${e}`).then((t) => {
695
+ console.log("Response:", t), _.departments = t.data, _.error = null;
696
+ }).catch((t) => {
697
+ C(t);
698
+ });
699
+ },
700
+ async create(e, t) {
701
+ await ee.post(`/api/departments/${e}/create`, t).then((s) => {
702
+ _.error = null, _.department = s.data;
703
+ }).catch((s) => {
704
+ C(s);
705
+ });
706
+ },
707
+ async update(e, t) {
708
+ await ee.post(`/api/departments/${e}/update`, t).then(() => {
709
+ _.error = null;
710
+ }).catch((s) => {
711
+ C(s);
712
+ });
713
+ },
714
+ async delete(e, t) {
715
+ await ee.delete(`/api/departments/${e}/delete`, { data: { _id: t } }).then(() => {
716
+ _.error = null;
717
+ }).catch((s) => {
718
+ C(s);
719
+ });
720
+ }
721
+ };
722
+ F(_, (e, t) => {
723
+ });
724
+ const Di = {
725
+ __name: "StructureTab",
726
+ props: {
727
+ organization: Object,
728
+ units: Array,
729
+ memberships: Array
730
+ },
731
+ async setup(e) {
732
+ let t, s;
733
+ const n = e;
734
+ b("departments"), [t, s] = Y(() => K.read(n.organization._id)), await t, s();
735
+ const l = Z(() => {
736
+ const i = _.departments, p = i.flatMap(
737
+ (r) => r.subdepartments.map((u) => u._id)
738
+ );
739
+ return i.filter(
740
+ (r) => !p.includes(r._id)
741
+ );
742
+ });
743
+ return (i, p) => (o(), y(H, { name: "slide-fade" }, {
744
+ default: x(() => [
745
+ a("div", null, [
746
+ k(l).length < 1 ? (o(), y(ge, {
747
+ key: 0,
748
+ title: "You don't have any spots yet.",
749
+ description: "Add spots to your hub.",
750
+ action: "Add spot",
751
+ callback: () => i.$router.push(`/app/organization/${n.organization._id}/departments/create`)
752
+ }, null, 8, ["callback"])) : g("", !0),
753
+ a("div", null, [
754
+ (o(!0), c(O, null, L(k(l), (r, u) => (o(), y(ws, {
755
+ key: u,
756
+ department: r,
757
+ organization: e.organization,
758
+ class: "radius-big bg-grey mn-thin"
759
+ }, null, 8, ["department", "organization"]))), 128)),
760
+ k(l).length > 0 && D.user._id === e.organization.owner ? (o(), c("button", {
761
+ key: 0,
762
+ onClick: p[0] || (p[0] = (r) => i.$router.push(`/app/organization/${n.organization._id}/departments/create`)),
763
+ class: "mn-thin button w-100"
764
+ }, " Add spot ")) : g("", !0)
765
+ ])
766
+ ])
767
+ ]),
768
+ _: 1
769
+ }));
770
+ }
771
+ }, te = fe.create({ baseURL: process.env.API_URL, withCredentials: !0 });
772
+ te.defaults.withCredentials = !0;
773
+ const T = ie({
774
+ invites: [],
775
+ invite: null,
776
+ error: null
777
+ }), oe = {
778
+ async read(e) {
779
+ await te.get(`/api/invites/${e}`).then((t) => {
780
+ T.invites = t.data, T.error = null;
781
+ }).catch((t) => {
782
+ C(t);
783
+ });
784
+ },
785
+ async readOne(e) {
786
+ await te.get(`/api/invites/get/${e}`).then((t) => {
787
+ T.invite = t.data, D.user.phone = t.data.invitedPhone, D.user.email = t.data.invitedEmail;
788
+ }).catch((t) => {
789
+ C(t);
790
+ });
791
+ },
792
+ async create(e, t) {
793
+ await te.post(`/api/invites/${e}/create`, t).then(() => {
794
+ T.error = null;
795
+ }).catch((s) => {
796
+ C(s);
797
+ });
798
+ },
799
+ async update(e, t) {
800
+ await te.put(`/api/invites/${e}/update`, t).then(() => {
801
+ T.error = null;
802
+ }).catch((s) => {
803
+ C(s);
804
+ });
805
+ },
806
+ async delete(e) {
807
+ await te.delete(`/api/invites/${e}/delete`).then(() => {
808
+ T.error = null;
809
+ }).catch((t) => {
810
+ C(t);
811
+ });
812
+ }
813
+ };
814
+ F(T, (e, t) => {
815
+ });
816
+ const Ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
817
+ __proto__: null,
818
+ actions: oe,
819
+ state: T
820
+ }, Symbol.toStringTag, { value: "Module" })), $s = { class: "mn-medium radius-medium pd-semi bg-white" }, Cs = /* @__PURE__ */ a("h3", { class: "mn-medium" }, "Добавить участников", -1), ks = /* @__PURE__ */ a("p", { class: "mn-small t-transp p-medium" }, "Укажите email или телефон, чтобы отправить ссылку с приглашением:", -1), xs = { class: "w-100 flex-nowrap flex" }, Os = {
821
+ key: 0,
822
+ class: "mn-r-medium flex-v-center flex"
823
+ }, Ls = ["onClick"], Ss = /* @__PURE__ */ a("p", { class: "t-blue mn-r-small" }, "+ Добавить приглашение", -1), zs = [
824
+ Ss
825
+ ], Ps = /* @__PURE__ */ a("span", null, "Отправить приглашения ", -1), Ms = {
826
+ __name: "MembersAdd",
827
+ props: {
828
+ organization: Object
829
+ },
830
+ emits: ["send-invite"],
831
+ setup(e, { emit: t }) {
832
+ const s = e, n = b(null), l = b([{ contact: "", role: "" }]);
833
+ function i() {
834
+ l.value.push({ contact: "", role: "" });
835
+ }
836
+ function p(d) {
837
+ l.value.splice(d, 1);
838
+ }
839
+ async function r(d) {
840
+ await oe.create(s.organization._id, l.value);
841
+ }
842
+ function u() {
843
+ }
844
+ return (d, m) => (o(), c("div", null, [
845
+ a("section", $s, [
846
+ Cs,
847
+ ks,
848
+ (o(!0), c(O, null, L(l.value, ($, S) => (o(), c("div", {
849
+ key: S,
850
+ class: "br-1px br-solid br-grey flex radius-small mn-thin"
851
+ }, [
852
+ a("div", xs, [
853
+ h(M, {
854
+ field: $.contact,
855
+ "onUpdate:field": (U) => $.contact = U,
856
+ placeholder: "Email или телефон",
857
+ class: "w-100 bg-white",
858
+ validation: n.value
859
+ }, null, 8, ["field", "onUpdate:field", "validation"]),
860
+ S > 0 ? (o(), c("div", Os, [
861
+ a("button", {
862
+ onClick: (U) => p(S),
863
+ class: "button-small button"
864
+ }, "×", 8, Ls)
865
+ ])) : g("", !0)
866
+ ]),
867
+ h(De, {
868
+ options: [
869
+ { name: "Директор", value: "director" },
870
+ { name: "Менеджер", value: "manager" },
871
+ { name: "Сотрудник", value: "member" }
872
+ ],
873
+ prop: $,
874
+ content: "role",
875
+ placeholder: "Роль",
876
+ size: "small",
877
+ class: "w-80"
878
+ }, null, 8, ["prop"])
879
+ ]))), 128)),
880
+ a("div", {
881
+ onClick: i,
882
+ class: "mn-small flex-v-center flex-nowrap flex"
883
+ }, zs),
884
+ h(ue, {
885
+ submit: d.a = () => r(T.invites),
886
+ callback: u,
887
+ class: "mn-t-medium"
888
+ }, {
889
+ default: x(() => [
890
+ Ps
891
+ ]),
892
+ _: 1
893
+ }, 8, ["submit"])
894
+ ])
895
+ ]));
896
+ }
897
+ }, Ds = { class: "mn-big radius-medium bg-white" }, As = {
898
+ key: 0,
899
+ class: "pd-semi"
900
+ }, Vs = { class: "br-grey br-1px br-solid radius-small flex-nowrap flex-v-center flex pd-medium" }, Es = { class: "w-100 mn-r-small" }, Us = { class: "t-transp" }, Is = {
901
+ key: 0,
902
+ class: "mn-l-medium flex-v-center flex"
903
+ }, Bs = ["onClick"], js = {
904
+ key: 1,
905
+ class: "pd-semi"
906
+ }, Ts = { key: 0 }, Fs = { class: "br-grey br-1px br-solid radius-small mn-thin flex-nowrap flex-v-center flex pd-medium" }, qs = { class: "w-100 mn-r-small" }, Rs = { class: "t-transp" }, Zs = { class: "mn-l-medium flex-v-center flex" }, Hs = ["onClick"], Ns = {
907
+ __name: "MembersList",
908
+ props: {
909
+ organization: Object,
910
+ memberships: Array,
911
+ invites: Array
912
+ },
913
+ emits: [["removeMember", "removeInvite"]],
914
+ setup(e, { emit: t }) {
915
+ const s = e, n = b("members");
916
+ function l(p, r) {
917
+ s.memberships.splice(p, 1), t("removeMember", r);
918
+ }
919
+ function i(p, r) {
920
+ s.invites.splice(p, 1), t("removeInvite", r);
921
+ }
922
+ return (p, r) => (o(), c("section", Ds, [
923
+ h(Me, {
924
+ selected: n.value,
925
+ "onUpdate:selected": r[0] || (r[0] = (u) => n.value = u),
926
+ class: "br-grey br-b br-solid radius-small",
927
+ tabs: [
928
+ { name: "Участники", value: "members" },
929
+ { name: "Приглашения", value: "invites" }
930
+ ]
931
+ }, null, 8, ["selected"]),
932
+ n.value === "members" ? (o(), c("div", As, [
933
+ (o(!0), c(O, null, L(e.memberships, (u, d) => (o(), c("div", Vs, [
934
+ a("span", Es, f(u.user.email) + " " + f(u.user.phone), 1),
935
+ a("span", Us, f(u.position), 1),
936
+ u.position !== "Основатель" ? (o(), c("div", Is, [
937
+ a("button", {
938
+ onClick: (m) => l(d, u),
939
+ class: "button-small button"
940
+ }, "×", 8, Bs)
941
+ ])) : g("", !0)
942
+ ]))), 256))
943
+ ])) : g("", !0),
944
+ n.value === "invites" ? (o(), c("div", js, [
945
+ e.invites.length < 1 ? (o(), c("span", Ts, "В организации нет приглашений")) : g("", !0),
946
+ (o(!0), c(O, null, L(e.invites, (u, d) => (o(), c("div", Fs, [
947
+ a("span", qs, f(u.invitedEmail) + " " + f(u.invitedPhone), 1),
948
+ a("span", Rs, f(u.status), 1),
949
+ a("div", Zs, [
950
+ a("button", {
951
+ onClick: (m) => i(d, u),
952
+ class: "button-small button"
953
+ }, "×", 8, Hs)
954
+ ])
955
+ ]))), 256))
956
+ ])) : g("", !0)
957
+ ]));
958
+ }
959
+ }, Ks = /* @__PURE__ */ a("section", { class: "mn-medium radius-medium pd-semi bg-white" }, [
960
+ /* @__PURE__ */ a("h2", { class: "mn-regular" }, "Участники"),
961
+ /* @__PURE__ */ a("p", { class: "t-transp p-big" }, "Добавляйте новых участников организации и настраивайте права доступа.")
962
+ ], -1), Vi = {
963
+ __name: "MembersTab",
964
+ props: {
965
+ organization: Object,
966
+ memberships: Array
967
+ },
968
+ async setup(e) {
969
+ let t, s;
970
+ const n = e;
971
+ [t, s] = Y(() => oe.read(n.organization._id)), await t, s();
972
+ async function l(r) {
973
+ await oe.create(n.organization._id, r);
974
+ }
975
+ async function i(r) {
976
+ await be.delete(r._id);
977
+ }
978
+ async function p(r) {
979
+ await oe.delete(r._id);
980
+ }
981
+ return (r, u) => (o(), y(H, { name: "slide-fade" }, {
982
+ default: x(() => [
983
+ a("div", null, [
984
+ Ks,
985
+ h(Ms, {
986
+ organization: e.organization,
987
+ onSendInvite: l
988
+ }, null, 8, ["organization"]),
989
+ h(Ns, {
990
+ organization: e.organization,
991
+ memberships: e.memberships,
992
+ invites: T.invites,
993
+ onRemoveInvite: p,
994
+ onRemoveMember: i
995
+ }, null, 8, ["organization", "memberships", "invites"])
996
+ ])
997
+ ]),
998
+ _: 1
999
+ }));
1000
+ }
1001
+ };
1002
+ const Ws = {
1003
+ key: 0,
1004
+ class: "pd-thin for-transition w-100"
1005
+ }, Ys = {
1006
+ __name: "Organization",
1007
+ setup(e) {
1008
+ const t = q(), s = E();
1009
+ let n = s.query.tab ? s.query.tab : "events";
1010
+ const l = b(null);
1011
+ me(async () => {
1012
+ l.value = await R.read({ _id: s.params._id, user: D.user._id }), await be.read(s.params._id);
1013
+ });
1014
+ const i = b(n);
1015
+ return s.query.tab = i.value, F(i, (p) => {
1016
+ t.replace({ query: { ...s.query, tab: p } });
1017
+ }), (p, r) => l.value ? (o(), c("div", Ws, [
1018
+ h(jt, {
1019
+ organization: w.current,
1020
+ user: D.user,
1021
+ class: "mn-semi"
1022
+ }, null, 8, ["organization", "user"]),
1023
+ h(Me, {
1024
+ selected: i.value,
1025
+ "onUpdate:selected": r[0] || (r[0] = (u) => i.value = u),
1026
+ tabs: [
1027
+ { name: "Events", value: "events" },
1028
+ { name: "Community", value: "community" }
1029
+ ],
1030
+ class: "mn-small o-hidden h5 radius-big bg-grey"
1031
+ }, null, 8, ["selected"]),
1032
+ h(H, { name: "slide-fade" }, {
1033
+ default: x(() => [
1034
+ i.value === "events" ? (o(), y(Ye, {
1035
+ key: 0,
1036
+ user: D.user._id,
1037
+ owner: k(s).params._id,
1038
+ sortOrder: "asc"
1039
+ }, null, 8, ["user", "owner"])) : g("", !0)
1040
+ ]),
1041
+ _: 1
1042
+ }),
1043
+ h(H, { name: "slide-fade" }, {
1044
+ default: x(() => [
1045
+ i.value === "community" ? (o(), y(Je, {
1046
+ key: 0,
1047
+ user: D.user._id,
1048
+ owner: k(s).params._id
1049
+ }, null, 8, ["user", "owner"])) : g("", !0)
1050
+ ]),
1051
+ _: 1
1052
+ })
1053
+ ])) : g("", !0);
1054
+ }
1055
+ }, Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1056
+ __proto__: null,
1057
+ default: Ys
1058
+ }, Symbol.toStringTag, { value: "Module" })), Qs = { class: "for-transition w-100" }, Xs = {
1059
+ id: "dash",
1060
+ class: "pd-medium bg-grey"
1061
+ }, Gs = { class: "mn-medium radius-medium pd-semi bg-white" }, ea = { class: "flex-nowrap flex mn-small" }, ta = { class: "w-100" }, sa = /* @__PURE__ */ a("path", {
1062
+ d: "M515.693 9.52082C510.095 3.91669 502.49 0.765625 494.563 0.765625C486.635 0.765625 479.036 3.91669 473.432 9.52082L48.7255 434.307C44.8244 438.214 42.0848 443.125 40.8088 448.496L0.939444 615.069C-1.47202 625.168 1.528 635.788 8.86652 643.132C16.2103 650.47 26.8305 653.47 36.9292 651.059L203.516 611.261H203.511C208.88 609.985 213.792 607.246 217.699 603.35L642.485 178.496C648.089 172.892 651.241 165.293 651.241 157.366C651.241 149.439 648.089 141.835 642.485 136.235L515.693 9.52082ZM113.76 453.708L388.307 179.161L472.828 263.682L198.281 538.229L113.76 453.708ZM87.1041 511.5L140.416 564.812L70.3014 581.614L87.1041 511.5ZM515.091 221.793L430.195 136.897L494.184 72.9075L579.08 157.429L515.091 221.793Z",
1063
+ fill: "black"
1064
+ }, null, -1), aa = [
1065
+ sa
1066
+ ], na = ["innerHTML"], oa = { class: "mn-medium radius-medium pd-semi bg-white" }, ia = /* @__PURE__ */ a("h3", { class: "mn-regular" }, "Команда", -1), la = { key: 0 }, ra = { class: "mn-medium radius-medium pd-semi bg-white" }, da = /* @__PURE__ */ a("h3", { class: "mn-regular" }, "Подотделы", -1), ca = { key: 0 }, ua = {
1067
+ __name: "Department",
1068
+ async setup(e) {
1069
+ let t, s;
1070
+ q();
1071
+ const n = E();
1072
+ return [t, s] = Y(() => K.readOne(n.params._id)), await t, s(), (l, i) => (o(), c("div", Qs, [
1073
+ a("div", Xs, [
1074
+ a("section", Gs, [
1075
+ a("div", ea, [
1076
+ a("h2", ta, f(_.department.name), 1),
1077
+ (o(), c("svg", {
1078
+ onClick: i[0] || (i[0] = (p) => l.$router.push(`/app/organization/departments/${_.department._id}/edit`)),
1079
+ class: "i-regular t-transp",
1080
+ width: "652",
1081
+ height: "652",
1082
+ viewBox: "0 0 652 652",
1083
+ fill: "none",
1084
+ xmlns: "http://www.w3.org/2000/svg"
1085
+ }, aa))
1086
+ ]),
1087
+ a("p", {
1088
+ class: "t-transp p-big",
1089
+ innerHTML: _.department.description
1090
+ }, null, 8, na)
1091
+ ]),
1092
+ a("section", oa, [
1093
+ ia,
1094
+ a("ul", null, [
1095
+ _.department.members.length < 1 ? (o(), c("li", la, "В отделе еще нет участников")) : g("", !0),
1096
+ (o(!0), c(O, null, L(_.department.members, (p, r) => (o(), y(Ee, {
1097
+ class: "br-b br-solid br-grey",
1098
+ key: r,
1099
+ user: p.user,
1100
+ position: p.position,
1101
+ onClick: (u) => l.$router.push(`/app/profile/${p.user._id}`)
1102
+ }, null, 8, ["user", "position", "onClick"]))), 128))
1103
+ ])
1104
+ ]),
1105
+ a("section", ra, [
1106
+ da,
1107
+ a("ul", null, [
1108
+ _.department.subdepartments.length < 1 ? (o(), c("li", ca, "В отделе еще нет подотделов")) : g("", !0),
1109
+ (o(!0), c(O, null, L(_.department.subdepartments, (p, r) => (o(), y(Ve, {
1110
+ onClick: (u) => l.$router.push(`/app/organization/departments/${p._id}`),
1111
+ key: r,
1112
+ class: "br-b br-solid br-grey",
1113
+ department: p
1114
+ }, null, 8, ["onClick", "department"]))), 128))
1115
+ ])
1116
+ ])
1117
+ ])
1118
+ ]));
1119
+ }
1120
+ }, pa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1121
+ __proto__: null,
1122
+ default: ua
1123
+ }, Symbol.toStringTag, { value: "Module" }));
1124
+ const ma = { class: "for-transition bg-white radius-big w-100" }, ha = { class: "flex-v-center flex-nowrap flex pd-semi" }, _a = /* @__PURE__ */ a("h2", { class: "mn-r-medium" }, "Organizations", -1), fa = { class: "pd-semi" }, ga = {
1125
+ key: 1,
1126
+ class: "cols-3"
1127
+ }, ba = ["onClick"], va = ["src"], ya = {
1128
+ key: 1,
1129
+ class: "radius-medium mn-small i-thin",
1130
+ width: "42",
1131
+ height: "42",
1132
+ viewBox: "0 0 42 42",
1133
+ fill: "none",
1134
+ xmlns: "http://www.w3.org/2000/svg"
1135
+ }, wa = /* @__PURE__ */ a("circle", {
1136
+ fill: "rgb(var(--main))",
1137
+ cx: "21",
1138
+ cy: "21",
1139
+ r: "21"
1140
+ }, null, -1), $a = /* @__PURE__ */ a("path", {
1141
+ fill: "#242424",
1142
+ "fill-opacity": "0.1",
1143
+ "fill-rule": "evenodd",
1144
+ "clip-rule": "evenodd",
1145
+ d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
1146
+ }, null, -1), Ca = [
1147
+ wa,
1148
+ $a
1149
+ ], ka = { class: "h4 mn-r-semi mn-small" }, xa = ["onClick"], Oa = /* @__PURE__ */ a("path", {
1150
+ fill: "black",
1151
+ d: "M6.41357 11.979C9.6831 11.979 12.3901 9.26611 12.3901 6.00244C12.3901 2.73291 9.67724 0.0258789 6.40771 0.0258789C3.14404 0.0258789 0.437008 2.73291 0.437008 6.00244C0.437008 9.26611 3.1499 11.979 6.41357 11.979ZM6.41357 10.9829C3.64795 10.9829 1.43896 8.76807 1.43896 6.00244C1.43896 3.23682 3.64209 1.02197 6.40771 1.02197C9.17334 1.02197 11.3882 3.23682 11.394 6.00244C11.3999 8.76807 9.1792 10.9829 6.41357 10.9829ZM8.72802 4.36182L9.1499 3.93408C9.3374 3.74072 9.35498 3.52979 9.1792 3.34814L9.04443 3.21924C8.86865 3.0376 8.65185 3.06104 8.46435 3.24854L8.03662 3.67041L8.72802 4.36182ZM4.53271 8.53955L8.37646 4.71338L7.68505 4.02197L3.84716 7.84814L3.51318 8.62158C3.45459 8.76807 3.59521 8.89697 3.72412 8.8501L4.53271 8.53955Z"
1152
+ }, null, -1), La = [
1153
+ Oa
1154
+ ], Sa = { class: "t-black p-small" }, Ei = {
1155
+ __name: "OrganizationsAccount",
1156
+ async setup(e) {
1157
+ let t, s;
1158
+ D.user._id && ([t, s] = Y(() => R.read({ owner: D.user._id })), await t, s());
1159
+ const n = q(), l = E();
1160
+ let i = l.query.tab ? l.query.tab : "details";
1161
+ const p = b(i);
1162
+ return l.query.tab = p.value, F(p, (r) => {
1163
+ n.replace({ query: { ...l.query, tab: r } });
1164
+ }), (r, u) => (o(), c("div", ma, [
1165
+ a("header", ha, [
1166
+ _a,
1167
+ a("button", {
1168
+ onClick: u[0] || (u[0] = (d) => r.$router.push({ name: "Create Organization" })),
1169
+ class: "radius-100p i-semi hover-scale-1 cursor-pointer t-white bg-second"
1170
+ }, "+")
1171
+ ]),
1172
+ a("div", fa, [
1173
+ w.all.length < 1 ? (o(), y(ge, {
1174
+ key: 0,
1175
+ title: "You Haven't Joined Any Organization Yet",
1176
+ description: "Weeder is all about community. Join an organization or maybe you want to create your own?",
1177
+ action: "Create organization",
1178
+ callback: r.a = () => r.$router.push("/app/organization/create/details")
1179
+ }, null, 8, ["callback"])) : (o(), c("div", ga, [
1180
+ (o(!0), c(O, null, L(w.all, (d) => (o(), c("div", {
1181
+ key: d._id,
1182
+ class: "mn-small radius-medium pd-medium br-2px br-solid br-grey",
1183
+ onClick: (m) => r.$router.push({ name: "Organization", params: { _id: d._id } })
1184
+ }, [
1185
+ d.profile.photo.length > 0 ? (o(), c("img", {
1186
+ key: 0,
1187
+ src: (r.FILE_SERVER_URL || "") + d.profile.photo,
1188
+ class: "radius-medium mn-small i-thin"
1189
+ }, null, 8, va)) : (o(), c("svg", ya, Ca)),
1190
+ a("p", ka, f(d.profile.name), 1),
1191
+ (o(), c("svg", {
1192
+ onClick: de((m) => r.$router.push({ name: "Organization Edit", params: { _id: d._id } }), ["stop"]),
1193
+ class: "t-transp hover-scale-1 z-index-1 pos-absolute pos-t-regular pos-r-regular i-medium",
1194
+ width: "13",
1195
+ height: "12",
1196
+ viewBox: "0 0 13 12",
1197
+ xmlns: "http://www.w3.org/2000/svg"
1198
+ }, La, 8, xa)),
1199
+ a("p", Sa, f(d.profile.description.slice(0, 120) + "..."), 1)
1200
+ ], 8, ba))), 128))
1201
+ ]))
1202
+ ])
1203
+ ]));
1204
+ }
1205
+ }, za = { class: "for-transition pd-thin" }, Pa = /* @__PURE__ */ a("h3", { class: "mn-small" }, "Type of group", -1), Ma = /* @__PURE__ */ a("p", { class: "mn-thin" }, "Public groups are open to everyone, whereas in exclusive groups only members can post. If you wish to make a group private, select 'hidden'.", -1), Da = /* @__PURE__ */ a("h3", { class: "mn-small" }, "Profile", -1), Aa = { class: "mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex" }, Va = /* @__PURE__ */ a("h4", null, "Upload photo", -1), Ea = /* @__PURE__ */ a("h3", { class: "mn-small" }, "Socials", -1), Ua = /* @__PURE__ */ a("p", { class: "mn-thin" }, "Please provide only the username for social media profiles, without full links.", -1), Ia = {
1206
+ __name: "OrganizationEdit",
1207
+ async setup(e) {
1208
+ let t, s;
1209
+ const n = E(), l = q();
1210
+ R.reset(), n.params._id && ([t, s] = Y(() => R.read({ _id: n.params._id })), await t, s());
1211
+ const i = Z(() => w.current);
1212
+ async function p() {
1213
+ n.params._id ? await R.update(n.params._id, i.value) : await R.create(w.current, D.user._id);
1214
+ }
1215
+ function r() {
1216
+ l.replace({ name: "Organization", params: { _id: w.current._id } });
1217
+ }
1218
+ return (u, d) => (o(), c("div", za, [
1219
+ Pa,
1220
+ Ma,
1221
+ h(Fe, {
1222
+ modelValue: w.current.types,
1223
+ "onUpdate:modelValue": d[0] || (d[0] = (m) => w.current.types = m),
1224
+ options: ["public", "exclusive", "hidden"],
1225
+ multiple: !1,
1226
+ taggable: !1,
1227
+ placeholder: "Type to search or add type of organization",
1228
+ class: "mn-semi bg-grey pd-medium radius-small"
1229
+ }, null, 8, ["modelValue"]),
1230
+ Da,
1231
+ a("div", Aa, [
1232
+ h(Ae, {
1233
+ photo: w.current.profile.photo,
1234
+ "onUpdate:photo": d[1] || (d[1] = (m) => w.current.profile.photo = m),
1235
+ uploadPath: "organizations/" + w.current._id + "/avatars",
1236
+ class: "h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"
1237
+ }, null, 8, ["photo", "uploadPath"]),
1238
+ Va
1239
+ ]),
1240
+ h(M, {
1241
+ field: w.current.profile.name,
1242
+ "onUpdate:field": d[2] || (d[2] = (m) => w.current.profile.name = m),
1243
+ placeholder: "Name of organization",
1244
+ class: "mn-thin bg-grey pd-medium radius-small"
1245
+ }, null, 8, ["field"]),
1246
+ h(M, {
1247
+ field: w.current.profile.description,
1248
+ "onUpdate:field": d[3] || (d[3] = (m) => w.current.profile.description = m),
1249
+ placeholder: "Brief description of your group",
1250
+ class: "mn-thin bg-grey pd-medium radius-small"
1251
+ }, null, 8, ["field"]),
1252
+ h(qe, {
1253
+ onTagsChanged: d[4] || (d[4] = (m) => w.current.profile.tags = m),
1254
+ tags: w.current.profile.tags
1255
+ }, null, 8, ["tags"]),
1256
+ Ea,
1257
+ Ua,
1258
+ h(M, {
1259
+ field: w.current.socials.instagram,
1260
+ "onUpdate:field": d[5] || (d[5] = (m) => w.current.socials.instagram = m),
1261
+ label: "Instagram",
1262
+ placeholder: "",
1263
+ class: "mn-thin bg-grey pd-medium radius-small"
1264
+ }, null, 8, ["field"]),
1265
+ h(M, {
1266
+ field: w.current.socials.twitter,
1267
+ "onUpdate:field": d[6] || (d[6] = (m) => w.current.socials.twitter = m),
1268
+ label: "Twitter",
1269
+ placeholder: "",
1270
+ class: "mn-thin bg-grey pd-medium radius-small"
1271
+ }, null, 8, ["field"]),
1272
+ h(M, {
1273
+ field: w.current.socials.facebook,
1274
+ "onUpdate:field": d[7] || (d[7] = (m) => w.current.socials.facebook = m),
1275
+ label: "Facebook",
1276
+ placeholder: "",
1277
+ class: "mn-thin bg-grey pd-medium radius-small"
1278
+ }, null, 8, ["field"]),
1279
+ h(M, {
1280
+ field: w.current.socials.telegram,
1281
+ "onUpdate:field": d[8] || (d[8] = (m) => w.current.socials.telegram = m),
1282
+ label: "Telegram",
1283
+ placeholder: "",
1284
+ class: "mn-thin bg-grey pd-medium radius-small"
1285
+ }, null, 8, ["field"]),
1286
+ h(ue, {
1287
+ submit: p,
1288
+ callback: r,
1289
+ class: "mn-thin"
1290
+ }, {
1291
+ default: x(() => [
1292
+ W("Save")
1293
+ ]),
1294
+ _: 1
1295
+ })
1296
+ ]));
1297
+ }
1298
+ }, xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1299
+ __proto__: null,
1300
+ default: Ia
1301
+ }, Symbol.toStringTag, { value: "Module" }));
1302
+ const Ba = { class: "for-transition bg-white radius-big w-100" }, ja = /* @__PURE__ */ a("header", { class: "flex-v-center flex-nowrap flex pd-semi" }, [
1303
+ /* @__PURE__ */ a("h2", { class: "mn-r-medium" }, "Weed dispensaries in Thailand")
1304
+ ], -1), Ta = { class: "pd-semi" }, Fa = {
1305
+ key: 1,
1306
+ class: "cols-3"
1307
+ }, qa = ["onClick"], Ra = ["src"], Za = {
1308
+ key: 1,
1309
+ class: "radius-medium mn-small i-thin",
1310
+ width: "42",
1311
+ height: "42",
1312
+ viewBox: "0 0 42 42",
1313
+ fill: "none",
1314
+ xmlns: "http://www.w3.org/2000/svg"
1315
+ }, Ha = /* @__PURE__ */ a("circle", {
1316
+ fill: "rgb(var(--main))",
1317
+ cx: "21",
1318
+ cy: "21",
1319
+ r: "21"
1320
+ }, null, -1), Na = /* @__PURE__ */ a("path", {
1321
+ fill: "#242424",
1322
+ "fill-opacity": "0.1",
1323
+ "fill-rule": "evenodd",
1324
+ "clip-rule": "evenodd",
1325
+ d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
1326
+ }, null, -1), Ka = [
1327
+ Ha,
1328
+ Na
1329
+ ], Wa = { class: "h4 mn-r-semi mn-small" }, Ya = ["onClick"], Ja = /* @__PURE__ */ a("path", {
1330
+ fill: "black",
1331
+ d: "M6.41357 11.979C9.6831 11.979 12.3901 9.26611 12.3901 6.00244C12.3901 2.73291 9.67724 0.0258789 6.40771 0.0258789C3.14404 0.0258789 0.437008 2.73291 0.437008 6.00244C0.437008 9.26611 3.1499 11.979 6.41357 11.979ZM6.41357 10.9829C3.64795 10.9829 1.43896 8.76807 1.43896 6.00244C1.43896 3.23682 3.64209 1.02197 6.40771 1.02197C9.17334 1.02197 11.3882 3.23682 11.394 6.00244C11.3999 8.76807 9.1792 10.9829 6.41357 10.9829ZM8.72802 4.36182L9.1499 3.93408C9.3374 3.74072 9.35498 3.52979 9.1792 3.34814L9.04443 3.21924C8.86865 3.0376 8.65185 3.06104 8.46435 3.24854L8.03662 3.67041L8.72802 4.36182ZM4.53271 8.53955L8.37646 4.71338L7.68505 4.02197L3.84716 7.84814L3.51318 8.62158C3.45459 8.76807 3.59521 8.89697 3.72412 8.8501L4.53271 8.53955Z"
1332
+ }, null, -1), Qa = [
1333
+ Ja
1334
+ ], Xa = { class: "t-black p-small" }, Ui = {
1335
+ __name: "Organizations",
1336
+ async setup(e) {
1337
+ let t, s;
1338
+ D.user._id && ([t, s] = Y(() => R.read({ owner: D.user._id })), await t, s());
1339
+ const n = q(), l = E();
1340
+ let i = l.query.tab ? l.query.tab : "details";
1341
+ const p = b(i);
1342
+ return l.query.tab = p.value, F(p, (r) => {
1343
+ n.replace({ query: { ...l.query, tab: r } });
1344
+ }), (r, u) => (o(), c("div", Ba, [
1345
+ ja,
1346
+ a("div", Ta, [
1347
+ w.all.length < 1 ? (o(), y(ge, {
1348
+ key: 0,
1349
+ title: "You Haven't Joined Any Organization Yet",
1350
+ description: "Weeder is all about community. Join an organization or maybe you want to create your own?",
1351
+ action: "Create organization",
1352
+ callback: r.a = () => r.$router.push("/app/organization/create/details")
1353
+ }, null, 8, ["callback"])) : (o(), c("div", Fa, [
1354
+ (o(!0), c(O, null, L(w.all, (d) => (o(), c("div", {
1355
+ key: d._id,
1356
+ class: "mn-small radius-medium pd-medium br-2px br-solid br-grey",
1357
+ onClick: (m) => r.$router.push({ name: "Organization", params: { _id: d._id } })
1358
+ }, [
1359
+ d.profile.photo.length > 0 ? (o(), c("img", {
1360
+ key: 0,
1361
+ src: (r.FILE_SERVER_URL || "") + d.profile.photo,
1362
+ class: "radius-medium mn-small i-thin"
1363
+ }, null, 8, Ra)) : (o(), c("svg", Za, Ka)),
1364
+ a("p", Wa, f(d.profile.name), 1),
1365
+ (o(), c("svg", {
1366
+ onClick: de((m) => r.$router.push({ name: "Organization Edit", params: { _id: d._id } }), ["stop"]),
1367
+ class: "t-transp hover-scale-1 z-index-1 pos-absolute pos-t-regular pos-r-regular i-medium",
1368
+ width: "13",
1369
+ height: "12",
1370
+ viewBox: "0 0 13 12",
1371
+ xmlns: "http://www.w3.org/2000/svg"
1372
+ }, Qa, 8, Ya)),
1373
+ a("p", Xa, f(d.profile.description.slice(0, 120) + "..."), 1)
1374
+ ], 8, qa))), 128))
1375
+ ]))
1376
+ ])
1377
+ ]));
1378
+ }
1379
+ };
1380
+ const Ga = {
1381
+ key: 0,
1382
+ class: "t-transp mn-r-small"
1383
+ }, en = ["placeholder", "value"], tn = {
1384
+ key: 0,
1385
+ class: "mn-t-thin invalid-feedback"
1386
+ }, sn = {
1387
+ __name: "Address",
1388
+ props: {
1389
+ apiKey: {
1390
+ type: String,
1391
+ required: !0
1392
+ },
1393
+ label: null,
1394
+ placeholder: "Enter something here",
1395
+ field: null,
1396
+ location: {
1397
+ type: Object,
1398
+ default: { lat: 48.6900735, lng: 41.1620239 }
1399
+ },
1400
+ address: {
1401
+ type: String,
1402
+ default: ""
1403
+ }
1404
+ },
1405
+ emits: ["update:address", "update:location", "update:country", "update:state", "update:city"],
1406
+ setup(e, { emit: t }) {
1407
+ const s = e, n = b(null);
1408
+ let l;
1409
+ const i = () => {
1410
+ l = new google.maps.places.Autocomplete(n.value), l.addListener("place_changed", r);
1411
+ }, p = () => {
1412
+ l || i();
1413
+ }, r = () => {
1414
+ const u = l.getPlace();
1415
+ if (!u.geometry || !u.address_components)
1416
+ return;
1417
+ let d = "", m = "", $ = "";
1418
+ for (let N = 0; N < u.address_components.length; N++) {
1419
+ console.log(u.address_components);
1420
+ let z = u.address_components[N];
1421
+ z.types.includes("country") && (d = z.long_name), z.types.includes("administrative_area_level_1") && (m = z.long_name), z.types.includes("locality") && ($ = z.long_name);
1422
+ }
1423
+ const S = u.formatted_address, U = { lat: u.geometry.location.lat(), lng: u.geometry.location.lng() };
1424
+ t("update:address", S), t("update:location", U), t("update:country", d), t("update:state", m), t("update:city", $);
1425
+ };
1426
+ return ce(() => {
1427
+ s.address !== n.value && (n.value = s.address);
1428
+ }), me(() => {
1429
+ i();
1430
+ }), (u, d) => (o(), c("div", {
1431
+ class: se([u.$attrs.class, "flex-nowrap flex"])
1432
+ }, [
1433
+ e.label ? (o(), c("div", Ga, [
1434
+ a("span", null, f(e.label), 1)
1435
+ ])) : g("", !0),
1436
+ a("input", {
1437
+ ref_key: "addressInput",
1438
+ ref: n,
1439
+ class: "w-100",
1440
+ placeholder: e.placeholder,
1441
+ value: e.address,
1442
+ onInput: p
1443
+ }, null, 40, en),
1444
+ h(H, {
1445
+ mode: "out-in",
1446
+ name: "fade"
1447
+ }, {
1448
+ default: x(() => [
1449
+ u.validation ? (o(), c("div", tn, " * " + f(u.validation.message), 1)) : g("", !0)
1450
+ ]),
1451
+ _: 1
1452
+ })
1453
+ ], 2));
1454
+ }
1455
+ }, an = /* @__PURE__ */ A(sn, [["__scopeId", "data-v-faece1a6"]]);
1456
+ const nn = (e) => (he("data-v-1c7971e5"), e = e(), _e(), e), on = { class: "map-container" }, ln = /* @__PURE__ */ nn(() => /* @__PURE__ */ a("svg", {
1457
+ class: "i-medium",
1458
+ width: "98",
1459
+ height: "98",
1460
+ viewBox: "0 0 98 98",
1461
+ fill: "none",
1462
+ xmlns: "http://www.w3.org/2000/svg"
1463
+ }, [
1464
+ /* @__PURE__ */ a("path", {
1465
+ d: "M50.0004 31.4995C39.7996 31.4995 31.5 39.7991 31.5 49.9999C31.5 60.2007 39.7996 68.5003 50.0004 68.5003C60.2012 68.5003 68.5008 60.2007 68.5008 49.9999C68.5008 39.7991 60.2012 31.4995 50.0004 31.4995ZM50.0004 63.7944C42.3941 63.7944 36.2059 57.6062 36.2059 49.9999C36.2059 42.3936 42.3941 36.2054 50.0004 36.2054C57.6067 36.2054 63.7949 42.3936 63.7949 49.9999C63.7949 57.6062 57.6067 63.7944 50.0004 63.7944Z",
1466
+ fill: "white"
1467
+ }),
1468
+ /* @__PURE__ */ a("path", {
1469
+ d: "M97.6471 47.6471H84.56C83.3977 30.4141 69.5859 16.6024 52.3529 15.44V2.35294C52.3529 1.05255 51.2988 0 50 0C48.6996 0 47.6471 1.05255 47.6471 2.35294V15.44C30.4141 16.6024 16.6024 30.4141 15.44 47.6471H2.35294C1.05255 47.6471 0 48.6996 0 50C0 51.2988 1.05255 52.3529 2.35294 52.3529H15.44C16.6024 69.5859 30.4141 83.3977 47.6471 84.56V97.6471C47.6471 98.9459 48.6996 100 50 100C51.2988 100 52.3529 98.9459 52.3529 97.6471V84.56C69.5859 83.3977 83.3977 69.5859 84.56 52.3529H97.6471C98.9459 52.3529 100 51.2988 100 50C100 48.6996 98.9459 47.6471 97.6471 47.6471ZM50 79.9435C33.4886 79.9435 20.0565 66.5114 20.0565 50C20.0565 33.4886 33.4886 20.0565 50 20.0565C66.5098 20.0565 79.9435 33.4886 79.9435 50C79.9435 66.5098 66.5098 79.9435 50 79.9435Z",
1470
+ fill: "white"
1471
+ })
1472
+ ], -1)), rn = [
1473
+ ln
1474
+ ], dn = {
1475
+ __name: "LocationMarker",
1476
+ props: {
1477
+ location: {
1478
+ type: Object,
1479
+ default: { lat: 48.6900735, lng: 41.1620239 }
1480
+ },
1481
+ address: {
1482
+ type: String,
1483
+ default: ""
1484
+ },
1485
+ apiKey: String
1486
+ },
1487
+ emits: ["update:location", "update:address", "update:country", "update:state", "update:city"],
1488
+ setup(e, { emit: t }) {
1489
+ const s = e, n = b(null);
1490
+ let l, i;
1491
+ me(() => {
1492
+ l = new google.maps.Map(n.value, {
1493
+ center: s.location,
1494
+ zoom: 15,
1495
+ mapTypeControl: !1,
1496
+ fullscreenControl: !1
1497
+ }), i = new google.maps.Marker({
1498
+ position: s.location,
1499
+ map: l,
1500
+ draggable: !0
1501
+ }), i.addListener("dragend", (u) => {
1502
+ const d = { lat: u.latLng.lat(), lng: u.latLng.lng() };
1503
+ t("update:location", d), p(d);
1504
+ });
1505
+ }), ce(() => {
1506
+ s.location && i && i.setPosition(new google.maps.LatLng(s.location.lat, s.location.lng));
1507
+ }), ce(() => {
1508
+ if (s.location && l) {
1509
+ const u = new google.maps.LatLng(s.location.lat, s.location.lng);
1510
+ l.setCenter(u);
1511
+ }
1512
+ });
1513
+ function p(u) {
1514
+ new google.maps.Geocoder().geocode({ location: u }, (m, $) => {
1515
+ if ($ === "OK")
1516
+ if (m[0]) {
1517
+ t("update:address", m[0].formatted_address);
1518
+ let S = "", U = "", N = "";
1519
+ m[0].address_components.forEach((z) => {
1520
+ z.types.includes("country") && (S = z.long_name), z.types.includes("administrative_area_level_1") && (U = z.long_name), z.types.includes("locality") && (N = z.long_name);
1521
+ }), t("update:country", S), t("update:state", U), t("update:city", N);
1522
+ } else
1523
+ console.error("No results found");
1524
+ else
1525
+ console.error("Geocoder failed due to: " + $);
1526
+ });
1527
+ }
1528
+ async function r() {
1529
+ navigator.geolocation ? navigator.geolocation.getCurrentPosition((u) => {
1530
+ const d = { lat: u.coords.latitude, lng: u.coords.longitude };
1531
+ t("update:location", d), p(d);
1532
+ }, () => {
1533
+ console.error("Error getting location");
1534
+ }) : console.error("Geolocation is not supported by this browser.");
1535
+ }
1536
+ return (u, d) => (o(), c("div", on, [
1537
+ a("div", {
1538
+ ref_key: "mapContainer",
1539
+ ref: n,
1540
+ class: "w-100 h-100"
1541
+ }, null, 512),
1542
+ a("button", {
1543
+ class: "pos-absolute pos-t-regular pos-r-regular i-semi bg-second radius-extra",
1544
+ onClick: r
1545
+ }, rn)
1546
+ ]));
1547
+ }
1548
+ }, cn = /* @__PURE__ */ A(dn, [["__scopeId", "data-v-1c7971e5"]]);
1549
+ var un = Object.defineProperty, pn = Object.defineProperties, mn = Object.getOwnPropertyDescriptors, Oe = Object.getOwnPropertySymbols, hn = Object.prototype.hasOwnProperty, _n = Object.prototype.propertyIsEnumerable, Le = (e, t, s) => t in e ? un(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, G = (e, t) => {
1550
+ for (var s in t || (t = {}))
1551
+ hn.call(t, s) && Le(e, s, t[s]);
1552
+ if (Oe)
1553
+ for (var s of Oe(t))
1554
+ _n.call(t, s) && Le(e, s, t[s]);
1555
+ return e;
1556
+ }, Se = (e, t) => pn(e, mn(t));
1557
+ const fn = {
1558
+ props: {
1559
+ autoscroll: {
1560
+ type: Boolean,
1561
+ default: !0
1562
+ }
1563
+ },
1564
+ watch: {
1565
+ typeAheadPointer() {
1566
+ this.autoscroll && this.maybeAdjustScroll();
1567
+ },
1568
+ open(e) {
1569
+ this.autoscroll && e && this.$nextTick(() => this.maybeAdjustScroll());
1570
+ }
1571
+ },
1572
+ methods: {
1573
+ maybeAdjustScroll() {
1574
+ var e;
1575
+ const t = ((e = this.$refs.dropdownMenu) == null ? void 0 : e.children[this.typeAheadPointer]) || !1;
1576
+ if (t) {
1577
+ const s = this.getDropdownViewport(), { top: n, bottom: l, height: i } = t.getBoundingClientRect();
1578
+ if (n < s.top)
1579
+ return this.$refs.dropdownMenu.scrollTop = t.offsetTop;
1580
+ if (l > s.bottom)
1581
+ return this.$refs.dropdownMenu.scrollTop = t.offsetTop - (s.height - i);
1582
+ }
1583
+ },
1584
+ getDropdownViewport() {
1585
+ return this.$refs.dropdownMenu ? this.$refs.dropdownMenu.getBoundingClientRect() : {
1586
+ height: 0,
1587
+ top: 0,
1588
+ bottom: 0
1589
+ };
1590
+ }
1591
+ }
1592
+ }, gn = {
1593
+ data() {
1594
+ return {
1595
+ typeAheadPointer: -1
1596
+ };
1597
+ },
1598
+ watch: {
1599
+ filteredOptions() {
1600
+ for (let e = 0; e < this.filteredOptions.length; e++)
1601
+ if (this.selectable(this.filteredOptions[e])) {
1602
+ this.typeAheadPointer = e;
1603
+ break;
1604
+ }
1605
+ },
1606
+ open(e) {
1607
+ e && this.typeAheadToLastSelected();
1608
+ },
1609
+ selectedValue() {
1610
+ this.open && this.typeAheadToLastSelected();
1611
+ }
1612
+ },
1613
+ methods: {
1614
+ typeAheadUp() {
1615
+ for (let e = this.typeAheadPointer - 1; e >= 0; e--)
1616
+ if (this.selectable(this.filteredOptions[e])) {
1617
+ this.typeAheadPointer = e;
1618
+ break;
1619
+ }
1620
+ },
1621
+ typeAheadDown() {
1622
+ for (let e = this.typeAheadPointer + 1; e < this.filteredOptions.length; e++)
1623
+ if (this.selectable(this.filteredOptions[e])) {
1624
+ this.typeAheadPointer = e;
1625
+ break;
1626
+ }
1627
+ },
1628
+ typeAheadSelect() {
1629
+ const e = this.filteredOptions[this.typeAheadPointer];
1630
+ e && this.selectable(e) && this.select(e);
1631
+ },
1632
+ typeAheadToLastSelected() {
1633
+ this.typeAheadPointer = this.selectedValue.length !== 0 ? this.filteredOptions.indexOf(this.selectedValue[this.selectedValue.length - 1]) : -1;
1634
+ }
1635
+ }
1636
+ }, bn = {
1637
+ props: {
1638
+ loading: {
1639
+ type: Boolean,
1640
+ default: !1
1641
+ }
1642
+ },
1643
+ data() {
1644
+ return {
1645
+ mutableLoading: !1
1646
+ };
1647
+ },
1648
+ watch: {
1649
+ search() {
1650
+ this.$emit("search", this.search, this.toggleLoading);
1651
+ },
1652
+ loading(e) {
1653
+ this.mutableLoading = e;
1654
+ }
1655
+ },
1656
+ methods: {
1657
+ toggleLoading(e = null) {
1658
+ return e == null ? this.mutableLoading = !this.mutableLoading : this.mutableLoading = e;
1659
+ }
1660
+ }
1661
+ }, ve = (e, t) => {
1662
+ const s = e.__vccOpts || e;
1663
+ for (const [n, l] of t)
1664
+ s[n] = l;
1665
+ return s;
1666
+ }, vn = {}, yn = {
1667
+ xmlns: "http://www.w3.org/2000/svg",
1668
+ width: "10",
1669
+ height: "10"
1670
+ }, wn = /* @__PURE__ */ a("path", { d: "M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z" }, null, -1), $n = [
1671
+ wn
1672
+ ];
1673
+ function Cn(e, t) {
1674
+ return o(), c("svg", yn, $n);
1675
+ }
1676
+ const kn = /* @__PURE__ */ ve(vn, [["render", Cn]]), xn = {}, On = {
1677
+ xmlns: "http://www.w3.org/2000/svg",
1678
+ width: "14",
1679
+ height: "10"
1680
+ }, Ln = /* @__PURE__ */ a("path", { d: "M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z" }, null, -1), Sn = [
1681
+ Ln
1682
+ ];
1683
+ function zn(e, t) {
1684
+ return o(), c("svg", On, Sn);
1685
+ }
1686
+ const Pn = /* @__PURE__ */ ve(xn, [["render", zn]]), ze = {
1687
+ Deselect: kn,
1688
+ OpenIndicator: Pn
1689
+ }, Mn = {
1690
+ mounted(e, { instance: t }) {
1691
+ if (t.appendToBody) {
1692
+ const {
1693
+ height: s,
1694
+ top: n,
1695
+ left: l,
1696
+ width: i
1697
+ } = t.$refs.toggle.getBoundingClientRect();
1698
+ let p = window.scrollX || window.pageXOffset, r = window.scrollY || window.pageYOffset;
1699
+ e.unbindPosition = t.calculatePosition(e, t, {
1700
+ width: i + "px",
1701
+ left: p + l + "px",
1702
+ top: r + n + s + "px"
1703
+ }), document.body.appendChild(e);
1704
+ }
1705
+ },
1706
+ unmounted(e, { instance: t }) {
1707
+ t.appendToBody && (e.unbindPosition && typeof e.unbindPosition == "function" && e.unbindPosition(), e.parentNode && e.parentNode.removeChild(e));
1708
+ }
1709
+ };
1710
+ function Dn(e) {
1711
+ const t = {};
1712
+ return Object.keys(e).sort().forEach((s) => {
1713
+ t[s] = e[s];
1714
+ }), JSON.stringify(t);
1715
+ }
1716
+ let An = 0;
1717
+ function Vn() {
1718
+ return ++An;
1719
+ }
1720
+ const En = {
1721
+ components: G({}, ze),
1722
+ directives: { appendToBody: Mn },
1723
+ mixins: [fn, gn, bn],
1724
+ compatConfig: {
1725
+ MODE: 3
1726
+ },
1727
+ emits: [
1728
+ "open",
1729
+ "close",
1730
+ "update:modelValue",
1731
+ "search",
1732
+ "search:compositionstart",
1733
+ "search:compositionend",
1734
+ "search:keydown",
1735
+ "search:blur",
1736
+ "search:focus",
1737
+ "search:input",
1738
+ "option:created",
1739
+ "option:selecting",
1740
+ "option:selected",
1741
+ "option:deselecting",
1742
+ "option:deselected"
1743
+ ],
1744
+ props: {
1745
+ modelValue: {},
1746
+ components: {
1747
+ type: Object,
1748
+ default: () => ({})
1749
+ },
1750
+ options: {
1751
+ type: Array,
1752
+ default() {
1753
+ return [];
1754
+ }
1755
+ },
1756
+ disabled: {
1757
+ type: Boolean,
1758
+ default: !1
1759
+ },
1760
+ clearable: {
1761
+ type: Boolean,
1762
+ default: !0
1763
+ },
1764
+ deselectFromDropdown: {
1765
+ type: Boolean,
1766
+ default: !1
1767
+ },
1768
+ searchable: {
1769
+ type: Boolean,
1770
+ default: !0
1771
+ },
1772
+ multiple: {
1773
+ type: Boolean,
1774
+ default: !1
1775
+ },
1776
+ placeholder: {
1777
+ type: String,
1778
+ default: ""
1779
+ },
1780
+ transition: {
1781
+ type: String,
1782
+ default: "vs__fade"
1783
+ },
1784
+ clearSearchOnSelect: {
1785
+ type: Boolean,
1786
+ default: !0
1787
+ },
1788
+ closeOnSelect: {
1789
+ type: Boolean,
1790
+ default: !0
1791
+ },
1792
+ label: {
1793
+ type: String,
1794
+ default: "label"
1795
+ },
1796
+ autocomplete: {
1797
+ type: String,
1798
+ default: "off"
1799
+ },
1800
+ reduce: {
1801
+ type: Function,
1802
+ default: (e) => e
1803
+ },
1804
+ selectable: {
1805
+ type: Function,
1806
+ default: (e) => !0
1807
+ },
1808
+ getOptionLabel: {
1809
+ type: Function,
1810
+ default(e) {
1811
+ return typeof e == "object" ? e.hasOwnProperty(this.label) ? e[this.label] : console.warn(`[vue-select warn]: Label key "option.${this.label}" does not exist in options object ${JSON.stringify(e)}.
1812
+ https://vue-select.org/api/props.html#getoptionlabel`) : e;
1813
+ }
1814
+ },
1815
+ getOptionKey: {
1816
+ type: Function,
1817
+ default(e) {
1818
+ if (typeof e != "object")
1819
+ return e;
1820
+ try {
1821
+ return e.hasOwnProperty("id") ? e.id : Dn(e);
1822
+ } catch (t) {
1823
+ return console.warn(`[vue-select warn]: Could not stringify this option to generate unique key. Please provide'getOptionKey' prop to return a unique key for each option.
1824
+ https://vue-select.org/api/props.html#getoptionkey`, e, t);
1825
+ }
1826
+ }
1827
+ },
1828
+ onTab: {
1829
+ type: Function,
1830
+ default: function() {
1831
+ this.selectOnTab && !this.isComposing && this.typeAheadSelect();
1832
+ }
1833
+ },
1834
+ taggable: {
1835
+ type: Boolean,
1836
+ default: !1
1837
+ },
1838
+ tabindex: {
1839
+ type: Number,
1840
+ default: null
1841
+ },
1842
+ pushTags: {
1843
+ type: Boolean,
1844
+ default: !1
1845
+ },
1846
+ filterable: {
1847
+ type: Boolean,
1848
+ default: !0
1849
+ },
1850
+ filterBy: {
1851
+ type: Function,
1852
+ default(e, t, s) {
1853
+ return (t || "").toLocaleLowerCase().indexOf(s.toLocaleLowerCase()) > -1;
1854
+ }
1855
+ },
1856
+ filter: {
1857
+ type: Function,
1858
+ default(e, t) {
1859
+ return e.filter((s) => {
1860
+ let n = this.getOptionLabel(s);
1861
+ return typeof n == "number" && (n = n.toString()), this.filterBy(s, n, t);
1862
+ });
1863
+ }
1864
+ },
1865
+ createOption: {
1866
+ type: Function,
1867
+ default(e) {
1868
+ return typeof this.optionList[0] == "object" ? { [this.label]: e } : e;
1869
+ }
1870
+ },
1871
+ resetOnOptionsChange: {
1872
+ default: !1,
1873
+ validator: (e) => ["function", "boolean"].includes(typeof e)
1874
+ },
1875
+ clearSearchOnBlur: {
1876
+ type: Function,
1877
+ default: function({ clearSearchOnSelect: e, multiple: t }) {
1878
+ return e && !t;
1879
+ }
1880
+ },
1881
+ noDrop: {
1882
+ type: Boolean,
1883
+ default: !1
1884
+ },
1885
+ inputId: {
1886
+ type: String
1887
+ },
1888
+ dir: {
1889
+ type: String,
1890
+ default: "auto"
1891
+ },
1892
+ selectOnTab: {
1893
+ type: Boolean,
1894
+ default: !1
1895
+ },
1896
+ selectOnKeyCodes: {
1897
+ type: Array,
1898
+ default: () => [13]
1899
+ },
1900
+ searchInputQuerySelector: {
1901
+ type: String,
1902
+ default: "[type=search]"
1903
+ },
1904
+ mapKeydown: {
1905
+ type: Function,
1906
+ default: (e, t) => e
1907
+ },
1908
+ appendToBody: {
1909
+ type: Boolean,
1910
+ default: !1
1911
+ },
1912
+ calculatePosition: {
1913
+ type: Function,
1914
+ default(e, t, { width: s, top: n, left: l }) {
1915
+ e.style.top = n, e.style.left = l, e.style.width = s;
1916
+ }
1917
+ },
1918
+ dropdownShouldOpen: {
1919
+ type: Function,
1920
+ default({ noDrop: e, open: t, mutableLoading: s }) {
1921
+ return e ? !1 : t && !s;
1922
+ }
1923
+ },
1924
+ uid: {
1925
+ type: [String, Number],
1926
+ default: () => Vn()
1927
+ }
1928
+ },
1929
+ data() {
1930
+ return {
1931
+ search: "",
1932
+ open: !1,
1933
+ isComposing: !1,
1934
+ pushedTags: [],
1935
+ _value: [],
1936
+ deselectButtons: []
1937
+ };
1938
+ },
1939
+ computed: {
1940
+ isReducingValues() {
1941
+ return this.$props.reduce !== this.$options.props.reduce.default;
1942
+ },
1943
+ isTrackingValues() {
1944
+ return typeof this.modelValue > "u" || this.isReducingValues;
1945
+ },
1946
+ selectedValue() {
1947
+ let e = this.modelValue;
1948
+ return this.isTrackingValues && (e = this.$data._value), e != null && e !== "" ? [].concat(e) : [];
1949
+ },
1950
+ optionList() {
1951
+ return this.options.concat(this.pushTags ? this.pushedTags : []);
1952
+ },
1953
+ searchEl() {
1954
+ return this.$slots.search ? this.$refs.selectedOptions.querySelector(this.searchInputQuerySelector) : this.$refs.search;
1955
+ },
1956
+ scope() {
1957
+ const e = {
1958
+ search: this.search,
1959
+ loading: this.loading,
1960
+ searching: this.searching,
1961
+ filteredOptions: this.filteredOptions
1962
+ };
1963
+ return {
1964
+ search: {
1965
+ attributes: G({
1966
+ disabled: this.disabled,
1967
+ placeholder: this.searchPlaceholder,
1968
+ tabindex: this.tabindex,
1969
+ readonly: !this.searchable,
1970
+ id: this.inputId,
1971
+ "aria-autocomplete": "list",
1972
+ "aria-labelledby": `vs${this.uid}__combobox`,
1973
+ "aria-controls": `vs${this.uid}__listbox`,
1974
+ ref: "search",
1975
+ type: "search",
1976
+ autocomplete: this.autocomplete,
1977
+ value: this.search
1978
+ }, this.dropdownOpen && this.filteredOptions[this.typeAheadPointer] ? {
1979
+ "aria-activedescendant": `vs${this.uid}__option-${this.typeAheadPointer}`
1980
+ } : {}),
1981
+ events: {
1982
+ compositionstart: () => this.isComposing = !0,
1983
+ compositionend: () => this.isComposing = !1,
1984
+ keydown: this.onSearchKeyDown,
1985
+ blur: this.onSearchBlur,
1986
+ focus: this.onSearchFocus,
1987
+ input: (t) => this.search = t.target.value
1988
+ }
1989
+ },
1990
+ spinner: {
1991
+ loading: this.mutableLoading
1992
+ },
1993
+ noOptions: {
1994
+ search: this.search,
1995
+ loading: this.mutableLoading,
1996
+ searching: this.searching
1997
+ },
1998
+ openIndicator: {
1999
+ attributes: {
2000
+ ref: "openIndicator",
2001
+ role: "presentation",
2002
+ class: "vs__open-indicator"
2003
+ }
2004
+ },
2005
+ listHeader: e,
2006
+ listFooter: e,
2007
+ header: Se(G({}, e), { deselect: this.deselect }),
2008
+ footer: Se(G({}, e), { deselect: this.deselect })
2009
+ };
2010
+ },
2011
+ childComponents() {
2012
+ return G(G({}, ze), this.components);
2013
+ },
2014
+ stateClasses() {
2015
+ return {
2016
+ "vs--open": this.dropdownOpen,
2017
+ "vs--single": !this.multiple,
2018
+ "vs--multiple": this.multiple,
2019
+ "vs--searching": this.searching && !this.noDrop,
2020
+ "vs--searchable": this.searchable && !this.noDrop,
2021
+ "vs--unsearchable": !this.searchable,
2022
+ "vs--loading": this.mutableLoading,
2023
+ "vs--disabled": this.disabled
2024
+ };
2025
+ },
2026
+ searching() {
2027
+ return !!this.search;
2028
+ },
2029
+ dropdownOpen() {
2030
+ return this.dropdownShouldOpen(this);
2031
+ },
2032
+ searchPlaceholder() {
2033
+ return this.isValueEmpty && this.placeholder ? this.placeholder : void 0;
2034
+ },
2035
+ filteredOptions() {
2036
+ const e = [].concat(this.optionList);
2037
+ if (!this.filterable && !this.taggable)
2038
+ return e;
2039
+ const t = this.search.length ? this.filter(e, this.search, this) : e;
2040
+ if (this.taggable && this.search.length) {
2041
+ const s = this.createOption(this.search);
2042
+ this.optionExists(s) || t.unshift(s);
2043
+ }
2044
+ return t;
2045
+ },
2046
+ isValueEmpty() {
2047
+ return this.selectedValue.length === 0;
2048
+ },
2049
+ showClearButton() {
2050
+ return !this.multiple && this.clearable && !this.open && !this.isValueEmpty;
2051
+ }
2052
+ },
2053
+ watch: {
2054
+ options(e, t) {
2055
+ const s = () => typeof this.resetOnOptionsChange == "function" ? this.resetOnOptionsChange(e, t, this.selectedValue) : this.resetOnOptionsChange;
2056
+ !this.taggable && s() && this.clearSelection(), this.modelValue && this.isTrackingValues && this.setInternalValueFromOptions(this.modelValue);
2057
+ },
2058
+ modelValue: {
2059
+ immediate: !0,
2060
+ handler(e) {
2061
+ this.isTrackingValues && this.setInternalValueFromOptions(e);
2062
+ }
2063
+ },
2064
+ multiple() {
2065
+ this.clearSelection();
2066
+ },
2067
+ open(e) {
2068
+ this.$emit(e ? "open" : "close");
2069
+ }
2070
+ },
2071
+ created() {
2072
+ this.mutableLoading = this.loading;
2073
+ },
2074
+ methods: {
2075
+ setInternalValueFromOptions(e) {
2076
+ Array.isArray(e) ? this.$data._value = e.map((t) => this.findOptionFromReducedValue(t)) : this.$data._value = this.findOptionFromReducedValue(e);
2077
+ },
2078
+ select(e) {
2079
+ this.$emit("option:selecting", e), this.isOptionSelected(e) ? this.deselectFromDropdown && (this.clearable || this.multiple && this.selectedValue.length > 1) && this.deselect(e) : (this.taggable && !this.optionExists(e) && (this.$emit("option:created", e), this.pushTag(e)), this.multiple && (e = this.selectedValue.concat(e)), this.updateValue(e), this.$emit("option:selected", e)), this.onAfterSelect(e);
2080
+ },
2081
+ deselect(e) {
2082
+ this.$emit("option:deselecting", e), this.updateValue(this.selectedValue.filter((t) => !this.optionComparator(t, e))), this.$emit("option:deselected", e);
2083
+ },
2084
+ clearSelection() {
2085
+ this.updateValue(this.multiple ? [] : null);
2086
+ },
2087
+ onAfterSelect(e) {
2088
+ this.closeOnSelect && (this.open = !this.open, this.searchEl.blur()), this.clearSearchOnSelect && (this.search = "");
2089
+ },
2090
+ updateValue(e) {
2091
+ typeof this.modelValue > "u" && (this.$data._value = e), e !== null && (Array.isArray(e) ? e = e.map((t) => this.reduce(t)) : e = this.reduce(e)), this.$emit("update:modelValue", e);
2092
+ },
2093
+ toggleDropdown(e) {
2094
+ const t = e.target !== this.searchEl;
2095
+ t && e.preventDefault();
2096
+ const s = [
2097
+ ...this.deselectButtons || [],
2098
+ this.$refs.clearButton
2099
+ ];
2100
+ if (this.searchEl === void 0 || s.filter(Boolean).some((n) => n.contains(e.target) || n === e.target)) {
2101
+ e.preventDefault();
2102
+ return;
2103
+ }
2104
+ this.open && t ? this.searchEl.blur() : this.disabled || (this.open = !0, this.searchEl.focus());
2105
+ },
2106
+ isOptionSelected(e) {
2107
+ return this.selectedValue.some((t) => this.optionComparator(t, e));
2108
+ },
2109
+ isOptionDeselectable(e) {
2110
+ return this.isOptionSelected(e) && this.deselectFromDropdown;
2111
+ },
2112
+ optionComparator(e, t) {
2113
+ return this.getOptionKey(e) === this.getOptionKey(t);
2114
+ },
2115
+ findOptionFromReducedValue(e) {
2116
+ const t = (n) => JSON.stringify(this.reduce(n)) === JSON.stringify(e), s = [...this.options, ...this.pushedTags].filter(t);
2117
+ return s.length === 1 ? s[0] : s.find((n) => this.optionComparator(n, this.$data._value)) || e;
2118
+ },
2119
+ closeSearchOptions() {
2120
+ this.open = !1, this.$emit("search:blur");
2121
+ },
2122
+ maybeDeleteValue() {
2123
+ if (!this.searchEl.value.length && this.selectedValue && this.selectedValue.length && this.clearable) {
2124
+ let e = null;
2125
+ this.multiple && (e = [
2126
+ ...this.selectedValue.slice(0, this.selectedValue.length - 1)
2127
+ ]), this.updateValue(e);
2128
+ }
2129
+ },
2130
+ optionExists(e) {
2131
+ return this.optionList.some((t) => this.optionComparator(t, e));
2132
+ },
2133
+ normalizeOptionForSlot(e) {
2134
+ return typeof e == "object" ? e : { [this.label]: e };
2135
+ },
2136
+ pushTag(e) {
2137
+ this.pushedTags.push(e);
2138
+ },
2139
+ onEscape() {
2140
+ this.search.length ? this.search = "" : this.searchEl.blur();
2141
+ },
2142
+ onSearchBlur() {
2143
+ if (this.mousedown && !this.searching)
2144
+ this.mousedown = !1;
2145
+ else {
2146
+ const { clearSearchOnSelect: e, multiple: t } = this;
2147
+ this.clearSearchOnBlur({ clearSearchOnSelect: e, multiple: t }) && (this.search = ""), this.closeSearchOptions();
2148
+ return;
2149
+ }
2150
+ if (this.search.length === 0 && this.options.length === 0) {
2151
+ this.closeSearchOptions();
2152
+ return;
2153
+ }
2154
+ },
2155
+ onSearchFocus() {
2156
+ this.open = !0, this.$emit("search:focus");
2157
+ },
2158
+ onMousedown() {
2159
+ this.mousedown = !0;
2160
+ },
2161
+ onMouseUp() {
2162
+ this.mousedown = !1;
2163
+ },
2164
+ onSearchKeyDown(e) {
2165
+ const t = (l) => (l.preventDefault(), !this.isComposing && this.typeAheadSelect()), s = {
2166
+ 8: (l) => this.maybeDeleteValue(),
2167
+ 9: (l) => this.onTab(),
2168
+ 27: (l) => this.onEscape(),
2169
+ 38: (l) => (l.preventDefault(), this.typeAheadUp()),
2170
+ 40: (l) => (l.preventDefault(), this.typeAheadDown())
2171
+ };
2172
+ this.selectOnKeyCodes.forEach((l) => s[l] = t);
2173
+ const n = this.mapKeydown(s, this);
2174
+ if (typeof n[e.keyCode] == "function")
2175
+ return n[e.keyCode](e);
2176
+ }
2177
+ }
2178
+ }, Un = ["dir"], In = ["id", "aria-expanded", "aria-owns"], Bn = {
2179
+ ref: "selectedOptions",
2180
+ class: "vs__selected-options"
2181
+ }, jn = ["disabled", "title", "aria-label", "onClick"], Tn = {
2182
+ ref: "actions",
2183
+ class: "vs__actions"
2184
+ }, Fn = ["disabled"], qn = { class: "vs__spinner" }, Rn = ["id"], Zn = ["id", "aria-selected", "onMouseover", "onClick"], Hn = {
2185
+ key: 0,
2186
+ class: "vs__no-options"
2187
+ }, Nn = /* @__PURE__ */ W(" Sorry, no matching options. "), Kn = ["id"];
2188
+ function Wn(e, t, s, n, l, i) {
2189
+ const p = Ie("append-to-body");
2190
+ return o(), c("div", {
2191
+ dir: s.dir,
2192
+ class: se(["v-select", i.stateClasses])
2193
+ }, [
2194
+ P(e.$slots, "header", V(I(i.scope.header))),
2195
+ a("div", {
2196
+ id: `vs${s.uid}__combobox`,
2197
+ ref: "toggle",
2198
+ class: "vs__dropdown-toggle",
2199
+ role: "combobox",
2200
+ "aria-expanded": i.dropdownOpen.toString(),
2201
+ "aria-owns": `vs${s.uid}__listbox`,
2202
+ "aria-label": "Search for option",
2203
+ onMousedown: t[1] || (t[1] = (r) => i.toggleDropdown(r))
2204
+ }, [
2205
+ a("div", Bn, [
2206
+ (o(!0), c(O, null, L(i.selectedValue, (r, u) => P(e.$slots, "selected-option-container", {
2207
+ option: i.normalizeOptionForSlot(r),
2208
+ deselect: i.deselect,
2209
+ multiple: s.multiple,
2210
+ disabled: s.disabled
2211
+ }, () => [
2212
+ (o(), c("span", {
2213
+ key: s.getOptionKey(r),
2214
+ class: "vs__selected"
2215
+ }, [
2216
+ P(e.$slots, "selected-option", V(I(i.normalizeOptionForSlot(r))), () => [
2217
+ W(f(s.getOptionLabel(r)), 1)
2218
+ ]),
2219
+ s.multiple ? (o(), c("button", {
2220
+ key: 0,
2221
+ ref_for: !0,
2222
+ ref: (d) => l.deselectButtons[u] = d,
2223
+ disabled: s.disabled,
2224
+ type: "button",
2225
+ class: "vs__deselect",
2226
+ title: `Deselect ${s.getOptionLabel(r)}`,
2227
+ "aria-label": `Deselect ${s.getOptionLabel(r)}`,
2228
+ onClick: (d) => i.deselect(r)
2229
+ }, [
2230
+ (o(), y(re(i.childComponents.Deselect)))
2231
+ ], 8, jn)) : g("", !0)
2232
+ ]))
2233
+ ])), 256)),
2234
+ P(e.$slots, "search", V(I(i.scope.search)), () => [
2235
+ a("input", ye({ class: "vs__search" }, i.scope.search.attributes, Be(i.scope.search.events)), null, 16)
2236
+ ])
2237
+ ], 512),
2238
+ a("div", Tn, [
2239
+ ne(a("button", {
2240
+ ref: "clearButton",
2241
+ disabled: s.disabled,
2242
+ type: "button",
2243
+ class: "vs__clear",
2244
+ title: "Clear Selected",
2245
+ "aria-label": "Clear Selected",
2246
+ onClick: t[0] || (t[0] = (...r) => i.clearSelection && i.clearSelection(...r))
2247
+ }, [
2248
+ (o(), y(re(i.childComponents.Deselect)))
2249
+ ], 8, Fn), [
2250
+ [we, i.showClearButton]
2251
+ ]),
2252
+ P(e.$slots, "open-indicator", V(I(i.scope.openIndicator)), () => [
2253
+ s.noDrop ? g("", !0) : (o(), y(re(i.childComponents.OpenIndicator), V(ye({ key: 0 }, i.scope.openIndicator.attributes)), null, 16))
2254
+ ]),
2255
+ P(e.$slots, "spinner", V(I(i.scope.spinner)), () => [
2256
+ ne(a("div", qn, "Loading...", 512), [
2257
+ [we, e.mutableLoading]
2258
+ ])
2259
+ ])
2260
+ ], 512)
2261
+ ], 40, In),
2262
+ h(H, { name: s.transition }, {
2263
+ default: x(() => [
2264
+ i.dropdownOpen ? ne((o(), c("ul", {
2265
+ id: `vs${s.uid}__listbox`,
2266
+ ref: "dropdownMenu",
2267
+ key: `vs${s.uid}__listbox`,
2268
+ class: "vs__dropdown-menu",
2269
+ role: "listbox",
2270
+ tabindex: "-1",
2271
+ onMousedown: t[2] || (t[2] = de((...r) => i.onMousedown && i.onMousedown(...r), ["prevent"])),
2272
+ onMouseup: t[3] || (t[3] = (...r) => i.onMouseUp && i.onMouseUp(...r))
2273
+ }, [
2274
+ P(e.$slots, "list-header", V(I(i.scope.listHeader))),
2275
+ (o(!0), c(O, null, L(i.filteredOptions, (r, u) => (o(), c("li", {
2276
+ id: `vs${s.uid}__option-${u}`,
2277
+ key: s.getOptionKey(r),
2278
+ role: "option",
2279
+ class: se(["vs__dropdown-option", {
2280
+ "vs__dropdown-option--deselect": i.isOptionDeselectable(r) && u === e.typeAheadPointer,
2281
+ "vs__dropdown-option--selected": i.isOptionSelected(r),
2282
+ "vs__dropdown-option--highlight": u === e.typeAheadPointer,
2283
+ "vs__dropdown-option--disabled": !s.selectable(r)
2284
+ }]),
2285
+ "aria-selected": u === e.typeAheadPointer ? !0 : null,
2286
+ onMouseover: (d) => s.selectable(r) ? e.typeAheadPointer = u : null,
2287
+ onClick: de((d) => s.selectable(r) ? i.select(r) : null, ["prevent", "stop"])
2288
+ }, [
2289
+ P(e.$slots, "option", V(I(i.normalizeOptionForSlot(r))), () => [
2290
+ W(f(s.getOptionLabel(r)), 1)
2291
+ ])
2292
+ ], 42, Zn))), 128)),
2293
+ i.filteredOptions.length === 0 ? (o(), c("li", Hn, [
2294
+ P(e.$slots, "no-options", V(I(i.scope.noOptions)), () => [
2295
+ Nn
2296
+ ])
2297
+ ])) : g("", !0),
2298
+ P(e.$slots, "list-footer", V(I(i.scope.listFooter)))
2299
+ ], 40, Rn)), [
2300
+ [p]
2301
+ ]) : (o(), c("ul", {
2302
+ key: 1,
2303
+ id: `vs${s.uid}__listbox`,
2304
+ role: "listbox",
2305
+ style: { display: "none", visibility: "hidden" }
2306
+ }, null, 8, Kn))
2307
+ ]),
2308
+ _: 3
2309
+ }, 8, ["name"]),
2310
+ P(e.$slots, "footer", V(I(i.scope.footer)))
2311
+ ], 10, Un);
2312
+ }
2313
+ const Ue = /* @__PURE__ */ ve(En, [["render", Wn]]);
2314
+ const Yn = { class: "w-100" }, Jn = { class: "flex" }, Qn = { class: "mn-regular" }, Xn = { class: "flex-column flex-wrap block" }, Gn = {
2315
+ key: 0,
2316
+ class: "w-100"
2317
+ }, eo = { class: "w-100 flex-center flex-nowrap flex" }, to = { class: "mn-r-regular w-100" }, so = ["onClick"], ao = {
2318
+ key: 0,
2319
+ class: "mn-t-small mn-small w-100"
2320
+ }, Ii = {
2321
+ __name: "EditArray",
2322
+ props: {
2323
+ name: Object,
2324
+ items: Array
2325
+ },
2326
+ emits: ["add", "remove"],
2327
+ setup(e, { emit: t }) {
2328
+ q(), E();
2329
+ let s = ie([]);
2330
+ je(s);
2331
+ const n = b(null), l = b(null), i = b(null);
2332
+ Z(() => {
2333
+ if (n.value === null || i.value === null || i.value === "")
2334
+ return !0;
2335
+ if (n.value.modifications.length > 0)
2336
+ return l.value === null;
2337
+ });
2338
+ function p(r) {
2339
+ store.commit("leftovers/deleteItemFromLeftover", r);
2340
+ }
2341
+ return (r, u) => (o(), c("div", Yn, [
2342
+ a("div", Jn, [
2343
+ a("h3", Qn, f(e.name), 1)
2344
+ ]),
2345
+ a("ul", Xn, [
2346
+ e.items.length < 1 ? (o(), c("span", Gn, "Вы еще не добавили позиции")) : g("", !0),
2347
+ (o(!0), c(O, null, L(e.items, (d, m) => (o(), c("li", {
2348
+ key: d._id,
2349
+ class: "w-100"
2350
+ }, [
2351
+ a("div", eo, [
2352
+ a("span", to, f(d.name), 1),
2353
+ a("a", {
2354
+ class: "w-20 button",
2355
+ onClick: ($) => p(d)
2356
+ }, "Удалить", 8, so)
2357
+ ]),
2358
+ m != e.items.length - 1 ? (o(), c("hr", ao)) : g("", !0)
2359
+ ]))), 128))
2360
+ ])
2361
+ ]));
2362
+ }
2363
+ };
2364
+ const no = { class: "br-grey radius-small mn-small" }, oo = {
2365
+ key: 1,
2366
+ class: "pd-small br-grey br-1px br-solid"
2367
+ }, io = ["disabled"], lo = {
2368
+ __name: "DepartmentMemberModify",
2369
+ props: {
2370
+ isPopupOpen: Boolean,
2371
+ department: Number,
2372
+ departments: Array,
2373
+ maindepartment: Object,
2374
+ alldepartments: Array
2375
+ },
2376
+ emits: ["callback", "remove"],
2377
+ setup(e, { emit: t }) {
2378
+ const s = e, n = b({
2379
+ subdepartment: null
2380
+ });
2381
+ s.department !== null && (n.value = s.departments[s.department]);
2382
+ function l(u, d, m) {
2383
+ return u.filter(($) => !(d.some((S) => S._id === $._id) || m._id === $._id));
2384
+ }
2385
+ const i = Z(() => l(s.alldepartments, s.departments, s.maindepartment));
2386
+ async function p() {
2387
+ s.departments.push(n.value.subdepartment), t("callback");
2388
+ }
2389
+ async function r() {
2390
+ s.departments.splice(s.department, 1), t("callback");
2391
+ }
2392
+ return (u, d) => (o(), c("div", null, [
2393
+ a("div", no, [
2394
+ s.department === null ? (o(), y(k(Ue), {
2395
+ key: 0,
2396
+ modelValue: n.value.subdepartment,
2397
+ "onUpdate:modelValue": d[0] || (d[0] = (m) => n.value.subdepartment = m),
2398
+ options: k(i),
2399
+ "get-option-label": (m) => m.name,
2400
+ class: "w-100 mn-small"
2401
+ }, null, 8, ["modelValue", "options", "get-option-label"])) : (o(), c("div", oo, f(n.value.name ? n.value.name : "Безымянный"), 1))
2402
+ ]),
2403
+ s.department === null ? (o(), c("button", {
2404
+ key: 0,
2405
+ disabled: !n.value.subdepartment,
2406
+ onClick: p,
2407
+ class: "w-100 button bg-second t-white"
2408
+ }, " Добавить отдел ", 8, io)) : g("", !0),
2409
+ s.department !== null ? (o(), c("button", {
2410
+ key: 1,
2411
+ onClick: r,
2412
+ class: "w-100 button bg-fourth t-white"
2413
+ }, " Удалить отдел ")) : g("", !0)
2414
+ ]));
2415
+ }
2416
+ }, Bi = /* @__PURE__ */ A(lo, [["__scopeId", "data-v-21f393e1"]]);
2417
+ const ro = { class: "br-grey radius-small mn-small" }, co = {
2418
+ key: 1,
2419
+ class: "pd-small br-grey br-1px br-solid"
2420
+ }, uo = ["disabled"], po = {
2421
+ __name: "DepartmentSubDepartmentModify",
2422
+ props: {
2423
+ isPopupOpen: Boolean,
2424
+ department: Number,
2425
+ departments: Array,
2426
+ maindepartment: Object,
2427
+ alldepartments: Array
2428
+ },
2429
+ emits: ["callback", "remove"],
2430
+ setup(e, { emit: t }) {
2431
+ const s = e, n = b({
2432
+ subdepartment: null
2433
+ });
2434
+ s.department !== null && (n.value = s.departments[s.department]);
2435
+ function l(u, d, m) {
2436
+ return u.filter(($) => !(d.some((S) => S._id === $._id) || m._id === $._id));
2437
+ }
2438
+ const i = Z(() => l(s.alldepartments, s.departments, s.maindepartment));
2439
+ async function p() {
2440
+ s.departments.push(n.value.subdepartment), t("callback");
2441
+ }
2442
+ async function r() {
2443
+ s.departments.splice(s.department, 1), t("callback");
2444
+ }
2445
+ return (u, d) => (o(), c("div", null, [
2446
+ a("div", ro, [
2447
+ s.department === null ? (o(), y(k(Ue), {
2448
+ key: 0,
2449
+ modelValue: n.value.subdepartment,
2450
+ "onUpdate:modelValue": d[0] || (d[0] = (m) => n.value.subdepartment = m),
2451
+ options: k(i),
2452
+ "get-option-label": (m) => m.name,
2453
+ class: "w-100 mn-small"
2454
+ }, null, 8, ["modelValue", "options", "get-option-label"])) : (o(), c("div", co, f(n.value.name ? n.value.name : "Безымянный"), 1))
2455
+ ]),
2456
+ s.department === null ? (o(), c("button", {
2457
+ key: 0,
2458
+ disabled: !n.value.subdepartment,
2459
+ onClick: p,
2460
+ class: "w-100 button bg-second t-white"
2461
+ }, " Добавить отдел ", 8, uo)) : g("", !0),
2462
+ s.department !== null ? (o(), c("button", {
2463
+ key: 1,
2464
+ onClick: r,
2465
+ class: "w-100 button bg-fourth t-white"
2466
+ }, " Удалить отдел ")) : g("", !0)
2467
+ ]));
2468
+ }
2469
+ }, ji = /* @__PURE__ */ A(po, [["__scopeId", "data-v-d3c6f191"]]);
2470
+ const ae = (e) => (he("data-v-195322bd"), e = e(), _e(), e), mo = { class: "for-transition w-100" }, ho = { class: "pd-b-zero pd-t-zero pd-thin" }, _o = { class: "pd-thin" }, fo = { class: "flex-nowrap flex bg-grey pd-medium radius-big" }, go = {
2471
+ key: 0,
2472
+ class: "mn-r-auto"
2473
+ }, bo = {
2474
+ key: 1,
2475
+ class: "mn-r-auto"
2476
+ }, vo = { class: "flex-nowrap flex pd-thin" }, yo = { class: "pd-b-zero pd-t-zero pd-thin cols-2 gap-thin" }, wo = { class: "flex-stretch flex-column flex" }, $o = { class: "mn-thin bg-grey pd-medium o-hidden radius-big" }, Co = /* @__PURE__ */ ae(() => /* @__PURE__ */ a("h3", { class: "mn-semi" }, "Profile", -1)), ko = { class: "radius-small flex-nowrap flex" }, xo = { class: "w-100 flex-child-grow-1 flex-child" }, Oo = { class: "bg-grey pd-medium o-hidden radius-big" }, Lo = /* @__PURE__ */ ae(() => /* @__PURE__ */ a("h3", { class: "mn-semi" }, "Details", -1)), So = /* @__PURE__ */ ae(() => /* @__PURE__ */ a("p", { class: "p-medium mn-small" }, "Please the available delivery options:", -1)), zo = { class: "mn-medium flex-nowrap flex" }, Po = /* @__PURE__ */ ae(() => /* @__PURE__ */ a("p", { class: "p-medium mn-small" }, "Please select the available payment methods:", -1)), Mo = { class: "flex-nowrap flex" }, Do = { class: "bg-grey pd-medium o-hidden radius-big" }, Ao = /* @__PURE__ */ ae(() => /* @__PURE__ */ a("h3", { class: "mn-semi" }, "Location", -1)), Vo = /* @__PURE__ */ ae(() => /* @__PURE__ */ a("p", { class: "mn-small p-medium" }, "Or choose on map:", -1)), Eo = { class: "flex-nowrap flex pd-thin" }, Uo = {
2477
+ __name: "DepartmentEdit",
2478
+ setup(e) {
2479
+ const t = q(), s = E();
2480
+ b("details"), b(!1);
2481
+ async function n() {
2482
+ s.params.department && await be.read(s.params.department), b(We.memberships), await K.read(s.params._id), s.params.department && await K.readOne(s.params.department);
2483
+ }
2484
+ n(), b(_.department.members), b(!1), b(null), b(!1), b(null);
2485
+ async function l() {
2486
+ s.params.department && await K.update(
2487
+ s.params._id,
2488
+ _.department
2489
+ ), s.params.department || await K.create(
2490
+ s.params._id,
2491
+ _.department
2492
+ );
2493
+ }
2494
+ function i() {
2495
+ t.replace({ name: "Department", params: { _id: s.params._id, department: _.department._id } });
2496
+ }
2497
+ async function p() {
2498
+ await K.delete(
2499
+ s.params._id,
2500
+ _.department
2501
+ );
2502
+ }
2503
+ return (r, u) => (o(), c("div", mo, [
2504
+ a("div", ho, [
2505
+ h(ct, { class: "pd-medium bg-grey radius-big" })
2506
+ ]),
2507
+ a("div", _o, [
2508
+ a("header", fo, [
2509
+ k(s).params.department ? (o(), c("h1", go, "Edit Spot")) : (o(), c("h1", bo, "Create Spot")),
2510
+ a("section", vo, [
2511
+ h(ue, {
2512
+ submit: l,
2513
+ callback: i
2514
+ }, {
2515
+ default: x(() => [
2516
+ W("Save Spot")
2517
+ ]),
2518
+ _: 1
2519
+ })
2520
+ ])
2521
+ ])
2522
+ ]),
2523
+ a("div", yo, [
2524
+ a("div", wo, [
2525
+ a("div", $o, [
2526
+ Co,
2527
+ a("div", ko, [
2528
+ h(Ae, {
2529
+ photo: _.department.profile.photo,
2530
+ "onUpdate:photo": u[0] || (u[0] = (d) => _.department.profile.photo = d),
2531
+ uploadPath: "organizations/" + _.department.name + "/avatars",
2532
+ class: "w-8r aspect-1x1 o-hidden mn-r-small radius-extra"
2533
+ }, null, 8, ["photo", "uploadPath"]),
2534
+ a("div", xo, [
2535
+ h(M, {
2536
+ field: _.department.profile.name,
2537
+ "onUpdate:field": u[1] || (u[1] = (d) => _.department.profile.name = d),
2538
+ label: "Name",
2539
+ placeholder: "Spot Name",
2540
+ class: "mn-small bg-white radius-small pd-medium",
2541
+ validation: r.organizationName
2542
+ }, null, 8, ["field", "validation"]),
2543
+ h(M, {
2544
+ field: _.department.profile.description,
2545
+ "onUpdate:field": u[2] || (u[2] = (d) => _.department.profile.description = d),
2546
+ label: "Description",
2547
+ placeholder: "Spot description (max 120 symbols)",
2548
+ class: "bg-white radius-small pd-medium",
2549
+ validation: r.organizationName
2550
+ }, null, 8, ["field", "validation"])
2551
+ ])
2552
+ ])
2553
+ ]),
2554
+ a("div", Oo, [
2555
+ Lo,
2556
+ So,
2557
+ a("div", zo, [
2558
+ h(J, {
2559
+ label: "Pickup",
2560
+ name: "Delivery",
2561
+ value: "pickup",
2562
+ class: "w-100 mn-r-small bg-white radius-small pd-small",
2563
+ radio: _.department.delivery
2564
+ }, null, 8, ["radio"]),
2565
+ h(J, {
2566
+ label: "Delivery",
2567
+ name: "Delivery",
2568
+ value: "courier",
2569
+ class: "w-100 mn-r-small bg-white radius-small pd-small",
2570
+ radio: _.department.delivery
2571
+ }, null, 8, ["radio"]),
2572
+ h(J, {
2573
+ label: "Post",
2574
+ name: "Delivery",
2575
+ value: "post",
2576
+ class: "w-100 bg-white radius-small pd-small",
2577
+ radio: _.department.delivery
2578
+ }, null, 8, ["radio"])
2579
+ ]),
2580
+ Po,
2581
+ a("div", Mo, [
2582
+ h(J, {
2583
+ label: "Cash",
2584
+ name: "Payment",
2585
+ value: "cash",
2586
+ class: "w-100 mn-r-small bg-white radius-small pd-small",
2587
+ radio: _.department.payment
2588
+ }, null, 8, ["radio"]),
2589
+ h(J, {
2590
+ label: "Bank Transfer",
2591
+ name: "Payment",
2592
+ value: "bank",
2593
+ class: "w-100 mn-r-small bg-white radius-small pd-small",
2594
+ radio: _.department.payment
2595
+ }, null, 8, ["radio"]),
2596
+ h(J, {
2597
+ label: "Crypto",
2598
+ name: "Payment",
2599
+ value: "crypto",
2600
+ class: "w-100 bg-white radius-small pd-small",
2601
+ radio: _.department.payment
2602
+ }, null, 8, ["radio"])
2603
+ ])
2604
+ ])
2605
+ ]),
2606
+ a("div", Do, [
2607
+ Ao,
2608
+ h(an, {
2609
+ apiKey: "AIzaSyDDR6WgYB7XMt7yTDDzQNEdF_gTdUiq8dI",
2610
+ address: _.department.address,
2611
+ location: _.department.location,
2612
+ label: "Address",
2613
+ placeholder: "Enter delivery address",
2614
+ class: "bg-white radius-small pd-small mn-small",
2615
+ "onUpdate:location": u[3] || (u[3] = (d) => {
2616
+ _.department.location = d;
2617
+ }),
2618
+ "onUpdate:address": u[4] || (u[4] = (d) => {
2619
+ _.department.address = d;
2620
+ })
2621
+ }, null, 8, ["address", "location"]),
2622
+ Vo,
2623
+ h(cn, {
2624
+ address: _.department.address,
2625
+ location: _.department.location,
2626
+ apiKey: "AIzaSyDDR6WgYB7XMt7yTDDzQNEdF_gTdUiq8dI",
2627
+ class: "radius-big o-hidden",
2628
+ "onUpdate:location": u[5] || (u[5] = (d) => {
2629
+ _.department.location = d;
2630
+ }),
2631
+ "onUpdate:address": u[6] || (u[6] = (d) => {
2632
+ _.department.address = d;
2633
+ })
2634
+ }, null, 8, ["address", "location"])
2635
+ ])
2636
+ ]),
2637
+ a("section", Eo, [
2638
+ h(ue, {
2639
+ submit: p,
2640
+ callback: r.redirectToDash,
2641
+ class: "bg-grey"
2642
+ }, {
2643
+ default: x(() => [
2644
+ W("Delete Spot")
2645
+ ]),
2646
+ _: 1
2647
+ }, 8, ["callback"])
2648
+ ])
2649
+ ]));
2650
+ }
2651
+ }, Io = /* @__PURE__ */ A(Uo, [["__scopeId", "data-v-195322bd"]]), Pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2652
+ __proto__: null,
2653
+ default: Io
2654
+ }, Symbol.toStringTag, { value: "Module" })), Bo = { class: "unit" }, jo = { class: "unit-details" }, To = { key: 0 }, Fo = { class: "subunits" }, Ti = {
2655
+ __name: "Unit",
2656
+ props: {
2657
+ unit: {
2658
+ type: Object,
2659
+ required: !0
2660
+ },
2661
+ editMode: {
2662
+ type: Boolean,
2663
+ required: !0
2664
+ }
2665
+ },
2666
+ setup(e) {
2667
+ const t = e, s = b({ ...t.unit });
2668
+ F(t.unit, () => {
2669
+ s.value = { ...t.unit };
2670
+ });
2671
+ async function n() {
2672
+ emit("unit-updated", s.value);
2673
+ }
2674
+ async function l() {
2675
+ emit("subunit-added", t.unit._id);
2676
+ }
2677
+ return (i, p) => {
2678
+ const r = pe("unit-component");
2679
+ return o(), c("div", Bo, [
2680
+ a("div", jo, [
2681
+ a("h3", null, f(e.unit.name), 1),
2682
+ a("p", null, f(e.unit.description), 1),
2683
+ e.editMode ? (o(), c("div", To, [
2684
+ ne(a("input", {
2685
+ "onUpdate:modelValue": p[0] || (p[0] = (u) => s.value.name = u),
2686
+ placeholder: "Название отдела"
2687
+ }, null, 512), [
2688
+ [$e, s.value.name]
2689
+ ]),
2690
+ ne(a("input", {
2691
+ "onUpdate:modelValue": p[1] || (p[1] = (u) => s.value.description = u),
2692
+ placeholder: "Описание отдела"
2693
+ }, null, 512), [
2694
+ [$e, s.value.description]
2695
+ ]),
2696
+ a("button", { onClick: n }, "Сохранить"),
2697
+ a("button", { onClick: l }, "Добавить подотдел")
2698
+ ])) : g("", !0)
2699
+ ]),
2700
+ a("div", Fo, [
2701
+ (o(!0), c(O, null, L(e.unit.subunits, (u, d) => (o(), y(r, {
2702
+ key: d,
2703
+ unit: u,
2704
+ "edit-mode": e.editMode
2705
+ }, null, 8, ["unit", "edit-mode"]))), 128))
2706
+ ])
2707
+ ]);
2708
+ };
2709
+ }
2710
+ };
2711
+ const qo = { class: "br-grey radius-small mn-small" }, Ro = {
2712
+ __name: "Places",
2713
+ props: {
2714
+ isPopupOpen: Boolean,
2715
+ place: Number,
2716
+ places: Array
2717
+ },
2718
+ emits: ["callback"],
2719
+ setup(e, { emit: t }) {
2720
+ const s = e, n = b({
2721
+ logo: "",
2722
+ name: "",
2723
+ address: ""
2724
+ });
2725
+ s.place !== null && (n.value = s.places[s.place]);
2726
+ const l = b(null);
2727
+ async function i() {
2728
+ try {
2729
+ await et(
2730
+ l,
2731
+ tt,
2732
+ n.value.name,
2733
+ "Некорректное название"
2734
+ );
2735
+ } catch {
2736
+ throw new Error();
2737
+ }
2738
+ s.place !== null ? (s.places[s.place] = n.value, t("callback")) : (s.places.push(n.value), t("callback"));
2739
+ }
2740
+ return (p, r) => (o(), c("div", null, [
2741
+ a("div", qo, [
2742
+ h(De, {
2743
+ options: [
2744
+ { name: "Кафе", value: "cafe" },
2745
+ { name: "Бар", value: "bar" },
2746
+ { name: "Ресторан", value: "restaraunt" },
2747
+ { name: "Пиццерия", value: "pizzeria" },
2748
+ { name: "Ночной клуб", value: "night-club" },
2749
+ { name: "Шаверма", value: "shaverma" },
2750
+ { name: "Кофейня", value: "coffee" }
2751
+ ],
2752
+ prop: n.value,
2753
+ content: "type",
2754
+ label: "Тип",
2755
+ placeholder: "Тип заведения",
2756
+ size: "small"
2757
+ }, null, 8, ["prop"]),
2758
+ h(M, {
2759
+ field: n.value.name,
2760
+ "onUpdate:field": r[0] || (r[0] = (u) => n.value.name = u),
2761
+ label: "Название",
2762
+ validation: l.value,
2763
+ placeholder: "Введите название места"
2764
+ }, null, 8, ["field", "validation"]),
2765
+ h(M, {
2766
+ field: n.value.address,
2767
+ "onUpdate:field": r[1] || (r[1] = (u) => n.value.address = u),
2768
+ label: "Адрес",
2769
+ validation: l.value,
2770
+ placeholder: "Введите адрес места"
2771
+ }, null, 8, ["field", "validation"]),
2772
+ h(M, {
2773
+ field: n.value.phone,
2774
+ "onUpdate:field": r[2] || (r[2] = (u) => n.value.phone = u),
2775
+ label: "Телефон",
2776
+ validation: l.value,
2777
+ placeholder: "Введите телефон места"
2778
+ }, null, 8, ["field", "validation"])
2779
+ ]),
2780
+ a("button", {
2781
+ onClick: i,
2782
+ class: "w-100 button bg-second t-white"
2783
+ }, f(s.place !== null ? "Редактировать заведение" : "Добавить заведение"), 1)
2784
+ ]));
2785
+ }
2786
+ }, Fi = /* @__PURE__ */ A(Ro, [["__scopeId", "data-v-de5143c5"]]);
2787
+ const Zo = (e) => (he("data-v-20739d92"), e = e(), _e(), e), Ho = { class: "documents" }, No = /* @__PURE__ */ Zo(() => /* @__PURE__ */ a("h3", { class: "mn-small" }, "Список документов", -1)), Ko = { class: "mn-big cols-4" }, Wo = ["onClick"], Yo = { class: "mn-small" }, Jo = { class: "t-semi t-transp radius-small" }, Qo = {
2788
+ __name: "Documents",
2789
+ setup(e) {
2790
+ q(), E();
2791
+ let t = [{
2792
+ name: "Паспорт",
2793
+ status: "Не добавлен",
2794
+ inputs: [{
2795
+ type: "text",
2796
+ name: "Номер и серия"
2797
+ }, {
2798
+ type: "text",
2799
+ name: "Место выдачи"
2800
+ }, {
2801
+ type: "text",
2802
+ name: "Дата выдачи"
2803
+ }]
2804
+ }, {
2805
+ name: "ИНН",
2806
+ status: "Не добавлен",
2807
+ inputs: [{
2808
+ type: "text",
2809
+ name: "Дата регистрации"
2810
+ }]
2811
+ }, {
2812
+ name: "СНИЛС",
2813
+ status: "Не добавлен",
2814
+ inputs: [{
2815
+ type: "text",
2816
+ name: "Дата регистрации"
2817
+ }]
2818
+ }, {
2819
+ name: "Военный билет",
2820
+ status: "Не добавлен",
2821
+ inputs: [{
2822
+ type: "text",
2823
+ name: "Дата регистрации"
2824
+ }]
2825
+ }];
2826
+ const s = b(!1), n = b(null), l = (r) => {
2827
+ n.value = r, s.value = !0;
2828
+ }, i = () => {
2829
+ s.value = !1;
2830
+ }, p = () => {
2831
+ i();
2832
+ };
2833
+ return ce(() => {
2834
+ }), (r, u) => {
2835
+ const d = pe("Popup");
2836
+ return o(), c("div", Ho, [
2837
+ No,
2838
+ a("div", Ko, [
2839
+ (o(!0), c(O, null, L(k(t), (m, $) => (o(), c("div", {
2840
+ key: $,
2841
+ onClick: (S) => l($),
2842
+ class: "h-100 pd-medium bg-white radius-small"
2843
+ }, [
2844
+ a("h3", Yo, f(m.name), 1),
2845
+ a("p", Jo, f(m.status), 1)
2846
+ ], 8, Wo))), 128))
2847
+ ]),
2848
+ h(d, {
2849
+ title: "Добавить документ",
2850
+ onClosePopup: i,
2851
+ isPopupOpen: s.value
2852
+ }, {
2853
+ default: x(() => [
2854
+ (o(!0), c(O, null, L(k(t)[n.value].inputs, (m) => (o(), c("div", {
2855
+ key: m.name
2856
+ }, [
2857
+ h(M, {
2858
+ field: m.value,
2859
+ "onUpdate:field": ($) => m.value = $,
2860
+ label: m.name,
2861
+ _id: m.name,
2862
+ placeholder: m.name,
2863
+ class: "w-100"
2864
+ }, null, 8, ["field", "onUpdate:field", "label", "_id", "placeholder"])
2865
+ ]))), 128)),
2866
+ a("button", {
2867
+ onClick: p,
2868
+ class: "w-100 mn-small button"
2869
+ }, "Отправить на верификацию")
2870
+ ]),
2871
+ _: 1
2872
+ }, 8, ["isPopupOpen"])
2873
+ ]);
2874
+ };
2875
+ }
2876
+ }, qi = /* @__PURE__ */ A(Qo, [["__scopeId", "data-v-20739d92"]]);
2877
+ const Xo = { class: "for-transition bg-white radius-big w-100" }, Go = { class: "" }, ei = {
2878
+ key: 1,
2879
+ class: "cols-1"
2880
+ }, Ri = {
2881
+ __name: "Organizations",
2882
+ props: {
2883
+ owner: {
2884
+ type: String,
2885
+ default: null
2886
+ },
2887
+ user: {
2888
+ type: [String, Number],
2889
+ default: null
2890
+ },
2891
+ onlyuser: {
2892
+ type: [String, Number],
2893
+ default: null
2894
+ }
2895
+ },
2896
+ async setup(e) {
2897
+ let t, s;
2898
+ const n = e, l = b(null);
2899
+ l.value = ([t, s] = Y(() => R.read({ owner: n.owner, user: n.user, onlyuser: n.onlyuser })), t = await t, s(), t);
2900
+ const i = q(), p = E();
2901
+ let r = p.query.tab ? p.query.tab : "details";
2902
+ const u = b(r);
2903
+ return p.query.tab = u.value, F(u, (d) => {
2904
+ i.replace({ query: { ...p.query, tab: d } });
2905
+ }), (d, m) => (o(), c("div", Xo, [
2906
+ a("div", Go, [
2907
+ l.value < 1 ? (o(), y(ge, {
2908
+ key: 0,
2909
+ title: "You Haven't Joined Any Organization Yet",
2910
+ description: "Weeder is all about community. Join an organization or maybe you want to create your own?",
2911
+ action: "Create organization",
2912
+ callback: d.a = () => d.$router.push("/app/organization/create/details")
2913
+ }, null, 8, ["callback"])) : (o(), c("div", ei, [
2914
+ (o(!0), c(O, null, L(l.value, ($) => (o(), y(Xe, {
2915
+ key: $._id,
2916
+ organization: $,
2917
+ user: D.user,
2918
+ onUpdateMembership: d.handleMembershipUpdate,
2919
+ class: se(["w-100", { "mn-r-small": d.index !== l.value.length - 1 }])
2920
+ }, null, 8, ["organization", "user", "onUpdateMembership", "class"]))), 128))
2921
+ ]))
2922
+ ])
2923
+ ]));
2924
+ }
2925
+ }, ti = {};
2926
+ function si(e, t) {
2927
+ const s = pe("router-view");
2928
+ return o(), y(s, null, {
2929
+ default: x(({ Component: n, route: l }) => [
2930
+ (o(), y(re(n)))
2931
+ ]),
2932
+ _: 1
2933
+ });
2934
+ }
2935
+ const ai = /* @__PURE__ */ A(ti, [["render", si]]), Zi = [{
2936
+ path: "organizations",
2937
+ component: ai,
2938
+ meta: {
2939
+ title: {
2940
+ en: "Organizations",
2941
+ ru: "Организации"
2942
+ }
2943
+ },
2944
+ children: [{
2945
+ path: ":_id",
2946
+ name: "Organization",
2947
+ meta: {
2948
+ title: {
2949
+ en: "Organization",
2950
+ ru: "Организация"
2951
+ }
2952
+ },
2953
+ component: () => Promise.resolve().then(() => Js)
2954
+ }, {
2955
+ path: "create",
2956
+ name: "Create Organization",
2957
+ title: {
2958
+ en: "Create Organization",
2959
+ ru: "Создать Организацию"
2960
+ },
2961
+ beforeEnter: [
2962
+ Q
2963
+ ],
2964
+ component: () => Promise.resolve().then(() => xe)
2965
+ }, {
2966
+ path: ":_id/edit",
2967
+ name: "Organization Edit",
2968
+ meta: {
2969
+ title: {
2970
+ en: "Edit Organization",
2971
+ ru: "Редактировать Организацию"
2972
+ }
2973
+ },
2974
+ beforeEnter: [
2975
+ Q
2976
+ ],
2977
+ component: () => Promise.resolve().then(() => xe)
2978
+ }, {
2979
+ path: ":_id/departments/create",
2980
+ name: "Department Creation",
2981
+ meta: {
2982
+ title: "Создание отдела"
2983
+ },
2984
+ beforeEnter: [
2985
+ Q
2986
+ ],
2987
+ component: () => Promise.resolve().then(() => Pe)
2988
+ }, {
2989
+ path: ":_id/departments/:deparment",
2990
+ name: "Department",
2991
+ meta: {
2992
+ title: "Отдел"
2993
+ },
2994
+ beforeEnter: [
2995
+ Q
2996
+ ],
2997
+ component: () => Promise.resolve().then(() => pa)
2998
+ }, {
2999
+ path: ":_id/departments/:department/edit",
3000
+ name: "Department Edit",
3001
+ meta: {
3002
+ title: "Редактирование отдела"
3003
+ },
3004
+ beforeEnter: [
3005
+ Q
3006
+ ],
3007
+ component: () => Promise.resolve().then(() => Pe)
3008
+ }, {
3009
+ path: ":_id/products/:product",
3010
+ name: "Product Organization",
3011
+ meta: {
3012
+ title: {
3013
+ en: "Product",
3014
+ ru: "Продукт"
3015
+ }
3016
+ },
3017
+ component: () => import(
3018
+ /* webpackChunkName: 'Product' */
3019
+ "./Product-a6251018.mjs"
3020
+ )
3021
+ }, {
3022
+ path: ":_id/products/:product/edit",
3023
+ name: "ProductEdit",
3024
+ beforeEnter: [
3025
+ Q
3026
+ ],
3027
+ component: () => import(
3028
+ /* webpackChunkName: 'ProductPageEdit' */
3029
+ "./ProductEdit-f901314c.mjs"
3030
+ )
3031
+ }, {
3032
+ path: ":_id/products/add",
3033
+ name: "AddProduct",
3034
+ component: () => import(
3035
+ /* webpackChunkName: 'ProductPageEdit' */
3036
+ "./ProductEdit-f901314c.mjs"
3037
+ )
3038
+ }]
3039
+ }];
3040
+ export {
3041
+ Zi as A,
3042
+ Io as D,
3043
+ Fi as P,
3044
+ Ee as U,
3045
+ ct as _,
3046
+ Mi as a,
3047
+ Pi as b,
3048
+ j as c,
3049
+ Ys as d,
3050
+ ua as e,
3051
+ Ei as f,
3052
+ Ia as g,
3053
+ Ui as h,
3054
+ Ii as i,
3055
+ Ti as j,
3056
+ Ve as k,
3057
+ Bi as l,
3058
+ ji as m,
3059
+ ge as n,
3060
+ Si as o,
3061
+ zi as p,
3062
+ Ms as q,
3063
+ Di as r,
3064
+ v as s,
3065
+ jt as t,
3066
+ Vi as u,
3067
+ qi as v,
3068
+ Ns as w,
3069
+ ws as x,
3070
+ Ri as y,
3071
+ Ai as z
3072
+ };