import{Fv as e,Hy as t,lh as n}from"./index-DDwwBb9e.js";var{withProvider:r,withContext:i,useStyles:a,PropsProvider:o}=e({key:`status`}),s=r(`div`,`root`),c=i(`div`,`indicator`);function l(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:e>=100?e.toFixed(0):e>=10?e.toFixed(1):e.toFixed(2)}function u(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString()}function d(e){return e>=1024**3?`${(e/1024**3).toFixed(2)}GB`:e>=1024**2?`${(e/1024**2).toFixed(2)}MB`:e>=1024?`${(e/1024).toFixed(2)}KB`:`${e}B`}function f(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e.toFixed(0)}ms`}function p(e,t){let n=(t?new Date(t).getTime():Date.now())-new Date(e).getTime();if(n<0)return`—`;if(n<1e3)return`${n}ms`;let r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;let i=Math.floor(r/60),a=Math.round(r%60);return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m ${a}s`}function m(e){if(e===null)return`—`;let t=Date.now()-e,n=Math.floor(Math.abs(t)/1e3),r=t<0,i=r?`in `:``,a=r?``:` ago`;if(n<60)return`${i}${n}s${a}`;let o=Math.floor(n/60);if(o<60)return`${i}${o}m${a}`;let s=Math.floor(o/60);return s<24?`${i}${s}h${a}`:`${i}${Math.floor(s/24)}d${a}`}function h({refetchInterval:e=2e3}={}){return n.ops.getReplayStatus.useQuery(void 0,{refetchInterval:e})}t();function g(e){switch(e){case`completed`:return`green`;case`failed`:return`red`;case`cancelled`:return`orange`;case`running`:return`blue`;default:return`gray`}}export{p as a,m as c,u as i,c as l,h as n,f as o,d as r,l as s,g as t,s as u};
//# sourceMappingURL=ReplayStateBadge-UndJza1A.js.map