@burdenoff/microfe-notification 2026.1124.1 → 2026.1125.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 (40) hide show
  1. package/dist/AdminNotificationRoutes.js +59 -51
  2. package/dist/AdminNotificationRoutes.js.map +1 -1
  3. package/dist/NotificationRoutes.js +76 -68
  4. package/dist/NotificationRoutes.js.map +1 -1
  5. package/dist/UserNotificationRoutes.js +39 -31
  6. package/dist/UserNotificationRoutes.js.map +1 -1
  7. package/dist/components/NotificationListFooter.js +1 -1
  8. package/dist/components/NotificationListFooter.js.map +1 -1
  9. package/dist/components/loadingSystem.d.ts +64 -0
  10. package/dist/components/loadingSystem.js +34 -0
  11. package/dist/components/loadingSystem.js.map +1 -0
  12. package/dist/navigation-v2/AdminPageV2.js +23 -16
  13. package/dist/navigation-v2/AdminPageV2.js.map +1 -1
  14. package/dist/navigation-v2/NotificationArchivedV2.js +100 -93
  15. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
  16. package/dist/navigation-v2/NotificationInboxV2.js +130 -123
  17. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
  18. package/dist/navigation-v2/NotificationSettingsV2.js +91 -84
  19. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
  20. package/dist/navigation-v2/NotificationsV2Landing.js +31 -23
  21. package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
  22. package/dist/pages/CreateNotificationPage.js +442 -432
  23. package/dist/pages/CreateNotificationPage.js.map +1 -1
  24. package/dist/pages/NotificationCenterPage.js +91 -84
  25. package/dist/pages/NotificationCenterPage.js.map +1 -1
  26. package/dist/pages/NotificationHistoryAdminPage.js +226 -219
  27. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  28. package/dist/pages/NotificationHistoryPage.js +69 -62
  29. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  30. package/dist/pages/NotificationLandingPage.js +42 -34
  31. package/dist/pages/NotificationLandingPage.js.map +1 -1
  32. package/dist/pages/NotificationPreferencesPage.js +80 -70
  33. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  34. package/dist/pages/NotificationTemplatesPage.js +192 -181
  35. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  36. package/dist/pages/NotificationTopicsPage.js +124 -117
  37. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  38. package/dist/pages/TemplateEditorPage.js +248 -233
  39. package/dist/pages/TemplateEditorPage.js.map +1 -1
  40. package/package.json +2 -2
@@ -4,371 +4,382 @@ import { useTr as n } from "../shared/hooks/useTr.js";
4
4
  import { nativeConfirm as r, nativeImpact as i, nativeNotify as a } from "../utils/nativeBridge.js";
5
5
  import { ConfirmDeleteDialog as o } from "../components/ConfirmDeleteDialog.js";
6
6
  import { useNavigationV2 as s, useNotificationPaths as c } from "../navigation-v2/paths.js";
