@burdenoff/microfe-notification 2026.1117.2 → 2026.1119.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 (29) hide show
  1. package/dist/components/NotificationListFooter.d.ts +18 -0
  2. package/dist/components/NotificationListFooter.js +43 -0
  3. package/dist/components/NotificationListFooter.js.map +1 -0
  4. package/dist/hooks/notificationPaging.d.ts +51 -0
  5. package/dist/hooks/notificationPaging.js +43 -0
  6. package/dist/hooks/notificationPaging.js.map +1 -0
  7. package/dist/hooks/useNotifications.d.ts +2 -0
  8. package/dist/hooks/useNotifications.js +177 -129
  9. package/dist/hooks/useNotifications.js.map +1 -1
  10. package/dist/navigation-v2/NotificationArchivedV2.js +98 -91
  11. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
  12. package/dist/navigation-v2/NotificationInboxV2.js +78 -71
  13. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
  14. package/dist/pages/CreateNotificationPage.js +108 -108
  15. package/dist/pages/CreateNotificationPage.js.map +1 -1
  16. package/dist/pages/NotificationCenterPage.js +105 -98
  17. package/dist/pages/NotificationCenterPage.js.map +1 -1
  18. package/dist/pages/NotificationHistoryAdminPage.js +122 -122
  19. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  20. package/dist/pages/NotificationHistoryPage.js +77 -70
  21. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  22. package/dist/pages/NotificationTemplatesPage.js +140 -140
  23. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  24. package/dist/pages/NotificationTopicsPage.js +74 -74
  25. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  26. package/dist/pages/TemplateEditorPage.js +361 -361
  27. package/dist/pages/TemplateEditorPage.js.map +1 -1
  28. package/dist/translations/en.d.ts +3 -0
  29. package/package.json +2 -2
@@ -5,12 +5,12 @@ import { useNotificationAnalytics as i } from "../hooks/useNotificationAnalytics
5
5
  import { TemplatePreview as ee } from "../components/TemplatePreview.js";
6
6
  import { NOTIFICATION_PERMISSIONS as te } from "../constants/permissions.js";
7
7
  import { useTr as ne } from "../shared/hooks/useTr.js";
8
- import { useCallback as a, useEffect as o, useMemo as s, useRef as re, useState as c } from "react";
9
- import { useGlobalUi as ie, usePermissions as ae } from "@burdenoff/fe-libs/shared/providers/shell";
10
- import { AlertCircle as l, ArrowLeft as oe, Code as se, Eye as u, EyeOff as d, Loader2 as f, Plus as ce, Save as p, Trash2 as le, Type as m, Variable as ue } from "lucide-react";
11
- import { useNavigate as de, useParams as fe } from "react-router";
12
- import { Fragment as pe, jsx as h, jsxs as g } from "react/jsx-runtime";
13
- import { Button as me, NextSteps as he, OptionalFields as ge, PagePurpose as _e } from "@burdenoff/fe-libs/ui";
8
+ import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
9
+ import { useGlobalUi as re, usePermissions as ie } from "@burdenoff/fe-libs/shared/providers/shell";
10
+ import { AlertCircle as ae, ArrowLeft as oe, Code as se, Eye as u, EyeOff as d, Loader2 as f, Plus as ce, Save as p, Trash2 as le, Type as ue, Variable as de } from "lucide-react";
11
+ import { useNavigate as fe, useParams as pe } from "react-router";
12
+ import { Fragment as me, jsx as m, jsxs as h } from "react/jsx-runtime";
13
+ import { Button as he, NextSteps as ge, OptionalFields as g, PagePurpose as _e, ThemedSelect as _ } from "@burdenoff/fe-libs/ui";
14
14
  import { useI18n as ve } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
15
  // src/pages/TemplateEditorPage.tsx
