@lunora/studio 1.0.0-alpha.356 → 1.0.0-alpha.358
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/{chunk-Q5GY7D5H.js → chunk-2CPBNLFU.js} +1 -1
- package/dist/standalone/{chunk-YHK5UBXI.js → chunk-3HX723U6.js} +1 -1
- package/dist/standalone/{chunk-GNVWTK4S.js → chunk-4FZYH76L.js} +1 -1
- package/dist/standalone/{chunk-FIJVZCBO.js → chunk-5IGDDSST.js} +1 -1
- package/dist/standalone/{chunk-SL7LF2SO.js → chunk-5SYMAYUA.js} +1 -1
- package/dist/standalone/{chunk-SPPJFTWE.js → chunk-7KPRMBD6.js} +1 -1
- package/dist/standalone/{chunk-SOVH524I.js → chunk-AKGGWCWW.js} +1 -1
- package/dist/standalone/{chunk-Z3NZJ4C2.js → chunk-AN2L3XHC.js} +1 -1
- package/dist/standalone/{chunk-MQ3FFFP4.js → chunk-B4BK5Q5O.js} +1 -1
- package/dist/standalone/{chunk-TIQ3NI77.js → chunk-B6OTKSMY.js} +1 -1
- package/dist/standalone/{chunk-DN3HPAOA.js → chunk-BCP3MEB3.js} +1 -1
- package/dist/standalone/{chunk-F7GMBSJP.js → chunk-CVUNFP54.js} +1 -1
- package/dist/standalone/{chunk-S6OBDEAQ.js → chunk-CZACJYDC.js} +1 -1
- package/dist/standalone/{chunk-VO6GV6F2.js → chunk-DPESH5MT.js} +1 -1
- package/dist/standalone/{chunk-N5FOHLIG.js → chunk-EAZXULX6.js} +1 -1
- package/dist/standalone/{chunk-CDV6T5KM.js → chunk-F4VO76XV.js} +1 -1
- package/dist/standalone/{chunk-ILLDX6LU.js → chunk-FACE2CFY.js} +1 -1
- package/dist/standalone/{chunk-64S3IDR2.js → chunk-FCRSF54M.js} +1 -1
- package/dist/standalone/{chunk-XFTWGZKD.js → chunk-FHGTI6PR.js} +1 -1
- package/dist/standalone/{chunk-CHGMDVEQ.js → chunk-FMQ72AKG.js} +1 -1
- package/dist/standalone/{chunk-NQX6SAC6.js → chunk-FNUPPZKJ.js} +1 -1
- package/dist/standalone/{chunk-ESUUPILO.js → chunk-FRN6D6MP.js} +1 -1
- package/dist/standalone/{chunk-D5LY65EX.js → chunk-FSWWDMW2.js} +1 -1
- package/dist/standalone/{chunk-VPG46PCA.js → chunk-FYWZRJCT.js} +1 -1
- package/dist/standalone/{chunk-IMF6DJKL.js → chunk-GMO7IUXO.js} +1 -1
- package/dist/standalone/{chunk-OGKRWT6I.js → chunk-HGT4YHTI.js} +1 -1
- package/dist/standalone/{chunk-EEPCLLGE.js → chunk-HONLEKH5.js} +1 -1
- package/dist/standalone/{chunk-SV34MAIK.js → chunk-HSLO46OW.js} +1 -1
- package/dist/standalone/{chunk-UWAVY3IF.js → chunk-IIJXS3KP.js} +1 -1
- package/dist/standalone/{chunk-UHGLZ5RV.js → chunk-IWG2D7QS.js} +1 -1
- package/dist/standalone/{chunk-R66XCM3J.js → chunk-JYCRY3LM.js} +1 -1
- package/dist/standalone/{chunk-7DMOBHYC.js → chunk-KRDWV6YM.js} +1 -1
- package/dist/standalone/{chunk-RNHTOEL7.js → chunk-KRH6UDVU.js} +1 -1
- package/dist/standalone/{chunk-M3KSCNKR.js → chunk-LVNPLZDL.js} +1 -1
- package/dist/standalone/{chunk-ZXUEBA56.js → chunk-MC577GI5.js} +1 -1
- package/dist/standalone/{chunk-U2YFL6EA.js → chunk-MHJNM7VT.js} +1 -1
- package/dist/standalone/{chunk-3QGR4DC7.js → chunk-MI7DM536.js} +1 -1
- package/dist/standalone/{chunk-I2PP6Q6F.js → chunk-MY7ZGJOD.js} +1 -1
- package/dist/standalone/{chunk-E423VRTC.js → chunk-N4AWDORA.js} +1 -1
- package/dist/standalone/{chunk-O6XMGPGY.js → chunk-NEZRBBPI.js} +1 -1
- package/dist/standalone/{chunk-YJYXN3WQ.js → chunk-NSUOMZWM.js} +1 -1
- package/dist/standalone/{chunk-NXNUGQHB.js → chunk-OIBN6KMM.js} +1 -1
- package/dist/standalone/{chunk-R5ACA3OC.js → chunk-OSQYIZAV.js} +1 -1
- package/dist/standalone/{chunk-AZRUSOAH.js → chunk-OX7I5YHU.js} +1 -1
- package/dist/standalone/{chunk-QSNQXPIX.js → chunk-PBKTGB7B.js} +1 -1
- package/dist/standalone/{chunk-GZX5XABE.js → chunk-PCMV6S7K.js} +1 -1
- package/dist/standalone/{chunk-OT4KZ6Y6.js → chunk-PMGNJZYE.js} +1 -1
- package/dist/standalone/{chunk-BCIFRJ3Q.js → chunk-PTCC45P7.js} +1 -1
- package/dist/standalone/{chunk-AMLIZFTD.js → chunk-QXHMVPS3.js} +1 -1
- package/dist/standalone/{chunk-TNII7Q2L.js → chunk-SUOVLXY6.js} +1 -1
- package/dist/standalone/{chunk-DUQ7KXNS.js → chunk-TA3DCQUA.js} +1 -1
- package/dist/standalone/{chunk-5KD75VXP.js → chunk-UFPN44MP.js} +1 -1
- package/dist/standalone/{chunk-7W6WESSS.js → chunk-V6SVNLUM.js} +1 -1
- package/dist/standalone/{chunk-4SJDWMH3.js → chunk-W37HRJGQ.js} +1 -1
- package/dist/standalone/{chunk-ZZ5564FZ.js → chunk-WC5QFZYZ.js} +1 -1
- package/dist/standalone/{chunk-FXTT2XP3.js → chunk-WCWSMX3N.js} +1 -1
- package/dist/standalone/{chunk-OKSZWLJX.js → chunk-WOGVVXGF.js} +1 -1
- package/dist/standalone/{chunk-4BNWYVLP.js → chunk-XIVWJUD3.js} +1 -1
- package/dist/standalone/{chunk-2CWGRQ5L.js → chunk-XZ6B5XNN.js} +1 -1
- package/dist/standalone/{chunk-AQJXOPBW.js → chunk-XZKWGTLI.js} +1 -1
- package/dist/standalone/{chunk-TAGWTOFD.js → chunk-ZD53YB3L.js} +1 -1
- package/dist/standalone/{chunk-5IIX2STA.js → chunk-ZFFZWSDJ.js} +1 -1
- package/dist/standalone/{chunk-2PHY5V5E.js → chunk-ZQOPXQIT.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +5 -5
- /package/dist/standalone/{chunk-FKM35PXF.js → chunk-SDSQIQJG.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Me}from"./chunk-LRXCL6IA.js";import{a as ve}from"./chunk-R36QXQZX.js";import{b as ye,c as we}from"./chunk-IH2CJZF2.js";import{a as xe}from"./chunk-YJWR6ZWC.js";import{a as Ne}from"./chunk-XBZUJDHD.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import{a as be}from"./chunk-5DNGK3NT.js";import{a as fe}from"./chunk-KYONGQQ4.js";import{b as he}from"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import{i as me}from"./chunk-SDQH4HR6.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as oe}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{a as ge}from"./chunk-IMF6DJKL.js";import"./chunk-OSJ7HV7B.js";import"./chunk-SL7LF2SO.js";import"./chunk-E26OT26O.js";import{a as ce}from"./chunk-6UTZXEW3.js";import{c as ie}from"./chunk-4SJDWMH3.js";import"./chunk-FKM35PXF.js";import"./chunk-WZTY3ZYI.js";import{a as ue}from"./chunk-3Y5K3IQO.js";import{b as te,f as U,p as pe,w as de}from"./chunk-LPINY2IJ.js";import{a as m,d as le,e as Ce,f as Le,g as Te}from"./chunk-OXFKZ4BM.js";var O=le(Le(),1),A=le(Ce(),1);var s=le(Te(),1);var Pe=.5,Ie=4,Se=m(n=>Math.min(100,Math.max(0,n)),"ce"),Ke=m((n,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=Se(n.offsetMs/e*100),a=n.durationMs/e*100,l=Math.max(Pe,Math.min(Se(a),100-t));return{leftPercent:t,widthPercent:l}},"Ce"),De=m((n,e,t=!1)=>{let a=e.trim().toLowerCase(),l=t?n.filter(r=>!r.ok):n;return a===""?[...l]:l.filter(r=>r.rootName.toLowerCase().includes(a)||r.functionPath.toLowerCase().includes(a)||r.traceId.toLowerCase().includes(a)||r.spans.some(o=>o.name.toLowerCase().includes(a)||o.spanId.toLowerCase().includes(a)))},"Ee"),G=m(n=>Number.isFinite(n)?n>0&&n<1?`${n.toFixed(2)}ms`:`${String(Math.round(n))}ms`:"\u2014","q"),Fe=m(n=>!Number.isFinite(n)||n<=0?[]:Array.from({length:Ie},(e,t)=>{let a=(t+1)/Ie;return{label:G(n*a),percent:a*100}}),"Pe"),ke=m(n=>{if(typeof n=="string")return n;try{return JSON.stringify(n,pe)}catch{return String(n)}},"ue"),ee=m(n=>{let e=(0,O.c)(7),{label:t,value:a}=n,l;e[0]!==t?(l=(0,s.jsx)("dt",{className:"w-40 shrink-0 text-muted-foreground",children:t}),e[0]=t,e[1]=l):l=e[1];let r;e[2]!==a?(r=(0,s.jsx)("dd",{className:"min-w-0 break-all",children:a}),e[2]=a,e[3]=r):r=e[3];let o;return e[4]!==l||e[5]!==r?(o=(0,s.jsxs)("div",{className:"flex gap-2",children:[l,r]}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o},"Y"),je=m(n=>{let e=(0,O.c)(68),{span:t}=n,a=U(),l,r,o,d,i,u;if(e[0]!==t.attributes||e[1]!==t.durationMs||e[2]!==t.error||e[3]!==t.events||e[4]!==t.kind||e[5]!==t.offsetMs||e[6]!==t.parentSpanId||e[7]!==t.spanId||e[8]!==a){let $=Object.entries(t.attributes??{}),_;e[15]!==t.events?(_=t.events??[],e[15]=t.events,e[16]=_):_=e[16],l=_,r="border-t border-border bg-background/60 px-3 py-2 font-mono text-xs",o="tr-span-detail";let y;e[17]!==a?(y=a("Span ID"),e[17]=a,e[18]=y):y=e[18];let w;e[19]!==t.spanId||e[20]!==y?(w=(0,s.jsx)(ee,{label:y,value:t.spanId}),e[19]=t.spanId,e[20]=y,e[21]=w):w=e[21];let M;e[22]!==a?(M=a("Parent span ID"),e[22]=a,e[23]=M):M=e[23];let p;e[24]!==t.parentSpanId||e[25]!==a?(p=t.parentSpanId===""?a("\u2014 (trace root)"):t.parentSpanId,e[24]=t.parentSpanId,e[25]=a,e[26]=p):p=e[26];let h;e[27]!==p||e[28]!==M?(h=(0,s.jsx)(ee,{label:M,value:p}),e[27]=p,e[28]=M,e[29]=h):h=e[29];let b;e[30]!==a?(b=a("Kind"),e[30]=a,e[31]=b):b=e[31];let C=t.kind??"internal",S;e[32]!==b||e[33]!==C?(S=(0,s.jsx)(ee,{label:b,value:C}),e[32]=b,e[33]=C,e[34]=S):S=e[34];let I;e[35]!==a?(I=a("Started at"),e[35]=a,e[36]=I):I=e[36];let g;e[37]!==t.offsetMs||e[38]!==a?(g=a("+{offset}",{offset:G(t.offsetMs)}),e[37]=t.offsetMs,e[38]=a,e[39]=g):g=e[39];let x;e[40]!==I||e[41]!==g?(x=(0,s.jsx)(ee,{label:I,value:g}),e[40]=I,e[41]=g,e[42]=x):x=e[42];let k;e[43]!==a?(k=a("Duration"),e[43]=a,e[44]=k):k=e[44];let f;e[45]!==t.durationMs?(f=G(t.durationMs),e[45]=t.durationMs,e[46]=f):f=e[46];let N;e[47]!==k||e[48]!==f?(N=(0,s.jsx)(ee,{label:k,value:f}),e[47]=k,e[48]=f,e[49]=N):N=e[49],e[50]!==h||e[51]!==S||e[52]!==x||e[53]!==N||e[54]!==w?(d=(0,s.jsxs)("dl",{className:"flex flex-col gap-1",children:[w,h,S,x,N]}),e[50]=h,e[51]=S,e[52]=x,e[53]=N,e[54]=w,e[55]=d):d=e[55],e[56]!==t.error?(i=t.error!==void 0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1.5","data-testid":"tr-detail-error",children:[(0,s.jsx)("span",{className:"font-semibold text-destructive",children:t.error.type}),(0,s.jsx)("p",{className:"whitespace-pre-wrap break-all text-destructive",children:t.error.message})]}),e[56]=t.error,e[57]=i):i=e[57],u=$.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-attributes",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Attributes")}),(0,s.jsx)("dl",{className:"flex flex-col gap-1",children:$.map(Ee)})]}),e[0]=t.attributes,e[1]=t.durationMs,e[2]=t.error,e[3]=t.events,e[4]=t.kind,e[5]=t.offsetMs,e[6]=t.parentSpanId,e[7]=t.spanId,e[8]=a,e[9]=l,e[10]=r,e[11]=o,e[12]=d,e[13]=i,e[14]=u}else l=e[9],r=e[10],o=e[11],d=e[12],i=e[13],u=e[14];let c;e[58]!==l||e[59]!==a?(c=l.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-events",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Events")}),(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:l.map(Oe)})]}),e[58]=l,e[59]=a,e[60]=c):c=e[60];let v;return e[61]!==r||e[62]!==o||e[63]!==d||e[64]!==i||e[65]!==u||e[66]!==c?(v=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,i,u,c]}),e[61]=r,e[62]=o,e[63]=d,e[64]=i,e[65]=u,e[66]=c,e[67]=v):v=e[67],v},"Fe");function Ee(n){let[e,t]=n;return(0,s.jsx)(ee,{label:e,value:ke(t)},e)}m(Ee,"Ke");function Ae(n){let[e,t]=n;return`${e}=${ke(t)}`}m(Ae,"Re");function Oe(n){return(0,s.jsxs)("li",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:de(n.ts)}),(0,s.jsx)(oe,{variant:"secondary",children:n.name}),(0,s.jsx)("span",{className:"min-w-0 break-all text-muted-foreground",children:Object.entries(n.attributes??{}).map(Ae).join(" ")})]},`${n.name}:${String(n.ts)}`)}m(Oe,"Ae");var Be=14,_e="grid grid-cols-[14rem_1fr_4rem_16rem_16rem] items-center gap-2 px-3",We=m(n=>{let e=(0,O.c)(17),{traceDurationMs:t}=n,a,l,r,o,d,i;if(e[0]!==t){i=Symbol.for("react.early_return_sentinel");e:{let v=Fe(t);if(v.length===0){i=null;break e}e[7]===Symbol.for("react.memo_cache_sentinel")?(r=te(_e,"border-b border-border py-1 font-mono text-[10px] text-muted-foreground"),e[7]=r):r=e[7],o="tr-ruler",e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("span",{}),e[8]=d):d=e[8],a="relative h-3",l=v.map(Je)}e[0]=t,e[1]=a,e[2]=l,e[3]=r,e[4]=o,e[5]=d,e[6]=i}else a=e[1],l=e[2],r=e[3],o=e[4],d=e[5],i=e[6];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;e[9]!==a||e[10]!==l?(u=(0,s.jsx)("span",{className:a,children:l}),e[9]=a,e[10]=l,e[11]=u):u=e[11];let c;return e[12]!==r||e[13]!==o||e[14]!==d||e[15]!==u?(c=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,u]}),e[12]=r,e[13]=o,e[14]=d,e[15]=u,e[16]=c):c=e[16],c},"je"),qe=m(n=>{let e=(0,O.c)(60),{span:t,traceDurationMs:a}=n,l=U(),[r,o]=(0,A.useState)(!1),d;e[0]!==t||e[1]!==a?(d=Ke(t,a),e[0]=t,e[1]=a,e[2]=d):d=e[2];let{leftPercent:i,widthPercent:u}=d,c;e[3]!==t.attributes?(c=ve(t.attributes),e[3]=t.attributes,e[4]=c):c=e[4];let v=c,$=t.depth*Be,_;e[5]!==$?(_={paddingLeft:$},e[5]=$,e[6]=_):_=e[6];let y=_,w=`${String(i)}%`,M=`${String(u)}%`,p;e[7]!==w||e[8]!==M?(p={left:w,width:M},e[7]=w,e[8]=M,e[9]=p):p=e[9];let h=p,b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m(()=>{o(Ue)},"h"),e[10]=b):b=e[10];let C=b,S=t.depth,I=`tr-span-detail-${t.spanId}`,g;e[11]!==t.durationMs||e[12]!==t.error||e[13]!==t.name||e[14]!==t.offsetMs||e[15]!==l?(g=l("{name}, {duration}, starts {offset} in{failure}",{duration:G(t.durationMs),failure:t.error===void 0?"":l(", failed: {message}",{message:t.error.message}),name:t.name,offset:G(t.offsetMs)}),e[11]=t.durationMs,e[12]=t.error,e[13]=t.name,e[14]=t.offsetMs,e[15]=l,e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=te(_e,"w-full border-b border-border py-1.5 text-left font-mono text-xs hover:bg-muted/50"),e[17]=x):x=e[17];let k=`tr-span-toggle-${t.spanId}`,f;e[18]!==t.ok?(f=t.ok?null:(0,s.jsx)("span",{"aria-hidden":"true",className:"mr-1 text-destructive","data-testid":"tr-span-error",children:"\u25CF"}),e[18]=t.ok,e[19]=f):f=e[19];let N;e[20]!==y||e[21]!==t.name||e[22]!==f?(N=(0,s.jsxs)("span",{className:"truncate",style:y,title:t.name,children:[f,t.name]}),e[20]=y,e[21]=t.name,e[22]=f,e[23]=N):N=e[23];let B=t.ok?"bg-primary/70":"bg-destructive",L;e[24]!==B?(L=te("absolute inset-y-0 rounded-sm",B),e[24]=B,e[25]=L):L=e[25];let E;e[26]!==h||e[27]!==i||e[28]!==L||e[29]!==u?(E=(0,s.jsx)("span",{"aria-hidden":"true",className:"relative h-3 overflow-hidden rounded-sm bg-muted",children:(0,s.jsx)("span",{className:L,"data-left":i,"data-testid":"tr-span-bar","data-width":u,style:h})}),e[26]=h,e[27]=i,e[28]=L,e[29]=u,e[30]=E):E=e[30];let W;e[31]!==t.durationMs?(W=G(t.durationMs),e[31]=t.durationMs,e[32]=W):W=e[32];let D;e[33]!==W?(D=(0,s.jsx)("span",{className:"text-right tabular-nums text-muted-foreground",children:W}),e[33]=W,e[34]=D):D=e[34];let q;e[35]!==t.error?(q=t.error===void 0?null:(0,s.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=q):q=e[36];let T;e[37]!==q?(T=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:q}),e[37]=q,e[38]=T):T=e[38];let z;e[39]!==v?(z=v===""?null:(0,s.jsx)("span",{"data-testid":"tr-span-attributes",title:v,children:v}),e[39]=v,e[40]=z):z=e[40];let P;e[41]!==z?(P=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:z}),e[41]=z,e[42]=P):P=e[42];let J;e[43]!==r||e[44]!==I||e[45]!==g||e[46]!==k||e[47]!==N||e[48]!==E||e[49]!==D||e[50]!==T||e[51]!==P?(J=(0,s.jsxs)("button",{"aria-controls":I,"aria-expanded":r,"aria-label":g,className:x,"data-testid":k,onClick:C,type:"button",children:[N,E,D,T,P]}),e[43]=r,e[44]=I,e[45]=g,e[46]=k,e[47]=N,e[48]=E,e[49]=D,e[50]=T,e[51]=P,e[52]=J):J=e[52];let F;e[53]!==r||e[54]!==t?(F=r&&(0,s.jsx)("div",{id:`tr-span-detail-${t.spanId}`,children:(0,s.jsx)(je,{span:t})}),e[53]=r,e[54]=t,e[55]=F):F=e[55];let K;return e[56]!==t.depth||e[57]!==J||e[58]!==F?(K=(0,s.jsxs)("li",{"data-depth":S,"data-testid":"tr-span-row",children:[J,F]}),e[56]=t.depth,e[57]=J,e[58]=F,e[59]=K):K=e[59],K},"Be"),ze=m(n=>{let e=(0,O.c)(15),{durationMs:t,spans:a}=n,l=U(),r;e[0]!==t?(r=(0,s.jsx)(We,{traceDurationMs:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==l?(o=l("Trace waterfall"),e[2]=l,e[3]=o):o=e[3];let d;if(e[4]!==t||e[5]!==a){let c;e[7]!==t?(c=m(v=>(0,s.jsx)(qe,{span:v,traceDurationMs:t},v.spanId),"c"),e[7]=t,e[8]=c):c=e[8],d=a.map(c),e[4]=t,e[5]=a,e[6]=d}else d=e[6];let i;e[9]!==o||e[10]!==d?(i=(0,s.jsx)("ul",{"aria-label":o,children:d}),e[9]=o,e[10]=d,e[11]=i):i=e[11];let u;return e[12]!==r||e[13]!==i?(u=(0,s.jsxs)(s.Fragment,{children:[r,i]}),e[12]=r,e[13]=i,e[14]=u):u=e[14],u},"Oe");function Je(n){return(0,s.jsx)("span",{className:te("absolute inset-y-0 border-l border-border/70",n.percent===100?"-translate-x-full pr-1":"pl-1"),style:{left:`${String(n.percent)}%`},children:n.label},n.percent)}m(Je,"We");function Ue(n){return!n}m(Ue,"Ue");var Ge=m(n=>Array.isArray(n?.traces)?n.traces:[],"qe"),He=m(n=>{let e=(0,O.c)(12),{entries:t}=n,a=U(),l;e[0]!==t.length||e[1]!==a?(l=a("Logs ({count})",{count:t.length}),e[0]=t.length,e[1]=a,e[2]=l):l=e[2];let r;e[3]!==l?(r=(0,s.jsx)("p",{className:"mb-1 font-mono text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==t?(o=t.map(Ve),e[5]=t,e[6]=o):o=e[6];let d;e[7]!==o?(d=(0,s.jsx)("div",{role:"grid",children:o}),e[7]=o,e[8]=d):d=e[8];let i;return e[9]!==r||e[10]!==d?(i=(0,s.jsxs)("div",{className:"border-t border-border px-3 py-2","data-testid":"tr-logs",children:[r,d]}),e[9]=r,e[10]=d,e[11]=i):i=e[11],i},"ze"),Qe=m(n=>{let e=(0,O.c)(50),{expanded:t,logs:a,onToggle:l,trace:r}=n,o=U(),d;e[0]!==l||e[1]!==r.traceId?(d=m(()=>{l(r.traceId)},"i"),e[0]=l,e[1]=r.traceId,e[2]=d):d=e[2];let i=d,u=`tr-row-${r.traceId}`,c=`tr-waterfall-${r.traceId}`,v=`tr-toggle-${r.traceId}`,$=t?"\u25BE":"\u25B8",_;e[3]!==$?(_=(0,s.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:$}),e[3]=$,e[4]=_):_=e[4];let y;e[5]!==r.rootName?(y=(0,s.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=y):y=e[6];let w;e[7]!==r.functionPath?(w=(0,s.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let M;e[9]!==r.durationMs?(M=G(r.durationMs),e[9]=r.durationMs,e[10]=M):M=e[10];let p;e[11]!==M?(p=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:M}),e[11]=M,e[12]=p):p=e[12];let h;e[13]!==o||e[14]!==r.spans.length?(h=o("{count} spans",{count:r.spans.length}),e[13]=o,e[14]=r.spans.length,e[15]=h):h=e[15];let b;e[16]!==h?(b=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:h}),e[16]=h,e[17]=b):b=e[17];let C=r.ok?"secondary":"destructive",S;e[18]!==o||e[19]!==r.ok?(S=r.ok?o("ok"):o("error"),e[18]=o,e[19]=r.ok,e[20]=S):S=e[20];let I;e[21]!==C||e[22]!==S?(I=(0,s.jsx)("span",{className:"shrink-0",children:(0,s.jsx)(oe,{variant:C,children:S})}),e[21]=C,e[22]=S,e[23]=I):I=e[23];let g;e[24]!==r.startTs?(g=de(r.startTs),e[24]=r.startTs,e[25]=g):g=e[25];let x;e[26]!==g?(x=(0,s.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let k;e[28]!==t||e[29]!==i||e[30]!==p||e[31]!==b||e[32]!==I||e[33]!==x||e[34]!==c||e[35]!==v||e[36]!==_||e[37]!==y||e[38]!==w?(k=(0,s.jsxs)("button",{"aria-controls":c,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":v,onClick:i,type:"button",children:[_,y,w,p,b,I,x]}),e[28]=t,e[29]=i,e[30]=p,e[31]=b,e[32]=I,e[33]=x,e[34]=c,e[35]=v,e[36]=_,e[37]=y,e[38]=w,e[39]=k):k=e[39];let f;e[40]!==t||e[41]!==a||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(f=t&&(0,s.jsxs)("div",{className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,children:[(0,s.jsx)(ze,{durationMs:r.durationMs,spans:r.spans}),a.length>0&&(0,s.jsx)(He,{entries:a})]}),e[40]=t,e[41]=a,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=f):f=e[45];let N;return e[46]!==k||e[47]!==f||e[48]!==u?(N=(0,s.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":u,children:[k,f]}),e[46]=k,e[47]=f,e[48]=u,e[49]=N):N=e[49],N},"Ge"),bt=m(n=>{let e=(0,O.c)(58),{initialShardKey:t}=n,a=U(),[l]=(0,A.useState)(ye),{queryShardKey:r,setShardKey:o,shardKey:d}=be(l?.shardKey!==void 0&&l.shardKey!==""?l.shardKey:t??""),[i,u]=(0,A.useState)(l?.traceId??""),[c,v]=(0,A.useState)(!1),[$,_]=(0,A.useState)(Xe),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0],(0,A.useEffect)(Ye,y);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={},e[1]=w):w=e[1];let M;e[2]!==r?(M={live:!0,shardKey:r},e[2]=r,e[3]=M):M=e[3];let{data:p,error:h,errorSource:b,isLoading:C,liveError:S}=ie(ce.getTraces,w,M),I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={},e[4]=I):I=e[4];let g=$.size>0,x;e[5]!==r||e[6]!==g?(x={enabled:g,live:!0,shardKey:r},e[5]=r,e[6]=g,e[7]=x):x=e[7];let{data:k}=ie(ce.getLogs,I,x),f,N;e[8]!==p||e[9]!==r?(f=m(()=>{p!==void 0&&he(r)},"p"),N=[p,r],e[8]=p,e[9]=r,e[10]=f,e[11]=N):(f=e[10],N=e[11]),(0,A.useEffect)(f,N);let B;if(e[12]!==p||e[13]!==h||e[14]!==b||e[15]!==$||e[16]!==C||e[17]!==S||e[18]!==k?.entries||e[19]!==c||e[20]!==i||e[21]!==o||e[22]!==d||e[23]!==a){let L=Ge(p),E=p?.total??L.length,W=E>L.length,D=De(L,i,c),q=Map.groupBy((k?.entries??[]).toReversed(),Ze),T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=m(j=>{u(j.target.value)},"C"),e[25]=T):T=e[25];let z=T,P;e[26]===Symbol.for("react.memo_cache_sentinel")?(P=m(j=>{_($e=>{let ne=new Set($e);return ne.has(j)?ne.delete(j):ne.add(j),ne})},"E"),e[26]=P):P=e[26];let J=P,F=h===null&&D.length===0&&!C,K;e[27]!==o||e[28]!==d?(K=(0,s.jsx)(fe,{onChange:o,testId:"tr-shard-input",value:d}),e[27]=o,e[28]=d,e[29]=K):K=e[29];let H;e[30]!==a?(H=a("Search traces"),e[30]=a,e[31]=H):H=e[31];let Q;e[32]!==a?(Q=a("search trace, span, or function"),e[32]=a,e[33]=Q):Q=e[33];let V;e[34]!==i||e[35]!==H||e[36]!==Q?(V=(0,s.jsx)(me,{"aria-label":H,className:"h-8 w-56","data-testid":"tr-search",onChange:z,placeholder:Q,value:i}),e[34]=i,e[35]=H,e[36]=Q,e[37]=V):V=e[37];let X;e[38]!==c?(X=(0,s.jsx)(xe,{checked:c,"data-testid":"tr-only-errors",id:"tr-only-errors",onCheckedChange:v}),e[38]=c,e[39]=X):X=e[39];let Y;e[40]!==a?(Y=a("Errors only"),e[40]=a,e[41]=Y):Y=e[41];let Z;e[42]!==X||e[43]!==Y?(Z=(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",htmlFor:"tr-only-errors",children:[X,Y]}),e[42]=X,e[43]=Y,e[44]=Z):Z=e[44];let R;e[45]!==S?(R=(0,s.jsx)(Ne,{message:S,prefix:"tr"}),e[45]=S,e[46]=R):R=e[46];let re;e[47]!==K||e[48]!==V||e[49]!==Z||e[50]!==R?(re=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K,V,Z,R]}),e[47]=K,e[48]=V,e[49]=Z,e[50]=R,e[51]=re):re=e[51];let ae;e[52]!==h||e[53]!==b?(ae=h!==null&&(0,s.jsx)(ge,{error:b,testId:"tr-error"}),e[52]=h,e[53]=b,e[54]=ae):ae=e[54];let se;e[55]!==F||e[56]!==a?(se=F&&(0,s.jsx)(ue,{description:a("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:a("No traces")}),e[55]=F,e[56]=a,e[57]=se):se=e[57],B=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[re,ae,se,h===null&&W&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:a("Showing the {shown} most recent of {total} traces in the buffer.",{shown:L.length,total:E})}),h===null&&D.length>0&&(0,s.jsx)("div",{"aria-label":a("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:D.map(j=>(0,s.jsx)(Qe,{expanded:$.has(j.traceId),logs:q.get(j.traceId)??[],onToggle:J,trace:j},j.traceId))})]}),e[12]=p,e[13]=h,e[14]=b,e[15]=$,e[16]=C,e[17]=S,e[18]=k?.entries,e[19]=c,e[20]=i,e[21]=o,e[22]=d,e[23]=a,e[24]=B}else B=e[24];return B},"bt");function Ve(n,e){return(0,s.jsx)("div",{className:"flex items-center border-b border-border py-1 font-mono text-xs last:border-b-0","data-testid":"tr-log-row",role:"row",children:(0,s.jsx)(Me,{entry:n})},`${String(e)}:${String(n.timestamp)}`)}m(Ve,"He");function Xe(){return new Set}m(Xe,"Je");function Ye(){we()}m(Ye,"Qe");function Ze(n){return n.traceId}m(Ze,"Ve");export{bt as default};
|
|
1
|
+
import{b as Me}from"./chunk-LRXCL6IA.js";import{a as ve}from"./chunk-R36QXQZX.js";import{b as ye,c as we}from"./chunk-IH2CJZF2.js";import{a as xe}from"./chunk-YJWR6ZWC.js";import{a as Ne}from"./chunk-XBZUJDHD.js";import"./chunk-NGVP66OH.js";import"./chunk-XYR5NST4.js";import{a as be}from"./chunk-5DNGK3NT.js";import{a as fe}from"./chunk-KYONGQQ4.js";import{b as he}from"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import{i as me}from"./chunk-SDQH4HR6.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as oe}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{a as ge}from"./chunk-GMO7IUXO.js";import"./chunk-OSJ7HV7B.js";import"./chunk-5SYMAYUA.js";import"./chunk-E26OT26O.js";import{a as ce}from"./chunk-6UTZXEW3.js";import{c as ie}from"./chunk-W37HRJGQ.js";import"./chunk-SDSQIQJG.js";import"./chunk-WZTY3ZYI.js";import{a as ue}from"./chunk-3Y5K3IQO.js";import{b as te,f as U,p as pe,w as de}from"./chunk-LPINY2IJ.js";import{a as m,d as le,e as Ce,f as Le,g as Te}from"./chunk-OXFKZ4BM.js";var O=le(Le(),1),A=le(Ce(),1);var s=le(Te(),1);var Pe=.5,Ie=4,Se=m(n=>Math.min(100,Math.max(0,n)),"ce"),Ke=m((n,e)=>{if(!Number.isFinite(e)||e<=0)return{leftPercent:0,widthPercent:100};let t=Se(n.offsetMs/e*100),a=n.durationMs/e*100,l=Math.max(Pe,Math.min(Se(a),100-t));return{leftPercent:t,widthPercent:l}},"Ce"),De=m((n,e,t=!1)=>{let a=e.trim().toLowerCase(),l=t?n.filter(r=>!r.ok):n;return a===""?[...l]:l.filter(r=>r.rootName.toLowerCase().includes(a)||r.functionPath.toLowerCase().includes(a)||r.traceId.toLowerCase().includes(a)||r.spans.some(o=>o.name.toLowerCase().includes(a)||o.spanId.toLowerCase().includes(a)))},"Ee"),G=m(n=>Number.isFinite(n)?n>0&&n<1?`${n.toFixed(2)}ms`:`${String(Math.round(n))}ms`:"\u2014","q"),Fe=m(n=>!Number.isFinite(n)||n<=0?[]:Array.from({length:Ie},(e,t)=>{let a=(t+1)/Ie;return{label:G(n*a),percent:a*100}}),"Pe"),ke=m(n=>{if(typeof n=="string")return n;try{return JSON.stringify(n,pe)}catch{return String(n)}},"ue"),ee=m(n=>{let e=(0,O.c)(7),{label:t,value:a}=n,l;e[0]!==t?(l=(0,s.jsx)("dt",{className:"w-40 shrink-0 text-muted-foreground",children:t}),e[0]=t,e[1]=l):l=e[1];let r;e[2]!==a?(r=(0,s.jsx)("dd",{className:"min-w-0 break-all",children:a}),e[2]=a,e[3]=r):r=e[3];let o;return e[4]!==l||e[5]!==r?(o=(0,s.jsxs)("div",{className:"flex gap-2",children:[l,r]}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o},"Y"),je=m(n=>{let e=(0,O.c)(68),{span:t}=n,a=U(),l,r,o,d,i,u;if(e[0]!==t.attributes||e[1]!==t.durationMs||e[2]!==t.error||e[3]!==t.events||e[4]!==t.kind||e[5]!==t.offsetMs||e[6]!==t.parentSpanId||e[7]!==t.spanId||e[8]!==a){let $=Object.entries(t.attributes??{}),_;e[15]!==t.events?(_=t.events??[],e[15]=t.events,e[16]=_):_=e[16],l=_,r="border-t border-border bg-background/60 px-3 py-2 font-mono text-xs",o="tr-span-detail";let y;e[17]!==a?(y=a("Span ID"),e[17]=a,e[18]=y):y=e[18];let w;e[19]!==t.spanId||e[20]!==y?(w=(0,s.jsx)(ee,{label:y,value:t.spanId}),e[19]=t.spanId,e[20]=y,e[21]=w):w=e[21];let M;e[22]!==a?(M=a("Parent span ID"),e[22]=a,e[23]=M):M=e[23];let p;e[24]!==t.parentSpanId||e[25]!==a?(p=t.parentSpanId===""?a("\u2014 (trace root)"):t.parentSpanId,e[24]=t.parentSpanId,e[25]=a,e[26]=p):p=e[26];let h;e[27]!==p||e[28]!==M?(h=(0,s.jsx)(ee,{label:M,value:p}),e[27]=p,e[28]=M,e[29]=h):h=e[29];let b;e[30]!==a?(b=a("Kind"),e[30]=a,e[31]=b):b=e[31];let C=t.kind??"internal",S;e[32]!==b||e[33]!==C?(S=(0,s.jsx)(ee,{label:b,value:C}),e[32]=b,e[33]=C,e[34]=S):S=e[34];let I;e[35]!==a?(I=a("Started at"),e[35]=a,e[36]=I):I=e[36];let g;e[37]!==t.offsetMs||e[38]!==a?(g=a("+{offset}",{offset:G(t.offsetMs)}),e[37]=t.offsetMs,e[38]=a,e[39]=g):g=e[39];let x;e[40]!==I||e[41]!==g?(x=(0,s.jsx)(ee,{label:I,value:g}),e[40]=I,e[41]=g,e[42]=x):x=e[42];let k;e[43]!==a?(k=a("Duration"),e[43]=a,e[44]=k):k=e[44];let f;e[45]!==t.durationMs?(f=G(t.durationMs),e[45]=t.durationMs,e[46]=f):f=e[46];let N;e[47]!==k||e[48]!==f?(N=(0,s.jsx)(ee,{label:k,value:f}),e[47]=k,e[48]=f,e[49]=N):N=e[49],e[50]!==h||e[51]!==S||e[52]!==x||e[53]!==N||e[54]!==w?(d=(0,s.jsxs)("dl",{className:"flex flex-col gap-1",children:[w,h,S,x,N]}),e[50]=h,e[51]=S,e[52]=x,e[53]=N,e[54]=w,e[55]=d):d=e[55],e[56]!==t.error?(i=t.error!==void 0&&(0,s.jsxs)("div",{className:"mt-2 rounded-md border border-destructive/40 bg-destructive/10 px-2 py-1.5","data-testid":"tr-detail-error",children:[(0,s.jsx)("span",{className:"font-semibold text-destructive",children:t.error.type}),(0,s.jsx)("p",{className:"whitespace-pre-wrap break-all text-destructive",children:t.error.message})]}),e[56]=t.error,e[57]=i):i=e[57],u=$.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-attributes",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Attributes")}),(0,s.jsx)("dl",{className:"flex flex-col gap-1",children:$.map(Ee)})]}),e[0]=t.attributes,e[1]=t.durationMs,e[2]=t.error,e[3]=t.events,e[4]=t.kind,e[5]=t.offsetMs,e[6]=t.parentSpanId,e[7]=t.spanId,e[8]=a,e[9]=l,e[10]=r,e[11]=o,e[12]=d,e[13]=i,e[14]=u}else l=e[9],r=e[10],o=e[11],d=e[12],i=e[13],u=e[14];let c;e[58]!==l||e[59]!==a?(c=l.length>0&&(0,s.jsxs)("div",{className:"mt-2","data-testid":"tr-detail-events",children:[(0,s.jsx)("p",{className:"mb-1 text-muted-foreground",children:a("Events")}),(0,s.jsx)("ul",{className:"flex flex-col gap-1",children:l.map(Oe)})]}),e[58]=l,e[59]=a,e[60]=c):c=e[60];let v;return e[61]!==r||e[62]!==o||e[63]!==d||e[64]!==i||e[65]!==u||e[66]!==c?(v=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,i,u,c]}),e[61]=r,e[62]=o,e[63]=d,e[64]=i,e[65]=u,e[66]=c,e[67]=v):v=e[67],v},"Fe");function Ee(n){let[e,t]=n;return(0,s.jsx)(ee,{label:e,value:ke(t)},e)}m(Ee,"Ke");function Ae(n){let[e,t]=n;return`${e}=${ke(t)}`}m(Ae,"Re");function Oe(n){return(0,s.jsxs)("li",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:de(n.ts)}),(0,s.jsx)(oe,{variant:"secondary",children:n.name}),(0,s.jsx)("span",{className:"min-w-0 break-all text-muted-foreground",children:Object.entries(n.attributes??{}).map(Ae).join(" ")})]},`${n.name}:${String(n.ts)}`)}m(Oe,"Ae");var Be=14,_e="grid grid-cols-[14rem_1fr_4rem_16rem_16rem] items-center gap-2 px-3",We=m(n=>{let e=(0,O.c)(17),{traceDurationMs:t}=n,a,l,r,o,d,i;if(e[0]!==t){i=Symbol.for("react.early_return_sentinel");e:{let v=Fe(t);if(v.length===0){i=null;break e}e[7]===Symbol.for("react.memo_cache_sentinel")?(r=te(_e,"border-b border-border py-1 font-mono text-[10px] text-muted-foreground"),e[7]=r):r=e[7],o="tr-ruler",e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsx)("span",{}),e[8]=d):d=e[8],a="relative h-3",l=v.map(Je)}e[0]=t,e[1]=a,e[2]=l,e[3]=r,e[4]=o,e[5]=d,e[6]=i}else a=e[1],l=e[2],r=e[3],o=e[4],d=e[5],i=e[6];if(i!==Symbol.for("react.early_return_sentinel"))return i;let u;e[9]!==a||e[10]!==l?(u=(0,s.jsx)("span",{className:a,children:l}),e[9]=a,e[10]=l,e[11]=u):u=e[11];let c;return e[12]!==r||e[13]!==o||e[14]!==d||e[15]!==u?(c=(0,s.jsxs)("div",{className:r,"data-testid":o,children:[d,u]}),e[12]=r,e[13]=o,e[14]=d,e[15]=u,e[16]=c):c=e[16],c},"je"),qe=m(n=>{let e=(0,O.c)(60),{span:t,traceDurationMs:a}=n,l=U(),[r,o]=(0,A.useState)(!1),d;e[0]!==t||e[1]!==a?(d=Ke(t,a),e[0]=t,e[1]=a,e[2]=d):d=e[2];let{leftPercent:i,widthPercent:u}=d,c;e[3]!==t.attributes?(c=ve(t.attributes),e[3]=t.attributes,e[4]=c):c=e[4];let v=c,$=t.depth*Be,_;e[5]!==$?(_={paddingLeft:$},e[5]=$,e[6]=_):_=e[6];let y=_,w=`${String(i)}%`,M=`${String(u)}%`,p;e[7]!==w||e[8]!==M?(p={left:w,width:M},e[7]=w,e[8]=M,e[9]=p):p=e[9];let h=p,b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=m(()=>{o(Ue)},"h"),e[10]=b):b=e[10];let C=b,S=t.depth,I=`tr-span-detail-${t.spanId}`,g;e[11]!==t.durationMs||e[12]!==t.error||e[13]!==t.name||e[14]!==t.offsetMs||e[15]!==l?(g=l("{name}, {duration}, starts {offset} in{failure}",{duration:G(t.durationMs),failure:t.error===void 0?"":l(", failed: {message}",{message:t.error.message}),name:t.name,offset:G(t.offsetMs)}),e[11]=t.durationMs,e[12]=t.error,e[13]=t.name,e[14]=t.offsetMs,e[15]=l,e[16]=g):g=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=te(_e,"w-full border-b border-border py-1.5 text-left font-mono text-xs hover:bg-muted/50"),e[17]=x):x=e[17];let k=`tr-span-toggle-${t.spanId}`,f;e[18]!==t.ok?(f=t.ok?null:(0,s.jsx)("span",{"aria-hidden":"true",className:"mr-1 text-destructive","data-testid":"tr-span-error",children:"\u25CF"}),e[18]=t.ok,e[19]=f):f=e[19];let N;e[20]!==y||e[21]!==t.name||e[22]!==f?(N=(0,s.jsxs)("span",{className:"truncate",style:y,title:t.name,children:[f,t.name]}),e[20]=y,e[21]=t.name,e[22]=f,e[23]=N):N=e[23];let B=t.ok?"bg-primary/70":"bg-destructive",L;e[24]!==B?(L=te("absolute inset-y-0 rounded-sm",B),e[24]=B,e[25]=L):L=e[25];let E;e[26]!==h||e[27]!==i||e[28]!==L||e[29]!==u?(E=(0,s.jsx)("span",{"aria-hidden":"true",className:"relative h-3 overflow-hidden rounded-sm bg-muted",children:(0,s.jsx)("span",{className:L,"data-left":i,"data-testid":"tr-span-bar","data-width":u,style:h})}),e[26]=h,e[27]=i,e[28]=L,e[29]=u,e[30]=E):E=e[30];let W;e[31]!==t.durationMs?(W=G(t.durationMs),e[31]=t.durationMs,e[32]=W):W=e[32];let D;e[33]!==W?(D=(0,s.jsx)("span",{className:"text-right tabular-nums text-muted-foreground",children:W}),e[33]=W,e[34]=D):D=e[34];let q;e[35]!==t.error?(q=t.error===void 0?null:(0,s.jsx)("span",{className:"text-destructive","data-testid":"tr-span-error-message",title:t.error.message,children:`${t.error.type}: ${t.error.message}`}),e[35]=t.error,e[36]=q):q=e[36];let T;e[37]!==q?(T=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:q}),e[37]=q,e[38]=T):T=e[38];let z;e[39]!==v?(z=v===""?null:(0,s.jsx)("span",{"data-testid":"tr-span-attributes",title:v,children:v}),e[39]=v,e[40]=z):z=e[40];let P;e[41]!==z?(P=(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:z}),e[41]=z,e[42]=P):P=e[42];let J;e[43]!==r||e[44]!==I||e[45]!==g||e[46]!==k||e[47]!==N||e[48]!==E||e[49]!==D||e[50]!==T||e[51]!==P?(J=(0,s.jsxs)("button",{"aria-controls":I,"aria-expanded":r,"aria-label":g,className:x,"data-testid":k,onClick:C,type:"button",children:[N,E,D,T,P]}),e[43]=r,e[44]=I,e[45]=g,e[46]=k,e[47]=N,e[48]=E,e[49]=D,e[50]=T,e[51]=P,e[52]=J):J=e[52];let F;e[53]!==r||e[54]!==t?(F=r&&(0,s.jsx)("div",{id:`tr-span-detail-${t.spanId}`,children:(0,s.jsx)(je,{span:t})}),e[53]=r,e[54]=t,e[55]=F):F=e[55];let K;return e[56]!==t.depth||e[57]!==J||e[58]!==F?(K=(0,s.jsxs)("li",{"data-depth":S,"data-testid":"tr-span-row",children:[J,F]}),e[56]=t.depth,e[57]=J,e[58]=F,e[59]=K):K=e[59],K},"Be"),ze=m(n=>{let e=(0,O.c)(15),{durationMs:t,spans:a}=n,l=U(),r;e[0]!==t?(r=(0,s.jsx)(We,{traceDurationMs:t}),e[0]=t,e[1]=r):r=e[1];let o;e[2]!==l?(o=l("Trace waterfall"),e[2]=l,e[3]=o):o=e[3];let d;if(e[4]!==t||e[5]!==a){let c;e[7]!==t?(c=m(v=>(0,s.jsx)(qe,{span:v,traceDurationMs:t},v.spanId),"c"),e[7]=t,e[8]=c):c=e[8],d=a.map(c),e[4]=t,e[5]=a,e[6]=d}else d=e[6];let i;e[9]!==o||e[10]!==d?(i=(0,s.jsx)("ul",{"aria-label":o,children:d}),e[9]=o,e[10]=d,e[11]=i):i=e[11];let u;return e[12]!==r||e[13]!==i?(u=(0,s.jsxs)(s.Fragment,{children:[r,i]}),e[12]=r,e[13]=i,e[14]=u):u=e[14],u},"Oe");function Je(n){return(0,s.jsx)("span",{className:te("absolute inset-y-0 border-l border-border/70",n.percent===100?"-translate-x-full pr-1":"pl-1"),style:{left:`${String(n.percent)}%`},children:n.label},n.percent)}m(Je,"We");function Ue(n){return!n}m(Ue,"Ue");var Ge=m(n=>Array.isArray(n?.traces)?n.traces:[],"qe"),He=m(n=>{let e=(0,O.c)(12),{entries:t}=n,a=U(),l;e[0]!==t.length||e[1]!==a?(l=a("Logs ({count})",{count:t.length}),e[0]=t.length,e[1]=a,e[2]=l):l=e[2];let r;e[3]!==l?(r=(0,s.jsx)("p",{className:"mb-1 font-mono text-xs text-muted-foreground",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==t?(o=t.map(Ve),e[5]=t,e[6]=o):o=e[6];let d;e[7]!==o?(d=(0,s.jsx)("div",{role:"grid",children:o}),e[7]=o,e[8]=d):d=e[8];let i;return e[9]!==r||e[10]!==d?(i=(0,s.jsxs)("div",{className:"border-t border-border px-3 py-2","data-testid":"tr-logs",children:[r,d]}),e[9]=r,e[10]=d,e[11]=i):i=e[11],i},"ze"),Qe=m(n=>{let e=(0,O.c)(50),{expanded:t,logs:a,onToggle:l,trace:r}=n,o=U(),d;e[0]!==l||e[1]!==r.traceId?(d=m(()=>{l(r.traceId)},"i"),e[0]=l,e[1]=r.traceId,e[2]=d):d=e[2];let i=d,u=`tr-row-${r.traceId}`,c=`tr-waterfall-${r.traceId}`,v=`tr-toggle-${r.traceId}`,$=t?"\u25BE":"\u25B8",_;e[3]!==$?(_=(0,s.jsx)("span",{"aria-hidden":"true",className:"w-3 shrink-0 text-xs text-muted-foreground",children:$}),e[3]=$,e[4]=_):_=e[4];let y;e[5]!==r.rootName?(y=(0,s.jsx)("span",{className:"w-56 shrink-0 truncate text-sm font-medium",title:r.rootName,children:r.rootName}),e[5]=r.rootName,e[6]=y):y=e[6];let w;e[7]!==r.functionPath?(w=(0,s.jsx)("span",{className:"w-48 shrink-0 truncate font-mono text-xs text-muted-foreground",title:r.functionPath,children:r.functionPath}),e[7]=r.functionPath,e[8]=w):w=e[8];let M;e[9]!==r.durationMs?(M=G(r.durationMs),e[9]=r.durationMs,e[10]=M):M=e[10];let p;e[11]!==M?(p=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:M}),e[11]=M,e[12]=p):p=e[12];let h;e[13]!==o||e[14]!==r.spans.length?(h=o("{count} spans",{count:r.spans.length}),e[13]=o,e[14]=r.spans.length,e[15]=h):h=e[15];let b;e[16]!==h?(b=(0,s.jsx)("span",{className:"w-20 shrink-0 text-right font-mono text-xs tabular-nums text-muted-foreground",children:h}),e[16]=h,e[17]=b):b=e[17];let C=r.ok?"secondary":"destructive",S;e[18]!==o||e[19]!==r.ok?(S=r.ok?o("ok"):o("error"),e[18]=o,e[19]=r.ok,e[20]=S):S=e[20];let I;e[21]!==C||e[22]!==S?(I=(0,s.jsx)("span",{className:"shrink-0",children:(0,s.jsx)(oe,{variant:C,children:S})}),e[21]=C,e[22]=S,e[23]=I):I=e[23];let g;e[24]!==r.startTs?(g=de(r.startTs),e[24]=r.startTs,e[25]=g):g=e[25];let x;e[26]!==g?(x=(0,s.jsx)("span",{className:"flex-1 truncate text-right font-mono text-xs tabular-nums text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let k;e[28]!==t||e[29]!==i||e[30]!==p||e[31]!==b||e[32]!==I||e[33]!==x||e[34]!==c||e[35]!==v||e[36]!==_||e[37]!==y||e[38]!==w?(k=(0,s.jsxs)("button",{"aria-controls":c,"aria-expanded":t,className:"flex w-full items-center gap-3 px-3 py-2 text-left hover:bg-muted/50","data-testid":v,onClick:i,type:"button",children:[_,y,w,p,b,I,x]}),e[28]=t,e[29]=i,e[30]=p,e[31]=b,e[32]=I,e[33]=x,e[34]=c,e[35]=v,e[36]=_,e[37]=y,e[38]=w,e[39]=k):k=e[39];let f;e[40]!==t||e[41]!==a||e[42]!==r.durationMs||e[43]!==r.spans||e[44]!==r.traceId?(f=t&&(0,s.jsxs)("div",{className:"bg-muted/20","data-testid":`tr-waterfall-${r.traceId}`,id:`tr-waterfall-${r.traceId}`,children:[(0,s.jsx)(ze,{durationMs:r.durationMs,spans:r.spans}),a.length>0&&(0,s.jsx)(He,{entries:a})]}),e[40]=t,e[41]=a,e[42]=r.durationMs,e[43]=r.spans,e[44]=r.traceId,e[45]=f):f=e[45];let N;return e[46]!==k||e[47]!==f||e[48]!==u?(N=(0,s.jsxs)("div",{className:"border-b border-border last:border-b-0","data-testid":u,children:[k,f]}),e[46]=k,e[47]=f,e[48]=u,e[49]=N):N=e[49],N},"Ge"),bt=m(n=>{let e=(0,O.c)(58),{initialShardKey:t}=n,a=U(),[l]=(0,A.useState)(ye),{queryShardKey:r,setShardKey:o,shardKey:d}=be(l?.shardKey!==void 0&&l.shardKey!==""?l.shardKey:t??""),[i,u]=(0,A.useState)(l?.traceId??""),[c,v]=(0,A.useState)(!1),[$,_]=(0,A.useState)(Xe),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],e[0]=y):y=e[0],(0,A.useEffect)(Ye,y);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={},e[1]=w):w=e[1];let M;e[2]!==r?(M={live:!0,shardKey:r},e[2]=r,e[3]=M):M=e[3];let{data:p,error:h,errorSource:b,isLoading:C,liveError:S}=ie(ce.getTraces,w,M),I;e[4]===Symbol.for("react.memo_cache_sentinel")?(I={},e[4]=I):I=e[4];let g=$.size>0,x;e[5]!==r||e[6]!==g?(x={enabled:g,live:!0,shardKey:r},e[5]=r,e[6]=g,e[7]=x):x=e[7];let{data:k}=ie(ce.getLogs,I,x),f,N;e[8]!==p||e[9]!==r?(f=m(()=>{p!==void 0&&he(r)},"p"),N=[p,r],e[8]=p,e[9]=r,e[10]=f,e[11]=N):(f=e[10],N=e[11]),(0,A.useEffect)(f,N);let B;if(e[12]!==p||e[13]!==h||e[14]!==b||e[15]!==$||e[16]!==C||e[17]!==S||e[18]!==k?.entries||e[19]!==c||e[20]!==i||e[21]!==o||e[22]!==d||e[23]!==a){let L=Ge(p),E=p?.total??L.length,W=E>L.length,D=De(L,i,c),q=Map.groupBy((k?.entries??[]).toReversed(),Ze),T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=m(j=>{u(j.target.value)},"C"),e[25]=T):T=e[25];let z=T,P;e[26]===Symbol.for("react.memo_cache_sentinel")?(P=m(j=>{_($e=>{let ne=new Set($e);return ne.has(j)?ne.delete(j):ne.add(j),ne})},"E"),e[26]=P):P=e[26];let J=P,F=h===null&&D.length===0&&!C,K;e[27]!==o||e[28]!==d?(K=(0,s.jsx)(fe,{onChange:o,testId:"tr-shard-input",value:d}),e[27]=o,e[28]=d,e[29]=K):K=e[29];let H;e[30]!==a?(H=a("Search traces"),e[30]=a,e[31]=H):H=e[31];let Q;e[32]!==a?(Q=a("search trace, span, or function"),e[32]=a,e[33]=Q):Q=e[33];let V;e[34]!==i||e[35]!==H||e[36]!==Q?(V=(0,s.jsx)(me,{"aria-label":H,className:"h-8 w-56","data-testid":"tr-search",onChange:z,placeholder:Q,value:i}),e[34]=i,e[35]=H,e[36]=Q,e[37]=V):V=e[37];let X;e[38]!==c?(X=(0,s.jsx)(xe,{checked:c,"data-testid":"tr-only-errors",id:"tr-only-errors",onCheckedChange:v}),e[38]=c,e[39]=X):X=e[39];let Y;e[40]!==a?(Y=a("Errors only"),e[40]=a,e[41]=Y):Y=e[41];let Z;e[42]!==X||e[43]!==Y?(Z=(0,s.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",htmlFor:"tr-only-errors",children:[X,Y]}),e[42]=X,e[43]=Y,e[44]=Z):Z=e[44];let R;e[45]!==S?(R=(0,s.jsx)(Ne,{message:S,prefix:"tr"}),e[45]=S,e[46]=R):R=e[46];let re;e[47]!==K||e[48]!==V||e[49]!==Z||e[50]!==R?(re=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[K,V,Z,R]}),e[47]=K,e[48]=V,e[49]=Z,e[50]=R,e[51]=re):re=e[51];let ae;e[52]!==h||e[53]!==b?(ae=h!==null&&(0,s.jsx)(ge,{error:b,testId:"tr-error"}),e[52]=h,e[53]=b,e[54]=ae):ae=e[54];let se;e[55]!==F||e[56]!==a?(se=F&&(0,s.jsx)(ue,{description:a("Traces recorded with ctx.trace show up here as your app handles traffic. The span buffer resets when the shard hibernates."),icon:(0,s.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M4 6h10M7 12h13M10 18h7"})}),testId:"tr-empty",title:a("No traces")}),e[55]=F,e[56]=a,e[57]=se):se=e[57],B=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-traces-panel",children:[re,ae,se,h===null&&W&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"tr-truncated",children:a("Showing the {shown} most recent of {total} traces in the buffer.",{shown:L.length,total:E})}),h===null&&D.length>0&&(0,s.jsx)("div",{"aria-label":a("Recent traces"),className:"overflow-hidden rounded-xl border border-border shadow-xs","data-testid":"tr-list",children:D.map(j=>(0,s.jsx)(Qe,{expanded:$.has(j.traceId),logs:q.get(j.traceId)??[],onToggle:J,trace:j},j.traceId))})]}),e[12]=p,e[13]=h,e[14]=b,e[15]=$,e[16]=C,e[17]=S,e[18]=k?.entries,e[19]=c,e[20]=i,e[21]=o,e[22]=d,e[23]=a,e[24]=B}else B=e[24];return B},"bt");function Ve(n,e){return(0,s.jsx)("div",{className:"flex items-center border-b border-border py-1 font-mono text-xs last:border-b-0","data-testid":"tr-log-row",role:"row",children:(0,s.jsx)(Me,{entry:n})},`${String(e)}:${String(n.timestamp)}`)}m(Ve,"He");function Xe(){return new Set}m(Xe,"Je");function Ye(){we()}m(Ye,"Qe");function Ze(n){return n.traceId}m(Ze,"Ve");export{bt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"./chunk-AOHKAKKL.js";import{a as Q}from"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-AOHKAKKL.js";import{a as Q}from"./chunk-FACE2CFY.js";import{a as L}from"./chunk-5DNGK3NT.js";import{a as G}from"./chunk-KYONGQQ4.js";import"./chunk-SLIDAWNX.js";import"./chunk-6M7FLLMT.js";import"./chunk-SDQH4HR6.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import"./chunk-ZBON5T5A.js";import{b as $}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{a as W}from"./chunk-GMO7IUXO.js";import"./chunk-OSJ7HV7B.js";import"./chunk-5SYMAYUA.js";import"./chunk-E26OT26O.js";import{a as E}from"./chunk-6UTZXEW3.js";import{c as B}from"./chunk-W37HRJGQ.js";import"./chunk-SDSQIQJG.js";import"./chunk-WZTY3ZYI.js";import{a as A}from"./chunk-3Y5K3IQO.js";import{a as q,b as H,c as O,d as K,e as T,f as D}from"./chunk-CW57Q264.js";import{a as _}from"./chunk-MD67S53Z.js";import{f as j}from"./chunk-LPINY2IJ.js";import{a as S,d as F,f as J,g as V}from"./chunk-OXFKZ4BM.js";var R=F(J(),1);var t=F(V(),1);var U=S(c=>`${c.toString()} ms`,"D"),X=S(c=>c.totalConnections===0&&c.shapePoke.passes===0&&c.whisper.passes===0&&c.shapeProbe.run===0&&c.shapeProbe.served===0&&c.globalPoll.drains===0&&c.globalPoll.pairsSkipped===0,"J"),z=S(c=>{let e=(0,R.c)(48),{counters:o,includeTiming:a,prefix:r,t:l,title:u}=c,d=`${r}-section`,n;e[0]!==u?(n=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:u}),e[0]=u,e[1]=n):n=e[1];let s=`${r}-stats`,i;e[2]!==l?(i=l("Passes"),e[2]=l,e[3]=i):i=e[3];let m=`${r}-passes`,I;e[4]!==o.passes||e[5]!==i||e[6]!==m?(I=(0,t.jsx)(v,{label:i,testId:m,value:o.passes}),e[4]=o.passes,e[5]=i,e[6]=m,e[7]=I):I=e[7];let g;e[8]!==l?(g=l("Sockets iterated"),e[8]=l,e[9]=g):g=e[9];let k=`${r}-iterated`,p;e[10]!==o.socketsIterated||e[11]!==g||e[12]!==k?(p=(0,t.jsx)(v,{label:g,testId:k,value:o.socketsIterated}),e[10]=o.socketsIterated,e[11]=g,e[12]=k,e[13]=p):p=e[13];let f;e[14]!==l?(f=l("Delivered"),e[14]=l,e[15]=f):f=e[15];let y=`${r}-delivered`,h;e[16]!==o.socketsDelivered||e[17]!==f||e[18]!==y?(h=(0,t.jsx)(v,{label:f,testId:y,value:o.socketsDelivered}),e[16]=o.socketsDelivered,e[17]=f,e[18]=y,e[19]=h):h=e[19];let x;e[20]!==l?(x=l("Peak width"),e[20]=l,e[21]=x):x=e[21];let N=`${r}-peak`,b;e[22]!==o.peakSocketsIterated||e[23]!==x||e[24]!==N?(b=(0,t.jsx)(v,{label:x,testId:N,value:o.peakSocketsIterated}),e[22]=o.peakSocketsIterated,e[23]=x,e[24]=N,e[25]=b):b=e[25];let C;e[26]!==o.totalMs||e[27]!==a||e[28]!==r||e[29]!==l?(C=a&&(0,t.jsx)(v,{label:l("Total time"),testId:`${r}-total-ms`,value:U(o.totalMs)}),e[26]=o.totalMs,e[27]=a,e[28]=r,e[29]=l,e[30]=C):C=e[30];let P;e[31]!==o.maxMs||e[32]!==a||e[33]!==r||e[34]!==l?(P=a&&(0,t.jsx)(v,{label:l("Max time"),testId:`${r}-max-ms`,value:U(o.maxMs)}),e[31]=o.maxMs,e[32]=a,e[33]=r,e[34]=l,e[35]=P):P=e[35];let M;e[36]!==h||e[37]!==b||e[38]!==C||e[39]!==P||e[40]!==s||e[41]!==I||e[42]!==p?(M=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":s,children:[I,p,h,b,C,P]}),e[36]=h,e[37]=b,e[38]=C,e[39]=P,e[40]=s,e[41]=I,e[42]=p,e[43]=M):M=e[43];let w;return e[44]!==d||e[45]!==M||e[46]!==n?(w=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":d,children:[n,M]}),e[44]=d,e[45]=M,e[46]=n,e[47]=w):w=e[47],w},"F"),Y=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Membership probes"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Queries run"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.run||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-probe-run",value:o.run}),e[6]=o.run,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Shared from cache"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.served||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-probe-served",value:o.served}),e[11]=o.served,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-probe-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-probe-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"V"),Z=S(c=>{let e=(0,R.c)(20),{counters:o,t:a}=c,r;e[0]!==a?(r=a("Global shape polls"),e[0]=a,e[1]=r):r=e[1];let l;e[2]!==r?(l=(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==a?(u=a("Global reads"),e[4]=a,e[5]=u):u=e[5];let d;e[6]!==o.drains||e[7]!==u?(d=(0,t.jsx)(v,{label:u,testId:"fanout-global-poll-drains",value:o.drains}),e[6]=o.drains,e[7]=u,e[8]=d):d=e[8];let n;e[9]!==a?(n=a("Pairs skipped"),e[9]=a,e[10]=n):n=e[10];let s;e[11]!==o.pairsSkipped||e[12]!==n?(s=(0,t.jsx)(v,{label:n,testId:"fanout-global-poll-pairs-skipped",value:o.pairsSkipped}),e[11]=o.pairsSkipped,e[12]=n,e[13]=s):s=e[13];let i;e[14]!==d||e[15]!==s?(i=(0,t.jsxs)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"fanout-global-poll-stats",children:[d,s]}),e[14]=d,e[15]=s,e[16]=i):i=e[16];let m;return e[17]!==l||e[18]!==i?(m=(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-global-poll-section",children:[l,i]}),e[17]=l,e[18]=i,e[19]=m):m=e[19],m},"X"),pe=S(c=>{let e=(0,R.c)(31),{initialShardKey:o}=c,a=j(),{queryShardKey:r,setShardKey:l,shardKey:u}=L(o),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={},e[0]=d):d=e[0];let n;e[1]!==r?(n={keepPreviousData:!0,shardKey:r},e[1]=r,e[2]=n):n=e[2];let{data:s,error:i,errorSource:m,poll:I}=B(E.getFanoutMetrics,d,n);Q(I,!0);let g;e[3]!==s?(g=s!==void 0&&X(s),e[3]=s,e[4]=g):g=e[4];let k=g,p;e[5]!==l||e[6]!==u?(p=(0,t.jsx)(G,{onChange:l,testId:"fanout-shard-input",value:u}),e[5]=l,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==s||e[9]!==a?(f=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"fanout-count",children:[s.promoted&&(0,t.jsx)($,{"data-testid":"fanout-promoted",variant:s.relayCount>=s.maxRelays?"destructive":"default",children:s.relayCount>=s.maxRelays?a("auto-scaled: {relayCount}/{maxRelays} relays (at ceiling)",{maxRelays:s.maxRelays,relayCount:s.relayCount}):a("auto-scaled: {relayCount}/{maxRelays} relays",{maxRelays:s.maxRelays,relayCount:s.relayCount})}),(0,t.jsx)($,{variant:"secondary",children:a("{count} connections",{count:s.totalConnections})}),(0,t.jsx)($,{variant:"secondary",children:a("peak {count} subscribers",{count:s.peakSubscribers})})]}),e[8]=s,e[9]=a,e[10]=f):f=e[10];let y;e[11]!==p||e[12]!==f?(y=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13];let h;e[14]!==i||e[15]!==m?(h=i!==null&&(0,t.jsx)(W,{error:m,testId:"fanout-error"}),e[14]=i,e[15]=m,e[16]=h):h=e[16];let x;e[17]!==i||e[18]!==k||e[19]!==a?(x=i===null&&k&&(0,t.jsx)(A,{description:a("Realtime fan-out cost and per-topic subscriber counts for this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M4 12h4l3 7 4-14 3 7h2"})}),testId:"fanout-empty",title:a("No fan-out activity yet.")}),e[17]=i,e[18]=k,e[19]=a,e[20]=x):x=e[20];let N;e[21]!==i||e[22]!==k||e[23]!==s||e[24]!==a?(N=i===null&&s!==void 0&&!k&&(0,t.jsxs)(t.Fragment,{children:[s.topics.length>0&&(0,t.jsxs)("section",{className:"flex flex-col gap-2","data-testid":"fanout-topics-section",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:a("Hot topics")}),(0,t.jsx)(_,{className:"overflow-hidden py-0",children:(0,t.jsxs)(q,{"data-testid":"fanout-topics-table",children:[(0,t.jsx)(H,{children:(0,t.jsxs)(K,{children:[(0,t.jsx)(T,{children:a("Topic")}),(0,t.jsx)(T,{children:a("Kind")}),(0,t.jsx)(T,{className:"text-right",children:a("Subscribers")})]})}),(0,t.jsx)(O,{children:s.topics.map(ee)})]})})]}),(0,t.jsxs)("section",{className:"flex flex-col gap-3","data-testid":"fanout-cost",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:a("Fan-out cost since this instance woke")}),(0,t.jsx)(z,{counters:s.shapePoke,includeTiming:!0,prefix:"fanout-poke",t:a,title:a("Shape pokes")}),(0,t.jsx)(z,{counters:s.whisper,includeTiming:!1,prefix:"fanout-whisper",t:a,title:a("Whisper broadcasts")}),(0,t.jsx)(Y,{counters:s.shapeProbe,t:a}),(0,t.jsx)(Z,{counters:s.globalPoll,t:a})]})]}),e[21]=i,e[22]=k,e[23]=s,e[24]=a,e[25]=N):N=e[25];let b;return e[26]!==y||e[27]!==h||e[28]!==x||e[29]!==N?(b=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"fanout-panel",children:[y,h,x,N]}),e[26]=y,e[27]=h,e[28]=x,e[29]=N,e[30]=b):b=e[30],b},"me");function ee(c){return(0,t.jsxs)(K,{"data-testid":"fanout-topic-row",children:[(0,t.jsx)(D,{className:"font-mono text-xs",children:c.topic}),(0,t.jsx)(D,{children:(0,t.jsx)($,{variant:"outline",children:c.kind})}),(0,t.jsx)(D,{className:"text-right font-medium tabular-nums",children:c.subscribers})]},`${c.kind}:${c.topic}`)}S(ee,"Y");export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-FACE2CFY.js";import{a as k}from"./chunk-5IGDDSST.js";import"./chunk-DBVJ5VLI.js";import"./chunk-LUHXNZI4.js";import"./chunk-ZTOREMGH.js";import"./chunk-2O6KKVH2.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as N}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{a as B}from"./chunk-GMO7IUXO.js";import"./chunk-OSJ7HV7B.js";import"./chunk-5SYMAYUA.js";import"./chunk-E26OT26O.js";import{a as u}from"./chunk-6UTZXEW3.js";import{c as p}from"./chunk-W37HRJGQ.js";import{h as R}from"./chunk-SDSQIQJG.js";import"./chunk-WZTY3ZYI.js";import{a as S}from"./chunk-3Y5K3IQO.js";import{a as A,b as C,c as P,d as b,e as l,f as n}from"./chunk-CW57Q264.js";import{a as v,e as w}from"./chunk-MD67S53Z.js";import{f as j,w as I}from"./chunk-LPINY2IJ.js";import{a as m,d as H,g as Q}from"./chunk-OXFKZ4BM.js";var e=H(Q(),1);var _="payment_subscriptions",O="payment_events",V=[_,O],Y={},E=new Set(["active","trialing"]),z=new Set(["past_due","unpaid"]),s=m((a,t)=>{if(a[t]!==void 0)return a[t];let h=a.__doc__;return typeof h=="string"?R(h)?.[t]:void 0},"a"),o=m(a=>typeof a=="string"?a:typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"?String(a):"","s"),J=m(a=>E.has(a)?"default":z.has(a)?"destructive":"outline","q"),ie=m(({limit:a=100})=>{let t=j(),h=k(),{data:x}=p(u.listTables,Y,{live:!0}),F=x!==void 0,L=Array.isArray(x)&&V.every(r=>x.some(d=>d.name===r)),c=h.payments&&L,i=p(u.readTablePage,{filters:[],limit:a,offset:0,orderBy:{column:"updatedAt",direction:"desc"},search:"",table:_},{enabled:c}),f=p(u.readTablePage,{filters:[],limit:25,offset:0,orderBy:{column:"processedAt",direction:"desc"},search:"",table:O},{enabled:c}),g=p(u.facetColumn,{column:"state",table:_},{enabled:c});D(()=>{if(c)return Promise.all([i.poll(),f.poll(),g.poll()])},!0);let y=i.data?.rows??[],M=f.data?.rows??[],U=i.error??f.error,q=i.error===null?f.errorSource:i.errorSource,G=i.data?.total??y.length,T=g.data?.values===void 0?y.filter(r=>E.has(o(s(r,"state")))).length:g.data.values.reduce((r,d)=>r+(E.has(o(d.value))?d.count:0),0);return F&&!c?(0,e.jsx)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:(0,e.jsx)(S,{description:t("No @lunora/payment tables found in this deployment. Add `.extend(paymentExtension)` to lunora/schema.ts and wire `payment` on createShardDO() to sync customers and subscriptions."),testId:"payments-unconfigured",title:t("No payments configured")})}):(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsx)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxs)(v,{className:"justify-between gap-0 py-0",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Subscriptions")}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T}),(0,e.jsx)(N,{variant:"default",children:t("{count} active",{count:T})})]})]}),(0,e.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:t("{total} total",{total:G})})]})}),U===null?void 0:(0,e.jsx)(B,{error:q}),y.length===0&&!i.isLoading?(0,e.jsx)(S,{testId:"payments-empty",title:t("No subscriptions yet")}):(0,e.jsx)(v,{className:"overflow-hidden py-0",children:(0,e.jsx)(w,{className:"px-0",children:(0,e.jsxs)(A,{children:[(0,e.jsx)(C,{children:(0,e.jsxs)(b,{children:[(0,e.jsx)(l,{children:t("Provider")}),(0,e.jsx)(l,{children:t("Reference")}),(0,e.jsx)(l,{children:t("Plan")}),(0,e.jsx)(l,{children:t("State")}),(0,e.jsx)(l,{children:t("Renews")})]})}),(0,e.jsx)(P,{children:y.map(r=>{let d=o(s(r,"state"));return(0,e.jsxs)(b,{"data-testid":"payment-subscription-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{children:o(s(r,"referenceId"))}),(0,e.jsx)(n,{children:o(s(r,"priceId"))}),(0,e.jsx)(n,{children:(0,e.jsx)(N,{variant:J(d),children:d})}),(0,e.jsx)(n,{children:I(s(r,"currentPeriodEnd"))})]},o(s(r,"providerSubscriptionId")))})})]})})}),(0,e.jsxs)(v,{className:"overflow-hidden py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Recent webhook events")})}),(0,e.jsx)(w,{className:"px-0",children:(0,e.jsx)(A,{children:(0,e.jsx)(P,{children:M.map(r=>(0,e.jsxs)(b,{"data-testid":"payment-event-row",children:[(0,e.jsx)(n,{children:o(s(r,"provider"))}),(0,e.jsx)(n,{className:"font-medium",children:o(s(r,"type"))}),(0,e.jsx)(n,{className:"text-muted-foreground",children:o(s(r,"providerEventId"))}),(0,e.jsx)(n,{children:I(s(r,"processedAt"))})]},o(s(r,"providerEventId"))))})})})]})]})},"oe");export{ie as PaymentsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as st}from"./chunk-X5KWBDTF.js";import"./chunk-A566HCBX.js";import{a as et}from"./chunk-P6L6ABWO.js";import{a as tt}from"./chunk-ILLDX6LU.js";import"./chunk-W2BCSK5S.js";import{a as Ze}from"./chunk-ZWDORIZY.js";import{i as Ge}from"./chunk-SDQH4HR6.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as pe}from"./chunk-2O6KKVH2.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as me}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{a as Ye}from"./chunk-IMF6DJKL.js";import{a as Xe}from"./chunk-OSJ7HV7B.js";import"./chunk-SL7LF2SO.js";import"./chunk-E26OT26O.js";import{a as G}from"./chunk-6UTZXEW3.js";import{c as Oe}from"./chunk-4SJDWMH3.js";import{p as Ve}from"./chunk-FKM35PXF.js";import"./chunk-WZTY3ZYI.js";import{a as he}from"./chunk-3Y5K3IQO.js";import{a as Re,b as _e,c as Je,d as H,e as L,f as S}from"./chunk-CW57Q264.js";import{a as ke,e as Be}from"./chunk-MD67S53Z.js";import{f as O,h as ge,i as fe,j as K,p as He,s as xe,w as Ke}from"./chunk-LPINY2IJ.js";import{a as c,d as $e,e as it,f as ut,g as ct}from"./chunk-OXFKZ4BM.js";var $=$e(ut(),1),M=$e(it(),1);var s=$e(ct(),1);var mt=c((n,e)=>{let t=new Set(n.map(a=>a.deadLetterQueue).filter(a=>typeof a=="string"&&a!=="")),o=n.filter(a=>(a.deadLetterQueue===void 0||a.deadLetterQueue==="")&&!t.has(a.name)),r=e.filter(a=>a.deadLettered).length;return{deadLetteredCount:r,queuesWithoutDlq:o,showReliabilityWarning:o.length>0||r>0}},"ct"),We="topic:",je=c(n=>{let e=[],t=new Map;for(let o of n)o.topic===void 0?e.push(o):t.set(o.topic,[...t.get(o.topic)??[],o]);return{plain:e,topics:t}},"Be"),rt=c(n=>`${We}${n}`,"He"),pt=c((n,e)=>n.startsWith(We)?(e.get(n.slice(We.length))??[]).map(t=>t.exportName):[n],"ut"),ht=200,gt=ge(G.sendQueueMessage),ft=c(async(n,e,t)=>{let o=(await Promise.allSettled(e.map(async a=>n.query(gt,a,fe(""))))).flatMap((a,l)=>a.status==="rejected"?[{exportName:e[l]?.exportName??"",message:K(a.reason)}]:[]),[r]=o;return r===void 0?null:e.length===1?r.message:t("Not sent to {failed}",{failed:o.map(a=>`${a.exportName}: ${a.message}`).join("; ")})},"ft"),xt=ge(G.replayQueueMessage),yt=ge(G.clearQueueMessages),at=96,Nt=c(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n,He)}catch{return"[unserializable]"}},"xt"),bt=c(n=>n.length>at?`${n.slice(0,at)}\u2026`:n,"yt"),qt=c(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","bt"),vt=c((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"Nt"),nt=c(n=>{let e=(0,$.c)(17),{queue:t}=n,o=`queues-row-${t.exportName}`,r;e[0]!==t.exportName?(r=(0,s.jsx)(S,{className:"font-mono text-xs",children:t.exportName}),e[0]=t.exportName,e[1]=r):r=e[1];let a;e[2]!==t.name?(a=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.name}),e[2]=t.name,e[3]=a):a=e[3];let l;e[4]!==t.mode?(l=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.mode}),e[4]=t.mode,e[5]=l):l=e[5];let d;e[6]!==t.binding?(d=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.binding}),e[6]=t.binding,e[7]=d):d=e[7];let i=t.deadLetterQueue??"\u2014",u;e[8]!==i?(u=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:i}),e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==o||e[11]!==r||e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==u?(p=(0,s.jsxs)(H,{"data-testid":o,children:[r,a,l,d,u]}),e[10]=o,e[11]=r,e[12]=a,e[13]=l,e[14]=d,e[15]=u,e[16]=p):p=e[16],p},"Ve"),St=c(n=>{let e=(0,$.c)(8),{loaded:t,queues:o}=n,r=O(),a;if(e[0]!==t||e[1]!==o||e[2]!==r){let{plain:l,topics:d}=je(o),i;e[4]!==r?(i=r("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[4]=r,e[5]=i):i=e[5];let u;e[6]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=u):u=e[7],a=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[u,t&&o.length===0?(0,s.jsx)(he,{description:r("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:r("No queues defined")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Be,{className:"px-0",children:(0,s.jsxs)(Re,{"data-testid":"queues-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:r("Export")}),(0,s.jsx)(L,{children:r("Queue")}),(0,s.jsx)(L,{children:r("Mode")}),(0,s.jsx)(L,{children:r("Binding")}),(0,s.jsx)(L,{children:r("Dead-letter")})]})}),(0,s.jsxs)(Je,{children:[l.map(Et),[...d].map(p=>{let[f,x]=p;return(0,s.jsxs)(M.Fragment,{children:[(0,s.jsx)(H,{className:"bg-muted/40","data-testid":`queues-topic-${f}`,children:(0,s.jsx)(S,{className:"text-xs font-medium",colSpan:5,children:r("Topic {topic} \xB7 {count} subscriptions",{count:x.length,topic:f})})}),x.map(Mt)]},f)})]})]})})})]}),e[0]=t,e[1]=o,e[2]=r,e[3]=a}else a=e[3];return a},"qt"),Ct=c(n=>{let e=(0,$.c)(67),{message:t,onReplay:o,replayingId:r}=n,a=O(),l,d,i,u,p,f,x,m,h,N;if(e[0]!==t.attempts||e[1]!==t.body||e[2]!==t.deadLettered||e[3]!==t.exportName||e[4]!==t.id||e[5]!==t.messageId||e[6]!==t.outcome||e[7]!==t.queue||e[8]!==a){let R=Nt(t.body);d=H,f=`queues-message-${t.id}`;let _=t.exportName??t.queue;e[19]!==_?(x=(0,s.jsx)(S,{className:"font-mono text-xs",children:_}),e[19]=_,e[20]=x):x=e[20],e[21]!==t.messageId?(m=(0,s.jsx)(S,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:t.messageId,children:t.messageId}),e[21]=t.messageId,e[22]=m):m=e[22],e[23]!==t.attempts?(h=(0,s.jsx)(S,{className:"font-mono text-xs tabular-nums",children:t.attempts}),e[23]=t.attempts,e[24]=h):h=e[24];let k=`queues-outcome-${t.id}`,w;e[25]!==t.outcome?(w=qt(t.outcome),e[25]=t.outcome,e[26]=w):w=e[26];let T;e[27]!==t.outcome||e[28]!==k||e[29]!==w?(T=(0,s.jsx)(me,{"data-testid":k,variant:w,children:t.outcome}),e[27]=t.outcome,e[28]=k,e[29]=w,e[30]=T):T=e[30];let I;e[31]!==t.deadLettered||e[32]!==t.id||e[33]!==a?(I=t.deadLettered&&(0,s.jsx)(me,{"data-testid":`queues-dlq-${t.id}`,variant:"destructive",children:a("DLQ")}),e[31]=t.deadLettered,e[32]=t.id,e[33]=a,e[34]=I):I=e[34],e[35]!==T||e[36]!==I?(N=(0,s.jsx)(S,{children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[T,I]})}),e[35]=T,e[36]=I,e[37]=N):N=e[37],l=S,i="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=R,p=bt(R),e[0]=t.attempts,e[1]=t.body,e[2]=t.deadLettered,e[3]=t.exportName,e[4]=t.id,e[5]=t.messageId,e[6]=t.outcome,e[7]=t.queue,e[8]=a,e[9]=l,e[10]=d,e[11]=i,e[12]=u,e[13]=p,e[14]=f,e[15]=x,e[16]=m,e[17]=h,e[18]=N}else l=e[9],d=e[10],i=e[11],u=e[12],p=e[13],f=e[14],x=e[15],m=e[16],h=e[17],N=e[18];let y;e[38]!==l||e[39]!==i||e[40]!==u||e[41]!==p?(y=(0,s.jsx)(l,{className:i,title:u,children:p}),e[38]=l,e[39]=i,e[40]=u,e[41]=p,e[42]=y):y=e[42];let b;e[43]!==t.capturedAt?(b=Ke(t.capturedAt,"\u2014"),e[43]=t.capturedAt,e[44]=b):b=e[44];let C;e[45]!==b?(C=(0,s.jsx)(S,{className:"text-xs text-muted-foreground tabular-nums",children:b}),e[45]=b,e[46]=C):C=e[46];let q=`queues-replay-${t.id}`,v=r!==null,E;e[47]!==t.id||e[48]!==r||e[49]!==a?(E=r===t.id?a("Replaying\u2026"):a("Replay"),e[47]=t.id,e[48]=r,e[49]=a,e[50]=E):E=e[50];let A;e[51]!==t.id||e[52]!==o||e[53]!==q||e[54]!==v||e[55]!==E?(A=(0,s.jsx)(S,{children:(0,s.jsx)(pe,{"data-id":t.id,"data-testid":q,disabled:v,onClick:o,size:"xs",type:"button",variant:"outline",children:E})}),e[51]=t.id,e[52]=o,e[53]=q,e[54]=v,e[55]=E,e[56]=A):A=e[56];let D;return e[57]!==d||e[58]!==C||e[59]!==A||e[60]!==f||e[61]!==x||e[62]!==m||e[63]!==h||e[64]!==N||e[65]!==y?(D=(0,s.jsxs)(d,{"data-testid":f,children:[x,m,h,N,y,C,A]}),e[57]=d,e[58]=C,e[59]=A,e[60]=f,e[61]=x,e[62]=m,e[63]=h,e[64]=N,e[65]=y,e[66]=D):D=e[66],D},"St"),wt=c(n=>{let e=(0,$.c)(29),{hasError:t,messages:o,onClear:r,onReplay:a,replayingId:l}=n,d=O(),i;e[0]!==d?(i=d("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=d,e[1]=i):i=e[1];let u;e[2]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=u):u=e[3];let p;e[4]!==d?(p=d("Clear the whole message log?"),e[4]=d,e[5]=p):p=e[5];let f=o.length===0,x;e[6]!==d?(x=d("Clear log"),e[6]=d,e[7]=x):x=e[7];let m;e[8]!==r||e[9]!==p||e[10]!==f||e[11]!==x?(m=(0,s.jsx)("div",{className:"ml-auto",children:(0,s.jsx)(Ze,{confirmLabel:p,disabled:f,onConfirm:r,testId:"queues-clear",children:x})}),e[8]=r,e[9]=p,e[10]=f,e[11]=x,e[12]=m):m=e[12];let h;e[13]!==o.length||e[14]!==d?(h=o.length>0&&(0,s.jsx)(me,{"data-testid":"queues-count",variant:"secondary",children:d("{count} messages",{count:o.length})}),e[13]=o.length,e[14]=d,e[15]=h):h=e[15];let N;e[16]!==u||e[17]!==m||e[18]!==h?(N=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,m,h]}),e[16]=u,e[17]=m,e[18]=h,e[19]=N):N=e[19];let y;e[20]!==t||e[21]!==o||e[22]!==a||e[23]!==l||e[24]!==d?(y=!t&&o.length===0?(0,s.jsx)(he,{description:d("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:d("No consumed messages yet.")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Be,{className:"px-0",children:(0,s.jsx)(st,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,s.jsxs)(Re,{"data-testid":"queues-messages-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:d("Export")}),(0,s.jsx)(L,{children:d("Message")}),(0,s.jsx)(L,{children:d("Attempts")}),(0,s.jsx)(L,{children:d("Outcome")}),(0,s.jsx)(L,{children:d("Body")}),(0,s.jsx)(L,{children:d("Captured")}),(0,s.jsx)(L,{})]})}),(0,s.jsx)(Je,{children:o.map(C=>(0,s.jsx)(Ct,{message:C,onReplay:a,replayingId:l},C.id))})]})})})}),e[20]=t,e[21]=o,e[22]=a,e[23]=l,e[24]=d,e[25]=y):y=e[25];let b;return e[26]!==N||e[27]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[N,y]}),e[26]=N,e[27]=y,e[28]=b):b=e[28],b},"Et"),It=c(n=>{let e=(0,$.c)(20),{batchMode:t,bodyText:o,delayText:r,onBatchModeChange:a,onBodyChange:l,onDelayChange:d,onSelectExport:i,onSend:u,queues:p,selectedExportName:f,sending:x}=n,m=O(),h;e[0]!==m?(h=m("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=m,e[1]=h):h=e[1];let N;e[2]!==h?(N=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[2]=h,e[3]=N):N=e[3];let y;e[4]!==t||e[5]!==o||e[6]!==r||e[7]!==a||e[8]!==l||e[9]!==d||e[10]!==i||e[11]!==u||e[12]!==p||e[13]!==f||e[14]!==x||e[15]!==m?(y=p.length===0?(0,s.jsx)(he,{description:m("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:m("No queues to send to")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("select",{"aria-label":m("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:i,value:f,children:[p.map(At),[...je(p).topics].map(C=>{let[q,v]=C;return(0,s.jsx)("option",{value:rt(q),children:m("{topic} (topic \u2192 {count} subscriptions)",{count:v.length,topic:q})},q)})]}),(0,s.jsx)(Ge,{"aria-label":m("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:d,placeholder:m("Delay (s)"),type:"number",value:r}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,s.jsx)("input",{checked:t,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:a,type:"checkbox"}),m("Send as batch (JSON array)")]}),(0,s.jsx)(pe,{className:"ml-auto","data-testid":"queues-send-button",disabled:x||f==="",onClick:u,type:"button",children:m(x?"Sending\u2026":"Send message")})]}),(0,s.jsx)(et,{"aria-label":m("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:l,placeholder:t?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:o})]}),e[4]=t,e[5]=o,e[6]=r,e[7]=a,e[8]=l,e[9]=d,e[10]=i,e[11]=u,e[12]=p,e[13]=f,e[14]=x,e[15]=m,e[16]=y):y=e[16];let b;return e[17]!==N||e[18]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[N,y]}),e[17]=N,e[18]=y,e[19]=b):b=e[19],b},"Tt"),Qt=c((n,e,t,o)=>{let r=null,a=n.trim();if(a!=="")try{r=JSON.parse(a)}catch{return{error:o("Body must be valid JSON.")}}let l,d=e.trim();if(d!==""){let i=Number(d);if(!Number.isFinite(i)||i<0)return{error:o("Delay must be a non-negative number of seconds.")};l=i}return t&&!Array.isArray(r)?{error:o("Batch mode needs a JSON array body \u2014 each element is enqueued as one message.")}:{body:r,delaySeconds:l}},"Ct"),Lt=c(n=>{let e=(0,$.c)(11),{deadLetteredCount:t,queuesWithoutDlq:o}=n,r=O(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,s.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),e[0]=a):a=e[0];let l;e[1]!==o||e[2]!==r?(l=o.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"font-medium",children:r("No dead-letter queue on {queues}.",{queues:o.map(Tt).join(", ")})}),(0,s.jsx)("p",{className:"text-muted-foreground",children:r("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),e[1]=o,e[2]=r,e[3]=l):l=e[3];let d;e[4]!==t||e[5]!==o.length||e[6]!==r?(d=t>0&&(0,s.jsx)("p",{className:o.length>0?"text-muted-foreground":"font-medium",children:t===1?r("1 message was recently dead-lettered."):r("{count} messages were recently dead-lettered.",{count:t})}),e[4]=t,e[5]=o.length,e[6]=r,e[7]=d):d=e[7];let i;return e[8]!==l||e[9]!==d?(i=(0,s.jsx)(Xe,{icon:a,testId:"queues-dlq-warning",variant:"warning",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[l,d]})}),e[8]=l,e[9]=d,e[10]=i):i=e[10],i},"_t"),Zt=c(n=>{let e=(0,$.c)(76),{limit:t}=n,o=t??ht,r=Ve(),a=O(),[l,d]=(0,M.useState)("declared"),[i,u]=(0,M.useState)(null),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let{data:f,error:x,errorSource:m}=Oe(G.listQueues,p),h;e[1]!==o?(h={limit:o},e[1]=o,e[2]=h):h=e[2];let{data:N,error:y,errorSource:b,poll:C,refetch:q}=Oe(G.getQueueMessages,h),v=Array.isArray(f?.queues)?[...f.queues].toSorted(Dt):[],E=N?.entries??[],{deadLetteredCount:A,queuesWithoutDlq:D,showReliabilityWarning:R}=mt(v,E),[_,k]=(0,M.useState)(""),[w,T]=(0,M.useState)(""),[I,ye]=(0,M.useState)(""),[B,Ne]=(0,M.useState)(!1),[be,V]=(0,M.useState)(!1),[qe,X]=(0,M.useState)(null),{topics:Y}=je(v),Fe=[...v.map($t),...[...Y.keys()].map(kt)],J=Fe.includes(_)?_:Fe[0]??"",ze=l==="messages"?y:x,ot=l==="messages"?b:m,ve=ze??i,Se=ze===null?i:ot;tt(C,l==="messages");let Z;e[3]!==B||e[4]!==w||e[5]!==r||e[6]!==I||e[7]!==q||e[8]!==J||e[9]!==V||e[10]!==a||e[11]!==Y?(Z=c(async()=>{u(null);let g=J;if(g==="")return;let Q=Qt(w,I,B,a);if("error"in Q){u(Q.error);return}let{body:Pe,delaySeconds:Ue}=Q;V(!0);let lt=pt(g,Y).map(ce=>B?{batch:Pe,delaySeconds:Ue,exportName:ce}:{body:Pe,delaySeconds:Ue,exportName:ce});try{u(await ft(r,lt,a)),q()}catch(ce){u(K(ce))}V(!1)},"K"),e[3]=B,e[4]=w,e[5]=r,e[6]=I,e[7]=q,e[8]=J,e[9]=V,e[10]=a,e[11]=Y,e[12]=Z):Z=e[12];let Ce=Z,ee;e[13]!==r||e[14]!==q||e[15]!==X?(ee=c(async g=>{u(null),X(g);try{await r.query(xt,{id:g},fe("")),q()}catch(Q){u(K(Q))}X(null)},"Z"),e[13]=r,e[14]=q,e[15]=X,e[16]=ee):ee=e[16];let we=ee,te;e[17]!==r||e[18]!==q?(te=c(async()=>{u(null);try{await r.query(yt,{},fe("")),q()}catch(g){u(K(g))}},"ee"),e[17]=r,e[18]=q,e[19]=te):te=e[19];let Ie=te,se;e[20]===Symbol.for("react.memo_cache_sentinel")?(se=c(g=>{let Q=g.currentTarget.dataset.tab;(Q==="declared"||Q==="messages"||Q==="send")&&d(Q)},"te"),e[20]=se):se=e[20];let dt=se,ae;e[21]!==k?(ae=c(g=>{k(g.currentTarget.value)},"se"),e[21]=k,e[22]=ae):ae=e[22];let Qe=ae,re;e[23]!==T?(re=c(g=>{T(g.currentTarget.value)},"re"),e[23]=T,e[24]=re):re=e[24];let Le=re,ne;e[25]!==ye?(ne=c(g=>{ye(g.currentTarget.value)},"ae"),e[25]=ye,e[26]=ne):ne=e[26];let Ee=ne,oe;e[27]!==Ne?(oe=c(g=>{Ne(g.currentTarget.checked)},"ne"),e[27]=Ne,e[28]=oe):oe=e[28];let Me=oe,de;e[29]!==Ce?(de=c(()=>{xe(Ce())},"oe"),e[29]=Ce,e[30]=de):de=e[30];let Ae=de,le;e[31]!==we?(le=c(g=>{let{id:Q}=g.currentTarget.dataset;Q!==void 0&&xe(we(Q))},"le"),e[31]=we,e[32]=le):le=e[32];let Te=le,ie;e[33]!==Ie?(ie=c(()=>{xe(Ie())},"ie"),e[33]=Ie,e[34]=ie):ie=e[34];let De=ie,W;e[35]!==a||e[36]!==l?(W=(0,s.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(g=>(0,s.jsx)(pe,{"aria-selected":l===g,"data-tab":g,"data-testid":`queues-tab-${g}`,onClick:dt,role:"tab",size:"sm",type:"button",variant:l===g?"secondary":"ghost",children:vt(g,a)},g))}),e[35]=a,e[36]=l,e[37]=W):W=e[37];let j;e[38]!==ve||e[39]!==Se?(j=ve!==null&&(0,s.jsx)(Ye,{error:Se,testId:"queues-error"}),e[38]=ve,e[39]=Se,e[40]=j):j=e[40];let F;e[41]!==A||e[42]!==D||e[43]!==R?(F=R&&(0,s.jsx)(Lt,{deadLetteredCount:A,queuesWithoutDlq:D}),e[41]=A,e[42]=D,e[43]=R,e[44]=F):F=e[44];let z;e[45]!==v||e[46]!==f||e[47]!==l?(z=l==="declared"&&(0,s.jsx)(St,{loaded:f!==void 0,queues:v}),e[45]=v,e[46]=f,e[47]=l,e[48]=z):z=e[48];let P;e[49]!==E||e[50]!==y||e[51]!==De||e[52]!==Te||e[53]!==qe||e[54]!==l?(P=l==="messages"&&(0,s.jsx)(wt,{hasError:y!==null,messages:E,onClear:De,onReplay:Te,replayingId:qe}),e[49]=E,e[50]=y,e[51]=De,e[52]=Te,e[53]=qe,e[54]=l,e[55]=P):P=e[55];let U;e[56]!==B||e[57]!==w||e[58]!==I||e[59]!==Me||e[60]!==Le||e[61]!==Ee||e[62]!==Qe||e[63]!==Ae||e[64]!==v||e[65]!==J||e[66]!==be||e[67]!==l?(U=l==="send"&&(0,s.jsx)(It,{batchMode:B,bodyText:w,delayText:I,onBatchModeChange:Me,onBodyChange:Le,onDelayChange:Ee,onSelectExport:Qe,onSend:Ae,queues:v,selectedExportName:J,sending:be}),e[56]=B,e[57]=w,e[58]=I,e[59]=Me,e[60]=Le,e[61]=Ee,e[62]=Qe,e[63]=Ae,e[64]=v,e[65]=J,e[66]=be,e[67]=l,e[68]=U):U=e[68];let ue;return e[69]!==W||e[70]!==j||e[71]!==F||e[72]!==z||e[73]!==P||e[74]!==U?(ue=(0,s.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-queues-panel",children:[W,j,F,z,P,U]}),e[69]=W,e[70]=j,e[71]=F,e[72]=z,e[73]=P,e[74]=U,e[75]=ue):ue=e[75],ue},"ts");function Et(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Et,"vt");function Mt(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Mt,"wt");function At(n){return(0,s.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}c(At,"Qt");function Tt(n){return n.name}c(Tt,"At");function Dt(n,e){return n.exportName.localeCompare(e.exportName)}c(Dt,"It");function $t(n){return n.exportName}c($t,"Mt");function kt(n){return rt(n)}c(kt,"Lt");export{Zt as default};
|
|
1
|
+
import{a as st}from"./chunk-X5KWBDTF.js";import"./chunk-A566HCBX.js";import{a as et}from"./chunk-P6L6ABWO.js";import{a as tt}from"./chunk-FACE2CFY.js";import"./chunk-W2BCSK5S.js";import{a as Ze}from"./chunk-ZWDORIZY.js";import{i as Ge}from"./chunk-SDQH4HR6.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as pe}from"./chunk-2O6KKVH2.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import{b as me}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{a as Ye}from"./chunk-GMO7IUXO.js";import{a as Xe}from"./chunk-OSJ7HV7B.js";import"./chunk-5SYMAYUA.js";import"./chunk-E26OT26O.js";import{a as G}from"./chunk-6UTZXEW3.js";import{c as Oe}from"./chunk-W37HRJGQ.js";import{p as Ve}from"./chunk-SDSQIQJG.js";import"./chunk-WZTY3ZYI.js";import{a as he}from"./chunk-3Y5K3IQO.js";import{a as Re,b as _e,c as Je,d as H,e as L,f as S}from"./chunk-CW57Q264.js";import{a as ke,e as Be}from"./chunk-MD67S53Z.js";import{f as O,h as ge,i as fe,j as K,p as He,s as xe,w as Ke}from"./chunk-LPINY2IJ.js";import{a as c,d as $e,e as it,f as ut,g as ct}from"./chunk-OXFKZ4BM.js";var $=$e(ut(),1),M=$e(it(),1);var s=$e(ct(),1);var mt=c((n,e)=>{let t=new Set(n.map(a=>a.deadLetterQueue).filter(a=>typeof a=="string"&&a!=="")),o=n.filter(a=>(a.deadLetterQueue===void 0||a.deadLetterQueue==="")&&!t.has(a.name)),r=e.filter(a=>a.deadLettered).length;return{deadLetteredCount:r,queuesWithoutDlq:o,showReliabilityWarning:o.length>0||r>0}},"ct"),We="topic:",je=c(n=>{let e=[],t=new Map;for(let o of n)o.topic===void 0?e.push(o):t.set(o.topic,[...t.get(o.topic)??[],o]);return{plain:e,topics:t}},"Be"),rt=c(n=>`${We}${n}`,"He"),pt=c((n,e)=>n.startsWith(We)?(e.get(n.slice(We.length))??[]).map(t=>t.exportName):[n],"ut"),ht=200,gt=ge(G.sendQueueMessage),ft=c(async(n,e,t)=>{let o=(await Promise.allSettled(e.map(async a=>n.query(gt,a,fe(""))))).flatMap((a,l)=>a.status==="rejected"?[{exportName:e[l]?.exportName??"",message:K(a.reason)}]:[]),[r]=o;return r===void 0?null:e.length===1?r.message:t("Not sent to {failed}",{failed:o.map(a=>`${a.exportName}: ${a.message}`).join("; ")})},"ft"),xt=ge(G.replayQueueMessage),yt=ge(G.clearQueueMessages),at=96,Nt=c(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n,He)}catch{return"[unserializable]"}},"xt"),bt=c(n=>n.length>at?`${n.slice(0,at)}\u2026`:n,"yt"),qt=c(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","bt"),vt=c((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"Nt"),nt=c(n=>{let e=(0,$.c)(17),{queue:t}=n,o=`queues-row-${t.exportName}`,r;e[0]!==t.exportName?(r=(0,s.jsx)(S,{className:"font-mono text-xs",children:t.exportName}),e[0]=t.exportName,e[1]=r):r=e[1];let a;e[2]!==t.name?(a=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.name}),e[2]=t.name,e[3]=a):a=e[3];let l;e[4]!==t.mode?(l=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.mode}),e[4]=t.mode,e[5]=l):l=e[5];let d;e[6]!==t.binding?(d=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:t.binding}),e[6]=t.binding,e[7]=d):d=e[7];let i=t.deadLetterQueue??"\u2014",u;e[8]!==i?(u=(0,s.jsx)(S,{className:"font-mono text-xs text-muted-foreground",children:i}),e[8]=i,e[9]=u):u=e[9];let p;return e[10]!==o||e[11]!==r||e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==u?(p=(0,s.jsxs)(H,{"data-testid":o,children:[r,a,l,d,u]}),e[10]=o,e[11]=r,e[12]=a,e[13]=l,e[14]=d,e[15]=u,e[16]=p):p=e[16],p},"Ve"),St=c(n=>{let e=(0,$.c)(8),{loaded:t,queues:o}=n,r=O(),a;if(e[0]!==t||e[1]!==o||e[2]!==r){let{plain:l,topics:d}=je(o),i;e[4]!==r?(i=r("Queues are declared in code with defineQueue. Enqueue from a mutation or action with ctx.queues.<name>.send(...); push consumers process batches in the worker."),e[4]=r,e[5]=i):i=e[5];let u;e[6]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=u):u=e[7],a=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[u,t&&o.length===0?(0,s.jsx)(he,{description:r("No defineQueue is declared in lunora/queues.ts in this deployment. Add one to offload async work to a Cloudflare Queue."),testId:"queues-empty",title:r("No queues defined")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Be,{className:"px-0",children:(0,s.jsxs)(Re,{"data-testid":"queues-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:r("Export")}),(0,s.jsx)(L,{children:r("Queue")}),(0,s.jsx)(L,{children:r("Mode")}),(0,s.jsx)(L,{children:r("Binding")}),(0,s.jsx)(L,{children:r("Dead-letter")})]})}),(0,s.jsxs)(Je,{children:[l.map(Et),[...d].map(p=>{let[f,x]=p;return(0,s.jsxs)(M.Fragment,{children:[(0,s.jsx)(H,{className:"bg-muted/40","data-testid":`queues-topic-${f}`,children:(0,s.jsx)(S,{className:"text-xs font-medium",colSpan:5,children:r("Topic {topic} \xB7 {count} subscriptions",{count:x.length,topic:f})})}),x.map(Mt)]},f)})]})]})})})]}),e[0]=t,e[1]=o,e[2]=r,e[3]=a}else a=e[3];return a},"qt"),Ct=c(n=>{let e=(0,$.c)(67),{message:t,onReplay:o,replayingId:r}=n,a=O(),l,d,i,u,p,f,x,m,h,N;if(e[0]!==t.attempts||e[1]!==t.body||e[2]!==t.deadLettered||e[3]!==t.exportName||e[4]!==t.id||e[5]!==t.messageId||e[6]!==t.outcome||e[7]!==t.queue||e[8]!==a){let R=Nt(t.body);d=H,f=`queues-message-${t.id}`;let _=t.exportName??t.queue;e[19]!==_?(x=(0,s.jsx)(S,{className:"font-mono text-xs",children:_}),e[19]=_,e[20]=x):x=e[20],e[21]!==t.messageId?(m=(0,s.jsx)(S,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:t.messageId,children:t.messageId}),e[21]=t.messageId,e[22]=m):m=e[22],e[23]!==t.attempts?(h=(0,s.jsx)(S,{className:"font-mono text-xs tabular-nums",children:t.attempts}),e[23]=t.attempts,e[24]=h):h=e[24];let k=`queues-outcome-${t.id}`,w;e[25]!==t.outcome?(w=qt(t.outcome),e[25]=t.outcome,e[26]=w):w=e[26];let T;e[27]!==t.outcome||e[28]!==k||e[29]!==w?(T=(0,s.jsx)(me,{"data-testid":k,variant:w,children:t.outcome}),e[27]=t.outcome,e[28]=k,e[29]=w,e[30]=T):T=e[30];let I;e[31]!==t.deadLettered||e[32]!==t.id||e[33]!==a?(I=t.deadLettered&&(0,s.jsx)(me,{"data-testid":`queues-dlq-${t.id}`,variant:"destructive",children:a("DLQ")}),e[31]=t.deadLettered,e[32]=t.id,e[33]=a,e[34]=I):I=e[34],e[35]!==T||e[36]!==I?(N=(0,s.jsx)(S,{children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[T,I]})}),e[35]=T,e[36]=I,e[37]=N):N=e[37],l=S,i="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=R,p=bt(R),e[0]=t.attempts,e[1]=t.body,e[2]=t.deadLettered,e[3]=t.exportName,e[4]=t.id,e[5]=t.messageId,e[6]=t.outcome,e[7]=t.queue,e[8]=a,e[9]=l,e[10]=d,e[11]=i,e[12]=u,e[13]=p,e[14]=f,e[15]=x,e[16]=m,e[17]=h,e[18]=N}else l=e[9],d=e[10],i=e[11],u=e[12],p=e[13],f=e[14],x=e[15],m=e[16],h=e[17],N=e[18];let y;e[38]!==l||e[39]!==i||e[40]!==u||e[41]!==p?(y=(0,s.jsx)(l,{className:i,title:u,children:p}),e[38]=l,e[39]=i,e[40]=u,e[41]=p,e[42]=y):y=e[42];let b;e[43]!==t.capturedAt?(b=Ke(t.capturedAt,"\u2014"),e[43]=t.capturedAt,e[44]=b):b=e[44];let C;e[45]!==b?(C=(0,s.jsx)(S,{className:"text-xs text-muted-foreground tabular-nums",children:b}),e[45]=b,e[46]=C):C=e[46];let q=`queues-replay-${t.id}`,v=r!==null,E;e[47]!==t.id||e[48]!==r||e[49]!==a?(E=r===t.id?a("Replaying\u2026"):a("Replay"),e[47]=t.id,e[48]=r,e[49]=a,e[50]=E):E=e[50];let A;e[51]!==t.id||e[52]!==o||e[53]!==q||e[54]!==v||e[55]!==E?(A=(0,s.jsx)(S,{children:(0,s.jsx)(pe,{"data-id":t.id,"data-testid":q,disabled:v,onClick:o,size:"xs",type:"button",variant:"outline",children:E})}),e[51]=t.id,e[52]=o,e[53]=q,e[54]=v,e[55]=E,e[56]=A):A=e[56];let D;return e[57]!==d||e[58]!==C||e[59]!==A||e[60]!==f||e[61]!==x||e[62]!==m||e[63]!==h||e[64]!==N||e[65]!==y?(D=(0,s.jsxs)(d,{"data-testid":f,children:[x,m,h,N,y,C,A]}),e[57]=d,e[58]=C,e[59]=A,e[60]=f,e[61]=x,e[62]=m,e[63]=h,e[64]=N,e[65]=y,e[66]=D):D=e[66],D},"St"),wt=c(n=>{let e=(0,$.c)(29),{hasError:t,messages:o,onClear:r,onReplay:a,replayingId:l}=n,d=O(),i;e[0]!==d?(i=d("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=d,e[1]=i):i=e[1];let u;e[2]!==i?(u=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=u):u=e[3];let p;e[4]!==d?(p=d("Clear the whole message log?"),e[4]=d,e[5]=p):p=e[5];let f=o.length===0,x;e[6]!==d?(x=d("Clear log"),e[6]=d,e[7]=x):x=e[7];let m;e[8]!==r||e[9]!==p||e[10]!==f||e[11]!==x?(m=(0,s.jsx)("div",{className:"ml-auto",children:(0,s.jsx)(Ze,{confirmLabel:p,disabled:f,onConfirm:r,testId:"queues-clear",children:x})}),e[8]=r,e[9]=p,e[10]=f,e[11]=x,e[12]=m):m=e[12];let h;e[13]!==o.length||e[14]!==d?(h=o.length>0&&(0,s.jsx)(me,{"data-testid":"queues-count",variant:"secondary",children:d("{count} messages",{count:o.length})}),e[13]=o.length,e[14]=d,e[15]=h):h=e[15];let N;e[16]!==u||e[17]!==m||e[18]!==h?(N=(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,m,h]}),e[16]=u,e[17]=m,e[18]=h,e[19]=N):N=e[19];let y;e[20]!==t||e[21]!==o||e[22]!==a||e[23]!==l||e[24]!==d?(y=!t&&o.length===0?(0,s.jsx)(he,{description:d("Consumed messages appear here once a push consumer processes a batch in dev. Send one from the Send tab to see it captured."),testId:"queues-messages-empty",title:d("No consumed messages yet.")}):(0,s.jsx)(ke,{className:"overflow-hidden py-0",children:(0,s.jsx)(Be,{className:"px-0",children:(0,s.jsx)(st,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,s.jsxs)(Re,{"data-testid":"queues-messages-table",children:[(0,s.jsx)(_e,{children:(0,s.jsxs)(H,{children:[(0,s.jsx)(L,{children:d("Export")}),(0,s.jsx)(L,{children:d("Message")}),(0,s.jsx)(L,{children:d("Attempts")}),(0,s.jsx)(L,{children:d("Outcome")}),(0,s.jsx)(L,{children:d("Body")}),(0,s.jsx)(L,{children:d("Captured")}),(0,s.jsx)(L,{})]})}),(0,s.jsx)(Je,{children:o.map(C=>(0,s.jsx)(Ct,{message:C,onReplay:a,replayingId:l},C.id))})]})})})}),e[20]=t,e[21]=o,e[22]=a,e[23]=l,e[24]=d,e[25]=y):y=e[25];let b;return e[26]!==N||e[27]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[N,y]}),e[26]=N,e[27]=y,e[28]=b):b=e[28],b},"Et"),It=c(n=>{let e=(0,$.c)(20),{batchMode:t,bodyText:o,delayText:r,onBatchModeChange:a,onBodyChange:l,onDelayChange:d,onSelectExport:i,onSend:u,queues:p,selectedExportName:f,sending:x}=n,m=O(),h;e[0]!==m?(h=m("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=m,e[1]=h):h=e[1];let N;e[2]!==h?(N=(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[2]=h,e[3]=N):N=e[3];let y;e[4]!==t||e[5]!==o||e[6]!==r||e[7]!==a||e[8]!==l||e[9]!==d||e[10]!==i||e[11]!==u||e[12]!==p||e[13]!==f||e[14]!==x||e[15]!==m?(y=p.length===0?(0,s.jsx)(he,{description:m("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:m("No queues to send to")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsxs)("select",{"aria-label":m("Queue"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"queues-send-select",onChange:i,value:f,children:[p.map(At),[...je(p).topics].map(C=>{let[q,v]=C;return(0,s.jsx)("option",{value:rt(q),children:m("{topic} (topic \u2192 {count} subscriptions)",{count:v.length,topic:q})},q)})]}),(0,s.jsx)(Ge,{"aria-label":m("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:d,placeholder:m("Delay (s)"),type:"number",value:r}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,s.jsx)("input",{checked:t,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:a,type:"checkbox"}),m("Send as batch (JSON array)")]}),(0,s.jsx)(pe,{className:"ml-auto","data-testid":"queues-send-button",disabled:x||f==="",onClick:u,type:"button",children:m(x?"Sending\u2026":"Send message")})]}),(0,s.jsx)(et,{"aria-label":m("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:l,placeholder:t?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:o})]}),e[4]=t,e[5]=o,e[6]=r,e[7]=a,e[8]=l,e[9]=d,e[10]=i,e[11]=u,e[12]=p,e[13]=f,e[14]=x,e[15]=m,e[16]=y):y=e[16];let b;return e[17]!==N||e[18]!==y?(b=(0,s.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[N,y]}),e[17]=N,e[18]=y,e[19]=b):b=e[19],b},"Tt"),Qt=c((n,e,t,o)=>{let r=null,a=n.trim();if(a!=="")try{r=JSON.parse(a)}catch{return{error:o("Body must be valid JSON.")}}let l,d=e.trim();if(d!==""){let i=Number(d);if(!Number.isFinite(i)||i<0)return{error:o("Delay must be a non-negative number of seconds.")};l=i}return t&&!Array.isArray(r)?{error:o("Batch mode needs a JSON array body \u2014 each element is enqueued as one message.")}:{body:r,delaySeconds:l}},"Ct"),Lt=c(n=>{let e=(0,$.c)(11),{deadLetteredCount:t,queuesWithoutDlq:o}=n,r=O(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,s.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),e[0]=a):a=e[0];let l;e[1]!==o||e[2]!==r?(l=o.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"font-medium",children:r("No dead-letter queue on {queues}.",{queues:o.map(Tt).join(", ")})}),(0,s.jsx)("p",{className:"text-muted-foreground",children:r("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),e[1]=o,e[2]=r,e[3]=l):l=e[3];let d;e[4]!==t||e[5]!==o.length||e[6]!==r?(d=t>0&&(0,s.jsx)("p",{className:o.length>0?"text-muted-foreground":"font-medium",children:t===1?r("1 message was recently dead-lettered."):r("{count} messages were recently dead-lettered.",{count:t})}),e[4]=t,e[5]=o.length,e[6]=r,e[7]=d):d=e[7];let i;return e[8]!==l||e[9]!==d?(i=(0,s.jsx)(Xe,{icon:a,testId:"queues-dlq-warning",variant:"warning",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[l,d]})}),e[8]=l,e[9]=d,e[10]=i):i=e[10],i},"_t"),Zt=c(n=>{let e=(0,$.c)(76),{limit:t}=n,o=t??ht,r=Ve(),a=O(),[l,d]=(0,M.useState)("declared"),[i,u]=(0,M.useState)(null),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let{data:f,error:x,errorSource:m}=Oe(G.listQueues,p),h;e[1]!==o?(h={limit:o},e[1]=o,e[2]=h):h=e[2];let{data:N,error:y,errorSource:b,poll:C,refetch:q}=Oe(G.getQueueMessages,h),v=Array.isArray(f?.queues)?[...f.queues].toSorted(Dt):[],E=N?.entries??[],{deadLetteredCount:A,queuesWithoutDlq:D,showReliabilityWarning:R}=mt(v,E),[_,k]=(0,M.useState)(""),[w,T]=(0,M.useState)(""),[I,ye]=(0,M.useState)(""),[B,Ne]=(0,M.useState)(!1),[be,V]=(0,M.useState)(!1),[qe,X]=(0,M.useState)(null),{topics:Y}=je(v),Fe=[...v.map($t),...[...Y.keys()].map(kt)],J=Fe.includes(_)?_:Fe[0]??"",ze=l==="messages"?y:x,ot=l==="messages"?b:m,ve=ze??i,Se=ze===null?i:ot;tt(C,l==="messages");let Z;e[3]!==B||e[4]!==w||e[5]!==r||e[6]!==I||e[7]!==q||e[8]!==J||e[9]!==V||e[10]!==a||e[11]!==Y?(Z=c(async()=>{u(null);let g=J;if(g==="")return;let Q=Qt(w,I,B,a);if("error"in Q){u(Q.error);return}let{body:Pe,delaySeconds:Ue}=Q;V(!0);let lt=pt(g,Y).map(ce=>B?{batch:Pe,delaySeconds:Ue,exportName:ce}:{body:Pe,delaySeconds:Ue,exportName:ce});try{u(await ft(r,lt,a)),q()}catch(ce){u(K(ce))}V(!1)},"K"),e[3]=B,e[4]=w,e[5]=r,e[6]=I,e[7]=q,e[8]=J,e[9]=V,e[10]=a,e[11]=Y,e[12]=Z):Z=e[12];let Ce=Z,ee;e[13]!==r||e[14]!==q||e[15]!==X?(ee=c(async g=>{u(null),X(g);try{await r.query(xt,{id:g},fe("")),q()}catch(Q){u(K(Q))}X(null)},"Z"),e[13]=r,e[14]=q,e[15]=X,e[16]=ee):ee=e[16];let we=ee,te;e[17]!==r||e[18]!==q?(te=c(async()=>{u(null);try{await r.query(yt,{},fe("")),q()}catch(g){u(K(g))}},"ee"),e[17]=r,e[18]=q,e[19]=te):te=e[19];let Ie=te,se;e[20]===Symbol.for("react.memo_cache_sentinel")?(se=c(g=>{let Q=g.currentTarget.dataset.tab;(Q==="declared"||Q==="messages"||Q==="send")&&d(Q)},"te"),e[20]=se):se=e[20];let dt=se,ae;e[21]!==k?(ae=c(g=>{k(g.currentTarget.value)},"se"),e[21]=k,e[22]=ae):ae=e[22];let Qe=ae,re;e[23]!==T?(re=c(g=>{T(g.currentTarget.value)},"re"),e[23]=T,e[24]=re):re=e[24];let Le=re,ne;e[25]!==ye?(ne=c(g=>{ye(g.currentTarget.value)},"ae"),e[25]=ye,e[26]=ne):ne=e[26];let Ee=ne,oe;e[27]!==Ne?(oe=c(g=>{Ne(g.currentTarget.checked)},"ne"),e[27]=Ne,e[28]=oe):oe=e[28];let Me=oe,de;e[29]!==Ce?(de=c(()=>{xe(Ce())},"oe"),e[29]=Ce,e[30]=de):de=e[30];let Ae=de,le;e[31]!==we?(le=c(g=>{let{id:Q}=g.currentTarget.dataset;Q!==void 0&&xe(we(Q))},"le"),e[31]=we,e[32]=le):le=e[32];let Te=le,ie;e[33]!==Ie?(ie=c(()=>{xe(Ie())},"ie"),e[33]=Ie,e[34]=ie):ie=e[34];let De=ie,W;e[35]!==a||e[36]!==l?(W=(0,s.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(g=>(0,s.jsx)(pe,{"aria-selected":l===g,"data-tab":g,"data-testid":`queues-tab-${g}`,onClick:dt,role:"tab",size:"sm",type:"button",variant:l===g?"secondary":"ghost",children:vt(g,a)},g))}),e[35]=a,e[36]=l,e[37]=W):W=e[37];let j;e[38]!==ve||e[39]!==Se?(j=ve!==null&&(0,s.jsx)(Ye,{error:Se,testId:"queues-error"}),e[38]=ve,e[39]=Se,e[40]=j):j=e[40];let F;e[41]!==A||e[42]!==D||e[43]!==R?(F=R&&(0,s.jsx)(Lt,{deadLetteredCount:A,queuesWithoutDlq:D}),e[41]=A,e[42]=D,e[43]=R,e[44]=F):F=e[44];let z;e[45]!==v||e[46]!==f||e[47]!==l?(z=l==="declared"&&(0,s.jsx)(St,{loaded:f!==void 0,queues:v}),e[45]=v,e[46]=f,e[47]=l,e[48]=z):z=e[48];let P;e[49]!==E||e[50]!==y||e[51]!==De||e[52]!==Te||e[53]!==qe||e[54]!==l?(P=l==="messages"&&(0,s.jsx)(wt,{hasError:y!==null,messages:E,onClear:De,onReplay:Te,replayingId:qe}),e[49]=E,e[50]=y,e[51]=De,e[52]=Te,e[53]=qe,e[54]=l,e[55]=P):P=e[55];let U;e[56]!==B||e[57]!==w||e[58]!==I||e[59]!==Me||e[60]!==Le||e[61]!==Ee||e[62]!==Qe||e[63]!==Ae||e[64]!==v||e[65]!==J||e[66]!==be||e[67]!==l?(U=l==="send"&&(0,s.jsx)(It,{batchMode:B,bodyText:w,delayText:I,onBatchModeChange:Me,onBodyChange:Le,onDelayChange:Ee,onSelectExport:Qe,onSend:Ae,queues:v,selectedExportName:J,sending:be}),e[56]=B,e[57]=w,e[58]=I,e[59]=Me,e[60]=Le,e[61]=Ee,e[62]=Qe,e[63]=Ae,e[64]=v,e[65]=J,e[66]=be,e[67]=l,e[68]=U):U=e[68];let ue;return e[69]!==W||e[70]!==j||e[71]!==F||e[72]!==z||e[73]!==P||e[74]!==U?(ue=(0,s.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-queues-panel",children:[W,j,F,z,P,U]}),e[69]=W,e[70]=j,e[71]=F,e[72]=z,e[73]=P,e[74]=U,e[75]=ue):ue=e[75],ue},"ts");function Et(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Et,"vt");function Mt(n){return(0,s.jsx)(nt,{queue:n},n.exportName)}c(Mt,"wt");function At(n){return(0,s.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}c(At,"Qt");function Tt(n){return n.name}c(Tt,"At");function Dt(n,e){return n.exportName.localeCompare(e.exportName)}c(Dt,"It");function $t(n){return n.exportName}c($t,"Mt");function kt(n){return rt(n)}c(kt,"Lt");export{Zt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as we}from"./chunk-P6L6ABWO.js";import{a as ve}from"./chunk-ZWDORIZY.js";import{i as ie}from"./chunk-SDQH4HR6.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as U}from"./chunk-2O6KKVH2.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import"./chunk-4C4THJUD.js";import{a as te}from"./chunk-6UTZXEW3.js";import{c as Ne}from"./chunk-4SJDWMH3.js";import{p as ue}from"./chunk-FKM35PXF.js";import"./chunk-WZTY3ZYI.js";import{a as de}from"./chunk-3Y5K3IQO.js";import{a as ae,b as re,c as ne,d as j,e as h,f as p}from"./chunk-CW57Q264.js";import{a as Y,e as ee}from"./chunk-MD67S53Z.js";import{f as X,h as ce,i as me,j as z,p as pe,s as q}from"./chunk-LPINY2IJ.js";import{a as s,d as he,e as ke,f as be,g as Se}from"./chunk-OXFKZ4BM.js";var xe=he(be(),1),i=he(ke(),1);var t=he(Se(),1);var Ce=["queued","running","rollingBack","paused","waiting","complete","errored","terminated"],Oe=["pause","resume","restart","terminate"],Ie=s(l=>{let e=(0,xe.c)(7),{busy:w,id:x,onAct:N}=l,b=X(),a;e[0]!==w||e[1]!==x||e[2]!==N||e[3]!==b?(a=Oe.map(m=>m==="restart"?(0,t.jsx)(ve,{confirmLabel:b("Restart?"),disabled:w,onConfirm:s(()=>{N(m)},"onConfirm"),testId:`workflow-instance-${m}-${x}`,children:b(m)},m):(0,t.jsx)(U,{"data-testid":`workflow-instance-${m}-${x}`,disabled:w,onClick:s(()=>{N(m)},"onClick"),size:"sm",type:"button",variant:"ghost",children:b(m)},m)),e[0]=w,e[1]=x,e[2]=N,e[3]=b,e[4]=a):a=e[4];let d;return e[5]!==a?(d=(0,t.jsx)(t.Fragment,{children:a}),e[5]=a,e[6]=d):d=e[6],d},"Ce"),$e="WORKFLOWS_NOT_CONFIGURED",We=s(l=>typeof l=="object"&&l!==null&&l.code===$e,"Oe"),Ae=s(l=>{let e=l.error??l.output;if(e===void 0)return"\u2014";try{return JSON.stringify(e,pe)}catch{return"(unserializable)"}},"Ee"),Te=s(({loadDetail:l,loadInstances:e,readOnly:w,runAction:x,workflowName:N})=>{let b=ue(),a=X(),[d,m]=(0,i.useState)(null),[v,L]=(0,i.useState)(null),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(null),[F,W]=(0,i.useState)(!1),[_,R]=(0,i.useState)(null),g=(0,i.useRef)(0),y=(0,i.useRef)(0),k=(0,i.useRef)(0),A=l??(n=>b.getWorkflowInstance(n)),I=w?void 0:x??(e===void 0?n=>b.setWorkflowInstanceStatus(n):void 0),T=s(async()=>{y.current+=1;let n=y.current;O(null),W(!1);let u=S===""?void 0:S;try{if(e===void 0){let r=await b.listWorkflowInstances({name:N,status:u});if(n!==y.current)return;if(r.configured===!1){m(null),W(!0);return}m(r.instances);return}let f=await e({name:N,status:u});n===y.current&&m(f)}catch(f){if(n!==y.current)return;m(null),We(f)?W(!0):O(z(f))}},"E");(0,i.useEffect)(()=>{g.current+=1,k.current+=1,L(null),q(T())},[N,S]);let P=s(async n=>{k.current+=1;let u=k.current;O(null);try{let f=await A({id:n,name:N});u===k.current&&L(f)}catch(f){u===k.current&&O(z(f))}},"W"),E=s(()=>{k.current+=1,L(null)},"A"),J=s(async(n,u)=>{if(I===void 0)return;let f=g.current;R(n),O(null);try{await I({action:u,id:n,name:N}),f===g.current&&await T()}catch(r){O(z(r))}R(null)},"L");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:a("Instance history")}),(0,t.jsxs)("select",{"aria-label":a("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:s(n=>{B(n.target.value)},"onChange"),value:S,children:[(0,t.jsx)("option",{value:"",children:a("All statuses")}),Ce.map(n=>(0,t.jsx)("option",{value:n,children:n},n))]})]}),C!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:C}),F&&(0,t.jsx)(de,{description:a("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:a("Workflow inspection not configured")}),!F&&d!==null&&d.length===0&&(0,t.jsx)(de,{description:a("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:a("No instances")}),d!==null&&d.length>0&&(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflow-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:a("Instance id")}),(0,t.jsx)(h,{children:a("Status")}),(0,t.jsx)(h,{children:a("Created")}),(0,t.jsx)(h,{children:a("Ended")}),(0,t.jsx)(h,{"aria-label":a("Actions")})]})}),(0,t.jsx)(ne,{children:d.map(n=>(0,t.jsxs)(j,{"data-testid":`workflow-instance-${n.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:n.status}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.createdOn??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.endedOn??"\u2014"}),(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)(U,{"data-testid":`workflow-instance-steps-${n.id}`,onClick:s(()=>{q(P(n.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:a("Steps")}),I!==void 0&&(0,t.jsx)(Ie,{busy:_===n.id,id:n.id,onAct:s(u=>{q(J(n.id,u))},"onAct")},N)]})})]},n.id))})]})})}),v!==null&&(0,t.jsx)(Y,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,t.jsxs)(ee,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"font-mono text-xs",children:[a("Steps")," \xB7 ",v.id]}),(0,t.jsx)(U,{"data-testid":"workflow-instance-detail-close",onClick:E,size:"xs",type:"button",variant:"ghost",children:a("Close")})]}),v.steps.length===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a("This instance has no recorded steps yet.")}):(0,t.jsxs)(ae,{"data-testid":"workflow-instance-steps",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:a("Step")}),(0,t.jsx)(h,{children:a("Type")}),(0,t.jsx)(h,{children:a("Attempts")}),(0,t.jsx)(h,{children:a("Started")}),(0,t.jsx)(h,{children:a("Output")})]})}),(0,t.jsx)(ne,{children:v.steps.map((n,u)=>(0,t.jsxs)(j,{"data-testid":`workflow-step-${String(u)}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.name}),(0,t.jsx)(p,{className:"text-xs text-muted-foreground",children:n.type??"\u2014"}),(0,t.jsx)(p,{className:"tabular-nums",children:n.attempts??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.start??"\u2014"}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:Ae(n)})]},`${n.name}:${String(u)}`))})]})]})})]})},"_e"),_e=ce(te.createWorkflowInstance),Ee=ce(te.getWorkflowInstanceStatus),Je=ce(te.sendWorkflowEvent),De=s(l=>{if(l.error)return`${l.error.name}: ${l.error.message}`;if(l.output===void 0)return"\u2014";try{return JSON.stringify(l.output,pe)}catch{return"(unserializable)"}},"$e"),ge=s(l=>{let e=l.trim();if(e==="")return{value:void 0};try{return{value:JSON.parse(e)}}catch{return null}},"ve"),Fe=s((l,e)=>l.some(w=>w.exportName===e)?e:l[0]?.exportName??"","Fe"),Pe=s(l=>{let e=(0,xe.c)(72),{eventTypes:w,exportName:x,onSent:N}=l,b=ue(),a=X(),[d,m]=(0,i.useState)(""),[v,L]=(0,i.useState)(""),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(!1),[F,W]=(0,i.useState)(null),_;e[0]!==b||e[1]!==x||e[2]!==N||e[3]!==a||e[4]!==v?(_=s(async(D,oe)=>{try{await b.query(Je,{exportName:x,id:D,payload:oe,type:v},me(""))}catch(fe){W(z(fe));return}try{await N(x,D)}catch(fe){let ye=fe;W(`${a("Event sent, but refreshing the instance failed")}: ${z(ye)}`)}},"_"),e[0]=b,e[1]=x,e[2]=N,e[3]=a,e[4]=v,e[5]=_):_=e[5];let R=_,g;e[6]!==R||e[7]!==d||e[8]!==S||e[9]!==a?(g=s(async()=>{let D=d.trim(),oe=ge(S);if(oe===null){W(a("Payload must be valid JSON"));return}O(!0),W(null),await R(D,oe.value).finally(()=>{O(!1)})},"N"),e[6]=R,e[7]=d,e[8]=S,e[9]=a,e[10]=g):g=e[10];let y=g,k;e[11]!==a?(k=a("Send event"),e[11]=a,e[12]=k):k=e[12];let A;e[13]!==k?(A=(0,t.jsx)("h3",{className:"text-sm font-medium",children:k}),e[13]=k,e[14]=A):A=e[14];let I;e[15]!==F?(I=F!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-event-error",role:"alert",children:F}),e[15]=F,e[16]=I):I=e[16];let T;e[17]!==a?(T=a("Instance id"),e[17]=a,e[18]=T):T=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=s(D=>{m(D.target.value)},"O"),e[19]=P):P=e[19];let E;e[20]!==a?(E=a("Instance id"),e[20]=a,e[21]=E):E=e[21];let J;e[22]!==d||e[23]!==T||e[24]!==E?(J=(0,t.jsx)(ie,{"aria-label":T,className:"max-w-48","data-testid":"workflows-event-id",onChange:P,placeholder:E,value:d}),e[22]=d,e[23]=T,e[24]=E,e[25]=J):J=e[25];let n;e[26]!==a?(n=a("Event type"),e[26]=a,e[27]=n):n=e[27];let u;e[28]===Symbol.for("react.memo_cache_sentinel")?(u=s(D=>{L(D.target.value)},"L"),e[28]=u):u=e[28];let f;e[29]!==a?(f=a("Event type"),e[29]=a,e[30]=f):f=e[30];let r;e[31]!==n||e[32]!==f||e[33]!==v?(r=(0,t.jsx)(ie,{"aria-label":n,className:"max-w-48","data-testid":"workflows-event-type",list:"workflows-event-types",onChange:u,placeholder:f,value:v}),e[31]=n,e[32]=f,e[33]=v,e[34]=r):r=e[34];let c;e[35]!==w?(c=w.map(je),e[35]=w,e[36]=c):c=e[36];let o;e[37]!==c?(o=(0,t.jsx)("datalist",{"data-testid":"workflows-event-types",id:"workflows-event-types",children:c}),e[37]=c,e[38]=o):o=e[38];let $;e[39]!==x||e[40]!==d||e[41]!==C||e[42]!==v?($=C||x===""||d.trim()===""||v.trim()==="",e[39]=x,e[40]=d,e[41]=C,e[42]=v,e[43]=$):$=e[43];let K;e[44]!==y?(K=s(()=>{q(y())},"z"),e[44]=y,e[45]=K):K=e[45];let G;e[46]!==C||e[47]!==a?(G=a(C?"Sending\u2026":"Send event"),e[46]=C,e[47]=a,e[48]=G):G=e[48];let M;e[49]!==$||e[50]!==K||e[51]!==G?(M=(0,t.jsx)(U,{"data-testid":"workflows-event-button",disabled:$,onClick:K,children:G}),e[49]=$,e[50]=K,e[51]=G,e[52]=M):M=e[52];let Z;e[53]!==r||e[54]!==o||e[55]!==M||e[56]!==J?(Z=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[J,r,o,M]}),e[53]=r,e[54]=o,e[55]=M,e[56]=J,e[57]=Z):Z=e[57];let H;e[58]!==a?(H=a("Payload (JSON)"),e[58]=a,e[59]=H):H=e[59];let se;e[60]===Symbol.for("react.memo_cache_sentinel")?(se=s(D=>{B(D.target.value)},"Y"),e[60]=se):se=e[60];let Q;e[61]!==a?(Q=a("Payload (JSON, optional)"),e[61]=a,e[62]=Q):Q=e[62];let V;e[63]!==S||e[64]!==H||e[65]!==Q?(V=(0,t.jsx)(we,{"aria-label":H,className:"font-mono","data-testid":"workflows-event-payload",onChange:se,placeholder:Q,value:S}),e[63]=S,e[64]=H,e[65]=Q,e[66]=V):V=e[66];let le;return e[67]!==Z||e[68]!==V||e[69]!==A||e[70]!==I?(le=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-event",children:[A,I,Z,V]}),e[67]=Z,e[68]=V,e[69]=A,e[70]=I,e[71]=le):le=e[71],le},"Pe"),Ve=s(()=>{let l=ue(),e=X(),{data:w,error:x}=Ne(te.listWorkflows,{}),[N,b]=(0,i.useState)(""),[a,d]=(0,i.useState)(""),[m,v]=(0,i.useState)(""),[L,S]=(0,i.useState)(!1),[B,C]=(0,i.useState)(null),[O,F]=(0,i.useState)([]),[W,_]=(0,i.useState)(null),R=w!==void 0,g=Array.isArray(w?.workflows)?[...w.workflows].toSorted((r,c)=>r.exportName.localeCompare(c.exportName)):[],y=Fe(g,N),k=g.find(r=>r.exportName===y),A=s(r=>{F(c=>{let o=c.filter($=>!($.exportName===r.exportName&&$.id===r.id));return[r,...o]})},"T"),I=s(async()=>{let r=y;if(r==="")return;let c=ge(m);if(c===null){C(e("Params must be valid JSON"));return}S(!0),C(null);try{let o=a.trim(),$=await l.query(_e,{exportName:r,id:o===""?void 0:o,params:c.value},me(""));A({exportName:r,id:$.id,status:$.status}),d("")}catch(o){C(z(o))}S(!1)},"F"),T=s(()=>{q(I())},"P"),P=s(async(r,c)=>{_(c);try{let o=await l.query(Ee,{exportName:r,id:c},me(""));A({error:o.error,exportName:r,id:o.id,output:o.output,status:o.status})}catch(o){throw _(null),o}_(null)},"O"),E=s(async(r,c)=>{try{await P(r,c)}catch(o){C(z(o))}},"E"),J=s(r=>{b(r.target.value)},"W"),n=s(r=>{d(r.target.value)},"A"),u=s(r=>{v(r.target.value)},"L"),f=s(r=>{let{export:c,id:o}=r.currentTarget.dataset;c!==void 0&&o!==void 0&&q(E(c,o))},"n");return(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:x}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),R&&g.length===0?(0,t.jsx)(de,{description:e("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:e("No workflows defined")}):(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:e("Export")}),(0,t.jsx)(h,{children:e("Name")}),(0,t.jsx)(h,{children:e("Class")})]})}),(0,t.jsx)(ne,{children:g.map(r=>(0,t.jsxs)(j,{"data-testid":`workflows-row-${r.exportName}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.name}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.className})]},r.exportName))})]})})}),g.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Start instance")}),B!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:B}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":e("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:J,value:y,children:g.map(r=>(0,t.jsx)("option",{value:r.exportName,children:r.exportName},r.exportName))}),(0,t.jsx)(ie,{"aria-label":e("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:n,placeholder:e("Instance id (optional)"),value:a}),(0,t.jsx)(U,{"data-testid":"workflows-start-button",disabled:L||y==="",onClick:T,children:e(L?"Starting\u2026":"Start instance")})]}),(0,t.jsx)(we,{"aria-label":e("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:u,placeholder:e("Params (JSON, optional)"),value:m})]}),g.length>0&&(0,t.jsx)(Pe,{eventTypes:w?.eventTypes??[],exportName:y,onSent:P},y),O.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Instances")}),(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:e("Workflow")}),(0,t.jsx)(h,{children:e("Instance id")}),(0,t.jsx)(h,{children:e("Status")}),(0,t.jsx)(h,{children:e("Output")}),(0,t.jsx)(h,{})]})}),(0,t.jsx)(ne,{children:O.map(r=>(0,t.jsxs)(j,{"data-testid":`workflows-instance-${r.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:r.status}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:De(r)}),(0,t.jsx)(p,{children:(0,t.jsx)(U,{"data-export":r.exportName,"data-id":r.id,"data-testid":`workflows-instance-refresh-${r.id}`,disabled:W===r.id,onClick:f,size:"xs",variant:"outline",children:W===r.id?e("Refreshing\u2026"):e("Refresh")})})]},`${r.exportName}:${r.id}`))})]})})})]}),k!==void 0&&(0,t.jsx)(Te,{workflowName:k.name})]})},"Ze");function je(l){return(0,t.jsx)("option",{value:l,children:l},l)}s(je,"De");export{Ve as default};
|
|
1
|
+
import{a as we}from"./chunk-P6L6ABWO.js";import{a as ve}from"./chunk-ZWDORIZY.js";import{i as ie}from"./chunk-SDQH4HR6.js";import"./chunk-W7MRISE3.js";import"./chunk-IBJVVHV5.js";import{a as U}from"./chunk-2O6KKVH2.js";import"./chunk-JTGGWF7R.js";import"./chunk-ZBON5T5A.js";import"./chunk-4C4THJUD.js";import{a as te}from"./chunk-6UTZXEW3.js";import{c as Ne}from"./chunk-W37HRJGQ.js";import{p as ue}from"./chunk-SDSQIQJG.js";import"./chunk-WZTY3ZYI.js";import{a as de}from"./chunk-3Y5K3IQO.js";import{a as ae,b as re,c as ne,d as j,e as h,f as p}from"./chunk-CW57Q264.js";import{a as Y,e as ee}from"./chunk-MD67S53Z.js";import{f as X,h as ce,i as me,j as z,p as pe,s as q}from"./chunk-LPINY2IJ.js";import{a as s,d as he,e as ke,f as be,g as Se}from"./chunk-OXFKZ4BM.js";var xe=he(be(),1),i=he(ke(),1);var t=he(Se(),1);var Ce=["queued","running","rollingBack","paused","waiting","complete","errored","terminated"],Oe=["pause","resume","restart","terminate"],Ie=s(l=>{let e=(0,xe.c)(7),{busy:w,id:x,onAct:N}=l,b=X(),a;e[0]!==w||e[1]!==x||e[2]!==N||e[3]!==b?(a=Oe.map(m=>m==="restart"?(0,t.jsx)(ve,{confirmLabel:b("Restart?"),disabled:w,onConfirm:s(()=>{N(m)},"onConfirm"),testId:`workflow-instance-${m}-${x}`,children:b(m)},m):(0,t.jsx)(U,{"data-testid":`workflow-instance-${m}-${x}`,disabled:w,onClick:s(()=>{N(m)},"onClick"),size:"sm",type:"button",variant:"ghost",children:b(m)},m)),e[0]=w,e[1]=x,e[2]=N,e[3]=b,e[4]=a):a=e[4];let d;return e[5]!==a?(d=(0,t.jsx)(t.Fragment,{children:a}),e[5]=a,e[6]=d):d=e[6],d},"Ce"),$e="WORKFLOWS_NOT_CONFIGURED",We=s(l=>typeof l=="object"&&l!==null&&l.code===$e,"Oe"),Ae=s(l=>{let e=l.error??l.output;if(e===void 0)return"\u2014";try{return JSON.stringify(e,pe)}catch{return"(unserializable)"}},"Ee"),Te=s(({loadDetail:l,loadInstances:e,readOnly:w,runAction:x,workflowName:N})=>{let b=ue(),a=X(),[d,m]=(0,i.useState)(null),[v,L]=(0,i.useState)(null),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(null),[F,W]=(0,i.useState)(!1),[_,R]=(0,i.useState)(null),g=(0,i.useRef)(0),y=(0,i.useRef)(0),k=(0,i.useRef)(0),A=l??(n=>b.getWorkflowInstance(n)),I=w?void 0:x??(e===void 0?n=>b.setWorkflowInstanceStatus(n):void 0),T=s(async()=>{y.current+=1;let n=y.current;O(null),W(!1);let u=S===""?void 0:S;try{if(e===void 0){let r=await b.listWorkflowInstances({name:N,status:u});if(n!==y.current)return;if(r.configured===!1){m(null),W(!0);return}m(r.instances);return}let f=await e({name:N,status:u});n===y.current&&m(f)}catch(f){if(n!==y.current)return;m(null),We(f)?W(!0):O(z(f))}},"E");(0,i.useEffect)(()=>{g.current+=1,k.current+=1,L(null),q(T())},[N,S]);let P=s(async n=>{k.current+=1;let u=k.current;O(null);try{let f=await A({id:n,name:N});u===k.current&&L(f)}catch(f){u===k.current&&O(z(f))}},"W"),E=s(()=>{k.current+=1,L(null)},"A"),J=s(async(n,u)=>{if(I===void 0)return;let f=g.current;R(n),O(null);try{await I({action:u,id:n,name:N}),f===g.current&&await T()}catch(r){O(z(r))}R(null)},"L");return(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-workflow-instances",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:a("Instance history")}),(0,t.jsxs)("select",{"aria-label":a("Filter by status"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflow-instances-filter",onChange:s(n=>{B(n.target.value)},"onChange"),value:S,children:[(0,t.jsx)("option",{value:"",children:a("All statuses")}),Ce.map(n=>(0,t.jsx)("option",{value:n,children:n},n))]})]}),C!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflow-instances-error",role:"alert",children:C}),F&&(0,t.jsx)(de,{description:a("Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .dev.vars to enable workflow instance history."),testId:"workflow-instances-unconfigured",title:a("Workflow inspection not configured")}),!F&&d!==null&&d.length===0&&(0,t.jsx)(de,{description:a("No instances match this filter for the selected workflow."),testId:"workflow-instances-empty",title:a("No instances")}),d!==null&&d.length>0&&(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflow-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:a("Instance id")}),(0,t.jsx)(h,{children:a("Status")}),(0,t.jsx)(h,{children:a("Created")}),(0,t.jsx)(h,{children:a("Ended")}),(0,t.jsx)(h,{"aria-label":a("Actions")})]})}),(0,t.jsx)(ne,{children:d.map(n=>(0,t.jsxs)(j,{"data-testid":`workflow-instance-${n.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:n.status}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.createdOn??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.endedOn??"\u2014"}),(0,t.jsx)(p,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)(U,{"data-testid":`workflow-instance-steps-${n.id}`,onClick:s(()=>{q(P(n.id))},"onClick"),size:"sm",type:"button",variant:"outline",children:a("Steps")}),I!==void 0&&(0,t.jsx)(Ie,{busy:_===n.id,id:n.id,onAct:s(u=>{q(J(n.id,u))},"onAct")},N)]})})]},n.id))})]})})}),v!==null&&(0,t.jsx)(Y,{className:"overflow-hidden py-0","data-testid":"workflow-instance-detail",children:(0,t.jsxs)(ee,{className:"flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"font-mono text-xs",children:[a("Steps")," \xB7 ",v.id]}),(0,t.jsx)(U,{"data-testid":"workflow-instance-detail-close",onClick:E,size:"xs",type:"button",variant:"ghost",children:a("Close")})]}),v.steps.length===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:a("This instance has no recorded steps yet.")}):(0,t.jsxs)(ae,{"data-testid":"workflow-instance-steps",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:a("Step")}),(0,t.jsx)(h,{children:a("Type")}),(0,t.jsx)(h,{children:a("Attempts")}),(0,t.jsx)(h,{children:a("Started")}),(0,t.jsx)(h,{children:a("Output")})]})}),(0,t.jsx)(ne,{children:v.steps.map((n,u)=>(0,t.jsxs)(j,{"data-testid":`workflow-step-${String(u)}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:n.name}),(0,t.jsx)(p,{className:"text-xs text-muted-foreground",children:n.type??"\u2014"}),(0,t.jsx)(p,{className:"tabular-nums",children:n.attempts??"\u2014"}),(0,t.jsx)(p,{className:"text-muted-foreground tabular-nums",children:n.start??"\u2014"}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:Ae(n)})]},`${n.name}:${String(u)}`))})]})]})})]})},"_e"),_e=ce(te.createWorkflowInstance),Ee=ce(te.getWorkflowInstanceStatus),Je=ce(te.sendWorkflowEvent),De=s(l=>{if(l.error)return`${l.error.name}: ${l.error.message}`;if(l.output===void 0)return"\u2014";try{return JSON.stringify(l.output,pe)}catch{return"(unserializable)"}},"$e"),ge=s(l=>{let e=l.trim();if(e==="")return{value:void 0};try{return{value:JSON.parse(e)}}catch{return null}},"ve"),Fe=s((l,e)=>l.some(w=>w.exportName===e)?e:l[0]?.exportName??"","Fe"),Pe=s(l=>{let e=(0,xe.c)(72),{eventTypes:w,exportName:x,onSent:N}=l,b=ue(),a=X(),[d,m]=(0,i.useState)(""),[v,L]=(0,i.useState)(""),[S,B]=(0,i.useState)(""),[C,O]=(0,i.useState)(!1),[F,W]=(0,i.useState)(null),_;e[0]!==b||e[1]!==x||e[2]!==N||e[3]!==a||e[4]!==v?(_=s(async(D,oe)=>{try{await b.query(Je,{exportName:x,id:D,payload:oe,type:v},me(""))}catch(fe){W(z(fe));return}try{await N(x,D)}catch(fe){let ye=fe;W(`${a("Event sent, but refreshing the instance failed")}: ${z(ye)}`)}},"_"),e[0]=b,e[1]=x,e[2]=N,e[3]=a,e[4]=v,e[5]=_):_=e[5];let R=_,g;e[6]!==R||e[7]!==d||e[8]!==S||e[9]!==a?(g=s(async()=>{let D=d.trim(),oe=ge(S);if(oe===null){W(a("Payload must be valid JSON"));return}O(!0),W(null),await R(D,oe.value).finally(()=>{O(!1)})},"N"),e[6]=R,e[7]=d,e[8]=S,e[9]=a,e[10]=g):g=e[10];let y=g,k;e[11]!==a?(k=a("Send event"),e[11]=a,e[12]=k):k=e[12];let A;e[13]!==k?(A=(0,t.jsx)("h3",{className:"text-sm font-medium",children:k}),e[13]=k,e[14]=A):A=e[14];let I;e[15]!==F?(I=F!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-event-error",role:"alert",children:F}),e[15]=F,e[16]=I):I=e[16];let T;e[17]!==a?(T=a("Instance id"),e[17]=a,e[18]=T):T=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=s(D=>{m(D.target.value)},"O"),e[19]=P):P=e[19];let E;e[20]!==a?(E=a("Instance id"),e[20]=a,e[21]=E):E=e[21];let J;e[22]!==d||e[23]!==T||e[24]!==E?(J=(0,t.jsx)(ie,{"aria-label":T,className:"max-w-48","data-testid":"workflows-event-id",onChange:P,placeholder:E,value:d}),e[22]=d,e[23]=T,e[24]=E,e[25]=J):J=e[25];let n;e[26]!==a?(n=a("Event type"),e[26]=a,e[27]=n):n=e[27];let u;e[28]===Symbol.for("react.memo_cache_sentinel")?(u=s(D=>{L(D.target.value)},"L"),e[28]=u):u=e[28];let f;e[29]!==a?(f=a("Event type"),e[29]=a,e[30]=f):f=e[30];let r;e[31]!==n||e[32]!==f||e[33]!==v?(r=(0,t.jsx)(ie,{"aria-label":n,className:"max-w-48","data-testid":"workflows-event-type",list:"workflows-event-types",onChange:u,placeholder:f,value:v}),e[31]=n,e[32]=f,e[33]=v,e[34]=r):r=e[34];let c;e[35]!==w?(c=w.map(je),e[35]=w,e[36]=c):c=e[36];let o;e[37]!==c?(o=(0,t.jsx)("datalist",{"data-testid":"workflows-event-types",id:"workflows-event-types",children:c}),e[37]=c,e[38]=o):o=e[38];let $;e[39]!==x||e[40]!==d||e[41]!==C||e[42]!==v?($=C||x===""||d.trim()===""||v.trim()==="",e[39]=x,e[40]=d,e[41]=C,e[42]=v,e[43]=$):$=e[43];let K;e[44]!==y?(K=s(()=>{q(y())},"z"),e[44]=y,e[45]=K):K=e[45];let G;e[46]!==C||e[47]!==a?(G=a(C?"Sending\u2026":"Send event"),e[46]=C,e[47]=a,e[48]=G):G=e[48];let M;e[49]!==$||e[50]!==K||e[51]!==G?(M=(0,t.jsx)(U,{"data-testid":"workflows-event-button",disabled:$,onClick:K,children:G}),e[49]=$,e[50]=K,e[51]=G,e[52]=M):M=e[52];let Z;e[53]!==r||e[54]!==o||e[55]!==M||e[56]!==J?(Z=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[J,r,o,M]}),e[53]=r,e[54]=o,e[55]=M,e[56]=J,e[57]=Z):Z=e[57];let H;e[58]!==a?(H=a("Payload (JSON)"),e[58]=a,e[59]=H):H=e[59];let se;e[60]===Symbol.for("react.memo_cache_sentinel")?(se=s(D=>{B(D.target.value)},"Y"),e[60]=se):se=e[60];let Q;e[61]!==a?(Q=a("Payload (JSON, optional)"),e[61]=a,e[62]=Q):Q=e[62];let V;e[63]!==S||e[64]!==H||e[65]!==Q?(V=(0,t.jsx)(we,{"aria-label":H,className:"font-mono","data-testid":"workflows-event-payload",onChange:se,placeholder:Q,value:S}),e[63]=S,e[64]=H,e[65]=Q,e[66]=V):V=e[66];let le;return e[67]!==Z||e[68]!==V||e[69]!==A||e[70]!==I?(le=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-event",children:[A,I,Z,V]}),e[67]=Z,e[68]=V,e[69]=A,e[70]=I,e[71]=le):le=e[71],le},"Pe"),Ve=s(()=>{let l=ue(),e=X(),{data:w,error:x}=Ne(te.listWorkflows,{}),[N,b]=(0,i.useState)(""),[a,d]=(0,i.useState)(""),[m,v]=(0,i.useState)(""),[L,S]=(0,i.useState)(!1),[B,C]=(0,i.useState)(null),[O,F]=(0,i.useState)([]),[W,_]=(0,i.useState)(null),R=w!==void 0,g=Array.isArray(w?.workflows)?[...w.workflows].toSorted((r,c)=>r.exportName.localeCompare(c.exportName)):[],y=Fe(g,N),k=g.find(r=>r.exportName===y),A=s(r=>{F(c=>{let o=c.filter($=>!($.exportName===r.exportName&&$.id===r.id));return[r,...o]})},"T"),I=s(async()=>{let r=y;if(r==="")return;let c=ge(m);if(c===null){C(e("Params must be valid JSON"));return}S(!0),C(null);try{let o=a.trim(),$=await l.query(_e,{exportName:r,id:o===""?void 0:o,params:c.value},me(""));A({exportName:r,id:$.id,status:$.status}),d("")}catch(o){C(z(o))}S(!1)},"F"),T=s(()=>{q(I())},"P"),P=s(async(r,c)=>{_(c);try{let o=await l.query(Ee,{exportName:r,id:c},me(""));A({error:o.error,exportName:r,id:o.id,output:o.output,status:o.status})}catch(o){throw _(null),o}_(null)},"O"),E=s(async(r,c)=>{try{await P(r,c)}catch(o){C(z(o))}},"E"),J=s(r=>{b(r.target.value)},"W"),n=s(r=>{d(r.target.value)},"A"),u=s(r=>{v(r.target.value)},"L"),f=s(r=>{let{export:c,id:o}=r.currentTarget.dataset;c!==void 0&&o!==void 0&&q(E(c,o))},"n");return(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-workflows-panel",children:[x!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-error",role:"alert",children:x}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("Workflows are declared in code with defineWorkflow and run as durable Cloudflare Workflows. Start an instance and observe its status below.")}),R&&g.length===0?(0,t.jsx)(de,{description:e("No defineWorkflow is declared in lunora/workflows.ts in this deployment. Add one to run a durable, multi-step workflow."),testId:"workflows-empty",title:e("No workflows defined")}):(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:e("Export")}),(0,t.jsx)(h,{children:e("Name")}),(0,t.jsx)(h,{children:e("Class")})]})}),(0,t.jsx)(ne,{children:g.map(r=>(0,t.jsxs)(j,{"data-testid":`workflows-row-${r.exportName}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.name}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.className})]},r.exportName))})]})})}),g.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-start",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Start instance")}),B!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"workflows-start-error",role:"alert",children:B}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":e("Workflow"),className:"h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50","data-testid":"workflows-start-select",onChange:J,value:y,children:g.map(r=>(0,t.jsx)("option",{value:r.exportName,children:r.exportName},r.exportName))}),(0,t.jsx)(ie,{"aria-label":e("Instance id (optional)"),className:"max-w-48","data-testid":"workflows-start-id",onChange:n,placeholder:e("Instance id (optional)"),value:a}),(0,t.jsx)(U,{"data-testid":"workflows-start-button",disabled:L||y==="",onClick:T,children:e(L?"Starting\u2026":"Start instance")})]}),(0,t.jsx)(we,{"aria-label":e("Params (JSON)"),className:"font-mono","data-testid":"workflows-start-params",onChange:u,placeholder:e("Params (JSON, optional)"),value:m})]}),g.length>0&&(0,t.jsx)(Pe,{eventTypes:w?.eventTypes??[],exportName:y,onSent:P},y),O.length>0&&(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"workflows-instances",children:[(0,t.jsx)("h3",{className:"text-sm font-medium",children:e("Instances")}),(0,t.jsx)(Y,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(ae,{"data-testid":"workflows-instances-table",children:[(0,t.jsx)(re,{children:(0,t.jsxs)(j,{children:[(0,t.jsx)(h,{children:e("Workflow")}),(0,t.jsx)(h,{children:e("Instance id")}),(0,t.jsx)(h,{children:e("Status")}),(0,t.jsx)(h,{children:e("Output")}),(0,t.jsx)(h,{})]})}),(0,t.jsx)(ne,{children:O.map(r=>(0,t.jsxs)(j,{"data-testid":`workflows-instance-${r.id}`,children:[(0,t.jsx)(p,{className:"font-mono text-xs",children:r.exportName}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:r.id}),(0,t.jsx)(p,{className:"font-mono text-xs",children:r.status}),(0,t.jsx)(p,{className:"font-mono text-xs text-muted-foreground",children:De(r)}),(0,t.jsx)(p,{children:(0,t.jsx)(U,{"data-export":r.exportName,"data-id":r.id,"data-testid":`workflows-instance-refresh-${r.id}`,disabled:W===r.id,onClick:f,size:"xs",variant:"outline",children:W===r.id?e("Refreshing\u2026"):e("Refresh")})})]},`${r.exportName}:${r.id}`))})]})})})]}),k!==void 0&&(0,t.jsx)(Te,{workflowName:k.name})]})},"Ze");function je(l){return(0,t.jsx)("option",{value:l,children:l},l)}s(je,"De");export{Ve as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-HKLF627N.js";import{b as Y}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{l as se,p as ee}from"./chunk-
|
|
1
|
+
import{a as Z}from"./chunk-HKLF627N.js";import{b as Y}from"./chunk-6I42AM75.js";import"./chunk-4C4THJUD.js";import{l as se,p as ee}from"./chunk-SDSQIQJG.js";import"./chunk-WZTY3ZYI.js";import{a as re}from"./chunk-3Y5K3IQO.js";import{a as O}from"./chunk-MD67S53Z.js";import{b as X,f as le,w as ne}from"./chunk-LPINY2IJ.js";import{a as k,d as ae,f as ce,g as me}from"./chunk-OXFKZ4BM.js";var te=ae(ce(),1);var a=ae(me(),1);var pe="/_lunora/health",he="/_lunora/health/ready",ue=k((r,e)=>(r.endsWith("/")?r.slice(0,-1):r)+e,"me"),fe=k(()=>{let r=ee();return async e=>{let w=e==="ready"?he:pe,t=r.getAuthToken(),y=ue(r.url,w);try{let i=await fetch(y,{headers:t===null?{}:{authorization:`Bearer ${t}`}}),p=null;try{p=await i.json()}catch{p=null}return{body:p,ok:i.ok,status:i.status}}catch(i){return{body:null,error:i instanceof Error?i.message:String(i),ok:!1,status:0}}}},"pe"),ge={crit:"bg-destructive",ok:"bg-success",warn:"bg-warning"},ye=k(r=>r==="unhealthy"?"crit":r==="degraded"?"warn":"ok","fe"),ie=k(r=>{let e=(0,te.c)(13),{label:w,level:t,testId:y,value:i}=r,p=ge[t],d;e[0]!==p?(d=X("size-1.5 shrink-0 rounded-full",p),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==d?(o=(0,a.jsx)("span",{"aria-hidden":"true",className:d}),e[2]=d,e[3]=o):o=e[3];let c;e[4]!==w||e[5]!==o?(c=(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:[o,w]}),e[4]=w,e[5]=o,e[6]=c):c=e[6];let h;e[7]!==y||e[8]!==i?(h=(0,a.jsx)("span",{className:"text-lg font-semibold text-foreground","data-testid":y,children:i}),e[7]=y,e[8]=i,e[9]=h):h=e[9];let C;return e[10]!==c||e[11]!==h?(C=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[c,h]})}),e[10]=c,e[11]=h,e[12]=C):C=e[12],C},"Z"),Ie=k(r=>{let e=(0,te.c)(107),{probe:w}=r,t=le(),y=ee(),i=fe(),p=w??i,d;e[0]!==p?(d=k(async()=>{let[s,n]=await Promise.all([p("live"),p("ready")]);return{live:s,ready:n}},"o"),e[0]=p,e[1]=d):d=e[1];let o;e[2]!==y?(o=y.clientIdentifier(),e[2]=y,e[3]=o):o=e[3];let c;e[4]!==o?(c=["deployment-health",o],e[4]=o,e[5]=c):c=e[5];let h;e[6]!==d||e[7]!==c?(h={queryFn:d,queryKey:c},e[6]=d,e[7]=c,e[8]=h):h=e[8];let{data:C,isPending:de}=se(h),Q=C?.live??null,oe=C?.ready??null;if(de){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"deployment-health-loading",children:[(0,a.jsx)(Z,{className:"h-16 w-full"}),(0,a.jsx)(Z,{className:"h-40 w-full"})]}),e[9]=s):s=e[9],s}let l=Q?.body??null;if(l===null){let s=Q?.status===403,n;e[10]!==s||e[11]!==Q?.error||e[12]!==t?(n=s?t("The health endpoint is in the admin posture. Paste a valid admin token in the connect popover, or set its auth to public."):t("Couldn't reach the health endpoint: {message}",{message:Q?.error??t("no response")}),e[10]=s,e[11]=Q?.error,e[12]=t,e[13]=n):n=e[13];let m;e[14]!==t?(m=t("Health endpoint unavailable"),e[14]=t,e[15]=m):m=e[15];let f;return e[16]!==n||e[17]!==m?(f=(0,a.jsx)(re,{description:n,testId:"deployment-health-error",title:m}),e[16]=n,e[17]=m,e[18]=f):f=e[18],f}let J;e[19]!==l.status?(J=ye(l.status),e[19]=l.status,e[20]=J):J=e[20];let W=J,u;if(l.status==="unhealthy"){let s;e[21]!==t?(s=t("Unhealthy"),e[21]=t,e[22]=s):s=e[22],u=s}else if(l.status==="degraded"){let s;e[23]!==t?(s=t("Degraded"),e[23]=t,e[24]=s):s=e[24],u=s}else{let s;e[25]!==t?(s=t("Healthy"),e[25]=t,e[26]=s):s=e[26],u=s}let _=oe?.ok??!1,G=_?"ok":"crit",j,H,I,x,N,v,S,V,b,P;if(e[27]!==l.appName||e[28]!==l.appVersion||e[29]!==l.checks||e[30]!==l.timestamp||e[31]!==W||e[32]!==G||e[33]!==_||e[34]!==u||e[35]!==t){let s=[...l.checks].toSorted(xe);H="flex flex-col gap-6",I="deployment-health";let n;e[46]!==t?(n=t("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint \u2014 wire an uptime monitor or a Cloudflare Health Check at it."),e[46]=t,e[47]=n):n=e[47],e[48]!==n?(x=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:n}),e[48]=n,e[49]=x):x=e[49];let m;e[50]!==u?(m=(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground","data-testid":"dh-status",children:u}),e[50]=u,e[51]=m):m=e[51];let f;e[52]!==l.appName||e[53]!==l.appVersion?(f=(0,a.jsxs)("span",{className:"font-mono text-[13px] text-muted-foreground","data-testid":"dh-app",children:[l.appName," \xB7 ",l.appVersion]}),e[52]=l.appName,e[53]=l.appVersion,e[54]=f):f=e[54];let D;e[55]!==m||e[56]!==f?(D=(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"grid leading-tight",children:[m,f]})}),e[55]=m,e[56]=f,e[57]=D):D=e[57];let T;e[58]!==t?(T=t("Checked"),e[58]=t,e[59]=T):T=e[59];let $;e[60]!==T?($=(0,a.jsx)("div",{className:"font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:T}),e[60]=T,e[61]=$):$=e[61];let q;e[62]!==l.timestamp?(q=ne(l.timestamp),e[62]=l.timestamp,e[63]=q):q=e[63];let B;e[64]!==q?(B=(0,a.jsx)("time",{className:"text-[13px] text-muted-foreground","data-testid":"dh-timestamp",children:q}),e[64]=q,e[65]=B):B=e[65];let E;e[66]!==$||e[67]!==B?(E=(0,a.jsxs)("div",{className:"text-end",children:[$,B]}),e[66]=$,e[67]=B,e[68]=E):E=e[68],e[69]!==D||e[70]!==E?(N=(0,a.jsx)(O,{className:"gap-0 py-0",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[D,E]})}),e[69]=D,e[70]=E,e[71]=N):N=e[71];let L;e[72]!==t?(L=t("Liveness"),e[72]=t,e[73]=L):L=e[73];let R;e[74]!==W||e[75]!==u||e[76]!==L?(R=(0,a.jsx)(ie,{label:L,level:W,testId:"dh-liveness",value:u}),e[74]=W,e[75]=u,e[76]=L,e[77]=R):R=e[77];let U;e[78]!==t?(U=t("Readiness"),e[78]=t,e[79]=U):U=e[79];let A;e[80]!==_||e[81]!==t?(A=t(_?"Ready":"Not ready"),e[80]=_,e[81]=t,e[82]=A):A=e[82];let F;e[83]!==G||e[84]!==U||e[85]!==A?(F=(0,a.jsx)(ie,{label:U,level:G,testId:"dh-readiness",value:A}),e[83]=G,e[84]=U,e[85]=A,e[86]=F):F=e[86],e[87]!==R||e[88]!==F?(v=(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2","data-testid":"dh-probes",children:[R,F]}),e[87]=R,e[88]=F,e[89]=v):v=e[89],j=O,S="gap-0 py-0",V="dh-checks";let K;e[90]!==t?(K=t("Subsystem checks"),e[90]=t,e[91]=K):K=e[91],e[92]!==K?(b=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:K})}),e[92]=K,e[93]=b):b=e[93],P=s.length===0?(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"dh-checks-empty",children:t("No checks reported.")}):(0,a.jsx)("ul",{className:"divide-y divide-border",children:s.map(g=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 px-4 py-2.5 text-xs","data-testid":`dh-check-${g.name}`,children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{"aria-hidden":"true",className:X("size-1.5 shrink-0 rounded-full",g.status==="up"?"bg-success":"bg-destructive")}),(0,a.jsx)("span",{className:"font-mono text-foreground",children:g.name}),g.critical&&(0,a.jsx)(Y,{variant:"outline",children:t("Critical")})]}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-2",children:[g.message!==void 0&&(0,a.jsx)("span",{className:"text-muted-foreground",children:g.message}),(0,a.jsx)(Y,{"data-testid":`dh-check-status-${g.name}`,variant:g.status==="up"?"secondary":"destructive",children:g.status==="up"?t("Up"):t("Down")})]})]},g.name))}),e[27]=l.appName,e[28]=l.appVersion,e[29]=l.checks,e[30]=l.timestamp,e[31]=W,e[32]=G,e[33]=_,e[34]=u,e[35]=t,e[36]=j,e[37]=H,e[38]=I,e[39]=x,e[40]=N,e[41]=v,e[42]=S,e[43]=V,e[44]=b,e[45]=P}else j=e[36],H=e[37],I=e[38],x=e[39],N=e[40],v=e[41],S=e[42],V=e[43],b=e[44],P=e[45];let z;e[94]!==j||e[95]!==S||e[96]!==V||e[97]!==b||e[98]!==P?(z=(0,a.jsxs)(j,{className:S,"data-testid":V,children:[b,P]}),e[94]=j,e[95]=S,e[96]=V,e[97]=b,e[98]=P,e[99]=z):z=e[99];let M;return e[100]!==H||e[101]!==I||e[102]!==x||e[103]!==N||e[104]!==v||e[105]!==z?(M=(0,a.jsxs)("div",{className:H,"data-testid":I,children:[x,N,v,z]}),e[100]=H,e[101]=I,e[102]=x,e[103]=N,e[104]=v,e[105]=z,e[106]=M):M=e[106],M},"_e");function xe(r,e){return r.name.localeCompare(e.name)}k(xe,"he");export{Ie as DeploymentHealthPanel};
|