import{c as t,L as V,i as e,F as C,b as w,d as f,k as y,p as P,j as X,g as M,M as Z,ae as G,P as J,ap as K,aq as Q,t as A,D as U,e as Y}from"./vendor-5507c805.js";import{c as ee,g as te,a as le,e as re,f as j,r as se}from"./index-83f95c10.js";import{u as W,y as ne,T as ae,z as oe,L as g,A as ie,E as ce,F as N,G as O,H as B,M as de,c as ge,B as ue,x as he}from"./index-bd53d7c8.js";import{C as I}from"./ConfigTitle-dd5fc83b.js";const fe=f('<div class="flex flex-col gap-4"><div><select class="select select-bordered w-full"></select></div><div><select class="select select-bordered w-full"></select></div><div><select class="select select-bordered w-full">'),k=f("<option>"),me=o=>{const[s]=W();return t(de,{ref:c=>{var i;return(i=o.ref)==null?void 0:i.call(o,c)},get icon(){return t(V,{size:24})},get title(){return s("logsSettings")},get children(){const c=fe(),i=c.firstChild,d=i.firstChild,b=i.nextSibling,_=b.firstChild,p=b.nextSibling,$=p.firstChild;return e(i,t(I,{withDivider:!0,get children(){return s("tableSize")}}),d),d.addEventListener("change",l=>ne(l.target.value)),e(d,t(C,{get each(){return Object.values(ae)},children:l=>(()=>{const n=k();return n.value=l,e(n,()=>s(l)),n})()})),e(b,t(I,{withDivider:!0,get children(){return s("logLevel")}}),_),_.addEventListener("change",l=>oe(l.target.value)),e(_,t(C,{get each(){return[g.Info,g.Error,g.Warning,g.Debug,g.Silent]},children:l=>(()=>{const n=k();return n.value=l,e(n,()=>s(l)),n})()})),e(p,t(I,{withDivider:!0,get children(){return s("logMaxRows")}}),$),$.addEventListener("change",l=>ie(parseInt(l.target.value))),e($,t(C,{each:ce,children:l=>(()=>{const n=k();return n.value=l,e(n,l),n})()})),w(()=>d.value=N()),w(()=>_.value=O()),w(()=>$.value=B()),c}})},ve=f("<span>"),_e=f('<div class="flex h-full flex-col gap-2"><div class="join w-full"><input type=search class="input join-item input-primary input-sm flex-1 flex-shrink-0 sm:input-md"></div><div class="overflow-x-auto whitespace-nowrap rounded-md bg-base-300"><table><thead class="sticky top-0 z-10"></thead><tbody>'),$e=f("<tr>"),be=f('<th class=bg-base-200><div class="flex items-center"><div>'),pe=f('<tr class="hover:!bg-primary hover:text-primary-content">'),Se=f("<td class=py-2>"),q=(o,s,c,i)=>{const d=se(o.getValue(s),c);return i({itemRank:d}),d.passed},Fe=()=>{let o;const[s]=W();let c=1;const[i,d]=y([]),b=ge("logs",{level:O()});P(()=>{const r=b();r&&(d(m=>[{...r,seq:c},...m].slice(0,B())),c++)});const[_,p]=y(""),[$,l]=X(y([]),{name:"logsTableSorting",storage:localStorage}),n=[{header:s("sequence"),accessorFn:r=>r.seq},{header:s("type"),accessorFn:r=>r.type,cell:({row:r})=>{const m=r.original.type;let u="";switch(m){case g.Error:u="text-error";break;case g.Warning:u="text-warning";break;case g.Info:u="text-info";break;case g.Debug:u="text-success";break}return(()=>{const S=ve();return M(S,u),e(S,()=>`[${r.original.type}]`),S})()}},{header:s("payload"),accessorFn:r=>r.payload}],E=ee({filterFns:{fuzzy:q},state:{get globalFilter(){return _()},get sorting(){return $()}},get data(){return i()},sortDescFirst:!0,columns:n,onGlobalFilterChange:p,onSortingChange:l,globalFilterFn:q,getFilteredRowModel:te(),getSortedRowModel:le(),getCoreRowModel:re()});return(()=>{const r=_e(),m=r.firstChild,u=m.firstChild,S=m.nextSibling,R=S.firstChild,D=R.firstChild,H=D.nextSibling;return u.$$input=a=>p(a.target.value),e(m,t(ue,{class:"join-item btn-sm sm:btn-md",onClick:()=>o==null?void 0:o.showModal(),get icon(){return t(Z,{})}}),null),e(D,t(G,{get each(){return E.getHeaderGroups()},children:a=>{const v=a();return(()=>{const h=$e();return e(h,t(G,{get each(){return v.headers},children:L=>{const x=L();return(()=>{const z=be(),T=z.firstChild,F=T.firstChild;return J(F,"click",x.column.getToggleSortingHandler(),!0),e(F,()=>j(x.column.columnDef.header,x.getContext())),e(T,()=>({asc:t(K,{}),desc:t(Q,{})})[x.column.getIsSorted()]??null,null),w(()=>M(F,A(x.column.getCanSort()&&"cursor-pointer select-none","flex-1"))),z})()}})),h})()}})),e(H,t(C,{get each(){return E.getRowModel().rows},children:a=>(()=>{const v=pe();return e(v,t(C,{get each(){return a.getVisibleCells()},children:h=>(()=>{const L=Se();return e(L,()=>j(h.column.columnDef.cell,h.getContext())),L})()})),v})()})),e(r,t(me,{ref:a=>o=a}),null),w(a=>{const v=s("search"),h=A(he(N()),"table relative rounded-none");return v!==a._v$&&U(u,"placeholder",a._v$=v),h!==a._v$2&&M(R,a._v$2=h),a},{_v$:void 0,_v$2:void 0}),r})()};Y(["input","click"]);export{Fe as default};
