@decocms/mesh 2.44.2 → 2.44.3
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-C1oaexcn.js → AlertCircle-9_AbzfZV.js} +1 -1
- package/dist/client/assets/{ArrowLeft-B1SBiQVA.js → ArrowLeft-2xAygwK8.js} +1 -1
- package/dist/client/assets/{ArrowUp-BvlJhwmz.js → ArrowUp-PDh8aKqr.js} +1 -1
- package/dist/client/assets/{Check-DImC9hlR.js → Check-DCOgSIim.js} +1 -1
- package/dist/client/assets/{ChevronDown-CJiuDn-R.js → ChevronDown-B9uETHHQ.js} +1 -1
- package/dist/client/assets/{Code01-C3PLJdIe.js → Code01-Bpv3xznV.js} +1 -1
- package/dist/client/assets/{Copy01-CJVQGg2V.js → Copy01-C5lSJKpp.js} +1 -1
- package/dist/client/assets/{CpuChip02-CvTMaFgN.js → CpuChip02-B0kuxhX5.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-BQhkzfkG.js → DotsHorizontal-R5qKOO-N.js} +1 -1
- package/dist/client/assets/{DotsVertical-RAbtNrG6.js → DotsVertical-qocOLS4A.js} +1 -1
- package/dist/client/assets/{Download01-DJRyuQwN.js → Download01-B-rCvX3Z.js} +1 -1
- package/dist/client/assets/{Edit01-DsrgmMbR.js → Edit01-DHPNOaMT.js} +1 -1
- package/dist/client/assets/{File06-DdyNkMaH.js → File06-BM3tW-ao.js} +1 -1
- package/dist/client/assets/{FilterLines-DudXubI6.js → FilterLines-DSbTCxDv.js} +1 -1
- package/dist/client/assets/{FlipBackward-BT14MhEV.js → FlipBackward-BQuWvmOt.js} +1 -1
- package/dist/client/assets/{GitBranch01-DMdTTGPv.js → GitBranch01-DZYIjDzk.js} +1 -1
- package/dist/client/assets/{Grid01-F6FBpTXb.js → Grid01-CHS_jF02.js} +1 -1
- package/dist/client/assets/{Home02-CXLfj9Lm.js → Home02-BuP7hann.js} +1 -1
- package/dist/client/assets/{Image01-CGATMxv1.js → Image01-5bkPZ70X.js} +1 -1
- package/dist/client/assets/{Inbox01-BExxQniM.js → Inbox01-39gPJAMl.js} +1 -1
- package/dist/client/assets/{InfoCircle-BwBXEQXi.js → InfoCircle-Dt8NaYCm.js} +1 -1
- package/dist/client/assets/{Key01-BPqaf5vy.js → Key01-8WmQn7uV.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CxomLdJd.js → LinkExternal01-DQw1Qc9U.js} +1 -1
- package/dist/client/assets/{List-taDOKmLS.js → List-C7xsEmxx.js} +1 -1
- package/dist/client/assets/{Loading01-C5WNj1RN.js → Loading01-CopTTh4g.js} +1 -1
- package/dist/client/assets/{Lock01-Di-2F0aX.js → Lock01-BdnY_MsG.js} +1 -1
- package/dist/client/assets/{Play-CrFW3Xap.js → Play-yVQdEMOg.js} +1 -1
- package/dist/client/assets/{Plus-Rzuz08cb.js → Plus-erQKhzFc.js} +1 -1
- package/dist/client/assets/{SearchMd-CQBqMKg_.js → SearchMd-CHkFEvMn.js} +1 -1
- package/dist/client/assets/{Terminal-kk64xKO9.js → Terminal-nMH6minT.js} +1 -1
- package/dist/client/assets/{Trash01-NIFttcxe.js → Trash01-CSFSnmeR.js} +1 -1
- package/dist/client/assets/{Upload01-DN0UV10S.js → Upload01-CDd2Qhk0.js} +1 -1
- package/dist/client/assets/{X-DmFAeozb.js → X-C7jTJYwd.js} +1 -1
- package/dist/client/assets/{XClose-CbwF-zr_.js → XClose-CqnirkQ-.js} +1 -1
- package/dist/client/assets/{agent-detail-COGqHNUz.js → agent-detail-BXGFUOb3.js} +1 -1
- package/dist/client/assets/{agents-B3iPqEqm.js → agents-CJ-N0UGt.js} +1 -1
- package/dist/client/assets/{alert-dialog-nojSsjex.js → alert-dialog-JUSgghwR.js} +1 -1
- package/dist/client/assets/{auth-catchall-C_OoShX7.js → auth-catchall-DuMCH5D-.js} +1 -1
- package/dist/client/assets/{avatar-HSzeBtSD.js → avatar-BIPSK-nZ.js} +1 -1
- package/dist/client/assets/{badge-D7yW7Ams.js → badge-Blh93jrG.js} +1 -1
- package/dist/client/assets/{binder-BvGWgf0j.js → binder-ku-JM_HB.js} +1 -1
- package/dist/client/assets/{button-B9UDEwx9.js → button-BNEclrG2.js} +1 -1
- package/dist/client/assets/card-kDbUMtCL.js +1 -0
- package/dist/client/assets/{checkbox-DmHZ3Xhg.js → checkbox-DZe4E6Kn.js} +1 -1
- package/dist/client/assets/{collection-detail-Cmda52TC.js → collection-detail-MFOY08Kp.js} +2 -2
- package/dist/client/assets/{collection-display-button-BAinwubP.js → collection-display-button-Bv_XCGpu.js} +1 -1
- package/dist/client/assets/{collection-header-d_96L4kd.js → collection-header-BMM2Ppyf.js} +1 -1
- package/dist/client/assets/{collection-page-BuBCnaqK.js → collection-page-CHEPcLha.js} +1 -1
- package/dist/client/assets/{collection-search-Cp9Rg8cG.js → collection-search-ClAji_RX.js} +1 -1
- package/dist/client/assets/{collection-tab-DGpjXcu1.js → collection-tab-Eyar9Ax-.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cfb-5BQo.js → collection-table-wrapper-BdCz63Jd.js} +1 -1
- package/dist/client/assets/connect-_JtLK9IP.js +1 -0
- package/dist/client/assets/{connection-card-DSC3U6N-.js → connection-card-C5RmKpx-.js} +1 -1
- package/dist/client/assets/connection-detail-OBVHxVs9.js +1 -0
- package/dist/client/assets/{connections-3QeHd0Af.js → connections-BJK-Unmt.js} +1 -1
- package/dist/client/assets/constants-Cp5o6xb6.js +1 -0
- package/dist/client/assets/{constants-C8DVLjyM.js → constants-l6jfVkIP.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-JxPXU7zP.js → create-organization-dialog-DnFctc5e.js} +1 -1
- package/dist/client/assets/{dialog-DUXNadw5.js → dialog-cbRNFkUF.js} +1 -1
- package/dist/client/assets/{dropdown-menu-5V-XyUMl.js → dropdown-menu-B5X7QG53.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Ba9BM3q2.js → dynamic-plugin-layout-AVNjiCzl.js} +1 -1
- package/dist/client/assets/{empty-state-D6Pye5dp.js → empty-state-Bnk561r4.js} +1 -1
- package/dist/client/assets/{empty-state-Ba4zQn5e.js → empty-state-DHhGwZ9F.js} +1 -1
- package/dist/client/assets/{env-vars-editor-BKG_L2uV.js → env-vars-editor-C22VVc0j.js} +1 -1
- package/dist/client/assets/{error-boundary-BYKWfLka.js → error-boundary-CwJYCTYr.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CDfHtG_N.js → extract-connection-data-CuvIF5Zc.js} +1 -1
- package/dist/client/assets/{file-browser-D32InLNO.js → file-browser-Ds1nWCpa.js} +2 -2
- package/dist/client/assets/{form-DufpJhV9.js → form-0ZBALKH0.js} +1 -1
- package/dist/client/assets/{grid-view-CnSMlDZ4.js → grid-view-DIwzP_dG.js} +1 -1
- package/dist/client/assets/{home-MusYVBVC.js → home-BtTYUCCq.js} +1 -1
- package/dist/client/assets/{index-kxFCfKdx.js → index-BTX95t7l.js} +11 -11
- package/dist/client/assets/index-CXM9c79w.js +25 -0
- package/dist/client/assets/{index-fVdZwXbQ.js → index-DALSTBZ2.js} +1 -1
- package/dist/client/assets/{index-g9oC-3mV.js → index-DHqToqKZ.js} +1 -1
- package/dist/client/assets/{index-CVzDWVip.js → index-DwgBtTXr.js} +1 -1
- package/dist/client/assets/{index-CNdaxvBl.js → index-dMwHjnnN.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Q9Ch1SlH.js → infiniteQueryObserver-DgpNxMlA.js} +1 -1
- package/dist/client/assets/{input-CJuUYj5Y.js → input-Vw7XIX0r.js} +1 -1
- package/dist/client/assets/{layout-BdEZp7Lm.js → layout-DKHrwMN9.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DuVpM8xt.js → localstorage-keys-BpjSpnih.js} +1 -1
- package/dist/client/assets/{login-Baj4wuxy.js → login-SBFyv6s2.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BCtnFmpv.js → mcp-oauth-CrWnEeM3.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DaxbgdWa.js → mcp-server-card-CgncAkll.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-C4n2ElKE.js → mcp-server-detail-BJ7r3PGK.js} +2 -2
- package/dist/client/assets/{members-C-QMSOdo.js → members-BWzPhwIh.js} +1 -1
- package/dist/client/assets/{monaco-editor-1VMfvFaT.js → monaco-editor-DcKPEfxo.js} +3 -3
- package/dist/client/assets/{monitoring-CyqwraZN.js → monitoring-1I6U1Wzz.js} +1 -1
- package/dist/client/assets/{oauth-callback-UvAveY4Q.js → oauth-callback-BchO0M4E.js} +1 -1
- package/dist/client/assets/{page-IMRDmGp_.js → page-BPc0iUzq.js} +1 -1
- package/dist/client/assets/{page-o9rm9dBG.js → page-Zz3f3l9F.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-DKtGxFhi.js → pin-to-sidebar-button-CDjTUMWb.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DqfmD7Lv.js → plugin-empty-state-CwFHEPBt.js} +1 -1
- package/dist/client/assets/{plugin-header-BfXGZdm2.js → plugin-header-CMNaIaJK.js} +1 -1
- package/dist/client/assets/{plugins-B-FlFz3o.js → plugins-Cv7F5xoL.js} +1 -1
- package/dist/client/assets/{popover-IWCGO-jB.js → popover-pmxV9P13.js} +1 -1
- package/dist/client/assets/{registry-utils-9nMczNLD.js → registry-utils-Dda0cOYu.js} +1 -1
- package/dist/client/assets/{resizable-oTpquxsO.js → resizable-DGeBeBFx.js} +1 -1
- package/dist/client/assets/{resource-tabs-DNjaGx4N.js → resource-tabs-B4vVuVvd.js} +1 -1
- package/dist/client/assets/{select-6QIp3PPA.js → select-BJmQF-t1.js} +1 -1
- package/dist/client/assets/{settings-DmEN7q-R.js → settings-awh6NdSn.js} +1 -1
- package/dist/client/assets/{shell-layout-f9QetI-r.js → shell-layout-CZgMrEjK.js} +2 -2
- package/dist/client/assets/{spinner-CHfAw4LE.js → spinner-DXcv41zw.js} +1 -1
- package/dist/client/assets/{switch-B8GiDtx0.js → switch-l3-49lJA.js} +1 -1
- package/dist/client/assets/{textarea-CO4qLNDj.js → textarea-DoBy6xpq.js} +1 -1
- package/dist/client/assets/{tool-set-selector-uL1FTDsj.js → tool-set-selector-DbGPsYZu.js} +1 -1
- package/dist/client/assets/{tools-list-BE1mq5Cn.js → tools-list-8U1et6rm.js} +1 -1
- package/dist/client/assets/{tooltip-DPmy6Yc4.js → tooltip-Mf5UtuF2.js} +1 -1
- package/dist/client/assets/{typewriter-title-D2-DYqDP.js → typewriter-title-B2NtHvjD.js} +1 -1
- package/dist/client/assets/{use-binding-Bpukv3gt.js → use-binding-BM0mjywS.js} +1 -1
- package/dist/client/assets/{use-collections-DWOZCISS.js → use-collections-M-ZucrNc.js} +1 -1
- package/dist/client/assets/{use-connection-ASBc3U14.js → use-connection-B7MC5D37.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DlrAoyaQ.js → use-create-virtual-mcp-mR4PpEB5.js} +1 -1
- package/dist/client/assets/{use-list-state-ZDRP3zFW.js → use-list-state-5iRHLEuj.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DXLHacDq.js → use-mcp-prompts-Cwl3wuSJ.js} +1 -1
- package/dist/client/assets/{use-members-CTEqdwIL.js → use-members-DQCYK0dI.js} +1 -1
- package/dist/client/assets/{use-mobile-BuEGyUe0.js → use-mobile-C3BU8S8_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-hA9VwO-v.js → use-organization-settings-Djf-qkBb.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BR9Cj6JE.js → use-virtual-mcp-TJpzrF0-.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DMGU-oe6.js +1 -0
- package/dist/client/assets/{useMutation-ClL17OKX.js → useMutation-BuhKRt0C.js} +1 -1
- package/dist/client/assets/useQuery-CnjlQpZk.js +1 -0
- package/dist/client/assets/{value-CzHdinJY.js → value-DN_0rG_i.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B5HElat6.js → view-mode-toggle-C5CEe5h-.js} +1 -1
- package/dist/client/assets/{workflow-Lt3GFUiP.js → workflow-B7pAFqx9.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/card-D-ZcDLJM.js +0 -1
- package/dist/client/assets/circle-alert-CsGRs6FI.js +0 -1
- package/dist/client/assets/connect-ChWwgYE3.js +0 -1
- package/dist/client/assets/connection-detail-D9V3bixZ.js +0 -1
- package/dist/client/assets/constants-CuO4IXOK.js +0 -1
- package/dist/client/assets/index-BJd9JH52.js +0 -25
- package/dist/client/assets/useInfiniteQuery-CnqRaniP.js +0 -1
- package/dist/client/assets/useQuery-CVADJf0h.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as u,S as l,m as v}from"./index-
|
|
1
|
+
import{c as d,j as u,S as l,m as v}from"./index-BTX95t7l.js";import{c as g}from"./button-BNEclrG2.js";const f=v("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function x(o){const e=d.c(12);let r,s,a,t;e[0]!==o?({className:r,variant:t,asChild:a,...s}=o,e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=t):(r=e[1],s=e[2],a=e[3],t=e[4]);const c=(a===void 0?!1:a)?l:"span";let i;e[5]!==r||e[6]!==t?(i=g(f({variant:t}),r),e[5]=r,e[6]=t,e[7]=i):i=e[7];let n;return e[8]!==c||e[9]!==s||e[10]!==i?(n=u.jsx(c,{"data-slot":"badge",className:i,...s}),e[8]=c,e[9]=s,e[10]=i,e[11]=n):n=e[11],n}export{x as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-BTX95t7l.js";function a(o){return{isImplementedBy:c=>{for(const e of o){const r=typeof e.name=="string"?new RegExp(`^${e.name}$`):e.name,t=c.find(i=>r.test(i.name));if(!(!t&&e.opt)&&!t)return!1}return!0}}}function s(o,c){const e=o.tools;if(!e||e.length===0)return!1;const r=e.map(n=>({name:n.name,inputSchema:n.inputSchema})),t=c.map(n=>({name:n.name,inputSchema:n.inputSchema,opt:n.opt}));return a(t).isImplementedBy(r)}export{a,s as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aN as g,aO as u,c as l,j as v,S as b,m as p}from"./index-
|
|
1
|
+
import{aN as g,aO as u,c as l,j as v,S as b,m as p}from"./index-BTX95t7l.js";function x(...a){return g(u(a))}const f=p("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-7 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function k(a){const e=l.c(14);let t,r,s,o,i;e[0]!==a?({className:t,variant:i,size:s,asChild:o,...r}=a,e[0]=a,e[1]=t,e[2]=r,e[3]=s,e[4]=o,e[5]=i):(t=e[1],r=e[2],s=e[3],o=e[4],i=e[5]);const c=(o===void 0?!1:o)?b:"button";let n;e[6]!==t||e[7]!==s||e[8]!==i?(n=x(f({variant:i,size:s,className:t})),e[6]=t,e[7]=s,e[8]=i,e[9]=n):n=e[9];let d;return e[10]!==c||e[11]!==r||e[12]!==n?(d=v.jsx(c,{"data-slot":"button",className:n,...r}),e[10]=c,e[11]=r,e[12]=n,e[13]=d):d=e[13],d}export{k as B,f as b,x as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c,j as l}from"./index-BTX95t7l.js";import{c as d}from"./button-BNEclrG2.js";function f(a){const e=c.c(8);let r,o;e[0]!==a?({className:r,...o}=a,e[0]=a,e[1]=r,e[2]=o):(r=e[1],o=e[2]);let t;e[3]!==r?(t=d("bg-card text-card-foreground hover:bg-accent/50 flex flex-col gap-6 rounded-xl border border-border/75",r),e[3]=r,e[4]=t):t=e[4];let s;return e[5]!==o||e[6]!==t?(s=l.jsx("div",{"data-slot":"card",className:t,...o}),e[5]=o,e[6]=t,e[7]=s):s=e[7],s}export{f as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as c,a0 as n,a1 as l}from"./index-
|
|
1
|
+
import{c as d,j as c,a0 as n,a1 as l}from"./index-BTX95t7l.js";import{i as m}from"./Check-DCOgSIim.js";import{c as b}from"./button-BNEclrG2.js";function f(o){const e=d.c(9);let r,a;e[0]!==o?({className:r,...a}=o,e[0]=o,e[1]=r,e[2]=a):(r=e[1],a=e[2]);let i;e[3]!==r?(i=b("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",r),e[3]=r,e[4]=i):i=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(l,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==a||e[7]!==i?(s=c.jsx(n,{"data-slot":"checkbox",className:i,...a,children:t}),e[6]=a,e[7]=i,e[8]=s):s=e[8],s}export{f as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bI as Y,r as C,o as cs,s as Ze,c as N,j as o,bg as dt,u as Z,d as as,m as ds,a as se,g as us,a8 as Qt,bB as U,bJ as fs,ak as ms,ai as ut,aj as te,al as Yt,am as ps,ae as ft,af as xs,an as en,ah as tn,au as hs,av as gs,aq as nn,aw as bs,bK as mt,bL as js,ag as vs,bc as ys,b6 as ws,bM as Ss,bq as sn}from"./index-kxFCfKdx.js";import{E as on,I as ze,n as Ns}from"./empty-state-D6Pye5dp.js";import{E as rn}from"./error-boundary-BYKWfLka.js";import{a as pt,u as xt,f as ht,e as gt,d as bt}from"./use-collections-DWOZCISS.js";import{u as Q}from"./constants-C8DVLjyM.js";import{P as jt}from"./pin-to-sidebar-button-DKtGxFhi.js";import{B as q,c as O}from"./button-B9UDEwx9.js";import{F as Qe,a as ks,b as vt,d as yt}from"./form-DufpJhV9.js";import{I as wt}from"./input-CJuUYj5Y.js";import{T as rt}from"./textarea-CO4qLNDj.js";import{T as oe,a as re,b as ie,c as le}from"./tooltip-DPmy6Yc4.js";import{i as ln}from"./FlipBackward-BT14MhEV.js";import{a as cn,V as St,b as ve}from"./layout-BdEZp7Lm.js";import{S as an,a as dn,b as un,c as fn,d as it}from"./select-6QIp3PPA.js";import{i as Cs}from"./AlertCircle-C1oaexcn.js";import{s as Is,M as ye}from"./monaco-editor-1VMfvFaT.js";import{i as _s}from"./Code01-C3PLJdIe.js";import{a as Ts}from"./Copy01-CJVQGg2V.js";import{i as _e}from"./Loading01-C5WNj1RN.js";import{i as Nt,n as $s}from"./Play-CrFW3Xap.js";import{s as kt}from"./XClose-CbwF-zr_.js";import{u as Es,O as Os,M as Rs,F as Ms,v as As}from"./index-BJd9JH52.js";import{u as Ct,b as Ps}from"./use-connection-ASBc3U14.js";import{E as It}from"./empty-state-Ba4zQn5e.js";import{D as Ls,a as zs}from"./use-binding-Bpukv3gt.js";import{b as mn}from"./use-virtual-mcp-BR9Cj6JE.js";import{b as Ds,R as Ht,a as Ws}from"./resizable-oTpquxsO.js";import{S as De}from"./spinner-CHfAw4LE.js";import{V as Hs}from"./view-mode-toggle-B5HElat6.js";import{i as Vs}from"./GitBranch01-DMdTTGPv.js";import{N as Fs,c as Bs,d as Us,e as qs,m as Oe,P as Ks,f as Js,R as Gs,g as Xs,h as Zs,j as Vt,E as Qs,k as Ys,l as eo,n as to,T as no,o as pn}from"./index-g9oC-3mV.js";import{b as so,c as oo,d as ro,e as io,a as lo,D as co}from"./dialog-DUXNadw5.js";import"./index-CVzDWVip.js";import{s as xn}from"./Plus-Rzuz08cb.js";import{i as _t}from"./Check-DImC9hlR.js";import{i as ao}from"./DotsHorizontal-BQhkzfkG.js";import{D as uo,a as fo,b as mo,c as Ft}from"./dropdown-menu-5V-XyUMl.js";import{i as po}from"./Grid01-F6FBpTXb.js";import{B as je}from"./badge-D7yW7Ams.js";import{i as hn}from"./X-DmFAeozb.js";import"./useMutation-ClL17OKX.js";import"./useQuery-CVADJf0h.js";import"./use-organization-settings-hA9VwO-v.js";import"./ArrowLeft-B1SBiQVA.js";import"./ChevronDown-CJiuDn-R.js";import"./infiniteQueryObserver-Q9Ch1SlH.js";import"./mcp-oauth-BCtnFmpv.js";import"./env-vars-editor-BKG_L2uV.js";import"./Trash01-NIFttcxe.js";import"./File06-DdyNkMaH.js";import"./Key01-BPqaf5vy.js";import"./extract-connection-data-CDfHtG_N.js";import"./constants-CuO4IXOK.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-9nMczNLD.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-CvTMaFgN.js";import"./Terminal-kk64xKO9.js";import"./index-fVdZwXbQ.js";import"./circle-alert-CsGRs6FI.js";import"./binder-BvGWgf0j.js";import"./localstorage-keys-DuVpM8xt.js";import"./popover-IWCGO-jB.js";import"./Image01-CGATMxv1.js";import"./SearchMd-CQBqMKg_.js";import"./use-mcp-prompts-DXLHacDq.js";import"./ArrowUp-BvlJhwmz.js";import"./Edit01-DsrgmMbR.js";import"./use-create-virtual-mcp-DlrAoyaQ.js";const gn=Y("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const bn=Y("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const Tt=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const $t=Y("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const xo=Y("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const ho=Y("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const jn=Y("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const vn=Y("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const yn=Y("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const wn=Y("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Sn=Y("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),Et=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));Et.displayName="AlertOctagon";const Nn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));Nn.displayName="Box";const kn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));kn.displayName="ClockFastForward";const Cn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Cn.displayName="Code02";const Re=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Re.displayName="Columns01";const In=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));In.displayName="CornerDownRight";const _n=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));_n.displayName="Database01";const Tn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Tn.displayName="Repeat03";const Ot=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Ot.displayName="Save02";const $n=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));$n.displayName="Tool01";cs({title:Ze().min(1),description:Ze().nullable(),body:Ze()});function Ye(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function go(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function bo(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(Qe,{control:n.control,name:"title",render:yo}),o.jsx(Qe,{control:n.control,name:"description",render:vo})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(Qe,{control:n.control,name:"body",render:jo})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(ks,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function jo(t){const{field:e}=t;return o.jsx(vt,{children:o.jsx(yt,{children:o.jsx(rt,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function vo(t){const{field:e}=t;return o.jsxs(vt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(yt,{children:o.jsx(wt,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function yo(t){const{field:e}=t;return o.jsxs(vt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(yt,{children:o.jsx(wt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function wo(t){const e=N.c(52),{providerId:n,promptId:s,onBack:i}=t,l=dt().location.href,{org:c}=Z(),a=n||null;let d;e[0]!==c.id||e[1]!==a?(d={connectionId:a,orgId:c.id},e[0]=c.id,e[1]=a,e[2]=d):d=e[2];const u=Q(d),f=pt(n,"PROMPT",s,u),m=xt(n,"PROMPT",u),x=m.update.isPending;let p;e[3]!==f?(p=f?{title:f.title,description:f.description??null,body:Ye(f)}:void 0,e[3]=f,e[4]=p):p=e[4];let g;e[5]!==p?(g={values:p},e[5]=p,e[6]=g):g=e[6];const h=as(g);let b;e[7]!==h||e[8]!==f?(b=()=>{f&&h.reset({title:f.title,description:f.description??null,body:Ye(f)})},e[7]=h,e[8]=f,e[9]=b):b=e[9];const j=b;let w;e[10]!==m.update||e[11]!==h||e[12]!==s?(w=h.handleSubmit(async B=>{const V=await m.update.mutateAsync({id:s,data:{title:B.title,description:B.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:B.body}}]}});h.reset({title:V.title,description:V.description??null,body:Ye(V)})}),e[10]=m.update,e[11]=h,e[12]=s,e[13]=w):w=e[13];const S=w;if(!f){let B;return e[14]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(on,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=B):B=e[14],B}let v;e[15]!==f.title?(v=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:f.title}),e[15]=f.title,e[16]=v):v=e[16];let y;e[17]!==f.description?(y=f.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:f.description})]}):null,e[17]=f.description,e[18]=y):y=e[18];let k;e[19]!==v||e[20]!==y?(k=o.jsx(cn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,y]})}),e[19]=v,e[20]=y,e[21]=k):k=e[21];let _;e[22]!==f.title||e[23]!==l?(_=o.jsx(jt,{title:f.title,url:l,icon:"description"}),e[22]=f.title,e[23]=l,e[24]=_):_=e[24];const $=!h.formState.isDirty||x;let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(ln,{size:14}),e[25]=L):L=e[25];let R;e[26]!==j||e[27]!==$?(R=o.jsx(oe,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:$,onClick:j,"aria-label":"Cancel",children:L})})}),e[26]=j,e[27]=$,e[28]=R):R=e[28];let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(re,{side:"bottom",children:"Cancel"}),e[29]=A):A=e[29];let M;e[30]!==R?(M=o.jsx(ie,{children:o.jsxs(le,{delayDuration:0,children:[R,A]})}),e[30]=R,e[31]=M):M=e[31];const H=!h.formState.isDirty||x;let P;e[32]!==S?(P=()=>{S()},e[32]=S,e[33]=P):P=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(Ot,{size:14}),e[34]=D):D=e[34];let I;e[35]!==H||e[36]!==P?(I=o.jsx(oe,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:H,onClick:P,"aria-label":"Save",children:D})})}),e[35]=H,e[36]=P,e[37]=I):I=e[37];let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(re,{side:"bottom",children:"Save"}),e[38]=T):T=e[38];let E;e[39]!==I?(E=o.jsx(ie,{children:o.jsxs(le,{delayDuration:0,children:[I,T]})}),e[39]=I,e[40]=E):E=e[40];let W;e[41]!==_||e[42]!==M||e[43]!==E?(W=o.jsxs(St,{children:[_,M,E]}),e[41]=_,e[42]=M,e[43]=E,e[44]=W):W=e[44];let K;e[45]!==h?(K=o.jsx("div",{className:"h-full",children:o.jsx(bo,{form:h})}),e[45]=h,e[46]=K):K=e[46];let F;return e[47]!==i||e[48]!==W||e[49]!==K||e[50]!==k?(F=o.jsxs(ve,{onBack:i,children:[k,W,K]}),e[47]=i,e[48]=W,e[49]=K,e[50]=k,e[51]=F):F=e[51],F}function So(t){const e=N.c(5),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=go(),e[0]=i):i=e[0];const r=i;if(!r){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(on,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let l;return e[2]!==n||e[3]!==s?(l=o.jsx(rn,{children:o.jsx(C.Suspense,{fallback:null,children:o.jsx(wo,{providerId:r,promptId:n,onBack:s})})}),e[2]=n,e[3]=s,e[4]=l):l=e[4],l}const No=ds("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function ko(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=O(No({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Co(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Io(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const _o=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function To(t){const e=N.c(10),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=Es(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(Os,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(Rs,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==i||e[7]!==c||e[8]!==n?(a=o.jsx($o,{toolName:n,connectionId:s,onBack:i},c),e[5]=s,e[6]=i,e[7]=c,e[8]=n,e[9]=a):a=e[9],a}function $o({toolName:t,connectionId:e,onBack:n}){const i=dt().location.href,{replayId:r}=us({strict:!1}),l=(()=>{if(!r)return null;const I=`replay-${r}`,T=sessionStorage.getItem(I);if(!T)return null;sessionStorage.removeItem(I);try{return JSON.parse(T)}catch{return null}})(),c=(()=>{if(!l)return null;const I={};for(const[T,E]of Object.entries(l))E!==null&&typeof E=="object"?I[T]=JSON.stringify(E,null,2):I[T]=E;return I})(),[a,d]=C.useState(c??{}),[u,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[m,x]=C.useState(null),[p,g]=C.useState(null),[h,b]=C.useState(!1),[j,w]=C.useState(null),{org:S}=Z(),v=Ct(e),y=Q({connectionId:e,orgId:S.id}),k=ht({client:y}),_=k.data?.tools?.find(I=>I.name===t),$=_?.inputSchema?.properties,L=$?Object.keys($):[],R=L.length>0,A={};if(R&&_?.inputSchema?.properties)for(const I of L)A[I]=_.inputSchema.required?.includes(I)?"":void 0;const M=I=>Object.prototype.hasOwnProperty.call(a,I),H=async()=>{b(!0),g(null),x(null),w(null);const I=performance.now();try{if(!y)throw new Error("MCP client is not available");const T=R?{...A,...a}:(()=>{const z=u.trim();if(!z)return{};const G=JSON.parse(z);if(G&&typeof G=="object")return G;throw new Error("Raw JSON input must be an object.")})();R&&_?.inputSchema?.properties&&Object.entries(_.inputSchema.properties).forEach(([z,G])=>{if((G.type==="object"||G.type==="array")&&typeof T[z]=="string")try{T[z]=JSON.parse(T[z])}catch{}});const E=await y.callTool({name:t,arguments:T}),W=E.structuredContent??E,K=performance.now(),F=Math.round(K-I);x(W);const B=JSON.stringify(W),V=new TextEncoder().encode(B).length;w({duration:`${F}ms`,bytes:`${V} bytes`,tokens:`~${Math.ceil(V/4)} tokens`,cost:"$0.0000"})}catch(T){const E=T instanceof Error?T.message:String(T);g(E||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-I)}ms`})}finally{b(!1)}},P=(I,T)=>{d(E=>({...E,[I]:T}))},D=()=>{x(null),g(null),w(null)};return o.jsxs(ve,{onBack:n,children:[o.jsx(St,{children:o.jsx(jt,{title:_?.name??_o(t),url:i,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ze,{icon:v?.icon||null,name:v?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[k.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):k.isLoading?o.jsx(_e,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:k.isSuccess?"ready":k.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:_?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),_?.inputSchema?.required&&_.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:R&&_?.inputSchema?.properties?Object.entries(_.inputSchema.properties).map(([I,T])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,_.inputSchema?.required?.includes(I)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:T.type})]}),T.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:T.description}),T.type==="object"||T.type==="array"?o.jsx(rt,{className:"font-mono text-xs",value:M(I)?a[I]??"":A[I]??"",onChange:E=>P(I,E.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):T.type==="boolean"?o.jsxs(an,{value:M(I)?String(a[I]??""):"",onValueChange:E=>P(I,E==="true"),children:[o.jsx(dn,{children:o.jsx(un,{placeholder:"Select true or false..."})}),o.jsxs(fn,{children:[o.jsx(it,{value:"true",children:"true"}),o.jsx(it,{value:"false",children:"false"})]})]}):o.jsx(wt,{value:M(I)?a[I]??"":A[I]??"",onChange:E=>P(I,E.target.value),placeholder:`Enter ${I}...`})]},I)):_?.inputSchema&&!R?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(rt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:I=>f(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Is,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Nn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(_n,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),o.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:o.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[o.jsx(q,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:H,disabled:h,children:h?o.jsxs(o.Fragment,{children:[o.jsx(_e,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(ie,{children:o.jsxs(le,{children:[o.jsx(oe,{asChild:!0,children:o.jsx(q,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:D,disabled:!m&&!p,children:o.jsx(kt,{size:14})})}),o.jsx(re,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),p&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(ko,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Cs,{className:"h-4 w-4"}),o.jsx(Co,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Io,{className:"text-xs text-destructive",children:p})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:m?o.jsxs(o.Fragment,{children:[o.jsx(ye,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(q,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Qt.success("Copied to clipboard")},children:o.jsx(Ts,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(_s,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Eo(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=se(i).connectionId;if(!Ct(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(C.Suspense,{fallback:a,children:o.jsx(To,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const Bt=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Rt=(t=>t?Bt(t):Bt),Oo=t=>t;function lt(t,e=Oo){const n=U.useSyncExternalStore(t.subscribe,U.useCallback(()=>e(t.getState()),[t,e]),U.useCallback(()=>e(t.getInitialState()),[t,e]));return U.useDebugValue(n),n}const Ro=t=>{const e=Rt(t),n=s=>lt(e,s);return Object.assign(n,e),n},Mo=(t=>Ro);function En(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return ct(s)(n)}}}},Ao=(t,e)=>(n,s,i)=>{let r={storage:En(()=>localStorage),partialize:h=>h,version:0,merge:(h,b)=>({...b,...h}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...h)},s,i);const f=()=>{const h=r.partialize({...s()});return u.setItem(r.name,{state:h,version:r.version})},m=i.setState;i.setState=(h,b)=>(m(h,b),f());const x=t((...h)=>(n(...h),f()),s,i);i.getInitialState=()=>x;let p;const g=()=>{var h,b;if(!u)return;const j=++c;l=!1,a.forEach(S=>{var v;return S((v=s())!=null?v:x)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(h=s())!=null?h:x))||void 0;return ct(u.getItem.bind(u))(r.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==r.version){if(r.migrate){const v=r.migrate(S.state,S.version);return v instanceof Promise?v.then(y=>[!0,y]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var v;if(j!==c)return;const[y,k]=S;if(p=r.merge(k,(v=s())!=null?v:x),n(p,!0),y)return f()}).then(()=>{j===c&&(w?.(p,void 0),p=s(),l=!0,d.forEach(S=>S(p)))}).catch(S=>{j===c&&w?.(void 0,S)})};return i.persist={setOptions:h=>{r={...r,...h},h.storage&&(u=h.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>g(),hasHydrated:()=>l,onHydrate:h=>(a.add(h),()=>{a.delete(h)}),onFinishHydration:h=>(d.add(h),()=>{d.delete(h)})},r.skipHydration||g(),p||x},On=Ao,{useSyncExternalStoreWithSelector:Po}=fs,Lo=t=>t;function zo(t,e=Lo,n){const s=Po(t.subscribe,t.getState,t.getInitialState,e,n);return U.useDebugValue(s),s}const Ut=t=>Symbol.iterator in t,qt=t=>"entries"in t,Kt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Do=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Wo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Ut(t)&&Ut(e)?qt(t)&&qt(e)?Kt(t,e):Do(t,e):Kt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ho(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{bG as Y,r as C,o as cs,s as Ze,c as N,j as o,bg as dt,u as Z,d as as,m as ds,a as se,g as us,a8 as Qt,bz as U,bH as fs,ak as ms,ai as ut,aj as te,al as Yt,am as ps,ae as ft,af as xs,an as en,ah as tn,au as hs,av as gs,aq as nn,aw as bs,bI as mt,bJ as js,ag as vs,bc as ys,b6 as ws,bK as Ss,bq as sn}from"./index-BTX95t7l.js";import{E as on,I as ze,n as Ns}from"./empty-state-Bnk561r4.js";import{E as rn}from"./error-boundary-CwJYCTYr.js";import{a as pt,u as xt,f as ht,e as gt,d as bt}from"./use-collections-M-ZucrNc.js";import{u as Q}from"./constants-l6jfVkIP.js";import{P as jt}from"./pin-to-sidebar-button-CDjTUMWb.js";import{B as q,c as O}from"./button-BNEclrG2.js";import{F as Qe,a as ks,b as vt,d as yt}from"./form-0ZBALKH0.js";import{I as wt}from"./input-Vw7XIX0r.js";import{T as rt}from"./textarea-DoBy6xpq.js";import{T as oe,a as re,b as ie,c as le}from"./tooltip-Mf5UtuF2.js";import{i as ln}from"./FlipBackward-BQuWvmOt.js";import{a as cn,V as St,b as ve}from"./layout-DKHrwMN9.js";import{S as an,a as dn,b as un,c as fn,d as it}from"./select-BJmQF-t1.js";import{i as Cs}from"./AlertCircle-9_AbzfZV.js";import{s as Is,M as ye}from"./monaco-editor-DcKPEfxo.js";import{i as _s}from"./Code01-Bpv3xznV.js";import{a as Ts}from"./Copy01-C5lSJKpp.js";import{i as _e}from"./Loading01-CopTTh4g.js";import{i as Nt,n as $s}from"./Play-yVQdEMOg.js";import{s as kt}from"./XClose-CqnirkQ-.js";import{u as Es,O as Os,M as Rs,F as Ms,v as As}from"./index-CXM9c79w.js";import{u as Ct,b as Ps}from"./use-connection-B7MC5D37.js";import{E as It}from"./empty-state-DHhGwZ9F.js";import{D as Ls,a as zs}from"./use-binding-BM0mjywS.js";import{b as mn}from"./use-virtual-mcp-TJpzrF0-.js";import{b as Ds,R as Ht,a as Ws}from"./resizable-DGeBeBFx.js";import{S as De}from"./spinner-DXcv41zw.js";import{V as Hs}from"./view-mode-toggle-C5CEe5h-.js";import{i as Vs}from"./GitBranch01-DZYIjDzk.js";import{N as Fs,c as Bs,d as Us,e as qs,m as Oe,P as Ks,f as Js,R as Gs,g as Xs,h as Zs,j as Vt,E as Qs,k as Ys,l as eo,n as to,T as no,o as pn}from"./index-DHqToqKZ.js";import{b as so,c as oo,d as ro,e as io,a as lo,D as co}from"./dialog-cbRNFkUF.js";import"./index-DwgBtTXr.js";import{s as xn}from"./Plus-erQKhzFc.js";import{i as _t}from"./Check-DCOgSIim.js";import{i as ao}from"./DotsHorizontal-R5qKOO-N.js";import{D as uo,a as fo,b as mo,c as Ft}from"./dropdown-menu-B5X7QG53.js";import{i as po}from"./Grid01-CHS_jF02.js";import{B as je}from"./badge-Blh93jrG.js";import{i as hn}from"./X-C7jTJYwd.js";import"./useMutation-BuhKRt0C.js";import"./useQuery-CnjlQpZk.js";import"./use-organization-settings-Djf-qkBb.js";import"./ArrowLeft-2xAygwK8.js";import"./ChevronDown-B9uETHHQ.js";import"./infiniteQueryObserver-DgpNxMlA.js";import"./mcp-oauth-CrWnEeM3.js";import"./env-vars-editor-C22VVc0j.js";import"./Trash01-CSFSnmeR.js";import"./File06-BM3tW-ao.js";import"./Key01-8WmQn7uV.js";import"./extract-connection-data-CuvIF5Zc.js";import"./constants-Cp5o6xb6.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Dda0cOYu.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-B0kuxhX5.js";import"./Terminal-nMH6minT.js";import"./index-DALSTBZ2.js";import"./binder-ku-JM_HB.js";import"./localstorage-keys-BpjSpnih.js";import"./popover-pmxV9P13.js";import"./Image01-5bkPZ70X.js";import"./SearchMd-CHkFEvMn.js";import"./use-mcp-prompts-Cwl3wuSJ.js";import"./ArrowUp-PDh8aKqr.js";import"./Edit01-DHPNOaMT.js";import"./use-create-virtual-mcp-mR4PpEB5.js";const gn=Y("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const bn=Y("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const Tt=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const $t=Y("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const xo=Y("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const ho=Y("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const jn=Y("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const vn=Y("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const yn=Y("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const wn=Y("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Sn=Y("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),Et=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M12 8v4m0 4h.01M2 8.523v6.954c0 .245 0 .367.028.482a1 1 0 0 0 .12.29c.061.1.148.187.32.36l4.923 4.922c.173.173.26.26.36.322.09.054.188.095.29.12.115.027.237.027.482.027h6.954c.245 0 .367 0 .482-.028a.998.998 0 0 0 .29-.12c.1-.061.187-.148.36-.32l4.922-4.923c.173-.173.26-.26.322-.36a.998.998 0 0 0 .12-.29c.027-.115.027-.237.027-.482V8.523c0-.245 0-.367-.028-.482a.998.998 0 0 0-.12-.29c-.061-.1-.148-.187-.32-.36L16.608 2.47c-.173-.173-.26-.26-.36-.322a1 1 0 0 0-.29-.12C15.844 2 15.722 2 15.477 2H8.523c-.245 0-.367 0-.482.028a1 1 0 0 0-.29.12c-.1.061-.187.148-.36.32L2.47 7.392c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C2 8.156 2 8.278 2 8.523Z"}));Et.displayName="AlertOctagon";const Nn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));Nn.displayName="Box";const kn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m22.7 11.5-2 2-2-2m2.245 1.5A9 9 0 1 0 19 17.657M12 7v5l3 2"}));kn.displayName="ClockFastForward";const Cn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"}));Cn.displayName="Code02";const Re=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M6.8 3h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C10 19.48 10 18.92 10 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C8.48 3 7.92 3 6.8 3Zm11 0h-.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C14 4.52 14 5.08 14 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C15.52 21 16.08 21 17.2 21h.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3Z"}));Re.displayName="Columns01";const In=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M4 4v1.4c0 3.36 0 5.04.654 6.324a6 6 0 0 0 2.622 2.622C8.56 15 10.24 15 13.6 15H20m0 0-5-5m5 5-5 5"}));In.displayName="CornerDownRight";const _n=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));_n.displayName="Database01";const Tn=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"m13 22-3-3m0 0 3-3m-3 3h5a7 7 0 0 0 3-13.326M6 18.326A7 7 0 0 1 9 5h5m0 0-3-3m3 3-3 3"}));Tn.displayName="Repeat03";const Ot=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15 8H8.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C7 7.24 7 6.96 7 6.4V3m10 18v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Ot.displayName="Save02";const $n=({size:t=24,color:e="currentColor",...n})=>C.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},C.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));$n.displayName="Tool01";cs({title:Ze().min(1),description:Ze().nullable(),body:Ze()});function Ye(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function go(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function bo(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(Qe,{control:n.control,name:"title",render:yo}),o.jsx(Qe,{control:n.control,name:"description",render:vo})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(Qe,{control:n.control,name:"body",render:jo})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(ks,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function jo(t){const{field:e}=t;return o.jsx(vt,{children:o.jsx(yt,{children:o.jsx(rt,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function vo(t){const{field:e}=t;return o.jsxs(vt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(yt,{children:o.jsx(wt,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function yo(t){const{field:e}=t;return o.jsxs(vt,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(yt,{children:o.jsx(wt,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function wo(t){const e=N.c(52),{providerId:n,promptId:s,onBack:i}=t,l=dt().location.href,{org:c}=Z(),a=n||null;let d;e[0]!==c.id||e[1]!==a?(d={connectionId:a,orgId:c.id},e[0]=c.id,e[1]=a,e[2]=d):d=e[2];const u=Q(d),f=pt(n,"PROMPT",s,u),m=xt(n,"PROMPT",u),x=m.update.isPending;let p;e[3]!==f?(p=f?{title:f.title,description:f.description??null,body:Ye(f)}:void 0,e[3]=f,e[4]=p):p=e[4];let g;e[5]!==p?(g={values:p},e[5]=p,e[6]=g):g=e[6];const h=as(g);let b;e[7]!==h||e[8]!==f?(b=()=>{f&&h.reset({title:f.title,description:f.description??null,body:Ye(f)})},e[7]=h,e[8]=f,e[9]=b):b=e[9];const j=b;let w;e[10]!==m.update||e[11]!==h||e[12]!==s?(w=h.handleSubmit(async B=>{const V=await m.update.mutateAsync({id:s,data:{title:B.title,description:B.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:B.body}}]}});h.reset({title:V.title,description:V.description??null,body:Ye(V)})}),e[10]=m.update,e[11]=h,e[12]=s,e[13]=w):w=e[13];const S=w;if(!f){let B;return e[14]===Symbol.for("react.memo_cache_sentinel")?(B=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(on,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=B):B=e[14],B}let v;e[15]!==f.title?(v=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:f.title}),e[15]=f.title,e[16]=v):v=e[16];let y;e[17]!==f.description?(y=f.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:f.description})]}):null,e[17]=f.description,e[18]=y):y=e[18];let k;e[19]!==v||e[20]!==y?(k=o.jsx(cn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v,y]})}),e[19]=v,e[20]=y,e[21]=k):k=e[21];let _;e[22]!==f.title||e[23]!==l?(_=o.jsx(jt,{title:f.title,url:l,icon:"description"}),e[22]=f.title,e[23]=l,e[24]=_):_=e[24];const $=!h.formState.isDirty||x;let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(ln,{size:14}),e[25]=L):L=e[25];let R;e[26]!==j||e[27]!==$?(R=o.jsx(oe,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:$,onClick:j,"aria-label":"Cancel",children:L})})}),e[26]=j,e[27]=$,e[28]=R):R=e[28];let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=o.jsx(re,{side:"bottom",children:"Cancel"}),e[29]=A):A=e[29];let M;e[30]!==R?(M=o.jsx(ie,{children:o.jsxs(le,{delayDuration:0,children:[R,A]})}),e[30]=R,e[31]=M):M=e[31];const H=!h.formState.isDirty||x;let P;e[32]!==S?(P=()=>{S()},e[32]=S,e[33]=P):P=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(Ot,{size:14}),e[34]=D):D=e[34];let I;e[35]!==H||e[36]!==P?(I=o.jsx(oe,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:H,onClick:P,"aria-label":"Save",children:D})})}),e[35]=H,e[36]=P,e[37]=I):I=e[37];let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(re,{side:"bottom",children:"Save"}),e[38]=T):T=e[38];let E;e[39]!==I?(E=o.jsx(ie,{children:o.jsxs(le,{delayDuration:0,children:[I,T]})}),e[39]=I,e[40]=E):E=e[40];let W;e[41]!==_||e[42]!==M||e[43]!==E?(W=o.jsxs(St,{children:[_,M,E]}),e[41]=_,e[42]=M,e[43]=E,e[44]=W):W=e[44];let K;e[45]!==h?(K=o.jsx("div",{className:"h-full",children:o.jsx(bo,{form:h})}),e[45]=h,e[46]=K):K=e[46];let F;return e[47]!==i||e[48]!==W||e[49]!==K||e[50]!==k?(F=o.jsxs(ve,{onBack:i,children:[k,W,K]}),e[47]=i,e[48]=W,e[49]=K,e[50]=k,e[51]=F):F=e[51],F}function So(t){const e=N.c(5),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=go(),e[0]=i):i=e[0];const r=i;if(!r){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(on,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let l;return e[2]!==n||e[3]!==s?(l=o.jsx(rn,{children:o.jsx(C.Suspense,{fallback:null,children:o.jsx(wo,{providerId:r,promptId:n,onBack:s})})}),e[2]=n,e[3]=s,e[4]=l):l=e[4],l}const No=ds("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function ko(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=O(No({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Co(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Io(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=O("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const _o=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function To(t){const e=N.c(10),{toolName:n,connectionId:s,onBack:i}=t;let r;e[0]!==s?(r={connectionId:s},e[0]=s,e[1]=r):r=e[1];const l=Es(r);if(!l.isAuthenticated){let d;return e[2]!==l.supportsOAuth||e[3]!==i?(d=o.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?o.jsx(Os,{onAuthenticate:()=>i(),buttonText:"Go back to authenticate"}):o.jsx(Rs,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=i,e[4]=d):d=e[4],d}const c=`${s}:${n}`;let a;return e[5]!==s||e[6]!==i||e[7]!==c||e[8]!==n?(a=o.jsx($o,{toolName:n,connectionId:s,onBack:i},c),e[5]=s,e[6]=i,e[7]=c,e[8]=n,e[9]=a):a=e[9],a}function $o({toolName:t,connectionId:e,onBack:n}){const i=dt().location.href,{replayId:r}=us({strict:!1}),l=(()=>{if(!r)return null;const I=`replay-${r}`,T=sessionStorage.getItem(I);if(!T)return null;sessionStorage.removeItem(I);try{return JSON.parse(T)}catch{return null}})(),c=(()=>{if(!l)return null;const I={};for(const[T,E]of Object.entries(l))E!==null&&typeof E=="object"?I[T]=JSON.stringify(E,null,2):I[T]=E;return I})(),[a,d]=C.useState(c??{}),[u,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[m,x]=C.useState(null),[p,g]=C.useState(null),[h,b]=C.useState(!1),[j,w]=C.useState(null),{org:S}=Z(),v=Ct(e),y=Q({connectionId:e,orgId:S.id}),k=ht({client:y}),_=k.data?.tools?.find(I=>I.name===t),$=_?.inputSchema?.properties,L=$?Object.keys($):[],R=L.length>0,A={};if(R&&_?.inputSchema?.properties)for(const I of L)A[I]=_.inputSchema.required?.includes(I)?"":void 0;const M=I=>Object.prototype.hasOwnProperty.call(a,I),H=async()=>{b(!0),g(null),x(null),w(null);const I=performance.now();try{if(!y)throw new Error("MCP client is not available");const T=R?{...A,...a}:(()=>{const z=u.trim();if(!z)return{};const G=JSON.parse(z);if(G&&typeof G=="object")return G;throw new Error("Raw JSON input must be an object.")})();R&&_?.inputSchema?.properties&&Object.entries(_.inputSchema.properties).forEach(([z,G])=>{if((G.type==="object"||G.type==="array")&&typeof T[z]=="string")try{T[z]=JSON.parse(T[z])}catch{}});const E=await y.callTool({name:t,arguments:T}),W=E.structuredContent??E,K=performance.now(),F=Math.round(K-I);x(W);const B=JSON.stringify(W),V=new TextEncoder().encode(B).length;w({duration:`${F}ms`,bytes:`${V} bytes`,tokens:`~${Math.ceil(V/4)} tokens`,cost:"$0.0000"})}catch(T){const E=T instanceof Error?T.message:String(T);g(E||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-I)}ms`})}finally{b(!1)}},P=(I,T)=>{d(E=>({...E,[I]:T}))},D=()=>{x(null),g(null),w(null)};return o.jsxs(ve,{onBack:n,children:[o.jsx(St,{children:o.jsx(jt,{title:_?.name??_o(t),url:i,icon:"build"})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[o.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:o.jsxs("div",{className:"flex-1 overflow-auto",children:[o.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ze,{icon:v?.icon||null,name:v?.title||t,size:"sm",className:"shadow-sm shrink-0"}),o.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[k.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):k.isLoading?o.jsx(_e,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:k.isSuccess?"ready":k.isLoading?"connecting":"error"})]})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:_?.description||"No description available"})]})}),o.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),_?.inputSchema?.required&&_.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:R&&_?.inputSchema?.properties?Object.entries(_.inputSchema.properties).map(([I,T])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[I,_.inputSchema?.required?.includes(I)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:T.type})]}),T.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:T.description}),T.type==="object"||T.type==="array"?o.jsx(rt,{className:"font-mono text-xs",value:M(I)?a[I]??"":A[I]??"",onChange:E=>P(I,E.target.value),placeholder:`Enter ${I} as JSON...`,rows:3}):T.type==="boolean"?o.jsxs(an,{value:M(I)?String(a[I]??""):"",onValueChange:E=>P(I,E==="true"),children:[o.jsx(dn,{children:o.jsx(un,{placeholder:"Select true or false..."})}),o.jsxs(fn,{children:[o.jsx(it,{value:"true",children:"true"}),o.jsx(it,{value:"false",children:"false"})]})]}):o.jsx(wt,{value:M(I)?a[I]??"":A[I]??"",onChange:E=>P(I,E.target.value),placeholder:`Enter ${I}...`})]},I)):_?.inputSchema&&!R?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(rt,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:I=>f(I.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Is,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Nn,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(_n,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),o.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:o.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[o.jsx(q,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:H,disabled:h,children:h?o.jsxs(o.Fragment,{children:[o.jsx(_e,{size:14,className:"animate-spin"}),"Executing..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),o.jsx(ie,{children:o.jsxs(le,{children:[o.jsx(oe,{asChild:!0,children:o.jsx(q,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:D,disabled:!m&&!p,children:o.jsx(kt,{size:14})})}),o.jsx(re,{children:o.jsx("p",{children:"Clear results"})})]})})]})}),p&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx(ko,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Cs,{className:"h-4 w-4"}),o.jsx(Co,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Io,{className:"text-xs text-destructive",children:p})]})})}),o.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:m?o.jsxs(o.Fragment,{children:[o.jsx(ye,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(q,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Qt.success("Copied to clipboard")},children:o.jsx(Ts,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(_s,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function Eo(t){const e=N.c(7),{itemId:n,onBack:s}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[0]=i):i=e[0];const l=se(i).connectionId;if(!Ct(l)||!l){let u;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=u):u=e[1],u}let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=a):a=e[2];let d;return e[3]!==l||e[4]!==s||e[5]!==n?(d=o.jsx(C.Suspense,{fallback:a,children:o.jsx(To,{toolName:n,connectionId:l,onBack:s})}),e[3]=l,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}const Bt=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Rt=(t=>t?Bt(t):Bt),Oo=t=>t;function lt(t,e=Oo){const n=U.useSyncExternalStore(t.subscribe,U.useCallback(()=>e(t.getState()),[t,e]),U.useCallback(()=>e(t.getInitialState()),[t,e]));return U.useDebugValue(n),n}const Ro=t=>{const e=Rt(t),n=s=>lt(e,s);return Object.assign(n,e),n},Mo=(t=>Ro);function En(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return ct(s)(n)}}}},Ao=(t,e)=>(n,s,i)=>{let r={storage:En(()=>localStorage),partialize:h=>h,version:0,merge:(h,b)=>({...b,...h}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...h)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...h)},s,i);const f=()=>{const h=r.partialize({...s()});return u.setItem(r.name,{state:h,version:r.version})},m=i.setState;i.setState=(h,b)=>(m(h,b),f());const x=t((...h)=>(n(...h),f()),s,i);i.getInitialState=()=>x;let p;const g=()=>{var h,b;if(!u)return;const j=++c;l=!1,a.forEach(S=>{var v;return S((v=s())!=null?v:x)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(h=s())!=null?h:x))||void 0;return ct(u.getItem.bind(u))(r.name).then(S=>{if(S)if(typeof S.version=="number"&&S.version!==r.version){if(r.migrate){const v=r.migrate(S.state,S.version);return v instanceof Promise?v.then(y=>[!0,y]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,S.state];return[!1,void 0]}).then(S=>{var v;if(j!==c)return;const[y,k]=S;if(p=r.merge(k,(v=s())!=null?v:x),n(p,!0),y)return f()}).then(()=>{j===c&&(w?.(p,void 0),p=s(),l=!0,d.forEach(S=>S(p)))}).catch(S=>{j===c&&w?.(void 0,S)})};return i.persist={setOptions:h=>{r={...r,...h},h.storage&&(u=h.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>g(),hasHydrated:()=>l,onHydrate:h=>(a.add(h),()=>{a.delete(h)}),onFinishHydration:h=>(d.add(h),()=>{d.delete(h)})},r.skipHydration||g(),p||x},On=Ao,{useSyncExternalStoreWithSelector:Po}=fs,Lo=t=>t;function zo(t,e=Lo,n){const s=Po(t.subscribe,t.getState,t.getInitialState,e,n);return U.useDebugValue(s),s}const Ut=t=>Symbol.iterator in t,qt=t=>"entries"in t,Kt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Do=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Wo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Ut(t)&&Ut(e)?qt(t)&&qt(e)?Kt(t,e):Do(t,e):Kt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ho(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
|
|
3
3
|
`:""} ${d}${f}: ${n(u)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -23,4 +23,4 @@ export default async function(input: Input): Promise<Output> {
|
|
|
23
23
|
return {
|
|
24
24
|
result: input,
|
|
25
25
|
};
|
|
26
|
-
}`;s(n.name,{action:{...n.action,transformCode:$}}),l(dl)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const p=x;let g;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(g=(_,$)=>{s(n.name,{action:{...n.action,transformCode:_},...$?{outputSchema:$}:{}})},e[7]=n.action,e[8]=n.name,e[9]=s,e[10]=g):g=e[10];const h=g;if("code"in n.action&&n.action.code)return null;const b=r?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[11]!==b?(j=O("flex flex-col flex-1 min-h-0 overflow-hidden border-b border-border",b),e[11]=b,e[12]=j):j=e[12];let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=w):w=e[13];let S;e[14]!==r?(S=o.jsxs("div",{className:"flex items-center justify-between",children:[w,r?o.jsx($t,{size:14,className:"text-muted-foreground"}):o.jsx(Tt,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=S):S=e[15];let v;e[16]!==S||e[17]!==p?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:S}),e[16]=S,e[17]=p,e[18]=v):v=e[18];let y;e[19]!==h||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(y=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ye,{code:u,language:"typescript",readOnly:i!==void 0,onSave:h,height:"100%"},`transform-code-${n.name}-${i}`)}),e[19]=h,e[20]=r,e[21]=n.name,e[22]=i,e[23]=u,e[24]=y):y=e[24];let k;return e[25]!==j||e[26]!==v||e[27]!==y?(k=o.jsxs("div",{className:j,children:[v,y]}),e[25]=j,e[26]=v,e[27]=y,e[28]=k):k=e[28],k}function dl(t){return!t}function ul(t){return!t}function fl(t){const e=N.c(24),{step:n}=t,[s,i]=C.useState(!1),{updateStep:r}=X(),l="code"in n.action&&n.action.code?n.action.code:null,c=J();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,w)=>{r(n.name,{action:{...n.action,code:j},...w?{outputSchema:w}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=a):a=e[3];const d=a;if(!l)return null;const u=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let f;e[4]!==u?(f=O("flex flex-col border-b border-border",u),e[4]=u,e[5]=f):f=e[5];let m;e[6]!==s?(m=()=>i(!s),e[6]=s,e[7]=m):m=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[8]=x):x=e[8];let p;e[9]!==s?(p=o.jsxs("div",{className:"flex items-center justify-between",children:[x,s?o.jsx($t,{size:14,className:"text-muted-foreground"}):o.jsx(Tt,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=p):p=e[10];let g;e[11]!==m||e[12]!==p?(g=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:m,children:p}),e[11]=m,e[12]=p,e[13]=g):g=e[13];let h;e[14]!==l||e[15]!==d||e[16]!==s||e[17]!==n.name||e[18]!==c?(h=s&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ye,{onSave:(j,w)=>d(j,w),code:l,language:"typescript",height:"100%",readOnly:c!==void 0},`step-code-${n.name}-${c}`)}),e[14]=l,e[15]=d,e[16]=s,e[17]=n.name,e[18]=c,e[19]=h):h=e[19];let b;return e[20]!==f||e[21]!==g||e[22]!==h?(b=o.jsxs("div",{className:f,children:[g,h]}),e[20]=f,e[21]=g,e[22]=h,e[23]=b):b=e[23],b}function Me(t){if(Array.isArray(t.type))return t.type.map(n=>Me({...t,type:n})).join(" | ");switch(t.type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return t.items?`${Me(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Me(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function ml(t){switch(t){case"success":return o.jsxs(je,{variant:"success",className:"gap-1",children:[o.jsx(_t,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(je,{variant:"destructive",className:"gap-1",children:[o.jsx(Et,{size:11}),"Error"]});case"running":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),"Running"]});case"enqueued":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),"On hold"]});case"cancelled":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(hn,{size:11}),"Cancelled"]});default:return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),t]})}}function pl(t){return`Run #${t.slice(-4).toUpperCase()}`}function xl(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=or(),{setShowExecutionsList:r}=Mt(),{setTrackingExecutionId:l}=X(),c=J();let a;e[0]!==l?(a=w=>{l(w)},e[0]=l,e[1]=a):a=e[1];const d=a;let u;e[2]!==r?(u=()=>{r(!1)},e[2]=r,e[3]=u):u=e[3];const f=u;let m;e[4]!==n?(m=O("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=x):x=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(hn,{size:11}),e[7]=p):p=e[7];let g;e[8]!==f?(g=o.jsxs("div",{className:"flex items-center h-12 px-5 border-b border-border shrink-0",children:[x,o.jsx(q,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),e[8]=f,e[9]=g):g=e[9];let h;e[10]!==s||e[11]!==d||e[12]!==i||e[13]!==c?(h=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((w,S)=>o.jsx(hl,{execution:w,isSelected:w.id===c,isFirst:S===0,onSelect:()=>d(w.id)},w.id)),e[10]=s,e[11]=d,e[12]=i,e[13]=c,e[14]=h):h=e[14];let b;e[15]!==h?(b=o.jsx("div",{className:"flex-1 overflow-auto",children:h}),e[15]=h,e[16]=b):b=e[16];let j;return e[17]!==m||e[18]!==g||e[19]!==b?(j=o.jsxs("div",{className:m,children:[g,b]}),e[17]=m,e[18]=g,e[19]=b,e[20]=j):j=e[20],j}function hl(t){const e=N.c(17),{execution:n,isSelected:s,isFirst:i,onSelect:r}=t,l=s&&"bg-accent/50",c=i&&s&&"bg-accent/50",a=!s&&"hover:bg-accent/30";let d;e[0]!==l||e[1]!==c||e[2]!==a?(d=O("flex flex-col justify-center h-[60px] px-4 border-b border-border cursor-pointer transition-colors",l,c,a),e[0]=l,e[1]=c,e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n.status?(u=ml(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=pl(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==u||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==x?(p=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=p):p=e[16],p}function gl(t){const e=N.c(10),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=se(s),r=i??"no-connection",{org:l}=Z(),c=i??null;let a;e[1]!==l.id||e[2]!==c?(a={connectionId:c,orgId:l.id},e[1]=l.id,e[2]=c,e[3]=a):a=e[3];const d=Q(a),u=pt(r,"WORKFLOW",n,d),f=xt(r,"WORKFLOW",d);let m;e[4]!==f||e[5]!==n?(m=async g=>{await f.update.mutateAsync({id:n,data:g})},e[4]=f,e[5]=n,e[6]=m):m=e[6];const x=m;let p;return e[7]!==u||e[8]!==x?(p={item:u,update:x},e[7]=u,e[8]=x,e[9]=p):p=e[9],p}function bl(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=X();let r,l,c,a;if(e[0]!==n.description||e[1]!==n.id||e[2]!==n.steps||e[3]!==n.title){const f={title:n.title,description:n.description,steps:n.steps};r=ye,l=`workflow-${n.id}`,c="100%",a=JSON.stringify(f,null,2),e[0]=n.description,e[1]=n.id,e[2]=n.steps,e[3]=n.title,e[4]=r,e[5]=l,e[6]=c,e[7]=a}else r=e[4],l=e[5],c=e[6],a=e[7];let d;e[8]!==s||e[9]!==i||e[10]!==n?(d=f=>{const m=JSON.parse(f);i({...n,...m}),s(m)},e[8]=s,e[9]=i,e[10]=n,e[11]=d):d=e[11];let u;return e[12]!==r||e[13]!==l||e[14]!==c||e[15]!==a||e[16]!==d?(u=o.jsx(r,{height:c,code:a,language:"json",onSave:d},l),e[12]=r,e[13]=l,e[14]=c,e[15]=a,e[16]=d,e[17]=u):u=e[17],u}function jl(){const t=N.c(12),{setTrackingExecutionId:e}=X(),n=J();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(Ss,{className:"w-4 h-4 text-muted-foreground"})}),t[0]=s):s=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[1]=i):i=t[1];let r;t[2]!==n?(r=o.jsxs("div",{className:"flex items-center h-full",children:[s,o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[i,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]})]}),t[2]=n,t[3]=r):r=t[3];let l;t[4]!==e?(l=()=>e(void 0),t[4]=e,t[5]=l):l=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(mt,{className:"w-4 h-4 text-muted-foreground"}),t[6]=c):c=t[6];let a;t[7]!==l?(a=o.jsx(q,{variant:"ghost",size:"xs",onClick:l,children:c}),t[7]=l,t[8]=a):a=t[8];let d;return t[9]!==r||t[10]!==a?(d=o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between border-b border-border",children:[r,a]}),t[9]=r,t[10]=a,t[11]=d):d=t[11],d}function vl(t){const e=N.c(17),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=se(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l,update:c}=gl(r);let a;e[3]!==l?(a=JSON.stringify(l),e[3]=l,e[4]=a):a=e[4];const d=a;if(!l){let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(It,{icon:o.jsx(vn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow not found",description:"This workflow may have been deleted or you may not have access to it."})}),e[5]=x):x=e[5];let p;return e[6]!==n?(p=o.jsx(ve,{onBack:n,children:x}),e[6]=n,e[7]=p):p=e[7],p}let u;e[8]!==l?(u={workflow:l,trackingExecutionId:void 0,currentStepTab:"input"},e[8]=l,e[9]=u):u=e[9];let f;e[10]!==n||e[11]!==c?(f=o.jsx(yl,{onBack:n,onUpdate:c}),e[10]=n,e[11]=c,e[12]=f):f=e[12];let m;return e[13]!==d||e[14]!==u||e[15]!==f?(m=o.jsx(Bo,{initialState:u,children:f},d),e[13]=d,e[14]=u,e[15]=f,e[16]=m):m=e[16],m}function yl(t){const e=N.c(24),{onBack:n,onUpdate:s}=t,i=Se(),r=J(),{setOriginalWorkflow:l}=X(),{viewMode:c,showExecutionsList:a}=Mt(),d=Te();let u;e[0]!==s||e[1]!==l||e[2]!==i?(u=async()=>{await s(i),l(i)},e[0]=s,e[1]=l,e[2]=i,e[3]=u):u=e[3];const f=u,m=d&&"toolName"in d.action,x=m?d.action.toolName:null,p=m&&!x&&!r,g=!p&&(d||r||!a);let h;e[4]!==f||e[5]!==i.description||e[6]!==i.title?(h=o.jsx(di,{title:i.title,description:i.description,onSave:f}),e[4]=f,e[5]=i.description,e[6]=i.title,e[7]=h):h=e[7];let b;e[8]!==r?(b=r&&o.jsx(jl,{}),e[8]=r,e[9]=b):b=e[9];let j;e[10]!==s||e[11]!==a||e[12]!==g||e[13]!==p||e[14]!==c||e[15]!==i?(j=o.jsx("div",{className:"flex-1 overflow-hidden",children:c==="code"?o.jsx(bl,{workflow:i,onUpdate:s}):o.jsxs(Ds,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(Ht,{defaultSize:50,minSize:30,children:o.jsx(_i,{})}),o.jsx(Ws,{}),o.jsxs(Ht,{defaultSize:50,minSize:25,children:[p&&o.jsx(Ei,{className:"border-l border-border"}),a&&o.jsx(xl,{}),g&&o.jsx(tl,{className:"border-l border-border"})]})]})}),e[10]=s,e[11]=a,e[12]=g,e[13]=p,e[14]=c,e[15]=i,e[16]=j):j=e[16];let w;e[17]!==h||e[18]!==b||e[19]!==j?(w=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[h,b,j]}),e[17]=h,e[18]=b,e[19]=j,e[20]=w):w=e[20];let S;return e[21]!==n||e[22]!==w?(S=o.jsx(ve,{onBack:n,children:w}),e[21]=n,e[22]=w,e[23]=S):S=e[23],S}function wl(t){const e=N.c(3),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=se(s),l=pt(i??"no-connection","WORKFLOW_EXECUTION",n,i);let c;return e[1]!==l?(c={item:l},e[1]=l,e[2]=c):c=e[2],c}function Sl(t){const e=N.c(13),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=se(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l}=wl(r);if(!l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(It,{icon:o.jsx(vn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow execution not found",description:"This workflow execution may have been deleted or you may not have access to it."})}),e[3]=u):u=e[3];let f;return e[4]!==n?(f=o.jsx(ve,{onBack:n,children:u}),e[4]=n,e[5]=f):f=e[5],f}let c;e[6]!==l?(c=JSON.stringify(l,null,2),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==c?(a=o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(ye,{height:"100%",code:c,language:"json",readOnly:!0})}),e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(ve,{onBack:n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}const Nl={workflow:vl,workflow_execution:Sl,prompt:So};function kl(){const t=N.c(6),e=sn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=se(n),i=decodeURIComponent(s.itemId);let r;t[1]!==e.history?(r=()=>{e.history.back()},t[1]=e.history,t[2]=r):r=t[2];const l=r,c=Cl;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(Eo,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function Cl(t){return Promise.resolve()}function Il(){const t=N.c(19),e=sn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=se(n),i=s.connectionId,r=decodeURIComponent(s.collectionName),l=decodeURIComponent(s.itemId);let c;t[1]!==e.history?(c=()=>{e.history.back()},t[1]=e.history,t[2]=c):c=t[2];const a=c,d=i??"no-connection",{org:u}=Z(),f=i??null;let m;t[3]!==u.id||t[4]!==f?(m={connectionId:f,orgId:u.id},t[3]=u.id,t[4]=f,t[5]=m):m=t[5];const x=Q(m),p=xt(d,r,x);let g;t[6]!==p||t[7]!==l?(g=async y=>{l&&await p.update.mutateAsync({id:l,data:y})},t[6]=p,t[7]=l,t[8]=g):g=t[8];const h=g;let b;t[9]!==r?(b=r?.toLowerCase(),t[9]=r,t[10]=b):b=t[10];const j=b,w=j&&Nl[j];if(w){let y;return t[11]!==w||t[12]!==a||t[13]!==h||t[14]!==l?(y=o.jsx(w,{itemId:l,onBack:a,onUpdate:h}),t[11]=w,t[12]=a,t[13]=h,t[14]=l,t[15]=y):y=t[15],y}let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(Ns,{size:36,className:"text-muted-foreground"}),t[16]=S):S=t[16];let v;return t[17]!==a?(v=o.jsx(It,{icon:S,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[17]=a,t[18]=v):v=t[18],v}function _l(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=se(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(kl,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(Il,{}),t[2]=r):r=t[2],r}function Bc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(rn,{children:o.jsx(C.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(_l,{})})}),t[0]=e):e=t[0],e}export{Bc as default};
|
|
26
|
+
}`;s(n.name,{action:{...n.action,transformCode:$}}),l(dl)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const p=x;let g;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(g=(_,$)=>{s(n.name,{action:{...n.action,transformCode:_},...$?{outputSchema:$}:{}})},e[7]=n.action,e[8]=n.name,e[9]=s,e[10]=g):g=e[10];const h=g;if("code"in n.action&&n.action.code)return null;const b=r?"flex-1 min-h-0 overflow-hidden":"shrink-0";let j;e[11]!==b?(j=O("flex flex-col flex-1 min-h-0 overflow-hidden border-b border-border",b),e[11]=b,e[12]=j):j=e[12];let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=w):w=e[13];let S;e[14]!==r?(S=o.jsxs("div",{className:"flex items-center justify-between",children:[w,r?o.jsx($t,{size:14,className:"text-muted-foreground"}):o.jsx(Tt,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=S):S=e[15];let v;e[16]!==S||e[17]!==p?(v=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:S}),e[16]=S,e[17]=p,e[18]=v):v=e[18];let y;e[19]!==h||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(y=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ye,{code:u,language:"typescript",readOnly:i!==void 0,onSave:h,height:"100%"},`transform-code-${n.name}-${i}`)}),e[19]=h,e[20]=r,e[21]=n.name,e[22]=i,e[23]=u,e[24]=y):y=e[24];let k;return e[25]!==j||e[26]!==v||e[27]!==y?(k=o.jsxs("div",{className:j,children:[v,y]}),e[25]=j,e[26]=v,e[27]=y,e[28]=k):k=e[28],k}function dl(t){return!t}function ul(t){return!t}function fl(t){const e=N.c(24),{step:n}=t,[s,i]=C.useState(!1),{updateStep:r}=X(),l="code"in n.action&&n.action.code?n.action.code:null,c=J();let a;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(a=(j,w)=>{r(n.name,{action:{...n.action,code:j},...w?{outputSchema:w}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=a):a=e[3];const d=a;if(!l)return null;const u=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let f;e[4]!==u?(f=O("flex flex-col border-b border-border",u),e[4]=u,e[5]=f):f=e[5];let m;e[6]!==s?(m=()=>i(!s),e[6]=s,e[7]=m):m=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[8]=x):x=e[8];let p;e[9]!==s?(p=o.jsxs("div",{className:"flex items-center justify-between",children:[x,s?o.jsx($t,{size:14,className:"text-muted-foreground"}):o.jsx(Tt,{size:14,className:"text-muted-foreground"})]}),e[9]=s,e[10]=p):p=e[10];let g;e[11]!==m||e[12]!==p?(g=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:m,children:p}),e[11]=m,e[12]=p,e[13]=g):g=e[13];let h;e[14]!==l||e[15]!==d||e[16]!==s||e[17]!==n.name||e[18]!==c?(h=s&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(ye,{onSave:(j,w)=>d(j,w),code:l,language:"typescript",height:"100%",readOnly:c!==void 0},`step-code-${n.name}-${c}`)}),e[14]=l,e[15]=d,e[16]=s,e[17]=n.name,e[18]=c,e[19]=h):h=e[19];let b;return e[20]!==f||e[21]!==g||e[22]!==h?(b=o.jsxs("div",{className:f,children:[g,h]}),e[20]=f,e[21]=g,e[22]=h,e[23]=b):b=e[23],b}function Me(t){if(Array.isArray(t.type))return t.type.map(n=>Me({...t,type:n})).join(" | ");switch(t.type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return t.items?`${Me(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Me(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function ml(t){switch(t){case"success":return o.jsxs(je,{variant:"success",className:"gap-1",children:[o.jsx(_t,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(je,{variant:"destructive",className:"gap-1",children:[o.jsx(Et,{size:11}),"Error"]});case"running":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),"Running"]});case"enqueued":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),"On hold"]});case"cancelled":return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(hn,{size:11}),"Cancelled"]});default:return o.jsxs(je,{variant:"secondary",className:"gap-1",children:[o.jsx(Re,{size:11}),t]})}}function pl(t){return`Run #${t.slice(-4).toUpperCase()}`}function xl(t){const e=N.c(21),{className:n}=t,{executions:s,isLoading:i}=or(),{setShowExecutionsList:r}=Mt(),{setTrackingExecutionId:l}=X(),c=J();let a;e[0]!==l?(a=w=>{l(w)},e[0]=l,e[1]=a):a=e[1];const d=a;let u;e[2]!==r?(u=()=>{r(!1)},e[2]=r,e[3]=u):u=e[3];const f=u;let m;e[4]!==n?(m=O("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=x):x=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(hn,{size:11}),e[7]=p):p=e[7];let g;e[8]!==f?(g=o.jsxs("div",{className:"flex items-center h-12 px-5 border-b border-border shrink-0",children:[x,o.jsx(q,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),e[8]=f,e[9]=g):g=e[9];let h;e[10]!==s||e[11]!==d||e[12]!==i||e[13]!==c?(h=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((w,S)=>o.jsx(hl,{execution:w,isSelected:w.id===c,isFirst:S===0,onSelect:()=>d(w.id)},w.id)),e[10]=s,e[11]=d,e[12]=i,e[13]=c,e[14]=h):h=e[14];let b;e[15]!==h?(b=o.jsx("div",{className:"flex-1 overflow-auto",children:h}),e[15]=h,e[16]=b):b=e[16];let j;return e[17]!==m||e[18]!==g||e[19]!==b?(j=o.jsxs("div",{className:m,children:[g,b]}),e[17]=m,e[18]=g,e[19]=b,e[20]=j):j=e[20],j}function hl(t){const e=N.c(17),{execution:n,isSelected:s,isFirst:i,onSelect:r}=t,l=s&&"bg-accent/50",c=i&&s&&"bg-accent/50",a=!s&&"hover:bg-accent/30";let d;e[0]!==l||e[1]!==c||e[2]!==a?(d=O("flex flex-col justify-center h-[60px] px-4 border-b border-border cursor-pointer transition-colors",l,c,a),e[0]=l,e[1]=c,e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n.status?(u=ml(n.status),e[4]=n.status,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=pl(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==u||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==x?(p=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=p):p=e[16],p}function gl(t){const e=N.c(10),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=se(s),r=i??"no-connection",{org:l}=Z(),c=i??null;let a;e[1]!==l.id||e[2]!==c?(a={connectionId:c,orgId:l.id},e[1]=l.id,e[2]=c,e[3]=a):a=e[3];const d=Q(a),u=pt(r,"WORKFLOW",n,d),f=xt(r,"WORKFLOW",d);let m;e[4]!==f||e[5]!==n?(m=async g=>{await f.update.mutateAsync({id:n,data:g})},e[4]=f,e[5]=n,e[6]=m):m=e[6];const x=m;let p;return e[7]!==u||e[8]!==x?(p={item:u,update:x},e[7]=u,e[8]=x,e[9]=p):p=e[9],p}function bl(t){const e=N.c(18),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=X();let r,l,c,a;if(e[0]!==n.description||e[1]!==n.id||e[2]!==n.steps||e[3]!==n.title){const f={title:n.title,description:n.description,steps:n.steps};r=ye,l=`workflow-${n.id}`,c="100%",a=JSON.stringify(f,null,2),e[0]=n.description,e[1]=n.id,e[2]=n.steps,e[3]=n.title,e[4]=r,e[5]=l,e[6]=c,e[7]=a}else r=e[4],l=e[5],c=e[6],a=e[7];let d;e[8]!==s||e[9]!==i||e[10]!==n?(d=f=>{const m=JSON.parse(f);i({...n,...m}),s(m)},e[8]=s,e[9]=i,e[10]=n,e[11]=d):d=e[11];let u;return e[12]!==r||e[13]!==l||e[14]!==c||e[15]!==a||e[16]!==d?(u=o.jsx(r,{height:c,code:a,language:"json",onSave:d},l),e[12]=r,e[13]=l,e[14]=c,e[15]=a,e[16]=d,e[17]=u):u=e[17],u}function jl(){const t=N.c(12),{setTrackingExecutionId:e}=X(),n=J();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(Ss,{className:"w-4 h-4 text-muted-foreground"})}),t[0]=s):s=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[1]=i):i=t[1];let r;t[2]!==n?(r=o.jsxs("div",{className:"flex items-center h-full",children:[s,o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[i,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]})]}),t[2]=n,t[3]=r):r=t[3];let l;t[4]!==e?(l=()=>e(void 0),t[4]=e,t[5]=l):l=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(mt,{className:"w-4 h-4 text-muted-foreground"}),t[6]=c):c=t[6];let a;t[7]!==l?(a=o.jsx(q,{variant:"ghost",size:"xs",onClick:l,children:c}),t[7]=l,t[8]=a):a=t[8];let d;return t[9]!==r||t[10]!==a?(d=o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between border-b border-border",children:[r,a]}),t[9]=r,t[10]=a,t[11]=d):d=t[11],d}function vl(t){const e=N.c(17),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=se(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l,update:c}=gl(r);let a;e[3]!==l?(a=JSON.stringify(l),e[3]=l,e[4]=a):a=e[4];const d=a;if(!l){let x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(It,{icon:o.jsx(vn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow not found",description:"This workflow may have been deleted or you may not have access to it."})}),e[5]=x):x=e[5];let p;return e[6]!==n?(p=o.jsx(ve,{onBack:n,children:x}),e[6]=n,e[7]=p):p=e[7],p}let u;e[8]!==l?(u={workflow:l,trackingExecutionId:void 0,currentStepTab:"input"},e[8]=l,e[9]=u):u=e[9];let f;e[10]!==n||e[11]!==c?(f=o.jsx(yl,{onBack:n,onUpdate:c}),e[10]=n,e[11]=c,e[12]=f):f=e[12];let m;return e[13]!==d||e[14]!==u||e[15]!==f?(m=o.jsx(Bo,{initialState:u,children:f},d),e[13]=d,e[14]=u,e[15]=f,e[16]=m):m=e[16],m}function yl(t){const e=N.c(24),{onBack:n,onUpdate:s}=t,i=Se(),r=J(),{setOriginalWorkflow:l}=X(),{viewMode:c,showExecutionsList:a}=Mt(),d=Te();let u;e[0]!==s||e[1]!==l||e[2]!==i?(u=async()=>{await s(i),l(i)},e[0]=s,e[1]=l,e[2]=i,e[3]=u):u=e[3];const f=u,m=d&&"toolName"in d.action,x=m?d.action.toolName:null,p=m&&!x&&!r,g=!p&&(d||r||!a);let h;e[4]!==f||e[5]!==i.description||e[6]!==i.title?(h=o.jsx(di,{title:i.title,description:i.description,onSave:f}),e[4]=f,e[5]=i.description,e[6]=i.title,e[7]=h):h=e[7];let b;e[8]!==r?(b=r&&o.jsx(jl,{}),e[8]=r,e[9]=b):b=e[9];let j;e[10]!==s||e[11]!==a||e[12]!==g||e[13]!==p||e[14]!==c||e[15]!==i?(j=o.jsx("div",{className:"flex-1 overflow-hidden",children:c==="code"?o.jsx(bl,{workflow:i,onUpdate:s}):o.jsxs(Ds,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(Ht,{defaultSize:50,minSize:30,children:o.jsx(_i,{})}),o.jsx(Ws,{}),o.jsxs(Ht,{defaultSize:50,minSize:25,children:[p&&o.jsx(Ei,{className:"border-l border-border"}),a&&o.jsx(xl,{}),g&&o.jsx(tl,{className:"border-l border-border"})]})]})}),e[10]=s,e[11]=a,e[12]=g,e[13]=p,e[14]=c,e[15]=i,e[16]=j):j=e[16];let w;e[17]!==h||e[18]!==b||e[19]!==j?(w=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[h,b,j]}),e[17]=h,e[18]=b,e[19]=j,e[20]=w):w=e[20];let S;return e[21]!==n||e[22]!==w?(S=o.jsx(ve,{onBack:n,children:w}),e[21]=n,e[22]=w,e[23]=S):S=e[23],S}function wl(t){const e=N.c(3),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{connectionId:i}=se(s),l=pt(i??"no-connection","WORKFLOW_EXECUTION",n,i);let c;return e[1]!==l?(c={item:l},e[1]=l,e[2]=c):c=e[2],c}function Sl(t){const e=N.c(13),{onBack:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},e[0]=s):s=e[0];const{itemId:i}=se(s);let r;e[1]!==i?(r={itemId:i},e[1]=i,e[2]=r):r=e[2];const{item:l}=wl(r);if(!l){let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(It,{icon:o.jsx(vn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow execution not found",description:"This workflow execution may have been deleted or you may not have access to it."})}),e[3]=u):u=e[3];let f;return e[4]!==n?(f=o.jsx(ve,{onBack:n,children:u}),e[4]=n,e[5]=f):f=e[5],f}let c;e[6]!==l?(c=JSON.stringify(l,null,2),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==c?(a=o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(ye,{height:"100%",code:c,language:"json",readOnly:!0})}),e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(ve,{onBack:n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}const Nl={workflow:vl,workflow_execution:Sl,prompt:So};function kl(){const t=N.c(6),e=sn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=se(n),i=decodeURIComponent(s.itemId);let r;t[1]!==e.history?(r=()=>{e.history.back()},t[1]=e.history,t[2]=r):r=t[2];const l=r,c=Cl;let a;return t[3]!==l||t[4]!==i?(a=o.jsx(Eo,{itemId:i,onBack:l,onUpdate:c}),t[3]=l,t[4]=i,t[5]=a):a=t[5],a}async function Cl(t){return Promise.resolve()}function Il(){const t=N.c(19),e=sn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=n):n=t[0];const s=se(n),i=s.connectionId,r=decodeURIComponent(s.collectionName),l=decodeURIComponent(s.itemId);let c;t[1]!==e.history?(c=()=>{e.history.back()},t[1]=e.history,t[2]=c):c=t[2];const a=c,d=i??"no-connection",{org:u}=Z(),f=i??null;let m;t[3]!==u.id||t[4]!==f?(m={connectionId:f,orgId:u.id},t[3]=u.id,t[4]=f,t[5]=m):m=t[5];const x=Q(m),p=xt(d,r,x);let g;t[6]!==p||t[7]!==l?(g=async y=>{l&&await p.update.mutateAsync({id:l,data:y})},t[6]=p,t[7]=l,t[8]=g):g=t[8];const h=g;let b;t[9]!==r?(b=r?.toLowerCase(),t[9]=r,t[10]=b):b=t[10];const j=b,w=j&&Nl[j];if(w){let y;return t[11]!==w||t[12]!==a||t[13]!==h||t[14]!==l?(y=o.jsx(w,{itemId:l,onBack:a,onUpdate:h}),t[11]=w,t[12]=a,t[13]=h,t[14]=l,t[15]=y):y=t[15],y}let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(Ns,{size:36,className:"text-muted-foreground"}),t[16]=S):S=t[16];let v;return t[17]!==a?(v=o.jsx(It,{icon:S,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:a,children:"Go back"}}),t[17]=a,t[18]=v):v=t[18],v}function _l(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},t[0]=e):e=t[0];const n=se(e);if(decodeURIComponent(n.collectionName)==="tools"){let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(kl,{}),t[1]=l):l=t[1],l}let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(Il,{}),t[2]=r):r=t[2],r}function Fc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(rn,{children:o.jsx(C.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(_e,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(_l,{})})}),t[0]=e):e=t[0],e}export{Fc as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as j,c as k,j as s}from"./index-
|
|
1
|
+
import{r as j,c as k,j as s}from"./index-BTX95t7l.js";import{c as N,B as C}from"./button-BNEclrG2.js";import{c as y,a as M,D as z,b as D}from"./dropdown-menu-B5X7QG53.js";import{i as S}from"./ArrowUp-PDh8aKqr.js";import{i as T}from"./Check-DCOgSIim.js";import{c as E}from"./Grid01-CHS_jF02.js";import{i as V}from"./List-C7xsEmxx.js";import{b as _,c as B,T as L,a as $}from"./tooltip-Mf5UtuF2.js";import{V as W}from"./view-mode-toggle-C5CEe5h-.js";const w=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const b=({size:r=24,color:e="currentColor",...o})=>j.createElement("svg",{viewBox:"0 0 24 24",width:r,height:r,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},j.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function H(r){const e=k.c(16),{viewMode:o,onViewModeChange:g,sortKey:v,sortDirection:n,onSort:l,sortOptions:a}=r;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(_,{children:s.jsxs(B,{children:[s.jsx(L,{asChild:!0,children:s.jsx(M,{asChild:!0,children:s.jsx(C,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx($,{children:"Search filters"})]})}),e[2]=m):m=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(V,{})},e[3]=p):p=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=[p,{value:"cards",icon:s.jsx(E,{})}],e[4]=h):h=e[4];let t;e[5]!==g||e[6]!==o?(t=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(W,{value:o,onValueChange:g,fullWidth:!0,options:h})}),e[5]=g,e[6]=o,e[7]=t):t=e[7];let i;e[8]!==l||e[9]!==n||e[10]!==v||e[11]!==d?(i=d.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),d.map(u=>{const f=v===u.id;return s.jsx(y,{onClick:()=>l(u.id),className:N("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(T,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:u.label}),f&&n&&(n==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},u.id)})]}),e[8]=l,e[9]=n,e[10]=v,e[11]=d,e[12]=i):i=e[12];let x;return e[13]!==t||e[14]!==i?(x=s.jsxs(z,{children:[m,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[t,i]})]}),e[13]=t,e[14]=i,e[15]=x):x=e[15],x}export{H as C,w as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,j as l}from"./index-
|
|
1
|
+
import{c as v,j as l}from"./index-BTX95t7l.js";import{C as b}from"./collection-display-button-Bv_XCGpu.js";function w(g){const e=v.c(20),{title:r,viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:a,ctaButton:h,leftElement:u}=g;let m;e[0]!==a?(m=a===void 0?[]:a,e[0]=a,e[1]=m):m=e[1];const j=m;let t;e[2]!==r?(t=typeof r=="string"?l.jsx("h1",{className:"text-sm font-medium text-foreground",children:r}):r,e[2]=r,e[3]=t):t=e[3];let s;e[4]!==u||e[5]!==t?(s=l.jsxs("div",{className:"flex items-center gap-2",children:[u,t]}),e[4]=u,e[5]=t,e[6]=s):s=e[6];let i;e[7]!==p||e[8]!==c||e[9]!==x||e[10]!==f||e[11]!==j||e[12]!==n?(i=n&&c&&l.jsx(b,{viewMode:n,onViewModeChange:c,sortKey:f,sortDirection:x,onSort:p,sortOptions:j}),e[7]=p,e[8]=c,e[9]=x,e[10]=f,e[11]=j,e[12]=n,e[13]=i):i=e[13];let o;e[14]!==h||e[15]!==i?(o=l.jsxs("div",{className:"flex items-center gap-2",children:[i,h]}),e[14]=h,e[15]=i,e[16]=o):o=e[16];let d;return e[17]!==s||e[18]!==o?(d=l.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:l.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[s,o]})}),e[17]=s,e[18]=o,e[19]=d):d=e[19],d}export{w as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as c}from"./index-
|
|
1
|
+
import{c as s,j as c}from"./index-BTX95t7l.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as a}from"./index-
|
|
1
|
+
import{c as g,j as a}from"./index-BTX95t7l.js";import{i as b}from"./Loading01-CopTTh4g.js";import{i as j}from"./SearchMd-CHkFEvMn.js";import{I as N}from"./input-Vw7XIX0r.js";import{c as v}from"./button-BNEclrG2.js";function E(h){const e=g.c(17),{value:n,onChange:c,placeholder:x,onKeyDown:m,className:f,isSearching:d}=h,p=x===void 0?"Search...":x;let s;e[0]!==f?(s=v("shrink-0 w-full border-b border-border h-12",f),e[0]=f,e[1]=s):s=e[1];let t;e[2]!==d?(t=d?a.jsx(b,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(j,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=d,e[3]=t):t=e[3];let r;e[4]!==c?(r=u=>c(u.target.value),e[4]=c,e[5]=r):r=e[5];let o;e[6]!==m||e[7]!==p||e[8]!==r||e[9]!==n?(o=a.jsx(N,{value:n,onChange:r,onKeyDown:m,placeholder:p,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[6]=m,e[7]=p,e[8]=r,e[9]=n,e[10]=o):o=e[10];let l;e[11]!==t||e[12]!==o?(l=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[t,o]}),e[11]=t,e[12]=o,e[13]=l):l=e[13];let i;return e[14]!==s||e[15]!==l?(i=a.jsx("div",{className:s,children:l}),e[14]=s,e[15]=l,e[16]=i):i=e[16],i}export{E as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ne,j as t,u as Ve,K as rt,f as at,bg as ct,e as dt,r as mt,a8 as ft}from"./index-kxFCfKdx.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button-BAinwubP.js";import{C as ut}from"./collection-search-Cp9Rg8cG.js";import{C as pt}from"./card-D-ZcDLJM.js";import{I as Ge,E as ht}from"./empty-state-D6Pye5dp.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-5V-XyUMl.js";import{B as ke,c as Oe}from"./button-B9UDEwx9.js";import{a as Qe}from"./Copy01-CJVQGg2V.js";import{i as Ye}from"./DotsVertical-RAbtNrG6.js";import{i as Xe}from"./Edit01-DsrgmMbR.js";import{s as Ze,u as xt}from"./use-list-state-ZDRP3zFW.js";import{s as et}from"./Trash01-NIFttcxe.js";import{C as gt}from"./collection-table-wrapper-Cfb-5BQo.js";import{E as Le}from"./empty-state-Ba4zQn5e.js";import{n as Be}from"./Inbox01-BExxQniM.js";import{A as Me}from"./avatar-HSzeBtSD.js";import{u as jt}from"./useQuery-CVADJf0h.js";import{a as Ct,u as tt}from"./constants-C8DVLjyM.js";import{P as vt}from"./pin-to-sidebar-button-DKtGxFhi.js";import{u as bt,b as yt}from"./use-collections-DWOZCISS.js";import{u as Nt}from"./use-connection-ASBc3U14.js";import{B as wt}from"./constants-CuO4IXOK.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-nojSsjex.js";import{s as Et}from"./Plus-Rzuz08cb.js";import{V as zt}from"./layout-BdEZp7Lm.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(gt,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function Ds(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=xt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(ut,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(ht,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{Ds as C};
|
|
1
|
+
import{c as ne,j as t,u as Ve,K as rt,f as at,bg as ct,e as dt,r as mt,a8 as ft}from"./index-BTX95t7l.js";import{g as Ue}from"./generate-id-Dyweu44Y.js";import{C as qe}from"./collection-display-button-Bv_XCGpu.js";import{C as ut}from"./collection-search-ClAji_RX.js";import{C as pt}from"./card-kDbUMtCL.js";import{I as Ge,E as ht}from"./empty-state-Bnk561r4.js";import{D as We,a as He,b as Je,c as F}from"./dropdown-menu-B5X7QG53.js";import{B as ke,c as Oe}from"./button-BNEclrG2.js";import{a as Qe}from"./Copy01-C5lSJKpp.js";import{i as Ye}from"./DotsVertical-qocOLS4A.js";import{i as Xe}from"./Edit01-DHPNOaMT.js";import{s as Ze,u as xt}from"./use-list-state-5iRHLEuj.js";import{s as et}from"./Trash01-CSFSnmeR.js";import{C as gt}from"./collection-table-wrapper-BdCz63Jd.js";import{E as Le}from"./empty-state-DHhGwZ9F.js";import{n as Be}from"./Inbox01-39gPJAMl.js";import{A as Me}from"./avatar-BIPSK-nZ.js";import{u as jt}from"./useQuery-CnjlQpZk.js";import{a as Ct,u as tt}from"./constants-l6jfVkIP.js";import{P as vt}from"./pin-to-sidebar-button-CDjTUMWb.js";import{u as bt,b as yt}from"./use-collections-M-ZucrNc.js";import{u as Nt}from"./use-connection-B7MC5D37.js";import{B as wt}from"./constants-Cp5o6xb6.js";import{A as St,g as _t,c as Dt,b as At,d as It,e as Pt,a as Tt,f as $t}from"./alert-dialog-JUSgghwR.js";import{s as Et}from"./Plus-erQKhzFc.js";import{V as zt}from"./layout-DKHrwMN9.js";function Ot(n,e){const s=n.properties||{};for(const o in s){const l=s[o];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&o in e&&e[o])return e[o]}const c=["image","img","avatar","icon","logo","thumbnail","cover"];for(const o of c)if(e&&typeof e=="object"&&o in e&&typeof e[o]=="string")return e[o]}function Mt(n){const e=ne.c(25),{item:s,schema:c,actions:o}=n;let l;e[0]!==s||e[1]!==c?(l=Ot(c,s),e[0]=s,e[1]=c,e[2]=l):l=e[2];const r=l,d=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==o?(f=o&&Object.keys(o).length>0,e[3]=o,e[4]=f):f=e[4];const i=f;let u;e[5]!==r||e[6]!==s.title?(u=t.jsx(Ge,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=u):u=e[7];let g;e[8]!==s.title?(g=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=g):g=e[9];const h=d||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==g||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,m]}),e[12]=g,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let v;e[18]!==o||e[19]!==i||e[20]!==s?(v=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ut,onMouseDown:Kt,children:t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:kt,children:[o.open&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),o.edit&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.edit?.(s)},children:[t.jsx(Xe,{size:16}),"Edit"]}),o.duplicate&&t.jsxs(F,{onClick:p=>{p.stopPropagation(),o.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),o.delete&&t.jsxs(F,{variant:"destructive",onClick:p=>{p.stopPropagation(),o.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=o,e[19]=i,e[20]=s,e[21]=v):v=e[21];let N;return e[22]!==y||e[23]!==v?(N=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,v]}),e[22]=y,e[23]=v,e[24]=N):N=e[24],N}function kt(n){return n.stopPropagation()}function Ft(n){return n.stopPropagation()}function Kt(n){return n.stopPropagation()}function Ut(n){return n.stopPropagation()}function Lt(n){const e=ne.c(11),{org:s}=Ve();let c;e[0]!==s.id?(c={connectionId:Ct,orgId:s.id},e[0]=s.id,e[1]=c):c=e[1];const o=tt(c);let l;e[2]!==n?(l=rt.user(n),e[2]=n,e[3]=l):l=e[3];let r;e[4]!==o||e[5]!==n?(r=async()=>{const i=await o.callTool({name:"USER_GET",arguments:{id:n}});return(i.structuredContent??i).user},e[4]=o,e[5]=n,e[6]=r):r=e[6];const d=!!n;let f;return e[7]!==l||e[8]!==r||e[9]!==d?(f={queryKey:l,queryFn:r,staleTime:3e5,retry:1,enabled:d},e[7]=l,e[8]=r,e[9]=d,e[10]=f):f=e[10],jt(f)}function Bt(n){const e=ne.c(39),{id:s,size:c,showEmail:o,className:l}=n,r=c===void 0?"xs":c,d=o===void 0?!1:o,{data:f,isLoading:i,isError:u}=Lt(s);if(i){let p;e[0]!==l?(p=Oe("flex items-center gap-2",l),e[0]=l,e[1]=p):p=e[1];let a;e[2]!==r?(a=t.jsx(Me.Skeleton,{shape:"circle",size:r}),e[2]=r,e[3]=a):a=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[4]=b):b=e[4];let j;e[5]!==d?(j=d&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[5]=d,e[6]=j):j=e[6];let C;e[7]!==j?(C=t.jsxs("div",{className:"flex flex-col gap-1",children:[b,j]}),e[7]=j,e[8]=C):C=e[8];let _;return e[9]!==p||e[10]!==a||e[11]!==C?(_=t.jsxs("div",{className:p,children:[a,C]}),e[9]=p,e[10]=a,e[11]=C,e[12]=_):_=e[12],_}if(u||!f){let p;e[13]!==l?(p=Oe("flex items-center gap-2",l),e[13]=l,e[14]=p):p=e[14];let a;e[15]!==r?(a=t.jsx(Me,{shape:"circle",size:r,fallback:"?",muted:!0}),e[15]=r,e[16]=a):a=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[17]=b):b=e[17];let j;return e[18]!==p||e[19]!==a?(j=t.jsxs("div",{className:p,children:[a,b]}),e[18]=p,e[19]=a,e[20]=j):j=e[20],j}let g;e[21]!==l?(g=Oe("flex items-center gap-2",l),e[21]=l,e[22]=g):g=e[22];const h=f.image??void 0;let m;e[23]!==r||e[24]!==h||e[25]!==f.name?(m=t.jsx(Me,{shape:"circle",size:r,url:h,fallback:f.name}),e[23]=r,e[24]=h,e[25]=f.name,e[26]=m):m=e[26];let x;e[27]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[27]=f.name,e[28]=x):x=e[28];let y;e[29]!==d||e[30]!==f.email?(y=d&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[29]=d,e[30]=f.email,e[31]=y):y=e[31];let v;e[32]!==x||e[33]!==y?(v=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[32]=x,e[33]=y,e[34]=v):v=e[34];let N;return e[35]!==g||e[36]!==m||e[37]!==v?(N=t.jsxs("div",{className:g,children:[m,v]}),e[35]=g,e[36]=m,e[37]=v,e[38]=N):N=e[38],N}const Rt=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Vt(n){return Object.keys(n).find(e=>Rt.includes(e.toLowerCase()))}function st(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function qt(n){const e=ne.c(32),{data:s,schema:c,viewMode:o,onViewModeChange:l,search:r,sortKey:d,sortDirection:f,onSort:i,actions:u,onItemClick:g,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:v,sortableFields:N}=n,p=l===void 0?Qt:l,a=f===void 0?"asc":f,b=i===void 0?Jt:i;let j;e[0]!==u?(j=u===void 0?{}:u,e[0]=u,e[1]=j):j=e[1];const C=j,_=g===void 0?Ht:g,D=h===void 0?null:h,P=m===void 0?null:m,E=x===void 0?!1:x,A=y===void 0?void 0:y,I=v===void 0?!1:v,S=N===void 0?void 0:N;let M;e[2]!==A||e[3]!==c||e[4]!==S?(M=A?A.filter(Wt).filter(O=>!S||S.includes(O.id)).map(Gt):st(c,S),e[2]=A,e[3]=c,e[4]=S,e[5]=M):M=e[5];const k=M;let z;e[6]!==D||e[7]!==I||e[8]!==b||e[9]!==p||e[10]!==a||e[11]!==d||e[12]!==k||e[13]!==o?(z=!I&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:o,onViewModeChange:p,sortKey:d,sortDirection:a,onSort:b,sortOptions:k})})]})}),e[6]=D,e[7]=I,e[8]=b,e[9]=p,e[10]=a,e[11]=d,e[12]=k,e[13]=o,e[14]=z):z=e[14];let T;e[15]!==C||e[16]!==A||e[17]!==s||e[18]!==P||e[19]!==_||e[20]!==b||e[21]!==E||e[22]!==c||e[23]!==r||e[24]!==a||e[25]!==d||e[26]!==S||e[27]!==o?(T=o==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>_?.(O),className:"cursor-pointer h-full",children:t.jsx(Mt,{item:O,schema:c,readOnly:E,actions:C})},O.id))})}):t.jsx(gt,{columns:Zt(A,c,S,C),data:s,sortKey:d,sortDirection:a,onSort:b,onRowClick:_,emptyState:P||t.jsx(Le,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:r?"Try adjusting your search":"No items to display"})}),e[15]=C,e[16]=A,e[17]=s,e[18]=P,e[19]=_,e[20]=b,e[21]=E,e[22]=c,e[23]=r,e[24]=a,e[25]=d,e[26]=S,e[27]=o,e[28]=T):T=e[28];let $;return e[29]!==z||e[30]!==T?($=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[z,T]}),e[29]=z,e[30]=T,e[31]=$):$=e[31],$}function Gt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Wt(n){return n.sortable!==!1}function Ht(){}function Jt(){}function Qt(){}function Yt(n){return{id:"actions",header:"",render:e=>t.jsxs(We,{children:[t.jsx(He,{asChild:!0,children:t.jsx(ke,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Xe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(n){const e=n.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Xt(n,e){const s=n.properties||{},c=Object.keys(s).filter(i=>{const u=s[i];return u&&it(u)}),o=Vt(s),l=[],r=new Set;o&&c.includes(o)&&(l.push(o),r.add(o));const d=["title","description","updated_at","updated_by"];for(const i of d)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));const f=c.filter(i=>!r.has(i)&&!Re.includes(i)).sort((i,u)=>i.localeCompare(u));for(const i of f)l.push(i),r.add(i);for(const i of Re)c.includes(i)&&!r.has(i)&&(l.push(i),r.add(i));return l.map(i=>{const u=s[i],g=e?e.includes(i):!["id"].includes(i);return i===o?{id:i,header:"",render:h=>{const m=h[i];return t.jsx(Ge,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:g,cellClassName:"max-w-[50ch]"}:i==="created_by"||i==="updated_by"?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx(Bt,{id:String(m),size:"xs"}):"—"},sortable:g,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:h=>{const m=h[i];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:g,cellClassName:"max-w-[200px]"}})}function Zt(n,e,s,c){const o=n||Xt(e,s);return o.some(d=>d.id==="actions")?o:Object.keys(c).length>0?[...o,Yt(c)]:o}function Ds(n){const e=ne.c(118),{connectionId:s,org:c,activeCollection:o}=n,l=o.name,r=o.schema??wt,d=o.hasCreateTool,f=o.hasUpdateTool,i=o.hasDeleteTool,u=at(),h=ct().location.href,{data:m}=dt.useSession(),x=m?.user?.id||"unknown",y=Nt(s),{org:v}=Ve();let N;e[0]!==s||e[1]!==v.id?(N={connectionId:s,orgId:v.id},e[0]=s,e[1]=v.id,e[2]=N):N=e[2];const p=tt(N),a=bt(s,l,p),b=`${s}-${l}`;let j;e[3]!==c||e[4]!==b?(j={namespace:c,resource:b,defaultSortKey:"updated_at"},e[3]=c,e[4]=b,e[5]=j):j=e[5];const{search:C,searchTerm:_,setSearch:D,viewMode:P,setViewMode:E,sortKey:A,sortDirection:I,handleSort:S}=xt(j);let M;e[6]!==_||e[7]!==I||e[8]!==A?(M={searchTerm:_,sortKey:A,sortDirection:I},e[6]=_,e[7]=I,e[8]=A,e[9]=M):M=e[9];const k=yt(s,l,p,M),z=!d&&!f&&!i;let T;e[10]!==l||e[11]!==s||e[12]!==u||e[13]!==c?(T=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:w.id}})},e[10]=l,e[11]=s,e[12]=u,e[13]=c,e[14]=T):T=e[14];const $=T;let O;e[15]!==a.create||e[16]!==x?(O=async w=>{const he=new Date().toISOString();await a.create.mutateAsync({...w,id:Ue("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[15]=a.create,e[16]=x,e[17]=O):O=e[17];const xe=O,[K,ge]=mt.useState(null);let le;e[18]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{ge(w)},e[18]=le):le=e[18];const ot=le;let U;e[19]!==$||e[20]!==f?(U=f&&{edit:$},e[19]=$,e[20]=f,e[21]=U):U=e[21];let L;e[22]!==xe||e[23]!==d?(L=d&&{duplicate:xe},e[22]=xe,e[23]=d,e[24]=L):L=e[24];let B;e[25]!==i?(B=i&&{delete:ot},e[25]=i,e[26]=B):B=e[26];let re;e[27]!==B||e[28]!==U||e[29]!==L?(re={...U,...L,...B},e[27]=B,e[28]=U,e[29]=L,e[30]=re):re=e[30];const je=re;let ae;e[31]!==a.delete||e[32]!==K?(ae=async()=>{K&&(await a.delete.mutateAsync(K.id),ge(null))},e[31]=a.delete,e[32]=K,e[33]=ae):ae=e[33];const Ce=ae;let ce;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==d||e[38]!==u||e[39]!==c||e[40]!==x?(ce=async()=>{if(!d){ft.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ue("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const ze=await a.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:c,connectionId:s,collectionName:l,itemId:ze.id}})}catch(ze){console.error("Failed to create item:",ze)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=d,e[38]=u,e[39]=c,e[40]=x,e[41]=ce):ce=e[41];const ve=ce;let de;e[42]!==r?(de=st(r),e[42]=r,e[43]=de):de=e[43];const be=de,Fe=(k?.length??0)>0,nt=d&&Fe,lt=d&&!Fe&&!C;let me;e[44]!==a.create||e[45]!==ve||e[46]!==d?(me=d?t.jsxs(ke,{onClick:ve,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=ve,e[46]=d,e[47]=me):me=e[47];const Ke=me,ye=A;let R;e[48]!==S||e[49]!==E||e[50]!==I||e[51]!==be||e[52]!==ye||e[53]!==P?(R=t.jsx(qe,{viewMode:P,onViewModeChange:E,sortKey:ye,sortDirection:I,onSort:S,sortOptions:be}),e[48]=S,e[49]=E,e[50]=I,e[51]=be,e[52]=ye,e[53]=P,e[54]=R):R=e[54];const Ne=`${l}s`,we=y?.icon??"grid_view";let V;e[55]!==Ne||e[56]!==we||e[57]!==h?(V=t.jsx(vt,{title:Ne,url:h,icon:we}),e[55]=Ne,e[56]=we,e[57]=h,e[58]=V):V=e[58];const Se=nt&&Ke;let q;e[59]!==R||e[60]!==V||e[61]!==Se?(q=t.jsxs(zt,{children:[R,V,Se]}),e[59]=R,e[60]=V,e[61]=Se,e[62]=q):q=e[62];const _e=`Search ${l}...`;let G;e[63]!==D?(G=w=>{w.key==="Escape"&&(D(""),w.target.blur())},e[63]=D,e[64]=G):G=e[64];let W;e[65]!==C||e[66]!==D||e[67]!==_e||e[68]!==G?(W=t.jsx(ut,{value:C,onChange:D,placeholder:_e,onKeyDown:G}),e[65]=C,e[66]=D,e[67]=_e,e[68]=G,e[69]=W):W=e[69];let H;e[70]!==k?(H=k??[],e[70]=k,e[71]=H):H=e[71];const De=A;let J;e[72]!==$?(J=w=>$(w),e[72]=$,e[73]=J):J=e[73];const Ae="No items found",Ie=C?"Try adjusting your search terms":"This collection doesn't have any items yet.",Pe=lt?Ke:void 0;let Q;e[74]!==Ae||e[75]!==Ie||e[76]!==Pe?(Q=t.jsx(ht,{image:null,title:Ae,description:Ie,actions:Pe}),e[74]=Ae,e[75]=Ie,e[76]=Pe,e[77]=Q):Q=e[77];let Y;e[78]!==S||e[79]!==z||e[80]!==je||e[81]!==r||e[82]!==C||e[83]!==D||e[84]!==E||e[85]!==I||e[86]!==H||e[87]!==De||e[88]!==J||e[89]!==Q||e[90]!==P?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(qt,{hideToolbar:!0,data:H,schema:r,viewMode:P,onViewModeChange:E,search:C,onSearchChange:D,sortKey:De,sortDirection:I,onSort:S,actions:je,onItemClick:J,readOnly:z,emptyState:Q})}),e[78]=S,e[79]=z,e[80]=je,e[81]=r,e[82]=C,e[83]=D,e[84]=E,e[85]=I,e[86]=H,e[87]=De,e[88]=J,e[89]=Q,e[90]=P,e[91]=Y):Y=e[91];let X;e[92]!==W||e[93]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[92]=W,e[93]=Y,e[94]=X):X=e[94];const Te=!!K;let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||ge(null)},e[95]=fe):fe=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Dt,{children:"Delete item?"}),e[96]=ue):ue=e[96];const $e=K?.title;let Z;e[97]!==$e?(Z=t.jsxs(At,{children:[ue,t.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[97]=$e,e[98]=Z):Z=e[98];let ee;e[99]!==a.delete.isPending?(ee=t.jsx(St,{disabled:a.delete.isPending,children:"Cancel"}),e[99]=a.delete.isPending,e[100]=ee):ee=e[100];const Ee=a.delete.isPending?"Deleting...":"Delete";let te;e[101]!==a.delete.isPending||e[102]!==Ce||e[103]!==Ee?(te=t.jsx(_t,{onClick:Ce,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[101]=a.delete.isPending,e[102]=Ce,e[103]=Ee,e[104]=te):te=e[104];let se;e[105]!==ee||e[106]!==te?(se=t.jsxs(Pt,{children:[ee,te]}),e[105]=ee,e[106]=te,e[107]=se):se=e[107];let ie;e[108]!==Z||e[109]!==se?(ie=t.jsxs(Tt,{children:[Z,se]}),e[108]=Z,e[109]=se,e[110]=ie):ie=e[110];let oe;e[111]!==Te||e[112]!==ie?(oe=t.jsx($t,{open:Te,onOpenChange:fe,children:ie}),e[111]=Te,e[112]=ie,e[113]=oe):oe=e[113];let pe;return e[114]!==q||e[115]!==X||e[116]!==oe?(pe=t.jsxs(t.Fragment,{children:[q,X,oe]}),e[114]=q,e[115]=X,e[116]=oe,e[117]=pe):pe=e[117],pe}export{Ds as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as o}from"./index-
|
|
1
|
+
import{c as g,j as o}from"./index-BTX95t7l.js";import{c as u}from"./button-BNEclrG2.js";import{n as T}from"./collection-display-button-Bv_XCGpu.js";import{i as $}from"./ArrowUp-PDh8aKqr.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./index-BTX95t7l.js";function t(){const{sessionId:n}=o({from:"/connect/$sessionId"});return typeof window<"u"&&(window.location.href=`https://hackathonantigravity.vercel.app/connect/${n}`),null}export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as s}from"./index-
|
|
1
|
+
import{c as S,j as s}from"./index-BTX95t7l.js";import{C as _}from"./card-kDbUMtCL.js";import{c as j}from"./button-BNEclrG2.js";import{I as A}from"./empty-state-Bnk561r4.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Q,j as o,f as H,bg as X,r as q,a as ce,u as ae,g as le,bq as me}from"./index-BTX95t7l.js";import{E as G,I as Y}from"./empty-state-Bnk561r4.js";import{E as Z}from"./error-boundary-CwJYCTYr.js";import{b as de}from"./use-binding-BM0mjywS.js";import{u as ue,S as pe}from"./index-CXM9c79w.js";import{f as fe}from"./use-collections-M-ZucrNc.js";import{u as J,a as he}from"./use-connection-B7MC5D37.js";import{u as xe}from"./constants-l6jfVkIP.js";import{b as ge,c as be}from"./use-mcp-prompts-Cwl3wuSJ.js";import{B as je}from"./button-BNEclrG2.js";import{R as ye}from"./resource-tabs-B4vVuVvd.js";import{i as ee}from"./Loading01-CopTTh4g.js";import{V as te,a as Se,b as Ce}from"./layout-DKHrwMN9.js";import{C as ve}from"./collection-tab-Eyar9Ax-.js";import{C as oe}from"./collection-display-button-Bv_XCGpu.js";import{C as se}from"./collection-search-ClAji_RX.js";import{C as ne}from"./collection-table-wrapper-BdCz63Jd.js";import{P as re}from"./pin-to-sidebar-button-CDjTUMWb.js";import{C as ie}from"./card-kDbUMtCL.js";import{R as Ne,T as Te}from"./tools-list-8U1et6rm.js";import"./binder-ku-JM_HB.js";import"./mcp-oauth-CrWnEeM3.js";import"./env-vars-editor-C22VVc0j.js";import"./input-Vw7XIX0r.js";import"./Plus-erQKhzFc.js";import"./Trash01-CSFSnmeR.js";import"./File06-BM3tW-ao.js";import"./Key01-8WmQn7uV.js";import"./badge-Blh93jrG.js";import"./dropdown-menu-B5X7QG53.js";import"./Grid01-CHS_jF02.js";import"./form-0ZBALKH0.js";import"./select-BJmQF-t1.js";import"./tooltip-Mf5UtuF2.js";import"./Check-DCOgSIim.js";import"./ChevronDown-B9uETHHQ.js";import"./extract-connection-data-CuvIF5Zc.js";import"./constants-Cp5o6xb6.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Dda0cOYu.js";import"./generate-id-Dyweu44Y.js";import"./CpuChip02-B0kuxhX5.js";import"./Terminal-nMH6minT.js";import"./use-virtual-mcp-TJpzrF0-.js";import"./index-DALSTBZ2.js";import"./index-DwgBtTXr.js";import"./index-DHqToqKZ.js";import"./X-C7jTJYwd.js";import"./monaco-editor-DcKPEfxo.js";import"./infiniteQueryObserver-DgpNxMlA.js";import"./spinner-DXcv41zw.js";import"./localstorage-keys-BpjSpnih.js";import"./useQuery-CnjlQpZk.js";import"./useMutation-BuhKRt0C.js";import"./popover-pmxV9P13.js";import"./Image01-5bkPZ70X.js";import"./SearchMd-CHkFEvMn.js";import"./dialog-cbRNFkUF.js";import"./AlertCircle-9_AbzfZV.js";import"./ArrowUp-PDh8aKqr.js";import"./Edit01-DHPNOaMT.js";import"./Copy01-C5lSJKpp.js";import"./use-create-virtual-mcp-mR4PpEB5.js";import"./ArrowLeft-2xAygwK8.js";import"./DotsVertical-qocOLS4A.js";import"./use-list-state-5iRHLEuj.js";import"./use-mobile-C3BU8S8_.js";import"./empty-state-DHhGwZ9F.js";import"./Inbox01-39gPJAMl.js";import"./avatar-BIPSK-nZ.js";import"./alert-dialog-JUSgghwR.js";import"./List-C7xsEmxx.js";import"./view-mode-toggle-C5CEe5h-.js";import"./use-organization-settings-Djf-qkBb.js";function we(t){const e=Q.c(42),{prompts:n,connectionId:s,org:r,connectionTitle:d,connectionIcon:l,onPromptClick:b,showToolbar:T,emptyMessage:E}=t,I=T===void 0?!0:T,R=E===void 0?"This connection doesn't have any prompts yet.":E,u=H(),x=X().location.href,[j,f]=q.useState(""),[g,i]=q.useState("table"),[p,w]=q.useState("name"),[m,D]=q.useState("asc");let V;e[0]!==m||e[1]!==p?(V=h=>{p===h?(D(_e),m==="desc"&&w(void 0)):(w(h),D("asc"))},e[0]=m,e[1]=p,e[2]=V):V=e[2];const v=V;let k;e[3]!==s||e[4]!==u||e[5]!==b||e[6]!==r?(k=h=>{b?b(h):s&&r&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:"prompts",itemId:encodeURIComponent(h.name)}})},e[3]=s,e[4]=u,e[5]=b,e[6]=r,e[7]=k):k=e[7];const _=k;let $;if(e[8]!==n||e[9]!==j||e[10]!==m||e[11]!==p){const h=!n||n.length===0?[]:j.trim()?(()=>{const K=j.toLowerCase();return n.filter(B=>B.name.toLowerCase().includes(K)||B.description&&B.description.toLowerCase().includes(K))})():n;$=!p||!m?h:[...h].sort((K,B)=>{const F=K[p]||"",U=B[p]||"",W=String(F).localeCompare(String(U));return m==="asc"?W:-W}),e[8]=n,e[9]=j,e[10]=m,e[11]=p,e[12]=$}else $=e[12];const N=$;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:ke,sortable:!0},{id:"description",header:"Description",render:Re,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const L=O;let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=L.filter(Ie).map($e),e[14]=a):a=e[14];const A=a;let y;e[15]!==l||e[16]!==d||e[17]!==v||e[18]!==I||e[19]!==m||e[20]!==p||e[21]!==x||e[22]!==g?(y=I&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:g,onViewModeChange:i,sortKey:p,sortDirection:m,onSort:v,sortOptions:A}),o.jsx(re,{title:d?`${d}: Prompts`:"Prompts",url:x,icon:l??"description"})]}),e[15]=l,e[16]=d,e[17]=v,e[18]=I,e[19]=m,e[20]=p,e[21]=x,e[22]=g,e[23]=y):y=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[24]=S):S=e[24];let C;e[25]!==j?(C=o.jsx(se,{value:j,onChange:f,placeholder:"Search prompts...",onKeyDown:S}),e[25]=j,e[26]=C):C=e[26];let c;e[27]!==R||e[28]!==_||e[29]!==v||e[30]!==j||e[31]!==m||e[32]!==p||e[33]!==N||e[34]!==g?(c=g==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(h=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>_(h),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:h.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h.description||"No description"})]})]})},h.name))})}):o.jsx(ne,{columns:L,data:N,isLoading:!1,sortKey:p,sortDirection:m,onSort:v,onRowClick:h=>_(h),emptyState:o.jsx(G,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":R})}),e[27]=R,e[28]=_,e[29]=v,e[30]=j,e[31]=m,e[32]=p,e[33]=N,e[34]=g,e[35]=c):c=e[35];let P;e[36]!==C||e[37]!==c?(P=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[C,c]}),e[36]=C,e[37]=c,e[38]=P):P=e[38];let M;return e[39]!==P||e[40]!==y?(M=o.jsxs(o.Fragment,{children:[y,P]}),e[39]=P,e[40]=y,e[41]=M):M=e[41],M}function $e(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ie(t){return t.sortable}function Re(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function ke(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function _e(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Le(t){const e=Q.c(6),{prompts:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(we,{prompts:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function Pe(t){const e=Q.c(2),{repository:n}=t;let s;return e[0]!==n?(s=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Ne,{repository:n})}),e[0]=n,e[1]=s):s=e[1],s}function Me(t){const e=Q.c(39),{resources:n,connectionTitle:s,connectionIcon:r,onResourceClick:d,showToolbar:l,emptyMessage:b}=t,T=l===void 0?!0:l,E=b===void 0?"This connection doesn't have any resources yet.":b,R=X().location.href,[u,z]=q.useState(""),[x,j]=q.useState("table"),[f,g]=q.useState("name"),[i,p]=q.useState("asc");let w;e[0]!==i||e[1]!==f?(w=c=>{f===c?(p(Ue),i==="desc"&&g(void 0)):(g(c),p("asc"))},e[0]=i,e[1]=f,e[2]=w):w=e[2];const m=w;let D;e[3]!==d?(D=c=>{d&&d(c)},e[3]=d,e[4]=D):D=e[4];const V=D;let v;if(e[5]!==n||e[6]!==u||e[7]!==i||e[8]!==f){const c=!n||n.length===0?[]:u.trim()?(()=>{const P=u.toLowerCase();return n.filter(M=>M.uri.toLowerCase().includes(P)||M.name&&M.name.toLowerCase().includes(P)||M.description&&M.description.toLowerCase().includes(P))})():n;v=!f||!i?c:[...c].sort((P,M)=>{const h=P[f]||"",K=M[f]||"",B=String(h).localeCompare(String(K));return i==="asc"?B:-B}),e[5]=n,e[6]=u,e[7]=i,e[8]=f,e[9]=v}else v=e[9];const k=v;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:Be,sortable:!0},{id:"uri",header:"URI",render:Oe,sortable:!0},{id:"description",header:"Description",render:De,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ee,sortable:!0}],e[10]=_):_=e[10];const $=_;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=$.filter(Ae).map(Ve),e[11]=N):N=e[11];const O=N;let L;e[12]!==r||e[13]!==s||e[14]!==m||e[15]!==T||e[16]!==i||e[17]!==f||e[18]!==R||e[19]!==x?(L=T&&o.jsxs(te,{children:[o.jsx(oe,{viewMode:x,onViewModeChange:j,sortKey:f,sortDirection:i,onSort:m,sortOptions:O}),o.jsx(re,{title:s?`${s}: Resources`:"Resources",url:R,icon:r??"folder"})]}),e[12]=r,e[13]=s,e[14]=m,e[15]=T,e[16]=i,e[17]=f,e[18]=R,e[19]=x,e[20]=L):L=e[20];let a;e[21]===Symbol.for("react.memo_cache_sentinel")?(a=c=>{c.key==="Escape"&&(z(""),c.target.blur())},e[21]=a):a=e[21];let A;e[22]!==u?(A=o.jsx(se,{value:u,onChange:z,placeholder:"Search resources...",onKeyDown:a}),e[22]=u,e[23]=A):A=e[23];let y;e[24]!==E||e[25]!==V||e[26]!==m||e[27]!==u||e[28]!==i||e[29]!==f||e[30]!==k||e[31]!==x?(y=x==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(c=>o.jsx(ie,{className:"cursor-pointer transition-colors",onClick:()=>V(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(Y,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(ne,{columns:$,data:k,isLoading:!1,sortKey:f,sortDirection:i,onSort:m,onRowClick:c=>V(c),emptyState:o.jsx(G,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":E})}),e[24]=E,e[25]=V,e[26]=m,e[27]=u,e[28]=i,e[29]=f,e[30]=k,e[31]=x,e[32]=y):y=e[32];let S;e[33]!==A||e[34]!==y?(S=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[A,y]}),e[33]=A,e[34]=y,e[35]=S):S=e[35];let C;return e[36]!==S||e[37]!==L?(C=o.jsxs(o.Fragment,{children:[L,S]}),e[36]=S,e[37]=L,e[38]=C):C=e[38],C}function Ve(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ae(t){return t.sortable}function Ee(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function De(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Oe(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Be(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ue(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Ke(t){const e=Q.c(6),{resources:n,connectionId:s,org:r}=t,d=J(s),l=d?.title,b=d?.icon;let T;return e[0]!==s||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==b?(T=o.jsx(Me,{resources:n,connectionId:s,org:r,connectionTitle:l,connectionIcon:b}),e[0]=s,e[1]=r,e[2]=n,e[3]=l,e[4]=b,e[5]=T):T=e[5],T}function ze(t){const e=Q.c(5),{tools:n,connectionId:s,org:r,isLoading:d}=t;let l;return e[0]!==s||e[1]!==d||e[2]!==r||e[3]!==n?(l=o.jsx(Te,{tools:n,connectionId:s,org:r,isLoading:d}),e[0]=s,e[1]=d,e[2]=r,e[3]=n,e[4]=l):l=e[4],l}function qe(t){const e=Q.c(66),{connection:n,connectionId:s,org:r,requestedTabId:d,collections:l,onUpdate:b,isUpdating:T,prompts:E,resources:I,tools:R,isLoadingTools:u}=t,z=me();let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/$org/mcps/$connectionId"},e[0]=x):x=e[0];const j=H(x);let f;e[1]!==s?(f={connectionId:s},e[1]=s,e[2]=f):f=e[2];const g=ue(f),i=g.isAuthenticated,p=n?.metadata?.repository,w=!!p?.url,m=R.length,D=E.length,V=I.length,v=m>0||u;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let _;e[4]!==u||e[5]!==i||e[6]!==v||e[7]!==m?(_=i&&v?[{id:"tools",label:"Tools",count:u?void 0:m}]:[],e[4]=u,e[5]=i,e[6]=v,e[7]=m,e[8]=_):_=e[8];let $;e[9]!==i||e[10]!==D?($=i&&D>0?[{id:"prompts",label:"Prompts",count:D}]:[],e[9]=i,e[10]=D,e[11]=$):$=e[11];let N;e[12]!==i||e[13]!==V?(N=i&&V>0?[{id:"resources",label:"Resources",count:V}]:[],e[12]=i,e[13]=V,e[14]=N):N=e[14];let O;if(e[15]!==l||e[16]!==w||e[17]!==i||e[18]!==_||e[19]!==$||e[20]!==N){let U;e[22]!==w?(U=w?[{id:"readme",label:"README"}]:[],e[22]=w,e[23]=U):U=e[23],O=[k,..._,...$,...N,...i?(l||[]).map(Qe):[],...U],e[15]=l,e[16]=w,e[17]=i,e[18]=_,e[19]=$,e[20]=N,e[21]=O}else O=e[21];const L=O,a=L.some(U=>U.id===d)?d:"settings";let A;e[24]!==j?(A=U=>{j({search:W=>({...W,tab:U}),replace:!0})},e[24]=j,e[25]=A):A=e[25];const y=A;let S;e[26]!==l?(S=l||[],e[26]=l,e[27]=S):S=e[27];let C;if(e[28]!==a||e[29]!==S){let U;e[31]!==a?(U=W=>W.name===a,e[31]=a,e[32]=U):U=e[32],C=S.find(U),e[28]=a,e[29]=S,e[30]=C}else C=e[30];const c=C;let P;e[33]!==z.history?(P=()=>z.history.back(),e[33]=z.history,e[34]=P):P=e[34];let M;e[35]!==a||e[36]!==y||e[37]!==L?(M=o.jsx(Se,{children:o.jsx(ye,{tabs:L,activeTab:a,onTabChange:y})}),e[35]=a,e[36]=y,e[37]=L,e[38]=M):M=e[38];let h;e[39]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[39]=h):h=e[39];let K;e[40]!==c||e[41]!==a||e[42]!==g.hasOAuthToken||e[43]!==g.isServerError||e[44]!==g.supportsOAuth||e[45]!==n||e[46]!==s||e[47]!==y||e[48]!==w||e[49]!==u||e[50]!==i||e[51]!==T||e[52]!==b||e[53]!==r||e[54]!==E||e[55]!==p||e[56]!==I||e[57]!==R?(K=o.jsx(q.Suspense,{fallback:h,children:a==="tools"?o.jsx(ze,{tools:R,connectionId:s,org:r,isLoading:u}):a==="prompts"?o.jsx(Le,{prompts:E,connectionId:s,org:r}):a==="resources"?o.jsx(Ke,{resources:I,connectionId:s,org:r}):a==="settings"?o.jsx(pe,{connection:n,onUpdate:b,isUpdating:T,isMCPAuthenticated:i,supportsOAuth:g.supportsOAuth,hasOAuthToken:g.hasOAuthToken,isServerError:g.isServerError,onViewReadme:w?()=>y("readme"):void 0}):a==="readme"&&w?o.jsx(Pe,{repository:p}):c&&i?o.jsx(ve,{connectionId:s,org:r,activeCollection:c},a):o.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[40]=c,e[41]=a,e[42]=g.hasOAuthToken,e[43]=g.isServerError,e[44]=g.supportsOAuth,e[45]=n,e[46]=s,e[47]=y,e[48]=w,e[49]=u,e[50]=i,e[51]=T,e[52]=b,e[53]=r,e[54]=E,e[55]=p,e[56]=I,e[57]=R,e[58]=K):K=e[58];let B;e[59]!==a||e[60]!==K?(B=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Z,{children:K},a)})}),e[59]=a,e[60]=K,e[61]=B):B=e[61];let F;return e[62]!==P||e[63]!==M||e[64]!==B?(F=o.jsxs(Ce,{onBack:P,children:[M,B]}),e[62]=P,e[63]=M,e[64]=B,e[65]=F):F=e[65],F}function Qe(t){return{id:t.name,label:t.displayName}}function Fe(){const t=Q.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const n=H(e);let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/mcps/$connectionId"},t[1]=s):s=t[1];const{connectionId:r,org:d}=ce(s),{org:l}=ae();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/shell/$org/mcps/$connectionId"},t[2]=b):b=t[2];const E=le(b).tab||"settings",I=J(r),R=he(),u=de(I??void 0);let z;t[3]!==r||t[4]!==l.id?(z={connectionId:r,orgId:l.id},t[3]=r,t[4]=l.id,t[5]=z):z=t[5];const x=xe(z);let j;t[6]!==x?(j={client:x},t[6]=x,t[7]=j):j=t[7];const{data:f}=ge(j);let g;t[8]!==x?(g={client:x},t[8]=x,t[9]=g):g=t[9];const{data:i}=be(g),p=I?.tools&&I.tools.length>0,w=!p;let m;t[10]!==x||t[11]!==w?(m={client:x,enabled:w},t[10]=x,t[11]=w,t[12]=m):m=t[12];const{data:D,isLoading:V}=fe(m);let v;t[13]!==f?.prompts?(v=f?.prompts??[],t[13]=f?.prompts,t[14]=v):v=t[14];let k;t[15]!==v?(k=v.map(He),t[15]=v,t[16]=k):k=t[16];const _=k;let $;t[17]!==i?.resources?($=i?.resources??[],t[17]=i?.resources,t[18]=$):$=t[18];let N;t[19]!==$?(N=$.map(Ge),t[19]=$,t[20]=N):N=t[20];const O=N;let L;t[21]!==I||t[22]!==p||t[23]!==D?.tools?(L=p?I.tools??[]:(D?.tools??[]).map(We),t[21]=I,t[22]=p,t[23]=D?.tools,t[24]=L):L=t[24];const a=L;let A;t[25]!==R.update||t[26]!==r?(A=async C=>{await R.update.mutateAsync({id:r,data:C})},t[25]=R.update,t[26]=r,t[27]=A):A=t[27];const y=A;if(!I){let C;return t[28]!==n||t[29]!==d?(C=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(je,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:d}}),children:"Back to connections"})})}),t[28]=n,t[29]=d,t[30]=C):C=t[30],C}let S;return t[31]!==R.update.isPending||t[32]!==u||t[33]!==I||t[34]!==r||t[35]!==y||t[36]!==V||t[37]!==d||t[38]!==_||t[39]!==E||t[40]!==O||t[41]!==a?(S=o.jsx(qe,{org:d,connection:I,connectionId:r,requestedTabId:E,collections:u,onUpdate:y,isUpdating:R.update.isPending,prompts:_,resources:O,tools:a,isLoadingTools:V}),t[31]=R.update.isPending,t[32]=u,t[33]=I,t[34]=r,t[35]=y,t[36]=V,t[37]=d,t[38]=_,t[39]=E,t[40]=O,t[41]=a,t[42]=S):S=t[42],S}function We(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Ge(t){return{uri:t.uri,name:t.name,description:t.description}}function He(t){return{name:t.name,description:t.description}}function Je(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Z,{children:o.jsx(q.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(Fe,{})})}),t[0]=e):e=t[0],e}function bo(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Je,{}),t[0]=e):e=t[0],e}export{bo as default};
|