1import{af as e,ao as H,r as I,bD as L,bE as D,bF as W,bG as A,aX as _}from"./vendor-B2oIjyY4.js";import{R as B,sH as $,a$ as S,h as k,fr as F,B as m,g as y,C as N,I as R,T as O,am as U,a as M,f as b,gW as P,dH as Q,aI as z,k as G}from"./main-CJK8sxkW.js";import{s as V}from"./sync-ChxifjL-.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";const v="minmax(300px, 1fr) 180px 180px 180px 180px",se=()=>{const{data:n,isLoading:r}=$(void 0,{select:J,suspense:!0}),a=n??{},t=Object.keys(a).length>0;return!r&&!t?e.jsxs(S,{children:[e.jsx(k,{mb:4,children:"Sync status by destination"}),e.jsx(F,{variant:"minimal",title:"No active syncs",message:"A sync defines how and when your data will be sent to a destination. This table only shows syncs that are enabled.",imageUrl:V,mb:6})]}):e.jsxs(S,{overflow:"hidden",children:[e.jsx(k,{mb:4,children:"Sync status by destination"}),e.jsxs(m,{display:"grid",gridTemplateColumns:v,children:[e.jsx(d,{height:"48px",children:e.jsx(y,{children:"Destination"})}),e.jsx(d,{justifyContent:"center",height:"48px",children:e.jsx(y,{children:"Healthy"})}),e.jsx(d,{justifyContent:"center",height:"48px",children:e.jsx(y,{children:"Warning"})}),e.jsx(d,{justifyContent:"center",height:"48px",children:e.jsx(y,{children:"Failing"})}),e.jsx(d,{justifyContent:"center",height:"48px",children:e.jsx(y,{children:"Inactive"})})]}),e.jsx(N,{overflow:"auto",children:t?Object.entries(a).map(([,c],o)=>e.jsx(X,{resourceItems:c},o)):H.times(10,c=>e.jsx(q,{},c))})]})},x=({count:n,variant:r,url:a})=>{const[t,c]=I.useState(!1),{bgColor:o,hoverBgColor:u,textColor:l}=K(r,!n),h=Q(n),p=a&&n>0,f=`${a}&status=${r}`;return e.jsx(d,{as:p?z:"div",...p?{to:f}:{},bg:o,pos:"relative",justifyContent:"center",alignItems:"center",fontWeight:"medium",color:l,_groupHover:{bg:u},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:t&&p?e.jsxs(m,{children:["View syncs ",e.jsx(G,{})]}):h})},T=({resource:n,resourceId:r,nested:a=!1})=>{const t=`/syncs?destination=${r}`;return e.jsxs(m,{position:"relative",display:"grid",gridTemplateColumns:v,className:"group",children:[e.jsxs(d,{pl:a?12:void 0,gap:2,alignItems:"center",_groupHover:{bg:"base.background"},children:[e.jsx(R,{src:n.icon,name:n.name}),e.jsx(P,{href:t,fontWeight:"medium",color:"inherit",children:n.name})]}),e.jsx(x,{count:n.succeeded,variant:"success",url:t}),e.jsx(x,{count:n.warning,variant:"warning",url:t}),e.jsx(x,{count:n.failed,variant:"failed",url:t}),e.jsx(x,{count:n.inactive,variant:"inactive",url:t})]})},X=({resourceItems:n})=>{var C;const[r,a]=I.useState(!1),[t,c]=I.useState(!1),o=Object.entries(n);if(o.length===1){const[s,i]=o[0]||[null,null];return i?e.jsx(T,{resource:i,resourceId:s}):null}const l=`/syncs?destination=${Object.keys(n).join(",")}`,h=(C=o[0])==null?void 0:C[1],p=o.reduce((s,[,i])=>s+i.succeeded,0),f=o.reduce((s,[,i])=>s+i.warning,0),w=o.reduce((s,[,i])=>s+i.failed,0),j=o.reduce((s,[,i])=>s+i.inactive,0);return e.jsx(L,{allowToggle:!0,index:t?[0]:[],onChange:s=>c(s===0),children:e.jsxs(D,{border:"none",children:[e.jsxs(m,{display:"grid",gridTemplateColumns:v,className:"group",children:[e.jsx(d,{cursor:"pointer",alignItems:"center",gap:2,_groupHover:{bg:"base.background"},onClick:()=>c(!t),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:h&&e.jsxs(e.Fragment,{children:[e.jsx(R,{name:h.name,src:h.icon}),e.jsx(O,{fontWeight:"medium",isTruncated:!0,children:h.friendlyType}),e.jsx(U,{children:o.length}),e.jsx(W,{"aria-label":`${t?"Collapse":"Expand"} syncs`,outline:"none !important",p:1,borderRadius:"sm",width:"fit-content",onClick:s=>s.stopPropagation(),children:e.jsx(m,{as:M,opacity:r||t?1:0,fontSize:"18px",transform:t?"rotate(90deg)":"",transitionProperty:"transform, opacity",transitionDuration:"fast",transitionTimingFunction:"easeOutQuad"})})]})}),e.jsx(x,{count:p,variant:"success",url:l}),e.jsx(x,{count:f,variant:"warning",url:l}),e.jsx(x,{count:w,variant:"failed",url:l}),e.jsx(x,{count:j,variant:"inactive",url:l})]}),e.jsx(A,{p:0,children:o.map(([s,i])=>e.jsx(T,{nested:!0,resource:i,resourceId:s},s))})]})})},q=()=>e.jsxs(m,{display:"grid",gridTemplateColumns:v,children:[e.jsx(d,{children:e.jsxs(B,{alignItems:"center",gap:2,children:[e.jsx(b,{borderRadius:"full",width:"24px",height:"24px"}),e.jsx(b,{width:"200px",height:"16px",borderRadius:"sm"})]})}),e.jsx(d,{justifyContent:"center",alignItems:"center",children:e.jsx(b,{width:"50px",height:"16px",borderRadius:"sm"})}),e.jsx(d,{justifyContent:"center",alignItems:"center",children:e.jsx(b,{width:"50px",height:"16px",borderRadius:"sm"})}),e.jsx(d,{justifyContent:"center",alignItems:"center",children:e.jsx(b,{width:"50px",height:"16px",borderRadius:"sm"})})]}),J=n=>{var a,t,c,o;if(!((a=n==null?void 0:n.destinations)!=null&&a.length))return{};const r={};for(const u of n.destinations){const l=u.type,h=u.id,p=u.name||"Unknown",f=((t=u.definition)==null?void 0:t.icon)||"",w=((c=u.definition)==null?void 0:c.name)||l;if(!((o=u.syncs)!=null&&o.length))continue;r[l]||(r[l]={});const j=u.syncs.filter(g=>!g.schedule_paused&&g.last_run_at),C=u.syncs.length-j.length,s=j.filter(g=>g.status==="success").length,i=j.filter(g=>g.status==="warning").length,E=j.filter(g=>g.status==="failed").length;r[l][h]={name:p,type:l,friendlyType:w,icon:f,succeeded:s,warning:i,failed:E,inactive:C}}return r},d=({children:n,...r})=>e.jsx(B,{px:6,height:"64px",alignItems:"center",borderBottomWidth:"hairline",borderBottomStyle:"solid",borderColor:"base.border",flexShrink:0,...r,children:n}),K=(n,r)=>
1{if(r)return{bgColor:"base.lightBackground",hoverBgColor:"base.background",textColor:"text.tertiary"};switch(n){case"warning":return{bgColor:"warning.background",hoverBgColor:"warning.100",textColor:"warning.text"};case"failed":return{bgColor:"danger.background",hoverBgColor:"danger.100",textColor:"danger.text"};case"success":return{bgColor:"green.background",hoverBgColor:"green.100",textColor:"green.text"};case"inactive":return{bgColor:"base.lightBackground",hoverBgColor:"base.background",textColor:"text.tertiary"};default:throw new _.UnreachableCaseError(n)}};export{d as Cell,se as SyncHealthTableLegacy}; 2//# sourceMappingURL=sync-health-table-legacy-zpurhey2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.