@burdenoff/microfe-eventfullymanaged 2026.1123.1 → 2026.1123.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eventfullymanaged/api/eventApi.d.ts +15 -0
- package/dist/eventfullymanaged/api/eventApi.js +75 -57
- package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
- package/dist/eventfullymanaged/components/CampaignAudiencePicker.d.ts +8 -0
- package/dist/eventfullymanaged/components/CampaignAudiencePicker.js +70 -0
- package/dist/eventfullymanaged/components/CampaignAudiencePicker.js.map +1 -0
- package/dist/eventfullymanaged/pages/modules/CommunicationPage.js +336 -245
- package/dist/eventfullymanaged/pages/modules/CommunicationPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import { useAnnouncementsQuery as e, useCommunicationCampaignsQuery as t, useEventsQuery as n, usePublishAnnouncementMutation as r, useSendCommunicationCampaignMutation as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { useAnnouncementsQuery as e, useCommunicationCampaignsQuery as t, useEventsQuery as n, usePublishAnnouncementMutation as r, useSendCommunicationCampaignMutation as i, useUpsertAnnouncementMutation as a, useUpsertCommunicationCampaignMutation as ee } from "../../api/eventApi.js";
|
|
2
|
+
import { CampaignAudiencePicker as o } from "../../components/CampaignAudiencePicker.js";
|
|
3
|
+
import { Pagination as s, usePagination as c } from "../../components/Pagination.js";
|
|
4
|
+
import { describeError as l, mutationSucceeded as u } from "../../lib/mutationResult.js";
|
|
5
|
+
import { notify as d } from "../../lib/toast.js";
|
|
6
|
+
import { useMemo as f, useState as p } from "react";
|
|
7
|
+
import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
|
+
import { Mail as g, Megaphone as ne, Plus as _, Send as re, Upload as ie } from "lucide-react";
|
|
10
|
+
import { Badge as v, Button as y, GlassCard as b, GradientText as ae, IllustratedEmptyState as x, Input as S, PagePurpose as oe, Select as se, SelectContent as ce, SelectItem as le, SelectTrigger as ue, SelectValue as de, Textarea as fe } from "@burdenoff/fe-libs/ui";
|
|
10
11
|
// src/eventfullymanaged/pages/modules/CommunicationPage.tsx
|
|
11
|
-
function
|
|
12
|
+
function pe(e) {
|
|
12
13
|
let t = e.metadata?.schedule;
|
|
13
14
|
if (!t || typeof t != "object" || Array.isArray(t)) return null;
|
|
14
15
|
let n = t.sendAt;
|
|
15
16
|
return typeof n == "string" && n ? n : null;
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function me(e) {
|
|
19
|
+
let t = e.metadata?.targetAudience, n = e.metadata?.audienceTagLabels, r = n && typeof n == "object" ? n : {}, i = typeof t == "string" ? t.split(",") : t && typeof t == "object" && "segments" in t ? t.segments : t;
|
|
20
|
+
if (!Array.isArray(i)) return [];
|
|
21
|
+
let a = i.filter((e) => typeof e == "string" && !!e.trim());
|
|
22
|
+
return [...new Set(a.map((e) => e.trim()))].map((e) => {
|
|
23
|
+
let t = r[e];
|
|
24
|
+
return {
|
|
25
|
+
id: e,
|
|
26
|
+
label: typeof t == "string" ? t : e
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function C(e) {
|
|
31
|
+
return {
|
|
32
|
+
targetAudience: { segments: e.map(({ id: e }) => e) },
|
|
33
|
+
audienceTagLabels: Object.fromEntries(e.map(({ id: e, label: t }) => [e, t]))
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function w(e) {
|
|
18
37
|
let t = e.toLowerCase();
|
|
19
38
|
return [
|
|
20
39
|
"published",
|
|
@@ -33,413 +52,485 @@ function x(e) {
|
|
|
33
52
|
"scheduled"
|
|
34
53
|
].includes(t) ? "info" : "secondary";
|
|
35
54
|
}
|
|
36
|
-
var
|
|
55
|
+
var T = (e) => {
|
|
37
56
|
let t = (e ?? "").toLowerCase();
|
|
38
57
|
return t === "" || t === "draft" || t === "created" || t === "scheduled";
|
|
39
|
-
},
|
|
40
|
-
function
|
|
41
|
-
let { t:
|
|
42
|
-
let n =
|
|
58
|
+
}, E = (e, t) => e.title ?? e.name ?? `${t} ${e.id}`;
|
|
59
|
+
function D() {
|
|
60
|
+
let { t: D } = te(), O = (e, t) => {
|
|
61
|
+
let n = D(e);
|
|
43
62
|
return n === e ? t : n;
|
|
44
|
-
},
|
|
45
|
-
limit:
|
|
46
|
-
offset:
|
|
47
|
-
}),
|
|
48
|
-
limit:
|
|
49
|
-
offset:
|
|
50
|
-
}), [he, { loading: ge }] =
|
|
63
|
+
}, k = c({ pageSize: 8 }), A = c({ pageSize: 8 }), j = e({
|
|
64
|
+
limit: k.limit,
|
|
65
|
+
offset: k.offset
|
|
66
|
+
}), M = t({
|
|
67
|
+
limit: A.limit,
|
|
68
|
+
offset: A.offset
|
|
69
|
+
}), [he, { loading: ge }] = a(), [_e, { loading: ve }] = r(), [N, { loading: P }] = ee(), [ye, { loading: F }] = i(), { data: be } = n({
|
|
51
70
|
limit: 100,
|
|
52
71
|
offset: 0
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
if (!
|
|
57
|
-
|
|
72
|
+
}), xe = be?.events?.items ?? [], [I, L] = p("announcement"), [R, Se] = p(""), [z, B] = p(""), [V, H] = p(""), [U, W] = p([]), [G, K] = p(null), [q, J] = p(""), [Y, Ce] = p(""), X = f(() => j.data?.announcements.items ?? [], [j.data]), Z = j.data?.announcements.total ?? 0, Q = f(() => M.data?.communicationCampaigns.items ?? [], [M.data]), $ = M.data?.communicationCampaigns.total ?? 0, we = I === "announcement" ? ge : P, Te = () => {
|
|
73
|
+
Se(""), B(""), H(""), W([]), J(""), Ce("");
|
|
74
|
+
}, Ee = async () => {
|
|
75
|
+
if (!z.trim()) {
|
|
76
|
+
d.error(O("eventfullymanaged.communication.subjectRequired", "Subject required"), "");
|
|
58
77
|
return;
|
|
59
78
|
}
|
|
60
79
|
if (I === "announcement") {
|
|
61
80
|
let e = {};
|
|
62
|
-
|
|
63
|
-
let t =
|
|
81
|
+
q.trim() && (e.body = q.trim()), V.trim() && (e.audience = V.trim());
|
|
82
|
+
let t = O("eventfullymanaged.communication.errors.create", "Could not create announcement");
|
|
64
83
|
try {
|
|
65
84
|
let n = await he({ variables: { input: {
|
|
66
|
-
title:
|
|
67
|
-
name:
|
|
85
|
+
title: z,
|
|
86
|
+
name: z,
|
|
68
87
|
status: "draft",
|
|
69
88
|
eventId: R || void 0,
|
|
70
89
|
metadata: e
|
|
71
90
|
} } });
|
|
72
|
-
if (!
|
|
73
|
-
|
|
91
|
+
if (!u(n, n.data?.upsertAnnouncement?.id, t)) return;
|
|
92
|
+
Te(), d.success(O("eventfullymanaged.communication.created", "Announcement created")), await j.refetch();
|
|
74
93
|
} catch (e) {
|
|
75
|
-
|
|
94
|
+
d.error(t, l(e));
|
|
76
95
|
}
|
|
77
96
|
return;
|
|
78
97
|
}
|
|
79
|
-
let e =
|
|
80
|
-
|
|
81
|
-
let
|
|
98
|
+
let e = {};
|
|
99
|
+
q.trim() && (e.content = { body: q.trim() }), U.length > 0 && Object.assign(e, C(U)), Y && (e.schedule = { sendAt: new Date(Y).toISOString() });
|
|
100
|
+
let t = O("eventfullymanaged.communication.errors.createCampaign", "Could not create campaign");
|
|
82
101
|
try {
|
|
83
|
-
let
|
|
84
|
-
title:
|
|
85
|
-
name:
|
|
102
|
+
let n = await N({ variables: { input: {
|
|
103
|
+
title: z,
|
|
104
|
+
name: z,
|
|
86
105
|
status: "draft",
|
|
87
106
|
eventId: R || void 0,
|
|
88
|
-
metadata:
|
|
107
|
+
metadata: e
|
|
89
108
|
} } });
|
|
90
|
-
if (!
|
|
91
|
-
|
|
109
|
+
if (!u(n, n.data?.upsertCommunicationCampaign?.id, t)) return;
|
|
110
|
+
Te(), d.success(O("eventfullymanaged.communication.campaignCreated", "Campaign created")), await M.refetch();
|
|
111
|
+
} catch (e) {
|
|
112
|
+
d.error(t, l(e));
|
|
113
|
+
}
|
|
114
|
+
}, De = async () => {
|
|
115
|
+
if (!G?.changed) return;
|
|
116
|
+
let { row: e, tags: t } = G, n = O("eventfullymanaged.communication.errors.saveAudience", "Could not save campaign audience");
|
|
117
|
+
try {
|
|
118
|
+
let r = await N({ variables: {
|
|
119
|
+
id: e.id,
|
|
120
|
+
input: {
|
|
121
|
+
name: e.name ?? void 0,
|
|
122
|
+
title: e.title ?? void 0,
|
|
123
|
+
status: "draft",
|
|
124
|
+
eventId: e.eventId ?? void 0,
|
|
125
|
+
metadata: {
|
|
126
|
+
...e.metadata,
|
|
127
|
+
...C(t)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
} });
|
|
131
|
+
if (!u(r, r.data?.upsertCommunicationCampaign?.id, n)) return;
|
|
132
|
+
K(null), d.success(O("eventfullymanaged.communication.audienceSaved", "Campaign audience saved")), await M.refetch();
|
|
92
133
|
} catch (e) {
|
|
93
|
-
|
|
134
|
+
d.error(n, l(e));
|
|
94
135
|
}
|
|
95
|
-
},
|
|
96
|
-
let t =
|
|
136
|
+
}, Oe = async (e) => {
|
|
137
|
+
let t = O("eventfullymanaged.communication.errors.publish", "Could not publish announcement");
|
|
97
138
|
try {
|
|
98
139
|
let n = await _e({ variables: { id: e.id } });
|
|
99
|
-
if (!
|
|
100
|
-
|
|
140
|
+
if (!u(n, n.data?.publishAnnouncement?.id, t)) return;
|
|
141
|
+
d.success(O("eventfullymanaged.communication.published", "Announcement published")), await j.refetch();
|
|
101
142
|
} catch (e) {
|
|
102
|
-
|
|
143
|
+
d.error(t, l(e));
|
|
103
144
|
}
|
|
104
|
-
},
|
|
105
|
-
let t =
|
|
145
|
+
}, ke = async (e) => {
|
|
146
|
+
let t = O("eventfullymanaged.communication.errors.send", "Could not send campaign");
|
|
106
147
|
try {
|
|
107
|
-
let n = await
|
|
108
|
-
if (!
|
|
109
|
-
n.data?.sendCommunicationCampaign?.status === "scheduled" ?
|
|
148
|
+
let n = await ye({ variables: { id: e.id } });
|
|
149
|
+
if (!u(n, n.data?.sendCommunicationCampaign?.id, t)) return;
|
|
150
|
+
n.data?.sendCommunicationCampaign?.status === "scheduled" ? d.success(O("eventfullymanaged.communication.scheduledAutoSend", "Campaign scheduled. It will be sent automatically at its send time; cancel the schedule to stop it.")) : d.success(O("eventfullymanaged.communication.sent", "Campaign delivery started")), await M.refetch();
|
|
110
151
|
} catch (e) {
|
|
111
|
-
|
|
152
|
+
d.error(t, l(e));
|
|
112
153
|
}
|
|
113
|
-
},
|
|
114
|
-
let t = e.metadata ?? {}, n = Object.fromEntries(Object.entries(t).filter(([e]) => e !== "schedule")), r =
|
|
154
|
+
}, Ae = async (e) => {
|
|
155
|
+
let t = e.metadata ?? {}, n = Object.fromEntries(Object.entries(t).filter(([e]) => e !== "schedule")), r = O("eventfullymanaged.communication.errors.cancelSchedule", "Could not cancel schedule");
|
|
115
156
|
try {
|
|
116
|
-
let t = await
|
|
157
|
+
let t = await N({ variables: {
|
|
117
158
|
id: e.id,
|
|
118
159
|
input: {
|
|
119
160
|
status: "draft",
|
|
120
161
|
metadata: n
|
|
121
162
|
}
|
|
122
163
|
} });
|
|
123
|
-
if (!
|
|
124
|
-
|
|
164
|
+
if (!u(t, t.data?.upsertCommunicationCampaign?.id, r)) return;
|
|
165
|
+
d.success(O("eventfullymanaged.communication.scheduleCancelled", "Schedule cancelled; back to draft")), await M.refetch();
|
|
125
166
|
} catch (e) {
|
|
126
|
-
|
|
167
|
+
d.error(r, l(e));
|
|
127
168
|
}
|
|
128
169
|
};
|
|
129
|
-
return /* @__PURE__ */
|
|
170
|
+
return /* @__PURE__ */ h("div", {
|
|
130
171
|
className: "space-y-6 p-6",
|
|
131
172
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ m(oe, { children: O("eventfullymanaged.communication.audiencePurpose", "Publish announcements to an event or workspace. Campaigns can also target attendees by tag. A sent status confirms that the campaign was queued.") }),
|
|
174
|
+
/* @__PURE__ */ h("div", {
|
|
134
175
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
|
|
136
177
|
className: "text-2xl font-bold text-text-primary",
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
}), /* @__PURE__ */
|
|
178
|
+
children: /* @__PURE__ */ m(ae, { children: O("eventfullymanaged.communication.title", "Communications") })
|
|
179
|
+
}), /* @__PURE__ */ m("p", {
|
|
139
180
|
className: "mt-1 text-sm text-text-secondary",
|
|
140
|
-
children:
|
|
141
|
-
})] }), /* @__PURE__ */
|
|
181
|
+
children: O("eventfullymanaged.communication.description", "Draft, publish and send from one place.")
|
|
182
|
+
})] }), /* @__PURE__ */ h("div", {
|
|
142
183
|
className: "flex flex-col gap-2 sm:flex-row",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ h(y, {
|
|
144
185
|
type: "button",
|
|
145
186
|
variant: I === "announcement" ? "default" : "outline",
|
|
146
187
|
onClick: () => L("announcement"),
|
|
147
|
-
children: [/* @__PURE__ */
|
|
148
|
-
}), /* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ m(_, { className: "h-4 w-4" }), O("eventfullymanaged.communication.actions.newAnnouncement", "New announcement")]
|
|
189
|
+
}), /* @__PURE__ */ h(y, {
|
|
149
190
|
type: "button",
|
|
150
191
|
variant: I === "campaign" ? "default" : "outline",
|
|
151
192
|
onClick: () => L("campaign"),
|
|
152
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ m(_, { className: "h-4 w-4" }), O("eventfullymanaged.communication.actions.newCampaign", "New campaign")]
|
|
153
194
|
})]
|
|
154
195
|
})]
|
|
155
196
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ m(b, {
|
|
157
198
|
treatment: "glass",
|
|
158
199
|
glow: !0,
|
|
159
200
|
className: "p-5",
|
|
160
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ h("div", {
|
|
161
202
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ h("div", {
|
|
163
204
|
className: "space-y-3",
|
|
164
205
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ h("div", {
|
|
166
207
|
className: "flex items-center gap-2",
|
|
167
|
-
children: [
|
|
208
|
+
children: [m(I === "announcement" ? ne : g, { className: "h-4 w-4 text-accent-primary" }), /* @__PURE__ */ m("h2", {
|
|
168
209
|
className: "text-base font-semibold text-text-primary",
|
|
169
|
-
children: I === "announcement" ?
|
|
210
|
+
children: I === "announcement" ? O("eventfullymanaged.communication.compose.announcement", "Compose announcement") : O("eventfullymanaged.communication.compose.campaign", "Compose campaign")
|
|
170
211
|
})]
|
|
171
212
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ h("label", {
|
|
173
214
|
className: "block space-y-1 text-sm",
|
|
174
215
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ m("span", {
|
|
176
217
|
className: "font-medium text-text-primary",
|
|
177
|
-
children:
|
|
218
|
+
children: O("eventfullymanaged.communication.fields.event", "Event (optional)")
|
|
178
219
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ h(se, {
|
|
180
221
|
value: R,
|
|
181
|
-
onValueChange:
|
|
182
|
-
children: [/* @__PURE__ */
|
|
183
|
-
"aria-label":
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
-
}), /* @__PURE__ */
|
|
222
|
+
onValueChange: Se,
|
|
223
|
+
children: [/* @__PURE__ */ m(ue, {
|
|
224
|
+
"aria-label": O("eventfullymanaged.communication.fields.event", "Event (optional)"),
|
|
225
|
+
children: /* @__PURE__ */ m(de, { placeholder: O("eventfullymanaged.communication.fields.eventPlaceholder", "All events (workspace-wide)") })
|
|
226
|
+
}), /* @__PURE__ */ m(ce, { children: xe.map((e) => /* @__PURE__ */ m(le, {
|
|
186
227
|
value: e.id,
|
|
187
228
|
children: e.name
|
|
188
229
|
}, e.id)) })]
|
|
189
230
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ m("span", {
|
|
191
232
|
className: "block text-xs text-text-muted",
|
|
192
|
-
children:
|
|
233
|
+
children: O("eventfullymanaged.communication.fields.eventScopeHint", "Choose an event to limit the audience to its attendees. Leave it unset to use the workspace.")
|
|
193
234
|
})
|
|
194
235
|
]
|
|
195
236
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ h("label", {
|
|
197
238
|
className: "block space-y-1 text-sm",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ m("span", {
|
|
199
240
|
className: "font-medium text-text-primary",
|
|
200
|
-
children:
|
|
201
|
-
}), /* @__PURE__ */
|
|
202
|
-
value:
|
|
203
|
-
onChange: (e) =>
|
|
204
|
-
placeholder:
|
|
205
|
-
"aria-label":
|
|
241
|
+
children: O("eventfullymanaged.communication.fields.subject", "Subject")
|
|
242
|
+
}), /* @__PURE__ */ m(S, {
|
|
243
|
+
value: z,
|
|
244
|
+
onChange: (e) => B(e.target.value),
|
|
245
|
+
placeholder: O("eventfullymanaged.communication.fields.subjectPlaceholder", "Q4 Product Roadmap Update"),
|
|
246
|
+
"aria-label": O("eventfullymanaged.communication.fields.subject", "Subject")
|
|
206
247
|
})]
|
|
207
248
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
249
|
+
I === "campaign" ? /* @__PURE__ */ m(o, {
|
|
250
|
+
selected: U,
|
|
251
|
+
onChange: W
|
|
252
|
+
}) : /* @__PURE__ */ h("label", {
|
|
209
253
|
className: "block space-y-1 text-sm",
|
|
210
254
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ m("span", {
|
|
212
256
|
className: "font-medium text-text-primary",
|
|
213
|
-
children:
|
|
257
|
+
children: O("eventfullymanaged.communication.fields.announcementAudience", "Audience labels (optional)")
|
|
214
258
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
value:
|
|
217
|
-
onChange: (e) =>
|
|
218
|
-
placeholder:
|
|
219
|
-
"aria-label":
|
|
259
|
+
/* @__PURE__ */ m(S, {
|
|
260
|
+
value: V,
|
|
261
|
+
onChange: (e) => H(e.target.value),
|
|
262
|
+
placeholder: O("eventfullymanaged.communication.fields.audienceSegmentsPlaceholder", "vip, early-bird, speakers (comma-separated segments)"),
|
|
263
|
+
"aria-label": O("eventfullymanaged.communication.fields.announcementAudience", "Audience labels (optional)")
|
|
220
264
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ m("span", {
|
|
222
266
|
className: "block text-xs text-text-muted",
|
|
223
|
-
children:
|
|
267
|
+
children: O("eventfullymanaged.communication.fields.announcementAudienceHint", "Announcement labels do not change who receives the announcement.")
|
|
224
268
|
})
|
|
225
269
|
]
|
|
226
270
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ h("label", {
|
|
228
272
|
className: "block space-y-1 text-sm",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
273
|
+
children: [/* @__PURE__ */ m("span", {
|
|
230
274
|
className: "font-medium text-text-primary",
|
|
231
|
-
children:
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
-
value:
|
|
234
|
-
onChange: (e) =>
|
|
275
|
+
children: O("eventfullymanaged.communication.fields.body", "Message")
|
|
276
|
+
}), /* @__PURE__ */ m(fe, {
|
|
277
|
+
value: q,
|
|
278
|
+
onChange: (e) => J(e.target.value),
|
|
235
279
|
rows: 5,
|
|
236
|
-
placeholder:
|
|
237
|
-
"aria-label":
|
|
280
|
+
placeholder: O("eventfullymanaged.communication.fields.bodyPlaceholder", "Hi there, here are the latest updates…"),
|
|
281
|
+
"aria-label": O("eventfullymanaged.communication.fields.body", "Message")
|
|
238
282
|
})]
|
|
239
283
|
}),
|
|
240
|
-
I === "campaign" ? /* @__PURE__ */
|
|
284
|
+
I === "campaign" ? /* @__PURE__ */ h("label", {
|
|
241
285
|
className: "block space-y-1 text-sm",
|
|
242
286
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ m("span", {
|
|
244
288
|
className: "font-medium text-text-primary",
|
|
245
|
-
children:
|
|
289
|
+
children: O("eventfullymanaged.communication.fields.scheduleAt", "Schedule send (optional)")
|
|
246
290
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ m(S, {
|
|
248
292
|
type: "datetime-local",
|
|
249
|
-
value:
|
|
250
|
-
onChange: (e) =>
|
|
251
|
-
"aria-label":
|
|
293
|
+
value: Y,
|
|
294
|
+
onChange: (e) => Ce(e.target.value),
|
|
295
|
+
"aria-label": O("eventfullymanaged.communication.fields.scheduleAt", "Schedule send (optional)")
|
|
252
296
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ m("span", {
|
|
254
298
|
className: "block text-xs text-text-muted",
|
|
255
|
-
children:
|
|
299
|
+
children: O("eventfullymanaged.communication.fields.scheduleHint", "Leave blank to send immediately when you click Send campaign. A future time is not sent automatically — you (or anyone with access) must click Send campaign again at or after that time. Times are in your browser’s local time zone.")
|
|
256
300
|
})
|
|
257
301
|
]
|
|
258
302
|
}) : null,
|
|
259
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ m("div", {
|
|
260
304
|
className: "flex justify-end",
|
|
261
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ m(y, {
|
|
262
306
|
type: "button",
|
|
263
|
-
disabled:
|
|
264
|
-
onClick:
|
|
265
|
-
children:
|
|
307
|
+
disabled: we,
|
|
308
|
+
onClick: Ee,
|
|
309
|
+
children: we ? O("eventfullymanaged.communication.actions.saving", "Saving…") : O(I === "announcement" ? "eventfullymanaged.communication.actions.createAnnouncement" : "eventfullymanaged.communication.actions.createCampaign", "Create draft")
|
|
266
310
|
})
|
|
267
311
|
})
|
|
268
312
|
]
|
|
269
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ h("div", {
|
|
270
314
|
className: "rounded-card border border-border-seam bg-bg-surface p-4",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ h("div", {
|
|
272
316
|
className: "flex items-center justify-between border-b border-border-seam pb-2",
|
|
273
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ h("span", {
|
|
274
318
|
className: "flex items-center gap-2 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
276
|
-
}), /* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ m(g, { className: "h-3.5 w-3.5" }), O("eventfullymanaged.communication.preview.label", "Preview")]
|
|
320
|
+
}), /* @__PURE__ */ m(v, {
|
|
277
321
|
variant: "info",
|
|
278
322
|
className: "uppercase",
|
|
279
|
-
children:
|
|
323
|
+
children: O("eventfullymanaged.communication.preview.draft", "Draft")
|
|
280
324
|
})]
|
|
281
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ h("div", {
|
|
282
326
|
className: "mt-3 space-y-2",
|
|
283
327
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ m("p", {
|
|
285
329
|
className: "text-base font-semibold text-text-primary",
|
|
286
|
-
children:
|
|
330
|
+
children: z.trim() || O("eventfullymanaged.communication.preview.noSubject", "Your subject line")
|
|
287
331
|
}),
|
|
288
|
-
|
|
332
|
+
(I === "campaign" ? U.length > 0 : V.trim()) ? /* @__PURE__ */ h("p", {
|
|
289
333
|
className: "text-xs text-text-secondary",
|
|
290
334
|
children: [
|
|
291
|
-
|
|
292
|
-
":
|
|
293
|
-
|
|
335
|
+
O("eventfullymanaged.communication.preview.to", "To"),
|
|
336
|
+
":",
|
|
337
|
+
" ",
|
|
338
|
+
I === "campaign" ? U.map(({ label: e }) => e).join(", ") : V.trim()
|
|
294
339
|
]
|
|
295
340
|
}) : null,
|
|
296
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ m("p", {
|
|
297
342
|
className: "whitespace-pre-wrap text-sm text-text-secondary",
|
|
298
|
-
children:
|
|
343
|
+
children: q.trim() || O("eventfullymanaged.communication.preview.noBody", "Start typing to see your message preview here.")
|
|
299
344
|
})
|
|
300
345
|
]
|
|
301
346
|
})]
|
|
302
347
|
})]
|
|
303
348
|
})
|
|
304
349
|
}),
|
|
305
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ h("div", {
|
|
306
351
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
307
|
-
children: [/* @__PURE__ */
|
|
352
|
+
children: [/* @__PURE__ */ h(b, {
|
|
308
353
|
treatment: "plain",
|
|
309
354
|
className: "border-border-seam p-5",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ h("div", {
|
|
311
356
|
className: "flex items-center justify-between",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
313
358
|
className: "text-lg font-semibold text-text-primary",
|
|
314
|
-
children:
|
|
315
|
-
}),
|
|
359
|
+
children: O("eventfullymanaged.communication.announcements.heading", "Announcements")
|
|
360
|
+
}), Z > 0 ? /* @__PURE__ */ m("span", {
|
|
316
361
|
className: "text-sm text-text-muted",
|
|
317
|
-
children:
|
|
362
|
+
children: Z
|
|
318
363
|
}) : null]
|
|
319
|
-
}), /* @__PURE__ */
|
|
364
|
+
}), /* @__PURE__ */ h("div", {
|
|
320
365
|
className: "mt-4",
|
|
321
|
-
children: [
|
|
366
|
+
children: [j.loading && X.length === 0 ? /* @__PURE__ */ m("p", {
|
|
322
367
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
323
|
-
children:
|
|
324
|
-
}) :
|
|
368
|
+
children: O("eventfullymanaged.communication.announcements.loading", "Loading announcements…")
|
|
369
|
+
}) : X.length === 0 ? /* @__PURE__ */ m(x, {
|
|
325
370
|
illustration: "empty-data",
|
|
326
|
-
title:
|
|
371
|
+
title: O("eventfullymanaged.communication.announcements.empty", "No announcements yet."),
|
|
327
372
|
className: "py-8"
|
|
328
|
-
}) : /* @__PURE__ */
|
|
373
|
+
}) : /* @__PURE__ */ m("ul", {
|
|
329
374
|
className: "space-y-2.5",
|
|
330
|
-
children:
|
|
375
|
+
children: X.map((e) => /* @__PURE__ */ h("li", {
|
|
331
376
|
className: "flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-elevation-1",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ m("p", {
|
|
333
378
|
className: "min-w-0 truncate font-medium text-text-primary",
|
|
334
|
-
children:
|
|
335
|
-
}), /* @__PURE__ */
|
|
379
|
+
children: E(e, O("eventfullymanaged.communication.announcements.itemPrefix", "Announcement"))
|
|
380
|
+
}), /* @__PURE__ */ h("div", {
|
|
336
381
|
className: "flex shrink-0 items-center gap-2",
|
|
337
|
-
children: [e.status ? /* @__PURE__ */
|
|
338
|
-
variant:
|
|
382
|
+
children: [e.status ? /* @__PURE__ */ m(v, {
|
|
383
|
+
variant: w(e.status),
|
|
339
384
|
className: "uppercase",
|
|
340
385
|
children: e.status
|
|
341
|
-
}) : null,
|
|
386
|
+
}) : null, T(e.status) ? /* @__PURE__ */ h(y, {
|
|
342
387
|
type: "button",
|
|
343
388
|
size: "sm",
|
|
344
|
-
disabled:
|
|
345
|
-
onClick: () => void
|
|
346
|
-
children: [/* @__PURE__ */
|
|
389
|
+
disabled: ve,
|
|
390
|
+
onClick: () => void Oe(e),
|
|
391
|
+
children: [/* @__PURE__ */ m(ie, { className: "h-3.5 w-3.5" }), O("eventfullymanaged.communication.actions.publish", "Publish")]
|
|
347
392
|
}) : null]
|
|
348
393
|
})]
|
|
349
394
|
}, e.id))
|
|
350
|
-
}), /* @__PURE__ */
|
|
351
|
-
offset:
|
|
352
|
-
limit:
|
|
353
|
-
loadedCount:
|
|
354
|
-
total:
|
|
355
|
-
onPrev:
|
|
356
|
-
onNext:
|
|
357
|
-
itemLabel:
|
|
358
|
-
loading:
|
|
395
|
+
}), /* @__PURE__ */ m(s, {
|
|
396
|
+
offset: k.offset,
|
|
397
|
+
limit: k.limit,
|
|
398
|
+
loadedCount: X.length,
|
|
399
|
+
total: Z,
|
|
400
|
+
onPrev: k.prevPage,
|
|
401
|
+
onNext: k.nextPage,
|
|
402
|
+
itemLabel: O("eventfullymanaged.communication.announcements.heading", "Announcements").toLowerCase(),
|
|
403
|
+
loading: j.loading
|
|
359
404
|
})]
|
|
360
405
|
})]
|
|
361
|
-
}), /* @__PURE__ */
|
|
406
|
+
}), /* @__PURE__ */ h(b, {
|
|
362
407
|
treatment: "plain",
|
|
363
408
|
className: "border-border-seam p-5",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ h("div", {
|
|
365
410
|
className: "flex items-center justify-between",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
367
412
|
className: "text-lg font-semibold text-text-primary",
|
|
368
|
-
children:
|
|
369
|
-
}),
|
|
413
|
+
children: O("eventfullymanaged.communication.campaigns.heading", "Campaigns")
|
|
414
|
+
}), $ > 0 ? /* @__PURE__ */ m("span", {
|
|
370
415
|
className: "text-sm text-text-muted",
|
|
371
|
-
children:
|
|
416
|
+
children: $
|
|
372
417
|
}) : null]
|
|
373
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ h("div", {
|
|
374
419
|
className: "mt-4",
|
|
375
|
-
children: [
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
420
|
+
children: [
|
|
421
|
+
G ? /* @__PURE__ */ h("div", {
|
|
422
|
+
className: "mb-4 space-y-3 rounded-card border border-border-seam bg-bg-surface p-4",
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ m("p", {
|
|
425
|
+
className: "font-medium text-text-primary",
|
|
426
|
+
children: E(G.row, "Campaign")
|
|
427
|
+
}),
|
|
428
|
+
/* @__PURE__ */ m(o, {
|
|
429
|
+
selected: G.tags,
|
|
430
|
+
onChange: (e) => K({
|
|
431
|
+
...G,
|
|
432
|
+
tags: e,
|
|
433
|
+
changed: !0
|
|
434
|
+
})
|
|
435
|
+
}, G.row.id),
|
|
436
|
+
/* @__PURE__ */ h("div", {
|
|
437
|
+
className: "flex flex-wrap gap-2",
|
|
438
|
+
children: [/* @__PURE__ */ m(y, {
|
|
439
|
+
type: "button",
|
|
440
|
+
disabled: P || !G.changed,
|
|
441
|
+
onClick: () => void De(),
|
|
442
|
+
children: O("eventfullymanaged.communication.actions.saveAudience", "Save audience")
|
|
443
|
+
}), /* @__PURE__ */ m(y, {
|
|
444
|
+
type: "button",
|
|
445
|
+
variant: "outline",
|
|
446
|
+
onClick: () => K(null),
|
|
447
|
+
children: O("eventfullymanaged.communication.actions.dismissAudience", "Close audience editor")
|
|
448
|
+
})]
|
|
449
|
+
})
|
|
450
|
+
]
|
|
451
|
+
}) : null,
|
|
452
|
+
M.loading && Q.length === 0 ? /* @__PURE__ */ m("p", {
|
|
453
|
+
className: "py-8 text-center text-sm text-text-secondary",
|
|
454
|
+
children: O("eventfullymanaged.communication.campaigns.loading", "Loading campaigns…")
|
|
455
|
+
}) : Q.length === 0 ? /* @__PURE__ */ m(x, {
|
|
456
|
+
illustration: "empty-data",
|
|
457
|
+
title: O("eventfullymanaged.communication.campaigns.empty", "No campaigns yet."),
|
|
458
|
+
className: "py-8"
|
|
459
|
+
}) : /* @__PURE__ */ m("ul", {
|
|
460
|
+
className: "space-y-2.5",
|
|
461
|
+
children: Q.map((e) => {
|
|
462
|
+
let t = pe(e);
|
|
463
|
+
return /* @__PURE__ */ h("li", {
|
|
464
|
+
className: "flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3 transition-[box-shadow,border-color] duration-200 hover:border-border-strong hover:shadow-elevation-1",
|
|
465
|
+
children: [/* @__PURE__ */ h("div", {
|
|
466
|
+
className: "min-w-0",
|
|
467
|
+
children: [/* @__PURE__ */ m("p", {
|
|
468
|
+
className: "truncate font-medium text-text-primary",
|
|
469
|
+
children: E(e, O("eventfullymanaged.communication.campaigns.itemPrefix", "Campaign"))
|
|
470
|
+
}), t ? /* @__PURE__ */ h("p", {
|
|
471
|
+
className: "truncate text-xs text-text-muted",
|
|
472
|
+
children: [
|
|
473
|
+
O("eventfullymanaged.communication.campaigns.scheduledFor", "Scheduled for"),
|
|
474
|
+
" ",
|
|
475
|
+
new Date(t).toLocaleString()
|
|
476
|
+
]
|
|
477
|
+
}) : null]
|
|
478
|
+
}), /* @__PURE__ */ h("div", {
|
|
479
|
+
className: "flex shrink-0 items-center gap-2",
|
|
395
480
|
children: [
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
481
|
+
e.status ? /* @__PURE__ */ m(v, {
|
|
482
|
+
variant: w(e.status),
|
|
483
|
+
className: "uppercase",
|
|
484
|
+
children: e.status
|
|
485
|
+
}) : null,
|
|
486
|
+
e.status?.toLowerCase() === "draft" ? /* @__PURE__ */ m(y, {
|
|
487
|
+
type: "button",
|
|
488
|
+
size: "sm",
|
|
489
|
+
variant: "outline",
|
|
490
|
+
disabled: P || F,
|
|
491
|
+
onClick: () => K({
|
|
492
|
+
row: e,
|
|
493
|
+
tags: me(e),
|
|
494
|
+
changed: !1
|
|
495
|
+
}),
|
|
496
|
+
children: O("eventfullymanaged.communication.actions.editAudience", "Edit audience")
|
|
497
|
+
}) : null,
|
|
498
|
+
T(e.status) ? /* @__PURE__ */ h(y, {
|
|
499
|
+
type: "button",
|
|
500
|
+
size: "sm",
|
|
501
|
+
disabled: F || G?.row.id === e.id,
|
|
502
|
+
onClick: () => void ke(e),
|
|
503
|
+
children: [/* @__PURE__ */ m(re, { className: "h-3.5 w-3.5" }), O("eventfullymanaged.communication.actions.send", "Send campaign")]
|
|
504
|
+
}) : null,
|
|
505
|
+
(e.status ?? "").toLowerCase() === "scheduled" ? /* @__PURE__ */ m(y, {
|
|
506
|
+
type: "button",
|
|
507
|
+
size: "sm",
|
|
508
|
+
variant: "outline",
|
|
509
|
+
onClick: () => void Ae(e),
|
|
510
|
+
children: O("eventfullymanaged.communication.actions.cancelSchedule", "Cancel schedule")
|
|
511
|
+
}) : null
|
|
399
512
|
]
|
|
400
|
-
})
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
onClick: () => void xe(e),
|
|
414
|
-
children: [/* @__PURE__ */ d(ae, { className: "h-3.5 w-3.5" }), T("eventfullymanaged.communication.actions.send", "Send campaign")]
|
|
415
|
-
}) : null,
|
|
416
|
-
(e.status ?? "").toLowerCase() === "scheduled" ? /* @__PURE__ */ d(_, {
|
|
417
|
-
type: "button",
|
|
418
|
-
size: "sm",
|
|
419
|
-
variant: "outline",
|
|
420
|
-
onClick: () => void Se(e),
|
|
421
|
-
children: T("eventfullymanaged.communication.actions.cancelSchedule", "Cancel schedule")
|
|
422
|
-
}) : null
|
|
423
|
-
]
|
|
424
|
-
})]
|
|
425
|
-
}, e.id);
|
|
513
|
+
})]
|
|
514
|
+
}, e.id);
|
|
515
|
+
})
|
|
516
|
+
}),
|
|
517
|
+
/* @__PURE__ */ m(s, {
|
|
518
|
+
offset: A.offset,
|
|
519
|
+
limit: A.limit,
|
|
520
|
+
loadedCount: Q.length,
|
|
521
|
+
total: $,
|
|
522
|
+
onPrev: A.prevPage,
|
|
523
|
+
onNext: A.nextPage,
|
|
524
|
+
itemLabel: O("eventfullymanaged.communication.campaigns.heading", "Campaigns").toLowerCase(),
|
|
525
|
+
loading: M.loading
|
|
426
526
|
})
|
|
427
|
-
|
|
428
|
-
offset: D.offset,
|
|
429
|
-
limit: D.limit,
|
|
430
|
-
loadedCount: X.length,
|
|
431
|
-
total: Z,
|
|
432
|
-
onPrev: D.prevPage,
|
|
433
|
-
onNext: D.nextPage,
|
|
434
|
-
itemLabel: T("eventfullymanaged.communication.campaigns.heading", "Campaigns").toLowerCase(),
|
|
435
|
-
loading: k.loading
|
|
436
|
-
})]
|
|
527
|
+
]
|
|
437
528
|
})]
|
|
438
529
|
})]
|
|
439
530
|
})
|
|
440
531
|
]
|
|
441
532
|
});
|
|
442
533
|
}
|
|
443
|
-
export {
|
|
534
|
+
export { D as default };
|
|
444
535
|
|
|
445
536
|
//# sourceMappingURL=CommunicationPage.js.map
|