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