module.exports=[22496,a=>{"use strict";let b=(0,a.i(64588).default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);a.s(["ScrollText",0,b],22496)},6268,a=>{"use strict";var b=a.i(57096),c=a.i(84668),d=a.i(22496),e=a.i(25273),f=a.i(58499);function g(a,b,c){c&&a.push({text:c,...b})}let h={0:"text-zinc-600",1:"text-red-400",2:"text-emerald-400",3:"text-yellow-300",4:"text-blue-400",5:"text-fuchsia-400",6:"text-cyan-300",7:"text-zinc-100",b0:"text-zinc-500",b1:"text-red-300",b2:"text-emerald-300",b3:"text-yellow-200",b4:"text-blue-300",b5:"text-fuchsia-300",b6:"text-cyan-200",b7:"text-white"};function i({line:a}){let d=(0,c.useMemo)(()=>(function(a){let b=[],c={},d=0;for(;d<a.length;){let e=a.indexOf("\x1b[",d);if(-1===e){g(b,c,a.slice(d));break}e>d&&g(b,c,a.slice(d,e));let f=a.indexOf("m",e+2);if(-1===f){g(b,c,a.slice(e));break}(function(a,b){let c=0;for(;c<b.length;){let d=b[c];switch(d){case 0:a.bold=void 0,a.dim=void 0,a.italic=void 0,a.underline=void 0,a.fg=void 0,a.bg=void 0;break;case 1:a.bold=!0;break;case 2:a.dim=!0;break;case 3:a.italic=!0;break;case 4:a.underline=!0;break;case 22:a.bold=void 0,a.dim=void 0;break;case 23:a.italic=void 0;break;case 24:a.underline=void 0;break;case 38:case 48:5===b[c+1]?c+=2:2===b[c+1]&&(c+=4);break;case 39:a.fg=void 0;break;case 49:a.bg=void 0;break;default:d>=30&&d<=37?a.fg=String(d-30):d>=90&&d<=97?a.fg=`b${d-90}`:d>=40&&d<=47?a.bg=String(d-40):d>=100&&d<=107&&(a.bg=`b${d-100}`)}c++}})(c,a.slice(e+2,f).split(";").map(a=>""===a?0:Number(a)).filter(a=>Number.isFinite(a))),d=f+1}return b})(a.line),[a.line]),e="meta"===a.stream?"text-zinc-500 italic":"err"===a.stream?"text-red-300":"";return(0,b.jsx)("div",{className:`whitespace-pre-wrap ${e}`,children:d.map((a,c)=>{let d,e=(d=[],a.bold&&d.push("font-bold"),a.dim&&d.push("opacity-60"),a.italic&&d.push("italic"),a.underline&&d.push("underline"),a.fg&&d.push(h[a.fg]),d.join(" "));return e?(0,b.jsx)("span",{className:e,children:a.text},c):(0,b.jsx)("span",{children:a.text},c)})})}a.s(["LogStream",0,function({clusterId:a,tail:g=200}){let[h,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(!0),[m,n]=(0,c.useState)(!1),o=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let b=new AbortController,c=!1;return(async()=>{j([]),n(!1);try{let d=await e.rpc.logs.stream({clusterId:a,tail:g},{signal:b.signal});for await(let a of(n(!0),d)){if(c)break;j(b=>{let c=[...b,a];return c.length>5e3?c.slice(-5e3):c})}}catch(a){c||a instanceof DOMException&&"AbortError"===a.name||console.error("[logs.stream]",a)}finally{c||n(!1)}})(),()=>{c=!0,b.abort()}},[a,g]),(0,c.useEffect)(()=>{k&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[h,k]),(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(d.ScrollText,{size:16,className:"text-zinc-500"}),(0,b.jsx)("span",{className:"font-mono text-xs",children:a}),(0,b.jsx)("span",{className:"ml-2 rounded-full px-2 py-0.5 text-xs "+(m?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300":"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"),children:m?"streaming":"disconnected"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-300",children:[(0,b.jsx)(f.Switch,{checked:k,onCheckedChange:l}),"Auto-follow"]})]}),(0,b.jsx)("div",{ref:o,className:"h-[70vh] overflow-auto rounded-md border border-zinc-200 bg-black p-3 font-mono text-xs leading-relaxed text-zinc-100 dark:border-zinc-800",children:0===h.length?(0,b.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output…"}):h.map((a,c)=>(0,b.jsx)(i,{line:a},c))})]})}],6268)}];

//# sourceMappingURL=_0hu5_m7._.js.map