@decocms/mesh 1.0.0-alpha.2 → 1.0.0-alpha.20
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/README.md +287 -0
- package/dist/client/assets/{alert-dialog-DsYjmjQa.js → alert-dialog-6yQ_ytNz.js} +3 -3
- package/dist/client/assets/app-name-gTETL9So.js +1 -0
- package/dist/client/assets/{auth-dQSMuI_r.js → auth-CSz5ame9.js} +1 -1
- package/dist/client/assets/{auth-catchall-vTieIyKZ.js → auth-catchall-CJDp3FDD.js} +1 -1
- package/dist/client/assets/{avatar-DFNVHH7B.js → avatar-D9WKKc2H.js} +1 -1
- package/dist/client/assets/{badge-D0svJbIE.js → badge-BxwpfgK4.js} +1 -1
- package/dist/client/assets/{button-CB7Gt-Ba.js → button-C-_NjPPs.js} +1 -1
- package/dist/client/assets/{card-BZePxfHz.js → card-5q0yQ-4E.js} +1 -1
- package/dist/client/assets/{checkbox-CJwRElzS.js → checkbox-CniIxwAN.js} +1 -1
- package/dist/client/assets/{circle-alert-FONBIc_T.js → circle-alert-DWlc7ruY.js} +1 -1
- package/dist/client/assets/collection-detail-F3buxrPU.js +1 -0
- package/dist/client/assets/collection-display-button-CYjIv9ET.js +1 -0
- package/dist/client/assets/collection-header-BElwf-Gz.js +1 -0
- package/dist/client/assets/{collection-page-BplXISpO.js → collection-page-B6r2HLtn.js} +1 -1
- package/dist/client/assets/{collection-search-BpPEPb0j.js → collection-search-OBebmCrY.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CJdrG443.js → collection-table-wrapper-CWTQ_xvQ.js} +1 -1
- package/dist/client/assets/connection-card-DMTXuLLY.js +1 -0
- package/dist/client/assets/connection-detail-ButZpcgF.js +1 -0
- package/dist/client/assets/connections-wbTmJe7J.js +1 -0
- package/dist/client/assets/{create-organization-dialog-Mq1L8DSD.js → create-organization-dialog-B024WWuD.js} +1 -1
- package/dist/client/assets/dialog-v2GF-04Y.js +1 -0
- package/dist/client/assets/{dropdown-menu-zoKN8fKM.js → dropdown-menu-BMFf3tlf.js} +1 -1
- package/dist/client/assets/{empty-state-BCgOYCyG.js → empty-state-DodoFFAj.js} +1 -1
- package/dist/client/assets/{error-boundary-L4NxoU-J.js → error-boundary-Cy_msdg7.js} +1 -1
- package/dist/client/assets/{extract-connection-data-mJfi2GDs.js → extract-connection-data-BlicUoX6.js} +1 -1
- package/dist/client/assets/{form-BmhZau8F.js → form-WEgfE5pE.js} +1 -1
- package/dist/client/assets/gateway-detail-CfQ0095F.js +1 -0
- package/dist/client/assets/gateways-CUtt8cOw.js +1 -0
- package/dist/client/assets/{home-RT_Ssleq.js → home-CXur84Cq.js} +1 -1
- package/dist/client/assets/{icon-Zm7eEeKG.js → icon-BWVVSGuI.js} +1 -1
- package/dist/client/assets/{index-CoeZDSQf.js → index-C3nlWW5L.js} +1 -1
- package/dist/client/assets/index-CEo77-MZ.js +118 -0
- package/dist/client/assets/index-CZk1llWx.js +32 -0
- package/dist/client/assets/{index-BAut7b_p.js → index-D49hLMyP.js} +1 -1
- package/dist/client/assets/index-yMf3L_oA.css +1 -0
- package/dist/client/assets/{input-DWY0hRYC.js → input-5ozmLchN.js} +1 -1
- package/dist/client/assets/layout-DLv0sB-y.js +1 -0
- package/dist/client/assets/{lazy-highlighter-V_ETf5s5.js → lazy-highlighter-bi9pmmha.js} +1 -1
- package/dist/client/assets/{localstorage-keys-CdMYd__a.js → localstorage-keys-yS7s4iFl.js} +1 -1
- package/dist/client/assets/login-DobNRNrA.js +1 -0
- package/dist/client/assets/mcp-oauth-37Mxf9Z0.js +1 -0
- package/dist/client/assets/members-zAFo6qid.js +3 -0
- package/dist/client/assets/monitoring-CNFmTfT0.js +1 -0
- package/dist/client/assets/monitoring-stats-row-DB9E7eLj.js +42 -0
- package/dist/client/assets/oauth-callback-T5DmL3Ao.js +1 -0
- package/dist/client/assets/page-BIqETU0M.js +21 -0
- package/dist/client/assets/page-BZV40eAE.css +1 -0
- package/dist/client/assets/{popover-B7GJHYd2.js → popover-BCVOzsms.js} +1 -1
- package/dist/client/assets/{prism-BsII3tZL.js → prism-iL5zefv5.js} +1 -1
- package/dist/client/assets/resource-tabs-DhcI51JE.js +1 -0
- package/dist/client/assets/{schema-CJRWBwzd.js → schema-DcHM5DMj.js} +1 -1
- package/dist/client/assets/{select-CrueAR2N.js → select-DFzO4KN0.js} +1 -1
- package/dist/client/assets/settings-D0vYaEZr.js +1 -0
- package/dist/client/assets/shell-layout-D34ddYiL.js +124 -0
- package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
- package/dist/client/assets/{spinner-R42f7AVH.js → spinner-DnJmPtgh.js} +1 -1
- package/dist/client/assets/store-C5PNHQD9.js +1 -0
- package/dist/client/assets/store-app-detail-D3a6jhJ2.js +1 -0
- package/dist/client/assets/switch-G-S3tsxP.js +1 -0
- package/dist/client/assets/{textarea-CAmjTm6l.js → textarea-DpLnh_Mr.js} +1 -1
- package/dist/client/assets/tool-set-selector-Yam11D5m.js +1 -0
- package/dist/client/assets/{tooltip-BLbXpJcn.js → tooltip-Bdp6F_4z.js} +1 -1
- package/dist/client/assets/{upload-CG7PZ6WF.js → upload-BJHCH8vW.js} +1 -1
- package/dist/client/assets/{use-binding-CeSgmpzj.js → use-binding-BZj4JXob.js} +2 -2
- package/dist/client/assets/use-connection-_IstvAFb.js +2 -0
- package/dist/client/assets/use-gateway-pw5jbc7Q.js +1 -0
- package/dist/client/assets/{use-list-state-BTIryg2o.js → use-list-state-DKMQTiNs.js} +1 -1
- package/dist/client/assets/use-mcp-Dj_7v_nd.js +1 -0
- package/dist/client/assets/use-members-fC3DA3xN.js +1 -0
- package/dist/client/assets/{use-mobile-BPQzOCZP.js → use-mobile-D6cBfH0_.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CMP1q4u_.js → use-organization-settings-DdaiS6Jy.js} +1 -1
- package/dist/client/assets/{use-tool-call-BsMTRGjQ.js → use-tool-call--kgIN5TM.js} +1 -1
- package/dist/client/assets/useQuery-DVO6EBFl.js +1 -0
- package/dist/client/assets/utils-ANvY6Qf5.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +191 -211
- package/dist/server/migrate.js +204 -204
- package/dist/server/server.js +245 -267
- package/package.json +7 -5
- package/dist/client/assets/app-name-DQPOjnhR.js +0 -1
- package/dist/client/assets/chunk-2RRQPJJO-DGhxLrrR.js +0 -1
- package/dist/client/assets/collection-detail-CFf2hZjF.js +0 -1
- package/dist/client/assets/collection-display-button-Ccjj22Xn.js +0 -1
- package/dist/client/assets/collection-header-C3vTyWNy.js +0 -1
- package/dist/client/assets/connection-card-B7VMSnFz.js +0 -1
- package/dist/client/assets/connection-detail-DGFMHZQW.js +0 -1
- package/dist/client/assets/connections-BFxMYtuo.js +0 -1
- package/dist/client/assets/dialog-DhrfZsqb.js +0 -1
- package/dist/client/assets/gateway-detail-BEN_sL0j.js +0 -1
- package/dist/client/assets/gateways-DPfP8fjF.js +0 -1
- package/dist/client/assets/index-CBL6DTCM.js +0 -32
- package/dist/client/assets/index-CfNAXm02.js +0 -1
- package/dist/client/assets/index-VCe1FY3E.js +0 -118
- package/dist/client/assets/index-feMggVqN.css +0 -1
- package/dist/client/assets/integration-icon-Dgf9Pzxc.js +0 -1
- package/dist/client/assets/layout-C75gYFRR.js +0 -1
- package/dist/client/assets/login-CaI2gNh0.js +0 -1
- package/dist/client/assets/members-BD990Z5F.js +0 -1
- package/dist/client/assets/monitoring-s9rrPP3V.js +0 -1
- package/dist/client/assets/monitoring-stats-row-DiSEgwHP.js +0 -42
- package/dist/client/assets/oauth-callback-ChC_4XSg.js +0 -10
- package/dist/client/assets/page-BauA0SPJ.js +0 -1
- package/dist/client/assets/resource-tabs-Djqhz6PB.js +0 -1
- package/dist/client/assets/settings-85tu13fN.js +0 -1
- package/dist/client/assets/shell-layout-CwcEMEv3.js +0 -124
- package/dist/client/assets/store-app-detail-D89e4NIX.js +0 -1
- package/dist/client/assets/store-zixro3Vs.js +0 -1
- package/dist/client/assets/tool-set-selector-BfScgRcK.js +0 -1
- package/dist/client/assets/use-connection-D5nZyekX.js +0 -2
- package/dist/client/assets/use-gateway-pRk3-ua4.js +0 -1
- package/dist/client/assets/use-members-OyBpbFn0.js +0 -1
- package/dist/client/assets/useQuery-DEUZMq4A.js +0 -1
- package/dist/client/assets/utils-B-QWwgyW.js +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{b6 as h,r as w,j as e}from"./index-VCe1FY3E.js";import{B as g}from"./chunk-2RRQPJJO-DGhxLrrR.js";import{a as f}from"./auth-dQSMuI_r.js";import{C as x,a as y,b as S,c as v}from"./card-BZePxfHz.js";import{I as b}from"./icon-Zm7eEeKG.js";import{C as j}from"./circle-alert-FONBIc_T.js";import"./utils-B-QWwgyW.js";const N=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],k=h("circle-check",N);async function E(){const n=new URLSearchParams(window.location.search),l=n.get("code"),d=n.get("state"),t=n.get("error"),p=n.get("error_description"),o="[mcp-callback]";console.log(`${o} Handling callback...`,{code:l,state:d,error:t,errorDescription:p});let a=null,i=null;const c=d?`mcp:auth:state_${d}`:null;try{if(t)throw new Error(`OAuth error: ${t} - ${p||"No description provided."}`);if(!l)throw new Error("Authorization code not found in callback query parameters.");if(!d||!c)throw new Error("State parameter not found or invalid in callback query parameters.");const r=localStorage.getItem(c);if(!r)throw new Error(`Invalid or expired state parameter "${d}". No matching state found in storage.`);try{i=JSON.parse(r)}catch{throw new Error("Failed to parse stored OAuth state.")}if(!i.expiry||i.expiry<Date.now())throw localStorage.removeItem(c),new Error("OAuth state has expired. Please try initiating authentication again.");if(!i.providerOptions)throw new Error("Stored state is missing required provider options.");const{serverUrl:s,...m}=i.providerOptions;console.log(`${o} Re-instantiating provider for server: ${s}`),a=new g(s,m),console.log(`${o} Calling SDK auth() to exchange code...`);const u=await f(a,{serverUrl:s,authorizationCode:l});if(u==="AUTHORIZED")console.log(`${o} Authorization successful via SDK auth(). Notifying opener...`),window.opener&&!window.opener.closed?(window.opener.postMessage({type:"mcp_auth_callback",success:!0},window.location.origin),window.close()):(console.warn(`${o} No opener window detected. Redirecting to root.`),window.location.href="/"),localStorage.removeItem(c);else throw console.warn(`${o} SDK auth() returned unexpected status: ${u}`),new Error(`Unexpected result from authentication library: ${u}`)}catch(r){console.error(`${o} Error during OAuth callback handling:`,r);const s=r instanceof Error?r.message:String(r);window.opener&&!window.opener.closed&&window.opener.postMessage({type:"mcp_auth_callback",success:!1,error:s},window.location.origin);try{document.body.innerHTML=`
|
|
2
|
-
<div style="font-family: sans-serif; padding: 20px;">
|
|
3
|
-
<h1>Authentication Error</h1>
|
|
4
|
-
<p style="color: red; background-color: #ffebeb; border: 1px solid red; padding: 10px; border-radius: 4px;">
|
|
5
|
-
${s}
|
|
6
|
-
</p>
|
|
7
|
-
<p>You can close this window or <a href="#" onclick="window.close(); return false;">click here to close</a>.</p>
|
|
8
|
-
<pre style="font-size: 0.8em; color: #555; margin-top: 20px; white-space: pre-wrap;">${r instanceof Error?r.stack:""}</pre>
|
|
9
|
-
</div>
|
|
10
|
-
`}catch(m){console.error(`${o} Could not display error in callback window:`,m)}c&&localStorage.removeItem(c),a&&(localStorage.removeItem(a.getKey("code_verifier")),localStorage.removeItem(a.getKey("last_auth_url")))}}function R(){const[n,l]=w.useState(null);return w.useEffect(()=>{(async()=>{try{const t=new URLSearchParams(window.location.search),p=t.get("code");let o=t.get("state");const a=t.get("error"),i=t.get("error_description");if(a){console.error("OAuth error:",a,i),l(i||a),setTimeout(()=>{window.close()},3e3);return}if(p&&o){try{const c=atob(o),r=JSON.parse(c);if(r.clientState){const s=new URL(window.location.href);s.searchParams.set("state",r.clientState),window.history.replaceState({},"",s.toString()),o=r.clientState}}catch{}await E(),window.opener&&!window.opener.closed&&window.opener.postMessage({type:"mcp:oauth:complete",success:!0},window.location.origin)}}catch(t){l(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 bg-background",children:e.jsxs(x,{className:"w-full max-w-md",children:[e.jsx(y,{children:e.jsx(S,{className:"flex items-center gap-2",children:n?e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"h-5 w-5 text-destructive"}),"Authentication Failed"]}):e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"h-5 w-5 text-green-600"}),"Authentication Successful"]})})}),e.jsx(v,{className:"space-y-4",children:n?e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:n}),e.jsx("p",{className:"mt-4",children:"This window will close automatically."})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(b,{name:"progress_activity",size:32,className:"animate-spin text-primary"})}),e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authentication complete. This window will close automatically."})]})})]})})}export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,at as ve,j as o,c as Y,a5 as he}from"./index-VCe1FY3E.js";import{c as oe,b as De}from"./use-connection-D5nZyekX.js";import{C as Ye}from"./collection-header-C3vTyWNy.js";import{C as qe}from"./collection-page-BplXISpO.js";import{E as fe}from"./error-boundary-L4NxoU-J.js";import{u as le}from"./use-tool-call-BsMTRGjQ.js";import{u as Q}from"./tooltip-BLbXpJcn.js";import{B as re}from"./button-CB7Gt-Ba.js";import{I as ne}from"./icon-Zm7eEeKG.js";import{c as T,p as ee,a as Je,i as Qe,s as F,b as et,d as tt,e as Me,f as at,g as rt,h as z,j as nt,k as ot,l as lt,m as st,n as Re,o as it,q as ct,r as dt,t as mt,u as ut,v as ft,w as Le,x as pt,y as be,z as Ke,R as gt,S as vt,D as Ge,A as $e,B as q,C as ht,L as Z,Z as Be,E as bt,F as yt,J as xt,G as Pt,H as Se,I as ye,P as St,K as jt,M as At,N as It,O as Ot,Q as _t,T as Nt,U as Tt,V as kt,W as Et,X as wt,Y as Ct,_ as je,$ as ae,a0 as pe,a1 as Ae,a2 as Dt,a3 as J,a4 as Mt,a5 as Rt,a6 as Lt,a7 as Kt,a8 as Gt,a9 as $t,aa as Bt,ab as zt,ac as Wt,ad as Ft,ae as Vt,af as Ht,ag as Ut,ah as se,ai as Xt,aj as Zt,ak as Yt}from"./monitoring-stats-row-DiSEgwHP.js";import{I as ze}from"./integration-icon-Dgf9Pzxc.js";import{B as qt}from"./badge-D0svJbIE.js";import"./collection-display-button-Ccjj22Xn.js";import"./dropdown-menu-zoKN8fKM.js";import"./utils-B-QWwgyW.js";import"./index-CoeZDSQf.js";function ie(){const e=new Date,t=new Date;t.setHours(e.getHours()-24),t.setSeconds(0,0);const a=new Date(e);return a.setHours(a.getHours()+1),a.setSeconds(0,0),{startDate:t.toISOString(),endDate:a.toISOString()}}var We=e=>e.graphicalItems.polarItems,Jt=T([ee,Je],Qe),ce=T([We,F,Jt],et),Qt=T([ce],tt),de=T([Qt,Me],at),ea=T([de,F,ce],rt);T([de,F,ce],(e,t,a)=>a.length>0?e.flatMap(r=>a.flatMap(n=>{var l,d=z(r,(l=t.dataKey)!==null&&l!==void 0?l:n.dataKey);return{value:d,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(r=>({value:z(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var Ie=()=>{},ta=T([de,F,ce,nt,ee],ot),aa=T([F,lt,st,Ie,ta,Ie,Re,ee],it),Fe=T([F,Re,de,ea,ct,ee,aa],dt),ra=T([Fe,F,mt],ut);T([F,Fe,ra,ee],ft);function Oe(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),a.push.apply(a,r)}return a}function _e(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Oe(Object(a),!0).forEach(function(r){na(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Oe(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function na(e,t,a){return(t=oa(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function oa(e){var t=la(e,"string");return typeof t=="symbol"?t:t+""}function la(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sa=(e,t)=>t,xe=T([We,sa],(e,t)=>e.filter(a=>a.type==="pie").find(a=>a.id===t)),ia=[],Pe=(e,t,a)=>a?.length===0?ia:a,Ve=T([Me,xe,Pe],(e,t,a)=>{var{chartData:r}=e;if(t!=null){var n;if(t?.data!=null&&t.data.length>0?n=t.data:n=r,(!n||!n.length)&&a!=null&&(n=a.map(l=>_e(_e({},t.presentationProps),l.props))),n!=null)return n}}),ca=T([Ve,xe,Pe],(e,t,a)=>{if(!(e==null||t==null))return e.map((r,n)=>{var l,d=z(r,t.nameKey,t.name),c;return a!=null&&(l=a[n])!==null&&l!==void 0&&(l=l.props)!==null&&l!==void 0&&l.fill?c=a[n].props.fill:typeof r=="object"&&r!=null&&"fill"in r?c=r.fill:c=t.fill,{value:Le(d,t.dataKey),color:c,payload:r,type:t.legendType}})}),da=T([Ve,xe,Pe,pt],(e,t,a,r)=>{if(!(t==null||e==null))return Ea({offset:r,pieSettings:t,displayedData:e,cells:a})}),ma=["key"],ua=["onMouseEnter","onClick","onMouseLeave"],fa=["id"],pa=["id"];function Ne(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),a.push.apply(a,r)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Ne(Object(a),!0).forEach(function(r){ga(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ne(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function ga(e,t,a){return(t=va(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function va(e){var t=ha(e,"string");return typeof t=="symbol"?t:t+""}function ha(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W(){return W=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},W.apply(null,arguments)}function me(e,t){if(e==null)return{};var a,r,n=ba(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function ba(e,t){if(e==null)return{};var a={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;a[r]=e[r]}return a}function ya(e){var t=i.useMemo(()=>$e(e.children,ye),[e.children]),a=q(r=>ca(r,e.id,t));return a==null?null:i.createElement(ht,{legendPayload:a})}var xa=i.memo(e=>{var{dataKey:t,nameKey:a,sectors:r,stroke:n,strokeWidth:l,fill:d,name:c,hide:u,tooltipType:m,id:f}=e,g={dataDefinedOnItem:r.map(s=>s.tooltipPayload),positions:r.map(s=>s.tooltipPosition),settings:{stroke:n,strokeWidth:l,fill:d,dataKey:t,nameKey:a,name:Le(c,t),hide:u,type:m,color:d,unit:"",graphicalItemId:f}};return i.createElement(bt,{tooltipEntrySettings:g})}),Pa=(e,t)=>e>t?"start":e<t?"end":"middle",Sa=(e,t,a)=>typeof t=="function"?J(t(e),a,a*.8):J(t,a,a*.8),ja=(e,t,a)=>{var{top:r,left:n,width:l,height:d}=t,c=Dt(l,d),u=n+J(e.cx,l,l/2),m=r+J(e.cy,d,d/2),f=J(e.innerRadius,c,0),g=Sa(a,e.outerRadius,c),s=e.maxRadius||Math.sqrt(l*l+d*d)/2;return{cx:u,cy:m,innerRadius:f,outerRadius:g,maxRadius:s}},Aa=(e,t)=>{var a=ae(t-e),r=Math.min(Math.abs(t-e),360);return a*r};function Ia(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var Oa=(e,t)=>{if(i.isValidElement(e))return i.cloneElement(e,t);if(typeof e=="function")return e(t);var a=ve("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,n=me(t,ma);return i.createElement(Mt,W({},n,{type:"linear",className:a}))},_a=(e,t,a)=>{if(i.isValidElement(e))return i.cloneElement(e,t);var r=a;if(typeof e=="function"&&(r=e(t),i.isValidElement(r)))return r;var n=ve("recharts-pie-label-text",Ia(e));return i.createElement(Rt,W({},t,{alignmentBaseline:"middle",className:n}),r)};function Na(e){var{sectors:t,props:a,showLabels:r}=e,{label:n,labelLine:l,dataKey:d}=a;if(!r||!n||!t)return null;var c=Ke(a),u=Ae(n),m=Ae(l),f=typeof n=="object"&&"offsetRadius"in n&&typeof n.offsetRadius=="number"&&n.offsetRadius||20,g=t.map((s,v)=>{var b=(s.startAngle+s.endAngle)/2,h=pe(s.cx,s.cy,s.outerRadius+f,b),y=I(I(I(I({},c),s),{},{stroke:"none"},u),{},{index:v,textAnchor:Pa(h.x,s.cx)},h),p=I(I(I(I({},c),s),{},{fill:"none",stroke:s.fill},m),{},{index:v,points:[pe(s.cx,s.cy,s.outerRadius,b),h],key:"line"});return i.createElement(Be,{zIndex:Ge.label,key:"label-".concat(s.startAngle,"-").concat(s.endAngle,"-").concat(s.midAngle,"-").concat(v)},i.createElement(Z,null,l&&Oa(l,p),_a(n,y,z(s,d))))});return i.createElement(Z,{className:"recharts-pie-labels"},g)}function Ta(e){var{sectors:t,props:a,showLabels:r}=e,{label:n}=a;return typeof n=="object"&&n!=null&&"position"in n?i.createElement(Ct,{label:n}):i.createElement(Na,{sectors:t,props:a,showLabels:r})}function ka(e){var{sectors:t,activeShape:a,inactiveShape:r,allOtherPieProps:n,shape:l,id:d}=e,c=q(jt),u=q(At),m=q(It),{onMouseEnter:f,onClick:g,onMouseLeave:s}=n,v=me(n,ua),b=Ot(f,n.dataKey,d),h=_t(s),y=Nt(g,n.dataKey,d);return t==null||t.length===0?null:i.createElement(i.Fragment,null,t.map((p,P)=>{if(p?.startAngle===0&&p?.endAngle===0&&t.length!==1)return null;var N=m==null||m===d,S=String(P)===c&&(u==null||n.dataKey===u)&&N,O=c?r:null,j=a&&S?a:O,x=I(I({},p),{},{stroke:p.stroke,tabIndex:-1,[kt]:P,[Tt]:d});return i.createElement(Z,W({key:"sector-".concat(p?.startAngle,"-").concat(p?.endAngle,"-").concat(p.midAngle,"-").concat(P),tabIndex:-1,className:"recharts-pie-sector"},Et(v,p,P),{onMouseEnter:b(p,P),onMouseLeave:h(p,P),onClick:y(p,P)}),i.createElement(wt,W({option:l??j,index:P,shapeType:"sector",isActive:S},x)))}))}function Ea(e){var t,{pieSettings:a,displayedData:r,cells:n,offset:l}=e,{cornerRadius:d,startAngle:c,endAngle:u,dataKey:m,nameKey:f,tooltipType:g}=a,s=Math.abs(a.minAngle),v=Aa(c,u),b=Math.abs(v),h=r.length<=1?0:(t=a.paddingAngle)!==null&&t!==void 0?t:0,y=r.filter(j=>z(j,m,0)!==0).length,p=(b>=360?y:y-1)*h,P=b-y*s-p,N=r.reduce((j,x)=>{var _=z(x,m,0);return j+(je(_)?_:0)},0),S;if(N>0){var O;S=r.map((j,x)=>{var _=z(j,m,0),w=z(j,f,x),k=ja(a,l,j),L=(je(_)?_:0)/N,M,C=I(I({},j),n&&n[x]&&n[x].props);x?M=O.endAngle+ae(v)*h*(_!==0?1:0):M=c;var R=M+ae(v)*((_!==0?s:0)+L*P),D=(M+R)/2,E=(k.innerRadius+k.outerRadius)/2,K=[{name:w,value:_,payload:C,dataKey:m,type:g,graphicalItemId:a.id}],$=pe(k.cx,k.cy,E,D);return O=I(I(I(I({},a.presentationProps),{},{percent:L,cornerRadius:typeof d=="string"?parseFloat(d):d,name:w,tooltipPayload:K,midAngle:D,middleRadius:E,tooltipPosition:$},C),k),{},{value:_,dataKey:m,startAngle:M,endAngle:R,payload:C,paddingAngle:ae(v)*h}),O})}return S}function wa(e){var{showLabels:t,sectors:a,children:r}=e,n=i.useMemo(()=>!t||!a?[]:a.map(l=>({value:l.value,payload:l.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:l.cx,cy:l.cy,innerRadius:l.innerRadius,outerRadius:l.outerRadius,startAngle:l.startAngle,endAngle:l.endAngle,clockWise:!1},fill:l.fill})),[a,t]);return i.createElement(St,{value:t?n:void 0},r)}function Ca(e){var{props:t,previousSectorsRef:a,id:r}=e,{sectors:n,isAnimationActive:l,animationBegin:d,animationDuration:c,animationEasing:u,activeShape:m,inactiveShape:f,onAnimationStart:g,onAnimationEnd:s}=t,v=yt(t,"recharts-pie-"),b=a.current,[h,y]=i.useState(!1),p=i.useCallback(()=>{typeof s=="function"&&s(),y(!1)},[s]),P=i.useCallback(()=>{typeof g=="function"&&g(),y(!0)},[g]);return i.createElement(wa,{showLabels:!h,sectors:n},i.createElement(xt,{animationId:v,begin:d,duration:c,isActive:l,easing:u,onAnimationStart:P,onAnimationEnd:p,key:v},N=>{var S=[],O=n&&n[0],j=O?.startAngle;return n?.forEach((x,_)=>{var w=b&&b[_],k=_>0?Pt(x,"paddingAngle",0):0;if(w){var L=Se(w.endAngle-w.startAngle,x.endAngle-x.startAngle,N),M=I(I({},x),{},{startAngle:j+k,endAngle:j+L+k});S.push(M),j=M.endAngle}else{var{endAngle:C,startAngle:R}=x,D=Se(0,C-R,N),E=I(I({},x),{},{startAngle:j+k,endAngle:j+D+k});S.push(E),j=E.endAngle}}),a.current=S,i.createElement(Z,null,i.createElement(ka,{sectors:S,activeShape:m,inactiveShape:f,allOtherPieProps:t,shape:t.shape,id:r}))}),i.createElement(Ta,{showLabels:!h,sectors:n,props:t}),t.children)}var Da={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Ge.area};function Ma(e){var{id:t}=e,a=me(e,fa),{hide:r,className:n,rootTabIndex:l}=e,d=i.useMemo(()=>$e(e.children,ye),[e.children]),c=q(f=>da(f,t,d)),u=i.useRef(null),m=ve("recharts-pie",n);return r||c==null?(u.current=null,i.createElement(Z,{tabIndex:l,className:m})):i.createElement(Be,{zIndex:e.zIndex},i.createElement(xa,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:c,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),i.createElement(Z,{tabIndex:l,className:m},i.createElement(Ca,{props:I(I({},a),{},{sectors:c}),previousSectorsRef:u,id:t})))}function He(e){var t=be(e,Da),{id:a}=t,r=me(t,pa),n=Ke(r);return i.createElement(gt,{id:a,type:"pie"},l=>i.createElement(i.Fragment,null,i.createElement(vt,{type:"pie",id:l,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:n,maxRadius:t.maxRadius}),i.createElement(ya,W({},r,{id:l})),i.createElement(Ma,W({},r,{id:l}))))}He.displayName="Pie";function Ra(e){var t=Lt();return i.useEffect(()=>{t(Kt(e))},[t,e]),null}var La=["layout"];function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ge.apply(null,arguments)}function Ka(e,t){if(e==null)return{};var a,r,n=Ga(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function Ga(e,t){if(e==null)return{};var a={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;a[r]=e[r]}return a}var $a={top:5,right:5,bottom:5,left:5},Ue={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:$a,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Ba=i.forwardRef(function(t,a){var r,n=be(t.categoricalChartProps,Ue),{layout:l}=n,d=Ka(n,La),{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:m,tooltipPayloadSearcher:f}=t,g={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:m,tooltipPayloadSearcher:f,eventEmitter:void 0};return i.createElement(Gt,{preloadedState:{options:g},reduxStoreName:(r=n.id)!==null&&r!==void 0?r:c},i.createElement($t,{chartData:n.data}),i.createElement(Bt,{layout:l,margin:n.margin}),i.createElement(zt,{baseValue:void 0,accessibilityLayer:n.accessibilityLayer,barCategoryGap:n.barCategoryGap,maxBarSize:n.maxBarSize,stackOffset:n.stackOffset,barGap:n.barGap,barSize:n.barSize,syncId:n.syncId,syncMethod:n.syncMethod,className:n.className,reverseStackOrder:n.reverseStackOrder}),i.createElement(Ra,{cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius}),i.createElement(Wt,ge({},d,{ref:a})))});function Te(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),a.push.apply(a,r)}return a}function ke(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Te(Object(a),!0).forEach(function(r){za(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Te(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function za(e,t,a){return(t=Wa(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Wa(e){var t=Fa(e,"string");return typeof t=="symbol"?t:t+""}function Fa(e,t){if(typeof e!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var r=a.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Va=["item"],Ha=ke(ke({},Ue),{},{layout:"centric",startAngle:0,endAngle:360}),Ua=i.forwardRef((e,t)=>{var a=be(e,Ha);return i.createElement(Ba,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Va,tooltipPayloadSearcher:Ft,categoricalChartProps:a,ref:t})});function Xa(e,t){const r=(t.getTime()-e.getTime())/24,n=Array.from({length:24},(u,m)=>{const f=new Date(e.getTime()+m*r),g=Math.floor(Math.random()*15)+5,s=m<20?g:g+Math.floor(Math.random()*20),v=Math.random()>.85?Math.floor(Math.random()*3):0,b=s>0?v/s*100:0,h=Math.floor(Math.random()*300)+100;return{t:f.toISOString(),ts:f.getTime(),label:f.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),calls:s,errors:v,errorRate:b,p95:h}}),l=n.reduce((u,m)=>u+m.calls,0),d=n.reduce((u,m)=>u+m.errors,0),c=Math.floor(n.reduce((u,m)=>u+m.p95,0)/n.length);return{totalCalls:l,totalErrors:d,avgDurationMs:c,data:n}}function Za(){const{locator:e}=Q(),t=oe(),a=ie(),{data:r}=le({toolCaller:t,toolName:"MONITORING_LOGS_LIST",toolInputParams:{...a,limit:750,offset:0},scope:e,staleTime:3e4}),n=r?.logs??[],l=new Date(a.startDate),d=new Date(a.endDate),c=n.length===0?Xa(l,d):Ht(n,{startDate:l,endDate:d},24,r?.total);return o.jsx(Ut,{stats:c,chartHeight:"h-[103px]",showDateLabels:!0,dateRange:{startDate:l,endDate:d}})}const Ee={Content:Za,Skeleton:Vt};function Xe(e){return(e?.totalCalls??0)>0}function Ya(){const e=Y.c(35),{org:t,locator:a}=Q(),r=he();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=oe(),e[0]=n):n=e[0];const l=n,d=De()??[];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c={...ie(),limit:8,offset:0},e[1]=c):c=e[1];const u=c;let m;e[2]!==a?(m={toolCaller:l,toolName:"MONITORING_LOGS_LIST",toolInputParams:u,scope:a,staleTime:3e4},e[2]=a,e[3]=m):m=e[3];const{data:f}=le(m);let g;e[4]!==f?.logs?(g=f?.logs??[],e[4]=f?.logs,e[5]=g):g=e[5];const s=g,v=new Map(d.map(qa));let b;e[6]!==r||e[7]!==t.slug?(b=A=>{r({to:"/$org/monitoring",params:{org:t.slug},search:{connections:A.connectionId,tool:A.toolName}})},e[6]=r,e[7]=t.slug,e[8]=b):b=e[8];const h=b;let y;e[9]!==r||e[10]!==t.slug?(y=()=>{r({to:"/$org/monitoring",params:{org:t.slug}})},e[9]=r,e[10]=t.slug,e[11]=y):y=e[11];const p=y;let P;e[12]===Symbol.for("react.memo_cache_sentinel")?(P={id:"1",toolName:"Google Drive",connectionId:"mock1",connectionTitle:"Google Drive",timestamp:new Date().toISOString(),durationMs:200,isError:!0},e[12]=P):P=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N={id:"2",toolName:"Google Sheets",connectionId:"mock2",connectionTitle:"Google Sheets",timestamp:new Date().toISOString(),durationMs:200,isError:!1},e[13]=N):N=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S={id:"3",toolName:"Google Slides",connectionId:"mock3",connectionTitle:"Google Slides",timestamp:new Date().toISOString(),durationMs:200,isError:!1},e[14]=S):S=e[14];let O;e[15]===Symbol.for("react.memo_cache_sentinel")?(O={id:"4",toolName:"Gmail",connectionId:"mock4",connectionTitle:"Gmail",timestamp:new Date().toISOString(),durationMs:200,isError:!1},e[15]=O):O=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={id:"5",toolName:"Google Calendar",connectionId:"mock5",connectionTitle:"Google Calendar",timestamp:new Date().toISOString(),durationMs:200,isError:!1},e[16]=j):j=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x={id:"6",toolName:"Discord",connectionId:"mock6",connectionTitle:"Discord",timestamp:new Date().toISOString(),durationMs:200,isError:!1},e[17]=x):x=e[17];let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_={id:"7",toolName:"VTEX",connectionId:"mock7",connectionTitle:"VTEX",timestamp:new Date().toISOString(),durationMs:200,isError:!1},e[18]=_):_=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=[P,N,S,O,j,x,_,{id:"8",toolName:"Google Docs",connectionId:"mock8",connectionTitle:"Google Docs",timestamp:new Date().toISOString(),durationMs:200,isError:!1}],e[19]=w):w=e[19];const k=w,L=s.length===0?k:s,M=s.length===0,C=A=>{const G=v.get(A.connectionId),B=new Date(A.timestamp).toLocaleString("en-US",{month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"});return o.jsxs("div",{className:"flex items-center h-16 border-t border-border/60 hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>!M&&h(A),children:[o.jsx("div",{className:"flex items-center justify-center w-16 px-4",children:o.jsx(ze,{icon:G?.icon||null,name:A.connectionTitle,size:"xs",className:"shadow-sm"})}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx("span",{className:"text-xs font-medium text-foreground truncate block",children:A.toolName})}),o.jsxs("div",{className:"flex items-center gap-2 px-5 text-xs whitespace-nowrap",children:[o.jsxs("span",{className:"text-muted-foreground",children:[A.durationMs,"ms"]}),o.jsx("span",{className:"text-foreground",children:B})]}),o.jsx("div",{className:"flex items-center pr-5",children:o.jsx(qt,{variant:A.isError?"destructive":"success",className:"text-xs px-2 py-1",children:A.isError?"Error":"OK"})})]},A.id)};let R;e[20]===Symbol.for("react.memo_cache_sentinel")?(R=o.jsx("p",{className:"text-sm text-muted-foreground",children:"Recent Activity"}),e[20]=R):R=e[20];let D;e[21]!==p||e[22]!==s.length||e[23]!==f?(D=f&&f.total>s.length?o.jsxs(re,{variant:"ghost",size:"sm",onClick:p,children:["See all",o.jsx(ne,{name:"chevron_right",size:16})]}):null,e[21]=p,e[22]=s.length,e[23]=f,e[24]=D):D=e[24];let E;if(e[25]!==L||e[26]!==C){let A;e[28]!==C?(A=G=>C(G),e[28]=C,e[29]=A):A=e[29],E=L.map(A),e[25]=L,e[26]=C,e[27]=E}else E=e[27];let K;e[30]!==E?(K=o.jsx("div",{className:"w-full h-full overflow-auto ",children:E}),e[30]=E,e[31]=K):K=e[31];let $;return e[32]!==D||e[33]!==K?($=o.jsx(se,{title:R,action:D,noPadding:!0,children:K}),e[32]=D,e[33]=K,e[34]=$):$=e[34],$}function qa(e){return[e.id,e]}function Ja(){const e=Y.c(3);let t,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx("p",{className:"text-sm text-muted-foreground",children:"Recent Activity"}),a=o.jsx("div",{className:"h-7 w-20 rounded bg-muted animate-pulse"}),e[0]=t,e[1]=a):(t=e[0],a=e[1]);let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(se,{title:t,action:a,children:o.jsx("div",{className:"space-y-2",children:[...Array(6)].map(Qa)})}),e[2]=r):r=e[2],r}function Qa(e,t){return o.jsx("div",{className:"h-12 rounded-xl bg-muted animate-pulse"},t)}const we=Object.assign(Ya,{Skeleton:Ja});function er(e,t){const a=new Map;for(const r of e){const n=r.toolName||"Unknown",l=a.get(n);a.set(n,{calls:(l?.calls??0)+1,connectionId:l?.connectionId||r.connectionId})}return[...a.entries()].map(([r,{calls:n,connectionId:l}])=>({tool:r,calls:n,connectionId:l})).sort((r,n)=>n.calls-r.calls).slice(0,t)}function tr(){const e=Y.c(28),{locator:t}=Q();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=oe(),e[0]=a):a=e[0];const r=a;let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=ie(),e[1]=n):n=e[1];const l=n,d=De()??[];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={...l,limit:750,offset:0},e[2]=c):c=e[2];let u;e[3]!==t?(u={toolCaller:r,toolName:"MONITORING_LOGS_LIST",toolInputParams:c,scope:t,staleTime:3e4},e[3]=t,e[4]=u):u=e[4];const{data:m}=le(u),f=m?.logs??[];let s=er(f,6).map(or);f.length===0&&(s=[{key:"t1",tool:"COLLECTION_AGENT_LIST",calls:210,connectionId:"mock1"},{key:"t2",tool:"COLLECTION_LLM_LIST",calls:82,connectionId:"mock2"},{key:"t3",tool:"COLLECTION_REGISTRY_APPS_LIST",calls:15,connectionId:"mock3"},{key:"t4",tool:"COLLECTION_REGISTRY_TOOLS_LIST",calls:15,connectionId:"mock4"},{key:"t5",tool:"MCP_CONFIGURATION",calls:8,connectionId:"mock5"},{key:"t6",tool:"LLM_DO_STREAM",calls:1,connectionId:"mock6"}]);const v=Object.fromEntries(s.map(nr)),b=new Map(d.map(rr)),h=se;let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("p",{className:"text-sm text-muted-foreground",children:"Top Tools (24h)"}),e[5]=y):y=e[5];const p=!0,P="w-full",N="flex items-center justify-center py-4 shrink-0",S=Xt,O="h-[200px] w-[200px] aspect-auto",j=Ua;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Zt,{content:o.jsx(Yt,{indicator:"dot",nameKey:"key"})}),e[6]=x):x=e[6];const _=He,w=s,k="calls",L="key",M="50%",C="50%",R=52,D=82,E=2,K="var(--color-border)",$=1,A=s.map(ar);let G;e[7]!==_||e[8]!==A||e[9]!==s?(G=o.jsx(_,{data:w,dataKey:k,nameKey:L,cx:M,cy:C,innerRadius:R,outerRadius:D,paddingAngle:E,stroke:K,strokeWidth:$,children:A}),e[7]=_,e[8]=A,e[9]=s,e[10]=G):G=e[10];let V;e[11]!==j||e[12]!==G||e[13]!==x?(V=o.jsxs(j,{children:[x,G]}),e[11]=j,e[12]=G,e[13]=x,e[14]=V):V=e[14];let B;e[15]!==S||e[16]!==v||e[17]!==V?(B=o.jsx("div",{className:N,children:o.jsx(S,{className:O,config:v,children:V})}),e[15]=S,e[16]=v,e[17]=V,e[18]=B):B=e[18];const ue=s.map(X=>{const Ze=b.get(X.connectionId||"");return o.jsxs("div",{className:"flex items-center h-16 border-t border-border/60 hover:bg-muted/40 transition-colors",children:[o.jsxs("div",{className:"flex items-center w-20 pl-4 gap-2",children:[o.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:v[X.key]?.color},"aria-hidden":"true"}),o.jsx("div",{className:"w-6 h-6 shrink-0 flex items-center justify-center",children:o.jsx(ze,{icon:Ze?.icon||null,name:X.tool,size:"xs",className:"shadow-sm"})})]}),o.jsx("div",{className:"flex-1 min-w-0 px-4",children:o.jsx("span",{className:"text-xs font-medium text-foreground truncate block",children:X.tool})}),o.jsx("div",{className:"flex items-center pr-5",children:o.jsx("span",{className:"font-mono text-xs text-foreground tabular-nums",children:X.calls})})]},X.key)});let H;e[19]!==ue?(H=o.jsx("div",{className:"w-full",children:ue}),e[19]=ue,e[20]=H):H=e[20];let U;e[21]!==B||e[22]!==H?(U=o.jsxs("div",{className:P,children:[B,H]}),e[21]=B,e[22]=H,e[23]=U):U=e[23];let te;return e[24]!==h||e[25]!==U||e[26]!==y?(te=o.jsx(h,{title:y,noPadding:p,children:U}),e[24]=h,e[25]=U,e[26]=y,e[27]=te):te=e[27],te}function ar(e){return o.jsx(ye,{fill:`var(--color-${e.key})`},e.key)}function rr(e){return[e.id,e]}function nr(e,t){return[e.key,{label:e.tool,color:`var(--chart-${t%5+1})`}]}function or(e,t){return{key:`t${t+1}`,tool:e.tool,calls:e.calls,connectionId:e.connectionId}}function lr(){const e=Y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=o.jsx(se,{title:o.jsx("p",{className:"text-sm text-muted-foreground",children:"Top Tools (24h)"}),children:o.jsx("div",{className:"h-[260px] w-full rounded-xl bg-muted animate-pulse"})}),e[0]=t):t=e[0],t}const Ce=Object.assign(tr,{Skeleton:lr});function sr(){const e=Y.c(21),{org:t,locator:a}=Q(),r=he();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=oe(),e[0]=n):n=e[0];const l=n;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=ie(),e[1]=d):d=e[1];const c=d;let u;e[2]!==a?(u={toolCaller:l,toolName:"MONITORING_STATS",toolInputParams:c,scope:a,staleTime:6e4,refetchInterval:ir},e[2]=a,e[3]=u):u=e[3];const{data:m}=le(u),f=Xe(m);let g;e[4]!==r||e[5]!==t.slug?(g=()=>{r({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},e[4]=r,e[5]=t.slug,e[6]=g):g=e[6];const s=g;let v;e[7]!==r||e[8]!==t.slug?(v=()=>{r({to:"/$org/store",params:{org:t.slug}})},e[7]=r,e[8]=t.slug,e[9]=v):v=e[9];const b=v;if(f)return null;let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"p-2",children:o.jsx("div",{className:"bg-muted border border-border rounded-lg h-[250px] overflow-hidden relative flex items-center justify-center",children:o.jsx("img",{src:"/empty-state-home.png",alt:"MCP Mesh illustration",className:"w-full h-full object-cover"})})}),e[10]=h):h=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsxs("div",{className:"px-6 py-6 space-y-2",children:[o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Welcome to your MCP Mesh"}),o.jsx("p",{className:"text-sm text-muted-foreground leading-normal",children:"Connect your first MCP server to unlock real-time metrics, activity logs, and analytics right here on your home."})]}),e[11]=y):y=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(ne,{name:"shopping_bag",size:16}),e[12]=p):p=e[12];let P;e[13]!==b?(P=o.jsxs(re,{onClick:b,size:"sm",className:"h-9",children:[p,"Browse Store"]}),e[13]=b,e[14]=P):P=e[14];let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=o.jsx(ne,{name:"add",size:16}),e[15]=N):N=e[15];let S;e[16]!==s?(S=o.jsxs(re,{variant:"outline",onClick:s,size:"sm",className:"h-9",children:[N,"Connect MCP Server"]}),e[16]=s,e[17]=S):S=e[17];let O;return e[18]!==S||e[19]!==P?(O=o.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-4 bg-background/80 backdrop-blur-[3px] z-10",children:o.jsxs("div",{className:"max-w-md w-full bg-background rounded-xl border border-border shadow-lg pointer-events-auto overflow-hidden",children:[h,y,o.jsxs("div",{className:"border-t border-border px-4 py-4 flex items-center justify-center gap-2",children:[P,S]})]})}),e[18]=S,e[19]=P,e[20]=O):O=e[20],O}function ir(e){return Xe(e.state.data)?!1:1e3}function Ir(){const e=Y.c(18),{org:t}=Q(),a=he();let r;e[0]!==a||e[1]!==t.slug?(r=()=>{a({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},e[0]=a,e[1]=t.slug,e[2]=r):r=e[2];const n=r;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(sr,{}),e[3]=l):l=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(ne,{name:"add",size:16}),e[4]=d):d=e[4];let c;e[5]!==n?(c=o.jsxs(re,{variant:"outline",size:"sm",className:"h-7 px-3",onClick:n,children:[d,"Connect MCP Server"]}),e[5]=n,e[6]=c):c=e[6];let u;e[7]!==t.name||e[8]!==c?(u=o.jsx(Ye,{title:t.name,ctaButton:c}),e[7]=t.name,e[8]=c,e[9]=u):u=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring stats"}),e[10]=m):m=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"lg:col-span-6",children:o.jsx(fe,{fallback:m,children:o.jsx(i.Suspense,{fallback:o.jsx(Ee.Skeleton,{}),children:o.jsx(Ee.Content,{})})})}),e[11]=f):f=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load recent activity"}),e[12]=g):g=e[12];let s;e[13]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"lg:col-span-3 min-h-0 overflow-hidden",children:o.jsx(fe,{fallback:g,children:o.jsx(i.Suspense,{fallback:o.jsx(we.Skeleton,{}),children:o.jsx(we,{})})})}),e[13]=s):s=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load top tools"}),e[14]=v):v=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx("div",{className:"flex-1 overflow-auto relative",children:o.jsx("div",{className:"h-full",children:o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-6 lg:grid-rows-[auto_1fr] gap-[0.5px] bg-border h-full",children:[f,s,o.jsx("div",{className:"lg:col-span-3 min-h-0 overflow-hidden",children:o.jsx(fe,{fallback:v,children:o.jsx(i.Suspense,{fallback:o.jsx(Ce.Skeleton,{}),children:o.jsx(Ce,{})})})})]})})}),e[15]=b):b=e[15];let h;return e[16]!==u?(h=o.jsxs(qe,{children:[l,u,b]}),e[16]=u,e[17]=h):h=e[17],h}export{Ir as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a2 as U,j as t,c as F,a5 as W,r as M}from"./index-VCe1FY3E.js";import{u as Y}from"./useQuery-DEUZMq4A.js";import{I as K}from"./icon-Zm7eEeKG.js";import{e as J}from"./registry-utils-ulDDT0d8.js";import{C as P}from"./collection-display-button-Ccjj22Xn.js";import{C as X}from"./collection-search-BpPEPb0j.js";import{C as Z}from"./collection-table-wrapper-CJdrG443.js";import{E as H}from"./empty-state-BCgOYCyG.js";import{I as ee}from"./integration-icon-Dgf9Pzxc.js";import{C as te}from"./card-BZePxfHz.js";import{V as oe}from"./layout-C75gYFRR.js";import{c as $}from"./utils-B-QWwgyW.js";import{B as re}from"./badge-D0svJbIE.js";import{B as se}from"./button-CB7Gt-Ba.js";function ne(o){return o.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function ae(o){return o.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,a)=>a.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${a} target="_blank" rel="noopener noreferrer">`)}function ie(o){let e=ne(o);return e=ae(e),e}function Ee({repository:o}){const e=o?J(o):null,{data:a,isLoading:c}=Y({queryKey:U.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const s=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!s.ok){if(s.status===404)return null;throw new Error(`Failed to fetch README: ${s.statusText}`)}const m=await s.text();return ie(m)}catch(s){return console.error("Error fetching README:",s),null}},enabled:!!e&&!!o,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(K,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}):a?t.jsx("div",{className:"p-6 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:a}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(K,{name:"description",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 Re(o){const e=F.c(39),{tools:a,connectionId:c,org:s,onToolClick:m,showToolbar:u,emptyMessage:f}=o,h=u===void 0?!0:u,p=f===void 0?"This connection doesn't have any tools yet.":f,d=W(),[n,A]=M.useState(""),[x,q]=M.useState("table"),[i,_]=M.useState("name"),[l,V]=M.useState("asc");let C;e[0]!==l||e[1]!==i?(C=r=>{i===r?(V(ue),l==="desc"&&_(void 0)):(_(r),V("asc"))},e[0]=l,e[1]=i,e[2]=C):C=e[2];const g=C;let S;e[3]!==c||e[4]!==d||e[5]!==m||e[6]!==s?(S=r=>{m?m(r):c&&s&&d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(r.name)}})},e[3]=c,e[4]=d,e[5]=m,e[6]=s,e[7]=S):S=e[7];const T=S;let E;if(e[8]!==n||e[9]!==l||e[10]!==i||e[11]!==a){const r=!a||a.length===0?[]:n.trim()?(()=>{const L=n.toLowerCase();return a.filter(w=>w.name.toLowerCase().includes(L)||w.description&&w.description.toLowerCase().includes(L))})():a;E=!i||!l?r:[...r].sort((L,w)=>{const O=L[i]||"",Q=w[i]||"",B=String(O).localeCompare(String(Q));return l==="asc"?B:-B}),e[8]=n,e[9]=l,e[10]=i,e[11]=a,e[12]=E}else E=e[12];const v=E;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:de,sortable:!0},{id:"description",header:"Description",render:me,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const z=R;let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=z.filter(ce).map(le),e[14]=k):k=e[14];const G=k;let b;e[15]!==g||e[16]!==h||e[17]!==l||e[18]!==i||e[19]!==x?(b=h&&t.jsx(oe,{children:t.jsx(P,{viewMode:x,onViewModeChange:q,sortKey:i,sortDirection:l,onSort:g,sortOptions:G})}),e[15]=g,e[16]=h,e[17]=l,e[18]=i,e[19]=x,e[20]=b):b=e[20];let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=r=>{r.key==="Escape"&&(A(""),r.target.blur())},e[21]=I):I=e[21];let j;e[22]!==n?(j=t.jsx(X,{value:n,onChange:A,placeholder:"Search tools...",onKeyDown:I}),e[22]=n,e[23]=j):j=e[23];let y;e[24]!==p||e[25]!==g||e[26]!==T||e[27]!==n||e[28]!==l||e[29]!==i||e[30]!==v||e[31]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:v.length===0?t.jsx(H,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:v.map(r=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>T(r),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:r.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:r.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:r.description||"No description"})]})]})},r.name))})}):t.jsx(Z,{columns:z,data:v,isLoading:!1,sortKey:i,sortDirection:l,onSort:g,onRowClick:r=>T(r),emptyState:t.jsx(H,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":p})}),e[24]=p,e[25]=g,e[26]=T,e[27]=n,e[28]=l,e[29]=i,e[30]=v,e[31]=x,e[32]=y):y=e[32];let N;e[33]!==j||e[34]!==y?(N=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[j,y]}),e[33]=j,e[34]=y,e[35]=N):N=e[35];let D;return e[36]!==N||e[37]!==b?(D=t.jsxs(t.Fragment,{children:[b,N]}),e[36]=N,e[37]=b,e[38]=D):D=e[38],D}function le(o){return{id:o.id,label:typeof o.header=="string"?o.header:o.id}}function ce(o){return o.sortable}function me(o){return t.jsx("span",{className:"text-sm text-foreground",children:o.description||"—"})}function de(o){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:o.name})}function ue(o){return o==="asc"?"desc":o==="desc"?null:"asc"}function ke(o){const e=F.c(12),{tabs:a,activeTab:c,onTabChange:s,className:m}=o;let u;e[0]!==m?(u=$("flex items-center gap-2 overflow-x-auto no-scrollbar",m),e[0]=m,e[1]=u):u=e[1];let f;if(e[2]!==c||e[3]!==s||e[4]!==a){let p;e[6]!==c||e[7]!==s?(p=d=>{const n=c===d.id;return t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>s(d.id),className:$("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",n&&"bg-muted border-input text-foreground font-medium",!n&&"text-muted-foreground font-normal"),children:[d.label,d.count!==void 0&&t.jsx(re,{variant:"secondary",className:$("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",n?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:d.count})]},d.id)},e[6]=c,e[7]=s,e[8]=p):p=e[8],f=a.map(p),e[2]=c,e[3]=s,e[4]=a,e[5]=f}else f=e[5];let h;return e[9]!==u||e[10]!==f?(h=t.jsx("div",{className:u,children:f}),e[9]=u,e[10]=f,e[11]=h):h=e[11],h}export{ke as R,Re as T,Ee as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as D,a1 as P,r as E,as as B,ar as $,j as t,ap as K,c as Q,a6 as C,a2 as L,a as A,aq as F,ay as T}from"./index-VCe1FY3E.js";import{C as H}from"./collection-header-C3vTyWNy.js";import{C as X}from"./collection-page-BplXISpO.js";import{u as Y}from"./tooltip-BLbXpJcn.js";import{u as G,B as p}from"./button-CB7Gt-Ba.js";import{a as J,F as O,b as R,c as k,d as M,f as U,e as V}from"./form-BmhZau8F.js";import{I as q}from"./input-DWY0hRYC.js";import{c as I}from"./utils-B-QWwgyW.js";import{U as W}from"./upload-CG7PZ6WF.js";import"./collection-display-button-Ccjj22Xn.js";import"./dropdown-menu-zoKN8fKM.js";import"./icon-Zm7eEeKG.js";const Z=K({name:F().min(1,"Name is required").max(255,"Name is too long"),slug:F().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:F().optional()});function _(j){const e=Q.c(24),{value:r,onChange:s,name:u}=j,l=E.useRef(null);let c;e[0]!==s?(c=z=>{const w=z.target.files?.[0];if(w){if(w.size>2097152){C.error("Image must be smaller than 2MB");return}const m=new FileReader;m.onerror=()=>{const N=m.error;console.error("FileReader error:",N),C.error(N?.message||"Failed to read image file. Please try again."),l.current&&(l.current.value="")},m.onloadend=()=>{if(m.readyState===FileReader.DONE&&m.result){const N=m.result;s(N)}},m.readAsDataURL(w)}},e[0]=s,e[1]=c):c=e[1];const a=c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{l.current?.click()},e[2]=g):g=e[2];const v=g;let d;e[3]!==s?(d=z=>{z.stopPropagation(),s("")},e[3]=s,e[4]=d):d=e[4];const o=d;let i;e[5]!==a?(i=t.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:a}),e[5]=a,e[6]=i):i=e[6];let n;e[7]!==o||e[8]!==u||e[9]!==r?(n=r?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:t.jsx("img",{src:r,alt:u||"Organization logo",className:"w-full h-full object-cover"})}),t.jsx("button",{type:"button",onClick:o,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:t.jsx(T,{className:"h-3 w-3"})})]}):t.jsxs("button",{type:"button",onClick:v,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:[t.jsx(W,{className:"h-5 w-5"}),t.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=o,e[8]=u,e[9]=r,e[10]=n):n=e[10];const S=r?"Change Logo":"Upload Logo";let x;e[11]!==S?(x=t.jsx(p,{type:"button",variant:"outline",size:"sm",onClick:v,className:"mb-2",children:S}),e[11]=S,e[12]=x):x=e[12];let h;e[13]!==o||e[14]!==r?(h=r&&t.jsx(p,{type:"button",variant:"ghost",size:"sm",onClick:o,className:"ml-2",children:"Remove"}),e[13]=o,e[14]=r,e[15]=h):h=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=b):b=e[16];let f;e[17]!==x||e[18]!==h?(f=t.jsxs("div",{className:"flex-1",children:[x,h,b]}),e[17]=x,e[18]=h,e[19]=f):f=e[19];let y;return e[20]!==f||e[21]!==i||e[22]!==n?(y=t.jsxs("div",{className:"flex items-start gap-4",children:[i,n,f]}),e[20]=f,e[21]=i,e[22]=n,e[23]=y):y=e[23],y}function ue(){const j=D(),{org:e}=Y(),r=P(),[s,u]=E.useState(!1),[l,c]=E.useState("organization"),a=B({resolver:$(Z),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),g=G({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo!==void 0&&(i.logo=o.logo||null);const n=await A.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:o=>{r.invalidateQueries({queryKey:L.organizations()}),r.invalidateQueries({queryKey:L.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&j({to:"/$org/settings",params:{org:o.data.slug}})},onError:o=>{C.error(o instanceof Error?o.message:"Failed to update organization")},onSettled:()=>{u(!1)}}),v=o=>{u(!0),g.mutate(o)},d=a.formState.isDirty;return t.jsxs(X,{children:[t.jsx(H,{title:"Settings"}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"flex h-full",children:[t.jsx("div",{className:"w-64 border-r border-border bg-background",children:t.jsxs("nav",{className:"p-5 space-y-1",children:[t.jsx("button",{onClick:()=>c("organization"),className:I("w-full text-left px-3 py-2 text-sm font-medium rounded-md transition-colors",l==="organization"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:"Organization"}),t.jsx("button",{onClick:()=>c("connection"),className:I("w-full text-left px-3 py-2 text-sm font-medium rounded-md transition-colors",l==="connection"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:"Connection"})]})}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("div",{className:"p-5 max-w-2xl",children:[l==="organization"&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),t.jsx(J,{...a,children:t.jsxs("form",{onSubmit:a.handleSubmit(v),className:"space-y-6",children:[t.jsx(O,{control:a.control,name:"name",render:({field:o})=>t.jsxs(R,{children:[t.jsx(k,{children:"Organization Name"}),t.jsx(M,{children:t.jsx(q,{placeholder:"My Organization",...o,disabled:s})}),t.jsx(U,{})]})}),t.jsx(O,{control:a.control,name:"slug",render:({field:o})=>t.jsxs(R,{children:[t.jsx(k,{children:"Organization Slug"}),t.jsx(M,{children:t.jsx(q,{placeholder:"my-organization",...o,disabled:s,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.onChange(n)}})}),t.jsx(V,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),t.jsx(U,{})]})}),t.jsx(O,{control:a.control,name:"logo",render:({field:o})=>t.jsxs(R,{children:[t.jsx(k,{children:"Logo"}),t.jsx(M,{children:t.jsx(_,{value:o.value,onChange:o.onChange,name:a.watch("name")})}),t.jsx(U,{})]})}),t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx(p,{type:"submit",disabled:!d||s,className:"min-w-24",children:s?"Saving...":"Save Changes"}),d&&t.jsx(p,{type:"button",variant:"outline",onClick:()=>a.reset(),disabled:s,children:"Cancel"})]})]})})]}),l==="connection"&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Connection"}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Models and agents are automatically discovered from your MCP connections."})]}),t.jsx("div",{children:t.jsx(p,{onClick:()=>j({to:"/$org/mcps",params:{org:e.slug}}),children:"Manage Connections"})})]})]})})]})})]})}export{ue as default};
|