@decocms/mesh 2.68.0 → 2.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-COLM9TSp.js → AlertCircle-CrLCfZT0.js} +1 -1
- package/dist/client/assets/{ArrowUp-DuCoD-_2.js → ArrowUp-deTSI0E8.js} +1 -1
- package/dist/client/assets/{Calendar-8BjmK9Wb.js → Calendar-BaFebt3t.js} +1 -1
- package/dist/client/assets/{Check-BecGNPr2.js → Check-DTUUSvp-.js} +1 -1
- package/dist/client/assets/{CheckCircle-Cl7dWyoO.js → CheckCircle-BoFrCz54.js} +1 -1
- package/dist/client/assets/{ChevronDown-C80wx8LH.js → ChevronDown-DeD12W57.js} +1 -1
- package/dist/client/assets/{ChevronRight-BXGDS3zi.js → ChevronRight-8Yl-zCCi.js} +1 -1
- package/dist/client/assets/{Code01-BRpoqzI0.js → Code01-C2qL6p3f.js} +1 -1
- package/dist/client/assets/{Copy01-D9gO8dra.js → Copy01-CqWuZ9K-.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-DREtot34.js → DotsHorizontal-4eEmoKn5.js} +1 -1
- package/dist/client/assets/{DotsVertical-CiHvrgFY.js → DotsVertical-BYXFslta.js} +1 -1
- package/dist/client/assets/{Download01-Bb-ZK_lB.js → Download01-DDoxVok6.js} +1 -1
- package/dist/client/assets/{Edit01-CkiAniBs.js → Edit01-BD2PlTCM.js} +1 -1
- package/dist/client/assets/{File02-D7VIQXmG.js → File02-D_ZJmgQJ.js} +1 -1
- package/dist/client/assets/{File06-DHJFu4Cl.js → File06-iSPwdYi1.js} +1 -1
- package/dist/client/assets/{FilterLines-B49cFETF.js → FilterLines-uGkpVOX8.js} +1 -1
- package/dist/client/assets/{Globe02-BJwDZf3m.js → Globe02-BhcJ1ruM.js} +1 -1
- package/dist/client/assets/{Grid01-ClvGNPyN.js → Grid01-B9LzvODL.js} +1 -1
- package/dist/client/assets/{Home02-0S7UZMux.js → Home02-DCnIiCxj.js} +1 -1
- package/dist/client/assets/{Image01-DzdAD7GX.js → Image01-BYZhOfgB.js} +1 -1
- package/dist/client/assets/{Inbox01-Uwm1ba1e.js → Inbox01-CUvjj3IH.js} +1 -1
- package/dist/client/assets/{InfoCircle-BZgIauqE.js → InfoCircle-DzQgROgs.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CVq4HepO.js → LinkExternal01-D33uvRa3.js} +1 -1
- package/dist/client/assets/{List-BTqXaORG.js → List-C1dM-VCr.js} +1 -1
- package/dist/client/assets/{Loading01-hzhOha89.js → Loading01-3CQcIIbt.js} +1 -1
- package/dist/client/assets/{Lock01-EOSVXDa6.js → Lock01-aFdw7wqo.js} +1 -1
- package/dist/client/assets/{Pin01-BOx0EQEM.js → Pin01-ChRD6YtE.js} +1 -1
- package/dist/client/assets/{Play-CccLeNTU.js → Play-B5QcYkt5.js} +1 -1
- package/dist/client/assets/{Plus-DgXpTyQu.js → Plus-CP35U6Iv.js} +1 -1
- package/dist/client/assets/{SearchMd-BrXcSv99.js → SearchMd-DTs0TtNF.js} +1 -1
- package/dist/client/assets/{Share07-C98mjjh2.js → Share07-DGflfftp.js} +1 -1
- package/dist/client/assets/{Terminal-5tYfgjqm.js → Terminal-Djd_0g5K.js} +1 -1
- package/dist/client/assets/{Tool01-CwTrOkBb.js → Tool01-A-03PfQ_.js} +1 -1
- package/dist/client/assets/{Trash01-CFVOYbE4.js → Trash01-Ck6jzVhZ.js} +1 -1
- package/dist/client/assets/{Upload01-p-_YhXOd.js → Upload01-CsBiVkrb.js} +1 -1
- package/dist/client/assets/{Users03-BwgyAH-8.js → Users03-B-DO1n7F.js} +1 -1
- package/dist/client/assets/{X-CNmc5JFs.js → X-BnxI_xD6.js} +1 -1
- package/dist/client/assets/{XClose-yK9GZfOf.js → XClose-DvgsYIZw.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-f9cNTUxC.js → agent-connections-preview-CYQwMlB4.js} +1 -1
- package/dist/client/assets/{agent-detail-B6pgG8nu.js → agent-detail-tHoRcKR8.js} +1 -1
- package/dist/client/assets/{agents-B3jt9h7_.js → agents-CNdtweuU.js} +1 -1
- package/dist/client/assets/{alert-dialog-C5BMlV_B.js → alert-dialog-DN6po1tq.js} +1 -1
- package/dist/client/assets/{auth-catchall-RCCLXWIU.js → auth-catchall-Bt6aq6Tb.js} +1 -1
- package/dist/client/assets/{badge-obBgL92k.js → badge-DIFY1rsD.js} +1 -1
- package/dist/client/assets/{binder-B-gKzuCI.js → binder-Dg2rfYkp.js} +1 -1
- package/dist/client/assets/{breadcrumb-rJChBiJd.js → breadcrumb-CJBikxW8.js} +1 -1
- package/dist/client/assets/{button-CQ8Kjf8O.js → button-CKIyuXIq.js} +1 -1
- package/dist/client/assets/{card-DLwzKTus.js → card-MU9VbmJ4.js} +1 -1
- package/dist/client/assets/{checkbox-2HWXGeDR.js → checkbox-BomYVgbH.js} +1 -1
- package/dist/client/assets/{circle-alert-DW33AE25.js → circle-alert-BcHAU0vN.js} +1 -1
- package/dist/client/assets/{collection-detail-EWZbXFTn.js → collection-detail-CZFVa2Zq.js} +1 -1
- package/dist/client/assets/{collection-search-DsJ7tYYh.js → collection-search-CECpIAiD.js} +1 -1
- package/dist/client/assets/{collection-tab-Bw9wDafH.js → collection-tab-D12suO7P.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DJPMRDfl.js → collection-table-wrapper-CzqGMTIb.js} +1 -1
- package/dist/client/assets/{collection-tabs-DKE_sesv.js → collection-tabs-Dd6S7hPE.js} +1 -1
- package/dist/client/assets/{command-Bkn5ljJp.js → command-BLAC1NoH.js} +1 -1
- package/dist/client/assets/{connect-D81s0hqa.js → connect-VopSOjzi.js} +1 -1
- package/dist/client/assets/{connection-card-BTdUyxaq.js → connection-card-C7cdqtZc.js} +1 -1
- package/dist/client/assets/{connection-detail-Dg_Jlpqx.js → connection-detail-Cm-idmqc.js} +1 -1
- package/dist/client/assets/{connections-DrB7wAkw.js → connections-DqIiaOoJ.js} +1 -1
- package/dist/client/assets/constants-DBJOqOcW.js +1 -0
- package/dist/client/assets/{constants-DZRJwikT.js → constants-DwkB1age.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-B4oPD4mb.js → create-organization-dialog-QVwT9MeU.js} +1 -1
- package/dist/client/assets/{dialog-DNf7oKHG.js → dialog-CjI8rs-6.js} +1 -1
- package/dist/client/assets/{dropdown-menu-oqWMuO1Y.js → dropdown-menu-CoO02CsY.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DTrgJ2ut.js → dynamic-plugin-layout-DxUJHFK2.js} +1 -1
- package/dist/client/assets/{empty-state-CsFQa3KR.js → empty-state-CQab9dR0.js} +1 -1
- package/dist/client/assets/{empty-state-CQfuZLBd.js → empty-state-VwVcPCE1.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DR9qXTlp.js → env-vars-editor-BMhfk7Zf.js} +1 -1
- package/dist/client/assets/{error-boundary-DtmbPa7H.js → error-boundary-C8CO11ML.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CXNq0UhM.js → extract-connection-data-DwTMOpOf.js} +1 -1
- package/dist/client/assets/{file-browser-K6aJ-90B.js → file-browser-BqPRsorK.js} +2 -2
- package/dist/client/assets/{form-DOuqKZXC.js → form-CO4xV9gA.js} +1 -1
- package/dist/client/assets/{grid-view-DNCUOIul.js → grid-view-CDgwvRTT.js} +1 -1
- package/dist/client/assets/{home-Hunp1pBK.js → home-Bgf631v9.js} +1 -1
- package/dist/client/assets/{index-BXIoP_MZ.js → index-810mvVLg.js} +1 -1
- package/dist/client/assets/{index-CMcaW4mM.js → index-Bc7QzOnC.js} +1 -1
- package/dist/client/assets/{index-C98gN7aR.js → index-BdSNJxPZ.js} +1 -1
- package/dist/client/assets/{index-D4MF_YMK.js → index-CHQ9-Q-G.js} +2 -2
- package/dist/client/assets/{index-CoTLSWKV.js → index-CNwEt7K8.js} +1 -1
- package/dist/client/assets/{index-DwckbwiB.js → index-CrNYs5dK.js} +1 -1
- package/dist/client/assets/{index-B_zasBnB.js → index-CvZXtRPz.js} +1 -1
- package/dist/client/assets/{index-Dv6ogWGy.js → index-aWpPBjkT.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BzntX6sG.js → infiniteQueryObserver-CKMx30vn.js} +1 -1
- package/dist/client/assets/{input-DTmWYrzg.js → input-BrgRsDcE.js} +1 -1
- package/dist/client/assets/{layout-CmTDyJx0.js → layout-D8nQ7DGi.js} +1 -1
- package/dist/client/assets/{localstorage-keys-C5qg7tJd.js → localstorage-keys-BiLB-Ybm.js} +1 -1
- package/dist/client/assets/{login-2cPT-FUQ.js → login-COXBU4ri.js} +1 -1
- package/dist/client/assets/{mcp-oauth-l5FY9ha9.js → mcp-oauth-i2Um3a9A.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DxTDJUfL.js → mcp-server-card-B_tcMycX.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-Cl5inBKq.js → mcp-server-detail-CCPdSS0H.js} +2 -2
- package/dist/client/assets/{members-ByaVzqHg.js → members-DNx_w5eC.js} +1 -1
- package/dist/client/assets/{monaco-editor-B_aNlfTE.js → monaco-editor-qYykGrlT.js} +1 -1
- package/dist/client/assets/{monitoring-mhA92Ixp.js → monitoring-BuIkRBxN.js} +1 -1
- package/dist/client/assets/{oauth-callback-D0QR_Mie.js → oauth-callback-B24XRb9Q.js} +1 -1
- package/dist/client/assets/{page-Btm7NQl7.js → page-Buen7bnX.js} +1 -1
- package/dist/client/assets/{page-DjUdRkou.js → page-NaxcVK27.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CqhE8dhS.js → plugin-empty-state-CNA6ghy_.js} +1 -1
- package/dist/client/assets/{plugin-header-HKvKg_58.js → plugin-header-ColWGLS5.js} +1 -1
- package/dist/client/assets/{plugins-DNaRCBWX.js → plugins-Bwp1vQes.js} +1 -1
- package/dist/client/assets/{popover-BaiBgi1w.js → popover-CjUGVjON.js} +1 -1
- package/dist/client/assets/{registry-utils-dFRqfWcz.js → registry-utils-TFnNkGPj.js} +1 -1
- package/dist/client/assets/{resizable-DlZWYzwB.js → resizable-DQA2LWqr.js} +1 -1
- package/dist/client/assets/{select-D4-WItce.js → select-JdRjOrBE.js} +1 -1
- package/dist/client/assets/{settings-DHZ7pBp9.js → settings-C5BA4Ik8.js} +1 -1
- package/dist/client/assets/{shell-layout-y-_rL17R.js → shell-layout-Dz2AUt47.js} +1 -1
- package/dist/client/assets/{spinner-DBvjLIGS.js → spinner-CEhxpPPn.js} +1 -1
- package/dist/client/assets/{store-invite-C_UIm-oL.js → store-invite-2RTGhZRS.js} +1 -1
- package/dist/client/assets/{switch-C7P9CpyX.js → switch-DKkhDe7l.js} +1 -1
- package/dist/client/assets/{table-BQWoR2xQ.js → table-CBtv9zrT.js} +1 -1
- package/dist/client/assets/{textarea-JbvjK4Se.js → textarea-BBk7k5wE.js} +1 -1
- package/dist/client/assets/{tools-list-ZEvuh1uO.js → tools-list-DGAPFCDO.js} +1 -1
- package/dist/client/assets/{typewriter-title-b4BeUK0_.js → typewriter-title-XDUo1EGk.js} +1 -1
- package/dist/client/assets/{use-binding-B1zV-Y0z.js → use-binding-HsWp1jWu.js} +1 -1
- package/dist/client/assets/{use-connection-zcRZ_mrS.js → use-connection-UwIAiUmR.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-C5P9SCxC.js → use-create-virtual-mcp-CG-Wp4A9.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-CfetKXkW.js → use-deco-chat-open-Da_cfFLg.js} +2 -2
- package/dist/client/assets/{use-list-state-DlKabQs5.js → use-list-state-Dxbvm2sV.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-4APAdxvp.js → use-mcp-prompts-DDPkiTOB.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CBaz6cWu.js → use-mcp-tools-BKgKiBFS.js} +1 -1
- package/dist/client/assets/{use-mobile-DCUge7v5.js → use-mobile-CtC8_4UP.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DzncoO7n.js → use-organization-settings-TImCLEbo.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D69PZZns.js → use-virtual-mcp-BIZk_q3v.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-wjoMRbc3.js +1 -0
- package/dist/client/assets/{useMutation-Cc1z0I0J.js → useMutation-C8K1KoTI.js} +1 -1
- package/dist/client/assets/useQuery-CImYAWdS.js +1 -0
- package/dist/client/assets/{view-mode-toggle-I9cNNgTM.js → view-mode-toggle-BiRjYen1.js} +1 -1
- package/dist/client/assets/{workflow-CFz7sZz-.js → workflow-TGPdc23k.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/constants-CtcvnfJ2.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DO7FQ9J7.js +0 -1
- package/dist/client/assets/useQuery-BdnAz8Zk.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,bp as q,j as e,bq as M,F as P,r as R,t as h,a as O}from"./index-
|
|
1
|
+
import{c as T,bp as q,j as e,bq as M,F as P,r as R,t as h,a as O}from"./index-CHQ9-Q-G.js";import{u as A}from"./useQuery-CImYAWdS.js";import{u as _}from"./useMutation-C8K1KoTI.js";import{B as y}from"./button-CKIyuXIq.js";import{C as N,a as v}from"./card-MU9VbmJ4.js";import{i as L,a as U}from"./mcp-oauth-i2Um3a9A.js";import{c as C,C as K,a as k}from"./circle-alert-BcHAU0vN.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=q(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(M,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=P(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as $,j as t}from"./index-
|
|
1
|
+
import{c as $,j as t}from"./index-CHQ9-Q-G.js";import{C as q}from"./card-MU9VbmJ4.js";import{c as N}from"./button-CKIyuXIq.js";import{I as B}from"./empty-state-VwVcPCE1.js";function L(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{L as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as Y,c as X,j as n,v as ze,l as pt,u as xt,bA as nt,ac as Mt,p as Dt,bs as He,o as gt,ba as It,bi as At,s as q,ad as st,ae as Vt,a as $t,f as Ot,F as Ft,h as Wt,k as Et,i as Lt,t as _e,K as ot}from"./index-D4MF_YMK.js";import{I as Ke,n as Rt,E as Ne}from"./empty-state-CQfuZLBd.js";import{E as bt}from"./error-boundary-DtmbPa7H.js";import{E as zt,r as Ut,e as jt}from"./env-vars-editor-DR9qXTlp.js";import{P as Qe,S as Xt}from"./index-BXIoP_MZ.js";import{b as Bt,a as qt}from"./use-binding-B1zV-Y0z.js";import{u as Yt,S as Ht}from"./index-B_zasBnB.js";import{f as Je,g as yt}from"./use-connection-zcRZ_mrS.js";import{u as Kt}from"./constants-DZRJwikT.js";import{d as Qt}from"./use-mcp-tools-CBaz6cWu.js";import{b as Jt,d as Gt}from"./use-mcp-prompts-4APAdxvp.js";import{a as Zt}from"./mcp-oauth-l5FY9ha9.js";import{b as rt,e as en,c as tn,d as nn,B as sn,a as on}from"./breadcrumb-rJChBiJd.js";import{B as qe}from"./button-CQ8Kjf8O.js";import{C as rn}from"./collection-tabs-DKE_sesv.js";import{i as Re}from"./Loading01-hzhOha89.js";import{V as Ge,a as an}from"./layout-CmTDyJx0.js";import{C as cn}from"./collection-tab-Bw9wDafH.js";import{B as Ye}from"./badge-obBgL92k.js";import{D as ln,a as dn,b as un,c as at}from"./dropdown-menu-oqWMuO1Y.js";import{F as J,a as mn,b as G,d as H,f as Z,c as te,e as fn}from"./form-DOuqKZXC.js";import{I as ee}from"./input-DTmWYrzg.js";import{S as it,a as ct,b as lt,c as dt,d as Q}from"./select-D4-WItce.js";import{i as vt}from"./CheckCircle-Cl7dWyoO.js";import{t as hn}from"./ChevronDown-C80wx8LH.js";import{s as We}from"./Globe02-BJwDZf3m.js";import{i as pn}from"./Terminal-5tYfgjqm.js";import{s as xn}from"./Trash01-CFVOYbE4.js";import{t as Ze}from"./Users03-BwgyAH-8.js";import{s as gn}from"./XClose-yK9GZfOf.js";import{U as bn}from"./use-list-state-DlKabQs5.js";import{b as jn,a as yn}from"./use-virtual-mcp-D69PZZns.js";import{i as vn}from"./ChevronRight-BXGDS3zi.js";import{s as Nn}from"./Plus-DgXpTyQu.js";import{t as we,c as Nt,d as wn,m as ut,a as Ee}from"./differenceInSeconds-NQ4PDo0z.js";import{a as wt,C as St}from"./collection-table-wrapper-DJPMRDfl.js";import{C as _t}from"./collection-search-DsJ7tYYh.js";import{C as Ct}from"./card-DLwzKTus.js";import{R as Sn,T as _n}from"./tools-list-ZEvuh1uO.js";import"./Pin01-BOx0EQEM.js";import"./use-organization-settings-DzncoO7n.js";import"./useMutation-Cc1z0I0J.js";import"./binder-B-gKzuCI.js";import"./File06-DHJFu4Cl.js";import"./index-CMcaW4mM.js";import"./constants-CtcvnfJ2.js";import"./registry-utils-dFRqfWcz.js";import"./extract-connection-data-CXNq0UhM.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./index-C98gN7aR.js";import"./circle-alert-DW33AE25.js";import"./index-DwckbwiB.js";import"./X-CNmc5JFs.js";import"./use-deco-chat-open-CfetKXkW.js";import"./Code01-BRpoqzI0.js";import"./infiniteQueryObserver-BzntX6sG.js";import"./localstorage-keys-C5qg7tJd.js";import"./useQuery-BdnAz8Zk.js";import"./popover-BaiBgi1w.js";import"./Grid01-ClvGNPyN.js";import"./Image01-DzdAD7GX.js";import"./SearchMd-BrXcSv99.js";import"./spinner-DBvjLIGS.js";import"./dialog-DNf7oKHG.js";import"./AlertCircle-COLM9TSp.js";import"./ArrowUp-DuCoD-_2.js";import"./Edit01-CkiAniBs.js";import"./Check-BecGNPr2.js";import"./Copy01-D9gO8dra.js";import"./monaco-editor-B_aNlfTE.js";import"./use-create-virtual-mcp-C5P9SCxC.js";import"./index-Dv6ogWGy.js";import"./DotsVertical-CiHvrgFY.js";import"./empty-state-CsFQa3KR.js";import"./Inbox01-Uwm1ba1e.js";import"./alert-dialog-C5BMlV_B.js";import"./use-mobile-DCUge7v5.js";import"./List-BTqXaORG.js";import"./view-mode-toggle-I9cNNgTM.js";import"./table-BQWoR2xQ.js";const Pt=({size:t=24,color:e="currentColor",...s})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},Y.createElement("path",{d:"M2 10s2.005-2.732 3.634-4.362A9 9 0 1 1 12 21a9.004 9.004 0 0 1-8.648-6.5M2 10V4m0 6h6"}));Pt.displayName="RefreshCcw01";let Cn={};function Pn(){return Cn}function mt(t){const e=we(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function et(t,...e){const s=Nt.bind(null,t||e.find(o=>typeof o=="object"));return e.map(s)}function Le(t,e){const s=+we(t)-+we(e);return s<0?-1:s>0?1:s}function kn(t){return Nt(t,Date.now())}function Tn(t,e,s){const[o,r]=et(s?.in,t,e),c=o.getFullYear()-r.getFullYear(),i=o.getMonth()-r.getMonth();return c*12+i}function Mn(t,e){const s=we(t);return s.setHours(23,59,59,999),s}function Dn(t,e){const s=we(t),o=s.getMonth();return s.setFullYear(s.getFullYear(),o+1,0),s.setHours(23,59,59,999),s}function In(t,e){const s=we(t);return+Mn(s)==+Dn(s)}function An(t,e,s){const[o,r,c]=et(s?.in,t,t,e),i=Le(r,c),l=Math.abs(Tn(r,c));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let m=Le(r,c)===-i;In(o)&&l===1&&Le(o,c)===1&&(m=!1);const d=i*(l-+m);return d===0?0:d}const Vn={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$n=(t,e,s)=>{let o;const r=Vn[t];return typeof r=="string"?o=r:e===1?o=r.one:o=r.other.replace("{{count}}",e.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+o:o+" ago":o};function Be(t){return(e={})=>{const s=e.width?String(e.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const On={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Fn={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},En={date:Be({formats:On,defaultWidth:"full"}),time:Be({formats:Fn,defaultWidth:"full"}),dateTime:Be({formats:Wn,defaultWidth:"full"})},Ln={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rn=(t,e,s,o)=>Ln[t];function Ce(t){return(e,s)=>{const o=s?.context?String(s.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=s?.width?String(s.width):i;r=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=s?.width?String(s.width):t.defaultWidth;r=t.values[l]||t.values[i]}const c=t.argumentCallback?t.argumentCallback(e):e;return r[c]}}const zn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Un={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Bn={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Yn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Hn=(t,e)=>{const s=Number(t),o=s%100;if(o>20||o<10)switch(o%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},Kn={ordinalNumber:Hn,era:Ce({values:zn,defaultWidth:"wide"}),quarter:Ce({values:Un,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ce({values:Xn,defaultWidth:"wide"}),day:Ce({values:Bn,defaultWidth:"wide"}),dayPeriod:Ce({values:qn,defaultWidth:"wide",formattingValues:Yn,defaultFormattingWidth:"wide"})};function Pe(t){return(e,s={})=>{const o=s.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],c=e.match(r);if(!c)return null;const i=c[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],m=Array.isArray(l)?Jn(l,p=>p.test(i)):Qn(l,p=>p.test(i));let d;d=t.valueCallback?t.valueCallback(m):m,d=s.valueCallback?s.valueCallback(d):d;const h=e.slice(i.length);return{value:d,rest:h}}}function Qn(t,e){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return s}function Jn(t,e){for(let s=0;s<t.length;s++)if(e(t[s]))return s}function Gn(t){return(e,s={})=>{const o=e.match(t.matchPattern);if(!o)return null;const r=o[0],c=e.match(t.parsePattern);if(!c)return null;let i=t.valueCallback?t.valueCallback(c[0]):c[0];i=s.valueCallback?s.valueCallback(i):i;const l=e.slice(r.length);return{value:i,rest:l}}}const Zn=/^(\d+)(th|st|nd|rd)?/i,es=/\d+/i,ts={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ns={any:[/^b/i,/^(a|c)/i]},ss={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},os={any:[/1/i,/2/i,/3/i,/4/i]},rs={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},as={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},is={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cs={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ls={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ds={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},us={ordinalNumber:Gn({matchPattern:Zn,parsePattern:es,valueCallback:t=>parseInt(t,10)}),era:Pe({matchPatterns:ts,defaultMatchWidth:"wide",parsePatterns:ns,defaultParseWidth:"any"}),quarter:Pe({matchPatterns:ss,defaultMatchWidth:"wide",parsePatterns:os,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Pe({matchPatterns:rs,defaultMatchWidth:"wide",parsePatterns:as,defaultParseWidth:"any"}),day:Pe({matchPatterns:is,defaultMatchWidth:"wide",parsePatterns:cs,defaultParseWidth:"any"}),dayPeriod:Pe({matchPatterns:ls,defaultMatchWidth:"any",parsePatterns:ds,defaultParseWidth:"any"})},ms={code:"en-US",formatDistance:$n,formatLong:En,formatRelative:Rn,localize:Kn,match:us,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fs(t,e,s){const o=Pn(),r=s?.locale??o.locale??ms,c=2520,i=Le(t,e);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},s,{addSuffix:s?.addSuffix,comparison:i}),[m,d]=et(s?.in,...i>0?[e,t]:[t,e]),h=wn(d,m),p=(mt(d)-mt(m))/1e3,a=Math.round((h-p)/60);let x;if(a<2)return s?.includeSeconds?h<5?r.formatDistance("lessThanXSeconds",5,l):h<10?r.formatDistance("lessThanXSeconds",10,l):h<20?r.formatDistance("lessThanXSeconds",20,l):h<40?r.formatDistance("halfAMinute",0,l):h<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):a===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",a,l);if(a<45)return r.formatDistance("xMinutes",a,l);if(a<90)return r.formatDistance("aboutXHours",1,l);if(a<ut){const u=Math.round(a/60);return r.formatDistance("aboutXHours",u,l)}else{if(a<c)return r.formatDistance("xDays",1,l);if(a<Ee){const u=Math.round(a/ut);return r.formatDistance("xDays",u,l)}else if(a<Ee*2)return x=Math.round(a/Ee),r.formatDistance("aboutXMonths",x,l)}if(x=An(d,m),x<12){const u=Math.round(a/Ee);return r.formatDistance("xMonths",u,l)}else{const u=x%12,f=Math.trunc(x/12);return u<3?r.formatDistance("aboutXYears",f,l):u<9?r.formatDistance("overXYears",f,l):r.formatDistance("almostXYears",f+1,l)}}function hs(t,e){return fs(t,kn(t),e)}function ps(t){const e=X.c(13),{virtualMcp:s,org:o}=t;let r;e[0]!==o||e[1]!==s.id?(r={org:o,agentId:s.id},e[0]=o,e[1]=s.id,e[2]=r):r=e[2];let c;e[3]!==s.icon||e[4]!==s.title?(c=s.icon?n.jsx("img",{src:s.icon,alt:s.title,className:"w-5 h-5 rounded-md object-cover shrink-0"}):n.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:n.jsx(Ze,{size:16,className:"text-primary"})}),e[3]=s.icon,e[4]=s.title,e[5]=c):c=e[5];let i;e[6]!==s.title?(i=n.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=i):i=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(vn,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=l):l=e[8];let m;return e[9]!==r||e[10]!==c||e[11]!==i?(m=n.jsxs(pt,{to:"/$org/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,i,l]}),e[9]=r,e[10]=c,e[11]=i,e[12]=m):m=e[12],m}function ft(t){const e=X.c(20),{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:l}=t,m=ze(),d=yn();let h;e[0]!==d.create||e[1]!==r||e[2]!==c||e[3]!==s||e[4]!==o||e[5]!==m||e[6]!==i?(h=async()=>{const u=await d.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:c??null,status:"active",connections:[{connection_id:s,selected_tools:null,selected_resources:null,selected_prompts:null}]});m({to:"/$org/agents/$agentId",params:{org:i,agentId:u.id}})},e[0]=d.create,e[1]=r,e[2]=c,e[3]=s,e[4]=o,e[5]=m,e[6]=i,e[7]=h):h=e[7];const p=h;if(l){let u;e[8]!==d.create.isPending?(u=d.create.isPending?n.jsx(Re,{size:16,className:"animate-spin"}):n.jsx(Nn,{size:16}),e[8]=d.create.isPending,e[9]=u):u=e[9];let f;return e[10]!==d.create.isPending||e[11]!==p||e[12]!==u?(f=n.jsx(qe,{variant:"ghost",className:"size-6 p-0",onClick:p,disabled:d.create.isPending,children:u}),e[10]=d.create.isPending,e[11]=p,e[12]=u,e[13]=f):f=e[13],f}let a;e[14]!==d.create.isPending?(a=d.create.isPending?n.jsx(Re,{className:"animate-spin text-muted-foreground"}):n.jsx(Ze,{className:"size-3 text-muted-foreground"}),e[14]=d.create.isPending,e[15]=a):a=e[15];let x;return e[16]!==d.create.isPending||e[17]!==p||e[18]!==a?(x=n.jsxs(qe,{variant:"outline",size:"sm",onClick:p,disabled:d.create.isPending,children:[a,"Create an agent"]}),e[16]=d.create.isPending,e[17]=p,e[18]=a,e[19]=x):x=e[19],x}function xs(t){const e=X.c(26),{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i}=t;let l;e[0]!==s?(l={filters:[{column:"connection_id",value:s}]},e[0]=s,e[1]=l):l=e[1];const m=jn(l);if(!(m.length>0)){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=f):f=e[2];let j;return e[3]!==r||e[4]!==c||e[5]!==s||e[6]!==o||e[7]!==i?(j=n.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[f,n.jsx(ft,{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=c,e[5]=s,e[6]=o,e[7]=i,e[8]=j):j=e[8],j}let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=h):h=e[9];let p;e[10]!==r||e[11]!==c||e[12]!==s||e[13]!==o||e[14]!==i?(p=n.jsx("div",{className:"flex flex-col gap-1",children:n.jsxs("div",{className:"flex items-center justify-between",children:[h,n.jsx(ft,{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=c,e[12]=s,e[13]=o,e[14]=i,e[15]=p):p=e[15];let a;if(e[16]!==i||e[17]!==m){let f;e[19]!==i?(f=j=>n.jsx(ps,{virtualMcp:j,org:i},j.id),e[19]=i,e[20]=f):f=e[20],a=m.map(f),e[16]=i,e[17]=m,e[18]=a}else a=e[18];let x;e[21]!==a?(x=n.jsx("div",{className:"flex flex-col gap-2",children:a}),e[21]=a,e[22]=x):x=e[22];let u;return e[23]!==p||e[24]!==x?(u=n.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,x]}),e[23]=p,e[24]=x,e[25]=u):u=e[25],u}function gs({form:t,connection:e,hasOAuthToken:s,onReauthenticate:o,onRemoveOAuth:r}){const c=nt({control:t.control,name:"ui_type"}),i=nt({control:t.control,name:"connection_url"}),{stdioEnabled:l}=Mt(),m=(()=>{if(typeof i!="string"||!i)return!1;try{const a=new URL(i);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=l||e.connection_type==="STDIO",h=e.connection_type==="VIRTUAL",p=h?Dt(e.connection_url):null;return h?n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),n.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[n.jsx(Ze,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),n.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:n.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[n.jsx(J,{control:t.control,name:"ui_type",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),c!=="NPX"&&c!=="STDIO"?n.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[n.jsxs(it,{value:a.value,onValueChange:a.onChange,children:[n.jsx(H,{children:n.jsxs(ct,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[n.jsx(We,{className:"w-4 h-4 text-muted-foreground shrink-0"}),n.jsx(lt,{})]})}),n.jsxs(dt,{children:[n.jsx(Q,{value:"HTTP",children:"HTTP"}),n.jsx(Q,{value:"SSE",children:"SSE"}),n.jsx(Q,{value:"Websocket",children:"Websocket"}),d&&n.jsxs(n.Fragment,{children:[n.jsx(Q,{value:"NPX",children:"NPX Package"}),n.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),n.jsx("div",{className:"w-px bg-border"}),n.jsx(J,{control:t.control,name:"connection_url",render:({field:x})=>n.jsx(G,{className:"flex-1 min-w-0",children:n.jsx(H,{children:n.jsx(ee,{placeholder:"https://example.com/mcp",...x,value:x.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):n.jsxs(it,{value:a.value,onValueChange:a.onChange,children:[n.jsx(H,{children:n.jsx(ct,{className:"h-10",children:n.jsx(lt,{})})}),n.jsxs(dt,{children:[n.jsx(Q,{value:"HTTP",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(We,{className:"w-4 h-4"}),"HTTP"]})}),n.jsx(Q,{value:"SSE",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(We,{className:"w-4 h-4"}),"SSE"]})}),n.jsx(Q,{value:"Websocket",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(We,{className:"w-4 h-4"}),"Websocket"]})}),d&&n.jsxs(n.Fragment,{children:[n.jsx(Q,{value:"NPX",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"w-4 h-4"}),"NPX Package"]})}),n.jsx(Q,{value:"STDIO",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(pn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),n.jsx(Z,{})]})}),c==="NPX"&&n.jsx(J,{control:t.control,name:"npx_package",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})}),c==="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(J,{control:t.control,name:"stdio_command",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})}),n.jsx(J,{control:t.control,name:"stdio_args",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),n.jsx(Z,{})]})})]}),n.jsx(J,{control:t.control,name:"stdio_cwd",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})})]}),(c==="NPX"||c==="STDIO")&&n.jsx(J,{control:t.control,name:"env_vars",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),n.jsx(H,{children:n.jsx(zt,{value:a.value??[],onChange:a.onChange})}),n.jsx(Z,{})]})}),c!=="NPX"&&c!=="STDIO"&&n.jsx(J,{control:t.control,name:"connection_token",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),s?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs(ln,{children:[n.jsx(dn,{asChild:!0,children:n.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:n.jsxs(Ye,{variant:"success",className:"gap-1.5",children:[n.jsx(vt,{size:12}),"Authenticated via OAuth",n.jsx(hn,{size:12})]})})}),n.jsxs(un,{align:"start",children:[n.jsxs(at,{onClick:o,children:[n.jsx(Pt,{size:16}),"Re-authenticate"]}),n.jsxs(at,{variant:"destructive",onClick:r,children:[n.jsx(xn,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?n.jsxs("div",{className:"relative group",children:[n.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),n.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:n.jsx(gn,{size:14,className:"text-muted-foreground"})})]}):n.jsxs(n.Fragment,{children:[n.jsx(H,{children:n.jsx(ee,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&n.jsxs(fn,{children:["Create a PAT at"," ",n.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),n.jsx(Z,{})]})})]})}function bs(t){const e=X.c(43),{form:s,connection:o,isMCPAuthenticated:r,hasOAuthToken:c,onReauthenticate:i,onRemoveOAuth:l}=t,{org:m}=xt();let d;e[0]!==o.icon||e[1]!==o.title?(d=n.jsx(Ke,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=d):d=e[2];let h;e[3]!==s.control?(h=n.jsxs("div",{className:"flex flex-col",children:[n.jsx(J,{control:s.control,name:"title",render:ys}),n.jsx(J,{control:s.control,name:"description",render:js})]}),e[3]=s.control,e[4]=h):h=e[4];let p;e[5]!==d||e[6]!==h?(p=n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[d,h]}),e[5]=d,e[6]=h,e[7]=p):p=e[7];let a;e[8]!==o||e[9]!==s||e[10]!==c||e[11]!==i||e[12]!==l?(a=n.jsx(gs,{form:s,connection:o,hasOAuthToken:c,onReauthenticate:i,onRemoveOAuth:l}),e[8]=o,e[9]=s,e[10]=c,e[11]=i,e[12]=l,e[13]=a):a=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=x):x=e[14];let u;e[15]!==r?(u=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[x,r?n.jsxs(Ye,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[n.jsx(vt,{size:12}),"Connected"]}):n.jsx(Ye,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=f):f=e[17];let j;e[18]!==o.created_by?(j=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[f,n.jsx(bn,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=P):P=e[20];let y;e[21]!==o.updated_at?(y=o.updated_at?hs(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=y):y=e[22];let N;e[23]!==y?(N=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[P,n.jsx("span",{className:"text-sm text-foreground",children:y})]}),e[23]=y,e[24]=N):N=e[24];let w;e[25]!==N||e[26]!==u||e[27]!==j?(w=n.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[u,j,N]}),e[25]=N,e[26]=u,e[27]=j,e[28]=w):w=e[28];let v;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==m.slug?(v=n.jsx(xs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:m.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=m.slug,e[34]=v):v=e[34];let g;e[35]!==w||e[36]!==v||e[37]!==p||e[38]!==a?(g=n.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[p,a,w,v]}),e[35]=w,e[36]=v,e[37]=p,e[38]=a,e[39]=g):g=e[39];let k;return e[40]!==s||e[41]!==g?(k=n.jsx(mn,{...s,children:g}),e[40]=s,e[41]=g,e[42]=k):k=e[42],k}function js(t){const{field:e}=t;return n.jsxs(G,{className:"w-full space-y-0",children:[n.jsx(H,{children:n.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),n.jsx(Z,{})]})}function ys(t){const{field:e}=t;return n.jsxs(G,{className:"flex-1 space-y-0",children:[n.jsx(H,{children:n.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),n.jsx(Z,{})]})}function vs(t){const e=X.c(42),{prompts:s,connectionId:o,org:r,connectionTitle:c,connectionIcon:i,onPromptClick:l,showToolbar:m,emptyMessage:d}=t,h=m===void 0?!0:m,p=d===void 0?"This connection doesn't have any prompts yet.":d,a=ze(),u=He().location.href,[f,j]=Y.useState(""),[P,y]=Y.useState("table"),[N,w]=Y.useState("name"),[v,g]=Y.useState("asc");let k;e[0]!==v||e[1]!==N?(k=_=>{N===_?(g(Cs),v==="desc"&&w(void 0)):(w(_),g("asc"))},e[0]=v,e[1]=N,e[2]=k):k=e[2];const z=k;let D;e[3]!==o||e[4]!==a||e[5]!==l||e[6]!==r?(D=_=>{l?l(_):o&&r&&a({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(_.name)}})},e[3]=o,e[4]=a,e[5]=l,e[6]=r,e[7]=D):D=e[7];const V=D;let I;if(e[8]!==s||e[9]!==f||e[10]!==v||e[11]!==N){const _=!s||s.length===0?[]:f.trim()?(()=>{const K=f.toLowerCase();return s.filter(B=>B.name.toLowerCase().includes(K)||B.description&&B.description.toLowerCase().includes(K))})():s;I=!N||!v?_:[..._].sort((K,B)=>{const ne=K[N]||"",se=B[N]||"",oe=String(ne).localeCompare(String(se));return v==="asc"?oe:-oe}),e[8]=s,e[9]=f,e[10]=v,e[11]=N,e[12]=I}else I=e[12];const M=I;let W;e[13]===Symbol.for("react.memo_cache_sentinel")?(W=[{id:"name",header:"Name",render:_s,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=W):W=e[13];const E=W;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=E.filter(ws).map(Ns),e[14]=S):S=e[14];const U=S;let T;e[15]!==i||e[16]!==c||e[17]!==z||e[18]!==h||e[19]!==v||e[20]!==N||e[21]!==u||e[22]!==P?(T=h&&n.jsxs(Ge,{children:[n.jsx(St,{viewMode:P,onViewModeChange:y,sortKey:N,sortDirection:v,onSort:z,sortOptions:U}),n.jsx(Qe,{title:c?`${c}: Prompts`:"Prompts",url:u,icon:i??"description"})]}),e[15]=i,e[16]=c,e[17]=z,e[18]=h,e[19]=v,e[20]=N,e[21]=u,e[22]=P,e[23]=T):T=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=_=>{_.key==="Escape"&&(j(""),_.target.blur())},e[24]=$):$=e[24];let A;e[25]!==f?(A=n.jsx(_t,{value:f,onChange:j,placeholder:"Search prompts...",onKeyDown:$}),e[25]=f,e[26]=A):A=e[26];let b;e[27]!==p||e[28]!==V||e[29]!==z||e[30]!==f||e[31]!==v||e[32]!==N||e[33]!==M||e[34]!==P?(b=P==="cards"?n.jsx("div",{className:"flex-1 overflow-auto p-5",children:M.length===0?n.jsx(Ne,{image:null,title:f?"No prompts found":"No prompts available",description:f?"Try adjusting your search terms":p}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:M.map(_=>n.jsx(Ct,{className:"cursor-pointer transition-colors",onClick:()=>V(_),children:n.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[n.jsx(Ke,{icon:null,name:_.name,size:"md",className:"shrink-0 shadow-sm"}),n.jsxs("div",{className:"flex flex-col gap-0",children:[n.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:_.name}),n.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:_.description||"No description"})]})]})},_.name))})}):n.jsx(wt,{columns:E,data:M,isLoading:!1,sortKey:N,sortDirection:v,onSort:z,onRowClick:_=>V(_),emptyState:n.jsx(Ne,{image:null,title:f?"No prompts found":"No prompts available",description:f?"Try adjusting your search terms":p})}),e[27]=p,e[28]=V,e[29]=z,e[30]=f,e[31]=v,e[32]=N,e[33]=M,e[34]=P,e[35]=b):b=e[35];let R;e[36]!==A||e[37]!==b?(R=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,b]}),e[36]=A,e[37]=b,e[38]=R):R=e[38];let O;return e[39]!==R||e[40]!==T?(O=n.jsxs(n.Fragment,{children:[T,R]}),e[39]=R,e[40]=T,e[41]=O):O=e[41],O}function Ns(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function ws(t){return t.sortable}function Ss(t){return n.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function _s(t){return n.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Cs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ps(t){const e=X.c(6),{prompts:s,connectionId:o,org:r}=t,c=Je(o),i=c?.title,l=c?.icon;let m;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l?(m=n.jsx(vs,{prompts:s,connectionId:o,org:r,connectionTitle:i,connectionIcon:l}),e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=m):m=e[5],m}function ks(t){const e=X.c(2),{repository:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:n.jsx(Sn,{repository:s})}),e[0]=s,e[1]=o):o=e[1],o}function Ts(t){const e=X.c(39),{resources:s,connectionTitle:o,connectionIcon:r,onResourceClick:c,showToolbar:i,emptyMessage:l}=t,m=i===void 0?!0:i,d=l===void 0?"This connection doesn't have any resources yet.":l,p=He().location.href,[a,x]=Y.useState(""),[u,f]=Y.useState("table"),[j,P]=Y.useState("name"),[y,N]=Y.useState("asc");let w;e[0]!==y||e[1]!==j?(w=b=>{j===b?(N(Os),y==="desc"&&P(void 0)):(P(b),N("asc"))},e[0]=y,e[1]=j,e[2]=w):w=e[2];const v=w;let g;e[3]!==c?(g=b=>{c&&c(b)},e[3]=c,e[4]=g):g=e[4];const k=g;let z;if(e[5]!==s||e[6]!==a||e[7]!==y||e[8]!==j){const b=!s||s.length===0?[]:a.trim()?(()=>{const R=a.toLowerCase();return s.filter(O=>O.uri.toLowerCase().includes(R)||O.name&&O.name.toLowerCase().includes(R)||O.description&&O.description.toLowerCase().includes(R))})():s;z=!j||!y?b:[...b].sort((R,O)=>{const _=R[j]||"",K=O[j]||"",B=String(_).localeCompare(String(K));return y==="asc"?B:-B}),e[5]=s,e[6]=a,e[7]=y,e[8]=j,e[9]=z}else z=e[9];const D=z;let V;e[10]===Symbol.for("react.memo_cache_sentinel")?(V=[{id:"name",header:"Name",render:$s,sortable:!0},{id:"uri",header:"URI",render:Vs,sortable:!0},{id:"description",header:"Description",render:As,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Is,sortable:!0}],e[10]=V):V=e[10];const I=V;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=I.filter(Ds).map(Ms),e[11]=M):M=e[11];const W=M;let E;e[12]!==r||e[13]!==o||e[14]!==v||e[15]!==m||e[16]!==y||e[17]!==j||e[18]!==p||e[19]!==u?(E=m&&n.jsxs(Ge,{children:[n.jsx(St,{viewMode:u,onViewModeChange:f,sortKey:j,sortDirection:y,onSort:v,sortOptions:W}),n.jsx(Qe,{title:o?`${o}: Resources`:"Resources",url:p,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=v,e[15]=m,e[16]=y,e[17]=j,e[18]=p,e[19]=u,e[20]=E):E=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(x(""),b.target.blur())},e[21]=S):S=e[21];let U;e[22]!==a?(U=n.jsx(_t,{value:a,onChange:x,placeholder:"Search resources...",onKeyDown:S}),e[22]=a,e[23]=U):U=e[23];let T;e[24]!==d||e[25]!==k||e[26]!==v||e[27]!==a||e[28]!==y||e[29]!==j||e[30]!==D||e[31]!==u?(T=u==="cards"?n.jsx("div",{className:"flex-1 overflow-auto p-5",children:D.length===0?n.jsx(Ne,{image:null,title:a?"No resources found":"No resources available",description:a?"Try adjusting your search terms":d}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:D.map(b=>n.jsx(Ct,{className:"cursor-pointer transition-colors",onClick:()=>k(b),children:n.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[n.jsx(Ke,{icon:null,name:b.name||b.uri,size:"md",className:"shrink-0 shadow-sm"}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.name||b.uri}),n.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:b.uri}),b.description&&n.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:b.description})]})]})},b.uri))})}):n.jsx(wt,{columns:I,data:D,isLoading:!1,sortKey:j,sortDirection:y,onSort:v,onRowClick:b=>k(b),emptyState:n.jsx(Ne,{image:null,title:a?"No resources found":"No resources available",description:a?"Try adjusting your search terms":d})}),e[24]=d,e[25]=k,e[26]=v,e[27]=a,e[28]=y,e[29]=j,e[30]=D,e[31]=u,e[32]=T):T=e[32];let $;e[33]!==U||e[34]!==T?($=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[U,T]}),e[33]=U,e[34]=T,e[35]=$):$=e[35];let A;return e[36]!==$||e[37]!==E?(A=n.jsxs(n.Fragment,{children:[E,$]}),e[36]=$,e[37]=E,e[38]=A):A=e[38],A}function Ms(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ds(t){return t.sortable}function Is(t){return n.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function As(t){return n.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Vs(t){return n.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function $s(t){return n.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Os(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Fs(t){const e=X.c(6),{resources:s,connectionId:o,org:r}=t,c=Je(o),i=c?.title,l=c?.icon;let m;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l?(m=n.jsx(Ts,{resources:s,connectionId:o,org:r,connectionTitle:i,connectionIcon:l}),e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=m):m=e[5],m}const Ws=gt({key:q().min(1,"Key is required"),value:q()}),Es=gt({title:q().min(1,"Name is required"),description:q().nullable().optional(),ui_type:Vt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:q().optional(),connection_token:q().nullable().optional(),npx_package:q().optional(),stdio_command:q().optional(),stdio_args:q().optional(),stdio_cwd:q().optional(),env_vars:st(Ws).optional(),configuration_scopes:st(q()).nullable().optional(),configuration_state:It(q(),At()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Ls(t){const e=X.c(5),{tools:s,connectionId:o,org:r,isLoading:c}=t;let i;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==s?(i=n.jsx(_n,{tools:s,connectionId:o,org:r,isLoading:c}),e[0]=o,e[1]=c,e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function Rs(t){return t.command==="npx"}function zs(t){return t.args?.find(e=>!e.startsWith("-"))??""}function Us(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Xs(t,e){const s={command:"npx",args:["-y",t]},o=jt(e);return Object.keys(o).length>0&&(s.envVars=o),s}function Bs(t,e,s,o){const r={command:t};e.trim()&&(r.args=e.trim().split(/\s+/)),s?.trim()&&(r.cwd=s.trim());const c=jt(o);return Object.keys(c).length>0&&(r.envVars=c),r}function ht(t,e){const s={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&Lt(t.connection_headers)){const o=t.connection_headers,r=Ut(o.envVars);if(Rs(o)){const i=zs(o);return{...s,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const c=Us(o);return{...s,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:r}}return{...s,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(t){let e,s=null,o=null,r=null;return t.ui_type==="NPX"?(e="STDIO",s="",r=Xs(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",s="",r=Bs(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,s=t.connection_url||"",o=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:s,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function Ys(t){const e=X.c(117),{connection:s,connectionId:o,org:r,requestedTabId:c,collections:i,onUpdate:l,isUpdating:m,prompts:d,resources:h,tools:p,isLoadingTools:a}=t;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/$org/mcps/$connectionId"},e[0]=x):x=e[0];const u=ze(x),f=Ft(),P=He().location.href,y=yt();let N;e[1]!==o?(N={connectionId:o},e[1]=o,e[2]=N):N=e[2];const w=Yt(N),g=s?.connection_type==="VIRTUAL"||w.isAuthenticated;let k;e[3]!==s?(k={connections:[s],binding:"MCP"},e[3]=s,e[4]=k):k=e[4];const D=qt(k).length>0,V=s?.metadata?.repository,I=!!V?.url;let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M=Wt(Es),e[5]=M):M=e[5];let W;e[6]!==s?(W=ht(s),e[6]=s,e[7]=W):W=e[7];let E;e[8]!==W?(E={resolver:M,values:W},e[8]=W,e[9]=E):E=e[9];const S=Et(E),U=S.formState.isDirty;let T;e[10]!==S||e[11]!==l?(T=async()=>{if(!await S.trigger())return;const L=S.getValues(),ve=qs(L);await l(ve),S.reset(L)},e[10]=S,e[11]=l,e[12]=T):T=e[12];const $=T;let A;e[13]!==s||e[14]!==S?(A=()=>{S.reset(ht(s))},e[13]=s,e[14]=S,e[15]=A):A=e[15];const b=A;let R;e[16]!==s.id||e[17]!==y||e[18]!==f?(R=async()=>{const{token:C,tokenInfo:L,error:ve}=await Zt({connectionId:s.id});if(ve||!C){_e.error(`Authentication failed: ${ve}`);return}if(L)try{const Fe=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:L.accessToken,refreshToken:L.refreshToken,expiresIn:L.expiresIn,scope:L.scope,clientId:L.clientId,clientSecret:L.clientSecret,tokenEndpoint:L.tokenEndpoint})});if(!Fe.ok)console.error("Failed to save OAuth token:",await Fe.text()),await y.update.mutateAsync({id:s.id,data:{connection_token:C}});else try{await y.update.mutateAsync({id:s.id,data:{}})}catch(tt){console.warn("Failed to refresh connection tools after OAuth:",tt)}}catch(Fe){console.error("Error saving OAuth token:",Fe),await y.update.mutateAsync({id:s.id,data:{connection_token:C}})}else await y.update.mutateAsync({id:s.id,data:{connection_token:C}});const Tt=new URL(`/mcp/${s.id}`,window.location.origin);await f.invalidateQueries({queryKey:ot.isMCPAuthenticated(Tt.href,null)}),_e.success("Authentication successful")},e[16]=s.id,e[17]=y,e[18]=f,e[19]=R):R=e[19];const O=R;let _;e[20]!==s.id||e[21]!==f?(_=async()=>{try{const C=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!C.ok){const ve=await C.text();_e.error(`Failed to remove OAuth: ${ve}`);return}const L=new URL(`/mcp/${s.id}`,window.location.origin);await f.invalidateQueries({queryKey:ot.isMCPAuthenticated(L.href,null)}),_e.success("OAuth removed. You can now re-authenticate with a different account.")}catch(C){console.error("Error removing OAuth token:",C),_e.error("Failed to remove OAuth")}},e[20]=s.id,e[21]=f,e[22]=_):_=e[22];const K=_,B=p.length,ne=d.length,se=h.length,oe=B>0||a;let ke;e[23]===Symbol.for("react.memo_cache_sentinel")?(ke={id:"settings",label:"Settings"},e[23]=ke):ke=e[23];let re;e[24]!==a||e[25]!==g||e[26]!==oe||e[27]!==B?(re=g&&oe?[{id:"tools",label:"Tools",count:a?void 0:B}]:[],e[24]=a,e[25]=g,e[26]=oe,e[27]=B,e[28]=re):re=e[28];let ae;e[29]!==g||e[30]!==ne?(ae=g&&ne>0?[{id:"prompts",label:"Prompts",count:ne}]:[],e[29]=g,e[30]=ne,e[31]=ae):ae=e[31];let ie;e[32]!==g||e[33]!==se?(ie=g&&se>0?[{id:"resources",label:"Resources",count:se}]:[],e[32]=g,e[33]=se,e[34]=ie):ie=e[34];let Te;if(e[35]!==i||e[36]!==I||e[37]!==g||e[38]!==re||e[39]!==ae||e[40]!==ie){let C;e[42]!==I?(C=I?[{id:"readme",label:"README"}]:[],e[42]=I,e[43]=C):C=e[43],Te=[ke,...re,...ae,...ie,...g?(i||[]).map(Ks):[],...C],e[35]=i,e[36]=I,e[37]=g,e[38]=re,e[39]=ae,e[40]=ie,e[41]=Te}else Te=e[41];const Se=Te,kt=g&&Se.some(Hs)?"tools":"settings",F=Se.some(C=>C.id===c)?c:kt;let Me;e[44]!==u?(Me=C=>{u({search:L=>({...L,tab:C}),replace:!0})},e[44]=u,e[45]=Me):Me=e[45];const ce=Me;let le;e[46]!==i?(le=i||[],e[46]=i,e[47]=le):le=e[47];let De;if(e[48]!==F||e[49]!==le){let C;e[51]!==F?(C=L=>L.name===F,e[51]=F,e[52]=C):C=e[52],De=le.find(C),e[48]=F,e[49]=le,e[50]=De}else De=e[50];const Ie=De;let de;e[53]!==r?(de=n.jsx(rt,{children:n.jsx(tn,{asChild:!0,children:n.jsx(pt,{to:"/$org/mcps",params:{org:r},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let Ae;e[55]===Symbol.for("react.memo_cache_sentinel")?(Ae=n.jsx(nn,{}),e[55]=Ae):Ae=e[55];let ue;e[56]!==s.title?(ue=n.jsx(rt,{children:n.jsx(en,{children:s.title})}),e[56]=s.title,e[57]=ue):ue=e[57];let Ve;e[58]!==de||e[59]!==ue?(Ve=n.jsx(sn,{children:n.jsxs(on,{children:[de,Ae,ue]})}),e[58]=de,e[59]=ue,e[60]=Ve):Ve=e[60];const Ue=Ve;let me;e[61]!==$||e[62]!==b||e[63]!==U||e[64]!==m?(me=n.jsx(Xt,{onSave:$,onUndo:b,isDirty:U,isSaving:m}),e[61]=$,e[62]=b,e[63]=U,e[64]=m,e[65]=me):me=e[65];const Xe=s.icon??"settings";let fe;e[66]!==s.title||e[67]!==Xe||e[68]!==P?(fe=n.jsx(Qe,{title:s.title,url:P,icon:Xe}),e[66]=s.title,e[67]=Xe,e[68]=P,e[69]=fe):fe=e[69];let he;e[70]!==me||e[71]!==fe?(he=n.jsxs(Ge,{children:[me,fe]}),e[70]=me,e[71]=fe,e[72]=he):he=e[72];let pe;e[73]!==w.hasOAuthToken||e[74]!==s||e[75]!==S||e[76]!==O||e[77]!==K||e[78]!==g?(pe=n.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:n.jsx(bs,{form:S,connection:s,isMCPAuthenticated:g,hasOAuthToken:w.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:K})}),e[73]=w.hasOAuthToken,e[74]=s,e[75]=S,e[76]=O,e[77]=K,e[78]=g,e[79]=pe):pe=e[79];let xe;e[80]!==F||e[81]!==ce||e[82]!==Se?(xe=n.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:n.jsx(rn,{tabs:Se,activeTab:F,onTabChange:ce,className:"flex-1"})}),e[80]=F,e[81]=ce,e[82]=Se,e[83]=xe):xe=e[83];let $e;e[84]===Symbol.for("react.memo_cache_sentinel")?($e=n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=$e):$e=e[84];let ge;e[85]!==Ie||e[86]!==F||e[87]!==w.isServerError||e[88]!==w.supportsOAuth||e[89]!==s||e[90]!==o||e[91]!==S||e[92]!==O||e[93]!==ce||e[94]!==D||e[95]!==I||e[96]!==a||e[97]!==g||e[98]!==r||e[99]!==d||e[100]!==V||e[101]!==h||e[102]!==p?(ge=n.jsx(Y.Suspense,{fallback:$e,children:F==="tools"?n.jsx(Ls,{tools:p,connectionId:o,org:r,isLoading:a}):F==="prompts"?n.jsx(Ps,{prompts:d,connectionId:o,org:r}):F==="resources"?n.jsx(Fs,{resources:h,connectionId:o,org:r}):F==="settings"?n.jsx(Ht,{connection:s,form:S,hasMcpBinding:D,isMCPAuthenticated:g,supportsOAuth:w.supportsOAuth,isServerError:w.isServerError,onAuthenticate:O,onViewReadme:I?()=>ce("readme"):void 0}):F==="readme"&&I?n.jsx(ks,{repository:V}):Ie&&g?n.jsx(cn,{connectionId:o,org:r,activeCollection:Ie},F):n.jsx(Ne,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=F,e[87]=w.isServerError,e[88]=w.supportsOAuth,e[89]=s,e[90]=o,e[91]=S,e[92]=O,e[93]=ce,e[94]=D,e[95]=I,e[96]=a,e[97]=g,e[98]=r,e[99]=d,e[100]=V,e[101]=h,e[102]=p,e[103]=ge):ge=e[103];let be;e[104]!==F||e[105]!==ge?(be=n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsx(bt,{children:ge},F)}),e[104]=F,e[105]=ge,e[106]=be):be=e[106];let je;e[107]!==xe||e[108]!==be?(je=n.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[xe,be]}),e[107]=xe,e[108]=be,e[109]=je):je=e[109];let ye;e[110]!==pe||e[111]!==je?(ye=n.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[pe,je]}),e[110]=pe,e[111]=je,e[112]=ye):ye=e[112];let Oe;return e[113]!==Ue||e[114]!==he||e[115]!==ye?(Oe=n.jsxs(an,{breadcrumb:Ue,children:[he,ye]}),e[113]=Ue,e[114]=he,e[115]=ye,e[116]=Oe):Oe=e[116],Oe}function Hs(t){return t.id==="tools"}function Ks(t){return{id:t.name,label:t.displayName}}function Qs(){const t=X.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const s=ze(e);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/mcps/$connectionId"},t[1]=o):o=t[1];const{connectionId:r,org:c}=$t(o),{org:i}=xt();let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[2]=l):l=t[2];const d=Ot(l).tab??"",h=Je(r),p=yt(),a=Bt(h??void 0);let x;t[3]!==r||t[4]!==i.id?(x={connectionId:r,orgId:i.id},t[3]=r,t[4]=i.id,t[5]=x):x=t[5];const u=Kt(x);let f;t[6]!==u?(f={client:u},t[6]=u,t[7]=f):f=t[7];const{data:j}=Jt(f);let P;t[8]!==u?(P={client:u},t[8]=u,t[9]=P):P=t[9];const{data:y}=Gt(P),w=!(h?.connection_type==="VIRTUAL")&&h?.tools&&h.tools.length>0,v=!w;let g;t[10]!==u||t[11]!==v?(g={client:u,enabled:v},t[10]=u,t[11]=v,t[12]=g):g=t[12];const{data:k,isLoading:z}=Qt(g);let D;t[13]!==j?.prompts?(D=j?.prompts??[],t[13]=j?.prompts,t[14]=D):D=t[14];let V;t[15]!==D?(V=D.map(Zs),t[15]=D,t[16]=V):V=t[16];const I=V;let M;t[17]!==y?.resources?(M=y?.resources??[],t[17]=y?.resources,t[18]=M):M=t[18];let W;t[19]!==M?(W=M.map(Gs),t[19]=M,t[20]=W):W=t[20];const E=W;let S;t[21]!==h||t[22]!==w||t[23]!==k?.tools?(S=w?h.tools??[]:(k?.tools??[]).map(Js),t[21]=h,t[22]=w,t[23]=k?.tools,t[24]=S):S=t[24];const U=S;let T;t[25]!==p.update||t[26]!==r?(T=async b=>{await p.update.mutateAsync({id:r,data:b})},t[25]=p.update,t[26]=r,t[27]=T):T=t[27];const $=T;if(!h){let b;return t[28]!==s||t[29]!==c?(b=n.jsx("div",{className:"flex h-full w-full bg-background",children:n.jsx(Ne,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:n.jsx(qe,{variant:"outline",onClick:()=>s({to:"/$org/mcps",params:{org:c}}),children:"Back to connections"})})}),t[28]=s,t[29]=c,t[30]=b):b=t[30],b}let A;return t[31]!==p.update.isPending||t[32]!==a||t[33]!==h||t[34]!==r||t[35]!==$||t[36]!==z||t[37]!==c||t[38]!==I||t[39]!==d||t[40]!==E||t[41]!==U?(A=n.jsx(Ys,{org:c,connection:h,connectionId:r,requestedTabId:d,collections:a,onUpdate:$,isUpdating:p.update.isPending,prompts:I,resources:E,tools:U,isLoadingTools:z}),t[31]=p.update.isPending,t[32]=a,t[33]=h,t[34]=r,t[35]=$,t[36]=z,t[37]=c,t[38]=I,t[39]=d,t[40]=E,t[41]=U,t[42]=A):A=t[42],A}function Js(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Gs(t){return{uri:t.uri,name:t.name,description:t.description}}function Zs(t){return{name:t.name,description:t.description}}function eo(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bt,{children:n.jsx(Y.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:n.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),children:n.jsx(Qs,{})})}),t[0]=e):e=t[0],e}function Mr(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(eo,{}),t[0]=e):e=t[0],e}export{Mr as default};
|
|
1
|
+
import{r as Y,c as X,j as n,v as ze,l as pt,u as xt,bA as nt,ac as Mt,p as Dt,bs as He,o as gt,ba as It,bi as At,s as q,ad as st,ae as Vt,a as $t,f as Ot,F as Ft,h as Wt,k as Et,i as Lt,t as _e,K as ot}from"./index-CHQ9-Q-G.js";import{I as Ke,n as Rt,E as Ne}from"./empty-state-VwVcPCE1.js";import{E as bt}from"./error-boundary-C8CO11ML.js";import{E as zt,r as Ut,e as jt}from"./env-vars-editor-BMhfk7Zf.js";import{P as Qe,S as Xt}from"./index-810mvVLg.js";import{b as Bt,a as qt}from"./use-binding-HsWp1jWu.js";import{u as Yt,S as Ht}from"./index-CvZXtRPz.js";import{f as Je,g as yt}from"./use-connection-UwIAiUmR.js";import{u as Kt}from"./constants-DwkB1age.js";import{d as Qt}from"./use-mcp-tools-BKgKiBFS.js";import{b as Jt,d as Gt}from"./use-mcp-prompts-DDPkiTOB.js";import{a as Zt}from"./mcp-oauth-i2Um3a9A.js";import{b as rt,e as en,c as tn,d as nn,B as sn,a as on}from"./breadcrumb-CJBikxW8.js";import{B as qe}from"./button-CKIyuXIq.js";import{C as rn}from"./collection-tabs-Dd6S7hPE.js";import{i as Re}from"./Loading01-3CQcIIbt.js";import{V as Ge,a as an}from"./layout-D8nQ7DGi.js";import{C as cn}from"./collection-tab-D12suO7P.js";import{B as Ye}from"./badge-DIFY1rsD.js";import{D as ln,a as dn,b as un,c as at}from"./dropdown-menu-CoO02CsY.js";import{F as J,a as mn,b as G,d as H,f as Z,c as te,e as fn}from"./form-CO4xV9gA.js";import{I as ee}from"./input-BrgRsDcE.js";import{S as it,a as ct,b as lt,c as dt,d as Q}from"./select-JdRjOrBE.js";import{i as vt}from"./CheckCircle-BoFrCz54.js";import{t as hn}from"./ChevronDown-DeD12W57.js";import{s as We}from"./Globe02-BhcJ1ruM.js";import{i as pn}from"./Terminal-Djd_0g5K.js";import{s as xn}from"./Trash01-Ck6jzVhZ.js";import{t as Ze}from"./Users03-B-DO1n7F.js";import{s as gn}from"./XClose-DvgsYIZw.js";import{U as bn}from"./use-list-state-Dxbvm2sV.js";import{b as jn,a as yn}from"./use-virtual-mcp-BIZk_q3v.js";import{i as vn}from"./ChevronRight-8Yl-zCCi.js";import{s as Nn}from"./Plus-CP35U6Iv.js";import{t as we,c as Nt,d as wn,m as ut,a as Ee}from"./differenceInSeconds-NQ4PDo0z.js";import{a as wt,C as St}from"./collection-table-wrapper-CzqGMTIb.js";import{C as _t}from"./collection-search-CECpIAiD.js";import{C as Ct}from"./card-MU9VbmJ4.js";import{R as Sn,T as _n}from"./tools-list-DGAPFCDO.js";import"./Pin01-ChRD6YtE.js";import"./use-organization-settings-TImCLEbo.js";import"./useMutation-C8K1KoTI.js";import"./binder-Dg2rfYkp.js";import"./File06-iSPwdYi1.js";import"./index-Bc7QzOnC.js";import"./constants-DBJOqOcW.js";import"./registry-utils-TFnNkGPj.js";import"./extract-connection-data-DwTMOpOf.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./index-BdSNJxPZ.js";import"./circle-alert-BcHAU0vN.js";import"./index-CrNYs5dK.js";import"./X-BnxI_xD6.js";import"./use-deco-chat-open-Da_cfFLg.js";import"./Code01-C2qL6p3f.js";import"./infiniteQueryObserver-CKMx30vn.js";import"./localstorage-keys-BiLB-Ybm.js";import"./useQuery-CImYAWdS.js";import"./popover-CjUGVjON.js";import"./Grid01-B9LzvODL.js";import"./Image01-BYZhOfgB.js";import"./SearchMd-DTs0TtNF.js";import"./spinner-CEhxpPPn.js";import"./dialog-CjI8rs-6.js";import"./AlertCircle-CrLCfZT0.js";import"./ArrowUp-deTSI0E8.js";import"./Edit01-BD2PlTCM.js";import"./Check-DTUUSvp-.js";import"./Copy01-CqWuZ9K-.js";import"./monaco-editor-qYykGrlT.js";import"./use-create-virtual-mcp-CG-Wp4A9.js";import"./index-aWpPBjkT.js";import"./DotsVertical-BYXFslta.js";import"./empty-state-CQab9dR0.js";import"./Inbox01-CUvjj3IH.js";import"./alert-dialog-DN6po1tq.js";import"./use-mobile-CtC8_4UP.js";import"./List-C1dM-VCr.js";import"./view-mode-toggle-BiRjYen1.js";import"./table-CBtv9zrT.js";const Pt=({size:t=24,color:e="currentColor",...s})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},Y.createElement("path",{d:"M2 10s2.005-2.732 3.634-4.362A9 9 0 1 1 12 21a9.004 9.004 0 0 1-8.648-6.5M2 10V4m0 6h6"}));Pt.displayName="RefreshCcw01";let Cn={};function Pn(){return Cn}function mt(t){const e=we(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function et(t,...e){const s=Nt.bind(null,t||e.find(o=>typeof o=="object"));return e.map(s)}function Le(t,e){const s=+we(t)-+we(e);return s<0?-1:s>0?1:s}function kn(t){return Nt(t,Date.now())}function Tn(t,e,s){const[o,r]=et(s?.in,t,e),c=o.getFullYear()-r.getFullYear(),i=o.getMonth()-r.getMonth();return c*12+i}function Mn(t,e){const s=we(t);return s.setHours(23,59,59,999),s}function Dn(t,e){const s=we(t),o=s.getMonth();return s.setFullYear(s.getFullYear(),o+1,0),s.setHours(23,59,59,999),s}function In(t,e){const s=we(t);return+Mn(s)==+Dn(s)}function An(t,e,s){const[o,r,c]=et(s?.in,t,t,e),i=Le(r,c),l=Math.abs(Tn(r,c));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let m=Le(r,c)===-i;In(o)&&l===1&&Le(o,c)===1&&(m=!1);const d=i*(l-+m);return d===0?0:d}const Vn={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$n=(t,e,s)=>{let o;const r=Vn[t];return typeof r=="string"?o=r:e===1?o=r.one:o=r.other.replace("{{count}}",e.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+o:o+" ago":o};function Be(t){return(e={})=>{const s=e.width?String(e.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const On={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Fn={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},En={date:Be({formats:On,defaultWidth:"full"}),time:Be({formats:Fn,defaultWidth:"full"}),dateTime:Be({formats:Wn,defaultWidth:"full"})},Ln={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rn=(t,e,s,o)=>Ln[t];function Ce(t){return(e,s)=>{const o=s?.context?String(s.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=s?.width?String(s.width):i;r=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=s?.width?String(s.width):t.defaultWidth;r=t.values[l]||t.values[i]}const c=t.argumentCallback?t.argumentCallback(e):e;return r[c]}}const zn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Un={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Bn={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Yn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Hn=(t,e)=>{const s=Number(t),o=s%100;if(o>20||o<10)switch(o%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},Kn={ordinalNumber:Hn,era:Ce({values:zn,defaultWidth:"wide"}),quarter:Ce({values:Un,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ce({values:Xn,defaultWidth:"wide"}),day:Ce({values:Bn,defaultWidth:"wide"}),dayPeriod:Ce({values:qn,defaultWidth:"wide",formattingValues:Yn,defaultFormattingWidth:"wide"})};function Pe(t){return(e,s={})=>{const o=s.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],c=e.match(r);if(!c)return null;const i=c[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],m=Array.isArray(l)?Jn(l,p=>p.test(i)):Qn(l,p=>p.test(i));let d;d=t.valueCallback?t.valueCallback(m):m,d=s.valueCallback?s.valueCallback(d):d;const h=e.slice(i.length);return{value:d,rest:h}}}function Qn(t,e){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return s}function Jn(t,e){for(let s=0;s<t.length;s++)if(e(t[s]))return s}function Gn(t){return(e,s={})=>{const o=e.match(t.matchPattern);if(!o)return null;const r=o[0],c=e.match(t.parsePattern);if(!c)return null;let i=t.valueCallback?t.valueCallback(c[0]):c[0];i=s.valueCallback?s.valueCallback(i):i;const l=e.slice(r.length);return{value:i,rest:l}}}const Zn=/^(\d+)(th|st|nd|rd)?/i,es=/\d+/i,ts={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ns={any:[/^b/i,/^(a|c)/i]},ss={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},os={any:[/1/i,/2/i,/3/i,/4/i]},rs={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},as={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},is={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cs={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ls={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ds={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},us={ordinalNumber:Gn({matchPattern:Zn,parsePattern:es,valueCallback:t=>parseInt(t,10)}),era:Pe({matchPatterns:ts,defaultMatchWidth:"wide",parsePatterns:ns,defaultParseWidth:"any"}),quarter:Pe({matchPatterns:ss,defaultMatchWidth:"wide",parsePatterns:os,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Pe({matchPatterns:rs,defaultMatchWidth:"wide",parsePatterns:as,defaultParseWidth:"any"}),day:Pe({matchPatterns:is,defaultMatchWidth:"wide",parsePatterns:cs,defaultParseWidth:"any"}),dayPeriod:Pe({matchPatterns:ls,defaultMatchWidth:"any",parsePatterns:ds,defaultParseWidth:"any"})},ms={code:"en-US",formatDistance:$n,formatLong:En,formatRelative:Rn,localize:Kn,match:us,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fs(t,e,s){const o=Pn(),r=s?.locale??o.locale??ms,c=2520,i=Le(t,e);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},s,{addSuffix:s?.addSuffix,comparison:i}),[m,d]=et(s?.in,...i>0?[e,t]:[t,e]),h=wn(d,m),p=(mt(d)-mt(m))/1e3,a=Math.round((h-p)/60);let x;if(a<2)return s?.includeSeconds?h<5?r.formatDistance("lessThanXSeconds",5,l):h<10?r.formatDistance("lessThanXSeconds",10,l):h<20?r.formatDistance("lessThanXSeconds",20,l):h<40?r.formatDistance("halfAMinute",0,l):h<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):a===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",a,l);if(a<45)return r.formatDistance("xMinutes",a,l);if(a<90)return r.formatDistance("aboutXHours",1,l);if(a<ut){const u=Math.round(a/60);return r.formatDistance("aboutXHours",u,l)}else{if(a<c)return r.formatDistance("xDays",1,l);if(a<Ee){const u=Math.round(a/ut);return r.formatDistance("xDays",u,l)}else if(a<Ee*2)return x=Math.round(a/Ee),r.formatDistance("aboutXMonths",x,l)}if(x=An(d,m),x<12){const u=Math.round(a/Ee);return r.formatDistance("xMonths",u,l)}else{const u=x%12,f=Math.trunc(x/12);return u<3?r.formatDistance("aboutXYears",f,l):u<9?r.formatDistance("overXYears",f,l):r.formatDistance("almostXYears",f+1,l)}}function hs(t,e){return fs(t,kn(t),e)}function ps(t){const e=X.c(13),{virtualMcp:s,org:o}=t;let r;e[0]!==o||e[1]!==s.id?(r={org:o,agentId:s.id},e[0]=o,e[1]=s.id,e[2]=r):r=e[2];let c;e[3]!==s.icon||e[4]!==s.title?(c=s.icon?n.jsx("img",{src:s.icon,alt:s.title,className:"w-5 h-5 rounded-md object-cover shrink-0"}):n.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:n.jsx(Ze,{size:16,className:"text-primary"})}),e[3]=s.icon,e[4]=s.title,e[5]=c):c=e[5];let i;e[6]!==s.title?(i=n.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=i):i=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(vn,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=l):l=e[8];let m;return e[9]!==r||e[10]!==c||e[11]!==i?(m=n.jsxs(pt,{to:"/$org/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,i,l]}),e[9]=r,e[10]=c,e[11]=i,e[12]=m):m=e[12],m}function ft(t){const e=X.c(20),{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:l}=t,m=ze(),d=yn();let h;e[0]!==d.create||e[1]!==r||e[2]!==c||e[3]!==s||e[4]!==o||e[5]!==m||e[6]!==i?(h=async()=>{const u=await d.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:c??null,status:"active",connections:[{connection_id:s,selected_tools:null,selected_resources:null,selected_prompts:null}]});m({to:"/$org/agents/$agentId",params:{org:i,agentId:u.id}})},e[0]=d.create,e[1]=r,e[2]=c,e[3]=s,e[4]=o,e[5]=m,e[6]=i,e[7]=h):h=e[7];const p=h;if(l){let u;e[8]!==d.create.isPending?(u=d.create.isPending?n.jsx(Re,{size:16,className:"animate-spin"}):n.jsx(Nn,{size:16}),e[8]=d.create.isPending,e[9]=u):u=e[9];let f;return e[10]!==d.create.isPending||e[11]!==p||e[12]!==u?(f=n.jsx(qe,{variant:"ghost",className:"size-6 p-0",onClick:p,disabled:d.create.isPending,children:u}),e[10]=d.create.isPending,e[11]=p,e[12]=u,e[13]=f):f=e[13],f}let a;e[14]!==d.create.isPending?(a=d.create.isPending?n.jsx(Re,{className:"animate-spin text-muted-foreground"}):n.jsx(Ze,{className:"size-3 text-muted-foreground"}),e[14]=d.create.isPending,e[15]=a):a=e[15];let x;return e[16]!==d.create.isPending||e[17]!==p||e[18]!==a?(x=n.jsxs(qe,{variant:"outline",size:"sm",onClick:p,disabled:d.create.isPending,children:[a,"Create an agent"]}),e[16]=d.create.isPending,e[17]=p,e[18]=a,e[19]=x):x=e[19],x}function xs(t){const e=X.c(26),{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i}=t;let l;e[0]!==s?(l={filters:[{column:"connection_id",value:s}]},e[0]=s,e[1]=l):l=e[1];const m=jn(l);if(!(m.length>0)){let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=f):f=e[2];let j;return e[3]!==r||e[4]!==c||e[5]!==s||e[6]!==o||e[7]!==i?(j=n.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[f,n.jsx(ft,{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=c,e[5]=s,e[6]=o,e[7]=i,e[8]=j):j=e[8],j}let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=h):h=e[9];let p;e[10]!==r||e[11]!==c||e[12]!==s||e[13]!==o||e[14]!==i?(p=n.jsx("div",{className:"flex flex-col gap-1",children:n.jsxs("div",{className:"flex items-center justify-between",children:[h,n.jsx(ft,{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=c,e[12]=s,e[13]=o,e[14]=i,e[15]=p):p=e[15];let a;if(e[16]!==i||e[17]!==m){let f;e[19]!==i?(f=j=>n.jsx(ps,{virtualMcp:j,org:i},j.id),e[19]=i,e[20]=f):f=e[20],a=m.map(f),e[16]=i,e[17]=m,e[18]=a}else a=e[18];let x;e[21]!==a?(x=n.jsx("div",{className:"flex flex-col gap-2",children:a}),e[21]=a,e[22]=x):x=e[22];let u;return e[23]!==p||e[24]!==x?(u=n.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,x]}),e[23]=p,e[24]=x,e[25]=u):u=e[25],u}function gs({form:t,connection:e,hasOAuthToken:s,onReauthenticate:o,onRemoveOAuth:r}){const c=nt({control:t.control,name:"ui_type"}),i=nt({control:t.control,name:"connection_url"}),{stdioEnabled:l}=Mt(),m=(()=>{if(typeof i!="string"||!i)return!1;try{const a=new URL(i);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=l||e.connection_type==="STDIO",h=e.connection_type==="VIRTUAL",p=h?Dt(e.connection_url):null;return h?n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),n.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[n.jsx(Ze,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),n.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:n.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[n.jsx(J,{control:t.control,name:"ui_type",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),c!=="NPX"&&c!=="STDIO"?n.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[n.jsxs(it,{value:a.value,onValueChange:a.onChange,children:[n.jsx(H,{children:n.jsxs(ct,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[n.jsx(We,{className:"w-4 h-4 text-muted-foreground shrink-0"}),n.jsx(lt,{})]})}),n.jsxs(dt,{children:[n.jsx(Q,{value:"HTTP",children:"HTTP"}),n.jsx(Q,{value:"SSE",children:"SSE"}),n.jsx(Q,{value:"Websocket",children:"Websocket"}),d&&n.jsxs(n.Fragment,{children:[n.jsx(Q,{value:"NPX",children:"NPX Package"}),n.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),n.jsx("div",{className:"w-px bg-border"}),n.jsx(J,{control:t.control,name:"connection_url",render:({field:x})=>n.jsx(G,{className:"flex-1 min-w-0",children:n.jsx(H,{children:n.jsx(ee,{placeholder:"https://example.com/mcp",...x,value:x.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):n.jsxs(it,{value:a.value,onValueChange:a.onChange,children:[n.jsx(H,{children:n.jsx(ct,{className:"h-10",children:n.jsx(lt,{})})}),n.jsxs(dt,{children:[n.jsx(Q,{value:"HTTP",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(We,{className:"w-4 h-4"}),"HTTP"]})}),n.jsx(Q,{value:"SSE",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(We,{className:"w-4 h-4"}),"SSE"]})}),n.jsx(Q,{value:"Websocket",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(We,{className:"w-4 h-4"}),"Websocket"]})}),d&&n.jsxs(n.Fragment,{children:[n.jsx(Q,{value:"NPX",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Rt,{className:"w-4 h-4"}),"NPX Package"]})}),n.jsx(Q,{value:"STDIO",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(pn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),n.jsx(Z,{})]})}),c==="NPX"&&n.jsx(J,{control:t.control,name:"npx_package",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})}),c==="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(J,{control:t.control,name:"stdio_command",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})}),n.jsx(J,{control:t.control,name:"stdio_args",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),n.jsx(Z,{})]})})]}),n.jsx(J,{control:t.control,name:"stdio_cwd",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),n.jsx(H,{children:n.jsx(ee,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})})]}),(c==="NPX"||c==="STDIO")&&n.jsx(J,{control:t.control,name:"env_vars",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),n.jsx(H,{children:n.jsx(zt,{value:a.value??[],onChange:a.onChange})}),n.jsx(Z,{})]})}),c!=="NPX"&&c!=="STDIO"&&n.jsx(J,{control:t.control,name:"connection_token",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),s?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs(ln,{children:[n.jsx(dn,{asChild:!0,children:n.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:n.jsxs(Ye,{variant:"success",className:"gap-1.5",children:[n.jsx(vt,{size:12}),"Authenticated via OAuth",n.jsx(hn,{size:12})]})})}),n.jsxs(un,{align:"start",children:[n.jsxs(at,{onClick:o,children:[n.jsx(Pt,{size:16}),"Re-authenticate"]}),n.jsxs(at,{variant:"destructive",onClick:r,children:[n.jsx(xn,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?n.jsxs("div",{className:"relative group",children:[n.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),n.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:n.jsx(gn,{size:14,className:"text-muted-foreground"})})]}):n.jsxs(n.Fragment,{children:[n.jsx(H,{children:n.jsx(ee,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&n.jsxs(fn,{children:["Create a PAT at"," ",n.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),n.jsx(Z,{})]})})]})}function bs(t){const e=X.c(43),{form:s,connection:o,isMCPAuthenticated:r,hasOAuthToken:c,onReauthenticate:i,onRemoveOAuth:l}=t,{org:m}=xt();let d;e[0]!==o.icon||e[1]!==o.title?(d=n.jsx(Ke,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=d):d=e[2];let h;e[3]!==s.control?(h=n.jsxs("div",{className:"flex flex-col",children:[n.jsx(J,{control:s.control,name:"title",render:ys}),n.jsx(J,{control:s.control,name:"description",render:js})]}),e[3]=s.control,e[4]=h):h=e[4];let p;e[5]!==d||e[6]!==h?(p=n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[d,h]}),e[5]=d,e[6]=h,e[7]=p):p=e[7];let a;e[8]!==o||e[9]!==s||e[10]!==c||e[11]!==i||e[12]!==l?(a=n.jsx(gs,{form:s,connection:o,hasOAuthToken:c,onReauthenticate:i,onRemoveOAuth:l}),e[8]=o,e[9]=s,e[10]=c,e[11]=i,e[12]=l,e[13]=a):a=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=x):x=e[14];let u;e[15]!==r?(u=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[x,r?n.jsxs(Ye,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[n.jsx(vt,{size:12}),"Connected"]}):n.jsx(Ye,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=f):f=e[17];let j;e[18]!==o.created_by?(j=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[f,n.jsx(bn,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=P):P=e[20];let y;e[21]!==o.updated_at?(y=o.updated_at?hs(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=y):y=e[22];let N;e[23]!==y?(N=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[P,n.jsx("span",{className:"text-sm text-foreground",children:y})]}),e[23]=y,e[24]=N):N=e[24];let w;e[25]!==N||e[26]!==u||e[27]!==j?(w=n.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[u,j,N]}),e[25]=N,e[26]=u,e[27]=j,e[28]=w):w=e[28];let v;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==m.slug?(v=n.jsx(xs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:m.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=m.slug,e[34]=v):v=e[34];let g;e[35]!==w||e[36]!==v||e[37]!==p||e[38]!==a?(g=n.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[p,a,w,v]}),e[35]=w,e[36]=v,e[37]=p,e[38]=a,e[39]=g):g=e[39];let k;return e[40]!==s||e[41]!==g?(k=n.jsx(mn,{...s,children:g}),e[40]=s,e[41]=g,e[42]=k):k=e[42],k}function js(t){const{field:e}=t;return n.jsxs(G,{className:"w-full space-y-0",children:[n.jsx(H,{children:n.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),n.jsx(Z,{})]})}function ys(t){const{field:e}=t;return n.jsxs(G,{className:"flex-1 space-y-0",children:[n.jsx(H,{children:n.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),n.jsx(Z,{})]})}function vs(t){const e=X.c(42),{prompts:s,connectionId:o,org:r,connectionTitle:c,connectionIcon:i,onPromptClick:l,showToolbar:m,emptyMessage:d}=t,h=m===void 0?!0:m,p=d===void 0?"This connection doesn't have any prompts yet.":d,a=ze(),u=He().location.href,[f,j]=Y.useState(""),[P,y]=Y.useState("table"),[N,w]=Y.useState("name"),[v,g]=Y.useState("asc");let k;e[0]!==v||e[1]!==N?(k=_=>{N===_?(g(Cs),v==="desc"&&w(void 0)):(w(_),g("asc"))},e[0]=v,e[1]=N,e[2]=k):k=e[2];const z=k;let D;e[3]!==o||e[4]!==a||e[5]!==l||e[6]!==r?(D=_=>{l?l(_):o&&r&&a({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(_.name)}})},e[3]=o,e[4]=a,e[5]=l,e[6]=r,e[7]=D):D=e[7];const V=D;let I;if(e[8]!==s||e[9]!==f||e[10]!==v||e[11]!==N){const _=!s||s.length===0?[]:f.trim()?(()=>{const K=f.toLowerCase();return s.filter(B=>B.name.toLowerCase().includes(K)||B.description&&B.description.toLowerCase().includes(K))})():s;I=!N||!v?_:[..._].sort((K,B)=>{const ne=K[N]||"",se=B[N]||"",oe=String(ne).localeCompare(String(se));return v==="asc"?oe:-oe}),e[8]=s,e[9]=f,e[10]=v,e[11]=N,e[12]=I}else I=e[12];const M=I;let W;e[13]===Symbol.for("react.memo_cache_sentinel")?(W=[{id:"name",header:"Name",render:_s,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=W):W=e[13];const E=W;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=E.filter(ws).map(Ns),e[14]=S):S=e[14];const U=S;let T;e[15]!==i||e[16]!==c||e[17]!==z||e[18]!==h||e[19]!==v||e[20]!==N||e[21]!==u||e[22]!==P?(T=h&&n.jsxs(Ge,{children:[n.jsx(St,{viewMode:P,onViewModeChange:y,sortKey:N,sortDirection:v,onSort:z,sortOptions:U}),n.jsx(Qe,{title:c?`${c}: Prompts`:"Prompts",url:u,icon:i??"description"})]}),e[15]=i,e[16]=c,e[17]=z,e[18]=h,e[19]=v,e[20]=N,e[21]=u,e[22]=P,e[23]=T):T=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=_=>{_.key==="Escape"&&(j(""),_.target.blur())},e[24]=$):$=e[24];let A;e[25]!==f?(A=n.jsx(_t,{value:f,onChange:j,placeholder:"Search prompts...",onKeyDown:$}),e[25]=f,e[26]=A):A=e[26];let b;e[27]!==p||e[28]!==V||e[29]!==z||e[30]!==f||e[31]!==v||e[32]!==N||e[33]!==M||e[34]!==P?(b=P==="cards"?n.jsx("div",{className:"flex-1 overflow-auto p-5",children:M.length===0?n.jsx(Ne,{image:null,title:f?"No prompts found":"No prompts available",description:f?"Try adjusting your search terms":p}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:M.map(_=>n.jsx(Ct,{className:"cursor-pointer transition-colors",onClick:()=>V(_),children:n.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[n.jsx(Ke,{icon:null,name:_.name,size:"md",className:"shrink-0 shadow-sm"}),n.jsxs("div",{className:"flex flex-col gap-0",children:[n.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:_.name}),n.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:_.description||"No description"})]})]})},_.name))})}):n.jsx(wt,{columns:E,data:M,isLoading:!1,sortKey:N,sortDirection:v,onSort:z,onRowClick:_=>V(_),emptyState:n.jsx(Ne,{image:null,title:f?"No prompts found":"No prompts available",description:f?"Try adjusting your search terms":p})}),e[27]=p,e[28]=V,e[29]=z,e[30]=f,e[31]=v,e[32]=N,e[33]=M,e[34]=P,e[35]=b):b=e[35];let R;e[36]!==A||e[37]!==b?(R=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,b]}),e[36]=A,e[37]=b,e[38]=R):R=e[38];let O;return e[39]!==R||e[40]!==T?(O=n.jsxs(n.Fragment,{children:[T,R]}),e[39]=R,e[40]=T,e[41]=O):O=e[41],O}function Ns(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function ws(t){return t.sortable}function Ss(t){return n.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function _s(t){return n.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Cs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ps(t){const e=X.c(6),{prompts:s,connectionId:o,org:r}=t,c=Je(o),i=c?.title,l=c?.icon;let m;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l?(m=n.jsx(vs,{prompts:s,connectionId:o,org:r,connectionTitle:i,connectionIcon:l}),e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=m):m=e[5],m}function ks(t){const e=X.c(2),{repository:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:n.jsx(Sn,{repository:s})}),e[0]=s,e[1]=o):o=e[1],o}function Ts(t){const e=X.c(39),{resources:s,connectionTitle:o,connectionIcon:r,onResourceClick:c,showToolbar:i,emptyMessage:l}=t,m=i===void 0?!0:i,d=l===void 0?"This connection doesn't have any resources yet.":l,p=He().location.href,[a,x]=Y.useState(""),[u,f]=Y.useState("table"),[j,P]=Y.useState("name"),[y,N]=Y.useState("asc");let w;e[0]!==y||e[1]!==j?(w=b=>{j===b?(N(Os),y==="desc"&&P(void 0)):(P(b),N("asc"))},e[0]=y,e[1]=j,e[2]=w):w=e[2];const v=w;let g;e[3]!==c?(g=b=>{c&&c(b)},e[3]=c,e[4]=g):g=e[4];const k=g;let z;if(e[5]!==s||e[6]!==a||e[7]!==y||e[8]!==j){const b=!s||s.length===0?[]:a.trim()?(()=>{const R=a.toLowerCase();return s.filter(O=>O.uri.toLowerCase().includes(R)||O.name&&O.name.toLowerCase().includes(R)||O.description&&O.description.toLowerCase().includes(R))})():s;z=!j||!y?b:[...b].sort((R,O)=>{const _=R[j]||"",K=O[j]||"",B=String(_).localeCompare(String(K));return y==="asc"?B:-B}),e[5]=s,e[6]=a,e[7]=y,e[8]=j,e[9]=z}else z=e[9];const D=z;let V;e[10]===Symbol.for("react.memo_cache_sentinel")?(V=[{id:"name",header:"Name",render:$s,sortable:!0},{id:"uri",header:"URI",render:Vs,sortable:!0},{id:"description",header:"Description",render:As,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Is,sortable:!0}],e[10]=V):V=e[10];const I=V;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=I.filter(Ds).map(Ms),e[11]=M):M=e[11];const W=M;let E;e[12]!==r||e[13]!==o||e[14]!==v||e[15]!==m||e[16]!==y||e[17]!==j||e[18]!==p||e[19]!==u?(E=m&&n.jsxs(Ge,{children:[n.jsx(St,{viewMode:u,onViewModeChange:f,sortKey:j,sortDirection:y,onSort:v,sortOptions:W}),n.jsx(Qe,{title:o?`${o}: Resources`:"Resources",url:p,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=v,e[15]=m,e[16]=y,e[17]=j,e[18]=p,e[19]=u,e[20]=E):E=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(x(""),b.target.blur())},e[21]=S):S=e[21];let U;e[22]!==a?(U=n.jsx(_t,{value:a,onChange:x,placeholder:"Search resources...",onKeyDown:S}),e[22]=a,e[23]=U):U=e[23];let T;e[24]!==d||e[25]!==k||e[26]!==v||e[27]!==a||e[28]!==y||e[29]!==j||e[30]!==D||e[31]!==u?(T=u==="cards"?n.jsx("div",{className:"flex-1 overflow-auto p-5",children:D.length===0?n.jsx(Ne,{image:null,title:a?"No resources found":"No resources available",description:a?"Try adjusting your search terms":d}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:D.map(b=>n.jsx(Ct,{className:"cursor-pointer transition-colors",onClick:()=>k(b),children:n.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[n.jsx(Ke,{icon:null,name:b.name||b.uri,size:"md",className:"shrink-0 shadow-sm"}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.name||b.uri}),n.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:b.uri}),b.description&&n.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:b.description})]})]})},b.uri))})}):n.jsx(wt,{columns:I,data:D,isLoading:!1,sortKey:j,sortDirection:y,onSort:v,onRowClick:b=>k(b),emptyState:n.jsx(Ne,{image:null,title:a?"No resources found":"No resources available",description:a?"Try adjusting your search terms":d})}),e[24]=d,e[25]=k,e[26]=v,e[27]=a,e[28]=y,e[29]=j,e[30]=D,e[31]=u,e[32]=T):T=e[32];let $;e[33]!==U||e[34]!==T?($=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[U,T]}),e[33]=U,e[34]=T,e[35]=$):$=e[35];let A;return e[36]!==$||e[37]!==E?(A=n.jsxs(n.Fragment,{children:[E,$]}),e[36]=$,e[37]=E,e[38]=A):A=e[38],A}function Ms(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ds(t){return t.sortable}function Is(t){return n.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function As(t){return n.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Vs(t){return n.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function $s(t){return n.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Os(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Fs(t){const e=X.c(6),{resources:s,connectionId:o,org:r}=t,c=Je(o),i=c?.title,l=c?.icon;let m;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l?(m=n.jsx(Ts,{resources:s,connectionId:o,org:r,connectionTitle:i,connectionIcon:l}),e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=m):m=e[5],m}const Ws=gt({key:q().min(1,"Key is required"),value:q()}),Es=gt({title:q().min(1,"Name is required"),description:q().nullable().optional(),ui_type:Vt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:q().optional(),connection_token:q().nullable().optional(),npx_package:q().optional(),stdio_command:q().optional(),stdio_args:q().optional(),stdio_cwd:q().optional(),env_vars:st(Ws).optional(),configuration_scopes:st(q()).nullable().optional(),configuration_state:It(q(),At()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Ls(t){const e=X.c(5),{tools:s,connectionId:o,org:r,isLoading:c}=t;let i;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==s?(i=n.jsx(_n,{tools:s,connectionId:o,org:r,isLoading:c}),e[0]=o,e[1]=c,e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function Rs(t){return t.command==="npx"}function zs(t){return t.args?.find(e=>!e.startsWith("-"))??""}function Us(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Xs(t,e){const s={command:"npx",args:["-y",t]},o=jt(e);return Object.keys(o).length>0&&(s.envVars=o),s}function Bs(t,e,s,o){const r={command:t};e.trim()&&(r.args=e.trim().split(/\s+/)),s?.trim()&&(r.cwd=s.trim());const c=jt(o);return Object.keys(c).length>0&&(r.envVars=c),r}function ht(t,e){const s={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&Lt(t.connection_headers)){const o=t.connection_headers,r=Ut(o.envVars);if(Rs(o)){const i=zs(o);return{...s,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const c=Us(o);return{...s,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:r}}return{...s,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(t){let e,s=null,o=null,r=null;return t.ui_type==="NPX"?(e="STDIO",s="",r=Xs(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",s="",r=Bs(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,s=t.connection_url||"",o=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:s,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function Ys(t){const e=X.c(117),{connection:s,connectionId:o,org:r,requestedTabId:c,collections:i,onUpdate:l,isUpdating:m,prompts:d,resources:h,tools:p,isLoadingTools:a}=t;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/$org/mcps/$connectionId"},e[0]=x):x=e[0];const u=ze(x),f=Ft(),P=He().location.href,y=yt();let N;e[1]!==o?(N={connectionId:o},e[1]=o,e[2]=N):N=e[2];const w=Yt(N),g=s?.connection_type==="VIRTUAL"||w.isAuthenticated;let k;e[3]!==s?(k={connections:[s],binding:"MCP"},e[3]=s,e[4]=k):k=e[4];const D=qt(k).length>0,V=s?.metadata?.repository,I=!!V?.url;let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M=Wt(Es),e[5]=M):M=e[5];let W;e[6]!==s?(W=ht(s),e[6]=s,e[7]=W):W=e[7];let E;e[8]!==W?(E={resolver:M,values:W},e[8]=W,e[9]=E):E=e[9];const S=Et(E),U=S.formState.isDirty;let T;e[10]!==S||e[11]!==l?(T=async()=>{if(!await S.trigger())return;const L=S.getValues(),ve=qs(L);await l(ve),S.reset(L)},e[10]=S,e[11]=l,e[12]=T):T=e[12];const $=T;let A;e[13]!==s||e[14]!==S?(A=()=>{S.reset(ht(s))},e[13]=s,e[14]=S,e[15]=A):A=e[15];const b=A;let R;e[16]!==s.id||e[17]!==y||e[18]!==f?(R=async()=>{const{token:C,tokenInfo:L,error:ve}=await Zt({connectionId:s.id});if(ve||!C){_e.error(`Authentication failed: ${ve}`);return}if(L)try{const Fe=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:L.accessToken,refreshToken:L.refreshToken,expiresIn:L.expiresIn,scope:L.scope,clientId:L.clientId,clientSecret:L.clientSecret,tokenEndpoint:L.tokenEndpoint})});if(!Fe.ok)console.error("Failed to save OAuth token:",await Fe.text()),await y.update.mutateAsync({id:s.id,data:{connection_token:C}});else try{await y.update.mutateAsync({id:s.id,data:{}})}catch(tt){console.warn("Failed to refresh connection tools after OAuth:",tt)}}catch(Fe){console.error("Error saving OAuth token:",Fe),await y.update.mutateAsync({id:s.id,data:{connection_token:C}})}else await y.update.mutateAsync({id:s.id,data:{connection_token:C}});const Tt=new URL(`/mcp/${s.id}`,window.location.origin);await f.invalidateQueries({queryKey:ot.isMCPAuthenticated(Tt.href,null)}),_e.success("Authentication successful")},e[16]=s.id,e[17]=y,e[18]=f,e[19]=R):R=e[19];const O=R;let _;e[20]!==s.id||e[21]!==f?(_=async()=>{try{const C=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!C.ok){const ve=await C.text();_e.error(`Failed to remove OAuth: ${ve}`);return}const L=new URL(`/mcp/${s.id}`,window.location.origin);await f.invalidateQueries({queryKey:ot.isMCPAuthenticated(L.href,null)}),_e.success("OAuth removed. You can now re-authenticate with a different account.")}catch(C){console.error("Error removing OAuth token:",C),_e.error("Failed to remove OAuth")}},e[20]=s.id,e[21]=f,e[22]=_):_=e[22];const K=_,B=p.length,ne=d.length,se=h.length,oe=B>0||a;let ke;e[23]===Symbol.for("react.memo_cache_sentinel")?(ke={id:"settings",label:"Settings"},e[23]=ke):ke=e[23];let re;e[24]!==a||e[25]!==g||e[26]!==oe||e[27]!==B?(re=g&&oe?[{id:"tools",label:"Tools",count:a?void 0:B}]:[],e[24]=a,e[25]=g,e[26]=oe,e[27]=B,e[28]=re):re=e[28];let ae;e[29]!==g||e[30]!==ne?(ae=g&&ne>0?[{id:"prompts",label:"Prompts",count:ne}]:[],e[29]=g,e[30]=ne,e[31]=ae):ae=e[31];let ie;e[32]!==g||e[33]!==se?(ie=g&&se>0?[{id:"resources",label:"Resources",count:se}]:[],e[32]=g,e[33]=se,e[34]=ie):ie=e[34];let Te;if(e[35]!==i||e[36]!==I||e[37]!==g||e[38]!==re||e[39]!==ae||e[40]!==ie){let C;e[42]!==I?(C=I?[{id:"readme",label:"README"}]:[],e[42]=I,e[43]=C):C=e[43],Te=[ke,...re,...ae,...ie,...g?(i||[]).map(Ks):[],...C],e[35]=i,e[36]=I,e[37]=g,e[38]=re,e[39]=ae,e[40]=ie,e[41]=Te}else Te=e[41];const Se=Te,kt=g&&Se.some(Hs)?"tools":"settings",F=Se.some(C=>C.id===c)?c:kt;let Me;e[44]!==u?(Me=C=>{u({search:L=>({...L,tab:C}),replace:!0})},e[44]=u,e[45]=Me):Me=e[45];const ce=Me;let le;e[46]!==i?(le=i||[],e[46]=i,e[47]=le):le=e[47];let De;if(e[48]!==F||e[49]!==le){let C;e[51]!==F?(C=L=>L.name===F,e[51]=F,e[52]=C):C=e[52],De=le.find(C),e[48]=F,e[49]=le,e[50]=De}else De=e[50];const Ie=De;let de;e[53]!==r?(de=n.jsx(rt,{children:n.jsx(tn,{asChild:!0,children:n.jsx(pt,{to:"/$org/mcps",params:{org:r},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let Ae;e[55]===Symbol.for("react.memo_cache_sentinel")?(Ae=n.jsx(nn,{}),e[55]=Ae):Ae=e[55];let ue;e[56]!==s.title?(ue=n.jsx(rt,{children:n.jsx(en,{children:s.title})}),e[56]=s.title,e[57]=ue):ue=e[57];let Ve;e[58]!==de||e[59]!==ue?(Ve=n.jsx(sn,{children:n.jsxs(on,{children:[de,Ae,ue]})}),e[58]=de,e[59]=ue,e[60]=Ve):Ve=e[60];const Ue=Ve;let me;e[61]!==$||e[62]!==b||e[63]!==U||e[64]!==m?(me=n.jsx(Xt,{onSave:$,onUndo:b,isDirty:U,isSaving:m}),e[61]=$,e[62]=b,e[63]=U,e[64]=m,e[65]=me):me=e[65];const Xe=s.icon??"settings";let fe;e[66]!==s.title||e[67]!==Xe||e[68]!==P?(fe=n.jsx(Qe,{title:s.title,url:P,icon:Xe}),e[66]=s.title,e[67]=Xe,e[68]=P,e[69]=fe):fe=e[69];let he;e[70]!==me||e[71]!==fe?(he=n.jsxs(Ge,{children:[me,fe]}),e[70]=me,e[71]=fe,e[72]=he):he=e[72];let pe;e[73]!==w.hasOAuthToken||e[74]!==s||e[75]!==S||e[76]!==O||e[77]!==K||e[78]!==g?(pe=n.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:n.jsx(bs,{form:S,connection:s,isMCPAuthenticated:g,hasOAuthToken:w.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:K})}),e[73]=w.hasOAuthToken,e[74]=s,e[75]=S,e[76]=O,e[77]=K,e[78]=g,e[79]=pe):pe=e[79];let xe;e[80]!==F||e[81]!==ce||e[82]!==Se?(xe=n.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:n.jsx(rn,{tabs:Se,activeTab:F,onTabChange:ce,className:"flex-1"})}),e[80]=F,e[81]=ce,e[82]=Se,e[83]=xe):xe=e[83];let $e;e[84]===Symbol.for("react.memo_cache_sentinel")?($e=n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=$e):$e=e[84];let ge;e[85]!==Ie||e[86]!==F||e[87]!==w.isServerError||e[88]!==w.supportsOAuth||e[89]!==s||e[90]!==o||e[91]!==S||e[92]!==O||e[93]!==ce||e[94]!==D||e[95]!==I||e[96]!==a||e[97]!==g||e[98]!==r||e[99]!==d||e[100]!==V||e[101]!==h||e[102]!==p?(ge=n.jsx(Y.Suspense,{fallback:$e,children:F==="tools"?n.jsx(Ls,{tools:p,connectionId:o,org:r,isLoading:a}):F==="prompts"?n.jsx(Ps,{prompts:d,connectionId:o,org:r}):F==="resources"?n.jsx(Fs,{resources:h,connectionId:o,org:r}):F==="settings"?n.jsx(Ht,{connection:s,form:S,hasMcpBinding:D,isMCPAuthenticated:g,supportsOAuth:w.supportsOAuth,isServerError:w.isServerError,onAuthenticate:O,onViewReadme:I?()=>ce("readme"):void 0}):F==="readme"&&I?n.jsx(ks,{repository:V}):Ie&&g?n.jsx(cn,{connectionId:o,org:r,activeCollection:Ie},F):n.jsx(Ne,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=F,e[87]=w.isServerError,e[88]=w.supportsOAuth,e[89]=s,e[90]=o,e[91]=S,e[92]=O,e[93]=ce,e[94]=D,e[95]=I,e[96]=a,e[97]=g,e[98]=r,e[99]=d,e[100]=V,e[101]=h,e[102]=p,e[103]=ge):ge=e[103];let be;e[104]!==F||e[105]!==ge?(be=n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsx(bt,{children:ge},F)}),e[104]=F,e[105]=ge,e[106]=be):be=e[106];let je;e[107]!==xe||e[108]!==be?(je=n.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[xe,be]}),e[107]=xe,e[108]=be,e[109]=je):je=e[109];let ye;e[110]!==pe||e[111]!==je?(ye=n.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[pe,je]}),e[110]=pe,e[111]=je,e[112]=ye):ye=e[112];let Oe;return e[113]!==Ue||e[114]!==he||e[115]!==ye?(Oe=n.jsxs(an,{breadcrumb:Ue,children:[he,ye]}),e[113]=Ue,e[114]=he,e[115]=ye,e[116]=Oe):Oe=e[116],Oe}function Hs(t){return t.id==="tools"}function Ks(t){return{id:t.name,label:t.displayName}}function Qs(){const t=X.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const s=ze(e);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/mcps/$connectionId"},t[1]=o):o=t[1];const{connectionId:r,org:c}=$t(o),{org:i}=xt();let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[2]=l):l=t[2];const d=Ot(l).tab??"",h=Je(r),p=yt(),a=Bt(h??void 0);let x;t[3]!==r||t[4]!==i.id?(x={connectionId:r,orgId:i.id},t[3]=r,t[4]=i.id,t[5]=x):x=t[5];const u=Kt(x);let f;t[6]!==u?(f={client:u},t[6]=u,t[7]=f):f=t[7];const{data:j}=Jt(f);let P;t[8]!==u?(P={client:u},t[8]=u,t[9]=P):P=t[9];const{data:y}=Gt(P),w=!(h?.connection_type==="VIRTUAL")&&h?.tools&&h.tools.length>0,v=!w;let g;t[10]!==u||t[11]!==v?(g={client:u,enabled:v},t[10]=u,t[11]=v,t[12]=g):g=t[12];const{data:k,isLoading:z}=Qt(g);let D;t[13]!==j?.prompts?(D=j?.prompts??[],t[13]=j?.prompts,t[14]=D):D=t[14];let V;t[15]!==D?(V=D.map(Zs),t[15]=D,t[16]=V):V=t[16];const I=V;let M;t[17]!==y?.resources?(M=y?.resources??[],t[17]=y?.resources,t[18]=M):M=t[18];let W;t[19]!==M?(W=M.map(Gs),t[19]=M,t[20]=W):W=t[20];const E=W;let S;t[21]!==h||t[22]!==w||t[23]!==k?.tools?(S=w?h.tools??[]:(k?.tools??[]).map(Js),t[21]=h,t[22]=w,t[23]=k?.tools,t[24]=S):S=t[24];const U=S;let T;t[25]!==p.update||t[26]!==r?(T=async b=>{await p.update.mutateAsync({id:r,data:b})},t[25]=p.update,t[26]=r,t[27]=T):T=t[27];const $=T;if(!h){let b;return t[28]!==s||t[29]!==c?(b=n.jsx("div",{className:"flex h-full w-full bg-background",children:n.jsx(Ne,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:n.jsx(qe,{variant:"outline",onClick:()=>s({to:"/$org/mcps",params:{org:c}}),children:"Back to connections"})})}),t[28]=s,t[29]=c,t[30]=b):b=t[30],b}let A;return t[31]!==p.update.isPending||t[32]!==a||t[33]!==h||t[34]!==r||t[35]!==$||t[36]!==z||t[37]!==c||t[38]!==I||t[39]!==d||t[40]!==E||t[41]!==U?(A=n.jsx(Ys,{org:c,connection:h,connectionId:r,requestedTabId:d,collections:a,onUpdate:$,isUpdating:p.update.isPending,prompts:I,resources:E,tools:U,isLoadingTools:z}),t[31]=p.update.isPending,t[32]=a,t[33]=h,t[34]=r,t[35]=$,t[36]=z,t[37]=c,t[38]=I,t[39]=d,t[40]=E,t[41]=U,t[42]=A):A=t[42],A}function Js(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Gs(t){return{uri:t.uri,name:t.name,description:t.description}}function Zs(t){return{name:t.name,description:t.description}}function eo(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(bt,{children:n.jsx(Y.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:n.jsx(Re,{size:32,className:"animate-spin text-muted-foreground"})}),children:n.jsx(Qs,{})})}),t[0]=e):e=t[0],e}function Mr(){const t=X.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(eo,{}),t[0]=e):e=t[0],e}export{Mr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as le,j as e,r as U,u as _e,v as Ce,f as be,g as ke,ac as Ne,k as we,h as Se,i as De,o as de,ad as Pe,s as y,ae as Te}from"./index-D4MF_YMK.js";import{g as Ie}from"./generate-id-Dyweu44Y.js";import{C as $e,a as Ve}from"./collection-table-wrapper-DJPMRDfl.js";import{C as Ae}from"./collection-search-DsJ7tYYh.js";import{C as Ee}from"./connection-card-BTdUyxaq.js";import{B as F}from"./badge-obBgL92k.js";import{i as Me}from"./AlertCircle-COLM9TSp.js";import{i as Be}from"./CheckCircle-Cl7dWyoO.js";import{n as H,E as O,I as Fe}from"./empty-state-CQfuZLBd.js";import{E as He}from"./error-boundary-DtmbPa7H.js";import{P as T}from"./index-Dv6ogWGy.js";import{u as Oe,U as Z,s as ee}from"./use-list-state-DlKabQs5.js";import{u as ze}from"./use-binding-B1zV-Y0z.js";import{f as Ue,e as Re}from"./registry-utils-dFRqfWcz.js";import{f as Xe,a as Le,b as We,c as Ke,d as Ge,e as qe,A as Ye,g as Qe}from"./alert-dialog-C5BMlV_B.js";import{B as Je,a as Ze,b as et,e as tt}from"./breadcrumb-rJChBiJd.js";import{B as _}from"./button-CQ8Kjf8O.js";import{D as nt,a as st,b as ot,c as rt,d as it,e as at}from"./dialog-DNf7oKHG.js";import{D as te,a as ne,b as se,c as A}from"./dropdown-menu-oqWMuO1Y.js";import{a as ct,F as h,b as x,c as g,d as f,f as j}from"./form-DOuqKZXC.js";import{I as b}from"./input-DTmWYrzg.js";import{S as lt,a as dt,b as mt,c as ut,d as I}from"./select-D4-WItce.js";import{T as pt}from"./textarea-JbvjK4Se.js";import{g as ht,h as xt}from"./use-connection-zcRZ_mrS.js";import{u as gt}from"./constants-DZRJwikT.js";import{b as ft}from"./use-mcp-tools-CBaz6cWu.js";import{i as oe}from"./DotsVertical-CiHvrgFY.js";import{s as z}from"./Globe02-BJwDZf3m.js";import{i as jt}from"./Loading01-hzhOha89.js";import{i as yt}from"./Terminal-5tYfgjqm.js";import{s as re}from"./Trash01-CFVOYbE4.js";import{r as vt,E as _t,e as me}from"./env-vars-editor-DR9qXTlp.js";import{d as Ct}from"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowUp-DuCoD-_2.js";import"./Check-BecGNPr2.js";import"./Grid01-ClvGNPyN.js";import"./List-BTqXaORG.js";import"./view-mode-toggle-I9cNNgTM.js";import"./table-BQWoR2xQ.js";import"./SearchMd-BrXcSv99.js";import"./card-DLwzKTus.js";import"./useQuery-BdnAz8Zk.js";import"./use-mobile-DCUge7v5.js";import"./binder-B-gKzuCI.js";import"./ChevronRight-BXGDS3zi.js";import"./X-CNmc5JFs.js";import"./ChevronDown-C80wx8LH.js";import"./useMutation-Cc1z0I0J.js";import"./Plus-DgXpTyQu.js";function ie(s){const n=le.c(3),{status:i}=s;if(i==="active"){let c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(Be,{size:12}),"Active"]}),n[0]=c):c=n[0],c}if(i==="error"){let c;return n[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Me,{size:12}),"Error"]}),n[1]=c):c=n[1],c}let d;return n[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(F,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),n[2]=d):d=n[2],d}function ae(s){const n=Ct(new Date,s);return n<60?"<1m":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:n<2592e3?`${Math.floor(n/604800)}w ago`:n<31536e3?`${Math.floor(n/2592e3)}mo ago`:`${Math.floor(n/31536e3)}y ago`}const bt=de({key:y(),value:y()}),kt=de({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Te(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Pe(bt).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function M(s){const n=s.trim();if(!n)return"";try{const i=new URL(n),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return n.replace(/\/+$/,"")}}function Nt(s){const n=s.trim().split(/\s+/).filter(Boolean);if(n.length<2)return null;const i=n[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=n.slice(1).find(a=>!a.startsWith("-"));return c?{packageName:c}:null}function E(s){const{uiType:n}=s,i=M(s.connectionUrl??"");if((n==="HTTP"||n==="SSE"||n==="Websocket")&&i===M("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return n==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function ce(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const n=M(s.connectionUrl??"");if(!n)return null;const i=s.registryItems.find(a=>(a.server?.remotes??[]).some(k=>M(k.url??"")===n));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function wt(s,n){const i={command:"npx",args:["-y",s]},d=me(n);return Object.keys(d).length>0&&(i.envVars=d),i}function St(s,n,i,d){const c={command:s};n.trim()&&(c.args=n.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const a=me(d);return Object.keys(a).length>0&&(c.envVars=a),c}function Dt(s){return s.command==="npx"}function Pt(s){return s.args?.find(n=>!n.startsWith("-"))??""}function Tt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function It(s,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function $t(){const{org:s}=_e(),n=Ce(),i=be({strict:!1}),{data:d}=ke.useSession(),{stdioEnabled:c}=Ne(),a=Oe({namespace:s.slug,resource:"connections"}),$=ht(),k=xt(a),[v,N]=U.useReducer(It,{mode:"idle"}),R=ze(k)[0],X=R?.id??"",L=Ue(R?.tools),ue=gt({connectionId:X||null,orgId:s.id}),{data:pe}=ft({client:ue,toolName:L,toolArguments:{limit:200},enabled:!!(X&&L),staleTime:3600*1e3,select:t=>t.structuredContent??t}),W=Re(pe??[]),K=i.action==="create",he=()=>{n({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},G=()=>{n({to:"/$org/mcps",params:{org:s.slug},search:{}})},r=we({resolver:Se(kt),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),q=r.watch("connection_url"),xe=r.watch("npx_package"),D=E({uiType:u,connectionUrl:q??"",npxPackage:xe??""})??ce({uiType:u,connectionUrl:q??"",registryItems:W}),m=v.mode==="editing"?v.connection:null;U.useEffect(()=>{if(m){const t=De(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const o=vt(t.envVars);if(Dt(t)){const l=Pt(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const l=Tt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:l.command,stdio_args:l.args,stdio_cwd:l.cwd,env_vars:o})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const ge=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;N({type:"close"});try{await $.delete.mutateAsync(t)}catch{}},fe=async t=>{let o,l=null,w=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",l="",C=wt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",l="",C=St(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,l=t.connection_url||"",w=t.connection_token||null),m){await $.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:l,...w&&{connection_token:w},...C&&{connection_headers:C}}}),N({type:"close"}),r.reset();return}const S=Ie("conn");await $.create.mutateAsync({id:S,title:t.title,description:t.description||null,connection_type:o,connection_url:l,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),G(),r.reset(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:S}})},Y=t=>{t||(K?G():N({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const l=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,S=p=>{if(p&&(!l&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const Q=r.getValues("env_vars")??[],ve=new Set(Q.map(P=>P.key)),J=p.envVarKeys.filter(P=>!ve.has(P));J.length>0&&r.setValue("env_vars",[...Q,...J.map(P=>({key:P,value:""}))],{shouldDirty:!0})}},B=Nt(o);if(B&&c){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",B.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),S(E({uiType:"NPX",npxPackage:B.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),S(E({uiType:p,connectionUrl:o})??ce({uiType:p,connectionUrl:o,registryItems:W}));return}u==="NPX"&&S(E({uiType:"NPX",npxPackage:o}))},je=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Fe,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(H,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(ie,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(Z,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ae(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(A,{onClick:o=>{o.stopPropagation(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}})},children:[e.jsx(ee,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:o=>{o.stopPropagation(),N({type:"delete",connection:t})},children:[e.jsx(re,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],ye=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:he,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(T,{children:[e.jsx(nt,{open:K||v.mode==="editing",onOpenChange:Y,children:e.jsxs(st,{className:"sm:max-w-[525px]",children:[e.jsxs(ot,{children:[e.jsx(rt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(it,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ct,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(fe),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Type *"}),e.jsxs(lt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(f,{children:e.jsx(dt,{children:e.jsx(mt,{})})}),e.jsxs(ut,{children:[e.jsx(I,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(I,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(I,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(I,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(I,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(yt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(j,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"NPM Package *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("npx_package",l.trim(),{shouldDirty:!0}),V(l))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(j,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Command *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Arguments"}),e.jsx(f,{children:e.jsx(b,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(j,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Working Directory"}),e.jsx(f,{children:e.jsx(b,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(j,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Environment Variables"}),e.jsx(f,{children:e.jsx(_t,{value:t.value??[],onChange:t.onChange})}),e.jsx(j,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"URL *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("connection_url",l.trim(),{shouldDirty:!0}),V(l))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:D?.token?.label??"Token (optional)"}),e.jsx(f,{children:e.jsx(b,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(j,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Name *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"My Connection",...t})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Description"}),e.jsx(f,{children:e.jsx(pt,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(j,{})]})})]}),e.jsxs(at,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Xe,{open:v.mode==="deleting",onOpenChange:t=>!t&&N({type:"close"}),children:e.jsxs(Le,{children:[e.jsxs(We,{children:[e.jsx(Ke,{children:"Delete Connection?"}),e.jsxs(Ge,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(qe,{children:[e.jsx(Ye,{children:"Cancel"}),e.jsx(Qe,{onClick:ge,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(T.Header,{children:[e.jsx(T.Header.Left,{children:e.jsx(Je,{children:e.jsx(Ze,{children:e.jsx(et,{children:e.jsx(tt,{children:"Connections"})})})})}),e.jsxs(T.Header.Right,{children:[e.jsx($e,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),ye]})]}),e.jsx(Ae,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(T.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(t=>e.jsx(Ee,{connection:t,fallbackIcon:e.jsx(H,{}),onClick:()=>n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}}),headerActions:e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(A,{onClick:o=>{o.stopPropagation(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}})},children:[e.jsx(ee,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:o=>{o.stopPropagation(),N({type:"delete",connection:t})},children:[e.jsx(re,{size:16}),"Delete"]})]})]}),body:e.jsx(ie,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Z,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?ae(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Ve,{columns:je,data:k,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),children:"Browse Store"})})})})})})})]})}function Pn(){const s=le.c(1);let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(He,{children:e.jsx(U.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(jt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx($t,{})})}),s[0]=n):n=s[0],n}export{Pn as default};
|
|
1
|
+
import{c as le,j as e,r as U,u as _e,v as Ce,f as be,g as ke,ac as Ne,k as we,h as Se,i as De,o as de,ad as Pe,s as y,ae as Te}from"./index-CHQ9-Q-G.js";import{g as Ie}from"./generate-id-Dyweu44Y.js";import{C as $e,a as Ve}from"./collection-table-wrapper-CzqGMTIb.js";import{C as Ae}from"./collection-search-CECpIAiD.js";import{C as Ee}from"./connection-card-C7cdqtZc.js";import{B as F}from"./badge-DIFY1rsD.js";import{i as Me}from"./AlertCircle-CrLCfZT0.js";import{i as Be}from"./CheckCircle-BoFrCz54.js";import{n as H,E as O,I as Fe}from"./empty-state-VwVcPCE1.js";import{E as He}from"./error-boundary-C8CO11ML.js";import{P as T}from"./index-aWpPBjkT.js";import{u as Oe,U as Z,s as ee}from"./use-list-state-Dxbvm2sV.js";import{u as ze}from"./use-binding-HsWp1jWu.js";import{f as Ue,e as Re}from"./registry-utils-TFnNkGPj.js";import{f as Xe,a as Le,b as We,c as Ke,d as Ge,e as qe,A as Ye,g as Qe}from"./alert-dialog-DN6po1tq.js";import{B as Je,a as Ze,b as et,e as tt}from"./breadcrumb-CJBikxW8.js";import{B as _}from"./button-CKIyuXIq.js";import{D as nt,a as st,b as ot,c as rt,d as it,e as at}from"./dialog-CjI8rs-6.js";import{D as te,a as ne,b as se,c as A}from"./dropdown-menu-CoO02CsY.js";import{a as ct,F as h,b as x,c as g,d as f,f as j}from"./form-CO4xV9gA.js";import{I as b}from"./input-BrgRsDcE.js";import{S as lt,a as dt,b as mt,c as ut,d as I}from"./select-JdRjOrBE.js";import{T as pt}from"./textarea-BBk7k5wE.js";import{g as ht,h as xt}from"./use-connection-UwIAiUmR.js";import{u as gt}from"./constants-DwkB1age.js";import{b as ft}from"./use-mcp-tools-BKgKiBFS.js";import{i as oe}from"./DotsVertical-BYXFslta.js";import{s as z}from"./Globe02-BhcJ1ruM.js";import{i as jt}from"./Loading01-3CQcIIbt.js";import{i as yt}from"./Terminal-Djd_0g5K.js";import{s as re}from"./Trash01-Ck6jzVhZ.js";import{r as vt,E as _t,e as me}from"./env-vars-editor-BMhfk7Zf.js";import{d as Ct}from"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowUp-deTSI0E8.js";import"./Check-DTUUSvp-.js";import"./Grid01-B9LzvODL.js";import"./List-C1dM-VCr.js";import"./view-mode-toggle-BiRjYen1.js";import"./table-CBtv9zrT.js";import"./SearchMd-DTs0TtNF.js";import"./card-MU9VbmJ4.js";import"./useQuery-CImYAWdS.js";import"./use-mobile-CtC8_4UP.js";import"./binder-Dg2rfYkp.js";import"./ChevronRight-8Yl-zCCi.js";import"./X-BnxI_xD6.js";import"./ChevronDown-DeD12W57.js";import"./useMutation-C8K1KoTI.js";import"./Plus-CP35U6Iv.js";function ie(s){const n=le.c(3),{status:i}=s;if(i==="active"){let c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(Be,{size:12}),"Active"]}),n[0]=c):c=n[0],c}if(i==="error"){let c;return n[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Me,{size:12}),"Error"]}),n[1]=c):c=n[1],c}let d;return n[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(F,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),n[2]=d):d=n[2],d}function ae(s){const n=Ct(new Date,s);return n<60?"<1m":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:n<2592e3?`${Math.floor(n/604800)}w ago`:n<31536e3?`${Math.floor(n/2592e3)}mo ago`:`${Math.floor(n/31536e3)}y ago`}const bt=de({key:y(),value:y()}),kt=de({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Te(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Pe(bt).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function M(s){const n=s.trim();if(!n)return"";try{const i=new URL(n),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return n.replace(/\/+$/,"")}}function Nt(s){const n=s.trim().split(/\s+/).filter(Boolean);if(n.length<2)return null;const i=n[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=n.slice(1).find(a=>!a.startsWith("-"));return c?{packageName:c}:null}function E(s){const{uiType:n}=s,i=M(s.connectionUrl??"");if((n==="HTTP"||n==="SSE"||n==="Websocket")&&i===M("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return n==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function ce(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const n=M(s.connectionUrl??"");if(!n)return null;const i=s.registryItems.find(a=>(a.server?.remotes??[]).some(k=>M(k.url??"")===n));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function wt(s,n){const i={command:"npx",args:["-y",s]},d=me(n);return Object.keys(d).length>0&&(i.envVars=d),i}function St(s,n,i,d){const c={command:s};n.trim()&&(c.args=n.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const a=me(d);return Object.keys(a).length>0&&(c.envVars=a),c}function Dt(s){return s.command==="npx"}function Pt(s){return s.args?.find(n=>!n.startsWith("-"))??""}function Tt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function It(s,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function $t(){const{org:s}=_e(),n=Ce(),i=be({strict:!1}),{data:d}=ke.useSession(),{stdioEnabled:c}=Ne(),a=Oe({namespace:s.slug,resource:"connections"}),$=ht(),k=xt(a),[v,N]=U.useReducer(It,{mode:"idle"}),R=ze(k)[0],X=R?.id??"",L=Ue(R?.tools),ue=gt({connectionId:X||null,orgId:s.id}),{data:pe}=ft({client:ue,toolName:L,toolArguments:{limit:200},enabled:!!(X&&L),staleTime:3600*1e3,select:t=>t.structuredContent??t}),W=Re(pe??[]),K=i.action==="create",he=()=>{n({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},G=()=>{n({to:"/$org/mcps",params:{org:s.slug},search:{}})},r=we({resolver:Se(kt),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),q=r.watch("connection_url"),xe=r.watch("npx_package"),D=E({uiType:u,connectionUrl:q??"",npxPackage:xe??""})??ce({uiType:u,connectionUrl:q??"",registryItems:W}),m=v.mode==="editing"?v.connection:null;U.useEffect(()=>{if(m){const t=De(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const o=vt(t.envVars);if(Dt(t)){const l=Pt(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const l=Tt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:l.command,stdio_args:l.args,stdio_cwd:l.cwd,env_vars:o})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const ge=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;N({type:"close"});try{await $.delete.mutateAsync(t)}catch{}},fe=async t=>{let o,l=null,w=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",l="",C=wt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",l="",C=St(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,l=t.connection_url||"",w=t.connection_token||null),m){await $.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:l,...w&&{connection_token:w},...C&&{connection_headers:C}}}),N({type:"close"}),r.reset();return}const S=Ie("conn");await $.create.mutateAsync({id:S,title:t.title,description:t.description||null,connection_type:o,connection_url:l,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),G(),r.reset(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:S}})},Y=t=>{t||(K?G():N({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const l=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,S=p=>{if(p&&(!l&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const Q=r.getValues("env_vars")??[],ve=new Set(Q.map(P=>P.key)),J=p.envVarKeys.filter(P=>!ve.has(P));J.length>0&&r.setValue("env_vars",[...Q,...J.map(P=>({key:P,value:""}))],{shouldDirty:!0})}},B=Nt(o);if(B&&c){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",B.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),S(E({uiType:"NPX",npxPackage:B.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),S(E({uiType:p,connectionUrl:o})??ce({uiType:p,connectionUrl:o,registryItems:W}));return}u==="NPX"&&S(E({uiType:"NPX",npxPackage:o}))},je=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Fe,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(H,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(ie,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(Z,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ae(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(A,{onClick:o=>{o.stopPropagation(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}})},children:[e.jsx(ee,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:o=>{o.stopPropagation(),N({type:"delete",connection:t})},children:[e.jsx(re,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],ye=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:he,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(T,{children:[e.jsx(nt,{open:K||v.mode==="editing",onOpenChange:Y,children:e.jsxs(st,{className:"sm:max-w-[525px]",children:[e.jsxs(ot,{children:[e.jsx(rt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(it,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ct,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(fe),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Type *"}),e.jsxs(lt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(f,{children:e.jsx(dt,{children:e.jsx(mt,{})})}),e.jsxs(ut,{children:[e.jsx(I,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(I,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(I,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(I,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(I,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(yt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(j,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"NPM Package *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("npx_package",l.trim(),{shouldDirty:!0}),V(l))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(j,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Command *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Arguments"}),e.jsx(f,{children:e.jsx(b,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(j,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Working Directory"}),e.jsx(f,{children:e.jsx(b,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(j,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Environment Variables"}),e.jsx(f,{children:e.jsx(_t,{value:t.value??[],onChange:t.onChange})}),e.jsx(j,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"URL *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("connection_url",l.trim(),{shouldDirty:!0}),V(l))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:D?.token?.label??"Token (optional)"}),e.jsx(f,{children:e.jsx(b,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(j,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Name *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"My Connection",...t})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Description"}),e.jsx(f,{children:e.jsx(pt,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(j,{})]})})]}),e.jsxs(at,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Xe,{open:v.mode==="deleting",onOpenChange:t=>!t&&N({type:"close"}),children:e.jsxs(Le,{children:[e.jsxs(We,{children:[e.jsx(Ke,{children:"Delete Connection?"}),e.jsxs(Ge,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(qe,{children:[e.jsx(Ye,{children:"Cancel"}),e.jsx(Qe,{onClick:ge,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(T.Header,{children:[e.jsx(T.Header.Left,{children:e.jsx(Je,{children:e.jsx(Ze,{children:e.jsx(et,{children:e.jsx(tt,{children:"Connections"})})})})}),e.jsxs(T.Header.Right,{children:[e.jsx($e,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),ye]})]}),e.jsx(Ae,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(T.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(t=>e.jsx(Ee,{connection:t,fallbackIcon:e.jsx(H,{}),onClick:()=>n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}}),headerActions:e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(A,{onClick:o=>{o.stopPropagation(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}})},children:[e.jsx(ee,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:o=>{o.stopPropagation(),N({type:"delete",connection:t})},children:[e.jsx(re,{size:16}),"Delete"]})]})]}),body:e.jsx(ie,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Z,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?ae(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Ve,{columns:je,data:k,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),children:"Browse Store"})})})})})})})]})}function Pn(){const s=le.c(1);let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(He,{children:e.jsx(U.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(jt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx($t,{})})}),s[0]=n):n=s[0],n}export{Pn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as t,I as a}from"./index-CHQ9-Q-G.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b3 as h,c as d,E as f,b4 as _}from"./index-
|
|
1
|
+
import{b3 as h,c as d,E as f,b4 as _}from"./index-CHQ9-Q-G.js";const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class y extends h{constructor(e,n){super(e,n)}send(e,n){const o=b(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function b(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const C={name:"mesh-sdk",version:"1.0.0"};function T(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function g({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=new _(C,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new y(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function S(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u}function I(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function E(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function O(t){return{id:v(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function $(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,y as S,P as W,M as a,L as b,g as c,O as d,E as e,D as f,v as g,R as h,$ as i,I as j,S as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-
|
|
1
|
+
import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-CHQ9-Q-G.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-DN6po1tq.js";import{B}from"./button-CKIyuXIq.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-CO4xV9gA.js";import{I as P}from"./input-BrgRsDcE.js";import{S as Q}from"./spinner-CEhxpPPn.js";import{u as W}from"./useMutation-C8K1KoTI.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let h;e[26]!==d||e[27]!==g?(h=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==n||e[31]!==m||e[32]!==c?(S=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,h]}),e[29]=h,e[30]=n,e[31]=m,e[32]=c,e[33]=S):S=e[33];let p;e[34]!==t||e[35]!==S?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:S})]}),e[34]=t,e[35]=S,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,R as u,w as m,T as x,D as j,x as N,y as D,z as b,B as g}from"./index-
|
|
1
|
+
import{c as n,j as i,R as u,w as m,T as x,D as j,x as N,y as D,z as b,B as g}from"./index-CHQ9-Q-G.js";import{i as h}from"./X-BnxI_xD6.js";import{c}from"./button-CKIyuXIq.js";function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{w as D,R as a,B as b,O as c,P as d,E as e,k as f,T as g};
|