@webx-ui/module-blog 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,23 @@
1
- import { useAdmin as re, useTranslate as j, useDates as gt, useErrorText as me, useEditing as ft, WxScreenHead as ht, WxEditingAlerts as mt, WxScreen as bt, WxSaveState as yt, WxDate as Ee, WxDrafts as wt, rowMenuWidth as at, WxListScreen as lt, WxRowMenu as Ne, WxAddressNote as xt, WxFilterChips as _t, categoryRoutes as kt } from "@webx-ui/module-admin";
2
- import { provide as $t, inject as Tt, defineComponent as te, useModel as Fe, computed as y, openBlock as _, createBlock as q, unref as e, mergeModels as Ke, ref as N, watch as ge, onMounted as Ue, onBeforeUnmount as He, createElementBlock as J, Fragment as _e, createVNode as r, withCtx as i, createTextVNode as V, toDisplayString as T, createCommentVNode as K, createElementVNode as H, renderList as qe, normalizeClass as it, normalizeProps as At, guardReactiveProps as St, useTemplateRef as Ie, nextTick as Ge, isRef as Pe, withKeys as Me, useId as Wt, withModifiers as Xe } from "vue";
3
- import { WxSelect as xe, useLocales as nt, localizedValue as Ct, confirm as pe, WxSkeleton as Oe, WxCard as Vt, WxBadge as se, WxBreadcrumb as zt, WxBreadcrumbItem as Ye, WxActionBar as st, WxButton as Y, toast as P, WxEmpty as Nt, WxText as ne, WxSortableList as Mt, WxAction as Ut, WxInput as Ve, WxAlert as Le, WxFormItem as ve, useModal as Re, WxDialog as De, WxSpace as Be, useElementWidth as qt, createModal as ze, WxTable as rt, WxEntityCard as It, WxIcon as Se, WxTooltip as ot, WxCheckbox as Pt } from "@webx-ui/core";
4
- import { useRoute as Je, useRouter as je, onBeforeRouteLeave as Rt } from "vue-router";
5
- import { provideBlocksPreview as Dt } from "@webx-ui/module-blocks";
6
- const ut = /* @__PURE__ */ Symbol("wx-article-editor");
7
- function Bt(b) {
8
- $t(ut, b);
1
+ import { useAdmin as ue, useTranslate as Y, useDates as xt, useErrorText as be, useEditing as kt, WxScreenHead as rt, WxEditingAlerts as $t, WxScreen as ut, WxSaveState as ct, WxDate as He, WxDrafts as Tt, rowMenuWidth as dt, WxListScreen as je, WxRowMenu as Ie, WxAddressNote as At, WxFilterChips as St, useBodyKeys as Wt, categoryRoutes as Ct } from "@webx-ui/module-admin";
2
+ import { provide as Vt, inject as qt, defineComponent as ie, useModel as Ze, computed as f, openBlock as y, createElementBlock as G, createVNode as r, unref as e, createBlock as U, withCtx as n, createTextVNode as N, toDisplayString as S, createCommentVNode as J, mergeModels as Qe, ref as V, watch as he, onMounted as ze, onBeforeUnmount as Pe, Fragment as _e, createElementVNode as F, renderList as Ue, normalizeClass as qe, normalizeProps as Nt, guardReactiveProps as zt, useTemplateRef as Be, nextTick as Xe, isRef as Ee, withKeys as De, createSlots as Pt, useId as Ut, withModifiers as nt } from "vue";
3
+ import { RouterLink as Mt, useRoute as Me, useRouter as Oe, onBeforeRouteLeave as vt, onBeforeRouteUpdate as Rt } from "vue-router";
4
+ import { WxSelect as $e, useLocales as Ye, localizedValue as pt, confirm as pe, WxSkeleton as Ne, WxCard as et, WxBadge as re, WxBreadcrumb as It, WxBreadcrumbItem as it, WxActionBar as tt, WxButton as le, toast as O, WxEmpty as Je, WxText as ve, WxSortableList as Dt, WxAction as Bt, WxInput as We, WxAlert as Ge, WxFormItem as me, useModal as Le, WxDialog as Fe, WxSpace as Ke, useElementWidth as Et, createModal as Re, WxTable as ht, WxEntityCard as Ot, WxIcon as ke, WxTooltip as gt, WxListDetail as Lt, WxAvatar as Ft, WxCheckbox as Kt } from "@webx-ui/core";
5
+ import { provideBlocksPreview as Ht } from "@webx-ui/module-blocks";
6
+ const ft = /* @__PURE__ */ Symbol("wx-article-editor");
7
+ function Jt(w) {
8
+ Vt(ft, w);
9
9
  }
10
- function We() {
11
- return Tt(ut, null);
10
+ function Ce() {
11
+ return qt(ft, null);
12
12
  }
13
- const Et = {
13
+ const Gt = {
14
14
  module: {
15
15
  group: "Blog",
16
16
  articles: "Articles",
17
17
  rubrics: "Rubrics",
18
- tags: "Tags"
18
+ tags: "Tags",
19
+ authors: "Authors",
20
+ author: "Author"
19
21
  },
20
22
  panel: {
21
23
  new: "New article",
@@ -166,6 +168,60 @@ const Et = {
166
168
  created: "The rubric is made.",
167
169
  "reorder-failed": "The new order was not saved."
168
170
  },
171
+ author: {
172
+ "tab-profile": "Profile",
173
+ "field-name": "Name on the site",
174
+ "field-name-help": "What readers see under the articles and on the page. Required in the main language.",
175
+ "field-role": "Role",
176
+ "field-bio": "About",
177
+ "field-bio-help": "A few lines for the author's page.",
178
+ "card-page": "On the site",
179
+ "field-photo": "Photo",
180
+ "field-public": "Page on the site",
181
+ "field-public-help": "With it, the name under the articles links to a page with all of the author's articles. Without it, the name is plain text.",
182
+ "field-slug": "Address",
183
+ "field-slug-help": "The last part of the page's address, after …/author/.",
184
+ "account-missing": "Choose the account this profile is for.",
185
+ "account-taken": "This account already has a profile.",
186
+ "name-required": "Write the name in the main language.",
187
+ new: "New author",
188
+ search: "Search by name",
189
+ empty: "No authors yet.",
190
+ "empty-help": "A profile gives an administrator who writes a name for readers, a photo and, if they want it, a page with their articles.",
191
+ "empty-search": "Nothing matches that.",
192
+ choose: "Choose an author",
193
+ "choose-help": "Or add a new one: pick the account and write the name.",
194
+ account: "Account",
195
+ "account-help": "Whose articles these are. Chosen once.",
196
+ "no-accounts": "Every account already has a profile.",
197
+ articles: "Articles: :count",
198
+ "page-open": "Page on the site",
199
+ "page-closed": "No page",
200
+ "open-page": "Open the page",
201
+ save: "Save",
202
+ saved: "Saved",
203
+ "save-failed": "Check the highlighted fields",
204
+ delete: "Delete",
205
+ "delete-title": "Delete the profile of :name?",
206
+ "delete-text": "The articles stay; under them the account's name is shown instead.",
207
+ deleted: "Profile deleted",
208
+ cancel: "Cancel",
209
+ back: "Authors",
210
+ "leave-title": "Leave without saving?",
211
+ "leave-text": "The changes to this profile will be lost.",
212
+ leave: "Leave",
213
+ untitled: "Without a name",
214
+ profile: "Author profile",
215
+ "make-profile": "Make a profile",
216
+ "field-socials": "Networks",
217
+ "field-socials-help": "Shown on the author's page, and named to search engines as the same person.",
218
+ "socials-add": "Add a network",
219
+ "socials-empty": "No networks yet.",
220
+ "social-network": "Network",
221
+ "social-url": "Address",
222
+ "social-network-missing": "Choose the network.",
223
+ "social-url-invalid": "An address that starts with https://."
224
+ },
169
225
  tag: {
170
226
  new: "New tag",
171
227
  "new-title": "New tag",
@@ -221,367 +277,394 @@ const Et = {
221
277
  "merge-warning": ":count articles will carry “:tag” instead. :merged tags will be deleted, and there is no undoing it.",
222
278
  "merge-confirm": "Merge"
223
279
  }
224
- }, et = /* @__PURE__ */ new WeakSet();
225
- function ae() {
280
+ }, st = /* @__PURE__ */ new WeakSet();
281
+ function se() {
226
282
  try {
227
- const { i18n: b } = re();
228
- et.has(b) || (b.defaults("webx-blog", Et), et.add(b));
283
+ const { i18n: w } = ue();
284
+ st.has(w) || (w.defaults("webx-blog", Gt), st.add(w));
229
285
  } catch {
230
286
  }
231
287
  }
232
- const Ot = /* @__PURE__ */ te({
288
+ const jt = { class: "wx-article-author" }, Zt = /* @__PURE__ */ ie({
233
289
  name: "WxArticleAuthor",
234
290
  __name: "ArticleAuthor",
235
- props: /* @__PURE__ */ Ke({
291
+ props: /* @__PURE__ */ Qe({
236
292
  disabled: { type: Boolean, default: !1 }
237
293
  }, {
238
294
  modelValue: { default: null },
239
295
  modelModifiers: {}
240
296
  }),
241
297
  emits: ["update:modelValue"],
242
- setup(b) {
243
- const d = b, f = Fe(b, "modelValue"), c = We();
244
- ae();
245
- const a = j("webx-blog"), s = y(() => d.disabled || c?.disabled.value === !0), t = y(
246
- () => (c?.options.value.authors ?? []).map((n) => ({
247
- label: n.title,
248
- value: n.id
298
+ setup(w) {
299
+ const d = w, c = Ze(w, "modelValue"), o = Ce();
300
+ se();
301
+ const a = Y("webx-blog"), i = ue(), t = f(() => d.disabled || o?.disabled.value === !0), v = f(
302
+ () => (o?.options.value.authors ?? []).map((p) => ({
303
+ label: p.title,
304
+ value: p.id
249
305
  }))
250
- ), u = y({
251
- get: () => f.value,
252
- set: (n) => {
253
- f.value = typeof n == "number" ? n : null;
306
+ ), l = f(() => {
307
+ if (!i.state.manifest?.modules.some((u) => u.id === "authors") || !i.can("blog.authors.manage") || c.value === null) return null;
308
+ const h = o?.base ?? "/blog", k = o?.options.value.authors.find((u) => u.id === c.value)?.profile;
309
+ return k ? {
310
+ to: { path: `${h}/authors`, query: { author: String(k) } },
311
+ label: a("author.profile")
312
+ } : {
313
+ to: { path: `${h}/authors`, query: { author: "new", account: String(c.value) } },
314
+ label: a("author.make-profile")
315
+ };
316
+ }), m = f({
317
+ get: () => c.value,
318
+ set: (p) => {
319
+ c.value = typeof p == "number" ? p : null;
254
320
  }
255
321
  });
256
- return (n, p) => (_(), q(e(xe), {
257
- modelValue: u.value,
258
- "onUpdate:modelValue": p[0] || (p[0] = (w) => u.value = w),
259
- options: t.value,
260
- placeholder: e(a)("article.no-author"),
261
- disabled: s.value,
262
- clearable: "",
263
- filterable: "",
264
- teleport: "",
265
- "aria-label": e(a)("article.author")
266
- }, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]));
322
+ return (p, h) => (y(), G("div", jt, [
323
+ r(e($e), {
324
+ modelValue: m.value,
325
+ "onUpdate:modelValue": h[0] || (h[0] = (k) => m.value = k),
326
+ options: v.value,
327
+ placeholder: e(a)("article.no-author"),
328
+ disabled: t.value,
329
+ clearable: "",
330
+ filterable: "",
331
+ teleport: "",
332
+ "aria-label": e(a)("article.author")
333
+ }, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]),
334
+ l.value ? (y(), U(e(Mt), {
335
+ key: 0,
336
+ class: "wx-article-author__profile",
337
+ to: l.value.to
338
+ }, {
339
+ default: n(() => [
340
+ N(S(l.value.label), 1)
341
+ ]),
342
+ _: 1
343
+ }, 8, ["to"])) : J("", !0)
344
+ ]));
267
345
  }
268
- });
269
- function de(b) {
270
- const d = `${b.apiPath}/blog/articles`, f = `${b.apiPath}/blog/tags`, c = (a) => a.data;
346
+ }), de = (w, d) => {
347
+ const c = w.__vccOpts || w;
348
+ for (const [o, a] of d)
349
+ c[o] = a;
350
+ return c;
351
+ }, Qt = /* @__PURE__ */ de(Zt, [["__scopeId", "data-v-4b275a4c"]]);
352
+ function ye(w) {
353
+ const d = `${w.apiPath}/blog/articles`, c = `${w.apiPath}/blog/tags`, o = (a) => a.data;
271
354
  return {
272
355
  articles: (a = {}) => {
273
- const s = new URLSearchParams();
274
- a.q && s.set("q", a.q), a.rubric != null && s.set("rubric", String(a.rubric)), a.tag != null && s.set("tag", String(a.tag)), a.author != null && s.set("author", String(a.author)), a.status && s.set("status", a.status), a.sort && s.set("sort", a.sort), a.trashed && s.set("trashed", "1"), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
275
- const t = s.size > 0 ? `?${s}` : "";
276
- return b.http.get(`${d}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
356
+ const i = new URLSearchParams();
357
+ a.q && i.set("q", a.q), a.rubric != null && i.set("rubric", String(a.rubric)), a.tag != null && i.set("tag", String(a.tag)), a.author != null && i.set("author", String(a.author)), a.status && i.set("status", a.status), a.sort && i.set("sort", a.sort), a.trashed && i.set("trashed", "1"), a.page && a.page > 1 && i.set("page", String(a.page)), a.per_page && i.set("per_page", String(a.per_page));
358
+ const t = i.size > 0 ? `?${i}` : "";
359
+ return w.http.get(`${d}${t}`).then((v) => ({ ...v.meta, data: v.data, filters: v.filters }));
277
360
  },
278
- get: (a) => b.http.get(`${d}/${a}`).then(c),
279
- create: (a) => b.http.post(d, a).then(c),
280
- save: (a, s) => b.http.put(`${d}/${a}`, s).then(c),
281
- discard: (a) => b.http.post(`${d}/${a}/discard`, {}).then(c),
282
- versions: (a) => b.http.get(`${d}/${a}/versions`).then(c),
283
- restoreVersion: (a, s) => b.http.post(`${d}/${a}/versions/${s}/restore`, {}).then(c),
361
+ get: (a) => w.http.get(`${d}/${a}`).then(o),
362
+ create: (a) => w.http.post(d, a).then(o),
363
+ save: (a, i) => w.http.put(`${d}/${a}`, i).then(o),
364
+ discard: (a) => w.http.post(`${d}/${a}/discard`, {}).then(o),
365
+ versions: (a) => w.http.get(`${d}/${a}/versions`).then(o),
366
+ restoreVersion: (a, i) => w.http.post(`${d}/${a}/versions/${i}/restore`, {}).then(o),
284
367
  tags: (a = "") => {
285
- const s = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
286
- return b.http.get(`${f}${s}`).then(c);
368
+ const i = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
369
+ return w.http.get(`${c}${i}`).then(o);
287
370
  },
288
- createTag: (a) => b.http.post(f, a).then(c),
289
- publish: (a, s, t) => b.http.post(`${d}/${a}/publish`, {
290
- ...s == null ? {} : { at: s },
371
+ createTag: (a) => w.http.post(c, a).then(o),
372
+ publish: (a, i, t) => w.http.post(`${d}/${a}/publish`, {
373
+ ...i == null ? {} : { at: i },
291
374
  ...t ? { revision: t } : {}
292
- }).then(c),
293
- unpublish: (a) => b.http.post(`${d}/${a}/unpublish`, {}).then(c),
294
- remove: (a) => b.http.delete(`${d}/${a}`).then(() => {
375
+ }).then(o),
376
+ unpublish: (a) => w.http.post(`${d}/${a}/unpublish`, {}).then(o),
377
+ remove: (a) => w.http.delete(`${d}/${a}`).then(() => {
295
378
  }),
296
- restore: (a) => b.http.post(`${d}/${a}/restore`, {}).then(c),
379
+ restore: (a) => w.http.post(`${d}/${a}/restore`, {}).then(o),
297
380
  tagsPage: (a = {}) => {
298
- const s = new URLSearchParams();
299
- a.q && s.set("q", a.q), a.empty && s.set("empty", "1"), a.noindex && s.set("noindex", "1"), a.sort && s.set("sort", a.sort), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
300
- const t = s.size > 0 ? `?${s}` : "";
301
- return b.http.get(`${f}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
381
+ const i = new URLSearchParams();
382
+ a.q && i.set("q", a.q), a.empty && i.set("empty", "1"), a.noindex && i.set("noindex", "1"), a.sort && i.set("sort", a.sort), a.page && a.page > 1 && i.set("page", String(a.page)), a.per_page && i.set("per_page", String(a.per_page));
383
+ const t = i.size > 0 ? `?${i}` : "";
384
+ return w.http.get(`${c}${t}`).then((v) => ({ ...v.meta, data: v.data, filters: v.filters }));
302
385
  },
303
- saveTag: (a, s) => b.http.put(`${f}/${a}`, s).then(c),
304
- removeTag: (a) => b.http.delete(`${f}/${a}`).then(() => {
386
+ saveTag: (a, i) => w.http.put(`${c}/${a}`, i).then(o),
387
+ removeTag: (a) => w.http.delete(`${c}/${a}`).then(() => {
305
388
  }),
306
- massTags: (a, s) => b.http.post(`${f}/mass`, { ids: a, action: s }).then((t) => t.data.affected),
307
- mergeTags: (a, s, t) => b.http.post(`${f}/merge`, { ids: a, keep: s, redirect: t }).then(c)
389
+ massTags: (a, i) => w.http.post(`${c}/mass`, { ids: a, action: i }).then((t) => t.data.affected),
390
+ mergeTags: (a, i, t) => w.http.post(`${c}/merge`, { ids: a, keep: i, redirect: t }).then(o)
308
391
  };
309
392
  }
310
- const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__ */ te({
393
+ const Xt = { class: "wx-article-editor__screen" }, Yt = 1200, ea = /* @__PURE__ */ ie({
311
394
  __name: "ArticleEditorPage",
312
395
  props: {
313
396
  base: { default: "/blog" }
314
397
  },
315
- setup(b) {
316
- const d = b, f = re(), c = de(f), a = Je(), s = je(), t = nt(), u = gt();
317
- ae();
318
- const n = j("webx-blog"), p = j("webx-admin"), w = me(), k = y(() => Number(a.params.id)), A = y(() => `${d.base}/articles`), v = N(null), $ = N({}), C = N(""), B = N(""), R = N(null), x = N({ rubrics: [], authors: [] }), S = N([]), U = N(!0), I = N(!1), h = N(!1), E = N({}), L = N(""), Z = N(0), ee = y(() => f.can("blog.articles.manage")), O = ft({
398
+ setup(w) {
399
+ const d = w, c = ue(), o = ye(c), a = Me(), i = Oe(), t = Ye(), v = xt();
400
+ se();
401
+ const l = Y("webx-blog"), m = Y("webx-admin"), p = be(), h = f(() => Number(a.params.id)), k = f(() => `${d.base}/articles`), u = V(null), T = V({}), W = V(""), E = V(""), B = V(null), _ = V({ rubrics: [], authors: [] }), q = V([]), M = V(!0), $ = V(!1), g = V(!1), z = V({}), L = V(""), Q = V(0), te = f(() => c.can("blog.articles.manage")), K = kt({
319
402
  entity: "articles",
320
- id: () => v.value?.id,
321
- values: $,
322
- revision: C,
403
+ id: () => u.value?.id,
404
+ values: T,
405
+ revision: W,
323
406
  read: async () => {
324
- const m = await c.get(k.value);
325
- return { values: m.values, revision: m.revision };
407
+ const A = await o.get(h.value);
408
+ return { values: A.values, revision: A.revision };
326
409
  },
327
- adopt: (m) => {
328
- L.value = JSON.stringify(m.values), Z.value += 1;
410
+ adopt: (A) => {
411
+ L.value = JSON.stringify(A.values), Q.value += 1;
329
412
  },
330
413
  // Published or restored by somebody else: the badge and the address follow, and the form
331
414
  // stays as it is.
332
- refresh: () => Ce(),
415
+ refresh: () => Ve(),
333
416
  restore: async () => {
334
- v.value && await c.restore(v.value.id);
417
+ u.value && await o.restore(u.value.id);
335
418
  },
336
- canWrite: () => ee.value,
337
- busy: () => I.value || G !== void 0,
419
+ canWrite: () => te.value,
420
+ busy: () => $.value || ee !== void 0,
338
421
  screen: "blog.article-form"
339
- }), oe = O.conflict, ie = y(() => !ee.value || h.value), le = y(() => JSON.stringify($.value)), Q = y(() => L.value !== "" && le.value !== L.value), be = y(() => I.value ? "saving" : Q.value ? "unsaved" : "saved"), ke = y(() => {
340
- const m = $.value.title;
341
- return Ct(m, t.active.value, v.value?.title ?? "");
342
- }), ce = y(() => {
343
- const m = $.value.published_at;
344
- return typeof m == "string" && m !== "" ? m : null;
345
- }), he = y(() => {
346
- if (ce.value === null) return !1;
347
- const m = new Date(ce.value.replace(" ", "T"));
348
- return !Number.isNaN(m.valueOf()) && m.valueOf() > Date.now();
349
- }), $e = y(() => {
350
- const m = v.value;
351
- if (!m) return "";
352
- const D = u.short(m.published_at);
422
+ }), ce = K.conflict, oe = f(() => !te.value || g.value), ne = f(() => JSON.stringify(T.value)), X = f(() => L.value !== "" && ne.value !== L.value), we = f(() => $.value ? "saving" : X.value ? "unsaved" : "saved"), C = f(() => {
423
+ const A = T.value.title;
424
+ return pt(A, t.active.value, u.value?.title ?? "");
425
+ }), I = f(() => {
426
+ const A = T.value.published_at;
427
+ return typeof A == "string" && A !== "" ? A : null;
428
+ }), j = f(() => {
429
+ if (I.value === null) return !1;
430
+ const A = new Date(I.value.replace(" ", "T"));
431
+ return !Number.isNaN(A.valueOf()) && A.valueOf() > Date.now();
432
+ }), ge = f(() => {
433
+ const A = u.value;
434
+ if (!A) return "";
435
+ const H = v.short(A.published_at);
353
436
  return {
354
- scheduled: n("article.live-scheduled", { date: D }),
355
- published: n("article.live-since", { date: D }),
356
- modified: n("article.live-since", { date: D })
357
- }[m.status] ?? "";
437
+ scheduled: l("article.live-scheduled", { date: H }),
438
+ published: l("article.live-since", { date: H }),
439
+ modified: l("article.live-since", { date: H })
440
+ }[A.status] ?? "";
358
441
  });
359
- Dt({ url: y(() => R.value), reload: Z }), Bt({
360
- article: v,
361
- values: $,
362
- options: x,
363
- related: S,
364
- prefix: B,
442
+ Ht({ url: f(() => B.value), reload: Q }), Jt({
443
+ article: u,
444
+ values: T,
445
+ options: _,
446
+ related: q,
447
+ prefix: E,
365
448
  base: d.base,
366
- canManage: ee.value,
367
- disabled: ie,
368
- reload: () => X(!0),
369
- save: () => l()
449
+ canManage: te.value,
450
+ disabled: oe,
451
+ reload: () => ae(!0),
452
+ save: () => s()
370
453
  });
371
- function Te(m) {
372
- v.value = m.article, $.value = m.values, C.value = m.revision, B.value = m.prefix, R.value = m.preview_url, x.value = m.options, S.value = m.related, L.value = JSON.stringify(m.values), O.opened(m.values), oe.value = null;
454
+ function xe(A) {
455
+ u.value = A.article, T.value = A.values, W.value = A.revision, E.value = A.prefix, B.value = A.preview_url, _.value = A.options, q.value = A.related, L.value = JSON.stringify(A.values), K.opened(A.values), ce.value = null;
373
456
  }
374
- async function X(m = !1) {
375
- m || (U.value = !0);
457
+ async function ae(A = !1) {
458
+ A || (M.value = !0);
376
459
  try {
377
- Te(await c.get(k.value));
378
- } catch (D) {
379
- P.danger(w(D)), s.push(A.value);
460
+ xe(await o.get(h.value));
461
+ } catch (H) {
462
+ O.danger(p(H)), i.push(k.value);
380
463
  } finally {
381
- U.value = !1;
464
+ M.value = !1;
382
465
  }
383
466
  }
384
- async function Ce() {
467
+ async function Ve() {
385
468
  try {
386
- const m = await c.get(k.value);
387
- v.value = m.article, B.value = m.prefix, R.value = m.preview_url;
469
+ const A = await o.get(h.value);
470
+ u.value = A.article, E.value = A.prefix, B.value = A.preview_url;
388
471
  } catch {
389
472
  }
390
473
  }
391
- let o;
392
- function M() {
393
- !ee.value || oe.value || !Q.value || O.stopped.value || (clearTimeout(o), o = setTimeout(() => {
394
- l();
395
- }, Ft));
474
+ let b;
475
+ function D() {
476
+ !te.value || ce.value || !X.value || K.stopped.value || (clearTimeout(b), b = setTimeout(() => {
477
+ s();
478
+ }, Yt));
396
479
  }
397
- function W() {
398
- !ee.value || oe.value || !Q.value || I.value || O.stopped.value || (clearTimeout(o), l());
480
+ function P() {
481
+ !te.value || ce.value || !X.value || $.value || K.stopped.value || (clearTimeout(b), s());
399
482
  }
400
- let G;
401
- async function l() {
402
- for (; G; ) {
403
- const { carried: F, done: ue } = G;
404
- if (await ue, !Q.value || oe.value || le.value === F) return;
483
+ let ee;
484
+ async function s() {
485
+ for (; ee; ) {
486
+ const { carried: Z, done: fe } = ee;
487
+ if (await fe, !X.value || ce.value || ne.value === Z) return;
405
488
  }
406
- const m = le.value, D = z();
407
- G = { carried: m, done: D };
489
+ const A = ne.value, H = R();
490
+ ee = { carried: A, done: H };
408
491
  try {
409
- await D;
492
+ await H;
410
493
  } finally {
411
- G?.done === D && (G = void 0);
494
+ ee?.done === H && (ee = void 0);
412
495
  }
413
496
  }
414
- async function z() {
415
- if (!v.value || !ee.value) return;
416
- clearTimeout(o);
417
- const m = le.value, D = $.value;
418
- I.value = !0, E.value = {};
497
+ async function R() {
498
+ if (!u.value || !te.value) return;
499
+ clearTimeout(b);
500
+ const A = ne.value, H = T.value;
501
+ $.value = !0, z.value = {};
419
502
  try {
420
- const F = await c.save(v.value.id, { values: D, revision: C.value });
421
- v.value = F.article, C.value = F.revision, B.value = F.prefix, R.value = F.preview_url, x.value = F.options, S.value = F.related, oe.value = null, le.value === m && (L.value = m), O.opened(D), Z.value += 1;
422
- } catch (F) {
423
- const ue = F;
424
- if (ue.status === 409 && ue.body?.data) {
425
- const Ae = ue.body.data;
426
- O.refused({
427
- values: Ae.values,
428
- revision: Ae.revision,
429
- changed: ue.body.changed
430
- }) && (v.value = Ae.article, l());
431
- } else ue.body?.errors ? (E.value = ue.body.errors, P.danger(n("article.save-failed"))) : await O.failed(F) || P.danger(w(F));
503
+ const Z = await o.save(u.value.id, { values: H, revision: W.value });
504
+ u.value = Z.article, W.value = Z.revision, E.value = Z.prefix, B.value = Z.preview_url, _.value = Z.options, q.value = Z.related, ce.value = null, ne.value === A && (L.value = A), K.opened(H), Q.value += 1;
505
+ } catch (Z) {
506
+ const fe = Z;
507
+ if (fe.status === 409 && fe.body?.data) {
508
+ const Se = fe.body.data;
509
+ K.refused({
510
+ values: Se.values,
511
+ revision: Se.revision,
512
+ changed: fe.body.changed
513
+ }) && (u.value = Se.article, s());
514
+ } else fe.body?.errors ? (z.value = fe.body.errors, O.danger(l("article.save-failed"))) : await K.failed(Z) || O.danger(p(Z));
432
515
  } finally {
433
- I.value = !1;
516
+ $.value = !1;
434
517
  }
435
518
  }
436
- async function g() {
437
- await X(!0);
519
+ async function x() {
520
+ await ae(!0);
438
521
  }
439
- async function ye() {
440
- if (!(!v.value || !await pe({
441
- title: p("editor.discard-title"),
442
- message: p("editor.discard-text"),
443
- confirmText: n("article.discard"),
522
+ async function Te() {
523
+ if (!(!u.value || !await pe({
524
+ title: m("editor.discard-title"),
525
+ message: m("editor.discard-text"),
526
+ confirmText: l("article.discard"),
444
527
  // Not «Cancel»: beside «Discard changes» the two read as the same word.
445
- cancelText: p("editor.keep-changes"),
528
+ cancelText: m("editor.keep-changes"),
446
529
  tone: "danger"
447
530
  }))) {
448
- h.value = !0;
531
+ g.value = !0;
449
532
  try {
450
- Te(await c.discard(v.value.id)), P.success(n("article.discarded"));
451
- } catch (D) {
452
- P.danger(w(D));
533
+ xe(await o.discard(u.value.id)), O.success(l("article.discarded"));
534
+ } catch (H) {
535
+ O.danger(p(H));
453
536
  } finally {
454
- h.value = !1;
537
+ g.value = !1;
455
538
  }
456
539
  }
457
540
  }
458
- async function we() {
459
- if (Q.value && await l(), oe.value || Q.value || !v.value) return;
460
- const m = await O.beforePublish();
461
- if (!m) return;
462
- const D = v.value, F = D.next_path ?? D.path, ue = D.next_path != null && D.path !== null ? ` ${p("editor.publish-moves", { old: `/${D.path}` })}` : "", Ae = F === null ? null : `/${F}`, vt = ce.value === null ? n("article.publish-now") : u.short(ce.value);
463
- if (m.asked || await pe({
464
- title: n("article.publish-title", { title: D.title }),
465
- message: he.value ? n("article.publish-later", { date: vt }) : Ae === null ? n("article.publish-nowhere") : n("article.publish-text", { address: Ae }) + ue,
466
- confirmText: he.value ? n("article.schedule") : n("panel.publish"),
467
- cancelText: n("panel.cancel")
541
+ async function Ae() {
542
+ if (X.value && await s(), ce.value || X.value || !u.value) return;
543
+ const A = await K.beforePublish();
544
+ if (!A) return;
545
+ const H = u.value, Z = H.next_path ?? H.path, fe = H.next_path != null && H.path !== null ? ` ${m("editor.publish-moves", { old: `/${H.path}` })}` : "", Se = Z === null ? null : `/${Z}`, _t = I.value === null ? l("article.publish-now") : v.short(I.value);
546
+ if (A.asked || await pe({
547
+ title: l("article.publish-title", { title: H.title }),
548
+ message: j.value ? l("article.publish-later", { date: _t }) : Se === null ? l("article.publish-nowhere") : l("article.publish-text", { address: Se }) + fe,
549
+ confirmText: j.value ? l("article.schedule") : l("panel.publish"),
550
+ cancelText: l("panel.cancel")
468
551
  })) {
469
- h.value = !0;
552
+ g.value = !0;
470
553
  try {
471
- await c.publish(D.id, ce.value, m.revision), await X(!0), P.success(he.value ? n("article.scheduled") : n("panel.published"));
472
- } catch (Qe) {
473
- await O.failed(Qe) || P.danger(w(Qe));
554
+ await o.publish(H.id, I.value, A.revision), await ae(!0), O.success(j.value ? l("article.scheduled") : l("panel.published"));
555
+ } catch (lt) {
556
+ await K.failed(lt) || O.danger(p(lt));
474
557
  } finally {
475
- h.value = !1;
558
+ g.value = !1;
476
559
  }
477
560
  }
478
561
  }
479
- async function dt() {
480
- const m = v.value;
481
- if (!(!m || !await pe({
482
- title: p("editor.unpublish-title"),
483
- message: p("editor.unpublish-text"),
484
- confirmText: p("editor.unpublish"),
485
- cancelText: p("editor.keep-published")
562
+ async function bt() {
563
+ const A = u.value;
564
+ if (!(!A || !await pe({
565
+ title: m("editor.unpublish-title"),
566
+ message: m("editor.unpublish-text"),
567
+ confirmText: m("editor.unpublish"),
568
+ cancelText: m("editor.keep-published")
486
569
  }))) {
487
- h.value = !0;
570
+ g.value = !0;
488
571
  try {
489
- await c.unpublish(m.id), await X(!0), P.success(p("editor.unpublished"));
490
- } catch (F) {
491
- P.danger(w(F));
572
+ await o.unpublish(A.id), await ae(!0), O.success(m("editor.unpublished"));
573
+ } catch (Z) {
574
+ O.danger(p(Z));
492
575
  } finally {
493
- h.value = !1;
576
+ g.value = !1;
494
577
  }
495
578
  }
496
579
  }
497
- function ct() {
498
- const m = v.value?.status;
499
- return m === "published" ? "success" : m === "modified" ? "warning" : m === "scheduled" ? "primary" : "default";
500
- }
501
- function Ze(m) {
502
- Q.value && m.preventDefault();
503
- }
504
- ge(le, M), ge(k, () => {
505
- X();
506
- }), Ue(() => {
507
- X(), window.addEventListener("beforeunload", Ze);
508
- }), He(() => {
509
- clearTimeout(o), window.removeEventListener("beforeunload", Ze);
510
- }), Rt(async () => !Q.value || !ee.value || (await l(), !Q.value) ? !0 : await pe({
511
- title: n("article.leave-title"),
512
- message: n("article.leave-text"),
513
- confirmText: n("article.leave"),
514
- cancelText: n("panel.cancel"),
580
+ function yt() {
581
+ const A = u.value?.status;
582
+ return A === "published" ? "success" : A === "modified" ? "warning" : A === "scheduled" ? "primary" : "default";
583
+ }
584
+ function at(A) {
585
+ X.value && A.preventDefault();
586
+ }
587
+ he(ne, D), he(h, () => {
588
+ ae();
589
+ }), ze(() => {
590
+ ae(), window.addEventListener("beforeunload", at);
591
+ }), Pe(() => {
592
+ clearTimeout(b), window.removeEventListener("beforeunload", at);
593
+ }), vt(async () => !X.value || !te.value || (await s(), !X.value) ? !0 : await pe({
594
+ title: l("article.leave-title"),
595
+ message: l("article.leave-text"),
596
+ confirmText: l("article.leave"),
597
+ cancelText: l("panel.cancel"),
515
598
  tone: "danger"
516
599
  }));
517
- const pt = y(() => {
518
- const m = [];
519
- return R.value && m.push({ key: "preview", label: n("article.preview"), icon: "eye", href: R.value }), v.value?.url && v.value.status !== "draft" && m.push({
600
+ const wt = f(() => {
601
+ const A = [];
602
+ return B.value && A.push({ key: "preview", label: l("article.preview"), icon: "eye", href: B.value }), u.value?.url && u.value.status !== "draft" && A.push({
520
603
  key: "site",
521
- label: n("panel.open-on-site"),
604
+ label: l("panel.open-on-site"),
522
605
  icon: "link",
523
- href: v.value.url
524
- }), ee.value && (v.value?.status === "published" || v.value?.status === "modified") && m.push({
606
+ href: u.value.url
607
+ }), te.value && (u.value?.status === "published" || u.value?.status === "modified") && A.push({
525
608
  key: "unpublish",
526
- label: p("editor.unpublish"),
609
+ label: m("editor.unpublish"),
527
610
  icon: "eye-off",
528
611
  run: () => {
529
- dt();
612
+ bt();
530
613
  }
531
- }), v.value?.status === "modified" && m.push({
614
+ }), u.value?.status === "modified" && A.push({
532
615
  key: "discard",
533
- label: n("article.discard"),
616
+ label: l("article.discard"),
534
617
  icon: "refresh",
535
618
  danger: !0,
536
619
  menu: !0,
537
620
  run: () => {
538
- ye();
621
+ Te();
539
622
  }
540
- }), m;
623
+ }), A;
541
624
  });
542
- return (m, D) => (_(), J("div", {
625
+ return (A, H) => (y(), G("div", {
543
626
  class: "wx-article-editor",
544
- onFocusout: W
627
+ onFocusout: P
545
628
  }, [
546
- U.value || !v.value ? (_(), J(_e, { key: 0 }, [
547
- r(e(Oe), {
629
+ M.value || !u.value ? (y(), G(_e, { key: 0 }, [
630
+ r(e(Ne), {
548
631
  class: "wx-article-editor__ghost",
549
632
  title: "",
550
633
  rows: 1
551
634
  }),
552
- r(e(Vt), null, {
553
- default: i(() => [
554
- r(e(Oe), { rows: 8 })
635
+ r(e(et), null, {
636
+ default: n(() => [
637
+ r(e(Ne), { rows: 8 })
555
638
  ]),
556
639
  _: 1
557
640
  })
558
- ], 64)) : (_(), J(_e, { key: 1 }, [
559
- r(e(ht), {
641
+ ], 64)) : (y(), G(_e, { key: 1 }, [
642
+ r(e(rt), {
560
643
  divider: "",
561
- back: A.value,
562
- "back-label": e(n)("module.articles"),
563
- title: ke.value || e(n)("article.untitled"),
564
- subtitle: $e.value,
565
- actions: pt.value
644
+ back: k.value,
645
+ "back-label": e(l)("module.articles"),
646
+ title: C.value || e(l)("article.untitled"),
647
+ subtitle: ge.value,
648
+ actions: wt.value
566
649
  }, {
567
- trail: i(() => [
568
- r(e(zt), {
650
+ trail: n(() => [
651
+ r(e(It), {
569
652
  size: "sm",
570
- label: e(n)("article.trail")
653
+ label: e(l)("article.trail")
571
654
  }, {
572
- default: i(() => [
573
- r(e(Ye), {
655
+ default: n(() => [
656
+ r(e(it), {
574
657
  as: "router-link",
575
- to: A.value
658
+ to: k.value
576
659
  }, {
577
- default: i(() => [
578
- V(T(e(n)("module.articles")), 1)
660
+ default: n(() => [
661
+ N(S(e(l)("module.articles")), 1)
579
662
  ]),
580
663
  _: 1
581
664
  }, 8, ["to"]),
582
- r(e(Ye), { current: "" }, {
583
- default: i(() => [
584
- V(T(ke.value || e(n)("article.untitled")), 1)
665
+ r(e(it), { current: "" }, {
666
+ default: n(() => [
667
+ N(S(C.value || e(l)("article.untitled")), 1)
585
668
  ]),
586
669
  _: 1
587
670
  })
@@ -589,564 +672,559 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
589
672
  _: 1
590
673
  }, 8, ["label"])
591
674
  ]),
592
- "title-after": i(() => [
593
- r(e(se), {
594
- type: ct(),
675
+ "title-after": n(() => [
676
+ r(e(re), {
677
+ type: yt(),
595
678
  dot: ""
596
679
  }, {
597
- default: i(() => [
598
- V(T(e(n)(`panel.status-${v.value.status}`)), 1)
680
+ default: n(() => [
681
+ N(S(e(l)(`panel.status-${u.value.status}`)), 1)
599
682
  ]),
600
683
  _: 1
601
684
  }, 8, ["type"]),
602
- v.value.status === "modified" ? (_(), q(e(se), {
685
+ u.value.status === "modified" ? (y(), U(e(re), {
603
686
  key: 0,
604
687
  type: "primary",
605
688
  round: ""
606
689
  }, {
607
- default: i(() => [
608
- V(T(e(n)("panel.edits")), 1)
690
+ default: n(() => [
691
+ N(S(e(l)("panel.edits")), 1)
609
692
  ]),
610
693
  _: 1
611
- })) : K("", !0)
694
+ })) : J("", !0)
612
695
  ]),
613
696
  _: 1
614
697
  }, 8, ["back", "back-label", "title", "subtitle", "actions"]),
615
- r(e(mt), {
616
- editing: e(O),
617
- onSave: l,
618
- onTheirs: g
698
+ r(e($t), {
699
+ editing: e(K),
700
+ onSave: s,
701
+ onTheirs: x
619
702
  }, null, 8, ["editing"]),
620
- H("div", Lt, [
621
- r(e(bt), {
622
- modelValue: $.value,
623
- "onUpdate:modelValue": D[0] || (D[0] = (F) => $.value = F),
703
+ F("div", Xt, [
704
+ r(e(ut), {
705
+ modelValue: T.value,
706
+ "onUpdate:modelValue": H[0] || (H[0] = (Z) => T.value = Z),
624
707
  name: "blog.article-form",
625
- errors: E.value,
626
- disabled: ie.value
708
+ errors: z.value,
709
+ disabled: oe.value
627
710
  }, null, 8, ["modelValue", "errors", "disabled"])
628
711
  ]),
629
- ee.value ? (_(), q(e(st), { key: 0 }, {
630
- state: i(() => [
631
- e(O).stopped.value ? K("", !0) : (_(), q(e(yt), {
712
+ te.value ? (y(), U(e(tt), { key: 0 }, {
713
+ state: n(() => [
714
+ e(K).stopped.value ? J("", !0) : (y(), U(e(ct), {
632
715
  key: 0,
633
- state: be.value
716
+ state: we.value
634
717
  }, null, 8, ["state"]))
635
718
  ]),
636
- default: i(() => [
637
- r(e(Y), {
719
+ default: n(() => [
720
+ r(e(le), {
638
721
  variant: "outline",
639
- loading: I.value,
640
- disabled: !Q.value || e(O).stopped.value,
641
- title: e(O).blocked.value,
642
- onClick: l
722
+ loading: $.value,
723
+ disabled: !X.value || e(K).stopped.value,
724
+ title: e(K).blocked.value,
725
+ onClick: s
643
726
  }, {
644
- default: i(() => [
645
- V(T(e(n)("article.save")), 1)
727
+ default: n(() => [
728
+ N(S(e(l)("article.save")), 1)
646
729
  ]),
647
730
  _: 1
648
731
  }, 8, ["loading", "disabled", "title"]),
649
- r(e(Y), {
732
+ r(e(le), {
650
733
  type: "primary",
651
- loading: h.value,
652
- disabled: e(O).stopped.value || v.value.status === "published" && !Q.value,
653
- title: e(O).blocked.value,
654
- onClick: we
734
+ loading: g.value,
735
+ disabled: e(K).stopped.value || u.value.status === "published" && !X.value,
736
+ title: e(K).blocked.value,
737
+ onClick: Ae
655
738
  }, {
656
- default: i(() => [
657
- V(T(he.value ? e(n)("article.schedule") : e(n)("panel.publish")), 1)
739
+ default: n(() => [
740
+ N(S(j.value ? e(l)("article.schedule") : e(l)("panel.publish")), 1)
658
741
  ]),
659
742
  _: 1
660
743
  }, 8, ["loading", "disabled", "title"])
661
744
  ]),
662
745
  _: 1
663
- })) : K("", !0)
746
+ })) : J("", !0)
664
747
  ], 64))
665
748
  ], 32));
666
749
  }
667
- }), fe = (b, d) => {
668
- const f = b.__vccOpts || b;
669
- for (const [c, a] of d)
670
- f[c] = a;
671
- return f;
672
- }, Ht = /* @__PURE__ */ fe(Kt, [["__scopeId", "data-v-49f5a61d"]]), Gt = { class: "wx-article-history-tab" }, Jt = { class: "wx-article-history" }, jt = { class: "wx-article-history__number" }, Zt = { class: "wx-article-history__who" }, Qt = /* @__PURE__ */ te({
750
+ }), ta = /* @__PURE__ */ de(ea, [["__scopeId", "data-v-49f5a61d"]]), aa = { class: "wx-article-history-tab" }, la = { class: "wx-article-history" }, na = { class: "wx-article-history__number" }, ia = { class: "wx-article-history__who" }, sa = /* @__PURE__ */ ie({
673
751
  name: "WxArticleHistory",
674
752
  __name: "ArticleHistory",
675
- setup(b) {
676
- const d = re(), f = de(d), c = We();
677
- ae();
678
- const a = j("webx-blog"), s = me(), t = N(null), u = N(!1), n = y(() => c?.article.value ?? null), p = y(() => d.can("blog.articles.manage")), w = y(
679
- () => n.value?.status === "published" || n.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
753
+ setup(w) {
754
+ const d = ue(), c = ye(d), o = Ce();
755
+ se();
756
+ const a = Y("webx-blog"), i = be(), t = V(null), v = V(!1), l = f(() => o?.article.value ?? null), m = f(() => d.can("blog.articles.manage")), p = f(
757
+ () => l.value?.status === "published" || l.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
680
758
  );
681
- async function k() {
682
- const v = n.value;
683
- if (v)
759
+ async function h() {
760
+ const u = l.value;
761
+ if (u)
684
762
  try {
685
- t.value = await f.versions(v.id);
686
- } catch ($) {
687
- t.value = [], P.danger(s($));
763
+ t.value = await c.versions(u.id);
764
+ } catch (T) {
765
+ t.value = [], O.danger(i(T));
688
766
  }
689
767
  }
690
- async function A(v) {
691
- const $ = n.value;
692
- if (!(!$ || !await pe({
693
- title: a("article.restore-title", { number: v.number }),
768
+ async function k(u) {
769
+ const T = l.value;
770
+ if (!(!T || !await pe({
771
+ title: a("article.restore-title", { number: u.number }),
694
772
  message: a("article.restore-text"),
695
773
  confirmText: a("article.restore-version"),
696
774
  cancelText: a("panel.cancel")
697
775
  }))) {
698
- u.value = !0;
776
+ v.value = !0;
699
777
  try {
700
- await f.restoreVersion($.id, v.number), await c?.reload(), P.success(a("article.restored-version", { number: v.number }));
701
- } catch (B) {
702
- P.danger(s(B));
778
+ await c.restoreVersion(T.id, u.number), await o?.reload(), O.success(a("article.restored-version", { number: u.number }));
779
+ } catch (E) {
780
+ O.danger(i(E));
703
781
  } finally {
704
- u.value = !1;
782
+ v.value = !1;
705
783
  }
706
784
  }
707
785
  }
708
- return ge(
709
- () => [n.value?.id, n.value?.published_at, n.value?.updated_at],
786
+ return he(
787
+ () => [l.value?.id, l.value?.published_at, l.value?.updated_at],
710
788
  () => {
711
- k();
789
+ h();
712
790
  },
713
791
  { immediate: !0 }
714
- ), (v, $) => (_(), J("div", Gt, [
715
- H("div", Jt, [
716
- t.value === null ? (_(), q(e(Oe), {
792
+ ), (u, T) => (y(), G("div", aa, [
793
+ F("div", la, [
794
+ t.value === null ? (y(), U(e(Ne), {
717
795
  key: 0,
718
796
  class: "wx-article-history__ghost",
719
797
  rows: 3
720
- })) : t.value.length === 0 ? (_(), q(e(Nt), {
798
+ })) : t.value.length === 0 ? (y(), U(e(Je), {
721
799
  key: 1,
722
800
  description: e(a)("article.history-empty")
723
- }, null, 8, ["description"])) : (_(!0), J(_e, { key: 2 }, qe(t.value, (C) => (_(), J("div", {
724
- key: C.number,
725
- class: it(["wx-article-history__row", { "is-live": C.number === w.value }])
801
+ }, null, 8, ["description"])) : (y(!0), G(_e, { key: 2 }, Ue(t.value, (W) => (y(), G("div", {
802
+ key: W.number,
803
+ class: qe(["wx-article-history__row", { "is-live": W.number === p.value }])
726
804
  }, [
727
- H("code", jt, T(e(a)("article.version", { number: C.number })), 1),
728
- H("div", Zt, [
729
- C.created_at ? (_(), q(e(Ee), {
805
+ F("code", na, S(e(a)("article.version", { number: W.number })), 1),
806
+ F("div", ia, [
807
+ W.created_at ? (y(), U(e(He), {
730
808
  key: 0,
731
- value: C.created_at,
809
+ value: W.created_at,
732
810
  size: "md",
733
811
  tone: "default"
734
- }, null, 8, ["value"])) : K("", !0),
735
- r(e(ne), {
812
+ }, null, 8, ["value"])) : J("", !0),
813
+ r(e(ve), {
736
814
  size: "sm",
737
815
  tone: "muted"
738
816
  }, {
739
- default: i(() => [
740
- V(T(C.author ?? e(a)(`article.source-${C.source}`)) + " ", 1),
741
- C.comment ? (_(), J(_e, { key: 0 }, [
742
- V(" · " + T(C.comment), 1)
743
- ], 64)) : K("", !0)
817
+ default: n(() => [
818
+ N(S(W.author ?? e(a)(`article.source-${W.source}`)) + " ", 1),
819
+ W.comment ? (y(), G(_e, { key: 0 }, [
820
+ N(" · " + S(W.comment), 1)
821
+ ], 64)) : J("", !0)
744
822
  ]),
745
823
  _: 2
746
824
  }, 1024)
747
825
  ]),
748
- C.number === w.value ? (_(), q(e(se), {
826
+ W.number === p.value ? (y(), U(e(re), {
749
827
  key: 0,
750
828
  type: "success",
751
829
  dot: ""
752
830
  }, {
753
- default: i(() => [
754
- V(T(e(a)("article.version-live")), 1)
831
+ default: n(() => [
832
+ N(S(e(a)("article.version-live")), 1)
755
833
  ]),
756
834
  _: 1
757
- })) : K("", !0),
758
- p.value && C.number !== w.value ? (_(), q(e(Y), {
835
+ })) : J("", !0),
836
+ m.value && W.number !== p.value ? (y(), U(e(le), {
759
837
  key: 1,
760
838
  size: "sm",
761
839
  variant: "outline",
762
- loading: u.value,
763
- onClick: (B) => A(C)
840
+ loading: v.value,
841
+ onClick: (E) => k(W)
764
842
  }, {
765
- default: i(() => [
766
- V(T(e(a)("article.restore-version")), 1)
843
+ default: n(() => [
844
+ N(S(e(a)("article.restore-version")), 1)
767
845
  ]),
768
846
  _: 1
769
- }, 8, ["loading", "onClick"])) : K("", !0)
847
+ }, 8, ["loading", "onClick"])) : J("", !0)
770
848
  ], 2))), 128))
771
849
  ]),
772
- r(e(wt), {
773
- id: n.value?.id,
850
+ r(e(Tt), {
851
+ id: l.value?.id,
774
852
  entity: "articles",
775
853
  screen: "blog.article-form",
776
- "can-restore": p.value,
777
- stamp: [n.value?.published_at, n.value?.updated_at],
778
- onRestored: $[0] || ($[0] = (C) => e(c)?.reload())
854
+ "can-restore": m.value,
855
+ stamp: [l.value?.published_at, l.value?.updated_at],
856
+ onRestored: T[0] || (T[0] = (W) => e(o)?.reload())
779
857
  }, null, 8, ["id", "can-restore", "stamp"])
780
858
  ]));
781
859
  }
782
- }), Xt = /* @__PURE__ */ fe(Qt, [["__scopeId", "data-v-0052c4f9"]]), Yt = { class: "wx-article-related" }, ea = { class: "wx-article-related__name" }, ta = 250, aa = 10, la = /* @__PURE__ */ te({
860
+ }), oa = /* @__PURE__ */ de(sa, [["__scopeId", "data-v-0052c4f9"]]), ra = { class: "wx-article-related" }, ua = { class: "wx-article-related__name" }, ca = 250, da = 10, va = /* @__PURE__ */ ie({
783
861
  name: "WxArticleRelated",
784
862
  __name: "ArticleRelated",
785
- props: /* @__PURE__ */ Ke({
863
+ props: /* @__PURE__ */ Qe({
786
864
  disabled: { type: Boolean, default: !1 }
787
865
  }, {
788
866
  modelValue: { default: () => [] },
789
867
  modelModifiers: {}
790
868
  }),
791
869
  emits: ["update:modelValue"],
792
- setup(b) {
793
- const d = b, f = Fe(b, "modelValue"), c = re(), a = de(c), s = We();
794
- ae();
795
- const t = j("webx-blog"), u = me(), n = y(() => d.disabled || s?.disabled.value === !0), p = N(/* @__PURE__ */ new Map()), w = N([]);
796
- let k;
797
- ge(
798
- () => s?.related.value,
799
- (x) => {
800
- const S = new Map(p.value);
801
- for (const U of x ?? []) S.set(U.id, U.title);
802
- p.value = S;
870
+ setup(w) {
871
+ const d = w, c = Ze(w, "modelValue"), o = ue(), a = ye(o), i = Ce();
872
+ se();
873
+ const t = Y("webx-blog"), v = be(), l = f(() => d.disabled || i?.disabled.value === !0), m = V(/* @__PURE__ */ new Map()), p = V([]);
874
+ let h;
875
+ he(
876
+ () => i?.related.value,
877
+ (_) => {
878
+ const q = new Map(m.value);
879
+ for (const M of _ ?? []) q.set(M.id, M.title);
880
+ m.value = q;
803
881
  },
804
882
  { immediate: !0, deep: !0 }
805
883
  );
806
- const A = y({
807
- get: () => f.value.map((x) => ({ id: x, title: p.value.get(x) ?? `#${x}` })),
808
- set: (x) => {
809
- f.value = x.map((S) => S.id);
884
+ const k = f({
885
+ get: () => c.value.map((_) => ({ id: _, title: m.value.get(_) ?? `#${_}` })),
886
+ set: (_) => {
887
+ c.value = _.map((q) => q.id);
810
888
  }
811
- }), v = y(
812
- () => w.value.filter((x) => !f.value.includes(x.id)).map((x) => ({ label: x.title, value: x.id }))
889
+ }), u = f(
890
+ () => p.value.filter((_) => !c.value.includes(_.id)).map((_) => ({ label: _.title, value: _.id }))
813
891
  );
814
- async function $(x) {
815
- const S = s?.article.value?.id;
892
+ async function T(_) {
893
+ const q = i?.article.value?.id;
816
894
  try {
817
- const U = await a.articles({ q: x, per_page: aa });
818
- w.value = U.data.filter((h) => h.id !== S).map((h) => ({ id: h.id, title: h.title }));
819
- const I = new Map(p.value);
820
- for (const h of w.value) I.set(h.id, h.title);
821
- p.value = I;
822
- } catch (U) {
823
- P.danger(u(U));
895
+ const M = await a.articles({ q: _, per_page: da });
896
+ p.value = M.data.filter((g) => g.id !== q).map((g) => ({ id: g.id, title: g.title }));
897
+ const $ = new Map(m.value);
898
+ for (const g of p.value) $.set(g.id, g.title);
899
+ m.value = $;
900
+ } catch (M) {
901
+ O.danger(v(M));
824
902
  }
825
903
  }
826
- function C(x) {
827
- clearTimeout(k), k = setTimeout(() => {
828
- $(x);
829
- }, ta);
904
+ function W(_) {
905
+ clearTimeout(h), h = setTimeout(() => {
906
+ T(_);
907
+ }, ca);
830
908
  }
831
- function B(x) {
832
- typeof x != "number" || f.value.includes(x) || (f.value = [...f.value, x]);
909
+ function E(_) {
910
+ typeof _ != "number" || c.value.includes(_) || (c.value = [...c.value, _]);
833
911
  }
834
- function R(x) {
835
- f.value = f.value.filter((S) => S !== x);
912
+ function B(_) {
913
+ c.value = c.value.filter((q) => q !== _);
836
914
  }
837
- return ge(
838
- () => s?.article.value?.id,
915
+ return he(
916
+ () => i?.article.value?.id,
839
917
  () => {
840
- $("");
918
+ T("");
841
919
  },
842
920
  { immediate: !0 }
843
- ), He(() => clearTimeout(k)), (x, S) => (_(), J("div", Yt, [
844
- r(e(Mt), {
845
- modelValue: A.value,
846
- "onUpdate:modelValue": S[0] || (S[0] = (U) => A.value = U),
921
+ ), Pe(() => clearTimeout(h)), (_, q) => (y(), G("div", ra, [
922
+ r(e(Dt), {
923
+ modelValue: k.value,
924
+ "onUpdate:modelValue": q[0] || (q[0] = (M) => k.value = M),
847
925
  plain: "",
848
926
  size: "sm",
849
927
  "item-key": "id",
850
928
  "item-label": "title",
851
- disabled: n.value,
929
+ disabled: l.value,
852
930
  "empty-text": e(t)("article.related-empty"),
853
931
  "aria-label": e(t)("article.related")
854
932
  }, {
855
- default: i(({ item: U }) => [
856
- H("span", ea, T(U.title), 1)
933
+ default: n(({ item: M }) => [
934
+ F("span", ua, S(M.title), 1)
857
935
  ]),
858
- actions: i(({ item: U }) => [
859
- r(e(Ut), {
936
+ actions: n(({ item: M }) => [
937
+ r(e(Bt), {
860
938
  type: "remove",
861
939
  size: "sm",
862
- disabled: n.value,
940
+ disabled: l.value,
863
941
  title: e(t)("article.related-remove"),
864
- onClick: (I) => R(U.id)
942
+ onClick: ($) => B(M.id)
865
943
  }, null, 8, ["disabled", "title", "onClick"])
866
944
  ]),
867
945
  _: 1
868
946
  }, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
869
- r(e(xe), {
947
+ r(e($e), {
870
948
  "model-value": null,
871
- options: v.value,
949
+ options: u.value,
872
950
  placeholder: e(t)("article.related-add"),
873
951
  "empty-text": e(t)("article.related-nothing"),
874
- disabled: n.value,
952
+ disabled: l.value,
875
953
  filterable: "",
876
954
  teleport: "",
877
955
  "aria-label": e(t)("article.related-add"),
878
- onSearch: C,
879
- "onUpdate:modelValue": B
956
+ onSearch: W,
957
+ "onUpdate:modelValue": E
880
958
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
881
959
  ]));
882
960
  }
883
- }), ia = /* @__PURE__ */ fe(la, [["__scopeId", "data-v-164e86fe"]]), na = { class: "wx-article-slug" }, sa = { class: "wx-article-slug__prefix" }, ra = /* @__PURE__ */ te({
961
+ }), pa = /* @__PURE__ */ de(va, [["__scopeId", "data-v-164e86fe"]]), ha = { class: "wx-article-slug" }, ga = { class: "wx-article-slug__prefix" }, fa = /* @__PURE__ */ ie({
884
962
  name: "WxArticleSlug",
885
963
  inheritAttrs: !1,
886
964
  __name: "ArticleSlug",
887
- setup(b) {
888
- const d = We(), f = nt();
889
- ae();
890
- const c = j("webx-blog"), a = y(() => {
891
- const u = d?.prefix.value ?? "";
892
- return u === "" ? "/" : `/${u}/`;
893
- }), s = y(() => {
894
- const u = d?.values.value.slug;
895
- return typeof u == "string" ? u : u?.[f.active.value] ?? "";
896
- }), t = y(() => {
897
- const u = d?.article.value?.path;
898
- return typeof u == "string" && s.value !== "" && `${a.value}${s.value}` != `/${u}`;
965
+ setup(w) {
966
+ const d = Ce(), c = Ye();
967
+ se();
968
+ const o = Y("webx-blog"), a = f(() => {
969
+ const v = d?.prefix.value ?? "";
970
+ return v === "" ? "/" : `/${v}/`;
971
+ }), i = f(() => {
972
+ const v = d?.values.value.slug;
973
+ return typeof v == "string" ? v : v?.[c.active.value] ?? "";
974
+ }), t = f(() => {
975
+ const v = d?.article.value?.path;
976
+ return typeof v == "string" && i.value !== "" && `${a.value}${i.value}` != `/${v}`;
899
977
  });
900
- return (u, n) => (_(), J("div", na, [
901
- r(e(Ve), At(St(u.$attrs)), {
902
- prefix: i(() => [
903
- H("span", sa, T(a.value), 1)
978
+ return (v, l) => (y(), G("div", ha, [
979
+ r(e(We), Nt(zt(v.$attrs)), {
980
+ prefix: n(() => [
981
+ F("span", ga, S(a.value), 1)
904
982
  ]),
905
983
  _: 1
906
984
  }, 16),
907
- t.value ? (_(), q(e(Le), {
985
+ t.value ? (y(), U(e(Ge), {
908
986
  key: 0,
909
987
  type: "info",
910
988
  variant: "soft",
911
- description: e(c)("article.address-moving")
912
- }, null, 8, ["description"])) : K("", !0)
989
+ description: e(o)("article.address-moving")
990
+ }, null, 8, ["description"])) : J("", !0)
913
991
  ]));
914
992
  }
915
- }), oa = /* @__PURE__ */ fe(ra, [["__scopeId", "data-v-5da20e5e"]]), ua = { class: "wx-article-tags" }, da = {
993
+ }), ma = /* @__PURE__ */ de(fa, [["__scopeId", "data-v-5da20e5e"]]), ba = { class: "wx-article-tags" }, ya = {
916
994
  key: 0,
917
995
  class: "wx-article-tags__chips"
918
- }, ca = { class: "wx-article-tags__pick" }, pa = 250, va = /* @__PURE__ */ te({
996
+ }, wa = { class: "wx-article-tags__pick" }, _a = 250, xa = /* @__PURE__ */ ie({
919
997
  name: "WxArticleTags",
920
998
  __name: "ArticleTags",
921
- props: /* @__PURE__ */ Ke({
999
+ props: /* @__PURE__ */ Qe({
922
1000
  disabled: { type: Boolean, default: !1 }
923
1001
  }, {
924
1002
  modelValue: { default: () => [] },
925
1003
  modelModifiers: {}
926
1004
  }),
927
1005
  emits: ["update:modelValue"],
928
- setup(b) {
929
- const d = b, f = Fe(b, "modelValue"), c = re(), a = de(c), s = We();
930
- ae();
931
- const t = j("webx-blog"), u = me(), n = y(() => d.disabled || s?.disabled.value === !0), p = N(/* @__PURE__ */ new Map()), w = N([]), k = N(""), A = N(!1);
932
- let v;
933
- ge(
934
- () => s?.article.value?.tags,
935
- (h) => {
936
- const E = new Map(p.value);
937
- for (const L of h ?? []) E.set(L.id, L.title);
938
- p.value = E;
1006
+ setup(w) {
1007
+ const d = w, c = Ze(w, "modelValue"), o = ue(), a = ye(o), i = Ce();
1008
+ se();
1009
+ const t = Y("webx-blog"), v = be(), l = f(() => d.disabled || i?.disabled.value === !0), m = V(/* @__PURE__ */ new Map()), p = V([]), h = V(""), k = V(!1);
1010
+ let u;
1011
+ he(
1012
+ () => i?.article.value?.tags,
1013
+ (g) => {
1014
+ const z = new Map(m.value);
1015
+ for (const L of g ?? []) z.set(L.id, L.title);
1016
+ m.value = z;
939
1017
  },
940
1018
  { immediate: !0, deep: !0 }
941
1019
  );
942
- const $ = y(
943
- () => f.value.map((h) => ({ id: h, title: p.value.get(h) ?? `#${h}` }))
944
- ), C = y(
945
- () => w.value.filter((h) => !f.value.includes(h.id)).map((h) => ({
1020
+ const T = f(
1021
+ () => c.value.map((g) => ({ id: g, title: m.value.get(g) ?? `#${g}` }))
1022
+ ), W = f(
1023
+ () => p.value.filter((g) => !c.value.includes(g.id)).map((g) => ({
946
1024
  // The count is part of the label rather than a column: a select draws a line of text, and
947
1025
  // the number is what the reader is choosing between two near-identical words on.
948
- label: t("article.tag-option", { title: h.title, count: h.articles_count }),
949
- value: h.id
1026
+ label: t("article.tag-option", { title: g.title, count: g.articles_count }),
1027
+ value: g.id
950
1028
  }))
951
- ), B = y(() => {
952
- const h = k.value.trim();
953
- if (h === "") return null;
954
- const E = (L) => L.toLowerCase() === h.toLowerCase();
955
- return w.value.some((L) => E(L.title)) ? null : h;
1029
+ ), E = f(() => {
1030
+ const g = h.value.trim();
1031
+ if (g === "") return null;
1032
+ const z = (L) => L.toLowerCase() === g.toLowerCase();
1033
+ return p.value.some((L) => z(L.title)) ? null : g;
956
1034
  });
957
- async function R() {
1035
+ async function B() {
958
1036
  try {
959
- w.value = await a.tags(k.value);
960
- const h = new Map(p.value);
961
- for (const E of w.value) h.set(E.id, E.title);
962
- p.value = h;
963
- } catch (h) {
964
- P.danger(u(h));
1037
+ p.value = await a.tags(h.value);
1038
+ const g = new Map(m.value);
1039
+ for (const z of p.value) g.set(z.id, z.title);
1040
+ m.value = g;
1041
+ } catch (g) {
1042
+ O.danger(v(g));
965
1043
  }
966
1044
  }
967
- function x(h) {
968
- k.value = h, clearTimeout(v), v = setTimeout(() => {
969
- R();
970
- }, pa);
1045
+ function _(g) {
1046
+ h.value = g, clearTimeout(u), u = setTimeout(() => {
1047
+ B();
1048
+ }, _a);
971
1049
  }
972
- function S(h) {
973
- typeof h != "number" || f.value.includes(h) || (f.value = [...f.value, h], k.value = "");
1050
+ function q(g) {
1051
+ typeof g != "number" || c.value.includes(g) || (c.value = [...c.value, g], h.value = "");
974
1052
  }
975
- function U(h) {
976
- f.value = f.value.filter((E) => E !== h);
1053
+ function M(g) {
1054
+ c.value = c.value.filter((z) => z !== g);
977
1055
  }
978
- async function I() {
979
- const h = B.value;
980
- if (!(h === null || A.value)) {
981
- A.value = !0;
1056
+ async function $() {
1057
+ const g = E.value;
1058
+ if (!(g === null || k.value)) {
1059
+ k.value = !0;
982
1060
  try {
983
- const E = await a.createTag({ title: h });
984
- p.value = new Map(p.value).set(E.id, E.title), w.value = [E, ...w.value], S(E.id);
985
- } catch (E) {
986
- P.danger(u(E));
1061
+ const z = await a.createTag({ title: g });
1062
+ m.value = new Map(m.value).set(z.id, z.title), p.value = [z, ...p.value], q(z.id);
1063
+ } catch (z) {
1064
+ O.danger(v(z));
987
1065
  } finally {
988
- A.value = !1;
1066
+ k.value = !1;
989
1067
  }
990
1068
  }
991
1069
  }
992
- return ge(
993
- () => s?.article.value?.id,
1070
+ return he(
1071
+ () => i?.article.value?.id,
994
1072
  () => {
995
- R();
1073
+ B();
996
1074
  },
997
1075
  { immediate: !0 }
998
- ), He(() => clearTimeout(v)), (h, E) => (_(), J("div", ua, [
999
- $.value.length > 0 ? (_(), J("div", da, [
1000
- (_(!0), J(_e, null, qe($.value, (L) => (_(), q(e(se), {
1076
+ ), Pe(() => clearTimeout(u)), (g, z) => (y(), G("div", ba, [
1077
+ T.value.length > 0 ? (y(), G("div", ya, [
1078
+ (y(!0), G(_e, null, Ue(T.value, (L) => (y(), U(e(re), {
1001
1079
  key: L.id,
1002
1080
  type: "default",
1003
- closable: !n.value,
1081
+ closable: !l.value,
1004
1082
  "close-label": e(t)("article.tag-remove"),
1005
- onClose: (Z) => U(L.id)
1083
+ onClose: (Q) => M(L.id)
1006
1084
  }, {
1007
- default: i(() => [
1008
- V(T(L.title), 1)
1085
+ default: n(() => [
1086
+ N(S(L.title), 1)
1009
1087
  ]),
1010
1088
  _: 2
1011
1089
  }, 1032, ["closable", "close-label", "onClose"]))), 128))
1012
- ])) : (_(), q(e(ne), {
1090
+ ])) : (y(), U(e(ve), {
1013
1091
  key: 1,
1014
1092
  size: "sm",
1015
1093
  tone: "muted"
1016
1094
  }, {
1017
- default: i(() => [
1018
- V(T(e(t)("article.tags-empty")), 1)
1095
+ default: n(() => [
1096
+ N(S(e(t)("article.tags-empty")), 1)
1019
1097
  ]),
1020
1098
  _: 1
1021
1099
  })),
1022
- H("div", ca, [
1023
- r(e(xe), {
1100
+ F("div", wa, [
1101
+ r(e($e), {
1024
1102
  "model-value": null,
1025
- options: C.value,
1103
+ options: W.value,
1026
1104
  placeholder: e(t)("article.tag-add"),
1027
1105
  "empty-text": e(t)("article.tag-nothing"),
1028
- disabled: n.value,
1106
+ disabled: l.value,
1029
1107
  filterable: "",
1030
1108
  teleport: "",
1031
1109
  "aria-label": e(t)("article.tag-add"),
1032
- onSearch: x,
1033
- "onUpdate:modelValue": S
1110
+ onSearch: _,
1111
+ "onUpdate:modelValue": q
1034
1112
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
1035
- B.value ? (_(), q(e(Y), {
1113
+ E.value ? (y(), U(e(le), {
1036
1114
  key: 0,
1037
1115
  variant: "outline",
1038
1116
  icon: "plus",
1039
- loading: A.value,
1040
- disabled: n.value,
1041
- onClick: I
1117
+ loading: k.value,
1118
+ disabled: l.value,
1119
+ onClick: $
1042
1120
  }, {
1043
- default: i(() => [
1044
- V(T(e(t)("article.tag-create", { title: B.value })), 1)
1121
+ default: n(() => [
1122
+ N(S(e(t)("article.tag-create", { title: E.value })), 1)
1045
1123
  ]),
1046
1124
  _: 1
1047
- }, 8, ["loading", "disabled"])) : K("", !0)
1125
+ }, 8, ["loading", "disabled"])) : J("", !0)
1048
1126
  ])
1049
1127
  ]));
1050
1128
  }
1051
- }), ga = /* @__PURE__ */ fe(va, [["__scopeId", "data-v-faf5adec"]]), fa = /* @__PURE__ */ te({
1129
+ }), ka = /* @__PURE__ */ de(xa, [["__scopeId", "data-v-faf5adec"]]), $a = /* @__PURE__ */ ie({
1052
1130
  name: "WxArticleUnpublish",
1053
1131
  __name: "ArticleUnpublish",
1054
- setup(b) {
1055
- const d = re(), f = de(d), c = We();
1056
- ae();
1057
- const a = j("webx-blog"), s = me(), t = N(!1), u = y(() => {
1058
- const w = c?.article.value?.status;
1059
- return w === "published" || w === "modified" || w === "scheduled";
1060
- }), n = y(() => c?.disabled.value === !0 || t.value);
1061
- async function p() {
1062
- const w = c?.article.value;
1063
- if (!(!w || !await pe({
1064
- title: a("article.unpublish-title", { title: w.title }),
1065
- message: w.status === "scheduled" ? a("article.unpublish-waiting") : a("article.unpublish-text"),
1132
+ setup(w) {
1133
+ const d = ue(), c = ye(d), o = Ce();
1134
+ se();
1135
+ const a = Y("webx-blog"), i = be(), t = V(!1), v = f(() => {
1136
+ const p = o?.article.value?.status;
1137
+ return p === "published" || p === "modified" || p === "scheduled";
1138
+ }), l = f(() => o?.disabled.value === !0 || t.value);
1139
+ async function m() {
1140
+ const p = o?.article.value;
1141
+ if (!(!p || !await pe({
1142
+ title: a("article.unpublish-title", { title: p.title }),
1143
+ message: p.status === "scheduled" ? a("article.unpublish-waiting") : a("article.unpublish-text"),
1066
1144
  confirmText: a("panel.unpublish"),
1067
1145
  cancelText: a("panel.cancel"),
1068
1146
  tone: "danger"
1069
1147
  }))) {
1070
1148
  t.value = !0;
1071
1149
  try {
1072
- await f.unpublish(w.id), await c?.reload(), P.success(a("panel.unpublished-done"));
1073
- } catch (A) {
1074
- P.danger(s(A));
1150
+ await c.unpublish(p.id), await o?.reload(), O.success(a("panel.unpublished-done"));
1151
+ } catch (k) {
1152
+ O.danger(i(k));
1075
1153
  } finally {
1076
1154
  t.value = !1;
1077
1155
  }
1078
1156
  }
1079
1157
  }
1080
- return (w, k) => u.value && e(c)?.canManage ? (_(), q(e(ve), {
1158
+ return (p, h) => v.value && e(o)?.canManage ? (y(), U(e(me), {
1081
1159
  key: 0,
1082
1160
  class: "wx-article-unpublish",
1083
1161
  help: e(a)("article.unpublish-help")
1084
1162
  }, {
1085
- default: i(() => [
1086
- r(e(Y), {
1163
+ default: n(() => [
1164
+ r(e(le), {
1087
1165
  variant: "outline",
1088
1166
  type: "danger",
1089
1167
  icon: "eye-off",
1090
1168
  loading: t.value,
1091
- disabled: n.value,
1092
- onClick: p
1169
+ disabled: l.value,
1170
+ onClick: m
1093
1171
  }, {
1094
- default: i(() => [
1095
- V(T(e(a)("panel.unpublish")), 1)
1172
+ default: n(() => [
1173
+ N(S(e(a)("panel.unpublish")), 1)
1096
1174
  ]),
1097
1175
  _: 1
1098
1176
  }, 8, ["loading", "disabled"])
1099
1177
  ]),
1100
1178
  _: 1
1101
- }, 8, ["help"])) : K("", !0);
1179
+ }, 8, ["help"])) : J("", !0);
1102
1180
  }
1103
- }), ha = /* @__PURE__ */ fe(fa, [["__scopeId", "data-v-c311cff2"]]), ma = /* @__PURE__ */ te({
1181
+ }), Ta = /* @__PURE__ */ de($a, [["__scopeId", "data-v-c311cff2"]]), Aa = /* @__PURE__ */ ie({
1104
1182
  __name: "ArticleCreateDialog",
1105
- setup(b) {
1106
- const { open: d, resolve: f, dismiss: c } = Re(), a = re(), s = de(a);
1107
- ae();
1108
- const t = j("webx-blog"), u = N(""), n = N(!1), p = N({}), w = Ie("field");
1109
- Ue(async () => {
1110
- await Ge(), w.value?.querySelector("input")?.focus();
1183
+ setup(w) {
1184
+ const { open: d, resolve: c, dismiss: o } = Le(), a = ue(), i = ye(a);
1185
+ se();
1186
+ const t = Y("webx-blog"), v = V(""), l = V(!1), m = V({}), p = Be("field");
1187
+ ze(async () => {
1188
+ await Xe(), p.value?.querySelector("input")?.focus();
1111
1189
  });
1112
- async function k() {
1113
- if (!(u.value.trim() === "" || n.value)) {
1114
- n.value = !0, p.value = {};
1190
+ async function h() {
1191
+ if (!(v.value.trim() === "" || l.value)) {
1192
+ l.value = !0, m.value = {};
1115
1193
  try {
1116
- f(await s.create({ title: u.value.trim() }));
1117
- } catch (A) {
1118
- p.value = A.body?.errors ?? {};
1194
+ c(await i.create({ title: v.value.trim() }));
1195
+ } catch (k) {
1196
+ m.value = k.body?.errors ?? {};
1119
1197
  } finally {
1120
- n.value = !1;
1198
+ l.value = !1;
1121
1199
  }
1122
1200
  }
1123
1201
  }
1124
- return (A, v) => (_(), q(e(De), {
1202
+ return (k, u) => (y(), U(e(Fe), {
1125
1203
  open: e(d),
1126
- "onUpdate:open": v[2] || (v[2] = ($) => Pe(d) ? d.value = $ : null),
1204
+ "onUpdate:open": u[2] || (u[2] = (T) => Ee(d) ? d.value = T : null),
1127
1205
  title: e(t)("panel.new-title"),
1128
1206
  width: 440
1129
1207
  }, {
1130
- footer: i(() => [
1131
- r(e(Be), { size: "sm" }, {
1132
- default: i(() => [
1133
- r(e(Y), {
1208
+ footer: n(() => [
1209
+ r(e(Ke), { size: "sm" }, {
1210
+ default: n(() => [
1211
+ r(e(le), {
1134
1212
  variant: "outline",
1135
- onClick: v[1] || (v[1] = ($) => e(c)())
1213
+ onClick: u[1] || (u[1] = (T) => e(o)())
1136
1214
  }, {
1137
- default: i(() => [
1138
- V(T(e(t)("panel.cancel")), 1)
1215
+ default: n(() => [
1216
+ N(S(e(t)("panel.cancel")), 1)
1139
1217
  ]),
1140
1218
  _: 1
1141
1219
  }),
1142
- r(e(Y), {
1220
+ r(e(le), {
1143
1221
  type: "primary",
1144
- loading: n.value,
1145
- disabled: u.value.trim() === "",
1146
- onClick: k
1222
+ loading: l.value,
1223
+ disabled: v.value.trim() === "",
1224
+ onClick: h
1147
1225
  }, {
1148
- default: i(() => [
1149
- V(T(e(t)("panel.create")), 1)
1226
+ default: n(() => [
1227
+ N(S(e(t)("panel.create")), 1)
1150
1228
  ]),
1151
1229
  _: 1
1152
1230
  }, 8, ["loading", "disabled"])
@@ -1154,22 +1232,22 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1154
1232
  _: 1
1155
1233
  })
1156
1234
  ]),
1157
- default: i(() => [
1158
- r(e(ve), {
1235
+ default: n(() => [
1236
+ r(e(me), {
1159
1237
  label: e(t)("panel.field-title"),
1160
- error: p.value.title?.[0] ?? p.value.slug?.[0],
1238
+ error: m.value.title?.[0] ?? m.value.slug?.[0],
1161
1239
  required: ""
1162
1240
  }, {
1163
- default: i(() => [
1164
- H("div", {
1241
+ default: n(() => [
1242
+ F("div", {
1165
1243
  ref_key: "field",
1166
- ref: w
1244
+ ref: p
1167
1245
  }, [
1168
- r(e(Ve), {
1169
- modelValue: u.value,
1170
- "onUpdate:modelValue": v[0] || (v[0] = ($) => u.value = $),
1246
+ r(e(We), {
1247
+ modelValue: v.value,
1248
+ "onUpdate:modelValue": u[0] || (u[0] = (T) => v.value = T),
1171
1249
  "aria-label": e(t)("panel.field-title"),
1172
- onKeyup: Me(k, ["enter"])
1250
+ onKeyup: De(h, ["enter"])
1173
1251
  }, null, 8, ["modelValue", "aria-label"])
1174
1252
  ], 512)
1175
1253
  ]),
@@ -1179,42 +1257,42 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1179
1257
  _: 1
1180
1258
  }, 8, ["open", "title"]));
1181
1259
  }
1182
- }), ba = ["src"], ya = { class: "wx-articles__name" }, wa = { class: "wx-articles__name-text" }, xa = { class: "wx-articles__title" }, _a = { class: "wx-articles__address" }, ka = { class: "wx-articles__chips" }, $a = { class: "wx-articles__state" }, tt = 640, Ta = /* @__PURE__ */ te({
1260
+ }), Sa = ["src"], Wa = { class: "wx-articles__name" }, Ca = { class: "wx-articles__name-text" }, Va = { class: "wx-articles__title" }, qa = { class: "wx-articles__address" }, Na = { class: "wx-articles__chips" }, za = { class: "wx-articles__state" }, ot = 640, Pa = /* @__PURE__ */ ie({
1183
1261
  __name: "ArticlesPage",
1184
1262
  props: {
1185
1263
  base: { default: "/blog" }
1186
1264
  },
1187
- setup(b) {
1188
- const d = b, f = re(), c = de(f), a = Je(), s = je();
1189
- ae();
1190
- const t = j("webx-blog"), u = j("webx-admin"), n = me(), p = Ie("root"), w = qt(p), k = N(null), A = N(!0), v = ze(ma), $ = y(() => f.can("blog.articles.manage")), C = y(
1191
- () => f.state.manifest?.modules.find((l) => l.id === "articles")?.title ?? t("module.articles")
1192
- ), B = y({
1265
+ setup(w) {
1266
+ const d = w, c = ue(), o = ye(c), a = Me(), i = Oe();
1267
+ se();
1268
+ const t = Y("webx-blog"), v = Y("webx-admin"), l = be(), m = Be("root"), p = Et(m), h = V(null), k = V(!0), u = Re(Aa), T = f(() => c.can("blog.articles.manage")), W = f(
1269
+ () => c.state.manifest?.modules.find((s) => s.id === "articles")?.title ?? t("module.articles")
1270
+ ), E = f({
1193
1271
  get: () => typeof a.query.view == "string" ? a.query.view : "",
1194
- set: (l) => {
1195
- s.replace({
1196
- query: { ...a.query, view: l === "" ? void 0 : String(l), page: void 0 }
1272
+ set: (s) => {
1273
+ i.replace({
1274
+ query: { ...a.query, view: s === "" ? void 0 : String(s), page: void 0 }
1197
1275
  });
1198
1276
  }
1199
- }), R = y(() => B.value === "trashed"), x = y(() => ({
1277
+ }), B = f(() => E.value === "trashed"), _ = f(() => ({
1200
1278
  q: typeof a.query.q == "string" ? a.query.q : "",
1201
- rubric: S(a.query.rubric),
1202
- tag: S(a.query.tag),
1203
- author: S(a.query.author),
1279
+ rubric: q(a.query.rubric),
1280
+ tag: q(a.query.tag),
1281
+ author: q(a.query.author),
1204
1282
  sort: typeof a.query.sort == "string" ? a.query.sort : null,
1205
1283
  page: Number(a.query.page ?? 1) || 1
1206
1284
  }));
1207
- function S(l) {
1208
- return typeof l == "string" && l !== "" && Number(l) || null;
1285
+ function q(s) {
1286
+ return typeof s == "string" && s !== "" && Number(s) || null;
1209
1287
  }
1210
- const U = y(() => [
1288
+ const M = f(() => [
1211
1289
  { value: "", label: t("panel.view-all") },
1212
1290
  { value: "published", label: t("panel.view-published") },
1213
1291
  { value: "scheduled", label: t("panel.view-scheduled") },
1214
1292
  { value: "draft", label: t("panel.view-draft") },
1215
1293
  { value: "unpublished", label: t("panel.view-unpublished") },
1216
1294
  { value: "trashed", label: t("panel.bin"), icon: "trash" }
1217
- ]), I = y(() => k.value?.filters ?? { rubrics: [], tags: [], authors: [] }), h = y(() => w.value > 0 && w.value < tt), E = y(() => h.value ? [{ key: "card", label: "" }] : [
1295
+ ]), $ = f(() => h.value?.filters ?? { rubrics: [], tags: [], authors: [] }), g = f(() => p.value > 0 && p.value < ot), z = f(() => g.value ? [{ key: "card", label: "" }] : [
1218
1296
  { key: "cover", label: "", width: 68 },
1219
1297
  /* The one that takes what the others leave, and the only one without a number. */
1220
1298
  { key: "title", label: t("panel.column-title"), minWidth: 220 },
@@ -1222,7 +1300,7 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1222
1300
  { key: "author", label: t("panel.column-author"), width: 160, hideBelow: 1200 },
1223
1301
  {
1224
1302
  key: "date",
1225
- label: R.value ? t("panel.column-deleted") : t("panel.column-date"),
1303
+ label: B.value ? t("panel.column-deleted") : t("panel.column-date"),
1226
1304
  width: 120,
1227
1305
  hideBelow: 700,
1228
1306
  // "today at 16:22" is three words the table will break over two lines given half a
@@ -1230,29 +1308,29 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1230
1308
  cellClass: "wx-articles__when"
1231
1309
  },
1232
1310
  { key: "status", label: t("panel.column-status"), width: 170 },
1233
- { key: "actions", label: "", width: at, align: "right" }
1234
- ]), L = y(() => x.value.q !== "" ? t("panel.empty-search") : R.value ? t("panel.empty-bin") : t("panel.empty")), Z = y(() => {
1235
- const l = [], z = I.value.rubrics.find((we) => we.id === x.value.rubric);
1236
- z && l.push({
1311
+ { key: "actions", label: "", width: dt, align: "right" }
1312
+ ]), L = f(() => _.value.q !== "" ? t("panel.empty-search") : B.value ? t("panel.empty-bin") : t("panel.empty")), Q = f(() => {
1313
+ const s = [], R = $.value.rubrics.find((Ae) => Ae.id === _.value.rubric);
1314
+ R && s.push({
1237
1315
  key: "rubric",
1238
- label: `${t("panel.filter-rubric")}: ${z.title}`,
1239
- clear: () => ie("rubric", void 0)
1316
+ label: `${t("panel.filter-rubric")}: ${R.title}`,
1317
+ clear: () => oe("rubric", void 0)
1240
1318
  });
1241
- const g = I.value.tags.find((we) => we.id === x.value.tag);
1242
- g && l.push({
1319
+ const x = $.value.tags.find((Ae) => Ae.id === _.value.tag);
1320
+ x && s.push({
1243
1321
  key: "tag",
1244
- label: `${t("panel.filter-tag")}: ${g.title}`,
1245
- clear: () => ie("tag", void 0)
1322
+ label: `${t("panel.filter-tag")}: ${x.title}`,
1323
+ clear: () => oe("tag", void 0)
1246
1324
  });
1247
- const ye = I.value.authors.find((we) => we.id === x.value.author);
1248
- return ye && l.push({
1325
+ const Te = $.value.authors.find((Ae) => Ae.id === _.value.author);
1326
+ return Te && s.push({
1249
1327
  key: "author",
1250
- label: `${t("panel.filter-author")}: ${ye.title}`,
1251
- clear: () => ie("author", void 0)
1252
- }), l;
1328
+ label: `${t("panel.filter-author")}: ${Te.title}`,
1329
+ clear: () => oe("author", void 0)
1330
+ }), s;
1253
1331
  });
1254
- function ee() {
1255
- s.replace({
1332
+ function te() {
1333
+ i.replace({
1256
1334
  query: {
1257
1335
  ...a.query,
1258
1336
  rubric: void 0,
@@ -1262,439 +1340,439 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1262
1340
  }
1263
1341
  });
1264
1342
  }
1265
- async function O(l) {
1266
- A.value = !0;
1343
+ async function K(s) {
1344
+ k.value = !0;
1267
1345
  try {
1268
- k.value = await c.articles({
1269
- q: l?.search ?? x.value.q,
1270
- status: R.value ? "" : B.value,
1271
- trashed: R.value,
1272
- rubric: x.value.rubric,
1273
- tag: x.value.tag,
1274
- author: x.value.author,
1275
- sort: l?.sort ? `${l.sort.order === "desc" ? "-" : ""}${l.sort.key}` : null,
1276
- page: l?.page ?? x.value.page,
1277
- per_page: l?.perPage
1346
+ h.value = await o.articles({
1347
+ q: s?.search ?? _.value.q,
1348
+ status: B.value ? "" : E.value,
1349
+ trashed: B.value,
1350
+ rubric: _.value.rubric,
1351
+ tag: _.value.tag,
1352
+ author: _.value.author,
1353
+ sort: s?.sort ? `${s.sort.order === "desc" ? "-" : ""}${s.sort.key}` : null,
1354
+ page: s?.page ?? _.value.page,
1355
+ per_page: s?.perPage
1278
1356
  });
1279
- } catch (z) {
1280
- P.danger(n(z));
1357
+ } catch (R) {
1358
+ O.danger(l(R));
1281
1359
  } finally {
1282
- A.value = !1;
1360
+ k.value = !1;
1283
1361
  }
1284
1362
  }
1285
- function oe(l) {
1286
- const z = {
1363
+ function ce(s) {
1364
+ const R = {
1287
1365
  ...a.query,
1288
- q: l.search === "" ? void 0 : l.search,
1289
- sort: l.sort === null ? void 0 : `${l.sort.order === "desc" ? "-" : ""}${l.sort.key}`,
1290
- page: l.page === 1 ? void 0 : String(l.page)
1366
+ q: s.search === "" ? void 0 : s.search,
1367
+ sort: s.sort === null ? void 0 : `${s.sort.order === "desc" ? "-" : ""}${s.sort.key}`,
1368
+ page: s.page === 1 ? void 0 : String(s.page)
1291
1369
  };
1292
- s.replace({ query: z }), O(l);
1370
+ i.replace({ query: R }), K(s);
1293
1371
  }
1294
- function ie(l, z) {
1295
- s.replace({
1372
+ function oe(s, R) {
1373
+ i.replace({
1296
1374
  query: {
1297
1375
  ...a.query,
1298
- [l]: typeof z == "number" ? String(z) : void 0,
1376
+ [s]: typeof R == "number" ? String(R) : void 0,
1299
1377
  page: void 0
1300
1378
  }
1301
1379
  });
1302
1380
  }
1303
- ge(
1304
- [B, () => x.value.rubric, () => x.value.tag, () => x.value.author],
1381
+ he(
1382
+ [E, () => _.value.rubric, () => _.value.tag, () => _.value.author],
1305
1383
  () => {
1306
- O();
1384
+ K();
1307
1385
  }
1308
- ), O();
1309
- function le(l) {
1310
- const z = `${d.base}/articles/${l.id}`;
1311
- s.resolve(z).matched.length > 0 && s.push({ path: z, query: { ...a.query } });
1312
- }
1313
- async function Q() {
1314
- const l = await v({});
1315
- l && (await O(), le(l));
1316
- }
1317
- function be(l) {
1318
- if (!$.value) return [];
1319
- if (R.value)
1386
+ ), K();
1387
+ function ne(s) {
1388
+ const R = `${d.base}/articles/${s.id}`;
1389
+ i.resolve(R).matched.length > 0 && i.push({ path: R, query: { ...a.query } });
1390
+ }
1391
+ async function X() {
1392
+ const s = await u({});
1393
+ s && (await K(), ne(s));
1394
+ }
1395
+ function we(s) {
1396
+ if (!T.value) return [];
1397
+ if (B.value)
1320
1398
  return [
1321
1399
  {
1322
1400
  key: "restore",
1323
1401
  icon: "refresh",
1324
1402
  label: t("panel.restore"),
1325
1403
  run: () => {
1326
- Te(l);
1404
+ xe(s);
1327
1405
  }
1328
1406
  }
1329
1407
  ];
1330
- const z = [
1331
- { key: "open", icon: "edit", label: t("panel.open"), run: () => le(l) }
1408
+ const R = [
1409
+ { key: "open", icon: "edit", label: t("panel.open"), run: () => ne(s) }
1332
1410
  ];
1333
- return l.url && l.status !== "draft" && z.push({
1411
+ return s.url && s.status !== "draft" && R.push({
1334
1412
  key: "site",
1335
1413
  icon: "external-link",
1336
1414
  label: t("panel.open-on-site"),
1337
- href: l.url
1338
- }), l.path !== null && z.push({
1415
+ href: s.url
1416
+ }), s.path !== null && R.push({
1339
1417
  key: "copy",
1340
1418
  icon: "copy",
1341
1419
  label: t("panel.copy-address"),
1342
1420
  run: () => {
1343
- Ce(l);
1421
+ Ve(s);
1344
1422
  }
1345
- }), z.push({
1423
+ }), R.push({
1346
1424
  key: "pin",
1347
1425
  icon: "star",
1348
- label: l.pinned ? t("panel.unpin") : t("panel.pin"),
1426
+ label: s.pinned ? t("panel.unpin") : t("panel.pin"),
1349
1427
  run: () => {
1350
- he(l, !l.pinned);
1428
+ j(s, !s.pinned);
1351
1429
  }
1352
- }), z.push(
1353
- l.status === "published" || l.status === "modified" || l.status === "scheduled" ? {
1430
+ }), R.push(
1431
+ s.status === "published" || s.status === "modified" || s.status === "scheduled" ? {
1354
1432
  key: "unpublish",
1355
1433
  icon: "eye-off",
1356
1434
  label: t("panel.unpublish"),
1357
1435
  run: () => {
1358
- ce(l);
1436
+ I(s);
1359
1437
  }
1360
1438
  } : {
1361
1439
  key: "publish",
1362
1440
  icon: "upload",
1363
1441
  label: t("panel.publish"),
1364
1442
  run: () => {
1365
- ke(l);
1443
+ C(s);
1366
1444
  }
1367
1445
  }
1368
- ), z.push({
1446
+ ), R.push({
1369
1447
  key: "delete",
1370
1448
  icon: "trash",
1371
1449
  label: t("panel.delete"),
1372
1450
  danger: !0,
1373
1451
  run: () => {
1374
- $e(l);
1452
+ ge(s);
1375
1453
  }
1376
- }), z;
1454
+ }), R;
1377
1455
  }
1378
- async function ke(l) {
1379
- await X(() => c.publish(l.id), t("panel.published"));
1456
+ async function C(s) {
1457
+ await ae(() => o.publish(s.id), t("panel.published"));
1380
1458
  }
1381
- async function ce(l) {
1382
- await X(() => c.unpublish(l.id), t("panel.unpublished-done"));
1459
+ async function I(s) {
1460
+ await ae(() => o.unpublish(s.id), t("panel.unpublished-done"));
1383
1461
  }
1384
- async function he(l, z) {
1385
- await X(
1386
- () => c.save(l.id, { values: { pinned: z }, revision: l.revision }),
1387
- t(z ? "panel.pinned-done" : "panel.unpinned")
1462
+ async function j(s, R) {
1463
+ await ae(
1464
+ () => o.save(s.id, { values: { pinned: R }, revision: s.revision }),
1465
+ t(R ? "panel.pinned-done" : "panel.unpinned")
1388
1466
  );
1389
1467
  }
1390
- async function $e(l) {
1468
+ async function ge(s) {
1391
1469
  await pe({
1392
- title: t("panel.delete-title", { title: l.title }),
1470
+ title: t("panel.delete-title", { title: s.title }),
1393
1471
  message: t("panel.delete-text"),
1394
1472
  confirmText: t("panel.delete"),
1395
1473
  cancelText: t("panel.cancel"),
1396
1474
  tone: "danger"
1397
- }) && await X(() => c.remove(l.id), t("panel.deleted"));
1475
+ }) && await ae(() => o.remove(s.id), t("panel.deleted"));
1398
1476
  }
1399
- async function Te(l) {
1400
- await X(() => c.restore(l.id), t("panel.restored"));
1477
+ async function xe(s) {
1478
+ await ae(() => o.restore(s.id), t("panel.restored"));
1401
1479
  }
1402
- async function X(l, z) {
1480
+ async function ae(s, R) {
1403
1481
  try {
1404
- await l(), P.success(z);
1405
- } catch (g) {
1406
- P.danger(n(g));
1482
+ await s(), O.success(R);
1483
+ } catch (x) {
1484
+ O.danger(l(x));
1407
1485
  } finally {
1408
- await O();
1486
+ await K();
1409
1487
  }
1410
1488
  }
1411
- async function Ce(l) {
1412
- if (l.url)
1489
+ async function Ve(s) {
1490
+ if (s.url)
1413
1491
  try {
1414
- await navigator.clipboard.writeText(l.url), P.success(t("panel.address-copied"));
1492
+ await navigator.clipboard.writeText(s.url), O.success(t("panel.address-copied"));
1415
1493
  } catch {
1416
1494
  }
1417
1495
  }
1418
- function o(l) {
1419
- return l === "published" || l === "modified" ? "success" : l === "scheduled" ? "warning" : "default";
1496
+ function b(s) {
1497
+ return s === "published" || s === "modified" ? "success" : s === "scheduled" ? "warning" : "default";
1420
1498
  }
1421
- function M(l) {
1422
- return R.value ? "—" : l.path === null ? t("panel.no-address") : `/${l.path}`;
1499
+ function D(s) {
1500
+ return B.value ? "—" : s.path === null ? t("panel.no-address") : `/${s.path}`;
1423
1501
  }
1424
- function W(l) {
1425
- return R.value ? l.deleted_at : l.published_at;
1502
+ function P(s) {
1503
+ return B.value ? s.deleted_at : s.published_at;
1426
1504
  }
1427
- const G = y(
1428
- () => $.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1429
- Q();
1505
+ const ee = f(
1506
+ () => T.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1507
+ X();
1430
1508
  } }] : []
1431
1509
  );
1432
- return (l, z) => (_(), J("div", {
1510
+ return (s, R) => (y(), G("div", {
1433
1511
  ref_key: "root",
1434
- ref: p,
1512
+ ref: m,
1435
1513
  class: "wx-articles"
1436
1514
  }, [
1437
- r(e(lt), {
1438
- view: B.value,
1439
- "onUpdate:view": z[3] || (z[3] = (g) => B.value = g),
1440
- title: C.value,
1441
- views: U.value,
1442
- actions: G.value
1515
+ r(e(je), {
1516
+ view: E.value,
1517
+ "onUpdate:view": R[3] || (R[3] = (x) => E.value = x),
1518
+ title: W.value,
1519
+ views: M.value,
1520
+ actions: ee.value
1443
1521
  }, {
1444
- default: i(() => [
1445
- r(e(rt), {
1446
- data: k.value,
1447
- columns: E.value,
1522
+ default: n(() => [
1523
+ r(e(ht), {
1524
+ data: h.value,
1525
+ columns: z.value,
1448
1526
  "row-key": "id",
1449
1527
  searchable: "",
1450
- clickable: !R.value,
1451
- hover: !R.value,
1528
+ clickable: !B.value,
1529
+ hover: !B.value,
1452
1530
  flush: "",
1453
- loading: A.value,
1531
+ loading: k.value,
1454
1532
  layout: "fixed",
1455
- "cards-below": tt,
1456
- "filters-count": Z.value.length,
1457
- "filters-label": e(u)("filters.title"),
1533
+ "cards-below": ot,
1534
+ "filters-count": Q.value.length,
1535
+ "filters-label": e(v)("filters.title"),
1458
1536
  "search-placeholder": e(t)("panel.search"),
1459
1537
  "empty-text": L.value,
1460
- "aria-label": C.value,
1461
- onRowClick: le,
1462
- onStateChange: oe
1538
+ "aria-label": W.value,
1539
+ onRowClick: ne,
1540
+ onStateChange: ce
1463
1541
  }, {
1464
- filters: i(() => [
1465
- r(e(ve), {
1542
+ filters: n(() => [
1543
+ r(e(me), {
1466
1544
  label: e(t)("panel.filter-rubric")
1467
1545
  }, {
1468
- default: i(() => [
1469
- r(e(xe), {
1470
- "model-value": x.value.rubric,
1471
- options: I.value.rubrics.map((g) => ({ value: g.id, label: g.title })),
1546
+ default: n(() => [
1547
+ r(e($e), {
1548
+ "model-value": _.value.rubric,
1549
+ options: $.value.rubrics.map((x) => ({ value: x.id, label: x.title })),
1472
1550
  placeholder: e(t)("panel.any-rubric"),
1473
1551
  clearable: "",
1474
1552
  size: "sm",
1475
- "onUpdate:modelValue": z[0] || (z[0] = (g) => ie("rubric", g))
1553
+ "onUpdate:modelValue": R[0] || (R[0] = (x) => oe("rubric", x))
1476
1554
  }, null, 8, ["model-value", "options", "placeholder"])
1477
1555
  ]),
1478
1556
  _: 1
1479
1557
  }, 8, ["label"]),
1480
- r(e(ve), {
1558
+ r(e(me), {
1481
1559
  label: e(t)("panel.filter-tag")
1482
1560
  }, {
1483
- default: i(() => [
1484
- r(e(xe), {
1485
- "model-value": x.value.tag,
1486
- options: I.value.tags.map((g) => ({ value: g.id, label: g.title })),
1561
+ default: n(() => [
1562
+ r(e($e), {
1563
+ "model-value": _.value.tag,
1564
+ options: $.value.tags.map((x) => ({ value: x.id, label: x.title })),
1487
1565
  placeholder: e(t)("panel.any-tag"),
1488
1566
  clearable: "",
1489
1567
  filterable: "",
1490
1568
  size: "sm",
1491
- "onUpdate:modelValue": z[1] || (z[1] = (g) => ie("tag", g))
1569
+ "onUpdate:modelValue": R[1] || (R[1] = (x) => oe("tag", x))
1492
1570
  }, null, 8, ["model-value", "options", "placeholder"])
1493
1571
  ]),
1494
1572
  _: 1
1495
1573
  }, 8, ["label"]),
1496
- r(e(ve), {
1574
+ r(e(me), {
1497
1575
  label: e(t)("panel.filter-author")
1498
1576
  }, {
1499
- default: i(() => [
1500
- r(e(xe), {
1501
- "model-value": x.value.author,
1502
- options: I.value.authors.map((g) => ({ value: g.id, label: g.title })),
1577
+ default: n(() => [
1578
+ r(e($e), {
1579
+ "model-value": _.value.author,
1580
+ options: $.value.authors.map((x) => ({ value: x.id, label: x.title })),
1503
1581
  placeholder: e(t)("panel.any-author"),
1504
1582
  clearable: "",
1505
1583
  size: "sm",
1506
- "onUpdate:modelValue": z[2] || (z[2] = (g) => ie("author", g))
1584
+ "onUpdate:modelValue": R[2] || (R[2] = (x) => oe("author", x))
1507
1585
  }, null, 8, ["model-value", "options", "placeholder"])
1508
1586
  ]),
1509
1587
  _: 1
1510
1588
  }, 8, ["label"]),
1511
- Z.value.length > 0 ? (_(), q(e(Y), {
1589
+ Q.value.length > 0 ? (y(), U(e(le), {
1512
1590
  key: 0,
1513
1591
  variant: "text",
1514
1592
  size: "sm",
1515
1593
  block: "",
1516
- onClick: ee
1594
+ onClick: te
1517
1595
  }, {
1518
- icon: i(() => [
1519
- r(e(Se), { name: "close" })
1596
+ icon: n(() => [
1597
+ r(e(ke), { name: "close" })
1520
1598
  ]),
1521
- default: i(() => [
1522
- V(" " + T(e(u)("filters.reset")), 1)
1599
+ default: n(() => [
1600
+ N(" " + S(e(v)("filters.reset")), 1)
1523
1601
  ]),
1524
1602
  _: 1
1525
- })) : K("", !0)
1603
+ })) : J("", !0)
1526
1604
  ]),
1527
- applied: i(() => [
1528
- r(e(_t), { filters: Z.value }, null, 8, ["filters"])
1605
+ applied: n(() => [
1606
+ r(e(St), { filters: Q.value }, null, 8, ["filters"])
1529
1607
  ]),
1530
- "cell-cover": i(({ row: g }) => [
1531
- H("span", {
1532
- class: it(["wx-articles__cover", { "is-empty": !g.cover }])
1608
+ "cell-cover": n(({ row: x }) => [
1609
+ F("span", {
1610
+ class: qe(["wx-articles__cover", { "is-empty": !x.cover }])
1533
1611
  }, [
1534
- g.cover?.thumb ? (_(), J("img", {
1612
+ x.cover?.thumb ? (y(), G("img", {
1535
1613
  key: 0,
1536
- src: g.cover.thumb,
1614
+ src: x.cover.thumb,
1537
1615
  alt: "",
1538
1616
  loading: "lazy"
1539
- }, null, 8, ba)) : (_(), q(e(Se), {
1617
+ }, null, 8, Sa)) : (y(), U(e(ke), {
1540
1618
  key: 1,
1541
1619
  name: "image",
1542
1620
  size: "sm"
1543
1621
  }))
1544
1622
  ], 2)
1545
1623
  ]),
1546
- "cell-title": i(({ row: g }) => [
1547
- H("div", ya, [
1548
- g.pinned ? (_(), q(e(ot), {
1624
+ "cell-title": n(({ row: x }) => [
1625
+ F("div", Wa, [
1626
+ x.pinned ? (y(), U(e(gt), {
1549
1627
  key: 0,
1550
1628
  content: e(t)("panel.pinned")
1551
1629
  }, {
1552
- default: i(() => [
1553
- r(e(Se), {
1630
+ default: n(() => [
1631
+ r(e(ke), {
1554
1632
  class: "wx-articles__pin",
1555
1633
  name: "star",
1556
1634
  size: "sm"
1557
1635
  })
1558
1636
  ]),
1559
1637
  _: 1
1560
- }, 8, ["content"])) : K("", !0),
1561
- H("div", wa, [
1562
- H("span", xa, T(g.title), 1),
1563
- H("span", _a, [
1564
- V(T(M(g)) + " ", 1),
1565
- R.value ? K("", !0) : (_(), q(e(xt), {
1638
+ }, 8, ["content"])) : J("", !0),
1639
+ F("div", Ca, [
1640
+ F("span", Va, S(x.title), 1),
1641
+ F("span", qa, [
1642
+ N(S(D(x)) + " ", 1),
1643
+ B.value ? J("", !0) : (y(), U(e(At), {
1566
1644
  key: 0,
1567
- locale: g.address_locale
1645
+ locale: x.address_locale
1568
1646
  }, null, 8, ["locale"]))
1569
1647
  ])
1570
1648
  ])
1571
1649
  ])
1572
1650
  ]),
1573
- "cell-rubrics": i(({ row: g }) => [
1574
- H("span", ka, [
1575
- (_(!0), J(_e, null, qe(g.rubrics, (ye) => (_(), q(e(se), {
1576
- key: ye.id,
1651
+ "cell-rubrics": n(({ row: x }) => [
1652
+ F("span", Na, [
1653
+ (y(!0), G(_e, null, Ue(x.rubrics, (Te) => (y(), U(e(re), {
1654
+ key: Te.id,
1577
1655
  size: "sm",
1578
1656
  round: ""
1579
1657
  }, {
1580
- default: i(() => [
1581
- V(T(ye.title), 1)
1658
+ default: n(() => [
1659
+ N(S(Te.title), 1)
1582
1660
  ]),
1583
1661
  _: 2
1584
1662
  }, 1024))), 128))
1585
1663
  ])
1586
1664
  ]),
1587
- "cell-author": i(({ row: g }) => [
1588
- r(e(ne), {
1665
+ "cell-author": n(({ row: x }) => [
1666
+ r(e(ve), {
1589
1667
  size: "sm",
1590
1668
  tone: "muted",
1591
1669
  truncate: ""
1592
1670
  }, {
1593
- default: i(() => [
1594
- V(T(g.author ? g.author.name : "—"), 1)
1671
+ default: n(() => [
1672
+ N(S(x.author ? x.author.name : "—"), 1)
1595
1673
  ]),
1596
1674
  _: 2
1597
1675
  }, 1024)
1598
1676
  ]),
1599
- "cell-date": i(({ row: g }) => [
1600
- W(g) ? (_(), q(e(Ee), {
1677
+ "cell-date": n(({ row: x }) => [
1678
+ P(x) ? (y(), U(e(He), {
1601
1679
  key: 0,
1602
- value: W(g),
1680
+ value: P(x),
1603
1681
  compact: ""
1604
- }, null, 8, ["value"])) : (_(), q(e(ne), {
1682
+ }, null, 8, ["value"])) : (y(), U(e(ve), {
1605
1683
  key: 1,
1606
1684
  size: "sm",
1607
1685
  tone: "muted"
1608
1686
  }, {
1609
- default: i(() => [...z[4] || (z[4] = [
1610
- V("—", -1)
1687
+ default: n(() => [...R[4] || (R[4] = [
1688
+ N("—", -1)
1611
1689
  ])]),
1612
1690
  _: 1
1613
1691
  }))
1614
1692
  ]),
1615
- "cell-status": i(({ row: g }) => [
1616
- H("span", $a, [
1617
- r(e(se), {
1618
- type: o(g.status),
1693
+ "cell-status": n(({ row: x }) => [
1694
+ F("span", za, [
1695
+ r(e(re), {
1696
+ type: b(x.status),
1619
1697
  dot: "",
1620
1698
  size: "sm"
1621
1699
  }, {
1622
- default: i(() => [
1623
- V(T(e(t)(`panel.status-${g.status}`)), 1)
1700
+ default: n(() => [
1701
+ N(S(e(t)(`panel.status-${x.status}`)), 1)
1624
1702
  ]),
1625
1703
  _: 2
1626
1704
  }, 1032, ["type"]),
1627
- g.status === "modified" ? (_(), q(e(se), {
1705
+ x.status === "modified" ? (y(), U(e(re), {
1628
1706
  key: 0,
1629
1707
  type: "primary",
1630
1708
  size: "sm",
1631
1709
  round: ""
1632
1710
  }, {
1633
- default: i(() => [
1634
- V(T(e(t)("panel.edits")), 1)
1711
+ default: n(() => [
1712
+ N(S(e(t)("panel.edits")), 1)
1635
1713
  ]),
1636
1714
  _: 1
1637
- })) : K("", !0)
1715
+ })) : J("", !0)
1638
1716
  ])
1639
1717
  ]),
1640
- "cell-card": i(({ row: g }) => [
1641
- r(e(It), {
1718
+ "cell-card": n(({ row: x }) => [
1719
+ r(e(Ot), {
1642
1720
  class: "wx-articles__entity",
1643
1721
  variant: "plain",
1644
- title: g.title,
1645
- image: g.cover?.thumb ?? void 0,
1722
+ title: x.title,
1723
+ image: x.cover?.thumb ?? void 0,
1646
1724
  "image-size": "56px",
1647
1725
  "title-lines": 2,
1648
- subtitle: M(g)
1726
+ subtitle: D(x)
1649
1727
  }, {
1650
- title: i(() => [
1651
- g.pinned ? (_(), q(e(Se), {
1728
+ title: n(() => [
1729
+ x.pinned ? (y(), U(e(ke), {
1652
1730
  key: 0,
1653
1731
  class: "wx-articles__pin",
1654
1732
  name: "star",
1655
1733
  size: "sm"
1656
- })) : K("", !0),
1657
- V(" " + T(g.title), 1)
1734
+ })) : J("", !0),
1735
+ N(" " + S(x.title), 1)
1658
1736
  ]),
1659
- meta: i(() => [
1660
- g.rubrics[0] ? (_(), q(e(se), {
1737
+ meta: n(() => [
1738
+ x.rubrics[0] ? (y(), U(e(re), {
1661
1739
  key: 0,
1662
1740
  size: "sm",
1663
1741
  round: ""
1664
1742
  }, {
1665
- default: i(() => [
1666
- V(T(g.rubrics[0].title), 1)
1743
+ default: n(() => [
1744
+ N(S(x.rubrics[0].title), 1)
1667
1745
  ]),
1668
1746
  _: 2
1669
- }, 1024)) : K("", !0),
1670
- r(e(se), {
1671
- type: o(g.status),
1747
+ }, 1024)) : J("", !0),
1748
+ r(e(re), {
1749
+ type: b(x.status),
1672
1750
  dot: "",
1673
1751
  size: "sm"
1674
1752
  }, {
1675
- default: i(() => [
1676
- V(T(e(t)(`panel.status-${g.status}`)), 1)
1753
+ default: n(() => [
1754
+ N(S(e(t)(`panel.status-${x.status}`)), 1)
1677
1755
  ]),
1678
1756
  _: 2
1679
1757
  }, 1032, ["type"]),
1680
- W(g) ? (_(), q(e(Ee), {
1758
+ P(x) ? (y(), U(e(He), {
1681
1759
  key: 1,
1682
- value: W(g)
1683
- }, null, 8, ["value"])) : K("", !0)
1760
+ value: P(x)
1761
+ }, null, 8, ["value"])) : J("", !0)
1684
1762
  ]),
1685
1763
  _: 2
1686
1764
  }, 1032, ["title", "image", "subtitle"])
1687
1765
  ]),
1688
- "card-actions": i(({ row: g }) => [
1689
- r(e(Ne), {
1690
- actions: be(g),
1691
- label: g.title
1766
+ "card-actions": n(({ row: x }) => [
1767
+ r(e(Ie), {
1768
+ actions: we(x),
1769
+ label: x.title
1692
1770
  }, null, 8, ["actions", "label"])
1693
1771
  ]),
1694
- "cell-actions": i(({ row: g }) => [
1695
- r(e(Ne), {
1696
- actions: be(g),
1697
- label: g.title
1772
+ "cell-actions": n(({ row: x }) => [
1773
+ r(e(Ie), {
1774
+ actions: we(x),
1775
+ label: x.title
1698
1776
  }, null, 8, ["actions", "label"])
1699
1777
  ]),
1700
1778
  _: 1
@@ -1704,58 +1782,482 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1704
1782
  }, 8, ["view", "title", "views", "actions"])
1705
1783
  ], 512));
1706
1784
  }
1707
- }), Aa = /* @__PURE__ */ fe(Ta, [["__scopeId", "data-v-5dfe798a"]]), Sa = /* @__PURE__ */ te({
1785
+ }), Ua = /* @__PURE__ */ de(Pa, [["__scopeId", "data-v-5dfe798a"]]);
1786
+ function mt(w) {
1787
+ const d = `${w.apiPath}/blog/authors`, c = (o) => o.data;
1788
+ return {
1789
+ list: (o = "") => {
1790
+ const a = o.trim() === "" ? "" : `?q=${encodeURIComponent(o.trim())}`;
1791
+ return w.http.get(`${d}${a}`).then(c);
1792
+ },
1793
+ accounts: () => w.http.get(`${d}/accounts`).then(c),
1794
+ get: (o) => w.http.get(`${d}/${o}`).then(c),
1795
+ create: (o, a) => w.http.post(d, { user_id: o, values: a }).then(c),
1796
+ save: (o, a) => w.http.put(`${d}/${o}`, { values: a }).then(c),
1797
+ remove: (o) => w.http.delete(`${d}/${o}`).then(() => {
1798
+ })
1799
+ };
1800
+ }
1801
+ const Ma = {
1802
+ key: 1,
1803
+ class: "wx-author__account"
1804
+ }, Ra = /* @__PURE__ */ ie({
1805
+ name: "WxAuthorPane",
1806
+ __name: "AuthorPane",
1807
+ props: {
1808
+ id: {},
1809
+ inline: { type: Boolean, default: !0 }
1810
+ },
1811
+ emits: ["back", "saved", "created", "removed"],
1812
+ setup(w, { emit: d }) {
1813
+ const c = w, o = d, a = ue(), i = mt(a), t = Me(), v = Ye();
1814
+ se();
1815
+ const l = Y("webx-blog"), m = be(), p = V(null), h = V({}), k = V(""), u = V([]), T = V(null), W = V(!0), E = V(!1), B = V({}), _ = f(() => a.can("blog.authors.manage")), q = f(() => JSON.stringify(h.value)), M = f(
1816
+ () => k.value !== "" && (q.value !== k.value || T.value !== null)
1817
+ ), $ = f(() => E.value ? "saving" : M.value || c.id === null ? "unsaved" : "saved"), g = f(() => {
1818
+ const C = h.value.title, I = c.id === null ? l("author.new") : p.value?.name ?? "";
1819
+ return pt(C, v.active.value, I) || l("author.untitled");
1820
+ }), z = f(
1821
+ () => u.value.map((C) => ({
1822
+ label: C.articles_count > 0 ? `${C.name} · ${l("author.articles", { count: C.articles_count })}` : C.name,
1823
+ value: C.id
1824
+ }))
1825
+ ), L = f({
1826
+ get: () => T.value,
1827
+ set: (C) => {
1828
+ T.value = typeof C == "number" ? C : null;
1829
+ const I = u.value.find((xe) => xe.id === T.value), j = h.value.title, ge = v.list.value[0]?.code;
1830
+ I && ge && !(j?.[ge] ?? "").trim() && (h.value = { ...h.value, title: { ...j ?? {}, [ge]: I.name } });
1831
+ }
1832
+ });
1833
+ function Q(C) {
1834
+ p.value = C.author, h.value = C.values, k.value = JSON.stringify(C.values), T.value = null;
1835
+ }
1836
+ async function te() {
1837
+ W.value = !0;
1838
+ try {
1839
+ if (c.id === null) {
1840
+ const C = {
1841
+ title: {},
1842
+ slug: {},
1843
+ role: {},
1844
+ bio: {},
1845
+ photo: null,
1846
+ socials: [],
1847
+ is_public: !1
1848
+ };
1849
+ h.value = C, k.value = JSON.stringify(C), u.value = await i.accounts();
1850
+ const I = Number(t.query.account);
1851
+ u.value.some((j) => j.id === I) && (L.value = I);
1852
+ } else
1853
+ Q(await i.get(c.id));
1854
+ } catch (C) {
1855
+ O.danger(m(C)), o("back");
1856
+ } finally {
1857
+ W.value = !1;
1858
+ }
1859
+ }
1860
+ async function K() {
1861
+ if (!(E.value || !_.value)) {
1862
+ E.value = !0, B.value = {};
1863
+ try {
1864
+ const C = c.id === null;
1865
+ if (C && T.value === null) {
1866
+ B.value = { user_id: [l("author.account-missing")] }, O.danger(l("author.save-failed"));
1867
+ return;
1868
+ }
1869
+ const I = C ? await i.create(T.value, h.value) : await i.save(c.id, h.value);
1870
+ Q(I), O.success(l("author.saved")), o(C ? "created" : "saved", I.author);
1871
+ } catch (C) {
1872
+ const I = C.body;
1873
+ I?.errors ? (B.value = I.errors, O.danger(l("author.save-failed"))) : O.danger(m(C));
1874
+ } finally {
1875
+ E.value = !1;
1876
+ }
1877
+ }
1878
+ }
1879
+ async function ce() {
1880
+ const C = p.value;
1881
+ if (!(!C || !await pe({
1882
+ title: l("author.delete-title", { name: C.name }),
1883
+ message: l("author.delete-text"),
1884
+ confirmText: l("author.delete"),
1885
+ cancelText: l("author.cancel"),
1886
+ tone: "danger"
1887
+ })))
1888
+ try {
1889
+ await i.remove(C.id), O.success(l("author.deleted")), k.value = q.value, T.value = null, o("removed", C.id);
1890
+ } catch (j) {
1891
+ O.danger(m(j));
1892
+ }
1893
+ }
1894
+ function oe(C) {
1895
+ M.value && C.preventDefault();
1896
+ }
1897
+ function ne(C) {
1898
+ (C.ctrlKey || C.metaKey) && C.key.toLowerCase() === "s" && (C.preventDefault(), (M.value || c.id === null) && K());
1899
+ }
1900
+ Wt(ne), ze(() => {
1901
+ te(), window.addEventListener("beforeunload", oe);
1902
+ }), Pe(() => {
1903
+ window.removeEventListener("beforeunload", oe);
1904
+ });
1905
+ async function X() {
1906
+ return !M.value || !_.value ? !0 : await pe({
1907
+ title: l("author.leave-title"),
1908
+ message: l("author.leave-text"),
1909
+ confirmText: l("author.leave"),
1910
+ cancelText: l("author.cancel"),
1911
+ tone: "danger"
1912
+ });
1913
+ }
1914
+ Rt(
1915
+ async (C, I) => C.query.author === I.query.author ? !0 : await X()
1916
+ ), vt(X);
1917
+ const we = f(() => {
1918
+ const C = [], I = p.value;
1919
+ return I?.open && I.url && C.push({
1920
+ key: "open",
1921
+ label: l("author.open-page"),
1922
+ icon: "external-link",
1923
+ run: () => {
1924
+ window.open(I.url, "_blank", "noopener");
1925
+ }
1926
+ }), _.value && I !== null && C.push({
1927
+ key: "delete",
1928
+ label: l("author.delete"),
1929
+ icon: "trash",
1930
+ danger: !0,
1931
+ menu: !0,
1932
+ run: () => {
1933
+ ce();
1934
+ }
1935
+ }), C;
1936
+ });
1937
+ return (C, I) => (y(), G("div", {
1938
+ class: "wx-author",
1939
+ onKeydown: ne
1940
+ }, [
1941
+ W.value ? (y(), U(e(Ne), {
1942
+ key: 0,
1943
+ class: "wx-author__ghost",
1944
+ title: "",
1945
+ rows: 6
1946
+ })) : (y(), G(_e, { key: 1 }, [
1947
+ r(e(rt), {
1948
+ level: 3,
1949
+ back: !c.inline,
1950
+ "back-label": e(l)("author.back"),
1951
+ title: g.value,
1952
+ actions: we.value,
1953
+ "collapse-below": 480,
1954
+ onBack: I[0] || (I[0] = (j) => o("back"))
1955
+ }, Pt({ _: 2 }, [
1956
+ p.value && !p.value.open ? {
1957
+ name: "title-after",
1958
+ fn: n(() => [
1959
+ r(e(re), { dot: "" }, {
1960
+ default: n(() => [
1961
+ N(S(e(l)("author.page-closed")), 1)
1962
+ ]),
1963
+ _: 1
1964
+ })
1965
+ ]),
1966
+ key: "0"
1967
+ } : void 0
1968
+ ]), 1032, ["back", "back-label", "title", "actions"]),
1969
+ c.id === null ? (y(), U(e(et), { key: 0 }, {
1970
+ default: n(() => [
1971
+ r(e(me), {
1972
+ label: e(l)("author.account"),
1973
+ help: u.value.length === 0 ? e(l)("author.no-accounts") : e(l)("author.account-help"),
1974
+ error: B.value.user_id?.[0],
1975
+ required: ""
1976
+ }, {
1977
+ default: n(() => [
1978
+ r(e($e), {
1979
+ modelValue: L.value,
1980
+ "onUpdate:modelValue": I[1] || (I[1] = (j) => L.value = j),
1981
+ options: z.value,
1982
+ disabled: !_.value || E.value || u.value.length === 0,
1983
+ filterable: "",
1984
+ teleport: "",
1985
+ "aria-label": e(l)("author.account")
1986
+ }, null, 8, ["modelValue", "options", "disabled", "aria-label"])
1987
+ ]),
1988
+ _: 1
1989
+ }, 8, ["label", "help", "error"])
1990
+ ]),
1991
+ _: 1
1992
+ })) : p.value?.user ? (y(), G("p", Ma, S(e(l)("author.account")) + ": " + S(p.value.user.name), 1)) : J("", !0),
1993
+ r(e(ut), {
1994
+ modelValue: h.value,
1995
+ "onUpdate:modelValue": I[2] || (I[2] = (j) => h.value = j),
1996
+ name: "blog.author-form",
1997
+ errors: B.value,
1998
+ disabled: !_.value || E.value
1999
+ }, null, 8, ["modelValue", "errors", "disabled"]),
2000
+ _.value ? (y(), U(e(tt), { key: 2 }, {
2001
+ state: n(() => [
2002
+ r(e(ct), { state: $.value }, null, 8, ["state"])
2003
+ ]),
2004
+ default: n(() => [
2005
+ r(e(le), {
2006
+ type: "primary",
2007
+ loading: E.value,
2008
+ disabled: !M.value && c.id !== null,
2009
+ onClick: K
2010
+ }, {
2011
+ default: n(() => [
2012
+ N(S(e(l)("author.save")), 1)
2013
+ ]),
2014
+ _: 1
2015
+ }, 8, ["loading", "disabled"])
2016
+ ]),
2017
+ _: 1
2018
+ })) : J("", !0)
2019
+ ], 64))
2020
+ ], 32));
2021
+ }
2022
+ }), Ia = /* @__PURE__ */ de(Ra, [["__scopeId", "data-v-60f7aa2e"]]), Da = { class: "wx-authors__bar" }, Ba = ["onClick"], Ea = { class: "wx-author-row__body" }, Oa = { class: "wx-author-row__name" }, La = { class: "wx-author-row__meta" }, Fa = { key: 0 }, Ka = { class: "wx-author-row__facts" }, Ha = /* @__PURE__ */ ie({
2023
+ __name: "AuthorsPage",
2024
+ props: {
2025
+ base: { default: "/blog" }
2026
+ },
2027
+ setup(w) {
2028
+ const d = ue(), c = mt(d), o = Me(), a = Oe();
2029
+ se();
2030
+ const i = Y("webx-blog"), t = be(), v = V([]), l = V(!0), m = f(() => d.can("blog.authors.manage")), p = f(
2031
+ () => d.state.manifest?.modules.find(($) => $.id === "authors")?.title ?? i("module.authors")
2032
+ ), h = f(() => typeof o.query.q == "string" ? o.query.q : ""), k = V(h.value), u = f(() => {
2033
+ const $ = o.query.author;
2034
+ return $ === "new" ? m.value ? "new" : null : typeof $ == "string" && $ !== "" && Number($) || null;
2035
+ }), T = f({
2036
+ get: () => u.value !== null,
2037
+ set: ($) => {
2038
+ $ || _();
2039
+ }
2040
+ });
2041
+ async function W() {
2042
+ l.value = !0;
2043
+ try {
2044
+ v.value = await c.list(h.value);
2045
+ } catch ($) {
2046
+ O.danger(t($));
2047
+ } finally {
2048
+ l.value = !1;
2049
+ }
2050
+ }
2051
+ he(h, () => {
2052
+ W();
2053
+ }), W();
2054
+ let E;
2055
+ he(k, ($) => {
2056
+ clearTimeout(E), E = setTimeout(() => {
2057
+ a.replace({ query: { ...o.query, q: $.trim() === "" ? void 0 : $ } });
2058
+ }, 300);
2059
+ }), Pe(() => clearTimeout(E));
2060
+ function B($) {
2061
+ const g = { ...o.query, author: String($) };
2062
+ $ !== "new" && delete g.account, a.replace({ query: g });
2063
+ }
2064
+ function _() {
2065
+ const $ = { ...o.query };
2066
+ delete $.author, delete $.account, a.replace({ query: $ });
2067
+ }
2068
+ function q($) {
2069
+ B($.id), W();
2070
+ }
2071
+ function M($) {
2072
+ u.value === $ && _(), W();
2073
+ }
2074
+ return ($, g) => (y(), U(e(je), {
2075
+ title: p.value,
2076
+ card: !1
2077
+ }, {
2078
+ default: n(() => [
2079
+ r(e(et), {
2080
+ class: "wx-authors",
2081
+ padding: "none"
2082
+ }, {
2083
+ default: n(() => [
2084
+ r(e(Lt), {
2085
+ open: T.value,
2086
+ "onUpdate:open": g[2] || (g[2] = (z) => T.value = z),
2087
+ class: "wx-authors__panes",
2088
+ "list-width": 360,
2089
+ "detail-min": 460,
2090
+ "detail-label": e(i)("module.authors")
2091
+ }, {
2092
+ list: n(() => [
2093
+ F("div", Da, [
2094
+ r(e(We), {
2095
+ modelValue: k.value,
2096
+ "onUpdate:modelValue": g[0] || (g[0] = (z) => k.value = z),
2097
+ class: "wx-authors__search",
2098
+ size: "sm",
2099
+ clearable: "",
2100
+ placeholder: e(i)("author.search"),
2101
+ "aria-label": e(i)("author.search")
2102
+ }, {
2103
+ prefix: n(() => [
2104
+ r(e(ke), {
2105
+ name: "search",
2106
+ size: "sm"
2107
+ })
2108
+ ]),
2109
+ _: 1
2110
+ }, 8, ["modelValue", "placeholder", "aria-label"])
2111
+ ]),
2112
+ m.value ? (y(), G("button", {
2113
+ key: 0,
2114
+ type: "button",
2115
+ class: qe(["wx-authors__new", { "is-current": u.value === "new" }]),
2116
+ onClick: g[1] || (g[1] = (z) => B("new"))
2117
+ }, [
2118
+ r(e(ke), {
2119
+ name: "plus",
2120
+ size: "sm"
2121
+ }),
2122
+ N(" " + S(e(i)("author.new")), 1)
2123
+ ], 2)) : J("", !0),
2124
+ l.value && v.value.length === 0 ? (y(), U(e(Ne), {
2125
+ key: 1,
2126
+ class: "wx-authors__loading",
2127
+ rows: 4
2128
+ })) : v.value.length === 0 ? (y(), U(e(Je), {
2129
+ key: 2,
2130
+ title: h.value === "" ? e(i)("author.empty") : e(i)("author.empty-search"),
2131
+ description: h.value === "" ? e(i)("author.empty-help") : void 0
2132
+ }, null, 8, ["title", "description"])) : (y(), G("ul", {
2133
+ key: 3,
2134
+ class: qe(["wx-authors__list", { "is-loading": l.value }])
2135
+ }, [
2136
+ (y(!0), G(_e, null, Ue(v.value, (z) => (y(), G("li", {
2137
+ key: z.id
2138
+ }, [
2139
+ F("button", {
2140
+ type: "button",
2141
+ class: qe(["wx-author-row", { "is-current": u.value === z.id }]),
2142
+ onClick: (L) => B(z.id)
2143
+ }, [
2144
+ r(e(Ft), {
2145
+ class: "wx-author-row__photo",
2146
+ src: z.photo ?? void 0,
2147
+ name: z.name,
2148
+ size: "md"
2149
+ }, null, 8, ["src", "name"]),
2150
+ F("span", Ea, [
2151
+ F("span", Oa, S(z.name), 1),
2152
+ F("span", La, [
2153
+ z.user ? (y(), G("span", Fa, S(z.user.name), 1)) : J("", !0),
2154
+ F("span", null, S(e(i)("author.articles", { count: z.articles_count })), 1)
2155
+ ]),
2156
+ F("span", Ka, [
2157
+ z.open ? (y(), U(e(re), {
2158
+ key: 0,
2159
+ dot: "",
2160
+ size: "sm",
2161
+ type: "success"
2162
+ }, {
2163
+ default: n(() => [
2164
+ N(S(e(i)("author.page-open")), 1)
2165
+ ]),
2166
+ _: 1
2167
+ })) : (y(), U(e(re), {
2168
+ key: 1,
2169
+ dot: "",
2170
+ size: "sm"
2171
+ }, {
2172
+ default: n(() => [
2173
+ N(S(e(i)("author.page-closed")), 1)
2174
+ ]),
2175
+ _: 1
2176
+ }))
2177
+ ])
2178
+ ])
2179
+ ], 10, Ba)
2180
+ ]))), 128))
2181
+ ], 2))
2182
+ ]),
2183
+ detail: n(({ inline: z, back: L }) => [
2184
+ u.value !== null ? (y(), U(Ia, {
2185
+ id: u.value === "new" ? null : u.value,
2186
+ key: String(u.value),
2187
+ inline: z,
2188
+ onBack: L,
2189
+ onSaved: W,
2190
+ onCreated: q,
2191
+ onRemoved: M
2192
+ }, null, 8, ["id", "inline", "onBack"])) : J("", !0)
2193
+ ]),
2194
+ empty: n(() => [
2195
+ r(e(Je), {
2196
+ title: e(i)("author.choose"),
2197
+ description: m.value ? e(i)("author.choose-help") : void 0
2198
+ }, null, 8, ["title", "description"])
2199
+ ]),
2200
+ _: 1
2201
+ }, 8, ["open", "detail-label"])
2202
+ ]),
2203
+ _: 1
2204
+ })
2205
+ ]),
2206
+ _: 1
2207
+ }, 8, ["title"]));
2208
+ }
2209
+ }), Ja = /* @__PURE__ */ de(Ha, [["__scopeId", "data-v-b0022a2f"]]), Ga = /* @__PURE__ */ ie({
1708
2210
  __name: "TagCreateDialog",
1709
- setup(b) {
1710
- const { open: d, resolve: f, dismiss: c } = Re(), a = re(), s = de(a);
1711
- ae();
1712
- const t = j("webx-blog"), u = N(""), n = N(""), p = N(!1), w = N({}), k = Ie("field");
1713
- Ue(async () => {
1714
- await Ge(), k.value?.querySelector("input")?.focus();
2211
+ setup(w) {
2212
+ const { open: d, resolve: c, dismiss: o } = Le(), a = ue(), i = ye(a);
2213
+ se();
2214
+ const t = Y("webx-blog"), v = V(""), l = V(""), m = V(!1), p = V({}), h = Be("field");
2215
+ ze(async () => {
2216
+ await Xe(), h.value?.querySelector("input")?.focus();
1715
2217
  });
1716
- async function A() {
1717
- if (!(u.value.trim() === "" || p.value)) {
1718
- p.value = !0, w.value = {};
2218
+ async function k() {
2219
+ if (!(v.value.trim() === "" || m.value)) {
2220
+ m.value = !0, p.value = {};
1719
2221
  try {
1720
- f(
1721
- await s.createTag({
1722
- title: u.value.trim(),
1723
- ...n.value.trim() === "" ? {} : { slug: n.value.trim() }
2222
+ c(
2223
+ await i.createTag({
2224
+ title: v.value.trim(),
2225
+ ...l.value.trim() === "" ? {} : { slug: l.value.trim() }
1724
2226
  })
1725
2227
  );
1726
- } catch (v) {
1727
- w.value = v.body?.errors ?? {};
2228
+ } catch (u) {
2229
+ p.value = u.body?.errors ?? {};
1728
2230
  } finally {
1729
- p.value = !1;
2231
+ m.value = !1;
1730
2232
  }
1731
2233
  }
1732
2234
  }
1733
- return (v, $) => (_(), q(e(De), {
2235
+ return (u, T) => (y(), U(e(Fe), {
1734
2236
  open: e(d),
1735
- "onUpdate:open": $[3] || ($[3] = (C) => Pe(d) ? d.value = C : null),
2237
+ "onUpdate:open": T[3] || (T[3] = (W) => Ee(d) ? d.value = W : null),
1736
2238
  title: e(t)("tag.new-title"),
1737
2239
  width: 440
1738
2240
  }, {
1739
- footer: i(() => [
1740
- r(e(Be), { size: "sm" }, {
1741
- default: i(() => [
1742
- r(e(Y), {
2241
+ footer: n(() => [
2242
+ r(e(Ke), { size: "sm" }, {
2243
+ default: n(() => [
2244
+ r(e(le), {
1743
2245
  variant: "outline",
1744
- onClick: $[2] || ($[2] = (C) => e(c)())
2246
+ onClick: T[2] || (T[2] = (W) => e(o)())
1745
2247
  }, {
1746
- default: i(() => [
1747
- V(T(e(t)("tag.cancel")), 1)
2248
+ default: n(() => [
2249
+ N(S(e(t)("tag.cancel")), 1)
1748
2250
  ]),
1749
2251
  _: 1
1750
2252
  }),
1751
- r(e(Y), {
2253
+ r(e(le), {
1752
2254
  type: "primary",
1753
- loading: p.value,
1754
- disabled: u.value.trim() === "",
1755
- onClick: A
2255
+ loading: m.value,
2256
+ disabled: v.value.trim() === "",
2257
+ onClick: k
1756
2258
  }, {
1757
- default: i(() => [
1758
- V(T(e(t)("tag.create")), 1)
2259
+ default: n(() => [
2260
+ N(S(e(t)("tag.create")), 1)
1759
2261
  ]),
1760
2262
  _: 1
1761
2263
  }, 8, ["loading", "disabled"])
@@ -1763,38 +2265,38 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1763
2265
  _: 1
1764
2266
  })
1765
2267
  ]),
1766
- default: i(() => [
1767
- r(e(ve), {
2268
+ default: n(() => [
2269
+ r(e(me), {
1768
2270
  label: e(t)("tag.field-title"),
1769
- error: w.value.title?.[0],
2271
+ error: p.value.title?.[0],
1770
2272
  required: ""
1771
2273
  }, {
1772
- default: i(() => [
1773
- H("div", {
2274
+ default: n(() => [
2275
+ F("div", {
1774
2276
  ref_key: "field",
1775
- ref: k
2277
+ ref: h
1776
2278
  }, [
1777
- r(e(Ve), {
1778
- modelValue: u.value,
1779
- "onUpdate:modelValue": $[0] || ($[0] = (C) => u.value = C),
2279
+ r(e(We), {
2280
+ modelValue: v.value,
2281
+ "onUpdate:modelValue": T[0] || (T[0] = (W) => v.value = W),
1780
2282
  "aria-label": e(t)("tag.field-title"),
1781
- onKeyup: Me(A, ["enter"])
2283
+ onKeyup: De(k, ["enter"])
1782
2284
  }, null, 8, ["modelValue", "aria-label"])
1783
2285
  ], 512)
1784
2286
  ]),
1785
2287
  _: 1
1786
2288
  }, 8, ["label", "error"]),
1787
- r(e(ve), {
2289
+ r(e(me), {
1788
2290
  label: e(t)("tag.field-slug"),
1789
- error: w.value.slug?.[0],
2291
+ error: p.value.slug?.[0],
1790
2292
  help: e(t)("tag.field-slug-help")
1791
2293
  }, {
1792
- default: i(() => [
1793
- r(e(Ve), {
1794
- modelValue: n.value,
1795
- "onUpdate:modelValue": $[1] || ($[1] = (C) => n.value = C),
2294
+ default: n(() => [
2295
+ r(e(We), {
2296
+ modelValue: l.value,
2297
+ "onUpdate:modelValue": T[1] || (T[1] = (W) => l.value = W),
1796
2298
  "aria-label": e(t)("tag.field-slug"),
1797
- onKeyup: Me(A, ["enter"])
2299
+ onKeyup: De(k, ["enter"])
1798
2300
  }, null, 8, ["modelValue", "aria-label"])
1799
2301
  ]),
1800
2302
  _: 1
@@ -1803,54 +2305,54 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1803
2305
  _: 1
1804
2306
  }, 8, ["open", "title"]));
1805
2307
  }
1806
- }), Wa = ["id"], Ca = /* @__PURE__ */ te({
2308
+ }), ja = ["id"], Za = /* @__PURE__ */ ie({
1807
2309
  __name: "TagRenameDialog",
1808
2310
  props: {
1809
2311
  name: {}
1810
2312
  },
1811
- setup(b) {
1812
- const d = b, { open: f, resolve: c, dismiss: a } = Re();
1813
- ae();
1814
- const s = j("webx-blog"), t = j("webx-admin"), u = Wt(), n = N(d.name), p = Ie("field");
1815
- Ue(async () => {
1816
- await Ge();
1817
- const k = p.value?.querySelector("input");
1818
- k?.focus(), k?.select();
2313
+ setup(w) {
2314
+ const d = w, { open: c, resolve: o, dismiss: a } = Le();
2315
+ se();
2316
+ const i = Y("webx-blog"), t = Y("webx-admin"), v = Ut(), l = V(d.name), m = Be("field");
2317
+ ze(async () => {
2318
+ await Xe();
2319
+ const h = m.value?.querySelector("input");
2320
+ h?.focus(), h?.select();
1819
2321
  });
1820
- function w() {
1821
- const k = n.value.trim();
1822
- if (k === "" || k === d.name) {
2322
+ function p() {
2323
+ const h = l.value.trim();
2324
+ if (h === "" || h === d.name) {
1823
2325
  a();
1824
2326
  return;
1825
2327
  }
1826
- c(k);
2328
+ o(h);
1827
2329
  }
1828
- return (k, A) => (_(), q(e(De), {
1829
- open: e(f),
1830
- "onUpdate:open": A[2] || (A[2] = (v) => Pe(f) ? f.value = v : null),
1831
- title: e(s)("tag.rename"),
2330
+ return (h, k) => (y(), U(e(Fe), {
2331
+ open: e(c),
2332
+ "onUpdate:open": k[2] || (k[2] = (u) => Ee(c) ? c.value = u : null),
2333
+ title: e(i)("tag.rename"),
1832
2334
  width: 420
1833
2335
  }, {
1834
- footer: i(() => [
1835
- r(e(Be), { size: "sm" }, {
1836
- default: i(() => [
1837
- r(e(Y), {
2336
+ footer: n(() => [
2337
+ r(e(Ke), { size: "sm" }, {
2338
+ default: n(() => [
2339
+ r(e(le), {
1838
2340
  variant: "outline",
1839
- onClick: A[1] || (A[1] = (v) => e(a)())
2341
+ onClick: k[1] || (k[1] = (u) => e(a)())
1840
2342
  }, {
1841
- default: i(() => [
1842
- V(T(e(s)("tag.cancel")), 1)
2343
+ default: n(() => [
2344
+ N(S(e(i)("tag.cancel")), 1)
1843
2345
  ]),
1844
2346
  _: 1
1845
2347
  }),
1846
- r(e(Y), {
2348
+ r(e(le), {
1847
2349
  type: "primary",
1848
2350
  "native-type": "submit",
1849
- form: e(u),
1850
- disabled: n.value.trim() === ""
2351
+ form: e(v),
2352
+ disabled: l.value.trim() === ""
1851
2353
  }, {
1852
- default: i(() => [
1853
- V(T(e(t)("editor.save")), 1)
2354
+ default: n(() => [
2355
+ N(S(e(t)("editor.save")), 1)
1854
2356
  ]),
1855
2357
  _: 1
1856
2358
  }, 8, ["form", "disabled"])
@@ -1858,89 +2360,89 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1858
2360
  _: 1
1859
2361
  })
1860
2362
  ]),
1861
- default: i(() => [
1862
- H("form", {
1863
- id: e(u),
2363
+ default: n(() => [
2364
+ F("form", {
2365
+ id: e(v),
1864
2366
  ref_key: "field",
1865
- ref: p,
1866
- onSubmit: Xe(w, ["prevent"])
2367
+ ref: m,
2368
+ onSubmit: nt(p, ["prevent"])
1867
2369
  }, [
1868
- r(e(ve), {
1869
- label: e(s)("tag.field-title"),
2370
+ r(e(me), {
2371
+ label: e(i)("tag.field-title"),
1870
2372
  required: ""
1871
2373
  }, {
1872
- default: i(() => [
1873
- r(e(Ve), {
1874
- modelValue: n.value,
1875
- "onUpdate:modelValue": A[0] || (A[0] = (v) => n.value = v),
1876
- "aria-label": e(s)("tag.field-title"),
1877
- onKeydown: Me(Xe(w, ["prevent"]), ["enter"])
2374
+ default: n(() => [
2375
+ r(e(We), {
2376
+ modelValue: l.value,
2377
+ "onUpdate:modelValue": k[0] || (k[0] = (u) => l.value = u),
2378
+ "aria-label": e(i)("tag.field-title"),
2379
+ onKeydown: De(nt(p, ["prevent"]), ["enter"])
1878
2380
  }, null, 8, ["modelValue", "aria-label", "onKeydown"])
1879
2381
  ]),
1880
2382
  _: 1
1881
2383
  }, 8, ["label"])
1882
- ], 40, Wa)
2384
+ ], 40, ja)
1883
2385
  ]),
1884
2386
  _: 1
1885
2387
  }, 8, ["open", "title"]));
1886
2388
  }
1887
- }), Va = { class: "wx-tag-merge" }, za = { class: "wx-tag-merge__chips" }, Na = { class: "wx-tag-merge__redirect" }, Ma = /* @__PURE__ */ te({
2389
+ }), Qa = { class: "wx-tag-merge" }, Xa = { class: "wx-tag-merge__chips" }, Ya = { class: "wx-tag-merge__redirect" }, el = /* @__PURE__ */ ie({
1888
2390
  __name: "TagMergeDialog",
1889
2391
  props: {
1890
2392
  tags: {}
1891
2393
  },
1892
- setup(b) {
1893
- const d = b, { open: f, resolve: c, dismiss: a } = Re(), s = re(), t = de(s);
1894
- ae();
1895
- const u = j("webx-blog"), n = me(), p = N(
1896
- [...d.tags].sort((S, U) => U.articles_count - S.articles_count)[0]?.id ?? 0
1897
- ), w = N(!1), k = N(!0), A = N(null), v = y(
1898
- () => d.tags.map((S) => ({ value: S.id, label: `${S.title} · ${S.articles_count}` }))
1899
- ), $ = y(() => d.tags.find((S) => S.id === p.value) ?? null), C = y(() => d.tags.filter((S) => S.id !== p.value)), B = y(() => C.value.reduce((S, U) => S + U.articles_count, 0)), R = y(() => C.value.map((S) => S.path).filter(Boolean));
1900
- async function x() {
1901
- if (!($.value === null || C.value.length === 0 || w.value)) {
1902
- w.value = !0, A.value = null;
2394
+ setup(w) {
2395
+ const d = w, { open: c, resolve: o, dismiss: a } = Le(), i = ue(), t = ye(i);
2396
+ se();
2397
+ const v = Y("webx-blog"), l = be(), m = V(
2398
+ [...d.tags].sort((q, M) => M.articles_count - q.articles_count)[0]?.id ?? 0
2399
+ ), p = V(!1), h = V(!0), k = V(null), u = f(
2400
+ () => d.tags.map((q) => ({ value: q.id, label: `${q.title} · ${q.articles_count}` }))
2401
+ ), T = f(() => d.tags.find((q) => q.id === m.value) ?? null), W = f(() => d.tags.filter((q) => q.id !== m.value)), E = f(() => W.value.reduce((q, M) => q + M.articles_count, 0)), B = f(() => W.value.map((q) => q.path).filter(Boolean));
2402
+ async function _() {
2403
+ if (!(T.value === null || W.value.length === 0 || p.value)) {
2404
+ p.value = !0, k.value = null;
1903
2405
  try {
1904
- c(
2406
+ o(
1905
2407
  await t.mergeTags(
1906
- C.value.map((S) => S.id),
1907
- p.value,
1908
- k.value
2408
+ W.value.map((q) => q.id),
2409
+ m.value,
2410
+ h.value
1909
2411
  )
1910
2412
  );
1911
- } catch (S) {
1912
- A.value = n(S);
2413
+ } catch (q) {
2414
+ k.value = l(q);
1913
2415
  } finally {
1914
- w.value = !1;
2416
+ p.value = !1;
1915
2417
  }
1916
2418
  }
1917
2419
  }
1918
- return (S, U) => (_(), q(e(De), {
1919
- open: e(f),
1920
- "onUpdate:open": U[3] || (U[3] = (I) => Pe(f) ? f.value = I : null),
1921
- title: e(u)("tag.merge-title"),
2420
+ return (q, M) => (y(), U(e(Fe), {
2421
+ open: e(c),
2422
+ "onUpdate:open": M[3] || (M[3] = ($) => Ee(c) ? c.value = $ : null),
2423
+ title: e(v)("tag.merge-title"),
1922
2424
  width: 520
1923
2425
  }, {
1924
- footer: i(() => [
1925
- r(e(Be), { size: "sm" }, {
1926
- default: i(() => [
1927
- r(e(Y), {
2426
+ footer: n(() => [
2427
+ r(e(Ke), { size: "sm" }, {
2428
+ default: n(() => [
2429
+ r(e(le), {
1928
2430
  variant: "outline",
1929
- onClick: U[2] || (U[2] = (I) => e(a)())
2431
+ onClick: M[2] || (M[2] = ($) => e(a)())
1930
2432
  }, {
1931
- default: i(() => [
1932
- V(T(e(u)("tag.cancel")), 1)
2433
+ default: n(() => [
2434
+ N(S(e(v)("tag.cancel")), 1)
1933
2435
  ]),
1934
2436
  _: 1
1935
2437
  }),
1936
- r(e(Y), {
2438
+ r(e(le), {
1937
2439
  type: "primary",
1938
- loading: w.value,
1939
- disabled: C.value.length === 0,
1940
- onClick: x
2440
+ loading: p.value,
2441
+ disabled: W.value.length === 0,
2442
+ onClick: _
1941
2443
  }, {
1942
- default: i(() => [
1943
- V(T(e(u)("tag.merge-confirm")), 1)
2444
+ default: n(() => [
2445
+ N(S(e(v)("tag.merge-confirm")), 1)
1944
2446
  ]),
1945
2447
  _: 1
1946
2448
  }, 8, ["loading", "disabled"])
@@ -1948,106 +2450,106 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
1948
2450
  _: 1
1949
2451
  })
1950
2452
  ]),
1951
- default: i(() => [
1952
- H("div", Va, [
1953
- H("div", za, [
1954
- (_(!0), J(_e, null, qe(C.value, (I) => (_(), q(e(se), {
1955
- key: I.id,
2453
+ default: n(() => [
2454
+ F("div", Qa, [
2455
+ F("div", Xa, [
2456
+ (y(!0), G(_e, null, Ue(W.value, ($) => (y(), U(e(re), {
2457
+ key: $.id,
1956
2458
  size: "sm",
1957
2459
  round: ""
1958
2460
  }, {
1959
- default: i(() => [
1960
- V(T(I.title) + " · " + T(I.articles_count), 1)
2461
+ default: n(() => [
2462
+ N(S($.title) + " · " + S($.articles_count), 1)
1961
2463
  ]),
1962
2464
  _: 2
1963
2465
  }, 1024))), 128)),
1964
- r(e(Se), {
2466
+ r(e(ke), {
1965
2467
  name: "arrow-right",
1966
2468
  size: "sm"
1967
2469
  }),
1968
- $.value ? (_(), q(e(se), {
2470
+ T.value ? (y(), U(e(re), {
1969
2471
  key: 0,
1970
2472
  type: "primary",
1971
2473
  size: "sm",
1972
2474
  round: ""
1973
2475
  }, {
1974
- default: i(() => [
1975
- V(T($.value.title) + " · " + T($.value.articles_count), 1)
2476
+ default: n(() => [
2477
+ N(S(T.value.title) + " · " + S(T.value.articles_count), 1)
1976
2478
  ]),
1977
2479
  _: 1
1978
- })) : K("", !0)
2480
+ })) : J("", !0)
1979
2481
  ]),
1980
- r(e(ve), {
1981
- label: e(u)("tag.merge-keep")
2482
+ r(e(me), {
2483
+ label: e(v)("tag.merge-keep")
1982
2484
  }, {
1983
- default: i(() => [
1984
- r(e(xe), {
1985
- modelValue: p.value,
1986
- "onUpdate:modelValue": U[0] || (U[0] = (I) => p.value = I),
1987
- options: v.value,
1988
- "aria-label": e(u)("tag.merge-keep")
2485
+ default: n(() => [
2486
+ r(e($e), {
2487
+ modelValue: m.value,
2488
+ "onUpdate:modelValue": M[0] || (M[0] = ($) => m.value = $),
2489
+ options: u.value,
2490
+ "aria-label": e(v)("tag.merge-keep")
1989
2491
  }, null, 8, ["modelValue", "options", "aria-label"])
1990
2492
  ]),
1991
2493
  _: 1
1992
2494
  }, 8, ["label"]),
1993
- H("div", Na, [
1994
- r(e(Pt), {
1995
- modelValue: k.value,
1996
- "onUpdate:modelValue": U[1] || (U[1] = (I) => k.value = I),
1997
- label: e(u)("tag.merge-redirect")
2495
+ F("div", Ya, [
2496
+ r(e(Kt), {
2497
+ modelValue: h.value,
2498
+ "onUpdate:modelValue": M[1] || (M[1] = ($) => h.value = $),
2499
+ label: e(v)("tag.merge-redirect")
1998
2500
  }, null, 8, ["modelValue", "label"]),
1999
- r(e(ne), {
2501
+ r(e(ve), {
2000
2502
  size: "sm",
2001
2503
  tone: "muted"
2002
2504
  }, {
2003
- default: i(() => [
2004
- V(T(R.value.length === 0 ? e(u)("tag.merge-redirect-none") : e(u)("tag.merge-redirect-help", { addresses: R.value.join(", ") })), 1)
2505
+ default: n(() => [
2506
+ N(S(B.value.length === 0 ? e(v)("tag.merge-redirect-none") : e(v)("tag.merge-redirect-help", { addresses: B.value.join(", ") })), 1)
2005
2507
  ]),
2006
2508
  _: 1
2007
2509
  })
2008
2510
  ]),
2009
- r(e(Le), {
2511
+ r(e(Ge), {
2010
2512
  type: "warning",
2011
2513
  variant: "soft",
2012
- description: e(u)("tag.merge-warning", {
2013
- count: B.value,
2014
- tag: $.value?.title ?? "",
2015
- merged: C.value.length
2514
+ description: e(v)("tag.merge-warning", {
2515
+ count: E.value,
2516
+ tag: T.value?.title ?? "",
2517
+ merged: W.value.length
2016
2518
  })
2017
2519
  }, null, 8, ["description"]),
2018
- A.value ? (_(), q(e(Le), {
2520
+ k.value ? (y(), U(e(Ge), {
2019
2521
  key: 0,
2020
2522
  type: "danger",
2021
2523
  variant: "soft",
2022
- description: A.value
2023
- }, null, 8, ["description"])) : K("", !0)
2524
+ description: k.value
2525
+ }, null, 8, ["description"])) : J("", !0)
2024
2526
  ])
2025
2527
  ]),
2026
2528
  _: 1
2027
2529
  }, 8, ["open", "title"]));
2028
2530
  }
2029
- }), Ua = /* @__PURE__ */ fe(Ma, [["__scopeId", "data-v-aa68b3a8"]]), qa = { class: "wx-tags" }, Ia = /* @__PURE__ */ te({
2531
+ }), tl = /* @__PURE__ */ de(el, [["__scopeId", "data-v-aa68b3a8"]]), al = { class: "wx-tags" }, ll = /* @__PURE__ */ ie({
2030
2532
  __name: "TagsPage",
2031
2533
  props: {
2032
2534
  base: { default: "/blog" }
2033
2535
  },
2034
- setup(b) {
2035
- const d = b, f = re(), c = de(f), a = Je(), s = je();
2036
- ae();
2037
- const t = j("webx-blog"), u = j("webx-admin"), n = me(), p = N(null), w = N(!0), k = N([]), A = N(!1), v = ze(Ca), $ = ze(Sa), C = ze(Ua), B = y(() => f.can("blog.taxonomy.manage")), R = y(
2038
- () => f.state.manifest?.modules.find((o) => o.id === "tags")?.title ?? t("module.tags")
2039
- ), x = y({
2536
+ setup(w) {
2537
+ const d = w, c = ue(), o = ye(c), a = Me(), i = Oe();
2538
+ se();
2539
+ const t = Y("webx-blog"), v = Y("webx-admin"), l = be(), m = V(null), p = V(!0), h = V([]), k = V(!1), u = Re(Za), T = Re(Ga), W = Re(tl), E = f(() => c.can("blog.taxonomy.manage")), B = f(
2540
+ () => c.state.manifest?.modules.find((b) => b.id === "tags")?.title ?? t("module.tags")
2541
+ ), _ = f({
2040
2542
  get: () => typeof a.query.view == "string" ? a.query.view : "",
2041
- set: (o) => {
2042
- s.replace({
2043
- query: { ...a.query, view: o === "" ? void 0 : String(o), page: void 0 }
2543
+ set: (b) => {
2544
+ i.replace({
2545
+ query: { ...a.query, view: b === "" ? void 0 : String(b), page: void 0 }
2044
2546
  });
2045
2547
  }
2046
- }), S = y(() => p.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), U = y(() => [
2047
- { value: "", label: t("tag.view-all"), badge: S.value.total },
2048
- { value: "empty", label: t("tag.view-empty"), badge: S.value.empty },
2049
- { value: "noindex", label: t("tag.view-noindex"), badge: S.value.noindex }
2050
- ]), I = y(() => p.value?.data ?? []), h = y(() => I.value.filter((o) => k.value.includes(o.id))), E = y(() => [
2548
+ }), q = f(() => m.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), M = f(() => [
2549
+ { value: "", label: t("tag.view-all"), badge: q.value.total },
2550
+ { value: "empty", label: t("tag.view-empty"), badge: q.value.empty },
2551
+ { value: "noindex", label: t("tag.view-noindex"), badge: q.value.noindex }
2552
+ ]), $ = f(() => m.value?.data ?? []), g = f(() => $.value.filter((b) => h.value.includes(b.id))), z = f(() => [
2051
2553
  { key: "title", label: t("tag.column-title"), minWidth: 150, sortable: !0 },
2052
2554
  // The number is what the other columns and the narrowest the title may be add up to without
2053
2555
  // this one: below it the address is what does not fit, and a fixed table does not shrink —
@@ -2065,106 +2567,106 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
2065
2567
  // at 180px of text, and a cell keeps 32 of its own. Narrower, the ruled row wrapped and
2066
2568
  // stood eighteen pixels taller than the ones around it.
2067
2569
  { key: "indexing", label: t("tag.column-indexing"), width: 230, hideBelow: 560 },
2068
- { key: "actions", label: "", width: at, align: "right" }
2570
+ { key: "actions", label: "", width: dt, align: "right" }
2069
2571
  ]);
2070
- function L(o) {
2572
+ function L(b) {
2071
2573
  return {
2072
- q: o?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
2073
- empty: x.value === "empty",
2074
- noindex: x.value === "noindex",
2574
+ q: b?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
2575
+ empty: _.value === "empty",
2576
+ noindex: _.value === "noindex",
2075
2577
  // Only when it is not the default: most used first is what the list is, and a query
2076
2578
  // string that repeats the default is a link that outlives a change of mind about it.
2077
- sort: ee(o),
2078
- page: o?.page ?? (Number(a.query.page ?? 1) || 1),
2079
- per_page: o?.perPage
2579
+ sort: te(b),
2580
+ page: b?.page ?? (Number(a.query.page ?? 1) || 1),
2581
+ per_page: b?.perPage
2080
2582
  };
2081
2583
  }
2082
- async function Z(o) {
2083
- w.value = !0;
2584
+ async function Q(b) {
2585
+ p.value = !0;
2084
2586
  try {
2085
- p.value = await c.tagsPage(L(o));
2086
- } catch (M) {
2087
- P.danger(n(M));
2587
+ m.value = await o.tagsPage(L(b));
2588
+ } catch (D) {
2589
+ O.danger(l(D));
2088
2590
  } finally {
2089
- w.value = !1;
2591
+ p.value = !1;
2090
2592
  }
2091
2593
  }
2092
- function ee(o) {
2093
- const M = o?.sort ?? O();
2094
- if (!M) return;
2095
- const W = M.key === "title" ? "name" : "articles", G = `${M.order === "desc" ? "-" : ""}${W}`;
2096
- return G === "articles" ? void 0 : G;
2594
+ function te(b) {
2595
+ const D = b?.sort ?? K();
2596
+ if (!D) return;
2597
+ const P = D.key === "title" ? "name" : "articles", ee = `${D.order === "desc" ? "-" : ""}${P}`;
2598
+ return ee === "articles" ? void 0 : ee;
2097
2599
  }
2098
- function O() {
2099
- const o = typeof a.query.sort == "string" ? a.query.sort : "";
2100
- if (o === "") return null;
2101
- const M = o.startsWith("-");
2102
- return { key: (M ? o.slice(1) : o) === "name" ? "title" : "articles_count", order: M ? "desc" : "asc" };
2600
+ function K() {
2601
+ const b = typeof a.query.sort == "string" ? a.query.sort : "";
2602
+ if (b === "") return null;
2603
+ const D = b.startsWith("-");
2604
+ return { key: (D ? b.slice(1) : b) === "name" ? "title" : "articles_count", order: D ? "desc" : "asc" };
2103
2605
  }
2104
- function oe(o) {
2105
- const M = {
2606
+ function ce(b) {
2607
+ const D = {
2106
2608
  ...a.query,
2107
- q: o.search === "" ? void 0 : o.search,
2108
- sort: ee(o),
2109
- page: o.page === 1 ? void 0 : String(o.page)
2609
+ q: b.search === "" ? void 0 : b.search,
2610
+ sort: te(b),
2611
+ page: b.page === 1 ? void 0 : String(b.page)
2110
2612
  };
2111
- s.replace({ query: M }), Z(o);
2613
+ i.replace({ query: D }), Q(b);
2112
2614
  }
2113
- ge(x, () => {
2114
- k.value = [], Z();
2115
- }), Z();
2116
- async function ie() {
2117
- await $({}) && await Z();
2615
+ he(_, () => {
2616
+ h.value = [], Q();
2617
+ }), Q();
2618
+ async function oe() {
2619
+ await T({}) && await Q();
2118
2620
  }
2119
- async function le(o) {
2120
- const M = await v({ name: o.title });
2121
- M && await be(o, { title: M }, t("tag.renamed"));
2621
+ async function ne(b) {
2622
+ const D = await u({ name: b.title });
2623
+ D && await we(b, { title: D }, t("tag.renamed"));
2122
2624
  }
2123
- async function Q(o, M) {
2124
- await be(o, { noindex: M }, t(M ? "tag.kept-out" : "tag.indexed"));
2625
+ async function X(b, D) {
2626
+ await we(b, { noindex: D }, t(D ? "tag.kept-out" : "tag.indexed"));
2125
2627
  }
2126
- async function be(o, M, W) {
2628
+ async function we(b, D, P) {
2127
2629
  try {
2128
- const G = await c.saveTag(o.id, M);
2129
- p.value && (p.value = {
2130
- ...p.value,
2131
- data: p.value.data.map((l) => l.id === G.id ? G : l)
2132
- }), P.success(W);
2133
- } catch (G) {
2134
- P.danger(n(G));
2630
+ const ee = await o.saveTag(b.id, D);
2631
+ m.value && (m.value = {
2632
+ ...m.value,
2633
+ data: m.value.data.map((s) => s.id === ee.id ? ee : s)
2634
+ }), O.success(P);
2635
+ } catch (ee) {
2636
+ O.danger(l(ee));
2135
2637
  }
2136
2638
  }
2137
- async function ke(o) {
2639
+ async function C(b) {
2138
2640
  if (await pe({
2139
- title: t("tag.delete-title", { title: o.title }),
2140
- message: o.articles_count > 0 ? t("tag.delete-text-used", { count: o.articles_count }) : t("tag.delete-text"),
2641
+ title: t("tag.delete-title", { title: b.title }),
2642
+ message: b.articles_count > 0 ? t("tag.delete-text-used", { count: b.articles_count }) : t("tag.delete-text"),
2141
2643
  confirmText: t("tag.delete"),
2142
2644
  cancelText: t("tag.cancel"),
2143
2645
  tone: "danger"
2144
2646
  }))
2145
2647
  try {
2146
- await c.removeTag(o.id), P.success(t("tag.deleted")), k.value = k.value.filter((W) => W !== o.id), await Z();
2147
- } catch (W) {
2148
- P.danger(n(W));
2648
+ await o.removeTag(b.id), O.success(t("tag.deleted")), h.value = h.value.filter((P) => P !== b.id), await Q();
2649
+ } catch (P) {
2650
+ O.danger(l(P));
2149
2651
  }
2150
2652
  }
2151
- const ce = y(() => [
2653
+ const I = f(() => [
2152
2654
  {
2153
2655
  key: "index",
2154
2656
  icon: "eye",
2155
2657
  label: t("tag.index"),
2156
- disabled: A.value,
2658
+ disabled: k.value,
2157
2659
  run: () => {
2158
- X("index");
2660
+ ae("index");
2159
2661
  }
2160
2662
  },
2161
2663
  {
2162
2664
  key: "noindex",
2163
2665
  icon: "eye-off",
2164
2666
  label: t("tag.noindex"),
2165
- disabled: A.value,
2667
+ disabled: k.value,
2166
2668
  run: () => {
2167
- X("noindex");
2669
+ ae("noindex");
2168
2670
  }
2169
2671
  },
2170
2672
  {
@@ -2172,188 +2674,188 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
2172
2674
  icon: "trash",
2173
2675
  label: t("tag.delete"),
2174
2676
  danger: !0,
2175
- disabled: A.value,
2677
+ disabled: k.value,
2176
2678
  run: () => {
2177
- X("delete");
2679
+ ae("delete");
2178
2680
  }
2179
2681
  }
2180
2682
  ]);
2181
- function he(o) {
2182
- if (!B.value) return [];
2183
- const M = [
2683
+ function j(b) {
2684
+ if (!E.value) return [];
2685
+ const D = [
2184
2686
  { key: "rename", icon: "edit", label: t("tag.rename"), run: () => {
2185
- le(o);
2687
+ ne(b);
2186
2688
  } }
2187
2689
  ];
2188
- return o.url && M.push({
2690
+ return b.url && D.push({
2189
2691
  key: "site",
2190
2692
  icon: "external-link",
2191
2693
  label: t("tag.open-on-site"),
2192
- href: o.url
2193
- }), M.push({
2694
+ href: b.url
2695
+ }), D.push({
2194
2696
  key: "articles",
2195
2697
  icon: "list",
2196
2698
  label: t("tag.show-articles"),
2197
2699
  run: () => {
2198
- s.push({ path: `${d.base}/articles`, query: { tag: String(o.id) } });
2700
+ i.push({ path: `${d.base}/articles`, query: { tag: String(b.id) } });
2199
2701
  }
2200
- }), M.push(
2201
- o.noindex ? {
2702
+ }), D.push(
2703
+ b.noindex ? {
2202
2704
  key: "index",
2203
2705
  icon: "eye",
2204
2706
  label: t("tag.index"),
2205
2707
  run: () => {
2206
- Q(o, !1);
2708
+ X(b, !1);
2207
2709
  }
2208
2710
  } : {
2209
2711
  key: "noindex",
2210
2712
  icon: "eye-off",
2211
2713
  label: t("tag.noindex"),
2212
2714
  run: () => {
2213
- Q(o, !0);
2715
+ X(b, !0);
2214
2716
  }
2215
2717
  }
2216
- ), M.push({
2718
+ ), D.push({
2217
2719
  key: "delete",
2218
2720
  icon: "trash",
2219
2721
  label: t("tag.delete"),
2220
2722
  danger: !0,
2221
2723
  run: () => {
2222
- ke(o);
2724
+ C(b);
2223
2725
  }
2224
- }), M;
2726
+ }), D;
2225
2727
  }
2226
- function $e(o) {
2227
- return o === "noindex" ? "muted" : "success";
2728
+ function ge(b) {
2729
+ return b === "noindex" ? "muted" : "success";
2228
2730
  }
2229
- async function Te() {
2230
- if (h.value.length < 2) return;
2231
- const o = await C({ tags: h.value });
2232
- o && (P.success(t("tag.merged", { tag: o.tag.title, count: o.articles_count })), k.value = [], await Z());
2233
- }
2234
- async function X(o) {
2235
- const M = h.value.map((W) => W.id);
2236
- if (!(M.length === 0 || A.value)) {
2237
- if (o === "delete") {
2238
- const W = h.value.reduce((l, z) => l + z.articles_count, 0);
2731
+ async function xe() {
2732
+ if (g.value.length < 2) return;
2733
+ const b = await W({ tags: g.value });
2734
+ b && (O.success(t("tag.merged", { tag: b.tag.title, count: b.articles_count })), h.value = [], await Q());
2735
+ }
2736
+ async function ae(b) {
2737
+ const D = g.value.map((P) => P.id);
2738
+ if (!(D.length === 0 || k.value)) {
2739
+ if (b === "delete") {
2740
+ const P = g.value.reduce((s, R) => s + R.articles_count, 0);
2239
2741
  if (!await pe({
2240
- title: t("tag.delete-many-title", { count: M.length }),
2241
- message: W > 0 ? t("tag.delete-many-text-used", { count: W }) : t("tag.delete-many-text"),
2742
+ title: t("tag.delete-many-title", { count: D.length }),
2743
+ message: P > 0 ? t("tag.delete-many-text-used", { count: P }) : t("tag.delete-many-text"),
2242
2744
  confirmText: t("tag.delete"),
2243
2745
  cancelText: t("tag.cancel"),
2244
2746
  tone: "danger"
2245
2747
  })) return;
2246
2748
  }
2247
- A.value = !0;
2749
+ k.value = !0;
2248
2750
  try {
2249
- const W = await c.massTags(M, o);
2250
- P.success(
2251
- o === "delete" ? t("tag.deleted-many", { count: W }) : o === "index" ? t("tag.indexed-many", { count: W }) : t("tag.kept-out-many", { count: W })
2252
- ), k.value = [], await Z();
2253
- } catch (W) {
2254
- P.danger(n(W));
2751
+ const P = await o.massTags(D, b);
2752
+ O.success(
2753
+ b === "delete" ? t("tag.deleted-many", { count: P }) : b === "index" ? t("tag.indexed-many", { count: P }) : t("tag.kept-out-many", { count: P })
2754
+ ), h.value = [], await Q();
2755
+ } catch (P) {
2756
+ O.danger(l(P));
2255
2757
  } finally {
2256
- A.value = !1;
2758
+ k.value = !1;
2257
2759
  }
2258
2760
  }
2259
2761
  }
2260
- const Ce = y(
2261
- () => B.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2262
- ie();
2762
+ const Ve = f(
2763
+ () => E.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2764
+ oe();
2263
2765
  } }] : []
2264
2766
  );
2265
- return (o, M) => (_(), J("div", qa, [
2266
- r(e(lt), {
2267
- view: x.value,
2268
- "onUpdate:view": M[1] || (M[1] = (W) => x.value = W),
2269
- title: R.value,
2270
- views: U.value,
2271
- actions: Ce.value
2767
+ return (b, D) => (y(), G("div", al, [
2768
+ r(e(je), {
2769
+ view: _.value,
2770
+ "onUpdate:view": D[1] || (D[1] = (P) => _.value = P),
2771
+ title: B.value,
2772
+ views: M.value,
2773
+ actions: Ve.value
2272
2774
  }, {
2273
- default: i(() => [
2274
- r(e(rt), {
2275
- selected: k.value,
2276
- "onUpdate:selected": M[0] || (M[0] = (W) => k.value = W),
2277
- data: p.value,
2278
- columns: E.value,
2775
+ default: n(() => [
2776
+ r(e(ht), {
2777
+ selected: h.value,
2778
+ "onUpdate:selected": D[0] || (D[0] = (P) => h.value = P),
2779
+ data: m.value,
2780
+ columns: z.value,
2279
2781
  "row-key": "id",
2280
2782
  searchable: "",
2281
2783
  hover: "",
2282
2784
  flush: "",
2283
2785
  layout: "fixed",
2284
- loading: w.value,
2285
- selectable: B.value,
2286
- "select-row-label": e(u)("filters.select-row"),
2287
- "select-all-label": e(u)("filters.select-all"),
2786
+ loading: p.value,
2787
+ selectable: E.value,
2788
+ "select-row-label": e(v)("filters.select-row"),
2789
+ "select-all-label": e(v)("filters.select-all"),
2288
2790
  "cards-below": 0,
2289
2791
  "search-placeholder": e(t)("tag.search"),
2290
- "empty-text": I.value.length === 0 && !w.value ? e(t)("tag.empty") : void 0,
2291
- "aria-label": R.value,
2292
- onStateChange: oe
2792
+ "empty-text": $.value.length === 0 && !p.value ? e(t)("tag.empty") : void 0,
2793
+ "aria-label": B.value,
2794
+ onStateChange: ce
2293
2795
  }, {
2294
- "cell-title": i(({ row: W }) => [
2295
- r(e(ne), { truncate: "" }, {
2296
- default: i(() => [
2297
- V(T(W.title), 1)
2796
+ "cell-title": n(({ row: P }) => [
2797
+ r(e(ve), { truncate: "" }, {
2798
+ default: n(() => [
2799
+ N(S(P.title), 1)
2298
2800
  ]),
2299
2801
  _: 2
2300
2802
  }, 1024)
2301
2803
  ]),
2302
- "cell-path": i(({ row: W }) => [
2303
- r(e(ne), {
2804
+ "cell-path": n(({ row: P }) => [
2805
+ r(e(ve), {
2304
2806
  size: "sm",
2305
2807
  tone: "muted",
2306
2808
  mono: "",
2307
2809
  truncate: ""
2308
2810
  }, {
2309
- default: i(() => [
2310
- V(T(W.path ?? e(t)("tag.no-address")), 1)
2811
+ default: n(() => [
2812
+ N(S(P.path ?? e(t)("tag.no-address")), 1)
2311
2813
  ]),
2312
2814
  _: 2
2313
2815
  }, 1024)
2314
2816
  ]),
2315
- "cell-articles_count": i(({ row: W }) => [
2316
- r(e(ne), {
2317
- tone: W.articles_count === 0 ? "muted" : "default"
2817
+ "cell-articles_count": n(({ row: P }) => [
2818
+ r(e(ve), {
2819
+ tone: P.articles_count === 0 ? "muted" : "default"
2318
2820
  }, {
2319
- default: i(() => [
2320
- V(T(W.articles_count), 1)
2821
+ default: n(() => [
2822
+ N(S(P.articles_count), 1)
2321
2823
  ]),
2322
2824
  _: 2
2323
2825
  }, 1032, ["tone"])
2324
2826
  ]),
2325
- "cell-indexing": i(({ row: W }) => [
2326
- W.indexing === "rule" ? (_(), q(e(ot), {
2827
+ "cell-indexing": n(({ row: P }) => [
2828
+ P.indexing === "rule" ? (y(), U(e(gt), {
2327
2829
  key: 0,
2328
2830
  content: e(t)("tag.indexing-rule-help")
2329
2831
  }, {
2330
- default: i(() => [
2331
- r(e(ne), {
2832
+ default: n(() => [
2833
+ r(e(ve), {
2332
2834
  size: "sm",
2333
- tone: $e(W.indexing)
2835
+ tone: ge(P.indexing)
2334
2836
  }, {
2335
- default: i(() => [
2336
- V(T(e(t)("tag.indexing-rule")), 1)
2837
+ default: n(() => [
2838
+ N(S(e(t)("tag.indexing-rule")), 1)
2337
2839
  ]),
2338
2840
  _: 1
2339
2841
  }, 8, ["tone"])
2340
2842
  ]),
2341
2843
  _: 2
2342
- }, 1032, ["content"])) : (_(), q(e(ne), {
2844
+ }, 1032, ["content"])) : (y(), U(e(ve), {
2343
2845
  key: 1,
2344
2846
  size: "sm",
2345
- tone: $e(W.indexing)
2847
+ tone: ge(P.indexing)
2346
2848
  }, {
2347
- default: i(() => [
2348
- V(T(e(t)(`tag.indexing-${W.indexing}`)), 1)
2849
+ default: n(() => [
2850
+ N(S(e(t)(`tag.indexing-${P.indexing}`)), 1)
2349
2851
  ]),
2350
2852
  _: 2
2351
2853
  }, 1032, ["tone"]))
2352
2854
  ]),
2353
- "cell-actions": i(({ row: W }) => [
2354
- r(e(Ne), {
2355
- actions: he(W),
2356
- label: W.title
2855
+ "cell-actions": n(({ row: P }) => [
2856
+ r(e(Ie), {
2857
+ actions: j(P),
2858
+ label: P.title
2357
2859
  }, null, 8, ["actions", "label"])
2358
2860
  ]),
2359
2861
  _: 1
@@ -2361,54 +2863,54 @@ const Lt = { class: "wx-article-editor__screen" }, Ft = 1200, Kt = /* @__PURE__
2361
2863
  ]),
2362
2864
  _: 1
2363
2865
  }, 8, ["view", "title", "views", "actions"]),
2364
- h.value.length > 0 ? (_(), q(e(st), {
2866
+ g.value.length > 0 ? (y(), U(e(tt), {
2365
2867
  key: 0,
2366
2868
  class: "wx-tags__bar",
2367
2869
  sticky: ""
2368
2870
  }, {
2369
- state: i(() => [
2370
- r(e(ne), { weight: "medium" }, {
2371
- default: i(() => [
2372
- V(T(e(t)("tag.selected", { count: h.value.length })), 1)
2871
+ state: n(() => [
2872
+ r(e(ve), { weight: "medium" }, {
2873
+ default: n(() => [
2874
+ N(S(e(t)("tag.selected", { count: g.value.length })), 1)
2373
2875
  ]),
2374
2876
  _: 1
2375
2877
  })
2376
2878
  ]),
2377
- default: i(() => [
2378
- r(e(Y), {
2879
+ default: n(() => [
2880
+ r(e(le), {
2379
2881
  type: "primary",
2380
- disabled: h.value.length < 2 || A.value,
2381
- onClick: Te
2882
+ disabled: g.value.length < 2 || k.value,
2883
+ onClick: xe
2382
2884
  }, {
2383
- icon: i(() => [
2384
- r(e(Se), { name: "link" })
2885
+ icon: n(() => [
2886
+ r(e(ke), { name: "link" })
2385
2887
  ]),
2386
- default: i(() => [
2387
- V(" " + T(e(t)("tag.merge")), 1)
2888
+ default: n(() => [
2889
+ N(" " + S(e(t)("tag.merge")), 1)
2388
2890
  ]),
2389
2891
  _: 1
2390
2892
  }, 8, ["disabled"]),
2391
- r(e(Ne), {
2893
+ r(e(Ie), {
2392
2894
  size: "lg",
2393
- actions: ce.value,
2394
- label: e(t)("tag.selected", { count: h.value.length })
2895
+ actions: I.value,
2896
+ label: e(t)("tag.selected", { count: g.value.length })
2395
2897
  }, null, 8, ["actions", "label"])
2396
2898
  ]),
2397
2899
  _: 1
2398
- })) : K("", !0)
2900
+ })) : J("", !0)
2399
2901
  ]));
2400
2902
  }
2401
- }), Pa = /* @__PURE__ */ fe(Ia, [["__scopeId", "data-v-d9b8d73d"]]);
2402
- function Ra(b = "/blog") {
2903
+ }), nl = /* @__PURE__ */ de(ll, [["__scopeId", "data-v-d9b8d73d"]]);
2904
+ function il(w = "/blog") {
2403
2905
  return {
2404
2906
  api: "blog/rubrics",
2405
- path: `${b}/rubrics`,
2907
+ path: `${w}/rubrics`,
2406
2908
  name: "webx.blog.rubrics",
2407
2909
  module: "rubrics",
2408
2910
  screen: "blog.category-form",
2409
2911
  manage: "blog.taxonomy.manage",
2410
2912
  count: "articles_count",
2411
- items: (d) => ({ path: `${b}/articles`, query: { rubric: String(d) } }),
2913
+ items: (d) => ({ path: `${w}/articles`, query: { rubric: String(d) } }),
2412
2914
  words: {
2413
2915
  new: "webx-blog::rubric.new",
2414
2916
  empty: "webx-blog::rubric.empty",
@@ -2428,8 +2930,8 @@ function Ra(b = "/blog") {
2428
2930
  }
2429
2931
  };
2430
2932
  }
2431
- function Ka(b = {}) {
2432
- const d = b.path ?? "/blog";
2933
+ function vl(w = {}) {
2934
+ const d = w.path ?? "/blog";
2433
2935
  return [
2434
2936
  {
2435
2937
  id: "articles",
@@ -2440,13 +2942,13 @@ function Ka(b = {}) {
2440
2942
  {
2441
2943
  path: `${d}/articles`,
2442
2944
  name: "webx.blog.articles",
2443
- component: Aa,
2945
+ component: Ua,
2444
2946
  props: { base: d }
2445
2947
  },
2446
2948
  {
2447
2949
  path: `${d}/articles/:id(\\d+)`,
2448
2950
  name: "webx.blog.articles.edit",
2449
- component: Ht,
2951
+ component: ta,
2450
2952
  props: { base: d }
2451
2953
  }
2452
2954
  ],
@@ -2465,12 +2967,12 @@ function Ka(b = {}) {
2465
2967
  * description — it is configuration the editor was handed with the record.
2466
2968
  */
2467
2969
  types: {
2468
- "wx-article-slug": { component: oa, kind: "field" },
2469
- "wx-article-author": { component: Ot, kind: "field" },
2470
- "wx-article-tags": { component: ga, kind: "field" },
2471
- "wx-article-related": { component: ia, kind: "field" },
2472
- "wx-article-unpublish": { component: ha, kind: "display" },
2473
- "wx-article-history": { component: Xt, kind: "display" }
2970
+ "wx-article-slug": { component: ma, kind: "field" },
2971
+ "wx-article-author": { component: Qt, kind: "field" },
2972
+ "wx-article-tags": { component: ka, kind: "field" },
2973
+ "wx-article-related": { component: pa, kind: "field" },
2974
+ "wx-article-unpublish": { component: Ta, kind: "display" },
2975
+ "wx-article-history": { component: oa, kind: "display" }
2474
2976
  }
2475
2977
  },
2476
2978
  {
@@ -2478,7 +2980,7 @@ function Ka(b = {}) {
2478
2980
  path: `${d}/rubrics`,
2479
2981
  // The list and the page of one rubric are the panel's shared category screens (§3.6 of
2480
2982
  // the services spec); what is the blog's is the description they are handed.
2481
- routes: kt(Ra(d))
2983
+ routes: Ct(il(d))
2482
2984
  },
2483
2985
  {
2484
2986
  id: "tags",
@@ -2487,7 +2989,21 @@ function Ka(b = {}) {
2487
2989
  {
2488
2990
  path: `${d}/tags`,
2489
2991
  name: "webx.blog.tags",
2490
- component: Pa,
2992
+ component: nl,
2993
+ props: { base: d }
2994
+ }
2995
+ ]
2996
+ },
2997
+ {
2998
+ // Only on a site with author pages (§19): the server leaves the module out of the manifest
2999
+ // otherwise, and a module the manifest does not name is never drawn.
3000
+ id: "authors",
3001
+ path: `${d}/authors`,
3002
+ routes: [
3003
+ {
3004
+ path: `${d}/authors`,
3005
+ name: "webx.blog.authors",
3006
+ component: Ja,
2491
3007
  props: { base: d }
2492
3008
  }
2493
3009
  ]
@@ -2495,24 +3011,27 @@ function Ka(b = {}) {
2495
3011
  ];
2496
3012
  }
2497
3013
  export {
2498
- Ot as WxArticleAuthorField,
2499
- ma as WxArticleCreateDialog,
2500
- Ht as WxArticleEditorPage,
2501
- Xt as WxArticleHistory,
2502
- ia as WxArticleRelated,
2503
- oa as WxArticleSlug,
2504
- ga as WxArticleTags,
2505
- ha as WxArticleUnpublish,
2506
- Aa as WxArticlesPage,
2507
- Sa as WxTagCreateDialog,
2508
- Ua as WxTagMergeDialog,
2509
- Pa as WxTagsPage,
2510
- ut as articleEditorKey,
2511
- Ka as blog,
2512
- Et as blogMessages,
2513
- de as createBlogApi,
2514
- Bt as provideArticleEditor,
2515
- Ra as rubricsOptions,
2516
- We as useArticleEditor
3014
+ Qt as WxArticleAuthorField,
3015
+ Aa as WxArticleCreateDialog,
3016
+ ta as WxArticleEditorPage,
3017
+ oa as WxArticleHistory,
3018
+ pa as WxArticleRelated,
3019
+ ma as WxArticleSlug,
3020
+ ka as WxArticleTags,
3021
+ Ta as WxArticleUnpublish,
3022
+ Ua as WxArticlesPage,
3023
+ Ia as WxAuthorPane,
3024
+ Ja as WxAuthorsPage,
3025
+ Ga as WxTagCreateDialog,
3026
+ tl as WxTagMergeDialog,
3027
+ nl as WxTagsPage,
3028
+ ft as articleEditorKey,
3029
+ vl as blog,
3030
+ Gt as blogMessages,
3031
+ mt as createAuthorsApi,
3032
+ ye as createBlogApi,
3033
+ Jt as provideArticleEditor,
3034
+ il as rubricsOptions,
3035
+ Ce as useArticleEditor
2517
3036
  };
2518
3037
  //# sourceMappingURL=index.js.map