@lunora/studio 1.0.0-alpha.142 → 1.0.0-alpha.144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/index.d.mts +15 -4
  2. package/dist/index.d.ts +15 -4
  3. package/dist/index.mjs +1 -1
  4. package/dist/mount.d.mts +2 -1
  5. package/dist/mount.d.ts +2 -1
  6. package/dist/mount.mjs +1 -1
  7. package/dist/packem_chunks/HealthPanel.mjs +1 -1
  8. package/dist/packem_chunks/MetricsPanel.mjs +1 -1
  9. package/dist/packem_chunks/analytics-panel.mjs +1 -1
  10. package/dist/packem_chunks/issues-panel.mjs +1 -1
  11. package/dist/packem_chunks/kv-browser.mjs +1 -1
  12. package/dist/packem_chunks/migrations-route.mjs +1 -1
  13. package/dist/packem_chunks/schedule-panel.mjs +1 -1
  14. package/dist/packem_shared/{ScheduledJobs-oDVEymk5.mjs → ScheduledJobs-Db0HZ8R9.mjs} +1 -1
  15. package/dist/packem_shared/{Studio-5eRSjGmd.mjs → Studio-UxOpDgEl.mjs} +1 -1
  16. package/dist/packem_shared/StudioApp-BdisV3FN.mjs +1 -0
  17. package/dist/packem_shared/aggregateMetrics-CY05xrYU.mjs +1 -0
  18. package/dist/packem_shared/{app.d-D1bPR8FO.d.mts → app.d-DFjg4Uki.d.mts} +33 -1
  19. package/dist/packem_shared/{app.d-D1bPR8FO.d.ts → app.d-DFjg4Uki.d.ts} +33 -1
  20. package/dist/packem_shared/{select-Cx8-CokP.mjs → select-DPyS18Vy.mjs} +1 -1
  21. package/dist/packem_shared/{studio-4odoxrh9.mjs → studio-DE8N0tIQ.mjs} +1 -1
  22. package/dist/standalone/{chunk-7GHBT32T.js → chunk-24XD27OU.js} +1 -1
  23. package/dist/standalone/chunk-2BN33A2H.js +1 -0
  24. package/dist/standalone/{chunk-3MNTCYQ3.js → chunk-2OLPNCFW.js} +1 -1
  25. package/dist/standalone/{chunk-GCYNOU4C.js → chunk-2V436GDL.js} +1 -1
  26. package/dist/standalone/{chunk-DRFQ3BUM.js → chunk-2WVC52MX.js} +1 -1
  27. package/dist/standalone/{chunk-YRNEKBFM.js → chunk-4RPBRBOA.js} +1 -1
  28. package/dist/standalone/{chunk-BP7MDQY5.js → chunk-5NCE6W7L.js} +1 -1
  29. package/dist/standalone/{chunk-F2R2UX27.js → chunk-6DHQ3IIO.js} +1 -1
  30. package/dist/standalone/{chunk-6H36JL4I.js → chunk-6HKQM3CN.js} +1 -1
  31. package/dist/standalone/{chunk-SPP7FEDA.js → chunk-6VDI4D53.js} +1 -1
  32. package/dist/standalone/{chunk-BDZFZT2N.js → chunk-7MXYEEMC.js} +1 -1
  33. package/dist/standalone/{chunk-BYWVVRKM.js → chunk-ADDPGZY7.js} +1 -1
  34. package/dist/standalone/chunk-BAKGFOG4.js +1 -0
  35. package/dist/standalone/{chunk-S4HBMTJ3.js → chunk-BGAQFHQC.js} +1 -1
  36. package/dist/standalone/{chunk-ATO3Y6BD.js → chunk-BOEMUL7H.js} +1 -1
  37. package/dist/standalone/{chunk-37VWQZEF.js → chunk-DMAQKIMP.js} +2 -2
  38. package/dist/standalone/{chunk-IMUTQDOB.js → chunk-DNNLYDKX.js} +1 -1
  39. package/dist/standalone/{chunk-NZMUY7ZG.js → chunk-DZVEJZ3C.js} +1 -1
  40. package/dist/standalone/{chunk-7DNDONOI.js → chunk-E3AFG6TS.js} +1 -1
  41. package/dist/standalone/{chunk-PCOD3V5E.js → chunk-ESVQSHW2.js} +1 -1
  42. package/dist/standalone/{chunk-BMAP2J7X.js → chunk-FOILW5QP.js} +1 -1
  43. package/dist/standalone/{chunk-NPHUYLGW.js → chunk-FSOA4SEY.js} +1 -1
  44. package/dist/standalone/{chunk-HCO5STOE.js → chunk-H2GRI4BS.js} +1 -1
  45. package/dist/standalone/{chunk-I27WXF7C.js → chunk-HD7R6NQT.js} +1 -1
  46. package/dist/standalone/{chunk-L6KA7M4B.js → chunk-IP6LZ2OL.js} +1 -1
  47. package/dist/standalone/{chunk-PNFIPQJO.js → chunk-IYS3RM7B.js} +1 -1
  48. package/dist/standalone/{chunk-BNGOZSCT.js → chunk-JWORA33E.js} +1 -1
  49. package/dist/standalone/chunk-KASQ7MFV.js +1 -0
  50. package/dist/standalone/{chunk-PV2LCZ6D.js → chunk-KDELXUQD.js} +1 -1
  51. package/dist/standalone/{chunk-B5FXTB7H.js → chunk-LSRUM2JJ.js} +1 -1
  52. package/dist/standalone/{chunk-XSLMHPP2.js → chunk-MFMUFECI.js} +1 -1
  53. package/dist/standalone/{chunk-7ZWZNTKG.js → chunk-MFXZDB7X.js} +1 -1
  54. package/dist/standalone/{chunk-WZYKLEU5.js → chunk-MMSQ35RC.js} +1 -1
  55. package/dist/standalone/{chunk-LPFRXMG7.js → chunk-MZXZ2XVQ.js} +1 -1
  56. package/dist/standalone/{chunk-KBSJO66O.js → chunk-N6Q4ORVH.js} +1 -1
  57. package/dist/standalone/{chunk-HS7MSYK7.js → chunk-NK7VUSL2.js} +1 -1
  58. package/dist/standalone/{chunk-QEN7S6YK.js → chunk-OJN5A2JI.js} +1 -1
  59. package/dist/standalone/{chunk-HJOKETMZ.js → chunk-OT4I4LMO.js} +1 -1
  60. package/dist/standalone/{chunk-BAIGKYAI.js → chunk-P3MCKI2S.js} +1 -1
  61. package/dist/standalone/chunk-PPNBTM7O.js +11 -0
  62. package/dist/standalone/{chunk-4TKQNBNV.js → chunk-Q2Q4UUXS.js} +1 -1
  63. package/dist/standalone/{chunk-XUKH3NTP.js → chunk-S6K7T563.js} +1 -1
  64. package/dist/standalone/chunk-S73X6JFA.js +1 -0
  65. package/dist/standalone/{chunk-WHWI6KXH.js → chunk-SNHEWTJY.js} +1 -1
  66. package/dist/standalone/{chunk-X43AA6RX.js → chunk-SOUQNAE7.js} +1 -1
  67. package/dist/standalone/chunk-SUDJTC4S.js +1 -0
  68. package/dist/standalone/{chunk-W7E5WYFI.js → chunk-TFNVT4ZJ.js} +1 -1
  69. package/dist/standalone/{chunk-T2IE5GKA.js → chunk-UODFNQOY.js} +4 -4
  70. package/dist/standalone/{chunk-JXELPXLG.js → chunk-URVSYGSQ.js} +1 -1
  71. package/dist/standalone/{chunk-O32757IN.js → chunk-V4EMZ3HJ.js} +1 -1
  72. package/dist/standalone/{chunk-PKCC4J5W.js → chunk-V7665E6Y.js} +1 -1
  73. package/dist/standalone/{chunk-WIFKQ25E.js → chunk-VAMUCQ75.js} +1 -1
  74. package/dist/standalone/{chunk-YKUEP7AA.js → chunk-VGGVQFKU.js} +1 -1
  75. package/dist/standalone/{chunk-ZNPR3SGG.js → chunk-VNK6MRM6.js} +1 -1
  76. package/dist/standalone/{chunk-HZX6KSC2.js → chunk-WISI2EBQ.js} +1 -1
  77. package/dist/standalone/{chunk-QM3SGSVK.js → chunk-WQWZR452.js} +1 -1
  78. package/dist/standalone/{chunk-AR46S3PP.js → chunk-X6GR3SDI.js} +1 -1
  79. package/dist/standalone/{chunk-A4MLWW6Q.js → chunk-XDLUQ6RQ.js} +1 -1
  80. package/dist/standalone/{chunk-IXLH5YBD.js → chunk-XTMBNA4V.js} +1 -1
  81. package/dist/standalone/{chunk-IXMHWLSN.js → chunk-Y3YXQ6EU.js} +1 -1
  82. package/dist/standalone/{chunk-V5ITAZCZ.js → chunk-YBWZUB6A.js} +1 -1
  83. package/dist/standalone/{chunk-IGBQ2CPW.js → chunk-YW3RHFAI.js} +1 -1
  84. package/dist/standalone/{chunk-LELCKAUP.js → chunk-ZQ2PIQE4.js} +1 -1
  85. package/dist/standalone/studio.js +7 -7
  86. package/package.json +6 -6
  87. package/dist/packem_shared/StudioApp-Bkym2DjT.mjs +0 -1
  88. package/dist/packem_shared/aggregateMetrics-A-Y7OH6R.mjs +0 -1
  89. package/dist/standalone/chunk-2O5QDSR2.js +0 -1
  90. package/dist/standalone/chunk-45T7VWRY.js +0 -1
  91. package/dist/standalone/chunk-AZOLR4BN.js +0 -1
  92. package/dist/standalone/chunk-CKZQXAZE.js +0 -1
  93. package/dist/standalone/chunk-TQCXJX4I.js +0 -1
  94. package/dist/standalone/chunk-XDT5DXOI.js +0 -11
  95. /package/dist/standalone/{chunk-YEBHHIAY.js → chunk-U5JDESCI.js} +0 -0
