@webx-ui/module-auth 0.10.2 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,72 +1,72 @@
1
- import { inject as ye, defineComponent as Q, computed as T, ref as z, useTemplateRef as ue, onBeforeUnmount as Ze, resolveComponent as H, openBlock as h, createBlock as $, withCtx as t, createVNode as a, withModifiers as Fe, createCommentVNode as E, createElementVNode as V, createTextVNode as d, toDisplayString as o, watch as ce, unref as e, isRef as ge, normalizeClass as Re, createElementBlock as Y, resolveDynamicComponent as Be, createSlots as we, Fragment as ie, renderList as _e, onMounted as et, h as Oe } from "vue";
2
- import { useTranslate as j, HttpError as tt, useAdmin as Z, useI18n as Ee, useErrorText as me, rowMenuWidth as at, WxDate as re, WxRowMenu as Se, WxFilterChips as De, WxListScreen as Me, WxScreen as lt, useTheme as nt } from "@webx-ui/module-admin";
3
- import { useRouter as st, useRoute as ot } from "vue-router";
4
- import { useModal as xe, WxDialog as ke, WxFormItem as K, WxInput as le, WxSelect as ne, WxSpace as se, WxCheckbox as Le, WxText as O, WxButton as N, toast as G, useElementWidth as Ce, WxTable as $e, WxEntityCard as Ae, WxBadge as J, WxAvatar as it, WxIcon as ee, confirm as Ne, createModal as Ve, WxHeading as de, WxCard as be, WxSkeleton as rt, WxTabs as ut, WxTab as fe, WxAlert as ct, WxThemeSwitch as dt } from "@webx-ui/core";
5
- const Ie = /* @__PURE__ */ Symbol("webx-auth");
6
- function ze() {
7
- const n = ye(Ie, null);
8
- if (n === null)
1
+ import { inject as xe, defineComponent as Q, computed as T, ref as A, useTemplateRef as oe, onBeforeUnmount as nt, resolveComponent as J, openBlock as m, createBlock as b, withCtx as t, createVNode as a, withModifiers as Oe, createCommentVNode as I, createElementVNode as S, createTextVNode as c, toDisplayString as i, watch as de, unref as e, isRef as Ve, normalizeClass as Be, createElementBlock as H, resolveDynamicComponent as Ee, createSlots as Ae, Fragment as ue, renderList as Ce, onMounted as Ie, h as De } from "vue";
2
+ import { useTranslate as G, HttpError as st, useAdmin as X, useI18n as Ne, useErrorText as re, rowMenuWidth as ot, WxDate as ae, WxRowMenu as Se, WxFilterChips as Me, WxListScreen as Ke, WxScreen as it, useTheme as ut } from "@webx-ui/module-admin";
3
+ import { useRouter as rt, useRoute as ct } from "vue-router";
4
+ import { useModal as _e, WxDialog as be, WxFormItem as M, WxInput as le, WxSelect as ne, WxSpace as se, WxCheckbox as Le, WxText as E, WxButton as N, toast as K, useElementWidth as ge, WxTable as ke, WxEntityCard as we, WxBadge as q, WxAvatar as dt, WxIcon as Z, confirm as ze, WxAlert as qe, WxRadioGroup as mt, createModal as he, WxHeading as me, WxCard as $e, WxSkeleton as vt, WxTabs as pt, WxTab as ye, WxThemeSwitch as ft } from "@webx-ui/core";
5
+ const He = /* @__PURE__ */ Symbol("webx-auth");
6
+ function We() {
7
+ const s = xe(He, null);
8
+ if (s === null)
9
9
  throw new Error("useAuth() was called outside a panel that installed the auth plugin.");
10
- return n;
10
+ return s;
11
11
  }
12
- function mt(n) {
13
- const u = `${n.apiPath}/auth`;
12
+ function yt(s) {
13
+ const r = `${s.apiPath}/auth`;
14
14
  return {
15
15
  async me() {
16
16
  try {
17
- return (await n.http.get(`${u}/me`)).data;
17
+ return (await s.http.get(`${r}/me`)).data;
18
18
  } catch (l) {
19
- if (pt(l))
19
+ if (_t(l))
20
20
  return null;
21
21
  throw l;
22
22
  }
23
23
  },
24
24
  async login(l) {
25
- const s = await n.http.post(`${u}/login`, {
25
+ const u = await s.http.post(`${r}/login`, {
26
26
  email: l.email,
27
27
  password: l.password,
28
28
  remember: l.remember ?? !1
29
29
  });
30
- return n.setUser(s.data), await n.reload(), s.data;
30
+ return s.setUser(u.data), await s.reload(), u.data;
31
31
  },
32
32
  async setLocale(l) {
33
- const s = await n.http.put(`${u}/locale`, { locale: l });
34
- n.setUser(s.data), await n.setLocale(l);
33
+ const u = await s.http.put(`${r}/locale`, { locale: l });
34
+ s.setUser(u.data), await s.setLocale(l);
35
35
  },
36
36
  async setTheme(l) {
37
- const s = await n.http.put(`${u}/theme`, {
37
+ const u = await s.http.put(`${r}/theme`, {
38
38
  theme: l === "system" ? null : l
39
39
  });
40
- n.setUser(s.data);
40
+ s.setUser(u.data);
41
41
  },
42
42
  async setSiteBar(l) {
43
- const s = await n.http.put(`${u}/site-bar`, { enabled: l });
44
- n.setUser(s.data);
43
+ const u = await s.http.put(`${r}/site-bar`, { enabled: l });
44
+ s.setUser(u.data);
45
45
  },
46
46
  async updateProfile(l) {
47
- const s = await n.http.put(
48
- `${u}/me`,
47
+ const u = await s.http.put(
48
+ `${r}/me`,
49
49
  l
50
50
  );
51
- return n.setUser(s.data), s.data;
51
+ return s.setUser(u.data), u.data;
52
52
  },
53
53
  async logout() {
54
54
  try {
55
- await n.http.post(`${u}/logout`);
55
+ await s.http.post(`${r}/logout`);
56
56
  } finally {
57
- n.setUser(null), n.state.status = "unauthenticated", n.state.manifest = null;
57
+ s.setUser(null), s.state.status = "unauthenticated", s.state.manifest = null;
58
58
  }
59
59
  }
60
60
  };
61
61
  }
62
- const qe = /* @__PURE__ */ Symbol("webx-auth-avatar"), He = /* @__PURE__ */ Symbol("webx-auth-avatar-field");
63
- function vt(n, u, l = null, s = null) {
64
- n.provide(Ie, u), n.provide(qe, l), n.provide(He, s);
62
+ const je = /* @__PURE__ */ Symbol("webx-auth-avatar"), Ge = /* @__PURE__ */ Symbol("webx-auth-avatar-field");
63
+ function ht(s, r, l = null, u = null) {
64
+ s.provide(He, r), s.provide(je, l), s.provide(Ge, u);
65
65
  }
66
- function pt(n) {
67
- return typeof n == "object" && n !== null && "status" in n && n.status === 401;
66
+ function _t(s) {
67
+ return typeof s == "object" && s !== null && "status" in s && s.status === 401;
68
68
  }
69
- const ft = ["title", "aria-label", "aria-pressed"], ht = /* @__PURE__ */ Q({
69
+ const bt = ["title", "aria-label", "aria-pressed"], gt = /* @__PURE__ */ Q({
70
70
  __name: "LoginCard",
71
71
  props: {
72
72
  emailLabel: { default: void 0 },
@@ -81,171 +81,171 @@ const ft = ["title", "aria-label", "aria-pressed"], ht = /* @__PURE__ */ Q({
81
81
  autofocus: { type: Boolean, default: !0 }
82
82
  },
83
83
  emits: ["success"],
84
- setup(n, { expose: u, emit: l }) {
85
- const s = n, g = l, c = ze(), A = j("webx-auth"), r = T(() => ({
86
- email: s.emailLabel ?? A("card.email"),
87
- password: s.passwordLabel ?? A("card.password"),
88
- remember: s.rememberLabel ?? A("card.remember"),
89
- submit: s.submitLabel ?? A("card.submit"),
90
- capsLock: s.capsLockWarning ?? A("card.caps-lock"),
91
- reveal: s.revealLabel ?? A("card.reveal"),
92
- hide: s.hideLabel ?? A("card.hide")
93
- })), m = z(""), U = z(""), p = z(!1), w = z(!1), x = z(!1), f = z(!1), y = z(""), v = z({}), _ = z(0), P = ue("emailField");
94
- let W = null;
95
- Ze(D);
96
- const F = T(() => _.value > 0), i = T(
97
- () => s.throttleMessage === void 0 ? A("card.throttled", { seconds: _.value }) : s.throttleMessage.replace(":seconds", String(_.value))
84
+ setup(s, { expose: r, emit: l }) {
85
+ const u = s, v = l, y = We(), V = G("webx-auth"), o = T(() => ({
86
+ email: u.emailLabel ?? V("card.email"),
87
+ password: u.passwordLabel ?? V("card.password"),
88
+ remember: u.rememberLabel ?? V("card.remember"),
89
+ submit: u.submitLabel ?? V("card.submit"),
90
+ capsLock: u.capsLockWarning ?? V("card.caps-lock"),
91
+ reveal: u.revealLabel ?? V("card.reveal"),
92
+ hide: u.hideLabel ?? V("card.hide")
93
+ })), h = A(""), F = A(""), d = A(!1), w = A(!1), x = A(!1), p = A(!1), g = A(""), _ = A({}), k = A(0), B = oe("emailField");
94
+ let C = null;
95
+ nt(U);
96
+ const O = T(() => k.value > 0), n = T(
97
+ () => u.throttleMessage === void 0 ? V("card.throttled", { seconds: k.value }) : u.throttleMessage.replace(":seconds", String(k.value))
98
98
  );
99
- async function b() {
100
- if (!(w.value || F.value)) {
101
- w.value = !0, y.value = "", v.value = {};
99
+ async function $() {
100
+ if (!(w.value || O.value)) {
101
+ w.value = !0, g.value = "", _.value = {};
102
102
  try {
103
- await c.login({
104
- email: m.value,
105
- password: U.value,
106
- remember: p.value
107
- }), U.value = "", g("success");
108
- } catch (k) {
109
- L(k);
103
+ await y.login({
104
+ email: h.value,
105
+ password: F.value,
106
+ remember: d.value
107
+ }), F.value = "", v("success");
108
+ } catch (f) {
109
+ R(f);
110
110
  } finally {
111
111
  w.value = !1;
112
112
  }
113
113
  }
114
114
  }
115
- function L(k) {
116
- if (!(k instanceof tt)) {
117
- y.value = k instanceof Error ? k.message : String(k);
115
+ function R(f) {
116
+ if (!(f instanceof st)) {
117
+ g.value = f instanceof Error ? f.message : String(f);
118
118
  return;
119
119
  }
120
- if (k.isValidation) {
121
- v.value = k.errors;
120
+ if (f.isValidation) {
121
+ _.value = f.errors;
122
122
  return;
123
123
  }
124
- if (k.isThrottled) {
125
- I(k.retryAfter ?? 60);
124
+ if (f.isThrottled) {
125
+ Y(f.retryAfter ?? 60);
126
126
  return;
127
127
  }
128
- y.value = k.message;
128
+ g.value = f.message;
129
129
  }
130
- function I(k) {
131
- D(), _.value = k, W = setInterval(() => {
132
- _.value -= 1, _.value <= 0 && D();
130
+ function Y(f) {
131
+ U(), k.value = f, C = setInterval(() => {
132
+ k.value -= 1, k.value <= 0 && U();
133
133
  }, 1e3);
134
134
  }
135
- function D() {
136
- W !== null && (clearInterval(W), W = null), _.value = 0;
135
+ function U() {
136
+ C !== null && (clearInterval(C), C = null), k.value = 0;
137
137
  }
138
- function q(k) {
139
- f.value = k.getModifierState("CapsLock");
138
+ function z(f) {
139
+ p.value = f.getModifierState("CapsLock");
140
140
  }
141
- return u({ focus: () => P.value?.focus() }), (k, R) => {
142
- const C = H("wx-alert"), X = H("wx-icon"), pe = H("wx-input"), B = H("wx-form-item"), M = H("wx-checkbox"), S = H("wx-button"), ae = H("wx-form"), Xe = H("wx-card");
143
- return h(), $(Xe, {
141
+ return r({ focus: () => B.value?.focus() }), (f, L) => {
142
+ const W = J("wx-alert"), te = J("wx-icon"), fe = J("wx-input"), D = J("wx-form-item"), j = J("wx-checkbox"), P = J("wx-button"), ie = J("wx-form"), lt = J("wx-card");
143
+ return m(), b(lt, {
144
144
  class: "wx-login",
145
145
  padding: 24
146
146
  }, {
147
147
  default: t(() => [
148
- a(ae, {
149
- errors: v.value,
148
+ a(ie, {
149
+ errors: _.value,
150
150
  disabled: w.value,
151
151
  gap: "md",
152
- onSubmit: Fe(b, ["prevent"])
152
+ onSubmit: Oe($, ["prevent"])
153
153
  }, {
154
154
  default: t(() => [
155
- y.value !== "" ? (h(), $(C, {
155
+ g.value !== "" ? (m(), b(W, {
156
156
  key: 0,
157
157
  type: "danger",
158
158
  variant: "soft",
159
159
  live: "",
160
- description: y.value,
160
+ description: g.value,
161
161
  class: "wx-login__message"
162
- }, null, 8, ["description"])) : F.value ? (h(), $(C, {
162
+ }, null, 8, ["description"])) : O.value ? (m(), b(W, {
163
163
  key: 1,
164
164
  type: "warning",
165
165
  variant: "soft",
166
166
  live: "",
167
- description: i.value,
167
+ description: n.value,
168
168
  class: "wx-login__message"
169
- }, null, 8, ["description"])) : E("", !0),
170
- a(B, { name: "email" }, {
169
+ }, null, 8, ["description"])) : I("", !0),
170
+ a(D, { name: "email" }, {
171
171
  default: t(() => [
172
- a(pe, {
172
+ a(fe, {
173
173
  ref_key: "emailField",
174
- ref: P,
175
- modelValue: m.value,
176
- "onUpdate:modelValue": R[0] || (R[0] = (oe) => m.value = oe),
174
+ ref: B,
175
+ modelValue: h.value,
176
+ "onUpdate:modelValue": L[0] || (L[0] = (ce) => h.value = ce),
177
177
  type: "email",
178
- placeholder: r.value.email,
179
- "aria-label": r.value.email,
178
+ placeholder: o.value.email,
179
+ "aria-label": o.value.email,
180
180
  autocomplete: "username",
181
- autofocus: n.autofocus,
181
+ autofocus: s.autofocus,
182
182
  inputmode: "email",
183
183
  size: "lg"
184
184
  }, {
185
185
  prefix: t(() => [
186
- a(X, { name: "mail" })
186
+ a(te, { name: "mail" })
187
187
  ]),
188
188
  _: 1
189
189
  }, 8, ["modelValue", "placeholder", "aria-label", "autofocus"])
190
190
  ]),
191
191
  _: 1
192
192
  }),
193
- a(B, {
193
+ a(D, {
194
194
  name: "password",
195
- help: f.value ? r.value.capsLock : void 0
195
+ help: p.value ? o.value.capsLock : void 0
196
196
  }, {
197
197
  default: t(() => [
198
- a(pe, {
199
- modelValue: U.value,
200
- "onUpdate:modelValue": R[2] || (R[2] = (oe) => U.value = oe),
198
+ a(fe, {
199
+ modelValue: F.value,
200
+ "onUpdate:modelValue": L[2] || (L[2] = (ce) => F.value = ce),
201
201
  type: x.value ? "text" : "password",
202
- placeholder: r.value.password,
203
- "aria-label": r.value.password,
202
+ placeholder: o.value.password,
203
+ "aria-label": o.value.password,
204
204
  autocomplete: "current-password",
205
205
  size: "lg",
206
- onKeydown: q,
207
- onKeyup: q
206
+ onKeydown: z,
207
+ onKeyup: z
208
208
  }, {
209
209
  prefix: t(() => [
210
- a(X, { name: "lock" })
210
+ a(te, { name: "lock" })
211
211
  ]),
212
212
  suffix: t(() => [
213
- V("button", {
213
+ S("button", {
214
214
  type: "button",
215
215
  class: "wx-login__reveal",
216
- title: x.value ? r.value.hide : r.value.reveal,
217
- "aria-label": x.value ? r.value.hide : r.value.reveal,
216
+ title: x.value ? o.value.hide : o.value.reveal,
217
+ "aria-label": x.value ? o.value.hide : o.value.reveal,
218
218
  "aria-pressed": x.value,
219
219
  tabindex: "-1",
220
- onClick: R[1] || (R[1] = (oe) => x.value = !x.value)
220
+ onClick: L[1] || (L[1] = (ce) => x.value = !x.value)
221
221
  }, [
222
- a(X, {
222
+ a(te, {
223
223
  name: x.value ? "eye-off" : "eye"
224
224
  }, null, 8, ["name"])
225
- ], 8, ft)
225
+ ], 8, bt)
226
226
  ]),
227
227
  _: 1
228
228
  }, 8, ["modelValue", "type", "placeholder", "aria-label"])
229
229
  ]),
230
230
  _: 1
231
231
  }, 8, ["help"]),
232
- n.remember ? (h(), $(M, {
232
+ s.remember ? (m(), b(j, {
233
233
  key: 2,
234
- modelValue: p.value,
235
- "onUpdate:modelValue": R[3] || (R[3] = (oe) => p.value = oe),
236
- label: r.value.remember,
234
+ modelValue: d.value,
235
+ "onUpdate:modelValue": L[3] || (L[3] = (ce) => d.value = ce),
236
+ label: o.value.remember,
237
237
  class: "wx-login__remember"
238
- }, null, 8, ["modelValue", "label"])) : E("", !0),
239
- a(S, {
238
+ }, null, 8, ["modelValue", "label"])) : I("", !0),
239
+ a(P, {
240
240
  type: "primary",
241
241
  "native-type": "submit",
242
242
  size: "lg",
243
243
  block: "",
244
244
  loading: w.value,
245
- disabled: F.value
245
+ disabled: O.value
246
246
  }, {
247
247
  default: t(() => [
248
- d(o(r.value.submit), 1)
248
+ c(i(o.value.submit), 1)
249
249
  ]),
250
250
  _: 1
251
251
  }, 8, ["loading", "disabled"])
@@ -257,20 +257,20 @@ const ft = ["title", "aria-label", "aria-pressed"], ht = /* @__PURE__ */ Q({
257
257
  });
258
258
  };
259
259
  }
260
- }), ve = (n, u) => {
261
- const l = n.__vccOpts || n;
262
- for (const [s, g] of u)
263
- l[s] = g;
260
+ }), ve = (s, r) => {
261
+ const l = s.__vccOpts || s;
262
+ for (const [u, v] of r)
263
+ l[u] = v;
264
264
  return l;
265
- }, yt = /* @__PURE__ */ ve(ht, [["__scopeId", "data-v-3c206e31"]]);
266
- function Ke(n) {
267
- return n.types["wx-media"]?.component ?? null;
265
+ }, kt = /* @__PURE__ */ ve(gt, [["__scopeId", "data-v-3c206e31"]]);
266
+ function Ye(s) {
267
+ return s.types["wx-media"]?.component ?? null;
268
268
  }
269
- function Ye(n) {
270
- const u = n.assetUrls;
271
- return u ? async (l) => (await u([l]))[l] ?? null : null;
269
+ function Je(s) {
270
+ const r = s.assetUrls;
271
+ return r ? async (l) => (await r([l]))[l] ?? null : null;
272
272
  }
273
- const je = {
273
+ const Qe = {
274
274
  card: {
275
275
  email: "Email",
276
276
  password: "Password",
@@ -378,6 +378,56 @@ const je = {
378
378
  done: ":client is disconnected",
379
379
  deleted: "Administrator #:id"
380
380
  },
381
+ // Keys for programs, issued and revoked under Administrators → Keys.
382
+ keys: {
383
+ title: "Keys",
384
+ issue: "Issue a key",
385
+ "issue-short": "Issue",
386
+ lead: "A key lets a program — a queue watcher, a nightly import — work in this panel without a browser. It acts as the administrator you choose and can never do more than they may. A key is a program, not a person: what a module keeps for a person, such as a stage checked by hand, it cannot do.",
387
+ name: "Name",
388
+ "name-hint": 'What the program is, so that the list says it: "queue watcher", "nightly import".',
389
+ who: "Acts as",
390
+ "who-hint": "Everything the key changes is done in this administrator's name, within their permissions.",
391
+ allowed: "What is allowed",
392
+ everything: "Everything the administrator may do",
393
+ chosen: "Only the scopes chosen below",
394
+ scopes: "Scopes",
395
+ "scopes-hint": "A module installed later is out of reach until a new key names it.",
396
+ "scopes-required": "Choose at least one scope.",
397
+ lifetime: "Lives for",
398
+ "lifetime-hint": "A key cannot be extended: issue a new one before this one runs out, then revoke the old one.",
399
+ "days-30": "30 days",
400
+ "days-90": "90 days",
401
+ "days-365": "1 year",
402
+ "days-1095": "3 years",
403
+ "days-3650": "10 years",
404
+ "issued-title": "Copy the key now",
405
+ "issued-text": "This is the only time the key is shown. Nobody can see it again — not here, not on the server. If it is lost, revoke it and issue a new one.",
406
+ secret: "Key",
407
+ copy: "Copy",
408
+ copied: "Copied",
409
+ "copy-failed": "Could not reach the clipboard. Select the key and copy it by hand.",
410
+ address: "Server address",
411
+ "header-hint": "The program sends the key in a header: Authorization: Bearer <key>.",
412
+ done: "Done",
413
+ cancel: "Cancel",
414
+ expires: "Expires",
415
+ until: "until",
416
+ "last-used": "Last used",
417
+ "never-used": "Never",
418
+ "issued-by": "Issued by :name",
419
+ "issued-console": "Issued in a terminal",
420
+ full: "Everything :name can do",
421
+ deleted: "Administrator #:id",
422
+ revoke: "Revoke",
423
+ revoked: "Revoked",
424
+ expired: "Expired",
425
+ "confirm-title": "Revoke :name?",
426
+ "confirm-text": "The program using it is refused from its next call. A revoked key cannot be switched back on.",
427
+ confirm: "Revoke",
428
+ "revoked-done": ":name is revoked",
429
+ empty: "No keys have been issued"
430
+ },
381
431
  connect: {
382
432
  lead: "An AI agent — Claude, ChatGPT, Cursor — can work in this panel as you. Give it the address below; it will ask you to sign in and then ask what it may do.",
383
433
  title: "Connect an agent",
@@ -440,56 +490,56 @@ const je = {
440
490
  "site-bar": "Panel on the site"
441
491
  }
442
492
  };
443
- function he(n) {
444
- const u = `${n.apiPath}/auth`, l = (s) => s.data;
493
+ function pe(s) {
494
+ const r = `${s.apiPath}/auth`, l = (u) => u.data;
445
495
  return {
446
- list: (s = {}) => n.http.get(`${u}/admins`, {
496
+ list: (u = {}) => s.http.get(`${r}/admins`, {
447
497
  query: {
448
- q: s.q || void 0,
449
- role: s.role ?? void 0,
450
- active: s.active ?? void 0,
451
- sort: s.sort,
452
- page: s.page,
453
- per_page: s.per_page
498
+ q: u.q || void 0,
499
+ role: u.role ?? void 0,
500
+ active: u.active ?? void 0,
501
+ sort: u.sort,
502
+ page: u.page,
503
+ per_page: u.per_page
454
504
  }
455
- }).then((g) => ({ ...g.meta, data: g.data })),
456
- get: (s) => n.http.get(`${u}/admins/${s}`).then(l),
457
- create: (s) => n.http.post(`${u}/admins`, s).then(l),
458
- update: (s, g) => n.http.patch(`${u}/admins/${s}`, g).then(l),
459
- remove: (s) => n.http.delete(`${u}/admins/${s}`),
460
- roles: () => n.http.get(`${u}/roles`).then(l),
461
- calls: (s = {}) => n.http.get(`${u}/mcp-calls`, {
505
+ }).then((v) => ({ ...v.meta, data: v.data })),
506
+ get: (u) => s.http.get(`${r}/admins/${u}`).then(l),
507
+ create: (u) => s.http.post(`${r}/admins`, u).then(l),
508
+ update: (u, v) => s.http.patch(`${r}/admins/${u}`, v).then(l),
509
+ remove: (u) => s.http.delete(`${r}/admins/${u}`),
510
+ roles: () => s.http.get(`${r}/roles`).then(l),
511
+ calls: (u = {}) => s.http.get(`${r}/mcp-calls`, {
462
512
  query: {
463
- user: s.user ?? void 0,
464
- tool: s.tool ?? void 0,
465
- outcome: s.outcome ?? void 0,
466
- page: s.page,
467
- per_page: s.per_page
513
+ user: u.user ?? void 0,
514
+ tool: u.tool ?? void 0,
515
+ outcome: u.outcome ?? void 0,
516
+ page: u.page,
517
+ per_page: u.per_page
468
518
  }
469
- }).then((g) => ({ ...g.meta, data: g.data, filters: g.filters }))
519
+ }).then((v) => ({ ...v.meta, data: v.data, filters: v.filters }))
470
520
  };
471
521
  }
472
- const We = /* @__PURE__ */ new WeakSet();
473
- function te() {
522
+ const Te = /* @__PURE__ */ new WeakSet();
523
+ function ee() {
474
524
  try {
475
- const { i18n: n } = Z();
476
- We.has(n) || (n.defaults("webx-auth", je), We.add(n));
525
+ const { i18n: s } = X();
526
+ Te.has(s) || (s.defaults("webx-auth", Qe), Te.add(s));
477
527
  } catch {
478
528
  }
479
529
  }
480
- const _t = { class: "wx-admin-form" }, bt = {
530
+ const wt = { class: "wx-admin-form" }, xt = {
481
531
  key: 0,
482
532
  class: "wx-admin-form__aside"
483
- }, gt = { class: "wx-admin-form__fields" }, wt = /* @__PURE__ */ Q({
533
+ }, Ct = { class: "wx-admin-form__fields" }, $t = /* @__PURE__ */ Q({
484
534
  __name: "AdminDialog",
485
535
  props: {
486
536
  admin: { default: null },
487
537
  avatarField: { default: void 0 }
488
538
  },
489
- setup(n) {
490
- const u = n, { resolve: l, dismiss: s, open: g } = xe(), c = Z(), A = he(c), r = Ee();
491
- te();
492
- const m = j("webx-auth"), U = me(), p = z([]), w = z(!1), x = z({}), f = z({
539
+ setup(s) {
540
+ const r = s, { resolve: l, dismiss: u, open: v } = _e(), y = X(), V = pe(y), o = Ne();
541
+ ee();
542
+ const h = G("webx-auth"), F = re(), d = A([]), w = A(!1), x = A({}), p = A({
493
543
  name: "",
494
544
  email: "",
495
545
  password: "",
@@ -498,60 +548,60 @@ const _t = { class: "wx-admin-form" }, bt = {
498
548
  is_super: !1,
499
549
  locale: null,
500
550
  roles: []
501
- }), y = T({
502
- get: () => f.value.avatar ? { path: f.value.avatar } : null,
503
- set: (i) => {
504
- f.value.avatar = i?.path ?? null;
551
+ }), g = T({
552
+ get: () => p.value.avatar ? { path: p.value.avatar } : null,
553
+ set: (n) => {
554
+ p.value.avatar = n?.path ?? null;
505
555
  }
506
- }), v = T(() => u.admin !== null), _ = T(() => p.value.map((i) => ({ value: i.id, label: i.name }))), P = T(() => [
507
- { value: "auto", label: m("admins.locale-auto") },
508
- ...r.state.panelLocales.map((i) => ({ value: i.code, label: i.nativeName }))
556
+ }), _ = T(() => r.admin !== null), k = T(() => d.value.map((n) => ({ value: n.id, label: n.name }))), B = T(() => [
557
+ { value: "auto", label: h("admins.locale-auto") },
558
+ ...o.state.panelLocales.map((n) => ({ value: n.code, label: n.nativeName }))
509
559
  ]);
510
- A.roles().then((i) => p.value = i), ce(
511
- () => u.admin,
512
- (i) => {
513
- f.value = {
514
- name: i?.name ?? "",
515
- email: i?.email ?? "",
560
+ V.roles().then((n) => d.value = n), de(
561
+ () => r.admin,
562
+ (n) => {
563
+ p.value = {
564
+ name: n?.name ?? "",
565
+ email: n?.email ?? "",
516
566
  password: "",
517
- avatar: i?.avatar ?? null,
518
- is_active: i?.is_active ?? !0,
519
- is_super: i?.is_super ?? !1,
520
- locale: i?.locale ?? "auto",
521
- roles: i?.roles.map((b) => b.id) ?? []
567
+ avatar: n?.avatar ?? null,
568
+ is_active: n?.is_active ?? !0,
569
+ is_super: n?.is_super ?? !1,
570
+ locale: n?.locale ?? "auto",
571
+ roles: n?.roles.map(($) => $.id) ?? []
522
572
  }, x.value = {};
523
573
  },
524
574
  { immediate: !0 }
525
575
  );
526
- function W(i) {
527
- return x.value[i]?.[0];
576
+ function C(n) {
577
+ return x.value[n]?.[0];
528
578
  }
529
- async function F() {
579
+ async function O() {
530
580
  w.value = !0, x.value = {};
531
- const i = {
532
- name: f.value.name,
533
- email: f.value.email,
534
- avatar: f.value.avatar,
535
- is_active: f.value.is_active,
536
- is_super: f.value.is_super,
537
- locale: f.value.locale === "auto" ? null : f.value.locale,
538
- roles: f.value.roles ?? []
581
+ const n = {
582
+ name: p.value.name,
583
+ email: p.value.email,
584
+ avatar: p.value.avatar,
585
+ is_active: p.value.is_active,
586
+ is_super: p.value.is_super,
587
+ locale: p.value.locale === "auto" ? null : p.value.locale,
588
+ roles: p.value.roles ?? []
539
589
  };
540
- f.value.password && (i.password = f.value.password);
590
+ p.value.password && (n.password = p.value.password);
541
591
  try {
542
- const b = u.admin ? await A.update(u.admin.id, i) : await A.create(i);
543
- G.success(m(v.value ? "admins.updated" : "admins.created")), l(b);
544
- } catch (b) {
545
- const L = b.body;
546
- L?.errors ? x.value = L.errors : G.danger(U(b));
592
+ const $ = r.admin ? await V.update(r.admin.id, n) : await V.create(n);
593
+ K.success(h(_.value ? "admins.updated" : "admins.created")), l($);
594
+ } catch ($) {
595
+ const R = $.body;
596
+ R?.errors ? x.value = R.errors : K.danger(F($));
547
597
  } finally {
548
598
  w.value = !1;
549
599
  }
550
600
  }
551
- return (i, b) => (h(), $(e(ke), {
552
- open: e(g),
553
- "onUpdate:open": b[9] || (b[9] = (L) => ge(g) ? g.value = L : null),
554
- title: v.value ? e(m)("admins.edit-short") : e(m)("admins.new-short"),
601
+ return (n, $) => (m(), b(e(be), {
602
+ open: e(v),
603
+ "onUpdate:open": $[9] || ($[9] = (R) => Ve(v) ? v.value = R : null),
604
+ title: _.value ? e(h)("admins.edit-short") : e(h)("admins.new-short"),
555
605
  width: 720
556
606
  }, {
557
607
  footer: t(() => [
@@ -559,20 +609,20 @@ const _t = { class: "wx-admin-form" }, bt = {
559
609
  default: t(() => [
560
610
  a(e(N), {
561
611
  variant: "outline",
562
- onClick: b[8] || (b[8] = (L) => e(s)())
612
+ onClick: $[8] || ($[8] = (R) => e(u)())
563
613
  }, {
564
614
  default: t(() => [
565
- d(o(e(m)("admins.cancel")), 1)
615
+ c(i(e(h)("admins.cancel")), 1)
566
616
  ]),
567
617
  _: 1
568
618
  }),
569
619
  a(e(N), {
570
620
  type: "primary",
571
621
  loading: w.value,
572
- onClick: F
622
+ onClick: O
573
623
  }, {
574
624
  default: t(() => [
575
- d(o(e(m)("admins.save")), 1)
625
+ c(i(e(h)("admins.save")), 1)
576
626
  ]),
577
627
  _: 1
578
628
  }, 8, ["loading"])
@@ -581,41 +631,41 @@ const _t = { class: "wx-admin-form" }, bt = {
581
631
  })
582
632
  ]),
583
633
  default: t(() => [
584
- V("div", _t, [
585
- V("div", {
586
- class: Re(["wx-admin-form__grid", { "has-aside": n.avatarField }])
634
+ S("div", wt, [
635
+ S("div", {
636
+ class: Be(["wx-admin-form__grid", { "has-aside": s.avatarField }])
587
637
  }, [
588
- n.avatarField ? (h(), Y("div", bt, [
589
- (h(), $(Be(n.avatarField), {
590
- modelValue: y.value,
591
- "onUpdate:modelValue": b[0] || (b[0] = (L) => y.value = L),
592
- label: e(m)("admins.avatar"),
638
+ s.avatarField ? (m(), H("div", xt, [
639
+ (m(), b(Ee(s.avatarField), {
640
+ modelValue: g.value,
641
+ "onUpdate:modelValue": $[0] || ($[0] = (R) => g.value = R),
642
+ label: e(h)("admins.avatar"),
593
643
  aspect: "1/1",
594
644
  captions: !1
595
645
  }, null, 8, ["modelValue", "label"]))
596
- ])) : E("", !0),
597
- V("div", gt, [
598
- a(e(K), {
599
- label: e(m)("admins.name"),
600
- error: W("name")
646
+ ])) : I("", !0),
647
+ S("div", Ct, [
648
+ a(e(M), {
649
+ label: e(h)("admins.name"),
650
+ error: C("name")
601
651
  }, {
602
652
  default: t(() => [
603
653
  a(e(le), {
604
- modelValue: f.value.name,
605
- "onUpdate:modelValue": b[1] || (b[1] = (L) => f.value.name = L),
654
+ modelValue: p.value.name,
655
+ "onUpdate:modelValue": $[1] || ($[1] = (R) => p.value.name = R),
606
656
  name: "name"
607
657
  }, null, 8, ["modelValue"])
608
658
  ]),
609
659
  _: 1
610
660
  }, 8, ["label", "error"]),
611
- a(e(K), {
612
- label: e(m)("admins.email"),
613
- error: W("email")
661
+ a(e(M), {
662
+ label: e(h)("admins.email"),
663
+ error: C("email")
614
664
  }, {
615
665
  default: t(() => [
616
666
  a(e(le), {
617
- modelValue: f.value.email,
618
- "onUpdate:modelValue": b[2] || (b[2] = (L) => f.value.email = L),
667
+ modelValue: p.value.email,
668
+ "onUpdate:modelValue": $[2] || ($[2] = (R) => p.value.email = R),
619
669
  type: "email",
620
670
  name: "email",
621
671
  autocomplete: "off"
@@ -623,15 +673,15 @@ const _t = { class: "wx-admin-form" }, bt = {
623
673
  ]),
624
674
  _: 1
625
675
  }, 8, ["label", "error"]),
626
- a(e(K), {
627
- label: e(m)("admins.password"),
628
- error: W("password"),
629
- help: v.value ? e(m)("admins.password-keep") : e(m)("admins.password-hint")
676
+ a(e(M), {
677
+ label: e(h)("admins.password"),
678
+ error: C("password"),
679
+ help: _.value ? e(h)("admins.password-keep") : e(h)("admins.password-hint")
630
680
  }, {
631
681
  default: t(() => [
632
682
  a(e(le), {
633
- modelValue: f.value.password,
634
- "onUpdate:modelValue": b[3] || (b[3] = (L) => f.value.password = L),
683
+ modelValue: p.value.password,
684
+ "onUpdate:modelValue": $[3] || ($[3] = (R) => p.value.password = R),
635
685
  type: "password",
636
686
  name: "password",
637
687
  autocomplete: "new-password"
@@ -639,28 +689,28 @@ const _t = { class: "wx-admin-form" }, bt = {
639
689
  ]),
640
690
  _: 1
641
691
  }, 8, ["label", "error", "help"]),
642
- a(e(K), {
643
- label: e(m)("admins.roles"),
644
- error: W("roles")
692
+ a(e(M), {
693
+ label: e(h)("admins.roles"),
694
+ error: C("roles")
645
695
  }, {
646
696
  default: t(() => [
647
697
  a(e(ne), {
648
- modelValue: f.value.roles,
649
- "onUpdate:modelValue": b[4] || (b[4] = (L) => f.value.roles = L),
650
- options: _.value,
698
+ modelValue: p.value.roles,
699
+ "onUpdate:modelValue": $[4] || ($[4] = (R) => p.value.roles = R),
700
+ options: k.value,
651
701
  multiple: ""
652
702
  }, null, 8, ["modelValue", "options"])
653
703
  ]),
654
704
  _: 1
655
705
  }, 8, ["label", "error"]),
656
- a(e(K), {
657
- label: e(m)("admins.locale")
706
+ a(e(M), {
707
+ label: e(h)("admins.locale")
658
708
  }, {
659
709
  default: t(() => [
660
710
  a(e(ne), {
661
- modelValue: f.value.locale,
662
- "onUpdate:modelValue": b[5] || (b[5] = (L) => f.value.locale = L),
663
- options: P.value
711
+ modelValue: p.value.locale,
712
+ "onUpdate:modelValue": $[5] || ($[5] = (R) => p.value.locale = R),
713
+ options: B.value
664
714
  }, null, 8, ["modelValue", "options"])
665
715
  ]),
666
716
  _: 1
@@ -668,24 +718,24 @@ const _t = { class: "wx-admin-form" }, bt = {
668
718
  a(e(se), { size: "md" }, {
669
719
  default: t(() => [
670
720
  a(e(Le), {
671
- modelValue: f.value.is_active,
672
- "onUpdate:modelValue": b[6] || (b[6] = (L) => f.value.is_active = L),
673
- label: e(m)("admins.active")
721
+ modelValue: p.value.is_active,
722
+ "onUpdate:modelValue": $[6] || ($[6] = (R) => p.value.is_active = R),
723
+ label: e(h)("admins.active")
674
724
  }, null, 8, ["modelValue", "label"]),
675
725
  a(e(Le), {
676
- modelValue: f.value.is_super,
677
- "onUpdate:modelValue": b[7] || (b[7] = (L) => f.value.is_super = L),
678
- label: e(m)("admins.super")
726
+ modelValue: p.value.is_super,
727
+ "onUpdate:modelValue": $[7] || ($[7] = (R) => p.value.is_super = R),
728
+ label: e(h)("admins.super")
679
729
  }, null, 8, ["modelValue", "label"])
680
730
  ]),
681
731
  _: 1
682
732
  }),
683
- a(e(O), {
733
+ a(e(E), {
684
734
  size: "sm",
685
735
  tone: "muted"
686
736
  }, {
687
737
  default: t(() => [
688
- d(o(e(m)("admins.super-hint")), 1)
738
+ c(i(e(h)("admins.super-hint")), 1)
689
739
  ]),
690
740
  _: 1
691
741
  })
@@ -696,7 +746,7 @@ const _t = { class: "wx-admin-form" }, bt = {
696
746
  _: 1
697
747
  }, 8, ["open", "title"]));
698
748
  }
699
- }), Te = 480, Ge = /* @__PURE__ */ Q({
749
+ }), Ue = 480, Xe = /* @__PURE__ */ Q({
700
750
  __name: "AdminList",
701
751
  props: {
702
752
  picking: { type: Boolean, default: !1 },
@@ -706,41 +756,41 @@ const _t = { class: "wx-admin-form" }, bt = {
706
756
  resolveAvatar: { type: Function, default: void 0 }
707
757
  },
708
758
  emits: ["open", "chosen", "selection", "remove"],
709
- setup(n, { expose: u, emit: l }) {
710
- const s = n, g = l, c = Z(), A = he(c);
711
- te();
712
- const r = ue("root"), m = Ce(r), U = T(() => m.value > 0 && m.value < Te), p = j("webx-auth"), w = j("webx-admin"), x = z(null), f = z([]), y = z(!1), v = z("all"), _ = z("any"), P = z([]), W = z({});
713
- let F = { page: 1, perPage: 20, sort: null, search: "" };
714
- const i = T(() => [
715
- { value: "all", label: p("admins.all-roles") },
716
- ...f.value.map((B) => ({ value: B.slug, label: B.name }))
717
- ]), b = T(() => [
718
- { value: "any", label: p("admins.any-state") },
719
- { value: "yes", label: p("admins.only-active") },
720
- { value: "no", label: p("admins.only-inactive") }
721
- ]), L = T(() => {
722
- const B = [], M = f.value.find((S) => S.slug === v.value);
723
- return M && B.push({
759
+ setup(s, { expose: r, emit: l }) {
760
+ const u = s, v = l, y = X(), V = pe(y);
761
+ ee();
762
+ const o = oe("root"), h = ge(o), F = T(() => h.value > 0 && h.value < Ue), d = G("webx-auth"), w = G("webx-admin"), x = A(null), p = A([]), g = A(!1), _ = A("all"), k = A("any"), B = A([]), C = A({});
763
+ let O = { page: 1, perPage: 20, sort: null, search: "" };
764
+ const n = T(() => [
765
+ { value: "all", label: d("admins.all-roles") },
766
+ ...p.value.map((D) => ({ value: D.slug, label: D.name }))
767
+ ]), $ = T(() => [
768
+ { value: "any", label: d("admins.any-state") },
769
+ { value: "yes", label: d("admins.only-active") },
770
+ { value: "no", label: d("admins.only-inactive") }
771
+ ]), R = T(() => {
772
+ const D = [], j = p.value.find((P) => P.slug === _.value);
773
+ return j && D.push({
724
774
  key: "role",
725
- label: `${p("admins.filter-role")}: ${M.name}`,
726
- clear: () => v.value = "all"
727
- }), _.value !== "any" && B.push({
775
+ label: `${d("admins.filter-role")}: ${j.name}`,
776
+ clear: () => _.value = "all"
777
+ }), k.value !== "any" && D.push({
728
778
  key: "state",
729
- label: `${p("admins.filter-state")}: ${_.value === "yes" ? p("admins.only-active") : p("admins.only-inactive")}`,
730
- clear: () => _.value = "any"
731
- }), B;
779
+ label: `${d("admins.filter-state")}: ${k.value === "yes" ? d("admins.only-active") : d("admins.only-inactive")}`,
780
+ clear: () => k.value = "any"
781
+ }), D;
732
782
  });
733
- function I() {
734
- v.value = "all", _.value = "any";
783
+ function Y() {
784
+ _.value = "all", k.value = "any";
735
785
  }
736
- const D = T(() => U.value ? [{ key: "card", label: "" }] : [
737
- { key: "name", label: p("admins.name"), sortable: !0 },
738
- { key: "email", label: p("admins.email"), sortable: !0, hideBelow: 560 },
739
- { key: "roles", label: p("admins.roles"), hideBelow: 760 },
740
- { key: "is_active", label: p("admins.active"), align: "center", hideBelow: 660 },
786
+ const U = T(() => F.value ? [{ key: "card", label: "" }] : [
787
+ { key: "name", label: d("admins.name"), sortable: !0 },
788
+ { key: "email", label: d("admins.email"), sortable: !0, hideBelow: 560 },
789
+ { key: "roles", label: d("admins.roles"), hideBelow: 760 },
790
+ { key: "is_active", label: d("admins.active"), align: "center", hideBelow: 660 },
741
791
  {
742
792
  key: "last_login_at",
743
- label: p("admins.last-login"),
793
+ label: d("admins.last-login"),
744
794
  sortable: !0,
745
795
  hideBelow: 900,
746
796
  // The first thing to go when a row becomes a card: it is a date somebody scans down a
@@ -750,205 +800,205 @@ const _t = { class: "wx-admin-form" }, bt = {
750
800
  {
751
801
  key: "actions",
752
802
  label: "",
753
- width: at,
803
+ width: ot,
754
804
  align: "right",
755
- hidden: !s.removable,
805
+ hidden: !u.removable,
756
806
  // A card puts them along its top instead, through the `card-actions` slot.
757
807
  hideOnCards: !0
758
808
  }
759
809
  ]);
760
- A.roles().then((B) => f.value = B), ce([v, _], () => q(F));
761
- async function q(B) {
762
- F = B, y.value = !0;
810
+ V.roles().then((D) => p.value = D), de([_, k], () => z(O));
811
+ async function z(D) {
812
+ O = D, g.value = !0;
763
813
  try {
764
- x.value = await A.list({
765
- q: B.search,
766
- role: v.value === "all" ? null : v.value,
767
- active: _.value === "any" ? null : _.value,
768
- sort: B.sort ? `${B.sort.order === "desc" ? "-" : ""}${B.sort.key}` : "name",
769
- page: B.page,
770
- per_page: B.perPage
771
- }), k();
814
+ x.value = await V.list({
815
+ q: D.search,
816
+ role: _.value === "all" ? null : _.value,
817
+ active: k.value === "any" ? null : k.value,
818
+ sort: D.sort ? `${D.sort.order === "desc" ? "-" : ""}${D.sort.key}` : "name",
819
+ page: D.page,
820
+ per_page: D.perPage
821
+ }), f();
772
822
  } finally {
773
- y.value = !1;
823
+ g.value = !1;
774
824
  }
775
825
  }
776
- async function k() {
777
- const B = s.resolveAvatar;
778
- if (B)
779
- for (const M of x.value?.data ?? []) {
780
- if (!M.avatar || W.value[M.avatar]) continue;
781
- const S = await B(M.avatar);
782
- S && (W.value = { ...W.value, [M.avatar]: S });
826
+ async function f() {
827
+ const D = u.resolveAvatar;
828
+ if (D)
829
+ for (const j of x.value?.data ?? []) {
830
+ if (!j.avatar || C.value[j.avatar]) continue;
831
+ const P = await D(j.avatar);
832
+ P && (C.value = { ...C.value, [j.avatar]: P });
783
833
  }
784
834
  }
785
- function R(B) {
835
+ function L(D) {
786
836
  return [
787
837
  {
788
838
  key: "delete",
789
839
  icon: "trash",
790
- label: p("admins.delete"),
840
+ label: d("admins.delete"),
791
841
  danger: !0,
792
- run: () => g("remove", B)
842
+ run: () => v("remove", D)
793
843
  }
794
844
  ];
795
845
  }
796
- function C(B) {
797
- if (s.picking) {
798
- g("chosen", [B]);
846
+ function W(D) {
847
+ if (u.picking) {
848
+ v("chosen", [D]);
799
849
  return;
800
850
  }
801
- g("open", B);
851
+ v("open", D);
802
852
  }
803
- const X = T(() => !(s.picking && s.multiple));
804
- function pe(B, M) {
805
- P.value = M, g("selection", M);
853
+ const te = T(() => !(u.picking && u.multiple));
854
+ function fe(D, j) {
855
+ B.value = j, v("selection", j);
806
856
  }
807
- return u({ reload: () => q(F), chosen: () => P.value }), (B, M) => (h(), Y("div", {
857
+ return r({ reload: () => z(O), chosen: () => B.value }), (D, j) => (m(), H("div", {
808
858
  ref_key: "root",
809
- ref: r,
859
+ ref: o,
810
860
  class: "wx-admin-list"
811
861
  }, [
812
- a(e($e), {
862
+ a(e(ke), {
813
863
  data: x.value,
814
- columns: D.value,
864
+ columns: U.value,
815
865
  "row-key": "id",
816
866
  searchable: "",
817
- clickable: X.value,
818
- hover: X.value,
867
+ clickable: te.value,
868
+ hover: te.value,
819
869
  flush: "",
820
- loading: y.value,
821
- "search-placeholder": e(p)("admins.search"),
822
- "empty-text": e(p)("admins.empty"),
823
- selectable: n.picking && n.multiple,
870
+ loading: g.value,
871
+ "search-placeholder": e(d)("admins.search"),
872
+ "empty-text": e(d)("admins.empty"),
873
+ selectable: s.picking && s.multiple,
824
874
  "select-row-label": e(w)("filters.select-row"),
825
875
  "select-all-label": e(w)("filters.select-all"),
826
- "cards-below": Te,
827
- "filters-count": L.value.length,
876
+ "cards-below": Ue,
877
+ "filters-count": R.value.length,
828
878
  "filters-label": e(w)("filters.title"),
829
- onRowClick: C,
830
- onStateChange: q,
831
- onSelectionChange: pe
832
- }, we({
833
- "cell-name": t(({ row: S }) => [
879
+ onRowClick: W,
880
+ onStateChange: z,
881
+ onSelectionChange: fe
882
+ }, Ae({
883
+ "cell-name": t(({ row: P }) => [
834
884
  a(e(se), {
835
885
  size: "sm",
836
886
  align: "center"
837
887
  }, {
838
888
  default: t(() => [
839
- a(e(it), {
840
- name: S.name,
841
- src: S.avatar ? W.value[S.avatar] : void 0,
889
+ a(e(dt), {
890
+ name: P.name,
891
+ src: P.avatar ? C.value[P.avatar] : void 0,
842
892
  size: "sm"
843
893
  }, null, 8, ["name", "src"]),
844
- V("span", null, o(S.name), 1),
845
- S.is_super ? (h(), $(e(J), {
894
+ S("span", null, i(P.name), 1),
895
+ P.is_super ? (m(), b(e(q), {
846
896
  key: 0,
847
897
  type: "warning"
848
898
  }, {
849
899
  default: t(() => [
850
- d(o(e(p)("admins.super")), 1)
900
+ c(i(e(d)("admins.super")), 1)
851
901
  ]),
852
902
  _: 1
853
- })) : E("", !0)
903
+ })) : I("", !0)
854
904
  ]),
855
905
  _: 2
856
906
  }, 1024)
857
907
  ]),
858
- "cell-roles": t(({ row: S }) => [
859
- S.roles.length > 0 ? (h(), $(e(se), {
908
+ "cell-roles": t(({ row: P }) => [
909
+ P.roles.length > 0 ? (m(), b(e(se), {
860
910
  key: 0,
861
911
  size: "xs",
862
912
  wrap: ""
863
913
  }, {
864
914
  default: t(() => [
865
- (h(!0), Y(ie, null, _e(S.roles, (ae) => (h(), $(e(J), {
866
- key: ae.id
915
+ (m(!0), H(ue, null, Ce(P.roles, (ie) => (m(), b(e(q), {
916
+ key: ie.id
867
917
  }, {
868
918
  default: t(() => [
869
- d(o(ae.name), 1)
919
+ c(i(ie.name), 1)
870
920
  ]),
871
921
  _: 2
872
922
  }, 1024))), 128))
873
923
  ]),
874
924
  _: 2
875
- }, 1024)) : (h(), $(e(O), {
925
+ }, 1024)) : (m(), b(e(E), {
876
926
  key: 1,
877
927
  size: "sm",
878
928
  tone: "muted"
879
929
  }, {
880
930
  default: t(() => [
881
- d(o(e(p)("admins.no-roles")), 1)
931
+ c(i(e(d)("admins.no-roles")), 1)
882
932
  ]),
883
933
  _: 1
884
934
  }))
885
935
  ]),
886
- "cell-is_active": t(({ row: S }) => [
887
- a(e(J), {
888
- type: S.is_active ? "success" : "default",
936
+ "cell-is_active": t(({ row: P }) => [
937
+ a(e(q), {
938
+ type: P.is_active ? "success" : "default",
889
939
  dot: ""
890
940
  }, {
891
941
  default: t(() => [
892
- d(o(S.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
942
+ c(i(P.is_active ? e(d)("admins.active") : e(d)("admins.only-inactive")), 1)
893
943
  ]),
894
944
  _: 2
895
945
  }, 1032, ["type"])
896
946
  ]),
897
- "card-actions": t(({ row: S }) => [
898
- n.removable ? (h(), $(e(Se), {
947
+ "card-actions": t(({ row: P }) => [
948
+ s.removable ? (m(), b(e(Se), {
899
949
  key: 0,
900
- actions: R(S),
901
- label: S.name
902
- }, null, 8, ["actions", "label"])) : E("", !0)
950
+ actions: L(P),
951
+ label: P.name
952
+ }, null, 8, ["actions", "label"])) : I("", !0)
903
953
  ]),
904
- "cell-actions": t(({ row: S }) => [
954
+ "cell-actions": t(({ row: P }) => [
905
955
  a(e(Se), {
906
- actions: R(S),
907
- label: S.name
956
+ actions: L(P),
957
+ label: P.name
908
958
  }, null, 8, ["actions", "label"])
909
959
  ]),
910
- "cell-last_login_at": t(({ row: S }) => [
911
- a(e(re), {
912
- value: S.last_login_at,
913
- tone: S.last_login_at ? "default" : "muted",
960
+ "cell-last_login_at": t(({ row: P }) => [
961
+ a(e(ae), {
962
+ value: P.last_login_at,
963
+ tone: P.last_login_at ? "default" : "muted",
914
964
  compact: ""
915
965
  }, null, 8, ["value", "tone"])
916
966
  ]),
917
- "cell-card": t(({ row: S }) => [
918
- a(e(Ae), {
967
+ "cell-card": t(({ row: P }) => [
968
+ a(e(we), {
919
969
  variant: "plain",
920
970
  shape: "circle",
921
- title: S.name,
922
- image: S.avatar ? W.value[S.avatar] : void 0,
923
- subtitle: S.email
971
+ title: P.name,
972
+ image: P.avatar ? C.value[P.avatar] : void 0,
973
+ subtitle: P.email
924
974
  }, {
925
975
  meta: t(() => [
926
- S.is_super ? (h(), $(e(J), {
976
+ P.is_super ? (m(), b(e(q), {
927
977
  key: 0,
928
978
  type: "warning",
929
979
  size: "sm"
930
980
  }, {
931
981
  default: t(() => [
932
- d(o(e(p)("admins.super")), 1)
982
+ c(i(e(d)("admins.super")), 1)
933
983
  ]),
934
984
  _: 1
935
- })) : E("", !0),
936
- (h(!0), Y(ie, null, _e(S.roles, (ae) => (h(), $(e(J), {
937
- key: ae.id,
985
+ })) : I("", !0),
986
+ (m(!0), H(ue, null, Ce(P.roles, (ie) => (m(), b(e(q), {
987
+ key: ie.id,
938
988
  size: "sm"
939
989
  }, {
940
990
  default: t(() => [
941
- d(o(ae.name), 1)
991
+ c(i(ie.name), 1)
942
992
  ]),
943
993
  _: 2
944
994
  }, 1024))), 128)),
945
- a(e(J), {
946
- type: S.is_active ? "success" : "default",
995
+ a(e(q), {
996
+ type: P.is_active ? "success" : "default",
947
997
  dot: "",
948
998
  size: "sm"
949
999
  }, {
950
1000
  default: t(() => [
951
- d(o(S.is_active ? e(p)("admins.active") : e(p)("admins.only-inactive")), 1)
1001
+ c(i(P.is_active ? e(d)("admins.active") : e(d)("admins.only-inactive")), 1)
952
1002
  ]),
953
1003
  _: 2
954
1004
  }, 1032, ["type"])
@@ -958,410 +1008,410 @@ const _t = { class: "wx-admin-form" }, bt = {
958
1008
  ]),
959
1009
  _: 2
960
1010
  }, [
961
- n.filters ? {
1011
+ s.filters ? {
962
1012
  name: "filters",
963
1013
  fn: t(() => [
964
- a(e(K), {
965
- label: e(p)("admins.filter-role")
1014
+ a(e(M), {
1015
+ label: e(d)("admins.filter-role")
966
1016
  }, {
967
1017
  default: t(() => [
968
1018
  a(e(ne), {
969
- modelValue: v.value,
970
- "onUpdate:modelValue": M[0] || (M[0] = (S) => v.value = S),
971
- options: i.value,
1019
+ modelValue: _.value,
1020
+ "onUpdate:modelValue": j[0] || (j[0] = (P) => _.value = P),
1021
+ options: n.value,
972
1022
  size: "sm"
973
1023
  }, null, 8, ["modelValue", "options"])
974
1024
  ]),
975
1025
  _: 1
976
1026
  }, 8, ["label"]),
977
- a(e(K), {
978
- label: e(p)("admins.filter-state")
1027
+ a(e(M), {
1028
+ label: e(d)("admins.filter-state")
979
1029
  }, {
980
1030
  default: t(() => [
981
1031
  a(e(ne), {
982
- modelValue: _.value,
983
- "onUpdate:modelValue": M[1] || (M[1] = (S) => _.value = S),
984
- options: b.value,
1032
+ modelValue: k.value,
1033
+ "onUpdate:modelValue": j[1] || (j[1] = (P) => k.value = P),
1034
+ options: $.value,
985
1035
  size: "sm"
986
1036
  }, null, 8, ["modelValue", "options"])
987
1037
  ]),
988
1038
  _: 1
989
1039
  }, 8, ["label"]),
990
- L.value.length > 0 ? (h(), $(e(N), {
1040
+ R.value.length > 0 ? (m(), b(e(N), {
991
1041
  key: 0,
992
1042
  variant: "text",
993
1043
  size: "sm",
994
1044
  block: "",
995
- onClick: I
1045
+ onClick: Y
996
1046
  }, {
997
1047
  icon: t(() => [
998
- a(e(ee), { name: "close" })
1048
+ a(e(Z), { name: "close" })
999
1049
  ]),
1000
1050
  default: t(() => [
1001
- d(" " + o(e(w)("filters.reset")), 1)
1051
+ c(" " + i(e(w)("filters.reset")), 1)
1002
1052
  ]),
1003
1053
  _: 1
1004
- })) : E("", !0)
1054
+ })) : I("", !0)
1005
1055
  ]),
1006
1056
  key: "0"
1007
1057
  } : void 0,
1008
- n.filters ? {
1058
+ s.filters ? {
1009
1059
  name: "applied",
1010
1060
  fn: t(() => [
1011
- a(e(De), { filters: L.value }, null, 8, ["filters"])
1061
+ a(e(Me), { filters: R.value }, null, 8, ["filters"])
1012
1062
  ]),
1013
1063
  key: "1"
1014
1064
  } : void 0
1015
1065
  ]), 1032, ["data", "columns", "clickable", "hover", "loading", "search-placeholder", "empty-text", "selectable", "select-row-label", "select-all-label", "filters-count", "filters-label"])
1016
1066
  ], 512));
1017
1067
  }
1018
- }), xt = { class: "wx-call-list__details" }, kt = { class: "wx-call-list__label" }, Ct = {
1068
+ }), Vt = { class: "wx-call-list__details" }, At = { class: "wx-call-list__label" }, zt = {
1019
1069
  key: 1,
1020
1070
  class: "wx-call-list__arguments"
1021
- }, $t = {
1071
+ }, Wt = {
1022
1072
  class: "wx-call-list__glyph",
1023
1073
  "aria-hidden": "true"
1024
- }, At = {
1074
+ }, St = {
1025
1075
  key: 2,
1026
1076
  class: "wx-call-list__arguments"
1027
- }, Ue = 480, Vt = /* @__PURE__ */ Q({
1077
+ }, Pe = 480, Lt = /* @__PURE__ */ Q({
1028
1078
  __name: "CallList",
1029
- setup(n, { expose: u }) {
1030
- const l = Z(), s = he(l);
1031
- te();
1032
- const g = ue("root"), c = Ce(g), A = T(() => c.value > 0 && c.value < Ue), r = j("webx-auth"), m = j("webx-admin"), U = z(null), p = z({ users: [], tools: [] }), w = z(!1), x = z("all"), f = z("all"), y = z("any");
1033
- let v = { page: 1, perPage: 30, sort: null, search: "" };
1034
- function _(k) {
1035
- return k === null ? r("calls.local") : k.name ?? r("calls.deleted", { id: k.id });
1079
+ setup(s, { expose: r }) {
1080
+ const l = X(), u = pe(l);
1081
+ ee();
1082
+ const v = oe("root"), y = ge(v), V = T(() => y.value > 0 && y.value < Pe), o = G("webx-auth"), h = G("webx-admin"), F = A(null), d = A({ users: [], tools: [] }), w = A(!1), x = A("all"), p = A("all"), g = A("any");
1083
+ let _ = { page: 1, perPage: 30, sort: null, search: "" };
1084
+ function k(f) {
1085
+ return f === null ? o("calls.local") : f.name ?? o("calls.deleted", { id: f.id });
1036
1086
  }
1037
- const P = T(() => [
1038
- { value: "all", label: r("calls.everybody") },
1039
- ...p.value.users.map((k) => ({
1040
- value: k.id === null ? "none" : String(k.id),
1041
- label: _(k.id === null ? null : { id: k.id, name: k.name })
1087
+ const B = T(() => [
1088
+ { value: "all", label: o("calls.everybody") },
1089
+ ...d.value.users.map((f) => ({
1090
+ value: f.id === null ? "none" : String(f.id),
1091
+ label: k(f.id === null ? null : { id: f.id, name: f.name })
1042
1092
  }))
1043
- ]), W = T(() => [
1044
- { value: "all", label: r("calls.all-tools") },
1045
- ...p.value.tools.map((k) => ({ value: k, label: k }))
1046
- ]), F = T(() => [
1047
- { value: "any", label: r("calls.any-outcome") },
1048
- { value: "ok", label: r("calls.only-answered") },
1049
- { value: "failed", label: r("calls.only-refused") },
1050
- { value: "dry", label: r("calls.only-dry") }
1051
- ]), i = T(() => {
1052
- const k = [], R = P.value.find((X) => X.value === x.value);
1053
- x.value !== "all" && R && k.push({
1093
+ ]), C = T(() => [
1094
+ { value: "all", label: o("calls.all-tools") },
1095
+ ...d.value.tools.map((f) => ({ value: f, label: f }))
1096
+ ]), O = T(() => [
1097
+ { value: "any", label: o("calls.any-outcome") },
1098
+ { value: "ok", label: o("calls.only-answered") },
1099
+ { value: "failed", label: o("calls.only-refused") },
1100
+ { value: "dry", label: o("calls.only-dry") }
1101
+ ]), n = T(() => {
1102
+ const f = [], L = B.value.find((te) => te.value === x.value);
1103
+ x.value !== "all" && L && f.push({
1054
1104
  key: "user",
1055
- label: `${r("calls.filter-user")}: ${R.label}`,
1105
+ label: `${o("calls.filter-user")}: ${L.label}`,
1056
1106
  clear: () => x.value = "all"
1057
- }), f.value !== "all" && k.push({
1107
+ }), p.value !== "all" && f.push({
1058
1108
  key: "tool",
1059
- label: `${r("calls.filter-tool")}: ${f.value}`,
1060
- clear: () => f.value = "all"
1109
+ label: `${o("calls.filter-tool")}: ${p.value}`,
1110
+ clear: () => p.value = "all"
1061
1111
  });
1062
- const C = F.value.find((X) => X.value === y.value);
1063
- return y.value !== "any" && C && k.push({
1112
+ const W = O.value.find((te) => te.value === g.value);
1113
+ return g.value !== "any" && W && f.push({
1064
1114
  key: "outcome",
1065
- label: `${r("calls.filter-outcome")}: ${C.label}`,
1066
- clear: () => y.value = "any"
1067
- }), k;
1115
+ label: `${o("calls.filter-outcome")}: ${W.label}`,
1116
+ clear: () => g.value = "any"
1117
+ }), f;
1068
1118
  });
1069
- function b() {
1070
- x.value = "all", f.value = "all", y.value = "any";
1119
+ function $() {
1120
+ x.value = "all", p.value = "all", g.value = "any";
1071
1121
  }
1072
- const L = T(() => A.value ? [{ key: "card", label: "" }] : [
1073
- { key: "at", label: r("calls.when") },
1074
- { key: "user", label: r("calls.who"), hideBelow: 640 },
1075
- { key: "tool", label: r("calls.tool") },
1076
- { key: "outcome", label: r("calls.outcome") },
1077
- { key: "duration_ms", label: r("calls.took"), align: "right", hideBelow: 820 },
1078
- { key: "client", label: r("calls.client"), hideBelow: 960 }
1122
+ const R = T(() => V.value ? [{ key: "card", label: "" }] : [
1123
+ { key: "at", label: o("calls.when") },
1124
+ { key: "user", label: o("calls.who"), hideBelow: 640 },
1125
+ { key: "tool", label: o("calls.tool") },
1126
+ { key: "outcome", label: o("calls.outcome") },
1127
+ { key: "duration_ms", label: o("calls.took"), align: "right", hideBelow: 820 },
1128
+ { key: "client", label: o("calls.client"), hideBelow: 960 }
1079
1129
  ]);
1080
- ce([x, f, y], () => I({ ...v, page: 1 }));
1081
- async function I(k) {
1082
- v = k, w.value = !0;
1130
+ de([x, p, g], () => Y({ ..._, page: 1 }));
1131
+ async function Y(f) {
1132
+ _ = f, w.value = !0;
1083
1133
  try {
1084
- U.value = await s.calls({
1134
+ F.value = await u.calls({
1085
1135
  user: x.value === "all" ? null : x.value,
1086
- tool: f.value === "all" ? null : f.value,
1087
- outcome: y.value === "any" ? null : y.value,
1088
- page: k.page,
1089
- per_page: k.perPage
1090
- }), p.value = U.value.filters;
1136
+ tool: p.value === "all" ? null : p.value,
1137
+ outcome: g.value === "any" ? null : g.value,
1138
+ page: f.page,
1139
+ per_page: f.perPage
1140
+ }), d.value = F.value.filters;
1091
1141
  } finally {
1092
1142
  w.value = !1;
1093
1143
  }
1094
1144
  }
1095
- function D(k) {
1096
- return k.ok ? k.dry_run ? { type: "info", label: r("calls.dry-run") } : { type: "success", label: r("calls.answered") } : { type: "danger", label: r("calls.refused") };
1145
+ function U(f) {
1146
+ return f.ok ? f.dry_run ? { type: "info", label: o("calls.dry-run") } : { type: "success", label: o("calls.answered") } : { type: "danger", label: o("calls.refused") };
1097
1147
  }
1098
- function q(k) {
1099
- return k.arguments !== null || k.error !== null;
1148
+ function z(f) {
1149
+ return f.arguments !== null || f.error !== null;
1100
1150
  }
1101
- return u({ reload: () => I(v) }), (k, R) => (h(), Y("div", {
1151
+ return r({ reload: () => Y(_) }), (f, L) => (m(), H("div", {
1102
1152
  ref_key: "root",
1103
- ref: g,
1153
+ ref: v,
1104
1154
  class: "wx-call-list"
1105
1155
  }, [
1106
- a(e($e), {
1107
- data: U.value,
1108
- columns: L.value,
1156
+ a(e(ke), {
1157
+ data: F.value,
1158
+ columns: R.value,
1109
1159
  "row-key": "id",
1110
1160
  flush: "",
1111
1161
  loading: w.value,
1112
1162
  clickable: !1,
1113
- expandable: !A.value,
1114
- "expandable-if": q,
1115
- "empty-text": e(r)("calls.empty"),
1116
- "cards-below": Ue,
1117
- "filters-count": i.value.length,
1118
- "filters-label": e(m)("filters.title"),
1119
- onStateChange: I
1163
+ expandable: !V.value,
1164
+ "expandable-if": z,
1165
+ "empty-text": e(o)("calls.empty"),
1166
+ "cards-below": Pe,
1167
+ "filters-count": n.value.length,
1168
+ "filters-label": e(h)("filters.title"),
1169
+ onStateChange: Y
1120
1170
  }, {
1121
1171
  filters: t(() => [
1122
- a(e(K), {
1123
- label: e(r)("calls.filter-user")
1172
+ a(e(M), {
1173
+ label: e(o)("calls.filter-user")
1124
1174
  }, {
1125
1175
  default: t(() => [
1126
1176
  a(e(ne), {
1127
1177
  modelValue: x.value,
1128
- "onUpdate:modelValue": R[0] || (R[0] = (C) => x.value = C),
1129
- options: P.value,
1178
+ "onUpdate:modelValue": L[0] || (L[0] = (W) => x.value = W),
1179
+ options: B.value,
1130
1180
  size: "sm"
1131
1181
  }, null, 8, ["modelValue", "options"])
1132
1182
  ]),
1133
1183
  _: 1
1134
1184
  }, 8, ["label"]),
1135
- a(e(K), {
1136
- label: e(r)("calls.filter-tool")
1185
+ a(e(M), {
1186
+ label: e(o)("calls.filter-tool")
1137
1187
  }, {
1138
1188
  default: t(() => [
1139
1189
  a(e(ne), {
1140
- modelValue: f.value,
1141
- "onUpdate:modelValue": R[1] || (R[1] = (C) => f.value = C),
1142
- options: W.value,
1190
+ modelValue: p.value,
1191
+ "onUpdate:modelValue": L[1] || (L[1] = (W) => p.value = W),
1192
+ options: C.value,
1143
1193
  size: "sm"
1144
1194
  }, null, 8, ["modelValue", "options"])
1145
1195
  ]),
1146
1196
  _: 1
1147
1197
  }, 8, ["label"]),
1148
- a(e(K), {
1149
- label: e(r)("calls.filter-outcome")
1198
+ a(e(M), {
1199
+ label: e(o)("calls.filter-outcome")
1150
1200
  }, {
1151
1201
  default: t(() => [
1152
1202
  a(e(ne), {
1153
- modelValue: y.value,
1154
- "onUpdate:modelValue": R[2] || (R[2] = (C) => y.value = C),
1155
- options: F.value,
1203
+ modelValue: g.value,
1204
+ "onUpdate:modelValue": L[2] || (L[2] = (W) => g.value = W),
1205
+ options: O.value,
1156
1206
  size: "sm"
1157
1207
  }, null, 8, ["modelValue", "options"])
1158
1208
  ]),
1159
1209
  _: 1
1160
1210
  }, 8, ["label"]),
1161
- i.value.length > 0 ? (h(), $(e(N), {
1211
+ n.value.length > 0 ? (m(), b(e(N), {
1162
1212
  key: 0,
1163
1213
  variant: "text",
1164
1214
  size: "sm",
1165
1215
  block: "",
1166
- onClick: b
1216
+ onClick: $
1167
1217
  }, {
1168
1218
  icon: t(() => [
1169
- a(e(ee), { name: "close" })
1219
+ a(e(Z), { name: "close" })
1170
1220
  ]),
1171
1221
  default: t(() => [
1172
- d(" " + o(e(m)("filters.reset")), 1)
1222
+ c(" " + i(e(h)("filters.reset")), 1)
1173
1223
  ]),
1174
1224
  _: 1
1175
- })) : E("", !0)
1225
+ })) : I("", !0)
1176
1226
  ]),
1177
1227
  applied: t(() => [
1178
- a(e(De), { filters: i.value }, null, 8, ["filters"])
1228
+ a(e(Me), { filters: n.value }, null, 8, ["filters"])
1179
1229
  ]),
1180
- "cell-at": t(({ row: C }) => [
1181
- a(e(re), {
1182
- value: C.at,
1230
+ "cell-at": t(({ row: W }) => [
1231
+ a(e(ae), {
1232
+ value: W.at,
1183
1233
  tone: "default",
1184
1234
  compact: ""
1185
1235
  }, null, 8, ["value"])
1186
1236
  ]),
1187
- "cell-user": t(({ row: C }) => [
1188
- a(e(O), {
1189
- tone: C.user === null || C.user.name === null ? "muted" : "default"
1237
+ "cell-user": t(({ row: W }) => [
1238
+ a(e(E), {
1239
+ tone: W.user === null || W.user.name === null ? "muted" : "default"
1190
1240
  }, {
1191
1241
  default: t(() => [
1192
- d(o(_(C.user)), 1)
1242
+ c(i(k(W.user)), 1)
1193
1243
  ]),
1194
1244
  _: 2
1195
1245
  }, 1032, ["tone"])
1196
1246
  ]),
1197
- "cell-tool": t(({ row: C }) => [
1198
- a(e(O), {
1247
+ "cell-tool": t(({ row: W }) => [
1248
+ a(e(E), {
1199
1249
  mono: "",
1200
1250
  size: "sm"
1201
1251
  }, {
1202
1252
  default: t(() => [
1203
- d(o(C.tool), 1)
1253
+ c(i(W.tool), 1)
1204
1254
  ]),
1205
1255
  _: 2
1206
1256
  }, 1024)
1207
1257
  ]),
1208
- "cell-outcome": t(({ row: C }) => [
1209
- a(e(J), {
1210
- type: D(C).type,
1258
+ "cell-outcome": t(({ row: W }) => [
1259
+ a(e(q), {
1260
+ type: U(W).type,
1211
1261
  dot: ""
1212
1262
  }, {
1213
1263
  default: t(() => [
1214
- d(o(D(C).label), 1)
1264
+ c(i(U(W).label), 1)
1215
1265
  ]),
1216
1266
  _: 2
1217
1267
  }, 1032, ["type"])
1218
1268
  ]),
1219
- "cell-duration_ms": t(({ row: C }) => [
1220
- a(e(O), {
1269
+ "cell-duration_ms": t(({ row: W }) => [
1270
+ a(e(E), {
1221
1271
  size: "sm",
1222
1272
  tone: "muted"
1223
1273
  }, {
1224
1274
  default: t(() => [
1225
- d(o(e(r)("calls.ms", { count: C.duration_ms })), 1)
1275
+ c(i(e(o)("calls.ms", { count: W.duration_ms })), 1)
1226
1276
  ]),
1227
1277
  _: 2
1228
1278
  }, 1024)
1229
1279
  ]),
1230
- "cell-client": t(({ row: C }) => [
1231
- C.client ? (h(), $(e(O), {
1280
+ "cell-client": t(({ row: W }) => [
1281
+ W.client ? (m(), b(e(E), {
1232
1282
  key: 0,
1233
1283
  size: "sm"
1234
1284
  }, {
1235
1285
  default: t(() => [
1236
- d(o(C.client), 1)
1286
+ c(i(W.client), 1)
1237
1287
  ]),
1238
1288
  _: 2
1239
- }, 1024)) : (h(), $(e(O), {
1289
+ }, 1024)) : (m(), b(e(E), {
1240
1290
  key: 1,
1241
1291
  size: "sm",
1242
1292
  tone: "muted"
1243
1293
  }, {
1244
- default: t(() => [...R[3] || (R[3] = [
1245
- d("—", -1)
1294
+ default: t(() => [...L[3] || (L[3] = [
1295
+ c("—", -1)
1246
1296
  ])]),
1247
1297
  _: 1
1248
1298
  }))
1249
1299
  ]),
1250
- expanded: t(({ row: C }) => [
1251
- V("div", xt, [
1252
- C.error ? (h(), $(e(O), {
1300
+ expanded: t(({ row: W }) => [
1301
+ S("div", Vt, [
1302
+ W.error ? (m(), b(e(E), {
1253
1303
  key: 0,
1254
1304
  tone: "danger",
1255
1305
  size: "sm",
1256
1306
  class: "wx-call-list__error"
1257
1307
  }, {
1258
1308
  default: t(() => [
1259
- V("strong", null, o(e(r)("calls.error")) + ":", 1),
1260
- d(" " + o(C.error), 1)
1309
+ S("strong", null, i(e(o)("calls.error")) + ":", 1),
1310
+ c(" " + i(W.error), 1)
1261
1311
  ]),
1262
1312
  _: 2
1263
- }, 1024)) : E("", !0),
1264
- V("div", kt, [
1265
- a(e(O), {
1313
+ }, 1024)) : I("", !0),
1314
+ S("div", At, [
1315
+ a(e(E), {
1266
1316
  size: "sm",
1267
1317
  weight: "semibold"
1268
1318
  }, {
1269
1319
  default: t(() => [
1270
- d(o(e(r)("calls.request")), 1)
1320
+ c(i(e(o)("calls.request")), 1)
1271
1321
  ]),
1272
1322
  _: 1
1273
1323
  }),
1274
- a(e(O), {
1324
+ a(e(E), {
1275
1325
  size: "xs",
1276
1326
  tone: "muted"
1277
1327
  }, {
1278
1328
  default: t(() => [
1279
- d(o(e(r)("calls.request-hint")), 1)
1329
+ c(i(e(o)("calls.request-hint")), 1)
1280
1330
  ]),
1281
1331
  _: 1
1282
1332
  })
1283
1333
  ]),
1284
- C.arguments ? (h(), Y("pre", Ct, o(C.arguments), 1)) : (h(), $(e(O), {
1334
+ W.arguments ? (m(), H("pre", zt, i(W.arguments), 1)) : (m(), b(e(E), {
1285
1335
  key: 2,
1286
1336
  size: "sm",
1287
1337
  tone: "muted"
1288
1338
  }, {
1289
1339
  default: t(() => [
1290
- d(o(e(r)("calls.no-arguments")), 1)
1340
+ c(i(e(o)("calls.no-arguments")), 1)
1291
1341
  ]),
1292
1342
  _: 1
1293
1343
  }))
1294
1344
  ])
1295
1345
  ]),
1296
- "cell-card": t(({ row: C }) => [
1297
- a(e(Ae), {
1346
+ "cell-card": t(({ row: W }) => [
1347
+ a(e(we), {
1298
1348
  variant: "plain",
1299
- title: C.tool,
1300
- subtitle: _(C.user)
1349
+ title: W.tool,
1350
+ subtitle: k(W.user)
1301
1351
  }, {
1302
1352
  media: t(() => [
1303
- V("span", $t, [
1304
- a(e(ee), { name: "sliders" })
1353
+ S("span", Wt, [
1354
+ a(e(Z), { name: "sliders" })
1305
1355
  ])
1306
1356
  ]),
1307
1357
  meta: t(() => [
1308
- a(e(J), {
1309
- type: D(C).type,
1358
+ a(e(q), {
1359
+ type: U(W).type,
1310
1360
  dot: "",
1311
1361
  size: "sm"
1312
1362
  }, {
1313
1363
  default: t(() => [
1314
- d(o(D(C).label), 1)
1364
+ c(i(U(W).label), 1)
1315
1365
  ]),
1316
1366
  _: 2
1317
1367
  }, 1032, ["type"]),
1318
- a(e(re), {
1319
- value: C.at,
1368
+ a(e(ae), {
1369
+ value: W.at,
1320
1370
  compact: ""
1321
1371
  }, null, 8, ["value"]),
1322
- C.client ? (h(), $(e(O), {
1372
+ W.client ? (m(), b(e(E), {
1323
1373
  key: 0,
1324
1374
  size: "xs",
1325
1375
  tone: "muted"
1326
1376
  }, {
1327
1377
  default: t(() => [
1328
- d(o(C.client), 1)
1378
+ c(i(W.client), 1)
1329
1379
  ]),
1330
1380
  _: 2
1331
- }, 1024)) : E("", !0)
1381
+ }, 1024)) : I("", !0)
1332
1382
  ]),
1333
1383
  default: t(() => [
1334
- q(C) ? (h(), $(e(se), {
1384
+ z(W) ? (m(), b(e(se), {
1335
1385
  key: 0,
1336
1386
  direction: "vertical",
1337
1387
  size: "xs",
1338
1388
  class: "wx-call-list__card-details"
1339
1389
  }, {
1340
1390
  default: t(() => [
1341
- C.error ? (h(), $(e(O), {
1391
+ W.error ? (m(), b(e(E), {
1342
1392
  key: 0,
1343
1393
  tone: "danger",
1344
1394
  size: "sm"
1345
1395
  }, {
1346
1396
  default: t(() => [
1347
- d(o(C.error), 1)
1397
+ c(i(W.error), 1)
1348
1398
  ]),
1349
1399
  _: 2
1350
- }, 1024)) : E("", !0),
1351
- C.arguments ? (h(), $(e(O), {
1400
+ }, 1024)) : I("", !0),
1401
+ W.arguments ? (m(), b(e(E), {
1352
1402
  key: 1,
1353
1403
  size: "xs",
1354
1404
  tone: "muted"
1355
1405
  }, {
1356
1406
  default: t(() => [
1357
- d(o(e(r)("calls.request")), 1)
1407
+ c(i(e(o)("calls.request")), 1)
1358
1408
  ]),
1359
1409
  _: 1
1360
- })) : E("", !0),
1361
- C.arguments ? (h(), Y("pre", At, o(C.arguments), 1)) : E("", !0)
1410
+ })) : I("", !0),
1411
+ W.arguments ? (m(), H("pre", St, i(W.arguments), 1)) : I("", !0)
1362
1412
  ]),
1363
1413
  _: 2
1364
- }, 1024)) : E("", !0)
1414
+ }, 1024)) : I("", !0)
1365
1415
  ]),
1366
1416
  _: 2
1367
1417
  }, 1032, ["title", "subtitle"])
@@ -1371,111 +1421,111 @@ const _t = { class: "wx-admin-form" }, bt = {
1371
1421
  ], 512));
1372
1422
  }
1373
1423
  });
1374
- function zt(n) {
1375
- const u = `${n.apiPath}/auth/connections`;
1424
+ function Tt(s) {
1425
+ const r = `${s.apiPath}/auth/connections`;
1376
1426
  return {
1377
- list: (l = "mine") => n.http.get(u, { query: { all: l === "all" ? 1 : void 0 } }).then((s) => ({
1378
- data: s.data,
1379
- scope: s.meta.scope,
1380
- canSeeEverybody: s.meta.can_see_everybody
1427
+ list: (l = "mine") => s.http.get(r, { query: { all: l === "all" ? 1 : void 0 } }).then((u) => ({
1428
+ data: u.data,
1429
+ scope: u.meta.scope,
1430
+ canSeeEverybody: u.meta.can_see_everybody
1381
1431
  })),
1382
- disconnect: (l) => n.http.delete(`${u}/${l}`).then((s) => s.data)
1432
+ disconnect: (l) => s.http.delete(`${r}/${l}`).then((u) => u.data)
1383
1433
  };
1384
1434
  }
1385
- const St = {
1435
+ const Ut = {
1386
1436
  class: "wx-connection-list__glyph",
1387
1437
  "aria-hidden": "true"
1388
- }, Pe = 560, Je = /* @__PURE__ */ Q({
1438
+ }, Fe = 560, Ze = /* @__PURE__ */ Q({
1389
1439
  __name: "ConnectionList",
1390
1440
  props: {
1391
1441
  scope: { default: "mine" }
1392
1442
  },
1393
- setup(n, { expose: u }) {
1394
- const l = n, s = Z(), g = zt(s);
1395
- te();
1396
- const c = j("webx-auth"), A = me(), r = ue("root"), m = Ce(r), U = T(() => m.value > 0 && m.value < Pe), p = z([]), w = z(!1), x = z(null), f = T(() => U.value ? [{ key: "card", label: "" }] : [
1397
- { key: "client", label: c("connections.client"), minWidth: 210 },
1398
- ...l.scope === "all" ? [{ key: "user", label: c("connections.who"), minWidth: 140 }] : [],
1399
- { key: "read_only", label: c("connections.allowed"), minWidth: 160 },
1400
- { key: "connected_at", label: c("connections.connected"), hideBelow: 860 },
1401
- { key: "last_used_at", label: c("connections.last-used"), minWidth: 130 },
1443
+ setup(s, { expose: r }) {
1444
+ const l = s, u = X(), v = Tt(u);
1445
+ ee();
1446
+ const y = G("webx-auth"), V = re(), o = oe("root"), h = ge(o), F = T(() => h.value > 0 && h.value < Fe), d = A([]), w = A(!1), x = A(null), p = T(() => F.value ? [{ key: "card", label: "" }] : [
1447
+ { key: "client", label: y("connections.client"), minWidth: 210 },
1448
+ ...l.scope === "all" ? [{ key: "user", label: y("connections.who"), minWidth: 140 }] : [],
1449
+ { key: "read_only", label: y("connections.allowed"), minWidth: 160 },
1450
+ { key: "connected_at", label: y("connections.connected"), hideBelow: 860 },
1451
+ { key: "last_used_at", label: y("connections.last-used"), minWidth: 130 },
1402
1452
  { key: "end", label: "", align: "right", width: 140 }
1403
1453
  ]);
1404
- function y(W) {
1405
- return W.user.name ?? c("calls.deleted", { id: W.user.id });
1454
+ function g(C) {
1455
+ return C.user.name ?? y("calls.deleted", { id: C.user.id });
1406
1456
  }
1407
- function v(W) {
1408
- if (W.read_only) return c("connections.read-only");
1409
- if (l.scope !== "all") return c("connections.full-you");
1410
- const F = W.user.name?.split(" ")[0];
1411
- return c("connections.full", { name: F || y(W) });
1457
+ function _(C) {
1458
+ if (C.read_only) return y("connections.read-only");
1459
+ if (l.scope !== "all") return y("connections.full-you");
1460
+ const O = C.user.name?.split(" ")[0];
1461
+ return y("connections.full", { name: O || g(C) });
1412
1462
  }
1413
- async function _() {
1463
+ async function k() {
1414
1464
  w.value = !0;
1415
1465
  try {
1416
- p.value = (await g.list(l.scope)).data;
1417
- } catch (W) {
1418
- G.danger(A(W));
1466
+ d.value = (await v.list(l.scope)).data;
1467
+ } catch (C) {
1468
+ K.danger(V(C));
1419
1469
  } finally {
1420
1470
  w.value = !1;
1421
1471
  }
1422
1472
  }
1423
- async function P(W) {
1424
- if (await Ne({
1425
- title: c("connections.confirm-title", { client: W.client }),
1426
- message: c("connections.confirm-text"),
1427
- confirmText: c("connections.confirm"),
1428
- cancelText: c("connections.cancel"),
1473
+ async function B(C) {
1474
+ if (await ze({
1475
+ title: y("connections.confirm-title", { client: C.client }),
1476
+ message: y("connections.confirm-text"),
1477
+ confirmText: y("connections.confirm"),
1478
+ cancelText: y("connections.cancel"),
1429
1479
  tone: "danger"
1430
1480
  })) {
1431
- x.value = W.id;
1481
+ x.value = C.id;
1432
1482
  try {
1433
- const i = await g.disconnect(W.id);
1434
- p.value = p.value.map((b) => b.id === i.id ? i : b), G.success(c("connections.done", { client: W.client }));
1435
- } catch (i) {
1436
- G.danger(A(i));
1483
+ const n = await v.disconnect(C.id);
1484
+ d.value = d.value.map(($) => $.id === n.id ? n : $), K.success(y("connections.done", { client: C.client }));
1485
+ } catch (n) {
1486
+ K.danger(V(n));
1437
1487
  } finally {
1438
1488
  x.value = null;
1439
1489
  }
1440
1490
  }
1441
1491
  }
1442
- return ce(() => l.scope, _, { immediate: !0 }), u({ reload: _ }), (W, F) => (h(), Y("div", {
1492
+ return de(() => l.scope, k, { immediate: !0 }), r({ reload: k }), (C, O) => (m(), H("div", {
1443
1493
  ref_key: "root",
1444
- ref: r,
1494
+ ref: o,
1445
1495
  class: "wx-connection-list"
1446
1496
  }, [
1447
- a(e($e), {
1448
- data: p.value,
1449
- columns: f.value,
1497
+ a(e(ke), {
1498
+ data: d.value,
1499
+ columns: p.value,
1450
1500
  "row-key": "id",
1451
1501
  flush: "",
1452
1502
  loading: w.value,
1453
1503
  clickable: !1,
1454
- "empty-text": n.scope === "all" ? e(c)("connections.empty-all") : e(c)("connections.empty"),
1455
- "cards-below": Pe,
1456
- "row-class": (i) => i.revoked_at ? "is-ended" : ""
1504
+ "empty-text": s.scope === "all" ? e(y)("connections.empty-all") : e(y)("connections.empty"),
1505
+ "cards-below": Fe,
1506
+ "row-class": (n) => n.revoked_at ? "is-ended" : ""
1457
1507
  }, {
1458
- "cell-client": t(({ row: i }) => [
1508
+ "cell-client": t(({ row: n }) => [
1459
1509
  a(e(se), {
1460
1510
  direction: "vertical",
1461
1511
  size: "none"
1462
1512
  }, {
1463
1513
  default: t(() => [
1464
- a(e(O), {
1465
- tone: i.revoked_at ? "muted" : "default",
1514
+ a(e(E), {
1515
+ tone: n.revoked_at ? "muted" : "default",
1466
1516
  weight: "medium"
1467
1517
  }, {
1468
1518
  default: t(() => [
1469
- d(o(i.client), 1)
1519
+ c(i(n.client), 1)
1470
1520
  ]),
1471
1521
  _: 2
1472
1522
  }, 1032, ["tone"]),
1473
- a(e(O), {
1523
+ a(e(E), {
1474
1524
  size: "xs",
1475
1525
  tone: "muted"
1476
1526
  }, {
1477
1527
  default: t(() => [
1478
- d(o(e(c)("connections.returns-to", { host: i.host })), 1)
1528
+ c(i(e(y)("connections.returns-to", { host: n.host })), 1)
1479
1529
  ]),
1480
1530
  _: 2
1481
1531
  }, 1024)
@@ -1483,145 +1533,145 @@ const St = {
1483
1533
  _: 2
1484
1534
  }, 1024)
1485
1535
  ]),
1486
- "cell-user": t(({ row: i }) => [
1487
- a(e(O), {
1488
- tone: i.user.name === null ? "muted" : "default"
1536
+ "cell-user": t(({ row: n }) => [
1537
+ a(e(E), {
1538
+ tone: n.user.name === null ? "muted" : "default"
1489
1539
  }, {
1490
1540
  default: t(() => [
1491
- d(o(y(i)), 1)
1541
+ c(i(g(n)), 1)
1492
1542
  ]),
1493
1543
  _: 2
1494
1544
  }, 1032, ["tone"])
1495
1545
  ]),
1496
- "cell-read_only": t(({ row: i }) => [
1497
- i.revoked_at ? (h(), $(e(J), {
1546
+ "cell-read_only": t(({ row: n }) => [
1547
+ n.revoked_at ? (m(), b(e(q), {
1498
1548
  key: 0,
1499
1549
  type: "default",
1500
1550
  dot: ""
1501
1551
  }, {
1502
1552
  default: t(() => [
1503
- d(o(e(c)("connections.disconnected")), 1)
1553
+ c(i(e(y)("connections.disconnected")), 1)
1504
1554
  ]),
1505
1555
  _: 1
1506
- })) : (h(), $(e(J), {
1556
+ })) : (m(), b(e(q), {
1507
1557
  key: 1,
1508
- type: i.read_only ? "info" : "success",
1558
+ type: n.read_only ? "info" : "success",
1509
1559
  dot: ""
1510
1560
  }, {
1511
1561
  default: t(() => [
1512
- d(o(v(i)), 1)
1562
+ c(i(_(n)), 1)
1513
1563
  ]),
1514
1564
  _: 2
1515
1565
  }, 1032, ["type"]))
1516
1566
  ]),
1517
- "cell-connected_at": t(({ row: i }) => [
1518
- a(e(re), {
1519
- value: i.connected_at,
1567
+ "cell-connected_at": t(({ row: n }) => [
1568
+ a(e(ae), {
1569
+ value: n.connected_at,
1520
1570
  tone: "muted",
1521
1571
  compact: ""
1522
1572
  }, null, 8, ["value"])
1523
1573
  ]),
1524
- "cell-last_used_at": t(({ row: i }) => [
1525
- i.last_used_at ? (h(), $(e(re), {
1574
+ "cell-last_used_at": t(({ row: n }) => [
1575
+ n.last_used_at ? (m(), b(e(ae), {
1526
1576
  key: 0,
1527
- value: i.last_used_at,
1577
+ value: n.last_used_at,
1528
1578
  tone: "default",
1529
1579
  compact: ""
1530
- }, null, 8, ["value"])) : (h(), $(e(O), {
1580
+ }, null, 8, ["value"])) : (m(), b(e(E), {
1531
1581
  key: 1,
1532
1582
  size: "sm",
1533
1583
  tone: "muted"
1534
1584
  }, {
1535
1585
  default: t(() => [
1536
- d(o(e(c)("connections.never-used")), 1)
1586
+ c(i(e(y)("connections.never-used")), 1)
1537
1587
  ]),
1538
1588
  _: 1
1539
1589
  }))
1540
1590
  ]),
1541
- "cell-end": t(({ row: i }) => [
1542
- i.revoked_at ? E("", !0) : (h(), $(e(N), {
1591
+ "cell-end": t(({ row: n }) => [
1592
+ n.revoked_at ? I("", !0) : (m(), b(e(N), {
1543
1593
  key: 0,
1544
1594
  type: "danger",
1545
1595
  variant: "text",
1546
1596
  size: "sm",
1547
- loading: x.value === i.id,
1548
- onClick: (b) => P(i)
1597
+ loading: x.value === n.id,
1598
+ onClick: ($) => B(n)
1549
1599
  }, {
1550
1600
  default: t(() => [
1551
- d(o(e(c)("connections.disconnect")), 1)
1601
+ c(i(e(y)("connections.disconnect")), 1)
1552
1602
  ]),
1553
1603
  _: 1
1554
1604
  }, 8, ["loading", "onClick"]))
1555
1605
  ]),
1556
- "cell-card": t(({ row: i }) => [
1557
- a(e(Ae), {
1606
+ "cell-card": t(({ row: n }) => [
1607
+ a(e(we), {
1558
1608
  variant: "plain",
1559
- title: i.client,
1560
- subtitle: e(c)("connections.returns-to", { host: i.host })
1609
+ title: n.client,
1610
+ subtitle: e(y)("connections.returns-to", { host: n.host })
1561
1611
  }, {
1562
1612
  media: t(() => [
1563
- V("span", St, [
1564
- a(e(ee), { name: "link" })
1613
+ S("span", Ut, [
1614
+ a(e(Z), { name: "link" })
1565
1615
  ])
1566
1616
  ]),
1567
1617
  meta: t(() => [
1568
- i.revoked_at ? (h(), $(e(J), {
1618
+ n.revoked_at ? (m(), b(e(q), {
1569
1619
  key: 0,
1570
1620
  type: "default",
1571
1621
  dot: "",
1572
1622
  size: "sm"
1573
1623
  }, {
1574
1624
  default: t(() => [
1575
- d(o(e(c)("connections.disconnected")), 1)
1625
+ c(i(e(y)("connections.disconnected")), 1)
1576
1626
  ]),
1577
1627
  _: 1
1578
- })) : (h(), $(e(J), {
1628
+ })) : (m(), b(e(q), {
1579
1629
  key: 1,
1580
- type: i.read_only ? "info" : "success",
1630
+ type: n.read_only ? "info" : "success",
1581
1631
  dot: "",
1582
1632
  size: "sm"
1583
1633
  }, {
1584
1634
  default: t(() => [
1585
- d(o(v(i)), 1)
1635
+ c(i(_(n)), 1)
1586
1636
  ]),
1587
1637
  _: 2
1588
1638
  }, 1032, ["type"])),
1589
- n.scope === "all" ? (h(), $(e(O), {
1639
+ s.scope === "all" ? (m(), b(e(E), {
1590
1640
  key: 2,
1591
1641
  size: "xs",
1592
1642
  tone: "muted"
1593
1643
  }, {
1594
1644
  default: t(() => [
1595
- d(o(y(i)), 1)
1645
+ c(i(g(n)), 1)
1596
1646
  ]),
1597
1647
  _: 2
1598
- }, 1024)) : E("", !0),
1599
- i.last_used_at ? (h(), $(e(re), {
1648
+ }, 1024)) : I("", !0),
1649
+ n.last_used_at ? (m(), b(e(ae), {
1600
1650
  key: 3,
1601
- value: i.last_used_at,
1651
+ value: n.last_used_at,
1602
1652
  compact: ""
1603
- }, null, 8, ["value"])) : (h(), $(e(O), {
1653
+ }, null, 8, ["value"])) : (m(), b(e(E), {
1604
1654
  key: 4,
1605
1655
  size: "xs",
1606
1656
  tone: "muted"
1607
1657
  }, {
1608
1658
  default: t(() => [
1609
- d(o(e(c)("connections.never-used")), 1)
1659
+ c(i(e(y)("connections.never-used")), 1)
1610
1660
  ]),
1611
1661
  _: 1
1612
1662
  }))
1613
1663
  ]),
1614
1664
  actions: t(() => [
1615
- i.revoked_at ? E("", !0) : (h(), $(e(N), {
1665
+ n.revoked_at ? I("", !0) : (m(), b(e(N), {
1616
1666
  key: 0,
1617
1667
  type: "danger",
1618
1668
  variant: "text",
1619
1669
  size: "sm",
1620
- loading: x.value === i.id,
1621
- onClick: (b) => P(i)
1670
+ loading: x.value === n.id,
1671
+ onClick: ($) => B(n)
1622
1672
  }, {
1623
1673
  default: t(() => [
1624
- d(o(e(c)("connections.disconnect")), 1)
1674
+ c(i(e(y)("connections.disconnect")), 1)
1625
1675
  ]),
1626
1676
  _: 1
1627
1677
  }, 8, ["loading", "onClick"]))
@@ -1633,7 +1683,563 @@ const St = {
1633
1683
  }, 8, ["data", "columns", "loading", "empty-text", "row-class"])
1634
1684
  ], 512));
1635
1685
  }
1636
- }), Lt = /* @__PURE__ */ Q({
1686
+ });
1687
+ async function et(s) {
1688
+ try {
1689
+ if (navigator.clipboard?.writeText)
1690
+ return await navigator.clipboard.writeText(s), !0;
1691
+ } catch {
1692
+ }
1693
+ return Pt(s);
1694
+ }
1695
+ function Pt(s) {
1696
+ const r = document.createElement("textarea");
1697
+ r.value = s, r.setAttribute("readonly", ""), r.style.position = "fixed", r.style.opacity = "0", document.body.append(r), r.select();
1698
+ try {
1699
+ return document.execCommand("copy");
1700
+ } catch {
1701
+ return !1;
1702
+ } finally {
1703
+ r.remove();
1704
+ }
1705
+ }
1706
+ function tt(s) {
1707
+ const r = `${s.apiPath}/auth/keys`;
1708
+ return {
1709
+ list: () => s.http.get(r).then((l) => ({
1710
+ data: l.data,
1711
+ scopes: l.meta.scopes,
1712
+ maxDays: l.meta.max_days
1713
+ })),
1714
+ issue: (l) => s.http.post(r, l).then((u) => ({ key: u.data, token: u.token })),
1715
+ revoke: (l) => s.http.delete(`${r}/${l}`).then((u) => u.data)
1716
+ };
1717
+ }
1718
+ const Ft = {
1719
+ key: 0,
1720
+ class: "wx-key-dialog"
1721
+ }, Rt = { class: "wx-key-dialog__secret" }, Ot = {
1722
+ key: 1,
1723
+ class: "wx-key-dialog"
1724
+ }, Bt = /* @__PURE__ */ Q({
1725
+ __name: "KeyDialog",
1726
+ setup(s) {
1727
+ const { open: r, resolve: l, dismiss: u } = _e(), v = X(), y = tt(v), V = pe(v);
1728
+ ee();
1729
+ const o = G("webx-auth"), h = re(), F = [30, 90, 365, 1095, 3650], d = A({
1730
+ name: "",
1731
+ admin: null,
1732
+ access: "everything",
1733
+ scopes: [],
1734
+ days: 365
1735
+ }), w = A([]), x = A([]), p = A(!1), g = A({}), _ = A(null), k = A(!1), B = T(
1736
+ () => w.value.filter((z) => z !== "mcp:use").map((z) => ({ value: z, label: z }))
1737
+ ), C = T(() => [
1738
+ { value: "everything", label: o("keys.everything") },
1739
+ { value: "chosen", label: o("keys.chosen") }
1740
+ ]), O = T(
1741
+ () => F.map((z) => ({ value: z, label: o(`keys.days-${z}`) }))
1742
+ ), n = T(() => {
1743
+ const z = v.state.manifest?.modules.find((f) => f.id === "connect")?.meta;
1744
+ return typeof z?.url == "string" ? z.url : "";
1745
+ });
1746
+ y.list().then(
1747
+ (z) => w.value = z.scopes,
1748
+ (z) => K.danger(h(z))
1749
+ ), V.list({ active: "yes", per_page: 100, sort: "name" }).then(
1750
+ (z) => x.value = z.data.map((f) => ({
1751
+ value: f.id,
1752
+ label: `${f.name} · ${f.email}`
1753
+ })),
1754
+ (z) => K.danger(h(z))
1755
+ );
1756
+ function $(z) {
1757
+ return g.value[z]?.[0] ?? g.value[`${z}.0`]?.[0];
1758
+ }
1759
+ async function R() {
1760
+ if (g.value = {}, d.value.access === "chosen" && d.value.scopes.length === 0) {
1761
+ g.value = { scopes: [o("keys.scopes-required")] };
1762
+ return;
1763
+ }
1764
+ p.value = !0;
1765
+ try {
1766
+ _.value = await y.issue({
1767
+ name: d.value.name,
1768
+ admin: d.value.admin ?? 0,
1769
+ scopes: d.value.access === "chosen" ? d.value.scopes : [],
1770
+ days: d.value.days
1771
+ });
1772
+ } catch (z) {
1773
+ const f = z.body;
1774
+ f?.errors ? g.value = f.errors : K.danger(h(z));
1775
+ } finally {
1776
+ p.value = !1;
1777
+ }
1778
+ }
1779
+ async function Y() {
1780
+ _.value !== null && (await et(_.value.token) ? k.value = !0 : K.danger(o("keys.copy-failed")));
1781
+ }
1782
+ function U() {
1783
+ _.value ? l(_.value.key) : u();
1784
+ }
1785
+ return (z, f) => (m(), b(e(be), {
1786
+ open: e(r),
1787
+ title: _.value ? e(o)("keys.issued-title") : e(o)("keys.issue"),
1788
+ width: 640,
1789
+ "onUpdate:open": f[5] || (f[5] = (L) => L ? void 0 : U())
1790
+ }, {
1791
+ footer: t(() => [
1792
+ a(e(se), { size: "sm" }, {
1793
+ default: t(() => [
1794
+ _.value ? (m(), b(e(N), {
1795
+ key: 0,
1796
+ type: "primary",
1797
+ onClick: U
1798
+ }, {
1799
+ default: t(() => [
1800
+ c(i(e(o)("keys.done")), 1)
1801
+ ]),
1802
+ _: 1
1803
+ })) : (m(), H(ue, { key: 1 }, [
1804
+ a(e(N), {
1805
+ variant: "outline",
1806
+ onClick: U
1807
+ }, {
1808
+ default: t(() => [
1809
+ c(i(e(o)("keys.cancel")), 1)
1810
+ ]),
1811
+ _: 1
1812
+ }),
1813
+ a(e(N), {
1814
+ type: "primary",
1815
+ loading: p.value,
1816
+ onClick: R
1817
+ }, {
1818
+ default: t(() => [
1819
+ c(i(e(o)("keys.issue-short")), 1)
1820
+ ]),
1821
+ _: 1
1822
+ }, 8, ["loading"])
1823
+ ], 64))
1824
+ ]),
1825
+ _: 1
1826
+ })
1827
+ ]),
1828
+ default: t(() => [
1829
+ _.value ? (m(), H("div", Ft, [
1830
+ a(e(qe), {
1831
+ type: "warning",
1832
+ closable: !1
1833
+ }, {
1834
+ default: t(() => [
1835
+ c(i(e(o)("keys.issued-text")), 1)
1836
+ ]),
1837
+ _: 1
1838
+ }),
1839
+ a(e(M), {
1840
+ label: e(o)("keys.secret")
1841
+ }, {
1842
+ default: t(() => [
1843
+ S("div", Rt, [
1844
+ a(e(le), {
1845
+ "model-value": _.value.token,
1846
+ readonly: "",
1847
+ name: "token"
1848
+ }, null, 8, ["model-value"]),
1849
+ a(e(N), {
1850
+ type: "primary",
1851
+ onClick: Y
1852
+ }, {
1853
+ icon: t(() => [
1854
+ a(e(Z), {
1855
+ name: k.value ? "check" : "copy"
1856
+ }, null, 8, ["name"])
1857
+ ]),
1858
+ default: t(() => [
1859
+ c(" " + i(k.value ? e(o)("keys.copied") : e(o)("keys.copy")), 1)
1860
+ ]),
1861
+ _: 1
1862
+ })
1863
+ ])
1864
+ ]),
1865
+ _: 1
1866
+ }, 8, ["label"]),
1867
+ n.value ? (m(), b(e(M), {
1868
+ key: 0,
1869
+ label: e(o)("keys.address")
1870
+ }, {
1871
+ default: t(() => [
1872
+ a(e(le), {
1873
+ "model-value": n.value,
1874
+ readonly: "",
1875
+ name: "address"
1876
+ }, null, 8, ["model-value"])
1877
+ ]),
1878
+ _: 1
1879
+ }, 8, ["label"])) : I("", !0),
1880
+ a(e(E), {
1881
+ size: "sm",
1882
+ tone: "muted"
1883
+ }, {
1884
+ default: t(() => [
1885
+ c(i(e(o)("keys.header-hint")), 1)
1886
+ ]),
1887
+ _: 1
1888
+ })
1889
+ ])) : (m(), H("div", Ot, [
1890
+ a(e(E), {
1891
+ size: "sm",
1892
+ tone: "muted"
1893
+ }, {
1894
+ default: t(() => [
1895
+ c(i(e(o)("keys.lead")), 1)
1896
+ ]),
1897
+ _: 1
1898
+ }),
1899
+ a(e(M), {
1900
+ label: e(o)("keys.name"),
1901
+ error: $("name"),
1902
+ help: e(o)("keys.name-hint")
1903
+ }, {
1904
+ default: t(() => [
1905
+ a(e(le), {
1906
+ modelValue: d.value.name,
1907
+ "onUpdate:modelValue": f[0] || (f[0] = (L) => d.value.name = L),
1908
+ name: "name",
1909
+ autocomplete: "off"
1910
+ }, null, 8, ["modelValue"])
1911
+ ]),
1912
+ _: 1
1913
+ }, 8, ["label", "error", "help"]),
1914
+ a(e(M), {
1915
+ label: e(o)("keys.who"),
1916
+ error: $("admin"),
1917
+ help: e(o)("keys.who-hint")
1918
+ }, {
1919
+ default: t(() => [
1920
+ a(e(ne), {
1921
+ modelValue: d.value.admin,
1922
+ "onUpdate:modelValue": f[1] || (f[1] = (L) => d.value.admin = L),
1923
+ options: x.value,
1924
+ filterable: "",
1925
+ name: "admin"
1926
+ }, null, 8, ["modelValue", "options"])
1927
+ ]),
1928
+ _: 1
1929
+ }, 8, ["label", "error", "help"]),
1930
+ a(e(M), {
1931
+ label: e(o)("keys.allowed")
1932
+ }, {
1933
+ default: t(() => [
1934
+ a(e(mt), {
1935
+ modelValue: d.value.access,
1936
+ "onUpdate:modelValue": f[2] || (f[2] = (L) => d.value.access = L),
1937
+ options: C.value,
1938
+ name: "access"
1939
+ }, null, 8, ["modelValue", "options"])
1940
+ ]),
1941
+ _: 1
1942
+ }, 8, ["label"]),
1943
+ d.value.access === "chosen" ? (m(), b(e(M), {
1944
+ key: 0,
1945
+ label: e(o)("keys.scopes"),
1946
+ error: $("scopes"),
1947
+ help: e(o)("keys.scopes-hint")
1948
+ }, {
1949
+ default: t(() => [
1950
+ a(e(ne), {
1951
+ modelValue: d.value.scopes,
1952
+ "onUpdate:modelValue": f[3] || (f[3] = (L) => d.value.scopes = L),
1953
+ options: B.value,
1954
+ multiple: "",
1955
+ filterable: "",
1956
+ name: "scopes"
1957
+ }, null, 8, ["modelValue", "options"])
1958
+ ]),
1959
+ _: 1
1960
+ }, 8, ["label", "error", "help"])) : I("", !0),
1961
+ a(e(M), {
1962
+ label: e(o)("keys.lifetime"),
1963
+ error: $("days"),
1964
+ help: e(o)("keys.lifetime-hint")
1965
+ }, {
1966
+ default: t(() => [
1967
+ a(e(ne), {
1968
+ modelValue: d.value.days,
1969
+ "onUpdate:modelValue": f[4] || (f[4] = (L) => d.value.days = L),
1970
+ options: O.value,
1971
+ name: "days"
1972
+ }, null, 8, ["modelValue", "options"])
1973
+ ]),
1974
+ _: 1
1975
+ }, 8, ["label", "error", "help"])
1976
+ ]))
1977
+ ]),
1978
+ _: 1
1979
+ }, 8, ["open", "title"]));
1980
+ }
1981
+ }), Et = {
1982
+ class: "wx-key-list__glyph",
1983
+ "aria-hidden": "true"
1984
+ }, Re = 560, It = /* @__PURE__ */ Q({
1985
+ __name: "KeyList",
1986
+ setup(s, { expose: r }) {
1987
+ const l = X(), u = tt(l);
1988
+ ee();
1989
+ const v = G("webx-auth"), y = re(), V = oe("root"), o = ge(V), h = T(() => o.value > 0 && o.value < Re), F = A([]), d = A(!1), w = A(null), x = T(() => h.value ? [{ key: "card", label: "" }] : [
1990
+ { key: "name", label: v("keys.name"), minWidth: 200 },
1991
+ { key: "user", label: v("keys.who"), minWidth: 140 },
1992
+ { key: "scopes", label: v("keys.allowed"), minWidth: 180 },
1993
+ { key: "expires_at", label: v("keys.expires"), minWidth: 120 },
1994
+ { key: "last_used_at", label: v("keys.last-used"), minWidth: 120, hideBelow: 860 },
1995
+ { key: "end", label: "", align: "right", width: 120 }
1996
+ ]);
1997
+ function p(C) {
1998
+ return C.user.name ?? v("keys.deleted", { id: C.user.id });
1999
+ }
2000
+ function g(C) {
2001
+ return C.created_by?.name ? v("keys.issued-by", { name: C.created_by.name }) : v("keys.issued-console");
2002
+ }
2003
+ function _(C) {
2004
+ return C.everything ? v("keys.full", { name: C.user.name?.split(" ")[0] || p(C) }) : C.scopes.join(", ");
2005
+ }
2006
+ async function k() {
2007
+ d.value = !0;
2008
+ try {
2009
+ F.value = (await u.list()).data;
2010
+ } catch (C) {
2011
+ K.danger(y(C));
2012
+ } finally {
2013
+ d.value = !1;
2014
+ }
2015
+ }
2016
+ async function B(C) {
2017
+ if (await ze({
2018
+ title: v("keys.confirm-title", { name: C.name }),
2019
+ message: v("keys.confirm-text"),
2020
+ confirmText: v("keys.confirm"),
2021
+ cancelText: v("keys.cancel"),
2022
+ tone: "danger"
2023
+ })) {
2024
+ w.value = C.id;
2025
+ try {
2026
+ const n = await u.revoke(C.id);
2027
+ F.value = F.value.map(($) => $.id === n.id ? n : $), K.success(v("keys.revoked-done", { name: C.name }));
2028
+ } catch (n) {
2029
+ K.danger(y(n));
2030
+ } finally {
2031
+ w.value = null;
2032
+ }
2033
+ }
2034
+ }
2035
+ return Ie(k), r({ reload: k }), (C, O) => (m(), H("div", {
2036
+ ref_key: "root",
2037
+ ref: V,
2038
+ class: "wx-key-list"
2039
+ }, [
2040
+ a(e(ke), {
2041
+ data: F.value,
2042
+ columns: x.value,
2043
+ "row-key": "id",
2044
+ flush: "",
2045
+ loading: d.value,
2046
+ clickable: !1,
2047
+ "empty-text": e(v)("keys.empty"),
2048
+ "cards-below": Re,
2049
+ "row-class": (n) => n.state === "live" ? "" : "is-ended"
2050
+ }, {
2051
+ "cell-name": t(({ row: n }) => [
2052
+ a(e(se), {
2053
+ direction: "vertical",
2054
+ size: "none"
2055
+ }, {
2056
+ default: t(() => [
2057
+ a(e(E), {
2058
+ tone: n.state === "live" ? "default" : "muted",
2059
+ weight: "medium"
2060
+ }, {
2061
+ default: t(() => [
2062
+ c(i(n.name), 1)
2063
+ ]),
2064
+ _: 2
2065
+ }, 1032, ["tone"]),
2066
+ a(e(E), {
2067
+ size: "xs",
2068
+ tone: "muted"
2069
+ }, {
2070
+ default: t(() => [
2071
+ c(i(g(n)) + " · ", 1),
2072
+ a(e(ae), {
2073
+ value: n.created_at,
2074
+ tone: "muted",
2075
+ compact: ""
2076
+ }, null, 8, ["value"])
2077
+ ]),
2078
+ _: 2
2079
+ }, 1024)
2080
+ ]),
2081
+ _: 2
2082
+ }, 1024)
2083
+ ]),
2084
+ "cell-user": t(({ row: n }) => [
2085
+ a(e(E), {
2086
+ tone: n.user.name === null ? "muted" : "default"
2087
+ }, {
2088
+ default: t(() => [
2089
+ c(i(p(n)), 1)
2090
+ ]),
2091
+ _: 2
2092
+ }, 1032, ["tone"])
2093
+ ]),
2094
+ "cell-scopes": t(({ row: n }) => [
2095
+ n.state === "revoked" ? (m(), b(e(q), {
2096
+ key: 0,
2097
+ type: "default",
2098
+ dot: ""
2099
+ }, {
2100
+ default: t(() => [
2101
+ c(i(e(v)("keys.revoked")), 1)
2102
+ ]),
2103
+ _: 1
2104
+ })) : n.state === "expired" ? (m(), b(e(q), {
2105
+ key: 1,
2106
+ type: "default",
2107
+ dot: ""
2108
+ }, {
2109
+ default: t(() => [
2110
+ c(i(e(v)("keys.expired")), 1)
2111
+ ]),
2112
+ _: 1
2113
+ })) : (m(), b(e(q), {
2114
+ key: 2,
2115
+ type: n.everything ? "success" : "info",
2116
+ dot: ""
2117
+ }, {
2118
+ default: t(() => [
2119
+ c(i(_(n)), 1)
2120
+ ]),
2121
+ _: 2
2122
+ }, 1032, ["type"]))
2123
+ ]),
2124
+ "cell-expires_at": t(({ row: n }) => [
2125
+ n.expires_at ? (m(), b(e(ae), {
2126
+ key: 0,
2127
+ value: n.expires_at,
2128
+ compact: ""
2129
+ }, null, 8, ["value"])) : I("", !0)
2130
+ ]),
2131
+ "cell-last_used_at": t(({ row: n }) => [
2132
+ n.last_used_at ? (m(), b(e(ae), {
2133
+ key: 0,
2134
+ value: n.last_used_at,
2135
+ compact: ""
2136
+ }, null, 8, ["value"])) : (m(), b(e(E), {
2137
+ key: 1,
2138
+ size: "sm",
2139
+ tone: "muted"
2140
+ }, {
2141
+ default: t(() => [
2142
+ c(i(e(v)("keys.never-used")), 1)
2143
+ ]),
2144
+ _: 1
2145
+ }))
2146
+ ]),
2147
+ "cell-end": t(({ row: n }) => [
2148
+ n.state === "live" ? (m(), b(e(N), {
2149
+ key: 0,
2150
+ type: "danger",
2151
+ variant: "text",
2152
+ size: "sm",
2153
+ loading: w.value === n.id,
2154
+ onClick: ($) => B(n)
2155
+ }, {
2156
+ default: t(() => [
2157
+ c(i(e(v)("keys.revoke")), 1)
2158
+ ]),
2159
+ _: 1
2160
+ }, 8, ["loading", "onClick"])) : I("", !0)
2161
+ ]),
2162
+ "cell-card": t(({ row: n }) => [
2163
+ a(e(we), {
2164
+ variant: "plain",
2165
+ title: n.name,
2166
+ subtitle: p(n)
2167
+ }, {
2168
+ media: t(() => [
2169
+ S("span", Et, [
2170
+ a(e(Z), { name: "lock" })
2171
+ ])
2172
+ ]),
2173
+ meta: t(() => [
2174
+ n.state === "revoked" ? (m(), b(e(q), {
2175
+ key: 0,
2176
+ type: "default",
2177
+ dot: "",
2178
+ size: "sm"
2179
+ }, {
2180
+ default: t(() => [
2181
+ c(i(e(v)("keys.revoked")), 1)
2182
+ ]),
2183
+ _: 1
2184
+ })) : n.state === "expired" ? (m(), b(e(q), {
2185
+ key: 1,
2186
+ type: "default",
2187
+ dot: "",
2188
+ size: "sm"
2189
+ }, {
2190
+ default: t(() => [
2191
+ c(i(e(v)("keys.expired")), 1)
2192
+ ]),
2193
+ _: 1
2194
+ })) : (m(), b(e(q), {
2195
+ key: 2,
2196
+ type: n.everything ? "success" : "info",
2197
+ dot: "",
2198
+ size: "sm"
2199
+ }, {
2200
+ default: t(() => [
2201
+ c(i(_(n)), 1)
2202
+ ]),
2203
+ _: 2
2204
+ }, 1032, ["type"])),
2205
+ n.expires_at ? (m(), b(e(E), {
2206
+ key: 3,
2207
+ size: "xs",
2208
+ tone: "muted"
2209
+ }, {
2210
+ default: t(() => [
2211
+ c(i(e(v)("keys.until")) + " ", 1),
2212
+ a(e(ae), {
2213
+ value: n.expires_at,
2214
+ compact: ""
2215
+ }, null, 8, ["value"])
2216
+ ]),
2217
+ _: 2
2218
+ }, 1024)) : I("", !0)
2219
+ ]),
2220
+ actions: t(() => [
2221
+ n.state === "live" ? (m(), b(e(N), {
2222
+ key: 0,
2223
+ type: "danger",
2224
+ variant: "text",
2225
+ size: "sm",
2226
+ loading: w.value === n.id,
2227
+ onClick: ($) => B(n)
2228
+ }, {
2229
+ default: t(() => [
2230
+ c(i(e(v)("keys.revoke")), 1)
2231
+ ]),
2232
+ _: 1
2233
+ }, 8, ["loading", "onClick"])) : I("", !0)
2234
+ ]),
2235
+ _: 2
2236
+ }, 1032, ["title", "subtitle"])
2237
+ ]),
2238
+ _: 1
2239
+ }, 8, ["data", "columns", "loading", "empty-text", "row-class"])
2240
+ ], 512));
2241
+ }
2242
+ }), Dt = /* @__PURE__ */ Q({
1637
2243
  __name: "AdminsPage",
1638
2244
  props: {
1639
2245
  base: { default: "/admins" },
@@ -1641,259 +2247,257 @@ const St = {
1641
2247
  avatarField: { default: void 0 },
1642
2248
  resolveAvatar: { type: Function, default: void 0 }
1643
2249
  },
1644
- setup(n) {
1645
- const u = n, l = Z(), s = he(l), g = u.avatarField ?? Ke(l) ?? void 0, c = u.resolveAvatar ?? Ye(l) ?? void 0, A = st(), r = ot();
1646
- te();
1647
- const m = j("webx-auth"), U = me(), p = ue("list"), w = z(null), x = Ve(wt), f = l.can("admins.manage"), y = l.can("admins.audit"), v = T(
1648
- () => l.state.manifest?.modules.find((b) => b.id === "admins")?.title ?? m("admins.title")
1649
- ), _ = T(() => {
1650
- const b = [{ value: "admins", label: v.value }];
1651
- return y && b.push({ value: "calls", label: m("calls.title") }), f && b.push({ value: "connections", label: m("connections.title") }), b.length > 1 ? b : void 0;
1652
- }), P = T({
1653
- get: () => u.current,
1654
- set: (b) => {
1655
- const L = b === "admins" ? u.base : `${u.base}/${String(b)}`;
1656
- L !== r.path && A.push(L);
2250
+ setup(s) {
2251
+ const r = s, l = X(), u = pe(l), v = r.avatarField ?? Ye(l) ?? void 0, y = r.resolveAvatar ?? Je(l) ?? void 0, V = rt(), o = ct();
2252
+ ee();
2253
+ const h = G("webx-auth"), F = re(), d = oe("list"), w = oe("keys"), x = A(null), p = he($t), g = he(Bt), _ = l.can("admins.manage"), k = l.can("admins.audit"), B = T(
2254
+ () => l.state.manifest?.modules.find((U) => U.id === "admins")?.title ?? h("admins.title")
2255
+ ), C = T(() => {
2256
+ const U = [{ value: "admins", label: B.value }];
2257
+ return k && U.push({ value: "calls", label: h("calls.title") }), _ && U.push({ value: "connections", label: h("connections.title") }), _ && U.push({ value: "keys", label: h("keys.title") }), U.length > 1 ? U : void 0;
2258
+ }), O = T({
2259
+ get: () => r.current,
2260
+ set: (U) => {
2261
+ const z = U === "admins" ? r.base : `${r.base}/${String(U)}`;
2262
+ z !== o.path && V.push(z);
1657
2263
  }
1658
- }), W = T(
1659
- () => f && u.current === "admins" ? [
1660
- {
1661
- key: "new",
1662
- label: m("admins.new-short"),
1663
- icon: "plus",
1664
- primary: !0,
1665
- run: () => {
1666
- F(null);
1667
- }
2264
+ }), n = T(() => _ ? r.current === "admins" ? [
2265
+ {
2266
+ key: "new",
2267
+ label: h("admins.new-short"),
2268
+ icon: "plus",
2269
+ primary: !0,
2270
+ run: () => {
2271
+ R(null);
1668
2272
  }
1669
- ] : []
1670
- );
1671
- async function F(b) {
1672
- w.value = b, await x({ admin: b, avatarField: g }) && p.value?.reload();
2273
+ }
2274
+ ] : r.current === "keys" ? [
2275
+ {
2276
+ key: "issue",
2277
+ label: h("keys.issue-short"),
2278
+ icon: "plus",
2279
+ primary: !0,
2280
+ run: () => {
2281
+ $();
2282
+ }
2283
+ }
2284
+ ] : [] : []);
2285
+ async function $() {
2286
+ await g() && w.value?.reload();
2287
+ }
2288
+ async function R(U) {
2289
+ x.value = U, await p({ admin: U, avatarField: v }) && d.value?.reload();
1673
2290
  }
1674
- async function i(b) {
1675
- if (await Ne({
1676
- title: m("admins.delete-title", { name: b.name }),
1677
- message: m("admins.delete-text"),
1678
- confirmText: m("admins.delete"),
1679
- cancelText: m("admins.cancel"),
2291
+ async function Y(U) {
2292
+ if (await ze({
2293
+ title: h("admins.delete-title", { name: U.name }),
2294
+ message: h("admins.delete-text"),
2295
+ confirmText: h("admins.delete"),
2296
+ cancelText: h("admins.cancel"),
1680
2297
  tone: "danger"
1681
2298
  }))
1682
2299
  try {
1683
- await s.remove(b.id), G.success(m("admins.deleted")), p.value?.reload();
1684
- } catch (I) {
1685
- G.danger(U(I));
2300
+ await u.remove(U.id), K.success(h("admins.deleted")), d.value?.reload();
2301
+ } catch (f) {
2302
+ K.danger(F(f));
1686
2303
  }
1687
2304
  }
1688
- return (b, L) => (h(), $(e(Me), {
1689
- view: P.value,
1690
- "onUpdate:view": L[0] || (L[0] = (I) => P.value = I),
1691
- title: v.value,
1692
- views: _.value,
1693
- actions: W.value
2305
+ return (U, z) => (m(), b(e(Ke), {
2306
+ view: O.value,
2307
+ "onUpdate:view": z[0] || (z[0] = (f) => O.value = f),
2308
+ title: B.value,
2309
+ views: C.value,
2310
+ actions: n.value
1694
2311
  }, {
1695
2312
  default: t(() => [
1696
- n.current === "calls" ? (h(), $(Vt, { key: 0 })) : n.current === "connections" ? (h(), $(Je, {
2313
+ s.current === "calls" ? (m(), b(Lt, { key: 0 })) : s.current === "connections" ? (m(), b(Ze, {
1697
2314
  key: 1,
1698
2315
  scope: "all"
1699
- })) : (h(), $(Ge, {
2316
+ })) : s.current === "keys" ? (m(), b(It, {
1700
2317
  key: 2,
2318
+ ref: "keys"
2319
+ }, null, 512)) : (m(), b(Xe, {
2320
+ key: 3,
1701
2321
  ref_key: "list",
1702
- ref: p,
1703
- removable: e(f),
1704
- "resolve-avatar": e(c),
1705
- onOpen: F,
1706
- onRemove: i
2322
+ ref: d,
2323
+ removable: e(_),
2324
+ "resolve-avatar": e(y),
2325
+ onOpen: R,
2326
+ onRemove: Y
1707
2327
  }, null, 8, ["removable", "resolve-avatar"]))
1708
2328
  ]),
1709
2329
  _: 1
1710
2330
  }, 8, ["view", "title", "views", "actions"]));
1711
2331
  }
1712
- }), Wt = {
2332
+ }), Nt = {
1713
2333
  key: 0,
1714
2334
  class: "wx-content-rules"
1715
- }, Tt = { class: "wx-content-rules__foot" }, Ut = /* @__PURE__ */ Q({
2335
+ }, Mt = { class: "wx-content-rules__foot" }, Kt = /* @__PURE__ */ Q({
1716
2336
  __name: "ContentRulesCard",
1717
- setup(n) {
1718
- const u = Z();
1719
- te();
1720
- const l = j("webx-auth"), s = j("webx-admin"), g = me(), c = T(() => {
1721
- const v = u.state.manifest?.modules.find((_) => _.id === "settings")?.meta?.content_screen;
1722
- return typeof v == "string" ? v : null;
1723
- }), A = u.can("settings.view") || u.can("settings.manage"), r = u.can("settings.manage"), m = z({}), U = z({}), p = z(!0), w = z(!1), x = `${u.apiPath}/settings/content`;
1724
- et(async () => {
1725
- if (!(!c.value || !A))
2337
+ setup(s) {
2338
+ const r = X();
2339
+ ee();
2340
+ const l = G("webx-auth"), u = G("webx-admin"), v = re(), y = T(() => {
2341
+ const _ = r.state.manifest?.modules.find((k) => k.id === "settings")?.meta?.content_screen;
2342
+ return typeof _ == "string" ? _ : null;
2343
+ }), V = r.can("settings.view") || r.can("settings.manage"), o = r.can("settings.manage"), h = A({}), F = A({}), d = A(!0), w = A(!1), x = `${r.apiPath}/settings/content`;
2344
+ Ie(async () => {
2345
+ if (!(!y.value || !V))
1726
2346
  try {
1727
- const y = await u.http.get(x);
1728
- m.value = y.data.values;
1729
- } catch (y) {
1730
- G.danger(g(y));
2347
+ const g = await r.http.get(x);
2348
+ h.value = g.data.values;
2349
+ } catch (g) {
2350
+ K.danger(v(g));
1731
2351
  } finally {
1732
- p.value = !1;
2352
+ d.value = !1;
1733
2353
  }
1734
2354
  });
1735
- async function f() {
1736
- w.value = !0, U.value = {};
2355
+ async function p() {
2356
+ w.value = !0, F.value = {};
1737
2357
  try {
1738
- const y = await u.http.put(x, {
1739
- values: m.value
2358
+ const g = await r.http.put(x, {
2359
+ values: h.value
1740
2360
  });
1741
- m.value = y.data.values, G.success(s("editor.saved"));
1742
- } catch (y) {
1743
- const v = y.body;
1744
- v?.errors && (U.value = v.errors), G.danger(g(y));
2361
+ h.value = g.data.values, K.success(u("editor.saved"));
2362
+ } catch (g) {
2363
+ const _ = g.body;
2364
+ _?.errors && (F.value = _.errors), K.danger(v(g));
1745
2365
  } finally {
1746
2366
  w.value = !1;
1747
2367
  }
1748
2368
  }
1749
- return (y, v) => c.value && e(A) ? (h(), Y("section", Wt, [
1750
- a(e(de), {
2369
+ return (g, _) => y.value && e(V) ? (m(), H("section", Nt, [
2370
+ a(e(me), {
1751
2371
  level: 2,
1752
2372
  size: "sm"
1753
2373
  }, {
1754
2374
  default: t(() => [
1755
- d(o(e(l)("connect.rules")), 1)
2375
+ c(i(e(l)("connect.rules")), 1)
1756
2376
  ]),
1757
2377
  _: 1
1758
2378
  }),
1759
- a(e(be), null, we({
2379
+ a(e($e), null, Ae({
1760
2380
  default: t(() => [
1761
- p.value ? (h(), $(e(rt), {
2381
+ d.value ? (m(), b(e(vt), {
1762
2382
  key: 0,
1763
2383
  rows: 4
1764
- })) : (h(), $(e(lt), {
2384
+ })) : (m(), b(e(it), {
1765
2385
  key: 1,
1766
- modelValue: m.value,
1767
- "onUpdate:modelValue": v[0] || (v[0] = (_) => m.value = _),
1768
- name: c.value,
1769
- errors: U.value,
1770
- disabled: !e(r)
2386
+ modelValue: h.value,
2387
+ "onUpdate:modelValue": _[0] || (_[0] = (k) => h.value = k),
2388
+ name: y.value,
2389
+ errors: F.value,
2390
+ disabled: !e(o)
1771
2391
  }, null, 8, ["modelValue", "name", "errors", "disabled"]))
1772
2392
  ]),
1773
2393
  _: 2
1774
2394
  }, [
1775
- p.value ? void 0 : {
2395
+ d.value ? void 0 : {
1776
2396
  name: "footer",
1777
2397
  fn: t(() => [
1778
- V("div", Tt, [
1779
- a(e(O), {
2398
+ S("div", Mt, [
2399
+ a(e(E), {
1780
2400
  size: "sm",
1781
2401
  tone: "muted"
1782
2402
  }, {
1783
2403
  default: t(() => [
1784
- d(o(e(l)("connect.rules-hint")), 1)
2404
+ c(i(e(l)("connect.rules-hint")), 1)
1785
2405
  ]),
1786
2406
  _: 1
1787
2407
  }),
1788
- e(r) ? (h(), $(e(N), {
2408
+ e(o) ? (m(), b(e(N), {
1789
2409
  key: 0,
1790
2410
  type: "primary",
1791
2411
  loading: w.value,
1792
- onClick: f
2412
+ onClick: p
1793
2413
  }, {
1794
2414
  default: t(() => [
1795
- d(o(e(s)("editor.save")), 1)
2415
+ c(i(e(u)("editor.save")), 1)
1796
2416
  ]),
1797
2417
  _: 1
1798
- }, 8, ["loading"])) : E("", !0)
2418
+ }, 8, ["loading"])) : I("", !0)
1799
2419
  ])
1800
2420
  ]),
1801
2421
  key: "0"
1802
2422
  }
1803
2423
  ]), 1024)
1804
- ])) : E("", !0);
2424
+ ])) : I("", !0);
1805
2425
  }
1806
- }), Pt = /* @__PURE__ */ ve(Ut, [["__scopeId", "data-v-55be157e"]]), Ft = { class: "wx-connect" }, Rt = { class: "wx-connect__section" }, Bt = { class: "wx-connect__row" }, Ot = { class: "wx-connect__url" }, Et = { class: "wx-connect__section" }, Dt = { class: "wx-connect__steps" }, Mt = { class: "wx-connect__steps" }, Nt = { class: "wx-connect__snippet" }, It = { class: "wx-connect__snippet" }, qt = { class: "wx-connect__section" }, Ht = { class: "wx-connect__links" }, Kt = { class: "wx-connect__steps" }, Yt = { class: "wx-connect__section" }, jt = /* @__PURE__ */ Q({
2426
+ }), qt = /* @__PURE__ */ ve(Kt, [["__scopeId", "data-v-55be157e"]]), Ht = { class: "wx-connect" }, jt = { class: "wx-connect__section" }, Gt = { class: "wx-connect__row" }, Yt = { class: "wx-connect__url" }, Jt = { class: "wx-connect__section" }, Qt = { class: "wx-connect__steps" }, Xt = { class: "wx-connect__steps" }, Zt = { class: "wx-connect__snippet" }, ea = { class: "wx-connect__snippet" }, ta = { class: "wx-connect__section" }, aa = { class: "wx-connect__links" }, la = { class: "wx-connect__steps" }, na = { class: "wx-connect__section" }, sa = /* @__PURE__ */ Q({
1807
2427
  __name: "ConnectPage",
1808
- setup(n) {
1809
- const u = Z();
1810
- te();
1811
- const l = j("webx-auth"), s = z(!1);
1812
- let g;
1813
- const c = T(() => {
1814
- const y = u.state.manifest?.modules.find((v) => v.id === "connect")?.meta;
1815
- return typeof y?.url == "string" ? y.url : "";
1816
- }), A = T(() => {
2428
+ setup(s) {
2429
+ const r = X();
2430
+ ee();
2431
+ const l = G("webx-auth"), u = A(!1);
2432
+ let v;
2433
+ const y = T(() => {
2434
+ const p = r.state.manifest?.modules.find((g) => g.id === "connect")?.meta;
2435
+ return typeof p?.url == "string" ? p.url : "";
2436
+ }), V = T(() => {
1817
2437
  try {
1818
- return new URL(c.value).hostname.split(".")[0] || "webx";
2438
+ return new URL(y.value).hostname.split(".")[0] || "webx";
1819
2439
  } catch {
1820
2440
  return "webx";
1821
2441
  }
1822
- }), r = T(() => `claude mcp add --transport http ${A.value} ${c.value}`), m = T(() => `[mcp_servers.${A.value}]
1823
- url = "${c.value}"`), U = T(() => {
1824
- const y = w(JSON.stringify({ url: c.value }));
1825
- return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(A.value)}&config=${y}`;
1826
- }), p = T(() => {
1827
- const y = JSON.stringify({ name: A.value, type: "http", url: c.value });
1828
- return `vscode:mcp/install?${encodeURIComponent(y)}`;
2442
+ }), o = T(() => `claude mcp add --transport http ${V.value} ${y.value}`), h = T(() => `[mcp_servers.${V.value}]
2443
+ url = "${y.value}"`), F = T(() => {
2444
+ const p = w(JSON.stringify({ url: y.value }));
2445
+ return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(V.value)}&config=${p}`;
2446
+ }), d = T(() => {
2447
+ const p = JSON.stringify({ name: V.value, type: "http", url: y.value });
2448
+ return `vscode:mcp/install?${encodeURIComponent(p)}`;
1829
2449
  });
1830
- function w(y) {
1831
- const v = new TextEncoder().encode(y);
2450
+ function w(p) {
2451
+ const g = new TextEncoder().encode(p);
1832
2452
  let _ = "";
1833
- for (const P of v) _ += String.fromCharCode(P);
2453
+ for (const k of g) _ += String.fromCharCode(k);
1834
2454
  return encodeURIComponent(btoa(_));
1835
2455
  }
1836
- async function x(y) {
1837
- try {
1838
- if (navigator.clipboard?.writeText)
1839
- await navigator.clipboard.writeText(y);
1840
- else if (!f(y))
1841
- throw new Error("no clipboard");
1842
- s.value = !0, clearTimeout(g), g = setTimeout(() => s.value = !1, 2e3);
1843
- } catch {
1844
- if (f(y)) return;
1845
- G.danger(l("connect.copy-failed"));
1846
- }
1847
- }
1848
- function f(y) {
1849
- const v = document.createElement("textarea");
1850
- v.value = y, v.setAttribute("readonly", ""), v.style.position = "fixed", v.style.opacity = "0", document.body.append(v), v.select();
1851
- try {
1852
- return document.execCommand("copy");
1853
- } catch {
1854
- return !1;
1855
- } finally {
1856
- v.remove();
2456
+ async function x(p) {
2457
+ if (!await et(p)) {
2458
+ K.danger(l("connect.copy-failed"));
2459
+ return;
1857
2460
  }
2461
+ u.value = !0, clearTimeout(v), v = setTimeout(() => u.value = !1, 2e3);
1858
2462
  }
1859
- return (y, v) => (h(), $(e(Me), {
2463
+ return (p, g) => (m(), b(e(Ke), {
1860
2464
  title: e(l)("connect.title"),
1861
2465
  card: !1
1862
2466
  }, {
1863
2467
  default: t(() => [
1864
- V("div", Ft, [
1865
- a(e(O), { class: "wx-connect__lead" }, {
2468
+ S("div", Ht, [
2469
+ a(e(E), { class: "wx-connect__lead" }, {
1866
2470
  default: t(() => [
1867
- d(o(e(l)("connect.lead")), 1)
2471
+ c(i(e(l)("connect.lead")), 1)
1868
2472
  ]),
1869
2473
  _: 1
1870
2474
  }),
1871
- V("section", Rt, [
1872
- a(e(de), {
2475
+ S("section", jt, [
2476
+ a(e(me), {
1873
2477
  level: 2,
1874
2478
  size: "sm"
1875
2479
  }, {
1876
2480
  default: t(() => [
1877
- d(o(e(l)("connect.address")), 1)
2481
+ c(i(e(l)("connect.address")), 1)
1878
2482
  ]),
1879
2483
  _: 1
1880
2484
  }),
1881
- a(e(be), { bordered: "" }, {
2485
+ a(e($e), { bordered: "" }, {
1882
2486
  default: t(() => [
1883
- V("div", Bt, [
1884
- V("code", Ot, o(c.value), 1),
2487
+ S("div", Gt, [
2488
+ S("code", Yt, i(y.value), 1),
1885
2489
  a(e(N), {
1886
2490
  type: "primary",
1887
- disabled: c.value === "",
1888
- onClick: v[0] || (v[0] = (_) => x(c.value))
2491
+ disabled: y.value === "",
2492
+ onClick: g[0] || (g[0] = (_) => x(y.value))
1889
2493
  }, {
1890
2494
  icon: t(() => [
1891
- a(e(ee), {
1892
- name: s.value ? "check" : "copy"
2495
+ a(e(Z), {
2496
+ name: u.value ? "check" : "copy"
1893
2497
  }, null, 8, ["name"])
1894
2498
  ]),
1895
2499
  default: t(() => [
1896
- d(" " + o(s.value ? e(l)("connect.copied") : e(l)("connect.copy")), 1)
2500
+ c(" " + i(u.value ? e(l)("connect.copied") : e(l)("connect.copy")), 1)
1897
2501
  ]),
1898
2502
  _: 1
1899
2503
  }, 8, ["disabled"])
@@ -1902,70 +2506,70 @@ url = "${c.value}"`), U = T(() => {
1902
2506
  _: 1
1903
2507
  })
1904
2508
  ]),
1905
- V("section", Et, [
1906
- a(e(de), {
2509
+ S("section", Jt, [
2510
+ a(e(me), {
1907
2511
  level: 2,
1908
2512
  size: "sm"
1909
2513
  }, {
1910
2514
  default: t(() => [
1911
- d(o(e(l)("connect.how")), 1)
2515
+ c(i(e(l)("connect.how")), 1)
1912
2516
  ]),
1913
2517
  _: 1
1914
2518
  }),
1915
- a(e(ut), {
2519
+ a(e(pt), {
1916
2520
  variant: "line",
1917
2521
  "aria-label": e(l)("connect.how")
1918
2522
  }, {
1919
2523
  default: t(() => [
1920
- a(e(fe), {
2524
+ a(e(ye), {
1921
2525
  value: "claude",
1922
2526
  label: e(l)("connect.claude-title")
1923
2527
  }, {
1924
2528
  default: t(() => [
1925
- V("ol", Dt, [
1926
- V("li", null, o(e(l)("connect.claude-1")), 1),
1927
- V("li", null, o(e(l)("connect.claude-2")), 1),
1928
- V("li", null, o(e(l)("connect.claude-3")), 1)
2529
+ S("ol", Qt, [
2530
+ S("li", null, i(e(l)("connect.claude-1")), 1),
2531
+ S("li", null, i(e(l)("connect.claude-2")), 1),
2532
+ S("li", null, i(e(l)("connect.claude-3")), 1)
1929
2533
  ])
1930
2534
  ]),
1931
2535
  _: 1
1932
2536
  }, 8, ["label"]),
1933
- a(e(fe), {
2537
+ a(e(ye), {
1934
2538
  value: "chatgpt",
1935
2539
  label: e(l)("connect.chatgpt-title")
1936
2540
  }, {
1937
2541
  default: t(() => [
1938
- V("ol", Mt, [
1939
- V("li", null, o(e(l)("connect.chatgpt-1")), 1),
1940
- V("li", null, o(e(l)("connect.chatgpt-2")), 1),
1941
- V("li", null, o(e(l)("connect.chatgpt-3")), 1)
2542
+ S("ol", Xt, [
2543
+ S("li", null, i(e(l)("connect.chatgpt-1")), 1),
2544
+ S("li", null, i(e(l)("connect.chatgpt-2")), 1),
2545
+ S("li", null, i(e(l)("connect.chatgpt-3")), 1)
1942
2546
  ])
1943
2547
  ]),
1944
2548
  _: 1
1945
2549
  }, 8, ["label"]),
1946
- a(e(fe), {
2550
+ a(e(ye), {
1947
2551
  value: "claude-code",
1948
2552
  label: e(l)("connect.claude-code-title")
1949
2553
  }, {
1950
2554
  default: t(() => [
1951
- a(e(O), { size: "sm" }, {
2555
+ a(e(E), { size: "sm" }, {
1952
2556
  default: t(() => [
1953
- d(o(e(l)("connect.claude-code-hint")), 1)
2557
+ c(i(e(l)("connect.claude-code-hint")), 1)
1954
2558
  ]),
1955
2559
  _: 1
1956
2560
  }),
1957
- V("div", Nt, [
1958
- V("pre", null, o(r.value), 1),
2561
+ S("div", Zt, [
2562
+ S("pre", null, i(o.value), 1),
1959
2563
  a(e(N), {
1960
2564
  variant: "text",
1961
2565
  size: "sm",
1962
- onClick: v[1] || (v[1] = (_) => x(r.value))
2566
+ onClick: g[1] || (g[1] = (_) => x(o.value))
1963
2567
  }, {
1964
2568
  icon: t(() => [
1965
- a(e(ee), { name: "copy" })
2569
+ a(e(Z), { name: "copy" })
1966
2570
  ]),
1967
2571
  default: t(() => [
1968
- d(" " + o(e(l)("connect.copy-line")), 1)
2572
+ c(" " + i(e(l)("connect.copy-line")), 1)
1969
2573
  ]),
1970
2574
  _: 1
1971
2575
  })
@@ -1973,29 +2577,29 @@ url = "${c.value}"`), U = T(() => {
1973
2577
  ]),
1974
2578
  _: 1
1975
2579
  }, 8, ["label"]),
1976
- a(e(fe), {
2580
+ a(e(ye), {
1977
2581
  value: "codex",
1978
2582
  label: e(l)("connect.codex-title")
1979
2583
  }, {
1980
2584
  default: t(() => [
1981
- a(e(O), { size: "sm" }, {
2585
+ a(e(E), { size: "sm" }, {
1982
2586
  default: t(() => [
1983
- d(o(e(l)("connect.codex-hint")), 1)
2587
+ c(i(e(l)("connect.codex-hint")), 1)
1984
2588
  ]),
1985
2589
  _: 1
1986
2590
  }),
1987
- V("div", It, [
1988
- V("pre", null, o(m.value), 1),
2591
+ S("div", ea, [
2592
+ S("pre", null, i(h.value), 1),
1989
2593
  a(e(N), {
1990
2594
  variant: "text",
1991
2595
  size: "sm",
1992
- onClick: v[2] || (v[2] = (_) => x(m.value))
2596
+ onClick: g[2] || (g[2] = (_) => x(h.value))
1993
2597
  }, {
1994
2598
  icon: t(() => [
1995
- a(e(ee), { name: "copy" })
2599
+ a(e(Z), { name: "copy" })
1996
2600
  ]),
1997
2601
  default: t(() => [
1998
- d(" " + o(e(l)("connect.copy-line")), 1)
2602
+ c(" " + i(e(l)("connect.copy-line")), 1)
1999
2603
  ]),
2000
2604
  _: 1
2001
2605
  })
@@ -2007,83 +2611,83 @@ url = "${c.value}"`), U = T(() => {
2007
2611
  _: 1
2008
2612
  }, 8, ["aria-label"])
2009
2613
  ]),
2010
- V("section", qt, [
2011
- a(e(de), {
2614
+ S("section", ta, [
2615
+ a(e(me), {
2012
2616
  level: 2,
2013
2617
  size: "sm"
2014
2618
  }, {
2015
2619
  default: t(() => [
2016
- d(o(e(l)("connect.one-click")), 1)
2620
+ c(i(e(l)("connect.one-click")), 1)
2017
2621
  ]),
2018
2622
  _: 1
2019
2623
  }),
2020
- a(e(O), {
2624
+ a(e(E), {
2021
2625
  size: "sm",
2022
2626
  tone: "muted"
2023
2627
  }, {
2024
2628
  default: t(() => [
2025
- d(o(e(l)("connect.one-click-hint")), 1)
2629
+ c(i(e(l)("connect.one-click-hint")), 1)
2026
2630
  ]),
2027
2631
  _: 1
2028
2632
  }),
2029
- V("div", Ht, [
2633
+ S("div", aa, [
2030
2634
  a(e(N), {
2031
- href: U.value,
2635
+ href: F.value,
2032
2636
  variant: "outline",
2033
- disabled: c.value === "",
2637
+ disabled: y.value === "",
2034
2638
  class: "wx-connect__link"
2035
2639
  }, {
2036
2640
  icon: t(() => [
2037
- a(e(ee), { name: "external-link" })
2641
+ a(e(Z), { name: "external-link" })
2038
2642
  ]),
2039
2643
  default: t(() => [
2040
- d(" " + o(e(l)("connect.install-in", { client: e(l)("connect.cursor-title") })), 1)
2644
+ c(" " + i(e(l)("connect.install-in", { client: e(l)("connect.cursor-title") })), 1)
2041
2645
  ]),
2042
2646
  _: 1
2043
2647
  }, 8, ["href", "disabled"]),
2044
2648
  a(e(N), {
2045
- href: p.value,
2649
+ href: d.value,
2046
2650
  variant: "outline",
2047
- disabled: c.value === "",
2651
+ disabled: y.value === "",
2048
2652
  class: "wx-connect__link"
2049
2653
  }, {
2050
2654
  icon: t(() => [
2051
- a(e(ee), { name: "external-link" })
2655
+ a(e(Z), { name: "external-link" })
2052
2656
  ]),
2053
2657
  default: t(() => [
2054
- d(" " + o(e(l)("connect.install-in", { client: e(l)("connect.vscode-title") })), 1)
2658
+ c(" " + i(e(l)("connect.install-in", { client: e(l)("connect.vscode-title") })), 1)
2055
2659
  ]),
2056
2660
  _: 1
2057
2661
  }, 8, ["href", "disabled"])
2058
2662
  ])
2059
2663
  ]),
2060
- a(e(ct), {
2664
+ a(e(qe), {
2061
2665
  type: "info",
2062
2666
  title: e(l)("connect.next")
2063
2667
  }, {
2064
2668
  default: t(() => [
2065
- V("ol", Kt, [
2066
- V("li", null, o(e(l)("connect.next-1")), 1),
2067
- V("li", null, o(e(l)("connect.next-2")), 1),
2068
- V("li", null, o(e(l)("connect.next-3")), 1)
2669
+ S("ol", la, [
2670
+ S("li", null, i(e(l)("connect.next-1")), 1),
2671
+ S("li", null, i(e(l)("connect.next-2")), 1),
2672
+ S("li", null, i(e(l)("connect.next-3")), 1)
2069
2673
  ])
2070
2674
  ]),
2071
2675
  _: 1
2072
2676
  }, 8, ["title"]),
2073
- a(Pt),
2074
- V("section", Yt, [
2075
- a(e(de), {
2677
+ a(qt),
2678
+ S("section", na, [
2679
+ a(e(me), {
2076
2680
  level: 2,
2077
2681
  size: "sm"
2078
2682
  }, {
2079
2683
  default: t(() => [
2080
- d(o(e(l)("connect.mine")), 1)
2684
+ c(i(e(l)("connect.mine")), 1)
2081
2685
  ]),
2082
2686
  _: 1
2083
2687
  }),
2084
- a(e(be), { padding: "none" }, {
2688
+ a(e($e), { padding: "none" }, {
2085
2689
  default: t(() => [
2086
- a(Je, { scope: "mine" })
2690
+ a(Ze, { scope: "mine" })
2087
2691
  ]),
2088
2692
  _: 1
2089
2693
  })
@@ -2093,78 +2697,81 @@ url = "${c.value}"`), U = T(() => {
2093
2697
  _: 1
2094
2698
  }, 8, ["title"]));
2095
2699
  }
2096
- }), Gt = /* @__PURE__ */ ve(jt, [["__scopeId", "data-v-0eba9ed6"]]);
2097
- function va(n = {}) {
2098
- const u = n.path ?? "/admins", l = (s) => ({
2099
- render: () => Oe(Lt, {
2100
- base: u,
2101
- current: s,
2102
- avatarField: n.avatarField,
2103
- resolveAvatar: n.resolveAvatar
2700
+ }), oa = /* @__PURE__ */ ve(sa, [["__scopeId", "data-v-19a489e0"]]);
2701
+ function Ca(s = {}) {
2702
+ const r = s.path ?? "/admins", l = (u) => ({
2703
+ render: () => De(Dt, {
2704
+ base: r,
2705
+ current: u,
2706
+ avatarField: s.avatarField,
2707
+ resolveAvatar: s.resolveAvatar
2104
2708
  })
2105
2709
  });
2106
2710
  return {
2107
2711
  id: "admins",
2108
- path: u,
2712
+ path: r,
2109
2713
  routes: [
2110
- { path: u, name: "webx.admins", component: l("admins") },
2111
- // What their agents did, and which agents they let in: two more views of the same
2714
+ { path: r, name: "webx.admins", component: l("admins") },
2715
+ // What their agents did, which agents they let in, and their keys: more views of the same
2112
2716
  // section, each with an address of its own so that its filters survive a trip to the
2113
2717
  // people and back.
2114
- { path: `${u}/calls`, name: "webx.admins.calls", component: l("calls") },
2718
+ { path: `${r}/calls`, name: "webx.admins.calls", component: l("calls") },
2115
2719
  {
2116
- path: `${u}/connections`,
2720
+ path: `${r}/connections`,
2117
2721
  name: "webx.admins.connections",
2118
2722
  component: l("connections")
2119
- }
2723
+ },
2724
+ // Keys for programs: a connection without a browser, issued by somebody who manages
2725
+ // the people it acts as.
2726
+ { path: `${r}/keys`, name: "webx.admins.keys", component: l("keys") }
2120
2727
  ]
2121
2728
  };
2122
2729
  }
2123
- function pa(n = {}) {
2124
- const u = n.path ?? "/connect";
2730
+ function $a(s = {}) {
2731
+ const r = s.path ?? "/connect";
2125
2732
  return {
2126
2733
  id: "connect",
2127
- path: u,
2128
- routes: [{ path: u, name: "webx.connect", component: Gt }]
2734
+ path: r,
2735
+ routes: [{ path: r, name: "webx.connect", component: oa }]
2129
2736
  };
2130
2737
  }
2131
- const Jt = /* @__PURE__ */ Q({
2738
+ const ia = /* @__PURE__ */ Q({
2132
2739
  __name: "AdminPicker",
2133
2740
  props: {
2134
2741
  multiple: { type: Boolean, default: !1 },
2135
2742
  title: { default: void 0 },
2136
2743
  resolveAvatar: { type: Function, default: void 0 }
2137
2744
  },
2138
- setup(n) {
2139
- const u = n, { open: l, resolve: s, dismiss: g } = xe();
2140
- te();
2141
- const c = j("webx-auth"), A = ue("list"), r = z(0);
2142
- function m(p) {
2143
- s(p);
2745
+ setup(s) {
2746
+ const r = s, { open: l, resolve: u, dismiss: v } = _e();
2747
+ ee();
2748
+ const y = G("webx-auth"), V = oe("list"), o = A(0);
2749
+ function h(d) {
2750
+ u(d);
2144
2751
  }
2145
- function U(p) {
2146
- r.value = p.length;
2752
+ function F(d) {
2753
+ o.value = d.length;
2147
2754
  }
2148
- return (p, w) => (h(), $(e(ke), {
2755
+ return (d, w) => (m(), b(e(be), {
2149
2756
  open: e(l),
2150
- "onUpdate:open": w[2] || (w[2] = (x) => ge(l) ? l.value = x : null),
2151
- title: n.title ?? e(c)(n.multiple ? "admins.select-many" : "admins.select-one"),
2757
+ "onUpdate:open": w[2] || (w[2] = (x) => Ve(l) ? l.value = x : null),
2758
+ title: s.title ?? e(y)(s.multiple ? "admins.select-many" : "admins.select-one"),
2152
2759
  width: 880
2153
- }, we({
2760
+ }, Ae({
2154
2761
  default: t(() => [
2155
- a(Ge, {
2762
+ a(Xe, {
2156
2763
  ref_key: "list",
2157
- ref: A,
2764
+ ref: V,
2158
2765
  picking: "",
2159
- multiple: n.multiple,
2160
- "resolve-avatar": u.resolveAvatar,
2161
- onChosen: m,
2162
- onSelection: U
2766
+ multiple: s.multiple,
2767
+ "resolve-avatar": r.resolveAvatar,
2768
+ onChosen: h,
2769
+ onSelection: F
2163
2770
  }, null, 8, ["multiple", "resolve-avatar"])
2164
2771
  ]),
2165
2772
  _: 2
2166
2773
  }, [
2167
- n.multiple ? {
2774
+ s.multiple ? {
2168
2775
  name: "footer",
2169
2776
  fn: t(() => [
2170
2777
  a(e(se), {
@@ -2172,31 +2779,31 @@ const Jt = /* @__PURE__ */ Q({
2172
2779
  align: "center"
2173
2780
  }, {
2174
2781
  default: t(() => [
2175
- a(e(O), {
2782
+ a(e(E), {
2176
2783
  size: "sm",
2177
2784
  tone: "muted"
2178
2785
  }, {
2179
2786
  default: t(() => [
2180
- d(o(e(c)("admins.chosen", { count: r.value })), 1)
2787
+ c(i(e(y)("admins.chosen", { count: o.value })), 1)
2181
2788
  ]),
2182
2789
  _: 1
2183
2790
  }),
2184
2791
  a(e(N), {
2185
2792
  variant: "outline",
2186
- onClick: w[0] || (w[0] = (x) => e(g)())
2793
+ onClick: w[0] || (w[0] = (x) => e(v)())
2187
2794
  }, {
2188
2795
  default: t(() => [
2189
- d(o(e(c)("admins.cancel")), 1)
2796
+ c(i(e(y)("admins.cancel")), 1)
2190
2797
  ]),
2191
2798
  _: 1
2192
2799
  }),
2193
2800
  a(e(N), {
2194
2801
  type: "primary",
2195
- disabled: r.value === 0,
2196
- onClick: w[1] || (w[1] = (x) => e(s)(A.value?.chosen() ?? []))
2802
+ disabled: o.value === 0,
2803
+ onClick: w[1] || (w[1] = (x) => e(u)(V.value?.chosen() ?? []))
2197
2804
  }, {
2198
2805
  default: t(() => [
2199
- d(o(e(c)("admins.save")), 1)
2806
+ c(i(e(y)("admins.save")), 1)
2200
2807
  ]),
2201
2808
  _: 1
2202
2809
  }, 8, ["disabled"])
@@ -2208,144 +2815,144 @@ const Jt = /* @__PURE__ */ Q({
2208
2815
  } : void 0
2209
2816
  ]), 1032, ["open", "title"]));
2210
2817
  }
2211
- }), Qe = Ve(Jt);
2212
- async function fa(n = {}) {
2213
- return (await Qe({ ...n, multiple: !1 }))?.[0];
2818
+ }), at = he(ia);
2819
+ async function Va(s = {}) {
2820
+ return (await at({ ...s, multiple: !1 }))?.[0];
2214
2821
  }
2215
- function ha(n = {}) {
2216
- return Qe({ ...n, multiple: !0 });
2822
+ function Aa(s = {}) {
2823
+ return at({ ...s, multiple: !0 });
2217
2824
  }
2218
- const Qt = { class: "wx-profile-host" }, Xt = { class: "wx-profile" }, Zt = {
2825
+ const ua = { class: "wx-profile-host" }, ra = { class: "wx-profile" }, ca = {
2219
2826
  key: 0,
2220
2827
  class: "wx-profile__aside"
2221
- }, ea = { class: "wx-profile__fields" }, ta = /* @__PURE__ */ Q({
2828
+ }, da = { class: "wx-profile__fields" }, ma = /* @__PURE__ */ Q({
2222
2829
  __name: "ProfileDialog",
2223
2830
  props: {
2224
2831
  avatarField: { default: void 0 }
2225
2832
  },
2226
- setup(n) {
2227
- const u = n, { resolve: l, dismiss: s, open: g } = xe(), c = Z(), A = ze();
2228
- te();
2229
- const r = j("webx-auth"), m = me(), U = z(!1), p = z({}), w = z({
2230
- name: c.state.user?.name ?? "",
2231
- avatar: c.state.user?.avatar ?? null,
2833
+ setup(s) {
2834
+ const r = s, { resolve: l, dismiss: u, open: v } = _e(), y = X(), V = We();
2835
+ ee();
2836
+ const o = G("webx-auth"), h = re(), F = A(!1), d = A({}), w = A({
2837
+ name: y.state.user?.name ?? "",
2838
+ avatar: y.state.user?.avatar ?? null,
2232
2839
  password: "",
2233
2840
  current_password: ""
2234
- }), x = z(w.value.avatar ? { path: w.value.avatar } : null);
2235
- function f(v) {
2236
- return p.value[v]?.[0];
2841
+ }), x = A(w.value.avatar ? { path: w.value.avatar } : null);
2842
+ function p(_) {
2843
+ return d.value[_]?.[0];
2237
2844
  }
2238
- async function y() {
2239
- U.value = !0, p.value = {};
2845
+ async function g() {
2846
+ F.value = !0, d.value = {};
2240
2847
  try {
2241
- await A.updateProfile({
2848
+ await V.updateProfile({
2242
2849
  name: w.value.name,
2243
2850
  avatar: x.value?.path ?? null,
2244
2851
  // Blank is left out entirely rather than sent as an empty string: the server reads a
2245
2852
  // filled password as "change it", and an empty one would be a change to nothing.
2246
2853
  ...w.value.password ? { password: w.value.password, current_password: w.value.current_password } : {}
2247
- }), G.success(r("profile.saved")), l(!0);
2248
- } catch (v) {
2249
- const _ = v.body;
2250
- _?.errors ? p.value = _.errors : G.danger(m(v));
2854
+ }), K.success(o("profile.saved")), l(!0);
2855
+ } catch (_) {
2856
+ const k = _.body;
2857
+ k?.errors ? d.value = k.errors : K.danger(h(_));
2251
2858
  } finally {
2252
- U.value = !1;
2859
+ F.value = !1;
2253
2860
  }
2254
2861
  }
2255
- return (v, _) => (h(), $(e(ke), {
2256
- open: e(g),
2257
- "onUpdate:open": _[5] || (_[5] = (P) => ge(g) ? g.value = P : null),
2258
- title: e(r)("profile.title"),
2862
+ return (_, k) => (m(), b(e(be), {
2863
+ open: e(v),
2864
+ "onUpdate:open": k[5] || (k[5] = (B) => Ve(v) ? v.value = B : null),
2865
+ title: e(o)("profile.title"),
2259
2866
  width: 560
2260
2867
  }, {
2261
2868
  footer: t(() => [
2262
2869
  a(e(N), {
2263
- onClick: _[4] || (_[4] = (P) => e(s)())
2870
+ onClick: k[4] || (k[4] = (B) => e(u)())
2264
2871
  }, {
2265
2872
  default: t(() => [
2266
- d(o(e(r)("profile.cancel")), 1)
2873
+ c(i(e(o)("profile.cancel")), 1)
2267
2874
  ]),
2268
2875
  _: 1
2269
2876
  }),
2270
2877
  a(e(N), {
2271
2878
  type: "primary",
2272
- loading: U.value,
2273
- onClick: y
2879
+ loading: F.value,
2880
+ onClick: g
2274
2881
  }, {
2275
2882
  default: t(() => [
2276
- d(o(e(r)("profile.save")), 1)
2883
+ c(i(e(o)("profile.save")), 1)
2277
2884
  ]),
2278
2885
  _: 1
2279
2886
  }, 8, ["loading"])
2280
2887
  ]),
2281
2888
  default: t(() => [
2282
- V("div", Qt, [
2283
- V("div", Xt, [
2284
- u.avatarField ? (h(), Y("div", Zt, [
2285
- (h(), $(Be(u.avatarField), {
2889
+ S("div", ua, [
2890
+ S("div", ra, [
2891
+ r.avatarField ? (m(), H("div", ca, [
2892
+ (m(), b(Ee(r.avatarField), {
2286
2893
  modelValue: x.value,
2287
- "onUpdate:modelValue": _[0] || (_[0] = (P) => x.value = P),
2288
- label: e(r)("profile.avatar"),
2894
+ "onUpdate:modelValue": k[0] || (k[0] = (B) => x.value = B),
2895
+ label: e(o)("profile.avatar"),
2289
2896
  aspect: "1/1",
2290
2897
  captions: !1
2291
2898
  }, null, 8, ["modelValue", "label"]))
2292
- ])) : E("", !0),
2293
- V("div", ea, [
2294
- a(e(K), {
2295
- label: e(r)("profile.name"),
2296
- error: f("name")
2899
+ ])) : I("", !0),
2900
+ S("div", da, [
2901
+ a(e(M), {
2902
+ label: e(o)("profile.name"),
2903
+ error: p("name")
2297
2904
  }, {
2298
2905
  default: t(() => [
2299
2906
  a(e(le), {
2300
2907
  modelValue: w.value.name,
2301
- "onUpdate:modelValue": _[1] || (_[1] = (P) => w.value.name = P),
2908
+ "onUpdate:modelValue": k[1] || (k[1] = (B) => w.value.name = B),
2302
2909
  name: "name"
2303
2910
  }, null, 8, ["modelValue"])
2304
2911
  ]),
2305
2912
  _: 1
2306
2913
  }, 8, ["label", "error"]),
2307
- a(e(K), {
2308
- label: e(r)("admins.email")
2914
+ a(e(M), {
2915
+ label: e(o)("admins.email")
2309
2916
  }, {
2310
2917
  default: t(() => [
2311
2918
  a(e(le), {
2312
- "model-value": e(c).state.user?.email ?? "",
2919
+ "model-value": e(y).state.user?.email ?? "",
2313
2920
  readonly: ""
2314
2921
  }, null, 8, ["model-value"])
2315
2922
  ]),
2316
2923
  _: 1
2317
2924
  }, 8, ["label"]),
2318
- a(e(K), {
2319
- label: e(r)("profile.password"),
2320
- help: e(r)("profile.password-hint"),
2321
- error: f("password")
2925
+ a(e(M), {
2926
+ label: e(o)("profile.password"),
2927
+ help: e(o)("profile.password-hint"),
2928
+ error: p("password")
2322
2929
  }, {
2323
2930
  default: t(() => [
2324
2931
  a(e(le), {
2325
2932
  modelValue: w.value.password,
2326
- "onUpdate:modelValue": _[2] || (_[2] = (P) => w.value.password = P),
2933
+ "onUpdate:modelValue": k[2] || (k[2] = (B) => w.value.password = B),
2327
2934
  type: "password",
2328
2935
  autocomplete: "new-password"
2329
2936
  }, null, 8, ["modelValue"])
2330
2937
  ]),
2331
2938
  _: 1
2332
2939
  }, 8, ["label", "help", "error"]),
2333
- w.value.password ? (h(), $(e(K), {
2940
+ w.value.password ? (m(), b(e(M), {
2334
2941
  key: 0,
2335
- label: e(r)("profile.current-password"),
2336
- help: e(r)("profile.current-password-hint"),
2337
- error: f("current_password")
2942
+ label: e(o)("profile.current-password"),
2943
+ help: e(o)("profile.current-password-hint"),
2944
+ error: p("current_password")
2338
2945
  }, {
2339
2946
  default: t(() => [
2340
2947
  a(e(le), {
2341
2948
  modelValue: w.value.current_password,
2342
- "onUpdate:modelValue": _[3] || (_[3] = (P) => w.value.current_password = P),
2949
+ "onUpdate:modelValue": k[3] || (k[3] = (B) => w.value.current_password = B),
2343
2950
  type: "password",
2344
2951
  autocomplete: "current-password"
2345
2952
  }, null, 8, ["modelValue"])
2346
2953
  ]),
2347
2954
  _: 1
2348
- }, 8, ["label", "help", "error"])) : E("", !0)
2955
+ }, 8, ["label", "help", "error"])) : I("", !0)
2349
2956
  ])
2350
2957
  ])
2351
2958
  ])
@@ -2353,7 +2960,7 @@ const Qt = { class: "wx-profile-host" }, Xt = { class: "wx-profile" }, Zt = {
2353
2960
  _: 1
2354
2961
  }, 8, ["open", "title"]));
2355
2962
  }
2356
- }), aa = /* @__PURE__ */ ve(ta, [["__scopeId", "data-v-9583a67a"]]), la = ["title"], na = { class: "wx-user-menu__who" }, sa = { class: "wx-user-menu__name" }, oa = { class: "wx-user-menu__email" }, ia = /* @__PURE__ */ Q({
2963
+ }), va = /* @__PURE__ */ ve(ma, [["__scopeId", "data-v-9583a67a"]]), pa = ["title"], fa = { class: "wx-user-menu__who" }, ya = { class: "wx-user-menu__name" }, ha = { class: "wx-user-menu__email" }, _a = /* @__PURE__ */ Q({
2357
2964
  __name: "UserMenu",
2358
2965
  props: {
2359
2966
  signOutLabel: { default: void 0 },
@@ -2361,248 +2968,250 @@ const Qt = { class: "wx-profile-host" }, Xt = { class: "wx-profile" }, Zt = {
2361
2968
  avatarField: { default: void 0 },
2362
2969
  expanded: { type: Boolean, default: !1 }
2363
2970
  },
2364
- setup(n) {
2365
- const u = n, l = Z(), s = ze(), g = Ee(), c = nt(), A = j("webx-auth"), r = g.scope("webx-admin"), m = T(() => l.state.user), U = T(
2366
- () => g.state.panelLocales.length > 1 ? g.state.panelLocales : []
2367
- ), p = ye(qe, null), w = ye(He, null), x = z(void 0);
2368
- ce(
2369
- () => typeof m.value?.avatar == "string" ? m.value.avatar : null,
2370
- async (F) => {
2371
- const i = u.resolveAvatar ?? p;
2372
- if (F === null || F === "" || i === null) {
2971
+ setup(s) {
2972
+ const r = s, l = X(), u = We(), v = Ne(), y = ut(), V = G("webx-auth"), o = v.scope("webx-admin"), h = T(() => l.state.user), F = T(
2973
+ () => v.state.panelLocales.length > 1 ? v.state.panelLocales : []
2974
+ ), d = xe(je, null), w = xe(Ge, null), x = A(void 0);
2975
+ de(
2976
+ () => typeof h.value?.avatar == "string" ? h.value.avatar : null,
2977
+ async (O) => {
2978
+ const n = r.resolveAvatar ?? d;
2979
+ if (O === null || O === "" || n === null) {
2373
2980
  x.value = void 0;
2374
2981
  return;
2375
2982
  }
2376
- const b = await i(F);
2377
- m.value?.avatar === F && (x.value = b ?? void 0);
2983
+ const $ = await n(O);
2984
+ h.value?.avatar === O && (x.value = $ ?? void 0);
2378
2985
  },
2379
2986
  { immediate: !0 }
2380
2987
  );
2381
- const f = Ve(aa);
2382
- function y() {
2988
+ const p = he(va);
2989
+ function g() {
2383
2990
  setTimeout(
2384
2991
  () => {
2385
- f({ avatarField: u.avatarField ?? w ?? void 0 });
2992
+ p({ avatarField: r.avatarField ?? w ?? void 0 });
2386
2993
  },
2387
2994
  0
2388
2995
  );
2389
2996
  }
2390
- const v = T({
2391
- get: () => c.state.preference,
2392
- set: (F) => {
2393
- c.set(F), s.setTheme(F);
2997
+ const _ = T({
2998
+ get: () => y.state.preference,
2999
+ set: (O) => {
3000
+ y.set(O), u.setTheme(O);
2394
3001
  }
2395
- }), _ = T(
2396
- () => typeof m.value?.siteBar == "boolean" ? m.value.siteBar : null
3002
+ }), k = T(
3003
+ () => typeof h.value?.siteBar == "boolean" ? h.value.siteBar : null
2397
3004
  );
2398
- function P() {
2399
- _.value !== null && s.setSiteBar(!_.value);
3005
+ function B() {
3006
+ k.value !== null && u.setSiteBar(!k.value);
2400
3007
  }
2401
- async function W(F) {
2402
- F !== g.state.locale && await s.setLocale(F);
3008
+ async function C(O) {
3009
+ O !== v.state.locale && await u.setLocale(O);
2403
3010
  }
2404
- return (F, i) => {
2405
- const b = H("wx-avatar"), L = H("wx-icon"), I = H("wx-text"), D = H("wx-dropdown-item"), q = H("wx-divider"), k = H("wx-dropdown");
2406
- return m.value !== null ? (h(), $(k, { key: 0 }, {
3011
+ return (O, n) => {
3012
+ const $ = J("wx-avatar"), R = J("wx-icon"), Y = J("wx-text"), U = J("wx-dropdown-item"), z = J("wx-divider"), f = J("wx-dropdown");
3013
+ return h.value !== null ? (m(), b(f, { key: 0 }, {
2407
3014
  trigger: t(() => [
2408
- V("button", {
3015
+ S("button", {
2409
3016
  type: "button",
2410
- class: Re(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": n.expanded }]),
2411
- title: m.value.name
3017
+ class: Be(["wx-user-menu__trigger", { "wx-user-menu__trigger--named": s.expanded }]),
3018
+ title: h.value.name
2412
3019
  }, [
2413
- a(b, {
2414
- name: m.value.name,
3020
+ a($, {
3021
+ name: h.value.name,
2415
3022
  src: x.value,
2416
3023
  size: "lg"
2417
3024
  }, null, 8, ["name", "src"]),
2418
- n.expanded ? (h(), Y(ie, { key: 0 }, [
2419
- V("span", na, [
2420
- V("span", sa, o(m.value.name), 1),
2421
- V("span", oa, o(m.value.email), 1)
3025
+ s.expanded ? (m(), H(ue, { key: 0 }, [
3026
+ S("span", fa, [
3027
+ S("span", ya, i(h.value.name), 1),
3028
+ S("span", ha, i(h.value.email), 1)
2422
3029
  ]),
2423
- a(L, {
3030
+ a(R, {
2424
3031
  name: "chevron-up",
2425
3032
  size: "sm",
2426
3033
  class: "wx-user-menu__chevron"
2427
3034
  })
2428
- ], 64)) : E("", !0)
2429
- ], 10, la)
3035
+ ], 64)) : I("", !0)
3036
+ ], 10, pa)
2430
3037
  ]),
2431
3038
  default: t(() => [
2432
- a(D, { disabled: "" }, {
3039
+ a(U, { disabled: "" }, {
2433
3040
  default: t(() => [
2434
- a(I, { size: "sm" }, {
3041
+ a(Y, { size: "sm" }, {
2435
3042
  default: t(() => [
2436
- d(o(m.value.email), 1)
3043
+ c(i(h.value.email), 1)
2437
3044
  ]),
2438
3045
  _: 1
2439
3046
  })
2440
3047
  ]),
2441
3048
  _: 1
2442
3049
  }),
2443
- a(q, { spacing: "sm" }),
2444
- a(D, {
3050
+ a(z, { spacing: "sm" }),
3051
+ a(U, {
2445
3052
  icon: "user",
2446
- onClick: y
3053
+ onClick: g
2447
3054
  }, {
2448
3055
  default: t(() => [
2449
- d(o(e(A)("profile.menu")), 1)
3056
+ c(i(e(V)("profile.menu")), 1)
2450
3057
  ]),
2451
3058
  _: 1
2452
3059
  }),
2453
- a(q, { spacing: "sm" }),
2454
- a(D, { disabled: "" }, {
3060
+ a(z, { spacing: "sm" }),
3061
+ a(U, { disabled: "" }, {
2455
3062
  default: t(() => [
2456
- a(I, {
3063
+ a(Y, {
2457
3064
  size: "sm",
2458
3065
  tone: "muted"
2459
3066
  }, {
2460
3067
  default: t(() => [
2461
- d(o(e(r)("theme.label")), 1)
3068
+ c(i(e(o)("theme.label")), 1)
2462
3069
  ]),
2463
3070
  _: 1
2464
3071
  })
2465
3072
  ]),
2466
3073
  _: 1
2467
3074
  }),
2468
- V("div", {
3075
+ S("div", {
2469
3076
  class: "wx-user-menu__theme",
2470
- onClick: i[1] || (i[1] = Fe(() => {
3077
+ onClick: n[1] || (n[1] = Oe(() => {
2471
3078
  }, ["stop"]))
2472
3079
  }, [
2473
- a(e(dt), {
2474
- modelValue: v.value,
2475
- "onUpdate:modelValue": i[0] || (i[0] = (R) => v.value = R),
3080
+ a(e(ft), {
3081
+ modelValue: _.value,
3082
+ "onUpdate:modelValue": n[0] || (n[0] = (L) => _.value = L),
2476
3083
  size: "sm",
2477
3084
  block: "",
2478
- "aria-label": e(r)("theme.label"),
2479
- "light-label": e(r)("theme.light"),
2480
- "dark-label": e(r)("theme.dark"),
2481
- "system-label": e(r)("theme.system")
3085
+ "aria-label": e(o)("theme.label"),
3086
+ "light-label": e(o)("theme.light"),
3087
+ "dark-label": e(o)("theme.dark"),
3088
+ "system-label": e(o)("theme.system")
2482
3089
  }, null, 8, ["modelValue", "aria-label", "light-label", "dark-label", "system-label"])
2483
3090
  ]),
2484
- _.value !== null ? (h(), Y(ie, { key: 0 }, [
2485
- a(q, { spacing: "sm" }),
2486
- a(D, {
2487
- icon: _.value ? "check" : void 0,
2488
- onClick: P
3091
+ k.value !== null ? (m(), H(ue, { key: 0 }, [
3092
+ a(z, { spacing: "sm" }),
3093
+ a(U, {
3094
+ icon: k.value ? "check" : void 0,
3095
+ onClick: B
2489
3096
  }, {
2490
3097
  default: t(() => [
2491
- d(o(e(A)("menu.site-bar")), 1)
3098
+ c(i(e(V)("menu.site-bar")), 1)
2492
3099
  ]),
2493
3100
  _: 1
2494
3101
  }, 8, ["icon"])
2495
- ], 64)) : E("", !0),
2496
- U.value.length > 0 ? (h(), Y(ie, { key: 1 }, [
2497
- a(q, { spacing: "sm" }),
2498
- a(D, { disabled: "" }, {
3102
+ ], 64)) : I("", !0),
3103
+ F.value.length > 0 ? (m(), H(ue, { key: 1 }, [
3104
+ a(z, { spacing: "sm" }),
3105
+ a(U, { disabled: "" }, {
2499
3106
  default: t(() => [
2500
- a(I, {
3107
+ a(Y, {
2501
3108
  size: "sm",
2502
3109
  tone: "muted"
2503
3110
  }, {
2504
3111
  default: t(() => [
2505
- d(o(e(A)("menu.language")), 1)
3112
+ c(i(e(V)("menu.language")), 1)
2506
3113
  ]),
2507
3114
  _: 1
2508
3115
  })
2509
3116
  ]),
2510
3117
  _: 1
2511
3118
  }),
2512
- (h(!0), Y(ie, null, _e(U.value, (R) => (h(), $(D, {
2513
- key: R.code,
2514
- icon: R.code === e(g).state.locale ? "check" : void 0,
2515
- onClick: (C) => W(R.code)
3119
+ (m(!0), H(ue, null, Ce(F.value, (L) => (m(), b(U, {
3120
+ key: L.code,
3121
+ icon: L.code === e(v).state.locale ? "check" : void 0,
3122
+ onClick: (W) => C(L.code)
2516
3123
  }, {
2517
3124
  default: t(() => [
2518
- d(o(R.nativeName), 1)
3125
+ c(i(L.nativeName), 1)
2519
3126
  ]),
2520
3127
  _: 2
2521
3128
  }, 1032, ["icon", "onClick"]))), 128)),
2522
- a(q, { spacing: "sm" })
2523
- ], 64)) : E("", !0),
2524
- a(D, {
3129
+ a(z, { spacing: "sm" })
3130
+ ], 64)) : I("", !0),
3131
+ a(U, {
2525
3132
  icon: "logout",
2526
- onClick: i[2] || (i[2] = (R) => e(s).logout())
3133
+ onClick: n[2] || (n[2] = (L) => e(u).logout())
2527
3134
  }, {
2528
3135
  default: t(() => [
2529
- d(o(n.signOutLabel ?? e(A)("menu.sign-out")), 1)
3136
+ c(i(s.signOutLabel ?? e(V)("menu.sign-out")), 1)
2530
3137
  ]),
2531
3138
  _: 1
2532
3139
  })
2533
3140
  ]),
2534
3141
  _: 1
2535
- })) : E("", !0);
3142
+ })) : I("", !0);
2536
3143
  };
2537
3144
  }
2538
- }), ya = /* @__PURE__ */ ve(ia, [["__scopeId", "data-v-22dfea95"]]);
2539
- function _a(n = {}) {
2540
- const u = n.path ?? "/login";
3145
+ }), za = /* @__PURE__ */ ve(_a, [["__scopeId", "data-v-22dfea95"]]);
3146
+ function Wa(s = {}) {
3147
+ const r = s.path ?? "/login";
2541
3148
  return {
2542
3149
  install(l) {
2543
- const s = mt(l.context);
2544
- l.i18n.defaults("webx-auth", je), vt(
3150
+ const u = yt(l.context);
3151
+ l.i18n.defaults("webx-auth", Qe), ht(
2545
3152
  l.app,
2546
- s,
2547
- n.resolveAvatar ?? Ye(l.context),
2548
- n.avatarField ?? Ke(l.context)
2549
- ), l.context.useSessionLoader(() => s.me()), l.router.addRoute({
2550
- path: u,
3153
+ u,
3154
+ s.resolveAvatar ?? Je(l.context),
3155
+ s.avatarField ?? Ye(l.context)
3156
+ ), l.context.useSessionLoader(() => u.me()), l.router.addRoute({
3157
+ path: r,
2551
3158
  name: "webx.login",
2552
3159
  meta: { public: !0 },
2553
- component: { render: () => Oe(yt, { ...n.card }) }
2554
- }), l.router.beforeEach((g) => g.meta.public === !0 || l.context.state.status !== "unauthenticated" ? !0 : { path: u, query: g.fullPath === "/" ? {} : { next: g.fullPath } }), ce(
3160
+ component: { render: () => De(kt, { ...s.card }) }
3161
+ }), l.router.beforeEach((v) => v.meta.public === !0 || l.context.state.status !== "unauthenticated" ? !0 : { path: r, query: v.fullPath === "/" ? {} : { next: v.fullPath } }), de(
2555
3162
  () => l.context.state.status,
2556
- (g) => {
2557
- const c = l.router.currentRoute.value;
2558
- if (g === "unauthenticated" && c.path !== u) {
2559
- l.router.replace({ path: u, query: { next: c.fullPath } });
3163
+ (v) => {
3164
+ const y = l.router.currentRoute.value;
3165
+ if (v === "unauthenticated" && y.path !== r) {
3166
+ l.router.replace({ path: r, query: { next: y.fullPath } });
2560
3167
  return;
2561
3168
  }
2562
- if (g === "ready" && c.path === u) {
2563
- const A = c.query.next;
2564
- if (typeof A == "string" && ra(A)) {
2565
- location.assign(A);
3169
+ if (v === "ready" && y.path === r) {
3170
+ const V = y.query.next;
3171
+ if (typeof V == "string" && ba(V)) {
3172
+ location.assign(V);
2566
3173
  return;
2567
3174
  }
2568
- l.router.replace(typeof A == "string" ? A : "/");
3175
+ l.router.replace(typeof V == "string" ? V : "/");
2569
3176
  }
2570
3177
  }
2571
3178
  );
2572
3179
  }
2573
3180
  };
2574
3181
  }
2575
- function ra(n) {
2576
- if (!/^https?:\/\//i.test(n))
3182
+ function ba(s) {
3183
+ if (!/^https?:\/\//i.test(s))
2577
3184
  return !1;
2578
3185
  try {
2579
- return new URL(n).origin === location.origin;
3186
+ return new URL(s).origin === location.origin;
2580
3187
  } catch {
2581
3188
  return !1;
2582
3189
  }
2583
3190
  }
2584
3191
  export {
2585
- Ge as WxAdminList,
2586
- Lt as WxAdminsPage,
2587
- Vt as WxAgentCallList,
2588
- Gt as WxConnectPage,
2589
- Je as WxConnectionList,
2590
- yt as WxLoginCard,
2591
- aa as WxProfileDialog,
2592
- ya as WxUserMenu,
2593
- va as admins,
2594
- _a as auth,
2595
- Ie as authKey,
2596
- je as authMessages,
2597
- He as avatarFieldKey,
2598
- qe as avatarResolverKey,
2599
- pa as connect,
2600
- he as createAdminsApi,
2601
- mt as createAuthSession,
2602
- zt as createConnectionsApi,
2603
- vt as provideAuth,
2604
- fa as selectAdmin,
2605
- ha as selectAdmins,
2606
- ze as useAuth
3192
+ Xe as WxAdminList,
3193
+ Dt as WxAdminsPage,
3194
+ Lt as WxAgentCallList,
3195
+ oa as WxConnectPage,
3196
+ Ze as WxConnectionList,
3197
+ It as WxKeyList,
3198
+ kt as WxLoginCard,
3199
+ va as WxProfileDialog,
3200
+ za as WxUserMenu,
3201
+ Ca as admins,
3202
+ Wa as auth,
3203
+ He as authKey,
3204
+ Qe as authMessages,
3205
+ Ge as avatarFieldKey,
3206
+ je as avatarResolverKey,
3207
+ $a as connect,
3208
+ pe as createAdminsApi,
3209
+ yt as createAuthSession,
3210
+ Tt as createConnectionsApi,
3211
+ tt as createKeysApi,
3212
+ ht as provideAuth,
3213
+ Va as selectAdmin,
3214
+ Aa as selectAdmins,
3215
+ We as useAuth
2607
3216
  };
2608
3217
  //# sourceMappingURL=index.js.map