@burdenoff/microfe-notification 2026.624.2 → 2026.625.2

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