@@ -0,0 +1 @@
1
+ import{a as rt}from"./chunk-SOUQNAE7.js";import"./chunk-CSUROWL2.js";import"./chunk-TJRQUJFS.js";import"./chunk-TWTNWOJU.js";import"./chunk-WQYWA7U6.js";import{a as Re}from"./chunk-IMOHEGMV.js";import{a as it}from"./chunk-7QRRR3K6.js";import"./chunk-7RIRJD2P.js";import"./chunk-C3TOZ4LG.js";import"./chunk-D27D4UUI.js";import"./chunk-SB35BJ7A.js";import"./chunk-FO26ZU7E.js";import"./chunk-5JDWLCSH.js";import{a as at}from"./chunk-I5OKDKON.js";import{a as Ye}from"./chunk-S3CRZLGS.js";import{a as Xe}from"./chunk-IFLTA2OD.js";import{b as Ge}from"./chunk-OGUKYRFM.js";import{d as Ae,e as Je}from"./chunk-JVUZEYKQ.js";import"./chunk-OKG3HWSJ.js";import{P as Pe}from"./chunk-46ZJ3TM4.js";import"./chunk-Y6CXU7T4.js";import"./chunk-4L4WTGN5.js";import{a as Ue}from"./chunk-EBWXFG4H.js";import"./chunk-TGHH7ZFA.js";import"./chunk-5GFSKIB2.js";import{b as Be}from"./chunk-NCCAMFB6.js";import"./chunk-25NFR6EB.js";import{a as Se}from"./chunk-TFNVT4ZJ.js";import"./chunk-ULIQFBZU.js";import"./chunk-SNHEWTJY.js";import"./chunk-35DM4JJG.js";import{a as R}from"./chunk-4ZEL6BYL.js";import{c as le}from"./chunk-IP6LZ2OL.js";import{f as Ee}from"./chunk-PPNBTM7O.js";import"./chunk-FSRSK4LY.js";import"./chunk-UODFNQOY.js";import{a as we}from"./chunk-FKVZRPV5.js";import{a as Ze,b as et,c as tt,d as Me,e as C,f as q}from"./chunk-HEAQVSNS.js";import{a as We,e as ze}from"./chunk-WUWBZPUK.js";import{d as de,f as He,g as Qe,h as Ve,o as $e,r as Ne}from"./chunk-Y4Q25F6X.js";import{a as o,d as oe,e as De,f as Le,g as _e,i as se}from"./chunk-YKXDMIHQ.js";var he=oe(Le(),1),me=oe(De(),1);var nt=oe(Le(),1);var S=oe(De(),1);var l=oe(_e(),1);var vt=He(R.runMigration),ot=o(t=>{let e=(0,nt.c)(98),{initialShardKey:r}=t,i=Ee(),a=de(),{queryShardKey:c,setShardKey:n,shardKey:s}=Ye(r),[u,b]=(0,S.useState)(""),[h,v]=(0,S.useState)("up"),[p,g]=(0,S.useState)(!0),[f,y]=(0,S.useState)(!1),[x,m]=(0,S.useState)(null),[w,k]=(0,S.useState)(null),K;e[0]!==s?(K=s.trim(),e[0]=s,e[1]=K):K=e[1];let I=K===c,O;e[2]===Symbol.for("react.memo_cache_sentinel")?(O={},e[2]=O):O=e[2];let F;e[3]!==c?(F={live:!0,shardKey:c},e[3]=c,e[4]=F):F=e[4];let $=le(R.migrationStatus,O,F),N=$.data?.migrations??null,Ce=$.error,{errorSource:qe,liveError:Ie}=$,pe,fe;e[5]!==c||e[6]!==$.data?(pe=o(()=>{$.data!==void 0&&Ge(c)},"W"),fe=[$.data,c],e[5]=c,e[6]=$.data,e[7]=pe,e[8]=fe):(pe=e[7],fe=e[8]),(0,S.useEffect)(pe,fe);let ge;if(e[9]!==i||e[10]!==h||e[11]!==p||e[12]!==u||e[13]!==s||e[14]!==$||e[15]!==a){let M=o(async()=>{let Te=u.trim();if(Te===""){k(a("Enter a migration id")),m(null);return}y(!0),k(null);try{let Fe=await i.query(vt,{direction:h,dryRun:p,id:Te},Qe(s));m(Fe),$.refetch()}catch(Fe){let bt=Fe;m(null),k(Ve(bt))}y(!1)},"m");ge=o(()=>{$e(M())},"V"),e[9]=i,e[10]=h,e[11]=p,e[12]=u,e[13]=s,e[14]=$,e[15]=a,e[16]=ge}else ge=e[16];let be=ge,ve;e[17]===Symbol.for("react.memo_cache_sentinel")?(ve=o(M=>{b(M.target.value)},"Y"),e[17]=ve):ve=e[17];let pt=ve,xe;e[18]===Symbol.for("react.memo_cache_sentinel")?(xe=o(M=>{v(M.target.value==="down"?"down":"up")},"Z"),e[18]=xe):xe=e[18];let ft=xe,ye;e[19]===Symbol.for("react.memo_cache_sentinel")?(ye=o(M=>{g(M.target.checked)},"ee"),e[19]=ye):ye=e[19];let gt=ye,T;e[20]!==n||e[21]!==s?(T=(0,l.jsx)(Xe,{onChange:n,testId:"mg-shard-input",value:s}),e[20]=n,e[21]=s,e[22]=T):T=e[22];let D;e[23]!==Ie?(D=(0,l.jsx)(it,{message:Ie,prefix:"mg"}),e[23]=Ie,e[24]=D):D=e[24];let L;e[25]!==T||e[26]!==D?(L=(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[T,D]}),e[25]=T,e[26]=D,e[27]=L):L=e[27];let _;e[28]!==Ce||e[29]!==qe?(_=Ce!==null&&(0,l.jsx)(Se,{error:qe,testId:"mg-status-error"}),e[28]=Ce,e[29]=qe,e[30]=_):_=e[30];let E;e[31]!==N||e[32]!==a?(E=N!==null&&N.length===0&&(0,l.jsx)(we,{description:a("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:a("No migrations have run on this shard.")}),e[31]=N,e[32]=a,e[33]=E):E=e[33];let A;e[34]!==N||e[35]!==a?(A=N!==null&&N.length>0&&(0,l.jsx)(We,{className:"overflow-hidden py-0",children:(0,l.jsx)(ze,{className:"px-0",children:(0,l.jsxs)(Ze,{"data-testid":"mg-table",children:[(0,l.jsx)(et,{children:(0,l.jsxs)(Me,{children:[(0,l.jsx)(C,{children:a("id")}),(0,l.jsx)(C,{children:a("direction")}),(0,l.jsx)(C,{children:a("status")}),(0,l.jsx)(C,{children:a("processed")}),(0,l.jsx)(C,{children:a("changed")}),(0,l.jsx)(C,{children:a("updated")}),(0,l.jsx)(C,{children:a("error")})]})}),(0,l.jsx)(tt,{children:N.map(xt)})]})})}),e[34]=N,e[35]=a,e[36]=A):A=e[36];let J;e[37]!==a?(J=a("Run migration"),e[37]=a,e[38]=J):J=e[38];let B;e[39]!==J?(B=(0,l.jsx)(Re,{children:J}),e[39]=J,e[40]=B):B=e[40];let P;e[41]!==a?(P=a("Migration id"),e[41]=a,e[42]=P):P=e[42];let U;e[43]!==a?(U=a("migration id"),e[43]=a,e[44]=U):U=e[44];let W;e[45]!==u||e[46]!==P||e[47]!==U?(W=(0,l.jsx)(Pe,{"aria-label":P,className:"w-auto","data-testid":"mg-id-input",onChange:pt,placeholder:U,value:u}),e[45]=u,e[46]=P,e[47]=U,e[48]=W):W=e[48];let z;e[49]!==a?(z=a("Direction"),e[49]=a,e[50]=z):z=e[50];let H;e[51]!==a?(H=a("up"),e[51]=a,e[52]=H):H=e[52];let Q;e[53]!==H?(Q=(0,l.jsx)("option",{value:"up",children:H}),e[53]=H,e[54]=Q):Q=e[54];let V;e[55]!==a?(V=a("down"),e[55]=a,e[56]=V):V=e[56];let G;e[57]!==V?(G=(0,l.jsx)("option",{value:"down",children:V}),e[57]=V,e[58]=G):G=e[58];let X;e[59]!==h||e[60]!==z||e[61]!==Q||e[62]!==G?(X=(0,l.jsxs)("select",{"aria-label":z,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:ft,value:h,children:[Q,G]}),e[59]=h,e[60]=z,e[61]=Q,e[62]=G,e[63]=X):X=e[63];let Y;e[64]!==p?(Y=(0,l.jsx)("input",{checked:p,className:"size-4 accent-primary","data-testid":"mg-dry-run",id:"mg-dry-run",onChange:gt,type:"checkbox"}),e[64]=p,e[65]=Y):Y=e[65];let Z;e[66]!==a?(Z=a("Dry run"),e[66]=a,e[67]=Z):Z=e[67];let ee;e[68]!==Y||e[69]!==Z?(ee=(0,l.jsxs)(Re,{className:"flex items-center gap-1.5",htmlFor:"mg-dry-run",children:[Y,Z]}),e[68]=Y,e[69]=Z,e[70]=ee):ee=e[70];let te;e[71]!==p||e[72]!==be||e[73]!==f||e[74]!==I||e[75]!==a?(te=p?(0,l.jsx)(Ue,{"data-testid":"mg-run",disabled:f||!I,onClick:be,type:"button",children:a(f?"Running\u2026":"Run")}):(0,l.jsx)(at,{confirmLabel:a(f?"Running\u2026":"Run migration?"),disabled:f||!I,onConfirm:be,testId:"mg-run",children:a("Run")}),e[71]=p,e[72]=be,e[73]=f,e[74]=I,e[75]=a,e[76]=te):te=e[76];let ae;e[77]!==W||e[78]!==X||e[79]!==ee||e[80]!==te?(ae=(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[W,X,ee,te]}),e[77]=W,e[78]=X,e[79]=ee,e[80]=te,e[81]=ae):ae=e[81];let ie;e[82]!==B||e[83]!==ae?(ie=(0,l.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-3 shadow-xs",children:[B,ae]}),e[82]=B,e[83]=ae,e[84]=ie):ie=e[84];let re;e[85]!==w?(re=w!==null&&(0,l.jsx)("pre",{className:"text-sm text-destructive whitespace-pre-wrap","data-testid":"mg-run-error",role:"alert",children:w}),e[85]=w,e[86]=re):re=e[86];let ne;e[87]!==x||e[88]!==a?(ne=x!==null&&(0,l.jsxs)("p",{className:"text-sm text-muted-foreground","data-testid":"mg-run-result",children:[x.dryRun?a("Dry run: "):"",a("{status} \u2014 processed",{status:x.status}),x.processed,a(", changed"),x.changed]}),e[87]=x,e[88]=a,e[89]=ne):ne=e[89];let ke;return e[90]!==L||e[91]!==_||e[92]!==E||e[93]!==A||e[94]!==ie||e[95]!==re||e[96]!==ne?(ke=(0,l.jsxs)("div",{className:"flex flex-col gap-3 pt-4","data-testid":"lunora-migrations",children:[L,_,E,A,ie,re,ne]}),e[90]=L,e[91]=_,e[92]=E,e[93]=A,e[94]=ie,e[95]=re,e[96]=ne,e[97]=ke):ke=e[97],ke},"yt");function xt(t){return(0,l.jsxs)(Me,{"data-testid":`mg-row-${t.id}`,children:[(0,l.jsx)(q,{children:t.id}),(0,l.jsx)(q,{children:t.direction}),(0,l.jsx)(q,{children:(0,l.jsx)(Be,{variant:"secondary",children:t.status})}),(0,l.jsx)(q,{children:t.processed}),(0,l.jsx)(q,{children:t.changed}),(0,l.jsx)(q,{children:Ne(t.updatedAt)}),(0,l.jsx)(q,{children:t.error??""})]},t.id)}o(xt,"Je");var d=oe(_e(),1);var Ke=1;function yt(t){let e={},r=Object.keys(t);r.sort();for(let i of r)e[i]=t[i];return e}o(yt,"te");var ce=o(t=>typeof t=="object"&&t!==null,"w"),kt=o(t=>ce(t)&&ce(t.fields)&&ce(t.indexes)&&ce(t.relations)&&typeof t.shardMode=="string","ne"),wt=o(t=>{if(t===void 0||t.trim()==="")return{status:"absent"};let e;try{e=JSON.parse(t)}catch(r){return{error:`baseline is not valid JSON: ${r instanceof Error?r.message:String(r)}`,status:"invalid"}}if(!ce(e)||e.version!==Ke||!ce(e.tables))return{error:`baseline is malformed or written by an incompatible version (expected version ${String(Ke)})`,status:"invalid"};for(let[r,i]of Object.entries(e.tables))if(!kt(i))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:Ke},status:"ok"}},"se"),$t=o((t,e)=>t.unique===e.unique&&t.fields.length===e.fields.length&&t.fields.every((r,i)=>r===e.fields[i]),"ie"),st=o(t=>t.unique!==void 0,"J"),Oe=o(({nullable:t,optional:e,refined:r,unique:i,...a})=>JSON.stringify(yt(a)),"C"),dt=o(t=>t.kind==="union"&&t.members?t.members.map(e=>Oe(e)):[Oe(t)],"P"),Nt=o((t,e)=>{if(e.kind!=="union")return!1;let r=new Set(dt(e));return dt(t).every(i=>r.has(i))},"ae"),j=o(t=>{switch(t.kind){case"array":return`array(${t.of?j(t.of):"?"})`;case"id":return`id(${t.ref??"?"})`;case"literal":return`literal(${t.literal??"?"})`;case"object":return`object({ ${Object.keys(t.fields??{}).join(", ")} })`;case"record":return`record(${t.key?j(t.key):"?"}, ${t.of?j(t.of):"?"})`;case"union":return(t.members??[]).map(e=>j(e)).join(" | ");default:return t.kind}},"y"),ue=o((t,e,r)=>({remediation:"backfill",scope:"table",severity:"breaking",summary:r,table:t,type:e}),"j"),je=o((t,e,r)=>({remediation:"none",scope:"table",severity:"safe",summary:r,table:t,type:e}),"F"),St=o((t,e,r,i,a)=>{if(!(r.kind===i.kind&&(!a||Oe(r)===Oe(i))))return a&&Nt(r,i)?je(t,"widenedFieldShape",`field ${t}.${e} widened: ${j(r)} \u2192 ${j(i)} \u2014 every stored value stays valid`):r.kind!==i.kind?ue(t,"changedFieldKind",`field ${t}.${e} changed type: ${r.kind} \u2192 ${i.kind} \u2014 add a data migration to convert existing values`):ue(t,"changedFieldShape",`field ${t}.${e} changed shape: ${j(r)} \u2192 ${j(i)} \u2014 stored values were written against the old shape; add a data migration to convert them`)},"oe"),jt=o((t,e,r,i)=>{let a=[];return r.unique!==i.unique&&a.push(i.unique===!0?ue(t,"addedFieldConstraint",`field ${t}.${e} became unique \u2014 existing duplicates would violate it; add a data migration to de-duplicate first`):je(t,"relaxedFieldConstraint",`field ${t}.${e} is no longer unique`)),r.nullable!==i.nullable&&a.push(i.nullable===!0?je(t,"relaxedFieldConstraint",`field ${t}.${e} became nullable`):ue(t,"addedFieldConstraint",`field ${t}.${e} is no longer nullable \u2014 rows holding NULL would be invalid; add a data migration to backfill them`)),r.refined!==i.refined&&a.push(i.refined===!0?ue(t,"addedFieldConstraint",`field ${t}.${e} gained a validation refinement \u2014 stored values were never checked against it; add a data migration if any could fail`):je(t,"relaxedFieldConstraint",`field ${t}.${e} dropped its validation refinement`)),a},"re"),ut=o((t,e,r,i)=>{let a=[],c=st(r)&&st(i),n=St(t,e,r,i,c);return n&&a.push(n),c&&a.push(...jt(t,e,r,i)),r.optional&&!i.optional?a.push({remediation:"backfill",severity:"breaking",summary:`field ${t}.${e} became required \u2014 rows missing it would be invalid; add a data migration to backfill it`,table:t,scope:"table",type:"fieldOptionalToRequired"}):!r.optional&&i.optional&&a.push({remediation:"none",scope:"table",severity:"safe",summary:`field ${t}.${e} became optional`,table:t,type:"fieldRequiredToOptional"}),a},"L"),Ot=o((t,e,r)=>r.optional?{remediation:"none",scope:"table",severity:"safe",summary:`added optional field ${t}.${e}`,table:t,type:"addedOptionalField"}:{remediation:"backfill",severity:"breaking",summary:`added required field ${t}.${e} \u2014 existing rows have no value; add a data migration to backfill it`,table:t,scope:"table",type:"addedRequiredField"},"de"),Ct=o((t,e,r,i)=>{for(let[a,c]of Object.entries(r.fields)){let n=e.fields[a];n===void 0?i.push(Ot(t,a,c)):i.push(...ut(t,a,n,c))}for(let a of Object.keys(e.fields))r.fields[a]===void 0&&i.push({remediation:"backfill",severity:"breaking",summary:`removed field ${t}.${a} \u2014 add a data migration if stored data must be cleaned up`,table:t,scope:"table",type:"removedField"})},"le"),qt=o((t,e,r,i)=>{for(let[a,c]of Object.entries(r.indexes)){let n=e.indexes[a];if(n===void 0){i.push({remediation:"none",scope:"table",severity:"safe",summary:`added index ${a} on ${t}`,table:t,type:"addedIndex"});continue}$t(n,c)||i.push({remediation:"code",severity:"breaking",summary:`index ${a} on ${t} changed shape \u2014 a query may have relied on the old index`,table:t,scope:"table",type:"changedIndex"})}for(let a of Object.keys(e.indexes))r.indexes[a]===void 0&&i.push({remediation:"code",severity:"breaking",summary:`removed index ${a} on ${t} \u2014 a query that used \`.withIndex("${a}")\` would break`,table:t,scope:"table",type:"removedIndex"})},"ce"),It=o((t,e,r,i)=>{for(let a of Object.keys(r.relations))e.relations[a]===void 0&&i.push({remediation:"none",scope:"schema",severity:"safe",summary:`added relation ${t}.${a}`,table:t,type:"addedRelation"});for(let a of Object.keys(e.relations))r.relations[a]===void 0&&i.push({remediation:"code",scope:"schema",severity:"breaking",summary:`removed relation ${t}.${a}`,table:t,type:"removedRelation"})},"ue"),Ft=o((t,e,r,i)=>{e.shardMode!==r.shardMode&&i.push({remediation:"rehome",severity:"breaking",summary:`table ${t} changed shard mode: ${e.shardMode} \u2192 ${r.shardMode} \u2014 its physical storage moves, and existing rows do NOT follow the schema; re-home them with an export/import round trip (https://lunora.sh/docs/concepts/sharding#migrating-a-populated-table)`,table:t,scope:"table",type:"changedShardMode"}),Ct(t,e,r,i),qt(t,e,r,i),It(t,e,r,i)},"me"),Mt=o((t,e)=>{let r=[],i=t?.tables??{};for(let[a,c]of Object.entries(e.tables)){let n=i[a];if(n===void 0){r.push({remediation:"none",scope:"table",severity:"safe",summary:`added table ${a}`,table:a,type:"addedTable"});continue}Ft(a,n,c,r)}for(let a of Object.keys(i))e.tables[a]===void 0&&r.push({remediation:"rehome",scope:"table",severity:"breaking",summary:`removed table ${a} \u2014 its rows stay in each shard's SQLite, unreachable through the schema; export the shard first if the data must be kept`,table:a,type:"removedTable"});if(t!==void 0&&t.jurisdiction!==e.jurisdiction){let a=t.jurisdiction??"(none)",c=e.jurisdiction??"(none)";r.push({remediation:"rehome",scope:"schema",severity:"breaking",summary:`Durable Object jurisdiction changed from ${a} to ${c} \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}},"he"),lt=o(t=>Object.entries(t.fields).map(([e,r])=>({name:e,optional:r.optional,ref:Object.values(t.relations).find(i=>i.field===e&&i.kind==="one")?.table,type:j(r)})),"H"),ct=o((t,e,r)=>{let i={},a=e?.fields??{},c=r?.fields??{};for(let[n,s]of Object.entries(c)){let u=a[n];u===void 0?i[n]=e===void 0?"unchanged":"added":i[n]=ut(t,n,u,s).length===0?"unchanged":"changed"}for(let n of Object.keys(a))c[n]===void 0&&(i[n]="removed");return i},"V"),Rt=o((t,e)=>{let{changes:r}=Mt(t,e),i=new Set(r.filter(n=>n.scope==="table"&&n.table!==void 0).map(n=>n.table)),a=[],c=o((n,s)=>n?"added":i.has(s)?"changed":"context","o");for(let[n,s]of Object.entries(e.tables)){let u=t?.tables[n],b=c(u===void 0,n);a.push({columns:lt(s),fieldStatus:ct(n,u,s),name:n,shardMode:s.shardMode,status:b})}for(let[n,s]of Object.entries(t?.tables??{}))e.tables[n]===void 0&&a.push({columns:lt(s),fieldStatus:ct(n,s,void 0),name:n,shardMode:s.shardMode,status:"removed"});return a.sort((n,s)=>n.name.localeCompare(s.name)),{breakingCount:r.filter(n=>n.severity==="breaking").length,changes:r,tables:a}},"fe"),mt=o(t=>{let e=wt(t);return e.status==="ok"?e.snapshot:void 0},"Q"),Kt={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"},Tt=o(t=>t==="global"?"global":"shard","ge"),Dt=o(t=>{let e=(0,he.c)(24),{appliedAt:r,hash:i,onSelect:a,selected:c,seq:n}=t,s=c?"border-s-primary bg-accent/60 text-foreground":"border-s-transparent text-muted-foreground hover:bg-accent/30 hover:text-foreground",u;e[0]!==s?(u=se("flex w-full flex-col items-start gap-1 border-s-2 px-4 py-3 text-start outline-none transition-colors",s),e[0]=s,e[1]=u):u=e[1];let b=`sh-version-${i}`,h;e[2]!==i||e[3]!==a?(h=o(()=>{a(i)},"f"),e[2]=i,e[3]=a,e[4]=h):h=e[4];let v;e[5]!==n?(v=(0,d.jsxs)("span",{className:"font-mono text-[13px] tabular-nums",children:["v",n]}),e[5]=n,e[6]=v):v=e[6];let p;e[7]!==i?(p=i.slice(0,7),e[7]=i,e[8]=p):p=e[8];let g;e[9]!==p?(g=(0,d.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,d.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,d.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 m;return e[18]!==x||e[19]!==u||e[20]!==b||e[21]!==h||e[22]!==f?(m=(0,d.jsx)("li",{children:(0,d.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]=m):m=e[23],m},"be"),Lt=o(t=>{let e=(0,he.c)(26),{breaking:r,count:i,first:a}=t,c=de();if(a){let g;e[0]!==i?(g=(0,d.jsx)("span",{className:"text-3xl leading-none font-light tracking-tight tabular-nums",children:i}),e[0]=i,e[1]=g):g=e[1];let f;e[2]!==c?(f=c("tables"),e[2]=c,e[3]=f):f=e[3];let y;e[4]!==f?(y=(0,d.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,d.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 n=r>0&&"text-destructive",s;e[9]!==n?(s=se("text-3xl leading-none font-light tracking-tight tabular-nums",n),e[9]=n,e[10]=s):s=e[10];let u;e[11]!==i||e[12]!==s?(u=(0,d.jsx)("span",{className:s,children:i}),e[11]=i,e[12]=s,e[13]=u):u=e[13];let b;e[14]!==i||e[15]!==c?(b=c(i===1?"change":"changes"),e[14]=i,e[15]=c,e[16]=b):b=e[16];let h;e[17]!==b?(h=(0,d.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]!==c?(v=r>0&&(0,d.jsxs)("span",{className:"font-mono text-[11px] tracking-widest text-destructive uppercase",children:["\xB7 ",c("{count} breaking",{count:r})]}),e[19]=r,e[20]=c,e[21]=v):v=e[21];let p;return e[22]!==u||e[23]!==h||e[24]!==v?(p=(0,d.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},"ve"),ht={addedFieldConstraint:{action:"added",kind:"constraint"},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"},changedFieldShape:{action:"changed",kind:"field shape"},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"},relaxedFieldConstraint:{action:"removed",kind:"constraint"},removedField:{action:"removed",kind:"field"},removedIndex:{action:"removed",kind:"index"},removedRelation:{action:"removed",kind:"relation"},removedTable:{action:"removed",kind:"table"},widenedFieldShape:{action:"changed",kind:"field \u2192 wider"}},_t=o((t,e)=>{let r=`${ht[t.type].action} ${e} `;return t.summary.startsWith(r)?t.summary.slice(r.length):t.summary},"xe"),Et=o(t=>{let e=new Map;for(let i of t){let a=i.table??"",c=e.get(a);c===void 0?e.set(a,[i]):c.push(i)}let r=[...e].map(([i,a])=>({changes:a,table:i}));return[...r.filter(i=>i.table!==""),...r.filter(i=>i.table==="")]},"ye"),At=o(t=>{let e=(0,he.c)(2),{children:r}=t,i;return e[0]!==r?(i=(0,d.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]=i):i=e[1],i},"ke"),Jt=o(({pane:t,shardKey:e=""})=>{let r=de(),i=Je(),a=Ae({strict:!1}).version,c=o(m=>{$e(i({search:{version:m},to:"/migrations"}))},"a"),n=le(R.schemaHistory,{},{shardKey:e}),s=n.data?.versions??[],u=a!==void 0&&s.some(m=>m.hash===a)?a:s[0]?.hash,b=s.findIndex(m=>m.hash===u),h=b===-1?void 0:s[b+1]?.hash,v=le(R.schemaVersion,{hash:u??""},{enabled:u!==void 0,shardKey:e}),p=le(R.schemaVersion,{hash:h??""},{enabled:h!==void 0,shardKey:e}),g=(0,me.useMemo)(()=>{let m=mt(v.data?.version?.snapshotJson);if(m!==void 0)return Rt(mt(p.data?.version?.snapshotJson),m)},[v.data,p.data]),f=(0,me.useMemo)(()=>(g?.tables??[]).map(m=>({columns:m.columns,name:m.name,tier:Tt(m.shardMode)})),[g]),y=(0,me.useMemo)(()=>{let m={};for(let w of g?.tables??[])m[w.name]=Kt[w.status];return m},[g]);if(n.error!==null)return(0,d.jsx)(Se,{error:n.errorSource,testId:"sh-error"});if(s.length===0)return(0,d.jsx)(we,{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,d.jsxs)("div",{className:"flex min-h-0 flex-1 gap-4","data-testid":"lunora-schema-history",children:[(0,d.jsxs)("nav",{className:"flex w-56 shrink-0 flex-col overflow-hidden border-e border-border","data-testid":"sh-timeline-rail",children:[(0,d.jsx)(At,{children:r("Schema versions")}),(0,d.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-timeline",children:s.map(m=>(0,d.jsx)(Dt,{appliedAt:m.appliedAt,hash:m.hash,onSelect:c,selected:m.hash===u,seq:m.seq},m.hash))})]}),(0,d.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-4 pe-1 pt-4",children:[(0,d.jsx)(Lt,{breaking:g?.breakingCount??0,count:h===void 0?f.length:x.length,first:h===void 0}),t==="diagram"?(0,d.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,d.jsx)(rt,{fill:!0,nodeClasses:y,tables:f,testIdPrefix:"sh"})}):(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"sh-changes",children:Et(x).map(m=>{let w=(g?.tables??[]).find(k=>k.name===m.table);return(0,d.jsxs)("section",{className:"mb-6",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-3 border-b border-border/60 pb-1.5",children:[(0,d.jsx)("span",{className:"font-mono text-[13px] text-foreground",children:m.table===""?r("schema"):m.table}),w!==void 0&&(0,d.jsx)("span",{className:"font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums uppercase",children:r("{count} columns",{count:w.columns.length})}),m.changes.length>1&&(0,d.jsx)("span",{className:"ms-auto font-mono text-[10px] tracking-widest text-muted-foreground/70 tabular-nums",children:m.changes.length})]}),(0,d.jsx)("ul",{children:m.changes.map(k=>{let{action:K,kind:I}=ht[k.type],O=k.severity==="breaking",F=_t(k,I);return(0,d.jsxs)("li",{className:"flex items-baseline gap-4 border-s-2 py-1.5 ps-3 transition-colors hover:bg-accent/30",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:se("-ms-3 h-3 w-0.5 shrink-0 self-center",O?"bg-destructive":"bg-transparent")}),(0,d.jsxs)("span",{className:"w-44 shrink-0 font-mono text-[10px] tracking-widest text-muted-foreground/70 uppercase",children:[r(K)," ",I]}),F!==m.table&&(0,d.jsx)("span",{className:se("min-w-0 font-mono text-[13px]",O?"text-destructive":"text-foreground"),children:F}),O&&(0,d.jsx)("span",{className:"ms-auto shrink-0 font-mono text-[10px] tracking-widest text-destructive uppercase",children:r("breaking")})]},`${k.type}-${k.summary}`)})})]},m.table)})})]})]})},"$e"),Bt=o(t=>se("-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",t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"we"),xa=o(t=>{let e=(0,he.c)(11),{initialShardKey:r}=t,i=de(),[a,c]=(0,me.useState)("diagram"),n;e[0]!==a?(n=o((v,p,g,f)=>(0,d.jsxs)("button",{"aria-selected":a===v,className:Bt(a===v),"data-testid":g,onClick:o(()=>{c(v)},"onClick"),role:"tab",type:"button",children:[p,f!==void 0&&(0,d.jsx)("span",{className:"ms-2 tabular-nums text-muted-foreground/70",children:f})]}),"a"),e[0]=a,e[1]=n):n=e[1];let s=n,u;e[2]!==i||e[3]!==s?(u=(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-1 border-b border-border px-3","data-testid":"mg-panes",role:"tablist",children:[s("diagram",i("Diagram"),"mg-pane-diagram"),s("changes",i("Changes"),"mg-pane-changes"),s("data",i("Data migrations"),"mg-pane-data")]}),e[2]=i,e[3]=s,e[4]=u):u=e[4];let b;e[5]!==r||e[6]!==a?(b=(0,d.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:a==="data"?(0,d.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4",children:(0,d.jsx)(ot,{initialShardKey:r})}):(0,d.jsx)(Jt,{pane:a,shardKey:r})}),e[5]=r,e[6]=a,e[7]=b):b=e[7];let h;return e[8]!==u||e[9]!==b?(h=(0,d.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},"De");export{xa as default};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-L6KA7M4B.js";import{a as n}from"./chunk-YKXDMIHQ.js";var b="__lunora_admin__:",g=new Set(["action","mutation","query"]),c=Symbol("lunora.operationSeq"),_=n(t=>{if(typeof t!="object"||t===null)return;let e=t[c];return typeof e=="number"?e:void 0},"g"),d=n((t,e)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,c,{configurable:!0,enumerable:!1,value:e,writable:!0})}catch{}},"h"),m=n(t=>{if(typeof t!="object"||t===null)return;let e=t.__lunoraRef;return typeof e=="string"&&e.startsWith(b)?e:void 0},"p"),h=n(t=>{if(typeof t!="object"||t===null)return"";let{shardKey:e}=t;return typeof e=="string"?e:""},"O"),w=n(t=>new Proxy(t,{get(e,u,y){let i=Reflect.get(e,u,y);if(typeof i!="function"||typeof u!="string"||!g.has(u))return typeof i=="function"?i.bind(e):i;let f=i;return async(...o)=>{let l=m(o[0]);if(l===void 0)return f.apply(e,o);let p=typeof o[1]=="object"&&o[1]!==null?o[1]:{},a=s.start(l,p,h(o[2]));try{let r=await f.apply(e,o);return s.settle(a,{result:r}),r}catch(r){throw s.settle(a,{error:r instanceof Error?r.message:String(r)}),d(r,a),r}}}}),"E");export{_ as a,w as b};
1
+ import{a as s}from"./chunk-IP6LZ2OL.js";import{a as n}from"./chunk-YKXDMIHQ.js";var b="__lunora_admin__:",g=new Set(["action","mutation","query"]),c=Symbol("lunora.operationSeq"),_=n(t=>{if(typeof t!="object"||t===null)return;let e=t[c];return typeof e=="number"?e:void 0},"g"),d=n((t,e)=>{if(!(typeof t!="object"||t===null||!Object.isExtensible(t)))try{Object.defineProperty(t,c,{configurable:!0,enumerable:!1,value:e,writable:!0})}catch{}},"h"),m=n(t=>{if(typeof t!="object"||t===null)return;let e=t.__lunoraRef;return typeof e=="string"&&e.startsWith(b)?e:void 0},"p"),h=n(t=>{if(typeof t!="object"||t===null)return"";let{shardKey:e}=t;return typeof e=="string"?e:""},"O"),w=n(t=>new Proxy(t,{get(e,u,y){let i=Reflect.get(e,u,y);if(typeof i!="function"||typeof u!="string"||!g.has(u))return typeof i=="function"?i.bind(e):i;let f=i;return async(...o)=>{let l=m(o[0]);if(l===void 0)return f.apply(e,o);let p=typeof o[1]=="object"&&o[1]!==null?o[1]:{},a=s.start(l,p,h(o[2]));try{let r=await f.apply(e,o);return s.settle(a,{result:r}),r}catch(r){throw s.settle(a,{error:r instanceof Error?r.message:String(r)}),d(r,a),r}}}}),"E");export{_ as a,w as b};