@burdenoff/microfe-integrations 2026.527.1 → 2026.527.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,301 +8,302 @@ import { useAuthenticateWithApiKey as ne, useAuthenticateWithBasicAuth as re, us
8
8
  import { waitForOAuthPopupCompletion as se } from "../utils/oauthPopup.js";
9
9
  import { CredentialStorageSelector as ce } from "./CredentialStorageSelector.js";
10
10
  import { ProviderIcon as a } from "./ProviderIcon.js";
11
- import { useCallback as le, useEffect as o, useMemo as ue, useRef as s, useState as c } from "react";
12
- import { AlertCircle as de, Check as fe, CheckCircle2 as pe, ExternalLink as l, Info as me, Key as u, Link2 as he, Loader2 as d, Lock as f, Search as ge, Shield as _e, X as ve } from "lucide-react";
13
- import { usePermissions as ye } from "@burdenoff/fe-libs/shared/providers/shell";
14
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
11
+ import { useCallback as le, useEffect as o, useId as ue, useMemo as de, useRef as s, useState as c } from "react";
12
+ import { AlertCircle as fe, Check as pe, CheckCircle2 as me, ExternalLink as l, Info as he, Key as u, Link2 as ge, Loader2 as d, Lock as _e, Search as ve, Shield as ye, X as be } from "lucide-react";
13
+ import { usePermissions as xe } from "@burdenoff/fe-libs/shared/providers/shell";
14
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
15
15
  //#region src/integrations/components/AddConnectionDialog.tsx
16
- function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated: y }) {
17
- let { apiGatewayUrl: b } = e(), { providers: x, loading: S } = te(), { hasPermission: be, isLoading: C } = ye(), xe = !C && be(n.CONNECTION_CREATE), { createConnection: w, loading: Se } = ae(), { initiateOAuth: Ce, loading: we } = oe(), { authenticateWithApiKey: Te, loading: Ee } = ne(), { authenticateWithBasicAuth: De, loading: Oe } = re(), { authenticateWithBearerToken: ke, loading: Ae } = ie(), [je] = ee({ fetchPolicy: "network-only" }), [T, E] = c(null), [D, O] = c(!v), [k, A] = c("connection"), [j, M] = c(""), [N, P] = c(""), [F, I] = c(""), [L, R] = c(""), [z, Me] = c(""), [B, Ne] = c(""), [V, Pe] = c(""), [H, Fe] = c({
16
+ function h({ open: h, onClose: g, preselectedProviderId: _, onConnectionCreated: v }) {
17
+ let { apiGatewayUrl: y } = e(), { providers: b, loading: Se } = te(), { hasPermission: Ce, isLoading: we } = xe(), Te = !we && Ce(n.CONNECTION_CREATE), { createConnection: x, loading: Ee } = ae(), { initiateOAuth: S, loading: De } = oe(), { authenticateWithApiKey: C, loading: Oe } = ne(), { authenticateWithBasicAuth: w, loading: ke } = re(), { authenticateWithBearerToken: T, loading: Ae } = ie(), [E] = ee({ fetchPolicy: "network-only" }), [D, O] = c(null), [k, A] = c(!_), [j, M] = c("connection"), [N, je] = c(""), [P, F] = c(""), [I, Me] = c(""), [L, Ne] = c(""), [R, Pe] = c(""), [z, Fe] = c(""), [B, Ie] = c(""), [V, Le] = c({
18
18
  mode: "managed",
19
19
  vaultId: "",
20
20
  secretId: "",
21
21
  managedSecretName: ""
22
- }), [U, Ie] = c(!1), [Le, W] = c(""), [G, K] = c(!1), [q, J] = c(!1), [, Re] = c(null), Y = s(null), X = s(null), ze = s(null);
22
+ }), [H, Re] = c(!1), [ze, U] = c(""), [W, G] = c(!1), [K, q] = c(!1), [, Be] = c(null), J = s(null), Y = s(null), X = s(null), Ve = ue(), Z = (e) => `${Ve}-${e}`;
23
23
  o(() => {
24
- if (!g) return;
24
+ if (!h) return;
25
25
  let e = (e) => {
26
- e.key === "Escape" && _();
26
+ e.key === "Escape" && g();
27
27
  };
28
28
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
29
- }, [g, _]), o(() => () => {
30
- X.current?.(), Y.current && !Y.current.closed && Y.current.close();
29
+ }, [h, g]), o(() => () => {
30
+ Y.current?.(), J.current && !J.current.closed && J.current.close();
31
31
  }, []), o(() => {
32
- g && (A("connection"), M(""), P(""), I(""), R(""), Me(""), Ne(""), Pe(""), Fe({
32
+ h && (M("connection"), je(""), F(""), Me(""), Ne(""), Pe(""), Fe(""), Ie(""), Le({
33
33
  mode: "managed",
34
34
  vaultId: "",
35
35
  secretId: "",
36
36
  managedSecretName: ""
37
- }), Ie(!1), W(""), K(!1), J(!1), Re(null), v ? (O(!1), E(null)) : (O(!0), E(null)));
38
- }, [g, v]), o(() => {
39
- if (g && v && x && !T) {
40
- let e = x.find((e) => e.id === v);
41
- e && (E(e), P(`${e.name} Connection`), O(!1));
37
+ }), Re(!1), U(""), G(!1), q(!1), Be(null), _ ? (A(!1), O(null)) : (A(!0), O(null)));
38
+ }, [h, _]), o(() => {
39
+ if (h && _ && b && !D) {
40
+ let e = b.find((e) => e.id === _);
41
+ e && (O(e), F(`${e.name} Connection`), A(!1));
42
42
  }
43
43
  }, [
44
- g,
45
- v,
46
- x,
47
- T
44
+ h,
45
+ _,
46
+ b,
47
+ D
48
48
  ]), o(() => {
49
- if (g && D) {
50
- let e = setTimeout(() => ze.current?.focus(), 100);
49
+ if (h && k) {
50
+ let e = setTimeout(() => X.current?.focus(), 100);
51
51
  return () => clearTimeout(e);
52
52
  }
53
- }, [g, D]);
54
- let Z = ue(() => {
55
- let e = (x ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
56
- if (!j.trim()) return e;
57
- let t = j.toLowerCase();
53
+ }, [h, k]);
54
+ let Q = de(() => {
55
+ let e = (b ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
56
+ if (!N.trim()) return e;
57
+ let t = N.toLowerCase();
58
58
  return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t) || e.key.toLowerCase().includes(t));
59
- }, [x, j]), Be = ue(() => {
59
+ }, [b, N]), He = de(() => {
60
60
  let e = {};
61
- return Z.forEach((t) => {
61
+ return Q.forEach((t) => {
62
62
  let n = t.category;
63
63
  e[n] || (e[n] = []), e[n].push(t);
64
64
  }), e;
65
- }, [Z]), Ve = le((e) => {
66
- E(e), P(`${e.name} Connection`), O(!1), W("");
67
- }, []), Q = Se || we || q || Ee || Oe || Ae, $ = le(async () => {
68
- if (!(!T || !N.trim())) {
69
- if (!H.vaultId) {
70
- W("Please select a vault for this connection");
65
+ }, [Q]), Ue = le((e) => {
66
+ O(e), F(`${e.name} Connection`), A(!1), U("");
67
+ }, []), $ = Ee || De || K || Oe || ke || Ae, We = le(async () => {
68
+ if (!(!D || !P.trim())) {
69
+ if (!V.vaultId) {
70
+ U("Please select a vault for this connection");
71
71
  return;
72
72
  }
73
- if (H.mode === "existing" && !H.secretId) {
74
- W("Please select an existing vault secret");
73
+ if (V.mode === "existing" && !V.secretId) {
74
+ U("Please select an existing vault secret");
75
75
  return;
76
76
  }
77
77
  try {
78
- W("");
79
- let e = await w({
80
- name: N.trim(),
81
- description: F.trim() || void 0,
82
- providerId: T.id,
83
- vaultId: H.vaultId,
84
- credentialSecretId: H.mode === "existing" ? H.secretId : void 0,
85
- managedSecretName: H.mode === "managed" && H.managedSecretName.trim() || void 0
78
+ U("");
79
+ let e = await x({
80
+ name: P.trim(),
81
+ description: I.trim() || void 0,
82
+ providerId: D.id,
83
+ vaultId: V.vaultId,
84
+ credentialSecretId: V.mode === "existing" ? V.secretId : void 0,
85
+ managedSecretName: V.mode === "managed" && V.managedSecretName.trim() || void 0
86
86
  });
87
87
  if (!e) {
88
- W("Failed to create connection");
88
+ U("Failed to create connection");
89
89
  return;
90
90
  }
91
- switch (Re(e), T.authType) {
91
+ switch (Be(e), D.authType) {
92
92
  case "oauth2": {
93
- let t = await Ce(e, b ? `${b}/integrations/oauth/callback` : "/integrations/oauth/callback", T.key);
93
+ let t = await S(e, y ? `${y}/integrations/oauth/callback` : "/integrations/oauth/callback", D.key);
94
94
  if (t?.redirectUrl) {
95
95
  let n = window.screenX + (window.innerWidth - 600) / 2, r = window.screenY + (window.innerHeight - 700) / 2, i = window.open(t.redirectUrl, "oauth_popup", `width=600,height=700,left=${n},top=${r},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
96
96
  if (!i) {
97
- W("Popup was blocked. Please allow popups for this site and try again.");
97
+ U("Popup was blocked. Please allow popups for this site and try again.");
98
98
  return;
99
99
  }
100
- Y.current = i, J(!0), X.current?.(), X.current = se({
100
+ J.current = i, q(!0), Y.current?.(), Y.current = se({
101
101
  connectionId: e,
102
102
  popup: i,
103
103
  fetchConnectionStatus: async () => {
104
- let { data: t } = await je({ variables: { id: e } });
104
+ let { data: t } = await E({ variables: { id: e } });
105
105
  return t?.getConnection ?? null;
106
106
  },
107
107
  onSuccess: () => {
108
- K(!0), y?.(e);
108
+ G(!0), v?.(e);
109
109
  },
110
- onError: W,
110
+ onError: U,
111
111
  onSettled: () => {
112
- X.current = null, Y.current = null, J(!1);
112
+ Y.current = null, J.current = null, q(!1);
113
113
  }
114
114
  });
115
115
  return;
116
116
  }
117
- K(!0), y?.(e);
117
+ G(!0), v?.(e);
118
118
  break;
119
119
  }
120
120
  case "api_key":
121
121
  if (!L.trim()) {
122
- W("API key is required");
122
+ U("API key is required");
123
123
  return;
124
124
  }
125
- await Te(e, L.trim()), K(!0), y?.(e);
125
+ await C(e, L.trim()), G(!0), v?.(e);
126
126
  break;
127
127
  case "basic_auth":
128
- if (!z.trim() || !B.trim()) {
129
- W("Username and password are required");
128
+ if (!R.trim() || !z.trim()) {
129
+ U("Username and password are required");
130
130
  return;
131
131
  }
132
- await De(e, z.trim(), B.trim()), K(!0), y?.(e);
132
+ await w(e, R.trim(), z.trim()), G(!0), v?.(e);
133
133
  break;
134
134
  case "bearer_token":
135
- if (!V.trim()) {
136
- W("Bearer token is required");
135
+ if (!B.trim()) {
136
+ U("Bearer token is required");
137
137
  return;
138
138
  }
139
- await ke(e, V.trim()), K(!0), y?.(e);
139
+ await T(e, B.trim()), G(!0), v?.(e);
140
140
  break;
141
- default: K(!0), y?.(e);
141
+ default: G(!0), v?.(e);
142
142
  }
143
143
  } catch (e) {
144
- W(e instanceof Error ? e.message : "Connection failed");
144
+ U(e instanceof Error ? e.message : "Connection failed");
145
145
  }
146
146
  }
147
147
  }, [
148
- T,
149
- N,
150
- F,
148
+ D,
149
+ P,
150
+ I,
151
151
  L,
152
+ R,
152
153
  z,
153
154
  B,
154
- V,
155
+ x,
156
+ S,
157
+ E,
158
+ C,
155
159
  w,
156
- Ce,
157
- je,
158
- Te,
159
- De,
160
- ke,
161
- b,
160
+ T,
162
161
  y,
163
- H
164
- ]), He = [{
162
+ v,
163
+ V
164
+ ]), Ge = [{
165
165
  key: "connection",
166
166
  label: "Connection",
167
- icon: he
167
+ icon: ge
168
168
  }, {
169
169
  key: "details",
170
170
  label: "Details",
171
- icon: me
171
+ icon: he
172
172
  }];
173
- return g ? !xe && !C ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
173
+ return h ? !Te && !we ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
174
174
  className: "fixed inset-0 bg-foreground/40 z-50 animate-in fade-in-0 duration-200",
175
- onClick: _
176
- }), /* @__PURE__ */ h("div", {
175
+ onClick: g
176
+ }), /* @__PURE__ */ m("div", {
177
177
  role: "dialog",
178
178
  "aria-modal": "true",
179
179
  "aria-labelledby": "add-connection-denied-title",
180
180
  className: "fixed inset-x-4 top-1/2 z-50 mx-auto flex max-w-md -translate-y-1/2 flex-col items-center gap-4 rounded-xl border border-border bg-background p-8 shadow-2xl text-center",
181
181
  children: [
182
- /* @__PURE__ */ m(_e, {
182
+ /* @__PURE__ */ p(ye, {
183
183
  size: 40,
184
184
  className: "text-muted-foreground"
185
185
  }),
186
- /* @__PURE__ */ m("h2", {
186
+ /* @__PURE__ */ p("h2", {
187
187
  id: "add-connection-denied-title",
188
188
  className: "text-lg font-semibold text-foreground",
189
189
  children: "Access Denied"
190
190
  }),
191
- /* @__PURE__ */ m("p", {
191
+ /* @__PURE__ */ p("p", {
192
192
  className: "text-sm text-muted-foreground",
193
193
  children: "You don't have permission to create connections."
194
194
  }),
195
- /* @__PURE__ */ m("button", {
195
+ /* @__PURE__ */ p("button", {
196
196
  type: "button",
197
- onClick: _,
197
+ onClick: g,
198
198
  className: "px-4 py-2 text-sm font-medium rounded-md border border-border hover:bg-accent transition-colors",
199
199
  children: "Close"
200
200
  })
201
201
  ]
202
- })] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
202
+ })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
203
203
  className: "fixed inset-0 bg-foreground/40 z-50 animate-in fade-in-0 duration-200",
204
- onClick: _
205
- }), /* @__PURE__ */ h("div", {
204
+ onClick: g
205
+ }), /* @__PURE__ */ m("div", {
206
206
  role: "dialog",
207
207
  "aria-modal": "true",
208
208
  "aria-labelledby": "add-connection-dialog-title",
209
209
  className: "fixed inset-x-4 top-4 bottom-4 z-50 mx-auto flex w-auto max-w-2xl flex-col overflow-hidden rounded-xl border border-border bg-background shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200 sm:inset-x-6 sm:top-1/2 sm:bottom-auto sm:w-full sm:-translate-y-1/2",
210
- children: [/* @__PURE__ */ h("div", {
210
+ children: [/* @__PURE__ */ m("div", {
211
211
  className: "flex items-center justify-between px-5 py-4 border-b border-border flex-shrink-0",
212
- children: [/* @__PURE__ */ m("div", {
212
+ children: [/* @__PURE__ */ p("div", {
213
213
  className: "flex items-center gap-3",
214
- children: T && !D ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
215
- provider: T,
214
+ children: D && !k ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(a, {
215
+ provider: D,
216
216
  size: 32
217
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("h2", {
217
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("h2", {
218
218
  id: "add-connection-dialog-title",
219
219
  className: "text-base font-semibold text-foreground",
220
- children: [T.name, " account"]
221
- }), /* @__PURE__ */ m("p", {
220
+ children: [D.name, " account"]
221
+ }), /* @__PURE__ */ p("p", {
222
222
  className: "text-xs text-muted-foreground",
223
- children: r(T.authType)
224
- })] })] }) : /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
223
+ children: r(D.authType)
224
+ })] })] }) : /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
225
225
  id: "add-connection-dialog-title",
226
226
  className: "text-base font-semibold text-foreground",
227
227
  children: "Add new credential"
228
- }), /* @__PURE__ */ m("p", {
228
+ }), /* @__PURE__ */ p("p", {
229
229
  className: "text-xs text-muted-foreground",
230
230
  children: "Select an app or service to connect to"
231
231
  })] })
232
- }), /* @__PURE__ */ h("div", {
232
+ }), /* @__PURE__ */ m("div", {
233
233
  className: "flex items-center gap-2",
234
- children: [T && !D && !G && /* @__PURE__ */ h("button", {
234
+ children: [D && !k && !W && /* @__PURE__ */ m("button", {
235
235
  type: "button",
236
- onClick: $,
237
- disabled: Q || !N.trim(),
236
+ onClick: We,
237
+ disabled: $ || !P.trim(),
238
238
  className: "inline-flex items-center gap-1.5 px-4 py-1.5 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50",
239
- children: [Q ? /* @__PURE__ */ m(d, {
239
+ children: [$ ? /* @__PURE__ */ p(d, {
240
240
  size: 14,
241
241
  className: "animate-spin"
242
- }) : /* @__PURE__ */ m(fe, { size: 14 }), q ? "Waiting..." : "Save"]
243
- }), /* @__PURE__ */ m("button", {
242
+ }) : /* @__PURE__ */ p(pe, { size: 14 }), K ? "Waiting..." : "Save"]
243
+ }), /* @__PURE__ */ p("button", {
244
244
  type: "button",
245
- onClick: _,
245
+ onClick: g,
246
246
  className: "p-1.5 rounded-md hover:bg-accent transition-colors text-muted-foreground hover:text-foreground",
247
247
  "aria-label": "Close",
248
- children: /* @__PURE__ */ m(ve, { size: 20 })
248
+ children: /* @__PURE__ */ p(be, { size: 20 })
249
249
  })]
250
250
  })]
251
- }), /* @__PURE__ */ h("div", {
251
+ }), /* @__PURE__ */ m("div", {
252
252
  className: "flex flex-1 min-h-0 overflow-hidden",
253
253
  children: [
254
- D && !T && /* @__PURE__ */ h("div", {
254
+ k && !D && /* @__PURE__ */ m("div", {
255
255
  className: "flex-1 p-5 overflow-y-auto",
256
256
  children: [
257
- /* @__PURE__ */ m("p", {
257
+ /* @__PURE__ */ p("p", {
258
258
  className: "text-sm text-muted-foreground mb-3",
259
259
  children: "Select an app or service to connect to"
260
260
  }),
261
- /* @__PURE__ */ h("div", {
261
+ /* @__PURE__ */ m("div", {
262
262
  className: "relative mb-4",
263
- children: [/* @__PURE__ */ m(ge, {
263
+ children: [/* @__PURE__ */ p(ve, {
264
264
  size: 16,
265
265
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
266
- }), /* @__PURE__ */ m("input", {
267
- ref: ze,
266
+ }), /* @__PURE__ */ p("input", {
267
+ ref: X,
268
268
  type: "text",
269
- value: j,
270
- onChange: (e) => M(e.target.value),
269
+ value: N,
270
+ onChange: (e) => je(e.target.value),
271
271
  placeholder: "Search providers...",
272
+ "aria-label": "Search providers",
272
273
  className: "w-full pl-9 pr-3 py-2.5 border border-border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
273
274
  })]
274
275
  }),
275
- S ? /* @__PURE__ */ m("div", {
276
+ Se ? /* @__PURE__ */ p("div", {
276
277
  className: "flex items-center justify-center py-8",
277
- children: /* @__PURE__ */ m(d, {
278
+ children: /* @__PURE__ */ p(d, {
278
279
  size: 24,
279
280
  className: "animate-spin text-muted-foreground"
280
281
  })
281
- }) : Z.length === 0 ? /* @__PURE__ */ h("div", {
282
+ }) : Q.length === 0 ? /* @__PURE__ */ m("div", {
282
283
  className: "text-center py-8 text-sm text-muted-foreground",
283
284
  children: [
284
285
  "No providers found matching “",
285
- j,
286
+ N,
286
287
  "”"
287
288
  ]
288
- }) : /* @__PURE__ */ m("div", {
289
+ }) : /* @__PURE__ */ p("div", {
289
290
  className: "max-h-[400px] overflow-y-auto space-y-1",
290
- children: Object.entries(Be).map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
291
+ children: Object.entries(He).map(([e, t]) => /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
291
292
  className: "px-2 py-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wider",
292
293
  children: i(e)
293
- }), t.map((e) => /* @__PURE__ */ h("button", {
294
+ }), t.map((e) => /* @__PURE__ */ m("button", {
294
295
  type: "button",
295
- onClick: () => Ve(e),
296
+ onClick: () => Ue(e),
296
297
  className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
297
- children: [/* @__PURE__ */ m(a, {
298
+ children: [/* @__PURE__ */ p(a, {
298
299
  provider: e,
299
300
  size: 32
300
- }), /* @__PURE__ */ h("div", {
301
+ }), /* @__PURE__ */ m("div", {
301
302
  className: "flex-1 min-w-0",
302
- children: [/* @__PURE__ */ m("div", {
303
+ children: [/* @__PURE__ */ p("div", {
303
304
  className: "text-sm font-medium text-foreground",
304
305
  children: e.name
305
- }), /* @__PURE__ */ m("div", {
306
+ }), /* @__PURE__ */ p("div", {
306
307
  className: "text-xs text-muted-foreground",
307
308
  children: r(e.authType)
308
309
  })]
@@ -311,279 +312,298 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
311
312
  })
312
313
  ]
313
314
  }),
314
- !D && !T && S && /* @__PURE__ */ m("div", {
315
+ !k && !D && Se && /* @__PURE__ */ p("div", {
315
316
  className: "flex-1 flex items-center justify-center",
316
- children: /* @__PURE__ */ m(d, {
317
+ children: /* @__PURE__ */ p(d, {
317
318
  size: 32,
318
319
  className: "animate-spin text-muted-foreground"
319
320
  })
320
321
  }),
321
- G && T && /* @__PURE__ */ h("div", {
322
+ W && D && /* @__PURE__ */ m("div", {
322
323
  className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
323
324
  children: [
324
- /* @__PURE__ */ m("div", {
325
+ /* @__PURE__ */ p("div", {
325
326
  className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
326
- children: /* @__PURE__ */ m(pe, {
327
+ children: /* @__PURE__ */ p(me, {
327
328
  size: 48,
328
329
  className: "text-status-success-text"
329
330
  })
330
331
  }),
331
- /* @__PURE__ */ m("h3", {
332
+ /* @__PURE__ */ p("h3", {
332
333
  className: "text-lg font-semibold text-foreground mb-1",
333
334
  children: "Connection Created!"
334
335
  }),
335
- /* @__PURE__ */ h("p", {
336
+ /* @__PURE__ */ m("p", {
336
337
  className: "text-sm text-muted-foreground mb-6",
337
338
  children: [
338
339
  "Your ",
339
- T.name,
340
+ D.name,
340
341
  " connection has been set up successfully."
341
342
  ]
342
343
  }),
343
- /* @__PURE__ */ m("button", {
344
+ /* @__PURE__ */ p("button", {
344
345
  type: "button",
345
- onClick: _,
346
+ onClick: g,
346
347
  className: "px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",
347
348
  children: "Close dialog"
348
349
  })
349
350
  ]
350
351
  }),
351
- T && !D && !G && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
352
+ D && !k && !W && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", {
352
353
  className: "w-full border-b border-border sm:w-40 sm:border-b-0 sm:border-r flex-shrink-0 py-3 overflow-x-auto",
353
- children: He.map((e) => {
354
+ children: Ge.map((e) => {
354
355
  let n = e.icon;
355
- return /* @__PURE__ */ h("button", {
356
+ return /* @__PURE__ */ m("button", {
356
357
  type: "button",
357
- onClick: () => A(e.key),
358
- className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", k === e.key ? "text-foreground bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2" : "text-muted-foreground hover:text-foreground hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2"),
359
- children: [/* @__PURE__ */ m(n, { size: 16 }), e.label]
358
+ onClick: () => M(e.key),
359
+ className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", j === e.key ? "text-foreground bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2" : "text-muted-foreground hover:text-foreground hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2"),
360
+ children: [/* @__PURE__ */ p(n, { size: 16 }), e.label]
360
361
  }, e.key);
361
362
  })
362
- }), /* @__PURE__ */ h("div", {
363
+ }), /* @__PURE__ */ m("div", {
363
364
  className: "flex-1 p-5 overflow-y-auto",
364
- children: [k === "connection" && /* @__PURE__ */ h("div", {
365
+ children: [j === "connection" && /* @__PURE__ */ m("div", {
365
366
  className: "space-y-5",
366
367
  children: [
367
- Le && /* @__PURE__ */ h("div", {
368
+ ze && /* @__PURE__ */ m("div", {
368
369
  className: "flex items-center gap-2 px-3 py-2 rounded-md bg-destructive/10 border border-destructive/20",
369
- children: [/* @__PURE__ */ m(de, {
370
+ children: [/* @__PURE__ */ p(fe, {
370
371
  size: 16,
371
372
  className: "text-destructive flex-shrink-0"
372
- }), /* @__PURE__ */ m("span", {
373
+ }), /* @__PURE__ */ p("span", {
373
374
  className: "text-sm text-destructive",
374
- children: Le
375
+ children: ze
375
376
  })]
376
377
  }),
377
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
378
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
379
+ htmlFor: Z("conn-name"),
378
380
  className: "block text-sm font-medium text-foreground mb-1.5",
379
- children: ["Connection Name ", /* @__PURE__ */ m("span", {
381
+ children: ["Connection Name ", /* @__PURE__ */ p("span", {
380
382
  className: "text-status-error-text",
381
383
  children: "*"
382
384
  })]
383
- }), /* @__PURE__ */ m("input", {
385
+ }), /* @__PURE__ */ p("input", {
386
+ id: Z("conn-name"),
387
+ "aria-label": "Connection Name",
384
388
  type: "text",
385
- value: N,
386
- onChange: (e) => P(e.target.value),
387
- placeholder: `My ${T.name} Connection`,
388
- disabled: Q,
389
+ value: P,
390
+ onChange: (e) => F(e.target.value),
391
+ placeholder: `My ${D.name} Connection`,
392
+ disabled: $,
389
393
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
390
394
  })] }),
391
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
395
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
396
+ htmlFor: Z("conn-desc"),
392
397
  className: "block text-sm font-medium text-foreground mb-1.5",
393
398
  children: "Description"
394
- }), /* @__PURE__ */ m("input", {
399
+ }), /* @__PURE__ */ p("input", {
400
+ id: Z("conn-desc"),
401
+ "aria-label": "Description",
395
402
  type: "text",
396
- value: F,
397
- onChange: (e) => I(e.target.value),
403
+ value: I,
404
+ onChange: (e) => Me(e.target.value),
398
405
  placeholder: "Optional description",
399
- disabled: Q,
406
+ disabled: $,
400
407
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
401
408
  })] }),
402
- /* @__PURE__ */ m(ce, {
403
- value: H,
404
- onChange: Fe,
405
- providerAuthType: T.authType
409
+ /* @__PURE__ */ p(ce, {
410
+ value: V,
411
+ onChange: Le,
412
+ providerAuthType: D.authType
406
413
  }),
407
- /* @__PURE__ */ h("div", {
414
+ /* @__PURE__ */ m("div", {
408
415
  className: "rounded-md border border-border/50 bg-card p-4",
409
416
  children: [
410
- /* @__PURE__ */ h("h3", {
417
+ /* @__PURE__ */ m("h3", {
411
418
  className: "font-medium text-foreground flex items-center gap-2 mb-3 text-sm",
412
419
  children: [
413
- /* @__PURE__ */ m(_e, {
420
+ /* @__PURE__ */ p(ye, {
414
421
  size: 16,
415
422
  className: "text-primary"
416
423
  }),
417
424
  "Authentication: ",
418
- r(T.authType)
425
+ r(D.authType)
419
426
  ]
420
427
  }),
421
- T.authType === "oauth2" && /* @__PURE__ */ m("div", {
428
+ D.authType === "oauth2" && /* @__PURE__ */ p("div", {
422
429
  className: "space-y-3",
423
- children: q ? /* @__PURE__ */ h("div", {
430
+ children: K ? /* @__PURE__ */ m("div", {
424
431
  className: "flex flex-col items-center gap-3 py-4",
425
432
  children: [
426
- /* @__PURE__ */ m(d, {
433
+ /* @__PURE__ */ p(d, {
427
434
  size: 28,
428
435
  className: "animate-spin text-primary"
429
436
  }),
430
- /* @__PURE__ */ h("p", {
437
+ /* @__PURE__ */ m("p", {
431
438
  className: "text-sm font-medium text-foreground",
432
439
  children: [
433
440
  "Waiting for ",
434
- T.name,
441
+ D.name,
435
442
  " authorization…"
436
443
  ]
437
444
  }),
438
- /* @__PURE__ */ m("p", {
445
+ /* @__PURE__ */ p("p", {
439
446
  className: "text-xs text-muted-foreground",
440
447
  children: "Complete the sign-in in the popup window"
441
448
  }),
442
- /* @__PURE__ */ h("div", {
449
+ /* @__PURE__ */ m("div", {
443
450
  className: "p-2 rounded-md bg-status-warning-bg-subtle border border-border-default text-xs text-status-warning-text flex items-center gap-1.5",
444
- children: [/* @__PURE__ */ m(l, { size: 12 }), "Don't see the popup? Check if it was blocked"]
451
+ children: [/* @__PURE__ */ p(l, { size: 12 }), "Don't see the popup? Check if it was blocked"]
445
452
  })
446
453
  ]
447
- }) : /* @__PURE__ */ h("div", {
454
+ }) : /* @__PURE__ */ m("div", {
448
455
  className: "space-y-3",
449
- children: [/* @__PURE__ */ h("div", {
456
+ children: [/* @__PURE__ */ m("div", {
450
457
  className: "p-2.5 rounded-md bg-status-info-bg-subtle border border-border-default text-sm text-status-info-text flex items-center gap-2",
451
458
  children: [
452
- /* @__PURE__ */ m(l, { size: 14 }),
459
+ /* @__PURE__ */ p(l, { size: 14 }),
453
460
  "A popup window will open for",
454
461
  " ",
455
- T.name,
462
+ D.name,
456
463
  " sign-in"
457
464
  ]
458
- }), /* @__PURE__ */ h("button", {
465
+ }), /* @__PURE__ */ m("button", {
459
466
  type: "button",
460
- onClick: $,
461
- disabled: Q || !N.trim(),
467
+ onClick: We,
468
+ disabled: $ || !P.trim(),
462
469
  className: "w-full inline-flex items-center justify-center gap-2.5 rounded-md border border-primary bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",
463
470
  children: [
464
- /* @__PURE__ */ m(a, {
465
- provider: T,
471
+ /* @__PURE__ */ p(a, {
472
+ provider: D,
466
473
  size: 20
467
474
  }),
468
475
  "Sign in with",
469
476
  " ",
470
- T.name.replace(/^(Google|Microsoft)\s/, "")
477
+ D.name.replace(/^(Google|Microsoft)\s/, "")
471
478
  ]
472
479
  })]
473
480
  })
474
481
  }),
475
- T.authType === "api_key" && /* @__PURE__ */ h("div", {
482
+ D.authType === "api_key" && /* @__PURE__ */ m("div", {
476
483
  className: "space-y-3",
477
- children: [/* @__PURE__ */ h("p", {
484
+ children: [/* @__PURE__ */ m("p", {
478
485
  className: "text-xs text-muted-foreground",
479
486
  children: [
480
487
  "Enter your ",
481
- T.name,
488
+ D.name,
482
489
  " API key."
483
490
  ]
484
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
491
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
492
+ htmlFor: Z("api-key"),
485
493
  className: "block text-sm font-medium text-foreground mb-1.5",
486
- children: ["API Key ", /* @__PURE__ */ m("span", {
494
+ children: ["API Key ", /* @__PURE__ */ p("span", {
487
495
  className: "text-status-error-text",
488
496
  children: "*"
489
497
  })]
490
- }), /* @__PURE__ */ h("div", {
498
+ }), /* @__PURE__ */ m("div", {
491
499
  className: "relative",
492
500
  children: [
493
- /* @__PURE__ */ m(u, {
501
+ /* @__PURE__ */ p(u, {
494
502
  size: 14,
495
503
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
496
504
  }),
497
- /* @__PURE__ */ m("input", {
498
- type: U ? "text" : "password",
505
+ /* @__PURE__ */ p("input", {
506
+ id: Z("api-key"),
507
+ "aria-label": "API Key",
508
+ type: H ? "text" : "password",
499
509
  value: L,
500
- onChange: (e) => R(e.target.value),
510
+ onChange: (e) => Ne(e.target.value),
501
511
  placeholder: "Enter your API key",
502
- disabled: Q,
512
+ disabled: $,
503
513
  className: "w-full pl-9 pr-10 py-2 border border-border rounded-md bg-background text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
504
514
  }),
505
- /* @__PURE__ */ m("button", {
515
+ /* @__PURE__ */ p("button", {
506
516
  type: "button",
507
- onClick: () => Ie(!U),
517
+ onClick: () => Re(!H),
518
+ "aria-label": H ? "Hide secret" : "Show secret",
508
519
  className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",
509
- children: m(U ? f : u, { size: 14 })
520
+ children: p(H ? _e : u, { size: 14 })
510
521
  })
511
522
  ]
512
523
  })] })]
513
524
  }),
514
- T.authType === "basic_auth" && /* @__PURE__ */ h("div", {
525
+ D.authType === "basic_auth" && /* @__PURE__ */ m("div", {
515
526
  className: "space-y-3",
516
527
  children: [
517
- /* @__PURE__ */ h("p", {
528
+ /* @__PURE__ */ m("p", {
518
529
  className: "text-xs text-muted-foreground",
519
530
  children: [
520
531
  "Enter your ",
521
- T.name,
532
+ D.name,
522
533
  " credentials."
523
534
  ]
524
535
  }),
525
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
536
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
537
+ htmlFor: Z("username"),
526
538
  className: "block text-sm font-medium text-foreground mb-1.5",
527
- children: ["Username ", /* @__PURE__ */ m("span", {
539
+ children: ["Username ", /* @__PURE__ */ p("span", {
528
540
  className: "text-status-error-text",
529
541
  children: "*"
530
542
  })]
531
- }), /* @__PURE__ */ m("input", {
543
+ }), /* @__PURE__ */ p("input", {
544
+ id: Z("username"),
545
+ "aria-label": "Username",
532
546
  type: "text",
533
- value: z,
534
- onChange: (e) => Me(e.target.value),
547
+ value: R,
548
+ onChange: (e) => Pe(e.target.value),
535
549
  placeholder: "Username or email",
536
- disabled: Q,
550
+ disabled: $,
537
551
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
538
552
  })] }),
539
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
553
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
554
+ htmlFor: Z("password"),
540
555
  className: "block text-sm font-medium text-foreground mb-1.5",
541
- children: ["Password ", /* @__PURE__ */ m("span", {
556
+ children: ["Password ", /* @__PURE__ */ p("span", {
542
557
  className: "text-status-error-text",
543
558
  children: "*"
544
559
  })]
545
- }), /* @__PURE__ */ h("div", {
560
+ }), /* @__PURE__ */ m("div", {
546
561
  className: "relative",
547
- children: [/* @__PURE__ */ m(f, {
562
+ children: [/* @__PURE__ */ p(_e, {
548
563
  size: 14,
549
564
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
550
- }), /* @__PURE__ */ m("input", {
565
+ }), /* @__PURE__ */ p("input", {
566
+ id: Z("password"),
567
+ "aria-label": "Password",
551
568
  type: "password",
552
- value: B,
553
- onChange: (e) => Ne(e.target.value),
569
+ value: z,
570
+ onChange: (e) => Fe(e.target.value),
554
571
  placeholder: "Password",
555
- disabled: Q,
572
+ disabled: $,
556
573
  className: "w-full pl-9 pr-3 py-2 border border-border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
557
574
  })]
558
575
  })] })
559
576
  ]
560
577
  }),
561
- T.authType === "bearer_token" && /* @__PURE__ */ h("div", {
578
+ D.authType === "bearer_token" && /* @__PURE__ */ m("div", {
562
579
  className: "space-y-3",
563
- children: [/* @__PURE__ */ h("p", {
580
+ children: [/* @__PURE__ */ m("p", {
564
581
  className: "text-xs text-muted-foreground",
565
582
  children: [
566
583
  "Enter your ",
567
- T.name,
584
+ D.name,
568
585
  " bearer token."
569
586
  ]
570
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
587
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("label", {
588
+ htmlFor: Z("bearer-token"),
571
589
  className: "block text-sm font-medium text-foreground mb-1.5",
572
- children: ["Bearer Token ", /* @__PURE__ */ m("span", {
590
+ children: ["Bearer Token ", /* @__PURE__ */ p("span", {
573
591
  className: "text-status-error-text",
574
592
  children: "*"
575
593
  })]
576
- }), /* @__PURE__ */ h("div", {
594
+ }), /* @__PURE__ */ m("div", {
577
595
  className: "relative",
578
- children: [/* @__PURE__ */ m(u, {
596
+ children: [/* @__PURE__ */ p(u, {
579
597
  size: 14,
580
598
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
581
- }), /* @__PURE__ */ m("input", {
599
+ }), /* @__PURE__ */ p("input", {
600
+ id: Z("bearer-token"),
601
+ "aria-label": "Bearer Token",
582
602
  type: "password",
583
- value: V,
584
- onChange: (e) => Pe(e.target.value),
603
+ value: B,
604
+ onChange: (e) => Ie(e.target.value),
585
605
  placeholder: "Enter your token",
586
- disabled: Q,
606
+ disabled: $,
587
607
  className: "w-full pl-9 pr-3 py-2 border border-border rounded-md bg-background text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
588
608
  })]
589
609
  })] })]
@@ -591,58 +611,58 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
591
611
  ]
592
612
  })
593
613
  ]
594
- }), k === "details" && /* @__PURE__ */ h("div", {
614
+ }), j === "details" && /* @__PURE__ */ m("div", {
595
615
  className: "space-y-4",
596
- children: [/* @__PURE__ */ m("h3", {
616
+ children: [/* @__PURE__ */ p("h3", {
597
617
  className: "text-sm font-semibold text-foreground",
598
618
  children: "Details"
599
- }), /* @__PURE__ */ h("div", {
619
+ }), /* @__PURE__ */ m("div", {
600
620
  className: "space-y-3",
601
621
  children: [
602
- /* @__PURE__ */ h("div", {
622
+ /* @__PURE__ */ m("div", {
603
623
  className: "flex items-center gap-3 p-3 rounded-md border border-border",
604
- children: [/* @__PURE__ */ m(a, {
605
- provider: T,
624
+ children: [/* @__PURE__ */ p(a, {
625
+ provider: D,
606
626
  size: 40
607
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
627
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
608
628
  className: "text-sm font-medium text-foreground",
609
- children: T.name
610
- }), /* @__PURE__ */ h("p", {
629
+ children: D.name
630
+ }), /* @__PURE__ */ m("p", {
611
631
  className: "text-xs text-muted-foreground",
612
632
  children: [
613
- r(T.authType),
633
+ r(D.authType),
614
634
  " ·",
615
635
  " ",
616
- i(T.category)
636
+ i(D.category)
617
637
  ]
618
638
  })] })]
619
639
  }),
620
- T.description && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
640
+ D.description && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
621
641
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
622
642
  children: "Description"
623
- }), /* @__PURE__ */ m("p", {
643
+ }), /* @__PURE__ */ p("p", {
624
644
  className: "text-sm text-foreground mt-1",
625
- children: T.description
645
+ children: D.description
626
646
  })] }),
627
- T.website && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
647
+ D.website && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
628
648
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
629
649
  children: "Website"
630
- }), /* @__PURE__ */ m("a", {
631
- href: T.website,
650
+ }), /* @__PURE__ */ p("a", {
651
+ href: D.website,
632
652
  target: "_blank",
633
653
  rel: "noopener noreferrer",
634
654
  className: "block text-sm text-primary hover:underline mt-1",
635
- children: T.website
655
+ children: D.website
636
656
  })] }),
637
- T.docsUrl && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
657
+ D.docsUrl && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
638
658
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
639
659
  children: "Documentation"
640
- }), /* @__PURE__ */ m("a", {
641
- href: T.docsUrl,
660
+ }), /* @__PURE__ */ p("a", {
661
+ href: D.docsUrl,
642
662
  target: "_blank",
643
663
  rel: "noopener noreferrer",
644
664
  className: "block text-sm text-primary hover:underline mt-1",
645
- children: T.docsUrl
665
+ children: D.docsUrl
646
666
  })] })
647
667
  ]
648
668
  })]
@@ -653,6 +673,6 @@ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated:
653
673
  })] }) : null;
654
674
  }
655
675
  //#endregion
656
- export { g as AddConnectionDialog };
676
+ export { h as AddConnectionDialog };
657
677
 
658
678
  //# sourceMappingURL=AddConnectionDialog.js.map