@decocms/mesh 1.0.0-alpha.4 → 1.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/client/assets/{alert-dialog-BvyEfL2D.js → alert-dialog-pYV3wSPs.js} +2 -2
  2. package/dist/client/assets/{auth-CYg5mzvi.js → auth-D1xg1rd7.js} +1 -1
  3. package/dist/client/assets/{auth-catchall-BBilN1Dc.js → auth-catchall-BZaDWHEa.js} +1 -1
  4. package/dist/client/assets/{avatar-UcUmG598.js → avatar-DAMcOnM4.js} +1 -1
  5. package/dist/client/assets/{badge-DO3BPtZ-.js → badge-Bi_GpkO_.js} +1 -1
  6. package/dist/client/assets/{button-BeTb9YZU.js → button-G3aMPyFq.js} +1 -1
  7. package/dist/client/assets/{card-DFBJ_uBy.js → card-CE1-D3SY.js} +1 -1
  8. package/dist/client/assets/{checkbox-Ep63AJ5F.js → checkbox-DgaTW36u.js} +1 -1
  9. package/dist/client/assets/{circle-alert-BjmT_0vz.js → circle-alert-B9wPiUFk.js} +1 -1
  10. package/dist/client/assets/{collection-detail-sG8EIVfm.js → collection-detail-Bj_y2m-h.js} +1 -1
  11. package/dist/client/assets/{collection-display-button-DE8BFxrp.js → collection-display-button-BOWw7rwa.js} +1 -1
  12. package/dist/client/assets/{collection-header-DNBGdgEG.js → collection-header-BeSLFcaG.js} +1 -1
  13. package/dist/client/assets/{collection-page-DwBYqm_T.js → collection-page-C_ScBEek.js} +1 -1
  14. package/dist/client/assets/{collection-search-C3auuf0Y.js → collection-search-DFSSOoxU.js} +1 -1
  15. package/dist/client/assets/{collection-table-wrapper-z4CuwV_C.js → collection-table-wrapper-CKt7U95e.js} +1 -1
  16. package/dist/client/assets/{connection-card-BbhdU3sl.js → connection-card-Bj0wmYgV.js} +1 -1
  17. package/dist/client/assets/{connection-detail-DfywFkvi.js → connection-detail-kWSPNag3.js} +1 -1
  18. package/dist/client/assets/{connections-DgCJgxmU.js → connections-C7HPEBbQ.js} +1 -1
  19. package/dist/client/assets/{create-organization-dialog-Bde9CI-n.js → create-organization-dialog-BpSaszPg.js} +1 -1
  20. package/dist/client/assets/{dialog-BT08DzpN.js → dialog-C1eFYVPZ.js} +1 -1
  21. package/dist/client/assets/{dropdown-menu-DsWv8lkW.js → dropdown-menu-CtSLEdvQ.js} +1 -1
  22. package/dist/client/assets/{empty-state-DCGHu7Ht.js → empty-state-YCqZyamY.js} +1 -1
  23. package/dist/client/assets/{error-boundary-dk0EDCPp.js → error-boundary-9CuK9oWa.js} +1 -1
  24. package/dist/client/assets/{extract-connection-data-DrneYG29.js → extract-connection-data-Cu9jjhV-.js} +1 -1
  25. package/dist/client/assets/{form-BmmDx2Hv.js → form-BsxjQn2d.js} +1 -1
  26. package/dist/client/assets/{gateway-detail-DlujL-fA.js → gateway-detail-C5d-KPPl.js} +1 -1
  27. package/dist/client/assets/{gateways-C0s_xtLd.js → gateways-BSgfG0sP.js} +1 -1
  28. package/dist/client/assets/{home-BUeYyp--.js → home-Bu1wH9nU.js} +1 -1
  29. package/dist/client/assets/{icon-HmCDqOPd.js → icon-Cxep_tfx.js} +1 -1
  30. package/dist/client/assets/{index-BrYbjxXv.js → index-BRGTweKk.js} +1 -1
  31. package/dist/client/assets/{index-BMEwImqy.js → index-Bhg5-H1t.js} +1 -1
  32. package/dist/client/assets/{index-DmUDvTrM.js → index-BtenH3n7.js} +1 -1
  33. package/dist/client/assets/{index-CxSCpakB.js → index-MoI-rvC3.js} +15 -15
  34. package/dist/client/assets/{index-Dt9jPzUp.js → index-fqd6S2iW.js} +1 -1
  35. package/dist/client/assets/{input-NL8_dTk4.js → input-CXe38a5R.js} +1 -1
  36. package/dist/client/assets/{integration-icon-B5ZzeehM.js → integration-icon-C162QlgN.js} +1 -1
  37. package/dist/client/assets/{layout-CKQw59Ep.js → layout-DqgJyIdL.js} +1 -1
  38. package/dist/client/assets/{lazy-highlighter-DOxi3dm5.js → lazy-highlighter-DdBDXFu3.js} +1 -1
  39. package/dist/client/assets/{localstorage-keys-CT9IjLo2.js → localstorage-keys-CzubTFSO.js} +1 -1
  40. package/dist/client/assets/{login-CVO6DM5O.js → login-CTfLDBBt.js} +1 -1
  41. package/dist/client/assets/{members-DloLkRIF.js → members-B8JX8n6Q.js} +1 -1
  42. package/dist/client/assets/{monitoring-BzP-NKj7.js → monitoring-D7cSD8lu.js} +1 -1
  43. package/dist/client/assets/{monitoring-stats-row-D3nSXKWj.js → monitoring-stats-row-CX3aDsAR.js} +1 -1
  44. package/dist/client/assets/{oauth-callback-CNapBDIq.js → oauth-callback-BSpJjtnq.js} +1 -1
  45. package/dist/client/assets/{page-CYEiDnba.js → page-DEl_xdLR.js} +1 -1
  46. package/dist/client/assets/{popover-Dqhqu57Q.js → popover-iDiv_aJK.js} +1 -1
  47. package/dist/client/assets/{prism-BM0Im-Yv.js → prism-vdds-nIT.js} +1 -1
  48. package/dist/client/assets/{resource-tabs-Cyi6PwbN.js → resource-tabs-CNxf_u1f.js} +1 -1
  49. package/dist/client/assets/{schema-DlhuekEX.js → schema-BJ2fRDqu.js} +1 -1
  50. package/dist/client/assets/{select-BOj5RERj.js → select-B4j1Cb8E.js} +1 -1
  51. package/dist/client/assets/{settings-C_okskGZ.js → settings-CJre-VTk.js} +1 -1
  52. package/dist/client/assets/{shell-layout-DWIG-gbq.js → shell-layout-BqISuLuR.js} +3 -3
  53. package/dist/client/assets/{spinner-wv31KLi9.js → spinner-BgjBycmB.js} +1 -1
  54. package/dist/client/assets/{store-Czna7Dgw.js → store-CL6xQwes.js} +1 -1
  55. package/dist/client/assets/{store-app-detail-Kn0xLpzy.js → store-app-detail-BqHjNu0f.js} +1 -1
  56. package/dist/client/assets/{textarea-DAuZp-vs.js → textarea-BK0_vna7.js} +1 -1
  57. package/dist/client/assets/{tool-set-selector-BYF6NlFy.js → tool-set-selector-DYpFtHWh.js} +1 -1
  58. package/dist/client/assets/{tooltip-BKoAX5gw.js → tooltip-CyReuecv.js} +1 -1
  59. package/dist/client/assets/{upload-DnaQ_f0x.js → upload-n_AaBb-Z.js} +1 -1
  60. package/dist/client/assets/{use-binding-BfGhaGVE.js → use-binding-DdwHCRqV.js} +1 -1
  61. package/dist/client/assets/{use-connection-v-w_yxra.js → use-connection-DiHU9E79.js} +1 -1
  62. package/dist/client/assets/{use-gateway-gKeEvLRE.js → use-gateway-B9o1M04u.js} +1 -1
  63. package/dist/client/assets/{use-list-state-j-4cxeBJ.js → use-list-state-CKwEYaZT.js} +1 -1
  64. package/dist/client/assets/{use-members-C80sliR8.js → use-members-BH0kTiC2.js} +1 -1
  65. package/dist/client/assets/{use-mobile-BXGgFxUH.js → use-mobile-BjUr6Jaq.js} +1 -1
  66. package/dist/client/assets/{use-organization-settings-ClRwCrjK.js → use-organization-settings-Cywci2R8.js} +1 -1
  67. package/dist/client/assets/{use-tool-call-CqAWykKA.js → use-tool-call-CPpXYXAZ.js} +1 -1
  68. package/dist/client/assets/useQuery-BpCQj7wy.js +1 -0
  69. package/dist/client/assets/utils-BLlwSV8I.js +1 -0
  70. package/dist/client/index.html +1 -1
  71. package/dist/server/cli.js +163 -163
  72. package/dist/server/migrate.js +1 -1
  73. package/dist/server/server.js +158 -158
  74. package/package.json +1 -1
  75. package/dist/client/assets/useQuery-CkIva3b0.js +0 -1
  76. package/dist/client/assets/utils-BGgJIaEU.js +0 -1
