@burdenoff/microfe-integrations 2026.510.111

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