@oneclick.dev/cms-core-modules 0.0.121 → 0.0.122

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.
@@ -0,0 +1,680 @@
1
+ import { defineComponent as U, openBlock as l, createElementBlock as c, createElementVNode as e, toDisplayString as n, ref as te, computed as o, resolveComponent as d, createVNode as a, isRef as Oe, unref as v, withCtx as i, createTextVNode as u, createBlock as w, reactive as Re, watch as ge, Fragment as L, createCommentVNode as g, normalizeClass as $, renderList as Ge } from "vue";
2
+ import { BellRing as Ye, Languages as _e, ChevronsUpDown as He, Check as xe, Copy as We, Globe2 as Je, AlertCircle as he, Send as Ke } from "lucide-vue-next";
3
+ import { useModuleBreadcrumbs as Qe, useModulePermissions as Xe } from "@oneclick.dev/cms-kit";
4
+ import { l as Ze } from "./languages-C_8yMQOH.mjs";
5
+ import { _ as ye } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
6
+ const et = { class: "preview-iphone" }, tt = { class: "push-container" }, st = { class: "inner" }, at = { class: "head" }, nt = { class: "app-name" }, ot = { class: "body" }, lt = { class: "push-title" }, it = { class: "push-message" }, rt = /* @__PURE__ */ U({
7
+ __name: "PreviewIPhone",
8
+ props: {
9
+ app: {
10
+ type: String,
11
+ required: !0
12
+ },
13
+ title: {
14
+ type: String,
15
+ required: !0
16
+ },
17
+ message: {
18
+ type: String,
19
+ required: !0
20
+ }
21
+ },
22
+ setup(_) {
23
+ return (y, f) => (l(), c("div", et, [
24
+ e("div", tt, [
25
+ e("div", st, [
26
+ e("div", at, [
27
+ e("span", nt, n(_.app), 1),
28
+ f[0] || (f[0] = e("span", null, "now", -1))
29
+ ]),
30
+ e("div", ot, [
31
+ e("span", lt, n(_.title), 1),
32
+ e("span", it, n(_.message), 1)
33
+ ])
34
+ ])
35
+ ])
36
+ ]));
37
+ }
38
+ }), ut = /* @__PURE__ */ ye(rt, [["__scopeId", "data-v-8c84cde9"]]), dt = { class: "preview-android" }, ct = { class: "push-container" }, mt = { class: "inner" }, pt = { class: "head" }, vt = { class: "app-name" }, ft = { class: "body" }, gt = { class: "push-title" }, _t = { class: "push-message" }, xt = /* @__PURE__ */ U({
39
+ __name: "PreviewAndroid",
40
+ props: {
41
+ app: {
42
+ type: String,
43
+ required: !0
44
+ },
45
+ title: {
46
+ type: String,
47
+ required: !0
48
+ },
49
+ message: {
50
+ type: String,
51
+ required: !0
52
+ }
53
+ },
54
+ setup(_) {
55
+ return (y, f) => (l(), c("div", dt, [
56
+ e("div", ct, [
57
+ e("div", mt, [
58
+ e("div", pt, [
59
+ f[0] || (f[0] = e("span", { class: "notification-badge" }, null, -1)),
60
+ e("span", vt, n(_.app), 1),
61
+ f[1] || (f[1] = e("span", null, null, -1))
62
+ ]),
63
+ e("div", ft, [
64
+ e("span", gt, n(_.title), 1),
65
+ e("span", _t, n(_.message), 1)
66
+ ])
67
+ ])
68
+ ])
69
+ ]));
70
+ }
71
+ }), ht = /* @__PURE__ */ ye(xt, [["__scopeId", "data-v-202b94a8"]]), yt = { class: "flex flex-col" }, bt = /* @__PURE__ */ U({
72
+ __name: "PushPreview",
73
+ props: {
74
+ app: {
75
+ type: String,
76
+ required: !0
77
+ },
78
+ title: {
79
+ type: String,
80
+ required: !0
81
+ },
82
+ message: {
83
+ type: String,
84
+ required: !0
85
+ }
86
+ },
87
+ setup(_) {
88
+ const y = _, f = te("ios"), q = o(() => y.title.length > 0 ? y.title : "Notification Preview"), E = o(() => y.message.length > 0 ? y.message : "Preview your push notification");
89
+ return (F, b) => {
90
+ const p = d("SegmentedControlButton"), k = d("SegmentedControl");
91
+ return l(), c("div", yt, [
92
+ a(k, {
93
+ modelValue: v(f),
94
+ "onUpdate:modelValue": b[0] || (b[0] = (C) => Oe(f) ? f.value = C : null),
95
+ class: "mx-auto mb-3"
96
+ }, {
97
+ default: i(() => [
98
+ a(p, { value: "ios" }, {
99
+ default: i(() => [...b[1] || (b[1] = [
100
+ u(" iOS ", -1)
101
+ ])]),
102
+ _: 1
103
+ }),
104
+ a(p, { value: "android" }, {
105
+ default: i(() => [...b[2] || (b[2] = [
106
+ u(" Android ", -1)
107
+ ])]),
108
+ _: 1
109
+ })
110
+ ]),
111
+ _: 1
112
+ }, 8, ["modelValue"]),
113
+ v(f) == "ios" ? (l(), w(ut, {
114
+ key: 0,
115
+ app: _.app,
116
+ title: v(q),
117
+ message: v(E)
118
+ }, null, 8, ["app", "title", "message"])) : (l(), w(ht, {
119
+ key: 1,
120
+ app: _.app,
121
+ title: v(q),
122
+ message: v(E)
123
+ }, null, 8, ["app", "title", "message"]))
124
+ ]);
125
+ };
126
+ }
127
+ }), kt = { class: "@container/push w-full" }, wt = { class: "mx-auto flex w-full max-w-7xl flex-col gap-6 py-8" }, Ct = { class: "flex flex-col gap-4 @lg/push:flex-row @lg/push:items-center @lg/push:justify-between" }, Lt = { class: "flex items-center gap-4" }, $t = { class: "flex size-11 shrink-0 items-center justify-center rounded-xl border border-primary/15 bg-primary/10 text-primary" }, St = { class: "grid min-w-0 items-start gap-6 @5xl/push:grid-cols-[minmax(24rem,1fr)_30.25rem]" }, Pt = { class: "flex flex-col flex-wrap gap-3 @md/editor:flex-row @md/editor:items-center @md/editor:justify-between" }, Dt = { class: "pt-6" }, Nt = {
128
+ class: "flex w-fit flex-wrap items-center gap-x-2 gap-y-1 rounded-full border bg-background px-3 py-1.5 text-xs text-muted-foreground",
129
+ "aria-live": "polite"
130
+ }, It = { key: 0 }, Tt = { key: 1 }, zt = { class: "space-y-2.5" }, qt = { class: "flex items-end justify-between gap-4" }, Et = { class: "flex min-w-0 items-center gap-3 text-left" }, Bt = { class: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted text-lg" }, jt = { class: "min-w-0" }, Vt = { class: "flex items-center gap-2" }, At = { class: "truncate text-sm font-medium" }, Mt = {
131
+ key: 0,
132
+ class: "rounded bg-muted px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground"
133
+ }, Ut = {
134
+ class: "mt-0.5 block truncate text-xs text-muted-foreground",
135
+ dir: "auto"
136
+ }, Ft = { class: "uppercase" }, Ot = { class: "flex shrink-0 items-center gap-2" }, Rt = { class: "text-base leading-none" }, Gt = { class: "min-w-0 flex-1" }, Yt = { class: "block truncate text-sm font-medium" }, Ht = {
137
+ class: "block truncate text-xs text-muted-foreground",
138
+ dir: "auto"
139
+ }, Wt = { class: "uppercase" }, Jt = { class: "text-base leading-none" }, Kt = { class: "min-w-0 flex-1" }, Qt = { class: "block truncate text-sm font-medium" }, Xt = {
140
+ class: "block truncate text-xs text-muted-foreground",
141
+ dir: "auto"
142
+ }, Zt = { class: "uppercase" }, es = ["id"], ts = { class: "flex flex-col gap-3 @md/editor:flex-row @md/editor:items-center @md/editor:justify-between" }, ss = { class: "mt-0.5 text-xs text-muted-foreground" }, as = { class: "truncate" }, ns = { class: "space-y-2" }, os = { class: "flex items-center justify-between gap-4" }, ls = {
143
+ key: 0,
144
+ class: "text-xs text-amber-600 dark:text-amber-400"
145
+ }, is = { class: "space-y-2" }, rs = { class: "flex items-center justify-between gap-4" }, us = {
146
+ key: 0,
147
+ class: "text-xs text-amber-600 dark:text-amber-400"
148
+ }, ds = {
149
+ key: 0,
150
+ class: "flex items-start gap-2 text-xs leading-relaxed text-muted-foreground"
151
+ }, cs = {
152
+ key: 1,
153
+ class: "flex items-start gap-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3"
154
+ }, ms = { class: "text-xs leading-relaxed text-amber-800 dark:text-amber-200" }, ps = {
155
+ key: 2,
156
+ class: "flex items-start gap-2 text-xs leading-relaxed text-muted-foreground"
157
+ }, vs = { class: "flex items-start gap-2 text-xs text-muted-foreground" }, fs = { key: 0 }, gs = { key: 1 }, _s = { class: "flex flex-col pt-6" }, xs = {
158
+ class: "overflow-x-auto px-3",
159
+ "aria-label": "Notification device preview"
160
+ }, hs = { class: "mx-auto w-max min-w-[450px]" }, Z = 60, ee = 160, $s = /* @__PURE__ */ U({
161
+ __name: "SendPush",
162
+ props: {
163
+ config: {
164
+ type: Object,
165
+ required: !0
166
+ }
167
+ },
168
+ setup(_) {
169
+ const y = _;
170
+ Qe(() => []);
171
+ const { hasPermission: f } = Xe(), q = { title: "", message: "" }, E = new Map(
172
+ Ze.map((t) => [t.code.toLowerCase(), t])
173
+ ), F = (t) => typeof t != "string" ? "" : t.trim().toLowerCase(), b = o(() => {
174
+ const t = y.config.supportedLanguages;
175
+ return (Array.isArray(t) ? t : typeof t == "string" ? [t] : []).map(F).filter((M) => !!M);
176
+ }), p = o(() => F(y.config.defaultLanguage) || b.value[0] || "en"), k = o(() => Array.from(
177
+ /* @__PURE__ */ new Set([p.value, ...b.value])
178
+ )), C = Re({}), r = te(p.value), B = te(!1);
179
+ ge(
180
+ k,
181
+ (t) => {
182
+ t.forEach((s) => {
183
+ C[s] ??= { title: "", message: "" };
184
+ }), t.includes(r.value) || (r.value = p.value);
185
+ },
186
+ { immediate: !0 }
187
+ ), ge(p, (t) => {
188
+ k.value.includes(r.value) || (r.value = t);
189
+ });
190
+ const O = (t) => E.get(t) ?? {
191
+ code: t,
192
+ name: t.toUpperCase(),
193
+ nativeName: t.toUpperCase(),
194
+ flag: "🌐"
195
+ }, j = (t) => C[t] ?? q, N = (t) => !!j(t).title.trim(), I = (t) => !!j(t).message.trim(), R = (t) => N(t) && I(t), G = (t) => N(t) !== I(t), V = (t) => R(t) ? "ready" : G(t) ? "incomplete" : t === p.value ? "required" : "fallback", be = {
196
+ ready: "Translated",
197
+ incomplete: "Incomplete",
198
+ required: "Required",
199
+ fallback: "Fallback"
200
+ }, se = (t) => {
201
+ const s = V(t);
202
+ return t === p.value && s === "ready" ? "Ready" : be[s];
203
+ }, ae = {
204
+ ready: "bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300",
205
+ incomplete: "bg-amber-500/10 text-amber-700 dark:bg-amber-500/15 dark:text-amber-300",
206
+ required: "bg-primary/10 text-primary",
207
+ fallback: "bg-muted text-muted-foreground"
208
+ }, A = o(() => k.value.map((t) => {
209
+ const s = V(t);
210
+ return {
211
+ ...O(t),
212
+ isDefault: t === p.value,
213
+ status: s,
214
+ statusLabel: se(t),
215
+ statusClass: ae[s]
216
+ };
217
+ })), x = o(
218
+ () => A.value.find((t) => t.isDefault)
219
+ ), Y = o(
220
+ () => A.value.filter((t) => !t.isDefault)
221
+ ), h = o(() => O(r.value)), S = o(
222
+ () => O(p.value)
223
+ ), H = o(() => j(r.value)), W = o(() => j(p.value)), T = o({
224
+ get: () => H.value.title,
225
+ set: (t) => {
226
+ C[r.value].title = t;
227
+ }
228
+ }), z = o({
229
+ get: () => H.value.message,
230
+ set: (t) => {
231
+ C[r.value].message = t;
232
+ }
233
+ }), P = o(
234
+ () => r.value === p.value
235
+ ), ne = o(
236
+ () => !N(r.value) && !I(r.value)
237
+ ), ke = o(() => G(r.value)), we = o(
238
+ () => N(r.value) || I(r.value)
239
+ ), J = o(() => R(p.value)), oe = o(
240
+ () => !P.value && ne.value
241
+ ), le = o(
242
+ () => oe.value ? W.value : H.value
243
+ ), D = o(
244
+ () => k.value.filter(
245
+ (t) => G(t)
246
+ ).length
247
+ ), ie = o(
248
+ () => k.value.filter(
249
+ (t) => t !== p.value && R(t)
250
+ ).length
251
+ ), Ce = o(
252
+ () => Math.max(k.value.length - 1, 0)
253
+ ), Le = o(
254
+ () => k.value.filter(
255
+ (t) => t !== p.value && V(t) === "fallback"
256
+ ).length
257
+ ), $e = o(
258
+ () => V(r.value)
259
+ ), Se = o(
260
+ () => se(r.value)
261
+ ), Pe = o(
262
+ () => ae[$e.value]
263
+ ), re = o(
264
+ () => !P.value && J.value
265
+ ), De = o(() => we.value ? `Replace with ${S.value.name}` : `Use ${S.value.name} as a starting point`), Ne = o(
266
+ () => J.value && D.value === 0 && f("send-push")
267
+ ), K = o(() => f("send-push") ? J.value ? D.value > 0 ? `Finish ${D.value} incomplete ${D.value === 1 ? "translation" : "translations"}.` : "" : `Add a ${[
268
+ N(p.value) ? "" : "title",
269
+ I(p.value) ? "" : "message"
270
+ ].filter(Boolean).join(" and ")} in ${S.value.name}.` : "You do not have permission to send push notifications."), Ie = () => {
271
+ re.value && (C[r.value].title = W.value.title, C[r.value].message = W.value.message);
272
+ }, ue = (t) => {
273
+ r.value = t, B.value = !1;
274
+ };
275
+ return (t, s) => {
276
+ const M = d("CardTitle"), de = d("CardDescription"), ce = d("CardHeader"), Q = d("Label"), X = d("Button"), Te = d("PopoverTrigger"), ze = d("CommandInput"), qe = d("CommandEmpty"), me = d("CommandItem"), pe = d("CommandGroup"), Ee = d("CommandSeparator"), Be = d("CommandList"), je = d("Command"), Ve = d("PopoverContent"), Ae = d("Popover"), Me = d("Input"), Ue = d("Textarea"), ve = d("CardContent"), Fe = d("CardFooter"), fe = d("Card");
277
+ return l(), c("div", kt, [
278
+ e("div", wt, [
279
+ e("header", Ct, [
280
+ e("div", Lt, [
281
+ e("div", $t, [
282
+ a(v(Ye), { class: "size-5" })
283
+ ]),
284
+ s[4] || (s[4] = e("div", null, [
285
+ e("h1", { class: "text-2xl font-semibold tracking-tight" }, " Send notification ")
286
+ ], -1))
287
+ ])
288
+ ]),
289
+ e("main", St, [
290
+ a(fe, { class: "@container/editor min-w-0 overflow-hidden py-0" }, {
291
+ default: i(() => [
292
+ a(ce, { class: "border-b bg-muted/20" }, {
293
+ default: i(() => [
294
+ e("div", Pt, [
295
+ e("div", Dt, [
296
+ a(M, { class: "text-base" }, {
297
+ default: i(() => [...s[5] || (s[5] = [
298
+ u("Notification content", -1)
299
+ ])]),
300
+ _: 1
301
+ }),
302
+ a(de, { class: "mt-1" }, {
303
+ default: i(() => [...s[6] || (s[6] = [
304
+ u(" Create the default message, then add translations where needed. ", -1)
305
+ ])]),
306
+ _: 1
307
+ })
308
+ ]),
309
+ e("div", Nt, [
310
+ a(v(_e), { class: "size-3.5" }),
311
+ Ce.value > 0 ? (l(), c("span", It, [
312
+ u(n(ie.value) + " translated ", 1),
313
+ s[8] || (s[8] = e("span", { "aria-hidden": "true" }, "·", -1)),
314
+ u(" " + n(Le.value) + " fallback ", 1),
315
+ D.value > 0 ? (l(), c(L, { key: 0 }, [
316
+ s[7] || (s[7] = e("span", { "aria-hidden": "true" }, "·", -1)),
317
+ u(" " + n(D.value) + " incomplete ", 1)
318
+ ], 64)) : g("", !0)
319
+ ])) : (l(), c("span", Tt, "Default copy only"))
320
+ ])
321
+ ])
322
+ ]),
323
+ _: 1
324
+ }),
325
+ a(ve, { class: "space-y-6 px-5 @md/editor:px-6" }, {
326
+ default: i(() => [
327
+ e("section", zt, [
328
+ e("div", qt, [
329
+ e("div", null, [
330
+ a(Q, { class: "text-sm font-medium" }, {
331
+ default: i(() => [...s[9] || (s[9] = [
332
+ u("Language", -1)
333
+ ])]),
334
+ _: 1
335
+ }),
336
+ s[10] || (s[10] = e("p", { class: "mt-0.5 text-xs text-muted-foreground" }, " Choose the version you want to edit. ", -1))
337
+ ]),
338
+ s[11] || (s[11] = e("span", { class: "hidden text-xs text-muted-foreground @sm/editor:inline" }, " Drafts are kept when you switch ", -1))
339
+ ]),
340
+ a(Ae, {
341
+ open: B.value,
342
+ "onUpdate:open": s[1] || (s[1] = (m) => B.value = m)
343
+ }, {
344
+ default: i(() => [
345
+ a(Te, { "as-child": "" }, {
346
+ default: i(() => [
347
+ a(X, {
348
+ type: "button",
349
+ variant: "outline",
350
+ role: "combobox",
351
+ "aria-expanded": B.value,
352
+ "aria-label": "Choose notification language",
353
+ class: "h-auto w-full justify-between gap-3 rounded-xl px-3 py-2.5 font-normal hover:bg-muted/40"
354
+ }, {
355
+ default: i(() => [
356
+ e("span", Et, [
357
+ e("span", Bt, n(h.value.flag), 1),
358
+ e("span", jt, [
359
+ e("span", Vt, [
360
+ e("span", At, n(h.value.name), 1),
361
+ P.value ? (l(), c("span", Mt, " Default ")) : g("", !0)
362
+ ]),
363
+ e("span", Ut, [
364
+ h.value.nativeName !== h.value.name ? (l(), c(L, { key: 0 }, [
365
+ u(n(h.value.nativeName) + " ", 1),
366
+ s[12] || (s[12] = e("span", { "aria-hidden": "true" }, " · ", -1))
367
+ ], 64)) : g("", !0),
368
+ e("span", Ft, n(r.value), 1)
369
+ ])
370
+ ])
371
+ ]),
372
+ e("span", Ot, [
373
+ e("span", {
374
+ class: $(["rounded-full px-2 py-1 text-[10px] font-medium", Pe.value])
375
+ }, n(Se.value), 3),
376
+ A.value.length > 1 ? (l(), w(v(He), {
377
+ key: 0,
378
+ class: "size-4 text-muted-foreground"
379
+ })) : g("", !0)
380
+ ])
381
+ ]),
382
+ _: 1
383
+ }, 8, ["aria-expanded"])
384
+ ]),
385
+ _: 1
386
+ }),
387
+ a(Ve, {
388
+ align: "start",
389
+ side: "bottom",
390
+ "side-offset": 6,
391
+ class: "w-[var(--reka-popover-trigger-width)] min-w-72 max-w-[calc(100vw-2rem)] p-0"
392
+ }, {
393
+ default: i(() => [
394
+ a(je, null, {
395
+ default: i(() => [
396
+ A.value.length > 5 ? (l(), w(ze, {
397
+ key: 0,
398
+ placeholder: "Search languages..."
399
+ })) : g("", !0),
400
+ a(Be, { class: "max-h-80" }, {
401
+ default: i(() => [
402
+ a(qe, null, {
403
+ default: i(() => [...s[13] || (s[13] = [
404
+ u("No language found.", -1)
405
+ ])]),
406
+ _: 1
407
+ }),
408
+ x.value ? (l(), w(pe, {
409
+ key: 0,
410
+ heading: "Default language"
411
+ }, {
412
+ default: i(() => [
413
+ a(me, {
414
+ value: `${x.value.name} ${x.value.nativeName} ${x.value.code}`,
415
+ class: "gap-3 py-2.5",
416
+ onSelect: s[0] || (s[0] = (m) => ue(x.value.code))
417
+ }, {
418
+ default: i(() => [
419
+ e("span", Rt, n(x.value.flag), 1),
420
+ e("span", Gt, [
421
+ e("span", Yt, n(x.value.name), 1),
422
+ e("span", Ht, [
423
+ x.value.nativeName !== x.value.name ? (l(), c(L, { key: 0 }, [
424
+ u(n(x.value.nativeName) + " ", 1),
425
+ s[14] || (s[14] = e("span", { "aria-hidden": "true" }, " · ", -1))
426
+ ], 64)) : g("", !0),
427
+ e("span", Wt, n(x.value.code), 1)
428
+ ])
429
+ ]),
430
+ e("span", {
431
+ class: $(["rounded-full px-2 py-1 text-[10px] font-medium", x.value.statusClass])
432
+ }, n(x.value.statusLabel), 3),
433
+ a(v(xe), {
434
+ class: $([
435
+ "size-4 shrink-0 text-primary",
436
+ r.value === x.value.code ? "opacity-100" : "opacity-0"
437
+ ])
438
+ }, null, 8, ["class"])
439
+ ]),
440
+ _: 1
441
+ }, 8, ["value"])
442
+ ]),
443
+ _: 1
444
+ })) : g("", !0),
445
+ Y.value.length > 0 ? (l(), w(Ee, { key: 1 })) : g("", !0),
446
+ Y.value.length > 0 ? (l(), w(pe, {
447
+ key: 2,
448
+ heading: `Translations · ${ie.value} translated`
449
+ }, {
450
+ default: i(() => [
451
+ (l(!0), c(L, null, Ge(Y.value, (m) => (l(), w(me, {
452
+ key: m.code,
453
+ value: `${m.name} ${m.nativeName} ${m.code}`,
454
+ class: "gap-3 py-2.5",
455
+ onSelect: (ys) => ue(m.code)
456
+ }, {
457
+ default: i(() => [
458
+ e("span", Jt, n(m.flag), 1),
459
+ e("span", Kt, [
460
+ e("span", Qt, n(m.name), 1),
461
+ e("span", Xt, [
462
+ m.nativeName !== m.name ? (l(), c(L, { key: 0 }, [
463
+ u(n(m.nativeName) + " ", 1),
464
+ s[15] || (s[15] = e("span", { "aria-hidden": "true" }, " · ", -1))
465
+ ], 64)) : g("", !0),
466
+ e("span", Zt, n(m.code), 1)
467
+ ])
468
+ ]),
469
+ e("span", {
470
+ class: $(["rounded-full px-2 py-1 text-[10px] font-medium", m.statusClass])
471
+ }, n(m.statusLabel), 3),
472
+ a(v(xe), {
473
+ class: $([
474
+ "size-4 shrink-0 text-primary",
475
+ r.value === m.code ? "opacity-100" : "opacity-0"
476
+ ])
477
+ }, null, 8, ["class"])
478
+ ]),
479
+ _: 2
480
+ }, 1032, ["value", "onSelect"]))), 128))
481
+ ]),
482
+ _: 1
483
+ }, 8, ["heading"])) : g("", !0)
484
+ ]),
485
+ _: 1
486
+ })
487
+ ]),
488
+ _: 1
489
+ })
490
+ ]),
491
+ _: 1
492
+ })
493
+ ]),
494
+ _: 1
495
+ }, 8, ["open"])
496
+ ]),
497
+ e("section", {
498
+ id: `notification-panel-${r.value}`,
499
+ class: "space-y-6"
500
+ }, [
501
+ e("div", ts, [
502
+ e("div", null, [
503
+ s[17] || (s[17] = e("h2", { class: "text-sm font-semibold" }, "Message copy", -1)),
504
+ e("p", ss, [
505
+ u(" Editing " + n(h.value.name) + " ", 1),
506
+ P.value ? (l(), c(L, { key: 0 }, [
507
+ u(" fallback")
508
+ ], 64)) : g("", !0),
509
+ s[16] || (s[16] = u(" content. ", -1))
510
+ ])
511
+ ]),
512
+ !P.value && re.value ? (l(), w(X, {
513
+ key: 0,
514
+ type: "button",
515
+ variant: "outline",
516
+ size: "sm",
517
+ class: "w-fit max-w-full justify-start",
518
+ onClick: Ie
519
+ }, {
520
+ default: i(() => [
521
+ a(v(We), { class: "size-3.5" }),
522
+ e("span", as, n(De.value), 1)
523
+ ]),
524
+ _: 1
525
+ })) : g("", !0)
526
+ ]),
527
+ e("div", ns, [
528
+ e("div", os, [
529
+ a(Q, {
530
+ for: `send_push_title_${r.value}`,
531
+ class: "text-sm font-medium"
532
+ }, {
533
+ default: i(() => [...s[18] || (s[18] = [
534
+ u(" Title ", -1)
535
+ ])]),
536
+ _: 1
537
+ }, 8, ["for"]),
538
+ e("span", {
539
+ class: $([
540
+ "text-xs tabular-nums",
541
+ T.value.length > Z ? "text-amber-600 dark:text-amber-400" : "text-muted-foreground"
542
+ ])
543
+ }, [
544
+ u(n(T.value.length) + "/" + n(Z) + " ", 1),
545
+ s[19] || (s[19] = e("span", { class: "hidden @lg/editor:inline" }, "recommended", -1))
546
+ ], 2)
547
+ ]),
548
+ a(Me, {
549
+ id: `send_push_title_${r.value}`,
550
+ modelValue: T.value,
551
+ "onUpdate:modelValue": s[2] || (s[2] = (m) => T.value = m),
552
+ type: "text",
553
+ lang: r.value,
554
+ dir: "auto",
555
+ placeholder: `Add a title in ${h.value.name}`,
556
+ autocomplete: "off",
557
+ class: "h-11"
558
+ }, null, 8, ["id", "modelValue", "lang", "placeholder"]),
559
+ T.value.length > Z ? (l(), c("p", ls, " Longer titles may be shortened on some devices. ")) : g("", !0)
560
+ ]),
561
+ e("div", is, [
562
+ e("div", rs, [
563
+ a(Q, {
564
+ for: `send_push_message_${r.value}`,
565
+ class: "text-sm font-medium"
566
+ }, {
567
+ default: i(() => [...s[20] || (s[20] = [
568
+ u(" Message ", -1)
569
+ ])]),
570
+ _: 1
571
+ }, 8, ["for"]),
572
+ e("span", {
573
+ class: $([
574
+ "text-xs tabular-nums",
575
+ z.value.length > ee ? "text-amber-600 dark:text-amber-400" : "text-muted-foreground"
576
+ ])
577
+ }, [
578
+ u(n(z.value.length) + "/" + n(ee) + " ", 1),
579
+ s[21] || (s[21] = e("span", { class: "hidden @lg/editor:inline" }, "recommended", -1))
580
+ ], 2)
581
+ ]),
582
+ a(Ue, {
583
+ id: `send_push_message_${r.value}`,
584
+ modelValue: z.value,
585
+ "onUpdate:modelValue": s[3] || (s[3] = (m) => z.value = m),
586
+ lang: r.value,
587
+ dir: "auto",
588
+ placeholder: `Write the notification message in ${h.value.name}`,
589
+ class: "min-h-36 resize-y"
590
+ }, null, 8, ["id", "modelValue", "lang", "placeholder"]),
591
+ z.value.length > ee ? (l(), c("p", us, " Longer messages may be truncated in the notification tray. ")) : g("", !0)
592
+ ]),
593
+ P.value ? (l(), c("div", ds, [
594
+ a(v(Je), { class: "mt-0.5 size-3.5 shrink-0 text-primary" }),
595
+ s[22] || (s[22] = e("p", null, " Required fallback for languages without their own translation. ", -1))
596
+ ])) : ke.value ? (l(), c("div", cs, [
597
+ a(v(he), { class: "mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400" }),
598
+ e("p", ms, " Complete both fields, or clear this translation to use " + n(S.value.name) + " as the fallback. ", 1)
599
+ ])) : ne.value ? (l(), c("div", ps, [
600
+ a(v(_e), { class: "mt-0.5 size-3.5 shrink-0" }),
601
+ e("p", null, " No " + n(h.value.name) + " translation — recipients will see the " + n(S.value.name) + " fallback. ", 1)
602
+ ])) : g("", !0)
603
+ ], 8, es)
604
+ ]),
605
+ _: 1
606
+ }),
607
+ a(Fe, { class: "flex flex-col gap-4 border-t bg-muted/20 px-5 py-4 @md/editor:flex-row @md/editor:items-center @md/editor:justify-between @md/editor:px-6" }, {
608
+ default: i(() => [
609
+ e("div", vs, [
610
+ a(v(he), { class: "mt-0.5 size-3.5 shrink-0" }),
611
+ K.value ? (l(), c("span", fs, n(K.value), 1)) : (l(), c("span", gs, " Review the live preview before sending. Delivery cannot be undone. "))
612
+ ]),
613
+ a(X, {
614
+ class: "w-full shrink-0 @md/editor:w-auto",
615
+ disabled: !Ne.value,
616
+ title: K.value
617
+ }, {
618
+ default: i(() => [
619
+ a(v(Ke), { class: "size-4" }),
620
+ s[23] || (s[23] = u(" Send notification ", -1))
621
+ ]),
622
+ _: 1
623
+ }, 8, ["disabled", "title"])
624
+ ]),
625
+ _: 1
626
+ })
627
+ ]),
628
+ _: 1
629
+ }),
630
+ a(fe, { class: "min-w-0 overflow-hidden @4xl/push:sticky @4xl/push:top-6 py-0" }, {
631
+ default: i(() => [
632
+ a(ce, { class: "border-b bg-muted/20" }, {
633
+ default: i(() => [
634
+ e("div", _s, [
635
+ a(M, { class: "text-base" }, {
636
+ default: i(() => [...s[24] || (s[24] = [
637
+ u("Live preview", -1)
638
+ ])]),
639
+ _: 1
640
+ }),
641
+ a(de, { class: "mt-0.5 mb-0" }, {
642
+ default: i(() => [
643
+ oe.value ? (l(), c(L, { key: 0 }, [
644
+ u(" Previewing " + n(S.value.name) + " fallback for " + n(h.value.name), 1)
645
+ ], 64)) : (l(), c(L, { key: 1 }, [
646
+ u(n(h.value.flag) + " " + n(h.value.name) + " notification ", 1)
647
+ ], 64))
648
+ ]),
649
+ _: 1
650
+ })
651
+ ])
652
+ ]),
653
+ _: 1
654
+ }),
655
+ a(ve, { class: "p-0" }, {
656
+ default: i(() => [
657
+ e("div", xs, [
658
+ e("div", hs, [
659
+ a(bt, {
660
+ app: _.config.appName || "Your app",
661
+ title: le.value.title,
662
+ message: le.value.message
663
+ }, null, 8, ["app", "title", "message"])
664
+ ])
665
+ ])
666
+ ]),
667
+ _: 1
668
+ })
669
+ ]),
670
+ _: 1
671
+ })
672
+ ])
673
+ ])
674
+ ]);
675
+ };
676
+ }
677
+ });
678
+ export {
679
+ $s as default
680
+ };