@webx-ui/module-inbox 0.9.0 → 0.9.1

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