@decocms/mesh 1.3.2 → 1.4.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 (135) hide show
  1. package/dist/client/assets/{AlertCircle-BMr3-fpA.js → AlertCircle-D6b9Ralv.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-BwQg_SOY.js → ArrowLeft-CmZRAub5.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-BjyTHawB.js → ChevronDown-xjFrqe8j.js} +1 -1
  4. package/dist/client/assets/{Clock-BqL_Iy4b.js → Clock-Bqlp1mni.js} +1 -1
  5. package/dist/client/assets/{Code01-DkmFiQmz.js → Code01-B3S249hz.js} +1 -1
  6. package/dist/client/assets/{Copy01-D2K_Muqy.js → Copy01-D0tR5TRJ.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-C_MNm5X3.js → CpuChip02-BJZ8c2R6.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-D0NEibaO.js → DotsVertical-0Pg6f15X.js} +1 -1
  9. package/dist/client/assets/{File06-CXgKQ6DN.js → File06-BzST8Ux5.js} +1 -1
  10. package/dist/client/assets/FlipBackward-J5E6LFga.js +1 -0
  11. package/dist/client/assets/{GitBranch01-BUSTYQYz.js → GitBranch01-C9tViAi-.js} +1 -1
  12. package/dist/client/assets/Grid01-DETN8WPx.js +1 -0
  13. package/dist/client/assets/{Inbox01-CBPg2mpL.js → Inbox01-DxqBKn7H.js} +1 -1
  14. package/dist/client/assets/{Key01-BperTm8i.js → Key01-B-GFSqTW.js} +1 -1
  15. package/dist/client/assets/LinkExternal01-D-pWR4LA.js +1 -0
  16. package/dist/client/assets/{Loading01-C4j07Rkx.js → Loading01-CpvGD3vr.js} +1 -1
  17. package/dist/client/assets/{Lock01-CFQ55MXh.js → Lock01-DbWcWM_K.js} +1 -1
  18. package/dist/client/assets/{Play-BZ988K1v.js → Play-D0iqjftf.js} +1 -1
  19. package/dist/client/assets/{Plus-mxlUVGel.js → Plus-Df5PHguC.js} +1 -1
  20. package/dist/client/assets/{SearchMd-COBfbXbx.js → SearchMd-BSF-Glwf.js} +1 -1
  21. package/dist/client/assets/{Terminal-RcHlyPBU.js → Terminal-Cw0wmZeh.js} +1 -1
  22. package/dist/client/assets/{Trash01-CyKI-_BM.js → Trash01-DPFHmwKr.js} +1 -1
  23. package/dist/client/assets/{X-BXO-lbAK.js → X-D8XIiJvQ.js} +1 -1
  24. package/dist/client/assets/{XClose-C64sfNMR.js → XClose-B_hUkeVk.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-P1n_1JT7.js → alert-dialog-CbCWAnT3.js} +2 -2
  26. package/dist/client/assets/{auth-DP47SEOm.js → auth-PKeXnxbM.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-CfVXVPNH.js → auth-catchall-Wppyfaii.js} +1 -1
  28. package/dist/client/assets/{avatar-_GsuhjwG.js → avatar-g2HizpCv.js} +1 -1
  29. package/dist/client/assets/{badge-DC5bHjau.js → badge-DpuZDXUE.js} +1 -1
  30. package/dist/client/assets/{button-dzqjSoP9.js → button-hWHuMvle.js} +1 -1
  31. package/dist/client/assets/{card-C7renjvY.js → card-Cdw91ud0.js} +1 -1
  32. package/dist/client/assets/{checkbox-DAye6Bhs.js → checkbox-C8hkq1Ob.js} +1 -1
  33. package/dist/client/assets/collection-detail-BhlzVbA_.js +183 -0
  34. package/dist/client/assets/collection-display-button-DJTB2EUg.js +1 -0
  35. package/dist/client/assets/{collection-header-BmMDhAGN.js → collection-header-BxKOSRWd.js} +1 -1
  36. package/dist/client/assets/{collection-page-Cn_-fCfu.js → collection-page-BDy0PpkC.js} +1 -1
  37. package/dist/client/assets/{collection-search-B8kQUh1o.js → collection-search-BoabZo7c.js} +1 -1
  38. package/dist/client/assets/{collection-tab-CuS_mYhN.js → collection-tab-y3dKzpme.js} +1 -1
  39. package/dist/client/assets/collection-table-wrapper-BERroKt9.js +1 -0
  40. package/dist/client/assets/{connection-card-DJnmbeP6.js → connection-card-si8Xv84Q.js} +1 -1
  41. package/dist/client/assets/connection-detail-D8qvOGFn.js +1 -0
  42. package/dist/client/assets/connections-D7K8Q8og.js +1 -0
  43. package/dist/client/assets/constants-CxHW24vL.js +1 -0
  44. package/dist/client/assets/{core-BmgwoN2D.js → core-BAd4uKi4.js} +1 -1
  45. package/dist/client/assets/{create-organization-dialog-C1_fICTk.js → create-organization-dialog-D4tz0eZI.js} +1 -1
  46. package/dist/client/assets/{dialog-CjFuRpNq.js → dialog-HUu8pjnY.js} +1 -1
  47. package/dist/client/assets/dropdown-menu-DG5cxUDL.js +1 -0
  48. package/dist/client/assets/{empty-state-D7F--R-i.js → empty-state-m_IydCcr.js} +1 -1
  49. package/dist/client/assets/{env-vars-editor-CA1M7xF4.js → env-vars-editor-kSmLn72b.js} +1 -1
  50. package/dist/client/assets/{error-boundary-Kj4QesDI.js → error-boundary-B-QcFATa.js} +1 -1
  51. package/dist/client/assets/{extract-connection-data-DoCNquGq.js → extract-connection-data-CjCzbgf3.js} +1 -1
  52. package/dist/client/assets/{form-DNs0FRpn.js → form-B-xqHHYa.js} +1 -1
  53. package/dist/client/assets/{formatDistanceToNow-ctvTO9qt.js → formatDistanceToNow-B3w53gnj.js} +1 -1
  54. package/dist/client/assets/gateway-detail-Dz5K97Qu.js +1 -0
  55. package/dist/client/assets/gateways-Bfk7wW4H.js +1 -0
  56. package/dist/client/assets/{home-CZCW3yxr.js → home-B2CMLWdT.js} +1 -1
  57. package/dist/client/assets/index-7USdUZHF.js +98 -0
  58. package/dist/client/assets/{index--kROx8O6.js → index-B9HSZhdB.js} +14 -14
  59. package/dist/client/assets/{index-DYEBIV-t.js → index-BI-brnHc.js} +1 -1
  60. package/dist/client/assets/index-BcDKMyjy.css +1 -0
  61. package/dist/client/assets/{index-C5Ye_Yv8.js → index-Bs52vOb7.js} +1 -1
  62. package/dist/client/assets/{index-DNNzqGj5.js → index-CXiBzYKD.js} +2 -2
  63. package/dist/client/assets/{input-Dos1YqM9.js → input-DcZE4UoL.js} +1 -1
  64. package/dist/client/assets/json-RSU7hrk4.js +1 -0
  65. package/dist/client/assets/{json-syntax-highlighter-DOX4DGR6.js → json-syntax-highlighter-Czp62O9j.js} +2 -2
  66. package/dist/client/assets/{layout-C2pQBqt8.js → layout-B5ADxfcB.js} +1 -1
  67. package/dist/client/assets/{lazy-highlighter-BeoVpvw-.js → lazy-highlighter-Z2qArbl8.js} +1 -1
  68. package/dist/client/assets/localstorage-keys-DZPXAcMr.js +1 -0
  69. package/dist/client/assets/{login-BkePM8bd.js → login-BX781KlF.js} +1 -1
  70. package/dist/client/assets/{mcp-oauth-BAFvA0-x.js → mcp-oauth-PzyAfNM8.js} +1 -1
  71. package/dist/client/assets/members-D9riafGS.js +3 -0
  72. package/dist/client/assets/monitoring-Bz-yKjJ1.js +4 -0
  73. package/dist/client/assets/{oauth-callback-Mr11rTZP.js → oauth-callback-CTNcTDd4.js} +1 -1
  74. package/dist/client/assets/{page-BxWTpniF.js → page-DF6IrrZD.js} +2 -2
  75. package/dist/client/assets/{pin-to-sidebar-button-DFstuxz9.js → pin-to-sidebar-button-CJEwje2A.js} +1 -1
  76. package/dist/client/assets/{popover-Bflc8KYR.js → popover-DOwrFuly.js} +1 -1
  77. package/dist/client/assets/prism-light-xse74Nms.js +1 -0
  78. package/dist/client/assets/resizable-C0OMnsnz.js +1 -0
  79. package/dist/client/assets/{resource-tabs-C7YApwd6.js → resource-tabs-BBkx9rqd.js} +1 -1
  80. package/dist/client/assets/responsive-select-Bl1ZcUtI.js +1 -0
  81. package/dist/client/assets/{select-Bd0A4qyi.js → select-l2DSo1hq.js} +1 -1
  82. package/dist/client/assets/settings-CWXxNDHw.js +1 -0
  83. package/dist/client/assets/shell-layout-CWj_6Hth.js +19 -0
  84. package/dist/client/assets/{spinner-DssEQupg.js → spinner-BtMKC1U7.js} +1 -1
  85. package/dist/client/assets/store-_81OANVP.js +1 -0
  86. package/dist/client/assets/store-app-detail-CuCWq6-w.js +1 -0
  87. package/dist/client/assets/{switch-jY_WtmSF.js → switch-BOFMRhtg.js} +1 -1
  88. package/dist/client/assets/{textarea-CRl6hqQJ.js → textarea-BoUne3Q6.js} +1 -1
  89. package/dist/client/assets/{tools-list-cySZCndz.js → tools-list-D5n3plgQ.js} +1 -1
  90. package/dist/client/assets/tooltip-DxQ-KPX4.js +1 -0
  91. package/dist/client/assets/{types-C2--1o8t.js → types-8dJFzoWN.js} +1 -1
  92. package/dist/client/assets/{use-binding-DHbkm4TE.js → use-binding-Ccb4SpbZ.js} +2 -2
  93. package/dist/client/assets/{use-connection-DwuFVoxD.js → use-connection-BfQqOvPU.js} +1 -1
  94. package/dist/client/assets/{use-connection-resources-6iOIsQA9.js → use-connection-resources-BuPCYNbb.js} +1 -1
  95. package/dist/client/assets/{use-gateway-C48kcbNv.js → use-gateway-BWSXRpvE.js} +1 -1
  96. package/dist/client/assets/{use-list-state-DC-EnrYi.js → use-list-state-qFWsDnqD.js} +1 -1
  97. package/dist/client/assets/{use-mcp-LjTWLNoY.js → use-mcp-40LwnzhO.js} +1 -1
  98. package/dist/client/assets/{use-members-k3Q2xXPW.js → use-members-BorgQnCE.js} +1 -1
  99. package/dist/client/assets/{use-mobile-Bmxp2FgH.js → use-mobile-v3aq_7jb.js} +1 -1
  100. package/dist/client/assets/{use-organization-settings-0ztRQ3i7.js → use-organization-settings-QpyD7U2T.js} +1 -1
  101. package/dist/client/assets/{use-tool-call-D1etRfCY.js → use-tool-call-CLKWIhEj.js} +1 -1
  102. package/dist/client/assets/useQuery-DE63pAfU.js +1 -0
  103. package/dist/client/assets/{useSuspenseInfiniteQuery-Br-4aSkX.js → useSuspenseInfiniteQuery-DUZsUnhN.js} +1 -1
  104. package/dist/client/assets/{view-mode-toggle-D13jhPxd.js → view-mode-toggle-C9GLUxuG.js} +1 -1
  105. package/dist/client/assets/workflow-DJAFzntg.js +1 -0
  106. package/dist/client/index.html +2 -2
  107. package/package.json +1 -1
  108. package/dist/client/assets/InfoCircle-COZlVleH.js +0 -1
  109. package/dist/client/assets/LinkExternal01-CYB_l3HF.js +0 -1
  110. package/dist/client/assets/Upload01-Ck1Svxew.js +0 -1
  111. package/dist/client/assets/assistant-DpkEh-Jl.js +0 -1
  112. package/dist/client/assets/binding-collection-view-MAfjU-3d.js +0 -1
  113. package/dist/client/assets/collection-detail-CCxtFEtB.js +0 -183
  114. package/dist/client/assets/collection-display-button-DuYSBdla.js +0 -1
  115. package/dist/client/assets/collection-table-wrapper-BxibriYd.js +0 -1
  116. package/dist/client/assets/connection-detail-BEAx4Rx8.js +0 -1
  117. package/dist/client/assets/connections-DhcecQtM.js +0 -1
  118. package/dist/client/assets/constants-BVChjGeA.js +0 -1
  119. package/dist/client/assets/dropdown-menu-6B5tpY1h.js +0 -1
  120. package/dist/client/assets/gateway-detail-e5GW9_16.js +0 -1
  121. package/dist/client/assets/gateways-potF35CW.js +0 -1
  122. package/dist/client/assets/index-BtfNSYYi.css +0 -1
  123. package/dist/client/assets/json-BSW9cMnN.js +0 -1
  124. package/dist/client/assets/localstorage-keys-Cl6fG_mC.js +0 -1
  125. package/dist/client/assets/members-DOlpKNSi.js +0 -3
  126. package/dist/client/assets/monitoring-C60hZcZG.js +0 -4
  127. package/dist/client/assets/prism-light-CKgeoQoL.js +0 -1
  128. package/dist/client/assets/resizable-CZ3q7UHO.js +0 -98
  129. package/dist/client/assets/settings-Bzv9x0Xx.js +0 -1
  130. package/dist/client/assets/shell-layout-JAlTNvh1.js +0 -19
  131. package/dist/client/assets/store-DDomUn8i.js +0 -1
  132. package/dist/client/assets/store-app-detail-Cvn5_uEK.js +0 -1
  133. package/dist/client/assets/tooltip-wl_T0hkj.js +0 -1
  134. package/dist/client/assets/useQuery-5Z2U7Q-f.js +0 -1
  135. package/dist/client/assets/workflow-COhnt_Eq.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as T,c as U,j as t,f as Ye,d as dt,b as mt,v as ut,_ as Oe,w as qe,g as ft,as as ht,x as xt,y as pt,a as gt,t as Be}from"./index-B9HSZhdB.js";import{E as jt}from"./SearchMd-BSF-Glwf.js";import{E as Le}from"./error-boundary-B-QcFATa.js";import{I as $e,u as He}from"./use-connection-BfQqOvPU.js";import{T as bt,S as vt}from"./switch-BOFMRhtg.js";import{C as Ke}from"./checkbox-C8hkq1Ob.js";import{c as ie,B as Q}from"./button-hWHuMvle.js";import{i as yt}from"./ArrowLeft-CmZRAub5.js";import{C as St}from"./collection-search-BoabZo7c.js";import{I as Ue}from"./input-DcZE4UoL.js";import{s as Qe}from"./Plus-Df5PHguC.js";import{i as Ct}from"./X-D8XIiJvQ.js";import{b as wt,a as Nt}from"./use-gateway-BWSXRpvE.js";import{u as _t,a as It}from"./use-connection-resources-BuPCYNbb.js";import{u as Ze,a as re,c as ae,b as ce,T as de,i as Je}from"./tooltip-DxQ-KPX4.js";import{a as kt}from"./Copy01-D0tR5TRJ.js";import{i as We}from"./CpuChip02-BJZ8c2R6.js";import{i as Tt}from"./FlipBackward-J5E6LFga.js";import{i as Xe}from"./LinkExternal01-D-pWR4LA.js";import{i as Ae}from"./Loading01-CpvGD3vr.js";import{F as ke,a as $t,b as Pe,d as ze,f as Me,c as et}from"./form-B-xqHHYa.js";import{S as tt,a as st,b as nt,c as ot,d as Te}from"./select-l2DSo1hq.js";import{R as Pt}from"./resource-tabs-BBkx9rqd.js";import{s as zt}from"./slugify-CEUa2lfQ.js";import{P as Mt}from"./pin-to-sidebar-button-CJEwje2A.js";import{a as Rt,V as Et,b as At}from"./layout-B5ADxfcB.js";import{C as te,b as Ft,c as Gt,u as Dt,U as Vt,d as Ot,I as Bt,M as Lt}from"./index-7USdUZHF.js";import{u as lt,L as it}from"./localstorage-keys-DZPXAcMr.js";import{f as Ut}from"./formatDistanceToNow-B3w53gnj.js";import"./ChevronDown-xjFrqe8j.js";import"./badge-DpuZDXUE.js";import"./use-organization-settings-QpyD7U2T.js";import"./use-binding-Ccb4SpbZ.js";import"./auth-PKeXnxbM.js";import"./AlertCircle-D6b9Ralv.js";import"./Grid01-DETN8WPx.js";import"./responsive-select-Bl1ZcUtI.js";import"./use-mobile-v3aq_7jb.js";import"./textarea-BoUne3Q6.js";import"./Terminal-Cw0wmZeh.js";import"./connection-card-si8Xv84Q.js";import"./card-Cdw91ud0.js";import"./json-syntax-highlighter-Czp62O9j.js";import"./alert-dialog-CbCWAnT3.js";import"./File06-BzST8Ux5.js";import"./useQuery-DE63pAfU.js";const rt=({size:n=24,color:e="currentColor",...s})=>T.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},T.createElement("path",{d:"M12 20h9M3 20h1.675c.489 0 .733 0 .964-.055.204-.05.399-.13.578-.24.201-.123.374-.296.72-.642L19.5 6.5a2.121 2.121 0 0 0-3-3L3.937 16.063c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.578c-.055.23-.055.475-.055.965V20Z"}));rt.displayName="Edit03";const at=({size:n=24,color:e="currentColor",...s})=>T.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},T.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));at.displayName="Save01";const Wt=T.memo(function(e){const s=U.c(20),{connection:o,isSelected:l,hasItemsEnabled:r,activeItemsCount:m,totalItemsCount:g,onSelect:d,onToggle:a}=e,c=l?"bg-accent/50":"hover:bg-muted/50";let f;s[0]!==c?(f=ie("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),s[0]=c,s[1]=f):f=s[1];let x;s[2]!==o.icon||s[3]!==o.title?(x=t.jsx($e,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=x):x=s[4];let i;s[5]!==o.title?(i=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=i):i=s[6];let p;s[7]!==d||s[8]!==x||s[9]!==i?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:d,children:[x,i]}),s[7]=d,s[8]=x,s[9]=i,s[10]=p):p=s[10];let h;s[11]!==m||s[12]!==r||s[13]!==a||s[14]!==g?(h=g>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[m,"/",g]}),t.jsx(Ke,{checked:r,onCheckedChange:a,onClick:Jt})]}),s[11]=m,s[12]=r,s[13]=a,s[14]=g,s[15]=h):h=s[15];let v;return s[16]!==f||s[17]!==p||s[18]!==h?(v=t.jsxs("div",{className:f,children:[p,h]}),s[16]=f,s[17]=p,s[18]=h,s[19]=v):v=s[19],v}),qt=T.memo(function(e){const s=U.c(18),{connectionId:o,item:l,isSelected:r,onToggle:m}=e,g=`item-${o}-${l.id}`,d=r?"text-foreground":"text-muted-foreground";let a;s[0]!==d?(a=ie("text-sm font-medium",d),s[0]=d,s[1]=a):a=s[1];let c;s[2]!==l.name||s[3]!==a?(c=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:a,children:l.name})}),s[2]=l.name,s[3]=a,s[4]=c):c=s[4];let f;s[5]!==l.description?(f=l.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:l.description}),s[5]=l.description,s[6]=f):f=s[6];let x;s[7]!==c||s[8]!==f?(x=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,f]}),s[7]=c,s[8]=f,s[9]=x):x=s[9];const i=`item-${o}-${l.id}`;let p;s[10]!==r||s[11]!==m||s[12]!==i?(p=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ke,{id:i,checked:r,onCheckedChange:m,onClick:Yt})}),s[10]=r,s[11]=m,s[12]=i,s[13]=p):p=s[13];let h;return s[14]!==g||s[15]!==x||s[16]!==p?(h=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:g,children:[x,p]}),s[14]=g,s[15]=x,s[16]=p,s[17]=h):h=s[17],h});function ct({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:l,extraContent:r}){const[m,g]=T.useState(""),d=T.useDeferredValue(m),[a,c]=T.useState("all"),[f,x]=T.useState(!1),i=T.useRef(new Set(Object.keys(n))),p=He({searchTerm:d.trim()||void 0}),h=i.current,v=[...h.values()].map(u=>p.find(S=>S.id===u)).filter(u=>u!==void 0),w=p.filter(u=>!h.has(u.id)),N=[...v,...w],j=u=>{const S=n[u];return S!==void 0&&S.length>0},C=N.filter(u=>{if(a==="all")return!0;const S=j(u.id);return a==="selected"?S:a==="unselected"?!S:!0}),[b,_]=T.useState(N[0]?.id??null),y=b?N.find(u=>u.id===b)??null:null,M=y?s(y):[],R=(u,S)=>n[u]?.includes(S)??!1,W=(u,S)=>{const I=n[u]??[],G=I.includes(S),k={...n};if(G){const $=I.filter(E=>E!==S);$.length===0?delete k[u]:k[u]=$}else k[u]=[...I,S];e(k)},V=u=>{const S=N.find(A=>A.id===u);if(!S)return;const I=s(S);if(I.length===0)return;const G=n[u]??[],k=I.map(A=>A.id),$=G.length>0&&k.every(A=>G.includes(A)),E={...n};$?delete E[u]:(E[u]=k,_(u)),e(E)},z=u=>{_(u),x(!0)},q=()=>{x(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:ie("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[t.jsx(St,{value:m,onChange:g,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>c("all"),className:ie("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>c("selected"),className:ie("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>c("unselected"),className:ie("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:m?"No connections found":a==="selected"?"No servers selected":a==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(u=>{const I=s(u).length,G=n[u.id]?.length??0;return t.jsx(Wt,{connection:u,isSelected:b===u.id,hasItemsEnabled:j(u.id),activeItemsCount:G,totalItemsCount:I,onSelect:()=>z(u.id),onToggle:()=>V(u.id)},u.id)})})})]}),t.jsx("div",{className:ie("flex-1 flex-col",f?"flex":"hidden md:flex"),children:y?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(Q,{variant:"ghost",size:"sm",onClick:q,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(yt,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx($e,{icon:y.icon,name:y.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.title}),y.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),r,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:M.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:l||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:M.map(u=>t.jsx(qt,{connectionId:y.id,item:u,isSelected:R(y.id,u.id),onToggle:()=>W(y.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function Jt(n){return n.stopPropagation()}function Yt(n){return n.stopPropagation()}function Ht(n){const e=U.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:l}=n;let r;e[0]!==l?(r=d=>(l.get(d.id)??[]).map(Kt),e[0]=l,e[1]=r):r=e[1];const m=r;let g;return e[2]!==m||e[3]!==o||e[4]!==s?(g=t.jsx(ct,{itemSet:s,onItemSetChange:o,getItems:m,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=m,e[3]=o,e[4]=s,e[5]=g):g=e[5],g}function Kt(n){return{id:n.name,name:n.name,description:n.description}}function Qt(n){return n.includes("*")}function Zt(n){const e=U.c(27),{patterns:s,onAddPattern:o,onRemovePattern:l}=n,[r,m]=T.useState("");let g;e[0]!==r||e[1]!==o||e[2]!==s?(g=()=>{const x=r.trim();x&&!s.includes(x)&&(o(x),m(""))},e[0]=r,e[1]=o,e[2]=s,e[3]=g):g=e[3];const d=g;let a;e[4]!==d?(a=x=>{x.key==="Enter"&&(x.preventDefault(),d())},e[4]=d,e[5]=a):a=e[5];const c=a;let f;if(e[6]!==d||e[7]!==c||e[8]!==r||e[9]!==l||e[10]!==s){const x=s.filter(Qt);let i;e[12]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("code",{children:"*"}),e[12]=i):i=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",i," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=p):p=e[13];let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=_=>m(_.target.value),e[14]=h):h=e[14];let v;e[15]!==c||e[16]!==r?(v=t.jsx(Ue,{value:r,onChange:h,onKeyDown:c,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=c,e[16]=r,e[17]=v):v=e[17];let w;e[18]!==r?(w=r.trim(),e[18]=r,e[19]=w):w=e[19];const N=!w;let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Qe,{size:16}),e[20]=j):j=e[20];let C;e[21]!==d||e[22]!==N?(C=t.jsx(Q,{type:"button",variant:"outline",size:"sm",onClick:d,disabled:N,children:j}),e[21]=d,e[22]=N,e[23]=C):C=e[23];let b;e[24]!==C||e[25]!==v?(b=t.jsxs("div",{className:"flex gap-2",children:[v,C]}),e[24]=C,e[25]=v,e[26]=b):b=e[26],f=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,b,x.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>l(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(Ct,{size:12})})]},_))})]}),e[6]=d,e[7]=c,e[8]=r,e[9]=l,e[10]=s,e[11]=f}else f=e[11];return f}function Xt(n){const e=U.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:l}=n,[r]=T.useState(null);let m;e[0]!==l?(m=j=>(l.get(j.id)??[]).map(es),e[0]=l,e[1]=m):m=e[1];const g=m;let d;e[2]!==o||e[3]!==s?(d=(j,C)=>{const b=s[j]??[];b.includes(C)||o({...s,[j]:[...b,C]})},e[2]=o,e[3]=s,e[4]=d):d=e[4];const a=d;let c;e[5]!==o||e[6]!==s?(c=(j,C)=>{const _=(s[j]??[]).filter(y=>y!==C);if(_.length===0){const y={...s};delete y[j],o(y)}else o({...s,[j]:_})},e[5]=o,e[6]=s,e[7]=c):c=e[7];const f=c;let x;e[8]!==o?(x=j=>{o(j)},e[8]=o,e[9]=x):x=e[9];const i=x;let p;e[10]!==s||e[11]!==r?(p=r?s[r]??[]:[],e[10]=s,e[11]=r,e[12]=p):p=e[12];const h=p;let v;e[13]!==a||e[14]!==f||e[15]!==r||e[16]!==h?(v=r?t.jsx(Zt,{patterns:h,onAddPattern:j=>a(r,j),onRemovePattern:j=>f(r,j)}):null,e[13]=a,e[14]=f,e[15]=r,e[16]=h,e[17]=v):v=e[17];const w=v;let N;return e[18]!==w||e[19]!==g||e[20]!==i||e[21]!==s?(N=t.jsx("div",{className:"h-full",children:t.jsx(ct,{itemSet:s,onItemSetChange:i,getItems:g,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:w})}),e[18]=w,e[19]=g,e[20]=i,e[21]=s,e[22]=N):N=e[22],N}function es(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}const ts="You are a helpful assistant. Please try answering the user's questions using your available tools.";function ss(n){const e=U.c(3),{gatewayId:s,onSelect:o}=n,{data:l}=Ot(s);if(l.length===0)return null;let r;return e[0]!==o||e[1]!==l?(r=t.jsx(Bt,{prompts:l,onSelect:o,className:"mt-6"}),e[0]=o,e[1]=l,e[2]=r):r=e[2],r}function ns(n,e){return n.find(e)??n[0]}function os(n,e,s,o){const l=U.c(9),r=null,[m,g]=lt(n,r);let d;l[0]!==s||l[1]!==m?(d=x=>m?s(x,m):!1,l[0]=s,l[1]=m,l[2]=d):d=l[2];let a;l[3]!==e||l[4]!==d?(a=ns(e,d),l[3]=e,l[4]=d,l[5]=a):a=l[5];const c=a;let f;return l[6]!==c||l[7]!==g?(f=[c,g],l[6]=c,l[7]=g,l[8]=f):f=l[8],f}function ls(n){const s=new TextEncoder().encode(n),o=Array.from(s,l=>String.fromCharCode(l)).join("");return btoa(o)}function is(n){const e=U.c(52),{serverName:s,gatewayUrl:o}=n,[l,r]=T.useState(!1),[m,g]=T.useState(null),d=zt(s);let a,c,f,x;if(e[0]!==o||e[1]!==d){const O={type:"http",url:o},L={[d]:O};a=JSON.stringify(L,null,2);const H=ne=>JSON.stringify({...O,headers:{"x-mesh-client":ne}},null,2),K=ls(H("Cursor"));c=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(d)}&config=${encodeURIComponent(K)}`;const J=H("Claude Code");f=d;let se;e[6]===Symbol.for("react.memo_cache_sentinel")?(se=/'/g,e[6]=se):se=e[6],x=J.replace(se,"'\\''"),e[0]=o,e[1]=d,e[2]=a,e[3]=c,e[4]=f,e[5]=x}else a=e[2],c=e[3],f=e[4],x=e[5];const i=`claude mcp add "${f}" --config '${x}'`;let p;e[7]!==a?(p=async()=>{await navigator.clipboard.writeText(a),r(!0),Be.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[7]=a,e[8]=p):p=e[8];const h=p;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=async(O,L)=>{await navigator.clipboard.writeText(O),g(L),Be.success(`${L} command copied`),setTimeout(()=>g(null),2e3)},e[9]=v):v=e[9];const w=v,N=rs;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=j):j=e[10];let C;e[11]!==l?(C=l?t.jsx(Je,{size:14}):t.jsx(kt,{size:14}),e[11]=l,e[12]=C):C=e[12];let b;e[13]!==h||e[14]!==C?(b=t.jsx(ce,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:h,children:C})}),e[13]=h,e[14]=C,e[15]=b):b=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(de,{children:"Copy configuration"}),e[16]=_):_=e[16];let y;e[17]!==b?(y=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(re,{children:t.jsxs(ae,{children:[b,_]})})}),e[17]=b,e[18]=y):y=e[18];let M;e[19]!==a||e[20]!==h?(M=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:h,children:a}),e[19]=a,e[20]=h,e[21]=M):M=e[21];let R;e[22]!==M||e[23]!==y?(R=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[y,M]}),e[22]=M,e[23]=y,e[24]=R):R=e[24];let W;e[25]!==c?(W=()=>N(c),e[25]=c,e[26]=W):W=e[26];let V,z;e[27]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),z=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=V,e[28]=z):(V=e[27],z=e[28]);let q;e[29]!==W?(q=t.jsx(ce,{asChild:!0,children:t.jsxs(Q,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:W,children:[V,z]})}),e[29]=W,e[30]=q):q=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(de,{children:"Add to Cursor"}),e[31]=u):u=e[31];let S;e[32]!==q?(S=t.jsx(re,{children:t.jsxs(ae,{children:[q,u]})}),e[32]=q,e[33]=S):S=e[33];let I;e[34]!==i?(I=()=>w(i,"Claude"),e[34]=i,e[35]=I):I=e[35];let G,k;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),k=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=G,e[37]=k):(G=e[36],k=e[37]);let $;e[38]!==m?($=m==="Claude"&&t.jsx(Je,{size:14,className:"ml-2 text-green-500"}),e[38]=m,e[39]=$):$=e[39];let E;e[40]!==I||e[41]!==$?(E=t.jsx(ce,{asChild:!0,children:t.jsxs(Q,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:I,children:[G,k,$]})}),e[40]=I,e[41]=$,e[42]=E):E=e[42];let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(de,{children:"Add to Claude Code"}),e[43]=A):A=e[43];let B;e[44]!==E?(B=t.jsx(re,{children:t.jsxs(ae,{children:[E,A]})}),e[44]=E,e[45]=B):B=e[45];let D;e[46]!==S||e[47]!==B?(D=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[S,B]}),e[46]=S,e[47]=B,e[48]=D):D=e[48];let Y;return e[49]!==R||e[50]!==D?(Y=t.jsxs("div",{className:"flex flex-col gap-4",children:[j,R,D]}),e[49]=R,e[50]=D,e[51]=Y):Y=e[51],Y}function rs(n){window.open(n,"_blank")}const as=ut({title:qe().min(1,"Name is required").max(255),description:qe().nullable(),status:Oe(["active","inactive"]),tool_selection_mode:Oe(["inclusion","exclusion"]),tool_selection_strategy:Oe(["passthrough","smart_tool_selection","code_execution"])});function cs(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const l=e.get(o.connection_id)??[];l.length>0&&(s[o.connection_id]=l)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function ds(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function ms(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function us(n,e,s,o){const l=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(l).map(r=>{const m=n[r]??[],g=o.get(r)??[],d=g.length>0&&g.every(a=>m.includes(a));return{connection_id:r,selected_tools:m.length===0||d?null:m,selected_resources:e[r]??null,selected_prompts:s[r]??null}})}function fs(n){const e=U.c(91),{gateway:s,activeThreadId:o,setActiveThreadId:l}=n,{data:r}=gt.useSession(),m=r?.user,g=Ft(),{locator:d}=Ze();let a;e[0]!==d?(a=it.chatSelectedModel(d),e[0]=d,e[1]=a):a=e[1];const[c,f]=os(a,g,hs);let x;e[2]!==o?(x={threadId:o,systemPrompt:ts},e[2]=o,e[3]=x):x=e[3];const i=Gt(x),{inputValue:p,setInputValue:h,branchContext:v,clearBranch:w}=Dt(),{isEmpty:N}=i,j=!!c;let C;e[4]!==o||e[5]!==i||e[6]!==w||e[7]!==s.id||e[8]!==j||e[9]!==c||e[10]!==h||e[11]!==m?.image||e[12]!==m?.name?(C=async ee=>{if(!j||!c){Be.error("No model configured");return}h(""),w();const fe={created_at:new Date().toISOString(),thread_id:o,model:{id:c.id,connectionId:c.connectionId,provider:c.provider??void 0,limits:c.limits??void 0},gateway:{id:s.id},user:{avatar:m?.image??void 0,name:m?.name??"you"}};await i.sendMessage(ee,fe)},e[4]=o,e[5]=i,e[6]=w,e[7]=s.id,e[8]=j,e[9]=c,e[10]=h,e[11]=m?.image,e[12]=m?.name,e[13]=C):C=e[13];const b=C;let _;e[14]!==f?(_=ee=>{f(ee)},e[14]=f,e[15]=_):_=e[15];const y=_;let M;e[16]!==v||e[17]!==w||e[18]!==l||e[19]!==h?(M=()=>{v&&(l(v.originalThreadId),w(),h(""))},e[16]=v,e[17]=w,e[18]=l,e[19]=h,e[20]=M):M=e[20];const R=M,W=s.title||"Gateway";let V;e[21]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(We,{size:32}),e[21]=V):V=e[21];let z;e[22]!==s.icon||e[23]!==W?(z=t.jsx($e,{icon:s.icon,name:W,size:"lg",fallbackIcon:V,className:"size-[60px]! rounded-[18px]!"}),e[22]=s.icon,e[23]=W,e[24]=z):z=e[24];const q=s.title||"Gateway Chat";let u;e[25]!==q?(u=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:q}),e[25]=q,e[26]=u):u=e[26];let S;e[27]!==s.description?(S=s.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[27]=s.description,e[28]=S):S=e[28];let I;e[29]!==u||e[30]!==S||e[31]!==z?(I=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[z,u,S]}),e[29]=u,e[30]=S,e[31]=z,e[32]=I):I=e[32];let G;e[33]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(Ae,{size:20,className:"animate-spin text-muted-foreground"})}),e[33]=G):G=e[33];let k;e[34]!==b?(k=ee=>{b(ee.description??ee.name)},e[34]=b,e[35]=k):k=e[35];let $;e[36]!==s.id||e[37]!==k?($=t.jsx(Le,{fallback:null,children:t.jsx(T.Suspense,{fallback:G,children:t.jsx(ss,{gatewayId:s.id,onSelect:k})})}),e[36]=s.id,e[37]=k,e[38]=$):$=e[38];let E;e[39]!==I||e[40]!==$?(E=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[I,$]}),e[39]=I,e[40]=$,e[41]=E):E=e[41];const A=E;let B;e[42]!==i.messages||e[43]!==i.status||e[44]!==A||e[45]!==N?(B=t.jsx(te.Main,{className:"h-full relative overflow-hidden",children:N?t.jsx(te.EmptyState,{children:A}):t.jsx(te.Messages,{messages:i.messages,status:i.status,minHeightOffset:240})}),e[42]=i.messages,e[43]=i.status,e[44]=A,e[45]=N,e[46]=B):B=e[46];let D;e[47]!==i.error||e[48]!==b?(D=()=>{i.error&&b(`I encountered this error: ${i.error.message}. Can you help me fix it?`)},e[47]=i.error,e[48]=b,e[49]=D):D=e[49];let Y;e[50]!==i.clearError||e[51]!==i.error||e[52]!==D?(Y=t.jsx(te.ErrorBanner,{error:i.error,onFixInChat:D,onDismiss:i.clearError}),e[50]=i.clearError,e[51]=i.error,e[52]=D,e[53]=Y):Y=e[53];let O;e[54]!==b?(O=()=>{b("Please continue.")},e[54]=b,e[55]=O):O=e[55];let L;e[56]!==i.clearFinishReason||e[57]!==i.finishReason||e[58]!==O?(L=t.jsx(te.FinishReasonWarning,{finishReason:i.finishReason,onContinue:O,onDismiss:i.clearFinishReason}),e[56]=i.clearFinishReason,e[57]=i.finishReason,e[58]=O,e[59]=L):L=e[59];let H;e[60]!==v||e[61]!==w||e[62]!==R||e[63]!==h?(H=t.jsx(te.BranchPreview,{branchContext:v,clearBranchContext:w,onGoToOriginalMessage:R,setInputValue:h}),e[60]=v,e[61]=w,e[62]=R,e[63]=h,e[64]=H):H=e[64];let K;e[65]!==b||e[66]!==p?(K=async()=>{p.trim()&&await b(p.trim())},e[65]=b,e[66]=p,e[67]=K):K=e[67];const J=!j,se=i.status==="submitted"||i.status==="streaming",ne=c?"Ask anything or @ for context":"Select a model to start chatting",me=c??void 0;let X;e[68]!==y||e[69]!==me?(X=t.jsx(Lt,{selectedModel:me,onModelChange:y,placeholder:"Model",variant:"borderless"}),e[68]=y,e[69]=me,e[70]=X):X=e[70];let Z;e[71]!==i.messages?(Z=t.jsx(Vt,{messages:i.messages}),e[71]=i.messages,e[72]=Z):Z=e[72];let oe;e[73]!==i.stop||e[74]!==p||e[75]!==h||e[76]!==K||e[77]!==J||e[78]!==se||e[79]!==ne||e[80]!==X||e[81]!==Z?(oe=t.jsxs(te.Input,{value:p,onChange:h,onSubmit:K,onStop:i.stop,disabled:J,isStreaming:se,placeholder:ne,children:[X,Z]}),e[73]=i.stop,e[74]=p,e[75]=h,e[76]=K,e[77]=J,e[78]=se,e[79]=ne,e[80]=X,e[81]=Z,e[82]=oe):oe=e[82];let F;e[83]!==Y||e[84]!==L||e[85]!==H||e[86]!==oe?(F=t.jsx(te.Footer,{children:t.jsxs("div",{className:"max-w-2xl mx-auto w-full min-w-0 flex flex-col gap-2",children:[Y,L,H,oe]})}),e[83]=Y,e[84]=L,e[85]=H,e[86]=oe,e[87]=F):F=e[87];let le;return e[88]!==B||e[89]!==F?(le=t.jsxs(te,{children:[B,F]}),e[88]=B,e[89]=F,e[90]=le):le=e[90],le}function hs(n,e){return n.id===e.id&&n.connectionId===e.connectionId}function xs(n){const e=U.c(2);let s;return e[0]!==n?(s=t.jsx(te.Provider,{children:t.jsx(fs,{...n})}),e[0]=n,e[1]=s):s=e[1],s}function ps(n){const e=U.c(41),{form:s,gateway:o,icon:l}=n;let r;e[0]!==s?(r=s.watch("title")||"Gateway",e[0]=s,e[1]=r):r=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(We,{}),e[2]=m):m=e[2];let g;e[3]!==l||e[4]!==r?(g=t.jsx($e,{icon:l,name:r,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=r,e[5]=g):g=e[5];let d;e[6]!==s.control?(d=t.jsx(ke,{control:s.control,name:"status",render:ys}),e[6]=s.control,e[7]=d):d=e[7];let a;e[8]!==g||e[9]!==d?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[g,d]}),e[8]=g,e[9]=d,e[10]=a):a=e[10];let c;e[11]!==s.control?(c=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ke,{control:s.control,name:"title",render:vs}),t.jsx(ke,{control:s.control,name:"description",render:bs})]}),e[11]=s.control,e[12]=c):c=e[12];let f;e[13]!==a||e[14]!==c?(f=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[a,c]}),e[13]=a,e[14]=c,e[15]=f):f=e[15];let x;e[16]!==s.control?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(ke,{control:s.control,name:"tool_selection_mode",render:js}),t.jsx(ke,{control:s.control,name:"tool_selection_strategy",render:gs})]}),e[16]=s.control,e[17]=x):x=e[17];let i;e[18]!==f||e[19]!==x?(i=t.jsxs("div",{className:"flex flex-col",children:[f,x]}),e[18]=f,e[19]=x,e[20]=i):i=e[20];let p;e[21]!==s||e[22]!==i?(p=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx($t,{...s,children:i})}),e[21]=s,e[22]=i,e[23]=p):p=e[23];let h;e[24]!==o.id||e[25]!==o.title?(h=o.title||`gateway-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=h):h=e[26];const v=`${window.location.origin}/mcp/gateway/${o.id}`;let w;e[27]!==h||e[28]!==v?(w=t.jsx("div",{className:"p-5",children:t.jsx(is,{serverName:h,gatewayUrl:v})}),e[27]=h,e[28]=v,e[29]=w):w=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=N):N=e[30];let j;e[31]!==o.updated_at?(j=o.updated_at?Ut(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=j):j=e[32];let C;e[33]!==j?(C=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[N,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[33]=j,e[34]=C):C=e[34];let b;e[35]!==w||e[36]!==C?(b=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[w,C]}),e[35]=w,e[36]=C,e[37]=b):b=e[37];let _;return e[38]!==p||e[39]!==b?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[p,b]}),e[38]=p,e[39]=b,e[40]=_):_=e[40],_}function gs(n){const{field:e}=n;return t.jsxs(Pe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(et,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(re,{children:t.jsxs(ae,{children:[t.jsx(ce,{asChild:!0,children:t.jsx(Q,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Gateway strategy help",children:t.jsx(Xe,{size:14,className:"text-muted-foreground"})})}),t.jsx(de,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(tt,{value:e.value,onValueChange:e.onChange,children:[t.jsx(ze,{children:t.jsx(st,{className:"w-[180px]",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Te,{value:"passthrough",children:"Passthrough"}),t.jsx(Te,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(Te,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Me,{})]})}function js(n){const{field:e}=n;return t.jsxs(Pe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(et,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(re,{children:t.jsxs(ae,{children:[t.jsx(ce,{asChild:!0,children:t.jsx(Q,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(Xe,{size:14,className:"text-muted-foreground"})})}),t.jsx(de,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(tt,{value:e.value,onValueChange:e.onChange,children:[t.jsx(ze,{children:t.jsx(st,{className:"w-[180px]",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Te,{value:"inclusion",children:"Include Selected"}),t.jsx(Te,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Me,{})]})}function bs(n){const{field:e}=n;return t.jsxs(Pe,{className:"w-full space-y-0",children:[t.jsx(ze,{children:t.jsx(Ue,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Me,{})]})}function vs(n){const{field:e}=n;return t.jsxs(Pe,{className:"w-full space-y-0",children:[t.jsx(ze,{children:t.jsx(Ue,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(Me,{})]})}function ys(n){const{field:e}=n;return t.jsxs(Pe,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(ze,{children:t.jsx(vt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Me,{})]})}function Ss(n){const e=U.c(96),{gateway:s,gatewayId:o,requestedTabId:l}=n,m=ft().location.href,g=ht();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={from:"/$org/gateways/$gatewayId"},e[0]=d):d=e[0];const a=Ye(d),c=Nt(),{locator:f}=Ze(),[x,i]=T.useState("chat");let p;e[1]!==o||e[2]!==f?(p=it.gatewayChatActiveThread(f,o),e[1]=o,e[2]=f,e[3]=p):p=e[3];const[h,v]=lt(p,Ns);let w;e[4]===Symbol.for("react.memo_cache_sentinel")?(w={},e[4]=w):w=e[4];const N=He(w);let j;e[5]!==N?(j=N.map(ws),e[5]=N,e[6]=j):j=e[6];const C=j,{promptsMap:b}=_t(C),{resourcesMap:_}=It(C);let y;if(e[7]!==N){y=new Map;for(const P of N)P.tools&&P.tools.length>0&&y.set(P.id,P.tools.map(Cs));e[7]=N,e[8]=y}else y=e[8];let M;e[9]!==y||e[10]!==s?(M=()=>cs(s,y),e[9]=y,e[10]=s,e[11]=M):M=e[11];const[R,W]=T.useState(M);let V;e[12]!==s?(V=()=>ds(s),e[12]=s,e[13]=V):V=e[13];const[z,q]=T.useState(V);let u;e[14]!==s?(u=()=>ms(s),e[14]=s,e[15]=u):u=e[15];const[S,I]=T.useState(u),[G,k]=T.useState(!1);let $;e[16]===Symbol.for("react.memo_cache_sentinel")?($=P=>{W(P),k(!0)},e[16]=$):$=e[16];const E=$;let A;e[17]===Symbol.for("react.memo_cache_sentinel")?(A=P=>{q(P),k(!0)},e[17]=A):A=e[17];const B=A;let D;e[18]===Symbol.for("react.memo_cache_sentinel")?(D=P=>{I(P),k(!0)},e[18]=D):D=e[18];const Y=D;let O;e[19]===Symbol.for("react.memo_cache_sentinel")?(O=xt(as),e[19]=O):O=e[19];const L=s.tool_selection_mode??"inclusion",H=s.tool_selection_strategy??"passthrough";let K;e[20]!==s.description||e[21]!==s.status||e[22]!==s.title||e[23]!==L||e[24]!==H?(K={resolver:O,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:L,tool_selection_strategy:H}},e[20]=s.description,e[21]=s.status,e[22]=s.title,e[23]=L,e[24]=H,e[25]=K):K=e[25];const J=pt(K),ne=J.formState.isDirty||G;let me;e[26]!==c.update||e[27]!==y||e[28]!==J||e[29]!==o||e[30]!==S||e[31]!==z||e[32]!==R?(me=async()=>{const P=J.getValues(),Ve=us(R,z,S,y);await c.update.mutateAsync({id:o,data:{title:P.title,description:P.description,status:P.status,tool_selection_mode:P.tool_selection_mode,tool_selection_strategy:P.tool_selection_strategy,connections:Ve}}),J.reset(P),k(!1),i("chat")},e[26]=c.update,e[27]=y,e[28]=J,e[29]=o,e[30]=S,e[31]=z,e[32]=R,e[33]=me):me=e[33];const X=me;let Z;e[34]===Symbol.for("react.memo_cache_sentinel")?(Z=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[34]=Z):Z=e[34];const oe=Z,F=oe.some(P=>P.id===l)?l:"settings";let le;e[35]!==a?(le=P=>{a({search:Ve=>({...Ve,tab:P}),replace:!0})},e[35]=a,e[36]=le):le=e[36];const ee=le,fe=c.update.isPending,ue=x==="edit";let he;e[37]!==g.history?(he=()=>g.history.back(),e[37]=g.history,e[38]=he):he=e[38];let xe;e[39]!==F||e[40]!==s.description||e[41]!==s.icon||e[42]!==s.title||e[43]!==ee||e[44]!==ue?(xe=t.jsx(Rt,{children:ue?t.jsx(Pt,{tabs:oe,activeTab:F,onTabChange:ee}):t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx($e,{icon:s.icon,name:s.title||"Gateway",size:"xs",fallbackIcon:t.jsx(We,{size:12})}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.title}),s.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s.description})]}):null]})]})}),e[39]=F,e[40]=s.description,e[41]=s.icon,e[42]=s.title,e[43]=ee,e[44]=ue,e[45]=xe):xe=e[45];const Fe=s.icon??"cpu_chip";let pe;e[46]!==s.title||e[47]!==Fe||e[48]!==m?(pe=t.jsx(Mt,{title:s.title,url:m,icon:Fe}),e[46]=s.title,e[47]=Fe,e[48]=m,e[49]=pe):pe=e[49];let ge;e[50]!==X||e[51]!==ne||e[52]!==ue||e[53]!==fe||e[54]!==v?(ge=ue?t.jsxs(t.Fragment,{children:[t.jsx(re,{children:t.jsxs(ae,{delayDuration:0,children:[t.jsx(ce,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(Q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:fe,onClick:()=>i("chat"),"aria-label":"Cancel",children:t.jsx(Tt,{size:14})})})}),t.jsx(de,{side:"bottom",children:"Cancel"})]})}),ne&&t.jsx(re,{children:t.jsxs(ae,{delayDuration:0,children:[t.jsx(ce,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(Q,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:fe,onClick:X,"aria-label":"Save",children:fe?t.jsx(Ae,{size:14,className:"animate-spin"}):t.jsx(at,{size:14})})})}),t.jsx(de,{side:"bottom",children:"Save"})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(re,{children:t.jsxs(ae,{children:[t.jsx(ce,{asChild:!0,children:t.jsx(Q,{type:"button",onClick:()=>v(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(Qe,{size:16})})}),t.jsx(de,{children:"New thread"})]})}),t.jsx(re,{children:t.jsxs(ae,{children:[t.jsx(ce,{asChild:!0,children:t.jsx(Q,{type:"button",onClick:()=>i("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(rt,{size:16})})}),t.jsx(de,{children:"Edit Settings"})]})})]}),e[50]=X,e[51]=ne,e[52]=ue,e[53]=fe,e[54]=v,e[55]=ge):ge=e[55];let je;e[56]!==pe||e[57]!==ge?(je=t.jsxs(Et,{children:[pe,ge]}),e[56]=pe,e[57]=ge,e[58]=je):je=e[58];const Ge=ue?"opacity-0 pointer-events-none hidden":"opacity-100";let be;e[59]!==Ge?(be=ie("h-full transition-opacity duration-200 ease-out",Ge),e[59]=Ge,e[60]=be):be=e[60];let ve;e[61]!==h||e[62]!==s||e[63]!==v?(ve=t.jsx(xs,{gateway:s,activeThreadId:h,setActiveThreadId:v}),e[61]=h,e[62]=s,e[63]=v,e[64]=ve):ve=e[64];let ye;e[65]!==be||e[66]!==ve?(ye=t.jsx("div",{className:be,children:ve}),e[65]=be,e[66]=ve,e[67]=ye):ye=e[67];const De=ue?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none hidden";let Se;e[68]!==De?(Se=ie("h-full overflow-auto transition-opacity duration-200 ease-out",De),e[68]=De,e[69]=Se):Se=e[69];let Re;e[70]===Symbol.for("react.memo_cache_sentinel")?(Re=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ae,{size:32,className:"animate-spin text-muted-foreground"})}),e[70]=Re):Re=e[70];let Ce;e[71]!==F||e[72]!==b||e[73]!==_||e[74]!==J||e[75]!==s||e[76]!==S||e[77]!==z||e[78]!==R?(Ce=F==="settings"?t.jsx(ps,{form:J,gateway:s,icon:s.icon}):F==="tools"?t.jsx(bt,{toolSet:R,onToolSetChange:E}):F==="resources"?t.jsx(Xt,{resourceSet:z,onResourceSetChange:B,connectionResources:_}):F==="prompts"?t.jsx(Ht,{promptSet:S,onPromptSetChange:Y,connectionPrompts:b}):null,e[71]=F,e[72]=b,e[73]=_,e[74]=J,e[75]=s,e[76]=S,e[77]=z,e[78]=R,e[79]=Ce):Ce=e[79];let we;e[80]!==Ce?(we=t.jsx(T.Suspense,{fallback:Re,children:Ce}),e[80]=Ce,e[81]=we):we=e[81];let Ne;e[82]!==F||e[83]!==we?(Ne=t.jsx(Le,{children:we},F),e[82]=F,e[83]=we,e[84]=Ne):Ne=e[84];let _e;e[85]!==Se||e[86]!==Ne?(_e=t.jsx("div",{className:Se,children:Ne}),e[85]=Se,e[86]=Ne,e[87]=_e):_e=e[87];let Ie;e[88]!==ye||e[89]!==_e?(Ie=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[ye,_e]})}),e[88]=ye,e[89]=_e,e[90]=Ie):Ie=e[90];let Ee;return e[91]!==he||e[92]!==xe||e[93]!==je||e[94]!==Ie?(Ee=t.jsxs(At,{onBack:he,children:[xe,je,Ie]}),e[91]=he,e[92]=xe,e[93]=je,e[94]=Ie,e[95]=Ee):Ee=e[95],Ee}function Cs(n){return n.name}function ws(n){return n.id}function Ns(n){return n||crypto.randomUUID()}function _s(){const n=U.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=Ye(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:l,org:r}=dt(o);let m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/gateways/$gatewayId"},n[2]=m):m=n[2];const d=mt(m).tab||"settings",a=wt(l);if(!a){let f;return n[3]!==s||n[4]!==r?(f=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(jt,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(Q,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),n[3]=s,n[4]=r,n[5]=f):f=n[5],f}let c;return n[6]!==a||n[7]!==l||n[8]!==d?(c=t.jsx(Ss,{gateway:a,gatewayId:l,requestedTabId:d}),n[6]=a,n[7]=l,n[8]=d,n[9]=c):c=n[9],c}function Is(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Le,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_s,{})})}),n[0]=e):e=n[0],e}function yn(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Is,{}),n[0]=e):e=n[0],e}export{yn as default};
@@ -0,0 +1 @@
1
+ import{c as te,j as t,r as se,f as ae,t as re}from"./index-B9HSZhdB.js";import{C as ie}from"./collection-header-BxKOSRWd.js";import{C as ne}from"./collection-page-BDy0PpkC.js";import{C as le}from"./collection-search-BoabZo7c.js";import{C as ce}from"./collection-table-wrapper-BERroKt9.js";import{C as de}from"./connection-card-si8Xv84Q.js";import{E as q}from"./SearchMd-BSF-Glwf.js";import{E as me}from"./error-boundary-B-QcFATa.js";import{u as ue,I as ge}from"./use-connection-BfQqOvPU.js";import{a as pe,u as he}from"./use-gateway-BWSXRpvE.js";import{u as fe,s as Q}from"./use-list-state-qFWsDnqD.js";import{u as xe}from"./tooltip-DxQ-KPX4.js";import{c as ye,b as we,d as je,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-CbCWAnT3.js";import{B as oe}from"./badge-DpuZDXUE.js";import{B as J}from"./button-hWHuMvle.js";import{b as U,D as X,a as Y,c as B}from"./dropdown-menu-DG5cxUDL.js";import{i as y}from"./CpuChip02-BJZ8c2R6.js";import{i as Z}from"./DotsVertical-0Pg6f15X.js";import{i as be}from"./Loading01-CpvGD3vr.js";import{s as ee}from"./Trash01-DPFHmwKr.js";import"./collection-display-button-DJTB2EUg.js";import"./Grid01-DETN8WPx.js";import"./view-mode-toggle-C9GLUxuG.js";import"./input-DcZE4UoL.js";import"./card-Cdw91ud0.js";import"./use-mobile-v3aq_7jb.js";function ke(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:a}=xe(),r=ae();let w;e[0]!==a.slug?(w={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=w):w=e[1];const s=fe(w),i=pe(),x=he(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[n,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==a.slug?(D=async()=>{if(R.length===0){re.error("Create at least one MCP connection first");return}const o=await i.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=a.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==n.gateway||e[11]!==n.mode?(S=async()=>{if(n.mode!=="deleting")return;const o=n.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=n.gateway,e[11]=n.mode,e[12]=S):S=e[12];const O=S;let v,b,k,_,M,I;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Ke,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ge,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},M={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:Ae,cellClassName:"w-24 shrink-0"},v={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=v,e[14]=b,e[15]=k,e[16]=_,e[17]=M,e[18]=I):(v=e[13],b=e[14],k=e[15],_=e[16],M=e[17],I=e[18]);let P;e[19]!==r||e[20]!==a.slug?(P=[b,k,_,M,I,v,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Pe,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=r,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=i.create.isPending?"Creating...":"Create MCP Gateway";let $;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?($=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i.create.isPending,children:H}),e[22]=i.create.isPending,e[23]=T,e[24]=H,e[25]=$):$=e[25];const L=$,F=n.mode==="deleting";let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[26]=z):z=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ye,{children:"Delete Gateway?"}),e[27]=A):A=e[27];const W=n.mode==="deleting"&&n.gateway.title;let c;e[28]!==W?(c=t.jsxs(we,{children:[A,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==O?(d=t.jsxs(Ne,{children:[E,t.jsx(De,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(Se,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(ve,{open:F,onOpenChange:z,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let g;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(g=t.jsx(ie,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=g):g=e[46];let p;e[47]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=p):p=e[48];let h;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:p}),e[49]=s.search,e[50]=s.setSearch,e[51]=p,e[52]=h):h=e[52];let f;e[53]!==V||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==r||e[61]!==a.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(y,{}),onClick:()=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:V,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=r,e[61]=a.slug,e[62]=f):f=e[62];let K;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(K=t.jsxs(ne,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=K):K=e[67],K}function Me(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Pe(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Ae(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ge(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ke(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(ge,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(y,{size:16})})}function mt(){const e=te.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=a):a=e[0],a}export{mt as default};
@@ -1 +1 @@
1
- import{c as u,j as i,a as w,r as C,f as E}from"./index--kROx8O6.js";import{C as _}from"./card-C7renjvY.js";import{c as v,B as $}from"./button-dzqjSoP9.js";import{A as k}from"./avatar-_GsuhjwG.js";import{i as A}from"./AlertCircle-BMr3-fpA.js";import{s as O}from"./Plus-mxlUVGel.js";import{I as L}from"./input-Dos1YqM9.js";import{C as D}from"./create-organization-dialog-C1_fICTk.js";import"./alert-dialog-P1n_1JT7.js";import"./form-DNs0FRpn.js";import"./spinner-DssEQupg.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let a;e[0]!==s?(a=p=>{s&&s(p)},e[0]=s,e[1]=a):a=e[1];const m=a,d=s&&"cursor-pointer",c=x&&"hover:ring-2 hover:ring-primary";let o;e[2]!==l||e[3]!==d||e[4]!==c?(o=v("group transition-all flex flex-col gap-0",d,c,l),e[2]=l,e[3]=d,e[4]=c,e[5]=o):o=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==o?(g=i.jsx(_,{className:o,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=o,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:a}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,c=x===void 0?"contain":x;let o;return e[0]!==a||e[1]!==l||e[2]!==c||e[3]!==m||e[4]!==d||e[5]!==n?(o=i.jsx(k,{url:n,fallback:l,shape:m,size:d,objectFit:c,className:a}),e[0]=a,e[1]=l,e[2]=c,e[3]=m,e[4]=d,e[5]=n,e[6]=o):o=e[6],o}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const a=x,d=P[s===void 0?4:s],c=a.sm&&V[a.sm],o=a.md&&X[a.md],g=a.lg&&J[a.lg],p=a.xl&&K[a.xl],j=a["2xl"]&&U[a["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==c||e[5]!==o||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,c,o,g,p,j,r),e[2]=r,e[3]=d,e[4]=c,e[5]=o,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let a;e[0]!==l?(a=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=a):a=e[1];const m=a,d=s===void 0?4:s;let c;e[2]!==x?(c=Array.from({length:x}).map(Y),e[2]=x,e[3]=c):c=e[3];let o;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==c?(o=i.jsx(z,{columns:m,gap:d,className:r,children:c}),e[4]=r,e[5]=m,e[6]=d,e[7]=c,e[8]=o):o=e[8],o}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const c=n.toLowerCase();return l.filter(o=>o.name.toLowerCase().includes(c)||o.slug.toLowerCase().includes(c))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=c):c=e[3],c}if(x.length===0){let c;return e[4]!==n?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=c):c=e[5],c}let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a={sm:2,md:3,lg:4},e[6]=a):a=e[6];let m;if(e[7]!==x||e[8]!==s){let c;e[10]!==s?(c=o=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:o.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:o.logo||"",fallback:o.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",o.slug]}),i.jsx(b.Title,{children:o.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(o.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},o.id),e[10]=s,e[11]=c):c=e[11],m=x.map(c),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:a,children:m}),e[12]=m,e[13]=d):d=e[13],d}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(A,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),a=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let c;t[6]!==l?(c=i.jsx(L,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=c):c=t[7];let o;t[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs($,{variant:"default",onClick:()=>x(!0),children:[i.jsx(O,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=o):o=t[8];let g;t[9]!==c?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[c,o]})]}),t[9]=c,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==a?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:a})})}),t[12]=a,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function fe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{fe as default};
1
+ import{c as u,j as i,a as w,r as C,f as E}from"./index-B9HSZhdB.js";import{C as _}from"./card-Cdw91ud0.js";import{c as v,B as $}from"./button-hWHuMvle.js";import{A as k}from"./avatar-g2HizpCv.js";import{i as A}from"./AlertCircle-D6b9Ralv.js";import{s as O}from"./Plus-Df5PHguC.js";import{I as L}from"./input-DcZE4UoL.js";import{C as D}from"./create-organization-dialog-D4tz0eZI.js";import"./alert-dialog-CbCWAnT3.js";import"./form-B-xqHHYa.js";import"./spinner-BtMKC1U7.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let a;e[0]!==s?(a=p=>{s&&s(p)},e[0]=s,e[1]=a):a=e[1];const m=a,d=s&&"cursor-pointer",c=x&&"hover:ring-2 hover:ring-primary";let o;e[2]!==l||e[3]!==d||e[4]!==c?(o=v("group transition-all flex flex-col gap-0",d,c,l),e[2]=l,e[3]=d,e[4]=c,e[5]=o):o=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==o?(g=i.jsx(_,{className:o,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=o,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:a}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,c=x===void 0?"contain":x;let o;return e[0]!==a||e[1]!==l||e[2]!==c||e[3]!==m||e[4]!==d||e[5]!==n?(o=i.jsx(k,{url:n,fallback:l,shape:m,size:d,objectFit:c,className:a}),e[0]=a,e[1]=l,e[2]=c,e[3]=m,e[4]=d,e[5]=n,e[6]=o):o=e[6],o}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const a=x,d=P[s===void 0?4:s],c=a.sm&&V[a.sm],o=a.md&&X[a.md],g=a.lg&&J[a.lg],p=a.xl&&K[a.xl],j=a["2xl"]&&U[a["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==c||e[5]!==o||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,c,o,g,p,j,r),e[2]=r,e[3]=d,e[4]=c,e[5]=o,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let a;e[0]!==l?(a=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=a):a=e[1];const m=a,d=s===void 0?4:s;let c;e[2]!==x?(c=Array.from({length:x}).map(Y),e[2]=x,e[3]=c):c=e[3];let o;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==c?(o=i.jsx(z,{columns:m,gap:d,className:r,children:c}),e[4]=r,e[5]=m,e[6]=d,e[7]=c,e[8]=o):o=e[8],o}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const c=n.toLowerCase();return l.filter(o=>o.name.toLowerCase().includes(c)||o.slug.toLowerCase().includes(c))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=c):c=e[3],c}if(x.length===0){let c;return e[4]!==n?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=c):c=e[5],c}let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a={sm:2,md:3,lg:4},e[6]=a):a=e[6];let m;if(e[7]!==x||e[8]!==s){let c;e[10]!==s?(c=o=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:o.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:o.logo||"",fallback:o.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",o.slug]}),i.jsx(b.Title,{children:o.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(o.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},o.id),e[10]=s,e[11]=c):c=e[11],m=x.map(c),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:a,children:m}),e[12]=m,e[13]=d):d=e[13],d}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(A,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),a=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let c;t[6]!==l?(c=i.jsx(L,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=c):c=t[7];let o;t[8]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs($,{variant:"default",onClick:()=>x(!0),children:[i.jsx(O,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=o):o=t[8];let g;t[9]!==c?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[c,o]})]}),t[9]=c,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==a?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:a})})}),t[12]=a,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function fe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{fe as default};