@wso2/am-core-ui 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/APIKeysManager-C0phJriD.js +241 -0
  2. package/dist/CatalogKindListing-DtFI2YMG.js +118 -0
  3. package/dist/CodeBlock-mB_Loq7I.js +21736 -0
  4. package/dist/EnvironmentCard-09h1XRxx.js +310 -0
  5. package/dist/EnvironmentSelector-B7Bl93s2.js +48 -0
  6. package/dist/MCPLogo-D9IJzzl7.js +30 -0
  7. package/dist/PolicyListSection-o4k9e8XO.js +2475 -0
  8. package/dist/ResourceListShell-Cx6mdeqv.js +463 -0
  9. package/dist/SwaggerSpecViewer-BvkhoKsi.js +106 -0
  10. package/dist/clipboard-YAzStmkw.js +23 -0
  11. package/dist/debounce-BV83M53b.js +208 -0
  12. package/dist/format-BEZZRyE2.js +29 -0
  13. package/dist/formatDistanceToNow-TErllcH8.js +100 -0
  14. package/dist/gatewayScripts-D8O45W8u.js +72 -0
  15. package/dist/highlight-BsUzxSR3.js +454 -0
  16. package/dist/index-B52h3RHg.js +1290 -0
  17. package/dist/index-BP5drcF2.js +1265 -0
  18. package/dist/index-BZ4vxviI.js +7981 -0
  19. package/dist/index-B_Z0MwXk.js +25012 -0
  20. package/dist/index-BfjzUWDa.js +1397 -0
  21. package/dist/{index-DYV1jEai.js → index-BnV-PkwM.js} +22 -20
  22. package/dist/index-CGDYgUCH.js +711 -0
  23. package/dist/index-COt7nJIf.js +2286 -0
  24. package/dist/index-CWZjOy1h.js +2247 -0
  25. package/dist/index-CezvogTQ.js +116 -0
  26. package/dist/index-CgCWbWzN.js +2342 -0
  27. package/dist/index-CjCkcuuI.js +322 -0
  28. package/dist/index-CjXvuf9m.js +1354 -0
  29. package/dist/index-DD4qF7gq.js +2340 -0
  30. package/dist/index-DeQ-9KTC.js +737 -0
  31. package/dist/index-Df6OBy4E.js +3041 -0
  32. package/dist/index-KRsV2L4V.js +1564 -0
  33. package/dist/index-PUuASE1F.js +2507 -0
  34. package/dist/index-PWsNvJB-.js +546 -0
  35. package/dist/index-UqDmyMSA.js +119 -0
  36. package/dist/index-_0Pj_ZtW.js +459 -0
  37. package/dist/{index-CnXsN5I3.js → index-sr-mWz4T.js} +31 -30
  38. package/dist/index.d.ts +496 -200
  39. package/dist/index.js +462 -439
  40. package/dist/llmProviderPayload-CzihkdNa.js +332 -0
  41. package/dist/schemas-DFScWdSL.js +2969 -0
  42. package/package.json +1 -1
  43. package/dist/index-B47EJCom.js +0 -236
  44. package/dist/index-Bl1Y7Sro.js +0 -3037
  45. package/dist/index-DlS9Lybj.js +0 -80691
