@burdenoff/microfe-botmanor 2026.1118.5 → 2026.1118.6

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.
@@ -10,19 +10,22 @@ import { FormField as f, Input as p, Textarea as m } from "../components/Input.j
10
10
  import { Badge as h, StatusBadge as ne } from "../components/Badge.js";
11
11
  import { EmptyState as re } from "../components/EmptyState.js";
12
12
  import "../hooks/index.js";
13
- import { WIDGET_METADATA_KEY as ie, readWidgetConfig as g, routeMetadataString as _, useChannelConnector as ae, useChannelRoutes as oe, useCreateChannelConnector as se, useCreateChannelRoute as ce, useDeleteChannelConnector as le, useUpdateChannelConnector as ue } from "../hooks/useChannels.js";
14
- import { formatRelativeTime as de } from "../utils/formatters.js";
15
- import { toUnion as v } from "../utils/unions.js";
16
- import { useInitiateSlackConnect as fe, useLinkIntegrationConnection as pe, useMyUserPlatformConnection as me, useRevokeSlackConnection as he, useToggleSlackNotifications as ge } from "../hooks/useUserPlatformConnection.js";
13
+ import { ChannelCredentialFields as ie, InboundWebhookCard as ae } from "../components/ChannelSetupPanels.js";
14
+ import { ChannelType as oe } from "../../generated/global-types.js";
15
+ import { PLATFORM_CREDENTIALS as se, connectorPlatform as ce, useActiveOrganizationId as le, useInboundChannel as ue, useProvisionChannel as de, validateCredentials as fe } from "../hooks/useChannelSetup.js";
16
+ import { WIDGET_METADATA_KEY as pe, readWidgetConfig as me, routeMetadataString as he, useChannelConnector as ge, useChannelRoutes as _e, useCreateChannelConnector as ve, useCreateChannelRoute as ye, useDeleteChannelConnector as be, useFindChannelConnector as xe, useUpdateChannelConnector as Se } from "../hooks/useChannels.js";
17
+ import { formatRelativeTime as Ce } from "../utils/formatters.js";
18
+ import { useGlobalChannels as we, useInitiateSlackConnect as Te, useLinkIntegrationConnection as Ee, useMyUserPlatformConnection as De, useRevokeSlackConnection as Oe, useToggleSlackNotifications as ke } from "../hooks/useUserPlatformConnection.js";
19
+ import { toUnion as g } from "../utils/unions.js";
17
20
  import "../permissions/index.js";
18
- import { useEffect as _e, useRef as ve, useState as y } from "react";
19
- import { GlassCard as ye, NextSteps as be, PagePurpose as xe } from "@burdenoff/fe-libs/ui";
20
- import { Fragment as Se, jsx as b, jsxs as x } from "react/jsx-runtime";
21
- import { useParams as Ce, useSearchParams as we } from "react-router";
22
- import { ArrowLeft as Te, Bell as Ee, BellOff as De, CheckCircle2 as Oe, Edit as ke, ExternalLink as Ae, Globe as S, Hash as C, Loader2 as w, MessageSquare as T, Palette as E, Plus as D, Radio as O, Save as k, Settings as A, Shield as je, Slack as j, Trash2 as Me, Unlink as Ne, X as M } from "lucide-react";
23
- import { toast as N } from "sonner";
21
+ import { useEffect as Ae, useMemo as je, useRef as Me, useState as _ } from "react";
22
+ import { GlassCard as Ne, NextSteps as Pe, PagePurpose as Fe } from "@burdenoff/fe-libs/ui";
23
+ import { Fragment as Ie, jsx as v, jsxs as y } from "react/jsx-runtime";
24
+ import { useParams as Le, useSearchParams as Re } from "react-router";
25
+ import { ArrowLeft as ze, Bell as Be, BellOff as Ve, CheckCircle2 as He, Edit as Ue, ExternalLink as We, Globe as b, Hash as x, Loader2 as Ge, MessageSquare as S, Palette as Ke, Plus as C, Power as qe, PowerOff as Je, Radio as w, Save as Ye, Settings as Xe, Shield as Ze, Slack as T, Trash2 as Qe, Unlink as $e, X as et } from "lucide-react";
26
+ import { toast as E } from "sonner";
24
27
  // src/botlit/pages/ChannelDetailPage.tsx
