@burdenoff/microfe-eventfullymanaged 2026.1123.5 → 2026.1124.1

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.
Files changed (90) hide show
  1. package/dist/eventfullymanaged/EventfullyManagedRoutes.js +58 -54
  2. package/dist/eventfullymanaged/EventfullyManagedRoutes.js.map +1 -1
  3. package/dist/eventfullymanaged/api/eventApi.js +1 -0
  4. package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
  5. package/dist/eventfullymanaged/components/ActionMenu.js +19 -19
  6. package/dist/eventfullymanaged/components/CampaignAudiencePicker.js +1 -1
  7. package/dist/eventfullymanaged/components/CampaignAudiencePicker.js.map +1 -1
  8. package/dist/eventfullymanaged/components/EntityFormShell.js +9 -9
  9. package/dist/eventfullymanaged/components/EntityTagsField.js +13 -13
  10. package/dist/eventfullymanaged/components/EntityTagsField.js.map +1 -1
  11. package/dist/eventfullymanaged/components/ImageUploadField.js +5 -5
  12. package/dist/eventfullymanaged/components/Pagination.js +7 -7
  13. package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js +51 -51
  14. package/dist/eventfullymanaged/components/floorPlanEditor/ZonePanels.js.map +1 -1
  15. package/dist/eventfullymanaged/pages/certificates/CertificateAccess.d.ts +7 -0
  16. package/dist/eventfullymanaged/pages/certificates/CertificateAccess.js +29 -0
  17. package/dist/eventfullymanaged/pages/certificates/CertificateAccess.js.map +1 -0
  18. package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.d.ts +7 -0
  19. package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.js +253 -0
  20. package/dist/eventfullymanaged/pages/certificates/CertificateIssuance.js.map +1 -0
  21. package/dist/eventfullymanaged/pages/certificates/CertificateTemplates.d.ts +8 -0
  22. package/dist/eventfullymanaged/pages/certificates/CertificateTemplates.js +260 -0
  23. package/dist/eventfullymanaged/pages/certificates/CertificateTemplates.js.map +1 -0
  24. package/dist/eventfullymanaged/pages/certificates/CertificatesPage.d.ts +1 -0
  25. package/dist/eventfullymanaged/pages/certificates/CertificatesPage.js +121 -0
  26. package/dist/eventfullymanaged/pages/certificates/CertificatesPage.js.map +1 -0
  27. package/dist/eventfullymanaged/pages/dashboard/DashboardPage.js +26 -26
  28. package/dist/eventfullymanaged/pages/events/EventDetailPage.js +150 -148
  29. package/dist/eventfullymanaged/pages/events/EventDetailPage.js.map +1 -1
  30. package/dist/eventfullymanaged/pages/events/VirtualSessionPage.js +100 -100
  31. package/dist/eventfullymanaged/pages/events/VirtualSessionPage.js.map +1 -1
  32. package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js +19 -19
  33. package/dist/eventfullymanaged/pages/exhibitors/ExhibitorsPage.js.map +1 -1
  34. package/dist/eventfullymanaged/pages/leads/LeadCaptureDialog.js +16 -16
  35. package/dist/eventfullymanaged/pages/leads/LeadCaptureDialog.js.map +1 -1
  36. package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js +103 -103
  37. package/dist/eventfullymanaged/pages/modules/AnalyticsPage.js.map +1 -1
  38. package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js +15 -15
  39. package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js +12 -12
  40. package/dist/eventfullymanaged/pages/modules/AttendeeRecommendations.js.map +1 -1
  41. package/dist/eventfullymanaged/pages/modules/CommunicationPage.js +155 -111
  42. package/dist/eventfullymanaged/pages/modules/CommunicationPage.js.map +1 -1
  43. package/dist/eventfullymanaged/pages/modules/EventTemplatesSection.js +14 -14
  44. package/dist/eventfullymanaged/pages/modules/EventTemplatesSection.js.map +1 -1
  45. package/dist/eventfullymanaged/pages/modules/EventsPage.js +121 -121
  46. package/dist/eventfullymanaged/pages/modules/EventsPage.js.map +1 -1
  47. package/dist/eventfullymanaged/pages/modules/IntegrationsPage.js +57 -57
  48. package/dist/eventfullymanaged/pages/modules/IntegrationsPage.js.map +1 -1
  49. package/dist/eventfullymanaged/pages/modules/KioskPage.js +241 -241
  50. package/dist/eventfullymanaged/pages/modules/KioskPage.js.map +1 -1
  51. package/dist/eventfullymanaged/pages/modules/NetworkingPage.js +120 -120
  52. package/dist/eventfullymanaged/pages/modules/NetworkingPage.js.map +1 -1
  53. package/dist/eventfullymanaged/pages/modules/OperationsHubPage.js +17 -17
  54. package/dist/eventfullymanaged/pages/modules/OperationsHubPage.js.map +1 -1
  55. package/dist/eventfullymanaged/pages/modules/RegistrationPage.js +61 -61
  56. package/dist/eventfullymanaged/pages/modules/RegistrationPage.js.map +1 -1
  57. package/dist/eventfullymanaged/pages/modules/RoadmapPanel.js +23 -23
  58. package/dist/eventfullymanaged/pages/modules/RoadmapPanel.js.map +1 -1
  59. package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js +17 -17
  60. package/dist/eventfullymanaged/pages/modules/SponsorDetailsPage.js.map +1 -1
  61. package/dist/eventfullymanaged/pages/modules/SponsorLeadsPage.js +11 -11
  62. package/dist/eventfullymanaged/pages/modules/VenueResourcesPage.js +13 -13
  63. package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js +108 -108
  64. package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js.map +1 -1
  65. package/dist/eventfullymanaged/pages/registration/PromoCodeFormPage.js +22 -22
  66. package/dist/eventfullymanaged/pages/registration/PromoCodeFormPage.js.map +1 -1
  67. package/dist/eventfullymanaged/pages/registration/RegisterAttendeePage.js +45 -45
  68. package/dist/eventfullymanaged/pages/speakers/SpeakersPage.js +24 -24
  69. package/dist/eventfullymanaged/pages/speakers/SpeakersPage.js.map +1 -1
  70. package/dist/eventfullymanaged/pages/sponsors/SponsorFormPage.js +37 -37
  71. package/dist/eventfullymanaged/pages/sponsors/SponsorsListPage.js +23 -23
  72. package/dist/eventfullymanaged/pages/sponsors/SponsorsListPage.js.map +1 -1
  73. package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js +123 -123
  74. package/dist/eventfullymanaged/pages/venues/FloorPlansPage.js.map +1 -1
  75. package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js +37 -37
  76. package/dist/eventfullymanaged/pages/venues/VenueDetailPage.js.map +1 -1
  77. package/dist/eventfullymanaged/pages/venues/VenueFormPage.js +25 -25
  78. package/dist/eventfullymanaged/pages/venues/VenueListPage.js +26 -26
  79. package/dist/eventfullymanaged/pages/venues/VenueListPage.js.map +1 -1
  80. package/dist/generated/wspace-operations.d.ts +383 -0
  81. package/dist/generated/wspace-operations.js +177 -11
  82. package/dist/generated/wspace-operations.js.map +1 -1
  83. package/dist/generated/wspace-types.d.ts +29809 -1503
  84. package/dist/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js +19 -0
  85. package/dist/node_modules/@apollo/client/react/hooks/internal/useRenderGuard.js.map +1 -0
  86. package/dist/node_modules/@apollo/client/react/hooks/useLazyQuery.js +110 -0
  87. package/dist/node_modules/@apollo/client/react/hooks/useLazyQuery.js.map +1 -0
  88. package/dist/utils/pageContext.js +5 -0
  89. package/dist/utils/pageContext.js.map +1 -1
  90. package/package.json +1 -1
@@ -3,14 +3,14 @@ import { useQuery as t } from "../../../node_modules/@apollo/client/react/hooks/
3
3
  import { CHART_SERIES_COLORS as n, ChartLegend as r, EventAreaChart as ee, EventBarChart as i, EventDonutChart as te } from "../../components/EventCharts.js";
4
4
  import { Pagination as ne, usePagination as re } from "../../components/Pagination.js";
5
5
  import { AttendanceForecast as ie } from "../../components/AttendanceForecast.js";
