@decocms/mesh 2.1.0 → 2.1.1

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 (103) hide show
  1. package/dist/client/assets/{AlertCircle-CnILn3jx.js → AlertCircle-Zcaeo0Ph.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-B6wScdzP.js → ArrowLeft-CvbtXveq.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-DTD8t00o.js → ChevronDown-BNNXIQh8.js} +1 -1
  4. package/dist/client/assets/{ChevronRight-1OHI0CBI.js → ChevronRight-VxwRrYTx.js} +1 -1
  5. package/dist/client/assets/{Copy01-Uwb56ntU.js → Copy01-9fowVOg1.js} +1 -1
  6. package/dist/client/assets/{DotsHorizontal-B5ryaglt.js → DotsHorizontal-BLSY-UE4.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-B-5TnXsG.js → DotsVertical-CNMrOcPp.js} +1 -1
  8. package/dist/client/assets/{File06-DExBhm42.js → File06-CuNx1VwU.js} +1 -1
  9. package/dist/client/assets/{FilterLines-aAu13BQ5.js → FilterLines-2EXIyDEE.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-DWy5EIwt.js → FlipBackward-JwQkZjg2.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-Dq29bc0o.js → GitBranch01-NybsoqtZ.js} +1 -1
  12. package/dist/client/assets/{Grid01-Bdi_lD58.js → Grid01-BZBEA_C4.js} +1 -1
  13. package/dist/client/assets/{Inbox01-DMQr1yW_.js → Inbox01-Cb8GJSHl.js} +1 -1
  14. package/dist/client/assets/{InfoCircle-BTGq_g6o.js → InfoCircle-ML5pVcTa.js} +1 -1
  15. package/dist/client/assets/{Key01-BM7IeiIC.js → Key01-COJyRDna.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BbRknnAT.js → LinkExternal01-Dkycwe2R.js} +1 -1
  17. package/dist/client/assets/{Loading01-BhwGtEie.js → Loading01-FEharlZ3.js} +1 -1
  18. package/dist/client/assets/{Lock01-BjwJTO1K.js → Lock01-ic-GN8d2.js} +1 -1
  19. package/dist/client/assets/{Play-B_M1eygK.js → Play-DgdieYyY.js} +1 -1
  20. package/dist/client/assets/{Plus-CUt-llJ2.js → Plus-WiwD_J2H.js} +1 -1
  21. package/dist/client/assets/{Terminal-OwfTXSIc.js → Terminal-Dh9is2K6.js} +1 -1
  22. package/dist/client/assets/{Trash01-DvwxBHIe.js → Trash01-_uGmDh1B.js} +1 -1
  23. package/dist/client/assets/{X-DmB-XP-B.js → X-Duz5Cat7.js} +1 -1
  24. package/dist/client/assets/{XClose-BfRKR4QX.js → XClose-Dgc9TlUt.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-CPgX_DbI.js → alert-dialog-DIvkZeS8.js} +1 -1
  26. package/dist/client/assets/{auth-C_7jwlCE.js → auth-Bs90bxg0.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-BsWBBbjQ.js → auth-catchall-C9s-NKYi.js} +1 -1
  28. package/dist/client/assets/{avatar-BfkYZ3Uk.js → avatar-B-VIja6j.js} +1 -1
  29. package/dist/client/assets/{badge-pmm0Bb0n.js → badge-Bq595clU.js} +1 -1
  30. package/dist/client/assets/{card-DX0N7QQe.js → card-DR5we5EA.js} +1 -1
  31. package/dist/client/assets/{checkbox-CT0tct0O.js → checkbox-TKNE3h-h.js} +1 -1
  32. package/dist/client/assets/{collection-detail-BB6Q1vQA.js → collection-detail-BzSV0PjX.js} +1 -1
  33. package/dist/client/assets/{collection-display-button-C6mkNMSZ.js → collection-display-button-DNy_7kSz.js} +1 -1
  34. package/dist/client/assets/{collection-header-B-OH92G_.js → collection-header-D0i6GZ3F.js} +1 -1
  35. package/dist/client/assets/{collection-page-BMM6TZo-.js → collection-page-9DhN6_JB.js} +1 -1
  36. package/dist/client/assets/{collection-search-Dspxl3Yz.js → collection-search-mQlL4U3W.js} +1 -1
  37. package/dist/client/assets/{collection-tab-CZVDVMRh.js → collection-tab-rmLj5s6A.js} +1 -1
  38. package/dist/client/assets/{collection-table-wrapper-QnkBhjXh.js → collection-table-wrapper-Zk7FDqrs.js} +1 -1
  39. package/dist/client/assets/{connection-card-D80SBKTI.js → connection-card-DebysJy8.js} +1 -1
  40. package/dist/client/assets/{connection-detail-CQgpZSSc.js → connection-detail-9KVtgeiT.js} +1 -1
  41. package/dist/client/assets/{connections-D1odZRUO.js → connections-9aNTlc_h.js} +1 -1
  42. package/dist/client/assets/constants-BTSmYMt9.js +1 -0
  43. package/dist/client/assets/{create-organization-dialog-Cz1rNGDv.js → create-organization-dialog-CJ98sB0C.js} +1 -1
  44. package/dist/client/assets/{dialog-CC31EL0X.js → dialog-DDYqAQBF.js} +1 -1
  45. package/dist/client/assets/{dropdown-menu-zbRnijT0.js → dropdown-menu-D6Qp2zGD.js} +1 -1
  46. package/dist/client/assets/{empty-state-B5WHq2Wp.js → empty-state-DBSXVfk0.js} +1 -1
  47. package/dist/client/assets/{env-vars-editor-BZ0EKsNv.js → env-vars-editor-DzhvBSgj.js} +1 -1
  48. package/dist/client/assets/{error-boundary-iei4NFmK.js → error-boundary-Eygnq8Hk.js} +1 -1
  49. package/dist/client/assets/extract-connection-data-5iVWxj7E.js +1 -0
  50. package/dist/client/assets/{form-B4rbGxTC.js → form-Bff3cjR5.js} +1 -1
  51. package/dist/client/assets/{formatDistanceToNow-B3eT5t4e.js → formatDistanceToNow-BRBGOkjl.js} +1 -1
  52. package/dist/client/assets/{gateway-detail-Cel29Jq6.js → gateway-detail-1i8IrIM9.js} +1 -1
  53. package/dist/client/assets/{gateway-selector-DrcyKhYX.js → gateway-selector-CCKBvHsl.js} +1 -1
  54. package/dist/client/assets/{gateways-BCUxb6V6.js → gateways-CYzUHwXz.js} +1 -1
  55. package/dist/client/assets/{home-DjjIziN3.js → home-B1-MfTjq.js} +1 -1
  56. package/dist/client/assets/{index-DhProoia.js → index-BbxwAA9k.js} +1 -1
  57. package/dist/client/assets/{index-Be5s3BTd.js → index-Cxif_WiW.js} +21 -21
  58. package/dist/client/assets/{index-CJUkmkVw.js → index-Cy9l89I6.js} +5 -5
  59. package/dist/client/assets/{input-D5VmXtXA.js → input-Dq5R1hsb.js} +1 -1
  60. package/dist/client/assets/{layout-BtPLf8h9.js → layout-COs-F_yU.js} +1 -1
  61. package/dist/client/assets/{lazy-highlighter-CKguQGTj.js → lazy-highlighter-CFowraVx.js} +1 -1
  62. package/dist/client/assets/{localstorage-keys-Cgns4y6c.js → localstorage-keys-TO4Iz1ZL.js} +1 -1
  63. package/dist/client/assets/{login-BY9zzeLF.js → login-D2jzWiIU.js} +1 -1
  64. package/dist/client/assets/{mcp-oauth-JrBnP9ka.js → mcp-oauth-o2ZvtP-e.js} +1 -1
  65. package/dist/client/assets/{mcp-server-detail-D1UUYOFR.js → mcp-server-detail-WcX1lQms.js} +1 -1
  66. package/dist/client/assets/{members-BLsbQRx4.js → members-xKTj4uec.js} +1 -1
  67. package/dist/client/assets/{monaco-editor-BbkOCnUd.js → monaco-editor-BLJ-5Rq_.js} +1 -1
  68. package/dist/client/assets/{monitoring-DQGgnd4W.js → monitoring-KQw3N0Bq.js} +1 -1
  69. package/dist/client/assets/{oauth-callback-CEdwKynD.js → oauth-callback-DghEZBt_.js} +1 -1
  70. package/dist/client/assets/{page-CjfeHs2p.js → page-9r0ghDqC.js} +1 -1
  71. package/dist/client/assets/{page-BXDOiUca.js → page-CO0kUkkz.js} +1 -1
  72. package/dist/client/assets/{pin-to-sidebar-button-Dw4GdfbU.js → pin-to-sidebar-button-DGCbmg2o.js} +1 -1
  73. package/dist/client/assets/{popover-t9-OkADH.js → popover-CsFIibUb.js} +1 -1
  74. package/dist/client/assets/{project-context-provider-BS8o541A.js → project-context-provider-C4m-SDFS.js} +1 -1
  75. package/dist/client/assets/{resizable-QJ-R9KRQ.js → resizable-CP3lQk6C.js} +1 -1
  76. package/dist/client/assets/{resource-tabs-B-4VA98W.js → resource-tabs-C_l6VEbU.js} +1 -1
  77. package/dist/client/assets/{select-e4C4SmKq.js → select-BEsgTDeZ.js} +1 -1
  78. package/dist/client/assets/{settings-Dnv8fDox.js → settings-DoNMBUhT.js} +1 -1
  79. package/dist/client/assets/{shell-layout-BlrxsMrN.js → shell-layout-BcqwLSW9.js} +1 -1
  80. package/dist/client/assets/{spinner-BFS4gVsU.js → spinner-Cm9P6I1C.js} +1 -1
  81. package/dist/client/assets/{switch-CLvPCUaJ.js → switch-BCWj5zC6.js} +1 -1
  82. package/dist/client/assets/{textarea-4b5OG-tc.js → textarea-BUrXlyuG.js} +1 -1
  83. package/dist/client/assets/{thread-history-popover-CdgY8TVV.js → thread-history-popover-Cm6dNBcQ.js} +3 -3
  84. package/dist/client/assets/{tools-list-DYFK0YJ7.js → tools-list-D53iqXZd.js} +1 -1
  85. package/dist/client/assets/{use-binding-4jFDqim2.js → use-binding-Db1yl1TL.js} +1 -1
  86. package/dist/client/assets/{use-connection-BV17GXlx.js → use-connection-CGMQx4M9.js} +1 -1
  87. package/dist/client/assets/{use-connection-resources-CaFhYy-Y.js → use-connection-resources-Bt4HyA5c.js} +1 -1
  88. package/dist/client/assets/{use-gateway-B7sk5BUf.js → use-gateway-_mFxXQBe.js} +1 -1
  89. package/dist/client/assets/{use-list-state-ClKTIM8C.js → use-list-state-BqAl0_R1.js} +1 -1
  90. package/dist/client/assets/{use-mcp-BnUTTtgf.js → use-mcp-o9InczvY.js} +1 -1
  91. package/dist/client/assets/{use-members-Duard-8M.js → use-members-B-_jPiHI.js} +1 -1
  92. package/dist/client/assets/{use-mobile-D6agNekL.js → use-mobile-C5d37E9R.js} +1 -1
  93. package/dist/client/assets/{use-organization-settings-BBRsFqJO.js → use-organization-settings-BQ3Z2_RY.js} +1 -1
  94. package/dist/client/assets/{use-tool-call-CM2oq0rB.js → use-tool-call-BkhAERrv.js} +1 -1
  95. package/dist/client/assets/useQuery-CNppnPNo.js +1 -0
  96. package/dist/client/assets/{value-8MKGBmon.js → value-CHn8uszM.js} +1 -1
  97. package/dist/client/assets/{view-mode-toggle-BTD72CUu.js → view-mode-toggle-D8JnY0Wg.js} +1 -1
  98. package/dist/client/assets/{workflow-6yVvsMos.js → workflow-J4y20R0G.js} +1 -1
  99. package/dist/client/index.html +1 -1
  100. package/package.json +1 -1
  101. package/dist/client/assets/constants-BvQJIhjO.js +0 -1
  102. package/dist/client/assets/extract-connection-data-RbshSMFT.js +0 -1
  103. package/dist/client/assets/useQuery-DdiguCvR.js +0 -1
