@synopackageland/sdk 0.9.1 → 0.9.2

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.
Files changed (51) hide show
  1. package/README.md +1 -1
  2. package/dist/i18n/authorization/de.json +6 -1
  3. package/dist/i18n/authorization/en.json +6 -1
  4. package/dist/i18n/authorization/es.json +6 -1
  5. package/dist/i18n/authorization/fr.json +6 -1
  6. package/dist/i18n/authorization/it.json +6 -1
  7. package/dist/i18n/authorization/ja.json +6 -1
  8. package/dist/i18n/authorization/ko.json +6 -1
  9. package/dist/i18n/authorization/zh-CN.json +6 -1
  10. package/dist/i18n/authorization/zh-TW.json +6 -1
  11. package/dist/i18n/delegate/de.json +1 -0
  12. package/dist/i18n/delegate/en.json +1 -0
  13. package/dist/i18n/delegate/es.json +1 -0
  14. package/dist/i18n/delegate/fr.json +1 -0
  15. package/dist/i18n/delegate/it.json +1 -0
  16. package/dist/i18n/delegate/ja.json +1 -0
  17. package/dist/i18n/delegate/ko.json +1 -0
  18. package/dist/i18n/delegate/zh-CN.json +1 -0
  19. package/dist/i18n/delegate/zh-TW.json +1 -0
  20. package/dist/i18n/files/de.json +5 -2
  21. package/dist/i18n/files/en.json +5 -2
  22. package/dist/i18n/files/es.json +5 -2
  23. package/dist/i18n/files/fr.json +5 -2
  24. package/dist/i18n/files/it.json +5 -2
  25. package/dist/i18n/files/ja.json +5 -2
  26. package/dist/i18n/files/ko.json +5 -2
  27. package/dist/i18n/files/zh-CN.json +5 -2
  28. package/dist/i18n/files/zh-TW.json +5 -2
  29. package/dist/i18n/save/de.json +2 -0
  30. package/dist/i18n/save/en.json +2 -0
  31. package/dist/i18n/save/es.json +2 -0
  32. package/dist/i18n/save/fr.json +2 -0
  33. package/dist/i18n/save/it.json +2 -0
  34. package/dist/i18n/save/ja.json +2 -0
  35. package/dist/i18n/save/ko.json +2 -0
  36. package/dist/i18n/save/zh-CN.json +2 -0
  37. package/dist/i18n/save/zh-TW.json +2 -0
  38. package/dist/index.js +2033 -1934
  39. package/dist/src/authorization/AuthorizationGate.vue.d.ts +2 -2
  40. package/dist/src/authorization/AuthorizationSettings.vue.d.ts +3 -0
  41. package/dist/src/authorization/use-authorization.d.ts +20 -0
  42. package/dist/src/delegate/copy.d.ts +2 -0
  43. package/dist/src/delegate/save-copy.d.ts +6 -0
  44. package/dist/src/files/FolderIcon.vue.d.ts +8 -0
  45. package/dist/src/files/size.d.ts +2 -0
  46. package/dist/src/nas/locale.d.ts +3 -0
  47. package/dist/src/vue.d.ts +2 -0
  48. package/dist/style.css +1 -1
  49. package/dist/vue.js +1331 -1223
  50. package/package.json +3 -3
  51. package/spec/protocol/v1/README.md +11 -0