16
16
  var ye = [
@@ -92,7 +92,7 @@ var ye = [
92
92
  function Se(e) {
93
93
  return e.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
94
94
  }
95
- function _(e, t, n) {
95
+ function v(e, t, n) {
96
96
  return e ? e.replace(/\{\{(\w+)\}\}/g, (e, r) => {
97
97
  let i = t.find((e) => e.name === r);
98
98
  if (!i) return e;
@@ -117,60 +117,60 @@ function Ce(e) {
117
117
  }
118
118
  return t;
119
119
  }
120
- function v(e) {
120
+ function y(e) {
121
121
  return typeof e == "object" && !!e;
122
122
  }
123
- function y(e) {
123
+ function b(e) {
124
124
  return e ? String(e) : "";
125
125
  }
126
- function b(e) {
126
+ function x(e) {
127
127
  return e === "number" || e === "boolean" || e === "date" ? e : "string";
128
128
  }
129
129
  function we(e) {
130
- return e ? Array.isArray(e) ? e.filter(v).map((e) => ({
130
+ return e ? Array.isArray(e) ? e.filter(y).map((e) => ({
131
131
  name: typeof e.name == "string" ? e.name : "",
132
- type: b(e.type),
133
- defaultValue: y(e.defaultValue)
134
- })) : v(e) ? Object.entries(e).map(([e, t]) => ({
132
+ type: x(e.type),
133
+ defaultValue: b(e.defaultValue)
134
+ })) : y(e) ? Object.entries(e).map(([e, t]) => ({
135
135
  name: e,
136
- type: b(v(t) ? t.type : void 0),
137
- defaultValue: y(v(t) ? t.defaultValue : void 0)
136
+ type: x(y(t) ? t.type : void 0),
137
+ defaultValue: b(y(t) ? t.defaultValue : void 0)
138
138
  })) : [] : [];
139
139
  }
140
- function x() {
141
- let v = de(), y = ne(), { locale: b } = ve(), { templateId: x } = fe(), S = !!x, { hasPermission: Te, isLoading: Ee, refreshPermissions: De } = ae(), { showToast: Oe } = ie(), { createTemplate: ke, updateTemplate: Ae, isCreating: je, isUpdating: Me } = r(), { trackTemplateSaved: C } = i(), { template: w, isLoading: Ne, error: T } = n(S ? x : void 0), [E, D] = c(""), [O, k] = c(""), [A, j] = c(!1), M = e(), [Pe, Fe] = c(!1), [N, P] = c(""), [F, I] = c("TRANSACTIONAL"), [L, Ie] = c(""), [Le, Re] = c("en"), [R, ze] = c(""), [z, B] = c(""), [V, H] = c(""), [U, W] = c([]), [G, K] = c("text"), Be = re(null), Ve = re(null), [He, q] = c(null), [Ue, J] = c(null), [Y, X] = c(!0), [We, Ge] = c("email");
140
+ function S() {
141
+ let y = fe(), b = ne(), { locale: x } = ve(), { templateId: S } = pe(), C = !!S, { hasPermission: Te, isLoading: Ee, refreshPermissions: De } = ie(), { showToast: Oe } = re(), { createTemplate: ke, updateTemplate: Ae, isCreating: je, isUpdating: Me } = r(), { trackTemplateSaved: Ne } = i(), { template: w, isLoading: Pe, error: Fe } = n(C ? S : void 0), [T, Ie] = l(""), [E, D] = l(""), [Le, Re] = l(!1), O = e(), [ze, Be] = l(!1), [k, A] = l(""), [j, M] = l("TRANSACTIONAL"), [N, Ve] = l(""), [P, F] = l("en"), [I, L] = l(""), [R, z] = l(""), [B, V] = l(""), [H, U] = l([]), [W, G] = l("text"), He = c(null), Ue = c(null), [We, K] = l(null), [Ge, q] = l(null), [J, Y] = l(!0), [Ke, qe] = l("email");
142
142
  o(() => {
143
- w && (D(w.name), k(w.slug), j(!0), P(w.description || ""), I(w.type), Re(w.locale || "en"), ze(w.subject || ""), B(w.bodyTemplate || ""), H(w.htmlTemplate || ""), W(we(w.variables)), w.htmlTemplate && K("html"));
143
+ w && (Ie(w.name), D(w.slug), Re(!0), A(w.description || ""), M(w.type), F(w.locale || "en"), L(w.subject || ""), z(w.bodyTemplate || ""), V(w.htmlTemplate || ""), U(we(w.variables)), w.htmlTemplate && G("html"));
144
144
  }, [w]), o(() => {
145
- !A && E && k(Se(E));
146
- }, [E, A]);
147
- let Ke = s(() => _(R, U, b), [
148
- b,
145
+ !Le && T && D(Se(T));
146
+ }, [T, Le]);
147
+ let Je = s(() => v(I, H, x), [
148
+ x,
149
+ I,
150
+ H
151
+ ]), Ye = s(() => v(R, H, x), [
149
152
  R,
150
- U
151
- ]), qe = s(() => _(z, U, b), [
152
- z,
153
- b,
154
- U
155
- ]), Je = s(() => _(V, U, b), [
156
- b,
157
- V,
158
- U
159
- ]), Ye = a(() => {
160
- W((e) => [...e, {
153
+ x,
154
+ H
155
+ ]), Xe = s(() => v(B, H, x), [
156
+ x,
157
+ B,
158
+ H
159
+ ]), Ze = a(() => {
160
+ U((e) => [...e, {
161
161
  name: "",
162
162
  type: "string",
163
163
  defaultValue: ""
164
164
  }]);
165
- }, []), Xe = a((e) => {
166
- W((t) => t.filter((t, n) => n !== e));
167
- }, []), Z = a((e, t, n) => {
168
- W((r) => r.map((r, i) => i === e ? {
165
+ }, []), Qe = a((e) => {
166
+ U((t) => t.filter((t, n) => n !== e));
167
+ }, []), X = a((e, t, n) => {
168
+ U((r) => r.map((r, i) => i === e ? {
169
169
  ...r,
170
170
  [t]: n
171
171
  } : r));
172
- }, []), Ze = a((e) => {
173
- let t = `{{${e}}}`, n = G === "html", r = n ? Ve.current : Be.current, i = n ? H : B;
172
+ }, []), $e = a((e) => {
173
+ let t = `{{${e}}}`, n = W === "html", r = n ? Ue.current : He.current, i = n ? V : z;
174
174
  if (r) {
175
175
  let e = r.selectionStart, n = r.selectionEnd;
176
176
  i((r) => r.substring(0, e) + t + r.substring(n)), requestAnimationFrame(() => {
@@ -179,688 +179,688 @@ function x() {
179
179
  r.selectionStart = n, r.selectionEnd = n;
180
180
  });
181
181
  } else i((e) => e + t);
182
- }, [G]), Q = async (e) => {
183
- if (e?.preventDefault(), q(null), J(null), !E.trim()) {
184
- q(y("notifTemplates.nameRequired", "Template name is required"));
182
+ }, [W]), Z = async (e) => {
183
+ if (e?.preventDefault(), K(null), q(null), !T.trim()) {
184
+ K(b("notifTemplates.nameRequired", "Template name is required"));
185
185
  return;
186
186
  }
187
- if (!O.trim()) {
188
- q(y("notifTemplates.slugRequired", "Template slug is required"));
187
+ if (!E.trim()) {
188
+ K(b("notifTemplates.slugRequired", "Template slug is required"));
189
189
  return;
190
190
  }
191
- if (!z.trim()) {
192
- q(y("notifTemplates.bodyRequired", "Body template is required"));
191
+ if (!R.trim()) {
192
+ K(b("notifTemplates.bodyRequired", "Body template is required"));
193
193
  return;
194
194
  }
195
- if (U.filter((e) => !e.name.trim()).length > 0) {
196
- q(y("notifTemplates.variablesNeedName", "All variables must have a name"));
195
+ if (H.filter((e) => !e.name.trim()).length > 0) {
196
+ K(b("notifTemplates.variablesNeedName", "All variables must have a name"));
197
197
  return;
198
198
  }
199
- let n = U.map((e) => e.name.trim()), r = n.filter((e, t) => n.indexOf(e) !== t);
200
- if (r.length > 0) q(`${y("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
199
+ let n = H.map((e) => e.name.trim()), r = n.filter((e, t) => n.indexOf(e) !== t);
200
+ if (r.length > 0) K(`${b("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
201
201
  else try {
202
- if (S && w) {
202
+ if (C && w) {
203
203
  let e = {
204
- name: E.trim(),
205
- description: N.trim() || void 0,
206
- subject: R.trim() || void 0,
207
- bodyTemplate: z.trim(),
208
- htmlTemplate: V.trim() || void 0,
209
- variables: Ce(U)
204
+ name: T.trim(),
205
+ description: k.trim() || void 0,
206
+ subject: I.trim() || void 0,
207
+ bodyTemplate: R.trim(),
208
+ htmlTemplate: B.trim() || void 0,
209
+ variables: Ce(H)
210
210
  };
211
- await Ae(w.id, e), C({
211
+ await Ae(w.id, e), Ne({
212
212
  action: "update",
213
- channel: L || void 0,
213
+ channel: N || void 0,
214
214
  type: w.type,
215
- variableCount: U.length,
216
- hasHtml: !!V.trim()
217
- }), J(y("notifTemplates.updateSuccess", "Template updated successfully"));
215
+ variableCount: H.length,
216
+ hasHtml: !!B.trim()
217
+ }), q(b("notifTemplates.updateSuccess", "Template updated successfully"));
218
218
  } else {
219
219
  let e = {
220
- slug: O.trim(),
221
- name: E.trim(),
222
- description: N.trim() || void 0,
223
- type: F,
224
- locale: Le || "en",
225
- subject: R.trim() || void 0,
226
- bodyTemplate: z.trim(),
227
- htmlTemplate: V.trim() || void 0,
228
- variables: Ce(U),
229
- ...L ? { channel: L } : {}
220
+ slug: E.trim(),
221
+ name: T.trim(),
222
+ description: k.trim() || void 0,
223
+ type: j,
224
+ locale: P || "en",
225
+ subject: I.trim() || void 0,
226
+ bodyTemplate: R.trim(),
227
+ htmlTemplate: B.trim() || void 0,
228
+ variables: Ce(H),
229
+ ...N ? { channel: N } : {}
230
230
  };
231
- await ke(e), C({
231
+ await ke(e), Ne({
232
232
  action: "create",
233
- channel: L || void 0,
234
- type: F,
235
- variableCount: U.length,
236
- hasHtml: !!V.trim()
237
- }), J(y("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => v("..", { relative: "path" }), 1200);
233
+ channel: N || void 0,
234
+ type: j,
235
+ variableCount: H.length,
236
+ hasHtml: !!B.trim()
237
+ }), q(b("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => y("..", { relative: "path" }), 1200);
238
238
  }
239
239
  } catch (e) {
240
240
  if (t(e)) {
241
- Oe(y("notifTemplates.permissionDeniedOnSave", "You don't have permission to save this template. Refreshing access…"), "warning"), De().catch((e) => console.warn("[permissions] refresh failed after template save denial:", e));
241
+ Oe(b("notifTemplates.permissionDeniedOnSave", "You don't have permission to save this template. Refreshing access…"), "warning"), De().catch((e) => console.warn("[permissions] refresh failed after template save denial:", e));
242
242
  return;
243
243
  }
244
- let n = e instanceof Error ? e.message : y("notifTemplates.saveFailed", "Failed to save template");
245
- q(n);
244
+ let n = e instanceof Error ? e.message : b("notifTemplates.saveFailed", "Failed to save template");
245
+ K(n);
246
246
  }
247
247
  };
248
- if (Ee) return /* @__PURE__ */ h("div", {
248
+ if (Ee) return /* @__PURE__ */ m("div", {
249
249
  className: "flex h-64 items-center justify-center",
250
- children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
250
+ children: /* @__PURE__ */ m("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
251
251
  });
252
- if (!Te(S ? te.TEMPLATE_UPDATE : te.TEMPLATE_CREATE)) return /* @__PURE__ */ h("div", {
252
+ if (!Te(C ? te.TEMPLATE_UPDATE : te.TEMPLATE_CREATE)) return /* @__PURE__ */ m("div", {
253
253
  className: "p-8 text-center text-text-secondary",
254
- children: S ? y("notifTemplates.noPermissionEdit", "You don't have permission to edit notification templates.") : y("notifTemplates.noPermissionCreate", "You don't have permission to create notification templates.")
254
+ children: C ? b("notifTemplates.noPermissionEdit", "You don't have permission to edit notification templates.") : b("notifTemplates.noPermissionCreate", "You don't have permission to create notification templates.")
255
255
  });
256
- if (S && Ne) return /* @__PURE__ */ g("div", {
256
+ if (C && Pe) return /* @__PURE__ */ h("div", {
257
257
  className: "flex flex-col items-center justify-center h-64 gap-3",
258
- children: [/* @__PURE__ */ h(f, {
258
+ children: [/* @__PURE__ */ m(f, {
259
259
  size: 28,
260
260
  className: "animate-spin text-accent-primary"
261
- }), /* @__PURE__ */ h("p", {
261
+ }), /* @__PURE__ */ m("p", {
262
262
  className: "text-sm text-text-secondary",
263
- children: y("notifTemplates.loadingTemplate", "Loading template...")
263
+ children: b("notifTemplates.loadingTemplate", "Loading template...")
264
264
  })]
265
265
  });
266
- if (S && T) return /* @__PURE__ */ g("div", {
266
+ if (C && Fe) return /* @__PURE__ */ h("div", {
267
267
  className: "flex flex-col items-center justify-center h-64 gap-4",
268
268
  children: [
269
- /* @__PURE__ */ h(l, {
269
+ /* @__PURE__ */ m(ae, {
270
270
  size: 28,
271
271
  className: "text-error"
272
272
  }),
273
- /* @__PURE__ */ h("p", {
273
+ /* @__PURE__ */ m("p", {
274
274
  className: "text-sm text-error",
275
- children: T
275
+ children: Fe
276
276
  }),
277
- /* @__PURE__ */ h("button", {
278
- onClick: () => v("..", { relative: "path" }),
277
+ /* @__PURE__ */ m("button", {
278
+ onClick: () => y("..", { relative: "path" }),
279
279
  className: "px-4 py-2 text-sm text-text-secondary hover:text-primary border border-default rounded-lg transition-all",
280
- children: y("notifTemplates.backToTemplates", "Back to Templates")
280
+ children: b("notifTemplates.backToTemplates", "Back to Templates")
281
281
  })
282
282
  ]
283
283
  });
284
- let $ = je || Me, Qe = /* @__PURE__ */ h(pe, { children: /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
284
+ let Q = je || Me, et = /* @__PURE__ */ m(me, { children: /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
285
285
  className: "block text-sm font-medium text-primary mb-1.5",
286
- children: y("notifTemplates.descriptionLabel", "Description")
287
- }), /* @__PURE__ */ h("textarea", {
288
- value: N,
289
- onChange: (e) => P(e.target.value),
286
+ children: b("notifTemplates.descriptionLabel", "Description")
287
+ }), /* @__PURE__ */ m("textarea", {
288
+ value: k,
289
+ onChange: (e) => A(e.target.value),
290
290
  rows: 2,
291
- placeholder: y("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
291
+ placeholder: b("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
292
292
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 resize-none"
293
- })] }) }), $e = /* @__PURE__ */ g(pe, { children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
293
+ })] }) }), tt = /* @__PURE__ */ h(me, { children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
294
294
  className: "block text-sm font-medium text-primary mb-1.5",
295
- children: y("notifTemplates.defaultChannel", "Default Channel")
296
- }), /* @__PURE__ */ g("select", {
297
- "aria-label": y("notifTemplates.defaultChannel", "Default Channel"),
298
- value: L,
299
- onChange: (e) => Ie(e.target.value),
300
- disabled: S,
295
+ children: b("notifTemplates.defaultChannel", "Default Channel")
296
+ }), /* @__PURE__ */ h(_, {
297
+ "aria-label": b("notifTemplates.defaultChannel", "Default Channel"),
298
+ value: N,
299
+ onChange: (e) => Ve(e.target.value),
300
+ disabled: C,
301
301
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 disabled:opacity-60 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
302
- children: [/* @__PURE__ */ h("option", {
302
+ children: [/* @__PURE__ */ m("option", {
303
303
  value: "",
304
- children: y("notifTemplates.none", "None")
305
- }), be.map((e) => /* @__PURE__ */ h("option", {
304
+ children: b("notifTemplates.none", "None")
305
+ }), be.map((e) => /* @__PURE__ */ m("option", {
306
306
  value: e.value,
307
- children: y(`notifTemplates.channel.${e.value}`, e.label)
307
+ children: b(`notifTemplates.channel.${e.value}`, e.label)
308
308
  }, e.value))]
309
- })] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
309
+ })] }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
310
310
  className: "block text-sm font-medium text-primary mb-1.5",
311
- children: y("notifTemplates.localeLabel", "Locale")
312
- }), /* @__PURE__ */ h("input", {
311
+ children: b("notifTemplates.localeLabel", "Locale")
312
+ }), /* @__PURE__ */ m("input", {
313
313
  type: "text",
314
- "aria-label": y("notifTemplates.localeLabel", "Locale"),
315
- value: Le,
316
- onChange: (e) => Re(e.target.value),
314
+ "aria-label": b("notifTemplates.localeLabel", "Locale"),
315
+ value: P,
316
+ onChange: (e) => F(e.target.value),
317
317
  placeholder: "en",
318
- disabled: S,
318
+ disabled: C,
319
319
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono disabled:opacity-60"
320
- })] })] }), et = w ? /* @__PURE__ */ g("div", {
320
+ })] })] }), $ = w ? /* @__PURE__ */ h("div", {
321
321
  className: "text-[11px] text-tertiary space-y-1",
322
322
  children: [
323
- /* @__PURE__ */ g("p", { children: [
324
- /* @__PURE__ */ g("span", {
323
+ /* @__PURE__ */ h("p", { children: [
324
+ /* @__PURE__ */ h("span", {
325
325
  className: "font-medium",
326
- children: [y("notifTemplates.metaId", "ID"), ":"]
326
+ children: [b("notifTemplates.metaId", "ID"), ":"]
327
327
  }),
328
328
  " ",
329
- /* @__PURE__ */ h("code", {
329
+ /* @__PURE__ */ m("code", {
330
330
  className: "text-[10px]",
331
331
  children: w.id
332
332
  })
333
333
  ] }),
334
- /* @__PURE__ */ g("p", { children: [
335
- /* @__PURE__ */ g("span", {
334
+ /* @__PURE__ */ h("p", { children: [
335
+ /* @__PURE__ */ h("span", {
336
336
  className: "font-medium",
337
- children: [y("notifTemplates.metaVersion", "Version"), ":"]
337
+ children: [b("notifTemplates.metaVersion", "Version"), ":"]
338
338
  }),
339
339
  " ",
340
340
  w.version
341
341
  ] }),
342
- /* @__PURE__ */ g("p", { children: [
343
- /* @__PURE__ */ g("span", {
342
+ /* @__PURE__ */ h("p", { children: [
343
+ /* @__PURE__ */ h("span", {
344
344
  className: "font-medium",
345
- children: [y("notifTemplates.metaCreated", "Created"), ":"]
345
+ children: [b("notifTemplates.metaCreated", "Created"), ":"]
346
346
  }),
347
347
  " ",
348
- new Date(w.createdAt).toLocaleString(b || "en-US")
348
+ new Date(w.createdAt).toLocaleString(x || "en-US")
349
349
  ] }),
350
- /* @__PURE__ */ g("p", { children: [
351
- /* @__PURE__ */ g("span", {
350
+ /* @__PURE__ */ h("p", { children: [
351
+ /* @__PURE__ */ h("span", {
352
352
  className: "font-medium",
353
- children: [y("notifTemplates.metaUpdated", "Updated"), ":"]
353
+ children: [b("notifTemplates.metaUpdated", "Updated"), ":"]
354
354
  }),
355
355
  " ",
356
- new Date(w.updatedAt).toLocaleString(b || "en-US")
356
+ new Date(w.updatedAt).toLocaleString(x || "en-US")
357
357
  ] }),
358
- /* @__PURE__ */ g("p", { children: [
359
- /* @__PURE__ */ g("span", {
358
+ /* @__PURE__ */ h("p", { children: [
359
+ /* @__PURE__ */ h("span", {
360
360
  className: "font-medium",
361
- children: [y("notifTemplates.metaEnabled", "Enabled"), ":"]
361
+ children: [b("notifTemplates.metaEnabled", "Enabled"), ":"]
362
362
  }),
363
363
  " ",
364
- w.enabled ? y("notifTemplates.yes", "Yes") : y("notifTemplates.no", "No")
364
+ w.enabled ? b("notifTemplates.yes", "Yes") : b("notifTemplates.no", "No")
365
365
  ] })
366
366
  ]
367
367
  }) : null;
368
- return /* @__PURE__ */ g("div", {
368
+ return /* @__PURE__ */ h("div", {
369
369
  className: "animate-in fade-in duration-200 h-full flex flex-col",
370
370
  children: [
371
- /* @__PURE__ */ g("div", {
371
+ /* @__PURE__ */ h("div", {
372
372
  className: "flex items-center justify-between gap-3 p-3 sm:px-6 sm:py-4 border-b border-border-seam bg-surface/50 shrink-0",
373
- children: [/* @__PURE__ */ g("div", {
373
+ children: [/* @__PURE__ */ h("div", {
374
374
  className: "flex items-center gap-3",
375
- children: [/* @__PURE__ */ h("button", {
376
- onClick: () => v("..", { relative: "path" }),
375
+ children: [/* @__PURE__ */ m("button", {
376
+ onClick: () => y("..", { relative: "path" }),
377
377
  className: "p-2 hover:bg-bg-sunken rounded-lg transition-all duration-150",
378
- children: /* @__PURE__ */ h(oe, {
378
+ children: /* @__PURE__ */ m(oe, {
379
379
  size: 20,
380
380
  className: "text-primary"
381
381
  })
382
- }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
382
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
383
383
  className: "text-lg font-bold text-primary",
384
- children: S ? y("notifTemplates.editTemplate", "Edit Template") : y("notifTemplates.createTemplate", "Create Template")
385
- }), S && w && /* @__PURE__ */ g("p", {
384
+ children: C ? b("notifTemplates.editTemplate", "Edit Template") : b("notifTemplates.createTemplate", "Create Template")
385
+ }), C && w && /* @__PURE__ */ h("p", {
386
386
  className: "text-xs text-tertiary",
387
387
  children: [
388
- /* @__PURE__ */ h("code", { children: w.slug }),
388
+ /* @__PURE__ */ m("code", { children: w.slug }),
389
389
  " · v",
390
390
  w.version
391
391
  ]
392
392
  })] })]
393
- }), /* @__PURE__ */ g(me, {
394
- onClick: Q,
395
- disabled: $,
393
+ }), /* @__PURE__ */ h(he, {
394
+ onClick: Z,
395
+ disabled: Q,
396
396
  className: "gap-2",
397
- children: [$ ? /* @__PURE__ */ h(f, {
397
+ children: [Q ? /* @__PURE__ */ m(f, {
398
398
  size: 16,
399
399
  className: "animate-spin"
400
- }) : /* @__PURE__ */ h(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
400
+ }) : /* @__PURE__ */ m(p, { size: 16 }), C ? b("notifTemplates.saveChanges", "Save Changes") : b("notifTemplates.createTemplate", "Create Template")]
401
401
  })]
402
402
  }),
403
- He && /* @__PURE__ */ g("div", {
403
+ We && /* @__PURE__ */ h("div", {
404
404
  className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
405
- children: [/* @__PURE__ */ h(l, {
405
+ children: [/* @__PURE__ */ m(ae, {
406
406
  size: 16,
407
407
  className: "text-error shrink-0"
408
- }), /* @__PURE__ */ h("p", {
408
+ }), /* @__PURE__ */ m("p", {
409
409
  className: "text-sm text-error",
410
- children: He
410
+ children: We
411
411
  })]
412
412
  }),
413
- Ue && /* @__PURE__ */ g("div", {
413
+ Ge && /* @__PURE__ */ h("div", {
414
414
  className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-success/10 border border-success/30 rounded-lg",
415
- children: [/* @__PURE__ */ h(p, {
415
+ children: [/* @__PURE__ */ m(p, {
416
416
  size: 16,
417
417
  className: "text-success shrink-0"
418
- }), /* @__PURE__ */ h("p", {
418
+ }), /* @__PURE__ */ m("p", {
419
419
  className: "text-sm text-success",
420
- children: Ue
420
+ children: Ge
421
421
  })]
422
422
  }),
423
- /* @__PURE__ */ g("div", {
423
+ /* @__PURE__ */ h("div", {
424
424
  className: "px-3 sm:px-6 pt-3 space-y-3 shrink-0",
425
- children: [/* @__PURE__ */ h(_e, {
426
- icon: /* @__PURE__ */ h(m, { size: 16 }),
427
- children: y("notifTemplates.editorPurpose", S ? "Refine this template’s content and {{variables}} placeholders. Switch the live preview between email, SMS and push to see how the same template renders per channel, then save a new version — existing scheduled sends keep using the version they were created with." : "Build a reusable message blueprint: write the subject and body with {{variables}} that get filled in at send time, define each variable with a type and default, and watch the live preview render it per channel. Once saved, anyone can pick this template from the Send page.")
428
- }), /* @__PURE__ */ h(he, {
425
+ children: [/* @__PURE__ */ m(_e, {
426
+ icon: /* @__PURE__ */ m(ue, { size: 16 }),
427
+ children: b("notifTemplates.editorPurpose", C ? "Refine this template’s content and {{variables}} placeholders. Switch the live preview between email, SMS and push to see how the same template renders per channel, then save a new version — existing scheduled sends keep using the version they were created with." : "Build a reusable message blueprint: write the subject and body with {{variables}} that get filled in at send time, define each variable with a type and default, and watch the live preview render it per channel. Once saved, anyone can pick this template from the Send page.")
428
+ }), /* @__PURE__ */ m(ge, {
429
429
  storageKey: "notification-template-editor",
430
430
  steps: [
431
431
  {
432
432
  id: "add-variable",
433
- label: y("notifTemplates.nextAddVarLabel", "Add a variable"),
434
- description: y("notifTemplates.nextAddVarDesc", "Define a {{placeholder}} (e.g. userName) so the same template personalises every send."),
435
- onClick: Ye
433
+ label: b("notifTemplates.nextAddVarLabel", "Add a variable"),
434
+ description: b("notifTemplates.nextAddVarDesc", "Define a {{placeholder}} (e.g. userName) so the same template personalises every send."),
435
+ onClick: Ze
436
436
  },
437
437
  {
438
438
  id: "preview-channel",
439
- label: y("notifTemplates.nextPreviewLabel", "Preview each channel"),
440
- description: y("notifTemplates.nextPreviewDesc", "Flip the live preview to SMS or push to confirm the template reads well everywhere."),
439
+ label: b("notifTemplates.nextPreviewLabel", "Preview each channel"),
440
+ description: b("notifTemplates.nextPreviewDesc", "Flip the live preview to SMS or push to confirm the template reads well everywhere."),
441
441
  onClick: () => {
442
- X(!0), Ge("sms");
442
+ Y(!0), qe("sms");
443
443
  }
444
444
  },
445
445
  {
446
446
  id: "save",
447
- label: S ? y("notifTemplates.nextSaveLabel", "Save your changes") : y("notifTemplates.nextCreateLabel", "Create the template"),
448
- description: y("notifTemplates.nextSaveDesc", "Persist the template so it becomes selectable on the Send page."),
449
- onClick: () => Q()
447
+ label: C ? b("notifTemplates.nextSaveLabel", "Save your changes") : b("notifTemplates.nextCreateLabel", "Create the template"),
448
+ description: b("notifTemplates.nextSaveDesc", "Persist the template so it becomes selectable on the Send page."),
449
+ onClick: () => Z()
450
450
  }
451
451
  ]
452
452
  })]
453
453
  }),
454
- /* @__PURE__ */ g("div", {
454
+ /* @__PURE__ */ h("div", {
455
455
  className: "flex-1 overflow-hidden flex flex-col lg:flex-row",
456
- children: [/* @__PURE__ */ h("div", {
456
+ children: [/* @__PURE__ */ m("div", {
457
457
  className: "flex-1 overflow-y-auto p-3 sm:p-5 lg:border-r lg:border-border-seam",
458
- children: /* @__PURE__ */ g("form", {
459
- onSubmit: Q,
458
+ children: /* @__PURE__ */ h("form", {
459
+ onSubmit: Z,
460
460
  className: "space-y-5",
461
461
  children: [
462
- /* @__PURE__ */ g("section", {
462
+ /* @__PURE__ */ h("section", {
463
463
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
464
464
  children: [
465
- /* @__PURE__ */ h("h2", {
465
+ /* @__PURE__ */ m("h2", {
466
466
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
467
- children: y("notifTemplates.basicInformation", "Basic Information")
467
+ children: b("notifTemplates.basicInformation", "Basic Information")
468
468
  }),
469
- /* @__PURE__ */ g("div", {
469
+ /* @__PURE__ */ h("div", {
470
470
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
471
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
471
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
472
472
  className: "block text-sm font-medium text-primary mb-1.5",
473
473
  children: [
474
- y("notifTemplates.nameLabel", "Name"),
474
+ b("notifTemplates.nameLabel", "Name"),
475
475
  " ",
476
- /* @__PURE__ */ h("span", {
476
+ /* @__PURE__ */ m("span", {
477
477
  className: "text-error",
478
478
  children: "*"
479
479
  })
480
480
  ]
481
- }), /* @__PURE__ */ h("input", {
481
+ }), /* @__PURE__ */ m("input", {
482
482
  type: "text",
483
- value: E,
484
- onChange: (e) => D(e.target.value),
485
- placeholder: y("notifTemplates.namePlaceholder", "e.g., Welcome Email"),
483
+ value: T,
484
+ onChange: (e) => Ie(e.target.value),
485
+ placeholder: b("notifTemplates.namePlaceholder", "e.g., Welcome Email"),
486
486
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150"
487
- })] }), /* @__PURE__ */ g("div", { children: [
488
- /* @__PURE__ */ g("label", {
487
+ })] }), /* @__PURE__ */ h("div", { children: [
488
+ /* @__PURE__ */ h("label", {
489
489
  className: "block text-sm font-medium text-primary mb-1.5",
490
490
  children: [
491
- y("notifTemplates.slugLabel", "Slug"),
491
+ b("notifTemplates.slugLabel", "Slug"),
492
492
  " ",
493
- /* @__PURE__ */ h("span", {
493
+ /* @__PURE__ */ m("span", {
494
494
  className: "text-error",
495
495
  children: "*"
496
496
  })
497
497
  ]
498
498
  }),
499
- M && !Pe ? /* @__PURE__ */ g("div", {
499
+ O && !ze ? /* @__PURE__ */ h("div", {
500
500
  className: "flex min-h-9 items-center gap-2",
501
- children: [/* @__PURE__ */ h("code", {
501
+ children: [/* @__PURE__ */ m("code", {
502
502
  className: "truncate font-mono text-sm text-text-primary",
503
- children: O || "—"
504
- }), !S && /* @__PURE__ */ h("button", {
503
+ children: E || "—"
504
+ }), !C && /* @__PURE__ */ m("button", {
505
505
  type: "button",
506
- onClick: () => Fe(!0),
506
+ onClick: () => Be(!0),
507
507
  className: "text-sm font-medium text-accent-primary hover:underline",
508
- children: y("notifTemplates.editSlug", "Edit")
508
+ children: b("notifTemplates.editSlug", "Edit")
509
509
  })]
510
- }) : /* @__PURE__ */ h("input", {
510
+ }) : /* @__PURE__ */ m("input", {
511
511
  type: "text",
512
- value: O,
512
+ value: E,
513
513
  onChange: (e) => {
514
- k(e.target.value), j(!0);
514
+ D(e.target.value), Re(!0);
515
515
  },
516
- placeholder: y("notifTemplates.slugPlaceholder", "e.g., welcome-email"),
517
- disabled: S,
516
+ placeholder: b("notifTemplates.slugPlaceholder", "e.g., welcome-email"),
517
+ disabled: C,
518
518
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono disabled:opacity-60 disabled:cursor-not-allowed"
519
519
  }),
520
- !S && /* @__PURE__ */ h("p", {
520
+ !C && /* @__PURE__ */ m("p", {
521
521
  className: "mt-1 text-[11px] text-tertiary",
522
- children: y("notifTemplates.autoGeneratedFromName", "Auto-generated from name.")
522
+ children: b("notifTemplates.autoGeneratedFromName", "Auto-generated from name.")
523
523
  })
524
524
  ] })]
525
525
  }),
526
- !M && Qe,
527
- /* @__PURE__ */ g("div", {
528
- className: `grid grid-cols-1 gap-4 ${M ? "sm:grid-cols-2" : "sm:grid-cols-3"}`,
529
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
526
+ !O && et,
527
+ /* @__PURE__ */ h("div", {
528
+ className: `grid grid-cols-1 gap-4 ${O ? "sm:grid-cols-2" : "sm:grid-cols-3"}`,
529
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
530
530
  className: "block text-sm font-medium text-primary mb-1.5",
531
531
  children: [
532
- y("notifTemplates.typeLabel", "Type"),
532
+ b("notifTemplates.typeLabel", "Type"),
533
533
  " ",
534
- /* @__PURE__ */ h("span", {
534
+ /* @__PURE__ */ m("span", {
535
535
  className: "text-error",
536
536
  children: "*"
537
537
  })
538
538
  ]
539
- }), /* @__PURE__ */ h("select", {
540
- value: F,
541
- onChange: (e) => I(e.target.value),
542
- disabled: S,
539
+ }), /* @__PURE__ */ m(_, {
540
+ value: j,
541
+ onChange: (e) => M(e.target.value),
542
+ disabled: C,
543
543
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 disabled:opacity-60 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
544
- children: ye.map((e) => /* @__PURE__ */ h("option", {
544
+ children: ye.map((e) => /* @__PURE__ */ m("option", {
545
545
  value: e.value,
546
- children: y(`notifTemplates.type.${e.value}`, e.label)
546
+ children: b(`notifTemplates.type.${e.value}`, e.label)
547
547
  }, e.value))
548
- })] }), !M && $e]
548
+ })] }), !O && tt]
549
549
  })
550
550
  ]
551
551
  }),
552
- M && /* @__PURE__ */ h(ge, {
552
+ O && /* @__PURE__ */ m(g, {
553
553
  storageKey: "notifications.templateEditor.more",
554
- children: /* @__PURE__ */ g("div", {
554
+ children: /* @__PURE__ */ h("div", {
555
555
  className: "space-y-4",
556
- children: [Qe, /* @__PURE__ */ h("div", {
556
+ children: [et, /* @__PURE__ */ m("div", {
557
557
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
558
- children: $e
558
+ children: tt
559
559
  })]
560
560
  })
561
561
  }),
562
- /* @__PURE__ */ g("section", {
562
+ /* @__PURE__ */ h("section", {
563
563
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
564
564
  children: [
565
- /* @__PURE__ */ g("div", {
565
+ /* @__PURE__ */ h("div", {
566
566
  className: "flex items-center justify-between",
567
- children: [/* @__PURE__ */ h("h2", {
567
+ children: [/* @__PURE__ */ m("h2", {
568
568
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
569
- children: y("notifTemplates.templateContent", "Template Content")
570
- }), /* @__PURE__ */ g("div", {
569
+ children: b("notifTemplates.templateContent", "Template Content")
570
+ }), /* @__PURE__ */ h("div", {
571
571
  className: "flex items-center bg-bg-sunken rounded-lg p-0.5",
572
- children: [/* @__PURE__ */ g("button", {
572
+ children: [/* @__PURE__ */ h("button", {
573
573
  type: "button",
574
- onClick: () => K("text"),
575
- className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${G === "text" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
576
- children: [/* @__PURE__ */ h(m, { size: 12 }), y("notifTemplates.contentMode.text", "Text")]
577
- }), /* @__PURE__ */ g("button", {
574
+ onClick: () => G("text"),
575
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${W === "text" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
576
+ children: [/* @__PURE__ */ m(ue, { size: 12 }), b("notifTemplates.contentMode.text", "Text")]
577
+ }), /* @__PURE__ */ h("button", {
578
578
  type: "button",
579
- onClick: () => K("html"),
580
- className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${G === "html" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
581
- children: [/* @__PURE__ */ h(se, { size: 12 }), y("notifTemplates.contentMode.html", "HTML")]
579
+ onClick: () => G("html"),
580
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${W === "html" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
581
+ children: [/* @__PURE__ */ m(se, { size: 12 }), b("notifTemplates.contentMode.html", "HTML")]
582
582
  })]
583
583
  })]
584
584
  }),
585
- /* @__PURE__ */ g("div", { children: [
586
- /* @__PURE__ */ h("label", {
585
+ /* @__PURE__ */ h("div", { children: [
586
+ /* @__PURE__ */ m("label", {
587
587
  className: "block text-sm font-medium text-primary mb-1.5",
588
- children: y("notifTemplates.subjectLabel", "Subject")
588
+ children: b("notifTemplates.subjectLabel", "Subject")
589
589
  }),
590
- /* @__PURE__ */ h("input", {
590
+ /* @__PURE__ */ m("input", {
591
591
  type: "text",
592
- value: R,
593
- onChange: (e) => ze(e.target.value),
594
- placeholder: y("notifTemplates.subjectPlaceholder", "e.g., Welcome to {{appName}}, {{userName}}!"),
592
+ value: I,
593
+ onChange: (e) => L(e.target.value),
594
+ placeholder: b("notifTemplates.subjectPlaceholder", "e.g., Welcome to {{appName}}, {{userName}}!"),
595
595
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono"
596
596
  }),
597
- /* @__PURE__ */ h("p", {
597
+ /* @__PURE__ */ m("p", {
598
598
  className: "mt-1 text-[11px] text-tertiary",
599
- children: y("notifTemplates.subjectHint", "Used for email subject lines. Supports {{variables}}.")
599
+ children: b("notifTemplates.subjectHint", "Used for email subject lines. Supports {{variables}}.")
600
600
  })
601
601
  ] }),
602
- G === "text" && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
602
+ W === "text" && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
603
603
  className: "block text-sm font-medium text-primary mb-1.5",
604
604
  children: [
605
- y("notifTemplates.bodyTemplateLabel", "Body Template"),
605
+ b("notifTemplates.bodyTemplateLabel", "Body Template"),
606
606
  " ",
607
- /* @__PURE__ */ h("span", {
607
+ /* @__PURE__ */ m("span", {
608
608
  className: "text-error",
609
609
  children: "*"
610
610
  })
611
611
  ]
612
- }), /* @__PURE__ */ h("textarea", {
613
- ref: Be,
614
- value: z,
615
- onChange: (e) => B(e.target.value),
612
+ }), /* @__PURE__ */ m("textarea", {
613
+ ref: He,
614
+ value: R,
615
+ onChange: (e) => z(e.target.value),
616
616
  rows: 8,
617
- placeholder: y("notifTemplates.bodyPlaceholder", "Hello {{userName}},\n\nWelcome to {{appName}}! Your account has been created.\n\nBest regards,\nThe Team"),
617
+ placeholder: b("notifTemplates.bodyPlaceholder", "Hello {{userName}},\n\nWelcome to {{appName}}! Your account has been created.\n\nBest regards,\nThe Team"),
618
618
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono resize-y"
619
619
  })] }),
620
- G === "html" && /* @__PURE__ */ g("div", { children: [
621
- /* @__PURE__ */ h("label", {
620
+ W === "html" && /* @__PURE__ */ h("div", { children: [
621
+ /* @__PURE__ */ m("label", {
622
622
  className: "block text-sm font-medium text-primary mb-1.5",
623
- children: y("notifTemplates.htmlTemplateLabel", "HTML Template")
623
+ children: b("notifTemplates.htmlTemplateLabel", "HTML Template")
624
624
  }),
625
- /* @__PURE__ */ h("textarea", {
626
- ref: Ve,
627
- value: V,
628
- onChange: (e) => H(e.target.value),
625
+ /* @__PURE__ */ m("textarea", {
626
+ ref: Ue,
627
+ value: B,
628
+ onChange: (e) => V(e.target.value),
629
629
  rows: 12,
630
- placeholder: y("notifTemplates.htmlPlaceholder", "<div style=\"font-family: sans-serif; max-width: 600px; margin: 0 auto;\">\n <h1>Welcome, {{userName}}!</h1>\n <p>Thank you for joining {{appName}}.</p>\n</div>"),
630
+ placeholder: b("notifTemplates.htmlPlaceholder", "<div style=\"font-family: sans-serif; max-width: 600px; margin: 0 auto;\">\n <h1>Welcome, {{userName}}!</h1>\n <p>Thank you for joining {{appName}}.</p>\n</div>"),
631
631
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono resize-y"
632
632
  }),
633
- /* @__PURE__ */ h("p", {
633
+ /* @__PURE__ */ m("p", {
634
634
  className: "mt-1 text-[11px] text-tertiary",
635
- children: y("notifTemplates.htmlHint", "HTML content for email. Falls back to text body if not provided.")
635
+ children: b("notifTemplates.htmlHint", "HTML content for email. Falls back to text body if not provided.")
636
636
  })
637
637
  ] }),
638
- U.length > 0 && /* @__PURE__ */ g("div", {
638
+ H.length > 0 && /* @__PURE__ */ h("div", {
639
639
  className: "flex items-center gap-2 flex-wrap",
640
- children: [/* @__PURE__ */ g("span", {
640
+ children: [/* @__PURE__ */ h("span", {
641
641
  className: "text-[11px] text-tertiary font-medium",
642
- children: [y("notifTemplates.insert", "Insert"), ":"]
643
- }), U.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ h("button", {
642
+ children: [b("notifTemplates.insert", "Insert"), ":"]
643
+ }), H.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ m("button", {
644
644
  type: "button",
645
- onClick: () => Ze(e.name),
645
+ onClick: () => $e(e.name),
646
646
  className: "px-2 py-1 text-[11px] font-mono text-primary bg-bg-sunken border border-default rounded hover:bg-bg-sunken/80 transition-colors",
647
647
  children: `{{${e.name}}}`
648
648
  }, t))]
649
649
  })
650
650
  ]
651
651
  }),
652
- /* @__PURE__ */ g("section", {
652
+ /* @__PURE__ */ h("section", {
653
653
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
654
654
  children: [
655
- /* @__PURE__ */ g("div", {
655
+ /* @__PURE__ */ h("div", {
656
656
  className: "flex items-center justify-between",
657
- children: [/* @__PURE__ */ g("div", {
657
+ children: [/* @__PURE__ */ h("div", {
658
658
  className: "flex items-center gap-2",
659
659
  children: [
660
- /* @__PURE__ */ h(ue, {
660
+ /* @__PURE__ */ m(de, {
661
661
  size: 16,
662
662
  className: "text-accent-primary"
663
663
  }),
664
- /* @__PURE__ */ h("h2", {
664
+ /* @__PURE__ */ m("h2", {
665
665
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
666
- children: y("notifTemplates.variables", "Variables")
666
+ children: b("notifTemplates.variables", "Variables")
667
667
  }),
668
- /* @__PURE__ */ g("span", {
668
+ /* @__PURE__ */ h("span", {
669
669
  className: "text-[11px] text-tertiary",
670
670
  children: [
671
671
  "(",
672
- U.length,
672
+ H.length,
673
673
  ")"
674
674
  ]
675
675
  })
676
676
  ]
677
- }), /* @__PURE__ */ g("button", {
677
+ }), /* @__PURE__ */ h("button", {
678
678
  type: "button",
679
- onClick: Ye,
679
+ onClick: Ze,
680
680
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-primary bg-accent-primary/10 border border-accent-primary/20 rounded-lg hover:bg-accent-primary/20 transition-colors",
681
- children: [/* @__PURE__ */ h(ce, { size: 12 }), y("notifTemplates.addVariable", "Add Variable")]
681
+ children: [/* @__PURE__ */ m(ce, { size: 12 }), b("notifTemplates.addVariable", "Add Variable")]
682
682
  })]
683
683
  }),
684
- U.length === 0 && /* @__PURE__ */ g("p", {
684
+ H.length === 0 && /* @__PURE__ */ h("p", {
685
685
  className: "text-sm text-tertiary text-center py-4",
686
686
  children: [
687
- y("notifTemplates.noVariables", "No variables defined. Add variables to use dynamic content like"),
687
+ b("notifTemplates.noVariables", "No variables defined. Add variables to use dynamic content like"),
688
688
  " ",
689
- /* @__PURE__ */ h("code", {
689
+ /* @__PURE__ */ m("code", {
690
690
  className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[11px] font-mono",
691
691
  children: "{{userName}}"
692
692
  })
693
693
  ]
694
694
  }),
695
- U.map((e, t) => /* @__PURE__ */ g("div", {
695
+ H.map((e, t) => /* @__PURE__ */ h("div", {
696
696
  className: "flex items-start gap-3 p-3 bg-bg-sunken/50 rounded-lg border border-default/50",
697
697
  children: [
698
- /* @__PURE__ */ g("div", {
698
+ /* @__PURE__ */ h("div", {
699
699
  className: "flex-1",
700
- children: [/* @__PURE__ */ h("label", {
700
+ children: [/* @__PURE__ */ m("label", {
701
701
  className: "block text-[11px] font-medium text-tertiary mb-1",
702
- children: y("notifTemplates.variableName", "Name")
703
- }), /* @__PURE__ */ h("input", {
702
+ children: b("notifTemplates.variableName", "Name")
703
+ }), /* @__PURE__ */ m("input", {
704
704
  type: "text",
705
705
  value: e.name,
706
- onChange: (e) => Z(t, "name", e.target.value.replace(/[^a-zA-Z0-9_]/g, "")),
707
- placeholder: y("notifTemplates.variableNamePlaceholder", "e.g., userName"),
706
+ onChange: (e) => X(t, "name", e.target.value.replace(/[^a-zA-Z0-9_]/g, "")),
707
+ placeholder: b("notifTemplates.variableNamePlaceholder", "e.g., userName"),
708
708
  className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent font-mono"
709
709
  })]
710
710
  }),
711
- /* @__PURE__ */ g("div", {
711
+ /* @__PURE__ */ h("div", {
712
712
  className: "w-28",
713
- children: [/* @__PURE__ */ h("label", {
713
+ children: [/* @__PURE__ */ m("label", {
714
714
  className: "block text-[11px] font-medium text-tertiary mb-1",
715
- children: y("notifTemplates.variableType", "Type")
716
- }), /* @__PURE__ */ h("select", {
715
+ children: b("notifTemplates.variableType", "Type")
716
+ }), /* @__PURE__ */ m(_, {
717
717
  value: e.type,
718
- onChange: (e) => Z(t, "type", e.target.value),
718
+ onChange: (e) => X(t, "type", e.target.value),
719
719
  className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
720
- children: xe.map((e) => /* @__PURE__ */ h("option", {
720
+ children: xe.map((e) => /* @__PURE__ */ m("option", {
721
721
  value: e.value,
722
- children: y(`notifTemplates.variableType.${e.value}`, e.label)
722
+ children: b(`notifTemplates.variableType.${e.value}`, e.label)
723
723
  }, e.value))
724
724
  })]
725
725
  }),
726
- /* @__PURE__ */ g("div", {
726
+ /* @__PURE__ */ h("div", {
727
727
  className: "flex-1",
728
- children: [/* @__PURE__ */ h("label", {
728
+ children: [/* @__PURE__ */ m("label", {
729
729
  className: "block text-[11px] font-medium text-tertiary mb-1",
730
- children: y("notifTemplates.sampleValue", "Sample Value")
731
- }), /* @__PURE__ */ h("input", {
730
+ children: b("notifTemplates.sampleValue", "Sample Value")
731
+ }), /* @__PURE__ */ m("input", {
732
732
  type: "text",
733
733
  value: e.defaultValue,
734
- onChange: (e) => Z(t, "defaultValue", e.target.value),
735
- placeholder: y("notifTemplates.previewValue", "Preview value"),
734
+ onChange: (e) => X(t, "defaultValue", e.target.value),
735
+ placeholder: b("notifTemplates.previewValue", "Preview value"),
736
736
  className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent"
737
737
  })]
738
738
  }),
739
- /* @__PURE__ */ h("button", {
739
+ /* @__PURE__ */ m("button", {
740
740
  type: "button",
741
- onClick: () => Xe(t),
741
+ onClick: () => Qe(t),
742
742
  className: "mt-5 p-1.5 text-tertiary hover:text-error rounded transition-colors",
743
- children: /* @__PURE__ */ h(le, { size: 14 })
743
+ children: /* @__PURE__ */ m(le, { size: 14 })
744
744
  })
745
745
  ]
746
746
  }, t))
747
747
  ]
748
748
  }),
749
- /* @__PURE__ */ g("div", {
749
+ /* @__PURE__ */ h("div", {
750
750
  className: "flex justify-end gap-3 lg:hidden pb-4",
751
- children: [/* @__PURE__ */ h("button", {
751
+ children: [/* @__PURE__ */ m("button", {
752
752
  type: "button",
753
- onClick: () => v("..", { relative: "path" }),
753
+ onClick: () => y("..", { relative: "path" }),
754
754
  className: "px-4 py-2 text-sm font-medium text-tertiary hover:text-primary border border-default rounded-lg transition-all duration-150",
755
- children: y("notifTemplates.cancel", "Cancel")
756
- }), /* @__PURE__ */ g("button", {
755
+ children: b("notifTemplates.cancel", "Cancel")
756
+ }), /* @__PURE__ */ h("button", {
757
757
  type: "submit",
758
- disabled: $,
758
+ disabled: Q,
759
759
  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 disabled:opacity-50",
760
- children: [$ ? /* @__PURE__ */ h(f, {
760
+ children: [Q ? /* @__PURE__ */ m(f, {
761
761
  size: 16,
762
762
  className: "animate-spin"
763
- }) : /* @__PURE__ */ h(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
763
+ }) : /* @__PURE__ */ m(p, { size: 16 }), C ? b("notifTemplates.saveChanges", "Save Changes") : b("notifTemplates.createTemplate", "Create Template")]
764
764
  })]
765
765
  })
766
766
  ]
767
767
  })
768
- }), /* @__PURE__ */ g("div", {
768
+ }), /* @__PURE__ */ h("div", {
769
769
  className: "hidden lg:flex lg:flex-col lg:w-[440px] xl:w-[500px] bg-bg-sunken/30",
770
- children: [/* @__PURE__ */ g("div", {
770
+ children: [/* @__PURE__ */ h("div", {
771
771
  className: "flex items-center gap-2 px-4 py-3 border-b border-border-seam bg-accent-wash shrink-0",
772
772
  children: [
773
- /* @__PURE__ */ h(u, {
773
+ /* @__PURE__ */ m(u, {
774
774
  size: 16,
775
775
  className: "text-primary"
776
776
  }),
777
- /* @__PURE__ */ h("span", {
777
+ /* @__PURE__ */ m("span", {
778
778
  className: "text-sm font-semibold text-primary",
779
- children: y("notifTemplates.livePreview", "Live Preview")
779
+ children: b("notifTemplates.livePreview", "Live Preview")
780
780
  }),
781
- /* @__PURE__ */ g("button", {
781
+ /* @__PURE__ */ h("button", {
782
782
  type: "button",
783
- onClick: () => X((e) => !e),
784
- className: `ml-auto flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-md transition-all duration-150 ${Y ? "bg-accent-primary/10 text-accent-primary" : "bg-bg-sunken text-tertiary hover:text-primary"}`,
785
- children: [h(Y ? u : d, { size: 12 }), Y ? y("notifTemplates.previewOn", "On") : y("notifTemplates.previewOffShort", "Off")]
783
+ onClick: () => Y((e) => !e),
784
+ className: `ml-auto flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-md transition-all duration-150 ${J ? "bg-accent-primary/10 text-accent-primary" : "bg-bg-sunken text-tertiary hover:text-primary"}`,
785
+ children: [m(J ? u : d, { size: 12 }), J ? b("notifTemplates.previewOn", "On") : b("notifTemplates.previewOffShort", "Off")]
786
786
  })
787
787
  ]
788
- }), Y ? /* @__PURE__ */ g("div", {
788
+ }), J ? /* @__PURE__ */ h("div", {
789
789
  className: "flex-1 flex flex-col overflow-hidden",
790
- children: [/* @__PURE__ */ h(ee, {
791
- channel: We,
792
- subject: Ke,
793
- body: qe,
794
- html: G === "html" && V ? Je : "",
795
- appName: U.find((e) => e.name === "appName")?.defaultValue || "Burdenoff",
796
- onChannelChange: Ge
797
- }), /* @__PURE__ */ g("div", {
790
+ children: [/* @__PURE__ */ m(ee, {
791
+ channel: Ke,
792
+ subject: Je,
793
+ body: Ye,
794
+ html: W === "html" && B ? Xe : "",
795
+ appName: H.find((e) => e.name === "appName")?.defaultValue || "Burdenoff",
796
+ onChannelChange: qe
797
+ }), /* @__PURE__ */ h("div", {
798
798
  className: "shrink-0 border-t border-default overflow-y-auto max-h-[240px]",
799
799
  children: [
800
- U.length > 0 && /* @__PURE__ */ g("div", {
800
+ H.length > 0 && /* @__PURE__ */ h("div", {
801
801
  className: "p-3 border-b border-default/50",
802
- children: [/* @__PURE__ */ g("p", {
802
+ children: [/* @__PURE__ */ h("p", {
803
803
  className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-2",
804
804
  children: [
805
- y("notifTemplates.variables", "Variables"),
805
+ b("notifTemplates.variables", "Variables"),
806
806
  " (",
807
- U.length,
807
+ H.length,
808
808
  ")"
809
809
  ]
810
- }), /* @__PURE__ */ h("div", {
810
+ }), /* @__PURE__ */ m("div", {
811
811
  className: "space-y-1.5",
812
- children: U.map((e, t) => /* @__PURE__ */ g("div", {
812
+ children: H.map((e, t) => /* @__PURE__ */ h("div", {
813
813
  className: "flex items-center justify-between text-xs",
814
- children: [/* @__PURE__ */ h("code", {
814
+ children: [/* @__PURE__ */ m("code", {
815
815
  className: "text-primary font-mono",
816
816
  children: `{{${e.name || "..."}}}`
817
- }), /* @__PURE__ */ g("span", {
817
+ }), /* @__PURE__ */ h("span", {
818
818
  className: "text-tertiary",
819
819
  children: [
820
820
  e.type,
821
821
  " =",
822
822
  " ",
823
- e.defaultValue || /* @__PURE__ */ h("em", { children: y("notifTemplates.noDefault", "no default") })
823
+ e.defaultValue || /* @__PURE__ */ m("em", { children: b("notifTemplates.noDefault", "no default") })
824
824
  ]
825
825
  })]
826
826
  }, t))
827
827
  })]
828
828
  }),
829
- S && w && M && /* @__PURE__ */ h("div", {
829
+ C && w && O && /* @__PURE__ */ m("div", {
830
830
  className: "p-3",
831
- children: /* @__PURE__ */ h(ge, {
831
+ children: /* @__PURE__ */ m(g, {
832
832
  storageKey: "notifications.templateEditor.details",
833
- label: y("notifTemplates.details", "Details"),
834
- children: et
833
+ label: b("notifTemplates.details", "Details"),
834
+ children: $
835
835
  })
836
836
  }),
837
- S && w && !M && /* @__PURE__ */ g("div", {
837
+ C && w && !O && /* @__PURE__ */ h("div", {
838
838
  className: "p-3",
839
- children: [/* @__PURE__ */ h("p", {
839
+ children: [/* @__PURE__ */ m("p", {
840
840
  className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-1",
841
- children: y("notifTemplates.metadata", "Metadata")
842
- }), et]
841
+ children: b("notifTemplates.metadata", "Metadata")
842
+ }), $]
843
843
  })
844
844
  ]
845
845
  })]
846
- }) : /* @__PURE__ */ h("div", {
846
+ }) : /* @__PURE__ */ m("div", {
847
847
  className: "flex-1 flex items-center justify-center",
848
- children: /* @__PURE__ */ g("div", {
848
+ children: /* @__PURE__ */ h("div", {
849
849
  className: "text-center",
850
850
  children: [
851
- /* @__PURE__ */ h(d, {
851
+ /* @__PURE__ */ m(d, {
852
852
  size: 32,
853
853
  className: "mx-auto text-tertiary mb-3"
854
854
  }),
855
- /* @__PURE__ */ h("p", {
855
+ /* @__PURE__ */ m("p", {
856
856
  className: "text-sm text-tertiary",
857
- children: y("notifTemplates.previewOff", "Preview is off")
857
+ children: b("notifTemplates.previewOff", "Preview is off")
858
858
  }),
859
- /* @__PURE__ */ h("button", {
859
+ /* @__PURE__ */ m("button", {
860
860
  type: "button",
861
- onClick: () => X(!0),
861
+ onClick: () => Y(!0),
862
862
  className: "mt-2 text-xs text-accent-primary hover:underline",
863
- children: y("notifTemplates.turnOn", "Turn on")
863
+ children: b("notifTemplates.turnOn", "Turn on")
864
864
  })
865
865
  ]
866
866
  })
@@ -870,6 +870,6 @@ function x() {
870
870
  ]
871
871
  });
872
872
  }
873
- export { x as TemplateEditorPage };
873
+ export { S as TemplateEditorPage };
874
874
 
875
875
  //# sourceMappingURL=TemplateEditorPage.js.map