@webx-ui/module-inbox 0.6.0 → 0.6.2

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