@webx-ui/module-blog 0.5.14 → 0.5.16

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,14 +1,14 @@
1
- import { useAdmin as le, useTranslate as Z, useDates as ut, useErrorText as we, WxScreenHead as ct, WxScreen as dt, WxSaveState as pt, WxDate as Ee, rowMenuWidth as Ye, WxListScreen as et, WxRowMenu as ze, WxFilterChips as vt, categoryRoutes as gt } from "@webx-ui/module-admin";
2
- import { provide as ht, inject as ft, defineComponent as Q, useModel as Le, computed as h, openBlock as x, createBlock as I, unref as e, mergeModels as Fe, ref as M, watch as ve, onMounted as Ne, onBeforeUnmount as Ke, createElementBlock as H, Fragment as Te, createVNode as r, withCtx as i, createTextVNode as V, toDisplayString as k, createCommentVNode as K, createElementVNode as F, renderList as qe, normalizeClass as tt, normalizeProps as mt, guardReactiveProps as bt, useTemplateRef as Ie, nextTick as He, isRef as Pe, withKeys as Me, useId as yt, withModifiers as Je } from "vue";
3
- import { WxSelect as $e, useLocales as at, localizedValue as wt, confirm as de, WxSkeleton as Oe, WxCard as xt, WxBadge as ae, WxBreadcrumb as _t, WxBreadcrumbItem as Ze, WxAlert as Ue, WxButton as G, WxActionBar as lt, toast as D, WxEmpty as kt, WxText as te, WxSortableList as $t, WxAction as Tt, WxInput as Ce, WxFormItem as pe, useModal as Re, WxDialog as De, WxSpace as Be, useElementWidth as At, createModal as Ve, WxTable as it, WxEntityCard as St, WxIcon as Ae, WxTooltip as nt, WxCheckbox as Wt } from "@webx-ui/core";
1
+ import { useAdmin as ne, useTranslate as J, useDates as ut, useErrorText as be, WxScreenHead as ct, WxScreen as dt, WxSaveState as pt, WxDate as Ee, rowMenuWidth as Ye, WxListScreen as et, WxRowMenu as ze, WxFilterChips as vt, categoryRoutes as gt } from "@webx-ui/module-admin";
2
+ import { provide as ft, inject as ht, defineComponent as Q, useModel as Le, computed as h, openBlock as _, createBlock as q, unref as e, mergeModels as Fe, ref as M, watch as ve, onMounted as Ne, onBeforeUnmount as Ke, createElementBlock as H, Fragment as ke, createVNode as r, withCtx as l, createTextVNode as C, toDisplayString as k, createCommentVNode as K, createElementVNode as F, renderList as qe, normalizeClass as tt, normalizeProps as mt, guardReactiveProps as bt, useTemplateRef as Ie, nextTick as He, isRef as Pe, withKeys as Me, useId as yt, withModifiers as Je } from "vue";
3
+ import { WxSelect as _e, useLocales as at, localizedValue as wt, confirm as de, WxSkeleton as Oe, WxCard as xt, WxBadge as ie, WxBreadcrumb as _t, WxBreadcrumbItem as Ze, WxAlert as Ue, WxButton as G, WxActionBar as lt, toast as R, WxEmpty as kt, WxText as le, WxSortableList as $t, WxAction as Tt, WxInput as Ce, WxFormItem as pe, useModal as Re, WxDialog as De, WxSpace as Be, useElementWidth as At, createModal as Ve, WxTable as it, WxEntityCard as St, WxIcon as Te, WxTooltip as nt, WxCheckbox as Wt } from "@webx-ui/core";
4
4
  import { useRoute as Ge, useRouter as je, onBeforeRouteLeave as Ct } from "vue-router";
5
5
  import { provideBlocksPreview as Vt } from "@webx-ui/module-blocks";
6
6
  const st = /* @__PURE__ */ Symbol("wx-article-editor");
