@burdenoff/microfe-notification 2026.1117.2 → 2026.1118.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.
- package/dist/components/NotificationListFooter.d.ts +18 -0
- package/dist/components/NotificationListFooter.js +43 -0
- package/dist/components/NotificationListFooter.js.map +1 -0
- package/dist/hooks/notificationPaging.d.ts +51 -0
- package/dist/hooks/notificationPaging.js +43 -0
- package/dist/hooks/notificationPaging.js.map +1 -0
- package/dist/hooks/useNotifications.d.ts +2 -0
- package/dist/hooks/useNotifications.js +177 -129
- package/dist/hooks/useNotifications.js.map +1 -1
- package/dist/navigation-v2/NotificationArchivedV2.js +98 -91
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
- package/dist/navigation-v2/NotificationInboxV2.js +78 -71
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +105 -98
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +77 -70
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/translations/en.d.ts +3 -0
- package/package.json +2 -2
|
@@ -2,22 +2,23 @@ import "../hooks/index.js";
|
|
|
2
2
|
import { useNotifications as e } from "../hooks/useNotifications.js";
|
|
3
3
|
import { NotificationCard as t } from "../components/NotificationCard.js";
|
|
4
4
|
import { useNotificationTopics as n } from "../hooks/useNotificationTopics.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
5
|
+
import { NotificationListFooter as r } from "../components/NotificationListFooter.js";
|
|
6
|
+
import { filterNotifications as i, groupNotificationsByDate as a } from "../utils/index.js";
|
|
7
|
+
import { NOTIFICATION_PERMISSIONS as o } from "../constants/permissions.js";
|
|
8
|
+
import { useNotification as s } from "../providers/NotificationProvider.js";
|
|
9
|
+
import { useTr as c } from "../shared/hooks/useTr.js";
|
|
10
|
+
import { NotificationInboxV2 as l } from "../navigation-v2/NotificationInboxV2.js";
|
|
11
|
+
import { useMemo as u } from "react";
|
|
12
|
+
import { usePermissions as d } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
13
|
+
import { BellRing as f, CheckCheck as p, Search as m } from "lucide-react";
|
|
14
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
|
+
import { PushOptInToggle as v } from "@burdenoff/fe-libs/chrome";
|
|
16
|
+
import { AuroraBackground as y, Button as b, EmphasisPanel as x, GlassCard as S, GradientText as C, IllustratedEmptyState as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
// src/pages/NotificationCenterPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var E = {
|
|
18
19
|
archived: !1,
|
|
19
20
|
channel: "IN_APP"
|
|
20
|
-
},
|
|
21
|
+
}, D = { channel: "IN_APP" }, O = [
|
|
21
22
|
{
|
|
22
23
|
value: "SYSTEM",
|
|
23
24
|
labelKey: "notifications.typeSystem",
|
|
@@ -38,7 +39,7 @@ var T = {
|
|
|
38
39
|
labelKey: "notifications.typeMarketing",
|
|
39
40
|
label: "Marketing"
|
|
40
41
|
}
|
|
41
|
-
],
|
|
42
|
+
], k = [
|
|
42
43
|
{
|
|
43
44
|
value: "URGENT",
|
|
44
45
|
labelKey: "notifications.priorityUrgent",
|
|
@@ -60,170 +61,176 @@ var T = {
|
|
|
60
61
|
label: "Low"
|
|
61
62
|
}
|
|
62
63
|
];
|
|
63
|
-
function k() {
|
|
64
|
-
let { navigationV2: e } = o();
|
|
65
|
-
return h(e ? c : A, {});
|
|
66
|
-
}
|
|
67
64
|
function A() {
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
let { navigationV2: e } = s();
|
|
66
|
+
return g(e ? l : j, {});
|
|
67
|
+
}
|
|
68
|
+
function j() {
|
|
69
|
+
let l = c(), { hasPermission: A, isLoading: j } = d(), { currentUser: M } = s(), { notifications: N, hasMore: P, isLoadingMore: F, loadMore: I, unreadCount: L, notificationFilter: R, markAsRead: z, markAllAsRead: B, archiveNotification: V, recordAction: H, updateFilter: U, resetFilter: W } = e({
|
|
70
|
+
baseFilter: E,
|
|
71
|
+
unreadFilter: D
|
|
72
|
+
}), { topics: G } = n({ isActive: !0 }), K = u(() => i(N, R), [N, R]), q = u(() => a(K, l), [K, l]);
|
|
73
|
+
return j ? /* @__PURE__ */ g("div", {
|
|
73
74
|
className: "flex h-64 items-center justify-center",
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
}) : !
|
|
75
|
+
children: /* @__PURE__ */ g("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
76
|
+
}) : !A(o.NOTIFICATION_LIST) && !M?.id ? /* @__PURE__ */ g("div", {
|
|
76
77
|
className: "p-8 text-center text-text-secondary",
|
|
77
|
-
children:
|
|
78
|
-
}) : /* @__PURE__ */
|
|
78
|
+
children: l("notifications.noPermissionView", "You don't have permission to view notifications.")
|
|
79
|
+
}) : /* @__PURE__ */ _("div", {
|
|
79
80
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
|
|
80
81
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
icon: /* @__PURE__ */
|
|
83
|
-
children:
|
|
82
|
+
/* @__PURE__ */ g(T, {
|
|
83
|
+
icon: /* @__PURE__ */ g(f, { size: 16 }),
|
|
84
|
+
children: l("notifications.centerPurpose", "Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.")
|
|
84
85
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ _("div", {
|
|
86
87
|
className: "relative overflow-hidden rounded-2xl",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ g(y, { intensity: "subtle" }), /* @__PURE__ */ _(x, {
|
|
88
89
|
"data-tour": "notification-center-header",
|
|
89
90
|
className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h1", {
|
|
91
92
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
}), /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ g(C, { children: l("notifications.centerTitle", "Notification Center") })
|
|
94
|
+
}), /* @__PURE__ */ g("p", {
|
|
94
95
|
className: "text-sm text-text-secondary mt-1",
|
|
95
|
-
children:
|
|
96
|
-
|
|
96
|
+
children: L > 0 ? /* @__PURE__ */ _(h, { children: [
|
|
97
|
+
l("notifications.youHave", "You have"),
|
|
97
98
|
" ",
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ _("span", {
|
|
99
100
|
className: "inline-flex items-center gap-1.5 font-semibold text-primary",
|
|
100
101
|
"data-tour": "notification-center-unread-count",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ g("span", { className: "inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse" }), L]
|
|
102
103
|
}),
|
|
103
104
|
" ",
|
|
104
|
-
|
|
105
|
-
] }) :
|
|
106
|
-
})] }),
|
|
105
|
+
l(L === 1 ? "notifications.unreadNotification" : "notifications.unreadNotifications", L === 1 ? "unread notification" : "unread notifications")
|
|
106
|
+
] }) : l("notifications.allCaughtUp", "All caught up!")
|
|
107
|
+
})] }), L > 0 && /* @__PURE__ */ _(b, {
|
|
107
108
|
"data-tour": "notification-center-mark-all-read",
|
|
108
109
|
variant: "outline",
|
|
109
|
-
onClick:
|
|
110
|
+
onClick: B,
|
|
110
111
|
className: "gap-2",
|
|
111
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ g(p, { size: 16 }), l("notifications.markAllAsRead", "Mark All as Read")]
|
|
112
113
|
})]
|
|
113
114
|
})]
|
|
114
115
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ g(v, {}),
|
|
117
|
+
/* @__PURE__ */ _(S, {
|
|
117
118
|
treatment: "plain",
|
|
118
119
|
"data-tour": "notification-center-filters",
|
|
119
120
|
className: "flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4",
|
|
120
121
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ _("div", {
|
|
122
123
|
className: "relative flex-1",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ g(m, {
|
|
124
125
|
size: 16,
|
|
125
126
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
|
|
126
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ g("input", {
|
|
127
128
|
"data-tour": "notification-center-search",
|
|
128
129
|
type: "text",
|
|
129
|
-
placeholder:
|
|
130
|
-
value:
|
|
131
|
-
onChange: (e) =>
|
|
130
|
+
placeholder: l("notifications.searchPlaceholder", "Search notifications..."),
|
|
131
|
+
value: R.search,
|
|
132
|
+
onChange: (e) => U({ search: e.target.value }),
|
|
132
133
|
className: "w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150"
|
|
133
134
|
})]
|
|
134
135
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
value:
|
|
137
|
-
onChange: (e) =>
|
|
136
|
+
/* @__PURE__ */ _("select", {
|
|
137
|
+
value: R.type,
|
|
138
|
+
onChange: (e) => U({ type: e.target.value }),
|
|
138
139
|
className: "px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ g("option", {
|
|
140
141
|
value: "ALL",
|
|
141
|
-
children:
|
|
142
|
-
}),
|
|
142
|
+
children: l("notifications.allTypes", "All Types")
|
|
143
|
+
}), O.map((e) => /* @__PURE__ */ g("option", {
|
|
143
144
|
value: e.value,
|
|
144
|
-
children:
|
|
145
|
+
children: l(e.labelKey, e.label)
|
|
145
146
|
}, e.value))]
|
|
146
147
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
value:
|
|
149
|
-
onChange: (e) =>
|
|
148
|
+
/* @__PURE__ */ _("select", {
|
|
149
|
+
value: R.priority,
|
|
150
|
+
onChange: (e) => U({ priority: e.target.value }),
|
|
150
151
|
className: "px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ g("option", {
|
|
152
153
|
value: "ALL",
|
|
153
|
-
children:
|
|
154
|
-
}),
|
|
154
|
+
children: l("notifications.allPriorities", "All Priorities")
|
|
155
|
+
}), k.map((e) => /* @__PURE__ */ g("option", {
|
|
155
156
|
value: e.value,
|
|
156
|
-
children:
|
|
157
|
+
children: l(e.labelKey, e.label)
|
|
157
158
|
}, e.value))]
|
|
158
159
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
value:
|
|
161
|
-
onChange: (e) =>
|
|
160
|
+
/* @__PURE__ */ _("select", {
|
|
161
|
+
value: R.topicId || "",
|
|
162
|
+
onChange: (e) => U({ topicId: e.target.value || void 0 }),
|
|
162
163
|
className: "px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ g("option", {
|
|
164
165
|
value: "",
|
|
165
|
-
children:
|
|
166
|
-
}),
|
|
166
|
+
children: l("notifications.allTopics", "All Topics")
|
|
167
|
+
}), G.map((e) => /* @__PURE__ */ g("option", {
|
|
167
168
|
value: e.id,
|
|
168
169
|
children: e.name
|
|
169
170
|
}, e.id))]
|
|
170
171
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
value:
|
|
173
|
-
onChange: (e) =>
|
|
172
|
+
/* @__PURE__ */ _("select", {
|
|
173
|
+
value: R.isRead === null ? "ALL" : R.isRead ? "READ" : "UNREAD",
|
|
174
|
+
onChange: (e) => U({ isRead: e.target.value === "ALL" ? null : e.target.value === "READ" }),
|
|
174
175
|
className: "px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
175
176
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ g("option", {
|
|
177
178
|
value: "ALL",
|
|
178
|
-
children:
|
|
179
|
+
children: l("notifications.filterAll", "All")
|
|
179
180
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ g("option", {
|
|
181
182
|
value: "UNREAD",
|
|
182
|
-
children:
|
|
183
|
+
children: l("notifications.filterUnread", "Unread")
|
|
183
184
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ g("option", {
|
|
185
186
|
value: "READ",
|
|
186
|
-
children:
|
|
187
|
+
children: l("notifications.filterRead", "Read")
|
|
187
188
|
})
|
|
188
189
|
]
|
|
189
190
|
}),
|
|
190
|
-
(
|
|
191
|
-
onClick:
|
|
191
|
+
(R.search || R.type !== "ALL" || R.priority !== "ALL" || R.isRead !== null || !!R.topicId) && /* @__PURE__ */ g("button", {
|
|
192
|
+
onClick: W,
|
|
192
193
|
className: "px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150",
|
|
193
|
-
children:
|
|
194
|
+
children: l("notifications.resetFilters", "Reset")
|
|
194
195
|
})
|
|
195
196
|
]
|
|
196
197
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ g("div", {
|
|
198
199
|
"data-tour": "notification-center-list",
|
|
199
200
|
className: "space-y-6",
|
|
200
|
-
children:
|
|
201
|
+
children: K.length > 0 ? Object.entries(q).map(([e, n]) => /* @__PURE__ */ _("div", {
|
|
201
202
|
className: "animate-in fade-in slide-in-from-bottom-2 duration-200",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
203
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
203
204
|
className: "text-sm font-semibold text-tertiary mb-3",
|
|
204
205
|
children: e
|
|
205
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ g("div", {
|
|
206
207
|
className: "space-y-2",
|
|
207
|
-
children: n.map((e) => /* @__PURE__ */
|
|
208
|
+
children: n.map((e) => /* @__PURE__ */ g(t, {
|
|
208
209
|
notification: e,
|
|
209
|
-
onMarkAsRead:
|
|
210
|
-
onArchive:
|
|
211
|
-
onAction:
|
|
210
|
+
onMarkAsRead: z,
|
|
211
|
+
onArchive: V,
|
|
212
|
+
onAction: H,
|
|
212
213
|
analyticsSource: "center"
|
|
213
214
|
}, e.id))
|
|
214
215
|
})]
|
|
215
|
-
}, e)) : /* @__PURE__ */
|
|
216
|
+
}, e)) : /* @__PURE__ */ g("div", {
|
|
216
217
|
className: "animate-in fade-in duration-200",
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
-
illustration:
|
|
219
|
-
title:
|
|
220
|
-
description:
|
|
218
|
+
children: /* @__PURE__ */ g(w, {
|
|
219
|
+
illustration: N.length === 0 ? "empty-notifications" : "empty-search",
|
|
220
|
+
title: l("notifications.noNotificationsFound", "No notifications found"),
|
|
221
|
+
description: N.length === 0 ? l("notifications.noNotificationsYet", "You don't have any notifications yet. We'll notify you when something important happens.") : l("notifications.adjustFilters", "Try adjusting your filters to see more notifications.")
|
|
221
222
|
})
|
|
222
223
|
})
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ g(r, {
|
|
226
|
+
hasMore: P,
|
|
227
|
+
isLoadingMore: F,
|
|
228
|
+
onLoadMore: I,
|
|
229
|
+
shownCount: K.length
|
|
223
230
|
})
|
|
224
231
|
]
|
|
225
232
|
});
|
|
226
233
|
}
|
|
227
|
-
export {
|
|
234
|
+
export { A as NotificationCenterPage };
|
|
228
235
|
|
|
229
236
|
//# sourceMappingURL=NotificationCenterPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\n );\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <select\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n {/* Priority filter */}\n <select\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n {/* Read/Unread filter */}\n <select\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </select>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,IAAMC,IAAgB;CAAE,UAA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AAc,WAAW,IAAI,wBAAwB;MACnE,OAAOT,EAAG,sCAAsC,wBAAwB;MACxE,aACES,EAAc,WAAW,IACrBT,EACE,oCACA,0FACF,IACAA,EACE,+BACA,uDACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\n );\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <select\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n {/* Priority filter */}\n <select\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n {/* Read/Unread filter */}\n <select\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </select>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={filteredNotifications.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,IAAMC,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAQ;CACtE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAA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