@decocms/mesh 1.0.13 → 1.0.15
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/client/assets/{AlertCircle-zCOLtXNG.js → AlertCircle-DaEUMwle.js} +1 -1
- package/dist/client/assets/{ArrowLeft-b0UM4Vui.js → ArrowLeft-CvFDkdiU.js} +1 -1
- package/dist/client/assets/{Calendar-Cxw5FKll.js → Calendar-DBqzL4c-.js} +1 -1
- package/dist/client/assets/{CheckCircle-U8-nit8x.js → CheckCircle-CILz6OCh.js} +1 -1
- package/dist/client/assets/{ChevronDown-BFYjmmoG.js → ChevronDown-g4L12M9A.js} +1 -1
- package/dist/client/assets/{Clock-qZko4uak.js → Clock-C-uwthk9.js} +1 -1
- package/dist/client/assets/{Copy01-XN5V21c6.js → Copy01-CHjgpWtl.js} +1 -1
- package/dist/client/assets/{CpuChip02-Nhk4zHXl.js → CpuChip02-DlCI7cQJ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CcNQsTaW.js → DotsVertical-CIfapH0j.js} +1 -1
- package/dist/client/assets/{File06-DB55FK-Z.js → File06-CBkqKj5m.js} +1 -1
- package/dist/client/assets/{GitBranch01-CM-ab6hS.js → GitBranch01-Ci5lqvRi.js} +1 -1
- package/dist/client/assets/{Inbox01-CIzt2AdR.js → Inbox01-DCkU3Xgq.js} +1 -1
- package/dist/client/assets/{InfoCircle-ChxTTkMX.js → InfoCircle-BwNsGATl.js} +1 -1
- package/dist/client/assets/{Key01-DYiMWoz_.js → Key01-5nxXQgMM.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CBZhTXC0.js → LinkExternal01-ISpHuMJE.js} +1 -1
- package/dist/client/assets/{Loading01-Dtm2TLlA.js → Loading01-r04aEG5T.js} +1 -1
- package/dist/client/assets/{Plus-DF_I5mml.js → Plus-CS_Y2Vnc.js} +1 -1
- package/dist/client/assets/{SearchMd-C_ak4ze3.js → SearchMd-1Gq7nypQ.js} +1 -1
- package/dist/client/assets/{Terminal-4DdepWh9.js → Terminal-DYN6gEAz.js} +1 -1
- package/dist/client/assets/{Trash01-FYPMjpVf.js → Trash01-DVxmznxT.js} +1 -1
- package/dist/client/assets/{Upload01-BYeEw9Vy.js → Upload01-Da0sGkRE.js} +1 -1
- package/dist/client/assets/{X-BTsWwO_U.js → X-BX0rl0N7.js} +1 -1
- package/dist/client/assets/{XClose-CY6vd_0A.js → XClose-BUuGHVgA.js} +1 -1
- package/dist/client/assets/{alert-dialog-DhxQ40TA.js → alert-dialog-DdP064l-.js} +1 -1
- package/dist/client/assets/{auth-CfgXQhXI.js → auth-AUS48lXs.js} +1 -1
- package/dist/client/assets/{auth-catchall-CohlC3Pb.js → auth-catchall-DqCIX1bA.js} +1 -1
- package/dist/client/assets/{avatar-CcUZFpwU.js → avatar-bcdjVFyi.js} +1 -1
- package/dist/client/assets/{badge-CgUwfcKq.js → badge-1WraHGEG.js} +1 -1
- package/dist/client/assets/{button-DuitHSR8.js → button-DodNLkpL.js} +1 -1
- package/dist/client/assets/{card-DkEpNms8.js → card-BHz-BqEu.js} +1 -1
- package/dist/client/assets/{checkbox-DTaSeum9.js → checkbox-Bj9jBMQF.js} +1 -1
- package/dist/client/assets/{collection-detail-Dvc6iyHF.js → collection-detail-QGbMDWA7.js} +1 -1
- package/dist/client/assets/{collection-display-button-DgDdVSTg.js → collection-display-button-475jHotV.js} +1 -1
- package/dist/client/assets/{collection-header-D-wXFMG4.js → collection-header-DcpyPzrC.js} +1 -1
- package/dist/client/assets/{collection-page-AFIAghtr.js → collection-page-DpUZNbpd.js} +1 -1
- package/dist/client/assets/{collection-search-OoKPetka.js → collection-search-DVBnlN6E.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DEVlTpj8.js → collection-table-wrapper-DQ4F9pbh.js} +1 -1
- package/dist/client/assets/{connection-card-CVX6Dj6b.js → connection-card-opsQBUfD.js} +1 -1
- package/dist/client/assets/{connection-detail-C_uPOJ6z.js → connection-detail-DpiL6xjK.js} +1 -1
- package/dist/client/assets/{connections-DoAE9QhX.js → connections-CeDc3J_o.js} +1 -1
- package/dist/client/assets/{core-BMfBj0bw.js → core-DJoPglro.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-C_xVF_Jl.js → create-organization-dialog-fbCy_hNu.js} +1 -1
- package/dist/client/assets/{dialog-Dl9CupEb.js → dialog-BqvvzTa7.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CPQpNQmn.js → dropdown-menu-DrQKdl4f.js} +1 -1
- package/dist/client/assets/{env-vars-editor-BcyBU5xA.js → env-vars-editor-DEYac6H7.js} +1 -1
- package/dist/client/assets/{error-boundary-DMJQCmxn.js → error-boundary-CdmYlIj7.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bt1_1dQ8.js → extract-connection-data-Ty2DjF1e.js} +1 -1
- package/dist/client/assets/{form-BfiwCHdz.js → form-Bus-fIfC.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-BmkU67cZ.js → formatDistanceToNow-D46rGC8T.js} +1 -1
- package/dist/client/assets/{gateway-detail-ZknLelfM.js → gateway-detail-fCVh3_nF.js} +1 -1
- package/dist/client/assets/{gateways-BAQA-e5y.js → gateways-DQmZoxNy.js} +1 -1
- package/dist/client/assets/{home-BzOK0WeX.js → home-heelYyW2.js} +1 -1
- package/dist/client/assets/{index-CCNaUj2A.js → index-A52jfksK.js} +2 -2
- package/dist/client/assets/{index-DR-B7Y1Z.js → index-DDiLOLYT.js} +1 -1
- package/dist/client/assets/index-DKrh5SL2.css +1 -0
- package/dist/client/assets/{index-T7OaHK12.js → index-JV0IIYp6.js} +1 -1
- package/dist/client/assets/{index-be58e1VX.js → index-td_4XAxf.js} +1 -1
- package/dist/client/assets/{input-YU6lpVgW.js → input-BXHWk19m.js} +1 -1
- package/dist/client/assets/json-gPxhilNK.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-Dve1WRV4.js → json-syntax-highlighter-i1hiMNnF.js} +2 -2
- package/dist/client/assets/{layout-n40g10Oh.js → layout-dxbGsEKV.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-BY_mRZdt.js → lazy-highlighter-QDCjbXst.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BphvZ-YX.js → localstorage-keys-D7pZSS7H.js} +1 -1
- package/dist/client/assets/{login-CJi6KFGq.js → login-CcnR2b1q.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CvO1Z13d.js → mcp-oauth-D7V7V-GS.js} +1 -1
- package/dist/client/assets/{members-UHyk3Nn4.js → members-D5QtYSzf.js} +1 -1
- package/dist/client/assets/{monitoring-65mgE8O0.js → monitoring-Cp92YRPy.js} +1 -1
- package/dist/client/assets/{oauth-callback-KqixmXKf.js → oauth-callback-1_PgXFG_.js} +1 -1
- package/dist/client/assets/{page-DmmG4y1n.js → page-C8KGQPlY.js} +1 -1
- package/dist/client/assets/{popover-PTQF8Dbg.js → popover-MhzpcVkW.js} +1 -1
- package/dist/client/assets/prism-light-C-ukkBST.js +1 -0
- package/dist/client/assets/{resizable-BF9gWgPg.js → resizable-B3HA_CX4.js} +3 -3
- package/dist/client/assets/{resource-tabs-Dx5v9tHv.js → resource-tabs-ru5yaRIE.js} +1 -1
- package/dist/client/assets/{select-C4QWjnSz.js → select-Be0LRVWn.js} +1 -1
- package/dist/client/assets/{settings-UndPSfwX.js → settings-gZFi_2QA.js} +1 -1
- package/dist/client/assets/shell-layout-adVEIdhn.js +17 -0
- package/dist/client/assets/{spinner-CNb2mD_9.js → spinner-oZ2DO2-U.js} +1 -1
- package/dist/client/assets/store-DzO4PTg0.js +1 -0
- package/dist/client/assets/{store-app-detail-BQ4UUaoG.js → store-app-detail-BIXt1EdE.js} +1 -1
- package/dist/client/assets/{switch-BmVnuO_C.js → switch-DsCvClV8.js} +1 -1
- package/dist/client/assets/{tools-list-BV-qlQqF.js → tools-list-BsHebq88.js} +1 -1
- package/dist/client/assets/{tooltip-CqCXb38Z.js → tooltip-BjhP6ibY.js} +1 -1
- package/dist/client/assets/{types-Bm46njUN.js → types-D4T3qWDr.js} +1 -1
- package/dist/client/assets/{use-binding-DdwsXkNS.js → use-binding-CapMpNVF.js} +1 -1
- package/dist/client/assets/{use-connection-BbvAiBvg.js → use-connection-BX5-4xHw.js} +1 -1
- package/dist/client/assets/{use-connection-resources-D-1-SK-8.js → use-connection-resources-FqHsvBSA.js} +1 -1
- package/dist/client/assets/{use-gateway-L1UQyU7-.js → use-gateway-CseaalWF.js} +1 -1
- package/dist/client/assets/{use-list-state-DVYCFUpb.js → use-list-state-7NLbXyOC.js} +1 -1
- package/dist/client/assets/{use-mcp-CWOlOW9q.js → use-mcp-M6XXMHar.js} +1 -1
- package/dist/client/assets/{use-members-Dyh_-7GU.js → use-members-DzZB15s9.js} +1 -1
- package/dist/client/assets/{use-mobile-B0xRFGhT.js → use-mobile-TpeNqylz.js} +1 -1
- package/dist/client/assets/{use-organization-settings-fWTyw7VB.js → use-organization-settings-BAhAEDx8.js} +1 -1
- package/dist/client/assets/{use-tool-call-CVPTtLoG.js → use-tool-call-CQCb5PBf.js} +1 -1
- package/dist/client/assets/useQuery-ojqdZMTH.js +1 -0
- package/dist/client/assets/utils-DgLfrg3u.js +1 -0
- package/dist/client/assets/{view-mode-toggle-DOtHoBLN.js → view-mode-toggle-DAXMt6ZW.js} +1 -1
- package/dist/client/assets/well-known-mcp-BPQQU1v0.js +1 -0
- package/dist/client/empty-state-openrouter.svg +320 -0
- package/dist/client/emptystate-mcp.svg +26 -70
- package/dist/client/index.html +2 -2
- package/dist/client/store-empty-state.svg +96 -349
- package/dist/server/cli.js +112 -112
- package/dist/server/server.js +105 -105
- package/package.json +1 -1
- package/dist/client/assets/index-Dgn6D_6Q.css +0 -1
- package/dist/client/assets/json-BnmF_c7J.js +0 -1
- package/dist/client/assets/prism-light-0RxCg8xt.js +0 -1
- package/dist/client/assets/shell-layout-BLjMALRt.js +0 -17
- package/dist/client/assets/store-CGyOcqhE.js +0 -1
- package/dist/client/assets/useQuery-C4GPpw7d.js +0 -1
- package/dist/client/assets/utils-o1atviYh.js +0 -1
- package/dist/client/assets/well-known-mcp-d1wcdFCF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aw as Tt,r as N,c as L,d as Mn,j as p,av as Fi,w as op,x as Gc,s as ip,v as wo,h as lp,b as ap,t as li,E as Y,M as cp,ax as So,ay as Yc,al as up,ak as dp,az as fp,F as Vi,a5 as Xc,a8 as hp,z as On,B as ze,a2 as Hi,a9 as pp,y as Fs,a6 as mp,a1 as Wi,af as gp,ag as yp,ah as xp,aA as qi,aB as bp,a7 as Qc,a4 as vp,aC as kp,J as wp,aD as Sp,aE as Cp}from"./index-CCNaUj2A.js";import{U as Ke,f as Ui,d as Ki,c as Mt,b as Ji,I as Vs,u as Np,n as Ep}from"./use-connection-BbvAiBvg.js";import{d as Tp,C as an,e as Mp,I as Op,l as ta,G as Zc,M as Ap,m as Ip,R as na,k as jp}from"./resizable-BF9gWgPg.js";import{E as Hs,i as Rp}from"./SearchMd-C_ak4ze3.js";import{E as nr}from"./error-boundary-DMJQCmxn.js";import{u as Dp,L as Pp}from"./localstorage-keys-BphvZ-YX.js";import{u as Lp,a as eu,c as tu,b as nu,T as ru,i as Gi}from"./tooltip-CqCXb38Z.js";import{B as ie}from"./button-DuitHSR8.js";import{F as nt,a as su,b as Ot,c as mr,d as An}from"./form-BfiwCHdz.js";import{I as In}from"./input-YU6lpVgW.js";import{T as Ur,D as $p,a as _p,b as zp,f as Bp,c as Fp,d as Vp}from"./dialog-Dl9CupEb.js";import{c as G}from"./utils-o1atviYh.js";import{A as Hp,D as Wp,u as qp}from"./use-binding-DdwsXkNS.js";import{i as Ct}from"./Loading01-Dtm2TLlA.js";import{s as Yi}from"./Plus-DF_I5mml.js";import{i as Up}from"./Upload01-BYeEw9Vy.js";import{V as Xi,b as Kr,a as ou}from"./layout-n40g10Oh.js";import{i as Kp}from"./AlertCircle-zCOLtXNG.js";import{s as Jp}from"./Clock-qZko4uak.js";import{a as Gp}from"./Copy01-XN5V21c6.js";import{i as Qi,J as Yp}from"./json-syntax-highlighter-Dve1WRV4.js";import{s as Zi,i as iu}from"./XClose-CY6vd_0A.js";import{u as Xp,O as Qp,M as Zp,P as em,F as tm,v as nm,E as rm}from"./index-be58e1VX.js";import{u as el}from"./use-mcp-CWOlOW9q.js";import{S as Yt}from"./spinner-CNb2mD_9.js";import{a as lu,b as sm}from"./use-tool-call-CVPTtLoG.js";import{V as om}from"./view-mode-toggle-DOtHoBLN.js";import{i as im}from"./ArrowLeft-b0UM4Vui.js";import{i as lm}from"./GitBranch01-CM-ab6hS.js";import"./index-DR-B7Y1Z.js";import{n as am}from"./Calendar-Cxw5FKll.js";import{b as cm,D as um,a as dm,d as ra,i as fm}from"./dropdown-menu-CPQpNQmn.js";import{B as cn}from"./badge-CgUwfcKq.js";import{i as au}from"./X-BTsWwO_U.js";import"./CpuChip02-Nhk4zHXl.js";import"./select-C4QWjnSz.js";import"./ChevronDown-BFYjmmoG.js";import"./use-mobile-B0xRFGhT.js";import"./use-gateway-L1UQyU7-.js";import"./Terminal-4DdepWh9.js";import"./connection-card-CVX6Dj6b.js";import"./card-DkEpNms8.js";import"./LinkExternal01-CBZhTXC0.js";import"./File06-DB55FK-Z.js";import"./InfoCircle-ChxTTkMX.js";import"./useQuery-C4GPpw7d.js";import"./auth-CfgXQhXI.js";import"./mcp-oauth-CvO1Z13d.js";import"./use-organization-settings-fWTyw7VB.js";import"./env-vars-editor-BcyBU5xA.js";import"./Trash01-FYPMjpVf.js";import"./Key01-DYiMWoz_.js";import"./formatDistanceToNow-BmkU67cZ.js";import"./extract-connection-data-Bt1_1dQ8.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-T7OaHK12.js";const cu=Tt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const uu=Tt("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const hm=Tt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const pm=Tt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const du=Tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const fu=Tt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const hu=Tt("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const pu=Tt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),tl=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));tl.displayName="AlertOctagon";const mu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));mu.displayName="Box";const gu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));gu.displayName="ClockFastForward";const yu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));yu.displayName="Code01";const xu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));xu.displayName="Code02";const bu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));bu.displayName="CoinsStacked01";const zr=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));zr.displayName="Columns01";const vu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));vu.displayName="CornerDownRight";const ku=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ku.displayName="Database01";const wu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));wu.displayName="Edit05";const Su=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Su.displayName="FlipBackward";const Cu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Cu.displayName="Repeat03";const Nu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Nu.displayName="Save02";const Eu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Eu.displayName="Tool01";const Ws=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));Ws.displayName="Users02";const{getOwnPropertyNames:mm,getOwnPropertySymbols:gm}=Object,{hasOwnProperty:ym}=Object.prototype;function Co(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Cr(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function xm(n){return n?.[Symbol.toStringTag]}function sa(n){return mm(n).concat(gm(n))}const bm=Object.hasOwn||((n,e)=>ym.call(n,e));function Xt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const vm="__v",km="__o",wm="_owner",{getOwnPropertyDescriptor:oa,keys:ia}=Object;function Sm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n),new Uint8Array(e))}function Cm(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Nm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Em(n,e){return Xt(n.getTime(),e.getTime())}function Tm(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Mm(n,e){return n===e}function la(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const Om=Xt;function Am(n,e,t){const r=ia(n);let s=r.length;if(ia(e).length!==s)return!1;for(;s-- >0;)if(!Tu(n,e,t,r[s]))return!1;return!0}function $n(n,e,t){const r=sa(n);let s=r.length;if(sa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Tu(n,e,t,o)||(i=oa(n,o),l=oa(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Im(n,e){return Xt(n.valueOf(),e.valueOf())}function jm(n,e){return n.source===e.source&&n.flags===e.flags}function aa(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function Jr(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Rm(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Tu(n,e,t,r){return(r===wm||r===km||r===vm)&&(n.$$typeof||e.$$typeof)?!0:bm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Dm="[object ArrayBuffer]",Pm="[object Arguments]",Lm="[object Boolean]",$m="[object DataView]",_m="[object Date]",zm="[object Error]",Bm="[object Map]",Fm="[object Number]",Vm="[object Object]",Hm="[object RegExp]",Wm="[object Set]",qm="[object String]",Um={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Km="[object URL]",Jm=Object.prototype.toString;function Gm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const k=typeof y;if(k!==typeof x)return!1;if(k!=="object")return k==="number"?l(y,x,b):k==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const v=Jm.call(y);if(v===_m)return r(y,x,b);if(v===Hm)return u(y,x,b);if(v===Bm)return i(y,x,b);if(v===Wm)return d(y,x,b);if(v===Vm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(v===Km)return h(y,x,b);if(v===zm)return s(y,x,b);if(v===Pm)return a(y,x,b);if(Um[v])return f(y,x,b);if(v===Dm)return n(y,x,b);if(v===$m)return t(y,x,b);if(v===Lm||v===Fm||v===qm)return c(y,x,b);if(m){let w=m[v];if(!w){const S=xm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Ym({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Sm,areArraysEqual:t?$n:Cm,areDataViewsEqual:Nm,areDatesEqual:Em,areErrorsEqual:Tm,areFunctionsEqual:Mm,areMapsEqual:t?Co(la,$n):la,areNumbersEqual:Om,areObjectsEqual:t?$n:Am,arePrimitiveWrappersEqual:Im,areRegExpsEqual:jm,areSetsEqual:t?Co(aa,$n):aa,areTypedArraysEqual:t?Co(Jr,$n):Jr,areUrlsEqual:Rm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Cr(r.areArraysEqual),o=Cr(r.areMapsEqual),i=Cr(r.areObjectsEqual),l=Cr(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function Xm(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function Qm({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const Zm=At();At({strict:!0});At({circular:!0});At({circular:!0,strict:!0});At({createInternalComparator:()=>Xt});At({strict:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt,strict:!0});function At(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Ym(n),i=Gm(o),l=t?t(i):Xm(i);return Qm({circular:e,comparator:i,createState:r,equals:l,strict:s})}function eg(n){const e=L.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Mp(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Op,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function tg(n){const e=L.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(cg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(nt,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(nt,{control:t.control,name:"title",render:ig}),p.jsx(nt,{control:t.control,name:"description",render:og})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(nt,{control:t.control,name:"gateway_id",render:sg}),p.jsx(nt,{control:t.control,name:"model",render:rg})]}),a=p.jsx(nt,{control:t.control,name:"system_prompt",render:ng}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(su,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function ng(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(An,{children:p.jsx(Ur,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function rg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(Ap,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function sg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(Zc,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function og(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function ig(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function lg(n){const e=L.c(62),{activeThreadId:t,mode:r,assistant:s,form:o}=n;let i;e[0]!==t||e[1]!==s.system_prompt?(i={threadId:t,systemPrompt:s.system_prompt},e[0]=t,e[1]=s.system_prompt,e[2]=i):i=e[2];const l=Tp(i),a=!!s.gateway_id&&!!s.model?.id&&!!s.model?.connectionId;let c;e[3]!==t||e[4]!==s.gateway_id||e[5]!==s.model||e[6]!==l||e[7]!==a?(c=async H=>{if(!a)return;const X={created_at:new Date().toISOString(),thread_id:t,model:{id:s.model.id,connectionId:s.model.connectionId},gateway:{id:s.gateway_id??""},user:{name:"you"}};await l.sendMessage(H,X)},e[3]=t,e[4]=s.gateway_id,e[5]=s.model,e[6]=l,e[7]=a,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.avatar||e[10]!==s.title?(d=s.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:s.avatar,alt:s.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(Ws,{size:28,className:"text-muted-foreground"})}),e[9]=s.avatar,e[10]=s.title,e[11]=d):d=e[11];let f;e[12]!==s.title?(f=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:s.title}),e[12]=s.title,e[13]=f):f=e[13];let h;e[14]!==s.description?(h=s.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[14]=s.description,e[15]=h):h=e[15];let m;e[16]!==d||e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d,f,h]}),e[16]=d,e[17]=f,e[18]=h,e[19]=m):m=e[19];let g;e[20]!==s.gateway_id||e[21]!==u?(g=s.gateway_id&&p.jsx(nr,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(eg,{gatewayId:s.gateway_id,onSelect:H=>{u(H.description??H.name)}})})}),e[20]=s.gateway_id,e[21]=u,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[m,g]}),e[23]=m,e[24]=g,e[25]=y):y=e[25];const x=y;let b;e[26]!==l.messages?(b=l.messages.filter(ag),e[26]=l.messages,e[27]=b):b=e[27];const k=b,C=r==="edit",v=C?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let w;e[28]!==v?(w=G("absolute inset-0 px-2 transition-opacity duration-200 ease-out",v),e[28]=v,e[29]=w):w=e[29];let S;e[30]!==o?(S=p.jsx(tg,{form:o}),e[30]=o,e[31]=S):S=e[31];let E;e[32]!==w||e[33]!==S?(E=p.jsx("div",{className:w,children:S}),e[32]=w,e[33]=S,e[34]=E):E=e[34];const M=C?"opacity-0 pointer-events-none":"opacity-100";let T;e[35]!==M?(T=G("h-full transition-opacity duration-200 ease-out",M),e[35]=M,e[36]=T):T=e[36];let R;e[37]!==l.messages||e[38]!==l.status||e[39]!==x||e[40]!==k.length?(R=k.length===0?p.jsx(an.EmptyState,{children:x}):p.jsx(an.Messages,{messages:l.messages,status:l.status,minHeightOffset:240}),e[37]=l.messages,e[38]=l.status,e[39]=x,e[40]=k.length,e[41]=R):R=e[41];let P;e[42]!==T||e[43]!==R?(P=p.jsx("div",{className:T,children:R}),e[42]=T,e[43]=R,e[44]=P):P=e[44];let _;e[45]!==E||e[46]!==P?(_=p.jsxs(an.Main,{className:"h-full relative overflow-hidden",children:[E,P]}),e[45]=E,e[46]=P,e[47]=_):_=e[47];const I=C?"translate-y-full":"translate-y-0";let O;e[48]!==I?(O=G("transition-transform duration-300 ease-out",I),e[48]=I,e[49]=O):O=e[49];const D=!a,z=l.status==="submitted"||l.status==="streaming";let U;e[50]!==l.messages||e[51]!==l.stop||e[52]!==u||e[53]!==D||e[54]!==z?(U=p.jsx(an.Footer,{children:p.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:p.jsx(an.Input,{onSubmit:u,onStop:l.stop,disabled:D,isStreaming:z,placeholder:"Ask anything or @ for context",usageMessages:l.messages})})}),e[50]=l.messages,e[51]=l.stop,e[52]=u,e[53]=D,e[54]=z,e[55]=U):U=e[55];let J;e[56]!==O||e[57]!==U?(J=p.jsx("div",{className:O,children:U}),e[56]=O,e[57]=U,e[58]=J):J=e[58];let K;return e[59]!==_||e[60]!==J?(K=p.jsxs(an,{children:[_,J]}),e[59]=_,e[60]=J,e[61]=K):K=e[61],K}function ag(n){return n.role!=="system"}function cg(n){const e=L.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const E=new FileReader;E.onloadend=()=>{const M=E.result;r(M)},E.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let k;e[9]!==b?(k=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Up,{className:b})}),e[9]=b,e[10]=k):k=e[10];let C;e[11]!==x||e[12]!==k?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,k]}),e[11]=x,e[12]=k,e[13]=C):C=e[13];let v;return e[14]!==g||e[15]!==y||e[16]!==C?(v=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=v):v=e[17],v}function ug(n){const e=L.c(49),{providerId:t,assistantId:r,onBack:s}=n,o=Fi();let i;e[0]!==s||e[1]!==o?(i=s??(()=>o.history.back()),e[0]=s,e[1]=o,e[2]=i):i=e[2];const l=i,{locator:a}=Lp();let c;e[3]!==r||e[4]!==a?(c=Pp.assistantChatActiveThread(a,r),e[3]=r,e[4]=a,e[5]=c):c=e[5];const[u,d]=Dp(c,dg),f=t||Ke;let h;e[6]!==f?(h=Mt(f),e[6]=f,e[7]=h):h=e[7];const m=h,g=Ui(t,"ASSISTANT",r,m),y=Ki(t,"ASSISTANT",m),x=y.update.isPending,[b,k]=N.useState(g?.model.id&&g?.gateway_id?"chat":"edit");let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=op(Hp),e[8]=C):C=e[8];const v=g??void 0;let w;e[9]!==v?(w={resolver:C,values:v},e[9]=v,e[10]=w):w=e[10];const S=Gc(w);let E;e[11]!==y.update||e[12]!==r||e[13]!==S?(E=S.handleSubmit(async J=>{const K=await y.update.mutateAsync({id:r,data:J});S.reset(K),k("chat")}),e[11]=y.update,e[12]=r,e[13]=S,e[14]=E):E=e[14];const M=E;if(!g){let J;e[15]===Symbol.for("react.memo_cache_sentinel")?(J=p.jsx(ta,{}),e[15]=J):J=e[15];let K;e[16]===Symbol.for("react.memo_cache_sentinel")?(K=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=K):K=e[16];let H;return e[17]!==l?(H=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:J,children:p.jsx(Kr,{onBack:l,children:K})})}),e[17]=l,e[18]=H):H=e[18],H}let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(ta,{}),e[19]=T):T=e[19];let R;e[20]!==g.avatar||e[21]!==g.title?(R=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:g.avatar?p.jsx("img",{src:g.avatar,alt:g.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{size:12,className:"text-muted-foreground"})})}),e[20]=g.avatar,e[21]=g.title,e[22]=R):R=e[22];let P;e[23]!==g.title?(P=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:g.title}),e[23]=g.title,e[24]=P):P=e[24];let _;e[25]!==g.description?(_=g.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:g.description})]}):null,e[25]=g.description,e[26]=_):_=e[26];let I;e[27]!==P||e[28]!==_?(I=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[P,_]}),e[27]=P,e[28]=_,e[29]=I):I=e[29];let O;e[30]!==R||e[31]!==I?(O=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[R,I]})}),e[30]=R,e[31]=I,e[32]=O):O=e[32];let D;e[33]!==S.formState.isDirty||e[34]!==x||e[35]!==b||e[36]!==M||e[37]!==d?(D=p.jsx(Xi,{children:b==="chat"?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",onClick:()=>d(crypto.randomUUID()),title:"New thread",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(Yi,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),p.jsx("button",{type:"button",onClick:()=>k("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(wu,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):p.jsxs(p.Fragment,{children:[p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:x,onClick:()=>k("chat"),children:"Cancel"}),p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!S.formState.isDirty||x,onClick:()=>{M()},children:x?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),e[33]=S.formState.isDirty,e[34]=x,e[35]=b,e[36]=M,e[37]=d,e[38]=D):D=e[38];let z;e[39]!==u||e[40]!==g||e[41]!==S||e[42]!==b?(z=p.jsx("div",{className:"h-full",children:p.jsx(lg,{activeThreadId:u,mode:b,assistant:g,form:S},S.formState.submitCount)}),e[39]=u,e[40]=g,e[41]=S,e[42]=b,e[43]=z):z=e[43];let U;return e[44]!==l||e[45]!==O||e[46]!==D||e[47]!==z?(U=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:T,children:p.jsxs(Kr,{onBack:l,children:[O,D,z]})})}),e[44]=l,e[45]=O,e[46]=D,e[47]=z,e[48]=U):U=e[48],U}function dg(n){return n||crypto.randomUUID()}function fg(n){const e=L.c(6),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!i||i===Ke){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(ug,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}ip({title:wo().min(1),description:wo().nullable(),body:wo()});function No(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function hg(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function pg(n){const e=L.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(nt,{control:t.control,name:"title",render:yg}),p.jsx(nt,{control:t.control,name:"description",render:gg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(nt,{control:t.control,name:"body",render:mg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=p.jsx(su,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function mg(n){const{field:e}=n;return p.jsx(Ot,{children:p.jsx(An,{children:p.jsx(Ur,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function gg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function yg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function xg(n){const e=L.c(42),{providerId:t,promptId:r,onBack:s}=n,o=t||Ke;let i;e[0]!==o?(i=Mt(o),e[0]=o,e[1]=i):i=e[1];const l=i,a=Ui(t,"PROMPT",r,l),c=Ki(t,"PROMPT",l),u=c.update.isPending;let d;e[2]!==a?(d=a?{title:a.title,description:a.description??null,body:No(a)}:void 0,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f={values:d},e[4]=d,e[5]=f):f=e[5];const h=Gc(f);let m;e[6]!==h||e[7]!==a?(m=()=>{a&&h.reset({title:a.title,description:a.description??null,body:No(a)})},e[6]=h,e[7]=a,e[8]=m):m=e[8];const g=m;let y;e[9]!==c.update||e[10]!==h||e[11]!==r?(y=h.handleSubmit(async I=>{const O=await c.update.mutateAsync({id:r,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});h.reset({title:O.title,description:O.description??null,body:No(O)})}),e[9]=c.update,e[10]=h,e[11]=r,e[12]=y):y=e[12];const x=y;if(!a){let I;return e[13]===Symbol.for("react.memo_cache_sentinel")?(I=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=I):I=e[13],I}let b;e[14]!==a.title?(b=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[14]=a.title,e[15]=b):b=e[15];let k;e[16]!==a.description?(k=a.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[16]=a.description,e[17]=k):k=e[17];let C;e[18]!==b||e[19]!==k?(C=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,k]})}),e[18]=b,e[19]=k,e[20]=C):C=e[20];const v=!h.formState.isDirty||u;let w;e[21]!==g||e[22]!==v?(w=p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:v,onClick:g,children:"Cancel"}),e[21]=g,e[22]=v,e[23]=w):w=e[23];const S=!h.formState.isDirty||u;let E;e[24]!==x?(E=()=>{x()},e[24]=x,e[25]=E):E=e[25];let M;e[26]!==u?(M=u?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save",e[26]=u,e[27]=M):M=e[27];let T;e[28]!==S||e[29]!==E||e[30]!==M?(T=p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:S,onClick:E,children:M}),e[28]=S,e[29]=E,e[30]=M,e[31]=T):T=e[31];let R;e[32]!==w||e[33]!==T?(R=p.jsxs(Xi,{children:[w,T]}),e[32]=w,e[33]=T,e[34]=R):R=e[34];let P;e[35]!==h?(P=p.jsx("div",{className:"h-full",children:p.jsx(pg,{form:h})}),e[35]=h,e[36]=P):P=e[36];let _;return e[37]!==s||e[38]!==R||e[39]!==P||e[40]!==C?(_=p.jsxs(Kr,{onBack:s,children:[C,R,P]}),e[37]=s,e[38]=R,e[39]=P,e[40]=C,e[41]=_):_=e[41],_}function bg(n){const e=L.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=hg()??Ke,e[0]=s):s=e[0];const o=s;if(!o||o===Ke){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(xg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const vg=lp("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function kg(n){const e=L.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=G(vg({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function wg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Sg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Cg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ng(n){const e=L.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=Xp(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(Qp,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(Zp,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Eg,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Eg({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const{replayId:s}=ap({strict:!1}),o=(()=>{if(!s)return null;const I=`replay-${s}`,O=sessionStorage.getItem(I);if(!O)return null;sessionStorage.removeItem(I);try{return JSON.parse(O)}catch{return null}})(),i=(()=>{if(!o)return null;const I={};for(const[O,D]of Object.entries(o))D!==null&&typeof D=="object"?I[O]=JSON.stringify(D,null,2):I[O]=D;return I})(),[l,a]=N.useState(i??{}),[c,u]=N.useState(o?JSON.stringify(o,null,2):"{}"),[d,f]=N.useState(null),[h,m]=N.useState(null),[g,y]=N.useState(!1),[x,b]=N.useState(null),k=Ji(e),C=el({url:t.href});N.useEffect(()=>{C.error&&console.error("MCP Error:",C.error)},[C.error]);const v=C.tools?.find(I=>I.name===n),w=v?.inputSchema?.properties,S=w?Object.keys(w):[],E=S.length>0,M={};if(E&&v?.inputSchema?.properties)for(const I of S)M[I]=v.inputSchema.required?.includes(I)?"":void 0;const T=I=>Object.prototype.hasOwnProperty.call(l,I),R=async()=>{y(!0),m(null),f(null),b(null);const I=performance.now(),O=Mt(e);try{const D=E?{...M,...l}:(()=>{const X=c.trim();if(!X)return{};const de=JSON.parse(X);if(de&&typeof de=="object")return de;throw new Error("Raw JSON input must be an object.")})();E&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([X,de])=>{if((de.type==="object"||de.type==="array")&&typeof D[X]=="string")try{D[X]=JSON.parse(D[X])}catch{}});const z=await O(n,D),U=performance.now(),J=Math.round(U-I);f(z);const K=JSON.stringify(z),H=new TextEncoder().encode(K).length;b({duration:`${J}ms`,bytes:`${H} bytes`,tokens:`~${Math.ceil(H/4)} tokens`,cost:"$0.0000"})}catch(D){const z=D instanceof Error?D.message:String(D);m(z||"Unknown error occurred");const U=performance.now();b({duration:`${Math.round(U-I)}ms`})}finally{y(!1)}},P=(I,O)=>{a(D=>({...D,[I]:O}))},_=()=>{f(null),m(null),b(null)};return p.jsxs(Kr,{onBack:r,children:[p.jsx(Xi,{children:p.jsx(em,{connectionId:e,title:v?.name??Cg(n),icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Vs,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[C.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):C.state==="connecting"?p.jsx(Ct,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:C.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:E&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([I,O])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,v.inputSchema?.required?.includes(I)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:O.type})]}),O.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:O.description}),O.type==="object"||O.type==="array"?p.jsx(Ur,{className:"font-mono text-xs",value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):p.jsx(In,{value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I}...`})]},I)):v?.inputSchema&&!E?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Ur,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:I=>u(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),x&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Jp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.duration})]}),x.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(mu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.tokens})]}),x.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(ku,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.bytes})]}),x.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:x.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ie,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:R,disabled:g,children:g?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(Qi,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(eu,{children:p.jsxs(tu,{children:[p.jsx(nu,{asChild:!0,children:p.jsx(ie,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:_,disabled:!d&&!h,children:p.jsx(Zi,{size:14})})}),p.jsx(ru,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),h&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(kg,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Kp,{className:"h-4 w-4"}),p.jsx(wg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Sg,{className:"text-xs text-destructive",children:h})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:d?p.jsxs(p.Fragment,{children:[p.jsx(Yp,{jsonString:JSON.stringify(d,null,2),padding:"1.5rem"}),p.jsx(ie,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(d,null,2)),li.success("Copied to clipboard")},children:p.jsx(Gp,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(yu,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Tg(n){const e=L.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!Ji(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Ct,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Ng,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ca=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},nl=(n=>n?ca(n):ca),Mg=n=>n;function ai(n,e=Mg){const t=Y.useSyncExternalStore(n.subscribe,Y.useCallback(()=>e(n.getState()),[n,e]),Y.useCallback(()=>e(n.getInitialState()),[n,e]));return Y.useDebugValue(t),t}const Og=n=>{const e=nl(n),t=r=>ai(e,r);return Object.assign(t,e),t},Ag=(n=>Og);function Mu(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const ci=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return ci(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return ci(r)(t)}}}},Ig=(n,e)=>(t,r,s)=>{let o={storage:Mu(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var k;return b((k=r())!=null?k:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return ci(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const k=o.migrate(b.state,b.version);return k instanceof Promise?k.then(C=>[!0,C]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var k;const[C,v]=b;if(h=o.merge(v,(k=r())!=null?k:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Ou=Ig,{useSyncExternalStoreWithSelector:jg}=cp,Rg=n=>n;function Dg(n,e=Rg,t){const r=jg(n.subscribe,n.getState,n.getInitialState,e,t);return Y.useDebugValue(r),r}const ua=n=>Symbol.iterator in n,da=n=>"entries"in n,fa=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},Pg=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Lg(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:ua(n)&&ua(e)?da(n)&&da(e)?fa(n,e):Pg(n,e):fa({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function $g(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
|
|
1
|
+
import{aw as Tt,r as N,c as L,d as Mn,j as p,av as Fi,w as op,x as Gc,s as ip,v as wo,h as lp,b as ap,t as li,E as Y,M as cp,ax as So,ay as Yc,al as up,ak as dp,az as fp,F as Vi,a5 as Xc,a8 as hp,z as On,B as ze,a2 as Hi,a9 as pp,y as Fs,a6 as mp,a1 as Wi,af as gp,ag as yp,ah as xp,aA as qi,aB as bp,a7 as Qc,a4 as vp,aC as kp,J as wp,aD as Sp,aE as Cp}from"./index-A52jfksK.js";import{U as Ke,f as Ui,d as Ki,c as Mt,b as Ji,I as Vs,u as Np,n as Ep}from"./use-connection-BX5-4xHw.js";import{d as Tp,C as an,e as Mp,I as Op,l as ta,G as Zc,M as Ap,m as Ip,R as na,k as jp}from"./resizable-B3HA_CX4.js";import{E as Hs,i as Rp}from"./SearchMd-1Gq7nypQ.js";import{E as nr}from"./error-boundary-CdmYlIj7.js";import{u as Dp,L as Pp}from"./localstorage-keys-D7pZSS7H.js";import{u as Lp,a as eu,c as tu,b as nu,T as ru,i as Gi}from"./tooltip-BjhP6ibY.js";import{B as ie}from"./button-DodNLkpL.js";import{F as nt,a as su,b as Ot,c as mr,d as An}from"./form-Bus-fIfC.js";import{I as In}from"./input-BXHWk19m.js";import{T as Ur,D as $p,a as _p,b as zp,f as Bp,c as Fp,d as Vp}from"./dialog-BqvvzTa7.js";import{c as G}from"./utils-DgLfrg3u.js";import{A as Hp,D as Wp,u as qp}from"./use-binding-CapMpNVF.js";import{i as Ct}from"./Loading01-r04aEG5T.js";import{s as Yi}from"./Plus-CS_Y2Vnc.js";import{i as Up}from"./Upload01-Da0sGkRE.js";import{V as Xi,b as Kr,a as ou}from"./layout-dxbGsEKV.js";import{i as Kp}from"./AlertCircle-DaEUMwle.js";import{s as Jp}from"./Clock-C-uwthk9.js";import{a as Gp}from"./Copy01-CHjgpWtl.js";import{i as Qi,J as Yp}from"./json-syntax-highlighter-i1hiMNnF.js";import{s as Zi,i as iu}from"./XClose-BUuGHVgA.js";import{u as Xp,O as Qp,M as Zp,P as em,F as tm,v as nm,E as rm}from"./index-td_4XAxf.js";import{u as el}from"./use-mcp-M6XXMHar.js";import{S as Yt}from"./spinner-oZ2DO2-U.js";import{a as lu,b as sm}from"./use-tool-call-CQCb5PBf.js";import{V as om}from"./view-mode-toggle-DAXMt6ZW.js";import{i as im}from"./ArrowLeft-CvFDkdiU.js";import{i as lm}from"./GitBranch01-Ci5lqvRi.js";import"./index-DDiLOLYT.js";import{n as am}from"./Calendar-DBqzL4c-.js";import{b as cm,D as um,a as dm,d as ra,i as fm}from"./dropdown-menu-DrQKdl4f.js";import{B as cn}from"./badge-1WraHGEG.js";import{i as au}from"./X-BX0rl0N7.js";import"./CpuChip02-DlCI7cQJ.js";import"./select-Be0LRVWn.js";import"./ChevronDown-g4L12M9A.js";import"./use-mobile-TpeNqylz.js";import"./use-gateway-CseaalWF.js";import"./Terminal-DYN6gEAz.js";import"./connection-card-opsQBUfD.js";import"./card-BHz-BqEu.js";import"./LinkExternal01-ISpHuMJE.js";import"./File06-CBkqKj5m.js";import"./InfoCircle-BwNsGATl.js";import"./useQuery-ojqdZMTH.js";import"./auth-AUS48lXs.js";import"./mcp-oauth-D7V7V-GS.js";import"./use-organization-settings-BAhAEDx8.js";import"./env-vars-editor-DEYac6H7.js";import"./Trash01-DVxmznxT.js";import"./Key01-5nxXQgMM.js";import"./formatDistanceToNow-D46rGC8T.js";import"./extract-connection-data-Ty2DjF1e.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-JV0IIYp6.js";const cu=Tt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const uu=Tt("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const hm=Tt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const pm=Tt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const du=Tt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const fu=Tt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const hu=Tt("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const pu=Tt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),tl=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));tl.displayName="AlertOctagon";const mu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));mu.displayName="Box";const gu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));gu.displayName="ClockFastForward";const yu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));yu.displayName="Code01";const xu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));xu.displayName="Code02";const bu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M12 17a5 5 0 1 0 10 0 5 5 0 0 0-10 0Zm0 0c0-1.126.372-2.165 1-3V5m-1 12c0 .825.2 1.604.554 2.29-.842.712-2.788 1.21-5.054 1.21-3.038 0-5.5-.895-5.5-2V5m11 0c0 1.105-2.462 2-5.5 2S2 6.105 2 5m11 0c0-1.105-2.462-2-5.5-2S2 3.895 2 5m0 9c0 1.105 2.462 2 5.5 2 2.189 0 4.08-.465 4.965-1.138M13 9.5c0 1.105-2.462 2-5.5 2S2 10.605 2 9.5"}));bu.displayName="CoinsStacked01";const zr=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));zr.displayName="Columns01";const vu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));vu.displayName="CornerDownRight";const ku=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ku.displayName="Database01";const wu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));wu.displayName="Edit05";const Su=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));Su.displayName="FlipBackward";const Cu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Cu.displayName="Repeat03";const Nu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Nu.displayName="Save02";const Eu=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));Eu.displayName="Tool01";const Ws=({size:n=24,color:e="currentColor",...t})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},N.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));Ws.displayName="Users02";const{getOwnPropertyNames:mm,getOwnPropertySymbols:gm}=Object,{hasOwnProperty:ym}=Object.prototype;function Co(n,e){return function(r,s,o){return n(r,s,o)&&e(r,s,o)}}function Cr(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:o}=s,i=o.get(t),l=o.get(r);if(i&&l)return i===r&&l===t;o.set(t,r),o.set(r,t);const a=n(t,r,s);return o.delete(t),o.delete(r),a}}function xm(n){return n?.[Symbol.toStringTag]}function sa(n){return mm(n).concat(gm(n))}const bm=Object.hasOwn||((n,e)=>ym.call(n,e));function Xt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const vm="__v",km="__o",wm="_owner",{getOwnPropertyDescriptor:oa,keys:ia}=Object;function Sm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n),new Uint8Array(e))}function Cm(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function Nm(n,e){return n.byteLength===e.byteLength&&Jr(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function Em(n,e){return Xt(n.getTime(),e.getTime())}function Tm(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function Mm(n,e){return n===e}function la(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.entries();let i,l,a=0;for(;(i=o.next())&&!i.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const f=i.value,h=l.value;if(t.equals(f[0],h[0],a,d,n,e,t)&&t.equals(f[1],h[1],f[0],h[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const Om=Xt;function Am(n,e,t){const r=ia(n);let s=r.length;if(ia(e).length!==s)return!1;for(;s-- >0;)if(!Tu(n,e,t,r[s]))return!1;return!0}function $n(n,e,t){const r=sa(n);let s=r.length;if(sa(e).length!==s)return!1;let o,i,l;for(;s-- >0;)if(o=r[s],!Tu(n,e,t,o)||(i=oa(n,o),l=oa(e,o),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function Im(n,e){return Xt(n.valueOf(),e.valueOf())}function jm(n,e){return n.source===e.source&&n.flags===e.flags}function aa(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),o=n.values();let i,l;for(;(i=o.next())&&!i.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(i.value,l.value,i.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function Jr(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function Rm(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Tu(n,e,t,r){return(r===wm||r===km||r===vm)&&(n.$$typeof||e.$$typeof)?!0:bm(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const Dm="[object ArrayBuffer]",Pm="[object Arguments]",Lm="[object Boolean]",$m="[object DataView]",_m="[object Date]",zm="[object Error]",Bm="[object Map]",Fm="[object Number]",Vm="[object Object]",Hm="[object RegExp]",Wm="[object Set]",qm="[object String]",Um={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Km="[object URL]",Jm=Object.prototype.toString;function Gm({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:h,unknownTagComparators:m}){return function(y,x,b){if(y===x)return!0;if(y==null||x==null)return!1;const k=typeof y;if(k!==typeof x)return!1;if(k!=="object")return k==="number"?l(y,x,b):k==="function"?o(y,x,b):!1;const C=y.constructor;if(C!==x.constructor)return!1;if(C===Object)return a(y,x,b);if(Array.isArray(y))return e(y,x,b);if(C===Date)return r(y,x,b);if(C===RegExp)return u(y,x,b);if(C===Map)return i(y,x,b);if(C===Set)return d(y,x,b);const v=Jm.call(y);if(v===_m)return r(y,x,b);if(v===Hm)return u(y,x,b);if(v===Bm)return i(y,x,b);if(v===Wm)return d(y,x,b);if(v===Vm)return typeof y.then!="function"&&typeof x.then!="function"&&a(y,x,b);if(v===Km)return h(y,x,b);if(v===zm)return s(y,x,b);if(v===Pm)return a(y,x,b);if(Um[v])return f(y,x,b);if(v===Dm)return n(y,x,b);if(v===$m)return t(y,x,b);if(v===Lm||v===Fm||v===qm)return c(y,x,b);if(m){let w=m[v];if(!w){const S=xm(y);S&&(w=m[S])}if(w)return w(y,x,b)}return!1}}function Ym({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:Sm,areArraysEqual:t?$n:Cm,areDataViewsEqual:Nm,areDatesEqual:Em,areErrorsEqual:Tm,areFunctionsEqual:Mm,areMapsEqual:t?Co(la,$n):la,areNumbersEqual:Om,areObjectsEqual:t?$n:Am,arePrimitiveWrappersEqual:Im,areRegExpsEqual:jm,areSetsEqual:t?Co(aa,$n):aa,areTypedArraysEqual:t?Co(Jr,$n):Jr,areUrlsEqual:Rm,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=Cr(r.areArraysEqual),o=Cr(r.areMapsEqual),i=Cr(r.areObjectsEqual),l=Cr(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:l})}return r}function Xm(n){return function(e,t,r,s,o,i,l){return n(e,t,l)}}function Qm({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const o={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,o)}}const Zm=At();At({strict:!0});At({circular:!0});At({circular:!0,strict:!0});At({createInternalComparator:()=>Xt});At({strict:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt});At({circular:!0,createInternalComparator:()=>Xt,strict:!0});function At(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,o=Ym(n),i=Gm(o),l=t?t(i):Xm(i);return Qm({circular:e,comparator:i,createState:r,equals:l,strict:s})}function eg(n){const e=L.c(3),{gatewayId:t,onSelect:r}=n,{data:s}=Mp(t);if(s.length===0)return null;let o;return e[0]!==r||e[1]!==s?(o=p.jsx(Op,{prompts:s,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=s,e[2]=o):o=e[2],o}function tg(n){const e=L.c(20),{form:t}=n;let r;e[0]!==t?(r=d=>{const{field:f}=d;return p.jsx(cg,{size:"md",value:f.value,onChange:f.onChange,alt:t.watch("title")})},e[0]=t,e[1]=r):r=e[1];let s;e[2]!==t.control||e[3]!==r?(s=p.jsx(nt,{control:t.control,name:"avatar",render:r}),e[2]=t.control,e[3]=r,e[4]=s):s=e[4];let o;e[5]!==t.control?(o=p.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[p.jsx(nt,{control:t.control,name:"title",render:ig}),p.jsx(nt,{control:t.control,name:"description",render:og})]}),e[5]=t.control,e[6]=o):o=e[6];let i;e[7]!==s||e[8]!==o?(i=p.jsxs("div",{className:"flex gap-4 items-start",children:[s,o]}),e[7]=s,e[8]=o,e[9]=i):i=e[9];let l,a;e[10]!==t.control?(l=p.jsxs("div",{className:"flex gap-4",children:[p.jsx(nt,{control:t.control,name:"gateway_id",render:sg}),p.jsx(nt,{control:t.control,name:"model",render:rg})]}),a=p.jsx(nt,{control:t.control,name:"system_prompt",render:ng}),e[10]=t.control,e[11]=l,e[12]=a):(l=e[11],a=e[12]);let c;e[13]!==i||e[14]!==l||e[15]!==a?(c=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[i,l,a]}),e[13]=i,e[14]=l,e[15]=a,e[16]=c):c=e[16];let u;return e[17]!==t||e[18]!==c?(u=p.jsx(su,{...t,children:c}),e[17]=t,e[18]=c,e[19]=u):u=e[19],u}function ng(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1 flex flex-col min-h-0",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"System prompt"}),p.jsx(An,{children:p.jsx(Ur,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function rg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Model"}),p.jsx(Ap,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:t=>e.onChange({id:t.id,connectionId:t.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function sg(n){const{field:e}=n;return p.jsxs(Ot,{className:"flex-1",children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Gateway"}),p.jsx(Zc,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function og(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function ig(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx(mr,{className:"text-xs text-muted-foreground",children:"Name"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function lg(n){const e=L.c(62),{activeThreadId:t,mode:r,assistant:s,form:o}=n;let i;e[0]!==t||e[1]!==s.system_prompt?(i={threadId:t,systemPrompt:s.system_prompt},e[0]=t,e[1]=s.system_prompt,e[2]=i):i=e[2];const l=Tp(i),a=!!s.gateway_id&&!!s.model?.id&&!!s.model?.connectionId;let c;e[3]!==t||e[4]!==s.gateway_id||e[5]!==s.model||e[6]!==l||e[7]!==a?(c=async H=>{if(!a)return;const X={created_at:new Date().toISOString(),thread_id:t,model:{id:s.model.id,connectionId:s.model.connectionId},gateway:{id:s.gateway_id??""},user:{name:"you"}};await l.sendMessage(H,X)},e[3]=t,e[4]=s.gateway_id,e[5]=s.model,e[6]=l,e[7]=a,e[8]=c):c=e[8];const u=c;let d;e[9]!==s.avatar||e[10]!==s.title?(d=s.avatar?p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:p.jsx("img",{src:s.avatar,alt:s.title,className:"h-full w-full object-cover"})}):p.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:p.jsx(Ws,{size:28,className:"text-muted-foreground"})}),e[9]=s.avatar,e[10]=s.title,e[11]=d):d=e[11];let f;e[12]!==s.title?(f=p.jsx("h3",{className:"text-xl font-medium text-foreground",children:s.title}),e[12]=s.title,e[13]=f):f=e[13];let h;e[14]!==s.description?(h=s.description?p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[14]=s.description,e[15]=h):h=e[15];let m;e[16]!==d||e[17]!==f||e[18]!==h?(m=p.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d,f,h]}),e[16]=d,e[17]=f,e[18]=h,e[19]=m):m=e[19];let g;e[20]!==s.gateway_id||e[21]!==u?(g=s.gateway_id&&p.jsx(nr,{fallback:null,children:p.jsx(N.Suspense,{fallback:p.jsx("div",{className:"flex justify-center mt-6",children:p.jsx(Ct,{size:20,className:"animate-spin text-muted-foreground"})}),children:p.jsx(eg,{gatewayId:s.gateway_id,onSelect:H=>{u(H.description??H.name)}})})}),e[20]=s.gateway_id,e[21]=u,e[22]=g):g=e[22];let y;e[23]!==m||e[24]!==g?(y=p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[m,g]}),e[23]=m,e[24]=g,e[25]=y):y=e[25];const x=y;let b;e[26]!==l.messages?(b=l.messages.filter(ag),e[26]=l.messages,e[27]=b):b=e[27];const k=b,C=r==="edit",v=C?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let w;e[28]!==v?(w=G("absolute inset-0 px-2 transition-opacity duration-200 ease-out",v),e[28]=v,e[29]=w):w=e[29];let S;e[30]!==o?(S=p.jsx(tg,{form:o}),e[30]=o,e[31]=S):S=e[31];let E;e[32]!==w||e[33]!==S?(E=p.jsx("div",{className:w,children:S}),e[32]=w,e[33]=S,e[34]=E):E=e[34];const M=C?"opacity-0 pointer-events-none":"opacity-100";let T;e[35]!==M?(T=G("h-full transition-opacity duration-200 ease-out",M),e[35]=M,e[36]=T):T=e[36];let R;e[37]!==l.messages||e[38]!==l.status||e[39]!==x||e[40]!==k.length?(R=k.length===0?p.jsx(an.EmptyState,{children:x}):p.jsx(an.Messages,{messages:l.messages,status:l.status,minHeightOffset:240}),e[37]=l.messages,e[38]=l.status,e[39]=x,e[40]=k.length,e[41]=R):R=e[41];let P;e[42]!==T||e[43]!==R?(P=p.jsx("div",{className:T,children:R}),e[42]=T,e[43]=R,e[44]=P):P=e[44];let _;e[45]!==E||e[46]!==P?(_=p.jsxs(an.Main,{className:"h-full relative overflow-hidden",children:[E,P]}),e[45]=E,e[46]=P,e[47]=_):_=e[47];const I=C?"translate-y-full":"translate-y-0";let O;e[48]!==I?(O=G("transition-transform duration-300 ease-out",I),e[48]=I,e[49]=O):O=e[49];const D=!a,z=l.status==="submitted"||l.status==="streaming";let U;e[50]!==l.messages||e[51]!==l.stop||e[52]!==u||e[53]!==D||e[54]!==z?(U=p.jsx(an.Footer,{children:p.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:p.jsx(an.Input,{onSubmit:u,onStop:l.stop,disabled:D,isStreaming:z,placeholder:"Ask anything or @ for context",usageMessages:l.messages})})}),e[50]=l.messages,e[51]=l.stop,e[52]=u,e[53]=D,e[54]=z,e[55]=U):U=e[55];let J;e[56]!==O||e[57]!==U?(J=p.jsx("div",{className:O,children:U}),e[56]=O,e[57]=U,e[58]=J):J=e[58];let K;return e[59]!==_||e[60]!==J?(K=p.jsxs(an,{children:[_,J]}),e[59]=_,e[60]=J,e[61]=K):K=e[61],K}function ag(n){return n.role!=="system"}function cg(n){const e=L.c(18),{value:t,onChange:r,alt:s,size:o}=n,i=o===void 0?"md":o,l=N.useRef(null),a=i==="xs"?"h-6 w-6":i==="sm"?"h-8 w-8":"h-16 w-16",c=i==="xs"?"h-3 w-3":i==="sm"?"h-4 w-4":"h-6 w-6",u=i==="xs"?"h-3 w-3":i==="sm"?"h-3.5 w-3.5":"h-5 w-5";let d;e[0]!==r?(d=w=>{const S=w.target.files?.[0];if(!S)return;const E=new FileReader;E.onloadend=()=>{const M=E.result;r(M)},E.readAsDataURL(S)},e[0]=r,e[1]=d):d=e[1];const f=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{l.current?.click()},e[2]=h):h=e[2];const m=h,g=`relative ${a} shrink-0 cursor-pointer group`;let y;e[3]!==f?(y=p.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:f}),e[3]=f,e[4]=y):y=e[4];let x;e[5]!==s||e[6]!==c||e[7]!==t?(x=t?p.jsx("img",{src:t,alt:s||"Avatar",className:"w-full h-full object-cover"}):p.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{className:c})}),e[5]=s,e[6]=c,e[7]=t,e[8]=x):x=e[8];const b=`${u} text-white`;let k;e[9]!==b?(k=p.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:p.jsx(Up,{className:b})}),e[9]=b,e[10]=k):k=e[10];let C;e[11]!==x||e[12]!==k?(C=p.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[x,k]}),e[11]=x,e[12]=k,e[13]=C):C=e[13];let v;return e[14]!==g||e[15]!==y||e[16]!==C?(v=p.jsxs("div",{className:g,onClick:m,children:[y,C]}),e[14]=g,e[15]=y,e[16]=C,e[17]=v):v=e[17],v}function ug(n){const e=L.c(49),{providerId:t,assistantId:r,onBack:s}=n,o=Fi();let i;e[0]!==s||e[1]!==o?(i=s??(()=>o.history.back()),e[0]=s,e[1]=o,e[2]=i):i=e[2];const l=i,{locator:a}=Lp();let c;e[3]!==r||e[4]!==a?(c=Pp.assistantChatActiveThread(a,r),e[3]=r,e[4]=a,e[5]=c):c=e[5];const[u,d]=Dp(c,dg),f=t||Ke;let h;e[6]!==f?(h=Mt(f),e[6]=f,e[7]=h):h=e[7];const m=h,g=Ui(t,"ASSISTANT",r,m),y=Ki(t,"ASSISTANT",m),x=y.update.isPending,[b,k]=N.useState(g?.model.id&&g?.gateway_id?"chat":"edit");let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=op(Hp),e[8]=C):C=e[8];const v=g??void 0;let w;e[9]!==v?(w={resolver:C,values:v},e[9]=v,e[10]=w):w=e[10];const S=Gc(w);let E;e[11]!==y.update||e[12]!==r||e[13]!==S?(E=S.handleSubmit(async J=>{const K=await y.update.mutateAsync({id:r,data:J});S.reset(K),k("chat")}),e[11]=y.update,e[12]=r,e[13]=S,e[14]=E):E=e[14];const M=E;if(!g){let J;e[15]===Symbol.for("react.memo_cache_sentinel")?(J=p.jsx(ta,{}),e[15]=J):J=e[15];let K;e[16]===Symbol.for("react.memo_cache_sentinel")?(K=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=K):K=e[16];let H;return e[17]!==l?(H=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:J,children:p.jsx(Kr,{onBack:l,children:K})})}),e[17]=l,e[18]=H):H=e[18],H}let T;e[19]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(ta,{}),e[19]=T):T=e[19];let R;e[20]!==g.avatar||e[21]!==g.title?(R=p.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:g.avatar?p.jsx("img",{src:g.avatar,alt:g.title,className:"h-full w-full object-cover"}):p.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:p.jsx(Ws,{size:12,className:"text-muted-foreground"})})}),e[20]=g.avatar,e[21]=g.title,e[22]=R):R=e[22];let P;e[23]!==g.title?(P=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:g.title}),e[23]=g.title,e[24]=P):P=e[24];let _;e[25]!==g.description?(_=g.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:g.description})]}):null,e[25]=g.description,e[26]=_):_=e[26];let I;e[27]!==P||e[28]!==_?(I=p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[P,_]}),e[27]=P,e[28]=_,e[29]=I):I=e[29];let O;e[30]!==R||e[31]!==I?(O=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[R,I]})}),e[30]=R,e[31]=I,e[32]=O):O=e[32];let D;e[33]!==S.formState.isDirty||e[34]!==x||e[35]!==b||e[36]!==M||e[37]!==d?(D=p.jsx(Xi,{children:b==="chat"?p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",onClick:()=>d(crypto.randomUUID()),title:"New thread",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(Yi,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),p.jsx("button",{type:"button",onClick:()=>k("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:p.jsx(wu,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):p.jsxs(p.Fragment,{children:[p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:x,onClick:()=>k("chat"),children:"Cancel"}),p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!S.formState.isDirty||x,onClick:()=>{M()},children:x?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),e[33]=S.formState.isDirty,e[34]=x,e[35]=b,e[36]=M,e[37]=d,e[38]=D):D=e[38];let z;e[39]!==u||e[40]!==g||e[41]!==S||e[42]!==b?(z=p.jsx("div",{className:"h-full",children:p.jsx(lg,{activeThreadId:u,mode:b,assistant:g,form:S},S.formState.submitCount)}),e[39]=u,e[40]=g,e[41]=S,e[42]=b,e[43]=z):z=e[43];let U;return e[44]!==l||e[45]!==O||e[46]!==D||e[47]!==z?(U=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:T,children:p.jsxs(Kr,{onBack:l,children:[O,D,z]})})}),e[44]=l,e[45]=O,e[46]=D,e[47]=z,e[48]=U):U=e[48],U}function dg(n){return n||crypto.randomUUID()}function fg(n){const e=L.c(6),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!i||i===Ke){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==i||e[3]!==t||e[4]!==r?(l=p.jsx(ug,{providerId:i,assistantId:t,onBack:r}),e[2]=i,e[3]=t,e[4]=r,e[5]=l):l=e[5],l}ip({title:wo().min(1),description:wo().nullable(),body:wo()});function No(n){for(const e of n.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function hg(){const n=window.location.pathname.split("/").filter(Boolean),e=n.findIndex(r=>r==="mcps"),t=e>=0?n[e+1]:void 0;return t?decodeURIComponent(t):void 0}function pg(n){const e=L.c(13),{form:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let s;e[1]!==t.control?(s=p.jsxs("div",{className:"flex flex-col gap-4",children:[r,p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[p.jsx(nt,{control:t.control,name:"title",render:yg}),p.jsx(nt,{control:t.control,name:"description",render:gg})]})]}),e[1]=t.control,e[2]=s):s=e[2];let o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),i=p.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=o,e[4]=i):(o=e[3],i=e[4]);let l;e[5]!==t.control?(l=p.jsxs("div",{className:"flex flex-col gap-2",children:[o,i,p.jsx(nt,{control:t.control,name:"body",render:mg})]}),e[5]=t.control,e[6]=l):l=e[6];let a;e[7]!==s||e[8]!==l?(a=p.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[s,l]}),e[7]=s,e[8]=l,e[9]=a):a=e[9];let c;return e[10]!==t||e[11]!==a?(c=p.jsx(su,{...t,children:a}),e[10]=t,e[11]=a,e[12]=c):c=e[12],c}function mg(n){const{field:e}=n;return p.jsx(Ot,{children:p.jsx(An,{children:p.jsx(Ur,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function gg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),p.jsx(An,{children:p.jsx(In,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function yg(n){const{field:e}=n;return p.jsxs(Ot,{children:[p.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),p.jsx(An,{children:p.jsx(In,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function xg(n){const e=L.c(42),{providerId:t,promptId:r,onBack:s}=n,o=t||Ke;let i;e[0]!==o?(i=Mt(o),e[0]=o,e[1]=i):i=e[1];const l=i,a=Ui(t,"PROMPT",r,l),c=Ki(t,"PROMPT",l),u=c.update.isPending;let d;e[2]!==a?(d=a?{title:a.title,description:a.description??null,body:No(a)}:void 0,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f={values:d},e[4]=d,e[5]=f):f=e[5];const h=Gc(f);let m;e[6]!==h||e[7]!==a?(m=()=>{a&&h.reset({title:a.title,description:a.description??null,body:No(a)})},e[6]=h,e[7]=a,e[8]=m):m=e[8];const g=m;let y;e[9]!==c.update||e[10]!==h||e[11]!==r?(y=h.handleSubmit(async I=>{const O=await c.update.mutateAsync({id:r,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});h.reset({title:O.title,description:O.description??null,body:No(O)})}),e[9]=c.update,e[10]=h,e[11]=r,e[12]=y):y=e[12];const x=y;if(!a){let I;return e[13]===Symbol.for("react.memo_cache_sentinel")?(I=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=I):I=e[13],I}let b;e[14]!==a.title?(b=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[14]=a.title,e[15]=b):b=e[15];let k;e[16]!==a.description?(k=a.description?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),p.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[16]=a.description,e[17]=k):k=e[17];let C;e[18]!==b||e[19]!==k?(C=p.jsx(ou,{children:p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,k]})}),e[18]=b,e[19]=k,e[20]=C):C=e[20];const v=!h.formState.isDirty||u;let w;e[21]!==g||e[22]!==v?(w=p.jsx(ie,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:v,onClick:g,children:"Cancel"}),e[21]=g,e[22]=v,e[23]=w):w=e[23];const S=!h.formState.isDirty||u;let E;e[24]!==x?(E=()=>{x()},e[24]=x,e[25]=E):E=e[25];let M;e[26]!==u?(M=u?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Saving..."]}):"Save",e[26]=u,e[27]=M):M=e[27];let T;e[28]!==S||e[29]!==E||e[30]!==M?(T=p.jsx(ie,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:S,onClick:E,children:M}),e[28]=S,e[29]=E,e[30]=M,e[31]=T):T=e[31];let R;e[32]!==w||e[33]!==T?(R=p.jsxs(Xi,{children:[w,T]}),e[32]=w,e[33]=T,e[34]=R):R=e[34];let P;e[35]!==h?(P=p.jsx("div",{className:"h-full",children:p.jsx(pg,{form:h})}),e[35]=h,e[36]=P):P=e[36];let _;return e[37]!==s||e[38]!==R||e[39]!==P||e[40]!==C?(_=p.jsxs(Kr,{onBack:s,children:[C,R,P]}),e[37]=s,e[38]=R,e[39]=P,e[40]=C,e[41]=_):_=e[41],_}function bg(n){const e=L.c(5),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=hg()??Ke,e[0]=s):s=e[0];const o=s;if(!o||o===Ke){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx("div",{className:"flex h-full w-full bg-background",children:p.jsx(Hs,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let i;return e[2]!==t||e[3]!==r?(i=p.jsx(nr,{children:p.jsx(N.Suspense,{fallback:null,children:p.jsx(xg,{providerId:o,promptId:t,onBack:r})})}),e[2]=t,e[3]=r,e[4]=i):i=e[4],i}const vg=lp("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function kg(n){const e=L.c(10);let t,r,s;e[0]!==n?({className:t,variant:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let o;e[4]!==t||e[5]!==s?(o=G(vg({variant:s}),t),e[4]=t,e[5]=s,e[6]=o):o=e[6];let i;return e[7]!==r||e[8]!==o?(i=p.jsx("div",{"data-slot":"alert",role:"alert",className:o,...r}),e[7]=r,e[8]=o,e[9]=i):i=e[9],i}function wg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function Sg(n){const e=L.c(8);let t,r;e[0]!==n?({className:t,...r}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=G("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}const Cg=n=>n.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ng(n){const e=L.c(13),{toolName:t,connectionId:r,onBack:s}=n,o=`/mcp/${r}`;let i;e[0]!==o?(i=new URL(o,window.location.origin),e[0]=o,e[1]=i):i=e[1];const l=i;let a;e[2]!==r?(a={connectionId:r},e[2]=r,e[3]=a):a=e[3];const c=Xp(a);if(!c.isAuthenticated){let f;return e[4]!==c.supportsOAuth||e[5]!==s?(f=p.jsx("div",{className:"flex h-full items-center justify-center",children:c.supportsOAuth?p.jsx(Qp,{onAuthenticate:()=>s(),buttonText:"Go back to authenticate"}):p.jsx(Zp,{hasReadme:!1})}),e[4]=c.supportsOAuth,e[5]=s,e[6]=f):f=e[6],f}const u=`${r}:${t}`;let d;return e[7]!==r||e[8]!==l||e[9]!==s||e[10]!==u||e[11]!==t?(d=p.jsx(Eg,{toolName:t,connectionId:r,mcpProxyUrl:l,onBack:s},u),e[7]=r,e[8]=l,e[9]=s,e[10]=u,e[11]=t,e[12]=d):d=e[12],d}function Eg({toolName:n,connectionId:e,mcpProxyUrl:t,onBack:r}){const{replayId:s}=ap({strict:!1}),o=(()=>{if(!s)return null;const I=`replay-${s}`,O=sessionStorage.getItem(I);if(!O)return null;sessionStorage.removeItem(I);try{return JSON.parse(O)}catch{return null}})(),i=(()=>{if(!o)return null;const I={};for(const[O,D]of Object.entries(o))D!==null&&typeof D=="object"?I[O]=JSON.stringify(D,null,2):I[O]=D;return I})(),[l,a]=N.useState(i??{}),[c,u]=N.useState(o?JSON.stringify(o,null,2):"{}"),[d,f]=N.useState(null),[h,m]=N.useState(null),[g,y]=N.useState(!1),[x,b]=N.useState(null),k=Ji(e),C=el({url:t.href});N.useEffect(()=>{C.error&&console.error("MCP Error:",C.error)},[C.error]);const v=C.tools?.find(I=>I.name===n),w=v?.inputSchema?.properties,S=w?Object.keys(w):[],E=S.length>0,M={};if(E&&v?.inputSchema?.properties)for(const I of S)M[I]=v.inputSchema.required?.includes(I)?"":void 0;const T=I=>Object.prototype.hasOwnProperty.call(l,I),R=async()=>{y(!0),m(null),f(null),b(null);const I=performance.now(),O=Mt(e);try{const D=E?{...M,...l}:(()=>{const X=c.trim();if(!X)return{};const de=JSON.parse(X);if(de&&typeof de=="object")return de;throw new Error("Raw JSON input must be an object.")})();E&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([X,de])=>{if((de.type==="object"||de.type==="array")&&typeof D[X]=="string")try{D[X]=JSON.parse(D[X])}catch{}});const z=await O(n,D),U=performance.now(),J=Math.round(U-I);f(z);const K=JSON.stringify(z),H=new TextEncoder().encode(K).length;b({duration:`${J}ms`,bytes:`${H} bytes`,tokens:`~${Math.ceil(H/4)} tokens`,cost:"$0.0000"})}catch(D){const z=D instanceof Error?D.message:String(D);m(z||"Unknown error occurred");const U=performance.now();b({duration:`${Math.round(U-I)}ms`})}finally{y(!1)}},P=(I,O)=>{a(D=>({...D,[I]:O}))},_=()=>{f(null),m(null),b(null)};return p.jsxs(Kr,{onBack:r,children:[p.jsx(Xi,{children:p.jsx(em,{connectionId:e,title:v?.name??Cg(n),icon:"build"})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[p.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:p.jsxs("div",{className:"flex-1 overflow-auto",children:[p.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(Vs,{icon:k?.icon||null,name:k?.title||n,size:"sm",className:"shadow-sm shrink-0"}),p.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:n}),p.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[C.state==="ready"?p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):C.state==="connecting"?p.jsx(Ct,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):p.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),p.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:C.state.replace("_"," ")})]})]}),p.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]})}),p.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),p.jsx("div",{className:"space-y-4",children:E&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([I,O])=>p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,v.inputSchema?.required?.includes(I)&&p.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),p.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:O.type})]}),O.description&&p.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:O.description}),O.type==="object"||O.type==="array"?p.jsx(Ur,{className:"font-mono text-xs",value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):p.jsx(In,{value:T(I)?l[I]??"":M[I]??"",onChange:D=>P(I,D.target.value),placeholder:`Enter ${I}...`})]},I)):v?.inputSchema&&!E?p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),p.jsx(Ur,{className:"font-mono text-xs min-h-[120px]",value:c,onChange:I=>u(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):p.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:p.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),p.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[p.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),x&&p.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Jp,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.duration})]}),x.tokens&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(mu,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.tokens})]}),x.bytes&&p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(ku,{className:"h-3 w-3 text-muted-foreground"}),p.jsx("span",{className:"font-mono text-foreground",children:x.bytes})]}),x.cost&&p.jsx("div",{className:"flex items-center gap-1.5",children:p.jsx("span",{className:"font-mono text-foreground",children:x.cost})})]})]}),p.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:p.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[p.jsx(ie,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:R,disabled:g,children:g?p.jsxs(p.Fragment,{children:[p.jsx(Ct,{size:14,className:"animate-spin"}),"Executing..."]}):p.jsxs(p.Fragment,{children:[p.jsx(Qi,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),p.jsx(eu,{children:p.jsxs(tu,{children:[p.jsx(nu,{asChild:!0,children:p.jsx(ie,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:_,disabled:!d&&!h,children:p.jsx(Zi,{size:14})})}),p.jsx(ru,{children:p.jsx("p",{children:"Clear results"})})]})})]})}),h&&p.jsx("div",{className:"px-6 py-4 bg-background",children:p.jsx(kg,{variant:"destructive",children:p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Kp,{className:"h-4 w-4"}),p.jsx(wg,{className:"mb-0",children:"Execution Failed"})]}),p.jsx(Sg,{className:"text-xs text-destructive",children:h})]})})}),p.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:d?p.jsxs(p.Fragment,{children:[p.jsx(Yp,{jsonString:JSON.stringify(d,null,2),padding:"1.5rem"}),p.jsx(ie,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(d,null,2)),li.success("Copied to clipboard")},children:p.jsx(Gp,{className:"h-3.5 w-3.5"})})]}):p.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[p.jsx(yu,{className:"h-12 w-12 mb-3 opacity-40"}),p.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Tg(n){const e=L.c(7),{itemId:t,onBack:r}=n;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const i=Mn(s).connectionId??Ke;if(!Ji(i)){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex h-full items-center justify-center",children:p.jsx(Ct,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let c;return e[3]!==i||e[4]!==r||e[5]!==t?(c=p.jsx(N.Suspense,{fallback:a,children:p.jsx(Ng,{toolName:t,connectionId:i,onBack:r})}),e[3]=i,e[4]=r,e[5]=t,e[6]=c):c=e[6],c}const ca=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(h=>h(e,f))}},s=()=>e,l={setState:r,getState:s,getInitialState:()=>a,subscribe:c=>(t.add(c),()=>t.delete(c))},a=e=n(r,s,l);return l},nl=(n=>n?ca(n):ca),Mg=n=>n;function ai(n,e=Mg){const t=Y.useSyncExternalStore(n.subscribe,Y.useCallback(()=>e(n.getState()),[n,e]),Y.useCallback(()=>e(n.getInitialState()),[n,e]));return Y.useDebugValue(t),t}const Og=n=>{const e=nl(n),t=r=>ai(e,r);return Object.assign(t,e),t},Ag=(n=>Og);function Mu(n,e){let t;try{t=n()}catch{return}return{getItem:s=>{var o;const i=a=>a===null?null:JSON.parse(a,void 0),l=(o=t.getItem(s))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(s,o)=>t.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>t.removeItem(s)}}const ci=n=>e=>{try{const t=n(e);return t instanceof Promise?t:{then(r){return ci(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return ci(r)(t)}}}},Ig=(n,e)=>(t,r,s)=>{let o={storage:Mu(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...e},i=!1;const l=new Set,a=new Set;let c=o.storage;if(!c)return n((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...g)},r,s);const u=()=>{const g=o.partialize({...r()});return c.setItem(o.name,{state:g,version:o.version})},d=s.setState;s.setState=(g,y)=>(d(g,y),u());const f=n((...g)=>(t(...g),u()),r,s);s.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!c)return;i=!1,l.forEach(b=>{var k;return b((k=r())!=null?k:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=r())!=null?g:f))||void 0;return ci(c.getItem.bind(c))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate){const k=o.migrate(b.state,b.version);return k instanceof Promise?k.then(C=>[!0,C]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var k;const[C,v]=b;if(h=o.merge(v,(k=r())!=null?k:f),t(h,!0),C)return u()}).then(()=>{x?.(h,void 0),h=r(),i=!0,a.forEach(b=>b(h))}).catch(b=>{x?.(void 0,b)})};return s.persist={setOptions:g=>{o={...o,...g},g.storage&&(c=g.storage)},clearStorage:()=>{c?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:g=>(l.add(g),()=>{l.delete(g)}),onFinishHydration:g=>(a.add(g),()=>{a.delete(g)})},o.skipHydration||m(),h||f},Ou=Ig,{useSyncExternalStoreWithSelector:jg}=cp,Rg=n=>n;function Dg(n,e=Rg,t){const r=jg(n.subscribe,n.getState,n.getInitialState,e,t);return Y.useDebugValue(r),r}const ua=n=>Symbol.iterator in n,da=n=>"entries"in n,fa=(n,e)=>{const t=n instanceof Map?n:new Map(n.entries()),r=e instanceof Map?e:new Map(e.entries());if(t.size!==r.size)return!1;for(const[s,o]of t)if(!r.has(s)||!Object.is(o,r.get(s)))return!1;return!0},Pg=(n,e)=>{const t=n[Symbol.iterator](),r=e[Symbol.iterator]();let s=t.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=t.next(),o=r.next()}return!!s.done&&!!o.done};function Lg(n,e){return Object.is(n,e)?!0:typeof n!="object"||n===null||typeof e!="object"||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e)?!1:ua(n)&&ua(e)?da(n)&&da(e)?fa(n,e):Pg(n,e):fa({entries:()=>Object.entries(n)},{entries:()=>Object.entries(e)})}function $g(n,e="Output"){if(!n)return`interface ${e} {}`;function t(o){if(!o||typeof o!="object")return"unknown";const i=o.type;if(Array.isArray(i))return i.map(l=>r(l)).join(" | ");switch(i){case"string":return o.enum?o.enum.map(l=>`"${l}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const l=o.items;return l?`${t(l)}[]`:"unknown[]"}case"object":return s(o);default:return o.anyOf?o.anyOf.map(t).join(" | "):o.oneOf?o.oneOf.map(t).join(" | "):o.allOf?o.allOf.map(t).join(" & "):"unknown"}}function r(o){switch(o){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function s(o){const i=o.properties;if(!i)return"Record<string, unknown>";const l=new Set(o.required||[]);return`{
|
|
2
2
|
${Object.entries(i).map(([c,u])=>{const d=l.has(c)?"":"?";return`${u.description?` /** ${u.description} */
|
|
3
3
|
`:""} ${c}${d}: ${t(u)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,c as N,j as s}from"./index-
|
|
1
|
+
import{r as n,c as N,j as s}from"./index-A52jfksK.js";import{B as C}from"./button-DodNLkpL.js";import{d as y,j as M,D as z,c as E,b as D,a as S}from"./dropdown-menu-DrQKdl4f.js";import{i as T,a as L,c as V,b as B,T as _}from"./tooltip-BjhP6ibY.js";import{V as W}from"./view-mode-toggle-DAXMt6ZW.js";import{c as $}from"./utils-DgLfrg3u.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function K(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(L,{children:s.jsxs(V,{children:[s.jsx(B,{asChild:!0,children:s.jsx(z,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(_,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(f=>{const j=v===f.id;return s.jsx(y,{onClick:()=>l(f.id),className:$("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(M,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(D,{children:[h,s.jsxs(S,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{K as C,w as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,j as i}from"./index-
|
|
1
|
+
import{c as j,j as i}from"./index-A52jfksK.js";import{C as b}from"./collection-display-button-475jHotV.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as c}from"./index-
|
|
1
|
+
import{c as s,j as c}from"./index-A52jfksK.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as x,j as a}from"./index-
|
|
1
|
+
import{c as x,j as a}from"./index-A52jfksK.js";import{i as u}from"./SearchMd-1Gq7nypQ.js";import{I as b}from"./input-BXHWk19m.js";import{c as g}from"./utils-DgLfrg3u.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as o}from"./index-
|
|
1
|
+
import{c as g,j as o}from"./index-A52jfksK.js";import{c as u}from"./utils-DgLfrg3u.js";import{n as T}from"./collection-display-button-475jHotV.js";import{j as $}from"./dropdown-menu-DrQKdl4f.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-
|
|
1
|
+
import{c as S,j as s}from"./index-A52jfksK.js";import{C as _}from"./card-BHz-BqEu.js";import{c as j}from"./utils-DgLfrg3u.js";import{I as A}from"./use-connection-BX5-4xHw.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as B,c as U,j as s,f as je,a as dt,t as mt,d as ut,b as ft,av as pt}from"./index-CCNaUj2A.js";import{E as G}from"./SearchMd-C_ak4ze3.js";import{E as Ze}from"./error-boundary-DMJQCmxn.js";import{I as be,b as Qe,d as ht,e as xt,c as gt,a as jt}from"./use-connection-BbvAiBvg.js";import{b as bt}from"./use-binding-DdwsXkNS.js";import{E as qe,P as yt,u as Ct,S as vt}from"./index-be58e1VX.js";import{u as Nt,a as wt}from"./use-connection-resources-D-1-SK-8.js";import{B as ye}from"./button-DuitHSR8.js";import{i as Xe}from"./Loading01-Dtm2TLlA.js";import{R as St}from"./resource-tabs-Dx5v9tHv.js";import{V as ze,a as Tt,b as _t}from"./layout-n40g10Oh.js";import{g as Ge}from"./generate-id-Dyweu44Y.js";import{C as Ce}from"./collection-display-button-DgDdVSTg.js";import{C as Ve}from"./collection-search-OoKPetka.js";import{C as Ke}from"./card-DkEpNms8.js";import{b as Ye,D as et,a as tt,d as q}from"./dropdown-menu-CPQpNQmn.js";import{a as st}from"./Copy01-XN5V21c6.js";import{i as ot}from"./DotsVertical-CcNQsTaW.js";import{s as nt,u as $t}from"./use-list-state-DVYCFUpb.js";import{s as it}from"./Trash01-FYPMjpVf.js";import{C as Fe}from"./collection-table-wrapper-DEVlTpj8.js";import{n as He}from"./Inbox01-CIzt2AdR.js";import{B as It}from"./extract-connection-data-Bt1_1dQ8.js";import{A as Dt,g as At,c as kt,b as Pt,d as Lt,e as Mt,a as Rt,f as Et}from"./alert-dialog-DhxQ40TA.js";import{s as Ot}from"./Plus-DF_I5mml.js";import{R as zt,T as Vt}from"./tools-list-BV-qlQqF.js";import"./utils-o1atviYh.js";import"./tooltip-CqCXb38Z.js";import"./auth-CfgXQhXI.js";import"./mcp-oauth-CvO1Z13d.js";import"./use-organization-settings-fWTyw7VB.js";import"./env-vars-editor-BcyBU5xA.js";import"./input-YU6lpVgW.js";import"./use-tool-call-CVPTtLoG.js";import"./useQuery-C4GPpw7d.js";import"./File06-DB55FK-Z.js";import"./Key01-DYiMWoz_.js";import"./form-BfiwCHdz.js";import"./select-C4QWjnSz.js";import"./ChevronDown-BFYjmmoG.js";import"./Terminal-4DdepWh9.js";import"./use-gateway-L1UQyU7-.js";import"./CpuChip02-Nhk4zHXl.js";import"./formatDistanceToNow-BmkU67cZ.js";import"./registry-utils-ulDDT0d8.js";import"./index-DR-B7Y1Z.js";import"./index-T7OaHK12.js";import"./badge-CgUwfcKq.js";import"./ArrowLeft-b0UM4Vui.js";import"./view-mode-toggle-DOtHoBLN.js";import"./use-mobile-B0xRFGhT.js";const Be=({size:t=24,color:e="currentColor",...o})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},B.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Be.displayName="Edit01";function Kt(t,e){const o=t.properties||{};for(const n in o){const l=o[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const i=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of i)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Ft(t){const e=U.c(25),{item:o,schema:i,actions:n}=t;let l;e[0]!==o||e[1]!==i?(l=Kt(i,o),e[0]=o,e[1]=i,e[2]=l):l=e[2];const u=l,y=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let h;e[3]!==n?(h=n&&Object.keys(n).length>0,e[3]=n,e[4]=h):h=e[4];const r=h;let d;e[5]!==u||e[6]!==o.title?(d=s.jsx(be,{icon:u,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=o.title,e[7]=d):d=e[7];let g;e[8]!==o.title?(g=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=g):g=e[9];const c=y||"No description";let f;e[10]!==c?(f=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:c}),e[10]=c,e[11]=f):f=e[11];let x;e[12]!==g||e[13]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,f]}),e[12]=g,e[13]=f,e[14]=x):x=e[14];let j;e[15]!==d||e[16]!==x?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[d,x]}),e[15]=d,e[16]=x,e[17]=j):j=e[17];let a;e[18]!==n||e[19]!==r||e[20]!==o?(a=r&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:qt,onMouseDown:Wt,children:s.jsxs(Ye,{children:[s.jsx(et,{asChild:!0,children:s.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ut,children:s.jsx(ot,{size:20})})}),s.jsxs(tt,{align:"end",onClick:Bt,children:[n.open&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.open?.(o)},children:[s.jsx(nt,{size:16}),"Open"]}),n.edit&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.edit?.(o)},children:[s.jsx(Be,{size:16}),"Edit"]}),n.duplicate&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.duplicate?.(o)},children:[s.jsx(st,{size:16}),"Duplicate"]}),n.delete&&s.jsxs(q,{variant:"destructive",onClick:b=>{b.stopPropagation(),n.delete?.(o)},children:[s.jsx(it,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=r,e[20]=o,e[21]=a):a=e[21];let p;return e[22]!==j||e[23]!==a?(p=s.jsxs(Ke,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,a]}),e[22]=j,e[23]=a,e[24]=p):p=e[24],p}function Bt(t){return t.stopPropagation()}function Ut(t){return t.stopPropagation()}function Wt(t){return t.stopPropagation()}function qt(t){return t.stopPropagation()}const Gt=["icon","avatar","logo"],Je=["created_at","created_by","id"];function Ht(t){return Object.keys(t).find(e=>Gt.includes(e.toLowerCase()))}function rt(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Jt(t){const e=U.c(32),{data:o,schema:i,viewMode:n,onViewModeChange:l,search:u,sortKey:y,sortDirection:h,onSort:r,actions:d,onItemClick:g,headerActions:c,emptyState:f,readOnly:x,columns:j,hideToolbar:a,sortableFields:p}=t,b=l===void 0?es:l,N=h===void 0?"asc":h,T=r===void 0?Yt:r;let w;e[0]!==d?(w=d===void 0?{}:d,e[0]=d,e[1]=w):w=e[1];const _=w,S=g===void 0?Xt:g,L=c===void 0?null:c,A=f===void 0?null:f,R=x===void 0?!1:x,M=j===void 0?void 0:j,v=a===void 0?!1:a,$=p===void 0?void 0:p;let k;e[2]!==M||e[3]!==i||e[4]!==$?(k=M?M.filter(Qt).filter(C=>!$||$.includes(C.id)).map(Zt):rt(i,$),e[2]=M,e[3]=i,e[4]=$,e[5]=k):k=e[5];const D=k;let m;e[6]!==L||e[7]!==v||e[8]!==T||e[9]!==b||e[10]!==N||e[11]!==y||e[12]!==D||e[13]!==n?(m=!v&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:L}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(Ce,{viewMode:n,onViewModeChange:b,sortKey:y,sortDirection:N,onSort:T,sortOptions:D})})]})}),e[6]=L,e[7]=v,e[8]=T,e[9]=b,e[10]=N,e[11]=y,e[12]=D,e[13]=n,e[14]=m):m=e[14];let P;e[15]!==_||e[16]!==M||e[17]!==o||e[18]!==A||e[19]!==S||e[20]!==T||e[21]!==R||e[22]!==i||e[23]!==u||e[24]!==N||e[25]!==y||e[26]!==$||e[27]!==n?(P=n==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:A||s.jsx(qe,{icon:s.jsx(He,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(C=>s.jsx("div",{onClick:()=>S?.(C),className:"cursor-pointer h-full",children:s.jsx(Ft,{item:C,schema:i,readOnly:R,actions:_})},C.id))})}):s.jsx(Fe,{columns:os(M,i,$,_),data:o,sortKey:y,sortDirection:N,onSort:T,onRowClick:S,emptyState:A||s.jsx(qe,{icon:s.jsx(He,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=M,e[17]=o,e[18]=A,e[19]=S,e[20]=T,e[21]=R,e[22]=i,e[23]=u,e[24]=N,e[25]=y,e[26]=$,e[27]=n,e[28]=P):P=e[28];let I;return e[29]!==m||e[30]!==P?(I=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[m,P]}),e[29]=m,e[30]=P,e[31]=I):I=e[31],I}function Zt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Qt(t){return t.sortable!==!1}function Xt(){}function Yt(){}function es(){}function ts(t){return{id:"actions",header:"",render:e=>s.jsxs(Ye,{children:[s.jsx(et,{asChild:!0,children:s.jsx(ye,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(ot,{size:20})})}),s.jsxs(tt,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(nt,{size:16}),"Open"]}),t.edit&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(Be,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(st,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(q,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(it,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function lt(t){const e=t.type;return Array.isArray(e)?e.every(o=>lt({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function ss(t,e){const o=t.properties||{},i=Object.keys(o).filter(r=>{const d=o[r];return d&<(d)}),n=Ht(o),l=[],u=new Set;n&&i.includes(n)&&(l.push(n),u.add(n));const y=["title","description","updated_at","updated_by"];for(const r of y)i.includes(r)&&!u.has(r)&&(l.push(r),u.add(r));const h=i.filter(r=>!u.has(r)&&!Je.includes(r)).sort((r,d)=>r.localeCompare(d));for(const r of h)l.push(r),u.add(r);for(const r of Je)i.includes(r)&&!u.has(r)&&(l.push(r),u.add(r));return l.map(r=>{const d=o[r],g=e?e.includes(r):!["id"].includes(r);return r===n?{id:r,header:"",render:c=>{const f=c[r];return s.jsx(be,{icon:f,name:c.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:r==="description"?{id:r,header:"Description",render:c=>{const f=c[r];return f==null?"—":s.jsx("span",{className:"block truncate max-w-[50ch]",children:String(f)})},sortable:g,cellClassName:"max-w-[50ch]"}:d?.format==="date-time"||r.endsWith("_at")?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:c=>{const f=c[r];return f?s.jsx("span",{className:"block truncate max-w-full",children:new Date(f).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:c=>{const f=c[r];return f==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(f)})},sortable:g,cellClassName:"max-w-[200px]"}})}function os(t,e,o,i){const n=t||ss(e,o);return n.some(y=>y.id==="actions")?n:Object.keys(i).length>0?[...n,ts(i)]:n}function ns(t){const e=U.c(117),{connectionId:o,org:i,activeCollection:n}=t,l=n.name,u=n.schema??It,y=n.hasCreateTool,h=n.hasUpdateTool,r=n.hasDeleteTool,d=je(),{data:g}=dt.useSession(),c=g?.user?.id||"unknown",f=Qe(o);let x;e[0]!==o?(x=gt(o),e[0]=o,e[1]=x):x=e[1];const j=x,a=ht(o,l,j),p=`${o}-${l}`;let b;e[2]!==i||e[3]!==p?(b={namespace:i,resource:p,defaultSortKey:"updated_at"},e[2]=i,e[3]=p,e[4]=b):b=e[4];const{search:N,searchTerm:T,setSearch:w,viewMode:_,setViewMode:S,sortKey:L,sortDirection:A,handleSort:R}=$t(b);let M;e[5]!==T||e[6]!==A||e[7]!==L?(M={searchTerm:T,sortKey:L,sortDirection:A},e[5]=T,e[6]=A,e[7]=L,e[8]=M):M=e[8];const v=xt(o,l,j,M),$=!y&&!h&&!r;let k;e[9]!==l||e[10]!==o||e[11]!==d||e[12]!==i?(k=V=>{d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:V.id}})},e[9]=l,e[10]=o,e[11]=d,e[12]=i,e[13]=k):k=e[13];const D=k;let m;e[14]!==a.create||e[15]!==c?(m=async V=>{const ge=new Date().toISOString();await a.create.mutateAsync({...V,id:Ge("conn"),title:`${V.title} (Copy)`,created_at:ge,updated_at:ge,created_by:c,updated_by:c})},e[14]=a.create,e[15]=c,e[16]=m):m=e[16];const P=m,[I,C]=B.useState(null);let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=V=>{C(V)},e[17]=z):z=e[17];const O=z;let K;e[18]!==D||e[19]!==h?(K=h&&{edit:D},e[18]=D,e[19]=h,e[20]=K):K=e[20];let F;e[21]!==P||e[22]!==y?(F=y&&{duplicate:P},e[21]=P,e[22]=y,e[23]=F):F=e[23];let E;e[24]!==r?(E=r&&{delete:O},e[24]=r,e[25]=E):E=e[25];let W;e[26]!==E||e[27]!==K||e[28]!==F?(W={...K,...F,...E},e[26]=E,e[27]=K,e[28]=F,e[29]=W):W=e[29];const ve=W;let de;e[30]!==a.delete||e[31]!==I?(de=async()=>{I&&(await a.delete.mutateAsync(I.id),C(null))},e[30]=a.delete,e[31]=I,e[32]=de):de=e[32];const Ne=de;let me;e[33]!==a.create||e[34]!==l||e[35]!==o||e[36]!==y||e[37]!==d||e[38]!==i||e[39]!==c?(me=async()=>{if(!y){mt.error("Create operation is not available for this collection");return}const V=new Date().toISOString(),ge={id:Ge("conn"),title:"New Item",description:"A brief description of the item",created_at:V,updated_at:V,created_by:c,updated_by:c};try{const Oe=await a.create.mutateAsync(ge);d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[33]=a.create,e[34]=l,e[35]=o,e[36]=y,e[37]=d,e[38]=i,e[39]=c,e[40]=me):me=e[40];const we=me;let ue;e[41]!==u?(ue=rt(u),e[41]=u,e[42]=ue):ue=e[42];const Se=ue,Ue=(v?.length??0)>0,at=y&&Ue,ct=y&&!Ue&&!N;let fe;e[43]!==a.create||e[44]!==we||e[45]!==y?(fe=y?s.jsxs(ye,{onClick:we,size:"sm",disabled:a.create.isPending,className:"h-7",children:[s.jsx(Ot,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[43]=a.create,e[44]=we,e[45]=y,e[46]=fe):fe=e[46];const We=fe,Te=L;let H;e[47]!==R||e[48]!==S||e[49]!==A||e[50]!==Se||e[51]!==Te||e[52]!==_?(H=s.jsx(Ce,{viewMode:_,onViewModeChange:S,sortKey:Te,sortDirection:A,onSort:R,sortOptions:Se}),e[47]=R,e[48]=S,e[49]=A,e[50]=Se,e[51]=Te,e[52]=_,e[53]=H):H=e[53];const _e=`${l}s`,$e=f?.icon??"grid_view";let J;e[54]!==o||e[55]!==_e||e[56]!==$e?(J=s.jsx(yt,{connectionId:o,title:_e,icon:$e}),e[54]=o,e[55]=_e,e[56]=$e,e[57]=J):J=e[57];const Ie=at&&We;let Z;e[58]!==H||e[59]!==J||e[60]!==Ie?(Z=s.jsxs(ze,{children:[H,J,Ie]}),e[58]=H,e[59]=J,e[60]=Ie,e[61]=Z):Z=e[61];const De=`Search ${l}...`;let Q;e[62]!==w?(Q=V=>{V.key==="Escape"&&(w(""),V.target.blur())},e[62]=w,e[63]=Q):Q=e[63];let X;e[64]!==N||e[65]!==w||e[66]!==De||e[67]!==Q?(X=s.jsx(Ve,{value:N,onChange:w,placeholder:De,onKeyDown:Q}),e[64]=N,e[65]=w,e[66]=De,e[67]=Q,e[68]=X):X=e[68];let Y;e[69]!==v?(Y=v??[],e[69]=v,e[70]=Y):Y=e[70];const Ae=L;let ee;e[71]!==D?(ee=V=>D(V),e[71]=D,e[72]=ee):ee=e[72];const ke="No items found",Pe=N?"Try adjusting your search terms":"This collection doesn't have any items yet.",Le=ct?We:void 0;let te;e[73]!==ke||e[74]!==Pe||e[75]!==Le?(te=s.jsx(G,{image:null,title:ke,description:Pe,actions:Le}),e[73]=ke,e[74]=Pe,e[75]=Le,e[76]=te):te=e[76];let se;e[77]!==R||e[78]!==$||e[79]!==ve||e[80]!==u||e[81]!==N||e[82]!==w||e[83]!==S||e[84]!==A||e[85]!==Y||e[86]!==Ae||e[87]!==ee||e[88]!==te||e[89]!==_?(se=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Jt,{hideToolbar:!0,data:Y,schema:u,viewMode:_,onViewModeChange:S,search:N,onSearchChange:w,sortKey:Ae,sortDirection:A,onSort:R,actions:ve,onItemClick:ee,readOnly:$,emptyState:te})}),e[77]=R,e[78]=$,e[79]=ve,e[80]=u,e[81]=N,e[82]=w,e[83]=S,e[84]=A,e[85]=Y,e[86]=Ae,e[87]=ee,e[88]=te,e[89]=_,e[90]=se):se=e[90];let oe;e[91]!==X||e[92]!==se?(oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[X,se]}),e[91]=X,e[92]=se,e[93]=oe):oe=e[93];const Me=!!I;let pe;e[94]===Symbol.for("react.memo_cache_sentinel")?(pe=V=>{V||C(null)},e[94]=pe):pe=e[94];let he;e[95]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(kt,{children:"Delete item?"}),e[95]=he):he=e[95];const Re=I?.title;let ne;e[96]!==Re?(ne=s.jsxs(Pt,{children:[he,s.jsxs(Lt,{children:['Are you sure you want to delete "',Re,'"? This action cannot be undone.']})]}),e[96]=Re,e[97]=ne):ne=e[97];let ie;e[98]!==a.delete.isPending?(ie=s.jsx(Dt,{disabled:a.delete.isPending,children:"Cancel"}),e[98]=a.delete.isPending,e[99]=ie):ie=e[99];const Ee=a.delete.isPending?"Deleting...":"Delete";let re;e[100]!==a.delete.isPending||e[101]!==Ne||e[102]!==Ee?(re=s.jsx(At,{onClick:Ne,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[100]=a.delete.isPending,e[101]=Ne,e[102]=Ee,e[103]=re):re=e[103];let le;e[104]!==ie||e[105]!==re?(le=s.jsxs(Mt,{children:[ie,re]}),e[104]=ie,e[105]=re,e[106]=le):le=e[106];let ae;e[107]!==ne||e[108]!==le?(ae=s.jsxs(Rt,{children:[ne,le]}),e[107]=ne,e[108]=le,e[109]=ae):ae=e[109];let ce;e[110]!==Me||e[111]!==ae?(ce=s.jsx(Et,{open:Me,onOpenChange:pe,children:ae}),e[110]=Me,e[111]=ae,e[112]=ce):ce=e[112];let xe;return e[113]!==Z||e[114]!==oe||e[115]!==ce?(xe=s.jsxs(s.Fragment,{children:[Z,oe,ce]}),e[113]=Z,e[114]=oe,e[115]=ce,e[116]=xe):xe=e[116],xe}function is(t){const e=U.c(39),{prompts:o,connectionId:i,org:n,onPromptClick:l,showToolbar:u,emptyMessage:y}=t,h=u===void 0?!0:u,r=y===void 0?"This connection doesn't have any prompts yet.":y,d=je(),[g,c]=B.useState(""),[f,x]=B.useState("table"),[j,a]=B.useState("name"),[p,b]=B.useState("asc");let N;e[0]!==p||e[1]!==j?(N=C=>{j===C?(b(ds),p==="desc"&&a(void 0)):(a(C),b("asc"))},e[0]=p,e[1]=j,e[2]=N):N=e[2];const T=N;let w;e[3]!==i||e[4]!==d||e[5]!==l||e[6]!==n?(w=C=>{l?l(C):i&&n&&d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:n,connectionId:i,collectionName:"prompts",itemId:encodeURIComponent(C.name)}})},e[3]=i,e[4]=d,e[5]=l,e[6]=n,e[7]=w):w=e[7];const _=w;let S;if(e[8]!==o||e[9]!==g||e[10]!==p||e[11]!==j){const C=!o||o.length===0?[]:g.trim()?(()=>{const z=g.toLowerCase();return o.filter(O=>O.name.toLowerCase().includes(z)||O.description&&O.description.toLowerCase().includes(z))})():o;S=!j||!p?C:[...C].sort((z,O)=>{const K=z[j]||"",F=O[j]||"",E=String(K).localeCompare(String(F));return p==="asc"?E:-E}),e[8]=o,e[9]=g,e[10]=p,e[11]=j,e[12]=S}else S=e[12];const L=S;let A;e[13]===Symbol.for("react.memo_cache_sentinel")?(A=[{id:"name",header:"Name",render:cs,sortable:!0},{id:"description",header:"Description",render:as,cellClassName:"flex-1",sortable:!0}],e[13]=A):A=e[13];const R=A;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=R.filter(ls).map(rs),e[14]=M):M=e[14];const v=M;let $;e[15]!==T||e[16]!==h||e[17]!==p||e[18]!==j||e[19]!==f?($=h&&s.jsx(ze,{children:s.jsx(Ce,{viewMode:f,onViewModeChange:x,sortKey:j,sortDirection:p,onSort:T,sortOptions:v})}),e[15]=T,e[16]=h,e[17]=p,e[18]=j,e[19]=f,e[20]=$):$=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=C=>{C.key==="Escape"&&(c(""),C.target.blur())},e[21]=k):k=e[21];let D;e[22]!==g?(D=s.jsx(Ve,{value:g,onChange:c,placeholder:"Search prompts...",onKeyDown:k}),e[22]=g,e[23]=D):D=e[23];let m;e[24]!==r||e[25]!==_||e[26]!==T||e[27]!==g||e[28]!==p||e[29]!==j||e[30]!==L||e[31]!==f?(m=f==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:L.length===0?s.jsx(G,{image:null,title:g?"No prompts found":"No prompts available",description:g?"Try adjusting your search terms":r}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:L.map(C=>s.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>_(C),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(be,{icon:null,name:C.name,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.name}),s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:C.description||"No description"})]})]})},C.name))})}):s.jsx(Fe,{columns:R,data:L,isLoading:!1,sortKey:j,sortDirection:p,onSort:T,onRowClick:C=>_(C),emptyState:s.jsx(G,{image:null,title:g?"No prompts found":"No prompts available",description:g?"Try adjusting your search terms":r})}),e[24]=r,e[25]=_,e[26]=T,e[27]=g,e[28]=p,e[29]=j,e[30]=L,e[31]=f,e[32]=m):m=e[32];let P;e[33]!==D||e[34]!==m?(P=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,m]}),e[33]=D,e[34]=m,e[35]=P):P=e[35];let I;return e[36]!==P||e[37]!==$?(I=s.jsxs(s.Fragment,{children:[$,P]}),e[36]=P,e[37]=$,e[38]=I):I=e[38],I}function rs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function ls(t){return t.sortable}function as(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function cs(t){return s.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function ds(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function ms(t){const e=U.c(4),{prompts:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(is,{prompts:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function us(t){const e=U.c(2),{repository:o}=t;let i;return e[0]!==o?(i=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(zt,{repository:o})}),e[0]=o,e[1]=i):i=e[1],i}function fs(t){const e=U.c(36),{resources:o,onResourceClick:i,showToolbar:n,emptyMessage:l}=t,u=n===void 0?!0:n,y=l===void 0?"This connection doesn't have any resources yet.":l,[h,r]=B.useState(""),[d,g]=B.useState("table"),[c,f]=B.useState("name"),[x,j]=B.useState("asc");let a;e[0]!==x||e[1]!==c?(a=m=>{c===m?(j(ys),x==="desc"&&f(void 0)):(f(m),j("asc"))},e[0]=x,e[1]=c,e[2]=a):a=e[2];const p=a;let b;e[3]!==i?(b=m=>{i&&i(m)},e[3]=i,e[4]=b):b=e[4];const N=b;let T;if(e[5]!==o||e[6]!==h||e[7]!==x||e[8]!==c){const m=!o||o.length===0?[]:h.trim()?(()=>{const P=h.toLowerCase();return o.filter(I=>I.uri.toLowerCase().includes(P)||I.name&&I.name.toLowerCase().includes(P)||I.description&&I.description.toLowerCase().includes(P))})():o;T=!c||!x?m:[...m].sort((P,I)=>{const C=P[c]||"",z=I[c]||"",O=String(C).localeCompare(String(z));return x==="asc"?O:-O}),e[5]=o,e[6]=h,e[7]=x,e[8]=c,e[9]=T}else T=e[9];const w=T;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:bs,sortable:!0},{id:"uri",header:"URI",render:js,sortable:!0},{id:"description",header:"Description",render:gs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:xs,sortable:!0}],e[10]=_):_=e[10];const S=_;let L;e[11]===Symbol.for("react.memo_cache_sentinel")?(L=S.filter(hs).map(ps),e[11]=L):L=e[11];const A=L;let R;e[12]!==p||e[13]!==u||e[14]!==x||e[15]!==c||e[16]!==d?(R=u&&s.jsx(ze,{children:s.jsx(Ce,{viewMode:d,onViewModeChange:g,sortKey:c,sortDirection:x,onSort:p,sortOptions:A})}),e[12]=p,e[13]=u,e[14]=x,e[15]=c,e[16]=d,e[17]=R):R=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=m=>{m.key==="Escape"&&(r(""),m.target.blur())},e[18]=M):M=e[18];let v;e[19]!==h?(v=s.jsx(Ve,{value:h,onChange:r,placeholder:"Search resources...",onKeyDown:M}),e[19]=h,e[20]=v):v=e[20];let $;e[21]!==y||e[22]!==N||e[23]!==p||e[24]!==h||e[25]!==x||e[26]!==c||e[27]!==w||e[28]!==d?($=d==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:w.length===0?s.jsx(G,{image:null,title:h?"No resources found":"No resources available",description:h?"Try adjusting your search terms":y}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:w.map(m=>s.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>N(m),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(be,{icon:null,name:m.name||m.uri,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:m.name||m.uri}),s.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:m.uri}),m.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:m.description})]})]})},m.uri))})}):s.jsx(Fe,{columns:S,data:w,isLoading:!1,sortKey:c,sortDirection:x,onSort:p,onRowClick:m=>N(m),emptyState:s.jsx(G,{image:null,title:h?"No resources found":"No resources available",description:h?"Try adjusting your search terms":y})}),e[21]=y,e[22]=N,e[23]=p,e[24]=h,e[25]=x,e[26]=c,e[27]=w,e[28]=d,e[29]=$):$=e[29];let k;e[30]!==v||e[31]!==$?(k=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v,$]}),e[30]=v,e[31]=$,e[32]=k):k=e[32];let D;return e[33]!==k||e[34]!==R?(D=s.jsxs(s.Fragment,{children:[R,k]}),e[33]=k,e[34]=R,e[35]=D):D=e[35],D}function ps(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function hs(t){return t.sortable}function xs(t){return s.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function js(t){return s.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function bs(t){return s.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function ys(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Cs(t){const e=U.c(4),{resources:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(fs,{resources:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function vs(t){const e=U.c(4),{tools:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(Vt,{tools:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function Ns(t){const e=U.c(60),{connection:o,connectionId:i,org:n,requestedTabId:l,collections:u,onUpdate:y,isUpdating:h,prompts:r,resources:d}=t,g=pt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const f=je(c);let x;e[1]!==i?(x={connectionId:i},e[1]=i,e[2]=x):x=e[2];const j=Ct(x),a=j.isAuthenticated,p=o?.metadata?.repository,b=!!p?.url,N=o?.tools?.length??0,T=r.length,w=d.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let S;e[4]!==a||e[5]!==N?(S=a&&N>0?[{id:"tools",label:"Tools",count:N}]:[],e[4]=a,e[5]=N,e[6]=S):S=e[6];let L;e[7]!==a||e[8]!==T?(L=a&&T>0?[{id:"prompts",label:"Prompts",count:T}]:[],e[7]=a,e[8]=T,e[9]=L):L=e[9];let A;e[10]!==a||e[11]!==w?(A=a&&w>0?[{id:"resources",label:"Resources",count:w}]:[],e[10]=a,e[11]=w,e[12]=A):A=e[12];let R;if(e[13]!==u||e[14]!==b||e[15]!==a||e[16]!==S||e[17]!==L||e[18]!==A){let E;e[20]!==b?(E=b?[{id:"readme",label:"README"}]:[],e[20]=b,e[21]=E):E=e[21],R=[_,...S,...L,...A,...a?(u||[]).map(ws):[],...E],e[13]=u,e[14]=b,e[15]=a,e[16]=S,e[17]=L,e[18]=A,e[19]=R}else R=e[19];const M=R,v=M.some(E=>E.id===l)?l:"settings";let $;e[22]!==f?($=E=>{f({search:W=>({...W,tab:E}),replace:!0})},e[22]=f,e[23]=$):$=e[23];const k=$;let D;e[24]!==u?(D=u||[],e[24]=u,e[25]=D):D=e[25];let m;if(e[26]!==v||e[27]!==D){let E;e[29]!==v?(E=W=>W.name===v,e[29]=v,e[30]=E):E=e[30],m=D.find(E),e[26]=v,e[27]=D,e[28]=m}else m=e[28];const P=m;let I;e[31]!==g.history?(I=()=>g.history.back(),e[31]=g.history,e[32]=I):I=e[32];let C;e[33]!==v||e[34]!==k||e[35]!==M?(C=s.jsx(Tt,{children:s.jsx(St,{tabs:M,activeTab:v,onTabChange:k})}),e[33]=v,e[34]=k,e[35]=M,e[36]=C):C=e[36];let z;e[37]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=z):z=e[37];let O;e[38]!==P||e[39]!==v||e[40]!==j.supportsOAuth||e[41]!==o||e[42]!==i||e[43]!==k||e[44]!==b||e[45]!==a||e[46]!==h||e[47]!==y||e[48]!==n||e[49]!==r||e[50]!==p||e[51]!==d?(O=s.jsx(B.Suspense,{fallback:z,children:v==="tools"?s.jsx(vs,{tools:o.tools??void 0,connectionId:i,org:n}):v==="prompts"?s.jsx(ms,{prompts:r,connectionId:i,org:n}):v==="resources"?s.jsx(Cs,{resources:d,connectionId:i,org:n}):v==="settings"?s.jsx(vt,{connection:o,onUpdate:y,isUpdating:h,isMCPAuthenticated:a,supportsOAuth:j.supportsOAuth,onViewReadme:b?()=>k("readme"):void 0}):v==="readme"&&b?s.jsx(us,{repository:p}):P&&a?s.jsx(ns,{connectionId:i,org:n,activeCollection:P},v):s.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=P,e[39]=v,e[40]=j.supportsOAuth,e[41]=o,e[42]=i,e[43]=k,e[44]=b,e[45]=a,e[46]=h,e[47]=y,e[48]=n,e[49]=r,e[50]=p,e[51]=d,e[52]=O):O=e[52];let K;e[53]!==v||e[54]!==O?(K=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(Ze,{children:O},v)})}),e[53]=v,e[54]=O,e[55]=K):K=e[55];let F;return e[56]!==I||e[57]!==C||e[58]!==K?(F=s.jsxs(_t,{onBack:I,children:[C,K]}),e[56]=I,e[57]=C,e[58]=K,e[59]=F):F=e[59],F}function ws(t){return{id:t.name,label:t.displayName}}function Ss(){const t=U.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=je(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/mcps/$connectionId"},t[1]=i):i=t[1];const{connectionId:n,org:l}=ut(i);let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/mcps/$connectionId"},t[2]=u):u=t[2];const h=ft(u).tab||"settings",r=Qe(n),d=jt(),g=bt(r??void 0);let c;t[3]!==n?(c=[n],t[3]=n,t[4]=c):c=t[4];const{promptsMap:f}=Nt(c);let x;t[5]!==n?(x=[n],t[5]=n,t[6]=x):x=t[6];const{resourcesMap:j}=wt(x);let a;t[7]!==n||t[8]!==f?(a=f.get(n)??[],t[7]=n,t[8]=f,t[9]=a):a=t[9];const p=a;let b;t[10]!==n||t[11]!==j?(b=j.get(n)??[],t[10]=n,t[11]=j,t[12]=b):b=t[12];const N=b;let T;t[13]!==d.update||t[14]!==n?(T=async S=>{await d.update.mutateAsync({id:n,data:S})},t[13]=d.update,t[14]=n,t[15]=T):T=t[15];const w=T;if(!r){let S;return t[16]!==o||t[17]!==l?(S=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(ye,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=o,t[17]=l,t[18]=S):S=t[18],S}let _;return t[19]!==d.update.isPending||t[20]!==g||t[21]!==r||t[22]!==n||t[23]!==w||t[24]!==l||t[25]!==p||t[26]!==h||t[27]!==N?(_=s.jsx(Ns,{org:l,connection:r,connectionId:n,requestedTabId:h,collections:g,onUpdate:w,isUpdating:d.update.isPending,prompts:p,resources:N}),t[19]=d.update.isPending,t[20]=g,t[21]=r,t[22]=n,t[23]=w,t[24]=l,t[25]=p,t[26]=h,t[27]=N,t[28]=_):_=t[28],_}function Ts(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ze,{children:s.jsx(B.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Ss,{})})}),t[0]=e):e=t[0],e}function To(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ts,{}),t[0]=e):e=t[0],e}export{To as default};
|
|
1
|
+
import{r as B,c as U,j as s,f as je,a as dt,t as mt,d as ut,b as ft,av as pt}from"./index-A52jfksK.js";import{E as G}from"./SearchMd-1Gq7nypQ.js";import{E as Ze}from"./error-boundary-CdmYlIj7.js";import{I as be,b as Qe,d as ht,e as xt,c as gt,a as jt}from"./use-connection-BX5-4xHw.js";import{b as bt}from"./use-binding-CapMpNVF.js";import{E as qe,P as yt,u as Ct,S as vt}from"./index-td_4XAxf.js";import{u as Nt,a as wt}from"./use-connection-resources-FqHsvBSA.js";import{B as ye}from"./button-DodNLkpL.js";import{i as Xe}from"./Loading01-r04aEG5T.js";import{R as St}from"./resource-tabs-ru5yaRIE.js";import{V as ze,a as Tt,b as _t}from"./layout-dxbGsEKV.js";import{g as Ge}from"./generate-id-Dyweu44Y.js";import{C as Ce}from"./collection-display-button-475jHotV.js";import{C as Ve}from"./collection-search-DVBnlN6E.js";import{C as Ke}from"./card-BHz-BqEu.js";import{b as Ye,D as et,a as tt,d as q}from"./dropdown-menu-DrQKdl4f.js";import{a as st}from"./Copy01-CHjgpWtl.js";import{i as ot}from"./DotsVertical-CIfapH0j.js";import{s as nt,u as $t}from"./use-list-state-7NLbXyOC.js";import{s as it}from"./Trash01-DVxmznxT.js";import{C as Fe}from"./collection-table-wrapper-DQ4F9pbh.js";import{n as He}from"./Inbox01-DCkU3Xgq.js";import{B as It}from"./extract-connection-data-Ty2DjF1e.js";import{A as Dt,g as At,c as kt,b as Pt,d as Lt,e as Mt,a as Rt,f as Et}from"./alert-dialog-DdP064l-.js";import{s as Ot}from"./Plus-CS_Y2Vnc.js";import{R as zt,T as Vt}from"./tools-list-BsHebq88.js";import"./utils-DgLfrg3u.js";import"./tooltip-BjhP6ibY.js";import"./auth-AUS48lXs.js";import"./mcp-oauth-D7V7V-GS.js";import"./use-organization-settings-BAhAEDx8.js";import"./env-vars-editor-DEYac6H7.js";import"./input-BXHWk19m.js";import"./use-tool-call-CQCb5PBf.js";import"./useQuery-ojqdZMTH.js";import"./File06-CBkqKj5m.js";import"./Key01-5nxXQgMM.js";import"./form-Bus-fIfC.js";import"./select-Be0LRVWn.js";import"./ChevronDown-g4L12M9A.js";import"./Terminal-DYN6gEAz.js";import"./use-gateway-CseaalWF.js";import"./CpuChip02-DlCI7cQJ.js";import"./formatDistanceToNow-D46rGC8T.js";import"./registry-utils-ulDDT0d8.js";import"./index-DDiLOLYT.js";import"./index-JV0IIYp6.js";import"./badge-1WraHGEG.js";import"./ArrowLeft-CvFDkdiU.js";import"./view-mode-toggle-DAXMt6ZW.js";import"./use-mobile-TpeNqylz.js";const Be=({size:t=24,color:e="currentColor",...o})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},B.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Be.displayName="Edit01";function Kt(t,e){const o=t.properties||{};for(const n in o){const l=o[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const i=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of i)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Ft(t){const e=U.c(25),{item:o,schema:i,actions:n}=t;let l;e[0]!==o||e[1]!==i?(l=Kt(i,o),e[0]=o,e[1]=i,e[2]=l):l=e[2];const u=l,y=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let h;e[3]!==n?(h=n&&Object.keys(n).length>0,e[3]=n,e[4]=h):h=e[4];const r=h;let d;e[5]!==u||e[6]!==o.title?(d=s.jsx(be,{icon:u,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=o.title,e[7]=d):d=e[7];let g;e[8]!==o.title?(g=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=g):g=e[9];const c=y||"No description";let f;e[10]!==c?(f=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:c}),e[10]=c,e[11]=f):f=e[11];let x;e[12]!==g||e[13]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,f]}),e[12]=g,e[13]=f,e[14]=x):x=e[14];let j;e[15]!==d||e[16]!==x?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[d,x]}),e[15]=d,e[16]=x,e[17]=j):j=e[17];let a;e[18]!==n||e[19]!==r||e[20]!==o?(a=r&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:qt,onMouseDown:Wt,children:s.jsxs(Ye,{children:[s.jsx(et,{asChild:!0,children:s.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ut,children:s.jsx(ot,{size:20})})}),s.jsxs(tt,{align:"end",onClick:Bt,children:[n.open&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.open?.(o)},children:[s.jsx(nt,{size:16}),"Open"]}),n.edit&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.edit?.(o)},children:[s.jsx(Be,{size:16}),"Edit"]}),n.duplicate&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.duplicate?.(o)},children:[s.jsx(st,{size:16}),"Duplicate"]}),n.delete&&s.jsxs(q,{variant:"destructive",onClick:b=>{b.stopPropagation(),n.delete?.(o)},children:[s.jsx(it,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=r,e[20]=o,e[21]=a):a=e[21];let p;return e[22]!==j||e[23]!==a?(p=s.jsxs(Ke,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,a]}),e[22]=j,e[23]=a,e[24]=p):p=e[24],p}function Bt(t){return t.stopPropagation()}function Ut(t){return t.stopPropagation()}function Wt(t){return t.stopPropagation()}function qt(t){return t.stopPropagation()}const Gt=["icon","avatar","logo"],Je=["created_at","created_by","id"];function Ht(t){return Object.keys(t).find(e=>Gt.includes(e.toLowerCase()))}function rt(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Jt(t){const e=U.c(32),{data:o,schema:i,viewMode:n,onViewModeChange:l,search:u,sortKey:y,sortDirection:h,onSort:r,actions:d,onItemClick:g,headerActions:c,emptyState:f,readOnly:x,columns:j,hideToolbar:a,sortableFields:p}=t,b=l===void 0?es:l,N=h===void 0?"asc":h,T=r===void 0?Yt:r;let w;e[0]!==d?(w=d===void 0?{}:d,e[0]=d,e[1]=w):w=e[1];const _=w,S=g===void 0?Xt:g,L=c===void 0?null:c,A=f===void 0?null:f,R=x===void 0?!1:x,M=j===void 0?void 0:j,v=a===void 0?!1:a,$=p===void 0?void 0:p;let k;e[2]!==M||e[3]!==i||e[4]!==$?(k=M?M.filter(Qt).filter(C=>!$||$.includes(C.id)).map(Zt):rt(i,$),e[2]=M,e[3]=i,e[4]=$,e[5]=k):k=e[5];const D=k;let m;e[6]!==L||e[7]!==v||e[8]!==T||e[9]!==b||e[10]!==N||e[11]!==y||e[12]!==D||e[13]!==n?(m=!v&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:L}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(Ce,{viewMode:n,onViewModeChange:b,sortKey:y,sortDirection:N,onSort:T,sortOptions:D})})]})}),e[6]=L,e[7]=v,e[8]=T,e[9]=b,e[10]=N,e[11]=y,e[12]=D,e[13]=n,e[14]=m):m=e[14];let P;e[15]!==_||e[16]!==M||e[17]!==o||e[18]!==A||e[19]!==S||e[20]!==T||e[21]!==R||e[22]!==i||e[23]!==u||e[24]!==N||e[25]!==y||e[26]!==$||e[27]!==n?(P=n==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:A||s.jsx(qe,{icon:s.jsx(He,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(C=>s.jsx("div",{onClick:()=>S?.(C),className:"cursor-pointer h-full",children:s.jsx(Ft,{item:C,schema:i,readOnly:R,actions:_})},C.id))})}):s.jsx(Fe,{columns:os(M,i,$,_),data:o,sortKey:y,sortDirection:N,onSort:T,onRowClick:S,emptyState:A||s.jsx(qe,{icon:s.jsx(He,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=M,e[17]=o,e[18]=A,e[19]=S,e[20]=T,e[21]=R,e[22]=i,e[23]=u,e[24]=N,e[25]=y,e[26]=$,e[27]=n,e[28]=P):P=e[28];let I;return e[29]!==m||e[30]!==P?(I=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[m,P]}),e[29]=m,e[30]=P,e[31]=I):I=e[31],I}function Zt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Qt(t){return t.sortable!==!1}function Xt(){}function Yt(){}function es(){}function ts(t){return{id:"actions",header:"",render:e=>s.jsxs(Ye,{children:[s.jsx(et,{asChild:!0,children:s.jsx(ye,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(ot,{size:20})})}),s.jsxs(tt,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(nt,{size:16}),"Open"]}),t.edit&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(Be,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(st,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(q,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(it,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function lt(t){const e=t.type;return Array.isArray(e)?e.every(o=>lt({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function ss(t,e){const o=t.properties||{},i=Object.keys(o).filter(r=>{const d=o[r];return d&<(d)}),n=Ht(o),l=[],u=new Set;n&&i.includes(n)&&(l.push(n),u.add(n));const y=["title","description","updated_at","updated_by"];for(const r of y)i.includes(r)&&!u.has(r)&&(l.push(r),u.add(r));const h=i.filter(r=>!u.has(r)&&!Je.includes(r)).sort((r,d)=>r.localeCompare(d));for(const r of h)l.push(r),u.add(r);for(const r of Je)i.includes(r)&&!u.has(r)&&(l.push(r),u.add(r));return l.map(r=>{const d=o[r],g=e?e.includes(r):!["id"].includes(r);return r===n?{id:r,header:"",render:c=>{const f=c[r];return s.jsx(be,{icon:f,name:c.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:r==="description"?{id:r,header:"Description",render:c=>{const f=c[r];return f==null?"—":s.jsx("span",{className:"block truncate max-w-[50ch]",children:String(f)})},sortable:g,cellClassName:"max-w-[50ch]"}:d?.format==="date-time"||r.endsWith("_at")?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:c=>{const f=c[r];return f?s.jsx("span",{className:"block truncate max-w-full",children:new Date(f).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:c=>{const f=c[r];return f==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(f)})},sortable:g,cellClassName:"max-w-[200px]"}})}function os(t,e,o,i){const n=t||ss(e,o);return n.some(y=>y.id==="actions")?n:Object.keys(i).length>0?[...n,ts(i)]:n}function ns(t){const e=U.c(117),{connectionId:o,org:i,activeCollection:n}=t,l=n.name,u=n.schema??It,y=n.hasCreateTool,h=n.hasUpdateTool,r=n.hasDeleteTool,d=je(),{data:g}=dt.useSession(),c=g?.user?.id||"unknown",f=Qe(o);let x;e[0]!==o?(x=gt(o),e[0]=o,e[1]=x):x=e[1];const j=x,a=ht(o,l,j),p=`${o}-${l}`;let b;e[2]!==i||e[3]!==p?(b={namespace:i,resource:p,defaultSortKey:"updated_at"},e[2]=i,e[3]=p,e[4]=b):b=e[4];const{search:N,searchTerm:T,setSearch:w,viewMode:_,setViewMode:S,sortKey:L,sortDirection:A,handleSort:R}=$t(b);let M;e[5]!==T||e[6]!==A||e[7]!==L?(M={searchTerm:T,sortKey:L,sortDirection:A},e[5]=T,e[6]=A,e[7]=L,e[8]=M):M=e[8];const v=xt(o,l,j,M),$=!y&&!h&&!r;let k;e[9]!==l||e[10]!==o||e[11]!==d||e[12]!==i?(k=V=>{d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:V.id}})},e[9]=l,e[10]=o,e[11]=d,e[12]=i,e[13]=k):k=e[13];const D=k;let m;e[14]!==a.create||e[15]!==c?(m=async V=>{const ge=new Date().toISOString();await a.create.mutateAsync({...V,id:Ge("conn"),title:`${V.title} (Copy)`,created_at:ge,updated_at:ge,created_by:c,updated_by:c})},e[14]=a.create,e[15]=c,e[16]=m):m=e[16];const P=m,[I,C]=B.useState(null);let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=V=>{C(V)},e[17]=z):z=e[17];const O=z;let K;e[18]!==D||e[19]!==h?(K=h&&{edit:D},e[18]=D,e[19]=h,e[20]=K):K=e[20];let F;e[21]!==P||e[22]!==y?(F=y&&{duplicate:P},e[21]=P,e[22]=y,e[23]=F):F=e[23];let E;e[24]!==r?(E=r&&{delete:O},e[24]=r,e[25]=E):E=e[25];let W;e[26]!==E||e[27]!==K||e[28]!==F?(W={...K,...F,...E},e[26]=E,e[27]=K,e[28]=F,e[29]=W):W=e[29];const ve=W;let de;e[30]!==a.delete||e[31]!==I?(de=async()=>{I&&(await a.delete.mutateAsync(I.id),C(null))},e[30]=a.delete,e[31]=I,e[32]=de):de=e[32];const Ne=de;let me;e[33]!==a.create||e[34]!==l||e[35]!==o||e[36]!==y||e[37]!==d||e[38]!==i||e[39]!==c?(me=async()=>{if(!y){mt.error("Create operation is not available for this collection");return}const V=new Date().toISOString(),ge={id:Ge("conn"),title:"New Item",description:"A brief description of the item",created_at:V,updated_at:V,created_by:c,updated_by:c};try{const Oe=await a.create.mutateAsync(ge);d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[33]=a.create,e[34]=l,e[35]=o,e[36]=y,e[37]=d,e[38]=i,e[39]=c,e[40]=me):me=e[40];const we=me;let ue;e[41]!==u?(ue=rt(u),e[41]=u,e[42]=ue):ue=e[42];const Se=ue,Ue=(v?.length??0)>0,at=y&&Ue,ct=y&&!Ue&&!N;let fe;e[43]!==a.create||e[44]!==we||e[45]!==y?(fe=y?s.jsxs(ye,{onClick:we,size:"sm",disabled:a.create.isPending,className:"h-7",children:[s.jsx(Ot,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[43]=a.create,e[44]=we,e[45]=y,e[46]=fe):fe=e[46];const We=fe,Te=L;let H;e[47]!==R||e[48]!==S||e[49]!==A||e[50]!==Se||e[51]!==Te||e[52]!==_?(H=s.jsx(Ce,{viewMode:_,onViewModeChange:S,sortKey:Te,sortDirection:A,onSort:R,sortOptions:Se}),e[47]=R,e[48]=S,e[49]=A,e[50]=Se,e[51]=Te,e[52]=_,e[53]=H):H=e[53];const _e=`${l}s`,$e=f?.icon??"grid_view";let J;e[54]!==o||e[55]!==_e||e[56]!==$e?(J=s.jsx(yt,{connectionId:o,title:_e,icon:$e}),e[54]=o,e[55]=_e,e[56]=$e,e[57]=J):J=e[57];const Ie=at&&We;let Z;e[58]!==H||e[59]!==J||e[60]!==Ie?(Z=s.jsxs(ze,{children:[H,J,Ie]}),e[58]=H,e[59]=J,e[60]=Ie,e[61]=Z):Z=e[61];const De=`Search ${l}...`;let Q;e[62]!==w?(Q=V=>{V.key==="Escape"&&(w(""),V.target.blur())},e[62]=w,e[63]=Q):Q=e[63];let X;e[64]!==N||e[65]!==w||e[66]!==De||e[67]!==Q?(X=s.jsx(Ve,{value:N,onChange:w,placeholder:De,onKeyDown:Q}),e[64]=N,e[65]=w,e[66]=De,e[67]=Q,e[68]=X):X=e[68];let Y;e[69]!==v?(Y=v??[],e[69]=v,e[70]=Y):Y=e[70];const Ae=L;let ee;e[71]!==D?(ee=V=>D(V),e[71]=D,e[72]=ee):ee=e[72];const ke="No items found",Pe=N?"Try adjusting your search terms":"This collection doesn't have any items yet.",Le=ct?We:void 0;let te;e[73]!==ke||e[74]!==Pe||e[75]!==Le?(te=s.jsx(G,{image:null,title:ke,description:Pe,actions:Le}),e[73]=ke,e[74]=Pe,e[75]=Le,e[76]=te):te=e[76];let se;e[77]!==R||e[78]!==$||e[79]!==ve||e[80]!==u||e[81]!==N||e[82]!==w||e[83]!==S||e[84]!==A||e[85]!==Y||e[86]!==Ae||e[87]!==ee||e[88]!==te||e[89]!==_?(se=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Jt,{hideToolbar:!0,data:Y,schema:u,viewMode:_,onViewModeChange:S,search:N,onSearchChange:w,sortKey:Ae,sortDirection:A,onSort:R,actions:ve,onItemClick:ee,readOnly:$,emptyState:te})}),e[77]=R,e[78]=$,e[79]=ve,e[80]=u,e[81]=N,e[82]=w,e[83]=S,e[84]=A,e[85]=Y,e[86]=Ae,e[87]=ee,e[88]=te,e[89]=_,e[90]=se):se=e[90];let oe;e[91]!==X||e[92]!==se?(oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[X,se]}),e[91]=X,e[92]=se,e[93]=oe):oe=e[93];const Me=!!I;let pe;e[94]===Symbol.for("react.memo_cache_sentinel")?(pe=V=>{V||C(null)},e[94]=pe):pe=e[94];let he;e[95]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(kt,{children:"Delete item?"}),e[95]=he):he=e[95];const Re=I?.title;let ne;e[96]!==Re?(ne=s.jsxs(Pt,{children:[he,s.jsxs(Lt,{children:['Are you sure you want to delete "',Re,'"? This action cannot be undone.']})]}),e[96]=Re,e[97]=ne):ne=e[97];let ie;e[98]!==a.delete.isPending?(ie=s.jsx(Dt,{disabled:a.delete.isPending,children:"Cancel"}),e[98]=a.delete.isPending,e[99]=ie):ie=e[99];const Ee=a.delete.isPending?"Deleting...":"Delete";let re;e[100]!==a.delete.isPending||e[101]!==Ne||e[102]!==Ee?(re=s.jsx(At,{onClick:Ne,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[100]=a.delete.isPending,e[101]=Ne,e[102]=Ee,e[103]=re):re=e[103];let le;e[104]!==ie||e[105]!==re?(le=s.jsxs(Mt,{children:[ie,re]}),e[104]=ie,e[105]=re,e[106]=le):le=e[106];let ae;e[107]!==ne||e[108]!==le?(ae=s.jsxs(Rt,{children:[ne,le]}),e[107]=ne,e[108]=le,e[109]=ae):ae=e[109];let ce;e[110]!==Me||e[111]!==ae?(ce=s.jsx(Et,{open:Me,onOpenChange:pe,children:ae}),e[110]=Me,e[111]=ae,e[112]=ce):ce=e[112];let xe;return e[113]!==Z||e[114]!==oe||e[115]!==ce?(xe=s.jsxs(s.Fragment,{children:[Z,oe,ce]}),e[113]=Z,e[114]=oe,e[115]=ce,e[116]=xe):xe=e[116],xe}function is(t){const e=U.c(39),{prompts:o,connectionId:i,org:n,onPromptClick:l,showToolbar:u,emptyMessage:y}=t,h=u===void 0?!0:u,r=y===void 0?"This connection doesn't have any prompts yet.":y,d=je(),[g,c]=B.useState(""),[f,x]=B.useState("table"),[j,a]=B.useState("name"),[p,b]=B.useState("asc");let N;e[0]!==p||e[1]!==j?(N=C=>{j===C?(b(ds),p==="desc"&&a(void 0)):(a(C),b("asc"))},e[0]=p,e[1]=j,e[2]=N):N=e[2];const T=N;let w;e[3]!==i||e[4]!==d||e[5]!==l||e[6]!==n?(w=C=>{l?l(C):i&&n&&d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:n,connectionId:i,collectionName:"prompts",itemId:encodeURIComponent(C.name)}})},e[3]=i,e[4]=d,e[5]=l,e[6]=n,e[7]=w):w=e[7];const _=w;let S;if(e[8]!==o||e[9]!==g||e[10]!==p||e[11]!==j){const C=!o||o.length===0?[]:g.trim()?(()=>{const z=g.toLowerCase();return o.filter(O=>O.name.toLowerCase().includes(z)||O.description&&O.description.toLowerCase().includes(z))})():o;S=!j||!p?C:[...C].sort((z,O)=>{const K=z[j]||"",F=O[j]||"",E=String(K).localeCompare(String(F));return p==="asc"?E:-E}),e[8]=o,e[9]=g,e[10]=p,e[11]=j,e[12]=S}else S=e[12];const L=S;let A;e[13]===Symbol.for("react.memo_cache_sentinel")?(A=[{id:"name",header:"Name",render:cs,sortable:!0},{id:"description",header:"Description",render:as,cellClassName:"flex-1",sortable:!0}],e[13]=A):A=e[13];const R=A;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=R.filter(ls).map(rs),e[14]=M):M=e[14];const v=M;let $;e[15]!==T||e[16]!==h||e[17]!==p||e[18]!==j||e[19]!==f?($=h&&s.jsx(ze,{children:s.jsx(Ce,{viewMode:f,onViewModeChange:x,sortKey:j,sortDirection:p,onSort:T,sortOptions:v})}),e[15]=T,e[16]=h,e[17]=p,e[18]=j,e[19]=f,e[20]=$):$=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=C=>{C.key==="Escape"&&(c(""),C.target.blur())},e[21]=k):k=e[21];let D;e[22]!==g?(D=s.jsx(Ve,{value:g,onChange:c,placeholder:"Search prompts...",onKeyDown:k}),e[22]=g,e[23]=D):D=e[23];let m;e[24]!==r||e[25]!==_||e[26]!==T||e[27]!==g||e[28]!==p||e[29]!==j||e[30]!==L||e[31]!==f?(m=f==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:L.length===0?s.jsx(G,{image:null,title:g?"No prompts found":"No prompts available",description:g?"Try adjusting your search terms":r}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:L.map(C=>s.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>_(C),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(be,{icon:null,name:C.name,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.name}),s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:C.description||"No description"})]})]})},C.name))})}):s.jsx(Fe,{columns:R,data:L,isLoading:!1,sortKey:j,sortDirection:p,onSort:T,onRowClick:C=>_(C),emptyState:s.jsx(G,{image:null,title:g?"No prompts found":"No prompts available",description:g?"Try adjusting your search terms":r})}),e[24]=r,e[25]=_,e[26]=T,e[27]=g,e[28]=p,e[29]=j,e[30]=L,e[31]=f,e[32]=m):m=e[32];let P;e[33]!==D||e[34]!==m?(P=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,m]}),e[33]=D,e[34]=m,e[35]=P):P=e[35];let I;return e[36]!==P||e[37]!==$?(I=s.jsxs(s.Fragment,{children:[$,P]}),e[36]=P,e[37]=$,e[38]=I):I=e[38],I}function rs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function ls(t){return t.sortable}function as(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function cs(t){return s.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function ds(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function ms(t){const e=U.c(4),{prompts:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(is,{prompts:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function us(t){const e=U.c(2),{repository:o}=t;let i;return e[0]!==o?(i=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(zt,{repository:o})}),e[0]=o,e[1]=i):i=e[1],i}function fs(t){const e=U.c(36),{resources:o,onResourceClick:i,showToolbar:n,emptyMessage:l}=t,u=n===void 0?!0:n,y=l===void 0?"This connection doesn't have any resources yet.":l,[h,r]=B.useState(""),[d,g]=B.useState("table"),[c,f]=B.useState("name"),[x,j]=B.useState("asc");let a;e[0]!==x||e[1]!==c?(a=m=>{c===m?(j(ys),x==="desc"&&f(void 0)):(f(m),j("asc"))},e[0]=x,e[1]=c,e[2]=a):a=e[2];const p=a;let b;e[3]!==i?(b=m=>{i&&i(m)},e[3]=i,e[4]=b):b=e[4];const N=b;let T;if(e[5]!==o||e[6]!==h||e[7]!==x||e[8]!==c){const m=!o||o.length===0?[]:h.trim()?(()=>{const P=h.toLowerCase();return o.filter(I=>I.uri.toLowerCase().includes(P)||I.name&&I.name.toLowerCase().includes(P)||I.description&&I.description.toLowerCase().includes(P))})():o;T=!c||!x?m:[...m].sort((P,I)=>{const C=P[c]||"",z=I[c]||"",O=String(C).localeCompare(String(z));return x==="asc"?O:-O}),e[5]=o,e[6]=h,e[7]=x,e[8]=c,e[9]=T}else T=e[9];const w=T;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:bs,sortable:!0},{id:"uri",header:"URI",render:js,sortable:!0},{id:"description",header:"Description",render:gs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:xs,sortable:!0}],e[10]=_):_=e[10];const S=_;let L;e[11]===Symbol.for("react.memo_cache_sentinel")?(L=S.filter(hs).map(ps),e[11]=L):L=e[11];const A=L;let R;e[12]!==p||e[13]!==u||e[14]!==x||e[15]!==c||e[16]!==d?(R=u&&s.jsx(ze,{children:s.jsx(Ce,{viewMode:d,onViewModeChange:g,sortKey:c,sortDirection:x,onSort:p,sortOptions:A})}),e[12]=p,e[13]=u,e[14]=x,e[15]=c,e[16]=d,e[17]=R):R=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=m=>{m.key==="Escape"&&(r(""),m.target.blur())},e[18]=M):M=e[18];let v;e[19]!==h?(v=s.jsx(Ve,{value:h,onChange:r,placeholder:"Search resources...",onKeyDown:M}),e[19]=h,e[20]=v):v=e[20];let $;e[21]!==y||e[22]!==N||e[23]!==p||e[24]!==h||e[25]!==x||e[26]!==c||e[27]!==w||e[28]!==d?($=d==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:w.length===0?s.jsx(G,{image:null,title:h?"No resources found":"No resources available",description:h?"Try adjusting your search terms":y}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:w.map(m=>s.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>N(m),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(be,{icon:null,name:m.name||m.uri,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:m.name||m.uri}),s.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:m.uri}),m.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:m.description})]})]})},m.uri))})}):s.jsx(Fe,{columns:S,data:w,isLoading:!1,sortKey:c,sortDirection:x,onSort:p,onRowClick:m=>N(m),emptyState:s.jsx(G,{image:null,title:h?"No resources found":"No resources available",description:h?"Try adjusting your search terms":y})}),e[21]=y,e[22]=N,e[23]=p,e[24]=h,e[25]=x,e[26]=c,e[27]=w,e[28]=d,e[29]=$):$=e[29];let k;e[30]!==v||e[31]!==$?(k=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v,$]}),e[30]=v,e[31]=$,e[32]=k):k=e[32];let D;return e[33]!==k||e[34]!==R?(D=s.jsxs(s.Fragment,{children:[R,k]}),e[33]=k,e[34]=R,e[35]=D):D=e[35],D}function ps(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function hs(t){return t.sortable}function xs(t){return s.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function js(t){return s.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function bs(t){return s.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function ys(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Cs(t){const e=U.c(4),{resources:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(fs,{resources:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function vs(t){const e=U.c(4),{tools:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(Vt,{tools:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function Ns(t){const e=U.c(60),{connection:o,connectionId:i,org:n,requestedTabId:l,collections:u,onUpdate:y,isUpdating:h,prompts:r,resources:d}=t,g=pt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const f=je(c);let x;e[1]!==i?(x={connectionId:i},e[1]=i,e[2]=x):x=e[2];const j=Ct(x),a=j.isAuthenticated,p=o?.metadata?.repository,b=!!p?.url,N=o?.tools?.length??0,T=r.length,w=d.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let S;e[4]!==a||e[5]!==N?(S=a&&N>0?[{id:"tools",label:"Tools",count:N}]:[],e[4]=a,e[5]=N,e[6]=S):S=e[6];let L;e[7]!==a||e[8]!==T?(L=a&&T>0?[{id:"prompts",label:"Prompts",count:T}]:[],e[7]=a,e[8]=T,e[9]=L):L=e[9];let A;e[10]!==a||e[11]!==w?(A=a&&w>0?[{id:"resources",label:"Resources",count:w}]:[],e[10]=a,e[11]=w,e[12]=A):A=e[12];let R;if(e[13]!==u||e[14]!==b||e[15]!==a||e[16]!==S||e[17]!==L||e[18]!==A){let E;e[20]!==b?(E=b?[{id:"readme",label:"README"}]:[],e[20]=b,e[21]=E):E=e[21],R=[_,...S,...L,...A,...a?(u||[]).map(ws):[],...E],e[13]=u,e[14]=b,e[15]=a,e[16]=S,e[17]=L,e[18]=A,e[19]=R}else R=e[19];const M=R,v=M.some(E=>E.id===l)?l:"settings";let $;e[22]!==f?($=E=>{f({search:W=>({...W,tab:E}),replace:!0})},e[22]=f,e[23]=$):$=e[23];const k=$;let D;e[24]!==u?(D=u||[],e[24]=u,e[25]=D):D=e[25];let m;if(e[26]!==v||e[27]!==D){let E;e[29]!==v?(E=W=>W.name===v,e[29]=v,e[30]=E):E=e[30],m=D.find(E),e[26]=v,e[27]=D,e[28]=m}else m=e[28];const P=m;let I;e[31]!==g.history?(I=()=>g.history.back(),e[31]=g.history,e[32]=I):I=e[32];let C;e[33]!==v||e[34]!==k||e[35]!==M?(C=s.jsx(Tt,{children:s.jsx(St,{tabs:M,activeTab:v,onTabChange:k})}),e[33]=v,e[34]=k,e[35]=M,e[36]=C):C=e[36];let z;e[37]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=z):z=e[37];let O;e[38]!==P||e[39]!==v||e[40]!==j.supportsOAuth||e[41]!==o||e[42]!==i||e[43]!==k||e[44]!==b||e[45]!==a||e[46]!==h||e[47]!==y||e[48]!==n||e[49]!==r||e[50]!==p||e[51]!==d?(O=s.jsx(B.Suspense,{fallback:z,children:v==="tools"?s.jsx(vs,{tools:o.tools??void 0,connectionId:i,org:n}):v==="prompts"?s.jsx(ms,{prompts:r,connectionId:i,org:n}):v==="resources"?s.jsx(Cs,{resources:d,connectionId:i,org:n}):v==="settings"?s.jsx(vt,{connection:o,onUpdate:y,isUpdating:h,isMCPAuthenticated:a,supportsOAuth:j.supportsOAuth,onViewReadme:b?()=>k("readme"):void 0}):v==="readme"&&b?s.jsx(us,{repository:p}):P&&a?s.jsx(ns,{connectionId:i,org:n,activeCollection:P},v):s.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=P,e[39]=v,e[40]=j.supportsOAuth,e[41]=o,e[42]=i,e[43]=k,e[44]=b,e[45]=a,e[46]=h,e[47]=y,e[48]=n,e[49]=r,e[50]=p,e[51]=d,e[52]=O):O=e[52];let K;e[53]!==v||e[54]!==O?(K=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(Ze,{children:O},v)})}),e[53]=v,e[54]=O,e[55]=K):K=e[55];let F;return e[56]!==I||e[57]!==C||e[58]!==K?(F=s.jsxs(_t,{onBack:I,children:[C,K]}),e[56]=I,e[57]=C,e[58]=K,e[59]=F):F=e[59],F}function ws(t){return{id:t.name,label:t.displayName}}function Ss(){const t=U.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=je(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/mcps/$connectionId"},t[1]=i):i=t[1];const{connectionId:n,org:l}=ut(i);let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/mcps/$connectionId"},t[2]=u):u=t[2];const h=ft(u).tab||"settings",r=Qe(n),d=jt(),g=bt(r??void 0);let c;t[3]!==n?(c=[n],t[3]=n,t[4]=c):c=t[4];const{promptsMap:f}=Nt(c);let x;t[5]!==n?(x=[n],t[5]=n,t[6]=x):x=t[6];const{resourcesMap:j}=wt(x);let a;t[7]!==n||t[8]!==f?(a=f.get(n)??[],t[7]=n,t[8]=f,t[9]=a):a=t[9];const p=a;let b;t[10]!==n||t[11]!==j?(b=j.get(n)??[],t[10]=n,t[11]=j,t[12]=b):b=t[12];const N=b;let T;t[13]!==d.update||t[14]!==n?(T=async S=>{await d.update.mutateAsync({id:n,data:S})},t[13]=d.update,t[14]=n,t[15]=T):T=t[15];const w=T;if(!r){let S;return t[16]!==o||t[17]!==l?(S=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(ye,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=o,t[17]=l,t[18]=S):S=t[18],S}let _;return t[19]!==d.update.isPending||t[20]!==g||t[21]!==r||t[22]!==n||t[23]!==w||t[24]!==l||t[25]!==p||t[26]!==h||t[27]!==N?(_=s.jsx(Ns,{org:l,connection:r,connectionId:n,requestedTabId:h,collections:g,onUpdate:w,isUpdating:d.update.isPending,prompts:p,resources:N}),t[19]=d.update.isPending,t[20]=g,t[21]=r,t[22]=n,t[23]=w,t[24]=l,t[25]=p,t[26]=h,t[27]=N,t[28]=_):_=t[28],_}function Ts(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ze,{children:s.jsx(B.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Ss,{})})}),t[0]=e):e=t[0],e}function To(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ts,{}),t[0]=e):e=t[0],e}export{To as default};
|