@burdenoff/microfe-integrations 2026.830.4 → 2026.919.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.
@@ -1,117 +1,124 @@
1
1
  import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
2
2
  import { useTr as t } from "../hooks/useTr.js";
3
3
  import { cn as n } from "../utils/cn.js";
4
- import { INTEGRATION_PERMISSIONS as ee } from "../constants/permissions.js";
5
- import { joinPath as r } from "../utils/navigation.js";
6
- import { parseConfigSchema as te } from "../utils/integrationsHelpers.js";
7
- import { useAuthTypeLabel as ne, useCategoryLabel as re } from "../hooks/useLabel.js";
8
- import { useGetConnectionLazyQuery as ie } from "../../generated/wspace-operations.js";
9
- import { useProvider as ae, useProviderByKey as oe, useProviders as se } from "../hooks/useProviders.js";
10
- import { useAuthenticateWithApiKey as ce, useAuthenticateWithBasicAuth as le, useAuthenticateWithBearerToken as ue, useAuthenticateWithCustomConfig as de, useAuthenticateWithServiceAccount as fe, useCreateConnection as pe, useInitiateOAuth as me } from "../hooks/useConnections.js";
11
- import { waitForOAuthPopupCompletion as he } from "../utils/oauthPopup.js";
12
- import { CredentialStorageSelector as ge } from "../components/CredentialStorageSelector.js";
13
- import { ProviderIcon as _e } from "../components/ProviderIcon.js";
14
- import { useCallback as i, useEffect as ve, useMemo as a, useRef as ye, useState as o } from "react";
15
- import { AlertCircle as s, ArrowLeft as be, ArrowRight as xe, Check as Se, CheckCircle2 as Ce, ExternalLink as we, Key as c, Link as Te, Loader2 as l, Lock as Ee, Search as De, Shield as Oe } from "lucide-react";
16
- import { useLocation as ke, useParams as Ae } from "react-router";
17
- import { usePermissions as je } from "@burdenoff/fe-libs/shared/providers/shell";
18
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
19
- import { Button as f, GlassCard as Me, IllustratedEmptyState as Ne, PagePurpose as Pe } from "@burdenoff/fe-libs/ui";
4
+ import { INTEGRATION_PERMISSIONS as r } from "../constants/permissions.js";
5
+ import { joinPath as i } from "../utils/navigation.js";
6
+ import { useAuthTypeLabel as ee, useCategoryLabel as te } from "../hooks/useLabel.js";
7
+ import { useGetConnectionLazyQuery as ne } from "../../generated/wspace-operations.js";
8
+ import { useProvider as re, useProviderByKey as ie, useProviders as ae } from "../hooks/useProviders.js";
9
+ import { useAuthenticateWithApiKey as oe, useAuthenticateWithBasicAuth as se, useAuthenticateWithBearerToken as ce, useAuthenticateWithCustomConfig as le, useAuthenticateWithServiceAccount as ue, useCreateConnection as de, useInitiateOAuth as fe } from "../hooks/useConnections.js";
10
+ import { waitForOAuthPopupCompletion as pe } from "../utils/oauthPopup.js";
11
+ import { CredentialStorageSelector as me } from "../components/CredentialStorageSelector.js";
12
+ import { ProviderIcon as he } from "../components/ProviderIcon.js";
13
+ import { SchemaForm as ge, initialValuesFromSchema as _e, isSchemaComplete as ve, parseFormSchema as ye, visibleValues as be } from "../components/SchemaForm.js";
14
+ import { useCallback as a, useEffect as xe, useMemo as o, useRef as s, useState as c } from "react";
15
+ import { AlertCircle as l, ArrowLeft as Se, ArrowRight as Ce, Check as we, CheckCircle2 as Te, ExternalLink as Ee, Key as u, Link as De, Loader2 as d, Lock as Oe, Search as ke, Shield as Ae } from "lucide-react";
16
+ import { useLocation as je, useParams as Me } from "react-router";
17
+ import { usePermissions as Ne } from "@burdenoff/fe-libs/shared/providers/shell";
18
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
19
+ import { Button as m, GlassCard as Pe, IllustratedEmptyState as Fe, PagePurpose as Ie } from "@burdenoff/fe-libs/ui";
20
20
  //#region src/integrations/pages/AddConnectionWizard.tsx
