@av-pi-studio/workbench 0.0.123 → 0.0.124

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 (62) hide show
  1. package/README.md +16 -4
  2. package/dist/chunks/{BinaryFallbackViewer-EznEIpRC.js → BinaryFallbackViewer-ua5VmtNP.js} +1 -1
  3. package/dist/chunks/{ChatPanel-DgJlK-yP.js → ChatPanel-9mV7jLOD.js} +3 -3
  4. package/dist/chunks/{CodeView-klpk8qD0.js → CodeView--Yo9YYpl.js} +2 -2
  5. package/dist/chunks/{FilePanel-Beg5Fs8X.js → FilePanel-CBNc1csX.js} +2 -2
  6. package/dist/chunks/HtmlViewer-BjvrS29T.js +539 -0
  7. package/dist/chunks/{ImageViewer-BLrsKWwI.js → ImageViewer-DQFVe58O.js} +1 -1
  8. package/dist/chunks/{MarkdownFileViewer-DxJJlrsv.js → MarkdownFileViewer-BEaGxGyd.js} +4 -4
  9. package/dist/chunks/{ModelProvidersPanel-C3TXoq1L.js → ModelProvidersPanel-CUdM6FMu.js} +2 -2
  10. package/dist/chunks/{MoleculeViewerPanel-BAWs5F2j.js → MoleculeViewerPanel-DhkadYBP.js} +3 -3
  11. package/dist/chunks/{PdfViewer-B_kiY-Tw.js → PdfViewer-PKAEVwco.js} +2 -2
  12. package/dist/chunks/{SaveFileButton-Bsz3wG4a.js → SaveFileButton-qwf_ewMX.js} +1 -1
  13. package/dist/chunks/SettingsDialog-ChDFOPih.js +454 -0
  14. package/dist/chunks/{SkillsPanel-BB5_yrcx.js → SkillsPanel-DP72YesV.js} +1 -1
  15. package/dist/chunks/{TerminalPanel-DgH4re05.js → TerminalPanel-BKnfLGNl.js} +1 -1
  16. package/dist/chunks/{TextViewer-BiwFYLLc.js → TextViewer-ZT99BjEP.js} +2 -2
  17. package/dist/chunks/{VideoViewer-BSGjTTQR.js → VideoViewer-C_gj8A0b.js} +1 -1
  18. package/dist/chunks/{ViewersPanel-BYHmKfOh.js → ViewersPanel-CTRov7NQ.js} +1 -1
  19. package/dist/chunks/external-link-BsgjS-QP.js +24 -0
  20. package/dist/chunks/{href-resolution-AtzN0oCd.js → href-resolution-AG-Co7Sm.js} +1 -1
  21. package/dist/chunks/index-CitLJdIo.js +7415 -0
  22. package/dist/chunks/{markdown-CypQ7TkY.js → markdown-CVWWeRbe.js} +97 -90
  23. package/dist/chunks/{use-file-download-zheHRdGQ.js → use-file-download-DbQCEsRG.js} +1 -1
  24. package/dist/chunks/{use-file-watch-CyVeSj2A.js → use-file-watch-CrgiCMCF.js} +1 -1
  25. package/dist/chunks/{use-provider-auth-list-jNjjSAD_.js → use-provider-auth-list-Bcdz9-zE.js} +1 -1
  26. package/dist/features/connection/ConnectionBar.d.ts +4 -0
  27. package/dist/features/connection/DaemonSwitcher.d.ts +16 -0
  28. package/dist/features/connection/daemon-switcher-presentation.d.ts +69 -0
  29. package/dist/features/connection/outdated-daemon.d.ts +17 -0
  30. package/dist/features/connection/use-outdated-daemon-notice.d.ts +26 -0
  31. package/dist/features/daemons/DaemonForm.d.ts +18 -0
  32. package/dist/features/daemons/DaemonsScreen.d.ts +17 -0
  33. package/dist/features/daemons/connect-current.d.ts +19 -0
  34. package/dist/features/daemons/daemon-form-actions.d.ts +27 -0
  35. package/dist/features/daemons/daemon-form.d.ts +103 -0
  36. package/dist/features/daemons/daemon-lifecycle.d.ts +58 -0
  37. package/dist/features/daemons/daemon-presentation.d.ts +46 -0
  38. package/dist/features/daemons/daemons-screen-actions.d.ts +37 -0
  39. package/dist/features/daemons/daemons-screen-view.d.ts +62 -0
  40. package/dist/features/daemons/daemons-store.d.ts +30 -0
  41. package/dist/features/daemons/use-daemon-lifecycle.d.ts +3 -0
  42. package/dist/features/daemons/use-daemons.d.ts +8 -0
  43. package/dist/features/files/preview-mounts.d.ts +25 -0
  44. package/dist/features/sessions/RenameSessionDialog.d.ts +8 -0
  45. package/dist/features/sessions/rename-title.d.ts +6 -0
  46. package/dist/features/sessions/session-actions.d.ts +6 -5
  47. package/dist/hooks/use-connection.d.ts +17 -5
  48. package/dist/host/browser-files.d.ts +2 -2
  49. package/dist/host/browser-host.d.ts +6 -1
  50. package/dist/host/types.d.ts +149 -2
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js +1 -1
  53. package/dist/lib/connection/connect-failure.d.ts +14 -0
  54. package/dist/lib/connection/connection-store.d.ts +7 -1
  55. package/dist/stores/session-rename-store.d.ts +13 -0
  56. package/dist/styles.css +1 -1
  57. package/dist/timeline/FileLink.d.ts +4 -2
  58. package/dist/timeline/external-href.d.ts +9 -0
  59. package/package.json +4 -4
  60. package/dist/chunks/HtmlViewer-KGQcSEm3.js +0 -490
  61. package/dist/chunks/SettingsDialog-AHnoT7nN.js +0 -471
  62. package/dist/chunks/index-QzeFcHmH.js +0 -6261
