@decocms/mesh 2.12.1 → 2.14.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-Cso_Xxvk.js → AlertCircle-DeHvJZzp.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BrsZ2N_5.js → ArrowLeft-Dan_IIKP.js} +1 -1
- package/dist/client/assets/ArrowUp-B2eKsIZo.js +1 -0
- package/dist/client/assets/{Check-JFkjTCfG.js → Check-VfxUlV5P.js} +1 -1
- package/dist/client/assets/{ChevronDown-HtFMO0lw.js → ChevronDown-OK90XtVB.js} +1 -1
- package/dist/client/assets/{Clock-CW5u1cfj.js → Clock-CRgmR_1n.js} +1 -1
- package/dist/client/assets/{Code01-CgNchnl3.js → Code01-B9DNMb5j.js} +1 -1
- package/dist/client/assets/{Copy01-Dadp_RDG.js → Copy01-dbjgqDL6.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-B0A7sUYv.js → DotsHorizontal-BpvBcoMa.js} +1 -1
- package/dist/client/assets/{DotsVertical-BHUUUCDx.js → DotsVertical-XnGZcIeo.js} +1 -1
- package/dist/client/assets/Download01-C8jw9jFZ.js +1 -0
- package/dist/client/assets/{Edit01-CxRkZTQ1.js → Edit01-Ddbn6DsS.js} +1 -1
- package/dist/client/assets/{File06-D0TXCuMx.js → File06-DCHrHfbn.js} +1 -1
- package/dist/client/assets/FilterLines-BzWlfPby.js +1 -0
- package/dist/client/assets/{FlipBackward-GGMv99yc.js → FlipBackward-Bum_Ktlp.js} +1 -1
- package/dist/client/assets/{GitBranch01-BUTuezlq.js → GitBranch01-CVAiK8ZD.js} +1 -1
- package/dist/client/assets/Grid01-AMlhaaWH.js +1 -0
- package/dist/client/assets/Home02-CnvrJTir.js +1 -0
- package/dist/client/assets/Image01-Bch9iOev.js +1 -0
- package/dist/client/assets/{Inbox01-CgwXLK3n.js → Inbox01-y9RgqkXP.js} +1 -1
- package/dist/client/assets/{InfoCircle-D6qJG9Nl.js → InfoCircle-HrYndWCZ.js} +1 -1
- package/dist/client/assets/{Key01-8ewaPBuD.js → Key01-DS2WWoiQ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D0Wjfr3t.js → LinkExternal01-DzBB4jwo.js} +1 -1
- package/dist/client/assets/List-BDW462gC.js +1 -0
- package/dist/client/assets/{Loading01-NW_f44Lz.js → Loading01-OB_JRXd5.js} +1 -1
- package/dist/client/assets/{Lock01-BTPtPjN4.js → Lock01-B_KYH87b.js} +1 -1
- package/dist/client/assets/{Play-CIMfsFF1.js → Play-VfPQ9yON.js} +1 -1
- package/dist/client/assets/{Plus-DaP4KLuJ.js → Plus-CgcZFggs.js} +1 -1
- package/dist/client/assets/{SearchMd-tOSOFUes.js → SearchMd-DRJ07Awx.js} +1 -1
- package/dist/client/assets/{Terminal-ANRX3jJ8.js → Terminal-FTJQx4pc.js} +1 -1
- package/dist/client/assets/{Trash01-CjDzx3jP.js → Trash01-BDWyzvD2.js} +1 -1
- package/dist/client/assets/Upload01-CB1SFmVO.js +1 -0
- package/dist/client/assets/{X-D3ljCSd1.js → X-CVhiWYv-.js} +1 -1
- package/dist/client/assets/{XClose-Ba3zyI0J.js → XClose-C895iFVX.js} +1 -1
- package/dist/client/assets/{alert-dialog-_Gzpv9vf.js → alert-dialog-D9k51qgG.js} +2 -2
- package/dist/client/assets/{auth-catchall-DRL5ZGJM.js → auth-catchall-BDKZr3VK.js} +1 -1
- package/dist/client/assets/avatar-BLmwViC3.js +1 -0
- package/dist/client/assets/badge-CMZTNGZo.js +1 -0
- package/dist/client/assets/binder-Bcr51BHa.js +1 -0
- package/dist/client/assets/button-2azNqzUx.js +1 -0
- package/dist/client/assets/card-WAuUk8Uz.js +1 -0
- package/dist/client/assets/checkbox-E6g3eWVz.js +1 -0
- package/dist/client/assets/{collection-detail-Bu5gtjud.js → collection-detail-DiFfTEhG.js} +2 -2
- package/dist/client/assets/collection-display-button-B3beugJ4.js +1 -0
- package/dist/client/assets/collection-header-MCgfYSgE.js +1 -0
- package/dist/client/assets/{collection-page-B4ZjGX9V.js → collection-page-CB_Az4GO.js} +1 -1
- package/dist/client/assets/collection-search-DL-7oL5d.js +1 -0
- package/dist/client/assets/collection-tab-C_pl92IS.js +1 -0
- package/dist/client/assets/collection-table-wrapper-CAH6fKB1.js +1 -0
- package/dist/client/assets/connection-CXC8d3Ae.js +2 -0
- package/dist/client/assets/connection-card-BTOP5EHD.js +1 -0
- package/dist/client/assets/connection-detail-BHduC6at.js +1 -0
- package/dist/client/assets/connections-Cm-7oBJu.js +1 -0
- package/dist/client/assets/constants-B-ATh8ff.js +1 -0
- package/dist/client/assets/create-organization-dialog-MS4oQ7Sl.js +1 -0
- package/dist/client/assets/dialog-DSU0GEtE.js +1 -0
- package/dist/client/assets/dropdown-menu-DRkETp4T.js +1 -0
- package/dist/client/assets/dynamic-plugin-layout-CXggkl7m.js +1 -0
- package/dist/client/assets/empty-state-C3NzxCFI.js +1 -0
- package/dist/client/assets/empty-state-DKa1iDdq.js +1 -0
- package/dist/client/assets/env-vars-editor-D54i65KN.js +1 -0
- package/dist/client/assets/error-boundary-DU6_J5et.js +1 -0
- package/dist/client/assets/extract-connection-data-Hjw19oaR.js +1 -0
- package/dist/client/assets/file-browser-B8xb3wGm.js +2 -0
- package/dist/client/assets/form-DM9msJYn.js +1 -0
- package/dist/client/assets/gateway-detail-6QzPV4MT.js +1 -0
- package/dist/client/assets/gateways-DcbIYmOg.js +1 -0
- package/dist/client/assets/grid-view-DjeV3XAc.js +1 -0
- package/dist/client/assets/home-BkFYrMbJ.js +1 -0
- package/dist/client/assets/{index-XOpbMEap.js → index-BQiKVu3k.js} +1 -1
- package/dist/client/assets/{index-CBIrwxtj.js → index-C5xxIZ3a.js} +17 -17
- package/dist/client/assets/{index-Bb8rHnPb.js → index-CYR9-1-4.js} +1 -1
- package/dist/client/assets/{index-GoXtajA4.js → index-DUfEAj2z.js} +2 -2
- package/dist/client/assets/index-Dk3lubBQ.js +174 -0
- package/dist/client/assets/index-fFpUC2Bx.css +1 -0
- package/dist/client/assets/infiniteQueryObserver-CUXkVkPG.js +1 -0
- package/dist/client/assets/input-CBrhxHNe.js +1 -0
- package/dist/client/assets/layout-MOaKucBL.js +1 -0
- package/dist/client/assets/{lazy-highlighter-Ccgc_fxj.js → lazy-highlighter-C2ClCxhY.js} +1 -1
- package/dist/client/assets/localstorage-keys-BJk6gyyN.js +1 -0
- package/dist/client/assets/login-RFCnTbJl.js +1 -0
- package/dist/client/assets/mcp-oauth-CuMRVoyP.js +1 -0
- package/dist/client/assets/mcp-server-card-DYesFUUw.js +1 -0
- package/dist/client/assets/mcp-server-detail-CBjpnL21.js +1 -0
- package/dist/client/assets/members-wdr88rOm.js +3 -0
- package/dist/client/assets/{monaco-editor-B_MycISs.js → monaco-editor-B2ZJ-0S4.js} +3 -3
- package/dist/client/assets/{monitoring-CBmCnQ7i.js → monitoring-Cr82twHN.js} +10 -10
- package/dist/client/assets/oauth-callback-BddKzzFQ.js +1 -0
- package/dist/client/assets/page-D_NhUEfH.js +1 -0
- package/dist/client/assets/{page-DrIZd1pO.js → page-DhI0Qooi.js} +2 -2
- package/dist/client/assets/pin-to-sidebar-button-CVN6Bdsp.js +1 -0
- package/dist/client/assets/plugin-empty-state-srmGKRQU.js +1 -0
- package/dist/client/assets/plugin-header-Dg9-cQAj.js +1 -0
- package/dist/client/assets/plugins-Dawnh_sQ.js +1 -0
- package/dist/client/assets/popover-HE15ABOl.js +1 -0
- package/dist/client/assets/project-context-provider-B1gr9e2f.js +1 -0
- package/dist/client/assets/registry-utils-COqteFH4.js +1 -0
- package/dist/client/assets/resizable-B8j7Xubf.js +1 -0
- package/dist/client/assets/resource-tabs-B1oXSRkv.js +1 -0
- package/dist/client/assets/select-DkAjMxeq.js +1 -0
- package/dist/client/assets/settings-Clme5cH0.js +1 -0
- package/dist/client/assets/shell-layout-BuirxVot.js +3 -0
- package/dist/client/assets/spinner-Dwr2EFZD.js +1 -0
- package/dist/client/assets/switch-C9XtHYD0.js +1 -0
- package/dist/client/assets/textarea-CyM57U4B.js +1 -0
- package/dist/client/assets/{thread-history-popover-Dv63nk6L.js → thread-history-popover-DlGwptvV.js} +4 -4
- package/dist/client/assets/tool-set-selector-B9-4X5pd.js +1 -0
- package/dist/client/assets/tools-list-DJqzZm19.js +1 -0
- package/dist/client/assets/tooltip-DHS6wGWv.js +1 -0
- package/dist/client/assets/use-binding-Cn24Ren1.js +23 -0
- package/dist/client/assets/use-collections-CbsNEj5T.js +1 -0
- package/dist/client/assets/use-connection-BhdfednN.js +1 -0
- package/dist/client/assets/{use-connection-resources-BywYCfzc.js → use-connection-resources-D6kK3b1i.js} +1 -1
- package/dist/client/assets/{use-create-gateway-Ca5SEa8I.js → use-create-gateway-dtd5LmVR.js} +1 -1
- package/dist/client/assets/use-gateway-Ck94EUZ3.js +1 -0
- package/dist/client/assets/{use-gateway-system-prompt-B4ia2QxW.js → use-gateway-system-prompt-C9-1moLN.js} +1 -1
- package/dist/client/assets/{use-list-state-CPUcOhR_.js → use-list-state-CQtVDn-T.js} +1 -1
- package/dist/client/assets/use-mcp-C1X3fEnH.js +1 -0
- package/dist/client/assets/{use-members-7eRdYOTr.js → use-members-Bh37cZiw.js} +1 -1
- package/dist/client/assets/{use-mobile--ytA5LT5.js → use-mobile-CuBmA9jm.js} +1 -1
- package/dist/client/assets/use-organization-settings-BNK4p5TK.js +1 -0
- package/dist/client/assets/{use-tool-call-BBonHr6l.js → use-tool-call-DzBMga46.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B7UO0aOm.js +1 -0
- package/dist/client/assets/useMutation-BEX5R6ly.js +1 -0
- package/dist/client/assets/useQuery-BbeI5BfO.js +1 -0
- package/dist/client/assets/value-UH6V0tmj.js +1 -0
- package/dist/client/assets/view-mode-toggle-kdDPGpPT.js +1 -0
- package/dist/client/assets/workflow-DgZwuETF.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +193 -193
- package/dist/server/migrate.js +128 -128
- package/dist/server/server.js +191 -191
- package/package.json +4 -4
- package/dist/client/assets/FilterLines-_uykt7r4.js +0 -1
- package/dist/client/assets/Grid01-BbdtRdR8.js +0 -1
- package/dist/client/assets/auth-C9dSkS_x.js +0 -1
- package/dist/client/assets/avatar-D1o5pnzU.js +0 -1
- package/dist/client/assets/badge-0b6sJe4S.js +0 -1
- package/dist/client/assets/card-B3fsloDi.js +0 -1
- package/dist/client/assets/checkbox-2xIaHvS4.js +0 -1
- package/dist/client/assets/collection-display-button-BGIcja12.js +0 -1
- package/dist/client/assets/collection-header-DhWbmVkk.js +0 -1
- package/dist/client/assets/collection-search-CYZk6T6Z.js +0 -1
- package/dist/client/assets/collection-tab-IeT0mJ-2.js +0 -1
- package/dist/client/assets/collection-table-wrapper-D2niE2Ci.js +0 -1
- package/dist/client/assets/connection-card-D0c_wvmz.js +0 -1
- package/dist/client/assets/connection-detail-BmNPUV8x.js +0 -1
- package/dist/client/assets/connections-U2y3agtD.js +0 -1
- package/dist/client/assets/constants-Cy709IUA.js +0 -1
- package/dist/client/assets/create-organization-dialog-D0WQQsLG.js +0 -1
- package/dist/client/assets/dialog-BXeLl5mO.js +0 -1
- package/dist/client/assets/dropdown-menu-CnL8UM0z.js +0 -1
- package/dist/client/assets/empty-state-BmkZOMzL.js +0 -1
- package/dist/client/assets/empty-state-DzS1Zp7m.js +0 -2
- package/dist/client/assets/env-vars-editor-B_mIaT86.js +0 -1
- package/dist/client/assets/error-boundary-BQnJ9S9E.js +0 -1
- package/dist/client/assets/extract-connection-data-DPoJQhk8.js +0 -1
- package/dist/client/assets/form-DrOt6d2d.js +0 -1
- package/dist/client/assets/gateway-detail-CniDbJPb.js +0 -1
- package/dist/client/assets/gateways-DmEpJOpx.js +0 -1
- package/dist/client/assets/home-HrkEcREJ.js +0 -1
- package/dist/client/assets/index-ChrSnaFS.css +0 -1
- package/dist/client/assets/index-DMNk-OUX.js +0 -163
- package/dist/client/assets/input-68J17rBp.js +0 -1
- package/dist/client/assets/layout-Olb4shdE.js +0 -1
- package/dist/client/assets/localstorage-keys-C62ZbWuB.js +0 -1
- package/dist/client/assets/login-UTKAAaeX.js +0 -1
- package/dist/client/assets/mcp-oauth-Db8WtQ8u.js +0 -1
- package/dist/client/assets/mcp-server-detail-BvVQovUz.js +0 -1
- package/dist/client/assets/members-V-vtwMYY.js +0 -3
- package/dist/client/assets/oauth-callback-BYBqbF1w.js +0 -1
- package/dist/client/assets/page-DYF0Qz3l.js +0 -1
- package/dist/client/assets/pin-to-sidebar-button-B1xHHS9n.js +0 -1
- package/dist/client/assets/popover-DC9U4d6e.js +0 -1
- package/dist/client/assets/project-context-provider-BJIP5a-U.js +0 -1
- package/dist/client/assets/registry-utils-B7t_ZBUi.js +0 -1
- package/dist/client/assets/resizable-CW5_SPIS.js +0 -1
- package/dist/client/assets/resource-tabs-BKSlcL1W.js +0 -1
- package/dist/client/assets/select-B9KJyTZZ.js +0 -1
- package/dist/client/assets/server-name-C3ttWdyD.js +0 -1
- package/dist/client/assets/settings-CYg4YPRI.js +0 -1
- package/dist/client/assets/shell-layout-KIN6fL5j.js +0 -3
- package/dist/client/assets/spinner-B0sczm1j.js +0 -1
- package/dist/client/assets/switch-BuVvmF04.js +0 -1
- package/dist/client/assets/textarea-BAUX8Qgd.js +0 -1
- package/dist/client/assets/tool-set-selector-DMsE0yRo.js +0 -1
- package/dist/client/assets/tools-list-Dgf0oqyC.js +0 -1
- package/dist/client/assets/use-binding-Dj4lal1A.js +0 -34
- package/dist/client/assets/use-connection-DoWszS3j.js +0 -1
- package/dist/client/assets/use-gateway-CRpsitbG.js +0 -1
- package/dist/client/assets/use-mcp-L2lisTXg.js +0 -1
- package/dist/client/assets/use-organization-settings-D6rXW2c_.js +0 -1
- package/dist/client/assets/value-Bd2XBV_y.js +0 -1
- package/dist/client/assets/view-mode-toggle-BpjQ6V4P.js +0 -1
- package/dist/client/assets/workflow-CjynHD6b.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as C,f as B,s as D,y as K,x as P,j as s,v as $,c as Q,t as N,K as U,a as H,w as R}from"./index-DMNk-OUX.js";import{C as A}from"./collection-header-DhWbmVkk.js";import{C as V}from"./collection-page-B4ZjGX9V.js";import{u as W}from"./project-context-provider-BJIP5a-U.js";import{u as Y,I,B as S}from"./input-68J17rBp.js";import{a as G,F as k,b as L,c as O,d as E,f as M,e as J}from"./form-DrOt6d2d.js";import{i as T}from"./X-D3ljCSd1.js";import"./collection-display-button-BGIcja12.js";import"./dropdown-menu-CnL8UM0z.js";import"./Grid01-BbdtRdR8.js";import"./Check-JFkjTCfG.js";import"./view-mode-toggle-BpjQ6V4P.js";const q=({size:d=24,color:e="currentColor",...a})=>C.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},C.createElement("path",{d:"M21 15v1.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.2V15m14-7-5-5m0 0L7 8m5-5v12"}));q.displayName="Upload01";const X=$({name:R().min(1,"Name is required").max(255,"Name is too long"),slug:R().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:R().optional()});function Z(d){const e=Q.c(24),{value:a,onChange:r,name:m}=d,o=C.useRef(null);let u;e[0]!==r?(u=z=>{const F=z.target.files?.[0];if(F){if(F.size>2097152){N.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const y=c.error;console.error("FileReader error:",y),N.error(y?.message||"Failed to read image file. Please try again."),o.current&&(o.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const y=c.result;r(y)}},c.readAsDataURL(F)}},e[0]=r,e[1]=u):u=e[1];const j=u;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{o.current?.click()},e[2]=i):i=e[2];const t=i;let l;e[3]!==r?(l=z=>{z.stopPropagation(),r("")},e[3]=r,e[4]=l):l=e[4];const n=l;let g;e[5]!==j?(g=s.jsx("input",{type:"file",ref:o,className:"hidden",accept:"image/*",onChange:j}),e[5]=j,e[6]=g):g=e[6];let h;e[7]!==n||e[8]!==m||e[9]!==a?(h=a?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:a,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:n,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(T,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(q,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=a,e[10]=h):h=e[10];const w=a?"Change Logo":"Upload Logo";let x;e[11]!==w?(x=s.jsx(S,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:w}),e[11]=w,e[12]=x):x=e[12];let f;e[13]!==n||e[14]!==a?(f=a&&s.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=a,e[15]=f):f=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=v):v=e[16];let p;e[17]!==x||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[x,f,v]}),e[17]=x,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==h?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,h,p]}),e[20]=p,e[21]=g,e[22]=h,e[23]=b):b=e[23],b}function me(){const d=B(),{org:e}=W(),a=D(),[r,m]=C.useState(!1),o=K({resolver:P(X),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=Y({mutationFn:async t=>{const l={name:t.name,slug:t.slug};t.logo&&(l.logo=t.logo);const n=await H.organization.update({organizationId:e.id,data:l});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{a.invalidateQueries({queryKey:U.organizations()}),a.invalidateQueries({queryKey:U.activeOrganization(e.slug)}),N.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{N.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},i=o.formState.isDirty;return s.jsxs(V,{children:[s.jsx(A,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(G,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(j),className:"space-y-6",children:[s.jsx(k,{control:o.control,name:"name",render:({field:t})=>s.jsxs(L,{children:[s.jsx(O,{children:"Organization Name"}),s.jsx(E,{children:s.jsx(I,{placeholder:"My Organization",...t,disabled:r})}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"slug",render:({field:t})=>s.jsxs(L,{children:[s.jsx(O,{children:"Organization Slug"}),s.jsx(E,{children:s.jsx(I,{placeholder:"my-organization",...t,disabled:r,onChange:l=>{const n=l.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(J,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(M,{})]})}),s.jsx(k,{control:o.control,name:"logo",render:({field:t})=>s.jsxs(L,{children:[s.jsx(O,{children:"Logo"}),s.jsx(E,{children:s.jsx(Z,{value:t.value,onChange:t.onChange,name:o.watch("name")})}),s.jsx(M,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(S,{type:"submit",disabled:!i||r,className:"min-w-24",children:r?"Saving...":"Save Changes"}),i&&s.jsx(S,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:r,children:"Cancel"})]})]})})]})})})})})]})}export{me as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as S,e as ts,a as q,j as n,f as $e,t as Y,c as p,R as ss,T as ns,D as as,C as os,P as is,g as ls,O as rs,h as cs,i as ds,k as St,l as ms,d as Nt,G as fs,m as us,S as wt,n as hs,o as ps,N as xs,p as gs,K as bs,q as yt}from"./index-DMNk-OUX.js";import{E as lt}from"./error-boundary-BQnJ9S9E.js";import{B as J,c as T,I as js}from"./input-68J17rBp.js";import{P as Ct,a as _t,b as kt}from"./popover-DC9U4d6e.js";import{B as mt}from"./badge-0b6sJe4S.js";import{i as Ge}from"./Check-JFkjTCfG.js";import{n as ft}from"./Inbox01-CgwXLK3n.js";import{s as ut}from"./XClose-Ba3zyI0J.js";import{i as vs}from"./File06-D0TXCuMx.js";import{i as ze}from"./X-D3ljCSd1.js";import{u as Me}from"./use-mobile--ytA5LT5.js";import{T as It,a as zt,b as $t,c as Mt,u as We,L as ht,P as Ss,O as Ns}from"./project-context-provider-BJIP5a-U.js";import{S as Ot,u as ws,a as ys,b as Cs,c as _s,N as ks,G as at,T as Is,d as zs,D as $s}from"./thread-history-popover-Dv63nk6L.js";import{u as Tt,a as Ms}from"./use-organization-settings-D6rXW2c_.js";import{n as Os,I as pt}from"./empty-state-DzS1Zp7m.js";import{i as ot}from"./use-gateway-CRpsitbG.js";import{C as Ts}from"./create-organization-dialog-D0WQQsLG.js";import{A as ee}from"./avatar-D1o5pnzU.js";import{c as As}from"./Grid01-BbdtRdR8.js";import{D as Rs,a as Es,b as Ls,c as Ps,u as Ds,d as Bs,e as Hs,C as L,f as xt,g as Us,h as Gs,i as Ws,U as Fs,G as Vs,M as Ks}from"./index-CBIrwxtj.js";import{D as Zs,a as Ys,b as qs,c as Js,d as gt}from"./dropdown-menu-CnL8UM0z.js";import{a as At}from"./Copy01-Dadp_RDG.js";import{n as bt}from"./LinkExternal01-D0Wjfr3t.js";import{D as Xs,a as Qs,b as en,c as tn,d as sn}from"./dialog-BXeLl5mO.js";import{L as nn}from"./form-DrOt6d2d.js";import{S as an}from"./switch-BuVvmF04.js";import{i as on}from"./Code01-CgNchnl3.js";import{u as Fe,L as Ve}from"./localstorage-keys-C62ZbWuB.js";import{R as Rt,a as ln,b as rn}from"./resizable-CW5_SPIS.js";import{s as cn}from"./Plus-DaP4KLuJ.js";import{u as dn}from"./use-connection-DoWszS3j.js";import{u as mn}from"./use-binding-Dj4lal1A.js";import"./use-gateway-system-prompt-B4ia2QxW.js";import"./ChevronDown-HtFMO0lw.js";import"./Edit01-CxRkZTQ1.js";import"./well-known-mcp-D13f-8h2.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CW5u1cfj.js";import"./SearchMd-tOSOFUes.js";import"./Trash01-CjDzx3jP.js";import"./alert-dialog-_Gzpv9vf.js";import"./spinner-B0sczm1j.js";import"./use-create-gateway-Ca5SEa8I.js";import"./AlertCircle-Cso_Xxvk.js";import"./textarea-BAUX8Qgd.js";import"./Terminal-ANRX3jJ8.js";import"./monaco-editor-B_MycISs.js";import"./select-B9KJyTZZ.js";import"./InfoCircle-D6qJG9Nl.js";import"./auth-C9dSkS_x.js";const Et=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));Et.displayName="BarChart10";const Lt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));Lt.displayName="Building02";const Pt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Pt.displayName="ChevronSelectorVertical";const Dt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));Dt.displayName="Globe01";const Bt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));Bt.displayName="Home02";const Ht=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 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 3Z"}));Ht.displayName="LayoutRight";const Ut=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));Ut.displayName="LogOut01";const Gt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Gt.displayName="Mail01";const rt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),S.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));rt.displayName="Settings01";const Wt=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Wt.displayName="Users01";const Ft=({size:t=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Ft.displayName="Zap";function fn({invitation:t,onStatusChange:e}){const[s,a]=S.useState(!1),[o,i]=S.useState(!1),l=$e(),r=async()=>{a(!0);try{const f=await q.organization.acceptInvitation({invitationId:t.id});if(f.error)Y.error(f.error.message),a(!1);else{e(t.id,"accepted");const x=await q.organization.setActive({organizationId:t.organizationId});x?.data?.slug?(Y.success("Invitation accepted!"),l({to:"/$org",params:{org:x.data.slug}})):(Y.success("Invitation accepted! Redirecting..."),l({to:"/"}))}}catch{Y.error("Failed to accept invitation"),a(!1)}},c=async()=>{i(!0);try{const f=await q.organization.rejectInvitation({invitationId:t.id});f.error?(Y.error(f.error.message),i(!1)):(Y.success("Invitation rejected"),e(t.id,"rejected"),i(!1))}catch{Y.error("Failed to reject invitation"),i(!1)}},d=t.organizationName||t.organizationId,m=t.inviter?.name||t.inviter?.email||t.email||"Someone",u=t.status==="pending",h=t.status==="accepted",b=t.status==="rejected";return n.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0 ${u?"":"opacity-50"}`,children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(Gt,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:[n.jsx("span",{className:"font-semibold inline-block max-w-[120px] truncate align-bottom",children:m})," invited you to join ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:u?n.jsxs(n.Fragment,{children:[n.jsx(J,{variant:"ghost",size:"icon",onClick:c,disabled:s||o,className:"h-8 w-8",children:n.jsx(ut,{size:14})}),n.jsx(J,{variant:"outline",size:"icon",onClick:r,disabled:s||o,className:"h-8 w-8",children:n.jsx(Ge,{size:14})})]}):h?n.jsxs(mt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(Ge,{size:12}),"Accepted"]}):b?n.jsxs(mt,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ut,{size:12}),"Declined"]}):null})]})}function un(){const[t,e]=S.useState(!1),s=S.useContext(ts),{data:a}=s.hooks.useListUserInvitations(),{data:o}=q.useListOrganizations(),[i,l]=S.useState({}),d=(a??[]).map(f=>{const x=(o??[]).find(g=>g.id===f.organizationId);return{...f,organizationSlug:x?.slug||f.organizationSlug,organizationName:x?.name||f.organizationName}}).map(f=>({...f,status:i[f.id]||f.status})),m=[...d].sort((f,x)=>{const g={pending:0,accepted:1,rejected:2};return(g[f.status]??999)-(g[x.status]??999)}),h=d.filter(f=>f.status==="pending").length>0,b=(f,x)=>{l(g=>({...g,[f]:x}))};return n.jsxs(Ct,{open:t,onOpenChange:e,children:[n.jsx(_t,{asChild:!0,children:n.jsxs(J,{variant:"ghost",size:"sm",className:"relative h-7 w-7 p-0","aria-label":"Inbox",children:[n.jsx(ft,{size:18,className:"text-muted-foreground"}),h&&n.jsx("span",{className:"absolute bottom-1 right-0.5 h-2 w-2 rounded-full bg-destructive ring-2 ring-background"})]})}),n.jsxs(kt,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:m.length>0?m.map(f=>n.jsx(fn,{invitation:f,onStatusChange:b},f.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(ft,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})}function hn(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ss,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function pn(t){const e=p.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(is,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function xn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(rs,{"data-slot":"sheet-overlay",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function gn(t){const e=p.c(17);let s,a,o,i;e[0]!==t?({className:a,children:s,side:i,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);const l=i===void 0?"right":i;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(xn,{}),e[5]=r):r=e[5];const c=l==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=l==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=l==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",u=l==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==u?(h=T("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,u,a),e[6]=a,e[7]=c,e[8]=d,e[9]=m,e[10]=u,e[11]=h):h=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(ls,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n.jsx(ze,{className:"size-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=b):b=e[12];let f;return e[13]!==s||e[14]!==o||e[15]!==h?(f=n.jsxs(pn,{children:[r,n.jsxs(os,{"data-slot":"sheet-content",className:h,...o,children:[s,b]})]}),e[13]=s,e[14]=o,e[15]=h,e[16]=f):f=e[16],f}function bn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sheet-header",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function jn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("text-foreground font-semibold",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(ns,{"data-slot":"sheet-title",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function vn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("text-muted-foreground text-sm",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx(as,{"data-slot":"sheet-description",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}const Sn="sidebar_state",Nn=3600*24*7,wn="16rem",yn="18rem",Cn="3rem",_n="b",Vt=S.createContext(null);function ct(){const t=S.useContext(Vt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function kn(t){const e=p.c(21),{defaultOpen:s,open:a,onOpenChange:o,children:i}=t,l=s===void 0?!0:s,r=Me(),[c,d]=S.useState(!1),[m,u]=S.useState(l),h=a??m;let b;e[0]!==h||e[1]!==o?(b=I=>{const w=typeof I=="function"?I(h):I;o?o(w):u(w),document.cookie=`${Sn}=${w}; path=/; max-age=${Nn}`},e[0]=h,e[1]=o,e[2]=b):b=e[2];const f=b;let x;e[3]!==r||e[4]!==f?(x=()=>r?d(zn):f(In),e[3]=r,e[4]=f,e[5]=x):x=e[5];const g=x;let j,v;e[6]!==g?(j=()=>{const I=w=>{if(w.key===_n&&(w.metaKey||w.ctrlKey)){const z=w.target;if(z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable)return;w.preventDefault(),g()}};return globalThis.addEventListener("keydown",I),()=>globalThis.removeEventListener("keydown",I)},v=[g],e[6]=g,e[7]=j,e[8]=v):(j=e[7],v=e[8]),S.useEffect(j,v);const C=h?"expanded":"collapsed";let $;e[9]!==r||e[10]!==h||e[11]!==c||e[12]!==f||e[13]!==C||e[14]!==g?($={state:C,open:h,setOpen:f,isMobile:r,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=r,e[10]=h,e[11]=c,e[12]=f,e[13]=C,e[14]=g,e[15]=$):$=e[15];const _=$;let N;e[16]!==i?(N=n.jsx(zt,{delayDuration:0,children:i}),e[16]=i,e[17]=N):N=e[17];let k;return e[18]!==_||e[19]!==N?(k=n.jsx(Vt.Provider,{value:_,children:N}),e[18]=_,e[19]=N,e[20]=k):k=e[20],k}function In(t){return!t}function zn(t){return!t}function $n(t){const e=p.c(14);let s,a,o,i;e[0]!==t?({className:a,style:i,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);let l;e[5]!==i?(l={"--sidebar-width":wn,"--sidebar-width-icon":Cn,...i},e[5]=i,e[6]=l):l=e[6];const r=l;let c;e[7]!==a?(c=T("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==o||e[11]!==r||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:c,...o,children:s}),e[9]=s,e[10]=o,e[11]=r,e[12]=c,e[13]=d):d=e[13],d}function Mn(t){const e=p.c(46);let s,a,o,i,l,r;e[0]!==t?({side:i,variant:l,collapsible:r,className:a,children:s,...o}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l,e[6]=r):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5],r=e[6]);const c=i===void 0?"left":i,d=l===void 0?"sidebar":l,m=r===void 0?"offcanvas":r,{isMobile:u,state:h,openMobile:b,setOpenMobile:f}=ct();if(m==="none"){let w;e[7]!==a?(w=T("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=w):w=e[8];let z;return e[9]!==s||e[10]!==o||e[11]!==w?(z=n.jsx("div",{"data-slot":"sidebar",className:w,...o,children:s}),e[9]=s,e[10]=o,e[11]=w,e[12]=z):z=e[12],z}if(u){let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w={"--sidebar-width":yn},e[13]=w):w=e[13];let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(bn,{className:"sr-only",children:[n.jsx(jn,{children:"Sidebar"}),n.jsx(vn,{children:"Displays the mobile sidebar."})]}),e[14]=z):z=e[14];let y;e[15]!==s?(y=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=y):y=e[16];let M;e[17]!==c||e[18]!==y?(M=n.jsxs(gn,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:w,side:c,children:[z,y]}),e[17]=c,e[18]=y,e[19]=M):M=e[19];let A;return e[20]!==b||e[21]!==o||e[22]!==f||e[23]!==M?(A=n.jsx(hn,{open:b,onOpenChange:f,...o,children:M}),e[20]=b,e[21]=o,e[22]=f,e[23]=M,e[24]=A):A=e[24],A}const x=h==="collapsed"?m:"",g=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let j;e[25]!==g?(j=T("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=j):j=e[26];let v;e[27]!==j?(v=n.jsx("div",{"data-slot":"sidebar-gap",className:j}),e[27]=j,e[28]=v):v=e[28];const C=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",$=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let _;e[29]!==a||e[30]!==C||e[31]!==$?(_=T("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",C,$,a),e[29]=a,e[30]=C,e[31]=$,e[32]=_):_=e[32];let N;e[33]!==s?(N=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=N):N=e[34];let k;e[35]!==o||e[36]!==_||e[37]!==N?(k=n.jsx("div",{"data-slot":"sidebar-container",className:_,...o,children:N}),e[35]=o,e[36]=_,e[37]=N,e[38]=k):k=e[38];let I;return e[39]!==c||e[40]!==h||e[41]!==k||e[42]!==x||e[43]!==v||e[44]!==d?(I=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":x,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[v,k]}),e[39]=c,e[40]=h,e[41]=k,e[42]=x,e[43]=v,e[44]=d,e[45]=I):I=e[45],I}function On(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("main",{"data-slot":"sidebar-inset",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Tn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("h-4 m-0! w-full",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-sidebar":"separator",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function An(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Rn(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function En(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("w-full text-sm",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Ln(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}function Ke(t){const e=p.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let o;e[3]!==s?(o=T("group/menu-item relative",s),e[3]=s,e[4]=o):o=e[4];let i;return e[5]!==a||e[6]!==o?(i=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...a}),e[5]=a,e[6]=o,e[7]=i):i=e[7],i}const Pn=cs("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Kt(t){const e=p.c(28);let s,a,o,i,l,r,c;e[0]!==t?({asChild:o,isActive:i,variant:l,size:r,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l,e[6]=r,e[7]=c):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5],r=e[6],c=e[7]);const d=o===void 0?!1:o,m=i===void 0?!1:i,u=l===void 0?"default":l,h=r===void 0?"default":r,b=d?ds:"button",{isMobile:f,state:x}=ct();let g;e[8]!==s||e[9]!==h||e[10]!==u?(g=T(Pn({variant:u,size:h}),s),e[8]=s,e[9]=h,e[10]=u,e[11]=g):g=e[11];let j;e[12]!==b||e[13]!==m||e[14]!==a||e[15]!==h||e[16]!==g?(j=n.jsx(b,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":m,className:g,...a}),e[12]=b,e[13]=m,e[14]=a,e[15]=h,e[16]=g,e[17]=j):j=e[17];const v=j;if(!c)return v;if(typeof c=="string"){let k;e[18]!==c?(k={children:c},e[18]=c,e[19]=k):k=e[19],c=k}let C;e[20]!==v?(C=n.jsx($t,{asChild:!0,children:v}),e[20]=v,e[21]=C):C=e[21];const $=x!=="collapsed"||f;let _;e[22]!==$||e[23]!==c?(_=n.jsx(It,{side:"right",align:"center",hidden:$,...c}),e[22]=$,e[23]=c,e[24]=_):_=e[24];let N;return e[25]!==C||e[26]!==_?(N=n.jsxs(Mt,{children:[C,_]}),e[25]=C,e[26]=_,e[27]=N):N=e[27],N}function Dn(t){const e=p.c(26),{item:s}=t,a=$e(),{org:o}=We(),i=Tt(o.id),l=Ms(o.id);let r;e[0]!==l.update||e[1]!==s.url||e[2]!==i?.sidebar_items?(r=async()=>{const $=(i?.sidebar_items||[]).filter(_=>_.url!==s.url);await l.update.mutateAsync({sidebar_items:$})},e[0]=l.update,e[1]=s.url,e[2]=i?.sidebar_items,e[3]=r):r=e[3];const c=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const u=m;let h;e[7]!==s.url||e[8]!==a?(h=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=h):h=e[9];const b=s.title;let f;e[10]!==u||e[11]!==s.icon||e[12]!==s.title?(f=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:u?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(vs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=u,e[11]=s.icon,e[12]=s.title,e[13]=f):f=e[13];let x;e[14]!==s.title?(x=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=x):x=e[15];let g;e[16]!==x?(g=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:x})}),e[16]=x,e[17]=g):g=e[17];let j;e[18]!==c?(j=n.jsx(ze,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:C=>{C.preventDefault(),C.stopPropagation(),c()}}),e[18]=c,e[19]=j):j=e[19];let v;return e[20]!==s.title||e[21]!==h||e[22]!==f||e[23]!==g||e[24]!==j?(v=n.jsx(Ke,{children:n.jsxs(Kt,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:h,tooltip:b,children:[f,g,j]})}),e[20]=s.title,e[21]=h,e[22]=f,e[23]=g,e[24]=j,e[25]=v):v=e[25],v}function Bn(){const t=p.c(4),{org:e}=We(),a=Tt(e.id)?.sidebar_items;if(!a?.length)return null;let o;t[0]!==a?(o=a.map(Hn),t[0]=a,t[1]=o):o=t[1];let i;return t[2]!==o?(i=n.jsx(Zt,{children:o}),t[2]=o,t[3]=i):i=t[3],i}function Hn(t){return n.jsx(Dn,{item:t},t.url)}function jt(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ke,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Ot,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Zt(t){const e=p.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Tn,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ke,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=o):o=e[1];let i;return e[2]!==s?(i=n.jsxs(n.Fragment,{children:[a,o,s]}),e[2]=s,e[3]=i):i=e[3],i}function Un(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(S.Suspense,{fallback:n.jsxs(Zt,{children:[n.jsx(jt,{}),n.jsx(jt,{})]}),children:n.jsx(Bn,{})}),t[0]=e):e=t[0],e}function Gn(){const t=p.c(49),{locator:e}=We(),s=$e(),a=St();let o;t[0]!==e?(o=ht.parse(e),t[0]=e,t[1]=o):o=t[1];const{org:i}=o;let l;t[2]!==e?(l=ht.isOrgAdminProject(e),t[2]=e,t[3]=l):l=t[3];const r=l,c=a.location.pathname===`/${i}`||a.location.pathname===`/${i}/`;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Bt,{}),t[4]=d):d=t[4];let m;t[5]!==c||t[6]!==s||t[7]!==i?(m={key:"home",label:"Home",icon:d,onClick:()=>{c?window.dispatchEvent(new CustomEvent("reset-home-view")):s({to:"/$org",params:{org:i}})}},t[5]=c,t[6]=s,t[7]=i,t[8]=m):m=t[8];let u;t[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Lt,{}),t[9]=u):u=t[9];let h;t[10]!==s||t[11]!==i?(h={key:"store",label:"Store",icon:u,onClick:()=>s({to:"/$org/store",params:{org:i}})},t[10]=s,t[11]=i,t[12]=h):h=t[12];let b;t[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Os,{}),t[13]=b):b=t[13];let f;t[14]!==s||t[15]!==i?(f={key:"mcps",label:"Connections",icon:b,onClick:()=>s({to:"/$org/mcps",params:{org:i}})},t[14]=s,t[15]=i,t[16]=f):f=t[16];let x;t[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(ot,{}),t[17]=x):x=t[17];let g;t[18]!==s||t[19]!==i?(g={key:"gateways",label:"Agents",icon:x,onClick:()=>s({to:"/$org/gateways",params:{org:i}})},t[18]=s,t[19]=i,t[20]=g):g=t[20];let j;t[21]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ft,{}),t[21]=j):j=t[21];let v;t[22]!==s||t[23]!==i?(v={key:"workflow",label:"Workflows",icon:j,onClick:()=>s({to:"/$org/workflows",params:{org:i}})},t[22]=s,t[23]=i,t[24]=v):v=t[24];let C;t[25]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(Et,{}),t[25]=C):C=t[25];let $;t[26]!==s||t[27]!==i?($={key:"monitoring",label:"Monitoring",icon:C,onClick:()=>s({to:"/$org/monitoring",params:{org:i}})},t[26]=s,t[27]=i,t[28]=$):$=t[28];let _;t[29]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Wt,{}),t[29]=_):_=t[29];let N;t[30]!==s||t[31]!==i?(N={key:"members",label:"Members",icon:_,onClick:()=>s({to:"/$org/members",params:{org:i}})},t[30]=s,t[31]=i,t[32]=N):N=t[32];let k;t[33]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(rt,{}),t[33]=k):k=t[33];let I;t[34]!==s||t[35]!==i?(I={key:"settings",label:"Settings",icon:k,onClick:()=>s({to:"/$org/settings",params:{org:i}})},t[34]=s,t[35]=i,t[36]=I):I=t[36];let w;t[37]!==v||t[38]!==$||t[39]!==N||t[40]!==I||t[41]!==m||t[42]!==h||t[43]!==f||t[44]!==g?(w=[m,h,f,g,v,$,N,I],t[37]=v,t[38]=$,t[39]=N,t[40]=I,t[41]=m,t[42]=h,t[43]=f,t[44]=g,t[45]=w):w=t[45];const z=w;let y;return t[46]!==z||t[47]!==r?(y=r?z:[],t[46]=z,t[47]=r,t[48]=y):y=t[48],y}function Yt(t){const e=p.c(10),{navigationItems:s,footer:a,additionalContent:o,variant:i,collapsible:l}=t,r=i===void 0?"sidebar":i,c=l===void 0?"icon":l;let d;e[0]!==s?(d=s.map(Wn),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=n.jsx(An,{className:"flex-1 overflow-x-hidden",children:n.jsx(Rn,{className:"font-medium",children:n.jsx(En,{children:n.jsxs(Ln,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let u;return e[5]!==c||e[6]!==a||e[7]!==m||e[8]!==r?(u=n.jsxs(Mn,{variant:r,collapsible:c,children:[m,a]}),e[5]=c,e[6]=a,e[7]=m,e[8]=r,e[9]=u):u=e[9],u}function Wn(t){return n.jsx(Ke,{children:n.jsxs(Kt,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Yt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ot,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Fn(){const t=p.c(3),e=Gn();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(n.Fragment,{children:n.jsx(lt,{children:n.jsx(S.Suspense,{fallback:null,children:n.jsx(Un,{})})})}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(Yt,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=a):a=t[2],a}function Vn(t){const e=p.c(12);let s,a,o,i;e[0]!==t?({className:s,orientation:o,decorative:i,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i):(s=e[1],a=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,r=i===void 0?!0:i;let c;e[5]!==s?(c=T("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==l||e[9]!==a||e[10]!==c?(d=n.jsx(ms,{"data-slot":"separator-root",decorative:r,orientation:l,className:c,...a}),e[7]=r,e[8]=l,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const qt=S.createContext(null);function Kn(){const t=S.useContext(qt);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Zn(t){const e=p.c(10),{children:s,onItemHover:a}=t,[o,i]=S.useState(null);let l;e[0]!==a?(l=u=>{i(u),a?.(u)},e[0]=a,e[1]=l):l=e[1];const r=l;let c;e[2]!==o||e[3]!==r?(c={hoveredItem:o,setHoveredItem:r},e[2]=o,e[3]=r,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ct,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(qt.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function Yn(t){const e=p.c(6),{children:s,onClick:a}=t;let o;e[0]!==s||e[1]!==a?(o=n.jsx(J,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=o):o=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(_t,{asChild:!0,children:n.jsx(J,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(Pt,{size:16,className:"opacity-50"})})}),e[3]=i):i=e[3];let l;return e[4]!==o?(l=n.jsxs("div",{className:"flex items-center gap-1",children:[o,i]}),e[4]=o,e[5]=l):l=e[5],l}function qn(t){const e=p.c(8),{item:s,fallback:a}=t,o=a===void 0?"":a,i=s?.avatarUrl??"",l=s?.name??o;let r;e[0]!==i||e[1]!==l?(r=n.jsx(ee,{url:i,fallback:l,size:"xs",objectFit:"contain"}),e[0]=i,e[1]=l,e[2]=r):r=e[2];const c=s?.name??o;let d;e[3]!==c?(d=n.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==r||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[r,d]}),e[5]=r,e[6]=d,e[7]=m):m=e[7],m}function Jn(t){const e=p.c(6),{children:s,align:a}=t,o=a===void 0?"start":a,l=S.Children.toArray(s).filter(Xn).length===1?"280px":"480px";let r;e[0]!==l?(r={width:l},e[0]=l,e[1]=r):r=e[1];let c;return e[2]!==o||e[3]!==s||e[4]!==r?(c=n.jsx(kt,{align:o,className:"p-0 flex items-start",style:r,children:s}),e[2]=o,e[3]=s,e[4]=r,e[5]=c):c=e[5],c}function Xn(t){return S.isValidElement(t)&&(t.type===Xt||t.type===Jt)}function Jt(t){const e=p.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}const Xt=Jt;function Qn(t){const e=p.c(6),{placeholder:s,value:a,onChange:o}=t,i=s===void 0?"Search...":s;let l;e[0]!==o?(l=c=>o(c.target.value),e[0]=o,e[1]=l):l=e[1];let r;return e[2]!==i||e[3]!==l||e[4]!==a?(r=n.jsx(js,{placeholder:i,value:a,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=i,e[3]=l,e[4]=a,e[5]=r):r=e[5],r}function ea(t){const e=p.c(6),{children:s,emptyMessage:a}=t,o=a===void 0?"No items found.":a,i=S.Children.count(s)>0;let l;e[0]!==o||e[1]!==i?(l=!i&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=i,e[2]=l):l=e[2];let r;return e[3]!==s||e[4]!==l?(r=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,s]}),e[3]=s,e[4]=l,e[5]=r):r=e[5],r}function ta(t){const e=p.c(15),{item:s,onClick:a,onHover:o,children:i}=t,l=Kn();let r;e[0]!==l||e[1]!==s||e[2]!==o?(r=()=>{l.setHoveredItem(s.slug),o?.(s)},e[0]=l,e[1]=s,e[2]=o,e[3]=r):r=e[3];const c=r;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==i||e[8]!==s.avatarUrl||e[9]!==s.name?(m=i||n.jsxs(n.Fragment,{children:[n.jsx(ee,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=i,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let u;return e[11]!==c||e[12]!==d||e[13]!==m?(u=n.jsx(J,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function sa(t){const e=p.c(2),{children:s}=t;let a;return e[0]!==s?(a=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function na(t){const e=p.c(11),{onClick:s,icon:a,children:o,variant:i}=t,r=(i===void 0?"default":i)==="muted"&&"text-muted-foreground";let c;e[0]!==r?(c=T("w-full justify-start font-normal",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==a?(d=a&&n.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==o?(m=n.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let u;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(u=n.jsxs(J,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=u):u=e[10],u}function aa(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Vn,{}),t[0]=e):e=t[0],e}function oa(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const G=Object.assign(Zn,{Trigger:Yn,CurrentItem:qn,Content:Jn,Panel:Xt,Search:Qn,Items:ea,Item:ta,Actions:sa,Action:na,Separator:aa,Skeleton:oa});function it(){const t=p.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=Nt(e),{data:a}=q.useListOrganizations(),o=$e();let i;t[1]!==s||t[2]!==a?(i=a?.find(R=>R.slug===s),t[1]=s,t[2]=a,t[3]=i):i=t[3];const l=i,[r,c]=S.useState(""),[d,m]=S.useState(!1);let u,h,b,f,x,g,j,v;if(t[4]!==l||t[5]!==o||t[6]!==s||t[7]!==r||t[8]!==a){const D=(a?(()=>{const P=a.filter(V=>V.name.toLowerCase().includes(r.toLowerCase()));if(s){const V=P.findIndex(X=>X.slug===s);if(V>0){const X=P[V];X&&(P.splice(V,1),P.unshift(X))}}return P})():[]).map(ia);let B;t[17]!==l?(B=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=B):B=t[18];const O=B;f=G;let U;t[19]!==o||t[20]!==s?(U=()=>o({to:"/$org",params:{org:s??""}}),t[19]=o,t[20]=s,t[21]=U):U=t[21];let E;t[22]!==O?(E=n.jsx(G.CurrentItem,{item:O}),t[22]=O,t[23]=E):E=t[23],t[24]!==U||t[25]!==E?(v=n.jsx(G.Trigger,{onClick:U,children:E}),t[24]=U,t[25]=E,t[26]=v):v=t[26],b=G.Content,h=G.Panel,t[27]!==r?(j=n.jsx(G.Search,{placeholder:"Search organizations...",value:r,onChange:c}),t[27]=r,t[28]=j):j=t[28],u=G.Items,x="No organizations found.";let W;t[29]!==o?(W=P=>n.jsx(G.Item,{item:P,onClick:V=>o({to:"/$org",params:{org:V.slug}})},P.slug),t[29]=o,t[30]=W):W=t[30],g=D.map(W),t[4]=l,t[5]=o,t[6]=s,t[7]=r,t[8]=a,t[9]=u,t[10]=h,t[11]=b,t[12]=f,t[13]=x,t[14]=g,t[15]=j,t[16]=v}else u=t[9],h=t[10],b=t[11],f=t[12],x=t[13],g=t[14],j=t[15],v=t[16];let C;t[31]!==u||t[32]!==x||t[33]!==g?(C=n.jsx(u,{emptyMessage:x,children:g}),t[31]=u,t[32]=x,t[33]=g,t[34]=C):C=t[34];let $,_;t[35]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(G.Actions,{children:n.jsx(G.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),_=n.jsx(G.Separator,{}),t[35]=$,t[36]=_):($=t[35],_=t[36]);let N;t[37]!==o?(N=()=>o({to:"/"}),t[37]=o,t[38]=N):N=t[38];let k;t[39]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(As,{}),t[39]=k):k=t[39];let I;t[40]!==N?(I=n.jsx(G.Actions,{children:n.jsx(G.Action,{onClick:N,icon:k,children:"See all organizations"})}),t[40]=N,t[41]=I):I=t[41];let w;t[42]!==h||t[43]!==I||t[44]!==j||t[45]!==C?(w=n.jsxs(h,{children:[j,C,$,_,I]}),t[42]=h,t[43]=I,t[44]=j,t[45]=C,t[46]=w):w=t[46];let z;t[47]!==b||t[48]!==w?(z=n.jsx(b,{children:w}),t[47]=b,t[48]=w,t[49]=z):z=t[49];let y;t[50]!==f||t[51]!==z||t[52]!==v?(y=n.jsxs(f,{children:[v,z]}),t[50]=f,t[51]=z,t[52]=v,t[53]=y):y=t[53];let M;t[54]!==d?(M=n.jsx(Ts,{open:d,onOpenChange:m}),t[54]=d,t[55]=M):M=t[55];let A;return t[56]!==y||t[57]!==M?(A=n.jsxs(n.Fragment,{children:[y,M]}),t[56]=y,t[57]=M,t[58]=A):A=t[58],A}function ia(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}it.Skeleton=G.Skeleton;const Qt=S.createContext({setOpen:()=>{}}),la=()=>S.useContext(Qt),ra=t=>{const e=p.c(25);let s,a,o,i,l;e[0]!==t?({children:s,defaultOpen:a,open:i,onOpenChange:o,...l}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=o,e[4]=i,e[5]=l):(s=e[1],a=e[2],o=e[3],i=e[4],l=e[5]);const r=a??!1;let c;e[6]!==o||e[7]!==i||e[8]!==r?(c={prop:i,defaultProp:r,onChange:o},e[6]=o,e[7]=i,e[8]=r,e[9]=c):c=e[9];const[d,m]=Ds(c);let u;e[10]!==m?(u={setOpen:m},e[10]=m,e[11]=u):u=e[11];let h;e[12]!==s||e[13]!==d||e[14]!==l||e[15]!==m?(h=n.jsx(Bs,{open:d,onOpenChange:m,...l,children:s}),e[12]=s,e[13]=d,e[14]=l,e[15]=m,e[16]=h):h=e[16];let b;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==h?(b=n.jsx(qs,{open:d,onOpenChange:m,...l,children:h}),e[17]=d,e[18]=l,e[19]=m,e[20]=h,e[21]=b):b=e[21];let f;return e[22]!==u||e[23]!==b?(f=n.jsx(Qt.Provider,{value:u,children:b}),e[22]=u,e[23]=b,e[24]=f):f=e[24],f},ca=t=>{const{children:e,title:s,...a}=t,o=Me(),{className:i,...l}=a;return o?n.jsxs(Es,{...l,children:[n.jsx(Ls,{className:"hidden",children:n.jsx(Ps,{children:s})}),n.jsx("div",{className:T("flex flex-col gap-2 p-2 py-4",i),children:e})]}):n.jsx(Ys,{...a,children:e})},da=t=>{const{children:e,...s}=t,{setOpen:a}=la(),o=Me(),{className:i,...l}=s;return o?n.jsx("div",{...l,onClick:r=>{a(!1);const{onClick:c}=l;c?.(r)},className:T("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),children:e}):n.jsx(Js,{...s,children:e})},ma=t=>{const e=p.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const o=Me();let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i=o?n.jsx(Rs,{asChild:!0,children:s}):n.jsx(Zs,{...a,children:s}),e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],i},fa=t=>{const e=p.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const o=Me();let i;return e[3]!==s||e[4]!==o||e[5]!==a?(i=o?n.jsx(gt,{className:T(s),...a}):n.jsx(gt,{className:T(s),...a}),e[3]=s,e[4]=o,e[5]=a,e[6]=i):i=e[6],i};function ua(t){const e=p.c(11),{user:s,trigger:a,align:o,children:i}=t,l=o===void 0?"start":o;let r;e[0]!==a||e[1]!==s?(r=a(s),e[0]=a,e[1]=s,e[2]=r):r=e[2];let c;e[3]!==r?(c=n.jsx(ma,{asChild:!0,children:n.jsx("div",{children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==l||e[6]!==i?(d=n.jsx(ca,{side:"top",align:l,className:"md:w-[240px]",children:i}),e[5]=l,e[6]=i,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(ra,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function ha(t){const e=p.c(8),{children:s,onClick:a,className:o,asChild:i}=t;let l;e[0]!==i||e[1]!==s||e[2]!==a?(l=i?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=i,e[1]=s,e[2]=a,e[3]=l):l=e[3];let r;return e[4]!==i||e[5]!==o||e[6]!==l?(r=n.jsx(da,{asChild:i,className:o,children:l}),e[4]=i,e[5]=o,e[6]=l,e[7]=r):r=e[7],r}function pa(t){const e=p.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(fa,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function xa(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Z=Object.assign(ua,{Item:ha,Separator:pa,Skeleton:xa});function ga(t){const e=p.c(48),{open:s,onOpenChange:a,user:o,userImage:i}=t,[l,r]=Hs(),[c,d]=S.useState(!1);let m;e[0]!==o.id?(m=()=>{navigator.clipboard.writeText(o.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=o.id,e[1]=m):m=e[1];const u=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(Xs,{className:"text-base",children:"Profile Settings"}),e[2]=h):h=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsxs(Qs,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[h,n.jsxs(en,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(ze,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=b):b=e[3];const f=o.name||"U";let x;e[4]!==f||e[5]!==i?(x=n.jsx(ee,{url:i,fallback:f,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=f,e[5]=i,e[6]=x):x=e[6];const g=o.name||"User";let j;e[7]!==g?(j=n.jsx("span",{className:"text-base font-medium text-foreground",children:g}),e[7]=g,e[8]=j):j=e[8];let v;e[9]!==o.email?(v=n.jsx("span",{className:"text-sm text-muted-foreground",children:o.email}),e[9]=o.email,e[10]=v):v=e[10];let C;e[11]!==j||e[12]!==v?(C=n.jsxs("div",{className:"flex flex-col gap-1",children:[j,v]}),e[11]=j,e[12]=v,e[13]=C):C=e[13];let $;e[14]!==x||e[15]!==C?($=n.jsxs("div",{className:"flex items-center gap-4",children:[x,C]}),e[14]=x,e[15]=C,e[16]=$):$=e[16];let _;e[17]!==l||e[18]!==r?(_=()=>r(!l),e[17]=l,e[18]=r,e[19]=_):_=e[19];let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(nn,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(on,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=N):N=e[20];let k;e[21]!==l||e[22]!==r?(k=n.jsx("div",{onClick:ba,children:n.jsx(an,{checked:l,onCheckedChange:r})}),e[21]=l,e[22]=r,e[23]=k):k=e[23];let I;e[24]!==_||e[25]!==k?(I=n.jsxs("button",{type:"button",onClick:_,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[N,k]}),e[24]=_,e[25]=k,e[26]=I):I=e[26];let w;e[27]!==$||e[28]!==I?(w=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[$,I]}),e[27]=$,e[28]=I,e[29]=w):w=e[29];let z;e[30]!==o.id?(z=n.jsx("span",{className:"font-mono text-xs",children:o.id}),e[30]=o.id,e[31]=z):z=e[31];let y;e[32]!==c?(y=c?n.jsx(Ge,{size:14,className:"text-green-600"}):n.jsx(At,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=y):y=e[33];let M;e[34]!==u||e[35]!==z||e[36]!==y?(M=n.jsx($t,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:u,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[z,y]})}),e[34]=u,e[35]=z,e[36]=y,e[37]=M):M=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(It,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=A):A=e[38];let R;e[39]!==M?(R=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(zt,{children:n.jsxs(Mt,{children:[M,A]})})}),e[39]=M,e[40]=R):R=e[40];let D;e[41]!==w||e[42]!==R?(D=n.jsxs(tn,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[b,n.jsxs("div",{className:"flex flex-col",children:[w,R]})]}),e[41]=w,e[42]=R,e[43]=D):D=e[43];let B;return e[44]!==a||e[45]!==s||e[46]!==D?(B=n.jsx(sn,{open:s,onOpenChange:a,children:D}),e[44]=a,e[45]=s,e[46]=D,e[47]=B):B=e[47],B}function ba(t){return t.stopPropagation()}function ja(t){const e=p.c(47),{user:s,userImage:a}=t,[o,i]=S.useState(!1),[l,r]=S.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const B=`ID: ${s.id}
|
|
2
|
-
Name: ${s.name||"N/A"}
|
|
3
|
-
Email: ${s.email}`;navigator.clipboard.writeText(B),r(!0),Y.success("User info copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[0]=s.email,e[1]=s.id,e[2]=s.name,e[3]=c):c=e[3];const d=c;let m;e[4]!==s.email||e[5]!==s.name||e[6]!==a?(m=()=>n.jsx(ee,{url:a,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all h-7 w-7"}),e[4]=s.email,e[5]=s.name,e[6]=a,e[7]=m):m=e[7];const u=s.name||s.email||"U";let h;e[8]!==u||e[9]!==a?(h=n.jsx(ee,{url:a,fallback:u,shape:"circle",size:"sm"}),e[8]=u,e[9]=a,e[10]=h):h=e[10];const b=s.name||"User";let f;e[11]!==b?(f=n.jsx("div",{className:"text-sm font-medium truncate",children:b}),e[11]=b,e[12]=f):f=e[12];let x;e[13]!==s.email?(x=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=x):x=e[14];let g;e[15]!==f||e[16]!==x?(g=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[f,x]}),e[15]=f,e[16]=x,e[17]=g):g=e[17];let j;e[18]!==l?(j=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?n.jsx(Ge,{size:16,className:"text-green-600"}):n.jsx(At,{size:16,className:"text-muted-foreground"})}),e[18]=l,e[19]=j):j=e[19];let v;e[20]!==h||e[21]!==g||e[22]!==j?(v=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[h,g,j]}),e[20]=h,e[21]=g,e[22]=j,e[23]=v):v=e[23];let C;e[24]!==d||e[25]!==v?(C=n.jsx(Z.Item,{onClick:d,children:v}),e[24]=d,e[25]=v,e[26]=C):C=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Z.Separator,{}),e[27]=$):$=e[27];let _,N;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsxs(Z.Item,{onClick:()=>i(!0),children:[n.jsx(rt,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),N=n.jsx(Z.Separator,{}),e[28]=_,e[29]=N):(_=e[28],N=e[29]);let k;e[30]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(fs,{className:"w-4 h-4 text-muted-foreground"}),e[30]=k):k=e[30];let I;e[31]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(Z.Item,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[k,"decocms/admin",n.jsx(bt,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=I):I=e[31];let w;e[32]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Dt,{className:"text-muted-foreground",size:18}),e[32]=w):w=e[32];let z,y;e[33]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Z.Item,{asChild:!0,children:n.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[w,"Homepage",n.jsx(bt,{size:18,className:"ml-auto text-muted-foreground"})]})}),y=n.jsx(Z.Separator,{}),e[33]=z,e[34]=y):(z=e[33],y=e[34]);let M;e[35]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsxs(Z.Item,{onClick:va,children:[n.jsx(Ut,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=M):M=e[35];let A;e[36]!==C||e[37]!==m||e[38]!==s?(A=n.jsxs(Z,{user:s,trigger:m,align:"end",children:[C,$,_,N,I,z,y,M]}),e[36]=C,e[37]=m,e[38]=s,e[39]=A):A=e[39];let R;e[40]!==o||e[41]!==s||e[42]!==a?(R=o&&n.jsx(ga,{open:o,onOpenChange:i,user:s,userImage:a}),e[40]=o,e[41]=s,e[42]=a,e[43]=R):R=e[43];let D;return e[44]!==A||e[45]!==R?(D=n.jsxs(n.Fragment,{children:[A,R]}),e[44]=A,e[45]=R,e[46]=D):D=e[46],D}function va(){return q.signOut()}function Sa(){const t=p.c(7),{data:e}=q.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ee,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const s=e.user,a=s.name??void 0;let o;t[1]!==a||t[2]!==s?(o={...s,name:a},t[1]=a,t[2]=s,t[3]=o):o=t[3];const i=o,l=s.image;let r;return t[4]!==l||t[5]!==i?(r=n.jsx(ja,{user:i,userImage:l}),t[4]=l,t[5]=i,t[6]=r):r=t[6],r}function dt(){const t=p.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ve.decoChatOpen(),t[0]=e):e=t[0];const[s,a]=Fe(e,Na);let o;return t[1]!==s||t[2]!==a?(o=[s,a],t[1]=s,t[2]=a,t[3]=o):o=t[3],o}function Na(t){return!!(t??!1)}function wa(t){const e=p.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(us,{children:n.jsx(wt,{})}),e[0]=a):a=e[0];let o;e[1]!==s?(o=n.jsx(hs,{children:s}),e[1]=s,e[2]=o):o=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ps,{children:n.jsx(xs,{to:"/login",replace:!0})}),e[3]=i):i=e[3];let l;return e[4]!==o?(l=n.jsxs(n.Fragment,{children:[a,o,i]}),e[4]=o,e[5]=l):l=e[5],l}function ya(t){const e=p.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function Ca(t){const e=p.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center justify-center px-2.5 h-full border-r border-border",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function _a(t){const e=p.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function ka(t){const e=p.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function Ia(t){const e=p.c(5),{children:s,className:a}=t;let o;e[0]!==a?(o=T("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=o):o=e[1];let i;return e[2]!==s||e[3]!==o?(i=n.jsx("div",{className:o,children:s}),e[2]=s,e[3]=o,e[4]=i):i=e[4],i}function za(){const t=p.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:n.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,s,n.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=a):a=t[2],a}const Ue=Object.assign(ya,{Sidebar:Ca,Left:_a,Center:ka,Right:Ia,Skeleton:za});function es(){const t=p.c(3),{toggleSidebar:e}=ct();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Ht,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:18}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(n.Fragment,{children:n.jsx(J,{onClick:e,size:"icon",variant:"ghost",className:"w-7 h-7 rounded-md",children:s})}),t[1]=e,t[2]=a):a=t[2],a}es.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};const $a="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Ma(){const t=p.c(147),{org:e,locator:s}=We(),{slug:a,id:o}=e,[,i]=dt(),l=$e(),{data:r}=q.useSession(),c=r?.user,{createThread:d,activeThreadId:m,setActiveThreadId:u,hideThread:h}=xt(),{threads:b,refetch:f}=Us(),x=Gs(),g=Ws(),j=dn();let v;t[0]!==j?(v={connections:j,binding:"LLMS"},t[0]=j,t[1]=v):v=t[1];const[C]=mn(v),$=!!C;let _;t[2]!==s?(_=Ve.chatSelectedModel(s),t[2]=s,t[3]=_):_=t[3];const[N,k]=ws(_,g,Oa),[I,w]=Fe(`${s}:selected-gateway-id`,null);let z;t[4]!==x||t[5]!==I?(z=I?x.find(H=>H.id===I)??null:null,t[4]=x,t[5]=I,t[6]=z):z=t[6];const y=z,M=y?.id??null,A=ys(M),R=Cs(),D=M??void 0;let B;t[7]!==m||t[8]!==A||t[9]!==R||t[10]!==D?(B={threadId:m,systemPrompt:A,onToolCall:R,gatewayId:D},t[7]=m,t[8]=A,t[9]=R,t[10]=D,t[11]=B):B=t[11];const O=_s(B),{inputValue:U,setInputValue:E,branchContext:W,clearBranch:P}=xt(),{isEmpty:V}=O,X=!M;let Oe;t[12]!==W||t[13]!==P||t[14]!==u||t[15]!==E?(Oe=()=>{W&&(u(W.originalThreadId),P(),E(""))},t[12]=W,t[13]=P,t[14]=u,t[15]=E,t[16]=Oe):Oe=t[16];const Ze=Oe;let Te;t[17]!==m||t[18]!==O||t[19]!==P||t[20]!==M||t[21]!==N||t[22]!==E||t[23]!==c?.image||t[24]!==c?.name?(Te=async H=>{if(!N){Y.error("No model configured");return}E(""),P();const Q={created_at:new Date().toISOString(),thread_id:m,model:{id:N.id,connectionId:N.connectionId,provider:N.provider??void 0,limits:N.limits??void 0},gateway:{id:M},user:{avatar:c?.image??void 0,name:c?.name??"you"}};await O.sendMessage(H,Q)},t[17]=m,t[18]=O,t[19]=P,t[20]=M,t[21]=N,t[22]=E,t[23]=c?.image,t[24]=c?.name,t[25]=Te):Te=t[25];const F=Te;let Ae;t[26]!==k?(Ae=H=>{k(H)},t[26]=k,t[27]=Ae):Ae=t[27];const Ye=Ae;let Re;t[28]!==w?(Re=H=>{w(H)},t[28]=w,t[29]=Re):Re=t[29];const te=Re,K=O.status==="submitted"||O.status==="streaming";if(!$){let H;t[30]===Symbol.for("react.memo_cache_sentinel")?(H=n.jsxs(L.Header.Left,{children:[n.jsx("img",{src:$a,alt:"deco chat",className:"size-5 rounded"}),n.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[30]=H):H=t[30];let Q;t[31]!==i?(Q=()=>i(!1),t[31]=i,t[32]=Q):Q=t[32];let Be;t[33]===Symbol.for("react.memo_cache_sentinel")?(Be=n.jsx(ze,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[33]=Be):Be=t[33];let _e;t[34]!==Q?(_e=n.jsxs(L.Header,{children:[H,n.jsx(L.Header.Right,{children:n.jsx("button",{type:"button",onClick:Q,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Be})})]}),t[34]=Q,t[35]=_e):_e=t[35];const nt=c?.id??"";let ke;t[36]!==l||t[37]!==a?(ke=()=>l({to:"/$org/mcps",params:{org:a},search:{action:"create"}}),t[36]=l,t[37]=a,t[38]=ke):ke=t[38];let Ie;t[39]!==j||t[40]!==o||t[41]!==a||t[42]!==nt||t[43]!==ke?(Ie=n.jsx(L.Main,{className:"flex flex-col items-center",children:n.jsx(L.EmptyState,{children:n.jsx(ks,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",orgSlug:a,orgId:o,userId:nt,allConnections:j,onInstallMcpServer:ke})})}),t[39]=j,t[40]=o,t[41]=a,t[42]=nt,t[43]=ke,t[44]=Ie):Ie=t[44];let He;return t[45]!==_e||t[46]!==Ie?(He=n.jsxs(L,{children:[_e,Ie]}),t[45]=_e,t[46]=Ie,t[47]=He):He=t[47],He}const qe=y?.icon??"/favicon.svg",Je=y?.title??"deco chat";let Ee;t[48]===Symbol.for("react.memo_cache_sentinel")?(Ee=n.jsx(ot,{size:12}),t[48]=Ee):Ee=t[48];let se;t[49]!==qe||t[50]!==Je?(se=n.jsx(pt,{icon:qe,name:Je,size:"xs",fallbackIcon:Ee}),t[49]=qe,t[50]=Je,t[51]=se):se=t[51];const Xe=y?.title||"deco chat";let ne;t[52]!==Xe?(ne=n.jsx("span",{className:"text-sm font-medium",children:Xe}),t[52]=Xe,t[53]=ne):ne=t[53];let ae;t[54]!==se||t[55]!==ne?(ae=n.jsxs(L.Header.Left,{children:[se,ne]}),t[54]=se,t[55]=ne,t[56]=ae):ae=t[56];let oe;t[57]!==d?(oe=()=>d(),t[57]=d,t[58]=oe):oe=t[58];let Le;t[59]===Symbol.for("react.memo_cache_sentinel")?(Le=n.jsx(cn,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[59]=Le):Le=t[59];let ie;t[60]!==oe?(ie=n.jsx("button",{type:"button",onClick:oe,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:Le}),t[60]=oe,t[61]=ie):ie=t[61];let le;t[62]!==f?(le=()=>f(),t[62]=f,t[63]=le):le=t[63];let re;t[64]!==m||t[65]!==h||t[66]!==u||t[67]!==le||t[68]!==b?(re=n.jsx(Is,{threads:b,activeThreadId:m,onSelectThread:u,onRemoveThread:h,onOpen:le}),t[64]=m,t[65]=h,t[66]=u,t[67]=le,t[68]=b,t[69]=re):re=t[69];let ce;t[70]!==i?(ce=()=>i(!1),t[70]=i,t[71]=ce):ce=t[71];let Pe;t[72]===Symbol.for("react.memo_cache_sentinel")?(Pe=n.jsx(ze,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[72]=Pe):Pe=t[72];let de;t[73]!==ce?(de=n.jsx("button",{type:"button",onClick:ce,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Pe}),t[73]=ce,t[74]=de):de=t[74];let me;t[75]!==ie||t[76]!==re||t[77]!==de?(me=n.jsxs(L.Header.Right,{children:[ie,re,de]}),t[75]=ie,t[76]=re,t[77]=de,t[78]=me):me=t[78];let fe;t[79]!==ae||t[80]!==me?(fe=n.jsxs(L.Header,{children:[ae,me]}),t[79]=ae,t[80]=me,t[81]=fe):fe=t[81];let ue;t[82]!==O.messages||t[83]!==O.status||t[84]!==F||t[85]!==V||t[86]!==y?.description||t[87]!==y?.icon||t[88]!==y?.title||t[89]!==M?(ue=n.jsx(L.Main,{children:V?n.jsx(L.EmptyState,{children:n.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[n.jsx(pt,{icon:y?.icon??"/favicon.svg",name:y?.title||"deco chat",size:"lg",fallbackIcon:n.jsx(ot,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:y?.title||"Ask deco chat"}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:y?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(at.Container,{children:M&&n.jsx(lt,{fallback:null,children:n.jsx(S.Suspense,{fallback:n.jsx(at.Fallback,{}),children:n.jsx(at,{gatewayId:M,onSelect:H=>{F(H.description??H.name)}})})},M)})]})}):n.jsx(L.Messages,{messages:O.messages,status:O.status,minHeightOffset:280})}),t[82]=O.messages,t[83]=O.status,t[84]=F,t[85]=V,t[86]=y?.description,t[87]=y?.icon,t[88]=y?.title,t[89]=M,t[90]=ue):ue=t[90];let he;t[91]!==O.error||t[92]!==F?(he=()=>{O.error&&F(`I encountered this error: ${O.error.message}. Can you help me fix it?`)},t[91]=O.error,t[92]=F,t[93]=he):he=t[93];let pe;t[94]!==O.clearError||t[95]!==O.error||t[96]!==he?(pe=n.jsx(L.ErrorBanner,{error:O.error,onFixInChat:he,onDismiss:O.clearError}),t[94]=O.clearError,t[95]=O.error,t[96]=he,t[97]=pe):pe=t[97];let xe;t[98]!==F?(xe=()=>{F("Please continue.")},t[98]=F,t[99]=xe):xe=t[99];let ge;t[100]!==O.clearFinishReason||t[101]!==O.finishReason||t[102]!==xe?(ge=n.jsx(L.FinishReasonWarning,{finishReason:O.finishReason,onContinue:xe,onDismiss:O.clearFinishReason}),t[100]=O.clearFinishReason,t[101]=O.finishReason,t[102]=xe,t[103]=ge):ge=t[103];let be;t[104]!==W||t[105]!==P||t[106]!==Ze||t[107]!==E?(be=n.jsx(L.BranchPreview,{branchContext:W,clearBranchContext:P,onGoToOriginalMessage:Ze,setInputValue:E}),t[104]=W,t[105]=P,t[106]=Ze,t[107]=E,t[108]=be):be=t[108];const Qe=y??void 0;let je;t[109]!==F||t[110]!==U?(je=async()=>{U.trim()&&await F(U.trim())},t[109]=F,t[110]=U,t[111]=je):je=t[111];const et=!N,tt=N?"Ask anything or @ for context":"Select a model to start chatting";let ve;t[112]!==te||t[113]!==K||t[114]!==M||t[115]!==X?(ve=X&&n.jsx(Vs,{selectedGatewayId:M,onGatewayChange:te,placeholder:"Agent",disabled:K}),t[112]=te,t[113]=K,t[114]=M,t[115]=X,t[116]=ve):ve=t[116];const st=N??void 0;let Se;t[117]!==Ye||t[118]!==st?(Se=n.jsx(Ks,{selectedModel:st,onModelChange:Ye,placeholder:"Model",variant:"borderless"}),t[117]=Ye,t[118]=st,t[119]=Se):Se=t[119];let Ne;t[120]!==O.messages?(Ne=n.jsx(Fs,{messages:O.messages}),t[120]=O.messages,t[121]=Ne):Ne=t[121];let we;t[122]!==O.stop||t[123]!==U||t[124]!==K||t[125]!==E||t[126]!==je||t[127]!==et||t[128]!==tt||t[129]!==ve||t[130]!==Se||t[131]!==Ne?(we=n.jsxs(L.Input,{value:U,onChange:E,onSubmit:je,onStop:O.stop,disabled:et,isStreaming:K,placeholder:tt,children:[ve,Se,Ne]}),t[122]=O.stop,t[123]=U,t[124]=K,t[125]=E,t[126]=je,t[127]=et,t[128]=tt,t[129]=ve,t[130]=Se,t[131]=Ne,t[132]=we):we=t[132];let ye;t[133]!==te||t[134]!==K||t[135]!==Qe||t[136]!==we?(ye=n.jsx(zs,{gateway:Qe,onGatewayChange:te,disabled:K,children:we}),t[133]=te,t[134]=K,t[135]=Qe,t[136]=we,t[137]=ye):ye=t[137];let Ce;t[138]!==pe||t[139]!==ge||t[140]!==be||t[141]!==ye?(Ce=n.jsx(L.Footer,{children:n.jsxs("div",{className:"flex flex-col gap-2",children:[pe,ge,be,ye]})}),t[138]=pe,t[139]=ge,t[140]=be,t[141]=ye,t[142]=Ce):Ce=t[142];let De;return t[143]!==fe||t[144]!==ue||t[145]!==Ce?(De=n.jsxs(L,{children:[fe,ue,Ce]}),t[143]=fe,t[144]=ue,t[145]=Ce,t[146]=De):De=t[146],De}function Oa(t,e){return t.id===e.id&&t.connectionId===e.connectionId}function Ta(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(L.Provider,{children:n.jsx(Ma,{})}),t[0]=e):e=t[0],e}const Aa="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function vt({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:a=!1}){const[o,i]=dt(),l=S.useRef(a);a&&o&&l.current!==a&&i(!1),l.current=a;const r=()=>{a||i(c=>!c)};return n.jsxs(Ue,{children:[t&&n.jsx(Ue.Sidebar,{children:n.jsx(es,{})}),n.jsx(Ue.Left,{children:e&&n.jsx(S.Suspense,{fallback:n.jsx(it.Skeleton,{}),children:n.jsx(it,{})})}),n.jsxs(Ue.Right,{className:"gap-2",children:[n.jsx(un,{}),s&&!a&&n.jsxs(J,{size:"sm",variant:"default",onClick:r,className:"h-7",children:[n.jsx(ee,{url:Aa,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),n.jsx(Sa,{})]})]})}function Ra(t){const e=p.c(10),{children:s,className:a}=t,[,o]=S.useTransition();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Ve.decoChatPanelWidth(),e[0]=i):i=e[0];const[l,r]=Fe(i,30);let c;e[1]!==r?(c=h=>o(()=>r(h)),e[1]=r,e[2]=c):c=e[2];const d=c;let m;e[3]!==a?(m=T("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let u;return e[5]!==l||e[6]!==s||e[7]!==d||e[8]!==m?(u=n.jsx(Rt,{defaultSize:l,minSize:20,className:m,onResize:d,children:s}),e[5]=l,e[6]=s,e[7]=d,e[8]=m,e[9]=u):u=e[9],u}function Ea(t){const e=p.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Ve.sidebarOpen(),e[0]=a):a=e[0];const[o,i]=Fe(a,!0);let l;return e[1]!==s||e[2]!==i||e[3]!==o?(l=n.jsx(kn,{open:o,onOpenChange:i,children:s}),e[1]=s,e[2]=i,e[3]=o,e[4]=l):l=e[4],l}function La(t){const e=p.c(10),{disableChat:s}=t,a=s===void 0?!1:s,[o]=dt(),i=o&&!a;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Rt,{className:"bg-background",children:n.jsx(yt,{})}),e[0]=l):l=e[0];let r;e[1]!==a||e[2]!==i?(r=!a&&n.jsx(ln,{withHandle:i}),e[1]=a,e[2]=i,e[3]=r):r=e[3];const c=i?"max-w-none":"max-w-0";let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(lt,{children:n.jsx(S.Suspense,{fallback:n.jsx($s,{}),children:n.jsx(Ta,{})})}),e[4]=d):d=e[4];let m;e[5]!==c?(m=n.jsx(Ra,{className:c,children:d}),e[5]=c,e[6]=m):m=e[6];let u;return e[7]!==r||e[8]!==m?(u=n.jsxs(rn,{direction:"horizontal",children:[l,r,m]}),e[7]=r,e[8]=m,e[9]=u):u=e[9],u}function Pa(){const t=p.c(22);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=Nt(e),a=St(),o=a.location.pathname===`/${s}`||a.location.pathname===`/${s}/`;let i;t[1]!==s?(i=bs.activeOrganization(s),t[1]=s,t[2]=i):i=t[2];let l;t[3]!==s?(l=async()=>{if(!s)return null;const{data:x}=await q.organization.setActive({organizationSlug:s});return{org:x,project:{slug:Ns}}},t[3]=s,t[4]=l):l=t[4];let r;t[5]!==i||t[6]!==l?(r={queryKey:i,queryFn:l,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=i,t[6]=l,t[7]=r):r=t[7];const{data:c}=gs(r);if(!c){let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(vt,{}),t[8]=x):x=t[8];let g;return t[9]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"min-h-screen bg-background",children:[x,n.jsx("div",{className:"pt-12",children:n.jsx(yt,{})})]}),t[9]=g):g=t[9],g}let d;t[10]!==o?(d=n.jsx(vt,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0,disableDecoChat:o}),t[10]=o,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[12]=m):m=t[12];let u;t[13]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Fn,{}),t[13]=u):u=t[13];let h;t[14]!==o?(h=n.jsxs($n,{className:"flex-1 bg-sidebar",style:m,children:[u,n.jsx(On,{className:"pt-12",children:n.jsx(La,{disableChat:o})})]}),t[14]=o,t[15]=h):h=t[15];let b;t[16]!==d||t[17]!==h?(b=n.jsx(Ea,{children:n.jsxs("div",{className:"flex flex-col h-screen",children:[d,h]})}),t[16]=d,t[17]=h,t[18]=b):b=t[18];let f;return t[19]!==c||t[20]!==b?(f=n.jsx(Ss,{...c,children:b}),t[19]=c,t[20]=b,t[21]=f):f=t[21],f}function Eo(){const t=p.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(wa,{children:n.jsx(S.Suspense,{fallback:n.jsx(wt,{}),children:n.jsx(Pa,{})})}),t[0]=e):e=t[0],e}export{Eo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,h as d,j as a}from"./index-DMNk-OUX.js";import{c as m}from"./input-68J17rBp.js";const u=d("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",special:"fill-special text-backround"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function p(f){const e=C.c(10),{variant:c,size:o}=f;let t;e[0]!==o||e[1]!==c?(t=m(u({variant:c,size:o})),e[0]=o,e[1]=c,e[2]=t):t=e[2];let l,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),i=a.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=l,e[4]=i):(l=e[3],i=e[4]);let s;e[5]!==t?(s=a.jsxs("svg",{"aria-hidden":"true",className:t,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l,i]}),e[5]=t,e[6]=s):s=e[6];let r;e[7]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=r):r=e[7];let n;return e[8]!==s?(n=a.jsxs("div",{role:"status",children:[s,r]}),e[8]=s,e[9]=n):n=e[9],n}export{p as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,ac as T,j as i,ad as C,aa as y,ai as I,af as M,aO as H,aN as z,c as A}from"./index-DMNk-OUX.js";import{c as g}from"./input-68J17rBp.js";var b="Switch",[O]=T(b),[U,q]=O(b),E=c.forwardRef((s,e)=>{const{__scopeSwitch:t,name:r,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=s,[p,h]=c.useState(null),v=y(e,m=>h(m)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,j]=I({prop:a,defaultProp:n??!1,onChange:k,caller:b});return i.jsxs(U,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":N(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:M(s.onClick,m=>{j(B=>!B),S&&(x.current=m.isPropagationStopped(),x.current||m.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=c.forwardRef((s,e)=>{const{__scopeSwitch:t,...r}=s,a=q(P,t);return i.jsx(C.span,{"data-state":N(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});R.displayName=P;var L="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:s,control:e,checked:t,bubbles:r=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=H(t),k=z(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=L;function N(s){return s?"checked":"unchecked"}var $=E,D=R;function X(s){const e=A.c(9);let t,r;e[0]!==s?({className:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...r,children:n}),e[6]=r,e[7]=a,e[8]=o):o=e[8],o}export{X as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as o,j as n}from"./index-DMNk-OUX.js";import{c as l}from"./input-68J17rBp.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground 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 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as v,c as z,j as t}from"./index-DMNk-OUX.js";import{I as F}from"./empty-state-DzS1Zp7m.js";import{C as I}from"./checkbox-2xIaHvS4.js";import{c as T,B as R}from"./input-68J17rBp.js";import{i as A}from"./ArrowLeft-BrsZ2N_5.js";import{u as U}from"./use-connection-DoWszS3j.js";import{C as V}from"./collection-search-CYZk6T6Z.js";const q=v.memo(function(S){const e=z.c(21),{connection:o,isSelected:m,hasToolsEnabled:r,activeToolsCount:h,totalToolsCount:p,onSelect:g,onToggle:x}=S,u=m?"bg-accent/50":"hover:bg-muted/50";let i;e[0]!==u?(i=T("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",u),e[0]=u,e[1]=i):i=e[1];let c;e[2]!==o.icon||e[3]!==o.title?(c=t.jsx(F,{icon:o.icon,name:o.title,size:"xs"}),e[2]=o.icon,e[3]=o.title,e[4]=c):c=e[4];let f;e[5]!==o.title?(f=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),e[5]=o.title,e[6]=f):f=e[6];let n;e[7]!==g||e[8]!==c||e[9]!==f?(n=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[c,f]}),e[7]=g,e[8]=c,e[9]=f,e[10]=n):n=e[10];let a;e[11]!==h||e[12]!==o.tools||e[13]!==r||e[14]!==x||e[15]!==p?(a=o.tools&&o.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[h,"/",p]}),t.jsx(I,{checked:r,onCheckedChange:x,onClick:H})]}),e[11]=h,e[12]=o.tools,e[13]=r,e[14]=x,e[15]=p,e[16]=a):a=e[16];let N;return e[17]!==i||e[18]!==n||e[19]!==a?(N=t.jsxs("div",{className:i,children:[n,a]}),e[17]=i,e[18]=n,e[19]=a,e[20]=N):N=e[20],N}),G=v.memo(function(S){const e=z.c(18),{connectionId:o,tool:m,isSelected:r,onToggle:h}=S,p=`tool-${o}-${m.name}`,g=r?"text-foreground":"text-muted-foreground";let x;e[0]!==g?(x=T("text-sm font-medium",g),e[0]=g,e[1]=x):x=e[1];let u;e[2]!==x||e[3]!==m.name?(u=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:x,children:m.name})}),e[2]=x,e[3]=m.name,e[4]=u):u=e[4];let i;e[5]!==m.description?(i=m.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:m.description}),e[5]=m.description,e[6]=i):i=e[6];let c;e[7]!==u||e[8]!==i?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[u,i]}),e[7]=u,e[8]=i,e[9]=c):c=e[9];const f=`tool-${o}-${m.name}`;let n;e[10]!==r||e[11]!==h||e[12]!==f?(n=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(I,{id:f,checked:r,onCheckedChange:h,onClick:J})}),e[10]=r,e[11]=h,e[12]=f,e[13]=n):n=e[13];let a;return e[14]!==p||e[15]!==c||e[16]!==n?(a=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:p,children:[c,n]}),e[14]=p,e[15]=c,e[16]=n,e[17]=a):a=e[17],a});function ee({toolSet:d,onToolSetChange:S}){const[e,o]=v.useState(""),m=v.useDeferredValue(e),[r,h]=v.useState("all"),[p,g]=v.useState(!1),x=v.useRef(new Set(Object.keys(d))),u=U({searchTerm:m.trim()||void 0}),i=x.current,c=[...i.values()].map(s=>u.find(l=>l.id===s)).filter(s=>s!==void 0),f=u.filter(s=>!i.has(s.id)),n=[...c,...f],a=s=>{const l=d[s];return l!==void 0&&l.length>0},N=n.filter(s=>{if(r==="all")return!0;const l=a(s.id);return r==="selected"?l:r==="unselected"?!l:!0}),[M,$]=v.useState(n[0]?.id??null),b=M?n.find(s=>s.id===M)??null:null,E=b?.tools??[],B=(s,l)=>d[s]?.includes(l)??!1,D=(s,l)=>{const j=d[s]??[],k=j.includes(l),w={...d};if(k){const y=j.filter(C=>C!==l);y.length===0?delete w[s]:w[s]=y}else w[s]=[...j,l];S(w)},O=s=>{const l=n.find(C=>C.id===s);if(!l?.tools)return;const j=d[s]??[],k=l.tools.map(C=>C.name),w=j.length>0&&k.every(C=>j.includes(C)),y={...d};w?delete y[s]:(y[s]=k,$(s)),S(y)},P=s=>{$(s),g(!0)},Q=()=>{g(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:T("w-full md:w-80 border-r border-border flex flex-col",p&&"hidden md:flex"),children:[t.jsx(V,{value:e,onChange:o,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>h("all"),className:T("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:()=>h("selected"),className:T("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:()=>h("unselected"),className:T("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:N.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"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:N.map(s=>{const l=s.tools?.length??0,j=d[s.id]?.length??0;return t.jsx(q,{connection:s,isSelected:M===s.id,hasToolsEnabled:a(s.id),activeToolsCount:j,totalToolsCount:l,onSelect:()=>P(s.id),onToggle:()=>O(s.id)},s.id)})})})]}),t.jsx("div",{className:T("flex-1 flex-col",p?"flex":"hidden md:flex"),children:b?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(R,{variant:"ghost",size:"sm",onClick:Q,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(A,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(F,{icon:b.icon,name:b.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:b.title}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:E.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:E.map(s=>t.jsx(G,{connectionId:b.id,tool:s,isSelected:B(b.id,s.name),onToggle:()=>D(b.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function H(d){return d.stopPropagation()}function J(d){return d.stopPropagation()}export{ee as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as B,j as t,c as O,f as Q,r as k}from"./index-DMNk-OUX.js";import{b as U}from"./use-connection-DoWszS3j.js";import{i as W}from"./File06-D0TXCuMx.js";import{i as Y}from"./Loading01-NW_f44Lz.js";import{e as J}from"./github-icon-Dp3wHhYE.js";import{C as P}from"./collection-display-button-BGIcja12.js";import{C as X}from"./collection-search-CYZk6T6Z.js";import{C as Z}from"./collection-table-wrapper-D2niE2Ci.js";import{E as z,I as ee}from"./empty-state-DzS1Zp7m.js";import{C as te}from"./card-B3fsloDi.js";import{V as se}from"./layout-Olb4shdE.js";function oe(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function re(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ne(s){let e=oe(s);return e=re(e),e}function we({repository:s}){const e=s?J(s):null,{data:i,isLoading:c}=U({queryKey:B.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ne(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(W,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function ve(s){const e=O.c(39),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:L,emptyMessage:M}=s,D=L===void 0?!0:L,j=M===void 0?"This connection doesn't have any tools yet.":M,I=Q(),[n,$]=k.useState(""),[d,H]=k.useState("table"),[r,A]=k.useState("name"),[a,_]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(_(me),a==="desc"&&A(void 0)):(A(o),_("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const q=R[r]||"",G=b[r]||"",K=String(q).localeCompare(String(G));return a==="asc"?K:-K}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:ce,sortable:!0},{id:"description",header:"Description",render:le,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const V=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=V.filter(ie).map(ae),e[14]=S):S=e[14];const F=S;let f;e[15]!==u||e[16]!==D||e[17]!==a||e[18]!==r||e[19]!==d?(f=D&&t.jsx(se,{children:t.jsx(P,{viewMode:d,onViewModeChange:H,sortKey:r,sortDirection:a,onSort:u,sortOptions:F})}),e[15]=u,e[16]=D,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&($(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(X,{value:n,onChange:$,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==n||e[28]!==a||e[29]!==r||e[30]!==g||e[31]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(Z,{columns:V,data:g,isLoading:!1,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=n,e[28]=a,e[29]=r,e[30]=g,e[31]=d,e[32]=h):h=e[32];let x;e[33]!==p||e[34]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[33]=p,e[34]=h,e[35]=x):x=e[35];let T;return e[36]!==x||e[37]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[36]=x,e[37]=f,e[38]=T):T=e[38],T}function ae(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ie(s){return s.sortable}function le(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ce(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function me(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{we as R,ve as T};
|