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