import{j as e,r as y}from"./@radix-3bj3otF9.js";import{N as I,K as i,a as p,b as O,V as k}from"./KeyValue-Dba6goo4.js";import{af as w,e as h,aY as Q,C as b,q as C,t as N,v as D,a1 as v,ae as S}from"./index-Cs2FY84s.js";import{b as E}from"./@tanstack-CByuvRcg.js";import{a as K}from"./@react-router-Ct_TgVUW.js";import{C as P}from"./collapsible-chevron-CRi1mieO.js";import{P as T}from"./pipeline-link-W-agDCn-.js";import"./eye-vFb-iYpN.js";import"./CollapsibleCard-ErHP3-9N.js";import"./chevron-down-smmnLxYI.js";import"./CodeSnippet-C2p1JJEZ.js";import"./@reactflow-CwWcBchH.js";function c({Component:l}){const{deploymentId:r}=K(),n=E({...w.detail(r),throwOnError:!0});if(n.isPending)return e.jsx(h,{className:"h-[200px] w-full"});if(n.isError)return null;const a=n.data;return e.jsx(l,{deployment:a})}function V(){return e.jsx(c,{Component:L})}function L({deployment:l}){var s,o,t;const r=(o=(s=l.resources)==null?void 0:s.deployer)==null?void 0:o.id,n=E({...Q.componentDetail(r),enabled:!!r});if(!r)return null;if(n.isPending)return e.jsx(h,{className:"h-[200px] w-full"});if(n.isError)return null;const a=n.data;return e.jsx(I,{isInitialOpen:!0,title:"Deployer Configuration",data:(t=a.metadata)==null?void 0:t.configuration})}function q(){return e.jsx(c,{Component:A})}function A({deployment:l}){var u,x,j,f,g;const[r,n]=y.useState(!0),a=l.id,s=(u=l.resources)==null?void 0:u.snapshot,o=s==null?void 0:s.id,t=s==null?void 0:s.name,d=(j=(x=l.resources)==null?void 0:x.pipeline)==null?void 0:j.id,m=(g=(f=l.resources)==null?void 0:f.pipeline)==null?void 0:g.name;return e.jsxs(b,{open:r,onOpenChange:n,children:[e.jsx(C,{className:"flex items-center gap-[10px]",children:e.jsxs(N,{className:"flex w-full gap-2",children:[e.jsx(P,{open:r}),"Details"]})}),e.jsx(D,{className:"border-t border-theme-border-moderate bg-theme-surface-primary px-5 py-3",children:e.jsxs("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 md:grid-cols-3 md:gap-y-4",children:[e.jsx(i,{label:"Id",value:e.jsxs("div",{className:"group/copybutton flex items-center gap-0.5",children:[a,e.jsx(v,{copyText:a})]})}),e.jsx(i,{label:"Snapshot",value:o&&t?e.jsx(S,{snapshotId:o,snapshotName:t}):e.jsx(p,{})}),e.jsx(O,{className:"h-auto",children:"Pipeline"}),e.jsx(k,{className:"h-auto",children:d&&m?e.jsx(T,{pipelineId:d,pipelineName:m}):e.jsx(p,{})})]})})]})}function B(){return e.jsx(c,{Component:H})}function H({deployment:l}){var s;const[r,n]=y.useState(!0),a=(s=l.body)==null?void 0:s.url;return e.jsxs(b,{open:r,onOpenChange:n,children:[e.jsx(C,{className:"flex items-center gap-[10px]",children:e.jsxs(N,{className:"flex w-full gap-2",children:[e.jsx(P,{open:r}),"Endpoint"]})}),e.jsx(D,{className:"border-t border-theme-border-moderate bg-theme-surface-primary px-5 py-3",children:e.jsx("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 md:grid-cols-3 md:gap-y-4",children:e.jsx(i,{label:"Endpoint",value:a?e.jsxs("div",{className:"group/copybutton flex items-center gap-0.5",children:[e.jsx("a",{className:"link",href:a,target:"_blank",rel:"noopener noreferrer",children:a}),e.jsx(v,{copyText:a})]}):e.jsx(p,{})})})})]})}function $(){return e.jsxs("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-2",children:[e.jsxs("div",{className:"space-y-5",children:[e.jsx(B,{}),e.jsx(q,{})]}),e.jsx("div",{children:e.jsx(V,{})})]})}export{$ as default};