21
- function p() {
22
- let { providerId: p } = Ae(), { basePath: m = "/", navigate: h, apiGatewayUrl: g } = e(), _ = t(), Fe = re(), v = ne(), y = ke().search, b = a(() => new URLSearchParams(y), [y]), x = b.get("providerKey") ?? null, S = b.get("returnTo") ?? null, C = b.get("channelId") ?? null, w = !!(S && C), { provider: T, loading: Ie } = oe(x ?? ""), { providers: E, loading: D } = se(), { hasPermission: Le, isLoading: Re } = je(), ze = Le(ee.CONNECTION_CREATE), { createConnection: O, loading: Be } = pe(), { initiateOAuth: Ve, loading: He } = me(), { authenticateWithApiKey: Ue, loading: We } = ce(), { authenticateWithBasicAuth: Ge, loading: Ke } = le(), { authenticateWithBearerToken: k, loading: qe } = ue(), { authenticateWithServiceAccount: Je, loading: Ye } = fe(), { authenticateWithCustomConfig: Xe, loading: Ze } = de(), [Qe] = ie({ fetchPolicy: "network-only" }), [A, j] = o(p || x ? "configure" : "select_provider"), [M, $e] = o(null), [N, et] = o(""), [P, F] = o(""), [I, tt] = o(""), [L, nt] = o(""), [R, rt] = o(""), [z, it] = o(""), [B, at] = o(""), [V, ot] = o({}), [H, st] = o({
21
+ function h() {
22
+ let { providerId: h } = Me(), { basePath: g = "/", navigate: _, apiGatewayUrl: v } = e(), y = t(), Le = te(), b = ee(), Re = je().search, x = o(() => new URLSearchParams(Re), [Re]), S = x.get("providerKey") ?? null, C = x.get("returnTo") ?? null, w = x.get("channelId") ?? null, T = !!(C && w), { provider: ze, loading: Be } = ie(S ?? ""), { providers: E, loading: D } = ae(), { hasPermission: Ve, isLoading: He } = Ne(), Ue = Ve(r.CONNECTION_CREATE), { createConnection: We, loading: Ge } = de(), { initiateOAuth: O, loading: Ke } = fe(), { authenticateWithApiKey: k, loading: qe } = oe(), { authenticateWithBasicAuth: Je, loading: Ye } = se(), { authenticateWithBearerToken: Xe, loading: Ze } = ce(), { authenticateWithServiceAccount: Qe, loading: $e } = ue(), { authenticateWithCustomConfig: et, loading: tt } = le(), [nt] = ne({ fetchPolicy: "network-only" }), [A, j] = c(h || S ? "configure" : "select_provider"), [M, rt] = c(null), [N, it] = c(""), [P, F] = c(""), [I, at] = c(""), [L, ot] = c(""), [R, st] = c(""), [z, ct] = c(""), [B, lt] = c(""), [ut, dt] = c({}), [V, ft] = c({
23
23
  mode: "managed",
24
24
  vaultId: "",
25
25
  secretId: "",
26
26
  managedSecretName: ""
27
- }), [U, W] = o(""), [G, ct] = o(null), [lt, ut] = o(!1), K = ye(null), q = ye(null);
28
- ve(() => () => {
29
- q.current?.(), K.current && !K.current.closed && K.current.close();
27
+ }), [H, U] = c(""), [W, pt] = c(null), [mt, ht] = c(!1), G = s(null), K = s(null);
28
+ xe(() => () => {
29
+ K.current?.(), G.current && !G.current.closed && G.current.close();
30
30
  }, []);
31
- let J = a(() => !p || !E ? null : E.find((e) => e.id === p) || null, [p, E]), { provider: dt, loading: ft } = ae(p && !J && !D ? p : ""), Y = a(() => T ?? J ?? dt, [
32
- T,
33
- J,
34
- dt
31
+ let q = o(() => !h || !E ? null : E.find((e) => e.id === h) || null, [h, E]), { provider: gt, loading: _t } = re(h && !q && !D ? h : ""), J = o(() => ze ?? q ?? gt, [
32
+ ze,
33
+ q,
34
+ gt
35
35
  ]);
36
- ve(() => {
37
- Y && !M && A === "configure" && ($e(Y), P || F(`${Y.name} Connection`));
36
+ xe(() => {
37
+ J && !M && A === "configure" && (rt(J), P || F(`${J.name} Connection`));
38
38
  }, [
39
- Y,
39
+ J,
40
40
  M,
41
41
  A,
42
42
  P
43
43
  ]);
44
- let pt = a(() => {
44
+ let Y = o(() => {
45
+ if (!M) return null;
46
+ let e = (M.authMethods ?? []).filter((e) => e.isEnabled);
47
+ return ye((e.find((e) => e.authType === "custom") ?? e.find((e) => e.isDefault) ?? e[0] ?? null)?.configSchema ?? M.configSchema);
48
+ }, [M]), X = o(() => ({
49
+ ..._e(Y),
50
+ ...ut
51
+ }), [Y, ut]), vt = o(() => {
45
52
  let e = (E ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
46
53
  if (!N) return e;
47
54
  let t = N.toLowerCase();
48
55
  return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t));
49
- }, [E, N]), mt = i((e) => {
50
- $e(e), F(`${e.name} Connection`), j("configure");
51
- }, []), ht = i(() => {
56
+ }, [E, N]), yt = a((e) => {
57
+ rt(e), dt({}), F(`${e.name} Connection`), j("configure");
58
+ }, []), bt = a(() => {
52
59
  if (!P.trim()) {
53
- W(_("integrations.addConnection.errors.nameRequired", "Connection name is required"));
60
+ U(y("integrations.addConnection.errors.nameRequired", "Connection name is required"));
54
61
  return;
55
62
  }
56
- if (!H.vaultId) {
57
- W(_("integrations.addConnection.errors.vaultRequired", "Please select a vault for storing or referencing credentials"));
63
+ if (!V.vaultId) {
64
+ U(y("integrations.addConnection.errors.vaultRequired", "Please select a vault for storing or referencing credentials"));
58
65
  return;
59
66
  }
60
- if (H.mode === "existing" && !H.secretId) {
61
- W(_("integrations.addConnection.errors.secretRequired", "Please select an existing vault secret to reuse"));
67
+ if (V.mode === "existing" && !V.secretId) {
68
+ U(y("integrations.addConnection.errors.secretRequired", "Please select an existing vault secret to reuse"));
62
69
  return;
63
70
  }
64
- W(""), j("authenticate");
71
+ U(""), j("authenticate");
65
72
  }, [
66
73
  P,
67
- H,
68
- _
69
- ]), gt = i(async () => {
74
+ V,
75
+ y
76
+ ]), xt = a(async () => {
70
77
  if (M) try {
71
- W("");
72
- let e = g ? `${g}/integrations/oauth/callback` : "/integrations/oauth/callback", t = w ? {
73
- returnTo: S,
74
- channelId: C
75
- } : void 0, n = G ?? await O({
78
+ U("");
79
+ let e = v ? `${v}/integrations/oauth/callback` : "/integrations/oauth/callback", t = T ? {
80
+ returnTo: C,
81
+ channelId: w
82
+ } : void 0, n = W ?? await We({
76
83
  name: P.trim(),
77
84
  description: I.trim(),
78
85
  providerId: M.id,
79
- vaultId: H.vaultId,
80
- credentialSecretId: H.mode === "existing" ? H.secretId : void 0,
81
- managedSecretName: H.mode === "managed" && H.managedSecretName.trim() || void 0,
86
+ vaultId: V.vaultId,
87
+ credentialSecretId: V.mode === "existing" ? V.secretId : void 0,
88
+ managedSecretName: V.mode === "managed" && V.managedSecretName.trim() || void 0,
82
89
  ...t ? { config: t } : {}
83
90
  });
84
91
  if (!n) {
85
- W(_("integrations.addConnection.errors.createFailed", "Failed to create connection")), j("error");
92
+ U(y("integrations.addConnection.errors.createFailed", "Failed to create connection")), j("error");
86
93
  return;
87
94
  }
88
- switch (ct(n), M.authType) {
95
+ switch (pt(n), M.authType) {
89
96
  case "oauth2": {
90
- let t = await Ve(n, e, M.key);
91
- if (t?.redirectUrl) if (w) {
97
+ let t = await O(n, e, M.key);
98
+ if (t?.redirectUrl) if (T) {
92
99
  window.location.href = t.redirectUrl;
93
100
  return;
94
101
  } else {
95
- let e = window.screenX + (window.innerWidth - 600) / 2, ee = window.screenY + (window.innerHeight - 700) / 2, r = window.open(t.redirectUrl, "oauth_popup", `width=600,height=700,left=${e},top=${ee},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
96
- if (!r) {
97
- W(_("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again.")), j("error");
102
+ 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`);
103
+ if (!i) {
104
+ U(y("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again.")), j("error");
98
105
  return;
99
106
  }
100
- K.current = r, ut(!0), q.current?.(), q.current = he({
107
+ G.current = i, ht(!0), K.current?.(), K.current = pe({
101
108
  connectionId: n,
102
- popup: r,
109
+ popup: i,
103
110
  fetchConnectionStatus: async () => {
104
- let { data: e } = await Qe({ variables: { id: n } });
111
+ let { data: e } = await nt({ variables: { id: n } });
105
112
  return e?.getConnection ?? null;
106
113
  },
107
114
  onSuccess: () => {
108
115
  j("success");
109
116
  },
110
117
  onError: (e) => {
111
- W(e), j("error");
118
+ U(e), j("error");
112
119
  },
113
120
  onSettled: () => {
114
- q.current = null, K.current = null, ut(!1);
121
+ K.current = null, G.current = null, ht(!1);
115
122
  }
116
123
  });
117
124
  return;
@@ -121,230 +128,230 @@ function p() {
121
128
  }
122
129
  case "api_key":
123
130
  if (!L.trim()) {
124
- W(_("integrations.addConnection.errors.apiKeyRequired", "API key is required"));
131
+ U(y("integrations.addConnection.errors.apiKeyRequired", "API key is required"));
125
132
  return;
126
133
  }
127
- await Ue(n, L.trim()), j("success");
134
+ await k(n, L.trim()), j("success");
128
135
  break;
129
136
  case "basic_auth":
130
137
  if (!R.trim() || !z.trim()) {
131
- W(_("integrations.addConnection.errors.basicAuthRequired", "Username and password are required"));
138
+ U(y("integrations.addConnection.errors.basicAuthRequired", "Username and password are required"));
132
139
  return;
133
140
  }
134
- await Ge(n, R.trim(), z.trim()), j("success");
141
+ await Je(n, R.trim(), z.trim()), j("success");
135
142
  break;
136
143
  case "bearer_token":
137
144
  if (!B.trim()) {
138
- W(_("integrations.addConnection.errors.bearerTokenRequired", "Bearer token is required"));
145
+ U(y("integrations.addConnection.errors.bearerTokenRequired", "Bearer token is required"));
139
146
  return;
140
147
  }
141
- await k(n, B.trim()), j("success");
148
+ await Xe(n, B.trim()), j("success");
142
149
  break;
143
150
  case "service_account":
144
- await Je(n, M.defaultScopes && M.defaultScopes.length > 0 ? M.defaultScopes : void 0), j("success");
151
+ await Qe(n, M.defaultScopes && M.defaultScopes.length > 0 ? M.defaultScopes : void 0), j("success");
145
152
  break;
146
153
  case "custom": {
147
- let e = te(M.configSchema);
148
- if (!e) {
149
- W(_("integrations.addConnection.authentication.custom.missingSchema", "This provider does not declare a configuration form."));
154
+ if (!Y) {
155
+ U(y("integrations.addConnection.authentication.custom.missingSchema", "This provider does not declare a configuration form."));
150
156
  return;
151
157
  }
152
- for (let t of e.required) if (!V[t]?.trim()) {
153
- W(_("integrations.addConnection.errors.fieldRequired", "{{field}} is required", { field: e.properties[t]?.title ?? t }));
158
+ if (!ve(Y, X)) {
159
+ U(y("integrations.addConnection.errors.fieldsRequired", "Please fill in all required fields"));
154
160
  return;
155
161
  }
156
- let t = {};
157
- for (let n of Object.keys(e.properties)) {
158
- let e = V[n]?.trim();
159
- e && (t[n] = e);
160
- }
161
- await Xe(n, t), j("success");
162
+ let e = {};
163
+ for (let [t, n] of Object.entries(be(Y, X))) if (t in Y.properties) if (typeof n == "string") {
164
+ let r = n.trim();
165
+ r && (e[t] = r);
166
+ } else n != null && (e[t] = n);
167
+ await et(n, e), j("success");
162
168
  break;
163
169
  }
164
170
  default: j("success");
165
171
  }
166
172
  } catch (e) {
167
- W(e instanceof Error ? e.message : _("integrations.addConnection.errors.authFailed", "Authentication failed")), j("error");
173
+ U(e instanceof Error ? e.message : y("integrations.addConnection.errors.authFailed", "Authentication failed")), j("error");
168
174
  }
169
175
  }, [
170
176
  M,
171
177
  P,
172
178
  I,
173
179
  L,
174
- _,
180
+ y,
175
181
  R,
176
182
  z,
177
183
  B,
178
- V,
184
+ Y,
185
+ X,
186
+ We,
179
187
  O,
180
- Ve,
181
- Qe,
182
- Ue,
183
- Ge,
188
+ nt,
184
189
  k,
185
190
  Je,
186
191
  Xe,
187
- w,
188
- S,
192
+ Qe,
193
+ et,
194
+ T,
189
195
  C,
190
- g,
191
- G,
192
- H
193
- ]), _t = i(() => {
194
- if (!S || !G) return;
195
- let e = new URL(S, window.location.origin);
196
- e.searchParams.set("integrationConnectionId", G), C && e.searchParams.set("channelId", C), h?.(e.pathname + e.search);
196
+ w,
197
+ v,
198
+ W,
199
+ V
200
+ ]), St = a(() => {
201
+ if (!C || !W) return;
202
+ let e = new URL(C, window.location.origin);
203
+ e.searchParams.set("integrationConnectionId", W), w && e.searchParams.set("channelId", w), _?.(e.pathname + e.search);
197
204
  }, [
198
- S,
199
- G,
200
205
  C,
201
- h
202
- ]), X = Be || He || lt || We || Ke || qe || Ye || Ze, Z = x ? Ie : D || ft, Q = [
206
+ W,
207
+ w,
208
+ _
209
+ ]), Z = Ge || Ke || mt || qe || Ye || Ze || $e || tt, Ct = S ? Be : D || _t, Q = [
203
210
  {
204
211
  key: "select_provider",
205
- label: _("integrations.addConnection.steps.selectProvider", "Select Provider")
212
+ label: y("integrations.addConnection.steps.selectProvider", "Select Provider")
206
213
  },
207
214
  {
208
215
  key: "configure",
209
- label: _("integrations.addConnection.steps.configure", "Configure")
216
+ label: y("integrations.addConnection.steps.configure", "Configure")
210
217
  },
211
218
  {
212
219
  key: "authenticate",
213
- label: _("integrations.addConnection.steps.authenticate", "Authenticate")
220
+ label: y("integrations.addConnection.steps.authenticate", "Authenticate")
214
221
  }
215
222
  ], $ = Q.findIndex((e) => e.key === A);
216
- return Re ? /* @__PURE__ */ u("div", {
223
+ return He ? /* @__PURE__ */ f("div", {
217
224
  className: "flex items-center justify-center py-20",
218
- children: /* @__PURE__ */ u(l, {
225
+ children: /* @__PURE__ */ f(d, {
219
226
  size: 48,
220
227
  className: "animate-spin text-primary"
221
228
  })
222
- }) : ze ? /* @__PURE__ */ d("div", {
229
+ }) : Ue ? /* @__PURE__ */ p("div", {
223
230
  className: "space-y-6 p-6 max-w-3xl mx-auto",
224
231
  children: [
225
- /* @__PURE__ */ d("div", {
232
+ /* @__PURE__ */ p("div", {
226
233
  className: "flex items-center gap-4",
227
234
  children: [
228
- /* @__PURE__ */ u(f, {
235
+ /* @__PURE__ */ f(m, {
229
236
  variant: "ghost",
230
237
  size: "icon",
231
- onClick: () => h?.(r(m, "connections")),
232
- "aria-label": _("integrations.common.back", "Back"),
233
- children: /* @__PURE__ */ u(be, { size: 20 })
238
+ onClick: () => _?.(i(g, "connections")),
239
+ "aria-label": y("integrations.common.back", "Back"),
240
+ children: /* @__PURE__ */ f(Se, { size: 20 })
234
241
  }),
235
- /* @__PURE__ */ u("h1", {
242
+ /* @__PURE__ */ f("h1", {
236
243
  className: "text-2xl font-bold text-text-primary",
237
- children: _("integrations.addConnection.title", "Add Connection")
244
+ children: y("integrations.addConnection.title", "Add Connection")
238
245
  }),
239
- w && /* @__PURE__ */ u("span", {
246
+ T && /* @__PURE__ */ f("span", {
240
247
  className: "ml-auto text-xs font-medium px-2.5 py-1 rounded-full bg-action-primary-bg/10 text-primary",
241
- children: _("integrations.addConnection.botChannelSetup", "Bot Channel Setup")
248
+ children: y("integrations.addConnection.botChannelSetup", "Bot Channel Setup")
242
249
  })
243
250
  ]
244
251
  }),
245
- A !== "success" && A !== "error" && /* @__PURE__ */ u(Pe, {
246
- icon: /* @__PURE__ */ u(Te, { size: 16 }),
247
- children: w ? _("integrations.addConnection.botChannelPurpose", "Connect an external account so your bot channel can act on your behalf. Pick the service, name the connection, choose where its credentials live, then authenticate — you will be sent back to finish linking the channel.") : _("integrations.addConnection.purpose", "A connection is a one-time, authenticated link between your workspace and an external service. Choose a provider, give the connection a recognizable name, decide where its credentials are stored, then authenticate. Once created, the rest of the platform can reuse it without asking you to log in again.")
252
+ A !== "success" && A !== "error" && /* @__PURE__ */ f(Ie, {
253
+ icon: /* @__PURE__ */ f(De, { size: 16 }),
254
+ children: T ? y("integrations.addConnection.botChannelPurpose", "Connect an external account so your bot channel can act on your behalf. Pick the service, name the connection, choose where its credentials live, then authenticate — you will be sent back to finish linking the channel.") : y("integrations.addConnection.purpose", "A connection is a one-time, authenticated link between your workspace and an external service. Choose a provider, give the connection a recognizable name, decide where its credentials are stored, then authenticate. Once created, the rest of the platform can reuse it without asking you to log in again.")
248
255
  }),
249
- A !== "success" && A !== "error" && /* @__PURE__ */ u("div", {
256
+ A !== "success" && A !== "error" && /* @__PURE__ */ f("div", {
250
257
  className: "flex items-center gap-2",
251
- children: Q.map((e, t) => /* @__PURE__ */ d("div", {
258
+ children: Q.map((e, t) => /* @__PURE__ */ p("div", {
252
259
  className: "flex items-center gap-2",
253
260
  children: [
254
- /* @__PURE__ */ u("div", {
261
+ /* @__PURE__ */ f("div", {
255
262
  className: n("w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium transition-all", t < $ ? "bg-action-primary-bg text-action-primary-text" : t === $ ? "bg-action-primary-bg text-action-primary-text ring-4 ring-primary/20" : "bg-bg-sunken text-text-secondary"),
256
- children: t < $ ? /* @__PURE__ */ u(Se, { size: 16 }) : t + 1
263
+ children: t < $ ? /* @__PURE__ */ f(we, { size: 16 }) : t + 1
257
264
  }),
258
- /* @__PURE__ */ u("span", {
265
+ /* @__PURE__ */ f("span", {
259
266
  className: n("text-sm font-medium hidden sm:inline", t === $ ? "text-text-primary" : "text-text-secondary"),
260
267
  children: e.label
261
268
  }),
262
- t < Q.length - 1 && /* @__PURE__ */ u("div", { className: "w-8 h-px bg-border" })
269
+ t < Q.length - 1 && /* @__PURE__ */ f("div", { className: "w-8 h-px bg-border" })
263
270
  ]
264
271
  }, e.key))
265
272
  }),
266
- U && A !== "error" && /* @__PURE__ */ d("div", {
273
+ H && A !== "error" && /* @__PURE__ */ p("div", {
267
274
  className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-4 flex items-center gap-3",
268
- children: [/* @__PURE__ */ u(s, {
275
+ children: [/* @__PURE__ */ f(l, {
269
276
  size: 20,
270
277
  className: "text-status-error-text flex-shrink-0"
271
- }), /* @__PURE__ */ u("p", {
278
+ }), /* @__PURE__ */ f("p", {
272
279
  className: "text-sm text-status-error-text",
273
- children: U
280
+ children: H
274
281
  })]
275
282
  }),
276
- A === "configure" && Z && !M && /* @__PURE__ */ u("div", {
283
+ A === "configure" && Ct && !M && /* @__PURE__ */ f("div", {
277
284
  className: "flex items-center justify-center py-12",
278
- children: /* @__PURE__ */ u(l, {
285
+ children: /* @__PURE__ */ f(d, {
279
286
  size: 24,
280
287
  className: "animate-spin text-text-secondary"
281
288
  })
282
289
  }),
283
- A === "configure" && !Z && !M && (p || x) && /* @__PURE__ */ d("div", {
290
+ A === "configure" && !Ct && !M && (h || S) && /* @__PURE__ */ p("div", {
284
291
  className: "flex flex-col items-center justify-center py-12 text-center",
285
- children: [/* @__PURE__ */ u(s, {
292
+ children: [/* @__PURE__ */ f(l, {
286
293
  size: 32,
287
294
  className: "text-text-secondary mb-3"
288
- }), /* @__PURE__ */ u("p", {
295
+ }), /* @__PURE__ */ f("p", {
289
296
  className: "text-sm text-text-secondary",
290
- children: _("integrations.addConnection.providerUnavailable", "This provider isn't available.")
297
+ children: y("integrations.addConnection.providerUnavailable", "This provider isn't available.")
291
298
  })]
292
299
  }),
293
- A === "select_provider" && /* @__PURE__ */ d("div", {
300
+ A === "select_provider" && /* @__PURE__ */ p("div", {
294
301
  className: "space-y-4",
295
302
  children: [
296
- /* @__PURE__ */ d("div", {
303
+ /* @__PURE__ */ p("div", {
297
304
  className: "relative group",
298
- children: [/* @__PURE__ */ u(De, {
305
+ children: [/* @__PURE__ */ f(ke, {
299
306
  size: 18,
300
307
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
301
- }), /* @__PURE__ */ u("input", {
308
+ }), /* @__PURE__ */ f("input", {
302
309
  type: "text",
303
- placeholder: _("integrations.addConnection.search.placeholder", "Search installed providers..."),
304
- "aria-label": _("integrations.addConnection.search.ariaLabel", "Search installed providers"),
310
+ placeholder: y("integrations.addConnection.search.placeholder", "Search installed providers..."),
311
+ "aria-label": y("integrations.addConnection.search.ariaLabel", "Search installed providers"),
305
312
  value: N,
306
- onChange: (e) => et(e.target.value),
313
+ onChange: (e) => it(e.target.value),
307
314
  className: "w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
308
315
  })]
309
316
  }),
310
- D && /* @__PURE__ */ u("div", {
317
+ D && /* @__PURE__ */ f("div", {
311
318
  className: "flex items-center justify-center py-12",
312
- children: /* @__PURE__ */ u(l, {
319
+ children: /* @__PURE__ */ f(d, {
313
320
  size: 24,
314
321
  className: "animate-spin text-text-secondary"
315
322
  })
316
323
  }),
317
- !D && pt.length === 0 && /* @__PURE__ */ u(Ne, {
324
+ !D && vt.length === 0 && /* @__PURE__ */ f(Fe, {
318
325
  illustration: N ? "empty-search" : "empty-data",
319
- title: N ? _("integrations.addConnection.empty.noMatchingProviders", "No matching providers") : _("integrations.addConnection.empty.noInstalledProviders", "No installed providers yet"),
320
- description: N ? _("integrations.addConnection.empty.matchingDescription", "No installed provider matches your search. Try a different term or install one from the catalog.") : _("integrations.addConnection.empty.installedDescription", "You need at least one installed, enabled provider before you can create a connection. Install one from the catalog to get started."),
321
- action: /* @__PURE__ */ u(f, {
322
- onClick: () => h?.(r(m, "providers")),
323
- children: _("integrations.addConnection.empty.browseCatalog", "Browse Catalog")
326
+ title: N ? y("integrations.addConnection.empty.noMatchingProviders", "No matching providers") : y("integrations.addConnection.empty.noInstalledProviders", "No installed providers yet"),
327
+ description: N ? y("integrations.addConnection.empty.matchingDescription", "No installed provider matches your search. Try a different term or install one from the catalog.") : y("integrations.addConnection.empty.installedDescription", "You need at least one installed, enabled provider before you can create a connection. Install one from the catalog to get started."),
328
+ action: /* @__PURE__ */ f(m, {
329
+ onClick: () => _?.(i(g, "providers")),
330
+ children: y("integrations.addConnection.empty.browseCatalog", "Browse Catalog")
324
331
  })
325
332
  }),
326
- /* @__PURE__ */ u("div", {
333
+ /* @__PURE__ */ f("div", {
327
334
  className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
328
- children: pt.map((e) => /* @__PURE__ */ d("button", {
335
+ children: vt.map((e) => /* @__PURE__ */ p("button", {
329
336
  type: "button",
330
- onClick: () => mt(e),
337
+ onClick: () => yt(e),
331
338
  className: n("flex items-start gap-3 p-4 rounded-xl border border-border-seam bg-bg-surface text-left", "hover:border-border-strong hover:shadow-[var(--shadow-pop)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "transition-[box-shadow,border-color] duration-200"),
332
- children: [/* @__PURE__ */ u(_e, {
339
+ children: [/* @__PURE__ */ f(he, {
333
340
  provider: e,
334
341
  size: 40
335
- }), /* @__PURE__ */ d("div", {
342
+ }), /* @__PURE__ */ p("div", {
336
343
  className: "flex-1 min-w-0",
337
- children: [/* @__PURE__ */ u("h3", {
344
+ children: [/* @__PURE__ */ f("h3", {
338
345
  className: "font-medium text-text-primary truncate",
339
346
  children: e.name
340
- }), /* @__PURE__ */ d("p", {
347
+ }), /* @__PURE__ */ p("p", {
341
348
  className: "text-xs text-text-secondary mt-0.5",
342
349
  children: [
343
- _(`integrations.category.${e.category}`, Fe(e.category)),
350
+ y(`integrations.category.${e.category}`, Le(e.category)),
344
351
  " ",
345
352
  "·",
346
353
  " ",
347
- _(`integrations.authType.${e.authType}`, v(e.authType))
354
+ y(`integrations.authType.${e.authType}`, b(e.authType))
348
355
  ]
349
356
  })]
350
357
  })]
@@ -352,433 +359,391 @@ function p() {
352
359
  })
353
360
  ]
354
361
  }),
355
- A === "configure" && M && /* @__PURE__ */ d("div", {
362
+ A === "configure" && M && /* @__PURE__ */ p("div", {
356
363
  className: "space-y-6",
357
364
  children: [
358
- /* @__PURE__ */ d(Me, {
365
+ /* @__PURE__ */ p(Pe, {
359
366
  className: "flex items-center gap-3 p-4 border-border-seam",
360
- children: [/* @__PURE__ */ u(_e, {
367
+ children: [/* @__PURE__ */ f(he, {
361
368
  provider: M,
362
369
  size: 40
363
- }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h3", {
370
+ }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
364
371
  className: "font-medium text-text-primary",
365
372
  children: M.name
366
- }), /* @__PURE__ */ u("p", {
373
+ }), /* @__PURE__ */ f("p", {
367
374
  className: "text-xs text-text-secondary",
368
- children: _(`integrations.authType.${M.authType}`, v(M.authType))
375
+ children: y(`integrations.authType.${M.authType}`, b(M.authType))
369
376
  })] })]
370
377
  }),
371
- /* @__PURE__ */ d("div", {
378
+ /* @__PURE__ */ p("div", {
372
379
  className: "space-y-4",
373
380
  children: [
374
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
381
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
375
382
  htmlFor: "conn-name",
376
383
  className: "block text-sm font-semibold mb-2",
377
384
  children: [
378
- _("integrations.addConnection.fields.connectionName", "Connection Name"),
385
+ y("integrations.addConnection.fields.connectionName", "Connection Name"),
379
386
  " ",
380
- /* @__PURE__ */ u("span", {
387
+ /* @__PURE__ */ f("span", {
381
388
  className: "text-status-error-text",
382
389
  children: "*"
383
390
  })
384
391
  ]
385
- }), /* @__PURE__ */ u("input", {
392
+ }), /* @__PURE__ */ f("input", {
386
393
  type: "text",
387
394
  id: "conn-name",
388
- "aria-label": _("integrations.addConnection.fields.connectionName", "Connection Name"),
395
+ "aria-label": y("integrations.addConnection.fields.connectionName", "Connection Name"),
389
396
  value: P,
390
397
  onChange: (e) => F(e.target.value),
391
- placeholder: _("integrations.addConnection.fields.connectionNamePlaceholder", "e.g., My Slack Workspace"),
398
+ placeholder: y("integrations.addConnection.fields.connectionNamePlaceholder", "e.g., My Slack Workspace"),
392
399
  className: "w-full px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
393
400
  })] }),
394
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
401
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
395
402
  htmlFor: "conn-desc",
396
403
  className: "block text-sm font-semibold mb-2",
397
- children: _("integrations.addConnection.fields.description", "Description")
398
- }), /* @__PURE__ */ u("textarea", {
404
+ children: y("integrations.addConnection.fields.description", "Description")
405
+ }), /* @__PURE__ */ f("textarea", {
399
406
  id: "conn-desc",
400
- "aria-label": _("integrations.addConnection.fields.description", "Description"),
407
+ "aria-label": y("integrations.addConnection.fields.description", "Description"),
401
408
  value: I,
402
- onChange: (e) => tt(e.target.value),
409
+ onChange: (e) => at(e.target.value),
403
410
  rows: 3,
404
- placeholder: _("integrations.addConnection.fields.descriptionPlaceholder", "Optional description..."),
411
+ placeholder: y("integrations.addConnection.fields.descriptionPlaceholder", "Optional description..."),
405
412
  className: "w-full px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
406
413
  })] }),
407
- /* @__PURE__ */ u(ge, {
408
- value: H,
409
- onChange: st,
414
+ /* @__PURE__ */ f(me, {
415
+ value: V,
416
+ onChange: ft,
410
417
  providerAuthType: M.authType
411
418
  })
412
419
  ]
413
420
  }),
414
- /* @__PURE__ */ d("div", {
421
+ /* @__PURE__ */ p("div", {
415
422
  className: "flex gap-3",
416
- children: [/* @__PURE__ */ u(f, {
423
+ children: [/* @__PURE__ */ f(m, {
417
424
  variant: "outline",
418
- onClick: () => p || x ? h?.(r(m, "connections")) : j("select_provider"),
419
- children: _("integrations.addConnection.actions.back", "Back")
420
- }), /* @__PURE__ */ d(f, {
421
- onClick: ht,
425
+ onClick: () => h || S ? _?.(i(g, "connections")) : j("select_provider"),
426
+ children: y("integrations.addConnection.actions.back", "Back")
427
+ }), /* @__PURE__ */ p(m, {
428
+ onClick: bt,
422
429
  children: [
423
- _("integrations.addConnection.actions.next", "Next"),
430
+ y("integrations.addConnection.actions.next", "Next"),
424
431
  " ",
425
- /* @__PURE__ */ u(xe, { size: 16 })
432
+ /* @__PURE__ */ f(Ce, { size: 16 })
426
433
  ]
427
434
  })]
428
435
  })
429
436
  ]
430
437
  }),
431
- A === "authenticate" && M && /* @__PURE__ */ d("div", {
438
+ A === "authenticate" && M && /* @__PURE__ */ p("div", {
432
439
  className: "space-y-6",
433
- children: [/* @__PURE__ */ d(Me, {
440
+ children: [/* @__PURE__ */ p(Pe, {
434
441
  treatment: "glass",
435
442
  glow: !0,
436
443
  className: "border-border-seam p-5",
437
444
  children: [
438
- /* @__PURE__ */ d("h2", {
445
+ /* @__PURE__ */ p("h2", {
439
446
  className: "font-semibold text-text-primary flex items-center gap-2 mb-4",
440
447
  children: [
441
- /* @__PURE__ */ u(Oe, {
448
+ /* @__PURE__ */ f(Ae, {
442
449
  size: 18,
443
450
  className: "text-primary"
444
451
  }),
445
- _("integrations.addConnection.authentication.title", "Authentication"),
452
+ y("integrations.addConnection.authentication.title", "Authentication"),
446
453
  ":",
447
454
  " ",
448
- _(`integrations.authType.${M.authType}`, v(M.authType))
455
+ y(`integrations.authType.${M.authType}`, b(M.authType))
449
456
  ]
450
457
  }),
451
- M.authType === "oauth2" && /* @__PURE__ */ d("div", {
458
+ M.authType === "oauth2" && /* @__PURE__ */ p("div", {
452
459
  className: "space-y-4",
453
- children: [/* @__PURE__ */ u("p", {
460
+ children: [/* @__PURE__ */ f("p", {
454
461
  className: "text-sm text-text-secondary",
455
- children: _("integrations.addConnection.authentication.oauthRedirect", "You will be redirected to {{provider}} to authorize access. After granting permission, you'll be redirected back.", { provider: M.name })
456
- }), /* @__PURE__ */ d("div", {
462
+ children: y("integrations.addConnection.authentication.oauthRedirect", "You will be redirected to {{provider}} to authorize access. After granting permission, you'll be redirected back.", { provider: M.name })
463
+ }), /* @__PURE__ */ p("div", {
457
464
  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",
458
- children: [/* @__PURE__ */ u(we, { size: 16 }), w ? _("integrations.addConnection.authentication.botChannelRedirect", "You'll be redirected back to the bot channel setup after authorization.") : _("integrations.addConnection.authentication.oauthPopupInfo", "A new window will open for OAuth authentication")]
465
+ children: [/* @__PURE__ */ f(Ee, { size: 16 }), T ? y("integrations.addConnection.authentication.botChannelRedirect", "You'll be redirected back to the bot channel setup after authorization.") : y("integrations.addConnection.authentication.oauthPopupInfo", "A new window will open for OAuth authentication")]
459
466
  })]
460
467
  }),
461
- M.authType === "api_key" && /* @__PURE__ */ d("div", {
468
+ M.authType === "api_key" && /* @__PURE__ */ p("div", {
462
469
  className: "space-y-4",
463
- children: [/* @__PURE__ */ u("p", {
470
+ children: [/* @__PURE__ */ f("p", {
464
471
  className: "text-sm text-text-secondary",
465
- children: _("integrations.addConnection.authentication.apiKeyHint", "Enter your {{provider}} API key. You can typically find this in your account settings.", { provider: M.name })
466
- }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
472
+ children: y("integrations.addConnection.authentication.apiKeyHint", "Enter your {{provider}} API key. You can typically find this in your account settings.", { provider: M.name })
473
+ }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
467
474
  htmlFor: "api-key",
468
475
  className: "block text-sm font-semibold mb-2",
469
476
  children: [
470
- _("integrations.addConnection.fields.apiKey", "API Key"),
477
+ y("integrations.addConnection.fields.apiKey", "API Key"),
471
478
  " ",
472
- /* @__PURE__ */ u("span", {
479
+ /* @__PURE__ */ f("span", {
473
480
  className: "text-status-error-text",
474
481
  children: "*"
475
482
  })
476
483
  ]
477
- }), /* @__PURE__ */ d("div", {
484
+ }), /* @__PURE__ */ p("div", {
478
485
  className: "relative",
479
- children: [/* @__PURE__ */ u(c, {
486
+ children: [/* @__PURE__ */ f(u, {
480
487
  size: 16,
481
488
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
482
- }), /* @__PURE__ */ u("input", {
489
+ }), /* @__PURE__ */ f("input", {
483
490
  type: "password",
484
491
  id: "api-key",
485
- "aria-label": _("integrations.addConnection.fields.apiKey", "API Key"),
492
+ "aria-label": y("integrations.addConnection.fields.apiKey", "API Key"),
486
493
  value: L,
487
- onChange: (e) => nt(e.target.value),
488
- placeholder: _("integrations.addConnection.fields.apiKeyPlaceholder", "Enter your API key"),
494
+ onChange: (e) => ot(e.target.value),
495
+ placeholder: y("integrations.addConnection.fields.apiKeyPlaceholder", "Enter your API key"),
489
496
  className: "w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
490
497
  })]
491
498
  })] })]
492
499
  }),
493
- M.authType === "basic_auth" && /* @__PURE__ */ d("div", {
500
+ M.authType === "basic_auth" && /* @__PURE__ */ p("div", {
494
501
  className: "space-y-4",
495
502
  children: [
496
- /* @__PURE__ */ u("p", {
503
+ /* @__PURE__ */ f("p", {
497
504
  className: "text-sm text-text-secondary",
498
- children: _("integrations.addConnection.authentication.basicAuthHint", "Enter your {{provider}} credentials.", { provider: M.name })
505
+ children: y("integrations.addConnection.authentication.basicAuthHint", "Enter your {{provider}} credentials.", { provider: M.name })
499
506
  }),
500
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
507
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
501
508
  htmlFor: "username",
502
509
  className: "block text-sm font-semibold mb-2",
503
510
  children: [
504
- _("integrations.addConnection.fields.username", "Username"),
511
+ y("integrations.addConnection.fields.username", "Username"),
505
512
  " ",
506
- /* @__PURE__ */ u("span", {
513
+ /* @__PURE__ */ f("span", {
507
514
  className: "text-status-error-text",
508
515
  children: "*"
509
516
  })
510
517
  ]
511
- }), /* @__PURE__ */ u("input", {
518
+ }), /* @__PURE__ */ f("input", {
512
519
  type: "text",
513
520
  id: "username",
514
- "aria-label": _("integrations.addConnection.fields.username", "Username"),
521
+ "aria-label": y("integrations.addConnection.fields.username", "Username"),
515
522
  value: R,
516
- onChange: (e) => rt(e.target.value),
517
- placeholder: _("integrations.addConnection.fields.usernamePlaceholder", "Username or email"),
523
+ onChange: (e) => st(e.target.value),
524
+ placeholder: y("integrations.addConnection.fields.usernamePlaceholder", "Username or email"),
518
525
  className: "w-full px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
519
526
  })] }),
520
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
527
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
521
528
  htmlFor: "password",
522
529
  className: "block text-sm font-semibold mb-2",
523
530
  children: [
524
- _("integrations.addConnection.fields.password", "Password"),
531
+ y("integrations.addConnection.fields.password", "Password"),
525
532
  " ",
526
- /* @__PURE__ */ u("span", {
533
+ /* @__PURE__ */ f("span", {
527
534
  className: "text-status-error-text",
528
535
  children: "*"
529
536
  })
530
537
  ]
531
- }), /* @__PURE__ */ d("div", {
538
+ }), /* @__PURE__ */ p("div", {
532
539
  className: "relative",
533
- children: [/* @__PURE__ */ u(Ee, {
540
+ children: [/* @__PURE__ */ f(Oe, {
534
541
  size: 16,
535
542
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
536
- }), /* @__PURE__ */ u("input", {
543
+ }), /* @__PURE__ */ f("input", {
537
544
  type: "password",
538
545
  id: "password",
539
- "aria-label": _("integrations.addConnection.fields.password", "Password"),
546
+ "aria-label": y("integrations.addConnection.fields.password", "Password"),
540
547
  value: z,
541
- onChange: (e) => it(e.target.value),
542
- placeholder: _("integrations.addConnection.fields.passwordPlaceholder", "Password"),
548
+ onChange: (e) => ct(e.target.value),
549
+ placeholder: y("integrations.addConnection.fields.passwordPlaceholder", "Password"),
543
550
  className: "w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
544
551
  })]
545
552
  })] })
546
553
  ]
547
554
  }),
548
- M.authType === "bearer_token" && /* @__PURE__ */ d("div", {
555
+ M.authType === "bearer_token" && /* @__PURE__ */ p("div", {
549
556
  className: "space-y-4",
550
- children: [/* @__PURE__ */ u("p", {
557
+ children: [/* @__PURE__ */ f("p", {
551
558
  className: "text-sm text-text-secondary",
552
- children: _("integrations.addConnection.authentication.bearerTokenHint", "Enter your {{provider}} bearer token.", { provider: M.name })
553
- }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
559
+ children: y("integrations.addConnection.authentication.bearerTokenHint", "Enter your {{provider}} bearer token.", { provider: M.name })
560
+ }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
554
561
  htmlFor: "bearer-token",
555
562
  className: "block text-sm font-semibold mb-2",
556
563
  children: [
557
- _("integrations.addConnection.fields.bearerToken", "Bearer Token"),
564
+ y("integrations.addConnection.fields.bearerToken", "Bearer Token"),
558
565
  " ",
559
- /* @__PURE__ */ u("span", {
566
+ /* @__PURE__ */ f("span", {
560
567
  className: "text-status-error-text",
561
568
  children: "*"
562
569
  })
563
570
  ]
564
- }), /* @__PURE__ */ d("div", {
571
+ }), /* @__PURE__ */ p("div", {
565
572
  className: "relative",
566
- children: [/* @__PURE__ */ u(c, {
573
+ children: [/* @__PURE__ */ f(u, {
567
574
  size: 16,
568
575
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
569
- }), /* @__PURE__ */ u("input", {
576
+ }), /* @__PURE__ */ f("input", {
570
577
  type: "password",
571
578
  id: "bearer-token",
572
- "aria-label": _("integrations.addConnection.fields.bearerToken", "Bearer Token"),
579
+ "aria-label": y("integrations.addConnection.fields.bearerToken", "Bearer Token"),
573
580
  value: B,
574
- onChange: (e) => at(e.target.value),
575
- placeholder: _("integrations.addConnection.fields.bearerTokenPlaceholder", "Enter your token"),
581
+ onChange: (e) => lt(e.target.value),
582
+ placeholder: y("integrations.addConnection.fields.bearerTokenPlaceholder", "Enter your token"),
576
583
  className: "w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
577
584
  })]
578
585
  })] })]
579
586
  }),
580
- M.authType === "service_account" && /* @__PURE__ */ u("div", {
587
+ M.authType === "service_account" && /* @__PURE__ */ f("div", {
581
588
  className: "space-y-4",
582
- children: /* @__PURE__ */ d("div", {
589
+ children: /* @__PURE__ */ p("div", {
583
590
  className: "rounded-lg border border-border bg-status-success-bg-subtle p-4",
584
591
  children: [
585
- /* @__PURE__ */ u("p", {
592
+ /* @__PURE__ */ f("p", {
586
593
  className: "text-sm font-semibold text-foreground",
587
- children: _("integrations.addConnection.authentication.serviceAccount.title", "No credentials needed")
594
+ children: y("integrations.addConnection.authentication.serviceAccount.title", "No credentials needed")
588
595
  }),
589
- /* @__PURE__ */ u("p", {
596
+ /* @__PURE__ */ f("p", {
590
597
  className: "text-sm text-muted-foreground mt-1",
591
- children: _("integrations.addConnection.authentication.serviceAccount.description", "{{provider}} is a first-party integration. Connecting grants {{provider}} permission to act on your behalf; access tokens are issued securely per use — there are no keys or secrets to manage.", { provider: M.name })
598
+ children: y("integrations.addConnection.authentication.serviceAccount.description", "{{provider}} is a first-party integration. Connecting grants {{provider}} permission to act on your behalf; access tokens are issued securely per use — there are no keys or secrets to manage.", { provider: M.name })
592
599
  }),
593
- M.defaultScopes && M.defaultScopes.length > 0 && /* @__PURE__ */ u("p", {
600
+ M.defaultScopes && M.defaultScopes.length > 0 && /* @__PURE__ */ f("p", {
594
601
  className: "text-sm text-muted-foreground mt-2",
595
- children: _("integrations.addConnection.authentication.serviceAccount.scopes", "Scopes: {{scopes}}", { scopes: M.defaultScopes.join(", ") })
602
+ children: y("integrations.addConnection.authentication.serviceAccount.scopes", "Scopes: {{scopes}}", { scopes: M.defaultScopes.join(", ") })
596
603
  })
597
604
  ]
598
605
  })
599
606
  }),
600
- M.authType === "custom" && (() => {
601
- let e = te(M.configSchema);
602
- if (!e) return /* @__PURE__ */ d("div", {
603
- className: "flex items-center gap-2 px-3 py-2 rounded-lg bg-status-error-bg-subtle border border-border-default",
604
- children: [/* @__PURE__ */ u(s, {
605
- size: 16,
606
- className: "text-status-error-text flex-shrink-0"
607
- }), /* @__PURE__ */ u("span", {
608
- className: "text-sm text-status-error-text",
609
- children: _("integrations.addConnection.authentication.custom.missingSchema", "This provider does not declare a configuration form.")
610
- })]
611
- });
612
- let t = new Set(e.required);
613
- return /* @__PURE__ */ d("div", {
614
- className: "space-y-4",
615
- children: [/* @__PURE__ */ u("p", {
616
- className: "text-sm text-text-secondary",
617
- children: _("integrations.addConnection.authentication.custom.hint", "Enter your {{provider}} configuration. Secret fields are stored encrypted and never shown again.", { provider: M.name })
618
- }), Object.entries(e.properties).map(([e, n]) => /* @__PURE__ */ d("div", { children: [
619
- /* @__PURE__ */ d("label", {
620
- htmlFor: `custom-${e}`,
621
- className: "block text-sm font-semibold mb-2",
622
- children: [
623
- n?.title ?? e,
624
- " ",
625
- t.has(e) && /* @__PURE__ */ u("span", {
626
- className: "text-status-error-text",
627
- children: "*"
628
- })
629
- ]
630
- }),
631
- n?.secret ? /* @__PURE__ */ u("textarea", {
632
- id: `custom-${e}`,
633
- "aria-label": n?.title ?? e,
634
- value: V[e] ?? "",
635
- onChange: (t) => ot((n) => ({
636
- ...n,
637
- [e]: t.target.value
638
- })),
639
- placeholder: n?.description,
640
- rows: 4,
641
- autoComplete: "off",
642
- spellCheck: !1,
643
- className: "w-full px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
644
- }) : /* @__PURE__ */ u("input", {
645
- id: `custom-${e}`,
646
- "aria-label": n?.title ?? e,
647
- type: "text",
648
- value: V[e] ?? "",
649
- onChange: (t) => ot((n) => ({
650
- ...n,
651
- [e]: t.target.value
652
- })),
653
- placeholder: n?.description,
654
- autoComplete: "off",
655
- className: "w-full px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
656
- }),
657
- n?.description && /* @__PURE__ */ u("p", {
658
- className: "mt-1 text-xs text-text-secondary",
659
- children: n.description
660
- })
661
- ] }, e))]
662
- });
663
- })()
607
+ M.authType === "custom" && (Y ? /* @__PURE__ */ p("div", {
608
+ className: "space-y-4",
609
+ children: [/* @__PURE__ */ f("p", {
610
+ className: "text-sm text-text-secondary",
611
+ children: y("integrations.addConnection.authentication.custom.hint", "Enter your {{provider}} configuration. Secret fields are stored encrypted and never shown again.", { provider: M.name })
612
+ }), /* @__PURE__ */ f(ge, {
613
+ schema: Y,
614
+ values: X,
615
+ onChange: dt,
616
+ disabled: Z,
617
+ idPrefix: "custom"
618
+ })]
619
+ }) : /* @__PURE__ */ p("div", {
620
+ className: "flex items-center gap-2 px-3 py-2 rounded-lg bg-status-error-bg-subtle border border-border-default",
621
+ children: [/* @__PURE__ */ f(l, {
622
+ size: 16,
623
+ className: "text-status-error-text flex-shrink-0"
624
+ }), /* @__PURE__ */ f("span", {
625
+ className: "text-sm text-status-error-text",
626
+ children: y("integrations.addConnection.authentication.custom.missingSchema", "This provider does not declare a configuration form.")
627
+ })]
628
+ }))
664
629
  ]
665
- }), /* @__PURE__ */ d("div", {
630
+ }), /* @__PURE__ */ p("div", {
666
631
  className: "flex gap-3",
667
- children: [/* @__PURE__ */ u(f, {
632
+ children: [/* @__PURE__ */ f(m, {
668
633
  variant: "outline",
669
634
  onClick: () => j("configure"),
670
- disabled: X,
671
- children: _("integrations.addConnection.actions.back", "Back")
672
- }), /* @__PURE__ */ d(f, {
673
- onClick: gt,
674
- disabled: X,
675
- children: [X ? /* @__PURE__ */ u(l, {
635
+ disabled: Z,
636
+ children: y("integrations.addConnection.actions.back", "Back")
637
+ }), /* @__PURE__ */ p(m, {
638
+ onClick: xt,
639
+ disabled: Z,
640
+ children: [Z ? /* @__PURE__ */ f(d, {
676
641
  size: 16,
677
642
  className: "animate-spin"
678
- }) : /* @__PURE__ */ u(Se, { size: 16 }), M.authType === "oauth2" ? _("integrations.addConnection.actions.authorize", "Authorize") : _("integrations.addConnection.actions.connect", "Connect")]
643
+ }) : /* @__PURE__ */ f(we, { size: 16 }), M.authType === "oauth2" ? y("integrations.addConnection.actions.authorize", "Authorize") : y("integrations.addConnection.actions.connect", "Connect")]
679
644
  })]
680
645
  })]
681
646
  }),
682
- A === "success" && /* @__PURE__ */ d("div", {
647
+ A === "success" && /* @__PURE__ */ p("div", {
683
648
  className: "flex flex-col items-center justify-center py-12 text-center",
684
649
  children: [
685
- /* @__PURE__ */ u("div", {
650
+ /* @__PURE__ */ f("div", {
686
651
  className: "p-4 rounded-full bg-status-success-bg-subtle mb-4",
687
- children: /* @__PURE__ */ u(Ce, {
652
+ children: /* @__PURE__ */ f(Te, {
688
653
  size: 48,
689
654
  className: "text-status-success-text"
690
655
  })
691
656
  }),
692
- /* @__PURE__ */ u("h2", {
657
+ /* @__PURE__ */ f("h2", {
693
658
  className: "text-xl font-bold text-text-primary mb-2",
694
- children: _("integrations.addConnection.success.title", "Connection Created!")
659
+ children: y("integrations.addConnection.success.title", "Connection Created!")
695
660
  }),
696
- /* @__PURE__ */ u("p", {
661
+ /* @__PURE__ */ f("p", {
697
662
  className: "text-sm text-text-secondary mb-6 max-w-sm",
698
- children: _("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: M?.name ?? "" })
663
+ children: y("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: M?.name ?? "" })
699
664
  }),
700
- /* @__PURE__ */ d("div", {
665
+ /* @__PURE__ */ p("div", {
701
666
  className: "flex gap-3",
702
667
  children: [
703
- w && G && /* @__PURE__ */ d(f, {
704
- onClick: _t,
705
- children: [/* @__PURE__ */ u(Te, { size: 16 }), _("integrations.addConnection.actions.linkToBotChannel", "Link to Bot Channel")]
668
+ T && W && /* @__PURE__ */ p(m, {
669
+ onClick: St,
670
+ children: [/* @__PURE__ */ f(De, { size: 16 }), y("integrations.addConnection.actions.linkToBotChannel", "Link to Bot Channel")]
706
671
  }),
707
- !w && G && /* @__PURE__ */ u(f, {
708
- onClick: () => h?.(r(m, `connections/${G}`)),
709
- children: _("integrations.addConnection.actions.viewConnection", "View Connection")
672
+ !T && W && /* @__PURE__ */ f(m, {
673
+ onClick: () => _?.(i(g, `connections/${W}`)),
674
+ children: y("integrations.addConnection.actions.viewConnection", "View Connection")
710
675
  }),
711
- /* @__PURE__ */ u(f, {
676
+ /* @__PURE__ */ f(m, {
712
677
  variant: "outline",
713
- onClick: () => h?.(r(m, "connections")),
714
- children: _("integrations.addConnection.actions.allConnections", "All Connections")
678
+ onClick: () => _?.(i(g, "connections")),
679
+ children: y("integrations.addConnection.actions.allConnections", "All Connections")
715
680
  })
716
681
  ]
717
682
  })
718
683
  ]
719
684
  }),
720
- A === "error" && /* @__PURE__ */ d("div", {
685
+ A === "error" && /* @__PURE__ */ p("div", {
721
686
  className: "flex flex-col items-center justify-center py-12 text-center",
722
687
  children: [
723
- /* @__PURE__ */ u("div", {
688
+ /* @__PURE__ */ f("div", {
724
689
  className: "p-4 rounded-full bg-status-error-bg-subtle mb-4",
725
- children: /* @__PURE__ */ u(s, {
690
+ children: /* @__PURE__ */ f(l, {
726
691
  size: 48,
727
692
  className: "text-status-error-text"
728
693
  })
729
694
  }),
730
- /* @__PURE__ */ u("h2", {
695
+ /* @__PURE__ */ f("h2", {
731
696
  className: "text-xl font-bold text-text-primary mb-2",
732
- children: _("integrations.addConnection.failed.title", "Connection Failed")
697
+ children: y("integrations.addConnection.failed.title", "Connection Failed")
733
698
  }),
734
- /* @__PURE__ */ u("p", {
699
+ /* @__PURE__ */ f("p", {
735
700
  className: "text-sm text-status-error-text mb-6 max-w-sm",
736
- children: U || _("integrations.addConnection.errors.unexpected", "An unexpected error occurred.")
701
+ children: H || y("integrations.addConnection.errors.unexpected", "An unexpected error occurred.")
737
702
  }),
738
- /* @__PURE__ */ d("div", {
703
+ /* @__PURE__ */ p("div", {
739
704
  className: "flex gap-3",
740
- children: [/* @__PURE__ */ u(f, {
705
+ children: [/* @__PURE__ */ f(m, {
741
706
  onClick: () => {
742
- W(""), j("authenticate");
707
+ U(""), j("authenticate");
743
708
  },
744
- children: _("integrations.addConnection.actions.tryAgain", "Try Again")
745
- }), /* @__PURE__ */ u(f, {
709
+ children: y("integrations.addConnection.actions.tryAgain", "Try Again")
710
+ }), /* @__PURE__ */ f(m, {
746
711
  variant: "outline",
747
- onClick: () => h?.(r(m, "connections")),
748
- children: _("integrations.addConnection.actions.cancel", "Cancel")
712
+ onClick: () => _?.(i(g, "connections")),
713
+ children: y("integrations.addConnection.actions.cancel", "Cancel")
749
714
  })]
750
715
  })
751
716
  ]
752
717
  })
753
718
  ]
754
- }) : /* @__PURE__ */ d("div", {
719
+ }) : /* @__PURE__ */ p("div", {
755
720
  className: "flex flex-col items-center justify-center py-20 text-center p-6",
756
721
  children: [
757
- /* @__PURE__ */ u(Oe, {
722
+ /* @__PURE__ */ f(Ae, {
758
723
  size: 48,
759
724
  className: "text-text-secondary mb-4"
760
725
  }),
761
- /* @__PURE__ */ u("h2", {
726
+ /* @__PURE__ */ f("h2", {
762
727
  className: "text-xl font-bold text-text-primary mb-2",
763
- children: _("integrations.addConnection.denied.title", "Access Denied")
728
+ children: y("integrations.addConnection.denied.title", "Access Denied")
764
729
  }),
765
- /* @__PURE__ */ u("p", {
730
+ /* @__PURE__ */ f("p", {
766
731
  className: "text-sm text-text-secondary mb-6 max-w-sm",
767
- children: _("integrations.addConnection.denied.description", "You don't have permission to create connections.")
732
+ children: y("integrations.addConnection.denied.description", "You don't have permission to create connections.")
768
733
  }),
769
- /* @__PURE__ */ d(f, {
734
+ /* @__PURE__ */ p(m, {
770
735
  variant: "outline",
771
- onClick: () => h?.(r(m, "connections")),
736
+ onClick: () => _?.(i(g, "connections")),
772
737
  children: [
773
- /* @__PURE__ */ u(be, { size: 16 }),
738
+ /* @__PURE__ */ f(Se, { size: 16 }),
774
739
  " ",
775
- _("integrations.addConnection.denied.back", "Back to Connections")
740
+ y("integrations.addConnection.denied.back", "Back to Connections")
776
741
  ]
777
742
  })
778
743
  ]
779
744
  });
780
745
  }
781
746
  //#endregion
782
- export { p as AddConnectionWizard };
747
+ export { h as AddConnectionWizard };
783
748
 
784
749
  //# sourceMappingURL=AddConnectionWizard.js.map