@lunora/studio 1.0.0-alpha.338 → 1.0.0-alpha.339
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-HC6E6BIJ.js → chunk-2SNK7KHX.js} +1 -1
- package/dist/standalone/{chunk-GABRCO5N.js → chunk-3FYMEXVB.js} +1 -1
- package/dist/standalone/{chunk-Q5CSRWLU.js → chunk-3N5PRV3V.js} +1 -1
- package/dist/standalone/{chunk-BCGCD4CO.js → chunk-43GV7LQK.js} +1 -1
- package/dist/standalone/{chunk-YXW7GATV.js → chunk-4NOMAGEO.js} +1 -1
- package/dist/standalone/{chunk-OYDOFRRB.js → chunk-5SLTDY4C.js} +1 -1
- package/dist/standalone/{chunk-AHQIBM3C.js → chunk-5Y5UTG4N.js} +1 -1
- package/dist/standalone/{chunk-VVB3GENM.js → chunk-6XKL22OG.js} +2 -2
- package/dist/standalone/{chunk-7VF6QXGR.js → chunk-6ZSIPBTC.js} +1 -1
- package/dist/standalone/{chunk-7LPVTOAF.js → chunk-7GVT36VI.js} +1 -1
- package/dist/standalone/{chunk-GNX7VKQY.js → chunk-APEQELK3.js} +1 -1
- package/dist/standalone/{chunk-DW67E5WI.js → chunk-BFQMOALO.js} +1 -1
- package/dist/standalone/{chunk-QZFWP5PG.js → chunk-BTG6YDYM.js} +1 -1
- package/dist/standalone/{chunk-DXC6YGNT.js → chunk-BTQ72TPT.js} +1 -1
- package/dist/standalone/{chunk-STF2OPKL.js → chunk-DBHZXRL6.js} +1 -1
- package/dist/standalone/{chunk-YI7WVSMX.js → chunk-DBZ4TBP5.js} +1 -1
- package/dist/standalone/{chunk-Z277L2BQ.js → chunk-DEFCA7GG.js} +1 -1
- package/dist/standalone/{chunk-NWWMHMGA.js → chunk-DHGPCQ2F.js} +1 -1
- package/dist/standalone/{chunk-O75FH2VA.js → chunk-E5DXYVPB.js} +1 -1
- package/dist/standalone/{chunk-G5DO7HSE.js → chunk-EE227HDE.js} +1 -1
- package/dist/standalone/{chunk-CG7AWLQB.js → chunk-ENIA26XP.js} +1 -1
- package/dist/standalone/{chunk-H4BEW5RF.js → chunk-FCXFQF2W.js} +1 -1
- package/dist/standalone/{chunk-JIWDKEGI.js → chunk-FUL4ROKH.js} +1 -1
- package/dist/standalone/{chunk-RZAWVHB7.js → chunk-G2F22AMT.js} +1 -1
- package/dist/standalone/{chunk-ROX3SLF7.js → chunk-GC4XRCRZ.js} +1 -1
- package/dist/standalone/{chunk-4KMJQGIN.js → chunk-GOFZ4Y74.js} +1 -1
- package/dist/standalone/{chunk-7WWDCRLQ.js → chunk-GWVYDOBH.js} +1 -1
- package/dist/standalone/{chunk-KRSOII6O.js → chunk-GYBCO7NN.js} +1 -1
- package/dist/standalone/{chunk-UQJRKAQX.js → chunk-HCFJBY65.js} +1 -1
- package/dist/standalone/{chunk-V65TMRRH.js → chunk-HGHIVU76.js} +1 -1
- package/dist/standalone/{chunk-5NCDYUAL.js → chunk-HH52IEFY.js} +1 -1
- package/dist/standalone/{chunk-W77PDXGW.js → chunk-HPYJUVCC.js} +1 -1
- package/dist/standalone/{chunk-YJ5SU2PD.js → chunk-ICRKYAYO.js} +1 -1
- package/dist/standalone/{chunk-LXQGF74P.js → chunk-IRSSZXC3.js} +1 -1
- package/dist/standalone/{chunk-VVRT5OAX.js → chunk-ITT6MM23.js} +1 -1
- package/dist/standalone/{chunk-VVGQZR53.js → chunk-JR4ROUBB.js} +1 -1
- package/dist/standalone/{chunk-H6MI6GGH.js → chunk-K3UAOIR7.js} +1 -1
- package/dist/standalone/{chunk-6LNSHLOB.js → chunk-KCFO2BVI.js} +1 -1
- package/dist/standalone/{chunk-G2YF7RNG.js → chunk-KF7Y5S5O.js} +1 -1
- package/dist/standalone/{chunk-EJ7YAEPM.js → chunk-LHG2JVIM.js} +1 -1
- package/dist/standalone/{chunk-BAWEGZ7T.js → chunk-M3QKMHAP.js} +1 -1
- package/dist/standalone/{chunk-QYLNHUWI.js → chunk-NCBLHBRW.js} +1 -1
- package/dist/standalone/chunk-NCCORPSU.js +7 -0
- package/dist/standalone/{chunk-UEHILSMN.js → chunk-O2FW4VRL.js} +1 -1
- package/dist/standalone/{chunk-NQZ5IJWF.js → chunk-OI5HX3ZO.js} +1 -1
- package/dist/standalone/{chunk-XSW4R2MI.js → chunk-OLIKYC3C.js} +1 -1
- package/dist/standalone/{chunk-MFUYHLXW.js → chunk-R3ADWOYR.js} +1 -1
- package/dist/standalone/{chunk-WYP2Z35M.js → chunk-RB3WPSY5.js} +1 -1
- package/dist/standalone/{chunk-3DNOCE5K.js → chunk-SC6P4M3S.js} +1 -1
- package/dist/standalone/{chunk-YGV4V7VT.js → chunk-SU6QNITV.js} +1 -1
- package/dist/standalone/{chunk-VTLEHQAN.js → chunk-T6IV7OKH.js} +1 -1
- package/dist/standalone/{chunk-LVNRJL4S.js → chunk-UIIKW4II.js} +1 -1
- package/dist/standalone/{chunk-2JD6VLW7.js → chunk-UJQNKTYE.js} +1 -1
- package/dist/standalone/{chunk-5B4SQYIP.js → chunk-UVL7N5IL.js} +1 -1
- package/dist/standalone/{chunk-GDD7FNZA.js → chunk-VENSZ6LF.js} +1 -1
- package/dist/standalone/{chunk-4ZISAQ2B.js → chunk-VJ7RCBJ7.js} +1 -1
- package/dist/standalone/{chunk-2OOWQRI5.js → chunk-VNMKNORK.js} +1 -1
- package/dist/standalone/{chunk-CMVOO3MU.js → chunk-VVCXVAA7.js} +1 -1
- package/dist/standalone/{chunk-EFT6JH6H.js → chunk-VXJJSPX3.js} +1 -1
- package/dist/standalone/{chunk-CHYVUB6Y.js → chunk-WUI2PUY6.js} +1 -1
- package/dist/standalone/{chunk-3FRBAQI7.js → chunk-WVYIBXUH.js} +1 -1
- package/dist/standalone/{chunk-SKTCA3PL.js → chunk-XBQ66PGW.js} +1 -1
- package/dist/standalone/{chunk-LQM7KUEA.js → chunk-YZ72ZAGX.js} +1 -1
- package/dist/standalone/{chunk-M27YVZWM.js → chunk-ZJQIGWLG.js} +1 -1
- package/dist/standalone/{chunk-OPXOPRI2.js → chunk-ZKV2XC5B.js} +1 -1
- package/dist/standalone/{chunk-TNXRQCSI.js → chunk-ZPNTFCVI.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +5 -5
- package/dist/standalone/chunk-3JVXNEBO.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as y}from"./chunk-
|
|
1
|
+
import{b as u}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as y}from"./chunk-ZJQIGWLG.js";import"./chunk-NCPW7WHO.js";import"./chunk-IRSSZXC3.js";import"./chunk-55UGUCQ6.js";import{a as N}from"./chunk-4ZEL6BYL.js";import{c as v}from"./chunk-DHGPCQ2F.js";import"./chunk-NCCORPSU.js";import"./chunk-QAQDMS6R.js";import"./chunk-M3QKMHAP.js";import{a as g}from"./chunk-RWVIV3U7.js";import{a as w,b,c as S,d as c,e as s,f as o}from"./chunk-HCTJKP5J.js";import{a as f,e as x}from"./chunk-2IKDEUCX.js";import{d as p}from"./chunk-74IYYDDI.js";import{a as n,d as R,g as T}from"./chunk-I26MS5PJ.js";var e=R(T(),1);var $={active:"default",failing:"destructive",idle:"secondary"},j=n(a=>a===void 0?"\u2014":`${new Date(a).toISOString().slice(0,19).replace("T"," ")} UTC`,"I"),U=n(a=>{let t=a.runs+a.suppressed;return t===0?void 0:Math.round(a.suppressed/t*100)},"$"),F=n(({initialShardKey:a=""})=>{let t=p(),{data:l,error:E,errorSource:A,liveError:I}=v(N.listReactors,{},{live:!0,shardKey:a}),C=l!==void 0,i=Array.isArray(l?.reactors)?l.reactors:[],d;C&&i.length===0?d=(0,e.jsx)(g,{description:t("No reactor is declared in this deployment. Export an onQueryChange(select, handler) from lunora/ to run server-side logic when a query's result changes."),testId:"reactors-empty",title:t("No reactors declared")}):d=(0,e.jsx)(f,{className:"overflow-hidden py-0",children:(0,e.jsx)(x,{className:"px-0",children:(0,e.jsxs)(w,{"data-testid":"reactors-table",children:[(0,e.jsx)(b,{children:(0,e.jsxs)(c,{children:[(0,e.jsx)(s,{children:t("Reactor")}),(0,e.jsx)(s,{children:t("State")}),(0,e.jsx)(s,{children:t("Ran")}),(0,e.jsx)(s,{children:t("Suppressed")}),(0,e.jsx)(s,{children:t("Errors")}),(0,e.jsx)(s,{children:t("Watches")}),(0,e.jsx)(s,{children:t("Last dispatch")})]})}),(0,e.jsx)(S,{children:i.map(r=>{let m=U(r);return(0,e.jsxs)(c,{"data-testid":`reactors-row-${r.path}`,children:[(0,e.jsx)(o,{className:"font-mono text-xs",children:r.path}),(0,e.jsx)(o,{children:(0,e.jsx)(u,{"data-testid":`reactors-state-${r.path}`,variant:$[r.state],children:r.state})}),(0,e.jsx)(o,{className:"font-mono text-xs",children:r.runs}),(0,e.jsxs)(o,{className:"font-mono text-xs text-muted-foreground",children:[r.suppressed,m===void 0?"":` (${String(m)}%)`]}),(0,e.jsx)(o,{className:"font-mono text-xs",children:r.errors===0?(0,e.jsx)("span",{className:"text-muted-foreground",children:"0"}):(0,e.jsx)("span",{className:"text-destructive",children:r.errors})}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:r.tables===void 0||r.tables.length===0?"\u2014":r.tables.join(", ")}),(0,e.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:j(r.lastRanAt)})]},r.path)})})]})})});let h=i.filter(r=>r.state==="failing");return(0,e.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-reactors-panel",children:[E!==null&&(0,e.jsx)(y,{error:A,testId:"reactors-error"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("A reactor runs after a write flush, but only when the result of the query it watches actually changed \u2014 a trigger fires on a row write, a reactor fires on a result changing. Suppressed dispatches are the ones where the read re-ran and nothing had moved.")}),h.length>0&&(0,e.jsx)("div",{className:"flex flex-col gap-2","data-testid":"reactors-failing",children:h.map(r=>(0,e.jsxs)("p",{className:"text-xs text-destructive",role:"alert",children:[(0,e.jsx)("span",{className:"font-mono",children:r.path}),": ",r.lastError??t("last dispatch failed")]},r.path))}),I!==void 0&&(0,e.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-500","data-testid":"reactors-live-error",role:"alert",children:t("Live updates unavailable; showing the last reading.")}),d]})},"U");export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-OYDOFRRB.js";import{a as H}from"./chunk-LXCVA5SP.js";import{a as ee}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as Z}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{b as E}from"./chunk-NWWMHMGA.js";import{l as R}from"./chunk-3JVXNEBO.js";import"./chunk-QAQDMS6R.js";import"./chunk-BAWEGZ7T.js";import{a as _}from"./chunk-RWVIV3U7.js";import{a as K,b as V,c as z,d as F,e as u,f as p}from"./chunk-HCTJKP5J.js";import{a as A,e as T}from"./chunk-2IKDEUCX.js";import{d as M,h as G,q as W,u as X}from"./chunk-74IYYDDI.js";import{a as c,d as P,e as oe,f as re,g as ae}from"./chunk-I26MS5PJ.js";var U=P(re(),1),Y=P(oe(),1);var t=P(ae(),1);var se=P(re(),1);var Q=P(oe(),1);var h=P(ae(),1);var ie=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","X"),le=c(a=>a.toSorted((e,i)=>e.scheduledFor-i.scheduledFor),"F"),ce=c((a,e,i)=>e!==void 0?e:i===void 0?d=>a.cancelScheduledJob(d):void 0,"Y"),de=c(a=>{let e=(0,se.c)(16),{cancelJob:i,loadJobs:d}=a===void 0?{}:a,f=R(),r=M(),l=d===void 0,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["lunora-scheduled-jobs"],e[0]=o):o=e[0];let N=E(o,async()=>{let v=await(d??(()=>f.listScheduledJobs()))();return le(v)}),[x,n]=(0,Q.useState)(void 0),[s,m]=(0,Q.useState)(void 0),y,k;e[1]!==f||e[2]!==l?(y=c(()=>{if(l)return f.subscribeScheduledJobs(v=>{m(void 0),n(le(v))})},"v"),k=[l,f],e[1]=f,e[2]=l,e[3]=y,e[4]=k):(y=e[3],k=e[4]),(0,Q.useEffect)(y,k);let g;e[5]!==N?(g=c(()=>N.poll(),"y"),e[5]=N,e[6]=g):g=e[6],O(g,!l);let J=ce(f,i,d),b=x??N.data,j=s??N.error,I=c(async v=>{if(J!==void 0){m(void 0);try{await J(v),l||N.refetch()}catch(D){m(G(D))}}},"A"),q="flex flex-col gap-3",B="lunora-scheduled-jobs",S;e[7]!==j?(S=j!==null&&(0,h.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:j}),e[7]=j,e[8]=S):S=e[8];let L;e[9]!==b?.length||e[10]!==r?(L=b?.length===0&&(0,h.jsx)(_,{description:r("Jobs queued with runAfter / runAt will appear here."),icon:(0,h.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,h.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:r("No scheduled jobs.")}),e[9]=b?.length,e[10]=r,e[11]=L):L=e[11];let $=b!==void 0&&b.length>0&&(0,h.jsx)(A,{className:"overflow-hidden py-0",children:(0,h.jsx)(T,{className:"px-0",children:(0,h.jsxs)(K,{"data-testid":"sj-table",children:[(0,h.jsx)(V,{children:(0,h.jsxs)(F,{children:[(0,h.jsx)(u,{children:r("function")}),(0,h.jsx)(u,{children:r("scheduled for")}),(0,h.jsx)(u,{children:r("pool")}),(0,h.jsx)(u,{children:r("attempts")}),(0,h.jsx)(u,{children:r("shard")}),(0,h.jsx)(u,{children:r("id")}),J!==void 0&&(0,h.jsx)(u,{"aria-label":r("Actions")})]})}),(0,h.jsx)(z,{children:b.map(v=>(0,h.jsxs)(F,{"data-testid":`sj-row-${v.id}`,children:[(0,h.jsx)(p,{className:"font-mono text-xs",children:v.workflow??v.functionPath}),(0,h.jsx)(p,{className:"text-muted-foreground tabular-nums",children:ie(v.scheduledFor)}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.pool??""}),(0,h.jsx)(p,{className:"tabular-nums",children:v.attempts??0}),(0,h.jsx)(p,{children:v.shardKey??""}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.id}),J!==void 0&&(0,h.jsx)(p,{className:"text-right",children:(0,h.jsx)(H,{confirmLabel:r("Cancel job?"),onConfirm:c(()=>{W(I(v.id))},"onConfirm"),testId:`sj-cancel-${v.id}`,children:r("Cancel")})})]},v.id))})]})})}),w;return e[12]!==$||e[13]!==S||e[14]!==L?(w=(0,h.jsxs)("div",{className:q,"data-testid":B,children:[S,L,$]}),e[12]=$,e[13]=S,e[14]=L,e[15]=w):w=e[15],w},"he");var he={kind:"idle"},me=c((a,e,i)=>i!==void 0?i:e===void 0?d=>a.runCronJob(d):void 0,"re"),ue=c(({loadCronJobs:a,runCronJob:e}={})=>{let i=R(),d=M(),[f,r]=(0,Y.useState)({}),l=E(["lunora-cron-jobs",a?"custom":"default"],()=>(a??(()=>i.getCronJobs()))()),{data:o,error:N}=l,x=me(i,a,e),n=c(async s=>{if(x!==void 0){r(m=>({...m,[s]:{kind:"running"}}));try{await x(s),r(m=>({...m,[s]:{kind:"ok"}})),l.refetch()}catch(m){r(y=>({...y,[s]:{kind:"error",message:G(m)}}))}}},"i");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),o?.length===0&&(0,t.jsx)(_,{description:d("Triggers declared with the cronJobs() builder appear here."),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)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:d("No cron triggers.")}),o!==void 0&&o.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"cron-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:d("name")}),(0,t.jsx)(u,{children:d("schedule")}),(0,t.jsx)(u,{children:d("target")}),(0,t.jsx)(u,{children:d("shard")}),x!==void 0&&(0,t.jsx)(u,{"aria-label":d("Actions")})]})}),(0,t.jsx)(z,{children:o.map(s=>{let m=f[s.name]??he;return(0,t.jsxs)(F,{"data-testid":`cron-row-${s.name}`,children:[(0,t.jsx)(p,{children:s.name}),(0,t.jsx)(p,{className:"font-mono text-xs tabular-nums",children:s.cron}),(0,t.jsx)(p,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[s.workflow===void 0?(0,t.jsx)(Z,{variant:"outline",children:d("function")}):(0,t.jsx)(Z,{variant:"secondary",children:d("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.workflow??s.functionPath})]})}),(0,t.jsx)(p,{children:s.shardKey??""}),x!==void 0&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[m.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${s.name}`,children:d("ran")}),m.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${s.name}`,role:"alert",children:m.message}),(0,t.jsx)(H,{confirmLabel:d("Run now?"),disabled:m.kind==="running",onConfirm:c(()=>{W(n(s.name))},"onConfirm"),testId:`cron-run-${s.name}`,children:m.kind==="running"?d("Running\u2026"):d("Run now")})]})})]},`${s.cron}:${s.name}`)})})]})})})]})},"le"),pe=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","se"),fe=c(a=>{let e=(0,U.c)(34),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadJobs:d,removeJob:f,retryJob:r}=i,l=R(),o=M(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let x;e[3]!==l||e[4]!==d?(x=c(async()=>(await(d??(()=>l.listDeadJobs()))()).toSorted(be),"h"),e[3]=l,e[4]=d,e[5]=x):x=e[5];let n=E(N,x),s=n.data,[m,y]=(0,Y.useState)(void 0),k=n.error??m,g=d===void 0,J;e[6]!==l||e[7]!==g||e[8]!==r?(J=r??(g?C=>l.retryDeadJob(C):void 0),e[6]=l,e[7]=g,e[8]=r,e[9]=J):J=e[9];let b=J,j;e[10]!==l||e[11]!==g||e[12]!==f?(j=f??(g?C=>l.removeDeadJob(C):void 0),e[10]=l,e[11]=g,e[12]=f,e[13]=j):j=e[13];let I=j,q;e[14]!==n?(q=c(()=>n.poll(),"$"),e[14]=n,e[15]=q):q=e[15],O(q,!0);let B;e[16]!==n?(B=c(async C=>{y(void 0);try{await C,n.refetch()}catch(ne){y(G(ne))}},"I"),e[16]=n,e[17]=B):B=e[17];let S=B,L=b!==void 0||I!==void 0,$;e[18]!==k?($=k!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:k}),e[18]=k,e[19]=$):$=e[19];let w;e[20]!==s?.length||e[21]!==o?(w=s?.length===0&&(0,t.jsx)(_,{description:o("Jobs that exhaust their retry budget are parked here instead of being dropped."),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:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:o("No dead-letter jobs.")}),e[20]=s?.length,e[21]=o,e[22]=w):w=e[22];let v;e[23]!==S||e[24]!==L||e[25]!==s||e[26]!==I||e[27]!==b||e[28]!==o?(v=s!==void 0&&s.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"dlq-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:o("function")}),(0,t.jsx)(u,{children:o("attempts")}),(0,t.jsx)(u,{children:o("last tried")}),(0,t.jsx)(u,{children:o("pool")}),(0,t.jsx)(u,{children:o("shard")}),(0,t.jsx)(u,{children:o("id")}),L&&(0,t.jsx)(u,{"aria-label":o("Actions")})]})}),(0,t.jsx)(z,{children:s.map(C=>(0,t.jsxs)(F,{"data-testid":`dlq-row-${C.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:C.workflow??C.functionPath}),(0,t.jsx)(p,{className:"tabular-nums",children:C.attempts??0}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:pe(C.scheduledFor)}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.pool??""}),(0,t.jsx)(p,{children:C.shardKey??""}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.id}),L&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsx)(ee,{"data-testid":`dlq-retry-${C.id}`,onClick:c(()=>{W(S(b(C.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Retry")}),I!==void 0&&(0,t.jsx)(H,{confirmLabel:o("Drop job?"),onConfirm:c(()=>{W(S(I(C.id)))},"onConfirm"),testId:`dlq-remove-${C.id}`,children:o("Drop")})]})})]},C.id))})]})})}),e[23]=S,e[24]=L,e[25]=s,e[26]=I,e[27]=b,e[28]=o,e[29]=v):v=e[29];let D;return e[30]!==v||e[31]!==$||e[32]!==w?(D=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,w,v]}),e[30]=v,e[31]=$,e[32]=w,e[33]=D):D=e[33],D},"ne");function be(a,e){return(e.attempts??0)-(a.attempts??0)}c(be,"oe");var te=c(a=>{let e=(0,U.c)(8),{label:i,testId:d,value:f}=a,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==d||e[3]!==f?(l=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":d,children:f}),e[2]=d,e[3]=f,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o=(0,t.jsx)(A,{className:"flex-1 py-0",children:(0,t.jsxs)(T,{className:"flex flex-col gap-1 p-4",children:[r,l]})}),e[5]=r,e[6]=l,e[7]=o):o=e[7],o},"E"),ve=c(a=>{let e=(0,U.c)(25),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadStatus:d}=i,f=R(),r=M(),l=d===void 0,o;e[2]!==l?(o=["lunora-scheduler-status",l],e[2]=l,e[3]=o):o=e[3];let N;e[4]!==f||e[5]!==d?(N=c(async()=>{let j=await(d??(()=>f.schedulerStatus()))();return{...j,pools:j.pools.toSorted(xe)}},"y"),e[4]=f,e[5]=d,e[6]=N):N=e[6];let x=E(o,N),{data:n,error:s}=x,m;e[7]!==x?(m=c(()=>x.poll(),"d"),e[7]=x,e[8]=m):m=e[8],O(m,!0);let y;e[9]!==s?(y=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:s}),e[9]=s,e[10]=y):y=e[10];let k;e[11]!==n||e[12]!==r?(k=n!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(te,{label:r("backlog"),testId:"pools-backlog",value:n.backlog}),(0,t.jsx)(te,{label:r("in flight"),testId:"pools-inflight",value:n.inFlight}),(0,t.jsx)(te,{label:r("pools"),testId:"pools-count",value:n.pools.length})]}),e[11]=n,e[12]=r,e[13]=k):k=e[13];let g;e[14]!==n?.pools.length||e[15]!==r?(g=n?.pools.length===0&&(0,t.jsx)(_,{description:r("Pools created with createWorkpool appear here once they have activity."),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:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:r("No workpools.")}),e[14]=n?.pools.length,e[15]=r,e[16]=g):g=e[16];let J;e[17]!==n||e[18]!==r?(J=n!==void 0&&n.pools.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"pools-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:r("pool")}),(0,t.jsx)(u,{children:r("queued")}),(0,t.jsx)(u,{children:r("in flight")}),(0,t.jsx)(u,{children:r("max concurrency")})]})}),(0,t.jsx)(z,{children:n.pools.map(ge)})]})})}),e[17]=n,e[18]=r,e[19]=J):J=e[19];let b;return e[20]!==y||e[21]!==k||e[22]!==g||e[23]!==J?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[y,k,g,J]}),e[20]=y,e[21]=k,e[22]=g,e[23]=J,e[24]=b):b=e[24],b},"ae");function xe(a,e){return e.queued-a.queued}c(xe,"ie");function ge(a){return(0,t.jsxs)(F,{"data-testid":`pools-row-${a.name}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:a.name}),(0,t.jsx)(p,{className:"tabular-nums",children:a.queued}),(0,t.jsxs)(p,{className:"tabular-nums",children:[a.inFlight," / ",a.maxConcurrency]}),(0,t.jsx)(p,{className:"tabular-nums",children:a.maxConcurrency})]},a.name)}c(ge,"de");var Ne=["jobs","dead","pools","cron"],Ve=c(a=>{let e=(0,U.c)(41),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadCronJobs:d,scheduledCancel:f,scheduledLoad:r}=i,l=M(),[o,N]=(0,Y.useState)("jobs"),x;e[2]!==l?(x=l("Cron triggers"),e[2]=l,e[3]=x):x=e[3];let n;e[4]!==l?(n=l("Dead letter"),e[4]=l,e[5]=n):n=e[5];let s;e[6]!==l?(s=l("Scheduled jobs"),e[6]=l,e[7]=s):s=e[7];let m;e[8]!==l?(m=l("Pools"),e[8]=l,e[9]=m):m=e[9];let y;e[10]!==x||e[11]!==n||e[12]!==s||e[13]!==m?(y={cron:x,dead:n,jobs:s,pools:m},e[10]=x,e[11]=n,e[12]=s,e[13]=m,e[14]=y):y=e[14];let k=y,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c(w=>{N(w.currentTarget.dataset.view)},"f"),e[15]=g):g=e[15];let J=g,b;e[16]!==l?(b=l("Schedule view"),e[16]=l,e[17]=b):b=e[17];let j;e[18]!==o||e[19]!==k?(j=Ne.map(w=>(0,t.jsx)(ee,{"aria-selected":o===w,"data-testid":`schedule-view-${w}`,"data-view":w,onClick:J,role:"tab",size:"sm",type:"button",variant:o===w?"default":"outline",children:k[w]},w)),e[18]=o,e[19]=k,e[20]=j):j=e[20];let I;e[21]!==b||e[22]!==j?(I=(0,t.jsx)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:j}),e[21]=b,e[22]=j,e[23]=I):I=e[23];let q;e[24]!==f||e[25]!==r||e[26]!==o?(q=o==="jobs"&&(0,t.jsx)(de,{cancelJob:f,loadJobs:r}),e[24]=f,e[25]=r,e[26]=o,e[27]=q):q=e[27];let B;e[28]!==o?(B=o==="dead"&&(0,t.jsx)(fe,{}),e[28]=o,e[29]=B):B=e[29];let S;e[30]!==o?(S=o==="pools"&&(0,t.jsx)(ve,{}),e[30]=o,e[31]=S):S=e[31];let L;e[32]!==d||e[33]!==o?(L=o==="cron"&&(0,t.jsx)(ue,{loadCronJobs:d}),e[32]=d,e[33]=o,e[34]=L):L=e[34];let $;return e[35]!==I||e[36]!==q||e[37]!==B||e[38]!==S||e[39]!==L?($=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,q,B,S,L]}),e[35]=I,e[36]=q,e[37]=B,e[38]=S,e[39]=L,e[40]=$):$=e[40],$},"Ie");export{Ve as SchedulePanel};
|
|
1
|
+
import{a as O}from"./chunk-5SLTDY4C.js";import{a as H}from"./chunk-LXCVA5SP.js";import{a as ee}from"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as Z}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{b as E}from"./chunk-DHGPCQ2F.js";import{l as R}from"./chunk-NCCORPSU.js";import"./chunk-QAQDMS6R.js";import"./chunk-M3QKMHAP.js";import{a as _}from"./chunk-RWVIV3U7.js";import{a as K,b as V,c as z,d as F,e as u,f as p}from"./chunk-HCTJKP5J.js";import{a as A,e as T}from"./chunk-2IKDEUCX.js";import{d as M,h as G,q as W,u as X}from"./chunk-74IYYDDI.js";import{a as c,d as P,e as oe,f as re,g as ae}from"./chunk-I26MS5PJ.js";var U=P(re(),1),Y=P(oe(),1);var t=P(ae(),1);var se=P(re(),1);var Q=P(oe(),1);var h=P(ae(),1);var ie=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","X"),le=c(a=>a.toSorted((e,i)=>e.scheduledFor-i.scheduledFor),"F"),ce=c((a,e,i)=>e!==void 0?e:i===void 0?d=>a.cancelScheduledJob(d):void 0,"Y"),de=c(a=>{let e=(0,se.c)(16),{cancelJob:i,loadJobs:d}=a===void 0?{}:a,f=R(),r=M(),l=d===void 0,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["lunora-scheduled-jobs"],e[0]=o):o=e[0];let N=E(o,async()=>{let v=await(d??(()=>f.listScheduledJobs()))();return le(v)}),[x,n]=(0,Q.useState)(void 0),[s,m]=(0,Q.useState)(void 0),y,k;e[1]!==f||e[2]!==l?(y=c(()=>{if(l)return f.subscribeScheduledJobs(v=>{m(void 0),n(le(v))})},"v"),k=[l,f],e[1]=f,e[2]=l,e[3]=y,e[4]=k):(y=e[3],k=e[4]),(0,Q.useEffect)(y,k);let g;e[5]!==N?(g=c(()=>N.poll(),"y"),e[5]=N,e[6]=g):g=e[6],O(g,!l);let J=ce(f,i,d),b=x??N.data,j=s??N.error,I=c(async v=>{if(J!==void 0){m(void 0);try{await J(v),l||N.refetch()}catch(D){m(G(D))}}},"A"),q="flex flex-col gap-3",B="lunora-scheduled-jobs",S;e[7]!==j?(S=j!==null&&(0,h.jsx)("p",{className:"text-sm text-destructive","data-testid":"sj-error",role:"alert",children:j}),e[7]=j,e[8]=S):S=e[8];let L;e[9]!==b?.length||e[10]!==r?(L=b?.length===0&&(0,h.jsx)(_,{description:r("Jobs queued with runAfter / runAt will appear here."),icon:(0,h.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,h.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,h.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"sj-empty",title:r("No scheduled jobs.")}),e[9]=b?.length,e[10]=r,e[11]=L):L=e[11];let $=b!==void 0&&b.length>0&&(0,h.jsx)(A,{className:"overflow-hidden py-0",children:(0,h.jsx)(T,{className:"px-0",children:(0,h.jsxs)(K,{"data-testid":"sj-table",children:[(0,h.jsx)(V,{children:(0,h.jsxs)(F,{children:[(0,h.jsx)(u,{children:r("function")}),(0,h.jsx)(u,{children:r("scheduled for")}),(0,h.jsx)(u,{children:r("pool")}),(0,h.jsx)(u,{children:r("attempts")}),(0,h.jsx)(u,{children:r("shard")}),(0,h.jsx)(u,{children:r("id")}),J!==void 0&&(0,h.jsx)(u,{"aria-label":r("Actions")})]})}),(0,h.jsx)(z,{children:b.map(v=>(0,h.jsxs)(F,{"data-testid":`sj-row-${v.id}`,children:[(0,h.jsx)(p,{className:"font-mono text-xs",children:v.workflow??v.functionPath}),(0,h.jsx)(p,{className:"text-muted-foreground tabular-nums",children:ie(v.scheduledFor)}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.pool??""}),(0,h.jsx)(p,{className:"tabular-nums",children:v.attempts??0}),(0,h.jsx)(p,{children:v.shardKey??""}),(0,h.jsx)(p,{className:"font-mono text-xs",children:v.id}),J!==void 0&&(0,h.jsx)(p,{className:"text-right",children:(0,h.jsx)(H,{confirmLabel:r("Cancel job?"),onConfirm:c(()=>{W(I(v.id))},"onConfirm"),testId:`sj-cancel-${v.id}`,children:r("Cancel")})})]},v.id))})]})})}),w;return e[12]!==$||e[13]!==S||e[14]!==L?(w=(0,h.jsxs)("div",{className:q,"data-testid":B,children:[S,L,$]}),e[12]=$,e[13]=S,e[14]=L,e[15]=w):w=e[15],w},"he");var he={kind:"idle"},me=c((a,e,i)=>i!==void 0?i:e===void 0?d=>a.runCronJob(d):void 0,"re"),ue=c(({loadCronJobs:a,runCronJob:e}={})=>{let i=R(),d=M(),[f,r]=(0,Y.useState)({}),l=E(["lunora-cron-jobs",a?"custom":"default"],()=>(a??(()=>i.getCronJobs()))()),{data:o,error:N}=l,x=me(i,a,e),n=c(async s=>{if(x!==void 0){r(m=>({...m,[s]:{kind:"running"}}));try{await x(s),r(m=>({...m,[s]:{kind:"ok"}})),l.refetch()}catch(m){r(y=>({...y,[s]:{kind:"error",message:G(m)}}))}}},"i");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-cron-triggers",children:[N!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"cron-error",role:"alert",children:N}),o?.length===0&&(0,t.jsx)(_,{description:d("Triggers declared with the cronJobs() builder appear here."),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)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M12 7.5V12l4 2"})]}),testId:"cron-empty",title:d("No cron triggers.")}),o!==void 0&&o.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"cron-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:d("name")}),(0,t.jsx)(u,{children:d("schedule")}),(0,t.jsx)(u,{children:d("target")}),(0,t.jsx)(u,{children:d("shard")}),x!==void 0&&(0,t.jsx)(u,{"aria-label":d("Actions")})]})}),(0,t.jsx)(z,{children:o.map(s=>{let m=f[s.name]??he;return(0,t.jsxs)(F,{"data-testid":`cron-row-${s.name}`,children:[(0,t.jsx)(p,{children:s.name}),(0,t.jsx)(p,{className:"font-mono text-xs tabular-nums",children:s.cron}),(0,t.jsx)(p,{children:(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[s.workflow===void 0?(0,t.jsx)(Z,{variant:"outline",children:d("function")}):(0,t.jsx)(Z,{variant:"secondary",children:d("workflow")}),(0,t.jsx)("span",{className:"font-mono text-xs",children:s.workflow??s.functionPath})]})}),(0,t.jsx)(p,{children:s.shardKey??""}),x!==void 0&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("span",{className:"flex items-center justify-end gap-2",children:[m.kind==="ok"&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":`cron-ran-${s.name}`,children:d("ran")}),m.kind==="error"&&(0,t.jsx)("span",{className:"text-xs text-destructive","data-testid":`cron-run-error-${s.name}`,role:"alert",children:m.message}),(0,t.jsx)(H,{confirmLabel:d("Run now?"),disabled:m.kind==="running",onConfirm:c(()=>{W(n(s.name))},"onConfirm"),testId:`cron-run-${s.name}`,children:m.kind==="running"?d("Running\u2026"):d("Run now")})]})})]},`${s.cron}:${s.name}`)})})]})})})]})},"le"),pe=c(a=>Number.isFinite(a)?X(a,"\u2014"):"\u2014","se"),fe=c(a=>{let e=(0,U.c)(34),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadJobs:d,removeJob:f,retryJob:r}=i,l=R(),o=M(),N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=["lunora-dead-jobs"],e[2]=N):N=e[2];let x;e[3]!==l||e[4]!==d?(x=c(async()=>(await(d??(()=>l.listDeadJobs()))()).toSorted(be),"h"),e[3]=l,e[4]=d,e[5]=x):x=e[5];let n=E(N,x),s=n.data,[m,y]=(0,Y.useState)(void 0),k=n.error??m,g=d===void 0,J;e[6]!==l||e[7]!==g||e[8]!==r?(J=r??(g?C=>l.retryDeadJob(C):void 0),e[6]=l,e[7]=g,e[8]=r,e[9]=J):J=e[9];let b=J,j;e[10]!==l||e[11]!==g||e[12]!==f?(j=f??(g?C=>l.removeDeadJob(C):void 0),e[10]=l,e[11]=g,e[12]=f,e[13]=j):j=e[13];let I=j,q;e[14]!==n?(q=c(()=>n.poll(),"$"),e[14]=n,e[15]=q):q=e[15],O(q,!0);let B;e[16]!==n?(B=c(async C=>{y(void 0);try{await C,n.refetch()}catch(ne){y(G(ne))}},"I"),e[16]=n,e[17]=B):B=e[17];let S=B,L=b!==void 0||I!==void 0,$;e[18]!==k?($=k!==void 0&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"dlq-error",role:"alert",children:k}),e[18]=k,e[19]=$):$=e[19];let w;e[20]!==s?.length||e[21]!==o?(w=s?.length===0&&(0,t.jsx)(_,{description:o("Jobs that exhaust their retry budget are parked here instead of being dropped."),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:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"})}),testId:"dlq-empty",title:o("No dead-letter jobs.")}),e[20]=s?.length,e[21]=o,e[22]=w):w=e[22];let v;e[23]!==S||e[24]!==L||e[25]!==s||e[26]!==I||e[27]!==b||e[28]!==o?(v=s!==void 0&&s.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"dlq-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:o("function")}),(0,t.jsx)(u,{children:o("attempts")}),(0,t.jsx)(u,{children:o("last tried")}),(0,t.jsx)(u,{children:o("pool")}),(0,t.jsx)(u,{children:o("shard")}),(0,t.jsx)(u,{children:o("id")}),L&&(0,t.jsx)(u,{"aria-label":o("Actions")})]})}),(0,t.jsx)(z,{children:s.map(C=>(0,t.jsxs)(F,{"data-testid":`dlq-row-${C.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:C.workflow??C.functionPath}),(0,t.jsx)(p,{className:"tabular-nums",children:C.attempts??0}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:pe(C.scheduledFor)}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.pool??""}),(0,t.jsx)(p,{children:C.shardKey??""}),(0,t.jsx)(p,{className:"font-mono text-xs",children:C.id}),L&&(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[b!==void 0&&(0,t.jsx)(ee,{"data-testid":`dlq-retry-${C.id}`,onClick:c(()=>{W(S(b(C.id)))},"onClick"),size:"sm",type:"button",variant:"outline",children:o("Retry")}),I!==void 0&&(0,t.jsx)(H,{confirmLabel:o("Drop job?"),onConfirm:c(()=>{W(S(I(C.id)))},"onConfirm"),testId:`dlq-remove-${C.id}`,children:o("Drop")})]})})]},C.id))})]})})}),e[23]=S,e[24]=L,e[25]=s,e[26]=I,e[27]=b,e[28]=o,e[29]=v):v=e[29];let D;return e[30]!==v||e[31]!==$||e[32]!==w?(D=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-dead-letter",children:[$,w,v]}),e[30]=v,e[31]=$,e[32]=w,e[33]=D):D=e[33],D},"ne");function be(a,e){return(e.attempts??0)-(a.attempts??0)}c(be,"oe");var te=c(a=>{let e=(0,U.c)(8),{label:i,testId:d,value:f}=a,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i}),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==d||e[3]!==f?(l=(0,t.jsx)("span",{className:"text-2xl font-semibold tabular-nums","data-testid":d,children:f}),e[2]=d,e[3]=f,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o=(0,t.jsx)(A,{className:"flex-1 py-0",children:(0,t.jsxs)(T,{className:"flex flex-col gap-1 p-4",children:[r,l]})}),e[5]=r,e[6]=l,e[7]=o):o=e[7],o},"E"),ve=c(a=>{let e=(0,U.c)(25),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadStatus:d}=i,f=R(),r=M(),l=d===void 0,o;e[2]!==l?(o=["lunora-scheduler-status",l],e[2]=l,e[3]=o):o=e[3];let N;e[4]!==f||e[5]!==d?(N=c(async()=>{let j=await(d??(()=>f.schedulerStatus()))();return{...j,pools:j.pools.toSorted(xe)}},"y"),e[4]=f,e[5]=d,e[6]=N):N=e[6];let x=E(o,N),{data:n,error:s}=x,m;e[7]!==x?(m=c(()=>x.poll(),"d"),e[7]=x,e[8]=m):m=e[8],O(m,!0);let y;e[9]!==s?(y=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"pools-error",role:"alert",children:s}),e[9]=s,e[10]=y):y=e[10];let k;e[11]!==n||e[12]!==r?(k=n!==void 0&&(0,t.jsxs)("div",{className:"flex gap-3","data-testid":"pools-totals",children:[(0,t.jsx)(te,{label:r("backlog"),testId:"pools-backlog",value:n.backlog}),(0,t.jsx)(te,{label:r("in flight"),testId:"pools-inflight",value:n.inFlight}),(0,t.jsx)(te,{label:r("pools"),testId:"pools-count",value:n.pools.length})]}),e[11]=n,e[12]=r,e[13]=k):k=e[13];let g;e[14]!==n?.pools.length||e[15]!==r?(g=n?.pools.length===0&&(0,t.jsx)(_,{description:r("Pools created with createWorkpool appear here once they have activity."),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:"M4 7h16M4 12h16M4 17h16"})}),testId:"pools-empty",title:r("No workpools.")}),e[14]=n?.pools.length,e[15]=r,e[16]=g):g=e[16];let J;e[17]!==n||e[18]!==r?(J=n!==void 0&&n.pools.length>0&&(0,t.jsx)(A,{className:"overflow-hidden py-0",children:(0,t.jsx)(T,{className:"px-0",children:(0,t.jsxs)(K,{"data-testid":"pools-table",children:[(0,t.jsx)(V,{children:(0,t.jsxs)(F,{children:[(0,t.jsx)(u,{children:r("pool")}),(0,t.jsx)(u,{children:r("queued")}),(0,t.jsx)(u,{children:r("in flight")}),(0,t.jsx)(u,{children:r("max concurrency")})]})}),(0,t.jsx)(z,{children:n.pools.map(ge)})]})})}),e[17]=n,e[18]=r,e[19]=J):J=e[19];let b;return e[20]!==y||e[21]!==k||e[22]!==g||e[23]!==J?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-scheduler-pools",children:[y,k,g,J]}),e[20]=y,e[21]=k,e[22]=g,e[23]=J,e[24]=b):b=e[24],b},"ae");function xe(a,e){return e.queued-a.queued}c(xe,"ie");function ge(a){return(0,t.jsxs)(F,{"data-testid":`pools-row-${a.name}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:a.name}),(0,t.jsx)(p,{className:"tabular-nums",children:a.queued}),(0,t.jsxs)(p,{className:"tabular-nums",children:[a.inFlight," / ",a.maxConcurrency]}),(0,t.jsx)(p,{className:"tabular-nums",children:a.maxConcurrency})]},a.name)}c(ge,"de");var Ne=["jobs","dead","pools","cron"],Ve=c(a=>{let e=(0,U.c)(41),i;e[0]!==a?(i=a===void 0?{}:a,e[0]=a,e[1]=i):i=e[1];let{loadCronJobs:d,scheduledCancel:f,scheduledLoad:r}=i,l=M(),[o,N]=(0,Y.useState)("jobs"),x;e[2]!==l?(x=l("Cron triggers"),e[2]=l,e[3]=x):x=e[3];let n;e[4]!==l?(n=l("Dead letter"),e[4]=l,e[5]=n):n=e[5];let s;e[6]!==l?(s=l("Scheduled jobs"),e[6]=l,e[7]=s):s=e[7];let m;e[8]!==l?(m=l("Pools"),e[8]=l,e[9]=m):m=e[9];let y;e[10]!==x||e[11]!==n||e[12]!==s||e[13]!==m?(y={cron:x,dead:n,jobs:s,pools:m},e[10]=x,e[11]=n,e[12]=s,e[13]=m,e[14]=y):y=e[14];let k=y,g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=c(w=>{N(w.currentTarget.dataset.view)},"f"),e[15]=g):g=e[15];let J=g,b;e[16]!==l?(b=l("Schedule view"),e[16]=l,e[17]=b):b=e[17];let j;e[18]!==o||e[19]!==k?(j=Ne.map(w=>(0,t.jsx)(ee,{"aria-selected":o===w,"data-testid":`schedule-view-${w}`,"data-view":w,onClick:J,role:"tab",size:"sm",type:"button",variant:o===w?"default":"outline",children:k[w]},w)),e[18]=o,e[19]=k,e[20]=j):j=e[20];let I;e[21]!==b||e[22]!==j?(I=(0,t.jsx)("div",{"aria-label":b,className:"flex gap-1.5","data-testid":"schedule-view-toggle",role:"tablist",children:j}),e[21]=b,e[22]=j,e[23]=I):I=e[23];let q;e[24]!==f||e[25]!==r||e[26]!==o?(q=o==="jobs"&&(0,t.jsx)(de,{cancelJob:f,loadJobs:r}),e[24]=f,e[25]=r,e[26]=o,e[27]=q):q=e[27];let B;e[28]!==o?(B=o==="dead"&&(0,t.jsx)(fe,{}),e[28]=o,e[29]=B):B=e[29];let S;e[30]!==o?(S=o==="pools"&&(0,t.jsx)(ve,{}),e[30]=o,e[31]=S):S=e[31];let L;e[32]!==d||e[33]!==o?(L=o==="cron"&&(0,t.jsx)(ue,{loadCronJobs:d}),e[32]=d,e[33]=o,e[34]=L):L=e[34];let $;return e[35]!==I||e[36]!==q||e[37]!==B||e[38]!==S||e[39]!==L?($=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schedule",children:[I,q,B,S,L]}),e[35]=I,e[36]=q,e[37]=B,e[38]=S,e[39]=L,e[40]=$):$=e[40],$},"Ie");export{Ve as SchedulePanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Er,b as pt,c as Vr,d as pn}from"./chunk-O75FH2VA.js";import{a as gn}from"./chunk-S4Z7K55A.js";import{b as mn}from"./chunk-5B2RTXBS.js";import{d as Hr}from"./chunk-UYEZR3BI.js";import{a as fn,b as $e,f as zr,g as $r}from"./chunk-4CGBMYO3.js";import{a as dn}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 un}from"./chunk-7RKB5KS7.js";import{a as Ht}from"./chunk-QJLHH3ET.js";import{a as io}from"./chunk-37WYCOQ2.js";import{a as cn}from"./chunk-PSMQQV6S.js";import{a as sn,b as Tr}from"./chunk-OYDOFRRB.js";import{b as vr,c as ro}from"./chunk-CCDX5RYT.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import{a as co}from"./chunk-IWZ7GVQO.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import{a as so}from"./chunk-LXCVA5SP.js";import{a as kr}from"./chunk-7Q256NLI.js";import{a as Fr,b as Mr}from"./chunk-ZKJS6EBE.js";import{b as Rr,c as Ir,f as lo}from"./chunk-RGMVGZV4.js";import{c as hr,d as wr,e as xr,f as it,g as on,h as Sr,i as _r}from"./chunk-OQ6I6OXT.js";import{i as Cr}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 oo,c as ct}from"./chunk-NWWMHMGA.js";import{b as eo,c as to,d as nn,e as br,l as nt}from"./chunk-3JVXNEBO.js";import"./chunk-QAQDMS6R.js";import"./chunk-BAWEGZ7T.js";import{a as ln}from"./chunk-RWVIV3U7.js";import{a as Pr,b as Nr,c as Dr,d as ao,e as Ar,f as Or}from"./chunk-HCTJKP5J.js";import{d as re,f as Ve,g as ze,h as $t,n as no,o as an,p as Te,q as te,u as yr}from"./chunk-74IYYDDI.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 Ts=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 gi=2166136261,fi=16777619,pi=o((t,e=gi)=>{let n=e;for(let l=0;l<t.length;l+=1)n^=t.charCodeAt(l),n=Math.imul(n,fi);return(n>>>0).toString(16).padStart(8,"0")},"L"),bi=/([a-z\d])([A-Z])/gu,hi=/[\s_-]+/u,wi=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),xi=o(t=>{let e=t.replaceAll(bi,"$1 $2").split(hi).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]},"ae"),Lr="\u2022\u2022\u2022",Ur=o((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:pi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):Lr}catch{return Lr}},"U"),jr=o((t,e)=>{let n=new Map;for(let l of t)l.table===e&&n.set(l.column,l.strategy);return n},"V"),Si=o(t=>{for(let e of xi(t))if(wi.has(e))return!0;return!1},"ce"),Br=o((t,e)=>{let n=e.filter(r=>!t.has(r)&&Si(r));if(n.length===0)return t;let l=new Map(t);for(let r of n)l.set(r,"redact");return l},"j"),Lt=o((t,e,n)=>{if(!n.enabled)return t;let l=n.columns.get(e);return l===void 0?t:Ur(t,l)},"_e"),bn=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]=Ur(n[l],r));return n},"ie"),hn=o((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>bn(n,e)),"Me"),Gr=o(t=>t==null?"\u2205":t===""?"(empty)":Te(t),"z"),_i=o(t=>{let e=(0,Rt.c)(32),{column:n,onFacetFilter:l,state:r}=t,a=re(),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:Gr(_.value)}),(0,Y.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:_.count})]},Gr(_.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},"ue"),wn=o(t=>{let e=(0,Rt.c)(44),{columns:n,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,i=re(),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)(_i,{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},"Te"),xn=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;throw e(u=>a in u?{...u,[a]:{error:$t(c),loading:!1,result:null}}:u),c}},"n");return{clearFacets:o(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:o(a=>Tr(Object.keys(n.current).map(s=>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&&te(r(a,s))},"toggleFacet")}},"$e"),Ci=[],yi=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:Ci},"fe"),Sn=o(t=>{let e=(0,Rt.c)(16),{columns:n,selectedTable:l}=t,r=yi(),[a,s]=(0,ot.useState)(!0),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(()=>{s(vi)},"g"),e[0]=i):i=e[0];let c=i,u;if(e[1]!==n||e[2]!==r||e[3]!==l){let b=jr(r,l??"");u=Br(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:Br(jr(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},"Re");function vi(t){return!t}o(vi,"me");var qr=34,Kr=600,Ri=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},"ge"),_n=o(({header:t,onReload:e,onSelect:n,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let i=re(),[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=mn({count:m.length,estimateSize:o(()=>qr,"estimateSize"),getScrollElement:o(()=>d.current,"getScrollElement"),initialRect:{height:Kr,width:240},observeElementRect:o((b,w)=>gn(b,w,Kr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*qr};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)(Ri,{item:w,onSelect:n,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=Me(zt(),1);var Jr=Me(gt(),1);function Ii(t){return Fi(t)||typeof t=="function"||Mi(t)}o(Ii,"isReactComponent");function Fi(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}o(Fi,"isClassComponent");function Mi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}o(Mi,"isExoticComponent");function bt(t,e){return t==null?null:Ii(t)?Jr.default.createElement(t,e):t}o(bt,"flexRender");function uo(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(uo,"FlexRender");function Wr(t){let e=on(t.source,t.selector,{compare:it});return typeof t.children=="function"?t.children(e):t.children}o(Wr,"Subscribe");function Xr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}o(Xr,"atomToStore");function mo(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(mo,"renderPhaseReactivity");function go(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(go,"createRenderPhaseSource");function Qr(){return mo({createAtom:xr,batch:wr})}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 Cn(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(Cn,"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 Yr(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(Yr,"isPlainContainer");function Zr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}o(Zr,"getEnumerableOwnKeys");var ki=3;function Pi(t,e){return el(t,e,ki)}o(Pi,"stateSlicesEqual");function el(t,e,n){if(Object.is(t,e))return!0;if(n<=0||!Yr(t)||!Yr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Zr(t),r=Zr(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)||!el(a[c],s[c],n-1))return!1}return!0}o(el,"stateSlicesEqualAtDepth");function He(t,e,n,l=Pi){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 tl(t){return t instanceof Function}o(tl,"isFunction");function nl(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(nl,"flattenBy");var Ni=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 yn(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}o(yn,"skipFirstRun");var Di=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 ${Di(`${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 Er,b as pt,c as Vr,d as pn}from"./chunk-E5DXYVPB.js";import{a as gn}from"./chunk-S4Z7K55A.js";import{b as mn}from"./chunk-5B2RTXBS.js";import{d as Hr}from"./chunk-UYEZR3BI.js";import{a as fn,b as $e,f as zr,g as $r}from"./chunk-4CGBMYO3.js";import{a as dn}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 un}from"./chunk-7RKB5KS7.js";import{a as Ht}from"./chunk-QJLHH3ET.js";import{a as io}from"./chunk-37WYCOQ2.js";import{a as cn}from"./chunk-PSMQQV6S.js";import{a as sn,b as Tr}from"./chunk-5SLTDY4C.js";import{b as vr,c as ro}from"./chunk-CCDX5RYT.js";import"./chunk-OYCUPD3Q.js";import"./chunk-NXQW5E6W.js";import"./chunk-UC7MNI2F.js";import{a as co}from"./chunk-IWZ7GVQO.js";import"./chunk-NGVP66OH.js";import"./chunk-GHQ2VDI2.js";import{a as so}from"./chunk-LXCVA5SP.js";import{a as kr}from"./chunk-7Q256NLI.js";import{a as Fr,b as Mr}from"./chunk-ZKJS6EBE.js";import{b as Rr,c as Ir,f as lo}from"./chunk-RGMVGZV4.js";import{c as hr,d as wr,e as xr,f as it,g as on,h as Sr,i as _r}from"./chunk-OQ6I6OXT.js";import{i as Cr}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 oo,c as ct}from"./chunk-DHGPCQ2F.js";import{b as eo,c as to,d as nn,e as br,l as nt}from"./chunk-NCCORPSU.js";import"./chunk-QAQDMS6R.js";import"./chunk-M3QKMHAP.js";import{a as ln}from"./chunk-RWVIV3U7.js";import{a as Pr,b as Nr,c as Dr,d as ao,e as Ar,f as Or}from"./chunk-HCTJKP5J.js";import{d as re,f as Ve,g as ze,h as $t,n as no,o as an,p as Te,q as te,u as yr}from"./chunk-74IYYDDI.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 Ts=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 gi=2166136261,fi=16777619,pi=o((t,e=gi)=>{let n=e;for(let l=0;l<t.length;l+=1)n^=t.charCodeAt(l),n=Math.imul(n,fi);return(n>>>0).toString(16).padStart(8,"0")},"L"),bi=/([a-z\d])([A-Z])/gu,hi=/[\s_-]+/u,wi=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),xi=o(t=>{let e=t.replaceAll(bi,"$1 $2").split(hi).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]},"ae"),Lr="\u2022\u2022\u2022",Ur=o((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:pi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):Lr}catch{return Lr}},"U"),jr=o((t,e)=>{let n=new Map;for(let l of t)l.table===e&&n.set(l.column,l.strategy);return n},"V"),Si=o(t=>{for(let e of xi(t))if(wi.has(e))return!0;return!1},"ce"),Br=o((t,e)=>{let n=e.filter(r=>!t.has(r)&&Si(r));if(n.length===0)return t;let l=new Map(t);for(let r of n)l.set(r,"redact");return l},"j"),Lt=o((t,e,n)=>{if(!n.enabled)return t;let l=n.columns.get(e);return l===void 0?t:Ur(t,l)},"_e"),bn=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]=Ur(n[l],r));return n},"ie"),hn=o((t,e)=>!e.enabled||e.columns.size===0?t:t.map(n=>bn(n,e)),"Me"),Gr=o(t=>t==null?"\u2205":t===""?"(empty)":Te(t),"z"),_i=o(t=>{let e=(0,Rt.c)(32),{column:n,onFacetFilter:l,state:r}=t,a=re(),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:Gr(_.value)}),(0,Y.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:_.count})]},Gr(_.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},"ue"),wn=o(t=>{let e=(0,Rt.c)(44),{columns:n,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,i=re(),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)(_i,{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},"Te"),xn=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;throw e(u=>a in u?{...u,[a]:{error:$t(c),loading:!1,result:null}}:u),c}},"n");return{clearFacets:o(()=>{e({})},"clearFacets"),facets:t,facetsRef:n,refetchFacets:o(a=>Tr(Object.keys(n.current).map(s=>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&&te(r(a,s))},"toggleFacet")}},"$e"),Ci=[],yi=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:Ci},"fe"),Sn=o(t=>{let e=(0,Rt.c)(16),{columns:n,selectedTable:l}=t,r=yi(),[a,s]=(0,ot.useState)(!0),i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(()=>{s(vi)},"g"),e[0]=i):i=e[0];let c=i,u;if(e[1]!==n||e[2]!==r||e[3]!==l){let b=jr(r,l??"");u=Br(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:Br(jr(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},"Re");function vi(t){return!t}o(vi,"me");var qr=34,Kr=600,Ri=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},"ge"),_n=o(({header:t,onReload:e,onSelect:n,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let i=re(),[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=mn({count:m.length,estimateSize:o(()=>qr,"estimateSize"),getScrollElement:o(()=>d.current,"getScrollElement"),initialRect:{height:Kr,width:240},observeElementRect:o((b,w)=>gn(b,w,Kr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*qr};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)(Ri,{item:w,onSelect:n,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=Me(zt(),1);var Jr=Me(gt(),1);function Ii(t){return Fi(t)||typeof t=="function"||Mi(t)}o(Ii,"isReactComponent");function Fi(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}o(Fi,"isClassComponent");function Mi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}o(Mi,"isExoticComponent");function bt(t,e){return t==null?null:Ii(t)?Jr.default.createElement(t,e):t}o(bt,"flexRender");function uo(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(uo,"FlexRender");function Wr(t){let e=on(t.source,t.selector,{compare:it});return typeof t.children=="function"?t.children(e):t.children}o(Wr,"Subscribe");function Xr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}o(Xr,"atomToStore");function mo(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(mo,"renderPhaseReactivity");function go(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(go,"createRenderPhaseSource");function Qr(){return mo({createAtom:xr,batch:wr})}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 Cn(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(Cn,"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 Yr(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(Yr,"isPlainContainer");function Zr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}o(Zr,"getEnumerableOwnKeys");var ki=3;function Pi(t,e){return el(t,e,ki)}o(Pi,"stateSlicesEqual");function el(t,e,n){if(Object.is(t,e))return!0;if(n<=0||!Yr(t)||!Yr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Zr(t),r=Zr(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)||!el(a[c],s[c],n-1))return!1}return!0}o(el,"stateSlicesEqualAtDepth");function He(t,e,n,l=Pi){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 tl(t){return t instanceof Function}o(tl,"isFunction");function nl(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(nl,"flattenBy");var Ni=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 yn(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}o(yn,"skipFirstRun");var Di=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 ${Di(`${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 Ni({...a,...{onAfterUpdate:o(()=>{g()},"onAfterUpdate")}})}o(Ft,"tableMemo");function ol(t,e="_"){let[n,l]=t.split(e);return{fnKey:l,fnName:`${n}.${l}`,parentName:n}}o(ol,"getFunctionNameInfo");function fe(t,e,n){for(let[l,{fn:r,memoDeps:a}]of Object.entries(n)){let{fnKey:s,fnName:i}=ol(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}=ol(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 rl(t){return t.row.getValue(t.column.id)}o(rl,"cell_getValue");function ll(t){return t.getValue()??t.table.options.renderFallbackValue}o(ll,"cell_renderValue");function al(t){return{table:t.table,column:t.column,row:t.row,cell:t,getValue:o(()=>t.getValue(),"getValue"),renderValue:o(()=>t.renderValue(),"renderValue")}}o(al,"cell_getContext");var sl={assignCellPrototype:o((t,e)=>{ce("coreCellsFeature",t,e,{cell_getValue:{fn:o(n=>rl(n),"fn")},cell_renderValue:{fn:o(n=>ll(n),"fn")},cell_getContext:{fn:o(n=>al(n),"fn"),memoDeps:o(n=>[n],"memoDeps")}})},"assignCellPrototype")};function Ai(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(Ai,"getHeaderPrototype");function fo(t,e,n){let l=Ai(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(fo,"constructHeader");function Xe(){return{start:[],end:[]}}o(Xe,"getDefaultColumnPinningState");function il(t){let e=t.getAllColumns(),n=t.getAllLeafColumnsById(),{start:l}=t.atoms.columnPinning?.get()??Xe(),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(il,"table_getStartHeaderGroups");function cl(t){let e=t.getAllColumns(),n=t.getAllLeafColumnsById(),{end:l}=t.atoms.columnPinning?.get()??Xe(),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(cl,"table_getEndHeaderGroups");function ul(t){let e=t.getAllColumns(),n=V(t,"getVisibleLeafColumns",ht),{start:l,end:r}=t.atoms.columnPinning?.get()??Xe();if(l.length||r.length){let a=[...l,...r];n=n.filter(s=>!a.includes(s.id))}return wt(e,n,t,"center")}o(ul,"table_getCenterHeaderGroups");function Oi(t){let{start:e}=t.atoms.columnPinning?.get()??Xe(),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_getStartLeafColumns");function Ti(t){let{end:e}=t.atoms.columnPinning?.get()??Xe(),n=t.getAllLeafColumnsById(),l=[];for(let r=0;r<e.length;r++){let a=n[e[r]];a&&l.push(a)}return l}o(Ti,"table_getEndLeafColumns");function Ei(t){let{start:e,end:n}=t.atoms.columnPinning?.get()??Xe();if(!e.length&&!n.length)return t.getAllLeafColumns();let l=[...e,...n];return t.getAllLeafColumns().filter(r=>!l.includes(r.id))}o(Ei,"table_getCenterLeafColumns");function Vi(t){return V(t,"getStartLeafColumns",Oi).filter(e=>V(e,"getIsVisible",ue))}o(Vi,"table_getStartVisibleLeafColumns");function zi(t){return V(t,"getEndLeafColumns",Ti).filter(e=>V(e,"getIsVisible",ue))}o(zi,"table_getEndVisibleLeafColumns");function $i(t){return V(t,"getCenterLeafColumns",Ei).filter(e=>V(e,"getIsVisible",ue))}o($i,"table_getCenterVisibleLeafColumns");function Ge(t,e){return e?e==="start"?V(t,"getStartVisibleLeafColumns",Vi):e==="end"?V(t,"getEndVisibleLeafColumns",zi):V(t,"getCenterVisibleLeafColumns",$i):V(t,"getVisibleLeafColumns",ht)}o(Ge,"table_getPinnedVisibleLeafColumns");function dl(){return H()}o(dl,"getDefaultColumnVisibilityState");function bo(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(bo,"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 ml(t){return e=>{bo(t,e.target.checked)}}o(ml,"column_getToggleVisibilityHandler");function po(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()??Xe();if(!l.length&&!r.length)return n;let a=V(t,"getVisibleCellsByColumnId",vn),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(po,"row_getVisibleCells");function vn(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(vn,"row_getVisibleCellsByColumnId");function gl(t){return t.getAllFlatColumns().filter(e=>V(e,"getIsVisible",ue))}o(gl,"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 fl(t,e){Bt(t,e?H():Object.assign(H(),ie(t.initialState.columnVisibility??{})))}o(fl,"table_resetColumnVisibility");function ho(t,e){e=e??!wo(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(ho,"table_toggleAllColumnsVisible");function wo(t){return!t.getAllLeafColumns().some(e=>!V(e,"getIsVisible",ue))}o(wo,"table_getIsAllColumnsVisible");function pl(t){return t.getAllLeafColumns().some(e=>V(e,"getIsVisible",ue))}o(pl,"table_getIsSomeColumnsVisible");function bl(t){return e=>{ho(t,e.target.checked)}}o(bl,"table_getToggleAllColumnsVisibilityHandler");function hl(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,hl(r.columns,e+1)))}return n}o(hl,"getMaxHeaderDepth");function Hi(t,e){return t?`${t}_${e}`:String(e)}o(Hi,"formatHeaderGroupId");function Li(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(Li,"formatHeaderId");function ji(t,e){let n=0;for(let l=0;l<t.length;l++)t[l].column===e&&n++;return n}o(ji,"countPendingHeadersForColumn");function wl(t,e,n,l,r,a){let s={depth:e,id:Hi(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=fo(n,m,{id:Li(l,e,m.id,u.id),isPlaceholder:h,placeholderId:h?String(ji(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&&wl(i,e-1,n,l,r,a)}o(wl,"constructHeaderGroup");function xl(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){xl(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(xl,"updateHeaderSpans");function wt(t,e,n,l){let r=hl(t),a=[],s=n._headerGroupInstanceInitFns,i=new Array(e.length);for(let c=0;c<e.length;c++)c in e&&(i[c]=fo(n,e[c],{depth:r,index:c}));return wl(i,r-1,n,l,a,s),a.reverse(),xl(a[0]?.headers??[]),a}o(wt,"buildHeaderGroups");function Bi(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(Bi,"getColumnPrototype");function Sl(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=Bi(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(Sl,"constructColumn");function _l(){return[]}o(_l,"getDefaultColumnOrderState");function xo(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(xo,"table_getColumnIndexes");function Cl(t,e){return V(t.table,"getColumnIndexes",xo)[e==="start"?"start":e==="end"?"end":e==="center"?"center":"all"][t.id]??-1}o(Cl,"column_getIndex");function yl(t,e){return Ge(t.table,e)[0]?.id===t.id}o(yl,"column_getIsFirstColumn");function vl(t,e){let n=Ge(t.table,e);return n[n.length-1]?.id===t.id}o(vl,"column_getIsLastColumn");function So(t,e){He(t,"columnOrder",e)}o(So,"table_setColumnOrder");function Rl(t,e){So(t,e?[]:ie(t.initialState.columnOrder??[]))}o(Rl,"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 Gi(t,l)}}o(Gt,"table_getOrderColumnsFn");function Gi(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(Gi,"orderColumns");function Il(t){return[t,...t.columns.flatMap(e=>e.getFlatColumns())]}o(Il,"column_getFlatColumns");function Fl(t){if(t.columns.length){let e=t.columns.flatMap(n=>n.getLeafColumns());return V(t.table,"getOrderColumns",Gt)(e)}return[t]}o(Fl,"column_getLeafColumns");function Ml(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(Ml,"table_getDefaultColumnDef");function kl(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=Sl(t,s,l,n),c=s;i.columns=c.columns?kl(t,c.columns,i,l+1):[],r[a]=i}return r}o(kl,"constructColumns");function Pl(t){return kl(t,t.options.columns)}o(Pl,"table_getAllColumns");function Nl(t){return t.getAllColumns().flatMap(e=>e.getFlatColumns())}o(Nl,"table_getAllFlatColumns");function Dl(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(Dl,"table_getAllFlatColumnsById");function Al(t){let e=t.getAllColumns().flatMap(n=>n.getLeafColumns());return V(t,"getOrderColumns",Gt)(e)}o(Al,"table_getAllLeafColumns");function Ol(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(Ol,"table_getAllLeafColumnsById");function Tl(t,e){return t.getAllFlatColumnsById()[e]}o(Tl,"table_getColumn");var El={assignColumnPrototype:o((t,e)=>{ce("coreColumnsFeature",t,e,{column_getFlatColumns:{fn:o(n=>Il(n),"fn"),memoDeps:o(n=>[n.table.options.columns],"memoDeps")},column_getLeafColumns:{fn:o(n=>Fl(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(()=>Ml(t),"fn"),memoDeps:o(()=>[t.options.defaultColumn],"memoDeps")},table_getAllColumns:{fn:o(()=>Pl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumns:{fn:o(()=>Nl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumnsById:{fn:o(()=>Dl(t),"fn"),memoDeps:o(()=>[t.options.columns],"memoDeps")},table_getAllLeafColumns:{fn:o(()=>Al(t),"fn"),memoDeps:o(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getAllLeafColumnsById:{fn:o(()=>Ol(t),"fn"),memoDeps:o(()=>[t.getAllLeafColumns()],"memoDeps")},table_getColumn:{fn:o(e=>Tl(t,e),"fn")}})},"constructTableAPIs")};function Vl(t,e){for(let n=0;n<t.subHeaders.length;n++)Vl(t.subHeaders[n],e);e.push(t)}o(Vl,"collectLeafHeaders");function zl(t){let e=[];return Vl(t,e),e}o(zl,"header_getLeafHeaders");function $l(t){return{column:t.column,header:t,table:t.column.table}}o($l,"header_getContext");function Hl(t){let{start:e,end:n}=t.atoms.columnPinning?.get()??Xe(),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(Hl,"table_getHeaderGroups");function Ll(t){return[...t.getHeaderGroups()].reverse()}o(Ll,"table_getFooterGroups");function jl(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(jl,"table_getFlatHeaders");function Bl(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(Bl,"table_getLeafHeaders");var Gl={assignHeaderPrototype:o((t,e)=>{ce("coreHeadersFeature",t,e,{header_getLeafHeaders:{fn:o(n=>zl(n),"fn"),memoDeps:o(n=>[n.column.table.options.columns],"memoDeps")},header_getContext:{fn:o(n=>$l(n),"fn"),memoDeps:o(n=>[n.column.table.options.columns],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{fe("coreHeadersFeature",t,{table_getHeaderGroups:{fn:o(()=>Hl(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(()=>Ll(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")},table_getFlatHeaders:{fn:o(()=>jl(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")},table_getLeafHeaders:{fn:o(()=>Bl(t),"fn"),memoDeps:o(()=>[t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};function qi(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(qi,"getRowPrototype");var ql=o((t,e,n,l,r,a,s)=>{let i=qi(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 Co=/([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 yo=xt({resolveDataValue:o(t=>In(t).toLowerCase(),"resolveDataValue"),sort:o((t,e)=>Jl(t,e),"sort")}),Ki=xt({resolveDataValue:o(t=>In(t),"resolveDataValue"),sort:o((t,e)=>Jl(t,e),"sort")}),vo=xt({resolveDataValue:o(t=>In(t).toLowerCase(),"resolveDataValue"),sort:o((t,e)=>Io(t,e),"sort")}),Ui=xt({resolveDataValue:o(t=>In(t),"resolveDataValue"),sort:o((t,e)=>Io(t,e),"sort")}),Ro=xt({resolveDataValue:o(t=>Ji(t),"resolveDataValue"),sort:o((t,e)=>t>e?1:t<e?-1:0,"sort")}),Mt=xt({sort:o((t,e)=>Io(t,e),"sort")});function Io(t,e){return t===e?0:t>e?1:-1}o(Io,"compareBasic");function Ji(t){return t instanceof Date?t.getTime():t}o(Ji,"toDateSortValue");function In(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}o(In,"toString");function Jl(t,e){let n=0,l=0,r=t.length,a=e.length;for(;n<r&&l<a;){let s=Rn(t.charCodeAt(n)),i=Rn(e.charCodeAt(l)),c=_o(t,n,s),u=_o(e,l,i);if(!s&&!i){let g=Wi(t,n,c,e,l,u);if(g)return g;n=c,l=u;continue}if(s!==i)return s?1:-1;let d=Xi(t,n,c,e,l,u);if(d)return d;n=c,l=u}return Ul(t,n)-Ul(e,l)}o(Jl,"compareAlphanumeric");function Rn(t){return t>=48&&t<=57}o(Rn,"isDigit");function _o(t,e,n){let l=e+1;for(;l<t.length&&Rn(t.charCodeAt(l))===n;)l++;return l}o(_o,"findChunkEnd");function Wi(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(Wi,"compareStringChunks");function Xi(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=Kl(t,s,n),h=Kl(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(Xi,"compareNumericChunks");function Kl(t,e,n){let l=0;for(let r=e;r<n;r++)l=l*10+t.charCodeAt(r)-48;return l}o(Kl,"parseSmallInt");function Ul(t,e){let n=0,l=e;for(;l<t.length;)n++,l=_o(t,l,Rn(t.charCodeAt(l)));return n}o(Ul,"countRemainingChunks");function Wl(){return[]}o(Wl,"getDefaultCellSelectionState");function Qi(t,e){He(t,"cellSelection",e?Wl():ie(t.initialState.cellSelection)??Wl())}o(Qi,"table_resetCellSelection");function Xl(t){t.atoms.cellSelection&&(t.options.autoResetAll??t.options.autoResetCellSelection??!0)&&t._reactivity.schedule(()=>Qi(t))}o(Xl,"table_autoResetCellSelection");function Ql(t){t.atoms.expanded&&(t.options.autoResetAll??t.options.autoResetExpanded??!t.options.manualExpanding)&&t._reactivity.schedule(()=>Yi(t))}o(Ql,"table_autoResetExpanded");function Yi(t,e){let n=t.initialState.expanded;He(t,"expanded",e?H():n===!0?!0:Object.assign(H(),ie(n??{})))}o(Yi,"table_resetExpanded");var Fn=0;function Mn(t){if(t.options.autoResetAll??t.options.autoResetPageIndex??!t.options.manualPagination){if((t.atoms.pagination?.get()?.pageIndex??Fn)===Fn)return;tc(t,!0)}}o(Mn,"table_autoResetPageIndex");function Zi(t,e){He(t,"pagination",e)}o(Zi,"table_setPagination");function ec(t,e){Zi(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(ec,"table_setPageIndex");function tc(t,e){ec(t,e?Fn:t.initialState.pagination?.pageIndex??Fn)}o(tc,"table_resetPageIndex");function Yl(){return[]}o(Yl,"getDefaultSortingState");function Kt(t,e){He(t,"sorting",e)}o(Kt,"table_setSorting");function Fo(t,e){Kt(t,e?[]:ie(t.initialState.sorting??[]))}o(Fo,"table_resetSorting");function Zl(t){t.atoms.sorting&&(t.options.autoResetAll??t.options.autoResetSorting??!1)&&Fo(t)}o(Zl,"table_autoResetSorting");function Mo(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(Co).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(Mo,"column_getAutoSortFn");function ko(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(ko,"column_getAutoSortDir");function kn(t){let e=t.table._rowModelFns.sortFns;return tl(t.columnDef.sortFn)?t.columnDef.sortFn:t.columnDef.sortFn==="auto"?Mo(t):e?.[t.columnDef.sortFn]??Mt}o(kn,"column_getSortFn");function Po(t,e,n){let l=Do(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(Po,"column_toggleSorting");function No(t){return t.columnDef.sortDescFirst??t.table.options.sortDescFirst??ko(t)==="desc"?"desc":"asc"}o(No,"column_getFirstSortDir");function Do(t,e){let n=No(t),l=Ao(t);return l?l!==n&&(t.table.options.enableSortingRemoval??!0)&&(!e||(t.table.options.enableMultiRemove??!0))?!1:l==="desc"?"asc":"desc":n}o(Do,"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 Ao(t){let e=t.table.atoms.sorting?.get()?.find(n=>n.id===t.id);return e?e.desc?"desc":"asc":!1}o(Ao,"column_getIsSorted");function ea(t){return t.table.atoms.sorting?.get()?.findIndex(e=>e.id===t.id)??-1}o(ea,"column_getSortIndex");function ta(t){Kt(t.table,e=>e.length?e.filter(n=>n.id!==t.id):[])}o(ta,"column_clearSorting");function na(t){let e=Ut(t);return n=>{e&&Po(t,void 0,qt(t)?t.table.options.isMultiSortEvent?.(n):!1)}}o(na,"column_getToggleSortingHandler");function oa(){return t=>Ft({feature:"coreRowModelsFeature",table:t,fnName:"table.getCoreRowModel",memoDeps:o(()=>[t.options.data],"memoDeps"),fn:o(()=>nc(t,t.options.data),"fn"),onAfterUpdate:yn(()=>{Ql(t),Mn(t),Zl(t),Xl(t)})})}o(oa,"createCoreRowModel");function ra(t,e,n,l=0,r){let a=[];for(let s=0;s<n.length;s++){let i=n[s],c=ql(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=ra(t,e,c.originalSubRows,l+1,c)))}return a}o(ra,"accessRows");function nc(t,e){let n={rows:[],flatRows:[],rowsById:H()};return n.rows=ra(t,n,e),n}o(nc,"_createCoreRowModel");function la(t){return t._rowModels.coreRowModel||(t._rowModels.coreRowModel=t.options.features.coreRowModel?.(t)??oa()(t)),t._rowModels.coreRowModel()}o(la,"table_getCoreRowModel");function aa(t){return t.getCoreRowModel()}o(aa,"table_getPreFilteredRowModel");function sa(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(sa,"table_getFilteredRowModel");function ia(t){return t.getFilteredRowModel()}o(ia,"table_getPreGroupedRowModel");function ca(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(ca,"table_getGroupedRowModel");function ua(t){return t.getGroupedRowModel()}o(ua,"table_getPreSortedRowModel");function da(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(da,"table_getSortedRowModel");function ma(t){return t.getSortedRowModel()}o(ma,"table_getPreExpandedRowModel");function ga(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(ga,"table_getExpandedRowModel");function fa(t){return t.getExpandedRowModel()}o(fa,"table_getPrePaginatedRowModel");function pa(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(pa,"table_getPaginatedRowModel");function ba(t){return t.getPaginatedRowModel()}o(ba,"table_getRowModel");var ha={constructTableAPIs:o(t=>{fe("coreRowModelsFeature",t,{table_getCoreRowModel:{fn:o(()=>la(t),"fn")},table_getPreFilteredRowModel:{fn:o(()=>aa(t),"fn")},table_getFilteredRowModel:{fn:o(()=>sa(t),"fn")},table_getPreGroupedRowModel:{fn:o(()=>ia(t),"fn")},table_getGroupedRowModel:{fn:o(()=>ca(t),"fn")},table_getPreSortedRowModel:{fn:o(()=>ua(t),"fn")},table_getSortedRowModel:{fn:o(()=>da(t),"fn")},table_getPreExpandedRowModel:{fn:o(()=>ma(t),"fn")},table_getExpandedRowModel:{fn:o(()=>ga(t),"fn")},table_getPrePaginatedRowModel:{fn:o(()=>fa(t),"fn")},table_getPaginatedRowModel:{fn:o(()=>pa(t),"fn")},table_getRowModel:{fn:o(()=>ba(t),"fn")}})},"constructTableAPIs")};function oc(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(oc,"getCellPrototype");function wa(t,e,n){let l=oc(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(wa,"constructCell");function xa(t){let e=t.table.getRowsInDisplayOrder(),n=t._displayIndexCache;return e[n]===t?n:-1}o(xa,"row_getDisplayIndex");function Sa(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(Sa,"table_getRowsInDisplayOrder");function _a(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(_a,"row_getValue");function Ca(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(Ca,"row_getUniqueValues");function ya(t,e){return t.getValue(e)??t.table.options.renderFallbackValue}o(ya,"row_renderValue");function va(t){return nl(t.subRows,e=>e.subRows)}o(va,"row_getLeafRows");function Ra(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(Ra,"table_getMaxSubRowDepth");function Ia(t){if(t.parentId)return t.table.getCoreRowModel().rowsById[t.parentId]??t.table.getRow(t.parentId,!0)}o(Ia,"row_getParentRow");function Fa(t){let e=[],n=t;for(;;){let l=n.getParentRow();if(!l)break;e.push(l),n=l}return e.reverse()}o(Fa,"row_getParentRows");function Ma(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=wa(a,t,t.table),n.set(a,s)),l[r]=s}return l}o(Ma,"row_getAllCells");function ka(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(ka,"row_getAllCellsByColumnId");function Pa(t,e,n,l){return e.options.getRowId?.(t,n,l)??(l?`${l.id}.${n}`:String(n))}o(Pa,"table_getRowId");function Na(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(Na,"table_getRow");var Da={assignRowPrototype:o((t,e)=>{ce("coreRowsFeature",t,e,{row_getDisplayIndex:{fn:o(n=>xa(n),"fn")},row_getAllCellsByColumnId:{fn:o(n=>ka(n),"fn"),memoDeps:o(n=>[n.getAllCells()],"memoDeps")},row_getAllCells:{fn:o(n=>Ma(n),"fn"),memoDeps:o(n=>[n.table.getAllLeafColumns()],"memoDeps")},row_getLeafRows:{fn:o(n=>va(n),"fn"),memoDeps:o(n=>[n.subRows],"memoDeps")},row_getParentRow:{fn:o(n=>Ia(n),"fn")},row_getParentRows:{fn:o(n=>Fa(n),"fn")},row_getUniqueValues:{fn:o((n,l)=>Ca(n,l),"fn")},row_getValue:{fn:o((n,l)=>_a(n,l),"fn")},row_renderValue:{fn:o((n,l)=>ya(n,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{fe("coreRowsFeature",t,{table_getRowsInDisplayOrder:{fn:o(()=>Sa(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)=>Pa(e,t,n,l),"fn")},table_getRow:{fn:o((e,n)=>Na(t,e,n),"fn")},table_getMaxSubRowDepth:{fn:o(()=>Ra(t),"fn"),memoDeps:o(()=>[t.getCoreRowModel()],"memoDeps")}})},"constructTableAPIs")};function Pn(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(Pn,"table_syncExternalStateToBaseAtoms");function Nn(t,e,n=(l,r)=>l===r){t._reactivity.batch(()=>{Pn(t,e,n),t._reactivity.commit?.()})}o(Nn,"table_publishExternalState");function Oo(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(Oo,"table_reset");function Aa(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(Aa,"table_mergeOptions");function Jt(t,e,n){let l=Aa(t,It(e,t.options));t.optionsStore?t.optionsStore.set(()=>l):t.options=l,n?.syncExternalState!==!1&&Nn(t,l.state??null)}o(Jt,"table_setOptions");var Oa={constructTableAPIs:o(t=>{fe("coreTablesFeature",t,{table_reset:{fn:o(()=>Oo(t),"fn")},table_setOptions:{fn:o(e=>Jt(t,e),"fn")}})},"constructTableAPIs")};var Ta={coreCellsFeature:sl,coreColumnsFeature:El,coreHeadersFeature:Gl,coreRowModelsFeature:ha,coreRowsFeature:Da,coreTablesFeature:Oa};function Ea(t,e={}){return Object.values(t).forEach(n=>{e=n.getInitialState?.(e)??e}),ie(e)}o(Ea,"getInitialTableState");function To(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:{...Ta,..._},_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=Ea(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}`})}Pn(S),S.store=Xr(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(To,"constructTable");var Eo={getInitialState:o(t=>({columnOrder:_l(),...t}),"getInitialState"),getDefaultTableOptions:o(t=>({onColumnOrderChange:Be("columnOrder",t)}),"getDefaultTableOptions"),assignColumnPrototype:o((t,e)=>{ce("columnOrderingFeature",t,e,{column_getIndex:{fn:o((n,l)=>Cl(n,l),"fn")},column_getIsFirstColumn:{fn:o((n,l)=>yl(n,l),"fn")},column_getIsLastColumn:{fn:o((n,l)=>vl(n,l),"fn")}})},"assignColumnPrototype"),constructTableAPIs:o(t=>{fe("columnOrderingFeature",t,{table_getColumnIndexes:{fn:o(()=>xo(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=>So(t,e),"fn")},table_resetColumnOrder:{fn:o(e=>Rl(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 Va(){return H()}o(Va,"getDefaultColumnSizingState");function Vo(){return{size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER}}o(Vo,"getDefaultColumnSizingColumnDef");function kt(t){let e=Vo(),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 Dn(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(Dn,"buildColumnOffsets");function An(t){return{all:Dn(Ge(t)),center:Dn(Ge(t,"center")),start:Dn(Ge(t,"start")),end:Dn(Ge(t,"end"))}}o(An,"table_getColumnOffsets");function za(t){return t==="start"?"start":t==="end"?"end":t==="center"?"center":"all"}o(za,"toOffsetsKey");function $a(t,e){return V(t.table,"getColumnOffsets",An)[za(e)].starts[t.id]??0}o($a,"column_getStart");function Ha(t,e){return V(t.table,"getColumnOffsets",An)[za(e)].afters[t.id]??0}o(Ha,"column_getAfter");function La(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(La,"column_resetSize");function ja(t){if(!t.subHeaders.length)return kt(t.column);let e=0;for(let n=0;n<t.subHeaders.length;n++)e+=ja(t.subHeaders[n]);return e}o(ja,"sumHeaderSize");function rt(t){return ja(t)}o(rt,"header_getSize");function zo(t){if(t.index>0){let e=t.headerGroup?.headers[t.index-1];if(e)return V(e,"getStart",zo)+V(e,"getSize",rt)}return 0}o(zo,"header_getStart");function Pt(t,e){t.options.onColumnSizingChange?.(e)}o(Pt,"table_setColumnSizing");function Ba(t,e){Pt(t,e?H():Object.assign(H(),ie(t.initialState.columnSizing??{})))}o(Ba,"table_resetColumnSizing");function Ga(t){return t.getHeaderGroups()[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ga,"table_getTotalSize");function qa(t){return V(t,"getStartHeaderGroups",il)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(qa,"table_getStartTotalSize");function Ka(t){return V(t,"getCenterHeaderGroups",ul)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ka,"table_getCenterTotalSize");function Ua(t){return V(t,"getEndHeaderGroups",cl)[0]?.headers.reduce((e,n)=>e+rt(n),0)??0}o(Ua,"table_getEndTotalSize");function Tn(){return{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}}o(Tn,"getDefaultColumnResizingState");function Ho(t){return(t.columnDef.enableResizing??!0)&&(t.table.options.enableColumnResizing??!0)}o(Ho,"column_getCanResize");function Ja(t){return t.table.atoms.columnResizing?.get()?.isResizingColumn===t.id}o(Ja,"column_getIsResizing");function Wa(t,e){let n=t.table.getColumn(t.column.id),l=Ho(n);return r=>{if(!l||$o(r)&&r.touches.length>1)return;let a=rt(t),s=t.getLeafHeaders().map(C=>[C.column.id,kt(C.column)]),i=$o(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=rc()?{passive:!1}:!1;$o(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(Wa,"header_getResizeHandler");function Nt(t,e){t.options.onColumnResizingChange?.(e)}o(Nt,"table_setColumnResizing");function Xa(t,e){Nt(t,e?Tn():ie(t.initialState.columnResizing??Tn()))}o(Xa,"table_resetHeaderSizeInfo");var On=null;function rc(){if(typeof On=="boolean")return On;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 On=t,On}o(rc,"passiveEventSupported");function $o(t){return t.type==="touchstart"}o($o,"isTouchStartEvent");var Lo={getInitialState:o(t=>({columnResizing:Tn(),...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=>Ho(n),"fn")},column_getIsResizing:{fn:o(n=>Ja(n),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:o((t,e)=>{ce("columnResizingFeature",t,e,{header_getResizeHandler:{fn:o((n,l)=>Wa(n,l),"fn")}})},"assignHeaderPrototype"),constructTableAPIs:o(t=>{fe("columnResizingFeature",t,{table_setColumnResizing:{fn:o(e=>Nt(t,e),"fn")},table_resetHeaderSizeInfo:{fn:o(e=>Xa(t,e),"fn")}})},"constructTableAPIs")};var jo={getInitialState:o(t=>({columnSizing:Va(),...t}),"getInitialState"),getDefaultColumnDef:o(()=>Vo(),"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)=>$a(n,l),"fn")},column_getAfter:{fn:o((n,l)=>Ha(n,l),"fn")},column_resetSize:{fn:o(n=>La(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=>zo(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(()=>An(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=>Ba(t,e),"fn")},table_getTotalSize:{fn:o(()=>Ga(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getStartTotalSize:{fn:o(()=>qa(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getCenterTotalSize:{fn:o(()=>Ka(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getEndTotalSize:{fn:o(()=>Ua(t),"fn"),memoDeps:o(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};var Bo={getInitialState:o(t=>({columnVisibility:dl(),...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=>ml(n),"fn")},column_toggleVisibility:{fn:o((n,l)=>bo(n,l),"fn")}})},"assignColumnPrototype"),assignRowPrototype:o((t,e)=>{ce("columnVisibilityFeature",t,e,{row_getVisibleCells:{fn:o(n=>po(n),"fn"),memoDeps:o(n=>[n.getAllCells(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get()],"memoDeps")},row_getVisibleCellsByColumnId:{fn:o(n=>vn(n),"fn"),memoDeps:o(n=>[n.getAllCells(),e.atoms.columnVisibility?.get()],"memoDeps")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{fe("columnVisibilityFeature",t,{table_getVisibleFlatColumns:{fn:o(()=>gl(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=>fl(t,e),"fn")},table_toggleAllColumnsVisible:{fn:o(e=>ho(t,e),"fn")},table_getIsAllColumnsVisible:{fn:o(()=>wo(t),"fn")},table_getIsSomeColumnsVisible:{fn:o(()=>pl(t),"fn")},table_getToggleAllColumnsVisibilityHandler:{fn:o(()=>bl(t),"fn")}})},"constructTableAPIs")};function Qa(){return H()}o(Qa,"getDefaultRowSelectionState");function St(t,e){t.options.onRowSelectionChange?.(e)}o(St,"table_setRowSelection");function Ya(t,e){t._lastSelectedRowId=null,St(t,e?H():Object.assign(H(),ie(t.initialState.rowSelection??{})))}o(Ya,"table_resetRowSelection");function Go(t,e,n){t._lastSelectedRowId=null,St(t,l=>{if(e=typeof e<"u"?e:!V(t,"getIsAllRowsSelected",Uo),n?.deselectAll&&!e)return H();let r=Object.assign(H(),l),a=t.getPreGroupedRowModel().flatRows;if(e){let s=new Map;a.forEach(i=>{En(i,s)&&(r[i.id]=!0)})}else a.forEach(s=>{Qe(s)&&delete r[s.id]});return r})}o(Go,"table_toggleAllRowsSelected");function qo(t,e,n){t._lastSelectedRowId=null,St(t,l=>{let r=typeof e<"u"?e:!V(t,"getIsAllPageRowsSelected",Jo);if(n?.deselectAll&&!r)return H();let a=Object.assign(H(),l);return t.getRowModel().rows.forEach(s=>{$n(a,s.id,r,!0,t,!0)}),a})}o(qo,"table_toggleAllPageRowsSelected");function Za(t){return t.getCoreRowModel()}o(Za,"table_getPreSelectedRowModel");function es(t){let e=t.getCoreRowModel();return V(t,"getIsSomeRowsSelected",Wt)?Qo(e,t):{rows:[],flatRows:[],rowsById:H()}}o(es,"table_getSelectedRowModel");function ts(t){let e=t.getFilteredRowModel();return V(t,"getIsSomeRowsSelected",Wt)?Qo(e,t):{rows:[],flatRows:[],rowsById:H()}}o(ts,"table_getFilteredSelectedRowModel");function ns(t){let e=t.getSortedRowModel();return V(t,"getIsSomeRowsSelected",Wt)?Qo(e,t):{rows:[],flatRows:[],rowsById:H()}}o(ns,"table_getGroupedSelectedRowModel");function Ko(t){return Object.keys(t.atoms.rowSelection?.get()??{})}o(Ko,"table_getSelectedRowIds");function Uo(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=>!Xt(a,n)&&En(a,r))&&(l=!1)}return l}o(Uo,"table_getIsAllRowsSelected");function Jo(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(Xt(s,n))!r&&En(s,l)&&(r=!0);else if(En(s,l))return!1}return r}o(Jo,"table_getIsAllPageRowsSelected");function Wt(t){return V(t,"getSelectedRowIds",Ko).length>0}o(Wt,"table_getIsSomeRowsSelected");function os(t){return t.getPaginatedRowModel().flatRows.filter(e=>Qe(e)).some(e=>Vn(e)||V(e,"getIsSomeSelected",Xo))}o(os,"table_getIsSomePageRowsSelected");function rs(t){return e=>{Go(t,e.target.checked)}}o(rs,"table_getToggleAllRowsSelectedHandler");function ls(t){return e=>{qo(t,e.target.checked)}}o(ls,"table_getToggleAllPageRowsSelectedHandler");function Wo(t,e,n){let l=Vn(t);St(t.table,r=>{e=typeof e<"u"?e:!l;let a=Object.assign(H(),r);return $n(a,t.id,e,(n?.selectChildren??!0)&&ut(t),t.table),!e&&n?.deselectParents&&is(a,t),a})}o(Wo,"row_toggleSelected");function Vn(t){return Xt(t,t.table.atoms.rowSelection?.get()??{})}o(Vn,"row_getIsSelected");function Xo(t){return Yo(t)==="some"}o(Xo,"row_getIsSomeSelected");function as(t){return Yo(t)==="all"}o(as,"row_getIsAllSubRowsSelected");function Qe(t){let e=t.table.options;return typeof e.enableRowSelection=="function"?e.enableRowSelection(t):e.enableRowSelection??!0}o(Qe,"row_getCanSelect");function zn(t){let e=t.table.options;return typeof e.enableSubRowSelection=="function"?e.enableSubRowSelection(t):e.enableSubRowSelection??!0}o(zn,"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 ss(t,e){let n=Qe(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))||!lc(t,i,s,e))&&Wo(t,s,e),a._lastSelectedRowId=t.id}}o(ss,"row_getToggleSelectedHandler");function lc(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];!Qe(_)||!ut(_)||($n(b,_.id,n,r,a),!n&&l?.deselectParents&&is(b,_))}return b}),!0}o(lc,"selectRowRange");function $n(t,e,n,l,r,a){let s=r.getRow(e,!0);n?(ut(s)||Object.keys(t).forEach(i=>delete t[i]),Qe(s)&&(t[e]=!0)):(!a||Qe(s))&&delete t[e],l&&s.subRows.length&&zn(s)&&s.subRows.forEach(i=>$n(t,i.id,n,l,r,a))}o($n,"mutateRowIsSelected");function En(t,e){if(!Qe(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(!zn(d)){i=!1;break}c=d.parentId}return s.forEach(u=>e.set(u,i)),i}o(En,"isRowSelectableInSelectAll");function is(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(is,"pruneAncestorRowIds");function cs(t,e,n,l){let r=[];for(let a=0;a<t.length;a++){let s=t[a],i=Xt(s,e);if(i&&(n.push(s),l[s.id]=s),s.subRows.length){let c=cs(s.subRows,e,n,l);if(i){let u=Object.create(Object.getPrototypeOf(s));Cn(u,s),u.subRows=c,r.push(u)}}else i&&r.push(s)}return r}o(cs,"selectRowsRecursively");function Qo(t,e){let n=[],l=H(),r=e.atoms.rowSelection?.get()??{};return{rows:cs(t.rows,r,n,l),flatRows:n,rowsById:l}}o(Qo,"selectRowsFn");function Xt(t,e){return!!(je(e,t.id)&&e[t.id])}o(Xt,"isRowSelected");function Yo(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(Qe(s)&&(r=!0,Xt(s,e)?n=!0:l=!1),s.subRows.length){let i=Yo(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(Yo,"isSubRowSelected");var Zo={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)=>Wo(n,l,r),"fn")},row_getIsSelected:{fn:o(n=>Vn(n),"fn")},row_getIsSomeSelected:{fn:o(n=>Xo(n),"fn"),memoDeps:o(n=>[n.subRows,n.table.atoms.rowSelection?.get(),n.table.options.enableRowSelection],"memoDeps")},row_getIsAllSubRowsSelected:{fn:o(n=>as(n),"fn"),memoDeps:o(n=>[n.subRows,n.table.atoms.rowSelection?.get(),n.table.options.enableRowSelection],"memoDeps")},row_getCanSelect:{fn:o(n=>Qe(n),"fn")},row_getCanSelectSubRows:{fn:o(n=>zn(n),"fn")},row_getCanMultiSelect:{fn:o(n=>ut(n),"fn")},row_getToggleSelectedHandler:{fn:o((n,l)=>ss(n,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:o(t=>{fe("rowSelectionFeature",t,{table_setRowSelection:{fn:o(e=>St(t,e),"fn")},table_resetRowSelection:{fn:o(e=>Ya(t,e),"fn")},table_toggleAllRowsSelected:{fn:o((e,n)=>Go(t,e,n),"fn")},table_toggleAllPageRowsSelected:{fn:o((e,n)=>qo(t,e,n),"fn")},table_getPreSelectedRowModel:{fn:o(()=>Za(t),"fn")},table_getSelectedRowModel:{fn:o(()=>es(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getCoreRowModel()],"memoDeps")},table_getFilteredSelectedRowModel:{fn:o(()=>ts(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel()],"memoDeps")},table_getGroupedSelectedRowModel:{fn:o(()=>ns(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getSortedRowModel()],"memoDeps")},table_getSelectedRowIds:{fn:o(()=>Ko(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsAllRowsSelected:{fn:o(()=>Uo(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsAllPageRowsSelected:{fn:o(()=>Jo(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(()=>os(t),"fn"),memoDeps:o(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection],"memoDeps")},table_getToggleAllRowsSelectedHandler:{fn:o(()=>rs(t),"fn")},table_getToggleAllPageRowsSelectedHandler:{fn:o(()=>ls(t),"fn")}})},"constructTableAPIs")};var er={getInitialState(t){return{sorting:Yl(),...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=>Mo(n),"fn")},column_getAutoSortDir:{fn:o(n=>ko(n),"fn")},column_getSortFn:{fn:o(n=>kn(n),"fn")},column_toggleSorting:{fn:o((n,l,r)=>Po(n,l,r),"fn")},column_getFirstSortDir:{fn:o(n=>No(n),"fn")},column_getNextSortingOrder:{fn:o((n,l)=>Do(n,l),"fn")},column_getCanSort:{fn:o(n=>Ut(n),"fn")},column_getCanMultiSort:{fn:o(n=>qt(n),"fn")},column_getIsSorted:{fn:o(n=>Ao(n),"fn")},column_getSortIndex:{fn:o(n=>ea(n),"fn")},column_clearSorting:{fn:o(n=>ta(n),"fn")},column_getToggleSortingHandler:{fn:o(n=>na(n),"fn")}})},constructTableAPIs(t){fe("rowSortingFeature",t,{table_setSorting:{fn:o(e=>Kt(t,e),"fn")},table_resetSorting:{fn:o(e=>Fo(t,e),"fn")}})}};function tr(){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(()=>ac(e),"fn"),onAfterUpdate:yn(()=>Mn(e))})}}o(tr,"createSortedRowModel");function ac(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:kn(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));Cn(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(ac,"_createSortedRowModel");var dt=Me(gt(),1);var sc=typeof window>"u"?dt.useEffect:dt.useLayoutEffect;function nr(t,e){let[{table:n,rootSource:l}]=(0,dt.useState)(()=>{let c=To({...t,features:{coreReactivityFeature:Qr(),...t.features}});return c.Subscribe=(u=>Wr({...u,source:u.source??c.store})),c.FlexRender=uo,{table:c,rootSource:go(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 sc(()=>{l.markCommitted(s),Nn(r,a??null,it)}),(0,dt.useMemo)(()=>({...n,options:t,state:i}),[n,t,i])}o(nr,"useTable");var ds=Me(Vt(),1),ms=Me(gt(),1),Ie=Me(zt(),1);var ic=[{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"}],cc=o(t=>{let e=t.trim(),n=Number(e);return e!==""&&Number.isFinite(n)&&String(n)===e?n:t},"$"),uc=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!==""&&!uc(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?cc(e.value):e.literal[0]}),"L"),us=o((t,e)=>({column:t.column,operator:t.operator,value:t.value,...e}),"P"),gs=o(t=>{let e=(0,ds.c)(44),{columns:n,filters:l,onAskAi:r,onFiltersChange:a,onSearchChange:s,search:i}=t,[c,u]=(0,ms.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?us(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?us(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(dc)}),(0,Ie.jsx)("select",{"aria-label":"Filter operator","data-index":k,"data-testid":"db-filter-operator",onChange:_,value:P.operator,children:ic.map(mc)}),(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 dc(t){return(0,Ie.jsx)("option",{value:t,children:t},t)}o(dc,"B");function mc(t){return(0,Ie.jsx)("option",{value:t.value,children:t.label},t.value)}o(mc,"G");var gc=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"),fc=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"),pc=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"),fs=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"),sr=o(t=>`${t.table}.${t.column}`,"It"),bc=o(t=>{let e=(0,q.c)(111),{columns:n,onApply:l,onClose:r,shardKey:a,table:s,total:i,uniqueColumns:c}=t,u=re(),[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 X;e[45]!==K||e[46]!==T?(X=(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[K,T]}),e[45]=K,e[46]=T,e[47]=X):X=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)(io,{htmlFor:"bulk-patch-column",children:J}),e[50]=J,e[51]=Z):Z=e[51];let oe;e[52]!==u?(oe=u("Column"),e[52]=u,e[53]=oe):oe=e[53];let ne;e[54]!==n?(ne=n.map(hc),e[54]=n,e[55]=ne):ne=e[55];let ae;e[56]!==d||e[57]!==oe||e[58]!==ne?(ae=(0,f.jsx)("select",{"aria-label":oe,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:ne}),e[56]=d,e[57]=oe,e[58]=ne,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)(io,{htmlFor:"bulk-patch-value",children:de}),e[62]=de,e[63]=pe):pe=e[63];let Ce;e[64]!==m?(Ce=(0,f.jsx)(Cr,{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 Q;e[82]!==y||e[83]!==d||e[84]!==m?(Q=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]=Q):Q=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]!==X||e[103]!==xe||e[104]!==Se||e[105]!==ye||e[106]!==L||e[107]!==Q||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:[X,xe,Se,ye,L,Q,G]}),e[101]=r,e[102]=X,e[103]=xe,e[104]=Se,e[105]=ye,e[106]=L,e[107]=Q,e[108]=G,e[109]=P,e[110]=De):De=e[110],De},"Do");function hc(t){return(0,f.jsx)("option",{value:t,children:t},t)}o(hc,"Ao");var ps=6,Ln=100,wc=o(t=>({paddingLeft:t*16}),"Po"),xc=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"),Sc=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"),_c=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"),Cc=o(t=>t.relation===void 0||t.relation.onDelete==="cascade"?(0,f.jsx)(Sc,{table:t.table}):t.isRestrict?(0,f.jsx)(xc,{table:t.table}):(0,f.jsx)(_c,{table:t.table}),"Mo"),vs=o(t=>{let e=(0,q.c)(35),{depth:n,node:l}=t,r=`cascade-row-${l.table}`,a;e[0]!==n?(a=wc(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=Cc(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)(vs,{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"),yc=o(t=>{let e=t._id??t.id??t.__id__??"";return typeof e=="string"?e:typeof e=="number"?e.toString():""},"Lo"),vc=o(async(t,e,n,l)=>{try{let r=await l(t,e,n),a=r.rows.flatMap(i=>yc(i)||[]).slice(0,Ln),s=r.total??0;return{capNote:s>Ln?`showing first ${Ln.toString()} of ${s.toString()}`:void 0,rowCount:s,rowIds:a}}catch{return{capNote:"count unavailable",rowCount:0,rowIds:[]}}},"Vo"),Rs=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 vc(t,n.field,e,s),d=n?.onDelete==="restrict",g=[],m=`${t}:${e}`,h=a>=ps;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 Rs(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 ${ps.toString()}`;p=i===void 0?b:`${i}; ${b}`}return{capNote:p,children:g,isRestrict:d,relation:n,rowCount:c,rowIds:u,table:t}},"cn"),Rc=o(({onClose:t,onConfirm:e,readPage:n,rowId:l,schema:r,table:a})=>{let s=re(),[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 te((async()=>{try{c(!0),m(null);let w=fc(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 Rs(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&&pc(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)(vs,{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"),Ic=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"),Fc=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"),Mc={columnOrderingFeature:Eo,columnResizingFeature:Lo,columnSizingFeature:jo,columnVisibilityFeature:Bo,rowSelectionFeature:Zo,rowSortingFeature:er,sortedRowModel:tr(),sortFns:{alphanumeric:yo,basic:Mt,datetime:Ro,text:vo}},kc=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(Nc,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"),Is=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"),Pc=o(t=>{let e=(0,q.c)(29),{changes:n,committing:l,onCommit:r,onDiscard:a}=t,s=re(),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(Dc),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 Nc(t,e){return t+Object.keys(e).length}o(Nc,"Jo");function Dc(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(Dc,"Wo");var bs=400,Ac=36,Oc={flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"},Tc={width:"100%"},Ec=/\n$/u,Vc={alignItems:"center",display:"flex",left:0,position:"absolute",top:0,width:"100%"},zc={display:"flex",width:"100%"},hs={flex:"0 0 8.5rem",padding:"0.375rem 0.75rem"},$c="2.5rem",Fs={alignItems:"center",display:"flex",flex:"0 0 2.5rem",justifyContent:"center",left:0,padding:"0.375rem 0",position:"sticky",zIndex:2},ir=o(t=>({flex:"0 0 auto",overflow:"hidden",padding:"0.375rem 0.75rem",position:"relative",textOverflow:"ellipsis",whiteSpace:"nowrap",width:`${t.toString()}px`}),"Ft"),Ms=o((t,e)=>({...ir(t),left:`calc(${$c} + ${e.toString()}px)`,position:"sticky",zIndex:2}),"fn"),or="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",Hc=o((t,e,n)=>e.enabled&&e.columns.has(n)?void 0:t,"ts"),ar="__back__:",Lc=o(t=>`${ar}${t.table}.${t.column}`,"ns"),jc=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"),Bc=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"),Gc=o((t,e,n)=>{if(n!==void 0&&n.type!=="any")return Bc(t,n);let l=Is(t,e);return typeof e=="number"&&typeof l!="number"?void 0:{value:l}},"ls"),qc=o(({anchor:t,columnIds:e,columnMeta:n,editableColumn:l,rows:r,text:a})=>{let s=a.replaceAll(`\r
|
|
3
3
|
`,`
|
|
4
4
|
`).replace(Ec,"").split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as j,h as v,i as D,l as g}from"./chunk-
|
|
1
|
+
import{g as j,h as v,i as D,l as g}from"./chunk-NCCORPSU.js";import{f as S,g as w,h as P,q}from"./chunk-74IYYDDI.js";import{a as i,d as A,e as x,f as M}from"./chunk-I26MS5PJ.js";var E=A(M(),1);var p=A(x(),1);var I=300,l=i(t=>typeof t=="string"?t===""?void 0:t:typeof t=="number"||typeof t=="boolean"?String(t):void 0,"c"),u=i(t=>t.filter(r=>r!==void 0).join(" "),"u"),T=i(t=>{let r=Array.isArray(t.filters)?t.filters.length:0,e=typeof t.search=="string"&&t.search!=="";return r===0&&!e?"no predicate":u([r===0?void 0:`${String(r)} filters`,e?"search":void 0])},"q"),N={clearTable:i(t=>u([l(t.table),"whole table"]),"clearTable"),deleteRows:i(t=>u([l(t.table),T(t)]),"deleteRows"),facetColumn:i(t=>u([l(t.table),l(t.column)]),"facetColumn"),importShard:i(t=>{if(!Array.isArray(t.rows))return"";let r=[...new Set(t.rows.filter(e=>typeof e=="object"&&e!==null).map(e=>e.table).filter(e=>typeof e=="string"))].toSorted((e,s)=>e.localeCompare(s));return u([`${String(t.rows.length)} rows`,r.length===0?void 0:`into ${r.join(", ")}`])},"importShard"),lintSql:i(()=>"sql","lintSql"),patchRows:i(t=>u([l(t.table),typeof t.doc=="object"&&t.doc!==null?`set ${Object.keys(t.doc).join(", ")}`:void 0,T(t)]),"patchRows"),pitrRestore:i(t=>u([l(t.time)===void 0?void 0:`to ${String(t.time)}`,typeof t.bookmark=="string"&&t.bookmark!==""?"from bookmark":void 0,t.restart===!0?"restart now":void 0]),"pitrRestore"),readTablePage:i(t=>u([l(t.table),Array.isArray(t.filters)&&t.filters.length>0?`${String(t.filters.length)} filters`:void 0,typeof t.search=="string"&&t.search!==""?"search":void 0,typeof t.limit=="number"?`limit ${String(t.limit)}`:void 0]),"readTablePage"),runMigration:i(t=>u([l(t.id),l(t.direction),t.dryRun===!0?"dry-run":void 0]),"runMigration"),runSql:i(t=>typeof t.sql=="string"?`${String(t.sql.length)} chars`:"","runSql"),schemaVersion:i(t=>typeof t.hash=="string"?t.hash.slice(0,8):"","schemaVersion"),writeRow:i(t=>u([l(t.table),"1 row"]),"writeRow")},$="__lunora_admin__:",F=i((t,r)=>{let e=t.startsWith($)?t.slice($.length):t,s=N[e];if(s!==void 0)return s(r);let n=Object.keys(r);return n.length===0?"":n.join(", ")},"M"),V=i(t=>{if(Array.isArray(t))return t.length;if(!(typeof t!="object"||t===null)){for(let r of Object.values(t))if(Array.isArray(r))return r.length}},"K"),k=class{static{i(this,"x")}entries=[];listeners=new Set;nextSeq=1;getSnapshot=i(()=>this.entries,"getSnapshot");subscribe=i(r=>(this.listeners.add(r),()=>{this.listeners.delete(r)}),"subscribe");start(r,e,s){return this.append(r,e,s,"call","pending")}startSubscription(r,e,s){return this.append(r,e,s,"subscription","live")}recordPush(r){if(this.listeners.size===0){let e=this.entries.find(s=>s.seq===r);e!==void 0&&(e.pushes=(e.pushes??0)+1);return}this.patch(r,e=>({...e,pushes:(e.pushes??0)+1}))}failSubscription(r,e){this.patch(r,s=>({...s,error:e,status:"error"}))}endSubscription(r){this.patch(r,e=>e.status==="error"?e:{...e,durationMs:Date.now()-e.startedAt,status:"closed"})}lastErrorSeq(){return this.entries.findLast(r=>r.status==="error")?.seq}settle(r,e){this.patch(r,s=>({...s,durationMs:Date.now()-s.startedAt,...e.error===void 0?{resultCount:V(e.result),status:"ok"}:{error:e.error,status:"error"}}))}clear(){this.entries=[],this.emit()}append(r,e,s,n,a){let c=this.nextSeq;this.nextSeq+=1;let d={functionPath:r,kind:n,seq:c,shardKey:s,startedAt:Date.now(),status:a,summary:F(r,e),...n==="subscription"?{pushes:0}:{}},o=[...this.entries,d];return this.entries=o.length>I?o.slice(o.length-I):o,this.emit(),c}patch(r,e){let s=this.entries.findIndex(n=>n.seq===r);s!==-1&&(this.entries=this.entries.with(s,e(this.entries[s])),this.emit())}emit(){for(let r of this.listeners)r()}},f=new k,O=i((t,r,e)=>["lunora-admin",t,r,e.trim()],"E"),_=i((t,r)=>[...t,r],"j");function W(t,r,e={}){let s=g(),{enabled:n=!0,keepPreviousData:a=!1,staleTime:c=0}=e,d=_(t,s.clientIdentifier()),o=D({enabled:n,queryFn:r,placeholderData:a?j:void 0,queryKey:d,staleTime:c});return{data:o.data,error:o.error?P(o.error):o.error,errorSource:o.error??void 0,isLoading:o.isLoading,liveError:void 0,refetch:i(()=>{q(o.refetch())},"refetch"),poll:i(async()=>{await o.refetch({throwOnError:!0})},"poll")}}i(W,"F");function Y(t,r,e={}){let s=g(),n=v(),{enabled:a=!0,keepPreviousData:c=!1,live:d=!1,shardKey:o="",staleTime:R}=e,m=O(t,r,o),C=W(m,()=>s.query(S(t),r,w(o)),{enabled:a,keepPreviousData:c,staleTime:R??(d?Number.POSITIVE_INFINITY:0)}),[K,b]=(0,p.useState)(void 0),L=JSON.stringify(m);return(0,p.useEffect)(()=>{if(!a||!d)return;b(void 0);let y=f.startSubscription(t,r,o),Q=s.subscribe(S(t),r,h=>{f.recordPush(y),b(void 0),n.setQueryData(_(m,s.clientIdentifier()),h)},{...w(o),onError:i(h=>{f.failSubscription(y,h.message),b(h.message)},"onError")});return()=>{f.endSubscription(y),Q()}},[s,L,a,d]),{...C,liveError:a&&d?K:void 0}}i(Y,"U");var B=i(()=>{let t=(0,E.c)(2),r=v(),e;return t[0]!==r?(e=i((s,n,a)=>{let c=n===void 0?["lunora-admin",s]:O(s,n,a??"");q(r.invalidateQueries({queryKey:c}))},"r"),t[0]=r,t[1]=e):e=t[1],e},"W");export{f as a,W as b,Y as c,B as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk-4ZEL6BYL.js";import{c as k}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-4ZEL6BYL.js";import{c as k}from"./chunk-DHGPCQ2F.js";import{l as S}from"./chunk-NCCORPSU.js";import{d as _,f as y,g as v,p as C}from"./chunk-74IYYDDI.js";import{a as i,d as N,e as L,f as T,g as F}from"./chunk-I26MS5PJ.js";var w=N(L(),1);var j={},A=y(g.aiGenerateSql),I=y(g.aiTableFilter),O=y(g.aiChartConfig),Q=i(s=>{let e=S(),[l,d]=(0,w.useState)({}),[n,t]=(0,w.useState)({}),a=k(g.aiAvailable,j,{shardKey:s}),[u,c]=(0,w.useState)(!1),x=u||a.data?.available===!1,p=i(o=>{d(r=>({...r,[o]:!0})),t(r=>({...r,[o]:void 0}))},"i"),h=i((o,r)=>{d(b=>({...b,[o]:!1})),r!==void 0&&t(b=>({...b,[o]:r})),r==="no-ai-binding"&&c(!0)},"a"),f=i(async o=>{p("sql");try{let{result:r}=await e.query(A,o,v(s));return h("sql",r.degraded?r.reason:void 0),r.degraded?void 0:r.sql}catch{h("sql","ai-error");return}},"f");return{generate:i(async(o,r)=>f({failedError:r?.error,failedSql:r?.sql,prompt:o}),"generate"),inferChart:i(async o=>{p("chart");try{let{result:r}=await e.query(O,o,v(s));return h("chart",r.degraded?r.reason:void 0),r.degraded?void 0:r.chart}catch{h("chart","ai-error");return}},"inferChart"),pending:i(o=>l[o]===!0,"pending"),reason:i(o=>n[o],"reason"),rewrite:i(async(o,r)=>f({editSql:r,prompt:o}),"rewrite"),suggestFilter:i(async(o,r)=>{p("filter");try{let{result:b}=await e.query(I,{prompt:o,table:r},v(s));return h("filter",b.degraded?b.reason:void 0),b.degraded?void 0:b.clauses}catch{h("filter","ai-error");return}},"suggestFilter"),unavailable:x}},"Q");var q=N(T(),1);var m=N(F(),1);var G=i((s,e)=>{if(e==="")return[{match:!1,offset:0,text:s}];let l=[],d=s.toLowerCase(),n=e.toLowerCase(),t=0;for(let a=d.indexOf(n);a!==-1;a=d.indexOf(n,t))a>t&&l.push({match:!1,offset:t,text:s.slice(t,a)}),l.push({match:!0,offset:a,text:s.slice(a,a+e.length)}),t=a+e.length;return t<s.length&&l.push({match:!1,offset:t,text:s.slice(t)}),l},"N"),U=i(s=>{let e=(0,q.c)(9),{highlight:l,value:d}=s;if(d==null){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=(0,m.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=c):c=e[0],c}let n,t,a;if(e[1]!==l||e[2]!==d){a=Symbol.for("react.early_return_sentinel");e:{let c=C(d);if(l===void 0||l===""){a=(0,m.jsx)("span",{title:c,children:c});break e}n=c,t=G(c,l).map(z)}e[1]=l,e[2]=d,e[3]=n,e[4]=t,e[5]=a}else n=e[3],t=e[4],a=e[5];if(a!==Symbol.for("react.early_return_sentinel"))return a;let u;return e[6]!==n||e[7]!==t?(u=(0,m.jsx)("span",{title:n,children:t}),e[6]=n,e[7]=t,e[8]=u):u=e[8],u},"v"),P=i(s=>{let e=(0,q.c)(22),{columns:l,rows:d}=s,n=_(),t;e[0]!==n?(t=n("Field"),e[0]=n,e[1]=t):t=e[1];let a;e[2]!==t?(a=(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let u;if(e[4]!==d||e[5]!==n){let f;e[7]!==n?(f=i((o,r)=>(0,m.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:n("Row {n}",{n:r+1})},r),"c"),e[7]=n,e[8]=f):f=e[8],u=d.map(f),e[4]=d,e[5]=n,e[6]=u}else u=e[6];let c;e[9]!==a||e[10]!==u?(c=(0,m.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,m.jsxs)("tr",{children:[a,u]})}),e[9]=a,e[10]=u,e[11]=c):c=e[11];let x;if(e[12]!==l||e[13]!==d){let f;e[15]!==d?(f=i(o=>(0,m.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,m.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:o}),d.map((r,b)=>(0,m.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,m.jsx)(U,{value:r[o]})},b))]},o),"c"),e[15]=d,e[16]=f):f=e[16],x=l.map(f),e[12]=l,e[13]=d,e[14]=x}else x=e[14];let p;e[17]!==x?(p=(0,m.jsx)("tbody",{children:x}),e[17]=x,e[18]=p):p=e[18];let h;return e[19]!==c||e[20]!==p?(h=(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,m.jsxs)("table",{className:"border-collapse text-xs",children:[c,p]})}),e[19]=c,e[20]=p,e[21]=h):h=e[21],h},"T"),V=i(({children:s,layout:e="card",testId:l})=>(0,m.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":l,children:s}),"j");function z(s){return(0,m.jsx)("mark",{className:s.match?"rounded-sm bg-warning/40 text-foreground":"bg-transparent text-inherit",children:s.text},s.offset)}i(z,"_");export{Q as a,U as b,P as c,V as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-5SLTDY4C.js";import{a as k}from"./chunk-6XKL22OG.js";import"./chunk-FUYEZFBP.js";import"./chunk-OQ6I6OXT.js";import"./chunk-SJQERRSZ.js";import"./chunk-7G4Z6Q7X.js";import"./chunk-3YXASVTP.js";import"./chunk-AUAECCXB.js";import{b as N}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{a as B}from"./chunk-ZJQIGWLG.js";import"./chunk-NCPW7WHO.js";import"./chunk-IRSSZXC3.js";import"./chunk-55UGUCQ6.js";import{a as u}from"./chunk-4ZEL6BYL.js";import{c as p}from"./chunk-DHGPCQ2F.js";import{e as R}from"./chunk-NCCORPSU.js";import"./chunk-QAQDMS6R.js";import"./chunk-M3QKMHAP.js";import{a as S}from"./chunk-RWVIV3U7.js";import{a as A,b as C,c as P,d as b,e as l,f as n}from"./chunk-HCTJKP5J.js";import{a as v,e as w}from"./chunk-2IKDEUCX.js";import{d as j,u as I}from"./chunk-74IYYDDI.js";import{a as m,d as H,g as Q}from"./chunk-I26MS5PJ.js";var e=H(Q(),1);var _="payment_subscriptions",O="payment_events",V=[_,O],Y={},E=new Set(["active","trialing"]),z=new Set(["past_due","unpaid"]),s=m((a,t)=>{if(a[t]!==void 0)return a[t];let h=a.__doc__;return typeof h=="string"?R(h)?.[t]:void 0},"a"),o=m(a=>typeof a=="string"?a:typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"?String(a):"","s"),J=m(a=>E.has(a)?"default":z.has(a)?"destructive":"outline","q"),ie=m(({limit:a=100})=>{let t=j(),h=k(),{data:x}=p(u.listTables,Y,{live:!0}),F=x!==void 0,L=Array.isArray(x)&&V.every(r=>x.some(d=>d.name===r)),c=h.payments&&L,i=p(u.readTablePage,{filters:[],limit:a,offset:0,orderBy:{column:"updatedAt",direction:"desc"},search:"",table:_},{enabled:c}),f=p(u.readTablePage,{filters:[],limit:25,offset:0,orderBy:{column:"processedAt",direction:"desc"},search:"",table:O},{enabled:c}),g=p(u.facetColumn,{column:"state",table:_},{enabled:c});D(()=>{if(c)return Promise.all([i.poll(),f.poll(),g.poll()])},!0);let y=i.data?.rows??[],M=f.data?.rows??[],U=i.error??f.error,q=i.error===null?f.errorSource:i.errorSource,G=i.data?.total??y.length,T=g.data?.values===void 0?y.filter(r=>E.has(o(s(r,"state")))).length:g.data.values.reduce((r,d)=>r+(E.has(o(d.value))?d.count:0),0);return F&&!c?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:(0,e.jsx)(S,{description:t("No @lunora/payment tables found in this deployment. Add `.extend(paymentExtension)` to lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions."),testId:"payments-unconfigured",title:t("No payments configured")})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsx)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxs)(v,{className:"justify-between gap-0 py-0",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Subscriptions")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T}),(0,e.jsx)(N,{variant:"default",children:t("{count} active",{count:T})})]})]}),(0,e.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:t("{total} total",{total:G})})]})}),U===null?void 0:(0,e.jsx)(B,{error:q}),y.length===0&&!i.isLoading?(0,e.jsx)(S,{testId:"payments-empty",title:t("No subscriptions yet")}):(0,e.jsx)(v,{className:"overflow-hidden py-0",children:(0,e.jsx)(w,{className:"px-0",children:(0,e.jsxs)(A,{children:[(0,e.jsx)(C,{children:(0,e.jsxs)(b,{children:[(0,e.jsx)(l,{children:t("Provider")}),(0,e.jsx)(l,{children:t("Reference")}),(0,e.jsx)(l,{children:t("Plan")}),(0,e.jsx)(l,{children:t("State")}),(0,e.jsx)(l,{children:t("Renews")})]})}),(0,e.jsx)(P,{children:y.map(r=>{let d=o(s(r,"state"));return(0,e.jsxs)(b,{"data-testid":"payment-subscription-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{children:o(s(r,"referenceId"))}),(0,e.jsx)(n,{children:o(s(r,"priceId"))}),(0,e.jsx)(n,{children:(0,e.jsx)(N,{variant:J(d),children:d})}),(0,e.jsx)(n,{children:I(s(r,"currentPeriodEnd"))})]},o(s(r,"providerSubscriptionId")))})})]})})}),(0,e.jsxs)(v,{className:"overflow-hidden py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Recent webhook events")})}),(0,e.jsx)(w,{className:"px-0",children:(0,e.jsx)(A,{children:(0,e.jsx)(P,{children:M.map(r=>(0,e.jsxs)(b,{"data-testid":"payment-event-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{className:"font-medium",children:o(s(r,"type"))}),(0,e.jsx)(n,{className:"text-muted-foreground",children:o(s(r,"providerEventId"))}),(0,e.jsx)(n,{children:I(s(r,"processedAt"))})]},o(s(r,"providerEventId"))))})})})]})]})},"oe");export{ie as PaymentsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H}from"./chunk-
|
|
1
|
+
import{a as H}from"./chunk-5SLTDY4C.js";import{b as x}from"./chunk-Q6ED4KUL.js";import"./chunk-BOMPSVRC.js";import{b as z}from"./chunk-DHGPCQ2F.js";import{l as O}from"./chunk-NCCORPSU.js";import"./chunk-QAQDMS6R.js";import"./chunk-M3QKMHAP.js";import{a as _}from"./chunk-RWVIV3U7.js";import{a as q,b as B,c as E,d as S,e as i,f as s}from"./chunk-HCTJKP5J.js";import{a as A,e as L}from"./chunk-2IKDEUCX.js";import{d as W}from"./chunk-74IYYDDI.js";import{a as R,d as M,f as $,g as D}from"./chunk-I26MS5PJ.js";var I=M($(),1);var n=M(D(),1);var F=2e3,G=new Set(["open"]),ie=R(Q=>{let e=(0,I.c)(41),{read:y}=Q,t=W(),j=O(),v;e[0]!==j||e[1]!==y?(v=R(()=>Promise.resolve(y?y():j.debug()),"T"),e[0]=j,e[1]=y,e[2]=v):v=e[2];let V=v,K=y?"injected":"live",b;e[3]!==K?(b=["lunora-studio","sync-client-debug",K],e[3]=K,e[4]=b):b=e[4];let{data:c,poll:Y}=z(b,V);if(H(Y,!0,F),!c){let r;e[5]!==t?(r=t("Reading the sync client's state\u2026"),e[5]=t,e[6]=r):r=e[6];let g;e[7]!==t?(g=t("Sync client"),e[7]=t,e[8]=g):g=e[8];let T;return e[9]!==r||e[10]!==g?(T=(0,n.jsx)(A,{children:(0,n.jsx)(L,{children:(0,n.jsx)(_,{description:r,title:g})})}),e[9]=r,e[10]=g,e[11]=T):T=e[11],T}let{pendingWrites:k,shards:N,subscriptions:w}=c,l;e[12]!==t?(l=t("This Studio session's sync client"),e[12]=t,e[13]=l):l=e[13];let a;e[14]!==l?(a=(0,n.jsx)("span",{className:"text-sm font-medium",children:l}),e[14]=l,e[15]=a):a=e[15];let P=c.connectionStatus==="connected"?"default":"secondary",o;e[16]!==c.connectionStatus||e[17]!==P?(o=(0,n.jsx)(x,{variant:P,children:c.connectionStatus}),e[16]=c.connectionStatus,e[17]=P,e[18]=o):o=e[18];let d;e[19]!==k||e[20]!==t?(d=k>0?(0,n.jsx)(x,{variant:"secondary",children:t("{count} pending writes",{count:k})}):null,e[19]=k,e[20]=t,e[21]=d):d=e[21];let h;e[22]!==a||e[23]!==o||e[24]!==d?(h=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a,o,d]}),e[22]=a,e[23]=o,e[24]=d,e[25]=h):h=e[25];let u;e[26]!==t?(u=t("Reads client.debug() for the client running in this page \u2014 not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there."),e[26]=t,e[27]=u):u=e[27];let m;e[28]!==u?(m=(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:u}),e[28]=u,e[29]=m):m=e[29];let p;e[30]!==N||e[31]!==t?(p=N.length===0?(0,n.jsx)(_,{description:t("No shard connection has been opened yet."),title:t("No shards")}):(0,n.jsxs)(q,{children:[(0,n.jsx)(B,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Shard")}),(0,n.jsx)(i,{children:t("Socket")}),(0,n.jsx)(i,{children:t("Confirmed watermark")})]})}),(0,n.jsx)(E,{children:N.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{children:r.shardKey??t("(default)")}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:G.has(r.wsState)?"default":"secondary",children:r.wsState})}),(0,n.jsx)(s,{children:r.confirmedMutationWatermark})]},r.shardKey??"__default__"))})]}),e[30]=N,e[31]=t,e[32]=p):p=e[32];let f;e[33]!==w||e[34]!==t?(f=w.length===0?(0,n.jsx)(_,{description:t("This client holds no live queries or shapes."),title:t("No subscriptions")}):(0,n.jsxs)(q,{children:[(0,n.jsx)(B,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(i,{children:t("Subscription")}),(0,n.jsx)(i,{children:t("Kind")}),(0,n.jsx)(i,{children:t("Acked")}),(0,n.jsx)(i,{children:t("Cursor")}),(0,n.jsx)(i,{children:t("Pending overlays")})]})}),(0,n.jsx)(E,{children:w.map(r=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{className:"font-mono text-xs",children:r.functionPath}),(0,n.jsx)(s,{children:r.kind}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:r.acked?"default":"secondary",children:r.acked?t("yes"):t("no")})}),(0,n.jsx)(s,{children:r.serverCursor??"\u2014"}),(0,n.jsx)(s,{children:r.pendingOptimisticLayers})]},r.id))})]}),e[33]=w,e[34]=t,e[35]=f):f=e[35];let C;return e[36]!==m||e[37]!==p||e[38]!==f||e[39]!==h?(C=(0,n.jsx)(A,{children:(0,n.jsxs)(L,{className:"flex flex-col gap-4",children:[h,m,p,f]})}),e[36]=m,e[37]=p,e[38]=f,e[39]=h,e[40]=C):C=e[40],C},"ie");export{ie as default};
|