6
- import { EventDraftAssistant as a } from "../../components/EventDraftAssistant.js";
7
- import { useCheckInThroughputQuery as o, useDashboardSummaryQuery as s, useEventsQuery as c, useUpsertAnalyticsSnapshotMutation as l } from "../../api/eventApi.js";
8
- import { describeError as u, mutationSucceeded as d } from "../../lib/mutationResult.js";
9
- import { notify as f } from "../../lib/toast.js";
10
- import { useMemo as p, useState as m } from "react";
11
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
12
- import { BarChart3 as ae, CalendarDays as oe, ClipboardList as se, MapPin as ce, QrCode as le, Sparkles as ue, Ticket as de, Trophy as fe, Users as _ } from "lucide-react";
13
- import { Badge as v, Button as y, EmphasisPanel as b, GlassCard as x, GradientText as S, IllustratedEmptyState as C, Input as w, PagePurpose as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Skeleton as j } from "@burdenoff/fe-libs/ui";
6
+ import { EventDraftAssistant as ae } from "../../components/EventDraftAssistant.js";
7
+ import { useCheckInThroughputQuery as a, useDashboardSummaryQuery as o, useEventsQuery as s, useUpsertAnalyticsSnapshotMutation as c } from "../../api/eventApi.js";
8
+ import { describeError as l, mutationSucceeded as u } from "../../lib/mutationResult.js";
9
+ import { notify as d } from "../../lib/toast.js";
10
+ import { useMemo as f, useState as p } from "react";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ import { Badge as oe, Button as se, EmphasisPanel as ce, GlassCard as g, GradientText as le, IllustratedEmptyState as ue, Input as de, PagePurpose as fe, Select as _, SelectContent as v, SelectItem as y, SelectTrigger as b, SelectValue as x, Skeleton as S } from "@burdenoff/fe-libs/ui";
13
+ import { BarChart3 as C, CalendarDays as w, ClipboardList as T, MapPin as E, QrCode as D, Sparkles as O, Ticket as k, Trophy as A, Users as j } from "lucide-react";
14
14
  // src/eventfullymanaged/pages/modules/AnalyticsPage.tsx
