@webx-ui/module-vacancies 0.1.7 → 0.1.8

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,53 +1,53 @@
1
- import { reorderItems as Ke, useAdmin as oe, useTranslate as ue, useErrorText as ke, WxListScreen as je, WxFilterChips as Ye, WxRowMenu as Ge, useDates as Je, provideRelationOwner as Qe, provideRecordAddress as Xe, WxScreenHead as Ze, WxScreen as et, WxSaveState as tt, WxDate as at, categoryRoutes as nt } from "@webx-ui/module-admin";
2
- import { defineComponent as de, ref as $, useTemplateRef as lt, onMounted as Re, nextTick as st, openBlock as f, createBlock as V, unref as e, isRef as it, withCtx as i, createVNode as d, createElementVNode as O, withKeys as ot, createTextVNode as k, toDisplayString as g, computed as h, watch as ie, onBeforeUnmount as Se, createElementBlock as z, createCommentVNode as R, Fragment as ee, normalizeClass as qe, resolveDynamicComponent as rt, mergeProps as ct, renderList as De, provide as ut, inject as dt } from "vue";
3
- import { useRoute as Ee, useRouter as Oe, onBeforeRouteLeave as pt } from "vue-router";
4
- import { useModal as vt, WxDialog as ht, WxFormItem as xe, WxInput as Pe, WxSpace as yt, WxButton as K, createModal as ft, WxIcon as se, WxPopover as mt, WxSelect as Ve, WxIndicator as gt, WxAction as wt, WxSkeleton as ce, WxEmpty as ze, WxSortableList as bt, WxTooltip as We, WxBadge as Y, WxAlert as Ae, toast as _, confirm as G, useLocales as _t, localizedValue as xt, WxCard as kt, WxBreadcrumb as Tt, WxBreadcrumbItem as Ce, WxActionBar as $t, WxText as Vt } from "@webx-ui/core";
5
- const Ie = "vacancies";
6
- function pe(r) {
7
- const c = `${r.apiPath}/${Ie}`, y = (n) => n.data, p = (n, m) => r.http.post(`${c}/${n}/${m}`, {}).then(y);
1
+ import { reorderItems as Ke, useAdmin as ce, useTranslate as oe, useErrorText as Ve, WxListScreen as je, WxFilterChips as Ye, WxRowMenu as Ge, WxAddressNote as Je, useDates as Qe, provideRelationOwner as Xe, provideRecordAddress as Ze, WxScreenHead as et, WxScreen as tt, WxSaveState as at, WxDate as nt, categoryRoutes as lt } from "@webx-ui/module-admin";
2
+ import { defineComponent as pe, ref as W, useTemplateRef as st, onMounted as Ee, nextTick as it, openBlock as y, createBlock as $, unref as e, isRef as ot, withCtx as i, createVNode as p, createElementVNode as A, withKeys as rt, createTextVNode as x, toDisplayString as g, computed as h, watch as re, onBeforeUnmount as Oe, createElementBlock as z, createCommentVNode as R, Fragment as ne, normalizeClass as De, resolveDynamicComponent as ct, mergeProps as ut, renderList as Ae, provide as dt, inject as pt } from "vue";
3
+ import { useRoute as Pe, useRouter as ze, onBeforeRouteLeave as vt } from "vue-router";
4
+ import { useModal as ht, WxDialog as yt, WxFormItem as $e, WxInput as Me, WxSpace as ft, WxButton as K, createModal as mt, WxIcon as ie, WxPopover as gt, WxSelect as Ie, WxIndicator as bt, WxAction as wt, WxSkeleton as de, WxEmpty as Le, WxSortableList as _t, WxTooltip as Ne, WxBadge as J, WxAlert as Fe, toast as _, confirm as j, useLocales as xt, localizedValue as kt, WxCard as Tt, WxBreadcrumb as $t, WxBreadcrumbItem as Re, WxActionBar as Vt, WxText as Wt } from "@webx-ui/core";
5
+ const Se = "vacancies";
6
+ function ve(c) {
7
+ const u = `${c.apiPath}/${Se}`, f = (n) => n.data, v = (n, m) => c.http.post(`${u}/${n}/${m}`, {}).then(f);
8
8
  return {
9
9
  list: (n = {}) => {
10
10
  const m = new URLSearchParams();
11
- return n.trashed ? m.set("trashed", "1") : m.set("state", n.state ?? "open"), n.q && m.set("q", n.q), n.category != null && m.set("category", String(n.category)), n.status && m.set("status", n.status), r.http.get(`${c}?${m}`);
11
+ return n.trashed ? m.set("trashed", "1") : m.set("state", n.state ?? "open"), n.q && m.set("q", n.q), n.category != null && m.set("category", String(n.category)), n.status && m.set("status", n.status), c.http.get(`${u}?${m}`);
12
12
  },
13
- get: (n) => r.http.get(`${c}/${n}`).then(y),
14
- create: (n) => r.http.post(c, n).then(y),
15
- save: (n, m) => r.http.put(`${c}/${n}`, m).then(y),
16
- discard: (n) => r.http.post(`${c}/${n}/discard`, {}).then(y),
17
- duplicate: (n) => r.http.post(`${c}/${n}/duplicate`, {}).then(y),
18
- publish: (n) => p(n, "publish"),
19
- unpublish: (n) => p(n, "unpublish"),
20
- close: (n) => p(n, "close"),
21
- reopen: (n) => p(n, "reopen"),
22
- remove: (n) => r.http.delete(`${c}/${n}`).then(() => {
13
+ get: (n) => c.http.get(`${u}/${n}`).then(f),
14
+ create: (n) => c.http.post(u, n).then(f),
15
+ save: (n, m) => c.http.put(`${u}/${n}`, m).then(f),
16
+ discard: (n) => c.http.post(`${u}/${n}/discard`, {}).then(f),
17
+ duplicate: (n) => c.http.post(`${u}/${n}/duplicate`, {}).then(f),
18
+ publish: (n) => v(n, "publish"),
19
+ unpublish: (n) => v(n, "unpublish"),
20
+ close: (n) => v(n, "close"),
21
+ reopen: (n) => v(n, "reopen"),
22
+ remove: (n) => c.http.delete(`${u}/${n}`).then(() => {
23
23
  }),
24
- restore: (n) => p(n, "restore"),
24
+ restore: (n) => v(n, "restore"),
25
25
  // No `category`, ever: vacancies have one order (§4.11), unlike services.
26
- reorder: (n) => Ke(r, Ie, n, null),
27
- versions: (n) => r.http.get(`${c}/${n}/versions`).then(y),
28
- restoreVersion: (n, m) => r.http.post(`${c}/${n}/versions/${m}/restore`, {}).then(y)
26
+ reorder: (n) => Ke(c, Se, n, null),
27
+ versions: (n) => c.http.get(`${u}/${n}/versions`).then(f),
28
+ restoreVersion: (n, m) => c.http.post(`${u}/${n}/versions/${m}/restore`, {}).then(f)
29
29
  };
30
30
  }
31
- const Wt = /^(\d{4})-(\d{2})-(\d{2})$/;
32
- function Me(r) {
33
- const c = typeof r == "string" ? Wt.exec(r.slice(0, 10)) : null;
34
- if (c === null) return null;
35
- const [, y, p, n] = c, m = new Date(Number(y), Number(p) - 1, Number(n));
31
+ const Ct = /^(\d{4})-(\d{2})-(\d{2})$/;
32
+ function Ue(c) {
33
+ const u = typeof c == "string" ? Ct.exec(c.slice(0, 10)) : null;
34
+ if (u === null) return null;
35
+ const [, f, v, n] = u, m = new Date(Number(f), Number(v) - 1, Number(n));
36
36
  return Number.isNaN(m.getTime()) ? null : m;
37
37
  }
38
- function Ct(r, c, y = /* @__PURE__ */ new Date()) {
39
- const p = Me(r);
40
- return p === null ? "" : new Intl.DateTimeFormat(c, {
38
+ function It(c, u, f = /* @__PURE__ */ new Date()) {
39
+ const v = Ue(c);
40
+ return v === null ? "" : new Intl.DateTimeFormat(u, {
41
41
  day: "numeric",
42
42
  month: "short",
43
- ...p.getFullYear() === y.getFullYear() ? {} : { year: "numeric" }
44
- }).format(p);
43
+ ...v.getFullYear() === f.getFullYear() ? {} : { year: "numeric" }
44
+ }).format(v);
45
45
  }
46
- function Le(r, c) {
47
- const y = Me(r);
48
- return y === null ? "" : new Intl.DateTimeFormat(c, { day: "numeric", month: "long", year: "numeric" }).format(y);
46
+ function Be(c, u) {
47
+ const f = Ue(c);
48
+ return f === null ? "" : new Intl.DateTimeFormat(u, { day: "numeric", month: "long", year: "numeric" }).format(f);
49
49
  }
50
- const It = {
50
+ const Nt = {
51
51
  module: {
52
52
  group: "Vacancies",
53
53
  vacancies: "Vacancies",
@@ -130,8 +130,6 @@ const It = {
130
130
  "publish-nowhere": "It has no address in this language yet, so nothing will answer.",
131
131
  preview: "Preview",
132
132
  discard: "Discard changes",
133
- "discard-title": "Discard what is waiting?",
134
- "discard-text": "The vacancy goes back to what the site is showing. What was written since is not listed anywhere.",
135
133
  discarded: "The vacancy is back to what is published.",
136
134
  "conflict-title": "The vacancy changed while you were editing",
137
135
  "conflict-mine": "Keep mine",
@@ -190,64 +188,64 @@ const It = {
190
188
  }
191
189
  }
192
190
  };
193
- function Nt(r) {
194
- return `vacancy.employment.${r}`;
191
+ function Rt(c) {
192
+ return `vacancy.employment.${c}`;
195
193
  }
196
- const Ne = /* @__PURE__ */ new WeakSet();
197
- function ve() {
194
+ const qe = /* @__PURE__ */ new WeakSet();
195
+ function he() {
198
196
  try {
199
- const { i18n: r } = oe();
200
- Ne.has(r) || (r.defaults("webx-vacancies", It), Ne.add(r));
197
+ const { i18n: c } = ce();
198
+ qe.has(c) || (c.defaults("webx-vacancies", Nt), qe.add(c));
201
199
  } catch {
202
200
  }
203
201
  }
204
- const Rt = /* @__PURE__ */ de({
202
+ const St = /* @__PURE__ */ pe({
205
203
  __name: "VacancyCreateDialog",
206
- setup(r) {
207
- const { open: c, resolve: y, dismiss: p } = vt(), n = oe(), m = pe(n);
208
- ve();
209
- const a = ue("webx-vacancies"), C = $(""), l = $(!1), N = $({}), q = lt("field");
210
- Re(async () => {
211
- await st(), q.value?.querySelector("input")?.focus();
204
+ setup(c) {
205
+ const { open: u, resolve: f, dismiss: v } = ht(), n = ce(), m = ve(n);
206
+ he();
207
+ const a = oe("webx-vacancies"), I = W(""), l = W(!1), k = W({}), C = st("field");
208
+ Ee(async () => {
209
+ await it(), C.value?.querySelector("input")?.focus();
212
210
  });
213
- async function A() {
214
- if (!(C.value.trim() === "" || l.value)) {
215
- l.value = !0, N.value = {};
211
+ async function F() {
212
+ if (!(I.value.trim() === "" || l.value)) {
213
+ l.value = !0, k.value = {};
216
214
  try {
217
- y((await m.create({ title: C.value.trim() })).vacancy);
218
- } catch (v) {
219
- N.value = v.body?.errors ?? {};
215
+ f((await m.create({ title: I.value.trim() })).vacancy);
216
+ } catch (q) {
217
+ k.value = q.body?.errors ?? {};
220
218
  } finally {
221
219
  l.value = !1;
222
220
  }
223
221
  }
224
222
  }
225
- return (v, w) => (f(), V(e(ht), {
226
- open: e(c),
227
- "onUpdate:open": w[2] || (w[2] = (W) => it(c) ? c.value = W : null),
223
+ return (q, o) => (y(), $(e(yt), {
224
+ open: e(u),
225
+ "onUpdate:open": o[2] || (o[2] = (T) => ot(u) ? u.value = T : null),
228
226
  title: e(a)("panel.new-title"),
229
227
  width: 440
230
228
  }, {
231
229
  footer: i(() => [
232
- d(e(yt), { size: "sm" }, {
230
+ p(e(ft), { size: "sm" }, {
233
231
  default: i(() => [
234
- d(e(K), {
232
+ p(e(K), {
235
233
  variant: "outline",
236
- onClick: w[1] || (w[1] = (W) => e(p)())
234
+ onClick: o[1] || (o[1] = (T) => e(v)())
237
235
  }, {
238
236
  default: i(() => [
239
- k(g(e(a)("panel.cancel")), 1)
237
+ x(g(e(a)("panel.cancel")), 1)
240
238
  ]),
241
239
  _: 1
242
240
  }),
243
- d(e(K), {
241
+ p(e(K), {
244
242
  type: "primary",
245
243
  loading: l.value,
246
- disabled: C.value.trim() === "",
247
- onClick: A
244
+ disabled: I.value.trim() === "",
245
+ onClick: F
248
246
  }, {
249
247
  default: i(() => [
250
- k(g(e(a)("panel.create")), 1)
248
+ x(g(e(a)("panel.create")), 1)
251
249
  ]),
252
250
  _: 1
253
251
  }, 8, ["loading", "disabled"])
@@ -256,21 +254,21 @@ const Rt = /* @__PURE__ */ de({
256
254
  })
257
255
  ]),
258
256
  default: i(() => [
259
- d(e(xe), {
257
+ p(e($e), {
260
258
  label: e(a)("panel.field-title"),
261
- error: N.value.title?.[0] ?? N.value.slug?.[0],
259
+ error: k.value.title?.[0] ?? k.value.slug?.[0],
262
260
  required: ""
263
261
  }, {
264
262
  default: i(() => [
265
- O("div", {
263
+ A("div", {
266
264
  ref_key: "field",
267
- ref: q
265
+ ref: C
268
266
  }, [
269
- d(e(Pe), {
270
- modelValue: C.value,
271
- "onUpdate:modelValue": w[0] || (w[0] = (W) => C.value = W),
267
+ p(e(Me), {
268
+ modelValue: I.value,
269
+ "onUpdate:modelValue": o[0] || (o[0] = (T) => I.value = T),
272
270
  "aria-label": e(a)("panel.field-title"),
273
- onKeyup: ot(A, ["enter"])
271
+ onKeyup: rt(F, ["enter"])
274
272
  }, null, 8, ["modelValue", "aria-label"])
275
273
  ], 512)
276
274
  ]),
@@ -280,128 +278,128 @@ const Rt = /* @__PURE__ */ de({
280
278
  _: 1
281
279
  }, 8, ["open", "title"]));
282
280
  }
283
- }), St = { class: "wx-vacancies" }, qt = { class: "wx-vacancies__bar" }, Dt = { class: "wx-vacancies__filters" }, Et = {
281
+ }), qt = { class: "wx-vacancies" }, Et = { class: "wx-vacancies__bar" }, Ot = { class: "wx-vacancies__filters" }, Dt = {
284
282
  key: 0,
285
283
  class: "wx-vacancies__applied"
286
- }, Ot = { class: "wx-vacancy-row__name" }, Pt = { class: "wx-vacancy-row__title" }, zt = { class: "wx-vacancy-row__address" }, At = { class: "wx-vacancy-row__facts" }, Mt = { class: "wx-vacancy-row__where" }, Lt = {
284
+ }, At = { class: "wx-vacancy-row__name" }, Pt = { class: "wx-vacancy-row__title" }, zt = { class: "wx-vacancy-row__address" }, Mt = { class: "wx-vacancy-row__facts" }, Lt = { class: "wx-vacancy-row__where" }, Ft = {
287
285
  key: 0,
288
286
  class: "wx-vacancy-row__employment"
289
- }, Ft = { class: "wx-vacancy-row__until" }, Ut = { class: "wx-vacancy-row__state" }, Bt = /* @__PURE__ */ de({
287
+ }, Ut = { class: "wx-vacancy-row__until" }, Bt = { class: "wx-vacancy-row__state" }, Ht = /* @__PURE__ */ pe({
290
288
  __name: "VacanciesPage",
291
289
  props: {
292
290
  base: { default: "/vacancies" }
293
291
  },
294
- setup(r) {
295
- const c = r, y = oe(), p = pe(y), n = Ee(), m = Oe();
296
- ve();
297
- const a = ue("webx-vacancies"), C = ke(), l = $([]), N = $({ categories: [] }), q = $(!0), A = ft(Rt), v = h(() => y.can("vacancies.manage")), w = h(
298
- () => y.state.manifest?.modules.find((t) => t.id === "vacancies")?.title ?? a("module.vacancies")
299
- ), W = h(() => y.i18n.state.locale), b = h({
292
+ setup(c) {
293
+ const u = c, f = ce(), v = ve(f), n = Pe(), m = ze();
294
+ he();
295
+ const a = oe("webx-vacancies"), I = Ve(), l = W([]), k = W({ categories: [] }), C = W(!0), F = mt(St), q = h(() => f.can("vacancies.manage")), o = h(
296
+ () => f.state.manifest?.modules.find((t) => t.id === "vacancies")?.title ?? a("module.vacancies")
297
+ ), T = h(() => f.i18n.state.locale), b = h({
300
298
  get: () => typeof n.query.view == "string" ? n.query.view : "",
301
299
  set: (t) => {
302
300
  m.replace({
303
301
  query: { ...n.query, view: t === "" ? void 0 : String(t) }
304
302
  });
305
303
  }
306
- }), T = h(() => b.value === "trashed"), M = h(() => b.value === "closed" ? "closed" : b.value === "all" ? "all" : "open"), P = h(() => {
304
+ }), V = h(() => b.value === "trashed"), M = h(() => b.value === "closed" ? "closed" : b.value === "all" ? "all" : "open"), U = h(() => {
307
305
  const t = n.query.category;
308
306
  return typeof t == "string" && t !== "" && Number(t) || null;
309
- }), I = h(
307
+ }), E = h(
310
308
  () => typeof n.query.status == "string" ? n.query.status : ""
311
- ), F = h(() => typeof n.query.q == "string" ? n.query.q : ""), S = $(F.value), Z = h(() => [
309
+ ), N = h(() => typeof n.query.q == "string" ? n.query.q : ""), Q = W(N.value), D = h(() => [
312
310
  { value: "", label: a("panel.view-open") },
313
311
  { value: "closed", label: a("panel.view-closed") },
314
312
  { value: "all", label: a("panel.view-all") },
315
313
  { value: "trashed", label: a("panel.bin"), icon: "trash" }
316
- ]), U = h(
314
+ ]), te = h(
317
315
  () => ["published", "draft", "unpublished"].map((t) => ({
318
316
  value: t,
319
317
  label: a(`panel.status-${t}`)
320
318
  }))
321
- ), te = h(
322
- () => F.value.trim() === "" && P.value === null && I.value === ""
323
- ), J = h(() => M.value !== "closed" && !T.value), D = h(() => v.value && J.value && te.value), he = h(() => J.value ? a(te.value ? "panel.order-all" : "panel.order-locked") : a("panel.order-closed")), ae = h(() => F.value !== "" ? a("panel.empty-search") : T.value ? a("panel.empty-bin") : M.value === "closed" ? a("panel.empty-closed") : M.value === "all" ? a("panel.empty") : a("panel.empty-open")), Q = h(() => {
319
+ ), P = h(
320
+ () => N.value.trim() === "" && U.value === null && E.value === ""
321
+ ), ue = h(() => M.value !== "closed" && !V.value), X = h(() => q.value && ue.value && P.value), O = h(() => ue.value ? a(P.value ? "panel.order-all" : "panel.order-locked") : a("panel.order-closed")), ye = h(() => N.value !== "" ? a("panel.empty-search") : V.value ? a("panel.empty-bin") : M.value === "closed" ? a("panel.empty-closed") : M.value === "all" ? a("panel.empty") : a("panel.empty-open")), B = h(() => {
324
322
  const t = [];
325
- I.value !== "" && t.push({
323
+ E.value !== "" && t.push({
326
324
  key: "status",
327
- label: `${a("panel.filter-status")}: ${a(`panel.status-${I.value}`)}`,
325
+ label: `${a("panel.filter-status")}: ${a(`panel.status-${E.value}`)}`,
328
326
  clear: () => L("status", void 0)
329
327
  });
330
- const u = N.value.categories.find((o) => o.id === P.value);
331
- return u && t.push({
328
+ const d = k.value.categories.find((r) => r.id === U.value);
329
+ return d && t.push({
332
330
  key: "category",
333
- label: `${a("panel.filter-category")}: ${u.title}`,
331
+ label: `${a("panel.filter-category")}: ${d.title}`,
334
332
  clear: () => L("category", void 0)
335
333
  }), t;
336
334
  });
337
- async function j() {
338
- q.value = !0;
335
+ async function Z() {
336
+ C.value = !0;
339
337
  try {
340
- const t = await p.list({
338
+ const t = await v.list({
341
339
  state: M.value,
342
- q: F.value,
343
- category: P.value,
344
- status: T.value ? "" : I.value,
345
- trashed: T.value
340
+ q: N.value,
341
+ category: U.value,
342
+ status: V.value ? "" : E.value,
343
+ trashed: V.value
346
344
  });
347
- l.value = t.data, N.value = t.filters;
345
+ l.value = t.data, k.value = t.filters;
348
346
  } catch (t) {
349
- _.danger(C(t));
347
+ _.danger(I(t));
350
348
  } finally {
351
- q.value = !1;
349
+ C.value = !1;
352
350
  }
353
351
  }
354
- ie([b, P, I, F], () => {
355
- j();
356
- }), j();
357
- let B;
358
- ie(S, (t) => {
359
- clearTimeout(B), B = setTimeout(() => {
352
+ re([b, U, E, N], () => {
353
+ Z();
354
+ }), Z();
355
+ let ae;
356
+ re(Q, (t) => {
357
+ clearTimeout(ae), ae = setTimeout(() => {
360
358
  m.replace({ query: { ...n.query, q: t.trim() === "" ? void 0 : t } });
361
359
  }, 300);
362
- }), Se(() => clearTimeout(B));
363
- function L(t, u) {
360
+ }), Oe(() => clearTimeout(ae));
361
+ function L(t, d) {
364
362
  m.replace({
365
363
  query: {
366
364
  ...n.query,
367
- [t]: typeof u == "number" || typeof u == "string" && u !== "" ? String(u) : void 0
365
+ [t]: typeof d == "number" || typeof d == "string" && d !== "" ? String(d) : void 0
368
366
  }
369
367
  });
370
368
  }
371
- function ye() {
369
+ function ee() {
372
370
  const t = { ...n.query };
373
371
  delete t.category, delete t.status, m.replace({ query: t });
374
372
  }
375
- function ne(t) {
376
- m.push({ path: `${c.base}/${t.id}`, query: { ...n.query } });
377
- }
378
- async function H() {
379
- const t = await A({});
380
- t && ne(t);
373
+ function le(t) {
374
+ m.push({ path: `${u.base}/${t.id}`, query: { ...n.query } });
381
375
  }
382
376
  async function fe() {
377
+ const t = await F({});
378
+ t && le(t);
379
+ }
380
+ async function H() {
383
381
  try {
384
- await p.reorder(l.value.map((t) => t.id));
382
+ await v.reorder(l.value.map((t) => t.id));
385
383
  } catch (t) {
386
- _.danger(C(t, a("panel.reorder-failed"))), await j();
384
+ _.danger(I(t, a("panel.reorder-failed"))), await Z();
387
385
  }
388
386
  }
389
- const le = (t) => t.status === "published" || t.status === "modified";
387
+ const se = (t) => t.status === "published" || t.status === "modified";
390
388
  function me(t) {
391
- if (!v.value) return [];
392
- if (T.value)
389
+ if (!q.value) return [];
390
+ if (V.value)
393
391
  return [
394
392
  {
395
393
  key: "restore",
396
394
  icon: "refresh",
397
395
  label: a("panel.restore"),
398
396
  run: () => {
399
- _e(t);
397
+ xe(t);
400
398
  }
401
399
  }
402
400
  ];
403
- const u = [
404
- { key: "open", icon: "edit", label: a("panel.open"), run: () => ne(t) },
401
+ const d = [
402
+ { key: "open", icon: "edit", label: a("panel.open"), run: () => le(t) },
405
403
  {
406
404
  key: "duplicate",
407
405
  icon: "copy",
@@ -411,147 +409,147 @@ const Rt = /* @__PURE__ */ de({
411
409
  }
412
410
  }
413
411
  ];
414
- return t.url && t.status !== "draft" && u.push({
412
+ return t.url && t.status !== "draft" && d.push({
415
413
  key: "site",
416
414
  icon: "external-link",
417
415
  label: a("panel.open-on-site"),
418
416
  href: t.url
419
- }), le(t) && t.closed_reason === "manual" ? u.push({
417
+ }), se(t) && t.closed_reason === "manual" ? d.push({
420
418
  key: "reopen",
421
419
  icon: "refresh",
422
420
  label: a("panel.reopen"),
423
421
  run: () => {
424
- be(t);
422
+ we(t);
425
423
  }
426
- }) : le(t) && t.closed_reason === null && u.push({
424
+ }) : se(t) && t.closed_reason === null && d.push({
427
425
  key: "close",
428
426
  icon: "lock",
429
427
  label: a("panel.close"),
430
428
  run: () => {
431
- we(t);
429
+ be(t);
432
430
  }
433
- }), u.push(
434
- le(t) ? {
431
+ }), d.push(
432
+ se(t) ? {
435
433
  key: "unpublish",
436
434
  icon: "eye-off",
437
435
  label: a("panel.unpublish"),
438
436
  run: () => {
439
- s(() => p.unpublish(t.id), a("panel.unpublished-done"));
437
+ Y(() => v.unpublish(t.id), a("panel.unpublished-done"));
440
438
  }
441
439
  } : {
442
440
  key: "publish",
443
441
  icon: "upload",
444
442
  label: a("panel.publish"),
445
443
  run: () => {
446
- s(() => p.publish(t.id), a("panel.published"));
444
+ Y(() => v.publish(t.id), a("panel.published"));
447
445
  }
448
446
  }
449
- ), u.push({
447
+ ), d.push({
450
448
  key: "delete",
451
449
  icon: "trash",
452
450
  label: a("panel.delete"),
453
451
  danger: !0,
454
452
  run: () => {
455
- re(t);
453
+ _e(t);
456
454
  }
457
- }), u;
455
+ }), d;
458
456
  }
459
457
  async function ge(t) {
460
458
  try {
461
- const u = await p.duplicate(t.id);
462
- _.success(a("panel.duplicated")), ne(u.vacancy);
463
- } catch (u) {
464
- _.danger(C(u));
459
+ const d = await v.duplicate(t.id);
460
+ _.success(a("panel.duplicated")), le(d.vacancy);
461
+ } catch (d) {
462
+ _.danger(I(d));
465
463
  }
466
464
  }
467
- async function we(t) {
465
+ async function be(t) {
468
466
  if (t.status === "modified") {
469
467
  _.warning(a("panel.close-edits"));
470
468
  return;
471
469
  }
472
- await G({
470
+ await j({
473
471
  title: a("panel.close-title", { title: t.title }),
474
472
  message: a("panel.close-text"),
475
473
  confirmText: a("panel.close"),
476
474
  cancelText: a("panel.cancel")
477
- }) && await s(() => p.close(t.id), a("panel.closed"));
475
+ }) && await Y(() => v.close(t.id), a("panel.closed"));
478
476
  }
479
- async function be(t) {
477
+ async function we(t) {
480
478
  if (t.status === "modified") {
481
479
  _.warning(a("panel.close-edits"));
482
480
  return;
483
481
  }
484
- if (await G({
482
+ if (await j({
485
483
  title: a("panel.reopen-title", { title: t.title }),
486
484
  message: a("panel.reopen-text"),
487
485
  confirmText: a("panel.reopen"),
488
486
  cancelText: a("panel.cancel")
489
487
  }))
490
488
  try {
491
- (await p.reopen(t.id)).closed ? _.warning(a("panel.reopen-expired")) : _.success(a("panel.reopened"));
492
- } catch (o) {
493
- _.danger(C(o));
489
+ (await v.reopen(t.id)).closed ? _.warning(a("panel.reopen-expired")) : _.success(a("panel.reopened"));
490
+ } catch (r) {
491
+ _.danger(I(r));
494
492
  } finally {
495
- await j();
493
+ await Z();
496
494
  }
497
495
  }
498
- async function re(t) {
499
- await G({
496
+ async function _e(t) {
497
+ await j({
500
498
  title: a("panel.delete-title", { title: t.title }),
501
499
  message: a("panel.delete-text"),
502
500
  confirmText: a("panel.delete"),
503
501
  cancelText: a("panel.cancel"),
504
502
  tone: "danger"
505
- }) && await s(() => p.remove(t.id), a("panel.deleted"));
503
+ }) && await Y(() => v.remove(t.id), a("panel.deleted"));
506
504
  }
507
- async function _e(t) {
508
- await s(() => p.restore(t.id), a("panel.restored"));
505
+ async function xe(t) {
506
+ await Y(() => v.restore(t.id), a("panel.restored"));
509
507
  }
510
- async function s(t, u) {
508
+ async function Y(t, d) {
511
509
  try {
512
- await t(), _.success(u);
513
- } catch (o) {
514
- _.danger(C(o));
510
+ await t(), _.success(d);
511
+ } catch (r) {
512
+ _.danger(I(r));
515
513
  } finally {
516
- await j();
514
+ await Z();
517
515
  }
518
516
  }
519
- function x(t) {
517
+ function ke(t) {
520
518
  return t === "published" || t === "modified" ? "success" : "default";
521
519
  }
522
- function E(t) {
523
- return T.value ? "—" : t.path === null ? a("panel.no-address") : `/${t.path}`;
520
+ function s(t) {
521
+ return V.value ? "—" : t.path === null ? a("panel.no-address") : `/${t.path}`;
524
522
  }
525
- function X(t) {
523
+ function w(t) {
526
524
  if (t.workplace === "remote") return a("vacancy.workplace.remote");
527
- const u = t.city !== "" ? t.city : a("panel.no-city");
528
- return t.workplace === "hybrid" ? `${u} · ${a("vacancy.workplace.hybrid")}` : u;
525
+ const d = t.city !== "" ? t.city : a("panel.no-city");
526
+ return t.workplace === "hybrid" ? `${d} · ${a("vacancy.workplace.hybrid")}` : d;
529
527
  }
530
- function Ue(t) {
531
- return t.employment_types.map((u) => a(Nt(u))).join(", ");
528
+ function S(t) {
529
+ return t.employment_types.map((d) => a(Rt(d))).join(", ");
532
530
  }
533
- function Be(t) {
534
- return t.closed && M.value === "all" && !T.value;
531
+ function G(t) {
532
+ return t.closed && M.value === "all" && !V.value;
535
533
  }
536
- const He = h(
537
- () => v.value ? [{ key: "new", label: a("panel.new"), icon: "plus", primary: !0, run: () => {
538
- H();
534
+ const Te = h(
535
+ () => q.value ? [{ key: "new", label: a("panel.new"), icon: "plus", primary: !0, run: () => {
536
+ fe();
539
537
  } }] : []
540
538
  );
541
- return (t, u) => (f(), z("div", St, [
542
- d(e(je), {
539
+ return (t, d) => (y(), z("div", qt, [
540
+ p(e(je), {
543
541
  view: b.value,
544
- "onUpdate:view": u[4] || (u[4] = (o) => b.value = o),
545
- title: w.value,
546
- views: Z.value,
547
- actions: He.value,
542
+ "onUpdate:view": d[4] || (d[4] = (r) => b.value = r),
543
+ title: o.value,
544
+ views: D.value,
545
+ actions: Te.value,
548
546
  padding: "sm"
549
547
  }, {
550
548
  default: i(() => [
551
- O("div", qt, [
552
- d(e(Pe), {
553
- modelValue: S.value,
554
- "onUpdate:modelValue": u[0] || (u[0] = (o) => S.value = o),
549
+ A("div", Et, [
550
+ p(e(Me), {
551
+ modelValue: Q.value,
552
+ "onUpdate:modelValue": d[0] || (d[0] = (r) => Q.value = r),
555
553
  class: "wx-vacancies__search",
556
554
  size: "sm",
557
555
  clearable: "",
@@ -559,29 +557,29 @@ const Rt = /* @__PURE__ */ de({
559
557
  "aria-label": e(a)("panel.search")
560
558
  }, {
561
559
  prefix: i(() => [
562
- d(e(se), {
560
+ p(e(ie), {
563
561
  name: "search",
564
562
  size: "sm"
565
563
  })
566
564
  ]),
567
565
  _: 1
568
566
  }, 8, ["modelValue", "placeholder", "aria-label"]),
569
- d(e(mt), {
567
+ p(e(gt), {
570
568
  title: e(a)("panel.filters"),
571
569
  width: 280,
572
570
  side: "bottom",
573
571
  align: "end"
574
572
  }, {
575
573
  trigger: i(() => [
576
- d(e(gt), {
574
+ p(e(bt), {
577
575
  class: "wx-vacancies__funnel",
578
- value: Q.value.length,
579
- hidden: Q.value.length === 0,
576
+ value: B.value.length,
577
+ hidden: B.value.length === 0,
580
578
  type: "primary",
581
579
  label: e(a)("panel.filters")
582
580
  }, {
583
581
  default: i(() => [
584
- d(e(wt), {
582
+ p(e(wt), {
585
583
  icon: "filter",
586
584
  size: "sm",
587
585
  title: e(a)("panel.filters")
@@ -591,50 +589,50 @@ const Rt = /* @__PURE__ */ de({
591
589
  }, 8, ["value", "hidden", "label"])
592
590
  ]),
593
591
  default: i(() => [
594
- O("div", Dt, [
595
- T.value ? R("", !0) : (f(), V(e(xe), {
592
+ A("div", Ot, [
593
+ V.value ? R("", !0) : (y(), $(e($e), {
596
594
  key: 0,
597
595
  label: e(a)("panel.filter-status")
598
596
  }, {
599
597
  default: i(() => [
600
- d(e(Ve), {
601
- "model-value": I.value === "" ? null : I.value,
602
- options: U.value,
598
+ p(e(Ie), {
599
+ "model-value": E.value === "" ? null : E.value,
600
+ options: te.value,
603
601
  placeholder: e(a)("panel.any-status"),
604
602
  clearable: "",
605
603
  size: "sm",
606
- "onUpdate:modelValue": u[1] || (u[1] = (o) => L("status", o))
604
+ "onUpdate:modelValue": d[1] || (d[1] = (r) => L("status", r))
607
605
  }, null, 8, ["model-value", "options", "placeholder"])
608
606
  ]),
609
607
  _: 1
610
608
  }, 8, ["label"])),
611
- d(e(xe), {
609
+ p(e($e), {
612
610
  label: e(a)("panel.filter-category")
613
611
  }, {
614
612
  default: i(() => [
615
- d(e(Ve), {
616
- "model-value": P.value,
617
- options: N.value.categories.map((o) => ({ value: o.id, label: o.title })),
613
+ p(e(Ie), {
614
+ "model-value": U.value,
615
+ options: k.value.categories.map((r) => ({ value: r.id, label: r.title })),
618
616
  placeholder: e(a)("panel.any-category"),
619
617
  clearable: "",
620
618
  size: "sm",
621
- "onUpdate:modelValue": u[2] || (u[2] = (o) => L("category", o))
619
+ "onUpdate:modelValue": d[2] || (d[2] = (r) => L("category", r))
622
620
  }, null, 8, ["model-value", "options", "placeholder"])
623
621
  ]),
624
622
  _: 1
625
623
  }, 8, ["label"]),
626
- Q.value.length > 0 ? (f(), V(e(K), {
624
+ B.value.length > 0 ? (y(), $(e(K), {
627
625
  key: 1,
628
626
  variant: "text",
629
627
  size: "sm",
630
628
  block: "",
631
- onClick: ye
629
+ onClick: ee
632
630
  }, {
633
631
  icon: i(() => [
634
- d(e(se), { name: "close" })
632
+ p(e(ie), { name: "close" })
635
633
  ]),
636
634
  default: i(() => [
637
- k(" " + g(e(a)("panel.filters-reset")), 1)
635
+ x(" " + g(e(a)("panel.filters-reset")), 1)
638
636
  ]),
639
637
  _: 1
640
638
  })) : R("", !0)
@@ -643,110 +641,116 @@ const Rt = /* @__PURE__ */ de({
643
641
  _: 1
644
642
  }, 8, ["title"])
645
643
  ]),
646
- Q.value.length > 0 ? (f(), z("div", Et, [
647
- d(e(Ye), { filters: Q.value }, null, 8, ["filters"])
644
+ B.value.length > 0 ? (y(), z("div", Dt, [
645
+ p(e(Ye), { filters: B.value }, null, 8, ["filters"])
648
646
  ])) : R("", !0),
649
- q.value && l.value.length === 0 ? (f(), V(e(ce), {
647
+ C.value && l.value.length === 0 ? (y(), $(e(de), {
650
648
  key: 1,
651
649
  class: "wx-vacancies__loading",
652
650
  rows: 5
653
- })) : l.value.length === 0 ? (f(), V(e(ze), {
651
+ })) : l.value.length === 0 ? (y(), $(e(Le), {
654
652
  key: 2,
655
- title: ae.value,
656
- description: M.value === "all" && !T.value && te.value ? e(a)("panel.empty-help") : void 0
657
- }, null, 8, ["title", "description"])) : (f(), z(ee, { key: 3 }, [
658
- d(e(bt), {
653
+ title: ye.value,
654
+ description: M.value === "all" && !V.value && P.value ? e(a)("panel.empty-help") : void 0
655
+ }, null, 8, ["title", "description"])) : (y(), z(ne, { key: 3 }, [
656
+ p(e(_t), {
659
657
  modelValue: l.value,
660
- "onUpdate:modelValue": u[3] || (u[3] = (o) => l.value = o),
661
- class: qe(["wx-vacancies__list", { "is-loading": q.value }]),
658
+ "onUpdate:modelValue": d[3] || (d[3] = (r) => l.value = r),
659
+ class: De(["wx-vacancies__list", { "is-loading": C.value }]),
662
660
  plain: "",
663
661
  "item-key": "id",
664
- handle: D.value ? "grip" : "row",
665
- "item-label": (o) => o.title,
666
- disabled: !D.value,
667
- onMove: fe
662
+ handle: X.value ? "grip" : "row",
663
+ "item-label": (r) => r.title,
664
+ disabled: !X.value,
665
+ onMove: H
668
666
  }, {
669
- default: i(({ item: o }) => [
670
- (f(), V(rt(T.value ? "div" : "router-link"), ct({
671
- class: ["wx-vacancy-row", { "is-closed": Be(o) }]
672
- }, T.value ? {} : { to: { path: `${c.base}/${o.id}`, query: e(n).query } }), {
667
+ default: i(({ item: r }) => [
668
+ (y(), $(ct(V.value ? "div" : "router-link"), ut({
669
+ class: ["wx-vacancy-row", { "is-closed": G(r) }]
670
+ }, V.value ? {} : { to: { path: `${u.base}/${r.id}`, query: e(n).query } }), {
673
671
  default: i(() => [
674
- O("span", Ot, [
675
- O("span", Pt, g(o.title), 1),
676
- O("span", zt, g(E(o)), 1)
672
+ A("span", At, [
673
+ A("span", Pt, g(r.title), 1),
674
+ A("span", zt, [
675
+ x(g(s(r)), 1),
676
+ V.value ? R("", !0) : (y(), $(e(Je), {
677
+ key: 0,
678
+ locale: r.address_locale
679
+ }, null, 8, ["locale"]))
680
+ ])
677
681
  ]),
678
- O("span", At, [
679
- O("span", Mt, [
680
- d(e(se), {
681
- name: o.workplace === "remote" ? "monitor" : "map-pin",
682
+ A("span", Mt, [
683
+ A("span", Lt, [
684
+ p(e(ie), {
685
+ name: r.workplace === "remote" ? "monitor" : "map-pin",
682
686
  size: "sm"
683
687
  }, null, 8, ["name"]),
684
- k(" " + g(X(o)), 1)
688
+ x(" " + g(w(r)), 1)
685
689
  ]),
686
- o.employment_types.length > 0 ? (f(), z("span", Lt, g(Ue(o)), 1)) : R("", !0),
687
- o.valid_through ? (f(), V(e(We), {
690
+ r.employment_types.length > 0 ? (y(), z("span", Ft, g(S(r)), 1)) : R("", !0),
691
+ r.valid_through ? (y(), $(e(Ne), {
688
692
  key: 1,
689
- content: e(a)("panel.until-help", { date: e(Le)(o.valid_through, W.value) })
693
+ content: e(a)("panel.until-help", { date: e(Be)(r.valid_through, T.value) })
690
694
  }, {
691
695
  default: i(() => [
692
- O("span", Ft, [
693
- d(e(se), {
696
+ A("span", Ut, [
697
+ p(e(ie), {
694
698
  name: "calendar",
695
699
  size: "sm"
696
700
  }),
697
- k(" " + g(e(a)("panel.until", { date: e(Ct)(o.valid_through, W.value) })), 1)
701
+ x(" " + g(e(a)("panel.until", { date: e(It)(r.valid_through, T.value) })), 1)
698
702
  ])
699
703
  ]),
700
704
  _: 2
701
705
  }, 1032, ["content"])) : R("", !0)
702
706
  ]),
703
- O("span", Ut, [
704
- (f(!0), z(ee, null, De(o.categories, ($e) => (f(), V(e(Y), {
705
- key: $e.id,
707
+ A("span", Bt, [
708
+ (y(!0), z(ne, null, Ae(r.categories, (Ce) => (y(), $(e(J), {
709
+ key: Ce.id,
706
710
  size: "sm",
707
711
  round: ""
708
712
  }, {
709
713
  default: i(() => [
710
- k(g($e.title), 1)
714
+ x(g(Ce.title), 1)
711
715
  ]),
712
716
  _: 2
713
717
  }, 1024))), 128)),
714
- o.closed_reason ? (f(), V(e(We), {
718
+ r.closed_reason ? (y(), $(e(Ne), {
715
719
  key: 0,
716
- content: e(a)(`panel.closed-${o.closed_reason}-help`)
720
+ content: e(a)(`panel.closed-${r.closed_reason}-help`)
717
721
  }, {
718
722
  default: i(() => [
719
- d(e(Y), {
723
+ p(e(J), {
720
724
  type: "warning",
721
725
  size: "sm",
722
726
  round: ""
723
727
  }, {
724
728
  default: i(() => [
725
- k(g(e(a)(`panel.closed-${o.closed_reason}`)), 1)
729
+ x(g(e(a)(`panel.closed-${r.closed_reason}`)), 1)
726
730
  ]),
727
731
  _: 2
728
732
  }, 1024)
729
733
  ]),
730
734
  _: 2
731
735
  }, 1032, ["content"])) : R("", !0),
732
- d(e(Y), {
733
- type: x(o.status),
736
+ p(e(J), {
737
+ type: ke(r.status),
734
738
  dot: "",
735
739
  size: "sm"
736
740
  }, {
737
741
  default: i(() => [
738
- k(g(e(a)(`panel.status-${o.status}`)), 1)
742
+ x(g(e(a)(`panel.status-${r.status}`)), 1)
739
743
  ]),
740
744
  _: 2
741
745
  }, 1032, ["type"]),
742
- o.status === "modified" ? (f(), V(e(Y), {
746
+ r.status === "modified" ? (y(), $(e(J), {
743
747
  key: 1,
744
748
  type: "primary",
745
749
  size: "sm",
746
750
  round: ""
747
751
  }, {
748
752
  default: i(() => [
749
- k(g(e(a)("panel.edits")), 1)
753
+ x(g(e(a)("panel.edits")), 1)
750
754
  ]),
751
755
  _: 1
752
756
  })) : R("", !0)
@@ -755,19 +759,19 @@ const Rt = /* @__PURE__ */ de({
755
759
  _: 2
756
760
  }, 1040, ["class"]))
757
761
  ]),
758
- actions: i(({ item: o }) => [
759
- d(e(Ge), {
760
- actions: me(o),
761
- label: o.title
762
+ actions: i(({ item: r }) => [
763
+ p(e(Ge), {
764
+ actions: me(r),
765
+ label: r.title
762
766
  }, null, 8, ["actions", "label"])
763
767
  ]),
764
768
  _: 1
765
769
  }, 8, ["modelValue", "class", "handle", "item-label", "disabled"]),
766
- v.value && !T.value ? (f(), V(e(Ae), {
770
+ q.value && !V.value ? (y(), $(e(Fe), {
767
771
  key: 0,
768
772
  class: "wx-vacancies__note",
769
773
  type: "info",
770
- description: he.value
774
+ description: O.value
771
775
  }, null, 8, ["description"])) : R("", !0)
772
776
  ], 64))
773
777
  ]),
@@ -775,225 +779,254 @@ const Rt = /* @__PURE__ */ de({
775
779
  }, 8, ["view", "title", "views", "actions"])
776
780
  ]));
777
781
  }
778
- }), Te = (r, c) => {
779
- const y = r.__vccOpts || r;
780
- for (const [p, n] of c)
781
- y[p] = n;
782
- return y;
783
- }, Ht = /* @__PURE__ */ Te(Bt, [["__scopeId", "data-v-41756f57"]]), Fe = /* @__PURE__ */ Symbol("wx-vacancy-editor");
784
- function Kt(r) {
785
- ut(Fe, r);
782
+ }), We = (c, u) => {
783
+ const f = c.__vccOpts || c;
784
+ for (const [v, n] of u)
785
+ f[v] = n;
786
+ return f;
787
+ }, Kt = /* @__PURE__ */ We(Ht, [["__scopeId", "data-v-491c2b10"]]), He = /* @__PURE__ */ Symbol("wx-vacancy-editor");
788
+ function jt(c) {
789
+ dt(He, c);
786
790
  }
787
- function jt() {
788
- return dt(Fe, null);
791
+ function Yt() {
792
+ return pt(He, null);
789
793
  }
790
- const Yt = { class: "wx-vacancy-editor__word" }, Gt = 1200, Jt = /* @__PURE__ */ de({
794
+ const Gt = { class: "wx-vacancy-editor__word" }, Jt = 1200, Qt = /* @__PURE__ */ pe({
791
795
  __name: "VacancyEditorPage",
792
796
  props: {
793
797
  base: { default: "/vacancies" }
794
798
  },
795
- setup(r) {
796
- const c = r, y = oe(), p = pe(y), n = Ee(), m = Oe(), a = _t(), C = Je();
797
- ve();
798
- const l = ue("webx-vacancies"), N = ke(), q = h(() => Number(n.params.id)), A = h(() => c.base), v = $(null), w = $({}), W = $(""), b = $(null), T = $(null), M = $(!0), P = $(!1), I = $(!1), F = $({}), S = $(null), Z = $(""), U = h(() => y.can("vacancies.manage")), te = h(() => !U.value || I.value), J = h(() => JSON.stringify(w.value)), D = h(() => Z.value !== "" && J.value !== Z.value), he = h(() => P.value ? "saving" : D.value ? "unsaved" : "saved"), ae = h(() => {
799
- const s = w.value.title;
800
- return xt(s, a.active.value, v.value?.title ?? "");
801
- }), Q = h(() => {
802
- const s = v.value;
799
+ setup(c) {
800
+ const u = c, f = ce(), v = ve(f), n = Pe(), m = ze(), a = xt(), I = Qe();
801
+ he();
802
+ const l = oe("webx-vacancies"), k = oe("webx-admin"), C = Ve(), F = h(() => Number(n.params.id)), q = h(() => u.base), o = W(null), T = W({}), b = W(""), V = W(null), M = W(null), U = W(!0), E = W(!1), N = W(!1), Q = W({}), D = W(null), te = W(""), P = h(() => f.can("vacancies.manage")), ue = h(() => !P.value || N.value), X = h(() => JSON.stringify(T.value)), O = h(() => te.value !== "" && X.value !== te.value), ye = h(() => E.value ? "saving" : O.value ? "unsaved" : "saved"), B = h(() => {
803
+ const s = T.value.title;
804
+ return kt(s, a.active.value, o.value?.title ?? "");
805
+ }), Z = h(() => {
806
+ const s = o.value;
803
807
  if (!s) return "";
804
- const x = [];
805
- return s.valid_through !== null && !s.closed && x.push(
806
- l("editor.open-until", { date: Le(s.valid_through, y.i18n.state.locale) })
807
- ), (s.status === "published" || s.status === "modified") && x.push(l("editor.live-since", { date: C.short(s.published_at) })), x.join(" · ");
808
+ const w = [];
809
+ return s.valid_through !== null && !s.closed && w.push(
810
+ l("editor.open-until", { date: Be(s.valid_through, f.i18n.state.locale) })
811
+ ), (s.status === "published" || s.status === "modified") && w.push(l("editor.live-since", { date: I.short(s.published_at) })), w.join(" · ");
808
812
  });
809
- Qe({ type: "vacancy", id: h(() => v.value?.id ?? null) }), Xe({
810
- values: w,
811
- prefix: b,
812
- path: h(() => v.value?.path),
813
+ Xe({ type: "vacancy", id: h(() => o.value?.id ?? null) }), Ze({
814
+ values: T,
815
+ prefix: V,
816
+ path: h(() => o.value?.path),
813
817
  moving: () => l("editor.address-moving")
814
- }), Kt({ vacancy: v, canManage: U.value, reload: () => B(!0) });
815
- function j(s) {
816
- const x = s.values;
817
- v.value = s.vacancy, w.value = x, W.value = s.revision, b.value = s.prefix, T.value = s.preview_url, Z.value = JSON.stringify(x), S.value = null;
818
+ }), jt({ vacancy: o, canManage: P.value, reload: () => L(!0) });
819
+ function ae(s) {
820
+ const w = s.values;
821
+ o.value = s.vacancy, T.value = w, b.value = s.revision, V.value = s.prefix, M.value = s.preview_url, te.value = JSON.stringify(w), D.value = null;
818
822
  }
819
- async function B(s = !1) {
820
- s || (M.value = !0);
823
+ async function L(s = !1) {
824
+ s || (U.value = !0);
821
825
  try {
822
- j(await p.get(q.value));
823
- } catch (x) {
824
- _.danger(N(x)), m.push(A.value);
826
+ ae(await v.get(F.value));
827
+ } catch (w) {
828
+ _.danger(C(w)), m.push(q.value);
825
829
  } finally {
826
- M.value = !1;
830
+ U.value = !1;
827
831
  }
828
832
  }
829
- let L;
830
- function ye() {
831
- !U.value || S.value || !D.value || (clearTimeout(L), L = setTimeout(() => {
833
+ let ee;
834
+ function le() {
835
+ !P.value || D.value || !O.value || (clearTimeout(ee), ee = setTimeout(() => {
832
836
  H();
833
- }, Gt));
837
+ }, Jt));
834
838
  }
835
- function ne() {
836
- !U.value || S.value || !D.value || P.value || (clearTimeout(L), H());
839
+ function fe() {
840
+ !P.value || D.value || !O.value || E.value || (clearTimeout(ee), H());
837
841
  }
838
842
  async function H() {
839
- if (!v.value || P.value || !U.value) return;
840
- clearTimeout(L);
841
- const s = J.value, x = w.value;
842
- P.value = !0, F.value = {};
843
+ if (!o.value || E.value || !P.value) return;
844
+ clearTimeout(ee);
845
+ const s = X.value, w = T.value;
846
+ E.value = !0, Q.value = {};
843
847
  try {
844
- const E = await p.save(v.value.id, { values: x, revision: W.value });
845
- v.value = E.vacancy, W.value = E.revision, b.value = E.prefix, T.value = E.preview_url, S.value = null, J.value === s && (Z.value = s);
846
- } catch (E) {
847
- const X = E;
848
- X.status === 409 && X.body?.data ? S.value = X.body : X.body?.errors ? (F.value = X.body.errors, _.danger(l("editor.save-failed"))) : _.danger(N(E));
848
+ const S = await v.save(o.value.id, { values: w, revision: b.value });
849
+ o.value = S.vacancy, b.value = S.revision, V.value = S.prefix, M.value = S.preview_url, D.value = null, X.value === s && (te.value = s);
850
+ } catch (S) {
851
+ const G = S;
852
+ G.status === 409 && G.body?.data ? D.value = G.body : G.body?.errors ? (Q.value = G.body.errors, _.danger(l("editor.save-failed"))) : _.danger(C(S));
849
853
  } finally {
850
- P.value = !1;
854
+ E.value = !1;
851
855
  }
852
856
  }
853
- async function fe() {
854
- await G({
857
+ async function se() {
858
+ await j({
855
859
  title: l("editor.conflict-theirs-title"),
856
860
  message: l("editor.conflict-theirs-text"),
857
861
  confirmText: l("editor.conflict-theirs"),
858
862
  cancelText: l("panel.cancel"),
859
863
  tone: "danger"
860
- }) && await B(!0);
861
- }
862
- async function le() {
863
- const s = S.value;
864
- s && (W.value = s.data.revision, S.value = null, await H());
864
+ }) && await L(!0);
865
865
  }
866
866
  async function me() {
867
- if (!(!v.value || !await G({
868
- title: l("editor.discard-title"),
869
- message: l("editor.discard-text"),
867
+ const s = D.value;
868
+ s && (b.value = s.data.revision, D.value = null, await H());
869
+ }
870
+ async function ge() {
871
+ if (!(!o.value || !await j({
872
+ title: k("editor.discard-title"),
873
+ message: k("editor.discard-text"),
870
874
  confirmText: l("editor.discard"),
871
- cancelText: l("panel.cancel"),
875
+ // Not «Cancel»: beside «Discard changes» the two read as the same word.
876
+ cancelText: k("editor.keep-changes"),
872
877
  tone: "danger"
873
878
  }))) {
874
- I.value = !0;
879
+ N.value = !0;
875
880
  try {
876
- j(await p.discard(v.value.id)), _.success(l("editor.discarded"));
877
- } catch (x) {
878
- _.danger(N(x));
881
+ ae(await v.discard(o.value.id)), _.success(l("editor.discarded"));
882
+ } catch (w) {
883
+ _.danger(C(w));
879
884
  } finally {
880
- I.value = !1;
885
+ N.value = !1;
881
886
  }
882
887
  }
883
888
  }
884
- async function ge() {
885
- const s = v.value;
886
- if (!(!s || !await G({
887
- title: l("editor.publish-title", { title: ae.value || s.title }),
888
- message: s.path === null ? l("editor.publish-nowhere") : l("editor.publish-text", { address: `/${s.path}` }),
889
+ async function be() {
890
+ if (O.value && await H(), D.value || O.value) return;
891
+ const s = o.value;
892
+ if (!s) return;
893
+ const w = s.next_path ?? s.path, S = s.next_path != null && s.path !== null ? ` ${k("editor.publish-moves", { old: `/${s.path}` })}` : "";
894
+ if (await j({
895
+ title: l("editor.publish-title", { title: B.value || s.title }),
896
+ message: w === null ? l("editor.publish-nowhere") : l("editor.publish-text", { address: `/${w}` }) + S,
889
897
  confirmText: l("panel.publish"),
890
898
  cancelText: l("panel.cancel")
891
- })) && (D.value && await H(), !S.value)) {
892
- I.value = !0;
899
+ })) {
900
+ N.value = !0;
893
901
  try {
894
- await p.publish(s.id), await B(!0), _.success(l("panel.published"));
895
- } catch (E) {
896
- _.danger(N(E));
902
+ await v.publish(s.id), await L(!0), _.success(l("panel.published"));
903
+ } catch (Te) {
904
+ _.danger(C(Te));
897
905
  } finally {
898
- I.value = !1;
906
+ N.value = !1;
899
907
  }
900
908
  }
901
909
  }
902
910
  async function we() {
903
- const s = v.value;
904
- if (s && (D.value && await H(), !(S.value || D.value))) {
905
- I.value = !0;
911
+ const s = o.value;
912
+ if (s && (O.value && await H(), !(D.value || O.value))) {
913
+ N.value = !0;
906
914
  try {
907
- const x = await p.duplicate(s.id);
908
- _.success(l("panel.duplicated")), await m.push({ path: `${A.value}/${x.vacancy.id}`, query: { ...n.query } });
909
- } catch (x) {
910
- _.danger(N(x));
915
+ const w = await v.duplicate(s.id);
916
+ _.success(l("panel.duplicated")), await m.push({ path: `${q.value}/${w.vacancy.id}`, query: { ...n.query } });
917
+ } catch (w) {
918
+ _.danger(C(w));
911
919
  } finally {
912
- I.value = !1;
920
+ N.value = !1;
913
921
  }
914
922
  }
915
923
  }
916
- function be() {
917
- const s = v.value?.status;
924
+ async function _e() {
925
+ const s = o.value;
926
+ if (!(!s || !await j({
927
+ title: k("editor.unpublish-title"),
928
+ message: k("editor.unpublish-text"),
929
+ confirmText: k("editor.unpublish"),
930
+ cancelText: k("editor.keep-published")
931
+ }))) {
932
+ N.value = !0;
933
+ try {
934
+ await v.unpublish(s.id), await L(!0), _.success(k("editor.unpublished"));
935
+ } catch (S) {
936
+ _.danger(C(S));
937
+ } finally {
938
+ N.value = !1;
939
+ }
940
+ }
941
+ }
942
+ function xe() {
943
+ const s = o.value?.status;
918
944
  return s === "published" || s === "modified" ? "success" : "default";
919
945
  }
920
- function re(s) {
921
- D.value && s.preventDefault();
946
+ function Y(s) {
947
+ O.value && s.preventDefault();
922
948
  }
923
- ie(J, ye), ie(q, () => {
924
- B();
925
- }), Re(() => {
926
- B(), window.addEventListener("beforeunload", re);
927
- }), Se(() => {
928
- clearTimeout(L), window.removeEventListener("beforeunload", re);
929
- }), pt(async () => !D.value || !U.value || (await H(), !D.value) ? !0 : await G({
949
+ re(X, le), re(F, () => {
950
+ L();
951
+ }), Ee(() => {
952
+ L(), window.addEventListener("beforeunload", Y);
953
+ }), Oe(() => {
954
+ clearTimeout(ee), window.removeEventListener("beforeunload", Y);
955
+ }), vt(async () => !O.value || !P.value || (await H(), !O.value) ? !0 : await j({
930
956
  title: l("editor.leave-title"),
931
957
  message: l("editor.leave-text"),
932
958
  confirmText: l("editor.leave"),
933
959
  cancelText: l("panel.cancel"),
934
960
  tone: "danger"
935
961
  }));
936
- const _e = h(() => {
962
+ const ke = h(() => {
937
963
  const s = [];
938
- return T.value && s.push({ key: "preview", label: l("editor.preview"), icon: "eye", href: T.value }), v.value?.url && v.value.status !== "draft" && s.push({
964
+ return M.value && s.push({ key: "preview", label: l("editor.preview"), icon: "eye", href: M.value }), o.value?.url && o.value.status !== "draft" && s.push({
939
965
  key: "site",
940
966
  label: l("panel.open-on-site"),
941
967
  icon: "link",
942
- href: v.value.url
943
- }), v.value?.status === "modified" && s.push({
968
+ href: o.value.url
969
+ }), P.value && (o.value?.status === "published" || o.value?.status === "modified") && s.push({
970
+ key: "unpublish",
971
+ label: k("editor.unpublish"),
972
+ icon: "eye-off",
973
+ run: () => {
974
+ _e();
975
+ }
976
+ }), o.value?.status === "modified" && s.push({
944
977
  key: "discard",
945
978
  label: l("editor.discard"),
946
979
  icon: "refresh",
947
980
  danger: !0,
948
981
  menu: !0,
949
982
  run: () => {
950
- me();
983
+ ge();
951
984
  }
952
985
  }), s;
953
986
  });
954
- return (s, x) => (f(), z("div", {
987
+ return (s, w) => (y(), z("div", {
955
988
  class: "wx-vacancy-editor",
956
- onFocusout: ne
989
+ onFocusout: fe
957
990
  }, [
958
- M.value || !v.value ? (f(), z(ee, { key: 0 }, [
959
- d(e(ce), {
991
+ U.value || !o.value ? (y(), z(ne, { key: 0 }, [
992
+ p(e(de), {
960
993
  class: "wx-vacancy-editor__ghost",
961
994
  title: "",
962
995
  rows: 1
963
996
  }),
964
- d(e(kt), null, {
997
+ p(e(Tt), null, {
965
998
  default: i(() => [
966
- d(e(ce), { rows: 8 })
999
+ p(e(de), { rows: 8 })
967
1000
  ]),
968
1001
  _: 1
969
1002
  })
970
- ], 64)) : (f(), z(ee, { key: 1 }, [
971
- d(e(Ze), {
1003
+ ], 64)) : (y(), z(ne, { key: 1 }, [
1004
+ p(e(et), {
972
1005
  divider: "",
973
- back: A.value,
1006
+ back: q.value,
974
1007
  "back-label": e(l)("module.vacancies"),
975
- title: ae.value || e(l)("editor.untitled"),
976
- subtitle: Q.value,
977
- actions: _e.value
1008
+ title: B.value || e(l)("editor.untitled"),
1009
+ subtitle: Z.value,
1010
+ actions: ke.value
978
1011
  }, {
979
1012
  trail: i(() => [
980
- d(e(Tt), {
1013
+ p(e($t), {
981
1014
  size: "sm",
982
1015
  label: e(l)("editor.trail")
983
1016
  }, {
984
1017
  default: i(() => [
985
- d(e(Ce), {
1018
+ p(e(Re), {
986
1019
  as: "router-link",
987
- to: A.value
1020
+ to: q.value
988
1021
  }, {
989
1022
  default: i(() => [
990
- k(g(e(l)("module.vacancies")), 1)
1023
+ x(g(e(l)("module.vacancies")), 1)
991
1024
  ]),
992
1025
  _: 1
993
1026
  }, 8, ["to"]),
994
- d(e(Ce), { current: "" }, {
1027
+ p(e(Re), { current: "" }, {
995
1028
  default: i(() => [
996
- k(g(ae.value || e(l)("editor.untitled")), 1)
1029
+ x(g(B.value || e(l)("editor.untitled")), 1)
997
1030
  ]),
998
1031
  _: 1
999
1032
  })
@@ -1002,113 +1035,113 @@ const Yt = { class: "wx-vacancy-editor__word" }, Gt = 1200, Jt = /* @__PURE__ */
1002
1035
  }, 8, ["label"])
1003
1036
  ]),
1004
1037
  "title-after": i(() => [
1005
- d(e(Y), {
1006
- type: be(),
1038
+ p(e(J), {
1039
+ type: xe(),
1007
1040
  dot: ""
1008
1041
  }, {
1009
1042
  default: i(() => [
1010
- k(g(e(l)(`panel.status-${v.value.status}`)), 1)
1043
+ x(g(e(l)(`panel.status-${o.value.status}`)), 1)
1011
1044
  ]),
1012
1045
  _: 1
1013
1046
  }, 8, ["type"]),
1014
- v.value.status === "modified" ? (f(), V(e(Y), {
1047
+ o.value.status === "modified" ? (y(), $(e(J), {
1015
1048
  key: 0,
1016
1049
  type: "primary",
1017
1050
  round: ""
1018
1051
  }, {
1019
1052
  default: i(() => [
1020
- k(g(e(l)("panel.edits")), 1)
1053
+ x(g(e(l)("panel.edits")), 1)
1021
1054
  ]),
1022
1055
  _: 1
1023
1056
  })) : R("", !0),
1024
- v.value.closed_reason ? (f(), V(e(Y), {
1057
+ o.value.closed_reason ? (y(), $(e(J), {
1025
1058
  key: 1,
1026
1059
  type: "warning",
1027
1060
  round: ""
1028
1061
  }, {
1029
1062
  default: i(() => [
1030
- k(g(e(l)(`panel.closed-${v.value.closed_reason}`)), 1)
1063
+ x(g(e(l)(`panel.closed-${o.value.closed_reason}`)), 1)
1031
1064
  ]),
1032
1065
  _: 1
1033
1066
  })) : R("", !0)
1034
1067
  ]),
1035
1068
  _: 1
1036
1069
  }, 8, ["back", "back-label", "title", "subtitle", "actions"]),
1037
- S.value ? (f(), V(e(Ae), {
1070
+ D.value ? (y(), $(e(Fe), {
1038
1071
  key: 0,
1039
1072
  type: "warning",
1040
1073
  title: e(l)("editor.conflict-title"),
1041
- description: S.value.message
1074
+ description: D.value.message
1042
1075
  }, {
1043
1076
  actions: i(() => [
1044
- d(e(K), {
1077
+ p(e(K), {
1045
1078
  size: "sm",
1046
1079
  variant: "outline",
1047
- onClick: fe
1080
+ onClick: se
1048
1081
  }, {
1049
1082
  default: i(() => [
1050
- k(g(e(l)("editor.conflict-theirs")), 1)
1083
+ x(g(e(l)("editor.conflict-theirs")), 1)
1051
1084
  ]),
1052
1085
  _: 1
1053
1086
  }),
1054
- d(e(K), {
1087
+ p(e(K), {
1055
1088
  size: "sm",
1056
1089
  type: "primary",
1057
- onClick: le
1090
+ onClick: me
1058
1091
  }, {
1059
1092
  default: i(() => [
1060
- k(g(e(l)("editor.conflict-mine")), 1)
1093
+ x(g(e(l)("editor.conflict-mine")), 1)
1061
1094
  ]),
1062
1095
  _: 1
1063
1096
  })
1064
1097
  ]),
1065
1098
  _: 1
1066
1099
  }, 8, ["title", "description"])) : R("", !0),
1067
- d(e(et), {
1068
- modelValue: w.value,
1069
- "onUpdate:modelValue": x[0] || (x[0] = (E) => w.value = E),
1100
+ p(e(tt), {
1101
+ modelValue: T.value,
1102
+ "onUpdate:modelValue": w[0] || (w[0] = (S) => T.value = S),
1070
1103
  name: "vacancies.form",
1071
- errors: F.value,
1072
- disabled: te.value
1104
+ errors: Q.value,
1105
+ disabled: ue.value
1073
1106
  }, null, 8, ["modelValue", "errors", "disabled"]),
1074
- U.value ? (f(), V(e($t), { key: 1 }, {
1107
+ P.value ? (y(), $(e(Vt), { key: 1 }, {
1075
1108
  state: i(() => [
1076
- d(e(tt), { state: he.value }, null, 8, ["state"])
1109
+ p(e(at), { state: ye.value }, null, 8, ["state"])
1077
1110
  ]),
1078
1111
  default: i(() => [
1079
- d(e(K), {
1112
+ p(e(K), {
1080
1113
  variant: "text",
1081
- disabled: I.value,
1114
+ disabled: N.value,
1082
1115
  "aria-label": e(l)("panel.duplicate"),
1083
1116
  onClick: we
1084
1117
  }, {
1085
1118
  icon: i(() => [
1086
- d(e(se), { name: "copy" })
1119
+ p(e(ie), { name: "copy" })
1087
1120
  ]),
1088
1121
  default: i(() => [
1089
- O("span", Yt, g(e(l)("panel.duplicate")), 1)
1122
+ A("span", Gt, g(e(l)("panel.duplicate")), 1)
1090
1123
  ]),
1091
1124
  _: 1
1092
1125
  }, 8, ["disabled", "aria-label"]),
1093
- d(e(K), {
1126
+ p(e(K), {
1094
1127
  variant: "outline",
1095
- loading: P.value,
1096
- disabled: !D.value,
1128
+ loading: E.value,
1129
+ disabled: !O.value,
1097
1130
  onClick: H
1098
1131
  }, {
1099
1132
  default: i(() => [
1100
- k(g(e(l)("editor.save")), 1)
1133
+ x(g(e(l)("editor.save")), 1)
1101
1134
  ]),
1102
1135
  _: 1
1103
1136
  }, 8, ["loading", "disabled"]),
1104
- d(e(K), {
1137
+ p(e(K), {
1105
1138
  type: "primary",
1106
- loading: I.value,
1107
- disabled: v.value.status === "published" && !D.value,
1108
- onClick: ge
1139
+ loading: N.value,
1140
+ disabled: o.value.status === "published" && !O.value,
1141
+ onClick: be
1109
1142
  }, {
1110
1143
  default: i(() => [
1111
- k(g(e(l)("panel.publish")), 1)
1144
+ x(g(e(l)("panel.publish")), 1)
1112
1145
  ]),
1113
1146
  _: 1
1114
1147
  }, 8, ["loading", "disabled"])
@@ -1118,118 +1151,118 @@ const Yt = { class: "wx-vacancy-editor__word" }, Gt = 1200, Jt = /* @__PURE__ */
1118
1151
  ], 64))
1119
1152
  ], 32));
1120
1153
  }
1121
- }), Qt = /* @__PURE__ */ Te(Jt, [["__scopeId", "data-v-04fdc324"]]), Xt = { class: "wx-vacancy-history" }, Zt = { class: "wx-vacancy-history__number" }, ea = { class: "wx-vacancy-history__who" }, ta = /* @__PURE__ */ de({
1154
+ }), Xt = /* @__PURE__ */ We(Qt, [["__scopeId", "data-v-12e705f9"]]), Zt = { class: "wx-vacancy-history" }, ea = { class: "wx-vacancy-history__number" }, ta = { class: "wx-vacancy-history__who" }, aa = /* @__PURE__ */ pe({
1122
1155
  name: "WxVacancyHistory",
1123
1156
  __name: "VacancyHistory",
1124
- setup(r) {
1125
- const c = oe(), y = pe(c), p = jt();
1126
- ve();
1127
- const n = ue("webx-vacancies"), m = ke(), a = $(null), C = $(!1), l = h(() => p?.vacancy.value ?? null), N = h(() => p?.canManage ?? !1), q = h(
1157
+ setup(c) {
1158
+ const u = ce(), f = ve(u), v = Yt();
1159
+ he();
1160
+ const n = oe("webx-vacancies"), m = Ve(), a = W(null), I = W(!1), l = h(() => v?.vacancy.value ?? null), k = h(() => v?.canManage ?? !1), C = h(
1128
1161
  () => l.value?.status === "published" || l.value?.status === "modified" ? a.value?.[0]?.number ?? null : null
1129
1162
  );
1130
- async function A() {
1131
- const w = l.value;
1132
- if (w)
1163
+ async function F() {
1164
+ const o = l.value;
1165
+ if (o)
1133
1166
  try {
1134
- a.value = await y.versions(w.id);
1135
- } catch (W) {
1136
- a.value = [], _.danger(m(W));
1167
+ a.value = await f.versions(o.id);
1168
+ } catch (T) {
1169
+ a.value = [], _.danger(m(T));
1137
1170
  }
1138
1171
  }
1139
- async function v(w) {
1140
- const W = l.value;
1141
- if (!(!W || !await G({
1142
- title: n("editor.restore-title", { number: w.number }),
1172
+ async function q(o) {
1173
+ const T = l.value;
1174
+ if (!(!T || !await j({
1175
+ title: n("editor.restore-title", { number: o.number }),
1143
1176
  message: n("editor.restore-text"),
1144
1177
  confirmText: n("editor.restore-version"),
1145
1178
  cancelText: n("panel.cancel")
1146
1179
  }))) {
1147
- C.value = !0;
1180
+ I.value = !0;
1148
1181
  try {
1149
- await y.restoreVersion(W.id, w.number), await p?.reload(), _.success(n("editor.restored-version", { number: w.number }));
1150
- } catch (T) {
1151
- _.danger(m(T));
1182
+ await f.restoreVersion(T.id, o.number), await v?.reload(), _.success(n("editor.restored-version", { number: o.number }));
1183
+ } catch (V) {
1184
+ _.danger(m(V));
1152
1185
  } finally {
1153
- C.value = !1;
1186
+ I.value = !1;
1154
1187
  }
1155
1188
  }
1156
1189
  }
1157
- return ie(
1190
+ return re(
1158
1191
  () => [l.value?.id, l.value?.published_at, l.value?.updated_at],
1159
1192
  () => {
1160
- A();
1193
+ F();
1161
1194
  },
1162
1195
  { immediate: !0 }
1163
- ), (w, W) => (f(), z("div", Xt, [
1164
- a.value === null ? (f(), V(e(ce), {
1196
+ ), (o, T) => (y(), z("div", Zt, [
1197
+ a.value === null ? (y(), $(e(de), {
1165
1198
  key: 0,
1166
1199
  class: "wx-vacancy-history__ghost",
1167
1200
  rows: 3
1168
- })) : a.value.length === 0 ? (f(), V(e(ze), {
1201
+ })) : a.value.length === 0 ? (y(), $(e(Le), {
1169
1202
  key: 1,
1170
1203
  description: e(n)("editor.history-empty")
1171
- }, null, 8, ["description"])) : (f(!0), z(ee, { key: 2 }, De(a.value, (b) => (f(), z("div", {
1204
+ }, null, 8, ["description"])) : (y(!0), z(ne, { key: 2 }, Ae(a.value, (b) => (y(), z("div", {
1172
1205
  key: b.number,
1173
- class: qe(["wx-vacancy-history__row", { "is-live": b.number === q.value }])
1206
+ class: De(["wx-vacancy-history__row", { "is-live": b.number === C.value }])
1174
1207
  }, [
1175
- O("code", Zt, g(e(n)("editor.version", { number: b.number })), 1),
1176
- O("div", ea, [
1177
- b.created_at ? (f(), V(e(at), {
1208
+ A("code", ea, g(e(n)("editor.version", { number: b.number })), 1),
1209
+ A("div", ta, [
1210
+ b.created_at ? (y(), $(e(nt), {
1178
1211
  key: 0,
1179
1212
  value: b.created_at,
1180
1213
  size: "md",
1181
1214
  tone: "default"
1182
1215
  }, null, 8, ["value"])) : R("", !0),
1183
- d(e(Vt), {
1216
+ p(e(Wt), {
1184
1217
  size: "sm",
1185
1218
  tone: "muted"
1186
1219
  }, {
1187
1220
  default: i(() => [
1188
- k(g(b.author ?? e(n)(`editor.source-${b.source}`)) + " ", 1),
1189
- b.comment ? (f(), z(ee, { key: 0 }, [
1190
- k(" · " + g(b.comment), 1)
1221
+ x(g(b.author ?? e(n)(`editor.source-${b.source}`)) + " ", 1),
1222
+ b.comment ? (y(), z(ne, { key: 0 }, [
1223
+ x(" · " + g(b.comment), 1)
1191
1224
  ], 64)) : R("", !0)
1192
1225
  ]),
1193
1226
  _: 2
1194
1227
  }, 1024)
1195
1228
  ]),
1196
- b.number === q.value ? (f(), V(e(Y), {
1229
+ b.number === C.value ? (y(), $(e(J), {
1197
1230
  key: 0,
1198
1231
  type: "success",
1199
1232
  dot: ""
1200
1233
  }, {
1201
1234
  default: i(() => [
1202
- k(g(e(n)("editor.version-live")), 1)
1235
+ x(g(e(n)("editor.version-live")), 1)
1203
1236
  ]),
1204
1237
  _: 1
1205
1238
  })) : R("", !0),
1206
- N.value && b.number !== q.value ? (f(), V(e(K), {
1239
+ k.value && b.number !== C.value ? (y(), $(e(K), {
1207
1240
  key: 1,
1208
1241
  size: "sm",
1209
1242
  variant: "outline",
1210
- loading: C.value,
1211
- onClick: (T) => v(b)
1243
+ loading: I.value,
1244
+ onClick: (V) => q(b)
1212
1245
  }, {
1213
1246
  default: i(() => [
1214
- k(g(e(n)("editor.restore-version")), 1)
1247
+ x(g(e(n)("editor.restore-version")), 1)
1215
1248
  ]),
1216
1249
  _: 1
1217
1250
  }, 8, ["loading", "onClick"])) : R("", !0)
1218
1251
  ], 2))), 128))
1219
1252
  ]));
1220
1253
  }
1221
- }), aa = /* @__PURE__ */ Te(ta, [["__scopeId", "data-v-77bc9b70"]]);
1222
- function na(r = "/vacancies") {
1254
+ }), na = /* @__PURE__ */ We(aa, [["__scopeId", "data-v-77bc9b70"]]);
1255
+ function la(c = "/vacancies") {
1223
1256
  return {
1224
1257
  api: "vacancies/categories",
1225
- path: `${r}/categories`,
1258
+ path: `${c}/categories`,
1226
1259
  name: "webx.vacancies.categories",
1227
1260
  module: "vacancy-categories",
1228
1261
  screen: "vacancies.category-form",
1229
1262
  manage: "vacancies.categories.manage",
1230
1263
  count: "vacancies_count",
1231
1264
  // Every vacancy of the category, closed ones included: "what is filed here" is the question.
1232
- items: (c) => ({ path: r, query: { category: String(c), view: "all" } }),
1265
+ items: (u) => ({ path: c, query: { category: String(u), view: "all" } }),
1233
1266
  words: {
1234
1267
  new: "webx-vacancies::category.new",
1235
1268
  empty: "webx-vacancies::category.empty",
@@ -1248,19 +1281,19 @@ function na(r = "/vacancies") {
1248
1281
  }
1249
1282
  };
1250
1283
  }
1251
- function ra(r = {}) {
1252
- const c = r.path ?? "/vacancies";
1284
+ function ca(c = {}) {
1285
+ const u = c.path ?? "/vacancies";
1253
1286
  return [
1254
1287
  {
1255
1288
  id: "vacancies",
1256
- path: c,
1289
+ path: u,
1257
1290
  routes: [
1258
- { path: c, name: "webx.vacancies", component: Ht, props: { base: c } },
1291
+ { path: u, name: "webx.vacancies", component: Kt, props: { base: u } },
1259
1292
  {
1260
- path: `${c}/:id(\\d+)`,
1293
+ path: `${u}/:id(\\d+)`,
1261
1294
  name: "webx.vacancies.edit",
1262
- component: Qt,
1263
- props: { base: c }
1295
+ component: Xt,
1296
+ props: { base: u }
1264
1297
  }
1265
1298
  ],
1266
1299
  /*
@@ -1269,28 +1302,28 @@ function ra(r = {}) {
1269
1302
  * `wx-date-picker`, `wx-checkbox-group`).
1270
1303
  */
1271
1304
  types: {
1272
- "wx-vacancy-history": { component: aa, kind: "display" }
1305
+ "wx-vacancy-history": { component: na, kind: "display" }
1273
1306
  }
1274
1307
  },
1275
1308
  {
1276
1309
  id: "vacancy-categories",
1277
- path: `${c}/categories`,
1278
- routes: nt(na(c))
1310
+ path: `${u}/categories`,
1311
+ routes: lt(la(u))
1279
1312
  }
1280
1313
  ];
1281
1314
  }
1282
1315
  export {
1283
- Ie as VACANCIES_API,
1284
- Ht as WxVacanciesPage,
1285
- Rt as WxVacancyCreateDialog,
1286
- Qt as WxVacancyEditorPage,
1287
- aa as WxVacancyHistory,
1288
- pe as createVacanciesApi,
1289
- Kt as provideVacancyEditor,
1290
- jt as useVacancyEditor,
1291
- ra as vacancies,
1292
- It as vacanciesMessages,
1293
- na as vacancyCategoriesOptions,
1294
- Fe as vacancyEditorKey
1316
+ Se as VACANCIES_API,
1317
+ Kt as WxVacanciesPage,
1318
+ St as WxVacancyCreateDialog,
1319
+ Xt as WxVacancyEditorPage,
1320
+ na as WxVacancyHistory,
1321
+ ve as createVacanciesApi,
1322
+ jt as provideVacancyEditor,
1323
+ Yt as useVacancyEditor,
1324
+ ca as vacancies,
1325
+ Nt as vacanciesMessages,
1326
+ la as vacancyCategoriesOptions,
1327
+ He as vacancyEditorKey
1295
1328
  };
1296
1329
  //# sourceMappingURL=index.js.map