@lunora/studio 1.0.0-alpha.115 → 1.0.0-alpha.116

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 (109) hide show
  1. package/dist/index.d.ts +13 -16
  2. package/dist/index.js +1 -1
  3. package/dist/mount.js +1 -1
  4. package/dist/packem_chunks/ApiTab.js +1 -1
  5. package/dist/packem_chunks/AuditPanel.js +1 -1
  6. package/dist/packem_chunks/DeploymentHealthPanel.js +1 -1
  7. package/dist/packem_chunks/ExportImportPanel.js +2 -2
  8. package/dist/packem_chunks/FileBrowser.js +1 -1
  9. package/dist/packem_chunks/FunctionRunner.js +1 -1
  10. package/dist/packem_chunks/FunctionStatsPanel.js +1 -1
  11. package/dist/packem_chunks/HealthPanel.js +1 -1
  12. package/dist/packem_chunks/InsightsPanel.js +1 -1
  13. package/dist/packem_chunks/LogsPanel.js +1 -1
  14. package/dist/packem_chunks/MetricsPanel.js +1 -1
  15. package/dist/packem_chunks/SchemaViewer.js +1 -1
  16. package/dist/packem_chunks/SettingsPanel.js +1 -1
  17. package/dist/packem_chunks/SqlEditorPanel.js +9 -6
  18. package/dist/packem_chunks/TableEditor.js +1 -1
  19. package/dist/packem_chunks/dashboards-panel.js +1 -1
  20. package/dist/packem_chunks/evals-panel.js +1 -1
  21. package/dist/packem_chunks/fanout-panel.js +1 -1
  22. package/dist/packem_chunks/issues-panel.js +1 -1
  23. package/dist/packem_chunks/kv-browser.js +1 -1
  24. package/dist/packem_chunks/migrations-route.js +1 -1
  25. package/dist/packem_chunks/permissions-panel.js +1 -1
  26. package/dist/packem_chunks/sparkline.js +1 -1
  27. package/dist/packem_chunks/subscriptions-panel.js +1 -1
  28. package/dist/packem_chunks/traces-panel.js +1 -1
  29. package/dist/packem_shared/{ApiReferencePanel-6W_QfOlv.js → ApiReferencePanel-DXrGI45U.js} +1 -1
  30. package/dist/packem_shared/CommandPalette-kQLn0xlS.js +1 -0
  31. package/dist/packem_shared/DataBrowser-BPCr2f8V.js +4 -0
  32. package/dist/packem_shared/{MigrationsPanel-CW4MNUa4.js → MigrationsPanel-CF73xHke.js} +1 -1
  33. package/dist/packem_shared/{OpenRpcReferencePanel-Cx-qwpZW.js → OpenRpcReferencePanel-DkYBLJGb.js} +1 -1
  34. package/dist/packem_shared/{ShardInput-XumEzeT0.js → ShardInput-CdawpUiS.js} +1 -1
  35. package/dist/packem_shared/{Studio-k_HuJZYW.js → Studio-RFVDC2sC.js} +1 -1
  36. package/dist/packem_shared/{StudioApp-CWpwayvp.js → StudioApp-jTW-QnDo.js} +1 -1
  37. package/dist/packem_shared/{bar-chart-CCyO67Uf.js → bar-chart-B6gzp_f9.js} +2 -2
  38. package/dist/packem_shared/browser-storage-BH1MxLZs.js +1 -0
  39. package/dist/packem_shared/{dropdown-menu-D_ewqsUU.js → dropdown-menu-U7Tjg1Nb.js} +1 -1
  40. package/dist/packem_shared/grid-features-AzpmpR3Q.js +6 -0
  41. package/dist/packem_shared/{reference-view-DhxnzBtf.js → reference-view-CxW7paCK.js} +1 -1
  42. package/dist/packem_shared/{schema-diagram-CPcjPZj3.js → schema-diagram-DLhppqVE.js} +1 -1
  43. package/dist/packem_shared/{shard-history-QcjcMnCA.js → shard-history-DU5b3QDI.js} +1 -1
  44. package/dist/packem_shared/shortcuts-lH4Vaqjc.js +1 -0
  45. package/dist/packem_shared/{sparkline-BreIqzDO.js → sparkline-CYbJzfA1.js} +1 -1
  46. package/dist/packem_shared/sql-result-table-blxdNVJ0.js +1 -0
  47. package/dist/packem_shared/studio-BdV57x3O.js +2 -0
  48. package/dist/packem_shared/{trace-handoff-C0CFV2ix.js → trace-handoff-z9sy89Ci.js} +1 -1
  49. package/dist/packem_shared/{use-open-trace-IfIlKEWd.js → use-open-trace-ClAdPkGD.js} +1 -1
  50. package/dist/standalone/chunk-22664OOM.js +1 -0
  51. package/dist/standalone/chunk-2P6N5XES.js +1 -0
  52. package/dist/standalone/{chunk-INBA3473.js → chunk-2SFSTQS4.js} +1 -1
  53. package/dist/standalone/{chunk-LDVDE3LE.js → chunk-2WAWYLUP.js} +1 -1
  54. package/dist/standalone/{chunk-HLEXBOCL.js → chunk-6UN4V2HB.js} +1 -1
  55. package/dist/standalone/{chunk-PNLUMMXO.js → chunk-BBXNPD22.js} +1 -1
  56. package/dist/standalone/chunk-CU7KGPAQ.js +1 -0
  57. package/dist/standalone/{chunk-ZHDCWHRT.js → chunk-CYLI7GO3.js} +1 -1
  58. package/dist/standalone/{chunk-KOH52XKG.js → chunk-CZK4GZ5C.js} +1 -1
  59. package/dist/standalone/{chunk-U2KBAKZ6.js → chunk-EEIKRCWD.js} +1 -1
  60. package/dist/standalone/{chunk-Q2G22JHG.js → chunk-F5YULDNX.js} +1 -1
  61. package/dist/standalone/{chunk-2UIT2HC2.js → chunk-FKNT7GEB.js} +1 -1
  62. package/dist/standalone/{chunk-NSR345ID.js → chunk-I4XA3BBM.js} +1 -1
  63. package/dist/standalone/{chunk-2CHFHPR3.js → chunk-IZ6AVENL.js} +1 -1
  64. package/dist/standalone/{chunk-6ZSAMAYN.js → chunk-J7GGD2O2.js} +1 -1
  65. package/dist/standalone/{chunk-7IQT5M4O.js → chunk-K5XFXW6D.js} +1 -1
  66. package/dist/standalone/{chunk-FEEZPSMA.js → chunk-KQ6HYQCE.js} +1 -1
  67. package/dist/standalone/{chunk-P52BY657.js → chunk-KVSQKUWD.js} +1 -1
  68. package/dist/standalone/chunk-LMAI2ESY.js +9 -0
  69. package/dist/standalone/{chunk-UKIDHICQ.js → chunk-MDWJRPZG.js} +1 -1
  70. package/dist/standalone/chunk-N7WIVIP2.js +3 -0
  71. package/dist/standalone/chunk-P2GOC5GL.js +6 -0
  72. package/dist/standalone/{chunk-INLHZKCS.js → chunk-PLI4LCPS.js} +1 -1
  73. package/dist/standalone/{chunk-D4HJ2VM2.js → chunk-R3VDUL6F.js} +1 -1
  74. package/dist/standalone/chunk-RND4232Z.js +1 -0
  75. package/dist/standalone/chunk-S6UHG354.js +1 -0
  76. package/dist/standalone/{chunk-OAXOITHK.js → chunk-T7DJP5HM.js} +1 -1
  77. package/dist/standalone/{chunk-RVQRXKRJ.js → chunk-TNFIYZPY.js} +1 -1
  78. package/dist/standalone/{chunk-UCA5MYCL.js → chunk-TNVZJKGN.js} +1 -1
  79. package/dist/standalone/chunk-TOZK5WX3.js +1 -0
  80. package/dist/standalone/chunk-TPAZM36C.js +1 -0
  81. package/dist/standalone/{chunk-OTZRXUHF.js → chunk-TYOIBCR6.js} +1 -1
  82. package/dist/standalone/{chunk-AG265V66.js → chunk-VKQZAEUQ.js} +1 -1
  83. package/dist/standalone/chunk-VTPKVALV.js +7 -0
  84. package/dist/standalone/{chunk-7TFEJVX4.js → chunk-VVB7SOO7.js} +1 -1
  85. package/dist/standalone/{chunk-MGC6PRMV.js → chunk-XOA5TTRA.js} +1 -1
  86. package/dist/standalone/{chunk-IWOZGUI2.js → chunk-YMVKAXBC.js} +1 -1
  87. package/dist/standalone/chunk-ZHPDAJBM.js +1 -0
  88. package/dist/standalone/studio.js +1 -1
  89. package/dist/styles.css +1 -1
  90. package/package.json +1 -1
  91. package/dist/packem_shared/CommandPalette-BAiOc1hT.js +0 -1
  92. package/dist/packem_shared/DataBrowser-CrkvQAMf.js +0 -1
  93. package/dist/packem_shared/browser-storage-Br_bLeBt.js +0 -1
  94. package/dist/packem_shared/grid-features-3wfN2PeE.js +0 -6
  95. package/dist/packem_shared/result-chart-Q-gVLi4_.js +0 -1
  96. package/dist/packem_shared/studio-BFvT56qK.js +0 -2
  97. package/dist/standalone/chunk-2Q7HAFRK.js +0 -1
  98. package/dist/standalone/chunk-44FJEOAY.js +0 -1
  99. package/dist/standalone/chunk-EQSVW6LZ.js +0 -3
  100. package/dist/standalone/chunk-GKHUQDVI.js +0 -1
  101. package/dist/standalone/chunk-H3M57MCN.js +0 -1
  102. package/dist/standalone/chunk-HLHO5AHK.js +0 -4
  103. package/dist/standalone/chunk-U7J3LXJ4.js +0 -6
  104. package/dist/standalone/chunk-UJXKS27L.js +0 -1
  105. package/dist/standalone/chunk-VNTEQQPP.js +0 -1
  106. package/dist/standalone/chunk-YYFHDYYT.js +0 -1
  107. package/dist/standalone/chunk-ZIHYXKQJ.js +0 -6
  108. /package/dist/standalone/{chunk-AECDJKXB.js → chunk-O2VDNK4B.js} +0 -0
  109. /package/dist/standalone/{chunk-APRVSWBH.js → chunk-XL2OT5WB.js} +0 -0
