@ozdao/prometheus-framework 0.0.96 → 0.0.97

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/dist/Chips-32092a52.js +1 -0
  2. package/dist/Chips-cc08d85a.mjs +108 -0
  3. package/dist/Feed-44f715a7.mjs +439 -0
  4. package/dist/Feed-67f403fb.mjs +366 -0
  5. package/dist/Feed-8a867bfc.js +1 -0
  6. package/dist/Feed-c88eb3aa.js +1 -0
  7. package/dist/Image-d74c19ee.mjs +477 -0
  8. package/dist/Image-fd501859.js +9 -0
  9. package/dist/Product-09a39f0b.js +7 -0
  10. package/dist/Product-b7c53f33.mjs +838 -0
  11. package/dist/ProductEdit-3d7f2823.js +1 -0
  12. package/dist/ProductEdit-e827ea38.mjs +350 -0
  13. package/dist/ProfileBlogposts-6f80b734.mjs +64 -0
  14. package/dist/ProfileBlogposts-e3ea2c82.js +1 -0
  15. package/dist/ProfileComments-0d22a8ec.js +1 -0
  16. package/dist/ProfileComments-c7230f42.mjs +44 -0
  17. package/dist/ProfileEvents-2f22e7cf.mjs +56 -0
  18. package/dist/ProfileEvents-cc65404c.js +1 -0
  19. package/dist/ProfileLikes-e4fa0792.mjs +44 -0
  20. package/dist/ProfileLikes-fa41bad0.js +1 -0
  21. package/dist/ProfileOrganizations-cef668b5.mjs +212 -0
  22. package/dist/ProfileOrganizations-d4ec181b.js +1 -0
  23. package/dist/community.client.cjs +1 -1
  24. package/dist/community.client.js +15 -7
  25. package/dist/events.client.cjs +1 -1
  26. package/dist/events.client.js +37 -29
  27. package/dist/organizations.client-723ebb3b.js +3 -0
  28. package/dist/organizations.client-f4dff584.mjs +3017 -0
  29. package/dist/organizations.client.cjs +1 -1
  30. package/dist/organizations.client.js +4 -4
  31. package/dist/users.client.cjs +1 -1
  32. package/dist/users.client.js +9 -6
  33. package/package.json +1 -1
  34. package/src/components/Chips/Chips.vue +1 -2
  35. package/src/modules/backoffice/components/pages/Organizations.vue +1 -1
  36. package/src/modules/community/components/layouts/Community.vue +2 -2
  37. package/src/modules/community/components/pages/Blog.vue +1 -1
  38. package/src/modules/community/router/blogposts.js +9 -1
  39. package/src/modules/events/router/events.js +9 -1
  40. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  41. package/src/modules/organizations/components/pages/Organizations.vue +1 -1
  42. package/src/modules/organizations/components/pages/OrganizationsAccount.vue +1 -1
  43. package/src/modules/organizations/components/sections/Organizations.vue +1 -1
  44. package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
  45. package/src/modules/users/components/pages/ProfileComments.vue +1 -1
  46. package/src/modules/users/components/pages/ProfileEvents.vue +1 -1
  47. package/src/modules/users/components/pages/ProfileLikes.vue +1 -1
  48. package/src/modules/users/components/pages/ProfileOrganizations.vue +1 -1
  49. package/src/modules/users/router/users.js +10 -7
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),u=require("vue-router"),h=require("./IconEdit-4cfe2115.js"),k={key:0,class:"pd-b-zero"},f={class:"w-100 flex-v-center flex-nojustify flex"},g={class:"w-100 flex-nowrap flex-v-center flex"},w=["src"],y={key:2,class:"t-semi"},p={key:1},B={key:2},E={class:"d-block mn-l-auto flex-nowrap flex flex-v-center"},b={key:0,class:"w-4r i-thin"},$={style:{position:"absolute",top:"0px",right:"0px"},class:"br-solid br-2px br-white z-index-1 radius-big i-thin bg-second flex flex-center t-white p-small mn-r-small t-semi"},v=["src"],x={__name:"CardHeader",props:["date","dateFormatted","owner","creator","members","membersPhotos","type"],setup(t){u.useRouter();function m(r){const o=new Date,n=new Date(r),s=Math.abs(o-n),d=Math.floor(s/1e3),i=Math.floor(d/60),a=Math.floor(i/60),l=Math.floor(a/24),c=Math.floor(l/7);return c>0?`${c} week${c>1?"s":""} ago`:l>0?`${l} day${l>1?"s":""} ago`:a>0?`${a} hour${a>1?"s":""} ago`:i>0?`${i} minute${i>1?"s":""} ago`:"Just now"}return(r,o)=>t.owner?(e.openBlock(),e.createElementBlock("header",k,[e.createElementVNode("div",f,[e.createElementVNode("div",g,[t.owner.target.profile.photo.length>0&&t.type!=="short"?(e.openBlock(),e.createElementBlock("img",{key:0,src:(r.FILE_SERVER_URL||"")+t.owner.target.profile.photo,class:"radius-medium mn-r-thin i-thin",onClick:o[0]||(o[0]=e.withModifiers(n=>r.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},null,8,w)):e.createCommentVNode("",!0),!t.owner.target.profile.photo&&t.type!=="short"?(e.openBlock(),e.createBlock(h.PlaceholderUserpic,{key:1,class:"radius-medium mn-r-thin i-thin",onClick:o[1]||(o[1]=e.withModifiers(n=>r.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))})):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("span",y,[e.createElementVNode("span",{onClick:o[2]||(o[2]=e.withModifiers(n=>r.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},e.toDisplayString(t.owner.target.profile.name),1),!t.creator.hidden&&t.owner.target.profile.name!==t.creator.target.profile.name?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:o[3]||(o[3]=e.withModifiers(n=>r.$router.push({name:"User Profile",params:{_id:t.owner.target._id}}),["stop"]))}," · by "+e.toDisplayString(t.creator.target.profile.name),1)):e.createCommentVNode("",!0),t.date?(e.openBlock(),e.createElementBlock("span",p," · "+e.toDisplayString(m(t.date)),1)):e.createCommentVNode("",!0),t.dateFormatted?(e.openBlock(),e.createElementBlock("span",B," · "+e.toDisplayString(t.dateFormatted),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",E,[t.members?(e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("span",$,e.toDisplayString(t.members),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.membersPhotos.slice(0,2),(n,s)=>(e.openBlock(),e.createElementBlock("img",{key:s,src:(r.FILE_SERVER_URL||"")+n,style:e.normalizeStyle({position:"absolute",top:"0px",right:s*20+40+"%",zIndex:1-s}),class:"br-solid br-2px br-white i-thin bg-grey radius-big"},null,12,v))),128))])):e.createCommentVNode("",!0)])])])])):e.createCommentVNode("",!0)}},V={class:"flex-v-center gap-thin flex"},C={class:"pd-thin radius-small t-semi bg-main"},N={key:1,class:"pd-thin radius-small t-semi bg-white"},D={__name:"Chips",props:["chips"],setup(t){return(m,r)=>(e.openBlock(),e.createElementBlock("div",V,[t.chips.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.chips,(o,n)=>(e.openBlock(),e.createElementBlock("div",C,e.toDisplayString(o.text?o.text:o),1))),256)):(e.openBlock(),e.createElementBlock("div",N,e.toDisplayString(t.chips),1))]))}};exports._sfc_main=x;exports._sfc_main$1=D;
@@ -0,0 +1,108 @@
1
+ import { openBlock as r, createElementBlock as s, createElementVNode as d, withModifiers as h, createCommentVNode as i, createBlock as k, toDisplayString as a, Fragment as w, renderList as y, normalizeStyle as $ } from "vue";
2
+ import { useRouter as x } from "vue-router";
3
+ import { P as v } from "./IconEdit-eacf3856.mjs";
4
+ const p = {
5
+ key: 0,
6
+ class: "pd-b-zero"
7
+ }, E = { class: "w-100 flex-v-center flex-nojustify flex" }, P = { class: "w-100 flex-nowrap flex-v-center flex" }, z = ["src"], C = {
8
+ key: 2,
9
+ class: "t-semi"
10
+ }, M = { key: 1 }, R = { key: 2 }, U = { class: "d-block mn-l-auto flex-nowrap flex flex-v-center" }, F = {
11
+ key: 0,
12
+ class: "w-4r i-thin"
13
+ }, L = {
14
+ style: { position: "absolute", top: "0px", right: "0px" },
15
+ class: "br-solid br-2px br-white z-index-1 radius-big i-thin bg-second flex flex-center t-white p-small mn-r-small t-semi"
16
+ }, D = ["src"], j = {
17
+ __name: "CardHeader",
18
+ props: [
19
+ "date",
20
+ "dateFormatted",
21
+ "owner",
22
+ "creator",
23
+ "members",
24
+ "membersPhotos",
25
+ "type"
26
+ ],
27
+ setup(e) {
28
+ x();
29
+ function g(n) {
30
+ const t = /* @__PURE__ */ new Date(), o = new Date(n), l = Math.abs(t - o), b = Math.floor(l / 1e3), m = Math.floor(b / 60), c = Math.floor(m / 60), u = Math.floor(c / 24), f = Math.floor(u / 7);
31
+ return f > 0 ? `${f} week${f > 1 ? "s" : ""} ago` : u > 0 ? `${u} day${u > 1 ? "s" : ""} ago` : c > 0 ? `${c} hour${c > 1 ? "s" : ""} ago` : m > 0 ? `${m} minute${m > 1 ? "s" : ""} ago` : "Just now";
32
+ }
33
+ return (n, t) => e.owner ? (r(), s("header", p, [
34
+ d("div", E, [
35
+ d("div", P, [
36
+ e.owner.target.profile.photo.length > 0 && e.type !== "short" ? (r(), s("img", {
37
+ key: 0,
38
+ src: (n.FILE_SERVER_URL || "") + e.owner.target.profile.photo,
39
+ class: "radius-medium mn-r-thin i-thin",
40
+ onClick: t[0] || (t[0] = h((o) => n.$router.push({
41
+ name: e.owner.type === "user" ? "User Profile" : "Organization",
42
+ params: {
43
+ _id: e.owner.target._id
44
+ }
45
+ }), ["stop"]))
46
+ }, null, 8, z)) : i("", !0),
47
+ !e.owner.target.profile.photo && e.type !== "short" ? (r(), k(v, {
48
+ key: 1,
49
+ class: "radius-medium mn-r-thin i-thin",
50
+ onClick: t[1] || (t[1] = h((o) => n.$router.push({
51
+ name: e.owner.type === "user" ? "User Profile" : "Organization",
52
+ params: {
53
+ _id: e.owner.target._id
54
+ }
55
+ }), ["stop"]))
56
+ })) : i("", !0),
57
+ e.type !== "short" ? (r(), s("span", C, [
58
+ d("span", {
59
+ onClick: t[2] || (t[2] = h((o) => n.$router.push({
60
+ name: e.owner.type === "user" ? "User Profile" : "Organization",
61
+ params: {
62
+ _id: e.owner.target._id
63
+ }
64
+ }), ["stop"]))
65
+ }, a(e.owner.target.profile.name), 1),
66
+ !e.creator.hidden && e.owner.target.profile.name !== e.creator.target.profile.name ? (r(), s("span", {
67
+ key: 0,
68
+ onClick: t[3] || (t[3] = h((o) => n.$router.push({
69
+ name: "User Profile",
70
+ params: {
71
+ _id: e.owner.target._id
72
+ }
73
+ }), ["stop"]))
74
+ }, " · by " + a(e.creator.target.profile.name), 1)) : i("", !0),
75
+ e.date ? (r(), s("span", M, " · " + a(g(e.date)), 1)) : i("", !0),
76
+ e.dateFormatted ? (r(), s("span", R, " · " + a(e.dateFormatted), 1)) : i("", !0)
77
+ ])) : i("", !0),
78
+ d("div", U, [
79
+ e.members ? (r(), s("div", F, [
80
+ d("span", L, a(e.members), 1),
81
+ (r(!0), s(w, null, y(e.membersPhotos.slice(0, 2), (o, l) => (r(), s("img", {
82
+ key: l,
83
+ src: (n.FILE_SERVER_URL || "") + o,
84
+ style: $({ position: "absolute", top: "0px", right: l * 20 + 40 + "%", zIndex: 1 - l }),
85
+ class: "br-solid br-2px br-white i-thin bg-grey radius-big"
86
+ }, null, 12, D))), 128))
87
+ ])) : i("", !0)
88
+ ])
89
+ ])
90
+ ])
91
+ ])) : i("", !0);
92
+ }
93
+ }, S = { class: "flex-v-center gap-thin flex" }, V = { class: "pd-thin radius-small t-semi bg-main" }, B = {
94
+ key: 1,
95
+ class: "pd-thin radius-small t-semi bg-white"
96
+ }, A = {
97
+ __name: "Chips",
98
+ props: ["chips"],
99
+ setup(e) {
100
+ return (g, n) => (r(), s("div", S, [
101
+ e.chips.length ? (r(!0), s(w, { key: 0 }, y(e.chips, (t, o) => (r(), s("div", V, a(t.text ? t.text : t), 1))), 256)) : (r(), s("div", B, a(e.chips), 1))
102
+ ]));
103
+ }
104
+ };
105
+ export {
106
+ j as _,
107
+ A as a
108
+ };
@@ -0,0 +1,439 @@
1
+ import { reactive as z, watch as B, openBlock as o, createElementBlock as c, toDisplayString as d, createCommentVNode as i, createElementVNode as b, ref as g, createTextVNode as I, computed as L, createBlock as w, withModifiers as N, createVNode as k, normalizeClass as O, unref as m, renderSlot as U, onMounted as A, Transition as $, withCtx as j, Fragment as M, renderList as T } from "vue";
2
+ import { _ as F } from "./EmptyState-34d85f10.mjs";
3
+ import { _ as V } from "./_plugin-vue_export-helper-dad06003.mjs";
4
+ import { _ as q, a as D } from "./Chips-cc08d85a.mjs";
5
+ import { useRouter as G } from "vue-router";
6
+ import { a as E } from "./auth-cfeacd61.mjs";
7
+ import { s as p } from "./globals-96ba60e4.mjs";
8
+ import { I as H } from "./IconEdit-eacf3856.mjs";
9
+ const _ = E.create({ baseURL: process.env.API_URL, withCredentials: !0 });
10
+ _.defaults.withCredentials = !0;
11
+ const f = z({
12
+ all: [],
13
+ filter: {
14
+ // query
15
+ tags: [],
16
+ period: ""
17
+ // pagination
18
+ },
19
+ pagination: {
20
+ page: 1,
21
+ perPage: 18
22
+ },
23
+ // Sort
24
+ sort: {
25
+ current: "popularity",
26
+ ascending: !1
27
+ },
28
+ current: {
29
+ _id: "",
30
+ url: "",
31
+ status: "",
32
+ name: "",
33
+ tags: [],
34
+ owner: {},
35
+ date: "",
36
+ views: 0,
37
+ content: []
38
+ }
39
+ });
40
+ async function R(e = {}) {
41
+ e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
42
+ try {
43
+ console.log("Request params:" + e.params);
44
+ const t = await _.get("/api/blog/read", { params: e.params });
45
+ return e.url ? P(t.data, "current") : P(t.data, "all"), Promise.resolve(t.data);
46
+ } catch (t) {
47
+ return p(t), Promise.reject(t);
48
+ }
49
+ }
50
+ async function J(e) {
51
+ return _.post("/api/blog/create", e).then(
52
+ (t) => (P(t.data, "current"), Promise.resolve(t.data)),
53
+ (t) => (p(t), Promise.reject(t))
54
+ );
55
+ }
56
+ async function K(e) {
57
+ return _.post("/api/blog/update", e).then(
58
+ (t) => (P(t.data, "current"), Promise.resolve(t.data)),
59
+ (t) => (p(t), Promise.reject(t))
60
+ );
61
+ }
62
+ async function Q(e) {
63
+ return await _.delete(`/api/blog/delete/${e}`).then(
64
+ (t) => {
65
+ const a = f.all.findIndex((r) => r._id === e);
66
+ return a !== -1 && f.all.splice(a, 1), Promise.resolve(t.data);
67
+ },
68
+ (t) => (p(t), Promise.reject(t))
69
+ );
70
+ }
71
+ function P(e, t) {
72
+ f[t] = e;
73
+ }
74
+ function W() {
75
+ f.current = {
76
+ _id: "",
77
+ url: "",
78
+ status: "",
79
+ name: "",
80
+ tags: [],
81
+ author: "",
82
+ owner: "",
83
+ date: "",
84
+ views: 0,
85
+ content: []
86
+ };
87
+ }
88
+ function X(e) {
89
+ const t = {
90
+ order: f.project.content.length + 1,
91
+ type: e.type,
92
+ data: e.data,
93
+ class: e.class,
94
+ content: e.content
95
+ };
96
+ f.project.content.push(t);
97
+ }
98
+ B(f, (e, t) => {
99
+ });
100
+ const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
+ __proto__: null,
102
+ blockAdd: X,
103
+ clean: W,
104
+ create: J,
105
+ read: R,
106
+ remove: Q,
107
+ set: P,
108
+ state: f,
109
+ update: K
110
+ }, Symbol.toStringTag, { value: "Module" })), Y = {
111
+ props: {
112
+ progress: {
113
+ type: Number,
114
+ default: null
115
+ },
116
+ status: {
117
+ type: String,
118
+ default: null
119
+ }
120
+ }
121
+ }, Z = { class: "circular-loader" }, ee = /* @__PURE__ */ b("svg", { viewBox: "25 25 50 50" }, [
122
+ /* @__PURE__ */ b("circle", {
123
+ cx: "50",
124
+ cy: "50",
125
+ r: "20",
126
+ fill: "none",
127
+ "stroke-width": "4",
128
+ "stroke-miterlimit": "10"
129
+ })
130
+ ], -1), te = {
131
+ key: 0,
132
+ class: "progress-text"
133
+ }, re = {
134
+ key: 1,
135
+ class: "uppercase t-semi w-m-10r status-text"
136
+ };
137
+ function ae(e, t, a, r, s, n) {
138
+ return o(), c("div", Z, [
139
+ ee,
140
+ a.progress ? (o(), c("div", te, d(a.progress), 1)) : i("", !0),
141
+ a.status ? (o(), c("div", re, d(a.status), 1)) : i("", !0)
142
+ ]);
143
+ }
144
+ const se = /* @__PURE__ */ V(Y, [["render", ae]]), x = E.create({
145
+ baseURL: process.env.API_URL,
146
+ withCredentials: !0
147
+ }), y = z({
148
+ reactions: [],
149
+ error: null
150
+ }), S = {
151
+ async read({ user: e, type: t, target: a, role: r }) {
152
+ try {
153
+ const s = await x.get("/api/reactions", { params: { user: e, type: t, target: a, role: r } });
154
+ return y.error = null, y.reactions = s.data, Promise.resolve(s.data);
155
+ } catch (s) {
156
+ return p(s), Promise.reject(s);
157
+ }
158
+ },
159
+ async create(e) {
160
+ try {
161
+ const t = await x.post("/api/reactions/create", e);
162
+ return y.error = null, Promise.resolve(t.data);
163
+ } catch (t) {
164
+ return console.log(t), p(t), Promise.reject(t);
165
+ }
166
+ },
167
+ async update(e) {
168
+ try {
169
+ const t = await x.post("/api/reactions/update", e);
170
+ return y.error = null, Promise.resolve(t.data);
171
+ } catch (t) {
172
+ return p(t), Promise.reject(t);
173
+ }
174
+ },
175
+ async delete(e) {
176
+ try {
177
+ const t = await x.post("/api/reactions/delete", e);
178
+ return y.error = null, Promise.resolve(t.data);
179
+ } catch (t) {
180
+ return p(t), Promise.reject(t);
181
+ }
182
+ }
183
+ }, oe = {
184
+ handleReactionUpdate(e, t, a) {
185
+ let r;
186
+ if (Array.isArray(e) ? r = e.find((s) => s._id === t.target) : typeof e == "object" && e._id === t.target && (r = e), r)
187
+ if (r.hasReaction = a, a)
188
+ r.reactions.push(t), r.numberOfReactions += 1;
189
+ else {
190
+ const s = r.reactions.findIndex((n) => n._id === t._id);
191
+ s !== -1 && (r.reactions.splice(s, 1), r.numberOfReactions -= 1);
192
+ }
193
+ }
194
+ };
195
+ B(y, (e) => {
196
+ });
197
+ const Ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
198
+ __proto__: null,
199
+ actions: S,
200
+ mutations: oe,
201
+ state: y
202
+ }, Symbol.toStringTag, { value: "Module" })), le = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, ne = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ce = { class: "cursor-pointer" }, ie = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ue = {
203
+ __name: "FooterBlogpost",
204
+ props: ["blogpost", "owner", "user"],
205
+ setup(e) {
206
+ const t = e, a = g(t.blogpost.numberOfReactions), r = g(t.blogpost.isReacted), s = g(t.blogpost.reactionId);
207
+ async function n(v) {
208
+ if (!t.user) {
209
+ alert("Please login to add a reaction");
210
+ return;
211
+ }
212
+ try {
213
+ const l = {
214
+ target: t.blogpost._id,
215
+ type: "blogpost",
216
+ user: t.user,
217
+ class: "like"
218
+ }, h = await S.create(l);
219
+ h.reaction.class === "like" && (a.value += 1, r.value = !0, s.value = h.reaction._id);
220
+ } catch (l) {
221
+ console.error(l), alert("Error adding reaction. Please try again later.");
222
+ }
223
+ }
224
+ async function u(v) {
225
+ if (!t.user) {
226
+ alert("Please login to add a reaction");
227
+ return;
228
+ }
229
+ try {
230
+ const l = { _id: s.value };
231
+ await S.delete(l), a.value -= 1, r.value = !1, s.value = null;
232
+ } catch {
233
+ alert("Error adding reaction. Please try again later.");
234
+ }
235
+ }
236
+ return (v, l) => (o(), c("footer", le, [
237
+ I(" 👁️ " + d(e.blogpost.views) + " ", 1),
238
+ ne,
239
+ b("div", ce, [
240
+ r.value ? i("", !0) : (o(), c("div", {
241
+ key: 0,
242
+ class: "cursor-pointer",
243
+ onClick: l[0] || (l[0] = (h) => n())
244
+ }, " 👍 " + d(a.value), 1)),
245
+ r.value ? (o(), c("div", {
246
+ key: 1,
247
+ class: "cursor-pointer",
248
+ onClick: l[1] || (l[1] = (h) => u())
249
+ }, " 👍 " + d(a.value), 1)) : i("", !0)
250
+ ]),
251
+ ie,
252
+ I(" 💬 " + d(e.blogpost.numberOfComments), 1)
253
+ ]));
254
+ }
255
+ }, de = { class: "bg-grey radius-big" }, me = ["src"], ge = { class: "pd-t-zero pd-medium" }, pe = {
256
+ key: 0,
257
+ class: "cursor-pointer mn-thin flex-nowrap flex w-100"
258
+ }, fe = {
259
+ key: 0,
260
+ 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"
261
+ }, ye = {
262
+ key: 1,
263
+ class: "mn-small t-transp p-big"
264
+ }, be = {
265
+ key: 2,
266
+ class: "mn-small h2"
267
+ }, ve = {
268
+ __name: "CardBlogpost",
269
+ props: ["blogpost", "user", "type"],
270
+ setup(e) {
271
+ const t = e, a = G(), r = L(() => t.blogpost.content.find((n) => n.type === "ImageUpload")), s = L(() => t.blogpost.content.find((n) => n.type === "Textarea"));
272
+ return (n, u) => (o(), c("article", de, [
273
+ e.user === e.blogpost.creator.target._id ? (o(), w(H, {
274
+ key: 0,
275
+ onClick: u[0] || (u[0] = N((v) => n.$router.push({
276
+ name: "Edit BlogPost",
277
+ params: {
278
+ url: e.blogpost.url
279
+ }
280
+ }), ["stop"])),
281
+ class: "z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
282
+ })) : i("", !0),
283
+ k(q, {
284
+ class: O({
285
+ "mn-small pd-medium": e.type !== "short",
286
+ "flex-child-order-last flex-child mn-l-small": e.type === "short"
287
+ }),
288
+ owner: e.blogpost.owner,
289
+ creator: e.blogpost.creator,
290
+ date: e.blogpost.createdAt
291
+ }, null, 8, ["class", "owner", "creator", "date"]),
292
+ m(r) && m(r).content && e.type !== "blogpostPage" ? (o(), c("img", {
293
+ key: 1,
294
+ src: (n.FILE_SERVER_URL || "") + m(r).content,
295
+ alt: "Blog post image",
296
+ class: "mn-medium object-fit-cover w-100 h-20r"
297
+ }, null, 8, me)) : i("", !0),
298
+ b("section", ge, [
299
+ e.type !== "blogpostPage" ? (o(), c("div", pe, [
300
+ b("h3", {
301
+ onClick: u[1] || (u[1] = (v) => m(a).push({
302
+ name: "BlogPost",
303
+ params: {
304
+ url: e.blogpost.url
305
+ }
306
+ })),
307
+ class: ""
308
+ }, d(e.blogpost.name), 1),
309
+ e.blogpost.status === "draft" ? (o(), c("div", fe, d(e.blogpost.status), 1)) : i("", !0)
310
+ ])) : i("", !0),
311
+ m(s) && m(s).content && e.type !== "blogpostPage" ? (o(), c("p", ye, d(m(s).content.slice(0, 120)) + "... ", 1)) : i("", !0),
312
+ e.type === "blogpostPage" ? (o(), c("h3", be, d(e.blogpost.name), 1)) : i("", !0),
313
+ U(n.$slots, "default"),
314
+ e.type !== "short" && e.blogpost.tags.length > 0 ? (o(), w(D, {
315
+ key: 3,
316
+ chips: e.blogpost.tags
317
+ }, null, 8, ["chips"])) : i("", !0)
318
+ ]),
319
+ k(ue, {
320
+ class: "pd-t-zero pd-medium",
321
+ blogpost: e.blogpost,
322
+ user: e.user
323
+ }, null, 8, ["blogpost", "user"])
324
+ ]));
325
+ }
326
+ }, he = { class: "feed" }, we = { key: 1 }, Le = {
327
+ __name: "Feed",
328
+ props: {
329
+ category: {
330
+ type: String,
331
+ default: null
332
+ },
333
+ owner: {
334
+ type: String,
335
+ default: null
336
+ },
337
+ creator: {
338
+ type: String,
339
+ default: null
340
+ },
341
+ status: {
342
+ type: String,
343
+ default: "published"
344
+ },
345
+ user: {
346
+ type: [String, Number],
347
+ default: null
348
+ },
349
+ period: {
350
+ type: String,
351
+ default: null
352
+ }
353
+ },
354
+ setup(e) {
355
+ const t = e, a = g([]), r = g(!0);
356
+ let s = g(!0), n = g(0), u = g(7);
357
+ const v = async () => {
358
+ if (r.value) {
359
+ n.value += u.value;
360
+ const l = await R({
361
+ skip: n.value,
362
+ limit: u.value,
363
+ category: t.category,
364
+ user: t.user,
365
+ owner: t.owner,
366
+ status: t.status,
367
+ creator: t.creator,
368
+ period: t.period
369
+ });
370
+ l.length === 0 && (r.value = !1), a.value = [...a.value, ...l];
371
+ }
372
+ };
373
+ return A(async () => {
374
+ const l = await R({
375
+ skip: n.value,
376
+ limit: u.value,
377
+ category: t.category,
378
+ user: t.user,
379
+ owner: t.owner,
380
+ status: t.status,
381
+ creator: t.creator,
382
+ period: t.period
383
+ });
384
+ l.length === 0 ? r.value = !1 : r.value = !0, a.value = l, s.value = !1;
385
+ }), (l, h) => (o(), c("section", he, [
386
+ k($, { name: "fade" }, {
387
+ default: j(() => [
388
+ m(s) ? (o(), w(se, {
389
+ key: 0,
390
+ class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
391
+ })) : i("", !0)
392
+ ]),
393
+ _: 1
394
+ }),
395
+ k($, { name: "fade" }, {
396
+ default: j(() => [
397
+ !m(s) && a.value.length < 1 ? (o(), w(F, {
398
+ key: 0,
399
+ title: "No Blog Posts Found",
400
+ description: "Currently, there are no posts available in this blog. Please check back later.",
401
+ class: "pd-medium mn-thin bg-grey radius-big"
402
+ })) : (o(), c("div", we, [
403
+ (o(!0), c(M, null, T(a.value, (C) => (o(), w(ve, {
404
+ key: C._id,
405
+ blogpost: C,
406
+ user: e.user,
407
+ class: "mn-medium"
408
+ }, null, 8, ["blogpost", "user"]))), 128)),
409
+ k($, { name: "fade" }, {
410
+ default: j(() => [
411
+ r.value && a.value.length > 0 ? (o(), c("button", {
412
+ key: 0,
413
+ onClick: v,
414
+ class: "w-100 bg-main button"
415
+ }, " Load more ")) : i("", !0)
416
+ ]),
417
+ _: 1
418
+ })
419
+ ]))
420
+ ]),
421
+ _: 1
422
+ })
423
+ ]));
424
+ }
425
+ };
426
+ export {
427
+ se as L,
428
+ Le as _,
429
+ J as a,
430
+ Q as b,
431
+ W as c,
432
+ ve as d,
433
+ ue as e,
434
+ Ce as f,
435
+ Ie as g,
436
+ R as r,
437
+ f as s,
438
+ K as u
439
+ };