@@ -0,0 +1,1290 @@
1
+ import { jsxs as u, Fragment as ft, jsx as r } from "react/jsx-runtime";
2
+ import { c as H } from "react/compiler-runtime";
3
+ import { useTheme as er, alpha as Sr, CircularProgress as Je, Stack as oe, Typography as V, Alert as Ct, Box as U, Skeleton as ne, FormControl as sr, InputLabel as Pr, Select as or, MenuItem as gt, Chip as cr, FormHelperText as Qt, Button as Q, Grid as le, StatCard as Zt, DataGrid as dr, ListingTable as j, TablePagination as xr, Form as se, TextField as Xt, DialogContent as vr, DialogTitle as Tr, DialogActions as wr, Dialog as _r, Card as ht, CardContent as mt, Divider as kr, Collapse as pt } from "@wso2/oxygen-ui";
4
+ import { ChevronRight as Br, Clock as ur, X as Ir, Check as Dr, FileText as Ar, Logs as Nr, Wrench as bt, XCircle as Kt, CheckCircle as yt, TrendingUp as Lr, Rocket as ir, Circle as hr, Plus as Rr, Settings as mr } from "@wso2/oxygen-ui-icons-react";
5
+ import { L as zr, M as Ur, H as Fr, D as tr, O as Mr, m as rr, Q as Wr, i as pr, R as jr, j as nr, h as Er, B as Vr, g as Or, n as ar, I as qr, r as fr, S as Gr, U as $r, q as Hr, V as Zr, t as re, W as Xr, P as Yr } from "./index-B_Z0MwXk.js";
6
+ import "@tanstack/react-query";
7
+ import { useState as ee, useMemo as Ye, useCallback as Yt, useEffect as Jr } from "react";
8
+ import { useParams as St, useSearchParams as gr, Link as Qr, generatePath as Kr } from "react-router-dom";
9
+ import { f as en } from "./formatDistanceToNow-TErllcH8.js";
10
+ import { o as br, s as G, u as tn, _ as rn, n as nn, a as an } from "./schemas-DFScWdSL.js";
11
+ const ln = (t) => {
12
+ switch (t.status) {
13
+ case "Succeeded":
14
+ return /* @__PURE__ */ r(Dr, { size: 16 });
15
+ case "Failed":
16
+ return /* @__PURE__ */ r(Ir, { size: 16 });
17
+ case "Running":
18
+ return /* @__PURE__ */ r(Je, { size: 16, color: "inherit" });
19
+ default:
20
+ return /* @__PURE__ */ r(ur, { size: 16 });
21
+ }
22
+ }, sn = (t) => {
23
+ switch (t.type) {
24
+ case "Completed":
25
+ return "Completed";
26
+ case "Succeeded":
27
+ return "Succeeded";
28
+ case "Running":
29
+ return "Running";
30
+ case "Pending":
31
+ return "Pending";
32
+ case "Failed":
33
+ return "Failed";
34
+ default:
35
+ return t.type;
36
+ }
37
+ };
38
+ function on(t) {
39
+ const e = H(25), {
40
+ step: a
41
+ } = t, l = er();
42
+ let i;
43
+ e[0] !== a.status || e[1] !== l.palette.error || e[2] !== l.palette.primary || e[3] !== l.palette.success || e[4] !== l.palette.warning ? (i = () => a.status === "Running" ? l.palette.warning.main : a.status === "Succeeded" ? l.palette.success.main : a.status === "Failed" ? l.palette.error.main : l.palette.primary.main, e[0] = a.status, e[1] = l.palette.error, e[2] = l.palette.primary, e[3] = l.palette.success, e[4] = l.palette.warning, e[5] = i) : i = e[5];
44
+ const d = i;
45
+ let c;
46
+ e[6] !== d ? (c = Sr(d(), 0.1), e[6] = d, e[7] = c) : c = e[7];
47
+ let m;
48
+ e[8] !== c ? (m = {
49
+ backgroundColor: c,
50
+ paddingX: 1,
51
+ paddingY: 0.5,
52
+ borderRadius: 1,
53
+ alignItems: "center",
54
+ justifyContent: "flex-start"
55
+ }, e[8] = c, e[9] = m) : m = e[9];
56
+ let h;
57
+ e[10] !== d ? (h = d(), e[10] = d, e[11] = h) : h = e[11];
58
+ let I;
59
+ e[12] !== a ? (I = ln(a), e[12] = a, e[13] = I) : I = e[13];
60
+ let S;
61
+ e[14] !== h || e[15] !== I ? (S = /* @__PURE__ */ r(oe, { color: h, children: I }), e[14] = h, e[15] = I, e[16] = S) : S = e[16];
62
+ let b;
63
+ e[17] !== a ? (b = sn(a), e[17] = a, e[18] = b) : b = e[18];
64
+ let p;
65
+ e[19] !== b ? (p = /* @__PURE__ */ r(V, { variant: "body1", children: b }), e[19] = b, e[20] = p) : p = e[20];
66
+ let f;
67
+ return e[21] !== m || e[22] !== S || e[23] !== p ? (f = /* @__PURE__ */ u(oe, { direction: "row", gap: 1, sx: m, children: [
68
+ S,
69
+ p
70
+ ] }), e[21] = m, e[22] = S, e[23] = p, e[24] = f) : f = e[24], f;
71
+ }
72
+ function cn(t) {
73
+ const e = H(4), {
74
+ build: a
75
+ } = t;
76
+ let l;
77
+ e[0] !== a.steps ? (l = a.steps?.map((d, c) => /* @__PURE__ */ u(ft, { children: [
78
+ /* @__PURE__ */ r(on, { step: d }, `${d.type}-${c}`),
79
+ c < (a.steps?.length ?? 0) - 1 && /* @__PURE__ */ r(Br, { size: 16 })
80
+ ] })), e[0] = a.steps, e[1] = l) : l = e[1];
81
+ let i;
82
+ return e[2] !== l ? (i = /* @__PURE__ */ r(oe, { spacing: 1, direction: "row", alignItems: "center", children: l }), e[2] = l, e[3] = i) : i = e[3], i;
83
+ }
84
+ const dn = () => {
85
+ const t = H(1);
86
+ let e;
87
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 1, children: [
88
+ /* @__PURE__ */ r(ne, { variant: "rounded", height: 24, width: 200 }),
89
+ /* @__PURE__ */ r(ne, { variant: "rounded", height: 32, width: "100%" }),
90
+ /* @__PURE__ */ r(ne, { variant: "rounded", height: 50, width: "100%" })
91
+ ] }), t[0] = e) : e = t[0], e;
92
+ };
93
+ function un(t) {
94
+ const e = H(49), {
95
+ buildName: a,
96
+ orgName: l,
97
+ projName: i,
98
+ agentName: d,
99
+ onClose: c,
100
+ onFullscreenChange: m
101
+ } = t, [h, I] = ee(!1);
102
+ let S;
103
+ e[0] !== h || e[1] !== m ? (S = () => {
104
+ const g = !h;
105
+ I(g), m?.(g);
106
+ }, e[0] = h, e[1] = m, e[2] = S) : S = e[2];
107
+ const b = S;
108
+ let p;
109
+ e[3] !== d || e[4] !== a || e[5] !== l || e[6] !== i ? (p = {
110
+ orgName: l,
111
+ projName: i,
112
+ agentName: d,
113
+ buildName: a
114
+ }, e[3] = d, e[4] = a, e[5] = l, e[6] = i, e[7] = p) : p = e[7];
115
+ const {
116
+ data: f,
117
+ isLoading: w,
118
+ error: R
119
+ } = zr(p);
120
+ let _;
121
+ e[8] !== d || e[9] !== a || e[10] !== l || e[11] !== i ? (_ = {
122
+ orgName: l,
123
+ projName: i,
124
+ agentName: d,
125
+ buildName: a
126
+ }, e[8] = d, e[9] = a, e[10] = l, e[11] = i, e[12] = _) : _ = e[12];
127
+ const {
128
+ data: D,
129
+ error: P,
130
+ isLoading: C
131
+ } = Ur(_, f?.status);
132
+ let v;
133
+ e[13] !== D ? (v = D ? [...D].reverse() : [], e[13] = D, e[14] = v) : v = e[14];
134
+ const k = v;
135
+ let F;
136
+ e[15] !== f?.status || e[16] !== P ? (F = P ? {
137
+ title: "Unable to Load Logs",
138
+ subtitle: "There was an error retrieving the logs. Please try refreshing. If the issue persists, contact support."
139
+ } : f?.status === "Running" || f?.status === "Pending" ? {
140
+ title: "Logs Being Generated",
141
+ subtitle: "Build is in progress. Logs will appear shortly. Try refreshing in a few moments."
142
+ } : f?.status === "Failed" ? {
143
+ title: "Unable to Retrieve Logs",
144
+ subtitle: "The build logs could not be loaded. Please try refreshing or check back later."
145
+ } : {
146
+ title: "Logs Not Loaded",
147
+ subtitle: "Build logs are not currently available. Please try refreshing the page. If the issue persists, there may be a temporary system issue."
148
+ }, e[15] = f?.status, e[16] = P, e[17] = F) : F = e[17];
149
+ const A = F;
150
+ let N;
151
+ e[18] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ r(Ar, { size: 64 }), e[18] = N) : N = e[18];
152
+ let z;
153
+ e[19] !== A.subtitle || e[20] !== A.title ? (z = {
154
+ title: A.title,
155
+ description: A.subtitle,
156
+ illustration: N
157
+ }, e[19] = A.subtitle, e[20] = A.title, e[21] = z) : z = e[21];
158
+ const T = z;
159
+ let s;
160
+ e[22] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ r(Nr, { size: 24 }), e[22] = s) : s = e[22];
161
+ let n;
162
+ e[23] !== b || e[24] !== h || e[25] !== c ? (n = /* @__PURE__ */ r(tr, { icon: s, title: "Build Details", onClose: c, isFullscreen: h, onToggleFullscreen: b }), e[23] = b, e[24] = h, e[25] = c, e[26] = n) : n = e[26];
163
+ let x;
164
+ e[27] !== f ? (x = f?.startedAt && /* @__PURE__ */ u(oe, { direction: "row", gap: 1, alignItems: "center", children: [
165
+ /* @__PURE__ */ r(ur, { size: 16 }),
166
+ /* @__PURE__ */ u(V, { variant: "body2", color: "text.secondary", children: [
167
+ "Triggered ",
168
+ en(new Date(f.startedAt), {
169
+ addSuffix: !0
170
+ })
171
+ ] })
172
+ ] }), e[27] = f, e[28] = x) : x = e[28];
173
+ let o;
174
+ e[29] !== R ? (o = !!R && /* @__PURE__ */ r(Ct, { severity: "error", children: Fr(R) }), e[29] = R, e[30] = o) : o = e[30];
175
+ let M;
176
+ e[31] !== w ? (M = w && /* @__PURE__ */ r(dn, {}), e[31] = w, e[32] = M) : M = e[32];
177
+ let E;
178
+ e[33] !== f ? (E = f && /* @__PURE__ */ r(cn, { build: f }), e[33] = f, e[34] = E) : E = e[34];
179
+ let W;
180
+ e[35] !== P || e[36] !== C || e[37] !== T || e[38] !== k ? (W = /* @__PURE__ */ r(Mr, { logs: k, isLoading: C, error: P, showSearch: !1, showTimestamp: !1, showLogLevel: !1, maxHeight: "calc(100vh - 172px)", emptyState: T }), e[35] = P, e[36] = C, e[37] = T, e[38] = k, e[39] = W) : W = e[39];
181
+ let L;
182
+ e[40] !== x || e[41] !== o || e[42] !== M || e[43] !== E || e[44] !== W ? (L = /* @__PURE__ */ r(rr, { children: /* @__PURE__ */ u(oe, { direction: "column", gap: 2, height: "calc(100vh - 72px)", children: [
183
+ x,
184
+ o,
185
+ M,
186
+ E,
187
+ W
188
+ ] }) }), e[40] = x, e[41] = o, e[42] = M, e[43] = E, e[44] = W, e[45] = L) : L = e[45];
189
+ let q;
190
+ return e[46] !== L || e[47] !== n ? (q = /* @__PURE__ */ u(oe, { direction: "column", height: "100%", children: [
191
+ n,
192
+ L
193
+ ] }), e[46] = L, e[47] = n, e[48] = q) : q = e[48], q;
194
+ }
195
+ function hn(t) {
196
+ if (!t) return null;
197
+ const e = t.match(/github\.com\/([^/]+)\/([^/.]+)/);
198
+ if (e)
199
+ return {
200
+ owner: e[1],
201
+ repo: e[2]
202
+ };
203
+ const a = t.match(/github\.com:([^/]+)\/([^/.]+)/);
204
+ return a ? {
205
+ owner: a[1],
206
+ repo: a[2]
207
+ } : null;
208
+ }
209
+ function mn({
210
+ onClose: t,
211
+ orgName: e,
212
+ projName: a,
213
+ agentName: l
214
+ }) {
215
+ const [i, d] = ee(""), {
216
+ mutate: c,
217
+ isPending: m
218
+ } = Wr(), {
219
+ data: h,
220
+ isLoading: I
221
+ } = pr({
222
+ orgName: e,
223
+ projName: a,
224
+ agentName: l
225
+ }), S = h?.provisioning?.repository?.branch || "", b = Ye(() => {
226
+ const C = h?.provisioning?.repository?.url;
227
+ return C ? hn(C) : null;
228
+ }, [h?.provisioning?.repository?.url]), p = h?.provisioning?.repository?.secretRef, {
229
+ data: f,
230
+ isLoading: w,
231
+ isError: R
232
+ } = jr({
233
+ owner: b?.owner || "",
234
+ repo: b?.repo || "",
235
+ branch: S || void 0,
236
+ // Include orgName and secretRef for private repo support
237
+ ...p ? {
238
+ orgName: e,
239
+ secretRef: p
240
+ } : {}
241
+ }, {
242
+ limit: 50
243
+ }, !!b && !!S), _ = (C) => {
244
+ d(C.target.value);
245
+ }, D = async () => {
246
+ try {
247
+ c({
248
+ params: {
249
+ orgName: e,
250
+ projName: a,
251
+ agentName: l
252
+ },
253
+ query: {
254
+ commitId: R ? "" : i || ""
255
+ }
256
+ }, {
257
+ onSuccess: () => {
258
+ t();
259
+ }
260
+ });
261
+ } catch {
262
+ }
263
+ }, P = f?.commits || [];
264
+ return /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", height: "100%", children: [
265
+ /* @__PURE__ */ r(tr, { icon: /* @__PURE__ */ r(bt, { size: 24 }), title: "Trigger Build", onClose: t }),
266
+ /* @__PURE__ */ u(rr, { children: [
267
+ /* @__PURE__ */ u(V, { variant: "body2", color: "text.secondary", children: [
268
+ "Build ",
269
+ h?.displayName || l,
270
+ " from a specific commit."
271
+ ] }),
272
+ /* @__PURE__ */ r(U, { display: "flex", flexDirection: "column", gap: 2, children: R ? /* @__PURE__ */ r(Ct, { severity: "warning", children: "Failed to load commits. The build will use the latest commit from the branch." }) : /* @__PURE__ */ u(sr, { fullWidth: !0, size: "small", children: [
273
+ /* @__PURE__ */ r(Pr, { id: "commit-select-label", shrink: !0, children: "Commit" }),
274
+ /* @__PURE__ */ r(or, { notched: !0, displayEmpty: !0, labelId: "commit-select-label", id: "commit-select", value: i || "", label: "Commit", onChange: _, disabled: w || !S, renderValue: (C) => {
275
+ if (!C)
276
+ return /* @__PURE__ */ r(V, { variant: "body2", color: "text.secondary", children: "Select a commit" });
277
+ const v = P.find((k) => k.sha === C);
278
+ return v ? /* @__PURE__ */ r(U, { display: "flex", alignItems: "center", gap: 1, children: /* @__PURE__ */ r(V, { variant: "body2", noWrap: !0, children: v.message?.split(`
279
+ `)[0] || v.shortSha }) }) : C;
280
+ }, endAdornment: w ? /* @__PURE__ */ r(Je, { size: 20, sx: {
281
+ mr: 2
282
+ } }) : void 0, MenuProps: {
283
+ PaperProps: {
284
+ style: {
285
+ maxHeight: 300
286
+ }
287
+ }
288
+ }, children: P.map((C, v) => /* @__PURE__ */ r(gt, { value: C.sha, children: /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", width: "100%", children: [
289
+ /* @__PURE__ */ u(U, { display: "flex", alignItems: "center", gap: 1, children: [
290
+ /* @__PURE__ */ r(V, { variant: "body2", noWrap: !0, sx: {
291
+ maxWidth: 350
292
+ }, children: C.message?.split(`
293
+ `)[0] || "" }),
294
+ v === 0 && /* @__PURE__ */ r(cr, { label: "Latest", size: "small", color: "primary" })
295
+ ] }),
296
+ /* @__PURE__ */ r(V, { variant: "caption", color: "text.secondary", children: C.shortSha })
297
+ ] }) }, C.sha)) }),
298
+ /* @__PURE__ */ r(Qt, { children: "Select the commit to build" })
299
+ ] }) }),
300
+ /* @__PURE__ */ u(U, { display: "flex", gap: 1, justifyContent: "flex-end", width: "100%", children: [
301
+ /* @__PURE__ */ r(Q, { variant: "outlined", color: "primary", onClick: t, children: "Cancel" }),
302
+ /* @__PURE__ */ r(Q, { variant: "contained", color: "primary", onClick: D, startIcon: /* @__PURE__ */ r(bt, { size: 16 }), disabled: m || I || !S, children: "Trigger Build" })
303
+ ] })
304
+ ] })
305
+ ] });
306
+ }
307
+ const pn = (t) => {
308
+ switch (t) {
309
+ case "Completed":
310
+ case "Succeeded":
311
+ return "success";
312
+ // greenish for success
313
+ case "Pending":
314
+ return "warning";
315
+ case "Running":
316
+ return "warning";
317
+ case "Failed":
318
+ return "error";
319
+ // red for failed
320
+ default:
321
+ return "info";
322
+ }
323
+ }, fn = (t) => isNaN(t) ? "warning" : t >= 0.9 ? "success" : t >= 0.5 ? "warning" : "error";
324
+ function gn() {
325
+ const t = H(3);
326
+ let e;
327
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ r(le, { size: {
328
+ xs: 12,
329
+ sm: 6,
330
+ md: 4
331
+ }, children: /* @__PURE__ */ r(ne, { variant: "rectangular", height: 120 }) }), t[0] = e) : e = t[0];
332
+ let a;
333
+ t[1] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ r(le, { size: {
334
+ xs: 12,
335
+ sm: 6,
336
+ md: 4
337
+ }, children: /* @__PURE__ */ r(ne, { variant: "rectangular", height: 120 }) }), t[1] = a) : a = t[1];
338
+ let l;
339
+ return t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ u(le, { container: !0, spacing: 3, children: [
340
+ e,
341
+ a,
342
+ /* @__PURE__ */ r(le, { size: {
343
+ xs: 12,
344
+ sm: 6,
345
+ md: 4
346
+ }, children: /* @__PURE__ */ r(ne, { variant: "rectangular", height: 120 }) })
347
+ ] }), t[2] = l) : l = t[2], l;
348
+ }
349
+ const bn = () => {
350
+ const t = H(34), {
351
+ agentId: e,
352
+ projectId: a,
353
+ orgId: l
354
+ } = St();
355
+ let i;
356
+ t[0] !== e || t[1] !== l || t[2] !== a ? (i = {
357
+ orgName: l,
358
+ projName: a,
359
+ agentName: e
360
+ }, t[0] = e, t[1] = l, t[2] = a, t[3] = i) : i = t[3];
361
+ const {
362
+ data: d,
363
+ isLoading: c
364
+ } = nr(i), m = d?.builds[0], h = m?.status ?? "", I = d?.builds.filter(yn).length ?? 0, S = d?.builds.filter(Cn).length ?? 0;
365
+ if (c) {
366
+ let o;
367
+ return t[4] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ r(gn, {}), t[4] = o) : o = t[4], o;
368
+ }
369
+ const b = d?.builds.length ?? 0, p = I / Math.max(1, I + S), f = h === "Pending" || h === "Running";
370
+ let w;
371
+ t[5] !== f || t[6] !== m || t[7] !== h ? (w = m ? f ? /* @__PURE__ */ r(Je, { size: 24 }) : h === "Failed" ? /* @__PURE__ */ r(Kt, { size: 24 }) : /* @__PURE__ */ r(yt, { size: 24 }) : /* @__PURE__ */ r(Kt, { size: 24 }), t[5] = f, t[6] = m, t[7] = h, t[8] = w) : w = t[8];
372
+ const R = w;
373
+ let _;
374
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
375
+ xs: 12,
376
+ sm: 6,
377
+ md: 4
378
+ }, t[9] = _) : _ = t[9];
379
+ const D = m?.status ?? "No builds";
380
+ let P;
381
+ t[10] !== m || t[11] !== h ? (P = m ? pn(h) : "error", t[10] = m, t[11] = h, t[12] = P) : P = t[12];
382
+ let C;
383
+ t[13] !== R || t[14] !== D || t[15] !== P ? (C = /* @__PURE__ */ r(le, { size: _, children: /* @__PURE__ */ r(Zt, { value: D, label: "Latest Build Status", icon: R, iconColor: P }) }), t[13] = R, t[14] = D, t[15] = P, t[16] = C) : C = t[16];
384
+ let v;
385
+ t[17] === Symbol.for("react.memo_cache_sentinel") ? (v = {
386
+ xs: 12,
387
+ sm: 6,
388
+ md: 4
389
+ }, t[17] = v) : v = t[17];
390
+ const k = `${(p * 100).toFixed(1)}%`;
391
+ let F;
392
+ t[18] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ r(Lr, { size: 24 }), t[18] = F) : F = t[18];
393
+ let A;
394
+ t[19] !== p ? (A = fn(p), t[19] = p, t[20] = A) : A = t[20];
395
+ let N;
396
+ t[21] !== k || t[22] !== A ? (N = /* @__PURE__ */ r(le, { size: v, children: /* @__PURE__ */ r(Zt, { value: k, label: "Build Success Rate", icon: F, iconColor: A }) }), t[21] = k, t[22] = A, t[23] = N) : N = t[23];
397
+ let z;
398
+ t[24] === Symbol.for("react.memo_cache_sentinel") ? (z = {
399
+ xs: 12,
400
+ sm: 6,
401
+ md: 4
402
+ }, t[24] = z) : z = t[24];
403
+ let T;
404
+ t[25] !== b ? (T = b.toString(), t[25] = b, t[26] = T) : T = t[26];
405
+ let s;
406
+ t[27] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ r(yt, { size: 24 }), t[27] = s) : s = t[27];
407
+ let n;
408
+ t[28] !== T ? (n = /* @__PURE__ */ r(le, { size: z, children: /* @__PURE__ */ r(Zt, { value: T, label: "Total Builds", icon: s, iconColor: "primary" }) }), t[28] = T, t[29] = n) : n = t[29];
409
+ let x;
410
+ return t[30] !== N || t[31] !== n || t[32] !== C ? (x = /* @__PURE__ */ u(le, { container: !0, spacing: 3, children: [
411
+ C,
412
+ N,
413
+ n
414
+ ] }), t[30] = N, t[31] = n, t[32] = C, t[33] = x) : x = t[33], x;
415
+ };
416
+ function yn(t) {
417
+ return t.status === "Completed" || t.status === "Succeeded";
418
+ }
419
+ function Cn(t) {
420
+ return t.status === "Failed";
421
+ }
422
+ const {
423
+ DataGrid: Sn
424
+ } = dr, Pn = (t) => {
425
+ switch (t.color) {
426
+ case "success":
427
+ return /* @__PURE__ */ r(yt, { size: 16 });
428
+ case "warning":
429
+ return /* @__PURE__ */ r(Je, { size: 14, color: "warning" });
430
+ case "error":
431
+ return /* @__PURE__ */ r(Kt, { size: 16 });
432
+ default:
433
+ return /* @__PURE__ */ r(hr, { size: 16 });
434
+ }
435
+ }, xn = (t, e) => /* @__PURE__ */ r(U, { display: "flex", alignItems: "center", gap: e?.spacing(1) || 1, children: /* @__PURE__ */ r(cr, { variant: "outlined", icon: Pn(t), label: t.label, color: t.color, size: "small" }) });
436
+ function vn() {
437
+ const t = er(), [e, a] = gr(), l = e.get("selectedBuild"), i = e.get("panel"), {
438
+ orgId: d,
439
+ projectId: c,
440
+ agentId: m
441
+ } = St(), [h, I] = ee(!1), [S, b] = ee("startedAt"), [p, f] = ee("desc"), [w, R] = ee(0), [_, D] = ee(5), {
442
+ data: P,
443
+ isLoading: C
444
+ } = nr({
445
+ orgName: d,
446
+ projName: c,
447
+ agentName: m
448
+ }), v = Ye(() => P?.builds.sort((s, n) => new Date(n.startedAt).getTime() - new Date(s.startedAt).getTime()), [P]), k = Ye(() => v?.map((s) => ({
449
+ id: s.buildName,
450
+ actions: s.buildName,
451
+ branch: s.buildParameters.branch,
452
+ commit: s.buildParameters.commitId,
453
+ startedAt: s.startedAt,
454
+ status: s.status,
455
+ title: s.buildName,
456
+ imageId: s.imageId ?? "busybox"
457
+ })) ?? [], [v]), F = Yt((s, n) => {
458
+ b(s), f(n);
459
+ }, []), A = Ye(() => [...k].sort((s, n) => {
460
+ const x = s[S], o = n[S], M = String(x).localeCompare(String(o));
461
+ return p === "asc" ? M : -M;
462
+ }), [k, S, p]), N = Ye(() => A.slice(w * _, w * _ + _), [A, w, _]), z = Yt((s, n) => {
463
+ const x = new URLSearchParams(e);
464
+ x.set("selectedBuild", s), x.set("panel", n), a(x);
465
+ }, [e, a]), T = Yt(() => {
466
+ const s = new URLSearchParams(e);
467
+ s.delete("selectedBuild"), s.delete("panel"), a(s);
468
+ }, [e, a]);
469
+ return /* @__PURE__ */ u(ft, { children: [
470
+ /* @__PURE__ */ r(j.Provider, { sortField: S, sortDirection: p, onSortChange: F, page: w, rowsPerPage: _, totalCount: k.length, onPageChange: R, onRowsPerPageChange: (s) => {
471
+ D(s), R(0);
472
+ }, children: /* @__PURE__ */ r(j.Container, { children: C ? /* @__PURE__ */ r(Sn, { rows: [], columns: [{
473
+ field: "branch",
474
+ headerName: "Branch",
475
+ flex: 1
476
+ }, {
477
+ field: "title",
478
+ headerName: "Build Name",
479
+ flex: 1
480
+ }, {
481
+ field: "startedAt",
482
+ headerName: "Started At",
483
+ flex: 1
484
+ }, {
485
+ field: "status",
486
+ headerName: "Status",
487
+ flex: 1
488
+ }, {
489
+ field: "actions",
490
+ headerName: "",
491
+ flex: 1
492
+ }], loading: !0, hideFooter: !0 }) : k.length > 0 ? /* @__PURE__ */ u(ft, { children: [
493
+ /* @__PURE__ */ u(j, { children: [
494
+ /* @__PURE__ */ r(j.Head, { children: /* @__PURE__ */ u(j.Row, { children: [
495
+ /* @__PURE__ */ r(j.Cell, { width: "15%", children: /* @__PURE__ */ r(j.SortLabel, { field: "branch", children: "Branch" }) }),
496
+ /* @__PURE__ */ r(j.Cell, { width: "15%", children: /* @__PURE__ */ r(j.SortLabel, { field: "title", children: "Build Name" }) }),
497
+ /* @__PURE__ */ r(j.Cell, { width: "15%", children: /* @__PURE__ */ r(j.SortLabel, { field: "startedAt", children: "Started At" }) }),
498
+ /* @__PURE__ */ r(j.Cell, { width: "12%", children: /* @__PURE__ */ r(j.SortLabel, { field: "status", children: "Status" }) }),
499
+ /* @__PURE__ */ r(j.Cell, { width: "10%", align: "right" })
500
+ ] }) }),
501
+ /* @__PURE__ */ r(j.Body, { children: N.map((s) => /* @__PURE__ */ u(j.Row, { hover: !0, children: [
502
+ /* @__PURE__ */ r(j.Cell, { children: /* @__PURE__ */ r(V, { noWrap: !0, variant: "body2", children: `${s.branch} : ${s.commit.substring(0, 7)}` }) }),
503
+ /* @__PURE__ */ r(j.Cell, { children: /* @__PURE__ */ r(V, { noWrap: !0, variant: "body2", color: "text.primary", children: s.title }) }),
504
+ /* @__PURE__ */ r(j.Cell, { children: /* @__PURE__ */ r(V, { noWrap: !0, variant: "body2", color: "text.secondary", children: Er(new Date(s.startedAt), "dd/MM/yyyy HH:mm:ss") }) }),
505
+ /* @__PURE__ */ r(j.Cell, { children: xn({
506
+ color: Vr[s.status],
507
+ label: s.status
508
+ }, t) }),
509
+ /* @__PURE__ */ r(j.Cell, { align: "right", children: /* @__PURE__ */ u(U, { display: "flex", justifyContent: "flex-end", gap: 1, children: [
510
+ /* @__PURE__ */ r(Q, { variant: "text", color: "primary", onClick: () => z(s.title, "logs"), size: "small", children: "Details" }),
511
+ /* @__PURE__ */ r(Q, { variant: "outlined", color: "primary", disabled: s.status === "Pending" || s.status === "Running" || s.status === "Failed", component: Qr, to: `${Kr(Or.children.org.children.projects.children.agents.children.deployment.path, {
512
+ orgId: d,
513
+ projectId: c,
514
+ agentId: m
515
+ })}?deployPanel=open&selectedBuild=${s.id}`, size: "small", startIcon: /* @__PURE__ */ r(ir, { size: 16 }), children: s.status === "Running" || s.status === "Pending" ? "Building" : "Deploy" })
516
+ ] }) })
517
+ ] }, s.id)) })
518
+ ] }),
519
+ /* @__PURE__ */ r(xr, { rowsPerPageOptions: [5, 10, 25], component: "div", count: k.length, rowsPerPage: _, page: w, onPageChange: (s, n) => R(n), onRowsPerPageChange: (s) => {
520
+ D(parseInt(s.target.value, 10)), R(0);
521
+ } })
522
+ ] }) : /* @__PURE__ */ r(j.EmptyState, { illustration: /* @__PURE__ */ r(ir, { size: 64 }), title: "No builds yet", description: "Trigger a build to see it listed here" }) }) }),
523
+ /* @__PURE__ */ r(ar, { open: !!l, onClose: T, fullscreen: h, children: i === "logs" && l && /* @__PURE__ */ r(un, { onClose: T, onFullscreenChange: I, orgName: d || "", projName: c || "", agentName: m || "", buildName: l }) })
524
+ ] });
525
+ }
526
+ function Tn() {
527
+ const t = H(2);
528
+ let e;
529
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ u(U, { display: "flex", justifyContent: "space-between", gap: 4, children: [
530
+ /* @__PURE__ */ r(ne, { variant: "rounded", width: "100%", height: 120 }),
531
+ /* @__PURE__ */ r(ne, { variant: "rounded", width: "100%", height: 120 }),
532
+ /* @__PURE__ */ r(ne, { variant: "rounded", width: "100%", height: 120 })
533
+ ] }), t[0] = e) : e = t[0];
534
+ let a;
535
+ return t[1] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 4, pt: 1, children: [
536
+ e,
537
+ /* @__PURE__ */ r(dr.DataGrid, { rows: [], columns: [{
538
+ field: "buildNumber",
539
+ headerName: "Build",
540
+ flex: 0.5
541
+ }, {
542
+ field: "status",
543
+ headerName: "Status",
544
+ flex: 0.8
545
+ }, {
546
+ field: "branch",
547
+ headerName: "Branch",
548
+ flex: 1
549
+ }, {
550
+ field: "commit",
551
+ headerName: "Commit",
552
+ flex: 1
553
+ }, {
554
+ field: "startedAt",
555
+ headerName: "Started",
556
+ flex: 1
557
+ }, {
558
+ field: "duration",
559
+ headerName: "Duration",
560
+ flex: 0.8
561
+ }, {
562
+ field: "actions",
563
+ headerName: "Actions",
564
+ flex: 0.8
565
+ }], loading: !0, hideFooter: !0 })
566
+ ] }), t[1] = a) : a = t[1], a;
567
+ }
568
+ const wn = () => {
569
+ const t = H(6), {
570
+ agentId: e,
571
+ projectId: a,
572
+ orgId: l
573
+ } = St();
574
+ let i;
575
+ t[0] !== e || t[1] !== l || t[2] !== a ? (i = {
576
+ orgName: l,
577
+ projName: a,
578
+ agentName: e
579
+ }, t[0] = e, t[1] = l, t[2] = a, t[3] = i) : i = t[3];
580
+ const {
581
+ isLoading: d
582
+ } = nr(i);
583
+ if (d) {
584
+ let m;
585
+ return t[4] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ r(Tn, {}), t[4] = m) : m = t[4], m;
586
+ }
587
+ let c;
588
+ return t[5] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ r(qr, { children: /* @__PURE__ */ u(oe, { gap: 4, flexDirection: "column", children: [
589
+ /* @__PURE__ */ r(bn, {}),
590
+ /* @__PURE__ */ r(vn, {})
591
+ ] }) }), t[5] = c) : c = t[5], c;
592
+ }, _n = br({
593
+ name: G().trim().min(1, "Name is required").min(2, "Name must be at least 2 characters").max(25, "Name must be at most 25 characters").refine((t) => /^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(t) || t.length === 1, {
594
+ message: "Name must start and end with alphanumeric characters"
595
+ }),
596
+ username: G().trim().min(1, "Username is required"),
597
+ password: G().min(1, "Password/PAT is required")
598
+ }), Jt = {
599
+ name: "",
600
+ username: "",
601
+ password: ""
602
+ }, kn = (t) => {
603
+ const e = H(58), {
604
+ open: a,
605
+ onClose: l,
606
+ onSecretCreated: i,
607
+ orgId: d
608
+ } = t, [c, m] = ee(Jt), {
609
+ errors: h,
610
+ validateForm: I,
611
+ clearErrors: S,
612
+ clearFieldError: b
613
+ } = fr(_n), {
614
+ mutate: p,
615
+ isPending: f,
616
+ error: w,
617
+ reset: R
618
+ } = Gr();
619
+ let _;
620
+ e[0] !== b ? (_ = ($, de) => {
621
+ m((ae) => ({
622
+ ...ae,
623
+ [$]: de
624
+ })), b($);
625
+ }, e[0] = b, e[1] = _) : _ = e[1];
626
+ const D = _;
627
+ let P;
628
+ e[2] !== p || e[3] !== c || e[4] !== i || e[5] !== d || e[6] !== I ? (P = () => {
629
+ I(c) && p({
630
+ params: {
631
+ orgName: d
632
+ },
633
+ body: {
634
+ name: c.name.trim(),
635
+ type: "basic-auth",
636
+ credentials: {
637
+ username: c.username.trim(),
638
+ password: c.password
639
+ }
640
+ }
641
+ }, {
642
+ onSuccess: () => {
643
+ i(c.name.trim()), m(Jt);
644
+ }
645
+ });
646
+ }, e[2] = p, e[3] = c, e[4] = i, e[5] = d, e[6] = I, e[7] = P) : P = e[7];
647
+ const C = P;
648
+ let v;
649
+ e[8] !== S || e[9] !== l || e[10] !== R ? (v = () => {
650
+ m(Jt), S(), R(), l();
651
+ }, e[8] = S, e[9] = l, e[10] = R, e[11] = v) : v = e[11];
652
+ const k = v;
653
+ let F;
654
+ e[12] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ r(Tr, { children: "Create Git Secret" }), e[12] = F) : F = e[12];
655
+ let A, N;
656
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (A = {
657
+ mt: 1
658
+ }, N = /* @__PURE__ */ r(V, { variant: "body2", color: "text.secondary", children: "Create a secret to authenticate with private Git repositories. This secret will be available for all projects in your organization." }), e[13] = A, e[14] = N) : (A = e[13], N = e[14]);
659
+ let z;
660
+ e[15] !== w ? (z = !!w && /* @__PURE__ */ r(Ct, { severity: "error", children: "Failed to create git secret. Please try again." }), e[15] = w, e[16] = z) : z = e[16];
661
+ let T;
662
+ e[17] !== D ? (T = ($) => D("name", $.target.value), e[17] = D, e[18] = T) : T = e[18];
663
+ const s = !!h.name, n = h.name || "A unique name for this secret";
664
+ let x;
665
+ e[19] !== c.name || e[20] !== n || e[21] !== T || e[22] !== s ? (x = /* @__PURE__ */ r(se.ElementWrapper, { label: "Secret Name", name: "name", children: /* @__PURE__ */ r(Xt, { id: "name", placeholder: "e.g., my-github-pat", value: c.name, onChange: T, error: s, helperText: n, fullWidth: !0 }) }), e[19] = c.name, e[20] = n, e[21] = T, e[22] = s, e[23] = x) : x = e[23];
666
+ let o;
667
+ e[24] !== D ? (o = ($) => D("username", $.target.value), e[24] = D, e[25] = o) : o = e[25];
668
+ const M = !!h.username, E = h.username || "Your Git username";
669
+ let W;
670
+ e[26] !== c.username || e[27] !== o || e[28] !== M || e[29] !== E ? (W = /* @__PURE__ */ r(se.ElementWrapper, { label: "Username", name: "username", children: /* @__PURE__ */ r(Xt, { id: "username", placeholder: "e.g., your-github-username", value: c.username, onChange: o, error: M, helperText: E, fullWidth: !0 }) }), e[26] = c.username, e[27] = o, e[28] = M, e[29] = E, e[30] = W) : W = e[30];
671
+ let L;
672
+ e[31] !== D ? (L = ($) => D("password", $.target.value), e[31] = D, e[32] = L) : L = e[32];
673
+ const q = !!h.password, g = h.password || "Your personal access token (PAT) with repo access";
674
+ let Z;
675
+ e[33] !== c.password || e[34] !== L || e[35] !== q || e[36] !== g ? (Z = /* @__PURE__ */ r(se.ElementWrapper, { label: "Personal Access Token", name: "password", children: /* @__PURE__ */ r(Xt, { id: "password", placeholder: "ghp_xxxxxxxxxxxx", type: "password", value: c.password, onChange: L, error: q, helperText: g, fullWidth: !0 }) }), e[33] = c.password, e[34] = L, e[35] = q, e[36] = g, e[37] = Z) : Z = e[37];
676
+ let X;
677
+ e[38] !== x || e[39] !== W || e[40] !== Z || e[41] !== z ? (X = /* @__PURE__ */ r(vr, { children: /* @__PURE__ */ u(se.Stack, { spacing: 3, sx: A, children: [
678
+ N,
679
+ z,
680
+ x,
681
+ W,
682
+ Z
683
+ ] }) }), e[38] = x, e[39] = W, e[40] = Z, e[41] = z, e[42] = X) : X = e[42];
684
+ let Y;
685
+ e[43] !== k || e[44] !== f ? (Y = /* @__PURE__ */ r(Q, { onClick: k, disabled: f, children: "Cancel" }), e[43] = k, e[44] = f, e[45] = Y) : Y = e[45];
686
+ const B = f ? "Creating..." : "Create Secret";
687
+ let J;
688
+ e[46] !== C || e[47] !== f || e[48] !== B ? (J = /* @__PURE__ */ r(Q, { variant: "contained", onClick: C, disabled: f, children: B }), e[46] = C, e[47] = f, e[48] = B, e[49] = J) : J = e[49];
689
+ let K;
690
+ e[50] !== Y || e[51] !== J ? (K = /* @__PURE__ */ u(wr, { children: [
691
+ Y,
692
+ J
693
+ ] }), e[50] = Y, e[51] = J, e[52] = K) : K = e[52];
694
+ let te;
695
+ return e[53] !== k || e[54] !== a || e[55] !== X || e[56] !== K ? (te = /* @__PURE__ */ u(_r, { open: a, onClose: k, maxWidth: "sm", fullWidth: !0, children: [
696
+ F,
697
+ X,
698
+ K
699
+ ] }), e[53] = k, e[54] = a, e[55] = X, e[56] = K, e[57] = te) : te = e[57], te;
700
+ }, Bn = (t) => {
701
+ const e = H(37), {
702
+ orgId: a,
703
+ value: l,
704
+ onChange: i,
705
+ error: d,
706
+ disabled: c
707
+ } = t, [m, h] = ee(!1);
708
+ let I;
709
+ e[0] !== a ? (I = {
710
+ orgName: a
711
+ }, e[0] = a, e[1] = I) : I = e[1];
712
+ let S;
713
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (S = {
714
+ limit: 100
715
+ }, e[2] = S) : S = e[2];
716
+ const {
717
+ data: b,
718
+ isLoading: p,
719
+ refetch: f
720
+ } = $r(I, S);
721
+ let w;
722
+ e[3] !== b?.secrets ? (w = b?.secrets || [], e[3] = b?.secrets, e[4] = w) : w = e[4];
723
+ const R = w;
724
+ let _;
725
+ e[5] !== i ? (_ = (L) => {
726
+ const q = L.target.value;
727
+ if (q === "__create_new__") {
728
+ h(!0);
729
+ return;
730
+ }
731
+ i(q || void 0);
732
+ }, e[5] = i, e[6] = _) : _ = e[6];
733
+ const D = _;
734
+ let P;
735
+ e[7] !== i || e[8] !== f ? (P = (L) => {
736
+ i(L), f(), h(!1);
737
+ }, e[7] = i, e[8] = f, e[9] = P) : P = e[9];
738
+ const C = P;
739
+ let v;
740
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ r(V, { variant: "body2", sx: {
741
+ mb: 0.5,
742
+ fontWeight: 500
743
+ }, children: "Git Secret (Optional)" }), e[10] = v) : v = e[10];
744
+ const k = !!d, F = l || "", A = c || p;
745
+ let N;
746
+ e[11] !== p ? (N = p ? /* @__PURE__ */ r(Je, { size: 20, sx: {
747
+ mr: 1
748
+ } }) : void 0, e[11] = p, e[12] = N) : N = e[12];
749
+ let z;
750
+ e[13] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ r(gt, { value: "", children: /* @__PURE__ */ r("em", { children: "Public Repo (None)" }) }), e[13] = z) : z = e[13];
751
+ let T;
752
+ e[14] !== R ? (T = R.map(In), e[14] = R, e[15] = T) : T = e[15];
753
+ let s;
754
+ e[16] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ r(gt, { value: "__create_new__", children: /* @__PURE__ */ r(oe, { direction: "row", spacing: 1, alignItems: "center", children: /* @__PURE__ */ r(Q, { variant: "text", size: "small", startIcon: /* @__PURE__ */ r(Rr, { size: 16 }), sx: {
755
+ textTransform: "none",
756
+ p: 0
757
+ }, children: "Create new git secret" }) }) }), e[16] = s) : s = e[16];
758
+ let n;
759
+ e[17] !== D || e[18] !== N || e[19] !== T || e[20] !== F || e[21] !== A ? (n = /* @__PURE__ */ u(or, { id: "gitSecretRef", value: F, onChange: D, displayEmpty: !0, disabled: A, startAdornment: N, children: [
760
+ z,
761
+ T,
762
+ s
763
+ ] }), e[17] = D, e[18] = N, e[19] = T, e[20] = F, e[21] = A, e[22] = n) : n = e[22];
764
+ let x;
765
+ e[23] !== d ? (x = d ? /* @__PURE__ */ r(Qt, { error: !0, children: d }) : /* @__PURE__ */ r(Qt, { children: "Select a git secret for private repository authentication" }), e[23] = d, e[24] = x) : x = e[24];
766
+ let o;
767
+ e[25] !== n || e[26] !== x || e[27] !== k ? (o = /* @__PURE__ */ u(U, { children: [
768
+ v,
769
+ /* @__PURE__ */ u(sr, { fullWidth: !0, error: k, size: "small", children: [
770
+ n,
771
+ x
772
+ ] })
773
+ ] }), e[25] = n, e[26] = x, e[27] = k, e[28] = o) : o = e[28];
774
+ let M;
775
+ e[29] === Symbol.for("react.memo_cache_sentinel") ? (M = () => h(!1), e[29] = M) : M = e[29];
776
+ let E;
777
+ e[30] !== C || e[31] !== m || e[32] !== a ? (E = /* @__PURE__ */ r(kn, { open: m, onClose: M, onSecretCreated: C, orgId: a }), e[30] = C, e[31] = m, e[32] = a, e[33] = E) : E = e[33];
778
+ let W;
779
+ return e[34] !== o || e[35] !== E ? (W = /* @__PURE__ */ u(ft, { children: [
780
+ o,
781
+ E
782
+ ] }), e[34] = o, e[35] = E, e[36] = W) : W = e[36], W;
783
+ };
784
+ function In(t) {
785
+ return /* @__PURE__ */ r(gt, { value: t.name, children: /* @__PURE__ */ r(V, { children: t.name }) }, t.name);
786
+ }
787
+ const Dn = br({
788
+ repositoryUrl: G().trim().min(1, "Repository URL is required").url("Must be a valid URL"),
789
+ branch: G().trim().min(1, "Branch is required"),
790
+ gitSecretRef: G().optional(),
791
+ appPath: G().trim().min(1, "App path is required").refine((t) => t.startsWith("/"), {
792
+ message: "App path must start with /"
793
+ }).refine((t) => !/\.\./.test(t), {
794
+ message: "Path traversal is not allowed"
795
+ }).refine((t) => /^\/[A-Za-z0-9._\-/]*$/.test(t), {
796
+ message: "App path can only contain letters, numbers, ., _, -, and /"
797
+ }).refine((t) => t === "/" ? !0 : !t.endsWith("/"), {
798
+ message: "App path must be a valid path (use / for root directory)"
799
+ }),
800
+ runCommand: G().trim().optional(),
801
+ language: G().trim().min(1, "Language is required"),
802
+ languageVersion: G().trim().optional(),
803
+ dockerfilePath: G().trim().optional(),
804
+ interfaceType: rn(["DEFAULT", "CUSTOM"]),
805
+ port: tn([nn(), G(), an()]).transform((t) => {
806
+ if (!(t === "" || t === null || t === void 0))
807
+ return typeof t == "string" ? Number(t) : t;
808
+ }).optional(),
809
+ basePath: G().trim().optional(),
810
+ openApiPath: G().trim().optional()
811
+ }).refine((t) => !(t.interfaceType === "CUSTOM" && !t.port), {
812
+ message: "Port is required when using custom interface",
813
+ path: ["port"]
814
+ }).refine((t) => !(t.interfaceType === "CUSTOM" && t.port !== void 0 && (isNaN(t.port) || t.port < 1 || t.port > 65535)), {
815
+ message: "Port must be between 1 and 65535",
816
+ path: ["port"]
817
+ }).refine((t) => !(t.interfaceType === "CUSTOM" && !t.basePath), {
818
+ message: "Base path is required when using custom interface",
819
+ path: ["basePath"]
820
+ }).refine((t) => !(t.interfaceType === "CUSTOM" && !t.openApiPath), {
821
+ message: "OpenAPI spec path is required when using custom interface",
822
+ path: ["openApiPath"]
823
+ }).refine((t) => !(t.language === "python" && !t.runCommand?.trim()), {
824
+ message: "Start Command is required for Python agents",
825
+ path: ["runCommand"]
826
+ }).refine((t) => !(t.language === "python" && !t.languageVersion?.trim()), {
827
+ message: "Python version is required for Python agents",
828
+ path: ["languageVersion"]
829
+ }).refine((t) => !(t.language === "docker" && !t.dockerfilePath?.trim()), {
830
+ message: "Dockerfile path is required for Docker agents",
831
+ path: ["dockerfilePath"]
832
+ }).refine((t) => !(t.language === "docker" && t.dockerfilePath?.trim() && !t.dockerfilePath.startsWith("/")), {
833
+ message: "Dockerfile path must start with /",
834
+ path: ["dockerfilePath"]
835
+ }), An = [{
836
+ label: "Python",
837
+ value: "python"
838
+ }, {
839
+ label: "Ballerina",
840
+ value: "ballerina"
841
+ }, {
842
+ label: "Docker",
843
+ value: "docker"
844
+ }], Nn = [{
845
+ label: "Chat Agent",
846
+ description: "Standard chat interface with /chat endpoint on port 8000",
847
+ value: "DEFAULT"
848
+ }, {
849
+ label: "Custom API Agent",
850
+ description: "Custom HTTP API with user-specified OpenAPI specification and port configuration",
851
+ value: "CUSTOM"
852
+ }];
853
+ function Ln(t) {
854
+ const e = H(200), {
855
+ open: a,
856
+ onClose: l,
857
+ agent: i,
858
+ orgId: d,
859
+ projectId: c
860
+ } = t, m = er(), h = Hr.featureFlags?.enablePrivateRepoSupport === !0, I = !!i.inputInterface?.schema?.path || !!i.inputInterface?.port || !!i.inputInterface?.basePath || i.agentType?.subType === "custom-api", S = i.agentType?.subType === "custom-api" ? "CUSTOM" : i.agentType?.subType === "chat-api" ? "DEFAULT" : I ? "CUSTOM" : "DEFAULT", b = i.provisioning?.repository, p = i.build?.type === "buildpack" ? i.build.buildpack : void 0, f = i.build?.type === "docker" ? i.build.docker : void 0, w = i.inputInterface;
861
+ b?.url, b?.branch, b?.appPath, b?.secretRef, p?.runCommand, p?.language, p?.languageVersion, f?.dockerfilePath, i.build?.type, w?.port, w?.basePath, w?.schema?.path;
862
+ const R = b?.url || "", _ = b?.branch || "", D = b?.appPath ?? "", P = b?.secretRef ?? "", C = p?.runCommand ?? "python main.py", v = p?.language && p.language !== "" ? p?.language : i.build?.type === "docker" ? "docker" : "python", k = p?.languageVersion ?? "3.11", F = f?.dockerfilePath ?? "/Dockerfile", A = w?.port, N = w?.basePath ?? "", z = w?.schema?.path ?? "";
863
+ let T;
864
+ e[0] !== S || e[1] !== R || e[2] !== N || e[3] !== z || e[4] !== _ || e[5] !== D || e[6] !== P || e[7] !== C || e[8] !== v || e[9] !== k || e[10] !== F || e[11] !== A ? (T = {
865
+ repositoryUrl: R,
866
+ branch: _,
867
+ appPath: D,
868
+ gitSecretRef: P,
869
+ runCommand: C,
870
+ language: v,
871
+ languageVersion: k,
872
+ dockerfilePath: F,
873
+ interfaceType: S,
874
+ port: A,
875
+ basePath: N,
876
+ openApiPath: z
877
+ }, e[0] = S, e[1] = R, e[2] = N, e[3] = z, e[4] = _, e[5] = D, e[6] = P, e[7] = C, e[8] = v, e[9] = k, e[10] = F, e[11] = A, e[12] = T) : T = e[12];
878
+ const s = T, [n, x] = ee(s), {
879
+ errors: o,
880
+ validateField: M,
881
+ validateForm: E,
882
+ clearErrors: W,
883
+ setFieldError: L
884
+ } = fr(Dn), {
885
+ mutate: q,
886
+ isPending: g
887
+ } = Zr();
888
+ let Z, X;
889
+ e[13] !== s || e[14] !== W || e[15] !== a ? (Z = () => {
890
+ a && (x(s), W());
891
+ }, X = [a, s, W], e[13] = s, e[14] = W, e[15] = a, e[16] = Z, e[17] = X) : (Z = e[16], X = e[17]), Jr(Z, X);
892
+ let Y;
893
+ e[18] !== L || e[19] !== M ? (Y = (y, O) => {
894
+ x((ce) => {
895
+ const ie = {
896
+ ...ce,
897
+ [y]: O
898
+ }, yr = M(y, O, ie);
899
+ if (L(y, yr), y === "language")
900
+ if (O === "python") {
901
+ L("dockerfilePath", void 0);
902
+ const Ht = M("runCommand", ie.runCommand, ie), Cr = M("languageVersion", ie.languageVersion, ie);
903
+ L("runCommand", Ht), L("languageVersion", Cr);
904
+ } else if (O === "docker") {
905
+ L("runCommand", void 0), L("languageVersion", void 0);
906
+ const Ht = M("dockerfilePath", ie.dockerfilePath, ie);
907
+ L("dockerfilePath", Ht);
908
+ } else
909
+ O === "ballerina" && (L("runCommand", void 0), L("languageVersion", void 0), L("dockerfilePath", void 0));
910
+ return ie;
911
+ });
912
+ }, e[18] = L, e[19] = M, e[20] = Y) : Y = e[20];
913
+ const B = Y;
914
+ let J;
915
+ e[21] !== L || e[22] !== M ? (J = (y) => {
916
+ let O = null;
917
+ if (x((ce) => (O = {
918
+ ...ce,
919
+ interfaceType: y,
920
+ ...y === "DEFAULT" ? {
921
+ openApiPath: "",
922
+ port: void 0,
923
+ basePath: "/"
924
+ } : {}
925
+ }, O)), O) {
926
+ const ce = M("interfaceType", y, O);
927
+ L("interfaceType", ce);
928
+ }
929
+ }, e[21] = L, e[22] = M, e[23] = J) : J = e[23];
930
+ const K = J;
931
+ let te;
932
+ e[24] !== i.agentType || e[25] !== i.name || e[26] !== i.provisioning || e[27] !== W || e[28] !== n || e[29] !== l || e[30] !== d || e[31] !== c || e[32] !== q || e[33] !== E ? (te = (y) => {
933
+ if (y.preventDefault(), !E(n))
934
+ return;
935
+ const O = i.agentType ? {
936
+ ...i.agentType,
937
+ subType: n.interfaceType === "CUSTOM" ? "custom-api" : "chat-api"
938
+ } : {
939
+ type: "agent-api",
940
+ subType: n.interfaceType === "CUSTOM" ? "custom-api" : "chat-api"
941
+ }, ce = {
942
+ provisioning: {
943
+ type: i.provisioning.type,
944
+ repository: {
945
+ url: n.repositoryUrl,
946
+ branch: n.branch,
947
+ appPath: n.appPath,
948
+ secretRef: n.gitSecretRef || null
949
+ }
950
+ },
951
+ agentType: O,
952
+ build: n.language === "docker" ? {
953
+ type: "docker",
954
+ docker: {
955
+ dockerfilePath: n.dockerfilePath ?? "./Dockerfile"
956
+ }
957
+ } : n.language === "ballerina" ? {
958
+ type: "buildpack",
959
+ buildpack: {
960
+ language: "ballerina"
961
+ }
962
+ } : {
963
+ type: "buildpack",
964
+ buildpack: {
965
+ language: n.language || "python",
966
+ languageVersion: n.languageVersion || "",
967
+ runCommand: n.runCommand || ""
968
+ }
969
+ },
970
+ inputInterface: {
971
+ type: "HTTP",
972
+ ...n.interfaceType === "CUSTOM" ? {
973
+ port: Number(n.port),
974
+ basePath: n.basePath || "/",
975
+ schema: {
976
+ path: n.openApiPath || ""
977
+ }
978
+ } : {}
979
+ }
980
+ };
981
+ q({
982
+ params: {
983
+ orgName: d,
984
+ projName: c,
985
+ agentName: i.name
986
+ },
987
+ body: ce
988
+ }, {
989
+ onSuccess: () => {
990
+ W(), l();
991
+ }
992
+ });
993
+ }, e[24] = i.agentType, e[25] = i.name, e[26] = i.provisioning, e[27] = W, e[28] = n, e[29] = l, e[30] = d, e[31] = c, e[32] = q, e[33] = E, e[34] = te) : te = e[34];
994
+ const $ = te;
995
+ let de;
996
+ e[35] === Symbol.for("react.memo_cache_sentinel") ? (de = /* @__PURE__ */ r(mr, { size: 24 }), e[35] = de) : de = e[35];
997
+ let ae;
998
+ e[36] !== l ? (ae = /* @__PURE__ */ r(tr, { icon: de, title: "Configure Build", onClose: l }), e[36] = l, e[37] = ae) : ae = e[37];
999
+ let Qe, Ke;
1000
+ e[38] === Symbol.for("react.memo_cache_sentinel") ? (Qe = {
1001
+ gap: 1,
1002
+ display: "flex",
1003
+ flexDirection: "column"
1004
+ }, Ke = /* @__PURE__ */ r(V, { variant: "h5", children: "Repository Details" }), e[38] = Qe, e[39] = Ke) : (Qe = e[38], Ke = e[39]);
1005
+ let ue;
1006
+ e[40] !== B ? (ue = (y) => B("repositoryUrl", y.target.value), e[40] = B, e[41] = ue) : ue = e[41];
1007
+ const Pt = !!o.repositoryUrl;
1008
+ let he;
1009
+ e[42] !== o.repositoryUrl || e[43] !== n.repositoryUrl || e[44] !== g || e[45] !== ue || e[46] !== Pt ? (he = /* @__PURE__ */ r(re, { placeholder: "https://github.com/username/repo", label: "GitHub Repository", fullWidth: !0, size: "small", value: n.repositoryUrl, onChange: ue, error: Pt, helperText: o.repositoryUrl, disabled: g }), e[42] = o.repositoryUrl, e[43] = n.repositoryUrl, e[44] = g, e[45] = ue, e[46] = Pt, e[47] = he) : he = e[47];
1010
+ let me;
1011
+ e[48] !== o.gitSecretRef || e[49] !== n.gitSecretRef || e[50] !== B || e[51] !== g || e[52] !== d ? (me = h && /* @__PURE__ */ r(Bn, { orgId: d, value: n.gitSecretRef, onChange: (y) => B("gitSecretRef", y), error: o.gitSecretRef, disabled: g }), e[48] = o.gitSecretRef, e[49] = n.gitSecretRef, e[50] = B, e[51] = g, e[52] = d, e[53] = me) : me = e[53];
1012
+ let pe;
1013
+ e[54] !== B ? (pe = (y) => B("branch", y.target.value), e[54] = B, e[55] = pe) : pe = e[55];
1014
+ const xt = !!o.branch;
1015
+ let fe;
1016
+ e[56] !== o.branch || e[57] !== n.branch || e[58] !== g || e[59] !== pe || e[60] !== xt ? (fe = /* @__PURE__ */ r(re, { placeholder: "main", label: "Branch", fullWidth: !0, size: "small", value: n.branch, onChange: pe, error: xt, helperText: o.branch, disabled: g }), e[56] = o.branch, e[57] = n.branch, e[58] = g, e[59] = pe, e[60] = xt, e[61] = fe) : fe = e[61];
1017
+ let ge;
1018
+ e[62] !== B ? (ge = (y) => B("appPath", y.target.value), e[62] = B, e[63] = ge) : ge = e[63];
1019
+ const vt = !!o.appPath;
1020
+ let be;
1021
+ e[64] !== o.appPath || e[65] !== n.appPath || e[66] !== g || e[67] !== ge || e[68] !== vt ? (be = /* @__PURE__ */ r(re, { placeholder: "my-agent", label: "Project Path", fullWidth: !0, size: "small", value: n.appPath, onChange: ge, error: vt, helperText: o.appPath, disabled: g }), e[64] = o.appPath, e[65] = n.appPath, e[66] = g, e[67] = ge, e[68] = vt, e[69] = be) : be = e[69];
1022
+ let ye;
1023
+ e[70] !== fe || e[71] !== be ? (ye = /* @__PURE__ */ u(U, { display: "flex", flexDirection: "row", gap: 1, children: [
1024
+ fe,
1025
+ be
1026
+ ] }), e[70] = fe, e[71] = be, e[72] = ye) : ye = e[72];
1027
+ let Ce;
1028
+ e[73] !== he || e[74] !== me || e[75] !== ye ? (Ce = /* @__PURE__ */ r(ht, { variant: "outlined", children: /* @__PURE__ */ u(mt, { sx: Qe, children: [
1029
+ Ke,
1030
+ /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 1, children: [
1031
+ he,
1032
+ me,
1033
+ ye
1034
+ ] })
1035
+ ] }) }), e[73] = he, e[74] = me, e[75] = ye, e[76] = Ce) : Ce = e[76];
1036
+ let et, tt;
1037
+ e[77] === Symbol.for("react.memo_cache_sentinel") ? (et = {
1038
+ gap: 1,
1039
+ display: "flex",
1040
+ flexDirection: "column"
1041
+ }, tt = /* @__PURE__ */ r(V, { variant: "h5", children: "Build Details" }), e[77] = et, e[78] = tt) : (et = e[77], tt = e[78]);
1042
+ let Se;
1043
+ e[79] !== n.language || e[80] !== B ? (Se = An.map((y) => {
1044
+ const O = n.language === y.value;
1045
+ return /* @__PURE__ */ r(se.CardButton, { onClick: () => B("language", y.value), selected: O, children: /* @__PURE__ */ r(se.CardHeader, { title: /* @__PURE__ */ u(se.Stack, { direction: "row", spacing: 2, justifyContent: "center", alignItems: "center", children: [
1046
+ /* @__PURE__ */ r(Xr, { language: y.value }),
1047
+ /* @__PURE__ */ r(se.Body, { children: y.label })
1048
+ ] }) }) }, y.value);
1049
+ }), e[79] = n.language, e[80] = B, e[81] = Se) : Se = e[81];
1050
+ let Pe;
1051
+ e[82] !== Se ? (Pe = /* @__PURE__ */ r(U, { display: "flex", flexDirection: "row", gap: 1, children: Se }), e[82] = Se, e[83] = Pe) : Pe = e[83];
1052
+ const Tt = n.language === "python";
1053
+ let xe;
1054
+ e[84] !== B ? (xe = (y) => B("languageVersion", y.target.value), e[84] = B, e[85] = xe) : xe = e[85];
1055
+ const wt = !!o.languageVersion, _t = o.languageVersion || "e.g., 3.11, 20, 1.21";
1056
+ let ve;
1057
+ e[86] !== n.languageVersion || e[87] !== g || e[88] !== xe || e[89] !== wt || e[90] !== _t ? (ve = /* @__PURE__ */ r(re, { placeholder: "3.11", label: "Language Version", fullWidth: !0, size: "small", value: n.languageVersion, onChange: xe, error: wt, helperText: _t, disabled: g }), e[86] = n.languageVersion, e[87] = g, e[88] = xe, e[89] = wt, e[90] = _t, e[91] = ve) : ve = e[91];
1058
+ let Te;
1059
+ e[92] !== B ? (Te = (y) => B("runCommand", y.target.value), e[92] = B, e[93] = Te) : Te = e[93];
1060
+ const kt = !!o.runCommand, Bt = o.runCommand || "Dependencies auto-install from package.json, requirements.txt, or pyproject.toml";
1061
+ let we;
1062
+ e[94] !== n.runCommand || e[95] !== g || e[96] !== Te || e[97] !== kt || e[98] !== Bt ? (we = /* @__PURE__ */ r(re, { placeholder: "python main.py", label: "Start Command", fullWidth: !0, size: "small", value: n.runCommand, onChange: Te, error: kt, helperText: Bt, disabled: g }), e[94] = n.runCommand, e[95] = g, e[96] = Te, e[97] = kt, e[98] = Bt, e[99] = we) : we = e[99];
1063
+ let _e;
1064
+ e[100] !== ve || e[101] !== we ? (_e = /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 1, children: [
1065
+ ve,
1066
+ we
1067
+ ] }), e[100] = ve, e[101] = we, e[102] = _e) : _e = e[102];
1068
+ let ke;
1069
+ e[103] !== Tt || e[104] !== _e ? (ke = /* @__PURE__ */ r(pt, { in: Tt, children: _e }), e[103] = Tt, e[104] = _e, e[105] = ke) : ke = e[105];
1070
+ const It = n.language === "docker";
1071
+ let Be;
1072
+ e[106] !== B ? (Be = (y) => B("dockerfilePath", y.target.value), e[106] = B, e[107] = Be) : Be = e[107];
1073
+ const Dt = !!o.dockerfilePath, At = o.dockerfilePath || "Path to Dockerfile in your repository";
1074
+ let Ie;
1075
+ e[108] !== n.dockerfilePath || e[109] !== g || e[110] !== Be || e[111] !== Dt || e[112] !== At ? (Ie = /* @__PURE__ */ r(re, { placeholder: "./Dockerfile", label: "Dockerfile Path", fullWidth: !0, size: "small", value: n.dockerfilePath, onChange: Be, error: Dt, helperText: At, disabled: g }), e[108] = n.dockerfilePath, e[109] = g, e[110] = Be, e[111] = Dt, e[112] = At, e[113] = Ie) : Ie = e[113];
1076
+ let De;
1077
+ e[114] !== It || e[115] !== Ie ? (De = /* @__PURE__ */ r(pt, { in: It, children: Ie }), e[114] = It, e[115] = Ie, e[116] = De) : De = e[116];
1078
+ let Ae;
1079
+ e[117] !== Pe || e[118] !== ke || e[119] !== De ? (Ae = /* @__PURE__ */ r(ht, { variant: "outlined", children: /* @__PURE__ */ u(mt, { sx: et, children: [
1080
+ tt,
1081
+ /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 1, children: [
1082
+ Pe,
1083
+ ke,
1084
+ De
1085
+ ] })
1086
+ ] }) }), e[117] = Pe, e[118] = ke, e[119] = De, e[120] = Ae) : Ae = e[120];
1087
+ let rt, nt, at;
1088
+ e[121] === Symbol.for("react.memo_cache_sentinel") ? (rt = {
1089
+ gap: 1,
1090
+ display: "flex",
1091
+ flexDirection: "column"
1092
+ }, nt = /* @__PURE__ */ r(V, { variant: "h5", children: "Agent Interface" }), at = /* @__PURE__ */ r(V, { variant: "body2", color: "text.secondary", children: "How your agent receives requests" }), e[121] = rt, e[122] = nt, e[123] = at) : (rt = e[121], nt = e[122], at = e[123]);
1093
+ let Ne;
1094
+ e[124] !== n.interfaceType || e[125] !== K || e[126] !== m ? (Ne = Nn.map((y) => /* @__PURE__ */ r(ht, { variant: "outlined", onClick: () => K(y.value), sx: {
1095
+ maxWidth: 500,
1096
+ cursor: "pointer",
1097
+ flexGrow: 1,
1098
+ transition: m.transitions.create(["background-color", "border-color"]),
1099
+ "&.MuiCard-root": {
1100
+ backgroundColor: n.interfaceType === y.value ? "background.default" : "action.paper",
1101
+ borderColor: n.interfaceType === y.value ? "primary.main" : "divider",
1102
+ "&:hover": {
1103
+ backgroundColor: "background.default",
1104
+ borderColor: "primary.main"
1105
+ }
1106
+ }
1107
+ }, children: /* @__PURE__ */ r(mt, { sx: {
1108
+ height: "100%"
1109
+ }, children: /* @__PURE__ */ u(U, { display: "flex", flexDirection: "row", alignItems: "center", height: "100%", gap: 1, children: [
1110
+ /* @__PURE__ */ r(U, { children: n.interfaceType === y.value ? /* @__PURE__ */ r(yt, { size: 16 }) : /* @__PURE__ */ r(hr, { size: 16 }) }),
1111
+ /* @__PURE__ */ r(kr, { orientation: "vertical", flexItem: !0 }),
1112
+ /* @__PURE__ */ u(U, { children: [
1113
+ /* @__PURE__ */ r(V, { variant: "h6", children: y.label }),
1114
+ /* @__PURE__ */ r(V, { variant: "caption", children: y.description })
1115
+ ] })
1116
+ ] }) }) }, y.value)), e[124] = n.interfaceType, e[125] = K, e[126] = m, e[127] = Ne) : Ne = e[127];
1117
+ let Le;
1118
+ e[128] !== Ne ? (Le = /* @__PURE__ */ r(U, { display: "flex", flexDirection: "row", gap: 1, children: Ne }), e[128] = Ne, e[129] = Le) : Le = e[129];
1119
+ const Nt = n.interfaceType === "DEFAULT";
1120
+ let it;
1121
+ e[130] === Symbol.for("react.memo_cache_sentinel") ? (it = /* @__PURE__ */ r("strong", { children: "POST /chat" }), e[130] = it) : it = e[130];
1122
+ let lt, st;
1123
+ e[131] === Symbol.for("react.memo_cache_sentinel") ? (lt = /* @__PURE__ */ r("strong", { children: "8000" }), st = /* @__PURE__ */ r("br", {}), e[131] = lt, e[132] = st) : (lt = e[131], st = e[132]);
1124
+ let ot, ct;
1125
+ e[133] === Symbol.for("react.memo_cache_sentinel") ? (ot = /* @__PURE__ */ r("code", { children: "{message: string, session_id: string, context: JSON}" }), ct = /* @__PURE__ */ r("br", {}), e[133] = ot, e[134] = ct) : (ot = e[133], ct = e[134]);
1126
+ let dt;
1127
+ e[135] === Symbol.for("react.memo_cache_sentinel") ? (dt = /* @__PURE__ */ u(Ct, { severity: "info", children: [
1128
+ "Uses the standard chat interface:",
1129
+ " ",
1130
+ it,
1131
+ " on port",
1132
+ " ",
1133
+ lt,
1134
+ st,
1135
+ "Request:",
1136
+ " ",
1137
+ ot,
1138
+ ct,
1139
+ "Response: ",
1140
+ /* @__PURE__ */ r("code", { children: "{response: string}" })
1141
+ ] }), e[135] = dt) : dt = e[135];
1142
+ let Re;
1143
+ e[136] !== Nt ? (Re = /* @__PURE__ */ r(pt, { in: Nt, children: dt }), e[136] = Nt, e[137] = Re) : Re = e[137];
1144
+ const Lt = n.interfaceType === "CUSTOM", Rt = n.interfaceType === "CUSTOM", zt = n.openApiPath || "";
1145
+ let ze;
1146
+ e[138] !== B ? (ze = (y) => B("openApiPath", y.target.value), e[138] = B, e[139] = ze) : ze = e[139];
1147
+ const Ut = !!o.openApiPath, Ft = o.openApiPath || "Path to OpenAPI schema file in your repository";
1148
+ let Ue;
1149
+ e[140] !== g || e[141] !== Rt || e[142] !== zt || e[143] !== ze || e[144] !== Ut || e[145] !== Ft ? (Ue = /* @__PURE__ */ r(U, { display: "flex", flexDirection: "column", flexGrow: 1, children: /* @__PURE__ */ r(re, { label: "OpenAPI Spec Path", placeholder: "/openapi.yaml", required: Rt, fullWidth: !0, size: "small", value: zt, onChange: ze, error: Ut, helperText: Ft, disabled: g }) }), e[140] = g, e[141] = Rt, e[142] = zt, e[143] = ze, e[144] = Ut, e[145] = Ft, e[146] = Ue) : Ue = e[146];
1150
+ const Mt = n.interfaceType === "CUSTOM", Wt = n.port ?? "";
1151
+ let Fe;
1152
+ e[147] !== B ? (Fe = (y) => {
1153
+ const O = y.target.value;
1154
+ /^\d*$/.test(O) && B("port", O === "" ? void 0 : Number(O));
1155
+ }, e[147] = B, e[148] = Fe) : Fe = e[148];
1156
+ const jt = !!o.port, Et = o.port || (n.port ? void 0 : "Port is required");
1157
+ let Me;
1158
+ e[149] !== g || e[150] !== Mt || e[151] !== Wt || e[152] !== Fe || e[153] !== jt || e[154] !== Et ? (Me = /* @__PURE__ */ r(U, { children: /* @__PURE__ */ r(re, { label: "Port", placeholder: "8080", required: Mt, value: Wt, onChange: Fe, size: "small", type: "number", error: jt, helperText: Et, disabled: g }) }), e[149] = g, e[150] = Mt, e[151] = Wt, e[152] = Fe, e[153] = jt, e[154] = Et, e[155] = Me) : Me = e[155];
1159
+ let We;
1160
+ e[156] !== Ue || e[157] !== Me ? (We = /* @__PURE__ */ u(U, { display: "flex", flexDirection: "row", gap: 1, children: [
1161
+ Ue,
1162
+ Me
1163
+ ] }), e[156] = Ue, e[157] = Me, e[158] = We) : We = e[158];
1164
+ const Vt = n.interfaceType === "CUSTOM", Ot = n.basePath || "";
1165
+ let je;
1166
+ e[159] !== B ? (je = (y) => B("basePath", y.target.value), e[159] = B, e[160] = je) : je = e[160];
1167
+ const qt = !!o.basePath, Gt = o.basePath || "API base path (e.g., / or /api/v1)";
1168
+ let Ee;
1169
+ e[161] !== g || e[162] !== Vt || e[163] !== Ot || e[164] !== je || e[165] !== qt || e[166] !== Gt ? (Ee = /* @__PURE__ */ r(U, { children: /* @__PURE__ */ r(re, { label: "Base Path", placeholder: "/", required: Vt, fullWidth: !0, size: "small", value: Ot, onChange: je, error: qt, helperText: Gt, disabled: g }) }), e[161] = g, e[162] = Vt, e[163] = Ot, e[164] = je, e[165] = qt, e[166] = Gt, e[167] = Ee) : Ee = e[167];
1170
+ let Ve;
1171
+ e[168] !== We || e[169] !== Ee ? (Ve = /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 1, children: [
1172
+ We,
1173
+ Ee
1174
+ ] }), e[168] = We, e[169] = Ee, e[170] = Ve) : Ve = e[170];
1175
+ let Oe;
1176
+ e[171] !== Lt || e[172] !== Ve ? (Oe = /* @__PURE__ */ r(pt, { in: Lt, children: Ve }), e[171] = Lt, e[172] = Ve, e[173] = Oe) : Oe = e[173];
1177
+ let qe;
1178
+ e[174] !== Le || e[175] !== Re || e[176] !== Oe ? (qe = /* @__PURE__ */ r(ht, { variant: "outlined", children: /* @__PURE__ */ u(mt, { sx: rt, children: [
1179
+ nt,
1180
+ at,
1181
+ /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 1, children: [
1182
+ Le,
1183
+ Re,
1184
+ Oe
1185
+ ] })
1186
+ ] }) }), e[174] = Le, e[175] = Re, e[176] = Oe, e[177] = qe) : qe = e[177];
1187
+ let Ge;
1188
+ e[178] !== g || e[179] !== l ? (Ge = /* @__PURE__ */ r(Q, { variant: "outlined", color: "inherit", onClick: l, disabled: g, children: "Cancel" }), e[178] = g, e[179] = l, e[180] = Ge) : Ge = e[180];
1189
+ const $t = g ? "Updating..." : "Update Build Configuration";
1190
+ let $e;
1191
+ e[181] !== g || e[182] !== $t ? ($e = /* @__PURE__ */ r(Q, { type: "submit", variant: "contained", color: "primary", disabled: g, children: $t }), e[181] = g, e[182] = $t, e[183] = $e) : $e = e[183];
1192
+ let He;
1193
+ e[184] !== Ge || e[185] !== $e ? (He = /* @__PURE__ */ u(U, { display: "flex", justifyContent: "flex-end", gap: 1, mt: 2, children: [
1194
+ Ge,
1195
+ $e
1196
+ ] }), e[184] = Ge, e[185] = $e, e[186] = He) : He = e[186];
1197
+ let Ze;
1198
+ e[187] !== Ce || e[188] !== Ae || e[189] !== qe || e[190] !== He ? (Ze = /* @__PURE__ */ u(U, { display: "flex", flexDirection: "column", gap: 2, flexGrow: 1, children: [
1199
+ Ce,
1200
+ Ae,
1201
+ qe,
1202
+ He
1203
+ ] }), e[187] = Ce, e[188] = Ae, e[189] = qe, e[190] = He, e[191] = Ze) : Ze = e[191];
1204
+ let Xe;
1205
+ e[192] !== $ || e[193] !== Ze ? (Xe = /* @__PURE__ */ r(rr, { children: /* @__PURE__ */ r("form", { onSubmit: $, children: Ze }) }), e[192] = $, e[193] = Ze, e[194] = Xe) : Xe = e[194];
1206
+ let ut;
1207
+ return e[195] !== l || e[196] !== a || e[197] !== ae || e[198] !== Xe ? (ut = /* @__PURE__ */ u(ar, { open: a, onClose: l, children: [
1208
+ ae,
1209
+ Xe
1210
+ ] }), e[195] = l, e[196] = a, e[197] = ae, e[198] = Xe, e[199] = ut) : ut = e[199], ut;
1211
+ }
1212
+ const lr = () => {
1213
+ const t = H(45), [e, a] = gr(), {
1214
+ orgId: l,
1215
+ projectId: i,
1216
+ agentId: d
1217
+ } = St(), c = e.get("buildPanel") === "open", m = e.get("configureBuild") === "open";
1218
+ let h;
1219
+ t[0] !== d || t[1] !== l || t[2] !== i ? (h = {
1220
+ orgName: l,
1221
+ projName: i,
1222
+ agentName: d
1223
+ }, t[0] = d, t[1] = l, t[2] = i, t[3] = h) : h = t[3];
1224
+ const {
1225
+ data: I
1226
+ } = pr(h);
1227
+ let S;
1228
+ t[4] !== e || t[5] !== a ? (S = () => {
1229
+ const o = new URLSearchParams(e);
1230
+ o.delete("buildPanel"), a(o);
1231
+ }, t[4] = e, t[5] = a, t[6] = S) : S = t[6];
1232
+ const b = S;
1233
+ let p;
1234
+ t[7] !== e || t[8] !== a ? (p = () => {
1235
+ const o = new URLSearchParams(e);
1236
+ o.set("buildPanel", "open"), a(o);
1237
+ }, t[7] = e, t[8] = a, t[9] = p) : p = t[9];
1238
+ const f = p;
1239
+ let w;
1240
+ t[10] !== e || t[11] !== a ? (w = () => {
1241
+ const o = new URLSearchParams(e);
1242
+ o.delete("configureBuild"), a(o);
1243
+ }, t[10] = e, t[11] = a, t[12] = w) : w = t[12];
1244
+ const R = w;
1245
+ let _;
1246
+ t[13] !== e || t[14] !== a ? (_ = () => {
1247
+ const o = new URLSearchParams(e);
1248
+ o.set("configureBuild", "open"), a(o);
1249
+ }, t[13] = e, t[14] = a, t[15] = _) : _ = t[15];
1250
+ const D = _;
1251
+ let P;
1252
+ t[16] !== I?.provisioning.type || t[17] !== D ? (P = I?.provisioning.type === "internal" && /* @__PURE__ */ r(Q, { onClick: D, variant: "outlined", color: "primary", startIcon: /* @__PURE__ */ r(mr, { size: 16 }), children: "Configure Build" }), t[16] = I?.provisioning.type, t[17] = D, t[18] = P) : P = t[18];
1253
+ let C;
1254
+ t[19] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ r(bt, { size: 16 }), t[19] = C) : C = t[19];
1255
+ let v;
1256
+ t[20] !== f ? (v = /* @__PURE__ */ r(Q, { onClick: f, variant: "contained", color: "primary", startIcon: C, children: "Trigger a Build" }), t[20] = f, t[21] = v) : v = t[21];
1257
+ let k;
1258
+ t[22] !== P || t[23] !== v ? (k = /* @__PURE__ */ u(U, { display: "flex", gap: 1, children: [
1259
+ P,
1260
+ v
1261
+ ] }), t[22] = P, t[23] = v, t[24] = k) : k = t[24];
1262
+ let F;
1263
+ t[25] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ r(wn, {}), t[25] = F) : F = t[25];
1264
+ const A = l || "", N = i || "", z = d || "";
1265
+ let T;
1266
+ t[26] !== b || t[27] !== A || t[28] !== N || t[29] !== z ? (T = /* @__PURE__ */ r(mn, { onClose: b, orgName: A, projName: N, agentName: z }), t[26] = b, t[27] = A, t[28] = N, t[29] = z, t[30] = T) : T = t[30];
1267
+ let s;
1268
+ t[31] !== b || t[32] !== c || t[33] !== T ? (s = /* @__PURE__ */ r(ar, { open: c, onClose: b, children: T }), t[31] = b, t[32] = c, t[33] = T, t[34] = s) : s = t[34];
1269
+ let n;
1270
+ t[35] !== I || t[36] !== R || t[37] !== m || t[38] !== l || t[39] !== i ? (n = I && I.provisioning.type === "internal" && /* @__PURE__ */ r(Ln, { open: m, onClose: R, agent: I, orgId: l || "default", projectId: i || "default" }), t[35] = I, t[36] = R, t[37] = m, t[38] = l, t[39] = i, t[40] = n) : n = t[40];
1271
+ let x;
1272
+ return t[41] !== s || t[42] !== n || t[43] !== k ? (x = /* @__PURE__ */ u(Yr, { title: "Build", disableIcon: !0, actions: k, children: [
1273
+ F,
1274
+ s,
1275
+ n
1276
+ ] }), t[41] = s, t[42] = n, t[43] = k, t[44] = x) : x = t[44], x;
1277
+ }, qn = {
1278
+ title: "Build",
1279
+ description: "A page component for Build",
1280
+ icon: bt,
1281
+ path: "/build",
1282
+ component: lr,
1283
+ levels: {
1284
+ component: lr
1285
+ }
1286
+ };
1287
+ export {
1288
+ lr as BuildComponent,
1289
+ qn as metaData
1290
+ };