@decocms/mesh 1.4.4 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/client/assets/{AlertCircle-B6rEUVLf.js → AlertCircle-BIlMffS8.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DC_Ebc-m.js → ArrowLeft-CJ-eKoid.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-rNVX3ifZ.js → ChevronDown-atiP0m-F.js} +1 -1
  4. package/dist/client/assets/{Clock-DS2iGkSJ.js → Clock-BD2gknBV.js} +1 -1
  5. package/dist/client/assets/{Code01-CoFYqM8q.js → Code01-BEefaaXC.js} +1 -1
  6. package/dist/client/assets/{Copy01-CCVZH6f1.js → Copy01-DhXqtugg.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-DwHhz9CA.js → CpuChip02-BtgBI59l.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-8kkJJG9R.js → DotsVertical-roys0n6e.js} +1 -1
  9. package/dist/client/assets/{File06-DxUGl7Wc.js → File06-MlW8n69V.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-D9qJVjU9.js → FlipBackward-BSnTMMYy.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-DLNdjhEu.js → GitBranch01-CEvRlFly.js} +1 -1
  12. package/dist/client/assets/{Grid01-BTunGha4.js → Grid01-CkwdbRed.js} +1 -1
  13. package/dist/client/assets/{Inbox01-BoV8p7IN.js → Inbox01-D66dNA_K.js} +1 -1
  14. package/dist/client/assets/{Key01-Bqzm5f6K.js → Key01-BXlD7hmS.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-WcFL8RpQ.js → LinkExternal01-O4xnNCff.js} +1 -1
  16. package/dist/client/assets/{Loading01-B0vdyVbH.js → Loading01-EiDV-2FW.js} +1 -1
  17. package/dist/client/assets/{Lock01-B0PVK-yI.js → Lock01-DpRDCI3P.js} +1 -1
  18. package/dist/client/assets/{Play-KfJ8X6ky.js → Play-FKw7EqPO.js} +1 -1
  19. package/dist/client/assets/{Plus-nu8-Nz8b.js → Plus-CwB-Rc8B.js} +1 -1
  20. package/dist/client/assets/{SearchMd-BFumDfkS.js → SearchMd-C6P9P1wF.js} +1 -1
  21. package/dist/client/assets/{Terminal-CDIp_seB.js → Terminal-Dv6w41J8.js} +1 -1
  22. package/dist/client/assets/{Trash01-1tKgR7uh.js → Trash01-Ctk7srex.js} +1 -1
  23. package/dist/client/assets/{X-hEo9Za23.js → X-Da4xsL05.js} +1 -1
  24. package/dist/client/assets/{XClose-BIthQxae.js → XClose-OUZ04LEo.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-_VCwcCen.js → alert-dialog-D6UjYOUP.js} +1 -1
  26. package/dist/client/assets/{auth-BpfHzPVh.js → auth-CZR9mNdb.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-D-D94naG.js → auth-catchall-BZWl_BRK.js} +1 -1
  28. package/dist/client/assets/{avatar-DHKqC-IM.js → avatar-BHE7lL4M.js} +1 -1
  29. package/dist/client/assets/{badge-Dkhmn9Qj.js → badge-B-u7R38I.js} +1 -1
  30. package/dist/client/assets/{button-BSXU4L7C.js → button-B13xcF6W.js} +1 -1
  31. package/dist/client/assets/{card-CXFRieEW.js → card-7VW-xSd-.js} +1 -1
  32. package/dist/client/assets/{checkbox-C-t_-9ku.js → checkbox-BMd2Z-WT.js} +1 -1
  33. package/dist/client/assets/{collection-detail-P20CfY5q.js → collection-detail-7eGCexqR.js} +3 -3
  34. package/dist/client/assets/{collection-display-button-BAoFTB4b.js → collection-display-button-D4VM0KQx.js} +1 -1
  35. package/dist/client/assets/{collection-header-B--7sWbR.js → collection-header-od14k6u3.js} +1 -1
  36. package/dist/client/assets/{collection-page-B71dz4fa.js → collection-page-BNuNM--s.js} +1 -1
  37. package/dist/client/assets/{collection-search-CrC01K4Z.js → collection-search-LnYLnFH8.js} +1 -1
  38. package/dist/client/assets/{collection-tab-dwp9LGxi.js → collection-tab-bg_gmLyh.js} +1 -1
  39. package/dist/client/assets/{collection-table-wrapper-CFoaxah9.js → collection-table-wrapper-B0AFEn1d.js} +1 -1
  40. package/dist/client/assets/{connection-card-eAyda1Mu.js → connection-card-r2tH19aR.js} +1 -1
  41. package/dist/client/assets/{connection-detail-Bn-jl6HG.js → connection-detail-Dm1s8Dj2.js} +1 -1
  42. package/dist/client/assets/connections-CWHukeOK.js +1 -0
  43. package/dist/client/assets/constants-CN4QOiqe.js +1 -0
  44. package/dist/client/assets/{core-C9AbX0ks.js → core-BqWxized.js} +1 -1
  45. package/dist/client/assets/{create-organization-dialog-DhHOFwW5.js → create-organization-dialog-CjneLhKn.js} +1 -1
  46. package/dist/client/assets/{dialog-Cj2udzC-.js → dialog-DoN4ORnY.js} +1 -1
  47. package/dist/client/assets/{dropdown-menu-ClBJUvd8.js → dropdown-menu-uXj8nKiT.js} +1 -1
  48. package/dist/client/assets/{empty-state-CYnIzDhF.js → empty-state-N07FE0YG.js} +1 -1
  49. package/dist/client/assets/{env-vars-editor-nU4IPD2j.js → env-vars-editor-B7JL_p-V.js} +1 -1
  50. package/dist/client/assets/{error-boundary-D5hb-PLt.js → error-boundary-Ce0_dLsG.js} +1 -1
  51. package/dist/client/assets/{extract-connection-data-BWB54H7f.js → extract-connection-data-CeT4F9gU.js} +1 -1
  52. package/dist/client/assets/{form-Dn7fy5O5.js → form-BQIYj24w.js} +1 -1
  53. package/dist/client/assets/{formatDistanceToNow-km7E2wF1.js → formatDistanceToNow-CArtWgcP.js} +1 -1
  54. package/dist/client/assets/gateway-detail-VCb3jL84.js +1 -0
  55. package/dist/client/assets/gateways-9p2LLkTK.js +1 -0
  56. package/dist/client/assets/{home-dep1g9Zf.js → home-DgfprghT.js} +1 -1
  57. package/dist/client/assets/{index-gqIvEQSH.js → index-CVgkE3Gv.js} +2 -2
  58. package/dist/client/assets/{index-tz4gB72W.js → index-DEMNtulg.js} +2 -2
  59. package/dist/client/assets/{index-DX5d9vx1.js → index-DcMa5gDs.js} +1 -1
  60. package/dist/client/assets/{index-CcNvI65p.js → index-DcvTq0xJ.js} +1 -1
  61. package/dist/client/assets/{input-Cb7MaM0d.js → input-YdP8mwrf.js} +1 -1
  62. package/dist/client/assets/json-Bz08jZIq.js +1 -0
  63. package/dist/client/assets/{json-syntax-highlighter-CCgbux_M.js → json-syntax-highlighter-Bif-CDya.js} +2 -2
  64. package/dist/client/assets/{layout-DtfNegCp.js → layout-BNxxrCBw.js} +1 -1
  65. package/dist/client/assets/{lazy-highlighter-CaGtIE-R.js → lazy-highlighter-C0vzyJy5.js} +1 -1
  66. package/dist/client/assets/{localstorage-keys-DIkWdWYS.js → localstorage-keys-DwKN3_Ky.js} +1 -1
  67. package/dist/client/assets/{login-DSSk45pi.js → login-UWyl_cxx.js} +1 -1
  68. package/dist/client/assets/{mcp-oauth-BOAcAnr_.js → mcp-oauth-Dqr97r2H.js} +1 -1
  69. package/dist/client/assets/{members-D4I8qlnr.js → members-C3UV37Kw.js} +1 -1
  70. package/dist/client/assets/{monitoring-CvcerPLg.js → monitoring-Ds52TSSS.js} +2 -2
  71. package/dist/client/assets/{oauth-callback-CY5bCrs6.js → oauth-callback-D4M9mHyH.js} +1 -1
  72. package/dist/client/assets/{page-Du4118GJ.js → page-B7ia0_lh.js} +2 -2
  73. package/dist/client/assets/{pin-to-sidebar-button-CwlJToUG.js → pin-to-sidebar-button-BKotT_Nc.js} +1 -1
  74. package/dist/client/assets/{popover-BPqLZ76M.js → popover-7jr0PuXV.js} +1 -1
  75. package/dist/client/assets/prism-light-CHE2alug.js +1 -0
  76. package/dist/client/assets/resizable-qkPSJ31g.js +1 -0
  77. package/dist/client/assets/{resource-tabs-CmUpRVKA.js → resource-tabs-qR3NhTLd.js} +1 -1
  78. package/dist/client/assets/{responsive-select-DwsIwS1V.js → responsive-select-CJQwNPPj.js} +1 -1
  79. package/dist/client/assets/{select-HGITgxwS.js → select-L_OjJ9sW.js} +1 -1
  80. package/dist/client/assets/{settings-sSoOIGWg.js → settings-BapAo6i2.js} +1 -1
  81. package/dist/client/assets/shell-layout-DqUuQ9gz.js +19 -0
  82. package/dist/client/assets/{spinner-BUVePO6d.js → spinner-CAJeeq5B.js} +1 -1
  83. package/dist/client/assets/{store-H6vucsd1.js → store-DTMoxgob.js} +1 -1
  84. package/dist/client/assets/{store-app-detail-aULJzMOJ.js → store-app-detail-CbGg2GlI.js} +1 -1
  85. package/dist/client/assets/{switch-BwTlw9qL.js → switch-DlwEQXd2.js} +1 -1
  86. package/dist/client/assets/{textarea-BAs6HmBZ.js → textarea-IOVeLZOt.js} +1 -1
  87. package/dist/client/assets/{thread-history-popover-DbEl1KJu.js → thread-history-popover-COjpShBU.js} +3 -3
  88. package/dist/client/assets/{tools-list-thZyoBrU.js → tools-list-l6xtSgWR.js} +1 -1
  89. package/dist/client/assets/{tooltip-Bzy1O5cq.js → tooltip-C7B84lYF.js} +1 -1
  90. package/dist/client/assets/{types-BVTsq_OW.js → types-BmKCUQAI.js} +1 -1
  91. package/dist/client/assets/{use-binding-jUI3xZmp.js → use-binding-Ce8NG0MO.js} +1 -1
  92. package/dist/client/assets/{use-connection-DRZbGk_A.js → use-connection-D-LWel3A.js} +1 -1
  93. package/dist/client/assets/{use-connection-resources-B3tDNT6E.js → use-connection-resources-CJzk5_Wj.js} +1 -1
  94. package/dist/client/assets/{use-gateway-CUxuCVmJ.js → use-gateway-eXp_1iQc.js} +1 -1
  95. package/dist/client/assets/{use-list-state-CkGBL95Z.js → use-list-state-CmxR0QRn.js} +1 -1
  96. package/dist/client/assets/{use-mcp-CMt9Wy3X.js → use-mcp-Cmlg9h6L.js} +1 -1
  97. package/dist/client/assets/{use-members-cyA2aC2q.js → use-members-Drex2zGi.js} +1 -1
  98. package/dist/client/assets/{use-mobile-B8xlavN6.js → use-mobile-B-R7B7Hp.js} +1 -1
  99. package/dist/client/assets/{use-organization-settings-C7IdFOTo.js → use-organization-settings-B_G_DBCR.js} +1 -1
  100. package/dist/client/assets/{use-tool-call-CsOSZ1pI.js → use-tool-call-BN3WED_Z.js} +1 -1
  101. package/dist/client/assets/useQuery-DLJrS2VC.js +1 -0
  102. package/dist/client/assets/{useSuspenseInfiniteQuery-DqCwXIKB.js → useSuspenseInfiniteQuery-DFaXtjFO.js} +1 -1
  103. package/dist/client/assets/{view-mode-toggle-COcukfhX.js → view-mode-toggle-BpRlpgBn.js} +1 -1
  104. package/dist/client/assets/workflow-CBeu3WB4.js +1 -0
  105. package/dist/client/index.html +1 -1
  106. package/dist/server/cli.js +2 -2
  107. package/dist/server/migrate.js +2 -2
  108. package/dist/server/server.js +3 -3
  109. package/package.json +1 -1
  110. package/dist/client/assets/connections-CDl5cKXc.js +0 -1
  111. package/dist/client/assets/constants-C-5m3xCJ.js +0 -1
  112. package/dist/client/assets/gateway-detail-BEimKnAa.js +0 -1
  113. package/dist/client/assets/gateways-1GR6BIbg.js +0 -1
  114. package/dist/client/assets/json-CevIphLA.js +0 -1
  115. package/dist/client/assets/prism-light-bnbWF_0X.js +0 -1
  116. package/dist/client/assets/resizable-Ck5ltOjh.js +0 -1
  117. package/dist/client/assets/shell-layout-BCUXUEeW.js +0 -19
  118. package/dist/client/assets/useQuery-Bl78N6vT.js +0 -1
  119. package/dist/client/assets/workflow-CaCjE8aO.js +0 -1
