@webx-ui/module-inbox 0.5.7 → 0.6.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.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { defineComponent as ae, useModel as Ue, computed as S, unref as e, openBlock as u, createBlock as w, withCtx as a, createVNode as t, mergeModels as Le, ref as F, watch as Ce, isRef as ne, createElementVNode as G, createElementBlock as j, Fragment as ee, createCommentVNode as H, createTextVNode as z, toDisplayString as V, renderList as ke, createSlots as Ne, onMounted as fl, reactive as bl, useTemplateRef as il, normalizeClass as ll } from "vue";
2
- import { useRoute as Oe, useRouter as Pe } from "vue-router";
3
- import { useAdmin as oe, useTranslate as te, useErrorText as be, WxRowMenu as Fe, WxScreenHead as Qe, rowMenuWidth as hl, WxDate as De, WxFilterChips as yl, WxListScreen as ul, WxNotes as gl } from "@webx-ui/module-admin";
4
- import { useLocales as xe, WxLocales as xl, WxRichText as tl, useModal as Ee, WxDialog as Re, WxFormItem as B, WxSelect as ve, WxInput as X, WxText as J, WxAction as Ve, WxButton as le, WxIcon as $e, WxInputNumber as we, WxDatePicker as Ze, WxTagsInput as _l, WxCheckbox as he, WxSpace as qe, toast as P, createModal as Be, WxCard as se, WxEmpty as He, WxSortableList as Je, WxBadge as Se, localizedValue as fe, confirm as ze, WxSwitch as rl, WxTable as dl, WxAlert as Me, WxSkeleton as We, WxTabs as Xe, WxTab as ge, WxActionBar as wl, WxTextarea as kl, WxRadioGroup as Vl, WxCheckboxGroup as $l, useElementWidth as Ul, WxEntityCard as Sl, WxAvatar as al, WxTooltip as Cl, WxListDetail as zl, WxIndicator as nl, WxDescriptions as sl, WxDescriptionsItem as Ie, WxFileCard as Tl, WxTimeline as Fl, WxTimelineItem as Wl } from "@webx-ui/core";
5
- const cl = /* @__PURE__ */ ae({
1
+ import { defineComponent as ne, useModel as Se, computed as U, unref as e, openBlock as o, createBlock as w, withCtx as a, createVNode as t, mergeModels as Pe, ref as q, watch as Te, isRef as se, createElementVNode as K, createElementBlock as G, Fragment as ee, createCommentVNode as E, createTextVNode as S, toDisplayString as V, renderList as ge, createSlots as Oe, onMounted as yl, reactive as hl, useTemplateRef as cl, normalizeClass as sl } from "vue";
2
+ import { useRoute as Re, useRouter as Be } from "vue-router";
3
+ import { useAdmin as ie, useTranslate as ae, useErrorText as ye, WxRowMenu as ze, WxScreenHead as tl, rowMenuWidth as gl, WxDate as Ee, WxFilterChips as xl, WxListScreen as pl, WxNotes as _l } from "@webx-ui/module-admin";
4
+ import { useLocales as we, WxLocales as wl, WxRichText as ol, useModal as He, WxDialog as Ge, WxFormItem as H, WxSelect as fe, WxInput as le, WxText as Q, WxAction as $e, WxButton as te, WxIcon as _e, WxInputNumber as Ve, WxDatePicker as ll, WxTagsInput as kl, WxCheckbox as he, WxSpace as Ae, toast as L, createModal as je, WxCard as oe, WxEmpty as Ke, WxSortableList as al, WxBadge as Ue, localizedValue as be, confirm as Ce, WxSwitch as ml, WxTable as vl, WxAlert as Fe, WxSkeleton as We, WxTabs as nl, WxTab as xe, WxActionBar as Vl, WxTextarea as $l, WxRadioGroup as Ul, WxCheckboxGroup as Sl, useElementWidth as Tl, WxEntityCard as Cl, WxAvatar as il, WxTooltip as ql, WxListDetail as zl, WxIndicator as ul, WxDescriptions as rl, WxDescriptionsItem as Me, WxFileCard as Fl, WxTimeline as Wl, WxTimelineItem as Al } from "@webx-ui/core";
5
+ const fl = /* @__PURE__ */ ne({
6
6
  __name: "LocalizedRichText",
7
- props: /* @__PURE__ */ Le({
7
+ props: /* @__PURE__ */ Pe({
8
8
  placeholder: { default: void 0 },
9
9
  minHeight: { default: "160px" }
10
10
  }, {
@@ -12,99 +12,100 @@ const cl = /* @__PURE__ */ ae({
12
12
  modelModifiers: {}
13
13
  }),
14
14
  emits: ["update:modelValue"],
15
- setup(r) {
16
- const s = Ue(r, "modelValue"), o = r, f = xe(), n = S(() => {
17
- const m = f.active.value;
18
- return f.list.value.some((U) => U.code === m) ? m : f.list.value[0]?.code ?? "";
19
- }), d = S({
15
+ setup(i) {
16
+ const s = Se(i, "modelValue"), u = i, v = we(), n = U(() => {
17
+ const f = v.active.value;
18
+ return v.list.value.some((T) => T.code === f) ? f : v.list.value[0]?.code ?? "";
19
+ }), c = U({
20
20
  get: () => {
21
- const m = s.value;
22
- return typeof m == "string" ? n.value === "" || n.value === f.list.value[0]?.code ? m : "" : m[n.value] ?? "";
21
+ const f = s.value;
22
+ return typeof f == "string" ? n.value === "" || n.value === v.list.value[0]?.code ? f : "" : f[n.value] ?? "";
23
23
  },
24
- set: (m) => {
24
+ set: (f) => {
25
25
  if (n.value === "") {
26
- s.value = m;
26
+ s.value = f;
27
27
  return;
28
28
  }
29
29
  const l = typeof s.value == "string" ? { [n.value]: s.value } : s.value;
30
- s.value = { ...l, [n.value]: m };
30
+ s.value = { ...l, [n.value]: f };
31
31
  }
32
32
  });
33
- return (m, l) => e(f).list.value.length > 0 ? (u(), w(e(xl), { key: 0 }, {
33
+ return (f, l) => e(v).list.value.length > 0 ? (o(), w(e(wl), { key: 0 }, {
34
34
  default: a(() => [
35
- t(e(tl), {
36
- modelValue: d.value,
37
- "onUpdate:modelValue": l[0] || (l[0] = (U) => d.value = U),
38
- placeholder: o.placeholder,
39
- "min-height": o.minHeight
35
+ t(e(ol), {
36
+ modelValue: c.value,
37
+ "onUpdate:modelValue": l[0] || (l[0] = (T) => c.value = T),
38
+ placeholder: u.placeholder,
39
+ "min-height": u.minHeight
40
40
  }, null, 8, ["modelValue", "placeholder", "min-height"])
41
41
  ]),
42
42
  _: 1
43
- })) : (u(), w(e(tl), {
43
+ })) : (o(), w(e(ol), {
44
44
  key: 1,
45
- modelValue: d.value,
46
- "onUpdate:modelValue": l[1] || (l[1] = (U) => d.value = U),
47
- placeholder: o.placeholder,
48
- "min-height": o.minHeight
45
+ modelValue: c.value,
46
+ "onUpdate:modelValue": l[1] || (l[1] = (T) => c.value = T),
47
+ placeholder: u.placeholder,
48
+ "min-height": u.minHeight
49
49
  }, null, 8, ["modelValue", "placeholder", "min-height"]));
50
50
  }
51
51
  });
52
- function de(r) {
53
- const s = `${r.apiPath}/inbox`, o = (n) => n.data, f = () => {
52
+ function ce(i) {
53
+ const s = `${i.apiPath}/inbox`, u = (n) => n.data, v = () => {
54
54
  };
55
55
  return {
56
- forms: () => r.http.get(`${s}/forms`).then(o),
57
- form: (n) => r.http.get(`${s}/forms/${n}`).then(o),
58
- createForm: (n) => r.http.post(`${s}/forms`, n).then(o),
59
- saveForm: (n, d) => r.http.put(`${s}/forms/${n}`, d).then(o),
60
- removeForm: (n) => r.http.delete(`${s}/forms/${n}`).then(f),
61
- duplicateForm: (n) => r.http.post(`${s}/forms/${n}/duplicate`, {}).then(o),
62
- sortForms: (n) => r.http.post(`${s}/forms/sorting`, { ids: n }).then(f),
63
- fields: (n) => r.http.get(`${s}/forms/${n}/fields`).then(o),
64
- createField: (n, d) => r.http.post(`${s}/forms/${n}/fields`, d).then(o),
65
- saveField: (n, d) => r.http.put(`${s}/fields/${n}`, d).then(o),
66
- removeField: (n) => r.http.delete(`${s}/fields/${n}`).then(f),
67
- sortFields: (n, d) => r.http.post(`${s}/forms/${n}/fields/sorting`, { ids: d }).then(f),
68
- statuses: () => r.http.get(`${s}/statuses`).then(o),
69
- createStatus: (n) => r.http.post(`${s}/statuses`, n).then(o),
70
- saveStatus: (n, d) => r.http.put(`${s}/statuses/${n}`, d).then(o),
71
- removeStatus: (n) => r.http.delete(`${s}/statuses/${n}`).then(f),
72
- sortStatuses: (n) => r.http.post(`${s}/statuses/sorting`, { ids: n }).then(f),
73
- recipients: () => r.http.get(`${s}/recipients`).then(o),
74
- submissions: (n, d = {}) => r.http.get(`${s}/forms/${n}/submissions`, { query: Ye(d) }).then((m) => ({
75
- ...m.meta,
76
- data: m.data,
77
- columns: m.columns,
78
- counts: m.counts,
56
+ forms: () => i.http.get(`${s}/forms`).then(u),
57
+ form: (n) => i.http.get(`${s}/forms/${n}`).then(u),
58
+ createForm: (n) => i.http.post(`${s}/forms`, n).then(u),
59
+ saveForm: (n, c) => i.http.put(`${s}/forms/${n}`, c).then(u),
60
+ removeForm: (n) => i.http.delete(`${s}/forms/${n}`).then(v),
61
+ duplicateForm: (n) => i.http.post(`${s}/forms/${n}/duplicate`, {}).then(u),
62
+ sortForms: (n) => i.http.post(`${s}/forms/sorting`, { ids: n }).then(v),
63
+ fields: (n) => i.http.get(`${s}/forms/${n}/fields`).then(u),
64
+ createField: (n, c) => i.http.post(`${s}/forms/${n}/fields`, c).then(u),
65
+ saveField: (n, c) => i.http.put(`${s}/fields/${n}`, c).then(u),
66
+ removeField: (n) => i.http.delete(`${s}/fields/${n}`).then(v),
67
+ sortFields: (n, c) => i.http.post(`${s}/forms/${n}/fields/sorting`, { ids: c }).then(v),
68
+ statuses: () => i.http.get(`${s}/statuses`).then(u),
69
+ createStatus: (n) => i.http.post(`${s}/statuses`, n).then(u),
70
+ saveStatus: (n, c) => i.http.put(`${s}/statuses/${n}`, c).then(u),
71
+ removeStatus: (n) => i.http.delete(`${s}/statuses/${n}`).then(v),
72
+ sortStatuses: (n) => i.http.post(`${s}/statuses/sorting`, { ids: n }).then(v),
73
+ recipients: () => i.http.get(`${s}/recipients`).then(u),
74
+ submissions: (n, c = {}) => i.http.get(`${s}/forms/${n}/submissions`, { query: el(c) }).then((f) => ({
75
+ ...f.meta,
76
+ data: f.data,
77
+ columns: f.columns,
78
+ counts: f.counts,
79
79
  // Optional on the wire: a server from before placements answers without them.
80
- placements: m.placements ?? []
80
+ placements: f.placements ?? []
81
81
  })),
82
- submission: (n, d = {}) => r.http.get(`${s}/submissions/${n}`, { query: Ye(d) }).then(o),
83
- createSubmission: (n, d) => r.http.post(`${s}/forms/${n}/submissions`, { fields: d }).then(o),
84
- saveSubmission: (n, d) => r.http.put(`${s}/submissions/${n}`, d).then(o),
85
- removeSubmission: (n) => r.http.delete(`${s}/submissions/${n}`).then(f),
86
- massSubmissions: (n) => r.http.post(`${s}/submissions/mass`, n).then(o),
87
- exportUrl: (n, d = {}) => {
88
- const m = new URLSearchParams();
89
- for (const [U, p] of Object.entries(Ye(d)))
90
- p != null && p !== "" && m.set(U, String(p));
91
- const l = m.toString();
82
+ submission: (n, c = {}) => i.http.get(`${s}/submissions/${n}`, { query: el(c) }).then(u),
83
+ createSubmission: (n, c) => i.http.post(`${s}/forms/${n}/submissions`, { fields: c }).then(u),
84
+ saveSubmission: (n, c) => i.http.put(`${s}/submissions/${n}`, c).then(u),
85
+ removeSubmission: (n) => i.http.delete(`${s}/submissions/${n}`).then(v),
86
+ notifySubmission: (n) => i.http.post(`${s}/submissions/${n}/notify`).then(u),
87
+ massSubmissions: (n) => i.http.post(`${s}/submissions/mass`, n).then(u),
88
+ exportUrl: (n, c = {}) => {
89
+ const f = new URLSearchParams();
90
+ for (const [T, p] of Object.entries(el(c)))
91
+ p != null && p !== "" && f.set(T, String(p));
92
+ const l = f.toString();
92
93
  return `${s}/forms/${n}/submissions/export${l === "" ? "" : `?${l}`}`;
93
94
  }
94
95
  };
95
96
  }
96
- function Ye(r) {
97
+ function el(i) {
97
98
  return {
98
- view: r.view === void 0 || r.view === "" ? void 0 : r.view,
99
- search: r.search === void 0 || r.search === "" ? void 0 : r.search,
100
- assignee: r.assignee ?? void 0,
101
- placement: r.placement ?? void 0,
102
- sort: r.sort ?? void 0,
103
- page: r.page,
104
- per_page: r.per_page
99
+ view: i.view === void 0 || i.view === "" ? void 0 : i.view,
100
+ search: i.search === void 0 || i.search === "" ? void 0 : i.search,
101
+ assignee: i.assignee ?? void 0,
102
+ placement: i.placement ?? void 0,
103
+ sort: i.sort ?? void 0,
104
+ page: i.page,
105
+ per_page: i.per_page
105
106
  };
106
107
  }
107
- const ql = {
108
+ const Nl = {
108
109
  module: {
109
110
  title: "Inbox"
110
111
  },
@@ -242,16 +243,35 @@ const ql = {
242
243
  "event-unassigned": "Left to nobody",
243
244
  "event-note": "A note was added",
244
245
  "event-notified": "The notification went out",
246
+ "event-handled": "Handed to :name",
247
+ "event-handler-error": ":name failed: :error",
245
248
  system: "System",
246
249
  "no-answers": "Nothing was filled in.",
247
250
  download: "Download",
248
251
  "no-files-by-hand": "A file cannot be attached by hand: the files a submission carries are what was posted with it.",
249
- "submissions-none": "Nothing here under this filter."
252
+ "submissions-none": "Nothing here under this filter.",
253
+ "notifies-nobody": "Nobody is told about this form",
254
+ "notifies-nobody-text": "Every submission is kept here, but no letter goes out. Add a recipient on the Notifications tab.",
255
+ "notifies-nobody-short": "Nobody is told",
256
+ "recipient-admin_deleted": "This administrator no longer exists and gets no letter.",
257
+ "recipient-admin_inactive": "This administrator is switched off and gets no letter.",
258
+ "recipient-invalid_email": "This is not an e-mail address.",
259
+ "event-no-recipients": "Nobody was told: the form names no recipients",
260
+ "notified-nobody": "No notification: the form names nobody to tell",
261
+ "notify-queued": "The notification is waiting in the queue",
262
+ "notify-again": "Send the notification again",
263
+ "notify-sent-again": "The notification has been sent again",
264
+ "notify-recipient-queued": "waiting",
265
+ "notify-recipient-delivered": "sent",
266
+ "notify-recipient-failed": "failed",
267
+ "event-notify-queued": "The notification was queued",
268
+ "event-notify-failed": "The notification to :to failed"
250
269
  },
251
270
  fields: {
252
271
  field: "Field",
253
272
  "new-field": "New field",
254
273
  "edit-field": "Field",
274
+ edit: "Edit",
255
275
  "no-fields": "No questions yet.",
256
276
  "no-fields-help": "A form with no fields draws nothing on the page.",
257
277
  "save-first": "Save the form first, then write its questions.",
@@ -301,15 +321,15 @@ const ql = {
301
321
  "type-file": "File",
302
322
  "type-hidden": "Hidden"
303
323
  }
304
- }, ol = /* @__PURE__ */ new WeakSet();
305
- function ce() {
324
+ }, dl = /* @__PURE__ */ new WeakSet();
325
+ function pe() {
306
326
  try {
307
- const { i18n: r } = oe();
308
- ol.has(r) || (r.defaults("webx-inbox", ql), ol.add(r));
327
+ const { i18n: i } = ie();
328
+ dl.has(i) || (i.defaults("webx-inbox", Nl), dl.add(i));
309
329
  } catch {
310
330
  }
311
331
  }
312
- const Al = [
332
+ const Il = [
313
333
  "text",
314
334
  "email",
315
335
  "tel",
@@ -321,108 +341,108 @@ const Al = [
321
341
  "date",
322
342
  "file",
323
343
  "hidden"
324
- ], Il = ["default", "primary", "success", "warning", "info", "danger"], Nl = { class: "wx-inbox-field-form" }, Dl = { class: "wx-inbox-field-form__row" }, Ml = {
344
+ ], Dl = ["default", "primary", "success", "warning", "info", "danger"], Ml = { class: "wx-inbox-field-form" }, Ll = { class: "wx-inbox-field-form__row" }, Ol = {
325
345
  key: 2,
326
346
  class: "wx-inbox-choices"
327
- }, Ll = { class: "wx-inbox-field-form__row" }, Ol = { class: "wx-inbox-field-form__checks" }, Pl = /* @__PURE__ */ ae({
347
+ }, El = { class: "wx-inbox-field-form__row" }, Pl = { class: "wx-inbox-field-form__checks" }, Rl = /* @__PURE__ */ ne({
328
348
  __name: "FieldDialog",
329
349
  props: {
330
350
  field: {},
331
351
  form: {}
332
352
  },
333
- setup(r) {
334
- const s = r, { resolve: o, dismiss: f, open: n } = Ee(), d = oe(), m = de(d);
335
- ce();
336
- const l = te("webx-inbox"), U = be(), p = F(!1), i = F({}), L = F(""), C = F("text"), T = F({}), b = F({}), W = F({}), c = F({}), $ = F(!0), h = F(!1), O = F(!0), _ = F(!1);
337
- Ce(
353
+ setup(i) {
354
+ const s = i, { resolve: u, dismiss: v, open: n } = He(), c = ie(), f = ce(c);
355
+ pe();
356
+ const l = ae("webx-inbox"), T = ye(), p = q(!1), d = q({}), D = q(""), C = q("text"), z = q({}), b = q({}), F = q({}), m = q({}), $ = q(!0), h = q(!1), I = q(!0), x = q(!1);
357
+ Te(
338
358
  () => s.field,
339
- (I) => {
340
- L.value = I?.name ?? "", C.value = I?.type ?? "text", T.value = { ...I?.title ?? {} }, b.value = { ...I?.placeholder ?? {} }, W.value = { ...I?.help ?? {} }, c.value = { ...I?.options ?? {} }, $.value = I?.is_enabled ?? !0, h.value = I?.is_required ?? !1, O.value = I?.is_fullsize ?? !0, _.value = I?.in_table ?? !1, i.value = {};
359
+ (W) => {
360
+ D.value = W?.name ?? "", C.value = W?.type ?? "text", z.value = { ...W?.title ?? {} }, b.value = { ...W?.placeholder ?? {} }, F.value = { ...W?.help ?? {} }, m.value = { ...W?.options ?? {} }, $.value = W?.is_enabled ?? !0, h.value = W?.is_required ?? !1, I.value = W?.is_fullsize ?? !0, x.value = W?.in_table ?? !1, d.value = {};
341
361
  },
342
362
  { immediate: !0 }
343
363
  );
344
- const E = S(
345
- () => Al.map((I) => ({ value: I, label: l(`fields.type-${I}`) }))
346
- ), N = S(() => ["select", "radio", "checkbox"].includes(C.value)), q = S(
347
- () => Array.isArray(c.value.choices) ? c.value.choices : []
348
- ), M = S({
349
- get: () => Array.isArray(c.value.extensions) ? c.value.extensions : [],
350
- set: (I) => v(
364
+ const P = U(
365
+ () => Il.map((W) => ({ value: W, label: l(`fields.type-${W}`) }))
366
+ ), j = U(() => ["select", "radio", "checkbox"].includes(C.value)), R = U(
367
+ () => Array.isArray(m.value.choices) ? m.value.choices : []
368
+ ), B = U({
369
+ get: () => Array.isArray(m.value.extensions) ? m.value.extensions : [],
370
+ set: (W) => r(
351
371
  "extensions",
352
- I.map((k) => k.replace(/^\./, ""))
372
+ W.map((k) => k.replace(/^\./, ""))
353
373
  )
354
374
  });
355
- function v(I, k) {
356
- c.value = { ...c.value, [I]: k };
375
+ function r(W, k) {
376
+ m.value = { ...m.value, [W]: k };
357
377
  }
358
- function Y() {
359
- v("choices", [...q.value, { value: "", label: {} }]);
378
+ function O() {
379
+ r("choices", [...R.value, { value: "", label: {} }]);
360
380
  }
361
- function ye(I) {
362
- v(
381
+ function J(W) {
382
+ r(
363
383
  "choices",
364
- q.value.filter((k, y) => y !== I)
384
+ R.value.filter((k, g) => g !== W)
365
385
  );
366
386
  }
367
- function pe(I, k) {
368
- v(
387
+ function me(W, k) {
388
+ r(
369
389
  "choices",
370
- q.value.map((y, ue) => ue === I ? { ...y, ...k } : y)
390
+ R.value.map((g, re) => re === W ? { ...g, ...k } : g)
371
391
  );
372
392
  }
373
- function A(I) {
374
- return i.value[I]?.[0];
393
+ function A(W) {
394
+ return d.value[W]?.[0];
375
395
  }
376
- async function Q() {
377
- p.value = !0, i.value = {};
378
- const I = {
379
- name: L.value.trim() === "" ? null : L.value.trim(),
396
+ async function X() {
397
+ p.value = !0, d.value = {};
398
+ const W = {
399
+ name: D.value.trim() === "" ? null : D.value.trim(),
380
400
  type: C.value,
381
- title: T.value,
401
+ title: z.value,
382
402
  placeholder: b.value,
383
- help: W.value,
384
- options: c.value,
403
+ help: F.value,
404
+ options: m.value,
385
405
  is_enabled: $.value,
386
406
  is_required: h.value,
387
- is_fullsize: O.value,
388
- in_table: _.value
407
+ is_fullsize: I.value,
408
+ in_table: x.value
389
409
  };
390
410
  try {
391
- o(
392
- s.field === null ? await m.createField(s.form.id, I) : await m.saveField(s.field.id, I)
411
+ u(
412
+ s.field === null ? await f.createField(s.form.id, W) : await f.saveField(s.field.id, W)
393
413
  );
394
414
  } catch (k) {
395
- const y = k.body;
396
- y?.errors ? (i.value = y.errors, P.danger(l("panel.failed"))) : P.danger(U(k));
415
+ const g = k.body;
416
+ g?.errors ? (d.value = g.errors, L.danger(l("panel.failed"))) : L.danger(T(k));
397
417
  } finally {
398
418
  p.value = !1;
399
419
  }
400
420
  }
401
- return (I, k) => (u(), w(e(Re), {
421
+ return (W, k) => (o(), w(e(Ge), {
402
422
  open: e(n),
403
- "onUpdate:open": k[21] || (k[21] = (y) => ne(n) ? n.value = y : null),
404
- title: r.field ? e(l)("fields.edit-field") : e(l)("fields.new-field"),
423
+ "onUpdate:open": k[21] || (k[21] = (g) => se(n) ? n.value = g : null),
424
+ title: i.field ? e(l)("fields.edit-field") : e(l)("fields.new-field"),
405
425
  width: 720
406
426
  }, {
407
427
  footer: a(() => [
408
- t(e(qe), { size: "sm" }, {
428
+ t(e(Ae), { size: "sm" }, {
409
429
  default: a(() => [
410
- t(e(le), {
430
+ t(e(te), {
411
431
  variant: "outline",
412
- onClick: k[20] || (k[20] = (y) => e(f)())
432
+ onClick: k[20] || (k[20] = (g) => e(v)())
413
433
  }, {
414
434
  default: a(() => [
415
- z(V(e(l)("fields.cancel")), 1)
435
+ S(V(e(l)("fields.cancel")), 1)
416
436
  ]),
417
437
  _: 1
418
438
  }),
419
- t(e(le), {
439
+ t(e(te), {
420
440
  type: "primary",
421
441
  loading: p.value,
422
- onClick: Q
442
+ onClick: X
423
443
  }, {
424
444
  default: a(() => [
425
- z(V(e(l)("fields.save")), 1)
445
+ S(V(e(l)("fields.save")), 1)
426
446
  ]),
427
447
  _: 1
428
448
  }, 8, ["loading"])
@@ -431,292 +451,292 @@ const Al = [
431
451
  })
432
452
  ]),
433
453
  default: a(() => [
434
- G("div", Nl, [
435
- G("div", Dl, [
436
- t(e(B), {
454
+ K("div", Ml, [
455
+ K("div", Ll, [
456
+ t(e(H), {
437
457
  label: e(l)("fields.type")
438
458
  }, {
439
459
  default: a(() => [
440
- t(e(ve), {
460
+ t(e(fe), {
441
461
  modelValue: C.value,
442
- "onUpdate:modelValue": k[0] || (k[0] = (y) => C.value = y),
443
- options: E.value
462
+ "onUpdate:modelValue": k[0] || (k[0] = (g) => C.value = g),
463
+ options: P.value
444
464
  }, null, 8, ["modelValue", "options"])
445
465
  ]),
446
466
  _: 1
447
467
  }, 8, ["label"]),
448
- t(e(B), {
468
+ t(e(H), {
449
469
  label: e(l)("fields.name"),
450
470
  help: e(l)("fields.name-help"),
451
471
  error: A("name")
452
472
  }, {
453
473
  default: a(() => [
454
- t(e(X), {
455
- modelValue: L.value,
456
- "onUpdate:modelValue": k[1] || (k[1] = (y) => L.value = y),
474
+ t(e(le), {
475
+ modelValue: D.value,
476
+ "onUpdate:modelValue": k[1] || (k[1] = (g) => D.value = g),
457
477
  placeholder: "email"
458
478
  }, null, 8, ["modelValue"])
459
479
  ]),
460
480
  _: 1
461
481
  }, 8, ["label", "help", "error"])
462
482
  ]),
463
- t(e(B), {
483
+ t(e(H), {
464
484
  label: e(l)("fields.title"),
465
485
  error: A("title"),
466
486
  required: ""
467
487
  }, {
468
488
  default: a(() => [
469
- t(e(X), {
470
- modelValue: T.value,
471
- "onUpdate:modelValue": k[2] || (k[2] = (y) => T.value = y),
489
+ t(e(le), {
490
+ modelValue: z.value,
491
+ "onUpdate:modelValue": k[2] || (k[2] = (g) => z.value = g),
472
492
  localized: ""
473
493
  }, null, 8, ["modelValue"])
474
494
  ]),
475
495
  _: 1
476
496
  }, 8, ["label", "error"]),
477
- C.value !== "hidden" ? (u(), j(ee, { key: 0 }, [
478
- C.value !== "consent" ? (u(), w(e(B), {
497
+ C.value !== "hidden" ? (o(), G(ee, { key: 0 }, [
498
+ C.value !== "consent" ? (o(), w(e(H), {
479
499
  key: 0,
480
500
  label: e(l)("fields.placeholder")
481
501
  }, {
482
502
  default: a(() => [
483
- t(e(X), {
503
+ t(e(le), {
484
504
  modelValue: b.value,
485
- "onUpdate:modelValue": k[3] || (k[3] = (y) => b.value = y),
505
+ "onUpdate:modelValue": k[3] || (k[3] = (g) => b.value = g),
486
506
  localized: ""
487
507
  }, null, 8, ["modelValue"])
488
508
  ]),
489
509
  _: 1
490
- }, 8, ["label"])) : H("", !0),
491
- t(e(B), {
510
+ }, 8, ["label"])) : E("", !0),
511
+ t(e(H), {
492
512
  label: e(l)("fields.help")
493
513
  }, {
494
514
  default: a(() => [
495
- t(e(X), {
496
- modelValue: W.value,
497
- "onUpdate:modelValue": k[4] || (k[4] = (y) => W.value = y),
515
+ t(e(le), {
516
+ modelValue: F.value,
517
+ "onUpdate:modelValue": k[4] || (k[4] = (g) => F.value = g),
498
518
  localized: ""
499
519
  }, null, 8, ["modelValue"])
500
520
  ]),
501
521
  _: 1
502
522
  }, 8, ["label"])
503
- ], 64)) : H("", !0),
504
- C.value === "consent" ? (u(), w(e(B), {
523
+ ], 64)) : E("", !0),
524
+ C.value === "consent" ? (o(), w(e(H), {
505
525
  key: 1,
506
526
  label: e(l)("fields.consent-text"),
507
527
  help: e(l)("fields.consent-text-help")
508
528
  }, {
509
529
  default: a(() => [
510
- t(cl, {
511
- "model-value": c.value.text ?? {},
530
+ t(fl, {
531
+ "model-value": m.value.text ?? {},
512
532
  "min-height": "100px",
513
- "onUpdate:modelValue": k[5] || (k[5] = (y) => v("text", y))
533
+ "onUpdate:modelValue": k[5] || (k[5] = (g) => r("text", g))
514
534
  }, null, 8, ["model-value"])
515
535
  ]),
516
536
  _: 1
517
- }, 8, ["label", "help"])) : H("", !0),
518
- N.value ? (u(), j("div", Ml, [
519
- t(e(J), {
537
+ }, 8, ["label", "help"])) : E("", !0),
538
+ j.value ? (o(), G("div", Ol, [
539
+ t(e(Q), {
520
540
  size: "sm",
521
541
  weight: "medium"
522
542
  }, {
523
543
  default: a(() => [
524
- z(V(e(l)("fields.choices")), 1)
544
+ S(V(e(l)("fields.choices")), 1)
525
545
  ]),
526
546
  _: 1
527
547
  }),
528
- q.value.length === 0 ? (u(), w(e(J), {
548
+ R.value.length === 0 ? (o(), w(e(Q), {
529
549
  key: 0,
530
550
  size: "sm",
531
551
  tone: "placeholder"
532
552
  }, {
533
553
  default: a(() => [
534
- z(V(e(l)("fields.no-choices")), 1)
554
+ S(V(e(l)("fields.no-choices")), 1)
535
555
  ]),
536
556
  _: 1
537
- })) : H("", !0),
538
- (u(!0), j(ee, null, ke(q.value, (y, ue) => (u(), j("div", {
539
- key: ue,
557
+ })) : E("", !0),
558
+ (o(!0), G(ee, null, ge(R.value, (g, re) => (o(), G("div", {
559
+ key: re,
540
560
  class: "wx-inbox-choices__row"
541
561
  }, [
542
- t(e(X), {
543
- "model-value": y.value,
562
+ t(e(le), {
563
+ "model-value": g.value,
544
564
  placeholder: e(l)("fields.choice-value"),
545
- "onUpdate:modelValue": (re) => pe(ue, { value: String(re) })
565
+ "onUpdate:modelValue": (de) => me(re, { value: String(de) })
546
566
  }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
547
- t(e(X), {
548
- "model-value": y.label,
567
+ t(e(le), {
568
+ "model-value": g.label,
549
569
  localized: "",
550
570
  placeholder: e(l)("fields.choice-label"),
551
- "onUpdate:modelValue": (re) => pe(ue, { label: re })
571
+ "onUpdate:modelValue": (de) => me(re, { label: de })
552
572
  }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
553
- t(e(Ve), {
573
+ t(e($e), {
554
574
  icon: "trash",
555
575
  title: e(l)("fields.delete"),
556
- onClick: (re) => ye(ue)
576
+ onClick: (de) => J(re)
557
577
  }, null, 8, ["title", "onClick"])
558
578
  ]))), 128)),
559
- t(e(le), {
579
+ t(e(te), {
560
580
  variant: "outline",
561
581
  size: "sm",
562
- onClick: Y
582
+ onClick: O
563
583
  }, {
564
584
  icon: a(() => [
565
- t(e($e), { name: "plus" })
585
+ t(e(_e), { name: "plus" })
566
586
  ]),
567
587
  default: a(() => [
568
- z(" " + V(e(l)("fields.add-choice")), 1)
588
+ S(" " + V(e(l)("fields.add-choice")), 1)
569
589
  ]),
570
590
  _: 1
571
591
  })
572
- ])) : H("", !0),
573
- G("div", Ll, [
574
- C.value === "textarea" ? (u(), w(e(B), {
592
+ ])) : E("", !0),
593
+ K("div", El, [
594
+ C.value === "textarea" ? (o(), w(e(H), {
575
595
  key: 0,
576
596
  label: e(l)("fields.rows")
577
597
  }, {
578
598
  default: a(() => [
579
- t(e(we), {
580
- "model-value": c.value.rows ?? 5,
599
+ t(e(Ve), {
600
+ "model-value": m.value.rows ?? 5,
581
601
  min: 2,
582
602
  max: 30,
583
- "onUpdate:modelValue": k[6] || (k[6] = (y) => v("rows", y))
603
+ "onUpdate:modelValue": k[6] || (k[6] = (g) => r("rows", g))
584
604
  }, null, 8, ["model-value"])
585
605
  ]),
586
606
  _: 1
587
- }, 8, ["label"])) : H("", !0),
588
- ["text", "email", "textarea"].includes(C.value) ? (u(), w(e(B), {
607
+ }, 8, ["label"])) : E("", !0),
608
+ ["text", "email", "textarea"].includes(C.value) ? (o(), w(e(H), {
589
609
  key: 1,
590
610
  label: e(l)("fields.maxlength")
591
611
  }, {
592
612
  default: a(() => [
593
- t(e(we), {
594
- "model-value": c.value.maxlength ?? null,
613
+ t(e(Ve), {
614
+ "model-value": m.value.maxlength ?? null,
595
615
  min: 1,
596
616
  max: 2e4,
597
- "onUpdate:modelValue": k[7] || (k[7] = (y) => v("maxlength", y))
617
+ "onUpdate:modelValue": k[7] || (k[7] = (g) => r("maxlength", g))
598
618
  }, null, 8, ["model-value"])
599
619
  ]),
600
620
  _: 1
601
- }, 8, ["label"])) : H("", !0),
602
- C.value === "tel" ? (u(), w(e(B), {
621
+ }, 8, ["label"])) : E("", !0),
622
+ C.value === "tel" ? (o(), w(e(H), {
603
623
  key: 2,
604
624
  label: e(l)("fields.pattern"),
605
625
  help: e(l)("fields.pattern-help")
606
626
  }, {
607
627
  default: a(() => [
608
- t(e(X), {
609
- "model-value": c.value.pattern ?? "",
610
- "onUpdate:modelValue": k[8] || (k[8] = (y) => v("pattern", y))
628
+ t(e(le), {
629
+ "model-value": m.value.pattern ?? "",
630
+ "onUpdate:modelValue": k[8] || (k[8] = (g) => r("pattern", g))
611
631
  }, null, 8, ["model-value"])
612
632
  ]),
613
633
  _: 1
614
- }, 8, ["label", "help"])) : H("", !0),
615
- C.value === "date" ? (u(), j(ee, { key: 3 }, [
616
- t(e(B), {
634
+ }, 8, ["label", "help"])) : E("", !0),
635
+ C.value === "date" ? (o(), G(ee, { key: 3 }, [
636
+ t(e(H), {
617
637
  label: e(l)("fields.earliest")
618
638
  }, {
619
639
  default: a(() => [
620
- t(e(Ze), {
640
+ t(e(ll), {
621
641
  clearable: "",
622
- "model-value": c.value.min ?? null,
623
- "onUpdate:modelValue": k[9] || (k[9] = (y) => v("min", y))
642
+ "model-value": m.value.min ?? null,
643
+ "onUpdate:modelValue": k[9] || (k[9] = (g) => r("min", g))
624
644
  }, null, 8, ["model-value"])
625
645
  ]),
626
646
  _: 1
627
647
  }, 8, ["label"]),
628
- t(e(B), {
648
+ t(e(H), {
629
649
  label: e(l)("fields.latest")
630
650
  }, {
631
651
  default: a(() => [
632
- t(e(Ze), {
652
+ t(e(ll), {
633
653
  clearable: "",
634
- "model-value": c.value.max ?? null,
635
- "onUpdate:modelValue": k[10] || (k[10] = (y) => v("max", y))
654
+ "model-value": m.value.max ?? null,
655
+ "onUpdate:modelValue": k[10] || (k[10] = (g) => r("max", g))
636
656
  }, null, 8, ["model-value"])
637
657
  ]),
638
658
  _: 1
639
659
  }, 8, ["label"])
640
- ], 64)) : H("", !0),
641
- C.value === "checkbox" ? (u(), j(ee, { key: 4 }, [
642
- t(e(B), {
660
+ ], 64)) : E("", !0),
661
+ C.value === "checkbox" ? (o(), G(ee, { key: 4 }, [
662
+ t(e(H), {
643
663
  label: e(l)("fields.min-choices")
644
664
  }, {
645
665
  default: a(() => [
646
- t(e(we), {
647
- "model-value": c.value.min ?? null,
666
+ t(e(Ve), {
667
+ "model-value": m.value.min ?? null,
648
668
  min: 0,
649
- "onUpdate:modelValue": k[11] || (k[11] = (y) => v("min", y))
669
+ "onUpdate:modelValue": k[11] || (k[11] = (g) => r("min", g))
650
670
  }, null, 8, ["model-value"])
651
671
  ]),
652
672
  _: 1
653
673
  }, 8, ["label"]),
654
- t(e(B), {
674
+ t(e(H), {
655
675
  label: e(l)("fields.max-choices")
656
676
  }, {
657
677
  default: a(() => [
658
- t(e(we), {
659
- "model-value": c.value.max ?? null,
678
+ t(e(Ve), {
679
+ "model-value": m.value.max ?? null,
660
680
  min: 0,
661
- "onUpdate:modelValue": k[12] || (k[12] = (y) => v("max", y))
681
+ "onUpdate:modelValue": k[12] || (k[12] = (g) => r("max", g))
662
682
  }, null, 8, ["model-value"])
663
683
  ]),
664
684
  _: 1
665
685
  }, 8, ["label"])
666
- ], 64)) : H("", !0),
667
- C.value === "file" ? (u(), w(e(B), {
686
+ ], 64)) : E("", !0),
687
+ C.value === "file" ? (o(), w(e(H), {
668
688
  key: 5,
669
689
  label: e(l)("fields.max-size")
670
690
  }, {
671
691
  default: a(() => [
672
- t(e(we), {
673
- "model-value": c.value.max_size ?? null,
692
+ t(e(Ve), {
693
+ "model-value": m.value.max_size ?? null,
674
694
  min: 1,
675
- "onUpdate:modelValue": k[13] || (k[13] = (y) => v("max_size", y))
695
+ "onUpdate:modelValue": k[13] || (k[13] = (g) => r("max_size", g))
676
696
  }, null, 8, ["model-value"])
677
697
  ]),
678
698
  _: 1
679
- }, 8, ["label"])) : H("", !0)
699
+ }, 8, ["label"])) : E("", !0)
680
700
  ]),
681
- C.value === "file" ? (u(), j(ee, { key: 3 }, [
682
- t(e(B), {
701
+ C.value === "file" ? (o(), G(ee, { key: 3 }, [
702
+ t(e(H), {
683
703
  label: e(l)("fields.extensions"),
684
704
  help: e(l)("fields.extensions-help")
685
705
  }, {
686
706
  default: a(() => [
687
- t(e(_l), {
688
- modelValue: M.value,
689
- "onUpdate:modelValue": k[14] || (k[14] = (y) => M.value = y)
707
+ t(e(kl), {
708
+ modelValue: B.value,
709
+ "onUpdate:modelValue": k[14] || (k[14] = (g) => B.value = g)
690
710
  }, null, 8, ["modelValue"])
691
711
  ]),
692
712
  _: 1
693
713
  }, 8, ["label", "help"]),
694
714
  t(e(he), {
695
- "model-value": !!c.value.multiple,
715
+ "model-value": !!m.value.multiple,
696
716
  label: e(l)("fields.multiple"),
697
- "onUpdate:modelValue": k[15] || (k[15] = (y) => v("multiple", y))
717
+ "onUpdate:modelValue": k[15] || (k[15] = (g) => r("multiple", g))
698
718
  }, null, 8, ["model-value", "label"])
699
- ], 64)) : H("", !0),
700
- G("div", Ol, [
719
+ ], 64)) : E("", !0),
720
+ K("div", Pl, [
701
721
  t(e(he), {
702
722
  modelValue: $.value,
703
- "onUpdate:modelValue": k[16] || (k[16] = (y) => $.value = y),
723
+ "onUpdate:modelValue": k[16] || (k[16] = (g) => $.value = g),
704
724
  label: e(l)("fields.is-enabled")
705
725
  }, null, 8, ["modelValue", "label"]),
706
726
  t(e(he), {
707
727
  modelValue: h.value,
708
- "onUpdate:modelValue": k[17] || (k[17] = (y) => h.value = y),
728
+ "onUpdate:modelValue": k[17] || (k[17] = (g) => h.value = g),
709
729
  label: e(l)("fields.is-required")
710
730
  }, null, 8, ["modelValue", "label"]),
711
- C.value !== "hidden" ? (u(), w(e(he), {
731
+ C.value !== "hidden" ? (o(), w(e(he), {
712
732
  key: 0,
713
- modelValue: O.value,
714
- "onUpdate:modelValue": k[18] || (k[18] = (y) => O.value = y),
733
+ modelValue: I.value,
734
+ "onUpdate:modelValue": k[18] || (k[18] = (g) => I.value = g),
715
735
  label: e(l)("fields.is-fullsize")
716
- }, null, 8, ["modelValue", "label"])) : H("", !0),
736
+ }, null, 8, ["modelValue", "label"])) : E("", !0),
717
737
  t(e(he), {
718
- modelValue: _.value,
719
- "onUpdate:modelValue": k[19] || (k[19] = (y) => _.value = y),
738
+ modelValue: x.value,
739
+ "onUpdate:modelValue": k[19] || (k[19] = (g) => x.value = g),
720
740
  label: e(l)("fields.in-table")
721
741
  }, null, 8, ["modelValue", "label"])
722
742
  ])
@@ -725,14 +745,14 @@ const Al = [
725
745
  _: 1
726
746
  }, 8, ["open", "title"]));
727
747
  }
728
- }), ie = (r, s) => {
729
- const o = r.__vccOpts || r;
730
- for (const [f, n] of s)
731
- o[f] = n;
732
- return o;
733
- }, El = /* @__PURE__ */ ie(Pl, [["__scopeId", "data-v-6696bbc1"]]), Rl = { class: "wx-inbox-field" }, Bl = { class: "wx-inbox-field__name" }, Hl = /* @__PURE__ */ ae({
748
+ }), ue = (i, s) => {
749
+ const u = i.__vccOpts || i;
750
+ for (const [v, n] of s)
751
+ u[v] = n;
752
+ return u;
753
+ }, Bl = /* @__PURE__ */ ue(Rl, [["__scopeId", "data-v-6696bbc1"]]), Hl = { class: "wx-inbox-field" }, Gl = { class: "wx-inbox-field__name" }, jl = /* @__PURE__ */ ne({
734
754
  __name: "FieldList",
735
- props: /* @__PURE__ */ Le({
755
+ props: /* @__PURE__ */ Pe({
736
756
  form: {},
737
757
  canManage: { type: Boolean }
738
758
  }, {
@@ -740,122 +760,122 @@ const Al = [
740
760
  modelModifiers: {}
741
761
  }),
742
762
  emits: ["update:modelValue"],
743
- setup(r) {
744
- const s = r, o = Ue(r, "modelValue"), f = oe(), n = de(f), d = xe();
745
- ce();
746
- const m = te("webx-inbox"), l = be(), U = Be(El);
747
- function p(c) {
748
- return fe(c.title, d.active.value, c.key);
749
- }
750
- function i(c) {
763
+ setup(i) {
764
+ const s = i, u = Se(i, "modelValue"), v = ie(), n = ce(v), c = we();
765
+ pe();
766
+ const f = ae("webx-inbox"), l = ye(), T = je(Bl);
767
+ function p(m) {
768
+ return be(m.title, c.active.value, m.key);
769
+ }
770
+ function d(m) {
751
771
  return [
752
- m(`fields.type-${c.type}`),
753
- ...c.is_required ? [m("fields.is-required")] : [],
754
- ...c.in_table ? [m("fields.in-table")] : [],
755
- ...c.is_fullsize ? [] : [m("fields.is-fullsize")]
772
+ f(`fields.type-${m.type}`),
773
+ ...m.is_required ? [f("fields.is-required")] : [],
774
+ ...m.in_table ? [f("fields.in-table")] : [],
775
+ ...m.is_fullsize ? [] : [f("fields.is-fullsize")]
756
776
  ];
757
777
  }
758
- const L = S(() => o.value.length === 0);
759
- async function C(c) {
760
- const $ = await U({ field: c, form: s.form });
761
- $ && (o.value = c === null ? [...o.value, $] : o.value.map((h) => h.id === $.id ? $ : h));
762
- }
763
- async function T(c) {
764
- if (await ze({
765
- title: m("fields.delete-title", { field: p(c) }),
766
- message: m("fields.delete-text"),
767
- confirmText: m("fields.delete"),
768
- cancelText: m("fields.cancel"),
778
+ const D = U(() => u.value.length === 0);
779
+ async function C(m) {
780
+ const $ = await T({ field: m, form: s.form });
781
+ $ && (u.value = m === null ? [...u.value, $] : u.value.map((h) => h.id === $.id ? $ : h));
782
+ }
783
+ async function z(m) {
784
+ if (await Ce({
785
+ title: f("fields.delete-title", { field: p(m) }),
786
+ message: f("fields.delete-text"),
787
+ confirmText: f("fields.delete"),
788
+ cancelText: f("fields.cancel"),
769
789
  tone: "danger"
770
790
  }))
771
791
  try {
772
- await n.removeField(c.id), o.value = o.value.filter((h) => h.id !== c.id), P.success(m("panel.deleted"));
792
+ await n.removeField(m.id), u.value = u.value.filter((h) => h.id !== m.id), L.success(f("panel.deleted"));
773
793
  } catch (h) {
774
- P.danger(l(h));
794
+ L.danger(l(h));
775
795
  }
776
796
  }
777
- function b(c) {
797
+ function b(m) {
778
798
  return s.canManage ? [
779
- { key: "edit", icon: "edit", label: m("fields.edit-field"), run: () => {
780
- C(c);
799
+ { key: "edit", icon: "edit", label: f("fields.edit"), run: () => {
800
+ C(m);
781
801
  } },
782
802
  {
783
803
  key: "delete",
784
804
  icon: "trash",
785
- label: m("fields.delete"),
805
+ label: f("fields.delete"),
786
806
  danger: !0,
787
807
  run: () => {
788
- T(c);
808
+ z(m);
789
809
  }
790
810
  }
791
811
  ] : [];
792
812
  }
793
- async function W() {
813
+ async function F() {
794
814
  try {
795
815
  await n.sortFields(
796
816
  s.form.id,
797
- o.value.map((c) => c.id)
817
+ u.value.map((m) => m.id)
798
818
  );
799
- } catch (c) {
800
- P.danger(l(c, m("panel.reorder-failed")));
819
+ } catch (m) {
820
+ L.danger(l(m, f("panel.reorder-failed")));
801
821
  }
802
822
  }
803
- return (c, $) => (u(), w(e(se), {
804
- title: e(m)("panel.tab-fields")
805
- }, Ne({
823
+ return (m, $) => (o(), w(e(oe), {
824
+ title: e(f)("panel.tab-fields")
825
+ }, Oe({
806
826
  default: a(() => [
807
- L.value ? (u(), w(e(He), {
827
+ D.value ? (o(), w(e(Ke), {
808
828
  key: 0,
809
- title: e(m)("fields.no-fields"),
810
- description: e(m)("fields.no-fields-help")
811
- }, null, 8, ["title", "description"])) : (u(), w(e(Je), {
829
+ title: e(f)("fields.no-fields"),
830
+ description: e(f)("fields.no-fields-help")
831
+ }, null, 8, ["title", "description"])) : (o(), w(e(al), {
812
832
  key: 1,
813
- modelValue: o.value,
814
- "onUpdate:modelValue": $[1] || ($[1] = (h) => o.value = h),
833
+ modelValue: u.value,
834
+ "onUpdate:modelValue": $[1] || ($[1] = (h) => u.value = h),
815
835
  plain: "",
816
836
  "item-key": "id",
817
837
  "item-label": p,
818
- disabled: !r.canManage,
819
- "aria-label": e(m)("panel.tab-fields"),
820
- onMove: W
838
+ disabled: !i.canManage,
839
+ "aria-label": e(f)("panel.tab-fields"),
840
+ onMove: F
821
841
  }, {
822
842
  default: a(({ item: h }) => [
823
- G("div", Rl, [
824
- G("div", Bl, [
825
- t(e(J), {
843
+ K("div", Hl, [
844
+ K("div", Gl, [
845
+ t(e(Q), {
826
846
  weight: "medium",
827
847
  truncate: ""
828
848
  }, {
829
849
  default: a(() => [
830
- z(V(p(h)), 1)
850
+ S(V(p(h)), 1)
831
851
  ]),
832
852
  _: 2
833
853
  }, 1024),
834
- h.is_enabled ? H("", !0) : (u(), w(e(Se), {
854
+ h.is_enabled ? E("", !0) : (o(), w(e(Ue), {
835
855
  key: 0,
836
856
  type: "default"
837
857
  }, {
838
858
  default: a(() => [
839
- z(V(e(m)("panel.off")), 1)
859
+ S(V(e(f)("panel.off")), 1)
840
860
  ]),
841
861
  _: 1
842
862
  }))
843
863
  ]),
844
- t(e(J), {
864
+ t(e(Q), {
845
865
  size: "sm",
846
866
  tone: "muted",
847
867
  truncate: ""
848
868
  }, {
849
869
  default: a(() => [
850
- G("code", null, "fields[" + V(h.key) + "]", 1),
851
- z(" · " + V(i(h).join(" · ")), 1)
870
+ K("code", null, "fields[" + V(h.key) + "]", 1),
871
+ S(" · " + V(d(h).join(" · ")), 1)
852
872
  ]),
853
873
  _: 2
854
874
  }, 1024)
855
875
  ])
856
876
  ]),
857
877
  actions: a(({ item: h }) => [
858
- t(e(Fe), {
878
+ t(e(ze), {
859
879
  actions: b(h),
860
880
  label: p(h)
861
881
  }, null, 8, ["actions", "label"])
@@ -865,19 +885,19 @@ const Al = [
865
885
  ]),
866
886
  _: 2
867
887
  }, [
868
- r.canManage ? {
888
+ i.canManage ? {
869
889
  name: "extra",
870
890
  fn: a(() => [
871
- t(e(le), {
891
+ t(e(te), {
872
892
  type: "primary",
873
893
  size: "sm",
874
894
  onClick: $[0] || ($[0] = (h) => C(null))
875
895
  }, {
876
896
  icon: a(() => [
877
- t(e($e), { name: "plus" })
897
+ t(e(_e), { name: "plus" })
878
898
  ]),
879
899
  default: a(() => [
880
- z(" " + V(e(m)("fields.new-field")), 1)
900
+ S(" " + V(e(f)("fields.new-field")), 1)
881
901
  ]),
882
902
  _: 1
883
903
  })
@@ -886,79 +906,79 @@ const Al = [
886
906
  } : void 0
887
907
  ]), 1032, ["title"]));
888
908
  }
889
- }), Gl = /* @__PURE__ */ ie(Hl, [["__scopeId", "data-v-421ed0af"]]);
890
- function me(r, s, o) {
891
- return S({
892
- get: () => r.value[s] ?? o,
893
- set: (f) => {
894
- const n = { ...r.value };
895
- f === "" || f === null || f === void 0 ? delete n[s] : n[s] = f, r.value = n;
909
+ }), Kl = /* @__PURE__ */ ue(jl, [["__scopeId", "data-v-60b85ad9"]]);
910
+ function ve(i, s, u) {
911
+ return U({
912
+ get: () => i.value[s] ?? u,
913
+ set: (v) => {
914
+ const n = { ...i.value };
915
+ v === "" || v === null || v === void 0 ? delete n[s] : n[s] = v, i.value = n;
896
916
  }
897
917
  });
898
918
  }
899
- const jl = /* @__PURE__ */ ae({
919
+ const Yl = /* @__PURE__ */ ne({
900
920
  __name: "FormAntispam",
901
921
  props: {
902
922
  modelValue: { required: !0 },
903
923
  modelModifiers: {}
904
924
  },
905
925
  emits: ["update:modelValue"],
906
- setup(r) {
907
- const s = Ue(r, "modelValue"), o = te("webx-inbox"), f = me(s, "antispam.honeypot", !0), n = me(s, "antispam.min_seconds", 3), d = me(s, "antispam.throttle", 5), m = me(s, "antispam.captcha", "off"), l = S(() => [
908
- { value: "off", label: o("panel.captcha-off") },
909
- { value: "recaptcha", label: o("panel.captcha-recaptcha") },
910
- { value: "turnstile", label: o("panel.captcha-turnstile") }
926
+ setup(i) {
927
+ const s = Se(i, "modelValue"), u = ae("webx-inbox"), v = ve(s, "antispam.honeypot", !0), n = ve(s, "antispam.min_seconds", 3), c = ve(s, "antispam.throttle", 5), f = ve(s, "antispam.captcha", "off"), l = U(() => [
928
+ { value: "off", label: u("panel.captcha-off") },
929
+ { value: "recaptcha", label: u("panel.captcha-recaptcha") },
930
+ { value: "turnstile", label: u("panel.captcha-turnstile") }
911
931
  ]);
912
- return (U, p) => (u(), w(e(se), null, {
932
+ return (T, p) => (o(), w(e(oe), null, {
913
933
  default: a(() => [
914
- t(e(B), {
915
- label: e(o)("panel.honeypot"),
916
- help: e(o)("panel.honeypot-help")
934
+ t(e(H), {
935
+ help: e(u)("panel.honeypot-help")
917
936
  }, {
918
937
  default: a(() => [
919
- t(e(rl), {
920
- modelValue: e(f),
921
- "onUpdate:modelValue": p[0] || (p[0] = (i) => ne(f) ? f.value = i : null)
922
- }, null, 8, ["modelValue"])
938
+ t(e(ml), {
939
+ modelValue: e(v),
940
+ "onUpdate:modelValue": p[0] || (p[0] = (d) => se(v) ? v.value = d : null),
941
+ label: e(u)("panel.honeypot")
942
+ }, null, 8, ["modelValue", "label"])
923
943
  ]),
924
944
  _: 1
925
- }, 8, ["label", "help"]),
926
- t(e(B), {
927
- label: e(o)("panel.min-seconds"),
928
- help: e(o)("panel.min-seconds-help")
945
+ }, 8, ["help"]),
946
+ t(e(H), {
947
+ label: e(u)("panel.min-seconds"),
948
+ help: e(u)("panel.min-seconds-help")
929
949
  }, {
930
950
  default: a(() => [
931
- t(e(we), {
951
+ t(e(Ve), {
932
952
  modelValue: e(n),
933
- "onUpdate:modelValue": p[1] || (p[1] = (i) => ne(n) ? n.value = i : null),
953
+ "onUpdate:modelValue": p[1] || (p[1] = (d) => se(n) ? n.value = d : null),
934
954
  min: 0,
935
955
  max: 120
936
956
  }, null, 8, ["modelValue"])
937
957
  ]),
938
958
  _: 1
939
959
  }, 8, ["label", "help"]),
940
- t(e(B), {
941
- label: e(o)("panel.throttle"),
942
- help: e(o)("panel.throttle-help")
960
+ t(e(H), {
961
+ label: e(u)("panel.throttle"),
962
+ help: e(u)("panel.throttle-help")
943
963
  }, {
944
964
  default: a(() => [
945
- t(e(we), {
946
- modelValue: e(d),
947
- "onUpdate:modelValue": p[2] || (p[2] = (i) => ne(d) ? d.value = i : null),
965
+ t(e(Ve), {
966
+ modelValue: e(c),
967
+ "onUpdate:modelValue": p[2] || (p[2] = (d) => se(c) ? c.value = d : null),
948
968
  min: 0,
949
969
  max: 120
950
970
  }, null, 8, ["modelValue"])
951
971
  ]),
952
972
  _: 1
953
973
  }, 8, ["label", "help"]),
954
- t(e(B), {
955
- label: e(o)("panel.captcha"),
956
- help: e(o)("panel.captcha-help")
974
+ t(e(H), {
975
+ label: e(u)("panel.captcha"),
976
+ help: e(u)("panel.captcha-help")
957
977
  }, {
958
978
  default: a(() => [
959
- t(e(ve), {
960
- modelValue: e(m),
961
- "onUpdate:modelValue": p[3] || (p[3] = (i) => ne(m) ? m.value = i : null),
979
+ t(e(fe), {
980
+ modelValue: e(f),
981
+ "onUpdate:modelValue": p[3] || (p[3] = (d) => se(f) ? f.value = d : null),
962
982
  options: l.value
963
983
  }, null, 8, ["modelValue", "options"])
964
984
  ]),
@@ -968,115 +988,115 @@ const jl = /* @__PURE__ */ ae({
968
988
  _: 1
969
989
  }));
970
990
  }
971
- }), Kl = { class: "wx-inbox-embed" }, Yl = { class: "wx-inbox-embed__snippet" }, Zl = { class: "wx-inbox-embed__snippet" }, Ql = /* @__PURE__ */ ae({
991
+ }), Zl = { class: "wx-inbox-embed" }, Ql = { class: "wx-inbox-embed__snippet" }, Jl = { class: "wx-inbox-embed__snippet" }, Xl = /* @__PURE__ */ ne({
972
992
  __name: "FormEmbed",
973
993
  props: {
974
994
  form: {},
975
995
  slug: {},
976
996
  fields: {}
977
997
  },
978
- setup(r) {
979
- const s = r;
980
- ce();
981
- const o = te("webx-inbox"), f = S(() => `<x-webx-inbox::form slug="${s.slug}" />`), n = S(
998
+ setup(i) {
999
+ const s = i;
1000
+ pe();
1001
+ const u = ae("webx-inbox"), v = U(() => `<x-webx-inbox::form slug="${s.slug}" />`), n = U(
982
1002
  () => `{{-- resources/views/blocks/contact.blade.php --}}
983
1003
  <x-webx-inbox::form slug="${s.slug}" />`
984
- ), d = S(() => [
985
- { key: "key", label: o("fields.name") },
986
- { key: "title", label: o("fields.title") },
987
- { key: "type", label: o("fields.type"), hideBelow: 520 }
988
- ]), m = S(() => s.fields.filter((U) => U.is_enabled));
989
- async function l(U) {
1004
+ ), c = U(() => [
1005
+ { key: "key", label: u("fields.name") },
1006
+ { key: "title", label: u("fields.title") },
1007
+ { key: "type", label: u("fields.type"), hideBelow: 520 }
1008
+ ]), f = U(() => s.fields.filter((T) => T.is_enabled));
1009
+ async function l(T) {
990
1010
  try {
991
- await navigator.clipboard.writeText(U), P.success(o("panel.copied"));
1011
+ await navigator.clipboard.writeText(T), L.success(u("panel.copied"));
992
1012
  } catch {
993
1013
  }
994
1014
  }
995
- return (U, p) => (u(), j("div", Kl, [
996
- t(e(se), {
997
- title: e(o)("panel.embed-blade")
1015
+ return (T, p) => (o(), G("div", Zl, [
1016
+ t(e(oe), {
1017
+ title: e(u)("panel.embed-blade")
998
1018
  }, {
999
1019
  default: a(() => [
1000
- t(e(J), {
1020
+ t(e(Q), {
1001
1021
  size: "sm",
1002
1022
  tone: "muted"
1003
1023
  }, {
1004
1024
  default: a(() => [
1005
- z(V(e(o)("panel.embed-blade-help")), 1)
1025
+ S(V(e(u)("panel.embed-blade-help")), 1)
1006
1026
  ]),
1007
1027
  _: 1
1008
1028
  }),
1009
- G("div", Yl, [
1010
- G("code", null, V(f.value), 1),
1011
- t(e(Ve), {
1029
+ K("div", Ql, [
1030
+ K("code", null, V(v.value), 1),
1031
+ t(e($e), {
1012
1032
  icon: "copy",
1013
- title: e(o)("panel.copy"),
1014
- onClick: p[0] || (p[0] = (i) => l(f.value))
1033
+ title: e(u)("panel.copy"),
1034
+ onClick: p[0] || (p[0] = (d) => l(v.value))
1015
1035
  }, null, 8, ["title"])
1016
1036
  ])
1017
1037
  ]),
1018
1038
  _: 1
1019
1039
  }, 8, ["title"]),
1020
- t(e(se), {
1021
- title: e(o)("panel.embed-block")
1040
+ t(e(oe), {
1041
+ title: e(u)("panel.embed-block")
1022
1042
  }, {
1023
1043
  default: a(() => [
1024
- t(e(J), {
1044
+ t(e(Q), {
1025
1045
  size: "sm",
1026
1046
  tone: "muted"
1027
1047
  }, {
1028
1048
  default: a(() => [
1029
- z(V(e(o)("panel.embed-block-help")), 1)
1049
+ S(V(e(u)("panel.embed-block-help")), 1)
1030
1050
  ]),
1031
1051
  _: 1
1032
1052
  }),
1033
- G("div", Zl, [
1034
- G("code", null, V(n.value), 1),
1035
- t(e(Ve), {
1053
+ K("div", Jl, [
1054
+ K("code", null, V(n.value), 1),
1055
+ t(e($e), {
1036
1056
  icon: "copy",
1037
- title: e(o)("panel.copy"),
1038
- onClick: p[1] || (p[1] = (i) => l(n.value))
1057
+ title: e(u)("panel.copy"),
1058
+ onClick: p[1] || (p[1] = (d) => l(n.value))
1039
1059
  }, null, 8, ["title"])
1040
1060
  ])
1041
1061
  ]),
1042
1062
  _: 1
1043
1063
  }, 8, ["title"]),
1044
- t(e(se), {
1045
- title: e(o)("panel.embed-names")
1064
+ t(e(oe), {
1065
+ title: e(u)("panel.embed-names")
1046
1066
  }, {
1047
1067
  default: a(() => [
1048
- t(e(J), {
1068
+ t(e(Q), {
1049
1069
  size: "sm",
1050
1070
  tone: "muted"
1051
1071
  }, {
1052
1072
  default: a(() => [
1053
- z(V(e(o)("panel.embed-names-help")), 1)
1073
+ S(V(e(u)("panel.embed-names-help")), 1)
1054
1074
  ]),
1055
1075
  _: 1
1056
1076
  }),
1057
- t(e(dl), {
1058
- data: m.value,
1059
- columns: d.value,
1077
+ t(e(vl), {
1078
+ data: f.value,
1079
+ columns: c.value,
1060
1080
  "row-key": "id",
1061
1081
  flush: "",
1062
- "empty-text": e(o)("fields.no-fields")
1082
+ "empty-text": e(u)("fields.no-fields")
1063
1083
  }, {
1064
- "cell-key": a(({ row: i }) => [
1065
- t(e(J), {
1084
+ "cell-key": a(({ row: d }) => [
1085
+ t(e(Q), {
1066
1086
  mono: "",
1067
1087
  size: "sm"
1068
1088
  }, {
1069
1089
  default: a(() => [
1070
- z("fields[" + V(i.key) + "]", 1)
1090
+ S("fields[" + V(d.key) + "]", 1)
1071
1091
  ]),
1072
1092
  _: 2
1073
1093
  }, 1024)
1074
1094
  ]),
1075
- "cell-title": a(({ row: i }) => [
1076
- z(V(Object.values(i.title)[0] ?? i.key), 1)
1095
+ "cell-title": a(({ row: d }) => [
1096
+ S(V(Object.values(d.title)[0] ?? d.key), 1)
1077
1097
  ]),
1078
- "cell-type": a(({ row: i }) => [
1079
- z(V(e(o)(`fields.type-${i.type}`)), 1)
1098
+ "cell-type": a(({ row: d }) => [
1099
+ S(V(e(u)(`fields.type-${d.type}`)), 1)
1080
1100
  ]),
1081
1101
  _: 1
1082
1102
  }, 8, ["data", "columns", "empty-text"])
@@ -1085,9 +1105,9 @@ const jl = /* @__PURE__ */ ae({
1085
1105
  }, 8, ["title"])
1086
1106
  ]));
1087
1107
  }
1088
- }), Jl = /* @__PURE__ */ ie(Ql, [["__scopeId", "data-v-e415689b"]]), Xl = { class: "wx-inbox-general" }, et = /* @__PURE__ */ ae({
1108
+ }), et = /* @__PURE__ */ ue(Xl, [["__scopeId", "data-v-e415689b"]]), lt = { class: "wx-inbox-general" }, tt = /* @__PURE__ */ ne({
1089
1109
  __name: "FormGeneral",
1090
- props: /* @__PURE__ */ Le({
1110
+ props: /* @__PURE__ */ Pe({
1091
1111
  errors: {}
1092
1112
  }, {
1093
1113
  settings: { required: !0 },
@@ -1096,105 +1116,105 @@ const jl = /* @__PURE__ */ ae({
1096
1116
  optionsModifiers: {}
1097
1117
  }),
1098
1118
  emits: ["update:settings", "update:options"],
1099
- setup(r) {
1100
- const s = Ue(
1101
- r,
1119
+ setup(i) {
1120
+ const s = Se(
1121
+ i,
1102
1122
  "settings"
1103
- ), o = Ue(r, "options"), f = te("webx-inbox"), n = me(o, "thank-you.heading", {}), d = me(o, "thank-you.text", {}), m = me(o, "design.submit-text", {}), l = me(o, "redirect", "");
1104
- return (U, p) => (u(), j("div", Xl, [
1105
- t(e(se), null, {
1123
+ ), u = Se(i, "options"), v = ae("webx-inbox"), n = ve(u, "thank-you.heading", {}), c = ve(u, "thank-you.text", {}), f = ve(u, "design.submit-text", {}), l = ve(u, "redirect", "");
1124
+ return (T, p) => (o(), G("div", lt, [
1125
+ t(e(oe), null, {
1106
1126
  default: a(() => [
1107
- t(e(B), {
1108
- label: e(f)("panel.title"),
1109
- error: r.errors.title?.[0],
1127
+ t(e(H), {
1128
+ label: e(v)("panel.title"),
1129
+ error: i.errors.title?.[0],
1110
1130
  required: ""
1111
1131
  }, {
1112
1132
  default: a(() => [
1113
- t(e(X), {
1133
+ t(e(le), {
1114
1134
  modelValue: s.value.title,
1115
- "onUpdate:modelValue": p[0] || (p[0] = (i) => s.value.title = i),
1135
+ "onUpdate:modelValue": p[0] || (p[0] = (d) => s.value.title = d),
1116
1136
  localized: ""
1117
1137
  }, null, 8, ["modelValue"])
1118
1138
  ]),
1119
1139
  _: 1
1120
1140
  }, 8, ["label", "error"]),
1121
- t(e(B), {
1122
- label: e(f)("panel.slug"),
1123
- help: e(f)("panel.slug-help"),
1124
- error: r.errors.slug?.[0],
1141
+ t(e(H), {
1142
+ label: e(v)("panel.slug"),
1143
+ help: e(v)("panel.slug-help"),
1144
+ error: i.errors.slug?.[0],
1125
1145
  required: ""
1126
1146
  }, {
1127
1147
  default: a(() => [
1128
- t(e(X), {
1148
+ t(e(le), {
1129
1149
  modelValue: s.value.slug,
1130
- "onUpdate:modelValue": p[1] || (p[1] = (i) => s.value.slug = i),
1150
+ "onUpdate:modelValue": p[1] || (p[1] = (d) => s.value.slug = d),
1131
1151
  placeholder: "contact"
1132
1152
  }, null, 8, ["modelValue"])
1133
1153
  ]),
1134
1154
  _: 1
1135
1155
  }, 8, ["label", "help", "error"]),
1136
- t(e(B), {
1137
- label: e(f)("panel.is-enabled"),
1138
- help: e(f)("panel.is-enabled-help")
1156
+ t(e(H), {
1157
+ help: e(v)("panel.is-enabled-help")
1139
1158
  }, {
1140
1159
  default: a(() => [
1141
- t(e(rl), {
1160
+ t(e(ml), {
1142
1161
  modelValue: s.value.is_enabled,
1143
- "onUpdate:modelValue": p[2] || (p[2] = (i) => s.value.is_enabled = i)
1144
- }, null, 8, ["modelValue"])
1162
+ "onUpdate:modelValue": p[2] || (p[2] = (d) => s.value.is_enabled = d),
1163
+ label: e(v)("panel.is-enabled")
1164
+ }, null, 8, ["modelValue", "label"])
1145
1165
  ]),
1146
1166
  _: 1
1147
- }, 8, ["label", "help"])
1167
+ }, 8, ["help"])
1148
1168
  ]),
1149
1169
  _: 1
1150
1170
  }),
1151
- t(e(se), {
1152
- title: e(f)("panel.after-sending")
1171
+ t(e(oe), {
1172
+ title: e(v)("panel.after-sending")
1153
1173
  }, {
1154
1174
  default: a(() => [
1155
- t(e(B), {
1156
- label: e(f)("panel.submit-text")
1175
+ t(e(H), {
1176
+ label: e(v)("panel.submit-text")
1157
1177
  }, {
1158
1178
  default: a(() => [
1159
- t(e(X), {
1160
- modelValue: e(m),
1161
- "onUpdate:modelValue": p[3] || (p[3] = (i) => ne(m) ? m.value = i : null),
1179
+ t(e(le), {
1180
+ modelValue: e(f),
1181
+ "onUpdate:modelValue": p[3] || (p[3] = (d) => se(f) ? f.value = d : null),
1162
1182
  localized: ""
1163
1183
  }, null, 8, ["modelValue"])
1164
1184
  ]),
1165
1185
  _: 1
1166
1186
  }, 8, ["label"]),
1167
- t(e(B), {
1168
- label: e(f)("panel.thank-you-heading")
1187
+ t(e(H), {
1188
+ label: e(v)("panel.thank-you-heading")
1169
1189
  }, {
1170
1190
  default: a(() => [
1171
- t(e(X), {
1191
+ t(e(le), {
1172
1192
  modelValue: e(n),
1173
- "onUpdate:modelValue": p[4] || (p[4] = (i) => ne(n) ? n.value = i : null),
1193
+ "onUpdate:modelValue": p[4] || (p[4] = (d) => se(n) ? n.value = d : null),
1174
1194
  localized: ""
1175
1195
  }, null, 8, ["modelValue"])
1176
1196
  ]),
1177
1197
  _: 1
1178
1198
  }, 8, ["label"]),
1179
- t(e(B), {
1180
- label: e(f)("panel.thank-you-text")
1199
+ t(e(H), {
1200
+ label: e(v)("panel.thank-you-text")
1181
1201
  }, {
1182
1202
  default: a(() => [
1183
- t(cl, {
1184
- modelValue: e(d),
1185
- "onUpdate:modelValue": p[5] || (p[5] = (i) => ne(d) ? d.value = i : null)
1203
+ t(fl, {
1204
+ modelValue: e(c),
1205
+ "onUpdate:modelValue": p[5] || (p[5] = (d) => se(c) ? c.value = d : null)
1186
1206
  }, null, 8, ["modelValue"])
1187
1207
  ]),
1188
1208
  _: 1
1189
1209
  }, 8, ["label"]),
1190
- t(e(B), {
1191
- label: e(f)("panel.redirect"),
1192
- help: e(f)("panel.redirect-help")
1210
+ t(e(H), {
1211
+ label: e(v)("panel.redirect"),
1212
+ help: e(v)("panel.redirect-help")
1193
1213
  }, {
1194
1214
  default: a(() => [
1195
- t(e(X), {
1215
+ t(e(le), {
1196
1216
  modelValue: e(l),
1197
- "onUpdate:modelValue": p[6] || (p[6] = (i) => ne(l) ? l.value = i : null),
1217
+ "onUpdate:modelValue": p[6] || (p[6] = (d) => se(l) ? l.value = d : null),
1198
1218
  placeholder: "/thank-you"
1199
1219
  }, null, 8, ["modelValue"])
1200
1220
  ]),
@@ -1205,143 +1225,170 @@ const jl = /* @__PURE__ */ ae({
1205
1225
  }, 8, ["title"])
1206
1226
  ]));
1207
1227
  }
1208
- }), lt = /* @__PURE__ */ ie(et, [["__scopeId", "data-v-35e56e3d"]]), tt = { class: "wx-inbox-recipients" }, at = /* @__PURE__ */ ae({
1228
+ }), at = /* @__PURE__ */ ue(tt, [["__scopeId", "data-v-1932aefe"]]), nt = /^[^\s@]+@[^\s@]+$/;
1229
+ function Le(i) {
1230
+ return "admin_id" in i;
1231
+ }
1232
+ function bl(i, s = []) {
1233
+ return Le(i) ? s.find(
1234
+ (v) => v.type === "admin" && v.admin_id === i.admin_id
1235
+ )?.problem ?? null : nt.test((i.email ?? "").trim()) ? null : "invalid_email";
1236
+ }
1237
+ function st(i, s = []) {
1238
+ return (i ?? []).some((u) => bl(u, s) === null);
1239
+ }
1240
+ const ot = { class: "wx-inbox-recipients" }, it = { class: "wx-inbox-recipients__row" }, ut = /* @__PURE__ */ ne({
1209
1241
  __name: "FormNotifications",
1210
- props: /* @__PURE__ */ Le({
1242
+ props: /* @__PURE__ */ Pe({
1211
1243
  fields: {},
1212
- errors: {}
1244
+ errors: {},
1245
+ reported: {}
1213
1246
  }, {
1214
1247
  modelValue: { required: !0 },
1215
1248
  modelModifiers: {}
1216
1249
  }),
1217
1250
  emits: ["update:modelValue"],
1218
- setup(r) {
1219
- const s = r, o = Ue(r, "modelValue"), f = oe(), n = de(f), d = te("webx-inbox"), m = F([]), l = me(o, "recipients", []), U = me(o, "email_field", "");
1220
- fl(async () => {
1251
+ setup(i) {
1252
+ const s = i, u = Se(i, "modelValue"), v = ie(), n = ce(v), c = ae("webx-inbox"), f = q([]), l = ve(u, "recipients", []), T = ve(u, "email_field", "");
1253
+ yl(async () => {
1221
1254
  try {
1222
- m.value = await n.recipients();
1255
+ f.value = await n.recipients();
1223
1256
  } catch {
1224
1257
  }
1225
1258
  });
1226
- const p = S(
1227
- () => m.value.map((c) => ({ value: c.id, label: `${c.name} · ${c.email}` }))
1228
- ), i = S(() => [
1229
- { value: "", label: d("panel.no-email-field") },
1230
- ...s.fields.filter((c) => c.type === "email").map((c) => ({ value: c.key, label: c.key }))
1259
+ const p = U(
1260
+ () => f.value.map((m) => ({ value: m.id, label: `${m.name} · ${m.email}` }))
1261
+ ), d = U(() => [
1262
+ { value: "", label: c("panel.no-email-field") },
1263
+ ...s.fields.filter((m) => m.type === "email").map((m) => ({ value: m.key, label: m.key }))
1231
1264
  ]);
1232
- function L(c) {
1233
- return "admin_id" in c;
1234
- }
1235
- function C(c) {
1236
- l.value = [...l.value, c];
1237
- }
1238
- async function T(c) {
1239
- const $ = l.value[c];
1240
- $ !== void 0 && (L($) || ($.email ?? "").trim() !== "") && !await ze({
1241
- title: d("panel.remove-recipient-title"),
1242
- message: d("panel.remove-recipient-text"),
1243
- confirmText: d("panel.remove"),
1244
- cancelText: d("panel.cancel"),
1265
+ function D(m) {
1266
+ if (!Le(m)) return null;
1267
+ const $ = bl(m, s.reported);
1268
+ return $ === null ? null : c(`panel.recipient-${$}`);
1269
+ }
1270
+ function C(m) {
1271
+ l.value = [...l.value, m];
1272
+ }
1273
+ async function z(m) {
1274
+ const $ = l.value[m];
1275
+ $ !== void 0 && (Le($) || ($.email ?? "").trim() !== "") && !await Ce({
1276
+ title: c("panel.remove-recipient-title"),
1277
+ message: c("panel.remove-recipient-text"),
1278
+ confirmText: c("panel.remove"),
1279
+ cancelText: c("panel.cancel"),
1245
1280
  tone: "danger"
1246
- }) || (l.value = l.value.filter((O, _) => _ !== c));
1281
+ }) || (l.value = l.value.filter((I, x) => x !== m));
1247
1282
  }
1248
- function b(c, $) {
1249
- l.value = l.value.map((h, O) => O === c ? { admin_id: $ } : h);
1283
+ function b(m, $) {
1284
+ l.value = l.value.map((h, I) => I === m ? { admin_id: $ } : h);
1250
1285
  }
1251
- function W(c, $) {
1252
- l.value = l.value.map((h, O) => O === c ? { email: $ } : h);
1286
+ function F(m, $) {
1287
+ l.value = l.value.map((h, I) => I === m ? { email: $ } : h);
1253
1288
  }
1254
- return (c, $) => (u(), w(e(se), {
1255
- title: e(d)("panel.recipients")
1289
+ return (m, $) => (o(), w(e(oe), {
1290
+ title: e(c)("panel.recipients")
1256
1291
  }, {
1257
1292
  default: a(() => [
1258
- t(e(J), {
1293
+ t(e(Q), {
1259
1294
  size: "sm",
1260
1295
  tone: "muted"
1261
1296
  }, {
1262
1297
  default: a(() => [
1263
- z(V(e(d)("panel.recipients-help")), 1)
1298
+ S(V(e(c)("panel.recipients-help")), 1)
1264
1299
  ]),
1265
1300
  _: 1
1266
1301
  }),
1267
- r.errors["options.recipients"] ? (u(), w(e(Me), {
1302
+ i.errors["options.recipients"] ? (o(), w(e(Fe), {
1268
1303
  key: 0,
1269
1304
  type: "danger",
1270
1305
  variant: "soft",
1271
- description: r.errors["options.recipients"]?.[0]
1272
- }, null, 8, ["description"])) : H("", !0),
1273
- G("div", tt, [
1274
- e(l).length === 0 ? (u(), w(e(J), {
1306
+ description: i.errors["options.recipients"]?.[0]
1307
+ }, null, 8, ["description"])) : E("", !0),
1308
+ K("div", ot, [
1309
+ e(l).length === 0 ? (o(), w(e(Q), {
1275
1310
  key: 0,
1276
1311
  size: "sm",
1277
1312
  tone: "placeholder"
1278
1313
  }, {
1279
1314
  default: a(() => [
1280
- z(V(e(d)("panel.no-recipients")), 1)
1315
+ S(V(e(c)("panel.no-recipients")), 1)
1281
1316
  ]),
1282
1317
  _: 1
1283
- })) : H("", !0),
1284
- (u(!0), j(ee, null, ke(e(l), (h, O) => (u(), j("div", {
1285
- key: O,
1286
- class: "wx-inbox-recipients__row"
1318
+ })) : E("", !0),
1319
+ (o(!0), G(ee, null, ge(e(l), (h, I) => (o(), G("div", {
1320
+ key: I,
1321
+ class: "wx-inbox-recipients__item"
1287
1322
  }, [
1288
- L(h) ? (u(), w(e(ve), {
1323
+ K("div", it, [
1324
+ e(Le)(h) ? (o(), w(e(fe), {
1325
+ key: 0,
1326
+ "model-value": h.admin_id,
1327
+ options: p.value,
1328
+ "onUpdate:modelValue": (x) => b(I, Number(x))
1329
+ }, null, 8, ["model-value", "options", "onUpdate:modelValue"])) : (o(), w(e(le), {
1330
+ key: 1,
1331
+ "model-value": h.email,
1332
+ type: "email",
1333
+ placeholder: "sales@example.com",
1334
+ "onUpdate:modelValue": (x) => F(I, String(x))
1335
+ }, null, 8, ["model-value", "onUpdate:modelValue"])),
1336
+ t(e($e), {
1337
+ icon: "trash",
1338
+ tone: "danger",
1339
+ title: e(c)("panel.remove"),
1340
+ onClick: (x) => z(I)
1341
+ }, null, 8, ["title", "onClick"])
1342
+ ]),
1343
+ D(h) ? (o(), w(e(Q), {
1289
1344
  key: 0,
1290
- "model-value": h.admin_id,
1291
- options: p.value,
1292
- "onUpdate:modelValue": (_) => b(O, Number(_))
1293
- }, null, 8, ["model-value", "options", "onUpdate:modelValue"])) : (u(), w(e(X), {
1294
- key: 1,
1295
- "model-value": h.email,
1296
- type: "email",
1297
- placeholder: "sales@example.com",
1298
- "onUpdate:modelValue": (_) => W(O, String(_))
1299
- }, null, 8, ["model-value", "onUpdate:modelValue"])),
1300
- t(e(Ve), {
1301
- icon: "trash",
1302
- tone: "danger",
1303
- title: e(d)("panel.remove"),
1304
- onClick: (_) => T(O)
1305
- }, null, 8, ["title", "onClick"])
1345
+ size: "sm",
1346
+ tone: "danger"
1347
+ }, {
1348
+ default: a(() => [
1349
+ S(V(D(h)), 1)
1350
+ ]),
1351
+ _: 2
1352
+ }, 1024)) : E("", !0)
1306
1353
  ]))), 128))
1307
1354
  ]),
1308
- t(e(qe), { size: "sm" }, {
1355
+ t(e(Ae), { size: "sm" }, {
1309
1356
  default: a(() => [
1310
- t(e(le), {
1357
+ t(e(te), {
1311
1358
  variant: "outline",
1312
1359
  icon: "user",
1313
1360
  disabled: p.value.length === 0,
1314
1361
  onClick: $[0] || ($[0] = (h) => C({ admin_id: Number(p.value[0]?.value) }))
1315
1362
  }, {
1316
1363
  default: a(() => [
1317
- z(V(e(d)("panel.add-admin")), 1)
1364
+ S(V(e(c)("panel.add-admin")), 1)
1318
1365
  ]),
1319
1366
  _: 1
1320
1367
  }, 8, ["disabled"]),
1321
- t(e(le), {
1368
+ t(e(te), {
1322
1369
  variant: "outline",
1323
1370
  onClick: $[1] || ($[1] = (h) => C({ email: "" }))
1324
1371
  }, {
1325
1372
  icon: a(() => [
1326
- t(e($e), { name: "mail" })
1373
+ t(e(_e), { name: "mail" })
1327
1374
  ]),
1328
1375
  default: a(() => [
1329
- z(" " + V(e(d)("panel.add-email")), 1)
1376
+ S(" " + V(e(c)("panel.add-email")), 1)
1330
1377
  ]),
1331
1378
  _: 1
1332
1379
  })
1333
1380
  ]),
1334
1381
  _: 1
1335
1382
  }),
1336
- t(e(B), {
1337
- label: e(d)("panel.email-field"),
1338
- help: e(d)("panel.email-field-help")
1383
+ t(e(H), {
1384
+ label: e(c)("panel.email-field"),
1385
+ help: e(c)("panel.email-field-help")
1339
1386
  }, {
1340
1387
  default: a(() => [
1341
- t(e(ve), {
1342
- modelValue: e(U),
1343
- "onUpdate:modelValue": $[2] || ($[2] = (h) => ne(U) ? U.value = h : null),
1344
- options: i.value
1388
+ t(e(fe), {
1389
+ modelValue: e(T),
1390
+ "onUpdate:modelValue": $[2] || ($[2] = (h) => se(T) ? T.value = h : null),
1391
+ options: d.value
1345
1392
  }, null, 8, ["modelValue", "options"])
1346
1393
  ]),
1347
1394
  _: 1
@@ -1350,56 +1397,58 @@ const jl = /* @__PURE__ */ ae({
1350
1397
  _: 1
1351
1398
  }, 8, ["title"]));
1352
1399
  }
1353
- }), nt = /* @__PURE__ */ ie(at, [["__scopeId", "data-v-a5998eb4"]]), st = { class: "wx-inbox-editor" }, ot = /* @__PURE__ */ ae({
1400
+ }), rt = /* @__PURE__ */ ue(ut, [["__scopeId", "data-v-2ce96844"]]), dt = { class: "wx-inbox-editor" }, ct = /* @__PURE__ */ ne({
1354
1401
  __name: "FormEditorPage",
1355
1402
  props: {
1356
1403
  base: { default: "/inbox" }
1357
1404
  },
1358
- setup(r) {
1359
- const s = r, o = oe(), f = de(o), n = Oe(), d = Pe(), m = xe();
1360
- ce();
1361
- const l = te("webx-inbox"), U = be(), p = F(null), i = F([]), L = F(!0), C = F(!1), T = F({});
1362
- let b = bl({
1405
+ setup(i) {
1406
+ const s = i, u = ie(), v = ce(u), n = Re(), c = Be(), f = we();
1407
+ pe();
1408
+ const l = ae("webx-inbox"), T = ye(), p = q(null), d = q([]), D = q(!0), C = q(!1), z = q({});
1409
+ let b = hl({
1363
1410
  slug: "",
1364
1411
  title: {},
1365
1412
  is_enabled: !0
1366
1413
  });
1367
- const W = F({}), c = S(() => o.can("inbox.manage")), $ = S(() => Number(n.params.id)), h = S(
1368
- () => p.value === null ? "" : fe(b.title, m.active.value, b.slug)
1369
- ), O = S(() => `${s.base}?form=${$.value}`);
1370
- async function _() {
1371
- L.value = !0;
1414
+ const F = q({}), $ = q(["general", "fields", "notifications", "antispam", "embed"].includes(String(n.query.tab)) ? String(n.query.tab) : "general"), h = U(
1415
+ () => b.is_enabled && !st(F.value.recipients, p.value?.recipients)
1416
+ ), I = U(() => u.can("inbox.manage")), x = U(() => Number(n.params.id)), P = U(
1417
+ () => p.value === null ? "" : be(b.title, f.active.value, b.slug)
1418
+ ), j = U(() => `${s.base}?form=${x.value}`);
1419
+ async function R() {
1420
+ D.value = !0;
1372
1421
  try {
1373
- const N = await f.form($.value);
1374
- p.value = N, i.value = N.fields ?? [], b.slug = N.slug, b.title = { ...N.title }, b.is_enabled = N.is_enabled, W.value = { ...N.options };
1375
- } catch (N) {
1376
- P.danger(U(N)), d.replace(s.base);
1422
+ const r = await v.form(x.value);
1423
+ p.value = r, d.value = r.fields ?? [], b.slug = r.slug, b.title = { ...r.title }, b.is_enabled = r.is_enabled, F.value = { ...r.options };
1424
+ } catch (r) {
1425
+ L.danger(T(r)), c.replace(s.base);
1377
1426
  } finally {
1378
- L.value = !1;
1427
+ D.value = !1;
1379
1428
  }
1380
1429
  }
1381
- Ce($, () => {
1382
- _();
1430
+ Te(x, () => {
1431
+ R();
1383
1432
  }, { immediate: !0 });
1384
- async function E() {
1385
- C.value = !0, T.value = {};
1433
+ async function B() {
1434
+ C.value = !0, z.value = {};
1386
1435
  try {
1387
- const N = await f.saveForm($.value, {
1436
+ const r = await v.saveForm(x.value, {
1388
1437
  slug: b.slug.trim(),
1389
1438
  title: b.title,
1390
1439
  is_enabled: b.is_enabled,
1391
- options: W.value
1440
+ options: F.value
1392
1441
  });
1393
- p.value = N, P.success(l("panel.saved"));
1394
- } catch (N) {
1395
- const q = N.body;
1396
- q?.errors ? (T.value = q.errors, P.danger(l("panel.failed"))) : P.danger(U(N));
1442
+ p.value = r, L.success(l("panel.saved"));
1443
+ } catch (r) {
1444
+ const O = r.body;
1445
+ O?.errors ? (z.value = O.errors, L.danger(l("panel.failed"))) : L.danger(T(r));
1397
1446
  } finally {
1398
1447
  C.value = !1;
1399
1448
  }
1400
1449
  }
1401
- return (N, q) => (u(), j("div", st, [
1402
- L.value ? (u(), w(e(se), { key: 0 }, {
1450
+ return (r, O) => (o(), G("div", dt, [
1451
+ D.value ? (o(), w(e(oe), { key: 0 }, {
1403
1452
  default: a(() => [
1404
1453
  t(e(We), {
1405
1454
  title: "",
@@ -1407,173 +1456,185 @@ const jl = /* @__PURE__ */ ae({
1407
1456
  })
1408
1457
  ]),
1409
1458
  _: 1
1410
- })) : p.value ? (u(), j(ee, { key: 1 }, [
1411
- t(e(Qe), {
1459
+ })) : p.value ? (o(), G(ee, { key: 1 }, [
1460
+ t(e(tl), {
1412
1461
  class: "wx-inbox-editor__head",
1413
- title: h.value,
1462
+ title: P.value,
1414
1463
  subtitle: p.value.slug,
1415
- back: O.value,
1464
+ back: j.value,
1416
1465
  "back-label": e(l)("panel.forms")
1417
1466
  }, {
1418
1467
  "title-after": a(() => [
1419
- e(b).is_enabled ? H("", !0) : (u(), w(e(Se), {
1468
+ e(b).is_enabled ? E("", !0) : (o(), w(e(Ue), {
1420
1469
  key: 0,
1421
1470
  type: "default"
1422
1471
  }, {
1423
1472
  default: a(() => [
1424
- z(V(e(l)("panel.off")), 1)
1473
+ S(V(e(l)("panel.off")), 1)
1425
1474
  ]),
1426
1475
  _: 1
1427
1476
  }))
1428
1477
  ]),
1429
1478
  _: 1
1430
1479
  }, 8, ["title", "subtitle", "back", "back-label"]),
1431
- t(e(Xe), {
1480
+ h.value ? (o(), w(e(Fe), {
1481
+ key: 0,
1482
+ class: "wx-inbox-editor__silent",
1483
+ type: "warning",
1484
+ variant: "soft",
1485
+ closable: !1,
1486
+ title: e(l)("panel.notifies-nobody"),
1487
+ description: e(l)("panel.notifies-nobody-text")
1488
+ }, null, 8, ["title", "description"])) : E("", !0),
1489
+ t(e(nl), {
1490
+ modelValue: $.value,
1491
+ "onUpdate:modelValue": O[5] || (O[5] = (J) => $.value = J),
1432
1492
  class: "wx-inbox-editor__tabs",
1433
1493
  "keep-alive": ""
1434
1494
  }, {
1435
1495
  default: a(() => [
1436
- t(e(ge), {
1496
+ t(e(xe), {
1437
1497
  value: "general",
1438
1498
  label: e(l)("panel.tab-general")
1439
1499
  }, {
1440
1500
  default: a(() => [
1441
- t(lt, {
1501
+ t(at, {
1442
1502
  settings: e(b),
1443
- "onUpdate:settings": q[0] || (q[0] = (M) => ne(b) ? b.value = M : b = M),
1444
- options: W.value,
1445
- "onUpdate:options": q[1] || (q[1] = (M) => W.value = M),
1446
- errors: T.value
1503
+ "onUpdate:settings": O[0] || (O[0] = (J) => se(b) ? b.value = J : b = J),
1504
+ options: F.value,
1505
+ "onUpdate:options": O[1] || (O[1] = (J) => F.value = J),
1506
+ errors: z.value
1447
1507
  }, null, 8, ["settings", "options", "errors"])
1448
1508
  ]),
1449
1509
  _: 1
1450
1510
  }, 8, ["label"]),
1451
- t(e(ge), {
1511
+ t(e(xe), {
1452
1512
  value: "fields",
1453
1513
  label: e(l)("panel.tab-fields")
1454
1514
  }, {
1455
1515
  default: a(() => [
1456
- t(Gl, {
1457
- modelValue: i.value,
1458
- "onUpdate:modelValue": q[2] || (q[2] = (M) => i.value = M),
1516
+ t(Kl, {
1517
+ modelValue: d.value,
1518
+ "onUpdate:modelValue": O[2] || (O[2] = (J) => d.value = J),
1459
1519
  form: p.value,
1460
- "can-manage": c.value
1520
+ "can-manage": I.value
1461
1521
  }, null, 8, ["modelValue", "form", "can-manage"])
1462
1522
  ]),
1463
1523
  _: 1
1464
1524
  }, 8, ["label"]),
1465
- t(e(ge), {
1525
+ t(e(xe), {
1466
1526
  value: "notifications",
1467
1527
  label: e(l)("panel.tab-notifications")
1468
1528
  }, {
1469
1529
  default: a(() => [
1470
- t(nt, {
1471
- modelValue: W.value,
1472
- "onUpdate:modelValue": q[3] || (q[3] = (M) => W.value = M),
1473
- fields: i.value,
1474
- errors: T.value
1475
- }, null, 8, ["modelValue", "fields", "errors"])
1530
+ t(rt, {
1531
+ modelValue: F.value,
1532
+ "onUpdate:modelValue": O[3] || (O[3] = (J) => F.value = J),
1533
+ fields: d.value,
1534
+ errors: z.value,
1535
+ reported: p.value.recipients
1536
+ }, null, 8, ["modelValue", "fields", "errors", "reported"])
1476
1537
  ]),
1477
1538
  _: 1
1478
1539
  }, 8, ["label"]),
1479
- t(e(ge), {
1540
+ t(e(xe), {
1480
1541
  value: "antispam",
1481
1542
  label: e(l)("panel.tab-antispam")
1482
1543
  }, {
1483
1544
  default: a(() => [
1484
- t(jl, {
1485
- modelValue: W.value,
1486
- "onUpdate:modelValue": q[4] || (q[4] = (M) => W.value = M)
1545
+ t(Yl, {
1546
+ modelValue: F.value,
1547
+ "onUpdate:modelValue": O[4] || (O[4] = (J) => F.value = J)
1487
1548
  }, null, 8, ["modelValue"])
1488
1549
  ]),
1489
1550
  _: 1
1490
1551
  }, 8, ["label"]),
1491
- t(e(ge), {
1552
+ t(e(xe), {
1492
1553
  value: "embed",
1493
1554
  label: e(l)("panel.tab-embed")
1494
1555
  }, {
1495
1556
  default: a(() => [
1496
- t(Jl, {
1557
+ t(et, {
1497
1558
  form: p.value,
1498
1559
  slug: e(b).slug,
1499
- fields: i.value
1560
+ fields: d.value
1500
1561
  }, null, 8, ["form", "slug", "fields"])
1501
1562
  ]),
1502
1563
  _: 1
1503
1564
  }, 8, ["label"])
1504
1565
  ]),
1505
1566
  _: 1
1506
- }),
1507
- c.value ? (u(), w(e(wl), { key: 0 }, {
1567
+ }, 8, ["modelValue"]),
1568
+ I.value ? (o(), w(e(Vl), { key: 1 }, {
1508
1569
  default: a(() => [
1509
- t(e(le), {
1570
+ t(e(te), {
1510
1571
  type: "primary",
1511
1572
  loading: C.value,
1512
- onClick: E
1573
+ onClick: B
1513
1574
  }, {
1514
1575
  default: a(() => [
1515
- z(V(e(l)("panel.save")), 1)
1576
+ S(V(e(l)("panel.save")), 1)
1516
1577
  ]),
1517
1578
  _: 1
1518
1579
  }, 8, ["loading"])
1519
1580
  ]),
1520
1581
  _: 1
1521
- })) : H("", !0)
1522
- ], 64)) : H("", !0)
1582
+ })) : E("", !0)
1583
+ ], 64)) : E("", !0)
1523
1584
  ]));
1524
1585
  }
1525
- }), it = /* @__PURE__ */ ie(ot, [["__scopeId", "data-v-11c10bb6"]]), ut = { class: "wx-inbox-create" }, rt = /* @__PURE__ */ ae({
1586
+ }), pt = /* @__PURE__ */ ue(ct, [["__scopeId", "data-v-8e53184e"]]), mt = { class: "wx-inbox-create" }, vt = /* @__PURE__ */ ne({
1526
1587
  __name: "FormCreateDialog",
1527
- setup(r) {
1528
- const { resolve: s, dismiss: o, open: f } = Ee(), n = oe(), d = de(n);
1529
- ce();
1530
- const m = te("webx-inbox"), l = be(), U = F({}), p = F(""), i = F(!1), L = F({});
1588
+ setup(i) {
1589
+ const { resolve: s, dismiss: u, open: v } = He(), n = ie(), c = ce(n);
1590
+ pe();
1591
+ const f = ae("webx-inbox"), l = ye(), T = q({}), p = q(""), d = q(!1), D = q({});
1531
1592
  function C(b) {
1532
- return L.value[b]?.[0];
1593
+ return D.value[b]?.[0];
1533
1594
  }
1534
- async function T() {
1535
- i.value = !0, L.value = {};
1595
+ async function z() {
1596
+ d.value = !0, D.value = {};
1536
1597
  try {
1537
1598
  s(
1538
- await d.createForm({
1539
- title: U.value,
1599
+ await c.createForm({
1600
+ title: T.value,
1540
1601
  slug: p.value.trim(),
1541
1602
  is_enabled: !0,
1542
1603
  options: {}
1543
1604
  })
1544
1605
  );
1545
1606
  } catch (b) {
1546
- const W = b.body;
1547
- W?.errors ? (L.value = W.errors, P.danger(m("panel.failed"))) : P.danger(l(b));
1607
+ const F = b.body;
1608
+ F?.errors ? (D.value = F.errors, L.danger(f("panel.failed"))) : L.danger(l(b));
1548
1609
  } finally {
1549
- i.value = !1;
1610
+ d.value = !1;
1550
1611
  }
1551
1612
  }
1552
- return (b, W) => (u(), w(e(Re), {
1553
- open: e(f),
1554
- "onUpdate:open": W[3] || (W[3] = (c) => ne(f) ? f.value = c : null),
1555
- title: e(m)("panel.new-form-title"),
1613
+ return (b, F) => (o(), w(e(Ge), {
1614
+ open: e(v),
1615
+ "onUpdate:open": F[3] || (F[3] = (m) => se(v) ? v.value = m : null),
1616
+ title: e(f)("panel.new-form-title"),
1556
1617
  width: 520
1557
1618
  }, {
1558
1619
  footer: a(() => [
1559
- t(e(qe), { size: "sm" }, {
1620
+ t(e(Ae), { size: "sm" }, {
1560
1621
  default: a(() => [
1561
- t(e(le), {
1622
+ t(e(te), {
1562
1623
  variant: "outline",
1563
- onClick: W[2] || (W[2] = (c) => e(o)())
1624
+ onClick: F[2] || (F[2] = (m) => e(u)())
1564
1625
  }, {
1565
1626
  default: a(() => [
1566
- z(V(e(m)("panel.cancel")), 1)
1627
+ S(V(e(f)("panel.cancel")), 1)
1567
1628
  ]),
1568
1629
  _: 1
1569
1630
  }),
1570
- t(e(le), {
1631
+ t(e(te), {
1571
1632
  type: "primary",
1572
- loading: i.value,
1573
- onClick: T
1633
+ loading: d.value,
1634
+ onClick: z
1574
1635
  }, {
1575
1636
  default: a(() => [
1576
- z(V(e(m)("panel.save")), 1)
1637
+ S(V(e(f)("panel.save")), 1)
1577
1638
  ]),
1578
1639
  _: 1
1579
1640
  }, 8, ["loading"])
@@ -1582,31 +1643,31 @@ const jl = /* @__PURE__ */ ae({
1582
1643
  })
1583
1644
  ]),
1584
1645
  default: a(() => [
1585
- G("div", ut, [
1586
- t(e(B), {
1587
- label: e(m)("panel.title"),
1646
+ K("div", mt, [
1647
+ t(e(H), {
1648
+ label: e(f)("panel.title"),
1588
1649
  error: C("title"),
1589
1650
  required: ""
1590
1651
  }, {
1591
1652
  default: a(() => [
1592
- t(e(X), {
1593
- modelValue: U.value,
1594
- "onUpdate:modelValue": W[0] || (W[0] = (c) => U.value = c),
1653
+ t(e(le), {
1654
+ modelValue: T.value,
1655
+ "onUpdate:modelValue": F[0] || (F[0] = (m) => T.value = m),
1595
1656
  localized: "",
1596
1657
  autofocus: ""
1597
1658
  }, null, 8, ["modelValue"])
1598
1659
  ]),
1599
1660
  _: 1
1600
1661
  }, 8, ["label", "error"]),
1601
- t(e(B), {
1602
- label: e(m)("panel.slug"),
1603
- help: e(m)("panel.slug-help"),
1662
+ t(e(H), {
1663
+ label: e(f)("panel.slug"),
1664
+ help: e(f)("panel.slug-help"),
1604
1665
  error: C("slug")
1605
1666
  }, {
1606
1667
  default: a(() => [
1607
- t(e(X), {
1668
+ t(e(le), {
1608
1669
  modelValue: p.value,
1609
- "onUpdate:modelValue": W[1] || (W[1] = (c) => p.value = c),
1670
+ "onUpdate:modelValue": F[1] || (F[1] = (m) => p.value = m),
1610
1671
  placeholder: "contact"
1611
1672
  }, null, 8, ["modelValue"])
1612
1673
  ]),
@@ -1617,84 +1678,84 @@ const jl = /* @__PURE__ */ ae({
1617
1678
  _: 1
1618
1679
  }, 8, ["open", "title"]));
1619
1680
  }
1620
- }), dt = /* @__PURE__ */ ie(rt, [["__scopeId", "data-v-55fb40d8"]]), ct = { class: "wx-inbox-by-hand" }, pt = /* @__PURE__ */ ae({
1681
+ }), ft = /* @__PURE__ */ ue(vt, [["__scopeId", "data-v-55fb40d8"]]), bt = { class: "wx-inbox-by-hand" }, yt = /* @__PURE__ */ ne({
1621
1682
  __name: "SubmissionCreateDialog",
1622
1683
  props: {
1623
1684
  form: {}
1624
1685
  },
1625
- setup(r) {
1626
- const s = r, { resolve: o, dismiss: f, open: n } = Ee(), d = oe(), m = de(d), l = xe();
1627
- ce();
1628
- const U = te("webx-inbox"), p = be(), i = F([]), L = F(!0), C = F(!1), T = F({}), b = F({}), W = S(() => i.value.filter((q) => q.type !== "file")), c = S(() => i.value.some((q) => q.type === "file"));
1629
- function $(q) {
1630
- return b.value[`fields.${q.key}`]?.[0];
1631
- }
1632
- function h(q) {
1633
- return fe(q.title, l.active.value, q.key);
1634
- }
1635
- function O(q, M = "") {
1636
- return fe(
1637
- q,
1686
+ setup(i) {
1687
+ const s = i, { resolve: u, dismiss: v, open: n } = He(), c = ie(), f = ce(c), l = we();
1688
+ pe();
1689
+ const T = ae("webx-inbox"), p = ye(), d = q([]), D = q(!0), C = q(!1), z = q({}), b = q({}), F = U(() => d.value.filter((R) => R.type !== "file")), m = U(() => d.value.some((R) => R.type === "file"));
1690
+ function $(R) {
1691
+ return b.value[`fields.${R.key}`]?.[0];
1692
+ }
1693
+ function h(R) {
1694
+ return be(R.title, l.active.value, R.key);
1695
+ }
1696
+ function I(R, B = "") {
1697
+ return be(
1698
+ R,
1638
1699
  l.active.value,
1639
- M
1700
+ B
1640
1701
  );
1641
1702
  }
1642
- function _(q) {
1643
- return (q.options.choices ?? []).map((M) => ({
1644
- value: M.value,
1645
- label: O(M.label, M.value)
1703
+ function x(R) {
1704
+ return (R.options.choices ?? []).map((B) => ({
1705
+ value: B.value,
1706
+ label: I(B.label, B.value)
1646
1707
  }));
1647
1708
  }
1648
- async function E() {
1709
+ async function P() {
1649
1710
  try {
1650
- const q = await m.form(s.form.id);
1651
- i.value = (q.fields ?? []).filter((M) => M.is_enabled);
1652
- for (const M of i.value)
1653
- T.value[M.key] = M.type === "checkbox" ? [] : M.type === "consent" ? !1 : "";
1654
- } catch (q) {
1655
- P.danger(p(q));
1711
+ const R = await f.form(s.form.id);
1712
+ d.value = (R.fields ?? []).filter((B) => B.is_enabled);
1713
+ for (const B of d.value)
1714
+ z.value[B.key] = B.type === "checkbox" ? [] : B.type === "consent" ? !1 : "";
1715
+ } catch (R) {
1716
+ L.danger(p(R));
1656
1717
  } finally {
1657
- L.value = !1;
1718
+ D.value = !1;
1658
1719
  }
1659
1720
  }
1660
- E();
1661
- async function N() {
1721
+ P();
1722
+ async function j() {
1662
1723
  C.value = !0, b.value = {};
1663
1724
  try {
1664
- o(await m.createSubmission(s.form.id, T.value));
1665
- } catch (q) {
1666
- const M = q.body;
1667
- M?.errors ? (b.value = M.errors, P.danger(U("panel.failed"))) : P.danger(p(q));
1725
+ u(await f.createSubmission(s.form.id, z.value));
1726
+ } catch (R) {
1727
+ const B = R.body;
1728
+ B?.errors ? (b.value = B.errors, L.danger(T("panel.failed"))) : L.danger(p(R));
1668
1729
  } finally {
1669
1730
  C.value = !1;
1670
1731
  }
1671
1732
  }
1672
- return (q, M) => (u(), w(e(Re), {
1733
+ return (R, B) => (o(), w(e(Ge), {
1673
1734
  open: e(n),
1674
- "onUpdate:open": M[1] || (M[1] = (v) => ne(n) ? n.value = v : null),
1675
- title: e(U)("panel.new-submission-title"),
1735
+ "onUpdate:open": B[1] || (B[1] = (r) => se(n) ? n.value = r : null),
1736
+ title: e(T)("panel.new-submission-title"),
1676
1737
  width: 560
1677
1738
  }, {
1678
1739
  footer: a(() => [
1679
- t(e(qe), { size: "sm" }, {
1740
+ t(e(Ae), { size: "sm" }, {
1680
1741
  default: a(() => [
1681
- t(e(le), {
1742
+ t(e(te), {
1682
1743
  variant: "outline",
1683
- onClick: M[0] || (M[0] = (v) => e(f)())
1744
+ onClick: B[0] || (B[0] = (r) => e(v)())
1684
1745
  }, {
1685
1746
  default: a(() => [
1686
- z(V(e(U)("panel.cancel")), 1)
1747
+ S(V(e(T)("panel.cancel")), 1)
1687
1748
  ]),
1688
1749
  _: 1
1689
1750
  }),
1690
- t(e(le), {
1751
+ t(e(te), {
1691
1752
  type: "primary",
1692
1753
  loading: C.value,
1693
- disabled: L.value,
1694
- onClick: N
1754
+ disabled: D.value,
1755
+ onClick: j
1695
1756
  }, {
1696
1757
  default: a(() => [
1697
- z(V(e(U)("panel.save")), 1)
1758
+ S(V(e(T)("panel.save")), 1)
1698
1759
  ]),
1699
1760
  _: 1
1700
1761
  }, 8, ["loading", "disabled"])
@@ -1703,169 +1764,169 @@ const jl = /* @__PURE__ */ ae({
1703
1764
  })
1704
1765
  ]),
1705
1766
  default: a(() => [
1706
- G("div", ct, [
1707
- t(e(Me), {
1767
+ K("div", bt, [
1768
+ t(e(Fe), {
1708
1769
  type: "info",
1709
1770
  closable: !1
1710
1771
  }, {
1711
1772
  default: a(() => [
1712
- z(V(e(U)("panel.new-submission-help")), 1)
1773
+ S(V(e(T)("panel.new-submission-help")), 1)
1713
1774
  ]),
1714
1775
  _: 1
1715
1776
  }),
1716
- L.value ? (u(), w(e(We), {
1777
+ D.value ? (o(), w(e(We), {
1717
1778
  key: 0,
1718
1779
  rows: 4
1719
- })) : (u(), j(ee, { key: 1 }, [
1720
- (u(!0), j(ee, null, ke(W.value, (v) => (u(), w(e(B), {
1721
- key: v.id,
1722
- label: h(v),
1723
- help: O(v.help),
1724
- error: $(v),
1725
- required: v.is_required
1780
+ })) : (o(), G(ee, { key: 1 }, [
1781
+ (o(!0), G(ee, null, ge(F.value, (r) => (o(), w(e(H), {
1782
+ key: r.id,
1783
+ label: h(r),
1784
+ help: I(r.help),
1785
+ error: $(r),
1786
+ required: r.is_required
1726
1787
  }, {
1727
1788
  default: a(() => [
1728
- v.type === "textarea" ? (u(), w(e(kl), {
1789
+ r.type === "textarea" ? (o(), w(e($l), {
1729
1790
  key: 0,
1730
- modelValue: T.value[v.key],
1731
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1732
- rows: v.options.rows ?? 4,
1733
- placeholder: O(v.placeholder)
1734
- }, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : v.type === "select" ? (u(), w(e(ve), {
1791
+ modelValue: z.value[r.key],
1792
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1793
+ rows: r.options.rows ?? 4,
1794
+ placeholder: I(r.placeholder)
1795
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : r.type === "select" ? (o(), w(e(fe), {
1735
1796
  key: 1,
1736
- modelValue: T.value[v.key],
1737
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1738
- options: _(v),
1797
+ modelValue: z.value[r.key],
1798
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1799
+ options: x(r),
1739
1800
  clearable: "",
1740
- placeholder: O(v.placeholder)
1741
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : v.type === "radio" ? (u(), w(e(Vl), {
1801
+ placeholder: I(r.placeholder)
1802
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : r.type === "radio" ? (o(), w(e(Ul), {
1742
1803
  key: 2,
1743
- modelValue: T.value[v.key],
1744
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1745
- options: _(v)
1746
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : v.type === "checkbox" ? (u(), w(e($l), {
1804
+ modelValue: z.value[r.key],
1805
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1806
+ options: x(r)
1807
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : r.type === "checkbox" ? (o(), w(e(Sl), {
1747
1808
  key: 3,
1748
- modelValue: T.value[v.key],
1749
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1750
- options: _(v)
1751
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : v.type === "consent" ? (u(), w(e(he), {
1809
+ modelValue: z.value[r.key],
1810
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1811
+ options: x(r)
1812
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : r.type === "consent" ? (o(), w(e(he), {
1752
1813
  key: 4,
1753
- modelValue: T.value[v.key],
1754
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1755
- label: O(v.options.text, h(v))
1756
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : v.type === "date" ? (u(), w(e(Ze), {
1814
+ modelValue: z.value[r.key],
1815
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1816
+ label: I(r.options.text, h(r))
1817
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : r.type === "date" ? (o(), w(e(ll), {
1757
1818
  key: 5,
1758
- modelValue: T.value[v.key],
1759
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1760
- placeholder: O(v.placeholder)
1761
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (u(), w(e(X), {
1819
+ modelValue: z.value[r.key],
1820
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1821
+ placeholder: I(r.placeholder)
1822
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (o(), w(e(le), {
1762
1823
  key: 6,
1763
- modelValue: T.value[v.key],
1764
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1765
- type: v.type === "email" ? "email" : v.type === "tel" ? "tel" : "text",
1766
- placeholder: O(v.placeholder),
1767
- maxlength: v.options.maxlength
1824
+ modelValue: z.value[r.key],
1825
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1826
+ type: r.type === "email" ? "email" : r.type === "tel" ? "tel" : "text",
1827
+ placeholder: I(r.placeholder),
1828
+ maxlength: r.options.maxlength
1768
1829
  }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "maxlength"]))
1769
1830
  ]),
1770
1831
  _: 2
1771
1832
  }, 1032, ["label", "help", "error", "required"]))), 128)),
1772
- c.value ? (u(), w(e(Me), {
1833
+ m.value ? (o(), w(e(Fe), {
1773
1834
  key: 0,
1774
1835
  type: "warning",
1775
1836
  closable: !1
1776
1837
  }, {
1777
1838
  default: a(() => [
1778
- z(V(e(U)("panel.no-files-by-hand")), 1)
1839
+ S(V(e(T)("panel.no-files-by-hand")), 1)
1779
1840
  ]),
1780
1841
  _: 1
1781
- })) : H("", !0)
1842
+ })) : E("", !0)
1782
1843
  ], 64))
1783
1844
  ])
1784
1845
  ]),
1785
1846
  _: 1
1786
1847
  }, 8, ["open", "title"]));
1787
1848
  }
1788
- }), mt = /* @__PURE__ */ ie(pt, [["__scopeId", "data-v-72006299"]]), vt = { class: "wx-submissions__mass" }, ft = { class: "wx-submissions__state" }, bt = 640, ht = /* @__PURE__ */ ae({
1849
+ }), ht = /* @__PURE__ */ ue(yt, [["__scopeId", "data-v-72006299"]]), gt = { class: "wx-submissions__mass" }, xt = { class: "wx-submissions__state" }, _t = 640, wt = /* @__PURE__ */ ne({
1789
1850
  __name: "SubmissionList",
1790
1851
  props: {
1791
1852
  form: {},
1792
1853
  base: { default: "/inbox" }
1793
1854
  },
1794
1855
  emits: ["changed"],
1795
- setup(r, { expose: s, emit: o }) {
1796
- const f = r, n = o, d = oe(), m = de(d), l = Oe(), U = Pe(), p = xe();
1797
- ce();
1798
- const i = il("root"), L = Ul(i), C = S(() => L.value > 0 && L.value < bt), T = S(() => C.value ? Number.POSITIVE_INFINITY : 0), b = te("webx-inbox"), W = te("webx-admin"), c = be(), $ = F(null), h = F([]), O = F(!1), _ = F([]), E = F(!1), N = S(() => d.can("inbox.update")), q = Be(mt), M = S({
1856
+ setup(i, { expose: s, emit: u }) {
1857
+ const v = i, n = u, c = ie(), f = ce(c), l = Re(), T = Be(), p = we();
1858
+ pe();
1859
+ const d = cl("root"), D = Tl(d), C = U(() => D.value > 0 && D.value < _t), z = U(() => C.value ? Number.POSITIVE_INFINITY : 0), b = ae("webx-inbox"), F = ae("webx-admin"), m = ye(), $ = q(null), h = q([]), I = q(!1), x = q([]), P = q(!1), j = U(() => c.can("inbox.update")), R = je(ht), B = U({
1799
1860
  get: () => typeof l.query.view == "string" && l.query.view !== "" ? l.query.view : "all",
1800
- set: (x) => {
1801
- U.replace({
1802
- query: { ...l.query, view: x === "all" ? void 0 : x, page: void 0 }
1861
+ set: (_) => {
1862
+ T.replace({
1863
+ query: { ...l.query, view: _ === "all" ? void 0 : _, page: void 0 }
1803
1864
  });
1804
1865
  }
1805
- }), v = S(() => ({
1806
- view: M.value,
1866
+ }), r = U(() => ({
1867
+ view: B.value,
1807
1868
  search: typeof l.query.search == "string" ? l.query.search : "",
1808
1869
  assignee: typeof l.query.assignee == "string" ? l.query.assignee : null,
1809
1870
  placement: typeof l.query.placement == "string" ? l.query.placement : null,
1810
1871
  sort: typeof l.query.sort == "string" ? l.query.sort : null,
1811
1872
  page: Number(l.query.page ?? 1) || 1
1812
- })), Y = S(
1873
+ })), O = U(
1813
1874
  () => ($.value?.placements ?? []).map(
1814
- (x) => x === null ? { value: "none", label: b("panel.placement-none") } : { value: x, label: x }
1875
+ (_) => _ === null ? { value: "none", label: b("panel.placement-none") } : { value: _, label: _ }
1815
1876
  )
1816
- ), ye = S(
1817
- () => Y.value.length > 1 || v.value.placement !== null
1818
- ), pe = S(() => {
1819
- const x = v.value.placement;
1820
- if (x === null) return [];
1821
- const K = Y.value.find((D) => D.value === x)?.label ?? (x === "none" ? b("panel.placement-none") : x);
1877
+ ), J = U(
1878
+ () => O.value.length > 1 || r.value.placement !== null
1879
+ ), me = U(() => {
1880
+ const _ = r.value.placement;
1881
+ if (_ === null) return [];
1882
+ const Z = O.value.find((N) => N.value === _)?.label ?? (_ === "none" ? b("panel.placement-none") : _);
1822
1883
  return [
1823
1884
  {
1824
1885
  key: "placement",
1825
- label: `${b("panel.meta-placement")}: ${K}`,
1886
+ label: `${b("panel.meta-placement")}: ${Z}`,
1826
1887
  clear: () => A(void 0)
1827
1888
  }
1828
1889
  ];
1829
1890
  });
1830
- function A(x) {
1831
- U.replace({
1891
+ function A(_) {
1892
+ T.replace({
1832
1893
  query: {
1833
1894
  ...l.query,
1834
- placement: typeof x == "string" && x !== "" ? x : void 0,
1895
+ placement: typeof _ == "string" && _ !== "" ? _ : void 0,
1835
1896
  page: void 0
1836
1897
  }
1837
1898
  });
1838
1899
  }
1839
- const Q = S(() => {
1840
- const x = $.value?.counts, K = [
1841
- { value: "all", label: b("panel.view-all"), badge: x?.all || void 0 },
1842
- { value: "unread", label: b("panel.view-unread"), badge: x?.unread || void 0 }
1900
+ const X = U(() => {
1901
+ const _ = $.value?.counts, Z = [
1902
+ { value: "all", label: b("panel.view-all"), badge: _?.all || void 0 },
1903
+ { value: "unread", label: b("panel.view-unread"), badge: _?.unread || void 0 }
1843
1904
  ];
1844
- for (const D of h.value)
1845
- K.push({
1846
- value: D.key,
1847
- label: re(D),
1848
- badge: x?.statuses[D.key] || void 0
1905
+ for (const N of h.value)
1906
+ Z.push({
1907
+ value: N.key,
1908
+ label: de(N),
1909
+ badge: _?.statuses[N.key] || void 0
1849
1910
  });
1850
- return K;
1911
+ return Z;
1851
1912
  });
1852
- function I(x, K) {
1853
- const D = $.value?.columns?.[K];
1854
- return D ? x.values[D.key] ?? "" : "";
1913
+ function W(_, Z) {
1914
+ const N = $.value?.columns?.[Z];
1915
+ return N ? _.values[N.key] ?? "" : "";
1855
1916
  }
1856
- const k = S(() => {
1857
- const x = $.value?.columns ?? [];
1917
+ const k = U(() => {
1918
+ const _ = $.value?.columns ?? [];
1858
1919
  return C.value ? [{ key: "card", label: "" }] : [
1859
- ...x.map((K, D) => ({
1860
- key: `values.${K.key}`,
1861
- label: K.label,
1920
+ ..._.map((Z, N) => ({
1921
+ key: `values.${Z.key}`,
1922
+ label: Z.label,
1862
1923
  sortable: !0,
1863
1924
  // The first answer is what the row is recognised by and stays at any width; every one
1864
1925
  // after it is worth less than the room it takes, so it goes a step sooner. The steps are
1865
1926
  // wide — 640, 960 — because an answer is a sentence and not a number: two of them plus
1866
1927
  // the status and the date is already what a 755px pane holds without scrolling sideways,
1867
1928
  // which is what the pane beside the forms actually is on a 1280 screen (§11).
1868
- hideBelow: D === 0 ? void 0 : 320 + D * 320
1929
+ hideBelow: N === 0 ? void 0 : 320 + N * 320
1869
1930
  })),
1870
1931
  // A floor rather than a width: the cell holds a badge, sometimes an avatar and sometimes
1871
1932
  // a paperclip, and a fixed width that any of them overflows makes the whole table scroll
@@ -1883,67 +1944,67 @@ const jl = /* @__PURE__ */ ae({
1883
1944
  // Kept on the card, unlike most dates: "when did this come in" is one of the two
1884
1945
  // questions a submission is looked at for, and the other one is who sent it.
1885
1946
  },
1886
- { key: "actions", label: "", width: hl, align: "right", hideOnCards: !0 }
1947
+ { key: "actions", label: "", width: gl, align: "right", hideOnCards: !0 }
1887
1948
  ];
1888
- }), y = S(
1889
- () => v.value.view === "all" && v.value.search === "" && v.value.assignee === null && v.value.placement === null ? b("panel.submissions-empty") : b("panel.submissions-none")
1890
- ), ue = S(
1891
- () => h.value.map((x) => ({ value: x.id, label: re(x) }))
1949
+ }), g = U(
1950
+ () => r.value.view === "all" && r.value.search === "" && r.value.assignee === null && r.value.placement === null ? b("panel.submissions-empty") : b("panel.submissions-none")
1951
+ ), re = U(
1952
+ () => h.value.map((_) => ({ value: _.id, label: de(_) }))
1892
1953
  );
1893
- function re(x) {
1894
- return fe(x.title, p.active.value, x.key);
1954
+ function de(_) {
1955
+ return be(_.title, p.active.value, _.key);
1895
1956
  }
1896
- function Ge() {
1897
- return fe(f.form.title, p.active.value, f.form.slug);
1957
+ function Ne() {
1958
+ return be(v.form.title, p.active.value, v.form.slug);
1898
1959
  }
1899
- async function _e(x) {
1900
- O.value = !0;
1960
+ async function ke(_) {
1961
+ I.value = !0;
1901
1962
  try {
1902
- $.value = await m.submissions(f.form.id, {
1903
- view: v.value.view,
1904
- search: x?.search ?? v.value.search,
1905
- assignee: v.value.assignee,
1906
- placement: v.value.placement,
1907
- sort: x?.sort ? `${x.sort.order === "desc" ? "-" : ""}${x.sort.key}` : null,
1908
- page: x?.page ?? v.value.page,
1909
- per_page: x?.perPage
1963
+ $.value = await f.submissions(v.form.id, {
1964
+ view: r.value.view,
1965
+ search: _?.search ?? r.value.search,
1966
+ assignee: r.value.assignee,
1967
+ placement: r.value.placement,
1968
+ sort: _?.sort ? `${_.sort.order === "desc" ? "-" : ""}${_.sort.key}` : null,
1969
+ page: _?.page ?? r.value.page,
1970
+ per_page: _?.perPage
1910
1971
  });
1911
- } catch (K) {
1912
- P.danger(c(K));
1972
+ } catch (Z) {
1973
+ L.danger(m(Z));
1913
1974
  } finally {
1914
- O.value = !1;
1975
+ I.value = !1;
1915
1976
  }
1916
1977
  }
1917
- function g(x) {
1918
- const K = {
1978
+ function Ye(_) {
1979
+ const Z = {
1919
1980
  ...l.query,
1920
- search: x.search === "" ? void 0 : x.search,
1921
- sort: x.sort === null ? void 0 : `${x.sort.order === "desc" ? "-" : ""}${x.sort.key}`,
1922
- page: x.page === 1 ? void 0 : String(x.page)
1981
+ search: _.search === "" ? void 0 : _.search,
1982
+ sort: _.sort === null ? void 0 : `${_.sort.order === "desc" ? "-" : ""}${_.sort.key}`,
1983
+ page: _.page === 1 ? void 0 : String(_.page)
1923
1984
  };
1924
- U.replace({ query: K }), _e(x);
1985
+ T.replace({ query: Z }), ke(_);
1925
1986
  }
1926
- Ce([() => f.form.id, M, () => v.value.assignee, () => v.value.placement], () => {
1927
- _.value = [], _e();
1928
- }), _e(), Z();
1929
- async function Z() {
1987
+ Te([() => v.form.id, B, () => r.value.assignee, () => r.value.placement], () => {
1988
+ x.value = [], ke();
1989
+ }), ke(), Ze();
1990
+ async function Ze() {
1930
1991
  try {
1931
- h.value = await m.statuses();
1932
- } catch (x) {
1933
- P.danger(c(x));
1992
+ h.value = await f.statuses();
1993
+ } catch (_) {
1994
+ L.danger(m(_));
1934
1995
  }
1935
1996
  }
1936
- function R(x) {
1937
- U.push({ path: `${f.base}/submissions/${x.id}`, query: { ...l.query } });
1997
+ function Ie(_) {
1998
+ T.push({ path: `${v.base}/submissions/${_.id}`, query: { ...l.query } });
1938
1999
  }
1939
- function Ae(x) {
1940
- return N.value ? [
2000
+ function De(_) {
2001
+ return j.value ? [
1941
2002
  {
1942
2003
  key: "read",
1943
- icon: x.is_read ? "eye-off" : "eye",
1944
- label: x.is_read ? b("panel.mark-unread") : b("panel.mark-read"),
2004
+ icon: _.is_read ? "eye-off" : "eye",
2005
+ label: _.is_read ? b("panel.mark-unread") : b("panel.mark-read"),
1945
2006
  run: () => {
1946
- Ke([x.id], x.is_read ? "unread" : "read");
2007
+ Y([_.id], _.is_read ? "unread" : "read");
1947
2008
  }
1948
2009
  },
1949
2010
  {
@@ -1952,72 +2013,72 @@ const jl = /* @__PURE__ */ ae({
1952
2013
  label: b("panel.delete"),
1953
2014
  danger: !0,
1954
2015
  run: () => {
1955
- el([x.id]);
2016
+ y([_.id]);
1956
2017
  }
1957
2018
  }
1958
2019
  ] : [];
1959
2020
  }
1960
- async function je(x) {
1961
- typeof x == "number" && (E.value = !0, await Ke(
1962
- _.value.map((K) => K.id),
2021
+ async function Qe(_) {
2022
+ typeof _ == "number" && (P.value = !0, await Y(
2023
+ x.value.map((Z) => Z.id),
1963
2024
  "status",
1964
- x
1965
- ), E.value = !1);
2025
+ _
2026
+ ), P.value = !1);
1966
2027
  }
1967
- async function el(x) {
1968
- await ze({
1969
- title: x.length === 1 ? b("panel.delete-submission-title") : b("panel.delete-selected-title", { count: x.length }),
2028
+ async function y(_) {
2029
+ await Ce({
2030
+ title: _.length === 1 ? b("panel.delete-submission-title") : b("panel.delete-selected-title", { count: _.length }),
1970
2031
  message: b("panel.delete-submission-text"),
1971
2032
  confirmText: b("panel.delete"),
1972
2033
  cancelText: b("panel.cancel"),
1973
2034
  tone: "danger"
1974
- }) && await Ke(x, "delete");
2035
+ }) && await Y(_, "delete");
1975
2036
  }
1976
- async function Ke(x, K, D) {
1977
- if (x.length !== 0)
2037
+ async function Y(_, Z, N) {
2038
+ if (_.length !== 0)
1978
2039
  try {
1979
- await m.massSubmissions({ ids: x, action: K, status_id: D }), _.value = [], await _e(), n("changed");
1980
- } catch (Te) {
1981
- P.danger(c(Te));
2040
+ await f.massSubmissions({ ids: _, action: Z, status_id: N }), x.value = [], await ke(), n("changed");
2041
+ } catch (qe) {
2042
+ L.danger(m(qe));
1982
2043
  }
1983
2044
  }
1984
- async function pl() {
1985
- const x = await q({ form: f.form });
1986
- x && (P.success(b("panel.created")), await _e(), n("changed"), U.push({ path: `${f.base}/submissions/${x.id}`, query: { ...l.query } }));
1987
- }
1988
- const ml = S(
1989
- () => m.exportUrl(f.form.id, {
1990
- view: v.value.view,
1991
- search: v.value.search,
1992
- assignee: v.value.assignee,
1993
- placement: v.value.placement,
1994
- sort: v.value.sort
2045
+ async function M() {
2046
+ const _ = await R({ form: v.form });
2047
+ _ && (L.success(b("panel.created")), await ke(), n("changed"), T.push({ path: `${v.base}/submissions/${_.id}`, query: { ...l.query } }));
2048
+ }
2049
+ const Je = U(
2050
+ () => f.exportUrl(v.form.id, {
2051
+ view: r.value.view,
2052
+ search: r.value.search,
2053
+ assignee: r.value.assignee,
2054
+ placement: r.value.placement,
2055
+ sort: r.value.sort
1995
2056
  })
1996
- ), vl = S(() => [
1997
- { key: "export", label: b("panel.export"), icon: "download", href: ml.value }
2057
+ ), Xe = U(() => [
2058
+ { key: "export", label: b("panel.export"), icon: "download", href: Je.value }
1998
2059
  ]);
1999
- return s({ create: pl }), (x, K) => (u(), j("div", {
2060
+ return s({ create: M }), (_, Z) => (o(), G("div", {
2000
2061
  ref_key: "root",
2001
- ref: i,
2062
+ ref: d,
2002
2063
  class: "wx-submissions"
2003
2064
  }, [
2004
- t(e(Qe), {
2065
+ t(e(tl), {
2005
2066
  class: "wx-submissions__head",
2006
2067
  level: 3,
2007
- title: Ge(),
2008
- subtitle: r.form.slug,
2009
- actions: vl.value
2068
+ title: Ne(),
2069
+ subtitle: i.form.slug,
2070
+ actions: Xe.value
2010
2071
  }, null, 8, ["title", "subtitle", "actions"]),
2011
- t(e(Xe), {
2012
- modelValue: M.value,
2013
- "onUpdate:modelValue": K[2] || (K[2] = (D) => M.value = D),
2072
+ t(e(nl), {
2073
+ modelValue: B.value,
2074
+ "onUpdate:modelValue": Z[2] || (Z[2] = (N) => B.value = N),
2014
2075
  class: "wx-submissions__views",
2015
- items: Q.value,
2076
+ items: X.value,
2016
2077
  "collapse-below": 560,
2017
2078
  "aria-label": e(b)("panel.status")
2018
2079
  }, {
2019
2080
  default: a(() => [
2020
- t(e(dl), {
2081
+ t(e(vl), {
2021
2082
  data: $.value,
2022
2083
  columns: k.value,
2023
2084
  "row-key": "id",
@@ -2025,141 +2086,141 @@ const jl = /* @__PURE__ */ ae({
2025
2086
  clickable: "",
2026
2087
  hover: "",
2027
2088
  flush: "",
2028
- loading: O.value,
2029
- selectable: N.value,
2030
- "select-row-label": e(W)("filters.select-row"),
2031
- "select-all-label": e(W)("filters.select-all"),
2032
- "row-class": (D) => D.is_read ? void 0 : "is-unread",
2089
+ loading: I.value,
2090
+ selectable: j.value,
2091
+ "select-row-label": e(F)("filters.select-row"),
2092
+ "select-all-label": e(F)("filters.select-all"),
2093
+ "row-class": (N) => N.is_read ? void 0 : "is-unread",
2033
2094
  "search-placeholder": e(b)("panel.search-submissions"),
2034
- "empty-text": y.value,
2035
- "cards-below": T.value,
2036
- "filters-count": pe.value.length,
2037
- onRowClick: R,
2038
- onStateChange: g,
2039
- onSelectionChange: K[1] || (K[1] = (D, Te) => _.value = Te)
2040
- }, Ne({
2041
- "cell-status": a(({ row: D }) => [
2042
- G("div", ft, [
2043
- D.status ? (u(), w(e(Se), {
2095
+ "empty-text": g.value,
2096
+ "cards-below": z.value,
2097
+ "filters-count": me.value.length,
2098
+ onRowClick: Ie,
2099
+ onStateChange: Ye,
2100
+ onSelectionChange: Z[1] || (Z[1] = (N, qe) => x.value = qe)
2101
+ }, Oe({
2102
+ "cell-status": a(({ row: N }) => [
2103
+ K("div", xt, [
2104
+ N.status ? (o(), w(e(Ue), {
2044
2105
  key: 0,
2045
- type: D.status.color
2106
+ type: N.status.color
2046
2107
  }, {
2047
2108
  default: a(() => [
2048
- z(V(re(D.status)), 1)
2109
+ S(V(de(N.status)), 1)
2049
2110
  ]),
2050
2111
  _: 2
2051
- }, 1032, ["type"])) : H("", !0),
2052
- D.assignee ? (u(), w(e(al), {
2112
+ }, 1032, ["type"])) : E("", !0),
2113
+ N.assignee ? (o(), w(e(il), {
2053
2114
  key: 1,
2054
- name: D.assignee.name,
2055
- title: D.assignee.name,
2115
+ name: N.assignee.name,
2116
+ title: N.assignee.name,
2056
2117
  size: "xs",
2057
2118
  tone: "auto"
2058
- }, null, 8, ["name", "title"])) : H("", !0),
2059
- D.files_count > 0 ? (u(), w(e(Cl), {
2119
+ }, null, 8, ["name", "title"])) : E("", !0),
2120
+ N.files_count > 0 ? (o(), w(e(ql), {
2060
2121
  key: 2,
2061
2122
  content: e(b)("panel.attachments")
2062
2123
  }, {
2063
2124
  default: a(() => [
2064
- t(e($e), {
2125
+ t(e(_e), {
2065
2126
  name: "file",
2066
2127
  size: "sm"
2067
2128
  })
2068
2129
  ]),
2069
2130
  _: 1
2070
- }, 8, ["content"])) : H("", !0)
2131
+ }, 8, ["content"])) : E("", !0)
2071
2132
  ])
2072
2133
  ]),
2073
- "cell-created_at": a(({ row: D }) => [
2074
- t(e(De), {
2075
- value: D.created_at,
2134
+ "cell-created_at": a(({ row: N }) => [
2135
+ t(e(Ee), {
2136
+ value: N.created_at,
2076
2137
  compact: ""
2077
2138
  }, null, 8, ["value"])
2078
2139
  ]),
2079
- "cell-card": a(({ row: D }) => [
2080
- t(e(Sl), {
2140
+ "cell-card": a(({ row: N }) => [
2141
+ t(e(Cl), {
2081
2142
  variant: "plain",
2082
2143
  shape: "circle",
2083
- title: I(D, 0)
2144
+ title: W(N, 0)
2084
2145
  }, {
2085
2146
  subtitle: a(() => [
2086
- z(V(I(D, 1)), 1)
2147
+ S(V(W(N, 1)), 1)
2087
2148
  ]),
2088
2149
  meta: a(() => [
2089
- D.status ? (u(), w(e(Se), {
2150
+ N.status ? (o(), w(e(Ue), {
2090
2151
  key: 0,
2091
- type: D.status.color,
2152
+ type: N.status.color,
2092
2153
  size: "sm"
2093
2154
  }, {
2094
2155
  default: a(() => [
2095
- z(V(re(D.status)), 1)
2156
+ S(V(de(N.status)), 1)
2096
2157
  ]),
2097
2158
  _: 2
2098
- }, 1032, ["type"])) : H("", !0),
2099
- D.assignee ? (u(), w(e(al), {
2159
+ }, 1032, ["type"])) : E("", !0),
2160
+ N.assignee ? (o(), w(e(il), {
2100
2161
  key: 1,
2101
- name: D.assignee.name,
2102
- title: D.assignee.name,
2162
+ name: N.assignee.name,
2163
+ title: N.assignee.name,
2103
2164
  size: "xs",
2104
2165
  tone: "auto"
2105
- }, null, 8, ["name", "title"])) : H("", !0),
2106
- D.files_count > 0 ? (u(), w(e($e), {
2166
+ }, null, 8, ["name", "title"])) : E("", !0),
2167
+ N.files_count > 0 ? (o(), w(e(_e), {
2107
2168
  key: 2,
2108
2169
  name: "file",
2109
2170
  size: "sm"
2110
- })) : H("", !0),
2111
- t(e(De), {
2112
- value: D.created_at
2171
+ })) : E("", !0),
2172
+ t(e(Ee), {
2173
+ value: N.created_at
2113
2174
  }, null, 8, ["value"])
2114
2175
  ]),
2115
2176
  _: 2
2116
2177
  }, 1032, ["title"])
2117
2178
  ]),
2118
- "card-actions": a(({ row: D }) => [
2119
- t(e(Fe), {
2120
- actions: Ae(D),
2121
- label: String(D.id)
2179
+ "card-actions": a(({ row: N }) => [
2180
+ t(e(ze), {
2181
+ actions: De(N),
2182
+ label: String(N.id)
2122
2183
  }, null, 8, ["actions", "label"])
2123
2184
  ]),
2124
- "cell-actions": a(({ row: D }) => [
2125
- t(e(Fe), {
2126
- actions: Ae(D),
2127
- label: String(D.id)
2185
+ "cell-actions": a(({ row: N }) => [
2186
+ t(e(ze), {
2187
+ actions: De(N),
2188
+ label: String(N.id)
2128
2189
  }, null, 8, ["actions", "label"])
2129
2190
  ]),
2130
2191
  _: 2
2131
2192
  }, [
2132
- _.value.length > 0 ? {
2193
+ x.value.length > 0 ? {
2133
2194
  name: "actions",
2134
2195
  fn: a(() => [
2135
- G("div", vt, [
2136
- t(e(J), {
2196
+ K("div", gt, [
2197
+ t(e(Q), {
2137
2198
  size: "sm",
2138
2199
  weight: "medium"
2139
2200
  }, {
2140
2201
  default: a(() => [
2141
- z(V(e(b)("panel.selected", { count: _.value.length })), 1)
2202
+ S(V(e(b)("panel.selected", { count: x.value.length })), 1)
2142
2203
  ]),
2143
2204
  _: 1
2144
2205
  }),
2145
- t(e(ve), {
2206
+ t(e(fe), {
2146
2207
  "model-value": null,
2147
- options: ue.value,
2208
+ options: re.value,
2148
2209
  placeholder: e(b)("panel.move-to"),
2149
- disabled: E.value,
2210
+ disabled: P.value,
2150
2211
  size: "sm",
2151
2212
  style: { width: "180px" },
2152
- "onUpdate:modelValue": je
2213
+ "onUpdate:modelValue": Qe
2153
2214
  }, null, 8, ["options", "placeholder", "disabled"]),
2154
- t(e(le), {
2215
+ t(e(te), {
2155
2216
  size: "sm",
2156
2217
  variant: "outline",
2157
2218
  type: "danger",
2158
2219
  icon: "trash",
2159
- onClick: K[0] || (K[0] = (D) => el(_.value.map((Te) => Te.id)))
2220
+ onClick: Z[0] || (Z[0] = (N) => y(x.value.map((qe) => qe.id)))
2160
2221
  }, {
2161
2222
  default: a(() => [
2162
- z(V(e(b)("panel.delete")), 1)
2223
+ S(V(e(b)("panel.delete")), 1)
2163
2224
  ]),
2164
2225
  _: 1
2165
2226
  })
@@ -2167,16 +2228,16 @@ const jl = /* @__PURE__ */ ae({
2167
2228
  ]),
2168
2229
  key: "0"
2169
2230
  } : void 0,
2170
- ye.value ? {
2231
+ J.value ? {
2171
2232
  name: "filters",
2172
2233
  fn: a(() => [
2173
- t(e(B), {
2234
+ t(e(H), {
2174
2235
  label: e(b)("panel.meta-placement")
2175
2236
  }, {
2176
2237
  default: a(() => [
2177
- t(e(ve), {
2178
- "model-value": v.value.placement,
2179
- options: Y.value,
2238
+ t(e(fe), {
2239
+ "model-value": r.value.placement,
2240
+ options: O.value,
2180
2241
  placeholder: e(b)("panel.any-placement"),
2181
2242
  clearable: "",
2182
2243
  size: "sm",
@@ -2188,10 +2249,10 @@ const jl = /* @__PURE__ */ ae({
2188
2249
  ]),
2189
2250
  key: "1"
2190
2251
  } : void 0,
2191
- pe.value.length > 0 ? {
2252
+ me.value.length > 0 ? {
2192
2253
  name: "applied",
2193
2254
  fn: a(() => [
2194
- t(e(yl), { filters: pe.value }, null, 8, ["filters"])
2255
+ t(e(xl), { filters: me.value }, null, 8, ["filters"])
2195
2256
  ]),
2196
2257
  key: "2"
2197
2258
  } : void 0
@@ -2201,46 +2262,46 @@ const jl = /* @__PURE__ */ ae({
2201
2262
  }, 8, ["modelValue", "items", "aria-label"])
2202
2263
  ], 512));
2203
2264
  }
2204
- }), yt = /* @__PURE__ */ ie(ht, [["__scopeId", "data-v-6bb4ef13"]]), gt = ["onClick"], xt = { class: "wx-inbox-form__name" }, _t = /* @__PURE__ */ ae({
2265
+ }), kt = /* @__PURE__ */ ue(wt, [["__scopeId", "data-v-6bb4ef13"]]), Vt = ["onClick"], $t = { class: "wx-inbox-form__name" }, Ut = /* @__PURE__ */ ne({
2205
2266
  __name: "InboxPage",
2206
2267
  props: {
2207
2268
  base: { default: "/inbox" }
2208
2269
  },
2209
- setup(r) {
2210
- const s = r, o = oe(), f = de(o), n = Oe(), d = Pe(), m = xe();
2211
- ce();
2212
- const l = te("webx-inbox"), U = be(), p = F([]), i = F(!0), L = il("pane"), C = F(!0), T = F(!1), b = S(() => o.can("inbox.manage")), W = Be(dt), c = S(
2213
- () => o.state.manifest?.modules.find((A) => A.id === "inbox")?.title ?? l("module.title")
2214
- ), $ = S(() => {
2270
+ setup(i) {
2271
+ const s = i, u = ie(), v = ce(u), n = Re(), c = Be(), f = we();
2272
+ pe();
2273
+ const l = ae("webx-inbox"), T = ye(), p = q([]), d = q(!0), D = cl("pane"), C = q(!0), z = q(!1), b = U(() => u.can("inbox.manage")), F = je(ft), m = U(
2274
+ () => u.state.manifest?.modules.find((A) => A.id === "inbox")?.title ?? l("module.title")
2275
+ ), $ = U(() => {
2215
2276
  const A = n.query.form;
2216
2277
  return typeof A == "string" && A !== "" ? Number(A) : null;
2217
- }), h = S(() => p.value.find((A) => A.id === $.value) ?? null);
2218
- function O(A) {
2219
- return fe(A.title, m.active.value, A.slug);
2278
+ }), h = U(() => p.value.find((A) => A.id === $.value) ?? null);
2279
+ function I(A) {
2280
+ return be(A.title, f.active.value, A.slug);
2220
2281
  }
2221
- async function _() {
2222
- i.value = !0;
2282
+ async function x() {
2283
+ d.value = !0;
2223
2284
  try {
2224
- p.value = await f.forms();
2285
+ p.value = await v.forms();
2225
2286
  } catch (A) {
2226
- P.danger(U(A));
2287
+ L.danger(T(A));
2227
2288
  } finally {
2228
- i.value = !1;
2289
+ d.value = !1;
2229
2290
  }
2230
2291
  }
2231
- _(), Ce([p, h], () => {
2232
- p.value.length === 0 || h.value !== null || d.replace({ query: { ...n.query, form: String(p.value[0].id) } });
2292
+ x(), Te([p, h], () => {
2293
+ p.value.length === 0 || h.value !== null || c.replace({ query: { ...n.query, form: String(p.value[0].id) } });
2233
2294
  });
2234
- function E(A, Q) {
2235
- d.replace({ query: { ...n.query, form: String(A.id) } }), Q();
2295
+ function P(A, X) {
2296
+ c.replace({ query: { ...n.query, form: String(A.id) } }), X();
2236
2297
  }
2237
- function N(A) {
2238
- d.push(`${s.base}/forms/${A.id}`);
2298
+ function j(A) {
2299
+ c.push(`${s.base}/forms/${A.id}`);
2239
2300
  }
2240
- function q(A) {
2301
+ function R(A) {
2241
2302
  return b.value ? [
2242
- { key: "settings", icon: "settings", label: l("panel.settings"), run: () => N(A) },
2243
- { key: "duplicate", icon: "copy", label: l("panel.duplicate"), run: () => v(A) },
2303
+ { key: "settings", icon: "settings", label: l("panel.settings"), run: () => j(A) },
2304
+ { key: "duplicate", icon: "copy", label: l("panel.duplicate"), run: () => r(A) },
2244
2305
  // A form that has taken submissions is switched off, never deleted (§2.4). The line is
2245
2306
  // left out rather than greyed: a menu is a list of what is possible.
2246
2307
  ...A.submissions_count === 0 ? [
@@ -2249,179 +2310,186 @@ const jl = /* @__PURE__ */ ae({
2249
2310
  icon: "trash",
2250
2311
  label: l("panel.delete"),
2251
2312
  danger: !0,
2252
- run: () => Y(A)
2313
+ run: () => O(A)
2253
2314
  }
2254
2315
  ] : []
2255
2316
  ] : [];
2256
2317
  }
2257
- async function M() {
2258
- const A = await W({});
2259
- A && (await _(), N(A));
2318
+ async function B() {
2319
+ const A = await F({});
2320
+ A && (await x(), j(A));
2260
2321
  }
2261
- async function v(A) {
2322
+ async function r(A) {
2262
2323
  try {
2263
- const Q = await f.duplicateForm(A.id);
2264
- P.success(l("panel.duplicated")), await _(), N(Q);
2265
- } catch (Q) {
2266
- P.danger(U(Q));
2324
+ const X = await v.duplicateForm(A.id);
2325
+ L.success(l("panel.duplicated")), await x(), j(X);
2326
+ } catch (X) {
2327
+ L.danger(T(X));
2267
2328
  }
2268
2329
  }
2269
- async function Y(A) {
2270
- if (await ze({
2271
- title: l("panel.delete-form-title", { form: O(A) }),
2330
+ async function O(A) {
2331
+ if (await Ce({
2332
+ title: l("panel.delete-form-title", { form: I(A) }),
2272
2333
  message: l("panel.delete-form-text"),
2273
2334
  confirmText: l("panel.delete"),
2274
2335
  cancelText: l("panel.cancel"),
2275
2336
  tone: "danger"
2276
2337
  }))
2277
2338
  try {
2278
- if (await f.removeForm(A.id), P.success(l("panel.deleted")), $.value === A.id) {
2279
- const I = { ...n.query };
2280
- delete I.form, d.replace({ query: I });
2339
+ if (await v.removeForm(A.id), L.success(l("panel.deleted")), $.value === A.id) {
2340
+ const W = { ...n.query };
2341
+ delete W.form, c.replace({ query: W });
2281
2342
  }
2282
- await _();
2283
- } catch (I) {
2284
- P.danger(U(I));
2343
+ await x();
2344
+ } catch (W) {
2345
+ L.danger(T(W));
2285
2346
  }
2286
2347
  }
2287
- async function ye() {
2348
+ async function J() {
2288
2349
  try {
2289
- await f.sortForms(p.value.map((A) => A.id));
2350
+ await v.sortForms(p.value.map((A) => A.id));
2290
2351
  } catch (A) {
2291
- P.danger(U(A, l("panel.reorder-failed"))), await _();
2352
+ L.danger(T(A, l("panel.reorder-failed"))), await x();
2292
2353
  }
2293
2354
  }
2294
- const pe = S(() => {
2355
+ const me = U(() => {
2295
2356
  const A = [];
2296
2357
  return b.value && A.push({
2297
2358
  key: "statuses",
2298
2359
  label: l("panel.statuses"),
2299
2360
  icon: "tag",
2300
2361
  run: () => {
2301
- d.push(`${s.base}/statuses`);
2362
+ c.push(`${s.base}/statuses`);
2302
2363
  }
2303
- }), o.can("inbox.update") && h.value !== null && A.push({
2364
+ }), u.can("inbox.update") && h.value !== null && A.push({
2304
2365
  key: "new-submission",
2305
2366
  label: l("panel.new-submission"),
2306
2367
  icon: "plus",
2307
2368
  primary: !0,
2308
2369
  run: () => {
2309
- L.value?.create();
2370
+ D.value?.create();
2310
2371
  }
2311
2372
  }), A;
2312
2373
  });
2313
- return (A, Q) => (u(), w(e(ul), {
2314
- title: c.value,
2315
- actions: pe.value,
2374
+ return (A, X) => (o(), w(e(pl), {
2375
+ title: m.value,
2376
+ actions: me.value,
2316
2377
  card: !1
2317
- }, Ne({
2378
+ }, Oe({
2318
2379
  default: a(() => [
2319
- t(e(se), {
2380
+ t(e(oe), {
2320
2381
  class: "wx-inbox",
2321
2382
  padding: "none"
2322
2383
  }, {
2323
2384
  default: a(() => [
2324
2385
  t(e(zl), {
2325
- "filters-open": T.value,
2326
- "onUpdate:filtersOpen": Q[2] || (Q[2] = (I) => T.value = I),
2386
+ "filters-open": z.value,
2387
+ "onUpdate:filtersOpen": X[2] || (X[2] = (W) => z.value = W),
2327
2388
  class: "wx-inbox__panes",
2328
2389
  "filters-width": 270,
2329
2390
  "detail-min": 420,
2330
2391
  "filters-title": e(l)("panel.forms"),
2331
- onFiltersInline: Q[3] || (Q[3] = (I) => C.value = I)
2392
+ onFiltersInline: X[3] || (X[3] = (W) => C.value = W)
2332
2393
  }, {
2333
- filters: a(({ inline: I, close: k }) => [
2334
- i.value ? (u(), w(e(We), {
2394
+ filters: a(({ inline: W, close: k }) => [
2395
+ d.value ? (o(), w(e(We), {
2335
2396
  key: 0,
2336
2397
  class: "wx-inbox__loading",
2337
2398
  rows: 5
2338
- })) : (u(), j(ee, { key: 1 }, [
2339
- !I && b.value ? (u(), w(e(le), {
2399
+ })) : (o(), G(ee, { key: 1 }, [
2400
+ !W && b.value ? (o(), w(e(te), {
2340
2401
  key: 0,
2341
2402
  class: "wx-inbox__new-form",
2342
2403
  variant: "outline",
2343
2404
  block: "",
2344
- onClick: M
2405
+ onClick: B
2345
2406
  }, {
2346
2407
  icon: a(() => [
2347
- t(e($e), { name: "plus" })
2408
+ t(e(_e), { name: "plus" })
2348
2409
  ]),
2349
2410
  default: a(() => [
2350
- z(" " + V(e(l)("panel.new-form")), 1)
2411
+ S(" " + V(e(l)("panel.new-form")), 1)
2351
2412
  ]),
2352
2413
  _: 1
2353
- })) : H("", !0),
2354
- t(e(Je), {
2414
+ })) : E("", !0),
2415
+ t(e(al), {
2355
2416
  modelValue: p.value,
2356
- "onUpdate:modelValue": Q[1] || (Q[1] = (y) => p.value = y),
2357
- class: ll(["wx-inbox__forms", { "is-panel": !I }]),
2417
+ "onUpdate:modelValue": X[1] || (X[1] = (g) => p.value = g),
2418
+ class: sl(["wx-inbox__forms", { "is-panel": !W }]),
2358
2419
  plain: "",
2359
2420
  size: "sm",
2360
2421
  "item-key": "id",
2361
- "item-label": O,
2422
+ "item-label": I,
2362
2423
  disabled: !b.value,
2363
- title: I ? e(l)("panel.forms") : void 0,
2364
- onMove: ye
2365
- }, Ne({
2366
- default: a(({ item: y }) => [
2367
- G("button", {
2424
+ title: W ? e(l)("panel.forms") : void 0,
2425
+ onMove: J
2426
+ }, Oe({
2427
+ default: a(({ item: g }) => [
2428
+ K("button", {
2368
2429
  type: "button",
2369
- class: ll(["wx-inbox-form", { "is-current": y.id === $.value, "is-off": !y.is_enabled }]),
2370
- onClick: (ue) => E(y, k)
2430
+ class: sl(["wx-inbox-form", { "is-current": g.id === $.value, "is-off": !g.is_enabled }]),
2431
+ onClick: (re) => P(g, k)
2371
2432
  }, [
2372
- G("span", xt, [
2373
- t(e(J), {
2433
+ K("span", $t, [
2434
+ t(e(Q), {
2374
2435
  truncate: "",
2375
2436
  weight: "medium",
2376
- tone: y.is_enabled ? "default" : "muted"
2437
+ tone: g.is_enabled ? "default" : "muted"
2377
2438
  }, {
2378
2439
  default: a(() => [
2379
- z(V(O(y)), 1)
2440
+ S(V(I(g)), 1)
2380
2441
  ]),
2381
2442
  _: 2
2382
2443
  }, 1032, ["tone"]),
2383
- y.unread_count ? (u(), w(e(nl), {
2444
+ g.is_enabled && g.notifies === !1 ? (o(), w(e(_e), {
2384
2445
  key: 0,
2446
+ class: "wx-inbox-form__silent",
2447
+ name: "warning",
2448
+ label: e(l)("panel.notifies-nobody-short"),
2449
+ title: e(l)("panel.notifies-nobody-short")
2450
+ }, null, 8, ["label", "title"])) : E("", !0),
2451
+ g.unread_count ? (o(), w(e(ul), {
2452
+ key: 1,
2385
2453
  class: "wx-inbox-form__count",
2386
2454
  type: "primary",
2387
- value: y.unread_count,
2455
+ value: g.unread_count,
2388
2456
  label: e(l)("panel.unread")
2389
- }, null, 8, ["value", "label"])) : y.submissions_count ? (u(), w(e(nl), {
2390
- key: 1,
2457
+ }, null, 8, ["value", "label"])) : g.submissions_count ? (o(), w(e(ul), {
2458
+ key: 2,
2391
2459
  class: "wx-inbox-form__count",
2392
2460
  type: "neutral",
2393
- value: y.submissions_count,
2461
+ value: g.submissions_count,
2394
2462
  label: e(l)("panel.submissions")
2395
- }, null, 8, ["value", "label"])) : H("", !0)
2463
+ }, null, 8, ["value", "label"])) : E("", !0)
2396
2464
  ]),
2397
- t(e(J), {
2465
+ t(e(Q), {
2398
2466
  size: "sm",
2399
2467
  tone: "muted",
2400
2468
  truncate: ""
2401
2469
  }, {
2402
2470
  default: a(() => [
2403
- z(V(y.slug), 1)
2471
+ S(V(g.slug), 1)
2404
2472
  ]),
2405
2473
  _: 2
2406
2474
  }, 1024)
2407
- ], 10, gt)
2475
+ ], 10, Vt)
2408
2476
  ]),
2409
- actions: a(({ item: y }) => [
2410
- t(e(Fe), {
2411
- actions: q(y),
2412
- label: O(y)
2477
+ actions: a(({ item: g }) => [
2478
+ t(e(ze), {
2479
+ actions: R(g),
2480
+ label: I(g)
2413
2481
  }, null, 8, ["actions", "label"])
2414
2482
  ]),
2415
2483
  _: 2
2416
2484
  }, [
2417
- I && b.value ? {
2485
+ W && b.value ? {
2418
2486
  name: "extra",
2419
2487
  fn: a(() => [
2420
- t(e(Ve), {
2488
+ t(e($e), {
2421
2489
  icon: "plus",
2422
2490
  size: "sm",
2423
2491
  title: e(l)("panel.new-form"),
2424
- onClick: M
2492
+ onClick: B
2425
2493
  }, null, 8, ["title"])
2426
2494
  ]),
2427
2495
  key: "0"
@@ -2430,18 +2498,18 @@ const jl = /* @__PURE__ */ ae({
2430
2498
  ], 64))
2431
2499
  ]),
2432
2500
  list: a(() => [
2433
- i.value ? (u(), w(e(We), {
2501
+ d.value ? (o(), w(e(We), {
2434
2502
  key: 0,
2435
2503
  class: "wx-inbox__loading",
2436
2504
  rows: 6
2437
- })) : h.value ? (u(), w(yt, {
2505
+ })) : h.value ? (o(), w(kt, {
2438
2506
  ref_key: "pane",
2439
- ref: L,
2507
+ ref: D,
2440
2508
  key: h.value.id,
2441
2509
  form: h.value,
2442
2510
  base: s.base,
2443
- onChanged: _
2444
- }, null, 8, ["form", "base"])) : (u(), w(e(He), {
2511
+ onChanged: x
2512
+ }, null, 8, ["form", "base"])) : (o(), w(e(Ke), {
2445
2513
  key: 2,
2446
2514
  title: e(l)("panel.no-forms"),
2447
2515
  description: e(l)("panel.no-forms-help")
@@ -2458,15 +2526,15 @@ const jl = /* @__PURE__ */ ae({
2458
2526
  C.value ? void 0 : {
2459
2527
  name: "actions",
2460
2528
  fn: a(() => [
2461
- t(e(le), {
2529
+ t(e(te), {
2462
2530
  variant: "outline",
2463
- onClick: Q[0] || (Q[0] = (I) => T.value = !0)
2531
+ onClick: X[0] || (X[0] = (W) => z.value = !0)
2464
2532
  }, {
2465
2533
  icon: a(() => [
2466
- t(e($e), { name: "list" })
2534
+ t(e(_e), { name: "list" })
2467
2535
  ]),
2468
2536
  default: a(() => [
2469
- z(" " + V(e(l)("panel.forms")), 1)
2537
+ S(" " + V(e(l)("panel.forms")), 1)
2470
2538
  ]),
2471
2539
  _: 1
2472
2540
  })
@@ -2475,74 +2543,74 @@ const jl = /* @__PURE__ */ ae({
2475
2543
  }
2476
2544
  ]), 1032, ["title", "actions"]));
2477
2545
  }
2478
- }), wt = { class: "wx-inbox-status-form" }, kt = { class: "wx-inbox-status-form__checks" }, Vt = /* @__PURE__ */ ae({
2546
+ }), St = { class: "wx-inbox-status-form" }, Tt = { class: "wx-inbox-status-form__checks" }, Ct = /* @__PURE__ */ ne({
2479
2547
  __name: "StatusDialog",
2480
2548
  props: {
2481
2549
  status: {}
2482
2550
  },
2483
- setup(r) {
2484
- const s = r, { resolve: o, dismiss: f, open: n } = Ee(), d = oe(), m = de(d);
2485
- ce();
2486
- const l = te("webx-inbox"), U = be(), p = F(""), i = F({}), L = F("default"), C = F(!1), T = F(!1), b = F(!1), W = F(!1), c = F({});
2487
- Ce(
2551
+ setup(i) {
2552
+ const s = i, { resolve: u, dismiss: v, open: n } = He(), c = ie(), f = ce(c);
2553
+ pe();
2554
+ const l = ae("webx-inbox"), T = ye(), p = q(""), d = q({}), D = q("default"), C = q(!1), z = q(!1), b = q(!1), F = q(!1), m = q({});
2555
+ Te(
2488
2556
  () => s.status,
2489
- (_) => {
2490
- p.value = _?.key ?? "", i.value = { ..._?.title ?? {} }, L.value = _?.color ?? "default", C.value = _?.is_default ?? !1, T.value = _?.is_spam ?? !1, b.value = _?.is_closed ?? !1, c.value = {};
2557
+ (x) => {
2558
+ p.value = x?.key ?? "", d.value = { ...x?.title ?? {} }, D.value = x?.color ?? "default", C.value = x?.is_default ?? !1, z.value = x?.is_spam ?? !1, b.value = x?.is_closed ?? !1, m.value = {};
2491
2559
  },
2492
2560
  { immediate: !0 }
2493
2561
  );
2494
- const $ = S(
2495
- () => Il.map((_) => ({ value: _, label: l(`panel.color-${_}`) }))
2562
+ const $ = U(
2563
+ () => Dl.map((x) => ({ value: x, label: l(`panel.color-${x}`) }))
2496
2564
  );
2497
- function h(_) {
2498
- return c.value[_]?.[0];
2565
+ function h(x) {
2566
+ return m.value[x]?.[0];
2499
2567
  }
2500
- async function O() {
2501
- W.value = !0, c.value = {};
2502
- const _ = {
2568
+ async function I() {
2569
+ F.value = !0, m.value = {};
2570
+ const x = {
2503
2571
  key: p.value.trim(),
2504
- title: i.value,
2505
- color: L.value,
2572
+ title: d.value,
2573
+ color: D.value,
2506
2574
  is_default: C.value,
2507
- is_spam: T.value,
2575
+ is_spam: z.value,
2508
2576
  is_closed: b.value
2509
2577
  };
2510
2578
  try {
2511
- o(
2512
- s.status === null ? await m.createStatus(_) : await m.saveStatus(s.status.id, _)
2579
+ u(
2580
+ s.status === null ? await f.createStatus(x) : await f.saveStatus(s.status.id, x)
2513
2581
  );
2514
- } catch (E) {
2515
- const N = E.body;
2516
- N?.errors ? (c.value = N.errors, P.danger(l("panel.failed"))) : P.danger(U(E));
2582
+ } catch (P) {
2583
+ const j = P.body;
2584
+ j?.errors ? (m.value = j.errors, L.danger(l("panel.failed"))) : L.danger(T(P));
2517
2585
  } finally {
2518
- W.value = !1;
2586
+ F.value = !1;
2519
2587
  }
2520
2588
  }
2521
- return (_, E) => (u(), w(e(Re), {
2589
+ return (x, P) => (o(), w(e(Ge), {
2522
2590
  open: e(n),
2523
- "onUpdate:open": E[7] || (E[7] = (N) => ne(n) ? n.value = N : null),
2524
- title: r.status ? e(l)("panel.settings") : e(l)("panel.new-status"),
2591
+ "onUpdate:open": P[7] || (P[7] = (j) => se(n) ? n.value = j : null),
2592
+ title: i.status ? e(l)("panel.settings") : e(l)("panel.new-status"),
2525
2593
  width: 520
2526
2594
  }, {
2527
2595
  footer: a(() => [
2528
- t(e(qe), { size: "sm" }, {
2596
+ t(e(Ae), { size: "sm" }, {
2529
2597
  default: a(() => [
2530
- t(e(le), {
2598
+ t(e(te), {
2531
2599
  variant: "outline",
2532
- onClick: E[6] || (E[6] = (N) => e(f)())
2600
+ onClick: P[6] || (P[6] = (j) => e(v)())
2533
2601
  }, {
2534
2602
  default: a(() => [
2535
- z(V(e(l)("panel.cancel")), 1)
2603
+ S(V(e(l)("panel.cancel")), 1)
2536
2604
  ]),
2537
2605
  _: 1
2538
2606
  }),
2539
- t(e(le), {
2607
+ t(e(te), {
2540
2608
  type: "primary",
2541
- loading: W.value,
2542
- onClick: O
2609
+ loading: F.value,
2610
+ onClick: I
2543
2611
  }, {
2544
2612
  default: a(() => [
2545
- z(V(e(l)("panel.save")), 1)
2613
+ S(V(e(l)("panel.save")), 1)
2546
2614
  ]),
2547
2615
  _: 1
2548
2616
  }, 8, ["loading"])
@@ -2551,63 +2619,63 @@ const jl = /* @__PURE__ */ ae({
2551
2619
  })
2552
2620
  ]),
2553
2621
  default: a(() => [
2554
- G("div", wt, [
2555
- t(e(B), {
2622
+ K("div", St, [
2623
+ t(e(H), {
2556
2624
  label: e(l)("panel.title"),
2557
2625
  error: h("title"),
2558
2626
  required: ""
2559
2627
  }, {
2560
2628
  default: a(() => [
2561
- t(e(X), {
2562
- modelValue: i.value,
2563
- "onUpdate:modelValue": E[0] || (E[0] = (N) => i.value = N),
2629
+ t(e(le), {
2630
+ modelValue: d.value,
2631
+ "onUpdate:modelValue": P[0] || (P[0] = (j) => d.value = j),
2564
2632
  localized: ""
2565
2633
  }, null, 8, ["modelValue"])
2566
2634
  ]),
2567
2635
  _: 1
2568
2636
  }, 8, ["label", "error"]),
2569
- t(e(B), {
2637
+ t(e(H), {
2570
2638
  label: e(l)("panel.status-key"),
2571
2639
  error: h("key"),
2572
2640
  required: ""
2573
2641
  }, {
2574
2642
  default: a(() => [
2575
- t(e(X), {
2643
+ t(e(le), {
2576
2644
  modelValue: p.value,
2577
- "onUpdate:modelValue": E[1] || (E[1] = (N) => p.value = N),
2645
+ "onUpdate:modelValue": P[1] || (P[1] = (j) => p.value = j),
2578
2646
  placeholder: "in-progress"
2579
2647
  }, null, 8, ["modelValue"])
2580
2648
  ]),
2581
2649
  _: 1
2582
2650
  }, 8, ["label", "error"]),
2583
- t(e(B), {
2651
+ t(e(H), {
2584
2652
  label: e(l)("panel.status-color"),
2585
2653
  error: h("color")
2586
2654
  }, {
2587
2655
  default: a(() => [
2588
- t(e(ve), {
2589
- modelValue: L.value,
2590
- "onUpdate:modelValue": E[2] || (E[2] = (N) => L.value = N),
2656
+ t(e(fe), {
2657
+ modelValue: D.value,
2658
+ "onUpdate:modelValue": P[2] || (P[2] = (j) => D.value = j),
2591
2659
  options: $.value
2592
2660
  }, null, 8, ["modelValue", "options"])
2593
2661
  ]),
2594
2662
  _: 1
2595
2663
  }, 8, ["label", "error"]),
2596
- G("div", kt, [
2664
+ K("div", Tt, [
2597
2665
  t(e(he), {
2598
2666
  modelValue: C.value,
2599
- "onUpdate:modelValue": E[3] || (E[3] = (N) => C.value = N),
2667
+ "onUpdate:modelValue": P[3] || (P[3] = (j) => C.value = j),
2600
2668
  label: e(l)("panel.status-default")
2601
2669
  }, null, 8, ["modelValue", "label"]),
2602
2670
  t(e(he), {
2603
- modelValue: T.value,
2604
- "onUpdate:modelValue": E[4] || (E[4] = (N) => T.value = N),
2671
+ modelValue: z.value,
2672
+ "onUpdate:modelValue": P[4] || (P[4] = (j) => z.value = j),
2605
2673
  label: e(l)("panel.status-spam")
2606
2674
  }, null, 8, ["modelValue", "label"]),
2607
2675
  t(e(he), {
2608
2676
  modelValue: b.value,
2609
- "onUpdate:modelValue": E[5] || (E[5] = (N) => b.value = N),
2610
- disabled: T.value,
2677
+ "onUpdate:modelValue": P[5] || (P[5] = (j) => b.value = j),
2678
+ disabled: z.value,
2611
2679
  label: e(l)("panel.status-closed")
2612
2680
  }, null, 8, ["modelValue", "disabled", "label"])
2613
2681
  ])
@@ -2616,50 +2684,50 @@ const jl = /* @__PURE__ */ ae({
2616
2684
  _: 1
2617
2685
  }, 8, ["open", "title"]));
2618
2686
  }
2619
- }), $t = /* @__PURE__ */ ie(Vt, [["__scopeId", "data-v-b520b53b"]]), Ut = { class: "wx-inbox-statuses" }, St = { class: "wx-inbox-status" }, Ct = /* @__PURE__ */ ae({
2687
+ }), qt = /* @__PURE__ */ ue(Ct, [["__scopeId", "data-v-b520b53b"]]), zt = { class: "wx-inbox-statuses" }, Ft = { class: "wx-inbox-status" }, Wt = /* @__PURE__ */ ne({
2620
2688
  __name: "StatusesPage",
2621
2689
  props: {
2622
2690
  base: { default: "/inbox" }
2623
2691
  },
2624
- setup(r) {
2625
- const s = r, o = oe(), f = de(o), n = xe();
2626
- ce();
2627
- const d = te("webx-inbox"), m = be(), l = F([]), U = F(!0), p = o.can("inbox.manage"), i = Be($t);
2628
- function L(h) {
2629
- return fe(h.title, n.active.value, h.key);
2692
+ setup(i) {
2693
+ const s = i, u = ie(), v = ce(u), n = we();
2694
+ pe();
2695
+ const c = ae("webx-inbox"), f = ye(), l = q([]), T = q(!0), p = u.can("inbox.manage"), d = je(qt);
2696
+ function D(h) {
2697
+ return be(h.title, n.active.value, h.key);
2630
2698
  }
2631
2699
  async function C() {
2632
- U.value = !0;
2700
+ T.value = !0;
2633
2701
  try {
2634
- l.value = await f.statuses();
2702
+ l.value = await v.statuses();
2635
2703
  } catch (h) {
2636
- P.danger(m(h));
2704
+ L.danger(f(h));
2637
2705
  } finally {
2638
- U.value = !1;
2706
+ T.value = !1;
2639
2707
  }
2640
2708
  }
2641
2709
  C();
2642
- async function T(h) {
2643
- await i({ status: h }) && await C();
2710
+ async function z(h) {
2711
+ await d({ status: h }) && await C();
2644
2712
  }
2645
2713
  async function b(h) {
2646
- if (await ze({
2647
- title: d("panel.delete-status-title", { status: L(h) }),
2648
- message: d("panel.delete-status-text"),
2649
- confirmText: d("panel.delete"),
2650
- cancelText: d("panel.cancel"),
2714
+ if (await Ce({
2715
+ title: c("panel.delete-status-title", { status: D(h) }),
2716
+ message: c("panel.delete-status-text"),
2717
+ confirmText: c("panel.delete"),
2718
+ cancelText: c("panel.cancel"),
2651
2719
  tone: "danger"
2652
2720
  }))
2653
2721
  try {
2654
- await f.removeStatus(h.id), P.success(d("panel.deleted")), await C();
2655
- } catch (_) {
2656
- P.danger(m(_));
2722
+ await v.removeStatus(h.id), L.success(c("panel.deleted")), await C();
2723
+ } catch (x) {
2724
+ L.danger(f(x));
2657
2725
  }
2658
2726
  }
2659
- function W(h) {
2727
+ function F(h) {
2660
2728
  return p ? [
2661
- { key: "edit", icon: "edit", label: d("panel.settings"), run: () => {
2662
- T(h);
2729
+ { key: "edit", icon: "edit", label: c("panel.settings"), run: () => {
2730
+ z(h);
2663
2731
  } },
2664
2732
  // A status with submissions in them cannot go: they would have nothing to be in. The
2665
2733
  // line is left out rather than greyed, the way every list of the panel does it.
@@ -2667,7 +2735,7 @@ const jl = /* @__PURE__ */ ae({
2667
2735
  {
2668
2736
  key: "delete",
2669
2737
  icon: "trash",
2670
- label: d("panel.delete"),
2738
+ label: c("panel.delete"),
2671
2739
  danger: !0,
2672
2740
  run: () => {
2673
2741
  b(h);
@@ -2676,85 +2744,85 @@ const jl = /* @__PURE__ */ ae({
2676
2744
  ] : []
2677
2745
  ] : [];
2678
2746
  }
2679
- const c = S(
2747
+ const m = U(
2680
2748
  () => p ? [
2681
2749
  {
2682
2750
  key: "new",
2683
- label: d("panel.new-status"),
2751
+ label: c("panel.new-status"),
2684
2752
  icon: "plus",
2685
2753
  primary: !0,
2686
2754
  run: () => {
2687
- T(null);
2755
+ z(null);
2688
2756
  }
2689
2757
  }
2690
2758
  ] : []
2691
2759
  );
2692
2760
  async function $() {
2693
2761
  try {
2694
- await f.sortStatuses(l.value.map((h) => h.id));
2762
+ await v.sortStatuses(l.value.map((h) => h.id));
2695
2763
  } catch (h) {
2696
- P.danger(m(h, d("panel.reorder-failed"))), await C();
2764
+ L.danger(f(h, c("panel.reorder-failed"))), await C();
2697
2765
  }
2698
2766
  }
2699
- return (h, O) => (u(), j("div", Ut, [
2700
- t(e(ul), {
2701
- title: e(d)("panel.statuses"),
2767
+ return (h, I) => (o(), G("div", zt, [
2768
+ t(e(pl), {
2769
+ title: e(c)("panel.statuses"),
2702
2770
  back: s.base,
2703
- "back-label": e(d)("panel.forms"),
2704
- actions: c.value
2771
+ "back-label": e(c)("panel.forms"),
2772
+ actions: m.value
2705
2773
  }, {
2706
2774
  default: a(() => [
2707
- !U.value && l.value.length === 0 ? (u(), w(e(He), {
2775
+ !T.value && l.value.length === 0 ? (o(), w(e(Ke), {
2708
2776
  key: 0,
2709
- title: e(d)("panel.no-statuses")
2710
- }, null, 8, ["title"])) : (u(), w(e(Je), {
2777
+ title: e(c)("panel.no-statuses")
2778
+ }, null, 8, ["title"])) : (o(), w(e(al), {
2711
2779
  key: 1,
2712
2780
  modelValue: l.value,
2713
- "onUpdate:modelValue": O[0] || (O[0] = (_) => l.value = _),
2781
+ "onUpdate:modelValue": I[0] || (I[0] = (x) => l.value = x),
2714
2782
  plain: "",
2715
2783
  "item-key": "id",
2716
- "item-label": L,
2784
+ "item-label": D,
2717
2785
  disabled: !e(p),
2718
- "aria-label": e(d)("panel.statuses"),
2786
+ "aria-label": e(c)("panel.statuses"),
2719
2787
  onMove: $
2720
2788
  }, {
2721
- default: a(({ item: _ }) => [
2722
- G("div", St, [
2723
- t(e(Se), {
2724
- type: _.color
2789
+ default: a(({ item: x }) => [
2790
+ K("div", Ft, [
2791
+ t(e(Ue), {
2792
+ type: x.color
2725
2793
  }, {
2726
2794
  default: a(() => [
2727
- z(V(L(_)), 1)
2795
+ S(V(D(x)), 1)
2728
2796
  ]),
2729
2797
  _: 2
2730
2798
  }, 1032, ["type"]),
2731
- t(e(J), {
2799
+ t(e(Q), {
2732
2800
  size: "sm",
2733
2801
  tone: "muted",
2734
2802
  truncate: ""
2735
2803
  }, {
2736
2804
  default: a(() => [
2737
- G("code", null, V(_.key), 1),
2738
- _.is_default ? (u(), j(ee, { key: 0 }, [
2739
- z(" · " + V(e(d)("panel.status-default")), 1)
2740
- ], 64)) : H("", !0),
2741
- _.is_spam ? (u(), j(ee, { key: 1 }, [
2742
- z(" · " + V(e(d)("panel.status-spam")), 1)
2743
- ], 64)) : _.is_closed ? (u(), j(ee, { key: 2 }, [
2744
- z(" · " + V(e(d)("panel.status-closed")), 1)
2745
- ], 64)) : H("", !0),
2746
- _.submissions_count ? (u(), j(ee, { key: 3 }, [
2747
- z(" · " + V(e(d)("panel.in-use")) + " (" + V(_.submissions_count) + ") ", 1)
2748
- ], 64)) : H("", !0)
2805
+ K("code", null, V(x.key), 1),
2806
+ x.is_default ? (o(), G(ee, { key: 0 }, [
2807
+ S(" · " + V(e(c)("panel.status-default")), 1)
2808
+ ], 64)) : E("", !0),
2809
+ x.is_spam ? (o(), G(ee, { key: 1 }, [
2810
+ S(" · " + V(e(c)("panel.status-spam")), 1)
2811
+ ], 64)) : x.is_closed ? (o(), G(ee, { key: 2 }, [
2812
+ S(" · " + V(e(c)("panel.status-closed")), 1)
2813
+ ], 64)) : E("", !0),
2814
+ x.submissions_count ? (o(), G(ee, { key: 3 }, [
2815
+ S(" · " + V(e(c)("panel.in-use")) + " (" + V(x.submissions_count) + ") ", 1)
2816
+ ], 64)) : E("", !0)
2749
2817
  ]),
2750
2818
  _: 2
2751
2819
  }, 1024)
2752
2820
  ])
2753
2821
  ]),
2754
- actions: a(({ item: _ }) => [
2755
- t(e(Fe), {
2756
- actions: W(_),
2757
- label: L(_)
2822
+ actions: a(({ item: x }) => [
2823
+ t(e(ze), {
2824
+ actions: F(x),
2825
+ label: D(x)
2758
2826
  }, null, 8, ["actions", "label"])
2759
2827
  ]),
2760
2828
  _: 1
@@ -2764,90 +2832,102 @@ const jl = /* @__PURE__ */ ae({
2764
2832
  }, 8, ["title", "back", "back-label", "actions"])
2765
2833
  ]));
2766
2834
  }
2767
- }), zt = /* @__PURE__ */ ie(Ct, [["__scopeId", "data-v-f94bf140"]]), Tt = { class: "wx-submission" }, Ft = {
2835
+ }), At = /* @__PURE__ */ ue(Wt, [["__scopeId", "data-v-f94bf140"]]), Nt = { class: "wx-submission" }, It = {
2768
2836
  key: 1,
2769
2837
  class: "wx-submission__panes"
2770
- }, Wt = { class: "wx-submission__main" }, qt = { class: "wx-submission__value" }, At = { class: "wx-submission__files" }, It = { class: "wx-submission__by" }, Nt = { class: "wx-submission__fields" }, Dt = ["href"], Mt = {
2838
+ }, Dt = { class: "wx-submission__main" }, Mt = { class: "wx-submission__value" }, Lt = { class: "wx-submission__files" }, Ot = { class: "wx-submission__by" }, Et = { class: "wx-submission__fields" }, Pt = ["href"], Rt = {
2771
2839
  key: 1,
2772
2840
  class: "wx-submission__detail"
2773
- }, Lt = { class: "wx-submission__aside" }, Ot = { class: "wx-submission__fields" }, Pt = { class: "wx-submission__field" }, Et = { class: "wx-submission__field" }, Rt = /* @__PURE__ */ ae({
2841
+ }, Bt = { class: "wx-submission__detail" }, Ht = {
2842
+ key: 5,
2843
+ class: "wx-submission__recipients"
2844
+ }, Gt = { key: 6 }, jt = { class: "wx-submission__aside" }, Kt = { class: "wx-submission__fields" }, Yt = { class: "wx-submission__field" }, Zt = { class: "wx-submission__field" }, Qt = /* @__PURE__ */ ne({
2774
2845
  __name: "SubmissionPage",
2775
2846
  props: {
2776
2847
  base: { default: "/inbox" }
2777
2848
  },
2778
- setup(r) {
2779
- const s = r, o = oe(), f = de(o), n = Oe(), d = Pe(), m = xe();
2780
- ce();
2781
- const l = te("webx-inbox"), U = te("webx-admin"), p = be(), i = F(null), L = F([]), C = F([]), T = F(!0), b = S(() => o.can("inbox.update")), W = S(() => Number(n.params.id)), c = S(() => ({
2849
+ setup(i) {
2850
+ const s = i, u = ie(), v = ce(u), n = Re(), c = Be(), f = we();
2851
+ pe();
2852
+ const l = ae("webx-inbox"), T = ae("webx-admin"), p = ye(), d = q(null), D = q([]), C = q([]), z = q(!0), b = U(() => u.can("inbox.update")), F = U(() => Number(n.params.id)), m = U(() => ({
2782
2853
  view: typeof n.query.view == "string" ? n.query.view : void 0,
2783
2854
  search: typeof n.query.search == "string" ? n.query.search : void 0,
2784
2855
  assignee: typeof n.query.assignee == "string" ? n.query.assignee : void 0
2785
- })), $ = S(() => ({ path: s.base, query: { ...n.query } })), h = S(
2786
- () => L.value.map((g) => ({ value: g.id, label: _(g) }))
2787
- ), O = S(
2788
- () => C.value.map((g) => ({ value: g.id, label: g.name }))
2856
+ })), $ = U(() => ({ path: s.base, query: { ...n.query } })), h = U(
2857
+ () => D.value.map((y) => ({ value: y.id, label: x(y) }))
2858
+ ), I = U(
2859
+ () => C.value.map((y) => ({ value: y.id, label: y.name }))
2789
2860
  );
2790
- function _(g) {
2791
- return fe(g.title, m.active.value, g.key);
2792
- }
2793
- const E = S(() => l("panel.submission", { id: String(W.value) })), N = S(() => {
2794
- const g = i.value?.form;
2795
- return g === void 0 ? "" : fe(g.title ?? {}, m.active.value, g.slug ?? "");
2796
- }), q = S(() => (i.value?.values ?? []).find((R) => R.type === "email" && (R.value ?? "") !== "")?.value ?? null), M = S(() => {
2797
- if (q.value === null) return null;
2798
- const g = encodeURIComponent(`${N.value} — ${E.value}`);
2799
- return `mailto:${q.value}?subject=${g}`;
2861
+ function x(y) {
2862
+ return be(y.title, f.active.value, y.key);
2863
+ }
2864
+ const P = U(() => l("panel.submission", { id: String(F.value) })), j = U(() => {
2865
+ const y = d.value?.form;
2866
+ return y === void 0 ? "" : be(y.title ?? {}, f.active.value, y.slug ?? "");
2867
+ }), R = U(() => (d.value?.values ?? []).find((M) => M.type === "email" && (M.value ?? "") !== "")?.value ?? null), B = U(() => {
2868
+ if (R.value === null) return null;
2869
+ const y = encodeURIComponent(`${j.value} — ${P.value}`);
2870
+ return `mailto:${R.value}?subject=${y}`;
2800
2871
  });
2801
- async function v() {
2802
- T.value = !0;
2872
+ async function r() {
2873
+ z.value = !0;
2803
2874
  try {
2804
- i.value = await f.submission(W.value, c.value);
2805
- } catch (g) {
2806
- P.danger(p(g)), d.replace($.value);
2875
+ d.value = await v.submission(F.value, m.value);
2876
+ } catch (y) {
2877
+ L.danger(p(y)), c.replace($.value);
2807
2878
  } finally {
2808
- T.value = !1;
2879
+ z.value = !1;
2809
2880
  }
2810
2881
  }
2811
- async function Y() {
2882
+ async function O() {
2812
2883
  try {
2813
- L.value = await f.statuses(), b.value && (C.value = await f.recipients());
2814
- } catch (g) {
2815
- P.danger(p(g));
2884
+ D.value = await v.statuses(), b.value && (C.value = await v.recipients());
2885
+ } catch (y) {
2886
+ L.danger(p(y));
2816
2887
  }
2817
2888
  }
2818
- Ce(W, () => {
2819
- v();
2820
- }, { immediate: !0 }), Y();
2821
- async function ye(g) {
2889
+ Te(F, () => {
2890
+ r();
2891
+ }, { immediate: !0 }), O();
2892
+ async function J(y) {
2822
2893
  try {
2823
- i.value = await f.saveSubmission(W.value, g), P.success(l("panel.saved"));
2824
- } catch (Z) {
2825
- P.danger(p(Z)), await v();
2894
+ d.value = await v.saveSubmission(F.value, y), L.success(l("panel.saved"));
2895
+ } catch (Y) {
2896
+ L.danger(p(Y)), await r();
2826
2897
  }
2827
2898
  }
2828
- function pe(g) {
2829
- typeof g == "number" && ye({ status_id: g });
2899
+ function me(y) {
2900
+ typeof y == "number" && J({ status_id: y });
2830
2901
  }
2831
- function A(g) {
2832
- ye({ assignee_id: typeof g == "number" ? g : null });
2902
+ function A(y) {
2903
+ J({ assignee_id: typeof y == "number" ? y : null });
2833
2904
  }
2834
- const Q = S(() => {
2835
- const g = [];
2836
- return M.value && g.push({
2905
+ const X = U(() => {
2906
+ const y = [];
2907
+ return B.value && y.push({
2837
2908
  key: "reply",
2838
2909
  label: l("panel.reply"),
2839
2910
  icon: "mail",
2840
2911
  primary: !0,
2841
- href: M.value,
2912
+ href: B.value,
2842
2913
  target: "_self"
2843
- }), b.value && i.value !== null && g.push(
2914
+ }), b.value && d.value !== null && y.push(
2844
2915
  {
2845
2916
  key: "unread",
2846
2917
  icon: "eye-off",
2847
2918
  label: l("panel.mark-unread"),
2848
2919
  menu: !0,
2849
2920
  run: () => {
2850
- I();
2921
+ re();
2922
+ }
2923
+ },
2924
+ {
2925
+ key: "notify",
2926
+ icon: "mail",
2927
+ label: l("panel.notify-again"),
2928
+ menu: !0,
2929
+ run: () => {
2930
+ W();
2851
2931
  }
2852
2932
  },
2853
2933
  {
@@ -2856,20 +2936,31 @@ const jl = /* @__PURE__ */ ae({
2856
2936
  label: l("panel.delete"),
2857
2937
  danger: !0,
2858
2938
  run: () => {
2859
- k();
2939
+ de();
2860
2940
  }
2861
2941
  }
2862
- ), g;
2942
+ ), y;
2863
2943
  });
2864
- async function I() {
2944
+ async function W() {
2865
2945
  try {
2866
- await f.massSubmissions({ ids: [W.value], action: "unread" }), d.push($.value);
2867
- } catch (g) {
2868
- P.danger(p(g));
2946
+ d.value = await v.notifySubmission(F.value), L.success(l("panel.notify-sent-again"));
2947
+ } catch (y) {
2948
+ L.danger(p(y));
2869
2949
  }
2870
2950
  }
2871
- async function k() {
2872
- if (await ze({
2951
+ const k = U(() => d.value?.notification ?? null);
2952
+ function g(y) {
2953
+ return l(`panel.notify-recipient-${y}`);
2954
+ }
2955
+ async function re() {
2956
+ try {
2957
+ await v.massSubmissions({ ids: [F.value], action: "unread" }), c.push($.value);
2958
+ } catch (y) {
2959
+ L.danger(p(y));
2960
+ }
2961
+ }
2962
+ async function de() {
2963
+ if (await Ce({
2873
2964
  title: l("panel.delete-submission-title"),
2874
2965
  message: l("panel.delete-submission-text"),
2875
2966
  confirmText: l("panel.delete"),
@@ -2877,96 +2968,116 @@ const jl = /* @__PURE__ */ ae({
2877
2968
  tone: "danger"
2878
2969
  }))
2879
2970
  try {
2880
- await f.removeSubmission(W.value), P.success(l("panel.deleted")), d.push($.value);
2881
- } catch (Z) {
2882
- P.danger(p(Z));
2971
+ await v.removeSubmission(F.value), L.success(l("panel.deleted")), c.push($.value);
2972
+ } catch (Y) {
2973
+ L.danger(p(Y));
2883
2974
  }
2884
2975
  }
2885
- function y(g) {
2886
- g !== null && d.push({ path: `${s.base}/submissions/${g}`, query: { ...n.query } });
2976
+ function Ne(y) {
2977
+ y !== null && c.push({ path: `${s.base}/submissions/${y}`, query: { ...n.query } });
2887
2978
  }
2888
- function ue(g) {
2889
- const Z = L.value.find((R) => R.key === g);
2890
- return Z === void 0 ? g : _(Z);
2979
+ function ke(y) {
2980
+ const Y = D.value.find((M) => M.key === y);
2981
+ return Y === void 0 ? y : x(Y);
2891
2982
  }
2892
- function re(g) {
2893
- switch (g.type) {
2983
+ const Ye = U(
2984
+ () => d.value?.events?.some((y) => y.type === "no_recipients") ?? !1
2985
+ );
2986
+ function Ze(y) {
2987
+ switch (y.type) {
2894
2988
  case "created":
2895
2989
  return l("panel.event-created");
2896
2990
  case "status":
2897
- return l("panel.event-status", { to: ue(g.to ?? "") });
2991
+ return l("panel.event-status", { to: ke(y.to ?? "") });
2898
2992
  case "assignee":
2899
- return g.to === null || g.to === "" ? l("panel.event-unassigned") : l("panel.event-assignee", { to: g.to });
2993
+ return y.to === null || y.to === "" ? l("panel.event-unassigned") : l("panel.event-assignee", { to: y.to });
2900
2994
  case "note":
2901
2995
  return l("panel.event-note");
2902
2996
  case "notified":
2903
2997
  return l("panel.event-notified");
2998
+ // A handler of `webx-inbox.handlers`: `from` is its class, shown by its own short name.
2999
+ case "handled":
3000
+ return l("panel.event-handled", { name: Ie(y.from) });
3001
+ case "handler_error":
3002
+ return l("panel.event-handler-error", {
3003
+ name: Ie(y.from),
3004
+ error: y.to ?? ""
3005
+ });
3006
+ case "no_recipients":
3007
+ return l("panel.event-no-recipients");
3008
+ case "notify_queued":
3009
+ return l("panel.event-notify-queued");
3010
+ case "notify_failed":
3011
+ return l("panel.event-notify-failed", { to: y.to ?? "" });
2904
3012
  default:
2905
- return g.type;
3013
+ return y.type;
2906
3014
  }
2907
3015
  }
2908
- function Ge(g) {
2909
- return `${Math.max(1, Math.round(g / 1024))} KB`;
2910
- }
2911
- const _e = S(() => {
2912
- const g = i.value?.meta ?? {}, Z = [];
2913
- typeof g.page == "string" && g.page !== "" && Z.push({ label: l("panel.meta-page"), value: g.page, link: !0 });
2914
- const R = i.value?.placement;
2915
- typeof R == "string" && R !== "" && Z.push({ label: l("panel.meta-placement"), value: R }), typeof g.referrer == "string" && g.referrer !== "" && Z.push({ label: l("panel.meta-referrer"), value: g.referrer, link: !0 });
2916
- for (const [Ae, je] of Object.entries(g.utm ?? {}))
2917
- Z.push({ label: Ae, value: String(je) });
2918
- return typeof g.locale == "string" && g.locale !== "" && Z.push({ label: l("panel.meta-locale"), value: g.locale }), typeof g.ip == "string" && g.ip !== "" && Z.push({ label: l("panel.meta-ip"), value: g.ip }), typeof g.user_agent == "string" && g.user_agent !== "" && Z.push({ label: l("panel.meta-agent"), value: g.user_agent }), Z;
3016
+ function Ie(y) {
3017
+ return (y ?? "").split("\\").pop() ?? "";
3018
+ }
3019
+ function De(y) {
3020
+ return `${Math.max(1, Math.round(y / 1024))} KB`;
3021
+ }
3022
+ const Qe = U(() => {
3023
+ const y = d.value?.meta ?? {}, Y = [];
3024
+ typeof y.page == "string" && y.page !== "" && Y.push({ label: l("panel.meta-page"), value: y.page, link: !0 });
3025
+ const M = d.value?.placement;
3026
+ typeof M == "string" && M !== "" && Y.push({ label: l("panel.meta-placement"), value: M }), typeof y.referrer == "string" && y.referrer !== "" && Y.push({ label: l("panel.meta-referrer"), value: y.referrer, link: !0 });
3027
+ for (const [Je, Xe] of Object.entries(y.utm ?? {}))
3028
+ Y.push({ label: Je, value: String(Xe) });
3029
+ return typeof y.locale == "string" && y.locale !== "" && Y.push({ label: l("panel.meta-locale"), value: y.locale }), typeof y.ip == "string" && y.ip !== "" && Y.push({ label: l("panel.meta-ip"), value: y.ip }), typeof y.user_agent == "string" && y.user_agent !== "" && Y.push({ label: l("panel.meta-agent"), value: y.user_agent }), Y;
2919
3030
  });
2920
- return (g, Z) => (u(), j("div", Tt, [
2921
- t(e(Qe), {
2922
- title: E.value,
2923
- subtitle: N.value,
3031
+ return (y, Y) => (o(), G("div", Nt, [
3032
+ t(e(tl), {
3033
+ title: P.value,
3034
+ subtitle: j.value,
2924
3035
  back: $.value,
2925
- actions: Q.value
3036
+ actions: X.value
2926
3037
  }, {
2927
3038
  extra: a(() => [
2928
- t(e(Ve), {
3039
+ t(e($e), {
2929
3040
  icon: "chevron-left",
2930
3041
  size: "lg",
2931
3042
  title: e(l)("panel.previous"),
2932
- disabled: !i.value?.previous_id,
2933
- onClick: Z[0] || (Z[0] = (R) => y(i.value?.previous_id ?? null))
3043
+ disabled: !d.value?.previous_id,
3044
+ onClick: Y[0] || (Y[0] = (M) => Ne(d.value?.previous_id ?? null))
2934
3045
  }, null, 8, ["title", "disabled"]),
2935
- t(e(Ve), {
3046
+ t(e($e), {
2936
3047
  icon: "chevron-right",
2937
3048
  size: "lg",
2938
3049
  title: e(l)("panel.next"),
2939
- disabled: !i.value?.next_id,
2940
- onClick: Z[1] || (Z[1] = (R) => y(i.value?.next_id ?? null))
3050
+ disabled: !d.value?.next_id,
3051
+ onClick: Y[1] || (Y[1] = (M) => Ne(d.value?.next_id ?? null))
2941
3052
  }, null, 8, ["title", "disabled"])
2942
3053
  ]),
2943
3054
  _: 1
2944
3055
  }, 8, ["title", "subtitle", "back", "actions"]),
2945
- T.value ? (u(), w(e(We), {
3056
+ z.value ? (o(), w(e(We), {
2946
3057
  key: 0,
2947
3058
  rows: 6
2948
- })) : i.value ? (u(), j("div", Ft, [
2949
- G("div", Wt, [
2950
- t(e(se), {
3059
+ })) : d.value ? (o(), G("div", It, [
3060
+ K("div", Dt, [
3061
+ t(e(oe), {
2951
3062
  title: e(l)("panel.answers")
2952
3063
  }, {
2953
3064
  default: a(() => [
2954
- i.value.values.length === 0 ? (u(), w(e(He), {
3065
+ d.value.values.length === 0 ? (o(), w(e(Ke), {
2955
3066
  key: 0,
2956
3067
  size: "sm",
2957
3068
  description: e(l)("panel.no-answers")
2958
- }, null, 8, ["description"])) : (u(), w(e(sl), {
3069
+ }, null, 8, ["description"])) : (o(), w(e(rl), {
2959
3070
  key: 1,
2960
3071
  columns: 1,
2961
3072
  layout: "vertical"
2962
3073
  }, {
2963
3074
  default: a(() => [
2964
- (u(!0), j(ee, null, ke(i.value.values, (R) => (u(), w(e(Ie), {
2965
- key: R.id,
2966
- label: R.label ?? R.name
3075
+ (o(!0), G(ee, null, ge(d.value.values, (M) => (o(), w(e(Me), {
3076
+ key: M.id,
3077
+ label: M.label ?? M.name
2967
3078
  }, {
2968
3079
  default: a(() => [
2969
- G("p", qt, V(R.value || "—"), 1)
3080
+ K("p", Mt, V(M.value || "—"), 1)
2970
3081
  ]),
2971
3082
  _: 2
2972
3083
  }, 1032, ["label"]))), 128))
@@ -2976,84 +3087,84 @@ const jl = /* @__PURE__ */ ae({
2976
3087
  ]),
2977
3088
  _: 1
2978
3089
  }, 8, ["title"]),
2979
- i.value.files.length > 0 ? (u(), w(e(se), {
3090
+ d.value.files.length > 0 ? (o(), w(e(oe), {
2980
3091
  key: 0,
2981
3092
  title: e(l)("panel.attachments")
2982
3093
  }, {
2983
3094
  default: a(() => [
2984
- G("div", At, [
2985
- (u(!0), j(ee, null, ke(i.value.files, (R) => (u(), w(e(Tl), {
2986
- key: R.id,
2987
- name: R.name,
2988
- type: R.mime ?? void 0,
2989
- "download-url": R.url,
3095
+ K("div", Lt, [
3096
+ (o(!0), G(ee, null, ge(d.value.files, (M) => (o(), w(e(Fl), {
3097
+ key: M.id,
3098
+ name: M.name,
3099
+ type: M.mime ?? void 0,
3100
+ "download-url": M.url,
2990
3101
  "download-label": e(l)("panel.download"),
2991
3102
  size: "sm"
2992
3103
  }, {
2993
3104
  meta: a(() => [
2994
- z(V(Ge(R.size)), 1)
3105
+ S(V(De(M.size)), 1)
2995
3106
  ]),
2996
3107
  _: 2
2997
3108
  }, 1032, ["name", "type", "download-url", "download-label"]))), 128))
2998
3109
  ])
2999
3110
  ]),
3000
3111
  _: 1
3001
- }, 8, ["title"])) : H("", !0),
3002
- t(e(se), { class: "wx-submission__more" }, {
3112
+ }, 8, ["title"])) : E("", !0),
3113
+ t(e(oe), { class: "wx-submission__more" }, {
3003
3114
  default: a(() => [
3004
- t(e(Xe), {
3115
+ t(e(nl), {
3005
3116
  variant: "pill",
3006
- "aria-label": E.value
3117
+ "aria-label": P.value
3007
3118
  }, {
3008
3119
  default: a(() => [
3009
- t(e(ge), {
3120
+ t(e(xe), {
3010
3121
  value: "notes",
3011
- label: e(U)("notes.title")
3122
+ label: e(T)("notes.title")
3012
3123
  }, {
3013
3124
  default: a(() => [
3014
- t(e(gl), {
3015
- id: i.value.id,
3125
+ t(e(_l), {
3126
+ id: d.value.id,
3016
3127
  type: "inbox_submission",
3017
3128
  title: "",
3018
3129
  can: b.value,
3019
- onChange: v
3130
+ onChange: r
3020
3131
  }, null, 8, ["id", "can"])
3021
3132
  ]),
3022
3133
  _: 1
3023
3134
  }, 8, ["label"]),
3024
- t(e(ge), {
3135
+ t(e(xe), {
3025
3136
  value: "log",
3026
3137
  label: e(l)("panel.log")
3027
3138
  }, {
3028
3139
  default: a(() => [
3029
- t(e(Fl), { size: "sm" }, {
3140
+ t(e(Wl), { size: "sm" }, {
3030
3141
  default: a(() => [
3031
- (u(!0), j(ee, null, ke(i.value.events, (R) => (u(), w(e(Wl), {
3032
- key: R.id
3142
+ (o(!0), G(ee, null, ge(d.value.events, (M) => (o(), w(e(Al), {
3143
+ key: M.id
3033
3144
  }, {
3034
3145
  default: a(() => [
3035
- t(e(J), {
3146
+ t(e(Q), {
3036
3147
  size: "sm",
3037
3148
  as: "p",
3038
3149
  class: "wx-submission__event"
3039
3150
  }, {
3040
3151
  default: a(() => [
3041
- z(V(re(R)), 1)
3152
+ S(V(Ze(M)), 1)
3042
3153
  ]),
3043
3154
  _: 2
3044
3155
  }, 1024),
3045
- G("p", It, [
3046
- t(e(J), {
3156
+ K("p", Ot, [
3157
+ t(e(Q), {
3047
3158
  size: "sm",
3048
3159
  tone: "muted"
3049
3160
  }, {
3050
3161
  default: a(() => [
3051
- z(V(R.author?.name ?? e(l)("panel.system")), 1)
3162
+ S(V(M.author?.name ?? e(l)("panel.system")), 1)
3052
3163
  ]),
3053
3164
  _: 2
3054
3165
  }, 1024),
3055
- t(e(De), {
3056
- value: R.created_at
3166
+ t(e(Ee), {
3167
+ value: M.created_at
3057
3168
  }, null, 8, ["value"])
3058
3169
  ])
3059
3170
  ]),
@@ -3065,89 +3176,139 @@ const jl = /* @__PURE__ */ ae({
3065
3176
  ]),
3066
3177
  _: 1
3067
3178
  }, 8, ["label"]),
3068
- t(e(ge), {
3179
+ t(e(xe), {
3069
3180
  value: "details",
3070
3181
  label: e(l)("panel.details")
3071
3182
  }, {
3072
3183
  default: a(() => [
3073
- G("div", Nt, [
3074
- t(e(sl), {
3184
+ K("div", Et, [
3185
+ t(e(rl), {
3075
3186
  columns: 1,
3076
3187
  layout: "vertical",
3077
3188
  size: "sm"
3078
3189
  }, {
3079
3190
  default: a(() => [
3080
- t(e(Ie), {
3191
+ t(e(Me), {
3081
3192
  label: e(l)("panel.received")
3082
3193
  }, {
3083
3194
  default: a(() => [
3084
- t(e(De), {
3085
- value: i.value.created_at,
3195
+ t(e(Ee), {
3196
+ value: d.value.created_at,
3086
3197
  tone: "default"
3087
3198
  }, null, 8, ["value"])
3088
3199
  ]),
3089
3200
  _: 1
3090
3201
  }, 8, ["label"]),
3091
- t(e(Ie), {
3202
+ t(e(Me), {
3092
3203
  label: e(l)("panel.meta-source")
3093
3204
  }, {
3094
3205
  default: a(() => [
3095
- t(e(Se), {
3096
- type: i.value.source === "panel" ? "info" : "default"
3206
+ t(e(Ue), {
3207
+ type: d.value.source === "panel" ? "info" : "default"
3097
3208
  }, {
3098
3209
  default: a(() => [
3099
- z(V(i.value.source === "panel" ? e(l)("panel.source-panel") : e(l)("panel.source-web")), 1)
3210
+ S(V(d.value.source === "panel" ? e(l)("panel.source-panel") : e(l)("panel.source-web")), 1)
3100
3211
  ]),
3101
3212
  _: 1
3102
3213
  }, 8, ["type"])
3103
3214
  ]),
3104
3215
  _: 1
3105
3216
  }, 8, ["label"]),
3106
- (u(!0), j(ee, null, ke(_e.value, (R) => (u(), w(e(Ie), {
3107
- key: R.label,
3108
- label: R.label
3217
+ (o(!0), G(ee, null, ge(Qe.value, (M) => (o(), w(e(Me), {
3218
+ key: M.label,
3219
+ label: M.label
3109
3220
  }, {
3110
3221
  default: a(() => [
3111
- R.link ? (u(), j("a", {
3222
+ M.link ? (o(), G("a", {
3112
3223
  key: 0,
3113
- href: R.value,
3224
+ href: M.value,
3114
3225
  target: "_blank",
3115
3226
  rel: "noreferrer"
3116
- }, V(R.value), 9, Dt)) : (u(), j("span", Mt, V(R.value), 1))
3227
+ }, V(M.value), 9, Pt)) : (o(), G("span", Rt, V(M.value), 1))
3117
3228
  ]),
3118
3229
  _: 2
3119
3230
  }, 1032, ["label"]))), 128))
3120
3231
  ]),
3121
3232
  _: 1
3122
3233
  }),
3123
- i.value.notify_error ? (u(), w(e(Me), {
3234
+ k.value?.state === "failed" ? (o(), w(e(Fe), {
3124
3235
  key: 0,
3125
3236
  type: "warning",
3126
- closable: !1
3237
+ closable: !1,
3238
+ title: e(l)("panel.notify-failed")
3127
3239
  }, {
3128
3240
  default: a(() => [
3129
- z(V(e(l)("panel.notify-failed")), 1)
3241
+ K("span", Bt, V(k.value.error), 1)
3130
3242
  ]),
3131
3243
  _: 1
3132
- })) : i.value.notified_at ? (u(), w(e(J), {
3244
+ }, 8, ["title"])) : k.value?.state === "queued" ? (o(), w(e(Q), {
3133
3245
  key: 1,
3134
3246
  size: "sm",
3135
3247
  tone: "muted"
3136
3248
  }, {
3137
3249
  default: a(() => [
3138
- z(V(e(l)("panel.notified")), 1)
3250
+ S(V(e(l)("panel.notify-queued")), 1)
3139
3251
  ]),
3140
3252
  _: 1
3141
- })) : (u(), w(e(J), {
3253
+ })) : k.value?.state === "delivered" ? (o(), w(e(Q), {
3142
3254
  key: 2,
3143
3255
  size: "sm",
3144
3256
  tone: "muted"
3145
3257
  }, {
3146
3258
  default: a(() => [
3147
- z(V(e(l)("panel.not-notified")), 1)
3259
+ S(V(e(l)("panel.notified")), 1)
3260
+ ]),
3261
+ _: 1
3262
+ })) : Ye.value ? (o(), w(e(Q), {
3263
+ key: 3,
3264
+ size: "sm",
3265
+ tone: "muted"
3266
+ }, {
3267
+ default: a(() => [
3268
+ S(V(e(l)("panel.notified-nobody")), 1)
3148
3269
  ]),
3149
3270
  _: 1
3150
- }))
3271
+ })) : (o(), w(e(Q), {
3272
+ key: 4,
3273
+ size: "sm",
3274
+ tone: "muted"
3275
+ }, {
3276
+ default: a(() => [
3277
+ S(V(e(l)("panel.not-notified")), 1)
3278
+ ]),
3279
+ _: 1
3280
+ })),
3281
+ k.value && k.value.recipients.length > 0 ? (o(), G("ul", Ht, [
3282
+ (o(!0), G(ee, null, ge(k.value.recipients, (M) => (o(), G("li", {
3283
+ key: M.address
3284
+ }, [
3285
+ t(e(Q), { size: "sm" }, {
3286
+ default: a(() => [
3287
+ S(V(M.address), 1)
3288
+ ]),
3289
+ _: 2
3290
+ }, 1024),
3291
+ t(e(Ue), {
3292
+ type: M.state === "failed" ? "danger" : M.state === "delivered" ? "success" : "default"
3293
+ }, {
3294
+ default: a(() => [
3295
+ S(V(g(M.state)), 1)
3296
+ ]),
3297
+ _: 2
3298
+ }, 1032, ["type"])
3299
+ ]))), 128))
3300
+ ])) : E("", !0),
3301
+ b.value && (k.value?.state === "failed" || k.value?.state === "queued") ? (o(), G("div", Gt, [
3302
+ t(e(te), {
3303
+ size: "sm",
3304
+ onClick: W
3305
+ }, {
3306
+ default: a(() => [
3307
+ S(V(e(l)("panel.notify-again")), 1)
3308
+ ]),
3309
+ _: 1
3310
+ })
3311
+ ])) : E("", !0)
3151
3312
  ])
3152
3313
  ]),
3153
3314
  _: 1
@@ -3159,40 +3320,40 @@ const jl = /* @__PURE__ */ ae({
3159
3320
  _: 1
3160
3321
  })
3161
3322
  ]),
3162
- G("aside", Lt, [
3163
- t(e(se), null, {
3323
+ K("aside", jt, [
3324
+ t(e(oe), null, {
3164
3325
  default: a(() => [
3165
- G("div", Ot, [
3166
- G("label", Pt, [
3167
- t(e(J), {
3326
+ K("div", Kt, [
3327
+ K("label", Yt, [
3328
+ t(e(Q), {
3168
3329
  size: "sm",
3169
3330
  tone: "muted"
3170
3331
  }, {
3171
3332
  default: a(() => [
3172
- z(V(e(l)("panel.status")), 1)
3333
+ S(V(e(l)("panel.status")), 1)
3173
3334
  ]),
3174
3335
  _: 1
3175
3336
  }),
3176
- t(e(ve), {
3177
- "model-value": i.value.status?.id ?? null,
3337
+ t(e(fe), {
3338
+ "model-value": d.value.status?.id ?? null,
3178
3339
  options: h.value,
3179
3340
  disabled: !b.value,
3180
- "onUpdate:modelValue": pe
3341
+ "onUpdate:modelValue": me
3181
3342
  }, null, 8, ["model-value", "options", "disabled"])
3182
3343
  ]),
3183
- G("label", Et, [
3184
- t(e(J), {
3344
+ K("label", Zt, [
3345
+ t(e(Q), {
3185
3346
  size: "sm",
3186
3347
  tone: "muted"
3187
3348
  }, {
3188
3349
  default: a(() => [
3189
- z(V(e(l)("panel.assignee")), 1)
3350
+ S(V(e(l)("panel.assignee")), 1)
3190
3351
  ]),
3191
3352
  _: 1
3192
3353
  }),
3193
- t(e(ve), {
3194
- "model-value": i.value.assignee?.id ?? null,
3195
- options: O.value,
3354
+ t(e(fe), {
3355
+ "model-value": d.value.assignee?.id ?? null,
3356
+ options: I.value,
3196
3357
  disabled: !b.value,
3197
3358
  clearable: "",
3198
3359
  placeholder: e(l)("panel.unassigned"),
@@ -3204,30 +3365,30 @@ const jl = /* @__PURE__ */ ae({
3204
3365
  _: 1
3205
3366
  })
3206
3367
  ])
3207
- ])) : H("", !0)
3368
+ ])) : E("", !0)
3208
3369
  ]));
3209
3370
  }
3210
- }), Bt = /* @__PURE__ */ ie(Rt, [["__scopeId", "data-v-4ef3ff2d"]]);
3211
- function Yt(r = {}) {
3212
- const s = r.path ?? "/inbox";
3371
+ }), Jt = /* @__PURE__ */ ue(Qt, [["__scopeId", "data-v-3d8c60d4"]]);
3372
+ function aa(i = {}) {
3373
+ const s = i.path ?? "/inbox";
3213
3374
  return {
3214
3375
  id: "inbox",
3215
3376
  path: s,
3216
- landing: r.landing ?? !0,
3377
+ landing: i.landing ?? !0,
3217
3378
  routes: [
3218
3379
  // The section's own path travels as a prop, so a panel that mounted it somewhere else
3219
3380
  // still links between its screens correctly.
3220
- { path: s, name: "webx.inbox", component: _t, props: { base: s } },
3381
+ { path: s, name: "webx.inbox", component: Ut, props: { base: s } },
3221
3382
  {
3222
3383
  path: `${s}/statuses`,
3223
3384
  name: "webx.inbox.statuses",
3224
- component: zt,
3385
+ component: At,
3225
3386
  props: { base: s }
3226
3387
  },
3227
3388
  {
3228
3389
  path: `${s}/forms/:id(\\d+)`,
3229
3390
  name: "webx.inbox.form",
3230
- component: it,
3391
+ component: pt,
3231
3392
  props: { base: s }
3232
3393
  },
3233
3394
  // A submission has an address of its own, not a dialog over the list (§11): it goes in
@@ -3235,24 +3396,24 @@ function Yt(r = {}) {
3235
3396
  {
3236
3397
  path: `${s}/submissions/:id(\\d+)`,
3237
3398
  name: "webx.inbox.submission",
3238
- component: Bt,
3399
+ component: Jt,
3239
3400
  props: { base: s }
3240
3401
  }
3241
3402
  ]
3242
3403
  };
3243
3404
  }
3244
3405
  export {
3245
- Al as FIELD_TYPES,
3246
- Il as STATUS_COLORS,
3247
- Gl as WxInboxFieldList,
3248
- it as WxInboxFormEditor,
3249
- _t as WxInboxPage,
3250
- zt as WxInboxStatusesPage,
3251
- yt as WxInboxSubmissionList,
3252
- Bt as WxInboxSubmissionPage,
3253
- de as createInboxApi,
3254
- Yt as inbox,
3255
- ql as inboxMessages,
3256
- me as option
3406
+ Il as FIELD_TYPES,
3407
+ Dl as STATUS_COLORS,
3408
+ Kl as WxInboxFieldList,
3409
+ pt as WxInboxFormEditor,
3410
+ Ut as WxInboxPage,
3411
+ At as WxInboxStatusesPage,
3412
+ kt as WxInboxSubmissionList,
3413
+ Jt as WxInboxSubmissionPage,
3414
+ ce as createInboxApi,
3415
+ aa as inbox,
3416
+ Nl as inboxMessages,
3417
+ ve as option
3257
3418
  };
3258
3419
  //# sourceMappingURL=index.js.map