@burdenoff/microfe-store 2026.625.4 → 2026.625.5

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.
@@ -2,13 +2,156 @@ import { useStore as e } from "../providers/StoreProvider.js";
2
2
  import { useInstallationStatusUpdatedSubscription as t } from "../generated/global-operations.js";
3
3
  import { useInstallations as n } from "../hooks/useInstallations.js";
4
4
  import { StoreInstallationStatus as r } from "../generated/global-types.js";
5
- import { useMemo as i, useState as a } from "react";
6
- import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
- import { AlertCircle as s, Loader2 as c, Package as l, Plus as u, RefreshCw as d, Settings2 as f, Trash2 as p } from "lucide-react";
8
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { useNavigate as g } from "react-router-dom";
5
+ import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
6
+ import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { AlertCircle as u, ArrowUpCircle as d, CheckCircle as f, Loader2 as p, Package as m, Plus as h, RefreshCw as g, Settings2 as _, ShieldCheck as v, Trash2 as y, X as b } from "lucide-react";
8
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
9
+ import { useNavigate as w } from "react-router-dom";
10
+ import { graphqlFetch as T } from "@burdenoff/fe-libs/shared/graphql";
10
11
  //#region src/pages/InstalledAppsPage.tsx
11
- var _ = [
12
+ var E = "\n query GetProductVersion($id: ID!) {\n product(id: $id) {\n id\n manifestVersion\n requiredPermissions\n }\n }\n", D = "mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }";
13
+ function O(e, t) {
14
+ let [n, r] = c({}), [o, l] = c(!1), u = s(e);
15
+ u.current = e;
16
+ let d = i(async (e) => {
17
+ if (e.length !== 0) {
18
+ l(!0);
19
+ try {
20
+ let n = await Promise.all(e.map((e) => T({
21
+ gateway: "global",
22
+ query: E,
23
+ variables: { id: e },
24
+ authToken: t || void 0
25
+ }).then((e) => e.data?.product ?? null).catch(() => null))), i = {};
26
+ for (let e of n) e && (i[e.id] = {
27
+ manifestVersion: e.manifestVersion,
28
+ requiredPermissions: e.requiredPermissions
29
+ });
30
+ r(i);
31
+ } finally {
32
+ l(!1);
33
+ }
34
+ }
35
+ }, [t]);
36
+ return a(() => {
37
+ e.length > 0 && d(e);
38
+ }, [e.join(",")]), {
39
+ metaMap: n,
40
+ metaLoading: o,
41
+ refetchMeta: () => d(u.current)
42
+ };
43
+ }
44
+ var k = ({ installation: e, product: t, onClose: n, onAccept: r }) => {
45
+ let [i, a] = c(!1), [o, s] = c("permissions");
46
+ return /* @__PURE__ */ C("div", {
47
+ className: "fixed inset-0 z-50 flex items-center justify-center p-4",
48
+ children: [/* @__PURE__ */ S("button", {
49
+ type: "button",
50
+ "aria-label": "Close",
51
+ className: "absolute inset-0 bg-bg-overlay/50 backdrop-blur-sm",
52
+ onClick: n
53
+ }), /* @__PURE__ */ C("dialog", {
54
+ open: !0,
55
+ "aria-modal": "true",
56
+ className: "relative z-10 w-full max-w-md rounded-2xl border border-border-default bg-bg-surface shadow-2xl",
57
+ children: [
58
+ /* @__PURE__ */ C("div", {
59
+ className: "flex items-center justify-between border-b border-border-default px-6 py-4",
60
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h2", {
61
+ className: "text-lg font-semibold text-text-primary",
62
+ children: o === "permissions" ? "Review Updated Permissions" : "Confirm Update"
63
+ }), /* @__PURE__ */ S("p", {
64
+ className: "text-sm text-text-muted",
65
+ children: e.workspaceName ?? e.workspaceId
66
+ })] }), /* @__PURE__ */ S("button", {
67
+ type: "button",
68
+ onClick: n,
69
+ className: "cursor-pointer rounded-lg p-2 text-text-muted hover:bg-bg-sunken",
70
+ children: /* @__PURE__ */ S(b, { className: "size-5" })
71
+ })]
72
+ }),
73
+ o === "permissions" && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C("div", {
74
+ className: "px-6 py-4",
75
+ children: [
76
+ /* @__PURE__ */ C("div", {
77
+ className: "mb-3 flex items-center gap-2 rounded-lg bg-status-info-bg-subtle px-3 py-2 text-sm text-status-info-text",
78
+ children: [/* @__PURE__ */ S(d, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ C("span", { children: ["Update available: v", t.manifestVersion] })]
79
+ }),
80
+ /* @__PURE__ */ S("p", {
81
+ className: "mb-4 text-sm text-text-secondary",
82
+ children: "This update requires the following permissions. Review and accept to continue."
83
+ }),
84
+ t.requiredPermissions.length > 0 ? /* @__PURE__ */ S("div", {
85
+ className: "max-h-56 overflow-y-auto space-y-2",
86
+ children: t.requiredPermissions.map((e) => /* @__PURE__ */ C("div", {
87
+ className: "flex items-center gap-3 rounded-lg bg-bg-sunken px-4 py-3",
88
+ children: [/* @__PURE__ */ S(v, { className: "size-5 flex-shrink-0 text-status-success-text" }), /* @__PURE__ */ S("span", {
89
+ className: "text-sm text-text-primary",
90
+ children: e
91
+ })]
92
+ }, e))
93
+ }) : /* @__PURE__ */ S("p", {
94
+ className: "text-sm text-text-muted",
95
+ children: "No permissions required by this version."
96
+ })
97
+ ]
98
+ }), /* @__PURE__ */ C("div", {
99
+ className: "border-t border-border-default px-6 py-4 flex justify-end gap-3",
100
+ children: [/* @__PURE__ */ S("button", {
101
+ type: "button",
102
+ onClick: n,
103
+ className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
104
+ children: "Cancel"
105
+ }), /* @__PURE__ */ C("button", {
106
+ type: "button",
107
+ onClick: () => s("confirm"),
108
+ className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 inline-flex items-center gap-2",
109
+ children: [/* @__PURE__ */ S(f, { className: "size-4" }), "Accept & Update"]
110
+ })]
111
+ })] }),
112
+ o === "confirm" && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
113
+ className: "px-6 py-4",
114
+ children: /* @__PURE__ */ C("div", {
115
+ className: "rounded-lg bg-status-success-bg-subtle p-4 text-center",
116
+ children: [
117
+ /* @__PURE__ */ S(f, { className: "mx-auto mb-2 size-8 text-status-success-text" }),
118
+ /* @__PURE__ */ S("p", {
119
+ className: "text-sm font-medium text-text-primary",
120
+ children: "Permissions accepted"
121
+ }),
122
+ /* @__PURE__ */ C("p", {
123
+ className: "mt-1 text-xs text-text-muted",
124
+ children: ["Ready to update to v", t.manifestVersion]
125
+ })
126
+ ]
127
+ })
128
+ }), /* @__PURE__ */ C("div", {
129
+ className: "border-t border-border-default px-6 py-4 flex justify-end gap-3",
130
+ children: [/* @__PURE__ */ S("button", {
131
+ type: "button",
132
+ onClick: () => s("permissions"),
133
+ disabled: i,
134
+ className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
135
+ children: "Back"
136
+ }), /* @__PURE__ */ S("button", {
137
+ type: "button",
138
+ onClick: async () => {
139
+ a(!0);
140
+ try {
141
+ await r(), n();
142
+ } finally {
143
+ a(!1);
144
+ }
145
+ },
146
+ disabled: i,
147
+ className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50 inline-flex items-center gap-2",
148
+ children: i ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(p, { className: "size-4 animate-spin" }), " Updating…"] }) : "Confirm Update"
149
+ })]
150
+ })] })
151
+ ]
152
+ })]
153
+ });
154
+ }, A = [
12
155
  {
13
156
  label: "All",
14
157
  value: "all"
@@ -37,206 +180,237 @@ var _ = [
37
180
  label: "Uninstalled",
38
181
  value: r.Uninstalled
39
182
  }
40
- ], v = (e) => e === r.Active ? "bg-status-success-bg-subtle text-status-success-text" : e === r.Pending || e === r.Installing || e === r.Inactive ? "bg-status-warning-bg-subtle text-status-warning-text" : e === r.Failed ? "bg-status-error-bg-subtle text-status-error-text" : "bg-bg-sunken text-text-muted", y = () => {
41
- let y = g(), { basePath: b, workspaceId: x } = e(), { t: S } = o(), [C, w] = a("all"), [T, E] = a(null), [D, O] = a(null), { installations: k, totalCount: A, hasMore: j, loading: M, error: N, uninstall: P, uninstallingIds: F, refetch: I, loadMore: L } = n({ filter: i(() => C === "all" ? void 0 : { status: C }, [C]) });
183
+ ], j = (e) => e === r.Active ? "bg-status-success-bg-subtle text-status-success-text" : e === r.Pending || e === r.Installing || e === r.Inactive ? "bg-status-warning-bg-subtle text-status-warning-text" : e === r.Failed ? "bg-status-error-bg-subtle text-status-error-text" : "bg-bg-sunken text-text-muted", M = () => {
184
+ let i = w(), { basePath: a, workspaceId: s, authToken: f } = e(), { t: v } = l(), [b, x] = c("all"), [E, M] = c(null), [N, P] = c(null), [F, I] = c(null), { installations: L, totalCount: R, hasMore: z, loading: B, error: V, uninstall: H, uninstallingIds: U, refetch: W, loadMore: G } = n({ filter: o(() => b === "all" ? void 0 : { status: b }, [b]) });
42
185
  t({
43
- variables: { workspaceId: x ?? "" },
44
- skip: !x,
186
+ variables: { workspaceId: s ?? "" },
187
+ skip: !s,
45
188
  onData: () => {
46
- I();
189
+ W();
47
190
  },
48
191
  onError: (e) => {
49
192
  console.warn("InstallationStatusUpdated subscription error:", e.message);
50
193
  }
51
194
  });
52
- let R = i(() => [...k].sort((e, t) => t.installedAt.localeCompare(e.installedAt)), [k]), z = () => {
53
- y(`${b}/marketplace`);
54
- }, B = async (e) => {
55
- E(null), await P(e, "User requested uninstall from store UI") || E("Could not uninstall. Try again."), O(null);
195
+ let K = o(() => [...L].sort((e, t) => t.installedAt.localeCompare(e.installedAt)), [L]), { metaMap: q, refetchMeta: J } = O(o(() => [...new Set(L.map((e) => e.productId))], [L]), f), Y = () => {
196
+ i(`${a}/marketplace`);
197
+ }, X = async (e) => {
198
+ M(null), await H(e, "User requested uninstall from store UI") || M("Could not uninstall. Try again."), P(null);
199
+ }, Z = async (e) => {
200
+ let t = q[e.productId];
201
+ if (t?.manifestVersion) try {
202
+ await T({
203
+ gateway: "global",
204
+ query: D,
205
+ variables: { input: {
206
+ productId: e.productId,
207
+ workspaceId: e.workspaceId,
208
+ workspaceName: e.workspaceName,
209
+ workspaceType: e.workspaceType,
210
+ organizationId: e.organizationId,
211
+ version: t.manifestVersion
212
+ } },
213
+ authToken: f || void 0
214
+ }), await W(), J();
215
+ } catch {
216
+ M("Update failed. Please try again.");
217
+ }
56
218
  };
57
- return /* @__PURE__ */ h("div", {
219
+ return /* @__PURE__ */ C("div", {
58
220
  className: "flex h-full flex-col",
59
221
  children: [
60
- /* @__PURE__ */ m("header", {
222
+ /* @__PURE__ */ S("header", {
61
223
  className: "border-b border-border-default bg-bg-surface px-6 py-4",
62
- children: /* @__PURE__ */ h("div", {
224
+ children: /* @__PURE__ */ C("div", {
63
225
  className: "flex items-center justify-between",
64
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
226
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h1", {
65
227
  className: "text-2xl font-bold text-text-primary",
66
- children: S("pages.installed.title", { defaultValue: "Installed Apps" })
67
- }), /* @__PURE__ */ m("p", {
228
+ children: v("pages.installed.title", { defaultValue: "Installed Apps" })
229
+ }), /* @__PURE__ */ S("p", {
68
230
  className: "text-sm text-text-muted",
69
231
  children: "Manage your installed applications"
70
- })] }), /* @__PURE__ */ h("button", {
232
+ })] }), /* @__PURE__ */ C("button", {
71
233
  type: "button",
72
- onClick: z,
234
+ onClick: Y,
73
235
  className: "flex cursor-pointer items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 font-semibold text-action-primary-text transition-colors hover:opacity-90",
74
- children: [/* @__PURE__ */ m(u, { className: "size-5" }), /* @__PURE__ */ m("span", { children: S("pages.installed.installNew", { defaultValue: "Install New App" }) })]
236
+ children: [/* @__PURE__ */ S(h, { className: "size-5" }), /* @__PURE__ */ S("span", { children: v("pages.installed.installNew", { defaultValue: "Install New App" }) })]
75
237
  })]
76
238
  })
77
239
  }),
78
- /* @__PURE__ */ m("main", {
240
+ /* @__PURE__ */ S("main", {
79
241
  className: "flex-1 overflow-y-auto p-6",
80
- children: /* @__PURE__ */ h("div", {
242
+ children: /* @__PURE__ */ C("div", {
81
243
  className: "mx-auto max-w-6xl",
82
244
  children: [
83
- /* @__PURE__ */ h("div", {
245
+ /* @__PURE__ */ C("div", {
84
246
  className: "mb-4 flex flex-wrap items-center gap-2",
85
- children: [_.map((e) => /* @__PURE__ */ m("button", {
247
+ children: [A.map((e) => /* @__PURE__ */ S("button", {
86
248
  type: "button",
87
- onClick: () => w(e.value),
88
- className: `cursor-pointer rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${C === e.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary hover:bg-bg-surface"}`,
249
+ onClick: () => x(e.value),
250
+ className: `cursor-pointer rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${b === e.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary hover:bg-bg-surface"}`,
89
251
  children: e.label
90
- }, e.label)), /* @__PURE__ */ h("button", {
252
+ }, e.label)), /* @__PURE__ */ C("button", {
91
253
  type: "button",
92
- onClick: () => I(),
254
+ onClick: () => W(),
93
255
  className: "ml-auto cursor-pointer inline-flex items-center gap-2 rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
94
- children: [/* @__PURE__ */ m(d, { className: "size-4" }), "Refresh"]
256
+ children: [/* @__PURE__ */ S(g, { className: "size-4" }), "Refresh"]
95
257
  })]
96
258
  }),
97
- T && /* @__PURE__ */ m("div", {
259
+ E && /* @__PURE__ */ S("div", {
98
260
  role: "alert",
99
261
  className: "mb-4 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
100
- children: T
262
+ children: E
101
263
  }),
102
- M ? /* @__PURE__ */ m("output", {
264
+ B ? /* @__PURE__ */ S("output", {
103
265
  "aria-label": "Loading installed apps",
104
266
  className: "flex items-center justify-center py-16",
105
- children: /* @__PURE__ */ m(c, {
267
+ children: /* @__PURE__ */ S(p, {
106
268
  className: "size-8 animate-spin text-text-muted",
107
269
  "aria-hidden": "true"
108
270
  })
109
- }) : N ? /* @__PURE__ */ h("div", {
271
+ }) : V ? /* @__PURE__ */ C("div", {
110
272
  role: "alert",
111
273
  className: "flex flex-col items-center justify-center rounded-xl border border-status-error-border bg-status-error-bg-subtle py-16 text-center",
112
274
  children: [
113
- /* @__PURE__ */ m(s, { className: "mb-3 size-10 text-status-error-text" }),
114
- /* @__PURE__ */ m("h3", {
275
+ /* @__PURE__ */ S(u, { className: "mb-3 size-10 text-status-error-text" }),
276
+ /* @__PURE__ */ S("h3", {
115
277
  className: "text-lg font-semibold text-status-error-text",
116
278
  children: "Failed to load installations"
117
279
  }),
118
- /* @__PURE__ */ m("p", {
280
+ /* @__PURE__ */ S("p", {
119
281
  className: "mt-2 text-sm text-text-muted",
120
- children: N.message
282
+ children: V.message
121
283
  }),
122
- /* @__PURE__ */ m("button", {
284
+ /* @__PURE__ */ S("button", {
123
285
  type: "button",
124
- onClick: () => I(),
286
+ onClick: () => W(),
125
287
  className: "mt-4 cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
126
288
  children: "Try Again"
127
289
  })
128
290
  ]
129
- }) : R.length === 0 ? /* @__PURE__ */ m("div", {
291
+ }) : K.length === 0 ? /* @__PURE__ */ S("div", {
130
292
  className: "flex items-center justify-center py-16",
131
- children: /* @__PURE__ */ h("div", {
293
+ children: /* @__PURE__ */ C("div", {
132
294
  className: "text-center",
133
295
  children: [
134
- /* @__PURE__ */ m(l, { className: "mx-auto mb-4 size-16 text-text-muted" }),
135
- /* @__PURE__ */ m("h3", {
296
+ /* @__PURE__ */ S(m, { className: "mx-auto mb-4 size-16 text-text-muted" }),
297
+ /* @__PURE__ */ S("h3", {
136
298
  className: "mb-2 text-lg font-semibold text-text-primary",
137
299
  children: "No apps installed"
138
300
  }),
139
- /* @__PURE__ */ m("p", {
301
+ /* @__PURE__ */ S("p", {
140
302
  className: "mb-4 text-sm text-text-muted",
141
303
  children: "Browse the marketplace to install your first app"
142
304
  }),
143
- /* @__PURE__ */ m("button", {
305
+ /* @__PURE__ */ S("button", {
144
306
  type: "button",
145
- onClick: z,
307
+ onClick: Y,
146
308
  className: "rounded-lg bg-action-primary-bg px-4 py-2 font-semibold text-action-primary-text transition-colors hover:opacity-90",
147
309
  children: "Browse Marketplace"
148
310
  })
149
311
  ]
150
312
  })
151
- }) : /* @__PURE__ */ h("div", {
313
+ }) : /* @__PURE__ */ C("div", {
152
314
  className: "flex flex-col gap-y-4",
153
315
  children: [
154
- /* @__PURE__ */ h("p", {
316
+ /* @__PURE__ */ C("p", {
155
317
  "aria-live": "polite",
156
318
  className: "text-sm text-text-muted",
157
319
  children: [
158
- A,
320
+ R,
159
321
  " installation",
160
- A === 1 ? "" : "s",
322
+ R === 1 ? "" : "s",
161
323
  " found"
162
324
  ]
163
325
  }),
164
- /* @__PURE__ */ m("ul", {
326
+ /* @__PURE__ */ S("ul", {
165
327
  className: "flex flex-col gap-y-4",
166
- children: R.map((e) => {
167
- let t = F.has(`${e.workspaceId}:${e.productId}`);
168
- return /* @__PURE__ */ m("li", {
169
- className: "rounded-xl border border-border-default bg-bg-surface p-4",
170
- children: /* @__PURE__ */ h("div", {
328
+ children: K.map((e) => {
329
+ let t = U.has(`${e.workspaceId}:${e.productId}`), n = q[e.productId], o = n?.manifestVersion && e.version && n.manifestVersion !== e.version;
330
+ return /* @__PURE__ */ C("li", {
331
+ className: `rounded-xl border bg-bg-surface p-4 ${o ? "border-status-info-border" : "border-border-default"}`,
332
+ children: [o && /* @__PURE__ */ C("div", {
333
+ className: "mb-3 flex items-center gap-2 rounded-lg bg-status-info-bg-subtle px-3 py-2 text-sm text-status-info-text",
334
+ children: [
335
+ /* @__PURE__ */ S(d, { className: "size-4 flex-shrink-0" }),
336
+ /* @__PURE__ */ C("span", { children: ["Update available: v", n?.manifestVersion] }),
337
+ /* @__PURE__ */ S("button", {
338
+ type: "button",
339
+ onClick: () => I(e),
340
+ className: "ml-auto cursor-pointer rounded-md bg-action-primary-bg px-3 py-1 text-xs font-medium text-action-primary-text hover:opacity-90",
341
+ children: "Update"
342
+ })
343
+ ]
344
+ }), /* @__PURE__ */ C("div", {
171
345
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
172
- children: [/* @__PURE__ */ h("div", {
346
+ children: [/* @__PURE__ */ C("div", {
173
347
  className: "flex items-start gap-3",
174
- children: [/* @__PURE__ */ m("div", {
348
+ children: [/* @__PURE__ */ S("div", {
175
349
  className: "flex size-12 items-center justify-center rounded-lg bg-bg-sunken text-lg font-semibold text-text-muted",
176
- children: /* @__PURE__ */ m(l, { className: "size-6" })
177
- }), /* @__PURE__ */ h("div", { children: [
178
- /* @__PURE__ */ m("h3", {
350
+ children: /* @__PURE__ */ S(m, { className: "size-6" })
351
+ }), /* @__PURE__ */ C("div", { children: [
352
+ /* @__PURE__ */ S("h3", {
179
353
  className: "font-semibold text-text-primary",
180
354
  children: e.workspaceName ?? e.workspaceId
181
355
  }),
182
- /* @__PURE__ */ h("p", {
356
+ /* @__PURE__ */ C("p", {
183
357
  className: "text-sm text-text-muted",
184
358
  children: ["Product: ", e.productId]
185
359
  }),
186
- /* @__PURE__ */ h("div", {
360
+ /* @__PURE__ */ C("div", {
187
361
  className: "mt-2 flex flex-wrap items-center gap-2 text-xs text-text-muted",
188
362
  children: [
189
- /* @__PURE__ */ m("span", {
190
- className: `rounded-full px-2 py-1 font-medium ${v(e.status)}`,
363
+ /* @__PURE__ */ S("span", {
364
+ className: `rounded-full px-2 py-1 font-medium ${j(e.status)}`,
191
365
  children: e.status
192
366
  }),
193
- e.version && /* @__PURE__ */ h("span", { children: ["v", e.version] }),
194
- e.workspaceType && /* @__PURE__ */ m("span", { children: e.workspaceType })
367
+ e.version && /* @__PURE__ */ C("span", { children: ["v", e.version] }),
368
+ e.workspaceType && /* @__PURE__ */ S("span", { children: e.workspaceType })
195
369
  ]
196
370
  })
197
371
  ] })]
198
- }), /* @__PURE__ */ h("div", {
372
+ }), /* @__PURE__ */ C("div", {
199
373
  className: "flex items-center gap-2",
200
374
  children: [
201
- /* @__PURE__ */ m("button", {
375
+ /* @__PURE__ */ S("button", {
202
376
  type: "button",
203
- onClick: () => y(`${b}/installed/${e.id}`),
377
+ onClick: () => i(`${a}/installed/${e.id}`),
204
378
  className: "cursor-pointer rounded-lg border border-border-default px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
205
379
  children: "Details"
206
380
  }),
207
- /* @__PURE__ */ h("button", {
381
+ /* @__PURE__ */ C("button", {
208
382
  type: "button",
209
- onClick: () => y(`${b}/installed/${e.id}/settings`),
383
+ onClick: () => i(`${a}/installed/${e.id}/settings`),
210
384
  className: "cursor-pointer inline-flex items-center gap-1.5 rounded-lg border border-border-default px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
211
- children: [/* @__PURE__ */ m(f, { className: "size-4" }), "Configure"]
385
+ children: [/* @__PURE__ */ S(_, { className: "size-4" }), "Configure"]
212
386
  }),
213
- /* @__PURE__ */ m("button", {
387
+ /* @__PURE__ */ S("button", {
214
388
  type: "button",
215
- onClick: () => y(`${b}/marketplace/product/${e.productId}`),
389
+ onClick: () => i(`${a}/marketplace/product/${e.productId}`),
216
390
  className: "cursor-pointer rounded-lg border border-border-default px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
217
391
  children: "View Product"
218
392
  }),
219
- e.status !== r.Uninstalled && /* @__PURE__ */ h("button", {
393
+ e.status !== r.Uninstalled && /* @__PURE__ */ C("button", {
220
394
  type: "button",
221
- onClick: () => O(e),
395
+ onClick: () => P(e),
222
396
  disabled: t,
223
397
  className: "cursor-pointer inline-flex items-center gap-1.5 rounded-lg border border-status-error-border px-3 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle disabled:opacity-60",
224
- children: [t ? /* @__PURE__ */ m(c, { className: "size-4 animate-spin" }) : /* @__PURE__ */ m(p, { className: "size-4" }), "Uninstall"]
398
+ children: [t ? /* @__PURE__ */ S(p, { className: "size-4 animate-spin" }) : /* @__PURE__ */ S(y, { className: "size-4" }), "Uninstall"]
225
399
  })
226
400
  ]
227
401
  })]
228
- })
402
+ })]
229
403
  }, e.id);
230
404
  })
231
405
  }),
232
- j && /* @__PURE__ */ m("div", {
406
+ z && /* @__PURE__ */ S("div", {
233
407
  className: "flex justify-center pt-6",
234
- children: /* @__PURE__ */ m("button", {
408
+ children: /* @__PURE__ */ S("button", {
235
409
  type: "button",
236
- onClick: L,
237
- disabled: M,
410
+ onClick: G,
411
+ disabled: B,
238
412
  className: "rounded-lg border border-border-default px-6 py-2.5 text-sm font-medium text-text-primary hover:bg-bg-subtle disabled:opacity-50",
239
- children: M ? "Loading…" : "Load more"
413
+ children: B ? "Loading…" : "Load more"
240
414
  })
241
415
  })
242
416
  ]
@@ -244,53 +418,59 @@ var _ = [
244
418
  ]
245
419
  })
246
420
  }),
247
- D && /* @__PURE__ */ h("div", {
421
+ F && q[F.productId] && /* @__PURE__ */ S(k, {
422
+ installation: F,
423
+ product: q[F.productId],
424
+ onClose: () => I(null),
425
+ onAccept: () => Z(F)
426
+ }),
427
+ N && /* @__PURE__ */ C("div", {
248
428
  className: "fixed inset-0 z-50 flex items-center justify-center p-4",
249
- children: [/* @__PURE__ */ m("button", {
429
+ children: [/* @__PURE__ */ S("button", {
250
430
  type: "button",
251
431
  "aria-label": "Cancel uninstall",
252
432
  className: "absolute inset-0 bg-bg-overlay/50",
253
- onClick: () => O(null)
254
- }), /* @__PURE__ */ h("dialog", {
433
+ onClick: () => P(null)
434
+ }), /* @__PURE__ */ C("dialog", {
255
435
  open: !0,
256
436
  "aria-modal": "true",
257
437
  "aria-labelledby": "installed-apps-uninstall-title",
258
438
  className: "relative z-10 w-full max-w-md rounded-2xl border border-border-default bg-bg-surface p-6 shadow-2xl",
259
439
  children: [
260
- /* @__PURE__ */ m("h2", {
440
+ /* @__PURE__ */ S("h2", {
261
441
  id: "installed-apps-uninstall-title",
262
442
  className: "text-lg font-semibold text-text-primary",
263
443
  children: "Uninstall app"
264
444
  }),
265
- /* @__PURE__ */ h("p", {
445
+ /* @__PURE__ */ C("p", {
266
446
  className: "mt-2 text-sm text-text-muted",
267
447
  children: [
268
448
  "Remove product",
269
449
  " ",
270
- /* @__PURE__ */ m("span", {
450
+ /* @__PURE__ */ S("span", {
271
451
  className: "font-medium text-text-primary",
272
- children: D.productId
452
+ children: N.productId
273
453
  }),
274
454
  " ",
275
455
  "from workspace",
276
456
  " ",
277
- /* @__PURE__ */ m("span", {
457
+ /* @__PURE__ */ S("span", {
278
458
  className: "font-medium text-text-primary",
279
- children: D.workspaceName ?? D.workspaceId
459
+ children: N.workspaceName ?? N.workspaceId
280
460
  }),
281
461
  "?"
282
462
  ]
283
463
  }),
284
- /* @__PURE__ */ h("div", {
464
+ /* @__PURE__ */ C("div", {
285
465
  className: "mt-6 flex flex-wrap justify-end gap-3",
286
- children: [/* @__PURE__ */ m("button", {
466
+ children: [/* @__PURE__ */ S("button", {
287
467
  type: "button",
288
- onClick: () => O(null),
468
+ onClick: () => P(null),
289
469
  className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
290
470
  children: "Cancel"
291
- }), /* @__PURE__ */ m("button", {
471
+ }), /* @__PURE__ */ S("button", {
292
472
  type: "button",
293
- onClick: () => B(D),
473
+ onClick: () => X(N),
294
474
  className: "cursor-pointer rounded-lg bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg-emphasis",
295
475
  children: "Uninstall"
296
476
  })]
@@ -302,6 +482,6 @@ var _ = [
302
482
  });
303
483
  };
304
484
  //#endregion
305
- export { y as InstalledAppsPage };
485
+ export { M as InstalledAppsPage };
306
486
 
307
487
  //# sourceMappingURL=InstalledAppsPage.js.map