@decocms/mesh 2.15.1 → 2.17.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 (154) hide show
  1. package/dist/client/assets/{AlertCircle-DlBo4Xw9.js → AlertCircle-DOBZDZTf.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CCqPW2JN.js → ArrowLeft-CiX5attk.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-KvHCnFh3.js → ArrowUp-Cb5IgbXf.js} +1 -1
  4. package/dist/client/assets/{Check-D4dBNJmC.js → Check-D_y2LGJG.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CJaS1NVA.js → ChevronDown-CK8tBMwt.js} +1 -1
  6. package/dist/client/assets/{Code01-CMazpegY.js → Code01-CHaKquD7.js} +1 -1
  7. package/dist/client/assets/{Copy01-Rf_P7R5F.js → Copy01-DEYUyyKa.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-Nj82ZW12.js → DotsHorizontal-CJj2K5Fj.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-f9rnazjX.js → DotsVertical-DBgin8Gd.js} +1 -1
  10. package/dist/client/assets/{Download01-Cnas0PSW.js → Download01-D480FrAl.js} +1 -1
  11. package/dist/client/assets/{Edit01-MWKLkbpZ.js → Edit01-C2wyoLl_.js} +1 -1
  12. package/dist/client/assets/{File06-Dir7h2_j.js → File06-Dss_qxDP.js} +1 -1
  13. package/dist/client/assets/{FilterLines-BgxUhbig.js → FilterLines-BIIc2m5u.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-B1KVh_65.js → FlipBackward-C6tD49bS.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-CA4KhZZx.js → GitBranch01-CCs9Y7UL.js} +1 -1
  16. package/dist/client/assets/{Grid01-BgBQwtBY.js → Grid01-CPcgzk-j.js} +1 -1
  17. package/dist/client/assets/{Home02-CR-W2ctm.js → Home02-B2DfszMd.js} +1 -1
  18. package/dist/client/assets/{Image01-B8cj-qoF.js → Image01-CWiMChMV.js} +1 -1
  19. package/dist/client/assets/{Inbox01-Bh5pMKE1.js → Inbox01-E54Xv1AH.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-CVdyaBb8.js → InfoCircle-C1Hk7qxK.js} +1 -1
  21. package/dist/client/assets/{Key01-BcxLAym0.js → Key01-D3jgPHnl.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-D41WE0Cl.js → LinkExternal01-DXt_okRr.js} +1 -1
  23. package/dist/client/assets/{List-hTdqyLGB.js → List-vJTsFkGC.js} +1 -1
  24. package/dist/client/assets/{Loading01-Bq_7Os6T.js → Loading01-CXxLrMyp.js} +1 -1
  25. package/dist/client/assets/{Lock01-DOJDUqUZ.js → Lock01-C0IcfwAr.js} +1 -1
  26. package/dist/client/assets/MessageChatSquare-BAK3msQ9.js +1 -0
  27. package/dist/client/assets/{Play-CoxjBx7-.js → Play-D5UR01Yp.js} +1 -1
  28. package/dist/client/assets/{Plus-C4F6mby2.js → Plus-BwqRnIpw.js} +1 -1
  29. package/dist/client/assets/{SearchMd-B_A85eif.js → SearchMd-B72GLhSo.js} +1 -1
  30. package/dist/client/assets/{Terminal-BWurH474.js → Terminal-C6oII67o.js} +1 -1
  31. package/dist/client/assets/{Trash01-GrzirNvV.js → Trash01-pQsQJfD7.js} +1 -1
  32. package/dist/client/assets/{Upload01-Ba_zCXbQ.js → Upload01-CPXoheIk.js} +1 -1
  33. package/dist/client/assets/{X-D09jV0HO.js → X-Ta7e64fd.js} +1 -1
  34. package/dist/client/assets/{XClose-D9UXYoHK.js → XClose-COWRVEvP.js} +1 -1
  35. package/dist/client/assets/{alert-dialog-Df8ZsItX.js → alert-dialog-CwDNNTWs.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-Bu_AmzqF.js → auth-catchall-DOIkjlbS.js} +1 -1
  37. package/dist/client/assets/{avatar-CrVRRbJ7.js → avatar-Bbu1o6br.js} +1 -1
  38. package/dist/client/assets/{badge-BPKvq16e.js → badge-BF26aj7r.js} +1 -1
  39. package/dist/client/assets/{binder-BtPpbY4I.js → binder-CZMsXyzM.js} +1 -1
  40. package/dist/client/assets/button-CKEM3eQL.js +1 -0
  41. package/dist/client/assets/{card-Rz2C5-Lx.js → card-2L27xRvH.js} +1 -1
  42. package/dist/client/assets/{checkbox-DGIT6WZ3.js → checkbox-D-u8zfFA.js} +1 -1
  43. package/dist/client/assets/{collection-detail-CIorpvYQ.js → collection-detail-DRvlQkfI.js} +2 -2
  44. package/dist/client/assets/{collection-display-button-C_GfVLwh.js → collection-display-button-BRmjKmXA.js} +1 -1
  45. package/dist/client/assets/{collection-header-Dl8Ii13M.js → collection-header-DxthRGYV.js} +1 -1
  46. package/dist/client/assets/{collection-page-C75JriCh.js → collection-page-D_yHhDuI.js} +1 -1
  47. package/dist/client/assets/{collection-search-D67e9ppe.js → collection-search-B1XW3AZu.js} +1 -1
  48. package/dist/client/assets/{collection-tab-DVmiR956.js → collection-tab-tjhO7Mrn.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-DDHrDWif.js → collection-table-wrapper-D0Ju0-U8.js} +1 -1
  50. package/dist/client/assets/{connection-card-BuCHeT4K.js → connection-card-DtL0ugHI.js} +1 -1
  51. package/dist/client/assets/connection-detail-CfQ3feir.js +1 -0
  52. package/dist/client/assets/{connection-CmMMEDBY.js → connection-iGG9vveH.js} +1 -1
  53. package/dist/client/assets/connections-D3zmX0Z9.js +1 -0
  54. package/dist/client/assets/constants-rLrKmanL.js +1 -0
  55. package/dist/client/assets/{create-organization-dialog-DQ5uy2r0.js → create-organization-dialog-eRNW8Qxh.js} +1 -1
  56. package/dist/client/assets/{dialog-bW33A1d_.js → dialog-CDtau8Kt.js} +1 -1
  57. package/dist/client/assets/{dropdown-menu-dsr_wyw0.js → dropdown-menu-wWS-zaMN.js} +1 -1
  58. package/dist/client/assets/dynamic-plugin-layout-DputRlYb.js +1 -0
  59. package/dist/client/assets/{empty-state-By_kA__m.js → empty-state-BHbK0lgC.js} +1 -1
  60. package/dist/client/assets/{empty-state-B1DU5702.js → empty-state-CVNEuxZY.js} +1 -1
  61. package/dist/client/assets/{env-vars-editor-BjH5KdVc.js → env-vars-editor-C51mNjyA.js} +1 -1
  62. package/dist/client/assets/{error-boundary-BOBkDZ1Y.js → error-boundary-Bcxx4rfP.js} +1 -1
  63. package/dist/client/assets/{extract-connection-data-CNcw3HV2.js → extract-connection-data-Dpmksiuo.js} +1 -1
  64. package/dist/client/assets/{file-browser-BDyBPrc6.js → file-browser-BGJT68ml.js} +2 -2
  65. package/dist/client/assets/{form-ChO7tWCF.js → form-V7XQlTI9.js} +1 -1
  66. package/dist/client/assets/gateway-detail-Dwo3tRMv.js +1 -0
  67. package/dist/client/assets/{gateways-ckyn_Uas.js → gateways-zERSWoJy.js} +1 -1
  68. package/dist/client/assets/{grid-view-CTAOtRDs.js → grid-view-D8luahOM.js} +1 -1
  69. package/dist/client/assets/{home-CpIhQ8D8.js → home-BzIxKv5R.js} +1 -1
  70. package/dist/client/assets/index-BuhwJgoT.js +1 -0
  71. package/dist/client/assets/index-CCciYu2S.css +1 -0
  72. package/dist/client/assets/{index-ChF3uWl9.js → index-COEG5bG9.js} +1 -1
  73. package/dist/client/assets/{index-CH2G6_zW.js → index-D93bwXlh.js} +1 -1
  74. package/dist/client/assets/index-Dm3KUy-5.js +107 -0
  75. package/dist/client/assets/{index-ZiFjEqyT.js → index-H8waGLZX.js} +3 -3
  76. package/dist/client/assets/{infiniteQueryObserver-DEh2zauU.js → infiniteQueryObserver-CorNdPTl.js} +1 -1
  77. package/dist/client/assets/{input-DEsmZ6es.js → input-B_S0H_Hl.js} +1 -1
  78. package/dist/client/assets/layout-CSDcjZIC.js +1 -0
  79. package/dist/client/assets/{lazy-highlighter-B2TKQCpQ.js → lazy-highlighter-C9yEt-oj.js} +1 -1
  80. package/dist/client/assets/{localstorage-keys-DhdYpXZj.js → localstorage-keys-bcceq1xC.js} +1 -1
  81. package/dist/client/assets/{login-DtC787Hg.js → login-BYnVwbER.js} +1 -1
  82. package/dist/client/assets/{mcp-oauth-D8a9d38x.js → mcp-oauth-BQzIgGw8.js} +1 -1
  83. package/dist/client/assets/{mcp-server-card-DSQZ-b3I.js → mcp-server-card-_ATNoXTX.js} +1 -1
  84. package/dist/client/assets/{mcp-server-detail-rW4PqaOO.js → mcp-server-detail-DObA9nLB.js} +1 -1
  85. package/dist/client/assets/{members-C4HTAJHG.js → members-BebBEAXI.js} +2 -2
  86. package/dist/client/assets/{monaco-editor-BYgR7J38.js → monaco-editor-DKdQnknl.js} +4 -4
  87. package/dist/client/assets/{monitoring-BGY0w02b.js → monitoring-CDDlEqUx.js} +6 -6
  88. package/dist/client/assets/{oauth-callback-BSZdPTYI.js → oauth-callback-gzfkrrQW.js} +1 -1
  89. package/dist/client/assets/page-CLLgwmPE.js +35 -0
  90. package/dist/client/assets/page-Do6tc7Ak.js +1 -0
  91. package/dist/client/assets/{pin-to-sidebar-button-BahvsjHH.js → pin-to-sidebar-button-NqMT4AF7.js} +1 -1
  92. package/dist/client/assets/{plugin-empty-state-CIiB0IAw.js → plugin-empty-state-CsEwK0UI.js} +1 -1
  93. package/dist/client/assets/{plugin-header-CvDO4WmD.js → plugin-header-DMvUkTVw.js} +1 -1
  94. package/dist/client/assets/plugins-femIOaN7.js +1 -0
  95. package/dist/client/assets/{popover-DW05feED.js → popover-CUHksX3w.js} +1 -1
  96. package/dist/client/assets/{project-context-provider-BPo-49FO.js → project-context-provider-DTbOrAFq.js} +1 -1
  97. package/dist/client/assets/{registry-utils-DzI73csj.js → registry-utils-C5W-BZ_1.js} +1 -1
  98. package/dist/client/assets/{resizable-BAPLF4RD.js → resizable-BEUt05S8.js} +1 -1
  99. package/dist/client/assets/{resource-tabs-CC5dHHUl.js → resource-tabs-kfeiBQEL.js} +1 -1
  100. package/dist/client/assets/select-H2esePZI.js +1 -0
  101. package/dist/client/assets/settings-DO0PkWA0.js +1 -0
  102. package/dist/client/assets/shell-layout-Bx8F46Gf.js +17 -0
  103. package/dist/client/assets/{spinner-DqooIng7.js → spinner-BZhaf6l_.js} +1 -1
  104. package/dist/client/assets/{switch-dZML6kqo.js → switch-CIfCfD81.js} +1 -1
  105. package/dist/client/assets/{textarea-DFRypKCQ.js → textarea-CC9KHQpw.js} +1 -1
  106. package/dist/client/assets/{tool-set-selector-DRx4AOzy.js → tool-set-selector-Cty6fXdH.js} +1 -1
  107. package/dist/client/assets/{tools-list-C8nSsOKD.js → tools-list-rrG-PiCB.js} +1 -1
  108. package/dist/client/assets/{tooltip-BJO9sFhZ.js → tooltip-DixY1Sbc.js} +1 -1
  109. package/dist/client/assets/use-binding-CPqdk4GE.js +23 -0
  110. package/dist/client/assets/{use-collections-g067BPxP.js → use-collections-S6OVeMx0.js} +1 -1
  111. package/dist/client/assets/{use-connection-BskZam-G.js → use-connection-C_QQYkok.js} +1 -1
  112. package/dist/client/assets/use-connection-resources-h_CY6VEc.js +1 -0
  113. package/dist/client/assets/{use-create-gateway-CCmt4GT8.js → use-create-gateway-eDGGqEOS.js} +1 -1
  114. package/dist/client/assets/{use-gateway-v7etejE8.js → use-gateway-DMJjVwlU.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-DoCpWoeh.js → use-gateway-system-prompt-CfIIyZId.js} +1 -1
  116. package/dist/client/assets/{use-list-state-C5pgFF_z.js → use-list-state-Bt6QEhtR.js} +1 -1
  117. package/dist/client/assets/{use-mcp-ZNQ-iMEF.js → use-mcp-DuKh-Xf7.js} +1 -1
  118. package/dist/client/assets/{use-members-dVasH0ez.js → use-members-Hsme2FMs.js} +1 -1
  119. package/dist/client/assets/{use-mobile-Co7MtEW-.js → use-mobile-Bh6onNnL.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-K7SU43aD.js → use-organization-settings-C4u9V1Gg.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-BbfSyOCz.js → use-tool-call-BSVniqlJ.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-BYo7uk8S.js +1 -0
  123. package/dist/client/assets/{useMutation-4fnzP4bc.js → useMutation-DXyBs08e.js} +1 -1
  124. package/dist/client/assets/useQuery-9rHAo5k0.js +1 -0
  125. package/dist/client/assets/{value-zEqR5KPg.js → value-EQeDZr5M.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-tlrhMsiy.js → view-mode-toggle-CoxeG-5F.js} +1 -1
  127. package/dist/client/assets/{well-known-mcp-D13f-8h2.js → well-known-mcp-DOEdYmKO.js} +1 -1
  128. package/dist/client/assets/{workflow-B8_jtBci.js → workflow-CdkAFtfl.js} +1 -1
  129. package/dist/client/index.html +2 -2
  130. package/dist/server/cli.js +33 -33
  131. package/dist/server/server.js +49 -49
  132. package/package.json +1 -1
  133. package/dist/client/assets/Clock-ljBuaWDA.js +0 -1
  134. package/dist/client/assets/button-Co_HOc3E.js +0 -1
  135. package/dist/client/assets/connection-detail-BsC5t8hY.js +0 -1
  136. package/dist/client/assets/connections-B3RW87mz.js +0 -1
  137. package/dist/client/assets/constants-B5NZDm4s.js +0 -1
  138. package/dist/client/assets/dynamic-plugin-layout-IH0Gl52A.js +0 -1
  139. package/dist/client/assets/gateway-detail-CzuSbsFr.js +0 -1
  140. package/dist/client/assets/index-BUdiVz6f.js +0 -1
  141. package/dist/client/assets/index-Bc30BcYv.js +0 -88
  142. package/dist/client/assets/index-JAPwCHXJ.css +0 -1
  143. package/dist/client/assets/layout-tF7tb_Qc.js +0 -1
  144. package/dist/client/assets/page-DcQoSvJk.js +0 -35
  145. package/dist/client/assets/page-DxMYdFSw.js +0 -1
  146. package/dist/client/assets/plugins-CyUBsABC.js +0 -1
  147. package/dist/client/assets/select-CVEPeRAQ.js +0 -1
  148. package/dist/client/assets/settings-BfbdOKrl.js +0 -1
  149. package/dist/client/assets/shell-layout-DJjajsTY.js +0 -3
  150. package/dist/client/assets/use-binding-C8KxuIY6.js +0 -23
  151. package/dist/client/assets/use-connection-resources-YXIBGXnm.js +0 -1
  152. package/dist/client/assets/use-model-state-B8hL-q1r.js +0 -20
  153. package/dist/client/assets/useInfiniteQuery-Dbq7IS1q.js +0 -1
  154. package/dist/client/assets/useQuery-Bn2Wcch_.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.15.1",
3
+ "version": "2.17.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{r}from"./index-ZiFjEqyT.js";const i=({size:e=24,color:t="currentColor",...o})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},r.createElement("path",{d:"M12 6v6l4 2m6-2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));i.displayName="Clock";export{i as s};
@@ -1 +0,0 @@
1
- import{aN as g,aa as u,c as l,h as v,j as b,i as p}from"./index-ZiFjEqyT.js";function h(...n){return g(u(n))}const x=v("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-7 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function k(n){const e=l.c(14);let t,r,s,o,i;e[0]!==n?({className:t,variant:i,size:s,asChild:o,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s,e[4]=o,e[5]=i):(t=e[1],r=e[2],s=e[3],o=e[4],i=e[5]);const c=(o===void 0?!1:o)?p:"button";let a;e[6]!==t||e[7]!==s||e[8]!==i?(a=h(x({variant:i,size:s,className:t})),e[6]=t,e[7]=s,e[8]=i,e[9]=a):a=e[9];let d;return e[10]!==c||e[11]!==r||e[12]!==a?(d=b.jsx(c,{"data-slot":"button",className:a,...r}),e[10]=c,e[11]=r,e[12]=a,e[13]=d):d=e[13],d}export{k as B,x as b,h as c};
@@ -1 +0,0 @@
1
- import{c as q,j as o,f as W,k as J,r as z,d as ce,b as le,as as ae}from"./index-ZiFjEqyT.js";import{E as F,I as Q}from"./empty-state-B1DU5702.js";import{E as X}from"./error-boundary-BOBkDZ1Y.js";import{b as G,a as me}from"./use-connection-BskZam-G.js";import{a as de}from"./use-binding-C8KxuIY6.js";import{u as ue,S as pe}from"./index-ChF3uWl9.js";import{u as fe,a as he}from"./use-connection-resources-YXIBGXnm.js";import{B as xe}from"./button-Co_HOc3E.js";import{i as Y}from"./Loading01-Bq_7Os6T.js";import{R as ge}from"./resource-tabs-CC5dHHUl.js";import{V as Z,a as be,b as je}from"./layout-tF7tb_Qc.js";import{C as ye}from"./collection-tab-DVmiR956.js";import{C as ee}from"./collection-display-button-C_GfVLwh.js";import{C as te}from"./collection-search-D67e9ppe.js";import{C as oe}from"./collection-table-wrapper-DDHrDWif.js";import{P as se}from"./pin-to-sidebar-button-BahvsjHH.js";import{C as ne}from"./card-Rz2C5-Lx.js";import{R as Se,T as Ce}from"./tools-list-C8nSsOKD.js";import"./connection-CmMMEDBY.js";import"./project-context-provider-BPo-49FO.js";import"./use-collections-g067BPxP.js";import"./useMutation-4fnzP4bc.js";import"./binder-BtPpbY4I.js";import"./mcp-oauth-D8a9d38x.js";import"./env-vars-editor-BjH5KdVc.js";import"./input-DEsmZ6es.js";import"./Plus-C4F6mby2.js";import"./Trash01-GrzirNvV.js";import"./use-tool-call-BbfSyOCz.js";import"./useQuery-Bn2Wcch_.js";import"./File06-Dir7h2_j.js";import"./Key01-BcxLAym0.js";import"./badge-BPKvq16e.js";import"./form-ChO7tWCF.js";import"./select-CVEPeRAQ.js";import"./tooltip-BJO9sFhZ.js";import"./Check-D4dBNJmC.js";import"./ChevronDown-CJaS1NVA.js";import"./extract-connection-data-CNcw3HV2.js";import"./constants-B5NZDm4s.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DzI73csj.js";import"./generate-id-Dyweu44Y.js";import"./Terminal-BWurH474.js";import"./use-gateway-v7etejE8.js";import"./Grid01-BgBQwtBY.js";import"./index-CH2G6_zW.js";import"./index-BUdiVz6f.js";import"./index-Bc30BcYv.js";import"./popover-DW05feED.js";import"./SearchMd-B_A85eif.js";import"./use-create-gateway-CCmt4GT8.js";import"./AlertCircle-DlBo4Xw9.js";import"./X-D09jV0HO.js";import"./ArrowUp-KvHCnFh3.js";import"./textarea-DFRypKCQ.js";import"./localstorage-keys-DhdYpXZj.js";import"./Copy01-Rf_P7R5F.js";import"./monaco-editor-BYgR7J38.js";import"./spinner-DqooIng7.js";import"./alert-dialog-Df8ZsItX.js";import"./Image01-B8cj-qoF.js";import"./ArrowLeft-CCqPW2JN.js";import"./dropdown-menu-dsr_wyw0.js";import"./DotsVertical-f9rnazjX.js";import"./Edit01-MWKLkbpZ.js";import"./use-list-state-C5pgFF_z.js";import"./use-mobile-Co7MtEW-.js";import"./empty-state-By_kA__m.js";import"./Inbox01-Bh5pMKE1.js";import"./avatar-CrVRRbJ7.js";import"./List-hTdqyLGB.js";import"./view-mode-toggle-tlrhMsiy.js";import"./use-organization-settings-K7SU43aD.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,k]=z.useState("name"),[d,_]=z.useState("asc");let b;e[0]!==d||e[1]!==h?(b=x=>{h===x?(_(Ie),d==="desc"&&k(void 0)):(k(x),_("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(Q,{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 ke(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 _e(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 k;e[0]!==a||e[1]!==i?(k=c=>{i===c?(h(De),a==="desc"&&w(void 0)):(w(c),h("asc"))},e[0]=a,e[1]=i,e[2]=k):k=e[2];const d=k;let _;e[3]!==l?(_=c=>{l&&l(c)},e[3]=l,e[4]=_):_=e[4];const b=_;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(Q,{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(_e,{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,k=N.length,d=V.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=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]!==k?(T=i&&k>0?[{id:"prompts",label:"Prompts",count:k}]:[],e[7]=i,e[8]=k,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=[_,...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(ke,{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(X,{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 k;t[13]!==V.update||t[14]!==s?(k=async b=>{await V.update.mutateAsync({id:s,data:b})},t[13]=V.update,t[14]=s,t[15]=k):k=t[15];const d=k;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 _;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?(_=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]=_):_=t[28],_}function qe(){const t=q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(X,{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 uo(){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{uo as default};
@@ -1 +0,0 @@
1
- import{c as ge,j as e,r as M,f as xe,b as je,a as fe,u as ye,E as ve,B as _e,y as se,Z as Ce,z as y,a3 as ke}from"./index-ZiFjEqyT.js";import{C as Ne}from"./collection-header-Dl8Ii13M.js";import{C as Se}from"./collection-page-C75JriCh.js";import{C as Te}from"./collection-search-D67e9ppe.js";import{C as we}from"./collection-table-wrapper-DDHrDWif.js";import{C as De}from"./connection-card-BuCHeT4K.js";import{n as O,E as B,I as be}from"./empty-state-B1DU5702.js";import{E as Pe}from"./error-boundary-BOBkDZ1Y.js";import{a as Ie,u as Ve}from"./use-connection-BskZam-G.js";import{u as Ee}from"./use-binding-C8KxuIY6.js";import{u as $e,s as Q}from"./use-list-state-C5pgFF_z.js";import{u as Ae}from"./project-context-provider-BPo-49FO.js";import{f as Fe,a as He,b as Oe,c as Be,d as ze,e as Me,A as Re,g as Ue}from"./alert-dialog-Df8ZsItX.js";import{B as Xe}from"./badge-BPKvq16e.js";import{B as _}from"./button-Co_HOc3E.js";import{d as Le,c as We,a as Ke,D as Ge,g as qe,f as Ye}from"./dialog-bW33A1d_.js";import{b as Z,D as J,a as ee,c as E}from"./dropdown-menu-dsr_wyw0.js";import{a as Qe,F as h,b as g,c as x,d as j,f}from"./form-ChO7tWCF.js";import{i as te}from"./DotsVertical-f9rnazjX.js";import{f as Ze,e as Je,s as z}from"./registry-utils-DzI73csj.js";import{i as et}from"./Loading01-Bq_7Os6T.js";import{i as tt}from"./Terminal-BWurH474.js";import{s as ne}from"./Trash01-GrzirNvV.js";import{I as k}from"./input-DEsmZ6es.js";import{S as nt,a as ot,b as st,c as rt,d as P}from"./select-CVEPeRAQ.js";import{T as it}from"./textarea-DFRypKCQ.js";import{g as at}from"./generate-id-Dyweu44Y.js";import{a as ct}from"./use-tool-call-BbfSyOCz.js";import{c as lt}from"./connection-CmMMEDBY.js";import{i as dt,r as mt,E as ut,e as re}from"./env-vars-editor-BjH5KdVc.js";import"./collection-display-button-C_GfVLwh.js";import"./ArrowUp-KvHCnFh3.js";import"./Check-D4dBNJmC.js";import"./Grid01-BgBQwtBY.js";import"./List-hTdqyLGB.js";import"./tooltip-BJO9sFhZ.js";import"./view-mode-toggle-tlrhMsiy.js";import"./SearchMd-B_A85eif.js";import"./card-Rz2C5-Lx.js";import"./use-collections-g067BPxP.js";import"./useMutation-4fnzP4bc.js";import"./binder-BtPpbY4I.js";import"./use-mobile-Co7MtEW-.js";import"./X-D09jV0HO.js";import"./ChevronDown-CJaS1NVA.js";import"./useQuery-Bn2Wcch_.js";import"./Plus-C4F6mby2.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function A(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const u=s.slice(1).find(a=>!a.startsWith("-"));return u?{packageName:u}:null}function $(n){const{uiType:s}=n,i=A(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===A("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=A(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",u=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:u}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const u={command:n};s.trim()&&(u.args=s.trim().split(/\s+/)),i?.trim()&&(u.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(u.envVars=a),u}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=Ae(),s=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:u}=ye(),a=$e({namespace:n.slug,resource:"connections"}),I=Ie(),N=Ve(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=Ze(R?.tools),ie=lt(F||void 0),{data:ae}=ct({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=Je(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),D=$({uiType:m,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:m,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=mt(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.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:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},me=async t=>{let o,c=null,T=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",T=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...T&&{connection_token:T},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const w=at("conn");await I.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:T,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,T=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!T&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(b=>b.key)),Y=p.envVarKeys.filter(b=>!he.has(b));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},H=gt(o);if(H&&u){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w($({uiType:"NPX",npxPackage:H.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),w($({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}m==="NPX"&&w($({uiType:"NPX",npxPackage:o}))},ue=[{id:"icon",header:"",render:t=>e.jsx(be,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;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:t=>e.jsx(Xe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(Z,{children:[e.jsx(J,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Le,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(We,{className:"sm:max-w-[525px]",children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:l?"Edit Connection":"Create Connection"}),e.jsx(qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Qe,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(nt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(ot,{children:e.jsx(st,{})})}),e.jsxs(rt,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),u&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),m==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),m==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(m==="NPX"||m==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(ut,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),m!=="NPX"&&m!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(it,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Ye,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Fe,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(He,{children:[e.jsxs(Oe,{children:[e.jsx(Be,{children:"Delete Connection?"}),e.jsxs(ze,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Me,{children:[e.jsx(Re,{children:"Cancel"}),e.jsx(Ue,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(Te,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(De,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(Z,{children:[e.jsx(J,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(we,{columns:ue,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function jn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Pe,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(et,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{jn as default};
@@ -1 +0,0 @@
1
- import{L as t,bm as a}from"./index-ZiFjEqyT.js";const e="mcp.mesh",s=t(a,{target:"draft-7"});export{s as B,e as M};
@@ -1 +0,0 @@
1
- import{c as I,d as P,a as O,j as n,bE as N,r as b,w as H,a6 as R}from"./index-ZiFjEqyT.js";import{i as _}from"./Loading01-Bq_7Os6T.js";import{a as T}from"./binder-BtPpbY4I.js";import{u as A}from"./use-connection-BskZam-G.js";import{L as $,u as D}from"./localstorage-keys-DhdYpXZj.js";import{u as G}from"./project-context-provider-BPo-49FO.js";import{c as K}from"./connection-CmMMEDBY.js";import"./use-collections-g067BPxP.js";import"./useMutation-4fnzP4bc.js";import"./useQuery-Bn2Wcch_.js";function Y(e,t){return e?e.filter(d=>T(d,t)):[]}function L(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function q(e){const t=I.c(13),{binding:d,renderHeader:m,renderEmptyState:s}=e,{org:l}=G();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{pluginId:a}=P(r),i=A(),{data:o}=O.useSession(),p=Y(i,d);let x;t[1]!==l.slug||t[2]!==a?(x=$.pluginConnection(l.slug,a),t[1]=l.slug,t[2]=a,t[3]=x):x=t[3];const[y,w]=D(x,F);let g;t[4]!==y?(g=f=>f.id===y,t[4]=y,t[5]=g):g=t[5];const u=p.find(g)??p[0]??null,v=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,E={id:l.id,slug:l.slug,name:l.name};if(p.length===0||!u){const f={connectionId:null,connection:null,toolCaller:null,org:E,session:v};let c;t[6]!==s?(c=s(),t[6]=s,t[7]=c):c=t[7];let C;return t[8]!==c?(C=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),t[8]=c,t[9]=C):C=t[9],n.jsx(N,{value:f,children:C})}const k=K(u.id),z={connectionId:u.id,connection:L(u),toolCaller:((f,c)=>k(f,c)),org:E,session:v},B="h-full flex flex-col overflow-hidden",S=m({connections:p.map(L),selectedConnectionId:u.id,onConnectionChange:w});let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(b.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(H,{})})}),t[10]=h):h=t[10];let j;return t[11]!==S?(j=n.jsxs("div",{className:B,children:[S,h]}),t[11]=S,t[12]=j):j=t[12],n.jsx(N,{value:z,children:j})}function F(e){return e??""}function se(){const e=I.c(12);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{pluginId:d}=P(t);let m;e[1]!==d?(m=R.find(i=>i.id===d),e[1]=d,e[2]=m):m=e[2];const s=m;if(s?.renderHeader&&s?.renderEmptyState){let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=i):i=e[3];let o;return e[4]!==s.binding||e[5]!==s.renderEmptyState||e[6]!==s.renderHeader?(o=n.jsx(b.Suspense,{fallback:i,children:n.jsx(q,{binding:s.binding,renderHeader:s.renderHeader,renderEmptyState:s.renderEmptyState})}),e[4]=s.binding,e[5]=s.renderEmptyState,e[6]=s.renderHeader,e[7]=o):o=e[7],o}const l=s?.LayoutComponent;if(!l){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(H,{}),e[8]=i):i=e[8],i}let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=r):r=e[9];let a;return e[10]!==l?(a=n.jsx(b.Suspense,{fallback:r,children:n.jsx(l,{})}),e[10]=l,e[11]=a):a=e[11],a}export{se as default};
@@ -1 +0,0 @@
1
- import{r as S,a3 as ye,y as re,Z as U,z as _,c as R,j as t,f as Fe,d as tt,b as st,k as ot,as as lt,B as nt,E as it,t as Ae}from"./index-ZiFjEqyT.js";import{I as Ee,E as rt}from"./empty-state-B1DU5702.js";import{E as Ve}from"./error-boundary-BOBkDZ1Y.js";import{C as Ge}from"./checkbox-DGIT6WZ3.js";import{c as H,B as V}from"./button-Co_HOc3E.js";import{i as at}from"./ArrowLeft-CCqPW2JN.js";import{u as We}from"./use-connection-BskZam-G.js";import{C as ct}from"./collection-search-D67e9ppe.js";import{I as Pe}from"./input-DEsmZ6es.js";import{s as dt}from"./Plus-C4F6mby2.js";import{i as mt}from"./X-D09jV0HO.js";import{P as ut}from"./pin-to-sidebar-button-BahvsjHH.js";import{T as ft}from"./tool-set-selector-DRx4AOzy.js";import{b as ht,a as xt,i as pt}from"./use-gateway-v7etejE8.js";import{u as gt,a as bt}from"./use-connection-resources-YXIBGXnm.js";import{u as jt}from"./use-gateway-system-prompt-DoCpWoeh.js";import{s as He}from"./slugify-CEUa2lfQ.js";import{B as Ze}from"./badge-BPKvq16e.js";import{a as yt,D as vt,c as St,d as Nt}from"./dialog-bW33A1d_.js";import{F as be,a as _t,b as ve,d as Se,f as Ne,c as wt}from"./form-ChO7tWCF.js";import{I as Ct,R as kt,a as It}from"./index-CH2G6_zW.js";import{R as Tt}from"./resource-tabs-CC5dHHUl.js";import{S as $t,a as Rt,b as zt,c as At,d as Ue}from"./select-CVEPeRAQ.js";import{S as Et}from"./switch-dZML6kqo.js";import{T as Pt}from"./textarea-DFRypKCQ.js";import{a as q,c as Y,b as J,T as Q}from"./tooltip-BJO9sFhZ.js";import{i as qe}from"./Check-D4dBNJmC.js";import{i as Mt}from"./Code01-CMazpegY.js";import{a as Dt}from"./Copy01-Rf_P7R5F.js";import{i as Ut}from"./FlipBackward-B1KVh_65.js";import{i as je}from"./InfoCircle-CVdyaBb8.js";import{i as ze}from"./Loading01-Bq_7Os6T.js";import{a as Lt,V as Ot,b as Bt}from"./layout-tF7tb_Qc.js";import"./connection-CmMMEDBY.js";import"./project-context-provider-BPo-49FO.js";import"./use-collections-g067BPxP.js";import"./useMutation-4fnzP4bc.js";import"./SearchMd-B_A85eif.js";import"./use-organization-settings-K7SU43aD.js";import"./localstorage-keys-DhdYpXZj.js";import"./useQuery-Bn2Wcch_.js";import"./ChevronDown-CJaS1NVA.js";const Ye=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Ye.displayName="ArrowsRight";const Je=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Je.displayName="Circle";const Qe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));Qe.displayName="Lightbulb02";const Ke=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.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"}));Ke.displayName="Save01";const Xe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));Xe.displayName="Share07";const Me=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ft=re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:U(_()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:U(_()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Vt=re({id:_().describe("Unique identifier for the gateway"),title:_().describe("Human-readable name for the gateway"),description:_().nullable().describe("Description of the gateway"),icon:_().nullable().optional().describe("Icon URL for the gateway"),created_at:_().describe("When the gateway was created"),updated_at:_().describe("When the gateway was last updated"),created_by:_().describe("User ID who created the gateway"),updated_by:_().optional().describe("User ID who last updated the gateway"),organization_id:_().describe("Organization ID this gateway belongs to"),tool_selection_mode:Me.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),connections:U(Ft).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});re({title:_().min(1).max(255).describe("Name for the gateway"),description:_().nullable().optional().describe("Optional description"),tool_selection_mode:Me.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:_().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});re({title:_().min(1).max(255).optional().describe("New name"),description:_().nullable().optional().describe("New description (null to clear)"),tool_selection_mode:Me.optional().describe("New tool selection mode"),icon:_().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Gt=S.memo(function(e){const s=R.c(20),{connection:l,isSelected:i,hasItemsEnabled:n,activeItemsCount:a,totalItemsCount:c,onSelect:m,onToggle:r}=e,d=i?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==d?(u=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=u):u=s[1];let f;s[2]!==l.icon||s[3]!==l.title?(f=t.jsx(Ee,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=f):f=s[4];let p;s[5]!==l.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=p):p=s[6];let x;s[7]!==m||s[8]!==f||s[9]!==p?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[f,p]}),s[7]=m,s[8]=f,s[9]=p,s[10]=x):x=s[10];let g;s[11]!==a||s[12]!==n||s[13]!==r||s[14]!==c?(g=c>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[a,"/",c]}),t.jsx(Ge,{checked:n,onCheckedChange:r,onClick:Ht})]}),s[11]=a,s[12]=n,s[13]=r,s[14]=c,s[15]=g):g=s[15];let y;return s[16]!==u||s[17]!==x||s[18]!==g?(y=t.jsxs("div",{className:u,children:[x,g]}),s[16]=u,s[17]=x,s[18]=g,s[19]=y):y=s[19],y}),Wt=S.memo(function(e){const s=R.c(18),{connectionId:l,item:i,isSelected:n,onToggle:a}=e,c=`item-${l}-${i.id}`,m=n?"text-foreground":"text-muted-foreground";let r;s[0]!==m?(r=H("text-sm font-medium",m),s[0]=m,s[1]=r):r=s[1];let d;s[2]!==i.name||s[3]!==r?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:i.name})}),s[2]=i.name,s[3]=r,s[4]=d):d=s[4];let u;s[5]!==i.description?(u=i.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.description}),s[5]=i.description,s[6]=u):u=s[6];let f;s[7]!==d||s[8]!==u?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),s[7]=d,s[8]=u,s[9]=f):f=s[9];const p=`item-${l}-${i.id}`;let x;s[10]!==n||s[11]!==a||s[12]!==p?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ge,{id:p,checked:n,onCheckedChange:a,onClick:Zt})}),s[10]=n,s[11]=a,s[12]=p,s[13]=x):x=s[13];let g;return s[14]!==c||s[15]!==f||s[16]!==x?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[f,x]}),s[14]=c,s[15]=f,s[16]=x,s[17]=g):g=s[17],g});function et({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:i,extraContent:n}){const[a,c]=S.useState(""),m=S.useDeferredValue(a),[r,d]=S.useState("all"),[u,f]=S.useState(!1),p=S.useRef(new Set(Object.keys(o))),x=We({searchTerm:m.trim()||void 0}),g=p.current,y=[...g.values()].map(h=>x.find(N=>N.id===h)).filter(h=>h!==void 0),j=x.filter(h=>!g.has(h.id)),v=[...y,...j],b=h=>{const N=o[h];return N!==void 0&&N.length>0},w=v.filter(h=>{if(r==="all")return!0;const N=b(h.id);return r==="selected"?N:r==="unselected"?!N:!0}),[I,k]=S.useState(v[0]?.id??null),C=I?v.find(h=>h.id===I)??null:null,P=C?s(C):[],E=(h,N)=>o[h]?.includes(N)??!1,L=(h,N)=>{const z=o[h]??[],$=z.includes(N),G={...o};if($){const W=z.filter(Z=>Z!==N);W.length===0?delete G[h]:G[h]=W}else G[h]=[...z,N];e(G)},B=h=>{const N=v.find(F=>F.id===h);if(!N)return;const z=s(N);if(z.length===0)return;const $=o[h]??[],G=z.map(F=>F.id),W=$.length>0&&G.every(F=>$.includes(F)),Z={...o};W?delete Z[h]:(Z[h]=G,k(h)),e(Z)},A=h=>{k(h),f(!0)},M=()=>{f(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(ct,{value:a,onChange:c,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:a?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:w.map(h=>{const z=s(h).length,$=o[h.id]?.length??0;return t.jsx(Gt,{connection:h,isSelected:I===h.id,hasItemsEnabled:b(h.id),activeItemsCount:$,totalItemsCount:z,onSelect:()=>A(h.id),onToggle:()=>B(h.id)},h.id)})})})]}),t.jsx("div",{className:H("flex-1 flex-col",u?"flex":"hidden md:flex"),children:C?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(V,{variant:"ghost",size:"sm",onClick:M,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(at,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Ee,{icon:C.icon,name:C.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:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),n,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:P.map(h=>t.jsx(Wt,{connectionId:C.id,item:h,isSelected:E(C.id,h.id),onToggle:()=>L(C.id,h.id)},h.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 ",l]})})})]})}function Ht(o){return o.stopPropagation()}function Zt(o){return o.stopPropagation()}function qt(o){const e=R.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:i}=o;let n;e[0]!==i?(n=m=>(i.get(m.id)??[]).map(Yt),e[0]=i,e[1]=n):n=e[1];const a=n;let c;return e[2]!==a||e[3]!==l||e[4]!==s?(c=t.jsx(et,{itemSet:s,onItemSetChange:l,getItems:a,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=a,e[3]=l,e[4]=s,e[5]=c):c=e[5],c}function Yt(o){return{id:o.name,name:o.name,description:o.description}}function Jt(o){return o.includes("*")}function Qt(o){const e=R.c(27),{patterns:s,onAddPattern:l,onRemovePattern:i}=o,[n,a]=S.useState("");let c;e[0]!==n||e[1]!==l||e[2]!==s?(c=()=>{const f=n.trim();f&&!s.includes(f)&&(l(f),a(""))},e[0]=n,e[1]=l,e[2]=s,e[3]=c):c=e[3];const m=c;let r;e[4]!==m?(r=f=>{f.key==="Enter"&&(f.preventDefault(),m())},e[4]=m,e[5]=r):r=e[5];const d=r;let u;if(e[6]!==m||e[7]!==d||e[8]!==n||e[9]!==i||e[10]!==s){const f=s.filter(Jt);let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("code",{children:"*"}),e[12]=p):p=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",p," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=k=>a(k.target.value),e[14]=g):g=e[14];let y;e[15]!==d||e[16]!==n?(y=t.jsx(Pe,{value:n,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=n,e[17]=y):y=e[17];let j;e[18]!==n?(j=n.trim(),e[18]=n,e[19]=j):j=e[19];const v=!j;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(dt,{size:16}),e[20]=b):b=e[20];let w;e[21]!==m||e[22]!==v?(w=t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=w):w=e[23];let I;e[24]!==w||e[25]!==y?(I=t.jsxs("div",{className:"flex gap-2",children:[y,w]}),e[24]=w,e[25]=y,e[26]=I):I=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,I,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(k=>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:k}),t.jsx("button",{type:"button",onClick:()=>i(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(mt,{size:12})})]},k))})]}),e[6]=m,e[7]=d,e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];return u}function Kt(o){const e=R.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:i}=o,[n]=S.useState(null);let a;e[0]!==i?(a=b=>(i.get(b.id)??[]).map(Xt),e[0]=i,e[1]=a):a=e[1];const c=a;let m;e[2]!==l||e[3]!==s?(m=(b,w)=>{const I=s[b]??[];I.includes(w)||l({...s,[b]:[...I,w]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const r=m;let d;e[5]!==l||e[6]!==s?(d=(b,w)=>{const k=(s[b]??[]).filter(C=>C!==w);if(k.length===0){const C={...s};delete C[b],l(C)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=d):d=e[7];const u=d;let f;e[8]!==l?(f=b=>{l(b)},e[8]=l,e[9]=f):f=e[9];const p=f;let x;e[10]!==s||e[11]!==n?(x=n?s[n]??[]:[],e[10]=s,e[11]=n,e[12]=x):x=e[12];const g=x;let y;e[13]!==r||e[14]!==u||e[15]!==n||e[16]!==g?(y=n?t.jsx(Qt,{patterns:g,onAddPattern:b=>r(n,b),onRemovePattern:b=>u(n,b)}):null,e[13]=r,e[14]=u,e[15]=n,e[16]=g,e[17]=y):y=e[17];const j=y;let v;return e[18]!==j||e[19]!==c||e[20]!==p||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(et,{itemSet:s,onItemSetChange:p,getItems:c,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:j})}),e[18]=j,e[19]=c,e[20]=p,e[21]=s,e[22]=v):v=e[22],v}function Xt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function es(o){const e=R.c(8);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("grid gap-3",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==l||e[6]!==i?(n=t.jsx(kt,{"data-slot":"radio-group",className:i,...l}),e[5]=l,e[6]=i,e[7]=n):n=e[7],n}function Re(o){const e=R.c(9);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=i):i=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(It,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Je,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=n):n=e[5];let a;return e[6]!==l||e[7]!==i?(a=t.jsx(Ct,{"data-slot":"radio-group-item",className:i,...l,children:n}),e[6]=l,e[7]=i,e[8]=a):a=e[8],a}function ts(o){const s=new TextEncoder().encode(o),l=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(l)}const ss=Vt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0}).extend({title:_().min(1,"Name is required").max(255)});function Le(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const i=e.get(l.connection_id)??[];i.length>0&&(s[l.connection_id]=i)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Oe(o){const e={};for(const s of o.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 Be(o){const e={};for(const s of o.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 os(o,e,s,l){const i=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(i).map(n=>{const a=o[n]??[],c=l.get(n)??[],m=c.length>0&&c.every(r=>a.includes(r));return{connection_id:n,selected_tools:a.length===0||m?null:a,selected_resources:e[n]??null,selected_prompts:s[n]??null}})}function ls(o){const e=R.c(10),{gatewayUrl:s}=o,[l,i]=S.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),i(!0),Ae.success("Agent URL copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const a=n;let c;e[2]!==l?(c=l?t.jsx(qe,{size:20,className:"text-green-600"}):t.jsx(Dt,{size:20}),e[2]=l,e[3]=c):c=e[3];const m=l?"Copied!":"Copy URL";let r;e[4]!==m?(r=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==c||e[8]!==r?(d=t.jsxs(V,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,r]}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9],d}function ns(o){const e=R.c(7),{gatewayUrl:s,serverName:l}=o;let i;e[0]!==s||e[1]!==l?(i=()=>{const r=He(l),u=ts(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(r)}&config=${encodeURIComponent(u)}`;window.open(f,"_blank"),Ae.success("Opening Cursor...")},e[0]=s,e[1]=l,e[2]=i):i=e[2];const n=i;let a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),c=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=a,e[4]=c):(a=e[3],c=e[4]);let m;return e[5]!==n?(m=t.jsxs(V,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[5]=n,e[6]=m):m=e[6],m}function is(o){const e=R.c(11),{gatewayUrl:s,serverName:l}=o,[i,n]=S.useState(!1);let a;e[0]!==s||e[1]!==l?(a=async()=>{const f=He(l),x=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${f}" --config '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),n(!0),Ae.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a;let m;e[3]!==i?(m=i?t.jsx(qe,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=i,e[4]=m):m=e[4];const r=i?"Copied!":"Install on Claude";let d;e[5]!==r?(d=t.jsx("span",{className:"text-xs font-medium",children:r}),e[5]=r,e[6]=d):d=e[6];let u;return e[7]!==c||e[8]!==m||e[9]!==d?(u=t.jsxs(V,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=c,e[8]=m,e[9]=d,e[10]=u):u=e[10],u}function rs(o){const e=R.c(40),{open:s,onOpenChange:l,gateway:i}=o,[n,a]=S.useState("code_execution");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=$=>{($==="passthrough"||$==="smart_tool_selection"||$==="code_execution")&&a($)},e[0]=c):c=e[0];const m=c;let r;e[1]!==i.id||e[2]!==n?(r=new URL(`/mcp/gateway/${i.id}`,window.location.origin),r.searchParams.set("mode",n),e[1]=i.id,e[2]=n,e[3]=r):r=e[3];let d;e[4]!==i.id||e[5]!==i.title?(d=i.title||`agent-${i.id.slice(0,8)}`,e[4]=i.id,e[5]=i.title,e[6]=d):d=e[6];const u=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(yt,{children:t.jsx(vt,{children:"Share Agent"})}),e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=p):p=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ye,{className:"size-5 text-muted-foreground"})}),e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[11]=y):y=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[x,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(q,{children:t.jsxs(Y,{children:[y,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Re,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Qe,{className:"size-5 text-muted-foreground"})}),e[13]=v):v=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=b):b=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[15]=w):w=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[v,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[b,t.jsx(q,{children:t.jsxs(Y,{children:[w,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Re,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=I):I=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Mt,{className:"size-5 text-muted-foreground"})}),e[17]=k):k=e[17];let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=C):C=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[19]=P):P=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[k,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[C,t.jsx(q,{children:t.jsxs(Y,{children:[P,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Re,{id:"mode-code",value:"code_execution"}),t.jsx(Ze,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=E):E=e[20];let L;e[21]!==n?(L=t.jsxs("div",{className:"flex flex-col gap-3",children:[p,t.jsxs(es,{value:n,onValueChange:m,className:"flex flex-col gap-4.5",children:[j,I,E]})]}),e[21]=n,e[22]=L):L=e[22];let B;e[23]!==r.href?(B=t.jsx(ls,{gatewayUrl:r.href}),e[23]=r.href,e[24]=B):B=e[24];let A,M;e[25]!==r.href||e[26]!==u?(A=t.jsx(ns,{gatewayUrl:r.href,serverName:u}),M=t.jsx(is,{gatewayUrl:r.href,serverName:u}),e[25]=r.href,e[26]=u,e[27]=A,e[28]=M):(A=e[27],M=e[28]);let h;e[29]!==B||e[30]!==A||e[31]!==M?(h=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[B,A,M]})}),e[29]=B,e[30]=A,e[31]=M,e[32]=h):h=e[32];let N;e[33]!==L||e[34]!==h?(N=t.jsxs(St,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[L,h]})]}),e[33]=L,e[34]=h,e[35]=N):N=e[35];let z;return e[36]!==l||e[37]!==s||e[38]!==N?(z=t.jsx(Nt,{open:s,onOpenChange:l,children:N}),e[36]=l,e[37]=s,e[38]=N,e[39]=z):z=e[39],z}function as(o){const e=R.c(31),{form:s,icon:l,gatewayId:i}=o,[n,a]=jt(i);let c;e[0]!==s?(c=s.watch("title")||"Agent",e[0]=s,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(pt,{}),e[2]=m):m=e[2];let r;e[3]!==l||e[4]!==c?(r=t.jsx(Ee,{icon:l,name:c,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=c,e[5]=r):r=e[5];let d;e[6]!==s.control?(d=t.jsx(be,{control:s.control,name:"status",render:us}),e[6]=s.control,e[7]=d):d=e[7];let u;e[8]!==r||e[9]!==d?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[r,d]}),e[8]=r,e[9]=d,e[10]=u):u=e[10];let f;e[11]!==s.control?(f=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:ms}),t.jsx(be,{control:s.control,name:"description",render:ds})]}),e[11]=s.control,e[12]=f):f=e[12];let p;e[13]!==u||e[14]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15];let x;e[16]!==s.control?(x=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(be,{control:s.control,name:"tool_selection_mode",render:cs})}),e[16]=s.control,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=g):g=e[18];let y;e[19]!==a?(y=w=>a(w.target.value),e[19]=a,e[20]=y):y=e[20];let j;e[21]!==n||e[22]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[g,t.jsx(Pt,{value:n,onChange:y,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=n,e[22]=y,e[23]=j):j=e[23];let v;e[24]!==j||e[25]!==p||e[26]!==x?(v=t.jsxs("div",{className:"flex flex-col",children:[p,x,j]}),e[24]=j,e[25]=p,e[26]=x,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(_t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function cs(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(wt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(q,{children:t.jsxs(Y,{children:[t.jsx(J,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(je,{size:14,className:"text-muted-foreground"})})}),t.jsx(Q,{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($t,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Se,{children:t.jsx(Rt,{className:"w-[180px]",children:t.jsx(zt,{})})}),t.jsxs(At,{children:[t.jsx(Ue,{value:"inclusion",children:"Include Selected"}),t.jsx(Ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Ne,{})]})}function ds(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...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(Ne,{})]})}function ms(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...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:"Agent Name"})}),t.jsx(Ne,{})]})}function us(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ze,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Se,{children:t.jsx(Et,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ne,{})]})}function fs(o){const e=R.c(81),{gateway:s,gatewayId:l,requestedTabId:i}=o,a=ot().location.href,c=lt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const r=Fe(m),d=xt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const f=We(u);let p;e[2]!==f?(p=f.map(xs),e[2]=f,e[3]=p):p=e[3];const x=p,{promptsMap:g}=gt(x),{resourcesMap:y}=bt(x);let j;if(e[4]!==f){j=new Map;for(const T of f)T.tools&&T.tools.length>0&&j.set(T.id,T.tools.map(hs));e[4]=f,e[5]=j}else j=e[5];let v;e[6]!==j||e[7]!==s?(v=()=>Le(s,j),e[6]=j,e[7]=s,e[8]=v):v=e[8];const[b,w]=S.useState(v);let I;e[9]!==s?(I=()=>Oe(s),e[9]=s,e[10]=I):I=e[10];const[k,C]=S.useState(I);let P;e[11]!==s?(P=()=>Be(s),e[11]=s,e[12]=P):P=e[12];const[E,L]=S.useState(P),[B,A]=S.useState(!1),[M,h]=S.useState(!1);let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=T=>{w(T),A(!0)},e[13]=N):N=e[13];const z=N;let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=T=>{C(T),A(!0)},e[14]=$):$=e[14];const G=$;let W;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=T=>{L(T),A(!0)},e[15]=W):W=e[15];const Z=W;let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=nt(ss),e[16]=F):F=e[16];const _e=s.tool_selection_mode??"inclusion";let ce;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==_e?(ce={resolver:F,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:_e}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=_e,e[21]=ce):ce=e[21];const O=it(ce),we=O.formState.isDirty||B;let de;e[22]!==d.update||e[23]!==j||e[24]!==O||e[25]!==l||e[26]!==E||e[27]!==k||e[28]!==b?(de=async()=>{const T=O.getValues(),$e=os(b,k,E,j);await d.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,connections:$e}}),O.reset(T),A(!1)},e[22]=d.update,e[23]=j,e[24]=O,e[25]=l,e[26]=E,e[27]=k,e[28]=b,e[29]=de):de=e[29];const Ce=de;let me;e[30]!==j||e[31]!==O||e[32]!==s?(me=()=>{O.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion"}),w(Le(s,j)),C(Oe(s)),L(Be(s)),A(!1)},e[30]=j,e[31]=O,e[32]=s,e[33]=me):me=e[33];const ke=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[34]=ue):ue=e[34];const De=ue,D=De.some(T=>T.id===i)?i:"settings";let fe;e[35]!==r?(fe=T=>{r({search:$e=>({...$e,tab:T}),replace:!0})},e[35]=r,e[36]=fe):fe=e[36];const Ie=fe,ae=d.update.isPending;let K;e[37]!==c.history?(K=()=>c.history.back(),e[37]=c.history,e[38]=K):K=e[38];let X;e[39]!==D||e[40]!==Ie?(X=t.jsx(Lt,{children:t.jsx(Tt,{tabs:De,activeTab:D,onTabChange:Ie})}),e[39]=D,e[40]=Ie,e[41]=X):X=e[41];let ee;e[42]!==ke||e[43]!==Ce||e[44]!==we||e[45]!==ae?(ee=we&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:ke,"aria-label":"Cancel",children:t.jsx(Ut,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Cancel"})]})}),t.jsx(q,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:Ce,"aria-label":"Save",children:ae?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(Ke,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Save"})]})})]}),e[42]=ke,e[43]=Ce,e[44]=we,e[45]=ae,e[46]=ee):ee=e[46];let he;e[47]===Symbol.for("react.memo_cache_sentinel")?(he=()=>h(!0),e[47]=he):he=e[47];let xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(q,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:he,"aria-label":"Share",children:t.jsx(Xe,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Share"})]})}),e[48]=xe):xe=e[48];const Te=s.icon??"cpu_chip";let te;e[49]!==s.title||e[50]!==Te||e[51]!==a?(te=t.jsx(ut,{title:s.title,url:a,icon:Te}),e[49]=s.title,e[50]=Te,e[51]=a,e[52]=te):te=e[52];let se;e[53]!==ee||e[54]!==te?(se=t.jsxs(Ot,{children:[ee,xe,te]}),e[53]=ee,e[54]=te,e[55]=se):se=e[55];let pe;e[56]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[56]=pe):pe=e[56];let oe;e[57]!==D||e[58]!==g||e[59]!==y||e[60]!==O||e[61]!==s.icon||e[62]!==l||e[63]!==E||e[64]!==k||e[65]!==b?(oe=D==="settings"?t.jsx(as,{form:O,icon:s.icon,gatewayId:l}):D==="tools"?t.jsx(ft,{toolSet:b,onToolSetChange:z}):D==="resources"?t.jsx(Kt,{resourceSet:k,onResourceSetChange:G,connectionResources:y}):D==="prompts"?t.jsx(qt,{promptSet:E,onPromptSetChange:Z,connectionPrompts:g}):null,e[57]=D,e[58]=g,e[59]=y,e[60]=O,e[61]=s.icon,e[62]=l,e[63]=E,e[64]=k,e[65]=b,e[66]=oe):oe=e[66];let le;e[67]!==oe?(le=t.jsx(S.Suspense,{fallback:pe,children:oe}),e[67]=oe,e[68]=le):le=e[68];let ne;e[69]!==D||e[70]!==le?(ne=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(Ve,{children:le},D)})})}),e[69]=D,e[70]=le,e[71]=ne):ne=e[71];let ie;e[72]!==s||e[73]!==M?(ie=t.jsx(rs,{open:M,onOpenChange:h,gateway:s}),e[72]=s,e[73]=M,e[74]=ie):ie=e[74];let ge;return e[75]!==K||e[76]!==X||e[77]!==se||e[78]!==ne||e[79]!==ie?(ge=t.jsxs(Bt,{onBack:K,children:[X,se,ne,ie]}),e[75]=K,e[76]=X,e[77]=se,e[78]=ne,e[79]=ie,e[80]=ge):ge=e[80],ge}function hs(o){return o.name}function xs(o){return o.id}function ps(){const o=R.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Fe(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:i,org:n}=tt(l);let a;o[2]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/gateways/$gatewayId"},o[2]=a):a=o[2];const m=st(a).tab||"settings",r=ht(i);if(!r){let u;return o[3]!==s||o[4]!==n?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(rt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:n}}),children:"Back to agents"})})}),o[3]=s,o[4]=n,o[5]=u):u=o[5],u}let d;return o[6]!==r||o[7]!==i||o[8]!==m?(d=t.jsx(fs,{gateway:r,gatewayId:i,requestedTabId:m}),o[6]=r,o[7]=i,o[8]=m,o[9]=d):d=o[9],d}function gs(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ve,{children:t.jsx(S.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ps,{})})}),o[0]=e):e=o[0],e}function ro(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(gs,{}),o[0]=e):e=o[0],e}export{ro as default};
@@ -1 +0,0 @@
1
- import{a4 as Ie,r as u,aF as K,aU as F,R as Re,P as Ce,O as $e,C as Me,aV as z}from"./index-ZiFjEqyT.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case a:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=a,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===a},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===a||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var Pe=Fe();const lt=Ie(Pe);var ve=1,De=.9,qe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ze=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,a,c,d){if(c===l.length)return a===t.length?ve:Ke;var v=`${a},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,a),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===a?b*=ve:Ve.test(t.charAt(i-1))?(b*=qe,x=t.slice(a,i-1).match(Oe),x&&a>0&&(b*=Math.pow(ee,x.length))):ze.test(t.charAt(i-1))?(b*=De,$=t.slice(a,i-1).match(be),$&&a>0&&(b*=Math.pow(ee,$.length))):(b*=je,a>0&&(b*=Math.pow(ee,i-a))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var O='[cmdk-group=""]',te='[cmdk-group-items=""]',Ue='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",_e=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),a=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,T=K(),ue=K(),H=K(),P=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,oe)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var o,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(H);I?I.focus():(o=document.getElementById(T))==null||o.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=q())==null?void 0:I.id,R.emit()}),m||w(5,oe),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=u.useMemo(()=>({value:(e,s,m)=>{var o;s!==((o=c.current.get(e))==null?void 0:o.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,ae(s,m)),w(2,()=>{W(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(a.current.has(s)?a.current.get(s).add(e):a.current.set(s,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=q();w(4,()=>{J(),m?.getAttribute("id")===e&&G(),R.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{c.current.delete(e),a.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:T,inputId:H,labelId:ue,listInnerRef:P}),[]);function ae(e,s){var m,o;let g=(o=(m=v.current)==null?void 0:m.filter)!=null?o:_e;return e?g(e,r.current.search,s):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(o=>{let g=a.current.get(o),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([o,S])});let m=P.current;V().sort((o,g)=>{var S,C;let I=o.getAttribute("id"),U=g.getAttribute("id");return((S=e.get(U))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(o=>{let g=o.closest(te);g?g.appendChild(o.parentElement===g?o:o.closest(`${te} > *`)):m.appendChild(o.parentElement===m?o:o.closest(`${te} > *`))}),s.sort((o,g)=>g[1]-o[1]).forEach(o=>{var g;let S=(g=P.current)==null?void 0:g.querySelector(`${O}[${j}="${encodeURIComponent(o[0])}"]`);S?.parentElement.appendChild(S)})}function G(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function J(){var e,s,m,o;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(o=(m=c.current.get(S))==null?void 0:m.keywords)!=null?o:[],U=ae(C,I);r.current.filtered.items.set(S,U),U>0&&g++}for(let[S,C]of a.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function oe(){var e,s,m;let o=q();o&&(((e=o.parentElement)==null?void 0:e.firstChild)===o&&((m=(s=o.closest(O))==null?void 0:s.querySelector(Ue))==null||m.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function q(){var e;return(e=P.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=P.current)==null?void 0:e.querySelectorAll(he))||[])}function X(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function Y(e){var s;let m=q(),o=V(),g=o.findIndex(C=>C===m),S=o[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?o[o.length-1]:g+e===o.length?o[0]:o[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=q(),m=s?.closest(O),o;for(;m&&!o;)m=e>0?Qe(m,O):Ze(m,O),o=m?.querySelector(he);o?R.setState("value",o.getAttribute(j)):Y(e)}let ce=()=>X(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):Y(1)},de=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ie(-1):Y(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let o=q();if(o){let g=new Event(ne);o.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:rt},y),_(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:N},e))))}),Te=u.forwardRef((t,l)=>{var r,f;let a=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(a,d?.id)},[i]);let p=ke(a,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(a)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:T,forceMount:ue,keywords:H,...P}=t;return u.createElement(F.div,{ref:z(c,l),...P,id:a,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),He=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:a,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>a||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:a}),[a]);return u.createElement(F.div,{ref:z(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),_(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Ne=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,a=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:z(a,l),...f,"cmdk-separator":"",role:"separator"})}),We=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,a=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:a?t.value:d,onChange:i=>{a||c.setState("search",i.target.value),r?.(i.target.value)}})}),Ge=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...a}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:z(c,l),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},_(t,i=>u.createElement("div",{ref:z(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Je=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:a,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:a}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Xe=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ye=u.forwardRef((t,l)=>{let{progress:r,children:f,label:a="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},_(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Ge,Item:Te,Input:We,Group:He,Separator:Ne,Dialog:Je,Empty:Xe,Loading:Ye});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let a=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():a.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),a.current=v}),a}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,a)=>{r.current.set(f,a),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function _({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,Pe as r};