@lunora/studio 1.0.0-alpha.97 → 1.0.0-alpha.99
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-ON2FIVI2.js → chunk-2TFGS62O.js} +1 -1
- package/dist/standalone/{chunk-NDO6YSEG.js → chunk-3J6AAVUL.js} +1 -1
- package/dist/standalone/{chunk-DDO5EGID.js → chunk-4D56O2UT.js} +1 -1
- package/dist/standalone/{chunk-VH2IO643.js → chunk-5GMRSN6L.js} +1 -1
- package/dist/standalone/chunk-6FQJRXVI.js +11 -0
- package/dist/standalone/{chunk-STESBRLN.js → chunk-6IKXBSNY.js} +1 -1
- package/dist/standalone/{chunk-YZIR7PL5.js → chunk-7HWEPGII.js} +1 -1
- package/dist/standalone/{chunk-SZXVX6PY.js → chunk-7IIICQZ7.js} +1 -1
- package/dist/standalone/{chunk-OKZP3YY3.js → chunk-AIB3GCQI.js} +1 -1
- package/dist/standalone/{chunk-J4UYSDWF.js → chunk-AS4WSCMT.js} +1 -1
- package/dist/standalone/{chunk-5A7NIX77.js → chunk-BAZ2VU7R.js} +1 -1
- package/dist/standalone/{chunk-3IF75YS7.js → chunk-BG54FBTO.js} +1 -1
- package/dist/standalone/{chunk-KP6VHTO4.js → chunk-BMZPRRSX.js} +1 -1
- package/dist/standalone/{chunk-2KRXOCZ2.js → chunk-D34YXUQY.js} +1 -1
- package/dist/standalone/{chunk-I7V54EDS.js → chunk-DK4J7ZBH.js} +1 -1
- package/dist/standalone/{chunk-NJRW66LJ.js → chunk-DSU54IAT.js} +1 -1
- package/dist/standalone/{chunk-5L63KFHD.js → chunk-FKBHX7BD.js} +1 -1
- package/dist/standalone/{chunk-6F7KP54M.js → chunk-HRRFUAP6.js} +1 -1
- package/dist/standalone/{chunk-IZFPJXB3.js → chunk-II5ZTRTW.js} +1 -1
- package/dist/standalone/{chunk-S7ZOM3NK.js → chunk-IMME7XEE.js} +1 -1
- package/dist/standalone/{chunk-QEVFPILV.js → chunk-IXAMI2KV.js} +1 -1
- package/dist/standalone/{chunk-FHZ5WDTU.js → chunk-J3Q3ESBP.js} +1 -1
- package/dist/standalone/{chunk-SPE3AB54.js → chunk-J6PMARYI.js} +1 -1
- package/dist/standalone/{chunk-FXBBFE7Y.js → chunk-JR4LDDRW.js} +1 -1
- package/dist/standalone/{chunk-QC4T2L6I.js → chunk-JZUM7FBJ.js} +1 -1
- package/dist/standalone/{chunk-NCKRVNF2.js → chunk-KBBOZRRX.js} +1 -1
- package/dist/standalone/{chunk-XPOUF2XH.js → chunk-KVYAMWYX.js} +1 -1
- package/dist/standalone/{chunk-H5ZYPSLB.js → chunk-MCPDCNPO.js} +1 -1
- package/dist/standalone/{chunk-NBANYYGB.js → chunk-N6N6MMWG.js} +1 -1
- package/dist/standalone/{chunk-PMGTIUU2.js → chunk-NTAN75BV.js} +1 -1
- package/dist/standalone/{chunk-4EHNOASW.js → chunk-O36FXWMR.js} +1 -1
- package/dist/standalone/{chunk-QQYX5WN4.js → chunk-O3BG6T4B.js} +1 -1
- package/dist/standalone/{chunk-73B3T2SA.js → chunk-QVK5DESS.js} +1 -1
- package/dist/standalone/{chunk-D264UAKY.js → chunk-RE7VLJ6H.js} +1 -1
- package/dist/standalone/{chunk-EZKBI7SZ.js → chunk-T2NCAYLT.js} +1 -1
- package/dist/standalone/{chunk-UYPXC3OO.js → chunk-T7AVSVIA.js} +1 -1
- package/dist/standalone/{chunk-M3Z2YAHD.js → chunk-T7YW6OMG.js} +1 -1
- package/dist/standalone/{chunk-G2O3XP7Y.js → chunk-TLVSMHK2.js} +1 -1
- package/dist/standalone/{chunk-E3Z4QXAD.js → chunk-TMZQNRFA.js} +1 -1
- package/dist/standalone/{chunk-CXBXUT5A.js → chunk-U3Y2BI4W.js} +1 -1
- package/dist/standalone/{chunk-3626PHEZ.js → chunk-UE2NC2ZZ.js} +1 -1
- package/dist/standalone/{chunk-3SGYSFRC.js → chunk-URCRLZN7.js} +1 -1
- package/dist/standalone/{chunk-OZA2RA45.js → chunk-UYOSHHOV.js} +1 -1
- package/dist/standalone/{chunk-WLXH4ECM.js → chunk-V3EN6YQV.js} +1 -1
- package/dist/standalone/{chunk-LHAHIDNT.js → chunk-V4R4HI3U.js} +1 -1
- package/dist/standalone/{chunk-LAEO6D34.js → chunk-VKK7A4VH.js} +1 -1
- package/dist/standalone/{chunk-PKWJ7UOG.js → chunk-VOYG35OH.js} +1 -1
- package/dist/standalone/{chunk-II64XEZV.js → chunk-W2GXYXCQ.js} +1 -1
- package/dist/standalone/{chunk-MW5YIENZ.js → chunk-WG3WC2F2.js} +1 -1
- package/dist/standalone/{chunk-5L2VKBAJ.js → chunk-WZXZ6YN5.js} +1 -1
- package/dist/standalone/{chunk-YP7WZ6YM.js → chunk-XGL7QCYN.js} +1 -1
- package/dist/standalone/{chunk-HH5CZ6KD.js → chunk-XUQEE25M.js} +1 -1
- package/dist/standalone/{chunk-A6NAMYVS.js → chunk-XYENOWOR.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/package.json +5 -5
- package/dist/standalone/chunk-C2ZFQARQ.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as Ue}from"./chunk-6V27P65N.js";import{c as _e}from"./chunk-XF2B7P5A.js";import"./chunk-4KIQ5RLS.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as ye}from"./chunk-JN2Y24PY.js";import"./chunk-ESVP44Y3.js";import{a as Re}from"./chunk-54MMVNPT.js";import"./chunk-I6A5C46N.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as Le}from"./chunk-AREBQI6D.js";import{a as De}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Ne}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as re}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as ae}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as be}from"./chunk-VDW32UET.js";import{f as Se}from"./chunk-
|
|
1
|
+
import{b as Ue}from"./chunk-6V27P65N.js";import{c as _e}from"./chunk-XF2B7P5A.js";import"./chunk-4KIQ5RLS.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as ye}from"./chunk-JN2Y24PY.js";import"./chunk-ESVP44Y3.js";import{a as Re}from"./chunk-54MMVNPT.js";import"./chunk-I6A5C46N.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as Le}from"./chunk-AREBQI6D.js";import{a as De}from"./chunk-RMN2JN4S.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Ne}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as re}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as ae}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as be}from"./chunk-VDW32UET.js";import{f as Se}from"./chunk-6FQJRXVI.js";import"./chunk-XBDKZZ67.js";import{a as he}from"./chunk-XQCVZAGU.js";import{a as $e,b as Te,c as Fe,d as ce,e as ne,f as ee}from"./chunk-WJQLNYGX.js";import{a as je,e as ze}from"./chunk-WQH3LT2P.js";import{d as Ce,f as me,g as ge,h as X,l as pe,o as W,q as Ke}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as g,e as fe,f as mt,g as gt,h as pt}from"./chunk-3XIESWL4.js";var M=fe(gt(),1),j=fe(mt(),1);var n=fe(pt(),1);var Oe=g((d,e,t)=>{let{onCopy:r,onDelete:s,onDownload:o,onToggleSelect:c}=t,i=g(()=>{r(d.key)},"i"),l=g(()=>{o(d.key)},"o"),u=g(()=>{s(d.key)},"u"),h=g(()=>{c(d.key)},"h");return{copy:i,download:l,name:d.key.slice(e.length),remove:u,toggle:h}},"Ke"),Me=g(d=>{let e=(0,M.c)(31),{busy:t,buttonClassName:r,copied:s,objectKey:o,onCopy:c,onDelete:i,onDownload:l,t:u}=d,h=`storage-copy-${o}`,f;e[0]!==s||e[1]!==u?(f=u(s?"Copied":"Copy URL"),e[0]=s,e[1]=u,e[2]=f):f=e[2];let m;e[3]!==t||e[4]!==r||e[5]!==c||e[6]!==h||e[7]!==f?(m=(0,n.jsx)(re,{className:r,"data-testid":h,disabled:t,onClick:c,size:"sm",type:"button",variant:"ghost",children:f}),e[3]=t,e[4]=r,e[5]=c,e[6]=h,e[7]=f,e[8]=m):m=e[8];let w=`storage-download-${o}`,a;e[9]!==u?(a=u("Download"),e[9]=u,e[10]=a):a=e[10];let k;e[11]!==t||e[12]!==r||e[13]!==l||e[14]!==w||e[15]!==a?(k=(0,n.jsx)(re,{className:r,"data-testid":w,disabled:t,onClick:l,size:"sm",type:"button",variant:"ghost",children:a}),e[11]=t,e[12]=r,e[13]=l,e[14]=w,e[15]=a,e[16]=k):k=e[16];let C;e[17]!==u?(C=u("Delete object?"),e[17]=u,e[18]=C):C=e[18];let x=`storage-delete-${o}`,b;e[19]!==u?(b=u("Delete"),e[19]=u,e[20]=b):b=e[20];let v;e[21]!==t||e[22]!==i||e[23]!==C||e[24]!==x||e[25]!==b?(v=(0,n.jsx)(Le,{confirmLabel:C,disabled:t,onConfirm:i,testId:x,children:b}),e[21]=t,e[22]=i,e[23]=C,e[24]=x,e[25]=b,e[26]=v):v=e[26];let y;return e[27]!==v||e[28]!==m||e[29]!==k?(y=(0,n.jsxs)(n.Fragment,{children:[m,k,v]}),e[27]=v,e[28]=m,e[29]=k,e[30]=y):y=e[30],y},"De"),Ae=g(d=>{let e=(0,M.c)(14),{objectKey:t,references:r,t:s}=d;if(r===void 0)return null;if(r.length===0){let h=`storage-orphan-${t}`,f;e[0]!==s?(f=s("Orphan"),e[0]=s,e[1]=f):f=e[1];let m;return e[2]!==h||e[3]!==f?(m=(0,n.jsx)(ae,{"data-testid":h,variant:"warning",children:f}),e[2]=h,e[3]=f,e[4]=m):m=e[4],m}let o;e[5]!==r?(o=r.map(bt).join(`
|
|
2
2
|
`),e[5]=r,e[6]=o):o=e[6];let c=o,i=`storage-refs-${t}`,l;e[7]!==r.length||e[8]!==s?(l=r.length===1?s("1 record"):s("{count} records",{count:r.length}),e[7]=r.length,e[8]=s,e[9]=l):l=e[9];let u;return e[10]!==c||e[11]!==i||e[12]!==l?(u=(0,n.jsx)(ae,{"data-testid":i,title:c,variant:"secondary",children:l}),e[10]=c,e[11]=i,e[12]=l,e[13]=u):u=e[13],u},"Te"),Pe=g(d=>{let e=(0,M.c)(7),{objectKey:t,onToggle:r,selected:s,t:o}=d,c;e[0]!==o?(c=o("Select row"),e[0]=o,e[1]=c):c=e[1];let i=`storage-select-${t}`,l;return e[2]!==r||e[3]!==s||e[4]!==c||e[5]!==i?(l=(0,n.jsx)(ye,{"aria-label":c,checked:s,"data-testid":i,onCheckedChange:r}),e[2]=r,e[3]=s,e[4]=c,e[5]=i,e[6]=l):l=e[6],l},"Fe");function bt(d){return`${d.table}\xB7${d.id}`}g(bt,"yt");var yt=g(d=>{let e=(0,M.c)(10),{colSpan:t,name:r,onEnter:s}=d,o;e[0]!==r||e[1]!==s?(o=g(()=>{s(r)},"n"),e[0]=r,e[1]=s,e[2]=o):o=e[2];let c=o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})}),e[3]=i):i=e[3];let l;e[4]!==c||e[5]!==r?(l=(0,n.jsxs)("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:c,type:"button",children:[i,r]}),e[4]=c,e[5]=r,e[6]=l):l=e[6];let u;return e[7]!==t||e[8]!==l?(u=(0,n.jsx)(ce,{children:(0,n.jsx)(ee,{colSpan:t,children:l})}),e[7]=t,e[8]=l,e[9]=u):u=e[9],u},"xt"),xt=g(d=>{let e=(0,M.c)(37),{busy:t,copiedKey:r,handlers:s,object:o,prefix:c,references:i,selected:l,showReferences:u,t:h}=d,f;e[0]!==s||e[1]!==o||e[2]!==c?(f=Oe(o,c,s),e[0]=s,e[1]=o,e[2]=c,e[3]=f):f=e[3];let{copy:m,download:w,name:a,remove:k,toggle:C}=f,x;e[4]!==o.key||e[5]!==l||e[6]!==h||e[7]!==C?(x=(0,n.jsx)(ee,{className:"w-8",children:(0,n.jsx)(Pe,{objectKey:o.key,onToggle:C,selected:l,t:h})}),e[4]=o.key,e[5]=l,e[6]=h,e[7]=C,e[8]=x):x=e[8];let b;e[9]!==a?(b=(0,n.jsx)(ee,{className:"font-mono text-xs",children:a}),e[9]=a,e[10]=b):b=e[10];let v;e[11]!==o.size?(v=pe(o.size),e[11]=o.size,e[12]=v):v=e[12];let y;e[13]!==v?(y=(0,n.jsx)(ee,{className:"tabular-nums text-muted-foreground",children:v}),e[13]=v,e[14]=y):y=e[14];let z=o.httpMetadata?.contentType??"",S;e[15]!==z?(S=(0,n.jsx)(ee,{children:z}),e[15]=z,e[16]=S):S=e[16];let N;e[17]!==o.key||e[18]!==i||e[19]!==u||e[20]!==h?(N=u&&(0,n.jsx)(ee,{children:(0,n.jsx)(Ae,{objectKey:o.key,references:i,t:h})}),e[17]=o.key,e[18]=i,e[19]=u,e[20]=h,e[21]=N):N=e[21];let $=r===o.key,K;e[22]!==t||e[23]!==m||e[24]!==w||e[25]!==o.key||e[26]!==k||e[27]!==h||e[28]!==$?(K=(0,n.jsx)(ee,{className:"text-right",children:(0,n.jsx)("span",{className:"inline-flex items-center gap-1",children:(0,n.jsx)(Me,{busy:t,copied:$,objectKey:o.key,onCopy:m,onDelete:k,onDownload:w,t:h})})}),e[22]=t,e[23]=m,e[24]=w,e[25]=o.key,e[26]=k,e[27]=h,e[28]=$,e[29]=K):K=e[29];let F;return e[30]!==K||e[31]!==x||e[32]!==b||e[33]!==y||e[34]!==S||e[35]!==N?(F=(0,n.jsxs)(ce,{"data-testid":"fb-row",children:[x,b,y,S,N,K]}),e[30]=K,e[31]=x,e[32]=b,e[33]=y,e[34]=S,e[35]=N,e[36]=F):F=e[36],F},"vt"),vt=g(d=>{let e=(0,M.c)(65),{allSelected:t,busy:r,copiedKey:s,files:o,folders:c,handlers:i,onEnterFolder:l,prefix:u,references:h,selected:f,showReferences:m,someSelected:w,t:a,toggleSelectAll:k}=d,C;e[0]!==a?(C=a("Select all rows"),e[0]=a,e[1]=C):C=e[1];let x;e[2]!==t||e[3]!==w||e[4]!==C||e[5]!==k?(x=(0,n.jsx)(ne,{className:"w-8",children:(0,n.jsx)(ye,{"aria-label":C,checked:t,"data-testid":"storage-select-all",indeterminate:w,onCheckedChange:k})}),e[2]=t,e[3]=w,e[4]=C,e[5]=k,e[6]=x):x=e[6];let b;e[7]!==a?(b=a("key"),e[7]=a,e[8]=b):b=e[8];let v;e[9]!==b?(v=(0,n.jsx)(ne,{children:b}),e[9]=b,e[10]=v):v=e[10];let y;e[11]!==a?(y=a("size"),e[11]=a,e[12]=y):y=e[12];let z;e[13]!==y?(z=(0,n.jsx)(ne,{children:y}),e[13]=y,e[14]=z):z=e[14];let S;e[15]!==a?(S=a("content-type"),e[15]=a,e[16]=S):S=e[16];let N;e[17]!==S?(N=(0,n.jsx)(ne,{children:S}),e[17]=S,e[18]=N):N=e[18];let $;e[19]!==m||e[20]!==a?($=m&&(0,n.jsx)(ne,{children:a("used by")}),e[19]=m,e[20]=a,e[21]=$):$=e[21];let K;e[22]!==a?(K=a("Actions"),e[22]=a,e[23]=K):K=e[23];let F;e[24]!==K?(F=(0,n.jsx)(ne,{"aria-label":K}),e[24]=K,e[25]=F):F=e[25];let T;e[26]!==F||e[27]!==x||e[28]!==v||e[29]!==z||e[30]!==N||e[31]!==$?(T=(0,n.jsx)(Te,{children:(0,n.jsxs)(ce,{children:[x,v,z,N,$,F]})}),e[26]=F,e[27]=x,e[28]=v,e[29]=z,e[30]=N,e[31]=$,e[32]=T):T=e[32];let L;if(e[33]!==c||e[34]!==l||e[35]!==m){let R;e[37]!==l||e[38]!==m?(R=g(_=>(0,n.jsx)(yt,{colSpan:m?6:5,name:_,onEnter:l},_),"R"),e[37]=l,e[38]=m,e[39]=R):R=e[39],L=c.map(R),e[33]=c,e[34]=l,e[35]=m,e[36]=L}else L=e[36];let B;if(e[40]!==r||e[41]!==s||e[42]!==o||e[43]!==i||e[44]!==u||e[45]!==h||e[46]!==f||e[47]!==m||e[48]!==a){let R;e[50]!==r||e[51]!==s||e[52]!==i||e[53]!==u||e[54]!==h||e[55]!==f||e[56]!==m||e[57]!==a?(R=g(_=>(0,n.jsx)(xt,{busy:r,copiedKey:s,handlers:i,object:_,prefix:u,references:h[_.key],selected:f.has(_.key),showReferences:m,t:a},_.key),"R"),e[50]=r,e[51]=s,e[52]=i,e[53]=u,e[54]=h,e[55]=f,e[56]=m,e[57]=a,e[58]=R):R=e[58],B=o.map(R),e[40]=r,e[41]=s,e[42]=o,e[43]=i,e[44]=u,e[45]=h,e[46]=f,e[47]=m,e[48]=a,e[49]=B}else B=e[49];let U;e[59]!==L||e[60]!==B?(U=(0,n.jsxs)(Fe,{children:[L,B]}),e[59]=L,e[60]=B,e[61]=U):U=e[61];let I;return e[62]!==T||e[63]!==U?(I=(0,n.jsx)(je,{className:"overflow-hidden py-0",children:(0,n.jsx)(ze,{className:"px-0",children:(0,n.jsxs)($e,{"data-testid":"fb-table",children:[T,U]})})}),e[62]=T,e[63]=U,e[64]=I):I=e[64],I},"kt"),kt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],wt=3600,Be=g((d,e)=>{if(e==="size")return d.size;if(e==="type")return d.httpMetadata?.contentType??"";if(e==="date"){if(d.uploaded===void 0)return 0;let t=new Date(d.uploaded).getTime();return Number.isNaN(t)?0:t}return e.startsWith("tag:")?d.customMetadata?.[e.slice(4)]??"":d.key},"ve"),St=g((d,e,t)=>{let r=t==="desc"?-1:1;return d.toSorted((s,o)=>{let c=Be(s,e),i=Be(o,e);return(typeof c=="number"&&typeof i=="number"?c-i:String(c).localeCompare(String(i)))*r})},"Nt"),Ct=g((d,e)=>{let t=new Set,r=[];for(let s of d){let o=s.key.slice(e.length),c=o.indexOf("/");c===-1?r.push(s):t.add(o.slice(0,c+1))}return{files:r,folders:[...t].toSorted((s,o)=>s.localeCompare(o))}},"Ct"),Nt=g(d=>{let e=(0,M.c)(59),{bucket:t,buckets:r,busy:s,draftPrefix:o,expiry:c,fileInputRef:i,onBucketChange:l,onExpiryChange:u,onFileChange:h,onList:f,onPrefixChange:m,onUploadClick:w,t:a}=d,k;e[0]!==m?(k=g(P=>{m(P.target.value)},"v"),e[0]=m,e[1]=k):k=e[1];let C=k,x;e[2]!==l?(x=g(P=>{l(P.target.value)},"y"),e[2]=l,e[3]=x):x=e[3];let b=x,v;e[4]!==u?(v=g(P=>{u(Number.parseInt(P.target.value,10))},"x"),e[4]=u,e[5]=v):v=e[5];let y=v,z;e[6]!==t||e[7]!==r||e[8]!==b||e[9]!==a?(z=r.length>0&&(0,n.jsx)("select",{"aria-label":a("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:b,value:t,children:r.map(zt)}),e[6]=t,e[7]=r,e[8]=b,e[9]=a,e[10]=z):z=e[10];let S;e[11]!==a?(S=a("Key prefix"),e[11]=a,e[12]=S):S=e[12];let N;e[13]!==a?(N=a("key prefix (optional)"),e[13]=a,e[14]=N):N=e[14];let $;e[15]!==o||e[16]!==C||e[17]!==S||e[18]!==N?($=(0,n.jsx)(Ne,{"aria-label":S,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:C,placeholder:N,value:o}),e[15]=o,e[16]=C,e[17]=S,e[18]=N,e[19]=$):$=e[19];let K;e[20]!==a?(K=a("List"),e[20]=a,e[21]=K):K=e[21];let F;e[22]!==s||e[23]!==f||e[24]!==K?(F=(0,n.jsx)(re,{"data-testid":"fb-list",disabled:s,onClick:f,size:"sm",type:"button",children:K}),e[22]=s,e[23]=f,e[24]=K,e[25]=F):F=e[25];let T;e[26]!==s||e[27]!==a?(T=a(s?"Uploading\u2026":"Upload"),e[26]=s,e[27]=a,e[28]=T):T=e[28];let L;e[29]!==s||e[30]!==w||e[31]!==T?(L=(0,n.jsx)(re,{"data-testid":"storage-upload",disabled:s,onClick:w,size:"sm",type:"button",variant:"outline",children:T}),e[29]=s,e[30]=w,e[31]=T,e[32]=L):L=e[32];let B;e[33]!==i||e[34]!==h?(B=(0,n.jsx)("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:i,type:"file"}),e[33]=i,e[34]=h,e[35]=B):B=e[35];let U;e[36]!==a?(U=a("Link expiry"),e[36]=a,e[37]=U):U=e[37];let I;e[38]!==a?(I=kt.map(P=>(0,n.jsx)("option",{value:P.seconds,children:a(P.label)},P.seconds)),e[38]=a,e[39]=I):I=e[39];let R;e[40]!==c||e[41]!==y||e[42]!==I?(R=(0,n.jsx)("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:y,value:c,children:I}),e[40]=c,e[41]=y,e[42]=I,e[43]=R):R=e[43];let _;e[44]!==U||e[45]!==R?(_=(0,n.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[U,R]}),e[44]=U,e[45]=R,e[46]=_):_=e[46];let O;e[47]!==a?(O=a("Open in Cloudflare"),e[47]=a,e[48]=O):O=e[48];let A;e[49]!==O?(A=(0,n.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:_e,rel:"noreferrer",target:"_blank",children:O}),e[49]=O,e[50]=A):A=e[50];let G;return e[51]!==L||e[52]!==B||e[53]!==_||e[54]!==A||e[55]!==z||e[56]!==$||e[57]!==F?(G=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[z,$,F,L,B,_,A]}),e[51]=L,e[52]=B,e[53]=_,e[54]=A,e[55]=z,e[56]=$,e[57]=F,e[58]=G):G=e[58],G},"$t"),jt=g(d=>{let e=(0,M.c)(66),{onSortKeyChange:t,onThumbSizeChange:r,showGrid:s,showList:o,sortDirection:c,sortKey:i,t:l,tagKeys:u,thumbSize:h,toggleSortDirection:f,view:m}=d,w;e[0]!==t?(w=g(V=>{t(V.target.value)},"k"),e[0]=t,e[1]=w):w=e[1];let a=w,k;e[2]!==r?(k=g(V=>{r(Number.parseInt(V.target.value,10))},"v"),e[2]=r,e[3]=k):k=e[3];let C=k,x=m==="list",b;e[4]!==l?(b=l("List"),e[4]=l,e[5]=b):b=e[5];let v;e[6]!==o||e[7]!==x||e[8]!==b?(v=(0,n.jsx)("button",{"aria-pressed":x,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:o,type:"button",children:b}),e[6]=o,e[7]=x,e[8]=b,e[9]=v):v=e[9];let y=m==="grid",z;e[10]!==l?(z=l("Grid"),e[10]=l,e[11]=z):z=e[11];let S;e[12]!==s||e[13]!==y||e[14]!==z?(S=(0,n.jsx)("button",{"aria-pressed":y,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:s,type:"button",children:z}),e[12]=s,e[13]=y,e[14]=z,e[15]=S):S=e[15];let N;e[16]!==v||e[17]!==S?(N=(0,n.jsxs)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[v,S]}),e[16]=v,e[17]=S,e[18]=N):N=e[18];let $;e[19]!==l?($=l("Sort"),e[19]=l,e[20]=$):$=e[20];let K;e[21]!==l?(K=l("Name"),e[21]=l,e[22]=K):K=e[22];let F;e[23]!==K?(F=(0,n.jsx)("option",{value:"name",children:K}),e[23]=K,e[24]=F):F=e[24];let T;e[25]!==l?(T=l("size"),e[25]=l,e[26]=T):T=e[26];let L;e[27]!==T?(L=(0,n.jsx)("option",{value:"size",children:T}),e[27]=T,e[28]=L):L=e[28];let B;e[29]!==l?(B=l("Type"),e[29]=l,e[30]=B):B=e[30];let U;e[31]!==B?(U=(0,n.jsx)("option",{value:"type",children:B}),e[31]=B,e[32]=U):U=e[32];let I;e[33]!==l?(I=l("Modified"),e[33]=l,e[34]=I):I=e[34];let R;e[35]!==I?(R=(0,n.jsx)("option",{value:"date",children:I}),e[35]=I,e[36]=R):R=e[36];let _;e[37]!==u?(_=u.map(Kt),e[37]=u,e[38]=_):_=e[38];let O;e[39]!==a||e[40]!==i||e[41]!==F||e[42]!==L||e[43]!==U||e[44]!==R||e[45]!==_?(O=(0,n.jsxs)("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:a,value:i,children:[F,L,U,R,_]}),e[39]=a,e[40]=i,e[41]=F,e[42]=L,e[43]=U,e[44]=R,e[45]=_,e[46]=O):O=e[46];let A;e[47]!==$||e[48]!==O?(A=(0,n.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[$,O]}),e[47]=$,e[48]=O,e[49]=A):A=e[49];let G;e[50]!==l?(G=l("Toggle sort direction"),e[50]=l,e[51]=G):G=e[51];let P=c==="asc"?"\u2191":"\u2193",H;e[52]!==G||e[53]!==P||e[54]!==f?(H=(0,n.jsx)("button",{"aria-label":G,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:f,type:"button",children:P}),e[52]=G,e[53]=P,e[54]=f,e[55]=H):H=e[55];let Y;e[56]!==C||e[57]!==l||e[58]!==h||e[59]!==m?(Y=m==="grid"&&(0,n.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[l("Thumbnail size"),(0,n.jsx)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:C,step:8,type:"range",value:h})]}),e[56]=C,e[57]=l,e[58]=h,e[59]=m,e[60]=Y):Y=e[60];let oe;return e[61]!==A||e[62]!==H||e[63]!==Y||e[64]!==N?(oe=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[N,A,H,Y]}),e[61]=A,e[62]=H,e[63]=Y,e[64]=N,e[65]=oe):oe=e[65],oe},"jt");function zt(d){return(0,n.jsx)("option",{value:d,children:d},d)}g(zt,"zt");function Kt(d){return(0,n.jsx)("option",{value:`tag:${d}`,children:d},d)}g(Kt,"Kt");var Dt=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,$t=g(d=>(d.httpMetadata?.contentType??"").startsWith("image/")||Dt.test(d.key),"Tt"),Tt=g(()=>{let d=(0,M.c)(1),e;return d[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"})}),d[0]=e):e=d[0],e},"Ft"),Ft=g(d=>{let e=(0,M.c)(13),{object:t,resolveUrl:r}=d,[s,o]=(0,j.useState)(null),[c,i]=(0,j.useState)(!1),l;e[0]!==t?(l=$t(t),e[0]=t,e[1]=l):l=e[1];let u=l,h,f;e[2]!==u||e[3]!==t.key||e[4]!==r?(h=g(()=>{if(!u)return;let k={cancelled:!1};return W((async()=>{try{let C=await r(t.key);k.cancelled||o(C)}catch{k.cancelled||i(!0)}})()),()=>{k.cancelled=!0}},"h"),f=[u,t.key,r],e[2]=u,e[3]=t.key,e[4]=r,e[5]=h,e[6]=f):(h=e[5],f=e[6]),(0,j.useEffect)(h,f);let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=g(()=>{i(!0)},"m"),e[7]=m):m=e[7];let w=m,a;return e[8]!==c||e[9]!==u||e[10]!==t.key||e[11]!==s?(a=(0,n.jsx)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:u&&s!==null&&!c?(0,n.jsx)("img",{alt:t.key,className:"size-full object-cover",loading:"lazy",onError:w,src:s}):(0,n.jsx)(Tt,{})}),e[8]=c,e[9]=u,e[10]=t.key,e[11]=s,e[12]=a):a=e[12],a},"Rt"),Lt=g(d=>{let e=(0,M.c)(42),{busy:t,copiedKey:r,handlers:s,object:o,prefix:c,references:i,resolveUrl:l,selected:u,showReferences:h,t:f}=d,m;e[0]!==s||e[1]!==o||e[2]!==c?(m=Oe(o,c,s),e[0]=s,e[1]=o,e[2]=c,e[3]=m):m=e[3];let{copy:w,download:a,name:k,remove:C,toggle:x}=m,b;e[4]!==o||e[5]!==l?(b=(0,n.jsx)(Ft,{object:o,resolveUrl:l}),e[4]=o,e[5]=l,e[6]=b):b=e[6];let v;e[7]!==o.key||e[8]!==u||e[9]!==f||e[10]!==x?(v=(0,n.jsx)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,n.jsx)(Pe,{objectKey:o.key,onToggle:x,selected:u,t:f})}),e[7]=o.key,e[8]=u,e[9]=f,e[10]=x,e[11]=v):v=e[11];let y;e[12]!==b||e[13]!==v?(y=(0,n.jsxs)("div",{className:"relative",children:[b,v]}),e[12]=b,e[13]=v,e[14]=y):y=e[14];let z;e[15]!==k?(z=(0,n.jsx)("p",{className:"truncate font-mono text-xs",title:k,children:k}),e[15]=k,e[16]=z):z=e[16];let S;e[17]!==o.size?(S=pe(o.size),e[17]=o.size,e[18]=S):S=e[18];let N;e[19]!==S?(N=(0,n.jsx)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:S}),e[19]=S,e[20]=N):N=e[20];let $;e[21]!==o.key||e[22]!==i||e[23]!==h||e[24]!==f?($=h&&(0,n.jsx)("div",{className:"mt-1",children:(0,n.jsx)(Ae,{objectKey:o.key,references:i,t:f})}),e[21]=o.key,e[22]=i,e[23]=h,e[24]=f,e[25]=$):$=e[25];let K;e[26]!==z||e[27]!==N||e[28]!==$?(K=(0,n.jsxs)("div",{className:"min-w-0",children:[z,N,$]}),e[26]=z,e[27]=N,e[28]=$,e[29]=K):K=e[29];let F=r===o.key,T;e[30]!==t||e[31]!==w||e[32]!==a||e[33]!==o.key||e[34]!==C||e[35]!==f||e[36]!==F?(T=(0,n.jsx)("div",{className:"flex items-center gap-1",children:(0,n.jsx)(Me,{busy:t,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:o.key,onCopy:w,onDelete:C,onDownload:a,t:f})}),e[30]=t,e[31]=w,e[32]=a,e[33]=o.key,e[34]=C,e[35]=f,e[36]=F,e[37]=T):T=e[37];let L;return e[38]!==T||e[39]!==y||e[40]!==K?(L=(0,n.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[y,K,T]}),e[38]=T,e[39]=y,e[40]=K,e[41]=L):L=e[41],L},"Lt"),Rt=g(d=>{let e=(0,M.c)(9),{name:t,onEnter:r}=d,s;e[0]!==t||e[1]!==r?(s=g(()=>{r(t)},"l"),e[0]=t,e[1]=r,e[2]=s):s=e[2];let o=s,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})})}),e[3]=c):c=e[3];let i;e[4]!==t?(i=(0,n.jsx)("span",{className:"truncate font-mono text-xs",title:t,children:t}),e[4]=t,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i?(l=(0,n.jsxs)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:o,type:"button",children:[c,i]}),e[6]=o,e[7]=i,e[8]=l):l=e[8],l},"Ot"),Ut=g(d=>{let e=(0,M.c)(34),{busy:t,copiedKey:r,files:s,folders:o,handlers:c,onEnterFolder:i,prefix:l,references:u,resolveUrl:h,selected:f,showReferences:m,size:w,t:a}=d,k;e[0]!==w?(k=w.toString(),e[0]=w,e[1]=k):k=e[1];let C=`repeat(auto-fill, minmax(${k}px, 1fr))`,x;e[2]!==C?(x={gridTemplateColumns:C},e[2]=C,e[3]=x):x=e[3];let b=x,v;if(e[4]!==o||e[5]!==i){let S;e[7]!==i?(S=g(N=>(0,n.jsx)(Rt,{name:N,onEnter:i},N),"w"),e[7]=i,e[8]=S):S=e[8],v=o.map(S),e[4]=o,e[5]=i,e[6]=v}else v=e[6];let y;if(e[9]!==t||e[10]!==r||e[11]!==s||e[12]!==c||e[13]!==l||e[14]!==u||e[15]!==h||e[16]!==f||e[17]!==m||e[18]!==a){let S;e[20]!==t||e[21]!==r||e[22]!==c||e[23]!==l||e[24]!==u||e[25]!==h||e[26]!==f||e[27]!==m||e[28]!==a?(S=g(N=>(0,n.jsx)(Lt,{busy:t,copiedKey:r,handlers:c,object:N,prefix:l,references:u[N.key],resolveUrl:h,selected:f.has(N.key),showReferences:m,t:a},N.key),"w"),e[20]=t,e[21]=r,e[22]=c,e[23]=l,e[24]=u,e[25]=h,e[26]=f,e[27]=m,e[28]=a,e[29]=S):S=e[29],y=s.map(S),e[9]=t,e[10]=r,e[11]=s,e[12]=c,e[13]=l,e[14]=u,e[15]=h,e[16]=f,e[17]=m,e[18]=a,e[19]=y}else y=e[19];let z;return e[30]!==b||e[31]!==v||e[32]!==y?(z=(0,n.jsxs)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[v,y]}),e[30]=b,e[31]=v,e[32]=y,e[33]=z):z=e[33],z},"Et"),_t=g(d=>{let e=(0,M.c)(23),{reference:t,t:r}=d,s=`fb-dangling-${t.table}-${t.id}-${t.column}`,o=`${t.table}\xB7${t.id}`,c;e[0]!==o?(c=(0,n.jsx)(ae,{variant:"secondary",children:o}),e[0]=o,e[1]=c):c=e[1];let i;e[2]!==t.column?(i=(0,n.jsx)("span",{className:"text-muted-foreground",children:t.column}),e[2]=t.column,e[3]=i):i=e[3];let l;e[4]!==r?(l=r("\u2192"),e[4]=r,e[5]=l):l=e[5];let u;e[6]!==l?(u=(0,n.jsx)("span",{className:"text-muted-foreground/60",children:l}),e[6]=l,e[7]=u):u=e[7];let h;e[8]!==t.key?(h=(0,n.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:t.key}),e[8]=t.key,e[9]=h):h=e[9];let f;e[10]!==c||e[11]!==i||e[12]!==u||e[13]!==h?(f=(0,n.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[c,i,u,h]}),e[10]=c,e[11]=i,e[12]=u,e[13]=h,e[14]=f):f=e[14];let m;e[15]!==r?(m=r("Missing object"),e[15]=r,e[16]=m):m=e[16];let w;e[17]!==m?(w=(0,n.jsx)(ae,{className:"border-destructive/40 text-destructive",variant:"outline",children:m}),e[17]=m,e[18]=w):w=e[18];let a;return e[19]!==s||e[20]!==w||e[21]!==f?(a=(0,n.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":s,children:[f,w]}),e[19]=s,e[20]=w,e[21]=f,e[22]=a):a=e[22],a},"Ut"),Bt=g(d=>{let e=(0,M.c)(37),{busy:t,onCheck:r,references:s,t:o,truncated:c}=d,i;e[0]!==o?(i=o("Integrity"),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==i?(l=(0,n.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[2]=i,e[3]=l):l=e[3];let u;e[4]!==o?(u=o("Orphaned objects"),e[4]=o,e[5]=u):u=e[5];let h;e[6]!==u?(h=(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:u}),e[6]=u,e[7]=h):h=e[7];let f;e[8]!==o?(f=o("Find records whose file reference points at an object the bucket no longer has."),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:f}),e[10]=f,e[11]=m):m=e[11];let w;e[12]!==l||e[13]!==h||e[14]!==m?(w=(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[l,h,m]}),e[12]=l,e[13]=h,e[14]=m,e[15]=w):w=e[15];let a;e[16]!==t||e[17]!==o?(a=o(t?"Checking\u2026":"Check for orphans"),e[16]=t,e[17]=o,e[18]=a):a=e[18];let k;e[19]!==t||e[20]!==r||e[21]!==a?(k=(0,n.jsx)(re,{"data-testid":"fb-orphans-check",disabled:t,onClick:r,size:"sm",type:"button",variant:"outline",children:a}),e[19]=t,e[20]=r,e[21]=a,e[22]=k):k=e[22];let C;e[23]!==w||e[24]!==k?(C=(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w,k]}),e[23]=w,e[24]=k,e[25]=C):C=e[25];let x;e[26]!==s?.length||e[27]!==o?(x=s?.length===0&&(0,n.jsx)(he,{description:o("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:o("No dangling references.")}),e[26]=s?.length,e[27]=o,e[28]=x):x=e[28];let b;e[29]!==s||e[30]!==o||e[31]!==c?(b=s!==void 0&&s.length>0&&(0,n.jsxs)(n.Fragment,{children:[c&&(0,n.jsx)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:o("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:s.length})}),(0,n.jsx)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:s.map(y=>(0,n.jsx)(_t,{reference:y,t:o},`${y.table}\xB7${y.id}\xB7${y.column}`))})]}),e[29]=s,e[30]=o,e[31]=c,e[32]=b):b=e[32];let v;return e[33]!==C||e[34]!==x||e[35]!==b?(v=(0,n.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[C,x,b]}),e[33]=C,e[34]=x,e[35]=b,e[36]=v):v=e[36],v},"_t"),Et=g(function(d,e){let t=(0,M.c)(18),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=new Set,t[0]=r):r=t[0];let[s,o]=(0,j.useState)(r),c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c=g(x=>{o(b=>{let v=new Set(b);return v.has(x)?v.delete(x):v.add(x),v})},"c"),t[1]=c):c=t[1];let i=c,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=g(()=>{o(new Set)},"o"),t[2]=l):l=t[2];let u=l,h,f,m;if(t[3]!==d||t[4]!==e||t[5]!==s){let x;t[9]!==e?(x=g(b=>e(b),"y"),t[9]=e,t[10]=x):x=t[10],f=d.map(x),h=f.length>0&&f.every(b=>s.has(b)),m=!h&&f.some(b=>s.has(b)),t[3]=d,t[4]=e,t[5]=s,t[6]=h,t[7]=f,t[8]=m}else h=t[6],f=t[7],m=t[8];let w=m,a;t[11]!==f?(a=g(()=>{o(x=>f.every(b=>x.has(b))?new Set:new Set(f))},"a"),t[11]=f,t[12]=a):a=t[12];let k=a,C;return t[13]!==h||t[14]!==s||t[15]!==w||t[16]!==k?(C={allSelected:h,clear:u,selected:s,someSelected:w,toggle:i,toggleAll:k},t[13]=h,t[14]=s,t[15]=w,t[16]=k,t[17]=C):C=t[17],C},"Bt"),It=me(be.storageReferences),Ot=me(be.storageOrphans),Ee=1e4,Mt=1e3,At=3600,Pt=g((d,e)=>{if(!("document"in globalThis))return;let t=globalThis.document.createElement("a");t.href=d,t.download=e,t.rel="noopener",globalThis.document.body.append(t),t.click(),t.remove()},"Wt"),Wt=g(d=>d.key,"qt"),Gt=g(({initialPrefix:d,pageSize:e})=>{let t=Se(),[r,s]=(0,j.useState)(d??""),[o,c]=(0,j.useState)(d??""),[i,l]=(0,j.useState)(wt),[u,h]=(0,j.useState)("list"),[f,m]=(0,j.useState)(128),[w,a]=(0,j.useState)("name"),[k,C]=(0,j.useState)("asc"),[x,b]=(0,j.useState)(void 0),[v,y]=(0,j.useState)(void 0),[z,S]=(0,j.useState)(!1),[N,$]=(0,j.useState)(void 0),[K,F]=(0,j.useState)(void 0),[T,L]=(0,j.useState)(""),[B,U]=(0,j.useState)({}),[I,R]=(0,j.useState)(!1),[_,O]=(0,j.useState)(void 0),[A,G]=(0,j.useState)(!1),[P,H]=(0,j.useState)(!1),[Y,oe]=(0,j.useState)([]),[V,xe]=(0,j.useState)(""),le=(0,j.useRef)(0),Q=(0,j.useRef)(0);(0,j.useEffect)(()=>{let p={cancelled:!1};return W((async()=>{try{let D=await t.listStorageBuckets();if(!p.cancelled){oe(D);let[E]=D;E!==void 0&&xe(q=>q===""?E:q)}}catch{}})()),()=>{p.cancelled=!0}},[t]);let Z=(0,j.useMemo)(()=>({list:g(p=>t.listStorageObjects({...p,bucket:V}),"list"),remove:g(p=>t.deleteStorageObject(p,{bucket:V}),"remove"),signedUrl:g((p,D)=>t.signedStorageUrl(p,{...D,bucket:V}),"signedUrl"),upload:g(p=>t.uploadStorageObject({...p,bucket:V}),"upload")}),[V,t]),J=(0,j.useCallback)(async(p,D,E)=>{le.current+=1;let q=le.current;y(void 0),S(!0);try{let te=await Z.list({cursor:D,limit:e,prefix:p});if(q!==le.current)return;b(we=>E&&we!==void 0?[...we,...te.objects]:te.objects),F(te.cursor)}catch(te){if(q!==le.current)return;E||b(void 0),y(X(te))}finally{q===le.current&&S(!1)}},[e,Z]);(0,j.useEffect)(()=>{W(J(d??"",void 0,!1))},[J,d]);let We=(x?.length??0)<=e;Re(()=>{W(J(r,void 0,!1))},We);let{files:de,folders:Ge}=Ct(x??[],r),He=(0,j.useMemo)(()=>{let p=new Set;for(let D of de)for(let E of Object.keys(D.customMetadata??{}))p.add(E);return[...p].toSorted((D,E)=>D.localeCompare(E))},[de]),ie=St(de,w,k),ue=(0,j.useMemo)(()=>[...new Set(ie.map(p=>p.key))].toSorted((p,D)=>p.localeCompare(D)).join(`
|
|
3
3
|
`),[ie]);(0,j.useEffect)(()=>{let p=ue===""?[]:ue.split(`
|
|
4
4
|
`);if(p.length===0){U({});return}let D={current:!0};return W((async()=>{try{let E=await t.query(It,{keys:p},ge(T));D.current&&(U(E.references??{}),R(Object.keys(E.storageColumns??{}).length>0))}catch{D.current&&(U({}),R(!1))}})()),()=>{D.current=!1}},[t,ue,T]);let{allSelected:qe,clear:se,selected:ve,someSelected:Ve,toggle:Ze,toggleAll:Je}=Et(ie,Wt),Ye=g(()=>{s(o),se(),W(J(o,void 0,!1))},"Ie"),Qe=g(()=>{W(J(r,K,!0))},"Me"),ke=g(p=>{s(p),c(p),se(),W(J(p,void 0,!1))},"be"),Xe=g(p=>{ke(`${r}${p}`)},"Ae"),et=g(p=>Z.signedUrl(p,{expiresInSeconds:At}),"Pe"),tt=g(()=>{h("list")},"We"),rt=g(()=>{h("grid")},"qe"),nt=g(p=>{a(p)},"Ge"),ot=g(()=>{C(p=>p==="asc"?"desc":"asc")},"He"),lt=g(p=>{m(p)},"Ze"),st=g(p=>{l(p)},"Ve"),at=g(()=>{y(void 0),S(!0),W((async()=>{try{for(let p of ve)await Z.remove(p);await J(r,void 0,!1),se()}catch(p){y(X(p))}S(!1)})())},"Xe"),it=g(p=>{y(void 0),W((async()=>{try{let D=await Z.signedUrl(p,{expiresInSeconds:i});Ke(D)&&$(p)}catch(D){y(X(D))}})())},"Ye"),ct=g(p=>{y(void 0),W((async()=>{try{let D=await Z.signedUrl(p,{expiresInSeconds:i}),E=p.slice(p.lastIndexOf("/")+1)||p;Pt(D,E)}catch(D){y(X(D))}})())},"Qe");(0,j.useEffect)(()=>{if(N===void 0)return;let p=globalThis.setTimeout(()=>{$(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[N]);let dt=g(p=>{y(void 0),S(!0),W((async()=>{try{await Z.remove(p),await J(r,void 0,!1)}catch(D){y(X(D))}S(!1)})())},"Je"),ut=g(p=>{let D=`${r}${p.name}`;y(void 0),S(!0),W((async()=>{try{let E=await p.arrayBuffer();await Z.upload({body:E,contentType:p.type===""?void 0:p.type,key:D}),await J(r,void 0,!1)}catch(E){y(X(E))}S(!1)})())},"et");(0,j.useEffect)(()=>{Q.current+=1,O(void 0),H(!1)},[T]);let ft=g(()=>{Q.current+=1;let p=Q.current;y(void 0),G(!0),W((async()=>{try{let D=[],E;do{let q=await Z.list({cursor:E,limit:Mt});for(let te of q.objects)D.push(te.key);E=D.length>=Ee?void 0:q.cursor}while(E!==void 0);if(D.length>=Ee)p===Q.current&&(O([]),H(!0));else{let q=await t.query(Ot,{liveKeys:D},ge(T));p===Q.current&&(O(q.references??[]),H(q.truncated===!0))}}catch(D){p===Q.current&&(O([]),H(!1),y(X(D)))}p===Q.current&&G(!1)})())},"tt"),ht=g(p=>{le.current+=1,Q.current+=1,xe(p),s(d??""),c(d??""),b(void 0),O(void 0),H(!1),se()},"rt");return{allSelected:qe,bucket:V,buckets:Y,bulkDelete:at,busy:z,checkOrphans:ft,clearSelection:se,copiedKey:N,danglingBusy:A,danglingReferences:_,danglingTruncated:P,draftPrefix:o,enterFolder:Xe,error:v,expiry:i,files:ie,folders:Ge,hasObjects:x!==void 0&&x.length>0,hasStorageColumns:I,listFirst:Ye,loaded:x!==void 0,loadMore:Qe,navigate:ke,nextCursor:K,onCopy:it,onDelete:dt,onDownload:ct,onExpiryChange:st,onFile:ut,onSortKeyChange:nt,onThumbSizeChange:lt,prefix:r,referenceShard:T,references:B,resolveUrl:et,selectBucket:ht,selected:ve,setDraftPrefix:c,setReferenceShard:L,showGrid:rt,showList:tt,someSelected:Ve,sortDirection:k,sortKey:w,tagKeys:He,thumbSize:f,toggleSelect:Ze,toggleSelectAll:Je,toggleSortDirection:ot,view:u}},"Gt"),Ht=100,Ie=g(d=>{let e=(0,M.c)(6),{label:t,onNavigate:r,target:s}=d,o;e[0]!==r||e[1]!==s?(o=g(()=>{r(s)},"n"),e[0]=r,e[1]=s,e[2]=o):o=e[2];let c=o,i;return e[3]!==c||e[4]!==t?(i=(0,n.jsx)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:c,type:"button",children:t}),e[3]=c,e[4]=t,e[5]=i):i=e[5],i},"we"),qt=g(d=>{let e=(0,M.c)(11),{onNavigate:t,prefix:r,t:s}=d,o;if(e[0]!==t||e[1]!==r||e[2]!==s){let c=r.split("/").filter(Vt),i;e[4]!==s?(i=s("Folder path"),e[4]=s,e[5]=i):i=e[5];let l;e[6]!==s?(l=s("root"),e[6]=s,e[7]=l):l=e[7];let u;e[8]!==t||e[9]!==l?(u=(0,n.jsx)(Ie,{label:l,onNavigate:t,target:""}),e[8]=t,e[9]=l,e[10]=u):u=e[10],o=(0,n.jsxs)("nav",{"aria-label":i,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[u,c.map((h,f)=>(0,n.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,n.jsx)("span",{className:"text-muted-foreground/50",children:"/"}),(0,n.jsx)(Ie,{label:h,onNavigate:t,target:`${c.slice(0,f+1).join("/")}/`})]},`${h}-${f.toString()}`))]}),e[0]=t,e[1]=r,e[2]=s,e[3]=o}else o=e[3];return o},"Zt"),ur=g(({initialPrefix:d,pageSize:e=Ht})=>{let t=Ce(),r=Gt({initialPrefix:d,pageSize:e}),s=(0,j.useRef)(null),{onCopy:o,onDelete:c,onDownload:i,onFile:l,toggleSelect:u}=r,h={onCopy:o,onDelete:c,onDownload:i,onToggleSelect:u},f=g(()=>{s.current?.click()},"f"),m=g(a=>{let k=a.target,C=k.files?.[0];k.value="",C&&l(C)},"m"),w=r.loaded&&!r.hasObjects;return(0,n.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,n.jsx)(Nt,{bucket:r.bucket,buckets:r.buckets,busy:r.busy,draftPrefix:r.draftPrefix,expiry:r.expiry,fileInputRef:s,onBucketChange:r.selectBucket,onExpiryChange:r.onExpiryChange,onFileChange:m,onList:r.listFirst,onPrefixChange:r.setDraftPrefix,onUploadClick:f,t}),r.loaded&&(0,n.jsx)(qt,{onNavigate:r.navigate,prefix:r.prefix,t}),r.hasObjects&&(0,n.jsx)(jt,{onSortKeyChange:r.onSortKeyChange,onThumbSizeChange:r.onThumbSizeChange,showGrid:r.showGrid,showList:r.showList,sortDirection:r.sortDirection,sortKey:r.sortKey,t,tagKeys:r.tagKeys,thumbSize:r.thumbSize,toggleSortDirection:r.toggleSortDirection,view:r.view}),r.hasStorageColumns&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:t("References shard")}),(0,n.jsx)(De,{id:"fb-reference-shard-input",onChange:r.setReferenceShard,testId:"fb-reference-shard-input",value:r.referenceShard}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:t("Which shard's records are checked for references to these files. Empty = root shard.")})]}),r.hasStorageColumns&&(0,n.jsx)(Bt,{busy:r.danglingBusy,onCheck:r.checkOrphans,references:r.danglingReferences,t,truncated:r.danglingTruncated}),r.selected.size>0&&(0,n.jsx)(Ue,{count:r.selected.size,editable:!0,onClear:r.clearSelection,onDelete:r.bulkDelete}),r.error!==void 0&&(0,n.jsx)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:r.error}),w&&(0,n.jsx)(he,{description:t("Objects you upload to your R2 buckets will appear here."),icon:(0,n.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"}),(0,n.jsx)("path",{d:"M12 11v5m-2.5-2.5h5"})]}),testId:"fb-empty",title:t("No objects.")}),r.hasObjects&&r.view==="list"&&(0,n.jsx)(vt,{allSelected:r.allSelected,busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:h,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,selected:r.selected,showReferences:r.hasStorageColumns,someSelected:r.someSelected,t,toggleSelectAll:r.toggleSelectAll}),r.hasObjects&&r.view==="grid"&&(0,n.jsx)(Ut,{busy:r.busy,copiedKey:r.copiedKey,files:r.files,folders:r.folders,handlers:h,onEnterFolder:r.enterFolder,prefix:r.prefix,references:r.references,resolveUrl:r.resolveUrl,selected:r.selected,showReferences:r.hasStorageColumns,size:r.thumbSize,t}),r.nextCursor!==void 0&&(0,n.jsx)("div",{children:(0,n.jsx)(re,{"data-testid":"fb-next",disabled:r.busy,onClick:r.loadMore,size:"sm",type:"button",variant:"outline",children:t("Load more")})})]})},"pr");function Vt(d){return d!==""}g(Vt,"Vt");export{ur as FileBrowser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as T}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as H}from"./chunk-
|
|
1
|
+
import{b as T}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as H}from"./chunk-KBBOZRRX.js";import"./chunk-XXQUMVWH.js";import"./chunk-DSU54IAT.js";import"./chunk-QLQADHFE.js";import{a as C}from"./chunk-VDW32UET.js";import{c as B}from"./chunk-HRRFUAP6.js";import"./chunk-6FQJRXVI.js";import"./chunk-XBDKZZ67.js";import{a as G}from"./chunk-XQCVZAGU.js";import{a as M,b as $,c as E,d as P,e as d,f as c}from"./chunk-WJQLNYGX.js";import{a as U,e as _}from"./chunk-WQH3LT2P.js";import{d as z}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as S,e as q,g as L,h as V}from"./chunk-3XIESWL4.js";var K=q(L(),1);var r=q(V(),1);var J=["read","insert","update","delete"],W=S((e,t)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[t],"q"),Q=S(e=>{let t=new Map;for(let a of e){let s=t.get(a.table)??{operations:new Set,procedures:new Set,table:a.table};s.operations.add(a.on),s.procedures.add(a.procedure),t.set(a.table,s)}return[...t.values()].toSorted((a,s)=>a.table.localeCompare(s.table))},"B"),ie=S(()=>{let e=(0,K.c)(49),t=z(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:s,error:R,errorSource:k}=B(C.rlsPolicies,a),p=s!==void 0,m,n,h,l,f,u,x,b,o;if(e[1]!==s||e[2]!==R||e[3]!==k||e[4]!==p||e[5]!==t){let F=Q(Array.isArray(s?.policies)?s.policies:[]),D;e[15]!==s?(D=Array.isArray(s?.roles)?s.roles:[],e[15]=s,e[16]=D):D=e[16],n=D,x="flex flex-col gap-6",b="lunora-rls-panel",e[17]!==R||e[18]!==k?(o=R!==null&&(0,r.jsx)(H,{error:k,testId:"rls-error"}),e[17]=R,e[18]=k,e[19]=o):o=e[19],u="flex flex-col gap-2",m=U,h="overflow-hidden py-0";let I;e[20]!==t?(I=t("Policies"),e[20]=t,e[21]=I):I=e[21],e[22]!==I?(l=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:I})}),e[22]=I,e[23]=l):l=e[23],f=p&&F.length===0?(0,r.jsx)(G,{description:t("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:t("No policies defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(M,{"data-testid":"rls-policies-table",children:[(0,r.jsx)($,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:t("Table")}),J.map(i=>(0,r.jsx)(d,{children:W(t,i)},i)),(0,r.jsx)(d,{children:t("Guarded by")})]})}),(0,r.jsx)(E,{children:F.map(i=>(0,r.jsxs)(P,{"data-testid":`rls-table-${i.table}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:i.table}),J.map(O=>(0,r.jsx)(c,{children:i.operations.has(O)?(0,r.jsx)(T,{variant:"secondary",children:t("Guarded")}):(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"})},O)),(0,r.jsx)(c,{className:"font-mono text-xs text-muted-foreground",children:[...i.procedures].join(", ")})]},i.table))})]})}),e[1]=s,e[2]=R,e[3]=k,e[4]=p,e[5]=t,e[6]=m,e[7]=n,e[8]=h,e[9]=l,e[10]=f,e[11]=u,e[12]=x,e[13]=b,e[14]=o}else m=e[6],n=e[7],h=e[8],l=e[9],f=e[10],u=e[11],x=e[12],b=e[13],o=e[14];let N;e[24]!==m||e[25]!==h||e[26]!==l||e[27]!==f?(N=(0,r.jsxs)(m,{className:h,children:[l,f]}),e[24]=m,e[25]=h,e[26]=l,e[27]=f,e[28]=N):N=e[28];let g;e[29]!==u||e[30]!==N?(g=(0,r.jsx)("section",{className:u,children:N}),e[29]=u,e[30]=N,e[31]=g):g=e[31];let y;e[32]!==t?(y=t("Roles"),e[32]=t,e[33]=y):y=e[33];let w;e[34]!==y?(w=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y})}),e[34]=y,e[35]=w):w=e[35];let v;e[36]!==p||e[37]!==n||e[38]!==t?(v=p&&n.length===0?(0,r.jsx)(G,{description:t("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:t("No roles defined")}):(0,r.jsx)(_,{className:"px-0",children:(0,r.jsxs)(M,{"data-testid":"rls-roles-table",children:[(0,r.jsx)($,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(d,{children:t("Role")}),(0,r.jsx)(d,{children:t("Description")}),(0,r.jsx)(d,{children:t("Permissions")})]})}),(0,r.jsx)(E,{children:n.map(Y)})]})}),e[36]=p,e[37]=n,e[38]=t,e[39]=v):v=e[39];let A;e[40]!==w||e[41]!==v?(A=(0,r.jsx)("section",{className:"flex flex-col gap-2",children:(0,r.jsxs)(U,{className:"overflow-hidden py-0",children:[w,v]})}),e[40]=w,e[41]=v,e[42]=A):A=e[42];let j;return e[43]!==A||e[44]!==x||e[45]!==b||e[46]!==o||e[47]!==g?(j=(0,r.jsxs)("div",{className:x,"data-testid":b,children:[o,g,A]}),e[43]=A,e[44]=x,e[45]=b,e[46]=o,e[47]=g,e[48]=j):j=e[48],j},"ae");function X(e){return(0,r.jsx)(T,{variant:"outline",children:e},e)}S(X,"H");function Y(e){return(0,r.jsxs)(P,{"data-testid":`rls-role-${e.name}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:e.name}),(0,r.jsx)(c,{className:"text-muted-foreground",children:e.description??""}),(0,r.jsx)(c,{children:e.permissions.length===0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,r.jsx)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(X)})})]},e.name)}S(Y,"L");export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-IGCNMZSB.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as L}from"./chunk-VDW32UET.js";import{c as $}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-IGCNMZSB.js";import{b as C}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as L}from"./chunk-VDW32UET.js";import{c as $}from"./chunk-HRRFUAP6.js";import"./chunk-6FQJRXVI.js";import"./chunk-XBDKZZ67.js";import{a as I}from"./chunk-XQCVZAGU.js";import{a as k,b as A,c as D,d as g,e as c,f as l}from"./chunk-WJQLNYGX.js";import{a as b,e as S}from"./chunk-WQH3LT2P.js";import{d as w}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as p,e as y,g as j,h as E}from"./chunk-3XIESWL4.js";var _=y(j(),1);var t=y(E(),1);var T="container:",M={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},W=p(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"_"),B=p(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(T))continue;let i=a.slice(T.length);if(i==="")continue;let s=JSON.stringify([i,r.instance??""]),o=n.get(s);if(o!==void 0&&o.timestamp>=r.timestamp)continue;let{detail:u,event:d}=W(r.message);n.set(s,{detail:u,event:d,exitCode:r.exitCode,instance:r.instance,level:r.level,name:i,state:M[d]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"j"),F={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},H=p(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"W"),V=p(()=>{let e=(0,_.c)(19),n=w(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:i,error:s,liveError:o}=$(L.getLogs,r,a),u=i!==void 0,d;if(e[2]!==i||e[3]!==s||e[4]!==o||e[5]!==u||e[6]!==n){let N=B(H(i)),x;e[8]!==s?(x=s!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:s}),e[8]=s,e[9]=x):x=e[9];let m;e[10]!==n?(m=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[10]=n,e[11]=m):m=e[11];let f;e[12]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[12]=m,e[13]=f):f=e[13];let h;e[14]!==o?(h=(0,t.jsx)(O,{message:o,prefix:"containers"}),e[14]=o,e[15]=h):h=e[15];let v;e[16]!==f||e[17]!==h?(v=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[f,h]}),e[16]=f,e[17]=h,e[18]=v):v=e[18],d=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[x,v,u&&N.length===0?(0,t.jsx)(I,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(b,{className:"overflow-hidden py-0",children:(0,t.jsx)(S,{className:"px-0",children:(0,t.jsxs)(k,{"data-testid":"containers-table",children:[(0,t.jsx)(A,{children:(0,t.jsxs)(g,{children:[(0,t.jsx)(c,{children:n("Container")}),(0,t.jsx)(c,{children:n("Instance")}),(0,t.jsx)(c,{children:n("State")}),(0,t.jsx)(c,{children:n("Last event")}),(0,t.jsx)(c,{children:n("Detail")}),(0,t.jsx)(c,{children:n("Exit")}),(0,t.jsx)(c,{children:n("When")})]})}),(0,t.jsx)(D,{children:N.map(J)})]})})})]}),e[2]=i,e[3]=s,e[4]=o,e[5]=u,e[6]=n,e[7]=d}else d=e[7];return d},"H");function J(e){return(0,t.jsxs)(g,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(l,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(l,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(l,{children:(0,t.jsx)(C,{variant:F[e.state],children:e.state})}),(0,t.jsx)(l,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(l,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(l,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(l,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}p(J,"B");export{V as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-54MMVNPT.js";import{b as x}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{b as B}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-54MMVNPT.js";import{b as x}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{b as B}from"./chunk-HRRFUAP6.js";import{f as O}from"./chunk-6FQJRXVI.js";import"./chunk-XBDKZZ67.js";import{a as j}from"./chunk-XQCVZAGU.js";import{a as W,b as q,c as E,d as S,e as r,f as s}from"./chunk-WJQLNYGX.js";import{a as A,e as L}from"./chunk-WQH3LT2P.js";import{d as z}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as T,e as M,g as $,h as I}from"./chunk-3XIESWL4.js";var F=M($(),1);var n=M(I(),1);var J=2e3,Q=new Set(["open"]),re=T(G=>{let e=(0,F.c)(41),{read:y}=G,t=z(),K=O(),v;e[0]!==K||e[1]!==y?(v=T(()=>Promise.resolve(y?y():K.debug()),"S"),e[0]=K,e[1]=y,e[2]=v):v=e[2];let H=v,P=y?"injected":"live",b;e[3]!==P?(b=["lunora-studio","sync-client-debug",P],e[3]=P,e[4]=b):b=e[4];let{data:c,refetch:Y}=B(b,H);if(D(Y,!0,J),!c){let i;e[5]!==t?(i=t("Reading the sync client's state\u2026"),e[5]=t,e[6]=i):i=e[6];let g;e[7]!==t?(g=t("Sync client"),e[7]=t,e[8]=g):g=e[8];let _;return e[9]!==i||e[10]!==g?(_=(0,n.jsx)(A,{children:(0,n.jsx)(L,{children:(0,n.jsx)(j,{description:i,title:g})})}),e[9]=i,e[10]=g,e[11]=_):_=e[11],_}let{pendingWrites:k,shards:N,subscriptions:w}=c,l;e[12]!==t?(l=t("This Studio session's sync client"),e[12]=t,e[13]=l):l=e[13];let a;e[14]!==l?(a=(0,n.jsx)("span",{className:"text-sm font-medium",children:l}),e[14]=l,e[15]=a):a=e[15];let R=c.connectionStatus==="connected"?"default":"secondary",o;e[16]!==c.connectionStatus||e[17]!==R?(o=(0,n.jsx)(x,{variant:R,children:c.connectionStatus}),e[16]=c.connectionStatus,e[17]=R,e[18]=o):o=e[18];let d;e[19]!==k||e[20]!==t?(d=k>0?(0,n.jsx)(x,{variant:"secondary",children:t("{count} pending writes",{count:k})}):null,e[19]=k,e[20]=t,e[21]=d):d=e[21];let h;e[22]!==a||e[23]!==o||e[24]!==d?(h=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a,o,d]}),e[22]=a,e[23]=o,e[24]=d,e[25]=h):h=e[25];let u;e[26]!==t?(u=t("Reads client.debug() for the client running in this page \u2014 not your application's client. Call client.debug() in your app to diagnose a specific stuck overlay there."),e[26]=t,e[27]=u):u=e[27];let m;e[28]!==u?(m=(0,n.jsx)("p",{className:"text-muted-foreground text-xs",children:u}),e[28]=u,e[29]=m):m=e[29];let p;e[30]!==N||e[31]!==t?(p=N.length===0?(0,n.jsx)(j,{description:t("No shard connection has been opened yet."),title:t("No shards")}):(0,n.jsxs)(W,{children:[(0,n.jsx)(q,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(r,{children:t("Shard")}),(0,n.jsx)(r,{children:t("Socket")}),(0,n.jsx)(r,{children:t("Confirmed watermark")})]})}),(0,n.jsx)(E,{children:N.map(i=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{children:i.shardKey??t("(default)")}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:Q.has(i.wsState)?"default":"secondary",children:i.wsState})}),(0,n.jsx)(s,{children:i.confirmedMutationWatermark})]},i.shardKey??"__default__"))})]}),e[30]=N,e[31]=t,e[32]=p):p=e[32];let f;e[33]!==w||e[34]!==t?(f=w.length===0?(0,n.jsx)(j,{description:t("This client holds no live queries or shapes."),title:t("No subscriptions")}):(0,n.jsxs)(W,{children:[(0,n.jsx)(q,{children:(0,n.jsxs)(S,{children:[(0,n.jsx)(r,{children:t("Subscription")}),(0,n.jsx)(r,{children:t("Kind")}),(0,n.jsx)(r,{children:t("Acked")}),(0,n.jsx)(r,{children:t("Cursor")}),(0,n.jsx)(r,{children:t("Pending overlays")})]})}),(0,n.jsx)(E,{children:w.map(i=>(0,n.jsxs)(S,{children:[(0,n.jsx)(s,{className:"font-mono text-xs",children:i.functionPath}),(0,n.jsx)(s,{children:i.kind}),(0,n.jsx)(s,{children:(0,n.jsx)(x,{variant:i.acked?"default":"secondary",children:i.acked?t("yes"):t("no")})}),(0,n.jsx)(s,{children:i.serverCursor??"\u2014"}),(0,n.jsx)(s,{children:i.pendingOptimisticLayers})]},i.id))})]}),e[33]=w,e[34]=t,e[35]=f):f=e[35];let C;return e[36]!==m||e[37]!==p||e[38]!==f||e[39]!==h?(C=(0,n.jsx)(A,{children:(0,n.jsxs)(L,{className:"flex flex-col gap-4",children:[h,m,p,f]})}),e[36]=m,e[37]=p,e[38]=f,e[39]=h,e[40]=C):C=e[40],C},"re");export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as l}from"./chunk-
|
|
1
|
+
import{b as l}from"./chunk-HRRFUAP6.js";import{f as c}from"./chunk-6FQJRXVI.js";import{a as r,e as f,g}from"./chunk-3XIESWL4.js";var m=f(g(),1);var p={capabilities:{accounts:!0,admin:!0,organization:!1,passkey:!1,twoFactor:!1},emailAndPassword:!1,organization:{enabled:!1,roles:!1,teams:!1},plugins:[],rateLimit:{enabled:!1},session:{},socialProviders:[],userFields:[]},y=r(()=>{let o=(0,m.c)(6),t=c(),a;o[0]===Symbol.for("react.memo_cache_sentinel")?(a=["lunora-auth-config"],o[0]=a):a=o[0];let e;o[1]!==t?(e=r(()=>t.getAuthConfig(),"o"),o[1]=t,o[2]=e):e=o[2];let{data:u,isLoading:d}=l(a,e),i=u??p,n=!d,s;return o[3]!==i||o[4]!==n?(s={config:i,ready:n},o[3]=i,o[4]=n,o[5]=s):s=o[5],s},"A");export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-LEDWUPXM.js";import"./chunk-2PJNAWB3.js";import{a as He}from"./chunk-V53KNYRN.js";import{a as Ke}from"./chunk-54MMVNPT.js";import"./chunk-BGBLQ563.js";import{a as Ge}from"./chunk-AREBQI6D.js";import{R as We}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as le}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as de}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Pe}from"./chunk-NCKRVNF2.js";import{a as Ue}from"./chunk-XXQUMVWH.js";import"./chunk-NJRW66LJ.js";import"./chunk-QLQADHFE.js";import{a as F}from"./chunk-VDW32UET.js";import{c as _e}from"./chunk-6F7KP54M.js";import{f as ze}from"./chunk-C2ZFQARQ.js";import"./chunk-XBDKZZ67.js";import{a as ie}from"./chunk-XQCVZAGU.js";import{a as Te,b as ke,c as Be,d as G,e as C,f as w}from"./chunk-WJQLNYGX.js";import{a as De,e as Ee}from"./chunk-WQH3LT2P.js";import{d as $,f as ce,g as ue,h as me,o as he,r as je}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as h,e as Me,f as rt,g as nt,h as ot}from"./chunk-3XIESWL4.js";var z=Me(nt(),1);var A=Me(rt(),1);var t=Me(ot(),1);var dt=h((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),l=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),d=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:d,queuesWithoutDlq:l,showReliabilityWarning:l.length>0||d>0}},"rt"),lt=200,it=ce(F.sendQueueMessage),ct=ce(F.replayQueueMessage),ut=ce(F.clearQueueMessages),Xe=96,mt=h(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n)}catch{return"[unserializable]"}},"it"),ht=h(n=>n.length>Xe?`${n.slice(0,Xe)}\u2026`:n,"ut"),pt=h(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","ct"),gt=h((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"mt"),ft=h(n=>{let e=(0,z.c)(11),{loaded:a,queues:l}=n,d=$(),s;e[0]!==d?(s=d("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[0]=d,e[1]=s):s=e[1];let o;e[2]!==s?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==l||e[6]!==d?(r=a&&l.length===0?(0,t.jsx)(ie,{description:d("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:d("No queues defined")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsxs)(Te,{"data-testid":"queues-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:d("Export")}),(0,t.jsx)(C,{children:d("Queue")}),(0,t.jsx)(C,{children:d("Mode")}),(0,t.jsx)(C,{children:d("Binding")}),(0,t.jsx)(C,{children:d("Dead-letter")})]})}),(0,t.jsx)(Be,{children:l.map(bt)})]})})}),e[4]=a,e[5]=l,e[6]=d,e[7]=r):r=e[7];let p;return e[8]!==o||e[9]!==r?(p=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[o,r]}),e[8]=o,e[9]=r,e[10]=p):p=e[10],p},"ht"),xt=h(n=>{let e=(0,z.c)(67),{message:a,onReplay:l,replayingId:d}=n,s=$(),o,r,p,u,x,N,y,i,m,f;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let W=mt(a.body);r=G,N=`queues-message-${a.id}`;let j=a.exportName??a.queue;e[19]!==j?(y=(0,t.jsx)(w,{className:"font-mono text-xs",children:j}),e[19]=j,e[20]=y):y=e[20],e[21]!==a.messageId?(i=(0,t.jsx)(w,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=i):i=e[22],e[23]!==a.attempts?(m=(0,t.jsx)(w,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=m):m=e[24];let D=`queues-outcome-${a.id}`,E;e[25]!==a.outcome?(E=pt(a.outcome),e[25]=a.outcome,e[26]=E):E=e[26];let I;e[27]!==a.outcome||e[28]!==D||e[29]!==E?(I=(0,t.jsx)(de,{"data-testid":D,variant:E,children:a.outcome}),e[27]=a.outcome,e[28]=D,e[29]=E,e[30]=I):I=e[30];let _;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(_=a.deadLettered&&(0,t.jsx)(de,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=_):_=e[34],e[35]!==I||e[36]!==_?(f=(0,t.jsx)(w,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[I,_]})}),e[35]=I,e[36]=_,e[37]=f):f=e[37],o=w,p="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=W,x=ht(W),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=o,e[10]=r,e[11]=p,e[12]=u,e[13]=x,e[14]=N,e[15]=y,e[16]=i,e[17]=m,e[18]=f}else o=e[9],r=e[10],p=e[11],u=e[12],x=e[13],N=e[14],y=e[15],i=e[16],m=e[17],f=e[18];let g;e[38]!==o||e[39]!==p||e[40]!==u||e[41]!==x?(g=(0,t.jsx)(o,{className:p,title:u,children:x}),e[38]=o,e[39]=p,e[40]=u,e[41]=x,e[42]=g):g=e[42];let q;e[43]!==a.capturedAt?(q=je(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(w,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let S=`queues-replay-${a.id}`,M=d!==null,Q;e[47]!==a.id||e[48]!==d||e[49]!==s?(Q=d===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=d,e[49]=s,e[50]=Q):Q=e[50];let L;e[51]!==a.id||e[52]!==l||e[53]!==S||e[54]!==M||e[55]!==Q?(L=(0,t.jsx)(w,{children:(0,t.jsx)(le,{"data-id":a.id,"data-testid":S,disabled:M,onClick:l,size:"xs",type:"button",variant:"outline",children:Q})}),e[51]=a.id,e[52]=l,e[53]=S,e[54]=M,e[55]=Q,e[56]=L):L=e[56];let T;return e[57]!==r||e[58]!==b||e[59]!==L||e[60]!==N||e[61]!==y||e[62]!==i||e[63]!==m||e[64]!==f||e[65]!==g?(T=(0,t.jsxs)(r,{"data-testid":N,children:[y,i,m,f,g,b,L]}),e[57]=r,e[58]=b,e[59]=L,e[60]=N,e[61]=y,e[62]=i,e[63]=m,e[64]=f,e[65]=g,e[66]=T):T=e[66],T},"pt"),yt=h(n=>{let e=(0,z.c)(30),{hasError:a,messages:l,onClear:d,onReplay:s,replayingId:o}=n,r=$(),p;e[0]!==r?(p=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=p):p=e[1];let u;e[2]!==p?(u=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p}),e[2]=p,e[3]=u):u=e[3];let x;e[4]!==l.length||e[5]!==r?(x=r("Clear {count} messages?",{count:l.length}),e[4]=l.length,e[5]=r,e[6]=x):x=e[6];let N=l.length===0,y;e[7]!==r?(y=r("Clear log"),e[7]=r,e[8]=y):y=e[8];let i;e[9]!==d||e[10]!==x||e[11]!==N||e[12]!==y?(i=(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(Ge,{confirmLabel:x,disabled:N,onConfirm:d,testId:"queues-clear",children:y})}),e[9]=d,e[10]=x,e[11]=N,e[12]=y,e[13]=i):i=e[13];let m;e[14]!==l.length||e[15]!==r?(m=l.length>0&&(0,t.jsx)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:l.length})}),e[14]=l.length,e[15]=r,e[16]=m):m=e[16];let f;e[17]!==u||e[18]!==i||e[19]!==m?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,i,m]}),e[17]=u,e[18]=i,e[19]=m,e[20]=f):f=e[20];let g;e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==o||e[25]!==r?(g=!a&&l.length===0?(0,t.jsx)(ie,{description:r("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:r("No consumed messages yet.")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsx)(Ve,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(Te,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:r("Export")}),(0,t.jsx)(C,{children:r("Message")}),(0,t.jsx)(C,{children:r("Attempts")}),(0,t.jsx)(C,{children:r("Outcome")}),(0,t.jsx)(C,{children:r("Body")}),(0,t.jsx)(C,{children:r("Captured")}),(0,t.jsx)(C,{})]})}),(0,t.jsx)(Be,{children:l.map(b=>(0,t.jsx)(xt,{message:b,onReplay:s,replayingId:o},b.id))})]})})})}),e[21]=a,e[22]=l,e[23]=s,e[24]=o,e[25]=r,e[26]=g):g=e[26];let q;return e[27]!==f||e[28]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[f,g]}),e[27]=f,e[28]=g,e[29]=q):q=e[29],q},"gt"),Nt=h(n=>{let e=(0,z.c)(20),{batchMode:a,bodyText:l,delayText:d,onBatchModeChange:s,onBodyChange:o,onDelayChange:r,onSelectExport:p,onSend:u,queues:x,selectedExportName:N,sending:y}=n,i=$(),m;e[0]!==i?(m=i("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=i,e[1]=m):m=e[1];let f;e[2]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==a||e[5]!==l||e[6]!==d||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==p||e[11]!==u||e[12]!==x||e[13]!==N||e[14]!==y||e[15]!==i?(g=x.length===0?(0,t.jsx)(ie,{description:i("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:i("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":i("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:p,value:N,children:x.map(qt)}),(0,t.jsx)(We,{"aria-label":i("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:i("Delay (s)"),type:"number",value:d}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),i("Send as batch (JSON array)")]}),(0,t.jsx)(le,{className:"ml-auto","data-testid":"queues-send-button",disabled:y||N==="",onClick:u,type:"button",children:i(y?"Sending\u2026":"Send message")})]}),(0,t.jsx)(He,{"aria-label":i("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:o,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:l})]}),e[4]=a,e[5]=l,e[6]=d,e[7]=s,e[8]=o,e[9]=r,e[10]=p,e[11]=u,e[12]=x,e[13]=N,e[14]=y,e[15]=i,e[16]=g):g=e[16];let q;return e[17]!==f||e[18]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[f,g]}),e[17]=f,e[18]=g,e[19]=q):q=e[19],q},"ft"),Ft=h(n=>{let e=(0,z.c)(59),{limit:a}=n,l=a??lt,d=ze(),s=$(),[o,r]=(0,A.useState)("declared"),[p,u]=(0,A.useState)(null),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];let{data:N,error:y,errorSource:i}=_e(F.listQueues,x),m;e[1]!==l?(m={limit:l},e[1]=l,e[2]=m):m=e[2];let{data:f,error:g,errorSource:q,refetch:b}=_e(F.getQueueMessages,m),S=Array.isArray(N?.queues)?[...N.queues].toSorted(vt):[],M=f?.entries??[],{deadLetteredCount:Q,queuesWithoutDlq:L,showReliabilityWarning:T}=dt(S,M),[W,j]=(0,A.useState)(""),[D,E]=(0,A.useState)(""),[I,_]=(0,A.useState)(""),[U,Ye]=(0,A.useState)(!1),[pe,Oe]=(0,A.useState)(!1),[ge,Re]=(0,A.useState)(null),H=S.some(c=>c.exportName===W)?W:S[0]?.exportName??"",Je=o==="messages"?g:y,Ze=o==="messages"?q:i,fe=Je??p,xe=Je===null?p:Ze,K;e[3]!==b?(K=h(()=>{b()},"H"),e[3]=b,e[4]=K):K=e[4],Ke(K,o==="messages");let ye=h(async()=>{u(null);let c=H;if(c==="")return;let v=null,$e=D.trim();if($e!=="")try{v=JSON.parse($e)}catch{u(s("Body must be valid JSON."));return}let Ae,Fe=I.trim();if(Fe!==""){let P=Number(Fe);if(!Number.isFinite(P)||P<0){u(s("Delay must be a non-negative number of seconds."));return}Ae=P}if(U&&!Array.isArray(v)){u(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let st=U?{batch:v,delaySeconds:Ae,exportName:c}:{body:v,delaySeconds:Ae,exportName:c};try{await d.query(it,st,ue("")),b()}catch(P){u(me(P))}Oe(!1)},"ce"),V;e[5]!==d||e[6]!==b?(V=h(async c=>{u(null),Re(c);try{await d.query(ct,{id:c},ue("")),b()}catch(v){u(me(v))}Re(null)},"K"),e[5]=d,e[6]=b,e[7]=V):V=e[7];let Ne=V,X;e[8]!==d||e[9]!==b?(X=h(async()=>{u(null);try{await d.query(ut,{},ue("")),b()}catch(c){u(me(c))}},"V"),e[8]=d,e[9]=b,e[10]=X):X=e[10];let be=X,Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=h(c=>{let v=c.currentTarget.dataset.tab;(v==="declared"||v==="messages"||v==="send")&&r(v)},"X"),e[11]=Y):Y=e[11];let et=Y,Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=h(c=>{j(c.currentTarget.value)},"Y"),e[12]=Z):Z=e[12];let qe=Z,ee;e[13]===Symbol.for("react.memo_cache_sentinel")?(ee=h(c=>{E(c.currentTarget.value)},"Z"),e[13]=ee):ee=e[13];let ve=ee,te;e[14]===Symbol.for("react.memo_cache_sentinel")?(te=h(c=>{_(c.currentTarget.value)},"ee"),e[14]=te):te=e[14];let Se=te,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=h(c=>{Ye(c.currentTarget.checked)},"te"),e[15]=ae):ae=e[15];let Ce=ae,se;e[16]!==ye?(se=h(()=>{he(ye())},"ae"),e[16]=ye,e[17]=se):se=e[17];let we=se,re;e[18]!==Ne?(re=h(c=>{let{id:v}=c.currentTarget.dataset;v!==void 0&&he(Ne(v))},"se"),e[18]=Ne,e[19]=re):re=e[19];let Ie=re,ne;e[20]!==be?(ne=h(()=>{he(be())},"re"),e[20]=be,e[21]=ne):ne=e[21];let Qe=ne,tt="flex flex-col gap-6",at="lunora-queues-panel",k;e[22]!==s||e[23]!==o?(k=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(c=>(0,t.jsx)(le,{"aria-selected":o===c,"data-tab":c,"data-testid":`queues-tab-${c}`,onClick:et,role:"tab",size:"sm",type:"button",variant:o===c?"secondary":"ghost",children:gt(c,s)},c))}),e[22]=s,e[23]=o,e[24]=k):k=e[24];let B;e[25]!==fe||e[26]!==xe?(B=fe!==null&&(0,t.jsx)(Pe,{error:xe,testId:"queues-error"}),e[25]=fe,e[26]=xe,e[27]=B):B=e[27];let Le=T&&(0,t.jsx)(Ue,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:L.map(St).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),Q>0&&(0,t.jsx)("p",{className:L.length>0?"text-muted-foreground":"font-medium",children:Q===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:Q})})]})}),O;e[28]!==S||e[29]!==N||e[30]!==o?(O=o==="declared"&&(0,t.jsx)(ft,{loaded:N!==void 0,queues:S}),e[28]=S,e[29]=N,e[30]=o,e[31]=O):O=e[31];let R;e[32]!==M||e[33]!==g||e[34]!==Qe||e[35]!==Ie||e[36]!==ge||e[37]!==o?(R=o==="messages"&&(0,t.jsx)(yt,{hasError:g!==null,messages:M,onClear:Qe,onReplay:Ie,replayingId:ge}),e[32]=M,e[33]=g,e[34]=Qe,e[35]=Ie,e[36]=ge,e[37]=o,e[38]=R):R=e[38];let J;e[39]!==U||e[40]!==D||e[41]!==I||e[42]!==Ce||e[43]!==ve||e[44]!==Se||e[45]!==qe||e[46]!==we||e[47]!==S||e[48]!==H||e[49]!==pe||e[50]!==o?(J=o==="send"&&(0,t.jsx)(Nt,{batchMode:U,bodyText:D,delayText:I,onBatchModeChange:Ce,onBodyChange:ve,onDelayChange:Se,onSelectExport:qe,onSend:we,queues:S,selectedExportName:H,sending:pe}),e[39]=U,e[40]=D,e[41]=I,e[42]=Ce,e[43]=ve,e[44]=Se,e[45]=qe,e[46]=we,e[47]=S,e[48]=H,e[49]=pe,e[50]=o,e[51]=J):J=e[51];let oe;return e[52]!==k||e[53]!==B||e[54]!==Le||e[55]!==O||e[56]!==R||e[57]!==J?(oe=(0,t.jsxs)("div",{className:tt,"data-testid":at,children:[k,B,Le,O,R,J]}),e[52]=k,e[53]=B,e[54]=Le,e[55]=O,e[56]=R,e[57]=J,e[58]=oe):oe=e[58],oe},"Ft");function bt(n){return(0,t.jsxs)(G,{"data-testid":`queues-row-${n.exportName}`,children:[(0,t.jsx)(w,{className:"font-mono text-xs",children:n.exportName}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.name}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.mode}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.binding}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.deadLetterQueue??"\u2014"})]},n.exportName)}h(bt,"xt");function qt(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}h(qt,"yt");function vt(n,e){return n.exportName.localeCompare(e.exportName)}h(vt,"Nt");function St(n){return n.name}h(St,"bt");export{Ft as default};
|
|
1
|
+
import{a as Ve}from"./chunk-LEDWUPXM.js";import"./chunk-2PJNAWB3.js";import{a as He}from"./chunk-V53KNYRN.js";import{a as Ke}from"./chunk-54MMVNPT.js";import"./chunk-BGBLQ563.js";import{a as Ge}from"./chunk-AREBQI6D.js";import{R as We}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as le}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as de}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Pe}from"./chunk-KBBOZRRX.js";import{a as Ue}from"./chunk-XXQUMVWH.js";import"./chunk-DSU54IAT.js";import"./chunk-QLQADHFE.js";import{a as F}from"./chunk-VDW32UET.js";import{c as _e}from"./chunk-HRRFUAP6.js";import{f as ze}from"./chunk-6FQJRXVI.js";import"./chunk-XBDKZZ67.js";import{a as ie}from"./chunk-XQCVZAGU.js";import{a as Te,b as ke,c as Be,d as G,e as C,f as w}from"./chunk-WJQLNYGX.js";import{a as De,e as Ee}from"./chunk-WQH3LT2P.js";import{d as $,f as ce,g as ue,h as me,o as he,r as je}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as h,e as Me,f as rt,g as nt,h as ot}from"./chunk-3XIESWL4.js";var z=Me(nt(),1);var A=Me(rt(),1);var t=Me(ot(),1);var dt=h((n,e)=>{let a=new Set(n.map(s=>s.deadLetterQueue).filter(s=>typeof s=="string"&&s!=="")),l=n.filter(s=>(s.deadLetterQueue===void 0||s.deadLetterQueue==="")&&!a.has(s.name)),d=e.filter(s=>s.deadLettered).length;return{deadLetteredCount:d,queuesWithoutDlq:l,showReliabilityWarning:l.length>0||d>0}},"rt"),lt=200,it=ce(F.sendQueueMessage),ct=ce(F.replayQueueMessage),ut=ce(F.clearQueueMessages),Xe=96,mt=h(n=>{if(n===void 0)return"\u2014";try{return JSON.stringify(n)}catch{return"[unserializable]"}},"it"),ht=h(n=>n.length>Xe?`${n.slice(0,Xe)}\u2026`:n,"ut"),pt=h(n=>n==="error"?"destructive":n==="retry"?"outline":"secondary","ct"),gt=h((n,e)=>e(n==="messages"?"Messages":n==="send"?"Send":"Declared"),"mt"),ft=h(n=>{let e=(0,z.c)(11),{loaded:a,queues:l}=n,d=$(),s;e[0]!==d?(s=d("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[0]=d,e[1]=s):s=e[1];let o;e[2]!==s?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==l||e[6]!==d?(r=a&&l.length===0?(0,t.jsx)(ie,{description:d("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:d("No queues defined")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsxs)(Te,{"data-testid":"queues-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:d("Export")}),(0,t.jsx)(C,{children:d("Queue")}),(0,t.jsx)(C,{children:d("Mode")}),(0,t.jsx)(C,{children:d("Binding")}),(0,t.jsx)(C,{children:d("Dead-letter")})]})}),(0,t.jsx)(Be,{children:l.map(bt)})]})})}),e[4]=a,e[5]=l,e[6]=d,e[7]=r):r=e[7];let p;return e[8]!==o||e[9]!==r?(p=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-declared",children:[o,r]}),e[8]=o,e[9]=r,e[10]=p):p=e[10],p},"ht"),xt=h(n=>{let e=(0,z.c)(67),{message:a,onReplay:l,replayingId:d}=n,s=$(),o,r,p,u,x,N,y,i,m,f;if(e[0]!==a.attempts||e[1]!==a.body||e[2]!==a.deadLettered||e[3]!==a.exportName||e[4]!==a.id||e[5]!==a.messageId||e[6]!==a.outcome||e[7]!==a.queue||e[8]!==s){let W=mt(a.body);r=G,N=`queues-message-${a.id}`;let j=a.exportName??a.queue;e[19]!==j?(y=(0,t.jsx)(w,{className:"font-mono text-xs",children:j}),e[19]=j,e[20]=y):y=e[20],e[21]!==a.messageId?(i=(0,t.jsx)(w,{className:"max-w-[16ch] truncate font-mono text-xs text-muted-foreground",title:a.messageId,children:a.messageId}),e[21]=a.messageId,e[22]=i):i=e[22],e[23]!==a.attempts?(m=(0,t.jsx)(w,{className:"font-mono text-xs tabular-nums",children:a.attempts}),e[23]=a.attempts,e[24]=m):m=e[24];let D=`queues-outcome-${a.id}`,E;e[25]!==a.outcome?(E=pt(a.outcome),e[25]=a.outcome,e[26]=E):E=e[26];let I;e[27]!==a.outcome||e[28]!==D||e[29]!==E?(I=(0,t.jsx)(de,{"data-testid":D,variant:E,children:a.outcome}),e[27]=a.outcome,e[28]=D,e[29]=E,e[30]=I):I=e[30];let _;e[31]!==a.deadLettered||e[32]!==a.id||e[33]!==s?(_=a.deadLettered&&(0,t.jsx)(de,{"data-testid":`queues-dlq-${a.id}`,variant:"destructive",children:s("DLQ")}),e[31]=a.deadLettered,e[32]=a.id,e[33]=s,e[34]=_):_=e[34],e[35]!==I||e[36]!==_?(f=(0,t.jsx)(w,{children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[I,_]})}),e[35]=I,e[36]=_,e[37]=f):f=e[37],o=w,p="max-w-[32ch] truncate font-mono text-xs text-muted-foreground",u=W,x=ht(W),e[0]=a.attempts,e[1]=a.body,e[2]=a.deadLettered,e[3]=a.exportName,e[4]=a.id,e[5]=a.messageId,e[6]=a.outcome,e[7]=a.queue,e[8]=s,e[9]=o,e[10]=r,e[11]=p,e[12]=u,e[13]=x,e[14]=N,e[15]=y,e[16]=i,e[17]=m,e[18]=f}else o=e[9],r=e[10],p=e[11],u=e[12],x=e[13],N=e[14],y=e[15],i=e[16],m=e[17],f=e[18];let g;e[38]!==o||e[39]!==p||e[40]!==u||e[41]!==x?(g=(0,t.jsx)(o,{className:p,title:u,children:x}),e[38]=o,e[39]=p,e[40]=u,e[41]=x,e[42]=g):g=e[42];let q;e[43]!==a.capturedAt?(q=je(a.capturedAt,"\u2014"),e[43]=a.capturedAt,e[44]=q):q=e[44];let b;e[45]!==q?(b=(0,t.jsx)(w,{className:"text-xs text-muted-foreground tabular-nums",children:q}),e[45]=q,e[46]=b):b=e[46];let S=`queues-replay-${a.id}`,M=d!==null,Q;e[47]!==a.id||e[48]!==d||e[49]!==s?(Q=d===a.id?s("Replaying\u2026"):s("Replay"),e[47]=a.id,e[48]=d,e[49]=s,e[50]=Q):Q=e[50];let L;e[51]!==a.id||e[52]!==l||e[53]!==S||e[54]!==M||e[55]!==Q?(L=(0,t.jsx)(w,{children:(0,t.jsx)(le,{"data-id":a.id,"data-testid":S,disabled:M,onClick:l,size:"xs",type:"button",variant:"outline",children:Q})}),e[51]=a.id,e[52]=l,e[53]=S,e[54]=M,e[55]=Q,e[56]=L):L=e[56];let T;return e[57]!==r||e[58]!==b||e[59]!==L||e[60]!==N||e[61]!==y||e[62]!==i||e[63]!==m||e[64]!==f||e[65]!==g?(T=(0,t.jsxs)(r,{"data-testid":N,children:[y,i,m,f,g,b,L]}),e[57]=r,e[58]=b,e[59]=L,e[60]=N,e[61]=y,e[62]=i,e[63]=m,e[64]=f,e[65]=g,e[66]=T):T=e[66],T},"pt"),yt=h(n=>{let e=(0,z.c)(30),{hasError:a,messages:l,onClear:d,onReplay:s,replayingId:o}=n,r=$(),p;e[0]!==r?(p=r("Cloudflare Queues have no peek API, so this is what push consumers actually processed \u2014 not pending depth."),e[0]=r,e[1]=p):p=e[1];let u;e[2]!==p?(u=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p}),e[2]=p,e[3]=u):u=e[3];let x;e[4]!==l.length||e[5]!==r?(x=r("Clear {count} messages?",{count:l.length}),e[4]=l.length,e[5]=r,e[6]=x):x=e[6];let N=l.length===0,y;e[7]!==r?(y=r("Clear log"),e[7]=r,e[8]=y):y=e[8];let i;e[9]!==d||e[10]!==x||e[11]!==N||e[12]!==y?(i=(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(Ge,{confirmLabel:x,disabled:N,onConfirm:d,testId:"queues-clear",children:y})}),e[9]=d,e[10]=x,e[11]=N,e[12]=y,e[13]=i):i=e[13];let m;e[14]!==l.length||e[15]!==r?(m=l.length>0&&(0,t.jsx)(de,{"data-testid":"queues-count",variant:"secondary",children:r("{count} messages",{count:l.length})}),e[14]=l.length,e[15]=r,e[16]=m):m=e[16];let f;e[17]!==u||e[18]!==i||e[19]!==m?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[u,i,m]}),e[17]=u,e[18]=i,e[19]=m,e[20]=f):f=e[20];let g;e[21]!==a||e[22]!==l||e[23]!==s||e[24]!==o||e[25]!==r?(g=!a&&l.length===0?(0,t.jsx)(ie,{description:r("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:r("No consumed messages yet.")}):(0,t.jsx)(De,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ee,{className:"px-0",children:(0,t.jsx)(Ve,{className:"max-h-[32rem]","data-testid":"queues-messages-scroll",children:(0,t.jsxs)(Te,{"data-testid":"queues-messages-table",children:[(0,t.jsx)(ke,{children:(0,t.jsxs)(G,{children:[(0,t.jsx)(C,{children:r("Export")}),(0,t.jsx)(C,{children:r("Message")}),(0,t.jsx)(C,{children:r("Attempts")}),(0,t.jsx)(C,{children:r("Outcome")}),(0,t.jsx)(C,{children:r("Body")}),(0,t.jsx)(C,{children:r("Captured")}),(0,t.jsx)(C,{})]})}),(0,t.jsx)(Be,{children:l.map(b=>(0,t.jsx)(xt,{message:b,onReplay:s,replayingId:o},b.id))})]})})})}),e[21]=a,e[22]=l,e[23]=s,e[24]=o,e[25]=r,e[26]=g):g=e[26];let q;return e[27]!==f||e[28]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"queues-messages",children:[f,g]}),e[27]=f,e[28]=g,e[29]=q):q=e[29],q},"gt"),Nt=h(n=>{let e=(0,z.c)(20),{batchMode:a,bodyText:l,delayText:d,onBatchModeChange:s,onBodyChange:o,onDelayChange:r,onSelectExport:p,onSend:u,queues:x,selectedExportName:N,sending:y}=n,i=$(),m;e[0]!==i?(m=i("Enqueue a JSON message to a declared producer to exercise its consumer. Nothing is captured until the consumer processes it."),e[0]=i,e[1]=m):m=e[1];let f;e[2]!==m?(f=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==a||e[5]!==l||e[6]!==d||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==p||e[11]!==u||e[12]!==x||e[13]!==N||e[14]!==y||e[15]!==i?(g=x.length===0?(0,t.jsx)(ie,{description:i("Declare a queue with defineQueue in lunora/queues.ts to enqueue a test message."),testId:"queues-send-empty",title:i("No queues to send to")}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("select",{"aria-label":i("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:p,value:N,children:x.map(qt)}),(0,t.jsx)(We,{"aria-label":i("Delay (seconds)"),className:"max-w-36","data-testid":"queues-send-delay",min:0,onChange:r,placeholder:i("Delay (s)"),type:"number",value:d}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"queues-send-batch",children:[(0,t.jsx)("input",{checked:a,"data-testid":"queues-send-batch",id:"queues-send-batch",onChange:s,type:"checkbox"}),i("Send as batch (JSON array)")]}),(0,t.jsx)(le,{className:"ml-auto","data-testid":"queues-send-button",disabled:y||N==="",onClick:u,type:"button",children:i(y?"Sending\u2026":"Send message")})]}),(0,t.jsx)(He,{"aria-label":i("Message body (JSON)"),className:"font-mono","data-testid":"queues-send-body",onChange:o,placeholder:a?'[ { "hello": "world" } ]':'{ "hello": "world" }',value:l})]}),e[4]=a,e[5]=l,e[6]=d,e[7]=s,e[8]=o,e[9]=r,e[10]=p,e[11]=u,e[12]=x,e[13]=N,e[14]=y,e[15]=i,e[16]=g):g=e[16];let q;return e[17]!==f||e[18]!==g?(q=(0,t.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"queues-send",children:[f,g]}),e[17]=f,e[18]=g,e[19]=q):q=e[19],q},"ft"),Ft=h(n=>{let e=(0,z.c)(59),{limit:a}=n,l=a??lt,d=ze(),s=$(),[o,r]=(0,A.useState)("declared"),[p,u]=(0,A.useState)(null),x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x={},e[0]=x):x=e[0];let{data:N,error:y,errorSource:i}=_e(F.listQueues,x),m;e[1]!==l?(m={limit:l},e[1]=l,e[2]=m):m=e[2];let{data:f,error:g,errorSource:q,refetch:b}=_e(F.getQueueMessages,m),S=Array.isArray(N?.queues)?[...N.queues].toSorted(vt):[],M=f?.entries??[],{deadLetteredCount:Q,queuesWithoutDlq:L,showReliabilityWarning:T}=dt(S,M),[W,j]=(0,A.useState)(""),[D,E]=(0,A.useState)(""),[I,_]=(0,A.useState)(""),[U,Ye]=(0,A.useState)(!1),[pe,Oe]=(0,A.useState)(!1),[ge,Re]=(0,A.useState)(null),H=S.some(c=>c.exportName===W)?W:S[0]?.exportName??"",Je=o==="messages"?g:y,Ze=o==="messages"?q:i,fe=Je??p,xe=Je===null?p:Ze,K;e[3]!==b?(K=h(()=>{b()},"H"),e[3]=b,e[4]=K):K=e[4],Ke(K,o==="messages");let ye=h(async()=>{u(null);let c=H;if(c==="")return;let v=null,$e=D.trim();if($e!=="")try{v=JSON.parse($e)}catch{u(s("Body must be valid JSON."));return}let Ae,Fe=I.trim();if(Fe!==""){let P=Number(Fe);if(!Number.isFinite(P)||P<0){u(s("Delay must be a non-negative number of seconds."));return}Ae=P}if(U&&!Array.isArray(v)){u(s("Batch mode needs a JSON array body \u2014 each element is enqueued as one message."));return}Oe(!0);let st=U?{batch:v,delaySeconds:Ae,exportName:c}:{body:v,delaySeconds:Ae,exportName:c};try{await d.query(it,st,ue("")),b()}catch(P){u(me(P))}Oe(!1)},"ce"),V;e[5]!==d||e[6]!==b?(V=h(async c=>{u(null),Re(c);try{await d.query(ct,{id:c},ue("")),b()}catch(v){u(me(v))}Re(null)},"K"),e[5]=d,e[6]=b,e[7]=V):V=e[7];let Ne=V,X;e[8]!==d||e[9]!==b?(X=h(async()=>{u(null);try{await d.query(ut,{},ue("")),b()}catch(c){u(me(c))}},"V"),e[8]=d,e[9]=b,e[10]=X):X=e[10];let be=X,Y;e[11]===Symbol.for("react.memo_cache_sentinel")?(Y=h(c=>{let v=c.currentTarget.dataset.tab;(v==="declared"||v==="messages"||v==="send")&&r(v)},"X"),e[11]=Y):Y=e[11];let et=Y,Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=h(c=>{j(c.currentTarget.value)},"Y"),e[12]=Z):Z=e[12];let qe=Z,ee;e[13]===Symbol.for("react.memo_cache_sentinel")?(ee=h(c=>{E(c.currentTarget.value)},"Z"),e[13]=ee):ee=e[13];let ve=ee,te;e[14]===Symbol.for("react.memo_cache_sentinel")?(te=h(c=>{_(c.currentTarget.value)},"ee"),e[14]=te):te=e[14];let Se=te,ae;e[15]===Symbol.for("react.memo_cache_sentinel")?(ae=h(c=>{Ye(c.currentTarget.checked)},"te"),e[15]=ae):ae=e[15];let Ce=ae,se;e[16]!==ye?(se=h(()=>{he(ye())},"ae"),e[16]=ye,e[17]=se):se=e[17];let we=se,re;e[18]!==Ne?(re=h(c=>{let{id:v}=c.currentTarget.dataset;v!==void 0&&he(Ne(v))},"se"),e[18]=Ne,e[19]=re):re=e[19];let Ie=re,ne;e[20]!==be?(ne=h(()=>{he(be())},"re"),e[20]=be,e[21]=ne):ne=e[21];let Qe=ne,tt="flex flex-col gap-6",at="lunora-queues-panel",k;e[22]!==s||e[23]!==o?(k=(0,t.jsx)("div",{className:"flex items-center gap-1","data-testid":"queues-tabs",role:"tablist",children:["declared","messages","send"].map(c=>(0,t.jsx)(le,{"aria-selected":o===c,"data-tab":c,"data-testid":`queues-tab-${c}`,onClick:et,role:"tab",size:"sm",type:"button",variant:o===c?"secondary":"ghost",children:gt(c,s)},c))}),e[22]=s,e[23]=o,e[24]=k):k=e[24];let B;e[25]!==fe||e[26]!==xe?(B=fe!==null&&(0,t.jsx)(Pe,{error:xe,testId:"queues-error"}),e[25]=fe,e[26]=xe,e[27]=B):B=e[27];let Le=T&&(0,t.jsx)(Ue,{icon:(0,t.jsx)("span",{"aria-hidden":"true",className:"text-base leading-none",children:"\u26A0"}),testId:"queues-dlq-warning",variant:"warning",children:(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[L.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"font-medium",children:s("No dead-letter queue on {queues}.",{queues:L.map(St).join(", ")})}),(0,t.jsx)("p",{className:"text-muted-foreground",children:s("Exhausted messages are dropped after retries. Add a deadLetterQueue to capture them.")})]}),Q>0&&(0,t.jsx)("p",{className:L.length>0?"text-muted-foreground":"font-medium",children:Q===1?s("1 message was recently dead-lettered."):s("{count} messages were recently dead-lettered.",{count:Q})})]})}),O;e[28]!==S||e[29]!==N||e[30]!==o?(O=o==="declared"&&(0,t.jsx)(ft,{loaded:N!==void 0,queues:S}),e[28]=S,e[29]=N,e[30]=o,e[31]=O):O=e[31];let R;e[32]!==M||e[33]!==g||e[34]!==Qe||e[35]!==Ie||e[36]!==ge||e[37]!==o?(R=o==="messages"&&(0,t.jsx)(yt,{hasError:g!==null,messages:M,onClear:Qe,onReplay:Ie,replayingId:ge}),e[32]=M,e[33]=g,e[34]=Qe,e[35]=Ie,e[36]=ge,e[37]=o,e[38]=R):R=e[38];let J;e[39]!==U||e[40]!==D||e[41]!==I||e[42]!==Ce||e[43]!==ve||e[44]!==Se||e[45]!==qe||e[46]!==we||e[47]!==S||e[48]!==H||e[49]!==pe||e[50]!==o?(J=o==="send"&&(0,t.jsx)(Nt,{batchMode:U,bodyText:D,delayText:I,onBatchModeChange:Ce,onBodyChange:ve,onDelayChange:Se,onSelectExport:qe,onSend:we,queues:S,selectedExportName:H,sending:pe}),e[39]=U,e[40]=D,e[41]=I,e[42]=Ce,e[43]=ve,e[44]=Se,e[45]=qe,e[46]=we,e[47]=S,e[48]=H,e[49]=pe,e[50]=o,e[51]=J):J=e[51];let oe;return e[52]!==k||e[53]!==B||e[54]!==Le||e[55]!==O||e[56]!==R||e[57]!==J?(oe=(0,t.jsxs)("div",{className:tt,"data-testid":at,children:[k,B,Le,O,R,J]}),e[52]=k,e[53]=B,e[54]=Le,e[55]=O,e[56]=R,e[57]=J,e[58]=oe):oe=e[58],oe},"Ft");function bt(n){return(0,t.jsxs)(G,{"data-testid":`queues-row-${n.exportName}`,children:[(0,t.jsx)(w,{className:"font-mono text-xs",children:n.exportName}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.name}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.mode}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.binding}),(0,t.jsx)(w,{className:"font-mono text-xs text-muted-foreground",children:n.deadLetterQueue??"\u2014"})]},n.exportName)}h(bt,"xt");function qt(n){return(0,t.jsx)("option",{value:n.exportName,children:n.exportName},n.exportName)}h(qt,"yt");function vt(n,e){return n.exportName.localeCompare(e.exportName)}h(vt,"Nt");function St(n){return n.name}h(St,"bt");export{Ft as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-XXQUMVWH.js";import{a as U}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-XXQUMVWH.js";import{a as U}from"./chunk-DSU54IAT.js";import{b as q}from"./chunk-QLQADHFE.js";import{d as A,h as C,j as H,k as O}from"./chunk-IUYFXK4X.js";import{a as V}from"./chunk-P33WK7YI.js";import{a as y,e as I,g as T,h as _}from"./chunk-3XIESWL4.js";var G=I(T(),1);var i=I(_(),1);var K=y(S=>{let e=(0,G.c)(38),{className:w,error:t,testId:N}=S,g=A(),r=q(),l,s,n,a,c,m,o,d;if(e[0]!==w||e[1]!==t||e[2]!==r||e[3]!==N){let j=H(t),h;e[12]!==t?(h=O(t),e[12]=t,e[13]=h):h=e[13],s=h;let x;e[14]!==t?(x=U(t),e[14]=t,e[15]=x):x=e[15];let k=x,v;e[16]!==r||e[17]!==k?(v=y(()=>{r?.openConsole({errorsOnly:!0,seq:k})},"x"),e[16]=r,e[17]=k,e[18]=v):v=e[18],n=v,l=D,a=w,c=N,m="destructive";let u;e[19]!==t?(u=C(t),e[19]=t,e[20]=u):u=e[20],e[21]!==u?(o=(0,i.jsx)("p",{className:"font-medium",children:u}),e[21]=u,e[22]=o):o=e[22],d=j===void 0?null:(0,i.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:V(j)}),e[0]=w,e[1]=t,e[2]=r,e[3]=N,e[4]=l,e[5]=s,e[6]=n,e[7]=a,e[8]=c,e[9]=m,e[10]=o,e[11]=d}else l=e[4],s=e[5],n=e[6],a=e[7],c=e[8],m=e[9],o=e[10],d=e[11];let p;e[23]!==s?(p=s===void 0?null:(0,i.jsx)("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:s,rel:"noreferrer",target:"_blank",children:"View error docs"}),e[23]=s,e[24]=p):p=e[24];let f;e[25]!==r||e[26]!==n||e[27]!==g?(f=r===void 0?null:(0,i.jsx)("button",{className:"mt-1 block text-xs underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":"error-show-in-console",onClick:n,type:"button",children:g("Show in console")}),e[25]=r,e[26]=n,e[27]=g,e[28]=f):f=e[28];let b;return e[29]!==l||e[30]!==a||e[31]!==c||e[32]!==m||e[33]!==o||e[34]!==d||e[35]!==p||e[36]!==f?(b=(0,i.jsxs)(l,{className:a,testId:c,variant:m,children:[o,d,p,f]}),e[29]=l,e[30]=a,e[31]=c,e[32]=m,e[33]=o,e[34]=d,e[35]=p,e[36]=f,e[37]=b):b=e[37],b},"G");export{K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ze}from"./chunk-BLHSTFG3.js";import"./chunk-GMR677FL.js";import"./chunk-4KIQ5RLS.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as Me}from"./chunk-5Y3QLNWX.js";import{a as Ye}from"./chunk-IGCNMZSB.js";import"./chunk-I6A5C46N.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import"./chunk-4UOFSGUS.js";import{a as Xe}from"./chunk-AREBQI6D.js";import{a as ze}from"./chunk-3CWGJYBB.js";import{a as We}from"./chunk-RMN2JN4S.js";import{b as Ve}from"./chunk-GRL5MG3Z.js";import{d as De,e as Fe}from"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import{R as Ae}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as Ee}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as _e}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as we}from"./chunk-NCKRVNF2.js";import"./chunk-XXQUMVWH.js";import"./chunk-NJRW66LJ.js";import"./chunk-QLQADHFE.js";import{a as C}from"./chunk-VDW32UET.js";import{c as de}from"./chunk-6F7KP54M.js";import{f as Te}from"./chunk-C2ZFQARQ.js";import"./chunk-XBDKZZ67.js";import{a as ye}from"./chunk-XQCVZAGU.js";import{a as Ge,b as He,c as Qe,d as Ie,e as O,f as I}from"./chunk-WJQLNYGX.js";import{a as Le,e as Je}from"./chunk-WQH3LT2P.js";import{d as oe,f as Ue,g as Pe,h as Be,o as ke,r as Ne}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as m,e as ie,f as qe,g as Ce,h as Ke,j as ne}from"./chunk-3XIESWL4.js";var me=ie(Ce(),1),ce=ie(qe(),1);var et=ie(Ce(),1);var j=ie(qe(),1);var l=ie(Ke(),1);var ct=Ue(C.runMigration),tt=m(a=>{let e=(0,et.c)(98),{initialShardKey:r}=a,s=Te(),t=oe(),{queryShardKey:d,setShardKey:i,shardKey:n}=ze(r),[u,b]=(0,j.useState)(""),[h,v]=(0,j.useState)("up"),[p,g]=(0,j.useState)(!0),[f,y]=(0,j.useState)(!1),[x,c]=(0,j.useState)(null),[N,k]=(0,j.useState)(null),K;e[0]!==n?(K=n.trim(),e[0]=n,e[1]=K):K=e[1];let M=K===d,S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S={},e[2]=S):S=e[2];let R;e[3]!==d?(R={live:!0,shardKey:d},e[3]=d,e[4]=R):R=e[4];let w=de(C.migrationStatus,S,R),$=w.data?.migrations??null,$e=w.error,{errorSource:je,liveError:Se}=w,ue,he;e[5]!==d||e[6]!==w.data?(ue=m(()=>{w.data!==void 0&&Ve(d)},"Q"),he=[w.data,d],e[5]=d,e[6]=w.data,e[7]=ue,e[8]=he):(ue=e[7],he=e[8]),(0,j.useEffect)(ue,he);let pe;if(e[9]!==s||e[10]!==h||e[11]!==p||e[12]!==u||e[13]!==n||e[14]!==w||e[15]!==t){let q=m(async()=>{let Re=u.trim();if(Re===""){k(t("Enter a migration id")),c(null);return}y(!0),k(null);try{let Oe=await s.query(ct,{direction:h,dryRun:p,id:Re},Pe(n));c(Oe),w.refetch()}catch(Oe){let lt=Oe;c(null),k(Be(lt))}y(!1)},"m");pe=m(()=>{ke(q())},"X"),e[9]=s,e[10]=h,e[11]=p,e[12]=u,e[13]=n,e[14]=w,e[15]=t,e[16]=pe}else pe=e[16];let fe=pe,ge;e[17]===Symbol.for("react.memo_cache_sentinel")?(ge=m(q=>{b(q.target.value)},"Z"),e[17]=ge):ge=e[17];let nt=ge,be;e[18]===Symbol.for("react.memo_cache_sentinel")?(be=m(q=>{v(q.target.value==="down"?"down":"up")},"H"),e[18]=be):be=e[18];let ot=be,ve;e[19]===Symbol.for("react.memo_cache_sentinel")?(ve=m(q=>{g(q.target.checked)},"ee"),e[19]=ve):ve=e[19];let dt=ve,T;e[20]!==i||e[21]!==n?(T=(0,l.jsx)(We,{onChange:i,testId:"mg-shard-input",value:n}),e[20]=i,e[21]=n,e[22]=T):T=e[22];let D;e[23]!==Se?(D=(0,l.jsx)(Ye,{message:Se,prefix:"mg"}),e[23]=Se,e[24]=D):D=e[24];let F;e[25]!==T||e[26]!==D?(F=(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[T,D]}),e[25]=T,e[26]=D,e[27]=F):F=e[27];let _;e[28]!==$e||e[29]!==je?(_=$e!==null&&(0,l.jsx)(we,{error:je,testId:"mg-status-error"}),e[28]=$e,e[29]=je,e[30]=_):_=e[30];let A;e[31]!==$||e[32]!==t?(A=$!==null&&$.length===0&&(0,l.jsx)(ye,{description:t("Data migrations you run against this shard will be tracked here."),icon:(0,l.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})}),testId:"mg-empty",title:t("No migrations have run on this shard.")}),e[31]=$,e[32]=t,e[33]=A):A=e[33];let E;e[34]!==$||e[35]!==t?(E=$!==null&&$.length>0&&(0,l.jsx)(Le,{className:"overflow-hidden py-0",children:(0,l.jsx)(Je,{className:"px-0",children:(0,l.jsxs)(Ge,{"data-testid":"mg-table",children:[(0,l.jsx)(He,{children:(0,l.jsxs)(Ie,{children:[(0,l.jsx)(O,{children:t("id")}),(0,l.jsx)(O,{children:t("direction")}),(0,l.jsx)(O,{children:t("status")}),(0,l.jsx)(O,{children:t("processed")}),(0,l.jsx)(O,{children:t("changed")}),(0,l.jsx)(O,{children:t("updated")}),(0,l.jsx)(O,{children:t("error")})]})}),(0,l.jsx)(Qe,{children:$.map(mt)})]})})}),e[34]=$,e[35]=t,e[36]=E):E=e[36];let L;e[37]!==t?(L=t("Run migration"),e[37]=t,e[38]=L):L=e[38];let J;e[39]!==L?(J=(0,l.jsx)(Me,{children:L}),e[39]=L,e[40]=J):J=e[40];let U;e[41]!==t?(U=t("Migration id"),e[41]=t,e[42]=U):U=e[42];let P;e[43]!==t?(P=t("migration id"),e[43]=t,e[44]=P):P=e[44];let B;e[45]!==u||e[46]!==U||e[47]!==P?(B=(0,l.jsx)(Ae,{"aria-label":U,className:"w-auto","data-testid":"mg-id-input",onChange:nt,placeholder:P,value:u}),e[45]=u,e[46]=U,e[47]=P,e[48]=B):B=e[48];let V;e[49]!==t?(V=t("Direction"),e[49]=t,e[50]=V):V=e[50];let W;e[51]!==t?(W=t("up"),e[51]=t,e[52]=W):W=e[52];let z;e[53]!==W?(z=(0,l.jsx)("option",{value:"up",children:W}),e[53]=W,e[54]=z):z=e[54];let G;e[55]!==t?(G=t("down"),e[55]=t,e[56]=G):G=e[56];let H;e[57]!==G?(H=(0,l.jsx)("option",{value:"down",children:G}),e[57]=G,e[58]=H):H=e[58];let Q;e[59]!==h||e[60]!==V||e[61]!==z||e[62]!==H?(Q=(0,l.jsxs)("select",{"aria-label":V,className:"flex h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"mg-direction",onChange:ot,value:h,children:[z,H]}),e[59]=h,e[60]=V,e[61]=z,e[62]=H,e[63]=Q):Q=e[63];let X;e[64]!==p?(X=(0,l.jsx)("input",{checked:p,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:dt,type:"checkbox"}),e[64]=p,e[65]=X):X=e[65];let Y;e[66]!==t?(Y=t("Dry run"),e[66]=t,e[67]=Y):Y=e[67];let Z;e[68]!==X||e[69]!==Y?(Z=(0,l.jsxs)(Me,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[X,Y]}),e[68]=X,e[69]=Y,e[70]=Z):Z=e[70];let ee;e[71]!==p||e[72]!==fe||e[73]!==f||e[74]!==M||e[75]!==t?(ee=p?(0,l.jsx)(Ee,{"data-testid":"mg-run",disabled:f||!M,onClick:fe,type:"button",children:t(f?"Running\u2026":"Run")}):(0,l.jsx)(Xe,{confirmLabel:t(f?"Running\u2026":"Run migration?"),disabled:f||!M,onConfirm:fe,testId:"mg-run",children:t("Run")}),e[71]=p,e[72]=fe,e[73]=f,e[74]=M,e[75]=t,e[76]=ee):ee=e[76];let te;e[77]!==B||e[78]!==Q||e[79]!==Z||e[80]!==ee?(te=(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[B,Q,Z,ee]}),e[77]=B,e[78]=Q,e[79]=Z,e[80]=ee,e[81]=te):te=e[81];let ae;e[82]!==J||e[83]!==te?(ae=(0,l.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[J,te]}),e[82]=J,e[83]=te,e[84]=ae):ae=e[84];let re;e[85]!==N?(re=N!==null&&(0,l.jsx)("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:N}),e[85]=N,e[86]=re):re=e[86];let se;e[87]!==x||e[88]!==t?(se=x!==null&&(0,l.jsxs)("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[x.dryRun?t("Dry run: "):"",t("{status} \u2014 processed",{status:x.status}),x.processed,t(", changed"),x.changed]}),e[87]=x,e[88]=t,e[89]=se):se=e[89];let xe;return e[90]!==F||e[91]!==_||e[92]!==A||e[93]!==E||e[94]!==ae||e[95]!==re||e[96]!==se?(xe=(0,l.jsxs)("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[F,_,A,E,ae,re,se]}),e[90]=F,e[91]=_,e[92]=A,e[93]=E,e[94]=ae,e[95]=re,e[96]=se,e[97]=xe):xe=e[97],xe},"yr");function mt(a){return(0,l.jsxs)(Ie,{"data-testid":`mg-row-${a.id}`,children:[(0,l.jsx)(I,{children:a.id}),(0,l.jsx)(I,{children:a.direction}),(0,l.jsx)(I,{children:(0,l.jsx)(_e,{variant:"secondary",children:a.status})}),(0,l.jsx)(I,{children:a.processed}),(0,l.jsx)(I,{children:a.changed}),(0,l.jsx)(I,{children:Ne(a.updatedAt)}),(0,l.jsx)(I,{children:a.error??""})]},a.id)}m(mt,"Ve");var o=ie(Ke(),1);var le=m(a=>typeof a=="object"&&a!==null,"k"),ut=m(a=>le(a)&&le(a.fields)&&le(a.indexes)&&le(a.relations)&&typeof a.shardMode=="string","z"),ht=m(a=>{if(a===void 0||a.trim()==="")return{status:"absent"};let e;try{e=JSON.parse(a)}catch(r){return{error:`baseline is not valid JSON: ${r instanceof Error?r.message:String(r)}`,status:"invalid"}}if(!le(e)||e.version!==1||!le(e.tables))return{error:`baseline is malformed or written by an incompatible version (expected version ${String(1)})`,status:"invalid"};for(let[r,s]of Object.entries(e.tables))if(!ut(s))return{error:`baseline table "${r}" has an invalid structure`,status:"invalid"};return{snapshot:{jurisdiction:typeof e.jurisdiction=="string"?e.jurisdiction:void 0,migrationIds:Array.isArray(e.migrationIds)?e.migrationIds:[],tables:e.tables,version:1},status:"ok"}},"B"),pt=m((a,e)=>a.unique===e.unique&&a.fields.length===e.fields.length&&a.fields.every((r,s)=>r===e.fields[s]),"L"),ft=m((a,e,r,s)=>{let t=[];return r.kind!==s.kind&&t.push({severity:"breaking",summary:`field ${a}.${e} changed type: ${r.kind} \u2192 ${s.kind} \u2014 add a data migration to convert existing values`,table:a,scope:"table",type:"changedFieldKind"}),r.optional&&!s.optional?t.push({severity:"breaking",summary:`field ${a}.${e} became required \u2014 rows missing it would be invalid; add a data migration to backfill it`,table:a,scope:"table",type:"fieldOptionalToRequired"}):!r.optional&&s.optional&&t.push({scope:"table",severity:"safe",summary:`field ${a}.${e} became optional`,table:a,type:"fieldRequiredToOptional"}),t},"Q"),gt=m((a,e,r)=>r.optional?{scope:"table",severity:"safe",summary:`added optional field ${a}.${e}`,table:a,type:"addedOptionalField"}:{severity:"breaking",summary:`added required field ${a}.${e} \u2014 existing rows have no value; add a data migration to backfill it`,table:a,scope:"table",type:"addedRequiredField"},"G"),bt=m((a,e,r,s)=>{for(let[t,d]of Object.entries(r.fields)){let i=e.fields[t];i===void 0?s.push(gt(a,t,d)):s.push(...ft(a,t,i,d))}for(let t of Object.keys(e.fields))r.fields[t]===void 0&&s.push({severity:"breaking",summary:`removed field ${a}.${t} \u2014 add a data migration if stored data must be cleaned up`,table:a,scope:"table",type:"removedField"})},"X"),vt=m((a,e,r,s)=>{for(let[t,d]of Object.entries(r.indexes)){let i=e.indexes[t];if(i===void 0){s.push({scope:"table",severity:"safe",summary:`added index ${t} on ${a}`,table:a,type:"addedIndex"});continue}pt(i,d)||s.push({severity:"breaking",summary:`index ${t} on ${a} changed shape \u2014 a query may have relied on the old index`,table:a,scope:"table",type:"changedIndex"})}for(let t of Object.keys(e.indexes))r.indexes[t]===void 0&&s.push({severity:"breaking",summary:`removed index ${t} on ${a} \u2014 a query that used \`.withIndex("${t}")\` would break`,table:a,scope:"table",type:"removedIndex"})},"Y"),xt=m((a,e,r,s)=>{for(let t of Object.keys(r.relations))e.relations[t]===void 0&&s.push({scope:"schema",severity:"safe",summary:`added relation ${a}.${t}`,table:a,type:"addedRelation"});for(let t of Object.keys(e.relations))r.relations[t]===void 0&&s.push({scope:"schema",severity:"breaking",summary:`removed relation ${a}.${t}`,table:a,type:"removedRelation"})},"Z"),yt=m((a,e,r,s)=>{e.shardMode!==r.shardMode&&s.push({severity:"breaking",summary:`table ${a} changed shard mode: ${e.shardMode} \u2192 ${r.shardMode} \u2014 its physical storage moves; add a data migration / re-shard plan`,table:a,scope:"table",type:"changedShardMode"}),bt(a,e,r,s),vt(a,e,r,s),xt(a,e,r,s)},"ee"),kt=m((a,e)=>{let r=[],s=a?.tables??{};for(let[t,d]of Object.entries(e.tables)){let i=s[t];if(i===void 0){r.push({scope:"table",severity:"safe",summary:`added table ${t}`,table:t,type:"addedTable"});continue}yt(t,i,d,r)}for(let t of Object.keys(s))e.tables[t]===void 0&&r.push({scope:"table",severity:"breaking",summary:`removed table ${t} \u2014 add a data migration if its data must be archived/cleaned up`,table:t,type:"removedTable"});if(a!==void 0&&a.jurisdiction!==e.jurisdiction){let t=a.jurisdiction??"(none)",d=e.jurisdiction??"(none)";r.push({scope:"schema",severity:"breaking",summary:`Durable Object jurisdiction changed from ${t} to ${d} \u2014 this re-homes every DO and strands all existing shard, scheduler, and session-DO data in the old region (no in-place migration; export then import to move it). Revert the change, or override the gate to proceed intentionally.`,type:"changedJurisdiction"})}return{changes:r}},"te"),at=m(a=>Object.entries(a.fields).map(([e,r])=>({name:e,optional:r.optional,ref:Object.values(a.relations).find(s=>s.field===e&&s.kind==="one")?.table,type:r.kind})),"T"),rt=m((a,e)=>{let r={},s=a?.fields??{},t=e?.fields??{};for(let[d,i]of Object.entries(t)){let n=s[d];n===void 0?r[d]=a===void 0?"unchanged":"added":r[d]=n.kind===i.kind&&n.optional===i.optional?"unchanged":"changed"}for(let d of Object.keys(s))t[d]===void 0&&(r[d]="removed");return r},"F"),Nt=m((a,e)=>{let{changes:r}=kt(a,e),s=new Set(r.filter(i=>i.scope==="table"&&i.table!==void 0).map(i=>i.table)),t=[],d=m((i,n)=>i?"added":s.has(n)?"changed":"context","o");for(let[i,n]of Object.entries(e.tables)){let u=a?.tables[i],b=d(u===void 0,i);t.push({columns:at(n),fieldStatus:rt(u,n),name:i,shardMode:n.shardMode,status:b})}for(let[i,n]of Object.entries(a?.tables??{}))e.tables[i]===void 0&&t.push({columns:at(n),fieldStatus:rt(n,void 0),name:i,shardMode:n.shardMode,status:"removed"});return t.sort((i,n)=>i.name.localeCompare(n.name)),{breakingCount:r.filter(i=>i.severity==="breaking").length,changes:r,tables:t}},"ae"),st=m(a=>{let e=ht(a);return e.status==="ok"?e.snapshot:void 0},"K"),wt={added:"ring-2 ring-emerald-500/60",changed:"ring-2 ring-amber-500/70",context:"opacity-55",removed:"opacity-70 ring-2 ring-destructive/60"},$t=m(a=>a==="global"?"global":"shard","se"),jt=m(a=>{let e=(0,me.c)(24),{appliedAt:r,hash:s,onSelect:t,selected:d,seq:i}=a,n=d?"border-s-primary bg-accent/60 text-foreground":"border-s-transparent text-muted-foreground hover:bg-accent/30 hover:text-foreground",u;e[0]!==n?(u=ne("flex w-full flex-col items-start gap-1 border-s-2 px-4 py-3 text-start outline-none transition-colors",n),e[0]=n,e[1]=u):u=e[1];let b=`sh-version-${s}`,h;e[2]!==s||e[3]!==t?(h=m(()=>{t(s)},"m"),e[2]=s,e[3]=t,e[4]=h):h=e[4];let v;e[5]!==i?(v=(0,o.jsxs)("span",{className:"font-mono text-[13px] tabular-nums",children:["v",i]}),e[5]=i,e[6]=v):v=e[6];let p;e[7]!==s?(p=s.slice(0,7),e[7]=s,e[8]=p):p=e[8];let g;e[9]!==p?(g=(0,o.jsx)("span",{className:"ms-auto font-mono text-[10px] tracking-wider text-muted-foreground/70 uppercase",children:p}),e[9]=p,e[10]=g):g=e[10];let f;e[11]!==v||e[12]!==g?(f=(0,o.jsxs)("span",{className:"flex w-full items-baseline gap-2",children:[v,g]}),e[11]=v,e[12]=g,e[13]=f):f=e[13];let y;e[14]!==r?(y=Ne(r),e[14]=r,e[15]=y):y=e[15];let x;e[16]!==y?(x=(0,o.jsx)("span",{className:"font-mono text-[10px] tracking-wide text-muted-foreground/70",children:y}),e[16]=y,e[17]=x):x=e[17];let c;return e[18]!==x||e[19]!==u||e[20]!==b||e[21]!==h||e[22]!==f?(c=(0,o.jsx)("li",{children:(0,o.jsxs)("button",{className:u,"data-testid":b,onClick:h,type:"button",children:[f,x]})}),e[18]=x,e[19]=u,e[20]=b,e[21]=h,e[22]=f,e[23]=c):c=e[23],c},"ie"),St=m(a=>{let e=(0,me.c)(26),{breaking:r,count:s,first:t}=a,d=oe();if(t){let g;e[0]!==s?(g=(0,o.jsx)("span",{className:"text-3xl leading-none font-light tracking-tight tabular-nums",children:s}),e[0]=s,e[1]=g):g=e[1];let f;e[2]!==d?(f=d("tables"),e[2]=d,e[3]=f):f=e[3];let y;e[4]!==f?(y=(0,o.jsx)("span",{className:"font-mono text-[11px] tracking-widest text-muted-foreground uppercase",children:f}),e[4]=f,e[5]=y):y=e[5];let x;return e[6]!==g||e[7]!==y?(x=(0,o.jsxs)("div",{className:"flex items-baseline gap-3","data-testid":"sh-summary",children:[g,y]}),e[6]=g,e[7]=y,e[8]=x):x=e[8],x}let i=r>0&&"text-destructive",n;e[9]!==i?(n=ne("text-3xl leading-none font-light tracking-tight tabular-nums",i),e[9]=i,e[10]=n):n=e[10];let u;e[11]!==s||e[12]!==n?(u=(0,o.jsx)("span",{className:n,children:s}),e[11]=s,e[12]=n,e[13]=u):u=e[13];let b;e[14]!==s||e[15]!==d?(b=d(s===1?"change":"changes"),e[14]=s,e[15]=d,e[16]=b):b=e[16];let h;e[17]!==b?(h=(0,o.jsx)("span",{className:"font-mono text-[11px] tracking-widest text-muted-foreground uppercase",children:b}),e[17]=b,e[18]=h):h=e[18];let v;e[19]!==r||e[20]!==d?(v=r>0&&(0,o.jsxs)("span",{className:"font-mono text-[11px] tracking-widest text-destructive uppercase",children:["\xB7 ",d("{count} breaking",{count:r})]}),e[19]=r,e[20]=d,e[21]=v):v=e[21];let p;return e[22]!==u||e[23]!==h||e[24]!==v?(p=(0,o.jsxs)("div",{className:"flex items-baseline gap-3","data-testid":"sh-summary",children:[u,h,v]}),e[22]=u,e[23]=h,e[24]=v,e[25]=p):p=e[25],p},"re"),it={addedIndex:{action:"added",kind:"index"},addedOptionalField:{action:"added",kind:"field?"},addedRelation:{action:"added",kind:"relation"},addedRequiredField:{action:"added",kind:"field"},addedTable:{action:"added",kind:"table"},changedFieldKind:{action:"changed",kind:"field kind"},changedIndex:{action:"changed",kind:"index"},changedJurisdiction:{action:"changed",kind:"jurisdiction"},changedShardMode:{action:"changed",kind:"shard mode"},fieldOptionalToRequired:{action:"changed",kind:"field \u2192 required"},fieldRequiredToOptional:{action:"changed",kind:"field \u2192 optional"},removedField:{action:"removed",kind:"field"},removedIndex:{action:"removed",kind:"index"},removedRelation:{action:"removed",kind:"relation"},removedTable:{action:"removed",kind:"table"}},Ot=m((a,e)=>{let r=`${it[a.type].action} ${e} `;return a.summary.startsWith(r)?a.summary.slice(r.length):a.summary},"oe"),It=m(a=>{let e=new Map;for(let s of a){let t=s.table??"",d=e.get(t);d===void 0?e.set(t,[s]):d.push(s)}let r=[...e].map(([s,t])=>({changes:t,table:s}));return[...r.filter(s=>s.table!==""),...r.filter(s=>s.table==="")]},"de"),Mt=m(a=>{let e=(0,me.c)(2),{children:r}=a,s;return e[0]!==r?(s=(0,o.jsx)("div",{className:"px-4 pt-4 pb-2 font-mono text-[10px] tracking-widest text-muted-foreground/70 uppercase",children:r}),e[0]=r,e[1]=s):s=e[1],s},"le"),Rt=m(({pane:a,shardKey:e=""})=>{let r=oe(),s=Fe(),t=De({strict:!1}).version,d=m(c=>{ke(s({search:{version:c},to:"/migrations"}))},"o"),i=de(C.schemaHistory,{},{shardKey:e}),n=i.data?.versions??[],u=t!==void 0&&n.some(c=>c.hash===t)?t:n[0]?.hash,b=n.findIndex(c=>c.hash===u),h=b===-1?void 0:n[b+1]?.hash,v=de(C.schemaVersion,{hash:u??""},{enabled:u!==void 0,shardKey:e}),p=de(C.schemaVersion,{hash:h??""},{enabled:h!==void 0,shardKey:e}),g=(0,ce.useMemo)(()=>{let c=st(v.data?.version?.snapshotJson);if(c!==void 0)return Nt(st(p.data?.version?.snapshotJson),c)},[v.data,p.data]),f=(0,ce.useMemo)(()=>(g?.tables??[]).map(c=>({columns:c.columns,name:c.name,tier:$t(c.shardMode)})),[g]),y=(0,ce.useMemo)(()=>{let c={};for(let N of g?.tables??[])c[N.name]=wt[N.status];return c},[g]);if(i.error!==null)return(0,o.jsx)(we,{error:i.errorSource,testId:"sh-error"});if(n.length===0)return(0,o.jsx)(ye,{description:r("Each distinct schema shape this shard runs is recorded here, so you can see what changed and when."),testId:"sh-empty",title:r("No schema versions recorded yet.")});let x=g?.changes??[];return(0,o.jsxs)("div",{className:"flex min-h-0 flex-1 gap-4","data-testid":"lunora-schema-history",children:[(0,o.jsxs)("nav",{className:"flex w-56 shrink-0 flex-col overflow-hidden border-e border-border","data-testid":"sh-timeline-rail",children:[(0,o.jsx)(Mt,{children:r("Schema versions")}),(0,o.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-timeline",children:n.map(c=>(0,o.jsx)(jt,{appliedAt:c.appliedAt,hash:c.hash,onSelect:d,selected:c.hash===u,seq:c.seq},c.hash))})]}),(0,o.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4 pe-1 pt-4",children:[(0,o.jsx)(St,{breaking:g?.breakingCount??0,count:h===void 0?f.length:x.length,first:h===void 0}),a==="diagram"?(0,o.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,o.jsx)(Ze,{fill:!0,nodeClasses:y,tables:f,testIdPrefix:"sh"})}):(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-changes",children:It(x).map(c=>{let N=(g?.tables??[]).find(k=>k.name===c.table);return(0,o.jsxs)("section",{className:"mb-6",children:[(0,o.jsxs)("div",{className:"flex items-baseline gap-3 border-b border-border/60 pb-1.5",children:[(0,o.jsx)("span",{className:"font-mono text-[13px] text-foreground",children:c.table===""?r("schema"):c.table}),N!==void 0&&(0,o.jsx)("span",{className:"font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums uppercase",children:r("{count} columns",{count:N.columns.length})}),c.changes.length>1&&(0,o.jsx)("span",{className:"ms-auto font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums",children:c.changes.length})]}),(0,o.jsx)("ul",{children:c.changes.map(k=>{let{action:K,kind:M}=it[k.type],S=k.severity==="breaking",R=Ot(k,M);return(0,o.jsxs)("li",{className:"flex items-baseline gap-4 border-s-2 py-1.5 ps-3 transition-colors hover:bg-accent/30",children:[(0,o.jsx)("span",{"aria-hidden":"true",className:ne("-ms-3 h-3 w-0.5 shrink-0 self-center",S?"bg-destructive":"bg-transparent")}),(0,o.jsxs)("span",{className:"w-44 shrink-0 font-mono text-[10px] tracking-widest text-muted-foreground/70 uppercase",children:[r(K)," ",M]}),R!==c.table&&(0,o.jsx)("span",{className:ne("min-w-0 font-mono text-[13px]",S?"text-destructive":"text-foreground"),children:R}),S&&(0,o.jsx)("span",{className:"ms-auto shrink-0 font-mono text-[10px] tracking-widest text-destructive uppercase",children:r("breaking")})]},`${k.type}-${k.summary}`)})})]},c.table)})})]})]})},"ce"),qt=m(a=>ne("-mb-px border-b-2 px-3 py-2.5 font-mono text-[11px] tracking-wider uppercase transition-colors outline-none","hover:bg-accent/40 focus-visible:bg-accent/40",a?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"me"),da=m(a=>{let e=(0,me.c)(11),{initialShardKey:r}=a,s=oe(),[t,d]=(0,ce.useState)("diagram"),i;e[0]!==t?(i=m((v,p,g,f)=>(0,o.jsxs)("button",{"aria-selected":t===v,className:qt(t===v),"data-testid":g,onClick:m(()=>{d(v)},"onClick"),role:"tab",type:"button",children:[p,f!==void 0&&(0,o.jsx)("span",{className:"ms-2 tabular-nums text-muted-foreground/70",children:f})]}),"i"),e[0]=t,e[1]=i):i=e[1];let n=i,u;e[2]!==s||e[3]!==n?(u=(0,o.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-3","data-testid":"mg-panes",role:"tablist",children:[n("diagram",s("Diagram"),"mg-pane-diagram"),n("changes",s("Changes"),"mg-pane-changes"),n("data",s("Data migrations"),"mg-pane-data")]}),e[2]=s,e[3]=n,e[4]=u):u=e[4];let b;e[5]!==r||e[6]!==t?(b=(0,o.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:t==="data"?(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4",children:(0,o.jsx)(tt,{initialShardKey:r})}):(0,o.jsx)(Rt,{pane:t,shardKey:r})}),e[5]=r,e[6]=t,e[7]=b):b=e[7];let h;return e[8]!==u||e[9]!==b?(h=(0,o.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col pt-4","data-testid":"lunora-migrations-route",children:[u,b]}),e[8]=u,e[9]=b,e[10]=h):h=e[10],h},"je");export{da as default};
|
|
1
|
+
import{a as Ze}from"./chunk-BLHSTFG3.js";import"./chunk-GMR677FL.js";import"./chunk-4KIQ5RLS.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as Me}from"./chunk-5Y3QLNWX.js";import{a as Ye}from"./chunk-IGCNMZSB.js";import"./chunk-I6A5C46N.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import"./chunk-4UOFSGUS.js";import{a as Xe}from"./chunk-AREBQI6D.js";import{a as ze}from"./chunk-3CWGJYBB.js";import{a as We}from"./chunk-RMN2JN4S.js";import{b as Ve}from"./chunk-GRL5MG3Z.js";import{d as De,e as Fe}from"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import{R as Ae}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as Ee}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as _e}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as we}from"./chunk-KBBOZRRX.js";import"./chunk-XXQUMVWH.js";import"./chunk-DSU54IAT.js";import"./chunk-QLQADHFE.js";import{a as C}from"./chunk-VDW32UET.js";import{c as de}from"./chunk-HRRFUAP6.js";import{f as Te}from"./chunk-6FQJRXVI.js";import"./chunk-XBDKZZ67.js";import{a as ye}from"./chunk-XQCVZAGU.js";import{a as Ge,b as He,c as Qe,d as Ie,e as O,f as I}from"./chunk-WJQLNYGX.js";import{a as Le,e as Je}from"./chunk-WQH3LT2P.js";import{d as oe,f as Ue,g as Pe,h as Be,o as ke,r as Ne}from"./chunk-IUYFXK4X.js";import"./chunk-P33WK7YI.js";import{a as m,e as ie,f as qe,g as Ce,h as Ke,j as ne}from"./chunk-3XIESWL4.js";var me=ie(Ce(),1),ce=ie(qe(),1);var et=ie(Ce(),1);var j=ie(qe(),1);var l=ie(Ke(),1);var ct=Ue(C.runMigration),tt=m(a=>{let e=(0,et.c)(98),{initialShardKey:r}=a,s=Te(),t=oe(),{queryShardKey:d,setShardKey:i,shardKey:n}=ze(r),[u,b]=(0,j.useState)(""),[h,v]=(0,j.useState)("up"),[p,g]=(0,j.useState)(!0),[f,y]=(0,j.useState)(!1),[x,c]=(0,j.useState)(null),[N,k]=(0,j.useState)(null),K;e[0]!==n?(K=n.trim(),e[0]=n,e[1]=K):K=e[1];let M=K===d,S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S={},e[2]=S):S=e[2];let R;e[3]!==d?(R={live:!0,shardKey:d},e[3]=d,e[4]=R):R=e[4];let w=de(C.migrationStatus,S,R),$=w.data?.migrations??null,$e=w.error,{errorSource:je,liveError:Se}=w,ue,he;e[5]!==d||e[6]!==w.data?(ue=m(()=>{w.data!==void 0&&Ve(d)},"Q"),he=[w.data,d],e[5]=d,e[6]=w.data,e[7]=ue,e[8]=he):(ue=e[7],he=e[8]),(0,j.useEffect)(ue,he);let pe;if(e[9]!==s||e[10]!==h||e[11]!==p||e[12]!==u||e[13]!==n||e[14]!==w||e[15]!==t){let q=m(async()=>{let Re=u.trim();if(Re===""){k(t("Enter a migration id")),c(null);return}y(!0),k(null);try{let Oe=await s.query(ct,{direction:h,dryRun:p,id:Re},Pe(n));c(Oe),w.refetch()}catch(Oe){let lt=Oe;c(null),k(Be(lt))}y(!1)},"m");pe=m(()=>{ke(q())},"X"),e[9]=s,e[10]=h,e[11]=p,e[12]=u,e[13]=n,e[14]=w,e[15]=t,e[16]=pe}else pe=e[16];let fe=pe,ge;e[17]===Symbol.for("react.memo_cache_sentinel")?(ge=m(q=>{b(q.target.value)},"Z"),e[17]=ge):ge=e[17];let nt=ge,be;e[18]===Symbol.for("react.memo_cache_sentinel")?(be=m(q=>{v(q.target.value==="down"?"down":"up")},"H"),e[18]=be):be=e[18];let ot=be,ve;e[19]===Symbol.for("react.memo_cache_sentinel")?(ve=m(q=>{g(q.target.checked)},"ee"),e[19]=ve):ve=e[19];let dt=ve,T;e[20]!==i||e[21]!==n?(T=(0,l.jsx)(We,{onChange:i,testId:"mg-shard-input",value:n}),e[20]=i,e[21]=n,e[22]=T):T=e[22];let D;e[23]!==Se?(D=(0,l.jsx)(Ye,{message:Se,prefix:"mg"}),e[23]=Se,e[24]=D):D=e[24];let F;e[25]!==T||e[26]!==D?(F=(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[T,D]}),e[25]=T,e[26]=D,e[27]=F):F=e[27];let _;e[28]!==$e||e[29]!==je?(_=$e!==null&&(0,l.jsx)(we,{error:je,testId:"mg-status-error"}),e[28]=$e,e[29]=je,e[30]=_):_=e[30];let A;e[31]!==$||e[32]!==t?(A=$!==null&&$.length===0&&(0,l.jsx)(ye,{description:t("Data migrations you run against this shard will be tracked here."),icon:(0,l.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,l.jsx)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"})}),testId:"mg-empty",title:t("No migrations have run on this shard.")}),e[31]=$,e[32]=t,e[33]=A):A=e[33];let E;e[34]!==$||e[35]!==t?(E=$!==null&&$.length>0&&(0,l.jsx)(Le,{className:"overflow-hidden py-0",children:(0,l.jsx)(Je,{className:"px-0",children:(0,l.jsxs)(Ge,{"data-testid":"mg-table",children:[(0,l.jsx)(He,{children:(0,l.jsxs)(Ie,{children:[(0,l.jsx)(O,{children:t("id")}),(0,l.jsx)(O,{children:t("direction")}),(0,l.jsx)(O,{children:t("status")}),(0,l.jsx)(O,{children:t("processed")}),(0,l.jsx)(O,{children:t("changed")}),(0,l.jsx)(O,{children:t("updated")}),(0,l.jsx)(O,{children:t("error")})]})}),(0,l.jsx)(Qe,{children:$.map(mt)})]})})}),e[34]=$,e[35]=t,e[36]=E):E=e[36];let L;e[37]!==t?(L=t("Run migration"),e[37]=t,e[38]=L):L=e[38];let J;e[39]!==L?(J=(0,l.jsx)(Me,{children:L}),e[39]=L,e[40]=J):J=e[40];let U;e[41]!==t?(U=t("Migration id"),e[41]=t,e[42]=U):U=e[42];let P;e[43]!==t?(P=t("migration id"),e[43]=t,e[44]=P):P=e[44];let B;e[45]!==u||e[46]!==U||e[47]!==P?(B=(0,l.jsx)(Ae,{"aria-label":U,className:"w-auto","data-testid":"mg-id-input",onChange:nt,placeholder:P,value:u}),e[45]=u,e[46]=U,e[47]=P,e[48]=B):B=e[48];let V;e[49]!==t?(V=t("Direction"),e[49]=t,e[50]=V):V=e[50];let W;e[51]!==t?(W=t("up"),e[51]=t,e[52]=W):W=e[52];let z;e[53]!==W?(z=(0,l.jsx)("option",{value:"up",children:W}),e[53]=W,e[54]=z):z=e[54];let G;e[55]!==t?(G=t("down"),e[55]=t,e[56]=G):G=e[56];let H;e[57]!==G?(H=(0,l.jsx)("option",{value:"down",children:G}),e[57]=G,e[58]=H):H=e[58];let Q;e[59]!==h||e[60]!==V||e[61]!==z||e[62]!==H?(Q=(0,l.jsxs)("select",{"aria-label":V,className:"flex h-8 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 dark:bg-input/30","data-testid":"mg-direction",onChange:ot,value:h,children:[z,H]}),e[59]=h,e[60]=V,e[61]=z,e[62]=H,e[63]=Q):Q=e[63];let X;e[64]!==p?(X=(0,l.jsx)("input",{checked:p,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:dt,type:"checkbox"}),e[64]=p,e[65]=X):X=e[65];let Y;e[66]!==t?(Y=t("Dry run"),e[66]=t,e[67]=Y):Y=e[67];let Z;e[68]!==X||e[69]!==Y?(Z=(0,l.jsxs)(Me,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[X,Y]}),e[68]=X,e[69]=Y,e[70]=Z):Z=e[70];let ee;e[71]!==p||e[72]!==fe||e[73]!==f||e[74]!==M||e[75]!==t?(ee=p?(0,l.jsx)(Ee,{"data-testid":"mg-run",disabled:f||!M,onClick:fe,type:"button",children:t(f?"Running\u2026":"Run")}):(0,l.jsx)(Xe,{confirmLabel:t(f?"Running\u2026":"Run migration?"),disabled:f||!M,onConfirm:fe,testId:"mg-run",children:t("Run")}),e[71]=p,e[72]=fe,e[73]=f,e[74]=M,e[75]=t,e[76]=ee):ee=e[76];let te;e[77]!==B||e[78]!==Q||e[79]!==Z||e[80]!==ee?(te=(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[B,Q,Z,ee]}),e[77]=B,e[78]=Q,e[79]=Z,e[80]=ee,e[81]=te):te=e[81];let ae;e[82]!==J||e[83]!==te?(ae=(0,l.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[J,te]}),e[82]=J,e[83]=te,e[84]=ae):ae=e[84];let re;e[85]!==N?(re=N!==null&&(0,l.jsx)("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:N}),e[85]=N,e[86]=re):re=e[86];let se;e[87]!==x||e[88]!==t?(se=x!==null&&(0,l.jsxs)("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[x.dryRun?t("Dry run: "):"",t("{status} \u2014 processed",{status:x.status}),x.processed,t(", changed"),x.changed]}),e[87]=x,e[88]=t,e[89]=se):se=e[89];let xe;return e[90]!==F||e[91]!==_||e[92]!==A||e[93]!==E||e[94]!==ae||e[95]!==re||e[96]!==se?(xe=(0,l.jsxs)("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[F,_,A,E,ae,re,se]}),e[90]=F,e[91]=_,e[92]=A,e[93]=E,e[94]=ae,e[95]=re,e[96]=se,e[97]=xe):xe=e[97],xe},"yr");function mt(a){return(0,l.jsxs)(Ie,{"data-testid":`mg-row-${a.id}`,children:[(0,l.jsx)(I,{children:a.id}),(0,l.jsx)(I,{children:a.direction}),(0,l.jsx)(I,{children:(0,l.jsx)(_e,{variant:"secondary",children:a.status})}),(0,l.jsx)(I,{children:a.processed}),(0,l.jsx)(I,{children:a.changed}),(0,l.jsx)(I,{children:Ne(a.updatedAt)}),(0,l.jsx)(I,{children:a.error??""})]},a.id)}m(mt,"Ve");var o=ie(Ke(),1);var le=m(a=>typeof a=="object"&&a!==null,"k"),ut=m(a=>le(a)&&le(a.fields)&&le(a.indexes)&&le(a.relations)&&typeof a.shardMode=="string","z"),ht=m(a=>{if(a===void 0||a.trim()==="")return{status:"absent"};let e;try{e=JSON.parse(a)}catch(r){return{error:`baseline is not valid JSON: ${r instanceof Error?r.message:String(r)}`,status:"invalid"}}if(!le(e)||e.version!==1||!le(e.tables))return{error:`baseline is malformed or written by an incompatible version (expected version ${String(1)})`,status:"invalid"};for(let[r,s]of Object.entries(e.tables))if(!ut(s))return{error:`baseline table "${r}" has an invalid structure`,status:"invalid"};return{snapshot:{jurisdiction:typeof e.jurisdiction=="string"?e.jurisdiction:void 0,migrationIds:Array.isArray(e.migrationIds)?e.migrationIds:[],tables:e.tables,version:1},status:"ok"}},"B"),pt=m((a,e)=>a.unique===e.unique&&a.fields.length===e.fields.length&&a.fields.every((r,s)=>r===e.fields[s]),"L"),ft=m((a,e,r,s)=>{let t=[];return r.kind!==s.kind&&t.push({severity:"breaking",summary:`field ${a}.${e} changed type: ${r.kind} \u2192 ${s.kind} \u2014 add a data migration to convert existing values`,table:a,scope:"table",type:"changedFieldKind"}),r.optional&&!s.optional?t.push({severity:"breaking",summary:`field ${a}.${e} became required \u2014 rows missing it would be invalid; add a data migration to backfill it`,table:a,scope:"table",type:"fieldOptionalToRequired"}):!r.optional&&s.optional&&t.push({scope:"table",severity:"safe",summary:`field ${a}.${e} became optional`,table:a,type:"fieldRequiredToOptional"}),t},"Q"),gt=m((a,e,r)=>r.optional?{scope:"table",severity:"safe",summary:`added optional field ${a}.${e}`,table:a,type:"addedOptionalField"}:{severity:"breaking",summary:`added required field ${a}.${e} \u2014 existing rows have no value; add a data migration to backfill it`,table:a,scope:"table",type:"addedRequiredField"},"G"),bt=m((a,e,r,s)=>{for(let[t,d]of Object.entries(r.fields)){let i=e.fields[t];i===void 0?s.push(gt(a,t,d)):s.push(...ft(a,t,i,d))}for(let t of Object.keys(e.fields))r.fields[t]===void 0&&s.push({severity:"breaking",summary:`removed field ${a}.${t} \u2014 add a data migration if stored data must be cleaned up`,table:a,scope:"table",type:"removedField"})},"X"),vt=m((a,e,r,s)=>{for(let[t,d]of Object.entries(r.indexes)){let i=e.indexes[t];if(i===void 0){s.push({scope:"table",severity:"safe",summary:`added index ${t} on ${a}`,table:a,type:"addedIndex"});continue}pt(i,d)||s.push({severity:"breaking",summary:`index ${t} on ${a} changed shape \u2014 a query may have relied on the old index`,table:a,scope:"table",type:"changedIndex"})}for(let t of Object.keys(e.indexes))r.indexes[t]===void 0&&s.push({severity:"breaking",summary:`removed index ${t} on ${a} \u2014 a query that used \`.withIndex("${t}")\` would break`,table:a,scope:"table",type:"removedIndex"})},"Y"),xt=m((a,e,r,s)=>{for(let t of Object.keys(r.relations))e.relations[t]===void 0&&s.push({scope:"schema",severity:"safe",summary:`added relation ${a}.${t}`,table:a,type:"addedRelation"});for(let t of Object.keys(e.relations))r.relations[t]===void 0&&s.push({scope:"schema",severity:"breaking",summary:`removed relation ${a}.${t}`,table:a,type:"removedRelation"})},"Z"),yt=m((a,e,r,s)=>{e.shardMode!==r.shardMode&&s.push({severity:"breaking",summary:`table ${a} changed shard mode: ${e.shardMode} \u2192 ${r.shardMode} \u2014 its physical storage moves; add a data migration / re-shard plan`,table:a,scope:"table",type:"changedShardMode"}),bt(a,e,r,s),vt(a,e,r,s),xt(a,e,r,s)},"ee"),kt=m((a,e)=>{let r=[],s=a?.tables??{};for(let[t,d]of Object.entries(e.tables)){let i=s[t];if(i===void 0){r.push({scope:"table",severity:"safe",summary:`added table ${t}`,table:t,type:"addedTable"});continue}yt(t,i,d,r)}for(let t of Object.keys(s))e.tables[t]===void 0&&r.push({scope:"table",severity:"breaking",summary:`removed table ${t} \u2014 add a data migration if its data must be archived/cleaned up`,table:t,type:"removedTable"});if(a!==void 0&&a.jurisdiction!==e.jurisdiction){let t=a.jurisdiction??"(none)",d=e.jurisdiction??"(none)";r.push({scope:"schema",severity:"breaking",summary:`Durable Object jurisdiction changed from ${t} to ${d} \u2014 this re-homes every DO and strands all existing shard, scheduler, and session-DO data in the old region (no in-place migration; export then import to move it). Revert the change, or override the gate to proceed intentionally.`,type:"changedJurisdiction"})}return{changes:r}},"te"),at=m(a=>Object.entries(a.fields).map(([e,r])=>({name:e,optional:r.optional,ref:Object.values(a.relations).find(s=>s.field===e&&s.kind==="one")?.table,type:r.kind})),"T"),rt=m((a,e)=>{let r={},s=a?.fields??{},t=e?.fields??{};for(let[d,i]of Object.entries(t)){let n=s[d];n===void 0?r[d]=a===void 0?"unchanged":"added":r[d]=n.kind===i.kind&&n.optional===i.optional?"unchanged":"changed"}for(let d of Object.keys(s))t[d]===void 0&&(r[d]="removed");return r},"F"),Nt=m((a,e)=>{let{changes:r}=kt(a,e),s=new Set(r.filter(i=>i.scope==="table"&&i.table!==void 0).map(i=>i.table)),t=[],d=m((i,n)=>i?"added":s.has(n)?"changed":"context","o");for(let[i,n]of Object.entries(e.tables)){let u=a?.tables[i],b=d(u===void 0,i);t.push({columns:at(n),fieldStatus:rt(u,n),name:i,shardMode:n.shardMode,status:b})}for(let[i,n]of Object.entries(a?.tables??{}))e.tables[i]===void 0&&t.push({columns:at(n),fieldStatus:rt(n,void 0),name:i,shardMode:n.shardMode,status:"removed"});return t.sort((i,n)=>i.name.localeCompare(n.name)),{breakingCount:r.filter(i=>i.severity==="breaking").length,changes:r,tables:t}},"ae"),st=m(a=>{let e=ht(a);return e.status==="ok"?e.snapshot:void 0},"K"),wt={added:"ring-2 ring-emerald-500/60",changed:"ring-2 ring-amber-500/70",context:"opacity-55",removed:"opacity-70 ring-2 ring-destructive/60"},$t=m(a=>a==="global"?"global":"shard","se"),jt=m(a=>{let e=(0,me.c)(24),{appliedAt:r,hash:s,onSelect:t,selected:d,seq:i}=a,n=d?"border-s-primary bg-accent/60 text-foreground":"border-s-transparent text-muted-foreground hover:bg-accent/30 hover:text-foreground",u;e[0]!==n?(u=ne("flex w-full flex-col items-start gap-1 border-s-2 px-4 py-3 text-start outline-none transition-colors",n),e[0]=n,e[1]=u):u=e[1];let b=`sh-version-${s}`,h;e[2]!==s||e[3]!==t?(h=m(()=>{t(s)},"m"),e[2]=s,e[3]=t,e[4]=h):h=e[4];let v;e[5]!==i?(v=(0,o.jsxs)("span",{className:"font-mono text-[13px] tabular-nums",children:["v",i]}),e[5]=i,e[6]=v):v=e[6];let p;e[7]!==s?(p=s.slice(0,7),e[7]=s,e[8]=p):p=e[8];let g;e[9]!==p?(g=(0,o.jsx)("span",{className:"ms-auto font-mono text-[10px] tracking-wider text-muted-foreground/70 uppercase",children:p}),e[9]=p,e[10]=g):g=e[10];let f;e[11]!==v||e[12]!==g?(f=(0,o.jsxs)("span",{className:"flex w-full items-baseline gap-2",children:[v,g]}),e[11]=v,e[12]=g,e[13]=f):f=e[13];let y;e[14]!==r?(y=Ne(r),e[14]=r,e[15]=y):y=e[15];let x;e[16]!==y?(x=(0,o.jsx)("span",{className:"font-mono text-[10px] tracking-wide text-muted-foreground/70",children:y}),e[16]=y,e[17]=x):x=e[17];let c;return e[18]!==x||e[19]!==u||e[20]!==b||e[21]!==h||e[22]!==f?(c=(0,o.jsx)("li",{children:(0,o.jsxs)("button",{className:u,"data-testid":b,onClick:h,type:"button",children:[f,x]})}),e[18]=x,e[19]=u,e[20]=b,e[21]=h,e[22]=f,e[23]=c):c=e[23],c},"ie"),St=m(a=>{let e=(0,me.c)(26),{breaking:r,count:s,first:t}=a,d=oe();if(t){let g;e[0]!==s?(g=(0,o.jsx)("span",{className:"text-3xl leading-none font-light tracking-tight tabular-nums",children:s}),e[0]=s,e[1]=g):g=e[1];let f;e[2]!==d?(f=d("tables"),e[2]=d,e[3]=f):f=e[3];let y;e[4]!==f?(y=(0,o.jsx)("span",{className:"font-mono text-[11px] tracking-widest text-muted-foreground uppercase",children:f}),e[4]=f,e[5]=y):y=e[5];let x;return e[6]!==g||e[7]!==y?(x=(0,o.jsxs)("div",{className:"flex items-baseline gap-3","data-testid":"sh-summary",children:[g,y]}),e[6]=g,e[7]=y,e[8]=x):x=e[8],x}let i=r>0&&"text-destructive",n;e[9]!==i?(n=ne("text-3xl leading-none font-light tracking-tight tabular-nums",i),e[9]=i,e[10]=n):n=e[10];let u;e[11]!==s||e[12]!==n?(u=(0,o.jsx)("span",{className:n,children:s}),e[11]=s,e[12]=n,e[13]=u):u=e[13];let b;e[14]!==s||e[15]!==d?(b=d(s===1?"change":"changes"),e[14]=s,e[15]=d,e[16]=b):b=e[16];let h;e[17]!==b?(h=(0,o.jsx)("span",{className:"font-mono text-[11px] tracking-widest text-muted-foreground uppercase",children:b}),e[17]=b,e[18]=h):h=e[18];let v;e[19]!==r||e[20]!==d?(v=r>0&&(0,o.jsxs)("span",{className:"font-mono text-[11px] tracking-widest text-destructive uppercase",children:["\xB7 ",d("{count} breaking",{count:r})]}),e[19]=r,e[20]=d,e[21]=v):v=e[21];let p;return e[22]!==u||e[23]!==h||e[24]!==v?(p=(0,o.jsxs)("div",{className:"flex items-baseline gap-3","data-testid":"sh-summary",children:[u,h,v]}),e[22]=u,e[23]=h,e[24]=v,e[25]=p):p=e[25],p},"re"),it={addedIndex:{action:"added",kind:"index"},addedOptionalField:{action:"added",kind:"field?"},addedRelation:{action:"added",kind:"relation"},addedRequiredField:{action:"added",kind:"field"},addedTable:{action:"added",kind:"table"},changedFieldKind:{action:"changed",kind:"field kind"},changedIndex:{action:"changed",kind:"index"},changedJurisdiction:{action:"changed",kind:"jurisdiction"},changedShardMode:{action:"changed",kind:"shard mode"},fieldOptionalToRequired:{action:"changed",kind:"field \u2192 required"},fieldRequiredToOptional:{action:"changed",kind:"field \u2192 optional"},removedField:{action:"removed",kind:"field"},removedIndex:{action:"removed",kind:"index"},removedRelation:{action:"removed",kind:"relation"},removedTable:{action:"removed",kind:"table"}},Ot=m((a,e)=>{let r=`${it[a.type].action} ${e} `;return a.summary.startsWith(r)?a.summary.slice(r.length):a.summary},"oe"),It=m(a=>{let e=new Map;for(let s of a){let t=s.table??"",d=e.get(t);d===void 0?e.set(t,[s]):d.push(s)}let r=[...e].map(([s,t])=>({changes:t,table:s}));return[...r.filter(s=>s.table!==""),...r.filter(s=>s.table==="")]},"de"),Mt=m(a=>{let e=(0,me.c)(2),{children:r}=a,s;return e[0]!==r?(s=(0,o.jsx)("div",{className:"px-4 pt-4 pb-2 font-mono text-[10px] tracking-widest text-muted-foreground/70 uppercase",children:r}),e[0]=r,e[1]=s):s=e[1],s},"le"),Rt=m(({pane:a,shardKey:e=""})=>{let r=oe(),s=Fe(),t=De({strict:!1}).version,d=m(c=>{ke(s({search:{version:c},to:"/migrations"}))},"o"),i=de(C.schemaHistory,{},{shardKey:e}),n=i.data?.versions??[],u=t!==void 0&&n.some(c=>c.hash===t)?t:n[0]?.hash,b=n.findIndex(c=>c.hash===u),h=b===-1?void 0:n[b+1]?.hash,v=de(C.schemaVersion,{hash:u??""},{enabled:u!==void 0,shardKey:e}),p=de(C.schemaVersion,{hash:h??""},{enabled:h!==void 0,shardKey:e}),g=(0,ce.useMemo)(()=>{let c=st(v.data?.version?.snapshotJson);if(c!==void 0)return Nt(st(p.data?.version?.snapshotJson),c)},[v.data,p.data]),f=(0,ce.useMemo)(()=>(g?.tables??[]).map(c=>({columns:c.columns,name:c.name,tier:$t(c.shardMode)})),[g]),y=(0,ce.useMemo)(()=>{let c={};for(let N of g?.tables??[])c[N.name]=wt[N.status];return c},[g]);if(i.error!==null)return(0,o.jsx)(we,{error:i.errorSource,testId:"sh-error"});if(n.length===0)return(0,o.jsx)(ye,{description:r("Each distinct schema shape this shard runs is recorded here, so you can see what changed and when."),testId:"sh-empty",title:r("No schema versions recorded yet.")});let x=g?.changes??[];return(0,o.jsxs)("div",{className:"flex min-h-0 flex-1 gap-4","data-testid":"lunora-schema-history",children:[(0,o.jsxs)("nav",{className:"flex w-56 shrink-0 flex-col overflow-hidden border-e border-border","data-testid":"sh-timeline-rail",children:[(0,o.jsx)(Mt,{children:r("Schema versions")}),(0,o.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-timeline",children:n.map(c=>(0,o.jsx)(jt,{appliedAt:c.appliedAt,hash:c.hash,onSelect:d,selected:c.hash===u,seq:c.seq},c.hash))})]}),(0,o.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4 pe-1 pt-4",children:[(0,o.jsx)(St,{breaking:g?.breakingCount??0,count:h===void 0?f.length:x.length,first:h===void 0}),a==="diagram"?(0,o.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,o.jsx)(Ze,{fill:!0,nodeClasses:y,tables:f,testIdPrefix:"sh"})}):(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-changes",children:It(x).map(c=>{let N=(g?.tables??[]).find(k=>k.name===c.table);return(0,o.jsxs)("section",{className:"mb-6",children:[(0,o.jsxs)("div",{className:"flex items-baseline gap-3 border-b border-border/60 pb-1.5",children:[(0,o.jsx)("span",{className:"font-mono text-[13px] text-foreground",children:c.table===""?r("schema"):c.table}),N!==void 0&&(0,o.jsx)("span",{className:"font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums uppercase",children:r("{count} columns",{count:N.columns.length})}),c.changes.length>1&&(0,o.jsx)("span",{className:"ms-auto font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums",children:c.changes.length})]}),(0,o.jsx)("ul",{children:c.changes.map(k=>{let{action:K,kind:M}=it[k.type],S=k.severity==="breaking",R=Ot(k,M);return(0,o.jsxs)("li",{className:"flex items-baseline gap-4 border-s-2 py-1.5 ps-3 transition-colors hover:bg-accent/30",children:[(0,o.jsx)("span",{"aria-hidden":"true",className:ne("-ms-3 h-3 w-0.5 shrink-0 self-center",S?"bg-destructive":"bg-transparent")}),(0,o.jsxs)("span",{className:"w-44 shrink-0 font-mono text-[10px] tracking-widest text-muted-foreground/70 uppercase",children:[r(K)," ",M]}),R!==c.table&&(0,o.jsx)("span",{className:ne("min-w-0 font-mono text-[13px]",S?"text-destructive":"text-foreground"),children:R}),S&&(0,o.jsx)("span",{className:"ms-auto shrink-0 font-mono text-[10px] tracking-widest text-destructive uppercase",children:r("breaking")})]},`${k.type}-${k.summary}`)})})]},c.table)})})]})]})},"ce"),qt=m(a=>ne("-mb-px border-b-2 px-3 py-2.5 font-mono text-[11px] tracking-wider uppercase transition-colors outline-none","hover:bg-accent/40 focus-visible:bg-accent/40",a?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"me"),da=m(a=>{let e=(0,me.c)(11),{initialShardKey:r}=a,s=oe(),[t,d]=(0,ce.useState)("diagram"),i;e[0]!==t?(i=m((v,p,g,f)=>(0,o.jsxs)("button",{"aria-selected":t===v,className:qt(t===v),"data-testid":g,onClick:m(()=>{d(v)},"onClick"),role:"tab",type:"button",children:[p,f!==void 0&&(0,o.jsx)("span",{className:"ms-2 tabular-nums text-muted-foreground/70",children:f})]}),"i"),e[0]=t,e[1]=i):i=e[1];let n=i,u;e[2]!==s||e[3]!==n?(u=(0,o.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-3","data-testid":"mg-panes",role:"tablist",children:[n("diagram",s("Diagram"),"mg-pane-diagram"),n("changes",s("Changes"),"mg-pane-changes"),n("data",s("Data migrations"),"mg-pane-data")]}),e[2]=s,e[3]=n,e[4]=u):u=e[4];let b;e[5]!==r||e[6]!==t?(b=(0,o.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:t==="data"?(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4",children:(0,o.jsx)(tt,{initialShardKey:r})}):(0,o.jsx)(Rt,{pane:t,shardKey:r})}),e[5]=r,e[6]=t,e[7]=b):b=e[7];let h;return e[8]!==u||e[9]!==b?(h=(0,o.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col pt-4","data-testid":"lunora-migrations-route",children:[u,b]}),e[8]=u,e[9]=b,e[10]=h):h=e[10],h},"je");export{da as default};
|