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