7
- import { useMemo as l, useState as u } from "react";
8
- import { usePermissions as d } from "@burdenoff/fe-libs/shared/providers/shell";
9
- import { AlertCircle as f, FileText as p, Loader2 as m, Plus as h, RefreshCw as ee, Search as te, Trash2 as g } from "lucide-react";
10
- import { useNavigate as _ } from "react-router";
11
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
12
- import { Button as b, EmphasisPanel as ne, GlassCard as re, IllustratedEmptyState as ie, NextSteps as ae, PagePurpose as oe, ThemedSelect as se } from "@burdenoff/fe-libs/ui";
13
- import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { CompactMarkOr as l, SectionLoaderOr as u, SpinnerIcon as d } from "../components/loadingSystem.js";
8
+ import { useMemo as f, useState as p } from "react";
9
+ import { usePermissions as m } from "@burdenoff/fe-libs/shared/providers/shell";
10
+ import { AlertCircle as h, FileText as g, Plus as _, RefreshCw as ee, Search as te, Trash2 as v } from "lucide-react";
11
+ import { useNavigate as ne } from "react-router";
12
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
13
+ import { Button as x, EmphasisPanel as re, GlassCard as S, IllustratedEmptyState as ie, NextSteps as ae, PagePurpose as oe, ThemedSelect as C } from "@burdenoff/fe-libs/ui";
14
+ import { useI18n as se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
15
  // src/pages/NotificationTemplatesPage.tsx
15
- var S = {
16
+ var ce = {
16
17
  TRANSACTIONAL: "text-status-info-text bg-status-info-bg-subtle border-status-info-bg-subtle",
17
18
  MARKETING: "text-accent-purple bg-accent-purple-subtle border-accent-purple-subtle",
18
19
  SYSTEM: "text-status-warning-text bg-status-warning-bg-subtle border-status-warning-bg-subtle",
19
20
  ALERT: "text-status-error-text bg-status-error-bg-subtle border-status-error-bg-subtle"
20
- }, C = {
21
+ }, le = {
21
22
  TRANSACTIONAL: "Transactional",
22
23
  MARKETING: "Marketing",
23
24
  SYSTEM: "System",
24
25
  ALERT: "Alert"
25
26
  };
26
- function w(e, t) {
27
+ function ue(e, t) {
27
28
  return new Date(e).toLocaleDateString(t || "en-US", {
28
29
  month: "short",
29
30
  day: "numeric",
30
31
  year: "numeric"
31
32
  });
32
33
  }
33
- function T() {
34
- let T = _(), E = n(), D = c(), O = s(), [k, A] = u(null), j = (e, t) => O ? new Promise((n) => A({
34
+ function w() {
35
+ let w = ne(), T = n(), E = c(), D = s(), [O, k] = p(null), A = (e, t) => D ? new Promise((n) => k({
35
36
  title: e,
36
37
  message: t,
37
38
  resolve: n
38
- })) : Promise.resolve(window.confirm(t)), { locale: ce } = x(), { hasPermission: M, isLoading: le } = d(), { templates: N, isLoading: P, isDeleting: F, error: I, total: L, hasMore: R, filter: z, refetch: B, loadMore: V, deleteTemplate: H, updateFilter: U } = e(), [W, G] = u(null), [K, q] = u(null), [J, Y] = u(/* @__PURE__ */ new Set()), X = l(() => N.filter((e) => J.has(e.id)), [J, N]), Z = N.length > 0 && N.every((e) => J.has(e.id)), ue = N.some((e) => J.has(e.id)) && !Z, Q = M(t.TEMPLATE_CREATE), $ = M(t.TEMPLATE_DELETE), de = async (e, t) => {
39
+ })) : Promise.resolve(window.confirm(t)), { locale: de } = se(), { hasPermission: j, isLoading: fe } = m(), { templates: M, isLoading: N, isDeleting: P, error: F, total: I, hasMore: L, filter: R, refetch: z, loadMore: B, deleteTemplate: V, updateFilter: H } = e(), [U, W] = p(null), [G, K] = p(null), [q, J] = p(/* @__PURE__ */ new Set()), Y = f(() => M.filter((e) => q.has(e.id)), [q, M]), X = M.length > 0 && M.every((e) => q.has(e.id)), Z = M.some((e) => q.has(e.id)) && !X, Q = j(t.TEMPLATE_CREATE), $ = j(t.TEMPLATE_DELETE), pe = async (e, t) => {
39
40
  e.stopPropagation(), i("medium");
40
- let n = E("notifTemplates.confirmDelete", `Delete template "${t.name}"? This cannot be undone.`), o = await r({
41
- title: E("notifTemplates.deleteTitle", "Delete template"),
41
+ let n = T("notifTemplates.confirmDelete", `Delete template "${t.name}"? This cannot be undone.`), o = await r({
42
+ title: T("notifTemplates.deleteTitle", "Delete template"),
42
43
  message: n,
43
- okButtonTitle: E("notifTemplates.delete", "Delete")
44
+ okButtonTitle: T("notifTemplates.delete", "Delete")
44
45
  });
45
- if (o === null ? await j(E("notifTemplates.deleteTitle", "Delete template"), n) : o) {
46
- G(t.id), q(null);
46
+ if (o === null ? await A(T("notifTemplates.deleteTitle", "Delete template"), n) : o) {
47
+ W(t.id), K(null);
47
48
  try {
48
- await H(t.id), a("success");
49
+ await V(t.id), a("success");
49
50
  } catch (e) {
50
- a("error"), q(e instanceof Error ? e.message : E("notifTemplates.deleteFailed", "Failed to delete template"));
51
+ a("error"), K(e instanceof Error ? e.message : T("notifTemplates.deleteFailed", "Failed to delete template"));
51
52
  } finally {
52
- G(null);
53
+ W(null);
53
54
  }
54
55
  }
55
- }, fe = async () => {
56
- if (X.length === 0) return;
56
+ }, me = async () => {
57
+ if (Y.length === 0) return;
57
58
  i("medium");
58
- let e = E("notifTemplates.confirmBulkDelete", `Delete ${X.length} selected template${X.length === 1 ? "" : "s"}? This cannot be undone.`), t = await r({
59
- title: E("notifTemplates.bulkDeleteTitle", "Delete templates"),
59
+ let e = T("notifTemplates.confirmBulkDelete", `Delete ${Y.length} selected template${Y.length === 1 ? "" : "s"}? This cannot be undone.`), t = await r({
60
+ title: T("notifTemplates.bulkDeleteTitle", "Delete templates"),
60
61
  message: e,
61
- okButtonTitle: E("notifTemplates.delete", "Delete")
62
+ okButtonTitle: T("notifTemplates.delete", "Delete")
62
63
  });
63
- if (!(t === null ? await j(E("notifTemplates.bulkDeleteTitle", "Delete templates"), e) : t)) return;
64
- q(null);
65
- let n = (await Promise.allSettled(X.map((e) => H(e.id)))).some((e) => e.status === "rejected");
66
- a(n ? "error" : "success"), Y(/* @__PURE__ */ new Set());
67
- }, pe = (e, t) => {
68
- Y((n) => {
64
+ if (!(t === null ? await A(T("notifTemplates.bulkDeleteTitle", "Delete templates"), e) : t)) return;
65
+ K(null);
66
+ let n = (await Promise.allSettled(Y.map((e) => V(e.id)))).some((e) => e.status === "rejected");
67
+ a(n ? "error" : "success"), J(/* @__PURE__ */ new Set());
68
+ }, he = (e, t) => {
69
+ J((n) => {
69
70
  let r = new Set(n);
70
71
  return t ? r.add(e) : r.delete(e), r;
71
72
  });
72
- }, me = (e) => {
73
- Y((t) => {
73
+ }, ge = (e) => {
74
+ J((t) => {
74
75
  let n = new Set(t);
75
- return N.forEach((t) => {
76
+ return M.forEach((t) => {
76
77
  e ? n.add(t.id) : n.delete(t.id);
77
78
  }), n;
78
79
  });
79
80
  };
80
- return le ? /* @__PURE__ */ v("div", {
81
- className: "flex h-64 items-center justify-center",
82
- children: /* @__PURE__ */ v("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
83
- }) : M(t.TEMPLATE_LIST) || Q || $ || M(t.TEMPLATE_UPDATE) ? P && N.length === 0 ? /* @__PURE__ */ y("div", {
84
- className: "flex flex-col items-center justify-center h-64 gap-3",
85
- children: [/* @__PURE__ */ v(m, {
86
- size: 28,
87
- className: "animate-spin text-accent-primary"
88
- }), /* @__PURE__ */ v("p", {
89
- className: "text-sm text-text-secondary",
90
- children: E("notifTemplates.loading", "Loading templates...")
91
- })]
92
- }) : I && N.length === 0 ? /* @__PURE__ */ y("div", {
81
+ return fe ? /* @__PURE__ */ y(u, {
82
+ minHeight: "16rem",
83
+ today: /* @__PURE__ */ y("div", {
84
+ className: "flex h-64 items-center justify-center",
85
+ children: /* @__PURE__ */ y(l, {
86
+ className: "h-8 w-8",
87
+ today: /* @__PURE__ */ y("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
88
+ })
89
+ })
90
+ }) : j(t.TEMPLATE_LIST) || Q || $ || j(t.TEMPLATE_UPDATE) ? N && M.length === 0 ? /* @__PURE__ */ y(u, {
91
+ label: T("notifTemplates.loading", "Loading templates..."),
92
+ minHeight: "16rem",
93
+ today: /* @__PURE__ */ b("div", {
94
+ className: "flex flex-col items-center justify-center h-64 gap-3",
95
+ children: [/* @__PURE__ */ y(d, {
96
+ size: 28,
97
+ className: "animate-spin text-accent-primary"
98
+ }), /* @__PURE__ */ y("p", {
99
+ className: "text-sm text-text-secondary",
100
+ children: T("notifTemplates.loading", "Loading templates...")
101
+ })]
102
+ })
103
+ }) : F && M.length === 0 ? /* @__PURE__ */ b("div", {
93
104
  className: "flex flex-col items-center justify-center h-64 gap-4",
94
105
  children: [
95
- /* @__PURE__ */ v(f, {
106
+ /* @__PURE__ */ y(h, {
96
107
  size: 28,
97
108
  className: "text-error"
98
109
  }),
99
- /* @__PURE__ */ v("p", {
110
+ /* @__PURE__ */ y("p", {
100
111
  className: "text-sm text-error",
101
- children: I
112
+ children: F
102
113
  }),
103
- /* @__PURE__ */ y("button", {
104
- onClick: B,
114
+ /* @__PURE__ */ b("button", {
115
+ onClick: z,
105
116
  className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-accent-primary hover:bg-accent-primary/90 rounded-lg transition-all duration-150",
106
- children: [/* @__PURE__ */ v(ee, { size: 14 }), E("notifTemplates.retry", "Retry")]
117
+ children: [/* @__PURE__ */ y(ee, { size: 14 }), T("notifTemplates.retry", "Retry")]
107
118
  })
108
119
  ]
109
- }) : /* @__PURE__ */ y("div", {
120
+ }) : /* @__PURE__ */ b("div", {
110
121
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
111
122
  children: [
112
- /* @__PURE__ */ v(oe, {
113
- icon: /* @__PURE__ */ v(p, { size: 16 }),
114
- children: E("notifTemplates.purpose", "Reusable, versioned message blueprints — subject lines, bodies and channel layouts with {{variables}} you fill in at send time. Build a template once (e.g. a welcome email or a payment receipt) and reuse it from the Send page so every notification stays on-brand and consistent.")
123
+ /* @__PURE__ */ y(oe, {
124
+ icon: /* @__PURE__ */ y(g, { size: 16 }),
125
+ children: T("notifTemplates.purpose", "Reusable, versioned message blueprints — subject lines, bodies and channel layouts with {{variables}} you fill in at send time. Build a template once (e.g. a welcome email or a payment receipt) and reuse it from the Send page so every notification stays on-brand and consistent.")
115
126
  }),
116
- /* @__PURE__ */ y(ne, {
127
+ /* @__PURE__ */ b(re, {
117
128
  className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
118
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
129
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
119
130
  className: "text-xl sm:text-2xl font-bold text-primary",
120
- children: E("notifTemplates.title", "Notification Templates")
121
- }), /* @__PURE__ */ y("p", {
131
+ children: T("notifTemplates.title", "Notification Templates")
132
+ }), /* @__PURE__ */ b("p", {
122
133
  className: "text-sm text-text-secondary mt-1",
123
134
  children: [
124
- L,
135
+ I,
125
136
  " ",
126
- E("notifTemplates.templateCount", "template"),
127
- L === 1 ? "" : "s",
137
+ T("notifTemplates.templateCount", "template"),
138
+ I === 1 ? "" : "s",
128
139
  " ",
129
- E("notifTemplates.total", "total")
140
+ T("notifTemplates.total", "total")
130
141
  ]
131
- })] }), Q && /* @__PURE__ */ y(b, {
132
- onClick: () => T(D.newTemplate),
142
+ })] }), Q && /* @__PURE__ */ b(x, {
143
+ onClick: () => w(E.newTemplate),
133
144
  className: "gap-2",
134
- children: [/* @__PURE__ */ v(h, { size: 16 }), E("notifTemplates.createTemplate", "Create Template")]
145
+ children: [/* @__PURE__ */ y(_, { size: 16 }), T("notifTemplates.createTemplate", "Create Template")]
135
146
  })]
136
147
  }),
137
- /* @__PURE__ */ v(ae, {
148
+ /* @__PURE__ */ y(ae, {
138
149
  storageKey: "notification-templates",
139
150
  steps: [
140
151
  ...Q ? [{
141
152
  id: "create-template",
142
- label: E("notifTemplates.nextCreateLabel", "Create your first template"),
143
- description: E("notifTemplates.nextCreateDesc", "Build a reusable message blueprint with {{variables}} you fill in at send time."),
144
- onClick: () => T(D.newTemplate)
153
+ label: T("notifTemplates.nextCreateLabel", "Create your first template"),
154
+ description: T("notifTemplates.nextCreateDesc", "Build a reusable message blueprint with {{variables}} you fill in at send time."),
155
+ onClick: () => w(E.newTemplate)
145
156
  }] : [],
146
157
  {
147
158
  id: "filter-type",
148
- label: E("notifTemplates.nextFilterLabel", "Filter by type"),
149
- description: E("notifTemplates.nextFilterDesc", "Narrow to Transactional, Marketing, System or Alert templates to find one fast."),
150
- onClick: () => U({ type: "TRANSACTIONAL" })
159
+ label: T("notifTemplates.nextFilterLabel", "Filter by type"),
160
+ description: T("notifTemplates.nextFilterDesc", "Narrow to Transactional, Marketing, System or Alert templates to find one fast."),
161
+ onClick: () => H({ type: "TRANSACTIONAL" })
151
162
  },
152
163
  {
153
164
  id: "use-on-send",
154
- label: E("notifTemplates.nextUseLabel", "Send with a template"),
155
- description: E("notifTemplates.nextUseDesc", "Pick any saved template from the Send page so every notification stays on-brand."),
156
- href: D.send
165
+ label: T("notifTemplates.nextUseLabel", "Send with a template"),
166
+ description: T("notifTemplates.nextUseDesc", "Pick any saved template from the Send page so every notification stays on-brand."),
167
+ href: E.send
157
168
  }
158
169
  ]
159
170
  }),
160
- /* @__PURE__ */ y("div", {
171
+ /* @__PURE__ */ b("div", {
161
172
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
162
- children: [/* @__PURE__ */ y("div", {
173
+ children: [/* @__PURE__ */ b("div", {
163
174
  className: "relative flex-1",
164
- children: [/* @__PURE__ */ v(te, {
175
+ children: [/* @__PURE__ */ y(te, {
165
176
  size: 16,
166
177
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
167
- }), /* @__PURE__ */ v("input", {
178
+ }), /* @__PURE__ */ y("input", {
168
179
  type: "text",
169
- value: z.search || "",
170
- onChange: (e) => U({ search: e.target.value }),
171
- placeholder: E("notifTemplates.searchPlaceholder", "Search templates..."),
180
+ value: R.search || "",
181
+ onChange: (e) => H({ search: e.target.value }),
182
+ placeholder: T("notifTemplates.searchPlaceholder", "Search templates..."),
172
183
  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"
173
184
  })]
174
- }), /* @__PURE__ */ y(se, {
175
- value: z.type || "",
176
- onChange: (e) => U({ type: e.target.value || void 0 }),
185
+ }), /* @__PURE__ */ b(C, {
186
+ value: R.type || "",
187
+ onChange: (e) => H({ type: e.target.value || void 0 }),
177
188
  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",
178
189
  children: [
179
- /* @__PURE__ */ v("option", {
190
+ /* @__PURE__ */ y("option", {
180
191
  value: "",
181
- children: E("notifTemplates.allTypes", "All Types")
192
+ children: T("notifTemplates.allTypes", "All Types")
182
193
  }),
183
- /* @__PURE__ */ v("option", {
194
+ /* @__PURE__ */ y("option", {
184
195
  value: "TRANSACTIONAL",
185
- children: E("notifTemplates.typeTransactional", "Transactional")
196
+ children: T("notifTemplates.typeTransactional", "Transactional")
186
197
  }),
187
- /* @__PURE__ */ v("option", {
198
+ /* @__PURE__ */ y("option", {
188
199
  value: "MARKETING",
189
- children: E("notifTemplates.typeMarketing", "Marketing")
200
+ children: T("notifTemplates.typeMarketing", "Marketing")
190
201
  }),
191
- /* @__PURE__ */ v("option", {
202
+ /* @__PURE__ */ y("option", {
192
203
  value: "SYSTEM",
193
- children: E("notifTemplates.typeSystem", "System")
204
+ children: T("notifTemplates.typeSystem", "System")
194
205
  }),
195
- /* @__PURE__ */ v("option", {
206
+ /* @__PURE__ */ y("option", {
196
207
  value: "ALERT",
197
- children: E("notifTemplates.typeAlert", "Alert")
208
+ children: T("notifTemplates.typeAlert", "Alert")
198
209
  })
199
210
  ]
200
211
  })]
201
212
  }),
202
- N.length > 0 && /* @__PURE__ */ y(re, {
213
+ M.length > 0 && /* @__PURE__ */ b(S, {
203
214
  treatment: "plain",
204
215
  className: "flex flex-col gap-3 border-border-seam p-4 sm:flex-row sm:items-center sm:justify-between",
205
- children: [/* @__PURE__ */ y("label", {
216
+ children: [/* @__PURE__ */ b("label", {
206
217
  className: "flex items-center gap-2 text-sm text-primary",
207
- children: [/* @__PURE__ */ v("input", {
218
+ children: [/* @__PURE__ */ y("input", {
208
219
  type: "checkbox",
209
- checked: Z,
220
+ checked: X,
210
221
  ref: (e) => {
211
- e && (e.indeterminate = ue && !Z);
222
+ e && (e.indeterminate = Z && !X);
212
223
  },
213
- onChange: (e) => me(e.target.checked),
214
- "aria-label": E("notifTemplates.selectAllVisibleAria", "Select all notification templates"),
224
+ onChange: (e) => ge(e.target.checked),
225
+ "aria-label": T("notifTemplates.selectAllVisibleAria", "Select all notification templates"),
215
226
  className: "h-4 w-4 rounded border-default text-accent-primary"
216
- }), /* @__PURE__ */ v("span", { children: E("notifTemplates.selectAllVisible", "Select all visible") })]
217
- }), /* @__PURE__ */ y("div", {
227
+ }), /* @__PURE__ */ y("span", { children: T("notifTemplates.selectAllVisible", "Select all visible") })]
228
+ }), /* @__PURE__ */ b("div", {
218
229
  className: "flex items-center gap-2",
219
230
  children: [
220
- /* @__PURE__ */ y("span", {
231
+ /* @__PURE__ */ b("span", {
221
232
  className: "text-sm text-text-secondary",
222
233
  children: [
223
- J.size,
234
+ q.size,
224
235
  " ",
225
- E("notifTemplates.selected", "selected")
236
+ T("notifTemplates.selected", "selected")
226
237
  ]
227
238
  }),
228
- J.size > 0 && /* @__PURE__ */ v("button", {
229
- onClick: () => Y(/* @__PURE__ */ new Set()),
239
+ q.size > 0 && /* @__PURE__ */ y("button", {
240
+ onClick: () => J(/* @__PURE__ */ new Set()),
230
241
  className: "text-sm text-text-secondary hover:text-primary",
231
- children: E("notifTemplates.clearSelection", "Clear selection")
242
+ children: T("notifTemplates.clearSelection", "Clear selection")
232
243
  }),
233
- $ && /* @__PURE__ */ y("button", {
234
- onClick: fe,
235
- disabled: X.length === 0 || F,
244
+ $ && /* @__PURE__ */ b("button", {
245
+ onClick: me,
246
+ disabled: Y.length === 0 || P,
236
247
  className: "flex items-center gap-2 px-3 py-2 text-sm font-medium text-error border border-error/30 hover:bg-error/10 rounded-lg transition-all duration-150 disabled:opacity-50",
237
248
  children: [
238
- /* @__PURE__ */ v(g, { size: 14 }),
239
- E("notifTemplates.deleteSelected", "Delete Selected"),
240
- X.length > 0 ? ` (${X.length})` : ""
249
+ /* @__PURE__ */ y(v, { size: 14 }),
250
+ T("notifTemplates.deleteSelected", "Delete Selected"),
251
+ Y.length > 0 ? ` (${Y.length})` : ""
241
252
  ]
242
253
  })
243
254
  ]
244
255
  })]
245
256
  }),
246
- K && /* @__PURE__ */ y("div", {
257
+ G && /* @__PURE__ */ b("div", {
247
258
  className: "flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
248
- children: [/* @__PURE__ */ v(f, {
259
+ children: [/* @__PURE__ */ y(h, {
249
260
  size: 16,
250
261
  className: "text-error shrink-0"
251
- }), /* @__PURE__ */ v("p", {
262
+ }), /* @__PURE__ */ y("p", {
252
263
  className: "text-sm text-error",
253
- children: K
264
+ children: G
254
265
  })]
255
266
  }),
256
- N.length === 0 && !P && /* @__PURE__ */ v(ie, {
257
- illustration: z.search || z.type ? "empty-search" : "empty-files",
258
- title: z.search || z.type ? E("notifTemplates.noMatchingTemplates", "No templates match your filters") : E("notifTemplates.noTemplatesYet", "No templates yet. Create your first one!"),
259
- description: z.search || z.type ? E("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : E("notifTemplates.noTemplatesDescription", "Reusable templates let you send consistent notifications fast."),
260
- action: !z.search && !z.type && Q ? /* @__PURE__ */ y(b, {
261
- onClick: () => T(D.newTemplate),
267
+ M.length === 0 && !N && /* @__PURE__ */ y(ie, {
268
+ illustration: R.search || R.type ? "empty-search" : "empty-files",
269
+ title: R.search || R.type ? T("notifTemplates.noMatchingTemplates", "No templates match your filters") : T("notifTemplates.noTemplatesYet", "No templates yet. Create your first one!"),
270
+ description: R.search || R.type ? T("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : T("notifTemplates.noTemplatesDescription", "Reusable templates let you send consistent notifications fast."),
271
+ action: !R.search && !R.type && Q ? /* @__PURE__ */ b(x, {
272
+ onClick: () => w(E.newTemplate),
262
273
  className: "gap-2",
263
- children: [/* @__PURE__ */ v(h, { size: 16 }), E("notifTemplates.createTemplate", "Create Template")]
274
+ children: [/* @__PURE__ */ y(_, { size: 16 }), T("notifTemplates.createTemplate", "Create Template")]
264
275
  }) : void 0,
265
- kind: z.search ? "no-results" : z.type ? "filtered" : "first-use"
276
+ kind: R.search ? "no-results" : R.type ? "filtered" : "first-use"
266
277
  }),
267
- /* @__PURE__ */ v("div", {
278
+ /* @__PURE__ */ y("div", {
268
279
  className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
269
- children: N.map((e) => /* @__PURE__ */ y("div", {
270
- onClick: () => T(D.template(e.slug)),
271
- className: `group relative p-4 bg-gloss-card border rounded-lg cursor-pointer transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 ${J.has(e.id) ? "border-accent-primary/50 ring-1 ring-accent-primary/20" : "border-border-seam"}`,
280
+ children: M.map((e) => /* @__PURE__ */ b("div", {
281
+ onClick: () => w(E.template(e.slug)),
282
+ className: `group relative p-4 bg-gloss-card border rounded-lg cursor-pointer transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 ${q.has(e.id) ? "border-accent-primary/50 ring-1 ring-accent-primary/20" : "border-border-seam"}`,
272
283
  children: [
273
- /* @__PURE__ */ y("div", {
284
+ /* @__PURE__ */ b("div", {
274
285
  className: "flex items-start justify-between mb-3",
275
- children: [/* @__PURE__ */ y("div", {
286
+ children: [/* @__PURE__ */ b("div", {
276
287
  className: "flex items-center gap-2",
277
- children: [/* @__PURE__ */ v("input", {
288
+ children: [/* @__PURE__ */ y("input", {
278
289
  type: "checkbox",
279
- checked: J.has(e.id),
290
+ checked: q.has(e.id),
280
291
  onChange: (t) => {
281
- t.stopPropagation(), pe(e.id, t.target.checked);
292
+ t.stopPropagation(), he(e.id, t.target.checked);
282
293
  },
283
294
  onClick: (e) => e.stopPropagation(),
284
- "aria-label": E("notifTemplates.selectTemplateAria", "Select template {{name}}").replace("{{name}}", e.name),
295
+ "aria-label": T("notifTemplates.selectTemplateAria", "Select template {{name}}").replace("{{name}}", e.name),
285
296
  className: "h-4 w-4 rounded border-default text-accent-primary"
286
- }), /* @__PURE__ */ v(p, {
297
+ }), /* @__PURE__ */ y(g, {
287
298
  size: 20,
288
299
  className: "text-accent-primary"
289
300
  })]
290
- }), /* @__PURE__ */ y("div", {
301
+ }), /* @__PURE__ */ b("div", {
291
302
  className: "flex items-center gap-2",
292
- children: [/* @__PURE__ */ v("span", {
293
- className: `px-2 py-0.5 text-[10px] font-semibold rounded-full border ${S[e.type] || "text-tertiary bg-bg-sunken border-default"}`,
294
- children: E(`notifTemplates.type.${e.type}`, C[e.type] || e.type)
295
- }), $ && /* @__PURE__ */ v("button", {
296
- onClick: (t) => de(t, e),
297
- disabled: F && W === e.id,
303
+ children: [/* @__PURE__ */ y("span", {
304
+ className: `px-2 py-0.5 text-[10px] font-semibold rounded-full border ${ce[e.type] || "text-tertiary bg-bg-sunken border-default"}`,
305
+ children: T(`notifTemplates.type.${e.type}`, le[e.type] || e.type)
306
+ }), $ && /* @__PURE__ */ y("button", {
307
+ onClick: (t) => pe(t, e),
308
+ disabled: P && U === e.id,
298
309
  className: "opacity-0 group-hover:opacity-100 p-1 text-tertiary hover:text-error rounded transition-all duration-150",
299
- title: E("notifTemplates.deleteTemplate", "Delete template"),
300
- children: F && W === e.id ? /* @__PURE__ */ v(m, {
310
+ title: T("notifTemplates.deleteTemplate", "Delete template"),
311
+ children: P && U === e.id ? /* @__PURE__ */ y(d, {
301
312
  size: 14,
302
313
  className: "animate-spin"
303
- }) : /* @__PURE__ */ v(g, { size: 14 })
314
+ }) : /* @__PURE__ */ y(v, { size: 14 })
304
315
  })]
305
316
  })]
306
317
  }),
307
- /* @__PURE__ */ v("h3", {
318
+ /* @__PURE__ */ y("h3", {
308
319
  className: "text-sm font-semibold text-primary mb-1 truncate",
309
320
  children: e.name
310
321
  }),
311
- e.description && /* @__PURE__ */ v("p", {
322
+ e.description && /* @__PURE__ */ y("p", {
312
323
  className: "text-xs text-text-secondary mb-2 line-clamp-2",
313
324
  children: e.description
314
325
  }),
315
- /* @__PURE__ */ y("div", {
326
+ /* @__PURE__ */ b("div", {
316
327
  className: "flex items-center gap-2 text-[11px] text-tertiary mt-auto pt-2 border-t border-default/50",
317
328
  children: [
318
- /* @__PURE__ */ v("code", {
329
+ /* @__PURE__ */ y("code", {
319
330
  className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[10px]",
320
331
  children: e.slug
321
332
  }),
322
- /* @__PURE__ */ v("span", { children: "•" }),
323
- /* @__PURE__ */ v("span", { children: e.locale || "en" }),
324
- /* @__PURE__ */ v("span", { children: "•" }),
325
- /* @__PURE__ */ v("span", {
333
+ /* @__PURE__ */ y("span", { children: "•" }),
334
+ /* @__PURE__ */ y("span", { children: e.locale || "en" }),
335
+ /* @__PURE__ */ y("span", { children: "•" }),
336
+ /* @__PURE__ */ y("span", {
326
337
  className: e.enabled ? "text-success" : "text-tertiary",
327
- children: e.enabled ? E("notifTemplates.enabled", "Enabled") : E("notifTemplates.disabled", "Disabled")
338
+ children: e.enabled ? T("notifTemplates.enabled", "Enabled") : T("notifTemplates.disabled", "Disabled")
328
339
  })
329
340
  ]
330
341
  }),
331
- /* @__PURE__ */ y("p", {
342
+ /* @__PURE__ */ b("p", {
332
343
  className: "text-[10px] text-tertiary mt-1.5",
333
344
  children: [
334
- E("notifTemplates.updated", "Updated"),
345
+ T("notifTemplates.updated", "Updated"),
335
346
  " ",
336
- w(e.updatedAt, ce)
347
+ ue(e.updatedAt, de)
337
348
  ]
338
349
  })
339
350
  ]
340
351
  }, e.id))
341
352
  }),
342
- R && /* @__PURE__ */ v("div", {
353
+ L && /* @__PURE__ */ y("div", {
343
354
  className: "flex justify-center pt-2",
344
- children: /* @__PURE__ */ y("button", {
345
- onClick: V,
346
- disabled: P,
355
+ children: /* @__PURE__ */ b("button", {
356
+ onClick: B,
357
+ disabled: N,
347
358
  className: "flex items-center gap-2 px-4 py-2 text-sm text-text-secondary hover:text-primary border border-default rounded-lg transition-all duration-150 hover:shadow-sm",
348
- children: [P ? /* @__PURE__ */ v(m, {
359
+ children: [N ? /* @__PURE__ */ y(d, {
349
360
  size: 14,
350
361
  className: "animate-spin"
351
- }) : null, E("notifTemplates.loadMore", "Load More")]
362
+ }) : null, T("notifTemplates.loadMore", "Load More")]
352
363
  })
353
364
  }),
354
- O && /* @__PURE__ */ v(o, {
355
- open: k !== null,
356
- title: k?.title ?? "",
357
- description: k?.message ?? "",
358
- confirmLabel: E("notifTemplates.delete", "Delete"),
365
+ D && /* @__PURE__ */ y(o, {
366
+ open: O !== null,
367
+ title: O?.title ?? "",
368
+ description: O?.message ?? "",
369
+ confirmLabel: T("notifTemplates.delete", "Delete"),
359
370
  onCancel: () => {
360
- k?.resolve(!1), A(null);
371
+ O?.resolve(!1), k(null);
361
372
  },
362
373
  onConfirm: () => {
363
- k?.resolve(!0), A(null);
374
+ O?.resolve(!0), k(null);
364
375
  }
365
376
  })
366
377
  ]
367
- }) : /* @__PURE__ */ v("div", {
378
+ }) : /* @__PURE__ */ y("div", {
368
379
  className: "p-8 text-center text-text-secondary",
369
- children: E("notifTemplates.noPermissionView", "You don't have permission to view notification templates.")
380
+ children: T("notifTemplates.noPermissionView", "You don't have permission to view notification templates.")
370
381
  });
371
382
  }
372
- export { T as NotificationTemplatesPage };
383
+ export { w as NotificationTemplatesPage };
373
384
 
374
385
  //# sourceMappingURL=NotificationTemplatesPage.js.map