@@ -1,11 +1,11 @@
1
1
  import { jsx as s, jsxs as v } from "react/jsx-runtime";
2
- import { u as U, O as W, m as j, P as k, Q as X, R as q, T as Y, U as z, v as D } from "./index-QzeFcHmH.js";
2
+ import { u as U, O as W, m as j, P as k, Q as X, R as q, T as Y, U as z, v as D } from "./index-CitLJdIo.js";
3
3
  import { Panel as h, EmptyState as N, Spinner as G, StatusBadge as w } from "@av-pi-studio/ui-library";
4
4
  import { useRef as M, useState as m, useMemo as H, useEffect as Q } from "react";
5
5
  import { MolViewer as J } from "@molviewer/core";
6
6
  import "@molviewer/core/style.css";
7
- import { u as K } from "./use-file-download-zheHRdGQ.js";
8
- import { u as Z } from "./use-file-watch-CyVeSj2A.js";
7
+ import { u as K } from "./use-file-download-DbQCEsRG.js";
8
+ import { u as Z } from "./use-file-watch-CrgiCMCF.js";
9
9
  function ee(e, r) {
10
10
  return !e || !r ? null : { url: r, name: e.split("/").pop() || e };
11
11
  }
@@ -2,8 +2,8 @@ import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as w, useEffect as x, useMemo as V, useRef as W, useLayoutEffect as te } from "react";
3
3
  import { ZoomOut as re, ZoomIn as ne, MoveHorizontal as oe, Download as ae } from "lucide-react";
4
4
  import { EmptyState as O, Button as y, Spinner as se } from "@av-pi-studio/ui-library";
5
- import { g as Z, O as ie } from "./index-QzeFcHmH.js";
6
- import { u as ce } from "./use-file-download-zheHRdGQ.js";
5
+ import { g as Z, O as ie } from "./index-CitLJdIo.js";
6
+ import { u as ce } from "./use-file-download-DbQCEsRG.js";
7
7
  import * as j from "pdfjs-dist";
8
8
  class H extends Error {
9
9
  name = "PdfUnavailableError";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as o, Fragment as m, jsx as i } from "react/jsx-runtime";
2
2
  import { useState as a, useRef as d, useEffect as v } from "react";
3
3
  import { Spinner as p, Button as S } from "@av-pi-studio/ui-library";
