import{r as p,aM as i,aJ as e}from"./@ui-core-DKdciH1Z.js";import{bN as l,e as c,C as h,o as j,q as f,t as g,v as y,T as u,ak as v,al as d}from"./index-D7KLAbvI.js";import{K as t,a as b,V as N}from"./KeyValue-DF0Uxg2V.js";import{a as m,e as C,R as E,E as T}from"./service-connectors-Bf5lqoIA.js";import{R as w}from"./resource-tyes-list-CNuocJjM.js";import{a as x}from"./@react-router-DaIuhn3X.js";import{N as R}from"./NestedCollapsible-k41ntPyA.js";import"./@reactflow-CJzATMj6.js";import"./@zod-DKyD3xVW.js";import"./@monaco-editor-CSMpaClf.js";import"./eye-off-T0xdenj_.js";import"./eye-0EFEzbgA.js";import"./CollapsibleCard-3zV5aMxC.js";import"./CodeSnippet-Dwuwo3ZI.js";function P(){const[s,r]=p.useState(!0),{connectorId:o}=x(),n=i({...l.serviceConnectorDetail(o),throwOnError:!0});if(n.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(n.isError)return e.jsx("div",{children:"Error"});const a=n.data;return e.jsxs(h,{open:s,onOpenChange:r,children:[e.jsx(j,{className:"flex items-center gap-[10px]",children:e.jsxs(f,{className:"flex w-full items-center gap-[10px] text-text-lg",children:[e.jsx(g,{className:` ${s?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`}),"Basic Parameters"]})}),e.jsx(y,{className:"space-y-5 border-t border-theme-border-moderate bg-theme-surface-primary p-5",children:e.jsxs("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 md:gap-y-4 lg:grid-cols-3",children:[e.jsx(t,{label:"Name",value:a.name}),e.jsx(_,{connector:a}),e.jsx(A,{connector:a}),e.jsx(D,{connector:a}),e.jsx(M,{connector:a}),e.jsx(S,{connector:a}),e.jsx(O,{connector:a}),e.jsx(I,{connector:a}),e.jsx(Q,{connector:a})]})})]})}function _({connector:s}){const r=s.body?.connector_type;return!r||typeof r=="string"?null:e.jsx(t,{label:"Type",value:e.jsxs(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit gap-0.5 text-theme-text-primary",color:"grey",children:[e.jsx("img",{src:r.logo_url??"",className:"h-4 w-4 shrink-0",alt:r.name}),e.jsx("span",{children:r.name})]})})}function A({connector:s}){const r=m(s);return e.jsx(t,{label:"Auth Method",value:r===void 0?null:e.jsx(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit text-theme-text-primary",color:"grey",children:e.jsx("span",{children:r.name||s.body?.auth_method})})})}function D({connector:s}){const r=C(s);return e.jsxs(e.Fragment,{children:[e.jsx(b,{children:"Resrouce Types"}),e.jsx(N,{className:"h-auto",children:e.jsx(w,{resourceTypes:r})})]})}function M({connector:s}){return e.jsx(t,{label:"Resource Name",value:e.jsx(E,{connector:s})})}function S({connector:s}){const r=s.resources?.user;return e.jsx(t,{label:"Author",value:r?e.jsx(v,{avatarUrl:r.body?.avatar_url??void 0,username:r.name,isServiceAccount:!!r.body?.is_service_account}):null})}function O({connector:s}){const r=s.body?.expires_at;return e.jsx(t,{label:"Expires in",value:r?e.jsx(T,{expires:r}):"Never"})}function I({connector:s}){const r=s.body?.created;return e.jsx(t,{label:"Created",value:r?e.jsx("span",{className:"truncate",children:e.jsx(d,{dateString:r})}):null})}function Q({connector:s}){const r=s.body?.updated;return e.jsx(t,{label:"Updated",value:r?e.jsx("span",{className:"truncate",children:e.jsx(d,{dateString:r})}):null})}function k(){const{connectorId:s}=x(),r=i({...l.serviceConnectorDetail(s),throwOnError:!0});if(r.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(r.isError)return e.jsx("div",{children:"Error"});const o=r.data,n=m(o);return e.jsx(R,{schema:n?.config_schema,title:e.jsx("p",{className:"text-text-xl",children:"Configuration"}),data:o.metadata?.configuration,isInitialOpen:!0})}function Y(){return e.jsxs("div",{className:"grid grid-cols-1 gap-5",children:[e.jsx("div",{children:e.jsx(P,{})}),e.jsx("div",{className:"space-y-5",children:e.jsx(k,{})})]})}export{Y as default};