@@ -1 +1 @@
1
- import{a_ as D,a$ as O,b0 as F,b1 as z,b2 as B,b3 as V,c as T,j as s,r as $,a5 as Q,a2 as U,a as W,b4 as H,ao as G}from"./index-CxSCpakB.js";import{g as Y,a as q}from"./well-known-mcp-Dq2j3ucM.js";import{C as J}from"./collection-header-DNBGdgEG.js";import{a as Z,c as X,d as K,b as ee}from"./use-connection-v-w_yxra.js";import{a as te,T as se,b as ie,u as _}from"./tooltip-BKoAX5gw.js";import{e as ne,s as re}from"./app-name-DQPOjnhR.js";import{I as E}from"./icon-HmCDqOPd.js";import{C as le}from"./collection-search-C3auuf0Y.js";import{C as ae}from"./card-DFBJ_uBy.js";import{I as oe}from"./integration-icon-B5ZzeehM.js";import{g as ce,f as de,a as me}from"./registry-utils-ulDDT0d8.js";import{d as fe,a as ue,S as he,b as xe,c as pe}from"./select-BOj5RERj.js";import{C as ge}from"./connection-card-BbhdU3sl.js";import{B as ve}from"./button-BeTb9YZU.js";import{E as je}from"./empty-state-DCGHu7Ht.js";import{a as Ne}from"./use-binding-BfGhaGVE.js";import{L as ye,u as Ce}from"./localstorage-keys-CT9IjLo2.js";import"./collection-display-button-DE8BFxrp.js";import"./dropdown-menu-DsWv8lkW.js";import"./utils-BGgJIaEU.js";import"./input-NL8_dTk4.js";import"./badge-DO3BPtZ-.js";import"./auth-CYg5mzvi.js";import"./useQuery-CkIva3b0.js";var we=class extends D{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:O()})}getOptimisticResult(t){return t.behavior=O(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:r}=t,c=super.createResult(t,e),{isFetching:n,isRefetching:u,isError:o,isRefetchError:d}=c,l=r.fetchMeta?.fetchMore?.direction,i=o&&l==="forward",a=n&&l==="forward",m=o&&l==="backward",h=n&&l==="backward";return{...c,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:z(e,r.data),hasPreviousPage:F(e,r.data),isFetchNextPageError:i,isFetchingNextPage:a,isFetchPreviousPageError:m,isFetchingPreviousPage:h,isRefetchError:d&&!i&&!m,isRefetching:u&&!a&&!h}}};function be(t,e){return B({...t,enabled:!0,suspense:!0,throwOnError:V},we,e)}function Se(t){const e=t.title||t.server.title||t.id||"Unnamed Item",r=t.server.description||null,c=t.server.icons?.[0]?.src||ce(t.server.repository)||null,n=t._meta?.["mcp.mesh"]?.verified??!1,u=t.server.version,d=(t.server.remotes?.length??0)>0;let l=e,i=null;if(e.includes("/")){const a=e.split("/");a.length>=2&&(i=a[0]||null,l=ne(e))}if(!i){const a=t._meta?.["mcp.mesh"]?.scopeName,m=t._meta?.["mcp.mesh"]?.appName;a&&m?i=`${a}/${m}`:a&&(i=a)}return{icon:c,scopeName:i,displayName:l,description:r,version:u||null,isVerified:n,canInstall:d}}function Pe(t){const e=T.c(45),{icon:r,scopeName:c,displayName:n,description:u,version:o,isVerified:d,canInstall:l,onClick:i}=t;let a;e[0]!==n||e[1]!==r?(a=s.jsx(oe,{icon:r,name:n,size:"md",className:"shadow-sm"}),e[0]=n,e[1]=r,e[2]=a):a=e[2];let m;e[3]!==n?(m=s.jsx("span",{className:"truncate",children:n}),e[3]=n,e[4]=m):m=e[4];let h;e[5]!==d?(h=d&&s.jsx(E,{name:"verified",size:16,className:"text-success shrink-0"}),e[5]=d,e[6]=h):h=e[6];let p;e[7]!==l?(p=!l&&s.jsx(E,{name:"lock",size:16,className:"text-muted-foreground shrink-0",title:"This MCP Server cannot be connected"}),e[7]=l,e[8]=p):p=e[8];let f;e[9]!==m||e[10]!==h||e[11]!==p?(f=s.jsx(te,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-semibold min-w-0",children:[m,h,p]})}),e[9]=m,e[10]=h,e[11]=p,e[12]=f):f=e[12];let v;e[13]!==n?(v=s.jsx("p",{children:n}),e[13]=n,e[14]=v):v=e[14];let j;e[15]!==l?(j=!l&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=l,e[16]=j):j=e[16];let N;e[17]!==v||e[18]!==j?(N=s.jsxs(se,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=N):N=e[19];let S;e[20]!==f||e[21]!==N?(S=s.jsxs(ie,{children:[f,N]}),e[20]=f,e[21]=N,e[22]=S):S=e[22];let y;e[23]!==c?(y=c&&s.jsx("span",{className:"truncate",children:c}),e[23]=c,e[24]=y):y=e[24];let P;e[25]!==c||e[26]!==o?(P=o&&s.jsxs(s.Fragment,{children:[c&&s.jsx("span",{children:"•"}),s.jsxs("span",{className:"shrink-0",children:["v",o]})]}),e[25]=c,e[26]=o,e[27]=P):P=e[27];let R;e[28]!==y||e[29]!==P?(R=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[y,P]}),e[28]=y,e[29]=P,e[30]=R):R=e[30];let w;e[31]!==R||e[32]!==S?(w=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[S,R]})}),e[31]=R,e[32]=S,e[33]=w):w=e[33];let x;e[34]!==a||e[35]!==w?(x=s.jsxs("div",{className:"flex gap-3",children:[a,w]}),e[34]=a,e[35]=w,e[36]=x):x=e[36];const b=u||"No description available";let I;e[37]!==b?(I=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-base text-muted-foreground line-clamp-2",children:b})}),e[37]=b,e[38]=I):I=e[38];let k;e[39]!==x||e[40]!==I?(k=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[x,I]}),e[39]=x,e[40]=I,e[41]=k):k=e[41];let C;return e[42]!==i||e[43]!==k?(C=s.jsx(ae,{className:"p-6 cursor-pointer hover:shadow-md transition-shadow",onClick:i,children:k}),e[42]=i,e[43]=k,e[44]=C):C=e[44],C}function A(t){const e=T.c(12),{items:r,title:c,onItemClick:n}=t;if(r.length===0)return null;let u;e[0]!==c?(u=c&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:c})}),e[0]=c,e[1]=u):u=e[1];let o;if(e[2]!==r||e[3]!==n){let i;e[5]!==n?(i=a=>{const m=Se(a);return s.jsx(Pe,{...m,onClick:()=>n(a)},a.id)},e[5]=n,e[6]=i):i=e[6],o=r.map(i),e[2]=r,e[3]=n,e[4]=o}else o=e[4];let d;e[7]!==o?(d=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=d):d=e[8];let l;return e[9]!==u||e[10]!==d?(l=s.jsxs("div",{className:"flex flex-col gap-4",children:[u,d]}),e[9]=u,e[10]=d,e[11]=l):l=e[11],l}function Re(t,e){if(!e)return t;const r=e.toLowerCase();return t.filter(c=>(c.name||c.title||"").toLowerCase().includes(r)||(c.description||c.server.description||"").toLowerCase().includes(r))}function Ie(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function ke(t){const e=T.c(32),{items:r,isLoadingMore:c,registryId:n,hasMore:u,onLoadMore:o}=t,d=c===void 0?!1:c,l=u===void 0?!1:u,[i,a]=$.useState(""),m=Q(),{org:h}=_(),p=$.useRef(null);let f,v,j;e[0]!==r||e[1]!==i?(f=Re(r,i),j=f.filter(Ie),v=f.filter(C=>!j.find(g=>g.id===C.id)),e[0]=r,e[1]=i,e[2]=f,e[3]=v,e[4]=j):(f=e[2],v=e[3],j=e[4]);const N=v;let S;e[5]!==m||e[6]!==h.slug||e[7]!==n?(S=C=>{const g=re(C.name||C.title||C.server.title||""),M=C.server.name;m({to:"/$org/store/$appName",params:{org:h.slug,appName:g},search:{registryId:n,serverName:M}})},e[5]=m,e[6]=h.slug,e[7]=n,e[8]=S):S=e[8];const y=S;let P;e[9]!==l||e[10]!==d||e[11]!==o||e[12]!==i?(P=C=>{if(!l||!o||i||d)return;const g=C.currentTarget;g.scrollHeight-g.scrollTop-g.clientHeight<200&&o()},e[9]=l,e[10]=d,e[11]=o,e[12]=i,e[13]=P):P=e[13];const R=P;let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=C=>{C.key==="Enter"&&a(C.currentTarget.value)},e[14]=w):w=e[14];let x;e[15]!==i?(x=s.jsx(le,{value:i,onChange:a,placeholder:"Search for an MCP Server...",onKeyDown:w}),e[15]=i,e[16]=x):x=e[16];let b;e[17]!==N||e[18]!==f||e[19]!==y||e[20]!==l||e[21]!==d||e[22]!==r.length||e[23]!==i||e[24]!==j?(b=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:r.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(E,{name:"inbox",size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):i&&f.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(E,{name:"search",size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[j.length>0&&s.jsx(A,{items:j,title:"Verified",onItemClick:y}),N.length>0&&s.jsx(A,{items:N,title:j.length>0?"All":"",onItemClick:y}),l&&!i&&d&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(E,{name:"progress_activity",size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=N,e[18]=f,e[19]=y,e[20]=l,e[21]=d,e[22]=r.length,e[23]=i,e[24]=j,e[25]=b):b=e[25];let I;e[26]!==R||e[27]!==b?(I=s.jsx("div",{ref:p,className:"flex-1 overflow-y-auto",onScroll:R,children:b}),e[26]=R,e[27]=b,e[28]=I):I=e[28];let k;return e[29]!==x||e[30]!==I?(k=s.jsxs("div",{className:"flex flex-col h-full",children:[x,I]}),e[29]=x,e[30]=I,e[31]=k):k=e[31],k}const L=24;function Ee(t){const e=T.c(27),{registryId:r}=t,c=Z(r);let n,u,o,d;if(e[0]!==c?.tools||e[1]!==r){if(n=de(c?.tools),!n)throw new Error("This registry does not support listing store items.");let x;e[6]!==r?(x=X(r),e[6]=r,e[7]=x):x=e[7],d=x,o=be,u=U.toolCall(r,n,JSON.stringify({limit:L})),e[0]=c?.tools,e[1]=r,e[2]=n,e[3]=u,e[4]=o,e[5]=d}else n=e[2],u=e[3],o=e[4],d=e[5];let l;e[8]!==n||e[9]!==d?(l=async x=>{const{pageParam:b}=x;return await d(n,b?{cursor:b,limit:L}:{limit:L})},e[8]=n,e[9]=d,e[10]=l):l=e[10];let i;e[11]!==u||e[12]!==l?(i={queryKey:u,queryFn:l,initialPageParam:void 0,getNextPageParam:Te,staleTime:36e5},e[11]=u,e[12]=l,e[13]=i):i=e[13];const{data:a,fetchNextPage:m,hasNextPage:h,isFetchingNextPage:p}=o(i);let f;e:{if(!a?.pages||a.pages.length===0){f=null;break e}const x=a.pages[0];if(typeof x=="object"&&x!==null&&"totalCount"in x&&typeof x.totalCount=="number"){f=x.totalCount;break e}f=null}const v=f,j=a?.pages;let N;e[14]!==j?(N=me(j),e[14]=j,e[15]=N):N=e[15];const S=N;let y;e[16]!==m||e[17]!==h||e[18]!==p?(y=()=>{h&&!p&&m()},e[16]=m,e[17]=h,e[18]=p,e[19]=y):y=e[19];const P=y,R=h??!1;let w;return e[20]!==S||e[21]!==P||e[22]!==p||e[23]!==r||e[24]!==R||e[25]!==v?(w=s.jsx(ke,{items:S,isLoadingMore:p,registryId:r,hasMore:R,onLoadMore:P,totalCount:v}),e[20]=S,e[21]=P,e[22]=p,e[23]=r,e[24]=R,e[25]=v,e[26]=w):w=e[26],w}function Te(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Me(t){const e=T.c(15),{registries:r,value:c,onValueChange:n,onAddWellKnown:u,wellKnownRegistries:o,placeholder:d}=t,l=d===void 0?"Select a registry...":d;let i;e[0]!==l?(i=s.jsx(ue,{className:"w-[200px] h-8!",children:s.jsx(he,{placeholder:l})}),e[0]=l,e[1]=i):i=e[1];let a;e[2]!==r?(a=r.map(Le),e[2]=r,e[3]=a):a=e[3];let m;e[4]!==u||e[5]!==o?(m=o.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(f=>s.jsxs("button",{onClick:v=>{v.preventDefault(),v.stopPropagation(),u(f)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[f.icon?s.jsx("img",{src:f.icon,alt:f.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(E,{name:"add",size:16})})]},f.id??f.title))]}),e[4]=u,e[5]=o,e[6]=m):m=e[6];let h;e[7]!==a||e[8]!==m?(h=s.jsxs(xe,{children:[a,m]}),e[7]=a,e[8]=m,e[9]=h):h=e[9];let p;return e[10]!==n||e[11]!==i||e[12]!==h||e[13]!==c?(p=s.jsxs(pe,{value:c,onValueChange:n,children:[i,h]}),e[10]=n,e[11]=i,e[12]=h,e[13]=c,e[14]=p):p=e[14],p}function Le(t){return s.jsx(fe,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function $e(t){const e=T.c(8),{registries:r,onConnected:c}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:423,height:279,className:"max-w-full h-auto"}),e[0]=n):n=e[0];let u;if(e[1]!==c||e[2]!==r){let d;e[4]!==c?(d=(l,i)=>{const a=l.id??`registry-${i}`;return s.jsx(_e,{registry:{...l,id:a},onConnected:c},a)},e[4]=c,e[5]=d):d=e[5],u=r.map(d),e[1]=c,e[2]=r,e[3]=u}else u=e[3];let o;return e[6]!==u?(o=s.jsx(je,{image:n,title:"Connect to a store",description:"Choose a registry to discover and connect MCP Servers from the community.",descriptionClassName:"max-w-[500px]",actionsClassName:"w-full max-w-2xl",actions:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full",children:u})}),e[6]=u,e[7]=o):o=e[7],o}function _e(t){const e=T.c(15),{registry:r,onConnected:c}=t,n=K(),{org:u}=_(),{data:o}=W.useSession(),d=!!u&&!!o?.user?.id;let l;e[0]!==n.create||e[1]!==d||e[2]!==c||e[3]!==r?(l=async()=>{if(!d)return;const f=await n.create.mutateAsync(r);c?.(f.id)},e[0]=n.create,e[1]=d,e[2]=c,e[3]=r,e[4]=l):l=e[4];const i=l,a=!d||n.create.isPending;let m;e[5]!==n.create.isPending?(m=n.create.isPending?s.jsxs(s.Fragment,{children:[s.jsx(E,{name:"progress_activity",className:"animate-spin"}),"Connecting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(E,{name:"add"}),"Connect"]}),e[5]=n.create.isPending,e[6]=m):m=e[6];let h;e[7]!==i||e[8]!==a||e[9]!==m?(h=s.jsx(ve,{variant:"outline",className:"w-full",disabled:a,onClick:i,children:m}),e[7]=i,e[8]=a,e[9]=m,e[10]=h):h=e[10];let p;return e[11]!==i||e[12]!==r||e[13]!==h?(p=s.jsx(ge,{connection:r,onClick:i,footer:h,className:"transition-all hover:border-primary/50 hover:shadow-md"}),e[11]=i,e[12]=r,e[13]=h,e[14]=p):p=e[14],p}function ct(){const t=T.c(33),{org:e}=_(),r=ee(),c=K(),n=H(),u=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,o=Ne(r);let d;t[0]!==o?(d=o.map(Ke),t[0]=o,t[1]=d):d=t[1];const l=d;let i;t[2]!==e.slug?(i=ye.selectedRegistry(e.slug),t[2]=e.slug,t[3]=i):i=t[3];const[a,m]=Ce(i,Ae);let h;if(t[4]!==o||t[5]!==a){let g;t[7]!==a?(g=M=>M.id===a,t[7]=a,t[8]=g):g=t[8],h=o.find(g),t[4]=o,t[5]=a,t[6]=h}else h=t[6];const f=h?.id||o[0]?.id||"";let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v=[Y(),q()],t[9]=v):v=t[9];const j=v;let N;t[10]!==c.create||t[11]!==m?(N=async g=>{const M=await c.create.mutateAsync(g);m(M.id)},t[10]=c.create,t[11]=m,t[12]=N):N=t[12];const S=N;let y;t[13]!==o?(y=new Set(o.map(Oe)),t[13]=o,t[14]=y):y=t[14];const P=y;let R;t[15]!==P?(R=j.filter(g=>g.id&&!P.has(g.id)),t[15]=P,t[16]=R):R=t[16];const w=R;if(u){let g;return t[17]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(G,{}),t[17]=g):g=t[17],g}let x;t[18]!==S?(x=async g=>S(g),t[18]=S,t[19]=x):x=t[19];let b;t[20]!==w||t[21]!==f||t[22]!==l||t[23]!==m||t[24]!==x?(b=s.jsx(J,{title:"Store",ctaButton:s.jsx(Me,{wellKnownRegistries:w,registries:l,value:f,onValueChange:m,onAddWellKnown:x,placeholder:"Select store..."})}),t[20]=w,t[21]=f,t[22]=l,t[23]=m,t[24]=x,t[25]=b):b=t[25];let I;t[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(E,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[26]=I):I=t[26];let k;t[27]!==f||t[28]!==m?(k=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx($.Suspense,{fallback:I,children:f?s.jsx(Ee,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx($e,{registries:j,onConnected:g=>{m(g)}})})})}),t[27]=f,t[28]=m,t[29]=k):k=t[29];let C;return t[30]!==k||t[31]!==b?(C=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[b,k]}),t[30]=k,t[31]=b,t[32]=C):C=t[32],C}function Oe(t){return t.id}function Ae(){return""}function Ke(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{ct as default};
1
+ import{a_ as D,a$ as O,b0 as F,b1 as z,b2 as B,b3 as V,c as T,j as s,r as $,a5 as Q,a2 as U,a as W,b4 as H,ao as G}from"./index-MoI-rvC3.js";import{g as Y,a as q}from"./well-known-mcp-Dq2j3ucM.js";import{C as J}from"./collection-header-BeSLFcaG.js";import{a as Z,c as X,d as K,b as ee}from"./use-connection-DiHU9E79.js";import{a as te,T as se,b as ie,u as _}from"./tooltip-CyReuecv.js";import{e as ne,s as re}from"./app-name-DQPOjnhR.js";import{I as E}from"./icon-Cxep_tfx.js";import{C as le}from"./collection-search-DFSSOoxU.js";import{C as ae}from"./card-CE1-D3SY.js";import{I as oe}from"./integration-icon-C162QlgN.js";import{g as ce,f as de,a as me}from"./registry-utils-ulDDT0d8.js";import{d as fe,a as ue,S as he,b as xe,c as pe}from"./select-B4j1Cb8E.js";import{C as ge}from"./connection-card-Bj0wmYgV.js";import{B as ve}from"./button-G3aMPyFq.js";import{E as je}from"./empty-state-YCqZyamY.js";import{a as Ne}from"./use-binding-DdwHCRqV.js";import{L as ye,u as Ce}from"./localstorage-keys-CzubTFSO.js";import"./collection-display-button-BOWw7rwa.js";import"./dropdown-menu-CtSLEdvQ.js";import"./utils-BLlwSV8I.js";import"./input-CXe38a5R.js";import"./badge-Bi_GpkO_.js";import"./auth-D1xg1rd7.js";import"./useQuery-BpCQj7wy.js";var we=class extends D{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:O()})}getOptimisticResult(t){return t.behavior=O(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:r}=t,c=super.createResult(t,e),{isFetching:n,isRefetching:u,isError:o,isRefetchError:d}=c,l=r.fetchMeta?.fetchMore?.direction,i=o&&l==="forward",a=n&&l==="forward",m=o&&l==="backward",h=n&&l==="backward";return{...c,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:z(e,r.data),hasPreviousPage:F(e,r.data),isFetchNextPageError:i,isFetchingNextPage:a,isFetchPreviousPageError:m,isFetchingPreviousPage:h,isRefetchError:d&&!i&&!m,isRefetching:u&&!a&&!h}}};function be(t,e){return B({...t,enabled:!0,suspense:!0,throwOnError:V},we,e)}function Se(t){const e=t.title||t.server.title||t.id||"Unnamed Item",r=t.server.description||null,c=t.server.icons?.[0]?.src||ce(t.server.repository)||null,n=t._meta?.["mcp.mesh"]?.verified??!1,u=t.server.version,d=(t.server.remotes?.length??0)>0;let l=e,i=null;if(e.includes("/")){const a=e.split("/");a.length>=2&&(i=a[0]||null,l=ne(e))}if(!i){const a=t._meta?.["mcp.mesh"]?.scopeName,m=t._meta?.["mcp.mesh"]?.appName;a&&m?i=`${a}/${m}`:a&&(i=a)}return{icon:c,scopeName:i,displayName:l,description:r,version:u||null,isVerified:n,canInstall:d}}function Pe(t){const e=T.c(45),{icon:r,scopeName:c,displayName:n,description:u,version:o,isVerified:d,canInstall:l,onClick:i}=t;let a;e[0]!==n||e[1]!==r?(a=s.jsx(oe,{icon:r,name:n,size:"md",className:"shadow-sm"}),e[0]=n,e[1]=r,e[2]=a):a=e[2];let m;e[3]!==n?(m=s.jsx("span",{className:"truncate",children:n}),e[3]=n,e[4]=m):m=e[4];let h;e[5]!==d?(h=d&&s.jsx(E,{name:"verified",size:16,className:"text-success shrink-0"}),e[5]=d,e[6]=h):h=e[6];let p;e[7]!==l?(p=!l&&s.jsx(E,{name:"lock",size:16,className:"text-muted-foreground shrink-0",title:"This MCP Server cannot be connected"}),e[7]=l,e[8]=p):p=e[8];let f;e[9]!==m||e[10]!==h||e[11]!==p?(f=s.jsx(te,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-semibold min-w-0",children:[m,h,p]})}),e[9]=m,e[10]=h,e[11]=p,e[12]=f):f=e[12];let v;e[13]!==n?(v=s.jsx("p",{children:n}),e[13]=n,e[14]=v):v=e[14];let j;e[15]!==l?(j=!l&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=l,e[16]=j):j=e[16];let N;e[17]!==v||e[18]!==j?(N=s.jsxs(se,{children:[v,j]}),e[17]=v,e[18]=j,e[19]=N):N=e[19];let S;e[20]!==f||e[21]!==N?(S=s.jsxs(ie,{children:[f,N]}),e[20]=f,e[21]=N,e[22]=S):S=e[22];let y;e[23]!==c?(y=c&&s.jsx("span",{className:"truncate",children:c}),e[23]=c,e[24]=y):y=e[24];let P;e[25]!==c||e[26]!==o?(P=o&&s.jsxs(s.Fragment,{children:[c&&s.jsx("span",{children:"•"}),s.jsxs("span",{className:"shrink-0",children:["v",o]})]}),e[25]=c,e[26]=o,e[27]=P):P=e[27];let R;e[28]!==y||e[29]!==P?(R=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[y,P]}),e[28]=y,e[29]=P,e[30]=R):R=e[30];let w;e[31]!==R||e[32]!==S?(w=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[S,R]})}),e[31]=R,e[32]=S,e[33]=w):w=e[33];let x;e[34]!==a||e[35]!==w?(x=s.jsxs("div",{className:"flex gap-3",children:[a,w]}),e[34]=a,e[35]=w,e[36]=x):x=e[36];const b=u||"No description available";let I;e[37]!==b?(I=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-base text-muted-foreground line-clamp-2",children:b})}),e[37]=b,e[38]=I):I=e[38];let k;e[39]!==x||e[40]!==I?(k=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[x,I]}),e[39]=x,e[40]=I,e[41]=k):k=e[41];let C;return e[42]!==i||e[43]!==k?(C=s.jsx(ae,{className:"p-6 cursor-pointer hover:shadow-md transition-shadow",onClick:i,children:k}),e[42]=i,e[43]=k,e[44]=C):C=e[44],C}function A(t){const e=T.c(12),{items:r,title:c,onItemClick:n}=t;if(r.length===0)return null;let u;e[0]!==c?(u=c&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:c})}),e[0]=c,e[1]=u):u=e[1];let o;if(e[2]!==r||e[3]!==n){let i;e[5]!==n?(i=a=>{const m=Se(a);return s.jsx(Pe,{...m,onClick:()=>n(a)},a.id)},e[5]=n,e[6]=i):i=e[6],o=r.map(i),e[2]=r,e[3]=n,e[4]=o}else o=e[4];let d;e[7]!==o?(d=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=d):d=e[8];let l;return e[9]!==u||e[10]!==d?(l=s.jsxs("div",{className:"flex flex-col gap-4",children:[u,d]}),e[9]=u,e[10]=d,e[11]=l):l=e[11],l}function Re(t,e){if(!e)return t;const r=e.toLowerCase();return t.filter(c=>(c.name||c.title||"").toLowerCase().includes(r)||(c.description||c.server.description||"").toLowerCase().includes(r))}function Ie(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function ke(t){const e=T.c(32),{items:r,isLoadingMore:c,registryId:n,hasMore:u,onLoadMore:o}=t,d=c===void 0?!1:c,l=u===void 0?!1:u,[i,a]=$.useState(""),m=Q(),{org:h}=_(),p=$.useRef(null);let f,v,j;e[0]!==r||e[1]!==i?(f=Re(r,i),j=f.filter(Ie),v=f.filter(C=>!j.find(g=>g.id===C.id)),e[0]=r,e[1]=i,e[2]=f,e[3]=v,e[4]=j):(f=e[2],v=e[3],j=e[4]);const N=v;let S;e[5]!==m||e[6]!==h.slug||e[7]!==n?(S=C=>{const g=re(C.name||C.title||C.server.title||""),M=C.server.name;m({to:"/$org/store/$appName",params:{org:h.slug,appName:g},search:{registryId:n,serverName:M}})},e[5]=m,e[6]=h.slug,e[7]=n,e[8]=S):S=e[8];const y=S;let P;e[9]!==l||e[10]!==d||e[11]!==o||e[12]!==i?(P=C=>{if(!l||!o||i||d)return;const g=C.currentTarget;g.scrollHeight-g.scrollTop-g.clientHeight<200&&o()},e[9]=l,e[10]=d,e[11]=o,e[12]=i,e[13]=P):P=e[13];const R=P;let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=C=>{C.key==="Enter"&&a(C.currentTarget.value)},e[14]=w):w=e[14];let x;e[15]!==i?(x=s.jsx(le,{value:i,onChange:a,placeholder:"Search for an MCP Server...",onKeyDown:w}),e[15]=i,e[16]=x):x=e[16];let b;e[17]!==N||e[18]!==f||e[19]!==y||e[20]!==l||e[21]!==d||e[22]!==r.length||e[23]!==i||e[24]!==j?(b=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:r.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(E,{name:"inbox",size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):i&&f.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(E,{name:"search",size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[j.length>0&&s.jsx(A,{items:j,title:"Verified",onItemClick:y}),N.length>0&&s.jsx(A,{items:N,title:j.length>0?"All":"",onItemClick:y}),l&&!i&&d&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(E,{name:"progress_activity",size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=N,e[18]=f,e[19]=y,e[20]=l,e[21]=d,e[22]=r.length,e[23]=i,e[24]=j,e[25]=b):b=e[25];let I;e[26]!==R||e[27]!==b?(I=s.jsx("div",{ref:p,className:"flex-1 overflow-y-auto",onScroll:R,children:b}),e[26]=R,e[27]=b,e[28]=I):I=e[28];let k;return e[29]!==x||e[30]!==I?(k=s.jsxs("div",{className:"flex flex-col h-full",children:[x,I]}),e[29]=x,e[30]=I,e[31]=k):k=e[31],k}const L=24;function Ee(t){const e=T.c(27),{registryId:r}=t,c=Z(r);let n,u,o,d;if(e[0]!==c?.tools||e[1]!==r){if(n=de(c?.tools),!n)throw new Error("This registry does not support listing store items.");let x;e[6]!==r?(x=X(r),e[6]=r,e[7]=x):x=e[7],d=x,o=be,u=U.toolCall(r,n,JSON.stringify({limit:L})),e[0]=c?.tools,e[1]=r,e[2]=n,e[3]=u,e[4]=o,e[5]=d}else n=e[2],u=e[3],o=e[4],d=e[5];let l;e[8]!==n||e[9]!==d?(l=async x=>{const{pageParam:b}=x;return await d(n,b?{cursor:b,limit:L}:{limit:L})},e[8]=n,e[9]=d,e[10]=l):l=e[10];let i;e[11]!==u||e[12]!==l?(i={queryKey:u,queryFn:l,initialPageParam:void 0,getNextPageParam:Te,staleTime:36e5},e[11]=u,e[12]=l,e[13]=i):i=e[13];const{data:a,fetchNextPage:m,hasNextPage:h,isFetchingNextPage:p}=o(i);let f;e:{if(!a?.pages||a.pages.length===0){f=null;break e}const x=a.pages[0];if(typeof x=="object"&&x!==null&&"totalCount"in x&&typeof x.totalCount=="number"){f=x.totalCount;break e}f=null}const v=f,j=a?.pages;let N;e[14]!==j?(N=me(j),e[14]=j,e[15]=N):N=e[15];const S=N;let y;e[16]!==m||e[17]!==h||e[18]!==p?(y=()=>{h&&!p&&m()},e[16]=m,e[17]=h,e[18]=p,e[19]=y):y=e[19];const P=y,R=h??!1;let w;return e[20]!==S||e[21]!==P||e[22]!==p||e[23]!==r||e[24]!==R||e[25]!==v?(w=s.jsx(ke,{items:S,isLoadingMore:p,registryId:r,hasMore:R,onLoadMore:P,totalCount:v}),e[20]=S,e[21]=P,e[22]=p,e[23]=r,e[24]=R,e[25]=v,e[26]=w):w=e[26],w}function Te(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Me(t){const e=T.c(15),{registries:r,value:c,onValueChange:n,onAddWellKnown:u,wellKnownRegistries:o,placeholder:d}=t,l=d===void 0?"Select a registry...":d;let i;e[0]!==l?(i=s.jsx(ue,{className:"w-[200px] h-8!",children:s.jsx(he,{placeholder:l})}),e[0]=l,e[1]=i):i=e[1];let a;e[2]!==r?(a=r.map(Le),e[2]=r,e[3]=a):a=e[3];let m;e[4]!==u||e[5]!==o?(m=o.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(f=>s.jsxs("button",{onClick:v=>{v.preventDefault(),v.stopPropagation(),u(f)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-xl py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[f.icon?s.jsx("img",{src:f.icon,alt:f.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(E,{name:"add",size:16})})]},f.id??f.title))]}),e[4]=u,e[5]=o,e[6]=m):m=e[6];let h;e[7]!==a||e[8]!==m?(h=s.jsxs(xe,{children:[a,m]}),e[7]=a,e[8]=m,e[9]=h):h=e[9];let p;return e[10]!==n||e[11]!==i||e[12]!==h||e[13]!==c?(p=s.jsxs(pe,{value:c,onValueChange:n,children:[i,h]}),e[10]=n,e[11]=i,e[12]=h,e[13]=c,e[14]=p):p=e[14],p}function Le(t){return s.jsx(fe,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function $e(t){const e=T.c(8),{registries:r,onConnected:c}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:423,height:279,className:"max-w-full h-auto"}),e[0]=n):n=e[0];let u;if(e[1]!==c||e[2]!==r){let d;e[4]!==c?(d=(l,i)=>{const a=l.id??`registry-${i}`;return s.jsx(_e,{registry:{...l,id:a},onConnected:c},a)},e[4]=c,e[5]=d):d=e[5],u=r.map(d),e[1]=c,e[2]=r,e[3]=u}else u=e[3];let o;return e[6]!==u?(o=s.jsx(je,{image:n,title:"Connect to a store",description:"Choose a registry to discover and connect MCP Servers from the community.",descriptionClassName:"max-w-[500px]",actionsClassName:"w-full max-w-2xl",actions:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full",children:u})}),e[6]=u,e[7]=o):o=e[7],o}function _e(t){const e=T.c(15),{registry:r,onConnected:c}=t,n=K(),{org:u}=_(),{data:o}=W.useSession(),d=!!u&&!!o?.user?.id;let l;e[0]!==n.create||e[1]!==d||e[2]!==c||e[3]!==r?(l=async()=>{if(!d)return;const f=await n.create.mutateAsync(r);c?.(f.id)},e[0]=n.create,e[1]=d,e[2]=c,e[3]=r,e[4]=l):l=e[4];const i=l,a=!d||n.create.isPending;let m;e[5]!==n.create.isPending?(m=n.create.isPending?s.jsxs(s.Fragment,{children:[s.jsx(E,{name:"progress_activity",className:"animate-spin"}),"Connecting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(E,{name:"add"}),"Connect"]}),e[5]=n.create.isPending,e[6]=m):m=e[6];let h;e[7]!==i||e[8]!==a||e[9]!==m?(h=s.jsx(ve,{variant:"outline",className:"w-full",disabled:a,onClick:i,children:m}),e[7]=i,e[8]=a,e[9]=m,e[10]=h):h=e[10];let p;return e[11]!==i||e[12]!==r||e[13]!==h?(p=s.jsx(ge,{connection:r,onClick:i,footer:h,className:"transition-all hover:border-primary/50 hover:shadow-md"}),e[11]=i,e[12]=r,e[13]=h,e[14]=p):p=e[14],p}function ct(){const t=T.c(33),{org:e}=_(),r=ee(),c=K(),n=H(),u=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,o=Ne(r);let d;t[0]!==o?(d=o.map(Ke),t[0]=o,t[1]=d):d=t[1];const l=d;let i;t[2]!==e.slug?(i=ye.selectedRegistry(e.slug),t[2]=e.slug,t[3]=i):i=t[3];const[a,m]=Ce(i,Ae);let h;if(t[4]!==o||t[5]!==a){let g;t[7]!==a?(g=M=>M.id===a,t[7]=a,t[8]=g):g=t[8],h=o.find(g),t[4]=o,t[5]=a,t[6]=h}else h=t[6];const f=h?.id||o[0]?.id||"";let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v=[Y(),q()],t[9]=v):v=t[9];const j=v;let N;t[10]!==c.create||t[11]!==m?(N=async g=>{const M=await c.create.mutateAsync(g);m(M.id)},t[10]=c.create,t[11]=m,t[12]=N):N=t[12];const S=N;let y;t[13]!==o?(y=new Set(o.map(Oe)),t[13]=o,t[14]=y):y=t[14];const P=y;let R;t[15]!==P?(R=j.filter(g=>g.id&&!P.has(g.id)),t[15]=P,t[16]=R):R=t[16];const w=R;if(u){let g;return t[17]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(G,{}),t[17]=g):g=t[17],g}let x;t[18]!==S?(x=async g=>S(g),t[18]=S,t[19]=x):x=t[19];let b;t[20]!==w||t[21]!==f||t[22]!==l||t[23]!==m||t[24]!==x?(b=s.jsx(J,{title:"Store",ctaButton:s.jsx(Me,{wellKnownRegistries:w,registries:l,value:f,onValueChange:m,onAddWellKnown:x,placeholder:"Select store..."})}),t[20]=w,t[21]=f,t[22]=l,t[23]=m,t[24]=x,t[25]=b):b=t[25];let I;t[26]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(E,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[26]=I):I=t[26];let k;t[27]!==f||t[28]!==m?(k=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx($.Suspense,{fallback:I,children:f?s.jsx(Ee,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx($e,{registries:j,onConnected:g=>{m(g)}})})})}),t[27]=f,t[28]=m,t[29]=k):k=t[29];let C;return t[30]!==k||t[31]!==b?(C=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[b,k]}),t[30]=k,t[31]=b,t[32]=C):C=t[32],C}function Oe(t){return t.id}function Ae(){return""}function Ke(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{ct as default};
@@ -1 +1 @@
1
- import{c as U,j as s,r as le,a5 as be,d as Ne,b as we,a as Ce,a6 as ge}from"./index-CxSCpakB.js";import{I as L}from"./icon-HmCDqOPd.js";import{B as xe}from"./button-BeTb9YZU.js";import{b as Te,D as _e,a as ke,c as Se}from"./dropdown-menu-DsWv8lkW.js";import{E as Ie}from"./empty-state-DCGHu7Ht.js";import{R as Ae,T as Le,a as Ue}from"./resource-tabs-Cyi6PwbN.js";import{d as Ee,b as Me,a as De,c as Pe}from"./use-connection-v-w_yxra.js";import{a as Ve}from"./use-binding-BfGhaGVE.js";import{u as Re}from"./use-tool-call-CqAWykKA.js";import{u as Be}from"./index-DmUDvTrM.js";import{u as ve}from"./tooltip-BKoAX5gw.js";import{e as $e}from"./extract-connection-data-DrneYG29.js";import{e as ze,s as Oe}from"./app-name-DQPOjnhR.js";import{f as He,e as Fe,b as Ge,c as We,g as Ke}from"./registry-utils-ulDDT0d8.js";import"./utils-BGgJIaEU.js";import"./useQuery-CkIva3b0.js";import"./collection-display-button-DE8BFxrp.js";import"./collection-search-C3auuf0Y.js";import"./input-NL8_dTk4.js";import"./collection-table-wrapper-z4CuwV_C.js";import"./integration-icon-B5ZzeehM.js";import"./card-DFBJ_uBy.js";import"./layout-CKQw59Ep.js";import"./badge-DO3BPtZ-.js";import"./auth-CYg5mzvi.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./generate-id-Dyweu44Y.js";function qe(t){const e=U.c(3),{message:r}=t,n=r===void 0?"Loading app details...":r;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(L,{name:"progress_activity",size:48,className:"animate-spin mb-4"}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function Je(t){const e=U.c(9),{error:r,onBack:n}=t,o=r instanceof Error?r.message:r;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(L,{name:"error",size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==o?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:o}),e[2]=o,e[3]=c):c=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let f;return e[6]!==c||e[7]!==l?(f=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=f):f=e[8],f}function Qe(t){const e=U.c(5),{onBack:r}=t;let n,o,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(L,{name:"search_off",size:48,className:"text-muted-foreground mb-4"}),o=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=o,e[2]=i):(n=e[0],o=e[1],i=e[2]);let a;return e[3]!==r?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,o,i,s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=r,e[4]=a):a=e[4],a}function Xe(t){const e=U.c(3),{onBack:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(L,{name:"arrow_back",size:20}),e[0]=n):n=e[0];let o;return e[1]!==r?(o=s.jsx("div",{className:"shrink-0 bg-background border-b border-border px-4 py-3",children:s.jsx("div",{className:"max-w-7xl mx-auto",children:s.jsxs("button",{onClick:r,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[n,"Back"]})})}),e[1]=r,e[2]=o):o=e[2],o}function Ye(t){const e=U.c(32),{data:r,itemVersions:n,onInstall:o,canInstall:i,isInstalling:a}=t,c=i===void 0?!0:i,l=a===void 0?!1:a,[f,u]=le.useState(0);let x;e[0]!==o?(x=d=>{u(d),o(d)},e[0]=o,e[1]=x):x=e[1];const p=x;let h;e[2]!==r.icon||e[3]!==r.name?(h=r.icon?s.jsx("img",{src:r.icon,alt:r.name,crossOrigin:"anonymous",referrerPolicy:"no-referrer",onError:d=>{const v=d.target;v.style.display="none";const I=v.parentElement;I&&(I.innerHTML=r.name.substring(0,2).toUpperCase())},className:"w-full h-full object-cover rounded-2xl"}):r.name.substring(0,2).toUpperCase(),e[2]=r.icon,e[3]=r.name,e[4]=h):h=e[4];let g;e[5]!==h?(g=s.jsx("div",{className:"shrink-0 w-16 h-16 rounded-2xl bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-3xl font-bold text-primary overflow-hidden",children:h}),e[5]=h,e[6]=g):g=e[6];let b;e[7]!==r.name?(b=s.jsx("h1",{className:"text-3xl font-bold",children:r.name}),e[7]=r.name,e[8]=b):b=e[8];let w;e[9]!==r.verified?(w=r.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[9]=r.verified,e[10]=w):w=e[10];let C;e[11]!==b||e[12]!==w?(C=s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b,w]}),e[11]=b,e[12]=w,e[13]=C):C=e[13];let T;e[14]!==r.description?(T=r.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:r.description}),e[14]=r.description,e[15]=T):T=e[15];let _;e[16]!==C||e[17]!==T?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[C,T]}),e[16]=C,e[17]=T,e[18]=_):_=e[18];let k;e[19]!==c||e[20]!==p||e[21]!==l||e[22]!==n||e[23]!==o||e[24]!==f?(k=c?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(xe,{variant:"brand",onClick:()=>p(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(L,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs(Te,{children:[s.jsx(_e,{asChild:!0,children:s.jsx(xe,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(L,{name:"expand_more",size:20})})}),s.jsx(ke,{align:"end",className:"w-56",children:n.map((d,v)=>{const I=d._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Se,{onClick:()=>p(v),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-start justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",d.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-primary font-semibold mt-1",children:"LATEST"})]}),v===f&&s.jsx(L,{name:"check_circle",size:16,className:"text-primary shrink-0 mt-1"})]})},v)})})]})]}):s.jsxs(xe,{variant:"brand",onClick:()=>o(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(L,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[19]=c,e[20]=p,e[21]=l,e[22]=n,e[23]=o,e[24]=f,e[25]=k):k=e[25];let N;e[26]!==_||e[27]!==k?(N=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[_,k]}),e[26]=_,e[27]=k,e[28]=N):N=e[28];let S;return e[29]!==N||e[30]!==g?(S=s.jsxs("div",{className:"pl-10 flex items-start gap-6 pb-12 pr-10 border-b border-border",children:[g,N]}),e[29]=N,e[30]=g,e[31]=S):S=e[31],S}function Ze(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function et(t){const e=U.c(48),{data:r,publisherInfo:n,selectedItem:o}=t;let i;e[0]!==r.description?(i=r.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-lg font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r.description})]}),e[0]=r.description,e[1]=i):i=e[1];let a;e[2]!==r.publisher||e[3]!==n.logo?(a=n.logo?s.jsx("img",{src:n.logo,alt:r.publisher,crossOrigin:"anonymous",referrerPolicy:"no-referrer",onError:I=>{const Y=I.target;Y.style.display="none";const D=Y.parentElement;if(D){const y=r.publisher==="io.modelcontextprotocol.registry/official"?"OR":r.publisher.substring(0,2).toUpperCase();D.innerHTML=y}},className:"w-full h-full object-cover"}):r.publisher==="io.modelcontextprotocol.registry/official"?"OR":r.publisher.substring(0,2).toUpperCase(),e[2]=r.publisher,e[3]=n.logo,e[4]=a):a=e[4];let c;e[5]!==a?(c=s.jsx("div",{className:"w-12 h-12 rounded-lg bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-sm font-semibold text-primary shrink-0 overflow-hidden",children:a}),e[5]=a,e[6]=c):c=e[6];let l;e[7]!==r.publisher?(l=r.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":r.publisher.charAt(0).toUpperCase()+r.publisher.slice(1),e[7]=r.publisher,e[8]=l):l=e[8];let f;e[9]!==l?(f=s.jsx("div",{className:"font-medium",children:l}),e[9]=l,e[10]=f):f=e[10];let u;e[11]!==n.count?(u=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[11]=n.count,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:u}),e[13]=u,e[14]=x):x=e[14];let p;e[15]!==f||e[16]!==x?(p=s.jsxs("div",{children:[f,x]}),e[15]=f,e[16]=x,e[17]=p):p=e[17];let h;e[18]!==c||e[19]!==p?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,p]})}),e[18]=c,e[19]=p,e[20]=h):h=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("h2",{className:"text-lg font-medium mb-3",children:"Technical Details"}),e[21]=g):g=e[21];let b;e[22]!==r.version?(b=r.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Version"}),s.jsxs("span",{className:"text-foreground font-medium",children:["v",r.version]})]}),e[22]=r.version,e[23]=b):b=e[23];let w;e[24]!==r.connectionType?(w=r.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Connection Type"}),s.jsx("span",{className:"text-foreground font-medium",children:r.connectionType})]}),e[24]=r.connectionType,e[25]=w):w=e[25];let C;e[26]!==r.schemaVersion?(C=r.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Schema Version"}),s.jsx("span",{className:"text-foreground font-medium",children:r.schemaVersion})]}),e[26]=r.schemaVersion,e[27]=C):C=e[27];let T;e[28]!==r.websiteUrl?(T=r.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Website"}),s.jsxs("a",{href:r.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[s.jsx("span",{children:"Visit"}),s.jsx(L,{name:"open_in_new",size:14})]})]}),e[28]=r.websiteUrl,e[29]=T):T=e[29];let _;e[30]!==r.repository?(_=r.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Source"}),s.jsxs("a",{href:r.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[s.jsx("span",{children:"GitHub"}),s.jsx(L,{name:"open_in_new",size:14})]})]}),e[30]=r.repository,e[31]=_):_=e[31];let k;e[32]!==b||e[33]!==w||e[34]!==C||e[35]!==T||e[36]!==_?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,w,C,T,_]}),e[32]=b,e[33]=w,e[34]=C,e[35]=T,e[36]=_,e[37]=k):k=e[37];let N;e[38]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[38]=N):N=e[38];let S;e[39]!==o.updated_at?(S=Ze(o.updated_at),e[39]=o.updated_at,e[40]=S):S=e[40];let d;e[41]!==S?(d=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[N,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:S})]}),e[41]=S,e[42]=d):d=e[42];let v;return e[43]!==i||e[44]!==k||e[45]!==d||e[46]!==h?(v=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,d]}),e[43]=i,e[44]=k,e[45]=d,e[46]=h,e[47]=v):v=e[47],v}function tt(t){const e=U.c(18),{data:r,availableTabs:n,effectiveActiveTabId:o,effectiveTools:i,isLoadingTools:a,onTabChange:c}=t,l=a===void 0?!1:a;let f;e[0]!==i?(f=i.map(st),e[0]=i,e[1]=f):f=e[1];const u=f;let x;e[2]!==n||e[3]!==o||e[4]!==c?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ae,{tabs:n,activeTab:o,onTabChange:c})}),e[2]=n,e[3]=o,e[4]=c,e[5]=x):x=e[5];let p;e[6]!==o||e[7]!==i.length||e[8]!==l||e[9]!==u?(p=o==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(L,{name:"progress_activity",size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Le,{tools:u,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Ie,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=o,e[7]=i.length,e[8]=l,e[9]=u,e[10]=p):p=e[10];let h;e[11]!==r?.repository||e[12]!==o?(h=o==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Ue,{repository:r?.repository})}),e[11]=r?.repository,e[12]=o,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==p||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,p,h]}),e[14]=x,e[15]=p,e[16]=h,e[17]=g):g=e[17],g}function st(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function rt(t,e){if(!t||!e)return;const r=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===r||n.app_id?.toLowerCase()===r||n.title.toLowerCase()===r)||t.find(n=>n.title.toLowerCase().includes(r))}function ot(t,e,r,n,o){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:o??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:r?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function nt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],r=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],o=t.server,i=Ge(o.remotes?.[0]?.type),a=We(o.$schema),c=n?"io.modelcontextprotocol.registry/official":t.publisher||r?.scopeName||"Unknown",l=Ke(o.repository),f=t.icon||t.image||t.logo||o.icons?.[0]?.src||l||null,u=t.name||t.title||t.server?.title||"Unnamed Item";return{name:ze(u),description:t.description||t.summary||t.server?.description||"",icon:f,verified:t.verified||r?.verified,publisher:c,version:o.version||null,websiteUrl:o.websiteUrl||null,repository:o.repository||null,schemaVersion:a??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||o.tools||e?.tools||[],models:t.models||o.models||e?.models||[],emails:t.emails||o.emails||e?.emails||[],analytics:t.analytics||o.analytics||e?.analytics,cdn:t.cdn||o.cdn||e?.cdn}}class it extends le.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Store app detail error:",e,r)}render(){return this.state.hasError?s.jsx(Je,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function lt(){const t=U.c(70),{org:e}=ve(),r=be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:o}=Ne(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c}=we(i),[l,f]=le.useState("readme"),u=Ee(),x=Me(),{data:p}=Ce.useSession(),h=Ve(x),g=a||h[0]?.id||"",b=De(g),w=He(b?.tools),C=b?.tools&&b.tools.find(ft)?.name||"",T=b?.tools&&b.tools.find(mt)?.name||"",_=Pe(g),k=!!c;let N,S;k?(N=C||T,S={name:c}):(N=w,S={});const{data:d}=Re({toolCaller:_,toolName:N,toolInputParams:S,scope:g});let v=[],I=[],Y=null;if(d){if(Array.isArray(d))v=d;else if(typeof d=="object"&&d!==null)if("totalCount"in d&&typeof d.totalCount=="number"&&(Y=d.totalCount),"item"in d&&d.item){const m=d.item,A=m.id||"",P=m.server,V=m._meta;let M;t[2]!==m.title||t[3]!==A||t[4]!==P||t[5]!==V?(M=[{id:A,title:m.title,server:P,_meta:V}],t[2]=m.title,t[3]=A,t[4]=P,t[5]=V,t[6]=M):M=t[6],v=M}else{let m;"versions"in d&&Array.isArray(d.versions)?m="versions":"servers"in d&&Array.isArray(d.servers)?m="servers":m=Object.keys(d).find(A=>Array.isArray(d[A])),m&&(v=d[m],(m==="versions"||N?.includes("VERSIONS"))&&(I=v))}}let D;t[7]!==o?(D=m=>{const A=m.name||m.title||m.server.title||"";return Oe(A)===o},t[7]=o,t[8]=D):D=t[8];let y=v.find(D);if(!y&&c){let m;t[9]!==c?(m=A=>A.server.name===c||A.name===c||A.title===c,t[9]=c,t[10]=m):m=t[10],y=v.find(m)}const j=y?nt(y):null,ae=(j?.tools?.length||0)>0,ce=y?.server?.remotes?.[0]?.url||null,Z=!ae&&!!ce,R=Be({url:Z?ce:"",clientName:"MCP Store Preview",clientUri:typeof window<"u"?window.location.origin:"",autoReconnect:!1,autoRetry:!1,preventAutoAuth:!0}),ee=Z&&(R.state==="connecting"||R.state==="authenticating");let te;t[11]!==R||t[12]!==Z?(te=Z&&R.state==="ready"?(R.tools||[]).map(dt):[],t[11]=R,t[12]=Z,t[13]=te):te=t[13];const he=te,B=ae?j?.tools||[]:he,ye=rt(x,j?.publisher),de=j?ot(v,j.publisher,ye,b??null,Y):{count:0},je=j?.repository?Fe(j.repository):null,me=!!j?.repository&&!!je;let $;t[14]!==me?($={id:"readme",label:"README",visible:me},t[14]=me,t[15]=$):$=t[15];const fe=ae||he.length>0||ee&&!!ce;let z;t[16]!==B.length||t[17]!==fe?(z={id:"tools",label:"Tools",count:B.length,visible:fe},t[16]=B.length,t[17]=fe,t[18]=z):z=t[18];let se;t[19]!==$||t[20]!==z?(se=[$,z].filter(ct),t[19]=$,t[20]=z,t[21]=se):se=t[21];const E=se;let re;t[22]!==l||t[23]!==E?(re=E.find(m=>m.id===l)?l:E.find(at)?.id||E[0]?.id||"overview",t[22]=l,t[23]=E,t[24]=re):re=t[24];const pe=re;let oe;t[25]!==u||t[26]!==I||t[27]!==r||t[28]!==e||t[29]!==y||t[30]!==p?(oe=async m=>{const A=I[m??0]||y;if(!A||!e||!p?.user?.id)return;const P=$e(A,e.id,p.user.id);if(!P.connection_url){ge.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await u.create.mutateAsync(P);r({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const M=V;ge.error(`Failed to connect MCP Server: ${M instanceof Error?M.message:String(M)}`)}},t[25]=u,t[26]=I,t[27]=r,t[28]=e,t[29]=y,t[30]=p,t[31]=oe):oe=t[31];const ue=oe;let ne;t[32]!==r||t[33]!==e.slug?(ne=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[32]=r,t[33]=e.slug,t[34]=ne):ne=t[34];const O=ne;if(!y){let m;return t[35]!==O?(m=s.jsx(Qe,{onBack:O}),t[35]=O,t[36]=m):m=t[36],m}if(!j)return null;const H=(y?.server?.remotes?.length??0)>0;let F;t[37]!==O?(F=s.jsx(Xe,{onBack:O}),t[37]=O,t[38]=F):F=t[38];let G;t[39]!==H?(G=!H&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(L,{name:"info",size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=H,t[40]=G):G=t[40];let W;t[41]!==I||t[42]!==y?(W=I.length>0?I:[y],t[41]=I,t[42]=y,t[43]=W):W=t[43];let K;t[44]!==u.create.isPending||t[45]!==H||t[46]!==j||t[47]!==ue||t[48]!==W?(K=s.jsx(Ye,{data:j,itemVersions:W,onInstall:ue,canInstall:H,isInstalling:u.create.isPending}),t[44]=u.create.isPending,t[45]=H,t[46]=j,t[47]=ue,t[48]=W,t[49]=K):K=t[49];let q;t[50]!==j||t[51]!==de||t[52]!==y?(q=s.jsx(et,{data:j,publisherInfo:de,selectedItem:y}),t[50]=j,t[51]=de,t[52]=y,t[53]=q):q=t[53];let J;t[54]!==E||t[55]!==j||t[56]!==pe||t[57]!==B||t[58]!==ee?(J=s.jsx(tt,{data:j,availableTabs:E,effectiveActiveTabId:pe,effectiveTools:B,isLoadingTools:ee,onTabChange:f}),t[54]=E,t[55]=j,t[56]=pe,t[57]=B,t[58]=ee,t[59]=J):J=t[59];let Q;t[60]!==q||t[61]!==J?(Q=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[q,J]}),t[60]=q,t[61]=J,t[62]=Q):Q=t[62];let X;t[63]!==G||t[64]!==K||t[65]!==Q?(X=s.jsx("div",{className:"flex-1 overflow-y-auto pt-10 h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"max-w-7xl mx-auto h-full",children:[G,K,Q]})})}),t[63]=G,t[64]=K,t[65]=Q,t[66]=X):X=t[66];let ie;return t[67]!==F||t[68]!==X?(ie=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[F,X]}),t[67]=F,t[68]=X,t[69]=ie):ie=t[69],ie}function at(t){return t.id==="readme"}function ct(t){return t.visible}function dt(t){return{name:t.name,description:t.description}}function mt(t){return t.name.endsWith("_GET")}function ft(t){return t.name.endsWith("_VERSIONS")}function $t(){const t=U.c(6),{org:e}=ve(),r=be();let n;t[0]!==r||t[1]!==e.slug?(n=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[0]=r,t[1]=e.slug,t[2]=n):n=t[2];const o=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(le.Suspense,{fallback:s.jsx(qe,{}),children:s.jsx(lt,{})}),t[3]=i):i=t[3];let a;return t[4]!==o?(a=s.jsx(it,{onBack:o,children:i}),t[4]=o,t[5]=a):a=t[5],a}export{$t as default};
1
+ import{c as U,j as s,r as le,a5 as be,d as Ne,b as we,a as Ce,a6 as ge}from"./index-MoI-rvC3.js";import{I as L}from"./icon-Cxep_tfx.js";import{B as xe}from"./button-G3aMPyFq.js";import{b as Te,D as _e,a as ke,c as Se}from"./dropdown-menu-CtSLEdvQ.js";import{E as Ie}from"./empty-state-YCqZyamY.js";import{R as Ae,T as Le,a as Ue}from"./resource-tabs-CNxf_u1f.js";import{d as Ee,b as Me,a as De,c as Pe}from"./use-connection-DiHU9E79.js";import{a as Ve}from"./use-binding-DdwHCRqV.js";import{u as Re}from"./use-tool-call-CPpXYXAZ.js";import{u as Be}from"./index-BtenH3n7.js";import{u as ve}from"./tooltip-CyReuecv.js";import{e as $e}from"./extract-connection-data-Cu9jjhV-.js";import{e as ze,s as Oe}from"./app-name-DQPOjnhR.js";import{f as He,e as Fe,b as Ge,c as We,g as Ke}from"./registry-utils-ulDDT0d8.js";import"./utils-BLlwSV8I.js";import"./useQuery-BpCQj7wy.js";import"./collection-display-button-BOWw7rwa.js";import"./collection-search-DFSSOoxU.js";import"./input-CXe38a5R.js";import"./collection-table-wrapper-CKt7U95e.js";import"./integration-icon-C162QlgN.js";import"./card-CE1-D3SY.js";import"./layout-DqgJyIdL.js";import"./badge-Bi_GpkO_.js";import"./auth-D1xg1rd7.js";import"./chunk-2RRQPJJO-DGhxLrrR.js";import"./generate-id-Dyweu44Y.js";function qe(t){const e=U.c(3),{message:r}=t,n=r===void 0?"Loading app details...":r;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(L,{name:"progress_activity",size:48,className:"animate-spin mb-4"}),e[0]=o):o=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function Je(t){const e=U.c(9),{error:r,onBack:n}=t,o=r instanceof Error?r.message:r;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(L,{name:"error",size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==o?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:o}),e[2]=o,e[3]=c):c=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let f;return e[6]!==c||e[7]!==l?(f=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=f):f=e[8],f}function Qe(t){const e=U.c(5),{onBack:r}=t;let n,o,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(L,{name:"search_off",size:48,className:"text-muted-foreground mb-4"}),o=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=o,e[2]=i):(n=e[0],o=e[1],i=e[2]);let a;return e[3]!==r?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,o,i,s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=r,e[4]=a):a=e[4],a}function Xe(t){const e=U.c(3),{onBack:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(L,{name:"arrow_back",size:20}),e[0]=n):n=e[0];let o;return e[1]!==r?(o=s.jsx("div",{className:"shrink-0 bg-background border-b border-border px-4 py-3",children:s.jsx("div",{className:"max-w-7xl mx-auto",children:s.jsxs("button",{onClick:r,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[n,"Back"]})})}),e[1]=r,e[2]=o):o=e[2],o}function Ye(t){const e=U.c(32),{data:r,itemVersions:n,onInstall:o,canInstall:i,isInstalling:a}=t,c=i===void 0?!0:i,l=a===void 0?!1:a,[f,u]=le.useState(0);let x;e[0]!==o?(x=d=>{u(d),o(d)},e[0]=o,e[1]=x):x=e[1];const p=x;let h;e[2]!==r.icon||e[3]!==r.name?(h=r.icon?s.jsx("img",{src:r.icon,alt:r.name,crossOrigin:"anonymous",referrerPolicy:"no-referrer",onError:d=>{const v=d.target;v.style.display="none";const I=v.parentElement;I&&(I.innerHTML=r.name.substring(0,2).toUpperCase())},className:"w-full h-full object-cover rounded-2xl"}):r.name.substring(0,2).toUpperCase(),e[2]=r.icon,e[3]=r.name,e[4]=h):h=e[4];let g;e[5]!==h?(g=s.jsx("div",{className:"shrink-0 w-16 h-16 rounded-2xl bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-3xl font-bold text-primary overflow-hidden",children:h}),e[5]=h,e[6]=g):g=e[6];let b;e[7]!==r.name?(b=s.jsx("h1",{className:"text-3xl font-bold",children:r.name}),e[7]=r.name,e[8]=b):b=e[8];let w;e[9]!==r.verified?(w=r.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[9]=r.verified,e[10]=w):w=e[10];let C;e[11]!==b||e[12]!==w?(C=s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b,w]}),e[11]=b,e[12]=w,e[13]=C):C=e[13];let T;e[14]!==r.description?(T=r.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:r.description}),e[14]=r.description,e[15]=T):T=e[15];let _;e[16]!==C||e[17]!==T?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[C,T]}),e[16]=C,e[17]=T,e[18]=_):_=e[18];let k;e[19]!==c||e[20]!==p||e[21]!==l||e[22]!==n||e[23]!==o||e[24]!==f?(k=c?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(xe,{variant:"brand",onClick:()=>p(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(L,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs(Te,{children:[s.jsx(_e,{asChild:!0,children:s.jsx(xe,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(L,{name:"expand_more",size:20})})}),s.jsx(ke,{align:"end",className:"w-56",children:n.map((d,v)=>{const I=d._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Se,{onClick:()=>p(v),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-start justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",d.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-primary font-semibold mt-1",children:"LATEST"})]}),v===f&&s.jsx(L,{name:"check_circle",size:16,className:"text-primary shrink-0 mt-1"})]})},v)})})]})]}):s.jsxs(xe,{variant:"brand",onClick:()=>o(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(L,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[19]=c,e[20]=p,e[21]=l,e[22]=n,e[23]=o,e[24]=f,e[25]=k):k=e[25];let N;e[26]!==_||e[27]!==k?(N=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[_,k]}),e[26]=_,e[27]=k,e[28]=N):N=e[28];let S;return e[29]!==N||e[30]!==g?(S=s.jsxs("div",{className:"pl-10 flex items-start gap-6 pb-12 pr-10 border-b border-border",children:[g,N]}),e[29]=N,e[30]=g,e[31]=S):S=e[31],S}function Ze(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function et(t){const e=U.c(48),{data:r,publisherInfo:n,selectedItem:o}=t;let i;e[0]!==r.description?(i=r.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-lg font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r.description})]}),e[0]=r.description,e[1]=i):i=e[1];let a;e[2]!==r.publisher||e[3]!==n.logo?(a=n.logo?s.jsx("img",{src:n.logo,alt:r.publisher,crossOrigin:"anonymous",referrerPolicy:"no-referrer",onError:I=>{const Y=I.target;Y.style.display="none";const D=Y.parentElement;if(D){const y=r.publisher==="io.modelcontextprotocol.registry/official"?"OR":r.publisher.substring(0,2).toUpperCase();D.innerHTML=y}},className:"w-full h-full object-cover"}):r.publisher==="io.modelcontextprotocol.registry/official"?"OR":r.publisher.substring(0,2).toUpperCase(),e[2]=r.publisher,e[3]=n.logo,e[4]=a):a=e[4];let c;e[5]!==a?(c=s.jsx("div",{className:"w-12 h-12 rounded-lg bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-sm font-semibold text-primary shrink-0 overflow-hidden",children:a}),e[5]=a,e[6]=c):c=e[6];let l;e[7]!==r.publisher?(l=r.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":r.publisher.charAt(0).toUpperCase()+r.publisher.slice(1),e[7]=r.publisher,e[8]=l):l=e[8];let f;e[9]!==l?(f=s.jsx("div",{className:"font-medium",children:l}),e[9]=l,e[10]=f):f=e[10];let u;e[11]!==n.count?(u=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[11]=n.count,e[12]=u):u=e[12];let x;e[13]!==u?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:u}),e[13]=u,e[14]=x):x=e[14];let p;e[15]!==f||e[16]!==x?(p=s.jsxs("div",{children:[f,x]}),e[15]=f,e[16]=x,e[17]=p):p=e[17];let h;e[18]!==c||e[19]!==p?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,p]})}),e[18]=c,e[19]=p,e[20]=h):h=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("h2",{className:"text-lg font-medium mb-3",children:"Technical Details"}),e[21]=g):g=e[21];let b;e[22]!==r.version?(b=r.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Version"}),s.jsxs("span",{className:"text-foreground font-medium",children:["v",r.version]})]}),e[22]=r.version,e[23]=b):b=e[23];let w;e[24]!==r.connectionType?(w=r.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Connection Type"}),s.jsx("span",{className:"text-foreground font-medium",children:r.connectionType})]}),e[24]=r.connectionType,e[25]=w):w=e[25];let C;e[26]!==r.schemaVersion?(C=r.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Schema Version"}),s.jsx("span",{className:"text-foreground font-medium",children:r.schemaVersion})]}),e[26]=r.schemaVersion,e[27]=C):C=e[27];let T;e[28]!==r.websiteUrl?(T=r.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Website"}),s.jsxs("a",{href:r.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[s.jsx("span",{children:"Visit"}),s.jsx(L,{name:"open_in_new",size:14})]})]}),e[28]=r.websiteUrl,e[29]=T):T=e[29];let _;e[30]!==r.repository?(_=r.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Source"}),s.jsxs("a",{href:r.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:[s.jsx("span",{children:"GitHub"}),s.jsx(L,{name:"open_in_new",size:14})]})]}),e[30]=r.repository,e[31]=_):_=e[31];let k;e[32]!==b||e[33]!==w||e[34]!==C||e[35]!==T||e[36]!==_?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,w,C,T,_]}),e[32]=b,e[33]=w,e[34]=C,e[35]=T,e[36]=_,e[37]=k):k=e[37];let N;e[38]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[38]=N):N=e[38];let S;e[39]!==o.updated_at?(S=Ze(o.updated_at),e[39]=o.updated_at,e[40]=S):S=e[40];let d;e[41]!==S?(d=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[N,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:S})]}),e[41]=S,e[42]=d):d=e[42];let v;return e[43]!==i||e[44]!==k||e[45]!==d||e[46]!==h?(v=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,d]}),e[43]=i,e[44]=k,e[45]=d,e[46]=h,e[47]=v):v=e[47],v}function tt(t){const e=U.c(18),{data:r,availableTabs:n,effectiveActiveTabId:o,effectiveTools:i,isLoadingTools:a,onTabChange:c}=t,l=a===void 0?!1:a;let f;e[0]!==i?(f=i.map(st),e[0]=i,e[1]=f):f=e[1];const u=f;let x;e[2]!==n||e[3]!==o||e[4]!==c?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ae,{tabs:n,activeTab:o,onTabChange:c})}),e[2]=n,e[3]=o,e[4]=c,e[5]=x):x=e[5];let p;e[6]!==o||e[7]!==i.length||e[8]!==l||e[9]!==u?(p=o==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(L,{name:"progress_activity",size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Le,{tools:u,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Ie,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=o,e[7]=i.length,e[8]=l,e[9]=u,e[10]=p):p=e[10];let h;e[11]!==r?.repository||e[12]!==o?(h=o==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Ue,{repository:r?.repository})}),e[11]=r?.repository,e[12]=o,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==p||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,p,h]}),e[14]=x,e[15]=p,e[16]=h,e[17]=g):g=e[17],g}function st(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function rt(t,e){if(!t||!e)return;const r=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===r||n.app_id?.toLowerCase()===r||n.title.toLowerCase()===r)||t.find(n=>n.title.toLowerCase().includes(r))}function ot(t,e,r,n,o){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:o??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:r?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function nt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],r=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],o=t.server,i=Ge(o.remotes?.[0]?.type),a=We(o.$schema),c=n?"io.modelcontextprotocol.registry/official":t.publisher||r?.scopeName||"Unknown",l=Ke(o.repository),f=t.icon||t.image||t.logo||o.icons?.[0]?.src||l||null,u=t.name||t.title||t.server?.title||"Unnamed Item";return{name:ze(u),description:t.description||t.summary||t.server?.description||"",icon:f,verified:t.verified||r?.verified,publisher:c,version:o.version||null,websiteUrl:o.websiteUrl||null,repository:o.repository||null,schemaVersion:a??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||o.tools||e?.tools||[],models:t.models||o.models||e?.models||[],emails:t.emails||o.emails||e?.emails||[],analytics:t.analytics||o.analytics||e?.analytics,cdn:t.cdn||o.cdn||e?.cdn}}class it extends le.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Store app detail error:",e,r)}render(){return this.state.hasError?s.jsx(Je,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function lt(){const t=U.c(70),{org:e}=ve(),r=be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:o}=Ne(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c}=we(i),[l,f]=le.useState("readme"),u=Ee(),x=Me(),{data:p}=Ce.useSession(),h=Ve(x),g=a||h[0]?.id||"",b=De(g),w=He(b?.tools),C=b?.tools&&b.tools.find(ft)?.name||"",T=b?.tools&&b.tools.find(mt)?.name||"",_=Pe(g),k=!!c;let N,S;k?(N=C||T,S={name:c}):(N=w,S={});const{data:d}=Re({toolCaller:_,toolName:N,toolInputParams:S,scope:g});let v=[],I=[],Y=null;if(d){if(Array.isArray(d))v=d;else if(typeof d=="object"&&d!==null)if("totalCount"in d&&typeof d.totalCount=="number"&&(Y=d.totalCount),"item"in d&&d.item){const m=d.item,A=m.id||"",P=m.server,V=m._meta;let M;t[2]!==m.title||t[3]!==A||t[4]!==P||t[5]!==V?(M=[{id:A,title:m.title,server:P,_meta:V}],t[2]=m.title,t[3]=A,t[4]=P,t[5]=V,t[6]=M):M=t[6],v=M}else{let m;"versions"in d&&Array.isArray(d.versions)?m="versions":"servers"in d&&Array.isArray(d.servers)?m="servers":m=Object.keys(d).find(A=>Array.isArray(d[A])),m&&(v=d[m],(m==="versions"||N?.includes("VERSIONS"))&&(I=v))}}let D;t[7]!==o?(D=m=>{const A=m.name||m.title||m.server.title||"";return Oe(A)===o},t[7]=o,t[8]=D):D=t[8];let y=v.find(D);if(!y&&c){let m;t[9]!==c?(m=A=>A.server.name===c||A.name===c||A.title===c,t[9]=c,t[10]=m):m=t[10],y=v.find(m)}const j=y?nt(y):null,ae=(j?.tools?.length||0)>0,ce=y?.server?.remotes?.[0]?.url||null,Z=!ae&&!!ce,R=Be({url:Z?ce:"",clientName:"MCP Store Preview",clientUri:typeof window<"u"?window.location.origin:"",autoReconnect:!1,autoRetry:!1,preventAutoAuth:!0}),ee=Z&&(R.state==="connecting"||R.state==="authenticating");let te;t[11]!==R||t[12]!==Z?(te=Z&&R.state==="ready"?(R.tools||[]).map(dt):[],t[11]=R,t[12]=Z,t[13]=te):te=t[13];const he=te,B=ae?j?.tools||[]:he,ye=rt(x,j?.publisher),de=j?ot(v,j.publisher,ye,b??null,Y):{count:0},je=j?.repository?Fe(j.repository):null,me=!!j?.repository&&!!je;let $;t[14]!==me?($={id:"readme",label:"README",visible:me},t[14]=me,t[15]=$):$=t[15];const fe=ae||he.length>0||ee&&!!ce;let z;t[16]!==B.length||t[17]!==fe?(z={id:"tools",label:"Tools",count:B.length,visible:fe},t[16]=B.length,t[17]=fe,t[18]=z):z=t[18];let se;t[19]!==$||t[20]!==z?(se=[$,z].filter(ct),t[19]=$,t[20]=z,t[21]=se):se=t[21];const E=se;let re;t[22]!==l||t[23]!==E?(re=E.find(m=>m.id===l)?l:E.find(at)?.id||E[0]?.id||"overview",t[22]=l,t[23]=E,t[24]=re):re=t[24];const pe=re;let oe;t[25]!==u||t[26]!==I||t[27]!==r||t[28]!==e||t[29]!==y||t[30]!==p?(oe=async m=>{const A=I[m??0]||y;if(!A||!e||!p?.user?.id)return;const P=$e(A,e.id,p.user.id);if(!P.connection_url){ge.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await u.create.mutateAsync(P);r({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const M=V;ge.error(`Failed to connect MCP Server: ${M instanceof Error?M.message:String(M)}`)}},t[25]=u,t[26]=I,t[27]=r,t[28]=e,t[29]=y,t[30]=p,t[31]=oe):oe=t[31];const ue=oe;let ne;t[32]!==r||t[33]!==e.slug?(ne=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[32]=r,t[33]=e.slug,t[34]=ne):ne=t[34];const O=ne;if(!y){let m;return t[35]!==O?(m=s.jsx(Qe,{onBack:O}),t[35]=O,t[36]=m):m=t[36],m}if(!j)return null;const H=(y?.server?.remotes?.length??0)>0;let F;t[37]!==O?(F=s.jsx(Xe,{onBack:O}),t[37]=O,t[38]=F):F=t[38];let G;t[39]!==H?(G=!H&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(L,{name:"info",size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=H,t[40]=G):G=t[40];let W;t[41]!==I||t[42]!==y?(W=I.length>0?I:[y],t[41]=I,t[42]=y,t[43]=W):W=t[43];let K;t[44]!==u.create.isPending||t[45]!==H||t[46]!==j||t[47]!==ue||t[48]!==W?(K=s.jsx(Ye,{data:j,itemVersions:W,onInstall:ue,canInstall:H,isInstalling:u.create.isPending}),t[44]=u.create.isPending,t[45]=H,t[46]=j,t[47]=ue,t[48]=W,t[49]=K):K=t[49];let q;t[50]!==j||t[51]!==de||t[52]!==y?(q=s.jsx(et,{data:j,publisherInfo:de,selectedItem:y}),t[50]=j,t[51]=de,t[52]=y,t[53]=q):q=t[53];let J;t[54]!==E||t[55]!==j||t[56]!==pe||t[57]!==B||t[58]!==ee?(J=s.jsx(tt,{data:j,availableTabs:E,effectiveActiveTabId:pe,effectiveTools:B,isLoadingTools:ee,onTabChange:f}),t[54]=E,t[55]=j,t[56]=pe,t[57]=B,t[58]=ee,t[59]=J):J=t[59];let Q;t[60]!==q||t[61]!==J?(Q=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[q,J]}),t[60]=q,t[61]=J,t[62]=Q):Q=t[62];let X;t[63]!==G||t[64]!==K||t[65]!==Q?(X=s.jsx("div",{className:"flex-1 overflow-y-auto pt-10 h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"max-w-7xl mx-auto h-full",children:[G,K,Q]})})}),t[63]=G,t[64]=K,t[65]=Q,t[66]=X):X=t[66];let ie;return t[67]!==F||t[68]!==X?(ie=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[F,X]}),t[67]=F,t[68]=X,t[69]=ie):ie=t[69],ie}function at(t){return t.id==="readme"}function ct(t){return t.visible}function dt(t){return{name:t.name,description:t.description}}function mt(t){return t.name.endsWith("_GET")}function ft(t){return t.name.endsWith("_VERSIONS")}function $t(){const t=U.c(6),{org:e}=ve(),r=be();let n;t[0]!==r||t[1]!==e.slug?(n=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[0]=r,t[1]=e.slug,t[2]=n):n=t[2];const o=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(le.Suspense,{fallback:s.jsx(qe,{}),children:s.jsx(lt,{})}),t[3]=i):i=t[3];let a;return t[4]!==o?(a=s.jsx(it,{onBack:o,children:i}),t[4]=o,t[5]=a):a=t[5],a}export{$t as default};
@@ -1 +1 @@
1
- import{c as o,j as n}from"./index-CxSCpakB.js";import{c as l}from"./utils-BGgJIaEU.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
1
+ import{c as o,j as n}from"./index-MoI-rvC3.js";import{c as l}from"./utils-BLlwSV8I.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
@@ -1 +1 @@
1
- import{r as C,c as I,j as t}from"./index-CxSCpakB.js";import{I as M}from"./integration-icon-B5ZzeehM.js";import{C as E}from"./checkbox-Ep63AJ5F.js";import{c as k}from"./utils-BGgJIaEU.js";import{b as Q}from"./use-connection-v-w_yxra.js";import{C as R}from"./collection-search-C3auuf0Y.js";const z=C.memo(function(T){const e=I.c(21),{connection:o,isSelected:x,hasToolsEnabled:r,activeToolsCount:p,totalToolsCount:j,onSelect:g,onToggle:u}=T,f=x?"bg-accent/50":"hover:bg-muted/50";let i;e[0]!==f?(i=k("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",f),e[0]=f,e[1]=i):i=e[1];let n;e[2]!==o.icon||e[3]!==o.title?(n=t.jsx(M,{icon:o.icon,name:o.title,size:"sm"}),e[2]=o.icon,e[3]=o.title,e[4]=n):n=e[4];let m;e[5]!==o.title?(m=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),e[5]=o.title,e[6]=m):m=e[6];let c;e[7]!==g||e[8]!==n||e[9]!==m?(c=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[n,m]}),e[7]=g,e[8]=n,e[9]=m,e[10]=c):c=e[10];let d;e[11]!==p||e[12]!==o.tools||e[13]!==r||e[14]!==u||e[15]!==j?(d=o.tools&&o.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[p,"/",j]}),t.jsx(E,{checked:r,onCheckedChange:u,onClick:D})]}),e[11]=p,e[12]=o.tools,e[13]=r,e[14]=u,e[15]=j,e[16]=d):d=e[16];let v;return e[17]!==i||e[18]!==c||e[19]!==d?(v=t.jsxs("div",{className:i,children:[c,d]}),e[17]=i,e[18]=c,e[19]=d,e[20]=v):v=e[20],v}),A=C.memo(function(T){const e=I.c(18),{connectionId:o,tool:x,isSelected:r,onToggle:p}=T,j=`tool-${o}-${x.name}`,g=r?"text-foreground":"text-muted-foreground";let u;e[0]!==g?(u=k("text-sm font-medium",g),e[0]=g,e[1]=u):u=e[1];let f;e[2]!==u||e[3]!==x.name?(f=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:u,children:x.name})}),e[2]=u,e[3]=x.name,e[4]=f):f=e[4];let i;e[5]!==x.description?(i=x.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:x.description}),e[5]=x.description,e[6]=i):i=e[6];let n;e[7]!==f||e[8]!==i?(n=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,i]}),e[7]=f,e[8]=i,e[9]=n):n=e[9];const m=`tool-${o}-${x.name}`;let c;e[10]!==r||e[11]!==p||e[12]!==m?(c=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(E,{id:m,checked:r,onCheckedChange:p,onClick:U})}),e[10]=r,e[11]=p,e[12]=m,e[13]=c):c=e[13];let d;return e[14]!==j||e[15]!==n||e[16]!==c?(d=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:j,children:[n,c]}),e[14]=j,e[15]=n,e[16]=c,e[17]=d):d=e[17],d});function K({toolSet:a,onToolSetChange:T}){const[e,o]=C.useState(""),x=C.useDeferredValue(e),[r,p]=C.useState("all"),j=C.useRef(new Set(Object.keys(a))),g=Q({searchTerm:x.trim()||void 0}),u=j.current,f=[...u.values()].map(s=>g.find(l=>l.id===s)).filter(s=>s!==void 0),i=g.filter(s=>!u.has(s.id)),n=[...f,...i],m=s=>{const l=a[s];return l!==void 0&&l.length>0},c=n.filter(s=>{if(r==="all")return!0;const l=m(s.id);return r==="selected"?l:r==="unselected"?!l:!0}),[d,v]=C.useState(n[0]?.id??null),h=d?n.find(s=>s.id===d)??null:null,$=h?.tools??[],O=(s,l)=>a[s]?.includes(l)??!1,P=(s,l)=>{const b=a[s]??[],w=b.includes(l),S={...a};if(w){const y=b.filter(N=>N!==l);y.length===0?delete S[s]:S[s]=y}else S[s]=[...b,l];T(S)},F=s=>{const l=n.find(N=>N.id===s);if(!l?.tools)return;const b=a[s]??[],w=l.tools.map(N=>N.name),S=b.length>0&&w.every(N=>b.includes(N)),y={...a};S?delete y[s]:(y[s]=w,v(s)),T(y)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:"w-80 border-r border-border flex flex-col",children:[t.jsx(R,{value:e,onChange:o,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>p("all"),className:k("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>p("selected"),className:k("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>p("unselected"),className:k("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:c.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:c.map(s=>{const l=s.tools?.length??0,b=a[s.id]?.length??0;return t.jsx(z,{connection:s,isSelected:d===s.id,hasToolsEnabled:m(s.id),activeToolsCount:b,totalToolsCount:l,onSelect:()=>v(s.id),onToggle:()=>F(s.id)},s.id)})})})]}),t.jsx("div",{className:"flex-1 flex flex-col",children:h?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"p-4 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(M,{icon:h.icon,name:h.title,size:"md"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-lg font-medium text-foreground",children:h.title}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]}),$.length>0&&t.jsx("div",{className:"flex items-center shrink-0 pr-3",children:t.jsx(E,{checked:m(h.id),onCheckedChange:()=>F(h.id)})})]})}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:$.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:$.map(s=>t.jsx(A,{connectionId:h.id,tool:s,isSelected:O(h.id,s.name),onToggle:()=>P(h.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function D(a){return a.stopPropagation()}function U(a){return a.stopPropagation()}export{K as T};
1
+ import{r as C,c as I,j as t}from"./index-MoI-rvC3.js";import{I as M}from"./integration-icon-C162QlgN.js";import{C as E}from"./checkbox-DgaTW36u.js";import{c as k}from"./utils-BLlwSV8I.js";import{b as Q}from"./use-connection-DiHU9E79.js";import{C as R}from"./collection-search-DFSSOoxU.js";const z=C.memo(function(T){const e=I.c(21),{connection:o,isSelected:x,hasToolsEnabled:r,activeToolsCount:p,totalToolsCount:j,onSelect:g,onToggle:u}=T,f=x?"bg-accent/50":"hover:bg-muted/50";let i;e[0]!==f?(i=k("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",f),e[0]=f,e[1]=i):i=e[1];let n;e[2]!==o.icon||e[3]!==o.title?(n=t.jsx(M,{icon:o.icon,name:o.title,size:"sm"}),e[2]=o.icon,e[3]=o.title,e[4]=n):n=e[4];let m;e[5]!==o.title?(m=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),e[5]=o.title,e[6]=m):m=e[6];let c;e[7]!==g||e[8]!==n||e[9]!==m?(c=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[n,m]}),e[7]=g,e[8]=n,e[9]=m,e[10]=c):c=e[10];let d;e[11]!==p||e[12]!==o.tools||e[13]!==r||e[14]!==u||e[15]!==j?(d=o.tools&&o.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[p,"/",j]}),t.jsx(E,{checked:r,onCheckedChange:u,onClick:D})]}),e[11]=p,e[12]=o.tools,e[13]=r,e[14]=u,e[15]=j,e[16]=d):d=e[16];let v;return e[17]!==i||e[18]!==c||e[19]!==d?(v=t.jsxs("div",{className:i,children:[c,d]}),e[17]=i,e[18]=c,e[19]=d,e[20]=v):v=e[20],v}),A=C.memo(function(T){const e=I.c(18),{connectionId:o,tool:x,isSelected:r,onToggle:p}=T,j=`tool-${o}-${x.name}`,g=r?"text-foreground":"text-muted-foreground";let u;e[0]!==g?(u=k("text-sm font-medium",g),e[0]=g,e[1]=u):u=e[1];let f;e[2]!==u||e[3]!==x.name?(f=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:u,children:x.name})}),e[2]=u,e[3]=x.name,e[4]=f):f=e[4];let i;e[5]!==x.description?(i=x.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:x.description}),e[5]=x.description,e[6]=i):i=e[6];let n;e[7]!==f||e[8]!==i?(n=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,i]}),e[7]=f,e[8]=i,e[9]=n):n=e[9];const m=`tool-${o}-${x.name}`;let c;e[10]!==r||e[11]!==p||e[12]!==m?(c=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(E,{id:m,checked:r,onCheckedChange:p,onClick:U})}),e[10]=r,e[11]=p,e[12]=m,e[13]=c):c=e[13];let d;return e[14]!==j||e[15]!==n||e[16]!==c?(d=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:j,children:[n,c]}),e[14]=j,e[15]=n,e[16]=c,e[17]=d):d=e[17],d});function K({toolSet:a,onToolSetChange:T}){const[e,o]=C.useState(""),x=C.useDeferredValue(e),[r,p]=C.useState("all"),j=C.useRef(new Set(Object.keys(a))),g=Q({searchTerm:x.trim()||void 0}),u=j.current,f=[...u.values()].map(s=>g.find(l=>l.id===s)).filter(s=>s!==void 0),i=g.filter(s=>!u.has(s.id)),n=[...f,...i],m=s=>{const l=a[s];return l!==void 0&&l.length>0},c=n.filter(s=>{if(r==="all")return!0;const l=m(s.id);return r==="selected"?l:r==="unselected"?!l:!0}),[d,v]=C.useState(n[0]?.id??null),h=d?n.find(s=>s.id===d)??null:null,$=h?.tools??[],O=(s,l)=>a[s]?.includes(l)??!1,P=(s,l)=>{const b=a[s]??[],w=b.includes(l),S={...a};if(w){const y=b.filter(N=>N!==l);y.length===0?delete S[s]:S[s]=y}else S[s]=[...b,l];T(S)},F=s=>{const l=n.find(N=>N.id===s);if(!l?.tools)return;const b=a[s]??[],w=l.tools.map(N=>N.name),S=b.length>0&&w.every(N=>b.includes(N)),y={...a};S?delete y[s]:(y[s]=w,v(s)),T(y)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:"w-80 border-r border-border flex flex-col",children:[t.jsx(R,{value:e,onChange:o,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>p("all"),className:k("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>p("selected"),className:k("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>p("unselected"),className:k("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:c.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:c.map(s=>{const l=s.tools?.length??0,b=a[s.id]?.length??0;return t.jsx(z,{connection:s,isSelected:d===s.id,hasToolsEnabled:m(s.id),activeToolsCount:b,totalToolsCount:l,onSelect:()=>v(s.id),onToggle:()=>F(s.id)},s.id)})})})]}),t.jsx("div",{className:"flex-1 flex flex-col",children:h?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"p-4 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(M,{icon:h.icon,name:h.title,size:"md"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-lg font-medium text-foreground",children:h.title}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]}),$.length>0&&t.jsx("div",{className:"flex items-center shrink-0 pr-3",children:t.jsx(E,{checked:m(h.id),onCheckedChange:()=>F(h.id)})})]})}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:$.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:$.map(s=>t.jsx(A,{connectionId:h.id,tool:s,isSelected:O(h.id,s.name),onToggle:()=>P(h.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function D(a){return a.stopPropagation()}function U(a){return a.stopPropagation()}export{K as T};
@@ -1 +1 @@
1
- import{r as a,j as d,aC as $,c as j,aB as te,aD as G,aR as oe,aM as B,aX as re,aY as ne,bB as se,az as U,aN as ae,aE as T,aQ as ie,aO as le,aP as ce,aZ as ue}from"./index-CxSCpakB.js";import{c as de}from"./utils-BGgJIaEU.js";var pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fe="VisuallyHidden",V=a.forwardRef((t,e)=>d.jsx($.span,{...t,ref:e,style:{...pe,...t.style}}));V.displayName=fe;var ve=V;const S="org-admin",xe={from({org:t,project:e}){if(t.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${t}/${e}`},parse(t){t.startsWith("/")&&(t=t.slice(1));const[e,o]=t.split("/");if(!e||!o)throw new Error("Invalid locator");return{org:e,project:o}},isOrgAdminProject(t){return t.split("/")[1]===S},adminProject(t){return`${t}/${S}`}},z=a.createContext(void 0),ze=()=>{const t=a.useContext(z);if(!t)throw new Error("useProjectContext must be used within a ProjectContextProvider");return t},Fe=t=>{const e=j.c(10),{children:o,org:r,project:n}=t;let s;e[0]!==r.slug||e[1]!==n.slug?(s=xe.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const i=c;let u;return e[7]!==o||e[8]!==i?(u=d.jsx(z.Provider,{value:i,children:o}),e[7]=o,e[8]=i,e[9]=u):u=e[9],u};const he=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ge=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),H=t=>{const e=ge(t);return e.charAt(0).toUpperCase()+e.slice(1)},F=(...t)=>t.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ce=a.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:s,iconNode:l,...c},i)=>a.createElement("svg",{ref:i,...me,width:e,height:e,stroke:t,strokeWidth:r?Number(o)*24/Number(e):o,className:F("lucide",n),...c},[...l.map(([u,p])=>a.createElement(u,p)),...Array.isArray(s)?s:[s]]));const Ye=(t,e)=>{const o=a.forwardRef(({className:r,...n},s)=>a.createElement(Ce,{ref:s,iconNode:e,className:F(`lucide-${he(H(t))}`,`lucide-${t}`,r),...n}));return o.displayName=H(t),o};var[O]=te("Tooltip",[B]),L=B(),Y="TooltipProvider",ye=700,A="tooltip.open",[Te,k]=O(Y),W=t=>{const{__scopeTooltip:e,delayDuration:o=ye,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=t,l=a.useRef(!0),c=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),d.jsx(Te,{scope:e,isOpenDelayedRef:l,delayDuration:o,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};W.displayName=Y;var R="Tooltip",[we,_]=O(R),X=t=>{const{__scopeTooltip:e,children:o,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,i=k(R,t.__scopeTooltip),u=L(e),[p,v]=a.useState(null),x=ie(),f=a.useRef(0),h=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[y,C]=le({prop:r,defaultProp:n??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(M)},caller:R}),b=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,C(!0)},[C]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,C(!1)},[C]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,C(!0),f.current=0},m)},[m,C]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ce,{...u,children:d.jsx(we,{scope:e,contentId:x,open:y,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:o})})};X.displayName=R;var D="TooltipTrigger",Z=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=_(D,o),s=k(D,o),l=L(o),c=a.useRef(null),i=U(e,c,n.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),v=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(ae,{asChild:!0,...l,children:d.jsx($.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:T(t.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:T(t.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:T(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:T(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:T(t.onBlur,n.onClose),onClick:T(t.onClick,n.onClose)})})});Z.displayName=D;var N="TooltipPortal",[be,Pe]=O(N,{forceMount:void 0}),q=t=>{const{__scopeTooltip:e,forceMount:o,children:r,container:n}=t,s=_(N,e);return d.jsx(be,{scope:e,forceMount:o,children:d.jsx(G,{present:o||s.open,children:d.jsx(oe,{asChild:!0,container:n,children:r})})})};q.displayName=N;var w="TooltipContent",K=a.forwardRef((t,e)=>{const o=Pe(w,t.__scopeTooltip),{forceMount:r=o.forceMount,side:n="top",...s}=t,l=_(w,t.__scopeTooltip);return d.jsx(G,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(Ee,{side:n,...s,ref:e})})}),Ee=a.forwardRef((t,e)=>{const o=_(w,t.__scopeTooltip),r=k(w,t.__scopeTooltip),n=a.useRef(null),s=U(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=o,p=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},C=Oe(y,g.getBoundingClientRect()),b=Le(y,C),P=Ae(m.getBoundingClientRect()),E=ke([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&p){const h=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[i,p,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},C=i?.contains(g)||p?.contains(g),b=!De(y,l);C?x():b&&(x(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,p,l,u,x]),d.jsx(J,{...t,ref:s})}),[Re,je]=O(R,{isInside:!1}),_e=se("TooltipContent"),J=a.forwardRef((t,e)=>{const{__scopeTooltip:o,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,i=_(w,o),u=L(o),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(A,p),()=>document.removeEventListener(A,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(ne,{"data-state":i.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(_e,{children:r}),d.jsx(Re,{scope:o,isInside:!0,children:d.jsx(ve,{id:i.contentId,role:"tooltip",children:n||r})})]})})});K.displayName=w;var Q="TooltipArrow",ee=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=L(o);return je(Q,o).isInside?null:d.jsx(ue,{...n,...r,ref:e})});ee.displayName=Q;function Oe(t,e){const o=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(o,r,n,s)){case s:return"left";case n:return"right";case o:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Le(t,e,o=5){const r=[];switch(e){case"top":r.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":r.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":r.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":r.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return r}function Ae(t){const{top:e,right:o,bottom:r,left:n}=t;return[{x:n,y:e},{x:o,y:e},{x:o,y:r},{x:n,y:r}]}function De(t,e){const{x:o,y:r}=t;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],i=e[l],u=c.x,p=c.y,v=i.x,x=i.y;p>r!=x>r&&o<(v-u)*(r-p)/(x-p)+u&&(n=!n)}return n}function ke(t){const e=t.slice();return e.sort((o,r)=>o.x<r.x?-1:o.x>r.x?1:o.y<r.y?-1:o.y>r.y?1:0),Ne(e)}function Ne(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const n=t[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const o=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}return o.pop(),e.length===1&&o.length===1&&e[0].x===o[0].x&&e[0].y===o[0].y?e:e.concat(o)}var Ie=W,Me=X,Se=Z,He=q,$e=K,Ge=ee;function Be(t){const e=j.c(6);let o,r;e[0]!==t?({delayDuration:r,...o}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==o?(s=d.jsx(Ie,{"data-slot":"tooltip-provider",delayDuration:n,...o}),e[3]=n,e[4]=o,e[5]=s):s=e[5],s}function We(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Be,{children:d.jsx(Me,{"data-slot":"tooltip",...o})}),e[2]=o,e[3]=r):r=e[3],r}function Xe(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Se,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function Ze(t){const e=j.c(13);let o,r,n,s;e[0]!==t?({className:r,sideOffset:s,children:o,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=de("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ge,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let u;return e[8]!==o||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(He,{children:d.jsxs($e,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[o,i]})}),e[8]=o,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{xe as L,S as O,Fe as P,Ze as T,pe as V,Xe as a,We as b,Ye as c,Be as d,ze as u};
1
+ import{r as a,j as d,aC as $,c as j,aB as te,aD as G,aR as oe,aM as B,aX as re,aY as ne,bC as se,az as U,aN as ae,aE as T,aQ as ie,aO as le,aP as ce,aZ as ue}from"./index-MoI-rvC3.js";import{c as de}from"./utils-BLlwSV8I.js";var pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fe="VisuallyHidden",V=a.forwardRef((t,e)=>d.jsx($.span,{...t,ref:e,style:{...pe,...t.style}}));V.displayName=fe;var ve=V;const S="org-admin",xe={from({org:t,project:e}){if(t.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${t}/${e}`},parse(t){t.startsWith("/")&&(t=t.slice(1));const[e,o]=t.split("/");if(!e||!o)throw new Error("Invalid locator");return{org:e,project:o}},isOrgAdminProject(t){return t.split("/")[1]===S},adminProject(t){return`${t}/${S}`}},z=a.createContext(void 0),ze=()=>{const t=a.useContext(z);if(!t)throw new Error("useProjectContext must be used within a ProjectContextProvider");return t},Fe=t=>{const e=j.c(10),{children:o,org:r,project:n}=t;let s;e[0]!==r.slug||e[1]!==n.slug?(s=xe.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const i=c;let u;return e[7]!==o||e[8]!==i?(u=d.jsx(z.Provider,{value:i,children:o}),e[7]=o,e[8]=i,e[9]=u):u=e[9],u};const he=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ge=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),H=t=>{const e=ge(t);return e.charAt(0).toUpperCase()+e.slice(1)},F=(...t)=>t.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ce=a.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:s,iconNode:l,...c},i)=>a.createElement("svg",{ref:i,...me,width:e,height:e,stroke:t,strokeWidth:r?Number(o)*24/Number(e):o,className:F("lucide",n),...c},[...l.map(([u,p])=>a.createElement(u,p)),...Array.isArray(s)?s:[s]]));const Ye=(t,e)=>{const o=a.forwardRef(({className:r,...n},s)=>a.createElement(Ce,{ref:s,iconNode:e,className:F(`lucide-${he(H(t))}`,`lucide-${t}`,r),...n}));return o.displayName=H(t),o};var[O]=te("Tooltip",[B]),L=B(),Y="TooltipProvider",ye=700,A="tooltip.open",[Te,k]=O(Y),W=t=>{const{__scopeTooltip:e,delayDuration:o=ye,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=t,l=a.useRef(!0),c=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),d.jsx(Te,{scope:e,isOpenDelayedRef:l,delayDuration:o,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};W.displayName=Y;var R="Tooltip",[we,_]=O(R),X=t=>{const{__scopeTooltip:e,children:o,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,i=k(R,t.__scopeTooltip),u=L(e),[p,v]=a.useState(null),x=ie(),f=a.useRef(0),h=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[y,C]=le({prop:r,defaultProp:n??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(M)},caller:R}),b=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,C(!0)},[C]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,C(!1)},[C]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,C(!0),f.current=0},m)},[m,C]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ce,{...u,children:d.jsx(we,{scope:e,contentId:x,open:y,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:o})})};X.displayName=R;var D="TooltipTrigger",Z=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=_(D,o),s=k(D,o),l=L(o),c=a.useRef(null),i=U(e,c,n.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),v=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(ae,{asChild:!0,...l,children:d.jsx($.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:T(t.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:T(t.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:T(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:T(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:T(t.onBlur,n.onClose),onClick:T(t.onClick,n.onClose)})})});Z.displayName=D;var N="TooltipPortal",[be,Pe]=O(N,{forceMount:void 0}),q=t=>{const{__scopeTooltip:e,forceMount:o,children:r,container:n}=t,s=_(N,e);return d.jsx(be,{scope:e,forceMount:o,children:d.jsx(G,{present:o||s.open,children:d.jsx(oe,{asChild:!0,container:n,children:r})})})};q.displayName=N;var w="TooltipContent",K=a.forwardRef((t,e)=>{const o=Pe(w,t.__scopeTooltip),{forceMount:r=o.forceMount,side:n="top",...s}=t,l=_(w,t.__scopeTooltip);return d.jsx(G,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(Ee,{side:n,...s,ref:e})})}),Ee=a.forwardRef((t,e)=>{const o=_(w,t.__scopeTooltip),r=k(w,t.__scopeTooltip),n=a.useRef(null),s=U(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=o,p=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},C=Oe(y,g.getBoundingClientRect()),b=Le(y,C),P=Ae(m.getBoundingClientRect()),E=ke([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&p){const h=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[i,p,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},C=i?.contains(g)||p?.contains(g),b=!De(y,l);C?x():b&&(x(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,p,l,u,x]),d.jsx(J,{...t,ref:s})}),[Re,je]=O(R,{isInside:!1}),_e=se("TooltipContent"),J=a.forwardRef((t,e)=>{const{__scopeTooltip:o,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,i=_(w,o),u=L(o),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(A,p),()=>document.removeEventListener(A,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(ne,{"data-state":i.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(_e,{children:r}),d.jsx(Re,{scope:o,isInside:!0,children:d.jsx(ve,{id:i.contentId,role:"tooltip",children:n||r})})]})})});K.displayName=w;var Q="TooltipArrow",ee=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=L(o);return je(Q,o).isInside?null:d.jsx(ue,{...n,...r,ref:e})});ee.displayName=Q;function Oe(t,e){const o=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(o,r,n,s)){case s:return"left";case n:return"right";case o:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Le(t,e,o=5){const r=[];switch(e){case"top":r.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":r.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":r.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":r.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return r}function Ae(t){const{top:e,right:o,bottom:r,left:n}=t;return[{x:n,y:e},{x:o,y:e},{x:o,y:r},{x:n,y:r}]}function De(t,e){const{x:o,y:r}=t;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],i=e[l],u=c.x,p=c.y,v=i.x,x=i.y;p>r!=x>r&&o<(v-u)*(r-p)/(x-p)+u&&(n=!n)}return n}function ke(t){const e=t.slice();return e.sort((o,r)=>o.x<r.x?-1:o.x>r.x?1:o.y<r.y?-1:o.y>r.y?1:0),Ne(e)}function Ne(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const n=t[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const o=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}return o.pop(),e.length===1&&o.length===1&&e[0].x===o[0].x&&e[0].y===o[0].y?e:e.concat(o)}var Ie=W,Me=X,Se=Z,He=q,$e=K,Ge=ee;function Be(t){const e=j.c(6);let o,r;e[0]!==t?({delayDuration:r,...o}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==o?(s=d.jsx(Ie,{"data-slot":"tooltip-provider",delayDuration:n,...o}),e[3]=n,e[4]=o,e[5]=s):s=e[5],s}function We(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Be,{children:d.jsx(Me,{"data-slot":"tooltip",...o})}),e[2]=o,e[3]=r):r=e[3],r}function Xe(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Se,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function Ze(t){const e=j.c(13);let o,r,n,s;e[0]!==t?({className:r,sideOffset:s,children:o,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=de("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ge,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let u;return e[8]!==o||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(He,{children:d.jsxs($e,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[o,i]})}),e[8]=o,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{xe as L,S as O,Fe as P,Ze as T,pe as V,Xe as a,We as b,Ye as c,Be as d,ze as u};
@@ -1 +1 @@
1
- import{b6 as a}from"./index-CxSCpakB.js";const o=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],t=a("upload",o);export{t as U};
1
+ import{b6 as a}from"./index-MoI-rvC3.js";const o=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],t=a("upload",o);export{t as U};