@decocms/mesh 2.17.2 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Dvl19Bxu.js → AlertCircle-CahACZDg.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CNcRcLHi.js → ArrowLeft-DlLOWSTj.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dj1nFRfD.js → ArrowUp-Ck0taqJi.js} +1 -1
- package/dist/client/assets/{Check-MZfXJ4EP.js → Check-Cjgi2ZiG.js} +1 -1
- package/dist/client/assets/{ChevronDown-BPwd0ESk.js → ChevronDown-BuVzyKHq.js} +1 -1
- package/dist/client/assets/{Code01-ZM8AfORO.js → Code01-XpAoNs3W.js} +1 -1
- package/dist/client/assets/{Copy01-DoisEbOD.js → Copy01-De4SwxDv.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-2xfLjpUM.js → DotsHorizontal-D-Bv2U6B.js} +1 -1
- package/dist/client/assets/{DotsVertical-CRTSoELg.js → DotsVertical-BhTwPxq7.js} +1 -1
- package/dist/client/assets/{Download01-DzrQfwIZ.js → Download01-DhkFfGKV.js} +1 -1
- package/dist/client/assets/{Edit01-BVpBBN26.js → Edit01-DsRHb45T.js} +1 -1
- package/dist/client/assets/{File06-DvtIjhz0.js → File06-BiIPMtEV.js} +1 -1
- package/dist/client/assets/{FilterLines-DkNJkoIH.js → FilterLines-C_UJwG_t.js} +1 -1
- package/dist/client/assets/{FlipBackward-938bk6QK.js → FlipBackward-CQnTJKeB.js} +1 -1
- package/dist/client/assets/{GitBranch01-HnfHVRyp.js → GitBranch01-ClS9Bk6n.js} +1 -1
- package/dist/client/assets/{Grid01-tEwYXVxO.js → Grid01-CRALWbj6.js} +1 -1
- package/dist/client/assets/{Home02-9SuE7ucu.js → Home02-ofwnyeoV.js} +1 -1
- package/dist/client/assets/{Image01-vvKwvz0g.js → Image01-Cb4gQMH4.js} +1 -1
- package/dist/client/assets/{Inbox01-Cekk6aOf.js → Inbox01-CKGdnZFH.js} +1 -1
- package/dist/client/assets/{InfoCircle-BXonO5qh.js → InfoCircle-_4UsKVMw.js} +1 -1
- package/dist/client/assets/{Key01-DqRe3I-7.js → Key01-BFJBGJng.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BGOs7vaA.js → LinkExternal01-C1dAUI0b.js} +1 -1
- package/dist/client/assets/{List-j3ISho_T.js → List-DOmOO2Cw.js} +1 -1
- package/dist/client/assets/{Loading01-ByRd3GAn.js → Loading01-JwelopeC.js} +1 -1
- package/dist/client/assets/{Lock01-BYKl-IKI.js → Lock01-B7TIX2sZ.js} +1 -1
- package/dist/client/assets/{Play-DqeIwNA2.js → Play-CMKLF_6n.js} +1 -1
- package/dist/client/assets/{Plus-B6dO5J-T.js → Plus-Df2M6Ns2.js} +1 -1
- package/dist/client/assets/{SearchMd-RcsY4Qc3.js → SearchMd-Cgfgcbdz.js} +1 -1
- package/dist/client/assets/{Terminal-CM4NRPaq.js → Terminal-C8LHfiOW.js} +1 -1
- package/dist/client/assets/{Trash01-RdHotUor.js → Trash01-KvZ0cVo9.js} +1 -1
- package/dist/client/assets/{Upload01-B5lhw8CF.js → Upload01-TiwmYxO-.js} +1 -1
- package/dist/client/assets/{X-JFPiVUa4.js → X-DhyaYbLb.js} +1 -1
- package/dist/client/assets/{XClose-d9N07C9C.js → XClose-2bShEltc.js} +1 -1
- package/dist/client/assets/{alert-dialog-DIpJg2Aj.js → alert-dialog-gZhceV_v.js} +2 -2
- package/dist/client/assets/{auth-catchall-B2l1mrMK.js → auth-catchall-Dz8qCpUP.js} +1 -1
- package/dist/client/assets/{avatar-C9xlNN_x.js → avatar-d8M8JpvZ.js} +1 -1
- package/dist/client/assets/{badge--29UzF2m.js → badge-CKe-ib_i.js} +1 -1
- package/dist/client/assets/{binder-nBmgAoSK.js → binder-iKe3ndXq.js} +1 -1
- package/dist/client/assets/{button-CJFU-RdP.js → button-DXl1hVqx.js} +1 -1
- package/dist/client/assets/{card-BARP50i4.js → card-D0GcpRPY.js} +1 -1
- package/dist/client/assets/{checkbox-D4qUNjlU.js → checkbox-D1tHbcIN.js} +1 -1
- package/dist/client/assets/{collection-detail-DBx57h0R.js → collection-detail-BQkjgYb7.js} +1 -1
- package/dist/client/assets/{collection-display-button-DWT4ZvIF.js → collection-display-button-B_KC-ent.js} +1 -1
- package/dist/client/assets/{collection-header-DiGbkMTg.js → collection-header-BA9HTLmg.js} +1 -1
- package/dist/client/assets/{collection-page-b1I6uH8W.js → collection-page-CDkTC45g.js} +1 -1
- package/dist/client/assets/{collection-search-D3Bd0Mm5.js → collection-search-pUdl1eNx.js} +1 -1
- package/dist/client/assets/{collection-tab-V_ZAHQk2.js → collection-tab-BofyxU3Y.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DToPOpkG.js → collection-table-wrapper-wARoPZXo.js} +1 -1
- package/dist/client/assets/{connection-Cgb7Z5-V.js → connection-ByVJuREK.js} +1 -1
- package/dist/client/assets/{connection-card-B6jH4I7L.js → connection-card-DjK0GZ2u.js} +1 -1
- package/dist/client/assets/{connection-detail-DOeKZy2u.js → connection-detail-BGizcg4Z.js} +1 -1
- package/dist/client/assets/{connections-DIPInEqh.js → connections-B3vaIw3-.js} +1 -1
- package/dist/client/assets/constants-DQVDVC-J.js +1 -0
- package/dist/client/assets/{create-organization-dialog-BCm-rEBq.js → create-organization-dialog-DKwU0dfN.js} +1 -1
- package/dist/client/assets/{dialog-DVaRsY11.js → dialog-1B3YWWMu.js} +1 -1
- package/dist/client/assets/{dropdown-menu-L8DDYrma.js → dropdown-menu-Hp4qYTud.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BGqw6KSh.js → dynamic-plugin-layout-j2gEmQEr.js} +1 -1
- package/dist/client/assets/{empty-state-DSfHkDug.js → empty-state-C7Gr5Tg2.js} +1 -1
- package/dist/client/assets/{empty-state-DltMEOY9.js → empty-state-D-JjObLi.js} +1 -1
- package/dist/client/assets/{env-vars-editor-OFOnChaG.js → env-vars-editor-D4XTsyk0.js} +1 -1
- package/dist/client/assets/{error-boundary-BcexB_yc.js → error-boundary-rr4tK3fB.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CdV5tpm8.js → extract-connection-data-37AfzoCx.js} +1 -1
- package/dist/client/assets/{file-browser-lBeJR8bC.js → file-browser-BECnO7FM.js} +2 -2
- package/dist/client/assets/{form-0xzFj1MQ.js → form-BQupN7IV.js} +1 -1
- package/dist/client/assets/{gateway-detail-BjMZrPhA.js → gateway-detail-B1f7bt6s.js} +1 -1
- package/dist/client/assets/{gateways-Los1KR32.js → gateways-jpQl136Z.js} +1 -1
- package/dist/client/assets/{grid-view-5k-Ei6pR.js → grid-view-BwLKimb0.js} +1 -1
- package/dist/client/assets/{home-BPOuMXWN.js → home-9vMYPTYi.js} +1 -1
- package/dist/client/assets/{index-sGJO5Tbg.js → index-Bpy9plQL.js} +1 -1
- package/dist/client/assets/{index-Wmq2F9D5.js → index-D0CzZUCs.js} +1 -1
- package/dist/client/assets/{index-B2ZzxrDd.js → index-DEuqpeVv.js} +2 -2
- package/dist/client/assets/index-DVolwMvn.js +107 -0
- package/dist/client/assets/index-Dh9ePU0t.css +1 -0
- package/dist/client/assets/{index-DYB_vmtw.js → index-u_K3efbu.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-2ElA8vy3.js → infiniteQueryObserver-BXdaScti.js} +1 -1
- package/dist/client/assets/{input-BptR4gs0.js → input-CqqzkfyF.js} +1 -1
- package/dist/client/assets/{layout-CuyqJIpj.js → layout-D7T4rJzl.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-BsXV5-Cp.js → lazy-highlighter-U-fd28FU.js} +1 -1
- package/dist/client/assets/{localstorage-keys-1ChkoQpJ.js → localstorage-keys-kemGZMIp.js} +1 -1
- package/dist/client/assets/{login-9aWtH8iv.js → login-AsctHrUh.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DlEOJMOg.js → mcp-oauth-DqZqwRXe.js} +1 -1
- package/dist/client/assets/{mcp-server-card-QpfLcKhp.js → mcp-server-card-DfoQ5M8z.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-C1ZMmcCI.js → mcp-server-detail-GLsULv7B.js} +1 -1
- package/dist/client/assets/{members-BivX1Wff.js → members-eia2aN0I.js} +1 -1
- package/dist/client/assets/{monaco-editor-eqnLepiA.js → monaco-editor-rl0nEzOU.js} +1 -1
- package/dist/client/assets/{monitoring-CsAomsG7.js → monitoring-DWEGkU9y.js} +1 -1
- package/dist/client/assets/{oauth-callback-tqvl2JmB.js → oauth-callback-BFr0fBNT.js} +1 -1
- package/dist/client/assets/{page-9g38EhhR.js → page-BeG_Zpat.js} +1 -1
- package/dist/client/assets/page-GoE2bJQh.js +21 -0
- package/dist/client/assets/{pin-to-sidebar-button-SoohzyKD.js → pin-to-sidebar-button-CrzVxc9I.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-B7nLCaEJ.js → plugin-empty-state-CvQbqnfg.js} +1 -1
- package/dist/client/assets/{plugin-header-Cohl5yJx.js → plugin-header-BaWUIpLx.js} +1 -1
- package/dist/client/assets/{plugins-B4XhV1NA.js → plugins-Q7uqmYFh.js} +1 -1
- package/dist/client/assets/{popover-DMQ4A4gY.js → popover-BcOo6EXw.js} +1 -1
- package/dist/client/assets/{project-context-provider-CwANTiF8.js → project-context-provider-Dn1-l4h2.js} +1 -1
- package/dist/client/assets/{registry-utils-CYM7CTQI.js → registry-utils-85b65tFI.js} +1 -1
- package/dist/client/assets/{resizable-DPX1GbOQ.js → resizable-DkFmgcsj.js} +1 -1
- package/dist/client/assets/{resource-tabs-s8Be9X3Q.js → resource-tabs-DkDSMlFB.js} +1 -1
- package/dist/client/assets/{select-ChLkm3Du.js → select-Bv7J3zlQ.js} +1 -1
- package/dist/client/assets/{settings-CtF0WgEW.js → settings-BK8QvMDL.js} +1 -1
- package/dist/client/assets/shell-layout-DImgzYtx.js +3 -0
- package/dist/client/assets/{spinner-CwrVDgbN.js → spinner-D0hdWfev.js} +1 -1
- package/dist/client/assets/{switch-CcWa_MNs.js → switch-ugX7u7WU.js} +1 -1
- package/dist/client/assets/{textarea-DvOGbg2w.js → textarea-BUrXtpl5.js} +1 -1
- package/dist/client/assets/{tool-set-selector-CcjC51rS.js → tool-set-selector-a1uFioE0.js} +1 -1
- package/dist/client/assets/{tools-list-CZQCbddf.js → tools-list-DpFBj-bw.js} +1 -1
- package/dist/client/assets/{tooltip-BZp1NNfI.js → tooltip-vUrxHIt0.js} +1 -1
- package/dist/client/assets/typewriter-title-7_SusDya.js +16 -0
- package/dist/client/assets/{use-binding-kpHhQeiR.js → use-binding-B0VMz_Ex.js} +1 -1
- package/dist/client/assets/{use-collections-BI8SI9I-.js → use-collections-Cflasxiq.js} +1 -1
- package/dist/client/assets/{use-connection-By0HWGmn.js → use-connection-DhRUkVvI.js} +1 -1
- package/dist/client/assets/{use-connection-resources-CIndv_xt.js → use-connection-resources-C-wyp48q.js} +1 -1
- package/dist/client/assets/{use-create-gateway-DpNvhifN.js → use-create-gateway-DMkdPgfy.js} +1 -1
- package/dist/client/assets/{use-gateway-BzFnbg51.js → use-gateway-D5VVN1xE.js} +1 -1
- package/dist/client/assets/{use-gateway-system-prompt-DKg33ZMa.js → use-gateway-system-prompt-B3fSaA6r.js} +1 -1
- package/dist/client/assets/{use-list-state-cqgmpDXc.js → use-list-state-BYREPRxy.js} +1 -1
- package/dist/client/assets/{use-mcp-BY7dWO4N.js → use-mcp-CZeMxRgK.js} +1 -1
- package/dist/client/assets/{use-members-DuUTyG85.js → use-members-Bi0eIvBO.js} +1 -1
- package/dist/client/assets/{use-mobile-DHVQc88b.js → use-mobile-CI2w7svc.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C3rL2iPZ.js → use-organization-settings-D0kNSjbq.js} +1 -1
- package/dist/client/assets/{use-tool-call-CuYepGvY.js → use-tool-call-CoI4ZCZe.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-ckN_t7ea.js +1 -0
- package/dist/client/assets/{useMutation-Lj6qQmhH.js → useMutation-xcmVYLP7.js} +1 -1
- package/dist/client/assets/useQuery-BKyLWvSZ.js +1 -0
- package/dist/client/assets/{value-Cetx24MZ.js → value-C7rJ457O.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Df6PEFKi.js → view-mode-toggle-CTWk8Dkt.js} +1 -1
- package/dist/client/assets/{workflow-DiN6vHw9.js → workflow-ClKgdB2v.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/MessageChatSquare-Dfdgo-IV.js +0 -1
- package/dist/client/assets/constants-CRsABbUy.js +0 -1
- package/dist/client/assets/index-CCciYu2S.css +0 -1
- package/dist/client/assets/index-LUG2SkNP.js +0 -107
- package/dist/client/assets/page-DF7HRrxe.js +0 -35
- package/dist/client/assets/shell-layout-CF_ayOPu.js +0 -17
- package/dist/client/assets/useInfiniteQuery-Dbym_GhP.js +0 -1
- package/dist/client/assets/useQuery-DVzj5fVO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as S,_ as ye,y as re,I as U,z as _,c as R,j as t,f as Fe,d as tt,b as st,k as ot,af as lt,B as nt,E as it,t as Ae}from"./index-B2ZzxrDd.js";import{I as Ee,E as rt}from"./empty-state-DSfHkDug.js";import{E as Ve}from"./error-boundary-BcexB_yc.js";import{C as Ge}from"./checkbox-D4qUNjlU.js";import{c as H,B as V}from"./button-CJFU-RdP.js";import{i as at}from"./ArrowLeft-CNcRcLHi.js";import{u as We}from"./use-connection-By0HWGmn.js";import{C as ct}from"./collection-search-D3Bd0Mm5.js";import{I as Pe}from"./input-BptR4gs0.js";import{s as dt}from"./Plus-B6dO5J-T.js";import{i as mt}from"./X-JFPiVUa4.js";import{P as ut}from"./pin-to-sidebar-button-SoohzyKD.js";import{T as ft}from"./tool-set-selector-CcjC51rS.js";import{b as ht,a as xt,i as pt}from"./use-gateway-BzFnbg51.js";import{u as gt,a as bt}from"./use-connection-resources-CIndv_xt.js";import{u as jt}from"./use-gateway-system-prompt-DKg33ZMa.js";import{s as He}from"./slugify-CEUa2lfQ.js";import{B as qe}from"./badge--29UzF2m.js";import{a as yt,D as vt,c as St,d as Nt}from"./dialog-DVaRsY11.js";import{F as be,a as _t,b as ve,d as Se,f as Ne,c as wt}from"./form-0xzFj1MQ.js";import{I as Ct,R as kt,a as It}from"./index-DYB_vmtw.js";import{R as Tt}from"./resource-tabs-s8Be9X3Q.js";import{S as $t,a as Rt,b as zt,c as At,d as Ue}from"./select-ChLkm3Du.js";import{S as Et}from"./switch-CcWa_MNs.js";import{T as Pt}from"./textarea-DvOGbg2w.js";import{a as Z,c as Y,b as J,T as Q}from"./tooltip-BZp1NNfI.js";import{i as Ze}from"./Check-MZfXJ4EP.js";import{i as Mt}from"./Code01-ZM8AfORO.js";import{a as Dt}from"./Copy01-DoisEbOD.js";import{i as Ut}from"./FlipBackward-938bk6QK.js";import{i as je}from"./InfoCircle-BXonO5qh.js";import{i as ze}from"./Loading01-ByRd3GAn.js";import{a as Lt,V as Ot,b as Bt}from"./layout-CuyqJIpj.js";import"./connection-Cgb7Z5-V.js";import"./project-context-provider-CwANTiF8.js";import"./use-collections-BI8SI9I-.js";import"./useMutation-Lj6qQmhH.js";import"./SearchMd-RcsY4Qc3.js";import"./use-organization-settings-C3rL2iPZ.js";import"./localstorage-keys-1ChkoQpJ.js";import"./useQuery-DVzj5fVO.js";import"./ChevronDown-BPwd0ESk.js";const Ye=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Ye.displayName="ArrowsRight";const Je=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Je.displayName="Circle";const Qe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));Qe.displayName="Lightbulb02";const Ke=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Ke.displayName="Save01";const Xe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));Xe.displayName="Share07";const Me=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ft=re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:U(_()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:U(_()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Vt=re({id:_().describe("Unique identifier for the gateway"),title:_().describe("Human-readable name for the gateway"),description:_().nullable().describe("Description of the gateway"),icon:_().nullable().optional().describe("Icon URL for the gateway"),created_at:_().describe("When the gateway was created"),updated_at:_().describe("When the gateway was last updated"),created_by:_().describe("User ID who created the gateway"),updated_by:_().optional().describe("User ID who last updated the gateway"),organization_id:_().describe("Organization ID this gateway belongs to"),tool_selection_mode:Me.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),connections:U(Ft).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});re({title:_().min(1).max(255).describe("Name for the gateway"),description:_().nullable().optional().describe("Optional description"),tool_selection_mode:Me.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:_().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});re({title:_().min(1).max(255).optional().describe("New name"),description:_().nullable().optional().describe("New description (null to clear)"),tool_selection_mode:Me.optional().describe("New tool selection mode"),icon:_().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Gt=S.memo(function(e){const s=R.c(20),{connection:l,isSelected:i,hasItemsEnabled:n,activeItemsCount:a,totalItemsCount:c,onSelect:m,onToggle:r}=e,d=i?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==d?(u=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=u):u=s[1];let f;s[2]!==l.icon||s[3]!==l.title?(f=t.jsx(Ee,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=f):f=s[4];let p;s[5]!==l.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=p):p=s[6];let x;s[7]!==m||s[8]!==f||s[9]!==p?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[f,p]}),s[7]=m,s[8]=f,s[9]=p,s[10]=x):x=s[10];let g;s[11]!==a||s[12]!==n||s[13]!==r||s[14]!==c?(g=c>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[a,"/",c]}),t.jsx(Ge,{checked:n,onCheckedChange:r,onClick:Ht})]}),s[11]=a,s[12]=n,s[13]=r,s[14]=c,s[15]=g):g=s[15];let y;return s[16]!==u||s[17]!==x||s[18]!==g?(y=t.jsxs("div",{className:u,children:[x,g]}),s[16]=u,s[17]=x,s[18]=g,s[19]=y):y=s[19],y}),Wt=S.memo(function(e){const s=R.c(18),{connectionId:l,item:i,isSelected:n,onToggle:a}=e,c=`item-${l}-${i.id}`,m=n?"text-foreground":"text-muted-foreground";let r;s[0]!==m?(r=H("text-sm font-medium",m),s[0]=m,s[1]=r):r=s[1];let d;s[2]!==i.name||s[3]!==r?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:i.name})}),s[2]=i.name,s[3]=r,s[4]=d):d=s[4];let u;s[5]!==i.description?(u=i.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.description}),s[5]=i.description,s[6]=u):u=s[6];let f;s[7]!==d||s[8]!==u?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),s[7]=d,s[8]=u,s[9]=f):f=s[9];const p=`item-${l}-${i.id}`;let x;s[10]!==n||s[11]!==a||s[12]!==p?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ge,{id:p,checked:n,onCheckedChange:a,onClick:qt})}),s[10]=n,s[11]=a,s[12]=p,s[13]=x):x=s[13];let g;return s[14]!==c||s[15]!==f||s[16]!==x?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[f,x]}),s[14]=c,s[15]=f,s[16]=x,s[17]=g):g=s[17],g});function et({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:i,extraContent:n}){const[a,c]=S.useState(""),m=S.useDeferredValue(a),[r,d]=S.useState("all"),[u,f]=S.useState(!1),p=S.useRef(new Set(Object.keys(o))),x=We({searchTerm:m.trim()||void 0}),g=p.current,y=[...g.values()].map(h=>x.find(N=>N.id===h)).filter(h=>h!==void 0),j=x.filter(h=>!g.has(h.id)),v=[...y,...j],b=h=>{const N=o[h];return N!==void 0&&N.length>0},w=v.filter(h=>{if(r==="all")return!0;const N=b(h.id);return r==="selected"?N:r==="unselected"?!N:!0}),[I,k]=S.useState(v[0]?.id??null),C=I?v.find(h=>h.id===I)??null:null,P=C?s(C):[],E=(h,N)=>o[h]?.includes(N)??!1,L=(h,N)=>{const z=o[h]??[],$=z.includes(N),G={...o};if($){const W=z.filter(q=>q!==N);W.length===0?delete G[h]:G[h]=W}else G[h]=[...z,N];e(G)},B=h=>{const N=v.find(F=>F.id===h);if(!N)return;const z=s(N);if(z.length===0)return;const $=o[h]??[],G=z.map(F=>F.id),W=$.length>0&&G.every(F=>$.includes(F)),q={...o};W?delete q[h]:(q[h]=G,k(h)),e(q)},A=h=>{k(h),f(!0)},M=()=>{f(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(ct,{value:a,onChange:c,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:a?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:w.map(h=>{const z=s(h).length,$=o[h.id]?.length??0;return t.jsx(Gt,{connection:h,isSelected:I===h.id,hasItemsEnabled:b(h.id),activeItemsCount:$,totalItemsCount:z,onSelect:()=>A(h.id),onToggle:()=>B(h.id)},h.id)})})})]}),t.jsx("div",{className:H("flex-1 flex-col",u?"flex":"hidden md:flex"),children:C?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:M,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(at,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Ee,{icon:C.icon,name:C.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),n,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:P.map(h=>t.jsx(Wt,{connectionId:C.id,item:h,isSelected:E(C.id,h.id),onToggle:()=>L(C.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function Ht(o){return o.stopPropagation()}function qt(o){return o.stopPropagation()}function Zt(o){const e=R.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:i}=o;let n;e[0]!==i?(n=m=>(i.get(m.id)??[]).map(Yt),e[0]=i,e[1]=n):n=e[1];const a=n;let c;return e[2]!==a||e[3]!==l||e[4]!==s?(c=t.jsx(et,{itemSet:s,onItemSetChange:l,getItems:a,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=a,e[3]=l,e[4]=s,e[5]=c):c=e[5],c}function Yt(o){return{id:o.name,name:o.name,description:o.description}}function Jt(o){return o.includes("*")}function Qt(o){const e=R.c(27),{patterns:s,onAddPattern:l,onRemovePattern:i}=o,[n,a]=S.useState("");let c;e[0]!==n||e[1]!==l||e[2]!==s?(c=()=>{const f=n.trim();f&&!s.includes(f)&&(l(f),a(""))},e[0]=n,e[1]=l,e[2]=s,e[3]=c):c=e[3];const m=c;let r;e[4]!==m?(r=f=>{f.key==="Enter"&&(f.preventDefault(),m())},e[4]=m,e[5]=r):r=e[5];const d=r;let u;if(e[6]!==m||e[7]!==d||e[8]!==n||e[9]!==i||e[10]!==s){const f=s.filter(Jt);let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("code",{children:"*"}),e[12]=p):p=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",p," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=k=>a(k.target.value),e[14]=g):g=e[14];let y;e[15]!==d||e[16]!==n?(y=t.jsx(Pe,{value:n,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=n,e[17]=y):y=e[17];let j;e[18]!==n?(j=n.trim(),e[18]=n,e[19]=j):j=e[19];const v=!j;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(dt,{size:16}),e[20]=b):b=e[20];let w;e[21]!==m||e[22]!==v?(w=t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=w):w=e[23];let I;e[24]!==w||e[25]!==y?(I=t.jsxs("div",{className:"flex gap-2",children:[y,w]}),e[24]=w,e[25]=y,e[26]=I):I=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,I,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(k=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:k}),t.jsx("button",{type:"button",onClick:()=>i(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(mt,{size:12})})]},k))})]}),e[6]=m,e[7]=d,e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];return u}function Kt(o){const e=R.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:i}=o,[n]=S.useState(null);let a;e[0]!==i?(a=b=>(i.get(b.id)??[]).map(Xt),e[0]=i,e[1]=a):a=e[1];const c=a;let m;e[2]!==l||e[3]!==s?(m=(b,w)=>{const I=s[b]??[];I.includes(w)||l({...s,[b]:[...I,w]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const r=m;let d;e[5]!==l||e[6]!==s?(d=(b,w)=>{const k=(s[b]??[]).filter(C=>C!==w);if(k.length===0){const C={...s};delete C[b],l(C)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=d):d=e[7];const u=d;let f;e[8]!==l?(f=b=>{l(b)},e[8]=l,e[9]=f):f=e[9];const p=f;let x;e[10]!==s||e[11]!==n?(x=n?s[n]??[]:[],e[10]=s,e[11]=n,e[12]=x):x=e[12];const g=x;let y;e[13]!==r||e[14]!==u||e[15]!==n||e[16]!==g?(y=n?t.jsx(Qt,{patterns:g,onAddPattern:b=>r(n,b),onRemovePattern:b=>u(n,b)}):null,e[13]=r,e[14]=u,e[15]=n,e[16]=g,e[17]=y):y=e[17];const j=y;let v;return e[18]!==j||e[19]!==c||e[20]!==p||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(et,{itemSet:s,onItemSetChange:p,getItems:c,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:j})}),e[18]=j,e[19]=c,e[20]=p,e[21]=s,e[22]=v):v=e[22],v}function Xt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function es(o){const e=R.c(8);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("grid gap-3",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==l||e[6]!==i?(n=t.jsx(kt,{"data-slot":"radio-group",className:i,...l}),e[5]=l,e[6]=i,e[7]=n):n=e[7],n}function Re(o){const e=R.c(9);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=i):i=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(It,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Je,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=n):n=e[5];let a;return e[6]!==l||e[7]!==i?(a=t.jsx(Ct,{"data-slot":"radio-group-item",className:i,...l,children:n}),e[6]=l,e[7]=i,e[8]=a):a=e[8],a}function ts(o){const s=new TextEncoder().encode(o),l=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(l)}const ss=Vt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0}).extend({title:_().min(1,"Name is required").max(255)});function Le(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const i=e.get(l.connection_id)??[];i.length>0&&(s[l.connection_id]=i)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Oe(o){const e={};for(const s of o.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function Be(o){const e={};for(const s of o.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function os(o,e,s,l){const i=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(i).map(n=>{const a=o[n]??[],c=l.get(n)??[],m=c.length>0&&c.every(r=>a.includes(r));return{connection_id:n,selected_tools:a.length===0||m?null:a,selected_resources:e[n]??null,selected_prompts:s[n]??null}})}function ls(o){const e=R.c(10),{gatewayUrl:s}=o,[l,i]=S.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),i(!0),Ae.success("Agent URL copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const a=n;let c;e[2]!==l?(c=l?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx(Dt,{size:20}),e[2]=l,e[3]=c):c=e[3];const m=l?"Copied!":"Copy URL";let r;e[4]!==m?(r=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==c||e[8]!==r?(d=t.jsxs(V,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,r]}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9],d}function ns(o){const e=R.c(7),{gatewayUrl:s,serverName:l}=o;let i;e[0]!==s||e[1]!==l?(i=()=>{const r=He(l),u=ts(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(r)}&config=${encodeURIComponent(u)}`;window.open(f,"_blank"),Ae.success("Opening Cursor...")},e[0]=s,e[1]=l,e[2]=i):i=e[2];const n=i;let a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),c=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=a,e[4]=c):(a=e[3],c=e[4]);let m;return e[5]!==n?(m=t.jsxs(V,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[5]=n,e[6]=m):m=e[6],m}function is(o){const e=R.c(11),{gatewayUrl:s,serverName:l}=o,[i,n]=S.useState(!1);let a;e[0]!==s||e[1]!==l?(a=async()=>{const f=He(l),x=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${f}" --config '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),n(!0),Ae.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a;let m;e[3]!==i?(m=i?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=i,e[4]=m):m=e[4];const r=i?"Copied!":"Install on Claude";let d;e[5]!==r?(d=t.jsx("span",{className:"text-xs font-medium",children:r}),e[5]=r,e[6]=d):d=e[6];let u;return e[7]!==c||e[8]!==m||e[9]!==d?(u=t.jsxs(V,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=c,e[8]=m,e[9]=d,e[10]=u):u=e[10],u}function rs(o){const e=R.c(40),{open:s,onOpenChange:l,gateway:i}=o,[n,a]=S.useState("code_execution");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=$=>{($==="passthrough"||$==="smart_tool_selection"||$==="code_execution")&&a($)},e[0]=c):c=e[0];const m=c;let r;e[1]!==i.id||e[2]!==n?(r=new URL(`/mcp/gateway/${i.id}`,window.location.origin),r.searchParams.set("mode",n),e[1]=i.id,e[2]=n,e[3]=r):r=e[3];let d;e[4]!==i.id||e[5]!==i.title?(d=i.title||`agent-${i.id.slice(0,8)}`,e[4]=i.id,e[5]=i.title,e[6]=d):d=e[6];const u=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(yt,{children:t.jsx(vt,{children:"Share Agent"})}),e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=p):p=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ye,{className:"size-5 text-muted-foreground"})}),e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[11]=y):y=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[x,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(Z,{children:t.jsxs(Y,{children:[y,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Re,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Qe,{className:"size-5 text-muted-foreground"})}),e[13]=v):v=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=b):b=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[15]=w):w=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[v,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[b,t.jsx(Z,{children:t.jsxs(Y,{children:[w,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Re,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=I):I=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Mt,{className:"size-5 text-muted-foreground"})}),e[17]=k):k=e[17];let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=C):C=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[19]=P):P=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[k,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[C,t.jsx(Z,{children:t.jsxs(Y,{children:[P,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Re,{id:"mode-code",value:"code_execution"}),t.jsx(qe,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=E):E=e[20];let L;e[21]!==n?(L=t.jsxs("div",{className:"flex flex-col gap-3",children:[p,t.jsxs(es,{value:n,onValueChange:m,className:"flex flex-col gap-4.5",children:[j,I,E]})]}),e[21]=n,e[22]=L):L=e[22];let B;e[23]!==r.href?(B=t.jsx(ls,{gatewayUrl:r.href}),e[23]=r.href,e[24]=B):B=e[24];let A,M;e[25]!==r.href||e[26]!==u?(A=t.jsx(ns,{gatewayUrl:r.href,serverName:u}),M=t.jsx(is,{gatewayUrl:r.href,serverName:u}),e[25]=r.href,e[26]=u,e[27]=A,e[28]=M):(A=e[27],M=e[28]);let h;e[29]!==B||e[30]!==A||e[31]!==M?(h=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[B,A,M]})}),e[29]=B,e[30]=A,e[31]=M,e[32]=h):h=e[32];let N;e[33]!==L||e[34]!==h?(N=t.jsxs(St,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[L,h]})]}),e[33]=L,e[34]=h,e[35]=N):N=e[35];let z;return e[36]!==l||e[37]!==s||e[38]!==N?(z=t.jsx(Nt,{open:s,onOpenChange:l,children:N}),e[36]=l,e[37]=s,e[38]=N,e[39]=z):z=e[39],z}function as(o){const e=R.c(31),{form:s,icon:l,gatewayId:i}=o,[n,a]=jt(i);let c;e[0]!==s?(c=s.watch("title")||"Agent",e[0]=s,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(pt,{}),e[2]=m):m=e[2];let r;e[3]!==l||e[4]!==c?(r=t.jsx(Ee,{icon:l,name:c,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=c,e[5]=r):r=e[5];let d;e[6]!==s.control?(d=t.jsx(be,{control:s.control,name:"status",render:us}),e[6]=s.control,e[7]=d):d=e[7];let u;e[8]!==r||e[9]!==d?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[r,d]}),e[8]=r,e[9]=d,e[10]=u):u=e[10];let f;e[11]!==s.control?(f=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:ms}),t.jsx(be,{control:s.control,name:"description",render:ds})]}),e[11]=s.control,e[12]=f):f=e[12];let p;e[13]!==u||e[14]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15];let x;e[16]!==s.control?(x=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(be,{control:s.control,name:"tool_selection_mode",render:cs})}),e[16]=s.control,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=g):g=e[18];let y;e[19]!==a?(y=w=>a(w.target.value),e[19]=a,e[20]=y):y=e[20];let j;e[21]!==n||e[22]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[g,t.jsx(Pt,{value:n,onChange:y,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=n,e[22]=y,e[23]=j):j=e[23];let v;e[24]!==j||e[25]!==p||e[26]!==x?(v=t.jsxs("div",{className:"flex flex-col",children:[p,x,j]}),e[24]=j,e[25]=p,e[26]=x,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(_t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function cs(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(wt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Z,{children:t.jsxs(Y,{children:[t.jsx(J,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(je,{size:14,className:"text-muted-foreground"})})}),t.jsx(Q,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs($t,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Se,{children:t.jsx(Rt,{className:"w-[180px]",children:t.jsx(zt,{})})}),t.jsxs(At,{children:[t.jsx(Ue,{value:"inclusion",children:"Include Selected"}),t.jsx(Ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Ne,{})]})}function ds(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Ne,{})]})}function ms(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Agent Name"})}),t.jsx(Ne,{})]})}function us(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qe,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Se,{children:t.jsx(Et,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ne,{})]})}function fs(o){const e=R.c(81),{gateway:s,gatewayId:l,requestedTabId:i}=o,a=ot().location.href,c=lt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const r=Fe(m),d=xt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const f=We(u);let p;e[2]!==f?(p=f.map(xs),e[2]=f,e[3]=p):p=e[3];const x=p,{promptsMap:g}=gt(x),{resourcesMap:y}=bt(x);let j;if(e[4]!==f){j=new Map;for(const T of f)T.tools&&T.tools.length>0&&j.set(T.id,T.tools.map(hs));e[4]=f,e[5]=j}else j=e[5];let v;e[6]!==j||e[7]!==s?(v=()=>Le(s,j),e[6]=j,e[7]=s,e[8]=v):v=e[8];const[b,w]=S.useState(v);let I;e[9]!==s?(I=()=>Oe(s),e[9]=s,e[10]=I):I=e[10];const[k,C]=S.useState(I);let P;e[11]!==s?(P=()=>Be(s),e[11]=s,e[12]=P):P=e[12];const[E,L]=S.useState(P),[B,A]=S.useState(!1),[M,h]=S.useState(!1);let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=T=>{w(T),A(!0)},e[13]=N):N=e[13];const z=N;let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=T=>{C(T),A(!0)},e[14]=$):$=e[14];const G=$;let W;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=T=>{L(T),A(!0)},e[15]=W):W=e[15];const q=W;let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=nt(ss),e[16]=F):F=e[16];const _e=s.tool_selection_mode??"inclusion";let ce;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==_e?(ce={resolver:F,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:_e}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=_e,e[21]=ce):ce=e[21];const O=it(ce),we=O.formState.isDirty||B;let de;e[22]!==d.update||e[23]!==j||e[24]!==O||e[25]!==l||e[26]!==E||e[27]!==k||e[28]!==b?(de=async()=>{const T=O.getValues(),$e=os(b,k,E,j);await d.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,connections:$e}}),O.reset(T),A(!1)},e[22]=d.update,e[23]=j,e[24]=O,e[25]=l,e[26]=E,e[27]=k,e[28]=b,e[29]=de):de=e[29];const Ce=de;let me;e[30]!==j||e[31]!==O||e[32]!==s?(me=()=>{O.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion"}),w(Le(s,j)),C(Oe(s)),L(Be(s)),A(!1)},e[30]=j,e[31]=O,e[32]=s,e[33]=me):me=e[33];const ke=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[34]=ue):ue=e[34];const De=ue,D=De.some(T=>T.id===i)?i:"settings";let fe;e[35]!==r?(fe=T=>{r({search:$e=>({...$e,tab:T}),replace:!0})},e[35]=r,e[36]=fe):fe=e[36];const Ie=fe,ae=d.update.isPending;let K;e[37]!==c.history?(K=()=>c.history.back(),e[37]=c.history,e[38]=K):K=e[38];let X;e[39]!==D||e[40]!==Ie?(X=t.jsx(Lt,{children:t.jsx(Tt,{tabs:De,activeTab:D,onTabChange:Ie})}),e[39]=D,e[40]=Ie,e[41]=X):X=e[41];let ee;e[42]!==ke||e[43]!==Ce||e[44]!==we||e[45]!==ae?(ee=we&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:ke,"aria-label":"Cancel",children:t.jsx(Ut,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Cancel"})]})}),t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:Ce,"aria-label":"Save",children:ae?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(Ke,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Save"})]})})]}),e[42]=ke,e[43]=Ce,e[44]=we,e[45]=ae,e[46]=ee):ee=e[46];let he;e[47]===Symbol.for("react.memo_cache_sentinel")?(he=()=>h(!0),e[47]=he):he=e[47];let xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:he,"aria-label":"Share",children:t.jsx(Xe,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Share"})]})}),e[48]=xe):xe=e[48];const Te=s.icon??"cpu_chip";let te;e[49]!==s.title||e[50]!==Te||e[51]!==a?(te=t.jsx(ut,{title:s.title,url:a,icon:Te}),e[49]=s.title,e[50]=Te,e[51]=a,e[52]=te):te=e[52];let se;e[53]!==ee||e[54]!==te?(se=t.jsxs(Ot,{children:[ee,xe,te]}),e[53]=ee,e[54]=te,e[55]=se):se=e[55];let pe;e[56]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[56]=pe):pe=e[56];let oe;e[57]!==D||e[58]!==g||e[59]!==y||e[60]!==O||e[61]!==s.icon||e[62]!==l||e[63]!==E||e[64]!==k||e[65]!==b?(oe=D==="settings"?t.jsx(as,{form:O,icon:s.icon,gatewayId:l}):D==="tools"?t.jsx(ft,{toolSet:b,onToolSetChange:z}):D==="resources"?t.jsx(Kt,{resourceSet:k,onResourceSetChange:G,connectionResources:y}):D==="prompts"?t.jsx(Zt,{promptSet:E,onPromptSetChange:q,connectionPrompts:g}):null,e[57]=D,e[58]=g,e[59]=y,e[60]=O,e[61]=s.icon,e[62]=l,e[63]=E,e[64]=k,e[65]=b,e[66]=oe):oe=e[66];let le;e[67]!==oe?(le=t.jsx(S.Suspense,{fallback:pe,children:oe}),e[67]=oe,e[68]=le):le=e[68];let ne;e[69]!==D||e[70]!==le?(ne=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(Ve,{children:le},D)})})}),e[69]=D,e[70]=le,e[71]=ne):ne=e[71];let ie;e[72]!==s||e[73]!==M?(ie=t.jsx(rs,{open:M,onOpenChange:h,gateway:s}),e[72]=s,e[73]=M,e[74]=ie):ie=e[74];let ge;return e[75]!==K||e[76]!==X||e[77]!==se||e[78]!==ne||e[79]!==ie?(ge=t.jsxs(Bt,{onBack:K,children:[X,se,ne,ie]}),e[75]=K,e[76]=X,e[77]=se,e[78]=ne,e[79]=ie,e[80]=ge):ge=e[80],ge}function hs(o){return o.name}function xs(o){return o.id}function ps(){const o=R.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Fe(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:i,org:n}=tt(l);let a;o[2]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/gateways/$gatewayId"},o[2]=a):a=o[2];const m=st(a).tab||"settings",r=ht(i);if(!r){let u;return o[3]!==s||o[4]!==n?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(rt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:n}}),children:"Back to agents"})})}),o[3]=s,o[4]=n,o[5]=u):u=o[5],u}let d;return o[6]!==r||o[7]!==i||o[8]!==m?(d=t.jsx(fs,{gateway:r,gatewayId:i,requestedTabId:m}),o[6]=r,o[7]=i,o[8]=m,o[9]=d):d=o[9],d}function gs(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ve,{children:t.jsx(S.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ps,{})})}),o[0]=e):e=o[0],e}function ro(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(gs,{}),o[0]=e):e=o[0],e}export{ro as default};
|
|
1
|
+
import{r as S,_ as ye,y as re,I as U,z as _,c as R,j as t,f as Fe,d as tt,b as st,k as ot,af as lt,B as nt,E as it,t as Ae}from"./index-DEuqpeVv.js";import{I as Ee,E as rt}from"./empty-state-C7Gr5Tg2.js";import{E as Ve}from"./error-boundary-rr4tK3fB.js";import{C as Ge}from"./checkbox-D1tHbcIN.js";import{c as H,B as V}from"./button-DXl1hVqx.js";import{i as at}from"./ArrowLeft-DlLOWSTj.js";import{u as We}from"./use-connection-DhRUkVvI.js";import{C as ct}from"./collection-search-pUdl1eNx.js";import{I as Pe}from"./input-CqqzkfyF.js";import{s as dt}from"./Plus-Df2M6Ns2.js";import{i as mt}from"./X-DhyaYbLb.js";import{P as ut}from"./pin-to-sidebar-button-CrzVxc9I.js";import{T as ft}from"./tool-set-selector-a1uFioE0.js";import{b as ht,a as xt,i as pt}from"./use-gateway-D5VVN1xE.js";import{u as gt,a as bt}from"./use-connection-resources-C-wyp48q.js";import{u as jt}from"./use-gateway-system-prompt-B3fSaA6r.js";import{s as He}from"./slugify-CEUa2lfQ.js";import{B as qe}from"./badge-CKe-ib_i.js";import{a as yt,D as vt,c as St,d as Nt}from"./dialog-1B3YWWMu.js";import{F as be,a as _t,b as ve,d as Se,f as Ne,c as wt}from"./form-BQupN7IV.js";import{I as Ct,R as kt,a as It}from"./index-u_K3efbu.js";import{R as Tt}from"./resource-tabs-DkDSMlFB.js";import{S as $t,a as Rt,b as zt,c as At,d as Ue}from"./select-Bv7J3zlQ.js";import{S as Et}from"./switch-ugX7u7WU.js";import{T as Pt}from"./textarea-BUrXtpl5.js";import{a as Z,c as Y,b as J,T as Q}from"./tooltip-vUrxHIt0.js";import{i as Ze}from"./Check-Cjgi2ZiG.js";import{i as Mt}from"./Code01-XpAoNs3W.js";import{a as Dt}from"./Copy01-De4SwxDv.js";import{i as Ut}from"./FlipBackward-CQnTJKeB.js";import{i as je}from"./InfoCircle-_4UsKVMw.js";import{i as ze}from"./Loading01-JwelopeC.js";import{a as Lt,V as Ot,b as Bt}from"./layout-D7T4rJzl.js";import"./connection-ByVJuREK.js";import"./project-context-provider-Dn1-l4h2.js";import"./use-collections-Cflasxiq.js";import"./useMutation-xcmVYLP7.js";import"./SearchMd-Cgfgcbdz.js";import"./use-organization-settings-D0kNSjbq.js";import"./localstorage-keys-kemGZMIp.js";import"./useQuery-BKyLWvSZ.js";import"./ChevronDown-BuVzyKHq.js";const Ye=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Ye.displayName="ArrowsRight";const Je=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Je.displayName="Circle";const Qe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));Qe.displayName="Lightbulb02";const Ke=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Ke.displayName="Save01";const Xe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));Xe.displayName="Share07";const Me=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ft=re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:U(_()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:U(_()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Vt=re({id:_().describe("Unique identifier for the gateway"),title:_().describe("Human-readable name for the gateway"),description:_().nullable().describe("Description of the gateway"),icon:_().nullable().optional().describe("Icon URL for the gateway"),created_at:_().describe("When the gateway was created"),updated_at:_().describe("When the gateway was last updated"),created_by:_().describe("User ID who created the gateway"),updated_by:_().optional().describe("User ID who last updated the gateway"),organization_id:_().describe("Organization ID this gateway belongs to"),tool_selection_mode:Me.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),connections:U(Ft).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});re({title:_().min(1).max(255).describe("Name for the gateway"),description:_().nullable().optional().describe("Optional description"),tool_selection_mode:Me.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:_().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});re({title:_().min(1).max(255).optional().describe("New name"),description:_().nullable().optional().describe("New description (null to clear)"),tool_selection_mode:Me.optional().describe("New tool selection mode"),icon:_().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Gt=S.memo(function(e){const s=R.c(20),{connection:l,isSelected:i,hasItemsEnabled:n,activeItemsCount:a,totalItemsCount:c,onSelect:m,onToggle:r}=e,d=i?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==d?(u=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=u):u=s[1];let f;s[2]!==l.icon||s[3]!==l.title?(f=t.jsx(Ee,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=f):f=s[4];let p;s[5]!==l.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=p):p=s[6];let x;s[7]!==m||s[8]!==f||s[9]!==p?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[f,p]}),s[7]=m,s[8]=f,s[9]=p,s[10]=x):x=s[10];let g;s[11]!==a||s[12]!==n||s[13]!==r||s[14]!==c?(g=c>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[a,"/",c]}),t.jsx(Ge,{checked:n,onCheckedChange:r,onClick:Ht})]}),s[11]=a,s[12]=n,s[13]=r,s[14]=c,s[15]=g):g=s[15];let y;return s[16]!==u||s[17]!==x||s[18]!==g?(y=t.jsxs("div",{className:u,children:[x,g]}),s[16]=u,s[17]=x,s[18]=g,s[19]=y):y=s[19],y}),Wt=S.memo(function(e){const s=R.c(18),{connectionId:l,item:i,isSelected:n,onToggle:a}=e,c=`item-${l}-${i.id}`,m=n?"text-foreground":"text-muted-foreground";let r;s[0]!==m?(r=H("text-sm font-medium",m),s[0]=m,s[1]=r):r=s[1];let d;s[2]!==i.name||s[3]!==r?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:i.name})}),s[2]=i.name,s[3]=r,s[4]=d):d=s[4];let u;s[5]!==i.description?(u=i.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.description}),s[5]=i.description,s[6]=u):u=s[6];let f;s[7]!==d||s[8]!==u?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),s[7]=d,s[8]=u,s[9]=f):f=s[9];const p=`item-${l}-${i.id}`;let x;s[10]!==n||s[11]!==a||s[12]!==p?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ge,{id:p,checked:n,onCheckedChange:a,onClick:qt})}),s[10]=n,s[11]=a,s[12]=p,s[13]=x):x=s[13];let g;return s[14]!==c||s[15]!==f||s[16]!==x?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[f,x]}),s[14]=c,s[15]=f,s[16]=x,s[17]=g):g=s[17],g});function et({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:i,extraContent:n}){const[a,c]=S.useState(""),m=S.useDeferredValue(a),[r,d]=S.useState("all"),[u,f]=S.useState(!1),p=S.useRef(new Set(Object.keys(o))),x=We({searchTerm:m.trim()||void 0}),g=p.current,y=[...g.values()].map(h=>x.find(N=>N.id===h)).filter(h=>h!==void 0),j=x.filter(h=>!g.has(h.id)),v=[...y,...j],b=h=>{const N=o[h];return N!==void 0&&N.length>0},w=v.filter(h=>{if(r==="all")return!0;const N=b(h.id);return r==="selected"?N:r==="unselected"?!N:!0}),[I,k]=S.useState(v[0]?.id??null),C=I?v.find(h=>h.id===I)??null:null,P=C?s(C):[],E=(h,N)=>o[h]?.includes(N)??!1,L=(h,N)=>{const z=o[h]??[],$=z.includes(N),G={...o};if($){const W=z.filter(q=>q!==N);W.length===0?delete G[h]:G[h]=W}else G[h]=[...z,N];e(G)},B=h=>{const N=v.find(F=>F.id===h);if(!N)return;const z=s(N);if(z.length===0)return;const $=o[h]??[],G=z.map(F=>F.id),W=$.length>0&&G.every(F=>$.includes(F)),q={...o};W?delete q[h]:(q[h]=G,k(h)),e(q)},A=h=>{k(h),f(!0)},M=()=>{f(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(ct,{value:a,onChange:c,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:a?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:w.map(h=>{const z=s(h).length,$=o[h.id]?.length??0;return t.jsx(Gt,{connection:h,isSelected:I===h.id,hasItemsEnabled:b(h.id),activeItemsCount:$,totalItemsCount:z,onSelect:()=>A(h.id),onToggle:()=>B(h.id)},h.id)})})})]}),t.jsx("div",{className:H("flex-1 flex-col",u?"flex":"hidden md:flex"),children:C?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:M,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(at,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Ee,{icon:C.icon,name:C.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),n,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:P.map(h=>t.jsx(Wt,{connectionId:C.id,item:h,isSelected:E(C.id,h.id),onToggle:()=>L(C.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function Ht(o){return o.stopPropagation()}function qt(o){return o.stopPropagation()}function Zt(o){const e=R.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:i}=o;let n;e[0]!==i?(n=m=>(i.get(m.id)??[]).map(Yt),e[0]=i,e[1]=n):n=e[1];const a=n;let c;return e[2]!==a||e[3]!==l||e[4]!==s?(c=t.jsx(et,{itemSet:s,onItemSetChange:l,getItems:a,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=a,e[3]=l,e[4]=s,e[5]=c):c=e[5],c}function Yt(o){return{id:o.name,name:o.name,description:o.description}}function Jt(o){return o.includes("*")}function Qt(o){const e=R.c(27),{patterns:s,onAddPattern:l,onRemovePattern:i}=o,[n,a]=S.useState("");let c;e[0]!==n||e[1]!==l||e[2]!==s?(c=()=>{const f=n.trim();f&&!s.includes(f)&&(l(f),a(""))},e[0]=n,e[1]=l,e[2]=s,e[3]=c):c=e[3];const m=c;let r;e[4]!==m?(r=f=>{f.key==="Enter"&&(f.preventDefault(),m())},e[4]=m,e[5]=r):r=e[5];const d=r;let u;if(e[6]!==m||e[7]!==d||e[8]!==n||e[9]!==i||e[10]!==s){const f=s.filter(Jt);let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("code",{children:"*"}),e[12]=p):p=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",p," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=k=>a(k.target.value),e[14]=g):g=e[14];let y;e[15]!==d||e[16]!==n?(y=t.jsx(Pe,{value:n,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=n,e[17]=y):y=e[17];let j;e[18]!==n?(j=n.trim(),e[18]=n,e[19]=j):j=e[19];const v=!j;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(dt,{size:16}),e[20]=b):b=e[20];let w;e[21]!==m||e[22]!==v?(w=t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=w):w=e[23];let I;e[24]!==w||e[25]!==y?(I=t.jsxs("div",{className:"flex gap-2",children:[y,w]}),e[24]=w,e[25]=y,e[26]=I):I=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,I,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(k=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:k}),t.jsx("button",{type:"button",onClick:()=>i(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(mt,{size:12})})]},k))})]}),e[6]=m,e[7]=d,e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];return u}function Kt(o){const e=R.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:i}=o,[n]=S.useState(null);let a;e[0]!==i?(a=b=>(i.get(b.id)??[]).map(Xt),e[0]=i,e[1]=a):a=e[1];const c=a;let m;e[2]!==l||e[3]!==s?(m=(b,w)=>{const I=s[b]??[];I.includes(w)||l({...s,[b]:[...I,w]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const r=m;let d;e[5]!==l||e[6]!==s?(d=(b,w)=>{const k=(s[b]??[]).filter(C=>C!==w);if(k.length===0){const C={...s};delete C[b],l(C)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=d):d=e[7];const u=d;let f;e[8]!==l?(f=b=>{l(b)},e[8]=l,e[9]=f):f=e[9];const p=f;let x;e[10]!==s||e[11]!==n?(x=n?s[n]??[]:[],e[10]=s,e[11]=n,e[12]=x):x=e[12];const g=x;let y;e[13]!==r||e[14]!==u||e[15]!==n||e[16]!==g?(y=n?t.jsx(Qt,{patterns:g,onAddPattern:b=>r(n,b),onRemovePattern:b=>u(n,b)}):null,e[13]=r,e[14]=u,e[15]=n,e[16]=g,e[17]=y):y=e[17];const j=y;let v;return e[18]!==j||e[19]!==c||e[20]!==p||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(et,{itemSet:s,onItemSetChange:p,getItems:c,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:j})}),e[18]=j,e[19]=c,e[20]=p,e[21]=s,e[22]=v):v=e[22],v}function Xt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function es(o){const e=R.c(8);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("grid gap-3",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==l||e[6]!==i?(n=t.jsx(kt,{"data-slot":"radio-group",className:i,...l}),e[5]=l,e[6]=i,e[7]=n):n=e[7],n}function Re(o){const e=R.c(9);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=i):i=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(It,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Je,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=n):n=e[5];let a;return e[6]!==l||e[7]!==i?(a=t.jsx(Ct,{"data-slot":"radio-group-item",className:i,...l,children:n}),e[6]=l,e[7]=i,e[8]=a):a=e[8],a}function ts(o){const s=new TextEncoder().encode(o),l=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(l)}const ss=Vt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0}).extend({title:_().min(1,"Name is required").max(255)});function Le(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const i=e.get(l.connection_id)??[];i.length>0&&(s[l.connection_id]=i)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Oe(o){const e={};for(const s of o.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function Be(o){const e={};for(const s of o.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function os(o,e,s,l){const i=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(i).map(n=>{const a=o[n]??[],c=l.get(n)??[],m=c.length>0&&c.every(r=>a.includes(r));return{connection_id:n,selected_tools:a.length===0||m?null:a,selected_resources:e[n]??null,selected_prompts:s[n]??null}})}function ls(o){const e=R.c(10),{gatewayUrl:s}=o,[l,i]=S.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),i(!0),Ae.success("Agent URL copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const a=n;let c;e[2]!==l?(c=l?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx(Dt,{size:20}),e[2]=l,e[3]=c):c=e[3];const m=l?"Copied!":"Copy URL";let r;e[4]!==m?(r=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==c||e[8]!==r?(d=t.jsxs(V,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,r]}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9],d}function ns(o){const e=R.c(7),{gatewayUrl:s,serverName:l}=o;let i;e[0]!==s||e[1]!==l?(i=()=>{const r=He(l),u=ts(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(r)}&config=${encodeURIComponent(u)}`;window.open(f,"_blank"),Ae.success("Opening Cursor...")},e[0]=s,e[1]=l,e[2]=i):i=e[2];const n=i;let a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),c=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=a,e[4]=c):(a=e[3],c=e[4]);let m;return e[5]!==n?(m=t.jsxs(V,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[5]=n,e[6]=m):m=e[6],m}function is(o){const e=R.c(11),{gatewayUrl:s,serverName:l}=o,[i,n]=S.useState(!1);let a;e[0]!==s||e[1]!==l?(a=async()=>{const f=He(l),x=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${f}" --config '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),n(!0),Ae.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a;let m;e[3]!==i?(m=i?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=i,e[4]=m):m=e[4];const r=i?"Copied!":"Install on Claude";let d;e[5]!==r?(d=t.jsx("span",{className:"text-xs font-medium",children:r}),e[5]=r,e[6]=d):d=e[6];let u;return e[7]!==c||e[8]!==m||e[9]!==d?(u=t.jsxs(V,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=c,e[8]=m,e[9]=d,e[10]=u):u=e[10],u}function rs(o){const e=R.c(40),{open:s,onOpenChange:l,gateway:i}=o,[n,a]=S.useState("code_execution");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=$=>{($==="passthrough"||$==="smart_tool_selection"||$==="code_execution")&&a($)},e[0]=c):c=e[0];const m=c;let r;e[1]!==i.id||e[2]!==n?(r=new URL(`/mcp/gateway/${i.id}`,window.location.origin),r.searchParams.set("mode",n),e[1]=i.id,e[2]=n,e[3]=r):r=e[3];let d;e[4]!==i.id||e[5]!==i.title?(d=i.title||`agent-${i.id.slice(0,8)}`,e[4]=i.id,e[5]=i.title,e[6]=d):d=e[6];const u=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(yt,{children:t.jsx(vt,{children:"Share Agent"})}),e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=p):p=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ye,{className:"size-5 text-muted-foreground"})}),e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[11]=y):y=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[x,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(Z,{children:t.jsxs(Y,{children:[y,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Re,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Qe,{className:"size-5 text-muted-foreground"})}),e[13]=v):v=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=b):b=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[15]=w):w=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[v,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[b,t.jsx(Z,{children:t.jsxs(Y,{children:[w,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Re,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=I):I=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Mt,{className:"size-5 text-muted-foreground"})}),e[17]=k):k=e[17];let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=C):C=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[19]=P):P=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[k,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[C,t.jsx(Z,{children:t.jsxs(Y,{children:[P,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Re,{id:"mode-code",value:"code_execution"}),t.jsx(qe,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=E):E=e[20];let L;e[21]!==n?(L=t.jsxs("div",{className:"flex flex-col gap-3",children:[p,t.jsxs(es,{value:n,onValueChange:m,className:"flex flex-col gap-4.5",children:[j,I,E]})]}),e[21]=n,e[22]=L):L=e[22];let B;e[23]!==r.href?(B=t.jsx(ls,{gatewayUrl:r.href}),e[23]=r.href,e[24]=B):B=e[24];let A,M;e[25]!==r.href||e[26]!==u?(A=t.jsx(ns,{gatewayUrl:r.href,serverName:u}),M=t.jsx(is,{gatewayUrl:r.href,serverName:u}),e[25]=r.href,e[26]=u,e[27]=A,e[28]=M):(A=e[27],M=e[28]);let h;e[29]!==B||e[30]!==A||e[31]!==M?(h=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[B,A,M]})}),e[29]=B,e[30]=A,e[31]=M,e[32]=h):h=e[32];let N;e[33]!==L||e[34]!==h?(N=t.jsxs(St,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[L,h]})]}),e[33]=L,e[34]=h,e[35]=N):N=e[35];let z;return e[36]!==l||e[37]!==s||e[38]!==N?(z=t.jsx(Nt,{open:s,onOpenChange:l,children:N}),e[36]=l,e[37]=s,e[38]=N,e[39]=z):z=e[39],z}function as(o){const e=R.c(31),{form:s,icon:l,gatewayId:i}=o,[n,a]=jt(i);let c;e[0]!==s?(c=s.watch("title")||"Agent",e[0]=s,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(pt,{}),e[2]=m):m=e[2];let r;e[3]!==l||e[4]!==c?(r=t.jsx(Ee,{icon:l,name:c,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=c,e[5]=r):r=e[5];let d;e[6]!==s.control?(d=t.jsx(be,{control:s.control,name:"status",render:us}),e[6]=s.control,e[7]=d):d=e[7];let u;e[8]!==r||e[9]!==d?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[r,d]}),e[8]=r,e[9]=d,e[10]=u):u=e[10];let f;e[11]!==s.control?(f=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:ms}),t.jsx(be,{control:s.control,name:"description",render:ds})]}),e[11]=s.control,e[12]=f):f=e[12];let p;e[13]!==u||e[14]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15];let x;e[16]!==s.control?(x=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(be,{control:s.control,name:"tool_selection_mode",render:cs})}),e[16]=s.control,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=g):g=e[18];let y;e[19]!==a?(y=w=>a(w.target.value),e[19]=a,e[20]=y):y=e[20];let j;e[21]!==n||e[22]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[g,t.jsx(Pt,{value:n,onChange:y,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=n,e[22]=y,e[23]=j):j=e[23];let v;e[24]!==j||e[25]!==p||e[26]!==x?(v=t.jsxs("div",{className:"flex flex-col",children:[p,x,j]}),e[24]=j,e[25]=p,e[26]=x,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(_t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function cs(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(wt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Z,{children:t.jsxs(Y,{children:[t.jsx(J,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(je,{size:14,className:"text-muted-foreground"})})}),t.jsx(Q,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs($t,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Se,{children:t.jsx(Rt,{className:"w-[180px]",children:t.jsx(zt,{})})}),t.jsxs(At,{children:[t.jsx(Ue,{value:"inclusion",children:"Include Selected"}),t.jsx(Ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Ne,{})]})}function ds(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Ne,{})]})}function ms(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Agent Name"})}),t.jsx(Ne,{})]})}function us(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qe,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Se,{children:t.jsx(Et,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ne,{})]})}function fs(o){const e=R.c(81),{gateway:s,gatewayId:l,requestedTabId:i}=o,a=ot().location.href,c=lt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const r=Fe(m),d=xt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const f=We(u);let p;e[2]!==f?(p=f.map(xs),e[2]=f,e[3]=p):p=e[3];const x=p,{promptsMap:g}=gt(x),{resourcesMap:y}=bt(x);let j;if(e[4]!==f){j=new Map;for(const T of f)T.tools&&T.tools.length>0&&j.set(T.id,T.tools.map(hs));e[4]=f,e[5]=j}else j=e[5];let v;e[6]!==j||e[7]!==s?(v=()=>Le(s,j),e[6]=j,e[7]=s,e[8]=v):v=e[8];const[b,w]=S.useState(v);let I;e[9]!==s?(I=()=>Oe(s),e[9]=s,e[10]=I):I=e[10];const[k,C]=S.useState(I);let P;e[11]!==s?(P=()=>Be(s),e[11]=s,e[12]=P):P=e[12];const[E,L]=S.useState(P),[B,A]=S.useState(!1),[M,h]=S.useState(!1);let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=T=>{w(T),A(!0)},e[13]=N):N=e[13];const z=N;let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=T=>{C(T),A(!0)},e[14]=$):$=e[14];const G=$;let W;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=T=>{L(T),A(!0)},e[15]=W):W=e[15];const q=W;let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=nt(ss),e[16]=F):F=e[16];const _e=s.tool_selection_mode??"inclusion";let ce;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==_e?(ce={resolver:F,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:_e}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=_e,e[21]=ce):ce=e[21];const O=it(ce),we=O.formState.isDirty||B;let de;e[22]!==d.update||e[23]!==j||e[24]!==O||e[25]!==l||e[26]!==E||e[27]!==k||e[28]!==b?(de=async()=>{const T=O.getValues(),$e=os(b,k,E,j);await d.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,connections:$e}}),O.reset(T),A(!1)},e[22]=d.update,e[23]=j,e[24]=O,e[25]=l,e[26]=E,e[27]=k,e[28]=b,e[29]=de):de=e[29];const Ce=de;let me;e[30]!==j||e[31]!==O||e[32]!==s?(me=()=>{O.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion"}),w(Le(s,j)),C(Oe(s)),L(Be(s)),A(!1)},e[30]=j,e[31]=O,e[32]=s,e[33]=me):me=e[33];const ke=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[34]=ue):ue=e[34];const De=ue,D=De.some(T=>T.id===i)?i:"settings";let fe;e[35]!==r?(fe=T=>{r({search:$e=>({...$e,tab:T}),replace:!0})},e[35]=r,e[36]=fe):fe=e[36];const Ie=fe,ae=d.update.isPending;let K;e[37]!==c.history?(K=()=>c.history.back(),e[37]=c.history,e[38]=K):K=e[38];let X;e[39]!==D||e[40]!==Ie?(X=t.jsx(Lt,{children:t.jsx(Tt,{tabs:De,activeTab:D,onTabChange:Ie})}),e[39]=D,e[40]=Ie,e[41]=X):X=e[41];let ee;e[42]!==ke||e[43]!==Ce||e[44]!==we||e[45]!==ae?(ee=we&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:ke,"aria-label":"Cancel",children:t.jsx(Ut,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Cancel"})]})}),t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:Ce,"aria-label":"Save",children:ae?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(Ke,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Save"})]})})]}),e[42]=ke,e[43]=Ce,e[44]=we,e[45]=ae,e[46]=ee):ee=e[46];let he;e[47]===Symbol.for("react.memo_cache_sentinel")?(he=()=>h(!0),e[47]=he):he=e[47];let xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:he,"aria-label":"Share",children:t.jsx(Xe,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Share"})]})}),e[48]=xe):xe=e[48];const Te=s.icon??"cpu_chip";let te;e[49]!==s.title||e[50]!==Te||e[51]!==a?(te=t.jsx(ut,{title:s.title,url:a,icon:Te}),e[49]=s.title,e[50]=Te,e[51]=a,e[52]=te):te=e[52];let se;e[53]!==ee||e[54]!==te?(se=t.jsxs(Ot,{children:[ee,xe,te]}),e[53]=ee,e[54]=te,e[55]=se):se=e[55];let pe;e[56]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[56]=pe):pe=e[56];let oe;e[57]!==D||e[58]!==g||e[59]!==y||e[60]!==O||e[61]!==s.icon||e[62]!==l||e[63]!==E||e[64]!==k||e[65]!==b?(oe=D==="settings"?t.jsx(as,{form:O,icon:s.icon,gatewayId:l}):D==="tools"?t.jsx(ft,{toolSet:b,onToolSetChange:z}):D==="resources"?t.jsx(Kt,{resourceSet:k,onResourceSetChange:G,connectionResources:y}):D==="prompts"?t.jsx(Zt,{promptSet:E,onPromptSetChange:q,connectionPrompts:g}):null,e[57]=D,e[58]=g,e[59]=y,e[60]=O,e[61]=s.icon,e[62]=l,e[63]=E,e[64]=k,e[65]=b,e[66]=oe):oe=e[66];let le;e[67]!==oe?(le=t.jsx(S.Suspense,{fallback:pe,children:oe}),e[67]=oe,e[68]=le):le=e[68];let ne;e[69]!==D||e[70]!==le?(ne=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(Ve,{children:le},D)})})}),e[69]=D,e[70]=le,e[71]=ne):ne=e[71];let ie;e[72]!==s||e[73]!==M?(ie=t.jsx(rs,{open:M,onOpenChange:h,gateway:s}),e[72]=s,e[73]=M,e[74]=ie):ie=e[74];let ge;return e[75]!==K||e[76]!==X||e[77]!==se||e[78]!==ne||e[79]!==ie?(ge=t.jsxs(Bt,{onBack:K,children:[X,se,ne,ie]}),e[75]=K,e[76]=X,e[77]=se,e[78]=ne,e[79]=ie,e[80]=ge):ge=e[80],ge}function hs(o){return o.name}function xs(o){return o.id}function ps(){const o=R.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Fe(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:i,org:n}=tt(l);let a;o[2]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/gateways/$gatewayId"},o[2]=a):a=o[2];const m=st(a).tab||"settings",r=ht(i);if(!r){let u;return o[3]!==s||o[4]!==n?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(rt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:n}}),children:"Back to agents"})})}),o[3]=s,o[4]=n,o[5]=u):u=o[5],u}let d;return o[6]!==r||o[7]!==i||o[8]!==m?(d=t.jsx(fs,{gateway:r,gatewayId:i,requestedTabId:m}),o[6]=r,o[7]=i,o[8]=m,o[9]=d):d=o[9],d}function gs(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ve,{children:t.jsx(S.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ps,{})})}),o[0]=e):e=o[0],e}function ro(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(gs,{}),o[0]=e):e=o[0],e}export{ro as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ee,j as t,r as te,f as oe}from"./index-
|
|
1
|
+
import{c as ee,j as t,r as te,f as oe}from"./index-DEuqpeVv.js";import{C as re}from"./collection-header-BA9HTLmg.js";import{C as ie}from"./collection-page-CDkTC45g.js";import{C as ne}from"./collection-search-pUdl1eNx.js";import{C as ae}from"./collection-table-wrapper-wARoPZXo.js";import{C as le}from"./connection-card-DjK0GZ2u.js";import{E as W,I as ce}from"./empty-state-C7Gr5Tg2.js";import{E as de}from"./error-boundary-rr4tK3fB.js";import{u as me,a as ue,i as x}from"./use-gateway-D5VVN1xE.js";import{u as pe,s as J}from"./use-list-state-BYREPRxy.js";import{u as ge}from"./use-create-gateway-DMkdPgfy.js";import{u as he}from"./project-context-provider-Dn1-l4h2.js";import{c as fe,b as xe,d as je,A as Ce,e as we,g as ye,a as Ne,f as De}from"./alert-dialog-gZhceV_v.js";import{B as se}from"./badge-CKe-ib_i.js";import{B as q}from"./button-DXl1hVqx.js";import{b as Q,D as U,a as X,c as O}from"./dropdown-menu-Hp4qYTud.js";import{i as Y}from"./DotsVertical-BhTwPxq7.js";import{i as Se}from"./Loading01-JwelopeC.js";import{s as Z}from"./Trash01-KvZ0cVo9.js";import"./collection-display-button-B_KC-ent.js";import"./ArrowUp-Ck0taqJi.js";import"./Check-Cjgi2ZiG.js";import"./Grid01-CRALWbj6.js";import"./List-DOmOO2Cw.js";import"./tooltip-vUrxHIt0.js";import"./view-mode-toggle-CTWk8Dkt.js";import"./SearchMd-Cgfgcbdz.js";import"./input-CqqzkfyF.js";import"./card-D0GcpRPY.js";import"./connection-ByVJuREK.js";import"./use-collections-Cflasxiq.js";import"./useMutation-xcmVYLP7.js";import"./use-mobile-CI2w7svc.js";function ve(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function be(){const e=ee.c(63),{org:r}=he(),n=oe();let j;e[0]!==r.slug?(j={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=j):j=e[1];const s=pe(j),f=me(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createGateway:B,isCreating:w}=ge(C),G=ue();let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={mode:"idle"},e[3]=y):y=e[3];const[i,N]=te.useReducer(ve,y);let D;e[4]!==G||e[5]!==i.gateway||e[6]!==i.mode?(D=async()=>{if(i.mode!=="deleting")return;const o=i.gateway.id;N({type:"close"});try{await G.delete.mutateAsync(o)}catch{}},e[4]=G,e[5]=i.gateway,e[6]=i.mode,e[7]=D):D=e[7];const R=D;let S,v,b,k,_,A;e[8]===Symbol.for("react.memo_cache_sentinel")?(S={id:"icon",header:"",render:Ke,cellClassName:"w-16 shrink-0",wrap:!0},v={id:"title",header:"Name",render:Pe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},b={id:"description",header:"Description",render:Ee,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"mode",header:"Mode",accessor:$e,cellClassName:"w-[100px]"},_={id:"connections",header:"Connections",render:ze,cellClassName:"w-24 shrink-0"},A={id:"status",header:"Status",render:Me,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=v,e[10]=b,e[11]=k,e[12]=_,e[13]=A):(S=e[8],v=e[9],b=e[10],k=e[11],_=e[12],A=e[13]);let I;e[14]!==n||e[15]!==r.slug?(I=[S,v,b,k,_,A,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:Ae,children:[t.jsxs(O,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Open"]}),t.jsxs(O,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[14]=n,e[15]=r.slug,e[16]=I):I=e[16];const T=I,V=w?"Creating...":"Create Agent";let M;e[17]!==B||e[18]!==w||e[19]!==V?(M=t.jsx(q,{onClick:B,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:V}),e[17]=B,e[18]=w,e[19]=V,e[20]=M):M=e[20];const H=M,L=i.mode==="deleting";let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[21]=z):z=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(fe,{children:"Delete Agent?"}),e[22]=$):$=e[22];const F=i.mode==="deleting"&&i.gateway.title;let l;e[23]!==F?(l=t.jsxs(xe,{children:[$,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:F}),"."]})]}),e[23]=F,e[24]=l):l=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[25]=E):E=e[25];let c;e[26]!==R?(c=t.jsxs(we,{children:[E,t.jsx(ye,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[26]=R,e[27]=c):c=e[27];let d;e[28]!==l||e[29]!==c?(d=t.jsxs(Ne,{children:[l,c]}),e[28]=l,e[29]=c,e[30]=d):d=e[30];let m;e[31]!==L||e[32]!==d?(m=t.jsx(De,{open:L,onOpenChange:z,children:d}),e[31]=L,e[32]=d,e[33]=m):m=e[33];let P;e[34]===Symbol.for("react.memo_cache_sentinel")?(P=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=P):P=e[34];let u;e[35]!==H||e[36]!==s.handleSort||e[37]!==s.setViewMode||e[38]!==s.sortDirection||e[39]!==s.sortKey||e[40]!==s.viewMode?(u=t.jsx(re,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:P,ctaButton:H}),e[35]=H,e[36]=s.handleSort,e[37]=s.setViewMode,e[38]=s.sortDirection,e[39]=s.sortKey,e[40]=s.viewMode,e[41]=u):u=e[41];let p;e[42]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[42]=s,e[43]=p):p=e[43];let g;e[44]!==s.search||e[45]!==s.setSearch||e[46]!==p?(g=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:p}),e[44]=s.search,e[45]=s.setSearch,e[46]=p,e[47]=g):g=e[47];let h;e[48]!==T||e[49]!==f||e[50]!==s.handleSort||e[51]!==s.search||e[52]!==s.sortDirection||e[53]!==s.sortKey||e[54]!==s.viewMode||e[55]!==n||e[56]!==r.slug?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:f.map(o=>t.jsx(le,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(x,{}),onClick:()=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_e,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:ke,children:[t.jsxs(O,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Open"]}),t.jsxs(O,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ae,{columns:T,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[48]=T,e[49]=f,e[50]=s.handleSort,e[51]=s.search,e[52]=s.sortDirection,e[53]=s.sortKey,e[54]=s.viewMode,e[55]=n,e[56]=r.slug,e[57]=h):h=e[57];let K;return e[58]!==m||e[59]!==u||e[60]!==g||e[61]!==h?(K=t.jsxs(ie,{children:[m,u,g,h]}),e[58]=m,e[59]=u,e[60]=g,e[61]=h,e[62]=K):K=e[62],K}function ke(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Me(e){return t.jsx(se,{variant:e.status==="active"?"default":"outline",children:e.status})}function ze(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function $e(e){return t.jsx(se,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ee(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Pe(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function ft(){const e=ee.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(de,{children:t.jsx(te.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(be,{})})}),e[0]=r):r=e[0],r}export{ft as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,c as I,bK as _,j as s,x as O,t as F,bJ as q}from"./index-B2ZzxrDd.js";import{K as z,u as H,g as L,s as Z,a as Q,i as R,f as M}from"./file-browser-lBeJR8bC.js";import{B as w}from"./button-CJFU-RdP.js";import{i as D}from"./AlertCircle-Dvl19Bxu.js";import{n as W}from"./Download01-DzrQfwIZ.js";import{i as J}from"./File06-DvtIjhz0.js";import{a as S}from"./Image01-vvKwvz0g.js";import{i as $}from"./Loading01-ByRd3GAn.js";import{s as U}from"./Trash01-RdHotUor.js";import{i as A}from"./Upload01-B5lhw8CF.js";import{u as V}from"./useMutation-Lj6qQmhH.js";import{u as Y}from"./useQuery-DVzj5fVO.js";import"./useInfiniteQuery-Dbym_GhP.js";import"./infiniteQueryObserver-2ElA8vy3.js";import"./checkbox-D4qUNjlU.js";import"./Check-MZfXJ4EP.js";import"./Grid01-tEwYXVxO.js";import"./Home02-9SuE7ucu.js";import"./List-j3ISho_T.js";const P=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));P.displayName="File04";const B=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File07";const G=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="FileCode01";const K=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));K.displayName="VideoRecorder";function X(o){const e=I.c(5),[t,g]=b.useState(!1),c=b.useRef(null),f=b.useRef(!1);let n;e[0]!==o?(n=d=>{c.current&&(c.current.disconnect(),c.current=null),d&&!f.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!f.current&&(f.current=!0,g(!0),c.current?.disconnect(),c.current=null)},o),c.current.observe(d))},e[0]=o,e[1]=n):n=e[1];const l=n;let p;return e[2]!==t||e[3]!==l?(p=[t,l],e[2]=t,e[3]=l,e[4]=p):p=e[4],p}function ee(o){const e=I.c(22),{objectKey:t,alt:g,className:c}=o,f=c===void 0?"":c,{connectionId:n,toolCaller:l}=_();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={rootMargin:"100px",threshold:0},e[0]=p):p=e[0];const[d,y]=X(p);let a;e[1]!==n||e[2]!==t?(a=z.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let m;e[4]!==t||e[5]!==l?(m=async()=>{const{url:u}=await l("GET_PRESIGNED_URL",{key:t});return u},e[4]=t,e[5]=l,e[6]=m):m=e[6];let k;e[7]!==d||e[8]!==a||e[9]!==m?(k={queryKey:a,queryFn:m,enabled:d,staleTime:3e5,gcTime:6e5},e[7]=d,e[8]=a,e[9]=m,e[10]=k):k=e[10];const{data:h,isLoading:x,error:j}=Y(k),v=`relative w-full h-full flex items-center justify-center overflow-hidden ${f}`;let r;e[11]!==g||e[12]!==j||e[13]!==h||e[14]!==x||e[15]!==d||e[16]!==t?(r=!d||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx($,{size:24,className:"animate-spin"}):s.jsx(S,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(D,{size:24})}):h?s.jsx("img",{src:h,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[11]=g,e[12]=j,e[13]=h,e[14]=x,e[15]=d,e[16]=t,e[17]=r):r=e[17];let i;return e[18]!==y||e[19]!==v||e[20]!==r?(i=s.jsx("div",{ref:y,className:v,children:r}),e[18]=y,e[19]=v,e[20]=r,e[21]=i):i=e[21],i}const E=12,te={Image01:S,VideoRecorder:K,Music01:R,File02:R,File04:P,File06:J,File07:B,FileCode01:G,Folder:q};function se(o){const e=o.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function re(o){const e=I.c(38),{item:t,onNavigate:g,onDownload:c,onDelete:f}=o;let n;e[0]!==t.key?(n=L(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,p=t.isFolder?"Folder":Q(t.key),d=te[p]||R;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&se(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let m;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(m=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=m):m=e[8];const k=`flex flex-col items-center justify-center w-full h-full ${a?"":"p-4"} ${t.isFolder?"cursor-pointer":"cursor-default"}`;let h;e[9]!==d||e[10]!==a||e[11]!==t.isFolder||e[12]!==t.key||e[13]!==l?(h=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(ee,{objectKey:t.key,alt:l})}):s.jsx(d,{size:48,className:t.isFolder?"text-amber-500":"text-muted-foreground"}),e[9]=d,e[10]=a,e[11]=t.isFolder,e[12]=t.key,e[13]=l,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==t.isFolder||e[17]!==t.size||e[18]!==l?(x=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:M(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:M(t.size)})]}),e[15]=a,e[16]=t.isFolder,e[17]=t.size,e[18]=l,e[19]=x):x=e[19];let j;e[20]!==m||e[21]!==k||e[22]!==h||e[23]!==x?(j=s.jsxs("button",{type:"button",onClick:m,className:k,children:[h,x]}),e[20]=m,e[21]=k,e[22]=h,e[23]=x,e[24]=j):j=e[24];let v;e[25]!==t.isFolder||e[26]!==t.key||e[27]!==f||e[28]!==c?(v=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:u=>{u.stopPropagation(),c(t.key)},children:s.jsx(W,{size:14})}),s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})]}),e[25]=t.isFolder,e[26]=t.key,e[27]=f,e[28]=c,e[29]=v):v=e[29];let r;e[30]!==t.isFolder||e[31]!==t.key||e[32]!==f?(r=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})}),e[30]=t.isFolder,e[31]=t.key,e[32]=f,e[33]=r):r=e[33];let i;return e[34]!==j||e[35]!==v||e[36]!==r?(i=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[j,v,r]}),e[34]=j,e[35]=v,e[36]=r,e[37]=i):i=e[37],i}function Ne({prefix:o,flat:e,onNavigate:t}){const g=b.useRef(null),c=O(),{connectionId:f,toolCaller:n}=_(),{objects:l,isLoading:p,isFetchingMore:d,hasMore:y,loadMore:a,error:m}=H({prefix:o,flat:e,pageSize:E}),k=V({mutationFn:async r=>{const i=o+r.name,{url:u}=await n("PUT_PRESIGNED_URL",{key:i,contentType:r.type||"application/octet-stream"}),C=await fetch(u,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!C.ok)throw new Error(`Upload failed: ${C.statusText}`);return i},onSuccess:r=>{F.success(`Uploaded ${L(r)}`),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Upload failed: ${r.message}`)}}),h=V({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{F.success("Deleted successfully"),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:i}=await n("GET_PRESIGNED_URL",{key:r}),u=await fetch(i);if(!u.ok)throw new Error(`Failed to fetch file: ${u.statusText}`);const C=await u.blob(),T=URL.createObjectURL(C),N=document.createElement("a");N.href=T,N.download=L(r),document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(T)}catch(i){F.error(`Download failed: ${i instanceof Error?i.message:"Unknown error"}`)}},j=r=>{const i=r.target.files;if(i){for(const u of Array.from(i))k.mutate(u);r.target.value=""}},v=r=>{if(!y||d)return;const i=r.currentTarget;i.scrollHeight-i.scrollTop-i.clientHeight<200&&a()};return m?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(D,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:m.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:v,children:p?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(w,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(A,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(re,{item:r,onNavigate:t,onDownload:x,onDelete:i=>h.mutate([i])},r.key))}),d&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx($,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ne as default};
|
|
1
|
+
import{r as b,c as I,bM as _,j as s,x as O,t as F,bL as q}from"./index-DEuqpeVv.js";import{K as z,u as H,g as L,s as Z,a as Q,i as R,f as T}from"./file-browser-BECnO7FM.js";import{B as w}from"./button-DXl1hVqx.js";import{i as D}from"./AlertCircle-CahACZDg.js";import{n as W}from"./Download01-DhkFfGKV.js";import{i as A}from"./File06-BiIPMtEV.js";import{a as S}from"./Image01-Cb4gQMH4.js";import{i as $}from"./Loading01-JwelopeC.js";import{s as U}from"./Trash01-KvZ0cVo9.js";import{i as J}from"./Upload01-TiwmYxO-.js";import{u as V}from"./useMutation-xcmVYLP7.js";import{u as Y}from"./useQuery-BKyLWvSZ.js";import"./useInfiniteQuery-ckN_t7ea.js";import"./infiniteQueryObserver-BXdaScti.js";import"./checkbox-D1tHbcIN.js";import"./Check-Cjgi2ZiG.js";import"./Grid01-CRALWbj6.js";import"./Home02-ofwnyeoV.js";import"./List-DOmOO2Cw.js";const P=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));P.displayName="File04";const B=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File07";const G=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="FileCode01";const K=({size:o=24,color:e="currentColor",...t})=>b.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},b.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));K.displayName="VideoRecorder";function X(o){const e=I.c(5),[t,g]=b.useState(!1),c=b.useRef(null),f=b.useRef(!1);let n;e[0]!==o?(n=d=>{c.current&&(c.current.disconnect(),c.current=null),d&&!f.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!f.current&&(f.current=!0,g(!0),c.current?.disconnect(),c.current=null)},o),c.current.observe(d))},e[0]=o,e[1]=n):n=e[1];const l=n;let p;return e[2]!==t||e[3]!==l?(p=[t,l],e[2]=t,e[3]=l,e[4]=p):p=e[4],p}function ee(o){const e=I.c(22),{objectKey:t,alt:g,className:c}=o,f=c===void 0?"":c,{connectionId:n,toolCaller:l}=_();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={rootMargin:"100px",threshold:0},e[0]=p):p=e[0];const[d,y]=X(p);let a;e[1]!==n||e[2]!==t?(a=z.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let m;e[4]!==t||e[5]!==l?(m=async()=>{const{url:u}=await l("GET_PRESIGNED_URL",{key:t});return u},e[4]=t,e[5]=l,e[6]=m):m=e[6];let k;e[7]!==d||e[8]!==a||e[9]!==m?(k={queryKey:a,queryFn:m,enabled:d,staleTime:3e5,gcTime:6e5},e[7]=d,e[8]=a,e[9]=m,e[10]=k):k=e[10];const{data:h,isLoading:x,error:j}=Y(k),v=`relative w-full h-full flex items-center justify-center overflow-hidden ${f}`;let r;e[11]!==g||e[12]!==j||e[13]!==h||e[14]!==x||e[15]!==d||e[16]!==t?(r=!d||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx($,{size:24,className:"animate-spin"}):s.jsx(S,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(D,{size:24})}):h?s.jsx("img",{src:h,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[11]=g,e[12]=j,e[13]=h,e[14]=x,e[15]=d,e[16]=t,e[17]=r):r=e[17];let i;return e[18]!==y||e[19]!==v||e[20]!==r?(i=s.jsx("div",{ref:y,className:v,children:r}),e[18]=y,e[19]=v,e[20]=r,e[21]=i):i=e[21],i}const E=12,te={Image01:S,VideoRecorder:K,Music01:R,File02:R,File04:P,File06:A,File07:B,FileCode01:G,Folder:q};function se(o){const e=o.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function re(o){const e=I.c(38),{item:t,onNavigate:g,onDownload:c,onDelete:f}=o;let n;e[0]!==t.key?(n=L(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,p=t.isFolder?"Folder":Q(t.key),d=te[p]||R;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&se(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let m;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(m=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=m):m=e[8];const k=`flex flex-col items-center justify-center w-full h-full ${a?"":"p-4"} ${t.isFolder?"cursor-pointer":"cursor-default"}`;let h;e[9]!==d||e[10]!==a||e[11]!==t.isFolder||e[12]!==t.key||e[13]!==l?(h=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(ee,{objectKey:t.key,alt:l})}):s.jsx(d,{size:48,className:t.isFolder?"text-amber-500":"text-muted-foreground"}),e[9]=d,e[10]=a,e[11]=t.isFolder,e[12]=t.key,e[13]=l,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==t.isFolder||e[17]!==t.size||e[18]!==l?(x=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:T(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:T(t.size)})]}),e[15]=a,e[16]=t.isFolder,e[17]=t.size,e[18]=l,e[19]=x):x=e[19];let j;e[20]!==m||e[21]!==k||e[22]!==h||e[23]!==x?(j=s.jsxs("button",{type:"button",onClick:m,className:k,children:[h,x]}),e[20]=m,e[21]=k,e[22]=h,e[23]=x,e[24]=j):j=e[24];let v;e[25]!==t.isFolder||e[26]!==t.key||e[27]!==f||e[28]!==c?(v=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:u=>{u.stopPropagation(),c(t.key)},children:s.jsx(W,{size:14})}),s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})]}),e[25]=t.isFolder,e[26]=t.key,e[27]=f,e[28]=c,e[29]=v):v=e[29];let r;e[30]!==t.isFolder||e[31]!==t.key||e[32]!==f?(r=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})}),e[30]=t.isFolder,e[31]=t.key,e[32]=f,e[33]=r):r=e[33];let i;return e[34]!==j||e[35]!==v||e[36]!==r?(i=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[j,v,r]}),e[34]=j,e[35]=v,e[36]=r,e[37]=i):i=e[37],i}function Ne({prefix:o,flat:e,onNavigate:t}){const g=b.useRef(null),c=O(),{connectionId:f,toolCaller:n}=_(),{objects:l,isLoading:p,isFetchingMore:d,hasMore:y,loadMore:a,error:m}=H({prefix:o,flat:e,pageSize:E}),k=V({mutationFn:async r=>{const i=o+r.name,{url:u}=await n("PUT_PRESIGNED_URL",{key:i,contentType:r.type||"application/octet-stream"}),C=await fetch(u,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!C.ok)throw new Error(`Upload failed: ${C.statusText}`);return i},onSuccess:r=>{F.success(`Uploaded ${L(r)}`),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Upload failed: ${r.message}`)}}),h=V({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{F.success("Deleted successfully"),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:i}=await n("GET_PRESIGNED_URL",{key:r}),u=await fetch(i);if(!u.ok)throw new Error(`Failed to fetch file: ${u.statusText}`);const C=await u.blob(),M=URL.createObjectURL(C),N=document.createElement("a");N.href=M,N.download=L(r),document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(M)}catch(i){F.error(`Download failed: ${i instanceof Error?i.message:"Unknown error"}`)}},j=r=>{const i=r.target.files;if(i){for(const u of Array.from(i))k.mutate(u);r.target.value=""}},v=r=>{if(!y||d)return;const i=r.currentTarget;i.scrollHeight-i.scrollTop-i.clientHeight<200&&a()};return m?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(D,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:m.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:v,children:p?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(w,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(J,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(re,{item:r,onNavigate:t,onDownload:x,onDelete:i=>h.mutate([i])},r.key))}),d&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx($,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,j as s,a as I,r as C,e as F,f as E,x as O,t as w}from"./index-B2ZzxrDd.js";import{C as k}from"./card-BARP50i4.js";import{c as y,B as $}from"./button-CJFU-RdP.js";import{A as R}from"./avatar-C9xlNN_x.js";import{i as D}from"./AlertCircle-Dvl19Bxu.js";import{i as H}from"./Check-MZfXJ4EP.js";import{s as G}from"./Plus-B6dO5J-T.js";import{i as Q}from"./SearchMd-RcsY4Qc3.js";import{s as q}from"./XClose-d9N07C9C.js";import{I as B}from"./input-BptR4gs0.js";import{C as T}from"./create-organization-dialog-BCm-rEBq.js";import"./alert-dialog-DIpJg2Aj.js";import"./form-0xzFj1MQ.js";import"./spinner-CwrVDgbN.js";import"./useMutation-Lj6qQmhH.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function _e(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{_e as default};
|
|
1
|
+
import{c as f,j as s,a as I,r as C,e as F,f as E,x as O,t as w}from"./index-DEuqpeVv.js";import{C as k}from"./card-D0GcpRPY.js";import{c as y,B as $}from"./button-DXl1hVqx.js";import{A as R}from"./avatar-d8M8JpvZ.js";import{i as D}from"./AlertCircle-CahACZDg.js";import{i as H}from"./Check-Cjgi2ZiG.js";import{s as G}from"./Plus-Df2M6Ns2.js";import{i as Q}from"./SearchMd-Cgfgcbdz.js";import{s as q}from"./XClose-2bShEltc.js";import{I as B}from"./input-CqqzkfyF.js";import{C as T}from"./create-organization-dialog-DKwU0dfN.js";import"./alert-dialog-gZhceV_v.js";import"./form-BQupN7IV.js";import"./spinner-D0hdWfev.js";import"./useMutation-xcmVYLP7.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function _e(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{_e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{X as Ie,r as u,as as K,aU as F,R as Re,P as Ce,O as $e,C as Me,aV as z}from"./index-B2ZzxrDd.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case o:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=o,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===o},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===o||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var Pe=Fe();const lt=Ie(Pe);var ve=1,De=.9,qe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ze=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,o,c,d){if(c===l.length)return o===t.length?ve:Ke;var v=`${o},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,o),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===o?b*=ve:Ve.test(t.charAt(i-1))?(b*=qe,x=t.slice(o,i-1).match(Oe),x&&o>0&&(b*=Math.pow(ee,x.length))):ze.test(t.charAt(i-1))?(b*=De,$=t.slice(o,i-1).match(be),$&&o>0&&(b*=Math.pow(ee,$.length))):(b*=je,o>0&&(b*=Math.pow(ee,i-o))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var O='[cmdk-group=""]',te='[cmdk-group-items=""]',Ue='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",_e=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),o=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,T=K(),ue=K(),H=K(),P=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,ae)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var a,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")G(),W(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(H);I?I.focus():(a=document.getElementById(T))==null||a.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=q())==null?void 0:I.id,R.emit()}),m||w(5,ae),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=u.useMemo(()=>({value:(e,s,m)=>{var a;s!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,oe(s,m)),w(2,()=>{W(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(o.current.has(s)?o.current.get(s).add(e):o.current.set(s,new Set([e]))),w(3,()=>{G(),W(),r.current.value||X(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=q();w(4,()=>{G(),m?.getAttribute("id")===e&&X(),R.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{c.current.delete(e),o.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:T,inputId:H,labelId:ue,listInnerRef:P}),[]);function oe(e,s){var m,a;let g=(a=(m=v.current)==null?void 0:m.filter)!=null?a:_e;return e?g(e,r.current.search,s):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(a=>{let g=o.current.get(a),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([a,S])});let m=P.current;V().sort((a,g)=>{var S,C;let I=a.getAttribute("id"),U=g.getAttribute("id");return((S=e.get(U))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(a=>{let g=a.closest(te);g?g.appendChild(a.parentElement===g?a:a.closest(`${te} > *`)):m.appendChild(a.parentElement===m?a:a.closest(`${te} > *`))}),s.sort((a,g)=>g[1]-a[1]).forEach(a=>{var g;let S=(g=P.current)==null?void 0:g.querySelector(`${O}[${j}="${encodeURIComponent(a[0])}"]`);S?.parentElement.appendChild(S)})}function X(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function G(){var e,s,m,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(a=(m=c.current.get(S))==null?void 0:m.keywords)!=null?a:[],U=oe(C,I);r.current.filtered.items.set(S,U),U>0&&g++}for(let[S,C]of o.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function ae(){var e,s,m;let a=q();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((m=(s=a.closest(O))==null?void 0:s.querySelector(Ue))==null||m.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function q(){var e;return(e=P.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=P.current)==null?void 0:e.querySelectorAll(he))||[])}function J(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function Y(e){var s;let m=q(),a=V(),g=a.findIndex(C=>C===m),S=a[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?a[a.length-1]:g+e===a.length?a[0]:a[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=q(),m=s?.closest(O),a;for(;m&&!a;)m=e>0?Qe(m,O):Ze(m,O),a=m?.querySelector(he);a?R.setState("value",a.getAttribute(j)):Y(e)}let ce=()=>J(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):Y(1)},de=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ie(-1):Y(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let a=q();if(a){let g=new Event(ne);a.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:rt},y),_(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:N},e))))}),Te=u.forwardRef((t,l)=>{var r,f;let o=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(o,d?.id)},[i]);let p=ke(o,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(o)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:T,forceMount:ue,keywords:H,...P}=t;return u.createElement(F.div,{ref:z(c,l),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),He=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:o,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:o}),[o]);return u.createElement(F.div,{ref:z(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),_(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Ne=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,o=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:z(o,l),...f,"cmdk-separator":"",role:"separator"})}),We=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,o=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:o?t.value:d,onChange:i=>{o||c.setState("search",i.target.value),r?.(i.target.value)}})}),Xe=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...o}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:z(c,l),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},_(t,i=>u.createElement("div",{ref:z(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Ge=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:o,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:o}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Je=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ye=u.forwardRef((t,l)=>{let{progress:r,children:f,label:o="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},_(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Xe,Item:Te,Input:We,Group:He,Separator:Ne,Dialog:Ge,Empty:Je,Loading:Ye});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let o=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():o.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),o.current=v}),o}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,o)=>{r.current.set(f,o),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function _({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,Pe as r};
|
|
1
|
+
import{X as Ie,r as u,as as K,aW as F,R as Re,P as Ce,O as $e,C as Me,aX as z}from"./index-DEuqpeVv.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case o:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=o,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===o},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===o||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var Pe=Fe();const lt=Ie(Pe);var ve=1,De=.9,qe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ze=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,o,c,d){if(c===l.length)return o===t.length?ve:Ke;var v=`${o},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,o),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===o?b*=ve:Ve.test(t.charAt(i-1))?(b*=qe,x=t.slice(o,i-1).match(Oe),x&&o>0&&(b*=Math.pow(ee,x.length))):ze.test(t.charAt(i-1))?(b*=De,$=t.slice(o,i-1).match(be),$&&o>0&&(b*=Math.pow(ee,$.length))):(b*=je,o>0&&(b*=Math.pow(ee,i-o))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var O='[cmdk-group=""]',te='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",Te=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),o=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,U=K(),ue=K(),W=K(),P=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,ae)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var a,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")G(),H(),w(1,N);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(W);I?I.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=q())==null?void 0:I.id,R.emit()}),m||w(5,ae),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),X=u.useMemo(()=>({value:(e,s,m)=>{var a;s!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,oe(s,m)),w(2,()=>{H(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(o.current.has(s)?o.current.get(s).add(e):o.current.set(s,new Set([e]))),w(3,()=>{G(),H(),r.current.value||N(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=q();w(4,()=>{G(),m?.getAttribute("id")===e&&N(),R.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{c.current.delete(e),o.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:W,labelId:ue,listInnerRef:P}),[]);function oe(e,s){var m,a;let g=(a=(m=v.current)==null?void 0:m.filter)!=null?a:Te;return e?g(e,r.current.search,s):0}function H(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(a=>{let g=o.current.get(a),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([a,S])});let m=P.current;V().sort((a,g)=>{var S,C;let I=a.getAttribute("id"),_=g.getAttribute("id");return((S=e.get(_))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(a=>{let g=a.closest(te);g?g.appendChild(a.parentElement===g?a:a.closest(`${te} > *`)):m.appendChild(a.parentElement===m?a:a.closest(`${te} > *`))}),s.sort((a,g)=>g[1]-a[1]).forEach(a=>{var g;let S=(g=P.current)==null?void 0:g.querySelector(`${O}[${j}="${encodeURIComponent(a[0])}"]`);S?.parentElement.appendChild(S)})}function N(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function G(){var e,s,m,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(a=(m=c.current.get(S))==null?void 0:m.keywords)!=null?a:[],_=oe(C,I);r.current.filtered.items.set(S,_),_>0&&g++}for(let[S,C]of o.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function ae(){var e,s,m;let a=q();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((m=(s=a.closest(O))==null?void 0:s.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function q(){var e;return(e=P.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=P.current)==null?void 0:e.querySelectorAll(he))||[])}function J(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function Y(e){var s;let m=q(),a=V(),g=a.findIndex(C=>C===m),S=a[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?a[a.length-1]:g+e===a.length?a[0]:a[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=q(),m=s?.closest(O),a;for(;m&&!a;)m=e>0?Qe(m,O):Ze(m,O),a=m?.querySelector(he);a?R.setState("value",a.getAttribute(j)):Y(e)}let ce=()=>J(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):Y(1)},de=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ie(-1):Y(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let a=q();if(a){let g=new Event(ne);a.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:rt},y),T(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:X},e))))}),Ue=u.forwardRef((t,l)=>{var r,f;let o=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(o,d?.id)},[i]);let p=ke(o,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(o)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:U,forceMount:ue,keywords:W,...P}=t;return u.createElement(F.div,{ref:z(c,l),...P,id:o,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),We=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:o,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:o}),[o]);return u.createElement(F.div,{ref:z(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),T(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Xe=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,o=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:z(o,l),...f,"cmdk-separator":"",role:"separator"})}),He=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,o=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:o?t.value:d,onChange:i=>{o||c.setState("search",i.target.value),r?.(i.target.value)}})}),Ne=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...o}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:z(c,l),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},T(t,i=>u.createElement("div",{ref:z(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Ge=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:o,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:o}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Je=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ye=u.forwardRef((t,l)=>{let{progress:r,children:f,label:o="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},T(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Ne,Item:Ue,Input:He,Group:We,Separator:Xe,Dialog:Ge,Empty:Je,Loading:Ye});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let o=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():o.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),o.current=v}),o}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,o)=>{r.current.set(f,o),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function T({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,Pe as r};
|