25
- var P = [
28
+ var D = [
26
29
  "WEB_WIDGET",
27
30
  "SLACK",
28
31
  "TEAMS",
@@ -30,578 +33,698 @@ var P = [
30
33
  "WHATSAPP",
31
34
  "WEBHOOK",
32
35
  "CUSTOM"
33
- ], Pe = [
36
+ ], tt = [
34
37
  "PRIVATE",
35
38
  "WORKSPACE",
36
39
  "PUBLIC"
37
40
  ];
38
- function Fe(e) {
41
+ function nt(e) {
39
42
  return e.split(",").map((e) => e.trim()).filter(Boolean);
40
43
  }
41
- var Ie = ({ type: e }) => {
44
+ var rt = ({ type: e }) => {
42
45
  switch (e) {
43
- case "SLACK": return /* @__PURE__ */ b(C, { size: 18 });
44
- case "WEB_WIDGET": return /* @__PURE__ */ b(S, { size: 18 });
45
- case "TEAMS": return /* @__PURE__ */ b(T, { size: 18 });
46
- default: return /* @__PURE__ */ b(O, { size: 18 });
46
+ case "SLACK": return /* @__PURE__ */ v(x, { size: 18 });
47
+ case "WEB_WIDGET": return /* @__PURE__ */ v(b, { size: 18 });
48
+ case "TEAMS": return /* @__PURE__ */ v(S, { size: 18 });
49
+ default: return /* @__PURE__ */ v(w, { size: 18 });
47
50
  }
48
- }, F = ({ isNew: S }) => {
49
- let { connectorId: C } = Ce(), { navigateTo: F } = e(), [I, Le] = we(), { data: L, loading: Re } = ae(S ? void 0 : C), { data: ze, refetch: Be } = oe(C), { data: Ve } = t(), [He, Ue] = se(), [We, Ge] = ue(), [Ke, qe] = le(), [Je, Ye] = ce(), R = L?.type === "SLACK" && L?.credentialsRefId ? L.credentialsRefId : void 0, { data: z, loading: Xe, refetch: B } = me(R), { initiate: Ze } = fe(), { link: Qe, loading: $e } = pe(), { toggle: et, loading: tt } = ge(), { revoke: nt, loading: rt } = he(), [it, V] = y(null), at = ve(!1);
50
- _e(() => {
51
- if (at.current) return;
52
- let e = I.get("integrationConnectionId"), t = I.get("channelId");
51
+ }, O = ({ isNew: b }) => {
52
+ let { connectorId: x } = Le(), { navigateTo: O, workspaceId: it } = e(), [k, at] = Re(), { data: A, loading: ot, refetch: st } = ge(b ? void 0 : x), { data: ct, refetch: lt } = _e(x), { data: ut } = t(), [dt, ft] = ve(), [j, M] = Se(), [pt, mt] = be(), [ht, gt] = ye(), N = le(), _t = xe(), { provision: vt, discard: yt, loading: bt } = de(), xt = je(() => ({
53
+ channelType: oe.Communication,
54
+ organizationId: N ?? void 0
55
+ }), [N]), { data: St } = we(xt), Ct = A && ce(A.type) ? A.credentialsRefId : void 0, { data: wt, loading: Tt, error: Et, refetch: Dt } = ue(Ct), P = A?.type === "SLACK" && A?.credentialsRefId ? A.credentialsRefId : void 0, { data: F, loading: Ot, refetch: I } = De(P), { initiate: kt } = Te(), { link: At, loading: jt } = Ee(), { toggle: Mt, loading: Nt } = ke(), { revoke: Pt, loading: Ft } = Oe(), [It, L] = _(null), Lt = Me(!1);
56
+ Ae(() => {
57
+ if (Lt.current) return;
58
+ let e = k.get("integrationConnectionId"), t = k.get("channelId");
53
59
  if (!e || !t) return;
54
- at.current = !0;
55
- let n = new URLSearchParams(I);
56
- n.delete("integrationConnectionId"), n.delete("channelId"), Le(n, { replace: !0 }), V(null), Qe(e, t).then((e) => {
57
- e ? B() : V("Failed to link Slack connection. Please try again.");
60
+ Lt.current = !0;
61
+ let n = new URLSearchParams(k);
62
+ n.delete("integrationConnectionId"), n.delete("channelId"), at(n, { replace: !0 }), L(null), At(e, t).then((e) => {
63
+ e ? I() : L("Failed to link Slack connection. Please try again.");
58
64
  });
59
65
  }, [
60
- I,
61
- Le,
62
- Qe,
63
- B
66
+ k,
67
+ at,
68
+ At,
69
+ I
64
70
  ]);
65
- let ot = () => {
66
- if (!R) return;
71
+ let Rt = () => {
72
+ if (!P) return;
67
73
  let e = `${window.location.origin}${window.location.pathname}`;
68
- Ze(R, e);
69
- }, st = async () => {
70
- z && await et(z.id, !z.notificationsEnabled) && await B();
71
- }, ct = async () => {
72
- z && await nt(z.id) && await B();
73
- }, [H, U] = y(!1), [lt, ut] = y(!1), [dt, W] = y(!1), [G, K] = y({
74
- locationId: "",
74
+ kt(P, e);
75
+ }, zt = async () => {
76
+ F && await Mt(F.id, !F.notificationsEnabled) && await I();
77
+ }, Bt = async () => {
78
+ F && await Pt(F.id) && await I();
79
+ }, [R, z] = _(!1), [Vt, Ht] = _(!1), [Ut, B] = _(!1), [V, H] = _({
80
+ locationId: "*",
75
81
  locationName: "",
76
82
  botId: ""
77
- }), [q, J] = y({
83
+ }), [U, W] = _({
78
84
  name: "",
79
85
  description: "",
80
- type: "WEB_WIDGET",
86
+ type: g(k.get("type") ?? "WEB_WIDGET", D, "WEB_WIDGET"),
81
87
  visibility: "PRIVATE",
82
88
  credentialsRefId: ""
83
- }), [Y, X] = y({
89
+ }), [Wt, Gt] = _(!0), [Kt, qt] = _("new"), [G, Jt] = _({}), K = ce(U.type), q = se[U.type], J = q ? Kt : "existing", Y = K && N ? St.filter((e) => e.organizationId === N && e.platform === K && e.status === "ACTIVE") : [], Yt = Y.some((e) => e.id === U.credentialsRefId), [X, Z] = _({
84
90
  allowedOrigins: "",
85
91
  primaryColor: "#3b82f6",
86
92
  fontFamily: "Inter, sans-serif",
87
93
  starterPrompts: ""
88
- }), ft = () => {
89
- if (q.type === "WEB_WIDGET") return { [ie]: {
90
- allowedOrigins: Fe(Y.allowedOrigins),
91
- primaryColor: Y.primaryColor,
92
- fontFamily: Y.fontFamily,
93
- starterPrompts: Fe(Y.starterPrompts)
94
+ }), Xt = () => {
95
+ if (U.type === "WEB_WIDGET") return { [pe]: {
96
+ allowedOrigins: nt(X.allowedOrigins),
97
+ primaryColor: X.primaryColor,
98
+ fontFamily: X.fontFamily,
99
+ starterPrompts: nt(X.starterPrompts)
94
100
  } };
95
- }, pt = async () => {
96
- if (q.name) try {
97
- let e = await He({
98
- name: q.name,
99
- type: q.type,
100
- description: q.description || void 0,
101
- visibility: q.visibility,
102
- credentialsRefId: q.credentialsRefId || void 0,
103
- metadata: ft()
101
+ }, Zt = async () => {
102
+ if (!U.name) return;
103
+ let e = Wt ? "ACTIVE" : "DRAFT";
104
+ if (K && J === "existing" && !Yt) {
105
+ E.error("Select the channel this connector routes");
106
+ return;
107
+ }
108
+ let t;
109
+ if (K && J === "new" && q) {
110
+ let e = fe(q, G);
111
+ if (e) {
112
+ E.error(e);
113
+ return;
114
+ }
115
+ if (!N) {
116
+ E.error("Select an organization before connecting a channel");
117
+ return;
118
+ }
119
+ try {
120
+ t = await vt({
121
+ name: U.name,
122
+ description: U.description || void 0,
123
+ organizationId: N,
124
+ definition: q,
125
+ credentials: G
126
+ });
127
+ } catch (e) {
128
+ E.error(e instanceof Error ? e.message : "Failed to create the channel");
129
+ return;
130
+ }
131
+ }
132
+ try {
133
+ let n = await dt({
134
+ name: U.name,
135
+ type: U.type,
136
+ description: U.description || void 0,
137
+ visibility: U.visibility,
138
+ status: e,
139
+ credentialsRefId: K ? t ?? (J === "existing" ? U.credentialsRefId : void 0) : void 0,
140
+ metadata: Xt()
104
141
  });
105
- N.success(`Channel "${e.name}" created`), F(`channels/${e.id}`);
142
+ Jt({}), E.success(`Channel "${n.name}" created`), O(`channels/${n.id}`);
106
143
  } catch (e) {
107
- N.error(e instanceof Error ? e.message : "Failed to create channel connector");
144
+ if (t) {
145
+ let e = t;
146
+ await _t(e).catch(() => void 0) === null && await yt(e).catch(() => void 0);
147
+ }
148
+ E.error(e instanceof Error ? e.message : "Failed to create channel connector");
108
149
  }
109
- }, mt = async () => {
110
- if (C && q.name) try {
111
- await We({
112
- connectorId: C,
150
+ }, Qt = async () => {
151
+ if (!x || !A) return;
152
+ let e = A.status !== "ACTIVE";
153
+ try {
154
+ await j({
155
+ connectorId: x,
156
+ input: { status: e ? "ACTIVE" : "DRAFT" }
157
+ }), E.success(e ? "Connector activated" : "Connector deactivated"), st(), Dt();
158
+ } catch (e) {
159
+ E.error(e instanceof Error ? e.message : "Failed to change the connector status");
160
+ }
161
+ }, $t = async () => {
162
+ if (x && U.name) try {
163
+ await j({
164
+ connectorId: x,
113
165
  input: {
114
- name: q.name,
115
- description: q.description || void 0,
116
- visibility: q.visibility,
117
- credentialsRefId: q.credentialsRefId || void 0,
118
- metadata: ft()
166
+ name: U.name,
167
+ description: U.description || void 0,
168
+ visibility: U.visibility,
169
+ credentialsRefId: U.credentialsRefId || void 0,
170
+ metadata: Xt()
119
171
  }
120
- }), N.success("Channel updated"), U(!1);
172
+ }), E.success("Channel updated"), z(!1);
121
173
  } catch (e) {
122
- N.error(e instanceof Error ? e.message : "Failed to update channel connector");
174
+ E.error(e instanceof Error ? e.message : "Failed to update channel connector");
123
175
  }
124
- }, ht = async () => {
125
- if (C) try {
126
- await Ke(C), n() && te("success"), F("channels");
176
+ }, en = async () => {
177
+ if (x) try {
178
+ await pt(x), n() && te("success"), O("channels");
127
179
  } catch (e) {
128
180
  throw n() && te("error"), e;
129
181
  }
130
- }, gt = async () => {
131
- if (!C || !G.locationId || !G.botId) return;
132
- let e = Ve?.find((e) => e.id === G.botId);
182
+ }, tn = async () => {
183
+ if (!x || !V.locationId || !V.botId) return;
184
+ let e = ut?.find((e) => e.id === V.botId);
133
185
  try {
134
- await Je({
135
- connectorId: C,
136
- locationId: G.locationId,
137
- appId: G.botId,
186
+ await ht({
187
+ connectorId: x,
188
+ locationId: V.locationId,
189
+ appId: V.botId,
138
190
  metadata: {
139
- locationName: G.locationName || G.locationId,
191
+ locationName: V.locationName || V.locationId,
140
192
  appName: e?.name
141
193
  }
142
194
  });
143
195
  } catch (e) {
144
- N.error(e instanceof Error ? e.message : "Failed to create route");
196
+ E.error(e instanceof Error ? e.message : "Failed to create route");
145
197
  return;
146
198
  }
147
- N.success("Route created"), Be(), K({
148
- locationId: "",
199
+ E.success("Route created"), lt(), H({
200
+ locationId: "*",
149
201
  locationName: "",
150
202
  botId: ""
151
- }), W(!1);
152
- }, _t = () => {
153
- if (!L) return;
154
- J({
155
- name: L.name,
156
- description: L.description || "",
157
- type: v(L.type, P, "CUSTOM"),
158
- visibility: v(L.visibility, Pe, "PRIVATE"),
159
- credentialsRefId: L.credentialsRefId || ""
203
+ }), B(!1);
204
+ }, nn = () => {
205
+ if (!A) return;
206
+ W({
207
+ name: A.name,
208
+ description: A.description || "",
209
+ type: g(A.type, D, "CUSTOM"),
210
+ visibility: g(A.visibility, tt, "PRIVATE"),
211
+ credentialsRefId: A.credentialsRefId || ""
160
212
  });
161
- let e = g(L);
162
- e && X({
213
+ let e = me(A);
214
+ e && Z({
163
215
  allowedOrigins: e.allowedOrigins.join(", "),
164
216
  primaryColor: e.primaryColor,
165
217
  fontFamily: e.fontFamily,
166
218
  starterPrompts: e.starterPrompts.join(", ")
167
- }), U(!0);
219
+ }), z(!0);
168
220
  };
169
- if (S) return /* @__PURE__ */ b(a, {
221
+ if (b) return /* @__PURE__ */ v(a, {
170
222
  title: "Create Channel Connector",
171
223
  description: "Set up a new channel for your AI agents",
172
- actions: /* @__PURE__ */ x("div", {
224
+ actions: /* @__PURE__ */ y("div", {
173
225
  className: "flex gap-2",
174
- children: [/* @__PURE__ */ b(d, {
226
+ children: [/* @__PURE__ */ v(d, {
175
227
  variant: "outline",
176
- onClick: () => F("channels"),
228
+ onClick: () => O("channels"),
177
229
  children: "Cancel"
178
- }), /* @__PURE__ */ b(d, {
179
- leftIcon: /* @__PURE__ */ b(k, { size: 16 }),
180
- onClick: pt,
181
- isLoading: Ue.loading || Ge.loading,
182
- disabled: !q.name,
230
+ }), /* @__PURE__ */ v(d, {
231
+ leftIcon: /* @__PURE__ */ v(Ye, { size: 16 }),
232
+ onClick: Zt,
233
+ isLoading: bt || ft.loading || M.loading,
234
+ disabled: !U.name || !!K && J === "existing" && !Yt,
183
235
  children: "Create"
184
236
  })]
185
237
  }),
186
- children: /* @__PURE__ */ x("div", {
238
+ children: /* @__PURE__ */ y("div", {
187
239
  className: "max-w-2xl space-y-6",
188
- children: [/* @__PURE__ */ x(o, { children: [/* @__PURE__ */ b(l, { children: /* @__PURE__ */ b(u, { children: "Basic Information" }) }), /* @__PURE__ */ x(s, {
189
- className: "space-y-4",
190
- children: [
191
- /* @__PURE__ */ b(f, {
192
- label: "Connector Name",
193
- required: !0,
194
- children: /* @__PURE__ */ b(p, {
195
- placeholder: "e.g., Production Web Widget",
196
- value: q.name,
197
- onChange: (e) => J({
198
- ...q,
199
- name: e.target.value
200
- })
201
- })
202
- }),
203
- /* @__PURE__ */ b(f, {
204
- label: "Description",
205
- children: /* @__PURE__ */ b(m, {
206
- placeholder: "What is this channel connector for?",
207
- value: q.description,
208
- onChange: (e) => J({
209
- ...q,
210
- description: e.target.value
211
- }),
212
- rows: 3
213
- })
214
- }),
215
- /* @__PURE__ */ x("div", {
216
- className: "grid grid-cols-2 gap-4",
217
- children: [/* @__PURE__ */ b(f, {
218
- label: "Channel Type",
240
+ children: [
241
+ /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ v(l, { children: /* @__PURE__ */ v(u, { children: "Basic Information" }) }), /* @__PURE__ */ y(s, {
242
+ className: "space-y-4",
243
+ children: [
244
+ /* @__PURE__ */ v(f, {
245
+ label: "Connector Name",
219
246
  required: !0,
220
- children: /* @__PURE__ */ x("select", {
221
- className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
222
- value: q.type,
223
- onChange: (e) => J({
224
- ...q,
225
- type: e.target.value
226
- }),
227
- children: [
228
- /* @__PURE__ */ b("option", {
229
- value: "WEB_WIDGET",
230
- children: "Web Widget"
231
- }),
232
- /* @__PURE__ */ b("option", {
233
- value: "SLACK",
234
- children: "Slack"
235
- }),
236
- /* @__PURE__ */ b("option", {
237
- value: "TEAMS",
238
- children: "Microsoft Teams"
239
- }),
240
- /* @__PURE__ */ b("option", {
241
- value: "DISCORD",
242
- children: "Discord"
243
- }),
244
- /* @__PURE__ */ b("option", {
245
- value: "WHATSAPP",
246
- children: "WhatsApp"
247
- }),
248
- /* @__PURE__ */ b("option", {
249
- value: "WEBHOOK",
250
- children: "Webhook"
251
- }),
252
- /* @__PURE__ */ b("option", {
253
- value: "CUSTOM",
254
- children: "Custom"
255
- })
256
- ]
247
+ children: /* @__PURE__ */ v(p, {
248
+ placeholder: "e.g., Production Web Widget",
249
+ value: U.name,
250
+ onChange: (e) => W({
251
+ ...U,
252
+ name: e.target.value
253
+ })
257
254
  })
258
- }), /* @__PURE__ */ b(f, {
259
- label: "Visibility",
260
- children: /* @__PURE__ */ x("select", {
261
- className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
262
- value: q.visibility,
263
- onChange: (e) => J({
264
- ...q,
265
- visibility: e.target.value
255
+ }),
256
+ /* @__PURE__ */ v(f, {
257
+ label: "Description",
258
+ children: /* @__PURE__ */ v(m, {
259
+ placeholder: "What is this channel connector for?",
260
+ value: U.description,
261
+ onChange: (e) => W({
262
+ ...U,
263
+ description: e.target.value
266
264
  }),
267
- children: [
268
- /* @__PURE__ */ b("option", {
269
- value: "PRIVATE",
270
- children: "Private"
265
+ rows: 3
266
+ })
267
+ }),
268
+ /* @__PURE__ */ y("div", {
269
+ className: "grid grid-cols-2 gap-4",
270
+ children: [/* @__PURE__ */ v(f, {
271
+ label: "Channel Type",
272
+ required: !0,
273
+ children: /* @__PURE__ */ y("select", {
274
+ className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
275
+ value: U.type,
276
+ onChange: (e) => W({
277
+ ...U,
278
+ type: e.target.value,
279
+ credentialsRefId: ""
271
280
  }),
272
- /* @__PURE__ */ b("option", {
273
- value: "WORKSPACE",
274
- children: "Workspace"
281
+ children: [
282
+ /* @__PURE__ */ v("option", {
283
+ value: "WEB_WIDGET",
284
+ children: "Web Widget"
285
+ }),
286
+ /* @__PURE__ */ v("option", {
287
+ value: "SLACK",
288
+ children: "Slack"
289
+ }),
290
+ /* @__PURE__ */ v("option", {
291
+ value: "TEAMS",
292
+ children: "Microsoft Teams"
293
+ }),
294
+ /* @__PURE__ */ v("option", {
295
+ value: "DISCORD",
296
+ children: "Discord"
297
+ }),
298
+ /* @__PURE__ */ v("option", {
299
+ value: "WHATSAPP",
300
+ children: "WhatsApp"
301
+ }),
302
+ /* @__PURE__ */ v("option", {
303
+ value: "WEBHOOK",
304
+ children: "Webhook"
305
+ }),
306
+ /* @__PURE__ */ v("option", {
307
+ value: "CUSTOM",
308
+ children: "Custom"
309
+ })
310
+ ]
311
+ })
312
+ }), /* @__PURE__ */ v(f, {
313
+ label: "Visibility",
314
+ children: /* @__PURE__ */ y("select", {
315
+ className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
316
+ value: U.visibility,
317
+ onChange: (e) => W({
318
+ ...U,
319
+ visibility: e.target.value
275
320
  }),
276
- /* @__PURE__ */ b("option", {
277
- value: "PUBLIC",
278
- children: "Public"
279
- })
280
- ]
281
- })
321
+ children: [
322
+ /* @__PURE__ */ v("option", {
323
+ value: "PRIVATE",
324
+ children: "Private"
325
+ }),
326
+ /* @__PURE__ */ v("option", {
327
+ value: "WORKSPACE",
328
+ children: "Workspace"
329
+ }),
330
+ /* @__PURE__ */ v("option", {
331
+ value: "PUBLIC",
332
+ children: "Public"
333
+ })
334
+ ]
335
+ })
336
+ })]
337
+ }),
338
+ /* @__PURE__ */ y("label", {
339
+ className: "flex items-start gap-2 text-sm",
340
+ children: [/* @__PURE__ */ v("input", {
341
+ type: "checkbox",
342
+ className: "mt-1",
343
+ checked: Wt,
344
+ onChange: (e) => Gt(e.target.checked)
345
+ }), /* @__PURE__ */ y("span", { children: [/* @__PURE__ */ v("span", {
346
+ className: "font-medium",
347
+ children: "Activate now"
348
+ }), /* @__PURE__ */ v("span", {
349
+ className: "block text-text-secondary",
350
+ children: "Only an active connector receives messages. Leave unchecked to save it as a draft and activate it later."
351
+ })] })]
352
+ })
353
+ ]
354
+ })] }),
355
+ K && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y(l, { children: [/* @__PURE__ */ y(u, {
356
+ className: "flex items-center gap-2",
357
+ children: [/* @__PURE__ */ v(w, { size: 18 }), "Platform Connection"]
358
+ }), /* @__PURE__ */ v(c, { children: q ? "Enter the credentials of your platform app, or link a channel that is already set up." : "Link a channel that is already set up for this platform." })] }), /* @__PURE__ */ y(s, {
359
+ className: "space-y-4",
360
+ children: [q && /* @__PURE__ */ y("div", {
361
+ className: "flex gap-4 text-sm",
362
+ role: "radiogroup",
363
+ children: [/* @__PURE__ */ y("label", {
364
+ className: "flex items-center gap-2",
365
+ children: [/* @__PURE__ */ v("input", {
366
+ type: "radio",
367
+ name: "connection-mode",
368
+ checked: J === "new",
369
+ onChange: () => qt("new")
370
+ }), "Connect with credentials"]
371
+ }), /* @__PURE__ */ y("label", {
372
+ className: "flex items-center gap-2",
373
+ children: [/* @__PURE__ */ v("input", {
374
+ type: "radio",
375
+ name: "connection-mode",
376
+ checked: J === "existing",
377
+ onChange: () => qt("existing")
378
+ }), "Use an existing channel"]
282
379
  })]
283
- }),
284
- q.type !== "WEB_WIDGET" && /* @__PURE__ */ b(f, {
285
- label: "Credentials Reference",
286
- children: /* @__PURE__ */ b(p, {
287
- placeholder: "e.g., secret-slack-token",
288
- value: q.credentialsRefId,
289
- onChange: (e) => J({
290
- ...q,
380
+ }), J === "new" && q ? /* @__PURE__ */ v(ie, {
381
+ definition: q,
382
+ values: G,
383
+ onChange: Jt
384
+ }) : /* @__PURE__ */ v(f, {
385
+ label: "Channel",
386
+ description: "Channels of this platform in your organization",
387
+ children: /* @__PURE__ */ y("select", {
388
+ "aria-label": "Channel",
389
+ className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
390
+ value: U.credentialsRefId,
391
+ onChange: (e) => W({
392
+ ...U,
291
393
  credentialsRefId: e.target.value
292
- })
394
+ }),
395
+ children: [/* @__PURE__ */ v("option", {
396
+ value: "",
397
+ children: Y.length > 0 ? "Select a channel..." : "No channels of this platform yet"
398
+ }), Y.map((e) => /* @__PURE__ */ v("option", {
399
+ value: e.id,
400
+ children: e.name
401
+ }, e.id))]
293
402
  })
294
- })
295
- ]
296
- })] }), q.type === "WEB_WIDGET" && /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ b(l, { children: /* @__PURE__ */ x(u, {
297
- className: "flex items-center gap-2",
298
- children: [/* @__PURE__ */ b(E, { size: 18 }), "Widget Configuration"]
299
- }) }), /* @__PURE__ */ x(s, {
300
- className: "space-y-4",
301
- children: [
302
- /* @__PURE__ */ b(f, {
303
- label: "Allowed Origins",
304
- description: "Comma-separated list of domains",
305
- children: /* @__PURE__ */ b(p, {
306
- placeholder: "e.g., https://example.com, https://app.example.com",
307
- value: Y.allowedOrigins,
308
- onChange: (e) => X({
309
- ...Y,
310
- allowedOrigins: e.target.value
403
+ })]
404
+ })] }),
405
+ U.type === "WEB_WIDGET" && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ v(l, { children: /* @__PURE__ */ y(u, {
406
+ className: "flex items-center gap-2",
407
+ children: [/* @__PURE__ */ v(Ke, { size: 18 }), "Widget Configuration"]
408
+ }) }), /* @__PURE__ */ y(s, {
409
+ className: "space-y-4",
410
+ children: [
411
+ /* @__PURE__ */ v(f, {
412
+ label: "Allowed Origins",
413
+ description: "Comma-separated list of domains",
414
+ children: /* @__PURE__ */ v(p, {
415
+ placeholder: "e.g., https://example.com, https://app.example.com",
416
+ value: X.allowedOrigins,
417
+ onChange: (e) => Z({
418
+ ...X,
419
+ allowedOrigins: e.target.value
420
+ })
311
421
  })
312
- })
313
- }),
314
- /* @__PURE__ */ x("div", {
315
- className: "grid grid-cols-2 gap-4",
316
- children: [/* @__PURE__ */ b(f, {
317
- label: "Primary Color",
318
- children: /* @__PURE__ */ x("div", {
319
- className: "flex gap-2",
320
- children: [/* @__PURE__ */ b("input", {
321
- type: "color",
322
- value: Y.primaryColor,
323
- onChange: (e) => X({
324
- ...Y,
325
- primaryColor: e.target.value
326
- }),
327
- className: "h-10 w-16 rounded border border-border-default"
328
- }), /* @__PURE__ */ b(p, {
329
- value: Y.primaryColor,
330
- onChange: (e) => X({
331
- ...Y,
332
- primaryColor: e.target.value
422
+ }),
423
+ /* @__PURE__ */ y("div", {
424
+ className: "grid grid-cols-2 gap-4",
425
+ children: [/* @__PURE__ */ v(f, {
426
+ label: "Primary Color",
427
+ children: /* @__PURE__ */ y("div", {
428
+ className: "flex gap-2",
429
+ children: [/* @__PURE__ */ v("input", {
430
+ type: "color",
431
+ value: X.primaryColor,
432
+ onChange: (e) => Z({
433
+ ...X,
434
+ primaryColor: e.target.value
435
+ }),
436
+ className: "h-10 w-16 rounded border border-border-default"
437
+ }), /* @__PURE__ */ v(p, {
438
+ value: X.primaryColor,
439
+ onChange: (e) => Z({
440
+ ...X,
441
+ primaryColor: e.target.value
442
+ })
443
+ })]
444
+ })
445
+ }), /* @__PURE__ */ v(f, {
446
+ label: "Font Family",
447
+ children: /* @__PURE__ */ v(p, {
448
+ value: X.fontFamily,
449
+ onChange: (e) => Z({
450
+ ...X,
451
+ fontFamily: e.target.value
333
452
  })
334
- })]
335
- })
336
- }), /* @__PURE__ */ b(f, {
337
- label: "Font Family",
338
- children: /* @__PURE__ */ b(p, {
339
- value: Y.fontFamily,
340
- onChange: (e) => X({
341
- ...Y,
342
- fontFamily: e.target.value
343
453
  })
454
+ })]
455
+ }),
456
+ /* @__PURE__ */ v(f, {
457
+ label: "Starter Prompts",
458
+ description: "One per line",
459
+ children: /* @__PURE__ */ v(m, {
460
+ placeholder: "What can you help me with?",
461
+ value: X.starterPrompts,
462
+ onChange: (e) => Z({
463
+ ...X,
464
+ starterPrompts: e.target.value
465
+ }),
466
+ rows: 3
344
467
  })
345
- })]
346
- }),
347
- /* @__PURE__ */ b(f, {
348
- label: "Starter Prompts",
349
- description: "One per line",
350
- children: /* @__PURE__ */ b(m, {
351
- placeholder: "What can you help me with?",
352
- value: Y.starterPrompts,
353
- onChange: (e) => X({
354
- ...Y,
355
- starterPrompts: e.target.value
356
- }),
357
- rows: 3
358
468
  })
359
- })
360
- ]
361
- })] })]
469
+ ]
470
+ })] })
471
+ ]
362
472
  })
363
473
  });
364
- if (Re) return /* @__PURE__ */ b(a, {
474
+ if (ot) return /* @__PURE__ */ v(a, {
365
475
  title: "Loading...",
366
- children: /* @__PURE__ */ b("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
476
+ children: /* @__PURE__ */ v("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
367
477
  });
368
- if (!L) return /* @__PURE__ */ b(a, {
478
+ if (!A) return /* @__PURE__ */ v(a, {
369
479
  title: "Connector Not Found",
370
- children: /* @__PURE__ */ b(re, {
480
+ children: /* @__PURE__ */ v(re, {
371
481
  illustration: "empty-notifications",
372
482
  title: "Connector Not Found",
373
483
  description: "This channel connector doesn't exist.",
374
- action: /* @__PURE__ */ b(d, {
375
- onClick: () => F("channels"),
484
+ action: /* @__PURE__ */ v(d, {
485
+ onClick: () => O("channels"),
376
486
  children: "Back to Channels"
377
487
  })
378
488
  })
379
489
  });
380
- let Z = ze?.filter((e) => e.connectorId === L.id) || [], Q = v(L.type, P, "CUSTOM"), $ = g(L);
381
- return /* @__PURE__ */ b(a, {
382
- title: /* @__PURE__ */ x("div", {
490
+ let Q = ct?.filter((e) => e.connectorId === A.id) || [], rn = g(A.type, D, "CUSTOM"), $ = me(A);
491
+ return /* @__PURE__ */ v(a, {
492
+ title: /* @__PURE__ */ y("div", {
383
493
  className: "flex items-center gap-3",
384
494
  children: [
385
- /* @__PURE__ */ b(d, {
495
+ /* @__PURE__ */ v(d, {
386
496
  variant: "ghost",
387
497
  size: "icon",
388
- onClick: () => F("channels"),
389
- children: /* @__PURE__ */ b(Te, { size: 20 })
498
+ onClick: () => O("channels"),
499
+ children: /* @__PURE__ */ v(ze, { size: 20 })
390
500
  }),
391
- /* @__PURE__ */ b("div", {
501
+ /* @__PURE__ */ v("div", {
392
502
  className: "p-2 rounded-lg bg-action-primary-bg/10",
393
- children: /* @__PURE__ */ b(Ie, { type: Q })
503
+ children: /* @__PURE__ */ v(rt, { type: rn })
394
504
  }),
395
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("div", {
505
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("div", {
396
506
  className: "flex items-center gap-2",
397
- children: [/* @__PURE__ */ b("span", { children: L.name }), /* @__PURE__ */ b(ne, { status: L.status })]
398
- }), /* @__PURE__ */ b("p", {
507
+ children: [/* @__PURE__ */ v("span", { children: A.name }), /* @__PURE__ */ v(ne, { status: A.status })]
508
+ }), /* @__PURE__ */ v("p", {
399
509
  className: "text-sm font-normal text-text-secondary",
400
- children: L.description
510
+ children: A.description
401
511
  })] })
402
512
  ]
403
513
  }),
404
- actions: /* @__PURE__ */ x("div", {
514
+ actions: /* @__PURE__ */ y("div", {
405
515
  className: "flex gap-2",
406
- children: [/* @__PURE__ */ b(i, {
516
+ children: [/* @__PURE__ */ v(i, {
407
517
  permission: r.CHANNEL_CREATE,
408
- children: /* @__PURE__ */ b(d, {
518
+ children: /* @__PURE__ */ v(d, {
409
519
  variant: "outline",
410
- leftIcon: /* @__PURE__ */ b(D, { size: 16 }),
411
- onClick: () => W(!0),
520
+ leftIcon: /* @__PURE__ */ v(C, { size: 16 }),
521
+ onClick: () => B(!0),
412
522
  children: "Add Route"
413
523
  })
414
- }), H ? /* @__PURE__ */ x(Se, { children: [/* @__PURE__ */ b(d, {
524
+ }), R ? /* @__PURE__ */ y(Ie, { children: [/* @__PURE__ */ v(d, {
415
525
  variant: "outline",
416
- onClick: () => U(!1),
526
+ onClick: () => z(!1),
417
527
  children: "Cancel"
418
- }), /* @__PURE__ */ b(d, {
419
- leftIcon: /* @__PURE__ */ b(k, { size: 16 }),
420
- onClick: mt,
421
- isLoading: Ge.loading,
528
+ }), /* @__PURE__ */ v(d, {
529
+ leftIcon: /* @__PURE__ */ v(Ye, { size: 16 }),
530
+ onClick: $t,
531
+ isLoading: M.loading,
422
532
  children: "Save"
423
- })] }) : /* @__PURE__ */ x(Se, { children: [/* @__PURE__ */ b(i, {
424
- permission: r.CHANNEL_UPDATE,
425
- children: /* @__PURE__ */ b(d, {
426
- variant: "outline",
427
- leftIcon: /* @__PURE__ */ b(ke, { size: 16 }),
428
- onClick: _t,
429
- children: "Edit"
430
- })
431
- }), lt ? /* @__PURE__ */ x("div", {
432
- className: "flex gap-2",
433
- children: [/* @__PURE__ */ b(d, {
434
- variant: "outline",
435
- size: "sm",
436
- onClick: () => ut(!1),
437
- children: "Cancel"
438
- }), /* @__PURE__ */ b(d, {
439
- variant: "destructive",
440
- size: "sm",
441
- onClick: () => {
442
- ee("medium"), ht();
443
- },
444
- isLoading: qe.loading,
445
- children: "Confirm"
446
- })]
447
- }) : /* @__PURE__ */ b(i, {
448
- permission: r.CHANNEL_DELETE,
449
- children: /* @__PURE__ */ b(d, {
450
- variant: "destructive",
451
- leftIcon: /* @__PURE__ */ b(Me, { size: 16 }),
452
- onClick: () => ut(!0),
453
- children: "Delete"
533
+ })] }) : /* @__PURE__ */ y(Ie, { children: [
534
+ /* @__PURE__ */ v(i, {
535
+ permission: r.CHANNEL_UPDATE,
536
+ children: /* @__PURE__ */ v(d, {
537
+ variant: A.status === "ACTIVE" ? "outline" : "primary",
538
+ leftIcon: A.status === "ACTIVE" ? /* @__PURE__ */ v(Je, { size: 16 }) : /* @__PURE__ */ v(qe, { size: 16 }),
539
+ onClick: () => void Qt(),
540
+ isLoading: M.loading && !R,
541
+ children: A.status === "ACTIVE" ? "Deactivate" : "Activate"
542
+ })
543
+ }),
544
+ /* @__PURE__ */ v(i, {
545
+ permission: r.CHANNEL_UPDATE,
546
+ children: /* @__PURE__ */ v(d, {
547
+ variant: "outline",
548
+ leftIcon: /* @__PURE__ */ v(Ue, { size: 16 }),
549
+ onClick: nn,
550
+ children: "Edit"
551
+ })
552
+ }),
553
+ Vt ? /* @__PURE__ */ y("div", {
554
+ className: "flex gap-2",
555
+ children: [/* @__PURE__ */ v(d, {
556
+ variant: "outline",
557
+ size: "sm",
558
+ onClick: () => Ht(!1),
559
+ children: "Cancel"
560
+ }), /* @__PURE__ */ v(d, {
561
+ variant: "destructive",
562
+ size: "sm",
563
+ onClick: () => {
564
+ ee("medium"), en();
565
+ },
566
+ isLoading: mt.loading,
567
+ children: "Confirm"
568
+ })]
569
+ }) : /* @__PURE__ */ v(i, {
570
+ permission: r.CHANNEL_DELETE,
571
+ children: /* @__PURE__ */ v(d, {
572
+ variant: "destructive",
573
+ leftIcon: /* @__PURE__ */ v(Qe, { size: 16 }),
574
+ onClick: () => Ht(!0),
575
+ children: "Delete"
576
+ })
454
577
  })
455
- })] })]
578
+ ] })]
456
579
  }),
457
- children: /* @__PURE__ */ x("div", {
580
+ children: /* @__PURE__ */ y("div", {
458
581
  className: "space-y-6",
459
582
  children: [
460
- /* @__PURE__ */ b(xe, {
461
- icon: /* @__PURE__ */ b(O, { size: 18 }),
583
+ /* @__PURE__ */ v(Fe, {
584
+ icon: /* @__PURE__ */ v(w, { size: 18 }),
462
585
  children: "This connector links BotManor to one messaging platform. From here you add routes — each mapping a specific location on the channel (a Slack channel, a widget, a number) to the bot that should answer there — tweak the connector’s settings, and manage its connection. Set up at least one route so messages on this channel reach a bot."
463
586
  }),
464
- /* @__PURE__ */ b(be, {
465
- storageKey: `botlit-channel-${L.id}`,
587
+ /* @__PURE__ */ v(Pe, {
588
+ storageKey: `botlit-channel-${A.id}`,
466
589
  steps: [
467
590
  {
468
591
  id: "route",
469
592
  label: "Add a route",
470
593
  description: "Point an incoming location on this channel at one of your bots.",
471
- icon: /* @__PURE__ */ b(D, { size: 16 }),
472
- onClick: () => W(!0),
473
- done: Z.length > 0
594
+ icon: /* @__PURE__ */ v(C, { size: 16 }),
595
+ onClick: () => B(!0),
596
+ done: Q.length > 0
474
597
  },
475
598
  {
476
599
  id: "edit",
477
600
  label: "Review connector settings",
478
601
  description: "Confirm the name, visibility and channel-specific configuration.",
479
- icon: /* @__PURE__ */ b(A, { size: 16 }),
480
- onClick: _t
602
+ icon: /* @__PURE__ */ v(Xe, { size: 16 }),
603
+ onClick: nn
481
604
  },
482
605
  {
483
606
  id: "bots",
484
607
  label: "Check your bots",
485
608
  description: "Make sure the bot you are routing to is active and configured.",
486
- icon: /* @__PURE__ */ b(T, { size: 16 }),
487
- onClick: () => F("bots")
609
+ icon: /* @__PURE__ */ v(S, { size: 16 }),
610
+ onClick: () => O("bots")
488
611
  }
489
612
  ]
490
613
  }),
491
- dt && /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ x(l, {
614
+ Ut && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y(l, {
492
615
  className: "flex flex-row items-center justify-between",
493
- children: [/* @__PURE__ */ b(u, { children: "Add Route" }), /* @__PURE__ */ b(d, {
616
+ children: [/* @__PURE__ */ v(u, { children: "Add Route" }), /* @__PURE__ */ v(d, {
494
617
  variant: "ghost",
495
618
  size: "icon",
496
- onClick: () => W(!1),
497
- children: /* @__PURE__ */ b(M, { size: 16 })
619
+ onClick: () => B(!1),
620
+ children: /* @__PURE__ */ v(et, { size: 16 })
498
621
  })]
499
- }), /* @__PURE__ */ x(s, {
622
+ }), /* @__PURE__ */ y(s, {
500
623
  className: "space-y-4",
501
624
  children: [
502
- /* @__PURE__ */ x("div", {
625
+ /* @__PURE__ */ y("div", {
503
626
  className: "grid grid-cols-2 gap-4",
504
- children: [/* @__PURE__ */ b(f, {
627
+ children: [/* @__PURE__ */ v(f, {
505
628
  label: "Location ID",
506
629
  required: !0,
507
- children: /* @__PURE__ */ b(p, {
508
- placeholder: "e.g., #general or channel ID",
509
- value: G.locationId,
510
- onChange: (e) => K({
511
- ...G,
630
+ children: /* @__PURE__ */ v(p, {
631
+ placeholder: "* for every location, or a Slack channel ID",
632
+ value: V.locationId,
633
+ onChange: (e) => H({
634
+ ...V,
512
635
  locationId: e.target.value
513
636
  })
514
637
  })
515
- }), /* @__PURE__ */ b(f, {
638
+ }), /* @__PURE__ */ v(f, {
516
639
  label: "Location Name",
517
- children: /* @__PURE__ */ b(p, {
640
+ children: /* @__PURE__ */ v(p, {
518
641
  placeholder: "Friendly name (optional)",
519
- value: G.locationName,
520
- onChange: (e) => K({
521
- ...G,
642
+ value: V.locationName,
643
+ onChange: (e) => H({
644
+ ...V,
522
645
  locationName: e.target.value
523
646
  })
524
647
  })
525
648
  })]
526
649
  }),
527
- /* @__PURE__ */ b(f, {
650
+ /* @__PURE__ */ v(f, {
528
651
  label: "Connect to Bot",
529
652
  required: !0,
530
- children: /* @__PURE__ */ x("select", {
653
+ children: /* @__PURE__ */ y("select", {
531
654
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
532
- value: G.botId,
533
- onChange: (e) => K({
534
- ...G,
655
+ value: V.botId,
656
+ onChange: (e) => H({
657
+ ...V,
535
658
  botId: e.target.value
536
659
  }),
537
- children: [/* @__PURE__ */ b("option", {
660
+ children: [/* @__PURE__ */ v("option", {
538
661
  value: "",
539
662
  children: "Select a bot..."
540
- }), Ve?.map((e) => /* @__PURE__ */ b("option", {
663
+ }), ut?.map((e) => /* @__PURE__ */ v("option", {
541
664
  value: e.id,
542
665
  children: e.name
543
666
  }, e.id))]
544
667
  })
545
668
  }),
546
- /* @__PURE__ */ x("div", {
669
+ /* @__PURE__ */ y("div", {
547
670
  className: "flex justify-end gap-2",
548
- children: [/* @__PURE__ */ b(d, {
671
+ children: [/* @__PURE__ */ v(d, {
549
672
  variant: "outline",
550
- onClick: () => W(!1),
673
+ onClick: () => B(!1),
551
674
  children: "Cancel"
552
- }), /* @__PURE__ */ b(d, {
553
- onClick: gt,
554
- isLoading: Ye.loading,
555
- disabled: !G.locationId || !G.botId,
675
+ }), /* @__PURE__ */ v(d, {
676
+ onClick: tn,
677
+ isLoading: gt.loading,
678
+ disabled: !V.locationId || !V.botId,
556
679
  children: "Add Route"
557
680
  })]
558
681
  })
559
682
  ]
560
683
  })] }),
561
- H && /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ b(l, { children: /* @__PURE__ */ b(u, { children: "Edit Channel" }) }), /* @__PURE__ */ x(s, {
684
+ R && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ v(l, { children: /* @__PURE__ */ v(u, { children: "Edit Channel" }) }), /* @__PURE__ */ y(s, {
562
685
  className: "space-y-4",
563
686
  children: [
564
- /* @__PURE__ */ b(f, {
687
+ /* @__PURE__ */ v(f, {
565
688
  label: "Connector Name",
566
689
  required: !0,
567
- children: /* @__PURE__ */ b(p, {
568
- value: q.name,
569
- onChange: (e) => J({
570
- ...q,
690
+ children: /* @__PURE__ */ v(p, {
691
+ value: U.name,
692
+ onChange: (e) => W({
693
+ ...U,
571
694
  name: e.target.value
572
695
  })
573
696
  })
574
697
  }),
575
- /* @__PURE__ */ b(f, {
698
+ /* @__PURE__ */ v(f, {
576
699
  label: "Description",
577
- children: /* @__PURE__ */ b(m, {
578
- value: q.description,
579
- onChange: (e) => J({
580
- ...q,
700
+ children: /* @__PURE__ */ v(m, {
701
+ value: U.description,
702
+ onChange: (e) => W({
703
+ ...U,
581
704
  description: e.target.value
582
705
  }),
583
706
  rows: 2
584
707
  })
585
708
  }),
586
- /* @__PURE__ */ b(f, {
709
+ /* @__PURE__ */ v(f, {
587
710
  label: "Visibility",
588
- children: /* @__PURE__ */ x("select", {
711
+ children: /* @__PURE__ */ y("select", {
589
712
  className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
590
- value: q.visibility,
591
- onChange: (e) => J({
592
- ...q,
713
+ value: U.visibility,
714
+ onChange: (e) => W({
715
+ ...U,
593
716
  visibility: e.target.value
594
717
  }),
595
718
  children: [
596
- /* @__PURE__ */ b("option", {
719
+ /* @__PURE__ */ v("option", {
597
720
  value: "PRIVATE",
598
721
  children: "Private"
599
722
  }),
600
- /* @__PURE__ */ b("option", {
723
+ /* @__PURE__ */ v("option", {
601
724
  value: "WORKSPACE",
602
725
  children: "Workspace"
603
726
  }),
604
- /* @__PURE__ */ b("option", {
727
+ /* @__PURE__ */ v("option", {
605
728
  value: "PUBLIC",
606
729
  children: "Public"
607
730
  })
@@ -610,228 +733,237 @@ var Ie = ({ type: e }) => {
610
733
  })
611
734
  ]
612
735
  })] }),
613
- /* @__PURE__ */ x("div", {
736
+ /* @__PURE__ */ y("div", {
614
737
  className: "grid grid-cols-2 md:grid-cols-4 gap-4",
615
738
  children: [
616
- /* @__PURE__ */ b(o, { children: /* @__PURE__ */ x(s, {
739
+ /* @__PURE__ */ v(o, { children: /* @__PURE__ */ y(s, {
617
740
  className: "pt-6 text-center",
618
741
  children: [
619
- /* @__PURE__ */ b("div", {
742
+ /* @__PURE__ */ v("div", {
620
743
  className: "p-3 rounded-full bg-action-primary-bg/10 w-fit mx-auto mb-2",
621
- children: /* @__PURE__ */ b(Ie, { type: Q })
744
+ children: /* @__PURE__ */ v(rt, { type: rn })
622
745
  }),
623
- /* @__PURE__ */ b("p", {
746
+ /* @__PURE__ */ v("p", {
624
747
  className: "text-lg font-bold capitalize",
625
- children: L.type.toLowerCase().replace("_", " ")
748
+ children: A.type.toLowerCase().replace("_", " ")
626
749
  }),
627
- /* @__PURE__ */ b("p", {
750
+ /* @__PURE__ */ v("p", {
628
751
  className: "text-sm text-text-secondary",
629
752
  children: "Channel Type"
630
753
  })
631
754
  ]
632
755
  }) }),
633
- /* @__PURE__ */ x(ye, {
756
+ /* @__PURE__ */ y(Ne, {
634
757
  treatment: "glass",
635
758
  glow: !0,
636
759
  className: "p-6 text-center",
637
- children: [/* @__PURE__ */ b("p", {
760
+ children: [/* @__PURE__ */ v("p", {
638
761
  className: "text-3xl font-bold tabular-nums text-text-primary",
639
- children: Z.length
640
- }), /* @__PURE__ */ b("p", {
762
+ children: Q.length
763
+ }), /* @__PURE__ */ v("p", {
641
764
  className: "text-sm text-text-secondary",
642
765
  children: "Active Routes"
643
766
  })]
644
767
  }),
645
- /* @__PURE__ */ b(o, { children: /* @__PURE__ */ x(s, {
768
+ /* @__PURE__ */ v(o, { children: /* @__PURE__ */ y(s, {
646
769
  className: "pt-6 text-center",
647
- children: [/* @__PURE__ */ b("p", {
770
+ children: [/* @__PURE__ */ v("p", {
648
771
  className: "text-3xl font-bold text-text-primary capitalize",
649
- children: L.visibility.toLowerCase()
650
- }), /* @__PURE__ */ b("p", {
772
+ children: A.visibility.toLowerCase()
773
+ }), /* @__PURE__ */ v("p", {
651
774
  className: "text-sm text-text-secondary",
652
775
  children: "Visibility"
653
776
  })]
654
777
  }) }),
655
- /* @__PURE__ */ b(o, { children: /* @__PURE__ */ x(s, {
778
+ /* @__PURE__ */ v(o, { children: /* @__PURE__ */ y(s, {
656
779
  className: "pt-6 text-center",
657
- children: [/* @__PURE__ */ b("p", {
780
+ children: [/* @__PURE__ */ v("p", {
658
781
  className: "text-3xl font-bold text-text-primary",
659
- children: L.revision
660
- }), /* @__PURE__ */ b("p", {
782
+ children: A.revision
783
+ }), /* @__PURE__ */ v("p", {
661
784
  className: "text-sm text-text-secondary",
662
785
  children: "Revision"
663
786
  })]
664
787
  }) })
665
788
  ]
666
789
  }),
667
- $ && /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ b(l, { children: /* @__PURE__ */ x(u, {
790
+ $ && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ v(l, { children: /* @__PURE__ */ y(u, {
668
791
  className: "flex items-center gap-2",
669
- children: [/* @__PURE__ */ b(E, { size: 18 }), "Widget Configuration"]
670
- }) }), /* @__PURE__ */ x(s, { children: [/* @__PURE__ */ x("div", {
792
+ children: [/* @__PURE__ */ v(Ke, { size: 18 }), "Widget Configuration"]
793
+ }) }), /* @__PURE__ */ y(s, { children: [/* @__PURE__ */ y("div", {
671
794
  className: "grid grid-cols-2 md:grid-cols-3 gap-6",
672
795
  children: [
673
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
796
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
674
797
  className: "text-sm text-text-secondary",
675
798
  children: "Allowed Origins"
676
- }), $.allowedOrigins.length > 0 ? /* @__PURE__ */ b("div", {
799
+ }), $.allowedOrigins.length > 0 ? /* @__PURE__ */ v("div", {
677
800
  className: "flex flex-wrap gap-1 mt-1",
678
- children: $.allowedOrigins.map((e) => /* @__PURE__ */ b(h, {
801
+ children: $.allowedOrigins.map((e) => /* @__PURE__ */ v(h, {
679
802
  variant: "outline",
680
803
  className: "font-mono text-xs",
681
804
  children: e
682
805
  }, e))
683
- }) : /* @__PURE__ */ b("p", {
806
+ }) : /* @__PURE__ */ v("p", {
684
807
  className: "font-medium",
685
808
  children: "Any origin"
686
809
  })] }),
687
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
810
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
688
811
  className: "text-sm text-text-secondary",
689
812
  children: "Theme"
690
- }), /* @__PURE__ */ x("div", {
813
+ }), /* @__PURE__ */ y("div", {
691
814
  className: "flex items-center gap-2 mt-1",
692
- children: [/* @__PURE__ */ b("div", {
815
+ children: [/* @__PURE__ */ v("div", {
693
816
  className: "w-6 h-6 rounded border border-border-subtle",
694
817
  style: { backgroundColor: $.primaryColor }
695
- }), /* @__PURE__ */ b("span", {
818
+ }), /* @__PURE__ */ v("span", {
696
819
  className: "font-mono text-sm",
697
820
  children: $.primaryColor
698
821
  })]
699
822
  })] }),
700
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
823
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
701
824
  className: "text-sm text-text-secondary",
702
825
  children: "Font Family"
703
- }), /* @__PURE__ */ b("p", {
826
+ }), /* @__PURE__ */ v("p", {
704
827
  className: "font-medium",
705
828
  children: $.fontFamily
706
829
  })] })
707
830
  ]
708
- }), $.starterPrompts.length > 0 && /* @__PURE__ */ x("div", {
831
+ }), $.starterPrompts.length > 0 && /* @__PURE__ */ y("div", {
709
832
  className: "mt-4 pt-4 border-t border-border-subtle",
710
- children: [/* @__PURE__ */ b("p", {
833
+ children: [/* @__PURE__ */ v("p", {
711
834
  className: "text-sm text-text-secondary mb-2",
712
835
  children: "Starter Prompts"
713
- }), /* @__PURE__ */ b("div", {
836
+ }), /* @__PURE__ */ v("div", {
714
837
  className: "flex flex-wrap gap-2",
715
- children: $.starterPrompts.map((e, t) => /* @__PURE__ */ b(h, {
838
+ children: $.starterPrompts.map((e, t) => /* @__PURE__ */ v(h, {
716
839
  variant: "secondary",
717
840
  children: e
718
841
  }, t))
719
842
  })]
720
843
  })] })] }),
721
- /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ x(l, {
844
+ Ct && /* @__PURE__ */ v(ae, {
845
+ channel: wt,
846
+ loading: Tt,
847
+ error: Et,
848
+ connectorActive: A.status === "ACTIVE",
849
+ workspaceId: it,
850
+ hint: se[A.type]?.inboundHint,
851
+ onRefresh: () => void Dt()
852
+ }),
853
+ /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y(l, {
722
854
  className: "flex flex-row items-center justify-between",
723
- children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(u, { children: "Routes" }), /* @__PURE__ */ b(c, { children: "Routes connect this channel to your bots" })] }), /* @__PURE__ */ b(i, {
855
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v(u, { children: "Routes" }), /* @__PURE__ */ v(c, { children: "Routes connect this channel to your bots" })] }), /* @__PURE__ */ v(i, {
724
856
  permission: r.CHANNEL_CREATE,
725
- children: /* @__PURE__ */ b(d, {
857
+ children: /* @__PURE__ */ v(d, {
726
858
  variant: "outline",
727
859
  size: "sm",
728
- leftIcon: /* @__PURE__ */ b(D, { size: 14 }),
729
- onClick: () => W(!0),
860
+ leftIcon: /* @__PURE__ */ v(C, { size: 14 }),
861
+ onClick: () => B(!0),
730
862
  children: "Add Route"
731
863
  })
732
864
  })]
733
- }), /* @__PURE__ */ b(s, { children: Z.length > 0 ? /* @__PURE__ */ b("div", {
865
+ }), /* @__PURE__ */ v(s, { children: Q.length > 0 ? /* @__PURE__ */ v("div", {
734
866
  className: "space-y-3",
735
- children: Z.map((e) => /* @__PURE__ */ x("div", {
867
+ children: Q.map((e) => /* @__PURE__ */ y("div", {
736
868
  className: "flex items-center justify-between p-4 border border-border-subtle rounded-lg",
737
- children: [/* @__PURE__ */ x("div", {
869
+ children: [/* @__PURE__ */ y("div", {
738
870
  className: "flex items-center gap-4",
739
- children: [/* @__PURE__ */ b("div", {
871
+ children: [/* @__PURE__ */ v("div", {
740
872
  className: "p-2 rounded-lg bg-bg-sunken",
741
- children: /* @__PURE__ */ b(T, {
873
+ children: /* @__PURE__ */ v(S, {
742
874
  size: 18,
743
875
  className: "text-text-secondary"
744
876
  })
745
- }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
877
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
746
878
  className: "font-medium",
747
- children: _(e, "locationName") ?? e.locationId
748
- }), /* @__PURE__ */ x("p", {
879
+ children: he(e, "locationName") ?? e.locationId
880
+ }), /* @__PURE__ */ y("p", {
749
881
  className: "text-sm text-text-secondary",
750
- children: ["Connected to: ", _(e, "appName") ?? e.appId]
882
+ children: ["Connected to: ", he(e, "appName") ?? e.appId]
751
883
  })] })]
752
- }), /* @__PURE__ */ x("div", {
884
+ }), /* @__PURE__ */ y("div", {
753
885
  className: "flex items-center gap-2",
754
- children: [/* @__PURE__ */ x(h, {
886
+ children: [/* @__PURE__ */ y(h, {
755
887
  variant: "outline",
756
888
  children: ["Rev ", e.revision]
757
- }), /* @__PURE__ */ b(d, {
889
+ }), /* @__PURE__ */ v(d, {
758
890
  variant: "ghost",
759
891
  size: "sm",
760
- children: /* @__PURE__ */ b(Ae, { size: 14 })
892
+ children: /* @__PURE__ */ v(We, { size: 14 })
761
893
  })]
762
894
  })]
763
895
  }, e.id))
764
- }) : /* @__PURE__ */ b(re, {
896
+ }) : /* @__PURE__ */ v(re, {
765
897
  illustration: "empty-data",
766
898
  title: "No routes configured",
767
899
  description: "Add a route to connect this channel to a bot.",
768
- action: /* @__PURE__ */ b(i, {
900
+ action: /* @__PURE__ */ v(i, {
769
901
  permission: r.CHANNEL_CREATE,
770
- children: /* @__PURE__ */ b(d, {
771
- leftIcon: /* @__PURE__ */ b(D, { size: 16 }),
772
- onClick: () => W(!0),
902
+ children: /* @__PURE__ */ v(d, {
903
+ leftIcon: /* @__PURE__ */ v(C, { size: 16 }),
904
+ onClick: () => B(!0),
773
905
  children: "Add Route"
774
906
  })
775
907
  })
776
908
  }) })] }),
777
- L.type === "SLACK" && L.credentialsRefId && /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ x(l, { children: [/* @__PURE__ */ x(u, {
909
+ A.type === "SLACK" && A.credentialsRefId && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y(l, { children: [/* @__PURE__ */ y(u, {
778
910
  className: "flex items-center gap-2",
779
- children: [/* @__PURE__ */ b(j, { size: 18 }), "Your Slack Account"]
780
- }), /* @__PURE__ */ b(c, { children: "Connect your personal Slack account to receive direct messages from this bot" })] }), /* @__PURE__ */ x(s, { children: [it && /* @__PURE__ */ x("div", {
911
+ children: [/* @__PURE__ */ v(T, { size: 18 }), "Your Slack Account"]
912
+ }), /* @__PURE__ */ v(c, { children: "Connect your personal Slack account to receive direct messages from this bot" })] }), /* @__PURE__ */ y(s, { children: [It && /* @__PURE__ */ y("div", {
781
913
  className: "mb-4 flex items-start gap-2 rounded-lg border border-status-error-border/40 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
782
- children: [/* @__PURE__ */ b("span", { children: it }), /* @__PURE__ */ b("button", {
783
- onClick: () => V(null),
914
+ children: [/* @__PURE__ */ v("span", { children: It }), /* @__PURE__ */ v("button", {
915
+ onClick: () => L(null),
784
916
  className: "ml-auto cursor-pointer text-status-error-text/70 hover:text-status-error-text",
785
- children: /* @__PURE__ */ b(M, { size: 14 })
917
+ children: /* @__PURE__ */ v(et, { size: 14 })
786
918
  })]
787
- }), $e ? /* @__PURE__ */ x("div", {
919
+ }), jt ? /* @__PURE__ */ y("div", {
788
920
  className: "flex items-center gap-2 py-4 text-text-secondary",
789
- children: [/* @__PURE__ */ b(w, {
921
+ children: [/* @__PURE__ */ v(Ge, {
790
922
  size: 16,
791
923
  className: "animate-spin"
792
- }), /* @__PURE__ */ b("span", {
924
+ }), /* @__PURE__ */ v("span", {
793
925
  className: "text-sm",
794
926
  children: "Linking Slack connection..."
795
927
  })]
796
- }) : Xe ? /* @__PURE__ */ x("div", {
928
+ }) : Ot ? /* @__PURE__ */ y("div", {
797
929
  className: "flex items-center gap-2 py-4 text-text-secondary",
798
- children: [/* @__PURE__ */ b(w, {
930
+ children: [/* @__PURE__ */ v(Ge, {
799
931
  size: 16,
800
932
  className: "animate-spin"
801
- }), /* @__PURE__ */ b("span", {
933
+ }), /* @__PURE__ */ v("span", {
802
934
  className: "text-sm",
803
935
  children: "Checking connection..."
804
936
  })]
805
- }) : z && z.dmAllowed ? /* @__PURE__ */ x("div", {
937
+ }) : F && F.dmAllowed ? /* @__PURE__ */ y("div", {
806
938
  className: "space-y-4",
807
939
  children: [
808
- /* @__PURE__ */ x("div", {
940
+ /* @__PURE__ */ y("div", {
809
941
  className: "flex items-center gap-3 p-3 rounded-lg bg-bg-sunken",
810
942
  children: [
811
- /* @__PURE__ */ b(Oe, {
943
+ /* @__PURE__ */ v(He, {
812
944
  size: 20,
813
945
  className: "text-status-success-text shrink-0"
814
946
  }),
815
- /* @__PURE__ */ x("div", {
947
+ /* @__PURE__ */ y("div", {
816
948
  className: "min-w-0 flex-1",
817
949
  children: [
818
- /* @__PURE__ */ b("p", {
950
+ /* @__PURE__ */ v("p", {
819
951
  className: "font-medium text-sm",
820
- children: z.externalDisplayName || z.externalUsername || z.externalUserId
952
+ children: F.externalDisplayName || F.externalUsername || F.externalUserId
821
953
  }),
822
- z.externalUsername && z.externalDisplayName && /* @__PURE__ */ x("p", {
954
+ F.externalUsername && F.externalDisplayName && /* @__PURE__ */ y("p", {
823
955
  className: "text-xs text-text-secondary",
824
- children: ["@", z.externalUsername]
956
+ children: ["@", F.externalUsername]
825
957
  }),
826
- z.connectedAt && /* @__PURE__ */ x("p", {
958
+ F.connectedAt && /* @__PURE__ */ y("p", {
827
959
  className: "text-xs text-text-secondary",
828
- children: ["Connected ", new Date(z.connectedAt).toLocaleDateString()]
960
+ children: ["Connected ", new Date(F.connectedAt).toLocaleDateString()]
829
961
  })
830
962
  ]
831
963
  }),
832
- /* @__PURE__ */ b("div", {
964
+ /* @__PURE__ */ v("div", {
833
965
  className: "flex items-center gap-1",
834
- children: z.isTokenExpired && /* @__PURE__ */ b(h, {
966
+ children: F.isTokenExpired && /* @__PURE__ */ v(h, {
835
967
  variant: "outline",
836
968
  className: "text-xs text-status-warning-text border-status-warning-border",
837
969
  children: "Token expired"
@@ -839,126 +971,126 @@ var Ie = ({ type: e }) => {
839
971
  })
840
972
  ]
841
973
  }),
842
- /* @__PURE__ */ x("div", {
974
+ /* @__PURE__ */ y("div", {
843
975
  className: "flex items-center justify-between p-3 border border-border-subtle rounded-lg",
844
- children: [/* @__PURE__ */ x("div", {
976
+ children: [/* @__PURE__ */ y("div", {
845
977
  className: "flex items-center gap-2",
846
- children: [z.notificationsEnabled ? /* @__PURE__ */ b(Ee, {
978
+ children: [F.notificationsEnabled ? /* @__PURE__ */ v(Be, {
847
979
  size: 16,
848
980
  className: "text-primary"
849
- }) : /* @__PURE__ */ b(De, {
981
+ }) : /* @__PURE__ */ v(Ve, {
850
982
  size: 16,
851
983
  className: "text-text-secondary"
852
- }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
984
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
853
985
  className: "text-sm font-medium",
854
986
  children: "DM Notifications"
855
- }), /* @__PURE__ */ b("p", {
987
+ }), /* @__PURE__ */ v("p", {
856
988
  className: "text-xs text-text-secondary",
857
- children: z.notificationsEnabled ? "You will receive bot DMs" : "DM notifications are paused"
989
+ children: F.notificationsEnabled ? "You will receive bot DMs" : "DM notifications are paused"
858
990
  })] })]
859
- }), /* @__PURE__ */ b(d, {
991
+ }), /* @__PURE__ */ v(d, {
860
992
  variant: "outline",
861
993
  size: "sm",
862
- onClick: st,
863
- isLoading: tt,
864
- children: z.notificationsEnabled ? "Disable" : "Enable"
994
+ onClick: zt,
995
+ isLoading: Nt,
996
+ children: F.notificationsEnabled ? "Disable" : "Enable"
865
997
  })]
866
998
  }),
867
- /* @__PURE__ */ x("div", {
999
+ /* @__PURE__ */ y("div", {
868
1000
  className: "flex gap-2 justify-end pt-2",
869
- children: [z.isTokenExpired && /* @__PURE__ */ b(d, {
1001
+ children: [F.isTokenExpired && /* @__PURE__ */ v(d, {
870
1002
  variant: "outline",
871
1003
  size: "sm",
872
- leftIcon: /* @__PURE__ */ b(j, { size: 14 }),
873
- onClick: ot,
1004
+ leftIcon: /* @__PURE__ */ v(T, { size: 14 }),
1005
+ onClick: Rt,
874
1006
  children: "Reconnect"
875
- }), /* @__PURE__ */ b(d, {
1007
+ }), /* @__PURE__ */ v(d, {
876
1008
  variant: "destructive",
877
1009
  size: "sm",
878
- leftIcon: /* @__PURE__ */ b(Ne, { size: 14 }),
879
- onClick: ct,
880
- isLoading: rt,
1010
+ leftIcon: /* @__PURE__ */ v($e, { size: 14 }),
1011
+ onClick: Bt,
1012
+ isLoading: Ft,
881
1013
  children: "Disconnect"
882
1014
  })]
883
1015
  })
884
1016
  ]
885
- }) : /* @__PURE__ */ x("div", {
1017
+ }) : /* @__PURE__ */ y("div", {
886
1018
  className: "flex flex-col items-center gap-4 py-8 text-center",
887
1019
  children: [
888
- /* @__PURE__ */ b("div", {
1020
+ /* @__PURE__ */ v("div", {
889
1021
  className: "p-4 rounded-full bg-bg-sunken",
890
- children: /* @__PURE__ */ b(j, {
1022
+ children: /* @__PURE__ */ v(T, {
891
1023
  size: 32,
892
1024
  className: "text-text-secondary"
893
1025
  })
894
1026
  }),
895
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
1027
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
896
1028
  className: "font-medium",
897
1029
  children: "No personal account connected"
898
- }), /* @__PURE__ */ b("p", {
1030
+ }), /* @__PURE__ */ v("p", {
899
1031
  className: "text-sm text-text-secondary mt-1",
900
1032
  children: "Connect your Slack account so the bot can send you direct messages"
901
1033
  })] }),
902
- /* @__PURE__ */ b(d, {
903
- leftIcon: /* @__PURE__ */ b(j, { size: 16 }),
904
- onClick: ot,
1034
+ /* @__PURE__ */ v(d, {
1035
+ leftIcon: /* @__PURE__ */ v(T, { size: 16 }),
1036
+ onClick: Rt,
905
1037
  children: "Connect with Slack"
906
1038
  })
907
1039
  ]
908
1040
  })] })] }),
909
- L.defaultPolicyBindings && /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ x(l, { children: [/* @__PURE__ */ x(u, {
1041
+ A.defaultPolicyBindings && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ y(l, { children: [/* @__PURE__ */ y(u, {
910
1042
  className: "flex items-center gap-2",
911
- children: [/* @__PURE__ */ b(je, { size: 18 }), "Default Policy Bindings"]
912
- }), /* @__PURE__ */ b(c, { children: "Default policies applied to all routes on this connector" })] }), /* @__PURE__ */ b(s, { children: /* @__PURE__ */ b("div", {
1043
+ children: [/* @__PURE__ */ v(Ze, { size: 18 }), "Default Policy Bindings"]
1044
+ }), /* @__PURE__ */ v(c, { children: "Default policies applied to all routes on this connector" })] }), /* @__PURE__ */ v(s, { children: /* @__PURE__ */ v("div", {
913
1045
  className: "grid grid-cols-2 md:grid-cols-4 gap-4",
914
- children: Object.entries(L.defaultPolicyBindings).map(([e, t]) => t ? /* @__PURE__ */ x("div", {
1046
+ children: Object.entries(A.defaultPolicyBindings).map(([e, t]) => t ? /* @__PURE__ */ y("div", {
915
1047
  className: "p-3 bg-bg-sunken rounded-lg",
916
- children: [/* @__PURE__ */ b("p", {
1048
+ children: [/* @__PURE__ */ v("p", {
917
1049
  className: "text-xs text-text-secondary capitalize",
918
1050
  children: e.replace("PolicyId", "").replace(/([A-Z])/g, " $1")
919
- }), /* @__PURE__ */ b("p", {
1051
+ }), /* @__PURE__ */ v("p", {
920
1052
  className: "font-medium text-sm truncate",
921
1053
  children: String(t)
922
1054
  })]
923
1055
  }, e) : null)
924
1056
  }) })] }),
925
- /* @__PURE__ */ x(o, { children: [/* @__PURE__ */ b(l, { children: /* @__PURE__ */ x(u, {
1057
+ /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ v(l, { children: /* @__PURE__ */ y(u, {
926
1058
  className: "flex items-center gap-2",
927
- children: [/* @__PURE__ */ b(A, { size: 18 }), "Metadata"]
928
- }) }), /* @__PURE__ */ b(s, { children: /* @__PURE__ */ x("div", {
1059
+ children: [/* @__PURE__ */ v(Xe, { size: 18 }), "Metadata"]
1060
+ }) }), /* @__PURE__ */ v(s, { children: /* @__PURE__ */ y("div", {
929
1061
  className: "grid grid-cols-2 md:grid-cols-4 gap-6 text-sm",
930
1062
  children: [
931
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
1063
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
932
1064
  className: "text-text-secondary",
933
1065
  children: "Created"
934
- }), /* @__PURE__ */ b("p", {
1066
+ }), /* @__PURE__ */ v("p", {
935
1067
  className: "font-medium",
936
- children: de(L.createdAt)
1068
+ children: Ce(A.createdAt)
937
1069
  })] }),
938
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
1070
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
939
1071
  className: "text-text-secondary",
940
1072
  children: "Updated"
941
- }), /* @__PURE__ */ b("p", {
1073
+ }), /* @__PURE__ */ v("p", {
942
1074
  className: "font-medium",
943
- children: de(L.updatedAt)
1075
+ children: Ce(A.updatedAt)
944
1076
  })] }),
945
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
1077
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
946
1078
  className: "text-text-secondary",
947
- children: "Credentials"
948
- }), /* @__PURE__ */ b("p", {
949
- className: "font-medium",
950
- children: L.credentialsRefId || "Not configured"
1079
+ children: "Linked channel"
1080
+ }), /* @__PURE__ */ v("p", {
1081
+ className: "font-medium break-all",
1082
+ children: wt?.name ?? A.credentialsRefId ?? "Not configured"
951
1083
  })] }),
952
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
1084
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
953
1085
  className: "text-text-secondary",
954
1086
  children: "Tags"
955
- }), /* @__PURE__ */ b("div", {
1087
+ }), /* @__PURE__ */ v("div", {
956
1088
  className: "flex gap-1",
957
- children: L.tags.length > 0 ? L.tags.map((e) => /* @__PURE__ */ b(h, {
1089
+ children: A.tags.length > 0 ? A.tags.map((e) => /* @__PURE__ */ v(h, {
958
1090
  variant: "secondary",
959
1091
  className: "text-xs",
960
1092
  children: e
961
- }, e)) : /* @__PURE__ */ b("span", {
1093
+ }, e)) : /* @__PURE__ */ v("span", {
962
1094
  className: "text-text-secondary",
963
1095
  children: "None"
964
1096
  })
@@ -969,6 +1101,6 @@ var Ie = ({ type: e }) => {
969
1101
  })
970
1102
  });
971
1103
  };
972
- export { F as ChannelDetailPage };
1104
+ export { O as ChannelDetailPage };
973
1105
 
974
1106
  //# sourceMappingURL=ChannelDetailPage.js.map