@synopackageland/sdk 0.9.4 → 0.9.6

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