@@ -0,0 +1,6 @@
1
+ import{c as R}from"react/compiler-runtime";import{useState as O,useEffect as K}from"react";import{ConfirmButton as Q}from"./ConfirmButton-Cj2SOapE.js";import{D as J,a as M,b as v,c as F,d as G,e as I,f as A,g as U}from"./dropdown-menu-U7Tjg1Nb.js";import{M as H}from"./modal-shell-wGW4CKEW.js";import{useT as _}from"./DEFAULT_LOCALE-A1Yg5ORA.js";import{h as P,g as W,j as Y,s as B,f as z}from"./internal-7bgd8inO.js";import{jsx as d,jsxs as $}from"react/jsx-runtime";const L="inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",X=/["\n,]/u,Z=/^[=+\-@\t\r]/u,V=l=>{if(l==null)return"";let e;return typeof l=="string"?e=Z.test(l)?` ${l}`:l:typeof l=="number"||typeof l=="boolean"||typeof l=="bigint"?e=String(l):e=JSON.stringify(l),X.test(e)?`"${e.replaceAll('"','""')}"`:e},ee=(l,e)=>{const n=l.map(t=>V(t)).join(","),s=e.map(t=>l.map(o=>V(t[o])).join(","));return[n,...s].join(`
2
+ `)},te=l=>JSON.stringify(l,Y,2),q=500,le=l=>l==null?"NULL":typeof l=="number"?Number.isFinite(l)?String(l):"NULL":typeof l=="bigint"?String(l):typeof l=="boolean"?l?"1":"0":`'${(typeof l=="string"?l:JSON.stringify(l)).replaceAll("'","''")}'`,ne=(l,e,n)=>{if(e.length===0||n.length===0)return"";const s=e.map(o=>B(o)).join(", "),t=[];for(let o=0;o<n.length;o+=q){const r=n.slice(o,o+q).map(i=>` (${e.map(a=>le(i[a])).join(", ")})`).join(`,
3
+ `);t.push(`INSERT INTO ${B(l)} (${s}) VALUES
4
+ ${r};`)}return t.join(`
5
+
6
+ `)},D=(l,e,n)=>{if(!("document"in globalThis))return;const s=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:n})),t=globalThis.document.createElement("a");t.href=s,t.download=l,globalThis.document.body.append(t),t.click(),t.remove(),globalThis.URL.revokeObjectURL(s)},oe=l=>{const e=R(36),{columns:n,name:s,rows:t}=l,o=_();let r;e[0]!==n||e[1]!==s||e[2]!==t?(r=()=>{D(`${s}.csv`,ee(n,t),"text/csv;charset=utf-8")},e[0]=n,e[1]=s,e[2]=t,e[3]=r):r=e[3];const i=r;let a;e[4]!==s||e[5]!==t?(a=()=>{D(`${s}.json`,te(t),"application/json")},e[4]=s,e[5]=t,e[6]=a):a=e[6];const u=a;let f;e[7]!==n||e[8]!==s||e[9]!==t?(f=()=>{D(`${s}.sql`,ne(s,n,t),"application/sql;charset=utf-8")},e[7]=n,e[8]=s,e[9]=t,e[10]=f):f=e[10];const c=f,C=t.length===0;let p;e[11]!==C?(p=d(J,{className:L,"data-testid":"grid-export",disabled:C,title:"Exports only the rows loaded on the current page, not the whole table",children:"Export page"}),e[11]=C,e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=d(M,{children:"Export loaded rows"}),e[13]=g):g=e[13];let m;e[14]!==o?(m=o("CSV"),e[14]=o,e[15]=m):m=e[15];let x;e[16]!==i||e[17]!==m?(x=d(v,{"data-testid":"grid-export-csv",onClick:i,children:m}),e[16]=i,e[17]=m,e[18]=x):x=e[18];let N;e[19]!==o?(N=o("JSON"),e[19]=o,e[20]=N):N=e[20];let y;e[21]!==u||e[22]!==N?(y=d(v,{"data-testid":"grid-export-json",onClick:u,children:N}),e[21]=u,e[22]=N,e[23]=y):y=e[23];let S;e[24]!==o?(S=o("SQL"),e[24]=o,e[25]=S):S=e[25];let h;e[26]!==c||e[27]!==S?(h=d(v,{"data-testid":"grid-export-sql",onClick:c,children:S}),e[26]=c,e[27]=S,e[28]=h):h=e[28];let b;e[29]!==y||e[30]!==h||e[31]!==x?(b=$(F,{align:"end",children:[g,x,y,h]}),e[29]=y,e[30]=h,e[31]=x,e[32]=b):b=e[32];let w;return e[33]!==b||e[34]!==p?(w=$(G,{children:[p,b]}),e[33]=b,e[34]=p,e[35]=w):w=e[35],w},se=l=>{const e=R(9),{column:n}=l;let s;e[0]!==n?(s=()=>{n.toggleVisibility()},e[0]=n,e[1]=s):s=e[1];const t=s;let o;e[2]!==n?(o=n.getIsVisible(),e[2]=n,e[3]=o):o=e[3];const r=`grid-column-${n.id}`;let i;return e[4]!==n.id||e[5]!==t||e[6]!==o||e[7]!==r?(i=d(A,{checked:o,closeOnClick:!1,"data-testid":r,onCheckedChange:t,children:n.id}),e[4]=n.id,e[5]=t,e[6]=o,e[7]=r,e[8]=i):i=e[8],i},ie=[],re=({backRelations:l=ie,enabledBackRelations:e,onToggleBackRelation:n,table:s})=>{const t=_(),o=s.getIsAllColumnsVisible(),r=()=>{s.toggleAllColumnsVisible(!o)};return $(G,{children:[d(J,{className:L,"data-testid":"grid-columns",children:t("Columns")}),$(F,{align:"end",className:"max-h-80 overflow-y-auto",children:[$(I,{children:[d(M,{children:t("Columns")}),d(A,{checked:o,closeOnClick:!1,"data-testid":"grid-columns-all",onCheckedChange:r,children:t(o?"Hide all":"Show all")}),d(U,{}),s.getAllLeafColumns().filter(i=>!i.id.startsWith("__back__:")).map(i=>d(se,{column:i},i.id))]}),l.length>0&&n!==void 0&&$(I,{children:[d(U,{}),d(M,{children:t("Related")}),l.map(i=>{const a=`${i.table}.${i.column}`;return d(A,{checked:e?.has(a)===!0,closeOnClick:!1,"data-testid":`grid-back-relation-${a}`,onCheckedChange:()=>{n(a)},children:`← ${i.table}.${i.column}`},a)})]})]})]})},ce=l=>{const e=R(19),{count:n,editable:s,onClear:t,onDelete:o}=l,r=_();let i;e[0]!==n||e[1]!==r?(i=r("{count} selected",{count:n}),e[0]=n,e[1]=r,e[2]=i):i=e[2];let a;e[3]!==i?(a=d("span",{className:"font-medium tabular-nums","data-testid":"grid-selection-count",children:i}),e[3]=i,e[4]=a):a=e[4];let u;e[5]!==r?(u=r("Clear"),e[5]=r,e[6]=u):u=e[6];let f;e[7]!==t||e[8]!==u?(f=d("button",{className:L,"data-testid":"grid-selection-clear",onClick:t,type:"button",children:u}),e[7]=t,e[8]=u,e[9]=f):f=e[9];let c;e[10]!==n||e[11]!==s||e[12]!==o||e[13]!==r?(c=s&&d(Q,{confirmLabel:r("Delete {count} rows?",{count:n}),onConfirm:o,testId:"grid-selection-delete",children:r("Delete {count}",{count:n})}),e[10]=n,e[11]=s,e[12]=o,e[13]=r,e[14]=c):c=e[14];let C;return e[15]!==a||e[16]!==f||e[17]!==c?(C=$("div",{className:"flex items-center gap-2 rounded-md border border-border bg-accent/40 px-3 py-1.5 text-xs","data-testid":"grid-selection-bar",children:[a,f,c]}),e[15]=a,e[16]=f,e[17]=c,e[18]=C):C=e[18],C},ae=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,de=l=>{const e=R(9),{bucket:n,objectKey:s,resolveUrl:t}=l,[o,r]=O(null),[i,a]=O(!1);let u,f;e[0]!==n||e[1]!==s||e[2]!==t?(u=()=>{const g={cancelled:!1};return z((async()=>{try{const m=await t(s,n);g.cancelled||r(m)}catch{g.cancelled||a(!0)}})()),()=>{g.cancelled=!0}},f=[n,s,t],e[0]=n,e[1]=s,e[2]=t,e[3]=u,e[4]=f):(u=e[3],f=e[4]),K(u,f);let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{a(!0)},e[5]=c):c=e[5];const C=c;if(o===null||i)return null;let p;return e[6]!==s||e[7]!==o?(p=d("div",{className:"flex max-h-64 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:d("img",{alt:s,className:"max-h-64 object-contain","data-testid":"grid-cell-image",onError:C,src:o})}),e[6]=s,e[7]=o,e[8]=p):p=e[8],p},ye=l=>{const e=R(37),{bucket:n,column:s,onClose:t,resolveUrl:o,value:r}=l,i=_(),[a,u]=O(!1);let f;e[0]!==r?(f=P(r),e[0]=r,e[1]=f):f=e[1];const c=f;let C;e[2]!==c?(C=()=>{W(c)&&u(!0)},e[2]=c,e[3]=C):C=e[3];const p=C;let g;e[4]!==i?(g=i("Cell value"),e[4]=i,e[5]=g):g=e[5];let m;e[6]!==s?(m=d("h2",{className:"truncate font-mono text-sm font-semibold text-foreground",children:s}),e[6]=s,e[7]=m):m=e[7];let x;e[8]!==a||e[9]!==i?(x=i(a?"Copied":"Copy"),e[8]=a,e[9]=i,e[10]=x):x=e[10];let N;e[11]!==p||e[12]!==x?(N=d("button",{className:L,"data-testid":"grid-cell-copy",onClick:p,type:"button",children:x}),e[11]=p,e[12]=x,e[13]=N):N=e[13];let y;e[14]!==i?(y=i("Close"),e[14]=i,e[15]=y):y=e[15];let S;e[16]!==t||e[17]!==y?(S=d("button",{className:L,"data-testid":"grid-cell-close",onClick:t,type:"button",children:y}),e[16]=t,e[17]=y,e[18]=S):S=e[18];let h;e[19]!==N||e[20]!==S?(h=$("div",{className:"flex items-center gap-1.5",children:[N,S]}),e[19]=N,e[20]=S,e[21]=h):h=e[21];let b;e[22]!==m||e[23]!==h?(b=$("div",{className:"flex items-center justify-between",children:[m,h]}),e[22]=m,e[23]=h,e[24]=b):b=e[24];let w;e[25]!==n||e[26]!==o||e[27]!==r?(w=o!==void 0&&typeof r=="string"&&ae.test(r)&&d(de,{bucket:n,objectKey:r,resolveUrl:o}),e[25]=n,e[26]=o,e[27]=r,e[28]=w):w=e[28];let k;e[29]!==c?(k=d("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md border border-border bg-muted/30 p-3 font-mono text-xs whitespace-pre-wrap","data-testid":"grid-cell-value",children:c}),e[29]=c,e[30]=k):k=e[30];let T;return e[31]!==t||e[32]!==b||e[33]!==w||e[34]!==k||e[35]!==g?(T=$(H,{className:"max-h-[70vh] w-[min(40rem,90vw)]",label:g,onClose:t,panelTestId:"grid-cell-dialog",testId:"grid-cell-dialog-overlay",variant:"dialog",children:[b,w,k]}),e[31]=t,e[32]=b,e[33]=w,e[34]=k,e[35]=g,e[36]=T):T=e[36],T},we=l=>{const e=R(36),{backRelations:n,enabledBackRelations:s,onToggleBackRelation:t,columns:o,editable:r,name:i,onBulkDelete:a,onToggleTranspose:u,rows:f,table:c,transposed:C}=l,p=_();let g;e[0]!==c?(g=c.getSelectedRowModel(),e[0]=c,e[1]=g):g=e[1];const m=g.rows;let x;e[2]!==c?(x=()=>{c.resetRowSelection()},e[2]=c,e[3]=x):x=e[3];const N=x;let y;e[4]!==a||e[5]!==m||e[6]!==c?(y=()=>{a(m.map(fe)),c.resetRowSelection()},e[4]=a,e[5]=m,e[6]=c,e[7]=y):y=e[7];const S=y;let h;e[8]!==o||e[9]!==i||e[10]!==f?(h=d(oe,{columns:o,name:i,rows:f}),e[8]=o,e[9]=i,e[10]=f,e[11]=h):h=e[11];let b;e[12]!==n||e[13]!==s||e[14]!==t||e[15]!==c?(b=d(re,{backRelations:n,enabledBackRelations:s,onToggleBackRelation:t,table:c}),e[12]=n,e[13]=s,e[14]=t,e[15]=c,e[16]=b):b=e[16];let w;e[17]!==p?(w=p("Swap rows and columns"),e[17]=p,e[18]=w):w=e[18];let k;e[19]!==p?(k=p("Transpose"),e[19]=p,e[20]=k):k=e[20];let T;e[21]!==u||e[22]!==w||e[23]!==k||e[24]!==C?(T=d("button",{"aria-pressed":C,className:L,"data-testid":"grid-transpose",onClick:u,title:w,type:"button",children:k}),e[21]=u,e[22]=w,e[23]=k,e[24]=C,e[25]=T):T=e[25];let j;e[26]!==r||e[27]!==N||e[28]!==S||e[29]!==m.length?(j=m.length>0&&d(ce,{count:m.length,editable:r,onClear:N,onDelete:S}),e[26]=r,e[27]=N,e[28]=S,e[29]=m.length,e[30]=j):j=e[30];let E;return e[31]!==h||e[32]!==b||e[33]!==T||e[34]!==j?(E=$("div",{className:"flex flex-wrap items-center gap-1.5","data-testid":"grid-actions",children:[h,b,T,j]}),e[31]=h,e[32]=b,e[33]=T,e[34]=j,e[35]=E):E=e[35],E};function fe(l){return l.id}export{ye as C,oe as E,we as G,ce as S};
@@ -1,4 +1,4 @@
1
- import{c as L}from"react/compiler-runtime";import{useState as R,useEffect as oe,createContext as ie,use as ae}from"react";import{b as q,g as V,f as le,k as de,c as ce,d as ue}from"./internal-7bgd8inO.js";import{SentIcon as fe,Copy01Icon as me,Search01Icon as pe}from"@hugeicons/core-free-icons";import{HugeiconsIcon as W}from"@hugeicons/react";import{I as he}from"./input-CY5W3wzv.js";import{useT as K}from"./DEFAULT_LOCALE-A1Yg5ORA.js";import{B as z}from"./button-BOPLD1un.js";import{jsx as i,jsxs as k,Fragment as ge}from"react/jsx-runtime";import{B as xe}from"./badge-cAk9Di1Q.js";import{ShardInput as be}from"./ShardInput-XumEzeT0.js";import{L as G}from"./label-BOUo-DP0.js";import{T as ve}from"./textarea-DpO3i-Qo.js";import{LunoraError as ye}from"@lunora/errors";import{useLunora as Ne}from"@lunora/react";import{c as X}from"./utils-bhneXptQ.js";const xt=function(t,e,r){const s=L(10);let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},s[0]=n):n=s[0];const[o,l]=R(n);let a,m;s[1]!==r||s[2]!==e||s[3]!==t?(a=()=>{if(t!==void 0)return;let c=!1;return e().then(u=>(c||l(r(u)),u)).catch(u=>{c||l({kind:"error",message:q(u)})}),()=>{c=!0}},m=[r,e,t],s[1]=r,s[2]=e,s[3]=t,s[4]=a,s[5]=m):(a=s[4],m=s[5]),oe(a,m);let d;return s[6]!==r||s[7]!==o||s[8]!==t?(d=t===void 0?o:r(t),s[6]=r,s[7]=o,s[8]=t,s[9]=d):d=s[9],d},ke=t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string",Q=t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},F=t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>F(e)).join(" | "):t.type==="array"?`array<${F(t.items)}>`:t.type??"any",Se=t=>{const e=Q(t);return e!==void 0?t.type??ke(e[0]):F(t)},we=t=>{const e=Q(t);return e===void 0?void 0:e.map(r=>JSON.stringify(r)).join(" | ")},Oe=t=>{const e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} ≤`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);const r=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`≤ ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);const s=e.length>(r?2:1);return r||s?e.join(" "):void 0},$e=t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},M=t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return M(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{const e={};for(const[r,s]of Object.entries(t.properties??{}))e[r]=M(s);return e}case"string":return"";default:return null}},D=t=>{const e=L(7),{label:r,value:s}=t;let n;e[0]!==r?(n=i("span",{className:"text-muted-foreground",children:r}),e[0]=r,e[1]=n):n=e[1];let o;e[2]!==s?(o=i("span",{className:"text-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let l;return e[4]!==n||e[5]!==o?(l=k("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,o]}),e[4]=n,e[5]=o,e[6]=l):l=e[6],l},Te=t=>{const e=L(40),{name:r,required:s,schema:n}=t,o=K();let l;e[0]!==n?(l=Oe(n),e[0]=n,e[1]=l):l=e[1];const a=l;let m;e[2]!==n?(m=we(n),e[2]=n,e[3]=m):m=e[3];const d=m,c=n["x-lunora-table"],u=n.format!==void 0||a!==void 0||d!==void 0||c!==void 0;let v;e[4]!==n?(v=$e(n),e[4]=n,e[5]=v):v=e[5];const b=v,f=s?"*":"?";let p;e[6]!==f?(p=i("span",{className:"text-muted-foreground",children:f}),e[6]=f,e[7]=p):p=e[7];let y;e[8]!==r||e[9]!==p?(y=k("span",{className:"font-mono text-foreground",children:[r,p]}),e[8]=r,e[9]=p,e[10]=y):y=e[10];let O;e[11]!==n?(O=Se(n),e[11]=n,e[12]=O):O=e[12];let h;e[13]!==O?(h=i("span",{className:"font-mono text-muted-foreground",children:O}),e[13]=O,e[14]=h):h=e[14];let g;e[15]!==y||e[16]!==h?(g=k("div",{className:"flex items-baseline gap-2",children:[y,h]}),e[15]=y,e[16]=h,e[17]=g):g=e[17];let x;e[18]!==n.description?(x=n.description!==void 0&&i("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=x):x=e[19];let N;e[20]!==u||e[21]!==a||e[22]!==c||e[23]!==n.format||e[24]!==o||e[25]!==d?(N=u&&k("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&i(D,{label:o("Format"),value:n.format}),a!==void 0&&i(D,{label:o("Range"),value:a}),d!==void 0&&i(D,{label:o("Value in"),value:d}),c!==void 0&&i(D,{label:o("relation"),value:c})]}),e[20]=u,e[21]=a,e[22]=c,e[23]=n.format,e[24]=o,e[25]=d,e[26]=N):N=e[26];let S;e[27]!==x||e[28]!==N||e[29]!==g?(S=k("div",{className:"flex flex-col gap-1 py-2",children:[g,x,N]}),e[27]=x,e[28]=N,e[29]=g,e[30]=S):S=e[30];const w=S;if(b===void 0){let T;return e[31]!==w?(T=i("div",{className:"border-b border-border/50 last:border-b-0",children:w}),e[31]=w,e[32]=T):T=e[32],T}let $;e[33]!==w?($=i("summary",{className:"cursor-pointer marker:text-muted-foreground",children:w}),e[33]=w,e[34]=$):$=e[34];let E;e[35]!==b?(E=i("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:i(Y,{schema:b})}),e[35]=b,e[36]=E):E=e[36];let C;return e[37]!==$||e[38]!==E?(C=k("details",{className:"border-b border-border/50 last:border-b-0",children:[$,E]}),e[37]=$,e[38]=E,e[39]=C):C=e[39],C},Y=t=>{const e=L(7),{schema:r}=t;let s;e[0]!==r.required?(s=new Set(r.required),e[0]=r.required,e[1]=s):s=e[1];const n=s;let o;e[2]!==r.properties?(o=Object.entries(r.properties??{}),e[2]=r.properties,e[3]=o):o=e[3];const l=o;let a;return e[4]!==n||e[5]!==l?(a=i("div",{className:"flex flex-col",children:l.map(m=>{const[d,c]=m;return i(Te,{name:d,required:n.has(d),schema:c},d)})}),e[4]=n,e[5]=l,e[6]=a):a=e[6],a},U=t=>{const e=L(10),{schema:r,testId:s}=t;if(r?.type!=="object"||Object.keys(r.properties??{}).length===0){let l;e[0]!==r?(l=F(r),e[0]=r,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==s?(a=i("p",{className:"font-mono text-xs text-muted-foreground","data-testid":s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}let n;e[5]!==r?(n=i(Y,{schema:r}),e[5]=r,e[6]=n):n=e[6];let o;return e[7]!==n||e[8]!==s?(o=i("div",{className:"text-xs","data-testid":s,children:n}),e[7]=n,e[8]=s,e[9]=o):o=e[9],o},Ce=["curl","javascript","lunora"],je={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},Ee=t=>`api.${t.replaceAll(/[/:]/g,".")}`,Pe=t=>{const e=M(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},Ae=(t,e,r)=>{const s=`${r}${e.httpPath}`,n=JSON.stringify(Pe(e),void 0,2),o=JSON.stringify(M(e.argsSchema)??{},void 0,2);switch(t){case"curl":{const l=e.method!=="GET"&&e.method!=="HEAD",a=[`curl -X ${e.method} ${JSON.stringify(s)}`];return l&&a.push(' -H "Content-Type: application/json"',` -d '${n}'`),a.join(` \\
1
+ import{c as L}from"react/compiler-runtime";import{useState as R,useEffect as oe,createContext as ie,use as ae}from"react";import{b as q,g as V,f as le,k as de,c as ce,d as ue}from"./internal-7bgd8inO.js";import{SentIcon as fe,Copy01Icon as me,Search01Icon as pe}from"@hugeicons/core-free-icons";import{HugeiconsIcon as W}from"@hugeicons/react";import{I as he}from"./input-CY5W3wzv.js";import{useT as K}from"./DEFAULT_LOCALE-A1Yg5ORA.js";import{B as z}from"./button-BOPLD1un.js";import{jsx as i,jsxs as k,Fragment as ge}from"react/jsx-runtime";import{B as xe}from"./badge-cAk9Di1Q.js";import{ShardInput as be}from"./ShardInput-CdawpUiS.js";import{L as G}from"./label-BOUo-DP0.js";import{T as ve}from"./textarea-DpO3i-Qo.js";import{LunoraError as ye}from"@lunora/errors";import{useLunora as Ne}from"@lunora/react";import{c as X}from"./utils-bhneXptQ.js";const xt=function(t,e,r){const s=L(10);let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={kind:"loading"},s[0]=n):n=s[0];const[o,l]=R(n);let a,m;s[1]!==r||s[2]!==e||s[3]!==t?(a=()=>{if(t!==void 0)return;let c=!1;return e().then(u=>(c||l(r(u)),u)).catch(u=>{c||l({kind:"error",message:q(u)})}),()=>{c=!0}},m=[r,e,t],s[1]=r,s[2]=e,s[3]=t,s[4]=a,s[5]=m):(a=s[4],m=s[5]),oe(a,m);let d;return s[6]!==r||s[7]!==o||s[8]!==t?(d=t===void 0?o:r(t),s[6]=r,s[7]=o,s[8]=t,s[9]=d):d=s[9],d},ke=t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string",Q=t=>{if(t.enum!==void 0&&t.enum.length>0)return t.enum;if(t.anyOf!==void 0&&t.anyOf.length>0&&t.anyOf.every(e=>e.const!==void 0))return t.anyOf.map(e=>e.const)},F=t=>t===void 0?"any":t.const!==void 0?JSON.stringify(t.const):t.enum!==void 0&&t.enum.length>0?t.enum.map(e=>JSON.stringify(e)).join(" | "):t.anyOf!==void 0&&t.anyOf.length>0?t.anyOf.map(e=>F(e)).join(" | "):t.type==="array"?`array<${F(t.items)}>`:t.type??"any",Se=t=>{const e=Q(t);return e!==void 0?t.type??ke(e[0]):F(t)},we=t=>{const e=Q(t);return e===void 0?void 0:e.map(r=>JSON.stringify(r)).join(" | ")},Oe=t=>{const e=[];t.minimum!==void 0?e.push(`${String(t.minimum)} ≤`):t.exclusiveMinimum!==void 0&&e.push(`${String(t.exclusiveMinimum)} <`);const r=e.length>0;e.push("value"),t.maximum!==void 0?e.push(`≤ ${String(t.maximum)}`):t.exclusiveMaximum!==void 0&&e.push(`< ${String(t.exclusiveMaximum)}`);const s=e.length>(r?2:1);return r||s?e.join(" "):void 0},$e=t=>{if(t.type==="object"&&t.properties!==void 0)return t;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties!==void 0)return t.items},M=t=>{if(t===void 0)return null;if(t.const!==void 0)return t.const;if(t.enum!==void 0&&t.enum.length>0)return t.enum[0];if(t.anyOf!==void 0&&t.anyOf.length>0)return M(t.anyOf[0]);switch(t.type){case"array":return[];case"boolean":return!1;case"number":return 0;case"object":{const e={};for(const[r,s]of Object.entries(t.properties??{}))e[r]=M(s);return e}case"string":return"";default:return null}},D=t=>{const e=L(7),{label:r,value:s}=t;let n;e[0]!==r?(n=i("span",{className:"text-muted-foreground",children:r}),e[0]=r,e[1]=n):n=e[1];let o;e[2]!==s?(o=i("span",{className:"text-foreground",children:s}),e[2]=s,e[3]=o):o=e[3];let l;return e[4]!==n||e[5]!==o?(l=k("span",{className:"inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",children:[n,o]}),e[4]=n,e[5]=o,e[6]=l):l=e[6],l},Te=t=>{const e=L(40),{name:r,required:s,schema:n}=t,o=K();let l;e[0]!==n?(l=Oe(n),e[0]=n,e[1]=l):l=e[1];const a=l;let m;e[2]!==n?(m=we(n),e[2]=n,e[3]=m):m=e[3];const d=m,c=n["x-lunora-table"],u=n.format!==void 0||a!==void 0||d!==void 0||c!==void 0;let v;e[4]!==n?(v=$e(n),e[4]=n,e[5]=v):v=e[5];const b=v,f=s?"*":"?";let p;e[6]!==f?(p=i("span",{className:"text-muted-foreground",children:f}),e[6]=f,e[7]=p):p=e[7];let y;e[8]!==r||e[9]!==p?(y=k("span",{className:"font-mono text-foreground",children:[r,p]}),e[8]=r,e[9]=p,e[10]=y):y=e[10];let O;e[11]!==n?(O=Se(n),e[11]=n,e[12]=O):O=e[12];let h;e[13]!==O?(h=i("span",{className:"font-mono text-muted-foreground",children:O}),e[13]=O,e[14]=h):h=e[14];let g;e[15]!==y||e[16]!==h?(g=k("div",{className:"flex items-baseline gap-2",children:[y,h]}),e[15]=y,e[16]=h,e[17]=g):g=e[17];let x;e[18]!==n.description?(x=n.description!==void 0&&i("p",{className:"max-w-prose text-muted-foreground",children:n.description}),e[18]=n.description,e[19]=x):x=e[19];let N;e[20]!==u||e[21]!==a||e[22]!==c||e[23]!==n.format||e[24]!==o||e[25]!==d?(N=u&&k("div",{className:"flex flex-wrap gap-1",children:[n.format!==void 0&&i(D,{label:o("Format"),value:n.format}),a!==void 0&&i(D,{label:o("Range"),value:a}),d!==void 0&&i(D,{label:o("Value in"),value:d}),c!==void 0&&i(D,{label:o("relation"),value:c})]}),e[20]=u,e[21]=a,e[22]=c,e[23]=n.format,e[24]=o,e[25]=d,e[26]=N):N=e[26];let S;e[27]!==x||e[28]!==N||e[29]!==g?(S=k("div",{className:"flex flex-col gap-1 py-2",children:[g,x,N]}),e[27]=x,e[28]=N,e[29]=g,e[30]=S):S=e[30];const w=S;if(b===void 0){let T;return e[31]!==w?(T=i("div",{className:"border-b border-border/50 last:border-b-0",children:w}),e[31]=w,e[32]=T):T=e[32],T}let $;e[33]!==w?($=i("summary",{className:"cursor-pointer marker:text-muted-foreground",children:w}),e[33]=w,e[34]=$):$=e[34];let E;e[35]!==b?(E=i("div",{className:"mb-2 ml-2 border-l border-border pl-3",children:i(Y,{schema:b})}),e[35]=b,e[36]=E):E=e[36];let C;return e[37]!==$||e[38]!==E?(C=k("details",{className:"border-b border-border/50 last:border-b-0",children:[$,E]}),e[37]=$,e[38]=E,e[39]=C):C=e[39],C},Y=t=>{const e=L(7),{schema:r}=t;let s;e[0]!==r.required?(s=new Set(r.required),e[0]=r.required,e[1]=s):s=e[1];const n=s;let o;e[2]!==r.properties?(o=Object.entries(r.properties??{}),e[2]=r.properties,e[3]=o):o=e[3];const l=o;let a;return e[4]!==n||e[5]!==l?(a=i("div",{className:"flex flex-col",children:l.map(m=>{const[d,c]=m;return i(Te,{name:d,required:n.has(d),schema:c},d)})}),e[4]=n,e[5]=l,e[6]=a):a=e[6],a},U=t=>{const e=L(10),{schema:r,testId:s}=t;if(r?.type!=="object"||Object.keys(r.properties??{}).length===0){let l;e[0]!==r?(l=F(r),e[0]=r,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==s?(a=i("p",{className:"font-mono text-xs text-muted-foreground","data-testid":s,children:l}),e[2]=l,e[3]=s,e[4]=a):a=e[4],a}let n;e[5]!==r?(n=i(Y,{schema:r}),e[5]=r,e[6]=n):n=e[6];let o;return e[7]!==n||e[8]!==s?(o=i("div",{className:"text-xs","data-testid":s,children:n}),e[7]=n,e[8]=s,e[9]=o):o=e[9],o},Ce=["curl","javascript","lunora"],je={lunora:"Lunora",curl:"cURL",javascript:"JavaScript"},Ee=t=>`api.${t.replaceAll(/[/:]/g,".")}`,Pe=t=>{const e=M(t.argsSchema)??{};return t.functionPath===void 0?e:{args:e,functionPath:t.functionPath}},Ae=(t,e,r)=>{const s=`${r}${e.httpPath}`,n=JSON.stringify(Pe(e),void 0,2),o=JSON.stringify(M(e.argsSchema)??{},void 0,2);switch(t){case"curl":{const l=e.method!=="GET"&&e.method!=="HEAD",a=[`curl -X ${e.method} ${JSON.stringify(s)}`];return l&&a.push(' -H "Content-Type: application/json"',` -d '${n}'`),a.join(` \\
2
2
  `)}case"lunora":return e.functionPath===void 0?`await fetch(${JSON.stringify(e.httpPath)}, { method: ${JSON.stringify(e.method)} });`:`import { useLunora } from "@lunora/react";
3
3
  import { api } from "./_generated/api";
