@mcp-use/inspector 20.0.0-beta.7 → 20.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{ChatTab-DtUGK07C.js → ChatTab-C-Ysv6Zf.js} +3 -3
- package/dist/cdn/{MarkdownRenderer-bX1BrKgI.js → MarkdownRenderer-CK_6n3T9.js} +1 -1
- package/dist/cdn/{PromptsTab-BlXDcau3.js → PromptsTab-DSGYL32k.js} +1 -1
- package/dist/cdn/{ResourcesTab-D45_JojP.js → ResourcesTab-d3wxN7xC.js} +2 -2
- package/dist/cdn/{SamplingTab-r7tImM6L.js → SamplingTab-DETdWNJk.js} +1 -1
- package/dist/cdn/{ToolsTab-DOAO8HnS.js → ToolsTab-BMcnfEWg.js} +2 -2
- package/dist/cdn/inspector.css +1 -1
- package/dist/cdn/inspector.js +2 -2
- package/dist/cdn/{telemetry-TwPKZlFf.js → telemetry-DjQn_Xm9.js} +1 -1
- package/dist/cdn/{useConfig-leHVjdjl.js → useConfig-B_adtnP1.js} +1 -1
- package/dist/cli.js +61 -2
- package/dist/client/index.js +1 -1
- package/dist/server/cdn-shell.d.ts.map +1 -1
- package/dist/server/cdn-shell.js +2 -2
- package/dist/server/{chunk-5GVQGIAX.js → chunk-BD3ROXCC.js} +1 -1
- package/dist/server/{chunk-VFVFLXKP.js → chunk-BPXKTFQ5.js} +1 -1
- package/dist/server/{chunk-UZZDBVKF.js → chunk-XTVIGRTB.js} +61 -2
- package/dist/server/cli.js +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/middleware.js +3 -3
- package/dist/server/version.js +1 -1
- package/dist/web/assets/{ChatTab-B6ubLbeA.js → ChatTab-DxD-KLW_.js} +1 -1
- package/dist/web/assets/{ConnectionSettingsTab-Cb2eDgEu.js → ConnectionSettingsTab-pO6p0U0f.js} +1 -1
- package/dist/web/assets/{ElicitationTab-CbnCrmu9.js → ElicitationTab-o5_z6gqe.js} +1 -1
- package/dist/web/assets/{MCPAppsDebugControls-sRglMhat.js → MCPAppsDebugControls-CZW1uZdH.js} +1 -1
- package/dist/web/assets/{ManufactOAuthCallback-D4uYGigW.js → ManufactOAuthCallback-BnWhf5bW.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-Cwxp9fLj.js → MarkdownRenderer-gUUHRIm1.js} +1 -1
- package/dist/web/assets/{McpAppsViewPanel-jQYFoZNX.js → McpAppsViewPanel-CDJDb4t-.js} +1 -1
- package/dist/web/assets/{NotificationsTab-DuSm762_.js → NotificationsTab-CkJ5E_sR.js} +1 -1
- package/dist/web/assets/{OAuthCallback-VLHlUe2c.js → OAuthCallback-Dv_mFcua.js} +1 -1
- package/dist/web/assets/{PromptsTab-DK6XZxR8.js → PromptsTab-CLwWFf6d.js} +1 -1
- package/dist/web/assets/{ResourcesTab-CUE4MAtJ.js → ResourcesTab-B8cnuq-m.js} +1 -1
- package/dist/web/assets/{SamplingTab-BYNkVCTu.js → SamplingTab-BjYHYRHX.js} +1 -1
- package/dist/web/assets/{ServerMetadataTab-DWjNFMbq.js → ServerMetadataTab-CPlclbb7.js} +1 -1
- package/dist/web/assets/{ToolsTab-BisWWY2p.js → ToolsTab-BSSwvp4Q.js} +2 -2
- package/dist/web/assets/{ViewPreview-COrmPpRr.js → ViewPreview-C_LJdgt9.js} +1 -1
- package/dist/web/assets/{checkbox-B6dtF73d.js → checkbox-BuuDhnpk.js} +1 -1
- package/dist/web/assets/{dist-9Oy7e0v8.js → dist-C39gcmyH.js} +3 -3
- package/dist/web/assets/{index-BMaSsizY.js → index-CyvvaDNR.js} +2 -2
- package/dist/web/assets/index-bCIH1Sdx.css +1 -0
- package/dist/web/assets/{shared-CFs9CZfB.js → shared-Chk1rURG.js} +1 -1
- package/dist/web/assets/{tabs-subtle-D2XkWhLL.js → tabs-subtle-CK4nucyB.js} +1 -1
- package/dist/web/assets/{useConfig-B6tXvJOb.js → useConfig-CgQbKjVT.js} +1 -1
- package/dist/web/assets/{useViewHostProps-DZqOwiAm.js → useViewHostProps-DFI7Ywo7.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +4 -4
- package/dist/web/assets/index-D7TVTIt9.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTab-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTab-DxD-KLW_.js","assets/react-CU_d2d5K.js","assets/button-C8Xa2k4x.js","assets/createLucideIcon-BEHeJH0M.js","assets/FormContext-sV-yByKz.js","assets/input-C0OQCUZy.js","assets/select-D6jzbLJn.js","assets/AnimatePresence-FfDQQNFJ.js","assets/label-CI7JWQOo.js","assets/tabs-subtle-CK4nucyB.js","assets/refresh-cw-B5iaAZKn.js","assets/MarkdownRenderer-gUUHRIm1.js","assets/checkbox-BuuDhnpk.js","assets/dist-C39gcmyH.js","assets/useConfig-CgQbKjVT.js","assets/schemaHelpers-DLNTQr_6.js","assets/McpAppsViewPanel-CDJDb4t-.js","assets/WidgetWrapper-cv_BM1bY.js","assets/useViewHostProps-DFI7Ywo7.js","assets/textarea-CRTXuRmE.js","assets/ToolsTab-BSSwvp4Q.js","assets/MCPAppsDebugControls-CZW1uZdH.js","assets/maximize-2-Br1WQzT2.js","assets/sparkles-BGYTDThM.js","assets/zap-BDWHCVHU.js","assets/code-B14rVdNt.js","assets/shared-Chk1rURG.js","assets/ListTabHeader-CrGae306.js","assets/maximize-CJNgRe6S.js","assets/save-TM6fvNrt.js","assets/PromptsTab-CLwWFf6d.js","assets/ResourcesTab-B8cnuq-m.js","assets/brush-DX0UZ_pI.js","assets/SamplingTab-BjYHYRHX.js","assets/ElicitationTab-o5_z6gqe.js","assets/NotificationsTab-CkJ5E_sR.js","assets/ServerMetadataTab-CPlclbb7.js","assets/inspector-settings-layout-yjKRJDai.js","assets/ConnectionSettingsTab-pO6p0U0f.js","assets/OAuthCallback-Dv_mFcua.js","assets/ManufactOAuthCallback-BnWhf5bW.js","assets/ViewPreview-C_LJdgt9.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,i as t,n,s as r,t as i}from"./react-CU_d2d5K.js";import{$ as a,$n as o,A as s,At as c,B as l,Bn as u,Ct as d,D as f,Dn as p,Dt as m,E as h,En as g,F as _,G as v,Gt as y,I as b,It as x,J as S,K as C,Kn as w,Kt as T,L as E,Lt as ee,M as D,Mn as te,Mt as ne,N as re,Nn as O,Nt as ie,O as k,Ot as A,P as j,Pn as ae,Pt as oe,Q as se,R as ce,Rn as M,Rt as N,S as le,St as ue,T as de,Tn as fe,Tt as pe,U as me,Un as he,Ut as ge,Wn as _e,X as ve,Y as ye,Yn as be,Z as xe,Zn as P,_ as Se,_t as Ce,a as we,an as Te,ar as Ee,at as De,b as Oe,c as ke,cr as Ae,ct as je,dt as Me,et as Ne,f as Pe,ft as Fe,g as Ie,gt as Le,h as Re,hn as ze,ht as Be,i as Ve,in as He,ir as Ue,it as We,j as Ge,jt as Ke,k as qe,kn as Je,kt as Ye,lt as Xe,m as Ze,mn as Qe,mt as $e,n as et,nr as tt,o as nt,on as rt,or as it,ot as at,pt as ot,q as st,qt as ct,r as lt,rn as ut,rr as dt,rt as ft,s as pt,sr as F,st as mt,t as ht,tt as gt,ut as _t,v as vt,vt as yt,w as bt,wn as xt,wt as St,x as Ct,y as wt,yt as Tt,z as Et,zn as Dt}from"./input-C0OQCUZy.js";import{n as Ot,t as I}from"./createLucideIcon-BEHeJH0M.js";import{B as kt,D as At,H as L,M as jt,O as Mt,V as Nt,_ as Pt,a as Ft,c as It,d as Lt,g as Rt,h as zt,j as Bt,m as Vt,o as Ht,p as Ut,s as Wt,t as Gt,u as Kt,v as qt,z as Jt}from"./button-C8Xa2k4x.js";import{n as Yt,t as Xt}from"./label-CI7JWQOo.js";import{b as Zt,l as Qt,r as $t,t as en}from"./AnimatePresence-FfDQQNFJ.js";import{C as tn,S as nn,T as rn,_ as an,a as on,b as sn,c as cn,d as ln,f as un,g as dn,h as fn,i as pn,l as mn,m as hn,n as gn,p as _n,r as vn,t as yn,u as bn,v as xn,w as Sn,x as Cn,y as wn}from"./select-D6jzbLJn.js";import{c as Tn,i as En,l as Dn,o as On,r as kn,t as An}from"./FormContext-sV-yByKz.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var jn=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=ee,D=function(){ne.postMessage(null)}}else D=function(){_(ee,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Mn=n(((e,t)=>{t.exports=jn()})),Nn=n((e=>{var t=Mn(),n=i(),r=Ae();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function O(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?O(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return O(e(t))}catch{}}return null}var ie=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={pending:!1,data:null,method:null,action:null},ae=[],oe=-1;function se(e){return{current:e}}function ce(e){0>oe||(e.current=ae[oe],ae[oe]=null,oe--)}function M(e,t){oe++,ae[oe]=e.current,e.current=t}var N=se(null),le=se(null),ue=se(null),de=se(null);function fe(e,t){switch(M(ue,t),M(le,e),M(N,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ef(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ef(t),e=tf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ce(N),M(N,e)}function pe(){ce(N),ce(le),ce(ue)}function me(e){e.memoizedState!==null&&M(de,e);var t=N.current,n=tf(t,e.type);t!==n&&(M(le,e),M(N,n))}function he(e){le.current===e&&(ce(N),ce(le)),de.current===e&&(ce(de),up._currentValue=j)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+ge+e+_e}var ye=!1;function be(e,t){if(!e||ye)return``;ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -496,4 +496,4 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
496
496
|
# (optional) Use environment variables instead:
|
|
497
497
|
# env_http_headers = { `;let e=i.map(({name:e,header:t})=>`"${t}" = "${e}"`);r+=e.join(`, `),r+=` }`}}return{config:r,envVars:i}}function VL(e){if(e.length===0)return``;let t=`Set these environment variables in your shell:
|
|
498
498
|
|
|
499
|
-
`;for(let{name:n}of e)t+=`export ${n}="your-${n}-value"\n`;return t}function HL({className:e,size:t=`md`}){return(0,R.jsxs)(`svg`,{viewBox:`0 0 500 500`,className:L(`text-current`,{sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`}[t],e),fill:`currentColor`,fillRule:`nonzero`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M105.933 0C164.437 0.000116002 211.865 47.607 211.865 106.333C211.865 131.829 210.493 158.403 221.068 181.602L228.975 198.947C243.584 230.997 269.265 256.7 301.303 271.336L316.155 278.121C340.142 289.079 367.694 287.335 394.066 287.335C452.571 287.335 499.999 334.942 499.999 393.668C499.999 452.394 452.571 500.001 394.066 500.001C335.562 500.001 288.134 452.394 288.134 393.668C288.134 368.974 289.24 343.275 278.992 320.807L270.586 302.38C255.948 270.29 230.214 244.565 198.118 229.939L180.164 221.758C157.282 211.331 131.078 212.666 105.933 212.666C47.4278 212.666 4.86252e-05 165.059 0 106.333C0 47.607 47.4278 0 105.933 0Z`}),(0,R.jsx)(`circle`,{cx:`100.426`,cy:`399.575`,r:`100.426`}),(0,R.jsx)(`path`,{d:`M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z`})]})}function UL({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,R.jsx)(`path`,{d:`M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z`})})}function WL({className:e}){return(0,R.jsxs)(`svg`,{fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,className:e,xmlns:`http://www.w3.org/2000/svg`,"aria-label":`ModelContextProtocol`,children:[(0,R.jsx)(`path`,{d:`M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z`}),(0,R.jsx)(`path`,{d:`M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z`})]})}function GL({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,R.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}function KL({isOpen:e,onOpenChange:t,tools:n,prompts:r,resources:i,savedRequests:a,connections:o,selectedServer:s,tunnelUrl:c,onNavigate:l,onServerSelect:u}){let[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(0),h=(0,z.useRef)(null),g=(0,z.useRef)(null),_=sP(),y=kt.pill,{activeIndex:b,itemRects:x,sessionRef:S,handlers:C,registerItem:w,measureItems:T}=_n(h),E=s?c?`${c}/mcp`:s.url:null,ee=s?.name||`MCP Server`,D=s?MM(s):void 0,te=s?[{id:`open-in-cursor`,name:`Open in Cursor`,description:`Add this server to Cursor`,type:`global`,category:`Open in Client`,action:()=>{try{let e=NL(E,ee,D);window.location.href=e,oI.success(`Opening in Cursor...`),t(!1)}catch{oI.error(`Failed to open in Cursor`)}}},{id:`open-in-claude-code`,name:`Open in Claude Code`,description:`Add this server to Claude Code CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=RL(E,ee,D);lM(e),oI.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-claude-desktop`,name:`Open in Claude Desktop`,description:`Download .mcpb configuration file`,type:`global`,category:`Open in Client`,action:()=>{try{LL(E,ee,D),oI.success(`Downloaded .mcpb file`),t(!1)}catch{oI.error(`Failed to download configuration file`)}}},{id:`open-in-vscode`,name:`Open in VS Code`,description:`Add this server to VS Code`,type:`global`,category:`Open in Client`,action:()=>{try{let e=PL(E,ee,D);window.location.href=e,oI.success(`Opening in VS Code...`),t(!1)}catch{oI.error(`Failed to open in VS Code`)}}},{id:`open-in-vscode-insiders`,name:`Open in VS Code Insiders`,description:`Add this server to VS Code Insiders`,type:`global`,category:`Open in Client`,action:()=>{try{let e=FL(E,ee,D);window.location.href=e,oI.success(`Opening in VS Code Insiders...`),t(!1)}catch{oI.error(`Failed to open in VS Code Insiders`)}}},{id:`open-in-gemini`,name:`Open in Gemini CLI`,description:`Add this server to Gemini CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=zL(E,ee,D);lM(e),oI.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-codex`,name:`Open in Codex CLI`,description:`Add this server to Codex CLI`,type:`global`,category:`Open in Client`,action:()=>{let{config:e}=BL(E,ee,D);lM(e),oI.success(`Config copied to clipboard`),t(!1)}}]:[],ne=[{id:`connect-server`,name:`Connect Server`,description:`Add a new MCP server connection`,type:`global`,category:`Navigation`,action:()=>_(`/`)},{id:`mcp-use-website`,name:`MCP Use Website`,description:`Visit mcp-use.com for tools and resources`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com`,`_blank`)},{id:`mcp-use-docs`,name:`How to Create an MCP Server`,description:`Step-by-step guide to building MCP servers`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com/docs`,`_blank`)},{id:`mcp-docs`,name:`MCP Official Documentation`,description:`Learn about the Model Context Protocol`,type:`global`,category:`Documentation`,action:()=>window.open(`https://modelcontextprotocol.io/docs/getting-started/intro`,`_blank`)},{id:`discord`,name:`Join Discord Community`,description:`Connect with the MCP community`,type:`global`,category:`Community`,action:()=>window.open(`https://discord.gg/XkNkSkMz3V`,`_blank`)},{id:`clear-localstorage`,name:`Clear localStorage & Reload`,description:`Having trouble connecting? Clear stored auth data and refresh`,type:`global`,category:`Troubleshooting`,action:()=>{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n.startsWith(`mcp:auth`)||n.startsWith(`mcp-inspector`))&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),oI.success(`Cleared ${e.length} localStorage item(s). Refreshing page...`,{duration:2e3}),setTimeout(()=>{window.location.reload()},500),t(!1)}}],re=o.map(e=>({id:`server-${e.id}`,name:bM(e),description:`Connected server (${e.state})`,type:`global`,category:`Connected Servers`,metadata:{serverId:e.id,state:e.state},action:()=>u(e.id)})),O=[...ne,...te,...re,...n.map(e=>({id:`tool-${e.name}`,name:e.name,description:e.description,type:`tool`,category:e._serverName?`Tools - ${e._serverName}`:`Tools`,metadata:{inputSchema:e.inputSchema,serverId:e._serverId,serverName:e._serverName}})),...r.map(e=>({id:`prompt-${e.name}`,name:e.name,description:e.description,type:`prompt`,category:e._serverName?`Prompts - ${e._serverName}`:`Prompts`,metadata:{arguments:e.arguments,serverId:e._serverId,serverName:e._serverName}})),...i.map(e=>({id:`resource-${e.uri}`,name:e.name,description:e.description,type:`resource`,category:e._serverName?`Resources - ${e._serverName}`:`Resources`,metadata:{uri:e.uri,mimeType:e.mimeType,serverId:e._serverId,serverName:e._serverName}})),...a.map(e=>({id:`saved-${e.id}`,name:e.name,description:`Saved request for ${e.toolName}`,type:`saved-request`,category:`Saved Requests`,metadata:{toolName:e.toolName,args:e.args,savedAt:e.savedAt,serverId:e.serverId,serverName:e.serverName}}))].filter(e=>d.trim()?`${e.name} ${e.description||``} ${e.category}`.toLowerCase().includes(d.trim().toLowerCase()):!0),ie=(0,z.useCallback)(e=>{if(console.warn(`[CommandPalette] Item selected:`,{itemType:e.type,itemName:e.name,itemId:e.id,metadata:e.metadata}),e.action)console.warn(`[CommandPalette] Executing action for global item`),e.action(),t(!1);else if(e.type===`global`)e.metadata?.serverId&&(console.warn(`[CommandPalette] Selecting server:`,e.metadata.serverId),u(e.metadata.serverId),t(!1));else{let n=e.type===`resource`?e.metadata?.uri:e.name,r=e.type===`tool`?`tools`:e.type===`prompt`?`prompts`:e.type===`saved-request`?`tools`:`resources`;console.warn(`[CommandPalette] Navigating to item:`,{tab:r,itemIdentifier:n,serverId:e.metadata?.serverId}),l(r,n,e.metadata?.serverId),t(!1)}},[l,t,u]),k=(e,t,n)=>{switch(e){case`tool`:return(0,R.jsx)(`div`,{className:`bg-blue-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Yi,{className:`h-4 w-4 text-blue-500`})});case`prompt`:return(0,R.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(yi,{className:`h-4 w-4 text-purple-500`})});case`resource`:return(0,R.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Qr,{className:`h-4 w-4 text-green-500`})});case`saved-request`:return(0,R.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(ri,{className:`h-4 w-4 text-orange-500`})});case`global`:if(t===`Navigation`)return(0,R.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Ai,{className:`h-4 w-4 text-gray-600 dark:text-gray-300`})});if(t===`Open in Client`){if(n?.includes(`Cursor`))return(0,R.jsx)(`div`,{className:`bg-gray-200 dark:bg-gray-800 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/cursor`,alt:`Cursor`,className:`h-4 w-4`})});if(n?.includes(`Claude Code`)||n?.includes(`Claude Desktop`))return(0,R.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`})});if(n?.includes(`VS Code`))return(0,R.jsx)(`div`,{className:`bg-blue-600/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(UL,{className:`h-4 w-4 text-blue-600`})});if(n?.includes(`Gemini`))return(0,R.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/googlegemini`,alt:`Gemini`,className:`h-4 w-4`})});if(n?.includes(`Codex`))return(0,R.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://inspector-cdn.mcp-use.com/providers/openai.png`,alt:`Codex`,className:`h-4 w-4`})})}return t===`Documentation`?n?.includes(`MCP Use`)||n?.includes(`mcp-use`)?(0,R.jsx)(`div`,{className:`bg-black/10 dark:bg-white/10 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(HL,{className:`h-4 w-4 text-black dark:text-white`,size:`sm`})}):(0,R.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Yr,{className:`h-4 w-4 text-orange-500`})}):t===`Community`?(0,R.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(GL,{className:`h-4 w-4 text-purple-500`})}):t===`Troubleshooting`?(0,R.jsx)(`div`,{className:`bg-yellow-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Pr,{className:`h-4 w-4 text-yellow-500`})}):t===`Connected Servers`?(0,R.jsx)(`div`,{className:`bg-cyan-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Fi,{className:`h-4 w-4 text-cyan-500`})}):(0,R.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Yr,{className:`h-4 w-4 text-gray-500`})});default:return(0,R.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(v,{className:`h-4 w-4 text-gray-500`})})}};(0,z.useEffect)(()=>{e&&(f(``),m(0),requestAnimationFrame(()=>g.current?.focus()))},[e]),(0,z.useEffect)(()=>{h.current&&(h.current.scrollTop=0),m(0)},[d]),(0,z.useEffect)(()=>{p>=O.length&&m(Math.max(0,O.length-1))},[p,O.length]),(0,z.useLayoutEffect)(()=>{e&&T()},[e,T,O]);let A=x[p]??null,j=b===null?null:x[b],ae=b!==null&&b!==p;return e?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:`fixed inset-0 z-50 bg-black/40 backdrop-blur-sm`,"aria-label":`Close command palette`,onClick:()=>t(!1)}),(0,R.jsxs)(`div`,{role:`dialog`,"aria-label":`Command Palette`,"data-testid":`command-palette-dialog`,className:`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[51] max-w-[640px] w-[calc(100vw-2rem)] sm:w-full p-2 bg-white dark:bg-zinc-900/90 backdrop-blur-xl rounded-xl overflow-hidden border border-border shadow-[var(--cmdk-shadow)] transition-transform duration-100 ease-out outline-none`,onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),m(e=>Math.min(e+1,O.length-1))):e.key===`ArrowUp`?(e.preventDefault(),m(e=>Math.max(e-1,0))):e.key===`Enter`&&O[p]?(e.preventDefault(),ie(O[p])):e.key===`Escape`&&(e.preventDefault(),t(!1))},children:[(0,R.jsx)(`input`,{ref:g,placeholder:`What do you need?`,value:d,onChange:e=>f(e.target.value),className:`border-none w-full text-[17px] px-4 pt-2 pb-4 outline-none bg-transparent text-foreground border-b border-border mb-0 rounded-none placeholder:text-muted-foreground`,"data-testid":`command-palette-input`}),(0,R.jsxs)(`div`,{ref:h,onMouseEnter:C.onMouseEnter,onMouseMove:C.onMouseMove,onMouseLeave:C.onMouseLeave,className:`relative isolate min-h-[200px] sm:min-h-[330px] max-h-[400px] overflow-auto overscroll-contain transition-[height] duration-100 ease-out px-1`,"data-testid":`command-palette-list`,children:[(0,R.jsx)(en,{children:A&&(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:L(`pointer-events-none absolute bg-active`,y.bg),initial:!1,animate:{top:A.top,left:A.left,width:A.width,height:A.height,opacity:ae?.8:1},exit:{opacity:0,transition:pt.moderate.exit},transition:{...pt.moderate,opacity:{duration:.08}}})}),(0,R.jsx)(en,{children:j&&(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:L(`pointer-events-none absolute bg-hover`,y.bg),initial:{opacity:0,top:A?.top??j.top,left:A?.left??j.left,width:A?.width??j.width,height:A?.height??j.height},animate:{opacity:1,top:j.top,left:j.left,width:j.width,height:j.height},exit:{opacity:0,transition:pt.fast.exit},transition:{...pt.fast,opacity:{duration:.08}}},S.current)}),O.length===0?(0,R.jsx)(`div`,{className:`text-sm flex items-center justify-center h-12 whitespace-pre-wrap text-muted-foreground`,children:`No results found.`}):O.map((e,t)=>(0,R.jsxs)(`button`,{ref:e=>w(t,e),type:`button`,"data-testid":`command-palette-item-${e.id}`,"data-proximity-index":t,onClick:()=>ie(e),className:`[content-visibility:auto] relative z-10 cursor-pointer h-12 text-sm flex items-center gap-3 px-3 text-foreground select-none w-full text-left mt-1 first:mt-0`,children:[k(e.type,e.category,e.name),(0,R.jsx)(`span`,{className:`font-medium truncate flex-1 min-w-0`,children:e.name}),(()=>{let t=e.metadata?.serverId;if(!t||e.category===`Connected Servers`)return null;let n=o.find(e=>e.id===t);return n?(0,R.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 text-muted-foreground`,children:[(0,R.jsx)(xL,{server:n,size:`xs`}),(0,R.jsx)(`span`,{className:`text-xs truncate max-w-[9rem]`,children:bM(n)})]}):null})()]},e.id))]}),(0,R.jsxs)(`div`,{className:`border-t border-border px-4 py-3 pb-1 flex items-center justify-between text-xs text-muted-foreground `,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`t`}),(0,R.jsx)(`span`,{children:`Tools`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`p`}),(0,R.jsx)(`span`,{children:`Prompts`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`r`}),(0,R.jsx)(`span`,{children:`Resources`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`c`}),(0,R.jsx)(`span`,{children:`Chat`})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`h`}),(0,R.jsx)(`span`,{children:`Home`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center px-2 h-5 font-mono text-[10px] font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`esc`}),(0,R.jsx)(`span`,{children:`Close`})]})]})]})]})]}):null}var qL=`openid profile email offline_access`,JL=`mcp-inspector:manufact-auth`,YL=`manufact:session-changed`,XL={loaded:!0,authorizing:!1,accessToken:null,user:null,mode:null},ZL=new Map,QL=new Set,$L=new Map,eR=new Map,tR=null,nR=!1;typeof window<`u`&&window.addEventListener(`message`,e=>{if(e.data?.type!==`manufact:invalidate-oauth-client`)return;for(let e of ZL.keys())iR()?.removeItem(uR(e,`client`));let t=tR;!t||nR||(nR=!0,MR(t,{isRetry:!0}).finally(()=>{nR=!1}))});function rR(e){let t=ZL.get(e);if(t)return t;let n={...XL,loaded:!1};return ZL.set(e,n),n}function iR(){return typeof window>`u`?null:window.localStorage}function aR(e){return new URL(e).origin}function oR(e,t){let n=new URL(e),r=new URL(t),i=new Set([`localhost`,`127.0.0.1`]);return i.has(n.hostname)&&i.has(r.hostname)?n.origin===r.origin:(n.hostname===`manufact.com`||n.hostname.endsWith(`.manufact.com`))&&(r.hostname===`manufact.com`||r.hostname.endsWith(`.manufact.com`))}function sR(e){let t=window.__MANUFACT_LOGIN_URL__;if(t)return new URL(t).origin;let n=new URL(e);return n.hostname===`localhost`||n.hostname===`127.0.0.1`?`${n.protocol}//${n.hostname}:3000`:`${n.protocol}//manufact.com`}function cR(e){return`${sR(e)}/login`}function lR(e){return`${sR(e)}/auth/embedded-sign-out`}function uR(e,t){return`${JL}:${t}:${e}`}function dR(e){return iR()?.getItem(uR(e,`skip-session`))===`1`}function fR(e,t){let n=uR(e,`skip-session`);t?iR()?.setItem(n,`1`):iR()?.removeItem(n)}function pR(e){return`${JL}:state:${e}`}function mR(e){let t=iR()?.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return iR()?.removeItem(e),null}}function hR(e,t){iR()?.setItem(e,JSON.stringify(t))}function gR(e,t){ZL.set(e,{...ZL.get(e)??XL,...t}),QL.forEach(e=>e()),window.dispatchEvent(new CustomEvent(YL))}function _R(e){let t=``;return e.forEach(e=>{t+=String.fromCharCode(e)}),btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function vR(e=32){let t=new Uint8Array(e);return crypto.getRandomValues(t),_R(t)}async function yR(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return _R(new Uint8Array(t))}async function bR(e){let t=await fetch(`${e}/api/auth/.well-known/openid-configuration`);if(!t.ok)throw Error(`Manufact OAuth discovery failed`);return await t.json()}function xR(){return`${window.location.origin}${mM()}/auth/callback`}function SR(e){return e===`localhost`||e===`127.0.0.1`}function CR(e){try{let t=new URL(e).hostname,n=typeof window<`u`?new URL(window.location.href).hostname:``;return SR(t)&&SR(n)}catch{return!1}}async function wR(e,t,n){let r=new URL(`${e}/api/auth/oauth2/authorize`);r.searchParams.set(`response_type`,`code`),r.searchParams.set(`client_id`,t),r.searchParams.set(`redirect_uri`,n),r.searchParams.set(`scope`,qL),r.searchParams.set(`code_challenge`,await yR(vR(32))),r.searchParams.set(`code_challenge_method`,`S256`),r.searchParams.set(`state`,`client-probe`),r.searchParams.set(`prompt`,`none`);try{let e=await fetch(r.toString(),{method:`GET`,redirect:`manual`,credentials:`include`}),t=e.headers.get(`location`)??``;return t.includes(`/auth/error`)&&t.includes(`invalid_client`)?!1:e.status>=300&&e.status<400||e.type===`opaqueredirect`?!!t&&!t.includes(`/auth/error`):!0}catch{return!1}}async function TR(e,t){let n=xR(),r=uR(e,`client`),i=mR(r),a=CR(e);if(!a&&i?.client_id&&i.redirect_uri===n){if(await wR(e,i.client_id,n))return i;iR()?.removeItem(r)}else a&&i?.client_id&&iR()?.removeItem(r);if(!t.registration_endpoint)throw Error(`Manufact OAuth registration is unavailable`);let o=await fetch(t.registration_endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client_name:`mcp-use Inspector`,redirect_uris:[n],grant_types:[`authorization_code`,`refresh_token`],response_types:[`code`],token_endpoint_auth_method:`none`,scope:qL})});if(!o.ok)throw Error(`Could not register Inspector with Manufact`);let s=await o.json();if(!s.client_id)throw Error(`Manufact returned no OAuth client ID`);let c={...s,redirect_uri:n};return hR(r,c),c}async function ER(e,t){let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams(t)}),r=await n.json().catch(()=>({}));if(!n.ok||!r.access_token)throw Error(r.error_description??`Manufact token exchange failed`);return{access_token:r.access_token,refresh_token:r.refresh_token,token_type:r.token_type,expires_at:Date.now()+(r.expires_in??3600)*1e3}}async function DR(e,t){if(!t.refresh_token)return null;let n=eR.get(e);if(n)return n;let r=(async()=>{try{let n=await bR(e),r=mR(uR(e,`client`));if(!r?.client_id)return null;let i=await ER(n.token_endpoint,{grant_type:`refresh_token`,refresh_token:t.refresh_token,client_id:r.client_id}),a={...i,refresh_token:i.refresh_token??t.refresh_token};return hR(uR(e,`tokens`),a),a}catch{return iR()?.removeItem(uR(e,`tokens`)),null}finally{eR.delete(e)}})();return eR.set(e,r),r}async function OR(e){let t=mR(uR(e,`tokens`));return t?.access_token?t.expires_at>Date.now()+3e4?t:DR(e,t):null}async function kR(e,t){let n=await bR(e);if(!n.userinfo_endpoint)return null;let r=await fetch(n.userinfo_endpoint,{headers:{Authorization:`Bearer ${t}`}});if(!r.ok)return null;let i=await r.json();return i.sub?{id:i.sub,name:i.name,email:i.email,image:i.picture}:null}async function AR(e){try{let t=await fetch(`${e}/api/auth/get-session`,{credentials:`include`});return t.ok?(await t.json())?.user??null:null}catch{return null}}async function jR(e){let t=$L.get(e);if(t)return t;ZL.set(e,{...ZL.get(e)??XL,loaded:!1});let n=(async()=>{try{let t=oR(typeof window<`u`?window.location.href:e,e),n=dR(e),r=await OR(e),i=r?await kR(e,r.access_token):null;if(i&&r){fR(e,!1),gR(e,{loaded:!0,accessToken:r.access_token,user:i,mode:`oauth`});return}r&&!i&&iR()?.removeItem(uR(e,`tokens`));let a=t&&!n?await AR(e):null;if(a){gR(e,{loaded:!0,accessToken:null,user:a,mode:`session`});return}gR(e,{loaded:!0,accessToken:null,user:null,mode:null})}catch{gR(e,{loaded:!0,accessToken:null,user:null,mode:null})}})().finally(()=>$L.delete(e));return $L.set(e,n),n}async function MR(e,t){let n=aR(e);tR=e,fR(n,!1);let r=window.open(``,`manufact-oauth`,`width=600,height=700,resizable=yes,scrollbars=yes`);if(!r)throw Error(`Allow popups to sign in with Manufact`);if(gR(n,{authorizing:!0}),oR(window.location.href,n)){r.location.href=cR(n);let e=window.setInterval(async()=>{if(r.closed){window.clearInterval(e),gR(n,{authorizing:!1});return}let t=await AR(n);t&&(window.clearInterval(e),r.close(),gR(n,{loaded:!0,authorizing:!1,accessToken:null,user:t,mode:`session`}))},1e3);return}try{let e=await bR(n),t=await TR(n,e),i=vR(64),a=vR(),o=xR();hR(pR(a),{authOrigin:n,clientId:t.client_id,redirectUri:o,codeVerifier:i,expiresAt:Date.now()+600*1e3});let s=new URL(e.authorization_endpoint);s.searchParams.set(`response_type`,`code`),s.searchParams.set(`client_id`,t.client_id),s.searchParams.set(`redirect_uri`,o),s.searchParams.set(`scope`,qL),s.searchParams.set(`state`,a),s.searchParams.set(`code_challenge`,await yR(i)),s.searchParams.set(`code_challenge_method`,`S256`),s.searchParams.set(`prompt`,`consent`),r.location.href=s.toString();let c=window.setInterval(()=>{r.closed&&(window.clearInterval(c),jR(n).finally(()=>gR(n,{authorizing:!1})))},500)}catch(e){throw r.close(),gR(n,{authorizing:!1}),e}}async function NR(e=new URL(window.location.href)){let t=e.searchParams.get(`state`),n=e.searchParams.get(`code`),r=e.searchParams.get(`error_description`)??e.searchParams.get(`error`);if(r)throw Error(r);if(!t||!n)throw Error(`Missing OAuth code or state`);let i=pR(t),a=mR(i);if(iR()?.removeItem(i),!a||a.expiresAt<Date.now())throw Error(`OAuth state is invalid or expired`);let o=await ER((await bR(a.authOrigin)).token_endpoint,{grant_type:`authorization_code`,code:n,redirect_uri:a.redirectUri,client_id:a.clientId,code_verifier:a.codeVerifier});hR(uR(a.authOrigin,`tokens`),o),fR(a.authOrigin,!1);let s=await kR(a.authOrigin,o.access_token);gR(a.authOrigin,{loaded:!0,authorizing:!1,accessToken:o.access_token,user:s,mode:`oauth`}),window.opener?.postMessage({type:`manufact:oauth-complete`,authOrigin:a.authOrigin},window.location.origin)}function PR(e){let t=aR(e);iR()?.removeItem(uR(t,`tokens`)),gR(t,{loaded:!0,authorizing:!1,accessToken:null,user:null,mode:null})}async function FR(e){let t=mR(uR(e,`tokens`)),n=mR(uR(e,`client`)),r=t?.refresh_token??t?.access_token;if(!n?.client_id||!r)return null;try{let i=(await bR(e)).revocation_endpoint??`${e}/api/auth/oauth2/revoke`;return(await fetch(i,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({client_id:n.client_id,token:r,token_type_hint:t?.refresh_token?`refresh_token`:`access_token`})})).status}catch{return-1}}async function IR(e){let t=sR(e),n=window.open(lR(e),`manufact-sign-out`,`width=420,height=320`);return n?new Promise(r=>{let i=!1,a=e=>{i||(i=!0,window.clearTimeout(o),window.clearInterval(c),window.removeEventListener(`message`,s),r(e))},o=window.setTimeout(()=>{a({attempted:!0,signOutOk:!1,signOutStatus:null})},3e4),s=e=>{e.origin===t&&e.data?.type===`manufact:sign-out-complete`&&a({attempted:!0,signOutOk:!0,signOutStatus:200})},c=window.setInterval(()=>{n.closed&&AR(e).then(e=>{a({attempted:!0,signOutOk:!e,signOutStatus:e?401:200})})},500);window.addEventListener(`message`,s)}):{attempted:!0,signOutOk:!1,signOutStatus:null}}async function LR(e,t){let n=aR(e),r=!!mR(uR(n,`tokens`))?.access_token;t===`oauth`||r?(await FR(n),fR(n,!0)):t===`session`&&(await IR(n),fR(n,!1)),PR(e)}function RR(e){let t=e?aR(e):null,n=(0,z.useSyncExternalStore)((0,z.useCallback)(e=>(QL.add(e),()=>QL.delete(e)),[]),(0,z.useCallback)(()=>t?rR(t):XL,[t]),()=>XL);return(0,z.useEffect)(()=>{if(!t)return;jR(t);let e=e=>{e.origin===window.location.origin&&e.data?.type===`manufact:oauth-complete`&&e.data.authOrigin===t&&jR(t).finally(()=>gR(t,{authorizing:!1}))},n=e=>{e.key!==uR(t,`tokens`)||!e.newValue||jR(t).finally(()=>gR(t,{authorizing:!1}))};return window.addEventListener(`message`,e),window.addEventListener(`storage`,n),()=>{window.removeEventListener(`message`,e),window.removeEventListener(`storage`,n)}},[t]),{...n,authorize:(0,z.useCallback)(async()=>{e&&await MR(e)},[e]),logout:(0,z.useCallback)(async()=>{e&&await LR(e,n.mode)},[e,n.mode])}}var zR=(0,z.lazy)(()=>lS(()=>import(`./ChatTab-B6ubLbeA.js`).then(e=>({default:e.ChatTab})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),BR=(0,z.lazy)(()=>lS(()=>import(`./ToolsTab-BisWWY2p.js`).then(e=>({default:e.ToolsTab})),__vite__mapDeps([20,1,2,3,5,6,4,7,8,21,22,23,13,19,18,24,25,26,10,27,28,29,16,17]))),VR=(0,z.lazy)(()=>lS(()=>import(`./PromptsTab-DK6XZxR8.js`).then(e=>({default:e.PromptsTab})),__vite__mapDeps([30,1,2,3,5,6,4,7,8,24,26,10,27,28,29,11,12,19]))),HR=(0,z.lazy)(()=>lS(()=>import(`./ResourcesTab-CUE4MAtJ.js`).then(e=>({default:e.ResourcesTab})),__vite__mapDeps([31,1,2,3,5,7,21,6,4,8,22,23,13,19,18,32,24,25,26,10,27,28,14,17]))),UR=(0,z.lazy)(()=>lS(()=>import(`./SamplingTab-BYNkVCTu.js`).then(e=>({default:e.SamplingTab})),__vite__mapDeps([33,1,2,3,5,6,4,7,8,26,10,27,22,23,13,14,19]))),WR=(0,z.lazy)(()=>lS(()=>import(`./ElicitationTab-CbnCrmu9.js`).then(e=>({default:e.ElicitationTab})),__vite__mapDeps([34,1,2,3,5,8,26,10,27,22,15,12,19]))),GR=(0,z.lazy)(()=>lS(()=>import(`./NotificationsTab-DuSm762_.js`).then(e=>({default:e.NotificationsTab})),__vite__mapDeps([35,1,2,3,32,25,26,5,10,27,28]))),KR=(0,z.lazy)(()=>lS(()=>import(`./ServerMetadataTab-DWjNFMbq.js`).then(e=>({default:e.ServerMetadataTab})),__vite__mapDeps([36,1,5,2,3,9,7,8,27,10,37]))),qR=(0,z.lazy)(()=>lS(()=>import(`./ConnectionSettingsTab-Cb2eDgEu.js`).then(e=>({default:e.ConnectionSettingsTab})),__vite__mapDeps([38,1,2,3,5,27,10,37])));function JR({children:e}){return(0,R.jsx)(z.Suspense,{fallback:(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,R.jsx)(bL,{className:`size-6`})}),children:e})}var YR=`anthropic/claude-sonnet-4.6`;function XR({isLoopback:e,chatApiUrl:t}){return e&&!!t}function ZR(e,t,n=!1,r){let i=e.replace(/\/chat\/stream\/?$/,`/llm`);return{provider:`openai-compatible`,model:r??`anthropic/claude-sonnet-4.6`,apiKey:t??`server-managed`,baseUrl:i,...n?{credentials:`include`}:{}}}function QR(e){return e?{Authorization:`Bearer ${e}`}:void 0}var $R=`mcp-inspector:managed-model`;function ez(e){return`${$R}:${e}`}function tz(e){try{return localStorage.getItem(ez(e))}catch{return null}}function nz(e,t,n,r){let i=e?new URL(e).origin:null,[a,o]=(0,z.useState)([]),[s,c]=(0,z.useState)(YR),[l,u]=(0,z.useState)(()=>i?tz(i)??`anthropic/claude-sonnet-4.6`:YR),[d,f]=(0,z.useState)(!1),p=(0,z.useCallback)(e=>{if(u(e),i)try{localStorage.setItem(ez(i),e)}catch{}},[i]);return(0,z.useEffect)(()=>{if(!r||!i)return;let e=!1;return f(!0),(async()=>{try{let r=QR(t),a=await fetch(`${i}/api/v1/models`,{headers:r,credentials:n===`session`?`include`:`same-origin`});if(!a.ok)return;let s=await a.json();if(e)return;let l=s.models??[];o(l);let d=s.defaultModelId??`anthropic/claude-sonnet-4.6`;c(d);let f=new Set(l.map(e=>e.id)),p=tz(i);p&&f.has(p)?u(p):f.has(d)?u(d):l[0]&&u(l[0].id)}finally{e||f(!1)}})(),()=>{e=!0}},[r,i,t,n]),{models:a,selectedModelId:l,setSelectedModelId:p,isLoading:d,selectedModel:a.find(e=>e.id===l)??null,defaultModelId:s}}var rz=[`tools`,`prompts`,`resources`,`chat`,`sampling`,`elicitation`,`notifications`,`server-metadata`,`connection-settings`];function iz(e){return rz.includes(e)?e:`tools`}function az({selectedServer:e,activeTab:t,toolsSearchRef:n,promptsSearchRef:r,resourcesSearchRef:i,onUpdateConnection:a,children:o}){let{embeddedConfig:s}=EL(),c=iz(t),[l,u]=(0,z.useState)(()=>new Set([c]));(0,z.useEffect)(()=>{let e=iz(t);u(t=>t.has(e)?t:new Set(t).add(e))},[t]);let{accessToken:d,mode:f,user:p}=RR(s.chatApiUrl),m=QR(d),h=f===`session`?`include`:void 0,g=p!=null,_=s.chatApiUrl,v=!!e?.url&&_M(e.url),y=e?XR({isLoopback:v,chatApiUrl:s.chatApiUrl,enableFreeTierUpgrade:s.chatEnableFreeTierUpgrade}):!1,b=nz(_,d,f,!!e&&!!_&&g),x=y?ZR(_,d,f===`session`,g?b.selectedModelId:void 0):s.managedLlmConfig??(_&&!v?{provider:`anthropic`,model:`claude-haiku-4-5`,apiKey:`server-managed`}:void 0);if(!e&&s.forceConnected)return s.chatApiUrl?(0,R.jsx)(JR,{children:(0,R.jsx)(zR,{connection:{id:`force-connected`,url:``,displayName:``,name:``,state:`ready`,tools:[],prompts:[],resources:[]},isConnected:!0,prompts:[],serverId:`force-connected`,callPrompt:async()=>({messages:[]}),readResource:async()=>({contents:[]}),useClientSide:!1,chatApiUrl:s.chatApiUrl,extraHeaders:m,credentials:h,managedLlmConfig:s.managedLlmConfig??{provider:`anthropic`,model:`claude-haiku-4-5`,apiKey:`server-managed`},enableFreeTierUpgrade:s.chatEnableFreeTierUpgrade,hideTitle:s.chatHideTitle,hideModelBadge:s.chatHideModelBadge??!0,hideServerUrl:s.chatHideServerUrl??!0,clearButtonLabel:s.chatClearButtonLabel,clearButtonHideIcon:s.chatClearButtonHideIcon,clearButtonHideShortcut:s.chatClearButtonHideShortcut,clearButtonVariant:s.chatClearButtonVariant,chatQuickQuestions:s.chatQuickQuestions,chatFollowups:s.chatFollowups,hideClearButton:s.chatHideClearButton,hideToolSelector:s.chatHideToolSelector,enableKeyboardShortcuts:!1},`chat-force-connected`)}):(0,R.jsx)(R.Fragment,{children:o});if(!e)return(0,R.jsx)(R.Fragment,{children:o});let S=e=>s.visibleTabs?s.visibleTabs.includes(e):!0,C=rz;return(0,R.jsxs)(JR,{children:[S(`tools`)&&l.has(`tools`)&&(0,R.jsx)(`div`,{style:{display:t===`tools`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(BR,{ref:n,tools:e.tools,callTool:e.callTool,readResource:e.readResource,serverId:e.id,isConnected:e.state===`ready`,refreshTools:e.refreshTools},`tools-${e.id}`)}),S(`prompts`)&&l.has(`prompts`)&&(0,R.jsx)(`div`,{style:{display:t===`prompts`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(VR,{ref:r,prompts:e.prompts,callPrompt:(t,n)=>e.getPrompt(t,n?Object.fromEntries(Object.entries(n).map(([e,t])=>[e,typeof t==`string`?t:String(t??``)])):void 0),serverId:e.id,isConnected:e.state===`ready`,refreshPrompts:e.refreshPrompts},`prompts-${e.id}`)}),S(`resources`)&&l.has(`resources`)&&(0,R.jsx)(`div`,{style:{display:t===`resources`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(HR,{ref:i,resources:e.resources,readResource:e.readResource,serverId:e.id,isConnected:e.state===`ready`,mcpServerUrl:e.url||``,refreshResources:e.refreshResources},`resources-${e.id}`)}),S(`chat`)&&l.has(`chat`)&&(0,R.jsx)(`div`,{style:{display:t===`chat`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(zR,{connection:e,isConnected:s.forceConnected||e.state===`ready`,prompts:e.prompts,serverId:e.id,callPrompt:(t,n)=>e.getPrompt(t,n?Object.fromEntries(Object.entries(n).map(([e,t])=>[e,typeof t==`string`?t:String(t??``)])):void 0),readResource:e.readResource,useClientSide:y||!_,chatApiUrl:_,extraHeaders:m,credentials:s.chatCredentials??h,managedLlmConfig:x,managedCloudModel:b,enableFreeTierUpgrade:s.chatEnableFreeTierUpgrade,hideTitle:s.chatHideTitle,hideModelBadge:s.chatHideModelBadge??!1,hideServerUrl:s.chatHideServerUrl??!!_,clearButtonLabel:s.chatClearButtonLabel,clearButtonHideIcon:s.chatClearButtonHideIcon,clearButtonHideShortcut:s.chatClearButtonHideShortcut,clearButtonVariant:s.chatClearButtonVariant,chatQuickQuestions:s.chatQuickQuestions,chatFollowups:s.chatFollowups,hideClearButton:s.chatHideClearButton,hideToolSelector:s.chatHideToolSelector,streamProtocol:s.chatStreamProtocol},`chat-${e.id}`)}),S(`sampling`)&&l.has(`sampling`)&&(0,R.jsx)(`div`,{style:{display:t===`sampling`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(UR,{pendingRequests:e.pendingSamplingRequests,onApprove:e.approveSampling,onReject:e.rejectSampling,serverId:e.id,isConnected:e.state===`ready`,mcpServerUrl:e.url??``},`sampling-${e.id}`)}),S(`elicitation`)&&l.has(`elicitation`)&&(0,R.jsx)(`div`,{style:{display:t===`elicitation`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(WR,{pendingRequests:e.pendingElicitationRequests,onApprove:e.approveElicitation,onReject:e.rejectElicitation,serverId:e.id,isConnected:e.state===`ready`},`elicitation-${e.id}`)}),S(`notifications`)&&l.has(`notifications`)&&(0,R.jsx)(`div`,{style:{display:t===`notifications`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(GR,{notifications:e.notifications,unreadCount:e.unreadNotificationCount,markNotificationRead:e.markNotificationRead,markAllNotificationsRead:e.markAllNotificationsRead,clearNotifications:e.clearNotifications,serverId:e.id,isConnected:e.state===`ready`},`notifications-${e.id}`)}),S(`server-metadata`)&&l.has(`server-metadata`)&&(0,R.jsx)(`div`,{style:{display:t===`server-metadata`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(KR,{connection:e},`server-metadata-${e.id}`)}),S(`connection-settings`)&&l.has(`connection-settings`)&&a&&(0,R.jsx)(`div`,{style:{display:t===`connection-settings`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(qR,{connection:e,onSave:a},`connection-settings-${e.id}`)}),!C.includes(t)&&(0,R.jsx)(R.Fragment,{children:o})]})}var oz=z.createContext(void 0);function sz(){let e=z.use(oz);if(!e)throw Error(`useTabs must be used within a TabsProvider`);return e}var cz=z.createContext(void 0);function lz(){return z.use(cz)}function uz({ref:e,children:t,defaultValue:n,value:r,onValueChange:i,className:a,collapsed:o,onCollapsedChange:s,...c}){let[l,u]=z.useState(n||``),d=r!==void 0,f=o!==void 0,[p,m]=z.useState(!1),h=z.useCallback(e=>{d||u(e),i?.(e)},[d,i]);return(0,R.jsx)(oz,{value:{activeValue:d?r:l,handleValueChange:h,collapsed:f?o:p,handleCollapsedChange:z.useCallback(e=>{f||m(e),s?.(e)},[f,s])},children:(0,R.jsx)(`div`,{ref:e,className:L(`flex flex-col gap-2`,a),...c,children:t})})}uz.displayName=`Tabs`;function dz({ref:e,children:t,className:n,variant:r=`default`,collapsible:i=!1,...a}){let{activeValue:o,collapsed:s,handleCollapsedChange:c}=sz(),[l,u]=z.useState({width:0,left:0}),d=z.useRef(null),f=z.useRef(null),p=z.useRef(null),m=z.useCallback(()=>{let e=d.current;if(!e)return;let t=e.querySelector(`div:first-child`);if(!t)return;let n=t.querySelector(`button[data-tab-value="${o}"]`);if(n&&o){let e=t.getBoundingClientRect(),r=n.getBoundingClientRect();u({width:r.width,left:r.left-e.left})}else u({width:0,left:0})},[o]),h=z.useCallback(()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(m,16)},[m]);z.useEffect(()=>{let e=setTimeout(m,10);return()=>clearTimeout(e)},[m,s]),z.useEffect(()=>{let e=d.current;if(!e)return;f.current=new ResizeObserver(()=>{h()}),f.current.observe(e);let t=e.querySelector(`div:first-child`);return t&&t.querySelectorAll(`button[data-tab-value]`).forEach(e=>{f.current&&f.current.observe(e)}),()=>{f.current&&f.current.disconnect(),p.current&&clearTimeout(p.current)}},[h]),z.useEffect(()=>{let e=()=>{h()};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[h]);let g=z.useRef(null);return z.useEffect(()=>{g.current&&(g.current.style.width=`${l.width}px`,g.current.style.left=`${l.left}px`)},[l]),(0,R.jsx)(cz,{value:{variant:r,collapsed:s,handleCollapsedChange:c},children:(0,R.jsx)(`div`,{ref:d,className:L(`relative flex items-center bg-none gap-1`,r==="default"&&`p-1 rounded-full border border-zinc-300 dark:border-zinc-600`,r===`underline`&&`border-b border-zinc-200 dark:border-zinc-700`,n),...a,children:(0,R.jsxs)(`div`,{role:`tablist`,className:`flex-1 flex items-center relative`,children:[t,(0,R.jsx)(`span`,{ref:g,className:L(`absolute transition-all duration-[250ms] ease-in-out z-0`,r==="default"&&`bg-white dark:bg-zinc-700 rounded-full h-[calc(100%)] top-0 border border-zinc-300 dark:border-zinc-600`,r===`underline`&&`bottom-0 h-0.5 bg-black dark:bg-white`)})]})})})}dz.displayName=`TabsList`;var fz=({children:e,title:t,collapsed:n})=>!t||!n?e:(0,R.jsx)(Ve,{children:(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`span`,{className:`contents`,children:e}),nativeButton:!1}),(0,R.jsx)(lt,{children:t})]})}),pz=z.forwardRef(({children:e,value:t,className:n,disabled:r,icon:i,title:a,showDot:o=!1,alwaysExpanded:s=!1,iconOnly:c=!1,badge:l,...u},d)=>{let{activeValue:f,handleValueChange:p,collapsed:m}=sz(),h=lz()?.variant||`default`,g=f===t,_=!c&&(!m||g||s),v=c||m&&!_;return(0,R.jsx)(fz,{title:a,collapsed:m&&!_,children:(0,R.jsxs)(`button`,{ref:d,disabled:r,onClick:()=>p(t),"data-tab-value":t,"data-tab-active":g,role:`tab`,"aria-selected":g?`true`:`false`,title:m&&!_&&a?a:void 0,className:L(`relative z-10 inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background transition-all duration-[250ms] ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer`,c?`size-9 shrink-0 flex-none rounded-full p-0`:`flex-1`,h==="default"&&!c&&`py-2.5`,h==="default"&&!c&&`rounded-md px-4`,h===`underline`&&`px-6 py-3 border-b-2 border-transparent`,g&&`text-foreground`,!g&&`text-muted-foreground hover:text-foreground`,n),...u,children:[i&&(0,R.jsxs)(`span`,{className:L(`relative inline-flex shrink-0 items-center justify-center`,c?`size-5`:_&&`mr-2`),children:[(0,R.jsx)(i,{className:L(`h-4 w-4 shrink-0 transition-all duration-[250ms] ease-in-out`,!_&&!c&&`mr-0!`)}),l&&v?l:null]}),o&&(0,R.jsx)(`span`,{className:`absolute top-1.5 right-1.5 w-2 h-2 bg-orange-500 dark:bg-orange-400 border-2 border-white dark:border-zinc-900 rounded-full transition-opacity duration-300 z-10 animate-status-pulse-orange`}),(0,R.jsx)(`span`,{className:L(`min-w-0 transition-all duration-[250ms] ease-in-out overflow-hidden`,_?`w-auto opacity-100`:`w-0 opacity-0`),children:e}),l&&!v?l:null]})})});pz.displayName=`TabsTrigger`;function mz(e){return RR(e)}var hz=z.createContext(void 0);function gz(){let e=z.useContext(hz);if(e===void 0)throw Error(Vt(13));return e}var _z={imageLoadingStatus:()=>null},vz=z.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=z.useState(`idle`),c={imageLoadingStatus:o},l=z.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=Ft(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:_z});return(0,R.jsx)(hz.Provider,{value:l,children:u})});function yz(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i}){let[a,o]=z.useState(`idle`);return Rt(()=>{if(!e&&!i)return o(`error`),It;let a=!0,s=new window.Image,c=e=>()=>{a&&o(e)};return o(`loading`),s.onload=c(`loaded`),s.onerror=c(`error`),t&&(s.referrerPolicy=t),s.crossOrigin=n??null,r&&(s.sizes=r),i&&(s.srcset=i),e&&(s.src=e),s.complete&&o(s.naturalWidth>0?`loaded`:`error`),()=>{a=!1}},[e,i,r,n,t]),a}var bz={..._z,...it},xz=z.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,style:a,...o}=e,{setImageLoadingStatus:s}=gz(),c=yz(o.src,o),l=c===`loaded`,{mounted:u,transitionStatus:d,setMounted:f}=Je(l),p=z.useRef(null),m=Pt(e=>{i?.(e),s(e)});Rt(()=>{c!==`idle`&&m(c)},[c,m]),Rt(()=>()=>s(`idle`),[s]),g({open:l,ref:p,onComplete(){l||f(!1)}});let h=Ft(`img`,e,{state:{imageLoadingStatus:c,transitionStatus:d},ref:[t,p],props:o,stateAttributesMapping:bz,enabled:u});return u?h:null}),Sz=z.forwardRef(function(e,t){let{className:n,render:r,delay:i,style:a,...o}=e,{imageLoadingStatus:s}=gz(),[c,l]=z.useState(i===void 0),u=fe();return z.useEffect(()=>(i===void 0?l(!0):u.start(i,()=>l(!0)),u.clear),[u,i]),Ft(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:_z,enabled:s!==`loaded`&&(i===void 0||c)})});function Cz({className:e,size:t=`default`,...n}){return(0,R.jsx)(vz,{"data-slot":`avatar`,"data-size":t,className:L(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function wz({className:e,...t}){return(0,R.jsx)(xz,{"data-slot":`avatar-image`,className:L(`aspect-square size-full rounded-full object-cover`,e),...t})}function Tz({className:e,...t}){return(0,R.jsx)(Sz,{"data-slot":`avatar-fallback`,className:L(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function Ez(e,t){return e?.[0]?e[0].toUpperCase():t?.[0]?t[0].toUpperCase():`U`}function Dz({chatApiUrl:e,dashboardUrl:t=`https://manufact.com/cloud`,fallback:n=null,onUserResolved:r,compact:i=!1}){let{user:a,loaded:o,authorizing:s,authorize:c,logout:l,mode:u}=mz(e),d=(0,z.useRef)(void 0);if((0,z.useEffect)(()=>{if(!o)return;let e=a?.id??null;d.current!==e&&(d.current=e,r?.(a))},[o,a,r]),!o)return null;if(!a)return(0,R.jsxs)(R.Fragment,{children:[n,(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:L(`shrink-0 rounded-full text-[13px]`,i?`px-2.5 text-xs`:`px-4`),disabled:s,onClick:()=>{c().catch(e=>oI.error(e instanceof Error?e.message:`Authorization failed`))},children:s?`Authorizing…`:`Sign in`})]});let f=Ez(a.name,a.email),p=a.name??a.email??`User`;return(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsx)(Gt,{variant:`ghost`,className:`relative h-8 w-8 shrink-0 rounded-full p-0 mr-2`,"aria-label":`User menu`,children:(0,R.jsxs)(Cz,{className:`h-8 w-8 border border-zinc-300 dark:border-zinc-600`,children:[(0,R.jsx)(wz,{src:a.image??``,alt:p}),(0,R.jsx)(Tz,{className:`text-sm`,children:f})]})}),nativeButton:!0}),(0,R.jsxs)(Za,{className:`w-56`,align:`end`,forceMount:!0,children:[(0,R.jsx)(Qa,{className:`font-normal`,children:(0,R.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium leading-none truncate`,children:p}),a.email&&a.email!==p&&(0,R.jsx)(`p`,{className:`text-xs leading-none text-muted-foreground truncate`,children:a.email})]})}),(0,R.jsx)(no,{}),(0,R.jsx)($a,{render:(0,R.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,R.jsx)(li,{className:`mr-2 h-4 w-4`}),`Go to dashboard`]})}),(0,R.jsx)(no,{}),(0,R.jsxs)($a,{onClick:()=>{l().catch(()=>oI.error(`Sign out failed`))},children:[(0,R.jsx)(hi,{className:`mr-2 h-4 w-4`}),u===`session`?`Sign out of Manufact`:`Disconnect Inspector`]})]})]})}function Oz({count:e,isActive:t,size:n=`md`,overlay:r=!1}){return e<=0?null:(0,R.jsx)(`span`,{className:L(t?`dark:bg-black`:`dark:bg-zinc-700`,`shrink-0 bg-zinc-200 text-zinc-700 dark:text-zinc-300 rounded-full font-medium`,r&&`absolute -bottom-1 -right-1.5 z-10 flex h-3.5 min-w-3.5 items-center justify-center border border-background px-0.5 text-[9px] leading-none`,!r&&`ml-1`,!r&&n===`sm`&&`text-[10px] px-1.5 py-0.5`,!r&&n===`md`&&`text-xs px-2 py-0.5`),children:e})}var kz=`flex h-10 items-center gap-2`;function Az({serverConfig:e,additionalItems:t=[],showClients:n={cursor:!0,vsCode:!0,vsCodeInsiders:!0,claudeDesktop:!0,claudeCode:!0,geminiCli:!0,codexCli:!0},className:r=``,onSuccess:i,onError:a,trigger:o}){let[s,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(null),[d,f]=(0,z.useState)(!1),{url:p,name:m,headers:h}=e,g=e=>{try{PT(new Fo({client:e})).catch(()=>{})}catch{}},_=()=>{g(`cursor`);try{let e=NL(p,m,h);window.location.href=e,i?.(`Cursor`)}catch(e){console.error(`Failed to generate Cursor deep link:`,e),a?.(e)}},v=()=>{g(`vscode`);try{let e=PL(p,m,h);window.location.href=e,i?.(`VS Code`)}catch(e){console.error(`Failed to generate VS Code deep link:`,e),a?.(e)}},y=()=>{g(`vscode-insiders`);try{let e=FL(p,m,h);window.location.href=e,i?.(`VS Code Insiders`)}catch(e){console.error(`Failed to generate VS Code Insiders deep link:`,e),a?.(e)}},b=()=>{g(`claude-desktop`);try{LL(p,m,h),i?.(`Claude Desktop`)}catch(e){console.error(`Failed to download .mcpb file:`,e),a?.(e)}},x=()=>{g(`claude-code`),u(`claude-code`),c(!0)},S=()=>{g(`gemini-cli`),u(`gemini-cli`),c(!0)},C=()=>{g(`codex-cli`),u(`codex-cli`),c(!0)},w=async e=>{try{await lM(e),f(!0),setTimeout(()=>f(!1),2e3)}catch(e){console.error(`Failed to copy:`,e),a?.(e)}},T=()=>{if(l===`claude-code`){let{command:e,envVars:t}=RL(p,m,h),n=VL(t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(dL,{children:[(0,R.jsx)(hL,{children:`Add to Claude Code`}),(0,R.jsx)(gL,{children:`Execute the following command in your shell to add this server to Claude Code.`})]}),(0,R.jsxs)(fL,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Instructions`}),(0,R.jsxs)(`ol`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`1.`}),(0,R.jsx)(`span`,{children:`Ensure the Claude Code executable is available in your path`})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`2.`}),(0,R.jsx)(`span`,{children:`Execute the following snippet in your shell:`})]})]})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`h-7 px-2 bg-background hover:bg-accent border border-border`,onClick:()=>w(e),children:d?(0,R.jsx)(Fr,{className:`size-3.5 text-green-600`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 pr-14 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:e})})]}),n&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Environment Variables`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:`After installation, set these environment variables in your shell:`}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:n})})]}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`The MCP configuration supports environment variable expansion using `,(0,R.jsx)(`code`,{className:`text-foreground`,children:"${VAR}"}),` `,`syntax.`]})]})]})}if(l===`gemini-cli`){let{command:e,envVars:t}=zL(p,m,h),n=VL(t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(dL,{children:[(0,R.jsx)(hL,{children:`Add to Gemini CLI`}),(0,R.jsx)(gL,{children:`Execute the following command in your shell to add this server to Gemini CLI.`})]}),(0,R.jsxs)(fL,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Instructions`}),(0,R.jsxs)(`ol`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`1.`}),(0,R.jsx)(`span`,{children:`Ensure the Gemini CLI executable is available in your path`})]}),n&&(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`2.`}),(0,R.jsx)(`span`,{children:`Set these environment variables in your shell before running the command:`})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:n?`3.`:`2.`}),(0,R.jsx)(`span`,{children:`Execute the following snippet in your shell:`})]})]})]}),n&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Environment Variables`}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:n})})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`h-7 px-2 bg-background hover:bg-accent border border-border`,onClick:()=>w(e),children:d?(0,R.jsx)(Fr,{className:`size-3.5 text-green-600`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 pr-14 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:e})})]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Restart Gemini CLI to load the new configuration.`})]})]})}if(l===`codex-cli`){let{config:e,envVars:t}=BL(p,m,h);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(dL,{children:[(0,R.jsx)(hL,{children:`Add to Codex CLI`}),(0,R.jsxs)(gL,{children:[`Add this configuration to your`,` `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`~/.codex/config.toml`}),` `,`file.`]})]}),(0,R.jsxs)(fL,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Instructions`}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Add this configuration to your`,` `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`~/.codex/config.toml`}),`:`]})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`h-7 px-2 bg-background hover:bg-accent border border-border`,onClick:()=>w(e),children:d?(0,R.jsx)(Fr,{className:`size-3.5 text-green-600`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 pr-14 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:e})})]}),t.length>0&&(0,R.jsx)(`div`,{children:(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`(optional) If you would rather use variables from your system's environment, replace the`,` `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`http_headers`}),` key with the `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`env_http_headers`}),` `,`key as shown in the commented section above.`]})}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Restart Codex CLI to load the new configuration.`})]})]})}return null},E=(0,R.jsxs)(Gt,{variant:`ghost`,className:`bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 rounded-full transition-colors px-3 flex items-center justify-center ${r}`,children:[(0,R.jsxs)(`span`,{className:`xl:hidden hidden sm:flex items-center gap-1`,children:[(0,R.jsx)(Ai,{className:`size-3`}),`Client`]}),(0,R.jsxs)(`span`,{className:`hidden xl:flex items-center gap-1`,children:[`Add to Client`,(0,R.jsx)(Ir,{className:`size-3`})]})]}),ee=o?typeof o==`function`?o({isOpen:!1,onClick:()=>{}}):o:E;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,z.isValidElement)(ee)?ee:E,nativeButton:!0}),(0,R.jsxs)(Za,{align:`end`,className:`w-auto min-w-[300px]`,children:[t.map(e=>(0,R.jsxs)($a,{onClick:async()=>{await e.onClick()},className:kz,children:[e.icon,(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:e.label})]},e.id)),t.length>0&&(0,R.jsx)(no,{}),n.cursor&&(0,R.jsxs)($a,{onClick:_,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/cursor`,alt:`Cursor`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Cursor`})]}),n.claudeCode&&(0,R.jsxs)($a,{onClick:x,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Claude Code`})]}),n.claudeDesktop&&(0,R.jsxs)($a,{onClick:b,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Claude Desktop`})]}),n.vsCode&&(0,R.jsxs)($a,{onClick:v,className:kz,children:[(0,R.jsx)(UL,{className:`h-4 w-4 text-blue-500`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`VS Code`})]}),n.vsCodeInsiders&&(0,R.jsxs)($a,{onClick:y,className:kz,children:[(0,R.jsx)(UL,{className:`h-4 w-4 text-teal-400`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`VS Code Insiders`})]}),n.geminiCli&&(0,R.jsxs)($a,{onClick:S,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/googlegemini`,alt:`Gemini`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Gemini CLI`})]}),n.codexCli&&(0,R.jsxs)($a,{onClick:C,className:kz,children:[(0,R.jsx)(`img`,{src:`https://inspector-cdn.mcp-use.com/providers/openai.png`,alt:`Codex`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Codex CLI`})]})]})]}),(0,R.jsx)(cL,{open:s,onOpenChange:c,children:(0,R.jsx)(uL,{scrollable:!0,className:`max-w-3xl max-h-[80vh]`,children:T()})})]})}function jz({className:e,state:t=`collapsed`,to:n=`/`,showLabel:r=t===`expanded`,labelParts:i=`full`,pinSymbolInIconColumn:a=!1,size:o}){let[s,c]=(0,z.useState)(!1),l=1.5,u=.2/l,d=.8999999999999999/l,f=r&&(t===`expanded`||i===`inspector`),p=o??(a?20:t===`expanded`?40:20),m=(0,R.jsx)(`div`,{className:`relative`,children:(0,R.jsxs)(Pe.svg,{viewBox:`0 0 500 500`,initial:`rest`,animate:s?`hover`:`rest`,className:`text-foreground`,style:{width:p,height:p},children:[(0,R.jsxs)(Pe.g,{variants:{rest:{opacity:1},hover:{opacity:[1,0,0,1],transition:{duration:l,times:[0,u,d,1],ease:`easeInOut`}}},fill:`currentColor`,fillRule:`nonzero`,stroke:`currentColor`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M105.933 0C164.437 0.000116002 211.865 47.607 211.865 106.333C211.865 131.829 210.493 158.403 221.068 181.602L228.975 198.947C243.584 230.997 269.265 256.7 301.303 271.336L316.155 278.121C340.142 289.079 367.694 287.335 394.066 287.335C452.571 287.335 499.999 334.942 499.999 393.668C499.999 452.394 452.571 500.001 394.066 500.001C335.562 500.001 288.134 452.394 288.134 393.668C288.134 368.974 289.24 343.275 278.992 320.807L270.586 302.38C255.948 270.29 230.214 244.565 198.118 229.939L180.164 221.758C157.282 211.331 131.078 212.666 105.933 212.666C47.4278 212.666 4.86252e-05 165.059 0 106.333C0 47.607 47.4278 0 105.933 0Z`}),(0,R.jsx)(`circle`,{cx:`100.426`,cy:`399.575`,r:`100.426`}),(0,R.jsx)(`path`,{d:`M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z`})]}),(0,R.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(Mz,{d:`M105.933 0C164.437 0.000116002 211.865 47.607 211.865 106.333C211.865 131.829 210.493 158.403 221.068 181.602L228.975 198.947C243.584 230.997 269.265 256.7 301.303 271.336L316.155 278.121C340.142 289.079 367.694 287.335 394.066 287.335C452.571 287.335 499.999 334.942 499.999 393.668C499.999 452.394 452.571 500.001 394.066 500.001C335.562 500.001 288.134 452.394 288.134 393.668C288.134 368.974 289.24 343.275 278.992 320.807L270.586 302.38C255.948 270.29 230.214 244.565 198.118 229.939L180.164 221.758C157.282 211.331 131.078 212.666 105.933 212.666C47.4278 212.666 4.86252e-05 165.059 0 106.333C0 47.607 47.4278 0 105.933 0Z`,times:{T0:0,T1:u,T2:d,T3:1},total:l}),(0,R.jsx)(Nz,{cx:100.426,cy:399.575,r:100.426,times:{T0:0,T1:u,T2:d,T3:1},total:l}),(0,R.jsx)(Mz,{d:`M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z`,times:{T0:0,T1:u,T2:d,T3:1},total:l})]})]})}),h=r?(0,R.jsx)(`span`,{className:L(`font-ubuntu flex items-center gap-2 whitespace-nowrap`,a?L(`pl-(--sidebar-nav-text-pl-absolute)`,f?`relative opacity-100 blur-0`:`pointer-events-none absolute left-0 top-1/2 w-0 -translate-y-1/2 overflow-hidden opacity-0 blur-[3px]`):i===`inspector`?`mr-0`:`mr-3`),children:i===`full`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`text-xl font-bold leading-none text-foreground [text-box:trim-both_cap_alphabetic]`,children:`mcp-use`}),(0,R.jsx)(`span`,{className:`text-lg font-sans font-light leading-none tracking-wide text-muted-foreground [text-box:trim-both_cap_alphabetic]`,children:`Inspector`})]}):(0,R.jsx)(`span`,{className:`text-base font-medium leading-none text-foreground [text-box:trim-both_cap_alphabetic]`,children:`Inspector`})}):null,g=a?(0,R.jsxs)(`div`,{className:L(`relative flex shrink-0 items-center`,f?`min-w-(--sidebar-width-icon)`:`w-(--sidebar-width-icon)`),children:[(0,R.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex w-(--sidebar-width-icon) items-center justify-center`,children:(0,R.jsx)(`div`,{className:`pointer-events-auto`,children:m})}),h]}):i===`inspector`?(0,R.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[m,h]}):(0,R.jsxs)(R.Fragment,{children:[m,h]});return(0,R.jsx)(DF,{to:n,className:L(`flex items-center transition-opacity`,!a&&i!==`inspector`&&`-my-3`,e),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:g})}function Mz({d:e,times:t,total:n}){let{T0:r,T1:i,T2:a,T3:o}=t;return(0,R.jsx)(Pe.path,{d:e,variants:{rest:{pathLength:0,opacity:0},hover:{pathLength:[0,0,1,1],opacity:[0,0,1,1],transition:{duration:n,times:[r,i,a,o],ease:`easeInOut`}}}})}function Nz({cx:e,cy:t,r:n,times:r,total:i}){let{T0:a,T1:o,T2:s,T3:c}=r;return(0,R.jsx)(Pe.circle,{cx:e,cy:t,r:n,variants:{rest:{pathLength:0,opacity:0},hover:{pathLength:[0,0,1,1],opacity:[0,0,1,1],transition:{duration:i,times:[a,o,s,c],ease:`easeInOut`}}}})}var Pz=(0,z.createContext)(void 0);function Fz(){let e=(0,z.use)(Pz);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}function Iz({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,forcedTheme:r}){let[i,a]=(0,z.useState)(r||t),[o,s]=(0,z.useState)(!1),c=()=>typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,l=i===`system`?c():i,u=e=>{let t=document.documentElement,i=e===`system`?c():e;t.classList.remove(`light`,`dark`),t.classList.add(i),r||localStorage.setItem(n,e)};return(0,z.useEffect)(()=>{s(!0);let e=localStorage.getItem(n),i=r||e||t;a(i),u(i)},[t,n,r]),(0,z.useEffect)(()=>{if(i!==`system`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{u(`system`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[i]),(0,z.useEffect)(()=>{o&&u(i)},[i,o]),(0,R.jsx)(Pz,{value:{theme:i,setTheme:e=>{if(r){console.warn(`[ThemeProvider] Theme is forced via URL parameter, ignoring setTheme call`);return}a(e)},resolvedTheme:l},children:e})}function Lz({ref:e,shimmerColor:t,shimmerSize:n=`0.05em`,shimmerDuration:r=`3s`,borderRadius:i=`100px`,background:a,className:o,children:s,...c}){let{theme:l}=Fz();return(0,R.jsxs)(`button`,{style:{"--spread":`90deg`,"--shimmer-color":t||(l===`dark`?`#000000`:`#ffffff`),"--radius":i,"--speed":r,"--cut":n,"--bg":a||(l===`dark`?`rgba(255, 255, 255, 1)`:`rgba(0, 0, 0, 1)`)},className:L(`group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border px-6 py-3 whitespace-nowrap [background:var(--bg)]`,`transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px`,`dark:text-white text-black dark:border-white/10 border-black/10`,o),ref:e,...c,children:[(0,R.jsx)(`div`,{className:L(`-z-30 blur-[2px]`,`@container-[size] absolute inset-0 overflow-visible`),children:(0,R.jsx)(`div`,{className:`animate-shimmer-slide absolute inset-0 aspect-[1] h-[100cqh] rounded-none mask-none`,children:(0,R.jsx)(`div`,{className:`animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]`})})}),s,(0,R.jsx)(`div`,{className:L(`absolute inset-0 size-full`,`rounded-2xl px-4 py-1.5 text-sm font-medium`,`transform-gpu transition-all duration-300 ease-in-out`,`dark:shadow-[inset_0_-8px_10px_#0000001f] dark:group-hover:shadow-[inset_0_-6px_10px_#0000003f] dark:group-active:shadow-[inset_0_-10px_10px_#0000003f] shadow-[inset_0_-8px_10px_#ffffff1f] group-hover:shadow-[inset_0_-6px_10px_#ffffff3f] group-active:shadow-[inset_0_-10px_10px_#ffffff3f]`)}),(0,R.jsx)(`div`,{className:L(`absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] bg-black dark:bg-white`)})]})}Lz.displayName=`ShimmerButton`;function Rz(e){switch(e){case`ready`:return`bg-emerald-600 animate-status-pulse`;case`failed`:return`bg-rose-600 animate-status-pulse-red`;default:return`bg-yellow-500 animate-status-pulse-yellow`}}function zz(e){switch(e){case`ready`:return`Connected`;case`failed`:return`Failed`;default:return e}}function Bz({status:e,className:t}){return(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`div`,{className:L(`w-2 h-2 rounded-full shrink-0`,Rz(e),t)}),nativeButton:!1}),(0,R.jsx)(lt,{children:(0,R.jsx)(`p`,{children:zz(e)})})]})}var Vz=`h-6 px-2 text-xs bg-yellow-500/20 border-0 dark:bg-yellow-400/10 text-yellow-800 dark:text-yellow-500 shrink-0`;function Hz(e){try{sessionStorage.setItem(SI,JSON.stringify({url:e.url,name:e.name||`Auto-connected Server`,transportType:e.transportType||`http`,connectionMode:`auto`}))}catch{}}function Uz({server:e,className:t}){let{state:n,authUrl:r,authenticate:i}=e;return n!==`pending_auth`&&n!==`authenticating`?null:n===`authenticating`?(0,R.jsxs)(Gt,{size:`sm`,variant:`outline`,disabled:!0,className:L(Vz,t),children:[(0,R.jsx)(fi,{className:`h-3 w-3 animate-spin mr-1`}),`Authenticating`]}):i?(0,R.jsx)(Gt,{"data-testid":`server-header-authenticate`,size:`sm`,variant:`outline`,className:L(Vz,t),onClick:t=>{t.stopPropagation(),Hz(e),i()},children:`Authenticate`}):r?(0,R.jsx)(Gt,{size:`sm`,variant:`outline`,className:L(Vz,t),render:(0,R.jsx)(`a`,{href:r,"data-testid":`server-header-authenticate`,onClick:t=>{t.stopPropagation(),Hz(e)}}),nativeButton:!1,children:`Authenticate`}):null}function Wz({connections:e,selectedServer:t,onServerSelect:n,mobileMode:r=!1,variant:i=`default`,compactHeader:a=!1}){let o=sP(),s=t=>{e.some(e=>e.id===t)&&n(t)},c=(0,R.jsxs)(Za,{className:`w-[calc(100vw-2rem)] sm:w-[300px]`,align:`start`,children:[(0,R.jsx)(Qa,{className:`cursor-pointer hover:bg-zinc-100 dark:hover:bg-zinc-800`,onClick:()=>o(`/`),children:`MCP Servers`}),(0,R.jsx)(no,{}),e.length===0?(0,R.jsx)(`div`,{className:`px-2 py-4 text-sm text-muted-foreground dark:text-zinc-400 text-center`,children:`No servers connected. Go to the dashboard to add one.`}):e.map(e=>(0,R.jsxs)($a,{onClick:()=>s(e.id),className:`flex items-center gap-3`,children:[(0,R.jsx)(xL,{server:e,size:`sm`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 flex-1`,children:[(0,R.jsx)(`div`,{className:`font-medium`,children:bM(e)}),(0,R.jsx)(Bz,{status:e.state})]})]},e.id)),(0,R.jsx)(no,{}),(0,R.jsx)($a,{onClick:()=>o(`/`),children:(0,R.jsx)(`span`,{className:`text-blue-600 dark:text-blue-400`,children:`+ Add new server`})})]});return r?(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsx)(`div`,{className:`relative`,children:(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsxs)(Gt,{variant:`ghost`,className:`h-11 px-2 bg-black dark:bg-white text-white dark:text-black border-black dark:border-white hover:bg-gray-800 dark:hover:bg-zinc-100 hover:border-gray-800 dark:hover:border-zinc-200 flex items-center gap-1.5`,children:[t?(0,R.jsx)(xL,{server:t,size:`md`}):(0,R.jsx)(Fi,{className:`h-5 w-5`}),(0,R.jsx)(Ir,{className:`h-4 w-4`})]}),nativeButton:!0}),c]})})}):i===`header`?(0,R.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsxs)(`button`,{type:`button`,className:`inline-flex max-w-full min-w-0 items-center gap-1.5 border-0 bg-transparent p-0 cursor-pointer text-foreground transition-opacity hover:opacity-80`,children:[t&&(0,R.jsx)(xL,{server:t,size:`sm`,className:`!size-5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate text-sm`,children:t?bM(t):`Select server`}),t&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Bz,{status:t.state}),!a&&(0,R.jsx)(Uz,{server:t})]}),(0,R.jsx)(Ir,{className:`size-3.5 shrink-0 text-muted-foreground`})]}),nativeButton:!0}),c]})}):(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsx)(`div`,{className:`relative`,children:(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsxs)(Lz,{className:L(`min-w-0 sm:min-w-[200px] p-0 px-1 text-sm h-11 justify-start text-white dark:text-black border-black dark:border-white hover:bg-gray-800 dark:hover:bg-zinc-100 hover:border-gray-800 dark:hover:border-zinc-200`,!t&&`pl-4`),children:[t&&(0,R.jsx)(xL,{server:t,size:`md`,className:`mr-2`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 flex-1`,children:[(0,R.jsx)(`span`,{className:`truncate lg:max-w-[120px] xl:max-w-none`,children:t?bM(t):`Select server to inspect`}),t&&(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:t.error&&t.state!==`ready`?(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`button`,{onClick:e=>{e.stopPropagation()},className:`w-2 h-2 rounded-full bg-rose-500 animate-status-pulse-red hover:bg-rose-600 transition-colors`,title:`Click to copy error message`,"aria-label":`Copy error message to clipboard`}),nativeButton:!0}),(0,R.jsx)(lt,{children:(0,R.jsx)(`p`,{className:`max-w-xs`,children:t.error})})]}):(0,R.jsx)(`div`,{className:`w-2 h-2 rounded-full ${t.state===`ready`?`bg-emerald-600 animate-status-pulse`:t.state===`failed`?`bg-rose-600 animate-status-pulse-red`:`bg-yellow-500 animate-status-pulse-yellow`}`})})]})]}),nativeButton:!0}),c]})})})}function Gz(e){if(!e)return null;try{let t=new URL(e);if(t.protocol===`https:`)return t.origin}catch{}return null}function Kz(e,t){return e===`tools`?t.tools.length:e===`prompts`?t.prompts.length:e===`resources`?t.resources.length:e===`sampling`?t.pendingSamplingRequests?.length||0:e===`elicitation`?t.pendingElicitationRequests?.length||0:e===`notifications`?t.unreadNotificationCount:0}function qz(e,t,n){return n&&t>0&&[`sampling`,`elicitation`,`notifications`].includes(e)}var Jz=[{id:`server-metadata`,label:`Server Metadata`,icon:si},{id:`separator`},{id:`chat`,label:`Chat`,icon:vi,alwaysExpanded:!0},{id:`separator`},{id:`tools`,label:`Tools`,icon:Yi},{id:`prompts`,label:`Prompts`,icon:yi},{id:`resources`,label:`Resources`,icon:$r},{id:`sampling`,label:`Sampling`,icon:ti},{id:`elicitation`,label:`Elicitation`,icon:zi},{id:`notifications`,label:`Notifications`,icon:Mr},{id:`separator`},{id:`connection-settings`,label:`Connection Settings`,icon:Ii}],Yz=z.createContext(void 0);function Xz(e){let t=z.useContext(Yz);if(t===void 0&&!e)throw Error(Vt(47));return t}function Zz(){return{...ft(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Qz={...De,disabled:St(e=>e.disabled),instantType:St(e=>e.instantType),openMethod:St(e=>e.openMethod),openChangeReason:St(e=>e.openChangeReason),modal:St(e=>e.modal),focusManagerModal:St(e=>e.focusManagerModal),stickIfOpen:St(e=>e.stickIfOpen),titleElementId:St(e=>e.titleElementId),descriptionElementId:St(e=>e.descriptionElementId),openOnHover:St(e=>e.openOnHover),closeDelay:St(e=>e.closeDelay),hasViewport:St(e=>e.hasViewport)},$z=class e extends Tt{constructor(e,t,n=!1){let r={...Zz(),...e},i=new at;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=We(i,t,n),super(r,{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),stickIfOpenTimeout:new xt,triggerElements:i},Qz)}setOpen=(e,t)=>{let n=t.reason===o,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=je(t),s=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&s!=null&&(t.trigger=this.context.triggerElements.getById(s)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let c=()=>{let n={open:e,openChangeReason:t.reason};_t(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),br.flushSync(c)):c(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:i}=Le(t,(t,r)=>new e(n,t,r));return z.useEffect(()=>i?.disposeEffect(),[i]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function eB({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=$z.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});Fe(u,n,r,l),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`),m=Ke()!=null;u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Be(u,d),Me(u);let{forceUnmount:h}=ot(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o,nested:m}),z.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=z.useCallback(()=>{u.setOpen(!1,te(_e))},[u]);z.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=d||f,v=z.useMemo(()=>({store:u}),[u]);return(0,R.jsxs)(Yz.Provider,{value:v,children:[_&&(0,R.jsx)(nB,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function tB(e){return Xz(!0)?(0,R.jsx)(eB,{props:e}):(0,R.jsx)(Ye,{children:(0,R.jsx)(eB,{props:e})})}function nB({store:e,modal:t}){let n=m(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return $e(e,{activeTriggerProps:n.reference??Wt,inactiveTriggerProps:n.trigger??Wt,popupProps:z.useMemo(()=>zt(mt,n.floating),[n.floating])}),null}var rB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:u=!1,delay:d=300,closeDelay:f=0,id:p,...m}=e,h=Xz(!0),g=c?.store??h?.store;if(!g)throw Error(Vt(74));let _=O(p),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),S=g.useState(`triggerPopupId`,_),C=z.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Ce(_,C,g,{payload:l,disabled:o,openOnHover:u,closeDelay:f}),E=g.useState(`openChangeReason`),ee=g.useState(`stickIfOpen`),D=g.useState(`openMethod`),te=g.useState(`focusManagerModal`),ne=a(y,{enabled:!o&&y!=null&&u&&(D!==`touch`||E!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:se(),restMs:d,delay:{close:f},triggerElementRef:C,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),re=Sn(y,{enabled:y!=null,stickIfOpen:ee}),ie=dn(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),k=g.useState(`triggerProps`,T),{getButtonProps:A,buttonRef:j}=Lt({disabled:o,native:s}),ae={open(e){return e&&E===`trigger-press`?Ue.open(e):Ee.open(e)}},{preFocusGuardRef:oe,handlePreFocusGuardFocus:ce,handleFocusTargetFocus:M}=xr(g,C),N=Ft(`button`,e,{state:{disabled:o,open:b},ref:[j,t,w,C],props:[re.reference,ne,k,ie,{[x]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":S},m,A],stateAttributesMapping:ae});return T&&!te?(0,R.jsxs)(z.Fragment,{children:[(0,R.jsx)(ut,{ref:oe,onFocus:ce}),(0,R.jsx)(z.Fragment,{children:N},_),(0,R.jsx)(ut,{ref:g.context.triggerFocusTargetRef,onFocus:M})]}):(0,R.jsx)(z.Fragment,{children:N},_)}),iB=z.createContext(void 0);function aB(){let e=z.useContext(iB);if(e===void 0)throw Error(Vt(45));return e}var oB=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Xz();return i.useState(`mounted`)||n?(0,R.jsx)(iB.Provider,{value:n,children:(0,R.jsx)(oe,{ref:t,...r})}):null}),sB=z.createContext(void 0);function cB(){let e=z.useContext(sB);if(!e)throw Error(Vt(46));return e}var lB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:l=`center`,sideOffset:u=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:m=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:_=!1,collisionAvoidance:v=N,...y}=e,{store:b}=Xz(),x=aB(),C=c(),w=b.useState(`floatingRootContext`),T=b.useState(`mounted`),E=b.useState(`open`),ee=b.useState(`openChangeReason`),D=b.useState(`activeTriggerElement`),te=b.useState(`modal`),ne=b.useState(`openMethod`),re=b.useState(`positionerElement`),O=b.useState(`instantType`),ie=b.useState(`transitionStatus`),k=b.useState(`hasViewport`),j=z.useRef(null),ae=p(re,!1,!1),oe=S({anchor:a,floatingRootContext:w,positionMethod:o,mounted:T,side:s,sideOffset:u,align:l,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,disableAnchorTracking:_,keepMounted:x,nodeId:C,collisionAvoidance:v,adaptiveOrigin:k?ye:void 0}),se=w.useState(`domReferenceElement`);Rt(()=>{let e=se,t=j.current;if(e&&(j.current=e),t&&e&&e!==t){b.set(`instantType`,void 0);let e=new AbortController;return ae(()=>{b.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[se,ae,b]),an(E&&te===!0&&ee!==`trigger-hover`,ne===`touch`,re,D);let ce=z.useCallback(e=>{b.set(`positionerElement`,e)},[b]),M=st(e,{open:E,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,instant:O},{styles:oe.positionerStyles,transitionStatus:ie,props:y,refs:[t,ce],hidden:!T,inert:!E});return(0,R.jsxs)(sB.Provider,{value:oe,children:[T&&te===!0&&ee!==`trigger-hover`&&(0,R.jsx)(wn,{ref:b.context.internalBackdropRef,inert:sn(!E),cutout:D}),(0,R.jsx)(A,{id:C,children:M})]})}),uB=z.createContext(void 0);function dB(){let[e,t]=z.useState(0),n=Pt(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:z.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function fB(e){let{value:t,children:n}=e;return(0,R.jsx)(uB.Provider,{value:t,children:n})}var pB={...dt,...it},mB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,{store:c}=Xz(),l=cB(),u=Cn(!0)!=null,{context:d,hasClosePart:f}=dB(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),ee=c.useState(`disabled`),D=c.useState(`openOnHover`),te=c.useState(`closeDelay`),ne=s.id??E;g({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Ne(T,{enabled:D&&!ee,closeDelay:te});let re=a===void 0?Xe(c.context.popupRef):a,O=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,O);let ie=z.useCallback(e=>{c.set(`popupElement`,e)},[c]),k=Ft(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:_},ref:[t,c.context.popupRef,ie],props:[v,{id:ne,role:`dialog`,...mt,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&Qt.has(e.key)&&e.stopPropagation()}},xe(_),s],stateAttributesMapping:pB});return(0,R.jsx)(rn,{context:T,openInteractionType:m,modal:O,disabled:!S||C===`trigger-hover`,initialFocus:re,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:Bt(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,R.jsx)(fB,{value:d,children:k})})});function hB({...e}){return(0,R.jsx)(tB,{"data-slot":`popover`,...e})}function gB(e){return(0,R.jsx)(rB,{"data-slot":`popover-trigger`,...e})}function _B({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,R.jsx)(oB,{children:(0,R.jsx)(lB,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,R.jsx)(mB,{"data-slot":`popover-content`,className:L(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var vB={success:`border-emerald-700/20 bg-emerald-700/10 text-emerald-700 dark:border-emerald-400/30 dark:bg-emerald-400/10 dark:text-emerald-400`,failed:`border-red-500/20 bg-red-500/10 text-red-500 dark:border-red-400/30 dark:bg-red-400/10 dark:text-red-400`,warning:`border-amber-700/20 bg-amber-700/10 text-amber-700 dark:border-amber-400/30 dark:bg-amber-400/10 dark:text-amber-400`,loading:`border-purple-500/20 bg-purple-500/10 text-purple-500 dark:border-purple-400/30 dark:bg-purple-400/10 dark:text-purple-400 animate-spin`},yB=`size-4 shrink-0 rounded-full border p-0.5`;function bB({state:e,className:t}){let n=L(yB,vB[e],t);switch(e){case`success`:return(0,R.jsx)(Fr,{className:n,"aria-hidden":!0});case`failed`:return(0,R.jsx)(zr,{className:n,"aria-hidden":!0});case`warning`:return(0,R.jsx)(Ki,{className:n,"aria-hidden":!0});case`loading`:return(0,R.jsx)(fi,{className:n,"aria-hidden":!0});default:return null}}function xB(){return`text-emerald-700 dark:text-emerald-400`}function SB({onStop:e,showCopiedBanner:t=!1}){return(0,R.jsxs)(R.Fragment,{children:[t&&(0,R.jsxs)(`div`,{className:L(`flex items-center gap-2 text-sm -mt-1`,xB()),children:[(0,R.jsx)(bB,{state:`success`}),(0,R.jsx)(`span`,{children:`URL copied to clipboard`})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`h4`,{className:`font-semibold text-sm`,children:`Tunnel URL`}),(0,R.jsxs)(`a`,{href:`https://manufact.com/docs/tunneling`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[`Docs`,(0,R.jsx)(Ar,{className:`size-3`})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Use in ChatGPT & Claude`}),(0,R.jsxs)(`ol`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`1.`}),(0,R.jsxs)(`span`,{children:[`Enable`,` `,(0,R.jsx)(`a`,{href:`https://chatgpt.com/plugins#settings/Security`,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline underline-offset-2 hover:text-purple-600 dark:hover:text-purple-400`,children:`dev mode`}),` `,`from settings`]})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`2.`}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`a`,{href:`https://chatgpt.com/plugins#settings/Connectors?create-connector=true&redirectAfter=%2Fplugins`,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline underline-offset-2 hover:text-purple-600 dark:hover:text-purple-400`,children:`Add a connector`}),` `,`in App & Connectors`]})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`3.`}),(0,R.jsx)(`span`,{children:`Use the tunnel URL in the input`})]})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void e(),className:`flex items-center gap-1.5 text-xs text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors cursor-pointer`,children:[(0,R.jsx)(Vi,{className:`size-3 fill-current`}),`Stop Tunnel`]})]})}function CB(e){try{let t=new URL(e),n=t.pathname+t.search;return t.host+(n&&n!==`/`?n:``)}catch{return e}}function wB({copied:e,onCopy:t,className:n}){return(0,R.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),t()},"aria-label":e?`URL copied`:`Copy URL`,className:L(`shrink-0 cursor-pointer p-0.5 rounded-sm text-muted-foreground hover:text-foreground transition-opacity opacity-0 group-hover:opacity-100`,n),children:e?(0,R.jsx)(bB,{state:`success`,className:`size-3.5`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}function TB({url:e,className:t,tunnelPopover:n}){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1);if(!e)return null;let s=CB(e),c=n?.mcpUrl??e,l=!!n,u=async()=>{try{await lM(c),i(!0),setTimeout(()=>i(!1),2e3)}catch{oI.error(`Failed to copy URL`)}};(0,z.useEffect)(()=>{if(!n?.autoCopyOnOpen){o(!1);return}o(!0),i(!0);let e=setTimeout(()=>i(!1),2e3);return()=>clearTimeout(e)},[n?.autoCopyOnOpen]);let d=(0,R.jsxs)(R.Fragment,{children:[l?(0,R.jsx)(Lr,{className:`size-3.5 shrink-0`}):(0,R.jsx)(ei,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate max-w-[min(24rem,30vw)]`,children:s})]}),f=L(`flex items-center gap-1 min-w-0 truncate text-left text-sm cursor-pointer`,l?`text-purple-600 dark:text-purple-400`:`text-blue-500`);return(0,R.jsxs)(`div`,{className:L(`group flex items-center gap-1.5 min-w-0`,t),children:[l?(0,R.jsxs)(hB,{open:n.open,onOpenChange:n.onOpenChange,children:[(0,R.jsx)(gB,{render:(0,R.jsx)(`button`,{type:`button`,className:L(f,`hover:opacity-80`),children:d}),nativeButton:!0}),(0,R.jsx)(_B,{className:`w-[calc(100vw-2rem)] sm:w-96`,align:`start`,sideOffset:4,children:(0,R.jsx)(SB,{showCopiedBanner:a,onStop:async()=>{n.onOpenChange(!1),await n.onStop()}})})]}):(0,R.jsx)(`span`,{className:f,children:d}),(0,R.jsx)(wB,{copied:r,onCopy:()=>void u()})]})}function EB({devFromCli:e,isTunnelStarting:t,waitTicks:n,onStart:r}){if(t)return(0,R.jsxs)(`button`,{disabled:!0,className:`flex items-center gap-1 h-6 px-2 bg-violet-50 dark:bg-violet-950/40 border border-violet-200 dark:border-violet-800 rounded-full opacity-75 cursor-wait shrink-0`,children:[(0,R.jsx)(fi,{className:`size-3 text-violet-500 dark:text-violet-400 animate-spin`}),(0,R.jsxs)(`span`,{className:`text-xs font-medium text-violet-600 dark:text-violet-300 hidden lg:inline`,children:[`Start Tunnel `,(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[n,`s`]})]})]});let i=e===!0,a=e===null;return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void r(),disabled:!i||a,title:e===!1?"Run `mcp-use dev` from your project to enable tunneling.":a?`Checking dev server…`:void 0,className:L(`flex items-center gap-1 h-6 px-2 border rounded-full transition-colors shrink-0`,i&&!a?`bg-violet-50 dark:bg-violet-950/40 border-violet-200 dark:border-violet-800 hover:bg-violet-100 dark:hover:bg-violet-900/50 cursor-pointer`:`bg-violet-50/60 dark:bg-violet-950/20 border-violet-200 dark:border-violet-800 cursor-not-allowed opacity-70`),children:[a?(0,R.jsx)(fi,{className:`size-3 text-violet-500 dark:text-violet-400 animate-spin`}):(0,R.jsx)(Lr,{className:`size-3 text-violet-500 dark:text-violet-400`}),(0,R.jsx)(`span`,{className:`text-xs font-medium text-violet-600 dark:text-violet-300 hidden lg:inline`,children:`Start Tunnel`})]})}function DB(){return typeof window>`u`?!1:window.__MCP_DEV_CLI__===!0}async function OB(){try{let e=await fetch(hM(`dev/info`));return e.ok?await e.json():null}catch{return null}}function kB({tunnelUrl:e,setTunnelUrl:t,isTunnelStarting:n,setIsTunnelStarting:r,onTunnelStarted:i}){let[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(0),d=(0,z.useCallback)((e,n)=>{let r=n?.syncTunnel??!1;if(o(!!e.fromCli),e.mcpUrl&&c(e.mcpUrl),!r)return;if(e.tunnelUrl){t(new URL(e.tunnelUrl).origin);return}let i=Gz(e.mcpUrl??null);if(i){t(i);return}t(null)},[t]);return(0,z.useEffect)(()=>{if(!n){u(20);return}u(20);let e=setInterval(()=>u(e=>e>0?e-1:0),1e3);return()=>clearInterval(e)},[n]),(0,z.useEffect)(()=>{let e=!1;if(!DB()){o(!1);return}return(async()=>{let t=await OB();e||(t?d(t,{syncTunnel:!0}):o(!1))})(),()=>{e=!0}},[d]),{devFromCli:a,mcpUrl:s,waitTicks:l,handleStartTunnel:(0,z.useCallback)(async()=>{if(a===!1){oI.error("Start Tunnel requires `mcp-use dev` from your project directory.");return}r(!0);let e=!1;try{let t=await fetch(hM(`dev/start-tunnel`),{method:`POST`});if(!t.ok){let e=await t.json().catch(()=>({}));oI.error(e.error||`Failed to start tunnel`);return}let n=await OB();if(n?.tunnelUrl||n?.mcpUrl){d(n,{syncTunnel:!0});let e=n.mcpUrl??(n.tunnelUrl?`${n.tunnelUrl.replace(/\/+$/,``)}/mcp`:null);e&&cM(e),i?.()}e=!0}catch{oI.error(`Failed to start tunnel`)}finally{r(!1)}try{PT(new jo({action:`start`,success:e})).catch(()=>{})}catch{}},[d,a,i,r]),handleStopTunnel:(0,z.useCallback)(async()=>{r(!0);let n=!1;try{let e=await fetch(hM(`dev/stop-tunnel`),{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));oI.error(t.error||`Failed to stop tunnel`);return}t(null),c(null),oI.success(`Tunnel stopped`),n=!0}catch{oI.error(`Failed to stop tunnel`)}finally{r(!1)}try{PT(new jo({action:`stop`,success:n,tunnelUrl:e})).catch(()=>{})}catch{}},[r,t,e])}}function AB(e){let t=window.matchMedia(`(min-width: 1024px)`);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function jB(){return window.matchMedia(`(min-width: 1024px)`).matches}function MB(){return!0}function NB(){return(0,z.useSyncExternalStore)(AB,jB,MB)}function PB(e){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=NB(),o=(0,z.useCallback)(()=>{n(!0),i(!0)},[]);return(0,z.useEffect)(()=>{e||(n(!1),i(!1))},[e]),(0,z.useEffect)(()=>{if(!e)return;let t=new URLSearchParams(window.location.search);if(!t.has(`openTunnelPopover`))return;n(!0),i(!0),t.delete(`openTunnelPopover`);let r=t.toString();window.history.replaceState({},``,`${window.location.pathname}${r?`?${r}`:``}`)},[e]),{open:t,onOpenChange:(0,z.useCallback)(e=>{n(e),e||i(!1)},[]),isLgUp:a,autoCopyOnOpen:r,openWithAutoCopy:o}}function FB({connections:e,selectedServer:t,activeTab:n,onServerSelect:r,onTabChange:i,embedded:a=!1,sidebarCollapsed:o=!1}){let{tunnelUrl:s,isTunnelStarting:c,setTunnelUrl:l,setIsTunnelStarting:u,embeddedConfig:d}=EL(),[f,p]=(0,z.useState)(!1),[m]=(0,z.useState)(!0),h=PB(s),g=kB({tunnelUrl:s,setTunnelUrl:l,isTunnelStarting:c,setIsTunnelStarting:u,onTunnelStarted:h.openWithAutoCopy});if(d.singleTab)return null;let _=d.visibleTabs?Jz.filter(e=>e.id===`separator`||d.visibleTabs.includes(e.id)):Jz,v=!!t,y=!!t&&(_M(t.url??``)||vM(t.url??``)||!!s),b=t?s?`${s.replace(/\/+$/,``)}${pM()}`:t.url??``:``,x=g.mcpUrl??(s?`${s.replace(/\/+$/,``)}${pM()}`:null),S=(e,n)=>{if(!t||!b)return null;let r=e===`desktop`?h.isLgUp:!h.isLgUp;return(0,R.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,R.jsx)(TB,{url:b,className:n,tunnelPopover:s&&x&&r?{mcpUrl:x,onStop:g.handleStopTunnel,open:h.open,onOpenChange:h.onOpenChange,autoCopyOnOpen:h.autoCopyOnOpen}:void 0}),y&&!s&&(0,R.jsx)(EB,{devFromCli:g.devFromCli,isTunnelStarting:c,waitTicks:g.waitTicks,onStart:g.handleStartTunnel})]})},C=()=>a?null:(0,R.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-3 flex-shrink-0`,children:[t&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Az,{serverConfig:{url:b,name:bM(t),headers:MM(t),serverId:t.id},onSuccess:e=>oI.success(`Opening in ${e}...`),onError:e=>oI.error(`Failed: ${e.message}`),trigger:(0,R.jsxs)(Gt,{variant:`ghost`,className:`bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 rounded-full transition-colors px-3 flex items-center justify-center`,"aria-label":`Add to Client`,children:[(0,R.jsxs)(`span`,{className:`xl:hidden hidden sm:flex items-center gap-1`,children:[(0,R.jsx)(Ai,{className:`size-3`}),`Client`]}),(0,R.jsxs)(`span`,{className:`hidden xl:flex items-center gap-1`,children:[`Add to Client`,(0,R.jsx)(Ir,{className:`size-3`})]})]})})}),(0,R.jsx)(`a`,{href:f?`https://manufact.com/cloud?ref=mcp-use-inspector`:`https://manufact.com/signup?ref=mcp-use-inspector`,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>{try{PT(new Mo({referrer:`mcp-use-inspector`})).catch(()=>{})}catch{}},className:`inline-flex h-8 items-center justify-center rounded-full border border-blue-500/25 bg-blue-500/10 px-4 text-[13px] text-blue-500 outline-none cursor-pointer transition-colors hover:bg-blue-500/15 dark:border-blue-400/30 dark:bg-blue-400/10 dark:text-blue-400 dark:hover:bg-blue-400/15 focus-visible:ring-1 focus-visible:ring-ring`,children:(0,R.jsx)(`span`,{className:`[text-box:trim-both_cap_alphabetic]`,children:`Deploy`})}),w()]}),w=(e=!1)=>d.chatApiUrl?(0,R.jsx)(Dz,{chatApiUrl:d.chatApiUrl,onUserResolved:e=>p(!!e),compact:e}):null;return(0,R.jsxs)(`header`,{className:`w-full min-w-0 shrink-0 overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`hidden lg:flex h-(--header-height) items-center justify-between gap-3 px-4 md:pl-0 md:pr-6`,children:[(0,R.jsx)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:!a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:L(`hidden lg:block shrink-0`,v&&o&&`-mr-[calc(var(--sidebar-width-icon)/2-0.625rem)]`),children:(0,R.jsx)(jz,{pinSymbolInIconColumn:!0,showLabel:!v||!o,state:v&&o?`collapsed`:`expanded`})}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground/60 shrink-0 [text-box:trim-both_cap_alphabetic]`,children:`/`}),(0,R.jsx)(Wz,{connections:e,selectedServer:t,onServerSelect:r,variant:`header`}),S(`desktop`)]})}),C()]}),(0,R.jsxs)(`div`,{className:`flex lg:hidden min-w-0 w-full flex-col overflow-hidden pt-(--mobile-chrome-gap)`,children:[(0,R.jsx)(`div`,{className:`flex min-h-0 items-center gap-2 pb-(--mobile-chrome-gap)`,children:!a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2.5 overflow-hidden`,children:[(0,R.jsx)(jz,{state:`collapsed`,showLabel:!0,labelParts:`inspector`,className:`shrink-0`}),(0,R.jsx)(`span`,{className:`shrink-0 px-0.5 text-sm text-muted-foreground/60 [text-box:trim-both_cap_alphabetic]`,children:`/`}),(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(Wz,{connections:e,selectedServer:t,onServerSelect:r,variant:`header`,compactHeader:!0})})]}),(0,R.jsx)(`div`,{className:`shrink-0`,children:w(!0)})]})}),t&&(0,R.jsx)(`div`,{className:`w-full min-w-0 pb-(--mobile-chrome-gap) lg:hidden`,children:(0,R.jsx)(uz,{value:n,onValueChange:e=>i(e),collapsed:m,className:`w-full`,children:(0,R.jsx)(dz,{className:`w-full gap-0 border-0 bg-transparent p-0 [&_[role=tablist]]:justify-between`,children:_.filter(e=>e.id!==`separator`).map(e=>{let r=Kz(e.id,t);return(0,R.jsx)(pz,{value:e.id,"data-testid":`tab-${e.id}`,icon:e.icon,iconOnly:!0,title:e.label,badge:r>0?(0,R.jsx)(Oz,{count:r,isActive:n===e.id,overlay:!0}):void 0,className:`size-9 shrink-0 rounded-full p-0`,children:(0,R.jsx)(`span`,{className:`sr-only`,children:e.label})},e.id)})})})})]})]})}function IB({collapsed:e,onToggle:t}){let n=e?`Expand sidebar`:`Collapse sidebar`;return(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsxs)(Gt,{type:`button`,variant:`ghost`,size:`icon-sm`,tabIndex:-1,"aria-label":n,onClick:t,className:L(`border-border absolute top-1/2 right-0 z-30 hidden size-7 min-h-7 min-w-7 -translate-y-1/2 translate-x-1/2 rounded-full border bg-background lg:flex`,`opacity-0 transition-opacity duration-200 group-hover/sidebar:opacity-100 focus-visible:opacity-100`),children:[(0,R.jsx)(wi,{className:`size-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:n})]}),nativeButton:!0}),(0,R.jsx)(lt,{side:`right`,children:n})]})}function LB({className:e}){return(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentcolor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:e,children:[(0,R.jsx)(`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`}),(0,R.jsx)(`path`,{d:`M9 18c-4.51 2-5-2-7-2`})]})}var RB=z.createContext(void 0);function zB(){let e=z.useContext(RB);if(e===void 0)throw Error(Vt(63));return e}var BB=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),VB={...Tn,checked(e){return e?{[BB.checked]:``}:{[BB.unchecked]:``}}};function HB(e,t,n,r=!0,i){let[a,o]=z.useState(),s=O(i?`${i}-label`:void 0),c=e??t??a;return Rt(()=>{let i=e||t||!r?void 0:UB(n.current,s);a!==i&&o(i)}),c}function UB(e,t){let n=WB(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function WB(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var GB=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=An(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,validationMode:ee,disabled:D,name:ne,validation:re}=On(),{labelId:ie}=kn(),k=D||m,A=ne??l,j=z.useRef(null),ae=Kt(j,c,re.inputRef),oe=z.useRef(null),se=O(),ce=cn({id:s,implicit:!1,controlRef:oe}),M=u?void 0:ce,[N,le]=Yt({controlled:n,default:!!i,name:`Switch`,state:`checked`});En(oe,se,N,void 0,!k,l),Rt(()=>{j.current&&T(j.current.checked)},[j,T]),Dn(N,()=>{b(A),C(N!==w.initialValue),T(N),re.change(N)});let{getButtonProps:ue,buttonRef:de}=Lt({disabled:k,native:u}),fe=HB(a,ie,j,!u,M),pe={id:u?ce:se,role:`switch`,"aria-checked":N,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":fe,onFocus(){k||E(!0)},onBlur(){let e=j.current;!e||k||(S(!0),E(!1),ee===`onBlur`&&re.commit(e.checked))},onClick(e){if(f||k)return;e.preventDefault();let t=j.current;t&&t.dispatchEvent(new(Mt(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},me=zt({checked:N,disabled:k,form:o,id:M,name:A,required:p,style:A?Te:He,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ae,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=te(be,e.nativeEvent);d?.(t,n),!n.isCanceled&&le(t)},onFocus(){oe.current?.focus()}},e=>re.getValidationProps(k,e),_===void 0?Wt:{value:_}),he=z.useMemo(()=>({...x,checked:N,disabled:k,readOnly:f,required:p}),[x,N,k,f,p]),ge=Ft(`span`,e,{state:he,ref:[t,oe,de],props:[pe,y,ue,e=>re.getValidationProps(k,e)],stateAttributesMapping:VB});return(0,R.jsxs)(RB.Provider,{value:he,children:[ge,!N&&A&&g!==void 0&&(0,R.jsx)(`input`,{type:`hidden`,form:o,name:A,value:g,disabled:k}),(0,R.jsx)(`input`,{...me,suppressHydrationWarning:!0})]})}),KB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Ft(`span`,e,{state:zB(),ref:t,stateAttributesMapping:VB,props:a})}),qB=34,JB=20,YB=16,XB=2,ZB=4,QB=2;function $B(e){return`label`in e&&typeof e.label==`string`}var eV=(0,z.forwardRef)(({label:e,checked:t,onToggle:n,disabled:r=!1,thumbTransition:i,uncheckedTrackColor:a,uncheckedTrackColorHovered:o,className:s,...c},l)=>{let u=(0,z.useId)(),d=(0,z.useRef)(!1),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(!1),g=(0,z.useRef)(!1),_=(0,z.useRef)(!1),v=(0,z.useRef)(null),y=ia(t?16:XB);(0,z.useEffect)(()=>{d.current=!0},[]);let b=m?20:f?18:YB,x=m?YB-ZB:YB,S=m?4:XB,C=b-YB,w=t?16-C:XB;(0,z.useEffect)(()=>{g.current||(d.current?ka(y,w,i??pt.moderate):y.set(w))},[w,y,i]);let T=(0,z.useCallback)(e=>{r||e.pointerType===`mouse`&&e.button!==0||(h(!0),g.current=!1,_.current=!1,v.current={clientX:e.clientX,originX:y.get()},e.currentTarget.setPointerCapture(e.pointerId))},[r,y]),E=(0,z.useCallback)(e=>{if(!v.current)return;let t=e.clientX-v.current.clientX;if(!g.current){if(Math.abs(t)<QB)return;g.current=!0}let n=XB,r=qB-XB-20,i=v.current.originX+t;y.set(Math.max(n,Math.min(r,i)))},[y]),ee=(0,z.useCallback)(e=>{v.current&&=(h(!1),g.current&&(_.current=!0,g.current=!1,e&&(y.get()>14/2===t?ka(y,t?16:XB,i??pt.moderate):n()),requestAnimationFrame(()=>{_.current=!1})),null)},[t,n,y,i]);return(0,R.jsxs)(`div`,{ref:l,className:L(`relative z-10 flex items-center gap-2.5 px-3 py-2 cursor-pointer select-none touch-none`,r&&`opacity-50 pointer-events-none`,s),onPointerEnter:e=>{e.pointerType===`mouse`&&p(!0)},onPointerLeave:()=>p(!1),onPointerDown:T,onPointerMove:E,onPointerUp:()=>ee(!0),onPointerCancel:()=>{v.current&&=(h(!1),g.current&&(g.current=!1,ka(y,t?16:XB,i??pt.moderate)),null)},onClick:()=>{r||_.current||n()},...c,children:[(0,R.jsx)(GB,{checked:t,"aria-labelledby":u,onCheckedChange:()=>{_.current||n()},disabled:r,tabIndex:0,className:L(`relative shrink-0 rounded-full outline-none cursor-pointer`,`transition-colors duration-80`,`focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)] focus-visible:ring-offset-2 focus-visible:ring-offset-background`),style:{width:qB,height:JB,backgroundColor:t?f?`color-mix(in oklab, var(--primary) 88%, black)`:`var(--primary)`:f?o??`color-mix(in oklab, var(--accent), rgb(var(--overlay)) 10%)`:a??`var(--accent)`},onClick:e=>e.stopPropagation(),children:(0,R.jsx)(KB,{render:e=>{let{style:t,onDrag:n,onDragStart:r,onDragEnd:a,onAnimationStart:o,onAnimationEnd:s,onAnimationIteration:c,...l}=e;return(0,R.jsx)(Pe.span,{...l,className:`absolute top-0 left-0 block rounded-full bg-white shadow-sm`,initial:!1,style:{...t,x:y},animate:{y:S,width:b,height:x},transition:d.current?i??pt.moderate:{duration:0}})}})}),(0,R.jsx)(`span`,{id:u,className:L(`text-[13px] [text-box:trim-both_cap_alphabetic] transition-[color] duration-80`,t?`text-foreground`:`text-muted-foreground`),children:e})]})});eV.displayName=`FluidSwitch`;var tV=(0,z.forwardRef)(({checked:e,defaultChecked:t=!1,onCheckedChange:n,disabled:r=!1,className:i},a)=>{let[o,s]=(0,z.useState)(t),c=e??o;return(0,R.jsx)(GB,{ref:a,checked:c,disabled:r,onCheckedChange:t=>{e===void 0&&s(t),n?.(t)},className:L(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-colors duration-80`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]`,`disabled:cursor-not-allowed disabled:opacity-50`,`data-checked:bg-primary data-unchecked:bg-input`,i),children:(0,R.jsx)(KB,{className:L(`pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform duration-80`,`data-checked:translate-x-4 data-unchecked:translate-x-0`)})})});tV.displayName=`ShadcnSwitch`;var nV=(0,z.forwardRef)((e,t)=>$B(e)?(0,R.jsx)(eV,{ref:t,...e}):(0,R.jsx)(tV,{ref:t,...e}));nV.displayName=`Switch`;function rV({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0,children:(0,R.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}var iV=`flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,aV=`color-mix(in oklab, var(--sidebar-foreground) 22%, var(--sidebar))`,oV=`color-mix(in oklab, var(--sidebar-foreground) 30%, var(--sidebar))`,sV=`data-unchecked:!bg-zinc-300 dark:data-unchecked:!bg-zinc-600`;function cV({collapsed:e,rpcLoggerOpen:t,onRpcLoggerOpenChange:n,onCommandPaletteOpen:r}){let{embeddedConfig:i}=EL(),{theme:a,setTheme:o}=Fz(),{user:s}=mz(i.chatApiUrl),c=s?`https://manufact.com/cloud?ref=mcp-use-inspector`:`https://manufact.com/signup?ref=mcp-use-inspector`,l=()=>{try{PT(new Mo({referrer:`mcp-use-inspector-sidebar`})).catch(()=>{})}catch{}};return(0,R.jsx)(`footer`,{className:`mt-auto shrink-0`,children:(0,R.jsxs)(`div`,{className:L(`flex flex-col`,e?`items-center gap-2 px-2 py-3`:`gap-3 px-(--sidebar-nav-inset-x) py-4`),children:[e?(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`div`,{className:`flex size-8 items-center justify-center`,children:(0,R.jsx)(nV,{checked:t,onCheckedChange:n,"aria-label":`RPC Panel`,className:L(`scale-75`,sV)})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`right`,children:`RPC Panel`})]}):(0,R.jsx)(nV,{label:`RPC Panel`,checked:t,onToggle:()=>n(!t),uncheckedTrackColor:aV,uncheckedTrackColorHovered:oV,className:`w-full flex-row-reverse justify-between`}),e?(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:l,className:iV,"aria-label":`Deploying your MCP Server? Try manufact.com`,children:(0,R.jsx)(Ar,{className:`size-4`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`right`,children:`Deploying your MCP Server? Try manufact.com`})]}):(0,R.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:l,className:`relative block rounded-xl border border-sidebar-border bg-white p-3 transition-colors hover:bg-sidebar-accent/50 dark:bg-black`,children:[(0,R.jsx)(Ar,{className:`absolute top-2.5 right-2.5 size-3.5 text-muted-foreground`,"aria-hidden":!0}),(0,R.jsx)(`p`,{className:`pr-5 text-xs leading-snug text-muted-foreground`,children:`Deploying your MCP Server?`}),(0,R.jsxs)(`p`,{className:`mt-0.5 text-xs leading-snug`,children:[`Try`,` `,(0,R.jsx)(`span`,{className:`font-medium underline underline-offset-2`,children:`manufact.com`})]})]}),(0,R.jsxs)(`div`,{className:L(`flex`,e?`flex-col items-center gap-1`:`flex-row items-center gap-2`),children:[(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`a`,{href:`https://github.com/mcp-use/mcp-use`,target:`_blank`,rel:`noopener noreferrer`,className:iV,"aria-label":`GitHub`,children:(0,R.jsx)(LB,{className:`size-4`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:e?`right`:`top`,children:`GitHub`})]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`a`,{href:`https://discord.gg/XkNkSkMz3V`,target:`_blank`,rel:`noopener noreferrer`,className:iV,"aria-label":`Discord`,children:(0,R.jsx)(rV,{className:`size-4`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:e?`right`:`top`,children:`Discord`})]}),(0,R.jsxs)(Ya,{children:[(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(Xa,{render:(0,R.jsx)(`button`,{type:`button`,className:iV,"aria-label":`Theme`,children:a===`light`?(0,R.jsx)(Ui,{className:`size-4`}):a===`dark`?(0,R.jsx)(xi,{className:`size-4`}):(0,R.jsx)(bi,{className:`size-4`})}),nativeButton:!0}),nativeButton:!0}),(0,R.jsx)(lt,{side:e?`right`:`top`,children:`Theme`})]}),(0,R.jsx)(Za,{side:e?`right`:`top`,align:e?`start`:`center`,className:`w-40`,children:(0,R.jsxs)(eo,{value:a,onValueChange:e=>o(e),children:[(0,R.jsxs)(to,{value:`light`,children:[(0,R.jsx)(Ui,{className:`size-4 mr-2`}),`Light`]}),(0,R.jsxs)(to,{value:`dark`,children:[(0,R.jsx)(xi,{className:`size-4 mr-2`}),`Dark`]}),(0,R.jsxs)(to,{value:`system`,children:[(0,R.jsx)(bi,{className:`size-4 mr-2`}),`System`]})]})})]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`button`,{type:`button`,onClick:r,className:iV,"aria-label":`Command Palette`,"data-testid":`command-palette-trigger-button`,children:(0,R.jsx)(Ur,{className:`size-4`})}),nativeButton:!0}),(0,R.jsxs)(lt,{side:e?`right`:`top`,children:[`Command Palette (`,`⌘`,`K)`]})]})]})]})})}function lV(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetTop,r+=i.offsetLeft,i=i.offsetParent;if(i!==t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{top:r.top-n.top,left:r.left-n.left,width:r.width,height:r.height}}return{top:n,left:r,width:e.offsetWidth,height:e.offsetHeight}}function uV(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.top!==i.top||n.left!==i.left||n.width!==i.width||n.height!==i.height)return!1}return!0}function dV(e,t={}){let{axis:n=`y`}=t,r=(0,z.useRef)(new Map),[i,a]=(0,z.useState)(null),[o,s]=(0,z.useState)({}),c=(0,z.useRef)({}),l=(0,z.useRef)(0),u=(0,z.useRef)(null),d=(0,z.useRef)(null),f=(0,z.useCallback)(()=>{let t=e.current;if(!t)return;let n={};r.current.forEach((e,r)=>{n[r]=lV(e,t)}),!uV(c.current,n)&&(c.current=n,s(n))},[e]),p=(0,z.useCallback)((e,t)=>{t?r.current.set(e,t):r.current.delete(e),d.current!==null&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{d.current=null,f()})},[f]),m=(0,z.useCallback)(t=>{let r=t.clientX,i=t.clientY;u.current!==null&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(()=>{u.current=null;let t=e.current;if(!t)return;let o=t.getBoundingClientRect(),s=n===`x`?r:i,l=null,d=1/0,f=null,p=c.current,m=n===`x`?t.scrollLeft:t.scrollTop,h=n===`x`?t.clientLeft:t.clientTop,g=n===`x`?o.left:o.top,_=n===`x`?t.offsetWidth:t.offsetHeight,v=n===`x`?o.width:o.height,y=_>0?v/_:1;for(let[e,t]of Object.entries(p)){let r=g+(h+(n===`x`?t.left:t.top)-m)*y,i=(n===`x`?t.width:t.height)*y,a=r+i;s>=r&&s<=a&&(f=e);let o=r+i/2,c=Math.abs(s-o);c<d&&(d=c,l=e)}a(f??l)})},[n,e]),h=(0,z.useCallback)(()=>{l.current+=1},[]),g=(0,z.useCallback)(()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),a(null)},[]);return(0,z.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{d.current!==null&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{d.current=null,f()})});return n.observe(t),()=>n.disconnect()},[e,f]),(0,z.useEffect)(()=>()=>{u.current!==null&&cancelAnimationFrame(u.current),d.current!==null&&cancelAnimationFrame(d.current)},[]),{activeKey:i,itemRects:o,sessionRef:l,handlers:{onMouseMove:m,onMouseEnter:h,onMouseLeave:g},registerItem:p,measureItems:f}}function fV(e){if(!e)return{left:0,right:0};let t=getComputedStyle(e),n=Number.parseFloat(t.getPropertyValue(`--sidebar-nav-pill-bleed`))||0,r=Number.parseFloat(t.getPropertyValue(`--sidebar-nav-scrollbar-width`))||0,i=Number.parseFloat(t.getPropertyValue(`--sidebar-nav-pill-outer-trim-right`))||0;return{left:n,right:n+r+i}}function pV(e,t){return{...e,left:e.left-t.left,width:e.width+t.left+t.right}}var mV=(0,z.createContext)(null);function hV(){let e=(0,z.useContext)(mV),t=(0,z.useRef)(e?.registerItem);t.current=e?.registerItem;let n=(0,z.useRef)(new Map);return(0,z.useCallback)(e=>{let r=n.current,i=r.get(e);return i||(i=n=>t.current?.(e,n),r.set(e,i)),i},[])}function gV({children:e,isActiveKey:t,className:n}){let r=(0,z.useRef)(null),{activeKey:i,itemRects:a,sessionRef:o,handlers:s,registerItem:c,measureItems:l}=dV(r),u=(0,z.useMemo)(()=>({registerItem:c}),[c]),d=Object.keys(a).find(e=>t(e))??null;(0,z.useLayoutEffect)(()=>{l()},[l,e,d]);let f=fV(r.current),p=i?a[i]:null,m=d?a[d]:null,h=p?pV(p,f):null,g=m?pV(m,f):null,_=i!==null&&i!==d;return(0,R.jsx)(mV.Provider,{value:u,children:(0,R.jsxs)(`div`,{ref:r,onMouseEnter:s.onMouseEnter,onMouseMove:s.onMouseMove,onMouseLeave:s.onMouseLeave,className:L(`relative isolate`,n),children:[(0,R.jsx)(en,{initial:!1,children:g&&d?(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:`pointer-events-none absolute -z-20 rounded-full bg-sidebar-accent`,initial:{opacity:0,top:g.top,left:g.left,width:g.width,height:g.height},animate:{opacity:_?.85:1,top:g.top,left:g.left,width:g.width,height:g.height},exit:{opacity:0,transition:pt.fast.exit},transition:{opacity:{duration:.08},top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0}}},d):null}),(0,R.jsx)(en,{children:h?(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:`pointer-events-none absolute -z-10 rounded-full bg-sidebar-accent`,initial:{opacity:0,top:g?.top??h.top,left:g?.left??h.left,width:g?.width??h.width,height:g?.height??h.height},animate:{opacity:1,top:h.top,left:h.left,width:h.width,height:h.height},exit:{opacity:0,transition:pt.fast.exit},transition:{...pt.fast,opacity:{duration:.08}}},o.current):null}),e]})})}var _V=L(`pointer-events-auto absolute right-(--sidebar-nav-trailing-right) top-1/2 z-10 flex h-(--sidebar-nav-trailing-size) min-w-(--sidebar-nav-trailing-size) -translate-y-1/2 items-center justify-center`,L(`transition-[opacity,filter] duration-200 ease-out`,`opacity-100 blur-0`,`group-data-[collapsible=icon]:opacity-0 group-data-[collapsible=icon]:blur-[3px] group-data-[collapsible=icon]:pointer-events-none`,`group-data-[collapsed=true]:opacity-0 group-data-[collapsed=true]:blur-[3px] group-data-[collapsed=true]:pointer-events-none`)),vV=L(`truncate transition-[opacity,filter,margin] duration-200 ease-out`,`group-data-[collapsible=icon]:hidden`,`group-data-[collapsed=true]:hidden`),yV=L(`peer/menu-button flex cursor-pointer items-center gap-2 overflow-hidden rounded-full py-2 text-left text-sm outline-hidden ring-sidebar-ring hover:text-sidebar-accent-foreground group-hover/menu-item:text-sidebar-accent-foreground focus-visible:ring-2 active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:font-medium data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,`transition-[width,max-width,height,padding,border-radius] duration-200 ease-out`,`h-8 text-sm`);function bV({count:e}){return(0,R.jsx)(`span`,{className:L(`inline-flex h-5 shrink-0 items-center justify-center border border-border bg-zinc-200 px-1 text-[10px] font-medium tabular-nums leading-none text-foreground dark:bg-zinc-700`,String(e).length>=3?`min-w-5 rounded-md`:`size-5 min-w-5 rounded-full`),children:e})}function xV(e){return e.id!==`separator`}function SV({activeTab:e,onTabChange:t,selectedServer:n,visibleTabs:r,collapsed:i}){let a=hV();return(0,R.jsx)(`ul`,{className:`flex w-full min-w-0 flex-col gap-1 px-(--sidebar-nav-inset-x) group`,"data-collapsed":i,"aria-label":`Inspector tabs`,children:(r?Jz.filter(e=>xV(e)&&r.includes(e.id)):Jz.filter(xV)).map((r,o)=>{let s=Kz(r.id,n),c=qz(r.id,s,i),l=r.icon,u=e===r.id,d=s>0||c,f=(0,R.jsxs)(`button`,{ref:a(r.id),type:`button`,"data-testid":`tab-${r.id}`,"data-active":u?!0:void 0,onClick:()=>t(r.id),className:L(yV,i?`size-8! w-8! max-w-8! shrink-0 justify-center gap-0 p-0!`:`w-full max-w-full sidebar-nav-pill-bleed-x pl-(--sidebar-nav-icon-pl-bleed) pr-(--sidebar-nav-pr-bleed)`,d&&!i&&`pr-[calc(var(--sidebar-nav-trailing-right)+var(--sidebar-nav-trailing-size))]`),children:[(0,R.jsx)(l,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:vV,children:r.label})]});return(0,R.jsxs)(`li`,{className:L(`group/menu-item relative`,o===0&&`mt-4`),children:[i?(0,R.jsxs)(et,{delayDuration:0,children:[(0,R.jsx)(we,{render:f,nativeButton:!0}),(0,R.jsx)(lt,{side:`right`,children:s>0?`${r.label} (${s})`:r.label})]}):f,d&&!i?(0,R.jsx)(`div`,{className:_V,children:s>0?(0,R.jsx)(bV,{count:s}):c?(0,R.jsx)(`span`,{className:`inline-flex h-2 w-2 shrink-0 rounded-full bg-yellow-500 animate-status-pulse-yellow`}):null}):null]},r.id)})})}function CV({activeTab:e,onTabChange:t,selectedServer:n,visibleTabs:r,collapsed:i,onCollapsedChange:a,rpcLoggerOpen:o,onRpcLoggerOpenChange:s,onCommandPaletteOpen:c}){return(0,R.jsxs)(`aside`,{className:L(`group/sidebar relative hidden lg:flex flex-col shrink-0 text-sidebar-foreground transition-[width] duration-200 ease-out @container/sidebar`,i?`w-(--sidebar-width-icon)`:`w-(--sidebar-width)`),"data-collapsed":i,"data-collapsible":i?`icon`:`expanded`,children:[(0,R.jsx)(`div`,{className:`sidebar-nav-scroll flex-1 overflow-y-auto overflow-x-hidden min-h-0`,children:(0,R.jsx)(gV,{isActiveKey:t=>t===e,className:`pb-2`,children:(0,R.jsx)(SV,{activeTab:e,onTabChange:t,selectedServer:n,visibleTabs:r,collapsed:i})})}),(0,R.jsx)(cV,{collapsed:i,rpcLoggerOpen:o,onRpcLoggerOpenChange:s,onCommandPaletteOpen:c}),(0,R.jsx)(IB,{collapsed:i,onToggle:()=>a(!i)})]})}function wV(e){if(e===0)return`0 Bytes`;let t=1024,n=[`Bytes`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/t**r*100)/100+` `+n[r]}function TV(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/t**r).toFixed(1))} ${n[r]}`}var EV=100*1024,DV=1024*20;function OV(e,t){if(e==null)return e;if(typeof e==`string`)return e.length>t?e.substring(0,t)+`... (truncated)`:e;if(Array.isArray(e))return e.map(e=>OV(e,t));if(typeof e==`object`){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=OV(e[r],t));return n}return e}function kV(e){let t=JSON.stringify(e,null,2);return new TextEncoder().encode(t).length>EV?OV(e,DV):e}function AV(e){let t=JSON.stringify(e,null,2),n=new TextEncoder().encode(t).length,r=n>EV,i;if(r){let t=OV(e,DV);i=JSON.stringify(t,null,2)}else i=t;return{isLarge:r,size:n,sizeFormatted:wV(n),preview:i,full:t}}function jV(e,t){try{let n=JSON.stringify(e,null,2),r=globalThis.Blob,i=new r([n],{type:`application/json`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=t||`data-${Date.now()}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)}catch(e){throw console.error(`Failed to download JSON:`,e),e}}var MV={key:`text-sky-600 dark:text-sky-400`,string:`text-emerald-600 dark:text-emerald-400`,number:`text-amber-600 dark:text-amber-400`,boolean:`text-violet-600 dark:text-violet-400`,null:`text-zinc-500 dark:text-zinc-400`,punctuation:`text-muted-foreground`};function NV(e){let t=[],n=0,r=(e,n)=>{n&&t.push({kind:e,text:n})};for(;n<e.length;){let t=e[n];if(t===`"`){let t=n;for(n++;n<e.length;){if(e[n]===`\\`){n+=2;continue}if(e[n]===`"`){n++;break}n++}let i=e.slice(t,n),a=n;for(;a<e.length&&/[ \t]/.test(e[a]);)a++;r(e[a]===`:`?`key`:`string`,i);continue}if(/[0-9-]/.test(t)){let t=n;for(e[n]===`-`&&n++;n<e.length&&/[0-9.eE+-]/.test(e[n]);)n++;r(`number`,e.slice(t,n));continue}if(e.startsWith(`true`,n)||e.startsWith(`false`,n)){let t=e.startsWith(`true`,n)?`true`:`false`;r(`boolean`,t),n+=t.length;continue}if(e.startsWith(`null`,n)){r(`null`,`null`),n+=4;continue}if(/[{}[\],:]/.test(t)){r(`punctuation`,t),n++;continue}r(`punctuation`,t),n++}return t}function PV(e){return NV(e).map((e,t)=>(0,R.jsx)(`span`,{className:MV[e.kind],children:e.text},t))}var FV={string:`text-emerald-600 dark:text-emerald-400`,number:`text-amber-600 dark:text-amber-400`,boolean:`text-violet-600 dark:text-violet-400`,null:`text-zinc-500 dark:text-zinc-400`,key:`text-sky-600 dark:text-sky-400`,punctuation:`text-muted-foreground`};function IV(e){return e===null?(0,R.jsx)(`span`,{className:FV.null,children:`null`}):typeof e==`string`?(0,R.jsx)(`span`,{className:FV.string,children:JSON.stringify(e)}):typeof e==`number`?(0,R.jsx)(`span`,{className:FV.number,children:String(e)}):typeof e==`boolean`?(0,R.jsx)(`span`,{className:FV.boolean,children:String(e)}):(0,R.jsx)(`span`,{className:FV.string,children:JSON.stringify(e)})}function LV(e){return Array.isArray(e)?`[${e.length}]`:`{${Object.keys(e).length}}`}function RV({label:e,value:t,depth:n,defaultExpanded:r}){let i=typeof t==`object`&&t&&!Array.isArray(t)?Object.keys(t).length>0:Array.isArray(t)?t.length>0:!1,[a,o]=(0,z.useState)(i&&(r||n===0));if(!i){let r=Array.isArray(t)?`[]`:`{}`;return typeof t==`object`&&t?(0,R.jsxs)(`div`,{className:`font-mono text-[0.8rem] leading-relaxed`,style:{paddingLeft:n*12},children:[e!=null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:FV.key,children:JSON.stringify(e)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:`: `})]}),(0,R.jsx)(`span`,{className:FV.punctuation,children:r})]}):(0,R.jsxs)(`div`,{className:`font-mono text-[0.8rem] leading-relaxed`,style:{paddingLeft:n*12},children:[e!=null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:FV.key,children:JSON.stringify(e)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:`: `})]}),IV(t)]})}let s=Array.isArray(t)?t.map((e,t)=>[String(t),e]):Object.entries(t),c=Array.isArray(t),l=c?`[`:`{`,u=c?`]`:`}`;return(0,R.jsxs)(`div`,{className:`font-mono text-[0.8rem] leading-relaxed`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-0.5`,style:{paddingLeft:n*12},children:[(0,R.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`mt-0.5 inline-flex shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground`,children:(0,R.jsx)(C,{className:L(`h-3.5 w-3.5 transition-transform`,a&&`rotate-90`)})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e!=null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:FV.key,children:JSON.stringify(e)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:`: `})]}),(0,R.jsx)(`span`,{className:FV.punctuation,children:l}),!a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`mx-1 text-xs text-muted-foreground hover:text-foreground`,children:LV(t)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:u})]})]})]}),a&&(0,R.jsxs)(`div`,{children:[s.map(([e,t])=>(0,R.jsx)(RV,{label:e,value:t,depth:n+1,defaultExpanded:r},`${n}-${e}`)),(0,R.jsx)(`div`,{style:{paddingLeft:n*12},children:(0,R.jsx)(`span`,{className:FV.punctuation,children:u})})]})]})}function zV({data:e,defaultExpanded:t=!0,className:n}){return(0,R.jsx)(`div`,{className:L(`text-gray-900 dark:text-gray-100 [overflow-wrap:anywhere]`,n),"data-testid":`collapsible-json`,children:(0,R.jsx)(RV,{value:e,depth:0,defaultExpanded:t})})}var BV=`font-mono text-[0.8rem] text-gray-900 dark:text-gray-100 whitespace-pre-wrap break-words [overflow-wrap:anywhere]`;function VV({data:e,filename:t,className:n,collapsible:r=!1,defaultExpanded:i=!0,...a}){let o=AV(e),s=kV(e),c=o.isLarge?(0,R.jsx)(`div`,{className:`mb-3 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg`,children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`p`,{className:`text-sm font-medium text-yellow-800 dark:text-yellow-300 mb-1`,children:[`JSON is too large (`,o.sizeFormatted,`)`]}),(0,R.jsx)(`p`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:`Showing full structure with truncated values. Download the full JSON file to see complete values.`})]}),(0,R.jsxs)(Gt,{variant:`outline`,size:`sm`,onClick:()=>{jV(e,t)},className:`shrink-0`,children:[(0,R.jsx)(qr,{className:`h-4 w-4 mr-1`}),`Download`]})]})}):null;return r?(0,R.jsxs)(`div`,{className:n,...a,children:[c,(0,R.jsx)(zV,{data:s,defaultExpanded:i})]}):o.isLarge?(0,R.jsxs)(`div`,{className:n,...a,children:[c,(0,R.jsx)(`pre`,{className:BV,children:(0,R.jsx)(`code`,{children:PV(o.preview)})})]}):(0,R.jsx)(`div`,{className:n,...a,children:(0,R.jsx)(`pre`,{className:BV,children:(0,R.jsx)(`code`,{children:PV(o.preview)})})})}function HV(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var UV=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function WV(e){return z.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[UV.checked]:``}:{[UV.unchecked]:``}},...Tn}),[e.indeterminate])}var GV=z.createContext({disabled:!1});function KV(){return z.useContext(GV)}var qV=z.createContext(void 0);function JV(e=!0){let t=z.useContext(qV);if(t===void 0&&!e)throw Error(Vt(3));return t}var YV=z.createContext(void 0);function XV(){let e=z.useContext(YV);if(e===void 0)throw Error(Vt(14));return e}var ZV=`data-parent`,QV=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:b,...x}=e,{clearErrors:S}=An(),{disabled:C,name:w,setDirty:T,setFilled:E,setFocused:ee,setTouched:D,state:ne,validationMode:re,validityData:ie,validation:k}=On(),A=KV(),{labelId:j,controlId:ae,registerControlId:oe,getDescriptionProps:se}=kn(),ce=JV(),M=ce?.parent,N=M&&ce.allValues,le=C||A.disabled||ce?.disabled||o,ue=w??d,de=v??ue,fe=O(),pe=O(),me=ae;N?me=p?pe:`${M.id}-${de}`:c&&(me=c);let he={};N&&(p?he=ce.parent.getParentProps():de&&(he=ce.parent.getChildProps(de)));let{checked:ge=n,indeterminate:_e=l,onCheckedChange:ve,...ye}=he,xe=ce?.value,P=ce?.setValue,Se=ce?.defaultValue,Ce=z.useRef(null),we=qt(()=>Symbol(`checkbox-control`)),Ee=z.useRef(!1),{getButtonProps:De,buttonRef:Oe}=Lt({disabled:le,native:y}),ke=ce?.validation??k,[Ae,je]=Yt({controlled:de&&xe&&!p?xe.includes(de):ge,default:de&&Se&&!p?Se.includes(de):i,name:`Checkbox`,state:`checked`}),Me=N?!!ge:Ae,Ne=N&&_e||l;Rt(()=>{oe!==It&&(Ee.current=!0,oe(we.current,me))},[me,oe,we]),z.useEffect(()=>{let e=we.current;return()=>{!Ee.current||oe===It||(Ee.current=!1,oe(e,void 0))}},[oe,we]),En(Ce,fe,Ae,void 0,!ce&&!le,d);let Pe=z.useRef(null),Fe=Kt(u,Pe,ke.inputRef,ke.registerInput),Ie=HB(a,j,Pe,!y,me??void 0);Rt(()=>{Pe.current&&(Pe.current.indeterminate=Ne,Ae&&E(!0))},[Ae,Ne,E]),Dn(Ae,()=>{ce||(S(ue),E(Ae),T(Ae!==ie.initialValue),ke.change(Ae))});let Le=zt({checked:Ae,disabled:le,form:s,name:p?void 0:ue,id:y?void 0:me??void 0,required:g,ref:Fe,style:ue?Te:He,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=te(be,e.nativeEvent);f?.(t,n),!n.isCanceled&&(ve?.(t,n),!n.isCanceled&&(je(t),de&&xe&&P&&!p&&!N&&P(t?[...xe,de]:xe.filter(e=>e!==de),n)))},onFocus(){Ce.current?.focus()}},v===void 0?Wt:{value:(ce?Ae&&v:v)||``},se,e=>ke.getValidationProps(le,e));z.useEffect(()=>{if(!M||!de)return;let e=M.disabledStatesRef.current;return e.set(de,le),()=>{e.delete(de)}},[M,le,de]);let Re=z.useMemo(()=>({...ne,checked:Me,disabled:le,readOnly:m,required:g,indeterminate:Ne}),[ne,Me,le,m,g,Ne]),ze=WV(Re),Be=Ft(`span`,e,{state:Re,ref:[Oe,Ce,t,ce?.registerControlRef],props:[{id:y?me??void 0:fe,role:`checkbox`,"aria-checked":Ne?`mixed`:Me,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Ie,[ZV]:p?``:void 0,onFocus(){le||ee(!0)},onBlur(){let e=Pe.current;e&&(D(!0),ee(!1),re===`onBlur`&&ke.commit(ce?xe:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Pe.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),Mt(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||HV(t)?.click()})},onClick(e){if(m||le)return;e.preventDefault();let t=Pe.current;t&&t.dispatchEvent(new(Mt(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},x,ye,De,se,e=>ke.getValidationProps(le,e)],stateAttributesMapping:ze});return(0,R.jsxs)(YV.Provider,{value:Re,children:[Be,!Ae&&!ce&&ue&&!p&&_!==void 0&&(0,R.jsx)(`input`,{type:`hidden`,form:s,name:ue,value:_,disabled:le}),(0,R.jsx)(`input`,{...Le,suppressHydrationWarning:!0})]})}),$V=z.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=XV(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Je(c),f=z.useRef(null),p={...s,transitionStatus:u};g({open:c,ref:f,onComplete(){c||d(!1)}});let m={...WV(s),...it,...Tn},h=a||l,_=Ft(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?_:null}),eH=(0,z.createContext)(null);function tH(){let e=(0,z.useContext)(eH);if(!e)throw Error(`useCheckboxGroup must be used within a CheckboxGroup`);return e}var nH=(0,z.forwardRef)(({children:e,checkedIndices:t,orientation:n=`vertical`,className:r,...i},a)=>{let o=(0,z.useRef)(null),s=n===`horizontal`,{activeIndex:c,setActiveIndex:l,handlers:u,registerItem:d,measureItems:f}=_n(o,{axis:s?`x`:`y`});(0,z.useEffect)(()=>{f()},[f,e]);let p=s?`ArrowLeft`:`ArrowUp`,m=s?`ArrowRight`:`ArrowDown`;return(0,R.jsx)(eH.Provider,{value:{registerItem:d,activeIndex:c},children:(0,R.jsx)(`div`,{ref:e=>{o.current=e,typeof a==`function`?a(e):a&&(a.current=e)},onMouseEnter:u.onMouseEnter,onMouseMove:u.onMouseMove,onMouseLeave:u.onMouseLeave,onFocus:e=>{let t=e.target.closest(`[data-proximity-index]`)?.getAttribute(`data-proximity-index`);t!=null&&l(Number(t))},onBlur:e=>{o.current?.contains(e.relatedTarget)||l(null)},onKeyDown:e=>{let t=Array.from(o.current?.querySelectorAll(`[data-proximity-index]`)??[]),n=t.indexOf(e.target);n!==-1&&([p,m].includes(e.key)?(e.preventDefault(),t[e.key===m?(n+1)%t.length:(n-1+t.length)%t.length]?.focus()):e.key===`Home`?(e.preventDefault(),t[0]?.focus()):e.key===`End`&&(e.preventDefault(),t[t.length-1]?.focus()))},role:`group`,className:L(`relative flex max-w-full select-none`,s?`w-auto flex-row`:`w-72 flex-col`,r),...i,children:e})})});nH.displayName=`CheckboxGroup`;var rH=(0,z.forwardRef)(({label:e,index:t,checked:n,onToggle:r,size:i=`default`,className:a,...o},s)=>{let c=(0,z.useRef)(null),l=(0,z.useRef)(!1),{registerItem:u,activeIndex:d}=tH();(0,z.useEffect)(()=>(u(t,c.current),()=>u(t,null)),[t,u]),(0,z.useEffect)(()=>{l.current=!0},[]);let f=d===t,p=!l.current,m=Nt(),h=i===`sm`;return(0,R.jsxs)(`div`,{ref:e=>{c.current=e,typeof s==`function`?s(e):s&&(s.current=e)},"data-proximity-index":t,tabIndex:0,role:`checkbox`,"aria-checked":n,"aria-label":e,onClick:r,onMouseDown:e=>{let t=e.target.closest(`button:not([tabindex="-1"]), a[href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);t&&t!==e.currentTarget||(e.preventDefault(),e.currentTarget.focus())},onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),r())},className:L(`relative z-10 flex items-center cursor-pointer outline-none`,h?`h-7 gap-1.5 px-2`:`h-8 gap-2.5 px-3`,m.item,`focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]`,a),...o,children:[(0,R.jsxs)(QV,{checked:n,tabIndex:-1,"aria-hidden":!0,className:L(`pointer-events-none relative shrink-0 appearance-none bg-transparent p-0 border-0 outline-none`,h?`size-[13px]`:`size-[15px]`),children:[(0,R.jsx)(`div`,{className:L(`absolute inset-0 rounded-[5px] border-solid transition-all duration-80 border-[1.5px]`,n?`border-border`:f?`border-neutral-400 dark:border-neutral-500`:`border-border`)}),(0,R.jsx)(en,{children:n&&(0,R.jsx)($V,{keepMounted:!0,render:e=>{let{style:t,onDrag:n,onDragStart:r,onDragEnd:i,onAnimationStart:a,onAnimationEnd:o,onAnimationIteration:s,...c}=e;return(0,R.jsx)(Pe.svg,{...c,width:h?14:18,height:h?14:18,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-foreground`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:1},children:(0,R.jsx)(Pe.path,{d:`M6 12L10 16L18 8`,initial:{pathLength:+!!p},animate:{pathLength:1,transition:{duration:.08,ease:`easeOut`}},exit:{pathLength:0,transition:{duration:.04,ease:`easeIn`}}})})}})})]}),(0,R.jsxs)(`span`,{className:`inline-grid items-center self-center leading-none`,children:[(0,R.jsx)(`span`,{className:`col-start-1 row-start-1 invisible leading-none`,style:{fontVariationSettings:ke.semibold},"aria-hidden":`true`,children:e}),(0,R.jsx)(`span`,{className:L(`col-start-1 row-start-1 leading-none transition-[color,font-variation-settings] duration-80`,h?`text-[11px]`:`text-[13px]`,n||f?`text-foreground`:`text-muted-foreground`),style:{fontVariationSettings:n?ke.semibold:ke.normal},children:e})]})]})});rH.displayName=`CheckboxItem`;var iH=36,aH=188,oH=6;function sH(e,t,n){let[r,i]=(0,z.useState)(0),[a,o]=(0,z.useState)(0),s=(0,z.useMemo)(()=>{let n=[],r=[],i=0;for(let a of e){n.push(i);let e=iH+(t.has(a.id)?aH:0);r.push(e),i+=e}return{offsets:n,heights:r,totalHeight:i}},[t,e]),c=(0,z.useMemo)(()=>{if(e.length===0)return{totalHeight:0,visibleItems:[]};let{offsets:t,heights:n,totalHeight:i}=s,o=r+a,c=0;for(;c<e.length&&t[c]+n[c]<r;)c++;c=Math.max(0,c-oH);let l=c;for(;l<e.length&&t[l]<o;)l++;l=Math.min(e.length,l+oH);let u=[];for(let r=c;r<l;r++)u.push({index:r,item:e[r],top:t[r],height:n[r]});return{totalHeight:i,visibleItems:u}},[e,s,r,a]),l=(0,z.useCallback)(()=>{let e=n.current;e&&i(e.scrollTop)},[n]);return(0,z.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{o(e.clientHeight),i(e.scrollTop)};t();let r=new ResizeObserver(t);return r.observe(e),e.addEventListener(`scroll`,l,{passive:!0}),()=>{r.disconnect(),e.removeEventListener(`scroll`,l)}},[l,n,e.length]),c}var cH=300,lH=/(?:^|\/)notifications\//;function uH(e){let t=e;return typeof t?.method==`string`?t.method:null}function dH(e){let t=e.message;if(t?.id!==void 0&&t.id!==null||t?.result!==void 0||t?.error!==void 0)return null;let n=uH(e.message);return!n||!lH.test(n)?null:[e.source,e.serverId,e.widgetId??``,e.direction,n].join(`|`)}function fH(e,t,n=Date.now()){let r=dH(e),i=dH(t);if(!r||r!==i)return!1;let a=Date.parse(e.timestamp);return Number.isNaN(a)?!1:n-a<=cH}function pH(e,t){return{...e,timestamp:t.timestamp,message:t.message,repeatCount:(e.repeatCount??1)+1}}var mH=new class{maxEntries;entries=[];listeners=new Set;nextId=0;emitFrame=null;constructor(e=1e3){this.maxEntries=e}publish(e){let t=this.entries[this.entries.length-1];if(t&&fH(t,e,Date.parse(e.timestamp))){this.entries[this.entries.length-1]=pH(t,e),this.scheduleEmit();return}this.entries.push({...e,id:`rpc-${++this.nextId}`}),this.entries.length>this.maxEntries&&this.entries.splice(0,this.entries.length-this.maxEntries),this.scheduleEmit()}getSnapshot=()=>this.entries;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));clear(e={}){let t=new Set(e.serverIds??[]),n=new Set(e.sources??[]);t.size===0&&n.size===0?this.entries=[]:this.entries=this.entries.filter(e=>!((t.size===0||t.has(e.serverId))&&(n.size===0||n.has(e.source)))),this.scheduleEmit()}peekCoalesceKey(e){return dH(e)}scheduleEmit(){if(this.emitFrame===null){if(typeof requestAnimationFrame>`u`){this.emit();return}this.emitFrame=requestAnimationFrame(()=>{this.emitFrame=null,this.emit()})}}emit(){this.listeners.forEach(e=>e())}},hH;function gH(e){mH.publish({source:`mcp`,serverId:e.serverId,direction:e.direction,timestamp:e.timestamp,message:e.message})}function _H(){hH||=(dk().forEach(gH),fk(gH))}_H();function vH({serverIds:e,onCountChange:t,onClearRef:n,onExportRef:r}={}){let i=(0,z.useRef)(null),[a,o]=(0,z.useState)(new Set),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(()=>new Set([`mcp`,`widget`])),p=(0,z.useSyncExternalStore)(mH.subscribe,mH.getSnapshot,mH.getSnapshot),m=async e=>{try{await lM(JSON.stringify(e,null,2)),oI.success(`Message copied to clipboard`)}catch(e){console.error(`Failed to copy message:`,e),oI.error(`Failed to copy to clipboard`)}},h=(0,z.useMemo)(()=>{if(!e?.length)return p;let t=new Set(e);return p.filter(e=>t.has(e.serverId))},[p,e]),g=(0,z.useMemo)(()=>{let e=new Set;return d.has(`mcp`)&&e.add(0),d.has(`widget`)&&e.add(1),e},[d]),_=(0,z.useCallback)(e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),y=(0,z.useMemo)(()=>{let e=h;d.size>0&&(e=e.filter(e=>d.has(e.source)));let t=s.trim().toLowerCase();return t&&(e=e.filter(e=>{let n=bH(e);return e.serverId.toLowerCase().includes(t)||e.widgetId?.toLowerCase().includes(t)||e.source.includes(t)||n.toLowerCase().includes(t)||e.direction.toLowerCase().includes(t)||JSON.stringify(e.message).toLowerCase().includes(t)})),[...e].reverse()},[h,s,d]),{totalHeight:b,visibleItems:x}=sH(y,a,i),S=(0,z.useCallback)(e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),C=(0,z.useCallback)(async()=>{let t=d.size===0||d.size===2?void 0:[...d];(!t||t.includes(`mcp`))&&(e?.length?e.forEach(e=>pk(e)):pk()),mH.clear({serverIds:e,sources:t}),o(new Set)},[e,d]),w=(0,z.useCallback)(async()=>{try{await lM(JSON.stringify(y,null,2)),oI.success(`Copied ${y.length} messages`)}catch(e){console.error(`Failed to copy messages:`,e),oI.error(`Failed to copy to clipboard`)}},[y]),T=(0,z.useCallback)(()=>{let e=new Blob([JSON.stringify(y,null,2)],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`mcp-rpc-traffic-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,n.click(),URL.revokeObjectURL(t)},[y]);return(0,z.useEffect)(()=>{t?.(y.length)},[y.length,t]),(0,z.useEffect)(()=>(n&&(n.current=C),()=>{n&&(n.current=null)}),[C,n]),(0,z.useEffect)(()=>(r&&(r.current=w),()=>{r&&(r.current=null)}),[w,r]),(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pr-2 pt-2 pl-1`,children:[(0,R.jsx)(`h2`,{className:`text-xs font-medium text-foreground`,children:`RPC Logs`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`size-7 p-0`,onClick:w,disabled:y.length===0,"aria-label":`Copy filtered RPC traffic`,title:`Copy filtered`,children:(0,R.jsx)(Wr,{className:`size-3.5`})}),(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`size-7 p-0`,onClick:T,disabled:y.length===0,"aria-label":`Download filtered RPC traffic as JSON`,title:`Download JSON`,children:(0,R.jsx)(qr,{className:`size-3.5`})}),(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`size-7 p-0`,onClick:C,disabled:p.length===0,"aria-label":`Clear RPC traffic`,title:`Clear`,children:(0,R.jsx)(Gi,{className:`size-3.5`})})]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center pr-2 pb-2 pt-1 pl-1`,children:[(0,R.jsxs)(`div`,{className:`relative min-w-0 flex-1 transition-[flex-grow] duration-200 ease-out`,children:[(0,R.jsx)(v,{className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(ht,{value:s,onChange:e=>c(e.target.value),onFocus:()=>u(!0),onBlur:()=>u(!1),placeholder:`Search`,"aria-label":`Search RPC traffic`,className:`h-8 w-full pl-7 text-xs shadow-none transition-[width] duration-200 ease-out`})]}),(0,R.jsx)(`div`,{"aria-hidden":l,className:L(`shrink-0 overflow-hidden transition-[max-width,opacity,margin] duration-200 ease-out`,l?`pointer-events-none ml-0 max-w-0 opacity-0`:`ml-2 max-w-32 opacity-100`),children:(0,R.jsxs)(nH,{checkedIndices:g,orientation:`horizontal`,"aria-label":`Filter RPC traffic by source`,className:`w-auto shrink-0`,children:[(0,R.jsx)(rH,{index:0,label:`MCP`,size:`sm`,checked:d.has(`mcp`),onToggle:()=>_(`mcp`)}),(0,R.jsx)(rH,{index:1,label:`UI`,size:`sm`,checked:d.has(`widget`),onToggle:()=>_(`widget`)})]})})]}),(0,R.jsx)(`div`,{ref:i,className:`min-h-0 flex-1 overflow-y-auto pb-10`,style:{maskImage:`linear-gradient(to bottom, black 0, black calc(100% - 3rem), transparent 100%)`,WebkitMaskImage:`linear-gradient(to bottom, black 0, black calc(100% - 3rem), transparent 100%)`},children:y.length===0?(0,R.jsxs)(`div`,{className:`text-center py-8`,children:[(0,R.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No messages yet`}),(0,R.jsx)(`div`,{className:`text-[10px] text-muted-foreground mt-1`,children:`JSON-RPC messages will appear here`})]}):(0,R.jsx)(`div`,{className:`relative w-full`,style:{height:b},children:x.map(({item:e,top:t,height:n})=>(0,R.jsx)(yH,{item:e,top:t,height:n,expanded:a.has(e.id),onToggle:()=>S(e.id),onCopy:()=>m(e.message)},e.id))})})]})}function yH({item:e,top:t,height:n,expanded:r,onToggle:i,onCopy:a}){let o=bH(e),s=xH(e),c=e.repeatCount&&e.repeatCount>1?` ×${e.repeatCount}`:``;return(0,R.jsxs)(`div`,{className:`absolute inset-x-0 overflow-hidden`,style:{top:t,height:n},"data-testid":`rpc-message-${o.replace(/\//g,`-`)}`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:i,className:`flex h-9 w-full cursor-pointer items-center gap-2 py-2 pr-3 pl-1 text-left text-muted-foreground transition-colors hover:text-foreground`,children:[(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:e.direction===`receive`?(0,R.jsx)(Dr,{className:`size-3.5 text-blue-500`}):(0,R.jsx)(Ar,{className:`size-3.5 text-emerald-500`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`left`,children:s})]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center`,children:e.source===`mcp`?(0,R.jsx)(WL,{className:`size-3`}):(0,R.jsx)(Ti,{className:`size-3`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`left`,children:e.source===`mcp`?`MCP server`:`UI widget`})]}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,children:[o,c?(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:c}):null]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`time`,{dateTime:e.timestamp,className:`shrink-0 cursor-default font-mono text-[10px] tabular-nums text-muted-foreground underline decoration-dotted underline-offset-2`,children:new Date(e.timestamp).toLocaleTimeString()}),nativeButton:!1}),(0,R.jsx)(lt,{side:`left`,children:new Date(e.timestamp).toLocaleString()})]})]}),r?(0,R.jsxs)(`div`,{className:`relative mx-3 mb-2 max-h-44 overflow-auto rounded-lg p-2 pr-8`,children:[(0,R.jsx)(VV,{data:e.message,className:`[&_pre]:!text-[10px] [&_pre]:!leading-4`}),(0,R.jsx)(Gt,{variant:`secondary`,size:`icon-sm`,onClick:a,className:`absolute right-1 top-1 size-6 rounded-full p-0`,title:`Copy message`,"aria-label":`Copy message`,children:(0,R.jsx)(Wr,{className:`size-3`})})]}):null]})}function bH(e){let t=uH(e.message);if(t)return t;let n=e.message;return n?.result===void 0?n?.error===void 0?`unknown`:`error`:`result`}function xH(e){return e.source===`widget`?e.direction===`send`?`Host → Widget`:`Widget → Host`:e.direction===`send`?`Inspector → MCP`:`MCP → Inspector`}function SH({serverId:e,open:t}){return(0,R.jsx)(`aside`,{"aria-label":`RPC Panel`,"aria-hidden":!t,className:L(`relative hidden min-h-0 shrink-0 flex-col overflow-hidden transition-[width,margin] duration-200 ease-out lg:flex`,t?`w-(--rpc-panel-width) lg:mr-[18px]`:`w-0 lg:mr-0`),children:(0,R.jsx)(`div`,{className:L(`flex h-full min-h-0 w-(--rpc-panel-width) flex-col transition-opacity duration-200 ease-out`,t?`opacity-100`:`pointer-events-none opacity-0`),children:(0,R.jsx)(vH,{serverIds:[e]})})})}function CH({...e}){return(0,R.jsx)(tL,{"data-slot":`sheet`,...e})}function wH(e){return(0,R.jsx)(rL,{"data-slot":`sheet-trigger`,...e})}function TH({...e}){return(0,R.jsx)(JI,{"data-slot":`sheet-portal`,...e})}function EH({className:e,container:t,...n}){return(0,R.jsx)(zI,{"data-slot":`sheet-overlay`,className:L(`inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0`,t?`absolute`:`fixed`,e),...n})}function DH({className:e,children:t,side:n=`right`,showCloseButton:r=!0,container:i,...a}){return(0,R.jsxs)(TH,{container:i??void 0,children:[(0,R.jsx)(EH,{container:i}),(0,R.jsxs)(qI,{"data-slot":`sheet-content`,"data-side":n,className:L(`z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,i?`absolute`:`fixed`,e),...a,children:[t,r&&(0,R.jsxs)(BI,{"data-slot":`sheet-close`,render:(0,R.jsx)(Gt,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,R.jsx)(Xi,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function OH({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`sheet-header`,className:L(`flex flex-col gap-1.5 p-4`,e),...t})}function kH({className:e,...t}){return(0,R.jsx)(nL,{"data-slot":`sheet-title`,className:L(`font-medium text-foreground`,e),...t})}function AH({className:e,...t}){return(0,R.jsx)(VI,{"data-slot":`sheet-description`,className:L(`text-sm text-muted-foreground`,e),...t})}var jH=`https://cdn.mcp-use.com/mcpuse_logo_circle_dark.svg`;function MH({symbolSize:e=14,className:t,textClassName:n}){return(0,R.jsxs)(`span`,{className:L(`inline-flex items-center gap-1.5`,t),children:[(0,R.jsx)(NH,{size:e}),(0,R.jsx)(`span`,{className:L(`font-medium leading-none text-black [font-family:var(--font-family-outfit)]`,n),children:`Manufact`})]})}function NH({size:e=14,className:t}){return(0,R.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 480 480`,"aria-hidden":!0,className:L(`block shrink-0`,t),children:[(0,R.jsx)(`path`,{d:`M101.7 0 C157.9 0 203.4 45.7 203.4 102.1 C203.4 126.6 202.1 152.1 212.2 174.3 L219.8 191 C233.8 221.8 258.5 246.4 289.2 260.5 L303.5 267 C326.5 277.5 353 275.8 378.3 275.8 C434.5 275.8 480 321.5 480 377.9 C480 434.3 434.5 480 378.3 480 C322.1 480 276.6 434.3 276.6 377.9 C276.6 354.2 277.7 329.6 267.8 308 L259.8 290.3 C245.7 259.5 221 234.8 190.2 220.7 L173 212.9 C151 202.9 125.8 204.2 101.7 204.2 C45.5 204.2 0 158.5 0 102.1 C0 45.7 45.5 0 101.7 0 Z`,fill:`currentColor`}),(0,R.jsx)(`circle`,{cx:`96.4`,cy:`383.6`,r:`96.4`,fill:`currentColor`}),(0,R.jsx)(`circle`,{cx:`383.6`,cy:`96.4`,r:`96.4`,fill:`currentColor`})]})}var PH=`data:image/svg+xml,%3Csvg%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22%2394A3B8%22%20stroke%3D%22%2394A3B8%22%3E%3Cg%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M3%20248.945C18%20248.945%2076%20236%20106%20219C136%20202%20136%20202%20198%20158C276.497%20102.293%20332%20120.945%20423%20120.945%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M511%20121.5L357.25%20210.268L357.25%2032.7324L511%20121.5Z%22%2F%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M0%20249C15%20249%2073%20261.945%20103%20278.945C133%20295.945%20133%20295.945%20195%20339.945C273.497%20395.652%20329%20377%20420%20377%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M508%20376.445L354.25%20287.678L354.25%20465.213L508%20376.445Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`,FH={openai:`OpenAI`,anthropic:`Anthropic`,google:`Google`};function IH(e){let t=e.split(`/`)[0]?.toLowerCase();return t===`openai`||t===`anthropic`||t===`google`?t:`openrouter`}function LH(e,t){let n=e.trim(),r=FH[t];if(r){let e=r.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),t=RegExp(`^${e}\\s*:\\s*`,`i`),i=n.replace(t,``).trim();if(i.length>0)return i}let i=n.indexOf(`: `);return i>0&&i<48?n.slice(i+2).trim():n}function RH({provider:e,model:t,displayName:n,mode:r=`byok`,className:i,...a}){let o=n??t,s=r===`managed`&&e===`openai-compatible`?IH(t):e;return(0,R.jsxs)(`button`,{type:`button`,className:L(`inline-flex items-center gap-1.5 min-w-0 border-0 bg-transparent p-1`,`font-mono text-[11px] text-muted-foreground cursor-pointer`,`hover:text-foreground transition-colors`,`rounded-md outline-none focus-visible:ring-1 focus-visible:ring-ring`,i),...a,children:[r===`managed`?(0,R.jsx)(`img`,{src:jH,alt:`Manufact`,className:`h-3.5 w-3.5 shrink-0 rounded-full object-cover`}):(0,R.jsx)(ci,{className:`size-3 shrink-0 opacity-70`,"aria-hidden":!0}),(0,R.jsx)(VH,{provider:s,className:`shrink-0`}),(0,R.jsx)(`span`,{className:`whitespace-nowrap`,children:o}),(0,R.jsx)(Ir,{className:`size-3 shrink-0 opacity-60`,"aria-hidden":!0})]})}function zH(e){switch(e){case`openai`:return`OpenAI`;case`openai-compatible`:return`OpenAI Compatible`;case`anthropic`:return`Anthropic`;case`google`:return`Google`;case`openrouter`:return`OpenRouter`;case`ollama`:return`Ollama`;default:return e}}function BH(e,t){switch(e){case`openai`:case`anthropic`:case`google`:return`https://inspector-cdn.mcp-use.com/providers/${e}.png`;case`ollama`:return`https://inspector-cdn.mcp-use.com/providers/${t===`dark`?`ollama_dark`:`ollama_light`}.png`;case`openrouter`:return PH;case`openai-compatible`:return null;default:return null}}function VH({provider:e,className:t}){let{resolvedTheme:n}=Fz();if(e===`openai-compatible`)return null;let r=BH(e,n);if(r){let n=e===`ollama`?`h-3.5 w-3.5 object-contain`:`h-4 w-4 rounded-full object-cover`;return(0,R.jsx)(`img`,{src:r,alt:zH(e),className:L(n,t)})}return(0,R.jsx)(`div`,{"aria-label":zH(e),className:L(`flex h-4 w-4 items-center justify-center rounded-full bg-neutral-900 text-[9px] font-semibold text-white dark:bg-neutral-100 dark:text-neutral-900`,t),children:zH(e).charAt(0)})}function HH({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0,children:(0,R.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}var UH=`flex flex-1 items-center justify-center text-muted-foreground transition-colors hover:text-foreground active:text-foreground`;function WH({serverId:e,rpcLoggerOpen:t,onRpcLoggerOpenChange:n}){let r=NB(),{embeddedConfig:i}=EL(),{user:a}=mz(i.chatApiUrl),o=a?`https://manufact.com/cloud?ref=mcp-use-inspector`:`https://manufact.com/signup?ref=mcp-use-inspector`;return(0,R.jsxs)(R.Fragment,{children:[typeof document<`u`&&(0,br.createPortal)((0,R.jsxs)(`nav`,{"aria-label":`Inspector shortcuts`,className:`fixed inset-x-0 bottom-0 z-[100] flex items-center bg-transparent px-4 pt-(--mobile-chrome-gap) pb-[calc(var(--mobile-chrome-gap)+env(safe-area-inset-bottom))] lg:hidden`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>n(!t),className:L(UH,t&&`text-foreground`),"aria-label":`RPC logs`,"aria-pressed":t,children:(0,R.jsx)(Pi,{className:`size-4 shrink-0`})}),(0,R.jsx)(`a`,{href:`https://github.com/mcp-use/mcp-use`,target:`_blank`,rel:`noopener noreferrer`,className:UH,"aria-label":`GitHub`,children:(0,R.jsx)(LB,{className:`size-4 shrink-0`})}),(0,R.jsx)(`a`,{href:`https://discord.gg/XkNkSkMz3V`,target:`_blank`,rel:`noopener noreferrer`,className:UH,"aria-label":`Discord`,children:(0,R.jsx)(HH,{className:`size-4 shrink-0`})}),(0,R.jsx)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>{try{PT(new Mo({referrer:`mcp-use-inspector-mobile-toolbar`})).catch(()=>{})}catch{}},className:UH,"aria-label":`manufact.com`,children:(0,R.jsx)(NH,{size:16})})]}),document.body),!r&&(0,R.jsx)(CH,{open:t,onOpenChange:n,children:(0,R.jsxs)(DH,{side:`bottom`,className:`z-[101] flex h-[min(85dvh,720px)] flex-col gap-0 rounded-t-2xl border-zinc-200 p-0 dark:border-zinc-700`,children:[(0,R.jsx)(OH,{className:`sr-only`,children:(0,R.jsx)(kH,{children:`RPC logs`})}),(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-2 pb-2 pt-1`,children:(0,R.jsx)(vH,{serverIds:e?[e]:void 0})})]})})]})}function GH(e){return`${e.replace(/\/+$/,``)}${pM()}`}function KH({tunnelUrl:e,tunnelMcpUrl:t,selectedServerId:n,selectedServer:r,configLoaded:i,removeConnection:a,updateConnection:o,connections:s}){let c=(0,z.useRef)(null),l=(0,z.useRef)(!1),u=(0,z.useRef)(null),[d,f]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{!d||r?.url!==u.current||r.state!==`ready`&&r.state!==`failed`||(f(!1),l.current=!1,u.current=null)},[d,r]),(0,z.useEffect)(()=>{n&&_M(n)?c.current=n:r?.url&&_M(r.url)&&(c.current=r.url)},[r?.url,n]),(0,z.useEffect)(()=>{if(!i||!n||!r||l.current)return;let d=r.url??``,p=_M(d),m=vM(d),h=t??(e?GH(e):null),g=null;e&&h&&p?g=h:!e&&m&&c.current&&(g=c.current),!(!g||g===d)&&(l.current=!0,u.current=g,f(!0),(async()=>{try{g!==n&&s.some(e=>e.id===g)&&await a(g),await o(n,PM({...IM(n)??FM(r),url:g}))}catch{f(!1),u.current=null,l.current=!1}})())},[i,s,a,r,n,t,e,o]),(0,z.useEffect)(()=>{d||(l.current=!1)},[d]),d}function qH({children:e}){let t=sP(),n=iP(),{servers:r,addServer:i,removeServer:a,updateServerMetadata:o,updateServer:s,storageLoaded:c}=Aj(),l=(0,z.useCallback)(async(e,t)=>{try{await s(e,PM(t)),AM(e,t)}catch(t){console.error(`[Layout] Failed to update connection ${e}:`,t)}},[s]),u=(0,z.useCallback)(async(e,t)=>{try{await o(e,t)}catch(t){console.error(`[Layout] Failed to update connection metadata for ${e}:`,t)}},[o]),{selectedServerId:d,setSelectedServerId:f,activeTab:p,setActiveTab:m,navigateToItem:h,setTunnelUrl:g,tunnelUrl:_,isEmbedded:v,embeddedConfig:y,setEmbeddedMode:b}=EL(),[x,S]=(0,z.useState)(!1),[C,w]=(0,z.useState)(()=>{try{return localStorage.getItem(`inspector-sidebar-collapsed`)===`true`}catch{return!1}}),[T,E]=(0,z.useState)(()=>{try{return localStorage.getItem(`inspector-rpc-logger-open`)===`true`}catch{return!1}});(0,z.useEffect)(()=>{try{localStorage.setItem(`inspector-sidebar-collapsed`,C?`true`:`false`)}catch{}},[C]),(0,z.useEffect)(()=>{try{localStorage.setItem(`inspector-rpc-logger-open`,String(T))}catch{}},[T]);let{savedRequests:ee}=kL();(0,z.useEffect)(()=>{let e=new URLSearchParams(n.search),t=e.get(`embedded`)===`true`,r=e.get(`embeddedConfig`);if(t){let e={};if(r)try{e=JSON.parse(r)}catch(e){console.error(`Failed to parse embeddedConfig:`,e)}b(!0,e),e.defaultTab&&m(e.defaultTab)}},[]),(0,z.useEffect)(()=>{let e=new URLSearchParams(n.search).get(`tunnelUrl`);e!==null&&g(e)},[n.search,g]),(0,z.useEffect)(()=>{let e=new URLSearchParams(n.search).get(`tab`);e&&[`tools`,`prompts`,`resources`,`chat`,`sampling`,`elicitation`,`notifications`,`server-metadata`,`connection-settings`].includes(e)&&m(e)},[n.search,m]);let D=(0,z.useRef)(null),te=(0,z.useRef)(Date.now()),ne=(0,z.useRef)(new Set),re=(0,z.useRef)(0);(0,z.useEffect)(()=>{let e=()=>{re.current++};return window.addEventListener(`mcp-tool-executed`,e),()=>window.removeEventListener(`mcp-tool-executed`,e)},[]),(0,z.useEffect)(()=>{let e=()=>{try{PT(new Io({durationSeconds:Math.round((Date.now()-te.current)/1e3),tabsVisited:ne.current.size,toolsExecuted:re.current})).catch(()=>{})}catch{}};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[]);let O=(0,z.useCallback)(e=>{try{PT(new Po({tab:e,previousTab:D.current})).catch(()=>{})}catch{}D.current=e,ne.current.add(e),m(e);let r=new URLSearchParams(n.search);r.set(`tab`,e),t(`/?${r.toString()}`,{replace:!0})},[m,t,n.search]);(0,z.useEffect)(()=>{let e=e=>{let t=e.detail.requestId;d&&h(d,`sampling`,t)},t=e=>{let t=e.detail.requestId;d&&h(d,`elicitation`,t)},n=e=>{let t=e.detail.toolName;d&&t?h(d,`tools`,t):d&&O(`tools`)};return window.addEventListener(`navigate-to-sampling`,e),window.addEventListener(`navigate-to-elicitation`,t),window.addEventListener(`navigate-to-tool-result`,n),()=>{window.removeEventListener(`navigate-to-sampling`,e),window.removeEventListener(`navigate-to-elicitation`,t),window.removeEventListener(`navigate-to-tool-result`,n)}},[d,O,h]);let ie=(0,z.useRef)(null),k=(0,z.useRef)(null),A=(0,z.useRef)(null),{isAutoConnecting:j}=EI({connections:r,addServer:i,removeConnection:a,configLoaded:c,embedded:v});(0,z.useEffect)(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`)?`#000000`:`#f3f3f3`;document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let ae=(0,z.useCallback)(e=>{PT(new ko({trigger:e})).catch(()=>{}),S(!0)},[]),oe=e=>{if(!r.find(t=>t.id===e))return;f(e);let i=new URLSearchParams(n.search),a=i.get(`tunnelUrl`),o=i.get(`tab`),s=new URLSearchParams;s.set(`server`,e),a&&s.set(`tunnelUrl`,a),o&&s.set(`tab`,o),t(`/?${s.toString()}`)},se=(0,z.useCallback)(e=>{if(!d)return;let t=IM(d)||r.find(e=>e.id===d);e.url===d?t&&zM(t,e)?(u(d,{name:e.name||e.url}),AM(d,e)):l(d,e):(a(d),i(e.url,PM(e))),oI.success(`Connection settings updated`)},[d,r,a,i,u,l]),ce=(e,i,a)=>{if(console.warn(`[Layout] handleCommandPaletteNavigate called:`,{tab:e,itemName:i,serverId:a}),a){let o=r.find(e=>e.id===a);if(console.warn(`[Layout] Server lookup:`,{serverId:a,serverFound:!!o,serverState:o?.state}),!o||o.state!==`ready`){console.warn(`[Layout] Server not ready, showing error`),oI.error(`Server is not connected and cannot be inspected`);return}console.warn(`[Layout] Calling navigateToItem:`,{serverId:a,tab:e,itemName:i}),h(a,e,i);let s=new URLSearchParams(n.search),c=s.get(`tunnelUrl`),l=s.get(`tab`),u=new URLSearchParams;u.set(`server`,a),c&&u.set(`tunnelUrl`,c),e?u.set(`tab`,e):l&&u.set(`tab`,l);let d=`/?${u.toString()}`;console.warn(`[Layout] Navigating to:`,d),t(d)}else console.warn(`[Layout] No serverId, just updating tab to:`,e),O(e)},M=r.find(e=>e.id===d),N=KH({tunnelUrl:_,selectedServerId:d,selectedServer:M,configLoaded:c,removeConnection:a,updateConnection:s,connections:r}),le=M?M.tools.map(e=>({...e,_serverId:M.id})):r.flatMap(e=>e.state===`ready`?e.tools.map(t=>({...t,_serverId:e.id,_serverName:bM(e)})):[]),ue=M?M.prompts.map(e=>({...e,_serverId:M.id})):r.flatMap(e=>e.state===`ready`?e.prompts.map(t=>({...t,_serverId:e.id,_serverName:bM(e)})):[]),de=M?M.resources.map(e=>({...e,_serverId:M.id})):r.flatMap(e=>e.state===`ready`?e.resources.map(t=>({...t,_serverId:e.id,_serverName:bM(e)})):[]);(0,z.useEffect)(()=>{if(N)return;let e=new URLSearchParams(n.search),i=e.get(`server`);if(i&&(i.startsWith(`http://`)||i.startsWith(`https://`))&&!r.find(e=>e.id===i)){let n=new URLSearchParams(e);n.delete(`server`),n.set(`autoConnect`,i),t(`/?${n.toString()}`,{replace:!0});return}i!==d&&f(i)},[n.search,d,f,r,t,N]),(0,z.useEffect)(()=>{if(N)return;let e=new URLSearchParams(n.search).get(`server`);if(e&&!r.find(t=>t.id===e)){let e=setTimeout(()=>t(`/`),3e3);return()=>clearTimeout(e)}},[n.search,t,r,N]),(0,z.useEffect)(()=>{if(!v)return;let e=e=>{if(!e.data||typeof e.data!=`object`||e.data.type!==`mcp-inspector:connect_servers`)return;let t=e.data.servers;if(!Array.isArray(t)||t.length===0)return;let n=null;for(let e of t){if(!e.url||typeof e.url!=`string`)continue;let t=e.url,a=e.name??`Server`,o={...e.headers??{}};if(e.auth?.access_token){let t=e.auth.token_type||`bearer`;o.Authorization=`${t.charAt(0).toUpperCase()+t.slice(1)} ${e.auth.access_token}`}let s=typeof e.proxyConfig?.proxyAddress==`string`?e.proxyConfig.proxyAddress.trim():``,c=``;try{new URL(t).origin!==window.location.origin&&(c=TM())}catch{c=TM()}let l=s||c,u=EM(e.connectionMode,e.connectionType,!!s),d=PM({url:t,name:a,transportType:`http`,connectionMode:u,protocolNegotiation:CM(wM(e.protocolNegotiation)),connectionType:u===`proxy`?`Via Proxy`:`Direct`,proxyConfig:u===`proxy`&&l?{proxyAddress:l,...Object.keys(o).length>0?{headers:o}:{}}:void 0,headers:o,autoProxyFallback:u===`auto`&&l?{enabled:!0,proxyAddress:l}:!1});r.find(e=>e.url===t)||i(t,d),n||=t}window.parent!==window&&window.parent.postMessage({type:`mcp-inspector:servers_connected`,count:t.length},`*`)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[v,r,i]);let fe=(0,z.useRef)(!1);(0,z.useEffect)(()=>{if(!v||fe.current||d)return;let e=r.find(e=>e.state===`ready`);if(e){fe.current=!0,f(e.id);let r=new URLSearchParams(n.search);r.set(`server`,e.id),t(`/?${r.toString()}`,{replace:!0})}},[v,r,d,f,t,n.search]),DL({onCommandPalette:()=>ae(`keyboard`),onToolsTab:()=>{M&&O(`tools`)},onPromptsTab:()=>{M&&O(`prompts`)},onResourcesTab:()=>{M&&O(`resources`)},onChatTab:()=>{M&&O(`chat`)},onHome:()=>{t(`/`)},onFocusSearch:()=>{p===`tools`&&ie.current?ie.current.focusSearch():p===`prompts`&&k.current?k.current.focusSearch():p===`resources`&&A.current&&A.current.focusSearch()},onBlurSearch:()=>{p===`tools`&&ie.current?ie.current.blurSearch():p===`prompts`&&k.current?k.current.blurSearch():p===`resources`&&A.current&&A.current.blurSearch()}});let pe=new URLSearchParams(n.search).get(`server`),me=!c&&!!pe&&!pe.startsWith(`http://`)&&!pe.startsWith(`https://`),he=j||me||N,ge=M?.id??`home`,_e=he?`boot`:ge,[ve,ye]=(0,z.useState)(_e);(0,z.useLayoutEffect)(()=>{if(_e===ve)return;let e=()=>(0,br.flushSync)(()=>ye(_e));typeof document.startViewTransition==`function`?document.startViewTransition(e):e()},[_e,ve]);let be=ve===`boot`,xe=be||ve===`home`?void 0:r.find(e=>e.id===ve),P=v&&y.singleTab,Se=v?{backgroundColor:y.backgroundColor||`#f3f3f3`,padding:P?`0`:y.padding||`0.5rem`}:{},Ce=v?P?`h-screen flex flex-col`:`h-screen flex flex-col gap-2 sm:gap-4`:`h-screen bg-[#f3f3f3] dark:bg-black flex flex-col overflow-x-hidden px-4 lg:px-0 pb-[calc(var(--mobile-toolbar-height)+env(safe-area-inset-bottom))] lg:pb-4`,we=P?`flex-1 w-full bg-white dark:bg-black p-0 overflow-auto`:L(`flex-1 min-h-0 min-w-0 max-w-full w-full bg-white dark:bg-black rounded-2xl border border-zinc-200 dark:border-zinc-700 overflow-x-hidden overflow-y-auto`,!xe&&`lg:mx-4`,xe&&`lg:mr-4`);return(0,R.jsxs)(Ve,{children:[(0,R.jsx)(`div`,{className:`inspector-view-transition h-screen overflow-x-hidden bg-[#f3f3f3] dark:bg-black`,children:be?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center bg-[#f3f3f3] dark:bg-black`,children:(0,R.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,R.jsx)(bL,{className:`h-8 w-8 text-zinc-600 dark:text-zinc-400`}),(0,R.jsx)(`p`,{className:`text-sm text-zinc-600 dark:text-zinc-400`,children:`Connecting to MCP server...`})]})}):(0,R.jsxs)(`div`,{className:Ce,style:Se,children:[!P&&(0,R.jsx)(FB,{connections:r,selectedServer:xe,activeTab:p,onServerSelect:oe,onTabChange:O,embedded:v,sidebarCollapsed:C}),(0,R.jsxs)(`div`,{className:P?`flex-1 min-h-0`:`flex min-w-0 flex-1 min-h-0 overflow-hidden`,children:[xe&&!P&&(0,R.jsx)(CV,{activeTab:p,onTabChange:O,selectedServer:xe,visibleTabs:y.visibleTabs,collapsed:C,onCollapsedChange:w,rpcLoggerOpen:T,onRpcLoggerOpenChange:E,onCommandPaletteOpen:()=>ae(`button`)}),(0,R.jsx)(`main`,{className:we,children:(0,R.jsx)(az,{selectedServer:xe,activeTab:p,toolsSearchRef:ie,promptsSearchRef:k,resourcesSearchRef:A,onUpdateConnection:se,children:e})}),xe&&!P&&(0,R.jsx)(SH,{serverId:xe.id,open:T})]})]})}),!P&&!be&&(0,R.jsx)(WH,{serverId:xe?.id,rpcLoggerOpen:T,onRpcLoggerOpenChange:E}),(0,R.jsx)(KL,{isOpen:x,onOpenChange:S,tools:le,prompts:ue,resources:de,savedRequests:ee,connections:r,selectedServer:M,tunnelUrl:_,onNavigate:ce,onServerSelect:oe})]})}function JH({...e}){let{resolvedTheme:t}=Fz();return(0,R.jsx)(xI,{theme:t,className:`toaster group`,style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`},...e})}var YH=(0,z.createContext)(void 0),XH={deviceType:`desktop`,customViewport:{width:768,height:1024},cspMode:`permissive`,displayModeOverride:null,capabilities:{hover:!0,touch:!1},safeAreaInsets:{top:0,right:0,bottom:0,left:0},locale:`en-US`,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`};function ZH({children:e}){let[t,n]=(0,z.useState)({activeWidgetId:null,widgets:new Map,playground:XH}),r=(0,z.useCallback)(e=>{n(t=>({...t,activeWidgetId:e}))},[]),i=(0,z.useCallback)((e,t)=>{n(n=>{if(n.widgets.has(e))return n;let r=new Map(n.widgets);return r.set(e,{...t,cspViolations:[]}),{...n,widgets:r}})},[]),a=(0,z.useCallback)(e=>{n(t=>{let n=new Map(t.widgets);return n.delete(e),{...t,widgets:n,activeWidgetId:t.activeWidgetId===e?null:t.activeWidgetId}})},[]),o=(0,z.useRef)(t);o.current=t;let s=(0,z.useCallback)(e=>o.current.widgets.get(e),[]),c=(0,z.useCallback)((e,t)=>{n(n=>{let r=n.widgets.get(e);if(!r)return n;let i={cspViolations:[...r.cspViolations,t]};t.originalPolicy&&r.effectivePolicy===void 0&&(i.effectivePolicy=t.originalPolicy);let a=new Map(n.widgets);return a.set(e,{...r,...i}),{...n,widgets:a}})},[]),l=(0,z.useCallback)(e=>{n(t=>{let n=t.widgets.get(e);if(!n)return t;let r=new Map(t.widgets);return r.set(e,{...n,cspViolations:[]}),{...t,widgets:r}})},[]),u=(0,z.useCallback)((e,t)=>{n(n=>{let r=n.widgets.get(e);if(!r)return n;let i=new Map(n.widgets);return i.set(e,{...r,modelContext:t}),{...n,widgets:i}})},[]),d=(0,z.useCallback)((e,t)=>{n(n=>{let r=n.widgets.get(e);if(!r)return n;let i=new Map(n.widgets);return i.set(e,{...r,widgetState:t}),{...n,widgets:i}})},[]),f=(0,z.useCallback)((e,t,r)=>{n(n=>{let i=n.widgets.get(e);if(!i)return n;let a=new Map(n.widgets);return a.set(e,{...i,declaredCsp:t,...r!==void 0&&{effectivePolicy:r}}),{...n,widgets:a}})},[]),p=(0,z.useCallback)(e=>{n(t=>({...t,playground:{...t.playground,...e}}))},[]),m=(0,z.useCallback)(()=>{n(e=>({...e,widgets:new Map,activeWidgetId:null}))},[]),h=(0,z.useCallback)(()=>{let e=new Map;for(let[n,r]of t.widgets)r.modelContext&&e.set(n,r.modelContext);return e},[t.widgets]);return(0,R.jsx)(YH,{value:(0,z.useMemo)(()=>({...t,setActiveWidget:r,addWidget:i,removeWidget:a,getWidget:s,addCspViolation:c,clearCspViolations:l,setWidgetModelContext:u,setWidgetState:d,setWidgetDeclaredCsp:f,updatePlaygroundSettings:p,clearAllWidgets:m,getAllModelContexts:h}),[t,r,i,a,s,c,l,u,d,f,p,m,h]),children:e})}function QH(){let e=(0,z.use)(YH);if(!e)throw Error(`useWidgetDebug must be used within WidgetDebugProvider`);return e}var $H={mobile:{width:390,height:844,name:`iPhone 14`},desktop:{width:1440,height:900,name:`Desktop`}},eU=(0,z.lazy)(()=>lS(()=>import(`./OAuthCallback-VLHlUe2c.js`).then(e=>({default:e.OAuthCallback})),__vite__mapDeps([39,1,3]))),tU=(0,z.lazy)(()=>lS(()=>import(`./ManufactOAuthCallback-D4uYGigW.js`).then(e=>({default:e.ManufactOAuthCallback})),__vite__mapDeps([40,1,3]))),nU=(0,z.lazy)(()=>lS(()=>import(`./ViewPreview-COrmPpRr.js`).then(e=>({default:e.ViewPreview})),__vite__mapDeps([41,1,3,18,2])));function rU({activeTabRef:e}){let{activeTab:t}=EL();return(0,z.useEffect)(()=>{e.current=t},[t,e]),null}function iU(){let e=(0,z.useRef)(`tools`),t=new URLSearchParams(window.location.search),n=t.get(`embedded`)===`true`,r=t.get(`theme`),i=(0,z.useMemo)(()=>n?void 0:new BM(`mcp-inspector-connections`),[n]),a=TM(),o=a?.replace(/\/proxy\/?$/,`/oauth`),s=mM();return(0,z.useEffect)(()=>{MT()},[]),(0,z.useEffect)(()=>{let e=t.get(`auth_error`);if(!e)return;let n=t.get(`auth_error_description`);oI.error(`OAuth authentication failed: ${n||e}`,{duration:1/0,closeButton:!0});let r=new URLSearchParams(t);r.delete(`auth_error`),r.delete(`auth_error_description`);let i=r.toString();window.history.replaceState({},``,`${window.location.pathname}${i?`?${i}`:``}`)},[]),(0,R.jsx)(Iz,{forcedTheme:r||void 0,children:(0,R.jsx)(Jt,{defaultShape:`pill`,children:(0,R.jsx)(ZH,{children:(0,R.jsx)(kj,{storageProvider:i,enableRpcLogging:!0,defaultCallbackUrl:`${window.location.origin}${s}/oauth/callback`,defaultOAuthProxyUrl:o,defaultAutoProxyFallback:a?{enabled:!0,proxyAddress:a}:!1,defaultServerConfig:{preventAutoAuth:!0,useRedirectFlow:!0},clientInfo:{name:`mcp-use Inspector`,version:Lo(),websiteUrl:`https://mcp-use.com`,icons:[{src:`https://mcp-use.com/logo.png`}],capabilities:{extensions:{"io.modelcontextprotocol/ui":{mimeTypes:[`text/html;profile=mcp-app`]}}}},onServerAdded:(e,t)=>{console.log(`[Inspector] Server added:`,e,t.state)},onServerRemoved:e=>{console.log(`[Inspector] Server removed:`,e)},onServerStateChange:(e,t)=>{console.log(`[Inspector] Server state changed:`,e,t)},onSamplingRequest:(e,t,n,r,i)=>{let a=oI((0,R.jsx)(Fn,{title:`Sampling Request Received`,description:`New request from ${n}`,actions:[{label:`View Details`,testId:`sampling-toast-view-details`,onClick:()=>{let t=new CustomEvent(`navigate-to-sampling`,{detail:{requestId:e.id}});window.dispatchEvent(t),oI.dismiss(a)}},{label:`Approve`,testId:`sampling-toast-approve`,onClick:()=>{r(e.id,In),oI.success(`Sampling request approved`),oI.dismiss(a)}},{label:`Deny`,testId:`sampling-toast-deny`,onClick:()=>{i(e.id,`User denied from toast`),oI.dismiss(a)}}]}),{duration:1/0})},onElicitationRequest:(t,n,r,i,a)=>{if(e.current===`chat`)return;let o=t.request.mode||`form`,s=t.request.message,c=o===`url`&&`url`in t.request?t.request.url:void 0,l=oI((0,R.jsx)(Fn,{title:`Elicitation Request Received`,description:`From ${r}: ${s}`,extra:o===`url`&&c?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 font-mono`,children:c}):void 0,actions:[{label:`View Details`,testId:`elicitation-toast-view-details`,onClick:()=>{let e=new CustomEvent(`navigate-to-elicitation`,{detail:{requestId:t.id}});window.dispatchEvent(e),oI.dismiss(l)}},...o===`url`&&c?[{label:`Open URL`,testId:`elicitation-toast-open-url`,onClick:()=>{window.open(c,`_blank`),oI.dismiss(l)}}]:[],{label:`Cancel`,testId:`elicitation-toast-cancel`,onClick:()=>{a(t.id,`User cancelled from toast`),oI.dismiss(l)}}]}),{duration:1/0})},children:(0,R.jsxs)(TL,{children:[(0,R.jsx)(rU,{activeTabRef:e}),(0,R.jsx)(wF,{basename:s,children:(0,R.jsxs)(FP,{children:[(0,R.jsx)(NP,{path:`/oauth/callback`,element:(0,R.jsx)(JR,{children:(0,R.jsx)(eU,{})})}),(0,R.jsx)(NP,{path:`/auth/callback`,element:(0,R.jsx)(JR,{children:(0,R.jsx)(tU,{})})}),(0,R.jsx)(NP,{path:`/preview/:view`,element:(0,R.jsx)(JR,{children:(0,R.jsx)(nU,{})})}),(0,R.jsx)(NP,{path:`/`,element:(0,R.jsx)(qH,{children:(0,R.jsx)(CL,{})})})]})}),(0,R.jsx)(JH,{position:`top-center`})]})})})})})}var aU=document.getElementById(`root`);aU?Pn.createRoot(aU).render((0,R.jsx)(iU,{})):console.error(`[inspector] Root element not found`);export{zI as $,Wi as $t,mz as A,Q as At,uL as B,go as Bt,TV as C,Mr as Cn,qj as Ct,_B as D,Aj as Dt,hB as E,_r as En,gj as Et,bL as F,Eo as Ft,hL as G,Ya as Gt,mL as H,vo as Ht,yL as I,wo as It,eL as J,Xa as Jt,lL as K,Za as Kt,vL as L,Co as Lt,kL as M,Bb as Mt,DL as N,Cf as Nt,gB as O,PT as Ot,EL as P,No as Pt,BI as Q,Gi as Qt,cL as R,So as Rt,jV as S,Fr as Sn,oM as St,HB as T,vr as Tn,Jj as Tt,dL as U,mo as Ut,gL as V,bo as Vt,pL as W,ro as Wt,qI as X,Xi as Xt,JI as Y,Ia as Yt,VI as Z,Yi as Zt,ZV as _,Yr as _n,xM as _t,VH as a,xi as an,kI as at,VV as b,Vr as bn,lM as bt,CH as c,fi as cn,FF as ct,OH as d,ai as dn,IM as dt,zi as en,PI as et,kH as f,ri as fn,wM as ft,QV as g,Xr as gn,bM as gt,$V as h,Zr as hn,yM as ht,RH as i,Ti as in,OI as it,NR as j,lS as jt,Fz as k,KC as kt,DH as l,ci as ln,jM as lt,mH as m,$r as mn,FM as mt,QH as n,Ai as nn,jI as nt,LH as o,bi as on,oI as ot,wH as p,ti as pn,CM as pt,nL as q,$a as qt,MH as r,ki as rn,AI as rt,zH as s,yi as sn,lP as st,$H as t,Ii as tn,DI as tt,AH as u,si as un,TM as ut,qV as v,qr as vn,pM as vt,nV as w,jr as wn,Yj as wt,AV as x,Ir as xn,uM as xt,KV as y,Wr as yn,hM as yt,fL as z,Ao as zt};
|
|
499
|
+
`;for(let{name:n}of e)t+=`export ${n}="your-${n}-value"\n`;return t}function HL({className:e,size:t=`md`}){return(0,R.jsxs)(`svg`,{viewBox:`0 0 500 500`,className:L(`text-current`,{sm:`h-4 w-4`,md:`h-5 w-5`,lg:`h-6 w-6`}[t],e),fill:`currentColor`,fillRule:`nonzero`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M105.933 0C164.437 0.000116002 211.865 47.607 211.865 106.333C211.865 131.829 210.493 158.403 221.068 181.602L228.975 198.947C243.584 230.997 269.265 256.7 301.303 271.336L316.155 278.121C340.142 289.079 367.694 287.335 394.066 287.335C452.571 287.335 499.999 334.942 499.999 393.668C499.999 452.394 452.571 500.001 394.066 500.001C335.562 500.001 288.134 452.394 288.134 393.668C288.134 368.974 289.24 343.275 278.992 320.807L270.586 302.38C255.948 270.29 230.214 244.565 198.118 229.939L180.164 221.758C157.282 211.331 131.078 212.666 105.933 212.666C47.4278 212.666 4.86252e-05 165.059 0 106.333C0 47.607 47.4278 0 105.933 0Z`}),(0,R.jsx)(`circle`,{cx:`100.426`,cy:`399.575`,r:`100.426`}),(0,R.jsx)(`path`,{d:`M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z`})]})}function UL({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,R.jsx)(`path`,{d:`M23.15 2.587L18.21.21a1.494 1.494 0 0 0-1.705.29l-9.46 8.63-4.12-3.128a.999.999 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12 .326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a.999.999 0 0 0 1.276.057l4.12-3.128 9.46 8.63a1.492 1.492 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352zm-5.146 14.861L10.826 12l7.178-5.448v10.896z`})})}function WL({className:e}){return(0,R.jsxs)(`svg`,{fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,className:e,xmlns:`http://www.w3.org/2000/svg`,"aria-label":`ModelContextProtocol`,children:[(0,R.jsx)(`path`,{d:`M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z`}),(0,R.jsx)(`path`,{d:`M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z`})]})}function GL({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,children:(0,R.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}function KL({isOpen:e,onOpenChange:t,tools:n,prompts:r,resources:i,savedRequests:a,connections:o,selectedServer:s,tunnelUrl:c,onNavigate:l,onServerSelect:u}){let[d,f]=(0,z.useState)(``),[p,m]=(0,z.useState)(0),h=(0,z.useRef)(null),g=(0,z.useRef)(null),_=sP(),y=kt.pill,{activeIndex:b,itemRects:x,sessionRef:S,handlers:C,registerItem:w,measureItems:T}=_n(h),E=s?c?`${c}/mcp`:s.url:null,ee=s?.name||`MCP Server`,D=s?MM(s):void 0,te=s?[{id:`open-in-cursor`,name:`Open in Cursor`,description:`Add this server to Cursor`,type:`global`,category:`Open in Client`,action:()=>{try{let e=NL(E,ee,D);window.location.href=e,oI.success(`Opening in Cursor...`),t(!1)}catch{oI.error(`Failed to open in Cursor`)}}},{id:`open-in-claude-code`,name:`Open in Claude Code`,description:`Add this server to Claude Code CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=RL(E,ee,D);lM(e),oI.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-claude-desktop`,name:`Open in Claude Desktop`,description:`Download .mcpb configuration file`,type:`global`,category:`Open in Client`,action:()=>{try{LL(E,ee,D),oI.success(`Downloaded .mcpb file`),t(!1)}catch{oI.error(`Failed to download configuration file`)}}},{id:`open-in-vscode`,name:`Open in VS Code`,description:`Add this server to VS Code`,type:`global`,category:`Open in Client`,action:()=>{try{let e=PL(E,ee,D);window.location.href=e,oI.success(`Opening in VS Code...`),t(!1)}catch{oI.error(`Failed to open in VS Code`)}}},{id:`open-in-vscode-insiders`,name:`Open in VS Code Insiders`,description:`Add this server to VS Code Insiders`,type:`global`,category:`Open in Client`,action:()=>{try{let e=FL(E,ee,D);window.location.href=e,oI.success(`Opening in VS Code Insiders...`),t(!1)}catch{oI.error(`Failed to open in VS Code Insiders`)}}},{id:`open-in-gemini`,name:`Open in Gemini CLI`,description:`Add this server to Gemini CLI`,type:`global`,category:`Open in Client`,action:()=>{let{command:e}=zL(E,ee,D);lM(e),oI.success(`Command copied to clipboard`),t(!1)}},{id:`open-in-codex`,name:`Open in Codex CLI`,description:`Add this server to Codex CLI`,type:`global`,category:`Open in Client`,action:()=>{let{config:e}=BL(E,ee,D);lM(e),oI.success(`Config copied to clipboard`),t(!1)}}]:[],ne=[{id:`connect-server`,name:`Connect Server`,description:`Add a new MCP server connection`,type:`global`,category:`Navigation`,action:()=>_(`/`)},{id:`mcp-use-website`,name:`MCP Use Website`,description:`Visit mcp-use.com for tools and resources`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com`,`_blank`)},{id:`mcp-use-docs`,name:`How to Create an MCP Server`,description:`Step-by-step guide to building MCP servers`,type:`global`,category:`Documentation`,action:()=>window.open(`https://mcp-use.com/docs`,`_blank`)},{id:`mcp-docs`,name:`MCP Official Documentation`,description:`Learn about the Model Context Protocol`,type:`global`,category:`Documentation`,action:()=>window.open(`https://modelcontextprotocol.io/docs/getting-started/intro`,`_blank`)},{id:`discord`,name:`Join Discord Community`,description:`Connect with the MCP community`,type:`global`,category:`Community`,action:()=>window.open(`https://discord.gg/XkNkSkMz3V`,`_blank`)},{id:`clear-localstorage`,name:`Clear localStorage & Reload`,description:`Having trouble connecting? Clear stored auth data and refresh`,type:`global`,category:`Troubleshooting`,action:()=>{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n&&(n.startsWith(`mcp:auth`)||n.startsWith(`mcp-inspector`))&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),oI.success(`Cleared ${e.length} localStorage item(s). Refreshing page...`,{duration:2e3}),setTimeout(()=>{window.location.reload()},500),t(!1)}}],re=o.map(e=>({id:`server-${e.id}`,name:bM(e),description:`Connected server (${e.state})`,type:`global`,category:`Connected Servers`,metadata:{serverId:e.id,state:e.state},action:()=>u(e.id)})),O=[...ne,...te,...re,...n.map(e=>({id:`tool-${e.name}`,name:e.name,description:e.description,type:`tool`,category:e._serverName?`Tools - ${e._serverName}`:`Tools`,metadata:{inputSchema:e.inputSchema,serverId:e._serverId,serverName:e._serverName}})),...r.map(e=>({id:`prompt-${e.name}`,name:e.name,description:e.description,type:`prompt`,category:e._serverName?`Prompts - ${e._serverName}`:`Prompts`,metadata:{arguments:e.arguments,serverId:e._serverId,serverName:e._serverName}})),...i.map(e=>({id:`resource-${e.uri}`,name:e.name,description:e.description,type:`resource`,category:e._serverName?`Resources - ${e._serverName}`:`Resources`,metadata:{uri:e.uri,mimeType:e.mimeType,serverId:e._serverId,serverName:e._serverName}})),...a.map(e=>({id:`saved-${e.id}`,name:e.name,description:`Saved request for ${e.toolName}`,type:`saved-request`,category:`Saved Requests`,metadata:{toolName:e.toolName,args:e.args,savedAt:e.savedAt,serverId:e.serverId,serverName:e.serverName}}))].filter(e=>d.trim()?`${e.name} ${e.description||``} ${e.category}`.toLowerCase().includes(d.trim().toLowerCase()):!0),ie=(0,z.useCallback)(e=>{if(console.warn(`[CommandPalette] Item selected:`,{itemType:e.type,itemName:e.name,itemId:e.id,metadata:e.metadata}),e.action)console.warn(`[CommandPalette] Executing action for global item`),e.action(),t(!1);else if(e.type===`global`)e.metadata?.serverId&&(console.warn(`[CommandPalette] Selecting server:`,e.metadata.serverId),u(e.metadata.serverId),t(!1));else{let n=e.type===`resource`?e.metadata?.uri:e.name,r=e.type===`tool`?`tools`:e.type===`prompt`?`prompts`:e.type===`saved-request`?`tools`:`resources`;console.warn(`[CommandPalette] Navigating to item:`,{tab:r,itemIdentifier:n,serverId:e.metadata?.serverId}),l(r,n,e.metadata?.serverId),t(!1)}},[l,t,u]),k=(e,t,n)=>{switch(e){case`tool`:return(0,R.jsx)(`div`,{className:`bg-blue-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Yi,{className:`h-4 w-4 text-blue-500`})});case`prompt`:return(0,R.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(yi,{className:`h-4 w-4 text-purple-500`})});case`resource`:return(0,R.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Qr,{className:`h-4 w-4 text-green-500`})});case`saved-request`:return(0,R.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(ri,{className:`h-4 w-4 text-orange-500`})});case`global`:if(t===`Navigation`)return(0,R.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Ai,{className:`h-4 w-4 text-gray-600 dark:text-gray-300`})});if(t===`Open in Client`){if(n?.includes(`Cursor`))return(0,R.jsx)(`div`,{className:`bg-gray-200 dark:bg-gray-800 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/cursor`,alt:`Cursor`,className:`h-4 w-4`})});if(n?.includes(`Claude Code`)||n?.includes(`Claude Desktop`))return(0,R.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`})});if(n?.includes(`VS Code`))return(0,R.jsx)(`div`,{className:`bg-blue-600/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(UL,{className:`h-4 w-4 text-blue-600`})});if(n?.includes(`Gemini`))return(0,R.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/googlegemini`,alt:`Gemini`,className:`h-4 w-4`})});if(n?.includes(`Codex`))return(0,R.jsx)(`div`,{className:`bg-green-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(`img`,{src:`https://inspector-cdn.mcp-use.com/providers/openai.png`,alt:`Codex`,className:`h-4 w-4`})})}return t===`Documentation`?n?.includes(`MCP Use`)||n?.includes(`mcp-use`)?(0,R.jsx)(`div`,{className:`bg-black/10 dark:bg-white/10 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(HL,{className:`h-4 w-4 text-black dark:text-white`,size:`sm`})}):(0,R.jsx)(`div`,{className:`bg-orange-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Yr,{className:`h-4 w-4 text-orange-500`})}):t===`Community`?(0,R.jsx)(`div`,{className:`bg-purple-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(GL,{className:`h-4 w-4 text-purple-500`})}):t===`Troubleshooting`?(0,R.jsx)(`div`,{className:`bg-yellow-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Pr,{className:`h-4 w-4 text-yellow-500`})}):t===`Connected Servers`?(0,R.jsx)(`div`,{className:`bg-cyan-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Fi,{className:`h-4 w-4 text-cyan-500`})}):(0,R.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Yr,{className:`h-4 w-4 text-gray-500`})});default:return(0,R.jsx)(`div`,{className:`bg-gray-500/20 rounded-full p-2 flex items-center justify-center shrink-0`,children:(0,R.jsx)(v,{className:`h-4 w-4 text-gray-500`})})}};(0,z.useEffect)(()=>{e&&(f(``),m(0),requestAnimationFrame(()=>g.current?.focus()))},[e]),(0,z.useEffect)(()=>{h.current&&(h.current.scrollTop=0),m(0)},[d]),(0,z.useEffect)(()=>{p>=O.length&&m(Math.max(0,O.length-1))},[p,O.length]),(0,z.useLayoutEffect)(()=>{e&&T()},[e,T,O]);let A=x[p]??null,j=b===null?null:x[b],ae=b!==null&&b!==p;return e?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,className:`fixed inset-0 z-50 bg-black/40 backdrop-blur-sm`,"aria-label":`Close command palette`,onClick:()=>t(!1)}),(0,R.jsxs)(`div`,{role:`dialog`,"aria-label":`Command Palette`,"data-testid":`command-palette-dialog`,className:`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-[51] max-w-[640px] w-[calc(100vw-2rem)] sm:w-full p-2 bg-white dark:bg-zinc-900/90 backdrop-blur-xl rounded-xl overflow-hidden border border-border shadow-[var(--cmdk-shadow)] transition-transform duration-100 ease-out outline-none`,onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),m(e=>Math.min(e+1,O.length-1))):e.key===`ArrowUp`?(e.preventDefault(),m(e=>Math.max(e-1,0))):e.key===`Enter`&&O[p]?(e.preventDefault(),ie(O[p])):e.key===`Escape`&&(e.preventDefault(),t(!1))},children:[(0,R.jsx)(`input`,{ref:g,placeholder:`What do you need?`,value:d,onChange:e=>f(e.target.value),className:`border-none w-full text-[17px] px-4 pt-2 pb-4 outline-none bg-transparent text-foreground border-b border-border mb-0 rounded-none placeholder:text-muted-foreground`,"data-testid":`command-palette-input`}),(0,R.jsxs)(`div`,{ref:h,onMouseEnter:C.onMouseEnter,onMouseMove:C.onMouseMove,onMouseLeave:C.onMouseLeave,className:`relative isolate min-h-[200px] sm:min-h-[330px] max-h-[400px] overflow-auto overscroll-contain transition-[height] duration-100 ease-out px-1`,"data-testid":`command-palette-list`,children:[(0,R.jsx)(en,{children:A&&(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:L(`pointer-events-none absolute bg-active`,y.bg),initial:!1,animate:{top:A.top,left:A.left,width:A.width,height:A.height,opacity:ae?.8:1},exit:{opacity:0,transition:pt.moderate.exit},transition:{...pt.moderate,opacity:{duration:.08}}})}),(0,R.jsx)(en,{children:j&&(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:L(`pointer-events-none absolute bg-hover`,y.bg),initial:{opacity:0,top:A?.top??j.top,left:A?.left??j.left,width:A?.width??j.width,height:A?.height??j.height},animate:{opacity:1,top:j.top,left:j.left,width:j.width,height:j.height},exit:{opacity:0,transition:pt.fast.exit},transition:{...pt.fast,opacity:{duration:.08}}},S.current)}),O.length===0?(0,R.jsx)(`div`,{className:`text-sm flex items-center justify-center h-12 whitespace-pre-wrap text-muted-foreground`,children:`No results found.`}):O.map((e,t)=>(0,R.jsxs)(`button`,{ref:e=>w(t,e),type:`button`,"data-testid":`command-palette-item-${e.id}`,"data-proximity-index":t,onClick:()=>ie(e),className:`[content-visibility:auto] relative z-10 cursor-pointer h-12 text-sm flex items-center gap-3 px-3 text-foreground select-none w-full text-left mt-1 first:mt-0`,children:[k(e.type,e.category,e.name),(0,R.jsx)(`span`,{className:`font-medium truncate flex-1 min-w-0`,children:e.name}),(()=>{let t=e.metadata?.serverId;if(!t||e.category===`Connected Servers`)return null;let n=o.find(e=>e.id===t);return n?(0,R.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0 text-muted-foreground`,children:[(0,R.jsx)(xL,{server:n,size:`xs`}),(0,R.jsx)(`span`,{className:`text-xs truncate max-w-[9rem]`,children:bM(n)})]}):null})()]},e.id))]}),(0,R.jsxs)(`div`,{className:`border-t border-border px-4 py-3 pb-1 flex items-center justify-between text-xs text-muted-foreground `,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`t`}),(0,R.jsx)(`span`,{children:`Tools`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`p`}),(0,R.jsx)(`span`,{children:`Prompts`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`r`}),(0,R.jsx)(`span`,{children:`Resources`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`c`}),(0,R.jsx)(`span`,{children:`Chat`})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center w-5 h-5 font-mono font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`h`}),(0,R.jsx)(`span`,{children:`Home`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:`inline-flex items-center justify-center px-2 h-5 font-mono text-[10px] font-medium rounded shadow-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 text-foreground leading-none`,children:`esc`}),(0,R.jsx)(`span`,{children:`Close`})]})]})]})]})]}):null}var qL=`openid profile email offline_access`,JL=`mcp-inspector:manufact-auth`,YL=`manufact:session-changed`,XL={loaded:!0,authorizing:!1,accessToken:null,user:null,mode:null},ZL=new Map,QL=new Set,$L=new Map,eR=new Map,tR=null,nR=!1;typeof window<`u`&&window.addEventListener(`message`,e=>{if(e.data?.type!==`manufact:invalidate-oauth-client`)return;for(let e of ZL.keys())iR()?.removeItem(uR(e,`client`));let t=tR;!t||nR||(nR=!0,MR(t,{isRetry:!0}).finally(()=>{nR=!1}))});function rR(e){let t=ZL.get(e);if(t)return t;let n={...XL,loaded:!1};return ZL.set(e,n),n}function iR(){return typeof window>`u`?null:window.localStorage}function aR(e){return new URL(e).origin}function oR(e,t){let n=new URL(e),r=new URL(t),i=new Set([`localhost`,`127.0.0.1`]);return i.has(n.hostname)&&i.has(r.hostname)?n.origin===r.origin:(n.hostname===`manufact.com`||n.hostname.endsWith(`.manufact.com`))&&(r.hostname===`manufact.com`||r.hostname.endsWith(`.manufact.com`))}function sR(e){let t=window.__MANUFACT_LOGIN_URL__;if(t)return new URL(t).origin;let n=new URL(e);return n.hostname===`localhost`||n.hostname===`127.0.0.1`?`${n.protocol}//${n.hostname}:3000`:`${n.protocol}//manufact.com`}function cR(e){return`${sR(e)}/login`}function lR(e){return`${sR(e)}/auth/embedded-sign-out`}function uR(e,t){return`${JL}:${t}:${e}`}function dR(e){return iR()?.getItem(uR(e,`skip-session`))===`1`}function fR(e,t){let n=uR(e,`skip-session`);t?iR()?.setItem(n,`1`):iR()?.removeItem(n)}function pR(e){return`${JL}:state:${e}`}function mR(e){let t=iR()?.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return iR()?.removeItem(e),null}}function hR(e,t){iR()?.setItem(e,JSON.stringify(t))}function gR(e,t){ZL.set(e,{...ZL.get(e)??XL,...t}),QL.forEach(e=>e()),window.dispatchEvent(new CustomEvent(YL))}function _R(e){let t=``;return e.forEach(e=>{t+=String.fromCharCode(e)}),btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function vR(e=32){let t=new Uint8Array(e);return crypto.getRandomValues(t),_R(t)}async function yR(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return _R(new Uint8Array(t))}async function bR(e){let t=await fetch(`${e}/api/auth/.well-known/openid-configuration`);if(!t.ok)throw Error(`Manufact OAuth discovery failed`);return await t.json()}function xR(){return`${window.location.origin}${mM()}/auth/callback`}function SR(e){return e===`localhost`||e===`127.0.0.1`}function CR(e){try{let t=new URL(e).hostname,n=typeof window<`u`?new URL(window.location.href).hostname:``;return SR(t)&&SR(n)}catch{return!1}}async function wR(e,t,n){let r=new URL(`${e}/api/auth/oauth2/authorize`);r.searchParams.set(`response_type`,`code`),r.searchParams.set(`client_id`,t),r.searchParams.set(`redirect_uri`,n),r.searchParams.set(`scope`,qL),r.searchParams.set(`code_challenge`,await yR(vR(32))),r.searchParams.set(`code_challenge_method`,`S256`),r.searchParams.set(`state`,`client-probe`),r.searchParams.set(`prompt`,`none`);try{let e=await fetch(r.toString(),{method:`GET`,redirect:`manual`,credentials:`include`}),t=e.headers.get(`location`)??``;return t.includes(`/auth/error`)&&t.includes(`invalid_client`)?!1:e.status>=300&&e.status<400||e.type===`opaqueredirect`?!!t&&!t.includes(`/auth/error`):!0}catch{return!1}}async function TR(e,t){let n=xR(),r=uR(e,`client`),i=mR(r),a=CR(e);if(!a&&i?.client_id&&i.redirect_uri===n){if(await wR(e,i.client_id,n))return i;iR()?.removeItem(r)}else a&&i?.client_id&&iR()?.removeItem(r);if(!t.registration_endpoint)throw Error(`Manufact OAuth registration is unavailable`);let o=await fetch(t.registration_endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({client_name:`mcp-use Inspector`,redirect_uris:[n],grant_types:[`authorization_code`,`refresh_token`],response_types:[`code`],token_endpoint_auth_method:`none`,scope:qL})});if(!o.ok)throw Error(`Could not register Inspector with Manufact`);let s=await o.json();if(!s.client_id)throw Error(`Manufact returned no OAuth client ID`);let c={...s,redirect_uri:n};return hR(r,c),c}async function ER(e,t){let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams(t)}),r=await n.json().catch(()=>({}));if(!n.ok||!r.access_token)throw Error(r.error_description??`Manufact token exchange failed`);return{access_token:r.access_token,refresh_token:r.refresh_token,token_type:r.token_type,expires_at:Date.now()+(r.expires_in??3600)*1e3}}async function DR(e,t){if(!t.refresh_token)return null;let n=eR.get(e);if(n)return n;let r=(async()=>{try{let n=await bR(e),r=mR(uR(e,`client`));if(!r?.client_id)return null;let i=await ER(n.token_endpoint,{grant_type:`refresh_token`,refresh_token:t.refresh_token,client_id:r.client_id}),a={...i,refresh_token:i.refresh_token??t.refresh_token};return hR(uR(e,`tokens`),a),a}catch{return iR()?.removeItem(uR(e,`tokens`)),null}finally{eR.delete(e)}})();return eR.set(e,r),r}async function OR(e){let t=mR(uR(e,`tokens`));return t?.access_token?t.expires_at>Date.now()+3e4?t:DR(e,t):null}async function kR(e,t){let n=await bR(e);if(!n.userinfo_endpoint)return null;let r=await fetch(n.userinfo_endpoint,{headers:{Authorization:`Bearer ${t}`}});if(!r.ok)return null;let i=await r.json();return i.sub?{id:i.sub,name:i.name,email:i.email,image:i.picture}:null}async function AR(e){try{let t=await fetch(`${e}/api/auth/get-session`,{credentials:`include`});return t.ok?(await t.json())?.user??null:null}catch{return null}}async function jR(e){let t=$L.get(e);if(t)return t;ZL.set(e,{...ZL.get(e)??XL,loaded:!1});let n=(async()=>{try{let t=oR(typeof window<`u`?window.location.href:e,e),n=dR(e),r=await OR(e),i=r?await kR(e,r.access_token):null;if(i&&r){fR(e,!1),gR(e,{loaded:!0,accessToken:r.access_token,user:i,mode:`oauth`});return}r&&!i&&iR()?.removeItem(uR(e,`tokens`));let a=t&&!n?await AR(e):null;if(a){gR(e,{loaded:!0,accessToken:null,user:a,mode:`session`});return}gR(e,{loaded:!0,accessToken:null,user:null,mode:null})}catch{gR(e,{loaded:!0,accessToken:null,user:null,mode:null})}})().finally(()=>$L.delete(e));return $L.set(e,n),n}async function MR(e,t){let n=aR(e);tR=e,fR(n,!1);let r=window.open(``,`manufact-oauth`,`width=600,height=700,resizable=yes,scrollbars=yes`);if(!r)throw Error(`Allow popups to sign in with Manufact`);if(gR(n,{authorizing:!0}),oR(window.location.href,n)){r.location.href=cR(n);let e=window.setInterval(async()=>{if(r.closed){window.clearInterval(e),gR(n,{authorizing:!1});return}let t=await AR(n);t&&(window.clearInterval(e),r.close(),gR(n,{loaded:!0,authorizing:!1,accessToken:null,user:t,mode:`session`}))},1e3);return}try{let e=await bR(n),t=await TR(n,e),i=vR(64),a=vR(),o=xR();hR(pR(a),{authOrigin:n,clientId:t.client_id,redirectUri:o,codeVerifier:i,expiresAt:Date.now()+600*1e3});let s=new URL(e.authorization_endpoint);s.searchParams.set(`response_type`,`code`),s.searchParams.set(`client_id`,t.client_id),s.searchParams.set(`redirect_uri`,o),s.searchParams.set(`scope`,qL),s.searchParams.set(`state`,a),s.searchParams.set(`code_challenge`,await yR(i)),s.searchParams.set(`code_challenge_method`,`S256`),s.searchParams.set(`prompt`,`consent`),r.location.href=s.toString();let c=window.setInterval(()=>{r.closed&&(window.clearInterval(c),jR(n).finally(()=>gR(n,{authorizing:!1})))},500)}catch(e){throw r.close(),gR(n,{authorizing:!1}),e}}async function NR(e=new URL(window.location.href)){let t=e.searchParams.get(`state`),n=e.searchParams.get(`code`),r=e.searchParams.get(`error_description`)??e.searchParams.get(`error`);if(r)throw Error(r);if(!t||!n)throw Error(`Missing OAuth code or state`);let i=pR(t),a=mR(i);if(iR()?.removeItem(i),!a||a.expiresAt<Date.now())throw Error(`OAuth state is invalid or expired`);let o=await ER((await bR(a.authOrigin)).token_endpoint,{grant_type:`authorization_code`,code:n,redirect_uri:a.redirectUri,client_id:a.clientId,code_verifier:a.codeVerifier});hR(uR(a.authOrigin,`tokens`),o),fR(a.authOrigin,!1);let s=await kR(a.authOrigin,o.access_token);gR(a.authOrigin,{loaded:!0,authorizing:!1,accessToken:o.access_token,user:s,mode:`oauth`}),window.opener?.postMessage({type:`manufact:oauth-complete`,authOrigin:a.authOrigin},window.location.origin)}function PR(e){let t=aR(e);iR()?.removeItem(uR(t,`tokens`)),gR(t,{loaded:!0,authorizing:!1,accessToken:null,user:null,mode:null})}async function FR(e){let t=mR(uR(e,`tokens`)),n=mR(uR(e,`client`)),r=t?.refresh_token??t?.access_token;if(!n?.client_id||!r)return null;try{let i=(await bR(e)).revocation_endpoint??`${e}/api/auth/oauth2/revoke`;return(await fetch(i,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({client_id:n.client_id,token:r,token_type_hint:t?.refresh_token?`refresh_token`:`access_token`})})).status}catch{return-1}}async function IR(e){let t=sR(e),n=window.open(lR(e),`manufact-sign-out`,`width=420,height=320`);return n?new Promise(r=>{let i=!1,a=e=>{i||(i=!0,window.clearTimeout(o),window.clearInterval(c),window.removeEventListener(`message`,s),r(e))},o=window.setTimeout(()=>{a({attempted:!0,signOutOk:!1,signOutStatus:null})},3e4),s=e=>{e.origin===t&&e.data?.type===`manufact:sign-out-complete`&&a({attempted:!0,signOutOk:!0,signOutStatus:200})},c=window.setInterval(()=>{n.closed&&AR(e).then(e=>{a({attempted:!0,signOutOk:!e,signOutStatus:e?401:200})})},500);window.addEventListener(`message`,s)}):{attempted:!0,signOutOk:!1,signOutStatus:null}}async function LR(e,t){let n=aR(e),r=!!mR(uR(n,`tokens`))?.access_token;t===`oauth`||r?(await FR(n),fR(n,!0)):t===`session`&&(await IR(n),fR(n,!1)),PR(e)}function RR(e){let t=e?aR(e):null,n=(0,z.useSyncExternalStore)((0,z.useCallback)(e=>(QL.add(e),()=>QL.delete(e)),[]),(0,z.useCallback)(()=>t?rR(t):XL,[t]),()=>XL);return(0,z.useEffect)(()=>{if(!t)return;jR(t);let e=e=>{e.origin===window.location.origin&&e.data?.type===`manufact:oauth-complete`&&e.data.authOrigin===t&&jR(t).finally(()=>gR(t,{authorizing:!1}))},n=e=>{e.key!==uR(t,`tokens`)||!e.newValue||jR(t).finally(()=>gR(t,{authorizing:!1}))};return window.addEventListener(`message`,e),window.addEventListener(`storage`,n),()=>{window.removeEventListener(`message`,e),window.removeEventListener(`storage`,n)}},[t]),{...n,authorize:(0,z.useCallback)(async()=>{e&&await MR(e)},[e]),logout:(0,z.useCallback)(async()=>{e&&await LR(e,n.mode)},[e,n.mode])}}var zR=(0,z.lazy)(()=>lS(()=>import(`./ChatTab-DxD-KLW_.js`).then(e=>({default:e.ChatTab})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),BR=(0,z.lazy)(()=>lS(()=>import(`./ToolsTab-BSSwvp4Q.js`).then(e=>({default:e.ToolsTab})),__vite__mapDeps([20,1,2,3,5,6,4,7,8,21,22,23,13,19,18,24,25,26,10,27,28,29,16,17]))),VR=(0,z.lazy)(()=>lS(()=>import(`./PromptsTab-CLwWFf6d.js`).then(e=>({default:e.PromptsTab})),__vite__mapDeps([30,1,2,3,5,6,4,7,8,24,26,10,27,28,29,11,12,19]))),HR=(0,z.lazy)(()=>lS(()=>import(`./ResourcesTab-B8cnuq-m.js`).then(e=>({default:e.ResourcesTab})),__vite__mapDeps([31,1,2,3,5,7,21,6,4,8,22,23,13,19,18,32,24,25,26,10,27,28,14,17]))),UR=(0,z.lazy)(()=>lS(()=>import(`./SamplingTab-BjYHYRHX.js`).then(e=>({default:e.SamplingTab})),__vite__mapDeps([33,1,2,3,5,6,4,7,8,26,10,27,22,23,13,14,19]))),WR=(0,z.lazy)(()=>lS(()=>import(`./ElicitationTab-o5_z6gqe.js`).then(e=>({default:e.ElicitationTab})),__vite__mapDeps([34,1,2,3,5,8,26,10,27,22,15,12,19]))),GR=(0,z.lazy)(()=>lS(()=>import(`./NotificationsTab-CkJ5E_sR.js`).then(e=>({default:e.NotificationsTab})),__vite__mapDeps([35,1,2,3,32,25,26,5,10,27,28]))),KR=(0,z.lazy)(()=>lS(()=>import(`./ServerMetadataTab-CPlclbb7.js`).then(e=>({default:e.ServerMetadataTab})),__vite__mapDeps([36,1,5,2,3,9,7,8,27,10,37]))),qR=(0,z.lazy)(()=>lS(()=>import(`./ConnectionSettingsTab-pO6p0U0f.js`).then(e=>({default:e.ConnectionSettingsTab})),__vite__mapDeps([38,1,2,3,5,27,10,37])));function JR({children:e}){return(0,R.jsx)(z.Suspense,{fallback:(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,R.jsx)(bL,{className:`size-6`})}),children:e})}var YR=`anthropic/claude-sonnet-4.6`;function XR({isLoopback:e,chatApiUrl:t}){return e&&!!t}function ZR(e,t,n=!1,r){let i=e.replace(/\/chat\/stream\/?$/,`/llm`);return{provider:`openai-compatible`,model:r??`anthropic/claude-sonnet-4.6`,apiKey:t??`server-managed`,baseUrl:i,...n?{credentials:`include`}:{}}}function QR(e){return e?{Authorization:`Bearer ${e}`}:void 0}var $R=`mcp-inspector:managed-model`;function ez(e){return`${$R}:${e}`}function tz(e){try{return localStorage.getItem(ez(e))}catch{return null}}function nz(e,t,n,r){let i=e?new URL(e).origin:null,[a,o]=(0,z.useState)([]),[s,c]=(0,z.useState)(YR),[l,u]=(0,z.useState)(()=>i?tz(i)??`anthropic/claude-sonnet-4.6`:YR),[d,f]=(0,z.useState)(!1),p=(0,z.useCallback)(e=>{if(u(e),i)try{localStorage.setItem(ez(i),e)}catch{}},[i]);return(0,z.useEffect)(()=>{if(!r||!i)return;let e=!1;return f(!0),(async()=>{try{let r=QR(t),a=await fetch(`${i}/api/v1/models`,{headers:r,credentials:n===`session`?`include`:`same-origin`});if(!a.ok)return;let s=await a.json();if(e)return;let l=s.models??[];o(l);let d=s.defaultModelId??`anthropic/claude-sonnet-4.6`;c(d);let f=new Set(l.map(e=>e.id)),p=tz(i);p&&f.has(p)?u(p):f.has(d)?u(d):l[0]&&u(l[0].id)}finally{e||f(!1)}})(),()=>{e=!0}},[r,i,t,n]),{models:a,selectedModelId:l,setSelectedModelId:p,isLoading:d,selectedModel:a.find(e=>e.id===l)??null,defaultModelId:s}}var rz=[`tools`,`prompts`,`resources`,`chat`,`sampling`,`elicitation`,`notifications`,`server-metadata`,`connection-settings`];function iz(e){return rz.includes(e)?e:`tools`}function az({selectedServer:e,activeTab:t,toolsSearchRef:n,promptsSearchRef:r,resourcesSearchRef:i,onUpdateConnection:a,children:o}){let{embeddedConfig:s}=EL(),c=iz(t),[l,u]=(0,z.useState)(()=>new Set([c]));(0,z.useEffect)(()=>{let e=iz(t);u(t=>t.has(e)?t:new Set(t).add(e))},[t]);let{accessToken:d,mode:f,user:p}=RR(s.chatApiUrl),m=QR(d),h=f===`session`?`include`:void 0,g=p!=null,_=s.chatApiUrl,v=!!e?.url&&_M(e.url),y=e?XR({isLoopback:v,chatApiUrl:s.chatApiUrl,enableFreeTierUpgrade:s.chatEnableFreeTierUpgrade}):!1,b=nz(_,d,f,!!e&&!!_&&g),x=y?ZR(_,d,f===`session`,g?b.selectedModelId:void 0):s.managedLlmConfig??(_&&!v?{provider:`anthropic`,model:`claude-haiku-4-5`,apiKey:`server-managed`}:void 0);if(!e&&s.forceConnected)return s.chatApiUrl?(0,R.jsx)(JR,{children:(0,R.jsx)(zR,{connection:{id:`force-connected`,url:``,displayName:``,name:``,state:`ready`,tools:[],prompts:[],resources:[]},isConnected:!0,prompts:[],serverId:`force-connected`,callPrompt:async()=>({messages:[]}),readResource:async()=>({contents:[]}),useClientSide:!1,chatApiUrl:s.chatApiUrl,extraHeaders:m,credentials:h,managedLlmConfig:s.managedLlmConfig??{provider:`anthropic`,model:`claude-haiku-4-5`,apiKey:`server-managed`},enableFreeTierUpgrade:s.chatEnableFreeTierUpgrade,hideTitle:s.chatHideTitle,hideModelBadge:s.chatHideModelBadge??!0,hideServerUrl:s.chatHideServerUrl??!0,clearButtonLabel:s.chatClearButtonLabel,clearButtonHideIcon:s.chatClearButtonHideIcon,clearButtonHideShortcut:s.chatClearButtonHideShortcut,clearButtonVariant:s.chatClearButtonVariant,chatQuickQuestions:s.chatQuickQuestions,chatFollowups:s.chatFollowups,hideClearButton:s.chatHideClearButton,hideToolSelector:s.chatHideToolSelector,enableKeyboardShortcuts:!1},`chat-force-connected`)}):(0,R.jsx)(R.Fragment,{children:o});if(!e)return(0,R.jsx)(R.Fragment,{children:o});let S=e=>s.visibleTabs?s.visibleTabs.includes(e):!0,C=rz;return(0,R.jsxs)(JR,{children:[S(`tools`)&&l.has(`tools`)&&(0,R.jsx)(`div`,{style:{display:t===`tools`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(BR,{ref:n,tools:e.tools,callTool:e.callTool,readResource:e.readResource,serverId:e.id,isConnected:e.state===`ready`,refreshTools:e.refreshTools},`tools-${e.id}`)}),S(`prompts`)&&l.has(`prompts`)&&(0,R.jsx)(`div`,{style:{display:t===`prompts`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(VR,{ref:r,prompts:e.prompts,callPrompt:(t,n)=>e.getPrompt(t,n?Object.fromEntries(Object.entries(n).map(([e,t])=>[e,typeof t==`string`?t:String(t??``)])):void 0),serverId:e.id,isConnected:e.state===`ready`,refreshPrompts:e.refreshPrompts},`prompts-${e.id}`)}),S(`resources`)&&l.has(`resources`)&&(0,R.jsx)(`div`,{style:{display:t===`resources`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(HR,{ref:i,resources:e.resources,readResource:e.readResource,serverId:e.id,isConnected:e.state===`ready`,mcpServerUrl:e.url||``,refreshResources:e.refreshResources},`resources-${e.id}`)}),S(`chat`)&&l.has(`chat`)&&(0,R.jsx)(`div`,{style:{display:t===`chat`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(zR,{connection:e,isConnected:s.forceConnected||e.state===`ready`,prompts:e.prompts,serverId:e.id,callPrompt:(t,n)=>e.getPrompt(t,n?Object.fromEntries(Object.entries(n).map(([e,t])=>[e,typeof t==`string`?t:String(t??``)])):void 0),readResource:e.readResource,useClientSide:y||!_,chatApiUrl:_,extraHeaders:m,credentials:s.chatCredentials??h,managedLlmConfig:x,managedCloudModel:b,enableFreeTierUpgrade:s.chatEnableFreeTierUpgrade,hideTitle:s.chatHideTitle,hideModelBadge:s.chatHideModelBadge??!1,hideServerUrl:s.chatHideServerUrl??!!_,clearButtonLabel:s.chatClearButtonLabel,clearButtonHideIcon:s.chatClearButtonHideIcon,clearButtonHideShortcut:s.chatClearButtonHideShortcut,clearButtonVariant:s.chatClearButtonVariant,chatQuickQuestions:s.chatQuickQuestions,chatFollowups:s.chatFollowups,hideClearButton:s.chatHideClearButton,hideToolSelector:s.chatHideToolSelector,streamProtocol:s.chatStreamProtocol},`chat-${e.id}`)}),S(`sampling`)&&l.has(`sampling`)&&(0,R.jsx)(`div`,{style:{display:t===`sampling`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(UR,{pendingRequests:e.pendingSamplingRequests,onApprove:e.approveSampling,onReject:e.rejectSampling,serverId:e.id,isConnected:e.state===`ready`,mcpServerUrl:e.url??``},`sampling-${e.id}`)}),S(`elicitation`)&&l.has(`elicitation`)&&(0,R.jsx)(`div`,{style:{display:t===`elicitation`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(WR,{pendingRequests:e.pendingElicitationRequests,onApprove:e.approveElicitation,onReject:e.rejectElicitation,serverId:e.id,isConnected:e.state===`ready`},`elicitation-${e.id}`)}),S(`notifications`)&&l.has(`notifications`)&&(0,R.jsx)(`div`,{style:{display:t===`notifications`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(GR,{notifications:e.notifications,unreadCount:e.unreadNotificationCount,markNotificationRead:e.markNotificationRead,markAllNotificationsRead:e.markAllNotificationsRead,clearNotifications:e.clearNotifications,serverId:e.id,isConnected:e.state===`ready`},`notifications-${e.id}`)}),S(`server-metadata`)&&l.has(`server-metadata`)&&(0,R.jsx)(`div`,{style:{display:t===`server-metadata`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(KR,{connection:e},`server-metadata-${e.id}`)}),S(`connection-settings`)&&l.has(`connection-settings`)&&a&&(0,R.jsx)(`div`,{style:{display:t===`connection-settings`?`block`:`none`},className:`h-full`,children:(0,R.jsx)(qR,{connection:e,onSave:a},`connection-settings-${e.id}`)}),!C.includes(t)&&(0,R.jsx)(R.Fragment,{children:o})]})}var oz=z.createContext(void 0);function sz(){let e=z.use(oz);if(!e)throw Error(`useTabs must be used within a TabsProvider`);return e}var cz=z.createContext(void 0);function lz(){return z.use(cz)}function uz({ref:e,children:t,defaultValue:n,value:r,onValueChange:i,className:a,collapsed:o,onCollapsedChange:s,...c}){let[l,u]=z.useState(n||``),d=r!==void 0,f=o!==void 0,[p,m]=z.useState(!1),h=z.useCallback(e=>{d||u(e),i?.(e)},[d,i]);return(0,R.jsx)(oz,{value:{activeValue:d?r:l,handleValueChange:h,collapsed:f?o:p,handleCollapsedChange:z.useCallback(e=>{f||m(e),s?.(e)},[f,s])},children:(0,R.jsx)(`div`,{ref:e,className:L(`flex flex-col gap-2`,a),...c,children:t})})}uz.displayName=`Tabs`;function dz({ref:e,children:t,className:n,variant:r=`default`,collapsible:i=!1,...a}){let{activeValue:o,collapsed:s,handleCollapsedChange:c}=sz(),[l,u]=z.useState({width:0,left:0}),d=z.useRef(null),f=z.useRef(null),p=z.useRef(null),m=z.useCallback(()=>{let e=d.current;if(!e)return;let t=e.querySelector(`div:first-child`);if(!t)return;let n=t.querySelector(`button[data-tab-value="${o}"]`);if(n&&o){let e=t.getBoundingClientRect(),r=n.getBoundingClientRect();u({width:r.width,left:r.left-e.left})}else u({width:0,left:0})},[o]),h=z.useCallback(()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(m,16)},[m]);z.useEffect(()=>{let e=setTimeout(m,10);return()=>clearTimeout(e)},[m,s]),z.useEffect(()=>{let e=d.current;if(!e)return;f.current=new ResizeObserver(()=>{h()}),f.current.observe(e);let t=e.querySelector(`div:first-child`);return t&&t.querySelectorAll(`button[data-tab-value]`).forEach(e=>{f.current&&f.current.observe(e)}),()=>{f.current&&f.current.disconnect(),p.current&&clearTimeout(p.current)}},[h]),z.useEffect(()=>{let e=()=>{h()};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[h]);let g=z.useRef(null);return z.useEffect(()=>{g.current&&(g.current.style.width=`${l.width}px`,g.current.style.left=`${l.left}px`)},[l]),(0,R.jsx)(cz,{value:{variant:r,collapsed:s,handleCollapsedChange:c},children:(0,R.jsx)(`div`,{ref:d,className:L(`relative flex items-center bg-none gap-1`,r==="default"&&`p-1 rounded-full border border-zinc-300 dark:border-zinc-600`,r===`underline`&&`border-b border-zinc-200 dark:border-zinc-700`,n),...a,children:(0,R.jsxs)(`div`,{role:`tablist`,className:`flex-1 flex items-center relative`,children:[t,(0,R.jsx)(`span`,{ref:g,className:L(`absolute transition-all duration-[250ms] ease-in-out z-0`,r==="default"&&`bg-white dark:bg-zinc-700 rounded-full h-[calc(100%)] top-0 border border-zinc-300 dark:border-zinc-600`,r===`underline`&&`bottom-0 h-0.5 bg-black dark:bg-white`)})]})})})}dz.displayName=`TabsList`;var fz=({children:e,title:t,collapsed:n})=>!t||!n?e:(0,R.jsx)(Ve,{children:(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`span`,{className:`contents`,children:e}),nativeButton:!1}),(0,R.jsx)(lt,{children:t})]})}),pz=z.forwardRef(({children:e,value:t,className:n,disabled:r,icon:i,title:a,showDot:o=!1,alwaysExpanded:s=!1,iconOnly:c=!1,badge:l,...u},d)=>{let{activeValue:f,handleValueChange:p,collapsed:m}=sz(),h=lz()?.variant||`default`,g=f===t,_=!c&&(!m||g||s),v=c||m&&!_;return(0,R.jsx)(fz,{title:a,collapsed:m&&!_,children:(0,R.jsxs)(`button`,{ref:d,disabled:r,onClick:()=>p(t),"data-tab-value":t,"data-tab-active":g,role:`tab`,"aria-selected":g?`true`:`false`,title:m&&!_&&a?a:void 0,className:L(`relative z-10 inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background transition-all duration-[250ms] ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer`,c?`size-9 shrink-0 flex-none rounded-full p-0`:`flex-1`,h==="default"&&!c&&`py-2.5`,h==="default"&&!c&&`rounded-md px-4`,h===`underline`&&`px-6 py-3 border-b-2 border-transparent`,g&&`text-foreground`,!g&&`text-muted-foreground hover:text-foreground`,n),...u,children:[i&&(0,R.jsxs)(`span`,{className:L(`relative inline-flex shrink-0 items-center justify-center`,c?`size-5`:_&&`mr-2`),children:[(0,R.jsx)(i,{className:L(`h-4 w-4 shrink-0 transition-all duration-[250ms] ease-in-out`,!_&&!c&&`mr-0!`)}),l&&v?l:null]}),o&&(0,R.jsx)(`span`,{className:`absolute top-1.5 right-1.5 w-2 h-2 bg-orange-500 dark:bg-orange-400 border-2 border-white dark:border-zinc-900 rounded-full transition-opacity duration-300 z-10 animate-status-pulse-orange`}),(0,R.jsx)(`span`,{className:L(`min-w-0 transition-all duration-[250ms] ease-in-out overflow-hidden`,_?`w-auto opacity-100`:`w-0 opacity-0`),children:e}),l&&!v?l:null]})})});pz.displayName=`TabsTrigger`;function mz(e){return RR(e)}var hz=z.createContext(void 0);function gz(){let e=z.useContext(hz);if(e===void 0)throw Error(Vt(13));return e}var _z={imageLoadingStatus:()=>null},vz=z.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=z.useState(`idle`),c={imageLoadingStatus:o},l=z.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=Ft(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:_z});return(0,R.jsx)(hz.Provider,{value:l,children:u})});function yz(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i}){let[a,o]=z.useState(`idle`);return Rt(()=>{if(!e&&!i)return o(`error`),It;let a=!0,s=new window.Image,c=e=>()=>{a&&o(e)};return o(`loading`),s.onload=c(`loaded`),s.onerror=c(`error`),t&&(s.referrerPolicy=t),s.crossOrigin=n??null,r&&(s.sizes=r),i&&(s.srcset=i),e&&(s.src=e),s.complete&&o(s.naturalWidth>0?`loaded`:`error`),()=>{a=!1}},[e,i,r,n,t]),a}var bz={..._z,...it},xz=z.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,style:a,...o}=e,{setImageLoadingStatus:s}=gz(),c=yz(o.src,o),l=c===`loaded`,{mounted:u,transitionStatus:d,setMounted:f}=Je(l),p=z.useRef(null),m=Pt(e=>{i?.(e),s(e)});Rt(()=>{c!==`idle`&&m(c)},[c,m]),Rt(()=>()=>s(`idle`),[s]),g({open:l,ref:p,onComplete(){l||f(!1)}});let h=Ft(`img`,e,{state:{imageLoadingStatus:c,transitionStatus:d},ref:[t,p],props:o,stateAttributesMapping:bz,enabled:u});return u?h:null}),Sz=z.forwardRef(function(e,t){let{className:n,render:r,delay:i,style:a,...o}=e,{imageLoadingStatus:s}=gz(),[c,l]=z.useState(i===void 0),u=fe();return z.useEffect(()=>(i===void 0?l(!0):u.start(i,()=>l(!0)),u.clear),[u,i]),Ft(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:_z,enabled:s!==`loaded`&&(i===void 0||c)})});function Cz({className:e,size:t=`default`,...n}){return(0,R.jsx)(vz,{"data-slot":`avatar`,"data-size":t,className:L(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function wz({className:e,...t}){return(0,R.jsx)(xz,{"data-slot":`avatar-image`,className:L(`aspect-square size-full rounded-full object-cover`,e),...t})}function Tz({className:e,...t}){return(0,R.jsx)(Sz,{"data-slot":`avatar-fallback`,className:L(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function Ez(e,t){return e?.[0]?e[0].toUpperCase():t?.[0]?t[0].toUpperCase():`U`}function Dz({chatApiUrl:e,dashboardUrl:t=`https://manufact.com/cloud`,fallback:n=null,onUserResolved:r,compact:i=!1}){let{user:a,loaded:o,authorizing:s,authorize:c,logout:l,mode:u}=mz(e),d=(0,z.useRef)(void 0);if((0,z.useEffect)(()=>{if(!o)return;let e=a?.id??null;d.current!==e&&(d.current=e,r?.(a))},[o,a,r]),!o)return null;if(!a)return(0,R.jsxs)(R.Fragment,{children:[n,(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:L(`shrink-0 rounded-full text-[13px]`,i?`px-2.5 text-xs`:`px-4`),disabled:s,onClick:()=>{c().catch(e=>oI.error(e instanceof Error?e.message:`Authorization failed`))},children:s?`Authorizing…`:`Sign in`})]});let f=Ez(a.name,a.email),p=a.name??a.email??`User`;return(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsx)(Gt,{variant:`ghost`,className:`relative h-8 w-8 shrink-0 rounded-full p-0 mr-2`,"aria-label":`User menu`,children:(0,R.jsxs)(Cz,{className:`h-8 w-8 border border-zinc-300 dark:border-zinc-600`,children:[(0,R.jsx)(wz,{src:a.image??``,alt:p}),(0,R.jsx)(Tz,{className:`text-sm`,children:f})]})}),nativeButton:!0}),(0,R.jsxs)(Za,{className:`w-56`,align:`end`,forceMount:!0,children:[(0,R.jsx)(Qa,{className:`font-normal`,children:(0,R.jsxs)(`div`,{className:`flex flex-col space-y-1`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium leading-none truncate`,children:p}),a.email&&a.email!==p&&(0,R.jsx)(`p`,{className:`text-xs leading-none text-muted-foreground truncate`,children:a.email})]})}),(0,R.jsx)(no,{}),(0,R.jsx)($a,{render:(0,R.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,R.jsx)(li,{className:`mr-2 h-4 w-4`}),`Go to dashboard`]})}),(0,R.jsx)(no,{}),(0,R.jsxs)($a,{onClick:()=>{l().catch(()=>oI.error(`Sign out failed`))},children:[(0,R.jsx)(hi,{className:`mr-2 h-4 w-4`}),u===`session`?`Sign out of Manufact`:`Disconnect Inspector`]})]})]})}function Oz({count:e,isActive:t,size:n=`md`,overlay:r=!1}){return e<=0?null:(0,R.jsx)(`span`,{className:L(t?`dark:bg-black`:`dark:bg-zinc-700`,`shrink-0 bg-zinc-200 text-zinc-700 dark:text-zinc-300 rounded-full font-medium`,r&&`absolute -bottom-1 -right-1.5 z-10 flex h-3.5 min-w-3.5 items-center justify-center border border-background px-0.5 text-[9px] leading-none`,!r&&`ml-1`,!r&&n===`sm`&&`text-[10px] px-1.5 py-0.5`,!r&&n===`md`&&`text-xs px-2 py-0.5`),children:e})}var kz=`flex h-10 items-center gap-2`;function Az({serverConfig:e,additionalItems:t=[],showClients:n={cursor:!0,vsCode:!0,vsCodeInsiders:!0,claudeDesktop:!0,claudeCode:!0,geminiCli:!0,codexCli:!0},className:r=``,onSuccess:i,onError:a,trigger:o}){let[s,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(null),[d,f]=(0,z.useState)(!1),{url:p,name:m,headers:h}=e,g=e=>{try{PT(new Fo({client:e})).catch(()=>{})}catch{}},_=()=>{g(`cursor`);try{let e=NL(p,m,h);window.location.href=e,i?.(`Cursor`)}catch(e){console.error(`Failed to generate Cursor deep link:`,e),a?.(e)}},v=()=>{g(`vscode`);try{let e=PL(p,m,h);window.location.href=e,i?.(`VS Code`)}catch(e){console.error(`Failed to generate VS Code deep link:`,e),a?.(e)}},y=()=>{g(`vscode-insiders`);try{let e=FL(p,m,h);window.location.href=e,i?.(`VS Code Insiders`)}catch(e){console.error(`Failed to generate VS Code Insiders deep link:`,e),a?.(e)}},b=()=>{g(`claude-desktop`);try{LL(p,m,h),i?.(`Claude Desktop`)}catch(e){console.error(`Failed to download .mcpb file:`,e),a?.(e)}},x=()=>{g(`claude-code`),u(`claude-code`),c(!0)},S=()=>{g(`gemini-cli`),u(`gemini-cli`),c(!0)},C=()=>{g(`codex-cli`),u(`codex-cli`),c(!0)},w=async e=>{try{await lM(e),f(!0),setTimeout(()=>f(!1),2e3)}catch(e){console.error(`Failed to copy:`,e),a?.(e)}},T=()=>{if(l===`claude-code`){let{command:e,envVars:t}=RL(p,m,h),n=VL(t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(dL,{children:[(0,R.jsx)(hL,{children:`Add to Claude Code`}),(0,R.jsx)(gL,{children:`Execute the following command in your shell to add this server to Claude Code.`})]}),(0,R.jsxs)(fL,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Instructions`}),(0,R.jsxs)(`ol`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`1.`}),(0,R.jsx)(`span`,{children:`Ensure the Claude Code executable is available in your path`})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`2.`}),(0,R.jsx)(`span`,{children:`Execute the following snippet in your shell:`})]})]})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`h-7 px-2 bg-background hover:bg-accent border border-border`,onClick:()=>w(e),children:d?(0,R.jsx)(Fr,{className:`size-3.5 text-green-600`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 pr-14 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:e})})]}),n&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Environment Variables`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mb-2`,children:`After installation, set these environment variables in your shell:`}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:n})})]}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`The MCP configuration supports environment variable expansion using `,(0,R.jsx)(`code`,{className:`text-foreground`,children:"${VAR}"}),` `,`syntax.`]})]})]})}if(l===`gemini-cli`){let{command:e,envVars:t}=zL(p,m,h),n=VL(t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(dL,{children:[(0,R.jsx)(hL,{children:`Add to Gemini CLI`}),(0,R.jsx)(gL,{children:`Execute the following command in your shell to add this server to Gemini CLI.`})]}),(0,R.jsxs)(fL,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Instructions`}),(0,R.jsxs)(`ol`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`1.`}),(0,R.jsx)(`span`,{children:`Ensure the Gemini CLI executable is available in your path`})]}),n&&(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`2.`}),(0,R.jsx)(`span`,{children:`Set these environment variables in your shell before running the command:`})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:n?`3.`:`2.`}),(0,R.jsx)(`span`,{children:`Execute the following snippet in your shell:`})]})]})]}),n&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Environment Variables`}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:n})})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`h-7 px-2 bg-background hover:bg-accent border border-border`,onClick:()=>w(e),children:d?(0,R.jsx)(Fr,{className:`size-3.5 text-green-600`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 pr-14 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:e})})]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Restart Gemini CLI to load the new configuration.`})]})]})}if(l===`codex-cli`){let{config:e,envVars:t}=BL(p,m,h);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(dL,{children:[(0,R.jsx)(hL,{children:`Add to Codex CLI`}),(0,R.jsxs)(gL,{children:[`Add this configuration to your`,` `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`~/.codex/config.toml`}),` `,`file.`]})]}),(0,R.jsxs)(fL,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Instructions`}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Add this configuration to your`,` `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`~/.codex/config.toml`}),`:`]})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`h-7 px-2 bg-background hover:bg-accent border border-border`,onClick:()=>w(e),children:d?(0,R.jsx)(Fr,{className:`size-3.5 text-green-600`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}),(0,R.jsx)(`pre`,{className:`bg-muted p-3 pr-14 rounded-md text-xs overflow-x-auto`,children:(0,R.jsx)(`code`,{children:e})})]}),t.length>0&&(0,R.jsx)(`div`,{children:(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`(optional) If you would rather use variables from your system's environment, replace the`,` `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`http_headers`}),` key with the `,(0,R.jsx)(`code`,{className:`text-foreground`,children:`env_http_headers`}),` `,`key as shown in the commented section above.`]})}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Restart Codex CLI to load the new configuration.`})]})]})}return null},E=(0,R.jsxs)(Gt,{variant:`ghost`,className:`bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 rounded-full transition-colors px-3 flex items-center justify-center ${r}`,children:[(0,R.jsxs)(`span`,{className:`xl:hidden hidden sm:flex items-center gap-1`,children:[(0,R.jsx)(Ai,{className:`size-3`}),`Client`]}),(0,R.jsxs)(`span`,{className:`hidden xl:flex items-center gap-1`,children:[`Add to Client`,(0,R.jsx)(Ir,{className:`size-3`})]})]}),ee=o?typeof o==`function`?o({isOpen:!1,onClick:()=>{}}):o:E;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,z.isValidElement)(ee)?ee:E,nativeButton:!0}),(0,R.jsxs)(Za,{align:`end`,className:`w-auto min-w-[300px]`,children:[t.map(e=>(0,R.jsxs)($a,{onClick:async()=>{await e.onClick()},className:kz,children:[e.icon,(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:e.label})]},e.id)),t.length>0&&(0,R.jsx)(no,{}),n.cursor&&(0,R.jsxs)($a,{onClick:_,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/cursor`,alt:`Cursor`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Cursor`})]}),n.claudeCode&&(0,R.jsxs)($a,{onClick:x,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Claude Code`})]}),n.claudeDesktop&&(0,R.jsxs)($a,{onClick:b,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/claude`,alt:`Claude`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Claude Desktop`})]}),n.vsCode&&(0,R.jsxs)($a,{onClick:v,className:kz,children:[(0,R.jsx)(UL,{className:`h-4 w-4 text-blue-500`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`VS Code`})]}),n.vsCodeInsiders&&(0,R.jsxs)($a,{onClick:y,className:kz,children:[(0,R.jsx)(UL,{className:`h-4 w-4 text-teal-400`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`VS Code Insiders`})]}),n.geminiCli&&(0,R.jsxs)($a,{onClick:S,className:kz,children:[(0,R.jsx)(`img`,{src:`https://cdn.simpleicons.org/googlegemini`,alt:`Gemini`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Gemini CLI`})]}),n.codexCli&&(0,R.jsxs)($a,{onClick:C,className:kz,children:[(0,R.jsx)(`img`,{src:`https://inspector-cdn.mcp-use.com/providers/openai.png`,alt:`Codex`,className:`h-4 w-4`}),(0,R.jsx)(`span`,{className:`min-w-0 max-w-full whitespace-nowrap`,children:`Codex CLI`})]})]})]}),(0,R.jsx)(cL,{open:s,onOpenChange:c,children:(0,R.jsx)(uL,{scrollable:!0,className:`max-w-3xl max-h-[80vh]`,children:T()})})]})}function jz({className:e,state:t=`collapsed`,to:n=`/`,showLabel:r=t===`expanded`,labelParts:i=`full`,pinSymbolInIconColumn:a=!1,size:o}){let[s,c]=(0,z.useState)(!1),l=1.5,u=.2/l,d=.8999999999999999/l,f=r&&(t===`expanded`||i===`inspector`),p=o??(a?20:t===`expanded`?40:20),m=(0,R.jsx)(`div`,{className:`relative`,children:(0,R.jsxs)(Pe.svg,{viewBox:`0 0 500 500`,initial:`rest`,animate:s?`hover`:`rest`,className:`text-foreground`,style:{width:p,height:p},children:[(0,R.jsxs)(Pe.g,{variants:{rest:{opacity:1},hover:{opacity:[1,0,0,1],transition:{duration:l,times:[0,u,d,1],ease:`easeInOut`}}},fill:`currentColor`,fillRule:`nonzero`,stroke:`currentColor`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(`path`,{d:`M105.933 0C164.437 0.000116002 211.865 47.607 211.865 106.333C211.865 131.829 210.493 158.403 221.068 181.602L228.975 198.947C243.584 230.997 269.265 256.7 301.303 271.336L316.155 278.121C340.142 289.079 367.694 287.335 394.066 287.335C452.571 287.335 499.999 334.942 499.999 393.668C499.999 452.394 452.571 500.001 394.066 500.001C335.562 500.001 288.134 452.394 288.134 393.668C288.134 368.974 289.24 343.275 278.992 320.807L270.586 302.38C255.948 270.29 230.214 244.565 198.118 229.939L180.164 221.758C157.282 211.331 131.078 212.666 105.933 212.666C47.4278 212.666 4.86252e-05 165.059 0 106.333C0 47.607 47.4278 0 105.933 0Z`}),(0,R.jsx)(`circle`,{cx:`100.426`,cy:`399.575`,r:`100.426`}),(0,R.jsx)(`path`,{d:`M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z`})]}),(0,R.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeWidth:4,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,R.jsx)(Mz,{d:`M105.933 0C164.437 0.000116002 211.865 47.607 211.865 106.333C211.865 131.829 210.493 158.403 221.068 181.602L228.975 198.947C243.584 230.997 269.265 256.7 301.303 271.336L316.155 278.121C340.142 289.079 367.694 287.335 394.066 287.335C452.571 287.335 499.999 334.942 499.999 393.668C499.999 452.394 452.571 500.001 394.066 500.001C335.562 500.001 288.134 452.394 288.134 393.668C288.134 368.974 289.24 343.275 278.992 320.807L270.586 302.38C255.948 270.29 230.214 244.565 198.118 229.939L180.164 221.758C157.282 211.331 131.078 212.666 105.933 212.666C47.4278 212.666 4.86252e-05 165.059 0 106.333C0 47.607 47.4278 0 105.933 0Z`,times:{T0:0,T1:u,T2:d,T3:1},total:l}),(0,R.jsx)(Nz,{cx:100.426,cy:399.575,r:100.426,times:{T0:0,T1:u,T2:d,T3:1},total:l}),(0,R.jsx)(Mz,{d:`M500 100.426C500 155.889 455.037 200.851 399.574 200.851C344.11 200.851 299.148 155.889 299.148 100.426C299.148 44.962 344.11 0 399.574 0C455.037 0 500 44.962 500 100.426Z`,times:{T0:0,T1:u,T2:d,T3:1},total:l})]})]})}),h=r?(0,R.jsx)(`span`,{className:L(`font-ubuntu flex items-center gap-2 whitespace-nowrap`,a?L(`pl-(--sidebar-nav-text-pl-absolute)`,f?`relative opacity-100 blur-0`:`pointer-events-none absolute left-0 top-1/2 w-0 -translate-y-1/2 overflow-hidden opacity-0 blur-[3px]`):i===`inspector`?`mr-0`:`mr-3`),children:i===`full`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`text-xl font-bold leading-none text-foreground [text-box:trim-both_cap_alphabetic]`,children:`mcp-use`}),(0,R.jsx)(`span`,{className:`text-lg font-sans font-light leading-none tracking-wide text-muted-foreground [text-box:trim-both_cap_alphabetic]`,children:`Inspector`})]}):(0,R.jsx)(`span`,{className:`text-base font-medium leading-none text-foreground [text-box:trim-both_cap_alphabetic]`,children:`Inspector`})}):null,g=a?(0,R.jsxs)(`div`,{className:L(`relative flex shrink-0 items-center`,f?`min-w-(--sidebar-width-icon)`:`w-(--sidebar-width-icon)`),children:[(0,R.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-0 flex w-(--sidebar-width-icon) items-center justify-center`,children:(0,R.jsx)(`div`,{className:`pointer-events-auto`,children:m})}),h]}):i===`inspector`?(0,R.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[m,h]}):(0,R.jsxs)(R.Fragment,{children:[m,h]});return(0,R.jsx)(DF,{to:n,className:L(`flex items-center transition-opacity`,!a&&i!==`inspector`&&`-my-3`,e),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:g})}function Mz({d:e,times:t,total:n}){let{T0:r,T1:i,T2:a,T3:o}=t;return(0,R.jsx)(Pe.path,{d:e,variants:{rest:{pathLength:0,opacity:0},hover:{pathLength:[0,0,1,1],opacity:[0,0,1,1],transition:{duration:n,times:[r,i,a,o],ease:`easeInOut`}}}})}function Nz({cx:e,cy:t,r:n,times:r,total:i}){let{T0:a,T1:o,T2:s,T3:c}=r;return(0,R.jsx)(Pe.circle,{cx:e,cy:t,r:n,variants:{rest:{pathLength:0,opacity:0},hover:{pathLength:[0,0,1,1],opacity:[0,0,1,1],transition:{duration:i,times:[a,o,s,c],ease:`easeInOut`}}}})}var Pz=(0,z.createContext)(void 0);function Fz(){let e=(0,z.use)(Pz);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e}function Iz({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,forcedTheme:r}){let[i,a]=(0,z.useState)(r||t),[o,s]=(0,z.useState)(!1),c=()=>typeof window>`u`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,l=i===`system`?c():i,u=e=>{let t=document.documentElement,i=e===`system`?c():e;t.classList.remove(`light`,`dark`),t.classList.add(i),r||localStorage.setItem(n,e)};return(0,z.useEffect)(()=>{s(!0);let e=localStorage.getItem(n),i=r||e||t;a(i),u(i)},[t,n,r]),(0,z.useEffect)(()=>{if(i!==`system`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{u(`system`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[i]),(0,z.useEffect)(()=>{o&&u(i)},[i,o]),(0,R.jsx)(Pz,{value:{theme:i,setTheme:e=>{if(r){console.warn(`[ThemeProvider] Theme is forced via URL parameter, ignoring setTheme call`);return}a(e)},resolvedTheme:l},children:e})}function Lz({ref:e,shimmerColor:t,shimmerSize:n=`0.05em`,shimmerDuration:r=`3s`,borderRadius:i=`100px`,background:a,className:o,children:s,...c}){let{theme:l}=Fz();return(0,R.jsxs)(`button`,{style:{"--spread":`90deg`,"--shimmer-color":t||(l===`dark`?`#000000`:`#ffffff`),"--radius":i,"--speed":r,"--cut":n,"--bg":a||(l===`dark`?`rgba(255, 255, 255, 1)`:`rgba(0, 0, 0, 1)`)},className:L(`group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border px-6 py-3 whitespace-nowrap [background:var(--bg)]`,`transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px`,`dark:text-white text-black dark:border-white/10 border-black/10`,o),ref:e,...c,children:[(0,R.jsx)(`div`,{className:L(`-z-30 blur-[2px]`,`@container-[size] absolute inset-0 overflow-visible`),children:(0,R.jsx)(`div`,{className:`animate-shimmer-slide absolute inset-0 aspect-[1] h-[100cqh] rounded-none mask-none`,children:(0,R.jsx)(`div`,{className:`animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]`})})}),s,(0,R.jsx)(`div`,{className:L(`absolute inset-0 size-full`,`rounded-2xl px-4 py-1.5 text-sm font-medium`,`transform-gpu transition-all duration-300 ease-in-out`,`dark:shadow-[inset_0_-8px_10px_#0000001f] dark:group-hover:shadow-[inset_0_-6px_10px_#0000003f] dark:group-active:shadow-[inset_0_-10px_10px_#0000003f] shadow-[inset_0_-8px_10px_#ffffff1f] group-hover:shadow-[inset_0_-6px_10px_#ffffff3f] group-active:shadow-[inset_0_-10px_10px_#ffffff3f]`)}),(0,R.jsx)(`div`,{className:L(`absolute [inset:var(--cut)] -z-20 [border-radius:var(--radius)] bg-black dark:bg-white`)})]})}Lz.displayName=`ShimmerButton`;function Rz(e){switch(e){case`ready`:return`bg-emerald-600 animate-status-pulse`;case`failed`:return`bg-rose-600 animate-status-pulse-red`;default:return`bg-yellow-500 animate-status-pulse-yellow`}}function zz(e){switch(e){case`ready`:return`Connected`;case`failed`:return`Failed`;default:return e}}function Bz({status:e,className:t}){return(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`div`,{className:L(`w-2 h-2 rounded-full shrink-0`,Rz(e),t)}),nativeButton:!1}),(0,R.jsx)(lt,{children:(0,R.jsx)(`p`,{children:zz(e)})})]})}var Vz=`h-6 px-2 text-xs bg-yellow-500/20 border-0 dark:bg-yellow-400/10 text-yellow-800 dark:text-yellow-500 shrink-0`;function Hz(e){try{sessionStorage.setItem(SI,JSON.stringify({url:e.url,name:e.name||`Auto-connected Server`,transportType:e.transportType||`http`,connectionMode:`auto`}))}catch{}}function Uz({server:e,className:t}){let{state:n,authUrl:r,authenticate:i}=e;return n!==`pending_auth`&&n!==`authenticating`?null:n===`authenticating`?(0,R.jsxs)(Gt,{size:`sm`,variant:`outline`,disabled:!0,className:L(Vz,t),children:[(0,R.jsx)(fi,{className:`h-3 w-3 animate-spin mr-1`}),`Authenticating`]}):i?(0,R.jsx)(Gt,{"data-testid":`server-header-authenticate`,size:`sm`,variant:`outline`,className:L(Vz,t),onClick:t=>{t.stopPropagation(),Hz(e),i()},children:`Authenticate`}):r?(0,R.jsx)(Gt,{size:`sm`,variant:`outline`,className:L(Vz,t),render:(0,R.jsx)(`a`,{href:r,"data-testid":`server-header-authenticate`,onClick:t=>{t.stopPropagation(),Hz(e)}}),nativeButton:!1,children:`Authenticate`}):null}function Wz({connections:e,selectedServer:t,onServerSelect:n,mobileMode:r=!1,variant:i=`default`,compactHeader:a=!1}){let o=sP(),s=t=>{e.some(e=>e.id===t)&&n(t)},c=(0,R.jsxs)(Za,{className:`w-[calc(100vw-2rem)] sm:w-[300px]`,align:`start`,children:[(0,R.jsx)(Qa,{className:`cursor-pointer hover:bg-zinc-100 dark:hover:bg-zinc-800`,onClick:()=>o(`/`),children:`MCP Servers`}),(0,R.jsx)(no,{}),e.length===0?(0,R.jsx)(`div`,{className:`px-2 py-4 text-sm text-muted-foreground dark:text-zinc-400 text-center`,children:`No servers connected. Go to the dashboard to add one.`}):e.map(e=>(0,R.jsxs)($a,{onClick:()=>s(e.id),className:`flex items-center gap-3`,children:[(0,R.jsx)(xL,{server:e,size:`sm`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 flex-1`,children:[(0,R.jsx)(`div`,{className:`font-medium`,children:bM(e)}),(0,R.jsx)(Bz,{status:e.state})]})]},e.id)),(0,R.jsx)(no,{}),(0,R.jsx)($a,{onClick:()=>o(`/`),children:(0,R.jsx)(`span`,{className:`text-blue-600 dark:text-blue-400`,children:`+ Add new server`})})]});return r?(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsx)(`div`,{className:`relative`,children:(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsxs)(Gt,{variant:`ghost`,className:`h-11 px-2 bg-black dark:bg-white text-white dark:text-black border-black dark:border-white hover:bg-gray-800 dark:hover:bg-zinc-100 hover:border-gray-800 dark:hover:border-zinc-200 flex items-center gap-1.5`,children:[t?(0,R.jsx)(xL,{server:t,size:`md`}):(0,R.jsx)(Fi,{className:`h-5 w-5`}),(0,R.jsx)(Ir,{className:`h-4 w-4`})]}),nativeButton:!0}),c]})})}):i===`header`?(0,R.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsxs)(`button`,{type:`button`,className:`inline-flex max-w-full min-w-0 items-center gap-1.5 border-0 bg-transparent p-0 cursor-pointer text-foreground transition-opacity hover:opacity-80`,children:[t&&(0,R.jsx)(xL,{server:t,size:`sm`,className:`!size-5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate text-sm`,children:t?bM(t):`Select server`}),t&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Bz,{status:t.state}),!a&&(0,R.jsx)(Uz,{server:t})]}),(0,R.jsx)(Ir,{className:`size-3.5 shrink-0 text-muted-foreground`})]}),nativeButton:!0}),c]})}):(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsx)(`div`,{className:`relative`,children:(0,R.jsxs)(Ya,{children:[(0,R.jsx)(Xa,{render:(0,R.jsxs)(Lz,{className:L(`min-w-0 sm:min-w-[200px] p-0 px-1 text-sm h-11 justify-start text-white dark:text-black border-black dark:border-white hover:bg-gray-800 dark:hover:bg-zinc-100 hover:border-gray-800 dark:hover:border-zinc-200`,!t&&`pl-4`),children:[t&&(0,R.jsx)(xL,{server:t,size:`md`,className:`mr-2`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 flex-1`,children:[(0,R.jsx)(`span`,{className:`truncate lg:max-w-[120px] xl:max-w-none`,children:t?bM(t):`Select server to inspect`}),t&&(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:t.error&&t.state!==`ready`?(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`button`,{onClick:e=>{e.stopPropagation()},className:`w-2 h-2 rounded-full bg-rose-500 animate-status-pulse-red hover:bg-rose-600 transition-colors`,title:`Click to copy error message`,"aria-label":`Copy error message to clipboard`}),nativeButton:!0}),(0,R.jsx)(lt,{children:(0,R.jsx)(`p`,{className:`max-w-xs`,children:t.error})})]}):(0,R.jsx)(`div`,{className:`w-2 h-2 rounded-full ${t.state===`ready`?`bg-emerald-600 animate-status-pulse`:t.state===`failed`?`bg-rose-600 animate-status-pulse-red`:`bg-yellow-500 animate-status-pulse-yellow`}`})})]})]}),nativeButton:!0}),c]})})})}function Gz(e){if(!e)return null;try{let t=new URL(e);if(t.protocol===`https:`)return t.origin}catch{}return null}function Kz(e,t){return e===`tools`?t.tools.length:e===`prompts`?t.prompts.length:e===`resources`?t.resources.length:e===`sampling`?t.pendingSamplingRequests?.length||0:e===`elicitation`?t.pendingElicitationRequests?.length||0:e===`notifications`?t.unreadNotificationCount:0}function qz(e,t,n){return n&&t>0&&[`sampling`,`elicitation`,`notifications`].includes(e)}var Jz=[{id:`server-metadata`,label:`Server Metadata`,icon:si},{id:`separator`},{id:`chat`,label:`Chat`,icon:vi,alwaysExpanded:!0},{id:`separator`},{id:`tools`,label:`Tools`,icon:Yi},{id:`prompts`,label:`Prompts`,icon:yi},{id:`resources`,label:`Resources`,icon:$r},{id:`sampling`,label:`Sampling`,icon:ti},{id:`elicitation`,label:`Elicitation`,icon:zi},{id:`notifications`,label:`Notifications`,icon:Mr},{id:`separator`},{id:`connection-settings`,label:`Connection Settings`,icon:Ii}],Yz=z.createContext(void 0);function Xz(e){let t=z.useContext(Yz);if(t===void 0&&!e)throw Error(Vt(47));return t}function Zz(){return{...ft(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Qz={...De,disabled:St(e=>e.disabled),instantType:St(e=>e.instantType),openMethod:St(e=>e.openMethod),openChangeReason:St(e=>e.openChangeReason),modal:St(e=>e.modal),focusManagerModal:St(e=>e.focusManagerModal),stickIfOpen:St(e=>e.stickIfOpen),titleElementId:St(e=>e.titleElementId),descriptionElementId:St(e=>e.descriptionElementId),openOnHover:St(e=>e.openOnHover),closeDelay:St(e=>e.closeDelay),hasViewport:St(e=>e.hasViewport)},$z=class e extends Tt{constructor(e,t,n=!1){let r={...Zz(),...e},i=new at;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=We(i,t,n),super(r,{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),stickIfOpenTimeout:new xt,triggerElements:i},Qz)}setOpen=(e,t)=>{let n=t.reason===o,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=je(t),s=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&s!=null&&(t.trigger=this.context.triggerElements.getById(s)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let c=()=>{let n={open:e,openChangeReason:t.reason};_t(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),br.flushSync(c)):c(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:i}=Le(t,(t,r)=>new e(n,t,r));return z.useEffect(()=>i?.disposeEffect(),[i]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function eB({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=$z.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});Fe(u,n,r,l),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`),m=Ke()!=null;u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),Be(u,d),Me(u);let{forceUnmount:h}=ot(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o,nested:m}),z.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=z.useCallback(()=>{u.setOpen(!1,te(_e))},[u]);z.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:g}),[h,g]);let _=d||f,v=z.useMemo(()=>({store:u}),[u]);return(0,R.jsxs)(Yz.Provider,{value:v,children:[_&&(0,R.jsx)(nB,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})}function tB(e){return Xz(!0)?(0,R.jsx)(eB,{props:e}):(0,R.jsx)(Ye,{children:(0,R.jsx)(eB,{props:e})})}function nB({store:e,modal:t}){let n=m(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return $e(e,{activeTriggerProps:n.reference??Wt,inactiveTriggerProps:n.trigger??Wt,popupProps:z.useMemo(()=>zt(mt,n.floating),[n.floating])}),null}var rB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:o=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:u=!1,delay:d=300,closeDelay:f=0,id:p,...m}=e,h=Xz(!0),g=c?.store??h?.store;if(!g)throw Error(Vt(74));let _=O(p),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),S=g.useState(`triggerPopupId`,_),C=z.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Ce(_,C,g,{payload:l,disabled:o,openOnHover:u,closeDelay:f}),E=g.useState(`openChangeReason`),ee=g.useState(`stickIfOpen`),D=g.useState(`openMethod`),te=g.useState(`focusManagerModal`),ne=a(y,{enabled:!o&&y!=null&&u&&(D!==`touch`||E!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:se(),restMs:d,delay:{close:f},triggerElementRef:C,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),re=Sn(y,{enabled:y!=null,stickIfOpen:ee}),ie=dn(()=>g.select(`open`),e=>{g.set(`openMethod`,e)}),k=g.useState(`triggerProps`,T),{getButtonProps:A,buttonRef:j}=Lt({disabled:o,native:s}),ae={open(e){return e&&E===`trigger-press`?Ue.open(e):Ee.open(e)}},{preFocusGuardRef:oe,handlePreFocusGuardFocus:ce,handleFocusTargetFocus:M}=xr(g,C),N=Ft(`button`,e,{state:{disabled:o,open:b},ref:[j,t,w,C],props:[re.reference,ne,k,ie,{[x]:``,id:_,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":S},m,A],stateAttributesMapping:ae});return T&&!te?(0,R.jsxs)(z.Fragment,{children:[(0,R.jsx)(ut,{ref:oe,onFocus:ce}),(0,R.jsx)(z.Fragment,{children:N},_),(0,R.jsx)(ut,{ref:g.context.triggerFocusTargetRef,onFocus:M})]}):(0,R.jsx)(z.Fragment,{children:N},_)}),iB=z.createContext(void 0);function aB(){let e=z.useContext(iB);if(e===void 0)throw Error(Vt(45));return e}var oB=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Xz();return i.useState(`mounted`)||n?(0,R.jsx)(iB.Provider,{value:n,children:(0,R.jsx)(oe,{ref:t,...r})}):null}),sB=z.createContext(void 0);function cB(){let e=z.useContext(sB);if(!e)throw Error(Vt(46));return e}var lB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:l=`center`,sideOffset:u=0,alignOffset:d=0,collisionBoundary:f=`clipping-ancestors`,collisionPadding:m=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:_=!1,collisionAvoidance:v=N,...y}=e,{store:b}=Xz(),x=aB(),C=c(),w=b.useState(`floatingRootContext`),T=b.useState(`mounted`),E=b.useState(`open`),ee=b.useState(`openChangeReason`),D=b.useState(`activeTriggerElement`),te=b.useState(`modal`),ne=b.useState(`openMethod`),re=b.useState(`positionerElement`),O=b.useState(`instantType`),ie=b.useState(`transitionStatus`),k=b.useState(`hasViewport`),j=z.useRef(null),ae=p(re,!1,!1),oe=S({anchor:a,floatingRootContext:w,positionMethod:o,mounted:T,side:s,sideOffset:u,align:l,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,disableAnchorTracking:_,keepMounted:x,nodeId:C,collisionAvoidance:v,adaptiveOrigin:k?ye:void 0}),se=w.useState(`domReferenceElement`);Rt(()=>{let e=se,t=j.current;if(e&&(j.current=e),t&&e&&e!==t){b.set(`instantType`,void 0);let e=new AbortController;return ae(()=>{b.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[se,ae,b]),an(E&&te===!0&&ee!==`trigger-hover`,ne===`touch`,re,D);let ce=z.useCallback(e=>{b.set(`positionerElement`,e)},[b]),M=st(e,{open:E,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,instant:O},{styles:oe.positionerStyles,transitionStatus:ie,props:y,refs:[t,ce],hidden:!T,inert:!E});return(0,R.jsxs)(sB.Provider,{value:oe,children:[T&&te===!0&&ee!==`trigger-hover`&&(0,R.jsx)(wn,{ref:b.context.internalBackdropRef,inert:sn(!E),cutout:D}),(0,R.jsx)(A,{id:C,children:M})]})}),uB=z.createContext(void 0);function dB(){let[e,t]=z.useState(0),n=Pt(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:z.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function fB(e){let{value:t,children:n}=e;return(0,R.jsx)(uB.Provider,{value:t,children:n})}var pB={...dt,...it},mB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,{store:c}=Xz(),l=cB(),u=Cn(!0)!=null,{context:d,hasClosePart:f}=dB(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),ee=c.useState(`disabled`),D=c.useState(`openOnHover`),te=c.useState(`closeDelay`),ne=s.id??E;g({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Ne(T,{enabled:D&&!ee,closeDelay:te});let re=a===void 0?Xe(c.context.popupRef):a,O=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,O);let ie=z.useCallback(e=>{c.set(`popupElement`,e)},[c]),k=Ft(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:_},ref:[t,c.context.popupRef,ie],props:[v,{id:ne,role:`dialog`,...mt,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&Qt.has(e.key)&&e.stopPropagation()}},xe(_),s],stateAttributesMapping:pB});return(0,R.jsx)(rn,{context:T,openInteractionType:m,modal:O,disabled:!S||C===`trigger-hover`,initialFocus:re,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:Bt(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,R.jsx)(fB,{value:d,children:k})})});function hB({...e}){return(0,R.jsx)(tB,{"data-slot":`popover`,...e})}function gB(e){return(0,R.jsx)(rB,{"data-slot":`popover-trigger`,...e})}function _B({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,R.jsx)(oB,{children:(0,R.jsx)(lB,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,R.jsx)(mB,{"data-slot":`popover-content`,className:L(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var vB={success:`border-emerald-700/20 bg-emerald-700/10 text-emerald-700 dark:border-emerald-400/30 dark:bg-emerald-400/10 dark:text-emerald-400`,failed:`border-red-500/20 bg-red-500/10 text-red-500 dark:border-red-400/30 dark:bg-red-400/10 dark:text-red-400`,warning:`border-amber-700/20 bg-amber-700/10 text-amber-700 dark:border-amber-400/30 dark:bg-amber-400/10 dark:text-amber-400`,loading:`border-purple-500/20 bg-purple-500/10 text-purple-500 dark:border-purple-400/30 dark:bg-purple-400/10 dark:text-purple-400 animate-spin`},yB=`size-4 shrink-0 rounded-full border p-0.5`;function bB({state:e,className:t}){let n=L(yB,vB[e],t);switch(e){case`success`:return(0,R.jsx)(Fr,{className:n,"aria-hidden":!0});case`failed`:return(0,R.jsx)(zr,{className:n,"aria-hidden":!0});case`warning`:return(0,R.jsx)(Ki,{className:n,"aria-hidden":!0});case`loading`:return(0,R.jsx)(fi,{className:n,"aria-hidden":!0});default:return null}}function xB(){return`text-emerald-700 dark:text-emerald-400`}function SB({onStop:e,showCopiedBanner:t=!1}){return(0,R.jsxs)(R.Fragment,{children:[t&&(0,R.jsxs)(`div`,{className:L(`flex items-center gap-2 text-sm -mt-1`,xB()),children:[(0,R.jsx)(bB,{state:`success`}),(0,R.jsx)(`span`,{children:`URL copied to clipboard`})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(`h4`,{className:`font-semibold text-sm`,children:`Tunnel URL`}),(0,R.jsxs)(`a`,{href:`https://manufact.com/docs/tunneling`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[`Docs`,(0,R.jsx)(Ar,{className:`size-3`})]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h5`,{className:`font-semibold text-sm mb-2`,children:`Use in ChatGPT & Claude`}),(0,R.jsxs)(`ol`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`1.`}),(0,R.jsxs)(`span`,{children:[`Enable`,` `,(0,R.jsx)(`a`,{href:`https://chatgpt.com/plugins#settings/Security`,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline underline-offset-2 hover:text-purple-600 dark:hover:text-purple-400`,children:`dev mode`}),` `,`from settings`]})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`2.`}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`a`,{href:`https://chatgpt.com/plugins#settings/Connectors?create-connector=true&redirectAfter=%2Fplugins`,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline underline-offset-2 hover:text-purple-600 dark:hover:text-purple-400`,children:`Add a connector`}),` `,`in App & Connectors`]})]}),(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-foreground`,children:`3.`}),(0,R.jsx)(`span`,{children:`Use the tunnel URL in the input`})]})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void e(),className:`flex items-center gap-1.5 text-xs text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors cursor-pointer`,children:[(0,R.jsx)(Vi,{className:`size-3 fill-current`}),`Stop Tunnel`]})]})}function CB(e){try{let t=new URL(e),n=t.pathname+t.search;return t.host+(n&&n!==`/`?n:``)}catch{return e}}function wB({copied:e,onCopy:t,className:n}){return(0,R.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),t()},"aria-label":e?`URL copied`:`Copy URL`,className:L(`shrink-0 cursor-pointer p-0.5 rounded-sm text-muted-foreground hover:text-foreground transition-opacity opacity-0 group-hover:opacity-100`,n),children:e?(0,R.jsx)(bB,{state:`success`,className:`size-3.5`}):(0,R.jsx)(Wr,{className:`size-3.5`})})}function TB({url:e,className:t,tunnelPopover:n}){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1);if(!e)return null;let s=CB(e),c=n?.mcpUrl??e,l=!!n,u=async()=>{try{await lM(c),i(!0),setTimeout(()=>i(!1),2e3)}catch{oI.error(`Failed to copy URL`)}};(0,z.useEffect)(()=>{if(!n?.autoCopyOnOpen){o(!1);return}o(!0),i(!0);let e=setTimeout(()=>i(!1),2e3);return()=>clearTimeout(e)},[n?.autoCopyOnOpen]);let d=(0,R.jsxs)(R.Fragment,{children:[l?(0,R.jsx)(Lr,{className:`size-3.5 shrink-0`}):(0,R.jsx)(ei,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate max-w-[min(24rem,30vw)]`,children:s})]}),f=L(`flex items-center gap-1 min-w-0 truncate text-left text-sm cursor-pointer`,l?`text-purple-600 dark:text-purple-400`:`text-blue-500`);return(0,R.jsxs)(`div`,{className:L(`group flex items-center gap-1.5 min-w-0`,t),children:[l?(0,R.jsxs)(hB,{open:n.open,onOpenChange:n.onOpenChange,children:[(0,R.jsx)(gB,{render:(0,R.jsx)(`button`,{type:`button`,className:L(f,`hover:opacity-80`),children:d}),nativeButton:!0}),(0,R.jsx)(_B,{className:`w-[calc(100vw-2rem)] sm:w-96`,align:`start`,sideOffset:4,children:(0,R.jsx)(SB,{showCopiedBanner:a,onStop:async()=>{n.onOpenChange(!1),await n.onStop()}})})]}):(0,R.jsx)(`span`,{className:f,children:d}),(0,R.jsx)(wB,{copied:r,onCopy:()=>void u()})]})}function EB({devFromCli:e,isTunnelStarting:t,waitTicks:n,onStart:r}){if(t)return(0,R.jsxs)(`button`,{disabled:!0,className:`flex items-center gap-1 h-6 px-2 bg-violet-50 dark:bg-violet-950/40 border border-violet-200 dark:border-violet-800 rounded-full opacity-75 cursor-wait shrink-0`,children:[(0,R.jsx)(fi,{className:`size-3 text-violet-500 dark:text-violet-400 animate-spin`}),(0,R.jsxs)(`span`,{className:`text-xs font-medium text-violet-600 dark:text-violet-300 hidden lg:inline`,children:[`Start Tunnel `,(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[n,`s`]})]})]});let i=e===!0,a=e===null;return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void r(),disabled:!i||a,title:e===!1?"Run `mcp-use dev` from your project to enable tunneling.":a?`Checking dev server…`:void 0,className:L(`flex items-center gap-1 h-6 px-2 border rounded-full transition-colors shrink-0`,i&&!a?`bg-violet-50 dark:bg-violet-950/40 border-violet-200 dark:border-violet-800 hover:bg-violet-100 dark:hover:bg-violet-900/50 cursor-pointer`:`bg-violet-50/60 dark:bg-violet-950/20 border-violet-200 dark:border-violet-800 cursor-not-allowed opacity-70`),children:[a?(0,R.jsx)(fi,{className:`size-3 text-violet-500 dark:text-violet-400 animate-spin`}):(0,R.jsx)(Lr,{className:`size-3 text-violet-500 dark:text-violet-400`}),(0,R.jsx)(`span`,{className:`text-xs font-medium text-violet-600 dark:text-violet-300 hidden lg:inline`,children:`Start Tunnel`})]})}function DB(){return typeof window>`u`?!1:window.__MCP_DEV_CLI__===!0}async function OB(){try{let e=await fetch(hM(`dev/info`));return e.ok?await e.json():null}catch{return null}}function kB({tunnelUrl:e,setTunnelUrl:t,isTunnelStarting:n,setIsTunnelStarting:r,onTunnelStarted:i}){let[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(0),d=(0,z.useCallback)((e,n)=>{let r=n?.syncTunnel??!1;if(o(!!e.fromCli),e.mcpUrl&&c(e.mcpUrl),!r)return;if(e.tunnelUrl){t(new URL(e.tunnelUrl).origin);return}let i=Gz(e.mcpUrl??null);if(i){t(i);return}t(null)},[t]);return(0,z.useEffect)(()=>{if(!n){u(20);return}u(20);let e=setInterval(()=>u(e=>e>0?e-1:0),1e3);return()=>clearInterval(e)},[n]),(0,z.useEffect)(()=>{let e=!1;if(!DB()){o(!1);return}return(async()=>{let t=await OB();e||(t?d(t,{syncTunnel:!0}):o(!1))})(),()=>{e=!0}},[d]),{devFromCli:a,mcpUrl:s,waitTicks:l,handleStartTunnel:(0,z.useCallback)(async()=>{if(a===!1){oI.error("Start Tunnel requires `mcp-use dev` from your project directory.");return}r(!0);let e=!1;try{let t=await fetch(hM(`dev/start-tunnel`),{method:`POST`});if(!t.ok){let e=await t.json().catch(()=>({}));oI.error(e.error||`Failed to start tunnel`);return}let n=await OB();if(n?.tunnelUrl||n?.mcpUrl){d(n,{syncTunnel:!0});let e=n.mcpUrl??(n.tunnelUrl?`${n.tunnelUrl.replace(/\/+$/,``)}/mcp`:null);e&&cM(e),i?.()}e=!0}catch{oI.error(`Failed to start tunnel`)}finally{r(!1)}try{PT(new jo({action:`start`,success:e})).catch(()=>{})}catch{}},[d,a,i,r]),handleStopTunnel:(0,z.useCallback)(async()=>{r(!0);let n=!1;try{let e=await fetch(hM(`dev/stop-tunnel`),{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));oI.error(t.error||`Failed to stop tunnel`);return}t(null),c(null),oI.success(`Tunnel stopped`),n=!0}catch{oI.error(`Failed to stop tunnel`)}finally{r(!1)}try{PT(new jo({action:`stop`,success:n,tunnelUrl:e})).catch(()=>{})}catch{}},[r,t,e])}}function AB(e){let t=window.matchMedia(`(min-width: 1024px)`);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function jB(){return window.matchMedia(`(min-width: 1024px)`).matches}function MB(){return!0}function NB(){return(0,z.useSyncExternalStore)(AB,jB,MB)}function PB(e){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=NB(),o=(0,z.useCallback)(()=>{n(!0),i(!0)},[]);return(0,z.useEffect)(()=>{e||(n(!1),i(!1))},[e]),(0,z.useEffect)(()=>{if(!e)return;let t=new URLSearchParams(window.location.search);if(!t.has(`openTunnelPopover`))return;n(!0),i(!0),t.delete(`openTunnelPopover`);let r=t.toString();window.history.replaceState({},``,`${window.location.pathname}${r?`?${r}`:``}`)},[e]),{open:t,onOpenChange:(0,z.useCallback)(e=>{n(e),e||i(!1)},[]),isLgUp:a,autoCopyOnOpen:r,openWithAutoCopy:o}}function FB({connections:e,selectedServer:t,activeTab:n,onServerSelect:r,onTabChange:i,embedded:a=!1,sidebarCollapsed:o=!1}){let{tunnelUrl:s,isTunnelStarting:c,setTunnelUrl:l,setIsTunnelStarting:u,embeddedConfig:d}=EL(),[f,p]=(0,z.useState)(!1),[m]=(0,z.useState)(!0),h=PB(s),g=kB({tunnelUrl:s,setTunnelUrl:l,isTunnelStarting:c,setIsTunnelStarting:u,onTunnelStarted:h.openWithAutoCopy});if(d.singleTab)return null;let _=d.visibleTabs?Jz.filter(e=>e.id===`separator`||d.visibleTabs.includes(e.id)):Jz,v=!!t,y=!!t&&(_M(t.url??``)||vM(t.url??``)||!!s),b=t?s?`${s.replace(/\/+$/,``)}${pM()}`:t.url??``:``,x=g.mcpUrl??(s?`${s.replace(/\/+$/,``)}${pM()}`:null),S=(e,n)=>{if(!t||!b)return null;let r=e===`desktop`?h.isLgUp:!h.isLgUp;return(0,R.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,R.jsx)(TB,{url:b,className:n,tunnelPopover:s&&x&&r?{mcpUrl:x,onStop:g.handleStopTunnel,open:h.open,onOpenChange:h.onOpenChange,autoCopyOnOpen:h.autoCopyOnOpen}:void 0}),y&&!s&&(0,R.jsx)(EB,{devFromCli:g.devFromCli,isTunnelStarting:c,waitTicks:g.waitTicks,onStart:g.handleStartTunnel})]})},C=()=>a?null:(0,R.jsxs)(`div`,{className:`flex items-center gap-2 sm:gap-3 flex-shrink-0`,children:[t&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Az,{serverConfig:{url:b,name:bM(t),headers:MM(t),serverId:t.id},onSuccess:e=>oI.success(`Opening in ${e}...`),onError:e=>oI.error(`Failed: ${e.message}`),trigger:(0,R.jsxs)(Gt,{variant:`ghost`,className:`bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 rounded-full transition-colors px-3 flex items-center justify-center`,"aria-label":`Add to Client`,children:[(0,R.jsxs)(`span`,{className:`xl:hidden hidden sm:flex items-center gap-1`,children:[(0,R.jsx)(Ai,{className:`size-3`}),`Client`]}),(0,R.jsxs)(`span`,{className:`hidden xl:flex items-center gap-1`,children:[`Add to Client`,(0,R.jsx)(Ir,{className:`size-3`})]})]})})}),(0,R.jsx)(`a`,{href:f?`https://manufact.com/cloud?ref=mcp-use-inspector`:`https://manufact.com/signup?ref=mcp-use-inspector`,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>{try{PT(new Mo({referrer:`mcp-use-inspector`})).catch(()=>{})}catch{}},className:`inline-flex h-8 items-center justify-center rounded-full border border-blue-500/25 bg-blue-500/10 px-4 text-[13px] text-blue-500 outline-none cursor-pointer transition-colors hover:bg-blue-500/15 dark:border-blue-400/30 dark:bg-blue-400/10 dark:text-blue-400 dark:hover:bg-blue-400/15 focus-visible:ring-1 focus-visible:ring-ring`,children:(0,R.jsx)(`span`,{className:`[text-box:trim-both_cap_alphabetic]`,children:`Deploy`})}),w()]}),w=(e=!1)=>d.chatApiUrl?(0,R.jsx)(Dz,{chatApiUrl:d.chatApiUrl,onUserResolved:e=>p(!!e),compact:e}):null;return(0,R.jsxs)(`header`,{className:`w-full min-w-0 shrink-0 overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`hidden lg:flex h-(--header-height) items-center justify-between gap-3 px-4 md:pl-0 md:pr-6`,children:[(0,R.jsx)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:!a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:L(`hidden lg:block shrink-0`,v&&o&&`-mr-[calc(var(--sidebar-width-icon)/2-0.625rem)]`),children:(0,R.jsx)(jz,{pinSymbolInIconColumn:!0,showLabel:!v||!o,state:v&&o?`collapsed`:`expanded`})}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground/60 shrink-0 [text-box:trim-both_cap_alphabetic]`,children:`/`}),(0,R.jsx)(Wz,{connections:e,selectedServer:t,onServerSelect:r,variant:`header`}),S(`desktop`)]})}),C()]}),(0,R.jsxs)(`div`,{className:`flex lg:hidden min-w-0 w-full flex-col overflow-hidden pt-(--mobile-chrome-gap)`,children:[(0,R.jsx)(`div`,{className:`flex min-h-0 items-center gap-2 pb-(--mobile-chrome-gap)`,children:!a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2.5 overflow-hidden`,children:[(0,R.jsx)(jz,{state:`collapsed`,showLabel:!0,labelParts:`inspector`,className:`shrink-0`}),(0,R.jsx)(`span`,{className:`shrink-0 px-0.5 text-sm text-muted-foreground/60 [text-box:trim-both_cap_alphabetic]`,children:`/`}),(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(Wz,{connections:e,selectedServer:t,onServerSelect:r,variant:`header`,compactHeader:!0})})]}),(0,R.jsx)(`div`,{className:`shrink-0`,children:w(!0)})]})}),t&&(0,R.jsx)(`div`,{className:`w-full min-w-0 pb-(--mobile-chrome-gap) lg:hidden`,children:(0,R.jsx)(uz,{value:n,onValueChange:e=>i(e),collapsed:m,className:`w-full`,children:(0,R.jsx)(dz,{className:`w-full gap-0 border-0 bg-transparent p-0 [&_[role=tablist]]:justify-between`,children:_.filter(e=>e.id!==`separator`).map(e=>{let r=Kz(e.id,t);return(0,R.jsx)(pz,{value:e.id,"data-testid":`tab-${e.id}`,icon:e.icon,iconOnly:!0,title:e.label,badge:r>0?(0,R.jsx)(Oz,{count:r,isActive:n===e.id,overlay:!0}):void 0,className:`size-9 shrink-0 rounded-full p-0`,children:(0,R.jsx)(`span`,{className:`sr-only`,children:e.label})},e.id)})})})})]})]})}function IB({collapsed:e,onToggle:t}){let n=e?`Expand sidebar`:`Collapse sidebar`;return(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsxs)(Gt,{type:`button`,variant:`ghost`,size:`icon-sm`,tabIndex:-1,"aria-label":n,onClick:t,className:L(`border-border absolute top-1/2 right-0 z-30 hidden size-7 min-h-7 min-w-7 -translate-y-1/2 translate-x-1/2 rounded-full border bg-background lg:flex`,`opacity-0 transition-opacity duration-200 group-hover/sidebar:opacity-100 focus-visible:opacity-100`),children:[(0,R.jsx)(wi,{className:`size-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:n})]}),nativeButton:!0}),(0,R.jsx)(lt,{side:`right`,children:n})]})}function LB({className:e}){return(0,R.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentcolor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:e,children:[(0,R.jsx)(`path`,{d:`M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4`}),(0,R.jsx)(`path`,{d:`M9 18c-4.51 2-5-2-7-2`})]})}var RB=z.createContext(void 0);function zB(){let e=z.useContext(RB);if(e===void 0)throw Error(Vt(63));return e}var BB=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),VB={...Tn,checked(e){return e?{[BB.checked]:``}:{[BB.unchecked]:``}}};function HB(e,t,n,r=!0,i){let[a,o]=z.useState(),s=O(i?`${i}-label`:void 0),c=e??t??a;return Rt(()=>{let i=e||t||!r?void 0:UB(n.current,s);a!==i&&o(i)}),c}function UB(e,t){let n=WB(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function WB(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var GB=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=An(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,validationMode:ee,disabled:D,name:ne,validation:re}=On(),{labelId:ie}=kn(),k=D||m,A=ne??l,j=z.useRef(null),ae=Kt(j,c,re.inputRef),oe=z.useRef(null),se=O(),ce=cn({id:s,implicit:!1,controlRef:oe}),M=u?void 0:ce,[N,le]=Yt({controlled:n,default:!!i,name:`Switch`,state:`checked`});En(oe,se,N,void 0,!k,l),Rt(()=>{j.current&&T(j.current.checked)},[j,T]),Dn(N,()=>{b(A),C(N!==w.initialValue),T(N),re.change(N)});let{getButtonProps:ue,buttonRef:de}=Lt({disabled:k,native:u}),fe=HB(a,ie,j,!u,M),pe={id:u?ce:se,role:`switch`,"aria-checked":N,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":fe,onFocus(){k||E(!0)},onBlur(){let e=j.current;!e||k||(S(!0),E(!1),ee===`onBlur`&&re.commit(e.checked))},onClick(e){if(f||k)return;e.preventDefault();let t=j.current;t&&t.dispatchEvent(new(Mt(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},me=zt({checked:N,disabled:k,form:o,id:M,name:A,required:p,style:A?Te:He,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ae,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=te(be,e.nativeEvent);d?.(t,n),!n.isCanceled&&le(t)},onFocus(){oe.current?.focus()}},e=>re.getValidationProps(k,e),_===void 0?Wt:{value:_}),he=z.useMemo(()=>({...x,checked:N,disabled:k,readOnly:f,required:p}),[x,N,k,f,p]),ge=Ft(`span`,e,{state:he,ref:[t,oe,de],props:[pe,y,ue,e=>re.getValidationProps(k,e)],stateAttributesMapping:VB});return(0,R.jsxs)(RB.Provider,{value:he,children:[ge,!N&&A&&g!==void 0&&(0,R.jsx)(`input`,{type:`hidden`,form:o,name:A,value:g,disabled:k}),(0,R.jsx)(`input`,{...me,suppressHydrationWarning:!0})]})}),KB=z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Ft(`span`,e,{state:zB(),ref:t,stateAttributesMapping:VB,props:a})}),qB=34,JB=20,YB=16,XB=2,ZB=4,QB=2;function $B(e){return`label`in e&&typeof e.label==`string`}var eV=(0,z.forwardRef)(({label:e,checked:t,onToggle:n,disabled:r=!1,thumbTransition:i,uncheckedTrackColor:a,uncheckedTrackColorHovered:o,className:s,...c},l)=>{let u=(0,z.useId)(),d=(0,z.useRef)(!1),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(!1),g=(0,z.useRef)(!1),_=(0,z.useRef)(!1),v=(0,z.useRef)(null),y=ia(t?16:XB);(0,z.useEffect)(()=>{d.current=!0},[]);let b=m?20:f?18:YB,x=m?YB-ZB:YB,S=m?4:XB,C=b-YB,w=t?16-C:XB;(0,z.useEffect)(()=>{g.current||(d.current?ka(y,w,i??pt.moderate):y.set(w))},[w,y,i]);let T=(0,z.useCallback)(e=>{r||e.pointerType===`mouse`&&e.button!==0||(h(!0),g.current=!1,_.current=!1,v.current={clientX:e.clientX,originX:y.get()},e.currentTarget.setPointerCapture(e.pointerId))},[r,y]),E=(0,z.useCallback)(e=>{if(!v.current)return;let t=e.clientX-v.current.clientX;if(!g.current){if(Math.abs(t)<QB)return;g.current=!0}let n=XB,r=qB-XB-20,i=v.current.originX+t;y.set(Math.max(n,Math.min(r,i)))},[y]),ee=(0,z.useCallback)(e=>{v.current&&=(h(!1),g.current&&(_.current=!0,g.current=!1,e&&(y.get()>14/2===t?ka(y,t?16:XB,i??pt.moderate):n()),requestAnimationFrame(()=>{_.current=!1})),null)},[t,n,y,i]);return(0,R.jsxs)(`div`,{ref:l,className:L(`relative z-10 flex items-center gap-2.5 px-3 py-2 cursor-pointer select-none touch-none`,r&&`opacity-50 pointer-events-none`,s),onPointerEnter:e=>{e.pointerType===`mouse`&&p(!0)},onPointerLeave:()=>p(!1),onPointerDown:T,onPointerMove:E,onPointerUp:()=>ee(!0),onPointerCancel:()=>{v.current&&=(h(!1),g.current&&(g.current=!1,ka(y,t?16:XB,i??pt.moderate)),null)},onClick:()=>{r||_.current||n()},...c,children:[(0,R.jsx)(GB,{checked:t,"aria-labelledby":u,onCheckedChange:()=>{_.current||n()},disabled:r,tabIndex:0,className:L(`relative shrink-0 rounded-full outline-none cursor-pointer`,`transition-colors duration-80`,`focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)] focus-visible:ring-offset-2 focus-visible:ring-offset-background`),style:{width:qB,height:JB,backgroundColor:t?f?`color-mix(in oklab, var(--primary) 88%, black)`:`var(--primary)`:f?o??`color-mix(in oklab, var(--accent), rgb(var(--overlay)) 10%)`:a??`var(--accent)`},onClick:e=>e.stopPropagation(),children:(0,R.jsx)(KB,{render:e=>{let{style:t,onDrag:n,onDragStart:r,onDragEnd:a,onAnimationStart:o,onAnimationEnd:s,onAnimationIteration:c,...l}=e;return(0,R.jsx)(Pe.span,{...l,className:`absolute top-0 left-0 block rounded-full bg-white shadow-sm`,initial:!1,style:{...t,x:y},animate:{y:S,width:b,height:x},transition:d.current?i??pt.moderate:{duration:0}})}})}),(0,R.jsx)(`span`,{id:u,className:L(`text-[13px] [text-box:trim-both_cap_alphabetic] transition-[color] duration-80`,t?`text-foreground`:`text-muted-foreground`),children:e})]})});eV.displayName=`FluidSwitch`;var tV=(0,z.forwardRef)(({checked:e,defaultChecked:t=!1,onCheckedChange:n,disabled:r=!1,className:i},a)=>{let[o,s]=(0,z.useState)(t),c=e??o;return(0,R.jsx)(GB,{ref:a,checked:c,disabled:r,onCheckedChange:t=>{e===void 0&&s(t),n?.(t)},className:L(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs transition-colors duration-80`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]`,`disabled:cursor-not-allowed disabled:opacity-50`,`data-checked:bg-primary data-unchecked:bg-input`,i),children:(0,R.jsx)(KB,{className:L(`pointer-events-none block size-4 rounded-full bg-background shadow-sm ring-0 transition-transform duration-80`,`data-checked:translate-x-4 data-unchecked:translate-x-0`)})})});tV.displayName=`ShadcnSwitch`;var nV=(0,z.forwardRef)((e,t)=>$B(e)?(0,R.jsx)(eV,{ref:t,...e}):(0,R.jsx)(tV,{ref:t,...e}));nV.displayName=`Switch`;function rV({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0,children:(0,R.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}var iV=`flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,aV=`color-mix(in oklab, var(--sidebar-foreground) 22%, var(--sidebar))`,oV=`color-mix(in oklab, var(--sidebar-foreground) 30%, var(--sidebar))`,sV=`data-unchecked:!bg-zinc-300 dark:data-unchecked:!bg-zinc-600`;function cV({collapsed:e,rpcLoggerOpen:t,onRpcLoggerOpenChange:n,onCommandPaletteOpen:r}){let{embeddedConfig:i}=EL(),{theme:a,setTheme:o}=Fz(),{user:s}=mz(i.chatApiUrl),c=s?`https://manufact.com/cloud?ref=mcp-use-inspector`:`https://manufact.com/signup?ref=mcp-use-inspector`,l=()=>{try{PT(new Mo({referrer:`mcp-use-inspector-sidebar`})).catch(()=>{})}catch{}};return(0,R.jsx)(`footer`,{className:`mt-auto shrink-0`,children:(0,R.jsxs)(`div`,{className:L(`flex flex-col`,e?`items-center gap-2 px-2 py-3`:`gap-3 px-(--sidebar-nav-inset-x) py-4`),children:[e?(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`div`,{className:`flex size-8 items-center justify-center`,children:(0,R.jsx)(nV,{checked:t,onCheckedChange:n,"aria-label":`RPC Panel`,className:L(`scale-75`,sV)})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`right`,children:`RPC Panel`})]}):(0,R.jsx)(nV,{label:`RPC Panel`,checked:t,onToggle:()=>n(!t),uncheckedTrackColor:aV,uncheckedTrackColorHovered:oV,className:`w-full flex-row-reverse justify-between`}),e?(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:l,className:iV,"aria-label":`Deploying your MCP Server? Try manufact.com`,children:(0,R.jsx)(Ar,{className:`size-4`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`right`,children:`Deploying your MCP Server? Try manufact.com`})]}):(0,R.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:l,className:`relative block rounded-xl border border-sidebar-border bg-white p-3 transition-colors hover:bg-sidebar-accent/50 dark:bg-black`,children:[(0,R.jsx)(Ar,{className:`absolute top-2.5 right-2.5 size-3.5 text-muted-foreground`,"aria-hidden":!0}),(0,R.jsx)(`p`,{className:`pr-5 text-xs leading-snug text-muted-foreground`,children:`Deploying your MCP Server?`}),(0,R.jsxs)(`p`,{className:`mt-0.5 text-xs leading-snug`,children:[`Try`,` `,(0,R.jsx)(`span`,{className:`font-medium underline underline-offset-2`,children:`manufact.com`})]})]}),(0,R.jsxs)(`div`,{className:L(`flex`,e?`flex-col items-center gap-1`:`flex-row items-center gap-2`),children:[(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`a`,{href:`https://github.com/mcp-use/mcp-use`,target:`_blank`,rel:`noopener noreferrer`,className:iV,"aria-label":`GitHub`,children:(0,R.jsx)(LB,{className:`size-4`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:e?`right`:`top`,children:`GitHub`})]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`a`,{href:`https://discord.gg/XkNkSkMz3V`,target:`_blank`,rel:`noopener noreferrer`,className:iV,"aria-label":`Discord`,children:(0,R.jsx)(rV,{className:`size-4`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:e?`right`:`top`,children:`Discord`})]}),(0,R.jsxs)(Ya,{children:[(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(Xa,{render:(0,R.jsx)(`button`,{type:`button`,className:iV,"aria-label":`Theme`,children:a===`light`?(0,R.jsx)(Ui,{className:`size-4`}):a===`dark`?(0,R.jsx)(xi,{className:`size-4`}):(0,R.jsx)(bi,{className:`size-4`})}),nativeButton:!0}),nativeButton:!0}),(0,R.jsx)(lt,{side:e?`right`:`top`,children:`Theme`})]}),(0,R.jsx)(Za,{side:e?`right`:`top`,align:e?`start`:`center`,className:`w-40`,children:(0,R.jsxs)(eo,{value:a,onValueChange:e=>o(e),children:[(0,R.jsxs)(to,{value:`light`,children:[(0,R.jsx)(Ui,{className:`size-4 mr-2`}),`Light`]}),(0,R.jsxs)(to,{value:`dark`,children:[(0,R.jsx)(xi,{className:`size-4 mr-2`}),`Dark`]}),(0,R.jsxs)(to,{value:`system`,children:[(0,R.jsx)(bi,{className:`size-4 mr-2`}),`System`]})]})})]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`button`,{type:`button`,onClick:r,className:iV,"aria-label":`Command Palette`,"data-testid":`command-palette-trigger-button`,children:(0,R.jsx)(Ur,{className:`size-4`})}),nativeButton:!0}),(0,R.jsxs)(lt,{side:e?`right`:`top`,children:[`Command Palette (`,`⌘`,`K)`]})]})]})]})})}function lV(e,t){let n=0,r=0,i=e;for(;i&&i!==t;)n+=i.offsetTop,r+=i.offsetLeft,i=i.offsetParent;if(i!==t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{top:r.top-n.top,left:r.left-n.left,width:r.width,height:r.height}}return{top:n,left:r,width:e.offsetWidth,height:e.offsetHeight}}function uV(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.top!==i.top||n.left!==i.left||n.width!==i.width||n.height!==i.height)return!1}return!0}function dV(e,t={}){let{axis:n=`y`}=t,r=(0,z.useRef)(new Map),[i,a]=(0,z.useState)(null),[o,s]=(0,z.useState)({}),c=(0,z.useRef)({}),l=(0,z.useRef)(0),u=(0,z.useRef)(null),d=(0,z.useRef)(null),f=(0,z.useCallback)(()=>{let t=e.current;if(!t)return;let n={};r.current.forEach((e,r)=>{n[r]=lV(e,t)}),!uV(c.current,n)&&(c.current=n,s(n))},[e]),p=(0,z.useCallback)((e,t)=>{t?r.current.set(e,t):r.current.delete(e),d.current!==null&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{d.current=null,f()})},[f]),m=(0,z.useCallback)(t=>{let r=t.clientX,i=t.clientY;u.current!==null&&cancelAnimationFrame(u.current),u.current=requestAnimationFrame(()=>{u.current=null;let t=e.current;if(!t)return;let o=t.getBoundingClientRect(),s=n===`x`?r:i,l=null,d=1/0,f=null,p=c.current,m=n===`x`?t.scrollLeft:t.scrollTop,h=n===`x`?t.clientLeft:t.clientTop,g=n===`x`?o.left:o.top,_=n===`x`?t.offsetWidth:t.offsetHeight,v=n===`x`?o.width:o.height,y=_>0?v/_:1;for(let[e,t]of Object.entries(p)){let r=g+(h+(n===`x`?t.left:t.top)-m)*y,i=(n===`x`?t.width:t.height)*y,a=r+i;s>=r&&s<=a&&(f=e);let o=r+i/2,c=Math.abs(s-o);c<d&&(d=c,l=e)}a(f??l)})},[n,e]),h=(0,z.useCallback)(()=>{l.current+=1},[]),g=(0,z.useCallback)(()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),a(null)},[]);return(0,z.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{d.current!==null&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>{d.current=null,f()})});return n.observe(t),()=>n.disconnect()},[e,f]),(0,z.useEffect)(()=>()=>{u.current!==null&&cancelAnimationFrame(u.current),d.current!==null&&cancelAnimationFrame(d.current)},[]),{activeKey:i,itemRects:o,sessionRef:l,handlers:{onMouseMove:m,onMouseEnter:h,onMouseLeave:g},registerItem:p,measureItems:f}}function fV(e){if(!e)return{left:0,right:0};let t=getComputedStyle(e),n=Number.parseFloat(t.getPropertyValue(`--sidebar-nav-pill-bleed`))||0,r=Number.parseFloat(t.getPropertyValue(`--sidebar-nav-scrollbar-width`))||0,i=Number.parseFloat(t.getPropertyValue(`--sidebar-nav-pill-outer-trim-right`))||0;return{left:n,right:n+r+i}}function pV(e,t){return{...e,left:e.left-t.left,width:e.width+t.left+t.right}}var mV=(0,z.createContext)(null);function hV(){let e=(0,z.useContext)(mV),t=(0,z.useRef)(e?.registerItem);t.current=e?.registerItem;let n=(0,z.useRef)(new Map);return(0,z.useCallback)(e=>{let r=n.current,i=r.get(e);return i||(i=n=>t.current?.(e,n),r.set(e,i)),i},[])}function gV({children:e,isActiveKey:t,className:n}){let r=(0,z.useRef)(null),{activeKey:i,itemRects:a,sessionRef:o,handlers:s,registerItem:c,measureItems:l}=dV(r),u=(0,z.useMemo)(()=>({registerItem:c}),[c]),d=Object.keys(a).find(e=>t(e))??null;(0,z.useLayoutEffect)(()=>{l()},[l,e,d]);let f=fV(r.current),p=i?a[i]:null,m=d?a[d]:null,h=p?pV(p,f):null,g=m?pV(m,f):null,_=i!==null&&i!==d;return(0,R.jsx)(mV.Provider,{value:u,children:(0,R.jsxs)(`div`,{ref:r,onMouseEnter:s.onMouseEnter,onMouseMove:s.onMouseMove,onMouseLeave:s.onMouseLeave,className:L(`relative isolate`,n),children:[(0,R.jsx)(en,{initial:!1,children:g&&d?(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:`pointer-events-none absolute -z-20 rounded-full bg-sidebar-accent`,initial:{opacity:0,top:g.top,left:g.left,width:g.width,height:g.height},animate:{opacity:_?.85:1,top:g.top,left:g.left,width:g.width,height:g.height},exit:{opacity:0,transition:pt.fast.exit},transition:{opacity:{duration:.08},top:{duration:0},left:{duration:0},width:{duration:0},height:{duration:0}}},d):null}),(0,R.jsx)(en,{children:h?(0,R.jsx)(Pe.div,{"aria-hidden":!0,className:`pointer-events-none absolute -z-10 rounded-full bg-sidebar-accent`,initial:{opacity:0,top:g?.top??h.top,left:g?.left??h.left,width:g?.width??h.width,height:g?.height??h.height},animate:{opacity:1,top:h.top,left:h.left,width:h.width,height:h.height},exit:{opacity:0,transition:pt.fast.exit},transition:{...pt.fast,opacity:{duration:.08}}},o.current):null}),e]})})}var _V=L(`pointer-events-auto absolute right-(--sidebar-nav-trailing-right) top-1/2 z-10 flex h-(--sidebar-nav-trailing-size) min-w-(--sidebar-nav-trailing-size) -translate-y-1/2 items-center justify-center`,L(`transition-[opacity,filter] duration-200 ease-out`,`opacity-100 blur-0`,`group-data-[collapsible=icon]:opacity-0 group-data-[collapsible=icon]:blur-[3px] group-data-[collapsible=icon]:pointer-events-none`,`group-data-[collapsed=true]:opacity-0 group-data-[collapsed=true]:blur-[3px] group-data-[collapsed=true]:pointer-events-none`)),vV=L(`truncate transition-[opacity,filter,margin] duration-200 ease-out`,`group-data-[collapsible=icon]:hidden`,`group-data-[collapsed=true]:hidden`),yV=L(`peer/menu-button flex cursor-pointer items-center gap-2 overflow-hidden rounded-full py-2 text-left text-sm outline-hidden ring-sidebar-ring hover:text-sidebar-accent-foreground group-hover/menu-item:text-sidebar-accent-foreground focus-visible:ring-2 active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-active:font-medium data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,`transition-[width,max-width,height,padding,border-radius] duration-200 ease-out`,`h-8 text-sm`);function bV({count:e}){return(0,R.jsx)(`span`,{className:L(`inline-flex h-5 shrink-0 items-center justify-center border border-border bg-zinc-200 px-1 text-[10px] font-medium tabular-nums leading-none text-foreground dark:bg-zinc-700`,String(e).length>=3?`min-w-5 rounded-md`:`size-5 min-w-5 rounded-full`),children:e})}function xV(e){return e.id!==`separator`}function SV({activeTab:e,onTabChange:t,selectedServer:n,visibleTabs:r,collapsed:i}){let a=hV();return(0,R.jsx)(`ul`,{className:`flex w-full min-w-0 flex-col gap-1 px-(--sidebar-nav-inset-x) group`,"data-collapsed":i,"aria-label":`Inspector tabs`,children:(r?Jz.filter(e=>xV(e)&&r.includes(e.id)):Jz.filter(xV)).map((r,o)=>{let s=Kz(r.id,n),c=qz(r.id,s,i),l=r.icon,u=e===r.id,d=s>0||c,f=(0,R.jsxs)(`button`,{ref:a(r.id),type:`button`,"data-testid":`tab-${r.id}`,"data-active":u?!0:void 0,onClick:()=>t(r.id),className:L(yV,i?`size-8! w-8! max-w-8! shrink-0 justify-center gap-0 p-0!`:`w-full max-w-full sidebar-nav-pill-bleed-x pl-(--sidebar-nav-icon-pl-bleed) pr-(--sidebar-nav-pr-bleed)`,d&&!i&&`pr-[calc(var(--sidebar-nav-trailing-right)+var(--sidebar-nav-trailing-size))]`),children:[(0,R.jsx)(l,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:vV,children:r.label})]});return(0,R.jsxs)(`li`,{className:L(`group/menu-item relative`,o===0&&`mt-4`),children:[i?(0,R.jsxs)(et,{delayDuration:0,children:[(0,R.jsx)(we,{render:f,nativeButton:!0}),(0,R.jsx)(lt,{side:`right`,children:s>0?`${r.label} (${s})`:r.label})]}):f,d&&!i?(0,R.jsx)(`div`,{className:_V,children:s>0?(0,R.jsx)(bV,{count:s}):c?(0,R.jsx)(`span`,{className:`inline-flex h-2 w-2 shrink-0 rounded-full bg-yellow-500 animate-status-pulse-yellow`}):null}):null]},r.id)})})}function CV({activeTab:e,onTabChange:t,selectedServer:n,visibleTabs:r,collapsed:i,onCollapsedChange:a,rpcLoggerOpen:o,onRpcLoggerOpenChange:s,onCommandPaletteOpen:c}){return(0,R.jsxs)(`aside`,{className:L(`group/sidebar relative hidden lg:flex flex-col shrink-0 text-sidebar-foreground transition-[width] duration-200 ease-out @container/sidebar`,i?`w-(--sidebar-width-icon)`:`w-(--sidebar-width)`),"data-collapsed":i,"data-collapsible":i?`icon`:`expanded`,children:[(0,R.jsx)(`div`,{className:`sidebar-nav-scroll flex-1 overflow-y-auto overflow-x-hidden min-h-0`,children:(0,R.jsx)(gV,{isActiveKey:t=>t===e,className:`pb-2`,children:(0,R.jsx)(SV,{activeTab:e,onTabChange:t,selectedServer:n,visibleTabs:r,collapsed:i})})}),(0,R.jsx)(cV,{collapsed:i,rpcLoggerOpen:o,onRpcLoggerOpenChange:s,onCommandPaletteOpen:c}),(0,R.jsx)(IB,{collapsed:i,onToggle:()=>a(!i)})]})}function wV(e){if(e===0)return`0 Bytes`;let t=1024,n=[`Bytes`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/t**r*100)/100+` `+n[r]}function TV(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/t**r).toFixed(1))} ${n[r]}`}var EV=100*1024,DV=1024*20;function OV(e,t){if(e==null)return e;if(typeof e==`string`)return e.length>t?e.substring(0,t)+`... (truncated)`:e;if(Array.isArray(e))return e.map(e=>OV(e,t));if(typeof e==`object`){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=OV(e[r],t));return n}return e}function kV(e){let t=JSON.stringify(e,null,2);return new TextEncoder().encode(t).length>EV?OV(e,DV):e}function AV(e){let t=JSON.stringify(e,null,2),n=new TextEncoder().encode(t).length,r=n>EV,i;if(r){let t=OV(e,DV);i=JSON.stringify(t,null,2)}else i=t;return{isLarge:r,size:n,sizeFormatted:wV(n),preview:i,full:t}}function jV(e,t){try{let n=JSON.stringify(e,null,2),r=globalThis.Blob,i=new r([n],{type:`application/json`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=t||`data-${Date.now()}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)}catch(e){throw console.error(`Failed to download JSON:`,e),e}}var MV={key:`text-sky-600 dark:text-sky-400`,string:`text-emerald-600 dark:text-emerald-400`,number:`text-amber-600 dark:text-amber-400`,boolean:`text-violet-600 dark:text-violet-400`,null:`text-zinc-500 dark:text-zinc-400`,punctuation:`text-muted-foreground`};function NV(e){let t=[],n=0,r=(e,n)=>{n&&t.push({kind:e,text:n})};for(;n<e.length;){let t=e[n];if(t===`"`){let t=n;for(n++;n<e.length;){if(e[n]===`\\`){n+=2;continue}if(e[n]===`"`){n++;break}n++}let i=e.slice(t,n),a=n;for(;a<e.length&&/[ \t]/.test(e[a]);)a++;r(e[a]===`:`?`key`:`string`,i);continue}if(/[0-9-]/.test(t)){let t=n;for(e[n]===`-`&&n++;n<e.length&&/[0-9.eE+-]/.test(e[n]);)n++;r(`number`,e.slice(t,n));continue}if(e.startsWith(`true`,n)||e.startsWith(`false`,n)){let t=e.startsWith(`true`,n)?`true`:`false`;r(`boolean`,t),n+=t.length;continue}if(e.startsWith(`null`,n)){r(`null`,`null`),n+=4;continue}if(/[{}[\],:]/.test(t)){r(`punctuation`,t),n++;continue}r(`punctuation`,t),n++}return t}function PV(e){return NV(e).map((e,t)=>(0,R.jsx)(`span`,{className:MV[e.kind],children:e.text},t))}var FV={string:`text-emerald-600 dark:text-emerald-400`,number:`text-amber-600 dark:text-amber-400`,boolean:`text-violet-600 dark:text-violet-400`,null:`text-zinc-500 dark:text-zinc-400`,key:`text-sky-600 dark:text-sky-400`,punctuation:`text-muted-foreground`};function IV(e){return e===null?(0,R.jsx)(`span`,{className:FV.null,children:`null`}):typeof e==`string`?(0,R.jsx)(`span`,{className:FV.string,children:JSON.stringify(e)}):typeof e==`number`?(0,R.jsx)(`span`,{className:FV.number,children:String(e)}):typeof e==`boolean`?(0,R.jsx)(`span`,{className:FV.boolean,children:String(e)}):(0,R.jsx)(`span`,{className:FV.string,children:JSON.stringify(e)})}function LV(e){return Array.isArray(e)?`[${e.length}]`:`{${Object.keys(e).length}}`}function RV({label:e,value:t,depth:n,defaultExpanded:r}){let i=typeof t==`object`&&t&&!Array.isArray(t)?Object.keys(t).length>0:Array.isArray(t)?t.length>0:!1,[a,o]=(0,z.useState)(i&&(r||n===0));if(!i){let r=Array.isArray(t)?`[]`:`{}`;return typeof t==`object`&&t?(0,R.jsxs)(`div`,{className:`font-mono text-[0.8rem] leading-relaxed`,style:{paddingLeft:n*12},children:[e!=null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:FV.key,children:JSON.stringify(e)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:`: `})]}),(0,R.jsx)(`span`,{className:FV.punctuation,children:r})]}):(0,R.jsxs)(`div`,{className:`font-mono text-[0.8rem] leading-relaxed`,style:{paddingLeft:n*12},children:[e!=null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:FV.key,children:JSON.stringify(e)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:`: `})]}),IV(t)]})}let s=Array.isArray(t)?t.map((e,t)=>[String(t),e]):Object.entries(t),c=Array.isArray(t),l=c?`[`:`{`,u=c?`]`:`}`;return(0,R.jsxs)(`div`,{className:`font-mono text-[0.8rem] leading-relaxed`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-0.5`,style:{paddingLeft:n*12},children:[(0,R.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`mt-0.5 inline-flex shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground`,children:(0,R.jsx)(C,{className:L(`h-3.5 w-3.5 transition-transform`,a&&`rotate-90`)})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e!=null&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:FV.key,children:JSON.stringify(e)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:`: `})]}),(0,R.jsx)(`span`,{className:FV.punctuation,children:l}),!a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>o(!0),className:`mx-1 text-xs text-muted-foreground hover:text-foreground`,children:LV(t)}),(0,R.jsx)(`span`,{className:FV.punctuation,children:u})]})]})]}),a&&(0,R.jsxs)(`div`,{children:[s.map(([e,t])=>(0,R.jsx)(RV,{label:e,value:t,depth:n+1,defaultExpanded:r},`${n}-${e}`)),(0,R.jsx)(`div`,{style:{paddingLeft:n*12},children:(0,R.jsx)(`span`,{className:FV.punctuation,children:u})})]})]})}function zV({data:e,defaultExpanded:t=!0,className:n}){return(0,R.jsx)(`div`,{className:L(`text-gray-900 dark:text-gray-100 [overflow-wrap:anywhere]`,n),"data-testid":`collapsible-json`,children:(0,R.jsx)(RV,{value:e,depth:0,defaultExpanded:t})})}var BV=`font-mono text-[0.8rem] text-gray-900 dark:text-gray-100 whitespace-pre-wrap break-words [overflow-wrap:anywhere]`;function VV({data:e,filename:t,className:n,collapsible:r=!1,defaultExpanded:i=!0,...a}){let o=AV(e),s=kV(e),c=o.isLarge?(0,R.jsx)(`div`,{className:`mb-3 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg`,children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`p`,{className:`text-sm font-medium text-yellow-800 dark:text-yellow-300 mb-1`,children:[`JSON is too large (`,o.sizeFormatted,`)`]}),(0,R.jsx)(`p`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:`Showing full structure with truncated values. Download the full JSON file to see complete values.`})]}),(0,R.jsxs)(Gt,{variant:`outline`,size:`sm`,onClick:()=>{jV(e,t)},className:`shrink-0`,children:[(0,R.jsx)(qr,{className:`h-4 w-4 mr-1`}),`Download`]})]})}):null;return r?(0,R.jsxs)(`div`,{className:n,...a,children:[c,(0,R.jsx)(zV,{data:s,defaultExpanded:i})]}):o.isLarge?(0,R.jsxs)(`div`,{className:n,...a,children:[c,(0,R.jsx)(`pre`,{className:BV,children:(0,R.jsx)(`code`,{children:PV(o.preview)})})]}):(0,R.jsx)(`div`,{className:n,...a,children:(0,R.jsx)(`pre`,{className:BV,children:(0,R.jsx)(`code`,{children:PV(o.preview)})})})}function HV(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var UV=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function WV(e){return z.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[UV.checked]:``}:{[UV.unchecked]:``}},...Tn}),[e.indeterminate])}var GV=z.createContext({disabled:!1});function KV(){return z.useContext(GV)}var qV=z.createContext(void 0);function JV(e=!0){let t=z.useContext(qV);if(t===void 0&&!e)throw Error(Vt(3));return t}var YV=z.createContext(void 0);function XV(){let e=z.useContext(YV);if(e===void 0)throw Error(Vt(14));return e}var ZV=`data-parent`,QV=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:b,...x}=e,{clearErrors:S}=An(),{disabled:C,name:w,setDirty:T,setFilled:E,setFocused:ee,setTouched:D,state:ne,validationMode:re,validityData:ie,validation:k}=On(),A=KV(),{labelId:j,controlId:ae,registerControlId:oe,getDescriptionProps:se}=kn(),ce=JV(),M=ce?.parent,N=M&&ce.allValues,le=C||A.disabled||ce?.disabled||o,ue=w??d,de=v??ue,fe=O(),pe=O(),me=ae;N?me=p?pe:`${M.id}-${de}`:c&&(me=c);let he={};N&&(p?he=ce.parent.getParentProps():de&&(he=ce.parent.getChildProps(de)));let{checked:ge=n,indeterminate:_e=l,onCheckedChange:ve,...ye}=he,xe=ce?.value,P=ce?.setValue,Se=ce?.defaultValue,Ce=z.useRef(null),we=qt(()=>Symbol(`checkbox-control`)),Ee=z.useRef(!1),{getButtonProps:De,buttonRef:Oe}=Lt({disabled:le,native:y}),ke=ce?.validation??k,[Ae,je]=Yt({controlled:de&&xe&&!p?xe.includes(de):ge,default:de&&Se&&!p?Se.includes(de):i,name:`Checkbox`,state:`checked`}),Me=N?!!ge:Ae,Ne=N&&_e||l;Rt(()=>{oe!==It&&(Ee.current=!0,oe(we.current,me))},[me,oe,we]),z.useEffect(()=>{let e=we.current;return()=>{!Ee.current||oe===It||(Ee.current=!1,oe(e,void 0))}},[oe,we]),En(Ce,fe,Ae,void 0,!ce&&!le,d);let Pe=z.useRef(null),Fe=Kt(u,Pe,ke.inputRef,ke.registerInput),Ie=HB(a,j,Pe,!y,me??void 0);Rt(()=>{Pe.current&&(Pe.current.indeterminate=Ne,Ae&&E(!0))},[Ae,Ne,E]),Dn(Ae,()=>{ce||(S(ue),E(Ae),T(Ae!==ie.initialValue),ke.change(Ae))});let Le=zt({checked:Ae,disabled:le,form:s,name:p?void 0:ue,id:y?void 0:me??void 0,required:g,ref:Fe,style:ue?Te:He,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=te(be,e.nativeEvent);f?.(t,n),!n.isCanceled&&(ve?.(t,n),!n.isCanceled&&(je(t),de&&xe&&P&&!p&&!N&&P(t?[...xe,de]:xe.filter(e=>e!==de),n)))},onFocus(){Ce.current?.focus()}},v===void 0?Wt:{value:(ce?Ae&&v:v)||``},se,e=>ke.getValidationProps(le,e));z.useEffect(()=>{if(!M||!de)return;let e=M.disabledStatesRef.current;return e.set(de,le),()=>{e.delete(de)}},[M,le,de]);let Re=z.useMemo(()=>({...ne,checked:Me,disabled:le,readOnly:m,required:g,indeterminate:Ne}),[ne,Me,le,m,g,Ne]),ze=WV(Re),Be=Ft(`span`,e,{state:Re,ref:[Oe,Ce,t,ce?.registerControlRef],props:[{id:y?me??void 0:fe,role:`checkbox`,"aria-checked":Ne?`mixed`:Me,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Ie,[ZV]:p?``:void 0,onFocus(){le||ee(!0)},onBlur(){let e=Pe.current;e&&(D(!0),ee(!1),re===`onBlur`&&ke.commit(ce?xe:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Pe.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),Mt(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||HV(t)?.click()})},onClick(e){if(m||le)return;e.preventDefault();let t=Pe.current;t&&t.dispatchEvent(new(Mt(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},x,ye,De,se,e=>ke.getValidationProps(le,e)],stateAttributesMapping:ze});return(0,R.jsxs)(YV.Provider,{value:Re,children:[Be,!Ae&&!ce&&ue&&!p&&_!==void 0&&(0,R.jsx)(`input`,{type:`hidden`,form:s,name:ue,value:_,disabled:le}),(0,R.jsx)(`input`,{...Le,suppressHydrationWarning:!0})]})}),$V=z.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=XV(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=Je(c),f=z.useRef(null),p={...s,transitionStatus:u};g({open:c,ref:f,onComplete(){c||d(!1)}});let m={...WV(s),...it,...Tn},h=a||l,_=Ft(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?_:null}),eH=(0,z.createContext)(null);function tH(){let e=(0,z.useContext)(eH);if(!e)throw Error(`useCheckboxGroup must be used within a CheckboxGroup`);return e}var nH=(0,z.forwardRef)(({children:e,checkedIndices:t,orientation:n=`vertical`,className:r,...i},a)=>{let o=(0,z.useRef)(null),s=n===`horizontal`,{activeIndex:c,setActiveIndex:l,handlers:u,registerItem:d,measureItems:f}=_n(o,{axis:s?`x`:`y`});(0,z.useEffect)(()=>{f()},[f,e]);let p=s?`ArrowLeft`:`ArrowUp`,m=s?`ArrowRight`:`ArrowDown`;return(0,R.jsx)(eH.Provider,{value:{registerItem:d,activeIndex:c},children:(0,R.jsx)(`div`,{ref:e=>{o.current=e,typeof a==`function`?a(e):a&&(a.current=e)},onMouseEnter:u.onMouseEnter,onMouseMove:u.onMouseMove,onMouseLeave:u.onMouseLeave,onFocus:e=>{let t=e.target.closest(`[data-proximity-index]`)?.getAttribute(`data-proximity-index`);t!=null&&l(Number(t))},onBlur:e=>{o.current?.contains(e.relatedTarget)||l(null)},onKeyDown:e=>{let t=Array.from(o.current?.querySelectorAll(`[data-proximity-index]`)??[]),n=t.indexOf(e.target);n!==-1&&([p,m].includes(e.key)?(e.preventDefault(),t[e.key===m?(n+1)%t.length:(n-1+t.length)%t.length]?.focus()):e.key===`Home`?(e.preventDefault(),t[0]?.focus()):e.key===`End`&&(e.preventDefault(),t[t.length-1]?.focus()))},role:`group`,className:L(`relative flex max-w-full select-none`,s?`w-auto flex-row`:`w-72 flex-col`,r),...i,children:e})})});nH.displayName=`CheckboxGroup`;var rH=(0,z.forwardRef)(({label:e,index:t,checked:n,onToggle:r,size:i=`default`,className:a,...o},s)=>{let c=(0,z.useRef)(null),l=(0,z.useRef)(!1),{registerItem:u,activeIndex:d}=tH();(0,z.useEffect)(()=>(u(t,c.current),()=>u(t,null)),[t,u]),(0,z.useEffect)(()=>{l.current=!0},[]);let f=d===t,p=!l.current,m=Nt(),h=i===`sm`;return(0,R.jsxs)(`div`,{ref:e=>{c.current=e,typeof s==`function`?s(e):s&&(s.current=e)},"data-proximity-index":t,tabIndex:0,role:`checkbox`,"aria-checked":n,"aria-label":e,onClick:r,onMouseDown:e=>{let t=e.target.closest(`button:not([tabindex="-1"]), a[href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);t&&t!==e.currentTarget||(e.preventDefault(),e.currentTarget.focus())},onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),r())},className:L(`relative z-10 flex items-center cursor-pointer outline-none`,h?`h-7 gap-1.5 px-2`:`h-8 gap-2.5 px-3`,m.item,`focus-visible:ring-1 focus-visible:ring-[color:var(--focus-ring,#6B97FF)]`,a),...o,children:[(0,R.jsxs)(QV,{checked:n,tabIndex:-1,"aria-hidden":!0,className:L(`pointer-events-none relative shrink-0 appearance-none bg-transparent p-0 border-0 outline-none`,h?`size-[13px]`:`size-[15px]`),children:[(0,R.jsx)(`div`,{className:L(`absolute inset-0 rounded-[5px] border-solid transition-all duration-80 border-[1.5px]`,n?`border-border`:f?`border-neutral-400 dark:border-neutral-500`:`border-border`)}),(0,R.jsx)(en,{children:n&&(0,R.jsx)($V,{keepMounted:!0,render:e=>{let{style:t,onDrag:n,onDragStart:r,onDragEnd:i,onAnimationStart:a,onAnimationEnd:o,onAnimationIteration:s,...c}=e;return(0,R.jsx)(Pe.svg,{...c,width:h?14:18,height:h?14:18,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-foreground`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:1},children:(0,R.jsx)(Pe.path,{d:`M6 12L10 16L18 8`,initial:{pathLength:+!!p},animate:{pathLength:1,transition:{duration:.08,ease:`easeOut`}},exit:{pathLength:0,transition:{duration:.04,ease:`easeIn`}}})})}})})]}),(0,R.jsxs)(`span`,{className:`inline-grid items-center self-center leading-none`,children:[(0,R.jsx)(`span`,{className:`col-start-1 row-start-1 invisible leading-none`,style:{fontVariationSettings:ke.semibold},"aria-hidden":`true`,children:e}),(0,R.jsx)(`span`,{className:L(`col-start-1 row-start-1 leading-none transition-[color,font-variation-settings] duration-80`,h?`text-[11px]`:`text-[13px]`,n||f?`text-foreground`:`text-muted-foreground`),style:{fontVariationSettings:n?ke.semibold:ke.normal},children:e})]})]})});rH.displayName=`CheckboxItem`;var iH=36,aH=188,oH=6;function sH(e,t,n){let[r,i]=(0,z.useState)(0),[a,o]=(0,z.useState)(0),s=(0,z.useMemo)(()=>{let n=[],r=[],i=0;for(let a of e){n.push(i);let e=iH+(t.has(a.id)?aH:0);r.push(e),i+=e}return{offsets:n,heights:r,totalHeight:i}},[t,e]),c=(0,z.useMemo)(()=>{if(e.length===0)return{totalHeight:0,visibleItems:[]};let{offsets:t,heights:n,totalHeight:i}=s,o=r+a,c=0;for(;c<e.length&&t[c]+n[c]<r;)c++;c=Math.max(0,c-oH);let l=c;for(;l<e.length&&t[l]<o;)l++;l=Math.min(e.length,l+oH);let u=[];for(let r=c;r<l;r++)u.push({index:r,item:e[r],top:t[r],height:n[r]});return{totalHeight:i,visibleItems:u}},[e,s,r,a]),l=(0,z.useCallback)(()=>{let e=n.current;e&&i(e.scrollTop)},[n]);return(0,z.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{o(e.clientHeight),i(e.scrollTop)};t();let r=new ResizeObserver(t);return r.observe(e),e.addEventListener(`scroll`,l,{passive:!0}),()=>{r.disconnect(),e.removeEventListener(`scroll`,l)}},[l,n,e.length]),c}var cH=300,lH=/(?:^|\/)notifications\//;function uH(e){let t=e;return typeof t?.method==`string`?t.method:null}function dH(e){let t=e.message;if(t?.id!==void 0&&t.id!==null||t?.result!==void 0||t?.error!==void 0)return null;let n=uH(e.message);return!n||!lH.test(n)?null:[e.source,e.serverId,e.widgetId??``,e.direction,n].join(`|`)}function fH(e,t,n=Date.now()){let r=dH(e),i=dH(t);if(!r||r!==i)return!1;let a=Date.parse(e.timestamp);return Number.isNaN(a)?!1:n-a<=cH}function pH(e,t){return{...e,timestamp:t.timestamp,message:t.message,repeatCount:(e.repeatCount??1)+1}}var mH=new class{maxEntries;entries=[];listeners=new Set;nextId=0;emitFrame=null;constructor(e=1e3){this.maxEntries=e}publish(e){let t=this.entries[this.entries.length-1];if(t&&fH(t,e,Date.parse(e.timestamp))){this.entries[this.entries.length-1]=pH(t,e),this.scheduleEmit();return}this.entries.push({...e,id:`rpc-${++this.nextId}`}),this.entries.length>this.maxEntries&&this.entries.splice(0,this.entries.length-this.maxEntries),this.scheduleEmit()}getSnapshot=()=>this.entries;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));clear(e={}){let t=new Set(e.serverIds??[]),n=new Set(e.sources??[]);t.size===0&&n.size===0?this.entries=[]:this.entries=this.entries.filter(e=>!((t.size===0||t.has(e.serverId))&&(n.size===0||n.has(e.source)))),this.scheduleEmit()}peekCoalesceKey(e){return dH(e)}scheduleEmit(){if(this.emitFrame===null){if(typeof requestAnimationFrame>`u`){this.emit();return}this.emitFrame=requestAnimationFrame(()=>{this.emitFrame=null,this.emit()})}}emit(){this.listeners.forEach(e=>e())}},hH;function gH(e){mH.publish({source:`mcp`,serverId:e.serverId,direction:e.direction,timestamp:e.timestamp,message:e.message})}function _H(){hH||=(dk().forEach(gH),fk(gH))}_H();function vH({serverIds:e,onCountChange:t,onClearRef:n,onExportRef:r}={}){let i=(0,z.useRef)(null),[a,o]=(0,z.useState)(new Set),[s,c]=(0,z.useState)(``),[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(()=>new Set([`mcp`,`widget`])),p=(0,z.useSyncExternalStore)(mH.subscribe,mH.getSnapshot,mH.getSnapshot),m=async e=>{try{await lM(JSON.stringify(e,null,2)),oI.success(`Message copied to clipboard`)}catch(e){console.error(`Failed to copy message:`,e),oI.error(`Failed to copy to clipboard`)}},h=(0,z.useMemo)(()=>{if(!e?.length)return p;let t=new Set(e);return p.filter(e=>t.has(e.serverId))},[p,e]),g=(0,z.useMemo)(()=>{let e=new Set;return d.has(`mcp`)&&e.add(0),d.has(`widget`)&&e.add(1),e},[d]),_=(0,z.useCallback)(e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),y=(0,z.useMemo)(()=>{let e=h;d.size>0&&(e=e.filter(e=>d.has(e.source)));let t=s.trim().toLowerCase();return t&&(e=e.filter(e=>{let n=bH(e);return e.serverId.toLowerCase().includes(t)||e.widgetId?.toLowerCase().includes(t)||e.source.includes(t)||n.toLowerCase().includes(t)||e.direction.toLowerCase().includes(t)||JSON.stringify(e.message).toLowerCase().includes(t)})),[...e].reverse()},[h,s,d]),{totalHeight:b,visibleItems:x}=sH(y,a,i),S=(0,z.useCallback)(e=>{o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),C=(0,z.useCallback)(async()=>{let t=d.size===0||d.size===2?void 0:[...d];(!t||t.includes(`mcp`))&&(e?.length?e.forEach(e=>pk(e)):pk()),mH.clear({serverIds:e,sources:t}),o(new Set)},[e,d]),w=(0,z.useCallback)(async()=>{try{await lM(JSON.stringify(y,null,2)),oI.success(`Copied ${y.length} messages`)}catch(e){console.error(`Failed to copy messages:`,e),oI.error(`Failed to copy to clipboard`)}},[y]),T=(0,z.useCallback)(()=>{let e=new Blob([JSON.stringify(y,null,2)],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`mcp-rpc-traffic-${new Date().toISOString().replaceAll(`:`,`-`)}.json`,n.click(),URL.revokeObjectURL(t)},[y]);return(0,z.useEffect)(()=>{t?.(y.length)},[y.length,t]),(0,z.useEffect)(()=>(n&&(n.current=C),()=>{n&&(n.current=null)}),[C,n]),(0,z.useEffect)(()=>(r&&(r.current=w),()=>{r&&(r.current=null)}),[w,r]),(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 pr-2 pt-2 pl-1`,children:[(0,R.jsx)(`h2`,{className:`text-xs font-medium text-foreground`,children:`RPC Logs`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`size-7 p-0`,onClick:w,disabled:y.length===0,"aria-label":`Copy filtered RPC traffic`,title:`Copy filtered`,children:(0,R.jsx)(Wr,{className:`size-3.5`})}),(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`size-7 p-0`,onClick:T,disabled:y.length===0,"aria-label":`Download filtered RPC traffic as JSON`,title:`Download JSON`,children:(0,R.jsx)(qr,{className:`size-3.5`})}),(0,R.jsx)(Gt,{variant:`ghost`,size:`sm`,className:`size-7 p-0`,onClick:C,disabled:p.length===0,"aria-label":`Clear RPC traffic`,title:`Clear`,children:(0,R.jsx)(Gi,{className:`size-3.5`})})]})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center pr-2 pb-2 pt-1 pl-1`,children:[(0,R.jsxs)(`div`,{className:`relative min-w-0 flex-1 transition-[flex-grow] duration-200 ease-out`,children:[(0,R.jsx)(v,{className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,R.jsx)(ht,{value:s,onChange:e=>c(e.target.value),onFocus:()=>u(!0),onBlur:()=>u(!1),placeholder:`Search`,"aria-label":`Search RPC traffic`,className:`h-8 w-full pl-7 text-xs shadow-none transition-[width] duration-200 ease-out`})]}),(0,R.jsx)(`div`,{"aria-hidden":l,className:L(`shrink-0 overflow-hidden transition-[max-width,opacity,margin] duration-200 ease-out`,l?`pointer-events-none ml-0 max-w-0 opacity-0`:`ml-2 max-w-32 opacity-100`),children:(0,R.jsxs)(nH,{checkedIndices:g,orientation:`horizontal`,"aria-label":`Filter RPC traffic by source`,className:`w-auto shrink-0`,children:[(0,R.jsx)(rH,{index:0,label:`MCP`,size:`sm`,checked:d.has(`mcp`),onToggle:()=>_(`mcp`)}),(0,R.jsx)(rH,{index:1,label:`UI`,size:`sm`,checked:d.has(`widget`),onToggle:()=>_(`widget`)})]})})]}),(0,R.jsx)(`div`,{ref:i,className:`min-h-0 flex-1 overflow-y-auto pb-10`,style:{maskImage:`linear-gradient(to bottom, black 0, black calc(100% - 3rem), transparent 100%)`,WebkitMaskImage:`linear-gradient(to bottom, black 0, black calc(100% - 3rem), transparent 100%)`},children:y.length===0?(0,R.jsxs)(`div`,{className:`text-center py-8`,children:[(0,R.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No messages yet`}),(0,R.jsx)(`div`,{className:`text-[10px] text-muted-foreground mt-1`,children:`JSON-RPC messages will appear here`})]}):(0,R.jsx)(`div`,{className:`relative w-full`,style:{height:b},children:x.map(({item:e,top:t,height:n})=>(0,R.jsx)(yH,{item:e,top:t,height:n,expanded:a.has(e.id),onToggle:()=>S(e.id),onCopy:()=>m(e.message)},e.id))})})]})}function yH({item:e,top:t,height:n,expanded:r,onToggle:i,onCopy:a}){let o=bH(e),s=xH(e),c=e.repeatCount&&e.repeatCount>1?` ×${e.repeatCount}`:``;return(0,R.jsxs)(`div`,{className:`absolute inset-x-0 overflow-hidden`,style:{top:t,height:n},"data-testid":`rpc-message-${o.replace(/\//g,`-`)}`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":r,onClick:i,className:`flex h-9 w-full cursor-pointer items-center gap-2 py-2 pr-3 pl-1 text-left text-muted-foreground transition-colors hover:text-foreground`,children:[(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:e.direction===`receive`?(0,R.jsx)(Dr,{className:`size-3.5 text-blue-500`}):(0,R.jsx)(Ar,{className:`size-3.5 text-emerald-500`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`left`,children:s})]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center`,children:e.source===`mcp`?(0,R.jsx)(WL,{className:`size-3`}):(0,R.jsx)(Ti,{className:`size-3`})}),nativeButton:!1}),(0,R.jsx)(lt,{side:`left`,children:e.source===`mcp`?`MCP server`:`UI widget`})]}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,children:[o,c?(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:c}):null]}),(0,R.jsxs)(et,{children:[(0,R.jsx)(we,{render:(0,R.jsx)(`time`,{dateTime:e.timestamp,className:`shrink-0 cursor-default font-mono text-[10px] tabular-nums text-muted-foreground underline decoration-dotted underline-offset-2`,children:new Date(e.timestamp).toLocaleTimeString()}),nativeButton:!1}),(0,R.jsx)(lt,{side:`left`,children:new Date(e.timestamp).toLocaleString()})]})]}),r?(0,R.jsxs)(`div`,{className:`relative mx-3 mb-2 max-h-44 overflow-auto rounded-lg p-2 pr-8`,children:[(0,R.jsx)(VV,{data:e.message,className:`[&_pre]:!text-[10px] [&_pre]:!leading-4`}),(0,R.jsx)(Gt,{variant:`secondary`,size:`icon-sm`,onClick:a,className:`absolute right-1 top-1 size-6 rounded-full p-0`,title:`Copy message`,"aria-label":`Copy message`,children:(0,R.jsx)(Wr,{className:`size-3`})})]}):null]})}function bH(e){let t=uH(e.message);if(t)return t;let n=e.message;return n?.result===void 0?n?.error===void 0?`unknown`:`error`:`result`}function xH(e){return e.source===`widget`?e.direction===`send`?`Host → Widget`:`Widget → Host`:e.direction===`send`?`Inspector → MCP`:`MCP → Inspector`}function SH({serverId:e,open:t}){return(0,R.jsx)(`aside`,{"aria-label":`RPC Panel`,"aria-hidden":!t,className:L(`relative hidden min-h-0 shrink-0 flex-col overflow-hidden transition-[width,margin] duration-200 ease-out lg:flex`,t?`w-(--rpc-panel-width) lg:mr-[18px]`:`w-0 lg:mr-0`),children:(0,R.jsx)(`div`,{className:L(`flex h-full min-h-0 w-(--rpc-panel-width) flex-col transition-opacity duration-200 ease-out`,t?`opacity-100`:`pointer-events-none opacity-0`),children:(0,R.jsx)(vH,{serverIds:[e]})})})}function CH({...e}){return(0,R.jsx)(tL,{"data-slot":`sheet`,...e})}function wH(e){return(0,R.jsx)(rL,{"data-slot":`sheet-trigger`,...e})}function TH({...e}){return(0,R.jsx)(JI,{"data-slot":`sheet-portal`,...e})}function EH({className:e,container:t,...n}){return(0,R.jsx)(zI,{"data-slot":`sheet-overlay`,className:L(`inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0`,t?`absolute`:`fixed`,e),...n})}function DH({className:e,children:t,side:n=`right`,showCloseButton:r=!0,container:i,...a}){return(0,R.jsxs)(TH,{container:i??void 0,children:[(0,R.jsx)(EH,{container:i}),(0,R.jsxs)(qI,{"data-slot":`sheet-content`,"data-side":n,className:L(`z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,i?`absolute`:`fixed`,e),...a,children:[t,r&&(0,R.jsxs)(BI,{"data-slot":`sheet-close`,render:(0,R.jsx)(Gt,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,R.jsx)(Xi,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function OH({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`sheet-header`,className:L(`flex flex-col gap-1.5 p-4`,e),...t})}function kH({className:e,...t}){return(0,R.jsx)(nL,{"data-slot":`sheet-title`,className:L(`font-medium text-foreground`,e),...t})}function AH({className:e,...t}){return(0,R.jsx)(VI,{"data-slot":`sheet-description`,className:L(`text-sm text-muted-foreground`,e),...t})}var jH=`https://cdn.mcp-use.com/mcpuse_logo_circle_dark.svg`;function MH({symbolSize:e=14,className:t,textClassName:n}){return(0,R.jsxs)(`span`,{className:L(`inline-flex items-center gap-1.5`,t),children:[(0,R.jsx)(NH,{size:e}),(0,R.jsx)(`span`,{className:L(`font-medium leading-none text-black [font-family:var(--font-family-outfit)]`,n),children:`Manufact`})]})}function NH({size:e=14,className:t}){return(0,R.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 480 480`,"aria-hidden":!0,className:L(`block shrink-0`,t),children:[(0,R.jsx)(`path`,{d:`M101.7 0 C157.9 0 203.4 45.7 203.4 102.1 C203.4 126.6 202.1 152.1 212.2 174.3 L219.8 191 C233.8 221.8 258.5 246.4 289.2 260.5 L303.5 267 C326.5 277.5 353 275.8 378.3 275.8 C434.5 275.8 480 321.5 480 377.9 C480 434.3 434.5 480 378.3 480 C322.1 480 276.6 434.3 276.6 377.9 C276.6 354.2 277.7 329.6 267.8 308 L259.8 290.3 C245.7 259.5 221 234.8 190.2 220.7 L173 212.9 C151 202.9 125.8 204.2 101.7 204.2 C45.5 204.2 0 158.5 0 102.1 C0 45.7 45.5 0 101.7 0 Z`,fill:`currentColor`}),(0,R.jsx)(`circle`,{cx:`96.4`,cy:`383.6`,r:`96.4`,fill:`currentColor`}),(0,R.jsx)(`circle`,{cx:`383.6`,cy:`96.4`,r:`96.4`,fill:`currentColor`})]})}var PH=`data:image/svg+xml,%3Csvg%20width%3D%22512%22%20height%3D%22512%22%20viewBox%3D%220%200%20512%20512%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22%2394A3B8%22%20stroke%3D%22%2394A3B8%22%3E%3Cg%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M3%20248.945C18%20248.945%2076%20236%20106%20219C136%20202%20136%20202%20198%20158C276.497%20102.293%20332%20120.945%20423%20120.945%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M511%20121.5L357.25%20210.268L357.25%2032.7324L511%20121.5Z%22%2F%3E%3Cpath%20fill%3D%22none%22%20d%3D%22M0%20249C15%20249%2073%20261.945%20103%20278.945C133%20295.945%20133%20295.945%20195%20339.945C273.497%20395.652%20329%20377%20420%20377%22%20stroke-width%3D%2290%22%2F%3E%3Cpath%20d%3D%22M508%20376.445L354.25%20287.678L354.25%20465.213L508%20376.445Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E`,FH={openai:`OpenAI`,anthropic:`Anthropic`,google:`Google`};function IH(e){let t=e.split(`/`)[0]?.toLowerCase();return t===`openai`||t===`anthropic`||t===`google`?t:`openrouter`}function LH(e,t){let n=e.trim(),r=FH[t];if(r){let e=r.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),t=RegExp(`^${e}\\s*:\\s*`,`i`),i=n.replace(t,``).trim();if(i.length>0)return i}let i=n.indexOf(`: `);return i>0&&i<48?n.slice(i+2).trim():n}function RH({provider:e,model:t,displayName:n,mode:r=`byok`,className:i,...a}){let o=n??t,s=r===`managed`&&e===`openai-compatible`?IH(t):e;return(0,R.jsxs)(`button`,{type:`button`,className:L(`inline-flex items-center gap-1.5 min-w-0 border-0 bg-transparent p-1`,`font-mono text-[11px] text-muted-foreground cursor-pointer`,`hover:text-foreground transition-colors`,`rounded-md outline-none focus-visible:ring-1 focus-visible:ring-ring`,i),...a,children:[r===`managed`?(0,R.jsx)(`img`,{src:jH,alt:`Manufact`,className:`h-3.5 w-3.5 shrink-0 rounded-full object-cover`}):(0,R.jsx)(ci,{className:`size-3 shrink-0 opacity-70`,"aria-hidden":!0}),(0,R.jsx)(VH,{provider:s,className:`shrink-0`}),(0,R.jsx)(`span`,{className:`whitespace-nowrap`,children:o}),(0,R.jsx)(Ir,{className:`size-3 shrink-0 opacity-60`,"aria-hidden":!0})]})}function zH(e){switch(e){case`openai`:return`OpenAI`;case`openai-compatible`:return`OpenAI Compatible`;case`anthropic`:return`Anthropic`;case`google`:return`Google`;case`openrouter`:return`OpenRouter`;case`ollama`:return`Ollama`;default:return e}}function BH(e,t){switch(e){case`openai`:case`anthropic`:case`google`:return`https://inspector-cdn.mcp-use.com/providers/${e}.png`;case`ollama`:return`https://inspector-cdn.mcp-use.com/providers/${t===`dark`?`ollama_dark`:`ollama_light`}.png`;case`openrouter`:return PH;case`openai-compatible`:return null;default:return null}}function VH({provider:e,className:t}){let{resolvedTheme:n}=Fz();if(e===`openai-compatible`)return null;let r=BH(e,n);if(r){let n=e===`ollama`?`h-3.5 w-3.5 object-contain`:`h-4 w-4 rounded-full object-cover`;return(0,R.jsx)(`img`,{src:r,alt:zH(e),className:L(n,t)})}return(0,R.jsx)(`div`,{"aria-label":zH(e),className:L(`flex h-4 w-4 items-center justify-center rounded-full bg-neutral-900 text-[9px] font-semibold text-white dark:bg-neutral-100 dark:text-neutral-900`,t),children:zH(e).charAt(0)})}function HH({className:e}){return(0,R.jsx)(`svg`,{viewBox:`0 -28.5 256 256`,className:e,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0,children:(0,R.jsx)(`path`,{d:`M216.856339,16.5966031 C200.285002,8.84328665 182.566144,3.2084988 164.041564,0 C161.766523,4.11318106 159.108624,9.64549908 157.276099,14.0464379 C137.583995,11.0849896 118.072967,11.0849896 98.7430163,14.0464379 C96.9108417,9.64549908 94.1925838,4.11318106 91.8971895,0 C73.3526068,3.2084988 55.6133949,8.86399117 39.0420583,16.6376612 C5.61752293,67.146514 -3.4433191,116.400813 1.08711069,164.955721 C23.2560196,181.510915 44.7403634,191.567697 65.8621325,198.148576 C71.0772151,190.971126 75.7283628,183.341335 79.7352139,175.300261 C72.104019,172.400575 64.7949724,168.822202 57.8887866,164.667963 C59.7209612,163.310589 61.5131304,161.891452 63.2445898,160.431257 C105.36741,180.133187 151.134928,180.133187 192.754523,160.431257 C194.506336,161.891452 196.298154,163.310589 198.110326,164.667963 C191.183787,168.842556 183.854737,172.420929 176.223542,175.320965 C180.230393,183.341335 184.861538,190.991831 190.096624,198.16893 C211.238746,191.588051 232.743023,181.531619 254.911949,164.955721 C260.227747,108.668201 245.831087,59.8662432 216.856339,16.5966031 Z M85.4738752,135.09489 C72.8290281,135.09489 62.4592217,123.290155 62.4592217,108.914901 C62.4592217,94.5396472 72.607595,82.7145587 85.4738752,82.7145587 C98.3405064,82.7145587 108.709962,94.5189427 108.488529,108.914901 C108.508531,123.290155 98.3405064,135.09489 85.4738752,135.09489 Z M170.525237,135.09489 C157.88039,135.09489 147.510584,123.290155 147.510584,108.914901 C147.510584,94.5396472 157.658606,82.7145587 170.525237,82.7145587 C183.391518,82.7145587 193.761324,94.5189427 193.539891,108.914901 C193.539891,123.290155 183.391518,135.09489 170.525237,135.09489 Z`,fillRule:`nonzero`})})}var UH=`flex flex-1 items-center justify-center text-muted-foreground transition-colors hover:text-foreground active:text-foreground`;function WH({serverId:e,rpcLoggerOpen:t,onRpcLoggerOpenChange:n}){let r=NB(),{embeddedConfig:i}=EL(),{user:a}=mz(i.chatApiUrl),o=a?`https://manufact.com/cloud?ref=mcp-use-inspector`:`https://manufact.com/signup?ref=mcp-use-inspector`;return(0,R.jsxs)(R.Fragment,{children:[typeof document<`u`&&(0,br.createPortal)((0,R.jsxs)(`nav`,{"aria-label":`Inspector shortcuts`,className:`fixed inset-x-0 bottom-0 z-[100] flex items-center bg-transparent px-4 pt-(--mobile-chrome-gap) pb-[calc(var(--mobile-chrome-gap)+env(safe-area-inset-bottom))] lg:hidden`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:()=>n(!t),className:L(UH,t&&`text-foreground`),"aria-label":`RPC logs`,"aria-pressed":t,children:(0,R.jsx)(Pi,{className:`size-4 shrink-0`})}),(0,R.jsx)(`a`,{href:`https://github.com/mcp-use/mcp-use`,target:`_blank`,rel:`noopener noreferrer`,className:UH,"aria-label":`GitHub`,children:(0,R.jsx)(LB,{className:`size-4 shrink-0`})}),(0,R.jsx)(`a`,{href:`https://discord.gg/XkNkSkMz3V`,target:`_blank`,rel:`noopener noreferrer`,className:UH,"aria-label":`Discord`,children:(0,R.jsx)(HH,{className:`size-4 shrink-0`})}),(0,R.jsx)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>{try{PT(new Mo({referrer:`mcp-use-inspector-mobile-toolbar`})).catch(()=>{})}catch{}},className:UH,"aria-label":`manufact.com`,children:(0,R.jsx)(NH,{size:16})})]}),document.body),!r&&(0,R.jsx)(CH,{open:t,onOpenChange:n,children:(0,R.jsxs)(DH,{side:`bottom`,className:`z-[101] flex h-[min(85dvh,720px)] flex-col gap-0 rounded-t-2xl border-zinc-200 p-0 dark:border-zinc-700`,children:[(0,R.jsx)(OH,{className:`sr-only`,children:(0,R.jsx)(kH,{children:`RPC logs`})}),(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-2 pb-2 pt-1`,children:(0,R.jsx)(vH,{serverIds:e?[e]:void 0})})]})})]})}function GH(e){return`${e.replace(/\/+$/,``)}${pM()}`}function KH({tunnelUrl:e,tunnelMcpUrl:t,selectedServerId:n,selectedServer:r,configLoaded:i,removeConnection:a,updateConnection:o,connections:s}){let c=(0,z.useRef)(null),l=(0,z.useRef)(!1),u=(0,z.useRef)(null),[d,f]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{!d||r?.url!==u.current||r.state!==`ready`&&r.state!==`failed`||(f(!1),l.current=!1,u.current=null)},[d,r]),(0,z.useEffect)(()=>{n&&_M(n)?c.current=n:r?.url&&_M(r.url)&&(c.current=r.url)},[r?.url,n]),(0,z.useEffect)(()=>{if(!i||!n||!r||l.current)return;let d=r.url??``,p=_M(d),m=vM(d),h=t??(e?GH(e):null),g=null;e&&h&&p?g=h:!e&&m&&c.current&&(g=c.current),!(!g||g===d)&&(l.current=!0,u.current=g,f(!0),(async()=>{try{g!==n&&s.some(e=>e.id===g)&&await a(g),await o(n,PM({...IM(n)??FM(r),url:g}))}catch{f(!1),u.current=null,l.current=!1}})())},[i,s,a,r,n,t,e,o]),(0,z.useEffect)(()=>{d||(l.current=!1)},[d]),d}function qH({children:e}){let t=sP(),n=iP(),{servers:r,addServer:i,removeServer:a,updateServerMetadata:o,updateServer:s,storageLoaded:c}=Aj(),l=(0,z.useCallback)(async(e,t)=>{try{await s(e,PM(t)),AM(e,t)}catch(t){console.error(`[Layout] Failed to update connection ${e}:`,t)}},[s]),u=(0,z.useCallback)(async(e,t)=>{try{await o(e,t)}catch(t){console.error(`[Layout] Failed to update connection metadata for ${e}:`,t)}},[o]),{selectedServerId:d,setSelectedServerId:f,activeTab:p,setActiveTab:m,navigateToItem:h,setTunnelUrl:g,tunnelUrl:_,isEmbedded:v,embeddedConfig:y,setEmbeddedMode:b}=EL(),[x,S]=(0,z.useState)(!1),[C,w]=(0,z.useState)(()=>{try{return localStorage.getItem(`inspector-sidebar-collapsed`)===`true`}catch{return!1}}),[T,E]=(0,z.useState)(()=>{try{return localStorage.getItem(`inspector-rpc-logger-open`)===`true`}catch{return!1}});(0,z.useEffect)(()=>{try{localStorage.setItem(`inspector-sidebar-collapsed`,C?`true`:`false`)}catch{}},[C]),(0,z.useEffect)(()=>{try{localStorage.setItem(`inspector-rpc-logger-open`,String(T))}catch{}},[T]);let{savedRequests:ee}=kL();(0,z.useEffect)(()=>{let e=new URLSearchParams(n.search),t=e.get(`embedded`)===`true`,r=e.get(`embeddedConfig`);if(t){let e={};if(r)try{e=JSON.parse(r)}catch(e){console.error(`Failed to parse embeddedConfig:`,e)}b(!0,e),e.defaultTab&&m(e.defaultTab)}},[]),(0,z.useEffect)(()=>{let e=new URLSearchParams(n.search).get(`tunnelUrl`);e!==null&&g(e)},[n.search,g]),(0,z.useEffect)(()=>{let e=new URLSearchParams(n.search).get(`tab`);e&&[`tools`,`prompts`,`resources`,`chat`,`sampling`,`elicitation`,`notifications`,`server-metadata`,`connection-settings`].includes(e)&&m(e)},[n.search,m]);let D=(0,z.useRef)(null),te=(0,z.useRef)(Date.now()),ne=(0,z.useRef)(new Set),re=(0,z.useRef)(0);(0,z.useEffect)(()=>{let e=()=>{re.current++};return window.addEventListener(`mcp-tool-executed`,e),()=>window.removeEventListener(`mcp-tool-executed`,e)},[]),(0,z.useEffect)(()=>{let e=()=>{try{PT(new Io({durationSeconds:Math.round((Date.now()-te.current)/1e3),tabsVisited:ne.current.size,toolsExecuted:re.current})).catch(()=>{})}catch{}};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[]);let O=(0,z.useCallback)(e=>{try{PT(new Po({tab:e,previousTab:D.current})).catch(()=>{})}catch{}D.current=e,ne.current.add(e),m(e);let r=new URLSearchParams(n.search);r.set(`tab`,e),t(`/?${r.toString()}`,{replace:!0})},[m,t,n.search]);(0,z.useEffect)(()=>{let e=e=>{let t=e.detail.requestId;d&&h(d,`sampling`,t)},t=e=>{let t=e.detail.requestId;d&&h(d,`elicitation`,t)},n=e=>{let t=e.detail.toolName;d&&t?h(d,`tools`,t):d&&O(`tools`)};return window.addEventListener(`navigate-to-sampling`,e),window.addEventListener(`navigate-to-elicitation`,t),window.addEventListener(`navigate-to-tool-result`,n),()=>{window.removeEventListener(`navigate-to-sampling`,e),window.removeEventListener(`navigate-to-elicitation`,t),window.removeEventListener(`navigate-to-tool-result`,n)}},[d,O,h]);let ie=(0,z.useRef)(null),k=(0,z.useRef)(null),A=(0,z.useRef)(null),{isAutoConnecting:j}=EI({connections:r,addServer:i,removeConnection:a,configLoaded:c,embedded:v});(0,z.useEffect)(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`)?`#000000`:`#f3f3f3`;document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let ae=(0,z.useCallback)(e=>{PT(new ko({trigger:e})).catch(()=>{}),S(!0)},[]),oe=e=>{if(!r.find(t=>t.id===e))return;f(e);let i=new URLSearchParams(n.search),a=i.get(`tunnelUrl`),o=i.get(`tab`),s=new URLSearchParams;s.set(`server`,e),a&&s.set(`tunnelUrl`,a),o&&s.set(`tab`,o),t(`/?${s.toString()}`)},se=(0,z.useCallback)(e=>{if(!d)return;let t=IM(d)||r.find(e=>e.id===d);e.url===d?t&&zM(t,e)?(u(d,{name:e.name||e.url}),AM(d,e)):l(d,e):(a(d),i(e.url,PM(e))),oI.success(`Connection settings updated`)},[d,r,a,i,u,l]),ce=(e,i,a)=>{if(console.warn(`[Layout] handleCommandPaletteNavigate called:`,{tab:e,itemName:i,serverId:a}),a){let o=r.find(e=>e.id===a);if(console.warn(`[Layout] Server lookup:`,{serverId:a,serverFound:!!o,serverState:o?.state}),!o||o.state!==`ready`){console.warn(`[Layout] Server not ready, showing error`),oI.error(`Server is not connected and cannot be inspected`);return}console.warn(`[Layout] Calling navigateToItem:`,{serverId:a,tab:e,itemName:i}),h(a,e,i);let s=new URLSearchParams(n.search),c=s.get(`tunnelUrl`),l=s.get(`tab`),u=new URLSearchParams;u.set(`server`,a),c&&u.set(`tunnelUrl`,c),e?u.set(`tab`,e):l&&u.set(`tab`,l);let d=`/?${u.toString()}`;console.warn(`[Layout] Navigating to:`,d),t(d)}else console.warn(`[Layout] No serverId, just updating tab to:`,e),O(e)},M=r.find(e=>e.id===d),N=KH({tunnelUrl:_,selectedServerId:d,selectedServer:M,configLoaded:c,removeConnection:a,updateConnection:s,connections:r}),le=M?M.tools.map(e=>({...e,_serverId:M.id})):r.flatMap(e=>e.state===`ready`?e.tools.map(t=>({...t,_serverId:e.id,_serverName:bM(e)})):[]),ue=M?M.prompts.map(e=>({...e,_serverId:M.id})):r.flatMap(e=>e.state===`ready`?e.prompts.map(t=>({...t,_serverId:e.id,_serverName:bM(e)})):[]),de=M?M.resources.map(e=>({...e,_serverId:M.id})):r.flatMap(e=>e.state===`ready`?e.resources.map(t=>({...t,_serverId:e.id,_serverName:bM(e)})):[]);(0,z.useEffect)(()=>{if(N)return;let e=new URLSearchParams(n.search),i=e.get(`server`);if(i&&(i.startsWith(`http://`)||i.startsWith(`https://`))&&!r.find(e=>e.id===i)){let n=new URLSearchParams(e);n.delete(`server`),n.set(`autoConnect`,i),t(`/?${n.toString()}`,{replace:!0});return}i!==d&&f(i)},[n.search,d,f,r,t,N]),(0,z.useEffect)(()=>{if(N)return;let e=new URLSearchParams(n.search).get(`server`);if(e&&!r.find(t=>t.id===e)){let e=setTimeout(()=>t(`/`),3e3);return()=>clearTimeout(e)}},[n.search,t,r,N]),(0,z.useEffect)(()=>{if(!v)return;let e=e=>{if(!e.data||typeof e.data!=`object`||e.data.type!==`mcp-inspector:connect_servers`)return;let t=e.data.servers;if(!Array.isArray(t)||t.length===0)return;let n=null;for(let e of t){if(!e.url||typeof e.url!=`string`)continue;let t=e.url,a=e.name??`Server`,o={...e.headers??{}};if(e.auth?.access_token){let t=e.auth.token_type||`bearer`;o.Authorization=`${t.charAt(0).toUpperCase()+t.slice(1)} ${e.auth.access_token}`}let s=typeof e.proxyConfig?.proxyAddress==`string`?e.proxyConfig.proxyAddress.trim():``,c=``;try{new URL(t).origin!==window.location.origin&&(c=TM())}catch{c=TM()}let l=s||c,u=EM(e.connectionMode,e.connectionType,!!s),d=PM({url:t,name:a,transportType:`http`,connectionMode:u,protocolNegotiation:CM(wM(e.protocolNegotiation)),connectionType:u===`proxy`?`Via Proxy`:`Direct`,proxyConfig:u===`proxy`&&l?{proxyAddress:l,...Object.keys(o).length>0?{headers:o}:{}}:void 0,headers:o,autoProxyFallback:u===`auto`&&l?{enabled:!0,proxyAddress:l}:!1});r.find(e=>e.url===t)||i(t,d),n||=t}window.parent!==window&&window.parent.postMessage({type:`mcp-inspector:servers_connected`,count:t.length},`*`)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[v,r,i]);let fe=(0,z.useRef)(!1);(0,z.useEffect)(()=>{if(!v||fe.current||d)return;let e=r.find(e=>e.state===`ready`);if(e){fe.current=!0,f(e.id);let r=new URLSearchParams(n.search);r.set(`server`,e.id),t(`/?${r.toString()}`,{replace:!0})}},[v,r,d,f,t,n.search]),DL({onCommandPalette:()=>ae(`keyboard`),onToolsTab:()=>{M&&O(`tools`)},onPromptsTab:()=>{M&&O(`prompts`)},onResourcesTab:()=>{M&&O(`resources`)},onChatTab:()=>{M&&O(`chat`)},onHome:()=>{t(`/`)},onFocusSearch:()=>{p===`tools`&&ie.current?ie.current.focusSearch():p===`prompts`&&k.current?k.current.focusSearch():p===`resources`&&A.current&&A.current.focusSearch()},onBlurSearch:()=>{p===`tools`&&ie.current?ie.current.blurSearch():p===`prompts`&&k.current?k.current.blurSearch():p===`resources`&&A.current&&A.current.blurSearch()}});let pe=new URLSearchParams(n.search).get(`server`),me=!c&&!!pe&&!pe.startsWith(`http://`)&&!pe.startsWith(`https://`),he=j||me||N,ge=M?.id??`home`,_e=he?`boot`:ge,[ve,ye]=(0,z.useState)(_e);(0,z.useLayoutEffect)(()=>{if(_e===ve)return;let e=()=>(0,br.flushSync)(()=>ye(_e));typeof document.startViewTransition==`function`?document.startViewTransition(e):e()},[_e,ve]);let be=ve===`boot`,xe=be||ve===`home`?void 0:r.find(e=>e.id===ve),P=v&&y.singleTab,Se=v?{backgroundColor:y.backgroundColor||`#f3f3f3`,padding:P?`0`:y.padding||`0.5rem`}:{},Ce=v?P?`h-screen flex flex-col`:`h-screen flex flex-col gap-2 sm:gap-4`:`h-screen bg-[#f3f3f3] dark:bg-black flex flex-col overflow-x-hidden px-4 lg:px-0 pb-[calc(var(--mobile-toolbar-height)+env(safe-area-inset-bottom))] lg:pb-4`,we=P?`flex-1 w-full bg-white dark:bg-black p-0 overflow-auto`:L(`flex-1 min-h-0 min-w-0 max-w-full w-full bg-white dark:bg-black rounded-2xl border border-zinc-200 dark:border-zinc-700 overflow-x-hidden overflow-y-auto`,!xe&&`lg:mx-4`,xe&&`lg:mr-4`);return(0,R.jsxs)(Ve,{children:[(0,R.jsx)(`div`,{className:`inspector-view-transition h-screen overflow-x-hidden bg-[#f3f3f3] dark:bg-black`,children:be?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center bg-[#f3f3f3] dark:bg-black`,children:(0,R.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,R.jsx)(bL,{className:`h-8 w-8 text-zinc-600 dark:text-zinc-400`}),(0,R.jsx)(`p`,{className:`text-sm text-zinc-600 dark:text-zinc-400`,children:`Connecting to MCP server...`})]})}):(0,R.jsxs)(`div`,{className:Ce,style:Se,children:[!P&&(0,R.jsx)(FB,{connections:r,selectedServer:xe,activeTab:p,onServerSelect:oe,onTabChange:O,embedded:v,sidebarCollapsed:C}),(0,R.jsxs)(`div`,{className:P?`flex-1 min-h-0`:`flex min-w-0 flex-1 min-h-0 overflow-hidden`,children:[xe&&!P&&(0,R.jsx)(CV,{activeTab:p,onTabChange:O,selectedServer:xe,visibleTabs:y.visibleTabs,collapsed:C,onCollapsedChange:w,rpcLoggerOpen:T,onRpcLoggerOpenChange:E,onCommandPaletteOpen:()=>ae(`button`)}),(0,R.jsx)(`main`,{className:we,children:(0,R.jsx)(az,{selectedServer:xe,activeTab:p,toolsSearchRef:ie,promptsSearchRef:k,resourcesSearchRef:A,onUpdateConnection:se,children:e})}),xe&&!P&&(0,R.jsx)(SH,{serverId:xe.id,open:T})]})]})}),!P&&!be&&(0,R.jsx)(WH,{serverId:xe?.id,rpcLoggerOpen:T,onRpcLoggerOpenChange:E}),(0,R.jsx)(KL,{isOpen:x,onOpenChange:S,tools:le,prompts:ue,resources:de,savedRequests:ee,connections:r,selectedServer:M,tunnelUrl:_,onNavigate:ce,onServerSelect:oe})]})}function JH({...e}){let{resolvedTheme:t}=Fz();return(0,R.jsx)(xI,{theme:t,className:`toaster group`,style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`},...e})}var YH=(0,z.createContext)(void 0),XH={deviceType:`desktop`,customViewport:{width:768,height:1024},cspMode:`permissive`,displayModeOverride:null,capabilities:{hover:!0,touch:!1},safeAreaInsets:{top:0,right:0,bottom:0,left:0},locale:`en-US`,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`};function ZH({children:e}){let[t,n]=(0,z.useState)({activeWidgetId:null,widgets:new Map,playground:XH}),r=(0,z.useCallback)(e=>{n(t=>({...t,activeWidgetId:e}))},[]),i=(0,z.useCallback)((e,t)=>{n(n=>{if(n.widgets.has(e))return n;let r=new Map(n.widgets);return r.set(e,{...t,cspViolations:[]}),{...n,widgets:r}})},[]),a=(0,z.useCallback)(e=>{n(t=>{let n=new Map(t.widgets);return n.delete(e),{...t,widgets:n,activeWidgetId:t.activeWidgetId===e?null:t.activeWidgetId}})},[]),o=(0,z.useRef)(t);o.current=t;let s=(0,z.useCallback)(e=>o.current.widgets.get(e),[]),c=(0,z.useCallback)((e,t)=>{n(n=>{let r=n.widgets.get(e);if(!r)return n;let i={cspViolations:[...r.cspViolations,t]};t.originalPolicy&&r.effectivePolicy===void 0&&(i.effectivePolicy=t.originalPolicy);let a=new Map(n.widgets);return a.set(e,{...r,...i}),{...n,widgets:a}})},[]),l=(0,z.useCallback)(e=>{n(t=>{let n=t.widgets.get(e);if(!n)return t;let r=new Map(t.widgets);return r.set(e,{...n,cspViolations:[]}),{...t,widgets:r}})},[]),u=(0,z.useCallback)((e,t)=>{n(n=>{let r=n.widgets.get(e);if(!r)return n;let i=new Map(n.widgets);return i.set(e,{...r,modelContext:t}),{...n,widgets:i}})},[]),d=(0,z.useCallback)((e,t)=>{n(n=>{let r=n.widgets.get(e);if(!r)return n;let i=new Map(n.widgets);return i.set(e,{...r,widgetState:t}),{...n,widgets:i}})},[]),f=(0,z.useCallback)((e,t,r)=>{n(n=>{let i=n.widgets.get(e);if(!i)return n;let a=new Map(n.widgets);return a.set(e,{...i,declaredCsp:t,...r!==void 0&&{effectivePolicy:r}}),{...n,widgets:a}})},[]),p=(0,z.useCallback)(e=>{n(t=>({...t,playground:{...t.playground,...e}}))},[]),m=(0,z.useCallback)(()=>{n(e=>({...e,widgets:new Map,activeWidgetId:null}))},[]),h=(0,z.useCallback)(()=>{let e=new Map;for(let[n,r]of t.widgets)r.modelContext&&e.set(n,r.modelContext);return e},[t.widgets]);return(0,R.jsx)(YH,{value:(0,z.useMemo)(()=>({...t,setActiveWidget:r,addWidget:i,removeWidget:a,getWidget:s,addCspViolation:c,clearCspViolations:l,setWidgetModelContext:u,setWidgetState:d,setWidgetDeclaredCsp:f,updatePlaygroundSettings:p,clearAllWidgets:m,getAllModelContexts:h}),[t,r,i,a,s,c,l,u,d,f,p,m,h]),children:e})}function QH(){let e=(0,z.use)(YH);if(!e)throw Error(`useWidgetDebug must be used within WidgetDebugProvider`);return e}var $H={mobile:{width:390,height:844,name:`iPhone 14`},desktop:{width:1440,height:900,name:`Desktop`}},eU=(0,z.lazy)(()=>lS(()=>import(`./OAuthCallback-Dv_mFcua.js`).then(e=>({default:e.OAuthCallback})),__vite__mapDeps([39,1,3]))),tU=(0,z.lazy)(()=>lS(()=>import(`./ManufactOAuthCallback-BnWhf5bW.js`).then(e=>({default:e.ManufactOAuthCallback})),__vite__mapDeps([40,1,3]))),nU=(0,z.lazy)(()=>lS(()=>import(`./ViewPreview-C_LJdgt9.js`).then(e=>({default:e.ViewPreview})),__vite__mapDeps([41,1,3,18,2])));function rU({activeTabRef:e}){let{activeTab:t}=EL();return(0,z.useEffect)(()=>{e.current=t},[t,e]),null}function iU(){let e=(0,z.useRef)(`tools`),t=new URLSearchParams(window.location.search),n=t.get(`embedded`)===`true`,r=t.get(`theme`),i=(0,z.useMemo)(()=>n?void 0:new BM(`mcp-inspector-connections`),[n]),a=TM(),o=a?.replace(/\/proxy\/?$/,`/oauth`),s=mM();return(0,z.useEffect)(()=>{MT()},[]),(0,z.useEffect)(()=>{let e=t.get(`auth_error`);if(!e)return;let n=t.get(`auth_error_description`);oI.error(`OAuth authentication failed: ${n||e}`,{duration:1/0,closeButton:!0});let r=new URLSearchParams(t);r.delete(`auth_error`),r.delete(`auth_error_description`);let i=r.toString();window.history.replaceState({},``,`${window.location.pathname}${i?`?${i}`:``}`)},[]),(0,R.jsx)(Iz,{forcedTheme:r||void 0,children:(0,R.jsx)(Jt,{defaultShape:`pill`,children:(0,R.jsx)(ZH,{children:(0,R.jsx)(kj,{storageProvider:i,enableRpcLogging:!0,defaultCallbackUrl:`${window.location.origin}${s}/oauth/callback`,defaultOAuthProxyUrl:o,defaultAutoProxyFallback:a?{enabled:!0,proxyAddress:a}:!1,defaultServerConfig:{preventAutoAuth:!0,useRedirectFlow:!0},clientInfo:{name:`mcp-use Inspector`,version:Lo(),websiteUrl:`https://mcp-use.com`,icons:[{src:`https://mcp-use.com/logo.png`}],capabilities:{extensions:{"io.modelcontextprotocol/ui":{mimeTypes:[`text/html;profile=mcp-app`]}}}},onServerAdded:(e,t)=>{console.log(`[Inspector] Server added:`,e,t.state)},onServerRemoved:e=>{console.log(`[Inspector] Server removed:`,e)},onServerStateChange:(e,t)=>{console.log(`[Inspector] Server state changed:`,e,t)},onSamplingRequest:(e,t,n,r,i)=>{let a=oI((0,R.jsx)(Fn,{title:`Sampling Request Received`,description:`New request from ${n}`,actions:[{label:`View Details`,testId:`sampling-toast-view-details`,onClick:()=>{let t=new CustomEvent(`navigate-to-sampling`,{detail:{requestId:e.id}});window.dispatchEvent(t),oI.dismiss(a)}},{label:`Approve`,testId:`sampling-toast-approve`,onClick:()=>{r(e.id,In),oI.success(`Sampling request approved`),oI.dismiss(a)}},{label:`Deny`,testId:`sampling-toast-deny`,onClick:()=>{i(e.id,`User denied from toast`),oI.dismiss(a)}}]}),{duration:1/0})},onElicitationRequest:(t,n,r,i,a)=>{if(e.current===`chat`)return;let o=t.request.mode||`form`,s=t.request.message,c=o===`url`&&`url`in t.request?t.request.url:void 0,l=oI((0,R.jsx)(Fn,{title:`Elicitation Request Received`,description:`From ${r}: ${s}`,extra:o===`url`&&c?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 font-mono`,children:c}):void 0,actions:[{label:`View Details`,testId:`elicitation-toast-view-details`,onClick:()=>{let e=new CustomEvent(`navigate-to-elicitation`,{detail:{requestId:t.id}});window.dispatchEvent(e),oI.dismiss(l)}},...o===`url`&&c?[{label:`Open URL`,testId:`elicitation-toast-open-url`,onClick:()=>{window.open(c,`_blank`),oI.dismiss(l)}}]:[],{label:`Cancel`,testId:`elicitation-toast-cancel`,onClick:()=>{a(t.id,`User cancelled from toast`),oI.dismiss(l)}}]}),{duration:1/0})},children:(0,R.jsxs)(TL,{children:[(0,R.jsx)(rU,{activeTabRef:e}),(0,R.jsx)(wF,{basename:s,children:(0,R.jsxs)(FP,{children:[(0,R.jsx)(NP,{path:`/oauth/callback`,element:(0,R.jsx)(JR,{children:(0,R.jsx)(eU,{})})}),(0,R.jsx)(NP,{path:`/auth/callback`,element:(0,R.jsx)(JR,{children:(0,R.jsx)(tU,{})})}),(0,R.jsx)(NP,{path:`/preview/:view`,element:(0,R.jsx)(JR,{children:(0,R.jsx)(nU,{})})}),(0,R.jsx)(NP,{path:`/`,element:(0,R.jsx)(qH,{children:(0,R.jsx)(CL,{})})})]})}),(0,R.jsx)(JH,{position:`top-center`})]})})})})})}var aU=document.getElementById(`root`);aU?Pn.createRoot(aU).render((0,R.jsx)(iU,{})):console.error(`[inspector] Root element not found`);export{zI as $,Wi as $t,mz as A,Q as At,uL as B,go as Bt,TV as C,Mr as Cn,qj as Ct,_B as D,Aj as Dt,hB as E,_r as En,gj as Et,bL as F,Eo as Ft,hL as G,Ya as Gt,mL as H,vo as Ht,yL as I,wo as It,eL as J,Xa as Jt,lL as K,Za as Kt,vL as L,Co as Lt,kL as M,Bb as Mt,DL as N,Cf as Nt,gB as O,PT as Ot,EL as P,No as Pt,BI as Q,Gi as Qt,cL as R,So as Rt,jV as S,Fr as Sn,oM as St,HB as T,vr as Tn,Jj as Tt,dL as U,mo as Ut,gL as V,bo as Vt,pL as W,ro as Wt,qI as X,Xi as Xt,JI as Y,Ia as Yt,VI as Z,Yi as Zt,ZV as _,Yr as _n,xM as _t,VH as a,xi as an,kI as at,VV as b,Vr as bn,lM as bt,CH as c,fi as cn,FF as ct,OH as d,ai as dn,IM as dt,zi as en,PI as et,kH as f,ri as fn,wM as ft,QV as g,Xr as gn,bM as gt,$V as h,Zr as hn,yM as ht,RH as i,Ti as in,OI as it,NR as j,lS as jt,Fz as k,KC as kt,DH as l,ci as ln,jM as lt,mH as m,$r as mn,FM as mt,QH as n,Ai as nn,jI as nt,LH as o,bi as on,oI as ot,wH as p,ti as pn,CM as pt,nL as q,$a as qt,MH as r,ki as rn,AI as rt,zH as s,yi as sn,lP as st,$H as t,Ii as tn,DI as tt,AH as u,si as un,TM as ut,qV as v,qr as vn,pM as vt,nV as w,jr as wn,Yj as wt,AV as x,Ir as xn,uM as xt,KV as y,Wr as yn,hM as yt,fL as z,Ao as zt};
|