@ozdao/prometheus-framework 0.0.94 → 0.0.95
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-97217d38.mjs +1945 -0
- package/dist/ButtonFollow-4049a57e.js +1 -0
- package/dist/ButtonFollow-6765c266.mjs +131 -0
- package/dist/CardOrganization-b2098e42.js +1 -0
- package/dist/CardOrganization-c2e7e903.mjs +229 -0
- package/dist/Feed-13499a3a.mjs +428 -0
- package/dist/Feed-345d8513.mjs +355 -0
- package/dist/Feed-c6b67df4.js +1 -0
- package/dist/Feed-f0a40b33.js +1 -0
- package/dist/Image-b2131fa0.mjs +477 -0
- package/dist/Image-d01026cf.js +9 -0
- package/dist/Popup-0b38b537.js +1 -0
- package/dist/Popup-e6685f31.mjs +76 -0
- package/dist/Product-3c2ae338.js +7 -0
- package/dist/Product-dccb371a.mjs +838 -0
- package/dist/ProductEdit-777bb9e2.mjs +350 -0
- package/dist/ProductEdit-d5dec3cf.js +1 -0
- package/dist/ProfileBlogposts-39c20b79.mjs +64 -0
- package/dist/ProfileBlogposts-6c715a38.js +1 -0
- package/dist/ProfileComments-1525663e.mjs +44 -0
- package/dist/ProfileComments-1cbf5c45.js +1 -0
- package/dist/ProfileEvents-48c70286.mjs +56 -0
- package/dist/ProfileEvents-a28a4ee5.js +1 -0
- package/dist/ProfileLikes-ca197731.mjs +44 -0
- package/dist/ProfileLikes-e31f28dc.js +1 -0
- package/dist/ProfileOrganizations-600d310d.js +1 -0
- package/dist/ProfileOrganizations-774c6508.mjs +212 -0
- package/dist/Publics-4db36606.js +1 -0
- package/dist/Publics-cbb8eaaa.mjs +123 -0
- package/dist/UploadImage-739cab04.js +1 -0
- package/dist/UploadImage-8835be69.mjs +83 -0
- package/dist/auth-b61483ce.js +8 -0
- package/dist/auth-cfeacd61.mjs +1839 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +3 -3
- package/dist/auth.validation-2f00457e.js +1 -0
- package/dist/auth.validation-3fd4cc7c.mjs +20 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +10 -10
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +8 -8
- package/dist/organizations-49a10611.js +1 -0
- package/dist/organizations-8ffdf84d.mjs +121 -0
- package/dist/organizations.client-0071acee.js +3 -0
- package/dist/organizations.client-fa3b0839.mjs +3017 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +10 -10
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +9 -9
- package/package.json +2 -1
- package/src/modules/auth/store/auth.js +23 -3
@@ -0,0 +1,355 @@
|
|
1
|
+
import { ref as h, computed as m, openBlock as r, createElementBlock as l, normalizeClass as p, createVNode as C, unref as x, createElementVNode as f, createCommentVNode as i, toDisplayString as g, renderSlot as F, createBlock as T, createStaticVNode as I, reactive as N, watch as L, onMounted as j, TransitionGroup as z, withCtx as P, Fragment as E, renderList as O, Transition as R } from "vue";
|
2
|
+
import { _ as V } from "./EmptyState-34d85f10.mjs";
|
3
|
+
import { _ as B, a as H } from "./Chips-f0b7ce36.mjs";
|
4
|
+
import { a as Y } from "./auth-cfeacd61.mjs";
|
5
|
+
import { useRouter as q } from "vue-router";
|
6
|
+
import { _ as A } from "./_plugin-vue_export-helper-dad06003.mjs";
|
7
|
+
import { s as S } from "./globals-96ba60e4.mjs";
|
8
|
+
const G = {
|
9
|
+
key: 0,
|
10
|
+
class: "o-hidden bg-grey mn-small w-100"
|
11
|
+
}, J = ["src"], K = ["src"], Q = { class: "w-max mn-r-thin pd-thin radius-small t-semi bg-main" }, W = {
|
12
|
+
key: 0,
|
13
|
+
class: "t-semi"
|
14
|
+
}, X = { class: "t-semi" }, Z = {
|
15
|
+
key: 0,
|
16
|
+
class: "t-semi uppercase"
|
17
|
+
}, ee = {
|
18
|
+
key: 0,
|
19
|
+
class: "cursor-pointer mn-thin flex-nowrap flex w-100"
|
20
|
+
}, te = {
|
21
|
+
key: 0,
|
22
|
+
class: ""
|
23
|
+
}, ae = {
|
24
|
+
key: 1,
|
25
|
+
class: "pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"
|
26
|
+
}, re = {
|
27
|
+
key: 1,
|
28
|
+
class: "mn-small p-big"
|
29
|
+
}, ne = {
|
30
|
+
__name: "CardEvent",
|
31
|
+
props: ["event", "user", "short", "type"],
|
32
|
+
setup(e) {
|
33
|
+
const t = e;
|
34
|
+
h(/* @__PURE__ */ new Date()), q(), m(() => t.event.content.find((a) => a.type.name === "ImageUpload")), m(() => t.event.content.find((a) => a.type.name === "Textarea"));
|
35
|
+
const s = m(() => {
|
36
|
+
const a = /* @__PURE__ */ new Date(), o = Date.UTC(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate(), a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds()), n = new Date(t.event.date.start), u = Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), n.getUTCHours(), n.getUTCMinutes(), n.getUTCSeconds()) - o;
|
37
|
+
if (u < 0)
|
38
|
+
return "Finished";
|
39
|
+
if (u === 0)
|
40
|
+
return "Starting Now";
|
41
|
+
{
|
42
|
+
const b = Math.floor(u / 1e3), k = Math.floor(b / 60), D = Math.floor(k / 60), M = Math.floor(D / 24);
|
43
|
+
return M > 0 ? `${M} days until event` : D > 0 ? `${D} hours until event` : k > 0 ? `${k} minutes until event` : `${b} seconds until event`;
|
44
|
+
}
|
45
|
+
}), c = m(() => {
|
46
|
+
const a = new Date(t.event.date.start), o = { day: "2-digit", month: "2-digit" };
|
47
|
+
return a.toLocaleDateString(void 0, o);
|
48
|
+
}), d = m(() => {
|
49
|
+
const a = new Date(t.event.date.start), o = new Date(t.event.date.end), n = new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(a), $ = new Intl.DateTimeFormat(void 0, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).format(o);
|
50
|
+
return `${n}-${$}`;
|
51
|
+
}), y = m(() => {
|
52
|
+
const a = t.event.name;
|
53
|
+
return a.length > 26 ? `${a.substring(0, 22)}…` : a;
|
54
|
+
});
|
55
|
+
return (a, o) => (r(), l("article", {
|
56
|
+
class: p({
|
57
|
+
"flex-nowrap flex-v-center flex": e.type === "short"
|
58
|
+
})
|
59
|
+
}, [
|
60
|
+
C(B, {
|
61
|
+
class: p({
|
62
|
+
"mn-small pd-medium": e.type !== "short",
|
63
|
+
"flex-child-order-last flex-child mn-l-small": e.type === "short"
|
64
|
+
}),
|
65
|
+
owner: e.event.owner,
|
66
|
+
creator: e.event.creator,
|
67
|
+
members: e.event.numberOfTickets,
|
68
|
+
membersPhotos: e.event.participantsPhotos,
|
69
|
+
type: e.type,
|
70
|
+
dateFormatted: x(s)
|
71
|
+
}, null, 8, ["class", "owner", "creator", "members", "membersPhotos", "type", "dateFormatted"]),
|
72
|
+
e.event.cover && e.type !== "short" ? (r(), l("div", G, [
|
73
|
+
f("img", {
|
74
|
+
src: e.event.cover,
|
75
|
+
alt: "Event image",
|
76
|
+
class: "z-index-1 d-block mn-auto h-20r"
|
77
|
+
}, null, 8, J),
|
78
|
+
f("img", {
|
79
|
+
src: e.event.cover,
|
80
|
+
alt: "Event image",
|
81
|
+
class: "z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",
|
82
|
+
style: { transform: "scale(1.5)", filter: "blur(2rem)", "-webkit-filter": "blur(2rem)" }
|
83
|
+
}, null, 8, K)
|
84
|
+
])) : i("", !0),
|
85
|
+
f("section", {
|
86
|
+
class: p(["w-100", { "pd-t-zero pd-medium": e.type !== "short" }])
|
87
|
+
}, [
|
88
|
+
f("div", {
|
89
|
+
class: p([{ "mn-small": e.type !== "short" }, "flex-v-center flex-nowrap flex"])
|
90
|
+
}, [
|
91
|
+
f("div", Q, [
|
92
|
+
e.type !== "short" ? (r(), l("span", W, g(x(c)) + " | ", 1)) : i("", !0),
|
93
|
+
f("span", X, g(x(d)), 1)
|
94
|
+
]),
|
95
|
+
e.type === "short" ? (r(), l("span", Z, g(x(y)), 1)) : i("", !0)
|
96
|
+
], 2),
|
97
|
+
e.type !== "short" ? (r(), l("div", ee, [
|
98
|
+
e.type !== "short" ? (r(), l("h3", te, g(e.event.name), 1)) : i("", !0),
|
99
|
+
e.event.status === "draft" ? (r(), l("div", ae, g(e.event.status), 1)) : i("", !0)
|
100
|
+
])) : i("", !0),
|
101
|
+
e.type !== "short" ? (r(), l("p", re, g(e.event.description), 1)) : i("", !0),
|
102
|
+
F(a.$slots, "default"),
|
103
|
+
e.type !== "short" && e.event.tags.length > 0 ? (r(), T(H, {
|
104
|
+
key: 2,
|
105
|
+
chips: e.event.tags
|
106
|
+
}, null, 8, ["chips"])) : i("", !0)
|
107
|
+
], 2)
|
108
|
+
], 2));
|
109
|
+
}
|
110
|
+
}, se = {}, le = {
|
111
|
+
width: "100%",
|
112
|
+
height: "20rem",
|
113
|
+
xmlns: "http://www.w3.org/2000/svg"
|
114
|
+
}, ie = /* @__PURE__ */ I('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>', 6), ce = [
|
115
|
+
ie
|
116
|
+
];
|
117
|
+
function ue(e, t) {
|
118
|
+
return r(), l("svg", le, ce);
|
119
|
+
}
|
120
|
+
const oe = /* @__PURE__ */ A(se, [["render", ue]]), U = Y.create({ baseURL: process.env.API_URL, withCredentials: !0 }), v = N({
|
121
|
+
all: [],
|
122
|
+
filter: {
|
123
|
+
// query
|
124
|
+
tags: [],
|
125
|
+
period: "",
|
126
|
+
date: null
|
127
|
+
// pagination
|
128
|
+
},
|
129
|
+
pagination: {
|
130
|
+
page: 1,
|
131
|
+
perPage: 18
|
132
|
+
},
|
133
|
+
// Sort
|
134
|
+
sort: {
|
135
|
+
current: "popularity",
|
136
|
+
ascending: !1
|
137
|
+
},
|
138
|
+
current: {
|
139
|
+
_id: "",
|
140
|
+
cover: "",
|
141
|
+
url: "",
|
142
|
+
status: "",
|
143
|
+
name: "",
|
144
|
+
tags: [],
|
145
|
+
date: {
|
146
|
+
start: null,
|
147
|
+
false: null
|
148
|
+
},
|
149
|
+
views: 0,
|
150
|
+
content: []
|
151
|
+
}
|
152
|
+
});
|
153
|
+
async function _(e = {}) {
|
154
|
+
e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.status && (e.params = { status: e.status }), e.url && (e.params = { url: e.url }), e.period && (e.params.period = e.period), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.date && (e.params.date = e.date), e.participant && (e.params.participant = e.participant), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.user && (e.params.user = e.user), e.sortOrder && (e.params.sortOrder = e.sortOrder), e.sortParam && (e.params.sortParam = e.sortParam), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
|
155
|
+
try {
|
156
|
+
console.log("Request params:" + e.params);
|
157
|
+
const t = await U.get("/api/events/read", { params: e.params });
|
158
|
+
return console.log(e.params), e.url ? w(t.data, "current") : w(t.data, "all"), Promise.resolve(t.data);
|
159
|
+
} catch (t) {
|
160
|
+
return S(t), Promise.reject(t);
|
161
|
+
}
|
162
|
+
}
|
163
|
+
async function de(e) {
|
164
|
+
return U.post("/api/events/create", e).then(
|
165
|
+
(t) => (w(t.data, "current"), Promise.resolve(t.data)),
|
166
|
+
(t) => (S(t), Promise.reject(t))
|
167
|
+
);
|
168
|
+
}
|
169
|
+
async function me(e) {
|
170
|
+
return U.post("/api/events/update", e).then(
|
171
|
+
(t) => (w(t.data, "current"), Promise.resolve(t.data)),
|
172
|
+
(t) => (S(t), Promise.reject(t))
|
173
|
+
);
|
174
|
+
}
|
175
|
+
async function fe(e) {
|
176
|
+
return await U.delete(`/api/events/delete/${e}`).then(
|
177
|
+
(t) => {
|
178
|
+
const s = v.all.findIndex((c) => c._id === e);
|
179
|
+
return s !== -1 && v.all.splice(s, 1), Promise.resolve(t.data);
|
180
|
+
},
|
181
|
+
(t) => (S(t), Promise.reject(t))
|
182
|
+
);
|
183
|
+
}
|
184
|
+
function w(e, t) {
|
185
|
+
v[t] = e;
|
186
|
+
}
|
187
|
+
function ge() {
|
188
|
+
v.current = {
|
189
|
+
_id: "",
|
190
|
+
cover: "",
|
191
|
+
url: "",
|
192
|
+
status: "",
|
193
|
+
name: "",
|
194
|
+
tags: [],
|
195
|
+
date: {
|
196
|
+
start: null,
|
197
|
+
false: null
|
198
|
+
},
|
199
|
+
views: 0,
|
200
|
+
content: []
|
201
|
+
};
|
202
|
+
}
|
203
|
+
L(v, (e, t) => {
|
204
|
+
});
|
205
|
+
const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
206
|
+
__proto__: null,
|
207
|
+
clean: ge,
|
208
|
+
create: de,
|
209
|
+
read: _,
|
210
|
+
remove: fe,
|
211
|
+
set: w,
|
212
|
+
state: v,
|
213
|
+
update: me
|
214
|
+
}, Symbol.toStringTag, { value: "Module" })), he = { class: "feed" }, Te = {
|
215
|
+
__name: "Feed",
|
216
|
+
props: {
|
217
|
+
category: {
|
218
|
+
type: String,
|
219
|
+
default: null
|
220
|
+
},
|
221
|
+
selectedDate: {
|
222
|
+
type: String,
|
223
|
+
default: null
|
224
|
+
},
|
225
|
+
organization: {
|
226
|
+
type: String,
|
227
|
+
default: null
|
228
|
+
},
|
229
|
+
owner: {
|
230
|
+
type: String,
|
231
|
+
default: null
|
232
|
+
},
|
233
|
+
creator: {
|
234
|
+
type: String,
|
235
|
+
default: null
|
236
|
+
},
|
237
|
+
user: {
|
238
|
+
type: [String, Number],
|
239
|
+
default: null
|
240
|
+
},
|
241
|
+
sortOrder: {
|
242
|
+
type: String,
|
243
|
+
default: "desc"
|
244
|
+
},
|
245
|
+
participant: {
|
246
|
+
type: String,
|
247
|
+
default: null
|
248
|
+
},
|
249
|
+
period: {
|
250
|
+
type: String,
|
251
|
+
default: null
|
252
|
+
},
|
253
|
+
status: {
|
254
|
+
type: String,
|
255
|
+
default: null
|
256
|
+
}
|
257
|
+
},
|
258
|
+
setup(e) {
|
259
|
+
const t = e, s = h([]), c = h(!1), d = h(!0), y = h(0), a = h(20), o = async () => {
|
260
|
+
if (c.value) {
|
261
|
+
y.value += a.value;
|
262
|
+
const n = await _({
|
263
|
+
skip: y.value,
|
264
|
+
limit: a.value,
|
265
|
+
category: t.category,
|
266
|
+
sortOrder: t.sortOrder,
|
267
|
+
participant: t.participant,
|
268
|
+
creator: t.creator,
|
269
|
+
user: t.user,
|
270
|
+
date: t.selectedDate,
|
271
|
+
owner: t.owner,
|
272
|
+
organization: t.organization,
|
273
|
+
period: t.period,
|
274
|
+
status: t.status
|
275
|
+
});
|
276
|
+
n.length === 0 ? c.value = !1 : c.value = !0, s.value = [...s.value, ...n];
|
277
|
+
}
|
278
|
+
};
|
279
|
+
return j(async () => {
|
280
|
+
d.value = !0, console.log(t.selectedDate);
|
281
|
+
const n = await _({
|
282
|
+
skip: y.value,
|
283
|
+
limit: a.value,
|
284
|
+
category: t.category,
|
285
|
+
participant: t.participant,
|
286
|
+
sortOrder: t.sortOrder,
|
287
|
+
user: t.user,
|
288
|
+
owner: t.owner,
|
289
|
+
creator: t.creator,
|
290
|
+
date: t.selectedDate,
|
291
|
+
organization: t.organization,
|
292
|
+
period: t.period,
|
293
|
+
status: t.status
|
294
|
+
});
|
295
|
+
n.length === 0 ? c.value = !1 : c.value = !0, s.value = n, d.value = !1;
|
296
|
+
}), (n, $) => (r(), l("section", he, [
|
297
|
+
C(z, {
|
298
|
+
tag: "ul",
|
299
|
+
name: "fade",
|
300
|
+
class: "o-hidden bg-grey radius-big"
|
301
|
+
}, {
|
302
|
+
default: P(() => [
|
303
|
+
d.value ? (r(!0), l(E, { key: 0 }, O(a.value, (u) => (r(), T(oe, { key: u }))), 128)) : i("", !0)
|
304
|
+
]),
|
305
|
+
_: 1
|
306
|
+
}),
|
307
|
+
C(R, { name: "fade" }, {
|
308
|
+
default: P(() => [
|
309
|
+
!d.value && s.value.length < 1 ? (r(), T(V, {
|
310
|
+
key: 0,
|
311
|
+
title: "No Events Found",
|
312
|
+
description: "Currently, there are no events available. Please check back later.",
|
313
|
+
class: "pd-medium mn-thin bg-grey radius-big"
|
314
|
+
})) : i("", !0)
|
315
|
+
]),
|
316
|
+
_: 1
|
317
|
+
}),
|
318
|
+
C(z, {
|
319
|
+
tag: "ul",
|
320
|
+
name: "fade",
|
321
|
+
class: "container"
|
322
|
+
}, {
|
323
|
+
default: P(() => [
|
324
|
+
!d.value && s.value.length > 0 ? (r(!0), l(E, { key: 0 }, O(s.value, (u, b) => (r(), T(ne, {
|
325
|
+
onClick: (k) => n.$router.push({ name: "Event", params: { url: u.url } }),
|
326
|
+
key: u._id,
|
327
|
+
event: u,
|
328
|
+
owner: e.user,
|
329
|
+
type: "normal",
|
330
|
+
class: p(["bg-grey radius-big mn-medium", {
|
331
|
+
"br-b br-solid br-black-transp-10": b !== s.value.length - 1
|
332
|
+
}])
|
333
|
+
}, null, 8, ["onClick", "event", "owner", "class"]))), 128)) : i("", !0),
|
334
|
+
c.value && s.value.length > 0 ? (r(), l("button", {
|
335
|
+
key: 1,
|
336
|
+
onClick: o,
|
337
|
+
class: "w-100 bg-main button"
|
338
|
+
}, "Load more")) : i("", !0)
|
339
|
+
]),
|
340
|
+
_: 1
|
341
|
+
})
|
342
|
+
]));
|
343
|
+
}
|
344
|
+
};
|
345
|
+
export {
|
346
|
+
oe as S,
|
347
|
+
Te as _,
|
348
|
+
ne as a,
|
349
|
+
de as b,
|
350
|
+
ge as c,
|
351
|
+
Ce as e,
|
352
|
+
_ as r,
|
353
|
+
v as s,
|
354
|
+
me as u
|
355
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),b=require("./Chips-2a0d9bfe.js"),T=require("./auth-b61483ce.js"),D=require("vue-router"),V=require("./_plugin-vue_export-helper-f246444f.js"),v=require("./globals-928eb13c.js"),U={key:0,class:"o-hidden bg-grey mn-small w-100"},$=["src"],P=["src"],z={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},_={key:0,class:"t-semi"},M={class:"t-semi"},F={key:0,class:"t-semi uppercase"},O={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},I={key:0,class:""},q={key:1,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},L={key:1,class:"mn-small p-big"},C={__name:"CardEvent",props:["event","user","short","type"],setup(t){const r=t;e.ref(new Date),D.useRouter(),e.computed(()=>r.event.content.find(a=>a.type.name==="ImageUpload")),e.computed(()=>r.event.content.find(a=>a.type.name==="Textarea"));const s=e.computed(()=>{const a=new Date,o=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds()),n=new Date(r.event.date.start),c=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())-o;if(c<0)return"Finished";if(c===0)return"Starting Now";{const f=Math.floor(c/1e3),g=Math.floor(f/60),k=Math.floor(g/60),w=Math.floor(k/24);return w>0?`${w} days until event`:k>0?`${k} hours until event`:g>0?`${g} minutes until event`:`${f} seconds until event`}}),l=e.computed(()=>{const a=new Date(r.event.date.start),o={day:"2-digit",month:"2-digit"};return a.toLocaleDateString(void 0,o)}),i=e.computed(()=>{const a=new Date(r.event.date.start),o=new Date(r.event.date.end),n=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(a),p=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(o);return`${n}-${p}`}),d=e.computed(()=>{const a=r.event.name;return a.length>26?`${a.substring(0,22)}…`:a});return(a,o)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass({"flex-nowrap flex-v-center flex":t.type==="short"})},[e.createVNode(b._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),owner:t.event.owner,creator:t.event.creator,members:t.event.numberOfTickets,membersPhotos:t.event.participantsPhotos,type:t.type,dateFormatted:e.unref(s)},null,8,["class","owner","creator","members","membersPhotos","type","dateFormatted"]),t.event.cover&&t.type!=="short"?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("img",{src:t.event.cover,alt:"Event image",class:"z-index-1 d-block mn-auto h-20r"},null,8,$),e.createElementVNode("img",{src:t.event.cover,alt:"Event image",class:"z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",style:{transform:"scale(1.5)",filter:"blur(2rem)","-webkit-filter":"blur(2rem)"}},null,8,P)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass(["w-100",{"pd-t-zero pd-medium":t.type!=="short"}])},[e.createElementVNode("div",{class:e.normalizeClass([{"mn-small":t.type!=="short"},"flex-v-center flex-nowrap flex"])},[e.createElementVNode("div",z,[t.type!=="short"?(e.openBlock(),e.createElementBlock("span",_,e.toDisplayString(e.unref(l))+" | ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",M,e.toDisplayString(e.unref(i)),1)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",F,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",O,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",I,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",L,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.type!=="short"&&t.event.tags.length>0?(e.openBlock(),e.createBlock(b._sfc_main$1,{key:2,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}},j={},R={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},H=e.createStaticVNode('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',6),G=[H];function Y(t,r){return e.openBlock(),e.createElementBlock("svg",R,G)}const x=V._export_sfc(j,[["render",Y]]),y=T.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),u=e.reactive({all:[],filter:{tags:[],period:"",date:null},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}});async function h(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.status&&(t.params={status:t.status}),t.url&&(t.params={url:t.url}),t.period&&(t.params.period=t.period),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.date&&(t.params.date=t.date),t.participant&&(t.params.participant=t.participant),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.user&&(t.params.user=t.user),t.sortOrder&&(t.params.sortOrder=t.sortOrder),t.sortParam&&(t.params.sortParam=t.sortParam),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await y.get("/api/events/read",{params:t.params});return console.log(t.params),t.url?m(r.data,"current"):m(r.data,"all"),Promise.resolve(r.data)}catch(r){return v.setError(r),Promise.reject(r)}}async function E(t){return y.post("/api/events/create",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(v.setError(r),Promise.reject(r)))}async function B(t){return y.post("/api/events/update",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(v.setError(r),Promise.reject(r)))}async function A(t){return await y.delete(`/api/events/delete/${t}`).then(r=>{const s=u.all.findIndex(l=>l._id===t);return s!==-1&&u.all.splice(s,1),Promise.resolve(r.data)},r=>(v.setError(r),Promise.reject(r)))}function m(t,r){u[r]=t}function S(){u.current={_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}}e.watch(u,(t,r)=>{});const J=Object.freeze(Object.defineProperty({__proto__:null,clean:S,create:E,read:h,remove:A,set:m,state:u,update:B},Symbol.toStringTag,{value:"Module"})),K={class:"feed"},Q={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},user:{type:[String,Number],default:null},sortOrder:{type:String,default:"desc"},participant:{type:String,default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(t){const r=t,s=e.ref([]),l=e.ref(!1),i=e.ref(!0),d=e.ref(0),a=e.ref(20),o=async()=>{if(l.value){d.value+=a.value;const n=await h({skip:d.value,limit:a.value,category:r.category,sortOrder:r.sortOrder,participant:r.participant,creator:r.creator,user:r.user,date:r.selectedDate,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=[...s.value,...n]}};return e.onMounted(async()=>{i.value=!0,console.log(r.selectedDate);const n=await h({skip:d.value,limit:a.value,category:r.category,participant:r.participant,sortOrder:r.sortOrder,user:r.user,owner:r.owner,creator:r.creator,date:r.selectedDate,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=n,i.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",K,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[i.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,c=>(e.openBlock(),e.createBlock(x,{key:c}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!i.value&&s.value.length<1?(e.openBlock(),e.createBlock(N._sfc_main,{key:0,title:"No Events Found",description:"Currently, there are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!i.value&&s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(c,f)=>(e.openBlock(),e.createBlock(C,{onClick:g=>n.$router.push({name:"Event",params:{url:c.url}}),key:c._id,event:c,owner:t.user,type:"normal",class:e.normalizeClass(["bg-grey radius-big mn-medium",{"br-b br-solid br-black-transp-10":f!==s.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0),l.value&&s.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:o,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}};exports.SkeletonEvent=x;exports._sfc_main=Q;exports._sfc_main$1=C;exports.clean=S;exports.create=E;exports.events=J;exports.read=h;exports.state=u;exports.update=B;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const e=require("vue"),V=require("./EmptyState-7658d7d6.js"),S=require("./_plugin-vue_export-helper-f246444f.js"),v=require("./Chips-2a0d9bfe.js"),$=require("vue-router"),w=require("./auth-b61483ce.js"),u=require("./globals-928eb13c.js"),f=w.axios.create({baseURL:process.env.API_URL,withCredentials:!0});f.defaults.withCredentials=!0;const c=e.reactive({all:[],filter:{tags:[],period:""},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",url:"",status:"",name:"",tags:[],owner:{},date:"",views:0,content:[]}});async function k(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.period&&(t.params.period=t.period),t.url&&(t.params={url:t.url}),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.status&&(t.params.status=t.status),t.user&&(t.params.user=t.user),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await f.get("/api/blog/read",{params:t.params});return t.url?g(r.data,"current"):g(r.data,"all"),Promise.resolve(r.data)}catch(r){return u.setError(r),Promise.reject(r)}}async function B(t){return f.post("/api/blog/create",t).then(r=>(g(r.data,"current"),Promise.resolve(r.data)),r=>(u.setError(r),Promise.reject(r)))}async function _(t){return f.post("/api/blog/update",t).then(r=>(g(r.data,"current"),Promise.resolve(r.data)),r=>(u.setError(r),Promise.reject(r)))}async function x(t){return await f.delete(`/api/blog/delete/${t}`).then(r=>{const o=c.all.findIndex(a=>a._id===t);return o!==-1&&c.all.splice(o,1),Promise.resolve(r.data)},r=>(u.setError(r),Promise.reject(r)))}function g(t,r){c[r]=t}function E(){c.current={_id:"",url:"",status:"",name:"",tags:[],author:"",owner:"",date:"",views:0,content:[]}}function j(t){const r={order:c.project.content.length+1,type:t.type,data:t.data,class:t.class,content:t.content};c.project.content.push(r)}e.watch(c,(t,r)=>{});const R=Object.freeze(Object.defineProperty({__proto__:null,blockAdd:j,clean:E,create:B,read:k,remove:x,set:g,state:c,update:_},Symbol.toStringTag,{value:"Module"})),D={props:{progress:{type:Number,default:null},status:{type:String,default:null}}},z={class:"circular-loader"},L=e.createElementVNode("svg",{viewBox:"25 25 50 50"},[e.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})],-1),T={key:0,class:"progress-text"},q={key:1,class:"uppercase t-semi w-m-10r status-text"};function I(t,r,o,a,s,l){return e.openBlock(),e.createElementBlock("div",z,[L,o.progress?(e.openBlock(),e.createElementBlock("div",T,e.toDisplayString(o.progress),1)):e.createCommentVNode("",!0),o.status?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(o.status),1)):e.createCommentVNode("",!0)])}const P=S._export_sfc(D,[["render",I]]),y=w.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),d=e.reactive({reactions:[],error:null}),b={async read({user:t,type:r,target:o,role:a}){try{const s=await y.get("/api/reactions",{params:{user:t,type:r,target:o,role:a}});return d.error=null,d.reactions=s.data,Promise.resolve(s.data)}catch(s){return u.setError(s),Promise.reject(s)}},async create(t){try{const r=await y.post("/api/reactions/create",t);return d.error=null,Promise.resolve(r.data)}catch(r){return console.log(r),u.setError(r),Promise.reject(r)}},async update(t){try{const r=await y.post("/api/reactions/update",t);return d.error=null,Promise.resolve(r.data)}catch(r){return u.setError(r),Promise.reject(r)}},async delete(t){try{const r=await y.post("/api/reactions/delete",t);return d.error=null,Promise.resolve(r.data)}catch(r){return u.setError(r),Promise.reject(r)}}},O={handleReactionUpdate(t,r,o){let a;if(Array.isArray(t)?a=t.find(s=>s._id===r.target):typeof t=="object"&&t._id===r.target&&(a=t),a)if(a.hasReaction=o,o)a.reactions.push(r),a.numberOfReactions+=1;else{const s=a.reactions.findIndex(l=>l._id===r._id);s!==-1&&(a.reactions.splice(s,1),a.numberOfReactions-=1)}}};e.watch(d,t=>{});const A=Object.freeze(Object.defineProperty({__proto__:null,actions:b,mutations:O,state:d},Symbol.toStringTag,{value:"Module"})),U={class:"t-semi br-top-dark flex-nowrap flex-nojustify flex"},M=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),F={class:"cursor-pointer"},H=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),N={__name:"FooterBlogpost",props:["blogpost","owner","user"],setup(t){const r=t,o=e.ref(r.blogpost.numberOfReactions),a=e.ref(r.blogpost.isReacted),s=e.ref(r.blogpost.reactionId);async function l(m){if(!r.user){alert("Please login to add a reaction");return}try{const n={target:r.blogpost._id,type:"blogpost",user:r.user,class:"like"},p=await b.create(n);p.reaction.class==="like"&&(o.value+=1,a.value=!0,s.value=p.reaction._id)}catch(n){console.error(n),alert("Error adding reaction. Please try again later.")}}async function i(m){if(!r.user){alert("Please login to add a reaction");return}try{const n={_id:s.value};await b.delete(n),o.value-=1,a.value=!1,s.value=null}catch{alert("Error adding reaction. Please try again later.")}}return(m,n)=>(e.openBlock(),e.createElementBlock("footer",U,[e.createTextVNode(" 👁️ "+e.toDisplayString(t.blogpost.views)+" ",1),M,e.createElementVNode("div",F,[a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cursor-pointer",onClick:n[0]||(n[0]=p=>l())}," 👍 "+e.toDisplayString(o.value),1)),a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cursor-pointer",onClick:n[1]||(n[1]=p=>i())}," 👍 "+e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)]),H,e.createTextVNode(" 💬 "+e.toDisplayString(t.blogpost.numberOfComments),1)]))}},G={class:"bg-grey radius-big"},J=["src"],K={class:"pd-t-zero pd-medium"},Q={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},W={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},X={key:1,class:"mn-small t-transp p-big"},Y={key:2,class:"mn-small h2"},C={__name:"CardBlogpost",props:["blogpost","user","type"],setup(t){const r=t,o=$.useRouter(),a=e.computed(()=>r.blogpost.content.find(l=>l.type==="ImageUpload")),s=e.computed(()=>r.blogpost.content.find(l=>l.type==="Textarea"));return(l,i)=>(e.openBlock(),e.createElementBlock("article",G,[e.createVNode(v._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt},null,8,["class","owner","creator","date"]),e.unref(a)&&e.unref(a).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:0,src:e.unref(a).content,alt:"Blog post image",class:"mn-medium object-fit-cover w-100 h-20r"},null,8,J)):e.createCommentVNode("",!0),e.createElementVNode("section",K,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("h3",{onClick:i[0]||(i[0]=m=>e.unref(o).push({name:"BlogPost",params:{url:t.blogpost.url}})),class:""},e.toDisplayString(t.blogpost.name),1),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(s)&&e.unref(s).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("p",X,e.toDisplayString(e.unref(s).content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",Y,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default"),t.type!=="short"&&t.blogpost.tags.length>0?(e.openBlock(),e.createBlock(v._sfc_main$1,{key:3,chips:t.blogpost.tags},null,8,["chips"])):e.createCommentVNode("",!0)]),e.createVNode(N,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])]))}},Z={class:"feed"},ee={key:1},te={__name:"Feed",props:{category:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},status:{type:String,default:"published"},user:{type:[String,Number],default:null},period:{type:String,default:null}},setup(t){const r=t,o=e.ref([]),a=e.ref(!0);let s=e.ref(!0),l=e.ref(0),i=e.ref(7);const m=async()=>{if(a.value){l.value+=i.value;const n=await k({skip:l.value,limit:i.value,category:r.category,user:r.user,owner:r.owner,status:r.status,creator:r.creator,period:r.period});n.length===0&&(a.value=!1),o.value=[...o.value,...n]}};return e.onMounted(async()=>{const n=await k({skip:l.value,limit:i.value,category:r.category,user:r.user,owner:r.owner,status:r.status,creator:r.creator,period:r.period});n.length===0?a.value=!1:a.value=!0,o.value=n,s.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",Z,[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createBlock(P,{key:0,class:"z-index-5 pos-t-50 left-t-50 pos-absolute"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!e.unref(s)&&o.value.length<1?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Blog Posts Found",description:"Currently, there are no posts available in this blog. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,h=>(e.openBlock(),e.createBlock(C,{key:h._id,blogpost:h,user:t.user,class:"mn-medium"},null,8,["blogpost","user"]))),128)),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[a.value&&o.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:m,class:"w-100 bg-main button"}," Load more ")):e.createCommentVNode("",!0)]),_:1})]))]),_:1})]))}};exports.Loader=P;exports._sfc_main=te;exports._sfc_main$1=C;exports._sfc_main$2=N;exports.blogposts=R;exports.clean=E;exports.create=B;exports.reactions=A;exports.read=k;exports.remove=x;exports.state=c;exports.update=_;
|