@burdenoff/microfe-integrations 2026.527.2 → 2026.529.1

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