7
- function zt(v) {
8
- ht(st, v);
7
+ function zt(g) {
8
+ ft(st, g);
9
9
  }
10
- function Se() {
11
- return ft(st, null);
10
+ function Ae() {
11
+ return ht(st, null);
12
12
  }
13
13
  const Mt = {
14
14
  module: {
@@ -226,8 +226,8 @@ const Mt = {
226
226
  }, Qe = /* @__PURE__ */ new WeakSet();
227
227
  function X() {
228
228
  try {
229
- const { i18n: v } = le();
230
- Qe.has(v) || (v.defaults("webx-blog", Mt), Qe.add(v));
229
+ const { i18n: g } = ne();
230
+ Qe.has(g) || (g.defaults("webx-blog", Mt), Qe.add(g));
231
231
  } catch {
232
232
  }
233
233
  }
@@ -241,23 +241,23 @@ const Ut = /* @__PURE__ */ Q({
241
241
  modelModifiers: {}
242
242
  }),
243
243
  emits: ["update:modelValue"],
244
- setup(v) {
245
- const c = v, p = Le(v, "modelValue"), g = Se();
244
+ setup(g) {
245
+ const c = g, v = Le(g, "modelValue"), f = Ae();
246
246
  X();
247
- const a = Z("webx-blog"), s = h(() => c.disabled || g?.disabled.value === !0), t = h(
248
- () => (g?.options.value.authors ?? []).map((l) => ({
249
- label: l.title,
250
- value: l.id
247
+ const a = J("webx-blog"), s = h(() => c.disabled || f?.disabled.value === !0), t = h(
248
+ () => (f?.options.value.authors ?? []).map((i) => ({
249
+ label: i.title,
250
+ value: i.id
251
251
  }))
252
- ), o = h({
253
- get: () => p.value,
254
- set: (l) => {
255
- p.value = typeof l == "number" ? l : null;
252
+ ), u = h({
253
+ get: () => v.value,
254
+ set: (i) => {
255
+ v.value = typeof i == "number" ? i : null;
256
256
  }
257
257
  });
258
- return (l, b) => (x(), I(e($e), {
259
- modelValue: o.value,
260
- "onUpdate:modelValue": b[0] || (b[0] = (f) => o.value = f),
258
+ return (i, m) => (_(), q(e(_e), {
259
+ modelValue: u.value,
260
+ "onUpdate:modelValue": m[0] || (m[0] = (y) => u.value = y),
261
261
  options: t.value,
262
262
  placeholder: e(a)("article.no-author"),
263
263
  disabled: s.value,
@@ -268,42 +268,42 @@ const Ut = /* @__PURE__ */ Q({
268
268
  }, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]));
269
269
  }
270
270
  });
271
- function oe(v) {
272
- const c = `${v.apiPath}/blog/articles`, p = `${v.apiPath}/blog/tags`, g = (a) => a.data;
271
+ function ue(g) {
272
+ const c = `${g.apiPath}/blog/articles`, v = `${g.apiPath}/blog/tags`, f = (a) => a.data;
273
273
  return {
274
274
  articles: (a = {}) => {
275
275
  const s = new URLSearchParams();
276
276
  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));
277
277
  const t = s.size > 0 ? `?${s}` : "";
278
- return v.http.get(`${c}${t}`).then((o) => ({ ...o.meta, data: o.data, filters: o.filters }));
278
+ return g.http.get(`${c}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
279
279
  },
280
- get: (a) => v.http.get(`${c}/${a}`).then(g),
281
- create: (a) => v.http.post(c, a).then(g),
282
- save: (a, s) => v.http.put(`${c}/${a}`, s).then(g),
283
- discard: (a) => v.http.post(`${c}/${a}/discard`, {}).then(g),
284
- versions: (a) => v.http.get(`${c}/${a}/versions`).then(g),
285
- restoreVersion: (a, s) => v.http.post(`${c}/${a}/versions/${s}/restore`, {}).then(g),
280
+ get: (a) => g.http.get(`${c}/${a}`).then(f),
281
+ create: (a) => g.http.post(c, a).then(f),
282
+ save: (a, s) => g.http.put(`${c}/${a}`, s).then(f),
283
+ discard: (a) => g.http.post(`${c}/${a}/discard`, {}).then(f),
284
+ versions: (a) => g.http.get(`${c}/${a}/versions`).then(f),
285
+ restoreVersion: (a, s) => g.http.post(`${c}/${a}/versions/${s}/restore`, {}).then(f),
286
286
  tags: (a = "") => {
287
287
  const s = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
288
- return v.http.get(`${p}${s}`).then(g);
288
+ return g.http.get(`${v}${s}`).then(f);
289
289
  },
290
- createTag: (a) => v.http.post(p, a).then(g),
291
- publish: (a, s) => v.http.post(`${c}/${a}/publish`, s == null ? {} : { at: s }).then(g),
292
- unpublish: (a) => v.http.post(`${c}/${a}/unpublish`, {}).then(g),
293
- remove: (a) => v.http.delete(`${c}/${a}`).then(() => {
290
+ createTag: (a) => g.http.post(v, a).then(f),
291
+ publish: (a, s) => g.http.post(`${c}/${a}/publish`, s == null ? {} : { at: s }).then(f),
292
+ unpublish: (a) => g.http.post(`${c}/${a}/unpublish`, {}).then(f),
293
+ remove: (a) => g.http.delete(`${c}/${a}`).then(() => {
294
294
  }),
295
- restore: (a) => v.http.post(`${c}/${a}/restore`, {}).then(g),
295
+ restore: (a) => g.http.post(`${c}/${a}/restore`, {}).then(f),
296
296
  tagsPage: (a = {}) => {
297
297
  const s = new URLSearchParams();
298
298
  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));
299
299
  const t = s.size > 0 ? `?${s}` : "";
300
- return v.http.get(`${p}${t}`).then((o) => ({ ...o.meta, data: o.data, filters: o.filters }));
300
+ return g.http.get(`${v}${t}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
301
301
  },
302
- saveTag: (a, s) => v.http.put(`${p}/${a}`, s).then(g),
303
- removeTag: (a) => v.http.delete(`${p}/${a}`).then(() => {
302
+ saveTag: (a, s) => g.http.put(`${v}/${a}`, s).then(f),
303
+ removeTag: (a) => g.http.delete(`${v}/${a}`).then(() => {
304
304
  }),
305
- massTags: (a, s) => v.http.post(`${p}/mass`, { ids: a, action: s }).then((t) => t.data.affected),
306
- mergeTags: (a, s, t) => v.http.post(`${p}/merge`, { ids: a, keep: s, redirect: t }).then(g)
305
+ massTags: (a, s) => g.http.post(`${v}/mass`, { ids: a, action: s }).then((t) => t.data.affected),
306
+ mergeTags: (a, s, t) => g.http.post(`${v}/merge`, { ids: a, keep: s, redirect: t }).then(f)
307
307
  };
308
308
  }
309
309
  const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__ */ Q({
@@ -311,224 +311,224 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
311
311
  props: {
312
312
  base: { default: "/blog" }
313
313
  },
314
- setup(v) {
315
- const c = v, p = le(), g = oe(p), a = Ge(), s = je(), t = at(), o = ut();
314
+ setup(g) {
315
+ const c = g, v = ne(), f = ue(v), a = Ge(), s = je(), t = at(), u = ut();
316
316
  X();
317
- const l = Z("webx-blog"), b = we(), f = h(() => Number(a.params.id)), T = h(() => `${c.base}/articles`), m = M(null), A = M({}), z = M(""), S = M(""), B = M(null), R = M({ rubrics: [], authors: [] }), y = M([]), W = M(!0), N = M(!1), U = M(!1), $ = M({}), P = M(null), E = M(""), ie = M(0), Y = h(() => p.can("blog.articles.manage")), ne = h(() => !Y.value || U.value), se = h(() => JSON.stringify(A.value)), O = h(() => E.value !== "" && se.value !== E.value), he = h(() => N.value ? "saving" : O.value ? "unsaved" : "saved"), xe = h(() => {
318
- const w = A.value.title;
319
- return wt(w, t.active.value, m.value?.title ?? "");
320
- }), re = h(() => {
321
- const w = A.value.published_at;
322
- return typeof w == "string" && w !== "" ? w : null;
317
+ const i = J("webx-blog"), m = be(), y = h(() => Number(a.params.id)), $ = h(() => `${c.base}/articles`), d = M(null), W = M({}), V = M(""), z = M(""), D = M(null), B = M({ rubrics: [], authors: [] }), w = M([]), T = M(!0), N = M(!1), I = M(!1), b = M({}), P = M(null), E = M(""), Z = M(0), Y = h(() => v.can("blog.articles.manage")), se = h(() => !Y.value || I.value), re = h(() => JSON.stringify(W.value)), O = h(() => E.value !== "" && re.value !== E.value), ye = h(() => N.value ? "saving" : O.value ? "unsaved" : "saved"), we = h(() => {
318
+ const x = W.value.title;
319
+ return wt(x, t.active.value, d.value?.title ?? "");
320
+ }), te = h(() => {
321
+ const x = W.value.published_at;
322
+ return typeof x == "string" && x !== "" ? x : null;
323
323
  }), fe = h(() => {
324
- if (re.value === null) return !1;
325
- const w = new Date(re.value.replace(" ", "T"));
326
- return !Number.isNaN(w.valueOf()) && w.valueOf() > Date.now();
327
- }), We = h(() => {
328
- const w = m.value;
329
- if (!w) return "";
330
- const L = o.short(w.published_at);
324
+ if (te.value === null) return !1;
325
+ const x = new Date(te.value.replace(" ", "T"));
326
+ return !Number.isNaN(x.valueOf()) && x.valueOf() > Date.now();
327
+ }), Se = h(() => {
328
+ const x = d.value;
329
+ if (!x) return "";
330
+ const L = u.short(x.published_at);
331
331
  return {
332
- scheduled: l("article.live-scheduled", { date: L }),
333
- published: l("article.live-since", { date: L }),
334
- modified: l("article.live-since", { date: L })
335
- }[w.status] ?? "";
332
+ scheduled: i("article.live-scheduled", { date: L }),
333
+ published: i("article.live-since", { date: L }),
334
+ modified: i("article.live-since", { date: L })
335
+ }[x.status] ?? "";
336
336
  });
337
- Vt({ url: h(() => B.value), reload: ie }), zt({
338
- article: m,
339
- values: A,
340
- options: R,
341
- related: y,
342
- prefix: S,
337
+ Vt({ url: h(() => D.value), reload: Z }), zt({
338
+ article: d,
339
+ values: W,
340
+ options: B,
341
+ related: w,
342
+ prefix: z,
343
343
  base: c.base,
344
344
  canManage: Y.value,
345
- disabled: ne,
346
- reload: () => ue(!0),
347
- save: () => _()
345
+ disabled: se,
346
+ reload: () => oe(!0),
347
+ save: () => A()
348
348
  });
349
- function _e(w) {
350
- m.value = w.article, A.value = w.values, z.value = w.revision, S.value = w.prefix, B.value = w.preview_url, R.value = w.options, y.value = w.related, E.value = JSON.stringify(w.values), P.value = null;
349
+ function $e(x) {
350
+ d.value = x.article, W.value = x.values, V.value = x.revision, z.value = x.prefix, D.value = x.preview_url, B.value = x.options, w.value = x.related, E.value = JSON.stringify(x.values), P.value = null;
351
351
  }
352
- async function ue(w = !1) {
353
- w || (W.value = !0);
352
+ async function oe(x = !1) {
353
+ x || (T.value = !0);
354
354
  try {
355
- _e(await g.get(f.value));
355
+ $e(await f.get(y.value));
356
356
  } catch (L) {
357
- D.danger(b(L)), s.push(T.value);
357
+ R.danger(m(L)), s.push($.value);
358
358
  } finally {
359
- W.value = !1;
359
+ T.value = !1;
360
360
  }
361
361
  }
362
- let ee;
363
- function ce() {
364
- !Y.value || P.value || !O.value || (clearTimeout(ee), ee = setTimeout(() => {
365
- _();
362
+ let ce;
363
+ function ae() {
364
+ !Y.value || P.value || !O.value || (clearTimeout(ce), ce = setTimeout(() => {
365
+ A();
366
366
  }, qt));
367
367
  }
368
- function u() {
369
- !Y.value || P.value || !O.value || N.value || (clearTimeout(ee), _());
368
+ function We() {
369
+ !Y.value || P.value || !O.value || N.value || (clearTimeout(ce), A());
370
370
  }
371
- let C;
372
- async function _() {
373
- for (; C; ) {
374
- const { carried: j, done: ye } = C;
375
- if (await ye, !O.value || P.value || se.value === j) return;
371
+ let o;
372
+ async function A() {
373
+ for (; o; ) {
374
+ const { carried: j, done: me } = o;
375
+ if (await me, !O.value || P.value || re.value === j) return;
376
376
  }
377
- const w = se.value, L = J();
378
- C = { carried: w, done: L };
377
+ const x = re.value, L = S();
378
+ o = { carried: x, done: L };
379
379
  try {
380
380
  await L;
381
381
  } finally {
382
- C?.done === L && (C = void 0);
382
+ o?.done === L && (o = void 0);
383
383
  }
384
384
  }
385
- async function J() {
386
- if (!m.value || !Y.value) return;
387
- clearTimeout(ee);
388
- const w = se.value, L = A.value;
389
- N.value = !0, $.value = {};
385
+ async function S() {
386
+ if (!d.value || !Y.value) return;
387
+ clearTimeout(ce);
388
+ const x = re.value, L = W.value;
389
+ N.value = !0, b.value = {};
390
390
  try {
391
- const j = await g.save(m.value.id, { values: L, revision: z.value });
392
- m.value = j.article, z.value = j.revision, S.value = j.prefix, B.value = j.preview_url, R.value = j.options, y.value = j.related, P.value = null, se.value === w && (E.value = w), ie.value += 1;
391
+ const j = await f.save(d.value.id, { values: L, revision: V.value });
392
+ d.value = j.article, V.value = j.revision, z.value = j.prefix, D.value = j.preview_url, B.value = j.options, w.value = j.related, P.value = null, re.value === x && (E.value = x), Z.value += 1;
393
393
  } catch (j) {
394
- const ye = j;
395
- ye.status === 409 && ye.body?.data ? P.value = ye.body : ye.body?.errors ? ($.value = ye.body.errors, D.danger(l("article.save-failed"))) : D.danger(b(j));
394
+ const me = j;
395
+ me.status === 409 && me.body?.data ? P.value = me.body : me.body?.errors ? (b.value = me.body.errors, R.danger(i("article.save-failed"))) : R.danger(m(j));
396
396
  } finally {
397
397
  N.value = !1;
398
398
  }
399
399
  }
400
- async function me() {
400
+ async function ee() {
401
401
  await de({
402
- title: l("article.conflict-theirs-title"),
403
- message: l("article.conflict-theirs-text"),
404
- confirmText: l("article.conflict-theirs"),
405
- cancelText: l("panel.cancel"),
402
+ title: i("article.conflict-theirs-title"),
403
+ message: i("article.conflict-theirs-text"),
404
+ confirmText: i("article.conflict-theirs"),
405
+ cancelText: i("panel.cancel"),
406
406
  tone: "danger"
407
- }) && await ue(!0);
407
+ }) && await oe(!0);
408
408
  }
409
409
  async function n() {
410
- const w = P.value;
411
- w && (z.value = w.data.revision, P.value = null, await _());
410
+ const x = P.value;
411
+ x && (V.value = x.data.revision, P.value = null, await A());
412
412
  }
413
- async function q() {
414
- if (!(!m.value || !await de({
415
- title: l("article.discard-title"),
416
- message: l("article.discard-text"),
417
- confirmText: l("article.discard"),
418
- cancelText: l("panel.cancel"),
413
+ async function U() {
414
+ if (!(!d.value || !await de({
415
+ title: i("article.discard-title"),
416
+ message: i("article.discard-text"),
417
+ confirmText: i("article.discard"),
418
+ cancelText: i("panel.cancel"),
419
419
  tone: "danger"
420
420
  }))) {
421
- U.value = !0;
421
+ I.value = !0;
422
422
  try {
423
- _e(await g.discard(m.value.id)), D.success(l("article.discarded"));
423
+ $e(await f.discard(d.value.id)), R.success(i("article.discarded"));
424
424
  } catch (L) {
425
- D.danger(b(L));
425
+ R.danger(m(L));
426
426
  } finally {
427
- U.value = !1;
427
+ I.value = !1;
428
428
  }
429
429
  }
430
430
  }
431
- async function d() {
432
- const w = m.value;
433
- if (!w) return;
434
- const L = w.path === null ? null : `/${w.path}`, j = re.value === null ? l("article.publish-now") : o.short(re.value);
431
+ async function p() {
432
+ const x = d.value;
433
+ if (!x) return;
434
+ const L = x.path === null ? null : `/${x.path}`, j = te.value === null ? i("article.publish-now") : u.short(te.value);
435
435
  if (await de({
436
- title: l("article.publish-title", { title: w.title }),
437
- message: fe.value ? l("article.publish-later", { date: j }) : L === null ? l("article.publish-nowhere") : l("article.publish-text", { address: L }),
438
- confirmText: fe.value ? l("article.schedule") : l("panel.publish"),
439
- cancelText: l("panel.cancel")
440
- }) && (O.value && await _(), !P.value)) {
441
- U.value = !0;
436
+ title: i("article.publish-title", { title: x.title }),
437
+ message: fe.value ? i("article.publish-later", { date: j }) : L === null ? i("article.publish-nowhere") : i("article.publish-text", { address: L }),
438
+ confirmText: fe.value ? i("article.schedule") : i("panel.publish"),
439
+ cancelText: i("panel.cancel")
440
+ }) && (O.value && await A(), !P.value)) {
441
+ I.value = !0;
442
442
  try {
443
- await g.publish(w.id, re.value), await ue(!0), D.success(fe.value ? l("article.scheduled") : l("panel.published"));
443
+ await f.publish(x.id, te.value), await oe(!0), R.success(fe.value ? i("article.scheduled") : i("panel.published"));
444
444
  } catch (ot) {
445
- D.danger(b(ot));
445
+ R.danger(m(ot));
446
446
  } finally {
447
- U.value = !1;
447
+ I.value = !1;
448
448
  }
449
449
  }
450
450
  }
451
- function ke() {
452
- const w = m.value?.status;
453
- return w === "published" ? "success" : w === "modified" ? "warning" : w === "scheduled" ? "primary" : "default";
451
+ function xe() {
452
+ const x = d.value?.status;
453
+ return x === "published" ? "success" : x === "modified" ? "warning" : x === "scheduled" ? "primary" : "default";
454
454
  }
455
- function be(w) {
456
- O.value && w.preventDefault();
455
+ function he(x) {
456
+ O.value && x.preventDefault();
457
457
  }
458
- ve(se, ce), ve(f, () => {
459
- ue();
458
+ ve(re, ae), ve(y, () => {
459
+ oe();
460
460
  }), Ne(() => {
461
- ue(), window.addEventListener("beforeunload", be);
461
+ oe(), window.addEventListener("beforeunload", he);
462
462
  }), Ke(() => {
463
- clearTimeout(ee), window.removeEventListener("beforeunload", be);
464
- }), Ct(async () => !O.value || !Y.value || (await _(), !O.value) ? !0 : await de({
465
- title: l("article.leave-title"),
466
- message: l("article.leave-text"),
467
- confirmText: l("article.leave"),
468
- cancelText: l("panel.cancel"),
463
+ clearTimeout(ce), window.removeEventListener("beforeunload", he);
464
+ }), Ct(async () => !O.value || !Y.value || (await A(), !O.value) ? !0 : await de({
465
+ title: i("article.leave-title"),
466
+ message: i("article.leave-text"),
467
+ confirmText: i("article.leave"),
468
+ cancelText: i("panel.cancel"),
469
469
  tone: "danger"
470
470
  }));
471
471
  const rt = h(() => {
472
- const w = [];
473
- return B.value && w.push({ key: "preview", label: l("article.preview"), icon: "eye", href: B.value }), m.value?.url && m.value.status !== "draft" && w.push({
472
+ const x = [];
473
+ return D.value && x.push({ key: "preview", label: i("article.preview"), icon: "eye", href: D.value }), d.value?.url && d.value.status !== "draft" && x.push({
474
474
  key: "site",
475
- label: l("panel.open-on-site"),
475
+ label: i("panel.open-on-site"),
476
476
  icon: "link",
477
- href: m.value.url
478
- }), m.value?.status === "modified" && w.push({
477
+ href: d.value.url
478
+ }), d.value?.status === "modified" && x.push({
479
479
  key: "discard",
480
- label: l("article.discard"),
480
+ label: i("article.discard"),
481
481
  icon: "refresh",
482
482
  danger: !0,
483
483
  menu: !0,
484
484
  run: () => {
485
- q();
485
+ U();
486
486
  }
487
- }), w;
487
+ }), x;
488
488
  });
489
- return (w, L) => (x(), H("div", {
489
+ return (x, L) => (_(), H("div", {
490
490
  class: "wx-article-editor",
491
- onFocusout: u
491
+ onFocusout: We
492
492
  }, [
493
- W.value || !m.value ? (x(), H(Te, { key: 0 }, [
493
+ T.value || !d.value ? (_(), H(ke, { key: 0 }, [
494
494
  r(e(Oe), {
495
495
  class: "wx-article-editor__ghost",
496
496
  title: "",
497
497
  rows: 1
498
498
  }),
499
499
  r(e(xt), null, {
500
- default: i(() => [
500
+ default: l(() => [
501
501
  r(e(Oe), { rows: 8 })
502
502
  ]),
503
503
  _: 1
504
504
  })
505
- ], 64)) : (x(), H(Te, { key: 1 }, [
505
+ ], 64)) : (_(), H(ke, { key: 1 }, [
506
506
  r(e(ct), {
507
507
  divider: "",
508
- back: T.value,
509
- "back-label": e(l)("module.articles"),
510
- title: xe.value || e(l)("article.untitled"),
511
- subtitle: We.value,
508
+ back: $.value,
509
+ "back-label": e(i)("module.articles"),
510
+ title: we.value || e(i)("article.untitled"),
511
+ subtitle: Se.value,
512
512
  actions: rt.value
513
513
  }, {
514
- trail: i(() => [
514
+ trail: l(() => [
515
515
  r(e(_t), {
516
516
  size: "sm",
517
- label: e(l)("article.trail")
517
+ label: e(i)("article.trail")
518
518
  }, {
519
- default: i(() => [
519
+ default: l(() => [
520
520
  r(e(Ze), {
521
521
  as: "router-link",
522
- to: T.value
522
+ to: $.value
523
523
  }, {
524
- default: i(() => [
525
- V(k(e(l)("module.articles")), 1)
524
+ default: l(() => [
525
+ C(k(e(i)("module.articles")), 1)
526
526
  ]),
527
527
  _: 1
528
528
  }, 8, ["to"]),
529
529
  r(e(Ze), { current: "" }, {
530
- default: i(() => [
531
- V(k(xe.value || e(l)("article.untitled")), 1)
530
+ default: l(() => [
531
+ C(k(we.value || e(i)("article.untitled")), 1)
532
532
  ]),
533
533
  _: 1
534
534
  })
@@ -536,43 +536,43 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
536
536
  _: 1
537
537
  }, 8, ["label"])
538
538
  ]),
539
- "title-after": i(() => [
540
- r(e(ae), {
541
- type: ke(),
539
+ "title-after": l(() => [
540
+ r(e(ie), {
541
+ type: xe(),
542
542
  dot: ""
543
543
  }, {
544
- default: i(() => [
545
- V(k(e(l)(`panel.status-${m.value.status}`)), 1)
544
+ default: l(() => [
545
+ C(k(e(i)(`panel.status-${d.value.status}`)), 1)
546
546
  ]),
547
547
  _: 1
548
548
  }, 8, ["type"]),
549
- m.value.status === "modified" ? (x(), I(e(ae), {
549
+ d.value.status === "modified" ? (_(), q(e(ie), {
550
550
  key: 0,
551
551
  type: "primary",
552
552
  round: ""
553
553
  }, {
554
- default: i(() => [
555
- V(k(e(l)("panel.edits")), 1)
554
+ default: l(() => [
555
+ C(k(e(i)("panel.edits")), 1)
556
556
  ]),
557
557
  _: 1
558
558
  })) : K("", !0)
559
559
  ]),
560
560
  _: 1
561
561
  }, 8, ["back", "back-label", "title", "subtitle", "actions"]),
562
- P.value ? (x(), I(e(Ue), {
562
+ P.value ? (_(), q(e(Ue), {
563
563
  key: 0,
564
564
  type: "warning",
565
- title: e(l)("article.conflict-title"),
565
+ title: e(i)("article.conflict-title"),
566
566
  description: P.value.message
567
567
  }, {
568
- actions: i(() => [
568
+ actions: l(() => [
569
569
  r(e(G), {
570
570
  size: "sm",
571
571
  variant: "outline",
572
- onClick: me
572
+ onClick: ee
573
573
  }, {
574
- default: i(() => [
575
- V(k(e(l)("article.conflict-theirs")), 1)
574
+ default: l(() => [
575
+ C(k(e(i)("article.conflict-theirs")), 1)
576
576
  ]),
577
577
  _: 1
578
578
  }),
@@ -581,8 +581,8 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
581
581
  type: "primary",
582
582
  onClick: n
583
583
  }, {
584
- default: i(() => [
585
- V(k(e(l)("article.conflict-mine")), 1)
584
+ default: l(() => [
585
+ C(k(e(i)("article.conflict-mine")), 1)
586
586
  ]),
587
587
  _: 1
588
588
  })
@@ -591,37 +591,37 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
591
591
  }, 8, ["title", "description"])) : K("", !0),
592
592
  F("div", Nt, [
593
593
  r(e(dt), {
594
- modelValue: A.value,
595
- "onUpdate:modelValue": L[0] || (L[0] = (j) => A.value = j),
594
+ modelValue: W.value,
595
+ "onUpdate:modelValue": L[0] || (L[0] = (j) => W.value = j),
596
596
  name: "blog.article-form",
597
- errors: $.value,
598
- disabled: ne.value
597
+ errors: b.value,
598
+ disabled: se.value
599
599
  }, null, 8, ["modelValue", "errors", "disabled"])
600
600
  ]),
601
- Y.value ? (x(), I(e(lt), { key: 1 }, {
602
- state: i(() => [
603
- r(e(pt), { state: he.value }, null, 8, ["state"])
601
+ Y.value ? (_(), q(e(lt), { key: 1 }, {
602
+ state: l(() => [
603
+ r(e(pt), { state: ye.value }, null, 8, ["state"])
604
604
  ]),
605
- default: i(() => [
605
+ default: l(() => [
606
606
  r(e(G), {
607
607
  variant: "outline",
608
608
  loading: N.value,
609
609
  disabled: !O.value,
610
- onClick: _
610
+ onClick: A
611
611
  }, {
612
- default: i(() => [
613
- V(k(e(l)("article.save")), 1)
612
+ default: l(() => [
613
+ C(k(e(i)("article.save")), 1)
614
614
  ]),
615
615
  _: 1
616
616
  }, 8, ["loading", "disabled"]),
617
617
  r(e(G), {
618
618
  type: "primary",
619
- loading: U.value,
620
- disabled: m.value.status === "published" && !O.value,
621
- onClick: d
619
+ loading: I.value,
620
+ disabled: d.value.status === "published" && !O.value,
621
+ onClick: p
622
622
  }, {
623
- default: i(() => [
624
- V(k(fe.value ? e(l)("article.schedule") : e(l)("panel.publish")), 1)
623
+ default: l(() => [
624
+ C(k(fe.value ? e(i)("article.schedule") : e(i)("panel.publish")), 1)
625
625
  ]),
626
626
  _: 1
627
627
  }, 8, ["loading", "disabled"])
@@ -631,105 +631,105 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
631
631
  ], 64))
632
632
  ], 32));
633
633
  }
634
- }), ge = (v, c) => {
635
- const p = v.__vccOpts || v;
636
- for (const [g, a] of c)
637
- p[g] = a;
638
- return p;
634
+ }), ge = (g, c) => {
635
+ const v = g.__vccOpts || g;
636
+ for (const [f, a] of c)
637
+ v[f] = a;
638
+ return v;
639
639
  }, Pt = /* @__PURE__ */ ge(It, [["__scopeId", "data-v-c8b3304e"]]), Rt = { class: "wx-article-history" }, Dt = { class: "wx-article-history__number" }, Bt = { class: "wx-article-history__who" }, Et = /* @__PURE__ */ Q({
640
640
  name: "WxArticleHistory",
641
641
  __name: "ArticleHistory",
642
- setup(v) {
643
- const c = le(), p = oe(c), g = Se();
642
+ setup(g) {
643
+ const c = ne(), v = ue(c), f = Ae();
644
644
  X();
645
- const a = Z("webx-blog"), s = we(), t = M(null), o = M(!1), l = h(() => g?.article.value ?? null), b = h(() => c.can("blog.articles.manage")), f = h(
646
- () => l.value?.status === "published" || l.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
645
+ const a = J("webx-blog"), s = be(), t = M(null), u = M(!1), i = h(() => f?.article.value ?? null), m = h(() => c.can("blog.articles.manage")), y = h(
646
+ () => i.value?.status === "published" || i.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
647
647
  );
648
- async function T() {
649
- const A = l.value;
650
- if (A)
648
+ async function $() {
649
+ const W = i.value;
650
+ if (W)
651
651
  try {
652
- t.value = await p.versions(A.id);
653
- } catch (z) {
654
- t.value = [], D.danger(s(z));
652
+ t.value = await v.versions(W.id);
653
+ } catch (V) {
654
+ t.value = [], R.danger(s(V));
655
655
  }
656
656
  }
657
- async function m(A) {
658
- const z = l.value;
659
- if (!(!z || !await de({
660
- title: a("article.restore-title", { number: A.number }),
657
+ async function d(W) {
658
+ const V = i.value;
659
+ if (!(!V || !await de({
660
+ title: a("article.restore-title", { number: W.number }),
661
661
  message: a("article.restore-text"),
662
662
  confirmText: a("article.restore-version"),
663
663
  cancelText: a("panel.cancel")
664
664
  }))) {
665
- o.value = !0;
665
+ u.value = !0;
666
666
  try {
667
- await p.restoreVersion(z.id, A.number), await g?.reload(), D.success(a("article.restored-version", { number: A.number }));
668
- } catch (B) {
669
- D.danger(s(B));
667
+ await v.restoreVersion(V.id, W.number), await f?.reload(), R.success(a("article.restored-version", { number: W.number }));
668
+ } catch (D) {
669
+ R.danger(s(D));
670
670
  } finally {
671
- o.value = !1;
671
+ u.value = !1;
672
672
  }
673
673
  }
674
674
  }
675
675
  return ve(
676
- () => [l.value?.id, l.value?.published_at, l.value?.updated_at],
676
+ () => [i.value?.id, i.value?.published_at, i.value?.updated_at],
677
677
  () => {
678
- T();
678
+ $();
679
679
  },
680
680
  { immediate: !0 }
681
- ), (A, z) => (x(), H("div", Rt, [
682
- t.value === null ? (x(), I(e(Oe), {
681
+ ), (W, V) => (_(), H("div", Rt, [
682
+ t.value === null ? (_(), q(e(Oe), {
683
683
  key: 0,
684
684
  class: "wx-article-history__ghost",
685
685
  rows: 3
686
- })) : t.value.length === 0 ? (x(), I(e(kt), {
686
+ })) : t.value.length === 0 ? (_(), q(e(kt), {
687
687
  key: 1,
688
688
  description: e(a)("article.history-empty")
689
- }, null, 8, ["description"])) : (x(!0), H(Te, { key: 2 }, qe(t.value, (S) => (x(), H("div", {
690
- key: S.number,
691
- class: tt(["wx-article-history__row", { "is-live": S.number === f.value }])
689
+ }, null, 8, ["description"])) : (_(!0), H(ke, { key: 2 }, qe(t.value, (z) => (_(), H("div", {
690
+ key: z.number,
691
+ class: tt(["wx-article-history__row", { "is-live": z.number === y.value }])
692
692
  }, [
693
- F("code", Dt, k(e(a)("article.version", { number: S.number })), 1),
693
+ F("code", Dt, k(e(a)("article.version", { number: z.number })), 1),
694
694
  F("div", Bt, [
695
- S.created_at ? (x(), I(e(Ee), {
695
+ z.created_at ? (_(), q(e(Ee), {
696
696
  key: 0,
697
- value: S.created_at,
697
+ value: z.created_at,
698
698
  size: "md",
699
699
  tone: "default"
700
700
  }, null, 8, ["value"])) : K("", !0),
701
- r(e(te), {
701
+ r(e(le), {
702
702
  size: "sm",
703
703
  tone: "muted"
704
704
  }, {
705
- default: i(() => [
706
- V(k(S.author ?? e(a)(`article.source-${S.source}`)) + " ", 1),
707
- S.comment ? (x(), H(Te, { key: 0 }, [
708
- V(" · " + k(S.comment), 1)
705
+ default: l(() => [
706
+ C(k(z.author ?? e(a)(`article.source-${z.source}`)) + " ", 1),
707
+ z.comment ? (_(), H(ke, { key: 0 }, [
708
+ C(" · " + k(z.comment), 1)
709
709
  ], 64)) : K("", !0)
710
710
  ]),
711
711
  _: 2
712
712
  }, 1024)
713
713
  ]),
714
- S.number === f.value ? (x(), I(e(ae), {
714
+ z.number === y.value ? (_(), q(e(ie), {
715
715
  key: 0,
716
716
  type: "success",
717
717
  dot: ""
718
718
  }, {
719
- default: i(() => [
720
- V(k(e(a)("article.version-live")), 1)
719
+ default: l(() => [
720
+ C(k(e(a)("article.version-live")), 1)
721
721
  ]),
722
722
  _: 1
723
723
  })) : K("", !0),
724
- b.value && S.number !== f.value ? (x(), I(e(G), {
724
+ m.value && z.number !== y.value ? (_(), q(e(G), {
725
725
  key: 1,
726
726
  size: "sm",
727
727
  variant: "outline",
728
- loading: o.value,
729
- onClick: (B) => m(S)
728
+ loading: u.value,
729
+ onClick: (D) => d(z)
730
730
  }, {
731
- default: i(() => [
732
- V(k(e(a)("article.restore-version")), 1)
731
+ default: l(() => [
732
+ C(k(e(a)("article.restore-version")), 1)
733
733
  ]),
734
734
  _: 1
735
735
  }, 8, ["loading", "onClick"])) : K("", !0)
@@ -746,94 +746,94 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
746
746
  modelModifiers: {}
747
747
  }),
748
748
  emits: ["update:modelValue"],
749
- setup(v) {
750
- const c = v, p = Le(v, "modelValue"), g = le(), a = oe(g), s = Se();
749
+ setup(g) {
750
+ const c = g, v = Le(g, "modelValue"), f = ne(), a = ue(f), s = Ae();
751
751
  X();
752
- const t = Z("webx-blog"), o = we(), l = h(() => c.disabled || s?.disabled.value === !0), b = M(/* @__PURE__ */ new Map()), f = M([]);
753
- let T;
752
+ const t = J("webx-blog"), u = be(), i = h(() => c.disabled || s?.disabled.value === !0), m = M(/* @__PURE__ */ new Map()), y = M([]);
753
+ let $;
754
754
  ve(
755
755
  () => s?.related.value,
756
- (y) => {
757
- const W = new Map(b.value);
758
- for (const N of y ?? []) W.set(N.id, N.title);
759
- b.value = W;
756
+ (w) => {
757
+ const T = new Map(m.value);
758
+ for (const N of w ?? []) T.set(N.id, N.title);
759
+ m.value = T;
760
760
  },
761
761
  { immediate: !0, deep: !0 }
762
762
  );
763
- const m = h({
764
- get: () => p.value.map((y) => ({ id: y, title: b.value.get(y) ?? `#${y}` })),
765
- set: (y) => {
766
- p.value = y.map((W) => W.id);
763
+ const d = h({
764
+ get: () => v.value.map((w) => ({ id: w, title: m.value.get(w) ?? `#${w}` })),
765
+ set: (w) => {
766
+ v.value = w.map((T) => T.id);
767
767
  }
768
- }), A = h(
769
- () => f.value.filter((y) => !p.value.includes(y.id)).map((y) => ({ label: y.title, value: y.id }))
768
+ }), W = h(
769
+ () => y.value.filter((w) => !v.value.includes(w.id)).map((w) => ({ label: w.title, value: w.id }))
770
770
  );
771
- async function z(y) {
772
- const W = s?.article.value?.id;
771
+ async function V(w) {
772
+ const T = s?.article.value?.id;
773
773
  try {
774
- const N = await a.articles({ q: y, per_page: Ht });
775
- f.value = N.data.filter(($) => $.id !== W).map(($) => ({ id: $.id, title: $.title }));
776
- const U = new Map(b.value);
777
- for (const $ of f.value) U.set($.id, $.title);
778
- b.value = U;
774
+ const N = await a.articles({ q: w, per_page: Ht });
775
+ y.value = N.data.filter((b) => b.id !== T).map((b) => ({ id: b.id, title: b.title }));
776
+ const I = new Map(m.value);
777
+ for (const b of y.value) I.set(b.id, b.title);
778
+ m.value = I;
779
779
  } catch (N) {
780
- D.danger(o(N));
780
+ R.danger(u(N));
781
781
  }
782
782
  }
783
- function S(y) {
784
- clearTimeout(T), T = setTimeout(() => {
785
- z(y);
783
+ function z(w) {
784
+ clearTimeout($), $ = setTimeout(() => {
785
+ V(w);
786
786
  }, Kt);
787
787
  }
788
- function B(y) {
789
- typeof y != "number" || p.value.includes(y) || (p.value = [...p.value, y]);
788
+ function D(w) {
789
+ typeof w != "number" || v.value.includes(w) || (v.value = [...v.value, w]);
790
790
  }
791
- function R(y) {
792
- p.value = p.value.filter((W) => W !== y);
791
+ function B(w) {
792
+ v.value = v.value.filter((T) => T !== w);
793
793
  }
794
794
  return ve(
795
795
  () => s?.article.value?.id,
796
796
  () => {
797
- z("");
797
+ V("");
798
798
  },
799
799
  { immediate: !0 }
800
- ), Ke(() => clearTimeout(T)), (y, W) => (x(), H("div", Lt, [
800
+ ), Ke(() => clearTimeout($)), (w, T) => (_(), H("div", Lt, [
801
801
  r(e($t), {
802
- modelValue: m.value,
803
- "onUpdate:modelValue": W[0] || (W[0] = (N) => m.value = N),
802
+ modelValue: d.value,
803
+ "onUpdate:modelValue": T[0] || (T[0] = (N) => d.value = N),
804
804
  plain: "",
805
805
  size: "sm",
806
806
  "item-key": "id",
807
807
  "item-label": "title",
808
- disabled: l.value,
808
+ disabled: i.value,
809
809
  "empty-text": e(t)("article.related-empty"),
810
810
  "aria-label": e(t)("article.related")
811
811
  }, {
812
- default: i(({ item: N }) => [
812
+ default: l(({ item: N }) => [
813
813
  F("span", Ft, k(N.title), 1)
814
814
  ]),
815
- actions: i(({ item: N }) => [
815
+ actions: l(({ item: N }) => [
816
816
  r(e(Tt), {
817
817
  type: "remove",
818
818
  size: "sm",
819
- disabled: l.value,
819
+ disabled: i.value,
820
820
  title: e(t)("article.related-remove"),
821
- onClick: (U) => R(N.id)
821
+ onClick: (I) => B(N.id)
822
822
  }, null, 8, ["disabled", "title", "onClick"])
823
823
  ]),
824
824
  _: 1
825
825
  }, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
826
- r(e($e), {
826
+ r(e(_e), {
827
827
  "model-value": null,
828
- options: A.value,
828
+ options: W.value,
829
829
  placeholder: e(t)("article.related-add"),
830
830
  "empty-text": e(t)("article.related-nothing"),
831
- disabled: l.value,
831
+ disabled: i.value,
832
832
  filterable: "",
833
833
  teleport: "",
834
834
  "aria-label": e(t)("article.related-add"),
835
- onSearch: S,
836
- "onUpdate:modelValue": B
835
+ onSearch: z,
836
+ "onUpdate:modelValue": D
837
837
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
838
838
  ]));
839
839
  }
@@ -841,31 +841,31 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
841
841
  name: "WxArticleSlug",
842
842
  inheritAttrs: !1,
843
843
  __name: "ArticleSlug",
844
- setup(v) {
845
- const c = Se(), p = at();
844
+ setup(g) {
845
+ const c = Ae(), v = at();
846
846
  X();
847
- const g = Z("webx-blog"), a = h(() => {
848
- const o = c?.prefix.value ?? "";
849
- return o === "" ? "/" : `/${o}/`;
847
+ const f = J("webx-blog"), a = h(() => {
848
+ const u = c?.prefix.value ?? "";
849
+ return u === "" ? "/" : `/${u}/`;
850
850
  }), s = h(() => {
851
- const o = c?.values.value.slug;
852
- return typeof o == "string" ? o : o?.[p.active.value] ?? "";
851
+ const u = c?.values.value.slug;
852
+ return typeof u == "string" ? u : u?.[v.active.value] ?? "";
853
853
  }), t = h(() => {
854
- const o = c?.article.value?.path;
855
- return typeof o == "string" && s.value !== "" && `${a.value}${s.value}` != `/${o}`;
854
+ const u = c?.article.value?.path;
855
+ return typeof u == "string" && s.value !== "" && `${a.value}${s.value}` != `/${u}`;
856
856
  });
857
- return (o, l) => (x(), H("div", Jt, [
858
- r(e(Ce), mt(bt(o.$attrs)), {
859
- prefix: i(() => [
857
+ return (u, i) => (_(), H("div", Jt, [
858
+ r(e(Ce), mt(bt(u.$attrs)), {
859
+ prefix: l(() => [
860
860
  F("span", Zt, k(a.value), 1)
861
861
  ]),
862
862
  _: 1
863
863
  }, 16),
864
- t.value ? (x(), I(e(Ue), {
864
+ t.value ? (_(), q(e(Ue), {
865
865
  key: 0,
866
866
  type: "info",
867
867
  variant: "soft",
868
- description: e(g)("article.address-moving")
868
+ description: e(f)("article.address-moving")
869
869
  }, null, 8, ["description"])) : K("", !0)
870
870
  ]));
871
871
  }
@@ -882,123 +882,123 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
882
882
  modelModifiers: {}
883
883
  }),
884
884
  emits: ["update:modelValue"],
885
- setup(v) {
886
- const c = v, p = Le(v, "modelValue"), g = le(), a = oe(g), s = Se();
885
+ setup(g) {
886
+ const c = g, v = Le(g, "modelValue"), f = ne(), a = ue(f), s = Ae();
887
887
  X();
888
- const t = Z("webx-blog"), o = we(), l = h(() => c.disabled || s?.disabled.value === !0), b = M(/* @__PURE__ */ new Map()), f = M([]), T = M(""), m = M(!1);
889
- let A;
888
+ const t = J("webx-blog"), u = be(), i = h(() => c.disabled || s?.disabled.value === !0), m = M(/* @__PURE__ */ new Map()), y = M([]), $ = M(""), d = M(!1);
889
+ let W;
890
890
  ve(
891
891
  () => s?.article.value?.tags,
892
- ($) => {
893
- const P = new Map(b.value);
894
- for (const E of $ ?? []) P.set(E.id, E.title);
895
- b.value = P;
892
+ (b) => {
893
+ const P = new Map(m.value);
894
+ for (const E of b ?? []) P.set(E.id, E.title);
895
+ m.value = P;
896
896
  },
897
897
  { immediate: !0, deep: !0 }
898
898
  );
899
- const z = h(
900
- () => p.value.map(($) => ({ id: $, title: b.value.get($) ?? `#${$}` }))
901
- ), S = h(
902
- () => f.value.filter(($) => !p.value.includes($.id)).map(($) => ({
899
+ const V = h(
900
+ () => v.value.map((b) => ({ id: b, title: m.value.get(b) ?? `#${b}` }))
901
+ ), z = h(
902
+ () => y.value.filter((b) => !v.value.includes(b.id)).map((b) => ({
903
903
  // The count is part of the label rather than a column: a select draws a line of text, and
904
904
  // the number is what the reader is choosing between two near-identical words on.
905
- label: t("article.tag-option", { title: $.title, count: $.articles_count }),
906
- value: $.id
905
+ label: t("article.tag-option", { title: b.title, count: b.articles_count }),
906
+ value: b.id
907
907
  }))
908
- ), B = h(() => {
909
- const $ = T.value.trim();
910
- if ($ === "") return null;
911
- const P = (E) => E.toLowerCase() === $.toLowerCase();
912
- return f.value.some((E) => P(E.title)) ? null : $;
908
+ ), D = h(() => {
909
+ const b = $.value.trim();
910
+ if (b === "") return null;
911
+ const P = (E) => E.toLowerCase() === b.toLowerCase();
912
+ return y.value.some((E) => P(E.title)) ? null : b;
913
913
  });
914
- async function R() {
914
+ async function B() {
915
915
  try {
916
- f.value = await a.tags(T.value);
917
- const $ = new Map(b.value);
918
- for (const P of f.value) $.set(P.id, P.title);
919
- b.value = $;
920
- } catch ($) {
921
- D.danger(o($));
916
+ y.value = await a.tags($.value);
917
+ const b = new Map(m.value);
918
+ for (const P of y.value) b.set(P.id, P.title);
919
+ m.value = b;
920
+ } catch (b) {
921
+ R.danger(u(b));
922
922
  }
923
923
  }
924
- function y($) {
925
- T.value = $, clearTimeout(A), A = setTimeout(() => {
926
- R();
924
+ function w(b) {
925
+ $.value = b, clearTimeout(W), W = setTimeout(() => {
926
+ B();
927
927
  }, aa);
928
928
  }
929
- function W($) {
930
- typeof $ != "number" || p.value.includes($) || (p.value = [...p.value, $], T.value = "");
929
+ function T(b) {
930
+ typeof b != "number" || v.value.includes(b) || (v.value = [...v.value, b], $.value = "");
931
931
  }
932
- function N($) {
933
- p.value = p.value.filter((P) => P !== $);
932
+ function N(b) {
933
+ v.value = v.value.filter((P) => P !== b);
934
934
  }
935
- async function U() {
936
- const $ = B.value;
937
- if (!($ === null || m.value)) {
938
- m.value = !0;
935
+ async function I() {
936
+ const b = D.value;
937
+ if (!(b === null || d.value)) {
938
+ d.value = !0;
939
939
  try {
940
- const P = await a.createTag({ title: $ });
941
- b.value = new Map(b.value).set(P.id, P.title), f.value = [P, ...f.value], W(P.id);
940
+ const P = await a.createTag({ title: b });
941
+ m.value = new Map(m.value).set(P.id, P.title), y.value = [P, ...y.value], T(P.id);
942
942
  } catch (P) {
943
- D.danger(o(P));
943
+ R.danger(u(P));
944
944
  } finally {
945
- m.value = !1;
945
+ d.value = !1;
946
946
  }
947
947
  }
948
948
  }
949
949
  return ve(
950
950
  () => s?.article.value?.id,
951
951
  () => {
952
- R();
952
+ B();
953
953
  },
954
954
  { immediate: !0 }
955
- ), Ke(() => clearTimeout(A)), ($, P) => (x(), H("div", Yt, [
956
- z.value.length > 0 ? (x(), H("div", ea, [
957
- (x(!0), H(Te, null, qe(z.value, (E) => (x(), I(e(ae), {
955
+ ), Ke(() => clearTimeout(W)), (b, P) => (_(), H("div", Yt, [
956
+ V.value.length > 0 ? (_(), H("div", ea, [
957
+ (_(!0), H(ke, null, qe(V.value, (E) => (_(), q(e(ie), {
958
958
  key: E.id,
959
959
  type: "default",
960
- closable: !l.value,
960
+ closable: !i.value,
961
961
  "close-label": e(t)("article.tag-remove"),
962
- onClose: (ie) => N(E.id)
962
+ onClose: (Z) => N(E.id)
963
963
  }, {
964
- default: i(() => [
965
- V(k(E.title), 1)
964
+ default: l(() => [
965
+ C(k(E.title), 1)
966
966
  ]),
967
967
  _: 2
968
968
  }, 1032, ["closable", "close-label", "onClose"]))), 128))
969
- ])) : (x(), I(e(te), {
969
+ ])) : (_(), q(e(le), {
970
970
  key: 1,
971
971
  size: "sm",
972
972
  tone: "muted"
973
973
  }, {
974
- default: i(() => [
975
- V(k(e(t)("article.tags-empty")), 1)
974
+ default: l(() => [
975
+ C(k(e(t)("article.tags-empty")), 1)
976
976
  ]),
977
977
  _: 1
978
978
  })),
979
979
  F("div", ta, [
980
- r(e($e), {
980
+ r(e(_e), {
981
981
  "model-value": null,
982
- options: S.value,
982
+ options: z.value,
983
983
  placeholder: e(t)("article.tag-add"),
984
984
  "empty-text": e(t)("article.tag-nothing"),
985
- disabled: l.value,
985
+ disabled: i.value,
986
986
  filterable: "",
987
987
  teleport: "",
988
988
  "aria-label": e(t)("article.tag-add"),
989
- onSearch: y,
990
- "onUpdate:modelValue": W
989
+ onSearch: w,
990
+ "onUpdate:modelValue": T
991
991
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
992
- B.value ? (x(), I(e(G), {
992
+ D.value ? (_(), q(e(G), {
993
993
  key: 0,
994
994
  variant: "outline",
995
995
  icon: "plus",
996
- loading: m.value,
997
- disabled: l.value,
998
- onClick: U
996
+ loading: d.value,
997
+ disabled: i.value,
998
+ onClick: I
999
999
  }, {
1000
- default: i(() => [
1001
- V(k(e(t)("article.tag-create", { title: B.value })), 1)
1000
+ default: l(() => [
1001
+ C(k(e(t)("article.tag-create", { title: D.value })), 1)
1002
1002
  ]),
1003
1003
  _: 1
1004
1004
  }, 8, ["loading", "disabled"])) : K("", !0)
@@ -1008,48 +1008,48 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1008
1008
  }), ia = /* @__PURE__ */ ge(la, [["__scopeId", "data-v-faf5adec"]]), na = /* @__PURE__ */ Q({
1009
1009
  name: "WxArticleUnpublish",
1010
1010
  __name: "ArticleUnpublish",
1011
- setup(v) {
1012
- const c = le(), p = oe(c), g = Se();
1011
+ setup(g) {
1012
+ const c = ne(), v = ue(c), f = Ae();
1013
1013
  X();
1014
- const a = Z("webx-blog"), s = we(), t = M(!1), o = h(() => {
1015
- const f = g?.article.value?.status;
1016
- return f === "published" || f === "modified" || f === "scheduled";
1017
- }), l = h(() => g?.disabled.value === !0 || t.value);
1018
- async function b() {
1019
- const f = g?.article.value;
1020
- if (!(!f || !await de({
1021
- title: a("article.unpublish-title", { title: f.title }),
1022
- message: f.status === "scheduled" ? a("article.unpublish-waiting") : a("article.unpublish-text"),
1014
+ const a = J("webx-blog"), s = be(), t = M(!1), u = h(() => {
1015
+ const y = f?.article.value?.status;
1016
+ return y === "published" || y === "modified" || y === "scheduled";
1017
+ }), i = h(() => f?.disabled.value === !0 || t.value);
1018
+ async function m() {
1019
+ const y = f?.article.value;
1020
+ if (!(!y || !await de({
1021
+ title: a("article.unpublish-title", { title: y.title }),
1022
+ message: y.status === "scheduled" ? a("article.unpublish-waiting") : a("article.unpublish-text"),
1023
1023
  confirmText: a("panel.unpublish"),
1024
1024
  cancelText: a("panel.cancel"),
1025
1025
  tone: "danger"
1026
1026
  }))) {
1027
1027
  t.value = !0;
1028
1028
  try {
1029
- await p.unpublish(f.id), await g?.reload(), D.success(a("panel.unpublished-done"));
1030
- } catch (m) {
1031
- D.danger(s(m));
1029
+ await v.unpublish(y.id), await f?.reload(), R.success(a("panel.unpublished-done"));
1030
+ } catch (d) {
1031
+ R.danger(s(d));
1032
1032
  } finally {
1033
1033
  t.value = !1;
1034
1034
  }
1035
1035
  }
1036
1036
  }
1037
- return (f, T) => o.value && e(g)?.canManage ? (x(), I(e(pe), {
1037
+ return (y, $) => u.value && e(f)?.canManage ? (_(), q(e(pe), {
1038
1038
  key: 0,
1039
1039
  class: "wx-article-unpublish",
1040
1040
  help: e(a)("article.unpublish-help")
1041
1041
  }, {
1042
- default: i(() => [
1042
+ default: l(() => [
1043
1043
  r(e(G), {
1044
1044
  variant: "outline",
1045
1045
  type: "danger",
1046
1046
  icon: "eye-off",
1047
1047
  loading: t.value,
1048
- disabled: l.value,
1049
- onClick: b
1048
+ disabled: i.value,
1049
+ onClick: m
1050
1050
  }, {
1051
- default: i(() => [
1052
- V(k(e(a)("panel.unpublish")), 1)
1051
+ default: l(() => [
1052
+ C(k(e(a)("panel.unpublish")), 1)
1053
1053
  ]),
1054
1054
  _: 1
1055
1055
  }, 8, ["loading", "disabled"])
@@ -1059,51 +1059,51 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1059
1059
  }
1060
1060
  }), sa = /* @__PURE__ */ ge(na, [["__scopeId", "data-v-c311cff2"]]), ra = /* @__PURE__ */ Q({
1061
1061
  __name: "ArticleCreateDialog",
1062
- setup(v) {
1063
- const { open: c, resolve: p, dismiss: g } = Re(), a = le(), s = oe(a);
1062
+ setup(g) {
1063
+ const { open: c, resolve: v, dismiss: f } = Re(), a = ne(), s = ue(a);
1064
1064
  X();
1065
- const t = Z("webx-blog"), o = M(""), l = M(!1), b = M({}), f = Ie("field");
1065
+ const t = J("webx-blog"), u = M(""), i = M(!1), m = M({}), y = Ie("field");
1066
1066
  Ne(async () => {
1067
- await He(), f.value?.querySelector("input")?.focus();
1067
+ await He(), y.value?.querySelector("input")?.focus();
1068
1068
  });
1069
- async function T() {
1070
- if (!(o.value.trim() === "" || l.value)) {
1071
- l.value = !0, b.value = {};
1069
+ async function $() {
1070
+ if (!(u.value.trim() === "" || i.value)) {
1071
+ i.value = !0, m.value = {};
1072
1072
  try {
1073
- p(await s.create({ title: o.value.trim() }));
1074
- } catch (m) {
1075
- b.value = m.body?.errors ?? {};
1073
+ v(await s.create({ title: u.value.trim() }));
1074
+ } catch (d) {
1075
+ m.value = d.body?.errors ?? {};
1076
1076
  } finally {
1077
- l.value = !1;
1077
+ i.value = !1;
1078
1078
  }
1079
1079
  }
1080
1080
  }
1081
- return (m, A) => (x(), I(e(De), {
1081
+ return (d, W) => (_(), q(e(De), {
1082
1082
  open: e(c),
1083
- "onUpdate:open": A[2] || (A[2] = (z) => Pe(c) ? c.value = z : null),
1083
+ "onUpdate:open": W[2] || (W[2] = (V) => Pe(c) ? c.value = V : null),
1084
1084
  title: e(t)("panel.new-title"),
1085
1085
  width: 440
1086
1086
  }, {
1087
- footer: i(() => [
1087
+ footer: l(() => [
1088
1088
  r(e(Be), { size: "sm" }, {
1089
- default: i(() => [
1089
+ default: l(() => [
1090
1090
  r(e(G), {
1091
1091
  variant: "outline",
1092
- onClick: A[1] || (A[1] = (z) => e(g)())
1092
+ onClick: W[1] || (W[1] = (V) => e(f)())
1093
1093
  }, {
1094
- default: i(() => [
1095
- V(k(e(t)("panel.cancel")), 1)
1094
+ default: l(() => [
1095
+ C(k(e(t)("panel.cancel")), 1)
1096
1096
  ]),
1097
1097
  _: 1
1098
1098
  }),
1099
1099
  r(e(G), {
1100
1100
  type: "primary",
1101
- loading: l.value,
1102
- disabled: o.value.trim() === "",
1103
- onClick: T
1101
+ loading: i.value,
1102
+ disabled: u.value.trim() === "",
1103
+ onClick: $
1104
1104
  }, {
1105
- default: i(() => [
1106
- V(k(e(t)("panel.create")), 1)
1105
+ default: l(() => [
1106
+ C(k(e(t)("panel.create")), 1)
1107
1107
  ]),
1108
1108
  _: 1
1109
1109
  }, 8, ["loading", "disabled"])
@@ -1111,22 +1111,22 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1111
1111
  _: 1
1112
1112
  })
1113
1113
  ]),
1114
- default: i(() => [
1114
+ default: l(() => [
1115
1115
  r(e(pe), {
1116
1116
  label: e(t)("panel.field-title"),
1117
- error: b.value.title?.[0] ?? b.value.slug?.[0],
1117
+ error: m.value.title?.[0] ?? m.value.slug?.[0],
1118
1118
  required: ""
1119
1119
  }, {
1120
- default: i(() => [
1120
+ default: l(() => [
1121
1121
  F("div", {
1122
1122
  ref_key: "field",
1123
- ref: f
1123
+ ref: y
1124
1124
  }, [
1125
1125
  r(e(Ce), {
1126
- modelValue: o.value,
1127
- "onUpdate:modelValue": A[0] || (A[0] = (z) => o.value = z),
1126
+ modelValue: u.value,
1127
+ "onUpdate:modelValue": W[0] || (W[0] = (V) => u.value = V),
1128
1128
  "aria-label": e(t)("panel.field-title"),
1129
- onKeyup: Me(T, ["enter"])
1129
+ onKeyup: Me($, ["enter"])
1130
1130
  }, null, 8, ["modelValue", "aria-label"])
1131
1131
  ], 512)
1132
1132
  ]),
@@ -1136,32 +1136,32 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1136
1136
  _: 1
1137
1137
  }, 8, ["open", "title"]));
1138
1138
  }
1139
- }), oa = ["src"], ua = { class: "wx-articles__name" }, ca = { class: "wx-articles__name-text" }, da = { class: "wx-articles__title" }, pa = { class: "wx-articles__address" }, va = { class: "wx-articles__chips" }, ga = { class: "wx-articles__state" }, Xe = 640, ha = /* @__PURE__ */ Q({
1139
+ }), oa = ["src"], ua = { class: "wx-articles__name" }, ca = { class: "wx-articles__name-text" }, da = { class: "wx-articles__title" }, pa = { class: "wx-articles__address" }, va = { class: "wx-articles__chips" }, ga = { class: "wx-articles__state" }, Xe = 640, fa = /* @__PURE__ */ Q({
1140
1140
  __name: "ArticlesPage",
1141
1141
  props: {
1142
1142
  base: { default: "/blog" }
1143
1143
  },
1144
- setup(v) {
1145
- const c = v, p = le(), g = oe(p), a = Ge(), s = je();
1144
+ setup(g) {
1145
+ const c = g, v = ne(), f = ue(v), a = Ge(), s = je();
1146
1146
  X();
1147
- const t = Z("webx-blog"), o = Z("webx-admin"), l = we(), b = Ie("root"), f = At(b), T = M(null), m = M(!0), A = Ve(ra), z = h(() => p.can("blog.articles.manage")), S = h(
1148
- () => p.state.manifest?.modules.find((n) => n.id === "articles")?.title ?? t("module.articles")
1149
- ), B = h({
1147
+ const t = J("webx-blog"), u = J("webx-admin"), i = be(), m = Ie("root"), y = At(m), $ = M(null), d = M(!0), W = Ve(ra), V = h(() => v.can("blog.articles.manage")), z = h(
1148
+ () => v.state.manifest?.modules.find((n) => n.id === "articles")?.title ?? t("module.articles")
1149
+ ), D = h({
1150
1150
  get: () => typeof a.query.view == "string" ? a.query.view : "",
1151
1151
  set: (n) => {
1152
1152
  s.replace({
1153
1153
  query: { ...a.query, view: n === "" ? void 0 : String(n), page: void 0 }
1154
1154
  });
1155
1155
  }
1156
- }), R = h(() => B.value === "trashed"), y = h(() => ({
1156
+ }), B = h(() => D.value === "trashed"), w = h(() => ({
1157
1157
  q: typeof a.query.q == "string" ? a.query.q : "",
1158
- rubric: W(a.query.rubric),
1159
- tag: W(a.query.tag),
1160
- author: W(a.query.author),
1158
+ rubric: T(a.query.rubric),
1159
+ tag: T(a.query.tag),
1160
+ author: T(a.query.author),
1161
1161
  sort: typeof a.query.sort == "string" ? a.query.sort : null,
1162
1162
  page: Number(a.query.page ?? 1) || 1
1163
1163
  }));
1164
- function W(n) {
1164
+ function T(n) {
1165
1165
  return typeof n == "string" && n !== "" && Number(n) || null;
1166
1166
  }
1167
1167
  const N = h(() => [
@@ -1171,7 +1171,7 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1171
1171
  { value: "draft", label: t("panel.view-draft") },
1172
1172
  { value: "unpublished", label: t("panel.view-unpublished") },
1173
1173
  { value: "trashed", label: t("panel.bin"), icon: "trash" }
1174
- ]), U = h(() => T.value?.filters ?? { rubrics: [], tags: [], authors: [] }), $ = h(() => f.value > 0 && f.value < Xe), P = h(() => $.value ? [{ key: "card", label: "" }] : [
1174
+ ]), I = h(() => $.value?.filters ?? { rubrics: [], tags: [], authors: [] }), b = h(() => y.value > 0 && y.value < Xe), P = h(() => b.value ? [{ key: "card", label: "" }] : [
1175
1175
  { key: "cover", label: "", width: 68 },
1176
1176
  /* The one that takes what the others leave, and the only one without a number. */
1177
1177
  { key: "title", label: t("panel.column-title"), minWidth: 220 },
@@ -1179,7 +1179,7 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1179
1179
  { key: "author", label: t("panel.column-author"), width: 160, hideBelow: 1200 },
1180
1180
  {
1181
1181
  key: "date",
1182
- label: R.value ? t("panel.column-deleted") : t("panel.column-date"),
1182
+ label: B.value ? t("panel.column-deleted") : t("panel.column-date"),
1183
1183
  width: 120,
1184
1184
  hideBelow: 700,
1185
1185
  // "today at 16:22" is three words the table will break over two lines given half a
@@ -1188,23 +1188,23 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1188
1188
  },
1189
1189
  { key: "status", label: t("panel.column-status"), width: 170 },
1190
1190
  { key: "actions", label: "", width: Ye, align: "right" }
1191
- ]), E = h(() => y.value.q !== "" ? t("panel.empty-search") : R.value ? t("panel.empty-bin") : t("panel.empty")), ie = h(() => {
1192
- const n = [], q = U.value.rubrics.find((be) => be.id === y.value.rubric);
1193
- q && n.push({
1191
+ ]), E = h(() => w.value.q !== "" ? t("panel.empty-search") : B.value ? t("panel.empty-bin") : t("panel.empty")), Z = h(() => {
1192
+ const n = [], U = I.value.rubrics.find((he) => he.id === w.value.rubric);
1193
+ U && n.push({
1194
1194
  key: "rubric",
1195
- label: `${t("panel.filter-rubric")}: ${q.title}`,
1195
+ label: `${t("panel.filter-rubric")}: ${U.title}`,
1196
1196
  clear: () => O("rubric", void 0)
1197
1197
  });
1198
- const d = U.value.tags.find((be) => be.id === y.value.tag);
1199
- d && n.push({
1198
+ const p = I.value.tags.find((he) => he.id === w.value.tag);
1199
+ p && n.push({
1200
1200
  key: "tag",
1201
- label: `${t("panel.filter-tag")}: ${d.title}`,
1201
+ label: `${t("panel.filter-tag")}: ${p.title}`,
1202
1202
  clear: () => O("tag", void 0)
1203
1203
  });
1204
- const ke = U.value.authors.find((be) => be.id === y.value.author);
1205
- return ke && n.push({
1204
+ const xe = I.value.authors.find((he) => he.id === w.value.author);
1205
+ return xe && n.push({
1206
1206
  key: "author",
1207
- label: `${t("panel.filter-author")}: ${ke.title}`,
1207
+ label: `${t("panel.filter-author")}: ${xe.title}`,
1208
1208
  clear: () => O("author", void 0)
1209
1209
  }), n;
1210
1210
  });
@@ -1219,100 +1219,100 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1219
1219
  }
1220
1220
  });
1221
1221
  }
1222
- async function ne(n) {
1223
- m.value = !0;
1222
+ async function se(n) {
1223
+ d.value = !0;
1224
1224
  try {
1225
- T.value = await g.articles({
1226
- q: n?.search ?? y.value.q,
1227
- status: R.value ? "" : B.value,
1228
- trashed: R.value,
1229
- rubric: y.value.rubric,
1230
- tag: y.value.tag,
1231
- author: y.value.author,
1225
+ $.value = await f.articles({
1226
+ q: n?.search ?? w.value.q,
1227
+ status: B.value ? "" : D.value,
1228
+ trashed: B.value,
1229
+ rubric: w.value.rubric,
1230
+ tag: w.value.tag,
1231
+ author: w.value.author,
1232
1232
  sort: n?.sort ? `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}` : null,
1233
- page: n?.page ?? y.value.page,
1233
+ page: n?.page ?? w.value.page,
1234
1234
  per_page: n?.perPage
1235
1235
  });
1236
- } catch (q) {
1237
- D.danger(l(q));
1236
+ } catch (U) {
1237
+ R.danger(i(U));
1238
1238
  } finally {
1239
- m.value = !1;
1239
+ d.value = !1;
1240
1240
  }
1241
1241
  }
1242
- function se(n) {
1243
- const q = {
1242
+ function re(n) {
1243
+ const U = {
1244
1244
  ...a.query,
1245
1245
  q: n.search === "" ? void 0 : n.search,
1246
1246
  sort: n.sort === null ? void 0 : `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}`,
1247
1247
  page: n.page === 1 ? void 0 : String(n.page)
1248
1248
  };
1249
- s.replace({ query: q }), ne(n);
1249
+ s.replace({ query: U }), se(n);
1250
1250
  }
1251
- function O(n, q) {
1251
+ function O(n, U) {
1252
1252
  s.replace({
1253
1253
  query: {
1254
1254
  ...a.query,
1255
- [n]: typeof q == "number" ? String(q) : void 0,
1255
+ [n]: typeof U == "number" ? String(U) : void 0,
1256
1256
  page: void 0
1257
1257
  }
1258
1258
  });
1259
1259
  }
1260
1260
  ve(
1261
- [B, () => y.value.rubric, () => y.value.tag, () => y.value.author],
1261
+ [D, () => w.value.rubric, () => w.value.tag, () => w.value.author],
1262
1262
  () => {
1263
- ne();
1263
+ se();
1264
1264
  }
1265
- ), ne();
1266
- function he(n) {
1267
- const q = `${c.base}/articles/${n.id}`;
1268
- s.resolve(q).matched.length > 0 && s.push({ path: q, query: { ...a.query } });
1265
+ ), se();
1266
+ function ye(n) {
1267
+ const U = `${c.base}/articles/${n.id}`;
1268
+ s.resolve(U).matched.length > 0 && s.push({ path: U, query: { ...a.query } });
1269
1269
  }
1270
- async function xe() {
1271
- const n = await A({});
1272
- n && (await ne(), he(n));
1270
+ async function we() {
1271
+ const n = await W({});
1272
+ n && (await se(), ye(n));
1273
1273
  }
1274
- function re(n) {
1275
- if (!z.value) return [];
1276
- if (R.value)
1274
+ function te(n) {
1275
+ if (!V.value) return [];
1276
+ if (B.value)
1277
1277
  return [
1278
1278
  {
1279
1279
  key: "restore",
1280
1280
  icon: "refresh",
1281
1281
  label: t("panel.restore"),
1282
1282
  run: () => {
1283
- ee(n);
1283
+ ce(n);
1284
1284
  }
1285
1285
  }
1286
1286
  ];
1287
- const q = [
1288
- { key: "open", icon: "edit", label: t("panel.open"), run: () => he(n) }
1287
+ const U = [
1288
+ { key: "open", icon: "edit", label: t("panel.open"), run: () => ye(n) }
1289
1289
  ];
1290
- return n.url && n.status !== "draft" && q.push({
1290
+ return n.url && n.status !== "draft" && U.push({
1291
1291
  key: "site",
1292
1292
  icon: "external-link",
1293
1293
  label: t("panel.open-on-site"),
1294
1294
  href: n.url
1295
- }), n.path !== null && q.push({
1295
+ }), n.path !== null && U.push({
1296
1296
  key: "copy",
1297
1297
  icon: "copy",
1298
1298
  label: t("panel.copy-address"),
1299
1299
  run: () => {
1300
- u(n);
1300
+ We(n);
1301
1301
  }
1302
- }), q.push({
1302
+ }), U.push({
1303
1303
  key: "pin",
1304
1304
  icon: "star",
1305
1305
  label: n.pinned ? t("panel.unpin") : t("panel.pin"),
1306
1306
  run: () => {
1307
- _e(n, !n.pinned);
1307
+ $e(n, !n.pinned);
1308
1308
  }
1309
- }), q.push(
1309
+ }), U.push(
1310
1310
  n.status === "published" || n.status === "modified" || n.status === "scheduled" ? {
1311
1311
  key: "unpublish",
1312
1312
  icon: "eye-off",
1313
1313
  label: t("panel.unpublish"),
1314
1314
  run: () => {
1315
- We(n);
1315
+ Se(n);
1316
1316
  }
1317
1317
  } : {
1318
1318
  key: "publish",
@@ -1322,114 +1322,114 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1322
1322
  fe(n);
1323
1323
  }
1324
1324
  }
1325
- ), q.push({
1325
+ ), U.push({
1326
1326
  key: "delete",
1327
1327
  icon: "trash",
1328
1328
  label: t("panel.delete"),
1329
1329
  danger: !0,
1330
1330
  run: () => {
1331
- ue(n);
1331
+ oe(n);
1332
1332
  }
1333
- }), q;
1333
+ }), U;
1334
1334
  }
1335
1335
  async function fe(n) {
1336
- await ce(() => g.publish(n.id), t("panel.published"));
1336
+ await ae(() => f.publish(n.id), t("panel.published"));
1337
1337
  }
1338
- async function We(n) {
1339
- await ce(() => g.unpublish(n.id), t("panel.unpublished-done"));
1338
+ async function Se(n) {
1339
+ await ae(() => f.unpublish(n.id), t("panel.unpublished-done"));
1340
1340
  }
1341
- async function _e(n, q) {
1342
- await ce(
1343
- () => g.save(n.id, { values: { pinned: q }, revision: n.revision }),
1344
- t(q ? "panel.pinned-done" : "panel.unpinned")
1341
+ async function $e(n, U) {
1342
+ await ae(
1343
+ () => f.save(n.id, { values: { pinned: U }, revision: n.revision }),
1344
+ t(U ? "panel.pinned-done" : "panel.unpinned")
1345
1345
  );
1346
1346
  }
1347
- async function ue(n) {
1347
+ async function oe(n) {
1348
1348
  await de({
1349
1349
  title: t("panel.delete-title", { title: n.title }),
1350
1350
  message: t("panel.delete-text"),
1351
1351
  confirmText: t("panel.delete"),
1352
1352
  cancelText: t("panel.cancel"),
1353
1353
  tone: "danger"
1354
- }) && await ce(() => g.remove(n.id), t("panel.deleted"));
1354
+ }) && await ae(() => f.remove(n.id), t("panel.deleted"));
1355
1355
  }
1356
- async function ee(n) {
1357
- await ce(() => g.restore(n.id), t("panel.restored"));
1356
+ async function ce(n) {
1357
+ await ae(() => f.restore(n.id), t("panel.restored"));
1358
1358
  }
1359
- async function ce(n, q) {
1359
+ async function ae(n, U) {
1360
1360
  try {
1361
- await n(), D.success(q);
1362
- } catch (d) {
1363
- D.danger(l(d));
1361
+ await n(), R.success(U);
1362
+ } catch (p) {
1363
+ R.danger(i(p));
1364
1364
  } finally {
1365
- await ne();
1365
+ await se();
1366
1366
  }
1367
1367
  }
1368
- async function u(n) {
1368
+ async function We(n) {
1369
1369
  if (n.url)
1370
1370
  try {
1371
- await navigator.clipboard.writeText(n.url), D.success(t("panel.address-copied"));
1371
+ await navigator.clipboard.writeText(n.url), R.success(t("panel.address-copied"));
1372
1372
  } catch {
1373
1373
  }
1374
1374
  }
1375
- function C(n) {
1375
+ function o(n) {
1376
1376
  return n === "published" || n === "modified" ? "success" : n === "scheduled" ? "warning" : "default";
1377
1377
  }
1378
- function _(n) {
1379
- return R.value ? "—" : n.path === null ? t("panel.no-address") : `/${n.path}`;
1378
+ function A(n) {
1379
+ return B.value ? "—" : n.path === null ? t("panel.no-address") : `/${n.path}`;
1380
1380
  }
1381
- function J(n) {
1382
- return R.value ? n.deleted_at : n.published_at;
1381
+ function S(n) {
1382
+ return B.value ? n.deleted_at : n.published_at;
1383
1383
  }
1384
- const me = h(
1385
- () => z.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1386
- xe();
1384
+ const ee = h(
1385
+ () => V.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1386
+ we();
1387
1387
  } }] : []
1388
1388
  );
1389
- return (n, q) => (x(), H("div", {
1389
+ return (n, U) => (_(), H("div", {
1390
1390
  ref_key: "root",
1391
- ref: b,
1391
+ ref: m,
1392
1392
  class: "wx-articles"
1393
1393
  }, [
1394
1394
  r(e(et), {
1395
- view: B.value,
1396
- "onUpdate:view": q[3] || (q[3] = (d) => B.value = d),
1397
- title: S.value,
1395
+ view: D.value,
1396
+ "onUpdate:view": U[3] || (U[3] = (p) => D.value = p),
1397
+ title: z.value,
1398
1398
  views: N.value,
1399
- actions: me.value
1399
+ actions: ee.value
1400
1400
  }, {
1401
- default: i(() => [
1401
+ default: l(() => [
1402
1402
  r(e(it), {
1403
- data: T.value,
1403
+ data: $.value,
1404
1404
  columns: P.value,
1405
1405
  "row-key": "id",
1406
1406
  searchable: "",
1407
- clickable: !R.value,
1408
- hover: !R.value,
1407
+ clickable: !B.value,
1408
+ hover: !B.value,
1409
1409
  flush: "",
1410
- loading: m.value,
1410
+ loading: d.value,
1411
1411
  layout: "fixed",
1412
1412
  "cards-below": Xe,
1413
- "filters-count": ie.value.length,
1414
- "filters-label": e(o)("filters.title"),
1413
+ "filters-count": Z.value.length,
1414
+ "filters-label": e(u)("filters.title"),
1415
1415
  "search-placeholder": e(t)("panel.search"),
1416
1416
  "empty-text": E.value,
1417
- "aria-label": S.value,
1418
- onRowClick: he,
1419
- onStateChange: se
1417
+ "aria-label": z.value,
1418
+ onRowClick: ye,
1419
+ onStateChange: re
1420
1420
  }, {
1421
- filters: i(() => [
1421
+ filters: l(() => [
1422
1422
  r(e(pe), {
1423
1423
  label: e(t)("panel.filter-rubric")
1424
1424
  }, {
1425
- default: i(() => [
1426
- r(e($e), {
1427
- "model-value": y.value.rubric,
1428
- options: U.value.rubrics.map((d) => ({ value: d.id, label: d.title })),
1425
+ default: l(() => [
1426
+ r(e(_e), {
1427
+ "model-value": w.value.rubric,
1428
+ options: I.value.rubrics.map((p) => ({ value: p.id, label: p.title })),
1429
1429
  placeholder: e(t)("panel.any-rubric"),
1430
1430
  clearable: "",
1431
1431
  size: "sm",
1432
- "onUpdate:modelValue": q[0] || (q[0] = (d) => O("rubric", d))
1432
+ "onUpdate:modelValue": U[0] || (U[0] = (p) => O("rubric", p))
1433
1433
  }, null, 8, ["model-value", "options", "placeholder"])
1434
1434
  ]),
1435
1435
  _: 1
@@ -1437,15 +1437,15 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1437
1437
  r(e(pe), {
1438
1438
  label: e(t)("panel.filter-tag")
1439
1439
  }, {
1440
- default: i(() => [
1441
- r(e($e), {
1442
- "model-value": y.value.tag,
1443
- options: U.value.tags.map((d) => ({ value: d.id, label: d.title })),
1440
+ default: l(() => [
1441
+ r(e(_e), {
1442
+ "model-value": w.value.tag,
1443
+ options: I.value.tags.map((p) => ({ value: p.id, label: p.title })),
1444
1444
  placeholder: e(t)("panel.any-tag"),
1445
1445
  clearable: "",
1446
1446
  filterable: "",
1447
1447
  size: "sm",
1448
- "onUpdate:modelValue": q[1] || (q[1] = (d) => O("tag", d))
1448
+ "onUpdate:modelValue": U[1] || (U[1] = (p) => O("tag", p))
1449
1449
  }, null, 8, ["model-value", "options", "placeholder"])
1450
1450
  ]),
1451
1451
  _: 1
@@ -1453,61 +1453,61 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1453
1453
  r(e(pe), {
1454
1454
  label: e(t)("panel.filter-author")
1455
1455
  }, {
1456
- default: i(() => [
1457
- r(e($e), {
1458
- "model-value": y.value.author,
1459
- options: U.value.authors.map((d) => ({ value: d.id, label: d.title })),
1456
+ default: l(() => [
1457
+ r(e(_e), {
1458
+ "model-value": w.value.author,
1459
+ options: I.value.authors.map((p) => ({ value: p.id, label: p.title })),
1460
1460
  placeholder: e(t)("panel.any-author"),
1461
1461
  clearable: "",
1462
1462
  size: "sm",
1463
- "onUpdate:modelValue": q[2] || (q[2] = (d) => O("author", d))
1463
+ "onUpdate:modelValue": U[2] || (U[2] = (p) => O("author", p))
1464
1464
  }, null, 8, ["model-value", "options", "placeholder"])
1465
1465
  ]),
1466
1466
  _: 1
1467
1467
  }, 8, ["label"]),
1468
- ie.value.length > 0 ? (x(), I(e(G), {
1468
+ Z.value.length > 0 ? (_(), q(e(G), {
1469
1469
  key: 0,
1470
1470
  variant: "text",
1471
1471
  size: "sm",
1472
1472
  block: "",
1473
1473
  onClick: Y
1474
1474
  }, {
1475
- icon: i(() => [
1476
- r(e(Ae), { name: "close" })
1475
+ icon: l(() => [
1476
+ r(e(Te), { name: "close" })
1477
1477
  ]),
1478
- default: i(() => [
1479
- V(" " + k(e(o)("filters.reset")), 1)
1478
+ default: l(() => [
1479
+ C(" " + k(e(u)("filters.reset")), 1)
1480
1480
  ]),
1481
1481
  _: 1
1482
1482
  })) : K("", !0)
1483
1483
  ]),
1484
- applied: i(() => [
1485
- r(e(vt), { filters: ie.value }, null, 8, ["filters"])
1484
+ applied: l(() => [
1485
+ r(e(vt), { filters: Z.value }, null, 8, ["filters"])
1486
1486
  ]),
1487
- "cell-cover": i(({ row: d }) => [
1487
+ "cell-cover": l(({ row: p }) => [
1488
1488
  F("span", {
1489
- class: tt(["wx-articles__cover", { "is-empty": !d.cover }])
1489
+ class: tt(["wx-articles__cover", { "is-empty": !p.cover }])
1490
1490
  }, [
1491
- d.cover?.thumb ? (x(), H("img", {
1491
+ p.cover?.thumb ? (_(), H("img", {
1492
1492
  key: 0,
1493
- src: d.cover.thumb,
1493
+ src: p.cover.thumb,
1494
1494
  alt: "",
1495
1495
  loading: "lazy"
1496
- }, null, 8, oa)) : (x(), I(e(Ae), {
1496
+ }, null, 8, oa)) : (_(), q(e(Te), {
1497
1497
  key: 1,
1498
1498
  name: "image",
1499
1499
  size: "sm"
1500
1500
  }))
1501
1501
  ], 2)
1502
1502
  ]),
1503
- "cell-title": i(({ row: d }) => [
1503
+ "cell-title": l(({ row: p }) => [
1504
1504
  F("div", ua, [
1505
- d.pinned ? (x(), I(e(nt), {
1505
+ p.pinned ? (_(), q(e(nt), {
1506
1506
  key: 0,
1507
1507
  content: e(t)("panel.pinned")
1508
1508
  }, {
1509
- default: i(() => [
1510
- r(e(Ae), {
1509
+ default: l(() => [
1510
+ r(e(Te), {
1511
1511
  class: "wx-articles__pin",
1512
1512
  name: "star",
1513
1513
  size: "sm"
@@ -1516,136 +1516,136 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1516
1516
  _: 1
1517
1517
  }, 8, ["content"])) : K("", !0),
1518
1518
  F("div", ca, [
1519
- F("span", da, k(d.title), 1),
1520
- F("span", pa, k(_(d)), 1)
1519
+ F("span", da, k(p.title), 1),
1520
+ F("span", pa, k(A(p)), 1)
1521
1521
  ])
1522
1522
  ])
1523
1523
  ]),
1524
- "cell-rubrics": i(({ row: d }) => [
1524
+ "cell-rubrics": l(({ row: p }) => [
1525
1525
  F("span", va, [
1526
- (x(!0), H(Te, null, qe(d.rubrics, (ke) => (x(), I(e(ae), {
1527
- key: ke.id,
1526
+ (_(!0), H(ke, null, qe(p.rubrics, (xe) => (_(), q(e(ie), {
1527
+ key: xe.id,
1528
1528
  size: "sm",
1529
1529
  round: ""
1530
1530
  }, {
1531
- default: i(() => [
1532
- V(k(ke.title), 1)
1531
+ default: l(() => [
1532
+ C(k(xe.title), 1)
1533
1533
  ]),
1534
1534
  _: 2
1535
1535
  }, 1024))), 128))
1536
1536
  ])
1537
1537
  ]),
1538
- "cell-author": i(({ row: d }) => [
1539
- r(e(te), {
1538
+ "cell-author": l(({ row: p }) => [
1539
+ r(e(le), {
1540
1540
  size: "sm",
1541
1541
  tone: "muted",
1542
1542
  truncate: ""
1543
1543
  }, {
1544
- default: i(() => [
1545
- V(k(d.author ? d.author.name : "—"), 1)
1544
+ default: l(() => [
1545
+ C(k(p.author ? p.author.name : "—"), 1)
1546
1546
  ]),
1547
1547
  _: 2
1548
1548
  }, 1024)
1549
1549
  ]),
1550
- "cell-date": i(({ row: d }) => [
1551
- J(d) ? (x(), I(e(Ee), {
1550
+ "cell-date": l(({ row: p }) => [
1551
+ S(p) ? (_(), q(e(Ee), {
1552
1552
  key: 0,
1553
- value: J(d),
1553
+ value: S(p),
1554
1554
  compact: ""
1555
- }, null, 8, ["value"])) : (x(), I(e(te), {
1555
+ }, null, 8, ["value"])) : (_(), q(e(le), {
1556
1556
  key: 1,
1557
1557
  size: "sm",
1558
1558
  tone: "muted"
1559
1559
  }, {
1560
- default: i(() => [...q[4] || (q[4] = [
1561
- V("—", -1)
1560
+ default: l(() => [...U[4] || (U[4] = [
1561
+ C("—", -1)
1562
1562
  ])]),
1563
1563
  _: 1
1564
1564
  }))
1565
1565
  ]),
1566
- "cell-status": i(({ row: d }) => [
1566
+ "cell-status": l(({ row: p }) => [
1567
1567
  F("span", ga, [
1568
- r(e(ae), {
1569
- type: C(d.status),
1568
+ r(e(ie), {
1569
+ type: o(p.status),
1570
1570
  dot: "",
1571
1571
  size: "sm"
1572
1572
  }, {
1573
- default: i(() => [
1574
- V(k(e(t)(`panel.status-${d.status}`)), 1)
1573
+ default: l(() => [
1574
+ C(k(e(t)(`panel.status-${p.status}`)), 1)
1575
1575
  ]),
1576
1576
  _: 2
1577
1577
  }, 1032, ["type"]),
1578
- d.status === "modified" ? (x(), I(e(ae), {
1578
+ p.status === "modified" ? (_(), q(e(ie), {
1579
1579
  key: 0,
1580
1580
  type: "primary",
1581
1581
  size: "sm",
1582
1582
  round: ""
1583
1583
  }, {
1584
- default: i(() => [
1585
- V(k(e(t)("panel.edits")), 1)
1584
+ default: l(() => [
1585
+ C(k(e(t)("panel.edits")), 1)
1586
1586
  ]),
1587
1587
  _: 1
1588
1588
  })) : K("", !0)
1589
1589
  ])
1590
1590
  ]),
1591
- "cell-card": i(({ row: d }) => [
1591
+ "cell-card": l(({ row: p }) => [
1592
1592
  r(e(St), {
1593
1593
  class: "wx-articles__entity",
1594
1594
  variant: "plain",
1595
- title: d.title,
1596
- image: d.cover?.thumb ?? void 0,
1595
+ title: p.title,
1596
+ image: p.cover?.thumb ?? void 0,
1597
1597
  "image-size": "56px",
1598
1598
  "title-lines": 2,
1599
- subtitle: _(d)
1599
+ subtitle: A(p)
1600
1600
  }, {
1601
- title: i(() => [
1602
- d.pinned ? (x(), I(e(Ae), {
1601
+ title: l(() => [
1602
+ p.pinned ? (_(), q(e(Te), {
1603
1603
  key: 0,
1604
1604
  class: "wx-articles__pin",
1605
1605
  name: "star",
1606
1606
  size: "sm"
1607
1607
  })) : K("", !0),
1608
- V(" " + k(d.title), 1)
1608
+ C(" " + k(p.title), 1)
1609
1609
  ]),
1610
- meta: i(() => [
1611
- d.rubrics[0] ? (x(), I(e(ae), {
1610
+ meta: l(() => [
1611
+ p.rubrics[0] ? (_(), q(e(ie), {
1612
1612
  key: 0,
1613
1613
  size: "sm",
1614
1614
  round: ""
1615
1615
  }, {
1616
- default: i(() => [
1617
- V(k(d.rubrics[0].title), 1)
1616
+ default: l(() => [
1617
+ C(k(p.rubrics[0].title), 1)
1618
1618
  ]),
1619
1619
  _: 2
1620
1620
  }, 1024)) : K("", !0),
1621
- r(e(ae), {
1622
- type: C(d.status),
1621
+ r(e(ie), {
1622
+ type: o(p.status),
1623
1623
  dot: "",
1624
1624
  size: "sm"
1625
1625
  }, {
1626
- default: i(() => [
1627
- V(k(e(t)(`panel.status-${d.status}`)), 1)
1626
+ default: l(() => [
1627
+ C(k(e(t)(`panel.status-${p.status}`)), 1)
1628
1628
  ]),
1629
1629
  _: 2
1630
1630
  }, 1032, ["type"]),
1631
- J(d) ? (x(), I(e(Ee), {
1631
+ S(p) ? (_(), q(e(Ee), {
1632
1632
  key: 1,
1633
- value: J(d)
1633
+ value: S(p)
1634
1634
  }, null, 8, ["value"])) : K("", !0)
1635
1635
  ]),
1636
1636
  _: 2
1637
1637
  }, 1032, ["title", "image", "subtitle"])
1638
1638
  ]),
1639
- "card-actions": i(({ row: d }) => [
1639
+ "card-actions": l(({ row: p }) => [
1640
1640
  r(e(ze), {
1641
- actions: re(d),
1642
- label: d.title
1641
+ actions: te(p),
1642
+ label: p.title
1643
1643
  }, null, 8, ["actions", "label"])
1644
1644
  ]),
1645
- "cell-actions": i(({ row: d }) => [
1645
+ "cell-actions": l(({ row: p }) => [
1646
1646
  r(e(ze), {
1647
- actions: re(d),
1648
- label: d.title
1647
+ actions: te(p),
1648
+ label: p.title
1649
1649
  }, null, 8, ["actions", "label"])
1650
1650
  ]),
1651
1651
  _: 1
@@ -1655,58 +1655,58 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1655
1655
  }, 8, ["view", "title", "views", "actions"])
1656
1656
  ], 512));
1657
1657
  }
1658
- }), fa = /* @__PURE__ */ ge(ha, [["__scopeId", "data-v-d6800820"]]), ma = /* @__PURE__ */ Q({
1658
+ }), ha = /* @__PURE__ */ ge(fa, [["__scopeId", "data-v-d6800820"]]), ma = /* @__PURE__ */ Q({
1659
1659
  __name: "TagCreateDialog",
1660
- setup(v) {
1661
- const { open: c, resolve: p, dismiss: g } = Re(), a = le(), s = oe(a);
1660
+ setup(g) {
1661
+ const { open: c, resolve: v, dismiss: f } = Re(), a = ne(), s = ue(a);
1662
1662
  X();
1663
- const t = Z("webx-blog"), o = M(""), l = M(""), b = M(!1), f = M({}), T = Ie("field");
1663
+ const t = J("webx-blog"), u = M(""), i = M(""), m = M(!1), y = M({}), $ = Ie("field");
1664
1664
  Ne(async () => {
1665
- await He(), T.value?.querySelector("input")?.focus();
1665
+ await He(), $.value?.querySelector("input")?.focus();
1666
1666
  });
1667
- async function m() {
1668
- if (!(o.value.trim() === "" || b.value)) {
1669
- b.value = !0, f.value = {};
1667
+ async function d() {
1668
+ if (!(u.value.trim() === "" || m.value)) {
1669
+ m.value = !0, y.value = {};
1670
1670
  try {
1671
- p(
1671
+ v(
1672
1672
  await s.createTag({
1673
- title: o.value.trim(),
1674
- ...l.value.trim() === "" ? {} : { slug: l.value.trim() }
1673
+ title: u.value.trim(),
1674
+ ...i.value.trim() === "" ? {} : { slug: i.value.trim() }
1675
1675
  })
1676
1676
  );
1677
- } catch (A) {
1678
- f.value = A.body?.errors ?? {};
1677
+ } catch (W) {
1678
+ y.value = W.body?.errors ?? {};
1679
1679
  } finally {
1680
- b.value = !1;
1680
+ m.value = !1;
1681
1681
  }
1682
1682
  }
1683
1683
  }
1684
- return (A, z) => (x(), I(e(De), {
1684
+ return (W, V) => (_(), q(e(De), {
1685
1685
  open: e(c),
1686
- "onUpdate:open": z[3] || (z[3] = (S) => Pe(c) ? c.value = S : null),
1686
+ "onUpdate:open": V[3] || (V[3] = (z) => Pe(c) ? c.value = z : null),
1687
1687
  title: e(t)("tag.new-title"),
1688
1688
  width: 440
1689
1689
  }, {
1690
- footer: i(() => [
1690
+ footer: l(() => [
1691
1691
  r(e(Be), { size: "sm" }, {
1692
- default: i(() => [
1692
+ default: l(() => [
1693
1693
  r(e(G), {
1694
1694
  variant: "outline",
1695
- onClick: z[2] || (z[2] = (S) => e(g)())
1695
+ onClick: V[2] || (V[2] = (z) => e(f)())
1696
1696
  }, {
1697
- default: i(() => [
1698
- V(k(e(t)("tag.cancel")), 1)
1697
+ default: l(() => [
1698
+ C(k(e(t)("tag.cancel")), 1)
1699
1699
  ]),
1700
1700
  _: 1
1701
1701
  }),
1702
1702
  r(e(G), {
1703
1703
  type: "primary",
1704
- loading: b.value,
1705
- disabled: o.value.trim() === "",
1706
- onClick: m
1704
+ loading: m.value,
1705
+ disabled: u.value.trim() === "",
1706
+ onClick: d
1707
1707
  }, {
1708
- default: i(() => [
1709
- V(k(e(t)("tag.create")), 1)
1708
+ default: l(() => [
1709
+ C(k(e(t)("tag.create")), 1)
1710
1710
  ]),
1711
1711
  _: 1
1712
1712
  }, 8, ["loading", "disabled"])
@@ -1714,22 +1714,22 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1714
1714
  _: 1
1715
1715
  })
1716
1716
  ]),
1717
- default: i(() => [
1717
+ default: l(() => [
1718
1718
  r(e(pe), {
1719
1719
  label: e(t)("tag.field-title"),
1720
- error: f.value.title?.[0],
1720
+ error: y.value.title?.[0],
1721
1721
  required: ""
1722
1722
  }, {
1723
- default: i(() => [
1723
+ default: l(() => [
1724
1724
  F("div", {
1725
1725
  ref_key: "field",
1726
- ref: T
1726
+ ref: $
1727
1727
  }, [
1728
1728
  r(e(Ce), {
1729
- modelValue: o.value,
1730
- "onUpdate:modelValue": z[0] || (z[0] = (S) => o.value = S),
1729
+ modelValue: u.value,
1730
+ "onUpdate:modelValue": V[0] || (V[0] = (z) => u.value = z),
1731
1731
  "aria-label": e(t)("tag.field-title"),
1732
- onKeyup: Me(m, ["enter"])
1732
+ onKeyup: Me(d, ["enter"])
1733
1733
  }, null, 8, ["modelValue", "aria-label"])
1734
1734
  ], 512)
1735
1735
  ]),
@@ -1737,15 +1737,15 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1737
1737
  }, 8, ["label", "error"]),
1738
1738
  r(e(pe), {
1739
1739
  label: e(t)("tag.field-slug"),
1740
- error: f.value.slug?.[0],
1740
+ error: y.value.slug?.[0],
1741
1741
  help: e(t)("tag.field-slug-help")
1742
1742
  }, {
1743
- default: i(() => [
1743
+ default: l(() => [
1744
1744
  r(e(Ce), {
1745
- modelValue: l.value,
1746
- "onUpdate:modelValue": z[1] || (z[1] = (S) => l.value = S),
1745
+ modelValue: i.value,
1746
+ "onUpdate:modelValue": V[1] || (V[1] = (z) => i.value = z),
1747
1747
  "aria-label": e(t)("tag.field-slug"),
1748
- onKeyup: Me(m, ["enter"])
1748
+ onKeyup: Me(d, ["enter"])
1749
1749
  }, null, 8, ["modelValue", "aria-label"])
1750
1750
  ]),
1751
1751
  _: 1
@@ -1759,49 +1759,49 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1759
1759
  props: {
1760
1760
  name: {}
1761
1761
  },
1762
- setup(v) {
1763
- const c = v, { open: p, resolve: g, dismiss: a } = Re();
1762
+ setup(g) {
1763
+ const c = g, { open: v, resolve: f, dismiss: a } = Re();
1764
1764
  X();
1765
- const s = Z("webx-blog"), t = Z("webx-admin"), o = yt(), l = M(c.name), b = Ie("field");
1765
+ const s = J("webx-blog"), t = J("webx-admin"), u = yt(), i = M(c.name), m = Ie("field");
1766
1766
  Ne(async () => {
1767
1767
  await He();
1768
- const T = b.value?.querySelector("input");
1769
- T?.focus(), T?.select();
1768
+ const $ = m.value?.querySelector("input");
1769
+ $?.focus(), $?.select();
1770
1770
  });
1771
- function f() {
1772
- const T = l.value.trim();
1773
- if (T === "" || T === c.name) {
1771
+ function y() {
1772
+ const $ = i.value.trim();
1773
+ if ($ === "" || $ === c.name) {
1774
1774
  a();
1775
1775
  return;
1776
1776
  }
1777
- g(T);
1777
+ f($);
1778
1778
  }
1779
- return (T, m) => (x(), I(e(De), {
1780
- open: e(p),
1781
- "onUpdate:open": m[2] || (m[2] = (A) => Pe(p) ? p.value = A : null),
1779
+ return ($, d) => (_(), q(e(De), {
1780
+ open: e(v),
1781
+ "onUpdate:open": d[2] || (d[2] = (W) => Pe(v) ? v.value = W : null),
1782
1782
  title: e(s)("tag.rename"),
1783
1783
  width: 420
1784
1784
  }, {
1785
- footer: i(() => [
1785
+ footer: l(() => [
1786
1786
  r(e(Be), { size: "sm" }, {
1787
- default: i(() => [
1787
+ default: l(() => [
1788
1788
  r(e(G), {
1789
1789
  variant: "outline",
1790
- onClick: m[1] || (m[1] = (A) => e(a)())
1790
+ onClick: d[1] || (d[1] = (W) => e(a)())
1791
1791
  }, {
1792
- default: i(() => [
1793
- V(k(e(s)("tag.cancel")), 1)
1792
+ default: l(() => [
1793
+ C(k(e(s)("tag.cancel")), 1)
1794
1794
  ]),
1795
1795
  _: 1
1796
1796
  }),
1797
1797
  r(e(G), {
1798
1798
  type: "primary",
1799
1799
  "native-type": "submit",
1800
- form: e(o),
1801
- disabled: l.value.trim() === ""
1800
+ form: e(u),
1801
+ disabled: i.value.trim() === ""
1802
1802
  }, {
1803
- default: i(() => [
1804
- V(k(e(t)("editor.save")), 1)
1803
+ default: l(() => [
1804
+ C(k(e(t)("editor.save")), 1)
1805
1805
  ]),
1806
1806
  _: 1
1807
1807
  }, 8, ["form", "disabled"])
@@ -1809,23 +1809,23 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1809
1809
  _: 1
1810
1810
  })
1811
1811
  ]),
1812
- default: i(() => [
1812
+ default: l(() => [
1813
1813
  F("form", {
1814
- id: e(o),
1814
+ id: e(u),
1815
1815
  ref_key: "field",
1816
- ref: b,
1817
- onSubmit: Je(f, ["prevent"])
1816
+ ref: m,
1817
+ onSubmit: Je(y, ["prevent"])
1818
1818
  }, [
1819
1819
  r(e(pe), {
1820
1820
  label: e(s)("tag.field-title"),
1821
1821
  required: ""
1822
1822
  }, {
1823
- default: i(() => [
1823
+ default: l(() => [
1824
1824
  r(e(Ce), {
1825
- modelValue: l.value,
1826
- "onUpdate:modelValue": m[0] || (m[0] = (A) => l.value = A),
1825
+ modelValue: i.value,
1826
+ "onUpdate:modelValue": d[0] || (d[0] = (W) => i.value = W),
1827
1827
  "aria-label": e(s)("tag.field-title"),
1828
- onKeydown: Me(Je(f, ["prevent"]), ["enter"])
1828
+ onKeydown: Me(Je(y, ["prevent"]), ["enter"])
1829
1829
  }, null, 8, ["modelValue", "aria-label", "onKeydown"])
1830
1830
  ]),
1831
1831
  _: 1
@@ -1840,58 +1840,58 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1840
1840
  props: {
1841
1841
  tags: {}
1842
1842
  },
1843
- setup(v) {
1844
- const c = v, { open: p, resolve: g, dismiss: a } = Re(), s = le(), t = oe(s);
1843
+ setup(g) {
1844
+ const c = g, { open: v, resolve: f, dismiss: a } = Re(), s = ne(), t = ue(s);
1845
1845
  X();
1846
- const o = Z("webx-blog"), l = we(), b = M(
1847
- [...c.tags].sort((W, N) => N.articles_count - W.articles_count)[0]?.id ?? 0
1848
- ), f = M(!1), T = M(!0), m = M(null), A = h(
1849
- () => c.tags.map((W) => ({ value: W.id, label: `${W.title} · ${W.articles_count}` }))
1850
- ), z = h(() => c.tags.find((W) => W.id === b.value) ?? null), S = h(() => c.tags.filter((W) => W.id !== b.value)), B = h(() => S.value.reduce((W, N) => W + N.articles_count, 0)), R = h(() => S.value.map((W) => W.path).filter(Boolean));
1851
- async function y() {
1852
- if (!(z.value === null || S.value.length === 0 || f.value)) {
1853
- f.value = !0, m.value = null;
1846
+ const u = J("webx-blog"), i = be(), m = M(
1847
+ [...c.tags].sort((T, N) => N.articles_count - T.articles_count)[0]?.id ?? 0
1848
+ ), y = M(!1), $ = M(!0), d = M(null), W = h(
1849
+ () => c.tags.map((T) => ({ value: T.id, label: `${T.title} · ${T.articles_count}` }))
1850
+ ), V = h(() => c.tags.find((T) => T.id === m.value) ?? null), z = h(() => c.tags.filter((T) => T.id !== m.value)), D = h(() => z.value.reduce((T, N) => T + N.articles_count, 0)), B = h(() => z.value.map((T) => T.path).filter(Boolean));
1851
+ async function w() {
1852
+ if (!(V.value === null || z.value.length === 0 || y.value)) {
1853
+ y.value = !0, d.value = null;
1854
1854
  try {
1855
- g(
1855
+ f(
1856
1856
  await t.mergeTags(
1857
- S.value.map((W) => W.id),
1858
- b.value,
1859
- T.value
1857
+ z.value.map((T) => T.id),
1858
+ m.value,
1859
+ $.value
1860
1860
  )
1861
1861
  );
1862
- } catch (W) {
1863
- m.value = l(W);
1862
+ } catch (T) {
1863
+ d.value = i(T);
1864
1864
  } finally {
1865
- f.value = !1;
1865
+ y.value = !1;
1866
1866
  }
1867
1867
  }
1868
1868
  }
1869
- return (W, N) => (x(), I(e(De), {
1870
- open: e(p),
1871
- "onUpdate:open": N[3] || (N[3] = (U) => Pe(p) ? p.value = U : null),
1872
- title: e(o)("tag.merge-title"),
1869
+ return (T, N) => (_(), q(e(De), {
1870
+ open: e(v),
1871
+ "onUpdate:open": N[3] || (N[3] = (I) => Pe(v) ? v.value = I : null),
1872
+ title: e(u)("tag.merge-title"),
1873
1873
  width: 520
1874
1874
  }, {
1875
- footer: i(() => [
1875
+ footer: l(() => [
1876
1876
  r(e(Be), { size: "sm" }, {
1877
- default: i(() => [
1877
+ default: l(() => [
1878
1878
  r(e(G), {
1879
1879
  variant: "outline",
1880
- onClick: N[2] || (N[2] = (U) => e(a)())
1880
+ onClick: N[2] || (N[2] = (I) => e(a)())
1881
1881
  }, {
1882
- default: i(() => [
1883
- V(k(e(o)("tag.cancel")), 1)
1882
+ default: l(() => [
1883
+ C(k(e(u)("tag.cancel")), 1)
1884
1884
  ]),
1885
1885
  _: 1
1886
1886
  }),
1887
1887
  r(e(G), {
1888
1888
  type: "primary",
1889
- loading: f.value,
1890
- disabled: S.value.length === 0,
1891
- onClick: y
1889
+ loading: y.value,
1890
+ disabled: z.value.length === 0,
1891
+ onClick: w
1892
1892
  }, {
1893
- default: i(() => [
1894
- V(k(e(o)("tag.merge-confirm")), 1)
1893
+ default: l(() => [
1894
+ C(k(e(u)("tag.merge-confirm")), 1)
1895
1895
  ]),
1896
1896
  _: 1
1897
1897
  }, 8, ["loading", "disabled"])
@@ -1899,60 +1899,60 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1899
1899
  _: 1
1900
1900
  })
1901
1901
  ]),
1902
- default: i(() => [
1902
+ default: l(() => [
1903
1903
  F("div", wa, [
1904
1904
  F("div", xa, [
1905
- (x(!0), H(Te, null, qe(S.value, (U) => (x(), I(e(ae), {
1906
- key: U.id,
1905
+ (_(!0), H(ke, null, qe(z.value, (I) => (_(), q(e(ie), {
1906
+ key: I.id,
1907
1907
  size: "sm",
1908
1908
  round: ""
1909
1909
  }, {
1910
- default: i(() => [
1911
- V(k(U.title) + " · " + k(U.articles_count), 1)
1910
+ default: l(() => [
1911
+ C(k(I.title) + " · " + k(I.articles_count), 1)
1912
1912
  ]),
1913
1913
  _: 2
1914
1914
  }, 1024))), 128)),
1915
- r(e(Ae), {
1915
+ r(e(Te), {
1916
1916
  name: "arrow-right",
1917
1917
  size: "sm"
1918
1918
  }),
1919
- z.value ? (x(), I(e(ae), {
1919
+ V.value ? (_(), q(e(ie), {
1920
1920
  key: 0,
1921
1921
  type: "primary",
1922
1922
  size: "sm",
1923
1923
  round: ""
1924
1924
  }, {
1925
- default: i(() => [
1926
- V(k(z.value.title) + " · " + k(z.value.articles_count), 1)
1925
+ default: l(() => [
1926
+ C(k(V.value.title) + " · " + k(V.value.articles_count), 1)
1927
1927
  ]),
1928
1928
  _: 1
1929
1929
  })) : K("", !0)
1930
1930
  ]),
1931
1931
  r(e(pe), {
1932
- label: e(o)("tag.merge-keep")
1932
+ label: e(u)("tag.merge-keep")
1933
1933
  }, {
1934
- default: i(() => [
1935
- r(e($e), {
1936
- modelValue: b.value,
1937
- "onUpdate:modelValue": N[0] || (N[0] = (U) => b.value = U),
1938
- options: A.value,
1939
- "aria-label": e(o)("tag.merge-keep")
1934
+ default: l(() => [
1935
+ r(e(_e), {
1936
+ modelValue: m.value,
1937
+ "onUpdate:modelValue": N[0] || (N[0] = (I) => m.value = I),
1938
+ options: W.value,
1939
+ "aria-label": e(u)("tag.merge-keep")
1940
1940
  }, null, 8, ["modelValue", "options", "aria-label"])
1941
1941
  ]),
1942
1942
  _: 1
1943
1943
  }, 8, ["label"]),
1944
1944
  F("div", _a, [
1945
1945
  r(e(Wt), {
1946
- modelValue: T.value,
1947
- "onUpdate:modelValue": N[1] || (N[1] = (U) => T.value = U),
1948
- label: e(o)("tag.merge-redirect")
1946
+ modelValue: $.value,
1947
+ "onUpdate:modelValue": N[1] || (N[1] = (I) => $.value = I),
1948
+ label: e(u)("tag.merge-redirect")
1949
1949
  }, null, 8, ["modelValue", "label"]),
1950
- r(e(te), {
1950
+ r(e(le), {
1951
1951
  size: "sm",
1952
1952
  tone: "muted"
1953
1953
  }, {
1954
- default: i(() => [
1955
- V(k(R.value.length === 0 ? e(o)("tag.merge-redirect-none") : e(o)("tag.merge-redirect-help", { addresses: R.value.join(", ") })), 1)
1954
+ default: l(() => [
1955
+ C(k(B.value.length === 0 ? e(u)("tag.merge-redirect-none") : e(u)("tag.merge-redirect-help", { addresses: B.value.join(", ") })), 1)
1956
1956
  ]),
1957
1957
  _: 1
1958
1958
  })
@@ -1960,17 +1960,17 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1960
1960
  r(e(Ue), {
1961
1961
  type: "warning",
1962
1962
  variant: "soft",
1963
- description: e(o)("tag.merge-warning", {
1964
- count: B.value,
1965
- tag: z.value?.title ?? "",
1966
- merged: S.value.length
1963
+ description: e(u)("tag.merge-warning", {
1964
+ count: D.value,
1965
+ tag: V.value?.title ?? "",
1966
+ merged: z.value.length
1967
1967
  })
1968
1968
  }, null, 8, ["description"]),
1969
- m.value ? (x(), I(e(Ue), {
1969
+ d.value ? (_(), q(e(Ue), {
1970
1970
  key: 0,
1971
1971
  type: "danger",
1972
1972
  variant: "soft",
1973
- description: m.value
1973
+ description: d.value
1974
1974
  }, null, 8, ["description"])) : K("", !0)
1975
1975
  ])
1976
1976
  ]),
@@ -1982,23 +1982,23 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
1982
1982
  props: {
1983
1983
  base: { default: "/blog" }
1984
1984
  },
1985
- setup(v) {
1986
- const c = v, p = le(), g = oe(p), a = Ge(), s = je();
1985
+ setup(g) {
1986
+ const c = g, v = ne(), f = ue(v), a = Ge(), s = je();
1987
1987
  X();
1988
- const t = Z("webx-blog"), o = we(), l = M(null), b = M(!0), f = M([]), T = M(!1), m = Ve(ya), A = Ve(ma), z = Ve($a), S = h(() => p.can("blog.taxonomy.manage")), B = h(
1989
- () => p.state.manifest?.modules.find((u) => u.id === "tags")?.title ?? t("module.tags")
1990
- ), R = h({
1988
+ const t = J("webx-blog"), u = J("webx-admin"), i = be(), m = M(null), y = M(!0), $ = M([]), d = M(!1), W = Ve(ya), V = Ve(ma), z = Ve($a), D = h(() => v.can("blog.taxonomy.manage")), B = h(
1989
+ () => v.state.manifest?.modules.find((o) => o.id === "tags")?.title ?? t("module.tags")
1990
+ ), w = h({
1991
1991
  get: () => typeof a.query.view == "string" ? a.query.view : "",
1992
- set: (u) => {
1992
+ set: (o) => {
1993
1993
  s.replace({
1994
- query: { ...a.query, view: u === "" ? void 0 : String(u), page: void 0 }
1994
+ query: { ...a.query, view: o === "" ? void 0 : String(o), page: void 0 }
1995
1995
  });
1996
1996
  }
1997
- }), y = h(() => l.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), W = h(() => [
1998
- { value: "", label: t("tag.view-all"), badge: y.value.total },
1999
- { value: "empty", label: t("tag.view-empty"), badge: y.value.empty },
2000
- { value: "noindex", label: t("tag.view-noindex"), badge: y.value.noindex }
2001
- ]), N = h(() => l.value?.data ?? []), U = h(() => N.value.filter((u) => f.value.includes(u.id))), $ = h(() => [
1997
+ }), T = h(() => m.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), N = h(() => [
1998
+ { value: "", label: t("tag.view-all"), badge: T.value.total },
1999
+ { value: "empty", label: t("tag.view-empty"), badge: T.value.empty },
2000
+ { value: "noindex", label: t("tag.view-noindex"), badge: T.value.noindex }
2001
+ ]), I = h(() => m.value?.data ?? []), b = h(() => I.value.filter((o) => $.value.includes(o.id))), P = h(() => [
2002
2002
  { key: "title", label: t("tag.column-title"), minWidth: 150, sortable: !0 },
2003
2003
  // The number is what the other columns and the narrowest the title may be add up to without
2004
2004
  // this one: below it the address is what does not fit, and a fixed table does not shrink —
@@ -2018,104 +2018,104 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
2018
2018
  { key: "indexing", label: t("tag.column-indexing"), width: 230, hideBelow: 560 },
2019
2019
  { key: "actions", label: "", width: Ye, align: "right" }
2020
2020
  ]);
2021
- function P(u) {
2021
+ function E(o) {
2022
2022
  return {
2023
- q: u?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
2024
- empty: R.value === "empty",
2025
- noindex: R.value === "noindex",
2023
+ q: o?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
2024
+ empty: w.value === "empty",
2025
+ noindex: w.value === "noindex",
2026
2026
  // Only when it is not the default: most used first is what the list is, and a query
2027
2027
  // string that repeats the default is a link that outlives a change of mind about it.
2028
- sort: ie(u),
2029
- page: u?.page ?? (Number(a.query.page ?? 1) || 1),
2030
- per_page: u?.perPage
2028
+ sort: Y(o),
2029
+ page: o?.page ?? (Number(a.query.page ?? 1) || 1),
2030
+ per_page: o?.perPage
2031
2031
  };
2032
2032
  }
2033
- async function E(u) {
2034
- b.value = !0;
2033
+ async function Z(o) {
2034
+ y.value = !0;
2035
2035
  try {
2036
- l.value = await g.tagsPage(P(u));
2037
- } catch (C) {
2038
- D.danger(o(C));
2036
+ m.value = await f.tagsPage(E(o));
2037
+ } catch (A) {
2038
+ R.danger(i(A));
2039
2039
  } finally {
2040
- b.value = !1;
2040
+ y.value = !1;
2041
2041
  }
2042
2042
  }
2043
- function ie(u) {
2044
- const C = u?.sort ?? Y();
2045
- if (!C) return;
2046
- const _ = C.key === "title" ? "name" : "articles", J = `${C.order === "desc" ? "-" : ""}${_}`;
2047
- return J === "articles" ? void 0 : J;
2043
+ function Y(o) {
2044
+ const A = o?.sort ?? se();
2045
+ if (!A) return;
2046
+ const S = A.key === "title" ? "name" : "articles", ee = `${A.order === "desc" ? "-" : ""}${S}`;
2047
+ return ee === "articles" ? void 0 : ee;
2048
2048
  }
2049
- function Y() {
2050
- const u = typeof a.query.sort == "string" ? a.query.sort : "";
2051
- if (u === "") return null;
2052
- const C = u.startsWith("-");
2053
- return { key: (C ? u.slice(1) : u) === "name" ? "title" : "articles_count", order: C ? "desc" : "asc" };
2049
+ function se() {
2050
+ const o = typeof a.query.sort == "string" ? a.query.sort : "";
2051
+ if (o === "") return null;
2052
+ const A = o.startsWith("-");
2053
+ return { key: (A ? o.slice(1) : o) === "name" ? "title" : "articles_count", order: A ? "desc" : "asc" };
2054
2054
  }
2055
- function ne(u) {
2056
- const C = {
2055
+ function re(o) {
2056
+ const A = {
2057
2057
  ...a.query,
2058
- q: u.search === "" ? void 0 : u.search,
2059
- sort: ie(u),
2060
- page: u.page === 1 ? void 0 : String(u.page)
2058
+ q: o.search === "" ? void 0 : o.search,
2059
+ sort: Y(o),
2060
+ page: o.page === 1 ? void 0 : String(o.page)
2061
2061
  };
2062
- s.replace({ query: C }), E(u);
2062
+ s.replace({ query: A }), Z(o);
2063
2063
  }
2064
- ve(R, () => {
2065
- f.value = [], E();
2066
- }), E();
2067
- async function se() {
2068
- await A({}) && await E();
2064
+ ve(w, () => {
2065
+ $.value = [], Z();
2066
+ }), Z();
2067
+ async function O() {
2068
+ await V({}) && await Z();
2069
2069
  }
2070
- async function O(u) {
2071
- const C = await m({ name: u.title });
2072
- C && await xe(u, { title: C }, t("tag.renamed"));
2070
+ async function ye(o) {
2071
+ const A = await W({ name: o.title });
2072
+ A && await te(o, { title: A }, t("tag.renamed"));
2073
2073
  }
2074
- async function he(u, C) {
2075
- await xe(u, { noindex: C }, t(C ? "tag.kept-out" : "tag.indexed"));
2074
+ async function we(o, A) {
2075
+ await te(o, { noindex: A }, t(A ? "tag.kept-out" : "tag.indexed"));
2076
2076
  }
2077
- async function xe(u, C, _) {
2077
+ async function te(o, A, S) {
2078
2078
  try {
2079
- const J = await g.saveTag(u.id, C);
2080
- l.value && (l.value = {
2081
- ...l.value,
2082
- data: l.value.data.map((me) => me.id === J.id ? J : me)
2083
- }), D.success(_);
2084
- } catch (J) {
2085
- D.danger(o(J));
2079
+ const ee = await f.saveTag(o.id, A);
2080
+ m.value && (m.value = {
2081
+ ...m.value,
2082
+ data: m.value.data.map((n) => n.id === ee.id ? ee : n)
2083
+ }), R.success(S);
2084
+ } catch (ee) {
2085
+ R.danger(i(ee));
2086
2086
  }
2087
2087
  }
2088
- async function re(u) {
2088
+ async function fe(o) {
2089
2089
  if (await de({
2090
- title: t("tag.delete-title", { title: u.title }),
2091
- message: u.articles_count > 0 ? t("tag.delete-text-used", { count: u.articles_count }) : t("tag.delete-text"),
2090
+ title: t("tag.delete-title", { title: o.title }),
2091
+ message: o.articles_count > 0 ? t("tag.delete-text-used", { count: o.articles_count }) : t("tag.delete-text"),
2092
2092
  confirmText: t("tag.delete"),
2093
2093
  cancelText: t("tag.cancel"),
2094
2094
  tone: "danger"
2095
2095
  }))
2096
2096
  try {
2097
- await g.removeTag(u.id), D.success(t("tag.deleted")), f.value = f.value.filter((_) => _ !== u.id), await E();
2098
- } catch (_) {
2099
- D.danger(o(_));
2097
+ await f.removeTag(o.id), R.success(t("tag.deleted")), $.value = $.value.filter((S) => S !== o.id), await Z();
2098
+ } catch (S) {
2099
+ R.danger(i(S));
2100
2100
  }
2101
2101
  }
2102
- const fe = h(() => [
2102
+ const Se = h(() => [
2103
2103
  {
2104
2104
  key: "index",
2105
2105
  icon: "eye",
2106
2106
  label: t("tag.index"),
2107
- disabled: T.value,
2107
+ disabled: d.value,
2108
2108
  run: () => {
2109
- ee("index");
2109
+ ae("index");
2110
2110
  }
2111
2111
  },
2112
2112
  {
2113
2113
  key: "noindex",
2114
2114
  icon: "eye-off",
2115
2115
  label: t("tag.noindex"),
2116
- disabled: T.value,
2116
+ disabled: d.value,
2117
2117
  run: () => {
2118
- ee("noindex");
2118
+ ae("noindex");
2119
2119
  }
2120
2120
  },
2121
2121
  {
@@ -2123,241 +2123,243 @@ const Nt = { class: "wx-article-editor__screen" }, qt = 1200, It = /* @__PURE__
2123
2123
  icon: "trash",
2124
2124
  label: t("tag.delete"),
2125
2125
  danger: !0,
2126
- disabled: T.value,
2126
+ disabled: d.value,
2127
2127
  run: () => {
2128
- ee("delete");
2128
+ ae("delete");
2129
2129
  }
2130
2130
  }
2131
2131
  ]);
2132
- function We(u) {
2133
- if (!S.value) return [];
2134
- const C = [
2132
+ function $e(o) {
2133
+ if (!D.value) return [];
2134
+ const A = [
2135
2135
  { key: "rename", icon: "edit", label: t("tag.rename"), run: () => {
2136
- O(u);
2136
+ ye(o);
2137
2137
  } }
2138
2138
  ];
2139
- return u.url && C.push({
2139
+ return o.url && A.push({
2140
2140
  key: "site",
2141
2141
  icon: "external-link",
2142
2142
  label: t("tag.open-on-site"),
2143
- href: u.url
2144
- }), C.push({
2143
+ href: o.url
2144
+ }), A.push({
2145
2145
  key: "articles",
2146
2146
  icon: "list",
2147
2147
  label: t("tag.show-articles"),
2148
2148
  run: () => {
2149
- s.push({ path: `${c.base}/articles`, query: { tag: String(u.id) } });
2149
+ s.push({ path: `${c.base}/articles`, query: { tag: String(o.id) } });
2150
2150
  }
2151
- }), C.push(
2152
- u.noindex ? {
2151
+ }), A.push(
2152
+ o.noindex ? {
2153
2153
  key: "index",
2154
2154
  icon: "eye",
2155
2155
  label: t("tag.index"),
2156
2156
  run: () => {
2157
- he(u, !1);
2157
+ we(o, !1);
2158
2158
  }
2159
2159
  } : {
2160
2160
  key: "noindex",
2161
2161
  icon: "eye-off",
2162
2162
  label: t("tag.noindex"),
2163
2163
  run: () => {
2164
- he(u, !0);
2164
+ we(o, !0);
2165
2165
  }
2166
2166
  }
2167
- ), C.push({
2167
+ ), A.push({
2168
2168
  key: "delete",
2169
2169
  icon: "trash",
2170
2170
  label: t("tag.delete"),
2171
2171
  danger: !0,
2172
2172
  run: () => {
2173
- re(u);
2173
+ fe(o);
2174
2174
  }
2175
- }), C;
2175
+ }), A;
2176
2176
  }
2177
- function _e(u) {
2178
- return u === "noindex" ? "muted" : "success";
2177
+ function oe(o) {
2178
+ return o === "noindex" ? "muted" : "success";
2179
2179
  }
2180
- async function ue() {
2181
- if (U.value.length < 2) return;
2182
- const u = await z({ tags: U.value });
2183
- u && (D.success(t("tag.merged", { tag: u.tag.title, count: u.articles_count })), f.value = [], await E());
2180
+ async function ce() {
2181
+ if (b.value.length < 2) return;
2182
+ const o = await z({ tags: b.value });
2183
+ o && (R.success(t("tag.merged", { tag: o.tag.title, count: o.articles_count })), $.value = [], await Z());
2184
2184
  }
2185
- async function ee(u) {
2186
- const C = U.value.map((_) => _.id);
2187
- if (!(C.length === 0 || T.value)) {
2188
- if (u === "delete") {
2189
- const _ = U.value.reduce((me, n) => me + n.articles_count, 0);
2185
+ async function ae(o) {
2186
+ const A = b.value.map((S) => S.id);
2187
+ if (!(A.length === 0 || d.value)) {
2188
+ if (o === "delete") {
2189
+ const S = b.value.reduce((n, U) => n + U.articles_count, 0);
2190
2190
  if (!await de({
2191
- title: t("tag.delete-many-title", { count: C.length }),
2192
- message: _ > 0 ? t("tag.delete-many-text-used", { count: _ }) : t("tag.delete-many-text"),
2191
+ title: t("tag.delete-many-title", { count: A.length }),
2192
+ message: S > 0 ? t("tag.delete-many-text-used", { count: S }) : t("tag.delete-many-text"),
2193
2193
  confirmText: t("tag.delete"),
2194
2194
  cancelText: t("tag.cancel"),
2195
2195
  tone: "danger"
2196
2196
  })) return;
2197
2197
  }
2198
- T.value = !0;
2198
+ d.value = !0;
2199
2199
  try {
2200
- const _ = await g.massTags(C, u);
2201
- D.success(
2202
- u === "delete" ? t("tag.deleted-many", { count: _ }) : u === "index" ? t("tag.indexed-many", { count: _ }) : t("tag.kept-out-many", { count: _ })
2203
- ), f.value = [], await E();
2204
- } catch (_) {
2205
- D.danger(o(_));
2200
+ const S = await f.massTags(A, o);
2201
+ R.success(
2202
+ o === "delete" ? t("tag.deleted-many", { count: S }) : o === "index" ? t("tag.indexed-many", { count: S }) : t("tag.kept-out-many", { count: S })
2203
+ ), $.value = [], await Z();
2204
+ } catch (S) {
2205
+ R.danger(i(S));
2206
2206
  } finally {
2207
- T.value = !1;
2207
+ d.value = !1;
2208
2208
  }
2209
2209
  }
2210
2210
  }
2211
- const ce = h(
2212
- () => S.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2213
- se();
2211
+ const We = h(
2212
+ () => D.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2213
+ O();
2214
2214
  } }] : []
2215
2215
  );
2216
- return (u, C) => (x(), H("div", Ta, [
2216
+ return (o, A) => (_(), H("div", Ta, [
2217
2217
  r(e(et), {
2218
- view: R.value,
2219
- "onUpdate:view": C[1] || (C[1] = (_) => R.value = _),
2218
+ view: w.value,
2219
+ "onUpdate:view": A[1] || (A[1] = (S) => w.value = S),
2220
2220
  title: B.value,
2221
- views: W.value,
2222
- actions: ce.value
2221
+ views: N.value,
2222
+ actions: We.value
2223
2223
  }, {
2224
- default: i(() => [
2224
+ default: l(() => [
2225
2225
  r(e(it), {
2226
- selected: f.value,
2227
- "onUpdate:selected": C[0] || (C[0] = (_) => f.value = _),
2228
- data: l.value,
2229
- columns: $.value,
2226
+ selected: $.value,
2227
+ "onUpdate:selected": A[0] || (A[0] = (S) => $.value = S),
2228
+ data: m.value,
2229
+ columns: P.value,
2230
2230
  "row-key": "id",
2231
2231
  searchable: "",
2232
2232
  hover: "",
2233
2233
  flush: "",
2234
2234
  layout: "fixed",
2235
- loading: b.value,
2236
- selectable: S.value,
2235
+ loading: y.value,
2236
+ selectable: D.value,
2237
+ "select-row-label": e(u)("filters.select-row"),
2238
+ "select-all-label": e(u)("filters.select-all"),
2237
2239
  "cards-below": 0,
2238
2240
  "search-placeholder": e(t)("tag.search"),
2239
- "empty-text": N.value.length === 0 && !b.value ? e(t)("tag.empty") : void 0,
2241
+ "empty-text": I.value.length === 0 && !y.value ? e(t)("tag.empty") : void 0,
2240
2242
  "aria-label": B.value,
2241
- onStateChange: ne
2243
+ onStateChange: re
2242
2244
  }, {
2243
- "cell-title": i(({ row: _ }) => [
2244
- r(e(te), { truncate: "" }, {
2245
- default: i(() => [
2246
- V(k(_.title), 1)
2245
+ "cell-title": l(({ row: S }) => [
2246
+ r(e(le), { truncate: "" }, {
2247
+ default: l(() => [
2248
+ C(k(S.title), 1)
2247
2249
  ]),
2248
2250
  _: 2
2249
2251
  }, 1024)
2250
2252
  ]),
2251
- "cell-path": i(({ row: _ }) => [
2252
- r(e(te), {
2253
+ "cell-path": l(({ row: S }) => [
2254
+ r(e(le), {
2253
2255
  size: "sm",
2254
2256
  tone: "muted",
2255
2257
  mono: "",
2256
2258
  truncate: ""
2257
2259
  }, {
2258
- default: i(() => [
2259
- V(k(_.path ?? e(t)("tag.no-address")), 1)
2260
+ default: l(() => [
2261
+ C(k(S.path ?? e(t)("tag.no-address")), 1)
2260
2262
  ]),
2261
2263
  _: 2
2262
2264
  }, 1024)
2263
2265
  ]),
2264
- "cell-articles_count": i(({ row: _ }) => [
2265
- r(e(te), {
2266
- tone: _.articles_count === 0 ? "muted" : "default"
2266
+ "cell-articles_count": l(({ row: S }) => [
2267
+ r(e(le), {
2268
+ tone: S.articles_count === 0 ? "muted" : "default"
2267
2269
  }, {
2268
- default: i(() => [
2269
- V(k(_.articles_count), 1)
2270
+ default: l(() => [
2271
+ C(k(S.articles_count), 1)
2270
2272
  ]),
2271
2273
  _: 2
2272
2274
  }, 1032, ["tone"])
2273
2275
  ]),
2274
- "cell-indexing": i(({ row: _ }) => [
2275
- _.indexing === "rule" ? (x(), I(e(nt), {
2276
+ "cell-indexing": l(({ row: S }) => [
2277
+ S.indexing === "rule" ? (_(), q(e(nt), {
2276
2278
  key: 0,
2277
2279
  content: e(t)("tag.indexing-rule-help")
2278
2280
  }, {
2279
- default: i(() => [
2280
- r(e(te), {
2281
+ default: l(() => [
2282
+ r(e(le), {
2281
2283
  size: "sm",
2282
- tone: _e(_.indexing)
2284
+ tone: oe(S.indexing)
2283
2285
  }, {
2284
- default: i(() => [
2285
- V(k(e(t)("tag.indexing-rule")), 1)
2286
+ default: l(() => [
2287
+ C(k(e(t)("tag.indexing-rule")), 1)
2286
2288
  ]),
2287
2289
  _: 1
2288
2290
  }, 8, ["tone"])
2289
2291
  ]),
2290
2292
  _: 2
2291
- }, 1032, ["content"])) : (x(), I(e(te), {
2293
+ }, 1032, ["content"])) : (_(), q(e(le), {
2292
2294
  key: 1,
2293
2295
  size: "sm",
2294
- tone: _e(_.indexing)
2296
+ tone: oe(S.indexing)
2295
2297
  }, {
2296
- default: i(() => [
2297
- V(k(e(t)(`tag.indexing-${_.indexing}`)), 1)
2298
+ default: l(() => [
2299
+ C(k(e(t)(`tag.indexing-${S.indexing}`)), 1)
2298
2300
  ]),
2299
2301
  _: 2
2300
2302
  }, 1032, ["tone"]))
2301
2303
  ]),
2302
- "cell-actions": i(({ row: _ }) => [
2304
+ "cell-actions": l(({ row: S }) => [
2303
2305
  r(e(ze), {
2304
- actions: We(_),
2305
- label: _.title
2306
+ actions: $e(S),
2307
+ label: S.title
2306
2308
  }, null, 8, ["actions", "label"])
2307
2309
  ]),
2308
2310
  _: 1
2309
- }, 8, ["selected", "data", "columns", "loading", "selectable", "search-placeholder", "empty-text", "aria-label"])
2311
+ }, 8, ["selected", "data", "columns", "loading", "selectable", "select-row-label", "select-all-label", "search-placeholder", "empty-text", "aria-label"])
2310
2312
  ]),
2311
2313
  _: 1
2312
2314
  }, 8, ["view", "title", "views", "actions"]),
2313
- U.value.length > 0 ? (x(), I(e(lt), {
2315
+ b.value.length > 0 ? (_(), q(e(lt), {
2314
2316
  key: 0,
2315
2317
  class: "wx-tags__bar",
2316
2318
  sticky: ""
2317
2319
  }, {
2318
- state: i(() => [
2319
- r(e(te), { weight: "medium" }, {
2320
- default: i(() => [
2321
- V(k(e(t)("tag.selected", { count: U.value.length })), 1)
2320
+ state: l(() => [
2321
+ r(e(le), { weight: "medium" }, {
2322
+ default: l(() => [
2323
+ C(k(e(t)("tag.selected", { count: b.value.length })), 1)
2322
2324
  ]),
2323
2325
  _: 1
2324
2326
  })
2325
2327
  ]),
2326
- default: i(() => [
2328
+ default: l(() => [
2327
2329
  r(e(G), {
2328
2330
  type: "primary",
2329
- disabled: U.value.length < 2 || T.value,
2330
- onClick: ue
2331
+ disabled: b.value.length < 2 || d.value,
2332
+ onClick: ce
2331
2333
  }, {
2332
- icon: i(() => [
2333
- r(e(Ae), { name: "link" })
2334
+ icon: l(() => [
2335
+ r(e(Te), { name: "link" })
2334
2336
  ]),
2335
- default: i(() => [
2336
- V(" " + k(e(t)("tag.merge")), 1)
2337
+ default: l(() => [
2338
+ C(" " + k(e(t)("tag.merge")), 1)
2337
2339
  ]),
2338
2340
  _: 1
2339
2341
  }, 8, ["disabled"]),
2340
2342
  r(e(ze), {
2341
2343
  size: "lg",
2342
- actions: fe.value,
2343
- label: e(t)("tag.selected", { count: U.value.length })
2344
+ actions: Se.value,
2345
+ label: e(t)("tag.selected", { count: b.value.length })
2344
2346
  }, null, 8, ["actions", "label"])
2345
2347
  ]),
2346
2348
  _: 1
2347
2349
  })) : K("", !0)
2348
2350
  ]));
2349
2351
  }
2350
- }), Sa = /* @__PURE__ */ ge(Aa, [["__scopeId", "data-v-beb86d88"]]);
2351
- function Wa(v = "/blog") {
2352
+ }), Sa = /* @__PURE__ */ ge(Aa, [["__scopeId", "data-v-d9b8d73d"]]);
2353
+ function Wa(g = "/blog") {
2352
2354
  return {
2353
2355
  api: "blog/rubrics",
2354
- path: `${v}/rubrics`,
2356
+ path: `${g}/rubrics`,
2355
2357
  name: "webx.blog.rubrics",
2356
2358
  module: "rubrics",
2357
2359
  screen: "blog.category-form",
2358
2360
  manage: "blog.taxonomy.manage",
2359
2361
  count: "articles_count",
2360
- items: (c) => ({ path: `${v}/articles`, query: { rubric: String(c) } }),
2362
+ items: (c) => ({ path: `${g}/articles`, query: { rubric: String(c) } }),
2361
2363
  words: {
2362
2364
  new: "webx-blog::rubric.new",
2363
2365
  empty: "webx-blog::rubric.empty",
@@ -2377,8 +2379,8 @@ function Wa(v = "/blog") {
2377
2379
  }
2378
2380
  };
2379
2381
  }
2380
- function Na(v = {}) {
2381
- const c = v.path ?? "/blog";
2382
+ function Na(g = {}) {
2383
+ const c = g.path ?? "/blog";
2382
2384
  return [
2383
2385
  {
2384
2386
  id: "articles",
@@ -2389,7 +2391,7 @@ function Na(v = {}) {
2389
2391
  {
2390
2392
  path: `${c}/articles`,
2391
2393
  name: "webx.blog.articles",
2392
- component: fa,
2394
+ component: ha,
2393
2395
  props: { base: c }
2394
2396
  },
2395
2397
  {
@@ -2452,16 +2454,16 @@ export {
2452
2454
  Xt as WxArticleSlug,
2453
2455
  ia as WxArticleTags,
2454
2456
  sa as WxArticleUnpublish,
2455
- fa as WxArticlesPage,
2457
+ ha as WxArticlesPage,
2456
2458
  ma as WxTagCreateDialog,
2457
2459
  $a as WxTagMergeDialog,
2458
2460
  Sa as WxTagsPage,
2459
2461
  st as articleEditorKey,
2460
2462
  Na as blog,
2461
2463
  Mt as blogMessages,
2462
- oe as createBlogApi,
2464
+ ue as createBlogApi,
2463
2465
  zt as provideArticleEditor,
2464
2466
  Wa as rubricsOptions,
2465
- Se as useArticleEditor
2467
+ Ae as useArticleEditor
2466
2468
  };
2467
2469
  //# sourceMappingURL=index.js.map