@webx-ui/module-admin 0.17.0 → 0.18.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.
package/dist/index.js CHANGED
@@ -1,90 +1,90 @@
1
- import { inject as ne, reactive as he, defineComponent as I, useModel as se, ref as A, watch as Z, computed as w, openBlock as v, createElementBlock as _, createVNode as b, unref as l, withCtx as y, createElementVNode as B, toDisplayString as W, createBlock as T, createTextVNode as V, createCommentVNode as N, mergeModels as ae, useId as kt, Fragment as F, onMounted as Le, renderList as ee, mergeProps as Je, withModifiers as Qe, useSlots as _t, useTemplateRef as Ze, normalizeClass as le, renderSlot as O, createSlots as Ve, provide as et, normalizeProps as $t, guardReactiveProps as Tt, resolveComponent as H, watchEffect as St, onUnmounted as Ct, isRef as tt, createApp as Wt, h as ue, nextTick as at, withKeys as lt, onBeforeUnmount as nt } from "vue";
2
- import { RouterLink as At, useRouter as ye, useRoute as ot, createRouter as Lt, createWebHistory as Vt, onBeforeRouteLeave as zt } from "vue-router";
3
- import { WxSortableList as st, WxAction as ie, WxBadge as ze, WxSelect as Ne, WxInputNumber as Nt, WxSwitch as Me, WxButton as Q, WxSegmented as Ut, WxAutocomplete as Pe, WxText as G, WxInput as be, WxCheckbox as De, WxActions as Et, WxDropdownItem as It, useElementWidth as Rt, WxHeading as Bt, WxIcon as Ue, WxTabs as Mt, WxCard as Ce, WxRichText as Pt, useLocales as it, WxAlert as we, WxResult as Dt, useResponsiveShell as Ft, shellLayoutFor as Ot, WxToaster as Ht, WebxUI as jt, dateLocaleKey as Kt, localesKey as qt, useModal as Yt, WxDialog as rt, WxFormItem as Xt, WxSpace as Gt, createModal as Jt, WxSkeleton as de, WxEmpty as ut, WxTooltip as dt, toast as D, confirm as ge, localizedValue as Qt, WxBreadcrumb as Zt, WxBreadcrumbItem as Fe, WxActionBar as ea, WxPopover as ta, WxAvatar as aa, WxTextarea as Oe } from "@webx-ui/core";
4
- import { watchSystemTheme as la, applyTheme as na, systemTheme as oa } from "@webx-ui/tokens";
5
- import { WxScreenRenderer as sa } from "@webx-ui/schema";
6
- const xe = /* @__PURE__ */ Symbol("webx-i18n");
7
- function ia() {
8
- const e = ne(xe, null);
1
+ import { inject as se, reactive as be, defineComponent as M, useModel as re, ref as L, watch as te, computed as g, openBlock as m, createElementBlock as $, createVNode as w, unref as a, withCtx as y, createElementVNode as B, toDisplayString as A, createBlock as S, createTextVNode as z, createCommentVNode as N, mergeModels as ne, provide as ze, normalizeClass as oe, createSlots as ke, nextTick as Ie, useId as Tt, Fragment as j, onMounted as Ee, renderList as ae, mergeProps as et, withModifiers as tt, useSlots as St, useTemplateRef as lt, renderSlot as Y, normalizeProps as Ct, guardReactiveProps as Wt, resolveComponent as X, watchEffect as At, onUnmounted as Vt, isRef as at, createApp as Lt, h as ce, withKeys as nt, onBeforeUnmount as ot } from "vue";
2
+ import { RouterLink as Nt, useRouter as _e, useRoute as st, createRouter as Rt, createWebHistory as Ut, onBeforeRouteLeave as zt } from "vue-router";
3
+ import { WxSortableList as Be, WxAction as ue, WxBadge as $e, WxSelect as we, WxAutocomplete as Ne, WxSwitch as Ae, WxInputNumber as It, WxButton as le, WxSegmented as Et, WxText as ee, WxInput as Te, WxCheckbox as He, WxActions as Bt, WxDropdownItem as Mt, useElementWidth as Pt, WxHeading as Ft, WxIcon as Me, WxTabs as Ot, WxCard as Re, WxRichText as Dt, useLocales as it, WxAlert as Se, WxResult as Ht, useResponsiveShell as jt, shellLayoutFor as Kt, WxToaster as qt, WebxUI as Yt, dateLocaleKey as Xt, localesKey as Gt, useModal as Jt, WxDialog as rt, WxFormItem as Qt, WxSpace as Zt, createModal as el, WxSkeleton as me, WxEmpty as ut, WxTooltip as dt, toast as K, confirm as xe, localizedValue as tl, WxBreadcrumb as ll, WxBreadcrumbItem as je, WxActionBar as al, WxPopover as nl, WxAvatar as ol, WxTextarea as Ke } from "@webx-ui/core";
4
+ import { watchSystemTheme as sl, applyTheme as il, systemTheme as rl } from "@webx-ui/tokens";
5
+ import { WxScreenRenderer as ul } from "@webx-ui/schema";
6
+ const Ce = /* @__PURE__ */ Symbol("webx-i18n");
7
+ function dl() {
8
+ const e = se(Ce, null);
9
9
  if (e === null)
10
10
  throw new Error("useI18n() was called outside a panel created by createAdmin().");
11
11
  return e;
12
12
  }
13
- function P(e) {
14
- const t = ne(xe, null);
15
- return t === null ? Ee().scope(e) : t.scope(e);
13
+ function O(e) {
14
+ const t = se(Ce, null);
15
+ return t === null ? Pe().scope(e) : t.scope(e);
16
16
  }
17
- function ra(e, t) {
18
- e.provide(xe, t);
17
+ function cl(e, t) {
18
+ e.provide(Ce, t);
19
19
  }
20
- function Ee(e = {}) {
21
- const t = e.fallback ?? "en", a = he({
20
+ function Pe(e = {}) {
21
+ const t = e.fallback ?? "en", l = be({
22
22
  locale: e.locale ?? t,
23
23
  fallback: t,
24
24
  panelLocales: [],
25
25
  contentLocales: []
26
- }), o = {}, s = he({ value: {} });
26
+ }), n = {}, o = be({ value: {} });
27
27
  function i(r, u, d) {
28
28
  let h = r[u]?.[d[0] ?? ""];
29
- for (const m of d.slice(1)) {
29
+ for (const f of d.slice(1)) {
30
30
  if (typeof h != "object" || h === null)
31
31
  return null;
32
- h = h[m];
32
+ h = h[f];
33
33
  }
34
34
  return typeof h == "string" ? h : null;
35
35
  }
36
- function n(r, u, d) {
37
- const [h, m] = u.includes("::") ? u.split("::", 2) : [r, u], f = m.split("."), c = i(s.value, h, f) ?? i(o, h, f) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
36
+ function s(r, u, d) {
37
+ const [h, f] = u.includes("::") ? u.split("::", 2) : [r, u], v = f.split("."), c = i(o.value, h, v) ?? i(n, h, v) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
38
38
  // label says nothing to anybody trying to fix it.
39
39
  u;
40
- return d === void 0 ? c : ua(c, d);
40
+ return d === void 0 ? c : ml(c, d);
41
41
  }
42
42
  return {
43
- state: a,
43
+ state: l,
44
44
  defaults(r, u) {
45
- o[r] = { ...o[r], ...u };
45
+ n[r] = { ...n[r], ...u };
46
46
  },
47
47
  load(r, u, d) {
48
- s.value = r ?? {}, a.locale = u ?? a.locale, d !== void 0 && (a.fallback = d);
48
+ o.value = r ?? {}, l.locale = u ?? l.locale, d !== void 0 && (l.fallback = d);
49
49
  },
50
50
  scope(r) {
51
- return (u, d) => n(r, u, d);
51
+ return (u, d) => s(r, u, d);
52
52
  },
53
- t: (r, u) => n("", r, u)
53
+ t: (r, u) => s("", r, u)
54
54
  };
55
55
  }
56
- function ua(e, t) {
57
- let a = e;
58
- for (const [o, s] of Object.entries(t))
59
- a = a.replaceAll(`:${o}`, String(s));
60
- return a;
56
+ function ml(e, t) {
57
+ let l = e;
58
+ for (const [n, o] of Object.entries(t))
59
+ l = l.replaceAll(`:${n}`, String(o));
60
+ return l;
61
61
  }
62
- function ce(e, t) {
63
- const a = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, o = (s) => s.data;
62
+ function ve(e, t) {
63
+ const l = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, n = (o) => o.data;
64
64
  return {
65
- list: (s = {}) => {
65
+ list: (o = {}) => {
66
66
  const i = new URLSearchParams();
67
- return s.q && i.set("q", s.q), s.visible && i.set("visible", "1"), e.http.get(i.size > 0 ? `${a}?${i}` : a);
67
+ return o.q && i.set("q", o.q), o.visible && i.set("visible", "1"), e.http.get(i.size > 0 ? `${l}?${i}` : l);
68
68
  },
69
- create: (s) => e.http.post(a, s).then(o),
70
- get: (s) => e.http.get(`${a}/${s}`).then(o),
71
- save: (s, i) => e.http.put(`${a}/${s}`, { values: i }).then(o),
72
- remove: (s) => e.http.delete(`${a}/${s}`).then(() => {
69
+ create: (o) => e.http.post(l, o).then(n),
70
+ get: (o) => e.http.get(`${l}/${o}`).then(n),
71
+ save: (o, i) => e.http.put(`${l}/${o}`, { values: i }).then(n),
72
+ remove: (o) => e.http.delete(`${l}/${o}`).then(() => {
73
73
  }),
74
- restore: (s) => e.http.post(`${a}/${s}/restore`, {}).then(o),
75
- reorder: (s) => e.http.post(`${a}/reorder`, { ids: s }).then(() => {
74
+ restore: (o) => e.http.post(`${l}/${o}/restore`, {}).then(n),
75
+ reorder: (o) => e.http.post(`${l}/reorder`, { ids: o }).then(() => {
76
76
  })
77
77
  };
78
78
  }
79
- function da(e, t, a, o = null) {
80
- const s = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
81
- return e.http.post(`${s}/reorder`, o === null ? { ids: a } : { ids: a, category: o }).then(() => {
79
+ function fl(e, t, l, n = null) {
80
+ const o = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
81
+ return e.http.post(`${o}/reorder`, n === null ? { ids: l } : { ids: l, category: n }).then(() => {
82
82
  });
83
83
  }
84
- const ca = { class: "wx-categories-field" }, ma = { class: "wx-categories-field__name" }, fa = /* @__PURE__ */ I({
84
+ const vl = { class: "wx-categories-field" }, pl = { class: "wx-categories-field__name" }, hl = /* @__PURE__ */ M({
85
85
  name: "WxCategoriesField",
86
86
  __name: "CategoriesField",
87
- props: /* @__PURE__ */ ae({
87
+ props: /* @__PURE__ */ ne({
88
88
  source: {},
89
89
  main: { type: Boolean, default: !0 },
90
90
  disabled: { type: Boolean, default: !1 },
@@ -99,12 +99,12 @@ const ca = { class: "wx-categories-field" }, ma = { class: "wx-categories-field_
99
99
  }),
100
100
  emits: ["update:modelValue"],
101
101
  setup(e) {
102
- const t = e, a = se(e, "modelValue"), o = q(), s = P("webx-admin"), i = A([]);
103
- Z(
102
+ const t = e, l = re(e, "modelValue"), n = J(), o = O("webx-admin"), i = L([]);
103
+ te(
104
104
  () => t.source,
105
- async (f) => {
105
+ async (v) => {
106
106
  try {
107
- const c = await ce(o, f).list();
107
+ const c = await ve(n, v).list();
108
108
  i.value = c.data.map((x) => ({ id: x.id, name: x.name }));
109
109
  } catch {
110
110
  i.value = [];
@@ -112,22 +112,22 @@ const ca = { class: "wx-categories-field" }, ma = { class: "wx-categories-field_
112
112
  },
113
113
  { immediate: !0 }
114
114
  );
115
- const n = w(() => Array.isArray(a.value) ? a.value : []), r = w(() => new Map(i.value.map((f) => [f.id, f.name]))), u = w({
116
- get: () => n.value.map((f) => ({ id: f, name: r.value.get(f) ?? `#${f}` })),
117
- set: (f) => {
118
- a.value = f.map((c) => c.id);
115
+ const s = g(() => Array.isArray(l.value) ? l.value : []), r = g(() => new Map(i.value.map((v) => [v.id, v.name]))), u = g({
116
+ get: () => s.value.map((v) => ({ id: v, name: r.value.get(v) ?? `#${v}` })),
117
+ set: (v) => {
118
+ l.value = v.map((c) => c.id);
119
119
  }
120
- }), d = w(
121
- () => i.value.filter((f) => !n.value.includes(f.id)).map((f) => ({ label: f.name, value: f.id }))
120
+ }), d = g(
121
+ () => i.value.filter((v) => !s.value.includes(v.id)).map((v) => ({ label: v.name, value: v.id }))
122
122
  );
123
- function h(f) {
124
- typeof f != "number" || n.value.includes(f) || (a.value = [...n.value, f]);
123
+ function h(v) {
124
+ typeof v != "number" || s.value.includes(v) || (l.value = [...s.value, v]);
125
125
  }
126
- function m(f) {
127
- a.value = n.value.filter((c) => c !== f);
126
+ function f(v) {
127
+ l.value = s.value.filter((c) => c !== v);
128
128
  }
129
- return (f, c) => (v(), _("div", ca, [
130
- b(l(st), {
129
+ return (v, c) => (m(), $("div", vl, [
130
+ w(a(Be), {
131
131
  modelValue: u.value,
132
132
  "onUpdate:modelValue": c[0] || (c[0] = (x) => u.value = x),
133
133
  plain: "",
@@ -135,79 +135,387 @@ const ca = { class: "wx-categories-field" }, ma = { class: "wx-categories-field_
135
135
  "item-key": "id",
136
136
  "item-label": "name",
137
137
  disabled: t.disabled,
138
- "empty-text": t.emptyText ?? l(s)("categories.field-empty")
138
+ "empty-text": t.emptyText ?? a(o)("categories.field-empty")
139
139
  }, {
140
140
  default: y(({ item: x, index: p }) => [
141
- B("span", ma, W(x.name), 1),
142
- t.main && p === 0 ? (v(), T(l(ze), {
141
+ B("span", pl, A(x.name), 1),
142
+ t.main && p === 0 ? (m(), S(a($e), {
143
143
  key: 0,
144
144
  type: "primary"
145
145
  }, {
146
146
  default: y(() => [
147
- V(W(t.mainText ?? l(s)("categories.field-main")), 1)
147
+ z(A(t.mainText ?? a(o)("categories.field-main")), 1)
148
148
  ]),
149
149
  _: 1
150
150
  })) : N("", !0)
151
151
  ]),
152
152
  actions: y(({ item: x }) => [
153
- b(l(ie), {
153
+ w(a(ue), {
154
154
  type: "remove",
155
155
  size: "sm",
156
156
  disabled: t.disabled,
157
- title: t.removeText ?? l(s)("categories.field-remove"),
158
- onClick: (p) => m(x.id)
157
+ title: t.removeText ?? a(o)("categories.field-remove"),
158
+ onClick: (p) => f(x.id)
159
159
  }, null, 8, ["disabled", "title", "onClick"])
160
160
  ]),
161
161
  _: 1
162
162
  }, 8, ["modelValue", "disabled", "empty-text"]),
163
- b(l(Ne), {
163
+ w(a(we), {
164
164
  "model-value": null,
165
165
  options: d.value,
166
- placeholder: t.addText ?? l(s)("categories.field-add"),
166
+ placeholder: t.addText ?? a(o)("categories.field-add"),
167
167
  disabled: t.disabled || d.value.length === 0,
168
- "empty-text": t.noneLeftText ?? l(s)("categories.field-none-left"),
168
+ "empty-text": t.noneLeftText ?? a(o)("categories.field-none-left"),
169
169
  filterable: "",
170
170
  teleport: "",
171
- "aria-label": t.addText ?? l(s)("categories.field-add"),
171
+ "aria-label": t.addText ?? a(o)("categories.field-add"),
172
172
  "onUpdate:modelValue": h
173
173
  }, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
174
174
  ]));
175
175
  }
176
- }), K = (e, t) => {
177
- const a = e.__vccOpts || e;
178
- for (const [o, s] of t)
179
- a[o] = s;
180
- return a;
181
- }, va = /* @__PURE__ */ K(fa, [["__scopeId", "data-v-640cd836"]]), ct = 100, Te = /* @__PURE__ */ new WeakMap();
182
- function pa(e) {
183
- let t = Te.get(e);
184
- return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((a) => a.data), t.catch(() => Te.delete(e)), Te.set(e, t)), t;
176
+ }), G = (e, t) => {
177
+ const l = e.__vccOpts || e;
178
+ for (const [n, o] of t)
179
+ l[n] = o;
180
+ return l;
181
+ }, gl = /* @__PURE__ */ G(hl, [["__scopeId", "data-v-640cd836"]]);
182
+ class fe extends Error {
183
+ constructor(t, l, n = {}, o = null, i = null) {
184
+ super(t), this.status = l, this.errors = n, this.retryAfter = o, this.body = i, this.name = "HttpError";
185
+ }
186
+ status;
187
+ errors;
188
+ retryAfter;
189
+ body;
190
+ /** A failed form rather than a failed request. */
191
+ get isValidation() {
192
+ return this.status === 422;
193
+ }
194
+ get isUnauthenticated() {
195
+ return this.status === 401;
196
+ }
197
+ get isThrottled() {
198
+ return this.status === 429;
199
+ }
200
+ }
201
+ const yl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
202
+ function bl(e = {}) {
203
+ const t = (e.baseUrl ?? "").replace(/\/$/, ""), l = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", n = e.fetch ?? globalThis.fetch.bind(globalThis), o = e.onUnauthenticated, i = e.headers;
204
+ let s = !1;
205
+ async function r(d = !1) {
206
+ s && !d && qe("XSRF-TOKEN") !== null || (await n(l, { credentials: "same-origin" }), s = !0);
207
+ }
208
+ async function u(d, h, f, v = {}, c = !1) {
209
+ const x = yl.has(d);
210
+ x && await r();
211
+ const p = {
212
+ Accept: "application/json",
213
+ "X-Requested-With": "XMLHttpRequest",
214
+ // Standing headers first, so a caller can still override one for a single request.
215
+ ...i?.(),
216
+ ...v.headers
217
+ };
218
+ if (x) {
219
+ const T = qe("XSRF-TOKEN");
220
+ T !== null && (p["X-XSRF-TOKEN"] = T);
221
+ }
222
+ f !== void 0 && (p["Content-Type"] = "application/json");
223
+ const b = await n(xl(t, h, v.query), {
224
+ method: d,
225
+ credentials: "same-origin",
226
+ headers: p,
227
+ signal: v.signal,
228
+ body: f === void 0 ? void 0 : JSON.stringify(f)
229
+ });
230
+ if (b.status === 419 && x && !c)
231
+ return await r(!0), u(d, h, f, v, !0);
232
+ if (b.status === 401 && o?.(), !b.ok)
233
+ throw await wl(b);
234
+ if (b.status !== 204)
235
+ return await b.json();
236
+ }
237
+ return {
238
+ get: (d, h) => u("GET", d, void 0, h),
239
+ post: (d, h, f) => u("POST", d, h, f),
240
+ put: (d, h, f) => u("PUT", d, h, f),
241
+ patch: (d, h, f) => u("PATCH", d, h, f),
242
+ delete: (d, h) => u("DELETE", d, void 0, h)
243
+ };
244
+ }
245
+ async function wl(e) {
246
+ let t = null;
247
+ try {
248
+ t = await e.json();
249
+ } catch {
250
+ }
251
+ const l = t ?? {}, n = typeof l.message == "string" && l.message !== "" ? l.message : e.statusText || `Request failed with ${e.status}`, o = l.errors !== null && typeof l.errors == "object" ? l.errors : {}, i = e.headers.get("Retry-After"), s = i === null ? null : Number.parseInt(i, 10);
252
+ return new fe(
253
+ n,
254
+ e.status,
255
+ o,
256
+ Number.isFinite(s) ? s : null,
257
+ t
258
+ );
259
+ }
260
+ function xl(e, t, l) {
261
+ const o = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
262
+ if (l === void 0)
263
+ return o;
264
+ const i = new URLSearchParams();
265
+ for (const [r, u] of Object.entries(l))
266
+ u != null && i.set(r, String(u));
267
+ const s = i.toString();
268
+ return s === "" ? o : `${o}${o.includes("?") ? "&" : "?"}${s}`;
269
+ }
270
+ function qe(e) {
271
+ if (typeof document > "u")
272
+ return null;
273
+ for (const t of document.cookie.split(";")) {
274
+ const [l, ...n] = t.trim().split("=");
275
+ if (l === e)
276
+ return decodeURIComponent(n.join("="));
277
+ }
278
+ return null;
279
+ }
280
+ function kl(e, t) {
281
+ const l = `${e.apiPath}/relations/${encodeURIComponent(t)}`;
282
+ return {
283
+ search: (n) => e.http.get(l, { query: { q: n } }).then((o) => o.data),
284
+ named: (n) => n.length === 0 ? Promise.resolve([]) : e.http.get(`${l}?${n.map((o) => `ids[]=${o}`).join("&")}`).then((o) => o.data)
285
+ };
286
+ }
287
+ function _l(e) {
288
+ return Array.isArray(e) ? [...new Set(e.map(Number).filter((t) => Number.isInteger(t) && t > 0))] : [];
289
+ }
290
+ const ct = /* @__PURE__ */ Symbol("wx-relation-owner");
291
+ function zn(e) {
292
+ ze(ct, e);
293
+ }
294
+ function $l() {
295
+ return se(ct, null);
296
+ }
297
+ const Tl = ["src"], Sl = { class: "wx-relations-field__text" }, Cl = { class: "wx-relations-field__title" }, Wl = {
298
+ key: 0,
299
+ class: "wx-relations-field__subtitle"
300
+ }, Al = {
301
+ key: 0,
302
+ class: "wx-relations-field__note"
303
+ }, Vl = {
304
+ key: 1,
305
+ class: "wx-relations-field__add"
306
+ }, Ll = /* @__PURE__ */ M({
307
+ name: "WxRelationsField",
308
+ __name: "RelationsField",
309
+ props: /* @__PURE__ */ ne({
310
+ target: {},
311
+ max: { default: null },
312
+ sortable: { type: Boolean, default: !0 },
313
+ disabled: { type: Boolean, default: !1 },
314
+ addText: { default: void 0 },
315
+ emptyText: { default: void 0 }
316
+ }, {
317
+ modelValue: { default: () => [] },
318
+ modelModifiers: {}
319
+ }),
320
+ emits: ["update:modelValue"],
321
+ setup(e) {
322
+ const t = e, l = re(e, "modelValue"), n = J(), o = $l(), i = O("webx-admin"), s = g(() => kl(n, t.target)), r = L(/* @__PURE__ */ new Map()), u = L(/* @__PURE__ */ new Set()), d = L(!1), h = L([]), f = L(!1), v = L(""), c = g(() => _l(l.value));
323
+ function x(R) {
324
+ const U = new Map(r.value);
325
+ for (const I of R) U.set(I.id, I);
326
+ r.value = U;
327
+ }
328
+ async function p(R) {
329
+ const U = R.filter((I) => !r.value.has(I) && !u.value.has(I));
330
+ if (!(U.length === 0 || d.value))
331
+ try {
332
+ const I = await s.value.named(U);
333
+ x(I);
334
+ const de = new Set(I.map((ie) => ie.id));
335
+ u.value = /* @__PURE__ */ new Set([...u.value, ...U.filter((ie) => !de.has(ie))]);
336
+ } catch (I) {
337
+ I instanceof fe && I.status === 403 && (d.value = !0);
338
+ }
339
+ }
340
+ te(
341
+ () => t.target,
342
+ () => {
343
+ r.value = /* @__PURE__ */ new Map(), u.value = /* @__PURE__ */ new Set(), d.value = !1, h.value = [], p(c.value);
344
+ }
345
+ ), te(c, (R) => {
346
+ p(R);
347
+ }, { immediate: !0 });
348
+ const b = g({
349
+ get: () => c.value.map((R) => {
350
+ const U = r.value.get(R) ?? null;
351
+ return { id: R, title: U?.title || `#${R}`, candidate: U };
352
+ }),
353
+ set: (R) => {
354
+ l.value = R.map((U) => U.id);
355
+ }
356
+ }), T = g(() => t.max !== null && c.value.length >= t.max), F = g(() => o !== null && o.type === t.target ? o.id.value : null), Q = g(
357
+ () => h.value.filter((R) => R.id !== F.value && !c.value.includes(R.id)).map((R) => ({
358
+ value: R.title,
359
+ description: [R.subtitle, R.visible ? null : i("relations.field-hidden")].filter((U) => typeof U == "string" && U !== "").join(" · "),
360
+ id: R.id
361
+ }))
362
+ );
363
+ async function H(R) {
364
+ f.value = !0;
365
+ try {
366
+ const U = await s.value.search(R);
367
+ h.value = U, x(U);
368
+ } catch (U) {
369
+ h.value = [], U instanceof fe && U.status === 403 && (d.value = !0);
370
+ } finally {
371
+ f.value = !1;
372
+ }
373
+ }
374
+ function V(R) {
375
+ const U = Number(R.id);
376
+ !Number.isInteger(U) || c.value.includes(U) || T.value || (l.value = [...c.value, U], Ie(() => {
377
+ v.value = "";
378
+ }));
379
+ }
380
+ function k(R) {
381
+ l.value = c.value.filter((U) => U !== R);
382
+ }
383
+ const C = g(() => t.disabled || d.value), _ = g(
384
+ () => T.value ? i("relations.field-full", { max: String(t.max) }) : t.addText ?? i("relations.field-add")
385
+ );
386
+ function q(R) {
387
+ return R.candidate === null ? u.value.has(R.id) ? i("relations.field-missing") : null : R.candidate.trashed === !0 ? i("relations.field-trashed") : R.candidate.visible ? null : i("relations.field-hidden");
388
+ }
389
+ return (R, U) => (m(), $("div", {
390
+ class: oe(["wx-relations-field", { "is-unordered": !t.sortable }])
391
+ }, [
392
+ w(a(Be), {
393
+ modelValue: b.value,
394
+ "onUpdate:modelValue": U[0] || (U[0] = (I) => b.value = I),
395
+ plain: "",
396
+ size: "sm",
397
+ "item-key": "id",
398
+ "item-label": "title",
399
+ disabled: C.value || !t.sortable,
400
+ "empty-text": t.emptyText ?? a(i)("relations.field-empty"),
401
+ "drag-label": a(i)("relations.field-drag")
402
+ }, ke({
403
+ default: y(({ item: I }) => [
404
+ I.candidate?.thumb ? (m(), $("img", {
405
+ key: 0,
406
+ class: "wx-relations-field__thumb",
407
+ src: I.candidate.thumb,
408
+ alt: ""
409
+ }, null, 8, Tl)) : N("", !0),
410
+ B("span", Sl, [
411
+ B("span", Cl, A(I.title), 1),
412
+ I.candidate?.subtitle ? (m(), $("span", Wl, A(I.candidate.subtitle), 1)) : N("", !0)
413
+ ]),
414
+ q(I) ? (m(), S(a($e), {
415
+ key: 1,
416
+ type: "warning"
417
+ }, {
418
+ default: y(() => [
419
+ z(A(q(I)), 1)
420
+ ]),
421
+ _: 2
422
+ }, 1024)) : N("", !0)
423
+ ]),
424
+ _: 2
425
+ }, [
426
+ C.value ? void 0 : {
427
+ name: "actions",
428
+ fn: y(({ item: I }) => [
429
+ w(a(ue), {
430
+ type: "remove",
431
+ size: "sm",
432
+ title: a(i)("relations.field-remove"),
433
+ onClick: (de) => k(I.id)
434
+ }, null, 8, ["title", "onClick"])
435
+ ]),
436
+ key: "0"
437
+ }
438
+ ]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
439
+ d.value ? (m(), $("p", Al, A(a(i)("relations.field-forbidden")), 1)) : (m(), $("div", Vl, [
440
+ w(a(Ne), {
441
+ modelValue: v.value,
442
+ "onUpdate:modelValue": U[1] || (U[1] = (I) => v.value = I),
443
+ options: Q.value,
444
+ remote: "",
445
+ teleport: "",
446
+ loading: f.value,
447
+ "loading-text": a(i)("relations.field-searching"),
448
+ "empty-text": a(i)("relations.field-nothing"),
449
+ placeholder: _.value,
450
+ "aria-label": _.value,
451
+ disabled: t.disabled || T.value,
452
+ onSearch: H,
453
+ onSelect: V
454
+ }, null, 8, ["modelValue", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
455
+ ]))
456
+ ], 2));
457
+ }
458
+ }), mt = /* @__PURE__ */ G(Ll, [["__scopeId", "data-v-5ecf0e47"]]), ft = 100, Ve = /* @__PURE__ */ new WeakMap();
459
+ function Nl(e) {
460
+ let t = Ve.get(e);
461
+ return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((l) => l.data.map((n) => ({ ...n, relations: Rl(n) }))), t.catch(() => Ve.delete(e)), Ve.set(e, t)), t;
185
462
  }
186
- function He(e) {
187
- const t = typeof e == "object" && e !== null && !Array.isArray(e) ? e : {}, a = Array.isArray(t.categories) ? [...new Set(t.categories.map(Number).filter((s) => Number.isInteger(s) && s > 0))] : [], o = typeof t.limit == "number" && Number.isInteger(t.limit) ? t.limit : null;
463
+ function Rl(e) {
464
+ return Array.isArray(e.relations) ? e.relations.flatMap((t) => {
465
+ if (typeof t == "string") return t === "" ? [] : [{ key: t, title: t }];
466
+ if (typeof t == "object" && t !== null && typeof t.key == "string") {
467
+ const { key: l, title: n } = t;
468
+ return [{ key: l, title: typeof n == "string" && n !== "" ? n : l }];
469
+ }
470
+ return [];
471
+ }) : [];
472
+ }
473
+ function vt(e) {
474
+ return Array.isArray(e) ? [...new Set(e.map(Number).filter((t) => Number.isInteger(t) && t > 0))].sort(
475
+ (t, l) => t - l
476
+ ) : [];
477
+ }
478
+ function Ul(e) {
479
+ if (typeof e != "object" || e === null || Array.isArray(e)) return null;
480
+ const {
481
+ type: t,
482
+ ids: l,
483
+ current: n
484
+ } = e;
485
+ if (n === !0 && typeof t == "string" && t !== "")
486
+ return { type: t, ids: [], current: !0 };
487
+ const o = vt(l);
488
+ return typeof t == "string" && t !== "" && o.length > 0 ? { type: t, ids: o } : null;
489
+ }
490
+ function Ye(e) {
491
+ const t = typeof e == "object" && e !== null && !Array.isArray(e) ? e : {}, l = typeof t.limit == "number" && Number.isInteger(t.limit) ? t.limit : null;
188
492
  return {
189
- categories: a.sort((s, i) => s - i),
190
- limit: o !== null && o >= 1 ? Math.min(o, ct) : null,
493
+ categories: vt(t.categories),
494
+ related: Ul(t.related),
495
+ limit: l !== null && l >= 1 ? Math.min(l, ft) : null,
191
496
  filter: t.filter === !0,
192
497
  markup: typeof t.markup == "boolean" ? t.markup : null
193
498
  };
194
499
  }
195
- function je(e) {
196
- return e.categories.length === 0;
500
+ function Xe(e) {
501
+ return e.categories.length === 0 && e.related === null;
197
502
  }
198
- const ha = ["aria-busy"], ga = {
503
+ const zl = ["aria-busy"], Il = {
199
504
  key: 0,
200
505
  class: "wx-collection-field__note"
201
- }, ya = { class: "wx-collection-field__note" }, ba = {
506
+ }, El = { class: "wx-collection-field__note" }, Bl = {
202
507
  key: 0,
203
508
  class: "wx-collection-field__row"
204
- }, wa = ["for"], xa = { class: "wx-collection-field__row" }, ka = ["for"], _a = { class: "wx-collection-field__limit" }, $a = {
205
- key: 2,
509
+ }, Ml = ["for"], Pl = {
510
+ key: 1,
511
+ class: "wx-collection-field__row"
512
+ }, Fl = { class: "wx-collection-field__label" }, Ol = { class: "wx-collection-field__hint" }, Dl = { class: "wx-collection-field__row" }, Hl = ["for"], jl = { class: "wx-collection-field__limit" }, Kl = {
513
+ key: 3,
206
514
  class: "wx-collection-field__markup"
207
- }, Ta = { class: "wx-collection-field__hint" }, Sa = /* @__PURE__ */ I({
515
+ }, ql = { class: "wx-collection-field__hint" }, Yl = /* @__PURE__ */ M({
208
516
  name: "WxCollectionField",
209
517
  __name: "CollectionField",
210
- props: /* @__PURE__ */ ae({
518
+ props: /* @__PURE__ */ ne({
211
519
  source: {},
212
520
  disabled: { type: Boolean, default: !1 }
213
521
  }, {
@@ -216,127 +524,178 @@ const ha = ["aria-busy"], ga = {
216
524
  }),
217
525
  emits: ["update:modelValue"],
218
526
  setup(e) {
219
- const t = e, a = se(e, "modelValue"), o = q(), s = P("webx-admin"), i = kt(), n = A(void 0), r = A([]);
220
- Z(
527
+ const t = e, l = re(e, "modelValue"), n = J(), o = O("webx-admin"), i = Tt(), s = L(void 0), r = L([]);
528
+ te(
221
529
  () => t.source,
222
- async (g) => {
223
- n.value = void 0, r.value = [];
530
+ async (k) => {
531
+ s.value = void 0, r.value = [];
224
532
  try {
225
- n.value = (await pa(o)).find((k) => k.key === g) ?? null;
533
+ s.value = (await Nl(n)).find((C) => C.key === k) ?? null;
226
534
  } catch {
227
- n.value = null;
535
+ s.value = null;
228
536
  }
229
- if (n.value?.categories)
537
+ if (s.value?.categories)
230
538
  try {
231
- const k = await ce(o, n.value.categories).list();
232
- r.value = k.data.map((U) => ({ label: U.name, value: U.id }));
539
+ const C = await ve(n, s.value.categories).list();
540
+ r.value = C.data.map((_) => ({ label: _.name, value: _.id }));
233
541
  } catch {
234
542
  r.value = [];
235
543
  }
236
544
  },
237
545
  { immediate: !0 }
238
546
  );
239
- const u = w(() => He(a.value));
240
- function d(g) {
241
- a.value = He({ ...u.value, ...g });
547
+ const u = g(() => Ye(l.value));
548
+ function d(k) {
549
+ l.value = Ye({ ...u.value, ...k });
550
+ }
551
+ const h = g(() => {
552
+ const k = new Set(r.value.map((_) => _.value)), C = u.value.categories.filter((_) => !k.has(_)).map((_) => ({ label: `#${_}`, value: _ }));
553
+ return [...r.value, ...C];
554
+ });
555
+ function f(k) {
556
+ d({ categories: Array.isArray(k) ? k.map(Number) : [] });
242
557
  }
243
- const h = w(() => {
244
- const g = new Set(r.value.map((U) => U.value)), k = u.value.categories.filter((U) => !g.has(U)).map((U) => ({ label: `#${U}`, value: U }));
245
- return [...r.value, ...k];
558
+ function v(k) {
559
+ d({ limit: k ?? null });
560
+ }
561
+ const c = L(null), x = g(
562
+ () => (s.value?.relations ?? []).map((k) => ({ label: k.title, value: k.key }))
563
+ ), p = g(() => {
564
+ const k = s.value?.relations ?? [];
565
+ if (k.length === 1) return k[0];
566
+ const C = u.value.related?.type ?? c.value;
567
+ return k.find((_) => _.key === C) ?? null;
246
568
  });
247
- function m(g) {
248
- d({ categories: Array.isArray(g) ? g.map(Number) : [] });
569
+ function b(k) {
570
+ c.value = typeof k == "string" ? k : null, d({ related: null });
571
+ }
572
+ function T(k) {
573
+ const C = p.value?.key;
574
+ d({ related: C && k && k.length > 0 ? { type: C, ids: k } : null });
249
575
  }
250
- function f(g) {
251
- d({ limit: g ?? null });
576
+ function F(k) {
577
+ const C = p.value?.key;
578
+ d({ related: k && C ? { type: C, ids: [], current: !0 } : null });
252
579
  }
253
- const c = w(() => u.value.markup ?? je(u.value));
254
- function x(g) {
255
- d({ markup: g === !0 });
580
+ const Q = g(() => u.value.markup ?? Xe(u.value));
581
+ function H(k) {
582
+ d({ markup: k === !0 });
256
583
  }
257
- const p = w(
258
- () => s(
259
- je(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
584
+ const V = g(
585
+ () => o(
586
+ Xe(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
260
587
  )
261
588
  );
262
- return (g, k) => (v(), _("div", {
589
+ return (k, C) => (m(), $("div", {
263
590
  class: "wx-collection-field",
264
- "aria-busy": n.value === void 0
591
+ "aria-busy": s.value === void 0
265
592
  }, [
266
- n.value === null ? (v(), _("p", ga, W(l(s)("collections.field-unavailable", { source: t.source })), 1)) : n.value ? (v(), _(F, { key: 1 }, [
267
- B("p", ya, W(l(s)("collections.field-source", { source: n.value.title })), 1),
268
- n.value.categories ? (v(), _("div", ba, [
593
+ s.value === null ? (m(), $("p", Il, A(a(o)("collections.field-unavailable", { source: t.source })), 1)) : s.value ? (m(), $(j, { key: 1 }, [
594
+ B("p", El, A(a(o)("collections.field-source", { source: s.value.title })), 1),
595
+ s.value.categories ? (m(), $("div", Bl, [
269
596
  B("label", {
270
597
  class: "wx-collection-field__label",
271
- for: `${l(i)}-categories`
272
- }, W(l(s)("collections.field-categories")), 9, wa),
273
- b(l(Ne), {
274
- id: `${l(i)}-categories`,
598
+ for: `${a(i)}-categories`
599
+ }, A(a(o)("collections.field-categories")), 9, Ml),
600
+ w(a(we), {
601
+ id: `${a(i)}-categories`,
275
602
  "model-value": u.value.categories,
276
603
  options: h.value,
277
- placeholder: u.value.categories.length === 0 ? l(s)("collections.field-all") : "",
278
- "empty-text": l(s)("collections.field-no-categories"),
604
+ placeholder: u.value.categories.length === 0 ? a(o)("collections.field-all") : "",
605
+ "empty-text": a(o)("collections.field-no-categories"),
279
606
  disabled: t.disabled,
280
607
  multiple: "",
281
608
  filterable: "",
282
609
  clearable: "",
283
610
  teleport: "",
284
- "onUpdate:modelValue": m
611
+ "onUpdate:modelValue": f
285
612
  }, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
286
613
  ])) : N("", !0),
287
- B("div", xa, [
614
+ s.value.relations.length > 0 ? (m(), $("div", Pl, [
615
+ B("span", Fl, A(s.value.relations.length === 1 ? a(o)("relations.collection-related-to", { target: s.value.relations[0].title }) : a(o)("relations.collection-related")), 1),
616
+ s.value.relations.length > 1 ? (m(), S(a(we), {
617
+ key: 0,
618
+ "model-value": p.value?.key ?? null,
619
+ options: x.value,
620
+ placeholder: a(o)("relations.collection-related-type"),
621
+ "aria-label": a(o)("relations.collection-related-type"),
622
+ disabled: t.disabled,
623
+ clearable: "",
624
+ teleport: "",
625
+ "onUpdate:modelValue": b
626
+ }, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : N("", !0),
627
+ p.value ? (m(), $(j, { key: 1 }, [
628
+ w(a(Ae), {
629
+ "model-value": u.value.related?.current === !0,
630
+ label: a(o)("relations.collection-related-current"),
631
+ disabled: t.disabled,
632
+ "onUpdate:modelValue": C[0] || (C[0] = (_) => F(_ === !0))
633
+ }, null, 8, ["model-value", "label", "disabled"]),
634
+ B("p", Ol, A(a(o)("relations.collection-related-current-hint", { target: p.value.title })), 1)
635
+ ], 64)) : N("", !0),
636
+ p.value && u.value.related?.current !== !0 ? (m(), S(mt, {
637
+ key: 2,
638
+ "model-value": u.value.related?.ids ?? [],
639
+ target: p.value.key,
640
+ sortable: !1,
641
+ "empty-text": a(o)("relations.collection-related-any"),
642
+ disabled: t.disabled,
643
+ "onUpdate:modelValue": T
644
+ }, null, 8, ["model-value", "target", "empty-text", "disabled"])) : N("", !0)
645
+ ])) : N("", !0),
646
+ B("div", Dl, [
288
647
  B("label", {
289
648
  class: "wx-collection-field__label",
290
- for: `${l(i)}-limit`
291
- }, W(l(s)("collections.field-limit")), 9, ka),
292
- B("div", _a, [
293
- b(l(Nt), {
294
- id: `${l(i)}-limit`,
649
+ for: `${a(i)}-limit`
650
+ }, A(a(o)("collections.field-limit")), 9, Hl),
651
+ B("div", jl, [
652
+ w(a(It), {
653
+ id: `${a(i)}-limit`,
295
654
  "model-value": u.value.limit,
296
655
  min: 1,
297
- max: l(ct),
656
+ max: a(ft),
298
657
  step: 1,
299
658
  precision: 0,
300
- placeholder: l(s)("collections.field-limit-all"),
659
+ placeholder: a(o)("collections.field-limit-all"),
301
660
  disabled: t.disabled,
302
- "onUpdate:modelValue": f
661
+ "onUpdate:modelValue": v
303
662
  }, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
304
663
  ])
305
664
  ]),
306
- n.value.categories ? (v(), T(l(Me), {
307
- key: 1,
665
+ s.value.categories ? (m(), S(a(Ae), {
666
+ key: 2,
308
667
  "model-value": u.value.filter,
309
- label: l(s)("collections.field-filter"),
668
+ label: a(o)("collections.field-filter"),
310
669
  disabled: t.disabled,
311
- "onUpdate:modelValue": k[0] || (k[0] = (U) => d({ filter: U === !0 }))
670
+ "onUpdate:modelValue": C[1] || (C[1] = (_) => d({ filter: _ === !0 }))
312
671
  }, null, 8, ["model-value", "label", "disabled"])) : N("", !0),
313
- n.value.markup ? (v(), _("div", $a, [
314
- b(l(Me), {
315
- "model-value": c.value,
316
- label: l(s)("collections.field-markup"),
672
+ s.value.markup ? (m(), $("div", Kl, [
673
+ w(a(Ae), {
674
+ "model-value": Q.value,
675
+ label: a(o)("collections.field-markup"),
317
676
  disabled: t.disabled,
318
- "onUpdate:modelValue": x
677
+ "onUpdate:modelValue": H
319
678
  }, null, 8, ["model-value", "label", "disabled"]),
320
- B("p", Ta, W(p.value), 1),
321
- u.value.markup !== null ? (v(), T(l(Q), {
679
+ B("p", ql, A(V.value), 1),
680
+ u.value.markup !== null ? (m(), S(a(le), {
322
681
  key: 0,
323
682
  class: "wx-collection-field__reset",
324
683
  variant: "text",
325
684
  size: "sm",
326
685
  disabled: t.disabled,
327
- onClick: k[1] || (k[1] = (U) => d({ markup: null }))
686
+ onClick: C[2] || (C[2] = (_) => d({ markup: null }))
328
687
  }, {
329
688
  default: y(() => [
330
- V(W(l(s)("collections.field-markup-reset")), 1)
689
+ z(A(a(o)("collections.field-markup-reset")), 1)
331
690
  ]),
332
691
  _: 1
333
692
  }, 8, ["disabled"])) : N("", !0)
334
693
  ])) : N("", !0)
335
694
  ], 64)) : N("", !0)
336
- ], 8, ha));
695
+ ], 8, zl));
337
696
  }
338
- }), Ca = /* @__PURE__ */ K(Sa, [["__scopeId", "data-v-e86461fd"]]);
339
- function Wa() {
697
+ }), Xl = /* @__PURE__ */ G(Yl, [["__scopeId", "data-v-023ad095"]]);
698
+ function Gl() {
340
699
  return {
341
700
  target: "entity",
342
701
  entity_type: null,
@@ -347,31 +706,31 @@ function Wa() {
347
706
  rel: []
348
707
  };
349
708
  }
350
- function Aa(e) {
351
- const t = `${e.apiPath}/links`, a = (o) => o.data;
709
+ function Jl(e) {
710
+ const t = `${e.apiPath}/links`, l = (n) => n.data;
352
711
  return {
353
- sources: () => e.http.get(`${t}/sources`).then(a),
354
- search: (o, s, i) => e.http.get(`${t}/search`, { query: { type: o, q: s, locale: i } }).then(a),
355
- resolve: (o, s) => e.http.post(`${t}/resolve`, { links: o, locale: s }).then(a),
356
- routes: () => e.http.get(`${t}/routes`).then(a)
712
+ sources: () => e.http.get(`${t}/sources`).then(l),
713
+ search: (n, o, i) => e.http.get(`${t}/search`, { query: { type: n, q: o, locale: i } }).then(l),
714
+ resolve: (n, o) => e.http.post(`${t}/resolve`, { links: n, locale: o }).then(l),
715
+ routes: () => e.http.get(`${t}/routes`).then(l)
357
716
  };
358
717
  }
359
- const La = { class: "wx-link-picker" }, Va = {
718
+ const Ql = { class: "wx-link-picker" }, Zl = {
360
719
  key: 0,
361
720
  class: "wx-link-picker__entity"
362
- }, za = {
721
+ }, ea = {
363
722
  key: 1,
364
723
  class: "wx-link-picker__url"
365
- }, Na = {
724
+ }, ta = {
366
725
  key: 2,
367
726
  class: "wx-link-picker__hash"
368
- }, Ua = {
727
+ }, la = {
369
728
  key: 3,
370
729
  class: "wx-link-picker__attributes"
371
- }, Ea = { class: "wx-link-picker__rel" }, Ia = /* @__PURE__ */ I({
730
+ }, aa = { class: "wx-link-picker__rel" }, na = /* @__PURE__ */ M({
372
731
  name: "WxLinkPicker",
373
732
  __name: "LinkPicker",
374
- props: /* @__PURE__ */ ae({
733
+ props: /* @__PURE__ */ ne({
375
734
  allowNone: { type: Boolean, default: !0 },
376
735
  attributes: { type: Boolean, default: !0 },
377
736
  disabled: { type: Boolean, default: !1 }
@@ -381,195 +740,195 @@ const La = { class: "wx-link-picker" }, Va = {
381
740
  }),
382
741
  emits: ["update:modelValue"],
383
742
  setup(e) {
384
- const t = e, a = se(e, "modelValue"), o = q(), s = ia(), i = Aa(o), n = P("webx-admin"), r = A([]), u = A([]), d = A([]), h = A(!1), m = A(null), f = A(""), c = A(null);
743
+ const t = e, l = re(e, "modelValue"), n = J(), o = dl(), i = Jl(n), s = O("webx-admin"), r = L([]), u = L([]), d = L([]), h = L(!1), f = L(null), v = L(""), c = L(null);
385
744
  let x = null;
386
- const p = w(() => a.value ?? Wa()), g = w(() => {
387
- const $ = [
388
- { value: "entity", label: n("links.target-entity") },
389
- { value: "url", label: n("links.target-url") }
745
+ const p = g(() => l.value ?? Gl()), b = g(() => {
746
+ const W = [
747
+ { value: "entity", label: s("links.target-entity") },
748
+ { value: "url", label: s("links.target-url") }
390
749
  ];
391
- return t.allowNone ? [...$, { value: "none", label: n("links.target-none") }] : $;
392
- }), k = w(
393
- () => r.value.map(($) => ({ value: $.type, label: $.title }))
394
- ), U = w(
395
- () => u.value.map(($) => ({
396
- value: $.title,
397
- description: z($),
398
- id: $.id
750
+ return t.allowNone ? [...W, { value: "none", label: s("links.target-none") }] : W;
751
+ }), T = g(
752
+ () => r.value.map((W) => ({ value: W.type, label: W.title }))
753
+ ), F = g(
754
+ () => u.value.map((W) => ({
755
+ value: W.title,
756
+ description: E(W),
757
+ id: W.id
399
758
  }))
400
- ), J = w(
401
- () => d.value.map(($) => ({ value: $.path, description: $.name }))
759
+ ), Q = g(
760
+ () => d.value.map((W) => ({ value: W.path, description: W.name }))
402
761
  );
403
- Le(async () => {
404
- r.value = await i.sources(), m.value = p.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([j(), C()]);
405
- }), Z(
762
+ Ee(async () => {
763
+ r.value = await i.sources(), f.value = p.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([H(), V()]);
764
+ }), te(
406
765
  () => [p.value.entity_type, p.value.entity_id].join(":"),
407
766
  () => {
408
- j();
767
+ H();
409
768
  }
410
769
  );
411
- async function j() {
412
- const { entity_type: $, entity_id: R } = p.value;
413
- if ($ === null || R === null) {
414
- c.value = null, f.value = "";
770
+ async function H() {
771
+ const { entity_type: W, entity_id: P } = p.value;
772
+ if (W === null || P === null) {
773
+ c.value = null, v.value = "";
415
774
  return;
416
775
  }
417
- if (c.value?.id === R)
776
+ if (c.value?.id === P)
418
777
  return;
419
- const [M] = await i.resolve([{ type: $, id: R }], s.state.locale);
420
- c.value = M ?? null, f.value = M?.title ?? n("links.missing"), x = f.value;
778
+ const [D] = await i.resolve([{ type: W, id: P }], o.state.locale);
779
+ c.value = D ?? null, v.value = D?.title ?? s("links.missing"), x = v.value;
421
780
  }
422
- async function C() {
781
+ async function V() {
423
782
  d.value = await i.routes();
424
783
  }
425
- async function L($) {
426
- if ($ === x) {
784
+ async function k(W) {
785
+ if (W === x) {
427
786
  x = null;
428
787
  return;
429
788
  }
430
- if (x = null, m.value !== null) {
789
+ if (x = null, f.value !== null) {
431
790
  h.value = !0;
432
791
  try {
433
- u.value = await i.search(m.value, $, s.state.locale);
792
+ u.value = await i.search(f.value, W, o.state.locale);
434
793
  } finally {
435
794
  h.value = !1;
436
795
  }
437
796
  }
438
797
  }
439
- function E($) {
440
- $ !== void 0 && (a.value = { ...p.value, target: $ });
798
+ function C(W) {
799
+ W !== void 0 && (l.value = { ...p.value, target: W });
441
800
  }
442
- function S($) {
443
- m.value = $ == null ? null : String($), u.value = [], L("");
801
+ function _(W) {
802
+ f.value = W == null ? null : String(W), u.value = [], k("");
444
803
  }
445
- function Y($) {
446
- const R = u.value.find((M) => M.id === $.id);
447
- R === void 0 || m.value === null || (c.value = R, f.value = R.title, a.value = { ...p.value, entity_type: m.value, entity_id: R.id });
804
+ function q(W) {
805
+ const P = u.value.find((D) => D.id === W.id);
806
+ P === void 0 || f.value === null || (c.value = P, v.value = P.title, l.value = { ...p.value, entity_type: f.value, entity_id: P.id });
448
807
  }
449
- function oe() {
450
- c.value = null, f.value = "", u.value = [], a.value = { ...p.value, entity_type: null, entity_id: null };
808
+ function R() {
809
+ c.value = null, v.value = "", u.value = [], l.value = { ...p.value, entity_type: null, entity_id: null };
451
810
  }
452
- function re($) {
453
- a.value = { ...p.value, url: $ === "" ? null : $ };
811
+ function U(W) {
812
+ l.value = { ...p.value, url: W === "" ? null : W };
454
813
  }
455
- function te($) {
456
- const R = (typeof $ == "string" || typeof $ == "number" ? String($) : "").replace(/^#+/, "").trim();
457
- a.value = { ...p.value, hash: R === "" ? null : R };
814
+ function I(W) {
815
+ const P = (typeof W == "string" || typeof W == "number" ? String(W) : "").replace(/^#+/, "").trim();
816
+ l.value = { ...p.value, hash: P === "" ? null : P };
458
817
  }
459
- function ke($) {
460
- a.value = { ...p.value, new_tab: $ };
818
+ function de(W) {
819
+ l.value = { ...p.value, new_tab: W };
461
820
  }
462
- function _e($, R) {
463
- const M = p.value.rel.filter(($e) => $e !== $);
464
- a.value = { ...p.value, rel: R ? [...M, $] : M };
821
+ function ie(W, P) {
822
+ const D = p.value.rel.filter((We) => We !== W);
823
+ l.value = { ...p.value, rel: P ? [...D, W] : D };
465
824
  }
466
- function z($) {
467
- const R = [$.hint, $.url ?? void 0].filter(
468
- (M) => typeof M == "string" && M !== ""
825
+ function E(W) {
826
+ const P = [W.hint, W.url ?? void 0].filter(
827
+ (D) => typeof D == "string" && D !== ""
469
828
  );
470
- return $.available || R.push(n("links.unavailable")), R.join(" · ");
829
+ return W.available || P.push(s("links.unavailable")), P.join(" · ");
471
830
  }
472
- const X = ["nofollow", "sponsored", "ugc"];
473
- return ($, R) => (v(), _("div", La, [
474
- b(l(Ut), {
475
- options: g.value,
831
+ const Z = ["nofollow", "sponsored", "ugc"];
832
+ return (W, P) => (m(), $("div", Ql, [
833
+ w(a(Et), {
834
+ options: b.value,
476
835
  "model-value": p.value.target,
477
836
  disabled: t.disabled,
478
- "aria-label": l(n)("links.target-entity"),
479
- "onUpdate:modelValue": E
837
+ "aria-label": a(s)("links.target-entity"),
838
+ "onUpdate:modelValue": C
480
839
  }, null, 8, ["options", "model-value", "disabled", "aria-label"]),
481
- p.value.target === "entity" ? (v(), _("div", Va, [
482
- k.value.length > 1 ? (v(), T(l(Ne), {
840
+ p.value.target === "entity" ? (m(), $("div", Zl, [
841
+ T.value.length > 1 ? (m(), S(a(we), {
483
842
  key: 0,
484
843
  class: "wx-link-picker__section",
485
- options: k.value,
486
- "model-value": m.value,
844
+ options: T.value,
845
+ "model-value": f.value,
487
846
  disabled: t.disabled,
488
- "aria-label": l(n)("links.section"),
489
- "onUpdate:modelValue": S
847
+ "aria-label": a(s)("links.section"),
848
+ "onUpdate:modelValue": _
490
849
  }, null, 8, ["options", "model-value", "disabled", "aria-label"])) : N("", !0),
491
- b(l(Pe), {
850
+ w(a(Ne), {
492
851
  class: "wx-link-picker__search",
493
- "model-value": f.value,
494
- options: U.value,
852
+ "model-value": v.value,
853
+ options: F.value,
495
854
  remote: "",
496
855
  clearable: "",
497
856
  loading: h.value,
498
- "loading-text": l(n)("links.searching"),
499
- "empty-text": l(n)("links.empty"),
500
- placeholder: l(n)("links.search"),
501
- "aria-label": l(n)("links.search"),
857
+ "loading-text": a(s)("links.searching"),
858
+ "empty-text": a(s)("links.empty"),
859
+ placeholder: a(s)("links.search"),
860
+ "aria-label": a(s)("links.search"),
502
861
  disabled: t.disabled,
503
- "onUpdate:modelValue": R[0] || (R[0] = (M) => f.value = M),
504
- onSearch: L,
505
- onSelect: Y,
506
- onClear: oe
862
+ "onUpdate:modelValue": P[0] || (P[0] = (D) => v.value = D),
863
+ onSearch: k,
864
+ onSelect: q,
865
+ onClear: R
507
866
  }, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
508
- ])) : p.value.target === "url" ? (v(), _("div", za, [
509
- b(l(Pe), {
867
+ ])) : p.value.target === "url" ? (m(), $("div", ea, [
868
+ w(a(Ne), {
510
869
  "model-value": p.value.url ?? "",
511
- options: J.value,
870
+ options: Q.value,
512
871
  clearable: "",
513
872
  "open-on-focus": "",
514
- "empty-text": l(n)("links.url-routes"),
515
- placeholder: l(n)("links.url-placeholder"),
516
- "aria-label": l(n)("links.url-label"),
873
+ "empty-text": a(s)("links.url-routes"),
874
+ placeholder: a(s)("links.url-placeholder"),
875
+ "aria-label": a(s)("links.url-label"),
517
876
  disabled: t.disabled,
518
- "onUpdate:modelValue": re
877
+ "onUpdate:modelValue": U
519
878
  }, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
520
879
  ])) : N("", !0),
521
- p.value.target !== "none" ? (v(), _("label", Na, [
522
- b(l(G), {
880
+ p.value.target !== "none" ? (m(), $("label", ta, [
881
+ w(a(ee), {
523
882
  size: "sm",
524
883
  tone: "muted"
525
884
  }, {
526
885
  default: y(() => [
527
- V(W(l(n)("links.hash")), 1)
886
+ z(A(a(s)("links.hash")), 1)
528
887
  ]),
529
888
  _: 1
530
889
  }),
531
- R[2] || (R[2] = B("span", {
890
+ P[2] || (P[2] = B("span", {
532
891
  class: "wx-link-picker__sign",
533
892
  "aria-hidden": "true"
534
893
  }, "#", -1)),
535
- b(l(be), {
894
+ w(a(Te), {
536
895
  "model-value": p.value.hash ?? "",
537
- placeholder: l(n)("links.hash-placeholder"),
538
- "aria-label": l(n)("links.hash"),
896
+ placeholder: a(s)("links.hash-placeholder"),
897
+ "aria-label": a(s)("links.hash"),
539
898
  disabled: t.disabled,
540
899
  clearable: "",
541
- "onUpdate:modelValue": te
900
+ "onUpdate:modelValue": I
542
901
  }, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
543
902
  ])) : N("", !0),
544
- t.attributes && p.value.target !== "none" ? (v(), _("div", Ua, [
545
- b(l(De), {
903
+ t.attributes && p.value.target !== "none" ? (m(), $("div", la, [
904
+ w(a(He), {
546
905
  "model-value": p.value.new_tab,
547
906
  disabled: t.disabled,
548
- "onUpdate:modelValue": R[1] || (R[1] = (M) => ke(M))
907
+ "onUpdate:modelValue": P[1] || (P[1] = (D) => de(D))
549
908
  }, {
550
909
  default: y(() => [
551
- V(W(l(n)("links.new-tab")), 1)
910
+ z(A(a(s)("links.new-tab")), 1)
552
911
  ]),
553
912
  _: 1
554
913
  }, 8, ["model-value", "disabled"]),
555
- B("div", Ea, [
556
- b(l(G), {
914
+ B("div", aa, [
915
+ w(a(ee), {
557
916
  size: "sm",
558
917
  tone: "muted"
559
918
  }, {
560
919
  default: y(() => [
561
- V(W(l(n)("links.rel")), 1)
920
+ z(A(a(s)("links.rel")), 1)
562
921
  ]),
563
922
  _: 1
564
923
  }),
565
- (v(), _(F, null, ee(X, (M) => b(l(De), {
566
- key: M,
567
- "model-value": p.value.rel.includes(M),
924
+ (m(), $(j, null, ae(Z, (D) => w(a(He), {
925
+ key: D,
926
+ "model-value": p.value.rel.includes(D),
568
927
  disabled: t.disabled,
569
- "onUpdate:modelValue": ($e) => _e(M, $e)
928
+ "onUpdate:modelValue": (We) => ie(D, We)
570
929
  }, {
571
930
  default: y(() => [
572
- V(W(l(n)(`links.rel-${M}`)), 1)
931
+ z(A(a(s)(`links.rel-${D}`)), 1)
573
932
  ]),
574
933
  _: 2
575
934
  }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])), 64))
@@ -577,11 +936,11 @@ const La = { class: "wx-link-picker" }, Va = {
577
936
  ])) : N("", !0)
578
937
  ]));
579
938
  }
580
- }), Ra = /* @__PURE__ */ K(Ia, [["__scopeId", "data-v-e54022e5"]]), Ba = /* @__PURE__ */ I({
939
+ }), oa = /* @__PURE__ */ G(na, [["__scopeId", "data-v-e54022e5"]]), sa = /* @__PURE__ */ M({
581
940
  name: "WxLinkField",
582
941
  inheritAttrs: !1,
583
942
  __name: "LinkField",
584
- props: /* @__PURE__ */ ae({
943
+ props: /* @__PURE__ */ ne({
585
944
  allowNone: { type: Boolean, default: !0 },
586
945
  attributes: { type: Boolean, default: !0 },
587
946
  disabled: { type: Boolean, default: !1 }
@@ -591,17 +950,17 @@ const La = { class: "wx-link-picker" }, Va = {
591
950
  }),
592
951
  emits: ["update:modelValue"],
593
952
  setup(e) {
594
- const t = e, a = se(e, "modelValue");
595
- return (o, s) => (v(), T(Ra, Je({
596
- modelValue: a.value,
597
- "onUpdate:modelValue": s[0] || (s[0] = (i) => a.value = i)
598
- }, o.$attrs, {
953
+ const t = e, l = re(e, "modelValue");
954
+ return (n, o) => (m(), S(oa, et({
955
+ modelValue: l.value,
956
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => l.value = i)
957
+ }, n.$attrs, {
599
958
  "allow-none": t.allowNone,
600
959
  attributes: t.attributes,
601
960
  disabled: t.disabled
602
961
  }), null, 16, ["modelValue", "allow-none", "attributes", "disabled"]));
603
962
  }
604
- }), Ma = /* @__PURE__ */ I({
963
+ }), ia = /* @__PURE__ */ M({
605
964
  __name: "BackButton",
606
965
  props: {
607
966
  to: {},
@@ -609,21 +968,21 @@ const La = { class: "wx-link-picker" }, Va = {
609
968
  size: { default: "sm" }
610
969
  },
611
970
  setup(e) {
612
- const t = e, a = P("webx-admin"), o = w(() => t.label ?? a("editor.back"));
613
- return (s, i) => (v(), T(l(ie), {
971
+ const t = e, l = O("webx-admin"), n = g(() => t.label ?? l("editor.back"));
972
+ return (o, i) => (m(), S(a(ue), {
614
973
  icon: "arrow-left",
615
974
  class: "wx-back-button",
616
- as: l(At),
975
+ as: a(Nt),
617
976
  to: e.to,
618
- title: o.value,
977
+ title: n.value,
619
978
  size: e.size,
620
979
  "tooltip-side": "bottom"
621
980
  }, null, 8, ["as", "to", "title", "size"]));
622
981
  }
623
- }), Pa = {
982
+ }), ra = {
624
983
  key: 0,
625
984
  class: "wx-dropdown__divider"
626
- }, Da = /* @__PURE__ */ I({
985
+ }, ua = /* @__PURE__ */ M({
627
986
  __name: "RowMenu",
628
987
  props: {
629
988
  actions: {},
@@ -631,36 +990,36 @@ const La = { class: "wx-link-picker" }, Va = {
631
990
  size: { default: "sm" }
632
991
  },
633
992
  setup(e) {
634
- const t = P("webx-admin"), a = e, o = w(() => [
635
- ...a.actions.filter((i) => !i.danger),
636
- ...a.actions.filter((i) => i.danger)
637
- ]), s = w(() => {
638
- const i = o.value.find((n) => n.danger);
639
- return i && o.value[0] !== i ? i.key : null;
993
+ const t = O("webx-admin"), l = e, n = g(() => [
994
+ ...l.actions.filter((i) => !i.danger),
995
+ ...l.actions.filter((i) => i.danger)
996
+ ]), o = g(() => {
997
+ const i = n.value.find((s) => s.danger);
998
+ return i && n.value[0] !== i ? i.key : null;
640
999
  });
641
- return (i, n) => o.value.length > 0 ? (v(), T(l(Et), {
1000
+ return (i, s) => n.value.length > 0 ? (m(), S(a(Bt), {
642
1001
  key: 0,
643
1002
  class: "wx-row-menu",
644
1003
  collapse: "always",
645
1004
  align: "end",
646
1005
  size: e.size,
647
1006
  "aria-label": e.label,
648
- onClick: n[0] || (n[0] = Qe(() => {
1007
+ onClick: s[0] || (s[0] = tt(() => {
649
1008
  }, ["stop"]))
650
1009
  }, {
651
1010
  trigger: y(() => [
652
- b(l(ie), {
1011
+ w(a(ue), {
653
1012
  type: "more",
654
1013
  size: e.size,
655
- title: l(t)("editor.more")
1014
+ title: a(t)("editor.more")
656
1015
  }, null, 8, ["size", "title"])
657
1016
  ]),
658
1017
  collapsed: y(() => [
659
- (v(!0), _(F, null, ee(o.value, (r) => (v(), _(F, {
1018
+ (m(!0), $(j, null, ae(n.value, (r) => (m(), $(j, {
660
1019
  key: r.key
661
1020
  }, [
662
- r.key === s.value ? (v(), _("hr", Pa)) : N("", !0),
663
- b(l(It), {
1021
+ r.key === o.value ? (m(), $("hr", ra)) : N("", !0),
1022
+ w(a(Mt), {
664
1023
  icon: r.icon,
665
1024
  tone: r.danger ? "danger" : "default",
666
1025
  href: r.href,
@@ -669,7 +1028,7 @@ const La = { class: "wx-link-picker" }, Va = {
669
1028
  onClick: (u) => r.run?.()
670
1029
  }, {
671
1030
  default: y(() => [
672
- V(W(r.label), 1)
1031
+ z(A(r.label), 1)
673
1032
  ]),
674
1033
  _: 2
675
1034
  }, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
@@ -678,18 +1037,18 @@ const La = { class: "wx-link-picker" }, Va = {
678
1037
  _: 1
679
1038
  }, 8, ["size", "aria-label"])) : N("", !0);
680
1039
  }
681
- }), Ie = /* @__PURE__ */ K(Da, [["__scopeId", "data-v-cab01f7f"]]), Fa = ["data-level"], Oa = {
1040
+ }), Fe = /* @__PURE__ */ G(ua, [["__scopeId", "data-v-cab01f7f"]]), da = ["data-level"], ca = {
682
1041
  key: 0,
683
1042
  class: "wx-screen-head__trail"
684
- }, Ha = { class: "wx-screen-head__name" }, ja = {
1043
+ }, ma = { class: "wx-screen-head__name" }, fa = {
685
1044
  key: 4,
686
1045
  class: "wx-screen-head__actions"
687
- }, Ka = /* @__PURE__ */ I({
1046
+ }, va = /* @__PURE__ */ M({
688
1047
  __name: "ScreenHead",
689
1048
  props: {
690
1049
  title: { default: void 0 },
691
1050
  subtitle: { default: void 0 },
692
- back: { type: Boolean, default: void 0 },
1051
+ back: { type: [String, Object, Boolean], default: void 0 },
693
1052
  backLabel: { default: void 0 },
694
1053
  level: { default: 2 },
695
1054
  actions: { default: void 0 },
@@ -698,57 +1057,57 @@ const La = { class: "wx-link-picker" }, Va = {
698
1057
  },
699
1058
  emits: ["back"],
700
1059
  setup(e, { emit: t }) {
701
- const a = e, o = t, s = P("webx-admin"), i = _t(), n = Ze("root"), r = Rt(n), u = w(() => r.value > 0 && r.value < a.collapseBelow), d = w(() => a.actions ?? []), h = w(
1060
+ const l = e, n = t, o = O("webx-admin"), i = St(), s = lt("root"), r = Pt(s), u = g(() => r.value > 0 && r.value < l.collapseBelow), d = g(() => l.actions ?? []), h = g(
702
1061
  () => d.value.find((p) => p.primary) ?? null
703
- ), m = w(() => u.value ? h.value ? [h.value] : [] : d.value.filter((p) => !p.menu && !p.danger)), f = w(() => u.value ? d.value.filter((p) => p !== h.value) : d.value.filter((p) => p.menu || p.danger)), c = w(
704
- () => a.back && a.back !== !0 ? a.back : null
705
- ), x = w(
706
- () => m.value.length > 0 || f.value.length > 0 || !!i.extra
1062
+ ), f = g(() => u.value ? h.value ? [h.value] : [] : d.value.filter((p) => !p.menu && !p.danger)), v = g(() => u.value ? d.value.filter((p) => p !== h.value) : d.value.filter((p) => p.menu || p.danger)), c = g(
1063
+ () => l.back && l.back !== !0 ? l.back : null
1064
+ ), x = g(
1065
+ () => f.value.length > 0 || v.value.length > 0 || !!i.extra
707
1066
  );
708
- return (p, g) => (v(), _("div", {
1067
+ return (p, b) => (m(), $("div", {
709
1068
  ref_key: "root",
710
- ref: n,
711
- class: le(["wx-screen-head", {
1069
+ ref: s,
1070
+ class: oe(["wx-screen-head", {
712
1071
  "is-narrow": u.value,
713
- "has-button": m.value.length > 0,
1072
+ "has-button": f.value.length > 0,
714
1073
  "has-trail": !!p.$slots.trail,
715
1074
  "has-divider": e.divider
716
1075
  }]),
717
1076
  "data-level": e.level
718
1077
  }, [
719
- p.$slots.trail ? (v(), _("div", Oa, [
720
- O(p.$slots, "trail", {}, void 0, !0)
1078
+ p.$slots.trail ? (m(), $("div", ca, [
1079
+ Y(p.$slots, "trail", {}, void 0, !0)
721
1080
  ])) : N("", !0),
722
- c.value ? (v(), T(Ma, {
1081
+ c.value ? (m(), S(ia, {
723
1082
  key: 1,
724
1083
  class: "wx-screen-head__back",
725
1084
  to: c.value,
726
1085
  label: e.backLabel,
727
1086
  "tooltip-side": "bottom"
728
- }, null, 8, ["to", "label"])) : e.back ? (v(), T(l(ie), {
1087
+ }, null, 8, ["to", "label"])) : e.back ? (m(), S(a(ue), {
729
1088
  key: 2,
730
1089
  class: "wx-screen-head__back",
731
1090
  icon: "arrow-left",
732
1091
  size: "sm",
733
1092
  "tooltip-side": "bottom",
734
- title: e.backLabel ?? l(s)("editor.back"),
735
- onClick: g[0] || (g[0] = (k) => o("back"))
1093
+ title: e.backLabel ?? a(o)("editor.back"),
1094
+ onClick: b[0] || (b[0] = (T) => n("back"))
736
1095
  }, null, 8, ["title"])) : N("", !0),
737
- B("div", Ha, [
738
- e.title ? (v(), T(l(Bt), {
1096
+ B("div", ma, [
1097
+ e.title ? (m(), S(a(Ft), {
739
1098
  key: 0,
740
1099
  level: e.level,
741
1100
  truncate: "",
742
1101
  class: "wx-screen-head__title"
743
1102
  }, {
744
1103
  default: y(() => [
745
- V(W(e.title), 1)
1104
+ z(A(e.title), 1)
746
1105
  ]),
747
1106
  _: 1
748
1107
  }, 8, ["level"])) : N("", !0),
749
- O(p.$slots, "title-after", {}, void 0, !0)
1108
+ Y(p.$slots, "title-after", {}, void 0, !0)
750
1109
  ]),
751
- e.subtitle || p.$slots.subtitle ? (v(), T(l(G), {
1110
+ e.subtitle || p.$slots.subtitle ? (m(), S(a(ee), {
752
1111
  key: 3,
753
1112
  class: "wx-screen-head__subtitle",
754
1113
  size: "sm",
@@ -756,53 +1115,53 @@ const La = { class: "wx-link-picker" }, Va = {
756
1115
  truncate: ""
757
1116
  }, {
758
1117
  default: y(() => [
759
- O(p.$slots, "subtitle", {}, () => [
760
- V(W(e.subtitle), 1)
1118
+ Y(p.$slots, "subtitle", {}, () => [
1119
+ z(A(e.subtitle), 1)
761
1120
  ], !0)
762
1121
  ]),
763
1122
  _: 3
764
1123
  })) : N("", !0),
765
- x.value ? (v(), _("div", ja, [
766
- O(p.$slots, "extra", {}, void 0, !0),
767
- (v(!0), _(F, null, ee(m.value, (k) => (v(), T(l(Q), {
768
- key: k.key,
769
- class: le(["wx-screen-head__button", { "is-primary": k.primary }]),
770
- type: k.primary ? "primary" : "default",
771
- variant: k.primary ? "solid" : k.variant ?? "outline",
772
- loading: k.loading,
773
- disabled: k.disabled,
774
- href: k.href,
775
- target: k.href ? k.target ?? "_blank" : void 0,
776
- rel: k.href ? "noopener" : void 0,
777
- onClick: (U) => k.run?.()
778
- }, Ve({
1124
+ x.value ? (m(), $("div", fa, [
1125
+ Y(p.$slots, "extra", {}, void 0, !0),
1126
+ (m(!0), $(j, null, ae(f.value, (T) => (m(), S(a(le), {
1127
+ key: T.key,
1128
+ class: oe(["wx-screen-head__button", { "is-primary": T.primary }]),
1129
+ type: T.primary ? "primary" : "default",
1130
+ variant: T.primary ? "solid" : T.variant ?? "outline",
1131
+ loading: T.loading,
1132
+ disabled: T.disabled,
1133
+ href: T.href,
1134
+ target: T.href ? T.target ?? "_blank" : void 0,
1135
+ rel: T.href ? "noopener" : void 0,
1136
+ onClick: (F) => T.run?.()
1137
+ }, ke({
779
1138
  default: y(() => [
780
- V(" " + W(k.label), 1)
1139
+ z(" " + A(T.label), 1)
781
1140
  ]),
782
1141
  _: 2
783
1142
  }, [
784
- k.icon ? {
1143
+ T.icon ? {
785
1144
  name: "icon",
786
1145
  fn: y(() => [
787
- b(l(Ue), {
788
- name: k.icon
1146
+ w(a(Me), {
1147
+ name: T.icon
789
1148
  }, null, 8, ["name"])
790
1149
  ]),
791
1150
  key: "0"
792
1151
  } : void 0
793
1152
  ]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
794
- f.value.length > 0 ? (v(), T(Ie, {
1153
+ v.value.length > 0 ? (m(), S(Fe, {
795
1154
  key: 0,
796
- actions: f.value,
1155
+ actions: v.value,
797
1156
  size: "lg",
798
- label: e.title ?? l(s)("editor.more")
1157
+ label: e.title ?? a(o)("editor.more")
799
1158
  }, null, 8, ["actions", "label"])) : N("", !0)
800
1159
  ])) : N("", !0)
801
- ], 10, Fa));
1160
+ ], 10, da));
802
1161
  }
803
- }), mt = /* @__PURE__ */ K(Ka, [["__scopeId", "data-v-e27d184e"]]), qa = ["data-wx-fill"], Ya = /* @__PURE__ */ I({
1162
+ }), pt = /* @__PURE__ */ G(va, [["__scopeId", "data-v-9ebd5372"]]), pa = ["data-wx-fill"], ha = /* @__PURE__ */ M({
804
1163
  __name: "ListScreen",
805
- props: /* @__PURE__ */ ae({
1164
+ props: /* @__PURE__ */ ne({
806
1165
  title: { default: void 0 },
807
1166
  subtitle: { default: void 0 },
808
1167
  back: { default: void 0 },
@@ -819,12 +1178,12 @@ const La = { class: "wx-link-picker" }, Va = {
819
1178
  }),
820
1179
  emits: ["update:view"],
821
1180
  setup(e) {
822
- const t = se(e, "view");
823
- return (a, o) => (v(), _("div", {
824
- class: le(["wx-list-screen", { "is-fill": e.fill }]),
1181
+ const t = re(e, "view");
1182
+ return (l, n) => (m(), $("div", {
1183
+ class: oe(["wx-list-screen", { "is-fill": e.fill }]),
825
1184
  "data-wx-fill": e.fill ? "" : void 0
826
1185
  }, [
827
- e.title || e.actions || a.$slots.actions ? (v(), T(mt, {
1186
+ e.title || e.actions || l.$slots.actions ? (m(), S(pt, {
828
1187
  key: 0,
829
1188
  class: "wx-list-screen__head",
830
1189
  title: e.title,
@@ -833,217 +1192,220 @@ const La = { class: "wx-link-picker" }, Va = {
833
1192
  "back-label": e.backLabel,
834
1193
  actions: e.actions,
835
1194
  "collapse-below": 480
836
- }, Ve({ _: 2 }, [
837
- a.$slots.actions ? {
1195
+ }, ke({ _: 2 }, [
1196
+ l.$slots.actions ? {
838
1197
  name: "extra",
839
1198
  fn: y(() => [
840
- O(a.$slots, "actions", {}, void 0, !0)
1199
+ Y(l.$slots, "actions", {}, void 0, !0)
841
1200
  ]),
842
1201
  key: "0"
843
1202
  } : void 0
844
1203
  ]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : N("", !0),
845
- e.views && e.views.length > 0 ? (v(), T(l(Mt), {
1204
+ e.views && e.views.length > 0 ? (m(), S(a(Ot), {
846
1205
  key: 1,
847
1206
  modelValue: t.value,
848
- "onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
1207
+ "onUpdate:modelValue": n[0] || (n[0] = (o) => t.value = o),
849
1208
  class: "wx-list-screen__views",
850
1209
  items: e.views,
851
1210
  "collapse-below": e.collapseBelow,
852
1211
  "aria-label": e.title
853
1212
  }, {
854
1213
  default: y(() => [
855
- e.card ? (v(), T(l(Ce), {
1214
+ e.card ? (m(), S(a(Re), {
856
1215
  key: 0,
857
1216
  class: "wx-list-screen__card",
858
1217
  padding: e.padding
859
1218
  }, {
860
1219
  default: y(() => [
861
- O(a.$slots, "default", {}, void 0, !0)
1220
+ Y(l.$slots, "default", {}, void 0, !0)
862
1221
  ]),
863
1222
  _: 3
864
- }, 8, ["padding"])) : O(a.$slots, "default", {}, void 0, !0, 1)
1223
+ }, 8, ["padding"])) : Y(l.$slots, "default", {}, void 0, !0, 1)
865
1224
  ]),
866
1225
  _: 3
867
- }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (v(), _(F, { key: 2 }, [
868
- e.card ? (v(), T(l(Ce), {
1226
+ }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (m(), $(j, { key: 2 }, [
1227
+ e.card ? (m(), S(a(Re), {
869
1228
  key: 0,
870
1229
  class: "wx-list-screen__card",
871
1230
  padding: e.padding
872
1231
  }, {
873
1232
  default: y(() => [
874
- O(a.$slots, "default", {}, void 0, !0)
1233
+ Y(l.$slots, "default", {}, void 0, !0)
875
1234
  ]),
876
1235
  _: 3
877
- }, 8, ["padding"])) : O(a.$slots, "default", {}, void 0, !0, 1)
1236
+ }, 8, ["padding"])) : Y(l.$slots, "default", {}, void 0, !0, 1)
878
1237
  ], 64))
879
- ], 10, qa));
1238
+ ], 10, pa));
880
1239
  }
881
- }), ft = /* @__PURE__ */ K(Ya, [["__scopeId", "data-v-8c7e5ad1"]]), Xa = /* @__PURE__ */ I({
1240
+ }), ht = /* @__PURE__ */ G(ha, [["__scopeId", "data-v-8c7e5ad1"]]), ga = /* @__PURE__ */ M({
882
1241
  name: "WxRichTextField",
883
1242
  inheritAttrs: !1,
884
1243
  __name: "RichTextField",
885
1244
  setup(e) {
886
- const t = q(), a = P("webx-admin"), o = w(() => t.pickImage ?? void 0), s = w(() => ({
887
- bold: a("rich-text.bold"),
888
- italic: a("rich-text.italic"),
889
- strike: a("rich-text.strike"),
890
- code: a("rich-text.code"),
891
- h2: a("rich-text.h2"),
892
- h3: a("rich-text.h3"),
893
- h4: a("rich-text.h4"),
894
- bulletList: a("rich-text.bullet-list"),
895
- orderedList: a("rich-text.ordered-list"),
896
- blockquote: a("rich-text.blockquote"),
897
- hr: a("rich-text.hr"),
898
- link: a("rich-text.link"),
899
- table: a("rich-text.table"),
900
- image: a("rich-text.image"),
901
- youtube: a("rich-text.youtube"),
902
- undo: a("rich-text.undo"),
903
- redo: a("rich-text.redo"),
904
- addRowAfter: a("rich-text.row-below"),
905
- addRowBefore: a("rich-text.row-above"),
906
- addColumnAfter: a("rich-text.column-after"),
907
- addColumnBefore: a("rich-text.column-before"),
908
- deleteRow: a("rich-text.delete-row"),
909
- deleteColumn: a("rich-text.delete-column"),
910
- mergeOrSplit: a("rich-text.merge-cells"),
911
- deleteTable: a("rich-text.delete-table"),
912
- toolbar: a("rich-text.toolbar"),
913
- linkAddress: a("rich-text.link-address"),
914
- youtubeAddress: a("rich-text.youtube-address"),
915
- apply: a("rich-text.apply"),
916
- cancel: a("rich-text.cancel"),
917
- uploading: a("rich-text.uploading")
1245
+ const t = J(), l = O("webx-admin"), n = g(() => t.pickImage ?? void 0), o = g(() => ({
1246
+ bold: l("rich-text.bold"),
1247
+ italic: l("rich-text.italic"),
1248
+ strike: l("rich-text.strike"),
1249
+ code: l("rich-text.code"),
1250
+ h2: l("rich-text.h2"),
1251
+ h3: l("rich-text.h3"),
1252
+ h4: l("rich-text.h4"),
1253
+ bulletList: l("rich-text.bullet-list"),
1254
+ orderedList: l("rich-text.ordered-list"),
1255
+ blockquote: l("rich-text.blockquote"),
1256
+ hr: l("rich-text.hr"),
1257
+ link: l("rich-text.link"),
1258
+ table: l("rich-text.table"),
1259
+ image: l("rich-text.image"),
1260
+ youtube: l("rich-text.youtube"),
1261
+ undo: l("rich-text.undo"),
1262
+ redo: l("rich-text.redo"),
1263
+ addRowAfter: l("rich-text.row-below"),
1264
+ addRowBefore: l("rich-text.row-above"),
1265
+ addColumnAfter: l("rich-text.column-after"),
1266
+ addColumnBefore: l("rich-text.column-before"),
1267
+ deleteRow: l("rich-text.delete-row"),
1268
+ deleteColumn: l("rich-text.delete-column"),
1269
+ mergeOrSplit: l("rich-text.merge-cells"),
1270
+ deleteTable: l("rich-text.delete-table"),
1271
+ toolbar: l("rich-text.toolbar"),
1272
+ linkAddress: l("rich-text.link-address"),
1273
+ youtubeAddress: l("rich-text.youtube-address"),
1274
+ apply: l("rich-text.apply"),
1275
+ cancel: l("rich-text.cancel"),
1276
+ uploading: l("rich-text.uploading")
918
1277
  }));
919
- return (i, n) => (v(), T(l(Pt), Je(i.$attrs, {
920
- labels: s.value,
921
- "pick-image": o.value
1278
+ return (i, s) => (m(), S(a(Dt), et(i.$attrs, {
1279
+ labels: o.value,
1280
+ "pick-image": n.value
922
1281
  }), null, 16, ["labels", "pick-image"]));
923
1282
  }
924
- }), vt = /* @__PURE__ */ Symbol("wx-record-address");
925
- function Ga(e) {
926
- et(vt, e);
1283
+ }), gt = /* @__PURE__ */ Symbol("wx-record-address");
1284
+ function ya(e) {
1285
+ ze(gt, e);
927
1286
  }
928
- function Ja() {
929
- return ne(vt, null);
1287
+ function ba() {
1288
+ return se(gt, null);
930
1289
  }
931
- const Qa = { class: "wx-slug" }, Za = { class: "wx-slug__prefix" }, el = /* @__PURE__ */ I({
1290
+ const wa = { class: "wx-slug" }, xa = { class: "wx-slug__prefix" }, ka = /* @__PURE__ */ M({
932
1291
  name: "WxSlugField",
933
1292
  inheritAttrs: !1,
934
1293
  __name: "SlugField",
935
1294
  setup(e) {
936
- const t = Ja(), a = it(), o = w(() => {
937
- const n = t?.prefix.value ?? "";
938
- return n === "" ? "/" : `/${n}/`;
939
- }), s = w(() => {
940
- const n = t?.values.value.slug;
941
- return typeof n == "string" ? n : n?.[a.active.value] ?? "";
942
- }), i = w(() => {
943
- const n = t?.path.value;
944
- return typeof n == "string" && s.value !== "" && `${o.value}${s.value}` != `/${n}`;
1295
+ const t = ba(), l = it(), n = g(() => {
1296
+ const s = t?.prefix.value ?? "";
1297
+ return s === "" ? "/" : `/${s}/`;
1298
+ }), o = g(() => {
1299
+ const s = t?.values.value.slug;
1300
+ return typeof s == "string" ? s : s?.[l.active.value] ?? "";
1301
+ }), i = g(() => {
1302
+ const s = t?.path.value;
1303
+ return typeof s == "string" && o.value !== "" && `${n.value}${o.value}` != `/${s}`;
945
1304
  });
946
- return (n, r) => (v(), _("div", Qa, [
947
- b(l(be), $t(Tt(n.$attrs)), {
1305
+ return (s, r) => (m(), $("div", wa, [
1306
+ w(a(Te), Ct(Wt(s.$attrs)), {
948
1307
  prefix: y(() => [
949
- B("span", Za, W(o.value), 1)
1308
+ B("span", xa, A(n.value), 1)
950
1309
  ]),
951
1310
  _: 1
952
1311
  }, 16),
953
- i.value && l(t) ? (v(), T(l(we), {
1312
+ i.value && a(t) ? (m(), S(a(Se), {
954
1313
  key: 0,
955
1314
  type: "info",
956
1315
  variant: "soft",
957
- description: l(t).moving()
1316
+ description: a(t).moving()
958
1317
  }, null, 8, ["description"])) : N("", !0)
959
1318
  ]));
960
1319
  }
961
- }), Ke = /* @__PURE__ */ K(el, [["__scopeId", "data-v-5921c0dd"]]), tl = {
962
- "wx-list": { component: ft, kind: "layout", labelProp: "title" },
1320
+ }), Ge = /* @__PURE__ */ G(ka, [["__scopeId", "data-v-5921c0dd"]]), _a = {
1321
+ "wx-list": { component: ht, kind: "layout", labelProp: "title" },
963
1322
  // Full width: an editor shares a row with nothing, and a form of two columns would give it
964
1323
  // half a line to write a page of text in.
965
- "wx-rich-text": { component: Xa, kind: "field", wide: !0 },
1324
+ "wx-rich-text": { component: ga, kind: "field", wide: !0 },
966
1325
  // Wide as well: a row of the picker is a segmented switch, a section and a search box, and half
967
1326
  // a form's width leaves the search box too narrow to read a page title in.
968
- "wx-link": { component: Ba, kind: "field", wide: !0 },
969
- "wx-categories": { component: va, kind: "field" },
1327
+ "wx-link": { component: sa, kind: "field", wide: !0 },
1328
+ "wx-categories": { component: gl, kind: "field" },
970
1329
  // Wide: four controls in a column, and half a line leaves the category chips one to a row.
971
- "wx-collection": { component: Ca, kind: "field", wide: !0 },
972
- "wx-slug": { component: Ke, kind: "field" },
973
- "wx-category-slug": { component: Ke, kind: "field" }
974
- }, pt = /* @__PURE__ */ Symbol("webx-admin");
975
- function q() {
976
- const e = ne(pt, null);
1330
+ "wx-collection": { component: Xl, kind: "field", wide: !0 },
1331
+ // Wide: a row carries a picture, a name with a line under it and a mark, and the search box
1332
+ // under the list reads titles.
1333
+ "wx-relations": { component: mt, kind: "field", wide: !0 },
1334
+ "wx-slug": { component: Ge, kind: "field" },
1335
+ "wx-category-slug": { component: Ge, kind: "field" }
1336
+ }, yt = /* @__PURE__ */ Symbol("webx-admin");
1337
+ function J() {
1338
+ const e = se(yt, null);
977
1339
  if (e === null)
978
1340
  throw new Error("useAdmin() was called outside a panel created by createAdmin().");
979
1341
  return e;
980
1342
  }
981
- function al(e) {
982
- const t = he({
1343
+ function $a(e) {
1344
+ const t = be({
983
1345
  status: "loading",
984
1346
  manifest: null,
985
1347
  user: null,
986
1348
  error: null
987
- }), a = w(() => {
1349
+ }), l = g(() => {
988
1350
  const c = t.manifest;
989
1351
  if (c === null)
990
1352
  return [];
991
1353
  const x = [];
992
1354
  for (const p of c.modules) {
993
- const g = e.modules.find((U) => U.id === p.id);
994
- if (g === void 0)
1355
+ const b = e.modules.find((F) => F.id === p.id);
1356
+ if (b === void 0)
995
1357
  continue;
996
- const k = g.path ?? g.routes?.[0]?.path;
997
- k !== void 0 && x.push({
1358
+ const T = b.path ?? b.routes?.[0]?.path;
1359
+ T !== void 0 && x.push({
998
1360
  id: p.id,
999
1361
  title: p.title,
1000
1362
  icon: p.icon,
1001
- path: k,
1363
+ path: T,
1002
1364
  group: p.group ?? null
1003
1365
  });
1004
1366
  }
1005
1367
  return x;
1006
- }), o = w(() => {
1368
+ }), n = g(() => {
1007
1369
  const c = t.manifest?.groups ?? [], x = [], p = /* @__PURE__ */ new Map();
1008
- for (const g of a.value)
1009
- if (g.group !== null && c.some((k) => k.id === g.group)) {
1010
- const k = p.get(g.group) ?? [];
1011
- k.push(g), p.set(g.group, k);
1370
+ for (const b of l.value)
1371
+ if (b.group !== null && c.some((T) => T.id === b.group)) {
1372
+ const T = p.get(b.group) ?? [];
1373
+ T.push(b), p.set(b.group, T);
1012
1374
  } else
1013
- x.push(g);
1375
+ x.push(b);
1014
1376
  return {
1015
1377
  top: x,
1016
- groups: c.filter((g) => p.has(g.id)).map((g) => ({
1017
- id: g.id,
1018
- title: g.title,
1019
- icon: g.icon ?? null,
1020
- entries: p.get(g.id) ?? []
1378
+ groups: c.filter((b) => p.has(b.id)).map((b) => ({
1379
+ id: b.id,
1380
+ title: b.title,
1381
+ icon: b.icon ?? null,
1382
+ entries: p.get(b.id) ?? []
1021
1383
  }))
1022
1384
  };
1023
- }), s = { ...tl };
1385
+ }), o = { ..._a };
1024
1386
  for (const c of e.modules)
1025
- Object.assign(s, c.types);
1026
- Object.assign(s, e.types);
1027
- const i = e.modules.find((c) => c.pickImage !== void 0)?.pickImage, n = /* @__PURE__ */ new Map();
1387
+ Object.assign(o, c.types);
1388
+ Object.assign(o, e.types);
1389
+ const i = e.modules.find((c) => c.pickImage !== void 0)?.pickImage, s = /* @__PURE__ */ new Map();
1028
1390
  async function r(c) {
1029
1391
  const x = `${e.i18n.state.locale}:${c}`;
1030
- let p = n.get(x);
1031
- return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${c}`).then((g) => g.data.root).catch((g) => {
1032
- throw n.delete(x), g;
1033
- }), n.set(x, p)), p;
1392
+ let p = s.get(x);
1393
+ return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${c}`).then((b) => b.data.root).catch((b) => {
1394
+ throw s.delete(x), b;
1395
+ }), s.set(x, p)), p;
1034
1396
  }
1035
1397
  let u = null;
1036
1398
  async function d() {
1037
1399
  t.status = "loading", t.error = null;
1038
1400
  try {
1039
- if (u !== null && (t.user = await u(), m(t.user), t.user === null)) {
1401
+ if (u !== null && (t.user = await u(), f(t.user), t.user === null)) {
1040
1402
  t.manifest = null, t.status = "unauthenticated";
1041
1403
  return;
1042
1404
  }
1043
1405
  const c = await e.loadManifest();
1044
- t.manifest = c, e.i18n.state.contentLocales = c.locales ?? [], e.i18n.state.panelLocales = c.panelLocales ?? e.i18n.state.panelLocales, c.locale !== void 0 && c.locale !== e.i18n.state.locale && await f(c.locale), t.status = "ready";
1406
+ t.manifest = c, e.i18n.state.contentLocales = c.locales ?? [], e.i18n.state.panelLocales = c.panelLocales ?? e.i18n.state.panelLocales, c.locale !== void 0 && c.locale !== e.i18n.state.locale && await v(c.locale), t.status = "ready";
1045
1407
  } catch (c) {
1046
- if (nl(c)) {
1408
+ if (Sa(c)) {
1047
1409
  t.manifest = null, t.user = null, t.status = "unauthenticated";
1048
1410
  return;
1049
1411
  }
@@ -1057,10 +1419,10 @@ function al(e) {
1057
1419
  } catch {
1058
1420
  }
1059
1421
  }
1060
- function m(c) {
1422
+ function f(c) {
1061
1423
  c !== null && e.theme?.adopt(c.theme);
1062
1424
  }
1063
- async function f(c) {
1425
+ async function v(c) {
1064
1426
  if (e.loadDictionary === void 0) {
1065
1427
  e.i18n.state.locale = c;
1066
1428
  return;
@@ -1074,15 +1436,15 @@ function al(e) {
1074
1436
  state: t,
1075
1437
  i18n: e.i18n,
1076
1438
  modules: e.modules,
1077
- nav: a,
1078
- groups: o,
1079
- types: s,
1439
+ nav: l,
1440
+ groups: n,
1441
+ types: o,
1080
1442
  pickImage: i ?? null,
1081
1443
  reload: d,
1082
1444
  refreshManifest: h,
1083
- setLocale: f,
1445
+ setLocale: v,
1084
1446
  setUser(c) {
1085
- t.user = c, m(c);
1447
+ t.user = c, f(c);
1086
1448
  },
1087
1449
  useSessionLoader(c) {
1088
1450
  u = c;
@@ -1097,78 +1459,78 @@ function al(e) {
1097
1459
  }
1098
1460
  };
1099
1461
  }
1100
- function ll(e, t) {
1101
- e.provide(pt, t);
1462
+ function Ta(e, t) {
1463
+ e.provide(yt, t);
1102
1464
  }
1103
- function nl(e) {
1465
+ function Sa(e) {
1104
1466
  return typeof e == "object" && e !== null && "status" in e && e.status === 401;
1105
1467
  }
1106
- const ol = /* @__PURE__ */ I({
1468
+ const Ca = /* @__PURE__ */ M({
1107
1469
  __name: "AdminLanding",
1108
1470
  props: {
1109
1471
  landing: { default: null }
1110
1472
  },
1111
1473
  setup(e) {
1112
- const t = e, a = q(), o = ye(), s = P("webx-admin"), i = w(() => {
1113
- const n = a.nav.value;
1114
- return n.length === 0 ? null : ((t.landing === null ? void 0 : n.find((u) => u.path === t.landing)) ?? n[0])?.path ?? null;
1474
+ const t = e, l = J(), n = _e(), o = O("webx-admin"), i = g(() => {
1475
+ const s = l.nav.value;
1476
+ return s.length === 0 ? null : ((t.landing === null ? void 0 : s.find((u) => u.path === t.landing)) ?? s[0])?.path ?? null;
1115
1477
  });
1116
- return Z(
1478
+ return te(
1117
1479
  i,
1118
- (n) => {
1119
- n !== null && o.replace(n);
1480
+ (s) => {
1481
+ s !== null && n.replace(s);
1120
1482
  },
1121
1483
  { immediate: !0 }
1122
- ), (n, r) => i.value === null && l(a).state.status === "ready" ? (v(), T(l(Dt), {
1484
+ ), (s, r) => i.value === null && a(l).state.status === "ready" ? (m(), S(a(Ht), {
1123
1485
  key: 0,
1124
1486
  status: "info",
1125
- title: l(s)("shell.empty-title"),
1126
- description: l(s)("shell.empty-description")
1487
+ title: a(o)("shell.empty-title"),
1488
+ description: a(o)("shell.empty-description")
1127
1489
  }, null, 8, ["title", "description"])) : N("", !0);
1128
1490
  }
1129
- }), sl = /* @__PURE__ */ I({
1491
+ }), Wa = /* @__PURE__ */ M({
1130
1492
  __name: "AdminNav",
1131
1493
  props: {
1132
1494
  collapsed: { type: Boolean }
1133
1495
  },
1134
1496
  emits: ["select"],
1135
1497
  setup(e, { emit: t }) {
1136
- const a = t, o = q(), s = P("webx-admin"), i = ye(), n = ot(), r = w({
1498
+ const l = t, n = J(), o = O("webx-admin"), i = _e(), s = st(), r = g({
1137
1499
  /*
1138
1500
  * The longest path that contains this one, on a segment boundary: a section may live inside
1139
1501
  * another's path (`/services/categories` under `/services`), and the first match in the order
1140
1502
  * of the menu would light up the outer one.
1141
1503
  */
1142
- get: () => o.nav.value.filter((d) => n.path === d.path || n.path.startsWith(`${d.path}/`)).sort((d, h) => h.path.length - d.path.length)[0]?.id ?? "",
1504
+ get: () => n.nav.value.filter((d) => s.path === d.path || s.path.startsWith(`${d.path}/`)).sort((d, h) => h.path.length - d.path.length)[0]?.id ?? "",
1143
1505
  set: (u) => {
1144
- const d = o.nav.value.find((h) => h.id === u);
1506
+ const d = n.nav.value.find((h) => h.id === u);
1145
1507
  d !== void 0 && i.push(d.path);
1146
1508
  }
1147
1509
  });
1148
1510
  return (u, d) => {
1149
- const h = H("wx-menu-item"), m = H("wx-submenu"), f = H("wx-menu");
1150
- return v(), T(f, {
1511
+ const h = X("wx-menu-item"), f = X("wx-submenu"), v = X("wx-menu");
1512
+ return m(), S(v, {
1151
1513
  modelValue: r.value,
1152
1514
  "onUpdate:modelValue": d[0] || (d[0] = (c) => r.value = c),
1153
1515
  collapsed: e.collapsed,
1154
- label: l(s)("nav.sections"),
1155
- onSelect: d[1] || (d[1] = (c) => a("select"))
1516
+ label: a(o)("nav.sections"),
1517
+ onSelect: d[1] || (d[1] = (c) => l("select"))
1156
1518
  }, {
1157
1519
  default: y(() => [
1158
- (v(!0), _(F, null, ee(l(o).groups.value.top, (c) => (v(), T(h, {
1520
+ (m(!0), $(j, null, ae(a(n).groups.value.top, (c) => (m(), S(h, {
1159
1521
  key: c.id,
1160
1522
  value: c.id,
1161
1523
  icon: c.icon ?? void 0,
1162
1524
  label: c.title
1163
1525
  }, null, 8, ["value", "icon", "label"]))), 128)),
1164
- (v(!0), _(F, null, ee(l(o).groups.value.groups, (c) => (v(), T(m, {
1526
+ (m(!0), $(j, null, ae(a(n).groups.value.groups, (c) => (m(), S(f, {
1165
1527
  key: c.id,
1166
1528
  value: `group:${c.id}`,
1167
1529
  title: c.title,
1168
1530
  icon: c.icon ?? "gear"
1169
1531
  }, {
1170
1532
  default: y(() => [
1171
- (v(!0), _(F, null, ee(c.entries, (x) => (v(), T(h, {
1533
+ (m(!0), $(j, null, ae(c.entries, (x) => (m(), S(h, {
1172
1534
  key: x.id,
1173
1535
  value: x.id,
1174
1536
  icon: x.icon ?? void 0,
@@ -1182,68 +1544,68 @@ const ol = /* @__PURE__ */ I({
1182
1544
  }, 8, ["modelValue", "collapsed", "label"]);
1183
1545
  };
1184
1546
  }
1185
- }), il = {
1547
+ }), Aa = {
1186
1548
  key: 0,
1187
1549
  class: "wx-root wx-admin-plain"
1188
- }, rl = {
1550
+ }, Va = {
1189
1551
  key: 1,
1190
1552
  class: "wx-root wx-admin-plain"
1191
- }, ul = {
1553
+ }, La = {
1192
1554
  key: 2,
1193
1555
  class: "wx-root wx-admin-plain"
1194
- }, dl = ["src", "alt", "width", "height"], cl = ["src", "alt", "width", "height"], ml = ["src", "alt"], fl = { class: "wx-admin__user" }, vl = { class: "wx-admin__user wx-admin__user--drawer" }, pl = /* @__PURE__ */ I({
1556
+ }, Na = ["src", "alt", "width", "height"], Ra = ["src", "alt", "width", "height"], Ua = ["src", "alt"], za = { class: "wx-admin__user" }, Ia = { class: "wx-admin__user wx-admin__user--drawer" }, Ea = /* @__PURE__ */ M({
1195
1557
  __name: "AdminShell",
1196
1558
  setup(e) {
1197
- const t = q(), a = P("webx-admin"), o = A(null), { width: s, layout: i, collapsed: n, showAside: r, drawerOpen: u, toggle: d, close: h } = Ft(
1198
- o,
1559
+ const t = J(), l = O("webx-admin"), n = L(null), { width: o, layout: i, collapsed: s, showAside: r, drawerOpen: u, toggle: d, close: h } = jt(
1560
+ n,
1199
1561
  { persist: "webx-admin-shell" }
1200
- ), m = w(() => t.state.manifest?.title ?? ""), f = w(() => t.state.manifest?.branding?.logo ?? null), c = w(() => t.state.manifest?.branding?.mark ?? null), x = w(() => Ot(s.value, null));
1201
- return St(() => {
1562
+ ), f = g(() => t.state.manifest?.title ?? ""), v = g(() => t.state.manifest?.branding?.logo ?? null), c = g(() => t.state.manifest?.branding?.mark ?? null), x = g(() => Kt(o.value, null));
1563
+ return At(() => {
1202
1564
  typeof document > "u" || (document.documentElement.dataset.wxShell = x.value);
1203
- }), Ct(() => {
1565
+ }), Vt(() => {
1204
1566
  typeof document < "u" && delete document.documentElement.dataset.wxShell;
1205
- }), (p, g) => {
1206
- const k = H("router-view"), U = H("wx-loading"), J = H("wx-button"), j = H("wx-result"), C = H("wx-action"), L = H("wx-text"), E = H("wx-header"), S = H("wx-aside"), Y = H("wx-main"), oe = H("wx-container"), re = H("wx-drawer");
1207
- return v(), _(F, null, [
1208
- b(l(Ht), { placement: "bottom-center" }),
1209
- l(t).state.status === "unauthenticated" ? (v(), _("div", il, [
1210
- b(k)
1211
- ])) : l(t).state.status === "loading" ? (v(), _("div", rl, [
1212
- b(U, {
1213
- label: l(a)("shell.loading")
1567
+ }), (p, b) => {
1568
+ const T = X("router-view"), F = X("wx-loading"), Q = X("wx-button"), H = X("wx-result"), V = X("wx-action"), k = X("wx-text"), C = X("wx-header"), _ = X("wx-aside"), q = X("wx-main"), R = X("wx-container"), U = X("wx-drawer");
1569
+ return m(), $(j, null, [
1570
+ w(a(qt), { placement: "bottom-center" }),
1571
+ a(t).state.status === "unauthenticated" ? (m(), $("div", Aa, [
1572
+ w(T)
1573
+ ])) : a(t).state.status === "loading" ? (m(), $("div", Va, [
1574
+ w(F, {
1575
+ label: a(l)("shell.loading")
1214
1576
  }, null, 8, ["label"])
1215
- ])) : l(t).state.status === "error" ? (v(), _("div", ul, [
1216
- b(j, {
1577
+ ])) : a(t).state.status === "error" ? (m(), $("div", La, [
1578
+ w(H, {
1217
1579
  status: "error",
1218
- title: l(a)("shell.error-title"),
1219
- description: l(t).state.error
1580
+ title: a(l)("shell.error-title"),
1581
+ description: a(t).state.error
1220
1582
  }, {
1221
1583
  default: y(() => [
1222
- b(J, {
1584
+ w(Q, {
1223
1585
  type: "primary",
1224
- onClick: g[0] || (g[0] = (te) => l(t).reload())
1586
+ onClick: b[0] || (b[0] = (I) => a(t).reload())
1225
1587
  }, {
1226
1588
  default: y(() => [
1227
- V(W(l(a)("shell.retry")), 1)
1589
+ z(A(a(l)("shell.retry")), 1)
1228
1590
  ]),
1229
1591
  _: 1
1230
1592
  })
1231
1593
  ]),
1232
1594
  _: 1
1233
1595
  }, 8, ["title", "description"])
1234
- ])) : (v(), _("div", {
1596
+ ])) : (m(), $("div", {
1235
1597
  key: 3,
1236
1598
  ref_key: "shellEl",
1237
- ref: o,
1238
- class: le(["wx-root wx-admin", `wx-admin--${x.value}`])
1599
+ ref: n,
1600
+ class: oe(["wx-root wx-admin", `wx-admin--${x.value}`])
1239
1601
  }, [
1240
- b(oe, {
1241
- direction: l(i) === "drawer" ? "vertical" : "horizontal",
1602
+ w(R, {
1603
+ direction: a(i) === "drawer" ? "vertical" : "horizontal",
1242
1604
  "full-height": "",
1243
1605
  class: "wx-admin__frame"
1244
1606
  }, {
1245
1607
  default: y(() => [
1246
- l(i) === "drawer" ? (v(), T(E, {
1608
+ a(i) === "drawer" ? (m(), S(C, {
1247
1609
  key: 0,
1248
1610
  class: "wx-admin__header",
1249
1611
  floating: "",
@@ -1253,29 +1615,29 @@ const ol = /* @__PURE__ */ I({
1253
1615
  height: "var(--wx-admin-header-height)"
1254
1616
  }, {
1255
1617
  end: y(() => [
1256
- O(p.$slots, "user", { expanded: !1 }, void 0, !0)
1618
+ Y(p.$slots, "user", { expanded: !1 }, void 0, !0)
1257
1619
  ]),
1258
1620
  default: y(() => [
1259
- b(C, {
1621
+ w(V, {
1260
1622
  icon: "menu",
1261
- title: l(a)("nav.menu"),
1262
- onClick: l(d)
1623
+ title: a(l)("nav.menu"),
1624
+ onClick: a(d)
1263
1625
  }, null, 8, ["title", "onClick"]),
1264
- O(p.$slots, "brand", {}, () => [
1265
- f.value ? (v(), _("img", {
1626
+ Y(p.$slots, "brand", {}, () => [
1627
+ v.value ? (m(), $("img", {
1266
1628
  key: 0,
1267
1629
  class: "wx-admin__logo",
1268
- src: f.value.url,
1269
- alt: m.value,
1270
- width: f.value.width ?? void 0,
1271
- height: f.value.height ?? void 0
1272
- }, null, 8, dl)) : (v(), T(L, {
1630
+ src: v.value.url,
1631
+ alt: f.value,
1632
+ width: v.value.width ?? void 0,
1633
+ height: v.value.height ?? void 0
1634
+ }, null, 8, Na)) : (m(), S(k, {
1273
1635
  key: 1,
1274
1636
  weight: "semibold",
1275
1637
  truncate: ""
1276
1638
  }, {
1277
1639
  default: y(() => [
1278
- V(W(m.value), 1)
1640
+ z(A(f.value), 1)
1279
1641
  ]),
1280
1642
  _: 1
1281
1643
  }))
@@ -1283,96 +1645,96 @@ const ol = /* @__PURE__ */ I({
1283
1645
  ]),
1284
1646
  _: 3
1285
1647
  })) : N("", !0),
1286
- l(r) ? (v(), T(S, {
1648
+ a(r) ? (m(), S(_, {
1287
1649
  key: 1,
1288
1650
  class: "wx-admin__aside",
1289
1651
  sticky: "",
1290
1652
  floating: "",
1291
1653
  scroll: "",
1292
1654
  bordered: !1,
1293
- collapsed: l(n),
1655
+ collapsed: a(s),
1294
1656
  width: 220,
1295
1657
  "collapsed-width": 56
1296
1658
  }, {
1297
1659
  top: y(() => [
1298
1660
  B("div", {
1299
- class: le(["wx-admin__brand", { "wx-admin__brand--stacked": l(n) && c.value }])
1661
+ class: oe(["wx-admin__brand", { "wx-admin__brand--stacked": a(s) && c.value }])
1300
1662
  }, [
1301
- l(n) ? c.value ? (v(), _("img", {
1663
+ a(s) ? c.value ? (m(), $("img", {
1302
1664
  key: 1,
1303
1665
  class: "wx-admin__mark",
1304
1666
  src: c.value.url,
1305
- alt: m.value
1306
- }, null, 8, ml)) : N("", !0) : O(p.$slots, "brand", {}, () => [
1307
- f.value ? (v(), _("img", {
1667
+ alt: f.value
1668
+ }, null, 8, Ua)) : N("", !0) : Y(p.$slots, "brand", {}, () => [
1669
+ v.value ? (m(), $("img", {
1308
1670
  key: 0,
1309
1671
  class: "wx-admin__logo",
1310
- src: f.value.url,
1311
- alt: m.value,
1312
- width: f.value.width ?? void 0,
1313
- height: f.value.height ?? void 0
1314
- }, null, 8, cl)) : (v(), T(L, {
1672
+ src: v.value.url,
1673
+ alt: f.value,
1674
+ width: v.value.width ?? void 0,
1675
+ height: v.value.height ?? void 0
1676
+ }, null, 8, Ra)) : (m(), S(k, {
1315
1677
  key: 1,
1316
1678
  weight: "semibold",
1317
1679
  truncate: "",
1318
1680
  class: "wx-admin__title"
1319
1681
  }, {
1320
1682
  default: y(() => [
1321
- V(W(m.value), 1)
1683
+ z(A(f.value), 1)
1322
1684
  ]),
1323
1685
  _: 1
1324
1686
  }))
1325
1687
  ], !0, 0),
1326
- b(C, {
1688
+ w(V, {
1327
1689
  icon: "sidebar",
1328
- title: l(n) ? l(a)("nav.expand") : l(a)("nav.collapse"),
1329
- onClick: l(d)
1690
+ title: a(s) ? a(l)("nav.expand") : a(l)("nav.collapse"),
1691
+ onClick: a(d)
1330
1692
  }, null, 8, ["title", "onClick"])
1331
1693
  ], 2)
1332
1694
  ]),
1333
1695
  bottom: y(() => [
1334
- B("div", fl, [
1335
- O(p.$slots, "user", {
1336
- expanded: !l(n)
1696
+ B("div", za, [
1697
+ Y(p.$slots, "user", {
1698
+ expanded: !a(s)
1337
1699
  }, void 0, !0)
1338
1700
  ])
1339
1701
  ]),
1340
1702
  default: y(() => [
1341
- O(p.$slots, "nav", { collapsed: l(n) }, void 0, !0)
1703
+ Y(p.$slots, "nav", { collapsed: a(s) }, void 0, !0)
1342
1704
  ]),
1343
1705
  _: 3
1344
1706
  }, 8, ["collapsed"])) : N("", !0),
1345
- b(Y, {
1707
+ w(q, {
1346
1708
  padding: "none",
1347
1709
  class: "wx-admin__screen"
1348
1710
  }, {
1349
1711
  default: y(() => [
1350
- b(k)
1712
+ w(T)
1351
1713
  ]),
1352
1714
  _: 1
1353
1715
  })
1354
1716
  ]),
1355
1717
  _: 3
1356
1718
  }, 8, ["direction"]),
1357
- b(re, {
1358
- open: l(u),
1359
- "onUpdate:open": g[1] || (g[1] = (te) => tt(u) ? u.value = te : null),
1719
+ w(U, {
1720
+ open: a(u),
1721
+ "onUpdate:open": b[1] || (b[1] = (I) => at(u) ? u.value = I : null),
1360
1722
  class: "wx-admin__drawer",
1361
- title: m.value === "" ? l(a)("nav.menu") : m.value,
1723
+ title: f.value === "" ? a(l)("nav.menu") : f.value,
1362
1724
  side: "left",
1363
1725
  size: 260,
1364
1726
  "full-screen": !1,
1365
1727
  closable: ""
1366
1728
  }, {
1367
1729
  footer: y(() => [
1368
- B("div", vl, [
1369
- O(p.$slots, "user", { expanded: !0 }, void 0, !0)
1730
+ B("div", Ia, [
1731
+ Y(p.$slots, "user", { expanded: !0 }, void 0, !0)
1370
1732
  ])
1371
1733
  ]),
1372
1734
  default: y(() => [
1373
- O(p.$slots, "nav", {
1735
+ Y(p.$slots, "nav", {
1374
1736
  collapsed: !1,
1375
- select: l(h)
1737
+ select: a(h)
1376
1738
  }, void 0, !0)
1377
1739
  ]),
1378
1740
  _: 3
@@ -1381,146 +1743,47 @@ const ol = /* @__PURE__ */ I({
1381
1743
  ], 64);
1382
1744
  };
1383
1745
  }
1384
- }), hl = /* @__PURE__ */ K(pl, [["__scopeId", "data-v-819885ab"]]);
1385
- class We extends Error {
1386
- constructor(t, a, o = {}, s = null, i = null) {
1387
- super(t), this.status = a, this.errors = o, this.retryAfter = s, this.body = i, this.name = "HttpError";
1388
- }
1389
- status;
1390
- errors;
1391
- retryAfter;
1392
- body;
1393
- /** A failed form rather than a failed request. */
1394
- get isValidation() {
1395
- return this.status === 422;
1396
- }
1397
- get isUnauthenticated() {
1398
- return this.status === 401;
1399
- }
1400
- get isThrottled() {
1401
- return this.status === 429;
1402
- }
1403
- }
1404
- const gl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
1405
- function yl(e = {}) {
1406
- const t = (e.baseUrl ?? "").replace(/\/$/, ""), a = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", o = e.fetch ?? globalThis.fetch.bind(globalThis), s = e.onUnauthenticated, i = e.headers;
1407
- let n = !1;
1408
- async function r(d = !1) {
1409
- n && !d && qe("XSRF-TOKEN") !== null || (await o(a, { credentials: "same-origin" }), n = !0);
1410
- }
1411
- async function u(d, h, m, f = {}, c = !1) {
1412
- const x = gl.has(d);
1413
- x && await r();
1414
- const p = {
1415
- Accept: "application/json",
1416
- "X-Requested-With": "XMLHttpRequest",
1417
- // Standing headers first, so a caller can still override one for a single request.
1418
- ...i?.(),
1419
- ...f.headers
1420
- };
1421
- if (x) {
1422
- const k = qe("XSRF-TOKEN");
1423
- k !== null && (p["X-XSRF-TOKEN"] = k);
1424
- }
1425
- m !== void 0 && (p["Content-Type"] = "application/json");
1426
- const g = await o(wl(t, h, f.query), {
1427
- method: d,
1428
- credentials: "same-origin",
1429
- headers: p,
1430
- signal: f.signal,
1431
- body: m === void 0 ? void 0 : JSON.stringify(m)
1432
- });
1433
- if (g.status === 419 && x && !c)
1434
- return await r(!0), u(d, h, m, f, !0);
1435
- if (g.status === 401 && s?.(), !g.ok)
1436
- throw await bl(g);
1437
- if (g.status !== 204)
1438
- return await g.json();
1439
- }
1440
- return {
1441
- get: (d, h) => u("GET", d, void 0, h),
1442
- post: (d, h, m) => u("POST", d, h, m),
1443
- put: (d, h, m) => u("PUT", d, h, m),
1444
- patch: (d, h, m) => u("PATCH", d, h, m),
1445
- delete: (d, h) => u("DELETE", d, void 0, h)
1446
- };
1447
- }
1448
- async function bl(e) {
1449
- let t = null;
1450
- try {
1451
- t = await e.json();
1452
- } catch {
1453
- }
1454
- const a = t ?? {}, o = typeof a.message == "string" && a.message !== "" ? a.message : e.statusText || `Request failed with ${e.status}`, s = a.errors !== null && typeof a.errors == "object" ? a.errors : {}, i = e.headers.get("Retry-After"), n = i === null ? null : Number.parseInt(i, 10);
1455
- return new We(
1456
- o,
1457
- e.status,
1458
- s,
1459
- Number.isFinite(n) ? n : null,
1460
- t
1461
- );
1462
- }
1463
- function wl(e, t, a) {
1464
- const s = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
1465
- if (a === void 0)
1466
- return s;
1467
- const i = new URLSearchParams();
1468
- for (const [r, u] of Object.entries(a))
1469
- u != null && i.set(r, String(u));
1470
- const n = i.toString();
1471
- return n === "" ? s : `${s}${s.includes("?") ? "&" : "?"}${n}`;
1472
- }
1473
- function qe(e) {
1474
- if (typeof document > "u")
1475
- return null;
1476
- for (const t of document.cookie.split(";")) {
1477
- const [a, ...o] = t.trim().split("=");
1478
- if (a === e)
1479
- return decodeURIComponent(o.join("="));
1480
- }
1481
- return null;
1482
- }
1483
- const xl = "webx.theme", ht = /* @__PURE__ */ Symbol("webx-theme");
1484
- function gn() {
1485
- const e = ne(ht, null);
1746
+ }), Ba = /* @__PURE__ */ G(Ea, [["__scopeId", "data-v-819885ab"]]), Ma = "webx.theme", bt = /* @__PURE__ */ Symbol("webx-theme");
1747
+ function In() {
1748
+ const e = se(bt, null);
1486
1749
  if (e === null)
1487
1750
  throw new Error("useTheme() was called outside a panel created by createAdmin().");
1488
1751
  return e;
1489
1752
  }
1490
- function kl(e, t) {
1491
- e.provide(ht, t);
1753
+ function Pa(e, t) {
1754
+ e.provide(bt, t);
1492
1755
  }
1493
- function _l(e = {}) {
1494
- const t = e.storageKey === void 0 ? xl : e.storageKey, a = he({
1495
- preference: $l(t) ?? "system",
1756
+ function Fa(e = {}) {
1757
+ const t = e.storageKey === void 0 ? Ma : e.storageKey, l = be({
1758
+ preference: Oa(t) ?? "system",
1496
1759
  resolved: "light"
1497
1760
  });
1498
- function o() {
1499
- na(a.preference), a.resolved = a.preference === "system" ? oa() : a.preference;
1761
+ function n() {
1762
+ il(l.preference), l.resolved = l.preference === "system" ? rl() : l.preference;
1500
1763
  }
1501
- return o(), la((s) => {
1502
- a.preference === "system" && (a.resolved = s);
1764
+ return n(), sl((o) => {
1765
+ l.preference === "system" && (l.resolved = o);
1503
1766
  }), {
1504
- state: a,
1505
- set(s) {
1506
- a.preference = s, o(), Ye(t, s);
1767
+ state: l,
1768
+ set(o) {
1769
+ l.preference = o, n(), Je(t, o);
1507
1770
  },
1508
- adopt(s) {
1509
- if (s === void 0)
1771
+ adopt(o) {
1772
+ if (o === void 0)
1510
1773
  return;
1511
- const i = s ?? "system";
1512
- i !== a.preference && (a.preference = i, o(), Ye(t, i));
1774
+ const i = o ?? "system";
1775
+ i !== l.preference && (l.preference = i, n(), Je(t, i));
1513
1776
  }
1514
1777
  };
1515
1778
  }
1516
- function Ye(e, t) {
1779
+ function Je(e, t) {
1517
1780
  if (e !== null)
1518
1781
  try {
1519
1782
  localStorage.setItem(e, t);
1520
1783
  } catch {
1521
1784
  }
1522
1785
  }
1523
- function $l(e) {
1786
+ function Oa(e) {
1524
1787
  if (e === null)
1525
1788
  return null;
1526
1789
  try {
@@ -1530,7 +1793,7 @@ function $l(e) {
1530
1793
  return null;
1531
1794
  }
1532
1795
  }
1533
- const gt = {
1796
+ const wt = {
1534
1797
  shell: {
1535
1798
  loading: "Loading the panel…",
1536
1799
  "error-title": "The panel could not start",
@@ -1752,6 +2015,8 @@ const gt = {
1752
2015
  "unknown-category": "One of the chosen categories no longer exists.",
1753
2016
  limit: "How many to show: a whole number from 1 to :max, or empty for all.",
1754
2017
  flag: "This switch takes yes or no.",
2018
+ "unknown-relation": "Records of this section cannot be filtered by that.",
2019
+ "unknown-related": "One of the chosen related records no longer exists.",
1755
2020
  "field-source": "Shows records from “:source”.",
1756
2021
  "field-unavailable": "Records from “:source” cannot be chosen here: the section is not installed, or you have no access to it.",
1757
2022
  "field-categories": "Categories",
@@ -1764,29 +2029,51 @@ const gt = {
1764
2029
  "field-markup-auto-on": "By default it is on: the block shows every category.",
1765
2030
  "field-markup-auto-off": "By default it is off: search engines ask not to mark the same records up on several pages, and a chosen category usually stands on several.",
1766
2031
  "field-markup-reset": "Back to the default"
2032
+ },
2033
+ // The records of another section a record points at (`wx-relations`), and the same choice as a
2034
+ // block's filter ("only related to" in `wx-collection`). Kept apart from `collections` because
2035
+ // the field is a field of its own, on any screen.
2036
+ relations: {
2037
+ "field-add": "Add…",
2038
+ "field-searching": "Searching…",
2039
+ "field-nothing": "Nothing found.",
2040
+ "field-empty": "Nothing chosen yet.",
2041
+ "field-remove": "Remove",
2042
+ "field-drag": "Drag to change the order",
2043
+ "field-hidden": "Not on the site",
2044
+ "field-trashed": "In the bin",
2045
+ "field-missing": "Not found",
2046
+ "field-full": "No more than :max can be chosen.",
2047
+ "field-forbidden": "You cannot see these records, so the choice cannot be changed here.",
2048
+ "collection-related": "Only related to",
2049
+ "collection-related-to": "Only related to “:target”",
2050
+ "collection-related-type": "Which section",
2051
+ "collection-related-any": "Not narrowed: every record, related or not.",
2052
+ "collection-related-current": "The record of the page it stands on",
2053
+ "collection-related-current-hint": "On the page of a record of “:target” the block shows what is related to it; on any other page it shows nothing."
1767
2054
  }
1768
- }, yt = "webx.locale";
1769
- function yn(e = {}) {
1770
- const t = e.manifestUrl ?? Ll() ?? "/api/cms/manifest", a = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), o = e.basePath ?? "/cms", s = e.modules ?? [], i = [...e.routes ?? []];
1771
- for (const g of s)
1772
- i.push(...g.routes ?? []);
1773
- if (!i.some((g) => g.path === "/")) {
1774
- const g = s.find((k) => k.landing === !0);
2055
+ }, xt = "webx.locale";
2056
+ function En(e = {}) {
2057
+ const t = e.manifestUrl ?? Ya() ?? "/api/cms/manifest", l = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), n = e.basePath ?? "/cms", o = e.modules ?? [], i = [...e.routes ?? []];
2058
+ for (const b of o)
2059
+ i.push(...b.routes ?? []);
2060
+ if (!i.some((b) => b.path === "/")) {
2061
+ const b = o.find((T) => T.landing === !0);
1775
2062
  i.push({
1776
2063
  path: "/",
1777
2064
  name: "webx.home",
1778
- component: ol,
1779
- props: { landing: g?.path ?? g?.routes?.[0]?.path ?? null }
2065
+ component: Ca,
2066
+ props: { landing: b?.path ?? b?.routes?.[0]?.path ?? null }
1780
2067
  });
1781
2068
  }
1782
- const n = Lt({
1783
- history: Vt(o),
2069
+ const s = Rt({
2070
+ history: Ut(n),
1784
2071
  routes: i
1785
- }), r = Ee({ locale: e.locale ?? Sl() }), u = _l(), d = e.http ?? yl({
2072
+ }), r = Pe({ locale: e.locale ?? Ha() }), u = Fa(), d = e.http ?? bl({
1786
2073
  baseUrl: "",
1787
- csrfUrl: `${a}/auth/csrf-cookie`,
2074
+ csrfUrl: `${l}/auth/csrf-cookie`,
1788
2075
  onUnauthenticated: () => {
1789
- m.setUser(null), m.state.status = "unauthenticated";
2076
+ f.setUser(null), f.state.status = "unauthenticated";
1790
2077
  },
1791
2078
  // Every request says which language the panel is currently showing. It decides what
1792
2079
  // the server writes its own messages in — a 422 under a field — for anybody who has
@@ -1794,174 +2081,174 @@ function yn(e = {}) {
1794
2081
  // signing in on a Russian sign-in screen lands in an English panel.
1795
2082
  headers: () => ({ "X-Webx-Locale": r.state.locale })
1796
2083
  });
1797
- r.defaults("webx-admin", gt);
1798
- async function h(g) {
1799
- const k = await d.get(`${a}/translations/${g}`);
1800
- r.load(k.data.namespaces, k.data.locale, k.data.fallback), Cl(k.data.locale), Al(k.data.locale, r.state.panelLocales);
2084
+ r.defaults("webx-admin", wt);
2085
+ async function h(b) {
2086
+ const T = await d.get(`${l}/translations/${b}`);
2087
+ r.load(T.data.namespaces, T.data.locale, T.data.fallback), ja(T.data.locale), qa(T.data.locale, r.state.panelLocales);
1801
2088
  }
1802
- const m = al({
2089
+ const f = $a({
1803
2090
  http: d,
1804
2091
  theme: u,
1805
- basePath: o,
1806
- apiPath: a,
1807
- modules: s,
2092
+ basePath: n,
2093
+ apiPath: l,
2094
+ modules: o,
1808
2095
  i18n: r,
1809
2096
  loadDictionary: h,
1810
2097
  types: e.types,
1811
2098
  screens: e.screens,
1812
2099
  loadManifest: async () => (await d.get(t)).data
1813
- }), f = Wt(Tl(e));
1814
- f.use(jt), ll(f, m), ra(f, r), kl(f, u);
1815
- const c = A("");
1816
- f.provide(
1817
- Kt,
1818
- w(() => r.state.locale)
1819
- ), f.provide(qt, {
1820
- list: w(
1821
- () => r.state.contentLocales.map((g) => ({
1822
- code: g.code,
1823
- label: g.code.toUpperCase()
2100
+ }), v = Lt(Da(e));
2101
+ v.use(Yt), Ta(v, f), cl(v, r), Pa(v, u);
2102
+ const c = L("");
2103
+ v.provide(
2104
+ Xt,
2105
+ g(() => r.state.locale)
2106
+ ), v.provide(Gt, {
2107
+ list: g(
2108
+ () => r.state.contentLocales.map((b) => ({
2109
+ code: b.code,
2110
+ label: b.code.toUpperCase()
1824
2111
  }))
1825
2112
  ),
1826
- active: w({
2113
+ active: g({
1827
2114
  get: () => c.value || (r.state.contentLocales[0]?.code ?? ""),
1828
- set: (g) => {
1829
- c.value = g;
2115
+ set: (b) => {
2116
+ c.value = b;
1830
2117
  }
1831
2118
  })
1832
2119
  });
1833
2120
  const x = {
1834
- app: f,
1835
- router: n,
1836
- context: m,
2121
+ app: v,
2122
+ router: s,
2123
+ context: f,
1837
2124
  i18n: r,
1838
2125
  theme: u,
1839
2126
  async mount() {
1840
2127
  await Promise.all([p(), h(r.state.locale)]).catch(() => {
1841
- }), f.mount(e.el ?? "#webx-app"), await m.reload();
2128
+ }), v.mount(e.el ?? "#webx-app"), await f.reload();
1842
2129
  }
1843
2130
  };
1844
2131
  async function p() {
1845
- const g = await d.get(`${a}/locales`);
1846
- r.state.panelLocales = g.data.panel, r.state.contentLocales = g.data.content;
2132
+ const b = await d.get(`${l}/locales`);
2133
+ r.state.panelLocales = b.data.panel, r.state.contentLocales = b.data.content;
1847
2134
  }
1848
- for (const g of e.plugins ?? [])
1849
- g.install(x);
1850
- return f.use(n), x;
2135
+ for (const b of e.plugins ?? [])
2136
+ b.install(x);
2137
+ return v.use(s), x;
1851
2138
  }
1852
- function Tl(e) {
2139
+ function Da(e) {
1853
2140
  const t = {
1854
2141
  // The menu is the panel's own: it is the manifest, drawn.
1855
2142
  // The shell hands in what a choice means where it drew the menu — in the drawer it is what
1856
2143
  // closes it, and a drawer that stays open over the section it just opened is a drawer the
1857
2144
  // reader has to dismiss by hand.
1858
- nav: (a) => ue(sl, { collapsed: a.collapsed === !0, onSelect: a.select })
2145
+ nav: (l) => ce(Wa, { collapsed: l.collapsed === !0, onSelect: l.select })
1859
2146
  };
1860
- return e.brand !== void 0 && (t.brand = () => ue(e.brand)), e.userMenu !== void 0 && (t.user = (a) => ue(e.userMenu, { expanded: a.expanded === !0 })), { render: () => ue(hl, null, t) };
2147
+ return e.brand !== void 0 && (t.brand = () => ce(e.brand)), e.userMenu !== void 0 && (t.user = (l) => ce(e.userMenu, { expanded: l.expanded === !0 })), { render: () => ce(Ba, null, t) };
1861
2148
  }
1862
- function Sl() {
1863
- const e = Wl(yt);
2149
+ function Ha() {
2150
+ const e = Ka(xt);
1864
2151
  return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
1865
2152
  }
1866
- function Cl(e) {
2153
+ function ja(e) {
1867
2154
  try {
1868
- localStorage.setItem(yt, e);
2155
+ localStorage.setItem(xt, e);
1869
2156
  } catch {
1870
2157
  }
1871
2158
  }
1872
- function Wl(e) {
2159
+ function Ka(e) {
1873
2160
  try {
1874
2161
  return localStorage.getItem(e);
1875
2162
  } catch {
1876
2163
  return null;
1877
2164
  }
1878
2165
  }
1879
- function Al(e, t) {
1880
- typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((a) => a.code === e)?.direction ?? "ltr");
2166
+ function qa(e, t) {
2167
+ typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((l) => l.code === e)?.direction ?? "ltr");
1881
2168
  }
1882
- function Ll() {
2169
+ function Ya() {
1883
2170
  return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
1884
2171
  }
1885
- function Vl(e) {
2172
+ function Xa(e) {
1886
2173
  const t = e.replace(/\r\n?/g, `
1887
2174
  `).split(`
1888
- `), a = [];
1889
- let o = 0;
1890
- for (; o < t.length; ) {
1891
- const s = t[o] ?? "";
1892
- if (s.trim() === "") {
1893
- o += 1;
2175
+ `), l = [];
2176
+ let n = 0;
2177
+ for (; n < t.length; ) {
2178
+ const o = t[n] ?? "";
2179
+ if (o.trim() === "") {
2180
+ n += 1;
1894
2181
  continue;
1895
2182
  }
1896
- if (/^```([\w-]*)\s*$/.exec(s)) {
2183
+ if (/^```([\w-]*)\s*$/.exec(o)) {
1897
2184
  const u = [];
1898
- for (o += 1; o < t.length && !/^```\s*$/.test(t[o] ?? ""); )
1899
- u.push(t[o] ?? ""), o += 1;
1900
- o += 1, a.push(`<pre><code>${Ae(u.join(`
2185
+ for (n += 1; n < t.length && !/^```\s*$/.test(t[n] ?? ""); )
2186
+ u.push(t[n] ?? ""), n += 1;
2187
+ n += 1, l.push(`<pre><code>${Ue(u.join(`
1901
2188
  `))}</code></pre>`);
1902
2189
  continue;
1903
2190
  }
1904
- const n = /^(#{1,4})\s+(.*)$/.exec(s);
1905
- if (n) {
1906
- const u = Math.min(n[1].length + 1, 5);
1907
- a.push(`<h${u}>${Se(n[2] ?? "")}</h${u}>`), o += 1;
2191
+ const s = /^(#{1,4})\s+(.*)$/.exec(o);
2192
+ if (s) {
2193
+ const u = Math.min(s[1].length + 1, 5);
2194
+ l.push(`<h${u}>${Le(s[2] ?? "")}</h${u}>`), n += 1;
1908
2195
  continue;
1909
2196
  }
1910
- if (fe(s)) {
1911
- const u = /^\s*\d+[.)]\s+/.test(s), d = [];
1912
- for (; o < t.length && fe(t[o] ?? ""); )
1913
- for (d.push((t[o] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), o += 1; o < t.length; ) {
1914
- const m = t[o] ?? "";
1915
- if (m.trim() === "" || fe(m) || /^(#{1,4})\s/.test(m) || /^```/.test(m))
2197
+ if (he(o)) {
2198
+ const u = /^\s*\d+[.)]\s+/.test(o), d = [];
2199
+ for (; n < t.length && he(t[n] ?? ""); )
2200
+ for (d.push((t[n] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), n += 1; n < t.length; ) {
2201
+ const f = t[n] ?? "";
2202
+ if (f.trim() === "" || he(f) || /^(#{1,4})\s/.test(f) || /^```/.test(f))
1916
2203
  break;
1917
- d[d.length - 1] += ` ${m.trim()}`, o += 1;
2204
+ d[d.length - 1] += ` ${f.trim()}`, n += 1;
1918
2205
  }
1919
2206
  const h = u ? "ol" : "ul";
1920
- a.push(`<${h}>${d.map((m) => `<li>${Se(m)}</li>`).join("")}</${h}>`);
2207
+ l.push(`<${h}>${d.map((f) => `<li>${Le(f)}</li>`).join("")}</${h}>`);
1921
2208
  continue;
1922
2209
  }
1923
2210
  const r = [];
1924
- for (; o < t.length; ) {
1925
- const u = t[o] ?? "";
1926
- if (u.trim() === "" || fe(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
1927
- r.push(u.trim()), o += 1;
2211
+ for (; n < t.length; ) {
2212
+ const u = t[n] ?? "";
2213
+ if (u.trim() === "" || he(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
2214
+ r.push(u.trim()), n += 1;
1928
2215
  }
1929
- a.push(`<p>${Se(r.join(" "))}</p>`);
2216
+ l.push(`<p>${Le(r.join(" "))}</p>`);
1930
2217
  }
1931
- return a.join("");
2218
+ return l.join("");
1932
2219
  }
1933
- const me = "\0";
1934
- function fe(e) {
2220
+ const pe = "\0";
2221
+ function he(e) {
1935
2222
  return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
1936
2223
  }
1937
- function Se(e) {
1938
- const t = [], a = e.replace(/`([^`]+)`/g, (s, i) => (t.push(`<code>${Ae(i)}</code>`), `${me}${t.length - 1}${me}`));
1939
- return Ae(a).replace(
2224
+ function Le(e) {
2225
+ const t = [], l = e.replace(/`([^`]+)`/g, (o, i) => (t.push(`<code>${Ue(i)}</code>`), `${pe}${t.length - 1}${pe}`));
2226
+ return Ue(l).replace(
1940
2227
  /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
1941
2228
  '<a href="$2" target="_blank" rel="noopener">$1</a>'
1942
2229
  ).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
1943
- new RegExp(`${me}(\\d+)${me}`, "g"),
1944
- (s, i) => t[Number(i)] ?? ""
2230
+ new RegExp(`${pe}(\\d+)${pe}`, "g"),
2231
+ (o, i) => t[Number(i)] ?? ""
1945
2232
  );
1946
2233
  }
1947
- function Ae(e) {
2234
+ function Ue(e) {
1948
2235
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1949
2236
  }
1950
- function zl(e) {
1951
- const t = e.scope("webx-admin"), a = /* @__PURE__ */ new Map();
1952
- function o(i, n, r) {
2237
+ function Ga(e) {
2238
+ const t = e.scope("webx-admin"), l = /* @__PURE__ */ new Map();
2239
+ function n(i, s, r) {
1953
2240
  const u = e.state.locale, d = `${u}:${i}`;
1954
- let h = a.get(d);
1955
- return h === void 0 && (h = new Intl.DateTimeFormat(u, n), a.set(d, h)), h.format(r);
2241
+ let h = l.get(d);
2242
+ return h === void 0 && (h = new Intl.DateTimeFormat(u, s), l.set(d, h)), h.format(r);
1956
2243
  }
1957
- const s = (i) => o("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
2244
+ const o = (i) => n("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
1958
2245
  return {
1959
2246
  short(i) {
1960
- const n = pe(i);
1961
- if (n === null)
2247
+ const s = ye(i);
2248
+ if (s === null)
1962
2249
  return t("dates.never");
1963
- const r = /* @__PURE__ */ new Date(), u = Xe(n, r);
1964
- return u === 0 ? t("dates.today", { time: s(n) }) : u === -1 ? t("dates.yesterday", { time: s(n) }) : n.getFullYear() === r.getFullYear() ? o(
2250
+ const r = /* @__PURE__ */ new Date(), u = Qe(s, r);
2251
+ return u === 0 ? t("dates.today", { time: o(s) }) : u === -1 ? t("dates.yesterday", { time: o(s) }) : s.getFullYear() === r.getFullYear() ? n(
1965
2252
  "this-year",
1966
2253
  {
1967
2254
  day: "numeric",
@@ -1970,123 +2257,123 @@ function zl(e) {
1970
2257
  minute: "2-digit",
1971
2258
  hourCycle: "h23"
1972
2259
  },
1973
- n
1974
- ) : o("earlier", { day: "numeric", month: "long", year: "numeric" }, n);
2260
+ s
2261
+ ) : n("earlier", { day: "numeric", month: "long", year: "numeric" }, s);
1975
2262
  },
1976
2263
  compact(i) {
1977
- const n = pe(i);
1978
- if (n === null)
2264
+ const s = ye(i);
2265
+ if (s === null)
1979
2266
  return t("dates.never");
1980
2267
  const r = /* @__PURE__ */ new Date();
1981
- return Xe(n, r) === 0 ? s(n) : n.getFullYear() === r.getFullYear() ? o("compact", { day: "numeric", month: "short" }, n) : o("compact-earlier", { dateStyle: "short" }, n);
2268
+ return Qe(s, r) === 0 ? o(s) : s.getFullYear() === r.getFullYear() ? n("compact", { day: "numeric", month: "short" }, s) : n("compact-earlier", { dateStyle: "short" }, s);
1982
2269
  },
1983
2270
  exact(i) {
1984
- const n = pe(i);
1985
- return n === null ? "" : o("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, n);
2271
+ const s = ye(i);
2272
+ return s === null ? "" : n("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, s);
1986
2273
  },
1987
2274
  iso(i) {
1988
- const n = pe(i);
1989
- return n === null ? "" : n.toISOString();
2275
+ const s = ye(i);
2276
+ return s === null ? "" : s.toISOString();
1990
2277
  }
1991
2278
  };
1992
2279
  }
1993
- function bt() {
1994
- const e = ne(xe, null);
1995
- return zl(e ?? Nl());
2280
+ function kt() {
2281
+ const e = se(Ce, null);
2282
+ return Ga(e ?? Ja());
1996
2283
  }
1997
- let ve = null;
1998
- function Nl() {
1999
- return ve === null && (ve = Ee(), ve.defaults("webx-admin", gt)), ve;
2284
+ let ge = null;
2285
+ function Ja() {
2286
+ return ge === null && (ge = Pe(), ge.defaults("webx-admin", wt)), ge;
2000
2287
  }
2001
- function pe(e) {
2288
+ function ye(e) {
2002
2289
  if (e == null || e === "")
2003
2290
  return null;
2004
2291
  const t = e instanceof Date ? e : new Date(e);
2005
2292
  return Number.isNaN(t.getTime()) ? null : t;
2006
2293
  }
2007
- function Xe(e, t) {
2008
- const a = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate());
2009
- return Math.round((a(e) - a(t)) / 864e5);
2294
+ function Qe(e, t) {
2295
+ const l = (n) => Date.UTC(n.getFullYear(), n.getMonth(), n.getDate());
2296
+ return Math.round((l(e) - l(t)) / 864e5);
2010
2297
  }
2011
- function Ul(e, t, a) {
2012
- const o = e instanceof We ? e.status : El(e);
2013
- if (o === 422)
2014
- return Il(e) ?? a ?? t("errors.unknown");
2015
- if (o === 401) return t("errors.signed-out");
2016
- if (o === 403) return t("errors.forbidden");
2017
- if (o === 404) return t("errors.gone");
2018
- if (o === 409) return t("errors.conflict");
2019
- if (o === 429) {
2020
- const s = e instanceof We ? e.retryAfter : null;
2021
- return s === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: s });
2298
+ function Qa(e, t, l) {
2299
+ const n = e instanceof fe ? e.status : Za(e);
2300
+ if (n === 422)
2301
+ return en(e) ?? l ?? t("errors.unknown");
2302
+ if (n === 401) return t("errors.signed-out");
2303
+ if (n === 403) return t("errors.forbidden");
2304
+ if (n === 404) return t("errors.gone");
2305
+ if (n === 409) return t("errors.conflict");
2306
+ if (n === 429) {
2307
+ const o = e instanceof fe ? e.retryAfter : null;
2308
+ return o === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: o });
2022
2309
  }
2023
- return o !== null && o >= 500 ? t("errors.server") : o === null ? t("errors.offline") : a ?? t("errors.unknown");
2310
+ return n !== null && n >= 500 ? t("errors.server") : n === null ? t("errors.offline") : l ?? t("errors.unknown");
2024
2311
  }
2025
- function Re() {
2026
- const e = P("webx-admin");
2027
- return (t, a) => Ul(t, e, a);
2312
+ function Oe() {
2313
+ const e = O("webx-admin");
2314
+ return (t, l) => Qa(t, e, l);
2028
2315
  }
2029
- function El(e) {
2316
+ function Za(e) {
2030
2317
  const t = e?.status;
2031
2318
  return typeof t == "number" ? t : null;
2032
2319
  }
2033
- function Il(e) {
2034
- const a = e?.body?.message;
2035
- return typeof a == "string" && a !== "" ? a : null;
2320
+ function en(e) {
2321
+ const l = e?.body?.message;
2322
+ return typeof l == "string" && l !== "" ? l : null;
2036
2323
  }
2037
- function Rl(e, t, a) {
2038
- const o = `${e.apiPath}/entities/${t}/${a}/notes`, s = (n) => `${e.apiPath}/notes/${n}`, i = (n) => n.data;
2324
+ function tn(e, t, l) {
2325
+ const n = `${e.apiPath}/entities/${t}/${l}/notes`, o = (s) => `${e.apiPath}/notes/${s}`, i = (s) => s.data;
2039
2326
  return {
2040
- list: () => e.http.get(o).then(i),
2041
- add: (n) => e.http.post(o, { body: n }).then(i),
2042
- save: (n, r) => e.http.put(s(n), { body: r }).then(i),
2043
- remove: (n) => e.http.delete(s(n)).then(() => {
2327
+ list: () => e.http.get(n).then(i),
2328
+ add: (s) => e.http.post(n, { body: s }).then(i),
2329
+ save: (s, r) => e.http.put(o(s), { body: r }).then(i),
2330
+ remove: (s) => e.http.delete(o(s)).then(() => {
2044
2331
  })
2045
2332
  };
2046
2333
  }
2047
- const wt = /* @__PURE__ */ Symbol("wx-category-editor");
2048
- function Bl(e) {
2049
- et(wt, e);
2334
+ const _t = /* @__PURE__ */ Symbol("wx-category-editor");
2335
+ function ln(e) {
2336
+ ze(_t, e);
2050
2337
  }
2051
- function bn() {
2052
- return ne(wt, null);
2338
+ function Bn() {
2339
+ return se(_t, null);
2053
2340
  }
2054
- function Ml(e) {
2341
+ function an(e) {
2055
2342
  return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
2056
2343
  }
2057
- function wn(e, t) {
2058
- const a = q(), o = P("webx-admin"), s = w(() => Ml(t()));
2344
+ function Mn(e, t) {
2345
+ const l = J(), n = O("webx-admin"), o = g(() => an(t()));
2059
2346
  return {
2060
- mode: s,
2061
- sortable: w(() => s.value !== "locked"),
2062
- hint: w(() => o(`categories.order-${s.value}`)),
2063
- move: (i) => da(a, e, i, s.value === "category" ? t().category ?? null : null)
2347
+ mode: o,
2348
+ sortable: g(() => o.value !== "locked"),
2349
+ hint: g(() => n(`categories.order-${o.value}`)),
2350
+ move: (i) => fl(l, e, i, o.value === "category" ? t().category ?? null : null)
2064
2351
  };
2065
2352
  }
2066
- function Be(e = {}) {
2067
- const t = P("webx-admin");
2068
- return (a, o) => t(e[a] ?? `webx-admin::categories.${a}`, o);
2353
+ function De(e = {}) {
2354
+ const t = O("webx-admin");
2355
+ return (l, n) => t(e[l] ?? `webx-admin::categories.${l}`, n);
2069
2356
  }
2070
- const Pl = /* @__PURE__ */ I({
2357
+ const nn = /* @__PURE__ */ M({
2071
2358
  name: "WxCategoryCreateDialog",
2072
2359
  __name: "CategoryCreateDialog",
2073
2360
  props: {
2074
2361
  options: {}
2075
2362
  },
2076
2363
  setup(e) {
2077
- const t = e, { open: a, resolve: o, dismiss: s } = Yt(), i = ce(q(), t.options.api), n = Be(t.options.words), r = A(""), u = A(!1), d = A({}), h = Ze("field");
2078
- Le(async () => {
2079
- await at(), h.value?.querySelector("input")?.focus();
2364
+ const t = e, { open: l, resolve: n, dismiss: o } = Jt(), i = ve(J(), t.options.api), s = De(t.options.words), r = L(""), u = L(!1), d = L({}), h = lt("field");
2365
+ Ee(async () => {
2366
+ await Ie(), h.value?.querySelector("input")?.focus();
2080
2367
  });
2081
- function m(c) {
2368
+ function f(c) {
2082
2369
  const x = Object.keys(d.value).find((p) => p === c || p.startsWith(`${c}.`));
2083
2370
  return x === void 0 ? void 0 : d.value[x]?.[0];
2084
2371
  }
2085
- async function f() {
2372
+ async function v() {
2086
2373
  if (!(r.value.trim() === "" || u.value)) {
2087
2374
  u.value = !0, d.value = {};
2088
2375
  try {
2089
- o(await i.create({ title: r.value.trim() }));
2376
+ n(await i.create({ title: r.value.trim() }));
2090
2377
  } catch (c) {
2091
2378
  d.value = c.body?.errors ?? {};
2092
2379
  } finally {
@@ -2094,32 +2381,32 @@ const Pl = /* @__PURE__ */ I({
2094
2381
  }
2095
2382
  }
2096
2383
  }
2097
- return (c, x) => (v(), T(l(rt), {
2098
- open: l(a),
2099
- "onUpdate:open": x[2] || (x[2] = (p) => tt(a) ? a.value = p : null),
2100
- title: l(n)("new"),
2384
+ return (c, x) => (m(), S(a(rt), {
2385
+ open: a(l),
2386
+ "onUpdate:open": x[2] || (x[2] = (p) => at(l) ? l.value = p : null),
2387
+ title: a(s)("new"),
2101
2388
  width: 440
2102
2389
  }, {
2103
2390
  footer: y(() => [
2104
- b(l(Gt), { size: "sm" }, {
2391
+ w(a(Zt), { size: "sm" }, {
2105
2392
  default: y(() => [
2106
- b(l(Q), {
2393
+ w(a(le), {
2107
2394
  variant: "outline",
2108
- onClick: x[1] || (x[1] = (p) => l(s)())
2395
+ onClick: x[1] || (x[1] = (p) => a(o)())
2109
2396
  }, {
2110
2397
  default: y(() => [
2111
- V(W(l(n)("cancel")), 1)
2398
+ z(A(a(s)("cancel")), 1)
2112
2399
  ]),
2113
2400
  _: 1
2114
2401
  }),
2115
- b(l(Q), {
2402
+ w(a(le), {
2116
2403
  type: "primary",
2117
2404
  loading: u.value,
2118
2405
  disabled: r.value.trim() === "",
2119
- onClick: f
2406
+ onClick: v
2120
2407
  }, {
2121
2408
  default: y(() => [
2122
- V(W(l(n)("create")), 1)
2409
+ z(A(a(s)("create")), 1)
2123
2410
  ]),
2124
2411
  _: 1
2125
2412
  }, 8, ["loading", "disabled"])
@@ -2128,9 +2415,9 @@ const Pl = /* @__PURE__ */ I({
2128
2415
  })
2129
2416
  ]),
2130
2417
  default: y(() => [
2131
- b(l(Xt), {
2132
- label: l(n)("field-title"),
2133
- error: m("title") ?? m("slug"),
2418
+ w(a(Qt), {
2419
+ label: a(s)("field-title"),
2420
+ error: f("title") ?? f("slug"),
2134
2421
  required: ""
2135
2422
  }, {
2136
2423
  default: y(() => [
@@ -2138,11 +2425,11 @@ const Pl = /* @__PURE__ */ I({
2138
2425
  ref_key: "field",
2139
2426
  ref: h
2140
2427
  }, [
2141
- b(l(be), {
2428
+ w(a(Te), {
2142
2429
  modelValue: r.value,
2143
2430
  "onUpdate:modelValue": x[0] || (x[0] = (p) => r.value = p),
2144
- "aria-label": l(n)("field-title"),
2145
- onKeyup: lt(f, ["enter"])
2431
+ "aria-label": a(s)("field-title"),
2432
+ onKeyup: nt(v, ["enter"])
2146
2433
  }, null, 8, ["modelValue", "aria-label"])
2147
2434
  ], 512)
2148
2435
  ]),
@@ -2152,136 +2439,136 @@ const Pl = /* @__PURE__ */ I({
2152
2439
  _: 1
2153
2440
  }, 8, ["open", "title"]));
2154
2441
  }
2155
- }), Dl = { class: "wx-category-row__name" }, Fl = /* @__PURE__ */ I({
2442
+ }), on = { class: "wx-category-row__name" }, sn = /* @__PURE__ */ M({
2156
2443
  name: "WxCategoriesPage",
2157
2444
  __name: "CategoriesPage",
2158
2445
  props: {
2159
2446
  options: {}
2160
2447
  },
2161
2448
  setup(e) {
2162
- const t = e, a = q(), o = ce(a, t.options.api), s = ye(), i = Be(t.options.words), n = Re(), r = A([]), u = A(!0), d = A(!0), h = w(() => a.can(t.options.manage)), m = w(
2163
- () => a.state.manifest?.modules.find((C) => C.id === t.options.module)?.title ?? ""
2164
- ), f = Jt(Pl), c = w(
2449
+ const t = e, l = J(), n = ve(l, t.options.api), o = _e(), i = De(t.options.words), s = Oe(), r = L([]), u = L(!0), d = L(!0), h = g(() => l.can(t.options.manage)), f = g(
2450
+ () => l.state.manifest?.modules.find((V) => V.id === t.options.module)?.title ?? ""
2451
+ ), v = el(nn), c = g(
2165
2452
  () => h.value ? [{ key: "new", label: i("new"), icon: "plus", primary: !0, run: () => {
2166
- k();
2453
+ T();
2167
2454
  } }] : []
2168
2455
  );
2169
- function x(C) {
2170
- return Number(C[t.options.count] ?? 0);
2456
+ function x(V) {
2457
+ return Number(V[t.options.count] ?? 0);
2171
2458
  }
2172
2459
  async function p() {
2173
2460
  u.value = !0;
2174
2461
  try {
2175
- const C = await o.list();
2176
- r.value = C.data, d.value = C.prefix !== null;
2177
- } catch (C) {
2178
- D.danger(n(C));
2462
+ const V = await n.list();
2463
+ r.value = V.data, d.value = V.prefix !== null;
2464
+ } catch (V) {
2465
+ K.danger(s(V));
2179
2466
  } finally {
2180
2467
  u.value = !1;
2181
2468
  }
2182
2469
  }
2183
2470
  p();
2184
- function g(C) {
2185
- s.push(`${t.options.path}/${C.id}`);
2471
+ function b(V) {
2472
+ o.push(`${t.options.path}/${V.id}`);
2186
2473
  }
2187
- async function k() {
2188
- const C = await f({ options: t.options });
2189
- C !== void 0 && g(C);
2474
+ async function T() {
2475
+ const V = await v({ options: t.options });
2476
+ V !== void 0 && b(V);
2190
2477
  }
2191
- async function U(C) {
2192
- if (x(C) > 0) {
2193
- D.warning(i("delete-blocked"));
2478
+ async function F(V) {
2479
+ if (x(V) > 0) {
2480
+ K.warning(i("delete-blocked"));
2194
2481
  return;
2195
2482
  }
2196
- if (await ge({
2197
- title: i("delete-title", { name: C.name }),
2483
+ if (await xe({
2484
+ title: i("delete-title", { name: V.name }),
2198
2485
  message: i("delete-text"),
2199
2486
  confirmText: i("delete"),
2200
2487
  cancelText: i("cancel"),
2201
2488
  tone: "danger"
2202
2489
  }))
2203
2490
  try {
2204
- await o.remove(C.id), D.success(i("deleted")), await p();
2205
- } catch (E) {
2206
- D.danger(n(E));
2491
+ await n.remove(V.id), K.success(i("deleted")), await p();
2492
+ } catch (C) {
2493
+ K.danger(s(C));
2207
2494
  }
2208
2495
  }
2209
- function J(C) {
2210
- const L = [{ key: "edit", label: i("edit"), icon: "edit", run: () => g(C) }], E = t.options.items;
2211
- return E && x(C) > 0 && L.push({
2496
+ function Q(V) {
2497
+ const k = [{ key: "edit", label: i("edit"), icon: "edit", run: () => b(V) }], C = t.options.items;
2498
+ return C && x(V) > 0 && k.push({
2212
2499
  key: "items",
2213
2500
  label: i("show-items"),
2214
2501
  icon: "file-txt",
2215
2502
  run: () => {
2216
- s.push(E(C.id));
2503
+ o.push(C(V.id));
2217
2504
  }
2218
- }), C.url && C.is_visible && L.push({ key: "site", label: i("open-on-site"), icon: "link", href: C.url }), h.value && L.push({
2505
+ }), V.url && V.is_visible && k.push({ key: "site", label: i("open-on-site"), icon: "link", href: V.url }), h.value && k.push({
2219
2506
  key: "delete",
2220
2507
  label: i("delete"),
2221
2508
  icon: "trash",
2222
2509
  danger: !0,
2223
2510
  run: () => {
2224
- U(C);
2511
+ F(V);
2225
2512
  }
2226
- }), L;
2513
+ }), k;
2227
2514
  }
2228
- async function j() {
2515
+ async function H() {
2229
2516
  try {
2230
- await o.reorder(r.value.map((C) => C.id));
2231
- } catch (C) {
2232
- D.danger(n(C, i("reorder-failed"))), await p();
2517
+ await n.reorder(r.value.map((V) => V.id));
2518
+ } catch (V) {
2519
+ K.danger(s(V, i("reorder-failed"))), await p();
2233
2520
  }
2234
2521
  }
2235
- return (C, L) => {
2236
- const E = H("router-link");
2237
- return v(), T(ft, {
2522
+ return (V, k) => {
2523
+ const C = X("router-link");
2524
+ return m(), S(ht, {
2238
2525
  class: "wx-categories",
2239
- title: m.value,
2526
+ title: f.value,
2240
2527
  actions: c.value,
2241
2528
  padding: "sm"
2242
2529
  }, {
2243
2530
  default: y(() => [
2244
- u.value ? (v(), T(l(de), {
2531
+ u.value ? (m(), S(a(me), {
2245
2532
  key: 0,
2246
2533
  class: "wx-categories__loading",
2247
2534
  rows: 5
2248
- })) : r.value.length === 0 ? (v(), T(l(ut), {
2535
+ })) : r.value.length === 0 ? (m(), S(a(ut), {
2249
2536
  key: 1,
2250
- title: l(i)("empty"),
2251
- description: l(i)("empty-help")
2252
- }, null, 8, ["title", "description"])) : (v(), _(F, { key: 2 }, [
2253
- b(l(st), {
2537
+ title: a(i)("empty"),
2538
+ description: a(i)("empty-help")
2539
+ }, null, 8, ["title", "description"])) : (m(), $(j, { key: 2 }, [
2540
+ w(a(Be), {
2254
2541
  modelValue: r.value,
2255
- "onUpdate:modelValue": L[0] || (L[0] = (S) => r.value = S),
2542
+ "onUpdate:modelValue": k[0] || (k[0] = (_) => r.value = _),
2256
2543
  class: "wx-categories__list",
2257
2544
  plain: "",
2258
2545
  "item-key": "id",
2259
- "item-label": (S) => S.name,
2546
+ "item-label": (_) => _.name,
2260
2547
  disabled: !h.value,
2261
- onMove: j
2548
+ onMove: H
2262
2549
  }, {
2263
- default: y(({ item: S }) => [
2264
- b(E, {
2265
- class: le(["wx-category-row", { "is-hidden": !S.is_visible }]),
2266
- to: `${t.options.path}/${S.id}`
2550
+ default: y(({ item: _ }) => [
2551
+ w(C, {
2552
+ class: oe(["wx-category-row", { "is-hidden": !_.is_visible }]),
2553
+ to: `${t.options.path}/${_.id}`
2267
2554
  }, {
2268
2555
  default: y(() => [
2269
- B("span", Dl, [
2270
- b(l(G), {
2556
+ B("span", on, [
2557
+ w(a(ee), {
2271
2558
  truncate: "",
2272
2559
  weight: "medium"
2273
2560
  }, {
2274
2561
  default: y(() => [
2275
- V(W(S.name), 1)
2562
+ z(A(_.name), 1)
2276
2563
  ]),
2277
2564
  _: 2
2278
2565
  }, 1024),
2279
- S.is_visible ? N("", !0) : (v(), T(l(dt), {
2566
+ _.is_visible ? N("", !0) : (m(), S(a(dt), {
2280
2567
  key: 0,
2281
- content: l(i)("hidden")
2568
+ content: a(i)("hidden")
2282
2569
  }, {
2283
2570
  default: y(() => [
2284
- b(l(Ue), {
2571
+ w(a(Me), {
2285
2572
  name: "eye-off",
2286
2573
  size: "sm"
2287
2574
  })
@@ -2289,14 +2576,14 @@ const Pl = /* @__PURE__ */ I({
2289
2576
  _: 1
2290
2577
  }, 8, ["content"]))
2291
2578
  ]),
2292
- d.value ? (v(), T(l(G), {
2579
+ d.value ? (m(), S(a(ee), {
2293
2580
  key: 0,
2294
2581
  size: "sm",
2295
2582
  tone: "muted",
2296
2583
  truncate: ""
2297
2584
  }, {
2298
2585
  default: y(() => [
2299
- V(W(S.path === null ? l(i)("no-address") : `/${S.path}`), 1)
2586
+ z(A(_.path === null ? a(i)("no-address") : `/${_.path}`), 1)
2300
2587
  ]),
2301
2588
  _: 2
2302
2589
  }, 1024)) : N("", !0)
@@ -2304,28 +2591,28 @@ const Pl = /* @__PURE__ */ I({
2304
2591
  _: 2
2305
2592
  }, 1032, ["class", "to"])
2306
2593
  ]),
2307
- actions: y(({ item: S }) => [
2308
- b(l(G), {
2594
+ actions: y(({ item: _ }) => [
2595
+ w(a(ee), {
2309
2596
  class: "wx-category-row__count",
2310
2597
  size: "sm",
2311
2598
  tone: "muted"
2312
2599
  }, {
2313
2600
  default: y(() => [
2314
- V(W(l(i)("count", { count: x(S) })), 1)
2601
+ z(A(a(i)("count", { count: x(_) })), 1)
2315
2602
  ]),
2316
2603
  _: 2
2317
2604
  }, 1024),
2318
- b(Ie, {
2319
- actions: J(S),
2320
- label: S.name
2605
+ w(Fe, {
2606
+ actions: Q(_),
2607
+ label: _.name
2321
2608
  }, null, 8, ["actions", "label"])
2322
2609
  ]),
2323
2610
  _: 1
2324
2611
  }, 8, ["modelValue", "item-label", "disabled"]),
2325
- b(l(we), {
2612
+ w(a(Se), {
2326
2613
  class: "wx-categories__note",
2327
2614
  type: "info",
2328
- description: l(i)("order")
2615
+ description: a(i)("order")
2329
2616
  }, null, 8, ["description"])
2330
2617
  ], 64))
2331
2618
  ]),
@@ -2333,45 +2620,45 @@ const Pl = /* @__PURE__ */ I({
2333
2620
  }, 8, ["title", "actions"]);
2334
2621
  };
2335
2622
  }
2336
- }), Ol = {
2623
+ }), rn = {
2337
2624
  class: "wx-save-state",
2338
2625
  role: "status",
2339
2626
  "aria-live": "polite"
2340
- }, Hl = /* @__PURE__ */ I({
2627
+ }, un = /* @__PURE__ */ M({
2341
2628
  __name: "SaveState",
2342
2629
  props: {
2343
2630
  state: {},
2344
2631
  linger: { default: 2e3 }
2345
2632
  },
2346
2633
  setup(e) {
2347
- const t = e, a = P("webx-admin"), o = A(!1);
2348
- let s = null;
2349
- Z(
2634
+ const t = e, l = O("webx-admin"), n = L(!1);
2635
+ let o = null;
2636
+ te(
2350
2637
  () => t.state,
2351
- (n, r) => {
2352
- s !== null && clearTimeout(s), o.value = r === "saving" && n === "saved", o.value && (s = window.setTimeout(() => {
2353
- o.value = !1, s = null;
2638
+ (s, r) => {
2639
+ o !== null && clearTimeout(o), n.value = r === "saving" && s === "saved", n.value && (o = window.setTimeout(() => {
2640
+ n.value = !1, o = null;
2354
2641
  }, t.linger));
2355
2642
  }
2356
2643
  );
2357
- const i = w(
2358
- () => t.state === "saving" ? "saving" : o.value ? "saved" : null
2644
+ const i = g(
2645
+ () => t.state === "saving" ? "saving" : n.value ? "saved" : null
2359
2646
  );
2360
- return nt(() => {
2361
- s !== null && clearTimeout(s);
2362
- }), (n, r) => (v(), _("span", Ol, [
2363
- i.value ? (v(), T(l(Ue), {
2647
+ return ot(() => {
2648
+ o !== null && clearTimeout(o);
2649
+ }), (s, r) => (m(), $("span", rn, [
2650
+ i.value ? (m(), S(a(Me), {
2364
2651
  key: 0,
2365
- class: le(["wx-save-state__mark", { "is-saved": i.value === "saved" }]),
2652
+ class: oe(["wx-save-state__mark", { "is-saved": i.value === "saved" }]),
2366
2653
  name: i.value === "saving" ? "loader" : "check",
2367
2654
  spin: i.value === "saving",
2368
- label: l(a)(`editor.${i.value}`)
2655
+ label: a(l)(`editor.${i.value}`)
2369
2656
  }, null, 8, ["class", "name", "spin", "label"])) : N("", !0)
2370
2657
  ]));
2371
2658
  }
2372
- }), jl = /* @__PURE__ */ K(Hl, [["__scopeId", "data-v-216e5e44"]]), Kl = { class: "wx-screen-host" }, ql = /* @__PURE__ */ I({
2659
+ }), dn = /* @__PURE__ */ G(un, [["__scopeId", "data-v-216e5e44"]]), cn = { class: "wx-screen-host" }, mn = /* @__PURE__ */ M({
2373
2660
  __name: "Screen",
2374
- props: /* @__PURE__ */ ae({
2661
+ props: /* @__PURE__ */ ne({
2375
2662
  name: {},
2376
2663
  errors: { default: void 0 },
2377
2664
  disabled: { type: Boolean, default: !1 },
@@ -2382,39 +2669,39 @@ const Pl = /* @__PURE__ */ I({
2382
2669
  modelValue: { default: () => ({}) },
2383
2670
  modelModifiers: {}
2384
2671
  }),
2385
- emits: /* @__PURE__ */ ae(["loaded"], ["update:modelValue"]),
2386
- setup(e, { expose: t, emit: a }) {
2387
- const o = e, s = a, i = se(e, "modelValue"), n = q(), r = P("webx-admin"), u = A(null), d = A(null);
2672
+ emits: /* @__PURE__ */ ne(["loaded"], ["update:modelValue"]),
2673
+ setup(e, { expose: t, emit: l }) {
2674
+ const n = e, o = l, i = re(e, "modelValue"), s = J(), r = O("webx-admin"), u = L(null), d = L(null);
2388
2675
  async function h() {
2389
2676
  u.value = null, d.value = null;
2390
2677
  try {
2391
- const m = await n.loadScreen(o.name);
2392
- u.value = m, s("loaded", m);
2393
- } catch (m) {
2394
- d.value = m instanceof Error ? m.message : String(m);
2678
+ const f = await s.loadScreen(n.name);
2679
+ u.value = f, o("loaded", f);
2680
+ } catch (f) {
2681
+ d.value = f instanceof Error ? f.message : String(f);
2395
2682
  }
2396
2683
  }
2397
- return Z([() => o.name, () => n.i18n.state.locale], () => {
2684
+ return te([() => n.name, () => s.i18n.state.locale], () => {
2398
2685
  h();
2399
- }, { immediate: !0 }), t({ reload: h }), (m, f) => (v(), _("div", Kl, [
2400
- d.value ? (v(), T(l(we), {
2686
+ }, { immediate: !0 }), t({ reload: h }), (f, v) => (m(), $("div", cn, [
2687
+ d.value ? (m(), S(a(Se), {
2401
2688
  key: 0,
2402
2689
  type: "danger",
2403
- title: l(r)("shell.error-title"),
2690
+ title: a(r)("shell.error-title"),
2404
2691
  description: d.value
2405
- }, null, 8, ["title", "description"])) : u.value === null ? (v(), T(l(de), {
2692
+ }, null, 8, ["title", "description"])) : u.value === null ? (m(), S(a(me), {
2406
2693
  key: 1,
2407
2694
  rows: 4
2408
- })) : (v(), T(l(sa), {
2695
+ })) : (m(), S(a(ul), {
2409
2696
  key: 2,
2410
2697
  modelValue: i.value,
2411
- "onUpdate:modelValue": f[0] || (f[0] = (c) => i.value = c),
2698
+ "onUpdate:modelValue": v[0] || (v[0] = (c) => i.value = c),
2412
2699
  root: u.value,
2413
- patch: l(n).screenPatch(e.name),
2414
- types: l(n).types,
2700
+ patch: a(s).screenPatch(e.name),
2701
+ types: a(s).types,
2415
2702
  errors: e.errors,
2416
- translate: l(n).i18n.t,
2417
- can: l(n).can,
2703
+ translate: a(s).i18n.t,
2704
+ can: a(s).can,
2418
2705
  disabled: e.disabled,
2419
2706
  "label-position": e.labelPosition,
2420
2707
  "label-width": e.labelWidth,
@@ -2422,141 +2709,141 @@ const Pl = /* @__PURE__ */ I({
2422
2709
  }, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
2423
2710
  ]));
2424
2711
  }
2425
- }), Yl = /* @__PURE__ */ I({
2712
+ }), fn = /* @__PURE__ */ M({
2426
2713
  name: "WxCategoryEditorPage",
2427
2714
  __name: "CategoryEditorPage",
2428
2715
  props: {
2429
2716
  options: {}
2430
2717
  },
2431
2718
  setup(e) {
2432
- const t = e, a = q(), o = ce(a, t.options.api), s = ot(), i = ye(), n = it(), r = Be(t.options.words), u = Re(), d = w(() => Number(s.params.id)), h = w(() => t.options.path), m = A(null), f = A({}), c = A(null), x = A(""), p = A(!0), g = A(!1), k = A({}), U = w(() => a.can(t.options.manage)), J = w(() => JSON.stringify(f.value)), j = w(() => x.value !== "" && J.value !== x.value), C = w(() => g.value ? "saving" : j.value ? "unsaved" : "saved"), L = w(
2433
- () => a.state.manifest?.modules.find((z) => z.id === t.options.module)?.title ?? ""
2434
- ), E = w(() => {
2435
- const z = f.value.title;
2436
- return Qt(z, n.active.value, m.value?.name ?? "") || r("untitled");
2719
+ const t = e, l = J(), n = ve(l, t.options.api), o = st(), i = _e(), s = it(), r = De(t.options.words), u = Oe(), d = g(() => Number(o.params.id)), h = g(() => t.options.path), f = L(null), v = L({}), c = L(null), x = L(""), p = L(!0), b = L(!1), T = L({}), F = g(() => l.can(t.options.manage)), Q = g(() => JSON.stringify(v.value)), H = g(() => x.value !== "" && Q.value !== x.value), V = g(() => b.value ? "saving" : H.value ? "unsaved" : "saved"), k = g(
2720
+ () => l.state.manifest?.modules.find((E) => E.id === t.options.module)?.title ?? ""
2721
+ ), C = g(() => {
2722
+ const E = v.value.title;
2723
+ return tl(E, s.active.value, f.value?.name ?? "") || r("untitled");
2437
2724
  });
2438
- Bl({ category: m, values: f, prefix: c, moving: () => r("address-moving") }), Ga({
2439
- values: f,
2725
+ ln({ category: f, values: v, prefix: c, moving: () => r("address-moving") }), ya({
2726
+ values: v,
2440
2727
  prefix: c,
2441
- path: w(() => m.value?.path),
2728
+ path: g(() => f.value?.path),
2442
2729
  moving: () => r("address-moving")
2443
2730
  });
2444
- function S(z) {
2445
- m.value = z.category, f.value = z.values, c.value = z.prefix, x.value = JSON.stringify(z.values);
2731
+ function _(E) {
2732
+ f.value = E.category, v.value = E.values, c.value = E.prefix, x.value = JSON.stringify(E.values);
2446
2733
  }
2447
- async function Y() {
2734
+ async function q() {
2448
2735
  p.value = !0;
2449
2736
  try {
2450
- S(await o.get(d.value));
2451
- } catch (z) {
2452
- D.danger(u(z)), i.push(h.value);
2737
+ _(await n.get(d.value));
2738
+ } catch (E) {
2739
+ K.danger(u(E)), i.push(h.value);
2453
2740
  } finally {
2454
2741
  p.value = !1;
2455
2742
  }
2456
2743
  }
2457
- async function oe() {
2458
- if (!(!m.value || g.value || !U.value)) {
2459
- g.value = !0, k.value = {};
2744
+ async function R() {
2745
+ if (!(!f.value || b.value || !F.value)) {
2746
+ b.value = !0, T.value = {};
2460
2747
  try {
2461
- S(await o.save(m.value.id, f.value)), D.success(r("saved"));
2462
- } catch (z) {
2463
- const X = z.body;
2464
- X?.errors ? (k.value = X.errors, D.danger(r("save-failed"))) : D.danger(u(z));
2748
+ _(await n.save(f.value.id, v.value)), K.success(r("saved"));
2749
+ } catch (E) {
2750
+ const Z = E.body;
2751
+ Z?.errors ? (T.value = Z.errors, K.danger(r("save-failed"))) : K.danger(u(E));
2465
2752
  } finally {
2466
- g.value = !1;
2753
+ b.value = !1;
2467
2754
  }
2468
2755
  }
2469
2756
  }
2470
- async function re() {
2471
- const z = m.value;
2472
- if (!(!z || !await ge({
2473
- title: r("delete-title", { name: z.name }),
2757
+ async function U() {
2758
+ const E = f.value;
2759
+ if (!(!E || !await xe({
2760
+ title: r("delete-title", { name: E.name }),
2474
2761
  message: r("delete-text"),
2475
2762
  confirmText: r("delete"),
2476
2763
  cancelText: r("cancel"),
2477
2764
  tone: "danger"
2478
2765
  })))
2479
2766
  try {
2480
- await o.remove(z.id), D.success(r("deleted")), x.value = J.value, i.push(h.value);
2481
- } catch ($) {
2482
- D.danger(u($));
2767
+ await n.remove(E.id), K.success(r("deleted")), x.value = Q.value, i.push(h.value);
2768
+ } catch (W) {
2769
+ K.danger(u(W));
2483
2770
  }
2484
2771
  }
2485
- function te(z) {
2486
- j.value && z.preventDefault();
2772
+ function I(E) {
2773
+ H.value && E.preventDefault();
2487
2774
  }
2488
- function ke(z) {
2489
- (z.ctrlKey || z.metaKey) && z.key.toLowerCase() === "s" && (z.preventDefault(), j.value && oe());
2775
+ function de(E) {
2776
+ (E.ctrlKey || E.metaKey) && E.key.toLowerCase() === "s" && (E.preventDefault(), H.value && R());
2490
2777
  }
2491
- Z(d, () => {
2492
- Y();
2493
- }), Le(() => {
2494
- Y(), window.addEventListener("beforeunload", te);
2495
- }), nt(() => {
2496
- window.removeEventListener("beforeunload", te);
2497
- }), zt(async () => !j.value || !U.value ? !0 : await ge({
2778
+ te(d, () => {
2779
+ q();
2780
+ }), Ee(() => {
2781
+ q(), window.addEventListener("beforeunload", I);
2782
+ }), ot(() => {
2783
+ window.removeEventListener("beforeunload", I);
2784
+ }), zt(async () => !H.value || !F.value ? !0 : await xe({
2498
2785
  title: r("leave-title"),
2499
2786
  message: r("leave-text"),
2500
2787
  confirmText: r("leave"),
2501
2788
  cancelText: r("cancel"),
2502
2789
  tone: "danger"
2503
2790
  }));
2504
- const _e = w(() => {
2505
- const z = m.value, X = [];
2506
- return z && (z.url && z.is_visible && X.push({ key: "site", label: r("open-on-site"), icon: "link", href: z.url }), U.value && X.push({
2791
+ const ie = g(() => {
2792
+ const E = f.value, Z = [];
2793
+ return E && (E.url && E.is_visible && Z.push({ key: "site", label: r("open-on-site"), icon: "link", href: E.url }), F.value && Z.push({
2507
2794
  key: "delete",
2508
2795
  label: r("delete"),
2509
2796
  icon: "trash",
2510
2797
  danger: !0,
2511
2798
  menu: !0,
2512
2799
  run: () => {
2513
- re();
2800
+ U();
2514
2801
  }
2515
- })), X;
2802
+ })), Z;
2516
2803
  });
2517
- return (z, X) => (v(), _("div", {
2804
+ return (E, Z) => (m(), $("div", {
2518
2805
  class: "wx-category-editor",
2519
- onKeydown: ke
2806
+ onKeydown: de
2520
2807
  }, [
2521
- p.value || !m.value ? (v(), _(F, { key: 0 }, [
2522
- b(l(de), {
2808
+ p.value || !f.value ? (m(), $(j, { key: 0 }, [
2809
+ w(a(me), {
2523
2810
  class: "wx-category-editor__ghost",
2524
2811
  title: "",
2525
2812
  rows: 1
2526
2813
  }),
2527
- b(l(Ce), null, {
2814
+ w(a(Re), null, {
2528
2815
  default: y(() => [
2529
- b(l(de), { rows: 6 })
2816
+ w(a(me), { rows: 6 })
2530
2817
  ]),
2531
2818
  _: 1
2532
2819
  })
2533
- ], 64)) : (v(), _(F, { key: 1 }, [
2534
- b(mt, {
2820
+ ], 64)) : (m(), $(j, { key: 1 }, [
2821
+ w(pt, {
2535
2822
  divider: "",
2536
2823
  back: h.value,
2537
- "back-label": L.value,
2538
- title: E.value,
2539
- subtitle: m.value.path === null ? void 0 : `/${m.value.path}`,
2540
- actions: _e.value
2541
- }, Ve({
2824
+ "back-label": k.value,
2825
+ title: C.value,
2826
+ subtitle: f.value.path === null ? void 0 : `/${f.value.path}`,
2827
+ actions: ie.value
2828
+ }, ke({
2542
2829
  trail: y(() => [
2543
- b(l(Zt), {
2830
+ w(a(ll), {
2544
2831
  size: "sm",
2545
- label: l(r)("trail")
2832
+ label: a(r)("trail")
2546
2833
  }, {
2547
2834
  default: y(() => [
2548
- b(l(Fe), {
2835
+ w(a(je), {
2549
2836
  as: "router-link",
2550
2837
  to: h.value
2551
2838
  }, {
2552
2839
  default: y(() => [
2553
- V(W(L.value), 1)
2840
+ z(A(k.value), 1)
2554
2841
  ]),
2555
2842
  _: 1
2556
2843
  }, 8, ["to"]),
2557
- b(l(Fe), { current: "" }, {
2844
+ w(a(je), { current: "" }, {
2558
2845
  default: y(() => [
2559
- V(W(E.value), 1)
2846
+ z(A(C.value), 1)
2560
2847
  ]),
2561
2848
  _: 1
2562
2849
  })
@@ -2566,12 +2853,12 @@ const Pl = /* @__PURE__ */ I({
2566
2853
  ]),
2567
2854
  _: 2
2568
2855
  }, [
2569
- m.value.is_visible ? void 0 : {
2856
+ f.value.is_visible ? void 0 : {
2570
2857
  name: "title-after",
2571
2858
  fn: y(() => [
2572
- b(l(ze), { dot: "" }, {
2859
+ w(a($e), { dot: "" }, {
2573
2860
  default: y(() => [
2574
- V(W(l(r)("hidden")), 1)
2861
+ z(A(a(r)("hidden")), 1)
2575
2862
  ]),
2576
2863
  _: 1
2577
2864
  })
@@ -2579,26 +2866,26 @@ const Pl = /* @__PURE__ */ I({
2579
2866
  key: "0"
2580
2867
  }
2581
2868
  ]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
2582
- b(ql, {
2583
- modelValue: f.value,
2584
- "onUpdate:modelValue": X[0] || (X[0] = ($) => f.value = $),
2869
+ w(mn, {
2870
+ modelValue: v.value,
2871
+ "onUpdate:modelValue": Z[0] || (Z[0] = (W) => v.value = W),
2585
2872
  name: t.options.screen,
2586
- errors: k.value,
2587
- disabled: !U.value || g.value
2873
+ errors: T.value,
2874
+ disabled: !F.value || b.value
2588
2875
  }, null, 8, ["modelValue", "name", "errors", "disabled"]),
2589
- U.value ? (v(), T(l(ea), { key: 0 }, {
2876
+ F.value ? (m(), S(a(al), { key: 0 }, {
2590
2877
  state: y(() => [
2591
- b(jl, { state: C.value }, null, 8, ["state"])
2878
+ w(dn, { state: V.value }, null, 8, ["state"])
2592
2879
  ]),
2593
2880
  default: y(() => [
2594
- b(l(Q), {
2881
+ w(a(le), {
2595
2882
  type: "primary",
2596
- loading: g.value,
2597
- disabled: !j.value,
2598
- onClick: oe
2883
+ loading: b.value,
2884
+ disabled: !H.value,
2885
+ onClick: R
2599
2886
  }, {
2600
2887
  default: y(() => [
2601
- V(W(l(r)("save")), 1)
2888
+ z(A(a(r)("save")), 1)
2602
2889
  ]),
2603
2890
  _: 1
2604
2891
  }, 8, ["loading", "disabled"])
@@ -2608,44 +2895,44 @@ const Pl = /* @__PURE__ */ I({
2608
2895
  ], 64))
2609
2896
  ], 32));
2610
2897
  }
2611
- }), Xl = /* @__PURE__ */ K(Yl, [["__scopeId", "data-v-86d85f8c"]]);
2612
- function Ge(e, t) {
2613
- return I({
2898
+ }), vn = /* @__PURE__ */ G(fn, [["__scopeId", "data-v-86d85f8c"]]);
2899
+ function Ze(e, t) {
2900
+ return M({
2614
2901
  name: "WxCategoriesView",
2615
- setup: () => () => ue(e, { options: t })
2902
+ setup: () => () => ce(e, { options: t })
2616
2903
  });
2617
2904
  }
2618
- function xn(e) {
2905
+ function Pn(e) {
2619
2906
  return [
2620
- { path: e.path, name: e.name, component: Ge(Fl, e) },
2907
+ { path: e.path, name: e.name, component: Ze(sn, e) },
2621
2908
  {
2622
2909
  path: `${e.path}/:id(\\d+)`,
2623
2910
  name: `${e.name}.edit`,
2624
- component: Ge(Xl, e)
2911
+ component: Ze(vn, e)
2625
2912
  }
2626
2913
  ];
2627
2914
  }
2628
- const kn = 76, _n = /* @__PURE__ */ I({
2915
+ const Fn = 76, On = /* @__PURE__ */ M({
2629
2916
  __name: "FilterChips",
2630
2917
  props: {
2631
2918
  filters: {}
2632
2919
  },
2633
2920
  setup(e) {
2634
- return (t, a) => (v(!0), _(F, null, ee(e.filters, (o) => (v(), T(l(ze), {
2635
- key: o.key,
2921
+ return (t, l) => (m(!0), $(j, null, ae(e.filters, (n) => (m(), S(a($e), {
2922
+ key: n.key,
2636
2923
  class: "wx-filter-chip",
2637
2924
  size: "sm",
2638
2925
  round: "",
2639
2926
  closable: "",
2640
- onClose: (s) => o.clear()
2927
+ onClose: (o) => n.clear()
2641
2928
  }, {
2642
2929
  default: y(() => [
2643
- V(W(o.label), 1)
2930
+ z(A(n.label), 1)
2644
2931
  ]),
2645
2932
  _: 2
2646
2933
  }, 1032, ["onClose"]))), 128));
2647
2934
  }
2648
- }), Gl = { class: "wx-rename__footer" }, Jl = /* @__PURE__ */ I({
2935
+ }), pn = { class: "wx-rename__footer" }, hn = /* @__PURE__ */ M({
2649
2936
  __name: "RenameButton",
2650
2937
  props: {
2651
2938
  name: { default: "" },
@@ -2656,21 +2943,21 @@ const kn = 76, _n = /* @__PURE__ */ I({
2656
2943
  },
2657
2944
  emits: ["rename"],
2658
2945
  setup(e, { emit: t }) {
2659
- const a = e, o = t, s = P("webx-admin"), i = A(!1), n = A(a.name), r = A(null), u = w(() => a.label ?? s("editor.rename"));
2660
- Z(i, async (h) => {
2661
- h && (n.value = a.name, await at(), r.value?.focus(), r.value?.select());
2946
+ const l = e, n = t, o = O("webx-admin"), i = L(!1), s = L(l.name), r = L(null), u = g(() => l.label ?? o("editor.rename"));
2947
+ te(i, async (h) => {
2948
+ h && (s.value = l.name, await Ie(), r.value?.focus(), r.value?.select());
2662
2949
  });
2663
2950
  function d() {
2664
- const h = n.value.trim();
2665
- if (h === "" || h === a.name) {
2951
+ const h = s.value.trim();
2952
+ if (h === "" || h === l.name) {
2666
2953
  i.value = !1;
2667
2954
  return;
2668
2955
  }
2669
- o("rename", h), i.value = !1;
2956
+ n("rename", h), i.value = !1;
2670
2957
  }
2671
- return (h, m) => (v(), T(l(ta), {
2958
+ return (h, f) => (m(), S(a(nl), {
2672
2959
  open: i.value,
2673
- "onUpdate:open": m[2] || (m[2] = (f) => i.value = f),
2960
+ "onUpdate:open": f[2] || (f[2] = (v) => i.value = v),
2674
2961
  title: u.value,
2675
2962
  width: 320,
2676
2963
  side: "bottom",
@@ -2678,7 +2965,7 @@ const kn = 76, _n = /* @__PURE__ */ I({
2678
2965
  teleport: ""
2679
2966
  }, {
2680
2967
  trigger: y(() => [
2681
- b(l(ie), {
2968
+ w(a(ue), {
2682
2969
  type: "edit",
2683
2970
  title: u.value,
2684
2971
  size: e.size,
@@ -2688,25 +2975,25 @@ const kn = 76, _n = /* @__PURE__ */ I({
2688
2975
  default: y(() => [
2689
2976
  B("form", {
2690
2977
  class: "wx-rename",
2691
- onSubmit: Qe(d, ["prevent"])
2978
+ onSubmit: tt(d, ["prevent"])
2692
2979
  }, [
2693
- b(l(be), {
2980
+ w(a(Te), {
2694
2981
  ref_key: "field",
2695
2982
  ref: r,
2696
- modelValue: n.value,
2697
- "onUpdate:modelValue": m[0] || (m[0] = (f) => n.value = f),
2983
+ modelValue: s.value,
2984
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => s.value = v),
2698
2985
  "aria-label": u.value,
2699
2986
  placeholder: e.placeholder,
2700
- onKeydown: m[1] || (m[1] = lt((f) => i.value = !1, ["esc"]))
2987
+ onKeydown: f[1] || (f[1] = nt((v) => i.value = !1, ["esc"]))
2701
2988
  }, null, 8, ["modelValue", "aria-label", "placeholder"]),
2702
- B("div", Gl, [
2703
- b(l(Q), {
2989
+ B("div", pn, [
2990
+ w(a(le), {
2704
2991
  type: "primary",
2705
2992
  size: "sm",
2706
2993
  "native-type": "submit"
2707
2994
  }, {
2708
2995
  default: y(() => [
2709
- V(W(l(s)("editor.save")), 1)
2996
+ z(A(a(o)("editor.save")), 1)
2710
2997
  ]),
2711
2998
  _: 1
2712
2999
  })
@@ -2716,7 +3003,7 @@ const kn = 76, _n = /* @__PURE__ */ I({
2716
3003
  _: 1
2717
3004
  }, 8, ["open", "title"]));
2718
3005
  }
2719
- }), $n = /* @__PURE__ */ K(Jl, [["__scopeId", "data-v-d879e8d3"]]), Ql = ["innerHTML"], Zl = /* @__PURE__ */ I({
3006
+ }), Dn = /* @__PURE__ */ G(hn, [["__scopeId", "data-v-d879e8d3"]]), gn = ["innerHTML"], yn = /* @__PURE__ */ M({
2720
3007
  __name: "HelpButton",
2721
3008
  props: {
2722
3009
  body: {},
@@ -2726,33 +3013,33 @@ const kn = 76, _n = /* @__PURE__ */ I({
2726
3013
  width: { default: 720 }
2727
3014
  },
2728
3015
  setup(e) {
2729
- const t = e, a = P("webx-admin"), o = A(!1), s = w(() => t.title ?? a("help.title")), i = w(() => Vl(t.body));
2730
- return (n, r) => (v(), _(F, null, [
2731
- b(l(ie), {
3016
+ const t = e, l = O("webx-admin"), n = L(!1), o = g(() => t.title ?? l("help.title")), i = g(() => Xa(t.body));
3017
+ return (s, r) => (m(), $(j, null, [
3018
+ w(a(ue), {
2732
3019
  type: "details",
2733
3020
  icon: "question",
2734
3021
  tone: "neutral",
2735
3022
  size: e.size,
2736
- title: e.label ?? s.value,
2737
- onClick: r[0] || (r[0] = (u) => o.value = !0)
3023
+ title: e.label ?? o.value,
3024
+ onClick: r[0] || (r[0] = (u) => n.value = !0)
2738
3025
  }, null, 8, ["size", "title"]),
2739
- b(l(rt), {
2740
- open: o.value,
2741
- "onUpdate:open": r[1] || (r[1] = (u) => o.value = u),
2742
- title: s.value,
3026
+ w(a(rt), {
3027
+ open: n.value,
3028
+ "onUpdate:open": r[1] || (r[1] = (u) => n.value = u),
3029
+ title: o.value,
2743
3030
  width: e.width
2744
3031
  }, {
2745
3032
  default: y(() => [
2746
3033
  B("div", {
2747
3034
  class: "wx-help",
2748
3035
  innerHTML: i.value
2749
- }, null, 8, Ql)
3036
+ }, null, 8, gn)
2750
3037
  ]),
2751
3038
  _: 1
2752
3039
  }, 8, ["open", "title", "width"])
2753
3040
  ], 64));
2754
3041
  }
2755
- }), Tn = /* @__PURE__ */ K(Zl, [["__scopeId", "data-v-6c280d42"]]), xt = /* @__PURE__ */ I({
3042
+ }), Hn = /* @__PURE__ */ G(yn, [["__scopeId", "data-v-6c280d42"]]), $t = /* @__PURE__ */ M({
2756
3043
  name: "WxDate",
2757
3044
  __name: "DateText",
2758
3045
  props: {
@@ -2762,46 +3049,46 @@ const kn = 76, _n = /* @__PURE__ */ I({
2762
3049
  tone: { default: "muted" }
2763
3050
  },
2764
3051
  setup(e) {
2765
- const t = e, a = bt(), o = w(() => t.compact ? a.compact(t.value) : a.short(t.value)), s = w(() => a.exact(t.value)), i = w(() => a.iso(t.value));
2766
- return (n, r) => s.value ? (v(), T(l(dt), {
3052
+ const t = e, l = kt(), n = g(() => t.compact ? l.compact(t.value) : l.short(t.value)), o = g(() => l.exact(t.value)), i = g(() => l.iso(t.value));
3053
+ return (s, r) => o.value ? (m(), S(a(dt), {
2767
3054
  key: 0,
2768
- content: s.value
3055
+ content: o.value
2769
3056
  }, {
2770
3057
  default: y(() => [
2771
- b(l(G), {
3058
+ w(a(ee), {
2772
3059
  as: "time",
2773
3060
  datetime: i.value,
2774
3061
  size: e.size,
2775
3062
  tone: e.tone
2776
3063
  }, {
2777
3064
  default: y(() => [
2778
- V(W(o.value), 1)
3065
+ z(A(n.value), 1)
2779
3066
  ]),
2780
3067
  _: 1
2781
3068
  }, 8, ["datetime", "size", "tone"])
2782
3069
  ]),
2783
3070
  _: 1
2784
- }, 8, ["content"])) : (v(), T(l(G), {
3071
+ }, 8, ["content"])) : (m(), S(a(ee), {
2785
3072
  key: 1,
2786
3073
  size: e.size,
2787
3074
  tone: e.tone
2788
3075
  }, {
2789
3076
  default: y(() => [
2790
- V(W(o.value), 1)
3077
+ z(A(n.value), 1)
2791
3078
  ]),
2792
3079
  _: 1
2793
3080
  }, 8, ["size", "tone"]));
2794
3081
  }
2795
- }), en = { class: "wx-notes" }, tn = {
3082
+ }), bn = { class: "wx-notes" }, wn = {
2796
3083
  key: 3,
2797
3084
  class: "wx-notes__list"
2798
- }, an = { class: "wx-note__body" }, ln = { class: "wx-note__head" }, nn = { class: "wx-note__buttons" }, on = {
3085
+ }, xn = { class: "wx-note__body" }, kn = { class: "wx-note__head" }, _n = { class: "wx-note__buttons" }, $n = {
2799
3086
  key: 1,
2800
3087
  class: "wx-note__text"
2801
- }, sn = {
3088
+ }, Tn = {
2802
3089
  key: 4,
2803
3090
  class: "wx-notes__new"
2804
- }, rn = /* @__PURE__ */ I({
3091
+ }, Sn = /* @__PURE__ */ M({
2805
3092
  name: "WxNotes",
2806
3093
  __name: "NotesFeed",
2807
3094
  props: {
@@ -2812,52 +3099,52 @@ const kn = 76, _n = /* @__PURE__ */ I({
2812
3099
  },
2813
3100
  emits: ["change"],
2814
3101
  setup(e, { emit: t }) {
2815
- const a = e, o = t, s = q(), i = P("webx-admin"), n = Re(), r = A([]), u = A(!0), d = A(""), h = A(!1), m = A(null), f = A(""), c = w(() => Rl(s, a.type, a.id)), x = w(() => a.title ?? i("notes.title"));
3102
+ const l = e, n = t, o = J(), i = O("webx-admin"), s = Oe(), r = L([]), u = L(!0), d = L(""), h = L(!1), f = L(null), v = L(""), c = g(() => tn(o, l.type, l.id)), x = g(() => l.title ?? i("notes.title"));
2816
3103
  async function p() {
2817
3104
  u.value = !0;
2818
3105
  try {
2819
3106
  r.value = await c.value.list();
2820
- } catch (L) {
2821
- D.danger(n(L));
3107
+ } catch (k) {
3108
+ K.danger(s(k));
2822
3109
  } finally {
2823
3110
  u.value = !1;
2824
3111
  }
2825
3112
  }
2826
- Z(
2827
- () => [a.type, a.id],
3113
+ te(
3114
+ () => [l.type, l.id],
2828
3115
  () => {
2829
- m.value = null, d.value = "", p();
3116
+ f.value = null, d.value = "", p();
2830
3117
  },
2831
3118
  { immediate: !0 }
2832
3119
  );
2833
- async function g() {
2834
- const L = d.value.trim();
2835
- if (!(L === "" || h.value)) {
3120
+ async function b() {
3121
+ const k = d.value.trim();
3122
+ if (!(k === "" || h.value)) {
2836
3123
  h.value = !0;
2837
3124
  try {
2838
- r.value = [...r.value, await c.value.add(L)], d.value = "", o("change");
2839
- } catch (E) {
2840
- D.danger(n(E));
3125
+ r.value = [...r.value, await c.value.add(k)], d.value = "", n("change");
3126
+ } catch (C) {
3127
+ K.danger(s(C));
2841
3128
  } finally {
2842
3129
  h.value = !1;
2843
3130
  }
2844
3131
  }
2845
3132
  }
2846
- function k(L) {
2847
- m.value = L.id, f.value = L.body;
3133
+ function T(k) {
3134
+ f.value = k.id, v.value = k.body;
2848
3135
  }
2849
- async function U(L) {
2850
- const E = f.value.trim();
2851
- if (E !== "")
3136
+ async function F(k) {
3137
+ const C = v.value.trim();
3138
+ if (C !== "")
2852
3139
  try {
2853
- const S = await c.value.save(L.id, E);
2854
- r.value = r.value.map((Y) => Y.id === S.id ? S : Y), m.value = null, D.success(i("notes.saved")), o("change");
2855
- } catch (S) {
2856
- D.danger(n(S));
3140
+ const _ = await c.value.save(k.id, C);
3141
+ r.value = r.value.map((q) => q.id === _.id ? _ : q), f.value = null, K.success(i("notes.saved")), n("change");
3142
+ } catch (_) {
3143
+ K.danger(s(_));
2857
3144
  }
2858
3145
  }
2859
- async function J(L) {
2860
- if (await ge({
3146
+ async function Q(k) {
3147
+ if (await xe({
2861
3148
  title: i("notes.delete-title"),
2862
3149
  message: i("notes.delete-text"),
2863
3150
  confirmText: i("notes.delete"),
@@ -2865,256 +3152,262 @@ const kn = 76, _n = /* @__PURE__ */ I({
2865
3152
  tone: "danger"
2866
3153
  }))
2867
3154
  try {
2868
- await c.value.remove(L.id), r.value = r.value.filter((S) => S.id !== L.id), D.success(i("notes.deleted")), o("change");
2869
- } catch (S) {
2870
- D.danger(n(S));
3155
+ await c.value.remove(k.id), r.value = r.value.filter((_) => _.id !== k.id), K.success(i("notes.deleted")), n("change");
3156
+ } catch (_) {
3157
+ K.danger(s(_));
2871
3158
  }
2872
3159
  }
2873
- function j(L) {
2874
- return !a.can || !L.is_mine ? [] : [
2875
- { key: "edit", icon: "edit", label: i("notes.edit"), run: () => k(L) },
3160
+ function H(k) {
3161
+ return !l.can || !k.is_mine ? [] : [
3162
+ { key: "edit", icon: "edit", label: i("notes.edit"), run: () => T(k) },
2876
3163
  {
2877
3164
  key: "delete",
2878
3165
  icon: "trash",
2879
3166
  label: i("notes.delete"),
2880
3167
  danger: !0,
2881
3168
  run: () => {
2882
- J(L);
3169
+ Q(k);
2883
3170
  }
2884
3171
  }
2885
3172
  ];
2886
3173
  }
2887
- function C(L) {
2888
- return L.author?.name ?? i("notes.unknown-author");
3174
+ function V(k) {
3175
+ return k.author?.name ?? i("notes.unknown-author");
2889
3176
  }
2890
- return (L, E) => (v(), _("section", en, [
2891
- x.value ? (v(), T(l(G), {
3177
+ return (k, C) => (m(), $("section", bn, [
3178
+ x.value ? (m(), S(a(ee), {
2892
3179
  key: 0,
2893
3180
  weight: "medium",
2894
3181
  class: "wx-notes__title"
2895
3182
  }, {
2896
3183
  default: y(() => [
2897
- V(W(x.value), 1)
3184
+ z(A(x.value), 1)
2898
3185
  ]),
2899
3186
  _: 1
2900
3187
  })) : N("", !0),
2901
- u.value ? (v(), T(l(de), {
3188
+ u.value ? (m(), S(a(me), {
2902
3189
  key: 1,
2903
3190
  rows: 2
2904
- })) : r.value.length === 0 ? (v(), T(l(ut), {
3191
+ })) : r.value.length === 0 ? (m(), S(a(ut), {
2905
3192
  key: 2,
2906
3193
  size: "sm",
2907
- description: l(i)("notes.empty")
2908
- }, null, 8, ["description"])) : (v(), _("ul", tn, [
2909
- (v(!0), _(F, null, ee(r.value, (S) => (v(), _("li", {
2910
- key: S.id,
3194
+ description: a(i)("notes.empty")
3195
+ }, null, 8, ["description"])) : (m(), $("ul", wn, [
3196
+ (m(!0), $(j, null, ae(r.value, (_) => (m(), $("li", {
3197
+ key: _.id,
2911
3198
  class: "wx-note"
2912
3199
  }, [
2913
- b(l(aa), {
2914
- name: C(S),
3200
+ w(a(ol), {
3201
+ name: V(_),
2915
3202
  size: "sm",
2916
3203
  tone: "auto"
2917
3204
  }, null, 8, ["name"]),
2918
- B("div", an, [
2919
- B("div", ln, [
2920
- b(l(G), {
3205
+ B("div", xn, [
3206
+ B("div", kn, [
3207
+ w(a(ee), {
2921
3208
  size: "sm",
2922
3209
  weight: "medium",
2923
3210
  truncate: ""
2924
3211
  }, {
2925
3212
  default: y(() => [
2926
- V(W(C(S)), 1)
3213
+ z(A(V(_)), 1)
2927
3214
  ]),
2928
3215
  _: 2
2929
3216
  }, 1024),
2930
- b(xt, {
2931
- value: S.created_at
3217
+ w($t, {
3218
+ value: _.created_at
2932
3219
  }, null, 8, ["value"]),
2933
- b(Ie, {
2934
- actions: j(S),
2935
- label: C(S)
3220
+ w(Fe, {
3221
+ actions: H(_),
3222
+ label: V(_)
2936
3223
  }, null, 8, ["actions", "label"])
2937
3224
  ]),
2938
- m.value === S.id ? (v(), _(F, { key: 0 }, [
2939
- b(l(Oe), {
2940
- modelValue: f.value,
2941
- "onUpdate:modelValue": E[0] || (E[0] = (Y) => f.value = Y),
3225
+ f.value === _.id ? (m(), $(j, { key: 0 }, [
3226
+ w(a(Ke), {
3227
+ modelValue: v.value,
3228
+ "onUpdate:modelValue": C[0] || (C[0] = (q) => v.value = q),
2942
3229
  autosize: { minRows: 2, maxRows: 10 }
2943
3230
  }, null, 8, ["modelValue"]),
2944
- B("div", nn, [
2945
- b(l(Q), {
3231
+ B("div", _n, [
3232
+ w(a(le), {
2946
3233
  size: "sm",
2947
3234
  type: "primary",
2948
- onClick: (Y) => U(S)
3235
+ onClick: (q) => F(_)
2949
3236
  }, {
2950
3237
  default: y(() => [
2951
- V(W(l(i)("notes.save")), 1)
3238
+ z(A(a(i)("notes.save")), 1)
2952
3239
  ]),
2953
3240
  _: 1
2954
3241
  }, 8, ["onClick"]),
2955
- b(l(Q), {
3242
+ w(a(le), {
2956
3243
  size: "sm",
2957
3244
  variant: "text",
2958
- onClick: E[1] || (E[1] = (Y) => m.value = null)
3245
+ onClick: C[1] || (C[1] = (q) => f.value = null)
2959
3246
  }, {
2960
3247
  default: y(() => [
2961
- V(W(l(i)("notes.cancel")), 1)
3248
+ z(A(a(i)("notes.cancel")), 1)
2962
3249
  ]),
2963
3250
  _: 1
2964
3251
  })
2965
3252
  ])
2966
- ], 64)) : (v(), _("p", on, W(S.body), 1))
3253
+ ], 64)) : (m(), $("p", $n, A(_.body), 1))
2967
3254
  ])
2968
3255
  ]))), 128))
2969
3256
  ])),
2970
- e.can ? (v(), _("div", sn, [
2971
- b(l(Oe), {
3257
+ e.can ? (m(), $("div", Tn, [
3258
+ w(a(Ke), {
2972
3259
  modelValue: d.value,
2973
- "onUpdate:modelValue": E[2] || (E[2] = (S) => d.value = S),
2974
- placeholder: l(i)("notes.placeholder"),
3260
+ "onUpdate:modelValue": C[2] || (C[2] = (_) => d.value = _),
3261
+ placeholder: a(i)("notes.placeholder"),
2975
3262
  autosize: { minRows: 2, maxRows: 8 }
2976
3263
  }, null, 8, ["modelValue", "placeholder"]),
2977
- b(l(Q), {
3264
+ w(a(le), {
2978
3265
  size: "sm",
2979
3266
  type: "primary",
2980
3267
  disabled: d.value.trim() === "",
2981
3268
  loading: h.value,
2982
- onClick: g
3269
+ onClick: b
2983
3270
  }, {
2984
3271
  default: y(() => [
2985
- V(W(l(i)("notes.add")), 1)
3272
+ z(A(a(i)("notes.add")), 1)
2986
3273
  ]),
2987
3274
  _: 1
2988
3275
  }, 8, ["disabled", "loading"])
2989
3276
  ])) : N("", !0)
2990
3277
  ]));
2991
3278
  }
2992
- }), Sn = /* @__PURE__ */ K(rn, [["__scopeId", "data-v-71004c1a"]]), un = {
3279
+ }), jn = /* @__PURE__ */ G(Sn, [["__scopeId", "data-v-71004c1a"]]), Cn = {
2993
3280
  key: 1,
2994
3281
  class: "wx-backup-note"
2995
- }, dn = 48, cn = /* @__PURE__ */ I({
3282
+ }, Wn = 48, An = /* @__PURE__ */ M({
2996
3283
  name: "WxBackupNote",
2997
3284
  __name: "BackupNote",
2998
3285
  setup(e) {
2999
- const t = q(), a = bt(), o = P("webx-admin"), s = w(() => t.state.manifest?.backup ?? null), i = w(() => s.value !== null && t.can("settings.view")), n = w(() => {
3000
- const d = s.value?.at;
3286
+ const t = J(), l = kt(), n = O("webx-admin"), o = g(() => t.state.manifest?.backup ?? null), i = g(() => o.value !== null && t.can("settings.view")), s = g(() => {
3287
+ const d = o.value?.at;
3001
3288
  if (d == null) return !0;
3002
3289
  const h = new Date(d).getTime();
3003
- return Number.isNaN(h) || Date.now() - h > dn * 36e5;
3004
- }), r = w(() => {
3005
- const d = s.value?.bytes;
3290
+ return Number.isNaN(h) || Date.now() - h > Wn * 36e5;
3291
+ }), r = g(() => {
3292
+ const d = o.value?.bytes;
3006
3293
  if (d == null) return "";
3007
3294
  const h = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
3008
- let m = d, f = 0;
3009
- for (; m >= 1024 && f < h.length - 1; )
3010
- m /= 1024, f++;
3295
+ let f = d, v = 0;
3296
+ for (; f >= 1024 && v < h.length - 1; )
3297
+ f /= 1024, v++;
3011
3298
  return new Intl.NumberFormat(t.i18n.state.locale, {
3012
3299
  style: "unit",
3013
- unit: h[f],
3300
+ unit: h[v],
3014
3301
  unitDisplay: "short",
3015
- maximumFractionDigits: m >= 10 || f === 0 ? 0 : 1
3016
- }).format(m);
3017
- }), u = w(
3018
- () => s.value?.at == null ? o("backup.never") : o("backup.stale", { date: a.short(s.value.at) })
3302
+ maximumFractionDigits: f >= 10 || v === 0 ? 0 : 1
3303
+ }).format(f);
3304
+ }), u = g(
3305
+ () => o.value?.at == null ? n("backup.never") : n("backup.stale", { date: l.short(o.value.at) })
3019
3306
  );
3020
- return (d, h) => i.value && n.value ? (v(), T(l(we), {
3307
+ return (d, h) => i.value && s.value ? (m(), S(a(Se), {
3021
3308
  key: 0,
3022
3309
  type: "warning",
3023
3310
  variant: "soft",
3024
3311
  description: u.value
3025
- }, null, 8, ["description"])) : i.value ? (v(), _("p", un, [
3026
- b(l(G), {
3312
+ }, null, 8, ["description"])) : i.value ? (m(), $("p", Cn, [
3313
+ w(a(ee), {
3027
3314
  size: "sm",
3028
3315
  tone: "muted"
3029
3316
  }, {
3030
3317
  default: y(() => [
3031
- V(W(l(o)("backup.title")), 1)
3318
+ z(A(a(n)("backup.title")), 1)
3032
3319
  ]),
3033
3320
  _: 1
3034
3321
  }),
3035
- b(xt, {
3036
- value: s.value?.at
3322
+ w($t, {
3323
+ value: o.value?.at
3037
3324
  }, null, 8, ["value"]),
3038
- r.value ? (v(), T(l(G), {
3325
+ r.value ? (m(), S(a(ee), {
3039
3326
  key: 0,
3040
3327
  size: "sm",
3041
3328
  tone: "muted"
3042
3329
  }, {
3043
3330
  default: y(() => [
3044
- V("· " + W(r.value), 1)
3331
+ z("· " + A(r.value), 1)
3045
3332
  ]),
3046
3333
  _: 1
3047
3334
  })) : N("", !0)
3048
3335
  ])) : N("", !0);
3049
3336
  }
3050
- }), Cn = /* @__PURE__ */ K(cn, [["__scopeId", "data-v-beeee67e"]]);
3337
+ }), Kn = /* @__PURE__ */ G(An, [["__scopeId", "data-v-beeee67e"]]);
3051
3338
  export {
3052
- ol as AdminLanding,
3053
- sl as AdminNav,
3054
- hl as AdminShell,
3055
- ct as COLLECTION_MAX_LIMIT,
3056
- We as HttpError,
3057
- Ma as WxBackButton,
3058
- Cn as WxBackupNote,
3059
- va as WxCategoriesField,
3060
- Fl as WxCategoriesPage,
3061
- Pl as WxCategoryCreateDialog,
3062
- Xl as WxCategoryEditorPage,
3063
- Ke as WxCategorySlug,
3064
- Ca as WxCollectionField,
3065
- xt as WxDate,
3066
- _n as WxFilterChips,
3067
- Tn as WxHelpButton,
3068
- Ba as WxLinkField,
3069
- Ra as WxLinkPicker,
3070
- ft as WxListScreen,
3071
- Sn as WxNotes,
3072
- $n as WxRenameButton,
3073
- Xa as WxRichTextField,
3074
- Ie as WxRowMenu,
3075
- jl as WxSaveState,
3076
- ql as WxScreen,
3077
- mt as WxScreenHead,
3078
- Ke as WxSlugField,
3079
- pt as adminKey,
3080
- gt as adminMessages,
3081
- tl as adminTypes,
3082
- xn as categoryRoutes,
3083
- pa as collectionSources,
3084
- yn as createAdmin,
3085
- al as createAdminContext,
3086
- ce as createCategoriesApi,
3087
- zl as createDates,
3088
- yl as createHttp,
3089
- Ee as createI18n,
3090
- Aa as createLinksApi,
3091
- Rl as createNotesApi,
3092
- _l as createTheme,
3093
- je as defaultMarkup,
3094
- Wa as emptyLink,
3095
- Ul as errorText,
3096
- xe as i18nKey,
3097
- Ml as itemOrderMode,
3098
- He as normaliseCollection,
3099
- ll as provideAdmin,
3100
- ra as provideI18n,
3101
- Ga as provideRecordAddress,
3102
- kl as provideTheme,
3339
+ Ca as AdminLanding,
3340
+ Wa as AdminNav,
3341
+ Ba as AdminShell,
3342
+ ft as COLLECTION_MAX_LIMIT,
3343
+ fe as HttpError,
3344
+ ia as WxBackButton,
3345
+ Kn as WxBackupNote,
3346
+ gl as WxCategoriesField,
3347
+ sn as WxCategoriesPage,
3348
+ nn as WxCategoryCreateDialog,
3349
+ vn as WxCategoryEditorPage,
3350
+ Ge as WxCategorySlug,
3351
+ Xl as WxCollectionField,
3352
+ $t as WxDate,
3353
+ On as WxFilterChips,
3354
+ Hn as WxHelpButton,
3355
+ sa as WxLinkField,
3356
+ oa as WxLinkPicker,
3357
+ ht as WxListScreen,
3358
+ jn as WxNotes,
3359
+ mt as WxRelationsField,
3360
+ Dn as WxRenameButton,
3361
+ ga as WxRichTextField,
3362
+ Fe as WxRowMenu,
3363
+ dn as WxSaveState,
3364
+ mn as WxScreen,
3365
+ pt as WxScreenHead,
3366
+ Ge as WxSlugField,
3367
+ yt as adminKey,
3368
+ wt as adminMessages,
3369
+ _a as adminTypes,
3370
+ Pn as categoryRoutes,
3371
+ Nl as collectionSources,
3372
+ En as createAdmin,
3373
+ $a as createAdminContext,
3374
+ ve as createCategoriesApi,
3375
+ Ga as createDates,
3376
+ bl as createHttp,
3377
+ Pe as createI18n,
3378
+ Jl as createLinksApi,
3379
+ tn as createNotesApi,
3380
+ kl as createRelationsApi,
3381
+ Fa as createTheme,
3382
+ Xe as defaultMarkup,
3383
+ Gl as emptyLink,
3384
+ Qa as errorText,
3385
+ Ce as i18nKey,
3386
+ an as itemOrderMode,
3387
+ Ye as normaliseCollection,
3388
+ _l as normaliseRelations,
3389
+ Ta as provideAdmin,
3390
+ cl as provideI18n,
3391
+ ya as provideRecordAddress,
3392
+ zn as provideRelationOwner,
3393
+ Pa as provideTheme,
3103
3394
  qe as readCookie,
3104
- vt as recordAddressKey,
3105
- Vl as renderMarkdown,
3106
- da as reorderItems,
3107
- kn as rowMenuWidth,
3108
- ht as themeKey,
3109
- q as useAdmin,
3110
- bn as useCategoryEditor,
3111
- Be as useCategoryWords,
3112
- bt as useDates,
3113
- Re as useErrorText,
3114
- ia as useI18n,
3115
- wn as useItemOrder,
3116
- Ja as useRecordAddress,
3117
- gn as useTheme,
3118
- P as useTranslate
3395
+ gt as recordAddressKey,
3396
+ ct as relationOwnerKey,
3397
+ Xa as renderMarkdown,
3398
+ fl as reorderItems,
3399
+ Fn as rowMenuWidth,
3400
+ bt as themeKey,
3401
+ J as useAdmin,
3402
+ Bn as useCategoryEditor,
3403
+ De as useCategoryWords,
3404
+ kt as useDates,
3405
+ Oe as useErrorText,
3406
+ dl as useI18n,
3407
+ Mn as useItemOrder,
3408
+ ba as useRecordAddress,
3409
+ $l as useRelationOwner,
3410
+ In as useTheme,
3411
+ O as useTranslate
3119
3412
  };
3120
3413
  //# sourceMappingURL=index.js.map