@modelcontextprotocol/inspector-client 0.16.7 → 0.17.0

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.
@@ -7411,8 +7411,8 @@ function getElementRef$1(element) {
7411
7411
  }
7412
7412
  return element.props.ref || element.ref;
7413
7413
  }
7414
- function createCollection(name) {
7415
- const PROVIDER_NAME2 = name + "CollectionProvider";
7414
+ function createCollection(name2) {
7415
+ const PROVIDER_NAME2 = name2 + "CollectionProvider";
7416
7416
  const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME2);
7417
7417
  const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
7418
7418
  PROVIDER_NAME2,
@@ -7425,7 +7425,7 @@ function createCollection(name) {
7425
7425
  return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref2, children });
7426
7426
  };
7427
7427
  CollectionProvider.displayName = PROVIDER_NAME2;
7428
- const COLLECTION_SLOT_NAME = name + "CollectionSlot";
7428
+ const COLLECTION_SLOT_NAME = name2 + "CollectionSlot";
7429
7429
  const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
7430
7430
  const CollectionSlot = React.forwardRef(
7431
7431
  (props, forwardedRef) => {
@@ -7436,7 +7436,7 @@ function createCollection(name) {
7436
7436
  }
7437
7437
  );
7438
7438
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
7439
- const ITEM_SLOT_NAME = name + "CollectionItemSlot";
7439
+ const ITEM_SLOT_NAME = name2 + "CollectionItemSlot";
7440
7440
  const ITEM_DATA_ATTR = "data-radix-collection-item";
7441
7441
  const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
7442
7442
  const CollectionItemSlot = React.forwardRef(
@@ -7454,7 +7454,7 @@ function createCollection(name) {
7454
7454
  );
7455
7455
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
7456
7456
  function useCollection2(scope) {
7457
- const context = useCollectionContext(name + "CollectionConsumer", scope);
7457
+ const context = useCollectionContext(name2 + "CollectionConsumer", scope);
7458
7458
  const getItems = React.useCallback(() => {
7459
7459
  const collectionNode = context.collectionRef.current;
7460
7460
  if (!collectionNode) return [];
@@ -7721,17 +7721,17 @@ function dispatchUpdate() {
7721
7721
  const event = new CustomEvent(CONTEXT_UPDATE);
7722
7722
  document.dispatchEvent(event);
7723
7723
  }
7724
- function handleAndDispatchCustomEvent$1(name, handler, detail, { discrete }) {
7724
+ function handleAndDispatchCustomEvent$1(name2, handler, detail, { discrete }) {
7725
7725
  const target = detail.originalEvent.target;
7726
- const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
7727
- if (handler) target.addEventListener(name, handler, { once: true });
7726
+ const event = new CustomEvent(name2, { bubbles: false, cancelable: true, detail });
7727
+ if (handler) target.addEventListener(name2, handler, { once: true });
7728
7728
  if (discrete) {
7729
7729
  dispatchDiscreteCustomEvent(target, event);
7730
7730
  } else {
7731
7731
  target.dispatchEvent(event);
7732
7732
  }
7733
7733
  }
7734
- var Root$5 = DismissableLayer;
7734
+ var Root$6 = DismissableLayer;
7735
7735
  var Branch = DismissableLayerBranch;
7736
7736
  var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? reactExports.useLayoutEffect : () => {
7737
7737
  };
@@ -7961,10 +7961,10 @@ var VisuallyHidden = reactExports.forwardRef(
7961
7961
  }
7962
7962
  );
7963
7963
  VisuallyHidden.displayName = NAME$2;
7964
- var Root$4 = VisuallyHidden;
7964
+ var Root$5 = VisuallyHidden;
7965
7965
  var PROVIDER_NAME$1 = "ToastProvider";
7966
7966
  var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection("Toast");
7967
- var [createToastContext, createToastScope] = createContextScope("Toast", [createCollectionScope$2]);
7967
+ var [createToastContext] = createContextScope("Toast", [createCollectionScope$2]);
7968
7968
  var [ToastProviderProvider, useToastProviderContext] = createToastContext(PROVIDER_NAME$1);
7969
7969
  var ToastProvider$1 = (props) => {
7970
7970
  const {
@@ -8323,7 +8323,7 @@ var ToastImpl = reactExports.forwardRef(
8323
8323
  ),
8324
8324
  /* @__PURE__ */ jsxRuntimeExports.jsx(ToastInteractiveProvider, { scope: __scopeToast, onClose: handleClose, children: reactDomExports.createPortal(
8325
8325
  /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$2.ItemSlot, { scope: __scopeToast, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
8326
- Root$5,
8326
+ Root$6,
8327
8327
  {
8328
8328
  asChild: true,
8329
8329
  onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, () => {
@@ -8512,10 +8512,10 @@ function getAnnounceTextContent(container) {
8512
8512
  });
8513
8513
  return textContent;
8514
8514
  }
8515
- function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
8515
+ function handleAndDispatchCustomEvent(name2, handler, detail, { discrete }) {
8516
8516
  const currentTarget = detail.originalEvent.currentTarget;
8517
- const event = new CustomEvent(name, { bubbles: true, cancelable: true, detail });
8518
- if (handler) currentTarget.addEventListener(name, handler, { once: true });
8517
+ const event = new CustomEvent(name2, { bubbles: true, cancelable: true, detail });
8518
+ if (handler) currentTarget.addEventListener(name2, handler, { once: true });
8519
8519
  if (discrete) {
8520
8520
  dispatchDiscreteCustomEvent(currentTarget, event);
8521
8521
  } else {
@@ -16246,6 +16246,17 @@ objectType({
16246
16246
  token: stringType(),
16247
16247
  token_type_hint: stringType().optional()
16248
16248
  }).strip();
16249
+ const name = "@modelcontextprotocol/inspector-client";
16250
+ const version$1 = "0.17.0";
16251
+ const packageJson = {
16252
+ name,
16253
+ version: version$1
16254
+ };
16255
+ const CLIENT_IDENTITY = (() => {
16256
+ const [, name2 = packageJson.name] = packageJson.name.split("/");
16257
+ const version2 = packageJson.version;
16258
+ return { name: name2, version: version2 };
16259
+ })();
16249
16260
  const SESSION_KEYS = {
16250
16261
  CODE_VERIFIER: "mcp_code_verifier",
16251
16262
  SERVER_URL: "mcp_server_url",
@@ -17013,9 +17024,12 @@ class InspectorOAuthClientProvider {
17013
17024
  get redirectUrl() {
17014
17025
  return window.location.origin + "/oauth/callback";
17015
17026
  }
17027
+ get debugRedirectUrl() {
17028
+ return window.location.origin + "/oauth/callback/debug";
17029
+ }
17016
17030
  get clientMetadata() {
17017
17031
  return {
17018
- redirect_uris: [this.redirectUrl],
17032
+ redirect_uris: [this.redirectUrl, this.debugRedirectUrl],
17019
17033
  token_endpoint_auth_method: "none",
17020
17034
  grant_types: ["authorization_code", "refresh_token"],
17021
17035
  response_types: ["code"],
@@ -17038,14 +17052,9 @@ class InspectorOAuthClientProvider {
17038
17052
  });
17039
17053
  }
17040
17054
  saveClientInformation(clientInformation) {
17041
- const safeInfo = Object.fromEntries(
17042
- Object.entries(clientInformation).filter(
17043
- ([key]) => key !== "client_secret"
17044
- )
17045
- );
17046
17055
  saveClientInformationToSessionStorage({
17047
17056
  serverUrl: this.serverUrl,
17048
- clientInformation: safeInfo,
17057
+ clientInformation,
17049
17058
  isPreregistered: false
17050
17059
  });
17051
17060
  }
@@ -17098,7 +17107,7 @@ class InspectorOAuthClientProvider {
17098
17107
  }
17099
17108
  class DebugInspectorOAuthClientProvider extends InspectorOAuthClientProvider {
17100
17109
  get redirectUrl() {
17101
- return `${window.location.origin}/oauth/callback/debug`;
17110
+ return this.debugRedirectUrl;
17102
17111
  }
17103
17112
  saveServerMetadata(metadata) {
17104
17113
  const key = getServerSpecificKey(
@@ -18222,9 +18231,9 @@ function requireUri_all() {
18222
18231
  if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
18223
18232
  if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
18224
18233
  var fields = [];
18225
- for (var name in headers) {
18226
- if (headers[name] !== O[name]) {
18227
- fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
18234
+ for (var name2 in headers) {
18235
+ if (headers[name2] !== O[name2]) {
18236
+ fields.push(name2.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name2].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
18228
18237
  }
18229
18238
  }
18230
18239
  if (fields.length) {
@@ -23260,9 +23269,9 @@ function requireAjv() {
23260
23269
  }
23261
23270
  return text.slice(0, -separator.length);
23262
23271
  }
23263
- function addFormat(name, format2) {
23272
+ function addFormat(name2, format2) {
23264
23273
  if (typeof format2 == "string") format2 = new RegExp(format2);
23265
- this._formats[name] = format2;
23274
+ this._formats[name2] = format2;
23266
23275
  return this;
23267
23276
  }
23268
23277
  function addDefaultMetaSchema(self2) {
@@ -23284,15 +23293,15 @@ function requireAjv() {
23284
23293
  else for (var key in optsSchemas) self2.addSchema(optsSchemas[key], key);
23285
23294
  }
23286
23295
  function addInitialFormats(self2) {
23287
- for (var name in self2._opts.formats) {
23288
- var format2 = self2._opts.formats[name];
23289
- self2.addFormat(name, format2);
23296
+ for (var name2 in self2._opts.formats) {
23297
+ var format2 = self2._opts.formats[name2];
23298
+ self2.addFormat(name2, format2);
23290
23299
  }
23291
23300
  }
23292
23301
  function addInitialKeywords(self2) {
23293
- for (var name in self2._opts.keywords) {
23294
- var keyword2 = self2._opts.keywords[name];
23295
- self2.addKeyword(name, keyword2);
23302
+ for (var name2 in self2._opts.keywords) {
23303
+ var keyword2 = self2._opts.keywords[name2];
23304
+ self2.addKeyword(name2, keyword2);
23296
23305
  }
23297
23306
  }
23298
23307
  function checkUnique(self2, id) {
@@ -23374,9 +23383,9 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
23374
23383
  case "boolean":
23375
23384
  return isRequired ? false : void 0;
23376
23385
  case "array":
23377
- return [];
23386
+ return isRequired ? [] : void 0;
23378
23387
  case "object": {
23379
- if (!schema.properties) return {};
23388
+ if (!schema.properties) return isRequired ? {} : void 0;
23380
23389
  const obj = {};
23381
23390
  Object.entries(schema.properties).forEach(([key, prop]) => {
23382
23391
  if (isPropertyRequired(key, schema)) {
@@ -23386,7 +23395,7 @@ function generateDefaultValue(schema, propertyName, parentSchema) {
23386
23395
  }
23387
23396
  }
23388
23397
  });
23389
- return obj;
23398
+ return isRequired ? obj : Object.keys(obj).length > 0 ? obj : void 0;
23390
23399
  }
23391
23400
  case "null":
23392
23401
  return null;
@@ -23425,6 +23434,21 @@ function normalizeUnionType(schema) {
23425
23434
  }
23426
23435
  return schema;
23427
23436
  }
23437
+ function cleanParams(params, schema) {
23438
+ const cleaned = {};
23439
+ const required2 = schema.required || [];
23440
+ for (const [key, value] of Object.entries(params)) {
23441
+ const isFieldRequired = required2.includes(key);
23442
+ if (isFieldRequired) {
23443
+ cleaned[key] = value;
23444
+ } else {
23445
+ if (value !== void 0 && value !== "" && value !== null) {
23446
+ cleaned[key] = value;
23447
+ }
23448
+ }
23449
+ }
23450
+ return cleaned;
23451
+ }
23428
23452
  const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
23429
23453
  class Protocol {
23430
23454
  constructor(_options) {
@@ -24905,10 +24929,6 @@ class StreamableHTTPClientTransport {
24905
24929
  return this._protocolVersion;
24906
24930
  }
24907
24931
  }
24908
- const version$1 = "0.16.7";
24909
- const packageJson = {
24910
- version: version$1
24911
- };
24912
24932
  const getSearchParam = (key) => {
24913
24933
  try {
24914
24934
  const url = new URL(window.location.href);
@@ -25031,11 +25051,11 @@ function useConnection({
25031
25051
  args,
25032
25052
  sseUrl,
25033
25053
  env,
25034
- bearerToken,
25035
- headerName,
25054
+ customHeaders,
25036
25055
  oauthClientId,
25037
25056
  oauthScope,
25038
25057
  config,
25058
+ connectionType = "proxy",
25039
25059
  onNotification,
25040
25060
  onPendingRequest,
25041
25061
  onElicitationRequest,
@@ -25051,6 +25071,10 @@ function useConnection({
25051
25071
  );
25052
25072
  const [requestHistory, setRequestHistory] = reactExports.useState([]);
25053
25073
  const [completionsSupported, setCompletionsSupported] = reactExports.useState(false);
25074
+ const [mcpSessionId, setMcpSessionId] = reactExports.useState(null);
25075
+ const [mcpProtocolVersion, setMcpProtocolVersion] = reactExports.useState(
25076
+ null
25077
+ );
25054
25078
  reactExports.useEffect(() => {
25055
25079
  if (!oauthClientId) {
25056
25080
  clearClientInformationFromSessionStorage({
@@ -25230,127 +25254,220 @@ function useConnection({
25230
25254
  }
25231
25255
  return false;
25232
25256
  };
25257
+ const captureResponseHeaders = (response) => {
25258
+ const sessionId = response.headers.get("mcp-session-id");
25259
+ const protocolVersion = response.headers.get("mcp-protocol-version");
25260
+ if (sessionId && sessionId !== mcpSessionId) {
25261
+ setMcpSessionId(sessionId);
25262
+ }
25263
+ if (protocolVersion && protocolVersion !== mcpProtocolVersion) {
25264
+ setMcpProtocolVersion(protocolVersion);
25265
+ }
25266
+ };
25233
25267
  const connect = async (_e2, retryCount = 0) => {
25234
25268
  var _a;
25235
- const client2 = new Client(
25236
- {
25237
- name: "mcp-inspector",
25238
- version: packageJson.version
25239
- },
25240
- {
25241
- capabilities: {
25242
- sampling: {},
25243
- elicitation: {},
25244
- roots: {
25245
- listChanged: true
25246
- }
25269
+ const clientCapabilities = {
25270
+ capabilities: {
25271
+ sampling: {},
25272
+ elicitation: {},
25273
+ roots: {
25274
+ listChanged: true
25247
25275
  }
25248
25276
  }
25277
+ };
25278
+ const client2 = new Client(
25279
+ CLIENT_IDENTITY,
25280
+ clientCapabilities
25249
25281
  );
25250
- try {
25251
- await checkProxyHealth();
25252
- } catch {
25253
- setConnectionStatus("error-connecting-to-proxy");
25254
- return;
25282
+ if (connectionType === "proxy") {
25283
+ try {
25284
+ await checkProxyHealth();
25285
+ } catch {
25286
+ setConnectionStatus("error-connecting-to-proxy");
25287
+ return;
25288
+ }
25255
25289
  }
25256
25290
  let lastRequest = "";
25257
25291
  try {
25258
25292
  const headers = {};
25259
25293
  const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
25260
- const token = bearerToken || ((_a = await serverAuthProvider.tokens()) == null ? void 0 : _a.access_token);
25261
- if (token) {
25262
- const authHeaderName = headerName || "Authorization";
25263
- if (authHeaderName.toLowerCase() !== "authorization") {
25264
- headers[authHeaderName] = token;
25265
- headers["x-custom-auth-header"] = authHeaderName;
25266
- } else {
25267
- headers[authHeaderName] = `Bearer ${token}`;
25294
+ let finalHeaders = customHeaders || [];
25295
+ const isEmptyAuthHeader = (header) => header.name.trim().toLowerCase() === "authorization" && header.value.trim().toLowerCase() === "bearer";
25296
+ const hasEmptyAuthHeader = finalHeaders.some(
25297
+ (header) => header.enabled && isEmptyAuthHeader(header)
25298
+ );
25299
+ if (hasEmptyAuthHeader) {
25300
+ toast2({
25301
+ title: "Invalid Authorization Header",
25302
+ description: "Authorization header is enabled but empty. Please add a token or disable the header.",
25303
+ variant: "destructive"
25304
+ });
25305
+ }
25306
+ const needsOAuthToken = !finalHeaders.some(
25307
+ (header) => header.enabled && header.name.trim().toLowerCase() === "authorization"
25308
+ );
25309
+ if (needsOAuthToken) {
25310
+ const oauthToken = (_a = await serverAuthProvider.tokens()) == null ? void 0 : _a.access_token;
25311
+ if (oauthToken) {
25312
+ finalHeaders = [
25313
+ // Remove any existing Authorization headers with empty tokens
25314
+ ...finalHeaders.filter((header) => !isEmptyAuthHeader(header)),
25315
+ {
25316
+ name: "Authorization",
25317
+ value: `Bearer ${oauthToken}`,
25318
+ enabled: true
25319
+ }
25320
+ ];
25268
25321
  }
25269
25322
  }
25270
- const { token: proxyAuthToken, header: proxyAuthTokenHeader } = getMCPProxyAuthToken(config);
25271
- const proxyHeaders = {};
25272
- if (proxyAuthToken) {
25273
- proxyHeaders[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
25323
+ const customHeaderNames = [];
25324
+ finalHeaders.forEach((header) => {
25325
+ if (header.enabled && header.name.trim() && header.value.trim()) {
25326
+ const headerName = header.name.trim();
25327
+ const headerValue = header.value.trim();
25328
+ headers[headerName] = headerValue;
25329
+ if (headerName.toLowerCase() !== "authorization") {
25330
+ customHeaderNames.push(headerName);
25331
+ }
25332
+ }
25333
+ });
25334
+ if (customHeaderNames.length > 0) {
25335
+ headers["x-custom-auth-headers"] = JSON.stringify(customHeaderNames);
25274
25336
  }
25275
25337
  let transportOptions;
25276
- let mcpProxyServerUrl;
25277
- switch (transportType) {
25278
- case "stdio": {
25279
- mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/stdio`);
25280
- mcpProxyServerUrl.searchParams.append("command", command);
25281
- mcpProxyServerUrl.searchParams.append("args", args);
25282
- mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
25283
- const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
25284
- if (proxyFullAddress) {
25285
- mcpProxyServerUrl.searchParams.append(
25286
- "proxyFullAddress",
25287
- proxyFullAddress
25288
- );
25289
- }
25290
- transportOptions = {
25291
- authProvider: serverAuthProvider,
25292
- eventSourceInit: {
25293
- fetch: (url, init) => fetch(url, {
25294
- ...init,
25338
+ let serverUrl;
25339
+ if (connectionType === "direct" && transportType !== "stdio") {
25340
+ serverUrl = new URL(sseUrl);
25341
+ const requestHeaders = { ...headers };
25342
+ if (mcpSessionId) {
25343
+ requestHeaders["mcp-session-id"] = mcpSessionId;
25344
+ }
25345
+ switch (transportType) {
25346
+ case "sse":
25347
+ requestHeaders["Accept"] = "text/event-stream";
25348
+ requestHeaders["content-type"] = "application/json";
25349
+ transportOptions = {
25350
+ fetch: async (url, init) => {
25351
+ const response = await fetch(url, {
25352
+ ...init,
25353
+ headers: requestHeaders
25354
+ });
25355
+ captureResponseHeaders(response);
25356
+ return response;
25357
+ },
25358
+ requestInit: {
25359
+ headers: requestHeaders
25360
+ }
25361
+ };
25362
+ break;
25363
+ case "streamable-http":
25364
+ transportOptions = {
25365
+ fetch: async (url, init) => {
25366
+ requestHeaders["Accept"] = "text/event-stream, application/json";
25367
+ requestHeaders["Content-Type"] = "application/json";
25368
+ const response = await fetch(url, {
25369
+ headers: requestHeaders,
25370
+ ...init
25371
+ });
25372
+ captureResponseHeaders(response);
25373
+ return response;
25374
+ },
25375
+ requestInit: {
25376
+ headers: requestHeaders
25377
+ },
25378
+ // TODO these should be configurable...
25379
+ reconnectionOptions: {
25380
+ maxReconnectionDelay: 3e4,
25381
+ initialReconnectionDelay: 1e3,
25382
+ reconnectionDelayGrowFactor: 1.5,
25383
+ maxRetries: 2
25384
+ }
25385
+ };
25386
+ break;
25387
+ }
25388
+ } else {
25389
+ const { token: proxyAuthToken, header: proxyAuthTokenHeader } = getMCPProxyAuthToken(config);
25390
+ const proxyHeaders = {};
25391
+ if (proxyAuthToken) {
25392
+ proxyHeaders[proxyAuthTokenHeader] = `Bearer ${proxyAuthToken}`;
25393
+ }
25394
+ let mcpProxyServerUrl;
25395
+ switch (transportType) {
25396
+ case "stdio": {
25397
+ mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/stdio`);
25398
+ mcpProxyServerUrl.searchParams.append("command", command);
25399
+ mcpProxyServerUrl.searchParams.append("args", args);
25400
+ mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
25401
+ const proxyFullAddress = config.MCP_PROXY_FULL_ADDRESS.value;
25402
+ if (proxyFullAddress) {
25403
+ mcpProxyServerUrl.searchParams.append(
25404
+ "proxyFullAddress",
25405
+ proxyFullAddress
25406
+ );
25407
+ }
25408
+ transportOptions = {
25409
+ authProvider: serverAuthProvider,
25410
+ eventSourceInit: {
25411
+ fetch: (url, init) => fetch(url, {
25412
+ ...init,
25413
+ headers: { ...headers, ...proxyHeaders }
25414
+ })
25415
+ },
25416
+ requestInit: {
25295
25417
  headers: { ...headers, ...proxyHeaders }
25296
- })
25297
- },
25298
- requestInit: {
25299
- headers: { ...headers, ...proxyHeaders }
25418
+ }
25419
+ };
25420
+ break;
25421
+ }
25422
+ case "sse": {
25423
+ mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
25424
+ mcpProxyServerUrl.searchParams.append("url", sseUrl);
25425
+ const proxyFullAddressSSE = config.MCP_PROXY_FULL_ADDRESS.value;
25426
+ if (proxyFullAddressSSE) {
25427
+ mcpProxyServerUrl.searchParams.append(
25428
+ "proxyFullAddress",
25429
+ proxyFullAddressSSE
25430
+ );
25300
25431
  }
25301
- };
25302
- break;
25303
- }
25304
- case "sse": {
25305
- mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
25306
- mcpProxyServerUrl.searchParams.append("url", sseUrl);
25307
- const proxyFullAddressSSE = config.MCP_PROXY_FULL_ADDRESS.value;
25308
- if (proxyFullAddressSSE) {
25309
- mcpProxyServerUrl.searchParams.append(
25310
- "proxyFullAddress",
25311
- proxyFullAddressSSE
25312
- );
25432
+ transportOptions = {
25433
+ eventSourceInit: {
25434
+ fetch: (url, init) => fetch(url, {
25435
+ ...init,
25436
+ headers: { ...headers, ...proxyHeaders }
25437
+ })
25438
+ },
25439
+ requestInit: {
25440
+ headers: { ...headers, ...proxyHeaders }
25441
+ }
25442
+ };
25443
+ break;
25313
25444
  }
25314
- transportOptions = {
25315
- eventSourceInit: {
25316
- fetch: (url, init) => fetch(url, {
25317
- ...init,
25445
+ case "streamable-http":
25446
+ mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
25447
+ mcpProxyServerUrl.searchParams.append("url", sseUrl);
25448
+ transportOptions = {
25449
+ eventSourceInit: {
25450
+ fetch: (url, init) => fetch(url, {
25451
+ ...init,
25452
+ headers: { ...headers, ...proxyHeaders }
25453
+ })
25454
+ },
25455
+ requestInit: {
25318
25456
  headers: { ...headers, ...proxyHeaders }
25319
- })
25320
- },
25321
- requestInit: {
25322
- headers: { ...headers, ...proxyHeaders }
25323
- }
25324
- };
25325
- break;
25457
+ },
25458
+ // TODO these should be configurable...
25459
+ reconnectionOptions: {
25460
+ maxReconnectionDelay: 3e4,
25461
+ initialReconnectionDelay: 1e3,
25462
+ reconnectionDelayGrowFactor: 1.5,
25463
+ maxRetries: 2
25464
+ }
25465
+ };
25466
+ break;
25326
25467
  }
25327
- case "streamable-http":
25328
- mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/mcp`);
25329
- mcpProxyServerUrl.searchParams.append("url", sseUrl);
25330
- transportOptions = {
25331
- eventSourceInit: {
25332
- fetch: (url, init) => fetch(url, {
25333
- ...init,
25334
- headers: { ...headers, ...proxyHeaders }
25335
- })
25336
- },
25337
- requestInit: {
25338
- headers: { ...headers, ...proxyHeaders }
25339
- },
25340
- // TODO these should be configurable...
25341
- reconnectionOptions: {
25342
- maxReconnectionDelay: 3e4,
25343
- initialReconnectionDelay: 1e3,
25344
- reconnectionDelayGrowFactor: 1.5,
25345
- maxRetries: 2
25346
- }
25347
- };
25348
- break;
25468
+ serverUrl = mcpProxyServerUrl;
25469
+ serverUrl.searchParams.append("transportType", transportType);
25349
25470
  }
25350
- mcpProxyServerUrl.searchParams.append(
25351
- "transportType",
25352
- transportType
25353
- );
25354
25471
  if (onNotification) {
25355
25472
  [
25356
25473
  CancelledNotificationSchema,
@@ -25369,13 +25486,10 @@ function useConnection({
25369
25486
  }
25370
25487
  let capabilities;
25371
25488
  try {
25372
- const transport = transportType === "streamable-http" ? new StreamableHTTPClientTransport(mcpProxyServerUrl, {
25489
+ const transport = transportType === "streamable-http" ? new StreamableHTTPClientTransport(serverUrl, {
25373
25490
  sessionId: void 0,
25374
25491
  ...transportOptions
25375
- }) : new SSEClientTransport(
25376
- mcpProxyServerUrl,
25377
- transportOptions
25378
- );
25492
+ }) : new SSEClientTransport(serverUrl, transportOptions);
25379
25493
  await client2.connect(transport);
25380
25494
  setClientTransport(transport);
25381
25495
  capabilities = client2.getServerCapabilities();
@@ -25389,7 +25503,7 @@ function useConnection({
25389
25503
  });
25390
25504
  } catch (error) {
25391
25505
  console.error(
25392
- `Failed to connect to MCP Server via the MCP Inspector Proxy: ${mcpProxyServerUrl}:`,
25506
+ connectionType === "direct" ? `Failed to connect directly to MCP Server at: ${serverUrl}:` : `Failed to connect to MCP Server via the MCP Inspector Proxy: ${serverUrl}:`,
25393
25507
  error
25394
25508
  );
25395
25509
  if (isProxyAuthError(error)) {
@@ -25470,6 +25584,8 @@ function useConnection({
25470
25584
  setConnectionStatus("disconnected");
25471
25585
  setCompletionsSupported(false);
25472
25586
  setServerCapabilities(null);
25587
+ setMcpSessionId(null);
25588
+ setMcpProtocolVersion(null);
25473
25589
  };
25474
25590
  const clearRequestHistory = () => {
25475
25591
  setRequestHistory([]);
@@ -25801,10 +25917,10 @@ function focusFirst$1(candidates, preventScroll = false) {
25801
25917
  function wrapArray$1(array, startIndex) {
25802
25918
  return array.map((_, index2) => array[(startIndex + index2) % array.length]);
25803
25919
  }
25804
- var Root$3 = RovingFocusGroup;
25920
+ var Root$4 = RovingFocusGroup;
25805
25921
  var Item$1 = RovingFocusGroupItem;
25806
25922
  var TABS_NAME = "Tabs";
25807
- var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
25923
+ var [createTabsContext] = createContextScope(TABS_NAME, [
25808
25924
  createRovingFocusGroupScope
25809
25925
  ]);
25810
25926
  var useRovingFocusGroupScope = createRovingFocusGroupScope();
@@ -25859,7 +25975,7 @@ var TabsList$1 = reactExports.forwardRef(
25859
25975
  const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
25860
25976
  const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
25861
25977
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
25862
- Root$3,
25978
+ Root$4,
25863
25979
  {
25864
25980
  asChild: true,
25865
25981
  ...rovingFocusGroupScope,
@@ -26158,7 +26274,7 @@ const createLucideIcon = (iconName, iconNode) => {
26158
26274
  * This source code is licensed under the ISC license.
26159
26275
  * See the LICENSE file in the root directory of this source tree.
26160
26276
  */
26161
- const __iconNode$x = [
26277
+ const __iconNode$z = [
26162
26278
  ["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
26163
26279
  [
26164
26280
  "path",
@@ -26168,14 +26284,14 @@ const __iconNode$x = [
26168
26284
  }
26169
26285
  ]
26170
26286
  ];
26171
- const Bell = createLucideIcon("bell", __iconNode$x);
26287
+ const Bell = createLucideIcon("bell", __iconNode$z);
26172
26288
  /**
26173
26289
  * @license lucide-react v0.523.0 - ISC
26174
26290
  *
26175
26291
  * This source code is licensed under the ISC license.
26176
26292
  * See the LICENSE file in the root directory of this source tree.
26177
26293
  */
26178
- const __iconNode$w = [
26294
+ const __iconNode$y = [
26179
26295
  ["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
26180
26296
  ["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
26181
26297
  ["path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1", key: "d7y7pr" }],
@@ -26194,134 +26310,134 @@ const __iconNode$w = [
26194
26310
  ["path", { d: "M22 13h-4", key: "1jl80f" }],
26195
26311
  ["path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4", key: "k3fwyw" }]
26196
26312
  ];
26197
- const Bug = createLucideIcon("bug", __iconNode$w);
26313
+ const Bug = createLucideIcon("bug", __iconNode$y);
26198
26314
  /**
26199
26315
  * @license lucide-react v0.523.0 - ISC
26200
26316
  *
26201
26317
  * This source code is licensed under the ISC license.
26202
26318
  * See the LICENSE file in the root directory of this source tree.
26203
26319
  */
26204
- const __iconNode$v = [
26320
+ const __iconNode$x = [
26205
26321
  ["path", { d: "M18 6 7 17l-5-5", key: "116fxf" }],
26206
26322
  ["path", { d: "m22 10-7.5 7.5L13 16", key: "ke71qq" }]
26207
26323
  ];
26208
- const CheckCheck = createLucideIcon("check-check", __iconNode$v);
26324
+ const CheckCheck = createLucideIcon("check-check", __iconNode$x);
26209
26325
  /**
26210
26326
  * @license lucide-react v0.523.0 - ISC
26211
26327
  *
26212
26328
  * This source code is licensed under the ISC license.
26213
26329
  * See the LICENSE file in the root directory of this source tree.
26214
26330
  */
26215
- const __iconNode$u = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
26216
- const Check = createLucideIcon("check", __iconNode$u);
26331
+ const __iconNode$w = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
26332
+ const Check = createLucideIcon("check", __iconNode$w);
26217
26333
  /**
26218
26334
  * @license lucide-react v0.523.0 - ISC
26219
26335
  *
26220
26336
  * This source code is licensed under the ISC license.
26221
26337
  * See the LICENSE file in the root directory of this source tree.
26222
26338
  */
26223
- const __iconNode$t = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
26224
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$t);
26339
+ const __iconNode$v = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
26340
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$v);
26225
26341
  /**
26226
26342
  * @license lucide-react v0.523.0 - ISC
26227
26343
  *
26228
26344
  * This source code is licensed under the ISC license.
26229
26345
  * See the LICENSE file in the root directory of this source tree.
26230
26346
  */
26231
- const __iconNode$s = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
26232
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$s);
26347
+ const __iconNode$u = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
26348
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$u);
26233
26349
  /**
26234
26350
  * @license lucide-react v0.523.0 - ISC
26235
26351
  *
26236
26352
  * This source code is licensed under the ISC license.
26237
26353
  * See the LICENSE file in the root directory of this source tree.
26238
26354
  */
26239
- const __iconNode$r = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
26240
- const ChevronUp = createLucideIcon("chevron-up", __iconNode$r);
26355
+ const __iconNode$t = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
26356
+ const ChevronUp = createLucideIcon("chevron-up", __iconNode$t);
26241
26357
  /**
26242
26358
  * @license lucide-react v0.523.0 - ISC
26243
26359
  *
26244
26360
  * This source code is licensed under the ISC license.
26245
26361
  * See the LICENSE file in the root directory of this source tree.
26246
26362
  */
26247
- const __iconNode$q = [
26363
+ const __iconNode$s = [
26248
26364
  ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
26249
26365
  ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
26250
26366
  ];
26251
- const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$q);
26367
+ const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$s);
26252
26368
  /**
26253
26369
  * @license lucide-react v0.523.0 - ISC
26254
26370
  *
26255
26371
  * This source code is licensed under the ISC license.
26256
26372
  * See the LICENSE file in the root directory of this source tree.
26257
26373
  */
26258
- const __iconNode$p = [
26374
+ const __iconNode$r = [
26259
26375
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
26260
26376
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
26261
26377
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
26262
26378
  ];
26263
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$p);
26379
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$r);
26264
26380
  /**
26265
26381
  * @license lucide-react v0.523.0 - ISC
26266
26382
  *
26267
26383
  * This source code is licensed under the ISC license.
26268
26384
  * See the LICENSE file in the root directory of this source tree.
26269
26385
  */
26270
- const __iconNode$o = [
26386
+ const __iconNode$q = [
26271
26387
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
26272
26388
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
26273
26389
  ];
26274
- const CircleCheck = createLucideIcon("circle-check", __iconNode$o);
26390
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$q);
26275
26391
  /**
26276
26392
  * @license lucide-react v0.523.0 - ISC
26277
26393
  *
26278
26394
  * This source code is licensed under the ISC license.
26279
26395
  * See the LICENSE file in the root directory of this source tree.
26280
26396
  */
26281
- const __iconNode$n = [
26397
+ const __iconNode$p = [
26282
26398
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
26283
26399
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
26284
26400
  ["path", { d: "M12 17h.01", key: "p32p05" }]
26285
26401
  ];
26286
- const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$n);
26402
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$p);
26287
26403
  /**
26288
26404
  * @license lucide-react v0.523.0 - ISC
26289
26405
  *
26290
26406
  * This source code is licensed under the ISC license.
26291
26407
  * See the LICENSE file in the root directory of this source tree.
26292
26408
  */
26293
- const __iconNode$m = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
26294
- const Circle = createLucideIcon("circle", __iconNode$m);
26409
+ const __iconNode$o = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
26410
+ const Circle = createLucideIcon("circle", __iconNode$o);
26295
26411
  /**
26296
26412
  * @license lucide-react v0.523.0 - ISC
26297
26413
  *
26298
26414
  * This source code is licensed under the ISC license.
26299
26415
  * See the LICENSE file in the root directory of this source tree.
26300
26416
  */
26301
- const __iconNode$l = [
26417
+ const __iconNode$n = [
26302
26418
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
26303
26419
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
26304
26420
  ];
26305
- const Copy = createLucideIcon("copy", __iconNode$l);
26421
+ const Copy = createLucideIcon("copy", __iconNode$n);
26306
26422
  /**
26307
26423
  * @license lucide-react v0.523.0 - ISC
26308
26424
  *
26309
26425
  * This source code is licensed under the ISC license.
26310
26426
  * See the LICENSE file in the root directory of this source tree.
26311
26427
  */
26312
- const __iconNode$k = [
26428
+ const __iconNode$m = [
26313
26429
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
26314
26430
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
26315
26431
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
26316
26432
  ];
26317
- const ExternalLink = createLucideIcon("external-link", __iconNode$k);
26433
+ const ExternalLink = createLucideIcon("external-link", __iconNode$m);
26318
26434
  /**
26319
26435
  * @license lucide-react v0.523.0 - ISC
26320
26436
  *
26321
26437
  * This source code is licensed under the ISC license.
26322
26438
  * See the LICENSE file in the root directory of this source tree.
26323
26439
  */
26324
- const __iconNode$j = [
26440
+ const __iconNode$l = [
26325
26441
  [
26326
26442
  "path",
26327
26443
  {
@@ -26339,14 +26455,14 @@ const __iconNode$j = [
26339
26455
  ],
26340
26456
  ["path", { d: "m2 2 20 20", key: "1ooewy" }]
26341
26457
  ];
26342
- const EyeOff = createLucideIcon("eye-off", __iconNode$j);
26458
+ const EyeOff = createLucideIcon("eye-off", __iconNode$l);
26343
26459
  /**
26344
26460
  * @license lucide-react v0.523.0 - ISC
26345
26461
  *
26346
26462
  * This source code is licensed under the ISC license.
26347
26463
  * See the LICENSE file in the root directory of this source tree.
26348
26464
  */
26349
- const __iconNode$i = [
26465
+ const __iconNode$k = [
26350
26466
  [
26351
26467
  "path",
26352
26468
  {
@@ -26356,40 +26472,40 @@ const __iconNode$i = [
26356
26472
  ],
26357
26473
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
26358
26474
  ];
26359
- const Eye = createLucideIcon("eye", __iconNode$i);
26475
+ const Eye = createLucideIcon("eye", __iconNode$k);
26360
26476
  /**
26361
26477
  * @license lucide-react v0.523.0 - ISC
26362
26478
  *
26363
26479
  * This source code is licensed under the ISC license.
26364
26480
  * See the LICENSE file in the root directory of this source tree.
26365
26481
  */
26366
- const __iconNode$h = [
26482
+ const __iconNode$j = [
26367
26483
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
26368
26484
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
26369
26485
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
26370
26486
  ["path", { d: "M16 13H8", key: "t4e002" }],
26371
26487
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
26372
26488
  ];
26373
- const FileText = createLucideIcon("file-text", __iconNode$h);
26489
+ const FileText = createLucideIcon("file-text", __iconNode$j);
26374
26490
  /**
26375
26491
  * @license lucide-react v0.523.0 - ISC
26376
26492
  *
26377
26493
  * This source code is licensed under the ISC license.
26378
26494
  * See the LICENSE file in the root directory of this source tree.
26379
26495
  */
26380
- const __iconNode$g = [
26496
+ const __iconNode$i = [
26381
26497
  ["path", { d: "M20 7h-3a2 2 0 0 1-2-2V2", key: "x099mo" }],
26382
26498
  ["path", { d: "M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z", key: "18t6ie" }],
26383
26499
  ["path", { d: "M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8", key: "1nja0z" }]
26384
26500
  ];
26385
- const Files = createLucideIcon("files", __iconNode$g);
26501
+ const Files = createLucideIcon("files", __iconNode$i);
26386
26502
  /**
26387
26503
  * @license lucide-react v0.523.0 - ISC
26388
26504
  *
26389
26505
  * This source code is licensed under the ISC license.
26390
26506
  * See the LICENSE file in the root directory of this source tree.
26391
26507
  */
26392
- const __iconNode$f = [
26508
+ const __iconNode$h = [
26393
26509
  [
26394
26510
  "path",
26395
26511
  {
@@ -26407,14 +26523,14 @@ const __iconNode$f = [
26407
26523
  ["path", { d: "M3 5a2 2 0 0 0 2 2h3", key: "f2jnh7" }],
26408
26524
  ["path", { d: "M3 3v13a2 2 0 0 0 2 2h3", key: "k8epm1" }]
26409
26525
  ];
26410
- const FolderTree = createLucideIcon("folder-tree", __iconNode$f);
26526
+ const FolderTree = createLucideIcon("folder-tree", __iconNode$h);
26411
26527
  /**
26412
26528
  * @license lucide-react v0.523.0 - ISC
26413
26529
  *
26414
26530
  * This source code is licensed under the ISC license.
26415
26531
  * See the LICENSE file in the root directory of this source tree.
26416
26532
  */
26417
- const __iconNode$e = [
26533
+ const __iconNode$g = [
26418
26534
  [
26419
26535
  "path",
26420
26536
  {
@@ -26424,14 +26540,14 @@ const __iconNode$e = [
26424
26540
  ],
26425
26541
  ["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
26426
26542
  ];
26427
- const Github = createLucideIcon("github", __iconNode$e);
26543
+ const Github = createLucideIcon("github", __iconNode$g);
26428
26544
  /**
26429
26545
  * @license lucide-react v0.523.0 - ISC
26430
26546
  *
26431
26547
  * This source code is licensed under the ISC license.
26432
26548
  * See the LICENSE file in the root directory of this source tree.
26433
26549
  */
26434
- const __iconNode$d = [
26550
+ const __iconNode$f = [
26435
26551
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
26436
26552
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
26437
26553
  [
@@ -26442,84 +26558,84 @@ const __iconNode$d = [
26442
26558
  }
26443
26559
  ]
26444
26560
  ];
26445
- const Hammer = createLucideIcon("hammer", __iconNode$d);
26561
+ const Hammer = createLucideIcon("hammer", __iconNode$f);
26446
26562
  /**
26447
26563
  * @license lucide-react v0.523.0 - ISC
26448
26564
  *
26449
26565
  * This source code is licensed under the ISC license.
26450
26566
  * See the LICENSE file in the root directory of this source tree.
26451
26567
  */
26452
- const __iconNode$c = [
26568
+ const __iconNode$e = [
26453
26569
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
26454
26570
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
26455
26571
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
26456
26572
  ["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
26457
26573
  ];
26458
- const Hash = createLucideIcon("hash", __iconNode$c);
26574
+ const Hash = createLucideIcon("hash", __iconNode$e);
26459
26575
  /**
26460
26576
  * @license lucide-react v0.523.0 - ISC
26461
26577
  *
26462
26578
  * This source code is licensed under the ISC license.
26463
26579
  * See the LICENSE file in the root directory of this source tree.
26464
26580
  */
26465
- const __iconNode$b = [
26581
+ const __iconNode$d = [
26466
26582
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
26467
26583
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
26468
26584
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
26469
26585
  ];
26470
- const Key = createLucideIcon("key", __iconNode$b);
26586
+ const Key = createLucideIcon("key", __iconNode$d);
26471
26587
  /**
26472
26588
  * @license lucide-react v0.523.0 - ISC
26473
26589
  *
26474
26590
  * This source code is licensed under the ISC license.
26475
26591
  * See the LICENSE file in the root directory of this source tree.
26476
26592
  */
26477
- const __iconNode$a = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
26478
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$a);
26593
+ const __iconNode$c = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
26594
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$c);
26479
26595
  /**
26480
26596
  * @license lucide-react v0.523.0 - ISC
26481
26597
  *
26482
26598
  * This source code is licensed under the ISC license.
26483
26599
  * See the LICENSE file in the root directory of this source tree.
26484
26600
  */
26485
- const __iconNode$9 = [
26601
+ const __iconNode$b = [
26486
26602
  ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }]
26487
26603
  ];
26488
- const MessageSquare = createLucideIcon("message-square", __iconNode$9);
26604
+ const MessageSquare = createLucideIcon("message-square", __iconNode$b);
26489
26605
  /**
26490
26606
  * @license lucide-react v0.523.0 - ISC
26491
26607
  *
26492
26608
  * This source code is licensed under the ISC license.
26493
26609
  * See the LICENSE file in the root directory of this source tree.
26494
26610
  */
26495
- const __iconNode$8 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
26496
- const Minus = createLucideIcon("minus", __iconNode$8);
26611
+ const __iconNode$a = [["path", { d: "M5 12h14", key: "1ays0h" }]];
26612
+ const Minus = createLucideIcon("minus", __iconNode$a);
26497
26613
  /**
26498
26614
  * @license lucide-react v0.523.0 - ISC
26499
26615
  *
26500
26616
  * This source code is licensed under the ISC license.
26501
26617
  * See the LICENSE file in the root directory of this source tree.
26502
26618
  */
26503
- const __iconNode$7 = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
26504
- const Play = createLucideIcon("play", __iconNode$7);
26619
+ const __iconNode$9 = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
26620
+ const Play = createLucideIcon("play", __iconNode$9);
26505
26621
  /**
26506
26622
  * @license lucide-react v0.523.0 - ISC
26507
26623
  *
26508
26624
  * This source code is licensed under the ISC license.
26509
26625
  * See the LICENSE file in the root directory of this source tree.
26510
26626
  */
26511
- const __iconNode$6 = [
26627
+ const __iconNode$8 = [
26512
26628
  ["path", { d: "M5 12h14", key: "1ays0h" }],
26513
26629
  ["path", { d: "M12 5v14", key: "s699le" }]
26514
26630
  ];
26515
- const Plus = createLucideIcon("plus", __iconNode$6);
26631
+ const Plus = createLucideIcon("plus", __iconNode$8);
26516
26632
  /**
26517
26633
  * @license lucide-react v0.523.0 - ISC
26518
26634
  *
26519
26635
  * This source code is licensed under the ISC license.
26520
26636
  * See the LICENSE file in the root directory of this source tree.
26521
26637
  */
26522
- const __iconNode$5 = [
26638
+ const __iconNode$7 = [
26523
26639
  ["path", { d: "M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47", key: "1krf6h" }],
26524
26640
  ["path", { d: "M8 16H3v5", key: "1cv678" }],
26525
26641
  ["path", { d: "M3 12C3 9.51 4 7.26 5.64 5.64", key: "ruvoct" }],
@@ -26528,38 +26644,38 @@ const __iconNode$5 = [
26528
26644
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
26529
26645
  ["path", { d: "M22 22 2 2", key: "1r8tn9" }]
26530
26646
  ];
26531
- const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$5);
26647
+ const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$7);
26532
26648
  /**
26533
26649
  * @license lucide-react v0.523.0 - ISC
26534
26650
  *
26535
26651
  * This source code is licensed under the ISC license.
26536
26652
  * See the LICENSE file in the root directory of this source tree.
26537
26653
  */
26538
- const __iconNode$4 = [
26654
+ const __iconNode$6 = [
26539
26655
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
26540
26656
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
26541
26657
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
26542
26658
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
26543
26659
  ];
26544
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$4);
26660
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$6);
26545
26661
  /**
26546
26662
  * @license lucide-react v0.523.0 - ISC
26547
26663
  *
26548
26664
  * This source code is licensed under the ISC license.
26549
26665
  * See the LICENSE file in the root directory of this source tree.
26550
26666
  */
26551
- const __iconNode$3 = [
26667
+ const __iconNode$5 = [
26552
26668
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
26553
26669
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
26554
26670
  ];
26555
- const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$3);
26671
+ const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$5);
26556
26672
  /**
26557
26673
  * @license lucide-react v0.523.0 - ISC
26558
26674
  *
26559
26675
  * This source code is licensed under the ISC license.
26560
26676
  * See the LICENSE file in the root directory of this source tree.
26561
26677
  */
26562
- const __iconNode$2 = [
26678
+ const __iconNode$4 = [
26563
26679
  [
26564
26680
  "path",
26565
26681
  {
@@ -26570,14 +26686,25 @@ const __iconNode$2 = [
26570
26686
  ["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
26571
26687
  ["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
26572
26688
  ];
26573
- const Save = createLucideIcon("save", __iconNode$2);
26689
+ const Save = createLucideIcon("save", __iconNode$4);
26574
26690
  /**
26575
26691
  * @license lucide-react v0.523.0 - ISC
26576
26692
  *
26577
26693
  * This source code is licensed under the ISC license.
26578
26694
  * See the LICENSE file in the root directory of this source tree.
26579
26695
  */
26580
- const __iconNode$1 = [
26696
+ const __iconNode$3 = [
26697
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
26698
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
26699
+ ];
26700
+ const Search = createLucideIcon("search", __iconNode$3);
26701
+ /**
26702
+ * @license lucide-react v0.523.0 - ISC
26703
+ *
26704
+ * This source code is licensed under the ISC license.
26705
+ * See the LICENSE file in the root directory of this source tree.
26706
+ */
26707
+ const __iconNode$2 = [
26581
26708
  [
26582
26709
  "path",
26583
26710
  {
@@ -26587,14 +26714,14 @@ const __iconNode$1 = [
26587
26714
  ],
26588
26715
  ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
26589
26716
  ];
26590
- const Send = createLucideIcon("send", __iconNode$1);
26717
+ const Send = createLucideIcon("send", __iconNode$2);
26591
26718
  /**
26592
26719
  * @license lucide-react v0.523.0 - ISC
26593
26720
  *
26594
26721
  * This source code is licensed under the ISC license.
26595
26722
  * See the LICENSE file in the root directory of this source tree.
26596
26723
  */
26597
- const __iconNode = [
26724
+ const __iconNode$1 = [
26598
26725
  [
26599
26726
  "path",
26600
26727
  {
@@ -26604,7 +26731,21 @@ const __iconNode = [
26604
26731
  ],
26605
26732
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
26606
26733
  ];
26607
- const Settings = createLucideIcon("settings", __iconNode);
26734
+ const Settings = createLucideIcon("settings", __iconNode$1);
26735
+ /**
26736
+ * @license lucide-react v0.523.0 - ISC
26737
+ *
26738
+ * This source code is licensed under the ISC license.
26739
+ * See the LICENSE file in the root directory of this source tree.
26740
+ */
26741
+ const __iconNode = [
26742
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
26743
+ ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
26744
+ ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
26745
+ ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
26746
+ ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
26747
+ ];
26748
+ const Trash2 = createLucideIcon("trash-2", __iconNode);
26608
26749
  const OAuthStepDetails = ({
26609
26750
  label,
26610
26751
  isComplete,
@@ -27214,30 +27355,34 @@ function updateObject(obj, path, value) {
27214
27355
  }
27215
27356
  return newObj;
27216
27357
  }
27358
+ function useCopy({ timeout = 500 } = {}) {
27359
+ const [copied, setCopied] = reactExports.useState(false);
27360
+ reactExports.useEffect(() => {
27361
+ let timeoutId;
27362
+ if (copied) {
27363
+ timeoutId = setTimeout(() => {
27364
+ setCopied(false);
27365
+ }, timeout);
27366
+ }
27367
+ return () => {
27368
+ if (timeoutId) {
27369
+ clearTimeout(timeoutId);
27370
+ }
27371
+ };
27372
+ }, [copied]);
27373
+ return { copied, setCopied };
27374
+ }
27217
27375
  const JsonView = reactExports.memo(
27218
27376
  ({
27219
27377
  data: data2,
27220
- name,
27378
+ name: name2,
27221
27379
  initialExpandDepth = 3,
27222
27380
  className,
27223
27381
  withCopyButton = true,
27224
27382
  isError = false
27225
27383
  }) => {
27226
27384
  const { toast: toast2 } = useToast();
27227
- const [copied, setCopied] = reactExports.useState(false);
27228
- reactExports.useEffect(() => {
27229
- let timeoutId;
27230
- if (copied) {
27231
- timeoutId = setTimeout(() => {
27232
- setCopied(false);
27233
- }, 500);
27234
- }
27235
- return () => {
27236
- if (timeoutId) {
27237
- clearTimeout(timeoutId);
27238
- }
27239
- };
27240
- }, [copied]);
27385
+ const { copied, setCopied } = useCopy();
27241
27386
  const normalizedData = reactExports.useMemo(() => {
27242
27387
  return typeof data2 === "string" ? tryParseJson(data2).success ? tryParseJson(data2).data : data2 : data2;
27243
27388
  }, [data2]);
@@ -27270,7 +27415,7 @@ const JsonView = reactExports.memo(
27270
27415
  JsonNode,
27271
27416
  {
27272
27417
  data: normalizedData,
27273
- name,
27418
+ name: name2,
27274
27419
  depth: 0,
27275
27420
  initialExpandDepth,
27276
27421
  isError
@@ -27283,7 +27428,7 @@ JsonView.displayName = "JsonView";
27283
27428
  const JsonNode = reactExports.memo(
27284
27429
  ({
27285
27430
  data: data2,
27286
- name,
27431
+ name: name2,
27287
27432
  depth = 0,
27288
27433
  initialExpandDepth,
27289
27434
  isError = false
@@ -27311,8 +27456,8 @@ const JsonNode = reactExports.memo(
27311
27456
  };
27312
27457
  if (isEmpty) {
27313
27458
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
27314
- name && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27315
- name,
27459
+ name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27460
+ name2,
27316
27461
  ":"
27317
27462
  ] }),
27318
27463
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-500", children: symbolMap.empty })
@@ -27325,8 +27470,8 @@ const JsonNode = reactExports.memo(
27325
27470
  className: "flex items-center mr-1 rounded cursor-pointer group hover:bg-gray-800/10 dark:hover:bg-gray-800/20",
27326
27471
  onClick: () => setIsExpanded(!isExpanded),
27327
27472
  children: [
27328
- name && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
27329
- name,
27473
+ name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
27474
+ name2,
27330
27475
  ":"
27331
27476
  ] }),
27332
27477
  isExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: symbolMap.open }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -27367,8 +27512,8 @@ const JsonNode = reactExports.memo(
27367
27512
  const isTooLong = value.length > maxLength;
27368
27513
  if (!isTooLong) {
27369
27514
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded hover:bg-gray-800/20", children: [
27370
- name && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27371
- name,
27515
+ name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27516
+ name2,
27372
27517
  ":"
27373
27518
  ] }),
27374
27519
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -27388,8 +27533,8 @@ const JsonNode = reactExports.memo(
27388
27533
  ] });
27389
27534
  }
27390
27535
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex mr-1 rounded group hover:bg-gray-800/20", children: [
27391
- name && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
27392
- name,
27536
+ name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400 dark:group-hover:text-gray-100 group-hover:text-gray-400", children: [
27537
+ name2,
27393
27538
  ":"
27394
27539
  ] }),
27395
27540
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -27414,8 +27559,8 @@ const JsonNode = reactExports.memo(
27414
27559
  return renderString(data2);
27415
27560
  default:
27416
27561
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mr-1 rounded hover:bg-gray-800/20", children: [
27417
- name && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27418
- name,
27562
+ name2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-1 text-gray-600 dark:text-gray-400", children: [
27563
+ name2,
27419
27564
  ":"
27420
27565
  ] }),
27421
27566
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: typeStyleMap[dataType] || typeStyleMap.default, children: data2 === null ? "null" : String(data2) })
@@ -28439,8 +28584,8 @@ function RemoveScrollSideCar(props) {
28439
28584
  }
28440
28585
  }
28441
28586
  }, []);
28442
- var shouldCancel = reactExports.useCallback(function(name, delta, target, should) {
28443
- var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
28587
+ var shouldCancel = reactExports.useCallback(function(name2, delta, target, should) {
28588
+ var event = { name: name2, delta, target, should, shadowParent: getOutermostShadowParent(target) };
28444
28589
  shouldPreventQueue.current.push(event);
28445
28590
  setTimeout(function() {
28446
28591
  shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
@@ -28621,7 +28766,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
28621
28766
  return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
28622
28767
  };
28623
28768
  var DIALOG_NAME = "Dialog";
28624
- var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
28769
+ var [createDialogContext] = createContextScope(DIALOG_NAME);
28625
28770
  var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
28626
28771
  var Dialog = (props) => {
28627
28772
  const {
@@ -28671,7 +28816,7 @@ var DialogTrigger = reactExports.forwardRef(
28671
28816
  "aria-haspopup": "dialog",
28672
28817
  "aria-expanded": context.open,
28673
28818
  "aria-controls": context.contentId,
28674
- "data-state": getState$2(context.open),
28819
+ "data-state": getState$3(context.open),
28675
28820
  ...triggerProps,
28676
28821
  ref: composedTriggerRef,
28677
28822
  onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
@@ -28711,7 +28856,7 @@ var DialogOverlayImpl = reactExports.forwardRef(
28711
28856
  /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot$2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
28712
28857
  Primitive.div,
28713
28858
  {
28714
- "data-state": getState$2(context.open),
28859
+ "data-state": getState$3(context.open),
28715
28860
  ...overlayProps,
28716
28861
  ref: forwardedRef,
28717
28862
  style: { pointerEvents: "auto", ...overlayProps.style }
@@ -28830,7 +28975,7 @@ var DialogContentImpl = reactExports.forwardRef(
28830
28975
  id: context.contentId,
28831
28976
  "aria-describedby": context.descriptionId,
28832
28977
  "aria-labelledby": context.titleId,
28833
- "data-state": getState$2(context.open),
28978
+ "data-state": getState$3(context.open),
28834
28979
  ...contentProps,
28835
28980
  ref: composedRefs,
28836
28981
  onDismiss: () => context.onOpenChange(false)
@@ -28880,7 +29025,7 @@ var DialogClose = reactExports.forwardRef(
28880
29025
  }
28881
29026
  );
28882
29027
  DialogClose.displayName = CLOSE_NAME$1;
28883
- function getState$2(open) {
29028
+ function getState$3(open) {
28884
29029
  return open ? "open" : "closed";
28885
29030
  }
28886
29031
  var TITLE_WARNING_NAME = "DialogTitleWarning";
@@ -28918,7 +29063,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
28918
29063
  }, [MESSAGE, contentRef, descriptionId]);
28919
29064
  return null;
28920
29065
  };
28921
- var Root$2 = Dialog;
29066
+ var Root$3 = Dialog;
28922
29067
  var Portal$2 = DialogPortal$1;
28923
29068
  var Overlay = DialogOverlay$1;
28924
29069
  var Content$1 = DialogContent$1;
@@ -29153,7 +29298,7 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
29153
29298
  }, []), reactExports.createElement(Primitive.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B(r2, (m2) => reactExports.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
29154
29299
  }), xe = reactExports.forwardRef((r2, o) => {
29155
29300
  let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r2;
29156
- return reactExports.createElement(Root$2, { open: n, onOpenChange: u2 }, reactExports.createElement(Portal$2, { container: f }, reactExports.createElement(Overlay, { "cmdk-overlay": "", className: c }), reactExports.createElement(Content$1, { "aria-label": r2.label, "cmdk-dialog": "", className: d }, reactExports.createElement(me, { ref: o, ...p2 }))));
29301
+ return reactExports.createElement(Root$3, { open: n, onOpenChange: u2 }, reactExports.createElement(Portal$2, { container: f }, reactExports.createElement(Overlay, { "cmdk-overlay": "", className: c }), reactExports.createElement(Content$1, { "aria-label": r2.label, "cmdk-dialog": "", className: d }, reactExports.createElement(me, { ref: o, ...p2 }))));
29157
29302
  }), Ie = reactExports.forwardRef((r2, o) => P((u2) => u2.filtered.count === 0) ? reactExports.createElement(Primitive.div, { ref: o, ...r2, "cmdk-empty": "", role: "presentation" }) : null), Pe = reactExports.forwardRef((r2, o) => {
29158
29303
  let { progress: n, children: u2, label: c = "Loading...", ...d } = r2;
29159
29304
  return reactExports.createElement(Primitive.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B(r2, (f) => reactExports.createElement("div", { "aria-hidden": true }, f)));
@@ -29559,7 +29704,7 @@ const computePosition$1 = async (reference, floating, config) => {
29559
29704
  let resetCount = 0;
29560
29705
  for (let i = 0; i < validMiddleware.length; i++) {
29561
29706
  const {
29562
- name,
29707
+ name: name2,
29563
29708
  fn
29564
29709
  } = validMiddleware[i];
29565
29710
  const {
@@ -29585,8 +29730,8 @@ const computePosition$1 = async (reference, floating, config) => {
29585
29730
  y = nextY != null ? nextY : y;
29586
29731
  middlewareData = {
29587
29732
  ...middlewareData,
29588
- [name]: {
29589
- ...middlewareData[name],
29733
+ [name2]: {
29734
+ ...middlewareData[name2],
29590
29735
  ...data2
29591
29736
  }
29592
29737
  };
@@ -31245,7 +31390,7 @@ var Arrow$1 = reactExports.forwardRef((props, forwardedRef) => {
31245
31390
  );
31246
31391
  });
31247
31392
  Arrow$1.displayName = NAME$1;
31248
- var Root$1 = Arrow$1;
31393
+ var Root$2 = Arrow$1;
31249
31394
  function useSize(element) {
31250
31395
  const [size2, setSize] = reactExports.useState(void 0);
31251
31396
  useLayoutEffect2(() => {
@@ -31492,7 +31637,7 @@ var PopperArrow = reactExports.forwardRef(function PopperArrow2(props, forwarded
31492
31637
  visibility: contentContext.shouldHideArrow ? "hidden" : void 0
31493
31638
  },
31494
31639
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31495
- Root$1,
31640
+ Root$2,
31496
31641
  {
31497
31642
  ...arrowProps,
31498
31643
  ref: forwardedRef,
@@ -31552,7 +31697,7 @@ var Anchor = PopperAnchor;
31552
31697
  var Content = PopperContent;
31553
31698
  var Arrow = PopperArrow;
31554
31699
  var POPOVER_NAME = "Popover";
31555
- var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
31700
+ var [createPopoverContext] = createContextScope(POPOVER_NAME, [
31556
31701
  createPopperScope
31557
31702
  ]);
31558
31703
  var usePopperScope$2 = createPopperScope();
@@ -31622,7 +31767,7 @@ var PopoverTrigger$1 = reactExports.forwardRef(
31622
31767
  "aria-haspopup": "dialog",
31623
31768
  "aria-expanded": context.open,
31624
31769
  "aria-controls": context.contentId,
31625
- "data-state": getState$1(context.open),
31770
+ "data-state": getState$2(context.open),
31626
31771
  ...triggerProps,
31627
31772
  ref: composedTriggerRef,
31628
31773
  onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
@@ -31774,7 +31919,7 @@ var PopoverContentImpl = reactExports.forwardRef(
31774
31919
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31775
31920
  Content,
31776
31921
  {
31777
- "data-state": getState$1(context.open),
31922
+ "data-state": getState$2(context.open),
31778
31923
  role: "dialog",
31779
31924
  id: context.contentId,
31780
31925
  ...popperScope,
@@ -31825,7 +31970,7 @@ var PopoverArrow = reactExports.forwardRef(
31825
31970
  }
31826
31971
  );
31827
31972
  PopoverArrow.displayName = ARROW_NAME$2;
31828
- function getState$1(open) {
31973
+ function getState$2(open) {
31829
31974
  return open ? "open" : "closed";
31830
31975
  }
31831
31976
  var Root2$1 = Popover$1;
@@ -31937,19 +32082,36 @@ var Label$2 = reactExports.forwardRef((props, forwardedRef) => {
31937
32082
  );
31938
32083
  });
31939
32084
  Label$2.displayName = NAME;
31940
- var Root = Label$2;
32085
+ var Root$1 = Label$2;
31941
32086
  const labelVariants = cva(
31942
32087
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
31943
32088
  );
31944
32089
  const Label$1 = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31945
- Root,
32090
+ Root$1,
31946
32091
  {
31947
32092
  ref: ref2,
31948
32093
  className: cn(labelVariants(), className),
31949
32094
  ...props
31950
32095
  }
31951
32096
  ));
31952
- Label$1.displayName = Root.displayName;
32097
+ Label$1.displayName = Root$1.displayName;
32098
+ const Input = reactExports.forwardRef(
32099
+ ({ className, type: type2, ...props }, ref2) => {
32100
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
32101
+ "input",
32102
+ {
32103
+ type: type2,
32104
+ className: cn(
32105
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
32106
+ className
32107
+ ),
32108
+ ref: ref2,
32109
+ ...props
32110
+ }
32111
+ );
32112
+ }
32113
+ );
32114
+ Input.displayName = "Input";
31953
32115
  const ListPane = ({
31954
32116
  items: items2,
31955
32117
  listItems,
@@ -31959,40 +32121,101 @@ const ListPane = ({
31959
32121
  title: title2,
31960
32122
  buttonText,
31961
32123
  isButtonDisabled
31962
- }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-lg shadow", children: [
31963
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-border", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white", children: title2 }) }),
31964
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
31965
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31966
- Button,
31967
- {
31968
- variant: "outline",
31969
- className: "w-full mb-4",
31970
- onClick: listItems,
31971
- disabled: isButtonDisabled,
31972
- children: buttonText
31973
- }
31974
- ),
31975
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31976
- Button,
31977
- {
31978
- variant: "outline",
31979
- className: "w-full mb-4",
31980
- onClick: clearItems,
31981
- disabled: items2.length === 0,
31982
- children: "Clear"
31983
- }
31984
- ),
31985
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 overflow-y-auto max-h-96", children: items2.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
31986
- "div",
31987
- {
31988
- className: "flex items-center py-2 px-4 rounded hover:bg-gray-50 dark:hover:bg-secondary cursor-pointer",
31989
- onClick: () => setSelectedItem(item),
31990
- children: renderItem(item)
31991
- },
31992
- index2
31993
- )) })
31994
- ] })
31995
- ] });
32124
+ }) => {
32125
+ const [searchQuery, setSearchQuery] = reactExports.useState("");
32126
+ const [isSearchExpanded, setIsSearchExpanded] = reactExports.useState(false);
32127
+ const searchInputRef = reactExports.useRef(null);
32128
+ const filteredItems = reactExports.useMemo(() => {
32129
+ if (!searchQuery.trim()) return items2;
32130
+ return items2.filter((item) => {
32131
+ const searchableText = [
32132
+ item.name || "",
32133
+ item.description || ""
32134
+ ].join(" ").toLowerCase();
32135
+ return searchableText.includes(searchQuery.toLowerCase());
32136
+ });
32137
+ }, [items2, searchQuery]);
32138
+ const handleSearchClick = () => {
32139
+ setIsSearchExpanded(true);
32140
+ setTimeout(() => {
32141
+ var _a;
32142
+ (_a = searchInputRef.current) == null ? void 0 : _a.focus();
32143
+ }, 100);
32144
+ };
32145
+ const handleSearchBlur = () => {
32146
+ if (!searchQuery.trim()) {
32147
+ setIsSearchExpanded(false);
32148
+ }
32149
+ };
32150
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-lg shadow", children: [
32151
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-border", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
32152
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold dark:text-white flex-shrink-0", children: title2 }),
32153
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-end min-w-0 flex-1", children: !isSearchExpanded ? /* @__PURE__ */ jsxRuntimeExports.jsx(
32154
+ "button",
32155
+ {
32156
+ name: "search",
32157
+ "aria-label": "Search",
32158
+ onClick: handleSearchClick,
32159
+ className: "p-2 hover:bg-gray-100 dark:hover:bg-secondary rounded-md transition-all duration-300 ease-in-out",
32160
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "w-4 h-4 text-muted-foreground" })
32161
+ }
32162
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center w-full max-w-xs", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-full", children: [
32163
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none z-10" }),
32164
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
32165
+ Input,
32166
+ {
32167
+ ref: searchInputRef,
32168
+ name: "search",
32169
+ type: "text",
32170
+ placeholder: "Search...",
32171
+ value: searchQuery,
32172
+ onChange: (e) => setSearchQuery(e.target.value),
32173
+ onBlur: handleSearchBlur,
32174
+ className: "pl-10 w-full transition-all duration-300 ease-in-out"
32175
+ }
32176
+ )
32177
+ ] }) }) })
32178
+ ] }) }),
32179
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
32180
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
32181
+ Button,
32182
+ {
32183
+ variant: "outline",
32184
+ className: "w-full mb-4",
32185
+ onClick: listItems,
32186
+ disabled: isButtonDisabled,
32187
+ children: buttonText
32188
+ }
32189
+ ),
32190
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
32191
+ Button,
32192
+ {
32193
+ variant: "outline",
32194
+ className: "w-full mb-4",
32195
+ onClick: clearItems,
32196
+ disabled: items2.length === 0,
32197
+ children: "Clear"
32198
+ }
32199
+ ),
32200
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 overflow-y-auto max-h-96", children: [
32201
+ filteredItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
32202
+ "div",
32203
+ {
32204
+ className: "flex items-center py-2 px-4 rounded hover:bg-gray-50 dark:hover:bg-secondary cursor-pointer",
32205
+ onClick: () => setSelectedItem(item),
32206
+ children: renderItem(item)
32207
+ },
32208
+ index2
32209
+ )),
32210
+ filteredItems.length === 0 && searchQuery && items2.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-4 text-muted-foreground", children: [
32211
+ 'No items found matching "',
32212
+ searchQuery,
32213
+ '"'
32214
+ ] })
32215
+ ] })
32216
+ ] })
32217
+ ] });
32218
+ };
31996
32219
  function debounce(func, wait) {
31997
32220
  let timeout;
31998
32221
  return (...args) => {
@@ -32228,11 +32451,11 @@ class UriTemplate {
32228
32451
  const operator = this.getOperator(expr);
32229
32452
  const exploded = expr.includes("*");
32230
32453
  const names = this.getNames(expr);
32231
- const name = names[0];
32232
- for (const name2 of names) {
32233
- UriTemplate.validateLength(name2, MAX_VARIABLE_LENGTH, "Variable name");
32454
+ const name2 = names[0];
32455
+ for (const name3 of names) {
32456
+ UriTemplate.validateLength(name3, MAX_VARIABLE_LENGTH, "Variable name");
32234
32457
  }
32235
- parts.push({ name, operator, names, exploded });
32458
+ parts.push({ name: name2, operator, names, exploded });
32236
32459
  i = end + 1;
32237
32460
  } else {
32238
32461
  currentText += template[i];
@@ -32250,7 +32473,7 @@ class UriTemplate {
32250
32473
  }
32251
32474
  getNames(expr) {
32252
32475
  const operator = this.getOperator(expr);
32253
- return expr.slice(operator.length).split(",").map((name) => name.replace("*", "").trim()).filter((name) => name.length > 0);
32476
+ return expr.slice(operator.length).split(",").map((name2) => name2.replace("*", "").trim()).filter((name2) => name2.length > 0);
32254
32477
  }
32255
32478
  encodeValue(value, operator) {
32256
32479
  UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, "Variable value");
@@ -32261,12 +32484,12 @@ class UriTemplate {
32261
32484
  }
32262
32485
  expandPart(part, variables) {
32263
32486
  if (part.operator === "?" || part.operator === "&") {
32264
- const pairs = part.names.map((name) => {
32265
- const value2 = variables[name];
32487
+ const pairs = part.names.map((name2) => {
32488
+ const value2 = variables[name2];
32266
32489
  if (value2 === void 0)
32267
32490
  return "";
32268
32491
  const encoded2 = Array.isArray(value2) ? value2.map((v) => this.encodeValue(v, part.operator)).join(",") : this.encodeValue(value2.toString(), part.operator);
32269
- return `${name}=${encoded2}`;
32492
+ return `${name2}=${encoded2}`;
32270
32493
  }).filter((pair) => pair.length > 0);
32271
32494
  if (pairs.length === 0)
32272
32495
  return "";
@@ -32274,7 +32497,7 @@ class UriTemplate {
32274
32497
  return separator + pairs.join("&");
32275
32498
  }
32276
32499
  if (part.names.length > 1) {
32277
- const values2 = part.names.map((name) => variables[name]).filter((v) => v !== void 0);
32500
+ const values2 = part.names.map((name2) => variables[name2]).filter((v) => v !== void 0);
32278
32501
  if (values2.length === 0)
32279
32502
  return "";
32280
32503
  return values2.map((v) => Array.isArray(v) ? v[0] : v).join(",");
@@ -32326,22 +32549,22 @@ class UriTemplate {
32326
32549
  }
32327
32550
  partToRegExp(part) {
32328
32551
  const patterns = [];
32329
- for (const name2 of part.names) {
32330
- UriTemplate.validateLength(name2, MAX_VARIABLE_LENGTH, "Variable name");
32552
+ for (const name3 of part.names) {
32553
+ UriTemplate.validateLength(name3, MAX_VARIABLE_LENGTH, "Variable name");
32331
32554
  }
32332
32555
  if (part.operator === "?" || part.operator === "&") {
32333
32556
  for (let i = 0; i < part.names.length; i++) {
32334
- const name2 = part.names[i];
32557
+ const name3 = part.names[i];
32335
32558
  const prefix = i === 0 ? "\\" + part.operator : "&";
32336
32559
  patterns.push({
32337
- pattern: prefix + this.escapeRegExp(name2) + "=([^&]+)",
32338
- name: name2
32560
+ pattern: prefix + this.escapeRegExp(name3) + "=([^&]+)",
32561
+ name: name3
32339
32562
  });
32340
32563
  }
32341
32564
  return patterns;
32342
32565
  }
32343
32566
  let pattern2;
32344
- const name = part.name;
32567
+ const name2 = part.name;
32345
32568
  switch (part.operator) {
32346
32569
  case "":
32347
32570
  pattern2 = part.exploded ? "([^/]+(?:,[^/]+)*)" : "([^/,]+)";
@@ -32359,7 +32582,7 @@ class UriTemplate {
32359
32582
  default:
32360
32583
  pattern2 = "([^/]+)";
32361
32584
  }
32362
- patterns.push({ pattern: pattern2, name });
32585
+ patterns.push({ pattern: pattern2, name: name2 });
32363
32586
  return patterns;
32364
32587
  }
32365
32588
  match(uri) {
@@ -32371,9 +32594,9 @@ class UriTemplate {
32371
32594
  pattern2 += this.escapeRegExp(part);
32372
32595
  } else {
32373
32596
  const patterns = this.partToRegExp(part);
32374
- for (const { pattern: partPattern, name } of patterns) {
32597
+ for (const { pattern: partPattern, name: name2 } of patterns) {
32375
32598
  pattern2 += partPattern;
32376
- names.push({ name, exploded: part.exploded });
32599
+ names.push({ name: name2, exploded: part.exploded });
32377
32600
  }
32378
32601
  }
32379
32602
  }
@@ -32385,9 +32608,9 @@ class UriTemplate {
32385
32608
  return null;
32386
32609
  const result = {};
32387
32610
  for (let i = 0; i < names.length; i++) {
32388
- const { name, exploded } = names[i];
32611
+ const { name: name2, exploded } = names[i];
32389
32612
  const value = match[i + 1];
32390
- const cleanName = name.replace("*", "");
32613
+ const cleanName = name2.replace("*", "");
32391
32614
  if (exploded && value.includes(",")) {
32392
32615
  result[cleanName] = value.split(",");
32393
32616
  } else {
@@ -32590,23 +32813,6 @@ const ResourcesTab = ({
32590
32813
  ] })
32591
32814
  ] }) });
32592
32815
  };
32593
- const Input = reactExports.forwardRef(
32594
- ({ className, type: type2, ...props }, ref2) => {
32595
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
32596
- "input",
32597
- {
32598
- type: type2,
32599
- className: cn(
32600
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
32601
- className
32602
- ),
32603
- ref: ref2,
32604
- ...props
32605
- }
32606
- );
32607
- }
32608
- );
32609
- Input.displayName = "Input";
32610
32816
  const RootsTab = ({
32611
32817
  roots,
32612
32818
  setRoots,
@@ -32735,7 +32941,7 @@ function requireLib() {
32735
32941
  "\n/**\n * Reset the text fill color so that placeholder is visible\n */\n.".concat(className, ":empty {\n -webkit-text-fill-color: inherit !important;\n}\n\n/**\n * Hack to apply on some CSS on IE10 and IE11\n */\n@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n /**\n * IE doesn't support '-webkit-text-fill-color'\n * So we use 'color: transparent' to make the text transparent on IE\n * Unlike other browsers, it doesn't affect caret color in IE\n */\n .").concat(className, " {\n color: transparent !important;\n }\n\n .").concat(className, "::selection {\n background-color: #accef7 !important;\n color: transparent !important;\n }\n}\n")
32736
32942
  );
32737
32943
  var Editor2 = React2.forwardRef(function Editor3(props, ref2) {
32738
- var autoFocus = props.autoFocus, disabled = props.disabled, form = props.form, highlight = props.highlight, _a = props.ignoreTabKey, ignoreTabKey = _a === void 0 ? false : _a, _b = props.insertSpaces, insertSpaces = _b === void 0 ? true : _b, maxLength = props.maxLength, minLength = props.minLength, name = props.name, onBlur = props.onBlur, onClick = props.onClick, onFocus = props.onFocus, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, onValueChange = props.onValueChange, _c = props.padding, padding = _c === void 0 ? 0 : _c, placeholder = props.placeholder, preClassName = props.preClassName, readOnly = props.readOnly, required2 = props.required, style = props.style, _d = props.tabSize, tabSize = _d === void 0 ? 2 : _d, textareaClassName = props.textareaClassName, textareaId = props.textareaId, value = props.value, rest = __rest2(props, ["autoFocus", "disabled", "form", "highlight", "ignoreTabKey", "insertSpaces", "maxLength", "minLength", "name", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onValueChange", "padding", "placeholder", "preClassName", "readOnly", "required", "style", "tabSize", "textareaClassName", "textareaId", "value"]);
32944
+ var autoFocus = props.autoFocus, disabled = props.disabled, form = props.form, highlight = props.highlight, _a = props.ignoreTabKey, ignoreTabKey = _a === void 0 ? false : _a, _b = props.insertSpaces, insertSpaces = _b === void 0 ? true : _b, maxLength = props.maxLength, minLength = props.minLength, name2 = props.name, onBlur = props.onBlur, onClick = props.onClick, onFocus = props.onFocus, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, onValueChange = props.onValueChange, _c = props.padding, padding = _c === void 0 ? 0 : _c, placeholder = props.placeholder, preClassName = props.preClassName, readOnly = props.readOnly, required2 = props.required, style = props.style, _d = props.tabSize, tabSize = _d === void 0 ? 2 : _d, textareaClassName = props.textareaClassName, textareaId = props.textareaId, value = props.value, rest = __rest2(props, ["autoFocus", "disabled", "form", "highlight", "ignoreTabKey", "insertSpaces", "maxLength", "minLength", "name", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onValueChange", "padding", "placeholder", "preClassName", "readOnly", "required", "style", "tabSize", "textareaClassName", "textareaId", "value"]);
32739
32945
  var historyRef = React2.useRef({
32740
32946
  stack: [],
32741
32947
  offset: -1
@@ -33008,7 +33214,7 @@ function requireLib() {
33008
33214
  React2.createElement("pre", __assign2({ className: preClassName, "aria-hidden": "true", style: __assign2(__assign2(__assign2({}, styles.editor), styles.highlight), contentStyle) }, typeof highlighted === "string" ? { dangerouslySetInnerHTML: { __html: highlighted + "<br />" } } : { children: highlighted })),
33009
33215
  React2.createElement("textarea", { ref: function(c) {
33010
33216
  return inputRef.current = c;
33011
- }, style: __assign2(__assign2(__assign2({}, styles.editor), styles.textarea), contentStyle), className: className + (textareaClassName ? " ".concat(textareaClassName) : ""), id: textareaId, value, onChange: handleChange, onKeyDown: handleKeyDown, onClick, onKeyUp, onFocus, onBlur, disabled, form, maxLength, minLength, name, placeholder, readOnly, required: required2, autoFocus, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", spellCheck: false, "data-gramm": false }),
33217
+ }, style: __assign2(__assign2(__assign2({}, styles.editor), styles.textarea), contentStyle), className: className + (textareaClassName ? " ".concat(textareaClassName) : ""), id: textareaId, value, onChange: handleChange, onKeyDown: handleKeyDown, onClick, onKeyUp, onFocus, onBlur, disabled, form, maxLength, minLength, name: name2, placeholder, readOnly, required: required2, autoFocus, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", spellCheck: false, "data-gramm": false }),
33012
33218
  React2.createElement("style", { dangerouslySetInnerHTML: { __html: cssText } })
33013
33219
  );
33014
33220
  });
@@ -33712,10 +33918,10 @@ function requirePrism() {
33712
33918
  * @param {HookCallback} callback The callback function which is given environment variables.
33713
33919
  * @public
33714
33920
  */
33715
- add: function(name, callback) {
33921
+ add: function(name2, callback) {
33716
33922
  var hooks = _.hooks.all;
33717
- hooks[name] = hooks[name] || [];
33718
- hooks[name].push(callback);
33923
+ hooks[name2] = hooks[name2] || [];
33924
+ hooks[name2].push(callback);
33719
33925
  },
33720
33926
  /**
33721
33927
  * Runs a hook invoking all registered callbacks with the given environment variables.
@@ -33726,8 +33932,8 @@ function requirePrism() {
33726
33932
  * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
33727
33933
  * @public
33728
33934
  */
33729
- run: function(name, env) {
33730
- var callbacks = _.hooks.all[name];
33935
+ run: function(name2, env) {
33936
+ var callbacks = _.hooks.all[name2];
33731
33937
  if (!callbacks || !callbacks.length) {
33732
33938
  return;
33733
33939
  }
@@ -33774,8 +33980,8 @@ function requirePrism() {
33774
33980
  }
33775
33981
  _.hooks.run("wrap", env);
33776
33982
  var attributes = "";
33777
- for (var name in env.attributes) {
33778
- attributes += " " + name + '="' + (env.attributes[name] || "").replace(/"/g, "&quot;") + '"';
33983
+ for (var name2 in env.attributes) {
33984
+ attributes += " " + name2 + '="' + (env.attributes[name2] || "").replace(/"/g, "&quot;") + '"';
33779
33985
  }
33780
33986
  return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + "</" + env.tag + ">";
33781
33987
  };
@@ -34636,259 +34842,391 @@ const getArrayItemDefault = (schema) => {
34636
34842
  return null;
34637
34843
  }
34638
34844
  };
34639
- const DynamicJsonForm = ({
34640
- schema,
34641
- value,
34642
- onChange,
34643
- maxDepth = 3
34644
- }) => {
34645
- const isOnlyJSON = !isSimpleObject(schema);
34646
- const [isJsonMode, setIsJsonMode] = reactExports.useState(isOnlyJSON);
34647
- const [jsonError, setJsonError] = reactExports.useState();
34648
- const [copiedJson, setCopiedJson] = reactExports.useState(false);
34649
- const { toast: toast2 } = useToast();
34650
- const [rawJsonValue, setRawJsonValue] = reactExports.useState(
34651
- JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
34652
- );
34653
- const timeoutRef = reactExports.useRef();
34654
- const debouncedUpdateParent = reactExports.useCallback(
34655
- (jsonString) => {
34656
- if (timeoutRef.current) {
34657
- clearTimeout(timeoutRef.current);
34845
+ const DynamicJsonForm = reactExports.forwardRef(
34846
+ ({ schema, value, onChange, maxDepth = 3 }, ref2) => {
34847
+ const isOnlyJSON = !isSimpleObject(schema);
34848
+ const [isJsonMode, setIsJsonMode] = reactExports.useState(isOnlyJSON);
34849
+ const [jsonError, setJsonError] = reactExports.useState();
34850
+ const [copiedJson, setCopiedJson] = reactExports.useState(false);
34851
+ const { toast: toast2 } = useToast();
34852
+ const [rawJsonValue, setRawJsonValue] = reactExports.useState(
34853
+ JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
34854
+ );
34855
+ const timeoutRef = reactExports.useRef();
34856
+ const debouncedUpdateParent = reactExports.useCallback(
34857
+ (jsonString) => {
34858
+ if (timeoutRef.current) {
34859
+ clearTimeout(timeoutRef.current);
34860
+ }
34861
+ timeoutRef.current = setTimeout(() => {
34862
+ try {
34863
+ const parsed = JSON.parse(jsonString);
34864
+ onChange(parsed);
34865
+ setJsonError(void 0);
34866
+ } catch (err) {
34867
+ const errorMessage = err instanceof Error ? err.message : "Invalid JSON";
34868
+ setJsonError(errorMessage);
34869
+ const trimmed = jsonString.trim();
34870
+ if (trimmed.length > 5 && !trimmed.match(/^[\s[{]/)) {
34871
+ onChange(generateDefaultValue(schema));
34872
+ }
34873
+ }
34874
+ }, 300);
34875
+ },
34876
+ [onChange, setJsonError, schema]
34877
+ );
34878
+ reactExports.useEffect(() => {
34879
+ if (!isJsonMode) {
34880
+ setRawJsonValue(
34881
+ JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
34882
+ );
34658
34883
  }
34659
- timeoutRef.current = setTimeout(() => {
34884
+ }, [value, schema, isJsonMode]);
34885
+ const handleSwitchToFormMode = () => {
34886
+ if (isJsonMode) {
34660
34887
  try {
34661
- const parsed = JSON.parse(jsonString);
34888
+ const parsed = JSON.parse(rawJsonValue);
34662
34889
  onChange(parsed);
34663
- setJsonError(void 0);
34664
- } catch {
34890
+ setIsJsonMode(false);
34891
+ } catch (err) {
34892
+ setJsonError(err instanceof Error ? err.message : "Invalid JSON");
34665
34893
  }
34666
- }, 300);
34667
- },
34668
- [onChange, setJsonError]
34669
- );
34670
- reactExports.useEffect(() => {
34671
- if (!isJsonMode) {
34672
- setRawJsonValue(
34673
- JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
34674
- );
34675
- }
34676
- }, [value, schema, isJsonMode]);
34677
- const handleSwitchToFormMode = () => {
34678
- if (isJsonMode) {
34894
+ } else {
34895
+ setRawJsonValue(
34896
+ JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
34897
+ );
34898
+ setIsJsonMode(true);
34899
+ }
34900
+ };
34901
+ const formatJson = () => {
34679
34902
  try {
34680
- const parsed = JSON.parse(rawJsonValue);
34681
- onChange(parsed);
34682
- setIsJsonMode(false);
34903
+ const jsonStr = rawJsonValue.trim();
34904
+ if (!jsonStr) {
34905
+ return;
34906
+ }
34907
+ const formatted = JSON.stringify(JSON.parse(jsonStr), null, 2);
34908
+ setRawJsonValue(formatted);
34909
+ debouncedUpdateParent(formatted);
34910
+ setJsonError(void 0);
34683
34911
  } catch (err) {
34684
34912
  setJsonError(err instanceof Error ? err.message : "Invalid JSON");
34685
34913
  }
34686
- } else {
34687
- setRawJsonValue(
34688
- JSON.stringify(value ?? generateDefaultValue(schema), null, 2)
34689
- );
34690
- setIsJsonMode(true);
34691
- }
34692
- };
34693
- const formatJson = () => {
34694
- try {
34695
- const jsonStr = rawJsonValue.trim();
34696
- if (!jsonStr) {
34697
- return;
34914
+ };
34915
+ const validateJson = () => {
34916
+ if (!isJsonMode) return { isValid: true, error: null };
34917
+ try {
34918
+ const jsonStr = rawJsonValue.trim();
34919
+ if (!jsonStr) return { isValid: true, error: null };
34920
+ const parsed = JSON.parse(jsonStr);
34921
+ if (timeoutRef.current) {
34922
+ clearTimeout(timeoutRef.current);
34923
+ }
34924
+ onChange(parsed);
34925
+ setJsonError(void 0);
34926
+ return { isValid: true, error: null };
34927
+ } catch (err) {
34928
+ const errorMessage = err instanceof Error ? err.message : "Invalid JSON";
34929
+ setJsonError(errorMessage);
34930
+ return { isValid: false, error: errorMessage };
34698
34931
  }
34699
- const formatted = JSON.stringify(JSON.parse(jsonStr), null, 2);
34700
- setRawJsonValue(formatted);
34701
- debouncedUpdateParent(formatted);
34702
- setJsonError(void 0);
34703
- } catch (err) {
34704
- setJsonError(err instanceof Error ? err.message : "Invalid JSON");
34705
- }
34706
- };
34707
- const renderFormFields = (propSchema, currentValue, path = [], depth = 0, parentSchema, propertyName) => {
34708
- var _a, _b, _c;
34709
- if (depth >= maxDepth && (propSchema.type === "object" || propSchema.type === "array")) {
34710
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
34711
- JsonEditor,
34712
- {
34713
- value: JSON.stringify(
34714
- currentValue ?? generateDefaultValue(propSchema, propertyName, parentSchema),
34715
- null,
34716
- 2
34717
- ),
34718
- onChange: (newValue) => {
34719
- try {
34720
- const parsed = JSON.parse(newValue);
34721
- handleFieldChange(path, parsed);
34722
- setJsonError(void 0);
34723
- } catch (err) {
34724
- setJsonError(err instanceof Error ? err.message : "Invalid JSON");
34932
+ };
34933
+ const handleCopyJson = reactExports.useCallback(async () => {
34934
+ try {
34935
+ await navigator.clipboard.writeText(
34936
+ JSON.stringify(value, null, 2) ?? "[]"
34937
+ );
34938
+ setCopiedJson(true);
34939
+ toast2({
34940
+ title: "JSON copied",
34941
+ description: "The JSON data has been successfully copied to your clipboard."
34942
+ });
34943
+ setTimeout(() => {
34944
+ setCopiedJson(false);
34945
+ }, 2e3);
34946
+ } catch (error) {
34947
+ toast2({
34948
+ title: "Error",
34949
+ description: `Failed to copy JSON: ${error instanceof Error ? error.message : String(error)}`,
34950
+ variant: "destructive"
34951
+ });
34952
+ }
34953
+ }, [toast2, value]);
34954
+ reactExports.useImperativeHandle(ref2, () => ({
34955
+ validateJson
34956
+ }));
34957
+ const renderFormFields = (propSchema, currentValue, path = [], depth = 0, parentSchema, propertyName) => {
34958
+ var _a, _b, _c;
34959
+ if (depth >= maxDepth && (propSchema.type === "object" || propSchema.type === "array")) {
34960
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
34961
+ JsonEditor,
34962
+ {
34963
+ value: JSON.stringify(
34964
+ currentValue ?? generateDefaultValue(propSchema, propertyName, parentSchema),
34965
+ null,
34966
+ 2
34967
+ ),
34968
+ onChange: (newValue) => {
34969
+ try {
34970
+ const parsed = JSON.parse(newValue);
34971
+ handleFieldChange(path, parsed);
34972
+ setJsonError(void 0);
34973
+ } catch (err) {
34974
+ setJsonError(
34975
+ err instanceof Error ? err.message : "Invalid JSON"
34976
+ );
34977
+ }
34978
+ },
34979
+ error: jsonError
34980
+ }
34981
+ );
34982
+ }
34983
+ const isRequired = ((_a = parentSchema == null ? void 0 : parentSchema.required) == null ? void 0 : _a.includes(propertyName || "")) ?? false;
34984
+ let fieldType = propSchema.type;
34985
+ if (Array.isArray(fieldType)) {
34986
+ fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
34987
+ }
34988
+ switch (fieldType) {
34989
+ case "string": {
34990
+ if (propSchema.oneOf && propSchema.oneOf.every(
34991
+ (option) => typeof option.const === "string" && typeof option.title === "string"
34992
+ )) {
34993
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
34994
+ "select",
34995
+ {
34996
+ value: currentValue ?? "",
34997
+ onChange: (e) => {
34998
+ const val = e.target.value;
34999
+ if (!val && !isRequired) {
35000
+ handleFieldChange(path, void 0);
35001
+ } else {
35002
+ handleFieldChange(path, val);
35003
+ }
35004
+ },
35005
+ required: isRequired,
35006
+ className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800",
35007
+ children: [
35008
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
35009
+ propSchema.oneOf.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
35010
+ "option",
35011
+ {
35012
+ value: option.const,
35013
+ children: option.title
35014
+ },
35015
+ option.const
35016
+ ))
35017
+ ]
35018
+ }
35019
+ );
35020
+ }
35021
+ if (propSchema.enum) {
35022
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
35023
+ "select",
35024
+ {
35025
+ value: currentValue ?? "",
35026
+ onChange: (e) => {
35027
+ const val = e.target.value;
35028
+ if (!val && !isRequired) {
35029
+ handleFieldChange(path, void 0);
35030
+ } else {
35031
+ handleFieldChange(path, val);
35032
+ }
35033
+ },
35034
+ required: isRequired,
35035
+ className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800",
35036
+ children: [
35037
+ /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
35038
+ propSchema.enum.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, option))
35039
+ ]
35040
+ }
35041
+ );
35042
+ }
35043
+ let inputType = "text";
35044
+ switch (propSchema.format) {
35045
+ case "email":
35046
+ inputType = "email";
35047
+ break;
35048
+ case "uri":
35049
+ inputType = "url";
35050
+ break;
35051
+ case "date":
35052
+ inputType = "date";
35053
+ break;
35054
+ case "date-time":
35055
+ inputType = "datetime-local";
35056
+ break;
35057
+ default:
35058
+ inputType = "text";
35059
+ break;
35060
+ }
35061
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
35062
+ Input,
35063
+ {
35064
+ type: inputType,
35065
+ value: currentValue ?? "",
35066
+ onChange: (e) => {
35067
+ const val = e.target.value;
35068
+ handleFieldChange(path, val);
35069
+ },
35070
+ placeholder: propSchema.description,
35071
+ required: isRequired,
35072
+ minLength: propSchema.minLength,
35073
+ maxLength: propSchema.maxLength,
35074
+ pattern: propSchema.pattern
34725
35075
  }
34726
- },
34727
- error: jsonError
35076
+ );
34728
35077
  }
34729
- );
34730
- }
34731
- const isRequired = ((_a = parentSchema == null ? void 0 : parentSchema.required) == null ? void 0 : _a.includes(propertyName || "")) ?? false;
34732
- let fieldType = propSchema.type;
34733
- if (Array.isArray(fieldType)) {
34734
- fieldType = fieldType.find((t) => t !== "null") ?? fieldType[0];
34735
- }
34736
- switch (fieldType) {
34737
- case "string": {
34738
- if (propSchema.oneOf && propSchema.oneOf.every(
34739
- (option) => typeof option.const === "string" && typeof option.title === "string"
34740
- )) {
34741
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
34742
- "select",
35078
+ case "number":
35079
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
35080
+ Input,
34743
35081
  {
34744
- value: currentValue ?? "",
35082
+ type: "number",
35083
+ value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
34745
35084
  onChange: (e) => {
34746
35085
  const val = e.target.value;
34747
35086
  if (!val && !isRequired) {
34748
35087
  handleFieldChange(path, void 0);
34749
35088
  } else {
34750
- handleFieldChange(path, val);
35089
+ const num = Number(val);
35090
+ if (!isNaN(num)) {
35091
+ handleFieldChange(path, num);
35092
+ }
34751
35093
  }
34752
35094
  },
35095
+ placeholder: propSchema.description,
34753
35096
  required: isRequired,
34754
- className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800",
34755
- children: [
34756
- /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
34757
- propSchema.oneOf.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx(
34758
- "option",
34759
- {
34760
- value: option.const,
34761
- children: option.title
34762
- },
34763
- option.const
34764
- ))
34765
- ]
35097
+ min: propSchema.minimum,
35098
+ max: propSchema.maximum
34766
35099
  }
34767
35100
  );
34768
- }
34769
- if (propSchema.enum) {
34770
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
34771
- "select",
35101
+ case "integer":
35102
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
35103
+ Input,
34772
35104
  {
34773
- value: currentValue ?? "",
35105
+ type: "number",
35106
+ step: "1",
35107
+ value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
34774
35108
  onChange: (e) => {
34775
35109
  const val = e.target.value;
34776
35110
  if (!val && !isRequired) {
34777
35111
  handleFieldChange(path, void 0);
34778
35112
  } else {
34779
- handleFieldChange(path, val);
35113
+ const num = Number(val);
35114
+ if (!isNaN(num) && Number.isInteger(num)) {
35115
+ handleFieldChange(path, num);
35116
+ }
34780
35117
  }
34781
35118
  },
35119
+ placeholder: propSchema.description,
34782
35120
  required: isRequired,
34783
- className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800",
34784
- children: [
34785
- /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "Select an option..." }),
34786
- propSchema.enum.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }, option))
34787
- ]
35121
+ min: propSchema.minimum,
35122
+ max: propSchema.maximum
34788
35123
  }
34789
35124
  );
34790
- }
34791
- let inputType = "text";
34792
- switch (propSchema.format) {
34793
- case "email":
34794
- inputType = "email";
34795
- break;
34796
- case "uri":
34797
- inputType = "url";
34798
- break;
34799
- case "date":
34800
- inputType = "date";
34801
- break;
34802
- case "date-time":
34803
- inputType = "datetime-local";
34804
- break;
34805
- default:
34806
- inputType = "text";
34807
- break;
34808
- }
34809
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
34810
- Input,
34811
- {
34812
- type: inputType,
34813
- value: currentValue ?? "",
34814
- onChange: (e) => {
34815
- const val = e.target.value;
34816
- handleFieldChange(path, val);
34817
- },
34818
- placeholder: propSchema.description,
34819
- required: isRequired,
34820
- minLength: propSchema.minLength,
34821
- maxLength: propSchema.maxLength,
34822
- pattern: propSchema.pattern
34823
- }
34824
- );
34825
- }
34826
- case "number":
34827
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
34828
- Input,
34829
- {
34830
- type: "number",
34831
- value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
34832
- onChange: (e) => {
34833
- const val = e.target.value;
34834
- if (!val && !isRequired) {
34835
- handleFieldChange(path, void 0);
34836
- } else {
34837
- const num = Number(val);
34838
- if (!isNaN(num)) {
34839
- handleFieldChange(path, num);
34840
- }
34841
- }
34842
- },
34843
- placeholder: propSchema.description,
34844
- required: isRequired,
34845
- min: propSchema.minimum,
34846
- max: propSchema.maximum
34847
- }
34848
- );
34849
- case "integer":
34850
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
34851
- Input,
34852
- {
34853
- type: "number",
34854
- step: "1",
34855
- value: (currentValue == null ? void 0 : currentValue.toString()) ?? "",
34856
- onChange: (e) => {
34857
- const val = e.target.value;
34858
- if (!val && !isRequired) {
34859
- handleFieldChange(path, void 0);
34860
- } else {
34861
- const num = Number(val);
34862
- if (!isNaN(num) && Number.isInteger(num)) {
34863
- handleFieldChange(path, num);
34864
- }
35125
+ case "boolean":
35126
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
35127
+ Input,
35128
+ {
35129
+ type: "checkbox",
35130
+ checked: currentValue ?? false,
35131
+ onChange: (e) => handleFieldChange(path, e.target.checked),
35132
+ className: "w-4 h-4",
35133
+ required: isRequired
35134
+ }
35135
+ );
35136
+ case "null":
35137
+ return null;
35138
+ case "object":
35139
+ if (!propSchema.properties) {
35140
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
35141
+ JsonEditor,
35142
+ {
35143
+ value: JSON.stringify(currentValue ?? {}, null, 2),
35144
+ onChange: (newValue) => {
35145
+ try {
35146
+ const parsed = JSON.parse(newValue);
35147
+ handleFieldChange(path, parsed);
35148
+ setJsonError(void 0);
35149
+ } catch (err) {
35150
+ setJsonError(
35151
+ err instanceof Error ? err.message : "Invalid JSON"
35152
+ );
35153
+ }
35154
+ },
35155
+ error: jsonError
34865
35156
  }
34866
- },
34867
- placeholder: propSchema.description,
34868
- required: isRequired,
34869
- min: propSchema.minimum,
34870
- max: propSchema.maximum
35157
+ );
34871
35158
  }
34872
- );
34873
- case "boolean":
34874
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
34875
- Input,
34876
- {
34877
- type: "checkbox",
34878
- checked: currentValue ?? false,
34879
- onChange: (e) => handleFieldChange(path, e.target.checked),
34880
- className: "w-4 h-4",
34881
- required: isRequired
35159
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => {
35160
+ var _a2;
35161
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35162
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
35163
+ key,
35164
+ ((_a2 = propSchema.required) == null ? void 0 : _a2.includes(key)) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
35165
+ ] }),
35166
+ renderFormFields(
35167
+ subSchema,
35168
+ currentValue == null ? void 0 : currentValue[key],
35169
+ [...path, key],
35170
+ depth + 1,
35171
+ propSchema,
35172
+ key
35173
+ )
35174
+ ] }, key);
35175
+ }) });
35176
+ case "array": {
35177
+ const arrayValue = Array.isArray(currentValue) ? currentValue : [];
35178
+ if (!propSchema.items) return null;
35179
+ if (isSimpleObject(propSchema.items)) {
35180
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
35181
+ propSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: propSchema.description }),
35182
+ ((_b = propSchema.items) == null ? void 0 : _b.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
35183
+ "Items: ",
35184
+ propSchema.items.description
35185
+ ] }),
35186
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
35187
+ arrayValue.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
35188
+ renderFormFields(
35189
+ propSchema.items,
35190
+ item,
35191
+ [...path, index2.toString()],
35192
+ depth + 1
35193
+ ),
35194
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
35195
+ Button,
35196
+ {
35197
+ variant: "outline",
35198
+ size: "sm",
35199
+ onClick: () => {
35200
+ const newArray = [...arrayValue];
35201
+ newArray.splice(index2, 1);
35202
+ handleFieldChange(path, newArray);
35203
+ },
35204
+ children: "Remove"
35205
+ }
35206
+ )
35207
+ ] }, index2)),
35208
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
35209
+ Button,
35210
+ {
35211
+ variant: "outline",
35212
+ size: "sm",
35213
+ onClick: () => {
35214
+ const defaultValue = getArrayItemDefault(
35215
+ propSchema.items
35216
+ );
35217
+ handleFieldChange(path, [...arrayValue, defaultValue]);
35218
+ },
35219
+ title: ((_c = propSchema.items) == null ? void 0 : _c.description) ? `Add new ${propSchema.items.description}` : "Add new item",
35220
+ children: "Add Item"
35221
+ }
35222
+ )
35223
+ ] })
35224
+ ] });
34882
35225
  }
34883
- );
34884
- case "null":
34885
- return null;
34886
- case "object":
34887
- if (!propSchema.properties) {
34888
35226
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
34889
35227
  JsonEditor,
34890
35228
  {
34891
- value: JSON.stringify(currentValue ?? {}, null, 2),
35229
+ value: JSON.stringify(currentValue ?? [], null, 2),
34892
35230
  onChange: (newValue) => {
34893
35231
  try {
34894
35232
  const parsed = JSON.parse(newValue);
@@ -34904,189 +35242,88 @@ const DynamicJsonForm = ({
34904
35242
  }
34905
35243
  );
34906
35244
  }
34907
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 border rounded p-3", children: Object.entries(propSchema.properties).map(([key, subSchema]) => {
34908
- var _a2;
34909
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34910
- /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "block text-sm font-medium mb-1", children: [
34911
- key,
34912
- ((_a2 = propSchema.required) == null ? void 0 : _a2.includes(key)) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-500 ml-1", children: "*" })
34913
- ] }),
34914
- renderFormFields(
34915
- subSchema,
34916
- currentValue == null ? void 0 : currentValue[key],
34917
- [...path, key],
34918
- depth + 1,
34919
- propSchema,
34920
- key
34921
- )
34922
- ] }, key);
34923
- }) });
34924
- case "array": {
34925
- const arrayValue = Array.isArray(currentValue) ? currentValue : [];
34926
- if (!propSchema.items) return null;
34927
- if (isSimpleObject(propSchema.items)) {
34928
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
34929
- propSchema.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: propSchema.description }),
34930
- ((_b = propSchema.items) == null ? void 0 : _b.description) && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-gray-500", children: [
34931
- "Items: ",
34932
- propSchema.items.description
34933
- ] }),
34934
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
34935
- arrayValue.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
34936
- renderFormFields(
34937
- propSchema.items,
34938
- item,
34939
- [...path, index2.toString()],
34940
- depth + 1
34941
- ),
34942
- /* @__PURE__ */ jsxRuntimeExports.jsx(
34943
- Button,
34944
- {
34945
- variant: "outline",
34946
- size: "sm",
34947
- onClick: () => {
34948
- const newArray = [...arrayValue];
34949
- newArray.splice(index2, 1);
34950
- handleFieldChange(path, newArray);
34951
- },
34952
- children: "Remove"
34953
- }
34954
- )
34955
- ] }, index2)),
34956
- /* @__PURE__ */ jsxRuntimeExports.jsx(
34957
- Button,
34958
- {
34959
- variant: "outline",
34960
- size: "sm",
34961
- onClick: () => {
34962
- const defaultValue = getArrayItemDefault(
34963
- propSchema.items
34964
- );
34965
- handleFieldChange(path, [...arrayValue, defaultValue]);
34966
- },
34967
- title: ((_c = propSchema.items) == null ? void 0 : _c.description) ? `Add new ${propSchema.items.description}` : "Add new item",
34968
- children: "Add Item"
34969
- }
34970
- )
34971
- ] })
34972
- ] });
34973
- }
34974
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
34975
- JsonEditor,
34976
- {
34977
- value: JSON.stringify(currentValue ?? [], null, 2),
34978
- onChange: (newValue) => {
34979
- try {
34980
- const parsed = JSON.parse(newValue);
34981
- handleFieldChange(path, parsed);
34982
- setJsonError(void 0);
34983
- } catch (err) {
34984
- setJsonError(
34985
- err instanceof Error ? err.message : "Invalid JSON"
34986
- );
34987
- }
34988
- },
34989
- error: jsonError
34990
- }
34991
- );
35245
+ default:
35246
+ return null;
35247
+ }
35248
+ };
35249
+ const handleFieldChange = (path, fieldValue) => {
35250
+ if (path.length === 0) {
35251
+ onChange(fieldValue);
35252
+ return;
34992
35253
  }
34993
- default:
34994
- return null;
34995
- }
34996
- };
34997
- const handleFieldChange = (path, fieldValue) => {
34998
- if (path.length === 0) {
34999
- onChange(fieldValue);
35000
- return;
35001
- }
35002
- try {
35003
- const newValue = updateValueAtPath(value, path, fieldValue);
35004
- onChange(newValue);
35005
- } catch (error) {
35006
- console.error("Failed to update form value:", error);
35007
- onChange(value);
35008
- }
35009
- };
35010
- const shouldUseJsonMode = schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0);
35011
- reactExports.useEffect(() => {
35012
- if (shouldUseJsonMode && !isJsonMode) {
35013
- setIsJsonMode(true);
35014
- }
35015
- }, [shouldUseJsonMode, isJsonMode]);
35016
- const handleCopyJson = reactExports.useCallback(() => {
35017
- const copyToClipboard = async () => {
35018
35254
  try {
35019
- await navigator.clipboard.writeText(
35020
- JSON.stringify(value, null, 2) ?? "[]"
35021
- );
35022
- setCopiedJson(true);
35023
- toast2({
35024
- title: "JSON copied",
35025
- description: "The JSON data has been successfully copied to your clipboard."
35026
- });
35027
- setTimeout(() => {
35028
- setCopiedJson(false);
35029
- }, 2e3);
35255
+ const newValue = updateValueAtPath(value, path, fieldValue);
35256
+ onChange(newValue);
35030
35257
  } catch (error) {
35031
- toast2({
35032
- title: "Error",
35033
- description: `Failed to copy JSON: ${error instanceof Error ? error.message : String(error)}`,
35034
- variant: "destructive"
35035
- });
35258
+ console.error("Failed to update form value:", error);
35259
+ onChange(value);
35036
35260
  }
35037
35261
  };
35038
- copyToClipboard();
35039
- }, [toast2, value]);
35040
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
35041
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end space-x-2", children: [
35042
- isJsonMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
35043
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
35044
- Button,
35045
- {
35046
- type: "button",
35047
- variant: "outline",
35048
- size: "sm",
35049
- onClick: handleCopyJson,
35050
- children: [
35051
- copiedJson ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
35052
- "Copy JSON"
35053
- ]
35054
- }
35055
- ),
35056
- /* @__PURE__ */ jsxRuntimeExports.jsx(
35262
+ const shouldUseJsonMode = schema.type === "object" && (!schema.properties || Object.keys(schema.properties).length === 0);
35263
+ reactExports.useEffect(() => {
35264
+ if (shouldUseJsonMode && !isJsonMode) {
35265
+ setIsJsonMode(true);
35266
+ }
35267
+ }, [shouldUseJsonMode, isJsonMode]);
35268
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
35269
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end space-x-2", children: [
35270
+ isJsonMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
35271
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
35272
+ Button,
35273
+ {
35274
+ type: "button",
35275
+ variant: "outline",
35276
+ size: "sm",
35277
+ onClick: handleCopyJson,
35278
+ children: [
35279
+ copiedJson ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
35280
+ "Copy JSON"
35281
+ ]
35282
+ }
35283
+ ),
35284
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
35285
+ Button,
35286
+ {
35287
+ type: "button",
35288
+ variant: "outline",
35289
+ size: "sm",
35290
+ onClick: formatJson,
35291
+ children: "Format JSON"
35292
+ }
35293
+ )
35294
+ ] }),
35295
+ !isOnlyJSON && /* @__PURE__ */ jsxRuntimeExports.jsx(
35057
35296
  Button,
35058
35297
  {
35059
- type: "button",
35060
35298
  variant: "outline",
35061
35299
  size: "sm",
35062
- onClick: formatJson,
35063
- children: "Format JSON"
35300
+ onClick: handleSwitchToFormMode,
35301
+ children: isJsonMode ? "Switch to Form" : "Switch to JSON"
35064
35302
  }
35065
35303
  )
35066
35304
  ] }),
35067
- !isOnlyJSON && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", size: "sm", onClick: handleSwitchToFormMode, children: isJsonMode ? "Switch to Form" : "Switch to JSON" })
35068
- ] }),
35069
- isJsonMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
35070
- JsonEditor,
35071
- {
35072
- value: rawJsonValue,
35073
- onChange: (newValue) => {
35074
- setRawJsonValue(newValue);
35075
- debouncedUpdateParent(newValue);
35076
- },
35077
- error: jsonError
35078
- }
35079
- ) : (
35080
- // If schema type is object but value is not an object or is empty, and we have actual JSON data,
35081
- // render a simple representation of the JSON data
35082
- schema.type === "object" && (typeof value !== "object" || value === null || Object.keys(value).length === 0) && rawJsonValue && rawJsonValue !== "{}" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 border rounded-md p-4", children: [
35083
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Form view not available for this JSON structure. Using simplified view:" }),
35084
- /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-4 rounded text-sm overflow-auto", children: rawJsonValue }),
35085
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Use JSON mode for full editing capabilities." })
35086
- ] }) : renderFormFields(schema, value)
35087
- )
35088
- ] });
35089
- };
35305
+ isJsonMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(
35306
+ JsonEditor,
35307
+ {
35308
+ value: rawJsonValue,
35309
+ onChange: (newValue) => {
35310
+ setRawJsonValue(newValue);
35311
+ debouncedUpdateParent(newValue);
35312
+ },
35313
+ error: jsonError
35314
+ }
35315
+ ) : (
35316
+ // If schema type is object but value is not an object or is empty, and we have actual JSON data,
35317
+ // render a simple representation of the JSON data
35318
+ schema.type === "object" && (typeof value !== "object" || value === null || Object.keys(value).length === 0) && rawJsonValue && rawJsonValue !== "{}" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 border rounded-md p-4", children: [
35319
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Form view not available for this JSON structure. Using simplified view:" }),
35320
+ /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "bg-gray-50 dark:bg-gray-800 dark:text-gray-100 p-4 rounded text-sm overflow-auto", children: rawJsonValue }),
35321
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Use JSON mode for full editing capabilities." })
35322
+ ] }) : renderFormFields(schema, value)
35323
+ )
35324
+ ] });
35325
+ }
35326
+ );
35090
35327
  const SamplingRequest = ({
35091
35328
  onApprove,
35092
35329
  request,
@@ -35259,7 +35496,7 @@ var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
35259
35496
  var SELECTION_KEYS = [" ", "Enter"];
35260
35497
  var SELECT_NAME = "Select";
35261
35498
  var [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);
35262
- var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
35499
+ var [createSelectContext] = createContextScope(SELECT_NAME, [
35263
35500
  createCollectionScope,
35264
35501
  createPopperScope
35265
35502
  ]);
@@ -35277,7 +35514,7 @@ var Select$1 = (props) => {
35277
35514
  defaultValue,
35278
35515
  onValueChange,
35279
35516
  dir,
35280
- name,
35517
+ name: name2,
35281
35518
  autoComplete,
35282
35519
  disabled,
35283
35520
  required: required2,
@@ -35347,7 +35584,7 @@ var Select$1 = (props) => {
35347
35584
  "aria-hidden": true,
35348
35585
  required: required2,
35349
35586
  tabIndex: -1,
35350
- name,
35587
+ name: name2,
35351
35588
  autoComplete,
35352
35589
  value,
35353
35590
  onChange: (event) => setValue(event.target.value),
@@ -36306,7 +36543,7 @@ var SelectArrow = reactExports.forwardRef(
36306
36543
  }
36307
36544
  );
36308
36545
  SelectArrow.displayName = ARROW_NAME$1;
36309
- var BUBBLE_INPUT_NAME$1 = "SelectBubbleInput";
36546
+ var BUBBLE_INPUT_NAME$2 = "SelectBubbleInput";
36310
36547
  var SelectBubbleInput = reactExports.forwardRef(
36311
36548
  ({ __scopeSelect, value, ...props }, forwardedRef) => {
36312
36549
  const ref2 = reactExports.useRef(null);
@@ -36338,7 +36575,7 @@ var SelectBubbleInput = reactExports.forwardRef(
36338
36575
  );
36339
36576
  }
36340
36577
  );
36341
- SelectBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
36578
+ SelectBubbleInput.displayName = BUBBLE_INPUT_NAME$2;
36342
36579
  function shouldShowPlaceholder(value) {
36343
36580
  return value === "" || value === void 0;
36344
36581
  }
@@ -36541,8 +36778,8 @@ const useTheme = () => {
36541
36778
  [theme, setThemeWithSideEffect]
36542
36779
  );
36543
36780
  };
36544
- const version = "0.16.7";
36545
- var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
36781
+ const version = "0.17.0";
36782
+ var [createTooltipContext] = createContextScope("Tooltip", [
36546
36783
  createPopperScope
36547
36784
  ]);
36548
36785
  var usePopperScope = createPopperScope();
@@ -36867,7 +37104,7 @@ var TooltipContentImpl = reactExports.forwardRef(
36867
37104
  },
36868
37105
  children: [
36869
37106
  /* @__PURE__ */ jsxRuntimeExports.jsx(Slottable, { children }),
36870
- /* @__PURE__ */ jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root$4, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
37107
+ /* @__PURE__ */ jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root$5, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
36871
37108
  ]
36872
37109
  }
36873
37110
  )
@@ -37024,6 +37261,394 @@ const TooltipContent = reactExports.forwardRef(({ className, sideOffset = 4, ...
37024
37261
  }
37025
37262
  ));
37026
37263
  TooltipContent.displayName = Content2.displayName;
37264
+ const Textarea = reactExports.forwardRef(
37265
+ ({ className, ...props }, ref2) => {
37266
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
37267
+ "textarea",
37268
+ {
37269
+ className: cn(
37270
+ "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
37271
+ className
37272
+ ),
37273
+ ref: ref2,
37274
+ ...props
37275
+ }
37276
+ );
37277
+ }
37278
+ );
37279
+ Textarea.displayName = "Textarea";
37280
+ var SWITCH_NAME = "Switch";
37281
+ var [createSwitchContext] = createContextScope(SWITCH_NAME);
37282
+ var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
37283
+ var Switch$1 = reactExports.forwardRef(
37284
+ (props, forwardedRef) => {
37285
+ const {
37286
+ __scopeSwitch,
37287
+ name: name2,
37288
+ checked: checkedProp,
37289
+ defaultChecked,
37290
+ required: required2,
37291
+ disabled,
37292
+ value = "on",
37293
+ onCheckedChange,
37294
+ form,
37295
+ ...switchProps
37296
+ } = props;
37297
+ const [button, setButton] = reactExports.useState(null);
37298
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
37299
+ const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
37300
+ const isFormControl = button ? form || !!button.closest("form") : true;
37301
+ const [checked, setChecked] = useControllableState({
37302
+ prop: checkedProp,
37303
+ defaultProp: defaultChecked ?? false,
37304
+ onChange: onCheckedChange,
37305
+ caller: SWITCH_NAME
37306
+ });
37307
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
37308
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37309
+ Primitive.button,
37310
+ {
37311
+ type: "button",
37312
+ role: "switch",
37313
+ "aria-checked": checked,
37314
+ "aria-required": required2,
37315
+ "data-state": getState$1(checked),
37316
+ "data-disabled": disabled ? "" : void 0,
37317
+ disabled,
37318
+ value,
37319
+ ...switchProps,
37320
+ ref: composedRefs,
37321
+ onClick: composeEventHandlers(props.onClick, (event) => {
37322
+ setChecked((prevChecked) => !prevChecked);
37323
+ if (isFormControl) {
37324
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
37325
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
37326
+ }
37327
+ })
37328
+ }
37329
+ ),
37330
+ isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
37331
+ SwitchBubbleInput,
37332
+ {
37333
+ control: button,
37334
+ bubbles: !hasConsumerStoppedPropagationRef.current,
37335
+ name: name2,
37336
+ value,
37337
+ checked,
37338
+ required: required2,
37339
+ disabled,
37340
+ form,
37341
+ style: { transform: "translateX(-100%)" }
37342
+ }
37343
+ )
37344
+ ] });
37345
+ }
37346
+ );
37347
+ Switch$1.displayName = SWITCH_NAME;
37348
+ var THUMB_NAME = "SwitchThumb";
37349
+ var SwitchThumb = reactExports.forwardRef(
37350
+ (props, forwardedRef) => {
37351
+ const { __scopeSwitch, ...thumbProps } = props;
37352
+ const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
37353
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
37354
+ Primitive.span,
37355
+ {
37356
+ "data-state": getState$1(context.checked),
37357
+ "data-disabled": context.disabled ? "" : void 0,
37358
+ ...thumbProps,
37359
+ ref: forwardedRef
37360
+ }
37361
+ );
37362
+ }
37363
+ );
37364
+ SwitchThumb.displayName = THUMB_NAME;
37365
+ var BUBBLE_INPUT_NAME$1 = "SwitchBubbleInput";
37366
+ var SwitchBubbleInput = reactExports.forwardRef(
37367
+ ({
37368
+ __scopeSwitch,
37369
+ control,
37370
+ checked,
37371
+ bubbles = true,
37372
+ ...props
37373
+ }, forwardedRef) => {
37374
+ const ref2 = reactExports.useRef(null);
37375
+ const composedRefs = useComposedRefs(ref2, forwardedRef);
37376
+ const prevChecked = usePrevious(checked);
37377
+ const controlSize = useSize(control);
37378
+ reactExports.useEffect(() => {
37379
+ const input = ref2.current;
37380
+ if (!input) return;
37381
+ const inputProto = window.HTMLInputElement.prototype;
37382
+ const descriptor = Object.getOwnPropertyDescriptor(
37383
+ inputProto,
37384
+ "checked"
37385
+ );
37386
+ const setChecked = descriptor.set;
37387
+ if (prevChecked !== checked && setChecked) {
37388
+ const event = new Event("click", { bubbles });
37389
+ setChecked.call(input, checked);
37390
+ input.dispatchEvent(event);
37391
+ }
37392
+ }, [prevChecked, checked, bubbles]);
37393
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
37394
+ "input",
37395
+ {
37396
+ type: "checkbox",
37397
+ "aria-hidden": true,
37398
+ defaultChecked: checked,
37399
+ ...props,
37400
+ tabIndex: -1,
37401
+ ref: composedRefs,
37402
+ style: {
37403
+ ...props.style,
37404
+ ...controlSize,
37405
+ position: "absolute",
37406
+ pointerEvents: "none",
37407
+ opacity: 0,
37408
+ margin: 0
37409
+ }
37410
+ }
37411
+ );
37412
+ }
37413
+ );
37414
+ SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
37415
+ function getState$1(checked) {
37416
+ return checked ? "checked" : "unchecked";
37417
+ }
37418
+ var Root = Switch$1;
37419
+ var Thumb = SwitchThumb;
37420
+ const Switch = reactExports.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
37421
+ Root,
37422
+ {
37423
+ className: cn(
37424
+ "peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
37425
+ className
37426
+ ),
37427
+ ...props,
37428
+ ref: ref2,
37429
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37430
+ Thumb,
37431
+ {
37432
+ className: cn(
37433
+ "pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
37434
+ )
37435
+ }
37436
+ )
37437
+ }
37438
+ ));
37439
+ Switch.displayName = Root.displayName;
37440
+ const createEmptyHeader = () => ({
37441
+ name: "",
37442
+ value: "",
37443
+ enabled: true
37444
+ });
37445
+ const createHeaderFromBearerToken = (bearerToken, headerName) => ({
37446
+ name: headerName || "Authorization",
37447
+ value: (headerName == null ? void 0 : headerName.toLowerCase()) === "authorization" || !headerName ? `Bearer ${bearerToken}` : bearerToken,
37448
+ enabled: true
37449
+ });
37450
+ const migrateFromLegacyAuth = (bearerToken, headerName) => {
37451
+ return bearerToken ? [createHeaderFromBearerToken(bearerToken, headerName)] : [];
37452
+ };
37453
+ const CustomHeaders = ({
37454
+ headers,
37455
+ onChange,
37456
+ className
37457
+ }) => {
37458
+ const [isJsonMode, setIsJsonMode] = reactExports.useState(false);
37459
+ const [jsonValue, setJsonValue] = reactExports.useState("");
37460
+ const [jsonError, setJsonError] = reactExports.useState(null);
37461
+ const [visibleValues, setVisibleValues] = reactExports.useState(/* @__PURE__ */ new Set());
37462
+ const updateHeader = (index2, field, value) => {
37463
+ const newHeaders = [...headers];
37464
+ newHeaders[index2] = { ...newHeaders[index2], [field]: value };
37465
+ onChange(newHeaders);
37466
+ };
37467
+ const addHeader = () => {
37468
+ onChange([...headers, createEmptyHeader()]);
37469
+ };
37470
+ const removeHeader = (index2) => {
37471
+ const newHeaders = headers.filter((_, i) => i !== index2);
37472
+ onChange(newHeaders);
37473
+ };
37474
+ const toggleValueVisibility = (index2) => {
37475
+ const newVisible = new Set(visibleValues);
37476
+ if (newVisible.has(index2)) {
37477
+ newVisible.delete(index2);
37478
+ } else {
37479
+ newVisible.add(index2);
37480
+ }
37481
+ setVisibleValues(newVisible);
37482
+ };
37483
+ const switchToJsonMode = () => {
37484
+ const jsonObject = {};
37485
+ headers.forEach((header) => {
37486
+ if (header.enabled && header.name.trim() && header.value.trim()) {
37487
+ jsonObject[header.name.trim()] = header.value.trim();
37488
+ }
37489
+ });
37490
+ setJsonValue(JSON.stringify(jsonObject, null, 2));
37491
+ setJsonError(null);
37492
+ setIsJsonMode(true);
37493
+ };
37494
+ const switchToFormMode = () => {
37495
+ try {
37496
+ const parsed = JSON.parse(jsonValue);
37497
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
37498
+ setJsonError("JSON must be an object with string key-value pairs");
37499
+ return;
37500
+ }
37501
+ const newHeaders = Object.entries(parsed).map(
37502
+ ([name2, value]) => ({
37503
+ name: name2,
37504
+ value: String(value),
37505
+ enabled: true
37506
+ })
37507
+ );
37508
+ onChange(newHeaders);
37509
+ setJsonError(null);
37510
+ setIsJsonMode(false);
37511
+ } catch {
37512
+ setJsonError("Invalid JSON format");
37513
+ }
37514
+ };
37515
+ const handleJsonChange = (value) => {
37516
+ setJsonValue(value);
37517
+ setJsonError(null);
37518
+ };
37519
+ if (isJsonMode) {
37520
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `space-y-3 ${className}`, children: [
37521
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center gap-2", children: [
37522
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold flex-shrink-0", children: "Custom Headers (JSON)" }),
37523
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37524
+ Button,
37525
+ {
37526
+ type: "button",
37527
+ variant: "outline",
37528
+ size: "sm",
37529
+ onClick: switchToFormMode,
37530
+ className: "flex-shrink-0",
37531
+ children: "Switch to Form"
37532
+ }
37533
+ )
37534
+ ] }),
37535
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
37536
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37537
+ Textarea,
37538
+ {
37539
+ value: jsonValue,
37540
+ onChange: (e) => handleJsonChange(e.target.value),
37541
+ placeholder: '{\\n "Authorization": "Bearer token123",\\n "X-Tenant-ID": "acme-inc",\\n "X-Environment": "staging"\\n}',
37542
+ className: "font-mono text-sm min-h-[100px] resize-none"
37543
+ }
37544
+ ),
37545
+ jsonError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-600", children: jsonError }),
37546
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: "Enter headers as a JSON object with string key-value pairs." })
37547
+ ] })
37548
+ ] });
37549
+ }
37550
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `space-y-3 ${className}`, children: [
37551
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center gap-2", children: [
37552
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold flex-shrink-0", children: "Custom Headers" }),
37553
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [
37554
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37555
+ Button,
37556
+ {
37557
+ type: "button",
37558
+ variant: "outline",
37559
+ size: "sm",
37560
+ onClick: switchToJsonMode,
37561
+ className: "text-xs px-2",
37562
+ children: "JSON"
37563
+ }
37564
+ ),
37565
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
37566
+ Button,
37567
+ {
37568
+ type: "button",
37569
+ variant: "outline",
37570
+ size: "sm",
37571
+ onClick: addHeader,
37572
+ className: "text-xs px-2",
37573
+ "data-testid": "add-header-button",
37574
+ children: [
37575
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "w-3 h-3 mr-1" }),
37576
+ "Add"
37577
+ ]
37578
+ }
37579
+ )
37580
+ ] })
37581
+ ] }),
37582
+ headers.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-4 text-muted-foreground", children: [
37583
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: "No custom headers configured" }),
37584
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs mt-1", children: 'Click "Add" to get started' })
37585
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-2 max-h-[300px] overflow-y-auto", children: headers.map((header, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
37586
+ "div",
37587
+ {
37588
+ className: "flex items-start gap-2 p-2 border rounded-md",
37589
+ children: [
37590
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37591
+ Switch,
37592
+ {
37593
+ checked: header.enabled,
37594
+ onCheckedChange: (enabled) => updateHeader(index2, "enabled", enabled),
37595
+ className: "shrink-0 mt-2"
37596
+ }
37597
+ ),
37598
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0 space-y-2", children: [
37599
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37600
+ Input,
37601
+ {
37602
+ placeholder: "Header Name",
37603
+ value: header.name,
37604
+ onChange: (e) => updateHeader(index2, "name", e.target.value),
37605
+ className: "font-mono text-xs",
37606
+ "data-testid": `header-name-input-${index2}`
37607
+ }
37608
+ ),
37609
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
37610
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37611
+ Input,
37612
+ {
37613
+ placeholder: "Header Value",
37614
+ value: header.value,
37615
+ onChange: (e) => updateHeader(index2, "value", e.target.value),
37616
+ type: visibleValues.has(index2) ? "text" : "password",
37617
+ className: "font-mono text-xs pr-8",
37618
+ "data-testid": `header-value-input-${index2}`
37619
+ }
37620
+ ),
37621
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37622
+ Button,
37623
+ {
37624
+ type: "button",
37625
+ variant: "ghost",
37626
+ size: "sm",
37627
+ onClick: () => toggleValueVisibility(index2),
37628
+ className: "absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6 p-0",
37629
+ children: visibleValues.has(index2) ? /* @__PURE__ */ jsxRuntimeExports.jsx(EyeOff, { className: "w-3 h-3" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { className: "w-3 h-3" })
37630
+ }
37631
+ )
37632
+ ] })
37633
+ ] }),
37634
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37635
+ Button,
37636
+ {
37637
+ type: "button",
37638
+ variant: "ghost",
37639
+ size: "sm",
37640
+ onClick: () => removeHeader(index2),
37641
+ className: "shrink-0 text-red-600 hover:text-red-700 hover:bg-red-50 h-6 w-6 p-0 mt-2",
37642
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-3 h-3" })
37643
+ }
37644
+ )
37645
+ ]
37646
+ },
37647
+ index2
37648
+ )) }),
37649
+ headers.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-muted-foreground", children: "Use the toggle to enable/disable headers. Only enabled headers with both name and value will be sent." })
37650
+ ] });
37651
+ };
37027
37652
  const Sidebar = ({
37028
37653
  connectionStatus,
37029
37654
  transportType,
@@ -37036,10 +37661,8 @@ const Sidebar = ({
37036
37661
  setSseUrl,
37037
37662
  env,
37038
37663
  setEnv,
37039
- bearerToken,
37040
- setBearerToken,
37041
- headerName,
37042
- setHeaderName,
37664
+ customHeaders,
37665
+ setCustomHeaders,
37043
37666
  oauthClientId,
37044
37667
  setOauthClientId,
37045
37668
  oauthScope,
@@ -37050,7 +37673,9 @@ const Sidebar = ({
37050
37673
  sendLogLevelRequest,
37051
37674
  loggingSupported,
37052
37675
  config,
37053
- setConfig
37676
+ setConfig,
37677
+ connectionType,
37678
+ setConnectionType
37054
37679
  }) => {
37055
37680
  const [theme, setTheme] = useTheme();
37056
37681
  const [showEnvVars, setShowEnvVars] = reactExports.useState(false);
@@ -37060,6 +37685,7 @@ const Sidebar = ({
37060
37685
  const [copiedServerEntry, setCopiedServerEntry] = reactExports.useState(false);
37061
37686
  const [copiedServerFile, setCopiedServerFile] = reactExports.useState(false);
37062
37687
  const { toast: toast2 } = useToast();
37688
+ const connectionTypeTip = "Connect to server directly (requires CORS config on server) or via MCP Inspector Proxy";
37063
37689
  const reportError2 = reactExports.useCallback(
37064
37690
  (error) => {
37065
37691
  toast2({
@@ -37212,10 +37838,22 @@ const Sidebar = ({
37212
37838
  }
37213
37839
  )
37214
37840
  ] })
37215
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
37216
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "sse-url-input", children: "URL" }),
37217
- sseUrl ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
37218
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37841
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
37842
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
37843
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", htmlFor: "sse-url-input", children: "URL" }),
37844
+ sseUrl ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
37845
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
37846
+ Input,
37847
+ {
37848
+ id: "sse-url-input",
37849
+ placeholder: "URL",
37850
+ value: sseUrl,
37851
+ onChange: (e) => setSseUrl(e.target.value),
37852
+ className: "font-mono"
37853
+ }
37854
+ ) }),
37855
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: sseUrl })
37856
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
37219
37857
  Input,
37220
37858
  {
37221
37859
  id: "sse-url-input",
@@ -37224,19 +37862,36 @@ const Sidebar = ({
37224
37862
  onChange: (e) => setSseUrl(e.target.value),
37225
37863
  className: "font-mono"
37226
37864
  }
37227
- ) }),
37228
- /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: sseUrl })
37229
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
37230
- Input,
37231
- {
37232
- id: "sse-url-input",
37233
- placeholder: "URL",
37234
- value: sseUrl,
37235
- onChange: (e) => setSseUrl(e.target.value),
37236
- className: "font-mono"
37237
- }
37238
- )
37239
- ] }) }),
37865
+ )
37866
+ ] }),
37867
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip, { children: [
37868
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
37869
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
37870
+ "label",
37871
+ {
37872
+ className: "text-sm font-medium",
37873
+ htmlFor: "connection-type-select",
37874
+ children: "Connection Type"
37875
+ }
37876
+ ),
37877
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
37878
+ Select,
37879
+ {
37880
+ value: connectionType,
37881
+ onValueChange: (value) => setConnectionType(value),
37882
+ children: [
37883
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { id: "connection-type-select", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "Select connection type" }) }),
37884
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
37885
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "proxy", children: "Via Proxy" }),
37886
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "direct", children: "Direct" })
37887
+ ] })
37888
+ ]
37889
+ }
37890
+ )
37891
+ ] }) }),
37892
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContent, { children: connectionTypeTip })
37893
+ ] })
37894
+ ] }),
37240
37895
  transportType === "stdio" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
37241
37896
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
37242
37897
  Button,
@@ -37408,42 +38063,13 @@ const Sidebar = ({
37408
38063
  }
37409
38064
  ),
37410
38065
  showAuthConfig && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
37411
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 p-3 rounded border", children: [
37412
- /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold flex items-center", children: "API Token Authentication" }),
37413
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
37414
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-sm font-medium", children: "Header Name" }),
37415
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37416
- Input,
37417
- {
37418
- placeholder: "Authorization",
37419
- onChange: (e) => setHeaderName && setHeaderName(e.target.value),
37420
- "data-testid": "header-input",
37421
- className: "font-mono",
37422
- value: headerName
37423
- }
37424
- ),
37425
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37426
- "label",
37427
- {
37428
- className: "text-sm font-medium",
37429
- htmlFor: "bearer-token-input",
37430
- children: "Bearer Token"
37431
- }
37432
- ),
37433
- /* @__PURE__ */ jsxRuntimeExports.jsx(
37434
- Input,
37435
- {
37436
- id: "bearer-token-input",
37437
- placeholder: "Bearer Token",
37438
- value: bearerToken,
37439
- onChange: (e) => setBearerToken(e.target.value),
37440
- "data-testid": "bearer-token-input",
37441
- className: "font-mono",
37442
- type: "password"
37443
- }
37444
- )
37445
- ] })
37446
- ] }),
38066
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-3 rounded border overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38067
+ CustomHeaders,
38068
+ {
38069
+ headers: customHeaders,
38070
+ onChange: setCustomHeaders
38071
+ }
38072
+ ) }),
37447
38073
  transportType !== "stdio" && // OAuth Configuration
37448
38074
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2 p-3 rounded border", children: [
37449
38075
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-sm font-semibold flex items-center", children: "OAuth 2.0 Flow" }),
@@ -37717,7 +38343,7 @@ const Sidebar = ({
37717
38343
  ] });
37718
38344
  };
37719
38345
  var CHECKBOX_NAME = "Checkbox";
37720
- var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
38346
+ var [createCheckboxContext] = createContextScope(CHECKBOX_NAME);
37721
38347
  var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
37722
38348
  function CheckboxProvider(props) {
37723
38349
  const {
@@ -37727,7 +38353,7 @@ function CheckboxProvider(props) {
37727
38353
  defaultChecked,
37728
38354
  disabled,
37729
38355
  form,
37730
- name,
38356
+ name: name2,
37731
38357
  onCheckedChange,
37732
38358
  required: required2,
37733
38359
  value = "on",
@@ -37753,7 +38379,7 @@ function CheckboxProvider(props) {
37753
38379
  setChecked,
37754
38380
  control,
37755
38381
  setControl,
37756
- name,
38382
+ name: name2,
37757
38383
  form,
37758
38384
  value,
37759
38385
  hasConsumerStoppedPropagationRef,
@@ -37829,7 +38455,7 @@ var Checkbox$1 = reactExports.forwardRef(
37829
38455
  (props, forwardedRef) => {
37830
38456
  const {
37831
38457
  __scopeCheckbox,
37832
- name,
38458
+ name: name2,
37833
38459
  checked,
37834
38460
  defaultChecked,
37835
38461
  required: required2,
@@ -37848,7 +38474,7 @@ var Checkbox$1 = reactExports.forwardRef(
37848
38474
  disabled,
37849
38475
  required: required2,
37850
38476
  onCheckedChange,
37851
- name,
38477
+ name: name2,
37852
38478
  form,
37853
38479
  value,
37854
38480
  internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -37906,7 +38532,7 @@ var CheckboxBubbleInput = reactExports.forwardRef(
37906
38532
  defaultChecked,
37907
38533
  required: required2,
37908
38534
  disabled,
37909
- name,
38535
+ name: name2,
37910
38536
  value,
37911
38537
  form,
37912
38538
  bubbleInput,
@@ -37941,7 +38567,7 @@ var CheckboxBubbleInput = reactExports.forwardRef(
37941
38567
  defaultChecked: defaultChecked ?? defaultCheckedRef.current,
37942
38568
  required: required2,
37943
38569
  disabled,
37944
- name,
38570
+ name: name2,
37945
38571
  value,
37946
38572
  form,
37947
38573
  ...props,
@@ -37992,26 +38618,10 @@ const Checkbox = reactExports.forwardRef(({ className, ...props }, ref2) => /* @
37992
38618
  }
37993
38619
  ));
37994
38620
  Checkbox.displayName = Checkbox$1.displayName;
37995
- const Textarea = reactExports.forwardRef(
37996
- ({ className, ...props }, ref2) => {
37997
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
37998
- "textarea",
37999
- {
38000
- className: cn(
38001
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
38002
- className
38003
- ),
38004
- ref: ref2,
38005
- ...props
38006
- }
38007
- );
38008
- }
38009
- );
38010
- Textarea.displayName = "Textarea";
38011
38621
  const ResourceLinkView = reactExports.memo(
38012
38622
  ({
38013
38623
  uri,
38014
- name,
38624
+ name: name2,
38015
38625
  description: description2,
38016
38626
  mimeType,
38017
38627
  resourceContent,
@@ -38066,7 +38676,7 @@ const ResourceLinkView = reactExports.memo(
38066
38676
  onReadResource && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 flex-shrink-0", "aria-hidden": "true", children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: expanded ? "▼" : "▶" }) })
38067
38677
  ] })
38068
38678
  ] }),
38069
- name && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-sm text-gray-900 dark:text-gray-100 mb-1", children: name }),
38679
+ name2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-sm text-gray-900 dark:text-gray-100 mb-1", children: name2 }),
38070
38680
  description2 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-300 leading-relaxed", children: description2 })
38071
38681
  ] })
38072
38682
  }
@@ -38248,6 +38858,7 @@ const ToolsTab = ({
38248
38858
  setSelectedTool,
38249
38859
  toolResult,
38250
38860
  nextCursor,
38861
+ error,
38251
38862
  resourceContent,
38252
38863
  onReadResource
38253
38864
  }) => {
@@ -38255,6 +38866,17 @@ const ToolsTab = ({
38255
38866
  const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
38256
38867
  const [isOutputSchemaExpanded, setIsOutputSchemaExpanded] = reactExports.useState(false);
38257
38868
  const [isMetaExpanded, setIsMetaExpanded] = reactExports.useState(false);
38869
+ const [hasValidationErrors, setHasValidationErrors] = reactExports.useState(false);
38870
+ const formRefs = reactExports.useRef({});
38871
+ const { toast: toast2 } = useToast();
38872
+ const { copied, setCopied } = useCopy();
38873
+ const checkValidationErrors = () => {
38874
+ const errors = Object.values(formRefs.current).some(
38875
+ (ref2) => ref2 && !ref2.validateJson().isValid
38876
+ );
38877
+ setHasValidationErrors(errors);
38878
+ return errors;
38879
+ };
38258
38880
  reactExports.useEffect(() => {
38259
38881
  const params2 = Object.entries(
38260
38882
  (selectedTool == null ? void 0 : selectedTool.inputSchema.properties) ?? []
@@ -38267,6 +38889,8 @@ const ToolsTab = ({
38267
38889
  )
38268
38890
  ]);
38269
38891
  setParams(Object.fromEntries(params2));
38892
+ setHasValidationErrors(false);
38893
+ formRefs.current = {};
38270
38894
  }, [selectedTool]);
38271
38895
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tools", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
38272
38896
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -38291,6 +38915,11 @@ const ToolsTab = ({
38291
38915
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-card border border-border rounded-lg shadow", children: [
38292
38916
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 border-b border-gray-200 dark:border-border", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold", children: selectedTool ? selectedTool.name : "Select a tool" }) }),
38293
38917
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", children: selectedTool ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
38918
+ error && /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", children: [
38919
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
38920
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
38921
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
38922
+ ] }),
38294
38923
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: selectedTool.description }),
38295
38924
  Object.entries(selectedTool.inputSchema.properties ?? []).map(
38296
38925
  ([key, value]) => {
@@ -38336,16 +38965,27 @@ const ToolsTab = ({
38336
38965
  id: key,
38337
38966
  name: key,
38338
38967
  placeholder: prop.description,
38339
- value: params[key] ?? "",
38340
- onChange: (e) => setParams({
38341
- ...params,
38342
- [key]: e.target.value === "" ? void 0 : e.target.value
38343
- }),
38968
+ value: params[key] === void 0 ? "" : String(params[key]),
38969
+ onChange: (e) => {
38970
+ const value2 = e.target.value;
38971
+ if (value2 === "") {
38972
+ setParams({
38973
+ ...params,
38974
+ [key]: void 0
38975
+ });
38976
+ } else {
38977
+ setParams({
38978
+ ...params,
38979
+ [key]: value2
38980
+ });
38981
+ }
38982
+ },
38344
38983
  className: "mt-1"
38345
38984
  }
38346
38985
  ) : prop.type === "object" || prop.type === "array" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38347
38986
  DynamicJsonForm,
38348
38987
  {
38988
+ ref: (ref2) => formRefs.current[key] = ref2,
38349
38989
  schema: {
38350
38990
  type: prop.type,
38351
38991
  properties: prop.properties,
@@ -38358,6 +38998,7 @@ const ToolsTab = ({
38358
38998
  ...params,
38359
38999
  [key]: newValue
38360
39000
  });
39001
+ setTimeout(checkValidationErrors, 100);
38361
39002
  }
38362
39003
  }
38363
39004
  ) }) : prop.type === "number" || prop.type === "integer" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -38367,19 +39008,35 @@ const ToolsTab = ({
38367
39008
  id: key,
38368
39009
  name: key,
38369
39010
  placeholder: prop.description,
38370
- value: params[key] ?? "",
39011
+ value: params[key] === void 0 ? "" : String(params[key]),
38371
39012
  onChange: (e) => {
38372
39013
  const value2 = e.target.value;
38373
- setParams({
38374
- ...params,
38375
- [key]: value2 === "" ? "" : Number(value2)
38376
- });
39014
+ if (value2 === "") {
39015
+ setParams({
39016
+ ...params,
39017
+ [key]: void 0
39018
+ });
39019
+ } else {
39020
+ const num = Number(value2);
39021
+ if (!isNaN(num)) {
39022
+ setParams({
39023
+ ...params,
39024
+ [key]: num
39025
+ });
39026
+ } else {
39027
+ setParams({
39028
+ ...params,
39029
+ [key]: value2
39030
+ });
39031
+ }
39032
+ }
38377
39033
  },
38378
39034
  className: "mt-1"
38379
39035
  }
38380
39036
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38381
39037
  DynamicJsonForm,
38382
39038
  {
39039
+ ref: (ref2) => formRefs.current[key] = ref2,
38383
39040
  schema: {
38384
39041
  type: prop.type,
38385
39042
  properties: prop.properties,
@@ -38392,6 +39049,7 @@ const ToolsTab = ({
38392
39049
  ...params,
38393
39050
  [key]: newValue
38394
39051
  });
39052
+ setTimeout(checkValidationErrors, 100);
38395
39053
  }
38396
39054
  }
38397
39055
  ) })
@@ -38454,27 +39112,53 @@ const ToolsTab = ({
38454
39112
  }
38455
39113
  )
38456
39114
  ] }),
38457
- /* @__PURE__ */ jsxRuntimeExports.jsx(
38458
- Button,
38459
- {
38460
- onClick: async () => {
38461
- try {
38462
- setIsToolRunning(true);
38463
- await callTool(selectedTool.name, params);
38464
- } finally {
38465
- setIsToolRunning(false);
38466
- }
38467
- },
38468
- disabled: isToolRunning,
38469
- children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
38470
- /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
38471
- "Running..."
38472
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
38473
- /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4 mr-2" }),
38474
- "Run Tool"
38475
- ] })
38476
- }
38477
- ),
39115
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
39116
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
39117
+ Button,
39118
+ {
39119
+ onClick: async () => {
39120
+ if (checkValidationErrors()) return;
39121
+ try {
39122
+ setIsToolRunning(true);
39123
+ await callTool(selectedTool.name, params);
39124
+ } finally {
39125
+ setIsToolRunning(false);
39126
+ }
39127
+ },
39128
+ disabled: isToolRunning || hasValidationErrors,
39129
+ children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
39130
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
39131
+ "Running..."
39132
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
39133
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4 mr-2" }),
39134
+ "Run Tool"
39135
+ ] })
39136
+ }
39137
+ ),
39138
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
39139
+ Button,
39140
+ {
39141
+ onClick: async () => {
39142
+ try {
39143
+ navigator.clipboard.writeText(
39144
+ JSON.stringify(params, null, 2)
39145
+ );
39146
+ setCopied(true);
39147
+ } catch (error2) {
39148
+ toast2({
39149
+ title: "Error",
39150
+ description: `There was an error copying input to the clipboard: ${error2 instanceof Error ? error2.message : String(error2)}`,
39151
+ variant: "destructive"
39152
+ });
39153
+ }
39154
+ },
39155
+ children: [
39156
+ copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckCheck, { className: "h-4 w-4 mr-2 dark:text-green-700 text-green-600" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "h-4 w-4 mr-2" }),
39157
+ "Copy Input"
39158
+ ]
39159
+ }
39160
+ )
39161
+ ] }),
38478
39162
  /* @__PURE__ */ jsxRuntimeExports.jsx(
38479
39163
  ToolResults,
38480
39164
  {
@@ -38645,6 +39329,11 @@ const App = () => {
38645
39329
  const [args, setArgs] = reactExports.useState(getInitialArgs);
38646
39330
  const [sseUrl, setSseUrl] = reactExports.useState(getInitialSseUrl);
38647
39331
  const [transportType, setTransportType] = reactExports.useState(getInitialTransportType);
39332
+ const [connectionType, setConnectionType] = reactExports.useState(
39333
+ () => {
39334
+ return localStorage.getItem("lastConnectionType") || "proxy";
39335
+ }
39336
+ );
38648
39337
  const [logLevel, setLogLevel] = reactExports.useState("debug");
38649
39338
  const [notifications, setNotifications] = reactExports.useState([]);
38650
39339
  const [roots, setRoots] = reactExports.useState([]);
@@ -38664,6 +39353,31 @@ const App = () => {
38664
39353
  const [oauthScope, setOauthScope] = reactExports.useState(() => {
38665
39354
  return localStorage.getItem("lastOauthScope") || "";
38666
39355
  });
39356
+ const [customHeaders, setCustomHeaders] = reactExports.useState(() => {
39357
+ const savedHeaders = localStorage.getItem("lastCustomHeaders");
39358
+ if (savedHeaders) {
39359
+ try {
39360
+ return JSON.parse(savedHeaders);
39361
+ } catch (error) {
39362
+ console.warn(
39363
+ `Failed to parse custom headers: "${savedHeaders}", will try legacy migration`,
39364
+ error
39365
+ );
39366
+ }
39367
+ }
39368
+ const legacyToken = localStorage.getItem("lastBearerToken") || "";
39369
+ const legacyHeaderName = localStorage.getItem("lastHeaderName") || "";
39370
+ if (legacyToken) {
39371
+ return migrateFromLegacyAuth(legacyToken, legacyHeaderName);
39372
+ }
39373
+ return [
39374
+ {
39375
+ name: "Authorization",
39376
+ value: "Bearer ",
39377
+ enabled: false
39378
+ }
39379
+ ];
39380
+ });
38667
39381
  const [pendingSampleRequests, setPendingSampleRequests] = reactExports.useState([]);
38668
39382
  const [pendingElicitationRequests, setPendingElicitationRequests] = reactExports.useState([]);
38669
39383
  const [isAuthDebuggerVisible, setIsAuthDebuggerVisible] = reactExports.useState(false);
@@ -38718,11 +39432,11 @@ const App = () => {
38718
39432
  args,
38719
39433
  sseUrl,
38720
39434
  env,
38721
- bearerToken,
38722
- headerName,
39435
+ customHeaders,
38723
39436
  oauthClientId,
38724
39437
  oauthScope,
38725
39438
  config,
39439
+ connectionType,
38726
39440
  onNotification: (notification) => {
38727
39441
  setNotifications((prev) => [...prev, notification]);
38728
39442
  },
@@ -38790,11 +39504,35 @@ const App = () => {
38790
39504
  localStorage.setItem("lastTransportType", transportType);
38791
39505
  }, [transportType]);
38792
39506
  reactExports.useEffect(() => {
38793
- localStorage.setItem("lastBearerToken", bearerToken);
39507
+ localStorage.setItem("lastConnectionType", connectionType);
39508
+ }, [connectionType]);
39509
+ reactExports.useEffect(() => {
39510
+ if (bearerToken) {
39511
+ localStorage.setItem("lastBearerToken", bearerToken);
39512
+ } else {
39513
+ localStorage.removeItem("lastBearerToken");
39514
+ }
38794
39515
  }, [bearerToken]);
38795
39516
  reactExports.useEffect(() => {
38796
- localStorage.setItem("lastHeaderName", headerName);
39517
+ if (headerName) {
39518
+ localStorage.setItem("lastHeaderName", headerName);
39519
+ } else {
39520
+ localStorage.removeItem("lastHeaderName");
39521
+ }
38797
39522
  }, [headerName]);
39523
+ reactExports.useEffect(() => {
39524
+ localStorage.setItem("lastCustomHeaders", JSON.stringify(customHeaders));
39525
+ }, [customHeaders]);
39526
+ reactExports.useEffect(() => {
39527
+ if (customHeaders.length === 0 && (bearerToken || headerName)) {
39528
+ const migratedHeaders = migrateFromLegacyAuth(bearerToken, headerName);
39529
+ if (migratedHeaders.length > 0) {
39530
+ setCustomHeaders(migratedHeaders);
39531
+ setBearerToken("");
39532
+ setHeaderName("");
39533
+ }
39534
+ }
39535
+ }, [bearerToken, headerName, customHeaders, setCustomHeaders]);
38798
39536
  reactExports.useEffect(() => {
38799
39537
  localStorage.setItem("lastOauthClientId", oauthClientId);
38800
39538
  }, [oauthClientId]);
@@ -39035,12 +39773,12 @@ const App = () => {
39035
39773
  );
39036
39774
  setNextResourceTemplateCursor(response.nextCursor);
39037
39775
  };
39038
- const getPrompt = async (name, args2 = {}) => {
39776
+ const getPrompt = async (name2, args2 = {}) => {
39039
39777
  lastToolCallOriginTabRef.current = currentTabRef.current;
39040
39778
  const response = await sendMCPRequest(
39041
39779
  {
39042
39780
  method: "prompts/get",
39043
- params: { name, arguments: args2 }
39781
+ params: { name: name2, arguments: args2 }
39044
39782
  },
39045
39783
  GetPromptResultSchema,
39046
39784
  "prompts"
@@ -39119,15 +39857,17 @@ const App = () => {
39119
39857
  setNextToolCursor(response.nextCursor);
39120
39858
  cacheToolOutputSchemas(response.tools);
39121
39859
  };
39122
- const callTool = async (name, params) => {
39860
+ const callTool = async (name2, params) => {
39123
39861
  lastToolCallOriginTabRef.current = currentTabRef.current;
39124
39862
  try {
39863
+ const tool = tools.find((t) => t.name === name2);
39864
+ const cleanedParams = (tool == null ? void 0 : tool.inputSchema) ? cleanParams(params, tool.inputSchema) : params;
39125
39865
  const response = await sendMCPRequest(
39126
39866
  {
39127
39867
  method: "tools/call",
39128
39868
  params: {
39129
- name,
39130
- arguments: params,
39869
+ name: name2,
39870
+ arguments: cleanedParams,
39131
39871
  _meta: {
39132
39872
  progressToken: progressTokenRef.current++
39133
39873
  }
@@ -39137,6 +39877,7 @@ const App = () => {
39137
39877
  "tools"
39138
39878
  );
39139
39879
  setToolResult(response);
39880
+ setErrors((prev) => ({ ...prev, tools: null }));
39140
39881
  } catch (e) {
39141
39882
  const toolResult2 = {
39142
39883
  content: [
@@ -39148,6 +39889,7 @@ const App = () => {
39148
39889
  isError: true
39149
39890
  };
39150
39891
  setToolResult(toolResult2);
39892
+ setErrors((prev) => ({ ...prev, tools: null }));
39151
39893
  }
39152
39894
  };
39153
39895
  const handleRootsChange = async () => {
@@ -39177,13 +39919,13 @@ const App = () => {
39177
39919
  ) });
39178
39920
  if (window.location.pathname === "/oauth/callback") {
39179
39921
  const OAuthCallback = React.lazy(
39180
- () => __vitePreload(() => import("./OAuthCallback-aXDAN43J.js"), true ? [] : void 0)
39922
+ () => __vitePreload(() => import("./OAuthCallback-C0JXhwud.js"), true ? [] : void 0)
39181
39923
  );
39182
39924
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
39183
39925
  }
39184
39926
  if (window.location.pathname === "/oauth/callback/debug") {
39185
39927
  const OAuthDebugCallback = React.lazy(
39186
- () => __vitePreload(() => import("./OAuthDebugCallback-BanjyQ_V.js"), true ? [] : void 0)
39928
+ () => __vitePreload(() => import("./OAuthDebugCallback-TZR9iqA_.js"), true ? [] : void 0)
39187
39929
  );
39188
39930
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
39189
39931
  }
@@ -39215,10 +39957,8 @@ const App = () => {
39215
39957
  setEnv,
39216
39958
  config,
39217
39959
  setConfig,
39218
- bearerToken,
39219
- setBearerToken,
39220
- headerName,
39221
- setHeaderName,
39960
+ customHeaders,
39961
+ setCustomHeaders,
39222
39962
  oauthClientId,
39223
39963
  setOauthClientId,
39224
39964
  oauthScope,
@@ -39227,7 +39967,9 @@ const App = () => {
39227
39967
  onDisconnect: disconnectMcpServer,
39228
39968
  logLevel,
39229
39969
  sendLogLevelRequest,
39230
- loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false
39970
+ loggingSupported: !!(serverCapabilities == null ? void 0 : serverCapabilities.logging) || false,
39971
+ connectionType,
39972
+ setConnectionType
39231
39973
  }
39232
39974
  ),
39233
39975
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -39395,9 +40137,9 @@ const App = () => {
39395
40137
  setPrompts([]);
39396
40138
  setNextPromptCursor(void 0);
39397
40139
  },
39398
- getPrompt: (name, args2) => {
40140
+ getPrompt: (name2, args2) => {
39399
40141
  clearError("prompts");
39400
- getPrompt(name, args2);
40142
+ getPrompt(name2, args2);
39401
40143
  },
39402
40144
  selectedPrompt,
39403
40145
  setSelectedPrompt: (prompt) => {
@@ -39425,10 +40167,10 @@ const App = () => {
39425
40167
  setNextToolCursor(void 0);
39426
40168
  cacheToolOutputSchemas([]);
39427
40169
  },
39428
- callTool: async (name, params) => {
40170
+ callTool: async (name2, params) => {
39429
40171
  clearError("tools");
39430
40172
  setToolResult(null);
39431
- await callTool(name, params);
40173
+ await callTool(name2, params);
39432
40174
  },
39433
40175
  selectedTool,
39434
40176
  setSelectedTool: (tool) => {