@lunora/studio 1.0.0-alpha.377 → 1.0.0-alpha.379

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.
Files changed (122) hide show
  1. package/LICENSE.md +201 -104
  2. package/README.md +3 -3
  3. package/dist/index.d.mts +9 -1
  4. package/dist/index.d.ts +9 -1
  5. package/dist/packem_chunks/LogsPanel.mjs +1 -1
  6. package/dist/packem_chunks/MetricsPanel.mjs +1 -1
  7. package/dist/packem_chunks/NotificationsPanel.mjs +1 -1
  8. package/dist/packem_chunks/ai-knowledge.mjs +1 -1
  9. package/dist/packem_chunks/traces-panel.mjs +1 -1
  10. package/dist/packem_shared/log-fields-CV-9O0nh.mjs +8 -0
  11. package/dist/packem_shared/log-line-CYJQf6P-.mjs +1 -0
  12. package/dist/standalone/{chunk-6ORWM6ZT.js → chunk-26Y4MNET.js} +1 -1
  13. package/dist/standalone/{chunk-CJJSRDJQ.js → chunk-2JV4BRZM.js} +1 -1
  14. package/dist/standalone/{chunk-CD6Y4HMA.js → chunk-2VGEXP5J.js} +1 -1
  15. package/dist/standalone/{chunk-DB332GVZ.js → chunk-2X6PKSX3.js} +1 -1
  16. package/dist/standalone/chunk-323KPWNK.js +1 -0
  17. package/dist/standalone/{chunk-OVXKPVKS.js → chunk-34RW2S7B.js} +1 -1
  18. package/dist/standalone/{chunk-JUTXPZQK.js → chunk-3TPV2LT4.js} +1 -1
  19. package/dist/standalone/{chunk-QH6WAQIT.js → chunk-3VY2JXUG.js} +1 -1
  20. package/dist/standalone/{chunk-LD6JOIEW.js → chunk-4PGWRKGR.js} +1 -1
  21. package/dist/standalone/{chunk-D7SKD7RO.js → chunk-4QHOCKKK.js} +1 -1
  22. package/dist/standalone/chunk-4TMXSFYX.js +1 -0
  23. package/dist/standalone/{chunk-2BCNWFC5.js → chunk-4UMUJTD2.js} +1 -1
  24. package/dist/standalone/{chunk-N33IYFIX.js → chunk-5JP3QEKB.js} +1 -1
  25. package/dist/standalone/{chunk-3J26FAKO.js → chunk-5SCMOA55.js} +1 -1
  26. package/dist/standalone/{chunk-MUCEG53A.js → chunk-5UBZVLHV.js} +1 -1
  27. package/dist/standalone/{chunk-ZUVDTKXM.js → chunk-5YAKHHWZ.js} +1 -1
  28. package/dist/standalone/{chunk-MBA6SBBO.js → chunk-6BZNUPWO.js} +1 -1
  29. package/dist/standalone/{chunk-2SKEPLDB.js → chunk-6C5FR3EZ.js} +1 -1
  30. package/dist/standalone/{chunk-PGK4SNG3.js → chunk-6I7FRZA3.js} +1 -1
  31. package/dist/standalone/{chunk-Y5HPCYBO.js → chunk-6M3EQLUP.js} +1 -1
  32. package/dist/standalone/{chunk-AKOBXMLE.js → chunk-6ZMVAF2O.js} +1 -1
  33. package/dist/standalone/{chunk-JQH5M3FB.js → chunk-7BNAY62O.js} +1 -1
  34. package/dist/standalone/{chunk-5Z6PF6KC.js → chunk-7LXTCC2A.js} +1 -1
  35. package/dist/standalone/{chunk-DBV2V6OY.js → chunk-7M5KSH56.js} +1 -1
  36. package/dist/standalone/{chunk-4NKJV7YX.js → chunk-7VZFX5O4.js} +1 -1
  37. package/dist/standalone/{chunk-TKALUM7Y.js → chunk-AB7ELB6H.js} +1 -1
  38. package/dist/standalone/{chunk-VRAOBE6E.js → chunk-AUF7N5CE.js} +1 -1
  39. package/dist/standalone/{chunk-2BUAJRHS.js → chunk-AUGN55ZM.js} +1 -1
  40. package/dist/standalone/{chunk-IAVAD545.js → chunk-B2GQMLO3.js} +1 -1
  41. package/dist/standalone/{chunk-RQFK2LYP.js → chunk-BFL76ZWW.js} +1 -1
  42. package/dist/standalone/{chunk-ZAWNUXWP.js → chunk-C6ZJHEQT.js} +1 -1
  43. package/dist/standalone/{chunk-6ALD476Y.js → chunk-CUUNHCMD.js} +1 -1
  44. package/dist/standalone/{chunk-CTIZP3XO.js → chunk-CYL7MEO2.js} +1 -1
  45. package/dist/standalone/{chunk-MXYZQCDR.js → chunk-DM63RG6O.js} +1 -1
  46. package/dist/standalone/{chunk-IDK6WH4X.js → chunk-DR4FUUVD.js} +1 -1
  47. package/dist/standalone/{chunk-RNTEWZRJ.js → chunk-DXX7OLWZ.js} +1 -1
  48. package/dist/standalone/{chunk-OR2CSCVB.js → chunk-E4XUNAKO.js} +1 -1
  49. package/dist/standalone/{chunk-KMA6JR2E.js → chunk-EH3PU4PH.js} +1 -1
  50. package/dist/standalone/chunk-EYF7TFVA.js +1 -0
  51. package/dist/standalone/{chunk-LIQOSH6R.js → chunk-FGUHYMGU.js} +1 -1
  52. package/dist/standalone/{chunk-74OCXJGH.js → chunk-FLMIY73E.js} +1 -1
  53. package/dist/standalone/{chunk-5ZZO5UEC.js → chunk-FZLWUX7L.js} +1 -1
  54. package/dist/standalone/{chunk-QURAUVUB.js → chunk-FZSNE2IP.js} +1 -1
  55. package/dist/standalone/{chunk-MWMVXHQM.js → chunk-GXKHIVIJ.js} +1 -1
  56. package/dist/standalone/{chunk-AFIY2ATE.js → chunk-HROJA6UV.js} +1 -1
  57. package/dist/standalone/{chunk-XNZ4WUSQ.js → chunk-I63W47HC.js} +1 -1
  58. package/dist/standalone/{chunk-VB3BKQCE.js → chunk-IGIBOJJG.js} +1 -1
  59. package/dist/standalone/{chunk-NXNTS5G2.js → chunk-IKI4VXGN.js} +1 -1
  60. package/dist/standalone/{chunk-GWRKSV2Q.js → chunk-IXBHUFDE.js} +1 -1
  61. package/dist/standalone/{chunk-DBOXAUII.js → chunk-IYJF4GU7.js} +1 -1
  62. package/dist/standalone/{chunk-22OYIN7Q.js → chunk-IZQESKL2.js} +1 -1
  63. package/dist/standalone/chunk-JEKJEGBJ.js +33 -0
  64. package/dist/standalone/{chunk-DIZP54PG.js → chunk-JO3JBEGB.js} +1 -1
  65. package/dist/standalone/{chunk-D76SLSGV.js → chunk-JXGB4QDO.js} +1 -1
  66. package/dist/standalone/{chunk-GBVYBBIF.js → chunk-KCIVTT2F.js} +1 -1
  67. package/dist/standalone/{chunk-TLOLN6RV.js → chunk-KLS5BVVO.js} +1 -1
  68. package/dist/standalone/{chunk-GQF53GWD.js → chunk-KMNBBIIS.js} +1 -1
  69. package/dist/standalone/{chunk-K7Z7UTJJ.js → chunk-KN4GQKJS.js} +1 -1
  70. package/dist/standalone/{chunk-AMWPN5JC.js → chunk-KNGEOOIV.js} +1 -1
  71. package/dist/standalone/{chunk-N6H4WQHD.js → chunk-KY5SWGWS.js} +1 -1
  72. package/dist/standalone/{chunk-P37L55FP.js → chunk-L62S7I64.js} +1 -1
  73. package/dist/standalone/{chunk-FH4R64SS.js → chunk-LH2SSK4J.js} +1 -1
  74. package/dist/standalone/chunk-LJLNIVUA.js +8 -0
  75. package/dist/standalone/{chunk-553O7ESU.js → chunk-LMGNMZUF.js} +1 -1
  76. package/dist/standalone/{chunk-IEMQNFZ7.js → chunk-LUUXWTIY.js} +1 -1
  77. package/dist/standalone/{chunk-ZIUDJD6M.js → chunk-M4GISIVK.js} +1 -1
  78. package/dist/standalone/{chunk-3FVWKQLT.js → chunk-MT3SPV45.js} +1 -1
  79. package/dist/standalone/{chunk-PP75AWAZ.js → chunk-MUQCBR27.js} +1 -1
  80. package/dist/standalone/{chunk-QVFWLGGW.js → chunk-N7ZOD63M.js} +1 -1
  81. package/dist/standalone/{chunk-MAZES4KJ.js → chunk-NHBHBDXG.js} +1 -1
  82. package/dist/standalone/{chunk-7VZPHPTH.js → chunk-O3NLXHWS.js} +1 -1
  83. package/dist/standalone/{chunk-APHDGDQX.js → chunk-O3YJ437V.js} +1 -1
  84. package/dist/standalone/{chunk-EYDMS22X.js → chunk-OFTGFFZO.js} +1 -1
  85. package/dist/standalone/{chunk-YOUTNV5Y.js → chunk-OOUGEUZ4.js} +1 -1
  86. package/dist/standalone/chunk-OW7PWUF6.js +7 -0
  87. package/dist/standalone/{chunk-44ZHY2EU.js → chunk-P3QC3BR5.js} +1 -1
  88. package/dist/standalone/{chunk-7E3RA4X6.js → chunk-PZIS5JIG.js} +1 -1
  89. package/dist/standalone/{chunk-NSG5VFIL.js → chunk-Q2AOMTCB.js} +1 -1
  90. package/dist/standalone/{chunk-M5VU6MF5.js → chunk-QFHYWVOO.js} +1 -1
  91. package/dist/standalone/{chunk-YKUO2I5M.js → chunk-QUYKKLCH.js} +1 -1
  92. package/dist/standalone/{chunk-RNVK7QCW.js → chunk-R7MTF7SJ.js} +1 -1
  93. package/dist/standalone/{chunk-MWF4AQ5B.js → chunk-S2VF3IDK.js} +1 -1
  94. package/dist/standalone/{chunk-WUWBRYJG.js → chunk-S2WOKV7Y.js} +1 -1
  95. package/dist/standalone/{chunk-VH4NT2WJ.js → chunk-SCHOGXPE.js} +1 -1
  96. package/dist/standalone/{chunk-COLRWCN5.js → chunk-SD5JCGIU.js} +1 -1
  97. package/dist/standalone/{chunk-BS77NGL6.js → chunk-UDGBH3IC.js} +1 -1
  98. package/dist/standalone/{chunk-F4KT43QZ.js → chunk-W7DGN5TF.js} +1 -1
  99. package/dist/standalone/chunk-X2KZTOZR.js +1 -0
  100. package/dist/standalone/{chunk-JB5VB7PX.js → chunk-X7YDONJY.js} +1 -1
  101. package/dist/standalone/{chunk-XMJB5JOF.js → chunk-YCQ7ZPBP.js} +1 -1
  102. package/dist/standalone/{chunk-CVPH3ATG.js → chunk-YCRGSQOQ.js} +1 -1
  103. package/dist/standalone/{chunk-UBAPZPI2.js → chunk-YECCEZZT.js} +1 -1
  104. package/dist/standalone/{chunk-O6HYP4FT.js → chunk-YIXBY57R.js} +1 -1
  105. package/dist/standalone/{chunk-4RPRUFVA.js → chunk-YJOQFRGE.js} +1 -1
  106. package/dist/standalone/{chunk-VSYZL2WH.js → chunk-YM56MNAN.js} +1 -1
  107. package/dist/standalone/{chunk-446DKR7O.js → chunk-YSJ6AQXN.js} +1 -1
  108. package/dist/standalone/{chunk-CF2MJGHC.js → chunk-Z2373QYM.js} +1 -1
  109. package/dist/standalone/{chunk-6BWAMHRF.js → chunk-ZLGK7CDZ.js} +1 -1
  110. package/dist/standalone/{chunk-BMDQFH65.js → chunk-ZVTDYI5T.js} +1 -1
  111. package/dist/standalone/studio.js +1 -1
  112. package/dist/styles.css +1 -1
  113. package/package.json +2 -2
  114. package/dist/packem_shared/log-fields-BolUoZ9g.mjs +0 -1
  115. package/dist/packem_shared/log-line-BH0iWiBv.mjs +0 -1
  116. package/dist/standalone/chunk-EC3XQQRV.js +0 -1
  117. package/dist/standalone/chunk-IYN56FBP.js +0 -1
  118. package/dist/standalone/chunk-K24LZAP2.js +0 -7
  119. package/dist/standalone/chunk-M7EHYZ6R.js +0 -1
  120. package/dist/standalone/chunk-OYCDWIG2.js +0 -33
  121. package/dist/standalone/chunk-U4X2I55T.js +0 -1
  122. package/dist/standalone/chunk-YORPLSI5.js +0 -1
