@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.
- package/dist/APIKeysManager-C0phJriD.js +241 -0
- package/dist/CatalogKindListing-DtFI2YMG.js +118 -0
- package/dist/CodeBlock-mB_Loq7I.js +21736 -0
- package/dist/EnvironmentCard-09h1XRxx.js +310 -0
- package/dist/EnvironmentSelector-B7Bl93s2.js +48 -0
- package/dist/MCPLogo-D9IJzzl7.js +30 -0
- package/dist/PolicyListSection-o4k9e8XO.js +2475 -0
- package/dist/ResourceListShell-Cx6mdeqv.js +463 -0
- package/dist/SwaggerSpecViewer-BvkhoKsi.js +106 -0
- package/dist/clipboard-YAzStmkw.js +23 -0
- package/dist/debounce-BV83M53b.js +208 -0
- package/dist/format-BEZZRyE2.js +29 -0
- package/dist/formatDistanceToNow-TErllcH8.js +100 -0
- package/dist/gatewayScripts-D8O45W8u.js +72 -0
- package/dist/highlight-BsUzxSR3.js +454 -0
- package/dist/index-B52h3RHg.js +1290 -0
- package/dist/index-BP5drcF2.js +1265 -0
- package/dist/index-BZ4vxviI.js +7981 -0
- package/dist/index-B_Z0MwXk.js +25012 -0
- package/dist/index-BfjzUWDa.js +1397 -0
- package/dist/{index-DYV1jEai.js → index-BnV-PkwM.js} +22 -20
- package/dist/index-CGDYgUCH.js +711 -0
- package/dist/index-COt7nJIf.js +2286 -0
- package/dist/index-CWZjOy1h.js +2247 -0
- package/dist/index-CezvogTQ.js +116 -0
- package/dist/index-CgCWbWzN.js +2342 -0
- package/dist/index-CjCkcuuI.js +322 -0
- package/dist/index-CjXvuf9m.js +1354 -0
- package/dist/index-DD4qF7gq.js +2340 -0
- package/dist/index-DeQ-9KTC.js +737 -0
- package/dist/index-Df6OBy4E.js +3041 -0
- package/dist/index-KRsV2L4V.js +1564 -0
- package/dist/index-PUuASE1F.js +2507 -0
- package/dist/index-PWsNvJB-.js +546 -0
- package/dist/index-UqDmyMSA.js +119 -0
- package/dist/index-_0Pj_ZtW.js +459 -0
- package/dist/{index-CnXsN5I3.js → index-sr-mWz4T.js} +31 -30
- package/dist/index.d.ts +496 -200
- package/dist/index.js +462 -439
- package/dist/llmProviderPayload-CzihkdNa.js +332 -0
- package/dist/schemas-DFScWdSL.js +2969 -0
- package/package.json +1 -1
- package/dist/index-B47EJCom.js +0 -236
- package/dist/index-Bl1Y7Sro.js +0 -3037
- package/dist/index-DlS9Lybj.js +0 -80691
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { jsx as t, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { c as M } from "react/compiler-runtime";
|
|
3
|
+
import { useState as W } from "react";
|
|
4
|
+
import { Alert as Y, Box as K, Typography as j, Button as $, Chip as te, Tooltip as H, IconButton as J, Skeleton as le, Stack as Q, DialogTitle as ie, TextField as q, DialogContent as ne, CircularProgress as se, DialogActions as oe, Dialog as re } from "@wso2/oxygen-ui";
|
|
5
|
+
import { Key as U, Plus as G, Trash2 as ae, Copy as ce } from "@wso2/oxygen-ui-icons-react";
|
|
6
|
+
function be(C) {
|
|
7
|
+
return C?.enabled !== !1 && C?.apiKey?.enabled === !0;
|
|
8
|
+
}
|
|
9
|
+
function de(C) {
|
|
10
|
+
const e = M(44), {
|
|
11
|
+
open: l,
|
|
12
|
+
onClose: b,
|
|
13
|
+
isCreating: f,
|
|
14
|
+
onCreate: h,
|
|
15
|
+
onCreated: m
|
|
16
|
+
} = C, g = fe, [r, y] = W(""), [n, a] = W(g);
|
|
17
|
+
let p;
|
|
18
|
+
e[0] !== r ? (p = r.trim(), e[0] = r, e[1] = p) : p = e[1];
|
|
19
|
+
const c = p, s = c.length > 0 && n.length > 0;
|
|
20
|
+
let d;
|
|
21
|
+
e[2] !== b ? (d = () => {
|
|
22
|
+
y(""), a(g()), b();
|
|
23
|
+
}, e[2] = b, e[3] = d) : d = e[3];
|
|
24
|
+
const i = d;
|
|
25
|
+
let o;
|
|
26
|
+
e[4] !== s || e[5] !== n || e[6] !== i || e[7] !== h || e[8] !== m || e[9] !== c ? (o = async () => {
|
|
27
|
+
if (!s)
|
|
28
|
+
return;
|
|
29
|
+
const [E, X, Z] = n.split("-").map(Number), ee = new Date(E, X - 1, Z, 23, 59, 59, 999).toISOString();
|
|
30
|
+
try {
|
|
31
|
+
const V = await h({
|
|
32
|
+
displayName: c,
|
|
33
|
+
expiresAt: ee
|
|
34
|
+
});
|
|
35
|
+
V && m(V), i();
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
}, e[4] = s, e[5] = n, e[6] = i, e[7] = h, e[8] = m, e[9] = c, e[10] = o) : o = e[10];
|
|
39
|
+
const u = o;
|
|
40
|
+
let k;
|
|
41
|
+
e[11] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ t(ie, { children: "Create API Key" }), e[11] = k) : k = e[11];
|
|
42
|
+
let A;
|
|
43
|
+
e[12] === Symbol.for("react.memo_cache_sentinel") ? (A = {
|
|
44
|
+
pt: 1
|
|
45
|
+
}, e[12] = A) : A = e[12];
|
|
46
|
+
let S;
|
|
47
|
+
e[13] === Symbol.for("react.memo_cache_sentinel") ? (S = (E) => y(E.target.value), e[13] = S) : S = e[13];
|
|
48
|
+
let x;
|
|
49
|
+
e[14] !== r ? (x = /* @__PURE__ */ t(q, { label: "Display name", value: r, onChange: S, fullWidth: !0, required: !0, size: "small", placeholder: "production key" }), e[14] = r, e[15] = x) : x = e[15];
|
|
50
|
+
let I;
|
|
51
|
+
e[16] === Symbol.for("react.memo_cache_sentinel") ? (I = (E) => a(E.target.value), e[16] = I) : I = e[16];
|
|
52
|
+
const v = n.length === 0;
|
|
53
|
+
let B;
|
|
54
|
+
e[17] === Symbol.for("react.memo_cache_sentinel") ? (B = {
|
|
55
|
+
inputLabel: {
|
|
56
|
+
shrink: !0
|
|
57
|
+
}
|
|
58
|
+
}, e[17] = B) : B = e[17];
|
|
59
|
+
let D;
|
|
60
|
+
e[18] !== n || e[19] !== v ? (D = /* @__PURE__ */ t(q, { label: "Expires", type: "date", value: n, onChange: I, fullWidth: !0, required: !0, size: "small", error: v, slotProps: B, helperText: "Key expires at end of the selected day" }), e[18] = n, e[19] = v, e[20] = D) : D = e[20];
|
|
61
|
+
let w;
|
|
62
|
+
e[21] !== D || e[22] !== x ? (w = /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ _(Q, { spacing: 2, sx: A, children: [
|
|
63
|
+
x,
|
|
64
|
+
D
|
|
65
|
+
] }) }), e[21] = D, e[22] = x, e[23] = w) : w = e[23];
|
|
66
|
+
let P;
|
|
67
|
+
e[24] !== i || e[25] !== f ? (P = /* @__PURE__ */ t($, { variant: "outlined", onClick: i, disabled: f, children: "Cancel" }), e[24] = i, e[25] = f, e[26] = P) : P = e[26];
|
|
68
|
+
let z;
|
|
69
|
+
e[27] !== u ? (z = () => void u(), e[27] = u, e[28] = z) : z = e[28];
|
|
70
|
+
const F = f || !s;
|
|
71
|
+
let R;
|
|
72
|
+
e[29] !== f ? (R = f ? /* @__PURE__ */ t(se, { size: 16 }) : void 0, e[29] = f, e[30] = R) : R = e[30];
|
|
73
|
+
const L = f ? "Creating..." : "Create";
|
|
74
|
+
let N;
|
|
75
|
+
e[31] !== z || e[32] !== F || e[33] !== R || e[34] !== L ? (N = /* @__PURE__ */ t($, { variant: "contained", onClick: z, disabled: F, startIcon: R, children: L }), e[31] = z, e[32] = F, e[33] = R, e[34] = L, e[35] = N) : N = e[35];
|
|
76
|
+
let T;
|
|
77
|
+
e[36] !== P || e[37] !== N ? (T = /* @__PURE__ */ _(oe, { children: [
|
|
78
|
+
P,
|
|
79
|
+
N
|
|
80
|
+
] }), e[36] = P, e[37] = N, e[38] = T) : T = e[38];
|
|
81
|
+
let O;
|
|
82
|
+
return e[39] !== i || e[40] !== l || e[41] !== w || e[42] !== T ? (O = /* @__PURE__ */ _(re, { open: l, onClose: i, maxWidth: "sm", fullWidth: !0, children: [
|
|
83
|
+
k,
|
|
84
|
+
w,
|
|
85
|
+
T
|
|
86
|
+
] }), e[39] = i, e[40] = l, e[41] = w, e[42] = T, e[43] = O) : O = e[43], O;
|
|
87
|
+
}
|
|
88
|
+
function fe() {
|
|
89
|
+
const C = /* @__PURE__ */ new Date();
|
|
90
|
+
return C.setMonth(C.getMonth() + 1), C.toISOString().slice(0, 10);
|
|
91
|
+
}
|
|
92
|
+
function me(C) {
|
|
93
|
+
const e = M(19), {
|
|
94
|
+
apiKey: l,
|
|
95
|
+
onDismiss: b
|
|
96
|
+
} = C, [f, h] = W(!1);
|
|
97
|
+
let m;
|
|
98
|
+
e[0] !== l ? (m = () => {
|
|
99
|
+
navigator.clipboard.writeText(l).then(() => {
|
|
100
|
+
h(!0), setTimeout(() => h(!1), 2e3);
|
|
101
|
+
});
|
|
102
|
+
}, e[0] = l, e[1] = m) : m = e[1];
|
|
103
|
+
const g = m;
|
|
104
|
+
let r;
|
|
105
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (r = {
|
|
106
|
+
mb: 2,
|
|
107
|
+
"& .MuiAlert-message": {
|
|
108
|
+
flexGrow: 1
|
|
109
|
+
}
|
|
110
|
+
}, e[2] = r) : r = e[2];
|
|
111
|
+
let y;
|
|
112
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ t(j, { variant: "subtitle2", sx: {
|
|
113
|
+
mb: 0.5
|
|
114
|
+
}, children: "You will only see this key once. Copy it now." }), e[3] = y) : y = e[3];
|
|
115
|
+
let n;
|
|
116
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (n = {
|
|
117
|
+
input: {
|
|
118
|
+
readOnly: !0
|
|
119
|
+
}
|
|
120
|
+
}, e[4] = n) : n = e[4];
|
|
121
|
+
let a;
|
|
122
|
+
e[5] !== l ? (a = /* @__PURE__ */ t(q, { size: "small", fullWidth: !0, value: l, slotProps: n }), e[5] = l, e[6] = a) : a = e[6];
|
|
123
|
+
const p = f ? "Copied!" : "Copy";
|
|
124
|
+
let c;
|
|
125
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ t(ce, { size: 16 }), e[7] = c) : c = e[7];
|
|
126
|
+
let s;
|
|
127
|
+
e[8] !== g ? (s = /* @__PURE__ */ t(J, { size: "small", onClick: g, "aria-label": "Copy API key", children: c }), e[8] = g, e[9] = s) : s = e[9];
|
|
128
|
+
let d;
|
|
129
|
+
e[10] !== p || e[11] !== s ? (d = /* @__PURE__ */ t(H, { title: p, children: s }), e[10] = p, e[11] = s, e[12] = d) : d = e[12];
|
|
130
|
+
let i;
|
|
131
|
+
e[13] !== a || e[14] !== d ? (i = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", gap: 1, children: [
|
|
132
|
+
a,
|
|
133
|
+
d
|
|
134
|
+
] }), e[13] = a, e[14] = d, e[15] = i) : i = e[15];
|
|
135
|
+
let o;
|
|
136
|
+
return e[16] !== b || e[17] !== i ? (o = /* @__PURE__ */ _(Y, { severity: "success", onClose: b, sx: r, children: [
|
|
137
|
+
y,
|
|
138
|
+
i
|
|
139
|
+
] }), e[16] = b, e[17] = i, e[18] = o) : o = e[18], o;
|
|
140
|
+
}
|
|
141
|
+
function pe(C) {
|
|
142
|
+
const e = M(26), {
|
|
143
|
+
apiKey: l,
|
|
144
|
+
onRevoke: b,
|
|
145
|
+
isRevoking: f
|
|
146
|
+
} = C;
|
|
147
|
+
let h;
|
|
148
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
149
|
+
borderBottom: "1px solid",
|
|
150
|
+
borderColor: "divider"
|
|
151
|
+
}, e[0] = h) : h = e[0];
|
|
152
|
+
let m;
|
|
153
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ t(U, { size: 18 }), e[1] = m) : m = e[1];
|
|
154
|
+
const g = l.displayName || l.name;
|
|
155
|
+
let r;
|
|
156
|
+
e[2] !== g ? (r = /* @__PURE__ */ t(j, { variant: "body2", fontWeight: 500, children: g }), e[2] = g, e[3] = r) : r = e[3];
|
|
157
|
+
const y = l.expiresAt && ` · Expires ${new Date(l.expiresAt).toLocaleDateString()}`;
|
|
158
|
+
let n;
|
|
159
|
+
e[4] !== l.maskedApiKey || e[5] !== y ? (n = /* @__PURE__ */ _(j, { variant: "caption", color: "text.secondary", children: [
|
|
160
|
+
l.maskedApiKey,
|
|
161
|
+
y
|
|
162
|
+
] }), e[4] = l.maskedApiKey, e[5] = y, e[6] = n) : n = e[6];
|
|
163
|
+
let a;
|
|
164
|
+
e[7] !== r || e[8] !== n ? (a = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", gap: 2, children: [
|
|
165
|
+
m,
|
|
166
|
+
/* @__PURE__ */ _(K, { children: [
|
|
167
|
+
r,
|
|
168
|
+
n
|
|
169
|
+
] })
|
|
170
|
+
] }), e[7] = r, e[8] = n, e[9] = a) : a = e[9];
|
|
171
|
+
const p = l.status === "active" ? "success" : "default";
|
|
172
|
+
let c;
|
|
173
|
+
e[10] !== l.status || e[11] !== p ? (c = /* @__PURE__ */ t(te, { label: l.status, size: "small", color: p }), e[10] = l.status, e[11] = p, e[12] = c) : c = e[12];
|
|
174
|
+
let s;
|
|
175
|
+
e[13] !== l.name || e[14] !== b ? (s = () => b(l.name), e[13] = l.name, e[14] = b, e[15] = s) : s = e[15];
|
|
176
|
+
let d;
|
|
177
|
+
e[16] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ t(ae, { size: 16 }), e[16] = d) : d = e[16];
|
|
178
|
+
let i;
|
|
179
|
+
e[17] !== f || e[18] !== s ? (i = /* @__PURE__ */ t(H, { title: "Revoke", children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(J, { size: "small", color: "error", onClick: s, disabled: f, "aria-label": "Revoke API key", children: d }) }) }), e[17] = f, e[18] = s, e[19] = i) : i = e[19];
|
|
180
|
+
let o;
|
|
181
|
+
e[20] !== i || e[21] !== c ? (o = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", gap: 1, children: [
|
|
182
|
+
c,
|
|
183
|
+
i
|
|
184
|
+
] }), e[20] = i, e[21] = c, e[22] = o) : o = e[22];
|
|
185
|
+
let u;
|
|
186
|
+
return e[23] !== o || e[24] !== a ? (u = /* @__PURE__ */ _(K, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 2, py: 1.5, sx: h, children: [
|
|
187
|
+
a,
|
|
188
|
+
o
|
|
189
|
+
] }), e[23] = o, e[24] = a, e[25] = u) : u = e[25], u;
|
|
190
|
+
}
|
|
191
|
+
function xe(C) {
|
|
192
|
+
const e = M(23), {
|
|
193
|
+
keys: l,
|
|
194
|
+
isLoading: b,
|
|
195
|
+
isError: f,
|
|
196
|
+
isCreating: h,
|
|
197
|
+
isRevoking: m,
|
|
198
|
+
emptyDescription: g,
|
|
199
|
+
onCreate: r,
|
|
200
|
+
onRevoke: y
|
|
201
|
+
} = C, n = f === void 0 ? !1 : f, a = m === void 0 ? !1 : m, [p, c] = W(!1), [s, d] = W(null);
|
|
202
|
+
if (b) {
|
|
203
|
+
let v;
|
|
204
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ t(le, { variant: "rectangular", width: "100%", height: 200 }), e[0] = v) : v = e[0], v;
|
|
205
|
+
}
|
|
206
|
+
const i = !!l && l.length > 0;
|
|
207
|
+
let o;
|
|
208
|
+
e[1] !== i ? (o = i && /* @__PURE__ */ t(Q, { direction: "row", justifyContent: "flex-end", sx: {
|
|
209
|
+
mb: 2
|
|
210
|
+
}, children: /* @__PURE__ */ t($, { variant: "contained", startIcon: /* @__PURE__ */ t(G, { size: 16 }), onClick: () => c(!0), children: "Create" }) }), e[1] = i, e[2] = o) : o = e[2];
|
|
211
|
+
let u;
|
|
212
|
+
e[3] !== s ? (u = s && /* @__PURE__ */ t(me, { apiKey: s, onDismiss: () => d(null) }), e[3] = s, e[4] = u) : u = e[4];
|
|
213
|
+
let k;
|
|
214
|
+
e[5] !== g || e[6] !== i || e[7] !== n || e[8] !== a || e[9] !== l || e[10] !== y ? (k = n ? /* @__PURE__ */ t(Y, { severity: "error", children: "Failed to load API keys. Please refresh the page." }) : i ? /* @__PURE__ */ t(K, { sx: {
|
|
215
|
+
border: "1px solid",
|
|
216
|
+
borderColor: "divider",
|
|
217
|
+
borderRadius: 1
|
|
218
|
+
}, children: l.map((v) => /* @__PURE__ */ t(pe, { apiKey: v, onRevoke: y, isRevoking: a }, v.name)) }) : /* @__PURE__ */ _(K, { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", py: 8, gap: 2, children: [
|
|
219
|
+
/* @__PURE__ */ t(U, { size: 48 }),
|
|
220
|
+
/* @__PURE__ */ t(j, { variant: "h6", children: "No API keys" }),
|
|
221
|
+
/* @__PURE__ */ t(j, { variant: "body2", color: "text.secondary", children: g }),
|
|
222
|
+
/* @__PURE__ */ t($, { variant: "contained", startIcon: /* @__PURE__ */ t(G, { size: 16 }), onClick: () => c(!0), children: "Create API Key" })
|
|
223
|
+
] }), e[5] = g, e[6] = i, e[7] = n, e[8] = a, e[9] = l, e[10] = y, e[11] = k) : k = e[11];
|
|
224
|
+
let A;
|
|
225
|
+
e[12] === Symbol.for("react.memo_cache_sentinel") ? (A = () => c(!1), e[12] = A) : A = e[12];
|
|
226
|
+
let S;
|
|
227
|
+
e[13] === Symbol.for("react.memo_cache_sentinel") ? (S = (v) => d(v), e[13] = S) : S = e[13];
|
|
228
|
+
let x;
|
|
229
|
+
e[14] !== p || e[15] !== h || e[16] !== r ? (x = /* @__PURE__ */ t(de, { open: p, onClose: A, isCreating: h, onCreate: r, onCreated: S }), e[14] = p, e[15] = h, e[16] = r, e[17] = x) : x = e[17];
|
|
230
|
+
let I;
|
|
231
|
+
return e[18] !== o || e[19] !== u || e[20] !== k || e[21] !== x ? (I = /* @__PURE__ */ _(K, { children: [
|
|
232
|
+
o,
|
|
233
|
+
u,
|
|
234
|
+
k,
|
|
235
|
+
x
|
|
236
|
+
] }), e[18] = o, e[19] = u, e[20] = k, e[21] = x, e[22] = I) : I = e[22], I;
|
|
237
|
+
}
|
|
238
|
+
export {
|
|
239
|
+
xe as A,
|
|
240
|
+
be as i
|
|
241
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsx as n, jsxs as v, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, useRef as O, useEffect as D, useCallback as A, useMemo as T } from "react";
|
|
3
|
+
import { Typography as b, Form as _, Tooltip as k, Stack as N, SearchBar as B, Box as L, Skeleton as H, ListingTable as P, TablePagination as I } from "@wso2/oxygen-ui";
|
|
4
|
+
import { CircleIcon as j, Search as G } from "@wso2/oxygen-ui-icons-react";
|
|
5
|
+
import { c as W } from "react/compiler-runtime";
|
|
6
|
+
import { Link as z } from "react-router-dom";
|
|
7
|
+
const F = (g) => {
|
|
8
|
+
const e = W(26), {
|
|
9
|
+
item: i,
|
|
10
|
+
viewPath: d
|
|
11
|
+
} = g, o = i.description ?? "", r = i.latestVersion ? `Latest: ${i.latestVersion}` : null;
|
|
12
|
+
let u;
|
|
13
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
14
|
+
textDecoration: "none"
|
|
15
|
+
}, e[0] = u) : u = e[0];
|
|
16
|
+
let x;
|
|
17
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (x = {
|
|
18
|
+
width: "100%",
|
|
19
|
+
textAlign: "left",
|
|
20
|
+
textDecoration: "none",
|
|
21
|
+
height: 160,
|
|
22
|
+
display: "flex",
|
|
23
|
+
flexDirection: "column",
|
|
24
|
+
justifyContent: "flex-start"
|
|
25
|
+
}, e[1] = x) : x = e[1];
|
|
26
|
+
let m;
|
|
27
|
+
e[2] !== i.displayName ? (m = /* @__PURE__ */ n(b, { variant: "h6", textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", children: i.displayName }), e[2] = i.displayName, e[3] = m) : m = e[3];
|
|
28
|
+
let l;
|
|
29
|
+
e[4] !== i.displayName || e[5] !== m ? (l = /* @__PURE__ */ n(_.CardHeader, { title: /* @__PURE__ */ n(k, { title: i.displayName, placement: "top", children: m }) }), e[4] = i.displayName, e[5] = m, e[6] = l) : l = e[6];
|
|
30
|
+
let y;
|
|
31
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (y = {
|
|
32
|
+
width: "100%",
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
flexGrow: 1,
|
|
36
|
+
minHeight: 0
|
|
37
|
+
}, e[7] = y) : y = e[7];
|
|
38
|
+
const s = !o;
|
|
39
|
+
let C;
|
|
40
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (C = {
|
|
41
|
+
display: "-webkit-box",
|
|
42
|
+
WebkitBoxOrient: "vertical",
|
|
43
|
+
WebkitLineClamp: 2,
|
|
44
|
+
overflow: "hidden",
|
|
45
|
+
mb: 1
|
|
46
|
+
}, e[8] = C) : C = e[8];
|
|
47
|
+
const c = o || "No description provided.";
|
|
48
|
+
let h;
|
|
49
|
+
e[9] !== c ? (h = /* @__PURE__ */ n(b, { variant: "caption", color: "text.secondary", sx: C, children: c }), e[9] = c, e[10] = h) : h = e[10];
|
|
50
|
+
let p;
|
|
51
|
+
e[11] !== o || e[12] !== s || e[13] !== h ? (p = /* @__PURE__ */ n(N, { flexGrow: 1, minHeight: 0, children: /* @__PURE__ */ n(k, { title: o, placement: "top", disableHoverListener: s, children: h }) }), e[11] = o, e[12] = s, e[13] = h, e[14] = p) : p = e[14];
|
|
52
|
+
let f;
|
|
53
|
+
e[15] !== r ? (f = r && /* @__PURE__ */ n(b, { variant: "caption", color: "text.secondary", children: r }), e[15] = r, e[16] = f) : f = e[16];
|
|
54
|
+
let t;
|
|
55
|
+
e[17] !== p || e[18] !== f ? (t = /* @__PURE__ */ v(_.CardContent, { sx: y, children: [
|
|
56
|
+
p,
|
|
57
|
+
f
|
|
58
|
+
] }), e[17] = p, e[18] = f, e[19] = t) : t = e[19];
|
|
59
|
+
let a;
|
|
60
|
+
e[20] !== t || e[21] !== l ? (a = /* @__PURE__ */ v(_.CardButton, { sx: x, children: [
|
|
61
|
+
l,
|
|
62
|
+
t
|
|
63
|
+
] }), e[20] = t, e[21] = l, e[22] = a) : a = e[22];
|
|
64
|
+
let w;
|
|
65
|
+
return e[23] !== a || e[24] !== d ? (w = /* @__PURE__ */ n(z, { to: d, style: u, children: a }), e[23] = a, e[24] = d, e[25] = w) : w = e[25], w;
|
|
66
|
+
}, E = 6, K = [6, 12, 24], M = 300, X = ({
|
|
67
|
+
items: g,
|
|
68
|
+
getViewPath: e,
|
|
69
|
+
isLoading: i
|
|
70
|
+
}) => {
|
|
71
|
+
const [d, o] = S(0), [r, u] = S(E), [x, m] = S(""), [l, y] = S(""), s = O(null);
|
|
72
|
+
D(() => () => {
|
|
73
|
+
s.current && clearTimeout(s.current);
|
|
74
|
+
}, []);
|
|
75
|
+
const C = A((t) => {
|
|
76
|
+
const a = t.target.value;
|
|
77
|
+
m(a), s.current && clearTimeout(s.current), s.current = setTimeout(() => {
|
|
78
|
+
y(a), o(0);
|
|
79
|
+
}, M);
|
|
80
|
+
}, []), c = T(() => {
|
|
81
|
+
const t = l.trim().toLowerCase();
|
|
82
|
+
return t ? g.filter((a) => a.displayName.toLowerCase().includes(t) || a.name.toLowerCase().includes(t) || (a.description ?? "").toLowerCase().includes(t)) : g;
|
|
83
|
+
}, [g, l]), h = T(() => c.slice(d * r, d * r + r), [c, d, r]), p = (t, a) => {
|
|
84
|
+
o(a);
|
|
85
|
+
}, f = (t) => {
|
|
86
|
+
u(parseInt(t.target.value, 10)), o(0);
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ v(N, { spacing: 2, children: [
|
|
89
|
+
/* @__PURE__ */ n(N, { direction: "row", justifyContent: "flex-end", children: /* @__PURE__ */ n(B, { placeholder: "Search agent kinds", size: "small", value: x, onChange: C }) }),
|
|
90
|
+
i ? /* @__PURE__ */ n(L, { sx: {
|
|
91
|
+
display: "grid",
|
|
92
|
+
gridTemplateColumns: {
|
|
93
|
+
xs: "repeat(auto-fill, minmax(260px, 1fr))",
|
|
94
|
+
md: "repeat(auto-fill, minmax(300px, 1fr))"
|
|
95
|
+
},
|
|
96
|
+
gap: 2
|
|
97
|
+
}, children: Array.from({
|
|
98
|
+
length: 6
|
|
99
|
+
}).map((t, a) => /* @__PURE__ */ n(H, { variant: "rounded", height: 160 }, a)) }) : g.length === 0 ? /* @__PURE__ */ n(P.Container, { sx: {
|
|
100
|
+
my: 3
|
|
101
|
+
}, children: /* @__PURE__ */ n(P.EmptyState, { illustration: /* @__PURE__ */ n(j, { size: 64 }), title: "No agent kinds available", description: "No agent kinds have been added to the catalog yet." }) }) : c.length === 0 ? /* @__PURE__ */ n(P.Container, { sx: {
|
|
102
|
+
my: 3
|
|
103
|
+
}, children: /* @__PURE__ */ n(P.EmptyState, { illustration: /* @__PURE__ */ n(G, { size: 64 }), title: "No agent kinds match your search", description: "Try a different keyword or clear the search filter." }) }) : /* @__PURE__ */ v(R, { children: [
|
|
104
|
+
/* @__PURE__ */ n(L, { sx: {
|
|
105
|
+
display: "grid",
|
|
106
|
+
gridTemplateColumns: {
|
|
107
|
+
xs: "repeat(auto-fill, minmax(260px, 1fr))",
|
|
108
|
+
md: "repeat(auto-fill, minmax(300px, 1fr))"
|
|
109
|
+
},
|
|
110
|
+
gap: 2
|
|
111
|
+
}, children: h.map((t) => /* @__PURE__ */ n(F, { item: t, viewPath: e(t) }, t.name)) }),
|
|
112
|
+
c.length > E && /* @__PURE__ */ n(I, { component: "div", count: c.length, page: d, rowsPerPage: r, onPageChange: p, onRowsPerPageChange: f, rowsPerPageOptions: K })
|
|
113
|
+
] })
|
|
114
|
+
] });
|
|
115
|
+
};
|
|
116
|
+
export {
|
|
117
|
+
X as C
|
|
118
|
+
};
|