4
4
 
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as v}from"react/compiler-runtime";import{Download01Icon as ne}from"@hugeicons/core-free-icons";import{HugeiconsIcon as se}from"@hugeicons/react";import{Handle as B,Position as G,getNodesBounds as re,getViewportForBounds as ae,useNodesState as le,useEdgesState as ie,ReactFlow as ce,Background as de,Panel as M,Controls as me,MiniMap as pe,useNodes as ue,useReactFlow as U,useNodesInitialized as fe}from"@xyflow/react";import{useState as k,useMemo as _,useRef as ge,useEffect as D}from"react";import{S as he,T as N}from"./storage-tier-C2mKwYRj.js";import{B as S}from"./badge-cAk9Di1Q.js";import{B as j}from"./button-BOPLD1un.js";import{D as be,a as xe,b as Ne,g as C}from"./dropdown-menu-D_ewqsUU.js";import{I as ye}from"./input-CY5W3wzv.js";import{useT as T}from"./DEFAULT_LOCALE-A1Yg5ORA.js";import{f as L}from"./internal-7bgd8inO.js";import{c as y}from"./utils-bhneXptQ.js";import{jsx as i,jsxs as f}from"react/jsx-runtime";import{LunoraError as ve}from"@lunora/errors";import{toBlob as we,toSvg as Se}from"html-to-image";function Ee(o){const e=v(10);let t,a,s;e[0]!==o?({className:t,selected:s,...a}=o,e[0]=o,e[1]=t,e[2]=a,e[3]=s):(t=e[1],a=e[2],s=e[3]);const r=s===!0?"":void 0;let n;e[4]!==t?(n=y("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=n):n=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==n?(l=i("div",{"data-slot":"base-node","data-selected":r,className:n,...a}),e[6]=a,e[7]=r,e[8]=n,e[9]=l):l=e[9],l}function Te(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}function $e(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex flex-col",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-content",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}const F=o=>{const e=o.ref===void 0?o.type:`${o.type} → ${o.ref}`;return o.optional===!0?`${e}?`:e},_e=o=>{const e=v(22),{data:t,selected:a}=o,s=T();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==s?(r=t.loadError===!0?i("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:s("Columns unavailable")}):i("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=s,e[3]=r):r=e[3];const n=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=i("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=i("span",{className:"ms-auto",children:i(he,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let c;e[8]!==d||e[9]!==m?(c=f(Te,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=c):c=e[10];let p;e[11]!==t.columns||e[12]!==t.label||e[13]!==n?(p=t.columns.length===0?n:t.columns.map(g=>f("div",{className:y("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",g.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${g.name}`,children:[i(B,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Left,type:"target"}),i("span",{className:"truncate font-mono",title:g.name,children:g.name}),g.pk===!0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),g.ref!==void 0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),i("span",{className:"ms-auto truncate text-muted-foreground",title:F(g),children:F(g)}),i(B,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Right,type:"source"})]},g.name)),e[11]=t.columns,e[12]=t.label,e[13]=n,e[14]=p):p=e[14];let u;e[15]!==p?(u=i($e,{children:p}),e[15]=p,e[16]=u):u=e[16];let b;return e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=f(Ee,{className:"w-64 overflow-hidden","data-testid":l,selected:a,children:[c,u]}),e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],b},x=1920,E=1080,K=32,R=(o,e)=>{const t=globalThis.document.createElement("a");t.href=o,t.download=e,globalThis.document.body.append(t),t.click(),t.remove()},Ce=(o,e,t="schema-diagram.json")=>{const a={edges:e,exportedAt:new Date().toISOString(),nodes:o},s=JSON.stringify(a,void 0,2),r=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));R(r,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(r)},0)},P=(o,e,t,a)=>{const s=re(o),{x:r,y:n,zoom:l}=ae(s,e,t,.1,2,a);return{transform:[r,n,l],zoom:l}},Me=async(o,e,t="schema-diagram.png")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await we(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});if(l===null)throw new ve("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(l);R(d,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},ke=async(o,e,t="schema-diagram.svg")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await Se(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});R(l,t)},W=256,q=112,I=36,w=24,De=480,Le=1.4,Re=o=>{const e=Math.max(1,Math.round(Math.sqrt(Le*o/(W+q))));return Math.max(De,o/e)},Ae=38,Oe=28,z=o=>Ae+Math.max(1,o)*Oe,He=(o,e)=>{const t=new Map;for(const n of o)t.set(n,[]);for(const n of e)n.to!==n.from&&t.has(n.from)&&t.has(n.to)&&t.get(n.from)?.push(n.to);const a=new Map,s=new Set,r=n=>{const l=a.get(n);if(l!==void 0)return l;if(s.has(n))return 0;s.add(n);let d=0;for(const m of t.get(n)??[])d=Math.max(d,r(m)+1);return s.delete(n),a.set(n,d),d};for(const n of o)r(n);return a},Be=(o,e,t)=>{const a=He(o,e),s=new Map;for(const m of o){const c=a.get(m)??0,p=s.get(c);p===void 0?s.set(c,[m]):p.push(m)}const r=o.reduce((m,c)=>m+z(t.get(c)??0)+I,0),n=Re(r),l=[];let d=0;for(const m of[...s.keys()].toSorted((c,p)=>c-p)){let c=0,p=w;for(const u of s.get(m)??[]){const b=z(t.get(u)??0);p>w&&p+b>n&&(c+=1,p=w),l.push({name:u,x:w+(d+c)*(W+q),y:p}),p+=b+I}d+=c+1}return l},Ge={databaseSchema:_e},J={backgroundColor:N.shard.color},V={backgroundColor:N.global.color},je={global:!0,shard:!0},Fe={},Ie=o=>{const e=o.find(t=>t.pk===!0)?.name;return e!==void 0?e:o.some(t=>t.name==="_id")?"_id":o.some(t=>t.name==="id")?"id":o[0]?.name??"_id"},Y=o=>o.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),ze=(o,e,t)=>{const a=o.map(l=>l.name),s=new Map(o.map(l=>[l.name,l.columns.length])),r=Be(a,Y(o),s),n=new Map(o.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const c=n.get(l);return c===void 0?[]:[{className:t[l],data:{columns:c.columns,label:l,loadError:e,tier:c.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Ue=o=>{const e=new Map(o.map(t=>[t.name,t.columns]));return Y(o).flatMap(t=>{const a=e.get(t.to)??[],s=e.get(t.from)??[],r=Ie(a);return!a.some(n=>n.name===r)||!s.some(n=>n.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ke=()=>{const o=v(15),e=T();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),o[0]=t):t=o[0];let a;o[1]===Symbol.for("react.memo_cache_sentinel")?(a=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]}),o[1]=a):a=o[1];let s;o[2]===Symbol.for("react.memo_cache_sentinel")?(s=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),o[2]=s):s=o[2];let r;o[3]!==e?(r=e("Primary key"),o[3]=e,o[4]=r):r=o[4];let n;o[5]!==r?(n=f("span",{className:"flex items-center gap-1",children:[s,r]}),o[5]=r,o[6]=n):n=o[6];let l;o[7]===Symbol.for("react.memo_cache_sentinel")?(l=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),o[7]=l):l=o[7];let d;o[8]!==e?(d=e("Foreign key"),o[8]=e,o[9]=d):d=o[9];let m;o[10]!==d?(m=f("span",{className:"flex items-center gap-1",children:[l,d]}),o[10]=d,o[11]=m):m=o[11];let c;return o[12]!==n||o[13]!==m?(c=f("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,a,n,m]}),o[12]=n,o[13]=m,o[14]=c):c=o[14],c},Pe=12,We=o=>{const e=v(9),{containerRef:t,seedKey:a}=o,s=fe(),{fitView:r}=U();let n;e[0]!==t||e[1]!==r||e[2]!==s?(n=()=>{if(!s)return;const d=()=>{L(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const c=new ResizeObserver(()=>{d()});return c.observe(m),()=>{c.disconnect()}},e[0]=t,e[1]=r,e[2]=s,e[3]=n):n=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==s||e[7]!==a?(l=[t,r,s,a],e[4]=t,e[5]=r,e[6]=s,e[7]=a,e[8]=l):l=e[8],D(n,l),null},qe=({containerRef:o,testIdPrefix:e})=>{const t=T(),a=ue(),{getEdges:s}=U(),[r,n]=k(null),l=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("png");try{await Me(u,a,`${e}-schema-diagram.png`)}finally{n(null)}}},d=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("svg");try{await ke(u,a,`${e}-schema-diagram.svg`)}finally{n(null)}}},m=()=>{n("json");try{Ce(a,s(),`${e}-schema-diagram.json`)}finally{n(null)}},c=()=>{L(l())},p=()=>{L(d())};return i(M,{position:"top-right",children:f(be,{children:[f(xe,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${e}-export-trigger`,disabled:r!==null,children:[i(se,{className:"size-3.5",icon:ne,strokeWidth:2}),t("Export")]}),f(Ne,{align:"end",children:[i(C,{"data-testid":`${e}-export-png`,disabled:r!==null,onClick:c,children:t("PNG")}),i(C,{"data-testid":`${e}-export-svg`,disabled:r!==null,onClick:p,children:t("SVG")}),i(C,{"data-testid":`${e}-export-json`,disabled:r!==null,onClick:m,children:t("JSON")})]})]})})},dt=({columnsError:o,fill:e=!1,nodeClasses:t,tables:a,testIdPrefix:s})=>{const r=T(),[n,l]=k(je),[d,m]=k(""),c=_(()=>{const h=d.trim().toLowerCase();return a.filter(H=>n[H.tier]&&H.name.toLowerCase().includes(h))},[a,n,d]),p=_(()=>ze(c,o??!1,t??Fe),[c,o,t]),u=_(()=>Ue(c),[c]),b=c.map(h=>h.name).join(","),[g,A,Q]=le(p),[Z,O,X]=ie(u),$=ge(null);D(()=>{A(p)},[p,A]),D(()=>{O(u)},[u,O]);const ee=h=>{m(h.target.value)},te=()=>{l(h=>({...h,shard:!h.shard}))},oe=()=>{l(h=>({...h,global:!h.global}))};return a.length===0?i("section",{className:"flex flex-col gap-2","data-testid":`${s}-section`,children:i("p",{className:"text-sm text-muted-foreground","data-testid":`${s}-empty`,children:r("No tables to graph.")})}):i("section",{className:y("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${s}-section`,children:i("div",{className:y("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${s}-canvas`,ref:$,children:f(ce,{edges:Z,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:g,nodesConnectable:!1,nodeTypes:Ge,onEdgesChange:X,onNodesChange:Q,children:[i(de,{}),i(M,{position:"top-left",children:f("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[i(ye,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${s}-find`,onChange:ee,placeholder:r("Find table…"),value:d}),f("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[f(j,{"aria-pressed":n.shard,className:"gap-1.5","data-testid":`${s}-tier-shard`,onClick:te,size:"xs",type:"button",variant:n.shard?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),f(j,{"aria-pressed":n.global,className:"gap-1.5","data-testid":`${s}-tier-global`,onClick:oe,size:"xs",type:"button",variant:n.global?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]})]})]})}),i(M,{position:"bottom-center",children:i(Ke,{})}),i(me,{showInteractive:!1}),c.length>Pe&&i(pe,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),i(qe,{containerRef:$,testIdPrefix:s}),i(We,{containerRef:$,seedKey:b})]})})})};export{dt as S};
2
+ import{c as v}from"react/compiler-runtime";import{Download01Icon as ne}from"@hugeicons/core-free-icons";import{HugeiconsIcon as se}from"@hugeicons/react";import{Handle as B,Position as G,getNodesBounds as re,getViewportForBounds as ae,useNodesState as le,useEdgesState as ie,ReactFlow as ce,Background as de,Panel as M,Controls as me,MiniMap as pe,useNodes as ue,useReactFlow as U,useNodesInitialized as fe}from"@xyflow/react";import{useState as k,useMemo as _,useRef as ge,useEffect as D}from"react";import{S as he,T as N}from"./storage-tier-C2mKwYRj.js";import{B as S}from"./badge-cAk9Di1Q.js";import{B as j}from"./button-BOPLD1un.js";import{d as be,D as xe,c as Ne,b as C}from"./dropdown-menu-U7Tjg1Nb.js";import{I as ye}from"./input-CY5W3wzv.js";import{useT as T}from"./DEFAULT_LOCALE-A1Yg5ORA.js";import{f as L}from"./internal-7bgd8inO.js";import{c as y}from"./utils-bhneXptQ.js";import{jsx as i,jsxs as f}from"react/jsx-runtime";import{LunoraError as ve}from"@lunora/errors";import{toBlob as we,toSvg as Se}from"html-to-image";function Ee(o){const e=v(10);let t,a,s;e[0]!==o?({className:t,selected:s,...a}=o,e[0]=o,e[1]=t,e[2]=a,e[3]=s):(t=e[1],a=e[2],s=e[3]);const r=s===!0?"":void 0;let n;e[4]!==t?(n=y("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",t),e[4]=t,e[5]=n):n=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==n?(l=i("div",{"data-slot":"base-node","data-selected":r,className:n,...a}),e[6]=a,e[7]=r,e[8]=n,e[9]=l):l=e[9],l}function Te(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-header",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}function $e(o){const e=v(8);let t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let s;e[3]!==t?(s=y("flex flex-col",t),e[3]=t,e[4]=s):s=e[4];let r;return e[5]!==a||e[6]!==s?(r=i("div",{"data-slot":"base-node-content",className:s,...a}),e[5]=a,e[6]=s,e[7]=r):r=e[7],r}const F=o=>{const e=o.ref===void 0?o.type:`${o.type} → ${o.ref}`;return o.optional===!0?`${e}?`:e},_e=o=>{const e=v(22),{data:t,selected:a}=o,s=T();let r;e[0]!==t.label||e[1]!==t.loadError||e[2]!==s?(r=t.loadError===!0?i("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${t.label}-error`,children:s("Columns unavailable")}):i("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"—"}),e[0]=t.label,e[1]=t.loadError,e[2]=s,e[3]=r):r=e[3];const n=r,l=`sd-node-${t.label}`;let d;e[4]!==t.label?(d=i("span",{className:"truncate font-mono text-xs font-semibold",title:t.label,children:t.label}),e[4]=t.label,e[5]=d):d=e[5];let m;e[6]!==t.tier?(m=i("span",{className:"ms-auto",children:i(he,{tier:t.tier})}),e[6]=t.tier,e[7]=m):m=e[7];let c;e[8]!==d||e[9]!==m?(c=f(Te,{children:[d,m]}),e[8]=d,e[9]=m,e[10]=c):c=e[10];let p;e[11]!==t.columns||e[12]!==t.label||e[13]!==n?(p=t.columns.length===0?n:t.columns.map(g=>f("div",{className:y("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",g.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${t.label}-${g.name}`,children:[i(B,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Left,type:"target"}),i("span",{className:"truncate font-mono",title:g.name,children:g.name}),g.pk===!0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),g.ref!==void 0&&i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),i("span",{className:"ms-auto truncate text-muted-foreground",title:F(g),children:F(g)}),i(B,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:g.name,isConnectable:!1,position:G.Right,type:"source"})]},g.name)),e[11]=t.columns,e[12]=t.label,e[13]=n,e[14]=p):p=e[14];let u;e[15]!==p?(u=i($e,{children:p}),e[15]=p,e[16]=u):u=e[16];let b;return e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=f(Ee,{className:"w-64 overflow-hidden","data-testid":l,selected:a,children:[c,u]}),e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],b},x=1920,E=1080,K=32,R=(o,e)=>{const t=globalThis.document.createElement("a");t.href=o,t.download=e,globalThis.document.body.append(t),t.click(),t.remove()},Ce=(o,e,t="schema-diagram.json")=>{const a={edges:e,exportedAt:new Date().toISOString(),nodes:o},s=JSON.stringify(a,void 0,2),r=globalThis.URL.createObjectURL(new globalThis.Blob([s],{type:"application/json"}));R(r,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(r)},0)},P=(o,e,t,a)=>{const s=re(o),{x:r,y:n,zoom:l}=ae(s,e,t,.1,2,a);return{transform:[r,n,l],zoom:l}},Me=async(o,e,t="schema-diagram.png")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await we(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});if(l===null)throw new ve("INTERNAL","html-to-image produced no blob");const d=globalThis.URL.createObjectURL(l);R(d,t),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(d)},0)},ke=async(o,e,t="schema-diagram.svg")=>{const{transform:a}=P(e,x,E,K),[s,r,n]=a,l=await Se(o,{backgroundColor:"#ffffff",height:E,style:{transform:`translate(${s.toString()}px, ${r.toString()}px) scale(${n.toString()})`,transformOrigin:"top left",width:`${x.toString()}px`},width:x});R(l,t)},W=256,q=112,I=36,w=24,De=480,Le=1.4,Re=o=>{const e=Math.max(1,Math.round(Math.sqrt(Le*o/(W+q))));return Math.max(De,o/e)},Ae=38,Oe=28,z=o=>Ae+Math.max(1,o)*Oe,He=(o,e)=>{const t=new Map;for(const n of o)t.set(n,[]);for(const n of e)n.to!==n.from&&t.has(n.from)&&t.has(n.to)&&t.get(n.from)?.push(n.to);const a=new Map,s=new Set,r=n=>{const l=a.get(n);if(l!==void 0)return l;if(s.has(n))return 0;s.add(n);let d=0;for(const m of t.get(n)??[])d=Math.max(d,r(m)+1);return s.delete(n),a.set(n,d),d};for(const n of o)r(n);return a},Be=(o,e,t)=>{const a=He(o,e),s=new Map;for(const m of o){const c=a.get(m)??0,p=s.get(c);p===void 0?s.set(c,[m]):p.push(m)}const r=o.reduce((m,c)=>m+z(t.get(c)??0)+I,0),n=Re(r),l=[];let d=0;for(const m of[...s.keys()].toSorted((c,p)=>c-p)){let c=0,p=w;for(const u of s.get(m)??[]){const b=z(t.get(u)??0);p>w&&p+b>n&&(c+=1,p=w),l.push({name:u,x:w+(d+c)*(W+q),y:p}),p+=b+I}d+=c+1}return l},Ge={databaseSchema:_e},J={backgroundColor:N.shard.color},V={backgroundColor:N.global.color},je={global:!0,shard:!0},Fe={},Ie=o=>{const e=o.find(t=>t.pk===!0)?.name;return e!==void 0?e:o.some(t=>t.name==="_id")?"_id":o.some(t=>t.name==="id")?"id":o[0]?.name??"_id"},Y=o=>o.flatMap(e=>e.columns.filter(t=>t.ref!==void 0).map(t=>({column:t.name,from:e.name,to:t.ref}))),ze=(o,e,t)=>{const a=o.map(l=>l.name),s=new Map(o.map(l=>[l.name,l.columns.length])),r=Be(a,Y(o),s),n=new Map(o.map(l=>[l.name,l]));return r.flatMap(({name:l,x:d,y:m})=>{const c=n.get(l);return c===void 0?[]:[{className:t[l],data:{columns:c.columns,label:l,loadError:e,tier:c.tier},id:l,position:{x:d,y:m},type:"databaseSchema"}]})},Ue=o=>{const e=new Map(o.map(t=>[t.name,t.columns]));return Y(o).flatMap(t=>{const a=e.get(t.to)??[],s=e.get(t.from)??[],r=Ie(a);return!a.some(n=>n.name===r)||!s.some(n=>n.name===t.column)?[]:[{id:`${t.from}.${t.column}->${t.to}`,source:t.to,sourceHandle:r,target:t.from,targetHandle:t.column}]})},Ke=()=>{const o=v(15),e=T();let t;o[0]===Symbol.for("react.memo_cache_sentinel")?(t=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),o[0]=t):t=o[0];let a;o[1]===Symbol.for("react.memo_cache_sentinel")?(a=f("span",{className:"flex items-center gap-1",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]}),o[1]=a):a=o[1];let s;o[2]===Symbol.for("react.memo_cache_sentinel")?(s=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),o[2]=s):s=o[2];let r;o[3]!==e?(r=e("Primary key"),o[3]=e,o[4]=r):r=o[4];let n;o[5]!==r?(n=f("span",{className:"flex items-center gap-1",children:[s,r]}),o[5]=r,o[6]=n):n=o[6];let l;o[7]===Symbol.for("react.memo_cache_sentinel")?(l=i(S,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),o[7]=l):l=o[7];let d;o[8]!==e?(d=e("Foreign key"),o[8]=e,o[9]=d):d=o[9];let m;o[10]!==d?(m=f("span",{className:"flex items-center gap-1",children:[l,d]}),o[10]=d,o[11]=m):m=o[11];let c;return o[12]!==n||o[13]!==m?(c=f("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[t,a,n,m]}),o[12]=n,o[13]=m,o[14]=c):c=o[14],c},Pe=12,We=o=>{const e=v(9),{containerRef:t,seedKey:a}=o,s=fe(),{fitView:r}=U();let n;e[0]!==t||e[1]!==r||e[2]!==s?(n=()=>{if(!s)return;const d=()=>{L(r({duration:0,maxZoom:1.6,padding:.14}))};d();const m=t.current;if(m===null)return;const c=new ResizeObserver(()=>{d()});return c.observe(m),()=>{c.disconnect()}},e[0]=t,e[1]=r,e[2]=s,e[3]=n):n=e[3];let l;return e[4]!==t||e[5]!==r||e[6]!==s||e[7]!==a?(l=[t,r,s,a],e[4]=t,e[5]=r,e[6]=s,e[7]=a,e[8]=l):l=e[8],D(n,l),null},qe=({containerRef:o,testIdPrefix:e})=>{const t=T(),a=ue(),{getEdges:s}=U(),[r,n]=k(null),l=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("png");try{await Me(u,a,`${e}-schema-diagram.png`)}finally{n(null)}}},d=async()=>{const u=o.current?.querySelector(".react-flow__viewport");if(u){n("svg");try{await ke(u,a,`${e}-schema-diagram.svg`)}finally{n(null)}}},m=()=>{n("json");try{Ce(a,s(),`${e}-schema-diagram.json`)}finally{n(null)}},c=()=>{L(l())},p=()=>{L(d())};return i(M,{position:"top-right",children:f(be,{children:[f(xe,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${e}-export-trigger`,disabled:r!==null,children:[i(se,{className:"size-3.5",icon:ne,strokeWidth:2}),t("Export")]}),f(Ne,{align:"end",children:[i(C,{"data-testid":`${e}-export-png`,disabled:r!==null,onClick:c,children:t("PNG")}),i(C,{"data-testid":`${e}-export-svg`,disabled:r!==null,onClick:p,children:t("SVG")}),i(C,{"data-testid":`${e}-export-json`,disabled:r!==null,onClick:m,children:t("JSON")})]})]})})},dt=({columnsError:o,fill:e=!1,nodeClasses:t,tables:a,testIdPrefix:s})=>{const r=T(),[n,l]=k(je),[d,m]=k(""),c=_(()=>{const h=d.trim().toLowerCase();return a.filter(H=>n[H.tier]&&H.name.toLowerCase().includes(h))},[a,n,d]),p=_(()=>ze(c,o??!1,t??Fe),[c,o,t]),u=_(()=>Ue(c),[c]),b=c.map(h=>h.name).join(","),[g,A,Q]=le(p),[Z,O,X]=ie(u),$=ge(null);D(()=>{A(p)},[p,A]),D(()=>{O(u)},[u,O]);const ee=h=>{m(h.target.value)},te=()=>{l(h=>({...h,shard:!h.shard}))},oe=()=>{l(h=>({...h,global:!h.global}))};return a.length===0?i("section",{className:"flex flex-col gap-2","data-testid":`${s}-section`,children:i("p",{className:"text-sm text-muted-foreground","data-testid":`${s}-empty`,children:r("No tables to graph.")})}):i("section",{className:y("flex flex-col",e&&"min-h-0 flex-1"),"data-testid":`${s}-section`,children:i("div",{className:y("w-full overflow-hidden border border-border bg-muted/20",e?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${s}-canvas`,ref:$,children:f(ce,{edges:Z,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:g,nodesConnectable:!1,nodeTypes:Ge,onEdgesChange:X,onNodesChange:Q,children:[i(de,{}),i(M,{position:"top-left",children:f("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[i(ye,{"aria-label":r("Find table…"),className:"h-7 w-44 text-xs","data-testid":`${s}-find`,onChange:ee,placeholder:r("Find table…"),value:d}),f("div",{"aria-label":r("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[f(j,{"aria-pressed":n.shard,className:"gap-1.5","data-testid":`${s}-tier-shard`,onClick:te,size:"xs",type:"button",variant:n.shard?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:J}),N.shard.label]}),f(j,{"aria-pressed":n.global,className:"gap-1.5","data-testid":`${s}-tier-global`,onClick:oe,size:"xs",type:"button",variant:n.global?"default":"outline",children:[i("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:V}),N.global.label]})]})]})}),i(M,{position:"bottom-center",children:i(Ke,{})}),i(me,{showInteractive:!1}),c.length>Pe&&i(pe,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),i(qe,{containerRef:$,testIdPrefix:s}),i(We,{containerRef:$,seedKey:b})]})})})};export{dt as S};
@@ -1 +1 @@
1
- import{s as a,l as i}from"./browser-storage-Br_bLeBt.js";const e="lunora-studio-recent-shards",c=10,o=()=>i(e,"session").filter(s=>typeof s=="string"),l=s=>{const r=s.trim();if(r==="")return o();const t=[r,...o().filter(n=>n!==r)].slice(0,c);return a(e,t,"session"),t};export{o as l,l as r};
1
+ import{s as a,l as i}from"./browser-storage-BH1MxLZs.js";const e="lunora-studio-recent-shards",c=10,o=()=>i(e,"session").filter(s=>typeof s=="string"),l=s=>{const r=s.trim();if(r==="")return o();const t=[r,...o().filter(n=>n!==r)].slice(0,c);return a(e,t,"session"),t};export{o as l,l as r};
@@ -0,0 +1 @@
1
+ import{useSyncExternalStore as f}from"react";import{l as h,s as u}from"./browser-storage-BH1MxLZs.js";const r={console:"`",palette:"k"},c="lunora-studio-shortcuts",n=new Set,p=t=>{const e=typeof t?.console=="string"?t.console.toLowerCase():void 0,s=typeof t?.palette=="string"?t.palette.toLowerCase():void 0;return e?.length===1&&s?.length===1&&e!==s?{console:e,palette:s}:r};let o=r;const S=()=>{o=p(h(c)[0]);for(const t of n)t()};S();const g=t=>(n.add(t),()=>{n.delete(t)}),a=()=>o,w=()=>f(g,a,a),y=(t,e)=>{if(e.length!==1)return;const s=e.toLowerCase(),l=t==="console"?"palette":"console";o=o[l]===s?{...o,[t]:s,[l]:o[t]}:{...o,[t]:s},u(c,[o]);for(const i of n)i()},C=()=>{o=r,u(c,[o]);for(const t of n)t()};export{C as r,y as s,w as u};
@@ -1 +1 @@
1
- import{c as p}from"react/compiler-runtime";import{B as u,E as h}from"./bar-chart-CCyO67Uf.js";import{c as g}from"./utils-bhneXptQ.js";import{jsx as d}from"react/jsx-runtime";const v={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},w=i=>{const e=p(12),{ariaLabel:n,className:c,series:r,testId:m}=i;if(r.length<2)return null;let l;e[0]!==r?(l=r.slice(-40).map(b),e[0]=r,e[1]=l):l=e[1];const f=l;let a;e[2]!==c?(a=g("h-6 w-[120px]",c),e[2]=c,e[3]=a):a=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=d(u,{dataKey:"value"}),e[4]=o):o=e[4];let t;e[5]!==f?(t=d(h,{animationType:"none",barCategoryGap:1,className:"h-full w-full",config:v,data:f,children:o}),e[5]=f,e[6]=t):t=e[6];let s;return e[7]!==n||e[8]!==a||e[9]!==t||e[10]!==m?(s=d("div",{"aria-label":n,className:a,"data-testid":m,role:"img",children:t}),e[7]=n,e[8]=a,e[9]=t,e[10]=m,e[11]=s):s=e[11],s};function b(i,e){return{index:e,value:i}}export{w as S};
1
+ import{c as p}from"react/compiler-runtime";import{B as u,E as h}from"./bar-chart-B6gzp_f9.js";import{c as g}from"./utils-bhneXptQ.js";import{jsx as d}from"react/jsx-runtime";const v={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},w=i=>{const e=p(12),{ariaLabel:n,className:c,series:r,testId:m}=i;if(r.length<2)return null;let l;e[0]!==r?(l=r.slice(-40).map(b),e[0]=r,e[1]=l):l=e[1];const f=l;let a;e[2]!==c?(a=g("h-6 w-[120px]",c),e[2]=c,e[3]=a):a=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=d(u,{dataKey:"value"}),e[4]=o):o=e[4];let t;e[5]!==f?(t=d(h,{animationType:"none",barCategoryGap:1,className:"h-full w-full",config:v,data:f,children:o}),e[5]=f,e[6]=t):t=e[6];let s;return e[7]!==n||e[8]!==a||e[9]!==t||e[10]!==m?(s=d("div",{"aria-label":n,className:a,"data-testid":m,role:"img",children:t}),e[7]=n,e[8]=a,e[9]=t,e[10]=m,e[11]=s):s=e[11],s};function b(i,e){return{index:e,value:i}}export{w as S};
@@ -0,0 +1 @@
1
+ import{c as k}from"react/compiler-runtime";import{AreaChart as R,CartesianGrid as g,XAxis as N,Area as B,LineChart as X,Line as $}from"recharts";import{useT as S}from"./DEFAULT_LOCALE-A1Yg5ORA.js";import{h as E}from"./internal-7bgd8inO.js";import{E as H,X as _,B as j,T as G,C as O,a as A,b as K}from"./bar-chart-B6gzp_f9.js";import{jsx as l,jsxs as T}from"react/jsx-runtime";import{c as V,a as z,b as L,e as F,d as I,T as M}from"./table-BMsuYFhk.js";import{C as U}from"./data-grid-pjv4t5Yi.js";const W=50,q={value:{colors:{dark:["var(--chart-1)"],light:["var(--chart-1)"]},label:"value"}},D=o=>{const e=o.columns.find(n=>o.rows.length>0&&o.rows.every(a=>typeof a[n]=="number"))??null;return{label:o.columns.find(n=>n!==e)??null,value:e}},J=o=>{const e=k(3),{data:t,kind:n}=o;let a;return e[0]!==t||e[1]!==n?(a=l(O,{className:"h-full w-full",config:q,children:n==="area"?T(R,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l(B,{dataKey:"value",fill:"var(--color-value-0)",fillOpacity:.2,stroke:"var(--color-value-0)",type:"monotone"})]}):T(X,{data:t,children:[l(g,{vertical:!1}),l(N,{axisLine:!1,dataKey:"label",tickLine:!1}),l(A,{content:l(K,{})}),l($,{dataKey:"value",dot:!1,stroke:"var(--color-value-0)",strokeWidth:2,type:"monotone"})]})}),e[0]=t,e[1]=n,e[2]=a):a=e[2],a},oe=o=>{const e=k(21),{axes:t,kind:n,result:a}=o,u=S();let r;e[0]!==a?(r=D(a),e[0]=a,e[1]=r):r=e[1];const d=r;let m;e[2]!==a.columns?(m=new Set(a.columns),e[2]=a.columns,e[3]=m):m=e[3];const s=m,i=t!==void 0&&s.has(t.x)?t.x:d.label;let h;e[4]!==t?.y||e[5]!==s?(h=t?.y.find(c=>s.has(c)),e[4]=t?.y,e[5]=s,e[6]=h):h=e[6];const b=h,C=b??d.value;let w;e[7]!==i||e[8]!==a.rows||e[9]!==C?(w=C===null?[]:a.rows.slice(0,W).map((c,v)=>({label:i===null?`#${(v+1).toString()}`:E(c[i]),value:Number(c[C])||0})),e[7]=i,e[8]=a.rows,e[9]=C,e[10]=w):w=e[10];const x=w;if(C===null){let c;e[11]!==u?(c=u("No numeric column to chart."),e[11]=u,e[12]=c):c=e[12];let v;return e[13]!==c?(v=l("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-chart-empty",children:c}),e[13]=c,e[14]=v):v=e[14],v}const f=n??(t!==void 0&&b!==void 0?t.kind:"bar");let p;e[15]!==x||e[16]!==f?(p=f==="bar"?T(H,{className:"h-full w-full",config:q,data:x,children:[l(_,{dataKey:"label"}),l(j,{dataKey:"value"}),l(G,{})]}):l(J,{data:x,kind:f}),e[15]=x,e[16]=f,e[17]=p):p=e[17];let y;return e[18]!==f||e[19]!==p?(y=l("div",{className:"h-80 w-full p-3","data-chart-kind":f,"data-testid":"sql-chart",children:p}),e[18]=f,e[19]=p,e[20]=y):y=e[20],y},ne=o=>{const e=k(19),{result:t}=o,n=S();if(t.columns.length===0){let s;e[0]!==t.rowCount||e[1]!==n?(s=n("{count} rows",{count:t.rowCount}),e[0]=t.rowCount,e[1]=n,e[2]=s):s=e[2];let i;return e[3]!==s?(i=l("p",{className:"p-4 text-sm text-muted-foreground",children:s}),e[3]=s,e[4]=i):i=e[4],i}let a;e[5]!==t.columns?(a=t.columns.map(P),e[5]=t.columns,e[6]=a):a=e[6];let u;e[7]!==a?(u=l(z,{className:"sticky top-0 z-10 bg-muted",children:l(L,{children:a})}),e[7]=a,e[8]=u):u=e[8];let r;if(e[9]!==t.columns||e[10]!==t.rows){let s;e[12]!==t.columns?(s=(i,h)=>l(L,{"data-testid":"sql-row",children:t.columns.map(b=>l(F,{className:"max-w-md truncate font-mono text-xs",children:l(U,{value:i[b]})},b))},h),e[12]=t.columns,e[13]=s):s=e[13],r=t.rows.map(s),e[9]=t.columns,e[10]=t.rows,e[11]=r}else r=e[11];let d;e[14]!==r?(d=l(I,{children:r}),e[14]=r,e[15]=d):d=e[15];let m;return e[16]!==u||e[17]!==d?(m=T(M,{"data-testid":"sql-rows",children:[u,d]}),e[16]=u,e[17]=d,e[18]=m):m=e[18],m};function P(o){return l(V,{children:o},o)}export{oe as S,ne as a};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{c as k}from"react/compiler-runtime";import{createRootRoute as Xt,createRoute as St,createBrowserHistory as es,createMemoryHistory as ts,createRouter as ss,useNavigate as At,useSearch as as,RouterProvider as os,useRouterState as ns,Outlet as rs}from"@tanstack/react-router";import*as nt from"react";import{use as Nt,createContext as Et,useState as it,useEffect as rt,useSyncExternalStore as ls,lazy as A,Suspense as is}from"react";import{c as L}from"./utils-bhneXptQ.js";import{jsx as o,jsxs as w,Fragment as Rt}from"react/jsx-runtime";import{ErrorBoundary as ds}from"./ErrorBoundary-BWNF98VF.js";import{O as cs,u as us}from"./operation-console-provider-DoloEvon.js";import{useT as ee}from"./DEFAULT_LOCALE-A1Yg5ORA.js";import{LunoraError as It}from"@lunora/errors";import{B as dt}from"./badge-cAk9Di1Q.js";import{I as $t}from"./input-CY5W3wzv.js";import{Popover as lt}from"@base-ui/react/popover";import{Cancel01Icon as ms,SidebarLeftIcon as fs}from"@hugeicons/core-free-icons";import{HugeiconsIcon as Ht}from"@hugeicons/react";import{mergeProps as Bt}from"@base-ui/react/merge-props";import{useRender as zt}from"@base-ui/react/use-render";import{cva as hs}from"class-variance-authority";import{B as Vt}from"./button-BOPLD1un.js";import{Dialog as ae}from"@base-ui/react/dialog";import{Tooltip as se}from"@base-ui/react/tooltip";import{S as vt}from"./skeleton-DFBBaJU6.js";import{H as ps,u as gs}from"./home-panel-DywiFhDs.js";import{g as bs,f as wt}from"./internal-7bgd8inO.js";import{o as ft}from"./use-admin-query-DV9xmFl8.js";import{StudioI18nProvider as vs}from"./StudioI18nProvider-Bl547evf.js";import{v as xs,a as ys}from"./data-view-params-qoSTqjAj.js";import{CommandPalette as ws,openCommandPalette as ks}from"./CommandPalette-kQLn0xlS.js";import{motion as Ns}from"motion/react";import{u as Ms}from"./shortcuts-lH4Vaqjc.js";const Ot="(prefers-color-scheme: dark)",Dt=()=>{try{return globalThis.localStorage}catch{return}},Ss=t=>t==="system"||t==="light"||t==="dark",Zt=()=>globalThis.matchMedia,Ft="lunora-studio-theme",xt=["system","light","dark"],Cs=(t="system")=>{try{const e=Dt()?.getItem(Ft);return Ss(e)?e:t}catch{return t}},Ct=t=>{const e=Dt();if(e!==void 0)try{e.setItem(Ft,t)}catch{}},Ps=()=>{try{return Zt()?.(Ot).matches?"dark":"light"}catch{return"light"}},_s=(t,e)=>t==="system"?e:t,Ts=t=>{let e;try{e=Zt()?.(Ot)}catch{e=void 0}if(e===void 0)return()=>{};const s=a=>{t(a.matches?"dark":"light")};return e.addEventListener("change",s),()=>{e.removeEventListener("change",s)}},Mt=Et(null),Ls=({children:t,defaultTheme:e="system"})=>{const[s,a]=it(()=>Cs(e)),[n,r]=it(()=>Ps());rt(()=>Ts(r),[]);const l=u=>{Ct(u),a(u)},d={cycleTheme:()=>{a(u=>{const c=xt[(xt.indexOf(u)+1)%xt.length]??u;return Ct(c),c})},resolvedTheme:_s(s,n),setTheme:l,systemTheme:n,theme:s};return o(Mt,{value:d,children:t})},As=t=>{const e=k(3),{children:s}=t,a=Nt(Mt);let n;return e[0]!==s||e[1]!==a?(n=a===null?o(Ls,{children:s}):s,e[0]=s,e[1]=a,e[2]=n):n=e[2],n},Es=()=>{const t=Nt(Mt);if(t===null)throw new It("INTERNAL","useTheme must be used within a <ThemeProvider>");return t};function pn({delay:t=0,...e}){return o(se.Provider,{"data-slot":"tooltip-provider",delay:t,...e})}function Rs(t){const e=k(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(se.Root,{"data-slot":"tooltip",...s}),e[2]=s,e[3]=a):a=e[3],a}function Is(t){const e=k(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(se.Trigger,{"data-slot":"tooltip-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $s({className:t,side:e="top",sideOffset:s=4,align:a="center",alignOffset:n=0,children:r,...l}){return o(se.Portal,{children:o(se.Positioner,{align:a,alignOffset:n,side:e,sideOffset:s,className:"isolate z-50",children:w(se.Popup,{"data-slot":"tooltip-content",className:L("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...l,children:[r,o(se.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Hs=t=>{const e=k(5),{className:s}=t;let a;e[0]!==s?(a=L("h-full w-full text-foreground",s),e[0]=s,e[1]=a):a=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=o("path",{d:"M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",fillRule:"evenodd"}),e[2]=n):n=e[2];let r;return e[3]!==a?(r=o("svg",{"aria-hidden":"true",className:a,fill:"currentColor",viewBox:"0 0 543 446",children:n}),e[3]=a,e[4]=r):r=e[4],r},qt="lunora.studio.rulesBannerDismissed",Bs=()=>{try{return globalThis.localStorage.getItem(qt)==="1"}catch{return!1}},zs=()=>{try{globalThis.localStorage.setItem(qt,"1")}catch{}},Vs=()=>{const t=k(18),e=ee(),[s,a]=it(Os);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{a(!0),zs()},t[0]=n):n=t[0];const r=n;if(s)return null;let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=o("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),t[1]=l):l=t[1];let i;t[2]!==e?(i=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=i):i=t[3];let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=o("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"}),t[4]=d):d=t[4];let u;t[5]!==e?(u=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=u):u=t[6];let c;t[7]!==i||t[8]!==u?(c=w("span",{children:[i," ",d," ",u]}),t[7]=i,t[8]=u,t[9]=c):c=t[9];let f;t[10]!==e?(f=e("Dismiss"),t[10]=e,t[11]=f):f=t[11];let p;t[12]===Symbol.for("react.memo_cache_sentinel")?(p=o("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:o("path",{d:"M18 6 6 18M6 6l12 12"})}),t[12]=p):p=t[12];let m;t[13]!==f?(m=o("button",{"aria-label":f,className:"ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":"dash-app-rules-banner-dismiss",onClick:r,type:"button",children:p}),t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==c||t[16]!==m?(h=w("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[l,c,m]}),t[15]=c,t[16]=m,t[17]=h):h=t[17],h};function Os(){return Bs()}function Wt(t){const e=k(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(lt.Root,{"data-slot":"popover",...s}),e[2]=s,e[3]=a):a=e[3],a}function jt(t){const e=k(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(lt.Trigger,{"data-slot":"popover-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Ut({align:t="end",alignOffset:e=0,className:s,keepMounted:a=!1,side:n="bottom",sideOffset:r=6,...l}){return o(lt.Portal,{keepMounted:a,children:o(lt.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:n,sideOffset:r,children:o(lt.Popup,{className:L("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",s),"data-slot":"popover-content",...l})})})}const yt=768;function Ds(){const t=k(2),[e,s]=it(void 0);let a,n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{const r=globalThis.matchMedia(`(max-width: ${yt-1}px)`),l=()=>{s(globalThis.innerWidth<yt)};return r.addEventListener("change",l),s(globalThis.innerWidth<yt),()=>{r.removeEventListener("change",l)}},n=[],t[0]=a,t[1]=n):(a=t[0],n=t[1]),rt(a,n),!!e}function Zs(t){const e=k(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(ae.Root,{"data-slot":"sheet",...s}),e[2]=s,e[3]=a):a=e[3],a}function Fs(t){const e=k(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=o(ae.Portal,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function qs(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o(ae.Backdrop,{"data-slot":"sheet-overlay",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function Ws({className:t,children:e,side:s="right",showCloseButton:a=!0,...n}){return w(Fs,{children:[o(qs,{}),w(ae.Popup,{"data-slot":"sheet-content","data-side":s,className:L("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...n,children:[e,a&&w(ae.Close,{"data-slot":"sheet-close",render:o(Vt,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"}),children:[o(Ht,{icon:ms,strokeWidth:2}),o("span",{className:"sr-only",children:"Close"})]})]})]})}function js(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("flex flex-col gap-0.5 p-4",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("div",{"data-slot":"sheet-header",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function Us(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("text-sm font-medium text-foreground",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o(ae.Title,{"data-slot":"sheet-title",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function Ks(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("text-xs/relaxed text-muted-foreground",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o(ae.Description,{"data-slot":"sheet-description",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}const Gs="sidebar_state",Qs=3600*24*7,Ys="16rem",Js="18rem",Xs="3rem",ea="b",Kt=nt.createContext(null);function ht(){const t=nt.useContext(Kt);if(!t)throw new It("INTERNAL","useSidebar must be used within a SidebarProvider.");return t}function ta({defaultOpen:t=!0,open:e,onOpenChange:s,className:a,style:n,children:r,...l}){const i=Ds(),[d,u]=nt.useState(!1),[c,f]=nt.useState(t),p=e??c,m=x=>{const y=typeof x=="function"?x(p):x;s?s(y):f(y),document.cookie=`${Gs}=${y}; path=/; max-age=${Qs}`},h=()=>i?u(x=>!x):m(x=>!x),b=nt.useEffectEvent(()=>{h()});nt.useEffect(()=>{const x=y=>{y.key===ea&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),b())};return globalThis.addEventListener("keydown",x),()=>globalThis.removeEventListener("keydown",x)},[]);const g={state:p?"expanded":"collapsed",open:p,setOpen:m,isMobile:i,openMobile:d,setOpenMobile:u,toggleSidebar:h};return o(Kt.Provider,{value:g,children:o("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ys,"--sidebar-width-icon":Xs,...n},className:L("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...l,children:r})})}function sa({side:t="left",variant:e="sidebar",collapsible:s="offcanvas",className:a,children:n,dir:r,...l}){const{isMobile:i,state:d,openMobile:u,setOpenMobile:c}=ht();return s==="none"?o("div",{"data-slot":"sidebar",className:L("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...l,children:n}):i?o(Zs,{open:u,onOpenChange:c,...l,children:w(Ws,{dir:r,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Js},side:t,children:[w(js,{className:"sr-only",children:[o(Us,{children:"Sidebar"}),o(Ks,{children:"Displays the mobile sidebar."})]}),o("div",{className:"flex h-full w-full flex-col",children:n})]})}):w("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?s:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[o("div",{"data-slot":"sidebar-gap",className:L("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o("div",{"data-slot":"sidebar-container","data-side":t,className:L("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",a),...l,children:o("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n})})]})}function aa(t){const e=k(15);let s,a,n;e[0]!==t?({className:s,onClick:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);const{toggleSidebar:r}=ht();let l;e[4]!==s?(l=L(s),e[4]=s,e[5]=l):l=e[5];let i;e[6]!==a||e[7]!==r?(i=f=>{a?.(f),r()},e[6]=a,e[7]=r,e[8]=i):i=e[8];let d,u;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=o(Ht,{icon:fs,strokeWidth:2,className:"rtl:rotate-180"}),u=o("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=d,e[10]=u):(d=e[9],u=e[10]);let c;return e[11]!==n||e[12]!==l||e[13]!==i?(c=w(Vt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:l,onClick:i,...n,children:[d,u]}),e[11]=n,e[12]=l,e[13]=i,e[14]=c):c=e[14],c}function oa(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("main",{"data-slot":"sidebar-inset",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function na(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function ra(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function la(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function ia(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("relative flex w-full min-w-0 flex-col p-2",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function da(t){const e=k(10);let s,a,n,r;if(e[0]!==t){const{className:d,render:u,...c}=t;s=u,r=zt,a="div",n=Bt({className:L("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",d)},c),e[0]=t,e[1]=s,e[2]=a,e[3]=n,e[4]=r}else s=e[1],a=e[2],n=e[3],r=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=l):l=e[5];let i;return e[6]!==s||e[7]!==a||e[8]!==n?(i={defaultTagName:a,props:n,render:s,state:l},e[6]=s,e[7]=a,e[8]=n,e[9]=i):i=e[9],r(i)}function ca(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("w-full text-xs",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function Pt(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("flex w-full min-w-0 flex-col gap-0",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}function _t(t){const e=k(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let n;e[3]!==s?(n=L("group/menu-item relative",s),e[3]=s,e[4]=n):n=e[4];let r;return e[5]!==a||e[6]!==n?(r=o("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...a}),e[5]=a,e[6]=n,e[7]=r):r=e[7],r}const ua=hs("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Gt({render:t,isActive:e=!1,variant:s="default",size:a="default",tooltip:n,className:r,...l}){const{isMobile:i,state:d}=ht(),u=zt({defaultTagName:"button",props:Bt({className:L(ua({variant:s,size:a}),r)},l),render:n?o(Is,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:e}});return n?(typeof n=="string"&&(n={children:n}),w(Rs,{children:[u,o($s,{side:"right",align:"center",hidden:d!=="collapsed"||i,...n})]})):u}const ma=t=>t.replace("__lunora_admin__:",""),fa=()=>ls(ft.subscribe,ft.getSnapshot,ft.getSnapshot),ha=t=>t==="error"?"destructive":t==="pending"?"secondary":"default",pa=t=>{const e=k(56),{entry:s,focused:a}=t,n=ee();let r;e[0]!==a?(r=I=>{I!==null&&a&&I.scrollIntoView({block:"nearest"})},e[0]=a,e[1]=r):r=e[1];const l=r;let i;e[2]!==s.functionPath||e[3]!==s.shardKey||e[4]!==s.summary?(i=()=>{bs(`${s.functionPath} ${s.summary}${s.shardKey===""?"":` (shard ${s.shardKey})`}`)},e[2]=s.functionPath,e[3]=s.shardKey,e[4]=s.summary,e[5]=i):i=e[5];const d=i,u=a&&"bg-accent ring-1 ring-inset ring-primary/40";let c;e[6]!==u?(c=L("border-b border-border/60 last:border-b-0",u),e[6]=u,e[7]=c):c=e[7];let f;e[8]!==s.status?(f=ha(s.status),e[8]=s.status,e[9]=f):f=e[9];const p=s.status==="pending"?"…":s.status;let m;e[10]!==f||e[11]!==p?(m=o(dt,{className:"mt-px shrink-0",variant:f,children:p}),e[10]=f,e[11]=p,e[12]=m):m=e[12];let h;e[13]!==s.functionPath?(h=ma(s.functionPath),e[13]=s.functionPath,e[14]=h):h=e[14];let b;e[15]!==h?(b=o("span",{className:"shrink-0 font-mono text-[11px] text-foreground",children:h}),e[15]=h,e[16]=b):b=e[16];let v;e[17]!==s.kind||e[18]!==n?(v=s.kind==="subscription"&&o(dt,{className:"shrink-0",variant:"outline",children:n("live")}),e[17]=s.kind,e[18]=n,e[19]=v):v=e[19];let g;e[20]!==s.summary?(g=s.summary!==""&&o("span",{className:"min-w-0 truncate text-muted-foreground",children:s.summary}),e[20]=s.summary,e[21]=g):g=e[21];let x;e[22]!==s.shardKey?(x=s.shardKey!==""&&o("span",{className:"font-mono",children:s.shardKey}),e[22]=s.shardKey,e[23]=x):x=e[23];let y;e[24]!==s.resultCount||e[25]!==n?(y=s.resultCount!==void 0&&o("span",{children:n("{count} rows",{count:s.resultCount})}),e[24]=s.resultCount,e[25]=n,e[26]=y):y=e[26];let M;e[27]!==s.pushes||e[28]!==n?(M=s.pushes!==void 0&&s.pushes>0&&o("span",{children:n("{count} pushes",{count:s.pushes})}),e[27]=s.pushes,e[28]=n,e[29]=M):M=e[29];let S;e[30]!==s.durationMs?(S=s.durationMs!==void 0&&w("span",{children:[s.durationMs,"ms"]}),e[30]=s.durationMs,e[31]=S):S=e[31];let P;e[32]!==n?(P=n("Copy"),e[32]=n,e[33]=P):P=e[33];let N;e[34]!==d||e[35]!==P?(N=o("button",{"aria-label":P,className:"rounded px-1 outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-copy",onClick:d,type:"button",children:"⧉"}),e[34]=d,e[35]=P,e[36]=N):N=e[36];let T;e[37]!==x||e[38]!==y||e[39]!==M||e[40]!==S||e[41]!==N?(T=w("span",{className:"ms-auto flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[x,y,M,S,N]}),e[37]=x,e[38]=y,e[39]=M,e[40]=S,e[41]=N,e[42]=T):T=e[42];let _;e[43]!==v||e[44]!==g||e[45]!==T||e[46]!==m||e[47]!==b?(_=w("div",{className:"flex items-start gap-2 px-3 py-1.5 text-xs",children:[m,b,v,g,T]}),e[43]=v,e[44]=g,e[45]=T,e[46]=m,e[47]=b,e[48]=_):_=e[48];let C;e[49]!==s.error?(C=s.error!==void 0&&o("p",{className:"px-3 pb-1.5 font-mono text-[11px] text-destructive","data-testid":"oc-error",children:s.error}),e[49]=s.error,e[50]=C):C=e[50];let E;return e[51]!==l||e[52]!==_||e[53]!==C||e[54]!==c?(E=w("li",{className:c,"data-testid":"oc-row",ref:l,children:[_,C]}),e[51]=l,e[52]=_,e[53]=C,e[54]=c,e[55]=E):E=e[55],E},ga=t=>{const e=k(62),{focusSeq:s,onClose:a,onShownChange:n,shown:r}=t,l=ee(),i=fa(),[d,u]=it("");let c;if(e[0]!==i||e[1]!==s||e[2]!==d||e[3]!==a||e[4]!==n||e[5]!==r||e[6]!==l){const f=d.trim().toLowerCase(),p=i.filter($=>(r==="errors"?$.status==="error":!0)&&(f===""||`${$.functionPath} ${$.summary} ${$.shardKey}`.toLowerCase().includes(f))).toReversed();let m;e[8]!==i?(m=i.filter(ba),e[8]=i,e[9]=m):m=e[9];const h=m.length;let b;e[10]!==l?(b=l("Operation console"),e[10]=l,e[11]=b):b=e[11];let v;e[12]!==l?(v=l("Operation console"),e[12]=l,e[13]=v):v=e[13];let g;e[14]!==v?(g=o("span",{className:"text-xs font-medium",children:v}),e[14]=v,e[15]=g):g=e[15];let x;e[16]!==i.length||e[17]!==l?(x=l("{count} calls",{count:i.length}),e[16]=i.length,e[17]=l,e[18]=x):x=e[18];let y;e[19]!==x?(y=o(dt,{variant:"secondary",children:x}),e[19]=x,e[20]=y):y=e[20];let M;e[21]!==h||e[22]!==l?(M=h>0&&o(dt,{variant:"destructive",children:l("{count} failed",{count:h})}),e[21]=h,e[22]=l,e[23]=M):M=e[23];const S=r==="errors",P=r==="errors"&&"bg-accent";let N;e[24]!==P?(N=L("rounded px-2 py-0.5 text-xs outline-none hover:bg-accent focus-visible:bg-accent",P),e[24]=P,e[25]=N):N=e[25];let T;e[26]!==n||e[27]!==r?(T=()=>{n(r==="errors"?"all":"errors")},e[26]=n,e[27]=r,e[28]=T):T=e[28];let _;e[29]!==l?(_=l("Errors"),e[29]=l,e[30]=_):_=e[30];let C;e[31]!==N||e[32]!==T||e[33]!==_||e[34]!==S?(C=o("button",{"aria-pressed":S,className:N,"data-testid":"oc-filter-errors",onClick:T,type:"button",children:_}),e[31]=N,e[32]=T,e[33]=_,e[34]=S,e[35]=C):C=e[35];let E;e[36]!==l?(E=l("Filter"),e[36]=l,e[37]=E):E=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=$=>{u($.target.value)},e[38]=I):I=e[38];let H;e[39]!==l?(H=l("Filter"),e[39]=l,e[40]=H):H=e[40];let V;e[41]!==d||e[42]!==E||e[43]!==H?(V=o($t,{"aria-label":E,className:"h-7 w-40 text-xs","data-testid":"oc-search",onChange:I,placeholder:H,value:d}),e[41]=d,e[42]=E,e[43]=H,e[44]=V):V=e[44];let O;e[45]!==l?(O=l("Clear"),e[45]=l,e[46]=O):O=e[46];let B;e[47]!==O?(B=o("button",{className:"ms-auto rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-clear",onClick:va,type:"button",children:O}),e[47]=O,e[48]=B):B=e[48];let z;e[49]!==l?(z=l("Hide"),e[49]=l,e[50]=z):z=e[50];let D;e[51]!==a||e[52]!==z?(D=o("button",{"aria-label":z,className:"rounded px-2 py-0.5 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"oc-close",onClick:a,type:"button",children:"✕"}),e[51]=a,e[52]=z,e[53]=D):D=e[53];let F;e[54]!==C||e[55]!==V||e[56]!==B||e[57]!==D||e[58]!==g||e[59]!==y||e[60]!==M?(F=w("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",children:[g,y,M,C,V,B,D]}),e[54]=C,e[55]=V,e[56]=B,e[57]=D,e[58]=g,e[59]=y,e[60]=M,e[61]=F):F=e[61],c=w("section",{"aria-label":b,className:"flex max-h-80 flex-col border-t border-border bg-card","data-testid":"lunora-operation-console",children:[F,p.length===0?o("p",{className:"p-3 text-xs text-muted-foreground","data-testid":"oc-empty",children:l("Every admin call this studio makes is recorded here.")}):o("ul",{className:"min-h-0 flex-1 overflow-y-auto","data-testid":"oc-rows",children:p.map($=>o(pa,{entry:$,focused:$.seq===s},$.seq))})]}),e[0]=i,e[1]=s,e[2]=d,e[3]=a,e[4]=n,e[5]=r,e[6]=l,e[7]=c}else c=e[7];return c};function ba(t){return t.status==="error"}function va(){ft.clear()}const xa=()=>{const t=k(310),e=ee();let s;t[0]!==e?(s=e("Health score"),t[0]=e,t[1]=s):s=t[1];let a;t[2]!==e?(a=e("Agents"),t[2]=e,t[3]=a):a=t[3];let n;t[4]!==e?(n=e("Evals"),t[4]=e,t[5]=n):n=t[5];let r;t[6]!==e?(r=e("Analytics"),t[6]=e,t[7]=r):r=t[7];let l;t[8]!==e?(l=e("API"),t[8]=e,t[9]=l):l=t[9];let i;t[10]!==e?(i=e("Audit"),t[10]=e,t[11]=i):i=t[11];let d;t[12]!==e?(d=e("Auth audit"),t[12]=e,t[13]=d):d=t[13];let u;t[14]!==e?(u=e("Configuration"),t[14]=e,t[15]=u):u=t[15];let c;t[16]!==e?(c=e("Sessions"),t[16]=e,t[17]=c):c=t[17];let f;t[18]!==e?(f=e("Containers"),t[18]=e,t[19]=f):f=t[19];let p;t[20]!==e?(p=e("Dashboards"),t[20]=e,t[21]=p):p=t[21];let m;t[22]!==e?(m=e("Data"),t[22]=e,t[23]=m):m=t[23];let h;t[24]!==e?(h=e("Deployment health"),t[24]=e,t[25]=h):h=t[25];let b;t[26]!==e?(b=e("Log drains"),t[26]=e,t[27]=b):b=t[27];let v;t[28]!==e?(v=e("Export / Import"),t[28]=e,t[29]=v):v=t[29];let g;t[30]!==e?(g=e("Fan-out"),t[30]=e,t[31]=g):g=t[31];let x;t[32]!==e?(x=e("Files"),t[32]=e,t[33]=x):x=t[33];let y;t[34]!==e?(y=e("Flags"),t[34]=e,t[35]=y):y=t[35];let M;t[36]!==e?(M=e("Functions"),t[36]=e,t[37]=M):M=t[37];let S;t[38]!==e?(S=e("Health"),t[38]=e,t[39]=S):S=t[39];let P;t[40]!==e?(P=e("Home"),t[40]=e,t[41]=P):P=t[41];let N;t[42]!==e?(N=e("Performance"),t[42]=e,t[43]=N):N=t[43];let T;t[44]!==e?(T=e("Issues"),t[44]=e,t[45]=T):T=t[45];let _;t[46]!==e?(_=e("KV"),t[46]=e,t[47]=_):_=t[47];let C;t[48]!==e?(C=e("Logs"),t[48]=e,t[49]=C):C=t[49];let E;t[50]!==e?(E=e("Metrics"),t[50]=e,t[51]=E):E=t[51];let I;t[52]!==e?(I=e("Migrations"),t[52]=e,t[53]=I):I=t[53];let H;t[54]!==e?(H=e("Notifications"),t[54]=e,t[55]=H):H=t[55];let V;t[56]!==e?(V=e("Organizations"),t[56]=e,t[57]=V):V=t[57];let O;t[58]!==e?(O=e("Time Travel"),t[58]=e,t[59]=O):O=t[59];let B;t[60]!==e?(B=e("Mail"),t[60]=e,t[61]=B):B=t[61];let z;t[62]!==e?(z=e("Payments"),t[62]=e,t[63]=z):z=t[63];let D;t[64]!==e?(D=e("Permissions"),t[64]=e,t[65]=D):D=t[65];let F;t[66]!==e?(F=e("Queues"),t[66]=e,t[67]=F):F=t[67];let $;t[68]!==e?($=e("Realtime"),t[68]=e,t[69]=$):$=t[69];let q;t[70]!==e?(q=e("RLS Policies"),t[70]=e,t[71]=q):q=t[71];let X;t[72]!==e?(X=e("Scheduled"),t[72]=e,t[73]=X):X=t[73];let W;t[74]!==e?(W=e("Schema"),t[74]=e,t[75]=W):W=t[75];let Y;t[76]!==e?(Y=e("Security"),t[76]=e,t[77]=Y):Y=t[77];let j;t[78]!==e?(j=e("Settings"),t[78]=e,t[79]=j):j=t[79];let U;t[80]!==e?(U=e("SQL editor"),t[80]=e,t[81]=U):U=t[81];let K;t[82]!==e?(K=e("Traces"),t[82]=e,t[83]=K):K=t[83];let G;t[84]!==e?(G=e("Access Rules"),t[84]=e,t[85]=G):G=t[85];let Q;t[86]!==e?(Q=e("Users"),t[86]=e,t[87]=Q):Q=t[87];let J;t[88]!==e?(J=e("Vectors"),t[88]=e,t[89]=J):J=t[89];let Z;t[90]!==e?(Z=e("Workflows"),t[90]=e,t[91]=Z):Z=t[91];let te;t[92]!==s||t[93]!==a||t[94]!==p||t[95]!==m||t[96]!==h||t[97]!==b||t[98]!==v||t[99]!==g||t[100]!==x||t[101]!==y||t[102]!==M||t[103]!==S||t[104]!==n||t[105]!==P||t[106]!==N||t[107]!==T||t[108]!==_||t[109]!==C||t[110]!==E||t[111]!==I||t[112]!==H||t[113]!==V||t[114]!==O||t[115]!==r||t[116]!==B||t[117]!==z||t[118]!==D||t[119]!==F||t[120]!==$||t[121]!==q||t[122]!==X||t[123]!==W||t[124]!==Y||t[125]!==j||t[126]!==l||t[127]!==U||t[128]!==K||t[129]!==G||t[130]!==Q||t[131]!==J||t[132]!==Z||t[133]!==i||t[134]!==d||t[135]!==u||t[136]!==c||t[137]!==f?(te={advisorHealth:s,agents:a,evals:n,analytics:r,api:l,audit:i,authAudit:d,authConfig:u,authSessions:c,containers:f,dashboards:p,data:m,deploymentHealth:h,drains:b,export:v,fanout:g,files:x,flags:y,functions:M,health:S,home:P,insights:N,issues:T,kv:_,logs:C,metrics:E,migrations:I,notifications:H,organizations:V,pitr:O,mail:B,payments:z,permissions:D,queues:F,realtime:$,rls:q,schedule:X,schema:W,security:Y,settings:j,sql:U,traces:K,storageRules:G,users:Q,vectors:J,workflows:Z},t[92]=s,t[93]=a,t[94]=p,t[95]=m,t[96]=h,t[97]=b,t[98]=v,t[99]=g,t[100]=x,t[101]=y,t[102]=M,t[103]=S,t[104]=n,t[105]=P,t[106]=N,t[107]=T,t[108]=_,t[109]=C,t[110]=E,t[111]=I,t[112]=H,t[113]=V,t[114]=O,t[115]=r,t[116]=B,t[117]=z,t[118]=D,t[119]=F,t[120]=$,t[121]=q,t[122]=X,t[123]=W,t[124]=Y,t[125]=j,t[126]=l,t[127]=U,t[128]=K,t[129]=G,t[130]=Q,t[131]=J,t[132]=Z,t[133]=i,t[134]=d,t[135]=u,t[136]=c,t[137]=f,t[138]=te):te=t[138];const pt=te;let oe;t[139]!==e?(oe=e("Advisors"),t[139]=e,t[140]=oe):oe=t[140];let ne;t[141]!==e?(ne=e("Auth"),t[141]=e,t[142]=ne):ne=t[142];let re;t[143]!==e?(re=e("Database"),t[143]=e,t[144]=re):re=t[144];let le;t[145]!==e?(le=e("Functions"),t[145]=e,t[146]=le):le=t[146];let ie;t[147]!==e?(ie=e("Observability"),t[147]=e,t[148]=ie):ie=t[148];let de;t[149]!==e?(de=e("Operations"),t[149]=e,t[150]=de):de=t[150];let ce;t[151]!==e?(ce=e("Overview"),t[151]=e,t[152]=ce):ce=t[152];let ue;t[153]!==e?(ue=e("Settings"),t[153]=e,t[154]=ue):ue=t[154];let me;t[155]!==e?(me=e("Storage"),t[155]=e,t[156]=me):me=t[156];let ct;t[157]!==oe||t[158]!==ne||t[159]!==re||t[160]!==le||t[161]!==ie||t[162]!==de||t[163]!==ce||t[164]!==ue||t[165]!==me?(ct={advisors:oe,auth:ne,database:re,functions:le,observability:ie,operations:de,overview:ce,settings:ue,storage:me},t[157]=oe,t[158]=ne,t[159]=re,t[160]=le,t[161]=ie,t[162]=de,t[163]=ce,t[164]=ue,t[165]=me,t[166]=ct):ct=t[166];const gt=ct;let fe;t[167]!==e?(fe=e("Score your app's advisor findings: a grade, the coverage split, and every procedure ranked worst-first."),t[167]=e,t[168]=fe):fe=t[168];let he;t[169]!==e?(he=e("Inspect agent threads, message timelines, tool calls, and token usage."),t[169]=e,t[170]=he):he=t[170];let pe;t[171]!==e?(pe=e("Scores recorded by recordEvaluation — the latest verdict per eval, its trend, and the graded runs behind it."),t[171]=e,t[172]=pe):pe=t[172];let ge;t[173]!==e?(ge=e("Usage and latency from Analytics Engine — request volume, p50/p95, and hot shards."),t[173]=e,t[174]=ge):ge=t[174];let be;t[175]!==e?(be=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[175]=e,t[176]=be):be=t[176];let ve;t[177]!==e?(ve=e("A durable log of admin state-changing operations."),t[177]=e,t[178]=ve):ve=t[178];let xe;t[179]!==e?(xe=e("Authentication and security events — sign-ins, MFA, and session changes."),t[179]=e,t[180]=xe):xe=t[180];let ye;t[181]!==e?(ye=e("Enabled plugins and session config (read-only)."),t[181]=e,t[182]=ye):ye=t[182];let we;t[183]!==e?(we=e("Browse and revoke active sessions across all users."),t[183]=e,t[184]=we):we=t[184];let ke;t[185]!==e?(ke=e("Live Cloudflare Containers — current lifecycle state per instance from the log stream."),t[185]=e,t[186]=ke):ke=t[186];let Ne;t[187]!==e?(Ne=e("Chart widgets backed by saved read-only SQL queries."),t[187]=e,t[188]=Ne):Ne=t[188];let Me;t[189]!==e?(Me=e("Browse and edit rows across your shard and global tables."),t[189]=e,t[190]=Me):Me=t[190];let Se;t[191]!==e?(Se=e("Live liveness, readiness, and per-binding health from the deployment's /_lunora/health endpoint."),t[191]=e,t[192]=Se):Se=t[192];let Ce;t[193]!==e?(Ce=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[193]=e,t[194]=Ce):Ce=t[194];let Pe;t[195]!==e?(Pe=e("Export a shard to NDJSON, or import rows from it."),t[195]=e,t[196]=Pe):Pe=t[196];let _e;t[197]!==e?(_e=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[197]=e,t[198]=_e):_e=t[198];let Te;t[199]!==e?(Te=e("Browse objects in your R2 storage buckets."),t[199]=e,t[200]=Te):Te=t[200];let Le;t[201]!==e?(Le=e("Inspect feature flags and their live evaluation under a targeting context."),t[201]=e,t[202]=Le):Le=t[202];let Ae;t[203]!==e?(Ae=e("Run registered queries, mutations, and actions."),t[203]=e,t[204]=Ae):Ae=t[204];let Ee;t[205]!==e?(Ee=e("At-a-glance connection, error, and shard signals."),t[205]=e,t[206]=Ee):Ee=t[206];let Re;t[207]!==e?(Re=e("Connection, health, and advisor summary for your deployment."),t[207]=e,t[208]=Re):Re=t[208];let Ie;t[209]!==e?(Ie=e("Surface slow functions, error spikes, and cache problems."),t[209]=e,t[210]=Ie):Ie=t[210];let $e;t[211]!==e?($e=e("Grouped error triage — Worker throws and container crashes folded by fingerprint."),t[211]=e,t[212]=$e):$e=t[212];let He;t[213]!==e?(He=e("A live stream of recent function logs."),t[213]=e,t[214]=He):He=t[214];let Be;t[215]!==e?(Be=e("Per-shard health and aggregate metrics."),t[215]=e,t[216]=Be):Be=t[216];let ze;t[217]!==e?(ze=e("Review migration status and run them."),t[217]=e,t[218]=ze):ze=t[218];let Ve;t[219]!==e?(Ve=e("Registered push devices — endpoint, kind, last-send status, and delivery errors."),t[219]=e,t[220]=Ve):Ve=t[220];let Oe;t[221]!==e?(Oe=e("Browse and manage organizations, members, and invitations."),t[221]=e,t[222]=Oe):Oe=t[222];let De;t[223]!==e?(De=e("Restore a shard to a point in the last 30 days."),t[223]=e,t[224]=De):De=t[224];let Ze;t[225]!==e?(Ze=e("Email your app sent, captured in dev."),t[225]=e,t[226]=Ze):Ze=t[226];let Fe;t[227]!==e?(Fe=e("Synced customers, subscriptions, and webhook events."),t[227]=e,t[228]=Fe):Fe=t[228];let qe;t[229]!==e?(qe=e("Inspect access policies per table, and probe a function as any identity."),t[229]=e,t[230]=qe):qe=t[230];let We;t[231]!==e?(We=e("Inspect declared Cloudflare Queues — their producer bindings, consumer mode, and dead-letter queue."),t[231]=e,t[232]=We):We=t[232];let je;t[233]!==e?(je=e("Active WebSocket subscriptions on this shard."),t[233]=e,t[234]=je):je=t[234];let Ue;t[235]!==e?(Ue=e("Inspect row-level-security policies and roles, per table."),t[235]=e,t[236]=Ue):Ue=t[236];let Ke;t[237]!==e?(Ke=e("Inspect and cancel scheduled jobs."),t[237]=e,t[238]=Ke):Ke=t[238];let Ge;t[239]!==e?(Ge=e("Inspect each table and its columns."),t[239]=e,t[240]=Ge):Ge=t[240];let Qe;t[241]!==e?(Qe=e("Review admin gates, credentials, and log redaction."),t[241]=e,t[242]=Qe):Qe=t[242];let Ye;t[243]!==e?(Ye=e("Read-only deployment config — vars, secrets, and bindings."),t[243]=e,t[244]=Ye):Ye=t[244];let Je;t[245]!==e?(Je=e("Run read-only SQL against a shard."),t[245]=e,t[246]=Je):Je=t[246];let Xe;t[247]!==e?(Xe=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[247]=e,t[248]=Xe):Xe=t[248];let et;t[249]!==e?(et=e("Inspect storage access rules — per bucket, operation, and key prefix."),t[249]=e,t[250]=et):et=t[250];let tt;t[251]!==e?(tt=e("Recent ctx.trace waterfalls for this shard — the drill-down from a log line."),t[251]=e,t[252]=tt):tt=t[252];let st;t[253]!==e?(st=e("Manage auth users — roles, bans, sessions, and identity."),t[253]=e,t[254]=st):st=t[254];let at;t[255]!==e?(at=e("Browse Vectorize indexes and run similarity searches."),t[255]=e,t[256]=at):at=t[256];let ot;t[257]!==e?(ot=e("Inspect declared Cloudflare Workflows and their bindings."),t[257]=e,t[258]=ot):ot=t[258];let ut;t[259]!==st||t[260]!==at||t[261]!==ot||t[262]!==fe||t[263]!==he||t[264]!==pe||t[265]!==ge||t[266]!==be||t[267]!==ve||t[268]!==xe||t[269]!==ye||t[270]!==we||t[271]!==ke||t[272]!==Ne||t[273]!==Me||t[274]!==Se||t[275]!==Ce||t[276]!==Pe||t[277]!==_e||t[278]!==Te||t[279]!==Le||t[280]!==Ae||t[281]!==Ee||t[282]!==Re||t[283]!==Ie||t[284]!==$e||t[285]!==He||t[286]!==Be||t[287]!==ze||t[288]!==Ve||t[289]!==Oe||t[290]!==De||t[291]!==Ze||t[292]!==Fe||t[293]!==qe||t[294]!==We||t[295]!==je||t[296]!==Ue||t[297]!==Ke||t[298]!==Ge||t[299]!==Qe||t[300]!==Ye||t[301]!==Je||t[302]!==Xe||t[303]!==et||t[304]!==tt?(ut={advisorHealth:fe,agents:he,evals:pe,analytics:ge,api:be,audit:ve,authAudit:xe,authConfig:ye,authSessions:we,containers:ke,dashboards:Ne,data:Me,deploymentHealth:Se,drains:Ce,export:Pe,fanout:_e,files:Te,flags:Le,functions:Ae,health:Ee,home:Re,insights:Ie,issues:$e,logs:He,metrics:Be,migrations:ze,notifications:Ve,organizations:Oe,pitr:De,mail:Ze,payments:Fe,permissions:qe,queues:We,realtime:je,rls:Ue,schedule:Ke,schema:Ge,security:Qe,settings:Ye,sql:Je,kv:Xe,storageRules:et,traces:tt,users:st,vectors:at,workflows:ot},t[259]=st,t[260]=at,t[261]=ot,t[262]=fe,t[263]=he,t[264]=pe,t[265]=ge,t[266]=be,t[267]=ve,t[268]=xe,t[269]=ye,t[270]=we,t[271]=ke,t[272]=Ne,t[273]=Me,t[274]=Se,t[275]=Ce,t[276]=Pe,t[277]=_e,t[278]=Te,t[279]=Le,t[280]=Ae,t[281]=Ee,t[282]=Re,t[283]=Ie,t[284]=$e,t[285]=He,t[286]=Be,t[287]=ze,t[288]=Ve,t[289]=Oe,t[290]=De,t[291]=Ze,t[292]=Fe,t[293]=qe,t[294]=We,t[295]=je,t[296]=Ue,t[297]=Ke,t[298]=Ge,t[299]=Qe,t[300]=Ye,t[301]=Je,t[302]=Xe,t[303]=et,t[304]=tt,t[305]=ut):ut=t[305];const bt=ut;let mt;return t[306]!==gt||t[307]!==bt||t[308]!==pt?(mt={groupLabel:gt,tabDescription:bt,tabLabel:pt},t[306]=gt,t[307]=bt,t[308]=pt,t[309]=mt):mt=t[309],mt},ya=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[o("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"}),o("path",{d:"M8 21h8M12 17v4"})]}),t[0]=e):e=t[0],e},wa=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[o("circle",{cx:"12",cy:"12",r:"4"}),o("path",{d:"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),t[0]=e):e=t[0],e},ka=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:o("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),t[0]=e):e=t[0],e},Na=[{Icon:ya,value:"system"},{Icon:wa,value:"light"},{Icon:ka,value:"dark"}],Ma=()=>{const t=k(19),{theme:e,setTheme:s}=Es(),a=ee();let n;t[0]!==a?(n=a("Dark theme"),t[0]=a,t[1]=n):n=t[1];let r;t[2]!==a?(r=a("Light theme"),t[2]=a,t[3]=r):r=t[3];let l;t[4]!==a?(l=a("System theme"),t[4]=a,t[5]=l):l=t[5];let i;t[6]!==n||t[7]!==r||t[8]!==l?(i={dark:n,light:r,system:l},t[6]=n,t[7]=r,t[8]=l,t[9]=i):i=t[9];const d=i;let u;t[10]!==a?(u=a("Theme"),t[10]=a,t[11]=u):u=t[11];let c;t[12]!==d||t[13]!==s||t[14]!==e?(c=Na.map(p=>{const{Icon:m,value:h}=p,b=e===h;return w("button",{"aria-checked":b,"aria-label":d[h],className:L("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",b?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${h}`,onClick:()=>{s(h)},role:"radio",title:d[h],type:"button",children:[b&&o(Ns.span,{className:"absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",layoutId:"studio-theme-active",transition:{bounce:.1,duration:.45,type:"spring"}}),o("span",{className:"relative",children:o(m,{})})]},h)}),t[12]=d,t[13]=s,t[14]=e,t[15]=c):c=t[15];let f;return t[16]!==u||t[17]!==c?(f=o("div",{"aria-label":u,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",role:"radiogroup",children:c}),t[16]=u,t[17]=c,t[18]=f):f=t[18],f},Sa=t=>{const e=k(23),{domain:s,onOpenCommandPalette:a,page:n}=t,r=ee();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=o(aa,{className:"-ms-1"}),e[0]=l):l=e[0];let i;e[1]!==r?(i=r("Breadcrumb"),e[1]=r,e[2]=i):i=e[2];let d;e[3]!==s?(d=o("span",{className:"text-muted-foreground",children:s}),e[3]=s,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=o("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:o("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"})}),e[5]=u):u=e[5];let c;e[6]!==n?(c=o("span",{className:"font-medium text-foreground",children:n}),e[6]=n,e[7]=c):c=e[7];let f;e[8]!==i||e[9]!==d||e[10]!==c?(f=w("nav",{"aria-label":i,className:"flex items-center gap-1.5 text-[13px]",children:[d,u,c]}),e[8]=i,e[9]=d,e[10]=c,e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=w("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[o("circle",{cx:"11",cy:"11",r:"7"}),o("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"})]}),e[12]=p):p=e[12];let m;e[13]!==r?(m=r("Search…"),e[13]=r,e[14]=m):m=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=o("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"⌘K"}),e[15]=h):h=e[15];let b;e[16]!==a||e[17]!==m?(b=w("button",{className:"mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex","data-testid":"dash-app-search",onClick:a,type:"button",children:[p,m,h]}),e[16]=a,e[17]=m,e[18]=b):b=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=o("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:o(Ma,{})}),e[19]=v):v=e[19];let g;return e[20]!==b||e[21]!==f?(g=w("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[l,f,b,v]}),e[20]=b,e[21]=f,e[22]=g):g=e[22],g},Ca=t=>{const e=k(4),{console:s}=Ms();let a,n;e[0]!==s||e[1]!==t?(a=()=>{if(t===void 0)return;const r=l=>{if(!l.ctrlKey||l.metaKey||l.altKey||l.shiftKey||l.repeat||l.key.toLowerCase()!==s)return;const{target:i}=l;i instanceof HTMLElement&&(i.isContentEditable||["INPUT","SELECT","TEXTAREA"].includes(i.tagName))||(l.preventDefault(),t())};return globalThis.addEventListener("keydown",r),()=>{globalThis.removeEventListener("keydown",r)}},n=[s,t],e[0]=s,e[1]=t,e[2]=a,e[3]=n):(a=e[2],n=e[3]),rt(a,n)},R=(t,e)=>A(()=>t().then(s=>({default:s[e]}))),Pa=R(()=>import("../packem_chunks/InsightsPanel.js"),"InsightsPanel"),_a=A(()=>import("../packem_chunks/rls-panel.js")),Ta=A(()=>import("../packem_chunks/AdvisorHealthPanel.js")),La=A(()=>import("../packem_chunks/SecurityAdvisorPanel.js")),Aa=A(()=>import("../packem_chunks/agents-panel.js")),Ea=R(()=>import("../packem_chunks/analytics-panel.js"),"AnalyticsPanel"),Ra=A(()=>import("../packem_chunks/ApiTab.js")),Ia=A(()=>import("../packem_chunks/auth-audit-panel.js")),$a=A(()=>import("../packem_chunks/auth-config-panel.js")),Ha=A(()=>import("../packem_chunks/auth-sessions-panel.js")),Ba=A(()=>import("../packem_chunks/organizations-panel.js")),za=R(()=>import("../packem_chunks/users-panel.js"),"UsersPanel"),Va=A(()=>import("../packem_chunks/containers-panel.js")),Oa=R(()=>import("../packem_chunks/DeploymentHealthPanel.js"),"DeploymentHealthPanel"),Da=R(()=>import("../packem_chunks/TableEditor.js"),"TableEditor"),Za=R(()=>import("../packem_chunks/ExportImportPanel.js"),"ExportImportPanel"),Fa=A(()=>import("../packem_chunks/migrations-route.js")),qa={data:ys,migrations:xs},Wa=R(()=>import("../packem_chunks/PitrPanel.js"),"PitrPanel"),ja=A(()=>import("../packem_chunks/flags-panel.js")),Ua=R(()=>import("../packem_chunks/FunctionRunner.js"),"FunctionRunner"),Ka=R(()=>import("../packem_chunks/FunctionStatsPanel.js"),"FunctionStatsPanel"),Ga=A(()=>import("../packem_chunks/issues-panel.js")),Qa=R(()=>import("../packem_chunks/AuditPanel.js"),"AuditPanel"),Ya=A(()=>import("../packem_chunks/log-drains-panel.js")),Ja=A(()=>import("../packem_chunks/LogsPanel.js").then(t=>({default:t.LogsPanel}))),Xa=R(()=>import("../packem_chunks/MailPanel.js"),"MailPanel"),eo=R(()=>import("../packem_chunks/schedule-panel.js"),"SchedulePanel"),to=A(()=>import("../packem_chunks/subscriptions-panel.js")),so=A(()=>import("../packem_chunks/sync-client-panel.js")),ao=R(()=>import("../packem_chunks/kv-browser.js"),"KvBrowser"),oo=A(()=>import("../packem_chunks/NotificationsPanel.js")),no=R(()=>import("../packem_chunks/payments-panel.js"),"PaymentsPanel"),ro=R(()=>import("../packem_chunks/permissions-panel.js"),"PermissionsPanel"),lo=A(()=>import("../packem_chunks/queues-panel.js")),io=A(()=>import("../packem_chunks/dashboards-panel.js")),co=A(()=>import("../packem_chunks/fanout-panel.js")),uo=R(()=>import("../packem_chunks/HealthPanel.js"),"HealthPanel"),mo=R(()=>import("../packem_chunks/MetricsPanel.js"),"MetricsPanel"),fo=R(()=>import("../packem_chunks/SchemaViewer.js"),"SchemaViewer"),ho=R(()=>import("../packem_chunks/SettingsPanel.js"),"SettingsPanel"),po=R(()=>import("../packem_chunks/SqlEditorPanel.js"),"SqlEditorPanel"),go=R(()=>import("../packem_chunks/FileBrowser.js"),"FileBrowser"),bo=A(()=>import("../packem_chunks/storage-rules-panel.js")),vo=A(()=>import("../packem_chunks/traces-panel.js")),xo=A(()=>import("../packem_chunks/evals-panel.js")),yo=R(()=>import("../packem_chunks/vector-browser.js"),"VectorBrowser"),wo=A(()=>import("../packem_chunks/workflows-panel.js")),Qt=Et(null),ko={analytics:o("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),api:o("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"}),audit:o("path",{d:"M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"}),authAudit:o("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8h6m-6 3h6"}),authConfig:o("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),agents:o("path",{d:"M12 8V5m0 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM6 8h12a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2Zm3 5h.01M15 13h.01M9 21h6"}),authSessions:o("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),containers:o("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"}),dashboards:o("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"}),deploymentHealth:o("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2 3 4-5"}),drains:o("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"}),data:o("path",{d:"M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"}),export:o("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}),fanout:o("path",{d:"M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"}),files:o("path",{d:"M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"}),flags:o("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"}),functions:o("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"}),evals:o("path",{d:"M4 19V5m0 14h16M8 15l3-4 3 3 4-6M8 15v.01"}),health:o("path",{d:"M3 12h4l2 6 4-14 2 8h6"}),home:o("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"}),insights:o("path",{d:"M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"}),issues:o("path",{d:"M10.3 4.3 2.5 18a2 2 0 0 0 1.7 3h15.6a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0ZM12 9v4m0 3v.01"}),kv:o("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"}),logs:o("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"}),mail:o("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"}),payments:o("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"}),metrics:o("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"}),migrations:o("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"}),notifications:o("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3A6 6 0 0 0 6 11v3.2a2 2 0 0 1-.6 1.4L4 17h5m6 0v1a3 3 0 1 1-6 0v-1m6 0H9"}),organizations:o("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"}),permissions:o("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"}),pitr:o("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"}),queues:o("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"}),realtime:o("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}),rls:o("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"}),schedule:o("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"}),schema:o("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"}),sql:o("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"}),storageRules:o("path",{d:"M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"}),advisorHealth:o("path",{d:"M3 12h4l2-5 3 10 2-5h5"}),security:o("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"}),traces:o("path",{d:"M3 6h9M6 12h12M10 18h7"}),settings:o("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"}),users:o("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"}),vectors:o("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"}),workflows:o("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"})},Tt=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","workflows","agents","queues"]},{key:"auth",tabs:["users","organizations","authSessions","authAudit","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["issues","logs","traces","evals","audit","realtime","fanout","containers","metrics","analytics","health","deploymentHealth"]},{key:"advisors",tabs:["advisorHealth","security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","notifications","payments","flags"]},{key:"settings",tabs:["settings"]}],No={analytics:"analytics",authAudit:"auth",authConfig:"auth",authSessions:"auth",containers:"containers",files:"storage",flags:"flags",kv:"kv",mail:"mail",notifications:"notifications",organizations:"auth",payments:"payments",queues:"queues",schedule:"scheduler",storageRules:"storage",users:"auth",vectors:"vectors",workflows:"workflows"},Lt=(t,e)=>{const s=No[t];return s===void 0||e[s]},kt=t=>{const e=k(2),{tab:s}=t,a=ko[s];let n;return e[0]!==a?(n=o("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:a}),e[0]=a,e[1]=n):n=e[1],n},Mo=t=>t,Yt=Mo(["home","data","sql","functions","api","workflows","agents","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authAudit","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","deploymentHealth","advisorHealth","security","rls","permissions","insights","issues","logs","traces","evals","realtime","fanout","mail","notifications","payments","audit","schedule","drains","flags","settings"]),So=new Set(["api","data","migrations","sql"]),Co=t=>{const e=t.split("/").findLast(Boolean)??"";return Yt.includes(e)?e:"home"},Po=t=>{const e=k(19),{chrome:s,connected:a}=t,n=ee();let r;e[0]!==n?(r=n("admin token"),e[0]=n,e[1]=r):r=e[1];let l;e[2]!==r?(l=o("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:r}),e[2]=r,e[3]=l):l=e[3];let i;e[4]!==s.onTokenChange||e[5]!==s.token?(i=o($t,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:s.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:s.token}),e[4]=s.onTokenChange,e[5]=s.token,e[6]=i):i=e[6];let d;e[7]!==a||e[8]!==n?(d=a&&w("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[o("span",{"aria-hidden":"true",className:"text-warning",children:"⚠"}),n("Token rides the WebSocket URL — it can surface in browser DevTools and server logs. Use a dev-only token.")]}),e[7]=a,e[8]=n,e[9]=d):d=e[9];let u;e[10]!==s.clearToken||e[11]!==a||e[12]!==n?(u=a&&o("button",{className:"self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"dash-app-clear-token",onClick:s.clearToken,type:"button",children:n("Clear")}),e[10]=s.clearToken,e[11]=a,e[12]=n,e[13]=u):u=e[13];let c;return e[14]!==l||e[15]!==i||e[16]!==d||e[17]!==u?(c=w("div",{className:"flex flex-col gap-2",children:[l,i,d,u]}),e[14]=l,e[15]=i,e[16]=d,e[17]=u,e[18]=c):c=e[18],c},_o=t=>{const e=k(25),{current:s,group:a,groupLabel:n,selectTab:r,tabDescription:l,tabLabel:i}=t,d=a.tabs.includes(s)?"page":void 0,u=n[a.key],c=a.tabs[0];let f;e[0]!==c?(f=o(kt,{tab:c}),e[0]=c,e[1]=f):f=e[1];let p;e[2]!==d||e[3]!==u||e[4]!==f?(p=o(jt,{"aria-current":d,"aria-label":u,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:f}),e[2]=d,e[3]=u,e[4]=f,e[5]=p):p=e[5];const m=n[a.key];let h;e[6]!==m?(h=o("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:m}),e[6]=m,e[7]=h):h=e[7];let b;if(e[8]!==s||e[9]!==a.tabs||e[10]!==r||e[11]!==l||e[12]!==i){let x;e[14]!==s||e[15]!==r||e[16]!==l||e[17]!==i?(x=y=>w("button",{"aria-current":s===y?"page":void 0,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100","data-tab":y,"data-testid":`dash-tab-${y}`,onClick:r,title:l[y],type:"button",children:[o(kt,{tab:y}),o("span",{children:i[y]})]},y),e[14]=s,e[15]=r,e[16]=l,e[17]=i,e[18]=x):x=e[18],b=a.tabs.map(x),e[8]=s,e[9]=a.tabs,e[10]=r,e[11]=l,e[12]=i,e[13]=b}else b=e[13];let v;e[19]!==h||e[20]!==b?(v=w(Ut,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[h,b]}),e[19]=h,e[20]=b,e[21]=v):v=e[21];let g;return e[22]!==p||e[23]!==v?(g=w(Wt,{children:[p,v]}),e[22]=p,e[23]=v,e[24]=g):g=e[24],g},To=t=>{const e=k(45),{chrome:s,collapsed:a,connected:n}=t,r=ee();if(s===null){let y;e[0]!==r?(y=r("Admin"),e[0]=r,e[1]=y):y=e[1];let M;e[2]===Symbol.for("react.memo_cache_sentinel")?(M=o("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"}),e[2]=M):M=e[2];let S;e[3]!==r?(S=r("Admin"),e[3]=r,e[4]=S):S=e[4];let P;e[5]!==S?(P=o("span",{className:"truncate text-[13px] font-medium",children:S}),e[5]=S,e[6]=P):P=e[6];let N;e[7]!==r?(N=r("Studio"),e[7]=r,e[8]=N):N=e[8];let T;e[9]!==N?(T=o("span",{className:"truncate text-[11px] text-muted-foreground",children:N}),e[9]=N,e[10]=T):T=e[10];let _;e[11]!==P||e[12]!==T?(_=w("span",{className:"grid flex-1 text-start leading-tight",children:[P,T]}),e[11]=P,e[12]=T,e[13]=_):_=e[13];let C;return e[14]!==y||e[15]!==_?(C=w(Gt,{className:"data-active:bg-transparent",size:"lg",tooltip:y,children:[M,_]}),e[14]=y,e[15]=_,e[16]=C):C=e[16],C}const l=a?"mx-auto size-8 justify-center":"w-full p-2";let i;e[17]!==l?(i=L("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",l),e[17]=l,e[18]=i):i=e[18];let d;e[19]!==n||e[20]!==r?(d=r(n?"Connected":"Not connected"),e[19]=n,e[20]=r,e[21]=d):d=e[21];const u=n?"bg-success":"bg-muted-foreground/50";let c;e[22]!==u?(c=L("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",u),e[22]=u,e[23]=c):c=e[23];let f;e[24]!==c?(f=w("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",o("span",{"aria-hidden":"true",className:c})]}),e[24]=c,e[25]=f):f=e[25];let p;e[26]!==a||e[27]!==n||e[28]!==r?(p=!a&&w(Rt,{children:[w("span",{className:"grid flex-1 text-start leading-tight",children:[o("span",{className:"truncate text-[13px] font-medium",children:r("Admin")}),o("span",{className:"truncate text-[11px] text-muted-foreground",children:r(n?"Connected":"Not connected")})]}),o("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:o("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e[26]=a,e[27]=n,e[28]=r,e[29]=p):p=e[29];let m;e[30]!==i||e[31]!==d||e[32]!==f||e[33]!==p?(m=w(jt,{className:i,"data-testid":"dash-app-connect",title:d,children:[f,p]}),e[30]=i,e[31]=d,e[32]=f,e[33]=p,e[34]=m):m=e[34];const h=a?"end":"start",b=a?"right":"top";let v;e[35]!==s||e[36]!==n?(v=o(Po,{chrome:s,connected:n}),e[35]=s,e[36]=n,e[37]=v):v=e[37];let g;e[38]!==b||e[39]!==v||e[40]!==h?(g=o(Ut,{align:h,keepMounted:!0,side:b,children:v}),e[38]=b,e[39]=v,e[40]=h,e[41]=g):g=e[41];let x;return e[42]!==g||e[43]!==m?(x=w(Wt,{children:[m,g]}),e[42]=g,e[43]=m,e[44]=x):x=e[44],x},Lo=t=>{const e=k(28),{chrome:s,connected:a,current:n,groupLabel:r,groups:l,selectTab:i,tabDescription:d,tabLabel:u}=t,c=ee(),{state:f}=ht(),p=f==="collapsed",m=p&&"justify-center px-0";let h;e[0]!==m?(h=L("flex items-center gap-2.5 px-1.5 py-1",m),e[0]=m,e[1]=h):h=e[1];let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=o(Hs,{className:"size-9 shrink-0 text-foreground"}),e[2]=b):b=e[2];let v;e[3]!==p||e[4]!==a||e[5]!==c?(v=!p&&w(Rt,{children:[w("span",{className:"grid flex-1 leading-tight",children:[o("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"}),o("span",{className:"truncate text-[11px] text-muted-foreground",children:c("Studio")})]}),o(dt,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:c(a?"Live":"Local")})]}),e[3]=p,e[4]=a,e[5]=c,e[6]=v):v=e[6];let g;e[7]!==h||e[8]!==v?(g=o(na,{children:w("div",{className:h,children:[b,v]})}),e[7]=h,e[8]=v,e[9]=g):g=e[9];let x;e[10]!==p||e[11]!==n||e[12]!==r||e[13]!==l||e[14]!==i||e[15]!==d||e[16]!==u?(x=p?l.map(P=>o(_o,{current:n,group:P,groupLabel:r,selectTab:i,tabDescription:d,tabLabel:u},P.key)):l.map(P=>w(ia,{children:[o(da,{className:"text-[11px] font-medium tracking-wider uppercase",children:r[P.key]}),o(ca,{children:o(Pt,{children:P.tabs.map(N=>o(_t,{children:w(Gt,{className:"data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]","data-tab":N,"data-testid":`dash-tab-${N}`,isActive:n===N,onClick:i,title:d[N],tooltip:d[N],children:[o(kt,{tab:N}),o("span",{children:u[N]})]})},N))})})]},P.key)),e[10]=p,e[11]=n,e[12]=r,e[13]=l,e[14]=i,e[15]=d,e[16]=u,e[17]=x):x=e[17];let y;e[18]!==x?(y=o(la,{children:x}),e[18]=x,e[19]=y):y=e[19];let M;e[20]!==s||e[21]!==p||e[22]!==a?(M=o(ra,{children:o(Pt,{children:o(_t,{children:o(To,{chrome:s,collapsed:p,connected:a})})})}),e[20]=s,e[21]=p,e[22]=a,e[23]=M):M=e[23];let S;return e[24]!==g||e[25]!==y||e[26]!==M?(S=w(sa,{collapsible:"icon",variant:"inset",children:[g,y,M]}),e[24]=g,e[25]=y,e[26]=M,e[27]=S):S=e[27],S},Jt=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=w("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[w("div",{className:"flex items-center gap-2",children:[o(vt,{className:"h-8 w-40"}),o(vt,{className:"h-8 w-24"})]}),o(vt,{className:"h-72 w-full"})]}),t[0]=e):e=t[0],e},Ao=()=>{const t=k(64),e=ee(),s=At();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:Bo},t[0]=a):a=t[0];const n=ns(a);let r,l;t[1]!==n?(r=Co(n),l=So.has(r),t[1]=n,t[2]=r,t[3]=l):(r=t[2],l=t[3]);const i=l,d=us(),u=d?.toggle;Ca(u);const c=gs(),{groupLabel:f,tabDescription:p,tabLabel:m}=xa();let h;t[4]!==c?(h=Z=>({...Z,tabs:Z.tabs.filter(te=>Lt(te,c))}),t[4]=c,t[5]=h):h=t[5];const b=Tt.map(h).filter(zo);let v,g;t[6]!==r||t[7]!==c||t[8]!==s?(v=()=>{Lt(r,c)||wt(s({replace:!0,to:"/home"}))},g=[r,c,s],t[6]=r,t[7]=c,t[8]=s,t[9]=v,t[10]=g):(v=t[9],g=t[10]),rt(v,g);let x;t[11]!==s?(x=Z=>{wt(s({to:`/${Z.currentTarget.dataset.tab??""}`}))},t[11]=s,t[12]=x):x=t[12];const y=x;let M,S;t[13]!==r||t[14]!==m?(M=()=>{typeof document<"u"&&(document.title=`${m[r]} · lunora`)},S=[r,m],t[13]=r,t[14]=m,t[15]=M,t[16]=S):(M=t[15],S=t[16]),rt(M,S);const P=b.find(Z=>Z.tabs.includes(r))??Tt[0];let N;t[17]!==f||t[18]!==m?(N=Z=>Z.tabs.map(te=>({group:f[Z.key],label:m[te],to:`/${te}`})),t[17]=f,t[18]=m,t[19]=N):N=t[19];const T=b.flatMap(N),_=u===void 0?T:[...T,{group:e("Operations"),label:e("Toggle operation console"),run:u}],C=Nt(Qt),E=C!==null&&C.token!=="";let I;t[20]!==_?(I=o(ws,{items:_}),t[20]=_,t[21]=I):I=t[21];let H;t[22]!==C||t[23]!==E||t[24]!==r||t[25]!==f||t[26]!==y||t[27]!==p||t[28]!==m||t[29]!==b?(H=o(Lo,{chrome:C,connected:E,current:r,groupLabel:f,groups:b,selectTab:y,tabDescription:p,tabLabel:m}),t[22]=C,t[23]=E,t[24]=r,t[25]=f,t[26]=y,t[27]=p,t[28]=m,t[29]=b,t[30]=H):H=t[30];const V=f[P.key],O=m[r];let B;t[31]!==V||t[32]!==O?(B=o(Sa,{domain:V,onOpenCommandPalette:ks,page:O}),t[31]=V,t[32]=O,t[33]=B):B=t[33];let z;t[34]!==C?.rulesInstalled?(z=C?.rulesInstalled===!1&&o(Vs,{}),t[34]=C?.rulesInstalled,t[35]=z):z=t[35];const D=`dash-tab-${r}`,F=i?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",$=m[r];let q;t[36]!==e||t[37]!==$?(q=e("{title} failed",{title:$}),t[36]=e,t[37]=$,t[38]=q):q=t[38];const X=m[r];let W;t[39]!==e?(W=e("Try again"),t[39]=e,t[40]=W):W=t[40];let Y;t[41]===Symbol.for("react.memo_cache_sentinel")?(Y=o(is,{fallback:o(Jt,{}),children:o(rs,{})}),t[41]=Y):Y=t[41];let j;t[42]!==r||t[43]!==q||t[44]!==X||t[45]!==W?(j=o(ds,{fallbackTitle:q,label:X,retryLabel:W,children:Y},r),t[42]=r,t[43]=q,t[44]=X,t[45]=W,t[46]=j):j=t[46];let U;t[47]!==F||t[48]!==j?(U=o("div",{className:F,children:j}),t[47]=F,t[48]=j,t[49]=U):U=t[49];let K;t[50]!==d?(K=d?.open===!0&&o(ga,{focusSeq:d.focusSeq,onClose:d.close,onShownChange:d.setShown,shown:d.shown}),t[50]=d,t[51]=K):K=t[51];let G;t[52]!==D||t[53]!==U||t[54]!==K?(G=w("div",{"aria-labelledby":D,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:[U,K]}),t[52]=D,t[53]=U,t[54]=K,t[55]=G):G=t[55];let Q;t[56]!==B||t[57]!==z||t[58]!==G?(Q=w(oa,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[B,z,G]}),t[56]=B,t[57]=z,t[58]=G,t[59]=Q):Q=t[59];let J;return t[60]!==H||t[61]!==Q||t[62]!==I?(J=w(ta,{className:"min-h-0 flex-1","data-testid":"lunora-studio",children:[I,H,Q]}),t[60]=H,t[61]=Q,t[62]=I,t[63]=J):J=t[63],J},Eo=()=>{const t=k(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o(cs,{children:o(Ao,{})}),t[0]=e):e=t[0],e},Ro=t=>{const e=k(5),{initialShardKey:s,schemaEditable:a}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const r=as(n),{table:l}=r,i=typeof l=="string"?l:void 0;let d;return e[1]!==s||e[2]!==i||e[3]!==a?(d=o(fo,{initialShardKey:s,initialTable:i,schemaEditable:a}),e[1]=s,e[2]=i,e[3]=a,e[4]=d):d=e[4],d},Io=()=>{const t=k(3),e=At();let s,a;return t[0]!==e?(s=()=>{wt(e({replace:!0,to:"/home"}))},a=[e],t[0]=e,t[1]=s,t[2]=a):(s=t[1],a=t[2]),rt(s,a),null},$o=({basePath:t,dataEditable:e=!1,functions:s,initialShardKey:a,openApiSpec:n,openRpcSpec:r,runAsIdentity:l=!1,schemaEditable:i=!1,scheduledCancel:d,scheduledCron:u,scheduledLoad:c})=>{const f=Xt({component:Eo}),p={agents:o(Aa,{initialShardKey:a}),analytics:o(Ea,{}),api:o(Ra,{functions:s,initialShardKey:a,openApiSpec:n,openRpcSpec:r}),audit:o(Qa,{initialShardKey:a}),authAudit:o(Ia,{}),authConfig:o($a,{}),authSessions:o(Ha,{}),containers:o(Va,{}),dashboards:o(io,{initialShardKey:a}),data:o(Da,{editable:e,initialShardKey:a}),deploymentHealth:o(Oa,{}),drains:o(Ya,{}),export:o(Za,{initialShardKey:a}),fanout:o(co,{initialShardKey:a}),files:o(go,{}),kv:o(ao,{}),flags:o(ja,{initialShardKey:a}),functions:w("div",{className:"flex flex-col gap-8",children:[o(Ka,{functions:s,initialShardKey:a}),o(Ua,{functions:s,runAsIdentity:l})]}),health:o(uo,{initialShardKey:a}),home:o(ps,{initialShardKey:a}),insights:o(Pa,{initialShardKey:a}),issues:o(Ga,{initialShardKey:a}),logs:o(Ja,{initialShardKey:a}),traces:o(vo,{initialShardKey:a}),evals:o(xo,{initialShardKey:a}),metrics:o(mo,{initialShardKey:a}),migrations:o(Fa,{initialShardKey:a}),notifications:o(oo,{}),organizations:o(Ba,{}),permissions:o(ro,{functions:s,runAsIdentity:l,schemaEditable:i}),pitr:o(Wa,{initialShardKey:a}),mail:o(Xa,{}),payments:o(no,{}),queues:o(lo,{}),realtime:w("div",{className:"flex flex-col gap-8",children:[o(to,{initialShardKey:a}),o(so,{})]}),rls:o(_a,{}),schedule:o(eo,{loadCronJobs:u,scheduledCancel:d,scheduledLoad:c}),schema:o(Ro,{initialShardKey:a,schemaEditable:i}),advisorHealth:o(Ta,{}),security:o(La,{}),settings:o(ho,{initialShardKey:a}),sql:o(po,{initialShardKey:a}),storageRules:o(bo,{}),users:o(za,{}),vectors:o(yo,{}),workflows:o(wo,{})},m=St({component:()=>p.home,getParentRoute:()=>f,path:"/"}),h=Yt.map(g=>St({component:()=>p[g],getParentRoute:()=>f,path:`/${g}`,validateSearch:qa[g]})),b=f.addChildren([m,...h]),v="window"in globalThis?es():ts({initialEntries:["/home"]});return ss({...t===void 0||t==="/"?{}:{basepath:t},defaultNotFoundComponent:Io,defaultPendingComponent:Jt,defaultPendingMinMs:0,defaultPendingMs:0,history:v,routeTree:b})},Ho=t=>{const e=k(17),{basePath:s,chrome:a,dataEditable:n,functions:r,initialShardKey:l,openApiSpec:i,openRpcSpec:d,runAsIdentity:u,schemaEditable:c,scheduledCancel:f,scheduledCron:p,scheduledLoad:m}=t;let h;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==l||e[4]!==i||e[5]!==d||e[6]!==u||e[7]!==f||e[8]!==p||e[9]!==m||e[10]!==c?(h=$o({basePath:s,dataEditable:n,functions:r,initialShardKey:l,openApiSpec:i,openRpcSpec:d,runAsIdentity:u,schemaEditable:c,scheduledCancel:f,scheduledCron:p,scheduledLoad:m}),e[0]=s,e[1]=n,e[2]=r,e[3]=l,e[4]=i,e[5]=d,e[6]=u,e[7]=f,e[8]=p,e[9]=m,e[10]=c,e[11]=h):h=e[11];const b=h,v=a??null;let g;e[12]!==b?(g=o(os,{router:b}),e[12]=b,e[13]=g):g=e[13];let x;return e[14]!==v||e[15]!==g?(x=o(Qt,{value:v,children:g}),e[14]=v,e[15]=g,e[16]=x):x=e[16],x},gn=t=>{const e=k(17),{basePath:s,chrome:a,dataEditable:n,functions:r,i18n:l,initialShardKey:i,locale:d,openApiSpec:u,openRpcSpec:c,runAsIdentity:f,schemaEditable:p,scheduledCancel:m,scheduledCron:h,scheduledLoad:b}=t;let v;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==r||e[4]!==i||e[5]!==u||e[6]!==c||e[7]!==f||e[8]!==m||e[9]!==h||e[10]!==b||e[11]!==p?(v=o(As,{children:o(Ho,{basePath:s,chrome:a,dataEditable:n,functions:r,initialShardKey:i,openApiSpec:u,openRpcSpec:c,runAsIdentity:f,scheduledCancel:m,scheduledCron:h,scheduledLoad:b,schemaEditable:p})}),e[0]=s,e[1]=a,e[2]=n,e[3]=r,e[4]=i,e[5]=u,e[6]=c,e[7]=f,e[8]=m,e[9]=h,e[10]=b,e[11]=p,e[12]=v):v=e[12];const g=v;if(l===void 0&&d===void 0)return g;let x;return e[13]!==l||e[14]!==d||e[15]!==g?(x=o(vs,{i18n:l,locale:d,children:g}),e[13]=l,e[14]=d,e[15]=g,e[16]=x):x=e[16],x};function Bo(t){return t.location.pathname}function zo(t){return t.tabs.length>0}export{Hs as B,gn as S,Ls as T,pn as a,Zs as b,Ws as c,js as d,Us as e,Es as u};
@@ -1 +1 @@
1
- import{a as n,s as a}from"./browser-storage-Br_bLeBt.js";const t="lunora:traces:pending-filter",i=e=>{a(t,e,"session")},c=()=>{const e=n("session");if(e!==void 0)try{const s=e.getItem(t);if(s===null)return;const r=JSON.parse(s);return typeof r.traceId!="string"?void 0:{traceId:r.traceId,...typeof r.shardKey=="string"?{shardKey:r.shardKey}:{}}}catch{return}},d=()=>{try{n("session")?.removeItem(t)}catch{}};export{d as c,c as p,i as w};
1
+ import{a as n,s as a}from"./browser-storage-BH1MxLZs.js";const t="lunora:traces:pending-filter",i=e=>{a(t,e,"session")},c=()=>{const e=n("session");if(e!==void 0)try{const s=e.getItem(t);if(s===null)return;const r=JSON.parse(s);return typeof r.traceId!="string"?void 0:{traceId:r.traceId,...typeof r.shardKey=="string"?{shardKey:r.shardKey}:{}}}catch{return}},d=()=>{try{n("session")?.removeItem(t)}catch{}};export{d as c,c as p,i as w};
@@ -1 +1 @@
1
- import{c as n}from"react/compiler-runtime";import{useNavigate as a}from"@tanstack/react-router";import{f as m}from"./internal-7bgd8inO.js";import{w as s}from"./trace-handoff-C0CFV2ix.js";const u=r=>{const t=n(3),o=a();let e;return t[0]!==o||t[1]!==r?(e=i=>{s({shardKey:r,traceId:i}),m(o({to:"/traces"}))},t[0]=o,t[1]=r,t[2]=e):e=t[2],e};export{u};
1
+ import{c as n}from"react/compiler-runtime";import{useNavigate as a}from"@tanstack/react-router";import{f as m}from"./internal-7bgd8inO.js";import{w as s}from"./trace-handoff-z9sy89Ci.js";const u=r=>{const t=n(3),o=a();let e;return t[0]!==o||t[1]!==r?(e=i=>{s({shardKey:r,traceId:i}),m(o({to:"/traces"}))},t[0]=o,t[1]=r,t[2]=e):e=t[2],e};export{u};
@@ -0,0 +1 @@
1
+ import{b as de}from"./chunk-W2JBKQNU.js";import{a as te,b as re,c as ne}from"./chunk-TPAZM36C.js";import"./chunk-ZHPDAJBM.js";import{b as Y}from"./chunk-SPDZUX4P.js";import"./chunk-7PIHTTND.js";import{a as ae}from"./chunk-H4SLAZAN.js";import"./chunk-PZ4QDWTI.js";import"./chunk-DC5AAWSA.js";import"./chunk-F7JOSNAT.js";import{a as ee}from"./chunk-VDW32UET.js";import{c as Z}from"./chunk-2UWKGSEA.js";import"./chunk-22WJHOC4.js";import"./chunk-RCZTUWG3.js";import{a as le,b as oe,c as se,d as H,e as z,f as G}from"./chunk-L4EZAHCD.js";import{a as P,e as q}from"./chunk-IYWVSMAY.js";import{d as X}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as g,d as W,f as ce,g as me}from"./chunk-R5ZTCHCE.js";var J=W(ce(),1);var t=W(me(),1);var ue={binding:"outline",secret:"destructive",var:"secondary"},pe=g((n,e)=>{if(n===void 0)return[];let u=[];return n.workerUrl!==void 0&&u.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&u.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&u.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&u.push({label:e("Version"),value:n.versionTag}),u},"ce"),ie=g(n=>{let e=(0,J.c)(18),{modifier:u,name:r,label:p}=n,A=te(),x;e[0]!==r?(x=g(o=>{if(!["Escape","Tab"].includes(o.key)){if(o.shiftKey){o.preventDefault();return}o.preventDefault(),re(r,o.key)}},"b"),e[0]=r,e[1]=x):x=e[1];let i=x,c=`set-shortcut-${r}`,m;e[2]!==p?(m=(0,t.jsx)("dt",{className:"text-muted-foreground",children:p}),e[2]=p,e[3]=m):m=e[3];let h;e[4]!==u?(h=(0,t.jsx)("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:u}),e[4]=u,e[5]=h):h=e[5];let l=`set-shortcut-input-${r}`,f=A[r],s;e[6]!==p||e[7]!==i||e[8]!==l||e[9]!==f?(s=(0,t.jsx)("input",{"aria-label":p,className:"h-7 w-12 rounded-md border border-border bg-background text-center font-mono text-xs uppercase outline-none focus-visible:border-ring","data-testid":l,onKeyDown:i,readOnly:!0,value:f}),e[6]=p,e[7]=i,e[8]=l,e[9]=f,e[10]=s):s=e[10];let a;e[11]!==h||e[12]!==s?(a=(0,t.jsxs)("dd",{className:"flex items-center gap-1.5",children:[h,s]}),e[11]=h,e[12]=s,e[13]=a):a=e[13];let d;return e[14]!==c||e[15]!==m||e[16]!==a?(d=(0,t.jsxs)("div",{className:"contents","data-testid":c,children:[m,a]}),e[14]=c,e[15]=m,e[16]=a,e[17]=d):d=e[17],d},"z"),Se=g(n=>{let e=(0,J.c)(85),{initialShardKey:u}=n,r=X(),p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={},e[0]=p):p=e[0];let A=u??"",x;e[1]!==A?(x={shardKey:A},e[1]=A,e[2]=x):x=e[2];let{data:i,error:c,errorSource:m,isLoading:h}=Z(ee.getSettings,p,x),l,f,s,a,d,o,b;if(e[3]!==c||e[4]!==m||e[5]!==i?.deploy||e[6]!==i?.settings||e[7]!==r){let Q=pe(i?.deploy,r),M;e[15]!==i?.settings?(M=i?.settings??[],e[15]=i?.settings,e[16]=M):M=e[16],l=M,f="flex flex-col gap-4",s="lunora-settings";let V;e[17]!==r?(V=r("Open in Cloudflare"),e[17]=r,e[18]=V):V=e[18],e[19]!==V?(a=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:de,rel:"noreferrer",target:"_blank",children:V})}),e[19]=V,e[20]=a):a=e[20];let $;e[21]!==r?($=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=$):$=e[22],e[23]!==$?(d=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:$}),e[23]=$,e[24]=d):d=e[24],e[25]!==c||e[26]!==m?(o=c!==null&&(0,t.jsx)(ae,{error:m,testId:"set-error"}),e[25]=c,e[26]=m,e[27]=o):o=e[27],b=Q.length>0&&(0,t.jsxs)(P,{className:"py-0","data-testid":"set-deploy",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,t.jsx)(q,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:Q.map(he)})})]}),e[3]=c,e[4]=m,e[5]=i?.deploy,e[6]=i?.settings,e[7]=r,e[8]=l,e[9]=f,e[10]=s,e[11]=a,e[12]=d,e[13]=o,e[14]=b}else l=e[8],f=e[9],s=e[10],a=e[11],d=e[12],o=e[13],b=e[14];let y;e[28]!==r?(y=r("Keyboard shortcuts"),e[28]=r,e[29]=y):y=e[29];let v;e[30]!==y?(v=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y}),e[30]=y,e[31]=v):v=e[31];let N;e[32]!==r?(N=r("Reset"),e[32]=r,e[33]=N):N=e[33];let k;e[34]!==N?(k=(0,t.jsx)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"set-shortcut-reset",onClick:ne,type:"button",children:N}),e[34]=N,e[35]=k):k=e[35];let w;e[36]!==v||e[37]!==k?(w=(0,t.jsxs)("header",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[v,k]}),e[36]=v,e[37]=k,e[38]=w):w=e[38];let C;e[39]!==r?(C=r("Command palette"),e[39]=r,e[40]=C):C=e[40];let S;e[41]!==C?(S=(0,t.jsx)(ie,{label:C,modifier:"\u2318/Ctrl",name:"palette"}),e[41]=C,e[42]=S):S=e[42];let T;e[43]!==r?(T=r("Operation console"),e[43]=r,e[44]=T):T=e[44];let D;e[45]!==T?(D=(0,t.jsx)(ie,{label:T,modifier:"Ctrl",name:"console"}),e[45]=T,e[46]=D):D=e[46];let _;e[47]!==S||e[48]!==D?(_=(0,t.jsxs)("dl",{className:"grid grid-cols-[10rem_minmax(0,1fr)] items-center gap-x-4 gap-y-2 text-sm",children:[S,D]}),e[47]=S,e[48]=D,e[49]=_):_=e[49];let E;e[50]!==r?(E=r("Stored in this browser. Focus a box and press a key to rebind it."),e[50]=r,e[51]=E):E=e[51];let I;e[52]!==E?(I=(0,t.jsx)("p",{className:"pt-3 text-xs text-muted-foreground",children:E}),e[52]=E,e[53]=I):I=e[53];let K;e[54]!==_||e[55]!==I?(K=(0,t.jsxs)(q,{className:"py-3",children:[_,I]}),e[54]=_,e[55]=I,e[56]=K):K=e[56];let O;e[57]!==w||e[58]!==K?(O=(0,t.jsxs)(P,{className:"py-0","data-testid":"set-preferences",children:[w,K]}),e[57]=w,e[58]=K,e[59]=O):O=e[59];let U;e[60]!==r?(U=r("Environment & bindings"),e[60]=r,e[61]=U):U=e[61];let j;e[62]!==U?(j=(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:U})}),e[62]=U,e[63]=j):j=e[63];let F;e[64]!==c||e[65]!==h||e[66]!==l.length||e[67]!==r?(F=c===null&&!h&&l.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[64]=c,e[65]=h,e[66]=l.length,e[67]=r,e[68]=F):F=e[68];let L;e[69]!==l||e[70]!==r?(L=l.length>0&&(0,t.jsx)(q,{className:"px-0 py-0",children:(0,t.jsxs)(le,{"data-testid":"set-table",children:[(0,t.jsx)(oe,{children:(0,t.jsxs)(H,{children:[(0,t.jsx)(z,{children:r("name")}),(0,t.jsx)(z,{children:r("kind")}),(0,t.jsx)(z,{children:r("value")})]})}),(0,t.jsx)(se,{children:l.map(fe)})]})}),e[69]=l,e[70]=r,e[71]=L):L=e[71];let R;e[72]!==j||e[73]!==F||e[74]!==L?(R=(0,t.jsxs)(P,{className:"py-0",children:[j,F,L]}),e[72]=j,e[73]=F,e[74]=L,e[75]=R):R=e[75];let B;return e[76]!==O||e[77]!==R||e[78]!==f||e[79]!==s||e[80]!==a||e[81]!==d||e[82]!==o||e[83]!==b?(B=(0,t.jsxs)("div",{className:f,"data-testid":s,children:[a,d,o,b,O,R]}),e[76]=O,e[77]=R,e[78]=f,e[79]=s,e[80]=a,e[81]=d,e[82]=o,e[83]=b,e[84]=B):B=e[84],B},"Ce");function he(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}g(he,"me");function fe(n){return(0,t.jsxs)(H,{"data-testid":"set-row",children:[(0,t.jsx)(G,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(G,{children:(0,t.jsx)(Y,{variant:ue[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(G,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}g(fe,"fe");export{Se as SettingsPanel};
@@ -0,0 +1 @@
1
+ import{a as Ce,b as Ne}from"./chunk-CU7KGPAQ.js";import{a as ye}from"./chunk-KEMHRM53.js";import"./chunk-XL2OT5WB.js";import"./chunk-JV7KTJPY.js";import"./chunk-DPNEFSEC.js";import{e as ke,g as we}from"./chunk-ZHPDAJBM.js";import"./chunk-INQICZYC.js";import"./chunk-TFMQSCGC.js";import{a as X}from"./chunk-BWEXJENB.js";import"./chunk-74ASA4WU.js";import"./chunk-XQS7KSHL.js";import"./chunk-7PIHTTND.js";import{a as le}from"./chunk-PZ4QDWTI.js";import{a as pe}from"./chunk-VDW32UET.js";import"./chunk-2UWKGSEA.js";import{f as he}from"./chunk-22WJHOC4.js";import"./chunk-RCZTUWG3.js";import{a as me}from"./chunk-UANVABQG.js";import"./chunk-L4EZAHCD.js";import{a as oe,b as ue,c as ge,e as ae}from"./chunk-IYWVSMAY.js";import{d as te,f as ve,g as be,h as fe,m as xe,o as ne}from"./chunk-BKM6PMSO.js";import"./chunk-VYW2PAWC.js";import{a as g,d as ie,e as Se,f as Ke,g as Le}from"./chunk-R5ZTCHCE.js";var Y=ie(Ke(),1),G=ie(Se(),1);var a=ie(Le(),1);var Me=ve(pe.runSql),qe=g((f,e)=>{let t=(0,Y.c)(11),n=he(),[l,d]=(0,G.useState)(void 0),[s,i]=(0,G.useState)(void 0),[h,x]=(0,G.useState)(!0),m;t[0]!==n||t[1]!==e||t[2]!==f?(m=g(async u=>{x(!0);try{let C=await n.query(Me,{sql:f},be(e));u.cancelled||(d(C),i(void 0))}catch(C){let k=C;u.cancelled||(d(void 0),i(fe(k)))}u.cancelled||x(!1)},"h"),t[0]=n,t[1]=e,t[2]=f,t[3]=m):m=t[3];let r=m,o,v;t[4]!==r?(o=g(()=>{let u={cancelled:!1};return ne(r(u)),()=>{u.cancelled=!0}},"l"),v=[r],t[4]=r,t[5]=o,t[6]=v):(o=t[5],v=t[6]),(0,G.useEffect)(o,v);let S;return t[7]!==s||t[8]!==h||t[9]!==l?(S={error:s,loading:h,result:l},t[7]=s,t[8]=h,t[9]=l,t[10]=S):S=t[10],S},"Le"),Ee=g(f=>{f.preventDefault()},"Me"),ce=g(f=>f.kind??"chart","le"),Re=g(f=>{let e=(0,Y.c)(80),{actions:t,children:n,draggedRef:l,first:d,last:s,onEdit:i,onMove:h,onRemove:x,onReorder:m,widget:r}=f,o=te(),v;e[0]!==h||e[1]!==r.id?(v=g(()=>{h(r.id,-1)},"g"),e[0]=h,e[1]=r.id,e[2]=v):v=e[2];let S=v,u;e[3]!==h||e[4]!==r.id?(u=g(()=>{h(r.id,1)},"f"),e[3]=h,e[4]=r.id,e[5]=u):u=e[5];let C=u,k;e[6]!==i||e[7]!==r.id?(k=g(()=>{i(r.id)},"x"),e[6]=i,e[7]=r.id,e[8]=k):k=e[8];let E=k,O;e[9]!==x||e[10]!==r.id?(O=g(()=>{x(r.id)},"O"),e[9]=x,e[10]=r.id,e[11]=O):O=e[11];let j=O,T;e[12]!==l||e[13]!==r.id?(T=g(()=>{l.current=r.id},"z"),e[12]=l,e[13]=r.id,e[14]=T):T=e[14];let w=T,K;e[15]!==l||e[16]!==m||e[17]!==r.id?(K=g(()=>{let de=l.current;l.current=null,de!==null&&de!==r.id&&m(de,r.id)},"K"),e[15]=l,e[16]=m,e[17]=r.id,e[18]=K):K=e[18];let _=K,R=`dashboards-widget-${r.id}`,y;e[19]!==r.title?(y=(0,a.jsx)(ge,{className:"min-w-0 cursor-grab truncate",title:r.title,children:r.title}),e[19]=r.title,e[20]=y):y=e[20];let N;e[21]!==o?(N=o("Move widget up"),e[21]=o,e[22]=N):N=e[22];let F=`dashboards-move-up-${r.id}`,H;e[23]!==o?(H=o("Move widget up"),e[23]=o,e[24]=H):H=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m6 15 6-6 6 6"})}),e[25]=D):D=e[25];let W;e[26]!==d||e[27]!==S||e[28]!==F||e[29]!==H||e[30]!==N?(W=(0,a.jsx)(X,{"aria-label":N,"data-testid":F,disabled:d,onClick:S,size:"icon-xs",title:H,type:"button",variant:"ghost",children:D}),e[26]=d,e[27]=S,e[28]=F,e[29]=H,e[30]=N,e[31]=W):W=e[31];let L;e[32]!==o?(L=o("Move widget down"),e[32]=o,e[33]=L):L=e[33];let $=`dashboards-move-down-${r.id}`,M;e[34]!==o?(M=o("Move widget down"),e[34]=o,e[35]=M):M=e[35];let z;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m6 9 6 6 6-6"})}),e[36]=z):z=e[36];let q;e[37]!==s||e[38]!==C||e[39]!==L||e[40]!==$||e[41]!==M?(q=(0,a.jsx)(X,{"aria-label":L,"data-testid":$,disabled:s,onClick:C,size:"icon-xs",title:M,type:"button",variant:"ghost",children:z}),e[37]=s,e[38]=C,e[39]=L,e[40]=$,e[41]=M,e[42]=q):q=e[42];let B;e[43]!==o?(B=o("Edit widget"),e[43]=o,e[44]=B):B=e[44];let I=`dashboards-widget-edit-${r.id}`,A;e[45]!==o?(A=o("Edit widget"),e[45]=o,e[46]=A):A=e[46];let p;e[47]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M4 20h4L18 10l-4-4L4 16v4ZM14 6l4 4"})}),e[47]=p):p=e[47];let b;e[48]!==E||e[49]!==B||e[50]!==I||e[51]!==A?(b=(0,a.jsx)(X,{"aria-label":B,"data-testid":I,onClick:E,size:"icon-xs",title:A,type:"button",variant:"ghost",children:p}),e[48]=E,e[49]=B,e[50]=I,e[51]=A,e[52]=b):b=e[52];let c;e[53]!==o?(c=o("Remove widget"),e[53]=o,e[54]=c):c=e[54];let J=`dashboards-widget-remove-${r.id}`,V;e[55]!==o?(V=o("Remove widget"),e[55]=o,e[56]=V):V=e[56];let U;e[57]===Symbol.for("react.memo_cache_sentinel")?(U=(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"})}),e[57]=U):U=e[57];let Q;e[58]!==j||e[59]!==c||e[60]!==J||e[61]!==V?(Q=(0,a.jsx)(X,{"aria-label":c,"data-testid":J,onClick:j,size:"icon-xs",title:V,type:"button",variant:"ghost",children:U}),e[58]=j,e[59]=c,e[60]=J,e[61]=V,e[62]=Q):Q=e[62];let Z;e[63]!==t||e[64]!==W||e[65]!==q||e[66]!==b||e[67]!==Q?(Z=(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[t,W,q,b,Q]}),e[63]=t,e[64]=W,e[65]=q,e[66]=b,e[67]=Q,e[68]=Z):Z=e[68];let P;e[69]!==Z||e[70]!==y?(P=(0,a.jsxs)(ue,{className:"flex flex-row items-start justify-between gap-2 border-b pb-3",children:[y,Z]}),e[69]=Z,e[70]=y,e[71]=P):P=e[71];let ee;e[72]!==n?(ee=(0,a.jsx)(ae,{className:"min-h-32 py-2",children:n}),e[72]=n,e[73]=ee):ee=e[73];let re;return e[74]!==w||e[75]!==_||e[76]!==P||e[77]!==ee||e[78]!==R?(re=(0,a.jsxs)(oe,{"data-testid":R,draggable:!0,onDragOver:Ee,onDragStart:w,onDrop:_,children:[P,ee]}),e[74]=w,e[75]=_,e[76]=P,e[77]=ee,e[78]=R,e[79]=re):re=e[79],re},"ce"),je=g(f=>{let e=(0,Y.c)(10),{result:t}=f,n=te(),l=t.columns[0],d=l===void 0?void 0:t.rows[0]?.[l],s;e[0]!==d||e[1]!==n?(s=d===void 0?n("\u2014"):xe(d),e[0]=d,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==s?(i=(0,a.jsx)("p",{className:"truncate font-mono text-3xl font-semibold text-foreground",children:s}),e[3]=s,e[4]=i):i=e[4];let h;e[5]!==l?(h=l!==void 0&&(0,a.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:l}),e[5]=l,e[6]=h):h=e[6];let x;return e[7]!==i||e[8]!==h?(x=(0,a.jsxs)("div",{className:"flex h-full flex-col justify-center gap-1 p-4","data-testid":"dashboards-kpi",children:[i,h]}),e[7]=i,e[8]=h,e[9]=x):x=e[9],x},"qe"),ze=g(f=>{let e=(0,Y.c)(12),{draggedRef:t,first:n,last:l,onEdit:d,onMove:s,onRemove:i,onReorder:h,widget:x}=f,m=x.text??"",r;e[0]!==m?(r=(0,a.jsx)("p",{className:"p-2 text-sm whitespace-pre-wrap text-muted-foreground","data-testid":"dashboards-text",children:m}),e[0]=m,e[1]=r):r=e[1];let o;return e[2]!==t||e[3]!==n||e[4]!==l||e[5]!==d||e[6]!==s||e[7]!==i||e[8]!==h||e[9]!==r||e[10]!==x?(o=(0,a.jsx)(Re,{draggedRef:t,first:n,last:l,onEdit:d,onMove:s,onRemove:i,onReorder:h,widget:x,children:r}),e[2]=t,e[3]=n,e[4]=l,e[5]=d,e[6]=s,e[7]=i,e[8]=h,e[9]=r,e[10]=x,e[11]=o):o=e[11],o},"Ee"),Ae=g(f=>{let e=(0,Y.c)(52),{draggedRef:t,first:n,inferring:l,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,onSuggest:m,widget:r}=f,o=te(),{error:v,loading:S,result:u}=qe(r.sql,r.shardKey??""),C;e[0]!==r?(C=ce(r),e[0]=r,e[1]=C):C=e[1];let k=C,E;e[2]!==m||e[3]!==u||e[4]!==r.id?(E=g(()=>{u!==void 0&&m?.(r.id,u)},"q"),e[2]=m,e[3]=u,e[4]=r.id,e[5]=E):E=e[5];let O=E,j;e[6]!==l||e[7]!==k||e[8]!==m||e[9]!==O||e[10]!==u||e[11]!==o||e[12]!==r.id?(j=k==="chart"&&m!==void 0&&u!==void 0?(0,a.jsx)(X,{"aria-label":o("Suggest chart"),"data-testid":`dashboards-widget-suggest-${r.id}`,disabled:l,onClick:O,size:"icon-xs",title:o(l?"Suggesting\u2026":"Suggest chart"),type:"button",variant:"ghost",children:(0,a.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"m12 3 1.9 4.6L18.5 9.5 13.9 11.4 12 16l-1.9-4.6L5.5 9.5l4.6-1.9L12 3ZM18 15l.9 2.1 2.1.9-2.1.9L18 21l-.9-2.1-2.1-.9 2.1-.9L18 15Z"})})}):void 0,e[6]=l,e[7]=k,e[8]=m,e[9]=O,e[10]=u,e[11]=o,e[12]=r.id,e[13]=j):j=e[13];let T=j,w;e[14]!==v||e[15]!==r.id?(w=v!==void 0&&(0,a.jsx)(le,{className:"font-mono text-xs",testId:`dashboards-widget-error-${r.id}`,variant:"destructive",children:v}),e[14]=v,e[15]=r.id,e[16]=w):w=e[16];let K;e[17]!==v||e[18]!==S||e[19]!==u||e[20]!==o||e[21]!==r.id?(K=v===void 0&&S&&u===void 0&&(0,a.jsx)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":`dashboards-widget-loading-${r.id}`,children:o("Running\u2026")}),e[17]=v,e[18]=S,e[19]=u,e[20]=o,e[21]=r.id,e[22]=K):K=e[22];let _;e[23]!==v||e[24]!==k||e[25]!==u||e[26]!==r.chartAxes||e[27]!==r.chartKind?(_=v===void 0&&u!==void 0&&k==="chart"&&(0,a.jsx)(Ce,{axes:r.chartAxes,kind:r.chartKind,result:u}),e[23]=v,e[24]=k,e[25]=u,e[26]=r.chartAxes,e[27]=r.chartKind,e[28]=_):_=e[28];let R;e[29]!==v||e[30]!==k||e[31]!==u?(R=v===void 0&&u!==void 0&&k==="kpi"&&(0,a.jsx)(je,{result:u}),e[29]=v,e[30]=k,e[31]=u,e[32]=R):R=e[32];let y;e[33]!==v||e[34]!==k||e[35]!==u?(y=v===void 0&&u!==void 0&&k==="table"&&(0,a.jsx)("div",{className:"max-h-72 overflow-auto",children:(0,a.jsx)(Ne,{result:u})}),e[33]=v,e[34]=k,e[35]=u,e[36]=y):y=e[36];let N;return e[37]!==t||e[38]!==n||e[39]!==d||e[40]!==s||e[41]!==i||e[42]!==h||e[43]!==x||e[44]!==T||e[45]!==w||e[46]!==K||e[47]!==_||e[48]!==R||e[49]!==y||e[50]!==r?(N=(0,a.jsxs)(Re,{actions:T,draggedRef:t,first:n,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,widget:r,children:[w,K,_,R,y]}),e[37]=t,e[38]=n,e[39]=d,e[40]=s,e[41]=i,e[42]=h,e[43]=x,e[44]=T,e[45]=w,e[46]=K,e[47]=_,e[48]=R,e[49]=y,e[50]=r,e[51]=N):N=e[51],N},"Ae"),_e=g(f=>{let e=(0,Y.c)(11),{draggedRef:t,first:n,inferring:l,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,onSuggest:m,widget:r}=f,o;return e[0]!==t||e[1]!==n||e[2]!==l||e[3]!==d||e[4]!==s||e[5]!==i||e[6]!==h||e[7]!==x||e[8]!==m||e[9]!==r?(o=ce(r)==="text"?(0,a.jsx)(ze,{draggedRef:t,first:n,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,widget:r}):(0,a.jsx)(Ae,{draggedRef:t,first:n,inferring:l,last:d,onEdit:s,onMove:i,onRemove:h,onReorder:x,onSuggest:m,widget:r}),e[0]=t,e[1]=n,e[2]=l,e[3]=d,e[4]=s,e[5]=i,e[6]=h,e[7]=x,e[8]=m,e[9]=r,e[10]=o):o=e[10],o},"Te"),We=["bar","line","area"],$e=["chart","kpi","table","text"],Be="lunora-studio-dashboards",se={chartKind:"bar",kind:"chart",shardKey:"",sql:"",text:"",title:""},Ie=g((f,e)=>t=>t.map(n=>n.id===f?{...n,chartAxes:e,chartKind:e.kind}:n),"De"),Te=g((f,e)=>t=>{let n=t.find(s=>s.id===f),l=t.filter(s=>s.id!==f),d=l.findIndex(s=>s.id===e);return n===void 0||d===-1?t:[...l.slice(0,d),n,...l.slice(d)]},"je"),De=g((f,e)=>e(f==="line"?"Line":f==="area"?"Area":"Bar"),"ze"),Oe=g((f,e)=>e(f==="kpi"?"Single value":f==="table"?"Table":f==="text"?"Text":"Chart"),"Be"),Fe=g(f=>{let e=(0,Y.c)(82),{draft:t,editing:n,onCancel:l,onChange:d,onSubmit:s}=f,i=te(),h;e[0]!==t||e[1]!==d?(h=g(c=>{d({...t,title:c.target.value})},"c"),e[0]=t,e[1]=d,e[2]=h):h=e[2];let x=h,m;e[3]!==t||e[4]!==d?(m=g(c=>{d({...t,sql:c.target.value})},"h"),e[3]=t,e[4]=d,e[5]=m):m=e[5];let r=m,o;e[6]!==t||e[7]!==d?(o=g(c=>{d({...t,text:c.target.value})},"l"),e[6]=t,e[7]=d,e[8]=o):o=e[8];let v=o,S;e[9]!==t||e[10]!==d?(S=g(c=>{d({...t,shardKey:c.target.value})},"N"),e[9]=t,e[10]=d,e[11]=S):S=e[11];let u=S,C;e[12]!==t||e[13]!==d?(C=g(c=>{d({...t,chartKind:c.target.value})},"y"),e[12]=t,e[13]=d,e[14]=C):C=e[14];let k=C,E;e[15]!==t||e[16]!==d?(E=g(c=>{d({...t,kind:c.target.value})},"q"),e[15]=t,e[16]=d,e[17]=E):E=e[17];let O=E,j;e[18]!==s?(j=g(()=>{s()},"E"),e[18]=s,e[19]=j):j=e[19];let T=j,w=t.kind==="text",K;e[20]!==t.sql||e[21]!==t.text||e[22]!==t.title||e[23]!==w?(K=t.title.trim()!==""&&(w?t.text.trim()!=="":t.sql.trim()!==""),e[20]=t.sql,e[21]=t.text,e[22]=t.title,e[23]=w,e[24]=K):K=e[24];let _=K,R;e[25]!==i?(R=i("Widget title"),e[25]=i,e[26]=R):R=e[26];let y;e[27]!==i?(y=i("Widget title"),e[27]=i,e[28]=y):y=e[28];let N;e[29]!==t.title||e[30]!==x||e[31]!==y||e[32]!==R?(N=(0,a.jsx)("input",{"aria-label":R,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-title",onChange:x,placeholder:y,type:"text",value:t.title}),e[29]=t.title,e[30]=x,e[31]=y,e[32]=R,e[33]=N):N=e[33];let F;e[34]!==i?(F=i("Widget type"),e[34]=i,e[35]=F):F=e[35];let H=t.kind,D;e[36]!==i?(D=$e.map(c=>(0,a.jsx)("option",{value:c,children:Oe(c,i)},c)),e[36]=i,e[37]=D):D=e[37];let W;e[38]!==t.kind||e[39]!==O||e[40]!==F||e[41]!==D?(W=(0,a.jsx)("select",{"aria-label":F,className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-widget-kind",onChange:O,value:H,children:D}),e[38]=t.kind,e[39]=O,e[40]=F,e[41]=D,e[42]=W):W=e[42];let L;e[43]!==t.sql||e[44]!==t.text||e[45]!==w||e[46]!==r||e[47]!==v||e[48]!==i?(L=w?(0,a.jsx)("textarea",{"aria-label":i("Text"),className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-text",onChange:v,placeholder:i("Notes for whoever reads this dashboard."),value:t.text}):(0,a.jsx)("textarea",{"aria-label":i("SQL query"),className:"min-h-24 resize-y rounded-md border border-border bg-background p-2 font-mono text-xs leading-5 outline-none focus-visible:border-ring","data-testid":"dashboards-form-sql",onChange:r,placeholder:"SELECT author, COUNT(*) AS messages FROM \u2026",spellCheck:!1,value:t.sql}),e[43]=t.sql,e[44]=t.text,e[45]=w,e[46]=r,e[47]=v,e[48]=i,e[49]=L):L=e[49];let $;e[50]!==t.chartKind||e[51]!==t.kind||e[52]!==k||e[53]!==i?($=t.kind==="chart"&&(0,a.jsx)("select",{"aria-label":i("Chart type"),className:"h-8 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-kind",onChange:k,value:t.chartKind,children:We.map(c=>(0,a.jsx)("option",{value:c,children:De(c,i)},c))}),e[50]=t.chartKind,e[51]=t.kind,e[52]=k,e[53]=i,e[54]=$):$=e[54];let M;e[55]!==t.shardKey||e[56]!==w||e[57]!==u||e[58]!==i?(M=!w&&(0,a.jsx)("input",{"aria-label":i("Shard key (optional)"),className:"h-8 rounded-md border border-border bg-background px-2 font-mono text-xs outline-none focus-visible:border-ring","data-testid":"dashboards-form-shard",onChange:u,placeholder:i("Shard key (optional)"),type:"text",value:t.shardKey}),e[55]=t.shardKey,e[56]=w,e[57]=u,e[58]=i,e[59]=M):M=e[59];let z;e[60]!==i?(z=i("Cancel"),e[60]=i,e[61]=z):z=e[61];let q;e[62]!==l||e[63]!==z?(q=(0,a.jsx)(X,{"data-testid":"dashboards-form-cancel",onClick:l,size:"sm",type:"button",variant:"outline",children:z}),e[62]=l,e[63]=z,e[64]=q):q=e[64];let B=!_,I;e[65]!==n||e[66]!==i?(I=i(n?"Save widget":"Add widget"),e[65]=n,e[66]=i,e[67]=I):I=e[67];let A;e[68]!==T||e[69]!==B||e[70]!==I?(A=(0,a.jsx)(X,{"data-testid":"dashboards-form-save",disabled:B,onClick:T,size:"sm",type:"button",children:I}),e[68]=T,e[69]=B,e[70]=I,e[71]=A):A=e[71];let p;e[72]!==q||e[73]!==A?(p=(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[q,A]}),e[72]=q,e[73]=A,e[74]=p):p=e[74];let b;return e[75]!==N||e[76]!==W||e[77]!==L||e[78]!==$||e[79]!==M||e[80]!==p?(b=(0,a.jsx)(oe,{"data-testid":"dashboards-form",children:(0,a.jsxs)(ae,{className:"flex flex-col gap-3 py-4",children:[N,W,L,$,M,p]})}),e[75]=N,e[76]=W,e[77]=L,e[78]=$,e[79]=M,e[80]=p,e[81]=b):b=e[81],b},"Fe"),tt=g(f=>{let e=(0,Y.c)(53),{initialShardKey:t}=f,n=te(),[l,d]=ke(Be),[s,i]=(0,G.useState)(se),[h,x]=(0,G.useState)(null),[m,r]=(0,G.useState)(!1),o=ye(t??""),[v,S]=(0,G.useState)(null),u=(0,G.useRef)(null),C;e[0]!==t?(C=g(()=>{x(null),i({...se,shardKey:t??""}),r(!0)},"y"),e[0]=t,e[1]=C):C=e[1];let k=C,E;e[2]===Symbol.for("react.memo_cache_sentinel")?(E=g(()=>{r(!1),x(null),i(se)},"q"),e[2]=E):E=e[2];let O=E,j;e[3]!==l?(j=g(p=>{let b=l.find(c=>c.id===p);b!==void 0&&(x(p),i({chartKind:b.chartKind??"bar",kind:ce(b),shardKey:b.shardKey??"",sql:b.sql,text:b.text??"",title:b.title}),r(!0))},"E"),e[3]=l,e[4]=j):j=e[4];let T=j,w;e[5]!==o||e[6]!==d?(w=g((p,b)=>{S(p),ne((async()=>{let c=await o.inferChart({columns:b.columns,rowCount:b.rowCount});c!==void 0&&d(Ie(p,c))})().finally(()=>{S(c=>c===p?null:c)}))},"C"),e[5]=o,e[6]=d,e[7]=w):w=e[7];let K=w,_;e[8]!==d?(_=g(p=>{d(b=>b.filter(c=>c.id!==p))},"W"),e[8]=d,e[9]=_):_=e[9];let R=_,y;e[10]!==d?(y=g((p,b)=>{d(Te(p,b))},"k"),e[10]=d,e[11]=y):y=e[11];let N=y,F;e[12]!==d?(F=g((p,b)=>{d(c=>{let J=c.findIndex(P=>P.id===p),V=J+b;if(J===-1||V<0||V>=c.length)return c;let U=[...c],Q=U[J],Z=U[V];return Q===void 0||Z===void 0?c:(U[J]=Z,U[V]=Q,U)})},"_"),e[12]=d,e[13]=F):F=e[13];let H=F,D;e[14]!==s||e[15]!==h||e[16]!==d?(D=g(()=>{let p=s.title.trim(),b=s.sql.trim(),c=s.text.trim(),{chartKind:J,kind:V}=s;if(p===""||(V==="text"?c==="":b===""))return;let U={chartKind:J,kind:V,shardKey:s.shardKey.trim(),sql:b,text:c,title:p};d(h===null?Q=>[...Q,{...U,id:we("w")}]:Q=>Q.map(Z=>Z.id===h?{...Z,...U}:Z)),O()},"B"),e[14]=s,e[15]=h,e[16]=d,e[17]=D):D=e[17];let W=D,L;e[18]!==n?(L=n("Charts, values, tables, and notes. Drag a tile to reorder."),e[18]=n,e[19]=L):L=e[19];let $;e[20]!==L?($=(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:L}),e[20]=L,e[21]=$):$=e[21];let M;e[22]!==m||e[23]!==k||e[24]!==n?(M=!m&&(0,a.jsx)(X,{"data-testid":"dashboards-add",onClick:k,size:"sm",type:"button",children:n("Add widget")}),e[22]=m,e[23]=k,e[24]=n,e[25]=M):M=e[25];let z;e[26]!==$||e[27]!==M?(z=(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[$,M]}),e[26]=$,e[27]=M,e[28]=z):z=e[28];let q;e[29]!==o||e[30]!==n?(q=o.reason("chart")!==void 0&&(0,a.jsx)(le,{className:"text-xs",testId:"dashboards-suggest-error",variant:"destructive",children:n("Could not suggest a chart for that result.")}),e[29]=o,e[30]=n,e[31]=q):q=e[31];let B;e[32]!==s||e[33]!==h||e[34]!==m||e[35]!==W?(B=m&&(0,a.jsx)(Fe,{draft:s,editing:h!==null,onCancel:O,onChange:i,onSubmit:W}),e[32]=s,e[33]=h,e[34]=m,e[35]=W,e[36]=B):B=e[36];let I;e[37]!==o.unavailable||e[38]!==m||e[39]!==v||e[40]!==T||e[41]!==H||e[42]!==R||e[43]!==N||e[44]!==K||e[45]!==n||e[46]!==l?(I=l.length===0&&!m?(0,a.jsx)(me,{description:n("Add a chart, a single value, a table, or a note. Everything is saved on this browser."),testId:"dashboards-empty",title:n("No widgets yet")}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3","data-testid":"dashboards-grid",children:l.map((p,b)=>(0,a.jsx)(_e,{draggedRef:u,first:b===0,inferring:v===p.id,last:b===l.length-1,onEdit:T,onMove:H,onRemove:R,onReorder:N,onSuggest:o.unavailable?void 0:K,widget:p},p.id))}),e[37]=o.unavailable,e[38]=m,e[39]=v,e[40]=T,e[41]=H,e[42]=R,e[43]=N,e[44]=K,e[45]=n,e[46]=l,e[47]=I):I=e[47];let A;return e[48]!==z||e[49]!==q||e[50]!==B||e[51]!==I?(A=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-dashboards",children:[z,q,B,I]}),e[48]=z,e[49]=q,e[50]=B,e[51]=I,e[52]=A):A=e[52],A},"it");export{tt as default};
@@ -1 +1 @@
1
- import{a as r,c as o}from"./chunk-VNTEQQPP.js";import{a as e}from"./chunk-R5ZTCHCE.js";var a="lunora:traces:pending-filter",i=e(s=>{o(a,s,"session")},"i"),d=e(()=>{let s=r("session");if(s!==void 0)try{let n=s.getItem(a);if(n===null)return;let t=JSON.parse(n);return typeof t.traceId!="string"?void 0:{traceId:t.traceId,...typeof t.shardKey=="string"?{shardKey:t.shardKey}:{}}}catch{return}},"c"),p=e(()=>{try{r("session")?.removeItem(a)}catch{}},"d");export{i as a,d as b,p as c};
1
+ import{a as r,c as o}from"./chunk-ZHPDAJBM.js";import{a as e}from"./chunk-R5ZTCHCE.js";var a="lunora:traces:pending-filter",i=e(s=>{o(a,s,"session")},"i"),d=e(()=>{let s=r("session");if(s!==void 0)try{let n=s.getItem(a);if(n===null)return;let t=JSON.parse(n);return typeof t.traceId!="string"?void 0:{traceId:t.traceId,...typeof t.shardKey=="string"?{shardKey:t.shardKey}:{}}}catch{return}},"c"),p=e(()=>{try{r("session")?.removeItem(a)}catch{}},"d");export{i as a,d as b,p as c};