@@ -1 +1 @@
1
- import{r as n,c as N,j as s}from"./index-tz4gB72W.js";import{c as C,B as y}from"./button-BSXU4L7C.js";import{c as M,D as z,b as E,a as D}from"./dropdown-menu-ClBJUvd8.js";import{i as S,c as T}from"./Grid01-BTunGha4.js";import{i as L,a as V,c as B,b as _,T as W}from"./tooltip-Bzy1O5cq.js";import{V as $}from"./view-mode-toggle-COcukfhX.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function K(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsxs(B,{children:[s.jsx(_,{asChild:!0,children:s.jsx(z,{asChild:!0,children:s.jsx(y,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(W,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(T,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx($,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(f=>{const j=v===f.id;return s.jsx(M,{onClick:()=>l(f.id),className:C("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(L,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(E,{children:[h,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{K as C,w as n};
1
+ import{r as n,c as N,j as s}from"./index-DEMNtulg.js";import{c as C,B as y}from"./button-B13xcF6W.js";import{c as M,D as z,b as E,a as D}from"./dropdown-menu-uXj8nKiT.js";import{i as S,c as T}from"./Grid01-CkwdbRed.js";import{i as L,a as V,c as B,b as _,T as W}from"./tooltip-C7B84lYF.js";import{V as $}from"./view-mode-toggle-BpRlpgBn.js";const w=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));w.displayName="ArrowDown";const k=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));k.displayName="List";const b=({size:t=24,color:e="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));b.displayName="Sliders01";function K(t){const e=N.c(16),{viewMode:r,onViewModeChange:g,sortKey:v,sortDirection:a,onSort:l,sortOptions:c}=t;let d;e[0]!==c?(d=c===void 0?[]:c,e[0]=c,e[1]=d):d=e[1];const m=d;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(V,{children:s.jsxs(B,{children:[s.jsx(_,{asChild:!0,children:s.jsx(z,{asChild:!0,children:s.jsx(y,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(b,{size:16})})})}),s.jsx(W,{children:"Search filters"})]})}),e[2]=h):h=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={value:"table",icon:s.jsx(k,{})},e[3]=p):p=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=[p,{value:"cards",icon:s.jsx(T,{})}],e[4]=x):x=e[4];let o;e[5]!==g||e[6]!==r?(o=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx($,{value:r,onValueChange:g,fullWidth:!0,options:x})}),e[5]=g,e[6]=r,e[7]=o):o=e[7];let i;e[8]!==l||e[9]!==a||e[10]!==v||e[11]!==m?(i=m.length>0&&l&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(f=>{const j=v===f.id;return s.jsx(M,{onClick:()=>l(f.id),className:C("h-8 px-2 py-0 cursor-pointer",j&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[j&&s.jsx(L,{size:16,className:"text-foreground shrink-0"}),!j&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),j&&a&&(a==="asc"?s.jsx(S,{size:16,className:"text-foreground shrink-0"}):s.jsx(w,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[8]=l,e[9]=a,e[10]=v,e[11]=m,e[12]=i):i=e[12];let u;return e[13]!==o||e[14]!==i?(u=s.jsxs(E,{children:[h,s.jsxs(D,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,i]})]}),e[13]=o,e[14]=i,e[15]=u):u=e[15],u}export{K as C,w as n};
@@ -1 +1 @@
1
- import{c as j,j as i}from"./index-tz4gB72W.js";import{C as b}from"./collection-display-button-BAoFTB4b.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
1
+ import{c as j,j as i}from"./index-DEMNtulg.js";import{C as b}from"./collection-display-button-D4VM0KQx.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
@@ -1 +1 @@
1
- import{c as s,j as c}from"./index-tz4gB72W.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
1
+ import{c as s,j as c}from"./index-DEMNtulg.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
@@ -1 +1 @@
1
- import{c as x,j as a}from"./index-tz4gB72W.js";import{i as u}from"./SearchMd-BFumDfkS.js";import{I as b}from"./input-Cb7MaM0d.js";import{c as g}from"./button-BSXU4L7C.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
1
+ import{c as x,j as a}from"./index-DEMNtulg.js";import{i as u}from"./SearchMd-C6P9P1wF.js";import{I as b}from"./input-YdP8mwrf.js";import{c as g}from"./button-B13xcF6W.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
@@ -1 +1 @@
1
- import{r as ke,c as ne,j as t,K as nt,f as lt,g as rt,a as at,t as ct}from"./index-tz4gB72W.js";import{g as Ke}from"./generate-id-Dyweu44Y.js";import{I as Ve,c as We,b as dt,d as mt,e as ft}from"./use-connection-DRZbGk_A.js";import{C as qe}from"./collection-display-button-BAoFTB4b.js";import{C as ut}from"./collection-search-CrC01K4Z.js";import{C as pt}from"./card-CXFRieEW.js";import{b as Ge,D as He,a as Je,c as L}from"./dropdown-menu-ClBJUvd8.js";import{B as Oe}from"./button-BSXU4L7C.js";import{a as Qe}from"./Copy01-CCVZH6f1.js";import{i as Ye}from"./DotsVertical-8kkJJG9R.js";import{s as Ze,u as ht}from"./use-list-state-CkGBL95Z.js";import{s as Xe}from"./Trash01-1tKgR7uh.js";import{C as xt}from"./collection-table-wrapper-CFoaxah9.js";import{E as Ue}from"./empty-state-CYnIzDhF.js";import{n as Be}from"./Inbox01-BoV8p7IN.js";import{A as ze}from"./avatar-DHKqC-IM.js";import{u as gt}from"./useQuery-Bl78N6vT.js";import{E as jt}from"./SearchMd-BFumDfkS.js";import{P as vt}from"./pin-to-sidebar-button-CwlJToUG.js";import{B as Ct}from"./constants-C-5m3xCJ.js";import{A as bt,g as yt,c as Nt,b as wt,d as St,e as _t,a as Dt,f as At}from"./alert-dialog-_VCwcCen.js";import{s as Tt}from"./Plus-nu8-Nz8b.js";import{V as $t}from"./layout-DtfNegCp.js";const Le=({size:n=24,color:e="currentColor",...s})=>ke.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},ke.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Le.displayName="Edit01";function It(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of d)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Pt(n){const e=ne.c(25),{item:s,schema:d,actions:i}=n;let l;e[0]!==s||e[1]!==d?(l=It(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==i?(f=i&&Object.keys(i).length>0,e[3]=i,e[4]=f):f=e[4];const o=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(Ve,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let C;e[8]!==s.title?(C=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=C):C=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==C||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[C,m]}),e[12]=C,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let j;e[18]!==i||e[19]!==o||e[20]!==s?(j=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ot,onMouseDown:kt,children:t.jsxs(Ge,{children:[t.jsx(He,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:Et,children:[i.open&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),i.edit&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.edit?.(s)},children:[t.jsx(Le,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(L,{variant:"destructive",onClick:r=>{r.stopPropagation(),i.delete?.(s)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=j):j=e[21];let S;return e[22]!==y||e[23]!==j?(S=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,j]}),e[22]=y,e[23]=j,e[24]=S):S=e[24],S}function Et(n){return n.stopPropagation()}function zt(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function Lt(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=We(),e[0]=s):s=e[0];const d=s;let i;e[1]!==n?(i=nt.user(n),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==i||e[6]!==l||e[7]!==a?(c={queryKey:i,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=i,e[6]=l,e[7]=a,e[8]=c):c=e[8],gt(c)}function Mt(n){const e=ne.c(33),{id:s,size:d,showEmail:i,className:l}=n,a=d===void 0?"xs":d,c=i===void 0?!1:i,{data:f,isLoading:o,isError:u}=Lt(s);if(o){const r=`flex items-center gap-2 ${l||""}`;let g;e[0]!==a?(g=t.jsx(ze.Skeleton,{shape:"circle",size:a}),e[0]=a,e[1]=g):g=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=v):v=e[2];let p;e[3]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=c,e[4]=p):p=e[4];let _;e[5]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[v,p]}),e[5]=p,e[6]=_):_=e[6];let b;return e[7]!==r||e[8]!==g||e[9]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[7]=r,e[8]=g,e[9]=_,e[10]=b):b=e[10],b}if(u||!f){const r=`flex items-center gap-2 ${l||""}`;let g;e[11]!==a?(g=t.jsx(ze,{shape:"circle",size:a,fallback:"?",muted:!0}),e[11]=a,e[12]=g):g=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=v):v=e[13];let p;return e[14]!==r||e[15]!==g?(p=t.jsxs("div",{className:r,children:[g,v]}),e[14]=r,e[15]=g,e[16]=p):p=e[16],p}const C=`flex items-center gap-2 ${l||""}`,h=f.image??void 0;let m;e[17]!==a||e[18]!==h||e[19]!==f.name?(m=t.jsx(ze,{shape:"circle",size:a,url:h,fallback:f.name}),e[17]=a,e[18]=h,e[19]=f.name,e[20]=m):m=e[20];let x;e[21]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[21]=f.name,e[22]=x):x=e[22];let y;e[23]!==c||e[24]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[23]=c,e[24]=f.email,e[25]=y):y=e[25];let j;e[26]!==x||e[27]!==y?(j=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[26]=x,e[27]=y,e[28]=j):j=e[28];let S;return e[29]!==C||e[30]!==m||e[31]!==j?(S=t.jsxs("div",{className:C,children:[m,j]}),e[29]=C,e[30]=m,e[31]=j,e[32]=S):S=e[32],S}const Ft=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Kt(n){return Object.keys(n).find(e=>Ft.includes(e.toLowerCase()))}function et(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Ut(n){const e=ne.c(32),{data:s,schema:d,viewMode:i,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:o,actions:u,onItemClick:C,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:j,sortableFields:S}=n,r=l===void 0?qt:l,g=f===void 0?"asc":f,v=o===void 0?Wt:o;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=C===void 0?Vt:C,I=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,P=j===void 0?!1:j,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Rt).filter(O=>!D||D.includes(O.id)).map(Bt):et(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const M=z;let $;e[6]!==I||e[7]!==P||e[8]!==v||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==M||e[13]!==i?($=!P&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:i,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:v,sortOptions:M})})]})}),e[6]=I,e[7]=P,e[8]=v,e[9]=r,e[10]=g,e[11]=c,e[12]=M,e[13]=i,e[14]=$):$=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==v||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==i?(A=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>b?.(O),className:"cursor-pointer h-full",children:t.jsx(Pt,{item:O,schema:d,readOnly:E,actions:_})},O.id))})}):t.jsx(xt,{columns:Jt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:v,onRowClick:b,emptyState:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=v,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=i,e[28]=A):A=e[28];let k;return e[29]!==$||e[30]!==A?(k=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,A]}),e[29]=$,e[30]=A,e[31]=k):k=e[31],k}function Bt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Rt(n){return n.sortable!==!1}function Vt(){}function Wt(){}function qt(){}function Gt(n){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(He,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Le,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(L,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function tt(n){const e=n.type;return Array.isArray(e)?e.every(s=>tt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ht(n,e){const s=n.properties||{},d=Object.keys(s).filter(o=>{const u=s[o];return u&&tt(u)}),i=Kt(s),l=[],a=new Set;i&&d.includes(i)&&(l.push(i),a.add(i));const c=["title","description","updated_at","updated_by"];for(const o of c)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));const f=d.filter(o=>!a.has(o)&&!Re.includes(o)).sort((o,u)=>o.localeCompare(u));for(const o of f)l.push(o),a.add(o);for(const o of Re)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));return l.map(o=>{const u=s[o],C=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:h=>{const m=h[o];return t.jsx(Ve,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:C,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx(Mt,{id:String(m),size:"xs"}):"—"},sortable:C,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:C,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:C,cellClassName:"max-w-[200px]"}})}function Jt(n,e,s,d){const i=n||Ht(e,s);return i.some(c=>c.id==="actions")?i:Object.keys(d).length>0?[...i,Gt(d)]:i}function Cs(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:i}=n,l=i.name,a=i.schema??Ct,c=i.hasCreateTool,f=i.hasUpdateTool,o=i.hasDeleteTool,u=lt(),h=rt().location.href,{data:m}=at.useSession(),x=m?.user?.id||"unknown",y=dt(s);let j;e[0]!==s?(j=We(s),e[0]=s,e[1]=j):j=e[1];const S=j,r=mt(s,l,S),g=`${s}-${l}`;let v;e[2]!==d||e[3]!==g?(v={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=v):v=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:I,setViewMode:T,sortKey:E,sortDirection:N,handleSort:P}=ht(v);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=ft(s,l,S,D),M=!c&&!f&&!o;let $;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?($=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=$):$=e[13];const A=$;let k;e[14]!==r.create||e[15]!==x?(k=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Ke("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=k):k=e[16];const O=k,[F,xe]=ke.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const st=le;let K;e[18]!==A||e[19]!==f?(K=f&&{edit:A},e[18]=A,e[19]=f,e[20]=K):K=e[20];let U;e[21]!==O||e[22]!==c?(U=c&&{duplicate:O},e[21]=O,e[22]=c,e[23]=U):U=e[23];let B;e[24]!==o?(B=o&&{delete:st},e[24]=o,e[25]=B):B=e[25];let re;e[26]!==B||e[27]!==K||e[28]!==U?(re={...K,...U,...B},e[26]=B,e[27]=K,e[28]=U,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==F?(ae=async()=>{F&&(await r.delete.mutateAsync(F.id),xe(null))},e[30]=r.delete,e[31]=F,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){ct.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ke("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const ve=ce;let de;e[41]!==a?(de=et(a),e[41]=a,e[42]=de):de=e[42];const Ce=de,Me=(z?.length??0)>0,ot=c&&Me,it=c&&!Me&&!p;let me;e[43]!==r.create||e[44]!==ve||e[45]!==c?(me=c?t.jsxs(Oe,{onClick:ve,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=ve,e[45]=c,e[46]=me):me=e[46];const Fe=me,be=E;let R;e[47]!==P||e[48]!==T||e[49]!==N||e[50]!==Ce||e[51]!==be||e[52]!==I?(R=t.jsx(qe,{viewMode:I,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:P,sortOptions:Ce}),e[47]=P,e[48]=T,e[49]=N,e[50]=Ce,e[51]=be,e[52]=I,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(vt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=ot&&Fe;let W;e[58]!==R||e[59]!==V||e[60]!==we?(W=t.jsxs($t,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=W):W=e[61];const Se=`Search ${l}...`;let q;e[62]!==b?(q=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=q):q=e[63];let G;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==q?(G=t.jsx(ut,{value:p,onChange:b,placeholder:Se,onKeyDown:q}),e[64]=p,e[65]=b,e[66]=Se,e[67]=q,e[68]=G):G=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=it?Fe:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(jt,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==P||e[78]!==M||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==I?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Ut,{hideToolbar:!0,data:H,schema:a,viewMode:I,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:P,actions:ge,onItemClick:J,readOnly:M,emptyState:Q})}),e[77]=P,e[78]=M,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=I,e[90]=Y):Y=e[90];let Z;e[91]!==G||e[92]!==Y?(Z=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,Y]}),e[91]=G,e[92]=Y,e[93]=Z):Z=e[93];const $e=!!F;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ie=F?.title;let X;e[96]!==Ie?(X=t.jsxs(wt,{children:[ue,t.jsxs(St,{children:['Are you sure you want to delete "',Ie,'"? This action cannot be undone.']})]}),e[96]=Ie,e[97]=X):X=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(bt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(te=t.jsx(yt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(_t,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==X||e[108]!==se?(oe=t.jsxs(Dt,{children:[X,se]}),e[107]=X,e[108]=se,e[109]=oe):oe=e[109];let ie;e[110]!==$e||e[111]!==oe?(ie=t.jsx(At,{open:$e,onOpenChange:fe,children:oe}),e[110]=$e,e[111]=oe,e[112]=ie):ie=e[112];let pe;return e[113]!==W||e[114]!==Z||e[115]!==ie?(pe=t.jsxs(t.Fragment,{children:[W,Z,ie]}),e[113]=W,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}export{Cs as C};
1
+ import{r as ke,c as ne,j as t,K as nt,f as lt,g as rt,a as at,t as ct}from"./index-DEMNtulg.js";import{g as Ke}from"./generate-id-Dyweu44Y.js";import{I as Ve,c as We,b as dt,d as mt,e as ft}from"./use-connection-D-LWel3A.js";import{C as qe}from"./collection-display-button-D4VM0KQx.js";import{C as ut}from"./collection-search-LnYLnFH8.js";import{C as pt}from"./card-7VW-xSd-.js";import{b as Ge,D as He,a as Je,c as L}from"./dropdown-menu-uXj8nKiT.js";import{B as Oe}from"./button-B13xcF6W.js";import{a as Qe}from"./Copy01-DhXqtugg.js";import{i as Ye}from"./DotsVertical-roys0n6e.js";import{s as Ze,u as ht}from"./use-list-state-CmxR0QRn.js";import{s as Xe}from"./Trash01-Ctk7srex.js";import{C as xt}from"./collection-table-wrapper-B0AFEn1d.js";import{E as Ue}from"./empty-state-N07FE0YG.js";import{n as Be}from"./Inbox01-D66dNA_K.js";import{A as ze}from"./avatar-BHE7lL4M.js";import{u as gt}from"./useQuery-DLJrS2VC.js";import{E as jt}from"./SearchMd-C6P9P1wF.js";import{P as vt}from"./pin-to-sidebar-button-BKotT_Nc.js";import{B as Ct}from"./constants-CN4QOiqe.js";import{A as bt,g as yt,c as Nt,b as wt,d as St,e as _t,a as Dt,f as At}from"./alert-dialog-D6UjYOUP.js";import{s as Tt}from"./Plus-CwB-Rc8B.js";import{V as $t}from"./layout-BNxxrCBw.js";const Le=({size:n=24,color:e="currentColor",...s})=>ke.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},ke.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Le.displayName="Edit01";function It(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of d)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Pt(n){const e=ne.c(25),{item:s,schema:d,actions:i}=n;let l;e[0]!==s||e[1]!==d?(l=It(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==i?(f=i&&Object.keys(i).length>0,e[3]=i,e[4]=f):f=e[4];const o=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(Ve,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let C;e[8]!==s.title?(C=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=C):C=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==C||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[C,m]}),e[12]=C,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let j;e[18]!==i||e[19]!==o||e[20]!==s?(j=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Ot,onMouseDown:kt,children:t.jsxs(Ge,{children:[t.jsx(He,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:Et,children:[i.open&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.open?.(s)},children:[t.jsx(Ze,{size:16}),"Open"]}),i.edit&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.edit?.(s)},children:[t.jsx(Le,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(L,{onClick:r=>{r.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(L,{variant:"destructive",onClick:r=>{r.stopPropagation(),i.delete?.(s)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=j):j=e[21];let S;return e[22]!==y||e[23]!==j?(S=t.jsxs(pt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,j]}),e[22]=y,e[23]=j,e[24]=S):S=e[24],S}function Et(n){return n.stopPropagation()}function zt(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function Lt(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=We(),e[0]=s):s=e[0];const d=s;let i;e[1]!==n?(i=nt.user(n),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==i||e[6]!==l||e[7]!==a?(c={queryKey:i,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=i,e[6]=l,e[7]=a,e[8]=c):c=e[8],gt(c)}function Mt(n){const e=ne.c(33),{id:s,size:d,showEmail:i,className:l}=n,a=d===void 0?"xs":d,c=i===void 0?!1:i,{data:f,isLoading:o,isError:u}=Lt(s);if(o){const r=`flex items-center gap-2 ${l||""}`;let g;e[0]!==a?(g=t.jsx(ze.Skeleton,{shape:"circle",size:a}),e[0]=a,e[1]=g):g=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=v):v=e[2];let p;e[3]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=c,e[4]=p):p=e[4];let _;e[5]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[v,p]}),e[5]=p,e[6]=_):_=e[6];let b;return e[7]!==r||e[8]!==g||e[9]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[7]=r,e[8]=g,e[9]=_,e[10]=b):b=e[10],b}if(u||!f){const r=`flex items-center gap-2 ${l||""}`;let g;e[11]!==a?(g=t.jsx(ze,{shape:"circle",size:a,fallback:"?",muted:!0}),e[11]=a,e[12]=g):g=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=v):v=e[13];let p;return e[14]!==r||e[15]!==g?(p=t.jsxs("div",{className:r,children:[g,v]}),e[14]=r,e[15]=g,e[16]=p):p=e[16],p}const C=`flex items-center gap-2 ${l||""}`,h=f.image??void 0;let m;e[17]!==a||e[18]!==h||e[19]!==f.name?(m=t.jsx(ze,{shape:"circle",size:a,url:h,fallback:f.name}),e[17]=a,e[18]=h,e[19]=f.name,e[20]=m):m=e[20];let x;e[21]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[21]=f.name,e[22]=x):x=e[22];let y;e[23]!==c||e[24]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[23]=c,e[24]=f.email,e[25]=y):y=e[25];let j;e[26]!==x||e[27]!==y?(j=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[26]=x,e[27]=y,e[28]=j):j=e[28];let S;return e[29]!==C||e[30]!==m||e[31]!==j?(S=t.jsxs("div",{className:C,children:[m,j]}),e[29]=C,e[30]=m,e[31]=j,e[32]=S):S=e[32],S}const Ft=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Kt(n){return Object.keys(n).find(e=>Ft.includes(e.toLowerCase()))}function et(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Ut(n){const e=ne.c(32),{data:s,schema:d,viewMode:i,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:o,actions:u,onItemClick:C,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:j,sortableFields:S}=n,r=l===void 0?qt:l,g=f===void 0?"asc":f,v=o===void 0?Wt:o;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=C===void 0?Vt:C,I=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,P=j===void 0?!1:j,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Rt).filter(O=>!D||D.includes(O.id)).map(Bt):et(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const M=z;let $;e[6]!==I||e[7]!==P||e[8]!==v||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==M||e[13]!==i?($=!P&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{viewMode:i,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:v,sortOptions:M})})]})}),e[6]=I,e[7]=P,e[8]=v,e[9]=r,e[10]=g,e[11]=c,e[12]=M,e[13]=i,e[14]=$):$=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==v||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==i?(A=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(O=>t.jsx("div",{onClick:()=>b?.(O),className:"cursor-pointer h-full",children:t.jsx(Pt,{item:O,schema:d,readOnly:E,actions:_})},O.id))})}):t.jsx(xt,{columns:Jt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:v,onRowClick:b,emptyState:T||t.jsx(Ue,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=v,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=i,e[28]=A):A=e[28];let k;return e[29]!==$||e[30]!==A?(k=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,A]}),e[29]=$,e[30]=A,e[31]=k):k=e[31],k}function Bt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Rt(n){return n.sortable!==!1}function Vt(){}function Wt(){}function qt(){}function Gt(n){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(He,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Ye,{size:20})})}),t.jsxs(Je,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ze,{size:16}),"Open"]}),n.edit&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Le,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(L,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(L,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function tt(n){const e=n.type;return Array.isArray(e)?e.every(s=>tt({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ht(n,e){const s=n.properties||{},d=Object.keys(s).filter(o=>{const u=s[o];return u&&tt(u)}),i=Kt(s),l=[],a=new Set;i&&d.includes(i)&&(l.push(i),a.add(i));const c=["title","description","updated_at","updated_by"];for(const o of c)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));const f=d.filter(o=>!a.has(o)&&!Re.includes(o)).sort((o,u)=>o.localeCompare(u));for(const o of f)l.push(o),a.add(o);for(const o of Re)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));return l.map(o=>{const u=s[o],C=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:h=>{const m=h[o];return t.jsx(Ve,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:C,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx(Mt,{id:String(m),size:"xs"}):"—"},sortable:C,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:C,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:C,cellClassName:"max-w-[200px]"}})}function Jt(n,e,s,d){const i=n||Ht(e,s);return i.some(c=>c.id==="actions")?i:Object.keys(d).length>0?[...i,Gt(d)]:i}function Cs(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:i}=n,l=i.name,a=i.schema??Ct,c=i.hasCreateTool,f=i.hasUpdateTool,o=i.hasDeleteTool,u=lt(),h=rt().location.href,{data:m}=at.useSession(),x=m?.user?.id||"unknown",y=dt(s);let j;e[0]!==s?(j=We(s),e[0]=s,e[1]=j):j=e[1];const S=j,r=mt(s,l,S),g=`${s}-${l}`;let v;e[2]!==d||e[3]!==g?(v={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=v):v=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:I,setViewMode:T,sortKey:E,sortDirection:N,handleSort:P}=ht(v);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=ft(s,l,S,D),M=!c&&!f&&!o;let $;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?($=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=$):$=e[13];const A=$;let k;e[14]!==r.create||e[15]!==x?(k=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Ke("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=k):k=e[16];const O=k,[F,xe]=ke.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const st=le;let K;e[18]!==A||e[19]!==f?(K=f&&{edit:A},e[18]=A,e[19]=f,e[20]=K):K=e[20];let U;e[21]!==O||e[22]!==c?(U=c&&{duplicate:O},e[21]=O,e[22]=c,e[23]=U):U=e[23];let B;e[24]!==o?(B=o&&{delete:st},e[24]=o,e[25]=B):B=e[25];let re;e[26]!==B||e[27]!==K||e[28]!==U?(re={...K,...U,...B},e[26]=B,e[27]=K,e[28]=U,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==F?(ae=async()=>{F&&(await r.delete.mutateAsync(F.id),xe(null))},e[30]=r.delete,e[31]=F,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){ct.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ke("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const ve=ce;let de;e[41]!==a?(de=et(a),e[41]=a,e[42]=de):de=e[42];const Ce=de,Me=(z?.length??0)>0,ot=c&&Me,it=c&&!Me&&!p;let me;e[43]!==r.create||e[44]!==ve||e[45]!==c?(me=c?t.jsxs(Oe,{onClick:ve,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=ve,e[45]=c,e[46]=me):me=e[46];const Fe=me,be=E;let R;e[47]!==P||e[48]!==T||e[49]!==N||e[50]!==Ce||e[51]!==be||e[52]!==I?(R=t.jsx(qe,{viewMode:I,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:P,sortOptions:Ce}),e[47]=P,e[48]=T,e[49]=N,e[50]=Ce,e[51]=be,e[52]=I,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(vt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=ot&&Fe;let W;e[58]!==R||e[59]!==V||e[60]!==we?(W=t.jsxs($t,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=W):W=e[61];const Se=`Search ${l}...`;let q;e[62]!==b?(q=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=q):q=e[63];let G;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==q?(G=t.jsx(ut,{value:p,onChange:b,placeholder:Se,onKeyDown:q}),e[64]=p,e[65]=b,e[66]=Se,e[67]=q,e[68]=G):G=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=it?Fe:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(jt,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==P||e[78]!==M||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==I?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Ut,{hideToolbar:!0,data:H,schema:a,viewMode:I,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:P,actions:ge,onItemClick:J,readOnly:M,emptyState:Q})}),e[77]=P,e[78]=M,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=I,e[90]=Y):Y=e[90];let Z;e[91]!==G||e[92]!==Y?(Z=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,Y]}),e[91]=G,e[92]=Y,e[93]=Z):Z=e[93];const $e=!!F;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ie=F?.title;let X;e[96]!==Ie?(X=t.jsxs(wt,{children:[ue,t.jsxs(St,{children:['Are you sure you want to delete "',Ie,'"? This action cannot be undone.']})]}),e[96]=Ie,e[97]=X):X=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(bt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(te=t.jsx(yt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(_t,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==X||e[108]!==se?(oe=t.jsxs(Dt,{children:[X,se]}),e[107]=X,e[108]=se,e[109]=oe):oe=e[109];let ie;e[110]!==$e||e[111]!==oe?(ie=t.jsx(At,{open:$e,onOpenChange:fe,children:oe}),e[110]=$e,e[111]=oe,e[112]=ie):ie=e[112];let pe;return e[113]!==W||e[114]!==Z||e[115]!==ie?(pe=t.jsxs(t.Fragment,{children:[W,Z,ie]}),e[113]=W,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}export{Cs as C};
@@ -1 +1 @@
1
- import{c as g,j as o}from"./index-tz4gB72W.js";import{c as u}from"./button-BSXU4L7C.js";import{n as T}from"./collection-display-button-BAoFTB4b.js";import{i as $}from"./Grid01-BTunGha4.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
1
+ import{c as g,j as o}from"./index-DEMNtulg.js";import{c as u}from"./button-B13xcF6W.js";import{n as T}from"./collection-display-button-D4VM0KQx.js";import{i as $}from"./Grid01-CkwdbRed.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
@@ -1 +1 @@
1
- import{c as S,j as s}from"./index-tz4gB72W.js";import{C as _}from"./card-CXFRieEW.js";import{c as j}from"./button-BSXU4L7C.js";import{I as A}from"./use-connection-DRZbGk_A.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
1
+ import{c as S,j as s}from"./index-DEMNtulg.js";import{C as _}from"./card-7VW-xSd-.js";import{c as j}from"./button-B13xcF6W.js";import{I as A}from"./use-connection-D-LWel3A.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
@@ -1 +1 @@
1
- import{c as q,j as o,f as W,g as J,r as z,d as ce,b as le,af as ae}from"./index-tz4gB72W.js";import{E as F}from"./SearchMd-BFumDfkS.js";import{E as Q}from"./error-boundary-D5hb-PLt.js";import{b as G,I as X,a as me}from"./use-connection-DRZbGk_A.js";import{b as de}from"./use-binding-jUI3xZmp.js";import{u as ue,S as pe}from"./index-gqIvEQSH.js";import{u as fe,a as he}from"./use-connection-resources-B3tDNT6E.js";import{B as xe}from"./button-BSXU4L7C.js";import{i as Y}from"./Loading01-B0vdyVbH.js";import{R as ge}from"./resource-tabs-CmUpRVKA.js";import{V as Z,a as be,b as je}from"./layout-DtfNegCp.js";import{C as ye}from"./collection-tab-dwp9LGxi.js";import{C as ee}from"./collection-display-button-BAoFTB4b.js";import{C as te}from"./collection-search-CrC01K4Z.js";import{C as oe}from"./collection-table-wrapper-CFoaxah9.js";import{P as se}from"./pin-to-sidebar-button-CwlJToUG.js";import{C as ne}from"./card-CXFRieEW.js";import{R as Se,T as Ce}from"./tools-list-thZyoBrU.js";import"./tooltip-Bzy1O5cq.js";import"./auth-BpfHzPVh.js";import"./mcp-oauth-BOAcAnr_.js";import"./env-vars-editor-nU4IPD2j.js";import"./input-Cb7MaM0d.js";import"./Plus-nu8-Nz8b.js";import"./Trash01-1tKgR7uh.js";import"./use-tool-call-CsOSZ1pI.js";import"./useQuery-Bl78N6vT.js";import"./File06-DxUGl7Wc.js";import"./Key01-Bqzm5f6K.js";import"./form-Dn7fy5O5.js";import"./select-HGITgxwS.js";import"./ChevronDown-rNVX3ifZ.js";import"./Terminal-CDIp_seB.js";import"./use-gateway-CUxuCVmJ.js";import"./CpuChip02-DwHhz9CA.js";import"./formatDistanceToNow-km7E2wF1.js";import"./constants-C-5m3xCJ.js";import"./registry-utils-ulDDT0d8.js";import"./extract-connection-data-BWB54H7f.js";import"./generate-id-Dyweu44Y.js";import"./index-DX5d9vx1.js";import"./index-CcNvI65p.js";import"./badge-Dkhmn9Qj.js";import"./ArrowLeft-DC_Ebc-m.js";import"./dropdown-menu-ClBJUvd8.js";import"./Copy01-CCVZH6f1.js";import"./DotsVertical-8kkJJG9R.js";import"./use-list-state-CkGBL95Z.js";import"./use-mobile-B8xlavN6.js";import"./empty-state-CYnIzDhF.js";import"./Inbox01-BoV8p7IN.js";import"./avatar-DHKqC-IM.js";import"./alert-dialog-_VCwcCen.js";import"./Grid01-BTunGha4.js";import"./view-mode-toggle-COcukfhX.js";import"./use-organization-settings-C7IdFOTo.js";function ve(t){const e=q.c(42),{prompts:r,connectionId:n,org:s,connectionTitle:l,connectionIcon:f,onPromptClick:j,showToolbar:g,emptyMessage:N}=t,V=g===void 0?!0:g,L=N===void 0?"This connection doesn't have any prompts yet.":N,u=W(),y=J().location.href,[p,i]=z.useState(""),[w,a]=z.useState("table"),[h,_]=z.useState("name"),[d,k]=z.useState("asc");let b;e[0]!==d||e[1]!==h?(b=x=>{h===x?(k(Ie),d==="desc"&&_(void 0)):(_(x),k("asc"))},e[0]=d,e[1]=h,e[2]=b):b=e[2];const T=b;let P;e[3]!==n||e[4]!==u||e[5]!==j||e[6]!==s?(P=x=>{j?j(x):n&&s&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:n,collectionName:"prompts",itemId:encodeURIComponent(x.name)}})},e[3]=n,e[4]=u,e[5]=j,e[6]=s,e[7]=P):P=e[7];const A=P;let B;if(e[8]!==r||e[9]!==p||e[10]!==d||e[11]!==h){const x=!r||r.length===0?[]:p.trim()?(()=>{const S=p.toLowerCase();return r.filter(U=>U.name.toLowerCase().includes(S)||U.description&&U.description.toLowerCase().includes(S))})():r;B=!h||!d?x:[...x].sort((S,U)=>{const re=S[h]||"",ie=U[h]||"",H=String(re).localeCompare(String(ie));return d==="asc"?H:-H}),e[8]=r,e[9]=p,e[10]=d,e[11]=h,e[12]=B}else B=e[12];const m=B;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:$e,sortable:!0},{id:"description",header:"Description",render:Te,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const E=O;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=E.filter(we).map(Ne),e[14]=M):M=e[14];const D=M;let $;e[15]!==f||e[16]!==l||e[17]!==T||e[18]!==V||e[19]!==d||e[20]!==h||e[21]!==y||e[22]!==w?($=V&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:w,onViewModeChange:a,sortKey:h,sortDirection:d,onSort:T,sortOptions:D}),o.jsx(se,{title:l?`${l}: Prompts`:"Prompts",url:y,icon:f??"description"})]}),e[15]=f,e[16]=l,e[17]=T,e[18]=V,e[19]=d,e[20]=h,e[21]=y,e[22]=w,e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=x=>{x.key==="Escape"&&(i(""),x.target.blur())},e[24]=I):I=e[24];let R;e[25]!==p?(R=o.jsx(te,{value:p,onChange:i,placeholder:"Search prompts...",onKeyDown:I}),e[25]=p,e[26]=R):R=e[26];let c;e[27]!==L||e[28]!==A||e[29]!==T||e[30]!==p||e[31]!==d||e[32]!==h||e[33]!==m||e[34]!==w?(c=w==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:m.length===0?o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":L}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:m.map(x=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>A(x),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(X,{icon:null,name:x.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x.description||"No description"})]})]})},x.name))})}):o.jsx(oe,{columns:E,data:m,isLoading:!1,sortKey:h,sortDirection:d,onSort:T,onRowClick:x=>A(x),emptyState:o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":L})}),e[27]=L,e[28]=A,e[29]=T,e[30]=p,e[31]=d,e[32]=h,e[33]=m,e[34]=w,e[35]=c):c=e[35];let C;e[36]!==R||e[37]!==c?(C=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[R,c]}),e[36]=R,e[37]=c,e[38]=C):C=e[38];let v;return e[39]!==C||e[40]!==$?(v=o.jsxs(o.Fragment,{children:[$,C]}),e[39]=C,e[40]=$,e[41]=v):v=e[41],v}function Ne(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function we(t){return t.sortable}function Te(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function $e(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Ie(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Re(t){const e=q.c(6),{prompts:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ve,{prompts:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function _e(t){const e=q.c(2),{repository:r}=t;let n;return e[0]!==r?(n=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Se,{repository:r})}),e[0]=r,e[1]=n):n=e[1],n}function ke(t){const e=q.c(39),{resources:r,connectionTitle:n,connectionIcon:s,onResourceClick:l,showToolbar:f,emptyMessage:j}=t,g=f===void 0?!0:f,N=j===void 0?"This connection doesn't have any resources yet.":j,L=J().location.href,[u,K]=z.useState(""),[y,p]=z.useState("table"),[i,w]=z.useState("name"),[a,h]=z.useState("asc");let _;e[0]!==a||e[1]!==i?(_=c=>{i===c?(h(De),a==="desc"&&w(void 0)):(w(c),h("asc"))},e[0]=a,e[1]=i,e[2]=_):_=e[2];const d=_;let k;e[3]!==l?(k=c=>{l&&l(c)},e[3]=l,e[4]=k):k=e[4];const b=k;let T;if(e[5]!==r||e[6]!==u||e[7]!==a||e[8]!==i){const c=!r||r.length===0?[]:u.trim()?(()=>{const C=u.toLowerCase();return r.filter(v=>v.uri.toLowerCase().includes(C)||v.name&&v.name.toLowerCase().includes(C)||v.description&&v.description.toLowerCase().includes(C))})():r;T=!i||!a?c:[...c].sort((C,v)=>{const x=C[i]||"",S=v[i]||"",U=String(x).localeCompare(String(S));return a==="asc"?U:-U}),e[5]=r,e[6]=u,e[7]=a,e[8]=i,e[9]=T}else T=e[9];const P=T;let A;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=[{id:"name",header:"Name",render:Ae,sortable:!0},{id:"uri",header:"URI",render:Me,sortable:!0},{id:"description",header:"Description",render:Ee,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Le,sortable:!0}],e[10]=A):A=e[10];const B=A;let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=B.filter(Ve).map(Pe),e[11]=m):m=e[11];const O=m;let E;e[12]!==s||e[13]!==n||e[14]!==d||e[15]!==g||e[16]!==a||e[17]!==i||e[18]!==L||e[19]!==y?(E=g&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:y,onViewModeChange:p,sortKey:i,sortDirection:a,onSort:d,sortOptions:O}),o.jsx(se,{title:n?`${n}: Resources`:"Resources",url:L,icon:s??"folder"})]}),e[12]=s,e[13]=n,e[14]=d,e[15]=g,e[16]=a,e[17]=i,e[18]=L,e[19]=y,e[20]=E):E=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=c=>{c.key==="Escape"&&(K(""),c.target.blur())},e[21]=M):M=e[21];let D;e[22]!==u?(D=o.jsx(te,{value:u,onChange:K,placeholder:"Search resources...",onKeyDown:M}),e[22]=u,e[23]=D):D=e[23];let $;e[24]!==N||e[25]!==b||e[26]!==d||e[27]!==u||e[28]!==a||e[29]!==i||e[30]!==P||e[31]!==y?($=y==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:P.length===0?o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:P.map(c=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>b(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(X,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(oe,{columns:B,data:P,isLoading:!1,sortKey:i,sortDirection:a,onSort:d,onRowClick:c=>b(c),emptyState:o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N})}),e[24]=N,e[25]=b,e[26]=d,e[27]=u,e[28]=a,e[29]=i,e[30]=P,e[31]=y,e[32]=$):$=e[32];let I;e[33]!==D||e[34]!==$?(I=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,$]}),e[33]=D,e[34]=$,e[35]=I):I=e[35];let R;return e[36]!==I||e[37]!==E?(R=o.jsxs(o.Fragment,{children:[E,I]}),e[36]=I,e[37]=E,e[38]=R):R=e[38],R}function Pe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ve(t){return t.sortable}function Le(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function Ee(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Me(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Ae(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function De(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Be(t){const e=q.c(6),{resources:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ke,{resources:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Ue(t){const e=q.c(4),{tools:r,connectionId:n,org:s}=t;let l;return e[0]!==n||e[1]!==s||e[2]!==r?(l=o.jsx(Ce,{tools:r,connectionId:n,org:s}),e[0]=n,e[1]=s,e[2]=r,e[3]=l):l=e[3],l}function Ke(t){const e=q.c(61),{connection:r,connectionId:n,org:s,requestedTabId:l,collections:f,onUpdate:j,isUpdating:g,prompts:N,resources:V}=t,L=ae();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/mcps/$connectionId"},e[0]=u):u=e[0];const K=W(u);let y;e[1]!==n?(y={connectionId:n},e[1]=n,e[2]=y):y=e[2];const p=ue(y),i=p.isAuthenticated,w=r?.metadata?.repository,a=!!w?.url,h=r?.tools?.length??0,_=N.length,d=V.length;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let b;e[4]!==i||e[5]!==h?(b=i&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=i,e[5]=h,e[6]=b):b=e[6];let T;e[7]!==i||e[8]!==_?(T=i&&_>0?[{id:"prompts",label:"Prompts",count:_}]:[],e[7]=i,e[8]=_,e[9]=T):T=e[9];let P;e[10]!==i||e[11]!==d?(P=i&&d>0?[{id:"resources",label:"Resources",count:d}]:[],e[10]=i,e[11]=d,e[12]=P):P=e[12];let A;if(e[13]!==f||e[14]!==a||e[15]!==i||e[16]!==b||e[17]!==T||e[18]!==P){let S;e[20]!==a?(S=a?[{id:"readme",label:"README"}]:[],e[20]=a,e[21]=S):S=e[21],A=[k,...b,...T,...P,...i?(f||[]).map(Oe):[],...S],e[13]=f,e[14]=a,e[15]=i,e[16]=b,e[17]=T,e[18]=P,e[19]=A}else A=e[19];const B=A,m=B.some(S=>S.id===l)?l:"settings";let O;e[22]!==K?(O=S=>{K({search:U=>({...U,tab:S}),replace:!0})},e[22]=K,e[23]=O):O=e[23];const E=O;let M;e[24]!==f?(M=f||[],e[24]=f,e[25]=M):M=e[25];let D;if(e[26]!==m||e[27]!==M){let S;e[29]!==m?(S=U=>U.name===m,e[29]=m,e[30]=S):S=e[30],D=M.find(S),e[26]=m,e[27]=M,e[28]=D}else D=e[28];const $=D;let I;e[31]!==L.history?(I=()=>L.history.back(),e[31]=L.history,e[32]=I):I=e[32];let R;e[33]!==m||e[34]!==E||e[35]!==B?(R=o.jsx(be,{children:o.jsx(ge,{tabs:B,activeTab:m,onTabChange:E})}),e[33]=m,e[34]=E,e[35]=B,e[36]=R):R=e[36];let c;e[37]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=c):c=e[37];let C;e[38]!==$||e[39]!==m||e[40]!==p.isServerError||e[41]!==p.supportsOAuth||e[42]!==r||e[43]!==n||e[44]!==E||e[45]!==a||e[46]!==i||e[47]!==g||e[48]!==j||e[49]!==s||e[50]!==N||e[51]!==w||e[52]!==V?(C=o.jsx(z.Suspense,{fallback:c,children:m==="tools"?o.jsx(Ue,{tools:r.tools??void 0,connectionId:n,org:s}):m==="prompts"?o.jsx(Re,{prompts:N,connectionId:n,org:s}):m==="resources"?o.jsx(Be,{resources:V,connectionId:n,org:s}):m==="settings"?o.jsx(pe,{connection:r,onUpdate:j,isUpdating:g,isMCPAuthenticated:i,supportsOAuth:p.supportsOAuth,isServerError:p.isServerError,onViewReadme:a?()=>E("readme"):void 0}):m==="readme"&&a?o.jsx(_e,{repository:w}):$&&i?o.jsx(ye,{connectionId:n,org:s,activeCollection:$},m):o.jsx(F,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=m,e[40]=p.isServerError,e[41]=p.supportsOAuth,e[42]=r,e[43]=n,e[44]=E,e[45]=a,e[46]=i,e[47]=g,e[48]=j,e[49]=s,e[50]=N,e[51]=w,e[52]=V,e[53]=C):C=e[53];let v;e[54]!==m||e[55]!==C?(v=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Q,{children:C},m)})}),e[54]=m,e[55]=C,e[56]=v):v=e[56];let x;return e[57]!==I||e[58]!==R||e[59]!==v?(x=o.jsxs(je,{onBack:I,children:[R,v]}),e[57]=I,e[58]=R,e[59]=v,e[60]=x):x=e[60],x}function Oe(t){return{id:t.name,label:t.displayName}}function ze(){const t=q.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const r=W(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId"},t[1]=n):n=t[1];const{connectionId:s,org:l}=ce(n);let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const g=le(f).tab||"settings",N=G(s),V=me(),L=de(N??void 0);let u;t[3]!==s?(u=[s],t[3]=s,t[4]=u):u=t[4];const{promptsMap:K}=fe(u);let y;t[5]!==s?(y=[s],t[5]=s,t[6]=y):y=t[6];const{resourcesMap:p}=he(y);let i;t[7]!==s||t[8]!==K?(i=K.get(s)??[],t[7]=s,t[8]=K,t[9]=i):i=t[9];const w=i;let a;t[10]!==s||t[11]!==p?(a=p.get(s)??[],t[10]=s,t[11]=p,t[12]=a):a=t[12];const h=a;let _;t[13]!==V.update||t[14]!==s?(_=async b=>{await V.update.mutateAsync({id:s,data:b})},t[13]=V.update,t[14]=s,t[15]=_):_=t[15];const d=_;if(!N){let b;return t[16]!==r||t[17]!==l?(b=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(F,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(xe,{variant:"outline",onClick:()=>r({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=r,t[17]=l,t[18]=b):b=t[18],b}let k;return t[19]!==V.update.isPending||t[20]!==L||t[21]!==N||t[22]!==s||t[23]!==d||t[24]!==l||t[25]!==w||t[26]!==g||t[27]!==h?(k=o.jsx(Ke,{org:l,connection:N,connectionId:s,requestedTabId:g,collections:L,onUpdate:d,isUpdating:V.update.isPending,prompts:w,resources:h}),t[19]=V.update.isPending,t[20]=L,t[21]=N,t[22]=s,t[23]=d,t[24]=l,t[25]=w,t[26]=g,t[27]=h,t[28]=k):k=t[28],k}function qe(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Q,{children:o.jsx(z.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(ze,{})})}),t[0]=e):e=t[0],e}function Gt(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(qe,{}),t[0]=e):e=t[0],e}export{Gt as default};
1
+ import{c as q,j as o,f as W,g as J,r as z,d as ce,b as le,af as ae}from"./index-DEMNtulg.js";import{E as F}from"./SearchMd-C6P9P1wF.js";import{E as Q}from"./error-boundary-Ce0_dLsG.js";import{b as G,I as X,a as me}from"./use-connection-D-LWel3A.js";import{b as de}from"./use-binding-Ce8NG0MO.js";import{u as ue,S as pe}from"./index-CVgkE3Gv.js";import{u as fe,a as he}from"./use-connection-resources-CJzk5_Wj.js";import{B as xe}from"./button-B13xcF6W.js";import{i as Y}from"./Loading01-EiDV-2FW.js";import{R as ge}from"./resource-tabs-qR3NhTLd.js";import{V as Z,a as be,b as je}from"./layout-BNxxrCBw.js";import{C as ye}from"./collection-tab-bg_gmLyh.js";import{C as ee}from"./collection-display-button-D4VM0KQx.js";import{C as te}from"./collection-search-LnYLnFH8.js";import{C as oe}from"./collection-table-wrapper-B0AFEn1d.js";import{P as se}from"./pin-to-sidebar-button-BKotT_Nc.js";import{C as ne}from"./card-7VW-xSd-.js";import{R as Se,T as Ce}from"./tools-list-l6xtSgWR.js";import"./tooltip-C7B84lYF.js";import"./auth-CZR9mNdb.js";import"./mcp-oauth-Dqr97r2H.js";import"./env-vars-editor-B7JL_p-V.js";import"./input-YdP8mwrf.js";import"./Plus-CwB-Rc8B.js";import"./Trash01-Ctk7srex.js";import"./use-tool-call-BN3WED_Z.js";import"./useQuery-DLJrS2VC.js";import"./File06-MlW8n69V.js";import"./Key01-BXlD7hmS.js";import"./form-BQIYj24w.js";import"./select-L_OjJ9sW.js";import"./ChevronDown-atiP0m-F.js";import"./Terminal-Dv6w41J8.js";import"./use-gateway-eXp_1iQc.js";import"./CpuChip02-BtgBI59l.js";import"./formatDistanceToNow-CArtWgcP.js";import"./constants-CN4QOiqe.js";import"./registry-utils-ulDDT0d8.js";import"./extract-connection-data-CeT4F9gU.js";import"./generate-id-Dyweu44Y.js";import"./index-DcMa5gDs.js";import"./index-DcvTq0xJ.js";import"./badge-B-u7R38I.js";import"./ArrowLeft-CJ-eKoid.js";import"./dropdown-menu-uXj8nKiT.js";import"./Copy01-DhXqtugg.js";import"./DotsVertical-roys0n6e.js";import"./use-list-state-CmxR0QRn.js";import"./use-mobile-B-R7B7Hp.js";import"./empty-state-N07FE0YG.js";import"./Inbox01-D66dNA_K.js";import"./avatar-BHE7lL4M.js";import"./alert-dialog-D6UjYOUP.js";import"./Grid01-CkwdbRed.js";import"./view-mode-toggle-BpRlpgBn.js";import"./use-organization-settings-B_G_DBCR.js";function ve(t){const e=q.c(42),{prompts:r,connectionId:n,org:s,connectionTitle:l,connectionIcon:f,onPromptClick:j,showToolbar:g,emptyMessage:N}=t,V=g===void 0?!0:g,L=N===void 0?"This connection doesn't have any prompts yet.":N,u=W(),y=J().location.href,[p,i]=z.useState(""),[w,a]=z.useState("table"),[h,_]=z.useState("name"),[d,k]=z.useState("asc");let b;e[0]!==d||e[1]!==h?(b=x=>{h===x?(k(Ie),d==="desc"&&_(void 0)):(_(x),k("asc"))},e[0]=d,e[1]=h,e[2]=b):b=e[2];const T=b;let P;e[3]!==n||e[4]!==u||e[5]!==j||e[6]!==s?(P=x=>{j?j(x):n&&s&&u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:n,collectionName:"prompts",itemId:encodeURIComponent(x.name)}})},e[3]=n,e[4]=u,e[5]=j,e[6]=s,e[7]=P):P=e[7];const A=P;let B;if(e[8]!==r||e[9]!==p||e[10]!==d||e[11]!==h){const x=!r||r.length===0?[]:p.trim()?(()=>{const S=p.toLowerCase();return r.filter(U=>U.name.toLowerCase().includes(S)||U.description&&U.description.toLowerCase().includes(S))})():r;B=!h||!d?x:[...x].sort((S,U)=>{const re=S[h]||"",ie=U[h]||"",H=String(re).localeCompare(String(ie));return d==="asc"?H:-H}),e[8]=r,e[9]=p,e[10]=d,e[11]=h,e[12]=B}else B=e[12];const m=B;let O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=[{id:"name",header:"Name",render:$e,sortable:!0},{id:"description",header:"Description",render:Te,cellClassName:"flex-1",sortable:!0}],e[13]=O):O=e[13];const E=O;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=E.filter(we).map(Ne),e[14]=M):M=e[14];const D=M;let $;e[15]!==f||e[16]!==l||e[17]!==T||e[18]!==V||e[19]!==d||e[20]!==h||e[21]!==y||e[22]!==w?($=V&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:w,onViewModeChange:a,sortKey:h,sortDirection:d,onSort:T,sortOptions:D}),o.jsx(se,{title:l?`${l}: Prompts`:"Prompts",url:y,icon:f??"description"})]}),e[15]=f,e[16]=l,e[17]=T,e[18]=V,e[19]=d,e[20]=h,e[21]=y,e[22]=w,e[23]=$):$=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=x=>{x.key==="Escape"&&(i(""),x.target.blur())},e[24]=I):I=e[24];let R;e[25]!==p?(R=o.jsx(te,{value:p,onChange:i,placeholder:"Search prompts...",onKeyDown:I}),e[25]=p,e[26]=R):R=e[26];let c;e[27]!==L||e[28]!==A||e[29]!==T||e[30]!==p||e[31]!==d||e[32]!==h||e[33]!==m||e[34]!==w?(c=w==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:m.length===0?o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":L}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:m.map(x=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>A(x),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(X,{icon:null,name:x.name,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-0",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:x.name}),o.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:x.description||"No description"})]})]})},x.name))})}):o.jsx(oe,{columns:E,data:m,isLoading:!1,sortKey:h,sortDirection:d,onSort:T,onRowClick:x=>A(x),emptyState:o.jsx(F,{image:null,title:p?"No prompts found":"No prompts available",description:p?"Try adjusting your search terms":L})}),e[27]=L,e[28]=A,e[29]=T,e[30]=p,e[31]=d,e[32]=h,e[33]=m,e[34]=w,e[35]=c):c=e[35];let C;e[36]!==R||e[37]!==c?(C=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[R,c]}),e[36]=R,e[37]=c,e[38]=C):C=e[38];let v;return e[39]!==C||e[40]!==$?(v=o.jsxs(o.Fragment,{children:[$,C]}),e[39]=C,e[40]=$,e[41]=v):v=e[41],v}function Ne(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function we(t){return t.sortable}function Te(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function $e(t){return o.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function Ie(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Re(t){const e=q.c(6),{prompts:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ve,{prompts:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function _e(t){const e=q.c(2),{repository:r}=t;let n;return e[0]!==r?(n=o.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:o.jsx(Se,{repository:r})}),e[0]=r,e[1]=n):n=e[1],n}function ke(t){const e=q.c(39),{resources:r,connectionTitle:n,connectionIcon:s,onResourceClick:l,showToolbar:f,emptyMessage:j}=t,g=f===void 0?!0:f,N=j===void 0?"This connection doesn't have any resources yet.":j,L=J().location.href,[u,K]=z.useState(""),[y,p]=z.useState("table"),[i,w]=z.useState("name"),[a,h]=z.useState("asc");let _;e[0]!==a||e[1]!==i?(_=c=>{i===c?(h(De),a==="desc"&&w(void 0)):(w(c),h("asc"))},e[0]=a,e[1]=i,e[2]=_):_=e[2];const d=_;let k;e[3]!==l?(k=c=>{l&&l(c)},e[3]=l,e[4]=k):k=e[4];const b=k;let T;if(e[5]!==r||e[6]!==u||e[7]!==a||e[8]!==i){const c=!r||r.length===0?[]:u.trim()?(()=>{const C=u.toLowerCase();return r.filter(v=>v.uri.toLowerCase().includes(C)||v.name&&v.name.toLowerCase().includes(C)||v.description&&v.description.toLowerCase().includes(C))})():r;T=!i||!a?c:[...c].sort((C,v)=>{const x=C[i]||"",S=v[i]||"",U=String(x).localeCompare(String(S));return a==="asc"?U:-U}),e[5]=r,e[6]=u,e[7]=a,e[8]=i,e[9]=T}else T=e[9];const P=T;let A;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=[{id:"name",header:"Name",render:Ae,sortable:!0},{id:"uri",header:"URI",render:Me,sortable:!0},{id:"description",header:"Description",render:Ee,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Le,sortable:!0}],e[10]=A):A=e[10];const B=A;let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=B.filter(Ve).map(Pe),e[11]=m):m=e[11];const O=m;let E;e[12]!==s||e[13]!==n||e[14]!==d||e[15]!==g||e[16]!==a||e[17]!==i||e[18]!==L||e[19]!==y?(E=g&&o.jsxs(Z,{children:[o.jsx(ee,{viewMode:y,onViewModeChange:p,sortKey:i,sortDirection:a,onSort:d,sortOptions:O}),o.jsx(se,{title:n?`${n}: Resources`:"Resources",url:L,icon:s??"folder"})]}),e[12]=s,e[13]=n,e[14]=d,e[15]=g,e[16]=a,e[17]=i,e[18]=L,e[19]=y,e[20]=E):E=e[20];let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=c=>{c.key==="Escape"&&(K(""),c.target.blur())},e[21]=M):M=e[21];let D;e[22]!==u?(D=o.jsx(te,{value:u,onChange:K,placeholder:"Search resources...",onKeyDown:M}),e[22]=u,e[23]=D):D=e[23];let $;e[24]!==N||e[25]!==b||e[26]!==d||e[27]!==u||e[28]!==a||e[29]!==i||e[30]!==P||e[31]!==y?($=y==="cards"?o.jsx("div",{className:"flex-1 overflow-auto p-5",children:P.length===0?o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:P.map(c=>o.jsx(ne,{className:"cursor-pointer transition-colors",onClick:()=>b(c),children:o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsx(X,{icon:null,name:c.name||c.uri,size:"md",className:"shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:c.name||c.uri}),o.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:c.uri}),c.description&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:c.description})]})]})},c.uri))})}):o.jsx(oe,{columns:B,data:P,isLoading:!1,sortKey:i,sortDirection:a,onSort:d,onRowClick:c=>b(c),emptyState:o.jsx(F,{image:null,title:u?"No resources found":"No resources available",description:u?"Try adjusting your search terms":N})}),e[24]=N,e[25]=b,e[26]=d,e[27]=u,e[28]=a,e[29]=i,e[30]=P,e[31]=y,e[32]=$):$=e[32];let I;e[33]!==D||e[34]!==$?(I=o.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,$]}),e[33]=D,e[34]=$,e[35]=I):I=e[35];let R;return e[36]!==I||e[37]!==E?(R=o.jsxs(o.Fragment,{children:[E,I]}),e[36]=I,e[37]=E,e[38]=R):R=e[38],R}function Pe(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ve(t){return t.sortable}function Le(t){return o.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function Ee(t){return o.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Me(t){return o.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Ae(t){return o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function De(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Be(t){const e=q.c(6),{resources:r,connectionId:n,org:s}=t,l=G(n),f=l?.title,j=l?.icon;let g;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==f||e[4]!==j?(g=o.jsx(ke,{resources:r,connectionId:n,org:s,connectionTitle:f,connectionIcon:j}),e[0]=n,e[1]=s,e[2]=r,e[3]=f,e[4]=j,e[5]=g):g=e[5],g}function Ue(t){const e=q.c(4),{tools:r,connectionId:n,org:s}=t;let l;return e[0]!==n||e[1]!==s||e[2]!==r?(l=o.jsx(Ce,{tools:r,connectionId:n,org:s}),e[0]=n,e[1]=s,e[2]=r,e[3]=l):l=e[3],l}function Ke(t){const e=q.c(61),{connection:r,connectionId:n,org:s,requestedTabId:l,collections:f,onUpdate:j,isUpdating:g,prompts:N,resources:V}=t,L=ae();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/$org/mcps/$connectionId"},e[0]=u):u=e[0];const K=W(u);let y;e[1]!==n?(y={connectionId:n},e[1]=n,e[2]=y):y=e[2];const p=ue(y),i=p.isAuthenticated,w=r?.metadata?.repository,a=!!w?.url,h=r?.tools?.length??0,_=N.length,d=V.length;let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k={id:"settings",label:"Settings"},e[3]=k):k=e[3];let b;e[4]!==i||e[5]!==h?(b=i&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=i,e[5]=h,e[6]=b):b=e[6];let T;e[7]!==i||e[8]!==_?(T=i&&_>0?[{id:"prompts",label:"Prompts",count:_}]:[],e[7]=i,e[8]=_,e[9]=T):T=e[9];let P;e[10]!==i||e[11]!==d?(P=i&&d>0?[{id:"resources",label:"Resources",count:d}]:[],e[10]=i,e[11]=d,e[12]=P):P=e[12];let A;if(e[13]!==f||e[14]!==a||e[15]!==i||e[16]!==b||e[17]!==T||e[18]!==P){let S;e[20]!==a?(S=a?[{id:"readme",label:"README"}]:[],e[20]=a,e[21]=S):S=e[21],A=[k,...b,...T,...P,...i?(f||[]).map(Oe):[],...S],e[13]=f,e[14]=a,e[15]=i,e[16]=b,e[17]=T,e[18]=P,e[19]=A}else A=e[19];const B=A,m=B.some(S=>S.id===l)?l:"settings";let O;e[22]!==K?(O=S=>{K({search:U=>({...U,tab:S}),replace:!0})},e[22]=K,e[23]=O):O=e[23];const E=O;let M;e[24]!==f?(M=f||[],e[24]=f,e[25]=M):M=e[25];let D;if(e[26]!==m||e[27]!==M){let S;e[29]!==m?(S=U=>U.name===m,e[29]=m,e[30]=S):S=e[30],D=M.find(S),e[26]=m,e[27]=M,e[28]=D}else D=e[28];const $=D;let I;e[31]!==L.history?(I=()=>L.history.back(),e[31]=L.history,e[32]=I):I=e[32];let R;e[33]!==m||e[34]!==E||e[35]!==B?(R=o.jsx(be,{children:o.jsx(ge,{tabs:B,activeTab:m,onTabChange:E})}),e[33]=m,e[34]=E,e[35]=B,e[36]=R):R=e[36];let c;e[37]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=c):c=e[37];let C;e[38]!==$||e[39]!==m||e[40]!==p.isServerError||e[41]!==p.supportsOAuth||e[42]!==r||e[43]!==n||e[44]!==E||e[45]!==a||e[46]!==i||e[47]!==g||e[48]!==j||e[49]!==s||e[50]!==N||e[51]!==w||e[52]!==V?(C=o.jsx(z.Suspense,{fallback:c,children:m==="tools"?o.jsx(Ue,{tools:r.tools??void 0,connectionId:n,org:s}):m==="prompts"?o.jsx(Re,{prompts:N,connectionId:n,org:s}):m==="resources"?o.jsx(Be,{resources:V,connectionId:n,org:s}):m==="settings"?o.jsx(pe,{connection:r,onUpdate:j,isUpdating:g,isMCPAuthenticated:i,supportsOAuth:p.supportsOAuth,isServerError:p.isServerError,onViewReadme:a?()=>E("readme"):void 0}):m==="readme"&&a?o.jsx(_e,{repository:w}):$&&i?o.jsx(ye,{connectionId:n,org:s,activeCollection:$},m):o.jsx(F,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=m,e[40]=p.isServerError,e[41]=p.supportsOAuth,e[42]=r,e[43]=n,e[44]=E,e[45]=a,e[46]=i,e[47]=g,e[48]=j,e[49]=s,e[50]=N,e[51]=w,e[52]=V,e[53]=C):C=e[53];let v;e[54]!==m||e[55]!==C?(v=o.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:o.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:o.jsx(Q,{children:C},m)})}),e[54]=m,e[55]=C,e[56]=v):v=e[56];let x;return e[57]!==I||e[58]!==R||e[59]!==v?(x=o.jsxs(je,{onBack:I,children:[R,v]}),e[57]=I,e[58]=R,e[59]=v,e[60]=x):x=e[60],x}function Oe(t){return{id:t.name,label:t.displayName}}function ze(){const t=q.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const r=W(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId"},t[1]=n):n=t[1];const{connectionId:s,org:l}=ce(n);let f;t[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/mcps/$connectionId"},t[2]=f):f=t[2];const g=le(f).tab||"settings",N=G(s),V=me(),L=de(N??void 0);let u;t[3]!==s?(u=[s],t[3]=s,t[4]=u):u=t[4];const{promptsMap:K}=fe(u);let y;t[5]!==s?(y=[s],t[5]=s,t[6]=y):y=t[6];const{resourcesMap:p}=he(y);let i;t[7]!==s||t[8]!==K?(i=K.get(s)??[],t[7]=s,t[8]=K,t[9]=i):i=t[9];const w=i;let a;t[10]!==s||t[11]!==p?(a=p.get(s)??[],t[10]=s,t[11]=p,t[12]=a):a=t[12];const h=a;let _;t[13]!==V.update||t[14]!==s?(_=async b=>{await V.update.mutateAsync({id:s,data:b})},t[13]=V.update,t[14]=s,t[15]=_):_=t[15];const d=_;if(!N){let b;return t[16]!==r||t[17]!==l?(b=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(F,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:o.jsx(xe,{variant:"outline",onClick:()=>r({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=r,t[17]=l,t[18]=b):b=t[18],b}let k;return t[19]!==V.update.isPending||t[20]!==L||t[21]!==N||t[22]!==s||t[23]!==d||t[24]!==l||t[25]!==w||t[26]!==g||t[27]!==h?(k=o.jsx(Ke,{org:l,connection:N,connectionId:s,requestedTabId:g,collections:L,onUpdate:d,isUpdating:V.update.isPending,prompts:w,resources:h}),t[19]=V.update.isPending,t[20]=L,t[21]=N,t[22]=s,t[23]=d,t[24]=l,t[25]=w,t[26]=g,t[27]=h,t[28]=k):k=t[28],k}function qe(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(Q,{children:o.jsx(z.Suspense,{fallback:o.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:o.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:o.jsx(ze,{})})}),t[0]=e):e=t[0],e}function Gt(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(qe,{}),t[0]=e):e=t[0],e}export{Gt as default};
@@ -0,0 +1 @@
1
+ import{c as J,j as e,r as $,f as Q,b as Y,a as Z,u as ee,y as ne,x as te,v as X,W as se,w as x,_ as oe}from"./index-DEMNtulg.js";import{C as ie}from"./collection-header-od14k6u3.js";import{C as re}from"./collection-page-BNuNM--s.js";import{C as ae}from"./collection-search-LnYLnFH8.js";import{C as ce}from"./collection-table-wrapper-B0AFEn1d.js";import{C as le}from"./connection-card-r2tH19aR.js";import{E as T}from"./SearchMd-C6P9P1wF.js";import{E as de}from"./error-boundary-Ce0_dLsG.js";import{a as me,u as pe,n as I,I as ue}from"./use-connection-D-LWel3A.js";import{u as xe,s as M}from"./use-list-state-CmxR0QRn.js";import{u as he}from"./tooltip-C7B84lYF.js";import{f as ge,a as je,b as fe,c as _e,d as Ce,e as ve,A as ye,g as we}from"./alert-dialog-D6UjYOUP.js";import{B as ke}from"./badge-B-u7R38I.js";import{B as g}from"./button-B13xcF6W.js";import{d as Ne,c as Se,D as De,a as be,b as Te,f as Ie}from"./dialog-DoN4ORnY.js";import{b as z,D as V,a as R,c as S}from"./dropdown-menu-uXj8nKiT.js";import{a as Pe,F as l,b as d,c as m,d as p,f as u}from"./form-BQIYj24w.js";import{i as B}from"./DotsVertical-roys0n6e.js";import{i as $e,r as Ee,s as P,E as Oe,e as W}from"./env-vars-editor-B7JL_p-V.js";import{i as Ae}from"./Loading01-EiDV-2FW.js";import{i as Fe}from"./Terminal-Dv6w41J8.js";import{s as H}from"./Trash01-Ctk7srex.js";import{I as f}from"./input-YdP8mwrf.js";import{S as Me,a as ze,b as Ve,c as Re,d as k}from"./select-L_OjJ9sW.js";import{T as Be}from"./textarea-IOVeLZOt.js";import{g as He}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-D4VM0KQx.js";import"./Grid01-CkwdbRed.js";import"./view-mode-toggle-BpRlpgBn.js";import"./card-7VW-xSd-.js";import"./use-mobile-B-R7B7Hp.js";import"./X-Da4xsL05.js";import"./Plus-CwB-Rc8B.js";import"./ChevronDown-atiP0m-F.js";const Xe=X({key:x(),value:x()}),We=X({title:x().min(1,"Name is required"),description:x().nullable().optional(),ui_type:oe(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:x().optional(),connection_token:x().nullable().optional(),npx_package:x().optional(),stdio_command:x().optional(),stdio_args:x().optional(),stdio_cwd:x().optional(),env_vars:se(Xe).optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Le(t,o){const j={command:"npx",args:["-y",t]},_=W(o);return Object.keys(_).length>0&&(j.envVars=_),j}function Ue(t,o,j,_){const C={command:t};o.trim()&&(C.args=o.trim().split(/\s+/)),j?.trim()&&(C.cwd=j.trim());const r=W(_);return Object.keys(r).length>0&&(C.envVars=r),C}function Ke(t){return t.command==="npx"}function qe(t){return t.args?.find(o=>!o.startsWith("-"))??""}function Ge(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Je(t,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Qe(){const{org:t}=he(),o=Q(),j=Y({strict:!1}),{data:_}=Z.useSession(),{stdioEnabled:C}=ee(),r=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(r),[h,v]=$.useReducer(Je,{mode:"idle"}),E=j.action==="create",L=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},O=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{}})},i=ne({resolver:te(We),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),y=i.watch("ui_type"),a=h.mode==="editing"?h.connection:null;$.useEffect(()=>{if(a){const n=$e(a.connection_headers)?a.connection_headers:null;if(n&&a.connection_type==="STDIO"){const s=Ee(n.envVars);if(Ke(n)){const c=qe(n);i.reset({title:a.title,description:a.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Ge(n);i.reset({title:a.title,description:a.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else i.reset({title:a.title,description:a.description,ui_type:a.connection_type,connection_url:a.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else i.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[a,i]);const U=async()=>{if(h.mode!=="deleting")return;const n=h.connection.id;v({type:"close"});try{await D.delete.mutateAsync(n)}catch{}},K=async n=>{let s,c=null,N=null,w=null;if(n.ui_type==="NPX"?(s="STDIO",c="",w=Le(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(s="STDIO",c="",w=Ue(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(s=n.ui_type,c=n.connection_url||"",N=n.connection_token||null),a){await D.update.mutateAsync({id:a.id,data:{title:n.title,description:n.description||null,connection_type:s,connection_url:c,...N&&{connection_token:N},...w&&{connection_headers:w}}}),v({type:"close"}),i.reset();return}const F=He("conn");await D.create.mutateAsync({id:F,title:n.title,description:n.description||null,connection_type:s,connection_url:c,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:_?.user?.id||"system",organization_id:t.id,icon:null,app_name:null,app_id:null,connection_headers:w,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),O(),i.reset(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:F}})},A=n=>{n||(E?O():v({type:"close"}),i.reset())},q=[{id:"icon",header:"",render:n=>e.jsx(ue,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(I,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:n=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:n.title,children:n.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:n=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:n.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:n=>e.jsx("span",{className:"text-sm font-medium",children:n.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:n=>{const s=n.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:n=>e.jsx(ke,{variant:n.status==="active"?"success":"outline",children:n.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:n=>e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(S,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(M,{size:16}),"Inspect"]}),e.jsxs(S,{variant:"destructive",onClick:s=>{s.stopPropagation(),v({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(g,{onClick:L,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(re,{children:[e.jsx(Ne,{open:E||h.mode==="editing",onOpenChange:A,children:e.jsxs(Se,{className:"sm:max-w-[525px]",children:[e.jsxs(De,{children:[e.jsx(be,{children:a?"Edit Connection":"Create Connection"}),e.jsx(Te,{children:a?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Pe,{...i,children:e.jsxs("form",{onSubmit:i.handleSubmit(K),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(l,{control:i.control,name:"title",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Name *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"My Connection",...n})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"description",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Description"}),e.jsx(p,{children:e.jsx(Be,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"ui_type",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Type *"}),e.jsxs(Me,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(ze,{children:e.jsx(Ve,{})})}),e.jsxs(Re,{children:[e.jsx(k,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(k,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(k,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4"}),"Websocket"]})}),C&&e.jsxs(e.Fragment,{children:[e.jsx(k,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(k,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(u,{})]})}),y==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(l,{control:i.control,name:"npx_package",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"NPM Package *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(u,{})]})})}),y==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(l,{control:i.control,name:"stdio_command",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Command *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"node, bun, python...",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"stdio_args",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Arguments"}),e.jsx(p,{children:e.jsx(f,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),e.jsx(u,{})]})})]}),e.jsx(l,{control:i.control,name:"stdio_cwd",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Working Directory"}),e.jsx(p,{children:e.jsx(f,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(u,{})]})})]}),(y==="NPX"||y==="STDIO")&&e.jsx(l,{control:i.control,name:"env_vars",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Environment Variables"}),e.jsx(p,{children:e.jsx(Oe,{value:n.value??[],onChange:n.onChange})}),e.jsx(u,{})]})}),y!=="NPX"&&y!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{control:i.control,name:"connection_url",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"URL *"}),e.jsx(p,{children:e.jsx(f,{placeholder:"https://example.com/mcp",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:i.control,name:"connection_token",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Token (optional)"}),e.jsx(p,{children:e.jsx(f,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Ie,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>A(!1),children:"Cancel"}),e.jsx(g,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:i.formState.isSubmitting?"Saving...":a?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ge,{open:h.mode==="deleting",onOpenChange:n=>!n&&v({type:"close"}),children:e.jsxs(je,{children:[e.jsxs(fe,{children:[e.jsx(_e,{children:"Delete Connection?"}),e.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:h.mode==="deleting"&&h.connection.title}),"."]})]}),e.jsxs(ve,{children:[e.jsx(ye,{children:"Cancel"}),e.jsx(we,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(ie,{title:"Connections",viewMode:r.viewMode,onViewModeChange:r.setViewMode,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:G}),e.jsx(ae,{value:r.search,onChange:r.setSearch,placeholder:"Search for a Connection...",onKeyDown:n=>{n.key==="Escape"&&(r.setSearch(""),n.target.blur())}}),r.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:b.length===0?e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(r.search,"No Connections found"),description:r.search?`No Connections match "${r.search}"`:"Create a connection to get started.",actions:!r.search&&e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:b.map(n=>e.jsx(le,{connection:n,fallbackIcon:e.jsx(I,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),headerActions:e.jsxs(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(S,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(M,{size:16}),"Inspect"]}),e.jsxs(S,{variant:"destructive",onClick:s=>{s.stopPropagation(),v({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]})},n.id))})}):e.jsx(ce,{columns:q,data:b,isLoading:!1,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,onRowClick:n=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),emptyState:r.search?e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${r.search}"`}):e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})})})]})}function En(){const t=J.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(de,{children:e.jsx($.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Qe,{})})}),t[0]=o):o=t[0],o}export{En as default};
@@ -0,0 +1 @@
1
+ import{B as o}from"./use-binding-Ce8NG0MO.js";import{aN as a}from"./index-DEMNtulg.js";const e="mcp.mesh",m="mcp.mesh/publisher-provided",c=a(o,{target:"draft-07"});export{c as B,m as M,e as a};
@@ -1,4 +1,4 @@
1
- import{F as te,a2 as Ae}from"./index-tz4gB72W.js";function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},fn.apply(null,arguments)}function bt(e,n){if(e==null)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)!==-1)continue;a[t]=e[t]}return a}function wt(e,n){if(e==null)return{};var a,t,c=bt(e,n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(t=0;t<d.length;t++)a=d[t],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function xt(e){if(Array.isArray(e))return dn(e)}function St(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kt(e,n){if(e){if(typeof e=="string")return dn(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?dn(e,n):void 0}}function At(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{F as te,a2 as Ae}from"./index-DEMNtulg.js";function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},fn.apply(null,arguments)}function bt(e,n){if(e==null)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)!==-1)continue;a[t]=e[t]}return a}function wt(e,n){if(e==null)return{};var a,t,c=bt(e,n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(t=0;t<d.length;t++)a=d[t],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function xt(e){if(Array.isArray(e))return dn(e)}function St(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kt(e,n){if(e){if(typeof e=="string")return dn(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?dn(e,n):void 0}}function At(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pn(e){return xt(e)||St(e)||kt(e)||At()}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},me(e)}function Ct(e,n){if(me(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var t=a.call(e,n);if(me(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ft(e){var n=Ct(e,"string");return me(n)=="symbol"?n:n+""}function it(e,n,a){return(n=Ft(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Sn(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function pe(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Sn(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Sn(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function Lt(e){var n=e.length;if(n===0||n===1)return e;if(n===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(n===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(n>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ee={};function Nt(e){if(e.length===0||e.length===1)return e;var n=e.join(".");return Ee[n]||(Ee[n]=Lt(e)),Ee[n]}function Ot(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,t=e.filter(function(d){return d!=="token"}),c=Nt(t);return c.reduce(function(d,g){return pe(pe({},d),a[g])},n)}function kn(e){return e.join(" ")}function Tt(e,n){var a=0;return function(t){return a+=1,t.map(function(c,d){return lt({node:c,stylesheet:e,useInlineStyles:n,key:"code-segment-".concat(a,"-").concat(d)})})}}function lt(e){var n=e.node,a=e.stylesheet,t=e.style,c=t===void 0?{}:t,d=e.useInlineStyles,g=e.key,o=n.properties,h=n.type,k=n.tagName,A=n.value;if(h==="text")return A;if(k){var m=Tt(a,d),b;if(!d)b=pe(pe({},o),{},{className:kn(o.className)});else{var y=Object.keys(a).reduce(function(F,l){return l.split(".").forEach(function(i){F.includes(i)||F.push(i)}),F},[]),w=o.className&&o.className.includes("token")?["token"]:[],x=o.className&&w.concat(o.className.filter(function(F){return!y.includes(F)}));b=pe(pe({},o),{},{className:kn(x)||void 0,style:Ot(o.className,Object.assign({},o.style,c),a)})}var S=m(n.children);return te.createElement(k,fn({key:g},b),S)}}const Et=(function(e,n){var a=e.listLanguages();return a.indexOf(n)!==-1});var qt=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function An(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function ae(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?An(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):An(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}var jt=/\n/g;function $t(e){return e.match(jt)}function It(e){var n=e.lines,a=e.startingLineNumber,t=e.style;return n.map(function(c,d){var g=d+a;return te.createElement("span",{key:"line-".concat(d),className:"react-syntax-highlighter-line-number",style:typeof t=="function"?t(g):t},"".concat(g,`
3
3
  `))})}function Pt(e){var n=e.codeString,a=e.codeStyle,t=e.containerStyle,c=t===void 0?{float:"left",paddingRight:"10px"}:t,d=e.numberStyle,g=d===void 0?{}:d,o=e.startingLineNumber;return te.createElement("code",{style:Object.assign({},a,c)},It({lines:n.replace(/\n$/,"").split(`
4
4
  `),style:g,startingLineNumber:o}))}function Rt(e){return"".concat(e.toString().length,".25em")}function ct(e,n){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:n},children:[{type:"text",value:e}]}}function st(e,n,a){var t={display:"inline-block",minWidth:Rt(a),paddingRight:"1em",textAlign:"right",userSelect:"none"},c=typeof e=="function"?e(n):e,d=ae(ae({},t),c);return d}function ke(e){var n=e.children,a=e.lineNumber,t=e.lineNumberStyle,c=e.largestLineNumber,d=e.showInlineLineNumbers,g=e.lineProps,o=g===void 0?{}:g,h=e.className,k=h===void 0?[]:h,A=e.showLineNumbers,m=e.wrapLongLines,b=e.wrapLines,y=b===void 0?!1:b,w=y?ae({},typeof o=="function"?o(a):o):{};if(w.className=w.className?[].concat(pn(w.className.trim().split(/\s+/)),pn(k)):k,a&&d){var x=st(t,a,c);n.unshift(ct(a,x))}return m&A&&(w.style=ae({display:"flex"},w.style)),{type:"element",tagName:"span",properties:w,children:n}}function ut(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],t=0;t<e.length;t++){var c=e[t];if(c.type==="text")a.push(ke({children:[c],className:pn(new Set(n))}));else if(c.children){var d=n.concat(c.properties.className);ut(c.children,d).forEach(function(g){return a.push(g)})}}return a}function Dt(e,n,a,t,c,d,g,o,h){var k,A=ut(e.value),m=[],b=-1,y=0;function w(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return ke({children:u,lineNumber:r,lineNumberStyle:o,largestLineNumber:g,showInlineLineNumbers:c,lineProps:a,className:s,showLineNumbers:t,wrapLongLines:h,wrapLines:n})}function x(u,r){if(t&&r&&c){var s=st(o,r,g);u.unshift(ct(r,s))}return u}function S(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return n||s.length>0?w(u,r,s):x(u,r)}for(var F=function(){var r=A[y],s=r.children[0].value,v=$t(s);if(v){var f=s.split(`
@@ -1 +1 @@
1
- import{v as A,w as D,c as v,x as O,y as E,j as r,a as N}from"./index-tz4gB72W.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-_VCwcCen.js";import{u as V,B as k}from"./button-BSXU4L7C.js";import{F as q,a as H,b as U,c as G,d as J,e as K,f as P}from"./form-Dn7fy5O5.js";import{I as Q}from"./input-Cb7MaM0d.js";import{S as W}from"./spinner-BUVePO6d.js";function _(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function se(a){const e=v.c(41),{open:o,onOpenChange:s}=a;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:O(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=V(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(U,{children:[r.jsx(G,{children:"Organization Name"}),r.jsx(J,{children:r.jsx(Q,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(K,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(P,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(q,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(W,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(k,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(M,{children:[F,r.jsx(H,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==o||e[39]!==x?(C=r.jsx(B,{open:o,onOpenChange:s,children:x}),e[37]=s,e[38]=o,e[39]=x,e[40]=C):C=e[40],C}function Y(a){const{orgSlug:e}=a;window.location.href=`/${e}`}async function Z(a){const e=_(a.name);if(!e)throw new Error("Organization slug is invalid");const o=await N.organization.create({name:a.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const s=o?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{se as C};
1
+ import{v as A,w as D,c as v,x as O,y as E,j as r,a as N}from"./index-DEMNtulg.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-D6UjYOUP.js";import{u as V,B as k}from"./button-B13xcF6W.js";import{F as q,a as H,b as U,c as G,d as J,e as K,f as P}from"./form-BQIYj24w.js";import{I as Q}from"./input-YdP8mwrf.js";import{S as W}from"./spinner-CAJeeq5B.js";function _(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function se(a){const e=v.c(41),{open:o,onOpenChange:s}=a;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:O(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=V(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(U,{children:[r.jsx(G,{children:"Organization Name"}),r.jsx(J,{children:r.jsx(Q,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(K,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(P,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(q,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(W,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(k,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(M,{children:[F,r.jsx(H,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==o||e[39]!==x?(C=r.jsx(B,{open:o,onOpenChange:s,children:x}),e[37]=s,e[38]=o,e[39]=x,e[40]=C):C=e[40],C}function Y(a){const{orgSlug:e}=a;window.location.href=`/${e}`}async function Z(a){const e=_(a.name);if(!e)throw new Error("Organization slug is invalid");const o=await N.organization.create({name:a.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const s=o?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{se as C};
@@ -1 +1 @@
1
- import{c as n,j as i,R as g,C as m,T as u,D as x,P as j,O as N,aA as b,h as D}from"./index-tz4gB72W.js";import{i as h}from"./X-hEo9Za23.js";import{c}from"./button-BSXU4L7C.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(D,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,P as a,B as b,T as c,k as d,w as e,O as f};
1
+ import{c as n,j as i,R as g,C as m,T as u,D as x,P as j,O as N,aA as b,h as D}from"./index-DEMNtulg.js";import{i as h}from"./X-Da4xsL05.js";import{c}from"./button-B13xcF6W.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(D,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,P as a,B as b,T as c,k as d,w as e,O as f};
@@ -1 +1 @@
1
- import{c,j as i,aO as p,aP as f,aQ as m,aR as g,aS as x,aT as v,aU as b,aV as w,aW as h}from"./index-tz4gB72W.js";import{d as j}from"./tooltip-Bzy1O5cq.js";import{c as u}from"./button-BSXU4L7C.js";function D(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=a):a=e[3],a}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function $(s){const e=c.c(10);let t,a,o;e[0]!==s?({className:t,sideOffset:o,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o):(t=e[1],a=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...a})}),e[6]=a,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,a,o,n;e[0]!==s?({className:t,inset:a,variant:n,...o}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o,e[4]=n):(t=e[1],a=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==a||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:d,...o}),e[7]=a,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==a||e[6]!==o?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=n):n=e[7],n}function T(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=a):a=e[3],a}function C(s){const e=c.c(13);let t,a,o,n;e[0]!==s?({className:a,inset:o,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o,e[4]=n):(t=e[1],a=e[2],o=e[3],n=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",a),e[5]=a,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==a||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=n):n=e[7],n}export{M as D,$ as a,D as b,y as c,_ as d,T as e,C as f,R as g};
1
+ import{c,j as i,aO as p,aP as f,aQ as m,aR as g,aS as x,aT as v,aU as b,aV as w,aW as h}from"./index-DEMNtulg.js";import{d as j}from"./tooltip-C7B84lYF.js";import{c as u}from"./button-B13xcF6W.js";function D(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=a):a=e[3],a}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function $(s){const e=c.c(10);let t,a,o;e[0]!==s?({className:t,sideOffset:o,...a}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o):(t=e[1],a=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...a})}),e[6]=a,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,a,o,n;e[0]!==s?({className:t,inset:a,variant:n,...o}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o,e[4]=n):(t=e[1],a=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==a||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:d,...o}),e[7]=a,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==a||e[6]!==o?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=n):n=e[7],n}function T(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let a;return e[2]!==t?(a=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=a):a=e[3],a}function C(s){const e=c.c(13);let t,a,o,n;e[0]!==s?({className:a,inset:o,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=a,e[3]=o,e[4]=n):(t=e[1],a=e[2],o=e[3],n=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",a),e[5]=a,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,a;e[0]!==s?({className:t,...a}=s,e[0]=s,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==a||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=n):n=e[7],n}export{M as D,$ as a,D as b,y as c,_ as d,T as e,C as f,R as g};
@@ -1 +1 @@
1
- import{c as p,j as t}from"./index-tz4gB72W.js";import{B as j,c as b}from"./button-BSXU4L7C.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
1
+ import{c as p,j as t}from"./index-DEMNtulg.js";import{B as j,c as b}from"./button-B13xcF6W.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
@@ -1 +1 @@
1
- import{r as N,v as y,_ as D,W as k,w as t,X as m,aJ as T,aK as O,c as R,j as c}from"./index-tz4gB72W.js";import{B as z}from"./button-BSXU4L7C.js";import{I as W}from"./input-Cb7MaM0d.js";import{s as H}from"./Plus-nu8-Nz8b.js";import{s as L}from"./Trash01-1tKgR7uh.js";const U=({size:o=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},N.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));U.displayName="Globe02";const B=y({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:k(t()),grantType:D(["authorization_code","client_credentials"])}),K=y({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),M=y({headers:m(t(),t()).optional()}),$=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),V=y({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:O([$,M]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:k(K).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});V.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});V.partial();function Y(o){return o!=null&&"command"in o}function q(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function Z(o){const e=R.c(34),{value:n,onChange:r,keyPlaceholder:j,valuePlaceholder:l,className:I}=o,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let w;e[0]!==r||e[1]!==n?(w=()=>{r([...n,{key:"",value:""}])},e[0]=r,e[1]=n,e[2]=w):w=e[2];const A=w;let x;e[3]!==r||e[4]!==n?(x=s=>{r(n.filter((d,i)=>i!==s))},e[3]=r,e[4]=n,e[5]=x):x=e[5];const b=x;let S;e[6]!==r||e[7]!==n?(S=(s,d)=>{const i=[...n],a=i[s];a&&(i[s]={key:d,value:a.value},r(i))},e[6]=r,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==r||e[10]!==n?(C=(s,d)=>{const i=[...n],a=i[s];a&&(i[s]={key:a.key,value:d},r(i))},e[9]=r,e[10]=n,e[11]=C):C=e[11];const v=C;let u;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==f||e[16]!==n||e[17]!==_){let s;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==f||e[23]!==_?(s=(d,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(W,{placeholder:f,value:d.key,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(W,{type:q(d.key)?"password":"text",placeholder:_,value:d.value,onChange:a=>v(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(i),children:c.jsx(L,{size:16})})]},i),e[19]=g,e[20]=b,e[21]=v,e[22]=f,e[23]=_,e[24]=s):s=e[24],u=n.map(s),e[12]=g,e[13]=b,e[14]=v,e[15]=f,e[16]=n,e[17]=_,e[18]=u}else u=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(H,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(z,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==u||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[u,p]}),e[28]=u,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function ee(o){const e={};for(const{key:n,value:r}of o)n.trim()&&(e[n.trim()]=r);return e}function te(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{Z as E,ee as e,Y as i,te as r,U as s};
1
+ import{r as N,v as y,_ as D,W as k,w as t,X as m,aJ as T,aK as O,c as R,j as c}from"./index-DEMNtulg.js";import{B as z}from"./button-B13xcF6W.js";import{I as W}from"./input-YdP8mwrf.js";import{s as H}from"./Plus-CwB-Rc8B.js";import{s as L}from"./Trash01-Ctk7srex.js";const U=({size:o=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},N.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));U.displayName="Globe02";const B=y({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:k(t()),grantType:D(["authorization_code","client_credentials"])}),K=y({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),M=y({headers:m(t(),t()).optional()}),$=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),V=y({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:O([$,M]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:k(K).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});V.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});V.partial();function Y(o){return o!=null&&"command"in o}function q(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function Z(o){const e=R.c(34),{value:n,onChange:r,keyPlaceholder:j,valuePlaceholder:l,className:I}=o,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let w;e[0]!==r||e[1]!==n?(w=()=>{r([...n,{key:"",value:""}])},e[0]=r,e[1]=n,e[2]=w):w=e[2];const A=w;let x;e[3]!==r||e[4]!==n?(x=s=>{r(n.filter((d,i)=>i!==s))},e[3]=r,e[4]=n,e[5]=x):x=e[5];const b=x;let S;e[6]!==r||e[7]!==n?(S=(s,d)=>{const i=[...n],a=i[s];a&&(i[s]={key:d,value:a.value},r(i))},e[6]=r,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==r||e[10]!==n?(C=(s,d)=>{const i=[...n],a=i[s];a&&(i[s]={key:a.key,value:d},r(i))},e[9]=r,e[10]=n,e[11]=C):C=e[11];const v=C;let u;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==f||e[16]!==n||e[17]!==_){let s;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==f||e[23]!==_?(s=(d,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(W,{placeholder:f,value:d.key,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(W,{type:q(d.key)?"password":"text",placeholder:_,value:d.value,onChange:a=>v(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(i),children:c.jsx(L,{size:16})})]},i),e[19]=g,e[20]=b,e[21]=v,e[22]=f,e[23]=_,e[24]=s):s=e[24],u=n.map(s),e[12]=g,e[13]=b,e[14]=v,e[15]=f,e[16]=n,e[17]=_,e[18]=u}else u=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(H,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(z,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==u||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[u,p]}),e[28]=u,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function ee(o){const e={};for(const{key:n,value:r}of o)n.trim()&&(e[n.trim()]=r);return e}function te(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{Z as E,ee as e,Y as i,te as r,U as s};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./index-tz4gB72W.js";import{B as n}from"./button-BSXU4L7C.js";const o=({size:t=24,color:r="currentColor",...s})=>a.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},a.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));o.displayName="AlertTriangle";class l extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(o,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{l as E,o as i};
1
+ import{r as a,j as e}from"./index-DEMNtulg.js";import{B as n}from"./button-B13xcF6W.js";const o=({size:t=24,color:r="currentColor",...s})=>a.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},a.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));o.displayName="AlertTriangle";class l extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(o,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{l as E,o as i};
@@ -1 +1 @@
1
- import{a as p,M as u}from"./constants-C-5m3xCJ.js";import{b,g as C}from"./registry-utils-ulDDT0d8.js";import{g as E}from"./generate-id-Dyweu44Y.js";function M(e,s,i){const t=e.server,n=e._meta?.[p]??t?._meta?.[p],r=e._meta?.[u]??t?._meta?.[u],a=r?.metadata,c=t?.remotes?.[0],d=b(c?.type)||"HTTP",l=new Date().toISOString(),f=r?.friendlyName||e.title||t?.title||t?.name||"Unnamed App",_=t?.description||null,m=t?.icons?.[0]?.src||C(t?.repository)||null,o=a?.oauth_config,g=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,y=a?.configuration_state,h=a?.configuration_scopes,v=t?.repository?{url:t.repository.url,source:t.repository.source,subfolder:t.repository.subfolder}:null;return{id:E("conn"),title:f,description:_,icon:m,app_name:n?.appName||t?.name||null,app_id:n?.id||e.id||null,connection_type:d,connection_url:c?.url||"",connection_token:null,connection_headers:null,oauth_config:g,configuration_state:y??null,configuration_scopes:h??null,metadata:{...a,source:"store",registry_item_id:e.id,verified:n?.verified??!1,scopeName:n?.scopeName??null,toolsCount:r?.tools?.length??0,publishedAt:n?.publishedAt??null,repository:v},created_at:l,updated_at:l,created_by:i,organization_id:s,tools:null,bindings:null,status:"inactive"}}function T(e,s){if(!s?.startsWith("@"))return;const[i,t]=s.replace("@","").split("/");if(!(!i||!t))return e.find(n=>{const r=n._meta?.["mcp.mesh"],a=n.server.name;return r?.scopeName===i&&r?.appName===t||a===`${i}/${t}`})}export{M as e,T as f};
1
+ import{a as p,M as u}from"./constants-CN4QOiqe.js";import{b,g as C}from"./registry-utils-ulDDT0d8.js";import{g as E}from"./generate-id-Dyweu44Y.js";function M(e,s,i){const t=e.server,n=e._meta?.[p]??t?._meta?.[p],r=e._meta?.[u]??t?._meta?.[u],a=r?.metadata,c=t?.remotes?.[0],d=b(c?.type)||"HTTP",l=new Date().toISOString(),f=r?.friendlyName||e.title||t?.title||t?.name||"Unnamed App",_=t?.description||null,m=t?.icons?.[0]?.src||C(t?.repository)||null,o=a?.oauth_config,g=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,y=a?.configuration_state,h=a?.configuration_scopes,v=t?.repository?{url:t.repository.url,source:t.repository.source,subfolder:t.repository.subfolder}:null;return{id:E("conn"),title:f,description:_,icon:m,app_name:n?.appName||t?.name||null,app_id:n?.id||e.id||null,connection_type:d,connection_url:c?.url||"",connection_token:null,connection_headers:null,oauth_config:g,configuration_state:y??null,configuration_scopes:h??null,metadata:{...a,source:"store",registry_item_id:e.id,verified:n?.verified??!1,scopeName:n?.scopeName??null,toolsCount:r?.tools?.length??0,publishedAt:n?.publishedAt??null,repository:v},created_at:l,updated_at:l,created_by:i,organization_id:s,tools:null,bindings:null,status:"inactive"}}function T(e,s){if(!s?.startsWith("@"))return;const[i,t]=s.replace("@","").split("/");if(!(!i||!t))return e.find(n=>{const r=n._meta?.["mcp.mesh"],a=n.server.name;return r?.scopeName===i&&r?.appName===t||a===`${i}/${t}`})}export{M as e,T as f};
@@ -1 +1 @@
1
- import{c as d,j as m,aG as $,bo as j,bp as C,r as f,k as v,bq as N,br as h}from"./index-tz4gB72W.js";import{c as u}from"./button-BSXU4L7C.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,g=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(g.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,b=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==b?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:b,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=b,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function k(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,k as f};
1
+ import{c as d,j as m,aG as $,bo as j,bp as C,r as f,k as v,bq as N,br as h}from"./index-DEMNtulg.js";import{c as u}from"./button-B13xcF6W.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,g=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(g.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,b=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==b?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:b,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=b,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function k(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,k as f};