15
15
  var M = e`
16
16
  query EventfullymanagedAnalyticsSnapshotsWithMetrics($limit: Int, $offset: Int) {
@@ -91,16 +91,16 @@ function L(e) {
91
91
  return e.replace(/[_-]+/g, " ").split(" ").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ");
92
92
  }
93
93
  function R({ icon: e, label: t, value: n }) {
94
- return /* @__PURE__ */ g(x, {
94
+ return /* @__PURE__ */ h(g, {
95
95
  treatment: "metric",
96
96
  className: "p-4",
97
- children: [/* @__PURE__ */ g("div", {
97
+ children: [/* @__PURE__ */ h("div", {
98
98
  className: "flex items-center gap-2 text-text-secondary",
99
- children: [/* @__PURE__ */ h(e, { className: "h-4 w-4 text-accent-primary" }), /* @__PURE__ */ h("p", {
99
+ children: [/* @__PURE__ */ m(e, { className: "h-4 w-4 text-accent-primary" }), /* @__PURE__ */ m("p", {
100
100
  className: "text-xs font-medium uppercase tracking-wide",
101
101
  children: t
102
102
  })]
103
- }), /* @__PURE__ */ h("p", {
103
+ }), /* @__PURE__ */ m("p", {
104
104
  className: "mt-2 text-2xl font-bold tabular-nums text-text-primary",
105
105
  children: n.toLocaleString()
106
106
  })]
@@ -110,16 +110,16 @@ function z() {
110
110
  let e = re({ pageSize: 8 }), { data: z, loading: B, refetch: pe } = t(M, { variables: {
111
111
  limit: e.limit,
112
112
  offset: e.offset
113
- } }), V = s(), [me, { loading: H }] = l(), [U, he] = m("overview"), W = c({
113
+ } }), V = o(), [me, { loading: H }] = c(), [U, he] = p("overview"), W = s({
114
114
  limit: 50,
115
115
  offset: 0
116
- }), G = p(() => W.data?.events.items ?? [], [W.data]), [ge, _e] = m(""), K = ge || G[0]?.id || "", q = o({ eventId: K }), J = q.data?.checkInThroughput[0]?.timezone ?? null, ve = p(() => (q.data?.checkInThroughput ?? []).map((e) => ({
116
+ }), G = f(() => W.data?.events.items ?? [], [W.data]), [ge, _e] = p(""), K = ge || G[0]?.id || "", q = a({ eventId: K }), J = q.data?.checkInThroughput[0]?.timezone ?? null, ve = f(() => (q.data?.checkInThroughput ?? []).map((e) => ({
117
117
  name: new Date(e.hour).toLocaleTimeString(void 0, {
118
118
  hour: "numeric",
119
119
  timeZone: e.timezone
120
120
  }),
121
121
  value: e.count
122
- })), [q.data]), Y = p(() => z?.analyticsSnapshots.items ?? [], [z]), X = z?.analyticsSnapshots.total ?? 0, Z = V.data?.dashboardSummary, Q = Z?.checkedInRegistrations ?? 0, ye = p(() => Y.map((e) => {
122
+ })), [q.data]), Y = f(() => z?.analyticsSnapshots.items ?? [], [z]), X = z?.analyticsSnapshots.total ?? 0, Z = V.data?.dashboardSummary, Q = Z?.checkedInRegistrations ?? 0, ye = f(() => Y.map((e) => {
123
123
  let t = e.metrics?.generatedAt ?? e.createdAt ?? null, n = t ? new Date(t) : null, r = typeof e.metrics?.totalRegistrations == "number" ? e.metrics.totalRegistrations : null;
124
124
  return n && !Number.isNaN(n.getTime()) && r !== null ? {
125
125
  time: n.getTime(),
@@ -129,11 +129,11 @@ function z() {
129
129
  }).filter((e) => e !== null).sort((e, t) => e.time - t.time).map(({ label: e, value: t }) => ({
130
130
  label: e,
131
131
  value: t
132
- })), [Y]), $ = p(() => (Z?.registrationsByStatus ?? []).slice().sort((e, t) => t.count - e.count).map((e, t) => ({
132
+ })), [Y]), $ = f(() => (Z?.registrationsByStatus ?? []).slice().sort((e, t) => t.count - e.count).map((e, t) => ({
133
133
  name: L(e.status || "unknown"),
134
134
  value: e.count,
135
135
  color: n[t % n.length]
136
- })), [Z]), be = Z?.totalRegistrations ?? 0, xe = p(() => Z ? [
136
+ })), [Z]), be = Z?.totalRegistrations ?? 0, xe = f(() => Z ? [
137
137
  {
138
138
  name: "Events",
139
139
  value: Z.totalEvents
@@ -165,7 +165,7 @@ function z() {
165
165
  ] : [], [Z, Q]), Se = async () => {
166
166
  let e = U.trim();
167
167
  if (e) {
168
- if (Y.some((t) => (t.name ?? "").toLowerCase() === e.toLowerCase())) f.error("Snapshot name already used", "Pick a different name, or delete the existing snapshot first.");
168
+ if (Y.some((t) => (t.name ?? "").toLowerCase() === e.toLowerCase())) d.error("Snapshot name already used", "Pick a different name, or delete the existing snapshot first.");
169
169
  else try {
170
170
  let t = await me({ variables: { input: {
171
171
  name: e,
@@ -173,42 +173,42 @@ function z() {
173
173
  status: "created",
174
174
  metadata: {}
175
175
  } } });
176
- if (!d(t, t.data?.upsertAnalyticsSnapshot?.id, "Could not generate snapshot")) return;
177
- f.success("Snapshot generated"), await pe();
176
+ if (!u(t, t.data?.upsertAnalyticsSnapshot?.id, "Could not generate snapshot")) return;
177
+ d.success("Snapshot generated"), await pe();
178
178
  } catch (e) {
179
- f.error("Could not generate snapshot", u(e));
179
+ d.error("Could not generate snapshot", l(e));
180
180
  }
181
181
  }
182
182
  }, Ce = V.loading && !Z;
183
- return /* @__PURE__ */ g("div", {
183
+ return /* @__PURE__ */ h("div", {
184
184
  className: "space-y-6 p-6",
185
185
  children: [
186
- /* @__PURE__ */ h(T, { children: "Analytics shows current totals across every entity you manage, how registrations break down by status, and a trend line built from your saved snapshots. Generate a snapshot to record today's numbers for the workspace; each one is kept on its own and does not get replaced by later snapshots." }),
187
- /* @__PURE__ */ h(b, { children: /* @__PURE__ */ g("div", {
186
+ /* @__PURE__ */ m(fe, { children: "Analytics shows current totals across every entity you manage, how registrations break down by status, and a trend line built from your saved snapshots. Generate a snapshot to record today's numbers for the workspace; each one is kept on its own and does not get replaced by later snapshots." }),
187
+ /* @__PURE__ */ m(ce, { children: /* @__PURE__ */ h("div", {
188
188
  className: "flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between",
189
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
189
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
190
190
  className: "text-2xl font-bold text-text-primary",
191
- children: /* @__PURE__ */ h(S, { children: "Analytics" })
192
- }), /* @__PURE__ */ h("p", {
191
+ children: /* @__PURE__ */ m(le, { children: "Analytics" })
192
+ }), /* @__PURE__ */ m("p", {
193
193
  className: "mt-1 text-sm text-text-secondary",
194
194
  children: "Current metrics from live event operations, loaded when the page opens, plus point-in-time snapshots you control."
195
- })] }), /* @__PURE__ */ g("div", {
195
+ })] }), /* @__PURE__ */ h("div", {
196
196
  className: "flex w-full flex-col gap-2 sm:w-auto sm:flex-row",
197
- children: [/* @__PURE__ */ h(w, {
197
+ children: [/* @__PURE__ */ m(de, {
198
198
  value: U,
199
199
  onChange: (e) => he(e.target.value),
200
200
  placeholder: "daily-summary",
201
201
  "aria-label": "Snapshot name",
202
202
  className: "sm:w-48"
203
- }), /* @__PURE__ */ g(y, {
203
+ }), /* @__PURE__ */ h(se, {
204
204
  type: "button",
205
205
  disabled: H,
206
206
  onClick: Se,
207
- children: [/* @__PURE__ */ h(ue, { className: "h-4 w-4" }), H ? "Generating..." : "Generate snapshot"]
207
+ children: [/* @__PURE__ */ m(O, { className: "h-4 w-4" }), H ? "Generating..." : "Generate snapshot"]
208
208
  })]
209
209
  })]
210
210
  }) }),
211
- /* @__PURE__ */ h(ie, {
211
+ /* @__PURE__ */ m(ie, {
212
212
  events: G,
213
213
  total: W.data?.events.total ?? 0,
214
214
  loading: W.loading,
@@ -225,95 +225,95 @@ function z() {
225
225
  } })
226
226
  })
227
227
  }),
228
- /* @__PURE__ */ h(a, { events: G }),
229
- /* @__PURE__ */ g("div", {
228
+ /* @__PURE__ */ m(ae, { events: G }),
229
+ /* @__PURE__ */ h("div", {
230
230
  className: "grid grid-cols-1 gap-6 xl:grid-cols-[minmax(0,1fr)_320px]",
231
- children: [/* @__PURE__ */ g("div", {
231
+ children: [/* @__PURE__ */ h("div", {
232
232
  className: "space-y-6",
233
233
  children: [
234
- Ce ? /* @__PURE__ */ h("div", {
234
+ Ce ? /* @__PURE__ */ m("div", {
235
235
  className: "grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",
236
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ h(j, { className: "h-[92px] rounded-card" }, t))
237
- }) : Z ? /* @__PURE__ */ g("div", {
236
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ m(S, { className: "h-[92px] rounded-card" }, t))
237
+ }) : Z ? /* @__PURE__ */ h("div", {
238
238
  className: "grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",
239
239
  children: [
240
- /* @__PURE__ */ h(R, {
241
- icon: oe,
240
+ /* @__PURE__ */ m(R, {
241
+ icon: w,
242
242
  label: "Events",
243
243
  value: Z.totalEvents
244
244
  }),
245
- /* @__PURE__ */ h(R, {
246
- icon: se,
245
+ /* @__PURE__ */ m(R, {
246
+ icon: T,
247
247
  label: "Registrations",
248
248
  value: Z.totalRegistrations
249
249
  }),
250
- /* @__PURE__ */ h(R, {
251
- icon: _,
250
+ /* @__PURE__ */ m(R, {
251
+ icon: j,
252
252
  label: "Attendees",
253
253
  value: Z.totalAttendees
254
254
  }),
255
- /* @__PURE__ */ h(R, {
256
- icon: le,
255
+ /* @__PURE__ */ m(R, {
256
+ icon: D,
257
257
  label: "Check-ins",
258
258
  value: Q
259
259
  }),
260
- /* @__PURE__ */ h(R, {
261
- icon: ce,
260
+ /* @__PURE__ */ m(R, {
261
+ icon: E,
262
262
  label: "Venues",
263
263
  value: Z.totalVenues
264
264
  }),
265
- /* @__PURE__ */ h(R, {
266
- icon: fe,
265
+ /* @__PURE__ */ m(R, {
266
+ icon: A,
267
267
  label: "Sponsors",
268
268
  value: Z.totalSponsors
269
269
  }),
270
- /* @__PURE__ */ h(R, {
271
- icon: de,
270
+ /* @__PURE__ */ m(R, {
271
+ icon: k,
272
272
  label: "Upcoming Sessions",
273
273
  value: Z.upcomingSessions
274
274
  })
275
275
  ]
276
276
  }) : null,
277
- /* @__PURE__ */ g("div", {
277
+ /* @__PURE__ */ h("div", {
278
278
  className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
279
- children: [/* @__PURE__ */ g(x, {
279
+ children: [/* @__PURE__ */ h(g, {
280
280
  treatment: "insight",
281
281
  className: "p-5",
282
- children: [/* @__PURE__ */ g("div", {
282
+ children: [/* @__PURE__ */ h("div", {
283
283
  className: "flex items-center justify-between",
284
- children: [/* @__PURE__ */ h("h2", {
284
+ children: [/* @__PURE__ */ m("h2", {
285
285
  className: "text-base font-semibold text-text-primary",
286
286
  children: "Registrations over time"
287
- }), /* @__PURE__ */ h("span", {
287
+ }), /* @__PURE__ */ m("span", {
288
288
  className: "text-xs text-text-muted",
289
289
  children: "By snapshot"
290
290
  })]
291
- }), /* @__PURE__ */ h("div", {
291
+ }), /* @__PURE__ */ m("div", {
292
292
  className: "mt-4",
293
- children: /* @__PURE__ */ h(ee, {
293
+ children: /* @__PURE__ */ m(ee, {
294
294
  data: ye,
295
295
  emptyLabel: "Generate a few snapshots to chart the trend"
296
296
  })
297
297
  })]
298
- }), /* @__PURE__ */ g(x, {
298
+ }), /* @__PURE__ */ h(g, {
299
299
  treatment: "insight",
300
300
  className: "p-5",
301
- children: [/* @__PURE__ */ h("h2", {
301
+ children: [/* @__PURE__ */ m("h2", {
302
302
  className: "text-base font-semibold text-text-primary",
303
303
  children: "Registrations by status"
304
- }), /* @__PURE__ */ g("div", {
304
+ }), /* @__PURE__ */ h("div", {
305
305
  className: "mt-4 flex flex-col items-center gap-4 sm:flex-row",
306
- children: [/* @__PURE__ */ h("div", {
306
+ children: [/* @__PURE__ */ m("div", {
307
307
  className: "w-full sm:w-1/2",
308
- children: /* @__PURE__ */ h(te, {
308
+ children: /* @__PURE__ */ m(te, {
309
309
  data: $,
310
310
  centerValue: be.toLocaleString(),
311
311
  centerLabel: "Registrations",
312
312
  emptyLabel: "No registrations yet"
313
313
  })
314
- }), /* @__PURE__ */ h("div", {
314
+ }), /* @__PURE__ */ m("div", {
315
315
  className: "w-full sm:w-1/2",
316
- children: /* @__PURE__ */ h(r, { items: $.map((e) => ({
316
+ children: /* @__PURE__ */ m(r, { items: $.map((e) => ({
317
317
  label: e.name,
318
318
  color: e.color ?? "var(--color-chart-1)",
319
319
  value: e.value.toLocaleString()
@@ -322,70 +322,70 @@ function z() {
322
322
  })]
323
323
  })]
324
324
  }),
325
- /* @__PURE__ */ g(x, {
325
+ /* @__PURE__ */ h(g, {
326
326
  treatment: "insight",
327
327
  className: "p-5",
328
328
  children: [
329
- /* @__PURE__ */ h("h2", {
329
+ /* @__PURE__ */ m("h2", {
330
330
  className: "text-base font-semibold text-text-primary",
331
331
  children: "Portfolio totals"
332
332
  }),
333
- /* @__PURE__ */ h("p", {
333
+ /* @__PURE__ */ m("p", {
334
334
  className: "mt-0.5 text-xs text-text-muted",
335
335
  children: "Live counts across every entity you manage."
336
336
  }),
337
- /* @__PURE__ */ h("div", {
337
+ /* @__PURE__ */ m("div", {
338
338
  className: "mt-4",
339
- children: /* @__PURE__ */ h(i, {
339
+ children: /* @__PURE__ */ m(i, {
340
340
  data: xe,
341
341
  emptyLabel: "No operational data yet"
342
342
  })
343
343
  })
344
344
  ]
345
345
  }),
346
- /* @__PURE__ */ g(x, {
346
+ /* @__PURE__ */ h(g, {
347
347
  treatment: "insight",
348
348
  className: "p-5",
349
- children: [/* @__PURE__ */ g("div", {
349
+ children: [/* @__PURE__ */ h("div", {
350
350
  className: "flex flex-wrap items-center justify-between gap-3",
351
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h2", {
351
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
352
352
  className: "text-base font-semibold text-text-primary",
353
353
  children: "Check-in throughput"
354
- }), /* @__PURE__ */ g("p", {
354
+ }), /* @__PURE__ */ h("p", {
355
355
  className: "mt-0.5 text-xs text-text-muted",
356
356
  children: [
357
357
  "Scans per hour at the door for the selected event",
358
358
  J ? ` (${J})` : "",
359
359
  "."
360
360
  ]
361
- })] }), G.length > 0 ? /* @__PURE__ */ g(E, {
361
+ })] }), G.length > 0 ? /* @__PURE__ */ h(_, {
362
362
  value: K,
363
363
  onValueChange: _e,
364
- children: [/* @__PURE__ */ h(k, {
364
+ children: [/* @__PURE__ */ m(b, {
365
365
  className: "w-full sm:w-56",
366
366
  "aria-label": "Select event for check-in throughput",
367
- children: /* @__PURE__ */ h(A, { placeholder: "Select event" })
368
- }), /* @__PURE__ */ h(D, { children: G.map((e) => /* @__PURE__ */ h(O, {
367
+ children: /* @__PURE__ */ m(x, { placeholder: "Select event" })
368
+ }), /* @__PURE__ */ m(v, { children: G.map((e) => /* @__PURE__ */ m(y, {
369
369
  value: e.id,
370
370
  children: e.name
371
371
  }, e.id)) })]
372
372
  }) : null]
373
- }), /* @__PURE__ */ h("div", {
373
+ }), /* @__PURE__ */ m("div", {
374
374
  className: "mt-4",
375
- children: /* @__PURE__ */ h(i, {
375
+ children: /* @__PURE__ */ m(i, {
376
376
  data: ve,
377
377
  emptyLabel: K ? "No check-ins recorded yet for this event" : "Select an event to see throughput"
378
378
  })
379
379
  })]
380
380
  })
381
381
  ]
382
- }), /* @__PURE__ */ g("aside", {
382
+ }), /* @__PURE__ */ h("aside", {
383
383
  className: "space-y-4",
384
- children: [/* @__PURE__ */ g("div", {
384
+ children: [/* @__PURE__ */ h("div", {
385
385
  className: "flex items-center justify-between",
386
- children: [/* @__PURE__ */ g("h2", {
386
+ children: [/* @__PURE__ */ h("h2", {
387
387
  className: "text-base font-semibold text-text-primary",
388
- children: ["Saved snapshots ", X > 0 ? /* @__PURE__ */ g("span", {
388
+ children: ["Saved snapshots ", X > 0 ? /* @__PURE__ */ h("span", {
389
389
  className: "text-text-muted",
390
390
  children: [
391
391
  "(",
@@ -393,20 +393,20 @@ function z() {
393
393
  ")"
394
394
  ]
395
395
  }) : null]
396
- }), /* @__PURE__ */ h(ae, { className: "h-4 w-4 text-text-muted" })]
397
- }), B && Y.length === 0 ? /* @__PURE__ */ h("div", {
396
+ }), /* @__PURE__ */ m(C, { className: "h-4 w-4 text-text-muted" })]
397
+ }), B && Y.length === 0 ? /* @__PURE__ */ m("div", {
398
398
  className: "space-y-3",
399
- children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ h(j, { className: "h-24 rounded-card" }, t))
400
- }) : Y.length === 0 ? /* @__PURE__ */ h(x, {
399
+ children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ m(S, { className: "h-24 rounded-card" }, t))
400
+ }) : Y.length === 0 ? /* @__PURE__ */ m(g, {
401
401
  treatment: "plain",
402
402
  className: "border-border-seam",
403
- children: /* @__PURE__ */ h(C, {
403
+ children: /* @__PURE__ */ m(ue, {
404
404
  illustration: "empty-data",
405
405
  title: "No snapshots yet",
406
406
  description: "Generate your first snapshot to freeze the current metrics.",
407
407
  className: "py-8"
408
408
  })
409
- }) : /* @__PURE__ */ g("div", {
409
+ }) : /* @__PURE__ */ h("div", {
410
410
  className: "space-y-3",
411
411
  children: [Y.map((e) => {
412
412
  let t = F(e.metrics?.generatedAt) ?? F(e.createdAt), n = N.map((t) => {
@@ -416,43 +416,43 @@ function z() {
416
416
  value: typeof n == "number" ? n : null
417
417
  };
418
418
  }).filter((e) => e.value !== null);
419
- return /* @__PURE__ */ g(x, {
419
+ return /* @__PURE__ */ h(g, {
420
420
  treatment: "plain",
421
421
  className: "border-border-seam p-4",
422
- children: [/* @__PURE__ */ g("div", {
422
+ children: [/* @__PURE__ */ h("div", {
423
423
  className: "flex items-start justify-between gap-2",
424
- children: [/* @__PURE__ */ g("div", {
424
+ children: [/* @__PURE__ */ h("div", {
425
425
  className: "min-w-0",
426
- children: [/* @__PURE__ */ h("h3", {
426
+ children: [/* @__PURE__ */ m("h3", {
427
427
  className: "truncate text-sm font-semibold text-text-primary",
428
428
  children: e.title ?? e.name ?? `Snapshot ${e.id}`
429
- }), t ? /* @__PURE__ */ h("p", {
429
+ }), t ? /* @__PURE__ */ m("p", {
430
430
  className: "mt-0.5 text-xs text-text-muted",
431
431
  children: t
432
432
  }) : null]
433
- }), e.status ? /* @__PURE__ */ h(v, {
433
+ }), e.status ? /* @__PURE__ */ m(oe, {
434
434
  variant: P(e.status),
435
435
  className: "shrink-0 uppercase",
436
436
  children: e.status
437
437
  }) : null]
438
- }), n.length > 0 ? /* @__PURE__ */ h("dl", {
438
+ }), n.length > 0 ? /* @__PURE__ */ m("dl", {
439
439
  className: "mt-3 space-y-1.5",
440
- children: n.map((e) => /* @__PURE__ */ g("div", {
440
+ children: n.map((e) => /* @__PURE__ */ h("div", {
441
441
  className: "flex items-center justify-between text-xs",
442
- children: [/* @__PURE__ */ h("dt", {
442
+ children: [/* @__PURE__ */ m("dt", {
443
443
  className: "text-text-secondary",
444
444
  children: e.label
445
- }), /* @__PURE__ */ h("dd", {
445
+ }), /* @__PURE__ */ m("dd", {
446
446
  className: "font-semibold tabular-nums text-text-primary",
447
447
  children: (e.value ?? 0).toLocaleString()
448
448
  })]
449
449
  }, e.label))
450
- }) : /* @__PURE__ */ h("p", {
450
+ }) : /* @__PURE__ */ m("p", {
451
451
  className: "mt-3 text-xs text-text-muted",
452
452
  children: "No metrics captured."
453
453
  })]
454
454
  }, e.id);
455
- }), /* @__PURE__ */ h(ne, {
455
+ }), /* @__PURE__ */ m(ne, {
456
456
  offset: e.offset,
457
457
  limit: e.limit,
458
458
  loadedCount: Y.length,
@@ -1 +1 @@
1
- {"version":3,"file":"AnalyticsPage.js","names":["Badge","Badge$1","ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY","METRIC_FIELDS","statusVariant","value","status","formatGeneratedAt","parsed","shortDate","humanizeStatus","word","MetricTile","Icon","GlassCard","label","AnalyticsPage","pagination","usePagination","useQuery","summaryQuery","useDashboardSummaryQuery","upsertSnapshot","creating","useUpsertAnalyticsSnapshotMutation","snapshotName","setSnapshotName","useState","eventsQuery","useEventsQuery","events","useMemo","throughputEventIdOverride","setThroughputEventIdOverride","throughputEventId","throughputQuery","useCheckInThroughputQuery","throughputTimezone","throughputSeries","point","snapshots","data","total","summary","checkInCount","registrationsSeries","at","snapshot","a","b","statusBreakdown","entry","CHART_SERIES_COLORS","index","registrationTotal","entityCounts","onCreate","trimmed","response","mutationSucceeded","notify","refetch","error","describeError","summaryLoading","PagePurpose","EmphasisPanel","GradientText","Input","Button","Sparkles","AttendanceForecast","fetchMoreResult","previous","event","EventDraftAssistant","Skeleton","CalendarDays","ClipboardList","Users","QrCode","MapPin","Trophy","Ticket","EventAreaChart","EventDonutChart","ChartLegend","slice","EventBarChart","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","BarChart3","loading","IllustratedEmptyState","generatedAt","captured","raw","field","Pagination"],"sources":["../../../../src/eventfullymanaged/pages/modules/AnalyticsPage.tsx"],"sourcesContent":["import { BarChart3, CalendarDays, ClipboardList, MapPin, QrCode, Sparkles, Ticket, Trophy, Users } from 'lucide-react';\nimport type { LucideIcon } from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n CHART_SERIES_COLORS,\n ChartLegend,\n EventAreaChart,\n EventBarChart,\n EventDonutChart,\n type AreaPoint,\n type BarDatum,\n type DonutSlice,\n} from '../../components/EventCharts';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { AttendanceForecast } from '../../components/AttendanceForecast';\nimport { EventDraftAssistant } from '../../components/EventDraftAssistant';\nimport {\n useCheckInThroughputQuery,\n useDashboardSummaryQuery,\n useEventsQuery,\n useUpsertAnalyticsSnapshotMutation,\n} from '../../api/eventApi';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\n/**\n * Snapshot metrics are computed server-side at generation time and returned on\n * the `metrics` JSON field of an analytics snapshot. The shared\n * `useAnalyticsSnapshotsQuery` hook does not select `metrics`, so this page owns\n * a dedicated query (distinct operation name) that pulls the metric payload in\n * addition to the identity fields.\n */\nconst ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY = gql`\n query EventfullymanagedAnalyticsSnapshotsWithMetrics($limit: Int, $offset: Int) {\n analyticsSnapshots: eventfullyManagedAnalyticsSnapshots(limit: $limit, offset: $offset) {\n total\n items {\n id\n name\n title\n status\n metrics\n createdAt\n }\n }\n }\n`;\n\ntype SnapshotMetrics = {\n totalEvents?: number | null;\n activeEvents?: number | null;\n totalRegistrations?: number | null;\n totalAttendees?: number | null;\n totalVenues?: number | null;\n totalSponsors?: number | null;\n upcomingSessions?: number | null;\n generatedAt?: string | null;\n};\n\ntype SnapshotRow = {\n id: string;\n name?: string | null;\n title?: string | null;\n status?: string | null;\n createdAt?: string | null;\n metrics?: SnapshotMetrics | null;\n};\n\ntype SnapshotsResponse = {\n analyticsSnapshots: { total: number; items: SnapshotRow[] };\n};\n\nconst METRIC_FIELDS: { key: keyof SnapshotMetrics; label: string }[] = [\n { key: 'totalEvents', label: 'Events' },\n { key: 'activeEvents', label: 'Active' },\n { key: 'totalRegistrations', label: 'Registrations' },\n { key: 'totalAttendees', label: 'Attendees' },\n { key: 'totalVenues', label: 'Venues' },\n { key: 'totalSponsors', label: 'Sponsors' },\n { key: 'upcomingSessions', label: 'Upcoming Sessions' },\n];\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['active', 'published', 'completed'].includes(value)) return 'success';\n if (['inactive', 'cancelled', 'archived', 'expired'].includes(value)) return 'warning';\n if (['draft', 'created', 'pending', 'scheduled'].includes(value)) return 'info';\n return 'secondary';\n}\n\nfunction formatGeneratedAt(value?: string | null): string | null {\n if (!value) return null;\n const parsed = new Date(value);\n return Number.isNaN(parsed.getTime()) ? null : parsed.toLocaleString();\n}\n\nfunction shortDate(value?: string | null): string {\n if (!value) return '—';\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime())) return '—';\n return parsed.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });\n}\n\n/** Humanise a registration status token (e.g. `checked_in` → `Checked In`). */\nfunction humanizeStatus(status: string): string {\n return status\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}\n\nfunction MetricTile({ icon: Icon, label, value }: { icon: LucideIcon; label: string; value: number }) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-4\">\n <div className=\"flex items-center gap-2 text-text-secondary\">\n <Icon className=\"h-4 w-4 text-accent-primary\" />\n <p className=\"text-xs font-medium uppercase tracking-wide\">{label}</p>\n </div>\n <p className=\"mt-2 text-2xl font-bold tabular-nums text-text-primary\">{value.toLocaleString()}</p>\n </GlassCard>\n );\n}\n\nexport default function AnalyticsPage() {\n const pagination = usePagination({ pageSize: 8 });\n const { data, loading, refetch } = useQuery<SnapshotsResponse, { limit: number; offset: number }>(\n ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY,\n { variables: { limit: pagination.limit, offset: pagination.offset } }\n );\n const summaryQuery = useDashboardSummaryQuery();\n const [upsertSnapshot, { loading: creating }] = useUpsertAnalyticsSnapshotMutation();\n const [snapshotName, setSnapshotName] = useState('overview');\n\n // BOFF-3999 — check-in throughput is scoped to one event; default to the\n // first event once the list loads.\n const eventsQuery = useEventsQuery({ limit: 50, offset: 0 });\n const events = useMemo(() => eventsQuery.data?.events.items ?? [], [eventsQuery.data]);\n // Derived (not effect-synced): an explicit user pick wins, otherwise fall\n // back to the first loaded event — avoids a setState-in-effect render.\n const [throughputEventIdOverride, setThroughputEventIdOverride] = useState('');\n const throughputEventId = throughputEventIdOverride || events[0]?.id || '';\n const throughputQuery = useCheckInThroughputQuery({ eventId: throughputEventId });\n // BOFF-11389 — the server buckets `hour` in the event's own IANA timezone\n // (returned per-point as `timezone`); label each bar in that same zone\n // instead of the viewer's browser zone, or bucket and label disagree.\n const throughputTimezone = throughputQuery.data?.checkInThroughput[0]?.timezone ?? null;\n const throughputSeries = useMemo<BarDatum[]>(() => {\n return (throughputQuery.data?.checkInThroughput ?? []).map((point) => ({\n name: new Date(point.hour).toLocaleTimeString(undefined, { hour: 'numeric', timeZone: point.timezone }),\n value: point.count,\n }));\n }, [throughputQuery.data]);\n\n const snapshots = useMemo(() => data?.analyticsSnapshots.items ?? [], [data]);\n const total = data?.analyticsSnapshots.total ?? 0;\n\n const summary = summaryQuery.data?.dashboardSummary;\n\n // BOFF-11386 — checked-in count comes from the server aggregate (same live-\n // registration population as totalRegistrations), not a 200-row sample.\n const checkInCount = summary?.checkedInRegistrations ?? 0;\n\n // Registrations over time: the totalRegistrations captured on each snapshot,\n // ordered oldest → newest. Purely real, snapshot-derived — never synthesised.\n const registrationsSeries = useMemo<AreaPoint[]>(() => {\n return snapshots\n .map((snapshot) => {\n const at = snapshot.metrics?.generatedAt ?? snapshot.createdAt ?? null;\n const parsed = at ? new Date(at) : null;\n const value =\n typeof snapshot.metrics?.totalRegistrations === 'number' ? snapshot.metrics.totalRegistrations : null;\n return parsed && !Number.isNaN(parsed.getTime()) && value !== null\n ? { time: parsed.getTime(), label: shortDate(at), value }\n : null;\n })\n .filter((point): point is { time: number; label: string; value: number } => point !== null)\n .sort((a, b) => a.time - b.time)\n .map(({ label, value }) => ({ label, value }));\n }, [snapshots]);\n\n // BOFF-11386 — registrations-by-status donut, from the server aggregate\n // (same live-registration population as totalRegistrations), not a\n // 200-row client-side sample.\n const statusBreakdown = useMemo<DonutSlice[]>(() => {\n return (summary?.registrationsByStatus ?? [])\n .slice()\n .sort((a, b) => b.count - a.count)\n .map((entry, index) => ({\n name: humanizeStatus(entry.status || 'unknown'),\n value: entry.count,\n color: CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length],\n }));\n }, [summary]);\n\n const registrationTotal = summary?.totalRegistrations ?? 0;\n\n // Entity-count bar chart from the real dashboard summary + derived check-ins.\n const entityCounts = useMemo<BarDatum[]>(() => {\n if (!summary) return [];\n return [\n { name: 'Events', value: summary.totalEvents },\n { name: 'Regs', value: summary.totalRegistrations },\n { name: 'Attendees', value: summary.totalAttendees },\n { name: 'Check-ins', value: checkInCount },\n { name: 'Venues', value: summary.totalVenues },\n { name: 'Sponsors', value: summary.totalSponsors },\n { name: 'Sessions', value: summary.upcomingSessions },\n ];\n }, [summary, checkInCount]);\n\n // BOFF-11388 — the mutation always inserts (no lookup by name), so an\n // unvalidated name let two clicks, or two uses of the same label, produce\n // duplicate snapshots. Block a name already in the loaded page instead.\n const onCreate = async () => {\n const trimmed = snapshotName.trim();\n if (!trimmed) return;\n if (snapshots.some((snapshot) => (snapshot.name ?? '').toLowerCase() === trimmed.toLowerCase())) {\n notify.error('Snapshot name already used', 'Pick a different name, or delete the existing snapshot first.');\n return;\n }\n try {\n const response = await upsertSnapshot({\n variables: {\n input: {\n name: trimmed,\n title: trimmed,\n status: 'created',\n metadata: {},\n },\n },\n });\n if (!mutationSucceeded(response, response.data?.upsertAnalyticsSnapshot?.id, 'Could not generate snapshot')) {\n return;\n }\n notify.success('Snapshot generated');\n await refetch();\n } catch (error) {\n notify.error('Could not generate snapshot', describeError(error));\n }\n };\n\n const summaryLoading = summaryQuery.loading && !summary;\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Analytics shows current totals across every entity you manage, how registrations break down by status, and a\n trend line built from your saved snapshots. Generate a snapshot to record today&apos;s numbers for the\n workspace; each one is kept on its own and does not get replaced by later snapshots.\n </PagePurpose>\n\n <EmphasisPanel>\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Analytics</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Current metrics from live event operations, loaded when the page opens, plus point-in-time snapshots you\n control.\n </p>\n </div>\n <div className=\"flex w-full flex-col gap-2 sm:w-auto sm:flex-row\">\n <Input\n value={snapshotName}\n onChange={(e) => setSnapshotName(e.target.value)}\n placeholder=\"daily-summary\"\n aria-label=\"Snapshot name\"\n className=\"sm:w-48\"\n />\n <Button type=\"button\" disabled={creating} onClick={onCreate}>\n <Sparkles className=\"h-4 w-4\" />\n {creating ? 'Generating...' : 'Generate snapshot'}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n <AttendanceForecast\n events={events}\n total={eventsQuery.data?.events.total ?? 0}\n loading={eventsQuery.loading}\n failed={Boolean(eventsQuery.error)}\n reload={() => eventsQuery.refetch()}\n loadMore={() =>\n eventsQuery.fetchMore({\n variables: { limit: 50, offset: events.length },\n updateQuery: (previous, { fetchMoreResult }) => ({\n events: {\n total: fetchMoreResult.events.total,\n items: Array.from(\n new Map(\n [...previous.events.items, ...fetchMoreResult.events.items].map((event) => [event.id, event])\n ).values()\n ),\n },\n }),\n })\n }\n />\n\n <EventDraftAssistant events={events} />\n\n <div className=\"grid grid-cols-1 gap-6 xl:grid-cols-[minmax(0,1fr)_320px]\">\n <div className=\"space-y-6\">\n {/* Live metric tiles */}\n {summaryLoading ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n {Array.from({ length: 7 }).map((_, index) => (\n <Skeleton key={index} className=\"h-[92px] rounded-card\" />\n ))}\n </div>\n ) : summary ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n <MetricTile icon={CalendarDays} label=\"Events\" value={summary.totalEvents} />\n <MetricTile icon={ClipboardList} label=\"Registrations\" value={summary.totalRegistrations} />\n <MetricTile icon={Users} label=\"Attendees\" value={summary.totalAttendees} />\n <MetricTile icon={QrCode} label=\"Check-ins\" value={checkInCount} />\n <MetricTile icon={MapPin} label=\"Venues\" value={summary.totalVenues} />\n <MetricTile icon={Trophy} label=\"Sponsors\" value={summary.totalSponsors} />\n <MetricTile icon={Ticket} label=\"Upcoming Sessions\" value={summary.upcomingSessions} />\n </div>\n ) : null}\n\n {/* Registrations over time + by status */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations over time</h2>\n <span className=\"text-xs text-text-muted\">By snapshot</span>\n </div>\n <div className=\"mt-4\">\n <EventAreaChart data={registrationsSeries} emptyLabel=\"Generate a few snapshots to chart the trend\" />\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations by status</h2>\n <div className=\"mt-4 flex flex-col items-center gap-4 sm:flex-row\">\n <div className=\"w-full sm:w-1/2\">\n <EventDonutChart\n data={statusBreakdown}\n centerValue={registrationTotal.toLocaleString()}\n centerLabel=\"Registrations\"\n emptyLabel=\"No registrations yet\"\n />\n </div>\n <div className=\"w-full sm:w-1/2\">\n <ChartLegend\n items={statusBreakdown.map((slice) => ({\n label: slice.name,\n color: slice.color ?? 'var(--color-chart-1)',\n value: slice.value.toLocaleString(),\n }))}\n />\n </div>\n </div>\n </GlassCard>\n </div>\n\n {/* Entity totals */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Portfolio totals</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">Live counts across every entity you manage.</p>\n <div className=\"mt-4\">\n <EventBarChart data={entityCounts} emptyLabel=\"No operational data yet\" />\n </div>\n </GlassCard>\n\n {/* BOFF-3999 — check-in throughput by hour, scoped to one event. */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Check-in throughput</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Scans per hour at the door for the selected event\n {throughputTimezone ? ` (${throughputTimezone})` : ''}.\n </p>\n </div>\n {events.length > 0 ? (\n <Select value={throughputEventId} onValueChange={setThroughputEventIdOverride}>\n <SelectTrigger className=\"w-full sm:w-56\" aria-label=\"Select event for check-in throughput\">\n <SelectValue placeholder=\"Select event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((event) => (\n <SelectItem key={event.id} value={event.id}>\n {event.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n </div>\n <div className=\"mt-4\">\n <EventBarChart\n data={throughputSeries}\n emptyLabel={\n throughputEventId ? 'No check-ins recorded yet for this event' : 'Select an event to see throughput'\n }\n />\n </div>\n </GlassCard>\n </div>\n\n {/* Saved snapshots rail */}\n <aside className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">\n Saved snapshots {total > 0 ? <span className=\"text-text-muted\">({total})</span> : null}\n </h2>\n <BarChart3 className=\"h-4 w-4 text-text-muted\" />\n </div>\n\n {loading && snapshots.length === 0 ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <Skeleton key={index} className=\"h-24 rounded-card\" />\n ))}\n </div>\n ) : snapshots.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No snapshots yet\"\n description=\"Generate your first snapshot to freeze the current metrics.\"\n className=\"py-8\"\n />\n </GlassCard>\n ) : (\n <div className=\"space-y-3\">\n {snapshots.map((snapshot) => {\n const generatedAt =\n formatGeneratedAt(snapshot.metrics?.generatedAt) ?? formatGeneratedAt(snapshot.createdAt);\n const captured = METRIC_FIELDS.map((field) => {\n const raw = snapshot.metrics?.[field.key];\n return { label: field.label, value: typeof raw === 'number' ? raw : null };\n }).filter((entry) => entry.value !== null);\n return (\n <GlassCard key={snapshot.id} treatment=\"plain\" className=\"border-border-seam p-4\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {snapshot.title ?? snapshot.name ?? `Snapshot ${snapshot.id}`}\n </h3>\n {generatedAt ? <p className=\"mt-0.5 text-xs text-text-muted\">{generatedAt}</p> : null}\n </div>\n {snapshot.status ? (\n <Badge variant={statusVariant(snapshot.status)} className=\"shrink-0 uppercase\">\n {snapshot.status}\n </Badge>\n ) : null}\n </div>\n {captured.length > 0 ? (\n <dl className=\"mt-3 space-y-1.5\">\n {captured.map((entry) => (\n <div key={entry.label} className=\"flex items-center justify-between text-xs\">\n <dt className=\"text-text-secondary\">{entry.label}</dt>\n <dd className=\"font-semibold tabular-nums text-text-primary\">\n {(entry.value ?? 0).toLocaleString()}\n </dd>\n </div>\n ))}\n </dl>\n ) : (\n <p className=\"mt-3 text-xs text-text-muted\">No metrics captured.</p>\n )}\n </GlassCard>\n );\n })}\n\n <Pagination\n offset={pagination.offset}\n limit={pagination.limit}\n loadedCount={snapshots.length}\n total={total}\n onPrev={pagination.prevPage}\n onNext={pagination.nextPage}\n itemLabel=\"snapshots\"\n loading={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AAU,IAAI;OACzC,OACE,kBAACrC,GAAD;QAA6B,WAAU;QAAQ,WAAU;QAAzD,UAAA,CACE,kBAAC,OAAD;SAAK,WAAU;SAAf,UAAA,CACE,kBAAC,OAAD;UAAK,WAAU;UAAf,UAAA,CACE,kBAAC,MAAD;WAAI,WAAU;WACX,UAAAiC,EAAS,SAASA,EAAS,QAAQ,YAAYA,EAAS;UACvD,CAAA,GACHkD,IAAc,kBAAC,KAAD;WAAG,WAAU;WAAkC,UAAAA;UAAe,CAAA,IAAI,IAC9E;SACJ,CAAA,GAAAlD,EAAS,SACR,kBAAC/C,GAAD;UAAO,SAASI,EAAc2C,EAAS,MAAM;UAAG,WAAU;UACvD,UAAAA,EAAS;SACL,CAAA,IACL,IACD;QACJ,CAAA,GAAAmD,EAAS,SAAS,IACjB,kBAAC,MAAD;SAAI,WAAU;SACX,UAAAA,EAAS,KAAK,MACb,kBAAC,OAAD;UAAuB,WAAU;UAAjC,UAAA,CACE,kBAAC,MAAD;WAAI,WAAU;WAAuB,UAAA/C,EAAM;UAAU,CAAA,GACrD,kBAAC,MAAD;WAAI,WAAU;WACV,WAAAA,EAAM,SAAS,EAAA,CAAG,eAAe;UACjC,CAAA,CACD;SALK,GAAAA,EAAM,KAKX,CACN;QACC,CAAA,IAEJ,kBAAC,KAAD;SAAG,WAAU;SAA+B,UAAA;QAAuB,CAAA,CAE5D;OA5BK,GAAAJ,EAAS,EA4Bd;MAEf,CAAC,GAED,kBAACsD,IAAD;OACE,QAAQpF,EAAW;OACnB,OAAOA,EAAW;OAClB,aAAauB,EAAU;OAChB;OACP,QAAQvB,EAAW;OACnB,QAAQA,EAAW;OACnB,WAAU;OACD;MACV,CAAA,CACE;KAEF,CAAA,CAAA;IACJ,CAAA,CAAA;;EACF;;AAET"}
1
+ {"version":3,"file":"AnalyticsPage.js","names":["ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY","METRIC_FIELDS","statusVariant","value","status","formatGeneratedAt","parsed","shortDate","humanizeStatus","word","MetricTile","Icon","GlassCard","label","AnalyticsPage","pagination","usePagination","useQuery","summaryQuery","useDashboardSummaryQuery","upsertSnapshot","creating","useUpsertAnalyticsSnapshotMutation","snapshotName","setSnapshotName","useState","eventsQuery","useEventsQuery","events","useMemo","throughputEventIdOverride","setThroughputEventIdOverride","throughputEventId","throughputQuery","useCheckInThroughputQuery","throughputTimezone","throughputSeries","point","snapshots","data","total","summary","checkInCount","registrationsSeries","at","snapshot","a","b","statusBreakdown","entry","CHART_SERIES_COLORS","index","registrationTotal","entityCounts","onCreate","trimmed","response","mutationSucceeded","notify","refetch","error","describeError","summaryLoading","PagePurpose","EmphasisPanel","GradientText","Input","Button","Sparkles","AttendanceForecast","fetchMoreResult","previous","event","EventDraftAssistant","Skeleton","CalendarDays","ClipboardList","Users","QrCode","MapPin","Trophy","Ticket","EventAreaChart","EventDonutChart","ChartLegend","slice","EventBarChart","Select","SelectTrigger","SelectValue","SelectContent","SelectItem","BarChart3","loading","IllustratedEmptyState","generatedAt","captured","raw","field","Badge","Pagination"],"sources":["../../../../src/eventfullymanaged/pages/modules/AnalyticsPage.tsx"],"sourcesContent":["import { BarChart3, CalendarDays, ClipboardList, MapPin, QrCode, Sparkles, Ticket, Trophy, Users } from 'lucide-react';\nimport type { LucideIcon } from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n Input,\n PagePurpose,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Skeleton,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n CHART_SERIES_COLORS,\n ChartLegend,\n EventAreaChart,\n EventBarChart,\n EventDonutChart,\n type AreaPoint,\n type BarDatum,\n type DonutSlice,\n} from '../../components/EventCharts';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { AttendanceForecast } from '../../components/AttendanceForecast';\nimport { EventDraftAssistant } from '../../components/EventDraftAssistant';\nimport {\n useCheckInThroughputQuery,\n useDashboardSummaryQuery,\n useEventsQuery,\n useUpsertAnalyticsSnapshotMutation,\n} from '../../api/eventApi';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\n/**\n * Snapshot metrics are computed server-side at generation time and returned on\n * the `metrics` JSON field of an analytics snapshot. The shared\n * `useAnalyticsSnapshotsQuery` hook does not select `metrics`, so this page owns\n * a dedicated query (distinct operation name) that pulls the metric payload in\n * addition to the identity fields.\n */\nconst ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY = gql`\n query EventfullymanagedAnalyticsSnapshotsWithMetrics($limit: Int, $offset: Int) {\n analyticsSnapshots: eventfullyManagedAnalyticsSnapshots(limit: $limit, offset: $offset) {\n total\n items {\n id\n name\n title\n status\n metrics\n createdAt\n }\n }\n }\n`;\n\ntype SnapshotMetrics = {\n totalEvents?: number | null;\n activeEvents?: number | null;\n totalRegistrations?: number | null;\n totalAttendees?: number | null;\n totalVenues?: number | null;\n totalSponsors?: number | null;\n upcomingSessions?: number | null;\n generatedAt?: string | null;\n};\n\ntype SnapshotRow = {\n id: string;\n name?: string | null;\n title?: string | null;\n status?: string | null;\n createdAt?: string | null;\n metrics?: SnapshotMetrics | null;\n};\n\ntype SnapshotsResponse = {\n analyticsSnapshots: { total: number; items: SnapshotRow[] };\n};\n\nconst METRIC_FIELDS: { key: keyof SnapshotMetrics; label: string }[] = [\n { key: 'totalEvents', label: 'Events' },\n { key: 'activeEvents', label: 'Active' },\n { key: 'totalRegistrations', label: 'Registrations' },\n { key: 'totalAttendees', label: 'Attendees' },\n { key: 'totalVenues', label: 'Venues' },\n { key: 'totalSponsors', label: 'Sponsors' },\n { key: 'upcomingSessions', label: 'Upcoming Sessions' },\n];\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['active', 'published', 'completed'].includes(value)) return 'success';\n if (['inactive', 'cancelled', 'archived', 'expired'].includes(value)) return 'warning';\n if (['draft', 'created', 'pending', 'scheduled'].includes(value)) return 'info';\n return 'secondary';\n}\n\nfunction formatGeneratedAt(value?: string | null): string | null {\n if (!value) return null;\n const parsed = new Date(value);\n return Number.isNaN(parsed.getTime()) ? null : parsed.toLocaleString();\n}\n\nfunction shortDate(value?: string | null): string {\n if (!value) return '—';\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime())) return '—';\n return parsed.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });\n}\n\n/** Humanise a registration status token (e.g. `checked_in` → `Checked In`). */\nfunction humanizeStatus(status: string): string {\n return status\n .replace(/[_-]+/g, ' ')\n .split(' ')\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}\n\nfunction MetricTile({ icon: Icon, label, value }: { icon: LucideIcon; label: string; value: number }) {\n return (\n <GlassCard treatment=\"metric\" className=\"p-4\">\n <div className=\"flex items-center gap-2 text-text-secondary\">\n <Icon className=\"h-4 w-4 text-accent-primary\" />\n <p className=\"text-xs font-medium uppercase tracking-wide\">{label}</p>\n </div>\n <p className=\"mt-2 text-2xl font-bold tabular-nums text-text-primary\">{value.toLocaleString()}</p>\n </GlassCard>\n );\n}\n\nexport default function AnalyticsPage() {\n const pagination = usePagination({ pageSize: 8 });\n const { data, loading, refetch } = useQuery<SnapshotsResponse, { limit: number; offset: number }>(\n ANALYTICS_SNAPSHOTS_WITH_METRICS_QUERY,\n { variables: { limit: pagination.limit, offset: pagination.offset } }\n );\n const summaryQuery = useDashboardSummaryQuery();\n const [upsertSnapshot, { loading: creating }] = useUpsertAnalyticsSnapshotMutation();\n const [snapshotName, setSnapshotName] = useState('overview');\n\n // BOFF-3999 — check-in throughput is scoped to one event; default to the\n // first event once the list loads.\n const eventsQuery = useEventsQuery({ limit: 50, offset: 0 });\n const events = useMemo(() => eventsQuery.data?.events.items ?? [], [eventsQuery.data]);\n // Derived (not effect-synced): an explicit user pick wins, otherwise fall\n // back to the first loaded event — avoids a setState-in-effect render.\n const [throughputEventIdOverride, setThroughputEventIdOverride] = useState('');\n const throughputEventId = throughputEventIdOverride || events[0]?.id || '';\n const throughputQuery = useCheckInThroughputQuery({ eventId: throughputEventId });\n // BOFF-11389 — the server buckets `hour` in the event's own IANA timezone\n // (returned per-point as `timezone`); label each bar in that same zone\n // instead of the viewer's browser zone, or bucket and label disagree.\n const throughputTimezone = throughputQuery.data?.checkInThroughput[0]?.timezone ?? null;\n const throughputSeries = useMemo<BarDatum[]>(() => {\n return (throughputQuery.data?.checkInThroughput ?? []).map((point) => ({\n name: new Date(point.hour).toLocaleTimeString(undefined, { hour: 'numeric', timeZone: point.timezone }),\n value: point.count,\n }));\n }, [throughputQuery.data]);\n\n const snapshots = useMemo(() => data?.analyticsSnapshots.items ?? [], [data]);\n const total = data?.analyticsSnapshots.total ?? 0;\n\n const summary = summaryQuery.data?.dashboardSummary;\n\n // BOFF-11386 — checked-in count comes from the server aggregate (same live-\n // registration population as totalRegistrations), not a 200-row sample.\n const checkInCount = summary?.checkedInRegistrations ?? 0;\n\n // Registrations over time: the totalRegistrations captured on each snapshot,\n // ordered oldest → newest. Purely real, snapshot-derived — never synthesised.\n const registrationsSeries = useMemo<AreaPoint[]>(() => {\n return snapshots\n .map((snapshot) => {\n const at = snapshot.metrics?.generatedAt ?? snapshot.createdAt ?? null;\n const parsed = at ? new Date(at) : null;\n const value =\n typeof snapshot.metrics?.totalRegistrations === 'number' ? snapshot.metrics.totalRegistrations : null;\n return parsed && !Number.isNaN(parsed.getTime()) && value !== null\n ? { time: parsed.getTime(), label: shortDate(at), value }\n : null;\n })\n .filter((point): point is { time: number; label: string; value: number } => point !== null)\n .sort((a, b) => a.time - b.time)\n .map(({ label, value }) => ({ label, value }));\n }, [snapshots]);\n\n // BOFF-11386 — registrations-by-status donut, from the server aggregate\n // (same live-registration population as totalRegistrations), not a\n // 200-row client-side sample.\n const statusBreakdown = useMemo<DonutSlice[]>(() => {\n return (summary?.registrationsByStatus ?? [])\n .slice()\n .sort((a, b) => b.count - a.count)\n .map((entry, index) => ({\n name: humanizeStatus(entry.status || 'unknown'),\n value: entry.count,\n color: CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length],\n }));\n }, [summary]);\n\n const registrationTotal = summary?.totalRegistrations ?? 0;\n\n // Entity-count bar chart from the real dashboard summary + derived check-ins.\n const entityCounts = useMemo<BarDatum[]>(() => {\n if (!summary) return [];\n return [\n { name: 'Events', value: summary.totalEvents },\n { name: 'Regs', value: summary.totalRegistrations },\n { name: 'Attendees', value: summary.totalAttendees },\n { name: 'Check-ins', value: checkInCount },\n { name: 'Venues', value: summary.totalVenues },\n { name: 'Sponsors', value: summary.totalSponsors },\n { name: 'Sessions', value: summary.upcomingSessions },\n ];\n }, [summary, checkInCount]);\n\n // BOFF-11388 — the mutation always inserts (no lookup by name), so an\n // unvalidated name let two clicks, or two uses of the same label, produce\n // duplicate snapshots. Block a name already in the loaded page instead.\n const onCreate = async () => {\n const trimmed = snapshotName.trim();\n if (!trimmed) return;\n if (snapshots.some((snapshot) => (snapshot.name ?? '').toLowerCase() === trimmed.toLowerCase())) {\n notify.error('Snapshot name already used', 'Pick a different name, or delete the existing snapshot first.');\n return;\n }\n try {\n const response = await upsertSnapshot({\n variables: {\n input: {\n name: trimmed,\n title: trimmed,\n status: 'created',\n metadata: {},\n },\n },\n });\n if (!mutationSucceeded(response, response.data?.upsertAnalyticsSnapshot?.id, 'Could not generate snapshot')) {\n return;\n }\n notify.success('Snapshot generated');\n await refetch();\n } catch (error) {\n notify.error('Could not generate snapshot', describeError(error));\n }\n };\n\n const summaryLoading = summaryQuery.loading && !summary;\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Analytics shows current totals across every entity you manage, how registrations break down by status, and a\n trend line built from your saved snapshots. Generate a snapshot to record today&apos;s numbers for the\n workspace; each one is kept on its own and does not get replaced by later snapshots.\n </PagePurpose>\n\n <EmphasisPanel>\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Analytics</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Current metrics from live event operations, loaded when the page opens, plus point-in-time snapshots you\n control.\n </p>\n </div>\n <div className=\"flex w-full flex-col gap-2 sm:w-auto sm:flex-row\">\n <Input\n value={snapshotName}\n onChange={(e) => setSnapshotName(e.target.value)}\n placeholder=\"daily-summary\"\n aria-label=\"Snapshot name\"\n className=\"sm:w-48\"\n />\n <Button type=\"button\" disabled={creating} onClick={onCreate}>\n <Sparkles className=\"h-4 w-4\" />\n {creating ? 'Generating...' : 'Generate snapshot'}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n <AttendanceForecast\n events={events}\n total={eventsQuery.data?.events.total ?? 0}\n loading={eventsQuery.loading}\n failed={Boolean(eventsQuery.error)}\n reload={() => eventsQuery.refetch()}\n loadMore={() =>\n eventsQuery.fetchMore({\n variables: { limit: 50, offset: events.length },\n updateQuery: (previous, { fetchMoreResult }) => ({\n events: {\n total: fetchMoreResult.events.total,\n items: Array.from(\n new Map(\n [...previous.events.items, ...fetchMoreResult.events.items].map((event) => [event.id, event])\n ).values()\n ),\n },\n }),\n })\n }\n />\n\n <EventDraftAssistant events={events} />\n\n <div className=\"grid grid-cols-1 gap-6 xl:grid-cols-[minmax(0,1fr)_320px]\">\n <div className=\"space-y-6\">\n {/* Live metric tiles */}\n {summaryLoading ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n {Array.from({ length: 7 }).map((_, index) => (\n <Skeleton key={index} className=\"h-[92px] rounded-card\" />\n ))}\n </div>\n ) : summary ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4\">\n <MetricTile icon={CalendarDays} label=\"Events\" value={summary.totalEvents} />\n <MetricTile icon={ClipboardList} label=\"Registrations\" value={summary.totalRegistrations} />\n <MetricTile icon={Users} label=\"Attendees\" value={summary.totalAttendees} />\n <MetricTile icon={QrCode} label=\"Check-ins\" value={checkInCount} />\n <MetricTile icon={MapPin} label=\"Venues\" value={summary.totalVenues} />\n <MetricTile icon={Trophy} label=\"Sponsors\" value={summary.totalSponsors} />\n <MetricTile icon={Ticket} label=\"Upcoming Sessions\" value={summary.upcomingSessions} />\n </div>\n ) : null}\n\n {/* Registrations over time + by status */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations over time</h2>\n <span className=\"text-xs text-text-muted\">By snapshot</span>\n </div>\n <div className=\"mt-4\">\n <EventAreaChart data={registrationsSeries} emptyLabel=\"Generate a few snapshots to chart the trend\" />\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Registrations by status</h2>\n <div className=\"mt-4 flex flex-col items-center gap-4 sm:flex-row\">\n <div className=\"w-full sm:w-1/2\">\n <EventDonutChart\n data={statusBreakdown}\n centerValue={registrationTotal.toLocaleString()}\n centerLabel=\"Registrations\"\n emptyLabel=\"No registrations yet\"\n />\n </div>\n <div className=\"w-full sm:w-1/2\">\n <ChartLegend\n items={statusBreakdown.map((slice) => ({\n label: slice.name,\n color: slice.color ?? 'var(--color-chart-1)',\n value: slice.value.toLocaleString(),\n }))}\n />\n </div>\n </div>\n </GlassCard>\n </div>\n\n {/* Entity totals */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <h2 className=\"text-base font-semibold text-text-primary\">Portfolio totals</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">Live counts across every entity you manage.</p>\n <div className=\"mt-4\">\n <EventBarChart data={entityCounts} emptyLabel=\"No operational data yet\" />\n </div>\n </GlassCard>\n\n {/* BOFF-3999 — check-in throughput by hour, scoped to one event. */}\n <GlassCard treatment=\"insight\" className=\"p-5\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Check-in throughput</h2>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Scans per hour at the door for the selected event\n {throughputTimezone ? ` (${throughputTimezone})` : ''}.\n </p>\n </div>\n {events.length > 0 ? (\n <Select value={throughputEventId} onValueChange={setThroughputEventIdOverride}>\n <SelectTrigger className=\"w-full sm:w-56\" aria-label=\"Select event for check-in throughput\">\n <SelectValue placeholder=\"Select event\" />\n </SelectTrigger>\n <SelectContent>\n {events.map((event) => (\n <SelectItem key={event.id} value={event.id}>\n {event.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n </div>\n <div className=\"mt-4\">\n <EventBarChart\n data={throughputSeries}\n emptyLabel={\n throughputEventId ? 'No check-ins recorded yet for this event' : 'Select an event to see throughput'\n }\n />\n </div>\n </GlassCard>\n </div>\n\n {/* Saved snapshots rail */}\n <aside className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-text-primary\">\n Saved snapshots {total > 0 ? <span className=\"text-text-muted\">({total})</span> : null}\n </h2>\n <BarChart3 className=\"h-4 w-4 text-text-muted\" />\n </div>\n\n {loading && snapshots.length === 0 ? (\n <div className=\"space-y-3\">\n {Array.from({ length: 3 }).map((_, index) => (\n <Skeleton key={index} className=\"h-24 rounded-card\" />\n ))}\n </div>\n ) : snapshots.length === 0 ? (\n <GlassCard treatment=\"plain\" className=\"border-border-seam\">\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title=\"No snapshots yet\"\n description=\"Generate your first snapshot to freeze the current metrics.\"\n className=\"py-8\"\n />\n </GlassCard>\n ) : (\n <div className=\"space-y-3\">\n {snapshots.map((snapshot) => {\n const generatedAt =\n formatGeneratedAt(snapshot.metrics?.generatedAt) ?? formatGeneratedAt(snapshot.createdAt);\n const captured = METRIC_FIELDS.map((field) => {\n const raw = snapshot.metrics?.[field.key];\n return { label: field.label, value: typeof raw === 'number' ? raw : null };\n }).filter((entry) => entry.value !== null);\n return (\n <GlassCard key={snapshot.id} treatment=\"plain\" className=\"border-border-seam p-4\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {snapshot.title ?? snapshot.name ?? `Snapshot ${snapshot.id}`}\n </h3>\n {generatedAt ? <p className=\"mt-0.5 text-xs text-text-muted\">{generatedAt}</p> : null}\n </div>\n {snapshot.status ? (\n <Badge variant={statusVariant(snapshot.status)} className=\"shrink-0 uppercase\">\n {snapshot.status}\n </Badge>\n ) : null}\n </div>\n {captured.length > 0 ? (\n <dl className=\"mt-3 space-y-1.5\">\n {captured.map((entry) => (\n <div key={entry.label} className=\"flex items-center justify-between text-xs\">\n <dt className=\"text-text-secondary\">{entry.label}</dt>\n <dd className=\"font-semibold tabular-nums text-text-primary\">\n {(entry.value ?? 0).toLocaleString()}\n </dd>\n </div>\n ))}\n </dl>\n ) : (\n <p className=\"mt-3 text-xs text-text-muted\">No metrics captured.</p>\n )}\n </GlassCard>\n );\n })}\n\n <Pagination\n offset={pagination.offset}\n limit={pagination.limit}\n loadedCount={snapshots.length}\n total={total}\n onPrev={pagination.prevPage}\n onNext={pagination.nextPage}\n itemLabel=\"snapshots\"\n loading={loading}\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmDA,IAAMA,IAAyC,CAAG;;;;;;;;;;;;;;GAwC5CC,IAAiE;CACrE;EAAE,KAAK;EAAe,OAAO;CAAS;CACtC;EAAE,KAAK;EAAgB,OAAO;CAAS;CACvC;EAAE,KAAK;EAAsB,OAAO;CAAgB;CACpD;EAAE,KAAK;EAAkB,OAAO;CAAY;CAC5C;EAAE,KAAK;EAAe,OAAO;CAAS;CACtC;EAAE,KAAK;EAAiB,OAAO;CAAW;CAC1C;EAAE,KAAK;EAAoB,OAAO;CAAoB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