@lunora/studio 1.0.0-alpha.310 → 1.0.0-alpha.312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/{chunk-NXGPDLDU.js → chunk-2BXYYWFF.js} +1 -1
- package/dist/standalone/{chunk-KB4LDWU5.js → chunk-2KCU3R63.js} +1 -1
- package/dist/standalone/{chunk-F7GN7PFX.js → chunk-2MLBXX35.js} +1 -1
- package/dist/standalone/{chunk-2SJZZH4H.js → chunk-3MUG4ZHJ.js} +1 -1
- package/dist/standalone/{chunk-M2ZMWQFY.js → chunk-43KOF4CQ.js} +1 -1
- package/dist/standalone/{chunk-JH36CKFQ.js → chunk-465XOUP7.js} +1 -1
- package/dist/standalone/{chunk-3QX3JY3V.js → chunk-4OSK5JED.js} +1 -1
- package/dist/standalone/{chunk-YPWBHX2E.js → chunk-4SONVRCI.js} +1 -1
- package/dist/standalone/{chunk-XOFQMNBS.js → chunk-4VXO6PEW.js} +1 -1
- package/dist/standalone/{chunk-AD2DJJC3.js → chunk-53NRDRMS.js} +1 -1
- package/dist/standalone/{chunk-JRGRIQ7P.js → chunk-5QLHJ63L.js} +1 -1
- package/dist/standalone/{chunk-AV7OEKJ6.js → chunk-6L2GY26N.js} +2 -2
- package/dist/standalone/{chunk-H3BZ3JO6.js → chunk-72K3I5WQ.js} +1 -1
- package/dist/standalone/{chunk-RHRUDVZJ.js → chunk-7QW4APH4.js} +1 -1
- package/dist/standalone/{chunk-6RUR4ENY.js → chunk-B56FJPX3.js} +1 -1
- package/dist/standalone/{chunk-3PZCWECC.js → chunk-BTU2DO4W.js} +1 -1
- package/dist/standalone/{chunk-PJSLU6LL.js → chunk-CSPLK3YB.js} +1 -1
- package/dist/standalone/{chunk-GHZ2JWYN.js → chunk-CSX53SBE.js} +1 -1
- package/dist/standalone/{chunk-XL2AUAZA.js → chunk-D5V2I2AG.js} +1 -1
- package/dist/standalone/{chunk-WOBRELSS.js → chunk-DPTYTQR4.js} +1 -1
- package/dist/standalone/{chunk-IEDJDJCP.js → chunk-EHIBZBUU.js} +1 -1
- package/dist/standalone/{chunk-MOC6MEKG.js → chunk-EOLEL3WN.js} +1 -1
- package/dist/standalone/{chunk-K72WUXVL.js → chunk-FECB2R4V.js} +1 -1
- package/dist/standalone/{chunk-QBE5USC3.js → chunk-G7SKQQMQ.js} +1 -1
- package/dist/standalone/{chunk-GD2NG5PX.js → chunk-GI2ASB4F.js} +1 -1
- package/dist/standalone/{chunk-K6564T6V.js → chunk-GP4Y7JTA.js} +1 -1
- package/dist/standalone/{chunk-3GWYCFNE.js → chunk-GUICDCZY.js} +1 -1
- package/dist/standalone/{chunk-5LZ7ITPY.js → chunk-GVHNP2GX.js} +1 -1
- package/dist/standalone/{chunk-7DQRMMWU.js → chunk-IKA6U6M6.js} +1 -1
- package/dist/standalone/{chunk-QEMJIJCD.js → chunk-IKF6SZS6.js} +1 -1
- package/dist/standalone/{chunk-BSHTZR6K.js → chunk-IKMM2GHN.js} +1 -1
- package/dist/standalone/{chunk-MWIKSOHW.js → chunk-IOKJXFIU.js} +1 -1
- package/dist/standalone/{chunk-225UTWUC.js → chunk-IQHFRVZM.js} +1 -1
- package/dist/standalone/{chunk-D4ZXRW2I.js → chunk-JPDDVVP6.js} +1 -1
- package/dist/standalone/{chunk-BV2EBCUX.js → chunk-LILVP4NU.js} +1 -1
- package/dist/standalone/{chunk-2R4BRJGM.js → chunk-MAGV5WWM.js} +1 -1
- package/dist/standalone/{chunk-AVACONK5.js → chunk-MHJKGEKR.js} +1 -1
- package/dist/standalone/{chunk-IFEMFSLN.js → chunk-MZU5M2TO.js} +1 -1
- package/dist/standalone/{chunk-FUGLFWLW.js → chunk-NNSCCLU4.js} +1 -1
- package/dist/standalone/{chunk-7474UICL.js → chunk-OHMGKCDA.js} +1 -1
- package/dist/standalone/{chunk-YVNIQ7OG.js → chunk-PXBXNIM2.js} +1 -1
- package/dist/standalone/{chunk-IY6US3YF.js → chunk-QXRMBK26.js} +1 -1
- package/dist/standalone/{chunk-AD7GTQBR.js → chunk-R2TAO7Q4.js} +1 -1
- package/dist/standalone/{chunk-7RPU77RS.js → chunk-SMIU5HX6.js} +1 -1
- package/dist/standalone/{chunk-MVS7RWFI.js → chunk-TGZBBSZG.js} +1 -1
- package/dist/standalone/{chunk-76BXZLNG.js → chunk-U6QBSDND.js} +1 -1
- package/dist/standalone/{chunk-HXBFXMPI.js → chunk-VABBWB42.js} +1 -1
- package/dist/standalone/{chunk-M2FQTDR4.js → chunk-W36YKEUZ.js} +1 -1
- package/dist/standalone/{chunk-L254SW7Y.js → chunk-WCAUFFIX.js} +1 -1
- package/dist/standalone/{chunk-ZQPAHCMA.js → chunk-WK5TYZAF.js} +1 -1
- package/dist/standalone/{chunk-TPHEVTCW.js → chunk-WQMS7276.js} +1 -1
- package/dist/standalone/{chunk-2D5PY4GN.js → chunk-WV4V42RT.js} +1 -1
- package/dist/standalone/{chunk-VS4MTIRN.js → chunk-XDC2SWYS.js} +1 -1
- package/dist/standalone/{chunk-SFDYCSQW.js → chunk-XYBZYLQL.js} +1 -1
- package/dist/standalone/{chunk-4IGNK2QW.js → chunk-Y4CGNYC5.js} +1 -1
- package/dist/standalone/{chunk-QPTUTBNA.js → chunk-YC5NRN4O.js} +1 -1
- package/dist/standalone/{chunk-V24V4CZ4.js → chunk-Z4XHXX73.js} +1 -1
- package/dist/standalone/{chunk-SZCVCB4X.js → chunk-ZHLX75F6.js} +1 -1
- package/dist/standalone/{chunk-ZYKSTQC7.js → chunk-ZLVANF7H.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Pe,b as Re}from"./chunk-2VA5S3IA.js";import{a as ce}from"./chunk-VCFEO3RI.js";import{a as Te}from"./chunk-6QTAHSDD.js";import"./chunk-VESGIGMQ.js";import{a as Se}from"./chunk-S4Z7K55A.js";import{b as ke}from"./chunk-5B2RTXBS.js";import{a as de}from"./chunk-UYEZR3BI.js";import{a as Le}from"./chunk-SV764LKQ.js";import{a as ie}from"./chunk-IWZ7GVQO.js";import{a as xe}from"./chunk-R6U22RSY.js";import{a as be}from"./chunk-YVR4SEPU.js";import{b as ve}from"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import"./chunk-OQ6I6OXT.js";import{i as D}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import{a as pe}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as re}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as ye}from"./chunk-AD2DJJC3.js";import"./chunk-NCPW7WHO.js";import"./chunk-ZQPAHCMA.js";import"./chunk-55UGUCQ6.js";import{a as ne}from"./chunk-4ZEL6BYL.js";import{c as oe}from"./chunk-M2FQTDR4.js";import{l as ge}from"./chunk-AV7OEKJ6.js";import"./chunk-QAQDMS6R.js";import"./chunk-VGL7ERWQ.js";import{a as J}from"./chunk-RWVIV3U7.js";import{a as we,b as Ne,c as Ce,d as se,e as B,f as W}from"./chunk-HCTJKP5J.js";import{d as z,h as ae,i as fe,p as le}from"./chunk-HJHSQPHW.js";import{a as v,d as te,e as _e,f as Ae,g as Ue,i as j}from"./chunk-I26MS5PJ.js";var K=te(Ae(),1);var I=te(_e(),1);var r=te(Ue(),1);var me=["trace","debug","log","info","warn","error","fatal"],$e="LOG_ARCHIVE_NOT_CONFIGURED",ze={cursor:void 0,error:null,loading:!1,notConfigured:!1,rows:null},De=v((i,e)=>{switch(e.type){case"append":return{...i,cursor:e.cursor,error:null,loading:!1,rows:[...i.rows??[],...e.rows]};case"failed":return{cursor:void 0,error:e.message,loading:!1,notConfigured:!1,rows:null};case"loaded":return{cursor:e.cursor,error:null,loading:!1,notConfigured:!1,rows:e.rows};case"loading":return{...i,error:null,loading:!0,notConfigured:!1};case"notConfigured":return{cursor:void 0,error:null,loading:!1,notConfigured:!0,rows:null};case"pageFailed":return{...i,error:e.message,loading:!1};default:return i}},"De"),Be=v(i=>{let e=(0,K.c)(33),{row:t}=i,n;e[0]!==t.fields?(n=ce(t.fields),e[0]=t.fields,e[1]=n):n=e[1];let s=n,o=`lg-archive-row-${String(t.ts)}`,c;e[2]!==t.ts?(c=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=c):c=e[3];let f;e[4]!==c?(f=(0,r.jsx)(W,{className:"tabular-nums whitespace-nowrap text-xs text-muted-foreground",children:c}),e[4]=c,e[5]=f):f=e[5];let m=Pe[t.level],d;e[6]!==t.level||e[7]!==m?(d=(0,r.jsx)(W,{children:(0,r.jsx)(re,{variant:m,children:t.level})}),e[6]=t.level,e[7]=m,e[8]=d):d=e[8];let a;e[9]!==t.functionPath?(a=(0,r.jsx)(W,{className:"font-mono text-xs",children:t.functionPath}),e[9]=t.functionPath,e[10]=a):a=e[10];let h;e[11]!==t.message?(h=(0,r.jsx)("div",{className:"truncate",title:t.message,children:t.message}),e[11]=t.message,e[12]=h):h=e[12];let l;e[13]!==s?(l=s!==""&&(0,r.jsx)("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:s,children:s}),e[13]=s,e[14]=l):l=e[14];let u;e[15]!==h||e[16]!==l?(u=(0,r.jsxs)(W,{className:"max-w-md",children:[h,l]}),e[15]=h,e[16]=l,e[17]=u):u=e[17];let g=t.traceId??"\u2014",b;e[18]!==g?(b=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:g}),e[18]=g,e[19]=b):b=e[19];let x=t.shardKey??"\u2014",w;e[20]!==x?(w=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:x}),e[20]=x,e[21]=w):w=e[21];let N=t.userId??"\u2014",y;e[22]!==N?(y=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:N}),e[22]=N,e[23]=y):y=e[23];let T;return e[24]!==u||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==o||e[29]!==f||e[30]!==d||e[31]!==a?(T=(0,r.jsxs)(se,{"data-testid":o,children:[f,d,a,u,b,w,y]}),e[24]=u,e[25]=b,e[26]=w,e[27]=y,e[28]=o,e[29]=f,e[30]=d,e[31]=a,e[32]=T):T=e[32],T},"Qe"),We=v(({shardKey:i})=>{let e=ge(),t=z(),[n,s]=(0,I.useState)(""),[o,c]=(0,I.useState)(""),[f,m]=(0,I.useState)(""),[{cursor:d,error:a,loading:h,notConfigured:l,rows:u},g]=(0,I.useReducer)(De,ze),b=ie(n.trim(),400),x=ie(o.trim(),400),w={...b===""?{}:{functionPathPrefix:b},...f===""?{}:{minLevel:f},...i===""?{}:{shardKey:i},...x===""?{}:{userId:x}},N=JSON.stringify(w),y=(0,I.useRef)(N);(0,I.useEffect)(()=>{let p={cancelled:!1};return y.current=N,le((async()=>{g({type:"loading"});try{let C=await e.queryLogArchive(w);p.cancelled||g({cursor:C.nextCursor,rows:C.rows,type:"loaded"})}catch(C){p.cancelled||g(fe(C)===$e?{type:"notConfigured"}:{message:ae(C),type:"failed"})}})()),()=>{p.cancelled=!0}},[e,N]);let T=v(async()=>{if(d===void 0)return;let p=N;g({type:"loading"});try{let C=await e.queryLogArchive({...w,cursor:d});y.current===p&&g({cursor:C.nextCursor,rows:C.rows,type:"append"})}catch(C){y.current===p&&g({message:ae(C),type:"pageFailed"})}},"T"),R=v(p=>{s(p.target.value)},"R"),k=v(p=>{c(p.target.value)},"N"),L=v(p=>{m(p.target.value)},"L"),S=v(()=>{le(T())},"S");return l?(0,r.jsx)(J,{action:(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline",href:de,rel:"noreferrer",target:"_blank",children:t("Open in Cloudflare")}),description:t("Wire pipelineLogSink to a Cloudflare Pipeline \u2192 R2 Data Catalog table and set R2_SQL_ACCOUNT_ID, R2_SQL_TOKEN, R2_SQL_BUCKET to browse the durable log archive here."),testId:"lg-archive-not-configured",title:t("Log archive not configured")}):(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lg-archive",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(D,{"aria-label":t("Function path prefix"),className:"h-8 w-48","data-testid":"lg-archive-path",onChange:R,placeholder:t("function path\u2026"),value:n}),(0,r.jsx)(D,{"aria-label":t("User id"),className:"h-8 w-40","data-testid":"lg-archive-user",onChange:k,placeholder:t("user id\u2026"),value:o}),(0,r.jsxs)("select",{"aria-label":t("Minimum level"),className:"h-8 rounded-md border border-border bg-background px-2 text-sm","data-testid":"lg-archive-min-level",onChange:L,value:f,children:[(0,r.jsx)("option",{value:"",children:t("min level")}),me.map(p=>(0,r.jsx)("option",{value:p,children:p},p))]})]}),a!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"lg-archive-error",role:"alert",children:a}),h&&u===null&&a===null&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"lg-archive-loading",children:t("Loading\u2026")}),u!==null&&u.length===0&&(0,r.jsx)(J,{description:t("No archived logs match these filters. The durable archive fills as pipelineLogSink flushes records to R2."),testId:"lg-archive-empty",title:t("No archived logs.")}),u!==null&&u.length>0&&(0,r.jsx)("div",{className:"overflow-hidden rounded-xl border border-border shadow-xs",children:(0,r.jsxs)(we,{"data-testid":"lg-archive-table",children:[(0,r.jsx)(Ne,{children:(0,r.jsxs)(se,{children:[(0,r.jsx)(B,{children:t("Time")}),(0,r.jsx)(B,{children:t("Level")}),(0,r.jsx)(B,{children:t("Function")}),(0,r.jsx)(B,{children:t("Message")}),(0,r.jsx)(B,{children:t("Trace")}),(0,r.jsx)(B,{children:t("Shard")}),(0,r.jsx)(B,{children:t("User")})]})}),(0,r.jsx)(Ce,{children:u.map((p,C)=>(0,r.jsx)(Be,{row:p},`${String(p.ts)}-${String(C)}`))})]})}),d!==void 0&&(0,r.jsx)("div",{children:(0,r.jsx)(pe,{"data-testid":"lg-archive-more",disabled:h,onClick:S,size:"sm",variant:"outline",children:t(h?"Loading\u2026":"Load more")})})]})},"ze"),je=v(i=>{let e=(0,K.c)(11),{level:t,onToggle:n,selected:s}=i,o;e[0]!==t||e[1]!==n?(o=v(()=>{n(t)},"o"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let c=o,f=s?"border-border bg-muted font-medium":"border-input text-muted-foreground",m;e[3]!==f?(m=j("rounded-md border px-2 py-1 text-xs",f),e[3]=f,e[4]=m):m=e[4];let d=`logs-level-${t}`,a;return e[5]!==t||e[6]!==c||e[7]!==s||e[8]!==m||e[9]!==d?(a=(0,r.jsx)("button",{"aria-pressed":s,className:m,"data-testid":d,onClick:c,type:"button",children:t}),e[5]=t,e[6]=c,e[7]=s,e[8]=m,e[9]=d,e[10]=a):a=e[10],a},"Ge"),Ve=v(i=>{let e=(0,K.c)(68),{levelFilter:t,onLogPathChange:n,onSearchChange:s,onTimeRangeChange:o,onToggleLevel:c,onToggleSummary:f,pathFilter:m,search:d,showSummary:a,timeRange:h}=i,l=z(),u;e[0]!==l?(u=l("Search messages"),e[0]=l,e[1]=u):u=e[1];let g;e[2]!==l?(g=l("search message"),e[2]=l,e[3]=g):g=e[3];let b;e[4]!==s||e[5]!==d||e[6]!==u||e[7]!==g?(b=(0,r.jsx)(D,{"aria-label":u,className:"h-8 w-48","data-testid":"lg-search",onChange:s,placeholder:g,value:d}),e[4]=s,e[5]=d,e[6]=u,e[7]=g,e[8]=b):b=e[8];let x;e[9]!==l?(x=l("Function path"),e[9]=l,e[10]=x):x=e[10];let w;e[11]!==l?(w=l("filter path"),e[11]=l,e[12]=w):w=e[12];let N;e[13]!==n||e[14]!==m||e[15]!==x||e[16]!==w?(N=(0,r.jsx)(D,{"aria-label":x,className:"h-8 w-40","data-testid":"logs-path-filter",onChange:n,placeholder:w,value:m}),e[13]=n,e[14]=m,e[15]=x,e[16]=w,e[17]=N):N=e[17];let y;e[18]!==l?(y=l("Level filter"),e[18]=l,e[19]=y):y=e[19];let T;e[20]!==t||e[21]!==c?(T=me.map(Q=>(0,r.jsx)(je,{level:Q,onToggle:c,selected:t.has(Q)},Q)),e[20]=t,e[21]=c,e[22]=T):T=e[22];let R;e[23]!==y||e[24]!==T?(R=(0,r.jsx)("div",{"aria-label":y,className:"inline-flex items-center gap-1","data-testid":"logs-level-filter",role:"group",children:T}),e[23]=y,e[24]=T,e[25]=R):R=e[25];let k;e[26]!==l?(k=l("Time range"),e[26]=l,e[27]=k):k=e[27];let L;e[28]!==l?(L=l("All time"),e[28]=l,e[29]=L):L=e[29];let S;e[30]!==L?(S=(0,r.jsx)("option",{value:"all",children:L}),e[30]=L,e[31]=S):S=e[31];let p;e[32]!==l?(p=l("Last 5m"),e[32]=l,e[33]=p):p=e[33];let C;e[34]!==p?(C=(0,r.jsx)("option",{value:"5m",children:p}),e[34]=p,e[35]=C):C=e[35];let q;e[36]!==l?(q=l("Last 15m"),e[36]=l,e[37]=q):q=e[37];let F;e[38]!==q?(F=(0,r.jsx)("option",{value:"15m",children:q}),e[38]=q,e[39]=F):F=e[39];let O;e[40]!==l?(O=l("Last hour"),e[40]=l,e[41]=O):O=e[41];let E;e[42]!==O?(E=(0,r.jsx)("option",{value:"1h",children:O}),e[42]=O,e[43]=E):E=e[43];let M;e[44]!==o||e[45]!==k||e[46]!==S||e[47]!==C||e[48]!==F||e[49]!==E||e[50]!==h?(M=(0,r.jsxs)("select",{"aria-label":k,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"logs-time-range",onChange:o,value:h,children:[S,C,F,E]}),e[44]=o,e[45]=k,e[46]=S,e[47]=C,e[48]=F,e[49]=E,e[50]=h,e[51]=M):M=e[51];let V=a?"border-border bg-muted font-medium":"border-input text-muted-foreground",_;e[52]!==V?(_=j("h-8 rounded-md border px-3 text-sm",V),e[52]=V,e[53]=_):_=e[53];let U;e[54]!==a||e[55]!==l?(U=l(a?"List":"Summary"),e[54]=a,e[55]=l,e[56]=U):U=e[56];let A;e[57]!==f||e[58]!==a||e[59]!==_||e[60]!==U?(A=(0,r.jsx)("button",{"aria-pressed":a,className:_,"data-testid":"logs-summary-toggle",onClick:f,type:"button",children:U}),e[57]=f,e[58]=a,e[59]=_,e[60]=U,e[61]=A):A=e[61];let $;return e[62]!==M||e[63]!==A||e[64]!==b||e[65]!==N||e[66]!==R?($=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[b,N,R,M,A]}),e[62]=M,e[63]=A,e[64]=b,e[65]=N,e[66]=R,e[67]=$):$=e[67],$},"He"),Qe=v(i=>{let e=(0,K.c)(53),{onOutcomeChange:t,onPathChange:n,onTableChange:s,onUserChange:o,outcomeFilter:c,pathPrefix:f,tableFilter:m,userIdFilter:d}=i,a=z(),h;e[0]!==a?(h=a("Function path"),e[0]=a,e[1]=h):h=e[1];let l;e[2]!==a?(l=a("file:function"),e[2]=a,e[3]=l):l=e[3];let u;e[4]!==n||e[5]!==f||e[6]!==h||e[7]!==l?(u=(0,r.jsx)(D,{"aria-label":h,className:"h-8 w-44","data-testid":"lg-req-path",onChange:n,placeholder:l,value:f}),e[4]=n,e[5]=f,e[6]=h,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==a?(g=a("User id"),e[9]=a,e[10]=g):g=e[10];let b;e[11]!==a?(b=a("userId"),e[11]=a,e[12]=b):b=e[12];let x;e[13]!==o||e[14]!==g||e[15]!==b||e[16]!==d?(x=(0,r.jsx)(D,{"aria-label":g,className:"h-8 w-32","data-testid":"lg-req-user",onChange:o,placeholder:b,value:d}),e[13]=o,e[14]=g,e[15]=b,e[16]=d,e[17]=x):x=e[17];let w;e[18]!==a?(w=a("Table touched"),e[18]=a,e[19]=w):w=e[19];let N;e[20]!==a?(N=a("table"),e[20]=a,e[21]=N):N=e[21];let y;e[22]!==s||e[23]!==w||e[24]!==N||e[25]!==m?(y=(0,r.jsx)(D,{"aria-label":w,className:"h-8 w-32","data-testid":"lg-req-table",onChange:s,placeholder:N,value:m}),e[22]=s,e[23]=w,e[24]=N,e[25]=m,e[26]=y):y=e[26];let T;e[27]!==a?(T=a("Outcome filter"),e[27]=a,e[28]=T):T=e[28];let R;e[29]!==a?(R=a("all"),e[29]=a,e[30]=R):R=e[30];let k;e[31]!==R?(k=(0,r.jsx)("option",{value:"all",children:R}),e[31]=R,e[32]=k):k=e[32];let L;e[33]!==a?(L=a("ok"),e[33]=a,e[34]=L):L=e[34];let S;e[35]!==L?(S=(0,r.jsx)("option",{value:"ok",children:L}),e[35]=L,e[36]=S):S=e[36];let p;e[37]!==a?(p=a("error"),e[37]=a,e[38]=p):p=e[38];let C;e[39]!==p?(C=(0,r.jsx)("option",{value:"error",children:p}),e[39]=p,e[40]=C):C=e[40];let q;e[41]!==t||e[42]!==c||e[43]!==T||e[44]!==k||e[45]!==S||e[46]!==C?(q=(0,r.jsxs)("select",{"aria-label":T,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"lg-req-outcome",onChange:t,value:c,children:[k,S,C]}),e[41]=t,e[42]=c,e[43]=T,e[44]=k,e[45]=S,e[46]=C,e[47]=q):q=e[47];let F;return e[48]!==q||e[49]!==u||e[50]!==x||e[51]!==y?(F=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,x,y,q]}),e[48]=q,e[49]=u,e[50]=x,e[51]=y,e[52]=F):F=e[52],F},"We"),Fe=v(i=>{let e=(0,K.c)(7),{bucket:t}=i,n;e[0]!==t.key?(n=(0,r.jsx)("span",{className:"truncate text-muted-foreground",role:"gridcell",children:t.key}),e[0]=t.key,e[1]=n):n=e[1];let s;e[2]!==t.count?(s=(0,r.jsx)("span",{className:"shrink-0 tabular-nums",role:"gridcell",children:t.count}),e[2]=t.count,e[3]=s):s=e[3];let o;return e[4]!==n||e[5]!==s?(o=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 px-3 py-1 font-mono text-xs","data-testid":"logs-summary-row",role:"row",children:[n,s]}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o},"ve"),Ye=v(i=>{let e=(0,K.c)(31),{summary:t}=i,n=z(),s;e[0]!==t.total||e[1]!==n?(s=n("{count} entries",{count:t.total}),e[0]=t.total,e[1]=n,e[2]=s):s=e[2];let o;e[3]!==s?(o=(0,r.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"logs-summary-total",children:s}),e[3]=s,e[4]=o):o=e[4];let c;e[5]!==n?(c=n("By level"),e[5]=n,e[6]=c):c=e[6];let f;e[7]!==c?(f=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:c}),e[7]=c,e[8]=f):f=e[8];let m;e[9]!==t.byLevel?(m=t.byLevel.map(Ge),e[9]=t.byLevel,e[10]=m):m=e[10];let d;e[11]!==m?(d=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-levels",role:"grid",children:m}),e[11]=m,e[12]=d):d=e[12];let a;e[13]!==f||e[14]!==d?(a=(0,r.jsxs)("div",{children:[f,d]}),e[13]=f,e[14]=d,e[15]=a):a=e[15];let h;e[16]!==n?(h=n("By function"),e[16]=n,e[17]=h):h=e[17];let l;e[18]!==h?(l=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h}),e[18]=h,e[19]=l):l=e[19];let u;e[20]!==t.byPath?(u=t.byPath.map(He),e[20]=t.byPath,e[21]=u):u=e[21];let g;e[22]!==u?(g=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-paths",role:"grid",children:u}),e[22]=u,e[23]=g):g=e[23];let b;e[24]!==g||e[25]!==l?(b=(0,r.jsxs)("div",{children:[l,g]}),e[24]=g,e[25]=l,e[26]=b):b=e[26];let x;return e[27]!==b||e[28]!==o||e[29]!==a?(x=(0,r.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"logs-summary",children:[o,a,b]}),e[27]=b,e[28]=o,e[29]=a,e[30]=x):x=e[30],x},"Ye");function Ge(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(Ge,"je");function He(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(He,"Je");var Je=v(i=>{let e=(0,K.c)(46),{liveError:t,onShardKeyChange:n,onShowArchive:s,onShowErrors:o,onShowRequests:c,shardKey:f,view:m}=i,d=z(),a=m==="requests",h=m==="requests"?"bg-muted font-medium":"text-muted-foreground",l;e[0]!==h?(l=j("px-3 py-1 text-sm",h),e[0]=h,e[1]=l):l=e[1];let u;e[2]!==d?(u=d("Requests"),e[2]=d,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==a||e[6]!==l||e[7]!==u?(g=(0,r.jsx)("button",{"aria-selected":a,className:l,"data-testid":"lg-view-requests",onClick:c,role:"tab",type:"button",children:u}),e[4]=c,e[5]=a,e[6]=l,e[7]=u,e[8]=g):g=e[8];let b=m==="errors",x=m==="errors"?"bg-muted font-medium":"text-muted-foreground",w;e[9]!==x?(w=j("px-3 py-1 text-sm",x),e[9]=x,e[10]=w):w=e[10];let N;e[11]!==d?(N=d("Errors"),e[11]=d,e[12]=N):N=e[12];let y;e[13]!==o||e[14]!==b||e[15]!==w||e[16]!==N?(y=(0,r.jsx)("button",{"aria-selected":b,className:w,"data-testid":"lg-view-errors",onClick:o,role:"tab",type:"button",children:N}),e[13]=o,e[14]=b,e[15]=w,e[16]=N,e[17]=y):y=e[17];let T=m==="archive",R=m==="archive"?"bg-muted font-medium":"text-muted-foreground",k;e[18]!==R?(k=j("px-3 py-1 text-sm",R),e[18]=R,e[19]=k):k=e[19];let L;e[20]!==d?(L=d("Archive"),e[20]=d,e[21]=L):L=e[21];let S;e[22]!==s||e[23]!==T||e[24]!==k||e[25]!==L?(S=(0,r.jsx)("button",{"aria-selected":T,className:k,"data-testid":"lg-view-archive",onClick:s,role:"tab",type:"button",children:L}),e[22]=s,e[23]=T,e[24]=k,e[25]=L,e[26]=S):S=e[26];let p;e[27]!==y||e[28]!==S||e[29]!==g?(p=(0,r.jsxs)("div",{className:"inline-flex overflow-hidden rounded-lg border border-border",role:"tablist",children:[g,y,S]}),e[27]=y,e[28]=S,e[29]=g,e[30]=p):p=e[30];let C;e[31]!==n||e[32]!==f?(C=(0,r.jsx)(be,{onChange:n,testId:"lg-shard-input",value:f}),e[31]=n,e[32]=f,e[33]=C):C=e[33];let q;e[34]!==t||e[35]!==m?(q=m!=="archive"&&(0,r.jsx)(Le,{message:t,prefix:"lg"}),e[34]=t,e[35]=m,e[36]=q):q=e[36];let F;e[37]!==d?(F=d("Open in Cloudflare"),e[37]=d,e[38]=F):F=e[38];let O;e[39]!==F?(O=(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"lg-cf-link",href:de,rel:"noreferrer",target:"_blank",children:F}),e[39]=F,e[40]=O):O=e[40];let E;return e[41]!==p||e[42]!==C||e[43]!==q||e[44]!==O?(E=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,C,q,O]}),e[41]=p,e[42]=C,e[43]=q,e[44]=O,e[45]=E):E=e[45],E},"Xe"),ue=400,Xe=36,Ze={height:ue,overflow:"auto"},Oe={left:0,position:"absolute",top:0,width:"100%"},et={error:"destructive",ok:"secondary"},Ee=v(i=>{let e=(0,K.c)(6),{onOpenTrace:t,traceId:n}=i,s=z(),o;e[0]!==t||e[1]!==s||e[2]!==n?(o=n===void 0?null:(0,r.jsx)("button",{className:"text-primary underline-offset-2 hover:underline","data-testid":"lg-trace-link",onClick:v(()=>{t(n)},"onClick"),type:"button",children:s("Trace")}),e[0]=t,e[1]=s,e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==o?(c=(0,r.jsx)("span",{className:"w-16 shrink-0 text-right",role:"gridcell",children:o}),e[4]=o,e[5]=c):c=e[5],c},"xe"),tt=v(i=>{let e=(0,K.c)(13),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t?(a=(0,r.jsx)(Re,{entry:t}),e[2]=t,e[3]=a):a=e[3];let h;e[4]!==t.traceId||e[5]!==o?(h=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[4]=t.traceId,e[5]=o,e[6]=h):h=e[6];let l;return e[7]!==n||e[8]!==s||e[9]!==d||e[10]!==a||e[11]!==h?(l=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-row",ref:s,role:"row",style:d,children:[a,h]}),e[7]=n,e[8]=s,e[9]=d,e[10]=a,e[11]=h,e[12]=l):l=e[12],l},"rt"),Ie=v(i=>i.length===0?"\u2014":i.join(", "),"ce"),rt=v(i=>{let e=(0,K.c)(41),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t.ts?(a=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=a):a=e[3];let h;e[4]!==a?(h=(0,r.jsx)("span",{className:"w-40 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:a}),e[4]=a,e[5]=h):h=e[5];let l=et[t.outcome],u;e[6]!==t.outcome||e[7]!==l?(u=(0,r.jsx)("span",{className:"w-16 shrink-0",role:"gridcell",children:(0,r.jsx)(re,{variant:l,children:t.outcome})}),e[6]=t.outcome,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==t.functionPath?(g=(0,r.jsx)("span",{className:"w-44 shrink-0 truncate",role:"gridcell",title:t.functionPath,children:t.functionPath}),e[9]=t.functionPath,e[10]=g):g=e[10];let b=t.shardKey??"\u2014",x;e[11]!==b?(x=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:b}),e[11]=b,e[12]=x):x=e[12];let w=t.userId??"\u2014",N;e[13]!==w?(N=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:w}),e[13]=w,e[14]=N):N=e[14];let y;e[15]!==t.durationMs?(y=Math.round(t.durationMs),e[15]=t.durationMs,e[16]=y):y=e[16];let T=`${String(y)}ms`,R;e[17]!==T?(R=(0,r.jsx)("span",{className:"w-16 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:T}),e[17]=T,e[18]=R):R=e[18];let k;e[19]!==t.errorMessage||e[20]!==t.outcome||e[21]!==t.tablesRead||e[22]!==t.tablesWritten?(k=t.outcome==="error"&&t.errorMessage!==void 0?t.errorMessage:`r:${Ie(t.tablesRead)} \xB7 w:${Ie(t.tablesWritten)}`,e[19]=t.errorMessage,e[20]=t.outcome,e[21]=t.tablesRead,e[22]=t.tablesWritten,e[23]=k):k=e[23];let L;e[24]!==k?(L=(0,r.jsx)("span",{className:"flex-1 truncate text-muted-foreground",role:"gridcell",children:k}),e[24]=k,e[25]=L):L=e[25];let S;e[26]!==t.traceId||e[27]!==o?(S=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[26]=t.traceId,e[27]=o,e[28]=S):S=e[28];let p;return e[29]!==n||e[30]!==s||e[31]!==d||e[32]!==N||e[33]!==R||e[34]!==L||e[35]!==S||e[36]!==h||e[37]!==u||e[38]!==g||e[39]!==x?(p=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-req-row",ref:s,role:"row",style:d,children:[h,u,g,x,N,R,L,S]}),e[29]=n,e[30]=s,e[31]=d,e[32]=N,e[33]=R,e[34]=L,e[35]=S,e[36]=h,e[37]=u,e[38]=g,e[39]=x,e[40]=p):p=e[40],p},"st"),qe=v(i=>{let{entries:e}=i??{};return Array.isArray(e)?e:[]},"de"),at=v(i=>{let e={};return i.functionPathPrefix.trim()!==""&&(e.functionPathPrefix=i.functionPathPrefix.trim()),i.userId.trim()!==""&&(e.userId=i.userId.trim()),i.tableTouched.trim()!==""&&(e.tableTouched=i.tableTouched.trim()),(i.outcome==="ok"||i.outcome==="error")&&(e.outcome=i.outcome),e},"lt"),lt={"5m":300*1e3,"15m":900*1e3,"1h":3600*1e3},ot=v((i,e)=>{let t=e.search.trim().toLowerCase(),n=e.path.trim().toLowerCase(),s=e.range==="all"?Number.NEGATIVE_INFINITY:e.now-lt[e.range];return i.filter(o=>e.levels.size>0&&!e.levels.has(o.level)||o.timestamp<s||n!==""&&!(o.functionPath??"").toLowerCase().includes(n)?!1:t===""||o.message.toLowerCase().includes(t)||ce(o.fields).toLowerCase().includes(t))},"at"),nt="\u2014",st=v(i=>{let e=new Map,t=new Map;for(let o of i){e.set(o.level,(e.get(o.level)??0)+1);let c=o.functionPath??nt;t.set(c,(t.get(c)??0)+1)}let n=me.filter(o=>e.has(o)).map(o=>({count:e.get(o)??0,key:o})),s=[...t.entries()].map(([o,c])=>({count:c,key:o})).toSorted((o,c)=>c.count===o.count?o.key.localeCompare(c.key):c.count-o.count);return{byLevel:n,byPath:s,total:i.length}},"it"),qt=v(({initialShardKey:i})=>{let e=z(),[t,n]=(0,I.useState)("requests"),{queryShardKey:s,setShardKey:o,shardKey:c}=xe(i),[f,m]=(0,I.useState)(""),[d,a]=(0,I.useState)(()=>new Set),[h,l]=(0,I.useState)(""),[u,g]=(0,I.useState)("all"),[b,x]=(0,I.useState)(!1),[w,N]=(0,I.useState)(""),[y,T]=(0,I.useState)(""),[R,k]=(0,I.useState)(""),[L,S]=(0,I.useState)("all"),p=at({functionPathPrefix:w,outcome:L,tableTouched:R,userId:y}),C=oe(ne.getRequestLog,p,{enabled:t==="requests",live:!0,shardKey:s}),q=oe(ne.getLogs,{},{enabled:t==="errors",live:!0,shardKey:s}),F=t==="requests"?C:q,{error:O,errorSource:E,isLoading:M,liveError:V}=F,_=Te(s),U=qe(q.data),A=qe(C.data);(0,I.useEffect)(()=>{F.data!==void 0&&ve(s)},[F.data,s]);let $=ot(U,{levels:d,now:Date.now(),path:h,range:u,search:f}),Q=st($),X=t==="requests"?A.length:$.length,Z=t==="errors"&&b,Y=(0,I.useMemo)(()=>O!==null?"error":X===0?M?Z?"summary":"list":"empty":Z?"summary":"list",[X,M,O,Z]),he=(0,I.useRef)(null),G=ke({count:X,estimateSize:v(()=>Xe,"estimateSize"),getScrollElement:v(()=>he.current,"getScrollElement"),initialRect:{height:ue,width:800},observeElementRect:v((P,ee)=>Se(P,ee,ue),"observeElementRect"),overscan:8}),Ke=G.getVirtualItems(),Me={height:G.getTotalSize(),position:"relative",width:"100%"};return(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-logs",children:[(0,r.jsx)(Je,{liveError:V,onShardKeyChange:o,onShowArchive:v(()=>{n("archive"),x(!1)},"onShowArchive"),onShowErrors:v(()=>{n("errors"),x(!1)},"onShowErrors"),onShowRequests:v(()=>{n("requests"),x(!1)},"onShowRequests"),shardKey:c,view:t}),t==="errors"&&(0,r.jsx)(Ve,{levelFilter:d,onLogPathChange:v(P=>{l(P.target.value)},"onLogPathChange"),onSearchChange:v(P=>{m(P.target.value)},"onSearchChange"),onTimeRangeChange:v(P=>{g(P.target.value)},"onTimeRangeChange"),onToggleLevel:v(P=>{a(ee=>{let H=new Set(ee);return H.has(P)?H.delete(P):H.add(P),H})},"onToggleLevel"),onToggleSummary:v(()=>{x(P=>!P)},"onToggleSummary"),pathFilter:h,search:f,showSummary:b,timeRange:u}),t==="requests"&&(0,r.jsx)(Qe,{onOutcomeChange:v(P=>{S(P.target.value)},"onOutcomeChange"),onPathChange:v(P=>{N(P.target.value)},"onPathChange"),onTableChange:v(P=>{k(P.target.value)},"onTableChange"),onUserChange:v(P=>{T(P.target.value)},"onUserChange"),outcomeFilter:L,pathPrefix:w,tableFilter:R,userIdFilter:y}),t==="archive"?(0,r.jsx)(We,{shardKey:s}):(0,r.jsxs)(r.Fragment,{children:[Y==="error"&&(0,r.jsx)(ye,{error:E,testId:"lg-error"}),Y==="empty"&&(0,r.jsx)(J,{description:e("Function and request logs for this shard show up here as your app handles traffic."),icon:(0,r.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 5h16M4 12h16M4 19h10"})}),testId:"lg-empty",title:e("No logs.")}),Y==="summary"&&(0,r.jsx)(Ye,{summary:Q}),Y==="list"&&(0,r.jsx)("div",{className:"rounded-xl border border-border shadow-xs","data-testid":"lg-scroll",ref:he,style:Ze,children:(0,r.jsx)("div",{"aria-label":e("Recent logs"),"data-testid":"lg-table",role:"grid",style:Me,children:Ke.map(P=>t==="requests"?(0,r.jsx)(rt,{entry:A[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key):(0,r.jsx)(tt,{entry:$[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key))})})]})]})},"Wt");export{qt as LogsPanel,ot as filterLogs,st as summarizeLogs};
|
|
1
|
+
import{a as Pe,b as Re}from"./chunk-2VA5S3IA.js";import{a as ce}from"./chunk-VCFEO3RI.js";import{a as Te}from"./chunk-6QTAHSDD.js";import"./chunk-VESGIGMQ.js";import{a as Se}from"./chunk-S4Z7K55A.js";import{b as ke}from"./chunk-5B2RTXBS.js";import{a as de}from"./chunk-UYEZR3BI.js";import{a as Le}from"./chunk-SV764LKQ.js";import{a as ie}from"./chunk-IWZ7GVQO.js";import{a as xe}from"./chunk-R6U22RSY.js";import{a as be}from"./chunk-YVR4SEPU.js";import{b as ve}from"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import"./chunk-OQ6I6OXT.js";import{i as D}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import{a as pe}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as re}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as ye}from"./chunk-53NRDRMS.js";import"./chunk-NCPW7WHO.js";import"./chunk-WK5TYZAF.js";import"./chunk-55UGUCQ6.js";import{a as ne}from"./chunk-4ZEL6BYL.js";import{c as oe}from"./chunk-W36YKEUZ.js";import{l as ge}from"./chunk-6L2GY26N.js";import"./chunk-QAQDMS6R.js";import"./chunk-VGL7ERWQ.js";import{a as J}from"./chunk-RWVIV3U7.js";import{a as we,b as Ne,c as Ce,d as se,e as B,f as W}from"./chunk-HCTJKP5J.js";import{d as z,h as ae,i as fe,p as le}from"./chunk-HJHSQPHW.js";import{a as v,d as te,e as _e,f as Ae,g as Ue,i as j}from"./chunk-I26MS5PJ.js";var K=te(Ae(),1);var I=te(_e(),1);var r=te(Ue(),1);var me=["trace","debug","log","info","warn","error","fatal"],$e="LOG_ARCHIVE_NOT_CONFIGURED",ze={cursor:void 0,error:null,loading:!1,notConfigured:!1,rows:null},De=v((i,e)=>{switch(e.type){case"append":return{...i,cursor:e.cursor,error:null,loading:!1,rows:[...i.rows??[],...e.rows]};case"failed":return{cursor:void 0,error:e.message,loading:!1,notConfigured:!1,rows:null};case"loaded":return{cursor:e.cursor,error:null,loading:!1,notConfigured:!1,rows:e.rows};case"loading":return{...i,error:null,loading:!0,notConfigured:!1};case"notConfigured":return{cursor:void 0,error:null,loading:!1,notConfigured:!0,rows:null};case"pageFailed":return{...i,error:e.message,loading:!1};default:return i}},"De"),Be=v(i=>{let e=(0,K.c)(33),{row:t}=i,n;e[0]!==t.fields?(n=ce(t.fields),e[0]=t.fields,e[1]=n):n=e[1];let s=n,o=`lg-archive-row-${String(t.ts)}`,c;e[2]!==t.ts?(c=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=c):c=e[3];let f;e[4]!==c?(f=(0,r.jsx)(W,{className:"tabular-nums whitespace-nowrap text-xs text-muted-foreground",children:c}),e[4]=c,e[5]=f):f=e[5];let m=Pe[t.level],d;e[6]!==t.level||e[7]!==m?(d=(0,r.jsx)(W,{children:(0,r.jsx)(re,{variant:m,children:t.level})}),e[6]=t.level,e[7]=m,e[8]=d):d=e[8];let a;e[9]!==t.functionPath?(a=(0,r.jsx)(W,{className:"font-mono text-xs",children:t.functionPath}),e[9]=t.functionPath,e[10]=a):a=e[10];let h;e[11]!==t.message?(h=(0,r.jsx)("div",{className:"truncate",title:t.message,children:t.message}),e[11]=t.message,e[12]=h):h=e[12];let l;e[13]!==s?(l=s!==""&&(0,r.jsx)("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:s,children:s}),e[13]=s,e[14]=l):l=e[14];let u;e[15]!==h||e[16]!==l?(u=(0,r.jsxs)(W,{className:"max-w-md",children:[h,l]}),e[15]=h,e[16]=l,e[17]=u):u=e[17];let g=t.traceId??"\u2014",b;e[18]!==g?(b=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:g}),e[18]=g,e[19]=b):b=e[19];let x=t.shardKey??"\u2014",w;e[20]!==x?(w=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:x}),e[20]=x,e[21]=w):w=e[21];let N=t.userId??"\u2014",y;e[22]!==N?(y=(0,r.jsx)(W,{className:"font-mono text-[11px] text-muted-foreground",children:N}),e[22]=N,e[23]=y):y=e[23];let T;return e[24]!==u||e[25]!==b||e[26]!==w||e[27]!==y||e[28]!==o||e[29]!==f||e[30]!==d||e[31]!==a?(T=(0,r.jsxs)(se,{"data-testid":o,children:[f,d,a,u,b,w,y]}),e[24]=u,e[25]=b,e[26]=w,e[27]=y,e[28]=o,e[29]=f,e[30]=d,e[31]=a,e[32]=T):T=e[32],T},"Qe"),We=v(({shardKey:i})=>{let e=ge(),t=z(),[n,s]=(0,I.useState)(""),[o,c]=(0,I.useState)(""),[f,m]=(0,I.useState)(""),[{cursor:d,error:a,loading:h,notConfigured:l,rows:u},g]=(0,I.useReducer)(De,ze),b=ie(n.trim(),400),x=ie(o.trim(),400),w={...b===""?{}:{functionPathPrefix:b},...f===""?{}:{minLevel:f},...i===""?{}:{shardKey:i},...x===""?{}:{userId:x}},N=JSON.stringify(w),y=(0,I.useRef)(N);(0,I.useEffect)(()=>{let p={cancelled:!1};return y.current=N,le((async()=>{g({type:"loading"});try{let C=await e.queryLogArchive(w);p.cancelled||g({cursor:C.nextCursor,rows:C.rows,type:"loaded"})}catch(C){p.cancelled||g(fe(C)===$e?{type:"notConfigured"}:{message:ae(C),type:"failed"})}})()),()=>{p.cancelled=!0}},[e,N]);let T=v(async()=>{if(d===void 0)return;let p=N;g({type:"loading"});try{let C=await e.queryLogArchive({...w,cursor:d});y.current===p&&g({cursor:C.nextCursor,rows:C.rows,type:"append"})}catch(C){y.current===p&&g({message:ae(C),type:"pageFailed"})}},"T"),R=v(p=>{s(p.target.value)},"R"),k=v(p=>{c(p.target.value)},"N"),L=v(p=>{m(p.target.value)},"L"),S=v(()=>{le(T())},"S");return l?(0,r.jsx)(J,{action:(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline",href:de,rel:"noreferrer",target:"_blank",children:t("Open in Cloudflare")}),description:t("Wire pipelineLogSink to a Cloudflare Pipeline \u2192 R2 Data Catalog table and set R2_SQL_ACCOUNT_ID, R2_SQL_TOKEN, R2_SQL_BUCKET to browse the durable log archive here."),testId:"lg-archive-not-configured",title:t("Log archive not configured")}):(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lg-archive",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(D,{"aria-label":t("Function path prefix"),className:"h-8 w-48","data-testid":"lg-archive-path",onChange:R,placeholder:t("function path\u2026"),value:n}),(0,r.jsx)(D,{"aria-label":t("User id"),className:"h-8 w-40","data-testid":"lg-archive-user",onChange:k,placeholder:t("user id\u2026"),value:o}),(0,r.jsxs)("select",{"aria-label":t("Minimum level"),className:"h-8 rounded-md border border-border bg-background px-2 text-sm","data-testid":"lg-archive-min-level",onChange:L,value:f,children:[(0,r.jsx)("option",{value:"",children:t("min level")}),me.map(p=>(0,r.jsx)("option",{value:p,children:p},p))]})]}),a!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"lg-archive-error",role:"alert",children:a}),h&&u===null&&a===null&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"lg-archive-loading",children:t("Loading\u2026")}),u!==null&&u.length===0&&(0,r.jsx)(J,{description:t("No archived logs match these filters. The durable archive fills as pipelineLogSink flushes records to R2."),testId:"lg-archive-empty",title:t("No archived logs.")}),u!==null&&u.length>0&&(0,r.jsx)("div",{className:"overflow-hidden rounded-xl border border-border shadow-xs",children:(0,r.jsxs)(we,{"data-testid":"lg-archive-table",children:[(0,r.jsx)(Ne,{children:(0,r.jsxs)(se,{children:[(0,r.jsx)(B,{children:t("Time")}),(0,r.jsx)(B,{children:t("Level")}),(0,r.jsx)(B,{children:t("Function")}),(0,r.jsx)(B,{children:t("Message")}),(0,r.jsx)(B,{children:t("Trace")}),(0,r.jsx)(B,{children:t("Shard")}),(0,r.jsx)(B,{children:t("User")})]})}),(0,r.jsx)(Ce,{children:u.map((p,C)=>(0,r.jsx)(Be,{row:p},`${String(p.ts)}-${String(C)}`))})]})}),d!==void 0&&(0,r.jsx)("div",{children:(0,r.jsx)(pe,{"data-testid":"lg-archive-more",disabled:h,onClick:S,size:"sm",variant:"outline",children:t(h?"Loading\u2026":"Load more")})})]})},"ze"),je=v(i=>{let e=(0,K.c)(11),{level:t,onToggle:n,selected:s}=i,o;e[0]!==t||e[1]!==n?(o=v(()=>{n(t)},"o"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let c=o,f=s?"border-border bg-muted font-medium":"border-input text-muted-foreground",m;e[3]!==f?(m=j("rounded-md border px-2 py-1 text-xs",f),e[3]=f,e[4]=m):m=e[4];let d=`logs-level-${t}`,a;return e[5]!==t||e[6]!==c||e[7]!==s||e[8]!==m||e[9]!==d?(a=(0,r.jsx)("button",{"aria-pressed":s,className:m,"data-testid":d,onClick:c,type:"button",children:t}),e[5]=t,e[6]=c,e[7]=s,e[8]=m,e[9]=d,e[10]=a):a=e[10],a},"Ge"),Ve=v(i=>{let e=(0,K.c)(68),{levelFilter:t,onLogPathChange:n,onSearchChange:s,onTimeRangeChange:o,onToggleLevel:c,onToggleSummary:f,pathFilter:m,search:d,showSummary:a,timeRange:h}=i,l=z(),u;e[0]!==l?(u=l("Search messages"),e[0]=l,e[1]=u):u=e[1];let g;e[2]!==l?(g=l("search message"),e[2]=l,e[3]=g):g=e[3];let b;e[4]!==s||e[5]!==d||e[6]!==u||e[7]!==g?(b=(0,r.jsx)(D,{"aria-label":u,className:"h-8 w-48","data-testid":"lg-search",onChange:s,placeholder:g,value:d}),e[4]=s,e[5]=d,e[6]=u,e[7]=g,e[8]=b):b=e[8];let x;e[9]!==l?(x=l("Function path"),e[9]=l,e[10]=x):x=e[10];let w;e[11]!==l?(w=l("filter path"),e[11]=l,e[12]=w):w=e[12];let N;e[13]!==n||e[14]!==m||e[15]!==x||e[16]!==w?(N=(0,r.jsx)(D,{"aria-label":x,className:"h-8 w-40","data-testid":"logs-path-filter",onChange:n,placeholder:w,value:m}),e[13]=n,e[14]=m,e[15]=x,e[16]=w,e[17]=N):N=e[17];let y;e[18]!==l?(y=l("Level filter"),e[18]=l,e[19]=y):y=e[19];let T;e[20]!==t||e[21]!==c?(T=me.map(Q=>(0,r.jsx)(je,{level:Q,onToggle:c,selected:t.has(Q)},Q)),e[20]=t,e[21]=c,e[22]=T):T=e[22];let R;e[23]!==y||e[24]!==T?(R=(0,r.jsx)("div",{"aria-label":y,className:"inline-flex items-center gap-1","data-testid":"logs-level-filter",role:"group",children:T}),e[23]=y,e[24]=T,e[25]=R):R=e[25];let k;e[26]!==l?(k=l("Time range"),e[26]=l,e[27]=k):k=e[27];let L;e[28]!==l?(L=l("All time"),e[28]=l,e[29]=L):L=e[29];let S;e[30]!==L?(S=(0,r.jsx)("option",{value:"all",children:L}),e[30]=L,e[31]=S):S=e[31];let p;e[32]!==l?(p=l("Last 5m"),e[32]=l,e[33]=p):p=e[33];let C;e[34]!==p?(C=(0,r.jsx)("option",{value:"5m",children:p}),e[34]=p,e[35]=C):C=e[35];let q;e[36]!==l?(q=l("Last 15m"),e[36]=l,e[37]=q):q=e[37];let F;e[38]!==q?(F=(0,r.jsx)("option",{value:"15m",children:q}),e[38]=q,e[39]=F):F=e[39];let O;e[40]!==l?(O=l("Last hour"),e[40]=l,e[41]=O):O=e[41];let E;e[42]!==O?(E=(0,r.jsx)("option",{value:"1h",children:O}),e[42]=O,e[43]=E):E=e[43];let M;e[44]!==o||e[45]!==k||e[46]!==S||e[47]!==C||e[48]!==F||e[49]!==E||e[50]!==h?(M=(0,r.jsxs)("select",{"aria-label":k,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"logs-time-range",onChange:o,value:h,children:[S,C,F,E]}),e[44]=o,e[45]=k,e[46]=S,e[47]=C,e[48]=F,e[49]=E,e[50]=h,e[51]=M):M=e[51];let V=a?"border-border bg-muted font-medium":"border-input text-muted-foreground",_;e[52]!==V?(_=j("h-8 rounded-md border px-3 text-sm",V),e[52]=V,e[53]=_):_=e[53];let U;e[54]!==a||e[55]!==l?(U=l(a?"List":"Summary"),e[54]=a,e[55]=l,e[56]=U):U=e[56];let A;e[57]!==f||e[58]!==a||e[59]!==_||e[60]!==U?(A=(0,r.jsx)("button",{"aria-pressed":a,className:_,"data-testid":"logs-summary-toggle",onClick:f,type:"button",children:U}),e[57]=f,e[58]=a,e[59]=_,e[60]=U,e[61]=A):A=e[61];let $;return e[62]!==M||e[63]!==A||e[64]!==b||e[65]!==N||e[66]!==R?($=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[b,N,R,M,A]}),e[62]=M,e[63]=A,e[64]=b,e[65]=N,e[66]=R,e[67]=$):$=e[67],$},"He"),Qe=v(i=>{let e=(0,K.c)(53),{onOutcomeChange:t,onPathChange:n,onTableChange:s,onUserChange:o,outcomeFilter:c,pathPrefix:f,tableFilter:m,userIdFilter:d}=i,a=z(),h;e[0]!==a?(h=a("Function path"),e[0]=a,e[1]=h):h=e[1];let l;e[2]!==a?(l=a("file:function"),e[2]=a,e[3]=l):l=e[3];let u;e[4]!==n||e[5]!==f||e[6]!==h||e[7]!==l?(u=(0,r.jsx)(D,{"aria-label":h,className:"h-8 w-44","data-testid":"lg-req-path",onChange:n,placeholder:l,value:f}),e[4]=n,e[5]=f,e[6]=h,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==a?(g=a("User id"),e[9]=a,e[10]=g):g=e[10];let b;e[11]!==a?(b=a("userId"),e[11]=a,e[12]=b):b=e[12];let x;e[13]!==o||e[14]!==g||e[15]!==b||e[16]!==d?(x=(0,r.jsx)(D,{"aria-label":g,className:"h-8 w-32","data-testid":"lg-req-user",onChange:o,placeholder:b,value:d}),e[13]=o,e[14]=g,e[15]=b,e[16]=d,e[17]=x):x=e[17];let w;e[18]!==a?(w=a("Table touched"),e[18]=a,e[19]=w):w=e[19];let N;e[20]!==a?(N=a("table"),e[20]=a,e[21]=N):N=e[21];let y;e[22]!==s||e[23]!==w||e[24]!==N||e[25]!==m?(y=(0,r.jsx)(D,{"aria-label":w,className:"h-8 w-32","data-testid":"lg-req-table",onChange:s,placeholder:N,value:m}),e[22]=s,e[23]=w,e[24]=N,e[25]=m,e[26]=y):y=e[26];let T;e[27]!==a?(T=a("Outcome filter"),e[27]=a,e[28]=T):T=e[28];let R;e[29]!==a?(R=a("all"),e[29]=a,e[30]=R):R=e[30];let k;e[31]!==R?(k=(0,r.jsx)("option",{value:"all",children:R}),e[31]=R,e[32]=k):k=e[32];let L;e[33]!==a?(L=a("ok"),e[33]=a,e[34]=L):L=e[34];let S;e[35]!==L?(S=(0,r.jsx)("option",{value:"ok",children:L}),e[35]=L,e[36]=S):S=e[36];let p;e[37]!==a?(p=a("error"),e[37]=a,e[38]=p):p=e[38];let C;e[39]!==p?(C=(0,r.jsx)("option",{value:"error",children:p}),e[39]=p,e[40]=C):C=e[40];let q;e[41]!==t||e[42]!==c||e[43]!==T||e[44]!==k||e[45]!==S||e[46]!==C?(q=(0,r.jsxs)("select",{"aria-label":T,className:"h-8 rounded-md border border-input bg-transparent px-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none","data-testid":"lg-req-outcome",onChange:t,value:c,children:[k,S,C]}),e[41]=t,e[42]=c,e[43]=T,e[44]=k,e[45]=S,e[46]=C,e[47]=q):q=e[47];let F;return e[48]!==q||e[49]!==u||e[50]!==x||e[51]!==y?(F=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,x,y,q]}),e[48]=q,e[49]=u,e[50]=x,e[51]=y,e[52]=F):F=e[52],F},"We"),Fe=v(i=>{let e=(0,K.c)(7),{bucket:t}=i,n;e[0]!==t.key?(n=(0,r.jsx)("span",{className:"truncate text-muted-foreground",role:"gridcell",children:t.key}),e[0]=t.key,e[1]=n):n=e[1];let s;e[2]!==t.count?(s=(0,r.jsx)("span",{className:"shrink-0 tabular-nums",role:"gridcell",children:t.count}),e[2]=t.count,e[3]=s):s=e[3];let o;return e[4]!==n||e[5]!==s?(o=(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 px-3 py-1 font-mono text-xs","data-testid":"logs-summary-row",role:"row",children:[n,s]}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o},"ve"),Ye=v(i=>{let e=(0,K.c)(31),{summary:t}=i,n=z(),s;e[0]!==t.total||e[1]!==n?(s=n("{count} entries",{count:t.total}),e[0]=t.total,e[1]=n,e[2]=s):s=e[2];let o;e[3]!==s?(o=(0,r.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"logs-summary-total",children:s}),e[3]=s,e[4]=o):o=e[4];let c;e[5]!==n?(c=n("By level"),e[5]=n,e[6]=c):c=e[6];let f;e[7]!==c?(f=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:c}),e[7]=c,e[8]=f):f=e[8];let m;e[9]!==t.byLevel?(m=t.byLevel.map(Ge),e[9]=t.byLevel,e[10]=m):m=e[10];let d;e[11]!==m?(d=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-levels",role:"grid",children:m}),e[11]=m,e[12]=d):d=e[12];let a;e[13]!==f||e[14]!==d?(a=(0,r.jsxs)("div",{children:[f,d]}),e[13]=f,e[14]=d,e[15]=a):a=e[15];let h;e[16]!==n?(h=n("By function"),e[16]=n,e[17]=h):h=e[17];let l;e[18]!==h?(l=(0,r.jsx)("h4",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h}),e[18]=h,e[19]=l):l=e[19];let u;e[20]!==t.byPath?(u=t.byPath.map(He),e[20]=t.byPath,e[21]=u):u=e[21];let g;e[22]!==u?(g=(0,r.jsx)("div",{className:"overflow-hidden rounded-lg border border-border","data-testid":"logs-summary-paths",role:"grid",children:u}),e[22]=u,e[23]=g):g=e[23];let b;e[24]!==g||e[25]!==l?(b=(0,r.jsxs)("div",{children:[l,g]}),e[24]=g,e[25]=l,e[26]=b):b=e[26];let x;return e[27]!==b||e[28]!==o||e[29]!==a?(x=(0,r.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"logs-summary",children:[o,a,b]}),e[27]=b,e[28]=o,e[29]=a,e[30]=x):x=e[30],x},"Ye");function Ge(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(Ge,"je");function He(i){return(0,r.jsx)(Fe,{bucket:i},i.key)}v(He,"Je");var Je=v(i=>{let e=(0,K.c)(46),{liveError:t,onShardKeyChange:n,onShowArchive:s,onShowErrors:o,onShowRequests:c,shardKey:f,view:m}=i,d=z(),a=m==="requests",h=m==="requests"?"bg-muted font-medium":"text-muted-foreground",l;e[0]!==h?(l=j("px-3 py-1 text-sm",h),e[0]=h,e[1]=l):l=e[1];let u;e[2]!==d?(u=d("Requests"),e[2]=d,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==a||e[6]!==l||e[7]!==u?(g=(0,r.jsx)("button",{"aria-selected":a,className:l,"data-testid":"lg-view-requests",onClick:c,role:"tab",type:"button",children:u}),e[4]=c,e[5]=a,e[6]=l,e[7]=u,e[8]=g):g=e[8];let b=m==="errors",x=m==="errors"?"bg-muted font-medium":"text-muted-foreground",w;e[9]!==x?(w=j("px-3 py-1 text-sm",x),e[9]=x,e[10]=w):w=e[10];let N;e[11]!==d?(N=d("Errors"),e[11]=d,e[12]=N):N=e[12];let y;e[13]!==o||e[14]!==b||e[15]!==w||e[16]!==N?(y=(0,r.jsx)("button",{"aria-selected":b,className:w,"data-testid":"lg-view-errors",onClick:o,role:"tab",type:"button",children:N}),e[13]=o,e[14]=b,e[15]=w,e[16]=N,e[17]=y):y=e[17];let T=m==="archive",R=m==="archive"?"bg-muted font-medium":"text-muted-foreground",k;e[18]!==R?(k=j("px-3 py-1 text-sm",R),e[18]=R,e[19]=k):k=e[19];let L;e[20]!==d?(L=d("Archive"),e[20]=d,e[21]=L):L=e[21];let S;e[22]!==s||e[23]!==T||e[24]!==k||e[25]!==L?(S=(0,r.jsx)("button",{"aria-selected":T,className:k,"data-testid":"lg-view-archive",onClick:s,role:"tab",type:"button",children:L}),e[22]=s,e[23]=T,e[24]=k,e[25]=L,e[26]=S):S=e[26];let p;e[27]!==y||e[28]!==S||e[29]!==g?(p=(0,r.jsxs)("div",{className:"inline-flex overflow-hidden rounded-lg border border-border",role:"tablist",children:[g,y,S]}),e[27]=y,e[28]=S,e[29]=g,e[30]=p):p=e[30];let C;e[31]!==n||e[32]!==f?(C=(0,r.jsx)(be,{onChange:n,testId:"lg-shard-input",value:f}),e[31]=n,e[32]=f,e[33]=C):C=e[33];let q;e[34]!==t||e[35]!==m?(q=m!=="archive"&&(0,r.jsx)(Le,{message:t,prefix:"lg"}),e[34]=t,e[35]=m,e[36]=q):q=e[36];let F;e[37]!==d?(F=d("Open in Cloudflare"),e[37]=d,e[38]=F):F=e[38];let O;e[39]!==F?(O=(0,r.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"lg-cf-link",href:de,rel:"noreferrer",target:"_blank",children:F}),e[39]=F,e[40]=O):O=e[40];let E;return e[41]!==p||e[42]!==C||e[43]!==q||e[44]!==O?(E=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,C,q,O]}),e[41]=p,e[42]=C,e[43]=q,e[44]=O,e[45]=E):E=e[45],E},"Xe"),ue=400,Xe=36,Ze={height:ue,overflow:"auto"},Oe={left:0,position:"absolute",top:0,width:"100%"},et={error:"destructive",ok:"secondary"},Ee=v(i=>{let e=(0,K.c)(6),{onOpenTrace:t,traceId:n}=i,s=z(),o;e[0]!==t||e[1]!==s||e[2]!==n?(o=n===void 0?null:(0,r.jsx)("button",{className:"text-primary underline-offset-2 hover:underline","data-testid":"lg-trace-link",onClick:v(()=>{t(n)},"onClick"),type:"button",children:s("Trace")}),e[0]=t,e[1]=s,e[2]=n,e[3]=o):o=e[3];let c;return e[4]!==o?(c=(0,r.jsx)("span",{className:"w-16 shrink-0 text-right",role:"gridcell",children:o}),e[4]=o,e[5]=c):c=e[5],c},"xe"),tt=v(i=>{let e=(0,K.c)(13),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t?(a=(0,r.jsx)(Re,{entry:t}),e[2]=t,e[3]=a):a=e[3];let h;e[4]!==t.traceId||e[5]!==o?(h=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[4]=t.traceId,e[5]=o,e[6]=h):h=e[6];let l;return e[7]!==n||e[8]!==s||e[9]!==d||e[10]!==a||e[11]!==h?(l=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-row",ref:s,role:"row",style:d,children:[a,h]}),e[7]=n,e[8]=s,e[9]=d,e[10]=a,e[11]=h,e[12]=l):l=e[12],l},"rt"),Ie=v(i=>i.length===0?"\u2014":i.join(", "),"ce"),rt=v(i=>{let e=(0,K.c)(41),{entry:t,index:n,measureRef:s,onOpenTrace:o,start:c}=i,f=`translateY(${String(c)}px)`,m;e[0]!==f?(m={...Oe,transform:f},e[0]=f,e[1]=m):m=e[1];let d=m,a;e[2]!==t.ts?(a=new Date(t.ts).toLocaleString(),e[2]=t.ts,e[3]=a):a=e[3];let h;e[4]!==a?(h=(0,r.jsx)("span",{className:"w-40 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:a}),e[4]=a,e[5]=h):h=e[5];let l=et[t.outcome],u;e[6]!==t.outcome||e[7]!==l?(u=(0,r.jsx)("span",{className:"w-16 shrink-0",role:"gridcell",children:(0,r.jsx)(re,{variant:l,children:t.outcome})}),e[6]=t.outcome,e[7]=l,e[8]=u):u=e[8];let g;e[9]!==t.functionPath?(g=(0,r.jsx)("span",{className:"w-44 shrink-0 truncate",role:"gridcell",title:t.functionPath,children:t.functionPath}),e[9]=t.functionPath,e[10]=g):g=e[10];let b=t.shardKey??"\u2014",x;e[11]!==b?(x=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:b}),e[11]=b,e[12]=x):x=e[12];let w=t.userId??"\u2014",N;e[13]!==w?(N=(0,r.jsx)("span",{className:"w-24 shrink-0 truncate text-muted-foreground",role:"gridcell",children:w}),e[13]=w,e[14]=N):N=e[14];let y;e[15]!==t.durationMs?(y=Math.round(t.durationMs),e[15]=t.durationMs,e[16]=y):y=e[16];let T=`${String(y)}ms`,R;e[17]!==T?(R=(0,r.jsx)("span",{className:"w-16 shrink-0 tabular-nums text-muted-foreground",role:"gridcell",children:T}),e[17]=T,e[18]=R):R=e[18];let k;e[19]!==t.errorMessage||e[20]!==t.outcome||e[21]!==t.tablesRead||e[22]!==t.tablesWritten?(k=t.outcome==="error"&&t.errorMessage!==void 0?t.errorMessage:`r:${Ie(t.tablesRead)} \xB7 w:${Ie(t.tablesWritten)}`,e[19]=t.errorMessage,e[20]=t.outcome,e[21]=t.tablesRead,e[22]=t.tablesWritten,e[23]=k):k=e[23];let L;e[24]!==k?(L=(0,r.jsx)("span",{className:"flex-1 truncate text-muted-foreground",role:"gridcell",children:k}),e[24]=k,e[25]=L):L=e[25];let S;e[26]!==t.traceId||e[27]!==o?(S=(0,r.jsx)(Ee,{onOpenTrace:o,traceId:t.traceId}),e[26]=t.traceId,e[27]=o,e[28]=S):S=e[28];let p;return e[29]!==n||e[30]!==s||e[31]!==d||e[32]!==N||e[33]!==R||e[34]!==L||e[35]!==S||e[36]!==h||e[37]!==u||e[38]!==g||e[39]!==x?(p=(0,r.jsxs)("div",{className:"flex items-center border-b border-border px-3 py-1.5 font-mono text-xs hover:bg-muted/50","data-index":n,"data-testid":"lg-req-row",ref:s,role:"row",style:d,children:[h,u,g,x,N,R,L,S]}),e[29]=n,e[30]=s,e[31]=d,e[32]=N,e[33]=R,e[34]=L,e[35]=S,e[36]=h,e[37]=u,e[38]=g,e[39]=x,e[40]=p):p=e[40],p},"st"),qe=v(i=>{let{entries:e}=i??{};return Array.isArray(e)?e:[]},"de"),at=v(i=>{let e={};return i.functionPathPrefix.trim()!==""&&(e.functionPathPrefix=i.functionPathPrefix.trim()),i.userId.trim()!==""&&(e.userId=i.userId.trim()),i.tableTouched.trim()!==""&&(e.tableTouched=i.tableTouched.trim()),(i.outcome==="ok"||i.outcome==="error")&&(e.outcome=i.outcome),e},"lt"),lt={"5m":300*1e3,"15m":900*1e3,"1h":3600*1e3},ot=v((i,e)=>{let t=e.search.trim().toLowerCase(),n=e.path.trim().toLowerCase(),s=e.range==="all"?Number.NEGATIVE_INFINITY:e.now-lt[e.range];return i.filter(o=>e.levels.size>0&&!e.levels.has(o.level)||o.timestamp<s||n!==""&&!(o.functionPath??"").toLowerCase().includes(n)?!1:t===""||o.message.toLowerCase().includes(t)||ce(o.fields).toLowerCase().includes(t))},"at"),nt="\u2014",st=v(i=>{let e=new Map,t=new Map;for(let o of i){e.set(o.level,(e.get(o.level)??0)+1);let c=o.functionPath??nt;t.set(c,(t.get(c)??0)+1)}let n=me.filter(o=>e.has(o)).map(o=>({count:e.get(o)??0,key:o})),s=[...t.entries()].map(([o,c])=>({count:c,key:o})).toSorted((o,c)=>c.count===o.count?o.key.localeCompare(c.key):c.count-o.count);return{byLevel:n,byPath:s,total:i.length}},"it"),qt=v(({initialShardKey:i})=>{let e=z(),[t,n]=(0,I.useState)("requests"),{queryShardKey:s,setShardKey:o,shardKey:c}=xe(i),[f,m]=(0,I.useState)(""),[d,a]=(0,I.useState)(()=>new Set),[h,l]=(0,I.useState)(""),[u,g]=(0,I.useState)("all"),[b,x]=(0,I.useState)(!1),[w,N]=(0,I.useState)(""),[y,T]=(0,I.useState)(""),[R,k]=(0,I.useState)(""),[L,S]=(0,I.useState)("all"),p=at({functionPathPrefix:w,outcome:L,tableTouched:R,userId:y}),C=oe(ne.getRequestLog,p,{enabled:t==="requests",live:!0,shardKey:s}),q=oe(ne.getLogs,{},{enabled:t==="errors",live:!0,shardKey:s}),F=t==="requests"?C:q,{error:O,errorSource:E,isLoading:M,liveError:V}=F,_=Te(s),U=qe(q.data),A=qe(C.data);(0,I.useEffect)(()=>{F.data!==void 0&&ve(s)},[F.data,s]);let $=ot(U,{levels:d,now:Date.now(),path:h,range:u,search:f}),Q=st($),X=t==="requests"?A.length:$.length,Z=t==="errors"&&b,Y=(0,I.useMemo)(()=>O!==null?"error":X===0?M?Z?"summary":"list":"empty":Z?"summary":"list",[X,M,O,Z]),he=(0,I.useRef)(null),G=ke({count:X,estimateSize:v(()=>Xe,"estimateSize"),getScrollElement:v(()=>he.current,"getScrollElement"),initialRect:{height:ue,width:800},observeElementRect:v((P,ee)=>Se(P,ee,ue),"observeElementRect"),overscan:8}),Ke=G.getVirtualItems(),Me={height:G.getTotalSize(),position:"relative",width:"100%"};return(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-logs",children:[(0,r.jsx)(Je,{liveError:V,onShardKeyChange:o,onShowArchive:v(()=>{n("archive"),x(!1)},"onShowArchive"),onShowErrors:v(()=>{n("errors"),x(!1)},"onShowErrors"),onShowRequests:v(()=>{n("requests"),x(!1)},"onShowRequests"),shardKey:c,view:t}),t==="errors"&&(0,r.jsx)(Ve,{levelFilter:d,onLogPathChange:v(P=>{l(P.target.value)},"onLogPathChange"),onSearchChange:v(P=>{m(P.target.value)},"onSearchChange"),onTimeRangeChange:v(P=>{g(P.target.value)},"onTimeRangeChange"),onToggleLevel:v(P=>{a(ee=>{let H=new Set(ee);return H.has(P)?H.delete(P):H.add(P),H})},"onToggleLevel"),onToggleSummary:v(()=>{x(P=>!P)},"onToggleSummary"),pathFilter:h,search:f,showSummary:b,timeRange:u}),t==="requests"&&(0,r.jsx)(Qe,{onOutcomeChange:v(P=>{S(P.target.value)},"onOutcomeChange"),onPathChange:v(P=>{N(P.target.value)},"onPathChange"),onTableChange:v(P=>{k(P.target.value)},"onTableChange"),onUserChange:v(P=>{T(P.target.value)},"onUserChange"),outcomeFilter:L,pathPrefix:w,tableFilter:R,userIdFilter:y}),t==="archive"?(0,r.jsx)(We,{shardKey:s}):(0,r.jsxs)(r.Fragment,{children:[Y==="error"&&(0,r.jsx)(ye,{error:E,testId:"lg-error"}),Y==="empty"&&(0,r.jsx)(J,{description:e("Function and request logs for this shard show up here as your app handles traffic."),icon:(0,r.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M4 5h16M4 12h16M4 19h10"})}),testId:"lg-empty",title:e("No logs.")}),Y==="summary"&&(0,r.jsx)(Ye,{summary:Q}),Y==="list"&&(0,r.jsx)("div",{className:"rounded-xl border border-border shadow-xs","data-testid":"lg-scroll",ref:he,style:Ze,children:(0,r.jsx)("div",{"aria-label":e("Recent logs"),"data-testid":"lg-table",role:"grid",style:Me,children:Ke.map(P=>t==="requests"?(0,r.jsx)(rt,{entry:A[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key):(0,r.jsx)(tt,{entry:$[P.index],index:P.index,measureRef:G.measureElement,onOpenTrace:_,start:P.start},P.key))})})]})]})},"Wt");export{qt as LogsPanel,ot as filterLogs,st as summarizeLogs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as q}from"./chunk-JQXA2OYK.js";import{a as F}from"./chunk-R6U22RSY.js";import{a as D}from"./chunk-YVR4SEPU.js";import"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import"./chunk-AUAECCXB.js";import{b as S}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as L}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-JQXA2OYK.js";import{a as F}from"./chunk-R6U22RSY.js";import{a as D}from"./chunk-YVR4SEPU.js";import"./chunk-ZKJS6EBE.js";import"./chunk-RGMVGZV4.js";import"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import"./chunk-AUAECCXB.js";import{b as S}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as L}from"./chunk-53NRDRMS.js";import"./chunk-NCPW7WHO.js";import"./chunk-WK5TYZAF.js";import"./chunk-55UGUCQ6.js";import{a as B}from"./chunk-4ZEL6BYL.js";import{c as _}from"./chunk-W36YKEUZ.js";import"./chunk-6L2GY26N.js";import"./chunk-QAQDMS6R.js";import"./chunk-VGL7ERWQ.js";import{a as $}from"./chunk-RWVIV3U7.js";import{a as O,b as P,c as W,d as C,e as h,f as p}from"./chunk-HCTJKP5J.js";import{a as M,e as T}from"./chunk-2IKDEUCX.js";import{d as A,m as E}from"./chunk-HJHSQPHW.js";import{a as N,d as j,f as H,g as U}from"./chunk-I26MS5PJ.js";var R=j(H(),1);var t=j(U(),1);var J=80,Z=N(a=>{if(a===void 0)return"";let e=JSON.stringify(a,E);return e.length>J?`${e.slice(0,J)}\u2026`:e},"G"),z=N(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((l,i)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${i.toString()}`,subscription:l})})}return e},"J"),w=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),ce=N(a=>{let e=(0,R.c)(22),{initialShardKey:r}=a,n=A(),{queryShardKey:l,setShardKey:i,shardKey:m}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==l?(b={keepPreviousData:!0,shardKey:l},e[1]=l,e[2]=b):b=e[2];let{data:s,error:o,errorSource:u,refetch:G}=_(B.listSubscriptions,f,b);q(G,!0);let x;if(e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==i||e[7]!==m||e[8]!==n){let k=s===void 0?[]:z(s.connections),c;e[10]!==i||e[11]!==m?(c=(0,t.jsx)(D,{onChange:i,testId:"subs-shard-input",value:m}),e[10]=i,e[11]=m,e[12]=c):c=e[12];let d;e[13]!==s||e[14]!==n?(d=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(S,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(S,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=d):d=e[15];let g;e[16]!==c||e[17]!==d?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[16]=c,e[17]=d,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==u?(v=o!==null&&(0,t.jsx)(L,{error:u,testId:"subs-error"}),e[19]=o,e[20]=u,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&s!==void 0&&k.length===0&&(0,t.jsx)($,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&k.length>0&&(0,t.jsx)(M,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(C,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(W,{children:k.map(y=>{let{subscription:I}=y,K=Z(I?.args);return(0,t.jsxs)(C,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",y.connectionId,y.admin&&(0,t.jsx)(S,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??w}),(0,t.jsx)(p,{children:I?.table??w}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||w})]},y.key)})})]})})})]}),e[3]=o,e[4]=u,e[5]=s,e[6]=i,e[7]=m,e[8]=n,e[9]=x}else x=e[9];return x},"ae");export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as R}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as B}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as S}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as q}from"./chunk-
|
|
1
|
+
import{i as R}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as B}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as S}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as q}from"./chunk-53NRDRMS.js";import"./chunk-NCPW7WHO.js";import"./chunk-WK5TYZAF.js";import"./chunk-55UGUCQ6.js";import{a as U}from"./chunk-4ZEL6BYL.js";import{c as O}from"./chunk-W36YKEUZ.js";import"./chunk-6L2GY26N.js";import"./chunk-QAQDMS6R.js";import"./chunk-VGL7ERWQ.js";import{a as D}from"./chunk-RWVIV3U7.js";import{a as G,b as J,c as K,d as F,e as s,f as o}from"./chunk-HCTJKP5J.js";import{a as V,e as W}from"./chunk-2IKDEUCX.js";import{d as P,t as H}from"./chunk-HJHSQPHW.js";import{a as n,d as j,e as re,f as ae,g as ie}from"./chunk-I26MS5PJ.js";var X=j(ae(),1),M=j(re(),1);var t=j(ie(),1);var ne=n(e=>e==="ok"?"success":e==="failed"?"destructive":e==="expired"?"warning":"secondary","te"),Q=n(e=>e.endpoint??e.id,"M"),ve=n(()=>{let e=(0,X.c)(38),r=P(),[i,Y]=(0,M.useState)("all"),[l,Z]=(0,M.useState)(""),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={},e[0]=g):g=e[0];let{data:I,error:d,errorSource:x,isLoading:_,refetch:v}=O(U.listPushSubscriptions,g),N;if(e[1]!==I?.subscriptions||e[2]!==d||e[3]!==x||e[4]!==_||e[5]!==i||e[6]!==v||e[7]!==l||e[8]!==r){let L=I?.subscriptions??[],T=l.trim().toLowerCase(),A=L.filter(a=>i!=="all"&&a.kind!==i?!1:T===""?!0:`${Q(a)} ${a.userId??""}`.toLowerCase().includes(T)),b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=n(a=>{Z(a.target.value)},"w"),e[10]=b):b=e[10];let ee=b,w;e[11]!==v?(w=n(()=>{v()},"y"),e[11]=v,e[12]=w):w=e[12];let E=w,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=["all","web-push","fcm"],e[13]=k):k=e[13];let te=k,c;e[14]!==i||e[15]!==r?(c=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"nt-kind-filter",role:"tablist",children:te.map(a=>(0,t.jsx)(B,{"aria-selected":i===a,"data-testid":`nt-kind-${a}`,onClick:n(()=>{Y(a)},"onClick"),role:"tab",size:"sm",type:"button",variant:i===a?"secondary":"ghost",children:a==="all"?r("All"):a},a))}),e[14]=i,e[15]=r,e[16]=c):c=e[16];let m;e[17]!==r?(m=r("Filter devices"),e[17]=r,e[18]=m):m=e[18];let h;e[19]!==r?(h=r("filter endpoint, user"),e[19]=r,e[20]=h):h=e[20];let u;e[21]!==l||e[22]!==m||e[23]!==h?(u=(0,t.jsx)(R,{"aria-label":m,className:"h-8 w-56","data-testid":"nt-search",onChange:ee,placeholder:h,value:l}),e[21]=l,e[22]=m,e[23]=h,e[24]=u):u=e[24];let f;e[25]!==r?(f=r("Refresh"),e[25]=r,e[26]=f):f=e[26];let p;e[27]!==E||e[28]!==f?(p=(0,t.jsx)(B,{className:"ml-auto","data-testid":"nt-refresh",onClick:E,size:"sm",type:"button",variant:"outline",children:f}),e[27]=E,e[28]=f,e[29]=p):p=e[29];let $=L.length>0&&(0,t.jsx)(S,{"data-testid":"nt-count",variant:"secondary",children:r("{count} devices",{count:L.length})}),y;e[30]!==p||e[31]!==$||e[32]!==c||e[33]!==u?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,u,p,$]}),e[30]=p,e[31]=$,e[32]=c,e[33]=u,e[34]=y):y=e[34];let C;e[35]!==d||e[36]!==x?(C=d!==null&&(0,t.jsx)(q,{error:x,testId:"nt-error"}),e[35]=d,e[36]=x,e[37]=C):C=e[37],N=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-notifications",children:[y,C,d===null&&!_&&A.length===0&&(0,t.jsx)(D,{description:r("Registered Web Push / FCM devices appear here. Configure lunora/notify.ts with defineNotify({ store }) and register a device with ctx.push.register(...)."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"})}),testId:"nt-empty",title:r("No registered devices.")}),A.length>0&&(0,t.jsx)(V,{className:"overflow-hidden py-0",children:(0,t.jsx)(W,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"nt-table",children:[(0,t.jsx)(J,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(s,{children:r("kind")}),(0,t.jsx)(s,{children:r("endpoint")}),(0,t.jsx)(s,{children:r("user")}),(0,t.jsx)(s,{children:r("last seen")}),(0,t.jsx)(s,{children:r("status")}),(0,t.jsx)(s,{children:r("error")})]})}),(0,t.jsx)(K,{children:A.map(a=>{let z=Q(a);return(0,t.jsxs)(F,{"data-testid":"nt-row",children:[(0,t.jsx)(o,{children:(0,t.jsx)(S,{variant:"outline",children:a.kind})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs",title:z,children:z}),(0,t.jsx)(o,{className:"max-w-[16ch] truncate font-mono text-xs",children:a.userId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsx)(o,{className:"text-muted-foreground tabular-nums",children:H(a.lastSeenAt,"\u2014")}),(0,t.jsx)(o,{children:(0,t.jsx)(S,{"data-testid":`nt-status-${a.id}`,variant:ne(a.lastStatus),children:a.lastStatus??r("n/a")})}),(0,t.jsx)(o,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",title:a.lastError??void 0,children:a.lastError??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},a.id)})})]})})})]}),e[1]=I?.subscriptions,e[2]=d,e[3]=x,e[4]=_,e[5]=i,e[6]=v,e[7]=l,e[8]=r,e[9]=N}else N=e[9];return N},"ge");export{ve as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as fe}from"./chunk-ECY2JC5F.js";import"./chunk-NRP22GKC.js";import{a as ie}from"./chunk-Y3AYVFTK.js";import{a as pe}from"./chunk-JQXA2OYK.js";import"./chunk-UC7MNI2F.js";import{i as de}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as b}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as ne}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as he}from"./chunk-
|
|
1
|
+
import{a as fe}from"./chunk-ECY2JC5F.js";import"./chunk-NRP22GKC.js";import{a as ie}from"./chunk-Y3AYVFTK.js";import{a as pe}from"./chunk-JQXA2OYK.js";import"./chunk-UC7MNI2F.js";import{i as de}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-7Y3SY37W.js";import{a as b}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as ne}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as he}from"./chunk-53NRDRMS.js";import"./chunk-NCPW7WHO.js";import"./chunk-WK5TYZAF.js";import"./chunk-55UGUCQ6.js";import{a as B}from"./chunk-4ZEL6BYL.js";import{c as ue}from"./chunk-W36YKEUZ.js";import{l as le}from"./chunk-6L2GY26N.js";import"./chunk-QAQDMS6R.js";import"./chunk-VGL7ERWQ.js";import{a as ce}from"./chunk-RWVIV3U7.js";import{d as oe,f as Z,g as ee,h as te,p as ae,s as me,t as re}from"./chunk-HJHSQPHW.js";import{a as i,d as Y,e as ge,f as ve,g as Ne,i as se}from"./chunk-I26MS5PJ.js";var t=Y(Ne(),1);var be=Y(ve(),1);var N=Y(ge(),1);function ye({className:a,orientation:e="horizontal",...s}){return(0,t.jsx)(ie,{"data-slot":"separator",orientation:e,className:se("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...s})}i(ye,"ge");var we=/https?:\/\/[^\s"'<>)]+/i,xe=i(a=>a===void 0?void 0:we.exec(a)?.[0],"re"),y=i(a=>a===void 0?"":Array.isArray(a)?a.join(", "):a,"N"),Ce=/<a\s(?:[^>]*?\s)?href\s*=\s*["'](https?:\/\/[^"'\s]+)["']/iu,ke=/&(?:amp|#0*38|#x0*26);/giu,Se=i(a=>a===void 0?void 0:((a.html===void 0?void 0:Ce.exec(a.html)?.[1])??xe(a.text)??xe(a.html))?.replaceAll(ke,"&"),"ye"),Te=i((a,e)=>{let s=e.trim().toLowerCase();return s===""?a:a.filter(o=>`${o.subject} ${y(o.to)} ${y(o.cc)}`.toLowerCase().includes(s))},"Ce"),Le=i((a,e)=>{if(a.length!==0)return a.find(s=>s.id===e)??a[0]},"Se"),je=Z(B.clearCapturedMail),Me=Z(B.sendTestMail),_e=i(a=>{let e=(0,be.c)(38),{limit:s}=a,o=le(),p;e[0]!==s?(p={limit:s},e[0]=s,e[1]=p):p=e[1];let{data:q,error:w,errorSource:C,isLoading:g,refetch:n}=ue(B.getCapturedMail,p),[k,f]=(0,N.useState)(null),[P,S]=(0,N.useState)(null),[v,l]=(0,N.useState)("html"),[c,D]=(0,N.useState)(""),x=q?.entries??[],r=w??k,u=w===null?k:C,T;e[2]!==o||e[3]!==n?(T=i(async()=>{f(null);try{await o.query(je,{},ee("")),S(null),n()}catch(m){f(te(m))}},"T"),e[2]=o,e[3]=n,e[4]=T):T=e[4];let Q=T,L;e[5]!==o||e[6]!==n?(L=i(async()=>{f(null);try{await o.query(Me,{},ee("")),n()}catch(m){f(te(m))}},"k"),e[5]=o,e[6]=n,e[7]=L):L=e[7];let R=L,j;e[8]!==n?(j=i(()=>{n()},"A"),e[8]=n,e[9]=j):j=e[9],pe(j,!0);let M;e[10]!==Q?(M=i(()=>{ae(Q())},"E"),e[10]=Q,e[11]=M):M=e[11];let U=M,_;e[12]!==R?(_=i(()=>{ae(R())},"L"),e[12]=R,e[13]=_):_=e[13];let W=_,z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=i(m=>{D(m.currentTarget.value)},"_"),e[14]=z):z=e[14];let G=z,$;e[15]===Symbol.for("react.memo_cache_sentinel")?($=i(m=>{let{id:h}=m.currentTarget.dataset;h!==void 0&&S(h)},"M"),e[15]=$):$=e[15];let J=$,A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=i(m=>{let h=m.currentTarget.dataset.tab;(h==="headers"||h==="html"||h==="text")&&l(h)},"I"),e[16]=A):A=e[16];let K=A,O=Te(x,c),F=Le(O,P),d=Se(F),E;e[17]!==d?(E=i(()=>{d!==void 0&&me(d)},"z"),e[17]=d,e[18]=E):E=e[18];let V=E,H;e[19]!==d?(H=i(()=>{d!==void 0&&"window"in globalThis&&globalThis.window.open(d,"_blank","noopener")},"F"),e[19]=d,e[20]=H):H=e[20];let X=H,I;return e[21]!==x||e[22]!==r||e[23]!==u||e[24]!==c||e[25]!==g||e[26]!==d||e[27]!==U||e[28]!==V||e[29]!==G||e[30]!==X||e[31]!==J||e[32]!==K||e[33]!==W||e[34]!==F||e[35]!==v||e[36]!==O?(I={entries:x,error:r,errorSource:u,filter:c,isLoading:g,link:d,onClear:U,onCopyLink:V,onFilterChange:G,onOpenLink:X,onSelectMessage:J,onSelectTab:K,onSendTest:W,selected:F,tab:v,visible:O},e[21]=x,e[22]=r,e[23]=u,e[24]=c,e[25]=g,e[26]=d,e[27]=U,e[28]=V,e[29]=G,e[30]=X,e[31]=J,e[32]=K,e[33]=W,e[34]=F,e[35]=v,e[36]=O,e[37]=I):I=e[37],I},"Ae"),ze=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data:; style-src 'unsafe-inline'; font-src data:">`,$e=i(a=>`${ze}${a}`,"Le"),Ke=i(({limit:a=100})=>{let e=oe(),{entries:s,error:o,errorSource:p,filter:q,isLoading:w,link:C,onClear:g,onCopyLink:n,onFilterChange:k,onOpenLink:f,onSelectMessage:P,onSelectTab:S,onSendTest:v,selected:l,tab:c,visible:D}=_e({limit:a}),x=i(r=>e(r==="html"?"HTML":r==="text"?"Plain text":"Headers"),"x");return(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"mail-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b,{"data-testid":"mail-send-test",onClick:v,size:"sm",type:"button",variant:"outline",children:e("Send test")}),(0,t.jsx)(b,{"data-testid":"mail-clear",disabled:s.length===0,onClick:g,size:"sm",type:"button",variant:"outline",children:e("Clear inbox")}),s.length>0&&(0,t.jsx)(ne,{className:"ml-auto","data-testid":"mail-count",variant:"secondary",children:e("{count} messages",{count:s.length})})]}),o!==null&&(0,t.jsx)(he,{error:p,testId:"mail-error"}),o===null&&!w&&s.length===0&&(0,t.jsx)(ce,{description:e("Email your app sends in dev is captured here \u2014 nothing is delivered."),icon:(0,t.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{d:"M4 5h16v14H4z"}),(0,t.jsx)("path",{d:"m4 6 8 6 8-6"})]}),testId:"mail-empty",title:e("No captured email.")}),s.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-[minmax(0,22rem)_1fr]","data-testid":"mail-reader",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(de,{"aria-label":e("Search messages"),"data-testid":"mail-search",onChange:k,placeholder:e("Filter messages"),type:"search",value:q}),(0,t.jsx)(fe,{className:"max-h-[32rem] rounded-xl border border-border bg-card shadow-xs","data-testid":"mail-list",children:(0,t.jsx)("ul",{className:"divide-y",children:D.map(r=>{let u=r.id===l?.id;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{className:`flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm hover:bg-muted/60 ${u?"bg-muted":""}`,"data-active":u,"data-id":r.id,"data-testid":"mail-list-item",onClick:P,type:"button",children:[(0,t.jsx)("span",{className:"w-full truncate font-medium",children:r.subject||e("(no subject)")}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-muted-foreground",children:y(r.to)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:re(r.capturedAt,"\u2014")})]})},r.id)})})})]}),l!==void 0&&(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4 shadow-xs","data-testid":"mail-detail",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"truncate text-base font-semibold","data-testid":"mail-subject",children:l.subject||e("(no subject)")}),(0,t.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsx)("dt",{children:e("From")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:l.from??"\u2014"}),(0,t.jsx)("dt",{children:e("To")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:y(l.to)}),l.cc!==void 0&&l.cc.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("dt",{children:e("Cc")}),(0,t.jsx)("dd",{className:"truncate font-mono",children:y(l.cc)})]}),(0,t.jsx)("dt",{children:e("Sent")}),(0,t.jsx)("dd",{className:"tabular-nums",children:re(l.capturedAt,"\u2014")})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"mail-actions",children:[(0,t.jsx)(b,{"data-testid":"mail-copy-link",disabled:C===void 0,onClick:n,size:"sm",type:"button",variant:"outline",children:e("Copy link")}),(0,t.jsx)(b,{"data-testid":"mail-open-link",disabled:C===void 0,onClick:f,size:"sm",type:"button",variant:"outline",children:e("Open in new tab")})]}),(0,t.jsx)(ye,{}),(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"mail-tabs",role:"tablist",children:["html","text","headers"].map(r=>(0,t.jsx)(b,{"aria-selected":c===r,"data-tab":r,"data-testid":`mail-tab-${r}`,onClick:S,role:"tab",size:"sm",type:"button",variant:c===r?"secondary":"ghost",children:x(r)},r))}),(0,t.jsxs)("div",{className:"min-h-[12rem]",children:[c==="html"&&(l.html===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No HTML body.")}):(0,t.jsx)("iframe",{className:"h-[24rem] w-full rounded-md border bg-white","data-testid":"mail-preview-html",sandbox:"",srcDoc:$e(l.html),title:e("Email preview")})),c==="text"&&(l.text===void 0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No text body.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-text",children:l.text})),c==="headers"&&(l.headers===void 0||Object.keys(l.headers).length===0?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("No headers.")}):(0,t.jsx)("pre",{className:"overflow-auto whitespace-pre-wrap rounded-md border bg-muted/30 p-3 text-xs","data-testid":"mail-preview-headers",children:Object.entries(l.headers).map(([r,u])=>`${r}: ${u}`).join(`
|
|
2
2
|
`)}))]})]})]})]})},"Qe");export{Ke as MailPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as gn,b as $e,e as Vr,f as zr}from"./chunk-NDTQTKDX.js";import{a as Tr,b as pt,c as Er,d as fn}from"./chunk-FUGLFWLW.js";import{a as mn}from"./chunk-S4Z7K55A.js";import{b as dn}from"./chunk-5B2RTXBS.js";import{d as $r}from"./chunk-UYEZR3BI.js";import{a as un}from"./chunk-Q6IT6ZD7.js";import{a as Le}from"./chunk-CGQMJYCW.js";import"./chunk-NQZALRU3.js";import"./chunk-OPM7ESDV.js";import"./chunk-Y3AYVFTK.js";import{a as cn}from"./chunk-7RKB5KS7.js";import{a as Ht}from"./chunk-QJLHH3ET.js";import{a as so}from"./chunk-37WYCOQ2.js";import{a as sn}from"./chunk-Z22BDS6N.js";import{a as Or}from"./chunk-JQXA2OYK.js";import{b as yr,c as oo}from"./chunk-CCDX5RYT.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import{a as io}from"./chunk-IWZ7GVQO.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import{a as ao}from"./chunk-XHRKNCCI.js";import{a as Mr}from"./chunk-YVR4SEPU.js";import{a as Ir,b as Fr}from"./chunk-ZKJS6EBE.js";import{b as vr,c as Rr,f as ro}from"./chunk-RGMVGZV4.js";import{c as br,d as hr,e as wr,f as it,g as on,h as xr,i as Sr}from"./chunk-OQ6I6OXT.js";import{i as _r}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import{a as rn}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import"./chunk-BOMPSVRC.js";import{a as _e}from"./chunk-4ZEL6BYL.js";import{b as no,c as ct}from"./chunk-M2FQTDR4.js";import{b as Zn,c as eo,d as nn,e as pr,l as nt}from"./chunk-AV7OEKJ6.js";import"./chunk-QAQDMS6R.js";import"./chunk-VGL7ERWQ.js";import{a as ln}from"./chunk-RWVIV3U7.js";import{a as kr,b as Pr,c as Nr,d as lo,e as Dr,f as Ar}from"./chunk-HCTJKP5J.js";import{d as oe,f as Ve,g as ze,h as $t,m as to,n as an,o as Te,p as re,t as Cr}from"./chunk-HJHSQPHW.js";import{a as o,d as Me,e as gt,f as Vt,g as zt,i as ft}from"./chunk-I26MS5PJ.js";var Os=Me(Vt(),1);var Ot=Me(gt(),1);var q=Me(Vt(),1);var D=Me(gt(),1);var Rt=Me(Vt(),1);var Y=Me(zt(),1),ot=Me(gt(),1);var mi=2166136261,gi=16777619,fi=o((t,e=mi)=>{let n=e;for(let l=0;l<t.length;l+=1)n^=t.charCodeAt(l),n=Math.imul(n,gi);return(n>>>0).toString(16).padStart(8,"0")},"I"),pi=/([a-z\d])([A-Z])/gu,bi=/[\s_-]+/u,hi=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),wi=o(t=>{let e=t.replaceAll(pi,"$1 $2").split(bi).map(l=>l.toLowerCase()).filter(l=>l.length>0),n=new Set(e);for(let l=0;l<e.length-1;l+=1){let r=e[l],a=e[l+1];r===void 0||a===void 0||(n.add(`${r}${a}`),n.add(`${r}_${a}`))}return[...n]},"le"),Hr="\u2022\u2022\u2022",Kr=o((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:fi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):Hr}catch{return Hr}},"W"),Lr=o((t,e)=>{let n=new Map;for(let l of t)l.table===e&&n.set(l.column,l.strategy);return n},"j"),xi=o(t=>{for(let e of wi(t))if(hi.has(e))return!0;return!1},"ae"),jr=o((t,e)=>{let n=e.filter(r=>!t.has(r)&&xi(r));if(n.length===0)return t;let l=new Map(t);for(let r of n)l.set(r,"redact");return l},"z"),Lt=o((t,e,n)=>{if(!n.enabled)return t;let l=n.columns.get(e);return l===void 0?t:Kr(t,l)},"Ce"),pn=o((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let n={...t};for(let[l,r]of e.columns)l in n&&(n[l]=Kr(n[l],r));return n},"ce"),bn=o((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>pn(n,e)),"Fe"),Br=o(t=>t==null?"\u2205":t===""?"(empty)":Te(t),"B"),Si=o(t=>{let e=(0,Rt.c)(32),{column:n,onFacetFilter:l,state:r}=t,a=oe(),s;e[0]!==n||e[1]!==l||e[2]!==r.result?.values?(s=o(w=>{let _=Number(w.currentTarget.dataset.index),S=r.result?.values[_];S!==void 0&&l(n,S.value)},"x"),e[0]=n,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let i=s,c=`db-facet-${n}`,u;e[4]!==n?(u=(0,Y.jsx)("span",{className:"font-medium text-foreground",children:n}),e[4]=n,e[5]=u):u=e[5];let d;e[6]!==r.loading||e[7]!==r.result||e[8]!==a?(d=r.loading&&r.result===null&&(0,Y.jsx)("span",{className:"text-muted-foreground",children:a("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=a,e[9]=d):d=e[9];let g;e[10]!==r.error?(g=r.error!==null&&(0,Y.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=g):g=e[11];let m;e[12]!==r.result?.values?(m=r.result?.values??[],e[12]=r.result?.values,e[13]=m):m=e[13];let h;if(e[14]!==n||e[15]!==i||e[16]!==m){let w;e[18]!==n||e[19]!==i?(w=o((_,S)=>(0,Y.jsxs)("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":S,"data-testid":`db-facet-value-${n}`,onClick:i,type:"button",children:[(0,Y.jsx)("span",{className:"truncate",children:Br(_.value)}),(0,Y.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:_.count})]},Br(_.value)),"c"),e[18]=n,e[19]=i,e[20]=w):w=e[20],h=m.map(w),e[14]=n,e[15]=i,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==n||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,Y.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${n}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=n,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,Y.jsxs)("section",{className:"flex flex-col gap-1","data-testid":c,children:[u,d,g,h,p]}),e[25]=c,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ie"),hn=o(t=>{let e=(0,Rt.c)(44),{columns:n,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,i=oe(),c;e[0]!==s?(c=o(y=>{let{column:M}=y.currentTarget.dataset;M!==void 0&&s(M)},"o"),e[0]=s,e[1]=c):c=e[1];let u=c,d;e[2]!==r?(d=o(y=>r.enabled&&r.columns.has(y),"a"),e[2]=r,e[3]=d):d=e[3];let g=d,m,h,p,b,w,_,S,v;if(e[4]!==n||e[5]!==l||e[6]!==g||e[7]!==i||e[8]!==u){v=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==g?(y=o(N=>!g(N),"y"),e[17]=g,e[18]=y):y=e[18];let M=n.filter(y),F;if(e[19]!==l||e[20]!==g?(F=Object.entries(l).filter(N=>{let[A]=N;return!g(A)}),e[19]=l,e[20]=g,e[21]=F):F=e[21],m=F,M.length===0){v=null;break e}_="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",S="db-facets",b="flex flex-col gap-1.5";let P;e[22]!==i?(P=i("Facets"),e[22]=i,e[23]=P):P=e[23],e[24]!==P?(w=(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:P}),e[24]=P,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let k;e[26]!==l||e[27]!==u?(k=o(N=>(0,Y.jsx)("button",{"aria-pressed":N in l,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":N,"data-testid":`db-facet-toggle-${N}`,onClick:u,type:"button",children:N},N),"A"),e[26]=l,e[27]=u,e[28]=k):k=e[28],p=M.map(k)}e[4]=n,e[5]=l,e[6]=g,e[7]=i,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=_,e[15]=S,e[16]=v}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],_=e[14],S=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let I;e[29]!==h||e[30]!==p?(I=(0,Y.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=I):I=e[31];let C;e[32]!==I||e[33]!==b||e[34]!==w?(C=(0,Y.jsxs)("div",{className:b,children:[w,I]}),e[32]=I,e[33]=b,e[34]=w,e[35]=C):C=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(y=>{let[M,F]=y;return(0,Y.jsx)(Si,{column:M,onFacetFilter:a,state:F},M)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let x;return e[39]!==C||e[40]!==R||e[41]!==_||e[42]!==S?(x=(0,Y.jsxs)("aside",{className:_,"data-testid":S,children:[C,R]}),e[39]=C,e[40]=R,e[41]=_,e[42]=S,e[43]=x):x=e[43],x},"_e"),wn=o(()=>{let[t,e]=(0,ot.useState)({}),n=Le(t),l=(0,ot.useRef)({}),r=o(async(a,s)=>{let i=(l.current[a]??0)+1;l.current[a]=i,e(c=>a in c?{...c,[a]:{error:null,loading:!0,result:c[a]?.result??null}}:c);try{let c=await s(a);if(l.current[a]!==i)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:c}}:u)}catch(c){if(l.current[a]!==i)return;e(u=>a in u?{...u,[a]:{error:$t(c),loading:!1,result:null}}:u)}},"n");return{clearFacets:o(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:o(a=>{for(let s of Object.keys(n.current))re(r(s,a))},"refetchFacets"),toggleFacet:o((a,s)=>{if(a in n.current){e(i=>Object.fromEntries(Object.entries(i).filter(([c])=>c!==a)));return}e(i=>({...i,[a]:{error:null,loading:!0,result:null}})),s!==null&&re(r(a,s))},"toggleFacet")}},"Me"),_i=[],Ci=o(()=>{let t=(0,Rt.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:n}=ct(_e.maskPolicies,e);return Array.isArray(n?.columns)?n.columns:_i},"de"),xn=o(t=>{let e=(0,Rt.c)(16),{columns:n,selectedTable:l}=t,r=Ci(),[a,s]=(0,ot.useState)(!0),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(()=>{s(yi)},"g"),e[0]=i):i=e[0];let c=i,u;if(e[1]!==n||e[2]!==r||e[3]!==l){let b=Lr(r,l??"");u=jr(b,n),e[1]=n,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=o((b,w)=>({columns:jr(Lr(r,b),w),enabled:a}),"l"),e[5]=a,e[6]=r,e[7]=g):g=e[7];let m=g,h;e[8]!==d||e[9]!==a?(h={columns:d,enabled:a},e[8]=d,e[9]=a,e[10]=h):h=e[10];let p;return e[11]!==d||e[12]!==a||e[13]!==m||e[14]!==h?(p={maskColumns:d,maskOn:a,maskView:h,maskViewFor:m,onToggleMask:c},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Te");function yi(t){return!t}o(yi,"fe");var Gr=34,qr=600,vi=o(t=>{let e=(0,Rt.c)(21),{item:n,onSelect:l,prefix:r,selected:a,start:s}=t,i;e[0]!==n.name||e[1]!==l?(i=o(()=>{l(n.name)},"g"),e[0]=n.name,e[1]=l,e[2]=i):i=e[2];let c=i,u=`translateY(${String(s)}px)`,d;e[3]!==u?(d={insetInline:0,position:"absolute",top:0,transform:u},e[3]=u,e[4]=d):d=e[4];let g=d,m=a?"bg-accent font-medium text-accent-foreground":"text-foreground",h;e[5]!==m?(h=ft("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",m),e[5]=m,e[6]=h):h=e[6];let p=`${r}-table-${n.name}`,b;e[7]!==n.name?(b=(0,Y.jsx)("span",{className:"truncate",children:n.name}),e[7]=n.name,e[8]=b):b=e[8];let w;e[9]!==n.rowCount?(w=(0,Y.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:n.rowCount}),e[9]=n.rowCount,e[10]=w):w=e[10];let _;e[11]!==c||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(_=(0,Y.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:c,type:"button",children:[b,w]}),e[11]=c,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=_):_=e[17];let S;return e[18]!==g||e[19]!==_?(S=(0,Y.jsx)("li",{style:g,children:_}),e[18]=g,e[19]=_,e[20]=S):S=e[20],S},"me"),Sn=o(({header:t,onReload:e,onSelect:n,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let i=oe(),[c,u]=(0,ot.useState)(""),d=(0,ot.useRef)(null),g=o(b=>{u(b.target.value)},"l"),m=(0,ot.useMemo)(()=>{let b=c.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[c,s]),h=dn({count:m.length,estimateSize:o(()=>Gr,"estimateSize"),getScrollElement:o(()=>d.current,"getScrollElement"),initialRect:{height:qr,width:240},observeElementRect:o((b,w)=>mn(b,w,qr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Gr};return(0,Y.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${l}-table-list`,children:[t,(0,Y.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:i("Tables")}),e!==void 0&&(0,Y.jsx)("button",{"aria-label":r??i("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${l}-load-tables`,onClick:e,title:r??i("Refresh"),type:"button",children:(0,Y.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,Y.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})})})]}),(0,Y.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,Y.jsx)("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${l}-table-search`,onChange:g,placeholder:i("search table\u2026"),type:"search",value:c})}),(0,Y.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,Y.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,Y.jsx)(vi,{item:w,onSelect:n,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"$e");var f=Me(zt(),1);var Ur=Me(gt(),1);function Ri(t){return Ii(t)||typeof t=="function"||Fi(t)}o(Ri,"isReactComponent");function Ii(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}o(Ii,"isClassComponent");function Fi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}o(Fi,"isExoticComponent");function bt(t,e){return t==null?null:Ri(t)?Ur.default.createElement(t,e):t}o(bt,"flexRender");function co(t){if("cell"in t&&t.cell){let e=t.cell,n=e.column.columnDef,l=e,r=n;return l.getIsAggregated?.()?bt(r.aggregatedCell??n.cell,e.getContext()):l.getIsPlaceholder?.()?null:bt(n.cell,e.getContext())}return"header"in t&&t.header?bt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?bt(t.footer.column.columnDef.footer,t.footer.getContext()):null}o(co,"FlexRender");function Jr(t){let e=on(t.source,t.selector,{compare:it});return typeof t.children=="function"?t.children(e):t.children}o(Jr,"Subscribe");function Wr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}o(Wr,"atomToStore");function uo(t){let{createAtom:e,batch:n}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:n,untrack:o(r=>r(),"untrack"),createReadonlyAtom:o((r,a)=>{let s=a?.compare??Object.is,i=!1,c,u=o(()=>{let g=r();return(!i||!s(c,g))&&(c=g,i=!0),c},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:o((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:o(()=>{l.set(r=>r+1)},"commit")}}o(uo,"renderPhaseReactivity");function mo(t,e=Object.is){let n=!1,l;return{get:t.get,markCommitted:o(r=>{l=r,n=!0},"markCommitted"),subscribe:o(r=>t.subscribe(a=>{(!n||!e(l,a))&&r(a)}),"subscribe")}}o(mo,"createRenderPhaseSource");function Qr(){return uo({createAtom:wr,batch:hr})}o(Qr,"reactReactivity");function It(t,e){return typeof t=="function"?t(e):t}o(It,"functionalUpdate");function ie(t){if(Array.isArray(t))return t.map(ie);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let n=e===null?H():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(n,a,{configurable:!0,enumerable:!0,value:ie(t[a]),writable:!0})}return n}return t}o(ie,"cloneState");function _n(t,e){let n=Object.keys(e),l=t;for(let r=0;r<n.length;r++){let a=n[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}o(_n,"copyInstancePropertiesWithoutMemos");function H(){return Object.create(null)}o(H,"makeObjectMap");function je(t,e){return Object.prototype.hasOwnProperty.call(t,e)}o(je,"hasOwn");function Be(t,e){return n=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>It(n,l))}}o(Be,"makeStateUpdater");function Xr(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}o(Xr,"isPlainContainer");function Yr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}o(Yr,"getEnumerableOwnKeys");var Mi=3;function ki(t,e){return Zr(t,e,Mi)}o(ki,"stateSlicesEqual");function Zr(t,e,n){if(Object.is(t,e))return!0;if(n<=0||!Xr(t)||!Xr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Yr(t),r=Yr(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let i=0;i<l.length;i++){let c=l[i];if(!Object.prototype.propertyIsEnumerable.call(e,c)||!Zr(a[c],s[c],n-1))return!1}return!0}o(Zr,"stateSlicesEqualAtDepth");function He(t,e,n,l=ki){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let i=It(n,s);return l(s,i)?s:i})}o(He,"setStateSlice");function el(t){return t instanceof Function}o(el,"isFunction");function tl(t,e){let n=[],l=o(r=>{r.forEach(a=>{n.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),n}o(tl,"flattenBy");var Pi=o(({fn:t,memoDeps:e,onAfterCompare:n,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],i;return o(u=>{r?.();let d=e?.(u),g=!d||d.length!==s?.length;if(!g&&d){for(let m=0;m<d.length;m++)if(d[m]!==s[m]){g=!0;break}}return n?.(g),g&&(s=d,a?.(),i=t(...d??[]),l?.(i)),i},"memoizedFn")},"memo");function Cn(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}o(Cn,"skipFirstRun");var Ni=o((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function Ft({feature:t,fnName:e,objectId:n,onAfterUpdate:l,table:r,...a}){let s,i,c=0,u;function d(h,p){let b=c===0?"(1st run)":p?"(rerun #"+c+")":"(cache)";c++,console.groupCollapsed(`%c\u23F1 ${Ni(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${n?`(${e.split(".")[0]}Id: ${n})`:""}`,`font-size: .6rem; font-weight: bold; ${p?`color: hsl(
|
|
1
|
+
import{a as gn,b as $e,e as Vr,f as zr}from"./chunk-NDTQTKDX.js";import{a as Tr,b as pt,c as Er,d as fn}from"./chunk-NNSCCLU4.js";import{a as mn}from"./chunk-S4Z7K55A.js";import{b as dn}from"./chunk-5B2RTXBS.js";import{d as $r}from"./chunk-UYEZR3BI.js";import{a as un}from"./chunk-Q6IT6ZD7.js";import{a as Le}from"./chunk-CGQMJYCW.js";import"./chunk-NQZALRU3.js";import"./chunk-OPM7ESDV.js";import"./chunk-Y3AYVFTK.js";import{a as cn}from"./chunk-7RKB5KS7.js";import{a as Ht}from"./chunk-QJLHH3ET.js";import{a as so}from"./chunk-37WYCOQ2.js";import{a as sn}from"./chunk-Z22BDS6N.js";import{a as Or}from"./chunk-JQXA2OYK.js";import{b as yr,c as oo}from"./chunk-CCDX5RYT.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import{a as io}from"./chunk-IWZ7GVQO.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import{a as ao}from"./chunk-XHRKNCCI.js";import{a as Mr}from"./chunk-YVR4SEPU.js";import{a as Ir,b as Fr}from"./chunk-ZKJS6EBE.js";import{b as vr,c as Rr,f as ro}from"./chunk-RGMVGZV4.js";import{c as br,d as hr,e as wr,f as it,g as on,h as xr,i as Sr}from"./chunk-OQ6I6OXT.js";import{i as _r}from"./chunk-E4PXACVL.js";import"./chunk-MVWZMWPD.js";import"./chunk-SJQERRSZ.js";import"./chunk-7Y3SY37W.js";import{a as rn}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import"./chunk-BOMPSVRC.js";import{a as _e}from"./chunk-4ZEL6BYL.js";import{b as no,c as ct}from"./chunk-W36YKEUZ.js";import{b as Zn,c as eo,d as nn,e as pr,l as nt}from"./chunk-6L2GY26N.js";import"./chunk-QAQDMS6R.js";import"./chunk-VGL7ERWQ.js";import{a as ln}from"./chunk-RWVIV3U7.js";import{a as kr,b as Pr,c as Nr,d as lo,e as Dr,f as Ar}from"./chunk-HCTJKP5J.js";import{d as oe,f as Ve,g as ze,h as $t,m as to,n as an,o as Te,p as re,t as Cr}from"./chunk-HJHSQPHW.js";import{a as o,d as Me,e as gt,f as Vt,g as zt,i as ft}from"./chunk-I26MS5PJ.js";var Os=Me(Vt(),1);var Ot=Me(gt(),1);var q=Me(Vt(),1);var D=Me(gt(),1);var Rt=Me(Vt(),1);var Y=Me(zt(),1),ot=Me(gt(),1);var mi=2166136261,gi=16777619,fi=o((t,e=mi)=>{let n=e;for(let l=0;l<t.length;l+=1)n^=t.charCodeAt(l),n=Math.imul(n,gi);return(n>>>0).toString(16).padStart(8,"0")},"I"),pi=/([a-z\d])([A-Z])/gu,bi=/[\s_-]+/u,hi=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),wi=o(t=>{let e=t.replaceAll(pi,"$1 $2").split(bi).map(l=>l.toLowerCase()).filter(l=>l.length>0),n=new Set(e);for(let l=0;l<e.length-1;l+=1){let r=e[l],a=e[l+1];r===void 0||a===void 0||(n.add(`${r}${a}`),n.add(`${r}_${a}`))}return[...n]},"le"),Hr="\u2022\u2022\u2022",Kr=o((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:fi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):Hr}catch{return Hr}},"W"),Lr=o((t,e)=>{let n=new Map;for(let l of t)l.table===e&&n.set(l.column,l.strategy);return n},"j"),xi=o(t=>{for(let e of wi(t))if(hi.has(e))return!0;return!1},"ae"),jr=o((t,e)=>{let n=e.filter(r=>!t.has(r)&&xi(r));if(n.length===0)return t;let l=new Map(t);for(let r of n)l.set(r,"redact");return l},"z"),Lt=o((t,e,n)=>{if(!n.enabled)return t;let l=n.columns.get(e);return l===void 0?t:Kr(t,l)},"Ce"),pn=o((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let n={...t};for(let[l,r]of e.columns)l in n&&(n[l]=Kr(n[l],r));return n},"ce"),bn=o((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>pn(n,e)),"Fe"),Br=o(t=>t==null?"\u2205":t===""?"(empty)":Te(t),"B"),Si=o(t=>{let e=(0,Rt.c)(32),{column:n,onFacetFilter:l,state:r}=t,a=oe(),s;e[0]!==n||e[1]!==l||e[2]!==r.result?.values?(s=o(w=>{let _=Number(w.currentTarget.dataset.index),S=r.result?.values[_];S!==void 0&&l(n,S.value)},"x"),e[0]=n,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let i=s,c=`db-facet-${n}`,u;e[4]!==n?(u=(0,Y.jsx)("span",{className:"font-medium text-foreground",children:n}),e[4]=n,e[5]=u):u=e[5];let d;e[6]!==r.loading||e[7]!==r.result||e[8]!==a?(d=r.loading&&r.result===null&&(0,Y.jsx)("span",{className:"text-muted-foreground",children:a("Loading\u2026")}),e[6]=r.loading,e[7]=r.result,e[8]=a,e[9]=d):d=e[9];let g;e[10]!==r.error?(g=r.error!==null&&(0,Y.jsx)("span",{className:"text-destructive",role:"alert",children:r.error}),e[10]=r.error,e[11]=g):g=e[11];let m;e[12]!==r.result?.values?(m=r.result?.values??[],e[12]=r.result?.values,e[13]=m):m=e[13];let h;if(e[14]!==n||e[15]!==i||e[16]!==m){let w;e[18]!==n||e[19]!==i?(w=o((_,S)=>(0,Y.jsxs)("button",{className:"flex items-center justify-between gap-2 rounded px-1 py-0.5 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground","data-index":S,"data-testid":`db-facet-value-${n}`,onClick:i,type:"button",children:[(0,Y.jsx)("span",{className:"truncate",children:Br(_.value)}),(0,Y.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:_.count})]},Br(_.value)),"c"),e[18]=n,e[19]=i,e[20]=w):w=e[20],h=m.map(w),e[14]=n,e[15]=i,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==n||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,Y.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${n}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=n,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,Y.jsxs)("section",{className:"flex flex-col gap-1","data-testid":c,children:[u,d,g,h,p]}),e[25]=c,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ie"),hn=o(t=>{let e=(0,Rt.c)(44),{columns:n,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,i=oe(),c;e[0]!==s?(c=o(y=>{let{column:M}=y.currentTarget.dataset;M!==void 0&&s(M)},"o"),e[0]=s,e[1]=c):c=e[1];let u=c,d;e[2]!==r?(d=o(y=>r.enabled&&r.columns.has(y),"a"),e[2]=r,e[3]=d):d=e[3];let g=d,m,h,p,b,w,_,S,v;if(e[4]!==n||e[5]!==l||e[6]!==g||e[7]!==i||e[8]!==u){v=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==g?(y=o(N=>!g(N),"y"),e[17]=g,e[18]=y):y=e[18];let M=n.filter(y),F;if(e[19]!==l||e[20]!==g?(F=Object.entries(l).filter(N=>{let[A]=N;return!g(A)}),e[19]=l,e[20]=g,e[21]=F):F=e[21],m=F,M.length===0){v=null;break e}_="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",S="db-facets",b="flex flex-col gap-1.5";let P;e[22]!==i?(P=i("Facets"),e[22]=i,e[23]=P):P=e[23],e[24]!==P?(w=(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:P}),e[24]=P,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let k;e[26]!==l||e[27]!==u?(k=o(N=>(0,Y.jsx)("button",{"aria-pressed":N in l,className:"rounded border border-border px-1.5 py-0.5 text-muted-foreground transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-column":N,"data-testid":`db-facet-toggle-${N}`,onClick:u,type:"button",children:N},N),"A"),e[26]=l,e[27]=u,e[28]=k):k=e[28],p=M.map(k)}e[4]=n,e[5]=l,e[6]=g,e[7]=i,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=_,e[15]=S,e[16]=v}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],_=e[14],S=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let I;e[29]!==h||e[30]!==p?(I=(0,Y.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=I):I=e[31];let C;e[32]!==I||e[33]!==b||e[34]!==w?(C=(0,Y.jsxs)("div",{className:b,children:[w,I]}),e[32]=I,e[33]=b,e[34]=w,e[35]=C):C=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(y=>{let[M,F]=y;return(0,Y.jsx)(Si,{column:M,onFacetFilter:a,state:F},M)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let x;return e[39]!==C||e[40]!==R||e[41]!==_||e[42]!==S?(x=(0,Y.jsxs)("aside",{className:_,"data-testid":S,children:[C,R]}),e[39]=C,e[40]=R,e[41]=_,e[42]=S,e[43]=x):x=e[43],x},"_e"),wn=o(()=>{let[t,e]=(0,ot.useState)({}),n=Le(t),l=(0,ot.useRef)({}),r=o(async(a,s)=>{let i=(l.current[a]??0)+1;l.current[a]=i,e(c=>a in c?{...c,[a]:{error:null,loading:!0,result:c[a]?.result??null}}:c);try{let c=await s(a);if(l.current[a]!==i)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:c}}:u)}catch(c){if(l.current[a]!==i)return;e(u=>a in u?{...u,[a]:{error:$t(c),loading:!1,result:null}}:u)}},"n");return{clearFacets:o(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:o(a=>{for(let s of Object.keys(n.current))re(r(s,a))},"refetchFacets"),toggleFacet:o((a,s)=>{if(a in n.current){e(i=>Object.fromEntries(Object.entries(i).filter(([c])=>c!==a)));return}e(i=>({...i,[a]:{error:null,loading:!0,result:null}})),s!==null&&re(r(a,s))},"toggleFacet")}},"Me"),_i=[],Ci=o(()=>{let t=(0,Rt.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:n}=ct(_e.maskPolicies,e);return Array.isArray(n?.columns)?n.columns:_i},"de"),xn=o(t=>{let e=(0,Rt.c)(16),{columns:n,selectedTable:l}=t,r=Ci(),[a,s]=(0,ot.useState)(!0),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(()=>{s(yi)},"g"),e[0]=i):i=e[0];let c=i,u;if(e[1]!==n||e[2]!==r||e[3]!==l){let b=Lr(r,l??"");u=jr(b,n),e[1]=n,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=o((b,w)=>({columns:jr(Lr(r,b),w),enabled:a}),"l"),e[5]=a,e[6]=r,e[7]=g):g=e[7];let m=g,h;e[8]!==d||e[9]!==a?(h={columns:d,enabled:a},e[8]=d,e[9]=a,e[10]=h):h=e[10];let p;return e[11]!==d||e[12]!==a||e[13]!==m||e[14]!==h?(p={maskColumns:d,maskOn:a,maskView:h,maskViewFor:m,onToggleMask:c},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Te");function yi(t){return!t}o(yi,"fe");var Gr=34,qr=600,vi=o(t=>{let e=(0,Rt.c)(21),{item:n,onSelect:l,prefix:r,selected:a,start:s}=t,i;e[0]!==n.name||e[1]!==l?(i=o(()=>{l(n.name)},"g"),e[0]=n.name,e[1]=l,e[2]=i):i=e[2];let c=i,u=`translateY(${String(s)}px)`,d;e[3]!==u?(d={insetInline:0,position:"absolute",top:0,transform:u},e[3]=u,e[4]=d):d=e[4];let g=d,m=a?"bg-accent font-medium text-accent-foreground":"text-foreground",h;e[5]!==m?(h=ft("flex w-full items-center justify-between gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent",m),e[5]=m,e[6]=h):h=e[6];let p=`${r}-table-${n.name}`,b;e[7]!==n.name?(b=(0,Y.jsx)("span",{className:"truncate",children:n.name}),e[7]=n.name,e[8]=b):b=e[8];let w;e[9]!==n.rowCount?(w=(0,Y.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:n.rowCount}),e[9]=n.rowCount,e[10]=w):w=e[10];let _;e[11]!==c||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(_=(0,Y.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:c,type:"button",children:[b,w]}),e[11]=c,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=_):_=e[17];let S;return e[18]!==g||e[19]!==_?(S=(0,Y.jsx)("li",{style:g,children:_}),e[18]=g,e[19]=_,e[20]=S):S=e[20],S},"me"),Sn=o(({header:t,onReload:e,onSelect:n,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let i=oe(),[c,u]=(0,ot.useState)(""),d=(0,ot.useRef)(null),g=o(b=>{u(b.target.value)},"l"),m=(0,ot.useMemo)(()=>{let b=c.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[c,s]),h=dn({count:m.length,estimateSize:o(()=>Gr,"estimateSize"),getScrollElement:o(()=>d.current,"getScrollElement"),initialRect:{height:qr,width:240},observeElementRect:o((b,w)=>mn(b,w,qr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Gr};return(0,Y.jsxs)("aside",{className:"flex h-full w-60 shrink-0 flex-col border-e border-border bg-sidebar","data-testid":`${l}-table-list`,children:[t,(0,Y.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,Y.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:i("Tables")}),e!==void 0&&(0,Y.jsx)("button",{"aria-label":r??i("Refresh"),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":`${l}-load-tables`,onClick:e,title:r??i("Refresh"),type:"button",children:(0,Y.jsx)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,Y.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})})})]}),(0,Y.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,Y.jsx)("input",{className:"h-7 w-full rounded-md border border-border bg-background px-2 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring","data-testid":`${l}-table-search`,onChange:g,placeholder:i("search table\u2026"),type:"search",value:c})}),(0,Y.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,Y.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,Y.jsx)(vi,{item:w,onSelect:n,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"$e");var f=Me(zt(),1);var Ur=Me(gt(),1);function Ri(t){return Ii(t)||typeof t=="function"||Fi(t)}o(Ri,"isReactComponent");function Ii(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}o(Ii,"isClassComponent");function Fi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}o(Fi,"isExoticComponent");function bt(t,e){return t==null?null:Ri(t)?Ur.default.createElement(t,e):t}o(bt,"flexRender");function co(t){if("cell"in t&&t.cell){let e=t.cell,n=e.column.columnDef,l=e,r=n;return l.getIsAggregated?.()?bt(r.aggregatedCell??n.cell,e.getContext()):l.getIsPlaceholder?.()?null:bt(n.cell,e.getContext())}return"header"in t&&t.header?bt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?bt(t.footer.column.columnDef.footer,t.footer.getContext()):null}o(co,"FlexRender");function Jr(t){let e=on(t.source,t.selector,{compare:it});return typeof t.children=="function"?t.children(e):t.children}o(Jr,"Subscribe");function Wr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}o(Wr,"atomToStore");function uo(t){let{createAtom:e,batch:n}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:o(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:n,untrack:o(r=>r(),"untrack"),createReadonlyAtom:o((r,a)=>{let s=a?.compare??Object.is,i=!1,c,u=o(()=>{let g=r();return(!i||!s(c,g))&&(c=g,i=!0),c},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:o((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:o(()=>{l.set(r=>r+1)},"commit")}}o(uo,"renderPhaseReactivity");function mo(t,e=Object.is){let n=!1,l;return{get:t.get,markCommitted:o(r=>{l=r,n=!0},"markCommitted"),subscribe:o(r=>t.subscribe(a=>{(!n||!e(l,a))&&r(a)}),"subscribe")}}o(mo,"createRenderPhaseSource");function Qr(){return uo({createAtom:wr,batch:hr})}o(Qr,"reactReactivity");function It(t,e){return typeof t=="function"?t(e):t}o(It,"functionalUpdate");function ie(t){if(Array.isArray(t))return t.map(ie);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let n=e===null?H():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(n,a,{configurable:!0,enumerable:!0,value:ie(t[a]),writable:!0})}return n}return t}o(ie,"cloneState");function _n(t,e){let n=Object.keys(e),l=t;for(let r=0;r<n.length;r++){let a=n[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}o(_n,"copyInstancePropertiesWithoutMemos");function H(){return Object.create(null)}o(H,"makeObjectMap");function je(t,e){return Object.prototype.hasOwnProperty.call(t,e)}o(je,"hasOwn");function Be(t,e){return n=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>It(n,l))}}o(Be,"makeStateUpdater");function Xr(t){if(typeof t!="object"||t===null)return!1;if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}o(Xr,"isPlainContainer");function Yr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}o(Yr,"getEnumerableOwnKeys");var Mi=3;function ki(t,e){return Zr(t,e,Mi)}o(ki,"stateSlicesEqual");function Zr(t,e,n){if(Object.is(t,e))return!0;if(n<=0||!Xr(t)||!Xr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Yr(t),r=Yr(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let i=0;i<l.length;i++){let c=l[i];if(!Object.prototype.propertyIsEnumerable.call(e,c)||!Zr(a[c],s[c],n-1))return!1}return!0}o(Zr,"stateSlicesEqualAtDepth");function He(t,e,n,l=ki){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let i=It(n,s);return l(s,i)?s:i})}o(He,"setStateSlice");function el(t){return t instanceof Function}o(el,"isFunction");function tl(t,e){let n=[],l=o(r=>{r.forEach(a=>{n.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),n}o(tl,"flattenBy");var Pi=o(({fn:t,memoDeps:e,onAfterCompare:n,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],i;return o(u=>{r?.();let d=e?.(u),g=!d||d.length!==s?.length;if(!g&&d){for(let m=0;m<d.length;m++)if(d[m]!==s[m]){g=!0;break}}return n?.(g),g&&(s=d,a?.(),i=t(...d??[]),l?.(i)),i},"memoizedFn")},"memo");function Cn(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}o(Cn,"skipFirstRun");var Ni=o((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function Ft({feature:t,fnName:e,objectId:n,onAfterUpdate:l,table:r,...a}){let s,i,c=0,u;function d(h,p){let b=c===0?"(1st run)":p?"(rerun #"+c+")":"(cache)";c++,console.groupCollapsed(`%c\u23F1 ${Ni(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${n?`(${e.split(".")[0]}Id: ${n})`:""}`,`font-size: .6rem; font-weight: bold; ${p?`color: hsl(
|
|
2
2
|
${Math.max(0,Math.min(120-Math.log10(h)*60,120))}deg 100% 31%);`:""} `,`color: ${c<2?"#FF00FF":"#FF1493"}`,"color: #666","color: #87CEEB"),console.info({feature:t,state:r.store.state,deps:a.memoDeps?.toString()}),console.trace(),console.groupEnd()}o(d,"logTime");let g=o(()=>{if(!l)return;let{schedule:h,untrack:p}=r._reactivity;h(()=>p(()=>l()))},"onAfterUpdateHandler");return Pi({...a,...{onAfterUpdate:o(()=>{g()},"onAfterUpdate")}})}o(Ft,"tableMemo");function nl(t,e="_"){let[n,l]=t.split(e);return{fnKey:l,fnName:`${n}.${l}`,parentName:n}}o(nl,"getFunctionNameInfo");function fe(t,e,n){for(let[l,{fn:r,memoDeps:a}]of Object.entries(n)){let{fnKey:s,fnName:i}=nl(l);e[s]=a?Ft({memoDeps:a,fn:r,fnName:i,table:e,feature:t}):r}}o(fe,"assignTableAPIs");function ce(t,e,n,l){for(let[r,{fn:a,memoDeps:s}]of Object.entries(l)){let{fnKey:i,fnName:c}=nl(r);if(s){let u=`_memo_${i}`;e[i]=function(...d){if(!this[u]){let g=this;this[u]=Ft({memoDeps:o(m=>s(g,m),"memoDeps"),fn:o((...m)=>a(g,...m),"fn"),fnName:c,objectId:g.id,table:n,feature:t})}return this[u](...d)}}else e[i]=function(...u){return a(this,...u)}}}o(ce,"assignPrototypeAPIs");function V(t,e,n,...l){return t[e]?.(...l)??n(t,...l)}o(V,"callMemoOrStaticFn");function ol(t){return t.row.getValue(t.column.id)}o(ol,"cell_getValue");function rl(t){return t.getValue()??t.table.options.renderFallbackValue}o(rl,"cell_renderValue");function ll(t){return{table:t.table,column:t.column,row:t.row,cell:t,getValue:o(()=>t.getValue(),"getValue"),renderValue:o(()=>t.renderValue(),"renderValue")}}o(ll,"cell_getContext");var al={assignCellPrototype:o((t,e)=>{ce("coreCellsFeature",t,e,{cell_getValue:{fn:o(n=>ol(n),"fn")},cell_renderValue:{fn:o(n=>rl(n),"fn")},cell_getContext:{fn:o(n=>ll(n),"fn"),memoDeps:o(n=>[n],"memoDeps")}})},"assignCellPrototype")};function Di(t){if(!t._headerPrototype){t._headerPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignHeaderPrototype?.(t._headerPrototype,t)}return t._headerPrototype}o(Di,"getHeaderPrototype");function go(t,e,n){let l=Di(t),r=Object.create(l);r.colSpan=0,r.column=e,r.depth=n.depth,r.headerGroup=null,r.id=n.id??e.id,r.index=n.index,r.isPlaceholder=!!n.isPlaceholder,r.placeholderId=n.placeholderId,r.rowSpan=0,r.subHeaders=[];let a=t._headerInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}o(go,"constructHeader");function Qe(){return{start:[],end:[]}}o(Qe,"getDefaultColumnPinningState");function sl(t){let e=t.getAllColumns(),n=t.getAllLeafColumnsById(),{start:l}=t.atoms.columnPinning?.get()??Qe(),r=[];for(let a=0;a<l.length;a++){let s=n[l[a]];s&&V(s,"getIsVisible",ue)&&r.push(s)}return wt(e,r,t,"start")}o(sl,"table_getStartHeaderGroups");function il(t){let e=t.getAllColumns(),n=t.getAllLeafColumnsById(),{end:l}=t.atoms.columnPinning?.get()??Qe(),r=[];for(let a=0;a<l.length;a++){let s=n[l[a]];s&&V(s,"getIsVisible",ue)&&r.push(s)}return wt(e,r,t,"end")}o(il,"table_getEndHeaderGroups");function cl(t){let e=t.getAllColumns(),n=V(t,"getVisibleLeafColumns",ht),{start:l,end:r}=t.atoms.columnPinning?.get()??Qe();if(l.length||r.length){let a=[...l,...r];n=n.filter(s=>!a.includes(s.id))}return wt(e,n,t,"center")}o(cl,"table_getCenterHeaderGroups");function Ai(t){let{start:e}=t.atoms.columnPinning?.get()??Qe(),n=t.getAllLeafColumnsById(),l=[];for(let r=0;r<e.length;r++){let a=n[e[r]];a&&l.push(a)}return l}o(Ai,"table_getStartLeafColumns");function Oi(t){let{end:e}=t.atoms.columnPinning?.get()??Qe(),n=t.getAllLeafColumnsById(),l=[];for(let r=0;r<e.length;r++){let a=n[e[r]];a&&l.push(a)}return l}o(Oi,"table_getEndLeafColumns");function Ti(t){let{start:e,end:n}=t.atoms.columnPinning?.get()??Qe();if(!e.length&&!n.length)return t.getAllLeafColumns();let l=[...e,...n];return t.getAllLeafColumns().filter(r=>!l.includes(r.id))}o(Ti,"table_getCenterLeafColumns");function Ei(t){return V(t,"getStartLeafColumns",Ai).filter(e=>V(e,"getIsVisible",ue))}o(Ei,"table_getStartVisibleLeafColumns");function Vi(t){return V(t,"getEndLeafColumns",Oi).filter(e=>V(e,"getIsVisible",ue))}o(Vi,"table_getEndVisibleLeafColumns");function zi(t){return V(t,"getCenterLeafColumns",Ti).filter(e=>V(e,"getIsVisible",ue))}o(zi,"table_getCenterVisibleLeafColumns");function Ge(t,e){return e?e==="start"?V(t,"getStartVisibleLeafColumns",Ei):e==="end"?V(t,"getEndVisibleLeafColumns",Vi):V(t,"getCenterVisibleLeafColumns",zi):V(t,"getVisibleLeafColumns",ht)}o(Ge,"table_getPinnedVisibleLeafColumns");function ul(){return H()}o(ul,"getDefaultColumnVisibilityState");function po(t,e){jt(t)&&Bt(t.table,n=>{let l=Object.assign(H(),n),r=e??!V(t,"getIsVisible",ue),a=t.getLeafColumns();for(let s=0;s<a.length;s++){let i=a[s];jt(i)&&(l[i.id]=r)}return l})}o(po,"column_toggleVisibility");function ue(t){let e=t.table.atoms.columnVisibility?.get();if(!e)return!0;let n=t.columns;return n.length?n.some(l=>V(l,"getIsVisible",ue)):(je(e,t.id)?e[t.id]:void 0)??!0}o(ue,"column_getIsVisible");function jt(t){return(t.columnDef.enableHiding??!0)&&(t.table.options.enableHiding??!0)}o(jt,"column_getCanHide");function dl(t){return e=>{po(t,e.target.checked)}}o(dl,"column_getToggleVisibilityHandler");function fo(t){let e=t.getAllCells(),n=[];for(let u=0;u<e.length;u++){let d=e[u];V(d.column,"getIsVisible",ue)&&n.push(d)}let{start:l,end:r}=t.table.atoms.columnPinning?.get()??Qe();if(!l.length&&!r.length)return n;let a=V(t,"getVisibleCellsByColumnId",yn),s=[];for(let u=0;u<l.length;u++){let d=a[l[u]];d&&s.push(d)}let i=[];for(let u=0;u<r.length;u++){let d=a[r[u]];d&&i.push(d)}let c=[];for(let u=0;u<n.length;u++){let d=n[u],g=d.column.id;!l.includes(g)&&!r.includes(g)&&c.push(d)}return[...s,...c,...i]}o(fo,"row_getVisibleCells");function yn(t){let e=H(),n=t.getAllCells();for(let l=0;l<n.length;l++){let r=n[l];V(r.column,"getIsVisible",ue)&&(e[r.column.id]=r)}return e}o(yn,"row_getVisibleCellsByColumnId");function ml(t){return t.getAllFlatColumns().filter(e=>V(e,"getIsVisible",ue))}o(ml,"table_getVisibleFlatColumns");function ht(t){return t.getAllLeafColumns().filter(e=>V(e,"getIsVisible",ue))}o(ht,"table_getVisibleLeafColumns");function Bt(t,e){He(t,"columnVisibility",e)}o(Bt,"table_setColumnVisibility");function gl(t,e){Bt(t,e?H():Object.assign(H(),ie(t.initialState.columnVisibility??{})))}o(gl,"table_resetColumnVisibility");function bo(t,e){e=e??!ho(t);let n=H(),l=t.getAllLeafColumns();for(let r=0;r<l.length;r++){let a=l[r];n[a.id]=e||!jt(a)}Bt(t,n)}o(bo,"table_toggleAllColumnsVisible");function ho(t){return!t.getAllLeafColumns().some(e=>!V(e,"getIsVisible",ue))}o(ho,"table_getIsAllColumnsVisible");function fl(t){return t.getAllLeafColumns().some(e=>V(e,"getIsVisible",ue))}o(fl,"table_getIsSomeColumnsVisible");function pl(t){return e=>{bo(t,e.target.checked)}}o(pl,"table_getToggleAllColumnsVisibilityHandler");function bl(t,e=1){let n=e;for(let l=0;l<t.length;l++){let r=t[l];V(r,"getIsVisible",ue)&&r.columns.length&&(n=Math.max(n,bl(r.columns,e+1)))}return n}o(bl,"getMaxHeaderDepth");function $i(t,e){return t?`${t}_${e}`:String(e)}o($i,"formatHeaderGroupId");function Hi(t,e,n,l){let r=t??"";return e&&(r=r?`${r}_${e}`:String(e)),n&&(r=r?`${r}_${n}`:n),l&&(r=r?`${r}_${l}`:l),r}o(Hi,"formatHeaderId");function Li(t,e){let n=0;for(let l=0;l<t.length;l++)t[l].column===e&&n++;return n}o(Li,"countPendingHeadersForColumn");function hl(t,e,n,l,r,a){let s={depth:e,id:$i(l,e),headers:[]},i=[];for(let c=0;c<t.length;c++){if(!(c in t))continue;let u=t[c],d=i[i.length-1],g=u.column.depth===s.depth,m,h=!1;if(g&&u.column.parent?m=u.column.parent:(m=u.column,h=!0),d&&d.column===m)d.subHeaders.push(u);else{let p=go(n,m,{id:Hi(l,e,m.id,u.id),isPlaceholder:h,placeholderId:h?String(Li(i,m)):void 0,depth:e,index:i.length});p.subHeaders.push(u),i.push(p)}s.headers.push(u),u.headerGroup=s}for(let c=0;c<a.length;c++)a[c](s);r.push(s),e>0&&hl(i,e-1,n,l,r,a)}o(hl,"constructHeaderGroup");function wl(t){for(let e=0;e<t.length;e++){let n=t[e];if(!V(n.column,"getIsVisible",ue))continue;let l=0;if(n.subHeaders.length){wl(n.subHeaders);for(let r=0;r<n.subHeaders.length;r++){let a=n.subHeaders[r];V(a.column,"getIsVisible",ue)&&(l+=a.colSpan)}}else l=1;if(n.colSpan=l,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let r=1,a=n.subHeaders[0];for(;a;)a.rowSpan=0,r++,a=a.subHeaders.length===1&&a.subHeaders[0].column===n.column?a.subHeaders[0]:void 0;n.rowSpan=r}else n.rowSpan=1}}o(wl,"updateHeaderSpans");function wt(t,e,n,l){let r=bl(t),a=[],s=n._headerGroupInstanceInitFns,i=new Array(e.length);for(let c=0;c<e.length;c++)c in e&&(i[c]=go(n,e[c],{depth:r,index:c}));return hl(i,r-1,n,l,a,s),a.reverse(),wl(a[0]?.headers??[]),a}o(wt,"buildHeaderGroups");function ji(t){if(!t._columnPrototype){t._columnPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignColumnPrototype?.(t._columnPrototype,t)}return t._columnPrototype}o(ji,"getColumnPrototype");function xl(t,e,n,l){let r={...t.getDefaultColumnDef(),...e},a=r.accessorKey,s=a===void 0?void 0:String(a),i=r.id??s?.replaceAll(".","_")??(typeof r.header=="string"?r.header:void 0),c;if(r.accessorFn)c=r.accessorFn;else if(a!==void 0)if(typeof a=="string"&&a.includes(".")){let m=a.split(".");c=o(h=>{let p=h;for(let b=0;b<m.length;b++){let w=m[b];p=p?.[w]}return p},"accessorFn")}else c=o(m=>m[r.accessorKey],"accessorFn");if(!i)throw new Error;let u=ji(t),d=Object.create(u);d.accessorFn=c,d.columnDef=r,d.columns=[],d.depth=n,d.id=`${String(i)}`,d.parent=l;let g=t._columnInstanceInitFns;for(let m=0;m<g.length;m++)g[m](d);return d}o(xl,"constructColumn");function Sl(){return[]}o(Sl,"getDefaultColumnOrderState");function wo(t){let e=o(n=>{let l=H();for(let r=0;r<n.length;r++)l[n[r].id]=r;return l},"buildIndexes");return{all:e(Ge(t)),center:e(Ge(t,"center")),start:e(Ge(t,"start")),end:e(Ge(t,"end"))}}o(wo,"table_getColumnIndexes");function _l(t,e){return V(t.table,"getColumnIndexes",wo)[e==="start"?"start":e==="end"?"end":e==="center"?"center":"all"][t.id]??-1}o(_l,"column_getIndex");function Cl(t,e){return Ge(t.table,e)[0]?.id===t.id}o(Cl,"column_getIsFirstColumn");function yl(t,e){let n=Ge(t.table,e);return n[n.length-1]?.id===t.id}o(yl,"column_getIsLastColumn");function xo(t,e){He(t,"columnOrder",e)}o(xo,"table_setColumnOrder");function vl(t,e){xo(t,e?[]:ie(t.initialState.columnOrder??[]))}o(vl,"table_resetColumnOrder");function Gt(t){let e=t.atoms.columnOrder?.get();return n=>{let l=[];if(!e?.length)l=n;else{let r=new Map;for(let a=0;a<n.length;a++){let s=n[a];r.set(s.id,s)}for(let a=0;a<e.length;a++){let s=e[a],i=r.get(s);i&&(l.push(i),r.delete(s))}for(let a=0;a<n.length;a++){let s=n[a];r.has(s.id)&&l.push(s)}}return Bi(t,l)}}o(Gt,"table_getOrderColumnsFn");function Bi(t,e){let n=t.atoms.grouping?.get()??[],{groupedColumnMode:l}=t.options;if(!n.length||!l)return e;let r=e.filter(i=>!n.includes(i.id));if(l==="remove")return r;let a=new Map;for(let i=0;i<e.length;i++){let c=e[i];a.set(c.id,c)}let s=[];for(let i=0;i<n.length;i++){let c=a.get(n[i]);c&&s.push(c)}return[...s,...r]}o(Bi,"orderColumns");function Rl(t){return[t,...t.columns.flatMap(e=>e.getFlatColumns())]}o(Rl,"column_getFlatColumns");function Il(t){if(t.columns.length){let e=t.columns.flatMap(n=>n.getLeafColumns());return V(t.table,"getOrderColumns",Gt)(e)}return[t]}o(Il,"column_getLeafColumns");function Fl(t){return{header:o(e=>{let n=e.header.column.columnDef;return n.accessorKey?n.accessorKey:n.accessorFn?n.id:null},"header"),cell:o(e=>e.renderValue()?.toString?.()??null,"cell"),...Object.values(t._features).reduce((e,n)=>Object.assign(e,n.getDefaultColumnDef?.()),{}),...t.options.defaultColumn}}o(Fl,"table_getDefaultColumnDef");function Ml(t,e,n,l=0){let r=new Array(e.length);for(let a=0;a<e.length;a++){if(!(a in e))continue;let s=e[a],i=xl(t,s,l,n),c=s;i.columns=c.columns?Ml(t,c.columns,i,l+1):[],r[a]=i}return r}o(Ml,"constructColumns");function kl(t){return Ml(t,t.options.columns)}o(kl,"table_getAllColumns");function Pl(t){return t.getAllColumns().flatMap(e=>e.getFlatColumns())}o(Pl,"table_getAllFlatColumns");function Nl(t){let e=H(),n=t.getAllFlatColumns();for(let l=0;l<n.length;l++){let r=n[l];e[r.id]=r}return e}o(Nl,"table_getAllFlatColumnsById");function Dl(t){let e=t.getAllColumns().flatMap(n=>n.getLeafColumns());return V(t,"getOrderColumns",Gt)(e)}o(Dl,"table_getAllLeafColumns");function Al(t){let e=H(),n=t.getAllLeafColumns();for(let l=0;l<n.length;l++){let r=n[l];e[r.id]=r}return e}o(Al,"table_getAllLeafColumnsById");function Ol(t,e){return t.getAllFlatColumnsById()[e]}o(Ol,"table_getColumn");var Tl={assignColumnPrototype:o((t,e)=>{ce("coreColumnsFeature",t,e,{column_getFlatColumns:{fn:o(n=>Rl(n),"fn"),memoDeps:o(n=>[n.table.options.columns],"memoDeps")},column_getLeafColumns:{fn:o(n=>Il(n),"fn"),memoDeps:o(n=>[n.table.atoms.columnOrder?.get(),n.table.atoms.grouping?.get(),n.table.options.columns,n.table.options.groupedColumnMode],"memoDeps")}})},"assignColumnPrototype"),constructTableAPIs:o(t=>{fe("coreColumnsFeature",t,{table_getDefaultColumnDef:{fn:o(()=>Fl(t),"fn"),memoDeps:o(()=>[t.options.defaultColumn],"memoDeps")},table_getAllColumns:{fn:o(()=>kl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumns:{fn:o(()=>Pl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumnsById:{fn:o(()=>Nl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllLeafColumns:{fn:o(()=>Dl(t),"fn"),memoDeps:o(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getAllLeafColumnsById:{fn:o(()=>Al(t),"fn"),memoDeps:o(()=>[t.getAllLeafColumns()],"memoDeps")},table_getColumn:{fn:o(e=>Ol(t,e),"fn")}})},"constructTableAPIs")};function El(t,e){for(let n=0;n<t.subHeaders.length;n++)El(t.subHeaders[n],e);e.push(t)}o(El,"collectLeafHeaders");function Vl(t){let e=[];return El(t,e),e}o(Vl,"header_getLeafHeaders");function zl(t){return{column:t.column,header:t,table:t.column.table}}o(zl,"header_getContext");function $l(t){let{start:e,end:n}=t.atoms.columnPinning?.get()??Qe(),l=t.getAllColumns(),r=V(t,"getVisibleLeafColumns",ht);if(!e.length&&!n.length)return wt(l,r,t);let a=t.getAllLeafColumnsById(),s=[];for(let u=0;u<e.length;u++){let d=a[e[u]];d&&V(d,"getIsVisible",ue)&&s.push(d)}let i=[];for(let u=0;u<n.length;u++){let d=a[n[u]];d&&V(d,"getIsVisible",ue)&&i.push(d)}let c=r.filter(u=>!e.includes(u.id)&&!n.includes(u.id));return wt(l,[...s,...c,...i],t)}o($l,"table_getHeaderGroups");function Hl(t){return[...t.getHeaderGroups()].reverse()}o(Hl,"table_getFooterGroups");function Ll(t){let e=t.getHeaderGroups(),n=[];for(let l=0;l<e.length;l++){let r=e[l].headers;for(let a=0;a<r.length;a++)n.push(r[a])}return n}o(Ll,"table_getFlatHeaders");function jl(t){let e=t.getHeaderGroups()[0]?.headers??[],n=[];for(let l=0;l<e.length;l++){let r=e[l].getLeafHeaders();for(let a=0;a<r.length;a++)n.push(r[a])}return n}o(jl,"table_getLeafHeaders");var Bl={assignHeaderPrototype:o((t,e)=>{ce("coreHeadersFeature",t,e,{header_getLeafHeaders:{fn:o(n=>Vl(n),"fn"),memoDeps:o(n=>[n.column.table.options.columns],"memoDeps")},header_getContext:{fn:o(n=>zl(n),"fn"),memoDeps:o(n=>[n.column.table.options.columns],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{fe("coreHeadersFeature",t,{table_getHeaderGroups:{fn:o(()=>$l(t),"fn"),memoDeps:o(()=>[t.options.columns,t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.options.groupedColumnMode],"memoDeps")},table_getFooterGroups:{fn:o(()=>Hl(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")},table_getFlatHeaders:{fn:o(()=>Ll(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")},table_getLeafHeaders:{fn:o(()=>jl(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};function Gi(t){if(!t._rowPrototype){t._rowPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignRowPrototype?.(t._rowPrototype,t)}return t._rowPrototype}o(Gi,"getRowPrototype");var Gl=o((t,e,n,l,r,a,s)=>{let i=Gi(t),c=Object.create(i);c._displayIndexCache=-1,c._uniqueValuesCache=H(),c._valuesCache=H(),c.depth=r,c.id=e,c.index=l,c.original=n,c.parentId=s,c.subRows=a??[];let u=t._rowInstanceInitFns;for(let d=0;d<u.length;d++)u[d](c);return c},"constructRow");var _o=/([0-9]+)/gm;function xt(t){let e=Object.assign((n,l,r)=>{let a=n.getValue(r),s=l.getValue(r),i=e.resolveDataValue;return i&&(a=i(a),s=i(s)),e.sort(a,s,n,l,r)},t);return e}o(xt,"constructSortFn");var Co=xt({resolveDataValue:o(t=>Rn(t).toLowerCase(),"resolveDataValue"),sort:o((t,e)=>Ul(t,e),"sort")}),qi=xt({resolveDataValue:o(t=>Rn(t),"resolveDataValue"),sort:o((t,e)=>Ul(t,e),"sort")}),yo=xt({resolveDataValue:o(t=>Rn(t).toLowerCase(),"resolveDataValue"),sort:o((t,e)=>Ro(t,e),"sort")}),Ki=xt({resolveDataValue:o(t=>Rn(t),"resolveDataValue"),sort:o((t,e)=>Ro(t,e),"sort")}),vo=xt({resolveDataValue:o(t=>Ui(t),"resolveDataValue"),sort:o((t,e)=>t>e?1:t<e?-1:0,"sort")}),Mt=xt({sort:o((t,e)=>Ro(t,e),"sort")});function Ro(t,e){return t===e?0:t>e?1:-1}o(Ro,"compareBasic");function Ui(t){return t instanceof Date?t.getTime():t}o(Ui,"toDateSortValue");function Rn(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}o(Rn,"toString");function Ul(t,e){let n=0,l=0,r=t.length,a=e.length;for(;n<r&&l<a;){let s=vn(t.charCodeAt(n)),i=vn(e.charCodeAt(l)),c=So(t,n,s),u=So(e,l,i);if(!s&&!i){let g=Ji(t,n,c,e,l,u);if(g)return g;n=c,l=u;continue}if(s!==i)return s?1:-1;let d=Wi(t,n,c,e,l,u);if(d)return d;n=c,l=u}return Kl(t,n)-Kl(e,l)}o(Ul,"compareAlphanumeric");function vn(t){return t>=48&&t<=57}o(vn,"isDigit");function So(t,e,n){let l=e+1;for(;l<t.length&&vn(t.charCodeAt(l))===n;)l++;return l}o(So,"findChunkEnd");function Ji(t,e,n,l,r,a){let s=n-e,i=a-r,c=s<i?s:i;for(let u=0;u<c;u++){let d=t.charCodeAt(e+u),g=l.charCodeAt(r+u);if(d>g)return 1;if(g>d)return-1}return s>i?1:i>s?-1:0}o(Ji,"compareStringChunks");function Wi(t,e,n,l,r,a){let s=e;for(;s<n&&t.charCodeAt(s)===48;)s++;let i=r;for(;i<a&&l.charCodeAt(i)===48;)i++;let c=n-s,u=a-i;if(c===0&&u===0)return 0;if(c<=15&&u<=15){let m=ql(t,s,n),h=ql(l,i,a);return m>h?1:h>m?-1:0}let d=parseInt(t.slice(e,n),10),g=parseInt(l.slice(r,a),10);return d>g?1:g>d?-1:0}o(Wi,"compareNumericChunks");function ql(t,e,n){let l=0;for(let r=e;r<n;r++)l=l*10+t.charCodeAt(r)-48;return l}o(ql,"parseSmallInt");function Kl(t,e){let n=0,l=e;for(;l<t.length;)n++,l=So(t,l,vn(t.charCodeAt(l)));return n}o(Kl,"countRemainingChunks");function Jl(){return[]}o(Jl,"getDefaultCellSelectionState");function Qi(t,e){He(t,"cellSelection",e?Jl():ie(t.initialState.cellSelection)??Jl())}o(Qi,"table_resetCellSelection");function Wl(t){t.atoms.cellSelection&&(t.options.autoResetAll??t.options.autoResetCellSelection??!0)&&t._reactivity.schedule(()=>Qi(t))}o(Wl,"table_autoResetCellSelection");function Ql(t){t.atoms.expanded&&(t.options.autoResetAll??t.options.autoResetExpanded??!t.options.manualExpanding)&&t._reactivity.schedule(()=>Xi(t))}o(Ql,"table_autoResetExpanded");function Xi(t,e){let n=t.initialState.expanded;He(t,"expanded",e?H():n===!0?!0:Object.assign(H(),ie(n??{})))}o(Xi,"table_resetExpanded");var In=0;function Fn(t){if(t.options.autoResetAll??t.options.autoResetPageIndex??!t.options.manualPagination){if((t.atoms.pagination?.get()?.pageIndex??In)===In)return;ec(t,!0)}}o(Fn,"table_autoResetPageIndex");function Yi(t,e){He(t,"pagination",e)}o(Yi,"table_setPagination");function Zi(t,e){Yi(t,n=>{let l=It(e,n.pageIndex),r=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return l=Math.max(0,Math.min(l,r)),{...n,pageIndex:l}})}o(Zi,"table_setPageIndex");function ec(t,e){Zi(t,e?In:t.initialState.pagination?.pageIndex??In)}o(ec,"table_resetPageIndex");function Xl(){return[]}o(Xl,"getDefaultSortingState");function Kt(t,e){He(t,"sorting",e)}o(Kt,"table_setSorting");function Io(t,e){Kt(t,e?[]:ie(t.initialState.sorting??[]))}o(Io,"table_resetSorting");function Yl(t){t.atoms.sorting&&(t.options.autoResetAll??t.options.autoResetSorting??!1)&&Io(t)}o(Yl,"table_autoResetSorting");function Fo(t){let e=t.table._rowModelFns.sortFns,n=t.table.getFilteredRowModel().flatRows.slice(0,10),l,r=!1;for(let a=0;a<n.length;a++){let s=n[a].getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]"){l="datetime";break}if(typeof s=="string"&&(r=!0,s.split(_o).length>1)){l="alphanumeric";break}}if(!l&&r&&(l="text"),l){let a=e?.[l];if(a||l==="alphanumeric"&&(a=e?.text),a)return a}return Mt}o(Fo,"column_getAutoSortFn");function Mo(t){let e=t.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<e.length;n++){let l=e[n].getValue(t.id);if(l!=null)return typeof l=="string"?"asc":"desc"}return"desc"}o(Mo,"column_getAutoSortDir");function Mn(t){let e=t.table._rowModelFns.sortFns;return el(t.columnDef.sortFn)?t.columnDef.sortFn:t.columnDef.sortFn==="auto"?Fo(t):e?.[t.columnDef.sortFn]??Mt}o(Mn,"column_getSortFn");function ko(t,e,n){let l=No(t,n&&qt(t)),r=typeof e<"u";Kt(t.table,a=>{let s=a.findIndex(m=>m.id===t.id),i=s===-1?void 0:a[s],c=[],u,d=r?e:l==="desc",g=!!(a.length&&qt(t)&&n);return g?i?u="toggle":u="add":i?u="toggle":u="replace",u==="toggle"&&(r||l||(u="remove")),u==="add"?(c=[...a,{id:t.id,desc:d}],c.splice(0,c.length-(t.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):u==="toggle"?c=g?a.map(m=>m.id===t.id?{...m,desc:d}:m):[{id:t.id,desc:d}]:u==="remove"?c=g?a.filter(m=>m.id!==t.id):[]:c=[{id:t.id,desc:d}],c})}o(ko,"column_toggleSorting");function Po(t){return t.columnDef.sortDescFirst??t.table.options.sortDescFirst??Mo(t)==="desc"?"desc":"asc"}o(Po,"column_getFirstSortDir");function No(t,e){let n=Po(t),l=Do(t);return l?l!==n&&(t.table.options.enableSortingRemoval??!0)&&(!e||(t.table.options.enableMultiRemove??!0))?!1:l==="desc"?"asc":"desc":n}o(No,"column_getNextSortingOrder");function Ut(t){return(t.columnDef.enableSorting??!0)&&(t.table.options.enableSorting??!0)&&!!t.accessorFn}o(Ut,"column_getCanSort");function qt(t){return t.columnDef.enableMultiSort??t.table.options.enableMultiSort??!!t.accessorFn}o(qt,"column_getCanMultiSort");function Do(t){let e=t.table.atoms.sorting?.get()?.find(n=>n.id===t.id);return e?e.desc?"desc":"asc":!1}o(Do,"column_getIsSorted");function Zl(t){return t.table.atoms.sorting?.get()?.findIndex(e=>e.id===t.id)??-1}o(Zl,"column_getSortIndex");function ea(t){Kt(t.table,e=>e.length?e.filter(n=>n.id!==t.id):[])}o(ea,"column_clearSorting");function ta(t){let e=Ut(t);return n=>{e&&ko(t,void 0,qt(t)?t.table.options.isMultiSortEvent?.(n):!1)}}o(ta,"column_getToggleSortingHandler");function na(){return t=>Ft({feature:"coreRowModelsFeature",table:t,fnName:"table.getCoreRowModel",memoDeps:o(()=>[t.options.data],"memoDeps"),fn:o(()=>tc(t,t.options.data),"fn"),onAfterUpdate:Cn(()=>{Ql(t),Fn(t),Yl(t),Wl(t)})})}o(na,"createCoreRowModel");function oa(t,e,n,l=0,r){let a=[];for(let s=0;s<n.length;s++){let i=n[s],c=Gl(t,t.getRowId(i,s,r),i,s,l,void 0,r?.id);e.flatRows.push(c),e.rowsById[c.id]=c,a.push(c),t.options.getSubRows&&(c.originalSubRows=t.options.getSubRows(i,s),c.originalSubRows?.length&&(c.subRows=oa(t,e,c.originalSubRows,l+1,c)))}return a}o(oa,"accessRows");function tc(t,e){let n={rows:[],flatRows:[],rowsById:H()};return n.rows=oa(t,n,e),n}o(tc,"_createCoreRowModel");function ra(t){return t._rowModels.coreRowModel||(t._rowModels.coreRowModel=t.options.features.coreRowModel?.(t)??na()(t)),t._rowModels.coreRowModel()}o(ra,"table_getCoreRowModel");function la(t){return t.getCoreRowModel()}o(la,"table_getPreFilteredRowModel");function aa(t){return t._rowModels.filteredRowModel||(t._rowModels.filteredRowModel=t.options.features.filteredRowModel?.(t)),t.options.manualFiltering||!t._rowModels.filteredRowModel?t.getPreFilteredRowModel():t._rowModels.filteredRowModel()}o(aa,"table_getFilteredRowModel");function sa(t){return t.getFilteredRowModel()}o(sa,"table_getPreGroupedRowModel");function ia(t){return t._rowModels.groupedRowModel||(t._rowModels.groupedRowModel=t.options.features.groupedRowModel?.(t)),t.options.manualGrouping||!t._rowModels.groupedRowModel?t.getPreGroupedRowModel():t._rowModels.groupedRowModel()}o(ia,"table_getGroupedRowModel");function ca(t){return t.getGroupedRowModel()}o(ca,"table_getPreSortedRowModel");function ua(t){return t._rowModels.sortedRowModel||(t._rowModels.sortedRowModel=t.options.features.sortedRowModel?.(t)),t.options.manualSorting||!t._rowModels.sortedRowModel?t.getPreSortedRowModel():t._rowModels.sortedRowModel()}o(ua,"table_getSortedRowModel");function da(t){return t.getSortedRowModel()}o(da,"table_getPreExpandedRowModel");function ma(t){return t._rowModels.expandedRowModel||(t._rowModels.expandedRowModel=t.options.features.expandedRowModel?.(t)),t.options.manualExpanding||!t._rowModels.expandedRowModel?t.getPreExpandedRowModel():t._rowModels.expandedRowModel()}o(ma,"table_getExpandedRowModel");function ga(t){return t.getExpandedRowModel()}o(ga,"table_getPrePaginatedRowModel");function fa(t){return t._rowModels.paginatedRowModel||(t._rowModels.paginatedRowModel=t.options.features.paginatedRowModel?.(t)),t.options.manualPagination||!t._rowModels.paginatedRowModel?t.getPrePaginatedRowModel():t._rowModels.paginatedRowModel()}o(fa,"table_getPaginatedRowModel");function pa(t){return t.getPaginatedRowModel()}o(pa,"table_getRowModel");var ba={constructTableAPIs:o(t=>{fe("coreRowModelsFeature",t,{table_getCoreRowModel:{fn:o(()=>ra(t),"fn")},table_getPreFilteredRowModel:{fn:o(()=>la(t),"fn")},table_getFilteredRowModel:{fn:o(()=>aa(t),"fn")},table_getPreGroupedRowModel:{fn:o(()=>sa(t),"fn")},table_getGroupedRowModel:{fn:o(()=>ia(t),"fn")},table_getPreSortedRowModel:{fn:o(()=>ca(t),"fn")},table_getSortedRowModel:{fn:o(()=>ua(t),"fn")},table_getPreExpandedRowModel:{fn:o(()=>da(t),"fn")},table_getExpandedRowModel:{fn:o(()=>ma(t),"fn")},table_getPrePaginatedRowModel:{fn:o(()=>ga(t),"fn")},table_getPaginatedRowModel:{fn:o(()=>fa(t),"fn")},table_getRowModel:{fn:o(()=>pa(t),"fn")}})},"constructTableAPIs")};function nc(t){if(!t._cellPrototype){t._cellPrototype={table:t};let e=Object.values(t._features);for(let n=0;n<e.length;n++)e[n].assignCellPrototype?.(t._cellPrototype,t)}return t._cellPrototype}o(nc,"getCellPrototype");function ha(t,e,n){let l=nc(n),r=Object.create(l);r.column=t,r.id=`${e.id}_${t.id}`,r.row=e;let a=n._cellInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}o(ha,"constructCell");function wa(t){let e=t.table.getRowsInDisplayOrder(),n=t._displayIndexCache;return e[n]===t?n:-1}o(wa,"row_getDisplayIndex");function xa(t){let e=t.getPrePaginatedRowModel().rows;if(t.options.paginateExpandedRows===!1){let n=[],l=o(r=>{r._displayIndexCache=n.length,n.push(r),r.subRows.length&&r.getIsExpanded?.()&&r.subRows.forEach(l)},"handleRow");return e.forEach(l),n}for(let n=0;n<e.length;n++)e[n]._displayIndexCache=n;return e}o(xa,"table_getRowsInDisplayOrder");function Sa(t,e){if(je(t._valuesCache,e))return t._valuesCache[e];let n=t.table.getColumn(e);if(n?.accessorFn)return t._valuesCache[e]=n.accessorFn(t.original,t.index),t._valuesCache[e]}o(Sa,"row_getValue");function _a(t,e){if(je(t._uniqueValuesCache,e))return t._uniqueValuesCache[e];let n=t.table.getColumn(e);if(n?.accessorFn)return n.columnDef.getUniqueValues?(t._uniqueValuesCache[e]=n.columnDef.getUniqueValues(t.original,t.index),t._uniqueValuesCache[e]):(t._uniqueValuesCache[e]=[t.getValue(e)],t._uniqueValuesCache[e])}o(_a,"row_getUniqueValues");function Ca(t,e){return t.getValue(e)??t.table.options.renderFallbackValue}o(Ca,"row_renderValue");function ya(t){return tl(t.subRows,e=>e.subRows)}o(ya,"row_getLeafRows");function va(t){let e=t.getCoreRowModel().flatRows,n=0;for(let l=0;l<e.length;l++)n=Math.max(n,e[l].depth);return n}o(va,"table_getMaxSubRowDepth");function Ra(t){if(t.parentId)return t.table.getCoreRowModel().rowsById[t.parentId]??t.table.getRow(t.parentId,!0)}o(Ra,"row_getParentRow");function Ia(t){let e=[],n=t;for(;;){let l=n.getParentRow();if(!l)break;e.push(l),n=l}return e.reverse()}o(Ia,"row_getParentRows");function Fa(t){let e=t.table.getAllLeafColumns(),n=t._cellsCache;n||(n=t._cellsCache=new WeakMap);let l=new Array(e.length);for(let r=0;r<e.length;r++){let a=e[r],s=n.get(a);s||(s=ha(a,t,t.table),n.set(a,s)),l[r]=s}return l}o(Fa,"row_getAllCells");function Ma(t){let e=H(),n=t.getAllCells();for(let l=0;l<n.length;l++){let r=n[l];e[r.column.id]=r}return e}o(Ma,"row_getAllCellsByColumnId");function ka(t,e,n,l){return e.options.getRowId?.(t,n,l)??(l?`${l.id}.${n}`:String(n))}o(ka,"table_getRowId");function Pa(t,e,n){let l=(n?t.getPrePaginatedRowModel():t.getRowModel()).rowsById[e];if(!l&&(l=t.getCoreRowModel().rowsById[e],!l))throw new Error;return l}o(Pa,"table_getRow");var Na={assignRowPrototype:o((t,e)=>{ce("coreRowsFeature",t,e,{row_getDisplayIndex:{fn:o(n=>wa(n),"fn")},row_getAllCellsByColumnId:{fn:o(n=>Ma(n),"fn"),memoDeps:o(n=>[n.getAllCells()],"memoDeps")},row_getAllCells:{fn:o(n=>Fa(n),"fn"),memoDeps:o(n=>[n.table.getAllLeafColumns()],"memoDeps")},row_getLeafRows:{fn:o(n=>ya(n),"fn"),memoDeps:o(n=>[n.subRows],"memoDeps")},row_getParentRow:{fn:o(n=>Ra(n),"fn")},row_getParentRows:{fn:o(n=>Ia(n),"fn")},row_getUniqueValues:{fn:o((n,l)=>_a(n,l),"fn")},row_getValue:{fn:o((n,l)=>Sa(n,l),"fn")},row_renderValue:{fn:o((n,l)=>Ca(n,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{fe("coreRowsFeature",t,{table_getRowsInDisplayOrder:{fn:o(()=>xa(t),"fn"),memoDeps:o(()=>[t.getPrePaginatedRowModel().rows,t.options.paginateExpandedRows,t.options.paginateExpandedRows===!1?t.atoms.expanded?.get():void 0],"memoDeps")},table_getRowId:{fn:o((e,n,l)=>ka(e,t,n,l),"fn")},table_getRow:{fn:o((e,n)=>Pa(t,e,n),"fn")},table_getMaxSubRowDepth:{fn:o(()=>va(t),"fn"),memoDeps:o(()=>[t.getCoreRowModel()],"memoDeps")}})},"constructTableAPIs")};function kn(t,e,n=(l,r)=>l===r){let l=e===void 0?t.options.state:e;t._reactivity.batch(()=>{if(l)for(let r in l){let a=t.baseAtoms[r];if(!a)continue;let s=l[r],i=s===void 0?t.initialState[r]:s;n(t._reactivity.untrack(()=>a.get()),i)||a.set(()=>i)}})}o(kn,"table_syncExternalStateToBaseAtoms");function Pn(t,e,n=(l,r)=>l===r){t._reactivity.batch(()=>{kn(t,e,n),t._reactivity.commit?.()})}o(Pn,"table_publishExternalState");function Ao(t){let e=ie(t.initialState);t._reactivity.batch(()=>{let l=Object.keys(e);for(let r=0;r<l.length;r++){let a=l[r];t.baseAtoms[a].set(e[a])}});let n=Object.values(t._features);for(let l=0;l<n.length;l++)n[l].resetTableInstanceData?.(t)}o(Ao,"table_reset");function Da(t,e){let{features:n,atoms:l,initialState:r}=t.options;if(!t.options.mergeOptions)return{...t.options,...e,features:n,atoms:l,initialState:r};let a=t.options.mergeOptions(t.options,e),s={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...s,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:l,enumerable:!0,configurable:!0,writable:!0},initialState:{value:r,enumerable:!0,configurable:!0,writable:!0}})}o(Da,"table_mergeOptions");function Jt(t,e,n){let l=Da(t,It(e,t.options));t.optionsStore?t.optionsStore.set(()=>l):t.options=l,n?.syncExternalState!==!1&&Pn(t,l.state??null)}o(Jt,"table_setOptions");var Aa={constructTableAPIs:o(t=>{fe("coreTablesFeature",t,{table_reset:{fn:o(()=>Ao(t),"fn")},table_setOptions:{fn:o(e=>Jt(t,e),"fn")}})},"constructTableAPIs")};var Oa={coreCellsFeature:al,coreColumnsFeature:Tl,coreHeadersFeature:Bl,coreRowModelsFeature:ba,coreRowsFeature:Na,coreTablesFeature:Aa};function Ta(t,e={}){return Object.values(t).forEach(n=>{e=n.getInitialState?.(e)??e}),ie(e)}o(Ta,"getInitialTableState");function Oo(t){let e=t.features.coreReactivityFeature,{aggregationFns:n,columnMeta:l,coreRowModel:r,expandedRowModel:a,facetedMinMaxValues:s,facetedRowModel:i,facetedUniqueValues:c,filterFns:u,filterMeta:d,filteredRowModel:g,groupedRowModel:m,paginatedRowModel:h,sortFns:p,sortedRowModel:b,tableMeta:w,..._}=t.features,S={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...Oa,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:e,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:u,sortFns:p},_rowModels:{},atoms:{},baseAtoms:{}},v=Object.values(S._features),I={...v.reduce((R,x)=>Object.assign(R,x.getDefaultTableOptions?.(S)),{}),...t};if(e.wrapExternalAtoms&&I.atoms)for(let[R,x]of Object.entries(I.atoms)){let y=x,M=e.createWritableAtom(y.get(),{debugName:`externalAtom/${R}`});I.atoms[R]=M;let F=!1,P=y.subscribe(N=>{F||M.set(N)}),k=M.subscribe(N=>{F=!0,y.set(N),F=!1});e.addSubscription(P),e.addSubscription(k)}e.createOptionsStore?(S.optionsStore=e.createWritableAtom(I,{debugName:"table/optionsStore"}),Object.defineProperty(S,"options",{configurable:!0,enumerable:!0,get(){return S.optionsStore.get()},set(R){S.optionsStore.set(()=>R)}})):S.options=I,S.initialState=Ta(S._features,S.options.initialState);let C=Object.keys(S.initialState);for(let R=0;R<C.length;R++){let x=C[R];S.baseAtoms[x]=e.createWritableAtom(S.initialState[x],{debugName:`table/baseAtoms/${x}`}),S.atoms[x]=e.createReadonlyAtom(()=>{let y=S.options,M=y.atoms?.[x],F=M?M.get():S.baseAtoms[x].get();if(M)return F;let P=y.state;if(P&&je(P,x)){let k=P[x];return k===void 0?S.initialState[x]:k}return F},{debugName:`table/atoms/${x}`})}kn(S),S.store=Wr(e.createReadonlyAtom(()=>{let R={};for(let x=0;x<C.length;x++){let y=C[x];R[y]=S.atoms[y].get()}return R},{compare:it,debugName:"table/store"}));for(let R=0;R<v.length;R++){let x=v[R];x.initTableInstanceData?.(S),x.initCellInstanceData&&S._cellInstanceInitFns.push(x.initCellInstanceData.bind(x)),x.initColumnInstanceData&&S._columnInstanceInitFns.push(x.initColumnInstanceData.bind(x)),x.initHeaderGroupInstanceData&&S._headerGroupInstanceInitFns.push(x.initHeaderGroupInstanceData.bind(x)),x.initHeaderInstanceData&&S._headerInstanceInitFns.push(x.initHeaderInstanceData.bind(x)),x.initRowInstanceData&&S._rowInstanceInitFns.push(x.initRowInstanceData.bind(x)),x.constructTableAPIs?.(S)}return S}o(Oo,"constructTable");var To={getInitialState:o(t=>({columnOrder:Sl(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({onColumnOrderChange:Be("columnOrder",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{ce("columnOrderingFeature",t,e,{column_getIndex:{fn:o((n,l)=>_l(n,l),"fn")},column_getIsFirstColumn:{fn:o((n,l)=>Cl(n,l),"fn")},column_getIsLastColumn:{fn:o((n,l)=>yl(n,l),"fn")}})},"assignColumnPrototype"),constructTableAPIs:o(t=>{fe("columnOrderingFeature",t,{table_getColumnIndexes:{fn:o(()=>wo(t),"fn"),memoDeps:o(()=>[t.options.columns,t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")},table_setColumnOrder:{fn:o(e=>xo(t,e),"fn")},table_resetColumnOrder:{fn:o(e=>vl(t,e),"fn")},table_getOrderColumnsFn:{fn:o(()=>Gt(t),"fn"),memoDeps:o(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")}})},"constructTableAPIs")};function Ea(){return H()}o(Ea,"getDefaultColumnSizingState");function Eo(){return{size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER}}o(Eo,"getDefaultColumnSizingColumnDef");function kt(t){let e=Eo(),n=t.table.atoms.columnSizing?.get(),l=n&&je(n,t.id)?n[t.id]:void 0;return Math.min(Math.max(t.columnDef.minSize??e.minSize,l??t.columnDef.size??e.size),t.columnDef.maxSize??e.maxSize)}o(kt,"column_getSize");function Nn(t){let e=H(),n=H(),l=new Array(t.length),r=0;for(let s=0;s<t.length;s++){let i=t[s],c=V(i,"getSize",kt);l[s]=c,e[i.id]=r,r+=c}let a=0;for(let s=t.length-1;s>=0;s--)n[t[s].id]=a,a+=l[s];return{starts:e,afters:n}}o(Nn,"buildColumnOffsets");function Dn(t){return{all:Nn(Ge(t)),center:Nn(Ge(t,"center")),start:Nn(Ge(t,"start")),end:Nn(Ge(t,"end"))}}o(Dn,"table_getColumnOffsets");function Va(t){return t==="start"?"start":t==="end"?"end":t==="center"?"center":"all"}o(Va,"toOffsetsKey");function za(t,e){return V(t.table,"getColumnOffsets",Dn)[Va(e)].starts[t.id]??0}o(za,"column_getStart");function $a(t,e){return V(t.table,"getColumnOffsets",Dn)[Va(e)].afters[t.id]??0}o($a,"column_getAfter");function Ha(t){Pt(t.table,e=>{let n=H(),l=Object.keys(e);for(let r=0;r<l.length;r++){let a=l[r];a!==t.id&&(n[a]=e[a])}return n})}o(Ha,"column_resetSize");function La(t){if(!t.subHeaders.length)return kt(t.column);let e=0;for(let n=0;n<t.subHeaders.length;n++)e+=La(t.subHeaders[n]);return e}o(La,"sumHeaderSize");function rt(t){return La(t)}o(rt,"header_getSize");function Vo(t){if(t.index>0){let e=t.headerGroup?.headers[t.index-1];if(e)return V(e,"getStart",Vo)+V(e,"getSize",rt)}return 0}o(Vo,"header_getStart");function Pt(t,e){t.options.onColumnSizingChange?.(e)}o(Pt,"table_setColumnSizing");function ja(t,e){Pt(t,e?H():Object.assign(H(),ie(t.initialState.columnSizing??{})))}o(ja,"table_resetColumnSizing");function Ba(t){return t.getHeaderGroups()[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ba,"table_getTotalSize");function Ga(t){return V(t,"getStartHeaderGroups",sl)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ga,"table_getStartTotalSize");function qa(t){return V(t,"getCenterHeaderGroups",cl)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(qa,"table_getCenterTotalSize");function Ka(t){return V(t,"getEndHeaderGroups",il)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ka,"table_getEndTotalSize");function On(){return{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}}o(On,"getDefaultColumnResizingState");function $o(t){return(t.columnDef.enableResizing??!0)&&(t.table.options.enableColumnResizing??!0)}o($o,"column_getCanResize");function Ua(t){return t.table.atoms.columnResizing?.get()?.isResizingColumn===t.id}o(Ua,"column_getIsResizing");function Ja(t,e){let n=t.table.getColumn(t.column.id),l=$o(n);return r=>{if(!l||zo(r)&&r.touches.length>1)return;let a=rt(t),s=t.getLeafHeaders().map(C=>[C.column.id,kt(C.column)]),i=zo(r)?Math.round(r.touches[0].clientX):r.clientX,c=H(),u=o((C,R)=>{if(typeof R!="number")return;let x=n.table,y=x.options.columnResizeMode==="onChange"||C==="end";x._reactivity.batch(()=>{Nt(x,M=>{let F=x.options.columnResizeDirection==="rtl"?-1:1,P=(R-(M.startOffset??0))*F,k=M.startSize??0,N=Math.max(k>0?P/k:0,-.999999);if(y){let A=M.columnSizingStart;for(let z=0;z<A.length;z++){let O=A[z],$=O[1];c[O[0]]=Math.round(Math.max($>0?$+$*N:P/A.length,0)*100)/100}}return{...M,deltaOffset:P,deltaPercentage:N}}),y&&Pt(x,M=>Object.assign(H(),M,c))})},"updateOffset"),d=null,g=!1,m,h=o(()=>{g?(g=!1,u("move",m),d=requestAnimationFrame(h)):d=null},"flushMove"),p=o(C=>{if(m=C,typeof requestAnimationFrame!="function"){u("move",C);return}if(d!==null){g=!0;return}u("move",C),d=requestAnimationFrame(h)},"onMove"),b=o(C=>{d!==null&&(cancelAnimationFrame(d),d=null,g=!1),n.table._reactivity.batch(()=>{u("end",C??m),Nt(n.table,R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))})},"onEnd"),w=e||(typeof document<"u"?document:null),_={moveHandler:o(C=>p(C.clientX),"moveHandler"),upHandler:o(C=>{w?.removeEventListener("mousemove",_.moveHandler),w?.removeEventListener("mouseup",_.upHandler),b(C.clientX)},"upHandler")},S={moveHandler:o(C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),p(C.touches[0].clientX),!1),"moveHandler"),upHandler:o(C=>{v(),C.cancelable&&(C.preventDefault(),C.stopPropagation()),b(C.touches[0]?.clientX)},"upHandler"),cancelHandler:o(()=>{v(),b()},"cancelHandler")},v=o(()=>{w?.removeEventListener("touchmove",S.moveHandler),w?.removeEventListener("touchend",S.upHandler),w?.removeEventListener("touchcancel",S.cancelHandler)},"removeTouchEvents"),I=oc()?{passive:!1}:!1;zo(r)?(w?.addEventListener("touchmove",S.moveHandler,I),w?.addEventListener("touchend",S.upHandler,I),w?.addEventListener("touchcancel",S.cancelHandler,I)):(w?.addEventListener("mousemove",_.moveHandler,I),w?.addEventListener("mouseup",_.upHandler,I)),Nt(n.table,C=>({...C,startOffset:i,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:n.id}))}}o(Ja,"header_getResizeHandler");function Nt(t,e){t.options.onColumnResizingChange?.(e)}o(Nt,"table_setColumnResizing");function Wa(t,e){Nt(t,e?On():ie(t.initialState.columnResizing??On()))}o(Wa,"table_resetHeaderSizeInfo");var An=null;function oc(){if(typeof An=="boolean")return An;let t=!1;try{let e={get passive(){return t=!0,!1}},n=o(()=>{},"noop");window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return An=t,An}o(oc,"passiveEventSupported");function zo(t){return t.type==="touchstart"}o(zo,"isTouchStartEvent");var Ho={getInitialState:o(t=>({columnResizing:On(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnResizingChange:Be("columnResizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{ce("columnResizingFeature",t,e,{column_getCanResize:{fn:o(n=>$o(n),"fn")},column_getIsResizing:{fn:o(n=>Ua(n),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:o((t,e)=>{ce("columnResizingFeature",t,e,{header_getResizeHandler:{fn:o((n,l)=>Ja(n,l),"fn")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{fe("columnResizingFeature",t,{table_setColumnResizing:{fn:o(e=>Nt(t,e),"fn")},table_resetHeaderSizeInfo:{fn:o(e=>Wa(t,e),"fn")}})},"constructTableAPIs")};var Lo={getInitialState:o(t=>({columnSizing:Ea(),...t}),"getInitialState"),getDefaultColumnDef:o(()=>Eo(),"getDefaultColumnDef"),getDefaultTableOptions:o(t=>({onColumnSizingChange:Be("columnSizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{ce("columnSizingFeature",t,e,{column_getSize:{fn:o(n=>kt(n),"fn"),memoDeps:o(n=>[e.options.columns,e.atoms.columnSizing?.get()?.[n.id]],"memoDeps")},column_getStart:{fn:o((n,l)=>za(n,l),"fn")},column_getAfter:{fn:o((n,l)=>$a(n,l),"fn")},column_resetSize:{fn:o(n=>Ha(n),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:o((t,e)=>{ce("columnSizingFeature",t,e,{header_getSize:{fn:o(n=>rt(n),"fn"),memoDeps:o(n=>[e.options.columns,n.column.columns.length>0?e.atoms.columnSizing?.get():e.atoms.columnSizing?.get()?.[n.column.id]],"memoDeps")},header_getStart:{fn:o(n=>Vo(n),"fn"),memoDeps:o(()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{fe("columnSizingFeature",t,{table_getColumnOffsets:{fn:o(()=>Dn(t),"fn"),memoDeps:o(()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")},table_setColumnSizing:{fn:o(e=>Pt(t,e),"fn")},table_resetColumnSizing:{fn:o(e=>ja(t,e),"fn")},table_getTotalSize:{fn:o(()=>Ba(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getStartTotalSize:{fn:o(()=>Ga(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getCenterTotalSize:{fn:o(()=>qa(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getEndTotalSize:{fn:o(()=>Ka(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};var jo={getInitialState:o(t=>({columnVisibility:ul(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({onColumnVisibilityChange:Be("columnVisibility",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{ce("columnVisibilityFeature",t,e,{column_getIsVisible:{fn:o(n=>ue(n),"fn"),memoDeps:o(n=>[e.options.columns,e.atoms.columnVisibility?.get(),n.columns],"memoDeps")},column_getCanHide:{fn:o(n=>jt(n),"fn")},column_getToggleVisibilityHandler:{fn:o(n=>dl(n),"fn")},column_toggleVisibility:{fn:o((n,l)=>po(n,l),"fn")}})},"assignColumnPrototype"),assignRowPrototype:o((t,e)=>{ce("columnVisibilityFeature",t,e,{row_getVisibleCells:{fn:o(n=>fo(n),"fn"),memoDeps:o(n=>[n.getAllCells(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get()],"memoDeps")},row_getVisibleCellsByColumnId:{fn:o(n=>yn(n),"fn"),memoDeps:o(n=>[n.getAllCells(),e.atoms.columnVisibility?.get()],"memoDeps")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{fe("columnVisibilityFeature",t,{table_getVisibleFlatColumns:{fn:o(()=>ml(t),"fn"),memoDeps:o(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getVisibleLeafColumns:{fn:o(()=>ht(t),"fn"),memoDeps:o(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_setColumnVisibility:{fn:o(e=>Bt(t,e),"fn")},table_resetColumnVisibility:{fn:o(e=>gl(t,e),"fn")},table_toggleAllColumnsVisible:{fn:o(e=>bo(t,e),"fn")},table_getIsAllColumnsVisible:{fn:o(()=>ho(t),"fn")},table_getIsSomeColumnsVisible:{fn:o(()=>fl(t),"fn")},table_getToggleAllColumnsVisibilityHandler:{fn:o(()=>pl(t),"fn")}})},"constructTableAPIs")};function Qa(){return H()}o(Qa,"getDefaultRowSelectionState");function St(t,e){t.options.onRowSelectionChange?.(e)}o(St,"table_setRowSelection");function Xa(t,e){t._lastSelectedRowId=null,St(t,e?H():Object.assign(H(),ie(t.initialState.rowSelection??{})))}o(Xa,"table_resetRowSelection");function Bo(t,e,n){t._lastSelectedRowId=null,St(t,l=>{if(e=typeof e<"u"?e:!V(t,"getIsAllRowsSelected",Ko),n?.deselectAll&&!e)return H();let r=Object.assign(H(),l),a=t.getPreGroupedRowModel().flatRows;if(e){let s=new Map;a.forEach(i=>{Tn(i,s)&&(r[i.id]=!0)})}else a.forEach(s=>{Xe(s)&&delete r[s.id]});return r})}o(Bo,"table_toggleAllRowsSelected");function Go(t,e,n){t._lastSelectedRowId=null,St(t,l=>{let r=typeof e<"u"?e:!V(t,"getIsAllPageRowsSelected",Uo);if(n?.deselectAll&&!r)return H();let a=Object.assign(H(),l);return t.getRowModel().rows.forEach(s=>{zn(a,s.id,r,!0,t,!0)}),a})}o(Go,"table_toggleAllPageRowsSelected");function Ya(t){return t.getCoreRowModel()}o(Ya,"table_getPreSelectedRowModel");function Za(t){let e=t.getCoreRowModel();return V(t,"getIsSomeRowsSelected",Wt)?Qo(e,t):{rows:[],flatRows:[],rowsById:H()}}o(Za,"table_getSelectedRowModel");function es(t){let e=t.getFilteredRowModel();return V(t,"getIsSomeRowsSelected",Wt)?Qo(e,t):{rows:[],flatRows:[],rowsById:H()}}o(es,"table_getFilteredSelectedRowModel");function ts(t){let e=t.getSortedRowModel();return V(t,"getIsSomeRowsSelected",Wt)?Qo(e,t):{rows:[],flatRows:[],rowsById:H()}}o(ts,"table_getGroupedSelectedRowModel");function qo(t){return Object.keys(t.atoms.rowSelection?.get()??{})}o(qo,"table_getSelectedRowIds");function Ko(t){let e=t.getFilteredRowModel().flatRows,n=t.atoms.rowSelection?.get()??{},l=!!(e.length&&Object.keys(n).length);if(l){let r=new Map;e.some(a=>!Qt(a,n)&&Tn(a,r))&&(l=!1)}return l}o(Ko,"table_getIsAllRowsSelected");function Uo(t){let e=t.getPaginatedRowModel().flatRows,n=t.atoms.rowSelection?.get()??{},l=new Map,r=!1;for(let a=0;a<e.length;a++){let s=e[a];if(Qt(s,n))!r&&Tn(s,l)&&(r=!0);else if(Tn(s,l))return!1}return r}o(Uo,"table_getIsAllPageRowsSelected");function Wt(t){return V(t,"getSelectedRowIds",qo).length>0}o(Wt,"table_getIsSomeRowsSelected");function ns(t){return t.getPaginatedRowModel().flatRows.filter(e=>Xe(e)).some(e=>En(e)||V(e,"getIsSomeSelected",Wo))}o(ns,"table_getIsSomePageRowsSelected");function os(t){return e=>{Bo(t,e.target.checked)}}o(os,"table_getToggleAllRowsSelectedHandler");function rs(t){return e=>{Go(t,e.target.checked)}}o(rs,"table_getToggleAllPageRowsSelectedHandler");function Jo(t,e,n){let l=En(t);St(t.table,r=>{e=typeof e<"u"?e:!l;let a=Object.assign(H(),r);return zn(a,t.id,e,(n?.selectChildren??!0)&&ut(t),t.table),!e&&n?.deselectParents&&ss(a,t),a})}o(Jo,"row_toggleSelected");function En(t){return Qt(t,t.table.atoms.rowSelection?.get()??{})}o(En,"row_getIsSelected");function Wo(t){return Xo(t)==="some"}o(Wo,"row_getIsSomeSelected");function ls(t){return Xo(t)==="all"}o(ls,"row_getIsAllSubRowsSelected");function Xe(t){let e=t.table.options;return typeof e.enableRowSelection=="function"?e.enableRowSelection(t):e.enableRowSelection??!0}o(Xe,"row_getCanSelect");function Vn(t){let e=t.table.options;return typeof e.enableSubRowSelection=="function"?e.enableSubRowSelection(t):e.enableSubRowSelection??!0}o(Vn,"row_getCanSelectSubRows");function ut(t){let e=t.table.options;return typeof e.enableMultiRowSelection=="function"?e.enableMultiRowSelection(t):e.enableMultiRowSelection??!0}o(ut,"row_getCanMultiSelect");function as(t,e){let n=Xe(t);return l=>{if(!n)return;let r=l,a=t.table,s=r.target.checked,i=a._lastSelectedRowId;(!(a.options.enableRowRangeSelection!==!1&&i!==null&&ut(t)&&(a.options.isRowRangeSelectionEvent?.(l)??!1))||!rc(t,i,s,e))&&Jo(t,s,e),a._lastSelectedRowId=t.id}}o(as,"row_getToggleSelectedHandler");function rc(t,e,n,l){let r=l?.selectChildren??!0,a=t.table,s=a.getRowsInDisplayOrder(),i=a.getPrePaginatedRowModel().rowsById[e]??a.getCoreRowModel().rowsById[e];if(!i)return!1;let c=i.getDisplayIndex(),u=t.getDisplayIndex(),d=s[c],g=s[u];if(c<0||u<0||c>=s.length||u>=s.length||d?.id!==i.id||g?.id!==t.id||!ut(i)||!ut(t))return!1;let m=Math.min(c,u),h=Math.max(c,u);return St(a,p=>{let b=Object.assign(H(),p);for(let w=m;w<=h;w++){let _=s[w];!Xe(_)||!ut(_)||(zn(b,_.id,n,r,a),!n&&l?.deselectParents&&ss(b,_))}return b}),!0}o(rc,"selectRowRange");function zn(t,e,n,l,r,a){let s=r.getRow(e,!0);n?(ut(s)||Object.keys(t).forEach(i=>delete t[i]),Xe(s)&&(t[e]=!0)):(!a||Xe(s))&&delete t[e],l&&s.subRows.length&&Vn(s)&&s.subRows.forEach(i=>zn(t,i.id,n,l,r,a))}o(zn,"mutateRowIsSelected");function Tn(t,e){if(!Xe(t))return!1;let n=t.table;if(n.options.enableSubRowSelection===!0)return!0;let l=t.parentId;if(l===void 0)return!0;let r=e.get(l);if(r!==void 0)return r;let a=n.getCoreRowModel().rowsById,s=[],i=!0,c=l;for(;c!==void 0;){let u=e.get(c);if(u!==void 0){i=u;break}s.push(c);let d=a[c]??n.getRow(c,!0);if(!Vn(d)){i=!1;break}c=d.parentId}return s.forEach(u=>e.set(u,i)),i}o(Tn,"isRowSelectableInSelectAll");function ss(t,e){let n=e.table.getCoreRowModel().rowsById,l=e.parentId;for(;l!==void 0;)delete t[l],l=(n[l]??e.table.getRow(l,!0)).parentId}o(ss,"pruneAncestorRowIds");function is(t,e,n,l){let r=[];for(let a=0;a<t.length;a++){let s=t[a],i=Qt(s,e);if(i&&(n.push(s),l[s.id]=s),s.subRows.length){let c=is(s.subRows,e,n,l);if(i){let u=Object.create(Object.getPrototypeOf(s));_n(u,s),u.subRows=c,r.push(u)}}else i&&r.push(s)}return r}o(is,"selectRowsRecursively");function Qo(t,e){let n=[],l=H(),r=e.atoms.rowSelection?.get()??{};return{rows:is(t.rows,r,n,l),flatRows:n,rowsById:l}}o(Qo,"selectRowsFn");function Qt(t,e){return!!(je(e,t.id)&&e[t.id])}o(Qt,"isRowSelected");function Xo(t){if(!t.subRows.length)return!1;let e=t.table.atoms.rowSelection?.get()??{},n=!1,l=!0,r=!1;for(let a=0;a<t.subRows.length;a++){let s=t.subRows[a];if(n&&!l)break;if(Xe(s)&&(r=!0,Qt(s,e)?n=!0:l=!1),s.subRows.length){let i=Xo(s);i==="all"?(n=!0,r=!0):i==="some"?(n=!0,l=!1,r=!0):l=!1}}return r?l?"all":n?"some":!1:!1}o(Xo,"isSubRowSelected");var Yo={initTableInstanceData:o(t=>{t._lastSelectedRowId=null},"initTableInstanceData"),resetTableInstanceData:o(t=>{t._lastSelectedRowId=null},"resetTableInstanceData"),getInitialState:o(t=>({rowSelection:Qa(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({onRowSelectionChange:Be("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableRowRangeSelection:!0,enableSubRowSelection:!0,isRowRangeSelectionEvent:o(e=>{let n=e;return!!(n.shiftKey||n.nativeEvent?.shiftKey)},"isRowRangeSelectionEvent")}),"getDefaultTableOptions"),assignRowPrototype:o((t,e)=>{ce("rowSelectionFeature",t,e,{row_toggleSelected:{fn:o((n,l,r)=>Jo(n,l,r),"fn")},row_getIsSelected:{fn:o(n=>En(n),"fn")},row_getIsSomeSelected:{fn:o(n=>Wo(n),"fn"),memoDeps:o(n=>[n.subRows,n.table.atoms.rowSelection?.get(),n.table.options.enableRowSelection],"memoDeps")},row_getIsAllSubRowsSelected:{fn:o(n=>ls(n),"fn"),memoDeps:o(n=>[n.subRows,n.table.atoms.rowSelection?.get(),n.table.options.enableRowSelection],"memoDeps")},row_getCanSelect:{fn:o(n=>Xe(n),"fn")},row_getCanSelectSubRows:{fn:o(n=>Vn(n),"fn")},row_getCanMultiSelect:{fn:o(n=>ut(n),"fn")},row_getToggleSelectedHandler:{fn:o((n,l)=>as(n,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{fe("rowSelectionFeature",t,{table_setRowSelection:{fn:o(e=>St(t,e),"fn")},table_resetRowSelection:{fn:o(e=>Xa(t,e),"fn")},table_toggleAllRowsSelected:{fn:o((e,n)=>Bo(t,e,n),"fn")},table_toggleAllPageRowsSelected:{fn:o((e,n)=>Go(t,e,n),"fn")},table_getPreSelectedRowModel:{fn:o(()=>Ya(t),"fn")},table_getSelectedRowModel:{fn:o(()=>Za(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getCoreRowModel()],"memoDeps")},table_getFilteredSelectedRowModel:{fn:o(()=>es(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel()],"memoDeps")},table_getGroupedSelectedRowModel:{fn:o(()=>ts(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getSortedRowModel()],"memoDeps")},table_getSelectedRowIds:{fn:o(()=>qo(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsAllRowsSelected:{fn:o(()=>Ko(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsAllPageRowsSelected:{fn:o(()=>Uo(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsSomeRowsSelected:{fn:o(()=>Wt(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsSomePageRowsSelected:{fn:o(()=>ns(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection],"memoDeps")},table_getToggleAllRowsSelectedHandler:{fn:o(()=>os(t),"fn")},table_getToggleAllPageRowsSelectedHandler:{fn:o(()=>rs(t),"fn")}})},"constructTableAPIs")};var Zo={getInitialState(t){return{sorting:Xl(),...t}},getDefaultColumnDef(){return{sortFn:"auto",sortUndefined:1}},getDefaultTableOptions(t){return{autoResetSorting:!1,onSortingChange:Be("sorting",t),isMultiSortEvent:o(e=>e.shiftKey,"isMultiSortEvent")}},assignColumnPrototype(t,e){ce("rowSortingFeature",t,e,{column_getAutoSortFn:{fn:o(n=>Fo(n),"fn")},column_getAutoSortDir:{fn:o(n=>Mo(n),"fn")},column_getSortFn:{fn:o(n=>Mn(n),"fn")},column_toggleSorting:{fn:o((n,l,r)=>ko(n,l,r),"fn")},column_getFirstSortDir:{fn:o(n=>Po(n),"fn")},column_getNextSortingOrder:{fn:o((n,l)=>No(n,l),"fn")},column_getCanSort:{fn:o(n=>Ut(n),"fn")},column_getCanMultiSort:{fn:o(n=>qt(n),"fn")},column_getIsSorted:{fn:o(n=>Do(n),"fn")},column_getSortIndex:{fn:o(n=>Zl(n),"fn")},column_clearSorting:{fn:o(n=>ea(n),"fn")},column_getToggleSortingHandler:{fn:o(n=>ta(n),"fn")}})},constructTableAPIs(t){fe("rowSortingFeature",t,{table_setSorting:{fn:o(e=>Kt(t,e),"fn")},table_resetSorting:{fn:o(e=>Io(t,e),"fn")}})}};function er(){return t=>{let e=t;return Ft({feature:"rowSortingFeature",table:e,fnName:"table.getSortedRowModel",memoDeps:o(()=>[e.atoms.sorting?.get(),e.getPreSortedRowModel()],"memoDeps"),fn:o(()=>lc(e),"fn"),onAfterUpdate:Cn(()=>Fn(e))})}}o(er,"createSortedRowModel");function lc(t){let e=t.getPreSortedRowModel(),n=t.atoms.sorting?.get();if(!e.rows.length||!n?.length)return e;let l=[],r=n.filter(c=>{let u=t.getColumn(c.id);return u?Ut(u):!1});if(!r.length)return e;let a=[];for(let c=0;c<r.length;c++){let u=r[c],d=t.getColumn(u.id);d&&a.push({id:u.id,desc:u.desc,sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortFn:Mn(d)})}let s=o((c,u)=>{for(let d=0;d<a.length;d++){let g=a[d],m=g.sortUndefined,h=g.desc,p=0;if(m){let b=c.getValue(g.id),w=u.getValue(g.id),_=b===void 0,S=w===void 0;if(_&&S)continue;if(_||S){if(m==="first")return _?-1:1;if(m==="last")return _?1:-1;p=_?m:-m}}if(p===0&&(p=g.sortFn(c,u,g.id)),p!==0)return h&&(p*=-1),g.invertSorting&&(p*=-1),p}return c.index-u.index},"compareRows"),i=o(c=>{let u=c.slice();u.sort(s);let d=!1;for(let g=0;g<u.length;g++){let m=u[g];m!==c[g]&&(d=!0);let h=l.length;if(l.push(m),m.subRows.length){let p=i(m.subRows);if(p.changed){let b=Object.create(Object.getPrototypeOf(m));_n(b,m),b.subRows=p.rows,u[g]=b,l[h]=b,d=!0}}}return{rows:u,changed:d}},"sortData");return{rows:i(e.rows).rows,flatRows:l,rowsById:e.rowsById}}o(lc,"_createSortedRowModel");var dt=Me(gt(),1);var ac=typeof window>"u"?dt.useEffect:dt.useLayoutEffect;function tr(t,e){let[{table:n,rootSource:l}]=(0,dt.useState)(()=>{let c=Oo({...t,features:{coreReactivityFeature:Qr(),...t.features}});return c.Subscribe=(u=>Jr({...u,source:u.source??c.store})),c.FlexRender=co,{table:c,rootSource:mo(c.store,it)}}),r=n;Jt(r,c=>({...c,...t}),{syncExternalState:!1});let a=r.options.state,s=l.get(),i=on(l,e,{compare:it});return ac(()=>{l.markCommitted(s),Pn(r,a??null,it)}),(0,dt.useMemo)(()=>({...n,options:t,state:i}),[n,t,i])}o(tr,"useTable");var us=Me(Vt(),1),ds=Me(gt(),1),Ie=Me(zt(),1);var sc=[{label:"=",value:"eq"},{label:"\u2260",value:"ne"},{label:"<",value:"lt"},{label:"\u2264",value:"lte"},{label:">",value:"gt"},{label:"\u2265",value:"gte"},{label:"contains",value:"contains"}],ic=o(t=>{let e=t.trim(),n=Number(e);return e!==""&&Number.isFinite(n)&&String(n)===e?n:t},"$"),cc=o(t=>t.operator==="contains"?t.value==="":t.operator!=="eq"&&t.operator!=="ne"&&t.literal===void 0&&t.value.trim()==="","z"),Ye=o(t=>t.filter(e=>e.column!==""&&!cc(e)).map(e=>e.operator==="contains"?{column:e.column,operator:e.operator,value:e.value}:{column:e.column,operator:e.operator,value:e.literal===void 0?ic(e.value):e.literal[0]}),"L"),cs=o((t,e)=>({column:t.column,operator:t.operator,value:t.value,...e}),"P"),ms=o(t=>{let e=(0,us.c)(44),{columns:n,filters:l,onAskAi:r,onFiltersChange:a,onSearchChange:s,search:i}=t,[c,u]=(0,ds.useState)(""),d;e[0]!==n[0]||e[1]!==l||e[2]!==a?(d=o(()=>{a([...l,{column:n[0]??"",operator:"eq",value:""}])},"N"),e[0]=n[0],e[1]=l,e[2]=a,e[3]=d):d=e[3];let g=d,m;e[4]!==l||e[5]!==a?(m=o(F=>{let P=Number(F.currentTarget.dataset.index);a(l.filter((k,N)=>N!==P))},"T"),e[4]=l,e[5]=a,e[6]=m):m=e[6];let h=m,p;e[7]!==l||e[8]!==a?(p=o(F=>{let P=Number(F.currentTarget.dataset.index),k=F.currentTarget.value;a(l.map((N,A)=>A===P?cs(N,{column:k}):N))},"y"),e[7]=l,e[8]=a,e[9]=p):p=e[9];let b=p,w;e[10]!==l||e[11]!==a?(w=o(F=>{let P=Number(F.currentTarget.dataset.index),k=F.currentTarget.value;a(l.map((N,A)=>A===P?{...N,operator:k}:N))},"S"),e[10]=l,e[11]=a,e[12]=w):w=e[12];let _=w,S;e[13]!==l||e[14]!==a?(S=o(F=>{let P=Number(F.currentTarget.dataset.index),k=F.currentTarget.value;a(l.map((N,A)=>A===P?cs(N,{value:k}):N))},"k"),e[13]=l,e[14]=a,e[15]=S):S=e[15];let v=S,I;e[16]!==s||e[17]!==i?(I=(0,Ie.jsx)("input",{"aria-label":"Search rows","data-testid":"db-filter",onChange:s,placeholder:"search table\u2026",value:i}),e[16]=s,e[17]=i,e[18]=I):I=e[18];let C;e[19]!==g?(C=(0,Ie.jsx)("button",{"data-testid":"db-add-filter",onClick:g,type:"button",children:"Add filter"}),e[19]=g,e[20]=C):C=e[20];let R;e[21]!==c||e[22]!==r?(R=r!==void 0&&(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsx)("input",{"aria-label":"Describe a filter","data-testid":"db-ai-prompt",onChange:o(F=>{u(F.target.value)},"onChange"),onKeyDown:o(F=>{F.key==="Enter"&&c.trim()!==""&&(F.preventDefault(),r(c.trim()))},"onKeyDown"),placeholder:"describe a filter\u2026",value:c}),(0,Ie.jsx)("button",{"data-testid":"db-ai-filter",disabled:c.trim()==="",onClick:o(()=>{r(c.trim())},"onClick"),type:"button",children:"Suggest"})]}),e[21]=c,e[22]=r,e[23]=R):R=e[23];let x;e[24]!==I||e[25]!==C||e[26]!==R?(x=(0,Ie.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[I,C,R]}),e[24]=I,e[25]=C,e[26]=R,e[27]=x):x=e[27];let y;if(e[28]!==b||e[29]!==_||e[30]!==v||e[31]!==n||e[32]!==l||e[33]!==h){let F;e[35]!==b||e[36]!==_||e[37]!==v||e[38]!==n||e[39]!==h?(F=o((P,k)=>(0,Ie.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"db-filter-row",children:[(0,Ie.jsx)("select",{"aria-label":"Filter column","data-index":k,"data-testid":"db-filter-column",onChange:b,value:P.column,children:n.map(uc)}),(0,Ie.jsx)("select",{"aria-label":"Filter operator","data-index":k,"data-testid":"db-filter-operator",onChange:_,value:P.operator,children:sc.map(dc)}),(0,Ie.jsx)("input",{"aria-label":"Filter value","data-index":k,"data-testid":"db-filter-value",onChange:v,placeholder:"value",value:P.value}),(0,Ie.jsx)("button",{"aria-label":"Remove filter","data-index":k,"data-testid":"db-filter-remove",onClick:h,type:"button",children:"\u2715"})]},k),"a"),e[35]=b,e[36]=_,e[37]=v,e[38]=n,e[39]=h,e[40]=F):F=e[40],y=l.map(F),e[28]=b,e[29]=_,e[30]=v,e[31]=n,e[32]=l,e[33]=h,e[34]=y}else y=e[34];let M;return e[41]!==y||e[42]!==x?(M=(0,Ie.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"db-filters",children:[x,y]}),e[41]=y,e[42]=x,e[43]=M):M=e[43],M},"M");function uc(t){return(0,Ie.jsx)("option",{value:t,children:t},t)}o(uc,"B");function dc(t){return(0,Ie.jsx)("option",{value:t.value,children:t.label},t.value)}o(dc,"G");var mc=o(t=>({tables:Object.entries(t).map(([e,n])=>({fields:n.map(l=>l.name),indexes:[],name:e,relations:n.filter(l=>l.ref!==void 0).map(l=>({field:l.name,kind:"one",name:l.name,onDelete:l.onDelete,references:l.ref,table:e}))}))}),"_o"),gc=o(t=>{let e=new Map,n=new Set;for(let l of t.tables)for(let r of l.relations){if(r.kind!=="one"||r.onDelete==="set null")continue;let a=r.references,s=`${a}\0${l.name}\0${r.field}`;if(n.has(s))continue;n.add(s);let i=e.get(a)??[];i.push({...r,table:l.name}),e.set(a,i)}return e},"Ro"),fc=o((t,e)=>{let n=[],l=[t];for(;l.length>0;){let r=l.shift();if(r===void 0)break;e(r)&&n.push(r);for(let a of r.children)l.push(a)}return n},"$o"),gs=o((t,e)=>{let n=[];for(let[l,r]of Object.entries(e))for(let a of r)a.ref===t&&n.push({column:a.name,table:l});return n.sort((l,r)=>l.table.localeCompare(r.table)||l.column.localeCompare(r.column)),n},"Jt"),ar=o(t=>`${t.table}.${t.column}`,"It"),pc=o(t=>{let e=(0,q.c)(111),{columns:n,onApply:l,onClose:r,shardKey:a,table:s,total:i,uniqueColumns:c}=t,u=oe(),[d,g]=(0,D.useState)(n[0]??""),[m,h]=(0,D.useState)(""),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=o(be=>{g(be.target.value)},"u"),e[0]=p):p=e[0];let b=p,w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=o(be=>{h(be.target.value)},"h"),e[1]=w):w=e[1];let _=w,S;e[2]!==m?(S=m.trim(),e[2]=m,e[3]=S):S=e[3];let v=S==="",I,C;if(e[4]!==v||e[5]!==u||e[6]!==m){if(!v)try{C=nn(JSON.parse(m))}catch(be){I=u("Invalid JSON: {message}",{message:be.message})}e[4]=v,e[5]=u,e[6]=m,e[7]=I,e[8]=C}else I=e[7],C=e[8];let R;e[9]!==d||e[10]!==i||e[11]!==c?(R=c.has(d)&&i>1,e[9]=d,e[10]=i,e[11]=c,e[12]=R):R=e[12];let x=R,y=d!==""&&!v&&I===void 0&&!x,M;e[13]!==y||e[14]!==d||e[15]!==l||e[16]!==r||e[17]!==C?(M=o(()=>{y&&(l({[d]:C}),r())},"T"),e[13]=y,e[14]=d,e[15]=l,e[16]=r,e[17]=C,e[18]=M):M=e[18];let F=M,P;e[19]!==u?(P=u("Set a column on matching rows"),e[19]=u,e[20]=P):P=e[20];let k;e[21]!==u?(k=u("Set a column on matching rows"),e[21]=u,e[22]=k):k=e[22];let N;e[23]!==k?(N=(0,f.jsx)("h3",{className:"text-base text-foreground","data-testid":"bulk-patch-title",children:k}),e[23]=k,e[24]=N):N=e[24];let A;e[25]!==u||e[26]!==s||e[27]!==i?(A=u("Writes {total} rows of {table} through the schema-aware writer \u2014 validators and indexes apply, exactly like a mutation.",{table:s,total:i.toString()}),e[25]=u,e[26]=s,e[27]=i,e[28]=A):A=e[28];let z;e[29]!==A?(z=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-desc",children:A}),e[29]=A,e[30]=z):z=e[30];let O;e[31]!==a||e[32]!==u?(O=a===""?u("Shard: root"):u("Shard: {shardKey} \u2014 rows in other shards are not touched.",{shardKey:a}),e[31]=a,e[32]=u,e[33]=O):O=e[33];let $;e[34]!==O?($=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-shard",children:O}),e[34]=O,e[35]=$):$=e[35];let K;e[36]!==z||e[37]!==$||e[38]!==N?(K=(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[N,z,$]}),e[36]=z,e[37]=$,e[38]=N,e[39]=K):K=e[39];let U;e[40]!==u?(U=u("Close"),e[40]=u,e[41]=U):U=e[41];let T;e[42]!==r||e[43]!==U?(T=(0,f.jsx)(rn,{"data-testid":"bulk-patch-close",onClick:r,size:"xs",variant:"ghost",children:U}),e[42]=r,e[43]=U,e[44]=T):T=e[44];let Q;e[45]!==K||e[46]!==T?(Q=(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[K,T]}),e[45]=K,e[46]=T,e[47]=Q):Q=e[47];let J;e[48]!==u?(J=u("Column"),e[48]=u,e[49]=J):J=e[49];let Z;e[50]!==J?(Z=(0,f.jsx)(so,{htmlFor:"bulk-patch-column",children:J}),e[50]=J,e[51]=Z):Z=e[51];let ne;e[52]!==u?(ne=u("Column"),e[52]=u,e[53]=ne):ne=e[53];let te;e[54]!==n?(te=n.map(bc),e[54]=n,e[55]=te):te=e[55];let ae;e[56]!==d||e[57]!==ne||e[58]!==te?(ae=(0,f.jsx)("select",{"aria-label":ne,className:"h-8 rounded-md border border-input bg-transparent px-2 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"bulk-patch-column",id:"bulk-patch-column",onChange:b,value:d,children:te}),e[56]=d,e[57]=ne,e[58]=te,e[59]=ae):ae=e[59];let de;e[60]!==u?(de=u("Value"),e[60]=u,e[61]=de):de=e[61];let pe;e[62]!==de?(pe=(0,f.jsx)(so,{htmlFor:"bulk-patch-value",children:de}),e[62]=de,e[63]=pe):pe=e[63];let Ce;e[64]!==m?(Ce=(0,f.jsx)(_r,{className:"flex-1 font-mono","data-testid":"bulk-patch-value",id:"bulk-patch-value",onChange:_,placeholder:"true",value:m}),e[64]=m,e[65]=Ce):Ce=e[65];let xe;e[66]!==Z||e[67]!==ae||e[68]!==pe||e[69]!==Ce?(xe=(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[Z,ae,pe,Ce]}),e[66]=Z,e[67]=ae,e[68]=pe,e[69]=Ce,e[70]=xe):xe=e[70];let Se;e[71]!==I?(Se=I!==void 0&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-error",role:"alert",children:I}),e[71]=I,e[72]=Se):Se=e[72];let ye;e[73]!==d||e[74]!==u||e[75]!==i||e[76]!==x?(ye=x&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-unique",role:"alert",children:u("{column} has a unique index \u2014 the same value cannot be set on {total} rows.",{column:d,total:i.toString()})}),e[73]=d,e[74]=u,e[75]=i,e[76]=x,e[77]=ye):ye=e[77];let L;e[78]!==v||e[79]!==u||e[80]!==x?(L=v&&!x&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-hint",children:u('Enter a JSON value \u2014 for example true, 0, null, or "done".')}),e[78]=v,e[79]=u,e[80]=x,e[81]=L):L=e[81];let X;e[82]!==y||e[83]!==d||e[84]!==m?(X=y&&(0,f.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"bulk-patch-preview",children:`${d} = ${m.trim()}`}),e[82]=y,e[83]=d,e[84]=m,e[85]=X):X=e[85];let le;e[86]!==u?(le=u("Cancel"),e[86]=u,e[87]=le):le=e[87];let Fe;e[88]!==r||e[89]!==le?(Fe=(0,f.jsx)(rn,{"data-testid":"bulk-patch-cancel",onClick:r,size:"xs",variant:"outline",children:le}),e[88]=r,e[89]=le,e[90]=Fe):Fe=e[90];let Ne=!y,se;e[91]!==u||e[92]!==i?(se=u("Set on {total} rows",{total:i.toString()}),e[91]=u,e[92]=i,e[93]=se):se=e[93];let ee;e[94]!==F||e[95]!==Ne||e[96]!==se?(ee=(0,f.jsx)(rn,{"data-testid":"bulk-patch-apply",disabled:Ne,onClick:F,size:"xs",children:se}),e[94]=F,e[95]=Ne,e[96]=se,e[97]=ee):ee=e[97];let G;e[98]!==Fe||e[99]!==ee?(G=(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[Fe,ee]}),e[98]=Fe,e[99]=ee,e[100]=G):G=e[100];let De;return e[101]!==r||e[102]!==Q||e[103]!==xe||e[104]!==Se||e[105]!==ye||e[106]!==L||e[107]!==X||e[108]!==G||e[109]!==P?(De=(0,f.jsxs)(Ht,{label:P,onClose:r,panelTestId:"bulk-patch-panel",testId:"bulk-patch-overlay",variant:"dialog",children:[Q,xe,Se,ye,L,X,G]}),e[101]=r,e[102]=Q,e[103]=xe,e[104]=Se,e[105]=ye,e[106]=L,e[107]=X,e[108]=G,e[109]=P,e[110]=De):De=e[110],De},"Do");function bc(t){return(0,f.jsx)("option",{value:t,children:t},t)}o(bc,"Ao");var fs=6,Hn=100,hc=o(t=>({paddingLeft:t*16}),"Po"),wc=o(t=>{let e=(0,q.c)(2),{table:n}=t,l=`cascade-restrict-${n}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-destructive/10 px-1 text-destructive","data-testid":l,children:"restrict \u2014 will block delete"}),e[0]=l,e[1]=r):r=e[1],r},"Io"),xc=o(t=>{let e=(0,q.c)(2),{table:n}=t,l=`cascade-cascade-${n}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-warning/10 px-1 text-warning","data-testid":l,children:"cascade"}),e[0]=l,e[1]=r):r=e[1],r},"Fo"),Sc=o(t=>{let e=(0,q.c)(2),{table:n}=t,l=`cascade-undeclared-${n}`,r;return e[0]!==l?(r=(0,f.jsx)("span",{className:"rounded bg-muted px-1 text-muted-foreground","data-testid":l,children:"references \u2014 no delete action declared"}),e[0]=l,e[1]=r):r=e[1],r},"Oo"),_c=o(t=>t.relation===void 0||t.relation.onDelete==="cascade"?(0,f.jsx)(xc,{table:t.table}):t.isRestrict?(0,f.jsx)(wc,{table:t.table}):(0,f.jsx)(Sc,{table:t.table}),"Mo"),ys=o(t=>{let e=(0,q.c)(35),{depth:n,node:l}=t,r=`cascade-row-${l.table}`,a;e[0]!==n?(a=hc(n),e[0]=n,e[1]=a):a=e[1];let s;e[2]!==n?(s=n>0&&(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2514"}),e[2]=n,e[3]=s):s=e[3];let i;e[4]!==l.table?(i=(0,f.jsx)("span",{className:"font-medium text-foreground",children:l.table}),e[4]=l.table,e[5]=i):i=e[5];let c;e[6]!==l.relation||e[7]!==l.table?(c=l.relation!==void 0&&(0,f.jsxs)("span",{className:"text-muted-foreground","data-testid":`cascade-col-${l.table}-${l.relation.field}`,children:["via ",l.relation.field]}),e[6]=l.relation,e[7]=l.table,e[8]=c):c=e[8];let u;e[9]!==l.rowCount?(u=l.rowCount.toString(),e[9]=l.rowCount,e[10]=u):u=e[10];let d;e[11]!==u?(d=(0,f.jsxs)("span",{className:"text-muted-foreground",children:["(",u," rows)"]}),e[11]=u,e[12]=d):d=e[12];let g;e[13]!==l?(g=_c(l),e[13]=l,e[14]=g):g=e[14];let m;e[15]!==l.capNote||e[16]!==l.table?(m=l.capNote!==void 0&&(0,f.jsxs)("span",{className:"italic text-muted-foreground","data-testid":`cascade-cap-${l.table}`,children:["(",l.capNote,")"]}),e[15]=l.capNote,e[16]=l.table,e[17]=m):m=e[17];let h;e[18]!==r||e[19]!==a||e[20]!==s||e[21]!==i||e[22]!==c||e[23]!==d||e[24]!==g||e[25]!==m?(h=(0,f.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 py-1 font-mono text-xs","data-testid":r,style:a,children:[s,i,c,d,g,m]}),e[18]=r,e[19]=a,e[20]=s,e[21]=i,e[22]=c,e[23]=d,e[24]=g,e[25]=m,e[26]=h):h=e[26];let p;if(e[27]!==n||e[28]!==l.children){let w;e[30]!==n?(w=o((_,S)=>(0,f.jsx)(ys,{depth:n+1,node:_},`${_.table}-${_.relation?.field??"root"}-${S.toString()}`),"h"),e[30]=n,e[31]=w):w=e[31],p=l.children.map(w),e[27]=n,e[28]=l.children,e[29]=p}else p=e[29];let b;return e[32]!==h||e[33]!==p?(b=(0,f.jsxs)(f.Fragment,{children:[h,p]}),e[32]=h,e[33]=p,e[34]=b):b=e[34],b},"an"),Cc=o(t=>{let e=t._id??t.id??t.__id__??"";return typeof e=="string"?e:typeof e=="number"?e.toString():""},"Lo"),yc=o(async(t,e,n,l)=>{try{let r=await l(t,e,n),a=r.rows.flatMap(i=>Cc(i)||[]).slice(0,Hn),s=r.total??0;return{capNote:s>Hn?`showing first ${Hn.toString()} of ${s.toString()}`:void 0,rowCount:s,rowIds:a}}catch{return{capNote:"count unavailable",rowCount:0,rowIds:[]}}},"Vo"),vs=o(async(t,e,n,l,r,a,s)=>{let{capNote:i,rowCount:c,rowIds:u}=n===void 0?{capNote:void 0,rowCount:1,rowIds:[e]}:await yc(t,n.field,e,s),d=n?.onDelete==="restrict",g=[],m=`${t}:${e}`,h=a>=fs;if(!r.has(m)&&!h){r.add(m);let b=l.get(t)??[];for(let w of b)for(let _ of u.slice(0,10)){let S=await vs(w.table,_,w,l,r,a+1,s);(S.rowCount>0||a===0)&&g.push(S)}r.delete(m)}let p=i;if(h){let b=`depth capped at ${fs.toString()}`;p=i===void 0?b:`${i}; ${b}`}return{capNote:p,children:g,isRestrict:d,relation:n,rowCount:c,rowIds:u,table:t}},"cn"),vc=o(({onClose:t,onConfirm:e,readPage:n,rowId:l,schema:r,table:a})=>{let s=oe(),[i,c]=(0,D.useState)(!0),[u,d]=(0,D.useState)(null),[g,m]=(0,D.useState)(null);(0,D.useEffect)(()=>{let b=!1;return re((async()=>{try{c(!0),m(null);let w=gc(r);if(!((w.get(a)??[]).length>0)){b||(d({capNote:void 0,children:[],isRestrict:!1,relation:void 0,rowCount:1,rowIds:[l],table:a}),c(!1));return}let _=await vs(a,l,void 0,w,new Set,0,n);b||(d(_),c(!1))}catch(w){b||(m(w.message),c(!1))}})()),()=>{b=!0}},[l,a]);let h=u!==null&&fc(u,b=>b.isRestrict).length>0,p=o(()=>{e(),t()},"u");return(0,f.jsxs)(Ht,{label:"Cascade impact preview",onClose:t,panelTestId:"cascade-panel",testId:"cascade-overlay",variant:"dialog",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,f.jsx)("h3",{className:"text-base text-foreground","data-testid":"cascade-title",children:s("Cascade impact")}),(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-desc",children:s("Delete preview \u2014 rows that would cascade or be blocked")})]}),(0,f.jsx)("button",{className:"text-xs text-muted-foreground hover:text-foreground","data-testid":"cascade-close",onClick:t,type:"button",children:s("Close")})]}),i&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-loading",children:s("Loading\u2026")}),g!==null&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"cascade-error",role:"alert",children:g}),!i&&u!==null&&(0,f.jsx)("ul",{className:"flex flex-col","data-testid":"cascade-tree",children:(0,f.jsx)(ys,{depth:0,node:u})}),!i&&u!==null&&u.children.length===0&&(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"cascade-no-impact",children:s("No related rows found.")}),h&&(0,f.jsx)("p",{className:"text-sm font-medium text-destructive","data-testid":"cascade-blocker-warning",role:"alert",children:s("Restrict relations will block this delete.")}),(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,f.jsx)("button",{className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"cascade-cancel",onClick:t,type:"button",children:s("Cancel")}),(0,f.jsx)("button",{className:"rounded-md bg-destructive px-3 py-1.5 text-xs font-medium text-destructive-foreground outline-none transition-colors hover:bg-destructive/90 focus-visible:bg-destructive/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"cascade-confirm",disabled:i,onClick:p,type:"button",children:s("Delete")})]})]})},"Bo"),Rc=o((t,e,n,l,r=300)=>{if(l<=0)return{ids:new Set(t.map(g=>g.id)),leadPx:0,tailPx:0};let a=n-r,s=n+l+r,i=new Set,c=0,u=0,d=0;for(let g of t){let m=g.getSize(),h=e.has(g.id),p=c+m>a&&c<s;h||p?i.add(g.id):c<a?u+=m:d+=m,c+=m}return{ids:i,leadPx:u,tailPx:d}},"jo"),Ic=o((t,e)=>{let n=new Map,l=0;for(let r of t)e.has(r.id)&&(n.set(r.id,l),l+=r.getSize());return n},"zo"),Fc={columnOrderingFeature:To,columnResizingFeature:Ho,columnSizingFeature:Lo,columnVisibilityFeature:jo,rowSelectionFeature:Yo,rowSortingFeature:Zo,sortedRowModel:er(),sortFns:{alphanumeric:Co,basic:Mt,datetime:vo,text:yo}},Mc=o(()=>{let t=(0,q.c)(12),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let[n,l]=(0,D.useState)(e),r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=o((b,w,_)=>{l(S=>({...S,[b]:{...S[b],[w]:_}}))},"t"),t[1]=r):r=t[1];let a=r,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=o(()=>{l({})},"l"),t[2]=s):s=t[2];let i=s,c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=o((b,w)=>{l(_=>{let S=_[b];if(S===void 0)return _;let v=Object.fromEntries(Object.entries(S).filter(I=>{let[C,R]=I;return!(C in w)||!Object.is(R,w[C])}));return Object.keys(v).length===0?Object.fromEntries(Object.entries(_).filter(I=>{let[C]=I;return C!==b})):{..._,[b]:v}})},"a"),t[3]=c):c=t[3];let u=c,d;t[4]!==n?(d=o((b,w)=>{let _=n[b];return _!==void 0&&w in _?{value:_[w]}:void 0},"f"),t[4]=n,t[5]=d):d=t[5];let g=d,m;t[6]!==n?(m=Object.values(n).reduce(Pc,0),t[6]=n,t[7]=m):m=t[7];let h=m,p;return t[8]!==h||t[9]!==n||t[10]!==g?(p={clear:i,count:h,drop:u,stage:a,staged:n,stagedValue:g},t[8]=h,t[9]=n,t[10]=g,t[11]=p):p=t[11],p},"Ko"),Rs=o((t,e)=>{if(typeof e=="number"){let n=Number(t);return t.trim()===""||Number.isNaN(n)?t:n}if(typeof e=="boolean"){if(t==="true")return!0;if(t==="false")return!1}return t},"dn"),kc=o(t=>{let e=(0,q.c)(29),{changes:n,committing:l,onCommit:r,onDiscard:a}=t,s=oe(),i;e[0]!==n.length||e[1]!==s?(i=s("{count} pending changes",{count:n.length}),e[0]=n.length,e[1]=s,e[2]=i):i=e[2];let c;e[3]!==i?(c=(0,f.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-warning","data-testid":"db-staged-count",children:i}),e[3]=i,e[4]=c):c=e[4];let u;e[5]!==l||e[6]!==s?(u=s(l?"Committing\u2026":"Commit"),e[5]=l,e[6]=s,e[7]=u):u=e[7];let d;e[8]!==l||e[9]!==r||e[10]!==u?(d=(0,f.jsx)("button",{className:"ms-auto rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-commit",disabled:l,onClick:r,type:"button",children:u}),e[8]=l,e[9]=r,e[10]=u,e[11]=d):d=e[11];let g;e[12]!==s?(g=s("Discard"),e[12]=s,e[13]=g):g=e[13];let m;e[14]!==l||e[15]!==a||e[16]!==g?(m=(0,f.jsx)("button",{className:"rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"db-staged-discard",disabled:l,onClick:a,type:"button",children:g}),e[14]=l,e[15]=a,e[16]=g,e[17]=m):m=e[17];let h;e[18]!==c||e[19]!==d||e[20]!==m?(h=(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d,m]}),e[18]=c,e[19]=d,e[20]=m,e[21]=h):h=e[21];let p;e[22]!==n?(p=n.map(Nc),e[22]=n,e[23]=p):p=e[23];let b;e[24]!==p?(b=(0,f.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"db-staged-list",children:p}),e[24]=p,e[25]=b):b=e[25];let w;return e[26]!==h||e[27]!==b?(w=(0,f.jsxs)("div",{className:"flex flex-col gap-2 border border-warning/40 bg-warning/5 p-3","data-testid":"db-staged",children:[h,b]}),e[26]=h,e[27]=b,e[28]=w):w=e[28],w},"Go");function Pc(t,e){return t+Object.keys(e).length}o(Pc,"Jo");function Nc(t){return(0,f.jsxs)("li",{className:"flex flex-wrap items-center gap-2 font-mono text-xs",children:[(0,f.jsxs)("span",{className:"text-muted-foreground",children:[t.rowId,".",t.column]}),(0,f.jsx)("span",{className:"text-destructive line-through",children:Te(t.oldValue)}),(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2192"}),(0,f.jsx)("span",{className:"text-foreground",children:Te(t.newValue)})]},`${t.rowId}:${t.column}`)}o(Nc,"Wo");var ps=400,Dc=36,Ac={flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"},Oc={width:"100%"},Tc=/\n$/u,Ec={alignItems:"center",display:"flex",left:0,position:"absolute",top:0,width:"100%"},Vc={display:"flex",width:"100%"},bs={flex:"0 0 8.5rem",padding:"0.375rem 0.75rem"},zc="2.5rem",Is={alignItems:"center",display:"flex",flex:"0 0 2.5rem",justifyContent:"center",left:0,padding:"0.375rem 0",position:"sticky",zIndex:2},sr=o(t=>({flex:"0 0 auto",overflow:"hidden",padding:"0.375rem 0.75rem",position:"relative",textOverflow:"ellipsis",whiteSpace:"nowrap",width:`${t.toString()}px`}),"Ft"),Fs=o((t,e)=>({...sr(t),left:`calc(${zc} + ${e.toString()}px)`,position:"sticky",zIndex:2}),"fn"),nr="rounded-md px-2 py-0.5 text-xs font-medium text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",$c=o((t,e,n)=>e.enabled&&e.columns.has(n)?void 0:t,"ts"),lr="__back__:",Hc=o(t=>`${lr}${t.table}.${t.column}`,"ns"),Lc=o(t=>{let e=(0,q.c)(3),{counts:n,rowId:l}=t;if(n===void 0){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,f.jsx)("span",{className:"text-muted-foreground/50",children:"\u2014"}),e[0]=s):s=e[0],s}let r=n[l]??0,a;return e[1]!==r?(a=(0,f.jsx)("span",{className:"tabular-nums",children:r}),e[1]=r,e[2]=a):a=e[2],a},"os"),Ze=o(t=>{for(let e of["id","__id__","_id"]){let n=t[e];if(typeof n=="string"||typeof n=="number")return String(n)}return null},"Pe"),jc=o((t,e)=>{if(e.enumValues!==void 0&&e.enumValues.length>0)return e.enumValues.includes(t)||t===""&&e.nullable===!0?{value:t===""?null:t}:void 0;if(e.type==="boolean")return t==="true"||t==="false"?{value:t==="true"}:void 0;if(e.type==="number"){let n=Number(t);return t.trim()===""||!Number.isFinite(n)?void 0:{value:n}}return{value:t}},"ss"),Bc=o((t,e,n)=>{if(n!==void 0&&n.type!=="any")return jc(t,n);let l=Rs(t,e);return typeof e=="number"&&typeof l!="number"?void 0:{value:l}},"ls"),Gc=o(({anchor:t,columnIds:e,columnMeta:n,editableColumn:l,rows:r,text:a})=>{let s=a.replaceAll(`\r
|
|
3
3
|
`,`
|
|
4
4
|
`).replace(Tc,"").split(`
|