4
- import { O as g } from "./index-QzeFcHmH.js";
4
+ import { O as g } from "./index-CitLJdIo.js";
5
5
  function y({ path: f }) {
6
6
  const { saveToDisk: c } = g(), [l, e] = a(!1), [n, t] = a(null), r = d(!0);
7
7
  v(
@@ -0,0 +1,454 @@
1
+ import { jsx as o, jsxs as a, Fragment as x } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as w, useCallback as V, useReducer as X, useRef as k, Suspense as J } from "react";
3
+ import { clsx as W } from "clsx";
4
+ import { Dialog as K, Button as y, Spinner as E, TextInput as ee, IconButton as ne, Icon as oe, EmptyState as T } from "@av-pi-studio/ui-library";
5
+ import { u as q, r as Q, g as te, b as ie, S as re } from "./index-CitLJdIo.js";
6
+ import { useQueryClient as se } from "@tanstack/react-query";
7
+ import { ExternalLink as B, Check as ae, Copy as ce } from "lucide-react";
8
+ import { E as P } from "./external-link-BsgjS-QP.js";
9
+ import le from "qrcode";
10
+ import { u as L } from "./provider-auth-store-C1GaLTlw.js";
11
+ function ue(e, n) {
12
+ return {
13
+ provider: e,
14
+ authType: n,
15
+ phase: "starting",
16
+ statusLines: []
17
+ };
18
+ }
19
+ function pe(e, n, t) {
20
+ return {
21
+ ...e,
22
+ phase: e.phase === "starting" ? "waiting" : e.phase,
23
+ statusLines: [...e.statusLines, { kind: "info", message: n, links: t }]
24
+ };
25
+ }
26
+ function de(e, n) {
27
+ const t = e.statusLines.filter((s) => s.kind !== "progress");
28
+ return {
29
+ ...e,
30
+ phase: e.phase === "starting" ? "waiting" : e.phase,
31
+ statusLines: [...t, { kind: "progress", message: n }]
32
+ };
33
+ }
34
+ function ge(e, n, t) {
35
+ return { ...e, authUrl: { url: n, instructions: t } };
36
+ }
37
+ function he(e, n, t, s, d) {
38
+ return { ...e, deviceCode: { userCode: n, verificationUri: t, intervalSeconds: s, expiresInSeconds: d } };
39
+ }
40
+ function me(e, n) {
41
+ return { ...e, phase: "prompt", prompt: n };
42
+ }
43
+ function fe(e, n) {
44
+ return e.prompt?.promptId !== n ? e : { ...e, phase: "waiting", prompt: void 0 };
45
+ }
46
+ function _e(e, n, t) {
47
+ return { ...e, phase: "done", result: { ok: n, error: t } };
48
+ }
49
+ function ve(e, n) {
50
+ if (e.phase === "done") return e;
51
+ switch (n.kind) {
52
+ case "info":
53
+ return pe(e, n.message, n.links);
54
+ case "progress":
55
+ return de(e, n.message);
56
+ case "auth_url":
57
+ return ge(e, n.url, n.instructions);
58
+ case "device_code":
59
+ return he(
60
+ e,
61
+ n.userCode,
62
+ n.verificationUri,
63
+ n.intervalSeconds,
64
+ n.expiresInSeconds
65
+ );
66
+ case "prompt":
67
+ return me(e, n);
68
+ case "prompt_cancelled":
69
+ return fe(e, n.promptId);
70
+ case "done":
71
+ return _e(e, n.ok, n.error);
72
+ }
73
+ }
74
+ const be = "piwb-QrCode_qr_URoLM", Le = "piwb-QrCode_placeholder_TxqZK", U = {
75
+ qr: be,
76
+ placeholder: Le
77
+ }, we = 320;
78
+ function O({ value: e, label: n }) {
79
+ const [t, s] = f(null), [d, c] = f(!1);
80
+ return w(() => {
81
+ let p = !0;
82
+ return s(null), c(!1), le.toDataURL(e, { width: we, margin: 1, errorCorrectionLevel: "M" }).then((g) => {
83
+ p && s(g);
84
+ }).catch(() => {
85
+ p && c(!0);
86
+ }), () => {
87
+ p = !1;
88
+ };
89
+ }, [e]), d ? null : t ? /* @__PURE__ */ o("img", { className: U.qr, src: t, alt: n }) : /* @__PURE__ */ o("div", { className: U.placeholder, "aria-hidden": "true" });
90
+ }
91
+ const Ce = "piwb-LoginDialog_body_GIlGl", De = "piwb-LoginDialog_status_rqfrD", Se = "piwb-LoginDialog_statusLine_Hh0Xn", Ne = "piwb-LoginDialog_statusLineProgress_khvrx", Ie = "piwb-LoginDialog_statusText_m5xDP", ye = "piwb-LoginDialog_prompt__-xfG", ke = "piwb-LoginDialog_promptMessage_DY8Sq", xe = "piwb-LoginDialog_options_yZXpb", Ee = "piwb-LoginDialog_option_ZdMmQ", Pe = "piwb-LoginDialog_optionLabel__CA8q", Ae = "piwb-LoginDialog_optionDescription_ha4A3", Me = "piwb-LoginDialog_success_zLKu2", Re = "piwb-LoginDialog_error_SAY5b", Te = "piwb-LoginDialog_oauth_kwBPZ", Qe = "piwb-LoginDialog_oauthInstructions_qewUJ", Ue = "piwb-LoginDialog_oauthMain_jEuW3", Ke = "piwb-LoginDialog_oauthActions_NC3y_", qe = "piwb-LoginDialog_openButton_iwdTY", Be = "piwb-LoginDialog_urlRow_jEnPI", Oe = "piwb-LoginDialog_oauthUrl_cCSag", ze = "piwb-LoginDialog_oauthQr_v6BwP", Fe = "piwb-LoginDialog_oauthQrCaption_Mc-ho", $e = "piwb-LoginDialog_deviceCode__RauS", je = "piwb-LoginDialog_countdown_gYTuP", i = {
92
+ body: Ce,
93
+ status: De,
94
+ statusLine: Se,
95
+ statusLineProgress: Ne,
96
+ statusText: Ie,
97
+ prompt: ye,
98
+ promptMessage: ke,
99
+ options: xe,
100
+ option: Ee,
101
+ optionLabel: Pe,
102
+ optionDescription: Ae,
103
+ success: Me,
104
+ error: Re,
105
+ oauth: Te,
106
+ oauthInstructions: Qe,
107
+ oauthMain: Ue,
108
+ oauthActions: Ke,
109
+ openButton: qe,
110
+ urlRow: Be,
111
+ oauthUrl: Oe,
112
+ oauthQr: ze,
113
+ oauthQrCaption: Fe,
114
+ deviceCode: $e,
115
+ countdown: je
116
+ }, Ge = 1200, z = "provider-auth-prompt-form";
117
+ function Ye() {
118
+ const e = L((g) => g.pendingLogin), n = L((g) => g.cancelLogin), t = L((g) => g.clearLogin), s = L((g) => g.retryLogin), d = q((g) => g.client), c = se(), p = V(() => {
119
+ c.invalidateQueries({ queryKey: Q.providerAuthList() }), c.invalidateQueries({ queryKey: Q.providerModelsAll() });
120
+ }, [c]);
121
+ return !e || !d ? null : /* @__PURE__ */ o(
122
+ Ze,
123
+ {
124
+ provider: e.provider,
125
+ providerName: e.providerName,
126
+ authType: e.authType,
127
+ controller: e.controller,
128
+ client: d,
129
+ onCancel: n,
130
+ onClear: t,
131
+ onRetry: s,
132
+ onSuccess: p
133
+ },
134
+ `${e.provider}:${e.authType}:${e.attempt}`
135
+ );
136
+ }
137
+ function Ze({
138
+ provider: e,
139
+ providerName: n,
140
+ authType: t,
141
+ controller: s,
142
+ client: d,
143
+ onCancel: c,
144
+ onClear: p,
145
+ onRetry: g,
146
+ onSuccess: C
147
+ }) {
148
+ const [u, m] = X(
149
+ ve,
150
+ ue(e, t)
151
+ ), h = k(null), I = k(!1), _ = k(!1), [r, v] = f(""), [$, j] = f(null);
152
+ w(() => (_.current = !0, I.current || (I.current = !0, d.loginProvider(
153
+ e,
154
+ t,
155
+ {
156
+ prompt: (l) => new Promise((S, H) => {
157
+ h.current = { promptId: l.promptId, resolve: S, reject: H }, m({ kind: "prompt", ...l }), l.signal?.addEventListener(
158
+ "abort",
159
+ () => {
160
+ h.current?.promptId === l.promptId && (h.current = null), v(""), m({ kind: "prompt_cancelled", promptId: l.promptId });
161
+ },
162
+ { once: !0 }
163
+ );
164
+ }),
165
+ onEvent: (l) => m(l)
166
+ },
167
+ { signal: s.signal }
168
+ ).then((l) => {
169
+ _.current && m({ kind: "done", ok: l.ok, error: l.error });
170
+ }).catch((l) => {
171
+ _.current && m({
172
+ kind: "done",
173
+ ok: !1,
174
+ error: l instanceof Error ? l.message : String(l)
175
+ });
176
+ })), () => {
177
+ _.current = !1, h.current?.reject(new Error("login dialog closed")), h.current = null;
178
+ }), []), w(() => {
179
+ if (u.phase !== "done" || !u.result?.ok) return;
180
+ C();
181
+ const l = setTimeout(p, Ge);
182
+ return () => clearTimeout(l);
183
+ }, [u.phase, u.result?.ok, C, p]);
184
+ function A(l) {
185
+ const S = h.current;
186
+ S && (h.current = null, j(S.promptId), v(""), S.resolve(l));
187
+ }
188
+ function G(l) {
189
+ l.preventDefault(), A(r);
190
+ }
191
+ function Y(l) {
192
+ l || (u.phase === "done" ? p() : c());
193
+ }
194
+ const b = u.phase === "done", Z = b && u.result?.ok === !0, M = b && u.result?.ok === !1, D = u.phase === "prompt" && u.prompt && u.prompt.promptId !== $ ? u.prompt : void 0, R = D && D.promptKind !== "select" ? D : void 0;
195
+ return /* @__PURE__ */ o(
196
+ K,
197
+ {
198
+ open: !0,
199
+ onOpenChange: Y,
200
+ title: `Log in to ${n}`,
201
+ width: 480,
202
+ footer: b ? /* @__PURE__ */ a(x, { children: [
203
+ /* @__PURE__ */ o(y, { variant: "ghost", onClick: p, children: "Close" }),
204
+ M && /* @__PURE__ */ o(y, { onClick: g, children: "Try again" })
205
+ ] }) : /* @__PURE__ */ a(x, { children: [
206
+ /* @__PURE__ */ o(y, { variant: "ghost", onClick: c, children: "Cancel" }),
207
+ R && // Associated with the body's form by id, so Enter-in-the-input and this click are
208
+ // the same submit path while both actions still sit in the footer's action row.
209
+ //
210
+ // Deliberately NOT disabled on an empty input: blank is a meaningful answer to some
211
+ // prompts — GitHub Copilot opens with "GitHub Enterprise URL/domain (blank for
212
+ // github.com)", and gating on length made that flow impossible to advance. The
213
+ // provider decides what it accepts, exactly as `pi-studio auth login` does (its
214
+ // `@inquirer/prompts` input carries no non-empty validation either).
215
+ /* @__PURE__ */ o(y, { type: "submit", form: z, children: "Submit" })
216
+ ] }),
217
+ children: /* @__PURE__ */ a("div", { className: i.body, children: [
218
+ /* @__PURE__ */ o(He, { state: u }),
219
+ !b && u.authUrl && /* @__PURE__ */ o(Je, { authUrl: u.authUrl, showInstructions: !R }),
220
+ !b && u.deviceCode && /* @__PURE__ */ o(en, { deviceCode: u.deviceCode, stopped: b }),
221
+ D && /* @__PURE__ */ o(
222
+ Ve,
223
+ {
224
+ prompt: D,
225
+ inputValue: r,
226
+ onInputChange: v,
227
+ onTextSubmit: G,
228
+ onSelect: A
229
+ }
230
+ ),
231
+ Z && /* @__PURE__ */ o("p", { className: i.success, children: "Signed in. Closing…" }),
232
+ M && /* @__PURE__ */ o("p", { className: i.error, children: u.result?.error ?? "Login failed." })
233
+ ] })
234
+ }
235
+ );
236
+ }
237
+ function He({ state: e }) {
238
+ return e.statusLines.length === 0 && e.phase !== "starting" ? null : /* @__PURE__ */ a("div", { className: i.status, children: [
239
+ e.phase === "starting" && /* @__PURE__ */ a("div", { className: i.statusLine, children: [
240
+ /* @__PURE__ */ o(E, { size: "sm" }),
241
+ " Starting…"
242
+ ] }),
243
+ e.statusLines.map((n, t) => /* @__PURE__ */ a(
244
+ "div",
245
+ {
246
+ className: n.kind === "progress" ? i.statusLineProgress : i.statusLine,
247
+ children: [
248
+ n.kind === "progress" && /* @__PURE__ */ o(E, { size: "sm" }),
249
+ /* @__PURE__ */ a("span", { className: i.statusText, children: [
250
+ /* @__PURE__ */ o("span", { children: n.message }),
251
+ n.links?.map((s) => /* @__PURE__ */ o(P, { href: s.url, children: s.label ?? s.url }, s.url))
252
+ ] })
253
+ ]
254
+ },
255
+ t
256
+ ))
257
+ ] });
258
+ }
259
+ function Ve({
260
+ prompt: e,
261
+ inputValue: n,
262
+ onInputChange: t,
263
+ onTextSubmit: s,
264
+ onSelect: d
265
+ }) {
266
+ return e.promptKind === "select" ? /* @__PURE__ */ a("div", { className: i.prompt, children: [
267
+ /* @__PURE__ */ o("p", { className: i.promptMessage, children: e.message }),
268
+ /* @__PURE__ */ o("div", { className: i.options, children: e.options?.map((c) => /* @__PURE__ */ a(
269
+ "button",
270
+ {
271
+ type: "button",
272
+ className: i.option,
273
+ onClick: () => d(c.id),
274
+ children: [
275
+ /* @__PURE__ */ o("span", { className: i.optionLabel, children: c.label }),
276
+ c.description && /* @__PURE__ */ o("span", { className: i.optionDescription, children: c.description })
277
+ ]
278
+ },
279
+ c.id
280
+ )) })
281
+ ] }) : /* @__PURE__ */ a("form", { id: z, className: i.prompt, onSubmit: s, children: [
282
+ /* @__PURE__ */ o("label", { className: i.promptMessage, htmlFor: "login-prompt-input", children: e.message }),
283
+ /* @__PURE__ */ o(
284
+ ee,
285
+ {
286
+ id: "login-prompt-input",
287
+ autoFocus: !0,
288
+ type: e.promptKind === "secret" ? "password" : "text",
289
+ autoComplete: e.promptKind === "secret" ? "off" : void 0,
290
+ "data-1p-ignore": e.promptKind === "secret" ? "true" : void 0,
291
+ "data-lpignore": e.promptKind === "secret" ? "true" : void 0,
292
+ "data-bwignore": e.promptKind === "secret" ? "true" : void 0,
293
+ placeholder: e.placeholder,
294
+ value: n,
295
+ onChange: (c) => t(c.target.value)
296
+ }
297
+ )
298
+ ] });
299
+ }
300
+ const Xe = 1800;
301
+ function F({ value: e, label: n }) {
302
+ const [t, s] = f(!1);
303
+ return w(() => {
304
+ if (!t) return;
305
+ const d = setTimeout(() => s(!1), Xe);
306
+ return () => clearTimeout(d);
307
+ }, [t]), /* @__PURE__ */ o(
308
+ ne,
309
+ {
310
+ size: "sm",
311
+ "aria-label": t ? "Copied" : n,
312
+ title: t ? "Copied" : n,
313
+ onClick: () => {
314
+ te().clipboard.writeText(e).then(
315
+ () => s(!0),
316
+ () => s(!1)
317
+ );
318
+ },
319
+ children: t ? /* @__PURE__ */ o(ae, { size: 14 }) : /* @__PURE__ */ o(ce, { size: 14 })
320
+ }
321
+ );
322
+ }
323
+ function Je({
324
+ authUrl: e,
325
+ showInstructions: n
326
+ }) {
327
+ return /* @__PURE__ */ a("div", { className: i.oauth, children: [
328
+ n && e.instructions && /* @__PURE__ */ o("p", { className: i.oauthInstructions, children: e.instructions }),
329
+ /* @__PURE__ */ a("div", { className: i.oauthMain, children: [
330
+ /* @__PURE__ */ a("div", { className: i.oauthActions, children: [
331
+ /* @__PURE__ */ a(P, { className: i.openButton, href: e.url, children: [
332
+ /* @__PURE__ */ o(B, { size: 14 }),
333
+ "Open login page"
334
+ ] }),
335
+ /* @__PURE__ */ a("div", { className: i.urlRow, children: [
336
+ /* @__PURE__ */ o("span", { className: i.oauthUrl, children: e.url }),
337
+ /* @__PURE__ */ o(F, { value: e.url, label: "Copy link" })
338
+ ] })
339
+ ] }),
340
+ /* @__PURE__ */ a("div", { className: i.oauthQr, children: [
341
+ /* @__PURE__ */ o(O, { value: e.url, label: "QR code for the provider's login page" }),
342
+ /* @__PURE__ */ o("span", { className: i.oauthQrCaption, children: "Scan on another device" })
343
+ ] })
344
+ ] })
345
+ ] });
346
+ }
347
+ function We(e) {
348
+ const n = Math.max(0, e), t = Math.floor(n / 60), s = n % 60;
349
+ return `${t}:${String(s).padStart(2, "0")}`;
350
+ }
351
+ function en({
352
+ deviceCode: e,
353
+ stopped: n
354
+ }) {
355
+ const [t, s] = f(e.expiresInSeconds);
356
+ return w(() => {
357
+ if (n || e.expiresInSeconds === void 0) return;
358
+ s(e.expiresInSeconds);
359
+ const d = setInterval(() => {
360
+ s((c) => c === void 0 ? void 0 : Math.max(0, c - 1));
361
+ }, 1e3);
362
+ return () => clearInterval(d);
363
+ }, [e.expiresInSeconds, n]), /* @__PURE__ */ o("div", { className: i.oauth, children: /* @__PURE__ */ a("div", { className: i.oauthMain, children: [
364
+ /* @__PURE__ */ a("div", { className: i.oauthActions, children: [
365
+ /* @__PURE__ */ o("span", { className: i.oauthInstructions, children: "Enter this code at the verification page" }),
366
+ /* @__PURE__ */ a("div", { className: i.urlRow, children: [
367
+ /* @__PURE__ */ o("span", { className: i.deviceCode, children: e.userCode }),
368
+ /* @__PURE__ */ o(F, { value: e.userCode, label: "Copy code" })
369
+ ] }),
370
+ /* @__PURE__ */ a(P, { className: i.openButton, href: e.verificationUri, children: [
371
+ /* @__PURE__ */ o(B, { size: 14 }),
372
+ "Open verification page"
373
+ ] }),
374
+ t !== void 0 && /* @__PURE__ */ o("span", { className: i.countdown, children: t > 0 ? `Expires in ${We(t)}` : "Code expired" })
375
+ ] }),
376
+ /* @__PURE__ */ a("div", { className: i.oauthQr, children: [
377
+ /* @__PURE__ */ o(O, { value: e.verificationUri, label: "QR code for the verification page" }),
378
+ /* @__PURE__ */ o("span", { className: i.oauthQrCaption, children: "Scan on another device" })
379
+ ] })
380
+ ] }) });
381
+ }
382
+ const nn = "piwb-SettingsDialog_shell_N_xAE", on = "piwb-SettingsDialog_sidebar_1dH3S", tn = "piwb-SettingsDialog_category__q-DM", rn = "piwb-SettingsDialog_categoryActive_zc7nw", sn = "piwb-SettingsDialog_content_opjtv", N = {
383
+ shell: nn,
384
+ sidebar: on,
385
+ category: tn,
386
+ categoryActive: rn,
387
+ content: sn
388
+ };
389
+ function _n({ open: e, onOpenChange: n }) {
390
+ const t = q((r) => r.serverInfo), s = L((r) => r.pendingLogin), d = L((r) => r.cancelLogin), c = ie(t?.features), p = re.filter((r) => r.available(c)), [g, C] = f(p[0]?.id);
391
+ w(() => {
392
+ p.some((r) => r.id === g) || C(p[0]?.id);
393
+ }, [p.map((r) => r.id).join(",")]);
394
+ const u = p.find((r) => r.id === g) ?? p[0], m = u?.component;
395
+ function h(r) {
396
+ !r && s && d(), n(r);
397
+ }
398
+ function I(r) {
399
+ if (s) {
400
+ r.preventDefault();
401
+ return;
402
+ }
403
+ const v = r.detail.originalEvent.target;
404
+ v instanceof Node && !v.isConnected && r.preventDefault();
405
+ }
406
+ function _(r) {
407
+ s && r.preventDefault();
408
+ }
409
+ return /* @__PURE__ */ a(x, { children: [
410
+ /* @__PURE__ */ o(
411
+ K,
412
+ {
413
+ open: e,
414
+ onOpenChange: h,
415
+ title: "Settings",
416
+ width: 900,
417
+ onInteractOutside: I,
418
+ onEscapeKeyDown: _,
419
+ children: /* @__PURE__ */ a("div", { className: N.shell, children: [
420
+ /* @__PURE__ */ o("nav", { className: N.sidebar, children: p.map((r) => /* @__PURE__ */ a(
421
+ "button",
422
+ {
423
+ type: "button",
424
+ className: W(
425
+ N.category,
426
+ r.id === u?.id && N.categoryActive
427
+ ),
428
+ onClick: () => C(r.id),
429
+ children: [
430
+ /* @__PURE__ */ o(oe, { icon: r.icon, size: "sm" }),
431
+ r.label
432
+ ]
433
+ },
434
+ r.id
435
+ )) }),
436
+ /* @__PURE__ */ o("div", { className: N.content, children: m ? /* @__PURE__ */ o(
437
+ J,
438
+ {
439
+ fallback: /* @__PURE__ */ a(T, { children: [
440
+ /* @__PURE__ */ o(E, { size: "sm" }),
441
+ " Loading…"
442
+ ] }),
443
+ children: /* @__PURE__ */ o(m, {})
444
+ }
445
+ ) : /* @__PURE__ */ o(T, { children: "No settings categories available." }) })
446
+ ] })
447
+ }
448
+ ),
449
+ /* @__PURE__ */ o(Ye, {})
450
+ ] });
451
+ }
452
+ export {
453
+ _n as SettingsDialog
454
+ };
@@ -2,7 +2,7 @@ import { jsxs as h, jsx as s, Fragment as le } from "react/jsx-runtime";
2
2
  import { useEffect as K, useState as w, useRef as te } from "react";
3
3
  import { AlertTriangle as U, ChevronRight as ne, Trash2 as se } from "lucide-react";
4
4
  import { TextInput as Y, Icon as z, Dialog as re, Checkbox as j, StatusBadge as T, Button as D, Spinner as $, EmptyState as H, Switch as ae, IconButton as ie } from "@av-pi-studio/ui-library";
5
- import { u as I, r as N, g as O } from "./index-QzeFcHmH.js";
5
+ import { u as I, r as N, g as O } from "./index-CitLJdIo.js";
6
6
  import { detectSkillSource as oe } from "@av-pi-studio/client";
7
7
  import { useQueryClient as F, useQuery as ce } from "@tanstack/react-query";
8
8
  const G = {
@@ -4,7 +4,7 @@ import { Terminal as ie } from "@xterm/xterm";
4
4
  import { FitAddon as ue } from "@xterm/addon-fit";
5
5
  import "@xterm/xterm/css/xterm.css";
6
6
  import { TerminalStreamRouter as le } from "@av-pi-studio/client";
7
- import { u as ae, v as fe, K as de, M as Z, N as me, m as pe } from "./index-QzeFcHmH.js";
7
+ import { u as ae, v as fe, K as de, M as Z, N as me, m as pe } from "./index-CitLJdIo.js";
8
8
  import { baseFontSize as we, TERMINAL_FONT_STACK as J, useAppearance as Se, Spinner as he } from "@av-pi-studio/ui-library";
9
9
  const Re = 3e3, ee = `${we.sm}px ${J}`, te = "M";
10
10
  function ne() {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
2
  import { EmptyState as o, Panel as d, Spinner as a } from "@av-pi-studio/ui-library";
3
- import { u as l, C as c } from "./CodeView-klpk8qD0.js";
4
- import { S as m } from "./SaveFileButton-Bsz3wG4a.js";
3
+ import { u as l, C as c } from "./CodeView--Yo9YYpl.js";
4
+ import { S as m } from "./SaveFileButton-qwf_ewMX.js";
5
5
  const g = "piwb-TextViewer_note_8NLWz", u = "piwb-TextViewer_body_674Gk", y = "piwb-TextViewer_tooLarge_AE_S5", s = {
6
6
  note: g,
7
7
  body: u,
@@ -1,6 +1,6 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
2
  import { EmptyState as i, Spinner as t } from "@av-pi-studio/ui-library";
3
- import { u as a } from "./use-file-download-zheHRdGQ.js";
3
+ import { u as a } from "./use-file-download-DbQCEsRG.js";
4
4
  const d = "piwb-VideoViewer_wrap_uRDRg", c = "piwb-VideoViewer_video_e-yEz", n = {
5
5
  wrap: d,
6
6
  video: c
@@ -1,6 +1,6 @@
1
1
  import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
2
  import { Switch as w } from "@av-pi-studio/ui-library";
3
- import { a as r } from "./index-QzeFcHmH.js";
3
+ import { a as r } from "./index-CitLJdIo.js";
4
4
  const p = "piwb-ViewersPanel_list_-coFH", m = "piwb-ViewersPanel_row_HkMPx", b = "piwb-ViewersPanel_rowMain_WGJdx", f = "piwb-ViewersPanel_name_RIRP4", V = "piwb-ViewersPanel_description_SHFiN", _ = "piwb-ViewersPanel_note_CvJyn", n = {
5
5
  list: p,
6
6
  row: m,
@@ -0,0 +1,24 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
3
+ import { g as a } from "./index-CitLJdIo.js";
4
+ function i(r, n) {
5
+ const t = a().links.openExternal;
6
+ t && (r.preventDefault(), t(n));
7
+ }
8
+ function u({ href: r, onClick: n, ...t }) {
9
+ return /* @__PURE__ */ o(
10
+ "a",
11
+ {
12
+ ...t,
13
+ href: r,
14
+ target: "_blank",
15
+ rel: "noreferrer",
16
+ onClick: (e) => {
17
+ n?.(e), e.defaultPrevented || i(e, r);
18
+ }
19
+ }
20
+ );
21
+ }
22
+ export {
23
+ u as E
24
+ };
@@ -1,4 +1,4 @@
1
- import { n as l, H as o, _ as i } from "./index-QzeFcHmH.js";
1
+ import { n as l, H as o, _ as i } from "./index-CitLJdIo.js";
2
2
  const u = /^([a-zA-Z][a-zA-Z0-9+.-]*):/;
3
3
  function d(n) {
4
4
  try {