@webx-ui/module-inbox 0.9.0 → 0.10.0

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.
@@ -1,8 +1,8 @@
1
- import { inject as Qe, defineComponent as ne, useModel as We, computed as T, ref as C, watch as ve, openBlock as m, createElementBlock as D, createElementVNode as G, toDisplayString as I, createCommentVNode as N, createBlock as w, unref as e, withCtx as d, createTextVNode as E, createVNode as i, mergeModels as Fe, nextTick as Je, isRef as Be, Fragment as Q, renderList as Pe, useTemplateRef as et, createSlots as Oe, defineAsyncComponent as xe } from "vue";
2
- import { useLocales as se, localizedValue as de, WxBadge as be, WxAction as Me, WxAutocomplete as tt, useModal as De, WxDialog as Le, WxAlert as Ce, WxSkeleton as lt, WxFormItem as M, WxTextarea as at, WxSelect as ye, WxRadioGroup as nt, WxCheckboxGroup as st, WxCheckbox as le, WxDatePicker as Ne, WxInput as Z, WxSpace as He, WxButton as te, toast as Y, useElementWidth as ot, createModal as Xe, WxTabs as it, WxTable as ut, WxEntityCard as rt, WxAvatar as Ee, WxIcon as ge, WxTooltip as dt, WxText as ee, confirm as Ge, WxLocales as ct, WxRichText as qe, WxInputNumber as re, WxTagsInput as mt, WxCard as pt, WxEmpty as ft, WxSortableList as ht } from "@webx-ui/core";
3
- import { useAdmin as oe, i18nKey as vt, useTranslate as ae, createRelationsApi as bt, useErrorText as we, rowMenuWidth as yt, WxScreenHead as gt, WxRowMenu as Ue, WxDate as ze, WxFilterChips as xt, slugify as wt } from "@webx-ui/module-admin";
4
- import { useRoute as kt, useRouter as _t } from "vue-router";
5
- const Vt = {
1
+ import { inject as Qe, defineComponent as oe, useModel as Fe, computed as A, ref as U, watch as ge, openBlock as m, createElementBlock as M, createElementVNode as G, toDisplayString as I, createCommentVNode as W, createBlock as _, unref as e, withCtx as d, createTextVNode as z, createVNode as u, mergeModels as Ie, nextTick as Je, isRef as Pe, Fragment as Z, renderList as Oe, useTemplateRef as et, createSlots as De, mergeProps as tt, defineAsyncComponent as _e } from "vue";
2
+ import { useLocales as ie, localizedValue as pe, WxBadge as xe, WxAction as Le, WxAutocomplete as lt, useModal as Me, WxDialog as He, WxAlert as Ne, WxSkeleton as at, WxFormItem as D, WxTextarea as nt, WxSelect as we, WxRadioGroup as st, WxCheckboxGroup as ot, WxCheckbox as se, WxDatePicker as Ue, WxInput as K, WxSpace as Xe, WxButton as te, toast as j, useElementWidth as it, createModal as Ge, WxTabs as rt, WxTable as ut, WxEntityCard as dt, WxAvatar as qe, WxIcon as ke, WxTooltip as ct, WxText as ee, confirm as Ye, WxLocales as mt, WxRichText as ze, WxInputNumber as me, WxTagsInput as pt, WxCard as ht, WxEmpty as ft, WxSortableList as vt } from "@webx-ui/core";
3
+ import { useAdmin as re, i18nKey as bt, useTranslate as le, createRelationsApi as yt, useErrorText as Ve, rowMenuWidth as gt, WxScreenHead as xt, WxRowMenu as We, WxDate as Re, WxFilterChips as wt, useRichTextLabels as kt, useShortcodesWhen as _t, useRemoveConfirm as Vt, slugify as Tt } from "@webx-ui/module-admin";
4
+ import { useRoute as $t, useRouter as St } from "vue-router";
5
+ const At = {
6
6
  module: {
7
7
  title: "Inbox"
8
8
  },
@@ -29,6 +29,8 @@ const Vt = {
29
29
  reorder: "Reorder",
30
30
  "new-form-title": "New form",
31
31
  title: "Title",
32
+ description: "Description",
33
+ "description-help": "A line under the title of the form on the site and in a dialog. Empty — nothing is shown.",
32
34
  slug: "Address",
33
35
  "slug-help": "What the form is called on the site and where it posts.",
34
36
  "is-enabled": "Active",
@@ -257,34 +259,34 @@ const Vt = {
257
259
  unknown: "The Inbox has no form “:slug”. It has: :forms.",
258
260
  "unknown-none": "The Inbox has no form “:slug” — it has no forms yet."
259
261
  }
260
- }, Re = /* @__PURE__ */ new WeakSet();
261
- function ce() {
262
+ }, Be = /* @__PURE__ */ new WeakSet();
263
+ function he() {
262
264
  try {
263
- const { i18n: a } = oe();
264
- Re.has(a) || (a.defaults("webx-inbox", Vt), Re.add(a));
265
+ const { i18n: a } = re();
266
+ Be.has(a) || (a.defaults("webx-inbox", At), Be.add(a));
265
267
  } catch {
266
268
  }
267
269
  }
268
- function Tt() {
269
- const a = Qe(vt, null), n = se();
270
+ function Ct() {
271
+ const a = Qe(bt, null), n = ie();
270
272
  return (c) => {
271
- const y = a?.state.locale;
272
- return (y === void 0 ? void 0 : c.title[y]) || de(c.title, n.active.value, c.key);
273
+ const b = a?.state.locale;
274
+ return (b === void 0 ? void 0 : c.title[b]) || pe(c.title, n.active.value, c.key);
273
275
  };
274
276
  }
275
- const $t = { class: "wx-inbox-form-field" }, St = {
277
+ const Nt = { class: "wx-inbox-form-field" }, Ut = {
276
278
  key: 0,
277
279
  class: "wx-inbox-form-field__chosen"
278
- }, At = { class: "wx-inbox-form-field__text" }, Ct = { class: "wx-inbox-form-field__title" }, Nt = {
280
+ }, Wt = { class: "wx-inbox-form-field__text" }, Ft = { class: "wx-inbox-form-field__title" }, It = {
279
281
  key: 0,
280
282
  class: "wx-inbox-form-field__slug"
281
- }, Ut = {
283
+ }, Et = {
282
284
  key: 1,
283
285
  class: "wx-inbox-form-field__empty"
284
- }, Wt = { class: "wx-inbox-form-field__search" }, Ft = /* @__PURE__ */ ne({
286
+ }, qt = { class: "wx-inbox-form-field__search" }, zt = /* @__PURE__ */ oe({
285
287
  name: "WxInboxFormField",
286
288
  __name: "FormField",
287
- props: /* @__PURE__ */ Fe({
289
+ props: /* @__PURE__ */ Ie({
288
290
  disabled: { type: Boolean, default: !1 },
289
291
  placeholder: { default: void 0 },
290
292
  emptyText: { default: void 0 }
@@ -294,105 +296,105 @@ const $t = { class: "wx-inbox-form-field" }, St = {
294
296
  }),
295
297
  emits: ["update:modelValue"],
296
298
  setup(a) {
297
- const n = a, c = We(a, "modelValue");
298
- ce();
299
- const y = oe(), b = ae("webx-inbox"), B = bt(y, "inbox-form"), t = T(() => typeof c.value == "string" ? c.value.trim() : ""), l = C(/* @__PURE__ */ new Map()), g = C(/* @__PURE__ */ new Set()), q = C([]), z = C(!1), $ = C("");
300
- function S(k) {
301
- const x = new Map(l.value);
302
- for (const _ of k) _.slug && x.set(_.slug, _);
303
- l.value = x;
299
+ const n = a, c = Fe(a, "modelValue");
300
+ he();
301
+ const b = re(), w = le("webx-inbox"), B = yt(b, "inbox-form"), t = A(() => typeof c.value == "string" ? c.value.trim() : ""), l = U(/* @__PURE__ */ new Map()), g = U(/* @__PURE__ */ new Set()), S = U([]), N = U(!1), C = U("");
302
+ function q(V) {
303
+ const v = new Map(l.value);
304
+ for (const T of V) T.slug && v.set(T.slug, T);
305
+ l.value = v;
304
306
  }
305
- async function A(k) {
306
- if (!(k === "" || l.value.has(k) || g.value.has(k)))
307
+ async function x(V) {
308
+ if (!(V === "" || l.value.has(V) || g.value.has(V)))
307
309
  try {
308
- const x = await B.search(k);
309
- S(x), x.some((_) => _.slug === k) || (g.value = /* @__PURE__ */ new Set([...g.value, k]));
310
+ const v = await B.search(V);
311
+ q(v), v.some((T) => T.slug === V) || (g.value = /* @__PURE__ */ new Set([...g.value, V]));
310
312
  } catch {
311
313
  }
312
314
  }
313
- ve(t, (k) => {
314
- A(k);
315
+ ge(t, (V) => {
316
+ x(V);
315
317
  }, { immediate: !0 });
316
- const v = T(() => t.value === "" ? null : l.value.get(t.value) ?? null), L = T(() => t.value === "" ? null : v.value === null ? g.value.has(t.value) ? b("relations.field-missing") : null : v.value.visible ? null : b("relations.field-off")), p = T(
317
- () => q.value.filter((k) => k.slug && k.slug !== t.value).map((k) => ({
318
- value: k.title,
319
- description: [k.slug, k.visible ? null : b("relations.field-off")].filter((x) => typeof x == "string" && x !== "").join(" · "),
320
- id: k.slug
318
+ const p = A(() => t.value === "" ? null : l.value.get(t.value) ?? null), H = A(() => t.value === "" ? null : p.value === null ? g.value.has(t.value) ? w("relations.field-missing") : null : p.value.visible ? null : w("relations.field-off")), k = A(
319
+ () => S.value.filter((V) => V.slug && V.slug !== t.value).map((V) => ({
320
+ value: V.title,
321
+ description: [V.slug, V.visible ? null : w("relations.field-off")].filter((v) => typeof v == "string" && v !== "").join(" · "),
322
+ id: V.slug
321
323
  }))
322
324
  );
323
- async function U(k) {
324
- z.value = !0;
325
+ async function y(V) {
326
+ N.value = !0;
325
327
  try {
326
- const x = await B.search(k);
327
- q.value = x, S(x);
328
+ const v = await B.search(V);
329
+ S.value = v, q(v);
328
330
  } catch {
329
- q.value = [];
331
+ S.value = [];
330
332
  } finally {
331
- z.value = !1;
333
+ N.value = !1;
332
334
  }
333
335
  }
334
- function V() {
335
- q.value.length === 0 && !z.value && U($.value);
336
+ function $() {
337
+ S.value.length === 0 && !N.value && y(C.value);
336
338
  }
337
- function W(k) {
338
- typeof k.id != "string" || k.id === "" || (c.value = k.id, Je(() => {
339
- $.value = "";
339
+ function E(V) {
340
+ typeof V.id != "string" || V.id === "" || (c.value = V.id, Je(() => {
341
+ C.value = "";
340
342
  }));
341
343
  }
342
344
  function P() {
343
345
  c.value = null;
344
346
  }
345
- const X = T(() => n.placeholder ?? b("relations.field-search"));
346
- return (k, x) => (m(), D("div", $t, [
347
- t.value !== "" ? (m(), D("div", St, [
348
- G("span", At, [
349
- G("span", Ct, I(v.value?.title ?? t.value), 1),
350
- v.value ? (m(), D("span", Nt, I(t.value), 1)) : N("", !0)
347
+ const X = A(() => n.placeholder ?? w("relations.field-search"));
348
+ return (V, v) => (m(), M("div", Nt, [
349
+ t.value !== "" ? (m(), M("div", Ut, [
350
+ G("span", Wt, [
351
+ G("span", Ft, I(p.value?.title ?? t.value), 1),
352
+ p.value ? (m(), M("span", It, I(t.value), 1)) : W("", !0)
351
353
  ]),
352
- L.value ? (m(), w(e(be), {
354
+ H.value ? (m(), _(e(xe), {
353
355
  key: 0,
354
356
  type: "warning"
355
357
  }, {
356
358
  default: d(() => [
357
- E(I(L.value), 1)
359
+ z(I(H.value), 1)
358
360
  ]),
359
361
  _: 1
360
- })) : N("", !0),
361
- n.disabled ? N("", !0) : (m(), w(e(Me), {
362
+ })) : W("", !0),
363
+ n.disabled ? W("", !0) : (m(), _(e(Le), {
362
364
  key: 1,
363
365
  type: "remove",
364
366
  size: "sm",
365
- title: e(b)("relations.field-remove"),
367
+ title: e(w)("relations.field-remove"),
366
368
  onClick: P
367
369
  }, null, 8, ["title"]))
368
- ])) : (m(), D("p", Ut, I(n.emptyText ?? e(b)("relations.field-empty")), 1)),
369
- G("div", Wt, [
370
- i(e(tt), {
371
- modelValue: $.value,
372
- "onUpdate:modelValue": x[0] || (x[0] = (_) => $.value = _),
373
- options: p.value,
370
+ ])) : (m(), M("p", Et, I(n.emptyText ?? e(w)("relations.field-empty")), 1)),
371
+ G("div", qt, [
372
+ u(e(lt), {
373
+ modelValue: C.value,
374
+ "onUpdate:modelValue": v[0] || (v[0] = (T) => C.value = T),
375
+ options: k.value,
374
376
  remote: "",
375
377
  teleport: "",
376
- loading: z.value,
377
- "loading-text": e(b)("relations.field-searching"),
378
- "empty-text": e(b)("relations.field-nothing"),
378
+ loading: N.value,
379
+ "loading-text": e(w)("relations.field-searching"),
380
+ "empty-text": e(w)("relations.field-nothing"),
379
381
  placeholder: X.value,
380
382
  "aria-label": X.value,
381
383
  disabled: n.disabled,
382
- onSearch: U,
383
- onOpen: V,
384
- onSelect: W
384
+ onSearch: y,
385
+ onOpen: $,
386
+ onSelect: E
385
387
  }, null, 8, ["modelValue", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
386
388
  ])
387
389
  ]));
388
390
  }
389
- }), me = (a, n) => {
391
+ }), fe = (a, n) => {
390
392
  const c = a.__vccOpts || a;
391
- for (const [y, b] of n)
392
- c[y] = b;
393
+ for (const [b, w] of n)
394
+ c[b] = w;
393
395
  return c;
394
- }, It = /* @__PURE__ */ me(Ft, [["__scopeId", "data-v-91f60441"]]);
395
- function nl(a = {}) {
396
+ }, Rt = /* @__PURE__ */ fe(zt, [["__scopeId", "data-v-91f60441"]]);
397
+ function rl(a = {}) {
396
398
  const n = a.path ?? "/inbox";
397
399
  return {
398
400
  id: "inbox",
@@ -404,19 +406,19 @@ function nl(a = {}) {
404
406
  {
405
407
  path: n,
406
408
  name: "webx.inbox",
407
- component: () => import("./InboxPage-Dd_8TGGg.js"),
409
+ component: () => import("./InboxPage-PAtQ48A2.js"),
408
410
  props: { base: n }
409
411
  },
410
412
  {
411
413
  path: `${n}/statuses`,
412
414
  name: "webx.inbox.statuses",
413
- component: () => import("./StatusesPage-DKJmpZoG.js"),
415
+ component: () => import("./StatusesPage-xVeRPm4u.js"),
414
416
  props: { base: n }
415
417
  },
416
418
  {
417
419
  path: `${n}/forms/:id(\\d+)`,
418
420
  name: "webx.inbox.form",
419
- component: () => import("./FormEditorPage-HsbIZcG_.js"),
421
+ component: () => import("./FormEditorPage-CXYnpKAh.js"),
420
422
  props: { base: n }
421
423
  },
422
424
  // A submission has an address of its own, not a dialog over the list (§11): it goes in
@@ -424,48 +426,48 @@ function nl(a = {}) {
424
426
  {
425
427
  path: `${n}/submissions/:id(\\d+)`,
426
428
  name: "webx.inbox.submission",
427
- component: () => import("./SubmissionPage-BoE9jEhj.js"),
429
+ component: () => import("./SubmissionPage-DI8jAaud.js"),
428
430
  props: { base: n }
429
431
  }
430
432
  ],
431
433
  // A form of the Inbox as a field of any screen or block — the contact block's form — chosen
432
434
  // by name and kept by slug. Here and not in the panel: what it lists is this section's.
433
435
  types: {
434
- "wx-inbox-form": { component: It, kind: "field" }
436
+ "wx-inbox-form": { component: Rt, kind: "field" }
435
437
  }
436
438
  };
437
439
  }
438
- const he = /* @__PURE__ */ new WeakMap();
439
- function ke(a) {
440
- const n = `${a.apiPath}/inbox`, c = (t) => t.data, y = () => {
441
- }, b = (t) => (he.delete(a.http), t);
440
+ const ye = /* @__PURE__ */ new WeakMap();
441
+ function Te(a) {
442
+ const n = `${a.apiPath}/inbox`, c = (t) => t.data, b = () => {
443
+ }, w = (t) => (ye.delete(a.http), t);
442
444
  function B() {
443
- const t = he.get(a.http);
445
+ const t = ye.get(a.http);
444
446
  if (t !== void 0)
445
447
  return t.then((g) => [...g]);
446
448
  const l = a.http.get(`${n}/statuses`).then(c);
447
- return he.set(a.http, l), l.catch(() => he.delete(a.http)), l.then((g) => [...g]);
449
+ return ye.set(a.http, l), l.catch(() => ye.delete(a.http)), l.then((g) => [...g]);
448
450
  }
449
451
  return {
450
452
  forms: () => a.http.get(`${n}/forms`).then(c),
451
453
  form: (t) => a.http.get(`${n}/forms/${t}`).then(c),
452
454
  createForm: (t) => a.http.post(`${n}/forms`, t).then(c),
453
455
  saveForm: (t, l) => a.http.put(`${n}/forms/${t}`, l).then(c),
454
- removeForm: (t) => a.http.delete(`${n}/forms/${t}`).then(y),
456
+ removeForm: (t) => a.http.delete(`${n}/forms/${t}`).then(b),
455
457
  duplicateForm: (t) => a.http.post(`${n}/forms/${t}/duplicate`, {}).then(c),
456
- sortForms: (t) => a.http.post(`${n}/forms/sorting`, { ids: t }).then(y),
458
+ sortForms: (t) => a.http.post(`${n}/forms/sorting`, { ids: t }).then(b),
457
459
  fields: (t) => a.http.get(`${n}/forms/${t}/fields`).then(c),
458
460
  createField: (t, l) => a.http.post(`${n}/forms/${t}/fields`, l).then(c),
459
461
  saveField: (t, l) => a.http.put(`${n}/fields/${t}`, l).then(c),
460
- removeField: (t) => a.http.delete(`${n}/fields/${t}`).then(y),
461
- sortFields: (t, l) => a.http.post(`${n}/forms/${t}/fields/sorting`, { ids: l }).then(y),
462
+ removeField: (t) => a.http.delete(`${n}/fields/${t}`).then(b),
463
+ sortFields: (t, l) => a.http.post(`${n}/forms/${t}/fields/sorting`, { ids: l }).then(b),
462
464
  statuses: B,
463
- createStatus: (t) => a.http.post(`${n}/statuses`, t).then(c).then(b),
464
- saveStatus: (t, l) => a.http.put(`${n}/statuses/${t}`, l).then(c).then(b),
465
- removeStatus: (t) => a.http.delete(`${n}/statuses/${t}`).then(y).then(b),
466
- sortStatuses: (t) => a.http.post(`${n}/statuses/sorting`, { ids: t }).then(y).then(b),
465
+ createStatus: (t) => a.http.post(`${n}/statuses`, t).then(c).then(w),
466
+ saveStatus: (t, l) => a.http.put(`${n}/statuses/${t}`, l).then(c).then(w),
467
+ removeStatus: (t) => a.http.delete(`${n}/statuses/${t}`).then(b).then(w),
468
+ sortStatuses: (t) => a.http.post(`${n}/statuses/sorting`, { ids: t }).then(b).then(w),
467
469
  recipients: () => a.http.get(`${n}/recipients`).then(c),
468
- submissions: (t, l = {}) => a.http.get(`${n}/forms/${t}/submissions`, { query: Ae(l) }).then((g) => ({
470
+ submissions: (t, l = {}) => a.http.get(`${n}/forms/${t}/submissions`, { query: Ce(l) }).then((g) => ({
469
471
  ...g.meta,
470
472
  data: g.data,
471
473
  columns: g.columns,
@@ -473,22 +475,22 @@ function ke(a) {
473
475
  // Optional on the wire: a server from before placements answers without them.
474
476
  placements: g.placements ?? []
475
477
  })),
476
- submission: (t, l = {}) => a.http.get(`${n}/submissions/${t}`, { query: Ae(l) }).then(c),
478
+ submission: (t, l = {}) => a.http.get(`${n}/submissions/${t}`, { query: Ce(l) }).then(c),
477
479
  createSubmission: (t, l) => a.http.post(`${n}/forms/${t}/submissions`, { fields: l }).then(c),
478
480
  saveSubmission: (t, l) => a.http.put(`${n}/submissions/${t}`, l).then(c),
479
- removeSubmission: (t) => a.http.delete(`${n}/submissions/${t}`).then(y),
481
+ removeSubmission: (t) => a.http.delete(`${n}/submissions/${t}`).then(b),
480
482
  notifySubmission: (t) => a.http.post(`${n}/submissions/${t}/notify`).then(c),
481
483
  massSubmissions: (t) => a.http.post(`${n}/submissions/mass`, t).then(c),
482
484
  exportUrl: (t, l = {}) => {
483
485
  const g = new URLSearchParams();
484
- for (const [z, $] of Object.entries(Ae(l)))
485
- $ != null && $ !== "" && g.set(z, String($));
486
- const q = g.toString();
487
- return `${n}/forms/${t}/submissions/export${q === "" ? "" : `?${q}`}`;
486
+ for (const [N, C] of Object.entries(Ce(l)))
487
+ C != null && C !== "" && g.set(N, String(C));
488
+ const S = g.toString();
489
+ return `${n}/forms/${t}/submissions/export${S === "" ? "" : `?${S}`}`;
488
490
  }
489
491
  };
490
492
  }
491
- function Ae(a) {
493
+ function Ce(a) {
492
494
  return {
493
495
  view: a.view === void 0 || a.view === "" ? void 0 : a.view,
494
496
  search: a.search === void 0 || a.search === "" ? void 0 : a.search,
@@ -499,93 +501,93 @@ function Ae(a) {
499
501
  per_page: a.per_page
500
502
  };
501
503
  }
502
- function sl(a, n, c) {
503
- return T({
504
+ function ul(a, n, c) {
505
+ return A({
504
506
  get: () => a.value[n] ?? c,
505
- set: (y) => {
506
- const b = { ...a.value };
507
- y === "" || y === null || y === void 0 ? delete b[n] : b[n] = y, a.value = b;
507
+ set: (b) => {
508
+ const w = { ...a.value };
509
+ b === "" || b === null || b === void 0 ? delete w[n] : w[n] = b, a.value = w;
508
510
  }
509
511
  });
510
512
  }
511
- const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
513
+ const Bt = { class: "wx-inbox-by-hand" }, Pt = /* @__PURE__ */ oe({
512
514
  __name: "SubmissionCreateDialog",
513
515
  props: {
514
516
  form: {}
515
517
  },
516
518
  setup(a) {
517
- const n = a, { resolve: c, dismiss: y, open: b } = De(), B = oe(), t = ke(B), l = se();
518
- ce();
519
- const g = ae("webx-inbox"), q = we(), z = C([]), $ = C(!0), S = C(!1), A = C({}), v = C({}), L = T(() => z.value.filter((x) => x.type !== "file")), p = T(() => z.value.some((x) => x.type === "file"));
520
- function U(x) {
521
- return v.value[`fields.${x.key}`]?.[0];
519
+ const n = a, { resolve: c, dismiss: b, open: w } = Me(), B = re(), t = Te(B), l = ie();
520
+ he();
521
+ const g = le("webx-inbox"), S = Ve(), N = U([]), C = U(!0), q = U(!1), x = U({}), p = U({}), H = A(() => N.value.filter((v) => v.type !== "file")), k = A(() => N.value.some((v) => v.type === "file"));
522
+ function y(v) {
523
+ return p.value[`fields.${v.key}`]?.[0];
522
524
  }
523
- function V(x) {
524
- return de(x.title, l.active.value, x.key);
525
+ function $(v) {
526
+ return pe(v.title, l.active.value, v.key);
525
527
  }
526
- function W(x, _ = "") {
527
- return de(
528
- x,
528
+ function E(v, T = "") {
529
+ return pe(
530
+ v,
529
531
  l.active.value,
530
- _
532
+ T
531
533
  );
532
534
  }
533
- function P(x) {
534
- return (x.options.choices ?? []).map((_) => ({
535
- value: _.value,
536
- label: W(_.label, _.value)
535
+ function P(v) {
536
+ return (v.options.choices ?? []).map((T) => ({
537
+ value: T.value,
538
+ label: E(T.label, T.value)
537
539
  }));
538
540
  }
539
541
  async function X() {
540
542
  try {
541
- const x = await t.form(n.form.id);
542
- z.value = (x.fields ?? []).filter((_) => _.is_enabled);
543
- for (const _ of z.value)
544
- A.value[_.key] = _.type === "checkbox" ? [] : _.type === "consent" ? !1 : "";
545
- } catch (x) {
546
- Y.danger(q(x));
543
+ const v = await t.form(n.form.id);
544
+ N.value = (v.fields ?? []).filter((T) => T.is_enabled);
545
+ for (const T of N.value)
546
+ x.value[T.key] = T.type === "checkbox" ? [] : T.type === "consent" ? !1 : "";
547
+ } catch (v) {
548
+ j.danger(S(v));
547
549
  } finally {
548
- $.value = !1;
550
+ C.value = !1;
549
551
  }
550
552
  }
551
553
  X();
552
- async function k() {
553
- S.value = !0, v.value = {};
554
+ async function V() {
555
+ q.value = !0, p.value = {};
554
556
  try {
555
- c(await t.createSubmission(n.form.id, A.value));
556
- } catch (x) {
557
- const _ = x.body;
558
- _?.errors ? (v.value = _.errors, Y.danger(g("panel.failed"))) : Y.danger(q(x));
557
+ c(await t.createSubmission(n.form.id, x.value));
558
+ } catch (v) {
559
+ const T = v.body;
560
+ T?.errors ? (p.value = T.errors, j.danger(g("panel.failed"))) : j.danger(S(v));
559
561
  } finally {
560
- S.value = !1;
562
+ q.value = !1;
561
563
  }
562
564
  }
563
- return (x, _) => (m(), w(e(Le), {
564
- open: e(b),
565
- "onUpdate:open": _[1] || (_[1] = (u) => Be(b) ? b.value = u : null),
565
+ return (v, T) => (m(), _(e(He), {
566
+ open: e(w),
567
+ "onUpdate:open": T[1] || (T[1] = (i) => Pe(w) ? w.value = i : null),
566
568
  title: e(g)("panel.new-submission-title"),
567
569
  width: 560
568
570
  }, {
569
571
  footer: d(() => [
570
- i(e(He), { size: "sm" }, {
572
+ u(e(Xe), { size: "sm" }, {
571
573
  default: d(() => [
572
- i(e(te), {
574
+ u(e(te), {
573
575
  variant: "outline",
574
- onClick: _[0] || (_[0] = (u) => e(y)())
576
+ onClick: T[0] || (T[0] = (i) => e(b)())
575
577
  }, {
576
578
  default: d(() => [
577
- E(I(e(g)("panel.cancel")), 1)
579
+ z(I(e(g)("panel.cancel")), 1)
578
580
  ]),
579
581
  _: 1
580
582
  }),
581
- i(e(te), {
583
+ u(e(te), {
582
584
  type: "primary",
583
- loading: S.value,
584
- disabled: $.value,
585
- onClick: k
585
+ loading: q.value,
586
+ disabled: C.value,
587
+ onClick: V
586
588
  }, {
587
589
  default: d(() => [
588
- E(I(e(g)("panel.save")), 1)
590
+ z(I(e(g)("panel.save")), 1)
589
591
  ]),
590
592
  _: 1
591
593
  }, 8, ["loading", "disabled"])
@@ -594,89 +596,89 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
594
596
  })
595
597
  ]),
596
598
  default: d(() => [
597
- G("div", Et, [
598
- i(e(Ce), {
599
+ G("div", Bt, [
600
+ u(e(Ne), {
599
601
  type: "info",
600
602
  closable: !1
601
603
  }, {
602
604
  default: d(() => [
603
- E(I(e(g)("panel.new-submission-help")), 1)
605
+ z(I(e(g)("panel.new-submission-help")), 1)
604
606
  ]),
605
607
  _: 1
606
608
  }),
607
- $.value ? (m(), w(e(lt), {
609
+ C.value ? (m(), _(e(at), {
608
610
  key: 0,
609
611
  rows: 4
610
- })) : (m(), D(Q, { key: 1 }, [
611
- (m(!0), D(Q, null, Pe(L.value, (u) => (m(), w(e(M), {
612
- key: u.id,
613
- label: V(u),
614
- help: W(u.help),
615
- error: U(u),
616
- required: u.is_required
612
+ })) : (m(), M(Z, { key: 1 }, [
613
+ (m(!0), M(Z, null, Oe(H.value, (i) => (m(), _(e(D), {
614
+ key: i.id,
615
+ label: $(i),
616
+ help: E(i.help),
617
+ error: y(i),
618
+ required: i.is_required
617
619
  }, {
618
620
  default: d(() => [
619
- u.type === "textarea" ? (m(), w(e(at), {
621
+ i.type === "textarea" ? (m(), _(e(nt), {
620
622
  key: 0,
621
- modelValue: A.value[u.key],
622
- "onUpdate:modelValue": (R) => A.value[u.key] = R,
623
- rows: u.options.rows ?? 4,
624
- placeholder: W(u.placeholder)
625
- }, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : u.type === "select" ? (m(), w(e(ye), {
623
+ modelValue: x.value[i.key],
624
+ "onUpdate:modelValue": (R) => x.value[i.key] = R,
625
+ rows: i.options.rows ?? 4,
626
+ placeholder: E(i.placeholder)
627
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : i.type === "select" ? (m(), _(e(we), {
626
628
  key: 1,
627
- modelValue: A.value[u.key],
628
- "onUpdate:modelValue": (R) => A.value[u.key] = R,
629
- options: P(u),
629
+ modelValue: x.value[i.key],
630
+ "onUpdate:modelValue": (R) => x.value[i.key] = R,
631
+ options: P(i),
630
632
  clearable: "",
631
- placeholder: W(u.placeholder)
632
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : u.type === "radio" ? (m(), w(e(nt), {
633
+ placeholder: E(i.placeholder)
634
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : i.type === "radio" ? (m(), _(e(st), {
633
635
  key: 2,
634
- modelValue: A.value[u.key],
635
- "onUpdate:modelValue": (R) => A.value[u.key] = R,
636
- options: P(u)
637
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : u.type === "checkbox" ? (m(), w(e(st), {
636
+ modelValue: x.value[i.key],
637
+ "onUpdate:modelValue": (R) => x.value[i.key] = R,
638
+ options: P(i)
639
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : i.type === "checkbox" ? (m(), _(e(ot), {
638
640
  key: 3,
639
- modelValue: A.value[u.key],
640
- "onUpdate:modelValue": (R) => A.value[u.key] = R,
641
- options: P(u)
642
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : u.type === "consent" ? (m(), w(e(le), {
641
+ modelValue: x.value[i.key],
642
+ "onUpdate:modelValue": (R) => x.value[i.key] = R,
643
+ options: P(i)
644
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : i.type === "consent" ? (m(), _(e(se), {
643
645
  key: 4,
644
- modelValue: A.value[u.key],
645
- "onUpdate:modelValue": (R) => A.value[u.key] = R,
646
- label: W(u.options.text, V(u))
647
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : u.type === "date" ? (m(), w(e(Ne), {
646
+ modelValue: x.value[i.key],
647
+ "onUpdate:modelValue": (R) => x.value[i.key] = R,
648
+ label: E(i.options.text, $(i))
649
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : i.type === "date" ? (m(), _(e(Ue), {
648
650
  key: 5,
649
- modelValue: A.value[u.key],
650
- "onUpdate:modelValue": (R) => A.value[u.key] = R,
651
- placeholder: W(u.placeholder)
652
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (m(), w(e(Z), {
651
+ modelValue: x.value[i.key],
652
+ "onUpdate:modelValue": (R) => x.value[i.key] = R,
653
+ placeholder: E(i.placeholder)
654
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (m(), _(e(K), {
653
655
  key: 6,
654
- modelValue: A.value[u.key],
655
- "onUpdate:modelValue": (R) => A.value[u.key] = R,
656
- type: u.type === "email" ? "email" : u.type === "tel" ? "tel" : "text",
657
- placeholder: W(u.placeholder),
658
- maxlength: u.options.maxlength
656
+ modelValue: x.value[i.key],
657
+ "onUpdate:modelValue": (R) => x.value[i.key] = R,
658
+ type: i.type === "email" ? "email" : i.type === "tel" ? "tel" : "text",
659
+ placeholder: E(i.placeholder),
660
+ maxlength: i.options.maxlength
659
661
  }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "maxlength"]))
660
662
  ]),
661
663
  _: 2
662
664
  }, 1032, ["label", "help", "error", "required"]))), 128)),
663
- p.value ? (m(), w(e(Ce), {
665
+ k.value ? (m(), _(e(Ne), {
664
666
  key: 0,
665
667
  type: "warning",
666
668
  closable: !1
667
669
  }, {
668
670
  default: d(() => [
669
- E(I(e(g)("panel.no-files-by-hand")), 1)
671
+ z(I(e(g)("panel.no-files-by-hand")), 1)
670
672
  ]),
671
673
  _: 1
672
- })) : N("", !0)
674
+ })) : W("", !0)
673
675
  ], 64))
674
676
  ])
675
677
  ]),
676
678
  _: 1
677
679
  }, 8, ["open", "title"]));
678
680
  }
679
- }), zt = /* @__PURE__ */ me(qt, [["__scopeId", "data-v-72006299"]]), Rt = { class: "wx-submissions__mass" }, Bt = { class: "wx-submissions__state" }, Pt = 640, Ot = /* @__PURE__ */ ne({
681
+ }), Ot = /* @__PURE__ */ fe(Pt, [["__scopeId", "data-v-72006299"]]), Dt = { class: "wx-submissions__mass" }, Lt = { class: "wx-submissions__state" }, Mt = 640, Ht = /* @__PURE__ */ oe({
680
682
  __name: "SubmissionList",
681
683
  props: {
682
684
  form: {},
@@ -684,41 +686,41 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
684
686
  },
685
687
  emits: ["changed"],
686
688
  setup(a, { expose: n, emit: c }) {
687
- const y = a, b = c, B = oe(), t = ke(B), l = kt(), g = _t(), q = se();
688
- ce();
689
- const z = et("root"), $ = ot(z), S = T(() => $.value > 0 && $.value < Pt), A = T(() => S.value ? Number.POSITIVE_INFINITY : 0), v = ae("webx-inbox"), L = ae("webx-admin"), p = we(), U = C(null), V = C([]), W = C(!1), P = C([]), X = C(!1), k = T(() => B.can("inbox.update")), x = Xe(zt), _ = T({
689
+ const b = a, w = c, B = re(), t = Te(B), l = $t(), g = St(), S = ie();
690
+ he();
691
+ const N = et("root"), C = it(N), q = A(() => C.value > 0 && C.value < Mt), x = A(() => q.value ? Number.POSITIVE_INFINITY : 0), p = le("webx-inbox"), H = le("webx-admin"), k = Ve(), y = U(null), $ = U([]), E = U(!1), P = U([]), X = U(!1), V = A(() => B.can("inbox.update")), v = Ge(Ot), T = A({
690
692
  get: () => typeof l.query.view == "string" && l.query.view !== "" ? l.query.view : "all",
691
693
  set: (o) => {
692
694
  g.replace({
693
695
  query: { ...l.query, view: o === "all" ? void 0 : o, page: void 0 }
694
696
  });
695
697
  }
696
- }), u = T(() => ({
697
- view: _.value,
698
+ }), i = A(() => ({
699
+ view: T.value,
698
700
  search: typeof l.query.search == "string" ? l.query.search : "",
699
701
  assignee: typeof l.query.assignee == "string" ? l.query.assignee : null,
700
702
  placement: typeof l.query.placement == "string" ? l.query.placement : null,
701
703
  sort: typeof l.query.sort == "string" ? l.query.sort : null,
702
704
  page: Number(l.query.page ?? 1) || 1
703
- })), R = T(
704
- () => (U.value?.placements ?? []).map(
705
- (o) => o === null ? { value: "none", label: v("panel.placement-none") } : { value: o, label: o }
705
+ })), R = A(
706
+ () => (y.value?.placements ?? []).map(
707
+ (o) => o === null ? { value: "none", label: p("panel.placement-none") } : { value: o, label: o }
706
708
  )
707
- ), _e = T(
708
- () => R.value.length > 1 || u.value.placement !== null
709
- ), ie = T(() => {
710
- const o = u.value.placement;
709
+ ), ve = A(
710
+ () => R.value.length > 1 || i.value.placement !== null
711
+ ), ue = A(() => {
712
+ const o = i.value.placement;
711
713
  if (o === null) return [];
712
- const F = R.value.find((h) => h.value === o)?.label ?? (o === "none" ? v("panel.placement-none") : o);
714
+ const F = R.value.find((h) => h.value === o)?.label ?? (o === "none" ? p("panel.placement-none") : o);
713
715
  return [
714
716
  {
715
717
  key: "placement",
716
- label: `${v("panel.meta-placement")}: ${F}`,
717
- clear: () => K(void 0)
718
+ label: `${p("panel.meta-placement")}: ${F}`,
719
+ clear: () => be(void 0)
718
720
  }
719
721
  ];
720
722
  });
721
- function K(o) {
723
+ function be(o) {
722
724
  g.replace({
723
725
  query: {
724
726
  ...l.query,
@@ -727,26 +729,26 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
727
729
  }
728
730
  });
729
731
  }
730
- const pe = T(() => {
731
- const o = U.value?.counts, F = [
732
- { value: "all", label: v("panel.view-all"), badge: o?.all || void 0 },
733
- { value: "unread", label: v("panel.view-unread"), badge: o?.unread || void 0 }
732
+ const Q = A(() => {
733
+ const o = y.value?.counts, F = [
734
+ { value: "all", label: p("panel.view-all"), badge: o?.all || void 0 },
735
+ { value: "unread", label: p("panel.view-unread"), badge: o?.unread || void 0 }
734
736
  ];
735
- for (const h of V.value)
737
+ for (const h of $.value)
736
738
  F.push({
737
739
  value: h.key,
738
- label: j(h),
740
+ label: J(h),
739
741
  badge: o?.statuses[h.key] || void 0
740
742
  });
741
743
  return F;
742
744
  });
743
- function O(o, F) {
744
- const h = U.value?.columns?.[F];
745
+ function de(o, F) {
746
+ const h = y.value?.columns?.[F];
745
747
  return h ? o.values[h.key] ?? "" : "";
746
748
  }
747
- const Ve = T(() => {
748
- const o = U.value?.columns ?? [];
749
- return S.value ? [{ key: "card", label: "" }] : [
749
+ const L = A(() => {
750
+ const o = y.value?.columns ?? [];
751
+ return q.value ? [{ key: "card", label: "" }] : [
750
752
  ...o.map((F, h) => ({
751
753
  key: `values.${F.key}`,
752
754
  label: F.label,
@@ -761,10 +763,10 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
761
763
  // A floor rather than a width: the cell holds a badge, sometimes an avatar and sometimes
762
764
  // a paperclip, and a fixed width that any of them overflows makes the whole table scroll
763
765
  // sideways by two pixels.
764
- { key: "status", label: v("panel.status"), minWidth: 100 },
766
+ { key: "status", label: p("panel.status"), minWidth: 100 },
765
767
  {
766
768
  key: "created_at",
767
- label: v("panel.received"),
769
+ label: p("panel.received"),
768
770
  sortable: !0,
769
771
  width: 120,
770
772
  // "today at 16:22" is three words the table will break over two lines given half a
@@ -774,230 +776,230 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
774
776
  // Kept on the card, unlike most dates: "when did this come in" is one of the two
775
777
  // questions a submission is looked at for, and the other one is who sent it.
776
778
  },
777
- { key: "actions", label: "", width: yt, align: "right", hideOnCards: !0 }
779
+ { key: "actions", label: "", width: gt, align: "right", hideOnCards: !0 }
778
780
  ];
779
- }), Te = T(
780
- () => u.value.view === "all" && u.value.search === "" && u.value.assignee === null && u.value.placement === null ? v("panel.submissions-empty") : v("panel.submissions-none")
781
- ), fe = T(
782
- () => V.value.map((o) => ({ value: o.id, label: j(o) }))
783
- ), j = Tt();
784
- function $e() {
785
- return de(y.form.title, q.active.value, y.form.slug);
781
+ }), $e = A(
782
+ () => i.value.view === "all" && i.value.search === "" && i.value.assignee === null && i.value.placement === null ? p("panel.submissions-empty") : p("panel.submissions-none")
783
+ ), Se = A(
784
+ () => $.value.map((o) => ({ value: o.id, label: J(o) }))
785
+ ), J = Ct();
786
+ function ae() {
787
+ return pe(b.form.title, S.active.value, b.form.slug);
786
788
  }
787
- async function f(o) {
788
- W.value = !0;
789
+ async function ne(o) {
790
+ E.value = !0;
789
791
  try {
790
- U.value = await t.submissions(y.form.id, {
791
- view: u.value.view,
792
- search: o?.search ?? u.value.search,
793
- assignee: u.value.assignee,
794
- placement: u.value.placement,
792
+ y.value = await t.submissions(b.form.id, {
793
+ view: i.value.view,
794
+ search: o?.search ?? i.value.search,
795
+ assignee: i.value.assignee,
796
+ placement: i.value.placement,
795
797
  sort: o?.sort ? `${o.sort.order === "desc" ? "-" : ""}${o.sort.key}` : null,
796
- page: o?.page ?? u.value.page,
798
+ page: o?.page ?? i.value.page,
797
799
  per_page: o?.perPage
798
800
  });
799
801
  } catch (F) {
800
- Y.danger(p(F));
802
+ j.danger(k(F));
801
803
  } finally {
802
- W.value = !1;
804
+ E.value = !1;
803
805
  }
804
806
  }
805
- function s(o) {
807
+ function f(o) {
806
808
  const F = {
807
809
  ...l.query,
808
810
  search: o.search === "" ? void 0 : o.search,
809
811
  sort: o.sort === null ? void 0 : `${o.sort.order === "desc" ? "-" : ""}${o.sort.key}`,
810
812
  page: o.page === 1 ? void 0 : String(o.page)
811
813
  };
812
- g.replace({ query: F }), f(o);
814
+ g.replace({ query: F }), ne(o);
813
815
  }
814
- ve([() => y.form.id, _, () => u.value.assignee, () => u.value.placement], () => {
815
- P.value = [], f();
816
+ ge([() => b.form.id, T, () => i.value.assignee, () => i.value.placement], () => {
817
+ P.value = [], ne();
816
818
  }), r();
817
819
  async function r() {
818
820
  try {
819
- V.value = await t.statuses();
821
+ $.value = await t.statuses();
820
822
  } catch (o) {
821
- Y.danger(p(o));
823
+ j.danger(k(o));
822
824
  }
823
825
  }
824
- function H(o) {
825
- g.push({ path: `${y.base}/submissions/${o.id}`, query: { ...l.query } });
826
+ function s(o) {
827
+ g.push({ path: `${b.base}/submissions/${o.id}`, query: { ...l.query } });
826
828
  }
827
- function J(o) {
828
- return k.value ? [
829
+ function O(o) {
830
+ return V.value ? [
829
831
  {
830
832
  key: "read",
831
833
  icon: o.is_read ? "eye-off" : "eye",
832
- label: o.is_read ? v("panel.mark-unread") : v("panel.mark-read"),
834
+ label: o.is_read ? p("panel.mark-unread") : p("panel.mark-read"),
833
835
  run: () => {
834
- Se([o.id], o.is_read ? "unread" : "read");
836
+ Ae([o.id], o.is_read ? "unread" : "read");
835
837
  }
836
838
  },
837
839
  {
838
840
  key: "delete",
839
841
  icon: "trash",
840
- label: v("panel.delete"),
842
+ label: p("panel.delete"),
841
843
  danger: !0,
842
844
  run: () => {
843
- Ie([o.id]);
845
+ Ee([o.id]);
844
846
  }
845
847
  }
846
848
  ] : [];
847
849
  }
848
- async function Ye(o) {
849
- typeof o == "number" && (X.value = !0, await Se(
850
+ async function Y(o) {
851
+ typeof o == "number" && (X.value = !0, await Ae(
850
852
  P.value.map((F) => F.id),
851
853
  "status",
852
854
  o
853
855
  ), X.value = !1);
854
856
  }
855
- async function Ie(o) {
856
- await Ge({
857
- title: o.length === 1 ? v("panel.delete-submission-title") : v("panel.delete-selected-title", { count: o.length }),
858
- message: v("panel.delete-submission-text"),
859
- confirmText: v("panel.delete"),
860
- cancelText: v("panel.cancel"),
857
+ async function Ee(o) {
858
+ await Ye({
859
+ title: o.length === 1 ? p("panel.delete-submission-title") : p("panel.delete-selected-title", { count: o.length }),
860
+ message: p("panel.delete-submission-text"),
861
+ confirmText: p("panel.delete"),
862
+ cancelText: p("panel.cancel"),
861
863
  tone: "danger"
862
- }) && await Se(o, "delete");
864
+ }) && await Ae(o, "delete");
863
865
  }
864
- async function Se(o, F, h) {
866
+ async function Ae(o, F, h) {
865
867
  if (o.length !== 0)
866
868
  try {
867
- await t.massSubmissions({ ids: o, action: F, status_id: h }), P.value = [], await f(), b("changed");
868
- } catch (ue) {
869
- Y.danger(p(ue));
869
+ await t.massSubmissions({ ids: o, action: F, status_id: h }), P.value = [], await ne(), w("changed");
870
+ } catch (ce) {
871
+ j.danger(k(ce));
870
872
  }
871
873
  }
872
874
  async function je() {
873
- const o = await x({ form: y.form });
874
- o && (Y.success(v("panel.created")), await f(), b("changed"), g.push({ path: `${y.base}/submissions/${o.id}`, query: { ...l.query } }));
875
+ const o = await v({ form: b.form });
876
+ o && (j.success(p("panel.created")), await ne(), w("changed"), g.push({ path: `${b.base}/submissions/${o.id}`, query: { ...l.query } }));
875
877
  }
876
- const Ke = T(
877
- () => t.exportUrl(y.form.id, {
878
- view: u.value.view,
879
- search: u.value.search,
880
- assignee: u.value.assignee,
881
- placement: u.value.placement,
882
- sort: u.value.sort
878
+ const Ke = A(
879
+ () => t.exportUrl(b.form.id, {
880
+ view: i.value.view,
881
+ search: i.value.search,
882
+ assignee: i.value.assignee,
883
+ placement: i.value.placement,
884
+ sort: i.value.sort
883
885
  })
884
- ), Ze = T(() => [
885
- { key: "export", label: v("panel.export"), icon: "download", href: Ke.value }
886
+ ), Ze = A(() => [
887
+ { key: "export", label: p("panel.export"), icon: "download", href: Ke.value }
886
888
  ]);
887
- return n({ create: je }), (o, F) => (m(), D("div", {
889
+ return n({ create: je }), (o, F) => (m(), M("div", {
888
890
  ref_key: "root",
889
- ref: z,
891
+ ref: N,
890
892
  class: "wx-submissions"
891
893
  }, [
892
- i(e(gt), {
894
+ u(e(xt), {
893
895
  class: "wx-submissions__head",
894
896
  level: 3,
895
- title: $e(),
897
+ title: ae(),
896
898
  subtitle: a.form.slug,
897
899
  actions: Ze.value
898
900
  }, null, 8, ["title", "subtitle", "actions"]),
899
- i(e(it), {
900
- modelValue: _.value,
901
- "onUpdate:modelValue": F[2] || (F[2] = (h) => _.value = h),
901
+ u(e(rt), {
902
+ modelValue: T.value,
903
+ "onUpdate:modelValue": F[2] || (F[2] = (h) => T.value = h),
902
904
  class: "wx-submissions__views",
903
- items: pe.value,
905
+ items: Q.value,
904
906
  "collapse-below": 560,
905
- "aria-label": e(v)("panel.status")
907
+ "aria-label": e(p)("panel.status")
906
908
  }, {
907
909
  default: d(() => [
908
- i(e(ut), {
909
- data: U.value,
910
- columns: Ve.value,
910
+ u(e(ut), {
911
+ data: y.value,
912
+ columns: L.value,
911
913
  "row-key": "id",
912
914
  searchable: "",
913
915
  clickable: "",
914
916
  hover: "",
915
917
  flush: "",
916
- loading: W.value,
917
- "loading-text": e(v)("panel.loading"),
918
- selectable: k.value,
919
- "select-row-label": e(L)("filters.select-row"),
920
- "select-all-label": e(L)("filters.select-all"),
918
+ loading: E.value,
919
+ "loading-text": e(p)("panel.loading"),
920
+ selectable: V.value,
921
+ "select-row-label": e(H)("filters.select-row"),
922
+ "select-all-label": e(H)("filters.select-all"),
921
923
  "row-class": (h) => h.is_read ? void 0 : "is-unread",
922
- "search-placeholder": e(v)("panel.search-submissions"),
923
- "empty-text": Te.value,
924
- "cards-below": A.value,
925
- "filters-count": ie.value.length,
926
- onRowClick: H,
927
- onStateChange: s,
928
- onSelectionChange: F[1] || (F[1] = (h, ue) => P.value = ue)
929
- }, Oe({
924
+ "search-placeholder": e(p)("panel.search-submissions"),
925
+ "empty-text": $e.value,
926
+ "cards-below": x.value,
927
+ "filters-count": ue.value.length,
928
+ onRowClick: s,
929
+ onStateChange: f,
930
+ onSelectionChange: F[1] || (F[1] = (h, ce) => P.value = ce)
931
+ }, De({
930
932
  "cell-status": d(({ row: h }) => [
931
- G("div", Bt, [
932
- h.status ? (m(), w(e(be), {
933
+ G("div", Lt, [
934
+ h.status ? (m(), _(e(xe), {
933
935
  key: 0,
934
936
  type: h.status.color
935
937
  }, {
936
938
  default: d(() => [
937
- E(I(e(j)(h.status)), 1)
939
+ z(I(e(J)(h.status)), 1)
938
940
  ]),
939
941
  _: 2
940
- }, 1032, ["type"])) : N("", !0),
941
- h.assignee ? (m(), w(e(Ee), {
942
+ }, 1032, ["type"])) : W("", !0),
943
+ h.assignee ? (m(), _(e(qe), {
942
944
  key: 1,
943
945
  name: h.assignee.name,
944
946
  title: h.assignee.name,
945
947
  size: "xs",
946
948
  tone: "auto"
947
- }, null, 8, ["name", "title"])) : N("", !0),
948
- h.files_count > 0 ? (m(), w(e(dt), {
949
+ }, null, 8, ["name", "title"])) : W("", !0),
950
+ h.files_count > 0 ? (m(), _(e(ct), {
949
951
  key: 2,
950
- content: e(v)("panel.attachments")
952
+ content: e(p)("panel.attachments")
951
953
  }, {
952
954
  default: d(() => [
953
- i(e(ge), {
955
+ u(e(ke), {
954
956
  name: "file",
955
957
  size: "sm"
956
958
  })
957
959
  ]),
958
960
  _: 1
959
- }, 8, ["content"])) : N("", !0)
961
+ }, 8, ["content"])) : W("", !0)
960
962
  ])
961
963
  ]),
962
964
  "cell-created_at": d(({ row: h }) => [
963
- i(e(ze), {
965
+ u(e(Re), {
964
966
  value: h.created_at,
965
967
  compact: ""
966
968
  }, null, 8, ["value"])
967
969
  ]),
968
970
  "cell-card": d(({ row: h }) => [
969
- i(e(rt), {
971
+ u(e(dt), {
970
972
  variant: "plain",
971
973
  shape: "circle",
972
- title: O(h, 0)
974
+ title: de(h, 0)
973
975
  }, {
974
976
  subtitle: d(() => [
975
- E(I(O(h, 1)), 1)
977
+ z(I(de(h, 1)), 1)
976
978
  ]),
977
979
  meta: d(() => [
978
- h.status ? (m(), w(e(be), {
980
+ h.status ? (m(), _(e(xe), {
979
981
  key: 0,
980
982
  type: h.status.color,
981
983
  size: "sm"
982
984
  }, {
983
985
  default: d(() => [
984
- E(I(e(j)(h.status)), 1)
986
+ z(I(e(J)(h.status)), 1)
985
987
  ]),
986
988
  _: 2
987
- }, 1032, ["type"])) : N("", !0),
988
- h.assignee ? (m(), w(e(Ee), {
989
+ }, 1032, ["type"])) : W("", !0),
990
+ h.assignee ? (m(), _(e(qe), {
989
991
  key: 1,
990
992
  name: h.assignee.name,
991
993
  title: h.assignee.name,
992
994
  size: "xs",
993
995
  tone: "auto"
994
- }, null, 8, ["name", "title"])) : N("", !0),
995
- h.files_count > 0 ? (m(), w(e(ge), {
996
+ }, null, 8, ["name", "title"])) : W("", !0),
997
+ h.files_count > 0 ? (m(), _(e(ke), {
996
998
  key: 2,
997
999
  name: "file",
998
1000
  size: "sm"
999
- })) : N("", !0),
1000
- i(e(ze), {
1001
+ })) : W("", !0),
1002
+ u(e(Re), {
1001
1003
  value: h.created_at
1002
1004
  }, null, 8, ["value"])
1003
1005
  ]),
@@ -1005,14 +1007,14 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1005
1007
  }, 1032, ["title"])
1006
1008
  ]),
1007
1009
  "card-actions": d(({ row: h }) => [
1008
- i(e(Ue), {
1009
- actions: J(h),
1010
+ u(e(We), {
1011
+ actions: O(h),
1010
1012
  label: String(h.id)
1011
1013
  }, null, 8, ["actions", "label"])
1012
1014
  ]),
1013
1015
  "cell-actions": d(({ row: h }) => [
1014
- i(e(Ue), {
1015
- actions: J(h),
1016
+ u(e(We), {
1017
+ actions: O(h),
1016
1018
  label: String(h.id)
1017
1019
  }, null, 8, ["actions", "label"])
1018
1020
  ]),
@@ -1021,33 +1023,33 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1021
1023
  P.value.length > 0 ? {
1022
1024
  name: "actions",
1023
1025
  fn: d(() => [
1024
- G("div", Rt, [
1025
- i(e(ee), {
1026
+ G("div", Dt, [
1027
+ u(e(ee), {
1026
1028
  size: "sm",
1027
1029
  weight: "medium"
1028
1030
  }, {
1029
1031
  default: d(() => [
1030
- E(I(e(v)("panel.selected", { count: P.value.length })), 1)
1032
+ z(I(e(p)("panel.selected", { count: P.value.length })), 1)
1031
1033
  ]),
1032
1034
  _: 1
1033
1035
  }),
1034
- i(e(ye), {
1036
+ u(e(we), {
1035
1037
  "model-value": null,
1036
- options: fe.value,
1037
- placeholder: e(v)("panel.move-to"),
1038
+ options: Se.value,
1039
+ placeholder: e(p)("panel.move-to"),
1038
1040
  disabled: X.value,
1039
1041
  size: "sm",
1040
1042
  style: { width: "180px" },
1041
- "onUpdate:modelValue": Ye
1043
+ "onUpdate:modelValue": Y
1042
1044
  }, null, 8, ["options", "placeholder", "disabled"]),
1043
- i(e(te), {
1045
+ u(e(te), {
1044
1046
  size: "sm",
1045
1047
  variant: "outline",
1046
1048
  type: "danger",
1047
- onClick: F[0] || (F[0] = (h) => Ie(P.value.map((ue) => ue.id)))
1049
+ onClick: F[0] || (F[0] = (h) => Ee(P.value.map((ce) => ce.id)))
1048
1050
  }, {
1049
1051
  default: d(() => [
1050
- E(I(e(v)("panel.delete")), 1)
1052
+ z(I(e(p)("panel.delete")), 1)
1051
1053
  ]),
1052
1054
  _: 1
1053
1055
  })
@@ -1055,20 +1057,20 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1055
1057
  ]),
1056
1058
  key: "0"
1057
1059
  } : void 0,
1058
- _e.value ? {
1060
+ ve.value ? {
1059
1061
  name: "filters",
1060
1062
  fn: d(() => [
1061
- i(e(M), {
1062
- label: e(v)("panel.meta-placement")
1063
+ u(e(D), {
1064
+ label: e(p)("panel.meta-placement")
1063
1065
  }, {
1064
1066
  default: d(() => [
1065
- i(e(ye), {
1066
- "model-value": u.value.placement,
1067
+ u(e(we), {
1068
+ "model-value": i.value.placement,
1067
1069
  options: R.value,
1068
- placeholder: e(v)("panel.any-placement"),
1070
+ placeholder: e(p)("panel.any-placement"),
1069
1071
  clearable: "",
1070
1072
  size: "sm",
1071
- "onUpdate:modelValue": K
1073
+ "onUpdate:modelValue": be
1072
1074
  }, null, 8, ["model-value", "options", "placeholder"])
1073
1075
  ]),
1074
1076
  _: 1
@@ -1076,10 +1078,10 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1076
1078
  ]),
1077
1079
  key: "1"
1078
1080
  } : void 0,
1079
- ie.value.length > 0 ? {
1081
+ ue.value.length > 0 ? {
1080
1082
  name: "applied",
1081
1083
  fn: d(() => [
1082
- i(e(xt), { filters: ie.value }, null, 8, ["filters"])
1084
+ u(e(wt), { filters: ue.value }, null, 8, ["filters"])
1083
1085
  ]),
1084
1086
  key: "2"
1085
1087
  } : void 0
@@ -1089,9 +1091,9 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1089
1091
  }, 8, ["modelValue", "items", "aria-label"])
1090
1092
  ], 512));
1091
1093
  }
1092
- }), ol = /* @__PURE__ */ me(Ot, [["__scopeId", "data-v-f6cb49f1"]]), Mt = /* @__PURE__ */ ne({
1094
+ }), dl = /* @__PURE__ */ fe(Ht, [["__scopeId", "data-v-f6cb49f1"]]), Xt = /* @__PURE__ */ oe({
1093
1095
  __name: "LocalizedRichText",
1094
- props: /* @__PURE__ */ Fe({
1096
+ props: /* @__PURE__ */ Ie({
1095
1097
  placeholder: { default: void 0 },
1096
1098
  minHeight: { default: "160px" }
1097
1099
  }, {
@@ -1100,42 +1102,50 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1100
1102
  }),
1101
1103
  emits: ["update:modelValue"],
1102
1104
  setup(a) {
1103
- const n = We(a, "modelValue"), c = a, y = se(), b = T(() => {
1104
- const t = y.active.value;
1105
- return y.list.value.some((g) => g.code === t) ? t : y.list.value[0]?.code ?? "";
1106
- }), B = T({
1105
+ const n = Fe(a, "modelValue"), c = a, b = ie(), w = kt(), B = _t(() => !0), t = le("webx-admin"), l = A(() => {
1106
+ const S = b.active.value;
1107
+ return b.list.value.some((C) => C.code === S) ? S : b.list.value[0]?.code ?? "";
1108
+ }), g = A({
1107
1109
  get: () => {
1108
- const t = n.value;
1109
- return typeof t == "string" ? b.value === "" || b.value === y.list.value[0]?.code ? t : "" : t[b.value] ?? "";
1110
+ const S = n.value;
1111
+ return typeof S == "string" ? l.value === "" || l.value === b.list.value[0]?.code ? S : "" : S[l.value] ?? "";
1110
1112
  },
1111
- set: (t) => {
1112
- if (b.value === "") {
1113
- n.value = t;
1113
+ set: (S) => {
1114
+ if (l.value === "") {
1115
+ n.value = S;
1114
1116
  return;
1115
1117
  }
1116
- const l = typeof n.value == "string" ? { [b.value]: n.value } : n.value;
1117
- n.value = { ...l, [b.value]: t };
1118
+ const N = typeof n.value == "string" ? { [l.value]: n.value } : n.value;
1119
+ n.value = { ...N, [l.value]: S };
1118
1120
  }
1119
1121
  });
1120
- return (t, l) => e(y).list.value.length > 0 ? (m(), w(e(ct), { key: 0 }, {
1122
+ return (S, N) => e(b).list.value.length > 0 ? (m(), _(e(mt), { key: 0 }, {
1121
1123
  default: d(() => [
1122
- i(e(qe), {
1123
- modelValue: B.value,
1124
- "onUpdate:modelValue": l[0] || (l[0] = (g) => B.value = g),
1124
+ u(e(ze), {
1125
+ modelValue: g.value,
1126
+ "onUpdate:modelValue": N[0] || (N[0] = (C) => g.value = C),
1125
1127
  placeholder: c.placeholder,
1126
- "min-height": c.minHeight
1127
- }, null, 8, ["modelValue", "placeholder", "min-height"])
1128
+ "min-height": c.minHeight,
1129
+ labels: e(w),
1130
+ tokens: e(B).length > 0 ? e(B) : void 0,
1131
+ "tokens-title": e(t)("shortcodes.title"),
1132
+ "tokens-label": e(t)("shortcodes.insert")
1133
+ }, null, 8, ["modelValue", "placeholder", "min-height", "labels", "tokens", "tokens-title", "tokens-label"])
1128
1134
  ]),
1129
1135
  _: 1
1130
- })) : (m(), w(e(qe), {
1136
+ })) : (m(), _(e(ze), {
1131
1137
  key: 1,
1132
- modelValue: B.value,
1133
- "onUpdate:modelValue": l[1] || (l[1] = (g) => B.value = g),
1138
+ modelValue: g.value,
1139
+ "onUpdate:modelValue": N[1] || (N[1] = (C) => g.value = C),
1134
1140
  placeholder: c.placeholder,
1135
- "min-height": c.minHeight
1136
- }, null, 8, ["modelValue", "placeholder", "min-height"]));
1141
+ "min-height": c.minHeight,
1142
+ labels: e(w),
1143
+ tokens: e(B).length > 0 ? e(B) : void 0,
1144
+ "tokens-title": e(t)("shortcodes.title"),
1145
+ "tokens-label": e(t)("shortcodes.insert")
1146
+ }, null, 8, ["modelValue", "placeholder", "min-height", "labels", "tokens", "tokens-title", "tokens-label"]));
1137
1147
  }
1138
- }), Dt = [
1148
+ }), Gt = [
1139
1149
  "text",
1140
1150
  "email",
1141
1151
  "tel",
@@ -1147,10 +1157,10 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1147
1157
  "date",
1148
1158
  "file",
1149
1159
  "hidden"
1150
- ], il = ["default", "primary", "success", "warning", "info", "danger"], Lt = { class: "wx-inbox-field-form" }, Ht = {
1160
+ ], cl = ["default", "primary", "success", "warning", "info", "danger"], Yt = { class: "wx-inbox-field-form" }, jt = {
1151
1161
  key: 2,
1152
1162
  class: "wx-inbox-choices"
1153
- }, Xt = { class: "wx-inbox-field-form__row" }, Gt = { class: "wx-inbox-field-form__checks" }, Yt = { class: "wx-inbox-field-form__advanced" }, jt = /* @__PURE__ */ ne({
1163
+ }, Kt = { class: "wx-inbox-field-form__row" }, Zt = { class: "wx-inbox-field-form__checks" }, Qt = { class: "wx-inbox-field-form__advanced" }, Jt = /* @__PURE__ */ oe({
1154
1164
  __name: "FieldDialog",
1155
1165
  props: {
1156
1166
  field: {},
@@ -1158,122 +1168,126 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1158
1168
  taken: { default: () => [] }
1159
1169
  },
1160
1170
  setup(a) {
1161
- const n = a, { resolve: c, dismiss: y, open: b } = De(), B = oe(), t = ke(B);
1162
- ce();
1163
- const l = ae("webx-inbox"), g = we(), q = C(!1), z = C({}), $ = C(""), S = C("text"), A = C({}), v = C({}), L = C({}), p = C({}), U = C(!1), V = se(), W = C(!0), P = C(!1), X = C(!0), k = C(!1);
1164
- ve(
1171
+ const n = a, { resolve: c, dismiss: b, open: w } = Me(), B = re(), t = Te(B);
1172
+ he();
1173
+ const l = le("webx-inbox"), g = Vt(), S = Ve(), N = U(!1), C = U({}), q = U(""), x = U("text"), p = U({}), H = U({}), k = U({}), y = U({}), $ = U(!1), E = ie(), P = U(!0), X = U(!1), V = U(!0), v = U(!1);
1174
+ ge(
1165
1175
  () => n.field,
1166
1176
  (f) => {
1167
- $.value = f?.name ?? "", S.value = f?.type ?? "text", A.value = { ...f?.title ?? {} }, v.value = { ...f?.placeholder ?? {} }, L.value = { ...f?.help ?? {} }, p.value = { ...f?.options ?? {} }, W.value = f?.is_enabled ?? !0, P.value = f?.is_required ?? !1, X.value = f?.is_fullsize ?? !0, k.value = f?.in_table ?? !1, U.value = f !== null, z.value = {};
1177
+ q.value = f?.name ?? "", x.value = f?.type ?? "text", p.value = { ...f?.title ?? {} }, H.value = { ...f?.placeholder ?? {} }, k.value = { ...f?.help ?? {} }, y.value = { ...f?.options ?? {} }, P.value = f?.is_enabled ?? !0, X.value = f?.is_required ?? !1, V.value = f?.is_fullsize ?? !0, v.value = f?.in_table ?? !1, $.value = f !== null, C.value = {};
1168
1178
  },
1169
1179
  { immediate: !0 }
1170
1180
  );
1171
- function x(f) {
1172
- const s = f ?? {}, r = s[V.active.value];
1173
- return typeof r == "string" && r.trim() !== "" ? r : Object.values(s).find((H) => typeof H == "string" && H.trim() !== "") ?? "";
1181
+ function T(f) {
1182
+ const r = f ?? {}, s = r[E.active.value];
1183
+ if (typeof s == "string" && s.trim() !== "") return [s, E.active.value];
1184
+ const O = Object.entries(r).find(
1185
+ ([, Y]) => typeof Y == "string" && Y.trim() !== ""
1186
+ );
1187
+ return O === void 0 ? ["", E.active.value] : [O[1], O[0]];
1174
1188
  }
1175
- function _(f) {
1176
- let s = wt(f, "_").slice(0, 60).replace(/_+$/, "");
1189
+ function i([f, r]) {
1190
+ let s = Tt(f, "_", r).slice(0, 60).replace(/_+$/, "");
1177
1191
  if (s === "") return "";
1178
1192
  /^[a-z]/.test(s) || (s = `field_${s}`);
1179
- let r = s;
1180
- for (let H = 2; n.taken.includes(r); H++) r = `${s}_${H}`;
1181
- return r;
1193
+ let O = s;
1194
+ for (let Y = 2; n.taken.includes(O); Y++) O = `${s}_${Y}`;
1195
+ return O;
1182
1196
  }
1183
- ve(
1184
- () => x(A.value),
1197
+ ge(
1198
+ () => T(p.value),
1185
1199
  (f) => {
1186
- U.value || ($.value = _(f));
1200
+ $.value || (q.value = i(f));
1187
1201
  }
1188
1202
  );
1189
- function u(f) {
1190
- $.value = f, U.value = f.trim() !== "", U.value || ($.value = _(x(A.value)));
1203
+ function R(f) {
1204
+ q.value = f, $.value = f.trim() !== "", $.value || (q.value = i(T(p.value)));
1191
1205
  }
1192
- const R = T(() => {
1193
- const f = n.field?.name ?? "", s = $.value.trim();
1194
- return f !== "" && s !== "" && s !== f ? f : null;
1195
- }), _e = T(
1196
- () => Dt.map((f) => ({ value: f, label: l(`fields.type-${f}`) }))
1197
- ), ie = T(() => ["select", "radio", "checkbox"].includes(S.value)), K = T(
1198
- () => Array.isArray(p.value.choices) ? p.value.choices : []
1199
- ), pe = T({
1200
- get: () => Array.isArray(p.value.extensions) ? p.value.extensions : [],
1201
- set: (f) => O(
1206
+ const ve = A(() => {
1207
+ const f = n.field?.name ?? "", r = q.value.trim();
1208
+ return f !== "" && r !== "" && r !== f ? f : null;
1209
+ }), ue = A(
1210
+ () => Gt.map((f) => ({ value: f, label: l(`fields.type-${f}`) }))
1211
+ ), be = A(() => ["select", "radio", "checkbox"].includes(x.value)), Q = A(
1212
+ () => Array.isArray(y.value.choices) ? y.value.choices : []
1213
+ ), de = A({
1214
+ get: () => Array.isArray(y.value.extensions) ? y.value.extensions : [],
1215
+ set: (f) => L(
1202
1216
  "extensions",
1203
- f.map((s) => s.replace(/^\./, ""))
1217
+ f.map((r) => r.replace(/^\./, ""))
1204
1218
  )
1205
1219
  });
1206
- function O(f, s) {
1207
- p.value = { ...p.value, [f]: s };
1220
+ function L(f, r) {
1221
+ y.value = { ...y.value, [f]: r };
1208
1222
  }
1209
- function Ve() {
1210
- O("choices", [...K.value, { value: "", label: {} }]);
1223
+ function $e() {
1224
+ L("choices", [...Q.value, { value: "", label: {} }]);
1211
1225
  }
1212
- function Te(f) {
1213
- O(
1226
+ function Se(f) {
1227
+ L(
1214
1228
  "choices",
1215
- K.value.filter((s, r) => r !== f)
1229
+ Q.value.filter((r, s) => s !== f)
1216
1230
  );
1217
1231
  }
1218
- function fe(f, s) {
1219
- O(
1232
+ function J(f, r) {
1233
+ L(
1220
1234
  "choices",
1221
- K.value.map((r, H) => H === f ? { ...r, ...s } : r)
1235
+ Q.value.map((s, O) => O === f ? { ...s, ...r } : s)
1222
1236
  );
1223
1237
  }
1224
- function j(f) {
1225
- return z.value[f]?.[0];
1238
+ function ae(f) {
1239
+ return C.value[f]?.[0];
1226
1240
  }
1227
- async function $e() {
1228
- q.value = !0, z.value = {};
1241
+ async function ne() {
1242
+ N.value = !0, C.value = {};
1229
1243
  const f = {
1230
- name: $.value.trim() === "" ? null : $.value.trim(),
1231
- type: S.value,
1232
- title: A.value,
1233
- placeholder: v.value,
1234
- help: L.value,
1235
- options: p.value,
1236
- is_enabled: W.value,
1237
- is_required: P.value,
1238
- is_fullsize: X.value,
1239
- in_table: k.value
1244
+ name: q.value.trim() === "" ? null : q.value.trim(),
1245
+ type: x.value,
1246
+ title: p.value,
1247
+ placeholder: H.value,
1248
+ help: k.value,
1249
+ options: y.value,
1250
+ is_enabled: P.value,
1251
+ is_required: X.value,
1252
+ is_fullsize: V.value,
1253
+ in_table: v.value
1240
1254
  };
1241
1255
  try {
1242
1256
  c(
1243
1257
  n.field === null ? await t.createField(n.form.id, f) : await t.saveField(n.field.id, f)
1244
1258
  );
1245
- } catch (s) {
1246
- const r = s.body;
1247
- r?.errors ? (z.value = r.errors, Y.danger(l("panel.failed"))) : Y.danger(g(s));
1259
+ } catch (r) {
1260
+ const s = r.body;
1261
+ s?.errors ? (C.value = s.errors, j.danger(l("panel.failed"))) : j.danger(S(r));
1248
1262
  } finally {
1249
- q.value = !1;
1263
+ N.value = !1;
1250
1264
  }
1251
1265
  }
1252
- return (f, s) => (m(), w(e(Le), {
1253
- open: e(b),
1254
- "onUpdate:open": s[21] || (s[21] = (r) => Be(b) ? b.value = r : null),
1266
+ return (f, r) => (m(), _(e(He), {
1267
+ open: e(w),
1268
+ "onUpdate:open": r[21] || (r[21] = (s) => Pe(w) ? w.value = s : null),
1255
1269
  title: a.field ? e(l)("fields.edit-field") : e(l)("fields.new-field"),
1256
1270
  width: 720
1257
1271
  }, {
1258
1272
  footer: d(() => [
1259
- i(e(He), { size: "sm" }, {
1273
+ u(e(Xe), { size: "sm" }, {
1260
1274
  default: d(() => [
1261
- i(e(te), {
1275
+ u(e(te), {
1262
1276
  variant: "outline",
1263
- onClick: s[20] || (s[20] = (r) => e(y)())
1277
+ onClick: r[20] || (r[20] = (s) => e(b)())
1264
1278
  }, {
1265
1279
  default: d(() => [
1266
- E(I(e(l)("fields.cancel")), 1)
1280
+ z(I(e(l)("fields.cancel")), 1)
1267
1281
  ]),
1268
1282
  _: 1
1269
1283
  }),
1270
- i(e(te), {
1284
+ u(e(te), {
1271
1285
  type: "primary",
1272
- loading: q.value,
1273
- onClick: $e
1286
+ loading: N.value,
1287
+ onClick: ne
1274
1288
  }, {
1275
1289
  default: d(() => [
1276
- E(I(e(l)("fields.save")), 1)
1290
+ z(I(e(l)("fields.save")), 1)
1277
1291
  ]),
1278
1292
  _: 1
1279
1293
  }, 8, ["loading"])
@@ -1282,329 +1296,331 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1282
1296
  })
1283
1297
  ]),
1284
1298
  default: d(() => [
1285
- G("div", Lt, [
1286
- i(e(M), {
1299
+ G("div", Yt, [
1300
+ u(e(D), {
1287
1301
  label: e(l)("fields.type")
1288
1302
  }, {
1289
1303
  default: d(() => [
1290
- i(e(ye), {
1291
- modelValue: S.value,
1292
- "onUpdate:modelValue": s[0] || (s[0] = (r) => S.value = r),
1293
- options: _e.value
1304
+ u(e(we), {
1305
+ modelValue: x.value,
1306
+ "onUpdate:modelValue": r[0] || (r[0] = (s) => x.value = s),
1307
+ options: ue.value
1294
1308
  }, null, 8, ["modelValue", "options"])
1295
1309
  ]),
1296
1310
  _: 1
1297
1311
  }, 8, ["label"]),
1298
- i(e(M), {
1312
+ u(e(D), {
1299
1313
  label: e(l)("fields.title"),
1300
- error: j("title"),
1314
+ error: ae("title"),
1301
1315
  required: ""
1302
1316
  }, {
1303
1317
  default: d(() => [
1304
- i(e(Z), {
1305
- modelValue: A.value,
1306
- "onUpdate:modelValue": s[1] || (s[1] = (r) => A.value = r),
1318
+ u(e(K), {
1319
+ modelValue: p.value,
1320
+ "onUpdate:modelValue": r[1] || (r[1] = (s) => p.value = s),
1307
1321
  localized: ""
1308
1322
  }, null, 8, ["modelValue"])
1309
1323
  ]),
1310
1324
  _: 1
1311
1325
  }, 8, ["label", "error"]),
1312
- S.value !== "hidden" ? (m(), D(Q, { key: 0 }, [
1313
- S.value !== "consent" ? (m(), w(e(M), {
1326
+ x.value !== "hidden" ? (m(), M(Z, { key: 0 }, [
1327
+ x.value !== "consent" ? (m(), _(e(D), {
1314
1328
  key: 0,
1315
1329
  label: e(l)("fields.placeholder")
1316
1330
  }, {
1317
1331
  default: d(() => [
1318
- i(e(Z), {
1319
- modelValue: v.value,
1320
- "onUpdate:modelValue": s[2] || (s[2] = (r) => v.value = r),
1332
+ u(e(K), {
1333
+ modelValue: H.value,
1334
+ "onUpdate:modelValue": r[2] || (r[2] = (s) => H.value = s),
1321
1335
  localized: ""
1322
1336
  }, null, 8, ["modelValue"])
1323
1337
  ]),
1324
1338
  _: 1
1325
- }, 8, ["label"])) : N("", !0),
1326
- i(e(M), {
1339
+ }, 8, ["label"])) : W("", !0),
1340
+ u(e(D), {
1327
1341
  label: e(l)("fields.help")
1328
1342
  }, {
1329
1343
  default: d(() => [
1330
- i(e(Z), {
1331
- modelValue: L.value,
1332
- "onUpdate:modelValue": s[3] || (s[3] = (r) => L.value = r),
1344
+ u(e(K), {
1345
+ modelValue: k.value,
1346
+ "onUpdate:modelValue": r[3] || (r[3] = (s) => k.value = s),
1333
1347
  localized: ""
1334
1348
  }, null, 8, ["modelValue"])
1335
1349
  ]),
1336
1350
  _: 1
1337
1351
  }, 8, ["label"])
1338
- ], 64)) : N("", !0),
1339
- S.value === "consent" ? (m(), w(e(M), {
1352
+ ], 64)) : W("", !0),
1353
+ x.value === "consent" ? (m(), _(e(D), {
1340
1354
  key: 1,
1341
1355
  label: e(l)("fields.consent-text"),
1342
1356
  help: e(l)("fields.consent-text-help")
1343
1357
  }, {
1344
1358
  default: d(() => [
1345
- i(Mt, {
1346
- "model-value": p.value.text ?? {},
1359
+ u(Xt, {
1360
+ "model-value": y.value.text ?? {},
1347
1361
  "min-height": "100px",
1348
- "onUpdate:modelValue": s[4] || (s[4] = (r) => O("text", r))
1362
+ "onUpdate:modelValue": r[4] || (r[4] = (s) => L("text", s))
1349
1363
  }, null, 8, ["model-value"])
1350
1364
  ]),
1351
1365
  _: 1
1352
- }, 8, ["label", "help"])) : N("", !0),
1353
- ie.value ? (m(), D("div", Ht, [
1354
- i(e(ee), {
1366
+ }, 8, ["label", "help"])) : W("", !0),
1367
+ be.value ? (m(), M("div", jt, [
1368
+ u(e(ee), {
1355
1369
  size: "sm",
1356
1370
  weight: "medium"
1357
1371
  }, {
1358
1372
  default: d(() => [
1359
- E(I(e(l)("fields.choices")), 1)
1373
+ z(I(e(l)("fields.choices")), 1)
1360
1374
  ]),
1361
1375
  _: 1
1362
1376
  }),
1363
- K.value.length === 0 ? (m(), w(e(ee), {
1377
+ Q.value.length === 0 ? (m(), _(e(ee), {
1364
1378
  key: 0,
1365
1379
  size: "sm",
1366
1380
  tone: "placeholder"
1367
1381
  }, {
1368
1382
  default: d(() => [
1369
- E(I(e(l)("fields.no-choices")), 1)
1383
+ z(I(e(l)("fields.no-choices")), 1)
1370
1384
  ]),
1371
1385
  _: 1
1372
- })) : N("", !0),
1373
- (m(!0), D(Q, null, Pe(K.value, (r, H) => (m(), D("div", {
1374
- key: H,
1386
+ })) : W("", !0),
1387
+ (m(!0), M(Z, null, Oe(Q.value, (s, O) => (m(), M("div", {
1388
+ key: O,
1375
1389
  class: "wx-inbox-choices__row"
1376
1390
  }, [
1377
- i(e(Z), {
1378
- "model-value": r.value,
1391
+ u(e(K), {
1392
+ "model-value": s.value,
1379
1393
  placeholder: e(l)("fields.choice-value"),
1380
- "onUpdate:modelValue": (J) => fe(H, { value: String(J) })
1394
+ "onUpdate:modelValue": (Y) => J(O, { value: String(Y) })
1381
1395
  }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
1382
- i(e(Z), {
1383
- "model-value": r.label,
1396
+ u(e(K), {
1397
+ "model-value": s.label,
1384
1398
  localized: "",
1385
1399
  placeholder: e(l)("fields.choice-label"),
1386
- "onUpdate:modelValue": (J) => fe(H, { label: J })
1400
+ "onUpdate:modelValue": (Y) => J(O, { label: Y })
1387
1401
  }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
1388
- i(e(Me), {
1402
+ u(e(Le), tt({
1389
1403
  icon: "trash",
1390
- title: e(l)("fields.delete"),
1391
- onClick: (J) => Te(H)
1392
- }, null, 8, ["title", "onClick"])
1404
+ tone: "danger",
1405
+ title: e(l)("fields.delete")
1406
+ }, { ref_for: !0 }, e(g), {
1407
+ onClick: (Y) => Se(O)
1408
+ }), null, 16, ["title", "onClick"])
1393
1409
  ]))), 128)),
1394
- i(e(te), {
1410
+ u(e(te), {
1395
1411
  variant: "outline",
1396
1412
  size: "sm",
1397
- onClick: Ve
1413
+ onClick: $e
1398
1414
  }, {
1399
1415
  icon: d(() => [
1400
- i(e(ge), { name: "plus" })
1416
+ u(e(ke), { name: "plus" })
1401
1417
  ]),
1402
1418
  default: d(() => [
1403
- E(" " + I(e(l)("fields.add-choice")), 1)
1419
+ z(" " + I(e(l)("fields.add-choice")), 1)
1404
1420
  ]),
1405
1421
  _: 1
1406
1422
  }),
1407
- j("options.choices") ? (m(), w(e(ee), {
1423
+ ae("options.choices") ? (m(), _(e(ee), {
1408
1424
  key: 1,
1409
1425
  size: "sm",
1410
1426
  tone: "danger"
1411
1427
  }, {
1412
1428
  default: d(() => [
1413
- E(I(j("options.choices")), 1)
1429
+ z(I(ae("options.choices")), 1)
1414
1430
  ]),
1415
1431
  _: 1
1416
- })) : N("", !0)
1417
- ])) : N("", !0),
1418
- G("div", Xt, [
1419
- S.value === "textarea" ? (m(), w(e(M), {
1432
+ })) : W("", !0)
1433
+ ])) : W("", !0),
1434
+ G("div", Kt, [
1435
+ x.value === "textarea" ? (m(), _(e(D), {
1420
1436
  key: 0,
1421
1437
  label: e(l)("fields.rows")
1422
1438
  }, {
1423
1439
  default: d(() => [
1424
- i(e(re), {
1425
- "model-value": p.value.rows ?? 5,
1440
+ u(e(me), {
1441
+ "model-value": y.value.rows ?? 5,
1426
1442
  min: 2,
1427
1443
  max: 30,
1428
- "onUpdate:modelValue": s[5] || (s[5] = (r) => O("rows", r))
1444
+ "onUpdate:modelValue": r[5] || (r[5] = (s) => L("rows", s))
1429
1445
  }, null, 8, ["model-value"])
1430
1446
  ]),
1431
1447
  _: 1
1432
- }, 8, ["label"])) : N("", !0),
1433
- ["text", "email", "textarea"].includes(S.value) ? (m(), w(e(M), {
1448
+ }, 8, ["label"])) : W("", !0),
1449
+ ["text", "email", "textarea"].includes(x.value) ? (m(), _(e(D), {
1434
1450
  key: 1,
1435
1451
  label: e(l)("fields.maxlength")
1436
1452
  }, {
1437
1453
  default: d(() => [
1438
- i(e(re), {
1439
- "model-value": p.value.maxlength ?? null,
1454
+ u(e(me), {
1455
+ "model-value": y.value.maxlength ?? null,
1440
1456
  min: 1,
1441
1457
  max: 2e4,
1442
- "onUpdate:modelValue": s[6] || (s[6] = (r) => O("maxlength", r))
1458
+ "onUpdate:modelValue": r[6] || (r[6] = (s) => L("maxlength", s))
1443
1459
  }, null, 8, ["model-value"])
1444
1460
  ]),
1445
1461
  _: 1
1446
- }, 8, ["label"])) : N("", !0),
1447
- S.value === "tel" ? (m(), w(e(M), {
1462
+ }, 8, ["label"])) : W("", !0),
1463
+ x.value === "tel" ? (m(), _(e(D), {
1448
1464
  key: 2,
1449
1465
  label: e(l)("fields.pattern"),
1450
1466
  help: e(l)("fields.pattern-help")
1451
1467
  }, {
1452
1468
  default: d(() => [
1453
- i(e(Z), {
1454
- "model-value": p.value.pattern ?? "",
1455
- "onUpdate:modelValue": s[7] || (s[7] = (r) => O("pattern", r))
1469
+ u(e(K), {
1470
+ "model-value": y.value.pattern ?? "",
1471
+ "onUpdate:modelValue": r[7] || (r[7] = (s) => L("pattern", s))
1456
1472
  }, null, 8, ["model-value"])
1457
1473
  ]),
1458
1474
  _: 1
1459
- }, 8, ["label", "help"])) : N("", !0),
1460
- S.value === "date" ? (m(), D(Q, { key: 3 }, [
1461
- i(e(M), {
1475
+ }, 8, ["label", "help"])) : W("", !0),
1476
+ x.value === "date" ? (m(), M(Z, { key: 3 }, [
1477
+ u(e(D), {
1462
1478
  label: e(l)("fields.earliest")
1463
1479
  }, {
1464
1480
  default: d(() => [
1465
- i(e(Ne), {
1481
+ u(e(Ue), {
1466
1482
  clearable: "",
1467
- "model-value": p.value.min ?? null,
1468
- "onUpdate:modelValue": s[8] || (s[8] = (r) => O("min", r))
1483
+ "model-value": y.value.min ?? null,
1484
+ "onUpdate:modelValue": r[8] || (r[8] = (s) => L("min", s))
1469
1485
  }, null, 8, ["model-value"])
1470
1486
  ]),
1471
1487
  _: 1
1472
1488
  }, 8, ["label"]),
1473
- i(e(M), {
1489
+ u(e(D), {
1474
1490
  label: e(l)("fields.latest")
1475
1491
  }, {
1476
1492
  default: d(() => [
1477
- i(e(Ne), {
1493
+ u(e(Ue), {
1478
1494
  clearable: "",
1479
- "model-value": p.value.max ?? null,
1480
- "onUpdate:modelValue": s[9] || (s[9] = (r) => O("max", r))
1495
+ "model-value": y.value.max ?? null,
1496
+ "onUpdate:modelValue": r[9] || (r[9] = (s) => L("max", s))
1481
1497
  }, null, 8, ["model-value"])
1482
1498
  ]),
1483
1499
  _: 1
1484
1500
  }, 8, ["label"])
1485
- ], 64)) : N("", !0),
1486
- S.value === "checkbox" ? (m(), D(Q, { key: 4 }, [
1487
- i(e(M), {
1501
+ ], 64)) : W("", !0),
1502
+ x.value === "checkbox" ? (m(), M(Z, { key: 4 }, [
1503
+ u(e(D), {
1488
1504
  label: e(l)("fields.min-choices")
1489
1505
  }, {
1490
1506
  default: d(() => [
1491
- i(e(re), {
1492
- "model-value": p.value.min ?? null,
1507
+ u(e(me), {
1508
+ "model-value": y.value.min ?? null,
1493
1509
  min: 0,
1494
- "onUpdate:modelValue": s[10] || (s[10] = (r) => O("min", r))
1510
+ "onUpdate:modelValue": r[10] || (r[10] = (s) => L("min", s))
1495
1511
  }, null, 8, ["model-value"])
1496
1512
  ]),
1497
1513
  _: 1
1498
1514
  }, 8, ["label"]),
1499
- i(e(M), {
1515
+ u(e(D), {
1500
1516
  label: e(l)("fields.max-choices")
1501
1517
  }, {
1502
1518
  default: d(() => [
1503
- i(e(re), {
1504
- "model-value": p.value.max ?? null,
1519
+ u(e(me), {
1520
+ "model-value": y.value.max ?? null,
1505
1521
  min: 0,
1506
- "onUpdate:modelValue": s[11] || (s[11] = (r) => O("max", r))
1522
+ "onUpdate:modelValue": r[11] || (r[11] = (s) => L("max", s))
1507
1523
  }, null, 8, ["model-value"])
1508
1524
  ]),
1509
1525
  _: 1
1510
1526
  }, 8, ["label"])
1511
- ], 64)) : N("", !0),
1512
- S.value === "file" ? (m(), w(e(M), {
1527
+ ], 64)) : W("", !0),
1528
+ x.value === "file" ? (m(), _(e(D), {
1513
1529
  key: 5,
1514
1530
  label: e(l)("fields.max-size")
1515
1531
  }, {
1516
1532
  default: d(() => [
1517
- i(e(re), {
1518
- "model-value": p.value.max_size ?? null,
1533
+ u(e(me), {
1534
+ "model-value": y.value.max_size ?? null,
1519
1535
  min: 1,
1520
- "onUpdate:modelValue": s[12] || (s[12] = (r) => O("max_size", r))
1536
+ "onUpdate:modelValue": r[12] || (r[12] = (s) => L("max_size", s))
1521
1537
  }, null, 8, ["model-value"])
1522
1538
  ]),
1523
1539
  _: 1
1524
- }, 8, ["label"])) : N("", !0)
1540
+ }, 8, ["label"])) : W("", !0)
1525
1541
  ]),
1526
- S.value === "file" ? (m(), D(Q, { key: 3 }, [
1527
- i(e(M), {
1542
+ x.value === "file" ? (m(), M(Z, { key: 3 }, [
1543
+ u(e(D), {
1528
1544
  label: e(l)("fields.extensions"),
1529
1545
  help: e(l)("fields.extensions-help")
1530
1546
  }, {
1531
1547
  default: d(() => [
1532
- i(e(mt), {
1533
- modelValue: pe.value,
1534
- "onUpdate:modelValue": s[13] || (s[13] = (r) => pe.value = r)
1548
+ u(e(pt), {
1549
+ modelValue: de.value,
1550
+ "onUpdate:modelValue": r[13] || (r[13] = (s) => de.value = s)
1535
1551
  }, null, 8, ["modelValue"])
1536
1552
  ]),
1537
1553
  _: 1
1538
1554
  }, 8, ["label", "help"]),
1539
- i(e(le), {
1540
- "model-value": !!p.value.multiple,
1555
+ u(e(se), {
1556
+ "model-value": !!y.value.multiple,
1541
1557
  label: e(l)("fields.multiple"),
1542
- "onUpdate:modelValue": s[14] || (s[14] = (r) => O("multiple", r))
1558
+ "onUpdate:modelValue": r[14] || (r[14] = (s) => L("multiple", s))
1543
1559
  }, null, 8, ["model-value", "label"])
1544
- ], 64)) : N("", !0),
1545
- G("div", Gt, [
1546
- i(e(le), {
1547
- modelValue: W.value,
1548
- "onUpdate:modelValue": s[15] || (s[15] = (r) => W.value = r),
1560
+ ], 64)) : W("", !0),
1561
+ G("div", Zt, [
1562
+ u(e(se), {
1563
+ modelValue: P.value,
1564
+ "onUpdate:modelValue": r[15] || (r[15] = (s) => P.value = s),
1549
1565
  label: e(l)("fields.is-enabled")
1550
1566
  }, null, 8, ["modelValue", "label"]),
1551
- i(e(le), {
1552
- modelValue: P.value,
1553
- "onUpdate:modelValue": s[16] || (s[16] = (r) => P.value = r),
1567
+ u(e(se), {
1568
+ modelValue: X.value,
1569
+ "onUpdate:modelValue": r[16] || (r[16] = (s) => X.value = s),
1554
1570
  label: e(l)("fields.is-required")
1555
1571
  }, null, 8, ["modelValue", "label"]),
1556
- S.value !== "hidden" ? (m(), w(e(le), {
1572
+ x.value !== "hidden" ? (m(), _(e(se), {
1557
1573
  key: 0,
1558
- modelValue: X.value,
1559
- "onUpdate:modelValue": s[17] || (s[17] = (r) => X.value = r),
1574
+ modelValue: V.value,
1575
+ "onUpdate:modelValue": r[17] || (r[17] = (s) => V.value = s),
1560
1576
  label: e(l)("fields.is-fullsize")
1561
- }, null, 8, ["modelValue", "label"])) : N("", !0),
1562
- i(e(le), {
1563
- modelValue: k.value,
1564
- "onUpdate:modelValue": s[18] || (s[18] = (r) => k.value = r),
1577
+ }, null, 8, ["modelValue", "label"])) : W("", !0),
1578
+ u(e(se), {
1579
+ modelValue: v.value,
1580
+ "onUpdate:modelValue": r[18] || (r[18] = (s) => v.value = s),
1565
1581
  label: e(l)("fields.in-table")
1566
1582
  }, null, 8, ["modelValue", "label"])
1567
1583
  ]),
1568
- G("section", Yt, [
1569
- i(e(ee), {
1584
+ G("section", Qt, [
1585
+ u(e(ee), {
1570
1586
  size: "sm",
1571
1587
  weight: "medium",
1572
1588
  tone: "muted"
1573
1589
  }, {
1574
1590
  default: d(() => [
1575
- E(I(e(l)("fields.advanced")), 1)
1591
+ z(I(e(l)("fields.advanced")), 1)
1576
1592
  ]),
1577
1593
  _: 1
1578
1594
  }),
1579
- i(e(M), {
1595
+ u(e(D), {
1580
1596
  label: e(l)("fields.name"),
1581
- help: e(l)("fields.name-help", { name: $.value.trim() || "name" }),
1582
- error: j("name")
1597
+ help: e(l)("fields.name-help", { name: q.value.trim() || "name" }),
1598
+ error: ae("name")
1583
1599
  }, {
1584
1600
  default: d(() => [
1585
- i(e(Z), {
1586
- "model-value": $.value,
1601
+ u(e(K), {
1602
+ "model-value": q.value,
1587
1603
  placeholder: "phone",
1588
- "onUpdate:modelValue": s[19] || (s[19] = (r) => u(String(r ?? "")))
1604
+ "onUpdate:modelValue": r[19] || (r[19] = (s) => R(String(s ?? "")))
1589
1605
  }, null, 8, ["model-value"])
1590
1606
  ]),
1591
1607
  _: 1
1592
1608
  }, 8, ["label", "help", "error"]),
1593
- R.value ? (m(), w(e(Ce), {
1609
+ ve.value ? (m(), _(e(Ne), {
1594
1610
  key: 0,
1595
1611
  type: "warning",
1596
1612
  variant: "soft",
1597
- description: e(l)("fields.name-renamed", { old: R.value, new: $.value.trim() })
1598
- }, null, 8, ["description"])) : N("", !0)
1613
+ description: e(l)("fields.name-renamed", { old: ve.value, new: q.value.trim() })
1614
+ }, null, 8, ["description"])) : W("", !0)
1599
1615
  ])
1600
1616
  ])
1601
1617
  ]),
1602
1618
  _: 1
1603
1619
  }, 8, ["open", "title"]));
1604
1620
  }
1605
- }), Kt = /* @__PURE__ */ me(jt, [["__scopeId", "data-v-0b8e6619"]]), Zt = { class: "wx-inbox-field" }, Qt = { class: "wx-inbox-field__name" }, Jt = /* @__PURE__ */ ne({
1621
+ }), el = /* @__PURE__ */ fe(Jt, [["__scopeId", "data-v-8b202bc1"]]), tl = { class: "wx-inbox-field" }, ll = { class: "wx-inbox-field__name" }, al = /* @__PURE__ */ oe({
1606
1622
  __name: "FieldList",
1607
- props: /* @__PURE__ */ Fe({
1623
+ props: /* @__PURE__ */ Ie({
1608
1624
  form: {},
1609
1625
  canManage: { type: Boolean }
1610
1626
  }, {
@@ -1613,43 +1629,43 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1613
1629
  }),
1614
1630
  emits: ["update:modelValue"],
1615
1631
  setup(a) {
1616
- const n = a, c = We(a, "modelValue"), y = oe(), b = ke(y), B = se();
1617
- ce();
1618
- const t = ae("webx-inbox"), l = we(), g = Xe(Kt);
1619
- function q(p) {
1620
- return de(p.title, B.active.value, p.key);
1632
+ const n = a, c = Fe(a, "modelValue"), b = re(), w = Te(b), B = ie();
1633
+ he();
1634
+ const t = le("webx-inbox"), l = Ve(), g = Ge(el);
1635
+ function S(k) {
1636
+ return pe(k.title, B.active.value, k.key);
1621
1637
  }
1622
- function z(p) {
1638
+ function N(k) {
1623
1639
  return [
1624
- t(`fields.type-${p.type}`),
1625
- ...p.is_required ? [t("fields.is-required")] : [],
1626
- ...p.in_table ? [t("fields.in-table")] : [],
1627
- ...p.is_fullsize ? [] : [t("fields.is-fullsize")]
1640
+ t(`fields.type-${k.type}`),
1641
+ ...k.is_required ? [t("fields.is-required")] : [],
1642
+ ...k.in_table ? [t("fields.in-table")] : [],
1643
+ ...k.is_fullsize ? [] : [t("fields.is-fullsize")]
1628
1644
  ];
1629
1645
  }
1630
- const $ = T(() => c.value.length === 0);
1631
- async function S(p) {
1632
- const U = c.value.filter((W) => W.id !== p?.id).map((W) => W.key), V = await g({ field: p, form: n.form, taken: U });
1633
- V && (c.value = p === null ? [...c.value, V] : c.value.map((W) => W.id === V.id ? V : W));
1646
+ const C = A(() => c.value.length === 0);
1647
+ async function q(k) {
1648
+ const y = c.value.filter((E) => E.id !== k?.id).map((E) => E.key), $ = await g({ field: k, form: n.form, taken: y });
1649
+ $ && (c.value = k === null ? [...c.value, $] : c.value.map((E) => E.id === $.id ? $ : E));
1634
1650
  }
1635
- async function A(p) {
1636
- if (await Ge({
1637
- title: t("fields.delete-title", { field: q(p) }),
1651
+ async function x(k) {
1652
+ if (await Ye({
1653
+ title: t("fields.delete-title", { field: S(k) }),
1638
1654
  message: t("fields.delete-text"),
1639
1655
  confirmText: t("fields.delete"),
1640
1656
  cancelText: t("fields.cancel"),
1641
1657
  tone: "danger"
1642
1658
  }))
1643
1659
  try {
1644
- await b.removeField(p.id), c.value = c.value.filter((V) => V.id !== p.id), Y.success(t("panel.deleted"));
1645
- } catch (V) {
1646
- Y.danger(l(V));
1660
+ await w.removeField(k.id), c.value = c.value.filter(($) => $.id !== k.id), j.success(t("panel.deleted"));
1661
+ } catch ($) {
1662
+ j.danger(l($));
1647
1663
  }
1648
1664
  }
1649
- function v(p) {
1665
+ function p(k) {
1650
1666
  return n.canManage ? [
1651
1667
  { key: "edit", icon: "edit", label: t("fields.edit"), run: () => {
1652
- S(p);
1668
+ q(k);
1653
1669
  } },
1654
1670
  {
1655
1671
  key: "delete",
@@ -1657,83 +1673,83 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1657
1673
  label: t("fields.delete"),
1658
1674
  danger: !0,
1659
1675
  run: () => {
1660
- A(p);
1676
+ x(k);
1661
1677
  }
1662
1678
  }
1663
1679
  ] : [];
1664
1680
  }
1665
- async function L() {
1681
+ async function H() {
1666
1682
  try {
1667
- await b.sortFields(
1683
+ await w.sortFields(
1668
1684
  n.form.id,
1669
- c.value.map((p) => p.id)
1685
+ c.value.map((k) => k.id)
1670
1686
  );
1671
- } catch (p) {
1672
- Y.danger(l(p, t("panel.reorder-failed")));
1687
+ } catch (k) {
1688
+ j.danger(l(k, t("panel.reorder-failed")));
1673
1689
  }
1674
1690
  }
1675
- return (p, U) => (m(), w(e(pt), {
1691
+ return (k, y) => (m(), _(e(ht), {
1676
1692
  title: e(t)("panel.tab-fields")
1677
- }, Oe({
1693
+ }, De({
1678
1694
  default: d(() => [
1679
- $.value ? (m(), w(e(ft), {
1695
+ C.value ? (m(), _(e(ft), {
1680
1696
  key: 0,
1681
1697
  title: e(t)("fields.no-fields"),
1682
1698
  description: e(t)("fields.no-fields-help")
1683
- }, null, 8, ["title", "description"])) : (m(), w(e(ht), {
1699
+ }, null, 8, ["title", "description"])) : (m(), _(e(vt), {
1684
1700
  key: 1,
1685
1701
  modelValue: c.value,
1686
- "onUpdate:modelValue": U[1] || (U[1] = (V) => c.value = V),
1702
+ "onUpdate:modelValue": y[1] || (y[1] = ($) => c.value = $),
1687
1703
  plain: "",
1688
1704
  "item-key": "id",
1689
- "item-label": q,
1705
+ "item-label": S,
1690
1706
  "drag-label": e(t)("panel.reorder"),
1691
1707
  disabled: !a.canManage,
1692
1708
  "aria-label": e(t)("panel.tab-fields"),
1693
- onMove: L
1709
+ onMove: H
1694
1710
  }, {
1695
- default: d(({ item: V }) => [
1696
- G("div", Zt, [
1697
- G("div", Qt, [
1698
- i(e(ee), {
1711
+ default: d(({ item: $ }) => [
1712
+ G("div", tl, [
1713
+ G("div", ll, [
1714
+ u(e(ee), {
1699
1715
  weight: "medium",
1700
1716
  truncate: ""
1701
1717
  }, {
1702
1718
  default: d(() => [
1703
- E(I(q(V)), 1)
1719
+ z(I(S($)), 1)
1704
1720
  ]),
1705
1721
  _: 2
1706
1722
  }, 1024),
1707
- V.is_enabled ? N("", !0) : (m(), w(e(be), {
1723
+ $.is_enabled ? W("", !0) : (m(), _(e(xe), {
1708
1724
  key: 0,
1709
1725
  type: "default"
1710
1726
  }, {
1711
1727
  default: d(() => [
1712
- E(I(e(t)("panel.off")), 1)
1728
+ z(I(e(t)("panel.off")), 1)
1713
1729
  ]),
1714
1730
  _: 1
1715
1731
  }))
1716
1732
  ]),
1717
- i(e(ee), {
1733
+ u(e(ee), {
1718
1734
  size: "sm",
1719
1735
  tone: "muted",
1720
1736
  truncate: ""
1721
1737
  }, {
1722
1738
  default: d(() => [
1723
- V.name ? (m(), D(Q, { key: 0 }, [
1724
- G("code", null, I(V.name), 1),
1725
- U[2] || (U[2] = E(" · ", -1))
1726
- ], 64)) : N("", !0),
1727
- E(I(z(V).join(" · ")), 1)
1739
+ $.name ? (m(), M(Z, { key: 0 }, [
1740
+ G("code", null, I($.name), 1),
1741
+ y[2] || (y[2] = z(" · ", -1))
1742
+ ], 64)) : W("", !0),
1743
+ z(I(N($).join(" · ")), 1)
1728
1744
  ]),
1729
1745
  _: 2
1730
1746
  }, 1024)
1731
1747
  ])
1732
1748
  ]),
1733
- actions: d(({ item: V }) => [
1734
- i(e(Ue), {
1735
- actions: v(V),
1736
- label: q(V)
1749
+ actions: d(({ item: $ }) => [
1750
+ u(e(We), {
1751
+ actions: p($),
1752
+ label: S($)
1737
1753
  }, null, 8, ["actions", "label"])
1738
1754
  ]),
1739
1755
  _: 1
@@ -1744,16 +1760,16 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1744
1760
  a.canManage ? {
1745
1761
  name: "extra",
1746
1762
  fn: d(() => [
1747
- i(e(te), {
1763
+ u(e(te), {
1748
1764
  type: "primary",
1749
1765
  size: "sm",
1750
- onClick: U[0] || (U[0] = (V) => S(null))
1766
+ onClick: y[0] || (y[0] = ($) => q(null))
1751
1767
  }, {
1752
1768
  icon: d(() => [
1753
- i(e(ge), { name: "plus" })
1769
+ u(e(ke), { name: "plus" })
1754
1770
  ]),
1755
1771
  default: d(() => [
1756
- E(" " + I(e(t)("fields.new-field")), 1)
1772
+ z(" " + I(e(t)("fields.new-field")), 1)
1757
1773
  ]),
1758
1774
  _: 1
1759
1775
  })
@@ -1762,24 +1778,24 @@ const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
1762
1778
  } : void 0
1763
1779
  ]), 1032, ["title"]));
1764
1780
  }
1765
- }), ul = /* @__PURE__ */ me(Jt, [["__scopeId", "data-v-5d9f662e"]]), rl = xe(() => import("./InboxPage-Dd_8TGGg.js")), dl = xe(() => import("./FormEditorPage-HsbIZcG_.js")), cl = xe(() => import("./StatusesPage-DKJmpZoG.js")), ml = xe(() => import("./SubmissionPage-BoE9jEhj.js"));
1781
+ }), ml = /* @__PURE__ */ fe(al, [["__scopeId", "data-v-5d9f662e"]]), pl = _e(() => import("./InboxPage-PAtQ48A2.js")), hl = _e(() => import("./FormEditorPage-CXYnpKAh.js")), fl = _e(() => import("./StatusesPage-xVeRPm4u.js")), vl = _e(() => import("./SubmissionPage-DI8jAaud.js"));
1766
1782
  export {
1767
- ul as F,
1768
- ol as S,
1769
- dl as W,
1770
- me as _,
1771
- Mt as a,
1772
- il as b,
1773
- ke as c,
1774
- Tt as d,
1775
- Dt as e,
1776
- It as f,
1777
- rl as g,
1778
- cl as h,
1779
- ml as i,
1780
- nl as j,
1781
- Vt as k,
1782
- sl as o,
1783
- ce as u
1783
+ ml as F,
1784
+ dl as S,
1785
+ hl as W,
1786
+ fe as _,
1787
+ Xt as a,
1788
+ cl as b,
1789
+ Te as c,
1790
+ Ct as d,
1791
+ Gt as e,
1792
+ Rt as f,
1793
+ pl as g,
1794
+ fl as h,
1795
+ vl as i,
1796
+ rl as j,
1797
+ At as k,
1798
+ ul as o,
1799
+ he as u
1784
1800
  };
1785
- //# sourceMappingURL=index-Dxbb2lUM.js.map
1801
+ //# sourceMappingURL=index-BJ-mLCee.js.map