@@ -1 +1 @@
1
- import{c as ge,j as e,r as M,h as xe,b as je,a as fe,u as ye,x as ve,w as _e,s as oe,W as Ce,v as y,a0 as ke}from"./index-Be5s3BTd.js";import{C as Ne}from"./collection-header-B-OH92G_.js";import{C as Se}from"./collection-page-BMM6TZo-.js";import{C as we}from"./collection-search-Dspxl3Yz.js";import{C as Te}from"./collection-table-wrapper-QnkBhjXh.js";import{C as be}from"./connection-card-D80SBKTI.js";import{b as De,u as Pe,n as O,E as B,c as Ie,I as Ve}from"./use-connection-BV17GXlx.js";import{E as $e}from"./error-boundary-iei4NFmK.js";import{a as Ee}from"./use-binding-4jFDqim2.js";import{u as Ae,s as Q}from"./use-list-state-ClKTIM8C.js";import{u as Fe}from"./project-context-provider-BS8o541A.js";import{f as He,a as Oe,b as Be,c as ze,d as Me,e as Re,A as Ue,g as Xe}from"./alert-dialog-CPgX_DbI.js";import{B as We}from"./badge-pmm0Bb0n.js";import{I as k,B as _}from"./input-D5VmXtXA.js";import{d as Le,c as Ke,D as Ge,a as qe,b as Ye,f as Qe}from"./dialog-CC31EL0X.js";import{b as J,D as Z,a as ee,c as $}from"./dropdown-menu-zbRnijT0.js";import{a as Je,F as h,b as g,c as x,d as j,f}from"./form-B4rbGxTC.js";import{i as te}from"./DotsVertical-B-5TnXsG.js";import{i as Ze,r as et,s as z,E as tt,e as re}from"./env-vars-editor-BZ0EKsNv.js";import{i as nt}from"./Loading01-BhwGtEie.js";import{i as st}from"./Terminal-OwfTXSIc.js";import{s as ne}from"./Trash01-DvwxBHIe.js";import{S as ot,a as rt,b as it,c as at,d as P}from"./select-e4C4SmKq.js";import{T as ct}from"./textarea-4b5OG-tc.js";import{g as lt}from"./generate-id-Dyweu44Y.js";import{a as dt}from"./use-tool-call-CM2oq0rB.js";import{f as ut,e as mt}from"./registry-utils-B7t_ZBUi.js";import"./collection-display-button-C6mkNMSZ.js";import"./Grid01-Bdi_lD58.js";import"./view-mode-toggle-BTD72CUu.js";import"./card-DX0N7QQe.js";import"./auth-C_7jwlCE.js";import"./use-mobile-D6agNekL.js";import"./X-DmB-XP-B.js";import"./ChevronRight-1OHI0CBI.js";import"./Plus-CUt-llJ2.js";import"./ChevronDown-DTD8t00o.js";import"./useQuery-DdiguCvR.js";const pt=oe({key:y(),value:y()}),ht=oe({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 o=n.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function gt(n){const o=n.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=o.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function E(n){const{uiType:o}=n,i=A(n.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="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 o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function se(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const o=A(n.connectionUrl??"");if(!o)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function xt(n,o){const i={command:"npx",args:["-y",n]},d=re(o);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,o,i,d){const m={command:n};o.trim()&&(m.args=o.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(m.envVars=a),m}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(o=>!o.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=Fe(),o=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:m}=ye(),a=Ae({namespace:n.slug,resource:"connections"}),I=De(),N=Pe(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=ut(R?.tools),ie=Ie(F||void 0),{data:ae}=dt({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=mt(ae??[]),W=i.action==="create",ce=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},L=()=>{o({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:[]}}),u=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),b=E({uiType:u,connectionUrl:K??"",npxPackage:le??""})??se({uiType:u,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=Ze(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const s=et(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:s})}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:s})}}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{}},ue=async t=>{let s,c=null,w=null,C=null;if(t.ui_type==="NPX"?(s="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(s="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(s=t.ui_type,c=t.connection_url||"",w=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:s,connection_url:c,...w&&{connection_token:w},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const T=lt("conn");await I.create.mutateAsync({id:T,title:t.title,description:t.description||null,connection_type:s,connection_url:c,connection_token:w,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"}),L(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:T}})},G=t=>{t||(W?L():S({type:"close"}),r.reset())},V=t=>{const s=t.trim();if(!s)return;const c=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,T=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(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(D=>D.key)),Y=p.envVarKeys.filter(D=>!he.has(D));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(D=>({key:D,value:""}))],{shouldDirty:!0})}},H=gt(s);if(H&&m){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}),T(E({uiType:"NPX",npxPackage:H.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",s,{shouldDirty:!0}),T(E({uiType:p,connectionUrl:s})??se({uiType:p,connectionUrl:s,registryItems:X}));return}u==="NPX"&&T(E({uiType:"NPX",npxPackage:s}))},me=[{id:"icon",header:"",render:t=>e.jsx(Ve,{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 s=t.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(We,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.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:()=>o({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:W||v.mode==="editing",onOpenChange:G,children:e.jsxs(Ke,{className:"sm:max-w-[525px]",children:[e.jsxs(Ge,{children:[e.jsx(qe,{children:l?"Edit Connection":"Create Connection"}),e.jsx(Ye,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Je,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(ue),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(ot,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(rt,{children:e.jsx(it,{})})}),e.jsxs(at,{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"]})}),m&&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(st,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="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:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="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,{})]})})]}),(u==="NPX"||u==="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(tt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="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:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.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:b?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:b?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),b?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.token.helperText,b.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(ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Qe,{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(He,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(Oe,{children:[e.jsxs(Be,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Me,{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(Re,{children:[e.jsx(Ue,{children:"Cancel"}),e.jsx(Xe,{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(we,{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:()=>o({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(be,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(Te,{columns:me,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>o({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:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function cn(){const n=ge.c(1);let o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx($e,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=o):o=n[0],o}export{cn as default};
1
+ import{c as ge,j as e,r as M,h as xe,b as je,a as fe,u as ye,x as ve,w as _e,s as oe,W as Ce,v as y,a0 as ke}from"./index-Cxif_WiW.js";import{C as Ne}from"./collection-header-D0i6GZ3F.js";import{C as Se}from"./collection-page-9DhN6_JB.js";import{C as we}from"./collection-search-mQlL4U3W.js";import{C as Te}from"./collection-table-wrapper-Zk7FDqrs.js";import{C as be}from"./connection-card-DebysJy8.js";import{b as De,u as Pe,n as O,E as B,c as Ie,I as Ve}from"./use-connection-CGMQx4M9.js";import{E as $e}from"./error-boundary-Eygnq8Hk.js";import{a as Ee}from"./use-binding-Db1yl1TL.js";import{u as Ae,s as Q}from"./use-list-state-BqAl0_R1.js";import{u as Fe}from"./project-context-provider-C4m-SDFS.js";import{f as He,a as Oe,b as Be,c as ze,d as Me,e as Re,A as Ue,g as Xe}from"./alert-dialog-DIvkZeS8.js";import{B as We}from"./badge-Bq595clU.js";import{I as k,B as _}from"./input-Dq5R1hsb.js";import{d as Le,c as Ke,D as Ge,a as qe,b as Ye,f as Qe}from"./dialog-DDYqAQBF.js";import{b as J,D as Z,a as ee,c as $}from"./dropdown-menu-D6Qp2zGD.js";import{a as Je,F as h,b as g,c as x,d as j,f}from"./form-Bff3cjR5.js";import{i as te}from"./DotsVertical-CNMrOcPp.js";import{i as Ze,r as et,s as z,E as tt,e as re}from"./env-vars-editor-DzhvBSgj.js";import{i as nt}from"./Loading01-FEharlZ3.js";import{i as st}from"./Terminal-Dh9is2K6.js";import{s as ne}from"./Trash01-_uGmDh1B.js";import{S as ot,a as rt,b as it,c as at,d as P}from"./select-BEsgTDeZ.js";import{T as ct}from"./textarea-BUrXlyuG.js";import{g as lt}from"./generate-id-Dyweu44Y.js";import{a as dt}from"./use-tool-call-BkhAERrv.js";import{f as ut,e as mt}from"./registry-utils-B7t_ZBUi.js";import"./collection-display-button-DNy_7kSz.js";import"./Grid01-BZBEA_C4.js";import"./view-mode-toggle-D8JnY0Wg.js";import"./card-DR5we5EA.js";import"./auth-Bs90bxg0.js";import"./use-mobile-C5d37E9R.js";import"./X-Duz5Cat7.js";import"./ChevronRight-VxwRrYTx.js";import"./Plus-WiwD_J2H.js";import"./ChevronDown-BNNXIQh8.js";import"./useQuery-CNppnPNo.js";const pt=oe({key:y(),value:y()}),ht=oe({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 o=n.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function gt(n){const o=n.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=o.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function E(n){const{uiType:o}=n,i=A(n.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="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 o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function se(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const o=A(n.connectionUrl??"");if(!o)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function xt(n,o){const i={command:"npx",args:["-y",n]},d=re(o);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,o,i,d){const m={command:n};o.trim()&&(m.args=o.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(m.envVars=a),m}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(o=>!o.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=Fe(),o=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:m}=ye(),a=Ae({namespace:n.slug,resource:"connections"}),I=De(),N=Pe(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=ut(R?.tools),ie=Ie(F||void 0),{data:ae}=dt({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=mt(ae??[]),W=i.action==="create",ce=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},L=()=>{o({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:[]}}),u=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),b=E({uiType:u,connectionUrl:K??"",npxPackage:le??""})??se({uiType:u,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=Ze(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const s=et(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:s})}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:s})}}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{}},ue=async t=>{let s,c=null,w=null,C=null;if(t.ui_type==="NPX"?(s="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(s="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(s=t.ui_type,c=t.connection_url||"",w=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:s,connection_url:c,...w&&{connection_token:w},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const T=lt("conn");await I.create.mutateAsync({id:T,title:t.title,description:t.description||null,connection_type:s,connection_url:c,connection_token:w,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"}),L(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:T}})},G=t=>{t||(W?L():S({type:"close"}),r.reset())},V=t=>{const s=t.trim();if(!s)return;const c=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,T=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(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(D=>D.key)),Y=p.envVarKeys.filter(D=>!he.has(D));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(D=>({key:D,value:""}))],{shouldDirty:!0})}},H=gt(s);if(H&&m){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}),T(E({uiType:"NPX",npxPackage:H.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",s,{shouldDirty:!0}),T(E({uiType:p,connectionUrl:s})??se({uiType:p,connectionUrl:s,registryItems:X}));return}u==="NPX"&&T(E({uiType:"NPX",npxPackage:s}))},me=[{id:"icon",header:"",render:t=>e.jsx(Ve,{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 s=t.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(We,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.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:()=>o({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:W||v.mode==="editing",onOpenChange:G,children:e.jsxs(Ke,{className:"sm:max-w-[525px]",children:[e.jsxs(Ge,{children:[e.jsx(qe,{children:l?"Edit Connection":"Create Connection"}),e.jsx(Ye,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Je,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(ue),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(ot,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(rt,{children:e.jsx(it,{})})}),e.jsxs(at,{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"]})}),m&&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(st,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="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:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="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,{})]})})]}),(u==="NPX"||u==="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(tt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="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:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.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:b?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:b?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),b?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.token.helperText,b.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(ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Qe,{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(He,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(Oe,{children:[e.jsxs(Be,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Me,{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(Re,{children:[e.jsx(Ue,{children:"Cancel"}),e.jsx(Xe,{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(we,{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:()=>o({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(be,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(Te,{columns:me,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>o({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:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function cn(){const n=ge.c(1);let o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx($e,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=o):o=n[0],o}export{cn as default};
@@ -0,0 +1 @@
1
+ import{B as o}from"./use-binding-Db1yl1TL.js";import{F as s}from"./index-Cxif_WiW.js";const e="mcp.mesh",m="mcp.mesh/publisher-provided",c=s(o,{target:"draft-7"});export{c as B,m as M,e as a};
@@ -1 +1 @@
1
- import{s as A,v as D,c as v,w as O,x as E,j as r,a as N}from"./index-Be5s3BTd.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-CPgX_DbI.js";import{u as V,I as k,B as q}from"./input-D5VmXtXA.js";import{F as H,a as U,b as G,c as J,d as K,e as P,f as Q}from"./form-B4rbGxTC.js";import{S as W}from"./spinner-BFS4gVsU.js";function _(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function oe(a){const e=v.c(41),{open:o,onOpenChange:s}=a;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:O(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=V(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(G,{children:[r.jsx(J,{children:"Organization Name"}),r.jsx(K,{children:r.jsx(k,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(P,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(Q,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(H,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(W,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(q,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(M,{children:[F,r.jsx(U,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==o||e[39]!==x?(C=r.jsx(B,{open:o,onOpenChange:s,children:x}),e[37]=s,e[38]=o,e[39]=x,e[40]=C):C=e[40],C}function Y(a){const{orgSlug:e}=a;window.location.href=`/${e}`}async function Z(a){const e=_(a.name);if(!e)throw new Error("Organization slug is invalid");const o=await N.organization.create({name:a.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const s=o?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{oe as C};
1
+ import{s as A,v as D,c as v,w as O,x as E,j as r,a as N}from"./index-Cxif_WiW.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-DIvkZeS8.js";import{u as V,I as k,B as q}from"./input-Dq5R1hsb.js";import{F as H,a as U,b as G,c as J,d as K,e as P,f as Q}from"./form-Bff3cjR5.js";import{S as W}from"./spinner-Cm9P6I1C.js";function _(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function oe(a){const e=v.c(41),{open:o,onOpenChange:s}=a;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:O(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=V(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(G,{children:[r.jsx(J,{children:"Organization Name"}),r.jsx(K,{children:r.jsx(k,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(P,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(Q,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(H,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(W,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(q,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(M,{children:[F,r.jsx(U,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==o||e[39]!==x?(C=r.jsx(B,{open:o,onOpenChange:s,children:x}),e[37]=s,e[38]=o,e[39]=x,e[40]=C):C=e[40],C}function Y(a){const{orgSlug:e}=a;window.location.href=`/${e}`}async function Z(a){const e=_(a.name);if(!e)throw new Error("Organization slug is invalid");const o=await N.organization.create({name:a.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const s=o?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{oe as C};
@@ -1 +1 @@
1
- import{c as n,j as i,R as g,C as m,T as u,D as x,P as j,O as N,aP as b,e as D}from"./index-Be5s3BTd.js";import{i as h}from"./X-DmB-XP-B.js";import{c}from"./input-D5VmXtXA.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(D,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{P as D,O as a,B as b,T as c,k as d,w as e,R as f};
1
+ import{c as n,j as i,R as g,C as m,T as u,D as x,P as j,O as N,aP as b,e as D}from"./index-Cxif_WiW.js";import{i as h}from"./X-Duz5Cat7.js";import{c}from"./input-Dq5R1hsb.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(D,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{P as D,O as a,B as b,T as c,k as d,w as e,R as f};
@@ -1 +1 @@
1
- import{c,j as i,bz as p,bA as f,bB as m,bC as g,bD as b,bE as x,bF as v,bG as w,bH as h}from"./index-Be5s3BTd.js";import{i as j}from"./ChevronRight-1OHI0CBI.js";import{c as u}from"./input-D5VmXtXA.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(b,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(x,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,E as g};
1
+ import{c,j as i,bA as p,bB as f,bC as m,bD as g,bE as b,bF as x,bG as v,bH as w,bI as h}from"./index-Cxif_WiW.js";import{i as j}from"./ChevronRight-VxwRrYTx.js";import{c as u}from"./input-Dq5R1hsb.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(b,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(x,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,E as g};
@@ -1 +1 @@
1
- import{c as p,j as t}from"./index-Be5s3BTd.js";import{B as j,c as b}from"./input-D5VmXtXA.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
1
+ import{c as p,j as t}from"./index-Cxif_WiW.js";import{B as j,c as b}from"./input-Dq5R1hsb.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
@@ -1 +1 @@
1
- import{r as N,s as y,a0 as D,W as k,v as t,V as m,Y as T,H,c as O,j as c}from"./index-Be5s3BTd.js";import{I as z,B as V}from"./input-D5VmXtXA.js";import{s as R}from"./Plus-CUt-llJ2.js";import{s as L}from"./Trash01-DvwxBHIe.js";const U=({size:o=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},N.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));U.displayName="Globe02";const B=y({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:k(t()),grantType:D(["authorization_code","client_credentials"])}),M=y({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),K=y({headers:m(t(),t()).optional()}),$=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),W=y({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:H([$,K]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:k(M).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});W.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});W.partial();function Q(o){return o!=null&&"command"in o}function q(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function X(o){const e=O.c(34),{value:n,onChange:r,keyPlaceholder:j,valuePlaceholder:l,className:I}=o,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let x;e[0]!==r||e[1]!==n?(x=()=>{r([...n,{key:"",value:""}])},e[0]=r,e[1]=n,e[2]=x):x=e[2];const A=x;let w;e[3]!==r||e[4]!==n?(w=i=>{r(n.filter((d,s)=>s!==i))},e[3]=r,e[4]=n,e[5]=w):w=e[5];const b=w;let S;e[6]!==r||e[7]!==n?(S=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:d,value:a.value},r(s))},e[6]=r,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==r||e[10]!==n?(C=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:a.key,value:d},r(s))},e[9]=r,e[10]=n,e[11]=C):C=e[11];const v=C;let u;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==f||e[16]!==n||e[17]!==_){let i;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==f||e[23]!==_?(i=(d,s)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(z,{placeholder:f,value:d.key,onChange:a=>g(s,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(z,{type:q(d.key)?"password":"text",placeholder:_,value:d.value,onChange:a=>v(s,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(s),children:c.jsx(L,{size:16})})]},s),e[19]=g,e[20]=b,e[21]=v,e[22]=f,e[23]=_,e[24]=i):i=e[24],u=n.map(i),e[12]=g,e[13]=b,e[14]=v,e[15]=f,e[16]=n,e[17]=_,e[18]=u}else u=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(R,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(V,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==u||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[u,p]}),e[28]=u,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function Z(o){const e={};for(const{key:n,value:r}of o)n.trim()&&(e[n.trim()]=r);return e}function ee(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{X as E,Z as e,Q as i,ee as r,U as s};
1
+ import{r as N,s as y,a0 as D,W as k,v as t,V as m,Y as T,H,c as O,j as c}from"./index-Cxif_WiW.js";import{I as z,B as V}from"./input-Dq5R1hsb.js";import{s as R}from"./Plus-WiwD_J2H.js";import{s as L}from"./Trash01-_uGmDh1B.js";const U=({size:o=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},N.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));U.displayName="Globe02";const B=y({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:k(t()),grantType:D(["authorization_code","client_credentials"])}),M=y({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),K=y({headers:m(t(),t()).optional()}),$=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),W=y({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:H([$,K]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:k(M).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});W.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});W.partial();function Q(o){return o!=null&&"command"in o}function q(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function X(o){const e=O.c(34),{value:n,onChange:r,keyPlaceholder:j,valuePlaceholder:l,className:I}=o,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let x;e[0]!==r||e[1]!==n?(x=()=>{r([...n,{key:"",value:""}])},e[0]=r,e[1]=n,e[2]=x):x=e[2];const A=x;let w;e[3]!==r||e[4]!==n?(w=i=>{r(n.filter((d,s)=>s!==i))},e[3]=r,e[4]=n,e[5]=w):w=e[5];const b=w;let S;e[6]!==r||e[7]!==n?(S=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:d,value:a.value},r(s))},e[6]=r,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==r||e[10]!==n?(C=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:a.key,value:d},r(s))},e[9]=r,e[10]=n,e[11]=C):C=e[11];const v=C;let u;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==f||e[16]!==n||e[17]!==_){let i;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==f||e[23]!==_?(i=(d,s)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(z,{placeholder:f,value:d.key,onChange:a=>g(s,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(z,{type:q(d.key)?"password":"text",placeholder:_,value:d.value,onChange:a=>v(s,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(s),children:c.jsx(L,{size:16})})]},s),e[19]=g,e[20]=b,e[21]=v,e[22]=f,e[23]=_,e[24]=i):i=e[24],u=n.map(i),e[12]=g,e[13]=b,e[14]=v,e[15]=f,e[16]=n,e[17]=_,e[18]=u}else u=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(R,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(V,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==u||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[u,p]}),e[28]=u,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function Z(o){const e={};for(const{key:n,value:r}of o)n.trim()&&(e[n.trim()]=r);return e}function ee(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{X as E,Z as e,Q as i,ee as r,U as s};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./index-Be5s3BTd.js";import{B as n}from"./input-D5VmXtXA.js";const o=({size:t=24,color:r="currentColor",...s})=>a.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},a.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));o.displayName="AlertTriangle";class l extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(o,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{l as E,o as i};
1
+ import{r as a,j as e}from"./index-Cxif_WiW.js";import{B as n}from"./input-Dq5R1hsb.js";const o=({size:t=24,color:r="currentColor",...s})=>a.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},a.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));o.displayName="AlertTriangle";class l extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(o,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{l as E,o as i};
@@ -0,0 +1 @@
1
+ import{a as c,M as l}from"./constants-BTSmYMt9.js";import{g as C}from"./github-icon-Dp3wHhYE.js";import{g as E}from"./registry-utils-B7t_ZBUi.js";import{g as S}from"./generate-id-Dyweu44Y.js";function I(n,p,u){const t=n.server,e=n._meta?.[c]??t?._meta?.[c],r=n._meta?.[l]??t?._meta?.[l],i=r?.metadata,a=t?.remotes?.[0],d=E(a?.type)||"HTTP",s=new Date().toISOString(),_=r?.friendlyName||n.title||t?.title||t?.name||"Unnamed App",g=t?.description||null,f=t?.icons?.[0]?.src||C(t?.repository)||null,o=i?.oauth_config,m=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,y=i?.configuration_state,h=i?.configuration_scopes,b=t?.repository?{url:t.repository.url,source:t.repository.source,subfolder:t.repository.subfolder}:null;return{id:S("conn"),title:_,description:g,icon:f,app_name:e?.appName||t?.name||null,app_id:e?.id||n.id||null,connection_type:d,connection_url:a?.url||"",connection_token:null,connection_headers:null,oauth_config:m,configuration_state:y??null,configuration_scopes:h??null,metadata:{...i,source:"store",registry_item_id:n.id,verified:e?.verified??!1,scopeName:e?.scopeName??null,toolsCount:r?.tools?.length??0,publishedAt:e?.publishedAt??null,repository:b},created_at:s,updated_at:s,created_by:u,organization_id:p,tools:null,bindings:null,status:"inactive"}}export{I as e};
@@ -1 +1 @@
1
- import{c as d,j as m,aV as $,bb as j,bc as C,r as f,g as v,bd as N,be as h}from"./index-Be5s3BTd.js";import{c as u}from"./input-D5VmXtXA.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,g=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(g.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,b=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==b?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:b,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=b,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function V(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,V as f};
1
+ import{c as d,j as m,aV as $,bc as j,bd as C,r as f,g as v,be as N,bf as h}from"./index-Cxif_WiW.js";import{c as u}from"./input-Dq5R1hsb.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,b=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(b.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(b),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function V(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,V as f};
@@ -1 +1 @@
1
- import{aZ as X,a_ as O,a$ as q,b0 as j,ap as A,B as _,b1 as Y,b2 as z,r as w,b3 as I,b4 as L,b5 as N,b6 as H,b7 as k,b8 as x,b9 as V,ba as J}from"./index-Be5s3BTd.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!q(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=j(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=_(e),r=Y(),i=z(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let $={};function K(){return $}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function Z(t){return W(t,Date.now())}function G(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(G(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},qt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:qt,defaultParseWidth:"any"})},_t={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yt(t,n,e){const s=K(),r=e?.locale??s.locale??_t,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return Yt(t,Z(t),n)}export{Lt as f,It as u};
1
+ import{a_ as X,a$ as O,b0 as q,b1 as j,ap as A,B as _,b2 as Y,b3 as z,r as w,b4 as I,b5 as L,b6 as N,b7 as H,b8 as k,b9 as x,ba as V,bb as J}from"./index-Cxif_WiW.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!q(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=j(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=_(e),r=Y(),i=z(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let $={};function K(){return $}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function G(t){return W(t,Date.now())}function Z(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(Z(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},qt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:qt,defaultParseWidth:"any"})},_t={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yt(t,n,e){const s=K(),r=e?.locale??s.locale??_t,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return Yt(t,G(t),n)}export{Lt as f,It as u};
@@ -1 +1 @@
1
- import{r as I,c as U,j as t,h as Ve,d as qe,b as Qe,s as Ke,a0 as Ne,v as Te,i as We,aG as Ze,w as Xe,x as Ye,t as $e}from"./index-Be5s3BTd.js";import{I as ke,u as Ae,E as et}from"./use-connection-BV17GXlx.js";import{E as De}from"./error-boundary-iei4NFmK.js";import{C as Fe}from"./checkbox-CT0tct0O.js";import{c as K,B as H,I as Ie}from"./input-D5VmXtXA.js";import{i as tt}from"./ArrowLeft-B6wScdzP.js";import{C as st}from"./collection-search-Dspxl3Yz.js";import{s as lt}from"./Plus-CUt-llJ2.js";import{i as nt}from"./X-DmB-XP-B.js";import{P as ot}from"./pin-to-sidebar-button-Dw4GdfbU.js";import{T as it,S as rt}from"./switch-CLvPCUaJ.js";import{b as ct,a as at,i as dt}from"./use-gateway-B7sk5BUf.js";import{u as mt,a as ut}from"./use-connection-resources-CaFhYy-Y.js";import{s as ft}from"./slugify-CEUa2lfQ.js";import{F as fe,a as ht,b as xe,d as pe,f as ge,c as Me}from"./form-B4rbGxTC.js";import{R as xt}from"./resource-tabs-B-4VA98W.js";import{S as Ge,a as Oe,b as Be,c as Ue,d as he}from"./select-e4C4SmKq.js";import{a as W,c as Z,b as X,T as Y,i as Pe}from"./project-context-provider-BS8o541A.js";import{a as pt}from"./Copy01-Uwb56ntU.js";import{i as gt}from"./FlipBackward-DWy5EIwt.js";import{i as He}from"./InfoCircle-BTGq_g6o.js";import{i as we}from"./Loading01-BhwGtEie.js";import{a as jt,V as bt,b as vt}from"./layout-BtPLf8h9.js";import{f as yt}from"./formatDistanceToNow-B3eT5t4e.js";import"./use-organization-settings-BBRsFqJO.js";import"./badge-pmm0Bb0n.js";import"./ChevronDown-DTD8t00o.js";const Le=({size:l=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.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"}));Le.displayName="Save01";const Ct=I.memo(function(e){const s=U.c(20),{connection:n,isSelected:d,hasItemsEnabled:o,activeItemsCount:f,totalItemsCount:h,onSelect:c,onToggle:i}=e,a=d?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==a?(m=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",a),s[0]=a,s[1]=m):m=s[1];let r;s[2]!==n.icon||s[3]!==n.title?(r=t.jsx(ke,{icon:n.icon,name:n.title,size:"xs"}),s[2]=n.icon,s[3]=n.title,s[4]=r):r=s[4];let j;s[5]!==n.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),s[5]=n.title,s[6]=j):j=s[6];let x;s[7]!==c||s[8]!==r||s[9]!==j?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[r,j]}),s[7]=c,s[8]=r,s[9]=j,s[10]=x):x=s[10];let p;s[11]!==f||s[12]!==o||s[13]!==i||s[14]!==h?(p=h>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",h]}),t.jsx(Fe,{checked:o,onCheckedChange:i,onClick:_t})]}),s[11]=f,s[12]=o,s[13]=i,s[14]=h,s[15]=p):p=s[15];let y;return s[16]!==m||s[17]!==x||s[18]!==p?(y=t.jsxs("div",{className:m,children:[x,p]}),s[16]=m,s[17]=x,s[18]=p,s[19]=y):y=s[19],y}),St=I.memo(function(e){const s=U.c(18),{connectionId:n,item:d,isSelected:o,onToggle:f}=e,h=`item-${n}-${d.id}`,c=o?"text-foreground":"text-muted-foreground";let i;s[0]!==c?(i=K("text-sm font-medium",c),s[0]=c,s[1]=i):i=s[1];let a;s[2]!==d.name||s[3]!==i?(a=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:i,children:d.name})}),s[2]=d.name,s[3]=i,s[4]=a):a=s[4];let m;s[5]!==d.description?(m=d.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.description}),s[5]=d.description,s[6]=m):m=s[6];let r;s[7]!==a||s[8]!==m?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,m]}),s[7]=a,s[8]=m,s[9]=r):r=s[9];const j=`item-${n}-${d.id}`;let x;s[10]!==o||s[11]!==f||s[12]!==j?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Fe,{id:j,checked:o,onCheckedChange:f,onClick:Nt})}),s[10]=o,s[11]=f,s[12]=j,s[13]=x):x=s[13];let p;return s[14]!==h||s[15]!==r||s[16]!==x?(p=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:h,children:[r,x]}),s[14]=h,s[15]=r,s[16]=x,s[17]=p):p=s[17],p});function Je({itemSet:l,onItemSetChange:e,getItems:s,itemLabel:n,emptyItemsMessage:d,extraContent:o}){const[f,h]=I.useState(""),c=I.useDeferredValue(f),[i,a]=I.useState("all"),[m,r]=I.useState(!1),j=I.useRef(new Set(Object.keys(l))),x=Ae({searchTerm:c.trim()||void 0}),p=j.current,y=[...p.values()].map(u=>x.find(S=>S.id===u)).filter(u=>u!==void 0),b=x.filter(u=>!p.has(u.id)),w=[...y,...b],g=u=>{const S=l[u];return S!==void 0&&S.length>0},v=w.filter(u=>{if(i==="all")return!0;const S=g(u.id);return i==="selected"?S:i==="unselected"?!S:!0}),[C,_]=I.useState(w[0]?.id??null),N=C?w.find(u=>u.id===C)??null:null,V=N?s(N):[],E=(u,S)=>l[u]?.includes(S)??!1,O=(u,S)=>{const $=l[u]??[],P=$.includes(S),A={...l};if(P){const z=$.filter(R=>R!==S);z.length===0?delete A[u]:A[u]=z}else A[u]=[...$,S];e(A)},q=u=>{const S=w.find(D=>D.id===u);if(!S)return;const $=s(S);if($.length===0)return;const P=l[u]??[],A=$.map(D=>D.id),z=P.length>0&&A.every(D=>P.includes(D)),R={...l};z?delete R[u]:(R[u]=A,_(u)),e(R)},M=u=>{_(u),r(!0)},F=()=>{r(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(st,{value:f,onChange:h,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>a("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>a("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>a("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:v.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:f?"No connections found":i==="selected"?"No servers selected":i==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:v.map(u=>{const $=s(u).length,P=l[u.id]?.length??0;return t.jsx(Ct,{connection:u,isSelected:C===u.id,hasItemsEnabled:g(u.id),activeItemsCount:P,totalItemsCount:$,onSelect:()=>M(u.id),onToggle:()=>q(u.id)},u.id)})})})]}),t.jsx("div",{className:K("flex-1 flex-col",m?"flex":"hidden md:flex"),children:N?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(H,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(tt,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(ke,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),o,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:V.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:d||`This connection has no ${n} available`}):t.jsx("div",{className:"space-y-2",children:V.map(u=>t.jsx(St,{connectionId:N.id,item:u,isSelected:E(N.id,u.id),onToggle:()=>O(N.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",n]})})})]})}function _t(l){return l.stopPropagation()}function Nt(l){return l.stopPropagation()}function wt(l){const e=U.c(6),{promptSet:s,onPromptSetChange:n,connectionPrompts:d}=l;let o;e[0]!==d?(o=c=>(d.get(c.id)??[]).map(kt),e[0]=d,e[1]=o):o=e[1];const f=o;let h;return e[2]!==f||e[3]!==n||e[4]!==s?(h=t.jsx(Je,{itemSet:s,onItemSetChange:n,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=n,e[4]=s,e[5]=h):h=e[5],h}function kt(l){return{id:l.name,name:l.name,description:l.description}}function It(l){return l.includes("*")}function Tt(l){const e=U.c(27),{patterns:s,onAddPattern:n,onRemovePattern:d}=l,[o,f]=I.useState("");let h;e[0]!==o||e[1]!==n||e[2]!==s?(h=()=>{const r=o.trim();r&&!s.includes(r)&&(n(r),f(""))},e[0]=o,e[1]=n,e[2]=s,e[3]=h):h=e[3];const c=h;let i;e[4]!==c?(i=r=>{r.key==="Enter"&&(r.preventDefault(),c())},e[4]=c,e[5]=i):i=e[5];const a=i;let m;if(e[6]!==c||e[7]!==a||e[8]!==o||e[9]!==d||e[10]!==s){const r=s.filter(It);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=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 ",j," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=_=>f(_.target.value),e[14]=p):p=e[14];let y;e[15]!==a||e[16]!==o?(y=t.jsx(Ie,{value:o,onChange:p,onKeyDown:a,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=a,e[16]=o,e[17]=y):y=e[17];let b;e[18]!==o?(b=o.trim(),e[18]=o,e[19]=b):b=e[19];const w=!b;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(lt,{size:16}),e[20]=g):g=e[20];let v;e[21]!==c||e[22]!==w?(v=t.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:w,children:g}),e[21]=c,e[22]=w,e[23]=v):v=e[23];let C;e[24]!==v||e[25]!==y?(C=t.jsxs("div",{className:"flex gap-2",children:[y,v]}),e[24]=v,e[25]=y,e[26]=C):C=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,C,r.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>d(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(nt,{size:12})})]},_))})]}),e[6]=c,e[7]=a,e[8]=o,e[9]=d,e[10]=s,e[11]=m}else m=e[11];return m}function $t(l){const e=U.c(23),{resourceSet:s,onResourceSetChange:n,connectionResources:d}=l,[o]=I.useState(null);let f;e[0]!==d?(f=g=>(d.get(g.id)??[]).map(Pt),e[0]=d,e[1]=f):f=e[1];const h=f;let c;e[2]!==n||e[3]!==s?(c=(g,v)=>{const C=s[g]??[];C.includes(v)||n({...s,[g]:[...C,v]})},e[2]=n,e[3]=s,e[4]=c):c=e[4];const i=c;let a;e[5]!==n||e[6]!==s?(a=(g,v)=>{const _=(s[g]??[]).filter(N=>N!==v);if(_.length===0){const N={...s};delete N[g],n(N)}else n({...s,[g]:_})},e[5]=n,e[6]=s,e[7]=a):a=e[7];const m=a;let r;e[8]!==n?(r=g=>{n(g)},e[8]=n,e[9]=r):r=e[9];const j=r;let x;e[10]!==s||e[11]!==o?(x=o?s[o]??[]:[],e[10]=s,e[11]=o,e[12]=x):x=e[12];const p=x;let y;e[13]!==i||e[14]!==m||e[15]!==o||e[16]!==p?(y=o?t.jsx(Tt,{patterns:p,onAddPattern:g=>i(o,g),onRemovePattern:g=>m(o,g)}):null,e[13]=i,e[14]=m,e[15]=o,e[16]=p,e[17]=y):y=e[17];const b=y;let w;return e[18]!==b||e[19]!==h||e[20]!==j||e[21]!==s?(w=t.jsx("div",{className:"h-full",children:t.jsx(Je,{itemSet:s,onItemSetChange:j,getItems:h,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:b})}),e[18]=b,e[19]=h,e[20]=j,e[21]=s,e[22]=w):w=e[22],w}function Pt(l){return{id:l.uri,name:l.name||l.uri,description:l.description||l.uri}}function zt(l){const s=new TextEncoder().encode(l),n=Array.from(s,d=>String.fromCharCode(d)).join("");return btoa(n)}function Rt(l){const e=U.c(52),{serverName:s,gatewayUrl:n}=l,[d,o]=I.useState(!1),[f,h]=I.useState(null),c=ft(s);let i,a,m,r;if(e[0]!==n||e[1]!==c){const Q={type:"http",url:n},L={[c]:Q};i=JSON.stringify(L,null,2);const ee=je=>JSON.stringify({...Q,headers:{"x-mesh-client":je}},null,2),te=zt(ee("Cursor"));a=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(te)}`;const me=ee("Claude Code");m=c;let J;e[6]===Symbol.for("react.memo_cache_sentinel")?(J=/'/g,e[6]=J):J=e[6],r=me.replace(J,"'\\''"),e[0]=n,e[1]=c,e[2]=i,e[3]=a,e[4]=m,e[5]=r}else i=e[2],a=e[3],m=e[4],r=e[5];const j=`claude mcp add "${m}" --config '${r}'`;let x;e[7]!==i?(x=async()=>{await navigator.clipboard.writeText(i),o(!0),$e.success("Configuration copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[7]=i,e[8]=x):x=e[8];const p=x;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=async(Q,L)=>{await navigator.clipboard.writeText(Q),h(L),$e.success(`${L} command copied`),setTimeout(()=>h(null),2e3)},e[9]=y):y=e[9];const b=y,w=Et;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let v;e[11]!==d?(v=d?t.jsx(Pe,{size:14}):t.jsx(pt,{size:14}),e[11]=d,e[12]=v):v=e[12];let C;e[13]!==p||e[14]!==v?(C=t.jsx(X,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:v})}),e[13]=p,e[14]=v,e[15]=C):C=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Y,{children:"Copy configuration"}),e[16]=_):_=e[16];let N;e[17]!==C?(N=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(W,{children:t.jsxs(Z,{children:[C,_]})})}),e[17]=C,e[18]=N):N=e[18];let V;e[19]!==i||e[20]!==p?(V=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:p,children:i}),e[19]=i,e[20]=p,e[21]=V):V=e[21];let E;e[22]!==V||e[23]!==N?(E=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[N,V]}),e[22]=V,e[23]=N,e[24]=E):E=e[24];let O;e[25]!==a?(O=()=>w(a),e[25]=a,e[26]=O):O=e[26];let q,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),M=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=M):(q=e[27],M=e[28]);let F;e[29]!==O?(F=t.jsx(X,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:O,children:[q,M]})}),e[29]=O,e[30]=F):F=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Y,{children:"Add to Cursor"}),e[31]=u):u=e[31];let S;e[32]!==F?(S=t.jsx(W,{children:t.jsxs(Z,{children:[F,u]})}),e[32]=F,e[33]=S):S=e[33];let $;e[34]!==j?($=()=>b(j,"Claude"),e[34]=j,e[35]=$):$=e[35];let P,A;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),A=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=P,e[37]=A):(P=e[36],A=e[37]);let z;e[38]!==f?(z=f==="Claude"&&t.jsx(Pe,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=z):z=e[39];let R;e[40]!==$||e[41]!==z?(R=t.jsx(X,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[P,A,z]})}),e[40]=$,e[41]=z,e[42]=R):R=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Y,{children:"Add to Claude Code"}),e[43]=D):D=e[43];let B;e[44]!==R?(B=t.jsx(W,{children:t.jsxs(Z,{children:[R,D]})}),e[44]=R,e[45]=B):B=e[45];let T;e[46]!==S||e[47]!==B?(T=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[S,B]}),e[46]=S,e[47]=B,e[48]=T):T=e[48];let de;return e[49]!==E||e[50]!==T?(de=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,E,T]}),e[49]=E,e[50]=T,e[51]=de):de=e[51],de}function Et(l){window.open(l,"_blank")}const Vt=Ke({title:Te().min(1,"Name is required").max(255),description:Te().nullable(),status:Ne(["active","inactive"]),tool_selection_mode:Ne(["inclusion","exclusion"]),tool_selection_strategy:Ne(["passthrough","smart_tool_selection","code_execution"])});function ze(l,e){const s={};for(const n of l.connections)if(n.selected_tools===null){const d=e.get(n.connection_id)??[];d.length>0&&(s[n.connection_id]=d)}else n.selected_tools.length>0&&(s[n.connection_id]=n.selected_tools);return s}function Re(l){const e={};for(const s of l.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 Ee(l){const e={};for(const s of l.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 At(l,e,s,n){const d=new Set([...Object.keys(l),...Object.keys(e),...Object.keys(s)]);return Array.from(d).map(o=>{const f=l[o]??[],h=n.get(o)??[],c=h.length>0&&h.every(i=>f.includes(i));return{connection_id:o,selected_tools:f.length===0||c?null:f,selected_resources:e[o]??null,selected_prompts:s[o]??null}})}function Dt(l){const e=U.c(41),{form:s,gateway:n,icon:d}=l;let o;e[0]!==s?(o=s.watch("title")||"Hub",e[0]=s,e[1]=o):o=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(dt,{}),e[2]=f):f=e[2];let h;e[3]!==d||e[4]!==o?(h=t.jsx(ke,{icon:d,name:o,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=d,e[4]=o,e[5]=h):h=e[5];let c;e[6]!==s.control?(c=t.jsx(fe,{control:s.control,name:"status",render:Bt}),e[6]=s.control,e[7]=c):c=e[7];let i;e[8]!==h||e[9]!==c?(i=t.jsxs("div",{className:"flex items-start justify-between",children:[h,c]}),e[8]=h,e[9]=c,e[10]=i):i=e[10];let a;e[11]!==s.control?(a=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(fe,{control:s.control,name:"title",render:Ot}),t.jsx(fe,{control:s.control,name:"description",render:Gt})]}),e[11]=s.control,e[12]=a):a=e[12];let m;e[13]!==i||e[14]!==a?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[i,a]}),e[13]=i,e[14]=a,e[15]=m):m=e[15];let r;e[16]!==s.control?(r=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(fe,{control:s.control,name:"tool_selection_mode",render:Mt}),t.jsx(fe,{control:s.control,name:"tool_selection_strategy",render:Ft})]}),e[16]=s.control,e[17]=r):r=e[17];let j;e[18]!==m||e[19]!==r?(j=t.jsxs("div",{className:"flex flex-col",children:[m,r]}),e[18]=m,e[19]=r,e[20]=j):j=e[20];let x;e[21]!==s||e[22]!==j?(x=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(ht,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=x):x=e[23];let p;e[24]!==n.id||e[25]!==n.title?(p=n.title||`hub-${n.id.slice(0,8)}`,e[24]=n.id,e[25]=n.title,e[26]=p):p=e[26];const y=`${window.location.origin}/mcp/gateway/${n.id}`;let b;e[27]!==p||e[28]!==y?(b=t.jsx("div",{className:"p-5",children:t.jsx(Rt,{serverName:p,gatewayUrl:y})}),e[27]=p,e[28]=y,e[29]=b):b=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=w):w=e[30];let g;e[31]!==n.updated_at?(g=n.updated_at?yt(new Date(n.updated_at),{addSuffix:!1}):"Unknown",e[31]=n.updated_at,e[32]=g):g=e[32];let v;e[33]!==g?(v=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=v):v=e[34];let C;e[35]!==b||e[36]!==v?(C=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[b,v]}),e[35]=b,e[36]=v,e[37]=C):C=e[37];let _;return e[38]!==x||e[39]!==C?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[x,C]}),e[38]=x,e[39]=C,e[40]=_):_=e[40],_}function Ft(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Me,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(W,{children:t.jsxs(Z,{children:[t.jsx(X,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Hub strategy help",children:t.jsx(He,{size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(Ge,{value:e.value,onValueChange:e.onChange,children:[t.jsx(pe,{children:t.jsx(Oe,{className:"w-[180px]",children:t.jsx(Be,{})})}),t.jsxs(Ue,{children:[t.jsx(he,{value:"passthrough",children:"Passthrough"}),t.jsx(he,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(he,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(ge,{})]})}function Mt(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Me,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(W,{children:t.jsxs(Z,{children:[t.jsx(X,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(He,{size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{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(Ge,{value:e.value,onValueChange:e.onChange,children:[t.jsx(pe,{children:t.jsx(Oe,{className:"w-[180px]",children:t.jsx(Be,{})})}),t.jsxs(Ue,{children:[t.jsx(he,{value:"inclusion",children:"Include Selected"}),t.jsx(he,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(ge,{})]})}function Gt(l){const{field:e}=l;return t.jsxs(xe,{className:"w-full space-y-0",children:[t.jsx(pe,{children:t.jsx(Ie,{...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(ge,{})]})}function Ot(l){const{field:e}=l;return t.jsxs(xe,{className:"w-full space-y-0",children:[t.jsx(pe,{children:t.jsx(Ie,{...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:"Hub Name"})}),t.jsx(ge,{})]})}function Bt(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(pe,{children:t.jsx(rt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(ge,{})]})}function Ut(l){const e=U.c(75),{gateway:s,gatewayId:n,requestedTabId:d}=l,f=We().location.href,h=Ze();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/gateways/$gatewayId"},e[0]=c):c=e[0];const i=Ve(c),a=at();let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m={},e[1]=m):m=e[1];const r=Ae(m);let j;e[2]!==r?(j=r.map(Lt),e[2]=r,e[3]=j):j=e[3];const x=j,{promptsMap:p}=mt(x),{resourcesMap:y}=ut(x);let b;if(e[4]!==r){b=new Map;for(const k of r)k.tools&&k.tools.length>0&&b.set(k.id,k.tools.map(Ht));e[4]=r,e[5]=b}else b=e[5];let w;e[6]!==b||e[7]!==s?(w=()=>ze(s,b),e[6]=b,e[7]=s,e[8]=w):w=e[8];const[g,v]=I.useState(w);let C;e[9]!==s?(C=()=>Re(s),e[9]=s,e[10]=C):C=e[10];const[_,N]=I.useState(C);let V;e[11]!==s?(V=()=>Ee(s),e[11]=s,e[12]=V):V=e[12];const[E,O]=I.useState(V),[q,M]=I.useState(!1);let F;e[13]===Symbol.for("react.memo_cache_sentinel")?(F=k=>{v(k),M(!0)},e[13]=F):F=e[13];const u=F;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=k=>{N(k),M(!0)},e[14]=S):S=e[14];const $=S;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=k=>{O(k),M(!0)},e[15]=P):P=e[15];const A=P;let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=Xe(Vt),e[16]=z):z=e[16];const R=s.tool_selection_mode??"inclusion",D=s.tool_selection_strategy??"passthrough";let B;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==R||e[21]!==D?(B={resolver:z,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:R,tool_selection_strategy:D}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=R,e[21]=D,e[22]=B):B=e[22];const T=Ye(B),Q=T.formState.isDirty||q;let L;e[23]!==a.update||e[24]!==b||e[25]!==T||e[26]!==n||e[27]!==E||e[28]!==_||e[29]!==g?(L=async()=>{const k=T.getValues(),_e=At(g,_,E,b);await a.update.mutateAsync({id:n,data:{title:k.title,description:k.description,status:k.status,tool_selection_mode:k.tool_selection_mode,tool_selection_strategy:k.tool_selection_strategy,connections:_e}}),T.reset(k),M(!1)},e[23]=a.update,e[24]=b,e[25]=T,e[26]=n,e[27]=E,e[28]=_,e[29]=g,e[30]=L):L=e[30];const ee=L;let te;e[31]!==b||e[32]!==T||e[33]!==s?(te=()=>{T.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",tool_selection_strategy:s.tool_selection_strategy??"passthrough"}),v(ze(s,b)),N(Re(s)),O(Ee(s)),M(!1)},e[31]=b,e[32]=T,e[33]=s,e[34]=te):te=e[34];const me=te;let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[35]=J):J=e[35];const je=J,G=je.some(k=>k.id===d)?d:"settings";let be;e[36]!==i?(be=k=>{i({search:_e=>({..._e,tab:k}),replace:!0})},e[36]=i,e[37]=be):be=e[37];const Ce=be,ue=a.update.isPending;let se;e[38]!==h.history?(se=()=>h.history.back(),e[38]=h.history,e[39]=se):se=e[39];let le;e[40]!==G||e[41]!==Ce?(le=t.jsx(jt,{children:t.jsx(xt,{tabs:je,activeTab:G,onTabChange:Ce})}),e[40]=G,e[41]=Ce,e[42]=le):le=e[42];let ne;e[43]!==me||e[44]!==ee||e[45]!==Q||e[46]!==ue?(ne=Q&&t.jsxs(t.Fragment,{children:[t.jsx(W,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(X,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ue,onClick:me,"aria-label":"Cancel",children:t.jsx(gt,{size:14})})})}),t.jsx(Y,{side:"bottom",children:"Cancel"})]})}),t.jsx(W,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(X,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ue,onClick:ee,"aria-label":"Save",children:ue?t.jsx(we,{size:14,className:"animate-spin"}):t.jsx(Le,{size:14})})})}),t.jsx(Y,{side:"bottom",children:"Save"})]})})]}),e[43]=me,e[44]=ee,e[45]=Q,e[46]=ue,e[47]=ne):ne=e[47];const Se=s.icon??"cpu_chip";let oe;e[48]!==s.title||e[49]!==Se||e[50]!==f?(oe=t.jsx(ot,{title:s.title,url:f,icon:Se}),e[48]=s.title,e[49]=Se,e[50]=f,e[51]=oe):oe=e[51];let ie;e[52]!==ne||e[53]!==oe?(ie=t.jsxs(bt,{children:[ne,oe]}),e[52]=ne,e[53]=oe,e[54]=ie):ie=e[54];let ve;e[55]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(we,{size:32,className:"animate-spin text-muted-foreground"})}),e[55]=ve):ve=e[55];let re;e[56]!==G||e[57]!==p||e[58]!==y||e[59]!==T||e[60]!==s||e[61]!==E||e[62]!==_||e[63]!==g?(re=G==="settings"?t.jsx(Dt,{form:T,gateway:s,icon:s.icon}):G==="tools"?t.jsx(it,{toolSet:g,onToolSetChange:u}):G==="resources"?t.jsx($t,{resourceSet:_,onResourceSetChange:$,connectionResources:y}):G==="prompts"?t.jsx(wt,{promptSet:E,onPromptSetChange:A,connectionPrompts:p}):null,e[56]=G,e[57]=p,e[58]=y,e[59]=T,e[60]=s,e[61]=E,e[62]=_,e[63]=g,e[64]=re):re=e[64];let ce;e[65]!==re?(ce=t.jsx(I.Suspense,{fallback:ve,children:re}),e[65]=re,e[66]=ce):ce=e[66];let ae;e[67]!==G||e[68]!==ce?(ae=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(De,{children:ce},G)})})}),e[67]=G,e[68]=ce,e[69]=ae):ae=e[69];let ye;return e[70]!==se||e[71]!==le||e[72]!==ie||e[73]!==ae?(ye=t.jsxs(vt,{onBack:se,children:[le,ie,ae]}),e[70]=se,e[71]=le,e[72]=ie,e[73]=ae,e[74]=ye):ye=e[74],ye}function Ht(l){return l.name}function Lt(l){return l.id}function Jt(){const l=U.c(10);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},l[0]=e):e=l[0];const s=Ve(e);let n;l[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/gateways/$gatewayId"},l[1]=n):n=l[1];const{gatewayId:d,org:o}=qe(n);let f;l[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},l[2]=f):f=l[2];const c=Qe(f).tab||"settings",i=ct(d);if(!i){let m;return l[3]!==s||l[4]!==o?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(et,{title:"Hub not found",description:"This Hub may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:o}}),children:"Back to gateways"})})}),l[3]=s,l[4]=o,l[5]=m):m=l[5],m}let a;return l[6]!==i||l[7]!==d||l[8]!==c?(a=t.jsx(Ut,{gateway:i,gatewayId:d,requestedTabId:c}),l[6]=i,l[7]=d,l[8]=c,l[9]=a):a=l[9],a}function qt(){const l=U.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(De,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(we,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Jt,{})})}),l[0]=e):e=l[0],e}function ys(){const l=U.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qt,{}),l[0]=e):e=l[0],e}export{ys as default};
1
+ import{r as I,c as U,j as t,h as Ve,d as qe,b as Qe,s as Ke,a0 as Ne,v as Te,i as We,aG as Ze,w as Xe,x as Ye,t as $e}from"./index-Cxif_WiW.js";import{I as ke,u as Ae,E as et}from"./use-connection-CGMQx4M9.js";import{E as De}from"./error-boundary-Eygnq8Hk.js";import{C as Fe}from"./checkbox-TKNE3h-h.js";import{c as K,B as H,I as Ie}from"./input-Dq5R1hsb.js";import{i as tt}from"./ArrowLeft-CvbtXveq.js";import{C as st}from"./collection-search-mQlL4U3W.js";import{s as lt}from"./Plus-WiwD_J2H.js";import{i as nt}from"./X-Duz5Cat7.js";import{P as ot}from"./pin-to-sidebar-button-DGCbmg2o.js";import{T as it,S as rt}from"./switch-BCWj5zC6.js";import{b as ct,a as at,i as dt}from"./use-gateway-_mFxXQBe.js";import{u as mt,a as ut}from"./use-connection-resources-Bt4HyA5c.js";import{s as ft}from"./slugify-CEUa2lfQ.js";import{F as fe,a as ht,b as xe,d as pe,f as ge,c as Me}from"./form-Bff3cjR5.js";import{R as xt}from"./resource-tabs-C_l6VEbU.js";import{S as Ge,a as Oe,b as Be,c as Ue,d as he}from"./select-BEsgTDeZ.js";import{a as W,c as Z,b as X,T as Y,i as Pe}from"./project-context-provider-C4m-SDFS.js";import{a as pt}from"./Copy01-9fowVOg1.js";import{i as gt}from"./FlipBackward-JwQkZjg2.js";import{i as He}from"./InfoCircle-ML5pVcTa.js";import{i as we}from"./Loading01-FEharlZ3.js";import{a as jt,V as bt,b as vt}from"./layout-COs-F_yU.js";import{f as yt}from"./formatDistanceToNow-BRBGOkjl.js";import"./use-organization-settings-BQ3Z2_RY.js";import"./badge-Bq595clU.js";import"./ChevronDown-BNNXIQh8.js";const Le=({size:l=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.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"}));Le.displayName="Save01";const Ct=I.memo(function(e){const s=U.c(20),{connection:n,isSelected:d,hasItemsEnabled:o,activeItemsCount:f,totalItemsCount:h,onSelect:c,onToggle:i}=e,a=d?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==a?(m=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",a),s[0]=a,s[1]=m):m=s[1];let r;s[2]!==n.icon||s[3]!==n.title?(r=t.jsx(ke,{icon:n.icon,name:n.title,size:"xs"}),s[2]=n.icon,s[3]=n.title,s[4]=r):r=s[4];let j;s[5]!==n.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),s[5]=n.title,s[6]=j):j=s[6];let x;s[7]!==c||s[8]!==r||s[9]!==j?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[r,j]}),s[7]=c,s[8]=r,s[9]=j,s[10]=x):x=s[10];let p;s[11]!==f||s[12]!==o||s[13]!==i||s[14]!==h?(p=h>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",h]}),t.jsx(Fe,{checked:o,onCheckedChange:i,onClick:_t})]}),s[11]=f,s[12]=o,s[13]=i,s[14]=h,s[15]=p):p=s[15];let y;return s[16]!==m||s[17]!==x||s[18]!==p?(y=t.jsxs("div",{className:m,children:[x,p]}),s[16]=m,s[17]=x,s[18]=p,s[19]=y):y=s[19],y}),St=I.memo(function(e){const s=U.c(18),{connectionId:n,item:d,isSelected:o,onToggle:f}=e,h=`item-${n}-${d.id}`,c=o?"text-foreground":"text-muted-foreground";let i;s[0]!==c?(i=K("text-sm font-medium",c),s[0]=c,s[1]=i):i=s[1];let a;s[2]!==d.name||s[3]!==i?(a=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:i,children:d.name})}),s[2]=d.name,s[3]=i,s[4]=a):a=s[4];let m;s[5]!==d.description?(m=d.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.description}),s[5]=d.description,s[6]=m):m=s[6];let r;s[7]!==a||s[8]!==m?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,m]}),s[7]=a,s[8]=m,s[9]=r):r=s[9];const j=`item-${n}-${d.id}`;let x;s[10]!==o||s[11]!==f||s[12]!==j?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Fe,{id:j,checked:o,onCheckedChange:f,onClick:Nt})}),s[10]=o,s[11]=f,s[12]=j,s[13]=x):x=s[13];let p;return s[14]!==h||s[15]!==r||s[16]!==x?(p=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:h,children:[r,x]}),s[14]=h,s[15]=r,s[16]=x,s[17]=p):p=s[17],p});function Je({itemSet:l,onItemSetChange:e,getItems:s,itemLabel:n,emptyItemsMessage:d,extraContent:o}){const[f,h]=I.useState(""),c=I.useDeferredValue(f),[i,a]=I.useState("all"),[m,r]=I.useState(!1),j=I.useRef(new Set(Object.keys(l))),x=Ae({searchTerm:c.trim()||void 0}),p=j.current,y=[...p.values()].map(u=>x.find(S=>S.id===u)).filter(u=>u!==void 0),b=x.filter(u=>!p.has(u.id)),w=[...y,...b],g=u=>{const S=l[u];return S!==void 0&&S.length>0},v=w.filter(u=>{if(i==="all")return!0;const S=g(u.id);return i==="selected"?S:i==="unselected"?!S:!0}),[C,_]=I.useState(w[0]?.id??null),N=C?w.find(u=>u.id===C)??null:null,V=N?s(N):[],E=(u,S)=>l[u]?.includes(S)??!1,O=(u,S)=>{const $=l[u]??[],P=$.includes(S),A={...l};if(P){const z=$.filter(R=>R!==S);z.length===0?delete A[u]:A[u]=z}else A[u]=[...$,S];e(A)},q=u=>{const S=w.find(D=>D.id===u);if(!S)return;const $=s(S);if($.length===0)return;const P=l[u]??[],A=$.map(D=>D.id),z=P.length>0&&A.every(D=>P.includes(D)),R={...l};z?delete R[u]:(R[u]=A,_(u)),e(R)},M=u=>{_(u),r(!0)},F=()=>{r(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(st,{value:f,onChange:h,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>a("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>a("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>a("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:v.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:f?"No connections found":i==="selected"?"No servers selected":i==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:v.map(u=>{const $=s(u).length,P=l[u.id]?.length??0;return t.jsx(Ct,{connection:u,isSelected:C===u.id,hasItemsEnabled:g(u.id),activeItemsCount:P,totalItemsCount:$,onSelect:()=>M(u.id),onToggle:()=>q(u.id)},u.id)})})})]}),t.jsx("div",{className:K("flex-1 flex-col",m?"flex":"hidden md:flex"),children:N?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(H,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(tt,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(ke,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),o,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:V.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:d||`This connection has no ${n} available`}):t.jsx("div",{className:"space-y-2",children:V.map(u=>t.jsx(St,{connectionId:N.id,item:u,isSelected:E(N.id,u.id),onToggle:()=>O(N.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",n]})})})]})}function _t(l){return l.stopPropagation()}function Nt(l){return l.stopPropagation()}function wt(l){const e=U.c(6),{promptSet:s,onPromptSetChange:n,connectionPrompts:d}=l;let o;e[0]!==d?(o=c=>(d.get(c.id)??[]).map(kt),e[0]=d,e[1]=o):o=e[1];const f=o;let h;return e[2]!==f||e[3]!==n||e[4]!==s?(h=t.jsx(Je,{itemSet:s,onItemSetChange:n,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=n,e[4]=s,e[5]=h):h=e[5],h}function kt(l){return{id:l.name,name:l.name,description:l.description}}function It(l){return l.includes("*")}function Tt(l){const e=U.c(27),{patterns:s,onAddPattern:n,onRemovePattern:d}=l,[o,f]=I.useState("");let h;e[0]!==o||e[1]!==n||e[2]!==s?(h=()=>{const r=o.trim();r&&!s.includes(r)&&(n(r),f(""))},e[0]=o,e[1]=n,e[2]=s,e[3]=h):h=e[3];const c=h;let i;e[4]!==c?(i=r=>{r.key==="Enter"&&(r.preventDefault(),c())},e[4]=c,e[5]=i):i=e[5];const a=i;let m;if(e[6]!==c||e[7]!==a||e[8]!==o||e[9]!==d||e[10]!==s){const r=s.filter(It);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=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 ",j," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=_=>f(_.target.value),e[14]=p):p=e[14];let y;e[15]!==a||e[16]!==o?(y=t.jsx(Ie,{value:o,onChange:p,onKeyDown:a,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=a,e[16]=o,e[17]=y):y=e[17];let b;e[18]!==o?(b=o.trim(),e[18]=o,e[19]=b):b=e[19];const w=!b;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(lt,{size:16}),e[20]=g):g=e[20];let v;e[21]!==c||e[22]!==w?(v=t.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:w,children:g}),e[21]=c,e[22]=w,e[23]=v):v=e[23];let C;e[24]!==v||e[25]!==y?(C=t.jsxs("div",{className:"flex gap-2",children:[y,v]}),e[24]=v,e[25]=y,e[26]=C):C=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,C,r.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>d(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(nt,{size:12})})]},_))})]}),e[6]=c,e[7]=a,e[8]=o,e[9]=d,e[10]=s,e[11]=m}else m=e[11];return m}function $t(l){const e=U.c(23),{resourceSet:s,onResourceSetChange:n,connectionResources:d}=l,[o]=I.useState(null);let f;e[0]!==d?(f=g=>(d.get(g.id)??[]).map(Pt),e[0]=d,e[1]=f):f=e[1];const h=f;let c;e[2]!==n||e[3]!==s?(c=(g,v)=>{const C=s[g]??[];C.includes(v)||n({...s,[g]:[...C,v]})},e[2]=n,e[3]=s,e[4]=c):c=e[4];const i=c;let a;e[5]!==n||e[6]!==s?(a=(g,v)=>{const _=(s[g]??[]).filter(N=>N!==v);if(_.length===0){const N={...s};delete N[g],n(N)}else n({...s,[g]:_})},e[5]=n,e[6]=s,e[7]=a):a=e[7];const m=a;let r;e[8]!==n?(r=g=>{n(g)},e[8]=n,e[9]=r):r=e[9];const j=r;let x;e[10]!==s||e[11]!==o?(x=o?s[o]??[]:[],e[10]=s,e[11]=o,e[12]=x):x=e[12];const p=x;let y;e[13]!==i||e[14]!==m||e[15]!==o||e[16]!==p?(y=o?t.jsx(Tt,{patterns:p,onAddPattern:g=>i(o,g),onRemovePattern:g=>m(o,g)}):null,e[13]=i,e[14]=m,e[15]=o,e[16]=p,e[17]=y):y=e[17];const b=y;let w;return e[18]!==b||e[19]!==h||e[20]!==j||e[21]!==s?(w=t.jsx("div",{className:"h-full",children:t.jsx(Je,{itemSet:s,onItemSetChange:j,getItems:h,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:b})}),e[18]=b,e[19]=h,e[20]=j,e[21]=s,e[22]=w):w=e[22],w}function Pt(l){return{id:l.uri,name:l.name||l.uri,description:l.description||l.uri}}function zt(l){const s=new TextEncoder().encode(l),n=Array.from(s,d=>String.fromCharCode(d)).join("");return btoa(n)}function Rt(l){const e=U.c(52),{serverName:s,gatewayUrl:n}=l,[d,o]=I.useState(!1),[f,h]=I.useState(null),c=ft(s);let i,a,m,r;if(e[0]!==n||e[1]!==c){const Q={type:"http",url:n},L={[c]:Q};i=JSON.stringify(L,null,2);const ee=je=>JSON.stringify({...Q,headers:{"x-mesh-client":je}},null,2),te=zt(ee("Cursor"));a=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(te)}`;const me=ee("Claude Code");m=c;let J;e[6]===Symbol.for("react.memo_cache_sentinel")?(J=/'/g,e[6]=J):J=e[6],r=me.replace(J,"'\\''"),e[0]=n,e[1]=c,e[2]=i,e[3]=a,e[4]=m,e[5]=r}else i=e[2],a=e[3],m=e[4],r=e[5];const j=`claude mcp add "${m}" --config '${r}'`;let x;e[7]!==i?(x=async()=>{await navigator.clipboard.writeText(i),o(!0),$e.success("Configuration copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[7]=i,e[8]=x):x=e[8];const p=x;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=async(Q,L)=>{await navigator.clipboard.writeText(Q),h(L),$e.success(`${L} command copied`),setTimeout(()=>h(null),2e3)},e[9]=y):y=e[9];const b=y,w=Et;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let v;e[11]!==d?(v=d?t.jsx(Pe,{size:14}):t.jsx(pt,{size:14}),e[11]=d,e[12]=v):v=e[12];let C;e[13]!==p||e[14]!==v?(C=t.jsx(X,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:v})}),e[13]=p,e[14]=v,e[15]=C):C=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Y,{children:"Copy configuration"}),e[16]=_):_=e[16];let N;e[17]!==C?(N=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(W,{children:t.jsxs(Z,{children:[C,_]})})}),e[17]=C,e[18]=N):N=e[18];let V;e[19]!==i||e[20]!==p?(V=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:p,children:i}),e[19]=i,e[20]=p,e[21]=V):V=e[21];let E;e[22]!==V||e[23]!==N?(E=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[N,V]}),e[22]=V,e[23]=N,e[24]=E):E=e[24];let O;e[25]!==a?(O=()=>w(a),e[25]=a,e[26]=O):O=e[26];let q,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),M=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=M):(q=e[27],M=e[28]);let F;e[29]!==O?(F=t.jsx(X,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:O,children:[q,M]})}),e[29]=O,e[30]=F):F=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Y,{children:"Add to Cursor"}),e[31]=u):u=e[31];let S;e[32]!==F?(S=t.jsx(W,{children:t.jsxs(Z,{children:[F,u]})}),e[32]=F,e[33]=S):S=e[33];let $;e[34]!==j?($=()=>b(j,"Claude"),e[34]=j,e[35]=$):$=e[35];let P,A;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),A=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=P,e[37]=A):(P=e[36],A=e[37]);let z;e[38]!==f?(z=f==="Claude"&&t.jsx(Pe,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=z):z=e[39];let R;e[40]!==$||e[41]!==z?(R=t.jsx(X,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[P,A,z]})}),e[40]=$,e[41]=z,e[42]=R):R=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Y,{children:"Add to Claude Code"}),e[43]=D):D=e[43];let B;e[44]!==R?(B=t.jsx(W,{children:t.jsxs(Z,{children:[R,D]})}),e[44]=R,e[45]=B):B=e[45];let T;e[46]!==S||e[47]!==B?(T=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[S,B]}),e[46]=S,e[47]=B,e[48]=T):T=e[48];let de;return e[49]!==E||e[50]!==T?(de=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,E,T]}),e[49]=E,e[50]=T,e[51]=de):de=e[51],de}function Et(l){window.open(l,"_blank")}const Vt=Ke({title:Te().min(1,"Name is required").max(255),description:Te().nullable(),status:Ne(["active","inactive"]),tool_selection_mode:Ne(["inclusion","exclusion"]),tool_selection_strategy:Ne(["passthrough","smart_tool_selection","code_execution"])});function ze(l,e){const s={};for(const n of l.connections)if(n.selected_tools===null){const d=e.get(n.connection_id)??[];d.length>0&&(s[n.connection_id]=d)}else n.selected_tools.length>0&&(s[n.connection_id]=n.selected_tools);return s}function Re(l){const e={};for(const s of l.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 Ee(l){const e={};for(const s of l.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 At(l,e,s,n){const d=new Set([...Object.keys(l),...Object.keys(e),...Object.keys(s)]);return Array.from(d).map(o=>{const f=l[o]??[],h=n.get(o)??[],c=h.length>0&&h.every(i=>f.includes(i));return{connection_id:o,selected_tools:f.length===0||c?null:f,selected_resources:e[o]??null,selected_prompts:s[o]??null}})}function Dt(l){const e=U.c(41),{form:s,gateway:n,icon:d}=l;let o;e[0]!==s?(o=s.watch("title")||"Hub",e[0]=s,e[1]=o):o=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(dt,{}),e[2]=f):f=e[2];let h;e[3]!==d||e[4]!==o?(h=t.jsx(ke,{icon:d,name:o,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=d,e[4]=o,e[5]=h):h=e[5];let c;e[6]!==s.control?(c=t.jsx(fe,{control:s.control,name:"status",render:Bt}),e[6]=s.control,e[7]=c):c=e[7];let i;e[8]!==h||e[9]!==c?(i=t.jsxs("div",{className:"flex items-start justify-between",children:[h,c]}),e[8]=h,e[9]=c,e[10]=i):i=e[10];let a;e[11]!==s.control?(a=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(fe,{control:s.control,name:"title",render:Ot}),t.jsx(fe,{control:s.control,name:"description",render:Gt})]}),e[11]=s.control,e[12]=a):a=e[12];let m;e[13]!==i||e[14]!==a?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[i,a]}),e[13]=i,e[14]=a,e[15]=m):m=e[15];let r;e[16]!==s.control?(r=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(fe,{control:s.control,name:"tool_selection_mode",render:Mt}),t.jsx(fe,{control:s.control,name:"tool_selection_strategy",render:Ft})]}),e[16]=s.control,e[17]=r):r=e[17];let j;e[18]!==m||e[19]!==r?(j=t.jsxs("div",{className:"flex flex-col",children:[m,r]}),e[18]=m,e[19]=r,e[20]=j):j=e[20];let x;e[21]!==s||e[22]!==j?(x=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(ht,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=x):x=e[23];let p;e[24]!==n.id||e[25]!==n.title?(p=n.title||`hub-${n.id.slice(0,8)}`,e[24]=n.id,e[25]=n.title,e[26]=p):p=e[26];const y=`${window.location.origin}/mcp/gateway/${n.id}`;let b;e[27]!==p||e[28]!==y?(b=t.jsx("div",{className:"p-5",children:t.jsx(Rt,{serverName:p,gatewayUrl:y})}),e[27]=p,e[28]=y,e[29]=b):b=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=w):w=e[30];let g;e[31]!==n.updated_at?(g=n.updated_at?yt(new Date(n.updated_at),{addSuffix:!1}):"Unknown",e[31]=n.updated_at,e[32]=g):g=e[32];let v;e[33]!==g?(v=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=v):v=e[34];let C;e[35]!==b||e[36]!==v?(C=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[b,v]}),e[35]=b,e[36]=v,e[37]=C):C=e[37];let _;return e[38]!==x||e[39]!==C?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[x,C]}),e[38]=x,e[39]=C,e[40]=_):_=e[40],_}function Ft(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Me,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(W,{children:t.jsxs(Z,{children:[t.jsx(X,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Hub strategy help",children:t.jsx(He,{size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(Ge,{value:e.value,onValueChange:e.onChange,children:[t.jsx(pe,{children:t.jsx(Oe,{className:"w-[180px]",children:t.jsx(Be,{})})}),t.jsxs(Ue,{children:[t.jsx(he,{value:"passthrough",children:"Passthrough"}),t.jsx(he,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(he,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(ge,{})]})}function Mt(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Me,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(W,{children:t.jsxs(Z,{children:[t.jsx(X,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(He,{size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{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(Ge,{value:e.value,onValueChange:e.onChange,children:[t.jsx(pe,{children:t.jsx(Oe,{className:"w-[180px]",children:t.jsx(Be,{})})}),t.jsxs(Ue,{children:[t.jsx(he,{value:"inclusion",children:"Include Selected"}),t.jsx(he,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(ge,{})]})}function Gt(l){const{field:e}=l;return t.jsxs(xe,{className:"w-full space-y-0",children:[t.jsx(pe,{children:t.jsx(Ie,{...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(ge,{})]})}function Ot(l){const{field:e}=l;return t.jsxs(xe,{className:"w-full space-y-0",children:[t.jsx(pe,{children:t.jsx(Ie,{...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:"Hub Name"})}),t.jsx(ge,{})]})}function Bt(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(pe,{children:t.jsx(rt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(ge,{})]})}function Ut(l){const e=U.c(75),{gateway:s,gatewayId:n,requestedTabId:d}=l,f=We().location.href,h=Ze();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/gateways/$gatewayId"},e[0]=c):c=e[0];const i=Ve(c),a=at();let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m={},e[1]=m):m=e[1];const r=Ae(m);let j;e[2]!==r?(j=r.map(Lt),e[2]=r,e[3]=j):j=e[3];const x=j,{promptsMap:p}=mt(x),{resourcesMap:y}=ut(x);let b;if(e[4]!==r){b=new Map;for(const k of r)k.tools&&k.tools.length>0&&b.set(k.id,k.tools.map(Ht));e[4]=r,e[5]=b}else b=e[5];let w;e[6]!==b||e[7]!==s?(w=()=>ze(s,b),e[6]=b,e[7]=s,e[8]=w):w=e[8];const[g,v]=I.useState(w);let C;e[9]!==s?(C=()=>Re(s),e[9]=s,e[10]=C):C=e[10];const[_,N]=I.useState(C);let V;e[11]!==s?(V=()=>Ee(s),e[11]=s,e[12]=V):V=e[12];const[E,O]=I.useState(V),[q,M]=I.useState(!1);let F;e[13]===Symbol.for("react.memo_cache_sentinel")?(F=k=>{v(k),M(!0)},e[13]=F):F=e[13];const u=F;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=k=>{N(k),M(!0)},e[14]=S):S=e[14];const $=S;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=k=>{O(k),M(!0)},e[15]=P):P=e[15];const A=P;let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=Xe(Vt),e[16]=z):z=e[16];const R=s.tool_selection_mode??"inclusion",D=s.tool_selection_strategy??"passthrough";let B;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==R||e[21]!==D?(B={resolver:z,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:R,tool_selection_strategy:D}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=R,e[21]=D,e[22]=B):B=e[22];const T=Ye(B),Q=T.formState.isDirty||q;let L;e[23]!==a.update||e[24]!==b||e[25]!==T||e[26]!==n||e[27]!==E||e[28]!==_||e[29]!==g?(L=async()=>{const k=T.getValues(),_e=At(g,_,E,b);await a.update.mutateAsync({id:n,data:{title:k.title,description:k.description,status:k.status,tool_selection_mode:k.tool_selection_mode,tool_selection_strategy:k.tool_selection_strategy,connections:_e}}),T.reset(k),M(!1)},e[23]=a.update,e[24]=b,e[25]=T,e[26]=n,e[27]=E,e[28]=_,e[29]=g,e[30]=L):L=e[30];const ee=L;let te;e[31]!==b||e[32]!==T||e[33]!==s?(te=()=>{T.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",tool_selection_strategy:s.tool_selection_strategy??"passthrough"}),v(ze(s,b)),N(Re(s)),O(Ee(s)),M(!1)},e[31]=b,e[32]=T,e[33]=s,e[34]=te):te=e[34];const me=te;let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[35]=J):J=e[35];const je=J,G=je.some(k=>k.id===d)?d:"settings";let be;e[36]!==i?(be=k=>{i({search:_e=>({..._e,tab:k}),replace:!0})},e[36]=i,e[37]=be):be=e[37];const Ce=be,ue=a.update.isPending;let se;e[38]!==h.history?(se=()=>h.history.back(),e[38]=h.history,e[39]=se):se=e[39];let le;e[40]!==G||e[41]!==Ce?(le=t.jsx(jt,{children:t.jsx(xt,{tabs:je,activeTab:G,onTabChange:Ce})}),e[40]=G,e[41]=Ce,e[42]=le):le=e[42];let ne;e[43]!==me||e[44]!==ee||e[45]!==Q||e[46]!==ue?(ne=Q&&t.jsxs(t.Fragment,{children:[t.jsx(W,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(X,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ue,onClick:me,"aria-label":"Cancel",children:t.jsx(gt,{size:14})})})}),t.jsx(Y,{side:"bottom",children:"Cancel"})]})}),t.jsx(W,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(X,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ue,onClick:ee,"aria-label":"Save",children:ue?t.jsx(we,{size:14,className:"animate-spin"}):t.jsx(Le,{size:14})})})}),t.jsx(Y,{side:"bottom",children:"Save"})]})})]}),e[43]=me,e[44]=ee,e[45]=Q,e[46]=ue,e[47]=ne):ne=e[47];const Se=s.icon??"cpu_chip";let oe;e[48]!==s.title||e[49]!==Se||e[50]!==f?(oe=t.jsx(ot,{title:s.title,url:f,icon:Se}),e[48]=s.title,e[49]=Se,e[50]=f,e[51]=oe):oe=e[51];let ie;e[52]!==ne||e[53]!==oe?(ie=t.jsxs(bt,{children:[ne,oe]}),e[52]=ne,e[53]=oe,e[54]=ie):ie=e[54];let ve;e[55]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(we,{size:32,className:"animate-spin text-muted-foreground"})}),e[55]=ve):ve=e[55];let re;e[56]!==G||e[57]!==p||e[58]!==y||e[59]!==T||e[60]!==s||e[61]!==E||e[62]!==_||e[63]!==g?(re=G==="settings"?t.jsx(Dt,{form:T,gateway:s,icon:s.icon}):G==="tools"?t.jsx(it,{toolSet:g,onToolSetChange:u}):G==="resources"?t.jsx($t,{resourceSet:_,onResourceSetChange:$,connectionResources:y}):G==="prompts"?t.jsx(wt,{promptSet:E,onPromptSetChange:A,connectionPrompts:p}):null,e[56]=G,e[57]=p,e[58]=y,e[59]=T,e[60]=s,e[61]=E,e[62]=_,e[63]=g,e[64]=re):re=e[64];let ce;e[65]!==re?(ce=t.jsx(I.Suspense,{fallback:ve,children:re}),e[65]=re,e[66]=ce):ce=e[66];let ae;e[67]!==G||e[68]!==ce?(ae=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(De,{children:ce},G)})})}),e[67]=G,e[68]=ce,e[69]=ae):ae=e[69];let ye;return e[70]!==se||e[71]!==le||e[72]!==ie||e[73]!==ae?(ye=t.jsxs(vt,{onBack:se,children:[le,ie,ae]}),e[70]=se,e[71]=le,e[72]=ie,e[73]=ae,e[74]=ye):ye=e[74],ye}function Ht(l){return l.name}function Lt(l){return l.id}function Jt(){const l=U.c(10);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},l[0]=e):e=l[0];const s=Ve(e);let n;l[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/gateways/$gatewayId"},l[1]=n):n=l[1];const{gatewayId:d,org:o}=qe(n);let f;l[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},l[2]=f):f=l[2];const c=Qe(f).tab||"settings",i=ct(d);if(!i){let m;return l[3]!==s||l[4]!==o?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(et,{title:"Hub not found",description:"This Hub may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:o}}),children:"Back to gateways"})})}),l[3]=s,l[4]=o,l[5]=m):m=l[5],m}let a;return l[6]!==i||l[7]!==d||l[8]!==c?(a=t.jsx(Ut,{gateway:i,gatewayId:d,requestedTabId:c}),l[6]=i,l[7]=d,l[8]=c,l[9]=a):a=l[9],a}function qt(){const l=U.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(De,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(we,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Jt,{})})}),l[0]=e):e=l[0],e}function ys(){const l=U.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qt,{}),l[0]=e):e=l[0],e}export{ys as default};