package/dist/vue.js CHANGED
@@ -1,11 +1,11 @@
1
- import { shellCopy as Oe, nasCopy as oe, nasErrorCopy as we, format as ve, saveCopy as Ce, saveError as be, createNasProvider as $e, identityCopy as Re, backgroundCopy as qe, createBackgroundPickerProvider as Le, backgroundErrorCopy as Be, requestKey as _e, delegateCopy as xe, errorCopy as Fe, scopedPicker as Ne, authorizationCopy as Me } from "./index.js";
2
- import { activePage as mt, authorizationCatalogs as bt, backgroundCatalogs as kt, catalogs as _t, createBackgroundSaveFacade as gt, createFileTransfers as ht, decodeResponse as wt, delegateCatalogs as Ct, encodeRequest as $t, identityCatalogs as xt, nasCatalogs as St, protocolCodes as zt, protocolOps as Vt, protocolSchemas as Pt, saveCatalogs as Ut, shellCatalogs as Dt, shellPages as At, uiLocale as Et, uiLocales as Tt } from "./index.js";
3
- import { inject as He, ref as p, onBeforeUnmount as se, defineComponent as ae, computed as N, openBlock as t, createBlock as g, unref as e, withCtx as s, createVNode as b, renderSlot as ke, createElementVNode as _, onMounted as ie, createElementBlock as C, toDisplayString as l, createTextVNode as f, createCommentVNode as m, Fragment as j, renderList as te, watch as Se, withModifiers as ce, onUnmounted as ze, nextTick as Ke, resolveDynamicComponent as Je } from "vue";
4
- import { AppLayout as Xe, PageContent as Ge, PageHeader as Qe, AppSidebar as Ye, Button as z, FilePicker as We, Callout as Q, TreeView as Ze, DataGrid as je, Dialog as Ve, SettingsSection as de, Link as Pe, Form as pe, FormItem as ne, Input as re, FormActions as fe, Select as Ue, Checkbox as ea, Surface as aa } from "@synopackageland/ui";
5
- import { Timer as la, Info as ta, Folder as ge, File as na, TriangleAlert as sa, ShieldCheck as he } from "@lucide/vue";
6
- const ua = /* @__PURE__ */ Symbol("executor-setup");
7
- function ia() {
8
- return He(ua, {
1
+ import { shellCopy as Ge, nasCopy as ve, nasErrorCopy as Ee, format as Ue, uiLocale as Je, saveCopy as Re, saveError as ze, createNasProvider as Te, identityCopy as Xe, backgroundCopy as Qe, createBackgroundPickerProvider as Ye, backgroundErrorCopy as We, requestKey as De, delegateCopy as qe, errorCopy as Ze, scopedPicker as je, authorizationCopy as ea } from "./index.js";
2
+ import { activePage as Tt, authorizationCatalogs as qt, backgroundCatalogs as Ot, catalogs as Bt, createBackgroundSaveFacade as Lt, createFileTransfers as Ft, decodeResponse as Nt, delegateCatalogs as Mt, encodeRequest as Kt, identityCatalogs as Ht, nasCatalogs as Gt, protocolCodes as Jt, protocolOps as Xt, protocolSchemas as Qt, saveCatalogs as Yt, shellCatalogs as Wt, shellPages as Zt, uiLocales as jt } from "./index.js";
3
+ import { inject as Oe, ref as v, onBeforeUnmount as de, defineComponent as se, computed as N, openBlock as t, createBlock as w, unref as e, withCtx as s, createVNode as y, renderSlot as Ve, createElementVNode as h, markRaw as aa, onMounted as fe, createElementBlock as $, createTextVNode as k, toDisplayString as l, createCommentVNode as b, withKeys as Ie, withModifiers as be, watch as Be, Fragment as te, onUnmounted as Le, nextTick as la, renderList as ce, provide as ta } from "vue";
4
+ import { AppLayout as na, PageContent as sa, PageHeader as ia, AppSidebar as oa, IconButton as xe, Breadcrumb as ua, FilePicker as ra, Button as A, Callout as W, TreeView as da, DataGrid as va, Dialog as Pe, SettingsSection as pe, Link as Fe, Form as he, FormItem as re, Input as me, FormActions as _e, Select as Ne, Checkbox as ca, SettingsRow as fa } from "@synopackageland/ui";
5
+ import { Timer as pa, Info as ya, Folder as ma, ChevronLeft as ba, ChevronRight as ka, RotateCw as ha, File as _a, ShieldCheck as ga } from "@lucide/vue";
6
+ const wa = /* @__PURE__ */ Symbol("executor-setup");
7
+ function Ca() {
8
+ return Oe(wa, {
9
9
  async status() {
10
10
  return { state: "blocked", reason: "setup-unavailable" };
11
11
  },
@@ -17,102 +17,102 @@ function ia() {
17
17
  }
18
18
  });
19
19
  }
20
- function nt(y) {
21
- const D = p(!1), a = p(!1), $ = p(), u = p("");
22
- let r = !1, n = 0, i, o;
23
- function h() {
24
- clearTimeout(i), clearTimeout(o);
20
+ function Ct(c) {
21
+ const S = v(!1), a = v(!1), m = v(), i = v("");
22
+ let r = !1, n = 0, o, u;
23
+ function x() {
24
+ clearTimeout(o), clearTimeout(u);
25
25
  }
26
- function v(P = "") {
27
- n++, h(), $.value = void 0, u.value = P;
26
+ function d(T = "") {
27
+ n++, x(), m.value = void 0, i.value = T;
28
28
  }
29
- function w(P) {
29
+ function p(T) {
30
30
  if (r) return;
31
- const q = Date.parse(P.expiresAt) - Date.now();
31
+ const q = Date.parse(T.expiresAt) - Date.now();
32
32
  if (!Number.isFinite(q) || q <= 0) {
33
- v("expired");
33
+ d("expired");
34
34
  return;
35
35
  }
36
- h(), $.value = P, u.value = "", i = setTimeout(() => v("expired"), q);
37
- const Y = n;
38
- o = setTimeout(async () => {
36
+ x(), m.value = T, i.value = "", o = setTimeout(() => d("expired"), q);
37
+ const j = n;
38
+ u = setTimeout(async () => {
39
39
  try {
40
- const X = await y.call("identity.session");
41
- !r && n === Y && w(X);
40
+ const Y = await c.call("identity.session");
41
+ !r && n === j && p(Y);
42
42
  } catch {
43
- !r && n === Y && v("expired");
43
+ !r && n === j && d("expired");
44
44
  }
45
45
  }, Math.min(6e4, q));
46
46
  }
47
- async function U() {
47
+ async function V() {
48
48
  try {
49
- const P = await y.call("identity.status");
49
+ const T = await c.call("identity.status");
50
50
  if (r) return;
51
- if (D.value = P.enabled === !0, D.value)
51
+ if (S.value = T.enabled === !0, S.value)
52
52
  try {
53
- w(await y.call("identity.session", { bootstrap: !0 }));
53
+ p(await c.call("identity.session", { bootstrap: !0 }));
54
54
  } catch {
55
- r || v();
55
+ r || d();
56
56
  }
57
- } catch (P) {
58
- const q = P?.code;
59
- D.value = !["unknown_method", "admin_required", "app_privilege_denied", "session_required"].includes(q || ""), D.value && (u.value = "unavailable");
57
+ } catch (T) {
58
+ const q = T?.code;
59
+ S.value = !["unknown_method", "admin_required", "app_privilege_denied", "session_required"].includes(q || ""), S.value && (i.value = "unavailable");
60
60
  } finally {
61
61
  r || (a.value = !0);
62
62
  }
63
63
  }
64
- async function c(P, q) {
65
- const Y = n;
64
+ async function C(T, q) {
65
+ const j = n;
66
66
  try {
67
- const X = await y.call(P, q);
68
- if (r || D.value && Y !== n) throw { code: "session_required" };
69
- return X;
70
- } catch (X) {
71
- const F = X?.code;
72
- throw !r && Y === n && D.value && ["session_required", "session_revalidation_required"].includes(F || "") && v(F === "session_revalidation_required" ? "revalidate" : "expired"), X;
67
+ const Y = await c.call(T, q);
68
+ if (r || S.value && j !== n) throw { code: "session_required" };
69
+ return Y;
70
+ } catch (Y) {
71
+ const J = Y?.code;
72
+ throw !r && j === n && S.value && ["session_required", "session_revalidation_required"].includes(J || "") && d(J === "session_revalidation_required" ? "revalidate" : "expired"), Y;
73
73
  }
74
74
  }
75
- async function V(P, q, Y) {
76
- const X = await y.call("identity.login", { account: P, password: q, otp: Y });
77
- r || (n++, w(X));
75
+ async function f(T, q, j) {
76
+ const Y = await c.call("identity.login", { account: T, password: q, otp: j });
77
+ r || (n++, p(Y));
78
78
  }
79
- async function S() {
80
- const P = await y.call("identity.session", { bootstrap: !0 });
81
- r || (n++, w(P));
79
+ async function P() {
80
+ const T = await c.call("identity.session", { bootstrap: !0 });
81
+ r || (n++, p(T));
82
82
  }
83
- async function E() {
84
- await y.call("identity.logout"), r || v();
83
+ async function R() {
84
+ await c.call("identity.logout"), r || d();
85
85
  }
86
- function H() {
87
- r = !0, v();
86
+ function K() {
87
+ r = !0, d();
88
88
  }
89
- return { enabled: D, ready: a, subject: $, notice: u, start: U, call: c, login: V, bootstrap: S, logout: E, dispose: H };
89
+ return { enabled: S, ready: a, subject: m, notice: i, start: V, call: C, login: f, bootstrap: P, logout: R, dispose: K };
90
90
  }
91
- function oa() {
92
- const y = p(!1), D = p();
93
- let a = !1, $ = 0, u;
91
+ function $a() {
92
+ const c = v(!1), S = v();
93
+ let a = !1, m = 0, i;
94
94
  function r() {
95
- $++, u?.abort(), u = void 0, y.value = !1, D.value = void 0;
95
+ m++, i?.abort(), i = void 0, c.value = !1, S.value = void 0;
96
96
  }
97
- async function n(i) {
98
- if (a || y.value) return;
99
- const o = ++$, h = new AbortController();
100
- u = h, y.value = !0, D.value = void 0;
97
+ async function n(o) {
98
+ if (a || c.value) return;
99
+ const u = ++m, x = new AbortController();
100
+ i = x, c.value = !0, S.value = void 0;
101
101
  try {
102
- const v = await i(h.signal);
103
- return !a && o === $ ? v : void 0;
104
- } catch (v) {
105
- !a && o === $ && (D.value = v);
102
+ const d = await o(x.signal);
103
+ return !a && u === m ? d : void 0;
104
+ } catch (d) {
105
+ !a && u === m && (S.value = d);
106
106
  return;
107
107
  } finally {
108
- !a && o === $ && (y.value = !1, u = void 0);
108
+ !a && u === m && (c.value = !1, i = void 0);
109
109
  }
110
110
  }
111
- return se(() => {
111
+ return de(() => {
112
112
  a = !0, r();
113
- }), { busy: y, error: D, run: n, cancel: r };
113
+ }), { busy: c, error: S, run: n, cancel: r };
114
114
  }
115
- const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
115
+ const xa = { class: "app-page-content" }, Sa = /* @__PURE__ */ se({
116
116
  __name: "AppShell",
117
117
  props: {
118
118
  locale: {},
@@ -121,36 +121,36 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
121
121
  description: {}
122
122
  },
123
123
  emits: ["update:modelValue"],
124
- setup(y, { emit: D }) {
125
- const a = y, $ = D, u = N(() => Oe(a.locale)), r = { status: ta, background: la }, n = N(() => [{
126
- items: a.pages.map((o) => ({ key: o, label: u.value[o], icon: r[o] }))
127
- }]), i = N(() => u.value[a.modelValue] ?? u.value.status);
128
- return (o, h) => (t(), g(e(Xe), {
124
+ setup(c, { emit: S }) {
125
+ const a = c, m = S, i = N(() => Ge(a.locale)), r = { status: ya, background: pa }, n = N(() => [{
126
+ items: a.pages.map((u) => ({ key: u, label: i.value[u], icon: r[u] }))
127
+ }]), o = N(() => i.value[a.modelValue] ?? i.value.status);
128
+ return (u, x) => (t(), w(e(na), {
129
129
  class: "app-shell",
130
130
  "min-height": "0",
131
131
  "wide-layout": "window"
132
132
  }, {
133
133
  sidebar: s(() => [
134
- b(e(Ye), {
135
- "model-value": y.modelValue,
134
+ y(e(oa), {
135
+ "model-value": c.modelValue,
136
136
  groups: n.value,
137
- "onUpdate:modelValue": h[0] || (h[0] = (v) => $("update:modelValue", v))
137
+ "onUpdate:modelValue": x[0] || (x[0] = (d) => m("update:modelValue", d))
138
138
  }, null, 8, ["model-value", "groups"])
139
139
  ]),
140
140
  default: s(() => [
141
- b(e(Ge), { class: "app-page" }, {
141
+ y(e(sa), { class: "app-page" }, {
142
142
  default: s(() => [
143
- b(e(Qe), {
144
- title: i.value,
145
- description: y.description
143
+ y(e(ia), {
144
+ title: o.value,
145
+ description: c.description
146
146
  }, {
147
147
  actions: s(() => [
148
- ke(o.$slots, "actions", {}, void 0, !0)
148
+ Ve(u.$slots, "actions", {}, void 0, !0)
149
149
  ]),
150
150
  _: 3
151
151
  }, 8, ["title", "description"]),
152
- _("div", ra, [
153
- ke(o.$slots, "default", {}, void 0, !0)
152
+ h("div", xa, [
153
+ Ve(u.$slots, "default", {}, void 0, !0)
154
154
  ])
155
155
  ]),
156
156
  _: 3
@@ -159,28 +159,45 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
159
159
  _: 3
160
160
  }));
161
161
  }
162
- }), ue = (y, D) => {
163
- const a = y.__vccOpts || y;
164
- for (const [$, u] of D)
165
- a[$] = u;
162
+ }), oe = (c, S) => {
163
+ const a = c.__vccOpts || c;
164
+ for (const [m, i] of S)
165
+ a[m] = i;
166
166
  return a;
167
- }, st = /* @__PURE__ */ ue(da, [["__scopeId", "data-v-05f63ca5"]]), va = ["aria-busy", "aria-label"], ca = ["aria-label"], pa = {
167
+ }, $t = /* @__PURE__ */ oe(Sa, [["__scopeId", "data-v-05f63ca5"]]), Se = /* @__PURE__ */ se({
168
+ __name: "FolderIcon",
169
+ props: {
170
+ size: { default: 16 }
171
+ },
172
+ setup(c) {
173
+ return (S, a) => (t(), w(e(ma), {
174
+ size: c.size,
175
+ "aria-hidden": "true",
176
+ "data-folder-icon": "",
177
+ style: { color: "#d9a20b", fill: "#f6c445" }
178
+ }, null, 8, ["size"]));
179
+ }
180
+ }), Ae = ["B", "KB", "MB", "GB", "TB", "PB"];
181
+ function za(c, S) {
182
+ let a = 0, m = c;
183
+ for (; m >= 1024 && a < Ae.length - 1; )
184
+ m /= 1024, a++;
185
+ return `${new Intl.NumberFormat(S, { maximumFractionDigits: a ? 1 : 0 }).format(m)} ${Ae[a]}`;
186
+ }
187
+ const Va = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-location" }, Ua = ["aria-label"], Da = {
168
188
  key: 0,
169
189
  class: "file-toolbar"
170
- }, fa = {
190
+ }, Ia = {
171
191
  key: 1,
172
192
  role: "status"
173
- }, ya = { role: "alert" }, ma = {
193
+ }, Aa = { role: "alert" }, Ea = {
174
194
  key: 4,
175
195
  role: "status"
176
- }, ba = { class: "file-columns" }, ka = ["aria-label"], _a = { class: "file-content" }, ga = {
177
- key: 1,
178
- class: "file-name"
179
- }, ha = { class: "file-bytes" }, wa = {
196
+ }, Ra = { class: "file-columns" }, Ta = ["aria-label"], qa = { class: "file-content" }, Oa = ["onKeydown"], Ba = { class: "file-empty" }, La = { class: "file-bytes" }, Fa = {
180
197
  key: 5,
181
198
  class: "file-selection",
182
199
  role: "status"
183
- }, Ca = /* @__PURE__ */ ae({
200
+ }, Na = /* @__PURE__ */ se({
184
201
  __name: "FileBrowser",
185
202
  props: {
186
203
  provider: {},
@@ -189,281 +206,311 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
189
206
  transfers: { type: Boolean, default: !1 }
190
207
  },
191
208
  emits: ["selected"],
192
- setup(y, { emit: D }) {
193
- const a = y, $ = D, u = N(() => oe(a.locale)), r = oa(), { busy: n, error: i } = r, o = p([]), h = p([]), v = p([]), w = p(), U = p(), c = p([]), V = p(), S = p({ key: "name", direction: "asc" }), E = p(0), H = p([]), P = p(!1);
209
+ setup(c, { emit: S }) {
210
+ const a = c, m = S, i = N(() => ve(a.locale)), r = $a(), { busy: n, error: o } = r, u = v([]), x = v([]), d = v([]), p = v(), V = v(), C = v([]), f = v(), P = v({ key: "name", direction: "asc" }), R = v(0), K = v([]), T = v(!1);
194
211
  let q = new AbortController();
212
+ async function j() {
213
+ const g = p.value;
214
+ !g || g.isDir || !a.provider.download || await r.run(async (D) => (await a.provider.info(g.path, D), a.provider.download(g.path), !0));
215
+ }
195
216
  async function Y() {
196
- const d = w.value;
197
- !d || d.isDir || !a.provider.download || await r.run(async (k) => (await a.provider.info(d.path, k), a.provider.download(d.path), !0));
217
+ const g = d.value.at(-1)?.path, D = K.value[0];
218
+ if (!g || !D || !a.provider.upload) return;
219
+ T.value = !1, await r.run(async (M) => (await a.provider.upload(g, D, M), !0)) && (K.value = [], await le(d.value), T.value = !0);
220
+ }
221
+ const J = N(() => [
222
+ { key: "name", label: i.value.nameColumn, sortable: !0 },
223
+ { key: "kind", label: i.value.kindColumn },
224
+ { key: "bytes", label: i.value.sizeColumn, align: "right", sortable: !0 }
225
+ ]), L = aa(Se);
226
+ function X(g) {
227
+ return { id: g.path, label: g.name, icon: L, data: g };
198
228
  }
199
- async function X() {
200
- const d = v.value.at(-1)?.path, k = H.value[0];
201
- if (!d || !k || !a.provider.upload) return;
202
- P.value = !1, await r.run(async (G) => (await a.provider.upload(d, k, G), !0)) && (H.value = [], await R(v.value), P.value = !0);
229
+ function H(g) {
230
+ p.value = g, m("selected", g?.path);
203
231
  }
204
- const F = N(() => [
205
- { key: "name", label: u.value.nameColumn, sortable: !0 },
206
- { key: "kind", label: u.value.kindColumn },
207
- { key: "bytes", label: u.value.sizeColumn, align: "right", sortable: !0 },
208
- { key: "selection", label: u.value.selectAction }
209
- ]);
210
- function L(d) {
211
- return { id: d.path, label: d.name, icon: ge, data: d };
232
+ function ee(g) {
233
+ (a.mode === "folder" ? g.isDir : !g.isDir) && H(g);
212
234
  }
213
- function J(d) {
214
- w.value = d, $("selected", d?.path);
235
+ function ae(g) {
236
+ g.isDir ? $e(g) : ee(g);
215
237
  }
216
- function K(d, k, x = []) {
217
- for (const G of d) {
218
- const Z = [...x, G.data];
219
- if (G.id === k) return Z;
220
- const ee = K(G.children ?? [], k, Z);
221
- if (ee) return ee;
238
+ const Q = (g) => u.value.find((D) => D.path === g.path);
239
+ function E(g, D, I = []) {
240
+ for (const M of g) {
241
+ const ne = [...I, M.data];
242
+ if (M.id === D) return ne;
243
+ const ie = E(M.children ?? [], D, ne);
244
+ if (ie) return ie;
222
245
  }
223
246
  }
224
- async function W(d) {
225
- const k = E.value, x = q.signal;
247
+ function B(g, D) {
248
+ for (const I of g) {
249
+ if (I.id === D) return I;
250
+ const M = B(I.children ?? [], D);
251
+ if (M) return M;
252
+ }
253
+ }
254
+ function _(g, D, I) {
255
+ return g.map((M) => M.id === D ? { ...M, children: I } : M.children ? { ...M, children: _(M.children, D, I) } : M);
256
+ }
257
+ let z = 0;
258
+ async function G(g) {
259
+ const D = ++z;
260
+ for (const I of g.slice(0, -1)) {
261
+ const M = B(x.value, I.path);
262
+ if (!M) break;
263
+ if (M.children === void 0) {
264
+ const ne = await Z(M);
265
+ if (D !== z || !ne) return;
266
+ x.value = _(x.value, M.id, ne);
267
+ }
268
+ C.value.includes(M.id) || (C.value = [...C.value, M.id]);
269
+ }
270
+ f.value = g.at(-1)?.path;
271
+ }
272
+ async function Z(g) {
273
+ const D = R.value, I = q.signal;
226
274
  try {
227
- const G = [];
228
- let Z = 0;
229
- for (; Z !== void 0; ) {
230
- const ee = await a.provider.list(d.id, { offset: Z, sortBy: "name", sortDirection: "ASC" }, x);
231
- if (x.aborted || k !== E.value) return;
232
- G.push(...ee.entries.filter((me) => me.isDir).map(L)), Z = ee.nextOffset;
275
+ const M = [];
276
+ let ne = 0;
277
+ for (; ne !== void 0; ) {
278
+ const ie = await a.provider.list(g.id, { offset: ne, sortBy: "name", sortDirection: "ASC" }, I);
279
+ if (I.aborted || D !== R.value) return;
280
+ M.push(...ie.entries.filter((He) => He.isDir).map(X)), ne = ie.nextOffset;
233
281
  }
234
- return G;
235
- } catch (G) {
236
- !x.aborted && k === E.value && (i.value = G, J());
282
+ return M;
283
+ } catch (M) {
284
+ !I.aborted && D === R.value && (o.value = M, H());
237
285
  return;
238
286
  }
239
287
  }
240
- async function R(d, k = !1) {
288
+ async function le(g, D = !1) {
241
289
  if (n.value) return;
242
- J(), o.value = k ? o.value : [], U.value = k ? U.value : void 0;
243
- const x = k ? U.value ?? 0 : 0, G = d.at(-1)?.path;
244
- v.value = d;
245
- const Z = await r.run((ee) => G ? a.provider.list(G, { offset: x, sortBy: S.value.key, sortDirection: S.value.direction === "asc" ? "ASC" : "DESC" }, ee) : a.provider.shares(x, ee));
246
- Z && (o.value = k ? [...o.value, ...Z.entries] : Z.entries, U.value = Z.nextOffset, G || (h.value = o.value.filter((ee) => ee.isDir).map(L)));
290
+ H(), u.value = D ? u.value : [], V.value = D ? V.value : void 0;
291
+ const I = D ? V.value ?? 0 : 0, M = g.at(-1)?.path;
292
+ d.value = g;
293
+ const ne = await r.run((ie) => M ? a.provider.list(M, { offset: I, sortBy: P.value.key, sortDirection: P.value.direction === "asc" ? "ASC" : "DESC" }, ie) : a.provider.shares(I, ie));
294
+ ne && (u.value = D ? [...u.value, ...ne.entries] : ne.entries, V.value = ne.nextOffset, M ? a.mode === "folder" && !D && H(g.at(-1)) : x.value = u.value.filter((ie) => ie.isDir).map(X), D || G(g));
295
+ }
296
+ const ge = N(() => [{ id: "", display: i.value.roots }, ...d.value.map((g) => ({ id: g.path, display: g.name }))]);
297
+ function Ce(g) {
298
+ const D = ge.value.findIndex((I) => I.id === g.id);
299
+ D < d.value.length && ke(d.value.slice(0, D));
300
+ }
301
+ function $e(g) {
302
+ ke([...d.value, g]);
247
303
  }
248
- function O(d) {
249
- R([...v.value, d]);
304
+ const ye = v([[]]), ue = v(0);
305
+ function ke(g) {
306
+ n.value || (g.at(-1)?.path !== d.value.at(-1)?.path && (ye.value = [...ye.value.slice(0, ue.value + 1), g], ue.value++), le(g));
250
307
  }
251
- function T(d) {
252
- S.value = { key: d?.key === "bytes" ? "size" : "name", direction: d?.direction ?? "asc" }, R(v.value);
308
+ function O(g) {
309
+ n.value || (ue.value += g, le(ye.value[ue.value]));
253
310
  }
254
- function M() {
255
- n.value || (E.value++, q.abort(), q = new AbortController(), h.value = [], c.value = [], V.value = void 0, R([]));
311
+ function F(g) {
312
+ P.value = { key: g?.key === "bytes" ? "size" : "name", direction: g?.direction ?? "asc" }, le(d.value);
256
313
  }
257
- return ie(() => {
258
- R([]);
259
- }), se(() => {
260
- E.value++, q.abort();
261
- }), (d, k) => (t(), C("section", {
314
+ function U() {
315
+ n.value || (R.value++, q.abort(), q = new AbortController(), x.value = [], C.value = [], f.value = void 0, ye.value = [[]], ue.value = 0, le([]));
316
+ }
317
+ return fe(() => {
318
+ le([]);
319
+ }), de(() => {
320
+ R.value++, q.abort();
321
+ }), (g, D) => (t(), $("section", {
262
322
  class: "file-browser",
263
323
  "aria-busy": e(n),
264
- "aria-label": u.value.title
324
+ "aria-label": i.value.title
265
325
  }, [
266
- _("p", null, l(u.value.ownPermissions), 1),
267
- _("nav", {
268
- class: "file-toolbar",
269
- "aria-label": u.value.directoryKind
270
- }, [
271
- b(e(z), {
272
- variant: "secondary",
273
- disabled: e(n),
274
- onClick: M
326
+ h("div", Pa, [
327
+ y(e(xe), {
328
+ label: i.value.back,
329
+ size: "sm",
330
+ disabled: e(n) || ue.value === 0,
331
+ onClick: D[0] || (D[0] = (I) => O(-1))
275
332
  }, {
276
333
  default: s(() => [
277
- f(l(u.value.refresh), 1)
334
+ y(e(ba), {
335
+ size: 16,
336
+ "aria-hidden": "true"
337
+ })
278
338
  ]),
279
339
  _: 1
280
- }, 8, ["disabled"]),
281
- v.value.length ? (t(), g(e(z), {
282
- key: 0,
283
- variant: "secondary",
284
- disabled: e(n),
285
- onClick: k[0] || (k[0] = (x) => R(v.value.slice(0, -1)))
340
+ }, 8, ["label", "disabled"]),
341
+ y(e(xe), {
342
+ label: i.value.forward,
343
+ size: "sm",
344
+ disabled: e(n) || ue.value === ye.value.length - 1,
345
+ onClick: D[1] || (D[1] = (I) => O(1))
286
346
  }, {
287
347
  default: s(() => [
288
- f(l(u.value.back), 1)
348
+ y(e(ka), {
349
+ size: 16,
350
+ "aria-hidden": "true"
351
+ })
289
352
  ]),
290
353
  _: 1
291
- }, 8, ["disabled"])) : m("", !0),
292
- b(e(z), {
293
- variant: "secondary",
354
+ }, 8, ["label", "disabled"]),
355
+ y(e(xe), {
356
+ label: i.value.refresh,
357
+ size: "sm",
294
358
  disabled: e(n),
295
- onClick: k[1] || (k[1] = (x) => R([]))
359
+ onClick: U
296
360
  }, {
297
361
  default: s(() => [
298
- f(l(u.value.roots), 1)
362
+ y(e(ha), {
363
+ size: 14,
364
+ "aria-hidden": "true"
365
+ })
299
366
  ]),
300
367
  _: 1
301
- }, 8, ["disabled"]),
302
- (t(!0), C(j, null, te(v.value, (x, G) => (t(), g(e(z), {
303
- key: x.path,
304
- variant: "secondary",
305
- disabled: e(n),
306
- onClick: (Z) => R(v.value.slice(0, G + 1))
307
- }, {
308
- default: s(() => [
309
- f(l(x.name), 1)
310
- ]),
311
- _: 2
312
- }, 1032, ["disabled", "onClick"]))), 128))
313
- ], 8, ca),
314
- y.transfers && y.provider.upload && v.value.length ? (t(), C("div", pa, [
315
- b(e(We), {
316
- modelValue: H.value,
317
- "onUpdate:modelValue": k[2] || (k[2] = (x) => H.value = x),
368
+ }, 8, ["label", "disabled"]),
369
+ h("nav", {
370
+ class: "file-path",
371
+ "aria-label": i.value.location
372
+ }, [
373
+ y(e(ua), {
374
+ items: ge.value,
375
+ "collapsed-label": i.value.fullPath,
376
+ onClickItem: Ce
377
+ }, null, 8, ["items", "collapsed-label"])
378
+ ], 8, Ua)
379
+ ]),
380
+ c.transfers && c.provider.upload && d.value.length ? (t(), $("div", Da, [
381
+ y(e(ra), {
382
+ modelValue: K.value,
383
+ "onUpdate:modelValue": D[2] || (D[2] = (I) => K.value = I),
318
384
  variant: "compact",
319
385
  disabled: e(n),
320
386
  "max-files": 1,
321
387
  "max-size": 16 * 1024 ** 3,
322
- title: u.value.upload,
323
- onRejected: k[3] || (k[3] = (x) => i.value = { code: "upload_size_required" })
388
+ title: i.value.upload,
389
+ onRejected: D[3] || (D[3] = (I) => o.value = { code: "upload_size_required" })
324
390
  }, null, 8, ["modelValue", "disabled", "title"]),
325
- b(e(z), {
391
+ y(e(A), {
326
392
  variant: "primary",
327
- disabled: e(n) || !H.value.length,
328
- onClick: X
393
+ disabled: e(n) || !K.value.length,
394
+ onClick: Y
329
395
  }, {
330
396
  default: s(() => [
331
- f(l(u.value.upload), 1)
397
+ k(l(i.value.upload), 1)
332
398
  ]),
333
399
  _: 1
334
400
  }, 8, ["disabled"])
335
- ])) : m("", !0),
336
- P.value ? (t(), C("p", fa, l(u.value.uploaded), 1)) : m("", !0),
337
- y.transfers && y.provider.download && w.value && !w.value.isDir && !e(i) ? (t(), g(e(z), {
401
+ ])) : b("", !0),
402
+ T.value ? (t(), $("p", Ia, l(i.value.uploaded), 1)) : b("", !0),
403
+ c.transfers && c.provider.download && p.value && !p.value.isDir && !e(o) ? (t(), w(e(A), {
338
404
  key: 2,
339
405
  variant: "secondary",
340
406
  disabled: e(n),
341
- onClick: Y
407
+ onClick: j
342
408
  }, {
343
409
  default: s(() => [
344
- f(l(u.value.download), 1)
410
+ k(l(i.value.download), 1)
345
411
  ]),
346
412
  _: 1
347
- }, 8, ["disabled"])) : m("", !0),
348
- e(i) ? (t(), g(e(Q), {
413
+ }, 8, ["disabled"])) : b("", !0),
414
+ e(o) ? (t(), w(e(W), {
349
415
  key: 3,
350
416
  tone: "danger"
351
417
  }, {
352
418
  default: s(() => [
353
- _("span", ya, l(e(we)(e(i), u.value)), 1)
419
+ h("span", Aa, l(e(Ee)(e(o), i.value)), 1)
354
420
  ]),
355
421
  _: 1
356
- })) : m("", !0),
357
- e(n) ? (t(), C("p", ma, l(u.value.loading), 1)) : m("", !0),
358
- _("div", ba, [
359
- _("aside", {
422
+ })) : b("", !0),
423
+ e(n) ? (t(), $("p", Ea, l(i.value.loading), 1)) : b("", !0),
424
+ h("div", Ra, [
425
+ h("aside", {
360
426
  class: "file-tree",
361
- "aria-label": u.value.roots
427
+ "aria-label": i.value.roots
362
428
  }, [
363
- h.value.length ? (t(), g(e(Ze), {
364
- key: E.value,
365
- modelValue: V.value,
366
- "onUpdate:modelValue": k[4] || (k[4] = (x) => V.value = x),
367
- nodes: h.value,
368
- "onUpdate:nodes": k[5] || (k[5] = (x) => h.value = x),
369
- expanded: c.value,
370
- "onUpdate:expanded": k[6] || (k[6] = (x) => c.value = x),
371
- "load-children": W,
372
- "expand-label": (x, G) => e(ve)(G ? u.value.collapse : u.value.expand, x.label),
373
- onSelect: k[7] || (k[7] = (x) => R(K(h.value, x.id) ?? [x.data]))
374
- }, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : m("", !0)
375
- ], 8, ka),
376
- _("div", _a, [
377
- e(i) ? m("", !0) : (t(), g(e(je), {
429
+ x.value.length ? (t(), w(e(da), {
430
+ key: R.value,
431
+ modelValue: f.value,
432
+ "onUpdate:modelValue": D[4] || (D[4] = (I) => f.value = I),
433
+ nodes: x.value,
434
+ "onUpdate:nodes": D[5] || (D[5] = (I) => x.value = I),
435
+ expanded: C.value,
436
+ "onUpdate:expanded": D[6] || (D[6] = (I) => C.value = I),
437
+ "load-children": Z,
438
+ "expand-label": (I, M) => e(Ue)(M ? i.value.collapse : i.value.expand, I.label),
439
+ onSelect: D[7] || (D[7] = (I) => ke(E(x.value, I.id) ?? [I.data]))
440
+ }, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : b("", !0)
441
+ ], 8, Ta),
442
+ h("div", qa, [
443
+ e(o) ? b("", !0) : (t(), w(e(va), {
378
444
  key: 0,
379
- columns: F.value,
380
- rows: o.value.map((x) => ({ ...x, kind: x.isDir ? u.value.directoryKind : u.value.fileKind })),
445
+ columns: J.value,
446
+ rows: u.value.map((I) => ({ ...I, kind: I.isDir ? i.value.directoryKind : i.value.fileKind })),
381
447
  "row-key": "path",
382
448
  footer: !1,
383
449
  resizable: !1,
384
450
  "local-sort": !1,
385
451
  "local-pagination": !1,
386
452
  loading: e(n),
387
- "loading-text": u.value.loading,
388
- sort: { key: S.value.key === "size" ? "bytes" : S.value.key, direction: S.value.direction },
389
- labels: { empty: u.value.emptyFolder },
390
- "onUpdate:sort": T
453
+ "loading-text": i.value.loading,
454
+ sort: { key: P.value.key === "size" ? "bytes" : P.value.key, direction: P.value.direction },
455
+ labels: { empty: i.value.emptyFolder },
456
+ "selected-keys": p.value ? [p.value.path] : [],
457
+ "onUpdate:sort": F,
458
+ onRowClick: D[8] || (D[8] = (I) => {
459
+ e(n) || ee(Q(I));
460
+ }),
461
+ onRowDblclick: D[9] || (D[9] = (I) => {
462
+ e(n) || ae(Q(I));
463
+ })
391
464
  }, {
392
- "cell-name": s(({ row: x }) => [
393
- x.isDir ? (t(), g(e(z), {
394
- key: 0,
395
- variant: "secondary",
396
- disabled: e(n),
397
- "aria-label": e(ve)(u.value.open, String(x.name)),
398
- onClick: (G) => O(o.value.find((Z) => Z.path === x.path))
399
- }, {
400
- default: s(() => [
401
- b(e(ge), {
402
- size: 16,
403
- "aria-hidden": "true"
404
- }),
405
- f(l(x.name), 1)
406
- ]),
407
- _: 2
408
- }, 1032, ["disabled", "aria-label", "onClick"])) : (t(), C("span", ga, [
409
- b(e(na), {
465
+ "cell-name": s(({ row: I }) => [
466
+ h("span", {
467
+ class: "file-name",
468
+ tabindex: "0",
469
+ onKeydown: [
470
+ Ie(be((M) => !e(n) && ae(Q(I)), ["prevent"]), ["enter"]),
471
+ Ie(be((M) => !e(n) && ee(Q(I)), ["prevent"]), ["space"])
472
+ ]
473
+ }, [
474
+ I.isDir ? (t(), w(Se, { key: 0 })) : (t(), w(e(_a), {
475
+ key: 1,
476
+ class: "file-icon",
410
477
  size: 16,
411
478
  "aria-hidden": "true"
412
- }),
413
- f(l(x.name), 1)
414
- ]))
479
+ })),
480
+ k(l(I.name), 1)
481
+ ], 40, Oa)
415
482
  ]),
416
- "cell-bytes": s(({ row: x }) => [
417
- _("span", ha, l(x.isDir ? "—" : x.bytes ?? "—"), 1)
483
+ empty: s(() => [
484
+ h("div", Ba, [
485
+ y(Se, { size: 40 }),
486
+ h("span", null, l(i.value.emptyFolder), 1)
487
+ ])
418
488
  ]),
419
- "cell-selection": s(({ row: x }) => [
420
- (y.mode === "folder" ? x.isDir : !x.isDir) ? (t(), g(e(z), {
421
- key: 0,
422
- variant: "secondary",
423
- disabled: e(n),
424
- "aria-pressed": w.value?.path === x.path,
425
- "aria-label": e(ve)(u.value.select, String(x.name)),
426
- onClick: (G) => J(o.value.find((Z) => Z.path === x.path))
427
- }, {
428
- default: s(() => [
429
- f(l(u.value.selectAction), 1)
430
- ]),
431
- _: 1
432
- }, 8, ["disabled", "aria-pressed", "aria-label", "onClick"])) : m("", !0)
489
+ "cell-bytes": s(({ row: I }) => [
490
+ h("span", La, l(I.isDir || I.bytes === void 0 ? "—" : e(za)(I.bytes, e(Je)(c.locale))), 1)
433
491
  ]),
434
492
  _: 1
435
- }, 8, ["columns", "rows", "loading", "loading-text", "sort", "labels"])),
436
- U.value !== void 0 && !e(i) ? (t(), g(e(z), {
493
+ }, 8, ["columns", "rows", "loading", "loading-text", "sort", "labels", "selected-keys"])),
494
+ V.value !== void 0 && !e(o) ? (t(), w(e(A), {
437
495
  key: 1,
438
496
  variant: "secondary",
439
497
  disabled: e(n),
440
- onClick: k[8] || (k[8] = (x) => R(v.value, !0))
441
- }, {
442
- default: s(() => [
443
- f(l(u.value.loadMore), 1)
444
- ]),
445
- _: 1
446
- }, 8, ["disabled"])) : m("", !0),
447
- y.mode === "folder" && v.value.length && !e(i) ? (t(), g(e(z), {
448
- key: 2,
449
- variant: "secondary",
450
- disabled: e(n),
451
- onClick: k[9] || (k[9] = (x) => J(v.value.at(-1)))
498
+ onClick: D[10] || (D[10] = (I) => le(d.value, !0))
452
499
  }, {
453
500
  default: s(() => [
454
- f(l(e(ve)(u.value.select, v.value.at(-1).name)), 1)
501
+ k(l(i.value.loadMore), 1)
455
502
  ]),
456
503
  _: 1
457
- }, 8, ["disabled"])) : m("", !0)
504
+ }, 8, ["disabled"])) : b("", !0)
458
505
  ])
459
506
  ]),
460
- w.value && !e(i) ? (t(), C("p", wa, l(e(ve)(u.value.selected, w.value.path)), 1)) : m("", !0)
461
- ], 8, va));
507
+ p.value && !e(o) ? (t(), $("p", Fa, l(e(Ue)(i.value.selected, p.value.path)), 1)) : b("", !0)
508
+ ], 8, Va));
462
509
  }
463
- }), De = /* @__PURE__ */ ue(Ca, [["__scopeId", "data-v-f1aee828"]]), $a = {
510
+ }), Me = /* @__PURE__ */ oe(Na, [["__scopeId", "data-v-0b21604d"]]), Ma = {
464
511
  key: 0,
465
512
  class: "save-consent"
466
- }, xa = ["aria-busy", "inert"], Sa = /* @__PURE__ */ ae({
513
+ }, Ka = ["aria-busy", "inert"], Ha = /* @__PURE__ */ se({
467
514
  __name: "NasPicker",
468
515
  props: {
469
516
  open: { type: Boolean },
@@ -475,271 +522,272 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
475
522
  destination: {}
476
523
  },
477
524
  emits: ["update:open", "selected", "authorized"],
478
- setup(y, { emit: D }) {
479
- const a = y, $ = D, u = p(), r = N(() => oe(a.locale)), n = N(() => Ce(a.locale)), i = p(!1), o = p();
480
- let h = 0, v = !1;
481
- Se(() => a.open, () => {
482
- h++, u.value = void 0, o.value = void 0;
483
- }), se(() => {
484
- v = !0, h++;
525
+ setup(c, { emit: S }) {
526
+ const a = c, m = S, i = v(), r = N(() => ve(a.locale)), n = N(() => Re(a.locale)), o = v(!1), u = v();
527
+ let x = 0, d = !1;
528
+ Be(() => a.open, () => {
529
+ x++, i.value = void 0, u.value = void 0;
530
+ }), de(() => {
531
+ d = !0, x++;
485
532
  });
486
- function w() {
487
- i.value || (u.value = void 0, $("update:open", !1));
533
+ function p() {
534
+ o.value || (i.value = void 0, m("update:open", !1));
488
535
  }
489
- async function U() {
490
- const c = u.value, V = a.destination, S = h;
491
- if (!(!c || i.value || !a.open || v || V && a.mode !== "folder")) {
492
- if (!V) {
493
- $("selected", c), w();
536
+ async function V() {
537
+ const C = i.value, f = a.destination, P = x;
538
+ if (!(!C || o.value || !a.open || d || f && a.mode !== "folder")) {
539
+ if (!f) {
540
+ m("selected", C), p();
494
541
  return;
495
542
  }
496
- i.value = !0, o.value = void 0;
543
+ o.value = !0, u.value = void 0;
497
544
  try {
498
- const E = await V.selectDestination({ key: V.key, path: c });
499
- if (v || S !== h) return;
500
- if (!E || typeof E.id != "string" || !E.id || typeof E.username != "string" || !E.username || E.path !== c || E.key !== V.key || E.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
501
- $("authorized", E), i.value = !1, w();
502
- } catch (E) {
503
- !v && S === h && (o.value = E);
545
+ const R = await f.selectDestination({ key: f.key, path: C });
546
+ if (d || P !== x) return;
547
+ if (!R || typeof R.id != "string" || !R.id || typeof R.username != "string" || !R.username || R.path !== C || R.key !== f.key || R.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
548
+ m("authorized", R), o.value = !1, p();
549
+ } catch (R) {
550
+ !d && P === x && (u.value = R);
504
551
  } finally {
505
- v || (i.value = !1);
552
+ d || (o.value = !1);
506
553
  }
507
554
  }
508
555
  }
509
- return (c, V) => (t(), g(e(Ve), {
510
- open: y.open,
511
- title: y.title ?? (y.mode === "folder" ? r.value.choose : r.value.chooseFile),
512
- description: y.description ?? r.value.ownPermissions,
556
+ return (C, f) => (t(), w(e(Pe), {
557
+ open: c.open,
558
+ title: c.title ?? (c.mode === "folder" ? r.value.choose : r.value.chooseFile),
559
+ description: c.description ?? r.value.ownPermissions,
513
560
  "close-label": r.value.close,
514
- "show-close": !i.value,
561
+ "show-close": !o.value,
515
562
  width: "800px",
516
- onEscapeKeyDown: V[1] || (V[1] = (S) => {
517
- i.value && S.preventDefault();
563
+ onEscapeKeyDown: f[1] || (f[1] = (P) => {
564
+ o.value && P.preventDefault();
518
565
  }),
519
- onInteractOutside: V[2] || (V[2] = (S) => {
520
- i.value && S.preventDefault();
566
+ onInteractOutside: f[2] || (f[2] = (P) => {
567
+ o.value && P.preventDefault();
521
568
  }),
522
- "onUpdate:open": V[3] || (V[3] = (S) => {
523
- S || w();
569
+ "onUpdate:open": f[3] || (f[3] = (P) => {
570
+ P || p();
524
571
  })
525
572
  }, {
526
573
  footer: s(() => [
527
- b(e(z), {
574
+ y(e(A), {
528
575
  variant: "secondary",
529
- disabled: i.value,
530
- onClick: w
576
+ disabled: o.value,
577
+ onClick: p
531
578
  }, {
532
579
  default: s(() => [
533
- f(l(r.value.cancel), 1)
580
+ k(l(r.value.cancel), 1)
534
581
  ]),
535
582
  _: 1
536
583
  }, 8, ["disabled"]),
537
- b(e(z), {
584
+ y(e(A), {
538
585
  variant: "primary",
539
- disabled: !u.value || i.value || !!y.destination && y.mode !== "folder",
540
- onClick: U
586
+ disabled: !i.value || o.value || !!c.destination && c.mode !== "folder",
587
+ onClick: V
541
588
  }, {
542
589
  default: s(() => [
543
- f(l(r.value.confirm), 1)
590
+ k(l(r.value.confirm), 1)
544
591
  ]),
545
592
  _: 1
546
593
  }, 8, ["disabled"])
547
594
  ]),
548
595
  default: s(() => [
549
- y.destination ? (t(), C("p", $a, l(n.value.selection), 1)) : m("", !0),
550
- o.value ? (t(), g(e(Q), {
596
+ c.destination ? (t(), $("p", Ma, l(n.value.selection), 1)) : b("", !0),
597
+ u.value ? (t(), w(e(W), {
551
598
  key: 1,
552
599
  tone: "danger",
553
600
  role: "alert",
554
601
  class: "save-message"
555
602
  }, {
556
603
  default: s(() => [
557
- f(l(e(be)(o.value, n.value)), 1)
604
+ k(l(e(ze)(u.value, n.value)), 1)
558
605
  ]),
559
606
  _: 1
560
- })) : m("", !0),
561
- _("div", {
607
+ })) : b("", !0),
608
+ h("div", {
562
609
  class: "nas-picker-content",
563
- "aria-busy": i.value,
564
- inert: i.value
610
+ "aria-busy": o.value,
611
+ inert: o.value
565
612
  }, [
566
- y.open ? (t(), g(De, {
613
+ c.open ? (t(), w(Me, {
567
614
  key: 0,
568
- provider: y.provider,
569
- locale: y.locale,
570
- mode: y.mode,
571
- onSelected: V[0] || (V[0] = (S) => u.value = S)
572
- }, null, 8, ["provider", "locale", "mode"])) : m("", !0)
573
- ], 8, xa)
615
+ provider: c.provider,
616
+ locale: c.locale,
617
+ mode: c.mode,
618
+ onSelected: f[0] || (f[0] = (P) => i.value = P)
619
+ }, null, 8, ["provider", "locale", "mode"])) : b("", !0)
620
+ ], 8, Ka)
574
621
  ]),
575
622
  _: 1
576
623
  }, 8, ["open", "title", "description", "close-label", "show-close"]));
577
624
  }
578
- }), ye = /* @__PURE__ */ ue(Sa, [["__scopeId", "data-v-535a0e54"]]), za = { role: "alert" }, Va = { class: "files-actions" }, Pa = {
625
+ }), we = /* @__PURE__ */ oe(Ha, [["__scopeId", "data-v-535a0e54"]]), Ga = { role: "alert" }, Ja = { class: "files-actions" }, Xa = {
579
626
  key: 0,
580
627
  class: "files-path",
581
628
  role: "status"
582
- }, Ua = /* @__PURE__ */ ae({
629
+ }, Qa = /* @__PURE__ */ se({
583
630
  __name: "FilesPage",
584
631
  props: {
585
632
  ctx: {}
586
633
  },
587
- setup(y) {
588
- const D = y, a = p(), $ = p(!1), u = p("folder"), r = p(!1), n = p(""), i = p(0), o = $e(D.ctx);
589
- let h = !1, v;
590
- async function w() {
591
- if (!h) {
592
- a.value = void 0, $.value = !1, n.value = "", r.value = !1, i.value++;
634
+ setup(c) {
635
+ const S = c, a = v(), m = v(!1), i = v("folder"), r = v(!1), n = v(""), o = v(0), u = Te(S.ctx);
636
+ let x = !1, d;
637
+ async function p() {
638
+ if (!x) {
639
+ a.value = void 0, m.value = !1, n.value = "", r.value = !1, o.value++;
593
640
  try {
594
- await D.ctx.call("nas.session.status"), h || ($.value = !0);
595
- } catch (U) {
596
- !h && U?.code !== "unknown_method" && (a.value = U);
641
+ await S.ctx.call("nas.session.status"), x || (m.value = !0);
642
+ } catch (V) {
643
+ !x && V?.code !== "unknown_method" && (a.value = V);
597
644
  }
598
645
  }
599
646
  }
600
- return ie(() => {
601
- v = D.ctx.reopen(() => {
602
- w();
603
- }), w();
604
- }), se(() => {
605
- h = !0, v?.(), o.dispose();
606
- }), (U, c) => (t(), C(j, null, [
607
- a.value ? (t(), g(e(Q), {
647
+ return fe(() => {
648
+ d = S.ctx.reopen(() => {
649
+ p();
650
+ }), p();
651
+ }), de(() => {
652
+ x = !0, d?.(), u.dispose();
653
+ }), (V, C) => (t(), $(te, null, [
654
+ a.value ? (t(), w(e(W), {
608
655
  key: 0,
609
656
  tone: "danger"
610
657
  }, {
611
658
  default: s(() => [
612
- _("span", za, l(e(we)(a.value, e(oe)(y.ctx.locale))), 1),
613
- b(e(z), {
659
+ h("span", Ga, l(e(Ee)(a.value, e(ve)(c.ctx.locale))), 1),
660
+ y(e(A), {
614
661
  variant: "secondary",
615
- onClick: w
662
+ onClick: p
616
663
  }, {
617
664
  default: s(() => [
618
- f(l(e(oe)(y.ctx.locale).refresh), 1)
665
+ k(l(e(ve)(c.ctx.locale).refresh), 1)
619
666
  ]),
620
667
  _: 1
621
668
  })
622
669
  ]),
623
670
  _: 1
624
- })) : m("", !0),
625
- $.value ? (t(), g(e(de), {
671
+ })) : b("", !0),
672
+ m.value ? (t(), w(e(pe), {
626
673
  key: 1,
627
- title: e(oe)(y.ctx.locale).title,
674
+ title: e(ve)(c.ctx.locale).title,
628
675
  collapsible: !1
629
676
  }, {
630
677
  default: s(() => [
631
- _("div", Va, [
632
- b(e(z), {
678
+ h("p", null, l(e(ve)(c.ctx.locale).ownPermissions), 1),
679
+ h("div", Ja, [
680
+ y(e(A), {
633
681
  variant: "secondary",
634
- onClick: c[0] || (c[0] = (V) => {
635
- u.value = "folder", r.value = !0;
682
+ onClick: C[0] || (C[0] = (f) => {
683
+ i.value = "folder", r.value = !0;
636
684
  })
637
685
  }, {
638
686
  default: s(() => [
639
- f(l(e(oe)(y.ctx.locale).choose), 1)
687
+ k(l(e(ve)(c.ctx.locale).choose), 1)
640
688
  ]),
641
689
  _: 1
642
690
  }),
643
- b(e(z), {
691
+ y(e(A), {
644
692
  variant: "secondary",
645
- onClick: c[1] || (c[1] = (V) => {
646
- u.value = "file", r.value = !0;
693
+ onClick: C[1] || (C[1] = (f) => {
694
+ i.value = "file", r.value = !0;
647
695
  })
648
696
  }, {
649
697
  default: s(() => [
650
- f(l(e(oe)(y.ctx.locale).chooseFile), 1)
698
+ k(l(e(ve)(c.ctx.locale).chooseFile), 1)
651
699
  ]),
652
700
  _: 1
653
701
  })
654
702
  ]),
655
- n.value ? (t(), C("p", Pa, l(n.value), 1)) : m("", !0),
656
- (t(), g(De, {
657
- key: i.value,
658
- provider: e(o),
659
- locale: y.ctx.locale,
703
+ n.value ? (t(), $("p", Xa, l(n.value), 1)) : b("", !0),
704
+ (t(), w(Me, {
705
+ key: o.value,
706
+ provider: e(u),
707
+ locale: c.ctx.locale,
660
708
  transfers: ""
661
709
  }, null, 8, ["provider", "locale"])),
662
- b(ye, {
663
- provider: e(o),
664
- locale: y.ctx.locale,
665
- mode: u.value,
710
+ y(we, {
711
+ provider: e(u),
712
+ locale: c.ctx.locale,
713
+ mode: i.value,
666
714
  open: r.value,
667
- "onUpdate:open": c[2] || (c[2] = (V) => r.value = V),
668
- onSelected: c[3] || (c[3] = (V) => n.value = V)
715
+ "onUpdate:open": C[2] || (C[2] = (f) => r.value = f),
716
+ onSelected: C[3] || (C[3] = (f) => n.value = f)
669
717
  }, null, 8, ["provider", "locale", "mode", "open"])
670
718
  ]),
671
719
  _: 1
672
- }, 8, ["title"])) : m("", !0)
720
+ }, 8, ["title"])) : b("", !0)
673
721
  ], 64));
674
722
  }
675
- }), ut = /* @__PURE__ */ ue(Ua, [["__scopeId", "data-v-97bc5d15"]]), Da = { key: 0 }, Aa = { key: 0 }, Ea = { key: 3 }, Ta = { role: "alert" }, Ia = 5e3, it = /* @__PURE__ */ ae({
723
+ }), xt = /* @__PURE__ */ oe(Qa, [["__scopeId", "data-v-699931fa"]]), Ya = { key: 0 }, Wa = { key: 0 }, Za = { key: 3 }, ja = { role: "alert" }, el = 5e3, St = /* @__PURE__ */ se({
676
724
  __name: "PortalSettings",
677
725
  props: {
678
726
  portal: {}
679
727
  },
680
- setup(y) {
681
- const D = y, a = D.portal.messages, $ = p(), u = p(""), r = p(!1), n = p("");
682
- let i = !1;
683
- function o(w) {
684
- i || ($.value = w, u.value = w.alias || w.defaultAlias);
728
+ setup(c) {
729
+ const S = c, a = S.portal.messages, m = v(), i = v(""), r = v(!1), n = v("");
730
+ let o = !1;
731
+ function u(p) {
732
+ o || (m.value = p, i.value = p.alias || p.defaultAlias);
685
733
  }
686
- const h = /* @__PURE__ */ Symbol("late");
687
- async function v(w) {
734
+ const x = /* @__PURE__ */ Symbol("late");
735
+ async function d(p) {
688
736
  if (r.value) return;
689
737
  r.value = !0, n.value = "";
690
- const U = w();
738
+ const V = p();
691
739
  try {
692
- const c = await Promise.race([U, new Promise((V) => setTimeout(() => V(h), Ia))]);
693
- if (c !== h) {
694
- o(c);
740
+ const C = await Promise.race([V, new Promise((f) => setTimeout(() => f(x), el))]);
741
+ if (C !== x) {
742
+ u(C);
695
743
  return;
696
744
  }
697
- U.then(o, () => {
698
- }), o(await D.portal.status());
699
- } catch (c) {
700
- i || (n.value = a[c?.code || ""] || a.portal_unavailable);
745
+ V.then(u, () => {
746
+ }), u(await S.portal.status());
747
+ } catch (C) {
748
+ o || (n.value = a[C?.code || ""] || a.portal_unavailable);
701
749
  } finally {
702
- i || (r.value = !1);
750
+ o || (r.value = !1);
703
751
  }
704
752
  }
705
- return ie(() => {
706
- D.portal.status().then(o);
707
- }), se(() => {
708
- i = !0;
709
- }), (w, U) => $.value ? (t(), g(e(de), {
753
+ return fe(() => {
754
+ S.portal.status().then(u);
755
+ }), de(() => {
756
+ o = !0;
757
+ }), (p, V) => m.value ? (t(), w(e(pe), {
710
758
  key: 0,
711
759
  title: e(a).title,
712
760
  collapsible: !1,
713
761
  "aria-busy": r.value
714
762
  }, {
715
763
  default: s(() => [
716
- $.value.state === "active" ? (t(), C("p", Da, [
717
- f(l(e(a).link) + " ", 1),
718
- b(e(Pe), {
719
- href: $.value.url,
764
+ m.value.state === "active" ? (t(), $("p", Ya, [
765
+ k(l(e(a).link) + " ", 1),
766
+ y(e(Fe), {
767
+ href: m.value.url,
720
768
  external: ""
721
769
  }, {
722
770
  default: s(() => [
723
- f(l($.value.url), 1)
771
+ k(l(m.value.url), 1)
724
772
  ]),
725
773
  _: 1
726
774
  }, 8, ["href"])
727
- ])) : m("", !0),
728
- $.value.canManage ? (t(), C(j, { key: 1 }, [
729
- $.value.state !== "active" ? (t(), C("p", Aa, l(e(a).inactive), 1)) : m("", !0),
730
- b(e(pe), {
731
- onSubmit: U[2] || (U[2] = ce((c) => v(() => y.portal.apply(u.value)), ["prevent"]))
775
+ ])) : b("", !0),
776
+ m.value.canManage ? (t(), $(te, { key: 1 }, [
777
+ m.value.state !== "active" ? (t(), $("p", Wa, l(e(a).inactive), 1)) : b("", !0),
778
+ y(e(he), {
779
+ onSubmit: V[2] || (V[2] = be((C) => d(() => c.portal.apply(i.value)), ["prevent"]))
732
780
  }, {
733
781
  default: s(() => [
734
- b(e(ne), {
782
+ y(e(re), {
735
783
  label: e(a).alias,
736
784
  "label-for": "portal-alias"
737
785
  }, {
738
786
  default: s(() => [
739
- b(e(re), {
787
+ y(e(me), {
740
788
  id: "portal-alias",
741
- modelValue: u.value,
742
- "onUpdate:modelValue": U[0] || (U[0] = (c) => u.value = c),
789
+ modelValue: i.value,
790
+ "onUpdate:modelValue": V[0] || (V[0] = (C) => i.value = C),
743
791
  maxlength: "64",
744
792
  autocomplete: "off",
745
793
  disabled: r.value
@@ -747,227 +795,227 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
747
795
  ]),
748
796
  _: 1
749
797
  }, 8, ["label"]),
750
- b(e(fe), null, {
798
+ y(e(_e), null, {
751
799
  default: s(() => [
752
- b(e(z), {
800
+ y(e(A), {
753
801
  type: "submit",
754
802
  variant: "primary",
755
803
  disabled: r.value
756
804
  }, {
757
805
  default: s(() => [
758
- f(l(e(a).apply), 1)
806
+ k(l(e(a).apply), 1)
759
807
  ]),
760
808
  _: 1
761
809
  }, 8, ["disabled"]),
762
- $.value.state === "active" ? (t(), g(e(z), {
810
+ m.value.state === "active" ? (t(), w(e(A), {
763
811
  key: 0,
764
812
  variant: "secondary",
765
813
  disabled: r.value,
766
- onClick: U[1] || (U[1] = (c) => v(() => y.portal.disable()))
814
+ onClick: V[1] || (V[1] = (C) => d(() => c.portal.disable()))
767
815
  }, {
768
816
  default: s(() => [
769
- f(l(e(a).disable), 1)
817
+ k(l(e(a).disable), 1)
770
818
  ]),
771
819
  _: 1
772
- }, 8, ["disabled"])) : m("", !0)
820
+ }, 8, ["disabled"])) : b("", !0)
773
821
  ]),
774
822
  _: 1
775
823
  })
776
824
  ]),
777
825
  _: 1
778
826
  }),
779
- b(e(z), {
827
+ y(e(A), {
780
828
  variant: "secondary",
781
- onClick: U[3] || (U[3] = (c) => y.portal.openControlPanel())
829
+ onClick: V[3] || (V[3] = (C) => c.portal.openControlPanel())
782
830
  }, {
783
831
  default: s(() => [
784
- f(l(e(a).advanced), 1)
832
+ k(l(e(a).advanced), 1)
785
833
  ]),
786
834
  _: 1
787
835
  })
788
- ], 64)) : $.value.controlPanel ? (t(), g(e(z), {
836
+ ], 64)) : m.value.controlPanel ? (t(), w(e(A), {
789
837
  key: 2,
790
838
  variant: "secondary",
791
- onClick: U[4] || (U[4] = (c) => y.portal.openControlPanel())
839
+ onClick: V[4] || (V[4] = (C) => c.portal.openControlPanel())
792
840
  }, {
793
841
  default: s(() => [
794
- f(l(e(a).controlPanel), 1)
842
+ k(l(e(a).controlPanel), 1)
795
843
  ]),
796
844
  _: 1
797
- })) : $.value.state !== "active" ? (t(), C("p", Ea, l(e(a).askAdmin), 1)) : m("", !0),
798
- n.value ? (t(), g(e(Q), {
845
+ })) : m.value.state !== "active" ? (t(), $("p", Za, l(e(a).askAdmin), 1)) : b("", !0),
846
+ n.value ? (t(), w(e(W), {
799
847
  key: 4,
800
848
  tone: "danger"
801
849
  }, {
802
850
  default: s(() => [
803
- _("span", Ta, l(n.value), 1)
851
+ h("span", ja, l(n.value), 1)
804
852
  ]),
805
853
  _: 1
806
- })) : m("", !0)
854
+ })) : b("", !0)
807
855
  ]),
808
856
  _: 1
809
- }, 8, ["title", "aria-busy"])) : m("", !0);
857
+ }, 8, ["title", "aria-busy"])) : b("", !0);
810
858
  }
811
- }), Oa = ["aria-busy"], Ra = {
859
+ }), al = ["aria-busy"], ll = {
812
860
  key: 1,
813
861
  role: "status"
814
- }, qa = { role: "alert" }, La = { role: "status" }, Ba = /* @__PURE__ */ ae({
862
+ }, tl = { role: "alert" }, nl = { role: "status" }, sl = /* @__PURE__ */ se({
815
863
  __name: "LoginPage",
816
864
  props: {
817
865
  session: {},
818
866
  locale: {}
819
867
  },
820
- setup(y) {
821
- const D = y, a = N(() => Re(D.locale)), $ = p(""), u = p(""), r = p(""), n = p(!1), i = p(!1), o = p(""), h = p(), v = N(() => window.location.protocol === "https:");
822
- let w = !1;
823
- function U(E) {
824
- const H = E?.code;
825
- return a.value.errors[H || ""] || a.value.errors.failed;
868
+ setup(c) {
869
+ const S = c, a = N(() => Xe(S.locale)), m = v(""), i = v(""), r = v(""), n = v(!1), o = v(!1), u = v(""), x = v(), d = N(() => window.location.protocol === "https:");
870
+ let p = !1;
871
+ function V(R) {
872
+ const K = R?.code;
873
+ return a.value.errors[K || ""] || a.value.errors.failed;
826
874
  }
827
- async function c() {
828
- if (!(i.value || !v.value || !$.value || !u.value || n.value && !r.value)) {
829
- i.value = !0, o.value = "";
875
+ async function C() {
876
+ if (!(o.value || !d.value || !m.value || !i.value || n.value && !r.value)) {
877
+ o.value = !0, u.value = "";
830
878
  try {
831
- await D.session.login($.value, u.value, r.value), u.value = "", r.value = "";
832
- } catch (E) {
833
- if (w) return;
834
- r.value = "", E?.code === "otp_required" ? n.value = !0 : (o.value = U(E), u.value = "", n.value = !1);
879
+ await S.session.login(m.value, i.value, r.value), i.value = "", r.value = "";
880
+ } catch (R) {
881
+ if (p) return;
882
+ r.value = "", R?.code === "otp_required" ? n.value = !0 : (u.value = V(R), i.value = "", n.value = !1);
835
883
  } finally {
836
- w || (i.value = !1, n.value && (await Ke(), w || h.value?.querySelector("input")?.focus()));
884
+ p || (o.value = !1, n.value && (await la(), p || x.value?.querySelector("input")?.focus()));
837
885
  }
838
886
  }
839
887
  }
840
- async function V() {
841
- if (!i.value) {
842
- i.value = !0, o.value = "";
888
+ async function f() {
889
+ if (!o.value) {
890
+ o.value = !0, u.value = "";
843
891
  try {
844
- await D.session.bootstrap();
845
- } catch (E) {
846
- w || (o.value = U(E));
892
+ await S.session.bootstrap();
893
+ } catch (R) {
894
+ p || (u.value = V(R));
847
895
  } finally {
848
- w || (i.value = !1);
896
+ p || (o.value = !1);
849
897
  }
850
898
  }
851
899
  }
852
- function S() {
853
- u.value = "", r.value = "", n.value = !1, o.value = "";
900
+ function P() {
901
+ i.value = "", r.value = "", n.value = !1, u.value = "";
854
902
  }
855
- return ze(() => {
856
- w = !0, u.value = "", r.value = "";
857
- }), (E, H) => (t(), C("main", {
903
+ return Le(() => {
904
+ p = !0, i.value = "", r.value = "";
905
+ }), (R, K) => (t(), $("main", {
858
906
  class: "identity-login",
859
- "aria-busy": i.value
907
+ "aria-busy": o.value
860
908
  }, [
861
- b(e(de), {
909
+ y(e(pe), {
862
910
  title: a.value.title,
863
911
  collapsible: !1
864
912
  }, {
865
913
  default: s(() => [
866
- _("p", null, l(a.value.intro), 1),
867
- v.value ? m("", !0) : (t(), g(e(Q), {
914
+ h("p", null, l(a.value.intro), 1),
915
+ d.value ? b("", !0) : (t(), w(e(W), {
868
916
  key: 0,
869
917
  tone: "warning",
870
918
  title: a.value.httpsTitle
871
919
  }, {
872
920
  default: s(() => [
873
- f(l(a.value.errors.https_required), 1)
921
+ k(l(a.value.errors.https_required), 1)
874
922
  ]),
875
923
  _: 1
876
924
  }, 8, ["title"])),
877
- y.session.notice.value ? (t(), C("p", Ra, l(a.value.notices[y.session.notice.value]), 1)) : m("", !0),
878
- o.value ? (t(), g(e(Q), {
925
+ c.session.notice.value ? (t(), $("p", ll, l(a.value.notices[c.session.notice.value]), 1)) : b("", !0),
926
+ u.value ? (t(), w(e(W), {
879
927
  key: 2,
880
928
  tone: "danger",
881
929
  title: a.value.failedTitle
882
930
  }, {
883
931
  default: s(() => [
884
- _("span", qa, l(o.value), 1)
932
+ h("span", tl, l(u.value), 1)
885
933
  ]),
886
934
  _: 1
887
- }, 8, ["title"])) : m("", !0),
888
- b(e(pe), {
889
- onSubmit: ce(c, ["prevent"])
935
+ }, 8, ["title"])) : b("", !0),
936
+ y(e(he), {
937
+ onSubmit: be(C, ["prevent"])
890
938
  }, {
891
939
  default: s(() => [
892
- b(e(ne), {
940
+ y(e(re), {
893
941
  label: a.value.account
894
942
  }, {
895
943
  default: s(() => [
896
- b(e(re), {
897
- modelValue: $.value,
898
- "onUpdate:modelValue": H[0] || (H[0] = (P) => $.value = P),
944
+ y(e(me), {
945
+ modelValue: m.value,
946
+ "onUpdate:modelValue": K[0] || (K[0] = (T) => m.value = T),
899
947
  autocomplete: "username",
900
- disabled: i.value || n.value || !v.value
948
+ disabled: o.value || n.value || !d.value
901
949
  }, null, 8, ["modelValue", "disabled"])
902
950
  ]),
903
951
  _: 1
904
952
  }, 8, ["label"]),
905
- n.value ? (t(), C(j, { key: 1 }, [
906
- _("p", La, l(a.value.otpPrompt), 1),
907
- _("div", {
953
+ n.value ? (t(), $(te, { key: 1 }, [
954
+ h("p", nl, l(a.value.otpPrompt), 1),
955
+ h("div", {
908
956
  ref_key: "otpField",
909
- ref: h
957
+ ref: x
910
958
  }, [
911
- b(e(ne), {
959
+ y(e(re), {
912
960
  label: a.value.otp
913
961
  }, {
914
962
  default: s(() => [
915
- b(e(re), {
963
+ y(e(me), {
916
964
  modelValue: r.value,
917
- "onUpdate:modelValue": H[2] || (H[2] = (P) => r.value = P),
965
+ "onUpdate:modelValue": K[2] || (K[2] = (T) => r.value = T),
918
966
  inputmode: "numeric",
919
967
  autocomplete: "one-time-code",
920
- disabled: i.value
968
+ disabled: o.value
921
969
  }, null, 8, ["modelValue", "disabled"])
922
970
  ]),
923
971
  _: 1
924
972
  }, 8, ["label"])
925
973
  ], 512)
926
- ], 64)) : (t(), g(e(ne), {
974
+ ], 64)) : (t(), w(e(re), {
927
975
  key: 0,
928
976
  label: a.value.password
929
977
  }, {
930
978
  default: s(() => [
931
- b(e(re), {
932
- modelValue: u.value,
933
- "onUpdate:modelValue": H[1] || (H[1] = (P) => u.value = P),
979
+ y(e(me), {
980
+ modelValue: i.value,
981
+ "onUpdate:modelValue": K[1] || (K[1] = (T) => i.value = T),
934
982
  type: "password",
935
983
  autocomplete: "current-password",
936
- disabled: i.value || !v.value
984
+ disabled: o.value || !d.value
937
985
  }, null, 8, ["modelValue", "disabled"])
938
986
  ]),
939
987
  _: 1
940
988
  }, 8, ["label"])),
941
- b(e(fe), null, {
989
+ y(e(_e), null, {
942
990
  default: s(() => [
943
- b(e(z), {
991
+ y(e(A), {
944
992
  type: "submit",
945
993
  variant: "primary",
946
- disabled: i.value || !v.value || !$.value || !u.value || n.value && !r.value
994
+ disabled: o.value || !d.value || !m.value || !i.value || n.value && !r.value
947
995
  }, {
948
996
  default: s(() => [
949
- f(l(i.value ? a.value.signingIn : n.value ? a.value.verify : a.value.signIn), 1)
997
+ k(l(o.value ? a.value.signingIn : n.value ? a.value.verify : a.value.signIn), 1)
950
998
  ]),
951
999
  _: 1
952
1000
  }, 8, ["disabled"]),
953
- n.value ? (t(), g(e(z), {
1001
+ n.value ? (t(), w(e(A), {
954
1002
  key: 0,
955
1003
  variant: "secondary",
956
- disabled: i.value,
957
- onClick: S
1004
+ disabled: o.value,
1005
+ onClick: P
958
1006
  }, {
959
1007
  default: s(() => [
960
- f(l(a.value.otherAccount), 1)
1008
+ k(l(a.value.otherAccount), 1)
961
1009
  ]),
962
1010
  _: 1
963
- }, 8, ["disabled"])) : (t(), g(e(z), {
1011
+ }, 8, ["disabled"])) : (t(), w(e(A), {
964
1012
  key: 1,
965
1013
  variant: "secondary",
966
- disabled: i.value || !v.value,
967
- onClick: V
1014
+ disabled: o.value || !d.value,
1015
+ onClick: f
968
1016
  }, {
969
1017
  default: s(() => [
970
- f(l(a.value.continueDSM), 1)
1018
+ k(l(a.value.continueDSM), 1)
971
1019
  ]),
972
1020
  _: 1
973
1021
  }, 8, ["disabled"]))
@@ -980,337 +1028,337 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
980
1028
  ]),
981
1029
  _: 1
982
1030
  }, 8, ["title"])
983
- ], 8, Oa));
1031
+ ], 8, al));
984
1032
  }
985
- }), ot = /* @__PURE__ */ ue(Ba, [["__scopeId", "data-v-f7afcf5e"]]), Fa = { class: "integration-help" }, Na = { role: "status" }, Ma = { class: "integration-help" }, Ha = { class: "integration-help" }, Ka = { class: "integration-help" }, Ja = { class: "integration-actions" }, Xa = { class: "integration-actions" }, Ga = {
1033
+ }), zt = /* @__PURE__ */ oe(sl, [["__scopeId", "data-v-f7afcf5e"]]), il = { class: "integration-help" }, ol = { role: "status" }, ul = { class: "integration-help" }, rl = { class: "integration-help" }, dl = { class: "integration-help" }, vl = { class: "integration-actions" }, cl = { class: "integration-actions" }, fl = {
986
1034
  key: 0,
987
1035
  role: "status",
988
1036
  "data-bg-picked": ""
989
- }, Qa = { class: "integration-actions" }, Ya = { key: 1 }, Wa = {
1037
+ }, pl = { class: "integration-actions" }, yl = { key: 1 }, ml = {
990
1038
  key: 2,
991
1039
  class: "integration-jobs"
992
- }, Za = ["data-job-state", "data-job-id"], ja = { class: "nas-folder-name" }, el = {
1040
+ }, bl = ["data-job-state", "data-job-id"], kl = { class: "nas-folder-name" }, hl = {
993
1041
  key: 0,
994
1042
  class: "integration-help"
995
- }, al = {
1043
+ }, _l = {
996
1044
  key: 4,
997
1045
  class: "integration-help"
998
- }, ll = ["aria-label"], tl = { class: "integration-help" }, nl = { key: 1 }, sl = {
1046
+ }, gl = ["aria-label"], wl = { class: "integration-help" }, Cl = { key: 1 }, $l = {
999
1047
  key: 2,
1000
1048
  class: "integration-jobs"
1001
- }, ul = ["data-schedule-id"], il = { class: "nas-folder-name" }, ol = {
1049
+ }, xl = ["data-schedule-id"], Sl = { class: "nas-folder-name" }, zl = {
1002
1050
  key: 0,
1003
1051
  class: "integration-help"
1004
- }, rl = {
1052
+ }, Vl = {
1005
1053
  key: 1,
1006
1054
  class: "integration-help"
1007
- }, dl = { class: "integration-help" }, vl = { class: "integration-actions" }, cl = { class: "integration-actions" }, pl = { class: "integration-actions" }, fl = /* @__PURE__ */ ae({
1055
+ }, Pl = { class: "integration-help" }, Ul = { class: "integration-actions" }, Dl = { class: "integration-actions" }, Il = { class: "integration-actions" }, Al = /* @__PURE__ */ se({
1008
1056
  __name: "BackgroundPanel",
1009
1057
  props: {
1010
1058
  ctx: {}
1011
1059
  },
1012
- setup(y) {
1013
- const D = y, a = N(() => qe(D.ctx.locale)), $ = (I, B) => I.replace(/\{(\w+)\}/g, (A, le) => String(B[le] ?? "")), u = p(), r = p([]), n = p(), i = p(!1), o = p(!1), h = p([]), v = p(), w = p(!1), U = p("3600"), c = p(), V = p(), S = p(), E = p(!1), H = p(!1), P = p(), q = p(""), Y = p(""), X = Le(D.ctx);
1014
- let F, L = !1;
1015
- const J = (I) => !["queued", "running"].includes(I.state);
1016
- async function K(I, B) {
1060
+ setup(c) {
1061
+ const S = c, a = N(() => Qe(S.ctx.locale)), m = (O, F) => O.replace(/\{(\w+)\}/g, (U, g) => String(F[g] ?? "")), i = v(), r = v([]), n = v(), o = v(!1), u = v(!1), x = v([]), d = v(), p = v(!1), V = v("3600"), C = v(), f = v(), P = v(), R = v(!1), K = v(!1), T = v(), q = v(""), j = v(""), Y = Ye(S.ctx);
1062
+ let J, L = !1;
1063
+ const X = (O) => !["queued", "running"].includes(O.state);
1064
+ async function H(O, F) {
1017
1065
  try {
1018
- return await D.ctx.call(I, B);
1019
- } catch (A) {
1066
+ return await S.ctx.call(O, F);
1067
+ } catch (U) {
1020
1068
  if (L) return;
1021
- A?.code === "unsupported" ? (i.value = !0, r.value = [], h.value = [], v.value = void 0, c.value = void 0, V.value = void 0, u.value = void 0, S.value = void 0, P.value = void 0, q.value && URL.revokeObjectURL(q.value), q.value = "") : L || (n.value = A);
1069
+ U?.code === "unsupported" ? (o.value = !0, r.value = [], x.value = [], d.value = void 0, C.value = void 0, f.value = void 0, i.value = void 0, P.value = void 0, T.value = void 0, q.value && URL.revokeObjectURL(q.value), q.value = "") : L || (n.value = U);
1022
1070
  return;
1023
1071
  }
1024
1072
  }
1025
- async function W() {
1026
- if (!(L || E.value)) {
1027
- E.value = !0;
1073
+ async function ee() {
1074
+ if (!(L || R.value)) {
1075
+ R.value = !0;
1028
1076
  try {
1029
- const I = await K("bg.status");
1030
- if (!I || L) return;
1031
- if (!I.limits || typeof I.admin != "boolean") {
1077
+ const O = await H("bg.status");
1078
+ if (!O || L) return;
1079
+ if (!O.limits || typeof O.admin != "boolean") {
1032
1080
  n.value = { code: "unavailable" };
1033
1081
  return;
1034
1082
  }
1035
- i.value = !1, u.value = I;
1036
- const B = await K("bg.jobs.list");
1037
- B && !L && (r.value = B.jobs ?? []);
1038
- const A = await K("bg.schedules.list");
1039
- A && !L && (h.value = A.schedules ?? []), !L && r.value.every(J) && h.value.every((le) => !le.enabled) && F && (clearInterval(F), F = void 0);
1083
+ o.value = !1, i.value = O;
1084
+ const F = await H("bg.jobs.list");
1085
+ F && !L && (r.value = F.jobs ?? []);
1086
+ const U = await H("bg.schedules.list");
1087
+ U && !L && (x.value = U.schedules ?? []), !L && r.value.every(X) && x.value.every((g) => !g.enabled) && J && (clearInterval(J), J = void 0);
1040
1088
  } finally {
1041
- E.value = !1;
1089
+ R.value = !1;
1042
1090
  }
1043
1091
  }
1044
1092
  }
1045
- function R() {
1046
- F || (F = setInterval(() => {
1047
- W();
1093
+ function ae() {
1094
+ J || (J = setInterval(() => {
1095
+ ee();
1048
1096
  }, 3e3));
1049
1097
  }
1050
- async function O(I) {
1051
- if (!o.value) {
1052
- o.value = !0, n.value = void 0;
1098
+ async function Q(O) {
1099
+ if (!u.value) {
1100
+ u.value = !0, n.value = void 0;
1053
1101
  try {
1054
- await I(), await W(), (h.value.some((B) => B.enabled) || r.value.some((B) => !J(B))) && R();
1102
+ await O(), await ee(), (x.value.some((F) => F.enabled) || r.value.some((F) => !X(F))) && ae();
1055
1103
  } finally {
1056
- L || (o.value = !1);
1104
+ L || (u.value = !1);
1057
1105
  }
1058
1106
  }
1059
1107
  }
1060
- const T = () => O(async () => {
1061
- if (!S.value) return;
1062
- await K("bg.jobs.purge", { owner: S.value }) && (S.value = void 0);
1063
- }), M = N(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), d = (I) => {
1064
- v.value = I, w.value = !1, U.value = "3600";
1065
- }, k = () => O(async () => {
1066
- if (!v.value || !w.value) return;
1067
- await K("bg.schedules.create", { key: _e(), jobId: v.value.id, intervalSeconds: Number(U.value), consent: !0 }) && (v.value = void 0);
1068
- }), x = (I) => O(() => K("bg.schedules.disable", { id: I })), G = () => O(async () => {
1069
- if (!c.value) return;
1070
- await K("bg.schedules.delete", { id: c.value.id }) && (c.value = void 0);
1071
- }), Z = () => O(async () => {
1072
- if (!V.value) return;
1073
- await K("bg.schedules.enable", { id: V.value.id, consent: !0 }) && (V.value = void 0);
1074
- }), ee = (I) => {
1075
- const B = new Date(I);
1076
- return Number.isFinite(B.getTime()) ? B.toLocaleString() : a.value.unknownTime;
1077
- }, me = (I) => I.copyRetained && I.state === "succeeded" && !I.scheduleId && I.submitter?.user === u.value?.owner?.user && I.submitter?.uid === u.value?.owner?.uid, Ae = (I) => O(() => K("bg.jobs.cancel", { id: I })), Ee = (I) => {
1078
- const B = I.lastIndexOf("/");
1079
- P.value = { folder: I.slice(0, B), relative: I.slice(B + 1) };
1080
- }, Te = () => O(async () => {
1108
+ const E = () => Q(async () => {
1081
1109
  if (!P.value) return;
1082
- await K("bg.jobs.submit", { key: _e(), ...P.value }) && (P.value = void 0);
1110
+ await H("bg.jobs.purge", { owner: P.value }) && (P.value = void 0);
1111
+ }), B = N(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), _ = (O) => {
1112
+ d.value = O, p.value = !1, V.value = "3600";
1113
+ }, z = () => Q(async () => {
1114
+ if (!d.value || !p.value) return;
1115
+ await H("bg.schedules.create", { key: De(), jobId: d.value.id, intervalSeconds: Number(V.value), consent: !0 }) && (d.value = void 0);
1116
+ }), G = (O) => Q(() => H("bg.schedules.disable", { id: O })), Z = () => Q(async () => {
1117
+ if (!C.value) return;
1118
+ await H("bg.schedules.delete", { id: C.value.id }) && (C.value = void 0);
1119
+ }), le = () => Q(async () => {
1120
+ if (!f.value) return;
1121
+ await H("bg.schedules.enable", { id: f.value.id, consent: !0 }) && (f.value = void 0);
1122
+ }), ge = (O) => {
1123
+ const F = new Date(O);
1124
+ return Number.isFinite(F.getTime()) ? F.toLocaleString() : a.value.unknownTime;
1125
+ }, Ce = (O) => O.copyRetained && O.state === "succeeded" && !O.scheduleId && O.submitter?.user === i.value?.owner?.user && O.submitter?.uid === i.value?.owner?.uid, $e = (O) => Q(() => H("bg.jobs.cancel", { id: O })), ye = (O) => {
1126
+ const F = O.lastIndexOf("/");
1127
+ T.value = { folder: O.slice(0, F), relative: O.slice(F + 1) };
1128
+ }, ue = () => Q(async () => {
1129
+ if (!T.value) return;
1130
+ await H("bg.jobs.submit", { key: De(), ...T.value }) && (T.value = void 0);
1083
1131
  });
1084
- async function Ie(I) {
1085
- const B = await K("bg.jobs.result", { id: I.id });
1086
- !B || L || (q.value && URL.revokeObjectURL(q.value), q.value = URL.createObjectURL(new Blob([JSON.stringify(B.result, null, 2)], { type: "application/json" })), Y.value = `${I.name || I.id}.sha256.json`);
1132
+ async function ke(O) {
1133
+ const F = await H("bg.jobs.result", { id: O.id });
1134
+ !F || L || (q.value && URL.revokeObjectURL(q.value), q.value = URL.createObjectURL(new Blob([JSON.stringify(F.result, null, 2)], { type: "application/json" })), j.value = `${O.name || O.id}.sha256.json`);
1087
1135
  }
1088
- return ie(() => {
1089
- W().then(() => {
1090
- (h.value.some((I) => I.enabled) || r.value.some((I) => !J(I))) && R();
1136
+ return fe(() => {
1137
+ ee().then(() => {
1138
+ (x.value.some((O) => O.enabled) || r.value.some((O) => !X(O))) && ae();
1091
1139
  });
1092
- }), se(() => {
1093
- L = !0, X.dispose(), F && clearInterval(F), q.value && URL.revokeObjectURL(q.value);
1094
- }), (I, B) => (t(), g(e(de), {
1095
- "aria-busy": o.value || E.value,
1140
+ }), de(() => {
1141
+ L = !0, Y.dispose(), J && clearInterval(J), q.value && URL.revokeObjectURL(q.value);
1142
+ }), (O, F) => (t(), w(e(pe), {
1143
+ "aria-busy": u.value || R.value,
1096
1144
  title: a.value.title,
1097
1145
  collapsible: !1,
1098
1146
  "data-background-panel": ""
1099
1147
  }, {
1100
1148
  default: s(() => [
1101
- i.value ? (t(), g(e(Q), {
1149
+ o.value ? (t(), w(e(W), {
1102
1150
  key: 0,
1103
1151
  tone: "warning"
1104
1152
  }, {
1105
1153
  default: s(() => [
1106
- f(l(a.value.unsupported), 1)
1154
+ k(l(a.value.unsupported), 1)
1107
1155
  ]),
1108
1156
  _: 1
1109
- })) : (t(), C(j, { key: 1 }, [
1110
- _("p", Fa, l(a.value.help), 1),
1111
- n.value ? (t(), g(e(Q), {
1157
+ })) : (t(), $(te, { key: 1 }, [
1158
+ h("p", il, l(a.value.help), 1),
1159
+ n.value ? (t(), w(e(W), {
1112
1160
  key: 0,
1113
1161
  tone: "danger",
1114
1162
  role: "alert"
1115
1163
  }, {
1116
1164
  default: s(() => [
1117
- f(l(e(Be)(n.value, a.value)), 1)
1165
+ k(l(e(We)(n.value, a.value)), 1)
1118
1166
  ]),
1119
1167
  _: 1
1120
- })) : m("", !0),
1121
- u.value ? (t(), C(j, { key: 1 }, [
1122
- _("p", Na, l(u.value.worker?.alive ? $(a.value.workerRunning, { user: u.value.worker.username }) : a.value.workerStopped), 1),
1123
- _("p", Ma, l($(a.value.limits, { size: u.value.limits.maxInputBytes / 1024, queue: u.value.limits.maxQueued, seconds: u.value.limits.jobTimeoutSeconds })), 1),
1124
- _("p", Ha, l(u.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
1125
- _("p", Ka, l($(a.value.ownerLimits, { jobs: u.value.limits.maxOwnerPending, size: u.value.limits.maxOwnerBytes / 1024 })), 1),
1126
- _("div", Ja, [
1127
- b(e(z), {
1168
+ })) : b("", !0),
1169
+ i.value ? (t(), $(te, { key: 1 }, [
1170
+ h("p", ol, l(i.value.worker?.alive ? m(a.value.workerRunning, { user: i.value.worker.username }) : a.value.workerStopped), 1),
1171
+ h("p", ul, l(m(a.value.limits, { size: i.value.limits.maxInputBytes / 1024, queue: i.value.limits.maxQueued, seconds: i.value.limits.jobTimeoutSeconds })), 1),
1172
+ h("p", rl, l(i.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
1173
+ h("p", dl, l(m(a.value.ownerLimits, { jobs: i.value.limits.maxOwnerPending, size: i.value.limits.maxOwnerBytes / 1024 })), 1),
1174
+ h("div", vl, [
1175
+ y(e(A), {
1128
1176
  variant: "secondary",
1129
- disabled: o.value,
1130
- onClick: W
1177
+ disabled: u.value,
1178
+ onClick: ee
1131
1179
  }, {
1132
1180
  default: s(() => [
1133
- f(l(a.value.refresh), 1)
1181
+ k(l(a.value.refresh), 1)
1134
1182
  ]),
1135
1183
  _: 1
1136
1184
  }, 8, ["disabled"])
1137
1185
  ]),
1138
- _("template", null, [
1139
- _("div", Xa, [
1140
- b(e(z), {
1186
+ h("template", null, [
1187
+ h("div", cl, [
1188
+ y(e(A), {
1141
1189
  variant: "secondary",
1142
- disabled: o.value,
1143
- onClick: B[0] || (B[0] = (A) => H.value = !0)
1190
+ disabled: u.value,
1191
+ onClick: F[0] || (F[0] = (U) => K.value = !0)
1144
1192
  }, {
1145
1193
  default: s(() => [
1146
- f(l(a.value.chooseFile), 1)
1194
+ k(l(a.value.chooseFile), 1)
1147
1195
  ]),
1148
1196
  _: 1
1149
1197
  }, 8, ["disabled"]),
1150
- b(e(z), {
1198
+ y(e(A), {
1151
1199
  variant: "primary",
1152
- disabled: o.value || !P.value,
1153
- onClick: Te
1200
+ disabled: u.value || !T.value,
1201
+ onClick: ue
1154
1202
  }, {
1155
1203
  default: s(() => [
1156
- f(l(a.value.submit), 1)
1204
+ k(l(a.value.submit), 1)
1157
1205
  ]),
1158
1206
  _: 1
1159
1207
  }, 8, ["disabled"])
1160
1208
  ]),
1161
- P.value ? (t(), C("p", Ga, l($(a.value.chosen, { path: `${P.value.folder}/${P.value.relative}` })), 1)) : m("", !0),
1162
- b(ye, {
1163
- open: H.value,
1164
- "onUpdate:open": B[1] || (B[1] = (A) => H.value = A),
1165
- locale: y.ctx.locale,
1166
- provider: e(X),
1209
+ T.value ? (t(), $("p", fl, l(m(a.value.chosen, { path: `${T.value.folder}/${T.value.relative}` })), 1)) : b("", !0),
1210
+ y(we, {
1211
+ open: K.value,
1212
+ "onUpdate:open": F[1] || (F[1] = (U) => K.value = U),
1213
+ locale: c.ctx.locale,
1214
+ provider: e(Y),
1167
1215
  mode: "file",
1168
1216
  title: a.value.pickerTitle,
1169
1217
  description: a.value.pickerConsent,
1170
- onSelected: Ee
1218
+ onSelected: ye
1171
1219
  }, null, 8, ["open", "locale", "provider", "title", "description"])
1172
1220
  ]),
1173
- S.value && u.value.admin ? (t(), g(e(Q), {
1221
+ P.value && i.value.admin ? (t(), w(e(W), {
1174
1222
  key: 0,
1175
1223
  tone: "warning"
1176
1224
  }, {
1177
1225
  default: s(() => [
1178
- _("p", null, l($(a.value.purgeConfirm, { user: S.value.user, uid: S.value.uid })), 1),
1179
- _("div", Qa, [
1180
- b(e(z), {
1226
+ h("p", null, l(m(a.value.purgeConfirm, { user: P.value.user, uid: P.value.uid })), 1),
1227
+ h("div", pl, [
1228
+ y(e(A), {
1181
1229
  variant: "secondary",
1182
- disabled: o.value,
1183
- onClick: T
1230
+ disabled: u.value,
1231
+ onClick: E
1184
1232
  }, {
1185
1233
  default: s(() => [
1186
- f(l(a.value.confirmPurge), 1)
1234
+ k(l(a.value.confirmPurge), 1)
1187
1235
  ]),
1188
1236
  _: 1
1189
1237
  }, 8, ["disabled"]),
1190
- b(e(z), {
1238
+ y(e(A), {
1191
1239
  variant: "secondary",
1192
- disabled: o.value,
1193
- onClick: B[2] || (B[2] = (A) => S.value = void 0)
1240
+ disabled: u.value,
1241
+ onClick: F[2] || (F[2] = (U) => P.value = void 0)
1194
1242
  }, {
1195
1243
  default: s(() => [
1196
- f(l(a.value.keepJobs), 1)
1244
+ k(l(a.value.keepJobs), 1)
1197
1245
  ]),
1198
1246
  _: 1
1199
1247
  }, 8, ["disabled"])
1200
1248
  ])
1201
1249
  ]),
1202
1250
  _: 1
1203
- })) : m("", !0),
1204
- r.value.length ? (t(), C("ul", Wa, [
1205
- (t(!0), C(j, null, te(r.value, (A) => (t(), C("li", {
1206
- key: A.id,
1207
- "data-job-state": A.state,
1208
- "data-job-id": A.id
1251
+ })) : b("", !0),
1252
+ r.value.length ? (t(), $("ul", ml, [
1253
+ (t(!0), $(te, null, ce(r.value, (U) => (t(), $("li", {
1254
+ key: U.id,
1255
+ "data-job-state": U.state,
1256
+ "data-job-id": U.id
1209
1257
  }, [
1210
- _("span", ja, l(A.name) + " — " + l(a.value[`state_${A.state}`]), 1),
1211
- u.value.admin && A.submitter ? (t(), C("span", el, l($(a.value.owner, { user: A.submitter.user, uid: A.submitter.uid })), 1)) : m("", !0),
1212
- u.value.admin && A.submitter ? (t(), g(e(z), {
1258
+ h("span", kl, l(U.name) + " — " + l(a.value[`state_${U.state}`]), 1),
1259
+ i.value.admin && U.submitter ? (t(), $("span", hl, l(m(a.value.owner, { user: U.submitter.user, uid: U.submitter.uid })), 1)) : b("", !0),
1260
+ i.value.admin && U.submitter ? (t(), w(e(A), {
1213
1261
  key: 1,
1214
1262
  variant: "secondary",
1215
- disabled: o.value,
1216
- onClick: (le) => S.value = A.submitter
1263
+ disabled: u.value,
1264
+ onClick: (g) => P.value = U.submitter
1217
1265
  }, {
1218
1266
  default: s(() => [
1219
- f(l(a.value.purgeOwner), 1)
1267
+ k(l(a.value.purgeOwner), 1)
1220
1268
  ]),
1221
1269
  _: 1
1222
- }, 8, ["disabled", "onClick"])) : m("", !0),
1223
- J(A) ? m("", !0) : (t(), g(e(z), {
1270
+ }, 8, ["disabled", "onClick"])) : b("", !0),
1271
+ X(U) ? b("", !0) : (t(), w(e(A), {
1224
1272
  key: 2,
1225
1273
  variant: "secondary",
1226
- disabled: o.value,
1227
- onClick: (le) => Ae(A.id)
1274
+ disabled: u.value,
1275
+ onClick: (g) => $e(U.id)
1228
1276
  }, {
1229
1277
  default: s(() => [
1230
- f(l(a.value.cancel), 1)
1278
+ k(l(a.value.cancel), 1)
1231
1279
  ]),
1232
1280
  _: 1
1233
1281
  }, 8, ["disabled", "onClick"])),
1234
- me(A) ? (t(), g(e(z), {
1282
+ Ce(U) ? (t(), w(e(A), {
1235
1283
  key: 3,
1236
1284
  variant: "secondary",
1237
- disabled: o.value,
1238
- onClick: (le) => d(A)
1285
+ disabled: u.value,
1286
+ onClick: (g) => _(U)
1239
1287
  }, {
1240
1288
  default: s(() => [
1241
- f(l(a.value.scheduleCopy), 1)
1289
+ k(l(a.value.scheduleCopy), 1)
1242
1290
  ]),
1243
1291
  _: 1
1244
- }, 8, ["disabled", "onClick"])) : m("", !0),
1245
- A.scheduleId ? (t(), C("span", al, l(a.value.scheduledJob), 1)) : m("", !0),
1246
- A.state === "succeeded" ? (t(), g(e(z), {
1292
+ }, 8, ["disabled", "onClick"])) : b("", !0),
1293
+ U.scheduleId ? (t(), $("span", _l, l(a.value.scheduledJob), 1)) : b("", !0),
1294
+ U.state === "succeeded" ? (t(), w(e(A), {
1247
1295
  key: 5,
1248
1296
  variant: "secondary",
1249
- disabled: o.value,
1250
- onClick: (le) => Ie(A)
1297
+ disabled: u.value,
1298
+ onClick: (g) => ke(U)
1251
1299
  }, {
1252
1300
  default: s(() => [
1253
- f(l(a.value.result), 1)
1301
+ k(l(a.value.result), 1)
1254
1302
  ]),
1255
1303
  _: 1
1256
- }, 8, ["disabled", "onClick"])) : m("", !0)
1257
- ], 8, Za))), 128))
1258
- ])) : (t(), C("p", Ya, l(a.value.noJobs), 1)),
1259
- _("section", {
1304
+ }, 8, ["disabled", "onClick"])) : b("", !0)
1305
+ ], 8, bl))), 128))
1306
+ ])) : (t(), $("p", yl, l(a.value.noJobs), 1)),
1307
+ h("section", {
1260
1308
  "data-bg-schedules": "",
1261
1309
  class: "bg-schedules",
1262
1310
  "aria-label": a.value.schedulesTitle
1263
1311
  }, [
1264
- _("h3", null, l(a.value.schedulesTitle), 1),
1265
- _("p", tl, l(a.value.scheduleHelp), 1),
1266
- v.value ? (t(), g(e(pe), {
1312
+ h("h3", null, l(a.value.schedulesTitle), 1),
1313
+ h("p", wl, l(a.value.scheduleHelp), 1),
1314
+ d.value ? (t(), w(e(he), {
1267
1315
  key: 0,
1268
1316
  class: "bg-schedule-form",
1269
- onSubmit: ce(k, ["prevent"])
1317
+ onSubmit: be(z, ["prevent"])
1270
1318
  }, {
1271
1319
  default: s(() => [
1272
- _("p", null, l($(a.value.scheduleSource, { name: v.value.name })), 1),
1273
- b(e(ne), {
1320
+ h("p", null, l(m(a.value.scheduleSource, { name: d.value.name })), 1),
1321
+ y(e(re), {
1274
1322
  label: a.value.interval
1275
1323
  }, {
1276
1324
  default: s(() => [
1277
- b(e(Ue), {
1278
- modelValue: U.value,
1279
- "onUpdate:modelValue": B[3] || (B[3] = (A) => U.value = A),
1325
+ y(e(Ne), {
1326
+ modelValue: V.value,
1327
+ "onUpdate:modelValue": F[3] || (F[3] = (U) => V.value = U),
1280
1328
  "data-schedule-interval": "",
1281
- options: M.value,
1282
- disabled: o.value
1329
+ options: B.value,
1330
+ disabled: u.value
1283
1331
  }, null, 8, ["modelValue", "options", "disabled"])
1284
1332
  ]),
1285
1333
  _: 1
1286
1334
  }, 8, ["label"]),
1287
- b(e(ea), {
1288
- modelValue: w.value,
1289
- "onUpdate:modelValue": B[4] || (B[4] = (A) => w.value = A),
1335
+ y(e(ca), {
1336
+ modelValue: p.value,
1337
+ "onUpdate:modelValue": F[4] || (F[4] = (U) => p.value = U),
1290
1338
  "data-schedule-consent": "",
1291
- disabled: o.value,
1339
+ disabled: u.value,
1292
1340
  label: a.value.scheduleConsent
1293
1341
  }, null, 8, ["modelValue", "disabled", "label"]),
1294
- b(e(fe), null, {
1342
+ y(e(_e), null, {
1295
1343
  default: s(() => [
1296
- b(e(z), {
1344
+ y(e(A), {
1297
1345
  type: "submit",
1298
1346
  variant: "primary",
1299
- disabled: o.value || !w.value
1347
+ disabled: u.value || !p.value
1300
1348
  }, {
1301
1349
  default: s(() => [
1302
- f(l(a.value.createSchedule), 1)
1350
+ k(l(a.value.createSchedule), 1)
1303
1351
  ]),
1304
1352
  _: 1
1305
1353
  }, 8, ["disabled"]),
1306
- b(e(z), {
1354
+ y(e(A), {
1307
1355
  type: "button",
1308
1356
  variant: "secondary",
1309
- disabled: o.value,
1310
- onClick: B[5] || (B[5] = (A) => v.value = void 0)
1357
+ disabled: u.value,
1358
+ onClick: F[5] || (F[5] = (U) => d.value = void 0)
1311
1359
  }, {
1312
1360
  default: s(() => [
1313
- f(l(a.value.cancel), 1)
1361
+ k(l(a.value.cancel), 1)
1314
1362
  ]),
1315
1363
  _: 1
1316
1364
  }, 8, ["disabled"])
@@ -1319,148 +1367,148 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1319
1367
  })
1320
1368
  ]),
1321
1369
  _: 1
1322
- })) : m("", !0),
1323
- h.value.length ? (t(), C("ul", sl, [
1324
- (t(!0), C(j, null, te(h.value, (A) => (t(), C("li", {
1325
- key: A.id,
1326
- "data-schedule-id": A.id
1370
+ })) : b("", !0),
1371
+ x.value.length ? (t(), $("ul", $l, [
1372
+ (t(!0), $(te, null, ce(x.value, (U) => (t(), $("li", {
1373
+ key: U.id,
1374
+ "data-schedule-id": U.id
1327
1375
  }, [
1328
- _("span", il, l(A.name) + " — " + l(A.enabled ? a.value.scheduleOn : a.value.scheduleOff), 1),
1329
- u.value.admin ? (t(), C("span", ol, l($(a.value.owner, { user: A.owner.user, uid: A.owner.uid })), 1)) : m("", !0),
1330
- A.enabled ? (t(), C("span", rl, l($(a.value.nextRun, { time: ee(A.nextAt) })), 1)) : m("", !0),
1331
- _("span", dl, l($(a.value.missedRuns, { count: A.missed })), 1),
1332
- A.reason === "worker-changed" ? (t(), g(e(Q), {
1376
+ h("span", Sl, l(U.name) + " — " + l(U.enabled ? a.value.scheduleOn : a.value.scheduleOff), 1),
1377
+ i.value.admin ? (t(), $("span", zl, l(m(a.value.owner, { user: U.owner.user, uid: U.owner.uid })), 1)) : b("", !0),
1378
+ U.enabled ? (t(), $("span", Vl, l(m(a.value.nextRun, { time: ge(U.nextAt) })), 1)) : b("", !0),
1379
+ h("span", Pl, l(m(a.value.missedRuns, { count: U.missed })), 1),
1380
+ U.reason === "worker-changed" ? (t(), w(e(W), {
1333
1381
  key: 2,
1334
1382
  tone: "warning"
1335
1383
  }, {
1336
1384
  default: s(() => [
1337
- f(l(a.value.revisionChanged), 1)
1385
+ k(l(a.value.revisionChanged), 1)
1338
1386
  ]),
1339
1387
  _: 1
1340
- })) : A.reason === "input-unavailable" ? (t(), g(e(Q), {
1388
+ })) : U.reason === "input-unavailable" ? (t(), w(e(W), {
1341
1389
  key: 3,
1342
1390
  tone: "warning"
1343
1391
  }, {
1344
1392
  default: s(() => [
1345
- f(l(a.value.errors["input-unavailable"]), 1)
1393
+ k(l(a.value.errors["input-unavailable"]), 1)
1346
1394
  ]),
1347
1395
  _: 1
1348
- })) : m("", !0),
1349
- _("div", vl, [
1350
- A.enabled ? (t(), g(e(z), {
1396
+ })) : b("", !0),
1397
+ h("div", Ul, [
1398
+ U.enabled ? (t(), w(e(A), {
1351
1399
  key: 0,
1352
1400
  variant: "secondary",
1353
- disabled: o.value,
1354
- onClick: (le) => x(A.id)
1401
+ disabled: u.value,
1402
+ onClick: (g) => G(U.id)
1355
1403
  }, {
1356
1404
  default: s(() => [
1357
- f(l(a.value.disableSchedule), 1)
1405
+ k(l(a.value.disableSchedule), 1)
1358
1406
  ]),
1359
1407
  _: 1
1360
- }, 8, ["disabled", "onClick"])) : u.value.admin ? (t(), g(e(z), {
1408
+ }, 8, ["disabled", "onClick"])) : i.value.admin ? (t(), w(e(A), {
1361
1409
  key: 1,
1362
1410
  variant: "secondary",
1363
- disabled: o.value,
1364
- onClick: (le) => V.value = A
1411
+ disabled: u.value,
1412
+ onClick: (g) => f.value = U
1365
1413
  }, {
1366
1414
  default: s(() => [
1367
- f(l(a.value.enableSchedule), 1)
1415
+ k(l(a.value.enableSchedule), 1)
1368
1416
  ]),
1369
1417
  _: 1
1370
- }, 8, ["disabled", "onClick"])) : m("", !0),
1371
- b(e(z), {
1418
+ }, 8, ["disabled", "onClick"])) : b("", !0),
1419
+ y(e(A), {
1372
1420
  variant: "secondary",
1373
- disabled: o.value,
1374
- onClick: (le) => c.value = A
1421
+ disabled: u.value,
1422
+ onClick: (g) => C.value = U
1375
1423
  }, {
1376
1424
  default: s(() => [
1377
- f(l(a.value.deleteSchedule), 1)
1425
+ k(l(a.value.deleteSchedule), 1)
1378
1426
  ]),
1379
1427
  _: 1
1380
1428
  }, 8, ["disabled", "onClick"])
1381
1429
  ])
1382
- ], 8, ul))), 128))
1383
- ])) : (t(), C("p", nl, l(a.value.noSchedules), 1)),
1384
- c.value ? (t(), g(e(Q), {
1430
+ ], 8, xl))), 128))
1431
+ ])) : (t(), $("p", Cl, l(a.value.noSchedules), 1)),
1432
+ C.value ? (t(), w(e(W), {
1385
1433
  key: 3,
1386
1434
  tone: "warning"
1387
1435
  }, {
1388
1436
  default: s(() => [
1389
- _("p", null, l($(a.value.deleteScheduleConsent, { name: c.value.name })), 1),
1390
- _("div", cl, [
1391
- b(e(z), {
1437
+ h("p", null, l(m(a.value.deleteScheduleConsent, { name: C.value.name })), 1),
1438
+ h("div", Dl, [
1439
+ y(e(A), {
1392
1440
  variant: "danger",
1393
- disabled: o.value,
1394
- onClick: G
1441
+ disabled: u.value,
1442
+ onClick: Z
1395
1443
  }, {
1396
1444
  default: s(() => [
1397
- f(l(a.value.confirmDeleteSchedule), 1)
1445
+ k(l(a.value.confirmDeleteSchedule), 1)
1398
1446
  ]),
1399
1447
  _: 1
1400
1448
  }, 8, ["disabled"]),
1401
- b(e(z), {
1449
+ y(e(A), {
1402
1450
  variant: "secondary",
1403
- disabled: o.value,
1404
- onClick: B[6] || (B[6] = (A) => c.value = void 0)
1451
+ disabled: u.value,
1452
+ onClick: F[6] || (F[6] = (U) => C.value = void 0)
1405
1453
  }, {
1406
1454
  default: s(() => [
1407
- f(l(a.value.cancel), 1)
1455
+ k(l(a.value.cancel), 1)
1408
1456
  ]),
1409
1457
  _: 1
1410
1458
  }, 8, ["disabled"])
1411
1459
  ])
1412
1460
  ]),
1413
1461
  _: 1
1414
- })) : m("", !0),
1415
- V.value ? (t(), g(e(Q), {
1462
+ })) : b("", !0),
1463
+ f.value ? (t(), w(e(W), {
1416
1464
  key: 4,
1417
1465
  tone: "warning"
1418
1466
  }, {
1419
1467
  default: s(() => [
1420
- _("p", null, l($(a.value.enableScheduleConsent, { name: V.value.name })), 1),
1421
- _("div", pl, [
1422
- b(e(z), {
1468
+ h("p", null, l(m(a.value.enableScheduleConsent, { name: f.value.name })), 1),
1469
+ h("div", Il, [
1470
+ y(e(A), {
1423
1471
  variant: "primary",
1424
- disabled: o.value,
1425
- onClick: Z
1472
+ disabled: u.value,
1473
+ onClick: le
1426
1474
  }, {
1427
1475
  default: s(() => [
1428
- f(l(a.value.confirmEnableSchedule), 1)
1476
+ k(l(a.value.confirmEnableSchedule), 1)
1429
1477
  ]),
1430
1478
  _: 1
1431
1479
  }, 8, ["disabled"]),
1432
- b(e(z), {
1480
+ y(e(A), {
1433
1481
  variant: "secondary",
1434
- disabled: o.value,
1435
- onClick: B[7] || (B[7] = (A) => V.value = void 0)
1482
+ disabled: u.value,
1483
+ onClick: F[7] || (F[7] = (U) => f.value = void 0)
1436
1484
  }, {
1437
1485
  default: s(() => [
1438
- f(l(a.value.cancel), 1)
1486
+ k(l(a.value.cancel), 1)
1439
1487
  ]),
1440
1488
  _: 1
1441
1489
  }, 8, ["disabled"])
1442
1490
  ])
1443
1491
  ]),
1444
1492
  _: 1
1445
- })) : m("", !0)
1446
- ], 8, ll),
1447
- q.value ? (t(), g(e(Pe), {
1493
+ })) : b("", !0)
1494
+ ], 8, gl),
1495
+ q.value ? (t(), w(e(Fe), {
1448
1496
  key: 3,
1449
1497
  href: q.value,
1450
- download: Y.value
1498
+ download: j.value
1451
1499
  }, {
1452
1500
  default: s(() => [
1453
- f(l(a.value.download), 1)
1501
+ k(l(a.value.download), 1)
1454
1502
  ]),
1455
1503
  _: 1
1456
- }, 8, ["href", "download"])) : m("", !0)
1457
- ], 64)) : m("", !0)
1504
+ }, 8, ["href", "download"])) : b("", !0)
1505
+ ], 64)) : b("", !0)
1458
1506
  ], 64))
1459
1507
  ]),
1460
1508
  _: 1
1461
1509
  }, 8, ["aria-busy", "title"]));
1462
1510
  }
1463
- }), rt = /* @__PURE__ */ ue(fl, [["__scopeId", "data-v-7954713f"]]), yl = { role: "status" }, ml = { key: 1 }, bl = { key: 2 }, dt = /* @__PURE__ */ ae({
1511
+ }), Vt = /* @__PURE__ */ oe(Al, [["__scopeId", "data-v-7954713f"]]), El = { role: "status" }, Rl = { key: 1 }, Tl = { key: 2 }, Pt = /* @__PURE__ */ se({
1464
1512
  __name: "ExecutorSettings",
1465
1513
  props: {
1466
1514
  admin: { type: Boolean },
@@ -1468,137 +1516,137 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1468
1516
  ctx: {}
1469
1517
  },
1470
1518
  emits: ["confirmed"],
1471
- setup(y, { emit: D }) {
1472
- const a = y, $ = D, u = ia(), r = N(() => xe(a.locale)), n = p(), i = p(""), o = p(!1), h = p(!1), v = p(), w = p(""), U = p([]), c = N(() => v.value?.scope_mode === "install-selected"), V = N(() => [{ label: r.value.homeScope, value: "home" }, ...U.value]), S = N(() => !c.value || !!w.value && V.value.some((F) => F.value === w.value)), E = N(() => c.value && !v.value?.selection), H = N(() => w.value !== v.value?.selection?.scope);
1473
- let P = !1;
1474
- async function q(F) {
1475
- const L = F ?? await u.status();
1476
- if (P || (n.value = L, !a.ctx)) return;
1477
- const J = await a.ctx.call("delegate.status");
1478
- if (P || (v.value = J, J.scope_mode !== "install-selected")) return;
1479
- const K = [];
1480
- let W = 0;
1481
- for (let R = 0; R < 128; R++) {
1482
- const O = await a.ctx.call("bg.browse", { offset: W });
1483
- if (P) return;
1484
- if (!Array.isArray(O.shares) || !Number.isSafeInteger(O.total) || O.total < 0 || !O.shares.length && W < O.total) throw { code: "EXECUTOR_PROTOCOL" };
1485
- for (const T of O.shares)
1486
- T.isdir && T.path === "/" + T.name && !["home", "homes"].includes(T.name.toLowerCase()) && K.push({ label: T.name, value: "shared:" + T.name });
1487
- if (W += O.shares.length, W >= O.total) break;
1488
- if (R === 127) throw { code: "EXECUTOR_PROTOCOL" };
1519
+ setup(c, { emit: S }) {
1520
+ const a = c, m = S, i = Ca(), r = N(() => qe(a.locale)), n = v(), o = v(""), u = v(!1), x = v(!1), d = v(!1), p = v(), V = v(""), C = v([]), f = N(() => p.value?.scope_mode === "install-selected"), P = N(() => [{ label: r.value.homeScope, value: "home" }, ...C.value]), R = N(() => !f.value || !!V.value && P.value.some((L) => L.value === V.value)), K = N(() => f.value && !p.value?.selection), T = N(() => V.value !== p.value?.selection?.scope);
1521
+ let q = !1;
1522
+ async function j(L) {
1523
+ const X = L ?? await i.status();
1524
+ if (q || (n.value = X, !a.ctx)) return;
1525
+ const H = await a.ctx.call("delegate.status");
1526
+ if (q || (p.value = H, H.scope_mode !== "install-selected")) return;
1527
+ const ee = [];
1528
+ let ae = 0;
1529
+ for (let Q = 0; Q < 128; Q++) {
1530
+ const E = await a.ctx.call("bg.browse", { offset: ae });
1531
+ if (q) return;
1532
+ if (!Array.isArray(E.shares) || !Number.isSafeInteger(E.total) || E.total < 0 || !E.shares.length && ae < E.total) throw { code: "EXECUTOR_PROTOCOL" };
1533
+ for (const B of E.shares)
1534
+ B.isdir && B.path === "/" + B.name && !["home", "homes"].includes(B.name.toLowerCase()) && ee.push({ label: B.name, value: "shared:" + B.name });
1535
+ if (ae += E.shares.length, ae >= E.total) break;
1536
+ if (Q === 127) throw { code: "EXECUTOR_PROTOCOL" };
1489
1537
  }
1490
- U.value = K, w.value = J.selection?.scope ?? J.preselection ?? "";
1538
+ C.value = ee, V.value = H.selection?.scope ?? H.preselection ?? "";
1491
1539
  }
1492
1540
  async function Y() {
1493
- if (!(!a.admin || o.value)) {
1494
- o.value = !0, h.value = !1;
1541
+ if (!(!a.admin || u.value)) {
1542
+ u.value = !0, d.value = !1;
1495
1543
  try {
1496
- await q();
1544
+ await j();
1497
1545
  } catch {
1498
- P || (h.value = !0);
1546
+ q || (d.value = !0);
1499
1547
  } finally {
1500
- P || (o.value = !1);
1548
+ q || (u.value = !1);
1501
1549
  }
1502
1550
  }
1503
1551
  }
1504
- async function X() {
1505
- if (!a.admin || o.value || !i.value || !S.value || h.value) return;
1506
- o.value = !0, h.value = !1;
1507
- const F = i.value;
1508
- i.value = "";
1552
+ async function J() {
1553
+ if (!a.admin || u.value || !o.value || !R.value || d.value) return;
1554
+ u.value = !0, d.value = !1;
1555
+ const L = o.value;
1556
+ o.value = "", x.value = !0;
1509
1557
  try {
1510
- const L = c.value ? await u.authorize(F, w.value) : await u.authorize(F);
1511
- await q(L), P || $("confirmed");
1558
+ let X = f.value ? await i.authorize(L, V.value) : await i.authorize(L);
1559
+ await j(X), !q && f.value && X.state === "ready" && K.value && (X = await i.authorize(L, V.value), await j(X)), q || m("confirmed");
1512
1560
  } catch {
1513
- P || (h.value = !0);
1561
+ q || (d.value = !0);
1514
1562
  } finally {
1515
- P || (o.value = !1);
1563
+ q || (u.value = !1, x.value = !1);
1516
1564
  }
1517
1565
  }
1518
- return ie(() => {
1519
- u.subscribe?.((F) => {
1520
- P || (n.value = F);
1566
+ return fe(() => {
1567
+ i.subscribe?.((L) => {
1568
+ q || (n.value = L);
1521
1569
  }), Y();
1522
- }), se(() => {
1523
- P = !0, i.value = "";
1524
- }), (F, L) => y.admin ? (t(), g(e(de), {
1570
+ }), de(() => {
1571
+ q = !0, o.value = "";
1572
+ }), (L, X) => c.admin ? (t(), w(e(pe), {
1525
1573
  key: 0,
1526
1574
  title: r.value.setupTitle,
1527
1575
  collapsible: !1,
1528
- "aria-busy": o.value
1576
+ "aria-busy": u.value
1529
1577
  }, {
1530
1578
  default: s(() => [
1531
- _("p", null, l(r.value.setupHelp), 1),
1532
- h.value ? (t(), g(e(Q), {
1579
+ h("p", null, l(r.value.setupHelp), 1),
1580
+ d.value ? (t(), w(e(W), {
1533
1581
  key: 0,
1534
1582
  tone: "danger",
1535
1583
  role: "alert"
1536
1584
  }, {
1537
1585
  default: s(() => [
1538
- f(l(r.value.setupError), 1)
1586
+ k(l(r.value.setupError), 1)
1539
1587
  ]),
1540
1588
  _: 1
1541
- })) : m("", !0),
1542
- _("p", yl, l(n.value ? n.value.state === "ready" ? E.value ? r.value.scopeNeeds : r.value.ready : n.value.state === "needs-admin-approval" ? r.value.needs : r.value.blocked : r.value.loading), 1),
1543
- n.value?.reason && (n.value.state === "blocked" || n.value.state === "unsupported") ? (t(), C("p", ml, l(r.value.details) + ": " + l(n.value.reason), 1)) : m("", !0),
1544
- v.value?.selection ? (t(), C("p", bl, l(r.value.protectedScope) + ": " + l(v.value.selection.root), 1)) : m("", !0),
1545
- v.value?.mismatch ? (t(), g(e(Q), {
1589
+ })) : b("", !0),
1590
+ h("p", El, l(x.value ? r.value.confirming : n.value ? n.value.state === "ready" ? K.value ? r.value.scopeNeeds : r.value.ready : n.value.state === "needs-admin-approval" ? r.value.needs : r.value.blocked : r.value.loading), 1),
1591
+ n.value?.reason && (n.value.state === "blocked" || n.value.state === "unsupported") ? (t(), $("p", Rl, l(r.value.details) + ": " + l(n.value.reason), 1)) : b("", !0),
1592
+ p.value?.selection ? (t(), $("p", Tl, l(r.value.protectedScope) + ": " + l(p.value.selection.root), 1)) : b("", !0),
1593
+ p.value?.mismatch ? (t(), w(e(W), {
1546
1594
  key: 3,
1547
1595
  tone: "warning"
1548
1596
  }, {
1549
1597
  default: s(() => [
1550
- f(l(r.value.scopeMismatch) + " " + l(r.value.preselection) + ": " + l(v.value.preselection) + " · " + l(r.value.protectedScope) + ": " + l(v.value.selection?.root), 1)
1598
+ k(l(r.value.scopeMismatch) + " " + l(r.value.preselection) + ": " + l(p.value.preselection) + " · " + l(r.value.protectedScope) + ": " + l(p.value.selection?.root), 1)
1551
1599
  ]),
1552
1600
  _: 1
1553
- })) : m("", !0),
1554
- n.value?.state === "needs-admin-approval" || n.value?.retry || c.value && n.value?.state === "ready" ? (t(), g(e(pe), {
1601
+ })) : b("", !0),
1602
+ n.value?.state === "needs-admin-approval" || n.value?.retry || f.value && n.value?.state === "ready" ? (t(), w(e(he), {
1555
1603
  key: 4,
1556
- onSubmit: ce(X, ["prevent"])
1604
+ onSubmit: be(J, ["prevent"])
1557
1605
  }, {
1558
1606
  default: s(() => [
1559
- c.value ? (t(), C(j, { key: 0 }, [
1560
- _("p", null, l(v.value?.selection ? r.value.scopeChangeHelp : r.value.preselectionHelp), 1),
1561
- b(e(ne), {
1607
+ f.value ? (t(), $(te, { key: 0 }, [
1608
+ h("p", null, l(p.value?.selection ? r.value.scopeChangeHelp : r.value.preselectionHelp), 1),
1609
+ y(e(re), {
1562
1610
  label: r.value.scopeLabel,
1563
1611
  "label-for": "delegate-scope"
1564
1612
  }, {
1565
1613
  default: s(() => [
1566
- b(e(Ue), {
1614
+ y(e(Ne), {
1567
1615
  id: "delegate-scope",
1568
- modelValue: w.value,
1569
- "onUpdate:modelValue": L[0] || (L[0] = (J) => w.value = J),
1570
- options: V.value,
1571
- disabled: o.value || h.value
1616
+ modelValue: V.value,
1617
+ "onUpdate:modelValue": X[0] || (X[0] = (H) => V.value = H),
1618
+ options: P.value,
1619
+ disabled: u.value || d.value
1572
1620
  }, null, 8, ["modelValue", "options", "disabled"])
1573
1621
  ]),
1574
1622
  _: 1
1575
1623
  }, 8, ["label"])
1576
- ], 64)) : m("", !0),
1577
- b(e(ne), {
1624
+ ], 64)) : b("", !0),
1625
+ y(e(re), {
1578
1626
  label: r.value.password,
1579
1627
  "label-for": "delegate-password"
1580
1628
  }, {
1581
1629
  default: s(() => [
1582
- b(e(re), {
1630
+ y(e(me), {
1583
1631
  id: "delegate-password",
1584
- modelValue: i.value,
1585
- "onUpdate:modelValue": L[1] || (L[1] = (J) => i.value = J),
1632
+ modelValue: o.value,
1633
+ "onUpdate:modelValue": X[1] || (X[1] = (H) => o.value = H),
1586
1634
  type: "password",
1587
1635
  autocomplete: "current-password",
1588
- disabled: o.value || h.value
1636
+ disabled: u.value || d.value
1589
1637
  }, null, 8, ["modelValue", "disabled"])
1590
1638
  ]),
1591
1639
  _: 1
1592
1640
  }, 8, ["label"]),
1593
- b(e(fe), null, {
1641
+ y(e(_e), null, {
1594
1642
  default: s(() => [
1595
- b(e(z), {
1643
+ y(e(A), {
1596
1644
  type: "submit",
1597
1645
  variant: "primary",
1598
- disabled: o.value || h.value || !i.value || !S.value || c.value && !!v.value?.selection && !H.value
1646
+ disabled: u.value || d.value || !o.value || !R.value || f.value && !!p.value?.selection && !T.value
1599
1647
  }, {
1600
1648
  default: s(() => [
1601
- f(l(c.value ? v.value?.selection ? r.value.confirmScope : r.value.confirmShare : r.value.authorize), 1)
1649
+ k(l(f.value ? p.value?.selection ? r.value.confirmScope : r.value.confirmShare : r.value.authorize), 1)
1602
1650
  ]),
1603
1651
  _: 1
1604
1652
  }, 8, ["disabled"])
@@ -1607,162 +1655,162 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1607
1655
  })
1608
1656
  ]),
1609
1657
  _: 1
1610
- })) : m("", !0),
1611
- b(e(z), {
1658
+ })) : b("", !0),
1659
+ y(e(A), {
1612
1660
  variant: "secondary",
1613
- disabled: o.value,
1661
+ disabled: u.value,
1614
1662
  onClick: Y
1615
1663
  }, {
1616
1664
  default: s(() => [
1617
- f(l(r.value.refresh), 1)
1665
+ k(l(r.value.refresh), 1)
1618
1666
  ]),
1619
1667
  _: 1
1620
1668
  }, 8, ["disabled"])
1621
1669
  ]),
1622
1670
  _: 1
1623
- }, 8, ["title", "aria-busy"])) : m("", !0);
1671
+ }, 8, ["title", "aria-busy"])) : b("", !0);
1624
1672
  }
1625
- }), kl = {
1673
+ }), ql = {
1626
1674
  key: 1,
1627
1675
  role: "status"
1628
- }, _l = {
1676
+ }, Ol = {
1629
1677
  key: 2,
1630
1678
  role: "status"
1631
- }, gl = {
1679
+ }, Bl = {
1632
1680
  key: 0,
1633
1681
  role: "status",
1634
1682
  class: "destination"
1635
- }, hl = { class: "section-heading" }, wl = { key: 3 }, Cl = {
1683
+ }, Ll = { class: "section-heading" }, Fl = { key: 3 }, Nl = {
1636
1684
  key: 4,
1637
1685
  class: "records"
1638
- }, $l = ["data-job-state"], xl = ["role"], Sl = { key: 5 }, zl = {
1686
+ }, Ml = ["data-job-state"], Kl = ["role"], Hl = { key: 5 }, Gl = {
1639
1687
  key: 6,
1640
1688
  class: "records"
1641
- }, Vl = /* @__PURE__ */ ae({
1689
+ }, Jl = /* @__PURE__ */ se({
1642
1690
  __name: "DelegatePanel",
1643
1691
  props: {
1644
1692
  ctx: {}
1645
1693
  },
1646
- setup(y) {
1647
- const D = y, a = N(() => xe(D.ctx.locale)), $ = $e(D.ctx), u = p(), r = p([]), n = p([]), i = p(!1), o = p(), h = p(""), v = p(!1), w = p(""), U = p(""), c = p("");
1648
- let V = !1, S, E;
1649
- Se([U, w, c], () => {
1650
- E = void 0;
1694
+ setup(c) {
1695
+ const S = c, a = N(() => qe(S.ctx.locale)), m = Te(S.ctx), i = v(), r = v([]), n = v([]), o = v(!1), u = v(), x = v(""), d = v(!1), p = v(""), V = v(""), C = v("");
1696
+ let f = !1, P, R;
1697
+ Be([V, p, C], () => {
1698
+ R = void 0;
1651
1699
  }, { flush: "sync" });
1652
- const H = (M) => ["queued", "running", "waiting_executor"].includes(M.state), P = N(() => n.value.some((M) => M.state === "waiting_executor")), q = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], Y = N(() => P.value && q.includes(o.value?.code ?? "")), X = N(() => u.value && u.value.state !== "ready" && !(P.value && u.value.state === "needs-admin-approval" && q.includes(u.value.reason ?? "")));
1653
- async function F() {
1654
- if (V) return;
1655
- const [M, d, k] = await Promise.allSettled([D.ctx.call("delegate.status"), D.ctx.call("delegate.list"), D.ctx.call("delegate.jobs.list")]);
1656
- if (!V) {
1657
- M.status === "fulfilled" && (u.value = M.value), d.status === "fulfilled" && (r.value = (d.value.delegations ?? []).filter((x) => !x.revoked)), k.status === "fulfilled" && (n.value = k.value.jobs ?? []);
1658
- for (const x of [M, d, k]) if (x.status === "rejected") throw x.reason;
1700
+ const K = (B) => ["queued", "running", "waiting_executor"].includes(B.state), T = N(() => n.value.some((B) => B.state === "waiting_executor")), q = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], j = N(() => T.value && q.includes(u.value?.code ?? "")), Y = N(() => i.value && i.value.state !== "ready" && !(T.value && i.value.state === "needs-admin-approval" && q.includes(i.value.reason ?? "")));
1701
+ async function J() {
1702
+ if (f) return;
1703
+ const [B, _, z] = await Promise.allSettled([S.ctx.call("delegate.status"), S.ctx.call("delegate.list"), S.ctx.call("delegate.jobs.list")]);
1704
+ if (!f) {
1705
+ B.status === "fulfilled" && (i.value = B.value), _.status === "fulfilled" && (r.value = (_.value.delegations ?? []).filter((G) => !G.revoked)), z.status === "fulfilled" && (n.value = z.value.jobs ?? []);
1706
+ for (const G of [B, _, z]) if (G.status === "rejected") throw G.reason;
1659
1707
  }
1660
1708
  }
1661
- async function L(M) {
1662
- if (!(i.value || V)) {
1663
- i.value = !0, o.value = void 0;
1709
+ async function L(B) {
1710
+ if (!(o.value || f)) {
1711
+ o.value = !0, u.value = void 0;
1664
1712
  try {
1665
- await M();
1666
- } catch (d) {
1667
- V || (o.value = d);
1713
+ await B();
1714
+ } catch (_) {
1715
+ f || (u.value = _);
1668
1716
  } finally {
1669
- V || (i.value = !1);
1717
+ f || (o.value = !1);
1670
1718
  }
1671
1719
  }
1672
1720
  }
1673
- const J = () => L(F), K = (M) => L(async () => {
1674
- await D.ctx.call("delegate.revoke", { delegation_id: M }), await F();
1675
- }), W = (M) => L(async () => {
1676
- const d = await D.ctx.call("delegate.jobs.cancel", { id: M });
1677
- V || (h.value = d.revocation_pending ? a.value.pending : ""), await F();
1678
- }), R = N(() => u.value?.state === "ready" && !!w.value && !!U.value && !!c.value), O = () => L(async () => {
1679
- R.value && (await D.ctx.call("delegate.jobs.submit", { key: E ?? (E = crypto.randomUUID()), url: U.value, dest: w.value, name: c.value }), V || (U.value = "", c.value = "", w.value = ""), await F());
1680
- }), T = (M) => {
1681
- const d = new Date(M);
1682
- return Number.isNaN(d.getTime()) ? "—" : d.toLocaleString(D.ctx.locale);
1721
+ const X = () => L(J), H = (B) => L(async () => {
1722
+ await S.ctx.call("delegate.revoke", { delegation_id: B }), await J();
1723
+ }), ee = (B) => L(async () => {
1724
+ const _ = await S.ctx.call("delegate.jobs.cancel", { id: B });
1725
+ f || (x.value = _.revocation_pending ? a.value.pending : ""), await J();
1726
+ }), ae = N(() => i.value?.state === "ready" && !!p.value && !!V.value && !!C.value), Q = () => L(async () => {
1727
+ ae.value && (await S.ctx.call("delegate.jobs.submit", { key: R ?? (R = crypto.randomUUID()), url: V.value, dest: p.value, name: C.value }), f || (V.value = "", C.value = "", p.value = ""), await J());
1728
+ }), E = (B) => {
1729
+ const _ = new Date(B);
1730
+ return Number.isNaN(_.getTime()) ? "—" : _.toLocaleString(S.ctx.locale);
1683
1731
  };
1684
- return ie(() => {
1685
- J(), S = setInterval(() => {
1686
- n.value.some(H) && J();
1732
+ return fe(() => {
1733
+ X(), P = setInterval(() => {
1734
+ n.value.some(K) && X();
1687
1735
  }, 3e3);
1688
- }), se(() => {
1689
- V = !0, S && clearInterval(S), $.dispose();
1690
- }), (M, d) => (t(), g(e(de), {
1736
+ }), de(() => {
1737
+ f = !0, P && clearInterval(P), m.dispose();
1738
+ }), (B, _) => (t(), w(e(pe), {
1691
1739
  title: a.value.title,
1692
1740
  collapsible: !1,
1693
- "aria-busy": i.value,
1741
+ "aria-busy": o.value,
1694
1742
  class: "delegate-panel"
1695
1743
  }, {
1696
1744
  default: s(() => [
1697
- _("p", null, l(a.value.help), 1),
1698
- o.value && !Y.value ? (t(), g(e(Q), {
1745
+ h("p", null, l(a.value.help), 1),
1746
+ u.value && !j.value ? (t(), w(e(W), {
1699
1747
  key: 0,
1700
1748
  tone: "danger",
1701
1749
  role: "alert"
1702
1750
  }, {
1703
1751
  default: s(() => [
1704
- f(l(e(Fe)(o.value, a.value)), 1)
1752
+ k(l(e(Ze)(u.value, a.value)), 1)
1705
1753
  ]),
1706
1754
  _: 1
1707
- })) : m("", !0),
1708
- h.value ? (t(), C("p", kl, l(h.value), 1)) : m("", !0),
1709
- X.value ? (t(), C("p", _l, l(u.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : m("", !0),
1710
- b(e(pe), {
1711
- onSubmit: ce(O, ["prevent"])
1755
+ })) : b("", !0),
1756
+ x.value ? (t(), $("p", ql, l(x.value), 1)) : b("", !0),
1757
+ Y.value ? (t(), $("p", Ol, l(i.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : b("", !0),
1758
+ y(e(he), {
1759
+ onSubmit: be(Q, ["prevent"])
1712
1760
  }, {
1713
1761
  default: s(() => [
1714
- b(e(ne), {
1762
+ y(e(re), {
1715
1763
  label: a.value.url,
1716
1764
  "label-for": "delegate-url"
1717
1765
  }, {
1718
1766
  default: s(() => [
1719
- b(e(re), {
1767
+ y(e(me), {
1720
1768
  id: "delegate-url",
1721
- modelValue: U.value,
1722
- "onUpdate:modelValue": d[0] || (d[0] = (k) => U.value = k),
1769
+ modelValue: V.value,
1770
+ "onUpdate:modelValue": _[0] || (_[0] = (z) => V.value = z),
1723
1771
  type: "url",
1724
- disabled: i.value || u.value?.state !== "ready"
1772
+ disabled: o.value || i.value?.state !== "ready"
1725
1773
  }, null, 8, ["modelValue", "disabled"])
1726
1774
  ]),
1727
1775
  _: 1
1728
1776
  }, 8, ["label"]),
1729
- b(e(ne), {
1777
+ y(e(re), {
1730
1778
  label: a.value.name,
1731
1779
  "label-for": "delegate-name"
1732
1780
  }, {
1733
1781
  default: s(() => [
1734
- b(e(re), {
1782
+ y(e(me), {
1735
1783
  id: "delegate-name",
1736
- modelValue: c.value,
1737
- "onUpdate:modelValue": d[1] || (d[1] = (k) => c.value = k),
1784
+ modelValue: C.value,
1785
+ "onUpdate:modelValue": _[1] || (_[1] = (z) => C.value = z),
1738
1786
  "data-file-name": "",
1739
- disabled: i.value || u.value?.state !== "ready"
1787
+ disabled: o.value || i.value?.state !== "ready"
1740
1788
  }, null, 8, ["modelValue", "disabled"])
1741
1789
  ]),
1742
1790
  _: 1
1743
1791
  }, 8, ["label"]),
1744
- _("p", null, l(a.value.size), 1),
1745
- w.value ? (t(), C("p", gl, l(a.value.destination) + ": " + l(w.value), 1)) : m("", !0),
1746
- b(e(fe), null, {
1792
+ h("p", null, l(a.value.size), 1),
1793
+ p.value ? (t(), $("p", Bl, l(a.value.destination) + ": " + l(p.value), 1)) : b("", !0),
1794
+ y(e(_e), null, {
1747
1795
  default: s(() => [
1748
- b(e(z), {
1796
+ y(e(A), {
1749
1797
  type: "button",
1750
1798
  variant: "secondary",
1751
- disabled: i.value || u.value?.state !== "ready",
1752
- onClick: d[2] || (d[2] = (k) => v.value = !0)
1799
+ disabled: o.value || i.value?.state !== "ready",
1800
+ onClick: _[2] || (_[2] = (z) => d.value = !0)
1753
1801
  }, {
1754
1802
  default: s(() => [
1755
- f(l(a.value.choose), 1)
1803
+ k(l(a.value.choose), 1)
1756
1804
  ]),
1757
1805
  _: 1
1758
1806
  }, 8, ["disabled"]),
1759
- b(e(z), {
1807
+ y(e(A), {
1760
1808
  type: "submit",
1761
1809
  variant: "primary",
1762
- disabled: i.value || !R.value
1810
+ disabled: o.value || !ae.value
1763
1811
  }, {
1764
1812
  default: s(() => [
1765
- f(l(a.value.submit), 1)
1813
+ k(l(a.value.submit), 1)
1766
1814
  ]),
1767
1815
  _: 1
1768
1816
  }, 8, ["disabled"])
@@ -1772,64 +1820,64 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1772
1820
  ]),
1773
1821
  _: 1
1774
1822
  }),
1775
- b(ye, {
1776
- open: v.value,
1777
- "onUpdate:open": d[3] || (d[3] = (k) => v.value = k),
1778
- locale: y.ctx.locale,
1779
- provider: e($),
1823
+ y(we, {
1824
+ open: d.value,
1825
+ "onUpdate:open": _[3] || (_[3] = (z) => d.value = z),
1826
+ locale: c.ctx.locale,
1827
+ provider: e(m),
1780
1828
  mode: "folder",
1781
- onSelected: d[4] || (d[4] = (k) => w.value = k)
1829
+ onSelected: _[4] || (_[4] = (z) => p.value = z)
1782
1830
  }, null, 8, ["open", "locale", "provider"]),
1783
- _("div", hl, [
1784
- _("h3", null, l(a.value.downloads), 1),
1785
- b(e(z), {
1831
+ h("div", Ll, [
1832
+ h("h3", null, l(a.value.downloads), 1),
1833
+ y(e(A), {
1786
1834
  variant: "secondary",
1787
- disabled: i.value,
1788
- onClick: J
1835
+ disabled: o.value,
1836
+ onClick: X
1789
1837
  }, {
1790
1838
  default: s(() => [
1791
- f(l(a.value.refresh), 1)
1839
+ k(l(a.value.refresh), 1)
1792
1840
  ]),
1793
1841
  _: 1
1794
1842
  }, 8, ["disabled"])
1795
1843
  ]),
1796
- !n.value.length && !o.value ? (t(), C("p", wl, l(a.value.noJobs), 1)) : (t(), C("ul", Cl, [
1797
- (t(!0), C(j, null, te(n.value, (k) => (t(), C("li", {
1798
- key: k.id,
1799
- "data-job-state": k.state
1844
+ !n.value.length && !u.value ? (t(), $("p", Fl, l(a.value.noJobs), 1)) : (t(), $("ul", Nl, [
1845
+ (t(!0), $(te, null, ce(n.value, (z) => (t(), $("li", {
1846
+ key: z.id,
1847
+ "data-job-state": z.state
1800
1848
  }, [
1801
- _("span", {
1802
- role: k.state === "waiting_executor" ? "status" : void 0
1803
- }, l(k.name) + " · " + l(a.value[k.state]), 9, xl),
1804
- H(k) ? (t(), g(e(z), {
1849
+ h("span", {
1850
+ role: z.state === "waiting_executor" ? "status" : void 0
1851
+ }, l(z.name) + " · " + l(a.value[z.state]), 9, Kl),
1852
+ K(z) ? (t(), w(e(A), {
1805
1853
  key: 0,
1806
1854
  variant: "secondary",
1807
- disabled: i.value,
1808
- onClick: (x) => W(k.id)
1855
+ disabled: o.value,
1856
+ onClick: (G) => ee(z.id)
1809
1857
  }, {
1810
1858
  default: s(() => [
1811
- f(l(a.value.cancel), 1)
1859
+ k(l(a.value.cancel), 1)
1812
1860
  ]),
1813
1861
  _: 1
1814
- }, 8, ["disabled", "onClick"])) : m("", !0)
1815
- ], 8, $l))), 128))
1862
+ }, 8, ["disabled", "onClick"])) : b("", !0)
1863
+ ], 8, Ml))), 128))
1816
1864
  ])),
1817
- _("h3", null, l(a.value.delegations), 1),
1818
- !r.value.length && !o.value ? (t(), C("p", Sl, l(a.value.noDelegations), 1)) : (t(), C("ul", zl, [
1819
- (t(!0), C(j, null, te(r.value, (k) => (t(), C("li", {
1820
- key: k.delegation_id
1865
+ h("h3", null, l(a.value.delegations), 1),
1866
+ !r.value.length && !u.value ? (t(), $("p", Hl, l(a.value.noDelegations), 1)) : (t(), $("ul", Gl, [
1867
+ (t(!0), $(te, null, ce(r.value, (z) => (t(), $("li", {
1868
+ key: z.delegation_id
1821
1869
  }, [
1822
- _("div", null, [
1823
- _("strong", null, l(k.path), 1),
1824
- _("p", null, l(a.value.expires) + ": " + l(T(k.expires_at)), 1)
1870
+ h("div", null, [
1871
+ h("strong", null, l(z.path), 1),
1872
+ h("p", null, l(a.value.expires) + ": " + l(E(z.expires_at)), 1)
1825
1873
  ]),
1826
- b(e(z), {
1874
+ y(e(A), {
1827
1875
  variant: "secondary",
1828
- disabled: i.value,
1829
- onClick: (x) => K(k.delegation_id)
1876
+ disabled: o.value,
1877
+ onClick: (G) => H(z.delegation_id)
1830
1878
  }, {
1831
1879
  default: s(() => [
1832
- f(l(a.value.revoke), 1)
1880
+ k(l(a.value.revoke), 1)
1833
1881
  ]),
1834
1882
  _: 1
1835
1883
  }, 8, ["disabled", "onClick"])
@@ -1839,19 +1887,19 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1839
1887
  _: 1
1840
1888
  }, 8, ["title", "aria-busy"]));
1841
1889
  }
1842
- }), vt = /* @__PURE__ */ ue(Vl, [["__scopeId", "data-v-d79ee942"]]), Pl = {
1890
+ }), Ut = /* @__PURE__ */ oe(Jl, [["__scopeId", "data-v-d79ee942"]]), Xl = {
1843
1891
  key: 1,
1844
1892
  role: "status"
1845
- }, Ul = {
1893
+ }, Ql = {
1846
1894
  key: 2,
1847
1895
  role: "status"
1848
- }, Dl = { key: 3 }, Al = {
1896
+ }, Yl = { key: 3 }, Wl = {
1849
1897
  key: 7,
1850
1898
  role: "status"
1851
- }, El = { class: "save-actions" }, Tl = { key: 8 }, Il = {
1899
+ }, Zl = { class: "save-actions" }, jl = { key: 8 }, et = {
1852
1900
  key: 10,
1853
1901
  class: "save-actions"
1854
- }, Ol = { key: 12 }, Rl = { class: "save-records" }, ql = { class: "save-actions" }, Ll = { key: 14 }, Bl = { class: "save-records" }, Fl = ["data-job-id", "data-save-state"], Nl = { key: 0 }, Ml = { key: 3 }, Hl = /* @__PURE__ */ ae({
1902
+ }, at = { key: 12 }, lt = { class: "save-records" }, tt = { class: "save-actions" }, nt = { key: 14 }, st = { class: "save-records" }, it = ["data-job-id", "data-save-state"], ot = { key: 0 }, ut = { key: 3 }, rt = /* @__PURE__ */ se({
1855
1903
  __name: "BackgroundSavePanel",
1856
1904
  props: {
1857
1905
  sdk: {},
@@ -1860,472 +1908,532 @@ const ra = { class: "app-page-content" }, da = /* @__PURE__ */ ae({
1860
1908
  picker: {}
1861
1909
  },
1862
1910
  emits: ["authorized"],
1863
- setup(y, { emit: D }) {
1864
- const a = y, $ = D, u = p(!1), r = p(""), n = N(() => Ce(a.locale)), i = p(), o = p([]), h = p([]), v = p(!1), w = p(), U = p(""), c = p([]), V = N(() => a.picker && (i.value?.selection ? Ne(a.picker.provider, i.value.selection.root) : i.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider));
1865
- let S = !1, E;
1866
- const H = (T) => T.state === "copying" && T.code === "CANCEL_REQUESTED", P = (T) => H(T) ? "canceling" : T.state === "committed" && !T.receipt?.path ? "uncertain" : T.state, q = (T) => ["queued", "copying"].includes(T.state) && !H(T);
1867
- function Y() {
1868
- i.value = void 0, o.value = [], h.value = [], c.value = [], u.value = !1;
1911
+ setup(c, { emit: S }) {
1912
+ const a = c, m = S, i = v(!1), r = v(""), n = N(() => Re(a.locale)), o = v(), u = v([]), x = v([]), d = v(!1), p = v(), V = v(""), C = v([]), f = N(() => a.picker && (o.value?.selection ? je(a.picker.provider, o.value.selection.root) : o.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider));
1913
+ let P = !1, R;
1914
+ const K = (E) => E.state === "copying" && E.code === "CANCEL_REQUESTED", T = (E) => K(E) ? "canceling" : E.state === "committed" && !E.receipt?.path ? "uncertain" : E.state, q = (E) => ["queued", "copying"].includes(E.state) && !K(E);
1915
+ function j() {
1916
+ o.value = void 0, u.value = [], x.value = [], C.value = [], i.value = !1;
1869
1917
  }
1870
- async function X() {
1871
- const [T, M, d, k] = await Promise.all([a.sdk.status(), a.sdk.list(), a.sdk.operations(), Promise.all((a.picker?.keys ?? []).map((x) => a.sdk.destination(x)))]);
1872
- if (!S) {
1873
- if (!T || typeof T.disabled != "boolean" || !Array.isArray(M) || !Array.isArray(d)) throw { code: "unavailable" };
1874
- (i.value?.selection?.generation !== T.selection?.generation || i.value?.selection?.scope !== T.selection?.scope) && (u.value = !1), i.value = T, o.value = k.length ? M.filter((x) => k.some((G) => G.status === "active" && G.destination?.id === x.id)) : M, h.value = d, c.value = k;
1918
+ async function Y() {
1919
+ const [E, B, _, z] = await Promise.all([a.sdk.status(), a.sdk.list(), a.sdk.operations(), Promise.all((a.picker?.keys ?? []).map((G) => a.sdk.destination(G)))]);
1920
+ if (!P) {
1921
+ if (!E || typeof E.disabled != "boolean" || !Array.isArray(B) || !Array.isArray(_)) throw { code: "unavailable" };
1922
+ (o.value?.selection?.generation !== E.selection?.generation || o.value?.selection?.scope !== E.selection?.scope) && (i.value = !1), o.value = E, u.value = z.length ? B.filter((G) => z.some((Z) => Z.status === "active" && Z.destination?.id === G.id)) : B, x.value = _, C.value = z;
1875
1923
  }
1876
1924
  }
1877
- async function F(T) {
1878
- if (!(S || v.value)) {
1879
- v.value = !0, w.value = void 0, U.value = "";
1925
+ async function J(E) {
1926
+ if (!(P || d.value)) {
1927
+ d.value = !0, p.value = void 0, V.value = "";
1880
1928
  try {
1881
- await T();
1882
- } catch (M) {
1883
- S || (Y(), w.value = M);
1929
+ await E();
1930
+ } catch (B) {
1931
+ P || (j(), p.value = B);
1884
1932
  } finally {
1885
- S || (v.value = !1);
1933
+ P || (d.value = !1);
1886
1934
  }
1887
1935
  }
1888
1936
  }
1889
- const L = () => F(X);
1890
- function J(T) {
1891
- $("authorized", T), L();
1937
+ const L = () => J(Y);
1938
+ function X(E) {
1939
+ m("authorized", E), L();
1892
1940
  }
1893
- const K = (T) => F(async () => {
1894
- if ((await a.sdk.revoke({ delegation_id: T }))?.revoked !== !0) throw { code: "commit-uncertain" };
1895
- await X(), S || (U.value = n.value.revoked);
1896
- }), W = (T) => F(async () => {
1897
- await a.sdk.cancel({ delegation_id: T.delegation_id, job_id: T.job_id }), await X();
1898
- }), R = () => F(async () => {
1899
- if (!a.admin || !i.value) return;
1900
- const T = i.value.disabled;
1901
- if ((T ? await a.sdk.enable() : await a.sdk.disable())?.disabled !== !T) throw { code: "commit-uncertain" };
1902
- await X();
1903
- }), O = (T) => F(async () => {
1904
- const M = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (d) => d.toString(16).padStart(2, "0")).join("");
1905
- await a.sdk.exportExample({ key: T, job_id: M }), await X();
1941
+ const H = (E) => J(async () => {
1942
+ if ((await a.sdk.revoke({ delegation_id: E }))?.revoked !== !0) throw { code: "commit-uncertain" };
1943
+ await Y(), P || (V.value = n.value.revoked);
1944
+ }), ee = (E) => J(async () => {
1945
+ await a.sdk.cancel({ delegation_id: E.delegation_id, job_id: E.job_id }), await Y();
1946
+ }), ae = () => J(async () => {
1947
+ if (!a.admin || !o.value) return;
1948
+ const E = o.value.disabled;
1949
+ if ((E ? await a.sdk.enable() : await a.sdk.disable())?.disabled !== !E) throw { code: "commit-uncertain" };
1950
+ await Y();
1951
+ }), Q = (E) => J(async () => {
1952
+ const B = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (_) => _.toString(16).padStart(2, "0")).join("");
1953
+ await a.sdk.exportExample({ key: E, job_id: B }), await Y();
1906
1954
  });
1907
- return ie(() => {
1908
- L(), E = setInterval(() => {
1909
- h.value.some(q) && L();
1955
+ return fe(() => {
1956
+ L(), R = setInterval(() => {
1957
+ x.value.some(q) && L();
1910
1958
  }, 3e3);
1911
- }), se(() => {
1912
- S = !0, E && clearInterval(E);
1913
- }), (T, M) => (t(), g(e(de), {
1959
+ }), de(() => {
1960
+ P = !0, R && clearInterval(R);
1961
+ }), (E, B) => (t(), w(e(pe), {
1914
1962
  title: n.value.title,
1915
1963
  collapsible: !1,
1916
- "aria-busy": v.value,
1964
+ "aria-busy": d.value,
1917
1965
  class: "background-save-panel"
1918
1966
  }, {
1919
1967
  default: s(() => [
1920
- _("p", null, l(n.value.help), 1),
1921
- w.value ? (t(), g(e(Q), {
1968
+ h("p", null, l(n.value.help), 1),
1969
+ p.value ? (t(), w(e(W), {
1922
1970
  key: 0,
1923
1971
  tone: "danger",
1924
1972
  role: "alert",
1925
1973
  class: "save-message"
1926
1974
  }, {
1927
1975
  default: s(() => [
1928
- f(l(e(be)(w.value, n.value)), 1)
1976
+ k(l(e(ze)(p.value, n.value)), 1)
1929
1977
  ]),
1930
1978
  _: 1
1931
- })) : m("", !0),
1932
- v.value && !i.value ? (t(), C("p", Pl, l(n.value.loading), 1)) : m("", !0),
1933
- U.value ? (t(), C("p", Ul, l(U.value), 1)) : m("", !0),
1934
- i.value?.selection ? (t(), C("p", Dl, [
1935
- _("strong", null, l(n.value.scope), 1),
1936
- f(": " + l(i.value.selection.root), 1)
1937
- ])) : m("", !0),
1938
- i.value?.mismatch ? (t(), g(e(Q), {
1979
+ })) : b("", !0),
1980
+ d.value && !o.value ? (t(), $("p", Xl, l(n.value.loading), 1)) : b("", !0),
1981
+ V.value ? (t(), $("p", Ql, l(V.value), 1)) : b("", !0),
1982
+ o.value?.selection ? (t(), $("p", Yl, [
1983
+ h("strong", null, l(n.value.scope), 1),
1984
+ k(": " + l(o.value.selection.root), 1)
1985
+ ])) : b("", !0),
1986
+ o.value?.mismatch ? (t(), w(e(W), {
1939
1987
  key: 4,
1940
1988
  tone: "warning"
1941
1989
  }, {
1942
1990
  default: s(() => [
1943
- f(l(n.value.scopeMismatch) + " " + l(i.value.preselection) + " → " + l(i.value.selection?.root), 1)
1991
+ k(l(n.value.scopeMismatch) + " " + l(o.value.preselection) + " → " + l(o.value.selection?.root), 1)
1944
1992
  ]),
1945
1993
  _: 1
1946
- })) : m("", !0),
1947
- i.value?.scopeMode === "install-selected" && !i.value.selection ? (t(), g(e(Q), {
1994
+ })) : b("", !0),
1995
+ o.value?.scopeMode === "install-selected" && !o.value.selection ? (t(), w(e(W), {
1948
1996
  key: 5,
1949
1997
  tone: "warning"
1950
1998
  }, {
1951
1999
  default: s(() => [
1952
- f(l(n.value.scopeNeeds), 1)
2000
+ k(l(n.value.scopeNeeds), 1)
1953
2001
  ]),
1954
2002
  _: 1
1955
- })) : m("", !0),
1956
- i.value?.disabled ? (t(), g(e(Q), {
2003
+ })) : b("", !0),
2004
+ o.value?.disabled ? (t(), w(e(W), {
1957
2005
  key: 6,
1958
2006
  tone: "warning",
1959
2007
  role: "status",
1960
2008
  class: "save-message"
1961
2009
  }, {
1962
2010
  default: s(() => [
1963
- f(l(n.value.disabled), 1)
2011
+ k(l(n.value.disabled), 1)
1964
2012
  ]),
1965
2013
  _: 1
1966
- })) : i.value ? (t(), C("p", Al, l(n.value.enabled), 1)) : m("", !0),
1967
- _("div", El, [
1968
- b(e(z), {
2014
+ })) : o.value && !(o.value.scopeMode === "install-selected" && !o.value.selection) ? (t(), $("p", Wl, l(n.value.enabled), 1)) : b("", !0),
2015
+ h("div", Zl, [
2016
+ y(e(A), {
1969
2017
  variant: "secondary",
1970
- disabled: v.value,
2018
+ disabled: d.value,
1971
2019
  onClick: L
1972
2020
  }, {
1973
2021
  default: s(() => [
1974
- f(l(n.value.refresh), 1)
2022
+ k(l(n.value.refresh), 1)
1975
2023
  ]),
1976
2024
  _: 1
1977
2025
  }, 8, ["disabled"]),
1978
- y.admin && i.value ? (t(), g(e(z), {
2026
+ c.admin && o.value ? (t(), w(e(A), {
1979
2027
  key: 0,
1980
- variant: i.value.disabled ? "secondary" : "danger",
1981
- disabled: v.value,
1982
- onClick: R
2028
+ variant: o.value.disabled ? "secondary" : "danger",
2029
+ disabled: d.value,
2030
+ onClick: ae
1983
2031
  }, {
1984
2032
  default: s(() => [
1985
- f(l(i.value.disabled ? n.value.enable : n.value.disable), 1)
2033
+ k(l(o.value.disabled ? n.value.enable : n.value.disable), 1)
1986
2034
  ]),
1987
2035
  _: 1
1988
- }, 8, ["variant", "disabled"])) : m("", !0)
2036
+ }, 8, ["variant", "disabled"])) : b("", !0)
1989
2037
  ]),
1990
- y.admin && i.value ? (t(), C("p", Tl, l(n.value.disableHelp), 1)) : m("", !0),
1991
- _("h3", null, l(n.value.delegations), 1),
1992
- c.value.some((d) => d.status === "reselection-required") ? (t(), g(e(Q), {
2038
+ c.admin && o.value ? (t(), $("p", jl, l(n.value.disableHelp), 1)) : b("", !0),
2039
+ h("h3", null, l(n.value.delegations), 1),
2040
+ C.value.some((_) => _.status === "reselection-required") ? (t(), w(e(W), {
1993
2041
  key: 9,
1994
2042
  tone: "warning"
1995
2043
  }, {
1996
2044
  default: s(() => [
1997
- f(l(n.value.reselect), 1)
2045
+ k(l(n.value.reselect), 1)
1998
2046
  ]),
1999
2047
  _: 1
2000
- })) : m("", !0),
2001
- y.picker ? (t(), C("div", Il, [
2002
- (t(!0), C(j, null, te(y.picker.keys, (d) => (t(), g(e(z), {
2003
- key: d,
2048
+ })) : b("", !0),
2049
+ c.picker ? (t(), $("div", et, [
2050
+ (t(!0), $(te, null, ce(c.picker.keys, (_) => (t(), w(e(A), {
2051
+ key: _,
2004
2052
  variant: "secondary",
2005
- disabled: v.value || !i.value || i.value.disabled || !V.value,
2006
- onClick: (k) => {
2007
- r.value = d, u.value = !0;
2053
+ disabled: d.value || !o.value || o.value.disabled || !f.value,
2054
+ onClick: (z) => {
2055
+ r.value = _, i.value = !0;
2008
2056
  }
2009
2057
  }, {
2010
2058
  default: s(() => [
2011
- f(l(n.value.choose) + " (" + l(d) + ")", 1)
2059
+ k(l(n.value.choose) + " (" + l(_) + ")", 1)
2012
2060
  ]),
2013
2061
  _: 2
2014
2062
  }, 1032, ["disabled", "onClick"]))), 128))
2015
- ])) : m("", !0),
2016
- V.value ? (t(), g(ye, {
2017
- key: i.value?.selection?.scope,
2018
- open: u.value,
2019
- "onUpdate:open": M[0] || (M[0] = (d) => u.value = d),
2020
- provider: V.value,
2021
- locale: y.locale,
2063
+ ])) : b("", !0),
2064
+ f.value ? (t(), w(we, {
2065
+ key: o.value?.selection?.scope,
2066
+ open: i.value,
2067
+ "onUpdate:open": B[0] || (B[0] = (_) => i.value = _),
2068
+ provider: f.value,
2069
+ locale: c.locale,
2022
2070
  mode: "folder",
2023
- destination: { key: r.value, selectDestination: y.sdk.selectDestination },
2024
- onAuthorized: J
2025
- }, null, 8, ["open", "provider", "locale", "destination"])) : m("", !0),
2026
- i.value && !o.value.length ? (t(), C("p", Ol, l(n.value.empty), 1)) : m("", !0),
2027
- _("ul", Rl, [
2028
- (t(!0), C(j, null, te(o.value, (d) => (t(), C("li", {
2029
- key: d.id
2071
+ destination: { key: r.value, selectDestination: c.sdk.selectDestination },
2072
+ onAuthorized: X
2073
+ }, null, 8, ["open", "provider", "locale", "destination"])) : b("", !0),
2074
+ o.value && !u.value.length ? (t(), $("p", at, l(n.value.empty), 1)) : b("", !0),
2075
+ h("ul", lt, [
2076
+ (t(!0), $(te, null, ce(u.value, (_) => (t(), $("li", {
2077
+ key: _.id
2030
2078
  }, [
2031
- _("div", null, [
2032
- _("strong", null, l(d.path), 1),
2033
- _("p", null, l(n.value.untilRevoked), 1)
2079
+ h("div", null, [
2080
+ h("strong", null, l(_.path), 1),
2081
+ h("p", null, l(n.value.untilRevoked), 1)
2034
2082
  ]),
2035
- b(e(z), {
2083
+ y(e(A), {
2036
2084
  variant: "secondary",
2037
- disabled: v.value,
2038
- onClick: (k) => K(d.id)
2085
+ disabled: d.value,
2086
+ onClick: (z) => H(_.id)
2039
2087
  }, {
2040
2088
  default: s(() => [
2041
- f(l(n.value.revoke), 1)
2089
+ k(l(n.value.revoke), 1)
2042
2090
  ]),
2043
2091
  _: 1
2044
2092
  }, 8, ["disabled", "onClick"])
2045
2093
  ]))), 128))
2046
2094
  ]),
2047
- c.value.some((d) => d.status === "active") ? (t(), C(j, { key: 13 }, [
2048
- _("p", null, l(n.value.exampleHelp), 1),
2049
- _("div", ql, [
2050
- (t(!0), C(j, null, te(c.value.filter((d) => d.status === "active"), (d) => (t(), g(e(z), {
2051
- key: d.key,
2095
+ C.value.some((_) => _.status === "active") ? (t(), $(te, { key: 13 }, [
2096
+ h("p", null, l(n.value.exampleHelp), 1),
2097
+ h("div", tt, [
2098
+ (t(!0), $(te, null, ce(C.value.filter((_) => _.status === "active"), (_) => (t(), w(e(A), {
2099
+ key: _.key,
2052
2100
  variant: "secondary",
2053
- disabled: v.value || i.value?.disabled,
2054
- onClick: (k) => O(d.key)
2101
+ disabled: d.value || o.value?.disabled,
2102
+ onClick: (z) => Q(_.key)
2055
2103
  }, {
2056
2104
  default: s(() => [
2057
- f(l(n.value.example) + " (" + l(d.key) + ")", 1)
2105
+ k(l(n.value.example) + " (" + l(_.key) + ")", 1)
2058
2106
  ]),
2059
2107
  _: 2
2060
2108
  }, 1032, ["disabled", "onClick"]))), 128))
2061
2109
  ])
2062
- ], 64)) : m("", !0),
2063
- _("h3", null, l(n.value.operations), 1),
2064
- i.value && !h.value.length ? (t(), C("p", Ll, l(n.value.noOperations), 1)) : m("", !0),
2065
- _("ul", Bl, [
2066
- (t(!0), C(j, null, te(h.value, (d) => (t(), C("li", {
2067
- key: d.job_id,
2068
- "data-job-id": d.job_id,
2069
- "data-save-state": P(d)
2110
+ ], 64)) : b("", !0),
2111
+ h("h3", null, l(n.value.operations), 1),
2112
+ o.value && !x.value.length ? (t(), $("p", nt, l(n.value.noOperations), 1)) : b("", !0),
2113
+ h("ul", st, [
2114
+ (t(!0), $(te, null, ce(x.value, (_) => (t(), $("li", {
2115
+ key: _.job_id,
2116
+ "data-job-id": _.job_id,
2117
+ "data-save-state": T(_)
2070
2118
  }, [
2071
- _("div", null, [
2072
- _("strong", null, l(d.name), 1),
2073
- _("p", null, l(n.value[P(d)]) + " · " + l(d.job_id), 1),
2074
- P(d) === "committed" ? (t(), C("p", Nl, l(d.receipt?.path), 1)) : m("", !0),
2075
- P(d) === "uncertain" ? (t(), g(e(Q), {
2119
+ h("div", null, [
2120
+ h("strong", null, l(_.name), 1),
2121
+ h("p", null, l(n.value[T(_)]) + " · " + l(_.job_id), 1),
2122
+ T(_) === "committed" ? (t(), $("p", ot, l(_.receipt?.path), 1)) : b("", !0),
2123
+ T(_) === "uncertain" ? (t(), w(e(W), {
2076
2124
  key: 1,
2077
2125
  tone: "warning",
2078
2126
  class: "save-message"
2079
2127
  }, {
2080
2128
  default: s(() => [
2081
- f(l(n.value.uncertainHelp), 1)
2129
+ k(l(n.value.uncertainHelp), 1)
2082
2130
  ]),
2083
2131
  _: 1
2084
- })) : P(d) === "interrupted" ? (t(), g(e(Q), {
2132
+ })) : T(_) === "interrupted" ? (t(), w(e(W), {
2085
2133
  key: 2,
2086
2134
  tone: "warning",
2087
2135
  class: "save-message"
2088
2136
  }, {
2089
2137
  default: s(() => [
2090
- f(l(n.value.interruptedHelp), 1)
2138
+ k(l(n.value.interruptedHelp), 1)
2091
2139
  ]),
2092
2140
  _: 1
2093
- })) : m("", !0),
2094
- d.code && !H(d) ? (t(), C("p", Ml, l(e(be)({ code: d.code }, n.value)), 1)) : m("", !0)
2141
+ })) : b("", !0),
2142
+ T(_) === "interrupted" && _.code ? (t(), $("p", ut, l(e(ze)({ code: _.code }, n.value)), 1)) : b("", !0)
2095
2143
  ]),
2096
- q(d) ? (t(), g(e(z), {
2144
+ q(_) ? (t(), w(e(A), {
2097
2145
  key: 0,
2098
2146
  variant: "secondary",
2099
- disabled: v.value,
2100
- onClick: (k) => W(d)
2147
+ disabled: d.value,
2148
+ onClick: (z) => ee(_)
2101
2149
  }, {
2102
2150
  default: s(() => [
2103
- f(l(n.value.cancel), 1)
2151
+ k(l(n.value.cancel), 1)
2104
2152
  ]),
2105
2153
  _: 1
2106
- }, 8, ["disabled", "onClick"])) : m("", !0)
2107
- ], 8, Fl))), 128))
2154
+ }, 8, ["disabled", "onClick"])) : b("", !0)
2155
+ ], 8, it))), 128))
2108
2156
  ])
2109
2157
  ]),
2110
2158
  _: 1
2111
2159
  }, 8, ["title", "aria-busy"]));
2112
2160
  }
2113
- }), ct = /* @__PURE__ */ ue(Hl, [["__scopeId", "data-v-c4022c90"]]), Kl = {
2114
- class: "authorization-announcement",
2115
- role: "status",
2116
- "aria-live": "polite",
2117
- "aria-atomic": "true"
2118
- }, Jl = ["aria-busy", "data-authorization-state"], Xl = {
2119
- class: "authorization-icon",
2120
- "aria-hidden": "true"
2121
- }, Gl = { class: "authorization-title" }, Ql = { class: "authorization-body" }, Yl = { class: "authorization-actions" }, Wl = {
2122
- key: 1,
2123
- class: "authorization-authorized"
2124
- }, Zl = { class: "authorization-ready" }, jl = /* @__PURE__ */ ae({
2161
+ }), Dt = /* @__PURE__ */ oe(rt, [["__scopeId", "data-v-c38db985"]]), Ke = /* @__PURE__ */ Symbol("authorization");
2162
+ function dt() {
2163
+ const c = Oe(Ke, void 0);
2164
+ if (!c) throw Error("authorization controls must be placed inside AuthorizationGate");
2165
+ return c;
2166
+ }
2167
+ const vt = { class: "authorization-content" }, ct = ["aria-busy", "data-authorization-state"], ft = { class: "authorization-body" }, pt = /* @__PURE__ */ se({
2125
2168
  __name: "AuthorizationGate",
2126
2169
  props: {
2127
2170
  ctx: {},
2128
2171
  name: {}
2129
2172
  },
2130
2173
  emits: ["ready"],
2131
- setup(y, { emit: D }) {
2132
- const a = y, $ = D, u = p(), r = p(), n = p(!1), i = p(!1), o = p(!1);
2133
- let h = !1, v = 0, w = !1, U;
2134
- const c = N(() => Me(a.ctx.locale, a.name ?? a.ctx.displayName ?? "")), V = N(() => u.value?.state === "ready"), S = N(() => u.value || r.value), E = N(() => S.value?.state === "authorization_required"), H = N(() => ["helper_untrusted", "cli_untrusted"].includes(S.value?.reason || "")), P = N(() => E.value && !H.value), q = N(() => S.value?.reason === "credential_not_ready" ? "credential" : "unavailable"), Y = N(() => S.value ? E.value ? c.value("title") : S.value.state === "ready" ? c.value("ready") : S.value.state === "not_admin" ? c.value("not_admin.title") : S.value.state === "session_expired" ? c.value("session_expired.title") : c.value(q.value + ".title") : c.value("checking")), X = N(() => E.value ? c.value("purpose") : S.value?.state === "not_admin" ? c.value("not_admin.body") : S.value?.state === "session_expired" ? c.value("session_expired.body") : S.value?.state === "unavailable" ? c.value(q.value + ".body") : c.value("purpose")), F = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], L = N(() => F.includes(S.value?.reason || "") ? S.value.reason : "unknown"), J = N(() => H.value ? "next.reinstall" : L.value === "grant_missing" ? "next.install" : L.value === "upgrade_reapproval" || L.value === "grant_incompatible" ? "next.update" : "next.repair");
2135
- async function K(W) {
2136
- if (n.value || h) return;
2137
- const R = ++v;
2138
- r.value = W === "request" && u.value?.state === "authorization_required" ? u.value : void 0, n.value = !0, i.value = !1, u.value = void 0;
2174
+ setup(c, { emit: S }) {
2175
+ const a = c, m = S, i = v(), r = v(), n = v(!1), o = v(!1), u = v(!1);
2176
+ let x = [], d = !1, p = 0, V = !1, C;
2177
+ const f = N(() => ea(a.ctx.locale, a.name ?? a.ctx.displayName ?? "")), P = N(() => i.value || r.value), R = N(() => P.value?.state === "authorization_required"), K = N(() => ["helper_untrusted", "cli_untrusted"].includes(P.value?.reason || "")), T = N(() => R.value && !K.value), q = N(() => P.value?.reason === "credential_not_ready" ? "credential" : "unavailable"), j = N(() => P.value ? R.value ? f.value("title") : P.value.state === "ready" ? f.value("ready") : P.value.state === "not_admin" ? f.value("not_admin.title") : P.value.state === "session_expired" ? f.value("session_expired.title") : f.value(q.value + ".title") : f.value("checking")), Y = N(() => R.value ? f.value("purpose") : P.value?.state === "not_admin" ? f.value("not_admin.body") : P.value?.state === "session_expired" ? f.value("session_expired.body") : P.value?.state === "unavailable" ? f.value(q.value + ".body") : f.value("purpose")), J = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], L = N(() => J.includes(P.value?.reason || "") ? P.value.reason : "unknown"), X = N(() => K.value ? "next.reinstall" : L.value === "grant_missing" ? "next.install" : L.value === "upgrade_reapproval" || L.value === "grant_incompatible" ? "next.update" : "next.repair");
2178
+ function H(z) {
2179
+ if (!z || z.command !== "authorization" || z.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(z.state) || z.reason === "upgrade_reapproval" && z.state !== "authorization_required") throw Error("invalid status");
2180
+ return z;
2181
+ }
2182
+ const ee = [1e3, 3e3];
2183
+ async function ae(z) {
2184
+ const G = z === "status" && !u.value ? ee : [];
2185
+ for (let Z = 0; ; Z++) {
2186
+ try {
2187
+ const le = H(await a.ctx.authorization?.[z]());
2188
+ if (le.state !== "unavailable" || Z >= G.length) return le;
2189
+ } catch (le) {
2190
+ if (le.code === "session_required" || Z >= G.length) throw le;
2191
+ }
2192
+ if (await new Promise((le) => setTimeout(le, G[Z])), d) throw Error("disposed");
2193
+ }
2194
+ }
2195
+ async function Q(z) {
2196
+ if (n.value || d) return;
2197
+ const G = ++p;
2198
+ r.value = z === "request" && i.value?.state === "authorization_required" ? i.value : void 0, n.value = !0, o.value = !1, i.value = void 0;
2139
2199
  try {
2140
- const O = await a.ctx.authorization?.[W]();
2141
- if (h || R !== v) return;
2142
- if (!O || O.command !== "authorization" || O.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(O.state) || O.reason === "upgrade_reapproval" && O.state !== "authorization_required") throw Error("invalid status");
2143
- u.value = O, O.state === "ready" && $("ready");
2144
- } catch (O) {
2145
- !h && R === v && (u.value = O.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : r.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: "service_unavailable" }, i.value = !0);
2200
+ const Z = await ae(z);
2201
+ if (d || G !== p) return;
2202
+ i.value = Z, u.value = Z.state !== "ready", Z.state === "ready" && E(!0), Z.state === "ready" && m("ready");
2203
+ } catch (Z) {
2204
+ !d && G === p && (i.value = Z.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : r.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: "service_unavailable" }, o.value = !0, u.value = !0);
2146
2205
  } finally {
2147
- !h && R === v && (n.value = !1, r.value = void 0, w && (w = !1, K("status")));
2206
+ !d && G === p && (n.value = !1, r.value = void 0, V && (V = !1, Q("status")));
2148
2207
  }
2149
2208
  }
2150
- return ie(() => {
2151
- U = a.ctx.reopen(() => {
2152
- n.value ? w = !0 : K("status");
2153
- }), K("status");
2154
- }), ze(() => {
2155
- h = !0, v++, typeof U == "function" && U();
2156
- }), (W, R) => (t(), C(j, null, [
2157
- _("p", Kl, l(n.value ? c.value("authorizing") : Y.value), 1),
2158
- V.value ? (t(), C("div", Wl, [
2159
- _("div", Zl, [
2160
- b(e(he), {
2161
- size: 16,
2162
- "aria-hidden": "true"
2163
- }),
2164
- _("span", null, l(c.value("ready")), 1),
2165
- y.ctx.authorization?.canManage?.() ? (t(), g(e(z), {
2209
+ function E(z) {
2210
+ const G = x;
2211
+ x = [], G.forEach((Z) => Z(z));
2212
+ }
2213
+ function B(z) {
2214
+ u.value = z, z || E(!1);
2215
+ }
2216
+ function _() {
2217
+ return i.value?.state === "ready" ? Promise.resolve(!0) : (n.value || (u.value = !0), new Promise((z) => x.push(z)));
2218
+ }
2219
+ return ta(Ke, { state: N(() => i.value?.state ?? "checking"), requireAuthorization: _, text: f, busy: n, canManage: () => !!a.ctx.authorization?.canManage?.(), revoke: () => Q("revoke") }), fe(() => {
2220
+ C = a.ctx.reopen(() => {
2221
+ n.value ? V = !0 : Q("status");
2222
+ }), Q("status");
2223
+ }), Le(() => {
2224
+ d = !0, p++, E(!1), typeof C == "function" && C();
2225
+ }), (z, G) => (t(), $(te, null, [
2226
+ h("div", vt, [
2227
+ Ve(z.$slots, "default", {}, void 0, !0)
2228
+ ]),
2229
+ y(e(Pe), {
2230
+ open: u.value,
2231
+ title: j.value,
2232
+ width: "480px",
2233
+ "onUpdate:open": B
2234
+ }, {
2235
+ footer: s(() => [
2236
+ T.value ? (t(), w(e(A), {
2166
2237
  key: 0,
2167
- variant: "secondary",
2238
+ variant: "primary",
2239
+ loading: n.value,
2168
2240
  disabled: n.value,
2169
- onClick: R[2] || (R[2] = (O) => o.value = !0)
2241
+ onClick: G[0] || (G[0] = (Z) => Q("request"))
2170
2242
  }, {
2171
2243
  default: s(() => [
2172
- f(l(c.value("revoke")), 1)
2244
+ k(l(n.value ? f.value("authorizing") : f.value("authorize")), 1)
2173
2245
  ]),
2174
2246
  _: 1
2175
- }, 8, ["disabled"])) : m("", !0)
2176
- ]),
2177
- ke(W.$slots, "default", {}, void 0, !0)
2178
- ])) : (t(), C("div", {
2179
- key: 0,
2180
- class: "authorization-view",
2181
- "aria-busy": n.value,
2182
- "data-authorization-state": u.value?.state || "checking"
2183
- }, [
2184
- b(e(aa), {
2185
- class: "authorization-card",
2186
- padding: "lg",
2187
- raised: "",
2188
- "aria-label": Y.value
2189
- }, {
2190
- default: s(() => [
2191
- _("span", Xl, [
2192
- (t(), g(Je(S.value?.state === "unavailable" || S.value?.state === "session_expired" ? e(sa) : e(he)), { class: "authorization-icon-glyph" }))
2247
+ }, 8, ["loading", "disabled"])) : (t(), w(e(A), {
2248
+ key: 1,
2249
+ variant: "primary",
2250
+ loading: n.value,
2251
+ disabled: n.value,
2252
+ onClick: G[1] || (G[1] = (Z) => Q("status"))
2253
+ }, {
2254
+ default: s(() => [
2255
+ k(l(n.value ? f.value("checking") : f.value("retry")), 1)
2193
2256
  ]),
2194
- _("h1", Gl, l(Y.value), 1),
2195
- _("p", Ql, l(X.value), 1),
2196
- E.value ? (t(), g(e(Q), {
2257
+ _: 1
2258
+ }, 8, ["loading", "disabled"]))
2259
+ ]),
2260
+ default: s(() => [
2261
+ h("div", {
2262
+ class: "authorization-view",
2263
+ "aria-busy": n.value,
2264
+ "data-authorization-state": i.value?.state || "checking"
2265
+ }, [
2266
+ h("p", ft, l(Y.value), 1),
2267
+ R.value ? (t(), w(e(W), {
2197
2268
  key: 0,
2198
2269
  class: "authorization-status",
2199
2270
  tone: ["grant_missing", "upgrade_reapproval"].includes(L.value) ? "info" : "warning",
2200
- title: c.value("reason." + L.value)
2271
+ title: f.value("reason." + L.value)
2201
2272
  }, {
2202
2273
  default: s(() => [
2203
- f(l(c.value(J.value)), 1)
2274
+ k(l(f.value(X.value)), 1)
2204
2275
  ]),
2205
2276
  _: 1
2206
- }, 8, ["tone", "title"])) : m("", !0),
2207
- i.value ? (t(), g(e(Q), {
2277
+ }, 8, ["tone", "title"])) : b("", !0),
2278
+ o.value ? (t(), w(e(W), {
2208
2279
  key: 1,
2209
2280
  class: "authorization-failed",
2210
2281
  tone: "warning"
2211
2282
  }, {
2212
2283
  default: s(() => [
2213
- f(l(c.value("failed")), 1)
2284
+ k(l(f.value("failed")), 1)
2214
2285
  ]),
2215
2286
  _: 1
2216
- })) : m("", !0),
2217
- _("div", Yl, [
2218
- P.value ? (t(), g(e(z), {
2219
- key: 0,
2220
- variant: "primary",
2221
- loading: n.value,
2222
- disabled: n.value,
2223
- onClick: R[0] || (R[0] = (O) => K("request"))
2224
- }, {
2225
- default: s(() => [
2226
- f(l(n.value ? c.value("authorizing") : c.value("authorize")), 1)
2227
- ]),
2228
- _: 1
2229
- }, 8, ["loading", "disabled"])) : (t(), g(e(z), {
2230
- key: 1,
2231
- variant: "primary",
2232
- loading: n.value,
2233
- disabled: n.value,
2234
- onClick: R[1] || (R[1] = (O) => K("status"))
2235
- }, {
2236
- default: s(() => [
2237
- f(l(n.value ? c.value("checking") : c.value("retry")), 1)
2287
+ })) : b("", !0)
2288
+ ], 8, ct)
2289
+ ]),
2290
+ _: 1
2291
+ }, 8, ["open", "title"])
2292
+ ], 64));
2293
+ }
2294
+ }), It = /* @__PURE__ */ oe(pt, [["__scopeId", "data-v-e16b5f7d"]]), yt = { class: "authorization-setting" }, mt = {
2295
+ class: "authorization-state",
2296
+ role: "status"
2297
+ }, bt = { class: "authorization-revoke-body" }, kt = /* @__PURE__ */ se({
2298
+ __name: "AuthorizationSettings",
2299
+ setup(c) {
2300
+ const { state: S, requireAuthorization: a, text: m, busy: i, canManage: r, revoke: n } = dt(), o = v(!1), u = { checking: "checking", ready: "ready", authorization_required: "state.required", not_admin: "not_admin.title", session_expired: "session_expired.title", unavailable: "state.unavailable" };
2301
+ return (x, d) => (t(), $(te, null, [
2302
+ y(e(pe), {
2303
+ title: e(m)("settings.title"),
2304
+ collapsible: !1
2305
+ }, {
2306
+ default: s(() => [
2307
+ y(e(fa), {
2308
+ label: e(m)("settings.status"),
2309
+ description: e(m)("purpose"),
2310
+ align: "center"
2311
+ }, {
2312
+ default: s(() => [
2313
+ h("div", yt, [
2314
+ h("span", mt, [
2315
+ e(S) === "ready" ? (t(), w(e(ga), {
2316
+ key: 0,
2317
+ size: 16,
2318
+ "aria-hidden": "true"
2319
+ })) : b("", !0),
2320
+ k(l(e(m)(u[e(S)])), 1)
2238
2321
  ]),
2239
- _: 1
2240
- }, 8, ["loading", "disabled"]))
2241
- ])
2242
- ]),
2243
- _: 1
2244
- }, 8, ["aria-label"])
2245
- ], 8, Jl)),
2246
- b(e(Ve), {
2322
+ e(S) === "ready" && e(r)() ? (t(), w(e(A), {
2323
+ key: 0,
2324
+ variant: "secondary",
2325
+ disabled: e(i),
2326
+ onClick: d[0] || (d[0] = (p) => o.value = !0)
2327
+ }, {
2328
+ default: s(() => [
2329
+ k(l(e(m)("revoke")), 1)
2330
+ ]),
2331
+ _: 1
2332
+ }, 8, ["disabled"])) : e(S) !== "ready" && e(S) !== "checking" ? (t(), w(e(A), {
2333
+ key: 1,
2334
+ variant: "secondary",
2335
+ onClick: d[1] || (d[1] = (p) => e(a)())
2336
+ }, {
2337
+ default: s(() => [
2338
+ k(l(e(m)("settings.details")), 1)
2339
+ ]),
2340
+ _: 1
2341
+ })) : b("", !0)
2342
+ ])
2343
+ ]),
2344
+ _: 1
2345
+ }, 8, ["label", "description"])
2346
+ ]),
2347
+ _: 1
2348
+ }, 8, ["title"]),
2349
+ y(e(Pe), {
2247
2350
  open: o.value,
2248
- "onUpdate:open": R[5] || (R[5] = (O) => o.value = O),
2249
- title: c.value("revoke.title"),
2250
- description: c.value("revoke.body")
2351
+ "onUpdate:open": d[4] || (d[4] = (p) => o.value = p),
2352
+ title: e(m)("revoke.title"),
2353
+ width: "480px"
2251
2354
  }, {
2252
2355
  footer: s(() => [
2253
- b(e(z), {
2356
+ y(e(A), {
2254
2357
  variant: "secondary",
2255
- onClick: R[3] || (R[3] = (O) => o.value = !1)
2358
+ onClick: d[2] || (d[2] = (p) => o.value = !1)
2256
2359
  }, {
2257
2360
  default: s(() => [
2258
- f(l(c.value("cancel")), 1)
2361
+ k(l(e(m)("cancel")), 1)
2259
2362
  ]),
2260
2363
  _: 1
2261
2364
  }),
2262
- b(e(z), {
2365
+ y(e(A), {
2263
2366
  variant: "danger",
2264
- disabled: n.value,
2265
- onClick: R[4] || (R[4] = (O) => {
2266
- o.value = !1, K("revoke");
2367
+ disabled: e(i),
2368
+ onClick: d[3] || (d[3] = (p) => {
2369
+ o.value = !1, e(n)();
2267
2370
  })
2268
2371
  }, {
2269
2372
  default: s(() => [
2270
- f(l(c.value("revoke")), 1)
2373
+ k(l(e(m)("revoke")), 1)
2271
2374
  ]),
2272
2375
  _: 1
2273
2376
  }, 8, ["disabled"])
2274
2377
  ]),
2378
+ default: s(() => [
2379
+ h("p", bt, l(e(m)("revoke.body")), 1)
2380
+ ]),
2275
2381
  _: 1
2276
- }, 8, ["open", "title", "description"])
2382
+ }, 8, ["open", "title"])
2277
2383
  ], 64));
2278
2384
  }
2279
- }), pt = /* @__PURE__ */ ue(jl, [["__scopeId", "data-v-c8a34087"]]);
2385
+ }), At = /* @__PURE__ */ oe(kt, [["__scopeId", "data-v-f031e7c7"]]);
2280
2386
  export {
2281
- st as AppShell,
2282
- pt as AuthorizationGate,
2283
- rt as BackgroundPanel,
2284
- ct as BackgroundSavePanel,
2285
- vt as DelegatePanel,
2286
- dt as ExecutorSettings,
2287
- ua as ExecutorSetupKey,
2288
- De as FileBrowser,
2289
- ut as FilesPage,
2290
- ot as LoginPage,
2291
- ye as NasPicker,
2292
- it as PortalSettings,
2293
- mt as activePage,
2294
- bt as authorizationCatalogs,
2295
- Me as authorizationCopy,
2296
- kt as backgroundCatalogs,
2297
- qe as backgroundCopy,
2298
- Be as backgroundErrorCopy,
2299
- _t as catalogs,
2300
- Le as createBackgroundPickerProvider,
2301
- gt as createBackgroundSaveFacade,
2302
- ht as createFileTransfers,
2303
- $e as createNasProvider,
2304
- nt as createSession,
2305
- wt as decodeResponse,
2306
- Ct as delegateCatalogs,
2307
- xe as delegateCopy,
2308
- $t as encodeRequest,
2309
- Fe as errorCopy,
2310
- ve as format,
2311
- xt as identityCatalogs,
2312
- Re as identityCopy,
2313
- St as nasCatalogs,
2314
- oe as nasCopy,
2315
- we as nasErrorCopy,
2316
- zt as protocolCodes,
2317
- Vt as protocolOps,
2318
- Pt as protocolSchemas,
2319
- _e as requestKey,
2320
- Ut as saveCatalogs,
2321
- Ce as saveCopy,
2322
- be as saveError,
2323
- Ne as scopedPicker,
2324
- Dt as shellCatalogs,
2325
- Oe as shellCopy,
2326
- At as shellPages,
2327
- Et as uiLocale,
2328
- Tt as uiLocales,
2329
- ia as useExecutorSetup,
2330
- oa as useNasRequest
2387
+ $t as AppShell,
2388
+ It as AuthorizationGate,
2389
+ At as AuthorizationSettings,
2390
+ Vt as BackgroundPanel,
2391
+ Dt as BackgroundSavePanel,
2392
+ Ut as DelegatePanel,
2393
+ Pt as ExecutorSettings,
2394
+ wa as ExecutorSetupKey,
2395
+ Me as FileBrowser,
2396
+ xt as FilesPage,
2397
+ zt as LoginPage,
2398
+ we as NasPicker,
2399
+ St as PortalSettings,
2400
+ Tt as activePage,
2401
+ qt as authorizationCatalogs,
2402
+ ea as authorizationCopy,
2403
+ Ot as backgroundCatalogs,
2404
+ Qe as backgroundCopy,
2405
+ We as backgroundErrorCopy,
2406
+ Bt as catalogs,
2407
+ Ye as createBackgroundPickerProvider,
2408
+ Lt as createBackgroundSaveFacade,
2409
+ Ft as createFileTransfers,
2410
+ Te as createNasProvider,
2411
+ Ct as createSession,
2412
+ Nt as decodeResponse,
2413
+ Mt as delegateCatalogs,
2414
+ qe as delegateCopy,
2415
+ Kt as encodeRequest,
2416
+ Ze as errorCopy,
2417
+ Ue as format,
2418
+ Ht as identityCatalogs,
2419
+ Xe as identityCopy,
2420
+ Gt as nasCatalogs,
2421
+ ve as nasCopy,
2422
+ Ee as nasErrorCopy,
2423
+ Jt as protocolCodes,
2424
+ Xt as protocolOps,
2425
+ Qt as protocolSchemas,
2426
+ De as requestKey,
2427
+ Yt as saveCatalogs,
2428
+ Re as saveCopy,
2429
+ ze as saveError,
2430
+ je as scopedPicker,
2431
+ Wt as shellCatalogs,
2432
+ Ge as shellCopy,
2433
+ Zt as shellPages,
2434
+ Je as uiLocale,
2435
+ jt as uiLocales,
2436
+ dt as useAuthorization,
2437
+ Ca as useExecutorSetup,
2438
+ $a as useNasRequest
2331
2439
  };