@@ -1 +1 @@
1
- import{a as q}from"./chunk-IDK6WH4X.js";import"./chunk-3FVWKQLT.js";import{a as k}from"./chunk-F4KT43QZ.js";import"./chunk-QLZGKBOW.js";import"./chunk-Y2YLTUMD.js";import"./chunk-R3RIZDUS.js";import{a as A}from"./chunk-2KTN53PK.js";import{a as $}from"./chunk-7VZPHPTH.js";import"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import"./chunk-VB3BKQCE.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import"./chunk-OZID3UYF.js";import{a as E}from"./chunk-K7Z7UTJJ.js";import{b as j}from"./chunk-XMJB5JOF.js";import"./chunk-L27FKJTG.js";import{a as F}from"./chunk-2BCNWFC5.js";import"./chunk-CTIZP3XO.js";import"./chunk-GWRKSV2Q.js";import"./chunk-IAVAD545.js";import"./chunk-EOFWXI3T.js";import{a as S}from"./chunk-LYVYUTQY.js";import{c as I}from"./chunk-P37L55FP.js";import{a as w,e as O}from"./chunk-D76SLSGV.js";import"./chunk-K24LZAP2.js";import"./chunk-ZPQBVYNN.js";import{B as T,w as C}from"./chunk-OYCDWIG2.js";import"./chunk-PDBW6GTJ.js";import{a as D}from"./chunk-A6TVTNKO.js";import{b as H}from"./chunk-ADABTCDI.js";import{a as p,d as _}from"./chunk-5PEAXTYQ.js";var K=_(D(),1);var m=_(H(),1);var L=p(s=>s.length===0?void 0:{max:Math.max(...s),mean:s.reduce((e,t)=>e+t,0)/s.length,min:Math.min(...s)},"F"),B=/^gen_ai\.evaluation\.(.+)\.score$/u,P=p(s=>{let e=[];for(let t of s)for(let n of t.spans)for(let[a,l]of Object.entries(n.attributes??{})){let o=B.exec(a);if(!o||typeof l!="number")continue;let i=o[1],c=n.attributes?.[`gen_ai.evaluation.${i}.label`];e.push({...typeof c=="string"?{label:c}:{},name:i,score:l,spanName:n.name,startTs:t.startTs+n.offsetMs,traceId:t.traceId})}return e.toSorted((t,n)=>n.startTs-t.startTs)},"q"),Q=p(s=>{let e=[];for(let t of s?.series??[]){let n=B.exec(t.name);n&&e.push({name:n[1],points:t.points})}return e},"D"),R=p((s,e)=>{let t=new Set([...s.map(a=>a.name),...e.map(a=>a.name)]),n=[];for(let a of t){let l=s.filter(r=>r.name===a),o=e.find(r=>r.name===a)?.points??[],i=o.at(-1)?.last??l[0]?.score,c=o.length>0?{max:Math.max(...o.map(r=>r.max)),mean:o.reduce((r,d)=>r+d.sum,0)/o.reduce((r,d)=>r+d.count,0),min:Math.min(...o.map(r=>r.min))}:L(l.map(r=>r.score));n.push({...i===void 0?{}:{latest:i},...c,name:a,points:o,runs:l})}return n.toSorted((a,l)=>a.name.localeCompare(l.name))},"H"),U=p(s=>Array.isArray(s?.traces)?s.traces:[],"L"),N=p(s=>s===void 0?"\u2014":s.toFixed(2),"y"),z=p(s=>{let e=(0,K.c)(34),{card:t,onOpenTrace:n}=s,a=T(),l;e[0]!==t.name?(l=(0,m.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"ev-name",children:t.name}),e[0]=t.name,e[1]=l):l=e[1];let o;e[2]!==t.latest?(o=N(t.latest),e[2]=t.latest,e[3]=o):o=e[3];let i;e[4]!==o?(i=(0,m.jsx)("span",{className:"font-mono text-lg text-foreground","data-testid":"ev-latest",children:o}),e[4]=o,e[5]=i):i=e[5];let c;e[6]!==l||e[7]!==i?(c=(0,m.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[l,i]}),e[6]=l,e[7]=i,e[8]=c):c=e[8];let r;e[9]!==t.max||e[10]!==t.mean||e[11]!==t.min||e[12]!==a?(r=a("min {min} \xB7 mean {mean} \xB7 max {max}",{max:N(t.max),mean:N(t.mean),min:N(t.min)}),e[9]=t.max,e[10]=t.mean,e[11]=t.min,e[12]=a,e[13]=r):r=e[13];let d;e[14]!==r?(d=(0,m.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"ev-summary",children:r}),e[14]=r,e[15]=d):d=e[15];let u;e[16]!==t.name||e[17]!==t.points||e[18]!==a?(u=t.points.length>1?(0,m.jsx)(q,{ariaLabel:a("Score trend for {name}",{name:t.name}),className:"h-10 w-full",series:t.points.map(G),testId:"ev-trend"}):(0,m.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ev-no-trend",children:a("No durable history yet \u2014 pass ctx.metrics to recordEvaluation to chart a trend.")}),e[16]=t.name,e[17]=t.points,e[18]=a,e[19]=u):u=e[19];let h;if(e[20]!==t.runs||e[21]!==n||e[22]!==a){let v;e[24]!==n||e[25]!==a?(v=p(f=>(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2 font-mono text-xs","data-testid":"ev-run",children:[(0,m.jsxs)("span",{className:"truncate text-muted-foreground",children:[C(f.startTs)," \xB7 ",f.spanName]}),(0,m.jsxs)("span",{className:"flex items-center gap-2",children:[f.label===void 0?null:(0,m.jsx)(j,{variant:"outline",children:f.label}),(0,m.jsx)("span",{className:"text-foreground",children:N(f.score)}),n===void 0?null:(0,m.jsx)("button",{className:"text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{n(f.traceId)},"onClick"),title:a("Open the trace {trace}",{trace:f.traceId}),type:"button",children:f.traceId.slice(0,8)})]})]},`${f.traceId}:${f.spanName}`),"x"),e[24]=n,e[25]=a,e[26]=v):v=e[26],h=t.runs.slice(0,5).map(v),e[20]=t.runs,e[21]=n,e[22]=a,e[23]=h}else h=e[23];let x;e[27]!==h?(x=(0,m.jsx)("div",{className:"flex flex-col gap-1",children:h}),e[27]=h,e[28]=x):x=e[28];let g;return e[29]!==c||e[30]!==d||e[31]!==u||e[32]!==x?(g=(0,m.jsx)(w,{"data-testid":"ev-card",children:(0,m.jsxs)(O,{className:"flex flex-col gap-3 p-4",children:[c,d,u,x]})}),e[29]=c,e[30]=d,e[31]=u,e[32]=x,e[33]=g):g=e[33],g},"P"),oe=p(s=>{let e=(0,K.c)(21),{initialShardKey:t}=s,n=T(),{queryShardKey:a,setShardKey:l,shardKey:o}=A(t),i=k(a),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let r;e[1]!==a?(r={live:!0,shardKey:a},e[1]=a,e[2]=r):r=e[2];let{data:d,error:u}=I(S.getTraces,c,r),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let x;e[4]!==a?(x={live:!0,shardKey:a},e[4]=a,e[5]=x):x=e[5];let{data:g}=I(S.getMetricHistory,h,x),v;if(e[6]!==d||e[7]!==u||e[8]!==g||e[9]!==i||e[10]!==a||e[11]!==l||e[12]!==o||e[13]!==n){let f=R(P(U(d)),Q(g)),y;e[15]!==l||e[16]!==o?(y=(0,m.jsx)($,{onChange:l,testId:"ev-shard-input",value:o}),e[15]=l,e[16]=o,e[17]=y):y=e[17];let b;e[18]!==u||e[19]!==a?(b=u===null?null:(0,m.jsx)(F,{error:u,shardKey:a,testId:"ev-error"}),e[18]=u,e[19]=a,e[20]=b):b=e[20],v=(0,m.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ev-panel",children:[y,b,f.length===0?(0,m.jsx)(E,{description:n("Call recordEvaluation from a graded run and its score shows up here."),testId:"ev-empty",title:n("No evals recorded")}):(0,m.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(M=>(0,m.jsx)(z,{card:M,onOpenTrace:i},M.name))})]}),e[6]=d,e[7]=u,e[8]=g,e[9]=i,e[10]=a,e[11]=l,e[12]=o,e[13]=n,e[14]=v}else v=e[14];return v},"re");function G(s){return s.last}p(G,"Q");export{oe as default};
1
+ import{a as q}from"./chunk-DR4FUUVD.js";import"./chunk-MT3SPV45.js";import{a as k}from"./chunk-W7DGN5TF.js";import"./chunk-QLZGKBOW.js";import"./chunk-Y2YLTUMD.js";import"./chunk-R3RIZDUS.js";import{a as A}from"./chunk-2KTN53PK.js";import{a as $}from"./chunk-O3NLXHWS.js";import"./chunk-EDL46BPM.js";import"./chunk-4KPATTV6.js";import"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import"./chunk-IGIBOJJG.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import"./chunk-OZID3UYF.js";import{a as E}from"./chunk-KN4GQKJS.js";import{b as j}from"./chunk-YCQ7ZPBP.js";import"./chunk-L27FKJTG.js";import{a as F}from"./chunk-4UMUJTD2.js";import"./chunk-CYL7MEO2.js";import"./chunk-IXBHUFDE.js";import"./chunk-B2GQMLO3.js";import"./chunk-EOFWXI3T.js";import{a as S}from"./chunk-LYVYUTQY.js";import{c as I}from"./chunk-L62S7I64.js";import{a as w,e as O}from"./chunk-JXGB4QDO.js";import"./chunk-OW7PWUF6.js";import"./chunk-ZPQBVYNN.js";import{B as T,w as C}from"./chunk-JEKJEGBJ.js";import"./chunk-PDBW6GTJ.js";import{a as D}from"./chunk-A6TVTNKO.js";import{b as H}from"./chunk-ADABTCDI.js";import{a as p,d as _}from"./chunk-5PEAXTYQ.js";var K=_(D(),1);var m=_(H(),1);var L=p(s=>s.length===0?void 0:{max:Math.max(...s),mean:s.reduce((e,t)=>e+t,0)/s.length,min:Math.min(...s)},"F"),B=/^gen_ai\.evaluation\.(.+)\.score$/u,P=p(s=>{let e=[];for(let t of s)for(let n of t.spans)for(let[a,l]of Object.entries(n.attributes??{})){let o=B.exec(a);if(!o||typeof l!="number")continue;let i=o[1],c=n.attributes?.[`gen_ai.evaluation.${i}.label`];e.push({...typeof c=="string"?{label:c}:{},name:i,score:l,spanName:n.name,startTs:t.startTs+n.offsetMs,traceId:t.traceId})}return e.toSorted((t,n)=>n.startTs-t.startTs)},"q"),Q=p(s=>{let e=[];for(let t of s?.series??[]){let n=B.exec(t.name);n&&e.push({name:n[1],points:t.points})}return e},"D"),R=p((s,e)=>{let t=new Set([...s.map(a=>a.name),...e.map(a=>a.name)]),n=[];for(let a of t){let l=s.filter(r=>r.name===a),o=e.find(r=>r.name===a)?.points??[],i=o.at(-1)?.last??l[0]?.score,c=o.length>0?{max:Math.max(...o.map(r=>r.max)),mean:o.reduce((r,d)=>r+d.sum,0)/o.reduce((r,d)=>r+d.count,0),min:Math.min(...o.map(r=>r.min))}:L(l.map(r=>r.score));n.push({...i===void 0?{}:{latest:i},...c,name:a,points:o,runs:l})}return n.toSorted((a,l)=>a.name.localeCompare(l.name))},"H"),U=p(s=>Array.isArray(s?.traces)?s.traces:[],"L"),N=p(s=>s===void 0?"\u2014":s.toFixed(2),"y"),z=p(s=>{let e=(0,K.c)(34),{card:t,onOpenTrace:n}=s,a=T(),l;e[0]!==t.name?(l=(0,m.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground","data-testid":"ev-name",children:t.name}),e[0]=t.name,e[1]=l):l=e[1];let o;e[2]!==t.latest?(o=N(t.latest),e[2]=t.latest,e[3]=o):o=e[3];let i;e[4]!==o?(i=(0,m.jsx)("span",{className:"font-mono text-lg text-foreground","data-testid":"ev-latest",children:o}),e[4]=o,e[5]=i):i=e[5];let c;e[6]!==l||e[7]!==i?(c=(0,m.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[l,i]}),e[6]=l,e[7]=i,e[8]=c):c=e[8];let r;e[9]!==t.max||e[10]!==t.mean||e[11]!==t.min||e[12]!==a?(r=a("min {min} \xB7 mean {mean} \xB7 max {max}",{max:N(t.max),mean:N(t.mean),min:N(t.min)}),e[9]=t.max,e[10]=t.mean,e[11]=t.min,e[12]=a,e[13]=r):r=e[13];let d;e[14]!==r?(d=(0,m.jsx)("p",{className:"font-mono text-xs text-muted-foreground","data-testid":"ev-summary",children:r}),e[14]=r,e[15]=d):d=e[15];let u;e[16]!==t.name||e[17]!==t.points||e[18]!==a?(u=t.points.length>1?(0,m.jsx)(q,{ariaLabel:a("Score trend for {name}",{name:t.name}),className:"h-10 w-full",series:t.points.map(G),testId:"ev-trend"}):(0,m.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"ev-no-trend",children:a("No durable history yet \u2014 pass ctx.metrics to recordEvaluation to chart a trend.")}),e[16]=t.name,e[17]=t.points,e[18]=a,e[19]=u):u=e[19];let h;if(e[20]!==t.runs||e[21]!==n||e[22]!==a){let v;e[24]!==n||e[25]!==a?(v=p(f=>(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2 font-mono text-xs","data-testid":"ev-run",children:[(0,m.jsxs)("span",{className:"truncate text-muted-foreground",children:[C(f.startTs)," \xB7 ",f.spanName]}),(0,m.jsxs)("span",{className:"flex items-center gap-2",children:[f.label===void 0?null:(0,m.jsx)(j,{variant:"outline",children:f.label}),(0,m.jsx)("span",{className:"text-foreground",children:N(f.score)}),n===void 0?null:(0,m.jsx)("button",{className:"text-muted-foreground underline-offset-2 hover:underline",onClick:p(()=>{n(f.traceId)},"onClick"),title:a("Open the trace {trace}",{trace:f.traceId}),type:"button",children:f.traceId.slice(0,8)})]})]},`${f.traceId}:${f.spanName}`),"x"),e[24]=n,e[25]=a,e[26]=v):v=e[26],h=t.runs.slice(0,5).map(v),e[20]=t.runs,e[21]=n,e[22]=a,e[23]=h}else h=e[23];let x;e[27]!==h?(x=(0,m.jsx)("div",{className:"flex flex-col gap-1",children:h}),e[27]=h,e[28]=x):x=e[28];let g;return e[29]!==c||e[30]!==d||e[31]!==u||e[32]!==x?(g=(0,m.jsx)(w,{"data-testid":"ev-card",children:(0,m.jsxs)(O,{className:"flex flex-col gap-3 p-4",children:[c,d,u,x]})}),e[29]=c,e[30]=d,e[31]=u,e[32]=x,e[33]=g):g=e[33],g},"P"),oe=p(s=>{let e=(0,K.c)(21),{initialShardKey:t}=s,n=T(),{queryShardKey:a,setShardKey:l,shardKey:o}=A(t),i=k(a),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];let r;e[1]!==a?(r={live:!0,shardKey:a},e[1]=a,e[2]=r):r=e[2];let{data:d,error:u}=I(S.getTraces,c,r),h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={},e[3]=h):h=e[3];let x;e[4]!==a?(x={live:!0,shardKey:a},e[4]=a,e[5]=x):x=e[5];let{data:g}=I(S.getMetricHistory,h,x),v;if(e[6]!==d||e[7]!==u||e[8]!==g||e[9]!==i||e[10]!==a||e[11]!==l||e[12]!==o||e[13]!==n){let f=R(P(U(d)),Q(g)),y;e[15]!==l||e[16]!==o?(y=(0,m.jsx)($,{onChange:l,testId:"ev-shard-input",value:o}),e[15]=l,e[16]=o,e[17]=y):y=e[17];let b;e[18]!==u||e[19]!==a?(b=u===null?null:(0,m.jsx)(F,{error:u,shardKey:a,testId:"ev-error"}),e[18]=u,e[19]=a,e[20]=b):b=e[20],v=(0,m.jsxs)("section",{className:"flex flex-col gap-4","data-testid":"ev-panel",children:[y,b,f.length===0?(0,m.jsx)(E,{description:n("Call recordEvaluation from a graded run and its score shows up here."),testId:"ev-empty",title:n("No evals recorded")}):(0,m.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(M=>(0,m.jsx)(z,{card:M,onOpenTrace:i},M.name))})]}),e[6]=d,e[7]=u,e[8]=g,e[9]=i,e[10]=a,e[11]=l,e[12]=o,e[13]=n,e[14]=v}else v=e[14];return v},"re");function G(s){return s.last}p(G,"Q");export{oe as default};
@@ -1 +1 @@
1
- import{g as j,h as v,i as D,n as q}from"./chunk-K24LZAP2.js";import{h as g,i as S,j as P,s as w}from"./chunk-OYCDWIG2.js";import{a as M}from"./chunk-A6TVTNKO.js";import{a as L}from"./chunk-ADABTCDI.js";import{a as i,d as A}from"./chunk-5PEAXTYQ.js";var E=A(M(),1);var p=A(L(),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=q(),{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(()=>{w(o.refetch())},"refetch"),poll:i(async()=>{await o.refetch({throwOnError:!0})},"poll")}}i(W,"F");function Y(t,r,e={}){let s=q(),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(g(t),r,S(o)),{enabled:a,keepPreviousData:c,staleTime:R??(d?Number.POSITIVE_INFINITY:0)}),[K,b]=(0,p.useState)(void 0),Q=JSON.stringify(m);return(0,p.useEffect)(()=>{if(!a||!d)return;b(void 0);let y=f.startSubscription(t,r,o),x=s.subscribe(g(t),r,h=>{f.recordPush(y),b(void 0),n.setQueryData(_(m,s.clientIdentifier()),h)},{...S(o),onError:i(h=>{f.failSubscription(y,h.message),b(h.message)},"onError")});return()=>{f.endSubscription(y),x()}},[s,Q,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??"");w(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
+ import{g as j,h as v,i as D,n as q}from"./chunk-OW7PWUF6.js";import{h as g,i as S,j as P,s as w}from"./chunk-JEKJEGBJ.js";import{a as M}from"./chunk-A6TVTNKO.js";import{a as L}from"./chunk-ADABTCDI.js";import{a as i,d as A}from"./chunk-5PEAXTYQ.js";var E=A(M(),1);var p=A(L(),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=q(),{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(()=>{w(o.refetch())},"refetch"),poll:i(async()=>{await o.refetch({throwOnError:!0})},"poll")}}i(W,"F");function Y(t,r,e={}){let s=q(),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(g(t),r,S(o)),{enabled:a,keepPreviousData:c,staleTime:R??(d?Number.POSITIVE_INFINITY:0)}),[K,b]=(0,p.useState)(void 0),Q=JSON.stringify(m);return(0,p.useEffect)(()=>{if(!a||!d)return;b(void 0);let y=f.startSubscription(t,r,o),x=s.subscribe(g(t),r,h=>{f.recordPush(y),b(void 0),n.setQueryData(_(m,s.clientIdentifier()),h)},{...S(o),onError:i(h=>{f.failSubscription(y,h.message),b(h.message)},"onError")});return()=>{f.endSubscription(y),x()}},[s,Q,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??"");w(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,4 +1,4 @@
1
- import{a as dt,b as Or,c as uo}from"./chunk-GBVYBBIF.js";import{d as zr}from"./chunk-R6NJ4ER6.js";import{a as io}from"./chunk-W7CLOQOU.js";import{a as Be}from"./chunk-ODEIAS3V.js";import{c as so}from"./chunk-MHZNDDGI.js";import{a as lo}from"./chunk-JUTXPZQK.js";import{a as ro}from"./chunk-DIZP54PG.js";import{a as co,b as He,f as Vr,g as Er}from"./chunk-MXYZQCDR.js";import{a as Ot}from"./chunk-MAZES4KJ.js";import{a as ao}from"./chunk-JNWK5MJC.js";import{a as Tr}from"./chunk-RQFK2LYP.js";import{a as rn}from"./chunk-BMDQFH65.js";import"./chunk-CD6Y4HMA.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import{b as yr,c as tn}from"./chunk-CL3JOU6F.js";import{a as ln}from"./chunk-DRHZZ7IN.js";import{a as to,b as xr}from"./chunk-YOUTNV5Y.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as Nr}from"./chunk-7VZPHPTH.js";import{a as Fr,b as kr}from"./chunk-EDL46BPM.js";import{a as en}from"./chunk-KMA6JR2E.js";import{b as Cr,c as Rr,f as on}from"./chunk-4KPATTV6.js";import{c as pr,d as br,e as hr,f as rt,g as Zt,h as wr,i as Sr}from"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import{i as vr}from"./chunk-VB3BKQCE.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as oo}from"./chunk-553O7ESU.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as no}from"./chunk-K7Z7UTJJ.js";import"./chunk-L27FKJTG.js";import{a as Mr,b as Ir,c as Pr,d as nn,e as Ar,f as Dr}from"./chunk-VSYZL2WH.js";import{a as _e}from"./chunk-LYVYUTQY.js";import{b as Zo,c as lt}from"./chunk-P37L55FP.js";import{b as Qo,c as Xo,d as Yt,e as fr,n as et}from"./chunk-K24LZAP2.js";import"./chunk-ZPQBVYNN.js";import{B as te,h as $e,i as je,j as Tt,p as Yo,q as eo,r as Ee,s as ee,w as _r,x as ut}from"./chunk-OYCDWIG2.js";import"./chunk-PDBW6GTJ.js";import{a as At}from"./chunk-A6TVTNKO.js";import{a as ct,b as Dt}from"./chunk-ADABTCDI.js";import{a as n,d as ke}from"./chunk-5PEAXTYQ.js";var Vs=ke(At(),1);var Mt=ke(ct(),1);var G=ke(At(),1),A=ke(ct(),1);var _t=ke(At(),1);var X=ke(Dt(),1),tt=ke(ct(),1);var fi=2166136261,pi=16777619,bi=n((t,e=fi)=>{let o=e;for(let l=0;l<t.length;l+=1)o^=t.charCodeAt(l),o=Math.imul(o,pi);return(o>>>0).toString(16).padStart(8,"0")},"L"),hi=/([a-z\d])([A-Z])/gu,wi=/[\s_-]+/u,Si=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),_i=n(t=>{let e=t.replaceAll(hi,"$1 $2").split(wi).map(l=>l.toLowerCase()).filter(l=>l.length>0),o=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||(o.add(`${r}${a}`),o.add(`${r}_${a}`))}return[...o]},"ae"),$r="\u2022\u2022\u2022",qr=n((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:bi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):$r}catch{return $r}},"U"),jr=n((t,e)=>{let o=new Map;for(let l of t)l.table===e&&o.set(l.column,l.strategy);return o},"V"),xi=n(t=>{for(let e of _i(t))if(Si.has(e))return!0;return!1},"ce"),Hr=n((t,e)=>{let o=e.filter(r=>!t.has(r)&&xi(r));if(o.length===0)return t;let l=new Map(t);for(let r of o)l.set(r,"redact");return l},"j"),Vt=n((t,e,o)=>{if(!o.enabled)return t;let l=o.columns.get(e);return l===void 0?t:qr(t,l)},"_e"),mo=n((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let o={...t};for(let[l,r]of e.columns)l in o&&(o[l]=qr(o[l],r));return o},"ie"),go=n((t,e)=>!e.enabled||e.columns.size===0?t:t.map(o=>mo(o,e)),"Me"),Lr=n(t=>t==null?"\u2205":t===""?"(empty)":Ee(t),"z"),vi=n(t=>{let e=(0,_t.c)(32),{column:o,onFacetFilter:l,state:r}=t,a=te(),s;e[0]!==o||e[1]!==l||e[2]!==r.result?.values?(s=n(w=>{let x=Number(w.currentTarget.dataset.index),_=r.result?.values[x];_!==void 0&&l(o,_.value)},"x"),e[0]=o,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let c=s,i=`db-facet-${o}`,u;e[4]!==o?(u=(0,X.jsx)("span",{className:"font-medium text-foreground",children:o}),e[4]=o,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,X.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,X.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]!==o||e[15]!==c||e[16]!==m){let w;e[18]!==o||e[19]!==c?(w=n((x,_)=>(0,X.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":_,"data-testid":`db-facet-value-${o}`,onClick:c,type:"button",children:[(0,X.jsx)("span",{className:"truncate",children:Lr(x.value)}),(0,X.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:x.count})]},Lr(x.value)),"c"),e[18]=o,e[19]=c,e[20]=w):w=e[20],h=m.map(w),e[14]=o,e[15]=c,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==o||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,X.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${o}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=o,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==i||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,X.jsxs)("section",{className:"flex flex-col gap-1","data-testid":i,children:[u,d,g,h,p]}),e[25]=i,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ue"),fo=n(t=>{let e=(0,_t.c)(44),{columns:o,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,c=te(),i;e[0]!==s?(i=n(y=>{let{column:k}=y.currentTarget.dataset;k!==void 0&&s(k)},"o"),e[0]=s,e[1]=i):i=e[1];let u=i,d;e[2]!==r?(d=n(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,x,_,C;if(e[4]!==o||e[5]!==l||e[6]!==g||e[7]!==c||e[8]!==u){C=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==g?(y=n(N=>!g(N),"y"),e[17]=g,e[18]=y):y=e[18];let k=o.filter(y),P;if(e[19]!==l||e[20]!==g?(P=Object.entries(l).filter(N=>{let[T]=N;return!g(T)}),e[19]=l,e[20]=g,e[21]=P):P=e[21],m=P,k.length===0){C=null;break e}x="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",_="db-facets",b="flex flex-col gap-1.5";let M;e[22]!==c?(M=c("Facets"),e[22]=c,e[23]=M):M=e[23],e[24]!==M?(w=(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:M}),e[24]=M,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let I;e[26]!==l||e[27]!==u?(I=n(N=>(0,X.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]=I):I=e[28],p=k.map(I)}e[4]=o,e[5]=l,e[6]=g,e[7]=c,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=x,e[15]=_,e[16]=C}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],x=e[14],_=e[15],C=e[16];if(C!==Symbol.for("react.early_return_sentinel"))return C;let F;e[29]!==h||e[30]!==p?(F=(0,X.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=F):F=e[31];let v;e[32]!==F||e[33]!==b||e[34]!==w?(v=(0,X.jsxs)("div",{className:b,children:[w,F]}),e[32]=F,e[33]=b,e[34]=w,e[35]=v):v=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(y=>{let[k,P]=y;return(0,X.jsx)(vi,{column:k,onFacetFilter:a,state:P},k)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let S;return e[39]!==v||e[40]!==R||e[41]!==x||e[42]!==_?(S=(0,X.jsxs)("aside",{className:x,"data-testid":_,children:[v,R]}),e[39]=v,e[40]=R,e[41]=x,e[42]=_,e[43]=S):S=e[43],S},"Te"),po=n(()=>{let[t,e]=(0,tt.useState)({}),o=Be(t),l=(0,tt.useRef)({}),r=n(async(a,s)=>{let c=(l.current[a]??0)+1;l.current[a]=c,e(i=>a in i?{...i,[a]:{error:null,loading:!0,result:i[a]?.result??null}}:i);try{let i=await s(a);if(l.current[a]!==c)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:i}}:u)}catch(i){if(l.current[a]!==c)return;throw e(u=>a in u?{...u,[a]:{error:Tt(i),loading:!1,result:null}}:u),i}},"n");return{clearFacets:n(()=>{e({})},"clearFacets"),facets:t,facetsRef:o,refetchFacets:n(a=>xr(Object.keys(o.current).map(s=>r(s,a))),"refetchFacets"),toggleFacet:n((a,s)=>{if(a in o.current){e(c=>Object.fromEntries(Object.entries(c).filter(([i])=>i!==a)));return}e(c=>({...c,[a]:{error:null,loading:!0,result:null}})),s!==null&&ee(r(a,s))},"toggleFacet")}},"$e"),yi=[],Ci=n(()=>{let t=(0,_t.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:o}=lt(_e.maskPolicies,e);return Array.isArray(o?.columns)?o.columns:yi},"fe"),bo=n(t=>{let e=(0,_t.c)(16),{columns:o,selectedTable:l}=t,r=Ci(),[a,s]=(0,tt.useState)(!0),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n(()=>{s(Ri)},"g"),e[0]=c):c=e[0];let i=c,u;if(e[1]!==o||e[2]!==r||e[3]!==l){let b=jr(r,l??"");u=Hr(b,o),e[1]=o,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=n((b,w)=>({columns:Hr(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:i},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Re");function Ri(t){return!t}n(Ri,"me");var Br=34,Gr=600,Fi=n(t=>{let e=(0,_t.c)(21),{item:o,onSelect:l,prefix:r,selected:a,start:s}=t,c;e[0]!==o.name||e[1]!==l?(c=n(()=>{l(o.name)},"g"),e[0]=o.name,e[1]=l,e[2]=c):c=e[2];let i=c,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=ut("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-${o.name}`,b;e[7]!==o.name?(b=(0,X.jsx)("span",{className:"truncate",children:o.name}),e[7]=o.name,e[8]=b):b=e[8];let w;e[9]!==o.rowCount?(w=(0,X.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:o.rowCount}),e[9]=o.rowCount,e[10]=w):w=e[10];let x;e[11]!==i||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(x=(0,X.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:i,type:"button",children:[b,w]}),e[11]=i,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=x):x=e[17];let _;return e[18]!==g||e[19]!==x?(_=(0,X.jsx)("li",{style:g,children:x}),e[18]=g,e[19]=x,e[20]=_):_=e[20],_},"ge"),ho=n(({header:t,onReload:e,onSelect:o,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let c=te(),[i,u]=(0,tt.useState)(""),d=(0,tt.useRef)(null),g=n(b=>{u(b.target.value)},"l"),m=(0,tt.useMemo)(()=>{let b=i.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[i,s]),h=so({count:m.length,estimateSize:n(()=>Br,"estimateSize"),getScrollElement:n(()=>d.current,"getScrollElement"),initialRect:{height:Gr,width:240},observeElementRect:n((b,w)=>io(b,w,Gr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Br};return(0,X.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,X.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c("Tables")}),e!==void 0&&(0,X.jsx)("button",{"aria-label":r??c("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??c("Refresh"),type:"button",children:(0,X.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,X.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,X.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,X.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:c("search table\u2026"),type:"search",value:i})}),(0,X.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,X.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,X.jsx)(Fi,{item:w,onSelect:o,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=ke(Dt(),1);var Kr=ke(ct(),1);function ki(t){return Ni(t)||typeof t=="function"||Mi(t)}n(ki,"isReactComponent");function Ni(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}n(Ni,"isClassComponent");function Mi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}n(Mi,"isExoticComponent");function mt(t,e){return t==null?null:ki(t)?Kr.default.createElement(t,e):t}n(mt,"flexRender");function an(t){if("cell"in t&&t.cell){let e=t.cell,o=e.column.columnDef,l=e,r=o;return l.getIsAggregated?.()?mt(r.aggregatedCell??o.cell,e.getContext()):l.getIsPlaceholder?.()?null:mt(o.cell,e.getContext())}return"header"in t&&t.header?mt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?mt(t.footer.column.columnDef.footer,t.footer.getContext()):null}n(an,"FlexRender");function Ur(t){let e=Zt(t.source,t.selector,{compare:rt});return typeof t.children=="function"?t.children(e):t.children}n(Ur,"Subscribe");function Jr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}n(Jr,"atomToStore");function sn(t){let{createAtom:e,batch:o}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:o,untrack:n(r=>r(),"untrack"),createReadonlyAtom:n((r,a)=>{let s=a?.compare??Object.is,c=!1,i,u=n(()=>{let g=r();return(!c||!s(i,g))&&(i=g,c=!0),i},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:n((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:n(()=>{l.set(r=>r+1)},"commit")}}n(sn,"renderPhaseReactivity");function cn(t,e=Object.is){let o=!1,l;return{get:t.get,markCommitted:n(r=>{l=r,o=!0},"markCommitted"),subscribe:n(r=>t.subscribe(a=>{(!o||!e(l,a))&&r(a)}),"subscribe")}}n(cn,"createRenderPhaseSource");function Wr(){return sn({createAtom:hr,batch:br})}n(Wr,"reactReactivity");function wo(t,e){return typeof t=="function"?t(e):t}n(wo,"functionalUpdate");function Re(t){if(Array.isArray(t))return t.map(Re);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let o=e===null?j():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(o,a,{configurable:!0,enumerable:!0,value:Re(t[a]),writable:!0})}return o}return t}n(Re,"cloneState");function So(t,e){let o=Object.keys(e),l=t;for(let r=0;r<o.length;r++){let a=o[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}n(So,"copyInstancePropertiesWithoutMemos");function j(){return Object.create(null)}n(j,"makeObjectMap");function Ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n(Ke,"hasOwn");function Ge(t,e){return o=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>wo(o,l))}}n(Ge,"makeStateUpdater");function Qr(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}n(Qr,"isPlainContainer");function Xr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}n(Xr,"getEnumerableOwnKeys");var Ii=3;function Pi(t,e){return Yr(t,e,Ii)}n(Pi,"stateSlicesEqual");function Yr(t,e,o){if(Object.is(t,e))return!0;if(o<=0||!Qr(t)||!Qr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Xr(t),r=Xr(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let c=0;c<l.length;c++){let i=l[c];if(!Object.prototype.propertyIsEnumerable.call(e,i)||!Yr(a[i],s[i],o-1))return!1}return!0}n(Yr,"stateSlicesEqualAtDepth");function xt(t,e,o,l=Pi){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let c=wo(o,s);return l(s,c)?s:c})}n(xt,"setStateSlice");function Zr(t){return t instanceof Function}n(Zr,"isFunction");function el(t,e){let o=[],l=n(r=>{r.forEach(a=>{o.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),o}n(el,"flattenBy");var Ai=n(({fn:t,memoDeps:e,onAfterCompare:o,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],c;return n(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 o?.(g),g&&(s=d,a?.(),c=t(...d??[]),l?.(c)),c},"memoizedFn")},"memo");function _o(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}n(_o,"skipFirstRun");var Di=n((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function vt({feature:t,fnName:e,objectId:o,onAfterUpdate:l,table:r,...a}){let s,c,i=0,u;function d(h,p){let b=i===0?"(1st run)":p?"(rerun #"+i+")":"(cache)";i++,console.groupCollapsed(`%c\u23F1 ${Di(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${o?`(${e.split(".")[0]}Id: ${o})`:""}`,`font-size: .6rem; font-weight: bold; ${p?`color: hsl(
1
+ import{a as dt,b as Or,c as uo}from"./chunk-KCIVTT2F.js";import{d as zr}from"./chunk-R6NJ4ER6.js";import{a as io}from"./chunk-W7CLOQOU.js";import{a as Be}from"./chunk-ODEIAS3V.js";import{c as so}from"./chunk-MHZNDDGI.js";import{a as lo}from"./chunk-3TPV2LT4.js";import{a as ro}from"./chunk-JO3JBEGB.js";import{a as co,b as He,f as Vr,g as Er}from"./chunk-DM63RG6O.js";import{a as Ot}from"./chunk-NHBHBDXG.js";import{a as ao}from"./chunk-JNWK5MJC.js";import{a as Tr}from"./chunk-BFL76ZWW.js";import{a as rn}from"./chunk-ZVTDYI5T.js";import"./chunk-2VGEXP5J.js";import"./chunk-LMCBMC2V.js";import"./chunk-QF743FSL.js";import{b as yr,c as tn}from"./chunk-CL3JOU6F.js";import{a as ln}from"./chunk-DRHZZ7IN.js";import{a as to,b as xr}from"./chunk-OOUGEUZ4.js";import"./chunk-IQ5CIBXJ.js";import"./chunk-YNCZVYCO.js";import"./chunk-OWRWDDJT.js";import"./chunk-QHVUXMRV.js";import"./chunk-2NUCBQFU.js";import{a as Nr}from"./chunk-O3NLXHWS.js";import{a as Fr,b as kr}from"./chunk-EDL46BPM.js";import{a as en}from"./chunk-EH3PU4PH.js";import{b as Cr,c as Rr,f as on}from"./chunk-4KPATTV6.js";import{c as pr,d as br,e as hr,f as rt,g as Zt,h as wr,i as Sr}from"./chunk-7WGZSDRS.js";import"./chunk-N7FOBAV3.js";import{i as vr}from"./chunk-IGIBOJJG.js";import"./chunk-4SY2N2RS.js";import"./chunk-4AG356VE.js";import{a as oo}from"./chunk-LMGNMZUF.js";import"./chunk-SCTYLLJT.js";import"./chunk-OZID3UYF.js";import{a as no}from"./chunk-KN4GQKJS.js";import"./chunk-L27FKJTG.js";import{a as Mr,b as Ir,c as Pr,d as nn,e as Ar,f as Dr}from"./chunk-YM56MNAN.js";import{a as _e}from"./chunk-LYVYUTQY.js";import{b as Zo,c as lt}from"./chunk-L62S7I64.js";import{b as Qo,c as Xo,d as Yt,e as fr,n as et}from"./chunk-OW7PWUF6.js";import"./chunk-ZPQBVYNN.js";import{B as te,h as $e,i as je,j as Tt,p as Yo,q as eo,r as Ee,s as ee,w as _r,x as ut}from"./chunk-JEKJEGBJ.js";import"./chunk-PDBW6GTJ.js";import{a as At}from"./chunk-A6TVTNKO.js";import{a as ct,b as Dt}from"./chunk-ADABTCDI.js";import{a as n,d as ke}from"./chunk-5PEAXTYQ.js";var Vs=ke(At(),1);var Mt=ke(ct(),1);var G=ke(At(),1),A=ke(ct(),1);var _t=ke(At(),1);var X=ke(Dt(),1),tt=ke(ct(),1);var fi=2166136261,pi=16777619,bi=n((t,e=fi)=>{let o=e;for(let l=0;l<t.length;l+=1)o^=t.charCodeAt(l),o=Math.imul(o,pi);return(o>>>0).toString(16).padStart(8,"0")},"L"),hi=/([a-z\d])([A-Z])/gu,wi=/[\s_-]+/u,Si=new Set(["access_token","api_key","apikey","card_number","client_secret","credit_card","cvv","passwd","password","private_key","pwd","refresh_token","secret","ssn","token"]),_i=n(t=>{let e=t.replaceAll(hi,"$1 $2").split(wi).map(l=>l.toLowerCase()).filter(l=>l.length>0),o=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||(o.add(`${r}${a}`),o.add(`${r}_${a}`))}return[...o]},"ae"),$r="\u2022\u2022\u2022",qr=n((t,e)=>{try{return e==="redact"?null:e==="hash"?t==null?t:bi(typeof t=="bigint"?t.toString():typeof t=="string"?t:JSON.stringify(t)):$r}catch{return $r}},"U"),jr=n((t,e)=>{let o=new Map;for(let l of t)l.table===e&&o.set(l.column,l.strategy);return o},"V"),xi=n(t=>{for(let e of _i(t))if(Si.has(e))return!0;return!1},"ce"),Hr=n((t,e)=>{let o=e.filter(r=>!t.has(r)&&xi(r));if(o.length===0)return t;let l=new Map(t);for(let r of o)l.set(r,"redact");return l},"j"),Vt=n((t,e,o)=>{if(!o.enabled)return t;let l=o.columns.get(e);return l===void 0?t:qr(t,l)},"_e"),mo=n((t,e)=>{if(!e.enabled||e.columns.size===0)return t;let o={...t};for(let[l,r]of e.columns)l in o&&(o[l]=qr(o[l],r));return o},"ie"),go=n((t,e)=>!e.enabled||e.columns.size===0?t:t.map(o=>mo(o,e)),"Me"),Lr=n(t=>t==null?"\u2205":t===""?"(empty)":Ee(t),"z"),vi=n(t=>{let e=(0,_t.c)(32),{column:o,onFacetFilter:l,state:r}=t,a=te(),s;e[0]!==o||e[1]!==l||e[2]!==r.result?.values?(s=n(w=>{let x=Number(w.currentTarget.dataset.index),_=r.result?.values[x];_!==void 0&&l(o,_.value)},"x"),e[0]=o,e[1]=l,e[2]=r.result?.values,e[3]=s):s=e[3];let c=s,i=`db-facet-${o}`,u;e[4]!==o?(u=(0,X.jsx)("span",{className:"font-medium text-foreground",children:o}),e[4]=o,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,X.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,X.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]!==o||e[15]!==c||e[16]!==m){let w;e[18]!==o||e[19]!==c?(w=n((x,_)=>(0,X.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":_,"data-testid":`db-facet-value-${o}`,onClick:c,type:"button",children:[(0,X.jsx)("span",{className:"truncate",children:Lr(x.value)}),(0,X.jsx)("span",{className:"shrink-0 tabular-nums text-foreground/70",children:x.count})]},Lr(x.value)),"c"),e[18]=o,e[19]=c,e[20]=w):w=e[20],h=m.map(w),e[14]=o,e[15]=c,e[16]=m,e[17]=h}else h=e[17];let p;e[21]!==o||e[22]!==r.result||e[23]!==a?(p=r.result?.truncated===!0&&(0,X.jsx)("span",{className:"text-muted-foreground","data-testid":`db-facet-truncated-${o}`,children:a("Showing the {n} most common values.",{n:r.result.values.length})}),e[21]=o,e[22]=r.result,e[23]=a,e[24]=p):p=e[24];let b;return e[25]!==i||e[26]!==u||e[27]!==d||e[28]!==g||e[29]!==h||e[30]!==p?(b=(0,X.jsxs)("section",{className:"flex flex-col gap-1","data-testid":i,children:[u,d,g,h,p]}),e[25]=i,e[26]=u,e[27]=d,e[28]=g,e[29]=h,e[30]=p,e[31]=b):b=e[31],b},"ue"),fo=n(t=>{let e=(0,_t.c)(44),{columns:o,facets:l,mask:r,onFacetFilter:a,onToggleFacet:s}=t,c=te(),i;e[0]!==s?(i=n(y=>{let{column:k}=y.currentTarget.dataset;k!==void 0&&s(k)},"o"),e[0]=s,e[1]=i):i=e[1];let u=i,d;e[2]!==r?(d=n(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,x,_,C;if(e[4]!==o||e[5]!==l||e[6]!==g||e[7]!==c||e[8]!==u){C=Symbol.for("react.early_return_sentinel");e:{let y;e[17]!==g?(y=n(N=>!g(N),"y"),e[17]=g,e[18]=y):y=e[18];let k=o.filter(y),P;if(e[19]!==l||e[20]!==g?(P=Object.entries(l).filter(N=>{let[T]=N;return!g(T)}),e[19]=l,e[20]=g,e[21]=P):P=e[21],m=P,k.length===0){C=null;break e}x="flex w-56 shrink-0 flex-col gap-3 overflow-auto border-l border-border p-3 text-xs",_="db-facets",b="flex flex-col gap-1.5";let M;e[22]!==c?(M=c("Facets"),e[22]=c,e[23]=M):M=e[23],e[24]!==M?(w=(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:M}),e[24]=M,e[25]=w):w=e[25],h="flex flex-wrap gap-1";let I;e[26]!==l||e[27]!==u?(I=n(N=>(0,X.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]=I):I=e[28],p=k.map(I)}e[4]=o,e[5]=l,e[6]=g,e[7]=c,e[8]=u,e[9]=m,e[10]=h,e[11]=p,e[12]=b,e[13]=w,e[14]=x,e[15]=_,e[16]=C}else m=e[9],h=e[10],p=e[11],b=e[12],w=e[13],x=e[14],_=e[15],C=e[16];if(C!==Symbol.for("react.early_return_sentinel"))return C;let F;e[29]!==h||e[30]!==p?(F=(0,X.jsx)("div",{className:h,children:p}),e[29]=h,e[30]=p,e[31]=F):F=e[31];let v;e[32]!==F||e[33]!==b||e[34]!==w?(v=(0,X.jsxs)("div",{className:b,children:[w,F]}),e[32]=F,e[33]=b,e[34]=w,e[35]=v):v=e[35];let R;e[36]!==a||e[37]!==m?(R=m.map(y=>{let[k,P]=y;return(0,X.jsx)(vi,{column:k,onFacetFilter:a,state:P},k)}),e[36]=a,e[37]=m,e[38]=R):R=e[38];let S;return e[39]!==v||e[40]!==R||e[41]!==x||e[42]!==_?(S=(0,X.jsxs)("aside",{className:x,"data-testid":_,children:[v,R]}),e[39]=v,e[40]=R,e[41]=x,e[42]=_,e[43]=S):S=e[43],S},"Te"),po=n(()=>{let[t,e]=(0,tt.useState)({}),o=Be(t),l=(0,tt.useRef)({}),r=n(async(a,s)=>{let c=(l.current[a]??0)+1;l.current[a]=c,e(i=>a in i?{...i,[a]:{error:null,loading:!0,result:i[a]?.result??null}}:i);try{let i=await s(a);if(l.current[a]!==c)return;e(u=>a in u?{...u,[a]:{error:null,loading:!1,result:i}}:u)}catch(i){if(l.current[a]!==c)return;throw e(u=>a in u?{...u,[a]:{error:Tt(i),loading:!1,result:null}}:u),i}},"n");return{clearFacets:n(()=>{e({})},"clearFacets"),facets:t,facetsRef:o,refetchFacets:n(a=>xr(Object.keys(o.current).map(s=>r(s,a))),"refetchFacets"),toggleFacet:n((a,s)=>{if(a in o.current){e(c=>Object.fromEntries(Object.entries(c).filter(([i])=>i!==a)));return}e(c=>({...c,[a]:{error:null,loading:!0,result:null}})),s!==null&&ee(r(a,s))},"toggleFacet")}},"$e"),yi=[],Ci=n(()=>{let t=(0,_t.c)(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let{data:o}=lt(_e.maskPolicies,e);return Array.isArray(o?.columns)?o.columns:yi},"fe"),bo=n(t=>{let e=(0,_t.c)(16),{columns:o,selectedTable:l}=t,r=Ci(),[a,s]=(0,tt.useState)(!0),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n(()=>{s(Ri)},"g"),e[0]=c):c=e[0];let i=c,u;if(e[1]!==o||e[2]!==r||e[3]!==l){let b=jr(r,l??"");u=Hr(b,o),e[1]=o,e[2]=r,e[3]=l,e[4]=u}else u=e[4];let d=u,g;e[5]!==a||e[6]!==r?(g=n((b,w)=>({columns:Hr(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:i},e[11]=d,e[12]=a,e[13]=m,e[14]=h,e[15]=p):p=e[15],p},"Re");function Ri(t){return!t}n(Ri,"me");var Br=34,Gr=600,Fi=n(t=>{let e=(0,_t.c)(21),{item:o,onSelect:l,prefix:r,selected:a,start:s}=t,c;e[0]!==o.name||e[1]!==l?(c=n(()=>{l(o.name)},"g"),e[0]=o.name,e[1]=l,e[2]=c):c=e[2];let i=c,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=ut("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-${o.name}`,b;e[7]!==o.name?(b=(0,X.jsx)("span",{className:"truncate",children:o.name}),e[7]=o.name,e[8]=b):b=e[8];let w;e[9]!==o.rowCount?(w=(0,X.jsx)("span",{className:"shrink-0 rounded bg-muted px-1.5 text-xs tabular-nums text-muted-foreground",children:o.rowCount}),e[9]=o.rowCount,e[10]=w):w=e[10];let x;e[11]!==i||e[12]!==a||e[13]!==h||e[14]!==p||e[15]!==b||e[16]!==w?(x=(0,X.jsxs)("button",{"aria-pressed":a,className:h,"data-testid":p,onClick:i,type:"button",children:[b,w]}),e[11]=i,e[12]=a,e[13]=h,e[14]=p,e[15]=b,e[16]=w,e[17]=x):x=e[17];let _;return e[18]!==g||e[19]!==x?(_=(0,X.jsx)("li",{style:g,children:x}),e[18]=g,e[19]=x,e[20]=_):_=e[20],_},"ge"),ho=n(({header:t,onReload:e,onSelect:o,prefix:l,reloadLabel:r,selected:a,tables:s})=>{let c=te(),[i,u]=(0,tt.useState)(""),d=(0,tt.useRef)(null),g=n(b=>{u(b.target.value)},"l"),m=(0,tt.useMemo)(()=>{let b=i.trim().toLowerCase();return b===""?s:s.filter(w=>w.name.toLowerCase().includes(b))},[i,s]),h=so({count:m.length,estimateSize:n(()=>Br,"estimateSize"),getScrollElement:n(()=>d.current,"getScrollElement"),initialRect:{height:Gr,width:240},observeElementRect:n((b,w)=>io(b,w,Gr),"observeElementRect"),overscan:12}).getVirtualItems(),p={height:m.length*Br};return(0,X.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,X.jsxs)("div",{className:"flex h-9 shrink-0 items-center justify-between gap-2 border-b border-border px-3",children:[(0,X.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:c("Tables")}),e!==void 0&&(0,X.jsx)("button",{"aria-label":r??c("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??c("Refresh"),type:"button",children:(0,X.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,X.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,X.jsx)("div",{className:"shrink-0 border-b border-border p-2",children:(0,X.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:c("search table\u2026"),type:"search",value:i})}),(0,X.jsxs)("ul",{className:"relative flex-1 overflow-y-auto p-1.5","data-testid":`${l}-table-list-rows`,ref:d,children:[(0,X.jsx)("li",{"aria-hidden":"true",style:p}),h.map(b=>{let w=m[b.index];return w===void 0?null:(0,X.jsx)(Fi,{item:w,onSelect:o,prefix:l,selected:a===w.name,start:b.start},w.name)})]})]})},"Ae");var f=ke(Dt(),1);var Kr=ke(ct(),1);function ki(t){return Ni(t)||typeof t=="function"||Mi(t)}n(ki,"isReactComponent");function Ni(t){return typeof t=="function"&&(()=>{let e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}n(Ni,"isClassComponent");function Mi(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}n(Mi,"isExoticComponent");function mt(t,e){return t==null?null:ki(t)?Kr.default.createElement(t,e):t}n(mt,"flexRender");function an(t){if("cell"in t&&t.cell){let e=t.cell,o=e.column.columnDef,l=e,r=o;return l.getIsAggregated?.()?mt(r.aggregatedCell??o.cell,e.getContext()):l.getIsPlaceholder?.()?null:mt(o.cell,e.getContext())}return"header"in t&&t.header?mt(t.header.column.columnDef.header,t.header.getContext()):"footer"in t&&t.footer?mt(t.footer.column.columnDef.footer,t.footer.getContext()):null}n(an,"FlexRender");function Ur(t){let e=Zt(t.source,t.selector,{compare:rt});return typeof t.children=="function"?t.children(e):t.children}n(Ur,"Subscribe");function Jr(t){let e=t;return Object.defineProperty(t,"state",{get(){return t.get()}}),"set"in t&&(e.setState=t.set.bind(t)),e}n(Jr,"atomToStore");function sn(t){let{createAtom:e,batch:o}=t,l=e(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"addSubscription"),unmount:n(()=>{throw new Error("Feature not supported in current reactivity implementation")},"unmount"),schedule:t.schedule??(r=>queueMicrotask(r)),batch:o,untrack:n(r=>r(),"untrack"),createReadonlyAtom:n((r,a)=>{let s=a?.compare??Object.is,c=!1,i,u=n(()=>{let g=r();return(!c||!s(i,g))&&(i=g,c=!0),i},"getSnapshot"),d=e(()=>(l.get(),u()),{compare:s});return{get:u,subscribe:d.subscribe.bind(d)}},"createReadonlyAtom"),createWritableAtom:n((r,a)=>e(r,{compare:a?.compare}),"createWritableAtom"),commit:n(()=>{l.set(r=>r+1)},"commit")}}n(sn,"renderPhaseReactivity");function cn(t,e=Object.is){let o=!1,l;return{get:t.get,markCommitted:n(r=>{l=r,o=!0},"markCommitted"),subscribe:n(r=>t.subscribe(a=>{(!o||!e(l,a))&&r(a)}),"subscribe")}}n(cn,"createRenderPhaseSource");function Wr(){return sn({createAtom:hr,batch:br})}n(Wr,"reactReactivity");function wo(t,e){return typeof t=="function"?t(e):t}n(wo,"functionalUpdate");function Re(t){if(Array.isArray(t))return t.map(Re);if(t&&typeof t=="object"){let e=Object.getPrototypeOf(t);if(e!==Object.prototype&&e!==null)return t;let o=e===null?j():{},l=Object.keys(t);for(let r=0;r<l.length;r++){let a=l[r];Object.defineProperty(o,a,{configurable:!0,enumerable:!0,value:Re(t[a]),writable:!0})}return o}return t}n(Re,"cloneState");function So(t,e){let o=Object.keys(e),l=t;for(let r=0;r<o.length;r++){let a=o[r];!a.startsWith("_memo_")&&a!=="_cellsCache"&&(l[a]=e[a])}return t}n(So,"copyInstancePropertiesWithoutMemos");function j(){return Object.create(null)}n(j,"makeObjectMap");function Ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n(Ke,"hasOwn");function Ge(t,e){return o=>{(e.options.atoms?.[t]??e.baseAtoms[t]).set(l=>wo(o,l))}}n(Ge,"makeStateUpdater");function Qr(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}n(Qr,"isPlainContainer");function Xr(t){return Reflect.ownKeys(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}n(Xr,"getEnumerableOwnKeys");var Ii=3;function Pi(t,e){return Yr(t,e,Ii)}n(Pi,"stateSlicesEqual");function Yr(t,e,o){if(Object.is(t,e))return!0;if(o<=0||!Qr(t)||!Qr(e)||(Array.isArray(t)||Array.isArray(e))&&(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length))return!1;let l=Xr(t),r=Xr(e);if(l.length!==r.length)return!1;let a=t,s=e;for(let c=0;c<l.length;c++){let i=l[c];if(!Object.prototype.propertyIsEnumerable.call(e,i)||!Yr(a[i],s[i],o-1))return!1}return!0}n(Yr,"stateSlicesEqualAtDepth");function xt(t,e,o,l=Pi){let r=`on${e.charAt(0).toUpperCase()}${e.slice(1)}Change`,a=t.options[r];a&&a(s=>{let c=wo(o,s);return l(s,c)?s:c})}n(xt,"setStateSlice");function Zr(t){return t instanceof Function}n(Zr,"isFunction");function el(t,e){let o=[],l=n(r=>{r.forEach(a=>{o.push(a);let s=e(a);s.length&&l(s)})},"recurse");return l(t),o}n(el,"flattenBy");var Ai=n(({fn:t,memoDeps:e,onAfterCompare:o,onAfterUpdate:l,onBeforeCompare:r,onBeforeUpdate:a})=>{let s=[],c;return n(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 o?.(g),g&&(s=d,a?.(),c=t(...d??[]),l?.(c)),c},"memoizedFn")},"memo");function _o(t){let e=!1;return()=>{if(!e){e=!0;return}t()}}n(_o,"skipFirstRun");var Di=n((t,e)=>{for(t=String(t);t.length<e;)t=" "+t;return t},"pad");function vt({feature:t,fnName:e,objectId:o,onAfterUpdate:l,table:r,...a}){let s,c,i=0,u;function d(h,p){let b=i===0?"(1st run)":p?"(rerun #"+i+")":"(cache)";i++,console.groupCollapsed(`%c\u23F1 ${Di(`${h.toFixed(1)} ms`,12)} %c${b}%c ${e}%c ${o?`(${e.split(".")[0]}Id: ${o})`:""}`,`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: ${i<2?"#FF00FF":"#FF1493"}`,"color: #666","color: #87CEEB"),console.info({feature:t,state:r.store.state,deps:a.memoDeps?.toString()}),console.trace(),console.groupEnd()}return n(d,"logTime"),Ai({...a,...{onAfterUpdate:l?()=>{let{schedule:h,untrack:p}=r._reactivity;h(()=>p(()=>l()))}:void 0}})}n(vt,"tableMemo");function tl(t,e="_"){let[o,l]=t.replace(e," ").split(" ");return{fnKey:l,fnName:`${o}.${l}`,parentName:o}}n(tl,"getFunctionNameInfo");function fe(t,e,o){for(let[l,{fn:r,memoDeps:a}]of Object.entries(o)){let{fnKey:s,fnName:c}=tl(l);e[s]=a?vt({memoDeps:a,fn:r,fnName:c,table:e,feature:t}):r}}n(fe,"assignTableAPIs");function ue(t,e,o,l){for(let[r,{fn:a,memoDeps:s}]of Object.entries(l)){let{fnKey:c,fnName:i}=tl(r);if(s){let u=`_memo_${c}`;e[c]=function(...d){if(!this[u]){let g=this;this[u]=vt({memoDeps:n(m=>s(g,m),"memoDeps"),fn:n((...m)=>a(g,...m),"fn"),fnName:i,objectId:g.id,table:o,feature:t})}return this[u](...d)}}else e[c]=function(...u){return a(this,...u)}}}n(ue,"assignPrototypeAPIs");function re(t,e,o,...l){return t[e]?.(...l)??o(t,...l)}n(re,"callMemoOrStaticFn");function ol(t){return t.row.getValue(t.column.id)}n(ol,"cell_getValue");function nl(t){return t.getValue()??t.table.options.renderFallbackValue}n(nl,"cell_renderValue");function rl(t){return{table:t.table,column:t.column,row:t.row,cell:t,getValue:n(()=>t.getValue(),"getValue"),renderValue:n(()=>t.renderValue(),"renderValue")}}n(rl,"cell_getContext");var ll={assignCellPrototype:n((t,e)=>{ue("coreCellsFeature",t,e,{cell_getValue:{fn:n(o=>ol(o),"fn")},cell_renderValue:{fn:n(o=>nl(o),"fn")},cell_getContext:{fn:n(o=>rl(o),"fn"),memoDeps:n(o=>[o],"memoDeps")}})},"assignCellPrototype")};function Ti(t){if(!t._columnPrototype){t._columnPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignColumnPrototype?.(t._columnPrototype,t)}return t._columnPrototype}n(Ti,"getColumnPrototype");function al(t,e,o,l){let r={...t.getDefaultColumnDef(),...e},a=r.accessorKey,s=a===void 0?void 0:String(a),c=r.id??s?.replaceAll(".","_")??(typeof r.header=="string"?r.header:void 0),i;if(r.accessorFn)i=r.accessorFn;else if(a!==void 0)if(typeof a=="string"&&a.includes(".")){let m=a.split(".");i=n(h=>{let p=h;for(let b=0;b<m.length;b++){let w=m[b];p=p?.[w]}return p},"accessorFn")}else i=n(m=>m[r.accessorKey],"accessorFn");if(!c)throw new Error;let u=Ti(t),d=Object.create(u);d.accessorFn=i,d.columnDef=r,d.columns=[],d.depth=o,d.id=`${String(c)}`,d.parent=l;let g=t._columnInstanceInitFns;for(let m=0;m<g.length;m++)g[m](d);return d}n(al,"constructColumn");function xo(t){return t.getIsVisible?.()??!0}n(xo,"getIsColumnVisible");function un(t){return t.getVisibleLeafColumns?.()??t.getAllLeafColumns()}n(un,"getVisibleLeafColumns");function dn(t,e){let o=t,l=e;return o.getOrderColumnsFn?.()(l)??o._orderGroupedColumns?.(l)??e}n(dn,"orderLeafColumns");function vo(t,e,o,l){return t._orderByColumnPinning?.(e,o,l)??e}n(vo,"orderByColumnPinning");function Pe(t,e){return t.getPinnedVisibleLeafColumns?.(e)??(e&&e!=="center"?[]:un(t))}n(Pe,"getPinnedVisibleLeafColumns");function sl(t,e){return t._expandRows?.(e)??e}n(sl,"expandRowModel");function il(t){t.autoResetExpanded?.()}n(il,"autoResetExpanded");function yo(t){t.autoResetPageIndex?.()}n(yo,"autoResetPageIndex");function cl(t){t.autoResetSorting?.()}n(cl,"autoResetSorting");function ul(t){t.autoResetCellSelection?.()}n(ul,"autoResetCellSelection");function dl(t){return[t,...t.columns.flatMap(e=>e.getFlatColumns())]}n(dl,"column_getFlatColumns");function ml(t){if(t.columns.length){let e=t.columns.flatMap(o=>o.getLeafColumns());return dn(t.table,e)}return[t]}n(ml,"column_getLeafColumns");function gl(t){return{header:n(e=>{let o=e.header.column.columnDef;return o.accessorKey?o.accessorKey:o.accessorFn?o.id:null},"header"),cell:n(e=>e.renderValue()?.toString?.()??null,"cell"),...Object.values(t._features).reduce((e,o)=>Object.assign(e,o.getDefaultColumnDef?.()),{}),...t.options.defaultColumn}}n(gl,"table_getDefaultColumnDef");function fl(t,e,o,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],c=al(t,s,l,o),i=s;c.columns=i.columns?fl(t,i.columns,c,l+1):[],r[a]=c}return r}n(fl,"constructColumns");function pl(t){return fl(t,t.options.columns)}n(pl,"table_getAllColumns");function bl(t){return t.getAllColumns().flatMap(e=>e.getFlatColumns())}n(bl,"table_getAllFlatColumns");function hl(t){let e=j(),o=t.getAllFlatColumns();for(let l=0;l<o.length;l++){let r=o[l];e[r.id]=r}return e}n(hl,"table_getAllFlatColumnsById");function wl(t){let e=t.getAllColumns().flatMap(o=>o.getLeafColumns());return dn(t,e)}n(wl,"table_getAllLeafColumns");function Sl(t){let e=j(),o=t.getAllLeafColumns();for(let l=0;l<o.length;l++){let r=o[l];e[r.id]=r}return e}n(Sl,"table_getAllLeafColumnsById");function _l(t,e){return t.getAllFlatColumnsById()[e]}n(_l,"table_getColumn");var xl={assignColumnPrototype:n((t,e)=>{ue("coreColumnsFeature",t,e,{column_getFlatColumns:{fn:n(o=>dl(o),"fn"),memoDeps:n(o=>[o.table.options.columns],"memoDeps")},column_getLeafColumns:{fn:n(o=>ml(o),"fn"),memoDeps:n(o=>[o.table.atoms.columnOrder?.get(),o.table.atoms.grouping?.get(),o.table.options.columns,o.table.options.groupedColumnMode],"memoDeps")}})},"assignColumnPrototype"),constructTableAPIs:n(t=>{fe("coreColumnsFeature",t,{table_getDefaultColumnDef:{fn:n(()=>gl(t),"fn"),memoDeps:n(()=>[t.options.defaultColumn],"memoDeps")},table_getAllColumns:{fn:n(()=>pl(t),"fn"),memoDeps:n(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumns:{fn:n(()=>bl(t),"fn"),memoDeps:n(()=>[t.options.columns],"memoDeps")},table_getAllFlatColumnsById:{fn:n(()=>hl(t),"fn"),memoDeps:n(()=>[t.options.columns],"memoDeps")},table_getAllLeafColumns:{fn:n(()=>wl(t),"fn"),memoDeps:n(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getAllLeafColumnsById:{fn:n(()=>Sl(t),"fn"),memoDeps:n(()=>[t.getAllLeafColumns()],"memoDeps")},table_getColumn:{fn:n(e=>_l(t,e),"fn")}})},"constructTableAPIs")};function Oi(t){if(!t._headerPrototype){t._headerPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignHeaderPrototype?.(t._headerPrototype,t)}return t._headerPrototype}n(Oi,"getHeaderPrototype");function mn(t,e,o){let l=Oi(t),r=Object.create(l);r.colSpan=0,r.column=e,r.depth=o.depth,r.headerGroup=null,r.id=o.id??e.id,r.index=o.index,r.isPlaceholder=!!o.isPlaceholder,r.placeholderId=o.placeholderId,r.rowSpan=0,r.subHeaders=[];let a=t._headerInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}n(mn,"constructHeader");function vl(t,e=1){let o=e;for(let l=0;l<t.length;l++){let r=t[l];xo(r)&&r.columns.length&&(o=Math.max(o,vl(r.columns,e+1)))}return o}n(vl,"getMaxHeaderDepth");function Vi(t,e){return t?`${t}_${e}`:String(e)}n(Vi,"formatHeaderGroupId");function Ei(t,e,o,l){let r=t??"";return e&&(r=r?`${r}_${e}`:String(e)),o&&(r=r?`${r}_${o}`:o),l&&(r=r?`${r}_${l}`:l),r}n(Ei,"formatHeaderId");function zi(t,e){let o=0;for(let l=0;l<t.length;l++)t[l].column===e&&o++;return o}n(zi,"countPendingHeadersForColumn");function yl(t,e,o,l,r,a){let s={depth:e,id:Vi(l,e),headers:[]},c=[];for(let i=0;i<t.length;i++){if(!(i in t))continue;let u=t[i],d=c[c.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=mn(o,m,{id:Ei(l,e,m.id,u.id),isPlaceholder:h,placeholderId:h?String(zi(c,m)):void 0,depth:e,index:c.length});p.subHeaders.push(u),c.push(p)}s.headers.push(u),u.headerGroup=s}for(let i=0;i<a.length;i++)a[i](s);r.push(s),e>0&&yl(c,e-1,o,l,r,a)}n(yl,"constructHeaderGroup");function Cl(t){for(let e=0;e<t.length;e++){let o=t[e];if(!xo(o.column))continue;let l=0;if(o.subHeaders.length){Cl(o.subHeaders);for(let r=0;r<o.subHeaders.length;r++){let a=o.subHeaders[r];xo(a.column)&&(l+=a.colSpan)}}else l=1;if(o.colSpan=l,o.isPlaceholder&&o.subHeaders.length===1&&o.subHeaders[0].column===o.column){let r=1,a=o.subHeaders[0];for(;a;)a.rowSpan=0,r++,a=a.subHeaders.length===1&&a.subHeaders[0].column===o.column?a.subHeaders[0]:void 0;o.rowSpan=r}else o.rowSpan=1}}n(Cl,"updateHeaderSpans");function Rl(t,e,o,l){let r=vl(t),a=[],s=o._headerGroupInstanceInitFns,c=new Array(e.length);for(let i=0;i<e.length;i++)i in e&&(c[i]=mn(o,e[i],{depth:r,index:i}));return yl(c,r-1,o,l,a,s),a.reverse(),Cl(a[0]?.headers??[]),a}n(Rl,"buildHeaderGroups");function Fl(t,e){for(let o=0;o<t.subHeaders.length;o++)Fl(t.subHeaders[o],e);e.push(t)}n(Fl,"collectLeafHeaders");function kl(t){let e=[];return Fl(t,e),e}n(kl,"header_getLeafHeaders");function Nl(t){return{column:t.column,header:t,table:t.column.table}}n(Nl,"header_getContext");function Ml(t){return Rl(t.getAllColumns(),vo(t,un(t),e=>e.id),t)}n(Ml,"table_getHeaderGroups");function Il(t){return[...t.getHeaderGroups()].reverse()}n(Il,"table_getFooterGroups");function Pl(t){let e=t.getHeaderGroups(),o=[];for(let l=0;l<e.length;l++){let r=e[l].headers;for(let a=0;a<r.length;a++)o.push(r[a])}return o}n(Pl,"table_getFlatHeaders");function Al(t){let e=t.getHeaderGroups()[0]?.headers??[],o=[];for(let l=0;l<e.length;l++){let r=e[l].getLeafHeaders();for(let a=0;a<r.length;a++)o.push(r[a])}return o}n(Al,"table_getLeafHeaders");var Dl={assignHeaderPrototype:n((t,e)=>{ue("coreHeadersFeature",t,e,{header_getLeafHeaders:{fn:n(o=>kl(o),"fn"),memoDeps:n(o=>[o.column.table.options.columns],"memoDeps")},header_getContext:{fn:n(o=>Nl(o),"fn"),memoDeps:n(o=>[o.column.table.options.columns],"memoDeps")}})},"assignHeaderPrototype"),constructTableAPIs:n(t=>{fe("coreHeadersFeature",t,{table_getHeaderGroups:{fn:n(()=>Ml(t),"fn"),memoDeps:n(()=>[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:n(()=>Il(t),"fn"),memoDeps:n(()=>[t.getHeaderGroups()],"memoDeps")},table_getFlatHeaders:{fn:n(()=>Pl(t),"fn"),memoDeps:n(()=>[t.getHeaderGroups()],"memoDeps")},table_getLeafHeaders:{fn:n(()=>Al(t),"fn"),memoDeps:n(()=>[t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};function $i(t){if(!t._rowPrototype){t._rowPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignRowPrototype?.(t._rowPrototype,t)}return t._rowPrototype}n($i,"getRowPrototype");var Tl=n((t,e,o,l,r,a,s)=>{let c=$i(t),i=Object.create(c);i._displayIndexCache=-1,i._uniqueValuesCache=j(),i._valuesCache=j(),i.depth=r,i.id=e,i.index=l,i.original=o,i.parentId=s,i.subRows=a??[];let u=t._rowInstanceInitFns;for(let d=0;d<u.length;d++)u[d](i);return i},"constructRow");function Ol(){return t=>vt({feature:"coreRowModelsFeature",table:t,fnName:"table.getCoreRowModel",memoDeps:n(()=>[t.options.data],"memoDeps"),fn:n(()=>ji(t,t.options.data),"fn"),onAfterUpdate:_o(()=>{il(t),yo(t),cl(t),ul(t)})})}n(Ol,"createCoreRowModel");function Vl(t,e,o,l=0,r){let a=[];for(let s=0;s<o.length;s++){let c=o[s],i=Tl(t,t.getRowId(c,s,r),c,s,l,void 0,r?.id);e.flatRows.push(i),e.rowsById[i.id]=i,a.push(i),t.options.getSubRows&&(i.originalSubRows=t.options.getSubRows(c,s),i.originalSubRows?.length&&(i.subRows=Vl(t,e,i.originalSubRows,l+1,i)))}return a}n(Vl,"accessRows");function ji(t,e){let o={rows:[],flatRows:[],rowsById:j()};return o.rows=Vl(t,o,e),o}n(ji,"_createCoreRowModel");function El(t){return t._rowModels.coreRowModel||(t._rowModels.coreRowModel=t.options.features.coreRowModel?.(t)??Ol()(t)),t._rowModels.coreRowModel()}n(El,"table_getCoreRowModel");function zl(t){return t.getCoreRowModel()}n(zl,"table_getPreFilteredRowModel");function $l(t){return t._rowModels.filteredRowModel||(t._rowModels.filteredRowModel=t.options.features.filteredRowModel?.(t)),t.options.manualFiltering||!t._rowModels.filteredRowModel?t.getPreFilteredRowModel():t._rowModels.filteredRowModel()}n($l,"table_getFilteredRowModel");function jl(t){return t.getFilteredRowModel()}n(jl,"table_getPreGroupedRowModel");function Hl(t){return t._rowModels.groupedRowModel||(t._rowModels.groupedRowModel=t.options.features.groupedRowModel?.(t)),t.options.manualGrouping||!t._rowModels.groupedRowModel?t.getPreGroupedRowModel():t._rowModels.groupedRowModel()}n(Hl,"table_getGroupedRowModel");function Ll(t){return t.getGroupedRowModel()}n(Ll,"table_getPreSortedRowModel");function Bl(t){return t._rowModels.sortedRowModel||(t._rowModels.sortedRowModel=t.options.features.sortedRowModel?.(t)),t.options.manualSorting||!t._rowModels.sortedRowModel?t.getPreSortedRowModel():t._rowModels.sortedRowModel()}n(Bl,"table_getSortedRowModel");function Gl(t){return t.getSortedRowModel()}n(Gl,"table_getPreExpandedRowModel");function ql(t){return t._rowModels.expandedRowModel||(t._rowModels.expandedRowModel=t.options.features.expandedRowModel?.(t)),t.options.manualExpanding||!t._rowModels.expandedRowModel?t.getPreExpandedRowModel():t._rowModels.expandedRowModel()}n(ql,"table_getExpandedRowModel");function Kl(t){return t.getExpandedRowModel()}n(Kl,"table_getPrePaginatedRowModel");function Ul(t){return t._rowModels.paginatedRowModel||(t._rowModels.paginatedRowModel=t.options.features.paginatedRowModel?.(t)),t.options.manualPagination||!t._rowModels.paginatedRowModel?t.getPrePaginatedRowModel():t._rowModels.paginatedRowModel()}n(Ul,"table_getPaginatedRowModel");function Jl(t){return t.getPaginatedRowModel()}n(Jl,"table_getRowModel");var Wl={constructTableAPIs:n(t=>{fe("coreRowModelsFeature",t,{table_getCoreRowModel:{fn:n(()=>El(t),"fn")},table_getPreFilteredRowModel:{fn:n(()=>zl(t),"fn")},table_getFilteredRowModel:{fn:n(()=>$l(t),"fn")},table_getPreGroupedRowModel:{fn:n(()=>jl(t),"fn")},table_getGroupedRowModel:{fn:n(()=>Hl(t),"fn")},table_getPreSortedRowModel:{fn:n(()=>Ll(t),"fn")},table_getSortedRowModel:{fn:n(()=>Bl(t),"fn")},table_getPreExpandedRowModel:{fn:n(()=>Gl(t),"fn")},table_getExpandedRowModel:{fn:n(()=>ql(t),"fn")},table_getPrePaginatedRowModel:{fn:n(()=>Kl(t),"fn")},table_getPaginatedRowModel:{fn:n(()=>Ul(t),"fn")},table_getRowModel:{fn:n(()=>Jl(t),"fn")}})},"constructTableAPIs")};function Hi(t){if(!t._cellPrototype){t._cellPrototype={table:t};let e=Object.values(t._features);for(let o=0;o<e.length;o++)e[o].assignCellPrototype?.(t._cellPrototype,t)}return t._cellPrototype}n(Hi,"getCellPrototype");function Ql(t,e,o){let l=Hi(o),r=Object.create(l);r.column=t,r.id=`${e.id}_${t.id}`,r.row=e;let a=o._cellInstanceInitFns;for(let s=0;s<a.length;s++)a[s](r);return r}n(Ql,"constructCell");function Xl(t){let e=t.table.getRowsInDisplayOrder(),o=t._displayIndexCache;return e[o]===t?o:-1}n(Xl,"row_getDisplayIndex");function Yl(t){let e=t.getPrePaginatedRowModel(),o=t.options.paginateExpandedRows===!1?sl(t,e).rows:e.rows;for(let l=0;l<o.length;l++)o[l]._displayIndexCache=l;return o}n(Yl,"table_getRowsInDisplayOrder");function Zl(t,e){if(Ke(t._valuesCache,e))return t._valuesCache[e];let o=t.table.getColumn(e);if(o?.accessorFn)return t._valuesCache[e]=o.accessorFn(t.original,t.index),t._valuesCache[e]}n(Zl,"row_getValue");function ea(t,e){if(Ke(t._uniqueValuesCache,e))return t._uniqueValuesCache[e];let o=t.table.getColumn(e);if(o?.accessorFn)return o.columnDef.getUniqueValues?(t._uniqueValuesCache[e]=o.columnDef.getUniqueValues(t.original,t.index),t._uniqueValuesCache[e]):(t._uniqueValuesCache[e]=[t.getValue(e)],t._uniqueValuesCache[e])}n(ea,"row_getUniqueValues");function ta(t,e){return t.getValue(e)??t.table.options.renderFallbackValue}n(ta,"row_renderValue");function oa(t){return el(t.subRows,e=>e.subRows)}n(oa,"row_getLeafRows");function na(t){let e=t.getCoreRowModel().flatRows,o=0;for(let l=0;l<e.length;l++)o=Math.max(o,e[l].depth);return o}n(na,"table_getMaxSubRowDepth");function ra(t){if(t.parentId)return t.table.getCoreRowModel().rowsById[t.parentId]??t.table.getRow(t.parentId,!0)}n(ra,"row_getParentRow");function la(t){let e=[],o=t;for(;;){let l=o.getParentRow();if(!l)break;e.push(l),o=l}return e.reverse()}n(la,"row_getParentRows");function aa(t){let e=t.table.getAllLeafColumns(),o=t._cellsCache;o||(o=t._cellsCache=new WeakMap);let l=new Array(e.length);for(let r=0;r<e.length;r++){let a=e[r],s=o.get(a);s||(s=Ql(a,t,t.table),o.set(a,s)),l[r]=s}return l}n(aa,"row_getAllCells");function sa(t){let e=j(),o=t.getAllCells();for(let l=0;l<o.length;l++){let r=o[l];e[r.column.id]=r}return e}n(sa,"row_getAllCellsByColumnId");function ia(t,e,o,l){return e.options.getRowId?.(t,o,l)??(l?`${l.id}.${o}`:String(o))}n(ia,"table_getRowId");function ca(t,e,o){let l=(o?t.getPrePaginatedRowModel():t.getRowModel()).rowsById[e];if(!l&&(l=t.getCoreRowModel().rowsById[e],!l))throw new Error;return l}n(ca,"table_getRow");var ua={assignRowPrototype:n((t,e)=>{ue("coreRowsFeature",t,e,{row_getDisplayIndex:{fn:n(o=>Xl(o),"fn")},row_getAllCellsByColumnId:{fn:n(o=>sa(o),"fn"),memoDeps:n(o=>[o.getAllCells()],"memoDeps")},row_getAllCells:{fn:n(o=>aa(o),"fn"),memoDeps:n(o=>[o.table.getAllLeafColumns()],"memoDeps")},row_getLeafRows:{fn:n(o=>oa(o),"fn"),memoDeps:n(o=>[o.subRows],"memoDeps")},row_getParentRow:{fn:n(o=>ra(o),"fn")},row_getParentRows:{fn:n(o=>la(o),"fn")},row_getUniqueValues:{fn:n((o,l)=>ea(o,l),"fn")},row_getValue:{fn:n((o,l)=>Zl(o,l),"fn")},row_renderValue:{fn:n((o,l)=>ta(o,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:n(t=>{fe("coreRowsFeature",t,{table_getRowsInDisplayOrder:{fn:n(()=>Yl(t),"fn"),memoDeps:n(()=>[t.getPrePaginatedRowModel().rows,t.options.paginateExpandedRows,t.options.paginateExpandedRows===!1?t.atoms.expanded?.get():void 0],"memoDeps")},table_getRowId:{fn:n((e,o,l)=>ia(e,t,o,l),"fn")},table_getRow:{fn:n((e,o)=>ca(t,e,o),"fn")},table_getMaxSubRowDepth:{fn:n(()=>na(t),"fn"),memoDeps:n(()=>[t.getCoreRowModel()],"memoDeps")}})},"constructTableAPIs")};function Co(t,e,o=(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],c=s===void 0?t.initialState[r]:s;o(t._reactivity.untrack(()=>a.get()),c)||a.set(()=>c)}})}n(Co,"table_syncExternalStateToBaseAtoms");function Ro(t,e,o=(l,r)=>l===r){t._reactivity.batch(()=>{Co(t,e,o),t._reactivity.commit?.()})}n(Ro,"table_publishExternalState");function gn(t){let e=Re(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 o=Object.values(t._features);for(let l=0;l<o.length;l++)o[l].resetTableInstanceData?.(t)}n(gn,"table_reset");function da(t,e){let{features:o,atoms:l,initialState:r}=t.options;if(!t.options.mergeOptions)return{...t.options,...e,features:o,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:o,enumerable:!0,configurable:!0,writable:!0},atoms:{value:l,enumerable:!0,configurable:!0,writable:!0},initialState:{value:r,enumerable:!0,configurable:!0,writable:!0}})}n(da,"table_mergeOptions");function Et(t,e,o){let l=da(t,wo(e,t.options));t.optionsStore?t.optionsStore.set(()=>l):t.options=l,o?.syncExternalState!==!1&&Ro(t,l.state??null)}n(Et,"table_setOptions");var ma={constructTableAPIs:n(t=>{fe("coreTablesFeature",t,{table_reset:{fn:n(()=>gn(t),"fn")},table_setOptions:{fn:n(e=>Et(t,e),"fn")}})},"constructTableAPIs")};var ga={coreCellsFeature:ll,coreColumnsFeature:xl,coreHeadersFeature:Dl,coreRowModelsFeature:Wl,coreRowsFeature:ua,coreTablesFeature:ma};function fa(t,e={}){return Object.values(t).forEach(o=>{e=o.getInitialState?.(e)??e}),Re(e)}n(fa,"getInitialTableState");function fn(t){let e=t.features.coreReactivityFeature,{aggregationFns:o,columnMeta:l,coreRowModel:r,expandedRowModel:a,facetedMinMaxValues:s,facetedRowModel:c,facetedUniqueValues:i,filterFns:u,filterMeta:d,filteredRowModel:g,groupedRowModel:m,paginatedRowModel:h,sortFns:p,sortedRowModel:b,tableMeta:w,...x}=t.features,_={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...ga,...x},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:e,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:o,filterFns:u,sortFns:p},_rowModels:{},atoms:{},baseAtoms:{}},C=Object.values(_._features),F={...C.reduce((R,S)=>Object.assign(R,S.getDefaultTableOptions?.(_)),{}),...t};if(e.wrapExternalAtoms&&F.atoms)for(let[R,S]of Object.entries(F.atoms)){let y=S,k=e.createWritableAtom(y.get(),{debugName:`externalAtom/${R}`});F.atoms[R]=k;let P=!1,M=y.subscribe(N=>{P||k.set(N)}),I=k.subscribe(N=>{P=!0,y.set(N),P=!1});e.addSubscription(M),e.addSubscription(I)}e.createOptionsStore?(_.optionsStore=e.createWritableAtom(F,{debugName:"table/optionsStore"}),Object.defineProperty(_,"options",{configurable:!0,enumerable:!0,get(){return _.optionsStore.get()},set(R){_.optionsStore.set(()=>R)}})):_.options=F,_.initialState=fa(_._features,_.options.initialState);let v=Object.keys(_.initialState);for(let R=0;R<v.length;R++){let S=v[R];_.baseAtoms[S]=e.createWritableAtom(_.initialState[S],{debugName:`table/baseAtoms/${S}`}),_.atoms[S]=e.createReadonlyAtom(()=>{let y=_.options,k=y.atoms?.[S],P=k?k.get():_.baseAtoms[S].get();if(k)return P;let M=y.state;if(M&&Ke(M,S)){let I=M[S];return I===void 0?_.initialState[S]:I}return P},{debugName:`table/atoms/${S}`})}Co(_),_.store=Jr(e.createReadonlyAtom(()=>{let R={};for(let S=0;S<v.length;S++){let y=v[S];R[y]=_.atoms[y].get()}return R},{compare:rt,debugName:"table/store"}));for(let R=0;R<C.length;R++){let S=C[R];S.initTableInstanceData?.(_),S.initCellInstanceData&&_._cellInstanceInitFns.push(S.initCellInstanceData.bind(S)),S.initColumnInstanceData&&_._columnInstanceInitFns.push(S.initColumnInstanceData.bind(S)),S.initHeaderGroupInstanceData&&_._headerGroupInstanceInitFns.push(S.initHeaderGroupInstanceData.bind(S)),S.initHeaderInstanceData&&_._headerInstanceInitFns.push(S.initHeaderInstanceData.bind(S)),S.initRowInstanceData&&_._rowInstanceInitFns.push(S.initRowInstanceData.bind(S)),S.constructTableAPIs?.(_)}return _}n(fn,"constructTable");function pa(){return[]}n(pa,"getDefaultColumnOrderState");function pn(t){let e=n(o=>{let l=j();for(let r=0;r<o.length;r++)l[o[r].id]=r;return l},"buildIndexes");return{all:e(Pe(t)),center:e(Pe(t,"center")),start:e(Pe(t,"start")),end:e(Pe(t,"end"))}}n(pn,"table_getColumnIndexes");function ba(t,e){return re(t.table,"getColumnIndexes",pn)[e==="start"?"start":e==="end"?"end":e==="center"?"center":"all"][t.id]??-1}n(ba,"column_getIndex");function ha(t,e){return Pe(t.table,e)[0]?.id===t.id}n(ha,"column_getIsFirstColumn");function wa(t,e){let o=Pe(t.table,e);return o[o.length-1]?.id===t.id}n(wa,"column_getIsLastColumn");function bn(t,e){xt(t,"columnOrder",e)}n(bn,"table_setColumnOrder");function Sa(t,e){bn(t,e?[]:Re(t.initialState.columnOrder??[]))}n(Sa,"table_resetColumnOrder");function _a(t){let e=t.atoms.columnOrder?.get();return o=>{let l=[];if(!e?.length)l=o;else{let r=new Map;for(let a=0;a<o.length;a++){let s=o[a];r.set(s.id,s)}for(let a=0;a<e.length;a++){let s=e[a],c=r.get(s);c&&(l.push(c),r.delete(s))}for(let a=0;a<o.length;a++){let s=o[a];r.has(s.id)&&l.push(s)}}return Li(t,l)}}n(_a,"table_getOrderColumnsFn");function Li(t,e){let o=t.atoms.grouping?.get()??[],{groupedColumnMode:l}=t.options;if(!o.length||!l)return e;let r=e.filter(c=>!o.includes(c.id));if(l==="remove")return r;let a=new Map;for(let c=0;c<e.length;c++){let i=e[c];a.set(i.id,i)}let s=[];for(let c=0;c<o.length;c++){let i=a.get(o[c]);i&&s.push(i)}return[...s,...r]}n(Li,"orderColumns");var hn={getInitialState:n(t=>({columnOrder:pa(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({onColumnOrderChange:Ge("columnOrder",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnOrderingFeature",t,e,{column_getIndex:{fn:n((o,l)=>ba(o,l),"fn")},column_getIsFirstColumn:{fn:n((o,l)=>ha(o,l),"fn")},column_getIsLastColumn:{fn:n((o,l)=>wa(o,l),"fn")}})},"assignColumnPrototype"),constructTableAPIs:n(t=>{fe("columnOrderingFeature",t,{table_getColumnIndexes:{fn:n(()=>pn(t),"fn"),memoDeps:n(()=>[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:n(e=>bn(t,e),"fn")},table_resetColumnOrder:{fn:n(e=>Sa(t,e),"fn")},table_getOrderColumnsFn:{fn:n(()=>_a(t),"fn"),memoDeps:n(()=>[t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode],"memoDeps")}})},"constructTableAPIs")};function xa(){return j()}n(xa,"getDefaultColumnSizingState");function wn(){return{size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER}}n(wn,"getDefaultColumnSizingColumnDef");function gt(t){let e=wn(),o=t.table.atoms.columnSizing?.get(),l=o&&Ke(o,t.id)?o[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)}n(gt,"column_getSize");function Fo(t){let e=j(),o=j(),l=new Array(t.length),r=0;for(let s=0;s<t.length;s++){let c=t[s],i=re(c,"getSize",gt);l[s]=i,e[c.id]=r,r+=i}let a=0;for(let s=t.length-1;s>=0;s--)o[t[s].id]=a,a+=l[s];return{starts:e,afters:o}}n(Fo,"buildColumnOffsets");function ko(t){return{all:Fo(Pe(t)),center:Fo(Pe(t,"center")),start:Fo(Pe(t,"start")),end:Fo(Pe(t,"end"))}}n(ko,"table_getColumnOffsets");function va(t){return t==="start"?"start":t==="end"?"end":t==="center"?"center":"all"}n(va,"toOffsetsKey");function ya(t,e){return re(t.table,"getColumnOffsets",ko)[va(e)].starts[t.id]??0}n(ya,"column_getStart");function Ca(t,e){return re(t.table,"getColumnOffsets",ko)[va(e)].afters[t.id]??0}n(Ca,"column_getAfter");function Ra(t){Ct(t.table,e=>{let o=j(),l=Object.keys(e);for(let r=0;r<l.length;r++){let a=l[r];a!==t.id&&(o[a]=e[a])}return o})}n(Ra,"column_resetSize");function Fa(t){if(!t.subHeaders.length)return gt(t.column);let e=0;for(let o=0;o<t.subHeaders.length;o++)e+=Fa(t.subHeaders[o]);return e}n(Fa,"sumHeaderSize");function yt(t){return Fa(t)}n(yt,"header_getSize");function Sn(t){if(t.index>0){let e=t.headerGroup?.headers[t.index-1];if(e)return re(e,"getStart",Sn)+re(e,"getSize",yt)}return 0}n(Sn,"header_getStart");function Ct(t,e){t.options.onColumnSizingChange?.(e)}n(Ct,"table_setColumnSizing");function ka(t,e){Ct(t,e?j():Object.assign(j(),Re(t.initialState.columnSizing??{})))}n(ka,"table_resetColumnSizing");function _n(t){let e=0;for(let o=0;o<t.length;o++)e+=re(t[o],"getSize",gt);return e}n(_n,"sumColumnSizes");function Na(t){return t.getHeaderGroups()[0]?.headers.reduce((e,o)=>e+yt(o),0)??0}n(Na,"table_getTotalSize");function Ma(t){return _n(Pe(t,"start"))}n(Ma,"table_getStartTotalSize");function Ia(t){return _n(Pe(t,"center"))}n(Ia,"table_getCenterTotalSize");function Pa(t){return _n(Pe(t,"end"))}n(Pa,"table_getEndTotalSize");function Mo(){return{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}}n(Mo,"getDefaultColumnResizingState");function vn(t){return(t.columnDef.enableResizing??!0)&&(t.table.options.enableColumnResizing??!0)}n(vn,"column_getCanResize");function Aa(t){return t.table.atoms.columnResizing?.get()?.isResizingColumn===t.id}n(Aa,"column_getIsResizing");function Da(t,e){let o=t.table.getColumn(t.column.id),l=vn(o);return r=>{if(!l||xn(r)&&r.touches.length>1)return;let a=yt(t),s=t.getLeafHeaders().map(v=>[v.column.id,gt(v.column)]),c=xn(r)?Math.round(r.touches[0].clientX):r.clientX,i=j(),u=n((v,R)=>{if(typeof R!="number")return;let S=o.table,y=S.options.columnResizeMode==="onChange"||v==="end";S._reactivity.batch(()=>{Rt(S,k=>{let P=S.options.columnResizeDirection==="rtl"?-1:1,M=(R-(k.startOffset??0))*P,I=k.startSize??0,N=Math.max(I>0?M/I:0,-.999999);if(y){let T=k.columnSizingStart;for(let O=0;O<T.length;O++){let D=T[O],E=D[1];i[D[0]]=Math.round(Math.max(E>0?E+E*N:M/T.length,0)*100)/100}}return{...k,deltaOffset:M,deltaPercentage:N}}),y&&Ct(S,k=>Object.assign(j(),k,i))})},"updateOffset"),d=null,g=!1,m,h=n(()=>{g?(g=!1,u("move",m),d=requestAnimationFrame(h)):d=null},"flushMove"),p=n(v=>{if(m=v,typeof requestAnimationFrame!="function"){u("move",v);return}if(d!==null){g=!0;return}u("move",v),d=requestAnimationFrame(h)},"onMove"),b=n(v=>{d!==null&&(cancelAnimationFrame(d),d=null,g=!1),o.table._reactivity.batch(()=>{u("end",v??m),Rt(o.table,R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))})},"onEnd"),w=e||(typeof document<"u"?document:null),x={moveHandler:n(v=>p(v.clientX),"moveHandler"),upHandler:n(v=>{w?.removeEventListener("mousemove",x.moveHandler),w?.removeEventListener("mouseup",x.upHandler),b(v.clientX)},"upHandler")},_={moveHandler:n(v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),p(v.touches[0].clientX),!1),"moveHandler"),upHandler:n(v=>{C(),v.cancelable&&(v.preventDefault(),v.stopPropagation()),b(v.touches[0]?.clientX)},"upHandler"),cancelHandler:n(()=>{C(),b()},"cancelHandler")},C=n(()=>{w?.removeEventListener("touchmove",_.moveHandler),w?.removeEventListener("touchend",_.upHandler),w?.removeEventListener("touchcancel",_.cancelHandler)},"removeTouchEvents"),F=Bi()?{passive:!1}:!1;xn(r)?(w?.addEventListener("touchmove",_.moveHandler,F),w?.addEventListener("touchend",_.upHandler,F),w?.addEventListener("touchcancel",_.cancelHandler,F)):(w?.addEventListener("mousemove",x.moveHandler,F),w?.addEventListener("mouseup",x.upHandler,F)),Rt(o.table,v=>({...v,startOffset:c,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:o.id}))}}n(Da,"header_getResizeHandler");function Rt(t,e){t.options.onColumnResizingChange?.(e)}n(Rt,"table_setColumnResizing");function Ta(t,e){Rt(t,e?Mo():Re(t.initialState.columnResizing??Mo()))}n(Ta,"table_resetHeaderSizeInfo");var No=null;function Bi(){if(typeof No=="boolean")return No;let t=!1;try{let e={get passive(){return t=!0,!1}},o=n(()=>{},"noop");window.addEventListener("test",o,e),window.removeEventListener("test",o)}catch{t=!1}return No=t,No}n(Bi,"passiveEventSupported");function xn(t){return t.type==="touchstart"}n(xn,"isTouchStartEvent");var yn={getInitialState:n(t=>({columnResizing:Mo(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnResizingChange:Ge("columnResizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnResizingFeature",t,e,{column_getCanResize:{fn:n(o=>vn(o),"fn")},column_getIsResizing:{fn:n(o=>Aa(o),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:n((t,e)=>{ue("columnResizingFeature",t,e,{header_getResizeHandler:{fn:n((o,l)=>Da(o,l),"fn")}})},"assignHeaderPrototype"),constructTableAPIs:n(t=>{fe("columnResizingFeature",t,{table_setColumnResizing:{fn:n(e=>Rt(t,e),"fn")},table_resetHeaderSizeInfo:{fn:n(e=>Ta(t,e),"fn")}})},"constructTableAPIs")};var Cn={getInitialState:n(t=>({columnSizing:xa(),...t}),"getInitialState"),getDefaultColumnDef:n(()=>wn(),"getDefaultColumnDef"),getDefaultTableOptions:n(t=>({onColumnSizingChange:Ge("columnSizing",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnSizingFeature",t,e,{column_getSize:{fn:n(o=>gt(o),"fn"),memoDeps:n(o=>[e.options.columns,e.atoms.columnSizing?.get()?.[o.id]],"memoDeps")},column_getStart:{fn:n((o,l)=>ya(o,l),"fn")},column_getAfter:{fn:n((o,l)=>Ca(o,l),"fn")},column_resetSize:{fn:n(o=>Ra(o),"fn")}})},"assignColumnPrototype"),assignHeaderPrototype:n((t,e)=>{ue("columnSizingFeature",t,e,{header_getSize:{fn:n(o=>yt(o),"fn"),memoDeps:n(o=>[e.options.columns,o.column.columns.length>0?e.atoms.columnSizing?.get():e.atoms.columnSizing?.get()?.[o.column.id]],"memoDeps")},header_getStart:{fn:n(o=>Sn(o),"fn"),memoDeps:n(()=>[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:n(t=>{fe("columnSizingFeature",t,{table_getColumnOffsets:{fn:n(()=>ko(t),"fn"),memoDeps:n(()=>[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:n(e=>Ct(t,e),"fn")},table_resetColumnSizing:{fn:n(e=>ka(t,e),"fn")},table_getTotalSize:{fn:n(()=>Na(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getStartTotalSize:{fn:n(()=>Ma(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getCenterTotalSize:{fn:n(()=>Ia(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")},table_getEndTotalSize:{fn:n(()=>Pa(t),"fn"),memoDeps:n(()=>[t.atoms.columnSizing?.get(),t.getHeaderGroups()],"memoDeps")}})},"constructTableAPIs")};function Oa(){return j()}n(Oa,"getDefaultColumnVisibilityState");function Rn(t,e){zt(t)&&$t(t.table,o=>{let l=Object.assign(j(),o),r=e??!re(t,"getIsVisible",We),a=t.getLeafColumns();for(let s=0;s<a.length;s++){let c=a[s];zt(c)&&(l[c.id]=r)}return l})}n(Rn,"column_toggleVisibility");function We(t){let e=t.table.atoms.columnVisibility?.get();if(!e)return!0;let o=t.columns;return o.length?o.some(l=>re(l,"getIsVisible",We)):(Ke(e,t.id)?e[t.id]:void 0)??!0}n(We,"column_getIsVisible");function zt(t){return(t.columnDef.enableHiding??!0)&&(t.table.options.enableHiding??!0)}n(zt,"column_getCanHide");function Va(t){return e=>{Rn(t,e.target.checked)}}n(Va,"column_getToggleVisibilityHandler");function Ea(t){let e=t.getAllCells(),o=[];for(let l=0;l<e.length;l++){let r=e[l];re(r.column,"getIsVisible",We)&&o.push(r)}return vo(t.table,o,l=>l.column.id,()=>re(t,"getVisibleCellsByColumnId",Fn))}n(Ea,"row_getVisibleCells");function Fn(t){let e=j(),o=t.getAllCells();for(let l=0;l<o.length;l++){let r=o[l];re(r.column,"getIsVisible",We)&&(e[r.column.id]=r)}return e}n(Fn,"row_getVisibleCellsByColumnId");function za(t){return t.getAllFlatColumns().filter(e=>re(e,"getIsVisible",We))}n(za,"table_getVisibleFlatColumns");function $a(t){return t.getAllLeafColumns().filter(e=>re(e,"getIsVisible",We))}n($a,"table_getVisibleLeafColumns");function $t(t,e){xt(t,"columnVisibility",e)}n($t,"table_setColumnVisibility");function ja(t,e){$t(t,e?j():Object.assign(j(),Re(t.initialState.columnVisibility??{})))}n(ja,"table_resetColumnVisibility");function kn(t,e){e=e??!Nn(t);let o=j(),l=t.getAllLeafColumns();for(let r=0;r<l.length;r++){let a=l[r];o[a.id]=e||!zt(a)}$t(t,o)}n(kn,"table_toggleAllColumnsVisible");function Nn(t){return!t.getAllLeafColumns().some(e=>!re(e,"getIsVisible",We))}n(Nn,"table_getIsAllColumnsVisible");function Ha(t){return t.getAllLeafColumns().some(e=>re(e,"getIsVisible",We))}n(Ha,"table_getIsSomeColumnsVisible");function La(t){return e=>{kn(t,e.target.checked)}}n(La,"table_getToggleAllColumnsVisibilityHandler");var Mn={getInitialState:n(t=>({columnVisibility:Oa(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({onColumnVisibilityChange:Ge("columnVisibility",t)}),"getDefaultTableOptions"),assignColumnPrototype:n((t,e)=>{ue("columnVisibilityFeature",t,e,{column_getIsVisible:{fn:n(o=>We(o),"fn"),memoDeps:n(o=>[e.options.columns,e.atoms.columnVisibility?.get(),o.columns],"memoDeps")},column_getCanHide:{fn:n(o=>zt(o),"fn")},column_getToggleVisibilityHandler:{fn:n(o=>Va(o),"fn")},column_toggleVisibility:{fn:n((o,l)=>Rn(o,l),"fn")}})},"assignColumnPrototype"),assignRowPrototype:n((t,e)=>{ue("columnVisibilityFeature",t,e,{row_getVisibleCells:{fn:n(o=>Ea(o),"fn"),memoDeps:n(o=>[o.getAllCells(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get()],"memoDeps")},row_getVisibleCellsByColumnId:{fn:n(o=>Fn(o),"fn"),memoDeps:n(o=>[o.getAllCells(),e.atoms.columnVisibility?.get()],"memoDeps")}})},"assignRowPrototype"),constructTableAPIs:n(t=>{fe("columnVisibilityFeature",t,{table_getVisibleFlatColumns:{fn:n(()=>za(t),"fn"),memoDeps:n(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_getVisibleLeafColumns:{fn:n(()=>$a(t),"fn"),memoDeps:n(()=>[t.atoms.columnVisibility?.get(),t.atoms.columnOrder?.get(),t.atoms.grouping?.get(),t.options.columns,t.options.groupedColumnMode],"memoDeps")},table_setColumnVisibility:{fn:n(e=>$t(t,e),"fn")},table_resetColumnVisibility:{fn:n(e=>ja(t,e),"fn")},table_toggleAllColumnsVisible:{fn:n(e=>kn(t,e),"fn")},table_getIsAllColumnsVisible:{fn:n(()=>Nn(t),"fn")},table_getIsSomeColumnsVisible:{fn:n(()=>Ha(t),"fn")},table_getToggleAllColumnsVisibilityHandler:{fn:n(()=>La(t),"fn")}})},"constructTableAPIs")};function Ba(){return j()}n(Ba,"getDefaultRowSelectionState");function ft(t,e){t.options.onRowSelectionChange?.(e)}n(ft,"table_setRowSelection");function Ga(t,e){t._lastSelectedRowId=null,ft(t,e?j():Object.assign(j(),Re(t.initialState.rowSelection??{})))}n(Ga,"table_resetRowSelection");function In(t,e,o){t._lastSelectedRowId=null,ft(t,l=>{if(e=typeof e<"u"?e:!re(t,"getIsAllRowsSelected",Dn),o?.deselectAll&&!e)return j();let r=Object.assign(j(),l),a=t.getPreGroupedRowModel().flatRows;if(e){let s=new Map;a.forEach(c=>{Io(c,s)&&(r[c.id]=!0)})}else a.forEach(s=>{Qe(s)&&delete r[s.id]});return r})}n(In,"table_toggleAllRowsSelected");function Pn(t,e,o){t._lastSelectedRowId=null,ft(t,l=>{let r=typeof e<"u"?e:!re(t,"getIsAllPageRowsSelected",Tn);if(o?.deselectAll&&!r)return j();let a=Object.assign(j(),l);return t.getRowModel().rows.forEach(s=>{Do(a,s.id,r,!0,t,!0)}),a})}n(Pn,"table_toggleAllPageRowsSelected");function qa(t){return t.getCoreRowModel()}n(qa,"table_getPreSelectedRowModel");function Ka(t){let e=t.getCoreRowModel();return re(t,"getIsSomeRowsSelected",jt)?En(e,t):{rows:[],flatRows:[],rowsById:j()}}n(Ka,"table_getSelectedRowModel");function Ua(t){let e=t.getFilteredRowModel();return re(t,"getIsSomeRowsSelected",jt)?En(e,t):{rows:[],flatRows:[],rowsById:j()}}n(Ua,"table_getFilteredSelectedRowModel");function Ja(t){let e=t.getSortedRowModel();return re(t,"getIsSomeRowsSelected",jt)?En(e,t):{rows:[],flatRows:[],rowsById:j()}}n(Ja,"table_getGroupedSelectedRowModel");function An(t){return Object.keys(t.atoms.rowSelection?.get()??{})}n(An,"table_getSelectedRowIds");function Dn(t){let e=t.getFilteredRowModel().flatRows,o=t.atoms.rowSelection?.get()??{},l=!!(e.length&&Object.keys(o).length);if(l){let r=new Map;e.some(a=>!Ht(a,o)&&Io(a,r))&&(l=!1)}return l}n(Dn,"table_getIsAllRowsSelected");function Tn(t){let e=t.getPaginatedRowModel().flatRows,o=t.atoms.rowSelection?.get()??{},l=new Map,r=!1;for(let a=0;a<e.length;a++){let s=e[a];if(Ht(s,o))!r&&Io(s,l)&&(r=!0);else if(Io(s,l))return!1}return r}n(Tn,"table_getIsAllPageRowsSelected");function jt(t){return re(t,"getSelectedRowIds",An).length>0}n(jt,"table_getIsSomeRowsSelected");function Wa(t){return t.getPaginatedRowModel().flatRows.filter(e=>Qe(e)).some(e=>Po(e)||re(e,"getIsSomeSelected",Vn))}n(Wa,"table_getIsSomePageRowsSelected");function Qa(t){return e=>{In(t,e.target.checked)}}n(Qa,"table_getToggleAllRowsSelectedHandler");function Xa(t){return e=>{Pn(t,e.target.checked)}}n(Xa,"table_getToggleAllPageRowsSelectedHandler");function On(t,e,o){let l=Po(t);ft(t.table,r=>{e=typeof e<"u"?e:!l;let a=Object.assign(j(),r);return Do(a,t.id,e,(o?.selectChildren??!0)&&at(t),t.table),!e&&o?.deselectParents&&es(a,t),a})}n(On,"row_toggleSelected");function Po(t){return Ht(t,t.table.atoms.rowSelection?.get()??{})}n(Po,"row_getIsSelected");function Vn(t){return zn(t)==="some"}n(Vn,"row_getIsSomeSelected");function Ya(t){return zn(t)==="all"}n(Ya,"row_getIsAllSubRowsSelected");function Qe(t){let e=t.table.options;return typeof e.enableRowSelection=="function"?e.enableRowSelection(t):e.enableRowSelection??!0}n(Qe,"row_getCanSelect");function Ao(t){let e=t.table.options;return typeof e.enableSubRowSelection=="function"?e.enableSubRowSelection(t):e.enableSubRowSelection??!0}n(Ao,"row_getCanSelectSubRows");function at(t){let e=t.table.options;return typeof e.enableMultiRowSelection=="function"?e.enableMultiRowSelection(t):e.enableMultiRowSelection??!0}n(at,"row_getCanMultiSelect");function Za(t,e){let o=Qe(t);return l=>{if(!o)return;let r=l,a=t.table,s=r.target.checked,c=a._lastSelectedRowId;(!(a.options.enableRowRangeSelection!==!1&&c!==null&&at(t)&&(a.options.isRowRangeSelectionEvent?.(l)??!1))||!Gi(t,c,s,e))&&On(t,s,e),a._lastSelectedRowId=t.id}}n(Za,"row_getToggleSelectedHandler");function Gi(t,e,o,l){let r=l?.selectChildren??!0,a=t.table,s=a.getRowsInDisplayOrder(),c=a.getPrePaginatedRowModel().rowsById[e]??a.getCoreRowModel().rowsById[e];if(!c)return!1;let i=c.getDisplayIndex(),u=t.getDisplayIndex(),d=s[i],g=s[u];if(i<0||u<0||i>=s.length||u>=s.length||d?.id!==c.id||g?.id!==t.id||!at(c)||!at(t))return!1;let m=Math.min(i,u),h=Math.max(i,u);return ft(a,p=>{let b=Object.assign(j(),p);for(let w=m;w<=h;w++){let x=s[w];!Qe(x)||!at(x)||(Do(b,x.id,o,r,a),!o&&l?.deselectParents&&es(b,x))}return b}),!0}n(Gi,"selectRowRange");function Do(t,e,o,l,r,a){let s=r.getRow(e,!0);o?(at(s)||Object.keys(t).forEach(c=>delete t[c]),Qe(s)&&(t[e]=!0)):(!a||Qe(s))&&delete t[e],l&&s.subRows.length&&Ao(s)&&s.subRows.forEach(c=>Do(t,c.id,o,l,r,a))}n(Do,"mutateRowIsSelected");function Io(t,e){if(!Qe(t))return!1;let o=t.table;if(o.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=o.getCoreRowModel().rowsById,s=[],c=!0,i=l;for(;i!==void 0;){let u=e.get(i);if(u!==void 0){c=u;break}s.push(i);let d=a[i]??o.getRow(i,!0);if(!Ao(d)){c=!1;break}i=d.parentId}return s.forEach(u=>e.set(u,c)),c}n(Io,"isRowSelectableInSelectAll");function es(t,e){let o=e.table.getCoreRowModel().rowsById,l=e.parentId;for(;l!==void 0;)delete t[l],l=(o[l]??e.table.getRow(l,!0)).parentId}n(es,"pruneAncestorRowIds");function ts(t,e,o,l){let r=[];for(let a=0;a<t.length;a++){let s=t[a],c=Ht(s,e);if(c&&(o.push(s),l[s.id]=s),s.subRows.length){let i=ts(s.subRows,e,o,l);if(c){let u=Object.create(Object.getPrototypeOf(s));So(u,s),u.subRows=i,r.push(u)}}else c&&r.push(s)}return r}n(ts,"selectRowsRecursively");function En(t,e){let o=[],l=j(),r=e.atoms.rowSelection?.get()??{};return{rows:ts(t.rows,r,o,l),flatRows:o,rowsById:l}}n(En,"selectRowsFn");function Ht(t,e){return!!(Ke(e,t.id)&&e[t.id])}n(Ht,"isRowSelected");function zn(t){if(!t.subRows.length)return!1;let e=t.table.atoms.rowSelection?.get()??{},o=!1,l=!0,r=!1;for(let a=0;a<t.subRows.length;a++){let s=t.subRows[a];if(o&&!l)break;if(Qe(s)&&(r=!0,Ht(s,e)?o=!0:l=!1),s.subRows.length){let c=zn(s);c==="all"?(o=!0,r=!0):c==="some"?(o=!0,l=!1,r=!0):l=!1}}return r?l?"all":o?"some":!1:!1}n(zn,"isSubRowSelected");var $n={initTableInstanceData:n(t=>{t._lastSelectedRowId=null},"initTableInstanceData"),resetTableInstanceData:n(t=>{t._lastSelectedRowId=null},"resetTableInstanceData"),getInitialState:n(t=>({rowSelection:Ba(),...t}),"getInitialState"),getDefaultTableOptions:n(t=>({onRowSelectionChange:Ge("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableRowRangeSelection:!0,enableSubRowSelection:!0,isRowRangeSelectionEvent:n(e=>{let o=e;return!!(o.shiftKey||o.nativeEvent?.shiftKey)},"isRowRangeSelectionEvent")}),"getDefaultTableOptions"),assignRowPrototype:n((t,e)=>{ue("rowSelectionFeature",t,e,{row_toggleSelected:{fn:n((o,l,r)=>On(o,l,r),"fn")},row_getIsSelected:{fn:n(o=>Po(o),"fn")},row_getIsSomeSelected:{fn:n(o=>Vn(o),"fn"),memoDeps:n(o=>[o.subRows,o.table.atoms.rowSelection?.get(),o.table.options.enableRowSelection],"memoDeps")},row_getIsAllSubRowsSelected:{fn:n(o=>Ya(o),"fn"),memoDeps:n(o=>[o.subRows,o.table.atoms.rowSelection?.get(),o.table.options.enableRowSelection],"memoDeps")},row_getCanSelect:{fn:n(o=>Qe(o),"fn")},row_getCanSelectSubRows:{fn:n(o=>Ao(o),"fn")},row_getCanMultiSelect:{fn:n(o=>at(o),"fn")},row_getToggleSelectedHandler:{fn:n((o,l)=>Za(o,l),"fn")}})},"assignRowPrototype"),constructTableAPIs:n(t=>{fe("rowSelectionFeature",t,{table_setRowSelection:{fn:n(e=>ft(t,e),"fn")},table_resetRowSelection:{fn:n(e=>Ga(t,e),"fn")},table_toggleAllRowsSelected:{fn:n((e,o)=>In(t,e,o),"fn")},table_toggleAllPageRowsSelected:{fn:n((e,o)=>Pn(t,e,o),"fn")},table_getPreSelectedRowModel:{fn:n(()=>qa(t),"fn")},table_getSelectedRowModel:{fn:n(()=>Ka(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getCoreRowModel()],"memoDeps")},table_getFilteredSelectedRowModel:{fn:n(()=>Ua(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel()],"memoDeps")},table_getGroupedSelectedRowModel:{fn:n(()=>Ja(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getSortedRowModel()],"memoDeps")},table_getSelectedRowIds:{fn:n(()=>An(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsAllRowsSelected:{fn:n(()=>Dn(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getFilteredRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsAllPageRowsSelected:{fn:n(()=>Tn(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection,t.options.enableSubRowSelection],"memoDeps")},table_getIsSomeRowsSelected:{fn:n(()=>jt(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get()],"memoDeps")},table_getIsSomePageRowsSelected:{fn:n(()=>Wa(t),"fn"),memoDeps:n(()=>[t.atoms.rowSelection?.get(),t.getPaginatedRowModel(),t.options.enableRowSelection],"memoDeps")},table_getToggleAllRowsSelectedHandler:{fn:n(()=>Qa(t),"fn")},table_getToggleAllPageRowsSelectedHandler:{fn:n(()=>Xa(t),"fn")}})},"constructTableAPIs")};var Hn=/([0-9]+)/gm;function Lt(t){let e=Object.assign((o,l,r)=>{let a=o.getValue(r),s=l.getValue(r),c=e.resolveDataValue;return c&&(a=c(a),s=c(s)),e.sort(a,s,o,l,r)},t);return e}n(Lt,"constructSortFn");var Ln=Lt({resolveDataValue:n(t=>ls(t).toLowerCase(),"resolveDataValue"),sort:n((t,e)=>Ki(t,e),"sort")});var Bn=Lt({resolveDataValue:n(t=>ls(t).toLowerCase(),"resolveDataValue"),sort:n((t,e)=>rs(t,e),"sort")});var Gn=Lt({resolveDataValue:n(t=>qi(t),"resolveDataValue"),sort:n((t,e)=>t>e?1:t<e?-1:0,"sort")}),Ft=Lt({sort:n((t,e)=>rs(t,e),"sort")});function rs(t,e){return t===e?0:t>e?1:-1}n(rs,"compareBasic");function qi(t){return t instanceof Date?t.getTime():t}n(qi,"toDateSortValue");function ls(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}n(ls,"toString");function Ki(t,e){let o=0,l=0,r=t.length,a=e.length;for(;o<r&&l<a;){let s=To(t.charCodeAt(o)),c=To(e.charCodeAt(l)),i=jn(t,o,s),u=jn(e,l,c);if(!s&&!c){let g=Ui(t,o,i,e,l,u);if(g)return g;o=i,l=u;continue}if(s!==c)return s?1:-1;let d=Ji(t,o,i,e,l,u);if(d)return d;o=i,l=u}return ns(t,o)-ns(e,l)}n(Ki,"compareAlphanumeric");function To(t){return t>=48&&t<=57}n(To,"isDigit");function jn(t,e,o){let l=e+1;for(;l<t.length&&To(t.charCodeAt(l))===o;)l++;return l}n(jn,"findChunkEnd");function Ui(t,e,o,l,r,a){let s=o-e,c=a-r,i=s<c?s:c;for(let u=0;u<i;u++){let d=t.charCodeAt(e+u),g=l.charCodeAt(r+u);if(d>g)return 1;if(g>d)return-1}return s>c?1:c>s?-1:0}n(Ui,"compareStringChunks");function Ji(t,e,o,l,r,a){let s=e;for(;s<o&&t.charCodeAt(s)===48;)s++;let c=r;for(;c<a&&l.charCodeAt(c)===48;)c++;let i=o-s,u=a-c;if(i===0&&u===0)return 0;if(i<=15&&u<=15){let m=os(t,s,o),h=os(l,c,a);return m>h?1:h>m?-1:0}let d=parseInt(t.slice(e,o),10),g=parseInt(l.slice(r,a),10);return d>g?1:g>d?-1:0}n(Ji,"compareNumericChunks");function os(t,e,o){let l=0;for(let r=e;r<o;r++)l=l*10+t.charCodeAt(r)-48;return l}n(os,"parseSmallInt");function ns(t,e){let o=0,l=e;for(;l<t.length;)o++,l=jn(t,l,To(t.charCodeAt(l)));return o}n(ns,"countRemainingChunks");function as(){return[]}n(as,"getDefaultSortingState");function Gt(t,e){xt(t,"sorting",e)}n(Gt,"table_setSorting");function qn(t,e){Gt(t,e?[]:Re(t.initialState.sorting??[]))}n(qn,"table_resetSorting");function ss(t){t.atoms.sorting&&(t.options.autoResetAll??t.options.autoResetSorting??!1)&&qn(t)}n(ss,"table_autoResetSorting");function Kn(t){let e=t.table._rowModelFns.sortFns,o=t.table.getFilteredRowModel().flatRows.slice(0,10),l,r=!1;for(let a=0;a<o.length;a++){let s=o[a].getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]"){l="datetime";break}if(typeof s=="string"&&(r=!0,s.split(Hn).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 Ft}n(Kn,"column_getAutoSortFn");function Un(t){let e=t.table.getFilteredRowModel().flatRows.slice(0,10);for(let o=0;o<e.length;o++){let l=e[o].getValue(t.id);if(l!=null)return typeof l=="string"?"asc":"desc"}return"desc"}n(Un,"column_getAutoSortDir");function Oo(t){let e=t.table._rowModelFns.sortFns;return Zr(t.columnDef.sortFn)?t.columnDef.sortFn:t.columnDef.sortFn==="auto"?Kn(t):e?.[t.columnDef.sortFn]??Ft}n(Oo,"column_getSortFn");function Jn(t,e,o){let l=Qn(t,o&&Bt(t)),r=typeof e<"u";Gt(t.table,a=>{let s=a.findIndex(m=>m.id===t.id),c=s===-1?void 0:a[s],i=[],u,d=r?e:l==="desc",g=!!(a.length&&Bt(t)&&o);return g?c?u="toggle":u="add":c?u="toggle":u="replace",u==="toggle"&&(r||l||(u="remove")),u==="add"?(i=[...a,{id:t.id,desc:d}],i.splice(0,i.length-(t.table.options.maxMultiSortColCount??Number.MAX_SAFE_INTEGER))):u==="toggle"?i=g?a.map(m=>m.id===t.id?{...m,desc:d}:m):[{id:t.id,desc:d}]:u==="remove"?i=g?a.filter(m=>m.id!==t.id):[]:i=[{id:t.id,desc:d}],i})}n(Jn,"column_toggleSorting");function Wn(t){return t.columnDef.sortDescFirst??t.table.options.sortDescFirst??Un(t)==="desc"?"desc":"asc"}n(Wn,"column_getFirstSortDir");function Qn(t,e){let o=Wn(t),l=Xn(t);return l?l!==o&&(t.table.options.enableSortingRemoval??!0)&&(!e||(t.table.options.enableMultiRemove??!0))?!1:l==="desc"?"asc":"desc":o}n(Qn,"column_getNextSortingOrder");function qt(t){return(t.columnDef.enableSorting??!0)&&(t.table.options.enableSorting??!0)&&!!t.accessorFn}n(qt,"column_getCanSort");function Bt(t){return t.columnDef.enableMultiSort??t.table.options.enableMultiSort??!!t.accessorFn}n(Bt,"column_getCanMultiSort");function Xn(t){let e=t.table.atoms.sorting?.get()?.find(o=>o.id===t.id);return e?e.desc?"desc":"asc":!1}n(Xn,"column_getIsSorted");function is(t){return t.table.atoms.sorting?.get()?.findIndex(e=>e.id===t.id)??-1}n(is,"column_getSortIndex");function cs(t){Gt(t.table,e=>e.length?e.filter(o=>o.id!==t.id):[])}n(cs,"column_clearSorting");function us(t){let e=qt(t);return o=>{e&&Jn(t,void 0,Bt(t)?t.table.options.isMultiSortEvent?.(o):!1)}}n(us,"column_getToggleSortingHandler");var Yn={getInitialState(t){return{sorting:as(),...t}},getDefaultColumnDef(){return{sortFn:"auto",sortUndefined:1}},getDefaultTableOptions(t){return{autoResetSorting:!1,onSortingChange:Ge("sorting",t),isMultiSortEvent:n(e=>e.shiftKey,"isMultiSortEvent")}},assignColumnPrototype(t,e){ue("rowSortingFeature",t,e,{column_getAutoSortFn:{fn:n(o=>Kn(o),"fn")},column_getAutoSortDir:{fn:n(o=>Un(o),"fn")},column_getSortFn:{fn:n(o=>Oo(o),"fn")},column_toggleSorting:{fn:n((o,l,r)=>Jn(o,l,r),"fn")},column_getFirstSortDir:{fn:n(o=>Wn(o),"fn")},column_getNextSortingOrder:{fn:n((o,l)=>Qn(o,l),"fn")},column_getCanSort:{fn:n(o=>qt(o),"fn")},column_getCanMultiSort:{fn:n(o=>Bt(o),"fn")},column_getIsSorted:{fn:n(o=>Xn(o),"fn")},column_getSortIndex:{fn:n(o=>is(o),"fn")},column_clearSorting:{fn:n(o=>cs(o),"fn")},column_getToggleSortingHandler:{fn:n(o=>us(o),"fn")}})},constructTableAPIs(t){fe("rowSortingFeature",t,{table_autoResetSorting:{fn:n(()=>ss(t),"fn")},table_setSorting:{fn:n(e=>Gt(t,e),"fn")},table_resetSorting:{fn:n(e=>qn(t,e),"fn")}})}};function Zn(){return t=>{let e=t;return vt({feature:"rowSortingFeature",table:e,fnName:"table.getSortedRowModel",memoDeps:n(()=>[e.atoms.sorting?.get(),e.getPreSortedRowModel()],"memoDeps"),fn:n(()=>Wi(e),"fn"),onAfterUpdate:_o(()=>yo(e))})}}n(Zn,"createSortedRowModel");function Wi(t){let e=t.getPreSortedRowModel(),o=t.atoms.sorting?.get();if(!e.rows.length||!o?.length)return e;let l=[],r=o.filter(i=>{let u=t.getColumn(i.id);return u?qt(u):!1});if(!r.length)return e;let a=[];for(let i=0;i<r.length;i++){let u=r[i],d=t.getColumn(u.id);d&&a.push({id:u.id,desc:u.desc,sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortFn:Oo(d)})}let s=n((i,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=i.getValue(g.id),w=u.getValue(g.id),x=b===void 0,_=w===void 0;if(x&&_)continue;if(x||_){if(m==="first")return x?-1:1;if(m==="last")return x?1:-1;p=x?m:-m}}if(p===0&&(p=g.sortFn(i,u,g.id)),p!==0)return h&&(p*=-1),g.invertSorting&&(p*=-1),p}return i.index-u.index},"compareRows"),c=n(i=>{let u=i.slice();u.sort(s);let d=!1;for(let g=0;g<u.length;g++){let m=u[g];m!==i[g]&&(d=!0);let h=l.length;if(l.push(m),m.subRows.length){let p=c(m.subRows);if(p.changed){let b=Object.create(Object.getPrototypeOf(m));So(b,m),b.subRows=p.rows,u[g]=b,l[h]=b,d=!0}}}return{rows:u,changed:d}},"sortData");return{rows:c(e.rows).rows,flatRows:l,rowsById:e.rowsById}}n(Wi,"_createSortedRowModel");var st=ke(ct(),1);var Qi=typeof window>"u"?st.useEffect:st.useLayoutEffect;function er(t,e){let[{table:o,rootSource:l}]=(0,st.useState)(()=>{let i=fn({...t,features:{coreReactivityFeature:Wr(),...t.features}});return i.Subscribe=(u=>Ur({...u,source:u.source??i.store})),i.FlexRender=an,{table:i,rootSource:cn(i.store,rt)}}),r=o;Et(r,i=>({...i,...t}),{syncExternalState:!1});let a=r.options.state,s=l.get(),c=Zt(l,e,{compare:rt});return Qi(()=>{l.markCommitted(s),Ro(r,a??null,rt)}),(0,st.useMemo)(()=>({...o,options:t,state:c}),[o,t,c])}n(er,"useTable");var ds=ke(At(),1),ms=ke(ct(),1);var Ce=ke(Dt(),1);var Xi=[{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"}],gs=n(t=>{let e=t.trim(),o=Number(e);return e!==""&&Number.isFinite(o)&&String(o)===e?o:t},"E"),Yi=n(t=>{let e=t.trim();return(e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):void 0)??(e==="true"||e==="false"?e==="true":gs(t))},"G"),Zi=n(t=>t.operator==="has"?Yi(t.value):gs(t.value),"I"),ec=n(t=>t.operator==="contains"?t.value==="":t.operator!=="eq"&&t.operator!=="ne"&&t.literal===void 0&&t.value.trim()==="","J"),tc=n(t=>{if(t.pathSegments!==void 0)return t.pathSegments;let e=t.path??"";return e.trim()===""?void 0:e.split(".").map(o=>o.trim())},"L"),Xe=n(t=>t.filter(e=>e.column!==""&&!ec(e)).map(e=>{let o=tc(e),l=o===void 0?{}:{path:o};return e.operator==="contains"?{column:e.column,operator:e.operator,...l,value:e.value}:{column:e.column,operator:e.operator,...l,value:e.literal===void 0?Zi(e):e.literal[0]}}),"_"),tr=n((t,e)=>({column:t.column,operator:t.operator,path:t.path,pathSegments:t.pathSegments,value:t.value,...e}),"j"),fs=n(t=>{let e=(0,ds.c)(51),{columns:o,filters:l,onAskAi:r,onFiltersChange:a,onSearchChange:s,search:c}=t,[i,u]=(0,ms.useState)(""),d=te(),g;e[0]!==o[0]||e[1]!==l||e[2]!==a?(g=n(()=>{a([...l,{column:o[0]??"",operator:"eq",value:""}])},"T"),e[0]=o[0],e[1]=l,e[2]=a,e[3]=g):g=e[3];let m=g,h;e[4]!==l||e[5]!==a?(h=n(N=>{let T=Number(N.currentTarget.dataset.index);a(l.filter((O,D)=>D!==T))},"w"),e[4]=l,e[5]=a,e[6]=h):h=e[6];let p=h,b;e[7]!==l||e[8]!==a?(b=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E===T?tr(D,{column:O,path:void 0,pathSegments:void 0}):D))},"y"),e[7]=l,e[8]=a,e[9]=b):b=e[9];let w=b,x;e[10]!==l||e[11]!==a?(x=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E!==T?D:O==="has"?tr(D,{operator:O}):{...D,operator:O}))},"q"),e[10]=l,e[11]=a,e[12]=x):x=e[12];let _=x,C;e[13]!==l||e[14]!==a?(C=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E===T?{...D,path:O,pathSegments:void 0}:D))},"k"),e[13]=l,e[14]=a,e[15]=C):C=e[15];let F=C,v;e[16]!==l||e[17]!==a?(v=n(N=>{let T=Number(N.currentTarget.dataset.index),O=N.currentTarget.value;a(l.map((D,E)=>E===T?tr(D,{value:O}):D))},"A"),e[16]=l,e[17]=a,e[18]=v):v=e[18];let R=v,S;e[19]!==s||e[20]!==c?(S=(0,Ce.jsx)("input",{"aria-label":"Search rows","data-testid":"db-filter",onChange:s,placeholder:"search table\u2026",value:c}),e[19]=s,e[20]=c,e[21]=S):S=e[21];let y;e[22]!==m?(y=(0,Ce.jsx)("button",{"data-testid":"db-add-filter",onClick:m,type:"button",children:"Add filter"}),e[22]=m,e[23]=y):y=e[23];let k;e[24]!==i||e[25]!==r?(k=r!==void 0&&(0,Ce.jsxs)(Ce.Fragment,{children:[(0,Ce.jsx)("input",{"aria-label":"Describe a filter","data-testid":"db-ai-prompt",onChange:n(N=>{u(N.target.value)},"onChange"),onKeyDown:n(N=>{N.key==="Enter"&&i.trim()!==""&&(N.preventDefault(),r(i.trim()))},"onKeyDown"),placeholder:"describe a filter\u2026",value:i}),(0,Ce.jsx)("button",{"data-testid":"db-ai-filter",disabled:i.trim()==="",onClick:n(()=>{r(i.trim())},"onClick"),type:"button",children:"Suggest"})]}),e[24]=i,e[25]=r,e[26]=k):k=e[26];let P;e[27]!==S||e[28]!==y||e[29]!==k?(P=(0,Ce.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[S,y,k]}),e[27]=S,e[28]=y,e[29]=k,e[30]=P):P=e[30];let M;if(e[31]!==w||e[32]!==_||e[33]!==F||e[34]!==R||e[35]!==o||e[36]!==l||e[37]!==p||e[38]!==d){let N;e[40]!==w||e[41]!==_||e[42]!==F||e[43]!==R||e[44]!==o||e[45]!==p||e[46]!==d?(N=n((T,O)=>(0,Ce.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"db-filter-row",children:[(0,Ce.jsx)("select",{"aria-label":"Filter column","data-index":O,"data-testid":"db-filter-column",onChange:w,value:T.column,children:o.map(oc)}),(0,Ce.jsx)("select",{"aria-label":"Filter operator","data-index":O,"data-testid":"db-filter-operator",onChange:_,value:T.operator,children:[...Xi,{label:d("has"),value:"has"}].map(nc)}),(0,Ce.jsx)("input",{"aria-label":d("Nested field path"),"data-index":O,"data-testid":"db-filter-path",onChange:F,placeholder:d("nested path, e.g. geo.city"),value:T.path??""}),(0,Ce.jsx)("input",{"aria-label":"Filter value","data-index":O,"data-testid":"db-filter-value",onChange:R,placeholder:T.operator==="has"?d('value ("10" in quotes matches text)'):"value",value:T.value}),(0,Ce.jsx)("button",{"aria-label":"Remove filter","data-index":O,"data-testid":"db-filter-remove",onClick:p,type:"button",children:"\u2715"})]},O),"r"),e[40]=w,e[41]=_,e[42]=F,e[43]=R,e[44]=o,e[45]=p,e[46]=d,e[47]=N):N=e[47],M=l.map(N),e[31]=w,e[32]=_,e[33]=F,e[34]=R,e[35]=o,e[36]=l,e[37]=p,e[38]=d,e[39]=M}else M=e[39];let I;return e[48]!==P||e[49]!==M?(I=(0,Ce.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"db-filters",children:[P,M]}),e[48]=P,e[49]=M,e[50]=I):I=e[50],I},"ee");function oc(t){return(0,Ce.jsx)("option",{value:t,children:t},t)}n(oc,"M");function nc(t){return(0,Ce.jsx)("option",{value:t.value,children:t.label},t.value)}n(nc,"Q");var rc=n(t=>({tables:Object.entries(t).map(([e,o])=>({fields:o.map(l=>l.name),indexes:[],name:e,relations:o.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"),lc=n(t=>{let e=new Map,o=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(o.has(s))continue;o.add(s);let c=e.get(a)??[];c.push({...r,table:l.name}),e.set(a,c)}return e},"Ro"),ac=n((t,e)=>{let o=[],l=[t];for(;l.length>0;){let r=l.shift();if(r===void 0)break;e(r)&&o.push(r);for(let a of r.children)l.push(a)}return o},"$o"),ps=n((t,e)=>{let o=[];for(let[l,r]of Object.entries(e))for(let a of r)a.ref===t&&o.push({column:a.name,table:l});return o.sort((l,r)=>l.table.localeCompare(r.table)||l.column.localeCompare(r.column)),o},"Jt"),ar=n(t=>`${t.table}.${t.column}`,"Ot"),sc=n(t=>{let e=(0,G.c)(111),{columns:o,onApply:l,onClose:r,shardKey:a,table:s,total:c,uniqueColumns:i}=t,u=te(),[d,g]=(0,A.useState)(o[0]??""),[m,h]=(0,A.useState)(""),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=n(me=>{g(me.target.value)},"f"),e[0]=p):p=e[0];let b=p,w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w=n(me=>{h(me.target.value)},"h"),e[1]=w):w=e[1];let x=w,_;e[2]!==m?(_=m.trim(),e[2]=m,e[3]=_):_=e[3];let C=_==="",F,v;if(e[4]!==C||e[5]!==u||e[6]!==m){if(!C)try{v=Yt(JSON.parse(m))}catch(me){F=u("Invalid JSON: {message}",{message:me.message})}e[4]=C,e[5]=u,e[6]=m,e[7]=F,e[8]=v}else F=e[7],v=e[8];let R;e[9]!==d||e[10]!==c||e[11]!==i?(R=i.has(d)&&c>1,e[9]=d,e[10]=c,e[11]=i,e[12]=R):R=e[12];let S=R,y=d!==""&&!C&&F===void 0&&!S,k;e[13]!==y||e[14]!==d||e[15]!==l||e[16]!==r||e[17]!==v?(k=n(()=>{y&&(l({[d]:v}),r())},"T"),e[13]=y,e[14]=d,e[15]=l,e[16]=r,e[17]=v,e[18]=k):k=e[18];let P=k,M;e[19]!==u?(M=u("Set a column on matching rows"),e[19]=u,e[20]=M):M=e[20];let I;e[21]!==u?(I=u("Set a column on matching rows"),e[21]=u,e[22]=I):I=e[22];let N;e[23]!==I?(N=(0,f.jsx)("h3",{className:"text-base text-foreground","data-testid":"bulk-patch-title",children:I}),e[23]=I,e[24]=N):N=e[24];let T;e[25]!==u||e[26]!==s||e[27]!==c?(T=u("Writes {total} rows of {table} through the schema-aware writer \u2014 validators and indexes apply, exactly like a mutation.",{table:s,total:c.toString()}),e[25]=u,e[26]=s,e[27]=c,e[28]=T):T=e[28];let O;e[29]!==T?(O=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-desc",children:T}),e[29]=T,e[30]=O):O=e[30];let D;e[31]!==a||e[32]!==u?(D=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]=D):D=e[33];let E;e[34]!==D?(E=(0,f.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"bulk-patch-shard",children:D}),e[34]=D,e[35]=E):E=e[35];let q;e[36]!==O||e[37]!==E||e[38]!==N?(q=(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[N,O,E]}),e[36]=O,e[37]=E,e[38]=N,e[39]=q):q=e[39];let K;e[40]!==u?(K=u("Close"),e[40]=u,e[41]=K):K=e[41];let V;e[42]!==r||e[43]!==K?(V=(0,f.jsx)(oo,{"data-testid":"bulk-patch-close",onClick:r,size:"xs",variant:"ghost",children:K}),e[42]=r,e[43]=K,e[44]=V):V=e[44];let W;e[45]!==q||e[46]!==V?(W=(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[q,V]}),e[45]=q,e[46]=V,e[47]=W):W=e[47];let U;e[48]!==u?(U=u("Column"),e[48]=u,e[49]=U):U=e[49];let Y;e[50]!==U?(Y=(0,f.jsx)(rn,{htmlFor:"bulk-patch-column",children:U}),e[50]=U,e[51]=Y):Y=e[51];let ne;e[52]!==u?(ne=u("Column"),e[52]=u,e[53]=ne):ne=e[53];let oe;e[54]!==o?(oe=o.map(ic),e[54]=o,e[55]=oe):oe=e[55];let ae;e[56]!==d||e[57]!==ne||e[58]!==oe?(ae=(0,f.jsx)("select",{"aria-label":ne,className:"h-8 rounded-md border border-input bg-transparent px-2 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"bulk-patch-column",id:"bulk-patch-column",onChange:b,value:d,children:oe}),e[56]=d,e[57]=ne,e[58]=oe,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)(rn,{htmlFor:"bulk-patch-value",children:de}),e[62]=de,e[63]=pe):pe=e[63];let xe;e[64]!==m?(xe=(0,f.jsx)(vr,{className:"flex-1 font-mono","data-testid":"bulk-patch-value",id:"bulk-patch-value",onChange:x,placeholder:"true",value:m}),e[64]=m,e[65]=xe):xe=e[65];let we;e[66]!==Y||e[67]!==ae||e[68]!==pe||e[69]!==xe?(we=(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[Y,ae,pe,xe]}),e[66]=Y,e[67]=ae,e[68]=pe,e[69]=xe,e[70]=we):we=e[70];let Se;e[71]!==F?(Se=F!==void 0&&(0,f.jsx)("p",{className:"text-xs text-destructive","data-testid":"bulk-patch-error",role:"alert",children:F}),e[71]=F,e[72]=Se):Se=e[72];let ve;e[73]!==d||e[74]!==u||e[75]!==c||e[76]!==S?(ve=S&&(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:c.toString()})}),e[73]=d,e[74]=u,e[75]=c,e[76]=S,e[77]=ve):ve=e[77];let $;e[78]!==C||e[79]!==u||e[80]!==S?($=C&&!S&&(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]=C,e[79]=u,e[80]=S,e[81]=$):$=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)(oo,{"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 Ae=!y,se;e[91]!==u||e[92]!==c?(se=u("Set on {total} rows",{total:c.toString()}),e[91]=u,e[92]=c,e[93]=se):se=e[93];let Z;e[94]!==P||e[95]!==Ae||e[96]!==se?(Z=(0,f.jsx)(oo,{"data-testid":"bulk-patch-apply",disabled:Ae,onClick:P,size:"xs",children:se}),e[94]=P,e[95]=Ae,e[96]=se,e[97]=Z):Z=e[97];let B;e[98]!==Fe||e[99]!==Z?(B=(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[Fe,Z]}),e[98]=Fe,e[99]=Z,e[100]=B):B=e[100];let De;return e[101]!==r||e[102]!==W||e[103]!==we||e[104]!==Se||e[105]!==ve||e[106]!==$||e[107]!==Q||e[108]!==B||e[109]!==M?(De=(0,f.jsxs)(Ot,{label:M,onClose:r,panelTestId:"bulk-patch-panel",testId:"bulk-patch-overlay",variant:"dialog",children:[W,we,Se,ve,$,Q,B]}),e[101]=r,e[102]=W,e[103]=we,e[104]=Se,e[105]=ve,e[106]=$,e[107]=Q,e[108]=B,e[109]=M,e[110]=De):De=e[110],De},"Do");function ic(t){return(0,f.jsx)("option",{value:t,children:t},t)}n(ic,"Ao");var bs=6,Eo=100,cc=n(t=>({paddingLeft:t*16}),"Po"),uc=n(t=>{let e=(0,G.c)(2),{table:o}=t,l=`cascade-restrict-${o}`,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"),dc=n(t=>{let e=(0,G.c)(2),{table:o}=t,l=`cascade-cascade-${o}`,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},"Oo"),mc=n(t=>{let e=(0,G.c)(2),{table:o}=t,l=`cascade-undeclared-${o}`,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},"Fo"),gc=n(t=>t.relation===void 0||t.relation.onDelete==="cascade"?(0,f.jsx)(dc,{table:t.table}):t.isRestrict?(0,f.jsx)(uc,{table:t.table}):(0,f.jsx)(mc,{table:t.table}),"Mo"),Rs=n(t=>{let e=(0,G.c)(35),{depth:o,node:l}=t,r=`cascade-row-${l.table}`,a;e[0]!==o?(a=cc(o),e[0]=o,e[1]=a):a=e[1];let s;e[2]!==o?(s=o>0&&(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2514"}),e[2]=o,e[3]=s):s=e[3];let c;e[4]!==l.table?(c=(0,f.jsx)("span",{className:"font-medium text-foreground",children:l.table}),e[4]=l.table,e[5]=c):c=e[5];let i;e[6]!==l.relation||e[7]!==l.table?(i=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]=i):i=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=gc(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]!==c||e[22]!==i||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,c,i,d,g,m]}),e[18]=r,e[19]=a,e[20]=s,e[21]=c,e[22]=i,e[23]=d,e[24]=g,e[25]=m,e[26]=h):h=e[26];let p;if(e[27]!==o||e[28]!==l.children){let w;e[30]!==o?(w=n((x,_)=>(0,f.jsx)(Rs,{depth:o+1,node:x},`${x.table}-${x.relation?.field??"root"}-${_.toString()}`),"h"),e[30]=o,e[31]=w):w=e[31],p=l.children.map(w),e[27]=o,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"),fc=n(t=>{let e=t._id??t.id??t.__id__??"";return typeof e=="string"?e:typeof e=="number"?e.toString():""},"Vo"),pc=n(async(t,e,o,l)=>{try{let r=await l(t,e,o),a=r.rows.flatMap(c=>fc(c)||[]).slice(0,Eo),s=r.total??0;return{capNote:s>Eo?`showing first ${Eo.toString()} of ${s.toString()}`:void 0,rowCount:s,rowIds:a}}catch{return{capNote:"count unavailable",rowCount:0,rowIds:[]}}},"Lo"),Fs=n(async(t,e,o,l,r,a,s)=>{let{capNote:c,rowCount:i,rowIds:u}=o===void 0?{capNote:void 0,rowCount:1,rowIds:[e]}:await pc(t,o.field,e,s),d=o?.onDelete==="restrict",g=[],m=`${t}:${e}`,h=a>=bs;if(!r.has(m)&&!h){r.add(m);let b=l.get(t)??[];for(let w of b)for(let x of u.slice(0,10)){let _=await Fs(w.table,x,w,l,r,a+1,s);(_.rowCount>0||a===0)&&g.push(_)}r.delete(m)}let p=c;if(h){let b=`depth capped at ${bs.toString()}`;p=c===void 0?b:`${c}; ${b}`}return{capNote:p,children:g,isRestrict:d,relation:o,rowCount:i,rowIds:u,table:t}},"cn"),bc=n(({onClose:t,onConfirm:e,readPage:o,rowId:l,schema:r,table:a})=>{let s=te(),[c,i]=(0,A.useState)(!0),[u,d]=(0,A.useState)(null),[g,m]=(0,A.useState)(null);(0,A.useEffect)(()=>{let b=!1;return ee((async()=>{try{i(!0),m(null);let w=lc(r);if(!((w.get(a)??[]).length>0)){b||(d({capNote:void 0,children:[],isRestrict:!1,relation:void 0,rowCount:1,rowIds:[l],table:a}),i(!1));return}let x=await Fs(a,l,void 0,w,new Set,0,o);b||(d(x),i(!1))}catch(w){b||(m(w.message),i(!1))}})()),()=>{b=!0}},[l,a]);let h=u!==null&&ac(u,b=>b.isRestrict).length>0,p=n(()=>{e(),t()},"f");return(0,f.jsxs)(Ot,{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")})]}),c&&(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}),!c&&u!==null&&(0,f.jsx)("ul",{className:"flex flex-col","data-testid":"cascade-tree",children:(0,f.jsx)(Rs,{depth:0,node:u})}),!c&&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:c,onClick:p,type:"button",children:s("Delete")})]})]})},"Bo"),hc=n((t,e,o,l,r=300)=>{if(l<=0)return{ids:new Set(t.map(g=>g.id)),leadPx:0,tailPx:0};let a=o-r,s=o+l+r,c=new Set,i=0,u=0,d=0;for(let g of t){let m=g.getSize(),h=e.has(g.id),p=i+m>a&&i<s;h||p?c.add(g.id):i<a?u+=m:d+=m,i+=m}return{ids:c,leadPx:u,tailPx:d}},"jo"),wc=n((t,e)=>{let o=new Map,l=0;for(let r of t)e.has(r.id)&&(o.set(r.id,l),l+=r.getSize());return o},"zo"),Sc={columnOrderingFeature:hn,columnResizingFeature:yn,columnSizingFeature:Cn,columnVisibilityFeature:Mn,rowSelectionFeature:$n,rowSortingFeature:Yn,sortedRowModel:Zn(),sortFns:{alphanumeric:Ln,basic:Ft,datetime:Gn,text:Bn}},_c=n(()=>{let t=(0,G.c)(12),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={},t[0]=e):e=t[0];let[o,l]=(0,A.useState)(e),r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n((b,w,x)=>{l(_=>({..._,[b]:{..._[b],[w]:x}}))},"t"),t[1]=r):r=t[1];let a=r,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=n(()=>{l({})},"l"),t[2]=s):s=t[2];let c=s,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n((b,w)=>{l(x=>{let _=x[b];if(_===void 0)return x;let C=Object.fromEntries(Object.entries(_).filter(F=>{let[v,R]=F;return!(v in w)||!Object.is(R,w[v])}));return Object.keys(C).length===0?Object.fromEntries(Object.entries(x).filter(F=>{let[v]=F;return v!==b})):{...x,[b]:C}})},"a"),t[3]=i):i=t[3];let u=i,d;t[4]!==o?(d=n((b,w)=>{let x=o[b];return x!==void 0&&w in x?{value:x[w]}:void 0},"u"),t[4]=o,t[5]=d):d=t[5];let g=d,m;t[6]!==o?(m=Object.values(o).reduce(vc,0),t[6]=o,t[7]=m):m=t[7];let h=m,p;return t[8]!==h||t[9]!==o||t[10]!==g?(p={clear:c,count:h,drop:u,stage:a,staged:o,stagedValue:g},t[8]=h,t[9]=o,t[10]=g,t[11]=p):p=t[11],p},"Ko"),ks=n((t,e)=>{if(typeof e=="number"){let o=Number(t);return t.trim()===""||Number.isNaN(o)?t:o}if(typeof e=="boolean"){if(t==="true")return!0;if(t==="false")return!1}return t},"dn"),xc=n(t=>{let e=(0,G.c)(29),{changes:o,committing:l,onCommit:r,onDiscard:a}=t,s=te(),c;e[0]!==o.length||e[1]!==s?(c=s("{count} pending changes",{count:o.length}),e[0]=o.length,e[1]=s,e[2]=c):c=e[2];let i;e[3]!==c?(i=(0,f.jsx)("span",{className:"font-mono text-[11px] tracking-wide uppercase text-warning","data-testid":"db-staged-count",children:c}),e[3]=c,e[4]=i):i=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]!==i||e[19]!==d||e[20]!==m?(h=(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[i,d,m]}),e[18]=i,e[19]=d,e[20]=m,e[21]=h):h=e[21];let p;e[22]!==o?(p=o.map(yc),e[22]=o,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 vc(t,e){return t+Object.keys(e).length}n(vc,"Jo");function yc(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:Ee(t.oldValue)}),(0,f.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2192"}),(0,f.jsx)("span",{className:"text-foreground",children:Ee(t.newValue)})]},`${t.rowId}:${t.column}`)}n(yc,"Wo");var hs=400,Cc=36,Rc={flex:"1 1 0%",minHeight:0,overflow:"auto",position:"relative"},Fc={width:"100%"},kc=/\n$/u,Nc={alignItems:"center",display:"flex",left:0,position:"absolute",top:0,width:"100%"},Mc={display:"flex",width:"100%"},ws={flex:"0 0 8.5rem",padding:"0.375rem 0.75rem"},Ic="2.5rem",Ns={alignItems:"center",display:"flex",flex:"0 0 2.5rem",justifyContent:"center",left:0,padding:"0.375rem 0",position:"sticky",zIndex:2},sr=n(t=>({flex:"0 0 auto",overflow:"hidden",padding:"0.375rem 0.75rem",position:"relative",textOverflow:"ellipsis",whiteSpace:"nowrap",width:`${t.toString()}px`}),"Ft"),Ms=n((t,e)=>({...sr(t),left:`calc(${Ic} + ${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",Pc=n((t,e,o)=>e.enabled&&e.columns.has(o)?void 0:t,"ts"),lr="__back__:",Ac=n(t=>`${lr}${t.table}.${t.column}`,"ns"),Dc=n(t=>{let e=(0,G.c)(3),{counts:o,rowId:l}=t;if(o===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=o[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"),Ye=n(t=>{for(let e of["id","__id__","_id"]){let o=t[e];if(typeof o=="string"||typeof o=="number")return String(o)}return null},"Ie"),Tc=n((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 o=Number(t);return t.trim()===""||!Number.isFinite(o)?void 0:{value:o}}return{value:t}},"ss"),Oc=n((t,e,o)=>{if(o!==void 0&&o.type!=="any")return Tc(t,o);let l=ks(t,e);return typeof e=="number"&&typeof l!="number"?void 0:{value:l}},"ls"),Vc=n(({anchor:t,columnIds:e,columnMeta:o,editableColumn:l,rows:r,text:a})=>{let s=a.replaceAll(`\r
3
3
  `,`
4
4
  `).replace(kc,"").split(`
@@ -0,0 +1,8 @@
1
+ import{a as i}from"./chunk-5PEAXTYQ.js";var m=i(r=>{let t=String(r.name),e=String(r.message);return e===""?t:`${t}: ${e}`},"A"),g=i(r=>{if(typeof r=="string")return r;if(r instanceof Error)return m(r);try{return JSON.stringify(r)??String(r)}catch{return String(r)}},"a"),p=i(r=>typeof r=="object"&&r!==null&&!Array.isArray(r),"R"),h=i(r=>p(r)&&typeof r.name=="string"&&typeof r.message=="string"?r:void 0,"$"),y=i(r=>{let t=r;if(typeof r=="string"){if(!r.startsWith("{")||!r.endsWith("}"))return;try{t=JSON.parse(r)}catch{return}}let e=h(t);return e!==void 0&&(typeof e.stack=="string"||e.cause!==void 0||Array.isArray(e.errors))?e:void 0},"d"),f=i(r=>r.message===""?r.name:`${r.name}: ${r.message}`,"g"),d=/^[\w$.]+$/u,S=i(r=>{if(typeof r.stack!="string")return[];let t=r.stack,e=r.message===""?-1:t.indexOf(r.message),n=e===-1?"":t.slice(0,e);return e>0&&n.endsWith(": ")&&!n.includes(`
2
+ `)?t=t.slice(e+r.message.length):r.message===""&&d.test(t.split(`
3
+ `,1)[0]??"")&&(t=t.slice((t.split(`
4
+ `,1)[0]??"").length)),t.split(`
5
+ `).map(o=>o.trim()).filter(o=>o!=="")},"m"),l=i((r,t,e=0)=>{let n=`${t} `,o=[f(r),...S(r).map(s=>`${n}${s}`)],a=i((s,c)=>{let u=h(c);return u===void 0?`${t}${s}: ${g(c)}`:`${t}${s}: ${e>=4?f(u):l(u,n,e+1).join(`
6
+ `)}`},"o");return Array.isArray(r.errors)&&r.errors.slice(0,10).forEach((s,c)=>{o.push(a(`errors[${String(c)}]`,s))}),r.cause!==void 0&&o.push(a("caused by",r.cause)),o},"y"),v=i((r,t="")=>r.map(([e,n])=>`${t}${e}: ${l(n,`${t} `).join(`
7
+ `)}`).join(`
8
+ `),"O"),A=i(r=>{if(typeof r!="string")return r;if(!(!(r.startsWith("{")&&r.endsWith("}"))&&!(r.startsWith("[")&&r.endsWith("]"))))try{return JSON.parse(r)}catch{return}},"_"),$=i((r,t,e,n)=>{if(n.length>=10||e>=8||typeof r!="object"||r===null)return;let o=y(r);if(o!==void 0){n.push([t,o]);return}if(Array.isArray(r)){r.forEach((a,s)=>{$(a,`${t}[${String(s)}]`,e+1,n)});return}for(let[a,s]of Object.entries(r))$(s,`${t}.${a}`,e+1,n)},"E"),j=i(r=>{if(!p(r))return{errors:[],text:""};let t=[],e=[];for(let[n,o]of Object.entries(r)){let a=y(o);if(a===void 0){e.push(`${n}=${g(o)}`);let s=[];$(A(o),n,0,s),t.push(...s)}else t.push([n,a]),e.push(`${n}=${f(a)}`)}return{errors:t,text:e.join(" ")}},"h"),O=i(r=>j(r).text,"S");export{v as a,j as b,O as c};
@@ -1 +1 @@
1
- import{c as u}from"./chunk-SCTYLLJT.js";import{j as c}from"./chunk-L27FKJTG.js";import{a as l}from"./chunk-ZPQBVYNN.js";import{x as d}from"./chunk-OYCDWIG2.js";import{a as h,b as z}from"./chunk-ADABTCDI.js";import{a as t,d as o}from"./chunk-5PEAXTYQ.js";var p=o(h(),1);var a=p.forwardRef(t(function(e,r){let{render:n,className:k,disabled:s=!1,focusableWhenDisabled:g=!1,nativeButton:f=!0,style:B,...b}=e,{getButtonProps:m,buttonRef:x}=u({disabled:s,focusableWhenDisabled:g,native:f});return c("button",e,{state:{disabled:s},ref:[r,x],props:[b,m]})},"Button"));var v=o(z(),1);var y=l("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function W({className:i,variant:e="default",size:r="default",...n}){return(0,v.jsx)(a,{"data-slot":"button",className:d(y({variant:e,size:r,className:i})),...n})}t(W,"v");export{W as a};
1
+ import{c as u}from"./chunk-SCTYLLJT.js";import{j as c}from"./chunk-L27FKJTG.js";import{a as l}from"./chunk-ZPQBVYNN.js";import{x as d}from"./chunk-JEKJEGBJ.js";import{a as h,b as z}from"./chunk-ADABTCDI.js";import{a as t,d as o}from"./chunk-5PEAXTYQ.js";var p=o(h(),1);var a=p.forwardRef(t(function(e,r){let{render:n,className:k,disabled:s=!1,focusableWhenDisabled:g=!1,nativeButton:f=!0,style:B,...b}=e,{getButtonProps:m,buttonRef:x}=u({disabled:s,focusableWhenDisabled:g,native:f});return c("button",e,{state:{disabled:s},ref:[r,x],props:[b,m]})},"Button"));var v=o(z(),1);var y=l("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function W({className:i,variant:e="default",size:r="default",...n}){return(0,v.jsx)(a,{"data-slot":"button",className:d(y({variant:e,size:r,className:i})),...n})}t(W,"v");export{W as a};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-BS77NGL6.js";import{a as L}from"./chunk-K7Z7UTJJ.js";import{b as S}from"./chunk-XMJB5JOF.js";import"./chunk-L27FKJTG.js";import{a as T,b as k,c as A,d as g,e as c,f as l}from"./chunk-VSYZL2WH.js";import"./chunk-EOFWXI3T.js";import{a as C}from"./chunk-LYVYUTQY.js";import{c as w}from"./chunk-P37L55FP.js";import{a as I,e as $}from"./chunk-D76SLSGV.js";import"./chunk-K24LZAP2.js";import"./chunk-ZPQBVYNN.js";import{B as b}from"./chunk-OYCDWIG2.js";import"./chunk-PDBW6GTJ.js";import{a as _}from"./chunk-A6TVTNKO.js";import{b as j}from"./chunk-ADABTCDI.js";import{a as f,d as y}from"./chunk-5PEAXTYQ.js";var O=y(_(),1);var t=y(j(),1);var E="container:",M={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},B=f(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"B"),P=f(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(E))continue;let i=a.slice(E.length);if(i==="")continue;let s=JSON.stringify([i,r.instance??""]),o=n.get(s);if(o!==void 0&&o.timestamp>=r.timestamp)continue;let{detail:p,event:d}=B(r.message);n.set(s,{detail:p,event:d,exitCode:r.exitCode,instance:r.instance,level:r.level,name:i,state:M[d]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"D"),W={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},q=f(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"P"),V=f(()=>{let e=(0,O.c)(19),n=b(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:i,error:s,liveError:o}=w(C.getLogs,r,a),p=i!==void 0,d;if(e[2]!==i||e[3]!==s||e[4]!==o||e[5]!==p||e[6]!==n){let N=P(q(i)),x;e[8]!==s?(x=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:s}),e[8]=s,e[9]=x):x=e[9];let m;e[10]!==n?(m=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[10]=n,e[11]=m):m=e[11];let u;e[12]!==m?(u=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;e[14]!==o?(h=(0,t.jsx)(D,{message:o,prefix:"containers"}),e[14]=o,e[15]=h):h=e[15];let v;e[16]!==u||e[17]!==h?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,h]}),e[16]=u,e[17]=h,e[18]=v):v=e[18],d=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[x,v,p&&N.length===0?(0,t.jsx)(L,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(I,{className:"overflow-hidden py-0",children:(0,t.jsx)($,{className:"px-0",children:(0,t.jsxs)(T,{"data-testid":"containers-table",children:[(0,t.jsx)(k,{children:(0,t.jsxs)(g,{children:[(0,t.jsx)(c,{children:n("Container")}),(0,t.jsx)(c,{children:n("Instance")}),(0,t.jsx)(c,{children:n("State")}),(0,t.jsx)(c,{children:n("Last event")}),(0,t.jsx)(c,{children:n("Detail")}),(0,t.jsx)(c,{children:n("Exit")}),(0,t.jsx)(c,{children:n("When")})]})}),(0,t.jsx)(A,{children:N.map(F)})]})})})]}),e[2]=i,e[3]=s,e[4]=o,e[5]=p,e[6]=n,e[7]=d}else d=e[7];return d},"q");function F(e){return(0,t.jsxs)(g,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(l,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(l,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(l,{children:(0,t.jsx)(S,{variant:W[e.state],children:e.state})}),(0,t.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(l,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(l,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(l,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}f(F,"j");export{V as default};
1
+ import{a as D}from"./chunk-UDGBH3IC.js";import{a as L}from"./chunk-KN4GQKJS.js";import{b as S}from"./chunk-YCQ7ZPBP.js";import"./chunk-L27FKJTG.js";import{a as T,b as k,c as A,d as g,e as c,f as l}from"./chunk-YM56MNAN.js";import"./chunk-EOFWXI3T.js";import{a as C}from"./chunk-LYVYUTQY.js";import{c as w}from"./chunk-L62S7I64.js";import{a as I,e as $}from"./chunk-JXGB4QDO.js";import"./chunk-OW7PWUF6.js";import"./chunk-ZPQBVYNN.js";import{B as b}from"./chunk-JEKJEGBJ.js";import"./chunk-PDBW6GTJ.js";import{a as _}from"./chunk-A6TVTNKO.js";import{b as j}from"./chunk-ADABTCDI.js";import{a as f,d as y}from"./chunk-5PEAXTYQ.js";var O=y(_(),1);var t=y(j(),1);var E="container:",M={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},B=f(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"B"),P=f(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(E))continue;let i=a.slice(E.length);if(i==="")continue;let s=JSON.stringify([i,r.instance??""]),o=n.get(s);if(o!==void 0&&o.timestamp>=r.timestamp)continue;let{detail:p,event:d}=B(r.message);n.set(s,{detail:p,event:d,exitCode:r.exitCode,instance:r.instance,level:r.level,name:i,state:M[d]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"D"),W={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},q=f(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"P"),V=f(()=>{let e=(0,O.c)(19),n=b(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:i,error:s,liveError:o}=w(C.getLogs,r,a),p=i!==void 0,d;if(e[2]!==i||e[3]!==s||e[4]!==o||e[5]!==p||e[6]!==n){let N=P(q(i)),x;e[8]!==s?(x=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:s}),e[8]=s,e[9]=x):x=e[9];let m;e[10]!==n?(m=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[10]=n,e[11]=m):m=e[11];let u;e[12]!==m?(u=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[12]=m,e[13]=u):u=e[13];let h;e[14]!==o?(h=(0,t.jsx)(D,{message:o,prefix:"containers"}),e[14]=o,e[15]=h):h=e[15];let v;e[16]!==u||e[17]!==h?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,h]}),e[16]=u,e[17]=h,e[18]=v):v=e[18],d=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[x,v,p&&N.length===0?(0,t.jsx)(L,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(I,{className:"overflow-hidden py-0",children:(0,t.jsx)($,{className:"px-0",children:(0,t.jsxs)(T,{"data-testid":"containers-table",children:[(0,t.jsx)(k,{children:(0,t.jsxs)(g,{children:[(0,t.jsx)(c,{children:n("Container")}),(0,t.jsx)(c,{children:n("Instance")}),(0,t.jsx)(c,{children:n("State")}),(0,t.jsx)(c,{children:n("Last event")}),(0,t.jsx)(c,{children:n("Detail")}),(0,t.jsx)(c,{children:n("Exit")}),(0,t.jsx)(c,{children:n("When")})]})}),(0,t.jsx)(A,{children:N.map(F)})]})})})]}),e[2]=i,e[3]=s,e[4]=o,e[5]=p,e[6]=n,e[7]=d}else d=e[7];return d},"q");function F(e){return(0,t.jsxs)(g,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(l,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(l,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(l,{children:(0,t.jsx)(S,{variant:W[e.state],children:e.state})}),(0,t.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(l,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(l,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(l,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}f(F,"j");export{V as default};
@@ -1 +1 @@
1
- import{a as _}from"./chunk-K7Z7UTJJ.js";import{b as j}from"./chunk-XMJB5JOF.js";import"./chunk-L27FKJTG.js";import{a as J}from"./chunk-2BCNWFC5.js";import"./chunk-CTIZP3XO.js";import{a as E,b as G,c as L,d as I,e as c,f as p}from"./chunk-VSYZL2WH.js";import"./chunk-GWRKSV2Q.js";import{b as q}from"./chunk-IAVAD545.js";import"./chunk-EOFWXI3T.js";import{a as O}from"./chunk-LYVYUTQY.js";import{c as H}from"./chunk-P37L55FP.js";import{a as D,e as W}from"./chunk-D76SLSGV.js";import"./chunk-K24LZAP2.js";import"./chunk-ZPQBVYNN.js";import{B as z}from"./chunk-OYCDWIG2.js";import"./chunk-PDBW6GTJ.js";import{a as Q}from"./chunk-A6TVTNKO.js";import{b as V}from"./chunk-ADABTCDI.js";import{a as d,d as F}from"./chunk-5PEAXTYQ.js";var K=F(Q(),1);var r=F(V(),1);var U=["read","insert","update","delete"],M=30,X=d((e,t)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[t],"z"),Y=d(e=>{let t=new Map;for(let s of e){let a=t.get(s.table)??{operations:new Set,procedures:new Set,table:s.table};a.operations.add(s.on),a.procedures.add(s.procedure),t.set(s.table,a)}return[...t.values()].toSorted((s,a)=>s.table.localeCompare(a.table))},"J"),Z=d(e=>{let t=e.slice(0,M).map(s=>`${s.table}: ${U.filter(a=>s.operations.has(a)).join("/")}`).join("; ");return e.length>M?`${t}; and ${String(e.length-M)} more tables`:t},"K"),pe=d(()=>{let e=(0,K.c)(45),t=z(),s=q(),a=s!==void 0&&!s.unavailable,k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];let{data:l,error:C,errorSource:P}=H(O.rlsPolicies,k),o=l!==void 0,m;e[1]!==l?(m=Array.isArray(l?.policies)?l.policies:[],e[1]=l,e[2]=m):m=e[2];let S;e[3]!==m?(S=Y(m),e[3]=m,e[4]=S):S=e[4];let i=S,R;e[5]!==l?(R=Array.isArray(l?.roles)?l.roles:[],e[5]=l,e[6]=R):R=e[6];let T=R,h;e[7]!==C||e[8]!==P?(h=C!==null&&(0,r.jsx)(J,{error:P,testId:"rls-error"}),e[7]=C,e[8]=P,e[9]=h):h=e[9];let u;e[10]!==t?(u=t("Policies"),e[10]=t,e[11]=u):u=e[11];let f;e[12]!==u?(f=(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:u}),e[12]=u,e[13]=f):f=e[13];let b;e[14]!==s||e[15]!==a||e[16]!==o||e[17]!==t||e[18]!==i?(b=o&&a&&(0,r.jsx)("button",{className:"ms-auto text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"rls-ask-assistant",onClick:d(()=>{s.openAssistant({ask:i.length===0?t("This app declares no row-level-security policies at all. Which tables most need one, and what policy should I write for them?"):t("The Lunora RLS inspector shows these declared policies \u2014 {coverage}. Which tables and operations are still unguarded, and what policy should I add?",{coverage:Z(i)}),suggestions:[t("Which procedures still need .use(rls(...))?"),t("How do I test a policy?")],title:t("Access rules")})},"onClick"),type:"button",children:t("Ask the assistant")}),e[14]=s,e[15]=a,e[16]=o,e[17]=t,e[18]=i,e[19]=b):b=e[19];let x;e[20]!==f||e[21]!==b?(x=(0,r.jsxs)("header",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[f,b]}),e[20]=f,e[21]=b,e[22]=x):x=e[22];let g;e[23]!==o||e[24]!==t||e[25]!==i?(g=o&&i.length===0?(0,r.jsx)(_,{description:t("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:t("No policies defined")}):(0,r.jsx)(W,{className:"px-0",children:(0,r.jsxs)(E,{"data-testid":"rls-policies-table",children:[(0,r.jsx)(G,{children:(0,r.jsxs)(I,{children:[(0,r.jsx)(c,{children:t("Table")}),U.map(n=>(0,r.jsx)(c,{children:X(t,n)},n)),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(L,{children:i.map(n=>(0,r.jsxs)(I,{"data-testid":`rls-table-${n.table}`,children:[(0,r.jsx)(p,{className:"font-mono text-xs",children:n.table}),U.map(B=>(0,r.jsx)(p,{children:n.operations.has(B)?(0,r.jsx)(j,{variant:"secondary",children:t("Guarded")}):(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"})},B)),(0,r.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:[...n.procedures].join(", ")})]},n.table))})]})}),e[23]=o,e[24]=t,e[25]=i,e[26]=g):g=e[26];let N;e[27]!==x||e[28]!==g?(N=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[x,g]})}),e[27]=x,e[28]=g,e[29]=N):N=e[29];let y;e[30]!==t?(y=t("Roles"),e[30]=t,e[31]=y):y=e[31];let w;e[32]!==y?(w=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y})}),e[32]=y,e[33]=w):w=e[33];let v;e[34]!==o||e[35]!==T||e[36]!==t?(v=o&&T.length===0?(0,r.jsx)(_,{description:t("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:t("No roles defined")}):(0,r.jsx)(W,{className:"px-0",children:(0,r.jsxs)(E,{"data-testid":"rls-roles-table",children:[(0,r.jsx)(G,{children:(0,r.jsxs)(I,{children:[(0,r.jsx)(c,{children:t("Role")}),(0,r.jsx)(c,{children:t("Description")}),(0,r.jsx)(c,{children:t("Permissions")})]})}),(0,r.jsx)(L,{children:T.map(re)})]})}),e[34]=o,e[35]=T,e[36]=t,e[37]=v):v=e[37];let A;e[38]!==w||e[39]!==v?(A=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[w,v]})}),e[38]=w,e[39]=v,e[40]=A):A=e[40];let $;return e[41]!==N||e[42]!==A||e[43]!==h?($=(0,r.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-rls-panel",children:[h,N,A]}),e[41]=N,e[42]=A,e[43]=h,e[44]=$):$=e[44],$},"ce");function ee(e){return(0,r.jsx)(j,{variant:"outline",children:e},e)}d(ee,"V");function re(e){return(0,r.jsxs)(I,{"data-testid":`rls-role-${e.name}`,children:[(0,r.jsx)(p,{className:"font-mono text-xs",children:e.name}),(0,r.jsx)(p,{className:"text-muted-foreground",children:e.description??""}),(0,r.jsx)(p,{children:e.permissions.length===0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,r.jsx)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(ee)})})]},e.name)}d(re,"Y");export{pe as default};
1
+ import{a as _}from"./chunk-KN4GQKJS.js";import{b as j}from"./chunk-YCQ7ZPBP.js";import"./chunk-L27FKJTG.js";import{a as J}from"./chunk-4UMUJTD2.js";import"./chunk-CYL7MEO2.js";import{a as E,b as G,c as L,d as I,e as c,f as p}from"./chunk-YM56MNAN.js";import"./chunk-IXBHUFDE.js";import{b as q}from"./chunk-B2GQMLO3.js";import"./chunk-EOFWXI3T.js";import{a as O}from"./chunk-LYVYUTQY.js";import{c as H}from"./chunk-L62S7I64.js";import{a as D,e as W}from"./chunk-JXGB4QDO.js";import"./chunk-OW7PWUF6.js";import"./chunk-ZPQBVYNN.js";import{B as z}from"./chunk-JEKJEGBJ.js";import"./chunk-PDBW6GTJ.js";import{a as Q}from"./chunk-A6TVTNKO.js";import{b as V}from"./chunk-ADABTCDI.js";import{a as d,d as F}from"./chunk-5PEAXTYQ.js";var K=F(Q(),1);var r=F(V(),1);var U=["read","insert","update","delete"],M=30,X=d((e,t)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[t],"z"),Y=d(e=>{let t=new Map;for(let s of e){let a=t.get(s.table)??{operations:new Set,procedures:new Set,table:s.table};a.operations.add(s.on),a.procedures.add(s.procedure),t.set(s.table,a)}return[...t.values()].toSorted((s,a)=>s.table.localeCompare(a.table))},"J"),Z=d(e=>{let t=e.slice(0,M).map(s=>`${s.table}: ${U.filter(a=>s.operations.has(a)).join("/")}`).join("; ");return e.length>M?`${t}; and ${String(e.length-M)} more tables`:t},"K"),pe=d(()=>{let e=(0,K.c)(45),t=z(),s=q(),a=s!==void 0&&!s.unavailable,k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={},e[0]=k):k=e[0];let{data:l,error:C,errorSource:P}=H(O.rlsPolicies,k),o=l!==void 0,m;e[1]!==l?(m=Array.isArray(l?.policies)?l.policies:[],e[1]=l,e[2]=m):m=e[2];let S;e[3]!==m?(S=Y(m),e[3]=m,e[4]=S):S=e[4];let i=S,R;e[5]!==l?(R=Array.isArray(l?.roles)?l.roles:[],e[5]=l,e[6]=R):R=e[6];let T=R,h;e[7]!==C||e[8]!==P?(h=C!==null&&(0,r.jsx)(J,{error:P,testId:"rls-error"}),e[7]=C,e[8]=P,e[9]=h):h=e[9];let u;e[10]!==t?(u=t("Policies"),e[10]=t,e[11]=u):u=e[11];let f;e[12]!==u?(f=(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:u}),e[12]=u,e[13]=f):f=e[13];let b;e[14]!==s||e[15]!==a||e[16]!==o||e[17]!==t||e[18]!==i?(b=o&&a&&(0,r.jsx)("button",{className:"ms-auto text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"rls-ask-assistant",onClick:d(()=>{s.openAssistant({ask:i.length===0?t("This app declares no row-level-security policies at all. Which tables most need one, and what policy should I write for them?"):t("The Lunora RLS inspector shows these declared policies \u2014 {coverage}. Which tables and operations are still unguarded, and what policy should I add?",{coverage:Z(i)}),suggestions:[t("Which procedures still need .use(rls(...))?"),t("How do I test a policy?")],title:t("Access rules")})},"onClick"),type:"button",children:t("Ask the assistant")}),e[14]=s,e[15]=a,e[16]=o,e[17]=t,e[18]=i,e[19]=b):b=e[19];let x;e[20]!==f||e[21]!==b?(x=(0,r.jsxs)("header",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[f,b]}),e[20]=f,e[21]=b,e[22]=x):x=e[22];let g;e[23]!==o||e[24]!==t||e[25]!==i?(g=o&&i.length===0?(0,r.jsx)(_,{description:t("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:t("No policies defined")}):(0,r.jsx)(W,{className:"px-0",children:(0,r.jsxs)(E,{"data-testid":"rls-policies-table",children:[(0,r.jsx)(G,{children:(0,r.jsxs)(I,{children:[(0,r.jsx)(c,{children:t("Table")}),U.map(n=>(0,r.jsx)(c,{children:X(t,n)},n)),(0,r.jsx)(c,{children:t("Guarded by")})]})}),(0,r.jsx)(L,{children:i.map(n=>(0,r.jsxs)(I,{"data-testid":`rls-table-${n.table}`,children:[(0,r.jsx)(p,{className:"font-mono text-xs",children:n.table}),U.map(B=>(0,r.jsx)(p,{children:n.operations.has(B)?(0,r.jsx)(j,{variant:"secondary",children:t("Guarded")}):(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"})},B)),(0,r.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:[...n.procedures].join(", ")})]},n.table))})]})}),e[23]=o,e[24]=t,e[25]=i,e[26]=g):g=e[26];let N;e[27]!==x||e[28]!==g?(N=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[x,g]})}),e[27]=x,e[28]=g,e[29]=N):N=e[29];let y;e[30]!==t?(y=t("Roles"),e[30]=t,e[31]=y):y=e[31];let w;e[32]!==y?(w=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y})}),e[32]=y,e[33]=w):w=e[33];let v;e[34]!==o||e[35]!==T||e[36]!==t?(v=o&&T.length===0?(0,r.jsx)(_,{description:t("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:t("No roles defined")}):(0,r.jsx)(W,{className:"px-0",children:(0,r.jsxs)(E,{"data-testid":"rls-roles-table",children:[(0,r.jsx)(G,{children:(0,r.jsxs)(I,{children:[(0,r.jsx)(c,{children:t("Role")}),(0,r.jsx)(c,{children:t("Description")}),(0,r.jsx)(c,{children:t("Permissions")})]})}),(0,r.jsx)(L,{children:T.map(re)})]})}),e[34]=o,e[35]=T,e[36]=t,e[37]=v):v=e[37];let A;e[38]!==w||e[39]!==v?(A=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(D,{className:"overflow-hidden py-0",children:[w,v]})}),e[38]=w,e[39]=v,e[40]=A):A=e[40];let $;return e[41]!==N||e[42]!==A||e[43]!==h?($=(0,r.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-rls-panel",children:[h,N,A]}),e[41]=N,e[42]=A,e[43]=h,e[44]=$):$=e[44],$},"ce");function ee(e){return(0,r.jsx)(j,{variant:"outline",children:e},e)}d(ee,"V");function re(e){return(0,r.jsxs)(I,{"data-testid":`rls-role-${e.name}`,children:[(0,r.jsx)(p,{className:"font-mono text-xs",children:e.name}),(0,r.jsx)(p,{className:"text-muted-foreground",children:e.description??""}),(0,r.jsx)(p,{children:e.permissions.length===0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,r.jsx)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(ee)})})]},e.name)}d(re,"Y");export{pe as default};