@synopackageland/sdk 0.9.7 → 0.9.9

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