@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +33 -18
- package/dist/index.js +29 -29
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +3 -2
- package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
- package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
- package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
- package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
- package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
- package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
- package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
- package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
- package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
- package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
- package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
- package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
- package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
- package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
- package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
- package/dist/packem_chunks/SettingsPanel.js +391 -0
- package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +158 -387
- package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
- package/dist/packem_chunks/analytics-panel.js +261 -0
- package/dist/packem_chunks/auth-config-panel.js +365 -0
- package/dist/packem_chunks/auth-sessions-panel.js +175 -0
- package/dist/packem_chunks/containers-panel.js +247 -0
- package/dist/packem_chunks/dashboards-panel.js +780 -0
- package/dist/packem_chunks/fanout-panel.js +482 -0
- package/dist/packem_chunks/flags-panel.js +176 -0
- package/dist/packem_chunks/kv-browser.js +1896 -0
- package/dist/packem_chunks/log-drains-panel.js +273 -0
- package/dist/packem_chunks/organizations-panel.js +3178 -0
- package/dist/packem_chunks/payments-panel.js +186 -0
- package/dist/packem_chunks/permissions-panel.js +805 -0
- package/dist/packem_chunks/queues-panel.js +1075 -0
- package/dist/packem_chunks/rls-panel.js +315 -0
- package/dist/packem_chunks/schedule-panel.js +831 -0
- package/dist/packem_chunks/sparkline.js +79 -0
- package/dist/packem_chunks/storage-rules-panel.js +140 -0
- package/dist/packem_chunks/subscriptions-panel.js +238 -0
- package/dist/packem_chunks/users-panel.js +1731 -0
- package/dist/packem_chunks/vector-browser.js +281 -0
- package/dist/packem_chunks/workflows-panel.js +562 -0
- package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-BHHJi3Gb.js} +7 -0
- package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
- package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
- package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
- package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
- package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
- package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
- package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
- package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
- package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
- package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
- package/dist/packem_shared/alert-CdAET2K_.js +68 -0
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
- package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
- package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -0
- package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
- package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-CdXztApG.js} +1 -1
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
- package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
- package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
- package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
- package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
- package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
- package/dist/packem_shared/select-UkNYCT3s.js +273 -0
- package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
- package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
- package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -0
- package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
- package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-UVIXQJdU.js} +1 -1
- package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
- package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
- package/dist/standalone/chunk-25AYY4H7.js +2 -0
- package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
- package/dist/standalone/chunk-2K47A3P6.js +1 -0
- package/dist/standalone/chunk-2NGUNNGW.js +1 -0
- package/dist/standalone/chunk-3CJW6NWG.js +4 -0
- package/dist/standalone/chunk-3OA7PECS.js +6 -0
- package/dist/standalone/chunk-3OIHOXVV.js +1 -0
- package/dist/standalone/chunk-447TAUFD.js +1 -0
- package/dist/standalone/chunk-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-5C4TSNE6.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-6HSHEMZV.js +76 -0
- package/dist/standalone/chunk-6JIZ34MB.js +3 -0
- package/dist/standalone/chunk-6VO23MMW.js +4 -0
- package/dist/standalone/chunk-7MVSQS7B.js +1 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-7YXOPTWI.js +1 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-BGXOXASQ.js +1 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
- package/dist/standalone/chunk-BX5MKYOC.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-E75ANNWX.js +19 -0
- package/dist/standalone/chunk-EQZQOTJY.js +1 -0
- package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-GUI5GFFI.js +1 -0
- package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-HYDJNCGW.js +1 -0
- package/dist/standalone/chunk-HZK5RQHG.js +1 -0
- package/dist/standalone/chunk-IN2SYVJB.js +1 -0
- package/dist/standalone/chunk-IOANPSJN.js +1 -0
- package/dist/standalone/chunk-ISDZPW3V.js +1 -0
- package/dist/standalone/chunk-IXDH4GL5.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-J73VHFCL.js +1 -0
- package/dist/standalone/chunk-JHKMUTIF.js +13 -0
- package/dist/standalone/chunk-JPRH6DPK.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-KA5YB3VP.js +1 -0
- package/dist/standalone/chunk-KBB75WNT.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/chunk-KQV4NGH3.js +1 -0
- package/dist/standalone/chunk-KSKXW5PX.js +1 -0
- package/dist/standalone/chunk-KUH4P5F5.js +1 -0
- package/dist/standalone/chunk-KYJPPVGB.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/chunk-LAK5VSPI.js +1 -0
- package/dist/standalone/chunk-LBN7LPVK.js +1 -0
- package/dist/standalone/chunk-LNZIB2MD.js +1 -0
- package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
- package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
- package/dist/standalone/chunk-N2X2OO4V.js +1 -0
- package/dist/standalone/chunk-NGKITPQP.js +13 -0
- package/dist/standalone/chunk-O3NAGRTR.js +1 -0
- package/dist/standalone/chunk-OZACQNKG.js +1 -0
- package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
- package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
- package/dist/standalone/chunk-QAFAJBAW.js +1 -0
- package/dist/standalone/chunk-QBAT52GB.js +1 -0
- package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TBMYIZIO.js +1 -0
- package/dist/standalone/chunk-TDZ44E5I.js +4 -0
- package/dist/standalone/chunk-THNBTMUF.js +1 -0
- package/dist/standalone/chunk-TIQISBGK.js +1 -0
- package/dist/standalone/chunk-TMYVNQ66.js +1 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-UGUEC6BC.js +1 -0
- package/dist/standalone/chunk-UJB2LEI4.js +4 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VON7JUPG.js +1 -0
- package/dist/standalone/chunk-W3JK4YWR.js +1 -0
- package/dist/standalone/chunk-W3SHEIAL.js +3 -0
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/chunk-WIHXMNUY.js +1 -0
- package/dist/standalone/chunk-WLDVXVI2.js +1 -0
- package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/chunk-YAECF5LW.js +1 -0
- package/dist/standalone/chunk-YBGC4PPD.js +1 -0
- package/dist/standalone/chunk-YJAPWSDC.js +4 -0
- package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
- package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
- package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
- package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
- package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
- package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
- package/dist/standalone/studio.js +104 -246
- package/dist/styles.css +2 -2
- package/package.json +15 -13
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
- package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as J}from"./chunk-YBGC4PPD.js";import{a as P}from"./chunk-VLXV72QE.js";import{a as B}from"./chunk-UKDJ4H7I.js";import{b as j}from"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import{c as D}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as f}from"./chunk-BOXSWNXZ.js";import{c as L}from"./chunk-RHZ4M2NZ.js";import{a as v,e as y}from"./chunk-SEU5V7I6.js";import"./chunk-CKSHCYGC.js";import{f as _}from"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as E,e as S,f as w,g as b,k as I}from"./chunk-E75ANNWX.js";import{b as N}from"./chunk-JHKMUTIF.js";import{a as o,e as R,f as K,h as U}from"./chunk-RRCPZMC2.js";var c=R(K(),1);var e=R(U(),1);var V=S(f.exportShard),X=S(f.importShard),z=o(m=>m.map(a=>JSON.stringify(a)).join(`
|
|
2
|
+
`),"toNdjson"),G=o(m=>{let a=[],x=m.split(`
|
|
3
|
+
`);for(let[r,n]of x.entries()){let h=n.trim();if(h==="")continue;let l=JSON.parse(h);if(typeof l!="object"||l===null)throw new N("INTERNAL",`line ${(r+1).toString()}: expected a { table, doc } object`);let s=l;if(typeof s.table!="string"||typeof s.doc!="object"||s.doc===null||Array.isArray(s.doc))throw new N("INTERNAL",`line ${(r+1).toString()}: expected a { table, doc } object`);a.push(s)}return a},"parseNdjson"),ie=o(({initialShardKey:m})=>{let a=_(),x=L(),r=E(),[n,h]=(0,c.useState)(m??""),[l,s]=(0,c.useState)(""),[C,p]=(0,c.useState)(!1),[T,u]=(0,c.useState)(null),[i,g]=(0,c.useState)(null),[A,O]=(0,c.useState)(null),$=o(async()=>{p(!0),u(null),g(null);try{let t=await a.query(V,{},w(n));j(n),s(z(t.rows)),O(t.rows.length)}catch(t){u(b(t))}finally{p(!1)}},"exportShard"),k=o(async()=>{p(!0),u(null),g(null),O(null);let t;try{t=G(l)}catch(d){u(r("Invalid NDJSON: {message}",{message:b(d)})),p(!1);return}try{let d=await a.query(X,{rows:t},w(n));j(n),g(d),x(f.readTablePage),x(f.listTables)}catch(d){u(b(d))}finally{p(!1)}},"importShard"),M=i===null?0:Object.values(i.inserted).reduce((t,d)=>t+d,0),q=o(()=>{I($())},"runExport"),F=o(()=>{I(k())},"runImport"),H=o(t=>{s(t.target.value)},"onNdjsonChange");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-export-import",children:[(0,e.jsxDEV)(v,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Export")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(y,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(B,{onChange:h,testId:"ei-shard-input",value:n},void 0,!1),(0,e.jsxDEV)(D,{"data-testid":"ei-export",disabled:C,onClick:q,type:"button",children:r("Export")},void 0,!1)]},void 0,!0),A!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:r("Exported {count} rows.",{count:A})},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)(v,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Import")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(y,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxDEV)(P,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:H,placeholder:'{"table":"messages","doc":{\u2026}}',value:l},void 0,!1),(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:(0,e.jsxDEV)(J,{confirmLabel:r("Import (writes rows)?"),disabled:C||l.trim()==="",onConfirm:F,testId:"ei-import",children:r("Import")},void 0,!1)},void 0,!1),i!==null&&(0,e.jsxDEV)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,e.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:r("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:i.conflicts,errors:i.errors.length,inserted:M})},void 0,!1),i.errors.length>0&&(0,e.jsxDEV)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:i.errors.map(t=>(0,e.jsxDEV)("li",{className:"text-xs text-destructive",children:r("line {line} ({table}): {message}",{line:t.line,message:t.message,table:t.table})},`${t.table}-${t.line.toString()}`,!1))},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),T!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:T},void 0,!1)]},void 0,!0)},"ExportImportPanel");export{ie as ExportImportPanel};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as R}from"./chunk-TQ36RWOP.js";import{R as C}from"./chunk-3CJW6NWG.js";import{c as k}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as w,e as N}from"./chunk-SEU5V7I6.js";import"./chunk-CKSHCYGC.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as b,g as S,k as T,m as L}from"./chunk-E75ANNWX.js";import{a as f,e as y,f as W,g as j,h as D}from"./chunk-RRCPZMC2.js";var O=y(j(),1),v=y(W(),1);var t=y(D(),1);var I=f(s=>{let e=(0,O.c)(23),{destination:o}=s,h=b(),m;e[0]!==o.snippet?(m=f(()=>{L(o.snippet)},"t1"),e[0]=o.snippet,e[1]=m):m=e[1];let u=m,r;e[2]!==o.title?(r=(0,t.jsxDEV)("h4",{className:"text-sm font-semibold",children:o.title},void 0,!1),e[2]=o.title,e[3]=r):r=e[3];let a;e[4]!==o.description?(a=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:o.description},void 0,!1),e[4]=o.description,e[5]=a):a=e[5];let l;e[6]!==r||e[7]!==a?(l=(0,t.jsxDEV)("div",{children:[r,a]},void 0,!0),e[6]=r,e[7]=a,e[8]=l):l=e[8];let g=`drain-copy-${o.id}`,d;e[9]!==h?(d=h("Copy"),e[9]=h,e[10]=d):d=e[10];let i;e[11]!==u||e[12]!==g||e[13]!==d?(i=(0,t.jsxDEV)(k,{"data-testid":g,onClick:u,size:"sm",variant:"outline",children:d},void 0,!1),e[11]=u,e[12]=g,e[13]=d,e[14]=i):i=e[14];let n;e[15]!==l||e[16]!==i?(n=(0,t.jsxDEV)("div",{className:"flex items-start justify-between gap-3",children:[l,i]},void 0,!0),e[15]=l,e[16]=i,e[17]=n):n=e[17];let c;e[18]!==o.snippet?(c=(0,t.jsxDEV)("pre",{className:"mt-2 overflow-x-auto rounded bg-muted p-2 font-mono text-xs",children:o.snippet},void 0,!1),e[18]=o.snippet,e[19]=c):c=e[19];let p;return e[20]!==n||e[21]!==c?(p=(0,t.jsxDEV)(w,{className:"py-0","data-testid":"drain-card",children:(0,t.jsxDEV)(N,{className:"p-3",children:[n,c]},void 0,!0)},void 0,!1),e[20]=n,e[21]=c,e[22]=p):p=e[22],p},"DestinationRow"),F=f(()=>{let s=b(),e=[{description:s("Stream every request log to R2, a SIEM, or a third-party log service."),id:"logpush",snippet:["{",' "logpush": true',"}"].join(`
|
|
2
|
+
`),title:s("Logpush")},{description:s("Send logs programmatically to a Worker for custom capture and forwarding."),id:"tail-worker",snippet:["{",' "tail_consumers": [{ "service": "my-log-forwarder" }]',"}"].join(`
|
|
3
|
+
`),title:s("Tail Workers")},{description:s("Retain and query recent request logs directly in Cloudflare's dashboard."),id:"workers-logs",snippet:["{",' "observability": { "enabled": true }',"}"].join(`
|
|
4
|
+
`),title:s("Workers Logs")}],[o,h]=(0,v.useState)(""),[m,u]=(0,v.useState)(!1),[r,a]=(0,v.useState)(null),l=f(async()=>{let i=o.trim();if(i==="")return;let n="fetch"in globalThis?globalThis.fetch:void 0;if(n===void 0){a({kind:"error",message:s("fetch is unavailable in this environment.")});return}let c={durationMs:12,function:"messages:list",outcome:"ok",shard:"root",source:"lunora",tablesRead:["messages"],tablesWritten:[],ts:new Date().toISOString(),type:"request"};u(!0),a(null);let p=performance.now();try{let x=await n(i,{body:JSON.stringify(c),headers:{"Content-Type":"application/json"},method:"POST"});a({kind:"success",latencyMs:Math.round(performance.now()-p),status:x.status})}catch(x){a({kind:"error",message:S(x)})}finally{u(!1)}},"sendTest"),g=f(()=>{T(l())},"onSendTest"),d=f(i=>{h(i.target.value)},"onWebhookUrlChange");return(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"log-drains",children:[(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"drain-cf-link",href:R,rel:"noreferrer",target:"_blank",children:s("Open in Cloudflare")},void 0,!1)},void 0,!1),(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"drain-readonly-note",children:s("Lunora does not ship logs itself \u2014 forwarding is handled by Cloudflare. Configure a destination below, then test your collector.")},void 0,!1),(0,t.jsxDEV)("section",{className:"flex flex-col gap-3","data-testid":"drain-destinations",children:[(0,t.jsxDEV)("h3",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Cloudflare destinations")},void 0,!1),e.map(i=>(0,t.jsxDEV)(I,{destination:i},i.id,!1))]},void 0,!0),(0,t.jsxDEV)(w,{className:"py-0",children:(0,t.jsxDEV)(N,{className:"p-3",children:(0,t.jsxDEV)("section",{"data-testid":"drain-webhook",children:[(0,t.jsxDEV)("h3",{className:"mb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Webhook test")},void 0,!1),(0,t.jsxDEV)("p",{className:"mb-2 text-sm text-muted-foreground",children:s("POST a sample Lunora request-log envelope to your collector to confirm it is reachable.")},void 0,!1),(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxDEV)(C,{className:"min-w-[20rem] flex-1","data-testid":"drain-webhook-url",onChange:d,placeholder:s("https://example.com/logs"),type:"url",value:o},void 0,!1),(0,t.jsxDEV)(k,{"data-testid":"drain-webhook-test",disabled:m||o.trim()==="",onClick:g,children:s(m?"Sending\u2026":"Send test event")},void 0,!1)]},void 0,!0),r!==null&&(0,t.jsxDEV)("p",{className:r.kind==="success"?"mt-2 text-sm text-muted-foreground":"mt-2 text-sm text-destructive","data-testid":"drain-webhook-result",role:r.kind==="error"?"alert":void 0,children:r.kind==="success"?s("Delivered \u2014 status {status} in {latency}ms",{latency:r.latencyMs,status:r.status}):s("Failed: {message}",{message:r.message})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)},"LogDrainsPanel");export{F as LogDrainsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C}from"./chunk-J6J54MBP.js";import{a as E}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as x,b as I,c as N,d as u,e as l,f as o}from"./chunk-GTM65MVX.js";import{a as g}from"./chunk-BOXSWNXZ.js";import{a as A}from"./chunk-TAD43CG5.js";import{b as y}from"./chunk-RHZ4M2NZ.js";import{a as m,e as h}from"./chunk-SEU5V7I6.js";import{b as v}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as S,o as b}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as c,e as Q,h as V}from"./chunk-RRCPZMC2.js";var e=Q(V(),1);var P=new Set(["active","trialing"]),D=new Set(["past_due","unpaid"]),a=c((t,s)=>{if(t[s]!==void 0)return t[s];let d=t.__doc__;if(typeof d=="string")try{let n=JSON.parse(d);if(n!==null&&typeof n=="object"&&!Array.isArray(n))return n[s]}catch{}},"readField"),i=c(t=>typeof t=="string"?t:typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"?String(t):"","text"),F=c(t=>P.has(t)?"default":D.has(t)?"destructive":"outline","badgeVariant"),K=c(({limit:t=100})=>{let s=S(),d=y(g.readTablePage,{filters:[],limit:t,offset:0,orderBy:[],search:"",table:"subscriptions"}),n=y(g.readTablePage,{filters:[],limit:25,offset:0,orderBy:[],search:"",table:"events"});C(()=>{d.refetch(),n.refetch()},!0);let f=d.data?.rows??[],R=n.data?.rows??[],B=d.error??n.error,w=d.error===null?n.errorSource:d.errorSource,T=f.filter(r=>P.has(i(a(r,"state")))).length,j=R.toSorted((r,p)=>Number(a(p,"processedAt")??0)-Number(a(r,"processedAt")??0));return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsxDEV)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxDEV)(m,{className:"justify-between gap-0 py-0",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Subscriptions")},void 0,!1),(0,e.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,e.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T},void 0,!1),(0,e.jsxDEV)(v,{variant:"default",children:s("{count} active",{count:T})},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s("{total} total",{total:f.length})},void 0,!1)]},void 0,!0)},void 0,!1),B===null?void 0:(0,e.jsxDEV)(E,{error:w},void 0,!1),f.length===0&&!d.isLoading?(0,e.jsxDEV)(A,{testId:"payments-empty",title:s("No subscriptions yet")},void 0,!1):(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:[(0,e.jsxDEV)(I,{children:(0,e.jsxDEV)(u,{children:[(0,e.jsxDEV)(l,{children:s("Provider")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Reference")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Plan")},void 0,!1),(0,e.jsxDEV)(l,{children:s("State")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Renews")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(N,{children:f.map(r=>{let p=i(a(r,"state"));return(0,e.jsxDEV)(u,{"data-testid":"payment-subscription-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"referenceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"priceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:(0,e.jsxDEV)(v,{variant:F(p),children:p},void 0,!1)},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"currentPeriodEnd"))},void 0,!1)]},i(a(r,"providerSubscriptionId")),!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Recent webhook events")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:(0,e.jsxDEV)(N,{children:j.map(r=>(0,e.jsxDEV)(u,{"data-testid":"payment-event-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{className:"font-medium",children:i(a(r,"type"))},void 0,!1),(0,e.jsxDEV)(o,{className:"text-muted-foreground",children:i(a(r,"providerEventId"))},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"processedAt"))},void 0,!1)]},i(a(r,"providerEventId")),!0))},void 0,!1)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"PaymentsPanel");export{K as PaymentsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-RRCPZMC2.js";var u={highErrorRate:.05,highWriteContention:.1,lowCacheHitRate:.5,minCacheSamples:10,minConflictCalls:5,minErrorCalls:5,slowFunctionMs:1e3},t={error:0,info:2,warning:1},f=a((i,s)=>{let e=[];if(i.maxDurationMs>=s.slowFunctionMs){let n=i.scannedTables??[];n.length>0?e.push({fn:i.path,kind:"missing-index",severity:"warning",tables:n.map(o=>o.table),value:i.maxDurationMs}):e.push({fn:i.path,kind:"slow-function",severity:"info",value:i.maxDurationMs})}i.calls>=s.minErrorCalls&&i.errors/i.calls>=s.highErrorRate&&e.push({fn:i.path,kind:"high-error-rate",message:i.lastErrorMessage??void 0,severity:"error",value:i.errors/i.calls});let r=i.conflicts??0;return r>0&&i.calls>=s.minConflictCalls&&r/i.calls>=s.highWriteContention&&e.push({fn:i.path,kind:"high-write-contention",severity:"warning",value:r/i.calls}),e},"deriveFunctionInsights"),g=a((i,s,e=u)=>{let r=[];if(i?.cache){let{evictions:n,hits:o,misses:h}=i.cache,c=o+h;if(c>=e.minCacheSamples){let l=o/c;l<e.lowCacheHitRate&&r.push({kind:"low-cache-hit-rate",severity:"warning",value:l})}n>0&&n>o&&r.push({kind:"high-evictions",severity:"warning",value:n})}for(let n of s??[])r.push(...f(n,e));return r.toSorted((n,o)=>t[n.severity]-t[o.severity])},"deriveInsights");export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as we,b as Ke,c as je}from"./chunk-L7SK4ZZD.js";import{i as Ge,k as He}from"./chunk-4QHKBC77.js";import{D as Me,I as Se,K as Ve,L as De,M as Le,N as Oe,O as Te,P as Fe,Q as _e,a as $,b as Ie,c as Ne,e as F,f as Be}from"./chunk-3CJW6NWG.js";import{b as Ae}from"./chunk-UK64ZSUW.js";import{a as T,e as ce}from"./chunk-O3NAGRTR.js";import{a as ve,c as Re,d as Ee,g as de,i as Pe,j as W}from"./chunk-CKSHCYGC.js";import{a as vt}from"./chunk-3OA7PECS.js";import{a as i,d as Ct,e as k,f as O,g as yt,h as Rt,j as ye}from"./chunk-RRCPZMC2.js";var Je=k(yt(),1);var w={};Ct(w,{Indicator:()=>fe,Root:()=>ue});var u=k(O(),1);function Ue(t){if(!t)return null;for(let e of t.elements){let n=e.tagName;if(n==="BUTTON"||n==="INPUT"){let o=e;if(o.type==="submit")return o}}return null}i(Ue,"getDefaultFormSubmitter");var qe=k(O(),1);var le=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.indeterminate="data-indeterminate",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});function z(t){return qe.useMemo(()=>({checked(e){return t.indeterminate?{}:e?{[le.checked]:""}:{[le.unchecked]:""}},...$}),[t.indeterminate])}i(z,"useStateAttributesMapping");var We=k(O(),1);function $e(t,e,n,o=!0,a){let[f,p]=We.useState(),M=F(a?`${a}-label`:void 0),b=t??e??f;return T(()=>{let g=t||e||!o?void 0:Et(n.current,M);f!==g&&p(g)}),b}i($e,"useAriaLabelledBy");function Et(t,e){let n=Pt(t);if(n)return!n.id&&e&&(n.id=e),n.id||void 0}i(Et,"getAriaLabelledBy");function Pt(t){if(!t)return;let e=t.parentElement;if(e&&e.tagName==="LABEL")return e;let n=t.id;if(n){let a=t.nextElementSibling;if(a&&a.htmlFor===n)return a}let o=t.labels;return o&&o[0]}i(Pt,"findAssociatedLabel");var J=k(O(),1);var X=J.createContext(void 0);X.displayName="CheckboxRootContext";function ze(){let t=J.useContext(X);if(t===void 0)throw new Error("Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.");return t}i(ze,"useCheckboxRootContext");var _=k(vt(),1);var It="data-parent",ue=u.forwardRef(i(function(e,n){let{checked:o,className:a,defaultChecked:f=!1,"aria-labelledby":p,disabled:M=!1,form:b,id:g,indeterminate:S=!1,inputRef:Z,name:K,onCheckedChange:A,parent:m=!1,readOnly:R=!1,render:pe,required:E=!1,uncheckedValue:j,value:G,nativeButton:H=!1,style:Nt,...Xe}=e,{clearErrors:Ye}=Ne(),{disabled:Qe,name:Ze,setDirty:et,setFilled:ee,setFocused:me,setTouched:tt,state:he,validationMode:rt,validityData:nt,validation:ot}=Ie(),it=Me(),{labelId:at,controlId:st,registerControlId:P,getDescriptionProps:be}=Be(),s=_e(),V=s?.parent,D=V&&s.allValues,c=Qe||it.disabled||s?.disabled||M,I=Ze??K,d=G??I,ge=F(),dt=F(),x=st;D?x=m?dt:`${V.id}-${d}`:g&&(x=g);let te={};D&&(m?te=s.parent.getParentProps():d&&(te=s.parent.getChildProps(d)));let{checked:ke=o,indeterminate:ct=S,onCheckedChange:lt,...ut}=te,N=s?.value,xe=s?.setValue,Ce=s?.defaultValue,re=u.useRef(null),U=Re(()=>Symbol("checkbox-control")),ne=u.useRef(!1),{getButtonProps:ft,buttonRef:pt}=Ae({disabled:c,native:H}),B=s?.validation??ot,[l,mt]=Le({controlled:d&&N&&!m?N.includes(d):ke,default:d&&Ce&&!m?Ce.includes(d):f,name:"Checkbox",state:"checked"}),oe=D?!!ke:l,L=D&&ct||S;T(()=>{P!==de&&(ne.current=!0,P(U.current,x))},[x,P,U]),u.useEffect(()=>{let r=U.current;return()=>{!ne.current||P===de||(ne.current=!1,P(r,void 0))}},[P,U]),Oe(re,ge,l,void 0,!s&&!c,K);let C=u.useRef(null),ht=Ee(Z,C,B.inputRef,B.registerInput),bt=$e(p,at,C,!H,x??void 0);T(()=>{C.current&&(C.current.indeterminate=L,l&&ee(!0))},[l,L,ee]),je(l,()=>{s||(Ye(I),ee(l),et(l!==nt.initialValue),B.change(l))});let gt=ve({checked:l,disabled:c,form:b,name:m?void 0:I,id:H?void 0:x??void 0,required:E,ref:ht,style:I?Ke:we,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(r){if(r.nativeEvent.defaultPrevented)return;if(R){r.preventDefault();return}let h=r.currentTarget.checked,y=Fe(Te.none,r.nativeEvent);if(A?.(h,y),!y.isCanceled&&(lt?.(h,y),!y.isCanceled&&(mt(h),d&&N&&xe&&!m&&!D))){let v=h?[...N,d]:N.filter(q=>q!==d);xe(v,y)}},onFocus(){re.current?.focus()}},G!==void 0?{value:(s?l&&G:G)||""}:Pe,be,r=>B.getValidationProps(c,r));u.useEffect(()=>{if(!V||!d)return;let r=V.disabledStatesRef.current;return r.set(d,c),()=>{r.delete(d)}},[V,c,d]);let ie=u.useMemo(()=>({...he,checked:oe,disabled:c,readOnly:R,required:E,indeterminate:L}),[he,oe,c,R,E,L]),kt=z(ie),xt=W("span",e,{state:ie,ref:[pt,re,n,s?.registerControlRef],props:[{id:H?x??void 0:ge,role:"checkbox","aria-checked":L?"mixed":oe,"aria-readonly":R||void 0,"aria-required":E||void 0,"aria-labelledby":bt,[It]:m?"":void 0,onFocus(){c||me(!0)},onBlur(){let r=C.current;r&&(tt(!0),me(!1),rt==="onBlur"&&B.commit(s?N:r.checked))},onKeyDown(r){if(r.key!=="Enter"||(r.preventBaseUIHandler(),r.defaultPrevented))return;let h=C.current?.form??null,y=r.currentTarget,v=r.nativeEvent,q=r.preventDefault,ae=v.preventDefault,se=!1;r.preventDefault=()=>{se=!0,q.call(r)},v.preventDefault=()=>{se=!0,ae.call(v)},ae.call(v),ce(y).queueMicrotask(()=>{r.preventDefault=q,v.preventDefault=ae,se||Ue(h)?.click()})},onClick(r){if(R||c)return;r.preventDefault();let h=C.current;h&&h.dispatchEvent(new(ce(h)).PointerEvent("click",{bubbles:!0,shiftKey:r.shiftKey,ctrlKey:r.ctrlKey,altKey:r.altKey,metaKey:r.metaKey}))}},Xe,ut,ft,be,r=>B.getValidationProps(c,r)],stateAttributesMapping:kt});return(0,_.jsxs)(X.Provider,{value:ie,children:[xt,!l&&!s&&I&&!m&&j!==void 0&&(0,_.jsx)("input",{type:"hidden",form:b,name:I,value:j,disabled:c}),(0,_.jsx)("input",{...gt,suppressHydrationWarning:!0})]})},"CheckboxRoot"));ue.displayName="CheckboxRoot";var Y=k(O(),1);var fe=Y.forwardRef(i(function(e,n){let{render:o,className:a,style:f,keepMounted:p=!1,...M}=e,b=ze(),g=b.checked||b.indeterminate,{mounted:S,transitionStatus:Z,setMounted:K}=De(g),A=Y.useRef(null),m={...b,transitionStatus:Z};Ve({open:g,ref:A,onComplete(){g||K(!1)}});let pe={...z(b),...Se,...$},E=p||S,j=W("span",e,{ref:[n,A],state:m,stateAttributesMapping:pe,props:M});return E?j:null},"CheckboxIndicator"));fe.displayName="CheckboxIndicator";var Q=k(Rt(),1);function Sr(t){let e=(0,Je.c)(9),n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=ye("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",n),e[3]=n,e[4]=a):a=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,Q.jsxDEV)(w.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,Q.jsxDEV)(He,{icon:Ge,strokeWidth:2},void 0,!1)},void 0,!1),e[5]=f):f=e[5];let p;return e[6]!==o||e[7]!==a?(p=(0,Q.jsxDEV)(w.Root,{"data-slot":"checkbox",className:a,...o,children:f},void 0,!1),e[6]=o,e[7]=a,e[8]=p):p=e[8],p}i(Sr,"Checkbox");export{Sr as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,e as h,g as N,h as E,j as k}from"./chunk-RRCPZMC2.js";var y=h(N(),1);var v=h(E(),1);var I={dialog:"fixed inset-0 z-[1000] flex justify-center bg-black/20 pt-[10vh]",drawer:"fixed inset-0 z-[1000] flex justify-end bg-black/20"},T={dialog:"flex h-fit w-[min(28rem,92vw)] flex-col gap-3 rounded-lg border border-border bg-background p-4 shadow-xl",drawer:"flex h-full w-[min(34rem,100vw)] flex-col gap-4 overflow-auto border-l border-border bg-background p-4 shadow-xl"},_=d(A=>{let e=(0,y.c)(18),{className:n,children:c,label:f,onClose:l,panelTestId:b,testId:g,variant:u}=A,r;e[0]!==l?(r=d(i=>{i.target===i.currentTarget&&l()},"t1"),e[0]=l,e[1]=r):r=e[1];let m=r,a;e[2]!==l?(a=d(i=>{i.key==="Escape"&&l()},"t2"),e[2]=l,e[3]=a):a=e[3];let p=a,x=I[u],w=T[u],o;e[4]!==n||e[5]!==w?(o=k(w,n),e[4]=n,e[5]=w,e[6]=o):o=e[6];let t;e[7]!==c||e[8]!==f||e[9]!==b||e[10]!==o?(t=(0,v.jsxDEV)("div",{"aria-label":f,className:o,"data-testid":b,role:"dialog",children:c},void 0,!1),e[7]=c,e[8]=f,e[9]=b,e[10]=o,e[11]=t):t=e[11];let s;return e[12]!==m||e[13]!==p||e[14]!==x||e[15]!==t||e[16]!==g?(s=(0,v.jsxDEV)("div",{className:x,"data-testid":g,onClick:m,onKeyDown:p,role:"presentation",children:t},void 0,!1),e[12]=m,e[13]=p,e[14]=x,e[15]=t,e[16]=g,e[17]=s):s=e[17],s},"ModalShell");export{_ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as N,j as x}from"./chunk-E75ANNWX.js";import{a as m,e as w,g as y,h as C}from"./chunk-RRCPZMC2.js";var v=w(y(),1);var o=w(C(),1);var T=m(b=>{let e=(0,v.c)(8),{value:l}=b;if(l==null){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,o.jsxDEV)("span",{className:"text-muted-foreground/50 italic",children:"NULL"},void 0,!1),e[0]=a):a=e[0],a}let t;e[1]!==l?(t=x(l),e[1]=l,e[2]=t):t=e[2];let r;e[3]!==l?(r=x(l),e[3]=l,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=(0,o.jsxDEV)("span",{title:t,children:r},void 0,!1),e[5]=t,e[6]=r,e[7]=s):s=e[7],s},"CellValue"),G=m(b=>{let e=(0,v.c)(22),{columns:l,rows:t}=b,r=N(),s;e[0]!==r?(s=r("Field"),e[0]=r,e[1]=s):s=e[1];let a;e[2]!==s?(a=(0,o.jsxDEV)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:s},void 0,!1),e[2]=s,e[3]=a):a=e[3];let i;if(e[4]!==t||e[5]!==r){let d;e[7]!==r?(d=m((u,h)=>(0,o.jsxDEV)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:r("Row {n}",{n:h+1})},h,!1),"t42"),e[7]=r,e[8]=d):d=e[8],i=t.map(d),e[4]=t,e[5]=r,e[6]=i}else i=e[6];let n;e[9]!==a||e[10]!==i?(n=(0,o.jsxDEV)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,o.jsxDEV)("tr",{children:[a,i]},void 0,!0)},void 0,!1),e[9]=a,e[10]=i,e[11]=n):n=e[11];let f;if(e[12]!==l||e[13]!==t){let d;e[15]!==t?(d=m(u=>(0,o.jsxDEV)("tr",{className:"hover:bg-muted/40",children:[(0,o.jsxDEV)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:u},void 0,!1),t.map((h,g)=>(0,o.jsxDEV)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,o.jsxDEV)(T,{value:h[u]},void 0,!1)},g,!1))]},u,!0),"t62"),e[15]=t,e[16]=d):d=e[16],f=l.map(d),e[12]=l,e[13]=t,e[14]=f}else f=e[14];let c;e[17]!==f?(c=(0,o.jsxDEV)("tbody",{children:f},void 0,!1),e[17]=f,e[18]=c):c=e[18];let p;return e[19]!==n||e[20]!==c?(p=(0,o.jsxDEV)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,o.jsxDEV)("table",{className:"border-collapse text-xs",children:[n,c]},void 0,!0)},void 0,!1),e[19]=n,e[20]=c,e[21]=p):p=e[21],p},"TransposedTable"),L=m(({children:b,layout:e="card",testId:l})=>(0,o.jsxDEV)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":l,children:b},void 0,!1),"GridContainer");export{T as a,G as b,L as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-RRCPZMC2.js";function S(e,r,t){e.prototype=r.prototype=t,t.constructor=e}f(S,"default");function W(e,r){var t=Object.create(e.prototype);for(var n in r)t[n]=r[n];return t}f(W,"extend");function B(){}f(B,"Color");var C=.7,Y=1/C,R="\\s*([+-]?\\d+)\\s*",E="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xe=/^#([0-9a-f]{3,8})$/,Se=new RegExp(`^rgb\\(${R},${R},${R}\\)$`),Ce=new RegExp(`^rgb\\(${y},${y},${y}\\)$`),Ee=new RegExp(`^rgba\\(${R},${R},${R},${E}\\)$`),Be=new RegExp(`^rgba\\(${y},${y},${y},${E}\\)$`),Ie=new RegExp(`^hsl\\(${E},${y},${y}\\)$`),_e=new RegExp(`^hsla\\(${E},${y},${y},${E}\\)$`),se={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};S(B,v,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:le,formatHex:le,formatHex8:je,formatHsl:Ye,formatRgb:ue,toString:ue});function le(){return this.rgb().formatHex()}f(le,"color_formatHex");function je(){return this.rgb().formatHex8()}f(je,"color_formatHex8");function Ye(){return ge(this).formatHsl()}f(Ye,"color_formatHsl");function ue(){return this.rgb().formatRgb()}f(ue,"color_formatRgb");function v(e){var r,t;return e=(e+"").trim().toLowerCase(),(r=Xe.exec(e))?(t=r[1].length,r=parseInt(r[1],16),t===6?xe(r):t===3?new d(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?_(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?_(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Se.exec(e))?new d(r[1],r[2],r[3],1):(r=Ce.exec(e))?new d(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Ee.exec(e))?_(r[1],r[2],r[3],r[4]):(r=Be.exec(e))?_(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Ie.exec(e))?he(r[1],r[2]/100,r[3]/100,1):(r=_e.exec(e))?he(r[1],r[2]/100,r[3]/100,r[4]):se.hasOwnProperty(e)?xe(se[e]):e==="transparent"?new d(NaN,NaN,NaN,0):null}f(v,"color");function xe(e){return new d(e>>16&255,e>>8&255,e&255,1)}f(xe,"rgbn");function _(e,r,t,n){return n<=0&&(e=r=t=NaN),new d(e,r,t,n)}f(_,"rgba");function Le(e){return e instanceof B||(e=v(e)),e?(e=e.rgb(),new d(e.r,e.g,e.b,e.opacity)):new d}f(Le,"rgbConvert");function H(e,r,t,n){return arguments.length===1?Le(e):new d(e,r,t,n??1)}f(H,"rgb");function d(e,r,t,n){this.r=+e,this.g=+r,this.b=+t,this.opacity=+n}f(d,"Rgb");S(d,H,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new d(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new d(k(this.r),k(this.g),k(this.b),L(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ce,formatHex:ce,formatHex8:Te,formatRgb:pe,toString:pe}));function ce(){return`#${N(this.r)}${N(this.g)}${N(this.b)}`}f(ce,"rgb_formatHex");function Te(){return`#${N(this.r)}${N(this.g)}${N(this.b)}${N((isNaN(this.opacity)?1:this.opacity)*255)}`}f(Te,"rgb_formatHex8");function pe(){let e=L(this.opacity);return`${e===1?"rgb(":"rgba("}${k(this.r)}, ${k(this.g)}, ${k(this.b)}${e===1?")":`, ${e})`}`}f(pe,"rgb_formatRgb");function L(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}f(L,"clampa");function k(e){return Math.max(0,Math.min(255,Math.round(e)||0))}f(k,"clampi");function N(e){return e=k(e),(e<16?"0":"")+e.toString(16)}f(N,"hex");function he(e,r,t,n){return n<=0?e=r=t=NaN:t<=0||t>=1?e=r=NaN:r<=0&&(e=NaN),new w(e,r,t,n)}f(he,"hsla");function ge(e){if(e instanceof w)return new w(e.h,e.s,e.l,e.opacity);if(e instanceof B||(e=v(e)),!e)return new w;if(e instanceof w)return e;e=e.rgb();var r=e.r/255,t=e.g/255,n=e.b/255,i=Math.min(r,t,n),o=Math.max(r,t,n),a=NaN,s=o-i,x=(o+i)/2;return s?(r===o?a=(t-n)/s+(t<n)*6:t===o?a=(n-r)/s+2:a=(r-t)/s+4,s/=x<.5?o+i:2-o-i,a*=60):s=x>0&&x<1?0:a,new w(a,s,x,e.opacity)}f(ge,"hslConvert");function me(e,r,t,n){return arguments.length===1?ge(e):new w(e,r,t,n??1)}f(me,"hsl");function w(e,r,t,n){this.h=+e,this.s=+r,this.l=+t,this.opacity=+n}f(w,"Hsl");S(w,me,W(B,{brighter(e){return e=e==null?Y:Math.pow(Y,e),new w(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?C:Math.pow(C,e),new w(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,n=t+(t<.5?t:1-t)*r,i=2*t-n;return new d(Z(e>=240?e-240:e+120,i,n),Z(e,i,n),Z(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new w(de(this.h),j(this.s),j(this.l),L(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=L(this.opacity);return`${e===1?"hsl(":"hsla("}${de(this.h)}, ${j(this.s)*100}%, ${j(this.l)*100}%${e===1?")":`, ${e})`}`}}));function de(e){return e=(e||0)%360,e<0?e+360:e}f(de,"clamph");function j(e){return Math.max(0,Math.min(1,e||0))}f(j,"clampt");function Z(e,r,t){return(e<60?r+(t-r)*e/60:e<180?t:e<240?r+(t-r)*(240-e)/60:r)*255}f(Z,"hsl2rgb");function F(e,r,t,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*r+(4-6*o+3*a)*t+(1+3*e+3*o-3*a)*n+a*i)/6}f(F,"basis");function J(e){var r=e.length-1;return function(t){var n=t<=0?t=0:t>=1?(t=1,r-1):Math.floor(t*r),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,s=n<r-1?e[n+2]:2*o-i;return F((t-n/r)*r,a,i,o,s)}}f(J,"default");function U(e){var r=e.length;return function(t){var n=Math.floor(((t%=1)<0?++t:t)*r),i=e[(n+r-1)%r],o=e[n%r],a=e[(n+1)%r],s=e[(n+2)%r];return F((t-n/r)*r,i,o,a,s)}}f(U,"default");var I=f(e=>()=>e,"default");function De(e,r){return function(t){return e+t*r}}f(De,"linear");function Oe(e,r,t){return e=Math.pow(e,t),r=Math.pow(r,t)-e,t=1/t,function(n){return Math.pow(e+n*r,t)}}f(Oe,"exponential");function be(e){return(e=+e)==1?T:function(r,t){return t-r?Oe(r,t,e):I(isNaN(r)?t:r)}}f(be,"gamma");function T(e,r){var t=r-e;return t?De(e,t):I(isNaN(e)?r:e)}f(T,"nogamma");var D=f((function e(r){var t=be(r);function n(i,o){var a=t((i=H(i)).r,(o=H(o)).r),s=t(i.g,o.g),x=t(i.b,o.b),l=T(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=x(u),i.opacity=l(u),i+""}}return f(n,"rgb"),n.gamma=e,n}),"rgbGamma")(1);function we(e){return function(r){var t=r.length,n=new Array(t),i=new Array(t),o=new Array(t),a,s;for(a=0;a<t;++a)s=H(r[a]),n[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return n=e(n),i=e(i),o=e(o),s.opacity=1,function(x){return s.r=n(x),s.g=i(x),s.b=o(x),s+""}}}f(we,"rgbSpline");var ze=we(J),Pe=we(U);function ee(e,r){r||(r=[]);var t=e?Math.min(r.length,e.length):0,n=r.slice(),i;return function(o){for(i=0;i<t;++i)n[i]=e[i]*(1-o)+r[i]*o;return n}}f(ee,"default");function ye(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}f(ye,"isNumberArray");function ve(e,r){var t=r?r.length:0,n=e?Math.min(t,e.length):0,i=new Array(n),o=new Array(t),a;for(a=0;a<n;++a)i[a]=M(e[a],r[a]);for(;a<t;++a)o[a]=r[a];return function(s){for(a=0;a<n;++a)o[a]=i[a](s);return o}}f(ve,"genericArray");function re(e,r){var t=new Date;return e=+e,r=+r,function(n){return t.setTime(e*(1-n)+r*n),t}}f(re,"default");function g(e,r){return e=+e,r=+r,function(t){return e*(1-t)+r*t}}f(g,"default");function te(e,r){var t={},n={},i;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(i in r)i in e?t[i]=M(e[i],r[i]):n[i]=r[i];return function(o){for(i in t)n[i]=t[i](o);return n}}f(te,"default");var fe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ne=new RegExp(fe.source,"g");function Ve(e){return function(){return e}}f(Ve,"zero");function Qe(e){return function(r){return e(r)+""}}f(Qe,"one");function O(e,r){var t=fe.lastIndex=ne.lastIndex=0,n,i,o,a=-1,s=[],x=[];for(e=e+"",r=r+"";(n=fe.exec(e))&&(i=ne.exec(r));)(o=i.index)>t&&(o=r.slice(t,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,x.push({i:a,x:g(n,i)})),t=ne.lastIndex;return t<r.length&&(o=r.slice(t),s[a]?s[a]+=o:s[++a]=o),s.length<2?x[0]?Qe(x[0].x):Ve(r):(r=x.length,function(l){for(var u=0,c;u<r;++u)s[(c=x[u]).i]=c.x(l);return s.join("")})}f(O,"default");function M(e,r){var t=typeof r,n;return r==null||t==="boolean"?I(r):(t==="number"?g:t==="string"?(n=v(r))?(r=n,D):O:r instanceof v?D:r instanceof Date?re:ye(r)?ee:Array.isArray(r)?ve:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?te:g)(e,r)}f(M,"default");var Ge=1e-12;function Me(e){return((e=Math.exp(e))+1/e)/2}f(Me,"cosh");function Ke(e){return((e=Math.exp(e))-1/e)/2}f(Ke,"sinh");function We(e){return((e=Math.exp(2*e))-1)/(e+1)}f(We,"tanh");var Ze=f((function e(r,t,n){function i(o,a){var s=o[0],x=o[1],l=o[2],u=a[0],c=a[1],p=a[2],h=u-s,b=c-x,m=h*h+b*b,$,A;if(m<Ge)A=Math.log(p/l)/r,$=f(function(X){return[s+X*h,x+X*b,l*Math.exp(r*X*A)]},"i");else{var Q=Math.sqrt(m),G=(p*p-l*l+n*m)/(2*l*t*Q),K=(p*p-l*l-n*m)/(2*p*t*Q),q=Math.log(Math.sqrt(G*G+1)-G),qe=Math.log(Math.sqrt(K*K+1)-K);A=(qe-q)/r,$=f(function(X){var ie=X*A,ae=Me(q),oe=l/(t*Q)*(ae*We(r*ie+q)-Ke(q));return[s+oe*h,x+oe*b,l*ae/Me(r*ie+q)]},"i")}return $.duration=A*1e3*r/Math.SQRT2,$}return f(i,"zoom"),i.rho=function(o){var a=Math.max(.001,+o),s=a*a,x=s*s;return e(a,s,x)},i}),"zoomRho")(Math.SQRT2,2,4);function $e(e,r){return e=+e,r=+r,function(t){return Math.round(e*(1-t)+r*t)}}f($e,"default");var Ne=180/Math.PI,z={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function P(e,r,t,n,i,o){var a,s,x;return(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a),(x=e*t+r*n)&&(t-=e*x,n-=r*x),(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s,x/=s),e*n<r*t&&(e=-e,r=-r,x=-x,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(r,e)*Ne,skewX:Math.atan(x)*Ne,scaleX:a,scaleY:s}}f(P,"default");var V;function ke(e){let r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?z:P(r.a,r.b,r.c,r.d,r.e,r.f)}f(ke,"parseCss");function Re(e){return e==null?z:(V||(V=document.createElementNS("http://www.w3.org/2000/svg","g")),V.setAttribute("transform",e),(e=V.transform.baseVal.consolidate())?(e=e.matrix,P(e.a,e.b,e.c,e.d,e.e,e.f)):z)}f(Re,"parseSvg");function He(e,r,t,n){function i(l){return l.length?l.pop()+" ":""}f(i,"pop");function o(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push("translate(",null,r,null,t);b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c||p)&&h.push("translate("+c+r+p+t)}f(o,"translate");function a(l,u,c,p){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),p.push({i:c.push(i(c)+"rotate(",null,n)-2,x:g(l,u)})):u&&c.push(i(c)+"rotate("+u+n)}f(a,"rotate");function s(l,u,c,p){l!==u?p.push({i:c.push(i(c)+"skewX(",null,n)-2,x:g(l,u)}):u&&c.push(i(c)+"skewX("+u+n)}f(s,"skewX");function x(l,u,c,p,h,b){if(l!==c||u!==p){var m=h.push(i(h)+"scale(",null,",",null,")");b.push({i:m-4,x:g(l,c)},{i:m-2,x:g(u,p)})}else(c!==1||p!==1)&&h.push(i(h)+"scale("+c+","+p+")")}return f(x,"scale"),function(l,u){var c=[],p=[];return l=e(l),u=e(u),o(l.translateX,l.translateY,u.translateX,u.translateY,c,p),a(l.rotate,u.rotate,c,p),s(l.skewX,u.skewX,c,p),x(l.scaleX,l.scaleY,u.scaleX,u.scaleY,c,p),l=u=null,function(h){for(var b=-1,m=p.length,$;++b<m;)c[($=p[b]).i]=$.x(h);return c.join("")}}}f(He,"interpolateTransform");var Fe=He(ke,"px, ","px)","deg)"),Je=He(Re,", ",")",")");function Ae(e,r){r===void 0&&(r=e,e=M);for(var t=0,n=r.length-1,i=r[0],o=new Array(n<0?0:n);t<n;)o[t]=e(i,i=r[++t]);return function(a){var s=Math.max(0,Math.min(n-1,Math.floor(a*=n)));return o[s](a-s)}}f(Ae,"piecewise");export{v as a,D as b,g as c,O as d,M as e,$e as f,Fe as g,Je as h,Ze as i,Ae as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var _={clearCapturedMail:"__lunora_admin__:clearCapturedMail",clearQueueMessages:"__lunora_admin__:clearQueueMessages",clearTable:"__lunora_admin__:clearTable",createWorkflowInstance:"__lunora_admin__:createWorkflowInstance",deleteRows:"__lunora_admin__:deleteRows",describeTable:"__lunora_admin__:describeTable",describeTables:"__lunora_admin__:describeTables",exportShard:"__lunora_admin__:exportShard",facetColumn:"__lunora_admin__:facetColumn",getAdvisories:"__lunora_admin__:getAdvisories",getAuditLog:"__lunora_admin__:getAuditLog",getAuthMetrics:"__lunora_admin__:getAuthMetrics",getCapturedMail:"__lunora_admin__:getCapturedMail",getFanoutMetrics:"__lunora_admin__:getFanoutMetrics",getFunctionStats:"__lunora_admin__:getFunctionStats",listFlags:"__lunora_admin__:listFlags",listQueues:"__lunora_admin__:listQueues",listSubscriptions:"__lunora_admin__:listSubscriptions",listTableIndexes:"__lunora_admin__:listTableIndexes",listWorkflows:"__lunora_admin__:listWorkflows",getLogs:"__lunora_admin__:getLogs",getMetrics:"__lunora_admin__:getMetrics",getPitrBookmark:"__lunora_admin__:getPitrBookmark",getQueueMessages:"__lunora_admin__:getQueueMessages",getRequestLog:"__lunora_admin__:getRequestLog",getSecurityAudit:"__lunora_admin__:getSecurityAudit",getSettings:"__lunora_admin__:getSettings",getWorkflowInstanceStatus:"__lunora_admin__:getWorkflowInstanceStatus",importShard:"__lunora_admin__:importShard",listTables:"__lunora_admin__:listTables",maskPolicies:"__lunora_admin__:maskPolicies",migrationStatus:"__lunora_admin__:migrationStatus",pitrRestore:"__lunora_admin__:pitrRestore",readTablePage:"__lunora_admin__:readTablePage",replayQueueMessage:"__lunora_admin__:replayQueueMessage",rlsPolicies:"__lunora_admin__:rlsPolicies",runAs:"__lunora_admin__:runAs",runMigration:"__lunora_admin__:runMigration",runSql:"__lunora_admin__:runSql",sendQueueMessage:"__lunora_admin__:sendQueueMessage",sendTestMail:"__lunora_admin__:sendTestMail",storageOrphans:"__lunora_admin__:storageOrphans",storageReferences:"__lunora_admin__:storageReferences",storageRules:"__lunora_admin__:storageRules",studioFeatures:"__lunora_admin__:studioFeatures",writeRow:"__lunora_admin__:writeRow"};export{_ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as $}from"./chunk-TQ36RWOP.js";import{a as M}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as j}from"./chunk-BOXSWNXZ.js";import{b as H}from"./chunk-RHZ4M2NZ.js";import{a as K,e as O}from"./chunk-SEU5V7I6.js";import{b as F}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as B}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as U,e as L,f as G,g as J,h as X}from"./chunk-RRCPZMC2.js";var q=L(J(),1),te=L(G(),1);var r=L(X(),1);var Y={binding:"outline",secret:"destructive",var:"secondary"},me=U(a=>{let e=(0,q.c)(68),{initialShardKey:z}=a,t=B(),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let R=z??"",T;e[1]!==R?(T={shardKey:R},e[1]=R,e[2]=T):T=e[2];let{data:k,error:d,errorSource:S,isLoading:A}=H(j.getSettings,N,T),D;e:{let s=k?.deploy;if(s===void 0){let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[3]=l):l=e[3],D=l;break e}let o;if(e[4]!==s.deploymentId||e[5]!==s.environment||e[6]!==s.versionTag||e[7]!==s.workerUrl||e[8]!==t){if(o=[],s.workerUrl!==void 0){let l;e[10]!==t?(l=t("URL"),e[10]=t,e[11]=l):l=e[11];let i;e[12]!==s.workerUrl||e[13]!==l?(i={label:l,value:s.workerUrl},e[12]=s.workerUrl,e[13]=l,e[14]=i):i=e[14],o.push(i)}if(s.environment!==void 0){let l;e[15]!==t?(l=t("Environment"),e[15]=t,e[16]=l):l=e[16];let i;e[17]!==s.environment||e[18]!==l?(i={label:l,value:s.environment},e[17]=s.environment,e[18]=l,e[19]=i):i=e[19],o.push(i)}if(s.deploymentId!==void 0){let l;e[20]!==t?(l=t("Deployment"),e[20]=t,e[21]=l):l=e[21];let i;e[22]!==s.deploymentId||e[23]!==l?(i={label:l,value:s.deploymentId},e[22]=s.deploymentId,e[23]=l,e[24]=i):i=e[24],o.push(i)}if(s.versionTag!==void 0){let l;e[25]!==t?(l=t("Version"),e[25]=t,e[26]=l):l=e[26];let i;e[27]!==s.versionTag||e[28]!==l?(i={label:l,value:s.versionTag},e[27]=s.versionTag,e[28]=l,e[29]=i):i=e[29],o.push(i)}e[4]=s.deploymentId,e[5]=s.environment,e[6]=s.versionTag,e[7]=s.workerUrl,e[8]=t,e[9]=o}else o=e[9];D=o}let w=D,_;e[30]!==k?.settings?(_=k?.settings??[],e[30]=k?.settings,e[31]=_):_=e[31];let n=_,m;e[32]!==t?(m=t("Open in Cloudflare"),e[32]=t,e[33]=m):m=e[33];let f;e[34]!==m?(f=(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:$,rel:"noreferrer",target:"_blank",children:m},void 0,!1)},void 0,!1),e[34]=m,e[35]=f):f=e[35];let c;e[36]!==t?(c=t("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[36]=t,e[37]=c):c=e[37];let v;e[38]!==c?(v=(0,r.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:c},void 0,!1),e[38]=c,e[39]=v):v=e[39];let p;e[40]!==d||e[41]!==S?(p=d!==null&&(0,r.jsxDEV)(M,{error:S,testId:"set-error"},void 0,!1),e[40]=d,e[41]=S,e[42]=p):p=e[42];let u;e[43]!==w||e[44]!==t?(u=w.length>0&&(0,r.jsxDEV)(K,{className:"py-0","data-testid":"set-deploy",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Deployment")},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{className:"py-3",children:(0,r.jsxDEV)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:w.map(Z)},void 0,!1)},void 0,!1)]},void 0,!0),e[43]=w,e[44]=t,e[45]=u):u=e[45];let h;e[46]!==t?(h=t("Environment & bindings"),e[46]=t,e[47]=h):h=e[47];let g;e[48]!==h?(g=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h},void 0,!1)},void 0,!1),e[48]=h,e[49]=g):g=e[49];let x;e[50]!==d||e[51]!==A||e[52]!==n.length||e[53]!==t?(x=d===null&&!A&&n.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:t("No environment variables or bindings.")},void 0,!1),e[50]=d,e[51]=A,e[52]=n.length,e[53]=t,e[54]=x):x=e[54];let b;e[55]!==n||e[56]!==t?(b=n.length>0&&(0,r.jsxDEV)(O,{className:"px-0 py-0",children:(0,r.jsxDEV)(P,{"data-testid":"set-table",children:[(0,r.jsxDEV)(Q,{children:(0,r.jsxDEV)(V,{children:[(0,r.jsxDEV)(C,{children:t("name")},void 0,!1),(0,r.jsxDEV)(C,{children:t("kind")},void 0,!1),(0,r.jsxDEV)(C,{children:t("value")},void 0,!1)]},void 0,!0)},void 0,!1),(0,r.jsxDEV)(W,{children:n.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1),e[55]=n,e[56]=t,e[57]=b):b=e[57];let y;e[58]!==g||e[59]!==x||e[60]!==b?(y=(0,r.jsxDEV)(K,{className:"py-0",children:[g,x,b]},void 0,!0),e[58]=g,e[59]=x,e[60]=b,e[61]=y):y=e[61];let I;return e[62]!==p||e[63]!==u||e[64]!==y||e[65]!==f||e[66]!==v?(I=(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-settings",children:[f,v,p,u,y]},void 0,!0),e[62]=p,e[63]=u,e[64]=y,e[65]=f,e[66]=v,e[67]=I):I=e[67],I},"SettingsPanel");function Z(a){return(0,r.jsxDEV)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,r.jsxDEV)("dt",{className:"text-muted-foreground",children:a.label},void 0,!1),(0,r.jsxDEV)("dd",{className:"truncate font-mono text-xs",title:a.value,children:a.value},void 0,!1)]},a.label,!0)}U(Z,"_temp");function ee(a){return(0,r.jsxDEV)(V,{"data-testid":"set-row",children:[(0,r.jsxDEV)(E,{className:"font-mono text-xs font-medium",children:a.name},void 0,!1),(0,r.jsxDEV)(E,{children:(0,r.jsxDEV)(F,{variant:Y[a.kind],children:a.bindingType??a.kind},void 0,!1)},void 0,!1),(0,r.jsxDEV)(E,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:a.value??(0,r.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.name,!0)}U(ee,"_temp2");export{me as SettingsPanel};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r,e as p,f as m}from"./chunk-RRCPZMC2.js";function d(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}r(d,"mergeObjects");var R={};function h(e,t,n,o,i){if(!n&&!o&&!i&&!e)return y(t);let c=y(e);return t&&(c=E(c,t)),n&&(c=E(c,n)),o&&(c=E(c,o)),i&&(c=E(c,i)),c}r(h,"mergeProps");function T(e){if(e.length===0)return R;if(e.length===1)return y(e[0]);let t=y(e[0]);for(let n=1;n<e.length;n+=1)t=E(t,e[n]);return t}r(T,"mergePropsN");function y(e){return b(e)?{...x(e,R)}:K(e)}r(y,"createInitialMergedProps");function E(e,t){return b(t)?x(t,e):q(e,t)}r(E,"mergeInto");function K(e){let t={...e};for(let n in t){let o=t[n];_(n,o)&&(t[n]=k(o))}return t}r(K,"copyInitialProps");function q(e,t){if(!t)return e;for(let n in t){let o=t[n];switch(n){case"style":{e[n]=d(e.style,o);break}case"className":{e[n]=v(e.className,o);break}default:_(n,o)?e[n]=Q(e[n],o):e[n]=o}}return e}r(q,"mutablyMergeInto");function _(e,t){let n=e.charCodeAt(0),o=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&o===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}r(_,"isEventHandler");function b(e){return typeof e=="function"}r(b,"isPropsGetter");function x(e,t){return b(e)?e(t):e??R}r(x,"resolvePropsGetter");function Q(e,t){return t?e?(...n)=>{let o=n[0];if(V(o)){let c=o;M(c);let s=t(...n);return c.baseUIHandlerPrevented||e?.(...n),s}let i=t(...n);return e?.(...n),i}:k(t):e}r(Q,"mergeEventHandlers");function k(e){return e&&((...t)=>{let n=t[0];return V(n)&&M(n),e(...t)})}r(k,"wrapEventHandler");function M(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}r(M,"makeEventPreventable");function v(e,t){return t?e?t+" "+e:t:e}r(v,"mergeClassNames");function V(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}r(V,"isSyntheticEvent");var f=p(m(),1);var S=p(m(),1);var j={};function N(e,t){let n=S.useRef(j);return n.current===j&&(n.current=e(t)),n}r(N,"useRefWithInit");function g(e,t,n,o){let i=N(L).current;return X(i,e,t,n,o)&&$(i,[e,t,n,o]),i.callback}r(g,"useMergedRefs");function U(e){let t=N(L).current;return ee(t,e)&&$(t,e),t.callback}r(U,"useMergedRefsN");function L(){return{callback:null,cleanup:null,refs:[]}}r(L,"createForkRef");function X(e,t,n,o,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==i}r(X,"didChange");function ee(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}r(ee,"didChangeN");function $(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){let o=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){let c=t[i];if(c!=null)switch(typeof c){case"function":{let s=c(n);typeof s=="function"&&(o[i]=s);break}case"object":{c.current=n;break}default:}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){let c=t[i];if(c!=null)switch(typeof c){case"function":{let s=o[i];typeof s=="function"?s():c(null);break}case"object":{c.current=null;break}default:}}}}}}r($,"update");var Y=p(m(),1);var B=p(m(),1);var te=parseInt(B.version,10);function D(e){return te>=e}r(D,"isReactVersionAtLeast");function A(e){if(!Y.isValidElement(e))return null;let t=e,n=t.props;return(D(19)?n?.ref:t.ref)??null}r(A,"getReactElementRef");var I;I=new Set;function z(...e){{let t=e.join(" ");I.has(t)||(I.add(t),console.warn(`Base UI: ${t}`))}}r(z,"warn");function Ce(){}r(Ce,"NOOP");var Oe=Object.freeze([]),l=Object.freeze({});function W(e,t){let n={};for(let o in e){let i=e[o];if(t?.hasOwnProperty(o)){let c=t[o](i);c!=null&&Object.assign(n,c);continue}i===!0?n[`data-${o.toLowerCase()}`]="":i&&(n[`data-${o.toLowerCase()}`]=i.toString())}return n}r(W,"getStateAttributesProps");function Z(e,t){return typeof e=="function"?e(t):e}r(Z,"resolveClassName");function F(e,t){return typeof e=="function"?e(t):e}r(F,"resolveStyle");var P=p(m(),1);function Fe(e,t,n={}){let o=t.render,i=ne(t,n);if(n.enabled===!1)return null;let c=n.state??l;return se(e,o,i,c)}r(Fe,"useRenderElement");function ne(e,t={}){let{className:n,style:o,render:i}=e,{state:c=l,ref:s,props:w,stateAttributesMapping:G,enabled:a=!0}=t,C=a?Z(n,c):void 0,O=a?F(o,c):void 0,H=a?W(c,G):l,J=a&&w?re(w):void 0,u=a?d(H,J)??{}:l;return typeof document<"u"&&(a?Array.isArray(s)?u.ref=U([u.ref,A(i),...s]):u.ref=g(u.ref,A(i),s):g(null,null)),a?(C!==void 0&&(u.className=v(u.className,C)),O!==void 0&&(u.style=d(u.style,O)),u):l}r(ne,"useRenderElementProps");function re(e){return Array.isArray(e)?T(e):h(void 0,e)}r(re,"resolveRenderFunctionProps");var oe=Symbol.for("react.lazy"),ie=/^[A-Z][A-Za-z0-9$]*$/,ce=/[a-z]/;function se(e,t,n,o){if(t){if(typeof t=="function")return ue(t),t(n,o);let i=h(n,t.props);i.ref=n.ref;let c=t;if(c?.$$typeof===oe&&(c=f.Children.toArray(t)[0]),!f.isValidElement(c))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
|
|
2
|
+
`));return f.cloneElement(c,i)}if(e&&typeof e=="string")return fe(e,n);throw new Error("Base UI: Render element or function are not defined.")}r(se,"evaluateRenderProp");function ue(e){let t=e.name;t.length!==0&&ie.test(t)&&ce.test(t)&&z(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}r(ue,"warnIfRenderPropLooksLikeComponent");function fe(e,t){return e==="button"?(0,P.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,P.createElement)("img",{alt:"",...t,key:t.key}):f.createElement(e,t)}r(fe,"renderTag");export{h as a,M as b,N as c,g as d,D as e,z as f,Ce as g,Oe as h,l as i,Fe as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _}from"./chunk-3OA7PECS.js";import{a as n,e as E,f as S}from"./chunk-RRCPZMC2.js";var u=E(_(),1),o="base-ui-disable-scrollbar",d={className:o,getElement(t){return(0,u.jsx)("style",{nonce:t,href:o,precedence:"base-ui:low",children:`.${o}{scrollbar-width:none}.${o}::-webkit-scrollbar{display:none}`})}};d.getElement.displayName="styleDisableScrollbar.getElement";var s=E(S(),1);var p=s.createContext(void 0);p.displayName="CSPContext";var N={disableStyleElements:!1};function C(){return s.useContext(p)??N}n(C,"useCSPContext");function f(t,e=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,r))}n(f,"clamp");var m=1;function h(t,e){return Math.max(0,t-e)}n(h,"getMaxScrollOffset");function O(t,e){if(e<=0)return 0;let r=f(t,0,e),c=r,l=e-r,a=c<=m,i=l<=m;return a&&i?c<=l?0:e:a?0:i?e:r}n(O,"normalizeScrollOffset");export{d as a,C as b,f as c,m as d,h as e,O as f};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{a,c as te,e as de,f as qe}from"./chunk-RRCPZMC2.js";var pe=te((he,W)=>{(function(e,r){typeof define=="function"&&define.amd?define([],r):typeof W=="object"&&W.exports?W.exports=r():e.moo=r()})(he,function(){"use strict";var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString,t=typeof new RegExp().sticky=="boolean";function s(n){return n&&r.call(n)==="[object RegExp]"}a(s,"isRegExp");function i(n){return n&&typeof n=="object"&&!s(n)&&!Array.isArray(n)}a(i,"isObject");function l(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,function(o){return o==="-"?"\\x2d":"\\"+o})}a(l,"reEscape");function c(n){var o=new RegExp("|"+n);return o.exec("").length-1}a(c,"reGroups");function h(n){return"("+n+")"}a(h,"reCapture");function v(n){if(!n.length)return"(?!)";var o=n.map(function(u){return"(?:"+u+")"}).join("|");return"(?:"+o+")"}a(v,"reUnion");function S(n){if(typeof n=="string")return"(?:"+l(n)+")";if(s(n)){if(n.ignoreCase)throw new Error("RegExp /i flag not allowed");if(n.global)throw new Error("RegExp /g flag is implied");if(n.sticky)throw new Error("RegExp /y flag is implied");if(n.multiline)throw new Error("RegExp /m flag is implied");return n.source}else throw new Error("Not a pattern: "+n)}a(S,"regexpOrLiteral");function k(n,o){return n.length>o?n:Array(o-n.length+1).join(" ")+n}a(k,"pad");function M(n,o){for(var u=n.length,f=0;;){var g=n.lastIndexOf(`
|
|
2
|
+
`,u-1);if(g===-1||(f++,u=g,f===o)||u===0)break}var d=f<o?0:u+1;return n.substring(d).split(`
|
|
3
|
+
`)}a(M,"lastNLines");function K(n){for(var o=Object.getOwnPropertyNames(n),u=[],f=0;f<o.length;f++){var g=o[f],d=n[g],m=[].concat(d);if(g==="include"){for(var w=0;w<m.length;w++)u.push({include:m[w]});continue}var y=[];m.forEach(function(p){i(p)?(y.length&&u.push($(g,y)),u.push($(g,p)),y=[]):y.push(p)}),y.length&&u.push($(g,y))}return u}a(K,"objectToRules");function O(n){for(var o=[],u=0;u<n.length;u++){var f=n[u];if(f.include){for(var g=[].concat(f.include),d=0;d<g.length;d++)o.push({include:g[d]});continue}if(!f.type)throw new Error("Rule has no type: "+JSON.stringify(f));o.push($(f.type,f))}return o}a(O,"arrayToRules");function $(n,o){if(i(o)||(o={match:o}),o.include)throw new Error("Matching rules cannot also include states");var u={defaultType:n,lineBreaks:!!o.error||!!o.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var f in o)e.call(o,f)&&(u[f]=o[f]);if(typeof u.type=="string"&&n!==u.type)throw new Error("Type transform cannot be a string (type '"+u.type+"' for token '"+n+"')");var g=u.match;return u.match=Array.isArray(g)?g:g?[g]:[],u.match.sort(function(d,m){return s(d)&&s(m)?0:s(m)?-1:s(d)?1:m.length-d.length}),u}a($,"ruleOptions");function C(n){return Array.isArray(n)?O(n):K(n)}a(C,"toRules");var N=$("error",{lineBreaks:!0,shouldThrow:!0});function F(n,o){for(var u=null,f=Object.create(null),g=!0,d=null,m=[],w=[],y=0;y<n.length;y++)n[y].fallback&&(g=!1);for(var y=0;y<n.length;y++){var p=n[y];if(p.include)throw new Error("Inheritance is not allowed in stateless lexers");if(p.error||p.fallback){if(u)throw!p.fallback==!u.fallback?new Error("Multiple "+(p.fallback?"fallback":"error")+" rules not allowed (for token '"+p.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+p.defaultType+"')");u=p}var _=p.match.slice();if(g)for(;_.length&&typeof _[0]=="string"&&_[0].length===1;){var D=_.shift();f[D.charCodeAt(0)]=p}if(p.pop||p.push||p.next){if(!o)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+p.defaultType+"')");if(p.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+p.defaultType+"')")}if(_.length!==0){g=!1,m.push(p);for(var P=0;P<_.length;P++){var q=_[P];if(s(q)){if(d===null)d=q.unicode;else if(d!==q.unicode&&p.fallback===!1)throw new Error("If one rule is /u then all must be")}}var I=v(_.map(S)),T=new RegExp(I);if(T.test(""))throw new Error("RegExp matches empty string: "+T);var U=c(I);if(U>0)throw new Error("RegExp has capture groups: "+T+`
|
|
4
|
+
Use (?: \u2026 ) instead`);if(!p.lineBreaks&&T.test(`
|
|
5
|
+
`))throw new Error("Rule should declare lineBreaks: "+T);w.push(h(I))}}var R=u&&u.fallback,L=t&&!R?"ym":"gm",H=t||R?"":"|";d===!0&&(L+="u");var Pe=new RegExp(v(w)+H,L);return{regexp:Pe,groups:m,fast:f,error:u||N}}a(F,"compileRules");function X(n){var o=F(C(n));return new b({start:o},"start")}a(X,"compile");function fe(n,o,u){var f=n&&(n.push||n.next);if(f&&!u[f])throw new Error("Missing state '"+f+"' (in token '"+n.defaultType+"' of state '"+o+"')");if(n&&n.pop&&+n.pop!=1)throw new Error("pop must be 1 (in token '"+n.defaultType+"' of state '"+o+"')")}a(fe,"checkStateGroup");function $e(n,o){var u=n.$all?C(n.$all):[];delete n.$all;var f=Object.getOwnPropertyNames(n);o||(o=f[0]);for(var g=Object.create(null),d=0;d<f.length;d++){var m=f[d];g[m]=C(n[m]).concat(u)}for(var d=0;d<f.length;d++)for(var m=f[d],w=g[m],y=Object.create(null),p=0;p<w.length;p++){var _=w[p];if(_.include){var D=[p,1];if(_.include!==m&&!y[_.include]){y[_.include]=!0;var P=g[_.include];if(!P)throw new Error("Cannot include nonexistent state '"+_.include+"' (in state '"+m+"')");for(var q=0;q<P.length;q++){var I=P[q];w.indexOf(I)===-1&&D.push(I)}}w.splice.apply(w,D),p--}}for(var T=Object.create(null),d=0;d<f.length;d++){var m=f[d];T[m]=F(g[m],!0)}for(var d=0;d<f.length;d++){for(var U=f[d],R=T[U],L=R.groups,p=0;p<L.length;p++)fe(L[p],U,T);for(var H=Object.getOwnPropertyNames(R.fast),p=0;p<H.length;p++)fe(R.fast[H[p]],U,T)}return new b(T,o)}a($e,"compileStates");function Be(n){for(var o=typeof Map<"u",u=o?new Map:Object.create(null),f=Object.getOwnPropertyNames(n),g=0;g<f.length;g++){var d=f[g],m=n[d],w=Array.isArray(m)?m:[m];w.forEach(function(y){if(typeof y!="string")throw new Error("keyword must be string (in keyword '"+d+"')");o?u.set(y,d):u[y]=d})}return function(y){return o?u.get(y):u[y]}}a(Be,"keywordTransform");var b=a(function(n,o){this.startState=o,this.states=n,this.buffer="",this.stack=[],this.reset()},"Lexer");b.prototype.reset=function(n,o){return this.buffer=n||"",this.index=0,this.line=o?o.line:1,this.col=o?o.col:1,this.queuedToken=o?o.queuedToken:null,this.queuedText=o?o.queuedText:"",this.queuedThrow=o?o.queuedThrow:null,this.setState(o?o.state:this.startState),this.stack=o&&o.stack?o.stack.slice():[],this},b.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},b.prototype.setState=function(n){if(!(!n||this.state===n)){this.state=n;var o=this.states[n];this.groups=o.groups,this.error=o.error,this.re=o.regexp,this.fast=o.fast}},b.prototype.popState=function(){this.setState(this.stack.pop())},b.prototype.pushState=function(n){this.stack.push(this.state),this.setState(n)};var Ce=t?function(n,o){return n.exec(o)}:function(n,o){var u=n.exec(o);return u[0].length===0?null:u};b.prototype._getGroup=function(n){for(var o=this.groups.length,u=0;u<o;u++)if(n[u+1]!==void 0)return this.groups[u];throw new Error("Cannot find token type for matched text")};function De(){return this.value}if(a(De,"tokenToString"),b.prototype.next=function(){var n=this.index;if(this.queuedGroup){var o=this._token(this.queuedGroup,this.queuedText,n);return this.queuedGroup=null,this.queuedText="",o}var u=this.buffer;if(n!==u.length){var m=this.fast[u.charCodeAt(n)];if(m)return this._token(m,u.charAt(n),n);var f=this.re;f.lastIndex=n;var g=Ce(f,u),d=this.error;if(g==null)return this._token(d,u.slice(n,u.length),n);var m=this._getGroup(g),w=g[0];return d.fallback&&g.index!==n?(this.queuedGroup=m,this.queuedText=w,this._token(d,u.slice(n,g.index),n)):this._token(m,w,n)}},b.prototype._token=function(n,o,u){var f=0;if(n.lineBreaks){var g=/\n/g,d=1;if(o===`
|
|
6
|
+
`)f=1;else for(;g.exec(o);)f++,d=g.lastIndex}var m={type:typeof n.type=="function"&&n.type(o)||n.defaultType,value:typeof n.value=="function"?n.value(o):o,text:o,toString:De,offset:u,lineBreaks:f,line:this.line,col:this.col},w=o.length;if(this.index+=w,this.line+=f,f!==0?this.col=w-d+1:this.col+=w,n.shouldThrow){var y=new Error(this.formatError(m,"invalid syntax"));throw y}return n.pop?this.popState():n.push?this.pushState(n.push):n.next&&this.setState(n.next),m},typeof Symbol<"u"&&Symbol.iterator){var ee=a(function(n){this.lexer=n},"LexerIterator");ee.prototype.next=function(){var n=this.lexer.next();return{value:n,done:!n}},ee.prototype[Symbol.iterator]=function(){return this},b.prototype[Symbol.iterator]=function(){return new ee(this)}}return b.prototype.formatError=function(n,o){if(n==null)var u=this.buffer.slice(this.index),n={text:u,offset:this.index,lineBreaks:u.indexOf(`
|
|
7
|
+
`)===-1?0:1,line:this.line,col:this.col};var f=2,g=Math.max(n.line-f,1),d=n.line+f,m=String(d).length,w=M(this.buffer,this.line-n.line+f+1).slice(0,5),y=[];y.push(o+" at line "+n.line+" col "+n.col+":"),y.push("");for(var p=0;p<w.length;p++){var _=w[p],D=g+p;y.push(k(String(D),m)+" "+_),D===n.line&&y.push(k("",m+n.col+1)+"^")}return y.join(`
|
|
8
|
+
`)},b.prototype.clone=function(){return new b(this.states,this.state)},b.prototype.has=function(n){return!0},{compile:X,states:$e,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:Be}})});var ge=te(A=>{"use strict";var Ne=A&&A.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(A,"__esModule",{value:!0});A.lexer=A.states=void 0;var Fe=Ne(pe());A.states={body:{doubleapos:{match:"''",value:a(()=>"'","value")},quoted:{lineBreaks:!0,match:/'[{}#](?:[^']|'')*'(?!')/u,value:a(e=>e.slice(1,-1).replace(/''/g,"'"),"value")},argument:{lineBreaks:!0,match:/\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,push:"arg",value:a(e=>e.substring(1).trim(),"value")},octothorpe:"#",end:{match:"}",pop:1},content:{lineBreaks:!0,match:/[^][^{}#']*/u}},arg:{select:{lineBreaks:!0,match:/,\s*(?:plural|select|selectordinal)\s*,\s*/u,next:"select",value:a(e=>e.split(",")[1].trim(),"value")},"func-args":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,next:"body",value:a(e=>e.split(",")[1].trim(),"value")},"func-simple":{lineBreaks:!0,match:/,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,value:a(e=>e.substring(1).trim(),"value")},end:{match:"}",pop:1}},select:{offset:{lineBreaks:!0,match:/\s*offset\s*:\s*\d+\s*/u,value:a(e=>e.split(":")[1].trim(),"value")},case:{lineBreaks:!0,match:/\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,push:"body",value:a(e=>e.substring(0,e.indexOf("{")).trim(),"value")},end:{match:/\s*\}/u,pop:1}}};A.lexer=Fe.default.states(A.states)});var ve=te(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.ParseError=void 0;z.parse=Ue;var ye=ge(),j=a(e=>({offset:e.offset,line:e.line,col:e.col,text:e.text,lineBreaks:e.lineBreaks}),"getContext"),re=a(e=>e==="plural"||e==="select"||e==="selectordinal","isSelectType");function Ie(e,r){let t="",s="";for(let l of r){let c=l.ctx.text;switch(s+=c,l.type){case"content":t+=l.value;break;case"argument":case"function":case"octothorpe":t+=c;break;default:throw new x(e,`Unsupported part in strict mode function arg style: ${c}`)}}return[{type:"content",value:t.trim(),ctx:Object.assign({},r[0].ctx,{text:s})}]}a(Ie,"strictArgStyleParam");var Re=["number","date","time","spellout","ordinal","duration"],me=["zero","one","two","few","many","other"],x=class extends Error{static{a(this,"ParseError")}constructor(r,t){super(ye.lexer.formatError(r,t))}};z.ParseError=x;var ne=class{static{a(this,"Parser")}constructor(r,t){var s,i,l,c;this.lexer=ye.lexer.reset(r),this.cardinalKeys=(s=t?.cardinal)!==null&&s!==void 0?s:me,this.ordinalKeys=(i=t?.ordinal)!==null&&i!==void 0?i:me,this.strict=(l=t?.strict)!==null&&l!==void 0?l:!1,this.strictPluralKeys=(c=t?.strictPluralKeys)!==null&&c!==void 0?c:!0}parse(){return this.parseBody(!1,!0)}checkSelectKey(r,t,s){if(s[0]==="="){if(t==="select")throw new x(r,`The case ${s} is not valid with select`)}else if(t!=="select"){let i=t==="plural"?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&i.length>0&&!i.includes(s)){let l=`The ${t} case ${s} is not valid in this locale`;throw new x(r,l)}}}parseSelect({value:r},t,s,i){let l={type:i,arg:r,cases:[],ctx:s};i==="plural"||i==="selectordinal"?t=!0:this.strict&&(t=!1);for(let c of this.lexer)switch(c.type){case"offset":if(i==="select")throw new x(c,"Unexpected plural offset for select");if(l.cases.length>0)throw new x(c,"Plural offset must be set before cases");l.pluralOffset=Number(c.value),s.text+=c.text,s.lineBreaks+=c.lineBreaks;break;case"case":{this.checkSelectKey(c,i,c.value),l.cases.push({key:c.value,tokens:this.parseBody(t),ctx:j(c)});break}case"end":return l;default:throw new x(c,`Unexpected lexer token: ${c.type}`)}throw new x(null,"Unexpected message end")}parseArgToken(r,t){let s=j(r),i=this.lexer.next();if(!i)throw new x(null,"Unexpected message end");if(s.text+=i.text,s.lineBreaks+=i.lineBreaks,this.strict&&(i.type==="func-simple"||i.type==="func-args")&&!Re.includes(i.value)){let l=`Invalid strict mode function arg type: ${i.value}`;throw new x(r,l)}switch(i.type){case"end":return{type:"argument",arg:r.value,ctx:s};case"func-simple":{let l=this.lexer.next();if(!l)throw new x(null,"Unexpected message end");if(l.type!=="end")throw new x(l,`Unexpected lexer token: ${l.type}`);if(s.text+=l.text,re(i.value.toLowerCase()))throw new x(i,`Invalid type identifier: ${i.value}`);return{type:"function",arg:r.value,key:i.value,ctx:s}}case"func-args":{if(re(i.value.toLowerCase())){let c=`Invalid type identifier: ${i.value}`;throw new x(i,c)}let l=this.parseBody(this.strict?!1:t);return this.strict&&l.length>0&&(l=Ie(r,l)),{type:"function",arg:r.value,key:i.value,param:l,ctx:s}}case"select":if(re(i.value))return this.parseSelect(r,t,s,i.value);throw new x(i,`Unexpected select type ${i.value}`);default:throw new x(i,`Unexpected lexer token: ${i.type}`)}}parseBody(r,t){let s=[],i=null;for(let l of this.lexer)if(l.type==="argument")i&&(i=null),s.push(this.parseArgToken(l,r));else if(l.type==="octothorpe"&&r)i&&(i=null),s.push({type:"octothorpe",ctx:j(l)});else{if(l.type==="end"&&!t)return s;{let c=l.value;if(!r&&l.type==="quoted"&&c[0]==="#"){if(c.includes("{")){let h=`Unsupported escape pattern: ${c}`;throw new x(l,h)}c=l.text}i?(i.value+=c,i.ctx.text+=l.text,i.ctx.lineBreaks+=l.lineBreaks):(i={type:"content",value:c,ctx:j(l)},s.push(i))}}if(t)return s;throw new x(null,"Unexpected message end")}};function Ue(e,r={}){return new ne(e,r).parse()}a(Ue,"parse")});var _e=de(ve(),1);var E=class extends Error{static{a(this,"DateFormatError")}constructor(r,t,s){super(r),this.token=t,this.type=s||"error"}},we=a(e=>e<4?"short":e===4?"long":"narrow","alpha"),G=a(e=>e%2===0?"2-digit":"numeric","numeric");function Le(e,r){switch(e.char){case"y":return{year:G(e.width)};case"r":return{calendar:"gregory",year:"numeric"};default:return r(`${e.desc} is not supported; falling back to year:numeric`,E.WARNING),{year:"numeric"}}}a(Le,"yearOptions");function ze(e,r){switch(e.width){case 1:return"numeric";case 2:return"2-digit";case 3:return"short";case 4:return"long";case 5:return"narrow";default:r(`${e.desc} is not supported with width ${e.width}`);return}}a(ze,"monthStyle");function Ge(e,r){let{char:t,desc:s,width:i}=e;if(t==="d")return G(i);r(`${s} is not supported`)}a(Ge,"dayStyle");function Ke(e,r){let{char:t,desc:s,width:i}=e;if((t==="c"||t==="e")&&i<3){let l=`Numeric value is not supported for ${s}; falling back to weekday:short`;r(l,E.WARNING)}return we(i)}a(Ke,"weekdayStyle");function He(e){let r=G(e.width),t;switch(e.char){case"h":t="h12";break;case"H":t="h23";break;case"k":t="h24";break;case"K":t="h11";break}return t?{hour:r,hourCycle:t}:{hour:r}}a(He,"hourOptions");function We(e,r){let{char:t,desc:s,width:i}=e;switch(t){case"v":case"z":return i===4?"long":"short";case"V":if(i===4)return"long";r(`${s} is not supported with width ${i}`);return;case"X":r(`${s} is not supported`);return}return"short"}a(We,"timeZoneNameStyle");function je(e,r){switch(e.field){case"era":return{era:we(e.width)};case"year":return Le(e,r);case"month":return{month:ze(e,r)};case"day":return{day:Ge(e,r)};case"weekday":return{weekday:Ke(e,r)};case"period":return;case"hour":return He(e);case"min":return{minute:G(e.width)};case"sec":return{second:G(e.width)};case"tz":return{timeZoneName:We(e,r)};case"quarter":case"week":case"sec-frac":case"ms":r(`${e.desc} is not supported`)}}a(je,"compileOptions");function se(e,r,t=s=>{throw s}){let s={timeZone:r},i=[];for(let l of e){let{error:c,field:h,str:v}=l;if(c){let k=new E(c.message,l);k.stack=c.stack,t(k)}if(v){let k=`Ignoring string part: ${v}`;t(new E(k,l,E.WARNING))}h&&(i.indexOf(h)===-1?i.push(h):t(new E(`Duplicate ${h} token`,l)));let S=je(l,(k,M)=>t(new E(k,l,M)));S&&Object.assign(s,S)}return s}a(se,"getDateFormatOptions");var Ze={G:{field:"era",desc:"Era"},y:{field:"year",desc:"Year"},Y:{field:"year",desc:'Year of "Week of Year"'},u:{field:"year",desc:"Extended year"},U:{field:"year",desc:"Cyclic year name"},r:{field:"year",desc:"Related Gregorian year"},Q:{field:"quarter",desc:"Quarter"},q:{field:"quarter",desc:"Stand-alone quarter"},M:{field:"month",desc:"Month in year"},L:{field:"month",desc:"Stand-alone month in year"},w:{field:"week",desc:"Week of year"},W:{field:"week",desc:"Week of month"},d:{field:"day",desc:"Day in month"},D:{field:"day",desc:"Day of year"},F:{field:"day",desc:"Day of week in month"},g:{field:"day",desc:"Modified julian day"},E:{field:"weekday",desc:"Day of week"},e:{field:"weekday",desc:"Local day of week"},c:{field:"weekday",desc:"Stand-alone local day of week"},a:{field:"period",desc:"AM/PM marker"},b:{field:"period",desc:"AM/PM/noon/midnight marker"},B:{field:"period",desc:"Flexible day period"},h:{field:"hour",desc:"Hour in AM/PM (1~12)"},H:{field:"hour",desc:"Hour in day (0~23)"},k:{field:"hour",desc:"Hour in day (1~24)"},K:{field:"hour",desc:"Hour in AM/PM (0~11)"},j:{field:"hour",desc:"Hour in preferred cycle"},J:{field:"hour",desc:"Hour in preferred cycle without marker"},C:{field:"hour",desc:"Hour in preferred cycle with flexible marker"},m:{field:"min",desc:"Minute in hour"},s:{field:"sec",desc:"Second in minute"},S:{field:"sec-frac",desc:"Fractional second"},A:{field:"ms",desc:"Milliseconds in day"},z:{field:"tz",desc:"Time Zone: specific non-location"},Z:{field:"tz",desc:"Time Zone"},O:{field:"tz",desc:"Time Zone: localized"},v:{field:"tz",desc:"Time Zone: generic non-location"},V:{field:"tz",desc:"Time Zone: ID"},X:{field:"tz",desc:"Time Zone: ISO8601 with Z"},x:{field:"tz",desc:"Time Zone: ISO8601"}},xe=a(e=>e>="A"&&e<="Z"||e>="a"&&e<="z","isLetter");function Je(e,r){let t=e[r],s=1;for(;e[++r]===t;)++s;let i=Ze[t];if(!i){let l=`The letter ${t} is not a valid field identifier`;return{char:t,error:new Error(l),width:s}}return{char:t,field:i.field,desc:i.desc,width:s}}a(Je,"readFieldToken");function Ye(e,r){let t=e[++r],s=2;if(t==="'")return{char:"'",str:t,width:s};for(;;){let i=e[++r];if(++s,i===void 0){let l=`Unterminated quoted literal in pattern: ${t||e}`;return{char:"'",error:new Error(l),str:t,width:s}}else if(i==="'"){if(e[++r]!=="'")return{char:"'",str:t,width:s};++s}t+=i}}a(Ye,"readQuotedToken");function Qe(e,r){let t=e[r];if(!t)return null;if(xe(t))return Je(e,r);if(t==="'")return Ye(e,r);let s=t,i=1;for(;;){let l=e[++r];if(!l||xe(l)||l==="'")return{char:t,str:s,width:i};s+=l,i+=1}}a(Qe,"readToken");function Z(e){let r=[],t=0;for(;;){let s=Qe(e,t);if(!s)return r;r.push(s),t+=s.width}}a(Z,"parseDateTokens");function be(e,r){return e.filter(t=>t.type!=="content").length?e.map(t=>{if(t.type==="content")return r(t.value);if(t.type==="octothorpe")return"#";if(t.type==="argument")return[t.arg];if(t.type==="function"){let l=t?.param?.[0];if(t.key==="date"&&l){let c=Ve(l.value.trim(),h=>{throw new Error(`Unable to compile date expression: ${h.message}`)});return[t.arg,t.key,c]}return l?[t.arg,t.key,l.value.trim()]:[t.arg,t.key]}let s=t.pluralOffset,i={};return t.cases.forEach(({key:l,tokens:c})=>{let h=l[0]==="="?l.slice(1):l;i[h]=be(c,r)}),[t.arg,t.type,{offset:s,...i}]}):e.map(t=>r(t.value))}a(be,"processTokens");function Ve(e,r){if(/^::/.test(e)){let t=Z(e.substring(2));return se(t,void 0,r)}return e}a(Ve,"compileDateExpression");function Xe(e,r=t=>t){return be((0,_e.parse)(e),r)}a(Xe,"compileMessageOrThrow");function J(e,r=t=>t){try{return Xe(e,r)}catch(t){return console.error(`${t.message}
|
|
9
|
+
|
|
10
|
+
Message: ${e}`),[e]}}a(J,"compileMessage");var B=a(e=>typeof e=="string","isString"),et=a(e=>typeof e=="function","isFunction"),ke=new Map,Te="en";function le(e){return[...Array.isArray(e)?e:[e],Te]}a(le,"normalizeLocales");function ce(e,r,t){let s=le(e);t||(t="default");let i;if(typeof t=="string")switch(i={day:"numeric",month:"short",year:"numeric"},t){case"full":i.weekday="long";case"long":i.month="long";break;case"short":i.month="numeric";break}else i=t;return Y(()=>Q("date",s,t),()=>new Intl.DateTimeFormat(s,i)).format(B(r)?new Date(r):r)}a(ce,"date");function tt(e,r,t){let s;if(t||(t="default"),typeof t=="string")switch(s={second:"numeric",minute:"numeric",hour:"numeric"},t){case"full":case"long":s.timeZoneName="short";break;case"short":delete s.second}else s=t;return ce(e,r,s)}a(tt,"time");function ie(e,r,t){let s=le(e);return Y(()=>Q("number",s,t),()=>new Intl.NumberFormat(s,t)).format(r)}a(ie,"number");function Se(e,r,t,{offset:s=0,...i}){let l=le(e),c=r?Y(()=>Q("plural-ordinal",l),()=>new Intl.PluralRules(l,{type:"ordinal"})):Y(()=>Q("plural-cardinal",l),()=>new Intl.PluralRules(l,{type:"cardinal"}));return i[t]??i[c.select(t-s)]??i.other}a(Se,"plural");function Y(e,r){let t=e(),s=ke.get(t);return s||(s=r(),ke.set(t,s)),s}a(Y,"getMemoized");function Q(e,r,t){let s=r.join("-");return`${e}-${s}-${JSON.stringify(t)}`}a(Q,"cacheKey");var Ee=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Oe=a(e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(r,t,s)=>{if(t){let i=parseInt(t,16);return String.fromCharCode(i)}else{let i=parseInt(s,16);return String.fromCharCode(i)}}),"decodeEscapeSequences"),Ae="%__lingui_octothorpe__%",rt=a((e,r,t={})=>{let s=r||e,i=a(c=>typeof c=="object"?c:t[c],"style"),l=a((c,h)=>{let v=Object.keys(t).length?i("number"):void 0,S=ie(s,c,v);return h.replace(new RegExp(Ae,"g"),S)},"replaceOctothorpe");return{plural:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!1,c,h);return l(c-v,S)},"plural"),selectordinal:a((c,h)=>{let{offset:v=0}=h,S=Se(s,!0,c,h);return l(c-v,S)},"selectordinal"),select:nt,number:a((c,h)=>ie(s,c,i(h)||{style:h}),"number"),date:a((c,h)=>ce(s,c,i(h)||h),"date"),time:a((c,h)=>tt(s,c,i(h)||h),"time")}},"getDefaultFormats"),nt=a((e,r)=>r[e]??r.other,"selectFormatter");function st(e,r,t){return(s={},i)=>{let l=rt(r,t,i),c=a((v,S=!1)=>Array.isArray(v)?v.reduce((k,M)=>{if(M==="#"&&S)return k+Ae;if(B(M))return k+M;let[K,O,$]=M,C={};O==="plural"||O==="selectordinal"||O==="select"?Object.entries($).forEach(([F,X])=>{C[F]=c(X,O==="plural"||O==="selectordinal")}):C=$;let N;if(O){let F=l[O];N=F(s[K],C)}else N=s[K];return N==null?k:k+N},""):v,"formatMessage"),h=c(e);return B(h)&&Ee.test(h)?Oe(h):B(h)?h:h?String(h):""}}a(st,"interpolate");var ae=class{static{a(this,"EventEmitter")}_events={};on(r,t){return this._events[r]??=new Set,this._events[r].add(t),()=>this.removeListener(r,t)}removeListener(r,t){let s=this._events[r];s?.delete(t),s?.size===0&&delete this._events[r]}emit(r,...t){let s=this._events[r];if(s)for(let i of[...s])i.apply(this,t)}},oe=class extends ae{static{a(this,"I18n")}_locale="";_locales;_messages={};_missing;_messageCompiler;constructor(r){super(),this.setMessagesCompiler(J),r.missing!=null&&(this._missing=r.missing),r.messages!=null&&this.load(r.messages),(typeof r.locale=="string"||r.locales)&&this.activate(r.locale??Te,r.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(r){return this._messageCompiler=r,this}_load(r,t){let s=this._messages[r];s?Object.assign(s,t):this._messages[r]=t}load(r,t){typeof r=="string"&&typeof t=="object"?this._load(r,t):Object.entries(r).forEach(([s,i])=>this._load(s,i)),this.emit("change")}loadAndActivate({locale:r,locales:t,messages:s}){this._locale=r,this._locales=t||void 0,this._messages[this._locale]=s,this.emit("change")}activate(r,t){this._messages[r]||console.warn(`Messages for locale "${r}" not loaded.`),this._locale=r,this._locales=t,this.emit("change")}_(r,t,s){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let i=s?.message;r||(r=""),B(r)||(t=r.values||t,i=r.message,r=r.id);let l=this.messages[r],c=l===void 0,h=this._missing;if(h&&c)return et(h)?h(this._locale,r):h;c&&this.emit("missing",{id:r,locale:this._locale});let v=l||i||r;return B(v)&&(this._messageCompiler?v=this._messageCompiler(v):console.warn(`Uncompiled message detected! Message:
|
|
11
|
+
|
|
12
|
+
> ${v}
|
|
13
|
+
|
|
14
|
+
That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
|
|
15
|
+
ICU features such as interpolation and plurals will not work properly for that message.
|
|
16
|
+
|
|
17
|
+
Please compile your catalog first.
|
|
18
|
+
`)),B(v)&&Ee.test(v)?Oe(v):B(v)?v:st(v,this._locale,this._locales)(t,s?.formats)}t=this._.bind(this);date(r,t){return ce(this._locales||this._locale,r,t)}number(r,t){return ie(this._locales||this._locale,r,t)}};function ue(e={}){return new oe(e)}a(ue,"setupI18n");var qt=ue();var V=de(qe(),1);var it={},Me="en",at={en:it},ot=a((e=Me,r=at)=>{let t=ue();t.setMessagesCompiler(J);for(let[s,i]of Object.entries(r))t.load(s,i);return t.activate(r[e]===void 0?Me:e),t},"createStudioI18n"),lt=ot(),ct=(0,V.createContext)(lt),Ut=a(()=>{let e=(0,V.use)(ct);return(r,t)=>e._(r,t)},"useT");var Gt=a(e=>({__lunoraRef:e}),"adminRef"),Kt=a(e=>{let r=e.trim();return r===""?{}:{shardKey:r}},"callOptions"),Ht=a(e=>e instanceof Error?e.message:String(e),"errorMessage"),Wt=a(e=>{if(e===null||typeof e!="object"||!("hint"in e))return;let{hint:r}=e;return typeof r=="string"?r:Array.isArray(r)?r.filter(t=>typeof t=="string").join(`
|
|
19
|
+
`):void 0},"errorHint"),jt=a(e=>{if(e===null||typeof e!="object"||!("docsUrl"in e))return;let r=e.docsUrl;if(typeof r=="string")try{let{protocol:t}=new URL(r);return t==="http:"||t==="https:"?r:void 0}catch{return}},"errorDocumentationUrl"),Zt=a(e=>{if(e==null)return"";switch(typeof e){case"bigint":case"boolean":case"number":return e.toString();case"string":return e;case"symbol":return e.toString();default:return JSON.stringify(e)}},"formatCell"),ut=a((e,r)=>{e.catch(t=>{})},"fireAndForget"),Jt=a(e=>{if(e!==void 0&&e!=="")return e;let r=globalThis.location;return r?.origin!==void 0&&r.origin!==""?r.origin:"http://localhost:5173"},"resolveOrigin"),Yt=a(e=>{let r="navigator"in globalThis?globalThis.navigator.clipboard:void 0;return r===void 0?!1:(ut(r.writeText(e)),!0)},"copyToClipboard"),Qt=a(e=>{if(e==null)return"\u2014";if(e<1024)return`${e.toString()} B`;let r=["KB","MB","GB","TB"],t=e/1024,s=0;for(;t>=1024&&s<r.length-1;)t/=1024,s+=1;return`${t.toFixed(1)} ${r[s]??"TB"}`},"formatBytes"),Vt=a((e,r="")=>{if(e==null||e==="")return r;let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString()},"formatTimestamp");export{ot as a,lt as b,ct as c,Ut as d,Gt as e,Kt as f,Ht as g,Wt as h,jt as i,Zt as j,ut as k,Jt as l,Yt as m,Qt as n,Vt as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as At,b as re}from"./chunk-KA5YB3VP.js";import{a as Dt}from"./chunk-AHILM3ZP.js";import{a as It}from"./chunk-J6J54MBP.js";import{a as pt,b as yt,c as Ct,d as Ze,e as ae,f as ne}from"./chunk-GTM65MVX.js";import{a as xt}from"./chunk-VLXV72QE.js";import{a as zt}from"./chunk-JSEXCW5Q.js";import{R as Y}from"./chunk-3CJW6NWG.js";import{c as E}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as me}from"./chunk-TAD43CG5.js";import{a as ce}from"./chunk-RHZ4M2NZ.js";import{a as ht,e as bt}from"./chunk-SEU5V7I6.js";import"./chunk-CKSHCYGC.js";import{f as ie}from"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as X,j as z,k as St,o as Nt}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as n,e as vt,f as Rt,g as Et,h as Lt}from"./chunk-RRCPZMC2.js";var W=vt(Et(),1);var L=vt(Rt(),1);var o=vt(Lt(),1);var Tt=n(t=>{let e=JSON.parse(t);if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Expected a JSON object");return e},"parseJsonObject"),jt=n(t=>{let e=Tt(t),l={};for(let[d,f]of Object.entries(e)){if(!Array.isArray(f)||f.some(r=>typeof r!="string"))throw new TypeError(`"${d}" must map to an array of action strings`);l[d]=f}return l},"parsePermission"),Mt=n(t=>t==null||t===""?"":typeof t=="string"?t:JSON.stringify(t,null,2),"jsonInitial"),K=n(t=>{let e=(0,W.c)(6),{children:l,htmlFor:d,label:f}=t,r;e[0]!==d||e[1]!==f?(r=(0,o.jsxDEV)(zt,{htmlFor:d,children:f},void 0,!1),e[0]=d,e[1]=f,e[2]=r):r=e[2];let i;return e[3]!==l||e[4]!==r?(i=(0,o.jsxDEV)("div",{className:"flex flex-col gap-1",children:[r,l]},void 0,!0),e[3]=l,e[4]=r,e[5]=i):i=e[5],i},"Field"),de=n(({busy:t,canSubmit:e,children:l,destructive:d=!1,error:f,onClose:r,onSubmit:i,submitLabel:s,testId:a,title:m})=>{let c=X();return(0,o.jsxDEV)(Dt,{label:m,onClose:r,panelTestId:`${a}-panel`,testId:`${a}-overlay`,variant:"dialog",children:[(0,o.jsxDEV)("h2",{className:"text-sm font-semibold text-foreground",children:m},void 0,!1),l,f!==null&&(0,o.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":`${a}-error`,role:"alert",children:f},void 0,!1),(0,o.jsxDEV)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,o.jsxDEV)(E,{"data-testid":`${a}-cancel`,onClick:r,size:"sm",type:"button",variant:"outline",children:c("Cancel")},void 0,!1),(0,o.jsxDEV)(E,{"data-testid":`${a}-submit`,disabled:t||!e,onClick:i,size:"sm",type:"button",variant:d?"destructive":"default",children:t?c("Saving\u2026"):s},void 0,!1)]},void 0,!0)]},void 0,!0)},"DialogForm"),Ot=n(t=>{let e=(0,W.c)(79),{mode:l,onClose:d,onDone:f,org:r}=t,i=ie(),s=X(),{busy:a,error:m,run:c}=re(),k;e[0]!==r?(k=r?z(r.name):"",e[0]=r,e[1]=k):k=e[1];let[u,g]=(0,L.useState)(k),y;e[2]!==r?(y=r?z(r.slug):"",e[2]=r,e[3]=y):y=e[3];let[h,b]=(0,L.useState)(y),w;e[4]!==r?(w=r?z(r.logo):"",e[4]=r,e[5]=w):w=e[5];let[p,I]=(0,L.useState)(w),[v,S]=(0,L.useState)(""),C;e[6]!==l||e[7]!==r?.metadata?(C=l==="edit"?Mt(r?.metadata):"",e[6]=l,e[7]=r?.metadata,e[8]=C):C=e[8];let[x,N]=(0,L.useState)(C),_;e[9]!==i||e[10]!==p||e[11]!==x||e[12]!==l||e[13]!==u||e[14]!==d||e[15]!==f||e[16]!==r?.id||e[17]!==v||e[18]!==c||e[19]!==h?(_=n(()=>{c(async()=>{let V=x.trim()===""?void 0:Tt(x);l==="create"?await i.createAuthOrganization({logo:p.trim()===""?void 0:p.trim(),metadata:V,name:u.trim(),ownerId:v.trim()===""?void 0:v.trim(),slug:h.trim()===""?void 0:h.trim()}):await i.updateAuthOrganization({logo:p.trim()===""?void 0:p.trim(),metadata:V,name:u.trim()===""?void 0:u.trim(),organizationId:z(r?.id),slug:h.trim()===""?void 0:h.trim()}),f(),d()})},"t5"),e[9]=i,e[10]=p,e[11]=x,e[12]=l,e[13]=u,e[14]=d,e[15]=f,e[16]=r?.id,e[17]=v,e[18]=c,e[19]=h,e[20]=_):_=e[20];let A=_,D;e[21]!==l||e[22]!==u?(D=u.trim()!==""||l==="edit",e[21]=l,e[22]=u,e[23]=D):D=e[23];let T;e[24]!==l||e[25]!==s?(T=s(l==="create"?"Create":"Save"),e[24]=l,e[25]=s,e[26]=T):T=e[26];let $;e[27]!==l||e[28]!==s?($=s(l==="create"?"New organization":"Edit organization"),e[27]=l,e[28]=s,e[29]=$):$=e[29];let j;e[30]!==s?(j=s("name"),e[30]=s,e[31]=j):j=e[31];let U;e[32]===Symbol.for("react.memo_cache_sentinel")?(U=n(V=>{g(V.target.value)},"t10"),e[32]=U):U=e[32];let P;e[33]!==u?(P=(0,o.jsxDEV)(Y,{"data-testid":"org-form-name",id:"org-form-name",onChange:U,value:u},void 0,!1),e[33]=u,e[34]=P):P=e[34];let Q;e[35]!==P||e[36]!==j?(Q=(0,o.jsxDEV)(K,{htmlFor:"org-form-name",label:j,children:P},void 0,!1),e[35]=P,e[36]=j,e[37]=Q):Q=e[37];let J;e[38]!==s?(J=s("Slug (optional \u2014 derived from name)"),e[38]=s,e[39]=J):J=e[39];let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=n(V=>{b(V.target.value)},"t14"),e[40]=q):q=e[40];let M;e[41]!==h?(M=(0,o.jsxDEV)(Y,{"data-testid":"org-form-slug",id:"org-form-slug",onChange:q,value:h},void 0,!1),e[41]=h,e[42]=M):M=e[42];let F;e[43]!==J||e[44]!==M?(F=(0,o.jsxDEV)(K,{htmlFor:"org-form-slug",label:J,children:M},void 0,!1),e[43]=J,e[44]=M,e[45]=F):F=e[45];let B;e[46]!==s?(B=s("Logo URL (optional)"),e[46]=s,e[47]=B):B=e[47];let oe;e[48]===Symbol.for("react.memo_cache_sentinel")?(oe=n(V=>{I(V.target.value)},"t18"),e[48]=oe):oe=e[48];let Z;e[49]!==p?(Z=(0,o.jsxDEV)(Y,{"data-testid":"org-form-logo",id:"org-form-logo",onChange:oe,value:p},void 0,!1),e[49]=p,e[50]=Z):Z=e[50];let ee;e[51]!==B||e[52]!==Z?(ee=(0,o.jsxDEV)(K,{htmlFor:"org-form-logo",label:B,children:Z},void 0,!1),e[51]=B,e[52]=Z,e[53]=ee):ee=e[53];let O;e[54]!==l||e[55]!==v||e[56]!==s?(O=l==="create"&&(0,o.jsxDEV)(K,{htmlFor:"org-form-owner",label:s("Owner user id (optional)"),children:(0,o.jsxDEV)(Y,{"data-testid":"org-form-owner",id:"org-form-owner",onChange:n(V=>{S(V.target.value)},"onChange"),value:v},void 0,!1)},void 0,!1),e[54]=l,e[55]=v,e[56]=s,e[57]=O):O=e[57];let te;e[58]!==s?(te=s("Metadata (JSON, optional)"),e[58]=s,e[59]=te):te=e[59];let G;e[60]===Symbol.for("react.memo_cache_sentinel")?(G=n(V=>{N(V.target.value)},"t23"),e[60]=G):G=e[60];let le;e[61]!==x?(le=(0,o.jsxDEV)(xt,{"data-testid":"org-form-metadata",id:"org-form-metadata",onChange:G,value:x},void 0,!1),e[61]=x,e[62]=le):le=e[62];let H;e[63]!==te||e[64]!==le?(H=(0,o.jsxDEV)(K,{htmlFor:"org-form-metadata",label:te,children:le},void 0,!1),e[63]=te,e[64]=le,e[65]=H):H=e[65];let se;return e[66]!==a||e[67]!==m||e[68]!==d||e[69]!==A||e[70]!==Q||e[71]!==F||e[72]!==ee||e[73]!==O||e[74]!==H||e[75]!==D||e[76]!==T||e[77]!==$?(se=(0,o.jsxDEV)(de,{busy:a,canSubmit:D,error:m,onClose:d,onSubmit:A,submitLabel:T,testId:"org-form",title:$,children:[Q,F,ee,O,H]},void 0,!0),e[66]=a,e[67]=m,e[68]=d,e[69]=A,e[70]=Q,e[71]=F,e[72]=ee,e[73]=O,e[74]=H,e[75]=D,e[76]=T,e[77]=$,e[78]=se):se=e[78],se},"OrgFormDialog"),Pt=n(t=>{let e=(0,W.c)(40),{onClose:l,onDone:d,organizationId:f}=t,r=ie(),i=X(),{busy:s,error:a,run:m}=re(),[c,k]=(0,L.useState)(""),[u,g]=(0,L.useState)(""),y;e[0]!==r||e[1]!==l||e[2]!==d||e[3]!==f||e[4]!==u||e[5]!==m||e[6]!==c?(y=n(()=>{m(async()=>{await r.addAuthOrgMember({organizationId:f,role:u.trim()===""?void 0:u.trim(),userId:c.trim()}),d(),l()})},"t1"),e[0]=r,e[1]=l,e[2]=d,e[3]=f,e[4]=u,e[5]=m,e[6]=c,e[7]=y):y=e[7];let h=y,b;e[8]!==c?(b=c.trim(),e[8]=c,e[9]=b):b=e[9];let w=b!=="",p;e[10]!==i?(p=i("Add member"),e[10]=i,e[11]=p):p=e[11];let I;e[12]!==i?(I=i("Add member"),e[12]=i,e[13]=I):I=e[13];let v;e[14]!==i?(v=i("User id"),e[14]=i,e[15]=v):v=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=n($=>{k($.target.value)},"t7"),e[16]=S):S=e[16];let C;e[17]!==c?(C=(0,o.jsxDEV)(Y,{"data-testid":"org-add-member-user",id:"org-add-member-user",onChange:S,value:c},void 0,!1),e[17]=c,e[18]=C):C=e[18];let x;e[19]!==v||e[20]!==C?(x=(0,o.jsxDEV)(K,{htmlFor:"org-add-member-user",label:v,children:C},void 0,!1),e[19]=v,e[20]=C,e[21]=x):x=e[21];let N;e[22]!==i?(N=i("Role (optional)"),e[22]=i,e[23]=N):N=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=n($=>{g($.target.value)},"t11"),e[24]=_):_=e[24];let A;e[25]!==u?(A=(0,o.jsxDEV)(Y,{"data-testid":"org-add-member-role",id:"org-add-member-role",onChange:_,value:u},void 0,!1),e[25]=u,e[26]=A):A=e[26];let D;e[27]!==N||e[28]!==A?(D=(0,o.jsxDEV)(K,{htmlFor:"org-add-member-role",label:N,children:A},void 0,!1),e[27]=N,e[28]=A,e[29]=D):D=e[29];let T;return e[30]!==s||e[31]!==a||e[32]!==l||e[33]!==h||e[34]!==D||e[35]!==w||e[36]!==p||e[37]!==I||e[38]!==x?(T=(0,o.jsxDEV)(de,{busy:s,canSubmit:w,error:a,onClose:l,onSubmit:h,submitLabel:p,testId:"org-add-member",title:I,children:[x,D]},void 0,!0),e[30]=s,e[31]=a,e[32]=l,e[33]=h,e[34]=D,e[35]=w,e[36]=p,e[37]=I,e[38]=x,e[39]=T):T=e[39],T},"MemberAddDialog"),Qt=n(t=>{let e=(0,W.c)(40),{onClose:l,onDone:d,organizationId:f}=t,r=ie(),i=X(),{busy:s,error:a,run:m}=re(),[c,k]=(0,L.useState)(""),[u,g]=(0,L.useState)(""),y;e[0]!==r||e[1]!==c||e[2]!==l||e[3]!==d||e[4]!==f||e[5]!==u||e[6]!==m?(y=n(()=>{m(async()=>{await r.inviteAuthOrgMember({email:c.trim(),organizationId:f,role:u.trim()===""?void 0:u.trim()}),d(),l()})},"t1"),e[0]=r,e[1]=c,e[2]=l,e[3]=d,e[4]=f,e[5]=u,e[6]=m,e[7]=y):y=e[7];let h=y,b;e[8]!==c?(b=c.trim(),e[8]=c,e[9]=b):b=e[9];let w=b!=="",p;e[10]!==i?(p=i("Send invitation"),e[10]=i,e[11]=p):p=e[11];let I;e[12]!==i?(I=i("Invite member"),e[12]=i,e[13]=I):I=e[13];let v;e[14]!==i?(v=i("email"),e[14]=i,e[15]=v):v=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=n($=>{k($.target.value)},"t7"),e[16]=S):S=e[16];let C;e[17]!==c?(C=(0,o.jsxDEV)(Y,{"data-testid":"org-invite-member-email",id:"org-invite-member-email",onChange:S,type:"email",value:c},void 0,!1),e[17]=c,e[18]=C):C=e[18];let x;e[19]!==v||e[20]!==C?(x=(0,o.jsxDEV)(K,{htmlFor:"org-invite-member-email",label:v,children:C},void 0,!1),e[19]=v,e[20]=C,e[21]=x):x=e[21];let N;e[22]!==i?(N=i("Role (optional)"),e[22]=i,e[23]=N):N=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=n($=>{g($.target.value)},"t11"),e[24]=_):_=e[24];let A;e[25]!==u?(A=(0,o.jsxDEV)(Y,{"data-testid":"org-invite-member-role",id:"org-invite-member-role",onChange:_,value:u},void 0,!1),e[25]=u,e[26]=A):A=e[26];let D;e[27]!==N||e[28]!==A?(D=(0,o.jsxDEV)(K,{htmlFor:"org-invite-member-role",label:N,children:A},void 0,!1),e[27]=N,e[28]=A,e[29]=D):D=e[29];let T;return e[30]!==s||e[31]!==a||e[32]!==l||e[33]!==h||e[34]!==D||e[35]!==w||e[36]!==p||e[37]!==I||e[38]!==x?(T=(0,o.jsxDEV)(de,{busy:s,canSubmit:w,error:a,onClose:l,onSubmit:h,submitLabel:p,testId:"org-invite-member",title:I,children:[x,D]},void 0,!0),e[30]=s,e[31]=a,e[32]=l,e[33]=h,e[34]=D,e[35]=w,e[36]=p,e[37]=I,e[38]=x,e[39]=T):T=e[39],T},"MemberInviteDialog"),Jt=n(t=>{let e=(0,W.c)(32),{member:l,onClose:d,onDone:f}=t,r=ie(),i=X(),{busy:s,error:a,run:m}=re(),c;e[0]!==l.role?(c=z(l.role),e[0]=l.role,e[1]=c):c=e[1];let[k,u]=(0,L.useState)(c),g;e[2]!==r||e[3]!==l.id||e[4]!==d||e[5]!==f||e[6]!==k||e[7]!==m?(g=n(()=>{m(async()=>{await r.setAuthOrgMemberRole({memberId:z(l.id),role:k.trim()}),f(),d()})},"t2"),e[2]=r,e[3]=l.id,e[4]=d,e[5]=f,e[6]=k,e[7]=m,e[8]=g):g=e[8];let y=g,h;e[9]!==k?(h=k.trim(),e[9]=k,e[10]=h):h=e[10];let b=h!=="",w;e[11]!==i?(w=i("Save"),e[11]=i,e[12]=w):w=e[12];let p;e[13]!==i?(p=i("Change member role"),e[13]=i,e[14]=p):p=e[14];let I;e[15]!==i?(I=i("Role"),e[15]=i,e[16]=I):I=e[16];let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=n(N=>{u(N.target.value)},"t8"),e[17]=v):v=e[17];let S;e[18]!==k?(S=(0,o.jsxDEV)(Y,{"data-testid":"org-member-role-value",id:"org-member-role-value",onChange:v,value:k},void 0,!1),e[18]=k,e[19]=S):S=e[19];let C;e[20]!==I||e[21]!==S?(C=(0,o.jsxDEV)(K,{htmlFor:"org-member-role-value",label:I,children:S},void 0,!1),e[20]=I,e[21]=S,e[22]=C):C=e[22];let x;return e[23]!==s||e[24]!==a||e[25]!==d||e[26]!==y||e[27]!==C||e[28]!==b||e[29]!==w||e[30]!==p?(x=(0,o.jsxDEV)(de,{busy:s,canSubmit:b,error:a,onClose:d,onSubmit:y,submitLabel:w,testId:"org-member-role",title:p,children:C},void 0,!1),e[23]=s,e[24]=a,e[25]=d,e[26]=y,e[27]=C,e[28]=b,e[29]=w,e[30]=p,e[31]=x):x=e[31],x},"MemberRoleDialog"),_t=n(t=>{let e=(0,W.c)(36),{mode:l,onClose:d,onDone:f,organizationId:r,team:i}=t,s=ie(),a=X(),{busy:m,error:c,run:k}=re(),u;e[0]!==i?(u=i?z(i.name):"",e[0]=i,e[1]=u):u=e[1];let[g,y]=(0,L.useState)(u),h;e[2]!==s||e[3]!==l||e[4]!==g||e[5]!==d||e[6]!==f||e[7]!==r||e[8]!==k||e[9]!==i?.id?(h=n(()=>{k(async()=>{await(l==="create"?s.createAuthOrgTeam({name:g.trim(),organizationId:r}):s.updateAuthOrgTeam({name:g.trim(),teamId:z(i?.id)})),f(),d()})},"t2"),e[2]=s,e[3]=l,e[4]=g,e[5]=d,e[6]=f,e[7]=r,e[8]=k,e[9]=i?.id,e[10]=h):h=e[10];let b=h,w;e[11]!==g?(w=g.trim(),e[11]=g,e[12]=w):w=e[12];let p=w!=="",I;e[13]!==l||e[14]!==a?(I=a(l==="create"?"Create":"Save"),e[13]=l,e[14]=a,e[15]=I):I=e[15];let v;e[16]!==l||e[17]!==a?(v=a(l==="create"?"New team":"Rename team"),e[16]=l,e[17]=a,e[18]=v):v=e[18];let S;e[19]!==a?(S=a("name"),e[19]=a,e[20]=S):S=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=n(A=>{y(A.target.value)},"t8"),e[21]=C):C=e[21];let x;e[22]!==g?(x=(0,o.jsxDEV)(Y,{"data-testid":"org-team-form-name",id:"org-team-form-name",onChange:C,value:g},void 0,!1),e[22]=g,e[23]=x):x=e[23];let N;e[24]!==S||e[25]!==x?(N=(0,o.jsxDEV)(K,{htmlFor:"org-team-form-name",label:S,children:x},void 0,!1),e[24]=S,e[25]=x,e[26]=N):N=e[26];let _;return e[27]!==m||e[28]!==c||e[29]!==d||e[30]!==b||e[31]!==N||e[32]!==p||e[33]!==I||e[34]!==v?(_=(0,o.jsxDEV)(de,{busy:m,canSubmit:p,error:c,onClose:d,onSubmit:b,submitLabel:I,testId:"org-team-form",title:v,children:N},void 0,!1),e[27]=m,e[28]=c,e[29]=d,e[30]=b,e[31]=N,e[32]=p,e[33]=I,e[34]=v,e[35]=_):_=e[35],_},"TeamFormDialog"),Ut=n(t=>{let e=(0,W.c)(30),{onClose:l,onDone:d,teamId:f}=t,r=ie(),i=X(),{busy:s,error:a,run:m}=re(),[c,k]=(0,L.useState)(""),u;e[0]!==r||e[1]!==l||e[2]!==d||e[3]!==m||e[4]!==f||e[5]!==c?(u=n(()=>{m(async()=>{await r.addAuthOrgTeamMember({teamId:f,userId:c.trim()}),d(),l()})},"t1"),e[0]=r,e[1]=l,e[2]=d,e[3]=m,e[4]=f,e[5]=c,e[6]=u):u=e[6];let g=u,y;e[7]!==c?(y=c.trim(),e[7]=c,e[8]=y):y=e[8];let h=y!=="",b;e[9]!==i?(b=i("Add member"),e[9]=i,e[10]=b):b=e[10];let w;e[11]!==i?(w=i("Add team member"),e[11]=i,e[12]=w):w=e[12];let p;e[13]!==i?(p=i("User id"),e[13]=i,e[14]=p):p=e[14];let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=n(x=>{k(x.target.value)},"t7"),e[15]=I):I=e[15];let v;e[16]!==c?(v=(0,o.jsxDEV)(Y,{"data-testid":"org-team-add-member-user",id:"org-team-add-member-user",onChange:I,value:c},void 0,!1),e[16]=c,e[17]=v):v=e[17];let S;e[18]!==p||e[19]!==v?(S=(0,o.jsxDEV)(K,{htmlFor:"org-team-add-member-user",label:p,children:v},void 0,!1),e[18]=p,e[19]=v,e[20]=S):S=e[20];let C;return e[21]!==s||e[22]!==a||e[23]!==l||e[24]!==g||e[25]!==h||e[26]!==b||e[27]!==w||e[28]!==S?(C=(0,o.jsxDEV)(de,{busy:s,canSubmit:h,error:a,onClose:l,onSubmit:g,submitLabel:b,testId:"org-team-add-member",title:w,children:S},void 0,!1),e[21]=s,e[22]=a,e[23]=l,e[24]=g,e[25]=h,e[26]=b,e[27]=w,e[28]=S,e[29]=C):C=e[29],C},"TeamMemberAddDialog"),$t=n(t=>{let e=(0,W.c)(47),{mode:l,onClose:d,onDone:f,organizationId:r,role:i}=t,s=ie(),a=X(),{busy:m,error:c,run:k}=re(),u;e[0]!==i?(u=i?z(i.role):"",e[0]=i,e[1]=u):u=e[1];let[g,y]=(0,L.useState)(u),h;e[2]!==l||e[3]!==i?.permission?(h=l==="edit"?Mt(i?.permission):"",e[2]=l,e[3]=i?.permission,e[4]=h):h=e[4];let[b,w]=(0,L.useState)(h),p;e[5]!==s||e[6]!==l||e[7]!==g||e[8]!==d||e[9]!==f||e[10]!==r||e[11]!==b||e[12]!==i?.id||e[13]!==k?(p=n(()=>{k(async()=>{let $=jt(b);await(l==="create"?s.createAuthOrgRole({organizationId:r,permission:$,role:g.trim()}):s.updateAuthOrgRole({permission:$,roleId:z(i?.id)})),f(),d()})},"t3"),e[5]=s,e[6]=l,e[7]=g,e[8]=d,e[9]=f,e[10]=r,e[11]=b,e[12]=i?.id,e[13]=k,e[14]=p):p=e[14];let I=p,v;e[15]!==l||e[16]!==g||e[17]!==b?(v=b.trim()!==""&&(l==="edit"||g.trim()!==""),e[15]=l,e[16]=g,e[17]=b,e[18]=v):v=e[18];let S;e[19]!==l||e[20]!==a?(S=a(l==="create"?"Create":"Save"),e[19]=l,e[20]=a,e[21]=S):S=e[21];let C;e[22]!==l||e[23]!==a?(C=a(l==="create"?"New role":"Edit role"),e[22]=l,e[23]=a,e[24]=C):C=e[24];let x;e[25]!==l||e[26]!==g||e[27]!==a?(x=l==="create"&&(0,o.jsxDEV)(K,{htmlFor:"org-role-form-name",label:a("Role name"),children:(0,o.jsxDEV)(Y,{"data-testid":"org-role-form-name",id:"org-role-form-name",onChange:n($=>{y($.target.value)},"onChange"),value:g},void 0,!1)},void 0,!1),e[25]=l,e[26]=g,e[27]=a,e[28]=x):x=e[28];let N;e[29]!==a?(N=a('Permission (JSON, e.g. {"project":["create","update"]})'),e[29]=a,e[30]=N):N=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=n($=>{w($.target.value)},"t9"),e[31]=_):_=e[31];let A;e[32]!==b?(A=(0,o.jsxDEV)(xt,{"data-testid":"org-role-form-permission",id:"org-role-form-permission",onChange:_,value:b},void 0,!1),e[32]=b,e[33]=A):A=e[33];let D;e[34]!==A||e[35]!==N?(D=(0,o.jsxDEV)(K,{htmlFor:"org-role-form-permission",label:N,children:A},void 0,!1),e[34]=A,e[35]=N,e[36]=D):D=e[36];let T;return e[37]!==m||e[38]!==c||e[39]!==d||e[40]!==I||e[41]!==D||e[42]!==v||e[43]!==S||e[44]!==C||e[45]!==x?(T=(0,o.jsxDEV)(de,{busy:m,canSubmit:v,error:c,onClose:d,onSubmit:I,submitLabel:S,testId:"org-role-form",title:C,children:[x,D]},void 0,!0),e[37]=m,e[38]=c,e[39]=d,e[40]=I,e[41]=D,e[42]=v,e[43]=S,e[44]=C,e[45]=x,e[46]=T):T=e[46],T},"RoleFormDialog"),Ft=n(t=>{let e=(0,W.c)(18),{action:l,message:d,onClose:f,onDone:r,testId:i,title:s}=t,a=X(),{busy:m,error:c,run:k}=re(),u;e[0]!==l||e[1]!==f||e[2]!==r||e[3]!==k?(u=n(()=>{k(async()=>{await l(),r(),f()})},"t1"),e[0]=l,e[1]=f,e[2]=r,e[3]=k,e[4]=u):u=e[4];let g=u,y;e[5]!==a?(y=a("Delete"),e[5]=a,e[6]=y):y=e[6];let h;e[7]!==d?(h=(0,o.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:d},void 0,!1),e[7]=d,e[8]=h):h=e[8];let b;return e[9]!==m||e[10]!==c||e[11]!==f||e[12]!==g||e[13]!==y||e[14]!==h||e[15]!==i||e[16]!==s?(b=(0,o.jsxDEV)(de,{busy:m,canSubmit:!0,destructive:!0,error:c,onClose:f,onSubmit:g,submitLabel:y,testId:i,title:s,children:h},void 0,!1),e[9]=m,e[10]=c,e[11]=f,e[12]=g,e[13]=y,e[14]=h,e[15]=i,e[16]=s,e[17]=b):b=e[17],b},"ConfirmDialog"),et=n(t=>{let e=(0,W.c)(13),{action:l,children:d,heading:f,testId:r}=t,i;e[0]!==f?(i=(0,o.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:f},void 0,!1),e[0]=f,e[1]=i):i=e[1];let s;e[2]!==l?(s=l!==void 0&&(0,o.jsxDEV)("div",{className:"flex items-center gap-2",children:l},void 0,!1),e[2]=l,e[3]=s):s=e[3];let a;e[4]!==i||e[5]!==s?(a=(0,o.jsxDEV)("header",{className:"flex items-center justify-between gap-2 border-b border-border px-4 py-3",children:[i,s]},void 0,!0),e[4]=i,e[5]=s,e[6]=a):a=e[6];let m;e[7]!==d?(m=(0,o.jsxDEV)(bt,{className:"px-0",children:d},void 0,!1),e[7]=d,e[8]=m):m=e[8];let c;return e[9]!==a||e[10]!==m||e[11]!==r?(c=(0,o.jsxDEV)(ht,{className:"overflow-hidden py-0","data-testid":r,children:[a,m]},void 0,!0),e[9]=a,e[10]=m,e[11]=r,e[12]=c):c=e[12],c},"SectionCard"),tt=n(t=>{let e=(0,W.c)(23),{columns:l,rowActions:d,rowPrefix:f,rows:r}=t,i=X(),s;e[0]!==l?(s=l.map(Ht),e[0]=l,e[1]=s):s=e[1];let a;e[2]!==i?(a=i("Actions"),e[2]=i,e[3]=a):a=e[3];let m;e[4]!==a?(m=(0,o.jsxDEV)(ae,{"aria-label":a},void 0,!1),e[4]=a,e[5]=m):m=e[5];let c;e[6]!==s||e[7]!==m?(c=(0,o.jsxDEV)(yt,{children:(0,o.jsxDEV)(Ze,{children:[s,m]},void 0,!0)},void 0,!1),e[6]=s,e[7]=m,e[8]=c):c=e[8];let k;if(e[9]!==l||e[10]!==d||e[11]!==f||e[12]!==r){let y;e[14]!==l||e[15]!==d||e[16]!==f?(y=n(h=>{let b=z(h.id);return(0,o.jsxDEV)(Ze,{"data-testid":`${f}-${b}`,children:[l.map(w=>(0,o.jsxDEV)(ne,{className:w.className,children:w.render(h)},w.head,!1)),(0,o.jsxDEV)(ne,{children:(0,o.jsxDEV)("div",{className:"flex justify-end gap-1",children:d(h)},void 0,!1)},void 0,!1)]},b,!0)},"t62"),e[14]=l,e[15]=d,e[16]=f,e[17]=y):y=e[17],k=r.map(y),e[9]=l,e[10]=d,e[11]=f,e[12]=r,e[13]=k}else k=e[13];let u;e[18]!==k?(u=(0,o.jsxDEV)(Ct,{children:k},void 0,!1),e[18]=k,e[19]=u):u=e[19];let g;return e[20]!==c||e[21]!==u?(g=(0,o.jsxDEV)(pt,{children:[c,u]},void 0,!0),e[20]=c,e[21]=u,e[22]=g):g=e[22],g},"ManagedTable"),Bt=n(t=>{let e=(0,W.c)(213),{organizationId:l,rolesEnabled:d,teamsEnabled:f}=t,r=ie(),i=X(),[s,a]=(0,L.useState)(null),[m,c]=(0,L.useState)(null),k;e[0]!==l?(k=["lunora-auth-org-members",l],e[0]=l,e[1]=k):k=e[1];let u;e[2]!==r||e[3]!==l?(u=n(()=>r.listAuthOrgMembers({limit:200,organizationId:l}),"t2"),e[2]=r,e[3]=l,e[4]=u):u=e[4];let g=ce(k,u),y;e[5]!==l?(y=["lunora-auth-org-invitations",l],e[5]=l,e[6]=y):y=e[6];let h;e[7]!==r||e[8]!==l?(h=n(()=>r.listAuthOrgInvitations({limit:200,organizationId:l}),"t4"),e[7]=r,e[8]=l,e[9]=h):h=e[9];let b=ce(y,h),w;e[10]!==l?(w=["lunora-auth-org-teams",l],e[10]=l,e[11]=w):w=e[11];let p;e[12]!==r||e[13]!==l?(p=n(()=>r.listAuthOrgTeams({limit:200,organizationId:l}),"t6"),e[12]=r,e[13]=l,e[14]=p):p=e[14];let I;e[15]!==f?(I={enabled:f},e[15]=f,e[16]=I):I=e[16];let v=ce(w,p,I),S;e[17]!==l?(S=["lunora-auth-org-roles",l],e[17]=l,e[18]=S):S=e[18];let C;e[19]!==r||e[20]!==l?(C=n(()=>r.listAuthOrgRoles({limit:200,organizationId:l}),"t9"),e[19]=r,e[20]=l,e[21]=C):C=e[21];let x;e[22]!==d?(x={enabled:d},e[22]=d,e[23]=x):x=e[23];let N=ce(S,C,x),_;e[24]!==m?(_=["lunora-auth-org-team-members",m],e[24]=m,e[25]=_):_=e[25];let A;e[26]!==r||e[27]!==m?(A=n(()=>r.listAuthOrgTeamMembers({limit:200,teamId:m??""}),"t12"),e[26]=r,e[27]=m,e[28]=A):A=e[28];let D=m!==null,T;e[29]!==D?(T={enabled:D},e[29]=D,e[30]=T):T=e[30];let $=ce(_,A,T),j;e[31]!==g.data?.rows?(j=g.data?.rows??[],e[31]=g.data?.rows,e[32]=j):j=e[32];let U=j,P;e[33]!==b.data?.rows?(P=b.data?.rows??[],e[33]=b.data?.rows,e[34]=P):P=e[34];let Q=P,J;e[35]!==v.data?.rows?(J=v.data?.rows??[],e[35]=v.data?.rows,e[36]=J):J=e[36];let q=J,M;e[37]!==N.data?.rows?(M=N.data?.rows??[],e[37]=N.data?.rows,e[38]=M):M=e[38];let F=M,B;e[39]!==m||e[40]!==$?(B=m===null?[]:$.data?.rows??[],e[39]=m,e[40]=$,e[41]=B):B=e[41];let oe=B,Z=g.error??b.error??v.error??N.error??$.error,ee;e[42]!==b||e[43]!==g||e[44]!==d||e[45]!==N||e[46]!==m||e[47]!==$||e[48]!==f||e[49]!==v?(ee=n(()=>{g.refetch(),b.refetch(),f&&v.refetch(),d&&N.refetch(),m!==null&&$.refetch()},"t20"),e[42]=b,e[43]=g,e[44]=d,e[45]=N,e[46]=m,e[47]=$,e[48]=f,e[49]=v,e[50]=ee):ee=e[50];let O=ee;It(O,!0);let te;e[51]===Symbol.for("react.memo_cache_sentinel")?(te=n(()=>{a(null)},"t21"),e[51]=te):te=e[51];let G=te,le;e[52]!==O?(le=n(R=>{St((async()=>{await R(),O()})())},"t22"),e[52]=O,e[53]=le):le=e[53];let H=le,se;e[54]!==r||e[55]!==i?(se=n(R=>{let kt=z(R.id);a({action:n(async()=>{await r.removeAuthOrgTeam({teamId:kt}),c(wt=>wt===kt?null:wt)},"action"),kind:"confirm",message:i("Delete this team and its memberships? This cannot be undone."),testId:"org-team-delete",title:i("Delete team")})},"t23"),e[54]=r,e[55]=i,e[56]=se):se=e[56];let V=se,fe;e[57]!==i?(fe=i("userId"),e[57]=i,e[58]=fe):fe=e[58];let ue;e[59]!==fe?(ue={head:fe,render:Vt},e[59]=fe,e[60]=ue):ue=e[60];let ge;e[61]!==i?(ge=i("role"),e[61]=i,e[62]=ge):ge=e[62];let ve;e[63]!==ge?(ve={head:ge,render:qt},e[63]=ge,e[64]=ve):ve=e[64];let lt;e[65]!==ue||e[66]!==ve?(lt=[ue,ve],e[65]=ue,e[66]=ve,e[67]=lt):lt=e[67];let mt=lt,he;e[68]!==i?(he=i("email"),e[68]=i,e[69]=he):he=e[69];let be;e[70]!==he?(be={head:he,render:Gt},e[70]=he,e[71]=be):be=e[71];let pe;e[72]!==i?(pe=i("role"),e[72]=i,e[73]=pe):pe=e[73];let ye;e[74]!==pe?(ye={head:pe,render:Kt},e[74]=pe,e[75]=ye):ye=e[75];let Ce;e[76]!==i?(Ce=i("status"),e[76]=i,e[77]=Ce):Ce=e[77];let xe;e[78]!==Ce?(xe={head:Ce,render:Wt},e[78]=Ce,e[79]=xe):xe=e[79];let it;e[80]!==be||e[81]!==ye||e[82]!==xe?(it=[be,ye,xe],e[80]=be,e[81]=ye,e[82]=xe,e[83]=it):it=e[83];let ct=it,Ie;e[84]!==i?(Ie=i("id"),e[84]=i,e[85]=Ie):Ie=e[85];let ke;e[86]!==Ie?(ke={className:"font-mono text-xs",head:Ie,render:Xt},e[86]=Ie,e[87]=ke):ke=e[87];let we;e[88]!==i?(we=i("name"),e[88]=i,e[89]=we):we=e[89];let Se;e[90]!==we?(Se={head:we,render:Yt},e[90]=we,e[91]=Se):Se=e[91];let ot;e[92]!==ke||e[93]!==Se?(ot=[ke,Se],e[92]=ke,e[93]=Se,e[94]=ot):ot=e[94];let ft=ot,Ne;e[95]!==i?(Ne=i("userId"),e[95]=i,e[96]=Ne):Ne=e[96];let st;e[97]!==Ne?(st=[{head:Ne,render:Zt}],e[97]=Ne,e[98]=st):st=e[98];let ut=st,ze;e[99]!==i?(ze=i("role"),e[99]=i,e[100]=ze):ze=e[100];let Ae;e[101]!==ze?(Ae={head:ze,render:el},e[101]=ze,e[102]=Ae):Ae=e[102];let De;e[103]!==i?(De=i("Permission"),e[103]=i,e[104]=De):De=e[104];let Oe;e[105]!==De?(Oe={className:"font-mono text-xs whitespace-pre-wrap",head:De,render:tl},e[105]=De,e[106]=Oe):Oe=e[106];let rt;e[107]!==Ae||e[108]!==Oe?(rt=[Ae,Oe],e[107]=Ae,e[108]=Oe,e[109]=rt):rt=e[109];let gt=rt,_e;e[110]!==Z?(_e=Z!==null&&(0,o.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"org-detail-error",role:"alert",children:Z},void 0,!1),e[110]=Z,e[111]=_e):_e=e[111];let at;e[112]===Symbol.for("react.memo_cache_sentinel")?(at=n(()=>{a({kind:"add-member"})},"t49"),e[112]=at):at=e[112];let $e;e[113]!==i?($e=i("Add member"),e[113]=i,e[114]=$e):$e=e[114];let Te;e[115]!==$e?(Te=(0,o.jsxDEV)(E,{"data-testid":"org-open-add-member",onClick:at,size:"xs",type:"button",variant:"outline",children:$e},void 0,!1),e[115]=$e,e[116]=Te):Te=e[116];let nt;e[117]===Symbol.for("react.memo_cache_sentinel")?(nt=n(()=>{a({kind:"invite-member"})},"t52"),e[117]=nt):nt=e[117];let Me;e[118]!==i?(Me=i("Invite member"),e[118]=i,e[119]=Me):Me=e[119];let Fe;e[120]!==Me?(Fe=(0,o.jsxDEV)(E,{"data-testid":"org-open-invite-member",onClick:nt,size:"xs",type:"button",variant:"outline",children:Me},void 0,!1),e[120]=Me,e[121]=Fe):Fe=e[121];let Re;e[122]!==Te||e[123]!==Fe?(Re=(0,o.jsxDEV)(o.Fragment,{children:[Te,Fe]},void 0,!0),e[122]=Te,e[123]=Fe,e[124]=Re):Re=e[124];let Ee;e[125]!==i?(Ee=i("Members"),e[125]=i,e[126]=Ee):Ee=e[126];let Le;e[127]!==r||e[128]!==mt||e[129]!==U||e[130]!==H||e[131]!==i?(Le=U.length===0?(0,o.jsxDEV)("div",{className:"p-3",children:(0,o.jsxDEV)(me,{testId:"org-members-empty",title:i("No members.")},void 0,!1)},void 0,!1):(0,o.jsxDEV)(tt,{columns:mt,rowActions:n(R=>(0,o.jsxDEV)(o.Fragment,{children:[(0,o.jsxDEV)(E,{"data-testid":`org-member-role-${z(R.id)}`,onClick:n(()=>{a({kind:"member-role",member:R})},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Change role")},void 0,!1),(0,o.jsxDEV)(E,{"data-testid":`org-remove-member-${z(R.id)}`,onClick:n(()=>{H(()=>r.removeAuthOrgMember({memberId:z(R.id)}))},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Remove")},void 0,!1)]},void 0,!0),"rowActions"),rowPrefix:"org-member",rows:U},void 0,!1),e[127]=r,e[128]=mt,e[129]=U,e[130]=H,e[131]=i,e[132]=Le):Le=e[132];let je;e[133]!==Re||e[134]!==Ee||e[135]!==Le?(je=(0,o.jsxDEV)(et,{action:Re,heading:Ee,testId:"org-members",children:Le},void 0,!1),e[133]=Re,e[134]=Ee,e[135]=Le,e[136]=je):je=e[136];let Pe;e[137]!==r||e[138]!==ct||e[139]!==Q||e[140]!==H||e[141]!==i?(Pe=Q.length>0&&(0,o.jsxDEV)(et,{heading:i("Invitations"),testId:"org-invitations",children:(0,o.jsxDEV)(tt,{columns:ct,rowActions:n(R=>(0,o.jsxDEV)(E,{"data-testid":`org-cancel-invitation-${z(R.id)}`,onClick:n(()=>{H(()=>r.cancelAuthOrgInvitation({invitationId:z(R.id)}))},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Cancel")},void 0,!1),"rowActions"),rowPrefix:"org-invitation",rows:Q},void 0,!1)},void 0,!1),e[137]=r,e[138]=ct,e[139]=Q,e[140]=H,e[141]=i,e[142]=Pe):Pe=e[142];let Qe;e[143]!==V||e[144]!==m||e[145]!==i||e[146]!==ft||e[147]!==q||e[148]!==f?(Qe=f&&(0,o.jsxDEV)(et,{action:(0,o.jsxDEV)(E,{"data-testid":"org-open-create-team",onClick:n(()=>{a({kind:"team-create"})},"onClick"),size:"xs",type:"button",variant:"outline",children:i("New team")},void 0,!1),heading:i("Teams"),testId:"org-teams",children:q.length===0?(0,o.jsxDEV)("div",{className:"p-3",children:(0,o.jsxDEV)(me,{testId:"org-teams-empty",title:i("No teams.")},void 0,!1)},void 0,!1):(0,o.jsxDEV)(tt,{columns:ft,rowActions:n(R=>(0,o.jsxDEV)(o.Fragment,{children:[(0,o.jsxDEV)(E,{"aria-pressed":m===z(R.id),"data-testid":`org-team-select-${z(R.id)}`,onClick:n(()=>{c(z(R.id))},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Members")},void 0,!1),(0,o.jsxDEV)(E,{"data-testid":`org-team-rename-${z(R.id)}`,onClick:n(()=>{a({kind:"team-rename",team:R})},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Rename")},void 0,!1),(0,o.jsxDEV)(E,{"data-testid":`org-team-delete-${z(R.id)}`,onClick:n(()=>{V(R)},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Delete")},void 0,!1)]},void 0,!0),"rowActions"),rowPrefix:"org-team",rows:q},void 0,!1)},void 0,!1),e[143]=V,e[144]=m,e[145]=i,e[146]=ft,e[147]=q,e[148]=f,e[149]=Qe):Qe=e[149];let Je;e[150]!==r||e[151]!==H||e[152]!==m||e[153]!==i||e[154]!==ut||e[155]!==oe||e[156]!==f?(Je=f&&m!==null&&(0,o.jsxDEV)(et,{action:(0,o.jsxDEV)(E,{"data-testid":"org-open-add-team-member",onClick:n(()=>{a({kind:"team-add-member",teamId:m})},"onClick"),size:"xs",type:"button",variant:"outline",children:i("Add member")},void 0,!1),heading:i("Team members"),testId:"org-team-members",children:oe.length===0?(0,o.jsxDEV)("div",{className:"p-3",children:(0,o.jsxDEV)(me,{testId:"org-team-members-empty",title:i("No team members.")},void 0,!1)},void 0,!1):(0,o.jsxDEV)(tt,{columns:ut,rowActions:n(R=>(0,o.jsxDEV)(E,{"data-testid":`org-team-remove-member-${z(R.id)}`,onClick:n(()=>{H(()=>r.removeAuthOrgTeamMember({teamMemberId:z(R.id)}))},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Remove")},void 0,!1),"rowActions"),rowPrefix:"org-team-member",rows:oe},void 0,!1)},void 0,!1),e[150]=r,e[151]=H,e[152]=m,e[153]=i,e[154]=ut,e[155]=oe,e[156]=f,e[157]=Je):Je=e[157];let Ue;e[158]!==r||e[159]!==gt||e[160]!==F||e[161]!==d||e[162]!==i?(Ue=d&&(0,o.jsxDEV)(et,{action:(0,o.jsxDEV)(E,{"data-testid":"org-open-create-role",onClick:n(()=>{a({kind:"role-create"})},"onClick"),size:"xs",type:"button",variant:"outline",children:i("New role")},void 0,!1),heading:i("Roles"),testId:"org-roles",children:F.length===0?(0,o.jsxDEV)("div",{className:"p-3",children:(0,o.jsxDEV)(me,{testId:"org-roles-empty",title:i("No custom roles.")},void 0,!1)},void 0,!1):(0,o.jsxDEV)(tt,{columns:gt,rowActions:n(R=>(0,o.jsxDEV)(o.Fragment,{children:[(0,o.jsxDEV)(E,{"data-testid":`org-role-edit-${z(R.id)}`,onClick:n(()=>{a({kind:"role-edit",role:R})},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Edit")},void 0,!1),(0,o.jsxDEV)(E,{"data-testid":`org-role-delete-${z(R.id)}`,onClick:n(()=>{a({action:n(()=>r.deleteAuthOrgRole({roleId:z(R.id)}),"action"),kind:"confirm",message:i("Delete this custom role? Members keeping it will lose its grants."),testId:"org-role-delete",title:i("Delete role")})},"onClick"),size:"xs",type:"button",variant:"ghost",children:i("Delete")},void 0,!1)]},void 0,!0),"rowActions"),rowPrefix:"org-role",rows:F},void 0,!1)},void 0,!1),e[158]=r,e[159]=gt,e[160]=F,e[161]=d,e[162]=i,e[163]=Ue):Ue=e[163];let Be;e[164]!==s?.kind||e[165]!==l||e[166]!==O?(Be=s?.kind==="add-member"&&(0,o.jsxDEV)(Pt,{onClose:G,onDone:O,organizationId:l},void 0,!1),e[164]=s?.kind,e[165]=l,e[166]=O,e[167]=Be):Be=e[167];let He;e[168]!==s?.kind||e[169]!==l||e[170]!==O?(He=s?.kind==="invite-member"&&(0,o.jsxDEV)(Qt,{onClose:G,onDone:O,organizationId:l},void 0,!1),e[168]=s?.kind,e[169]=l,e[170]=O,e[171]=He):He=e[171];let Ve;e[172]!==s||e[173]!==O?(Ve=s?.kind==="member-role"&&(0,o.jsxDEV)(Jt,{member:s.member,onClose:G,onDone:O},void 0,!1),e[172]=s,e[173]=O,e[174]=Ve):Ve=e[174];let qe;e[175]!==s?.kind||e[176]!==l||e[177]!==O?(qe=s?.kind==="team-create"&&(0,o.jsxDEV)(_t,{mode:"create",onClose:G,onDone:O,organizationId:l},void 0,!1),e[175]=s?.kind,e[176]=l,e[177]=O,e[178]=qe):qe=e[178];let Ge;e[179]!==s||e[180]!==l||e[181]!==O?(Ge=s?.kind==="team-rename"&&(0,o.jsxDEV)(_t,{mode:"edit",onClose:G,onDone:O,organizationId:l,team:s.team},void 0,!1),e[179]=s,e[180]=l,e[181]=O,e[182]=Ge):Ge=e[182];let Ke;e[183]!==s||e[184]!==O?(Ke=s?.kind==="team-add-member"&&(0,o.jsxDEV)(Ut,{onClose:G,onDone:O,teamId:s.teamId},void 0,!1),e[183]=s,e[184]=O,e[185]=Ke):Ke=e[185];let We;e[186]!==s?.kind||e[187]!==l||e[188]!==O?(We=s?.kind==="role-create"&&(0,o.jsxDEV)($t,{mode:"create",onClose:G,onDone:O,organizationId:l},void 0,!1),e[186]=s?.kind,e[187]=l,e[188]=O,e[189]=We):We=e[189];let Xe;e[190]!==s||e[191]!==l||e[192]!==O?(Xe=s?.kind==="role-edit"&&(0,o.jsxDEV)($t,{mode:"edit",onClose:G,onDone:O,organizationId:l,role:s.role},void 0,!1),e[190]=s,e[191]=l,e[192]=O,e[193]=Xe):Xe=e[193];let Ye;e[194]!==s||e[195]!==O?(Ye=s?.kind==="confirm"&&(0,o.jsxDEV)(Ft,{action:s.action,message:s.message,onClose:G,onDone:O,testId:s.testId,title:s.title},void 0,!1),e[194]=s,e[195]=O,e[196]=Ye):Ye=e[196];let dt;return e[197]!==_e||e[198]!==je||e[199]!==Pe||e[200]!==Qe||e[201]!==Je||e[202]!==Ue||e[203]!==Be||e[204]!==He||e[205]!==Ve||e[206]!==qe||e[207]!==Ge||e[208]!==Ke||e[209]!==We||e[210]!==Xe||e[211]!==Ye?(dt=(0,o.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"org-detail",children:[_e,je,Pe,Qe,Je,Ue,Be,He,Ve,qe,Ge,Ke,We,Xe,Ye]},void 0,!0),e[197]=_e,e[198]=je,e[199]=Pe,e[200]=Qe,e[201]=Je,e[202]=Ue,e[203]=Be,e[204]=He,e[205]=Ve,e[206]=qe,e[207]=Ge,e[208]=Ke,e[209]=We,e[210]=Xe,e[211]=Ye,e[212]=dt):dt=e[212],dt},"OrganizationDetail");function Ht(t){return(0,o.jsxDEV)(ae,{children:t.head},t.head,!1)}n(Ht,"_temp");function Vt(t){return(0,o.jsxDEV)("span",{className:"font-mono text-xs",children:z(t.userId)},void 0,!1)}n(Vt,"_temp2");function qt(t){return z(t.role)}n(qt,"_temp3");function Gt(t){return z(t.email)}n(Gt,"_temp4");function Kt(t){return z(t.role)}n(Kt,"_temp5");function Wt(t){return z(t.status)}n(Wt,"_temp6");function Xt(t){return z(t.id)}n(Xt,"_temp7");function Yt(t){return z(t.name)}n(Yt,"_temp8");function Zt(t){return(0,o.jsxDEV)("span",{className:"font-mono text-xs",children:z(t.userId)},void 0,!1)}n(Zt,"_temp9");function el(t){return z(t.role)}n(el,"_temp0");function tl(t){return z(t.permission)}n(tl,"_temp1");var hl=n(()=>{let t=(0,W.c)(62),e=ie(),l=X(),{config:d,ready:f}=At(),r=d.capabilities.organization,[i,s]=(0,L.useState)(null),[a,m]=(0,L.useState)(null),c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=["lunora-auth-orgs"],t[0]=c):c=t[0];let k;t[1]!==e?(k=n(()=>e.listAuthOrganizations({limit:100}),"t1"),t[1]=e,t[2]=k):k=t[2];let u;t[3]!==r?(u={enabled:r},t[3]=r,t[4]=u):u=t[4];let g=ce(c,k,u),y=g.data?.rows??null,h;t[5]!==g?(h=n(()=>{g.refetch()},"t3"),t[5]=g,t[6]=h):h=t[6],It(h,r);let b;t[7]===Symbol.for("react.memo_cache_sentinel")?(b=n(()=>{m(null)},"t4"),t[7]=b):b=t[7];let w=b,p;t[8]!==g?(p=n(()=>{g.refetch()},"t5"),t[8]=g,t[9]=p):p=t[9];let I=p,v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=n(M=>{s(M)},"t6"),t[10]=v):v=t[10];let S=v;if(f&&!r){let M;t[11]!==l?(M=l("Enable the organization() plugin in your auth config to manage organizations here."),t[11]=l,t[12]=M):M=t[12];let F;t[13]!==l?(F=l("Organizations are not enabled."),t[13]=l,t[14]=F):F=t[14];let B;return t[15]!==M||t[16]!==F?(B=(0,o.jsxDEV)(me,{description:M,testId:"org-disabled",title:F},void 0,!1),t[15]=M,t[16]=F,t[17]=B):B=t[17],B}let C;t[18]!==l?(C=l("Organizations"),t[18]=l,t[19]=C):C=t[19];let x;t[20]!==C?(x=(0,o.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:C},void 0,!1),t[20]=C,t[21]=x):x=t[21];let N;t[22]===Symbol.for("react.memo_cache_sentinel")?(N=n(()=>{m({kind:"create"})},"t9"),t[22]=N):N=t[22];let _;t[23]!==l?(_=l("New organization"),t[23]=l,t[24]=_):_=t[24];let A;t[25]!==_?(A=(0,o.jsxDEV)(E,{"data-testid":"org-new",onClick:N,size:"sm",type:"button",children:_},void 0,!1),t[25]=_,t[26]=A):A=t[26];let D;t[27]!==A||t[28]!==x?(D=(0,o.jsxDEV)("div",{className:"flex items-center justify-between",children:[x,A]},void 0,!0),t[27]=A,t[28]=x,t[29]=D):D=t[29];let T;t[30]!==g.error?(T=g.error!==null&&(0,o.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"org-error",role:"alert",children:g.error},void 0,!1),t[30]=g.error,t[31]=T):T=t[31];let $;t[32]!==y||t[33]!==l?($=y!==null&&y.length===0&&(0,o.jsxDEV)(me,{testId:"org-empty",title:l("No organizations.")},void 0,!1),t[32]=y,t[33]=l,t[34]=$):$=t[34];let j;t[35]!==y||t[36]!==i||t[37]!==l?(j=y!==null&&y.length>0&&(0,o.jsxDEV)(ht,{className:"overflow-hidden py-0",children:(0,o.jsxDEV)(bt,{className:"px-0",children:(0,o.jsxDEV)(pt,{"data-testid":"org-table",children:[(0,o.jsxDEV)(yt,{children:(0,o.jsxDEV)(Ze,{children:[(0,o.jsxDEV)(ae,{children:l("id")},void 0,!1),(0,o.jsxDEV)(ae,{children:l("name")},void 0,!1),(0,o.jsxDEV)(ae,{children:l("slug")},void 0,!1),(0,o.jsxDEV)(ae,{children:l("created")},void 0,!1),(0,o.jsxDEV)(ae,{"aria-label":l("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,o.jsxDEV)(Ct,{children:y.map(M=>{let F=z(M.id);return(0,o.jsxDEV)(Ze,{"data-testid":`org-row-${F}`,children:[(0,o.jsxDEV)(ne,{className:"font-mono text-xs",children:F},void 0,!1),(0,o.jsxDEV)(ne,{children:z(M.name)},void 0,!1),(0,o.jsxDEV)(ne,{children:z(M.slug)},void 0,!1),(0,o.jsxDEV)(ne,{className:"text-muted-foreground tabular-nums",children:Nt(M.createdAt)},void 0,!1),(0,o.jsxDEV)(ne,{children:(0,o.jsxDEV)("div",{className:"flex justify-end gap-1",children:[(0,o.jsxDEV)(E,{"aria-pressed":i===F,"data-testid":`org-select-${F}`,onClick:n(()=>{S(F)},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Manage")},void 0,!1),(0,o.jsxDEV)(E,{"data-testid":`org-edit-${F}`,onClick:n(()=>{m({kind:"edit",org:M})},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Edit")},void 0,!1),(0,o.jsxDEV)(E,{"data-testid":`org-delete-${F}`,onClick:n(()=>{m({kind:"delete",org:M})},"onClick"),size:"xs",type:"button",variant:"ghost",children:l("Delete")},void 0,!1)]},void 0,!0)},void 0,!1)]},F,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),t[35]=y,t[36]=i,t[37]=l,t[38]=j):j=t[38];let U;t[39]!==d.organization||t[40]!==i?(U=i!==null&&(0,o.jsxDEV)(Bt,{organizationId:i,rolesEnabled:d.organization.roles,teamsEnabled:d.organization.teams},void 0,!1),t[39]=d.organization,t[40]=i,t[41]=U):U=t[41];let P;t[42]!==a?.kind||t[43]!==I?(P=a?.kind==="create"&&(0,o.jsxDEV)(Ot,{mode:"create",onClose:w,onDone:I},void 0,!1),t[42]=a?.kind,t[43]=I,t[44]=P):P=t[44];let Q;t[45]!==a||t[46]!==I?(Q=a?.kind==="edit"&&(0,o.jsxDEV)(Ot,{mode:"edit",onClose:w,onDone:I,org:a.org},void 0,!1),t[45]=a,t[46]=I,t[47]=Q):Q=t[47];let J;t[48]!==e||t[49]!==a||t[50]!==I||t[51]!==l?(J=a?.kind==="delete"&&(0,o.jsxDEV)(Ft,{action:n(async()=>{let M=z(a.org.id);await e.deleteAuthOrganization({organizationId:M}),s(F=>F===M?null:F)},"action"),message:l("Delete this organization? Its members, invitations, teams, and custom roles are removed. This cannot be undone."),onClose:w,onDone:I,testId:"org-delete",title:l("Delete organization")},void 0,!1),t[48]=e,t[49]=a,t[50]=I,t[51]=l,t[52]=J):J=t[52];let q;return t[53]!==D||t[54]!==T||t[55]!==$||t[56]!==j||t[57]!==U||t[58]!==P||t[59]!==Q||t[60]!==J?(q=(0,o.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-organizations",children:[D,T,$,j,U,P,Q,J]},void 0,!0),t[53]=D,t[54]=T,t[55]=$,t[56]=j,t[57]=U,t[58]=P,t[59]=Q,t[60]=J,t[61]=q):q=t[61],q},"OrganizationsPanel");export{hl as OrganizationsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Q}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as O,b as $,c as j,d as S,e as n,f as c}from"./chunk-GTM65MVX.js";import{a as L}from"./chunk-BOXSWNXZ.js";import{a as _}from"./chunk-TAD43CG5.js";import{b as F}from"./chunk-RHZ4M2NZ.js";import{a as B,e as D}from"./chunk-SEU5V7I6.js";import{b as k}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as U}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as R,e as M,g as z,h as J}from"./chunk-RRCPZMC2.js";var q=M(z(),1);var l=M(J(),1);var V=["read","insert","update","delete"],K=R((e,s)=>({delete:e("Delete"),insert:e("Insert"),read:e("Read"),update:e("Update")})[s],"operationLabel"),W=R(e=>{let s=new Map;for(let t of e){let r=s.get(t.table)??{operations:new Set,procedures:[],table:t.table};r.operations.add(t.on),r.procedures.includes(t.procedure)||r.procedures.push(t.procedure),s.set(t.table,r)}return[...s.values()].toSorted((t,r)=>t.table.localeCompare(r.table))},"groupByTable"),ie=R(()=>{let e=(0,q.c)(49),s=U(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={},e[0]=t):t=e[0];let{data:r,error:C,errorSource:I}=F(L.rlsPolicies,t),f=r!==void 0,p,d,m,a,u,h,v,b,o;if(e[1]!==r||e[2]!==C||e[3]!==I||e[4]!==f||e[5]!==s){let G=W(Array.isArray(r?.policies)?r.policies:[]),P;e[15]!==r?(P=Array.isArray(r?.roles)?r.roles:[],e[15]=r,e[16]=P):P=e[16],d=P,v="flex flex-col gap-6",b="lunora-rls-panel",e[17]!==C||e[18]!==I?(o=C!==null&&(0,l.jsxDEV)(Q,{error:I,testId:"rls-error"},void 0,!1),e[17]=C,e[18]=I,e[19]=o):o=e[19],h="flex flex-col gap-2",p=B,m="overflow-hidden py-0";let A;e[20]!==s?(A=s("Policies"),e[20]=s,e[21]=A):A=e[21],e[22]!==A?(a=(0,l.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,l.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:A},void 0,!1)},void 0,!1),e[22]=A,e[23]=a):a=e[23],u=f&&G.length===0?(0,l.jsxDEV)(_,{description:s("No `definePolicy` is wired through `.use(rls(...))` in this deployment. Add one to guard a table's rows."),testId:"rls-policies-empty",title:s("No policies defined")},void 0,!1):(0,l.jsxDEV)(D,{className:"px-0",children:(0,l.jsxDEV)(O,{"data-testid":"rls-policies-table",children:[(0,l.jsxDEV)($,{children:(0,l.jsxDEV)(S,{children:[(0,l.jsxDEV)(n,{children:s("Table")},void 0,!1),V.map(i=>(0,l.jsxDEV)(n,{children:K(s,i)},i,!1)),(0,l.jsxDEV)(n,{children:s("Guarded by")},void 0,!1)]},void 0,!0)},void 0,!1),(0,l.jsxDEV)(j,{children:G.map(i=>(0,l.jsxDEV)(S,{"data-testid":`rls-table-${i.table}`,children:[(0,l.jsxDEV)(c,{className:"font-mono text-xs",children:i.table},void 0,!1),V.map(H=>(0,l.jsxDEV)(c,{children:i.operations.has(H)?(0,l.jsxDEV)(k,{variant:"secondary",children:s("Guarded")},void 0,!1):(0,l.jsxDEV)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"},void 0,!1)},H,!1)),(0,l.jsxDEV)(c,{className:"font-mono text-xs text-muted-foreground",children:i.procedures.join(", ")},void 0,!1)]},i.table,!0))},void 0,!1)]},void 0,!0)},void 0,!1),e[1]=r,e[2]=C,e[3]=I,e[4]=f,e[5]=s,e[6]=p,e[7]=d,e[8]=m,e[9]=a,e[10]=u,e[11]=h,e[12]=v,e[13]=b,e[14]=o}else p=e[6],d=e[7],m=e[8],a=e[9],u=e[10],h=e[11],v=e[12],b=e[13],o=e[14];let x;e[24]!==p||e[25]!==m||e[26]!==a||e[27]!==u?(x=(0,l.jsxDEV)(p,{className:m,children:[a,u]},void 0,!0),e[24]=p,e[25]=m,e[26]=a,e[27]=u,e[28]=x):x=e[28];let N;e[29]!==h||e[30]!==x?(N=(0,l.jsxDEV)("section",{className:h,children:x},void 0,!1),e[29]=h,e[30]=x,e[31]=N):N=e[31];let y;e[32]!==s?(y=s("Roles"),e[32]=s,e[33]=y):y=e[33];let g;e[34]!==y?(g=(0,l.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,l.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:y},void 0,!1)},void 0,!1),e[34]=y,e[35]=g):g=e[35];let T;e[36]!==f||e[37]!==d||e[38]!==s?(T=f&&d.length===0?(0,l.jsxDEV)(_,{description:s("No `defineRole` is registered via `rls(policies, { roles })`. Roles back `ctx.auth.can(...)` permission checks."),testId:"rls-roles-empty",title:s("No roles defined")},void 0,!1):(0,l.jsxDEV)(D,{className:"px-0",children:(0,l.jsxDEV)(O,{"data-testid":"rls-roles-table",children:[(0,l.jsxDEV)($,{children:(0,l.jsxDEV)(S,{children:[(0,l.jsxDEV)(n,{children:s("Role")},void 0,!1),(0,l.jsxDEV)(n,{children:s("Description")},void 0,!1),(0,l.jsxDEV)(n,{children:s("Permissions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,l.jsxDEV)(j,{children:d.map(Y)},void 0,!1)]},void 0,!0)},void 0,!1),e[36]=f,e[37]=d,e[38]=s,e[39]=T):T=e[39];let w;e[40]!==g||e[41]!==T?(w=(0,l.jsxDEV)("section",{className:"flex flex-col gap-2",children:(0,l.jsxDEV)(B,{className:"overflow-hidden py-0",children:[g,T]},void 0,!0)},void 0,!1),e[40]=g,e[41]=T,e[42]=w):w=e[42];let E;return e[43]!==w||e[44]!==v||e[45]!==b||e[46]!==o||e[47]!==N?(E=(0,l.jsxDEV)("div",{className:v,"data-testid":b,children:[o,N,w]},void 0,!0),e[43]=w,e[44]=v,e[45]=b,e[46]=o,e[47]=N,e[48]=E):E=e[48],E},"RlsPanel");function X(e){return(0,l.jsxDEV)(k,{variant:"outline",children:e},e,!1)}R(X,"_temp");function Y(e){return(0,l.jsxDEV)(S,{"data-testid":`rls-role-${e.name}`,children:[(0,l.jsxDEV)(c,{className:"font-mono text-xs",children:e.name},void 0,!1),(0,l.jsxDEV)(c,{className:"text-muted-foreground",children:e.description??""},void 0,!1),(0,l.jsxDEV)(c,{children:e.permissions.length===0?(0,l.jsxDEV)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"},void 0,!1):(0,l.jsxDEV)("span",{className:"flex flex-wrap gap-1",children:e.permissions.map(X)},void 0,!1)},void 0,!1)]},e.name,!0)}R(Y,"_temp2");export{ie as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,e as n,f,g as b,h as p,j as d}from"./chunk-RRCPZMC2.js";var c=n(b(),1),m=n(f(),1);var r=n(p(),1);function h(o){let e=(0,c.c)(8),t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let a;e[3]!==t?(a=d("w-full caption-bottom text-xs",t),e[3]=t,e[4]=a):a=e[4];let s;return e[5]!==l||e[6]!==a?(s=(0,r.jsxDEV)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-clip",children:(0,r.jsxDEV)("table",{"data-slot":"table",className:a,...l},void 0,!1)},void 0,!1),e[5]=l,e[6]=a,e[7]=s):s=e[7],s}i(h,"Table");function x(o){let e=(0,c.c)(8),t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let a;e[3]!==t?(a=d("bg-muted/50 [&_tr]:border-b",t),e[3]=t,e[4]=a):a=e[4];let s;return e[5]!==l||e[6]!==a?(s=(0,r.jsxDEV)("thead",{"data-slot":"table-header",className:a,...l},void 0,!1),e[5]=l,e[6]=a,e[7]=s):s=e[7],s}i(x,"TableHeader");function N(o){let e=(0,c.c)(8),t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let a;e[3]!==t?(a=d("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=a):a=e[4];let s;return e[5]!==l||e[6]!==a?(s=(0,r.jsxDEV)("tbody",{"data-slot":"table-body",className:a,...l},void 0,!1),e[5]=l,e[6]=a,e[7]=s):s=e[7],s}i(N,"TableBody");function v(o){let e=(0,c.c)(8),t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let a;e[3]!==t?(a=d("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),e[3]=t,e[4]=a):a=e[4];let s;return e[5]!==l||e[6]!==a?(s=(0,r.jsxDEV)("tr",{"data-slot":"table-row",className:a,...l},void 0,!1),e[5]=l,e[6]=a,e[7]=s):s=e[7],s}i(v,"TableRow");function w(o){let e=(0,c.c)(8),t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let a;e[3]!==t?(a=d("h-9 border-e border-border px-3 text-start align-middle font-mono text-[11px] font-medium tracking-wide whitespace-nowrap text-muted-foreground uppercase last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=a):a=e[4];let s;return e[5]!==l||e[6]!==a?(s=(0,r.jsxDEV)("th",{"data-slot":"table-head",className:a,...l},void 0,!1),e[5]=l,e[6]=a,e[7]=s):s=e[7],s}i(w,"TableHead");function g(o){let e=(0,c.c)(8),t,l;e[0]!==o?({className:t,...l}=o,e[0]=o,e[1]=t,e[2]=l):(t=e[1],l=e[2]);let a;e[3]!==t?(a=d("border-e border-border px-3 py-1.5 align-middle whitespace-nowrap last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=a):a=e[4];let s;return e[5]!==l||e[6]!==a?(s=(0,r.jsxDEV)("td",{"data-slot":"table-cell",className:a,...l},void 0,!1),e[5]=l,e[6]=a,e[7]=s):s=e[7],s}i(g,"TableCell");export{h as a,x as b,N as c,v as d,w as e,g as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as w}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as C,b as $,c as A,d as v,e as n,f as c}from"./chunk-GTM65MVX.js";import{a as S}from"./chunk-BOXSWNXZ.js";import{a as T}from"./chunk-TAD43CG5.js";import{b as k}from"./chunk-RHZ4M2NZ.js";import{a as N,e as R}from"./chunk-SEU5V7I6.js";import{b as y}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as b}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as p,e as x,g as O,h as B}from"./chunk-RRCPZMC2.js";var I=x(O(),1);var t=x(B(),1);var D=p((e,r)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[r],"operationLabel"),E={delete:2,list:3,read:0,write:1},_=p(e=>[...e].toSorted((r,a)=>r.bucket.localeCompare(a.bucket)||E[r.on]-E[a.on]||(r.prefix??"").localeCompare(a.prefix??"")),"sortRules"),Q=p(()=>{let e=(0,I.c)(14),r=b(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:d,errorSource:i}=k(S.storageRules,a),h=l!==void 0,f;if(e[1]!==l||e[2]!==d||e[3]!==i||e[4]!==h||e[5]!==r){let g=_(Array.isArray(l?.rules)?l.rules:[]),m;e[7]!==d||e[8]!==i?(m=d!==null&&(0,t.jsxDEV)(w,{error:i,testId:"storage-rules-error"},void 0,!1),e[7]=d,e[8]=i,e[9]=m):m=e[9];let s;e[10]!==r?(s=r("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=r,e[11]=s):s=e[11];let u;e[12]!==s?(u=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:s},void 0,!1),e[12]=s,e[13]=u):u=e[13],f=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[m,u,h&&g.length===0?(0,t.jsxDEV)(T,{description:r("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:r("No storage rules defined")},void 0,!1):(0,t.jsxDEV)(N,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(R,{className:"px-0",children:(0,t.jsxDEV)(C,{"data-testid":"storage-rules-table",children:[(0,t.jsxDEV)($,{children:(0,t.jsxDEV)(v,{children:[(0,t.jsxDEV)(n,{children:r("Bucket")},void 0,!1),(0,t.jsxDEV)(n,{children:r("Operation")},void 0,!1),(0,t.jsxDEV)(n,{children:r("Key prefix")},void 0,!1),(0,t.jsxDEV)(n,{children:r("Guarded by")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(A,{children:g.map(o=>(0,t.jsxDEV)(v,{"data-testid":`storage-rule-${o.bucket}-${o.on}-${o.prefix??""}`,children:[(0,t.jsxDEV)(c,{className:"font-mono text-xs",children:o.bucket},void 0,!1),(0,t.jsxDEV)(c,{children:(0,t.jsxDEV)(y,{variant:"secondary",children:D(r,o.on)},void 0,!1)},void 0,!1),(0,t.jsxDEV)(c,{className:"font-mono text-xs",children:o.prefix??(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("(whole bucket)")},void 0,!1)},void 0,!1),(0,t.jsxDEV)(c,{className:"font-mono text-xs text-muted-foreground",children:o.procedure},void 0,!1)]},`${o.bucket}:${o.on}:${o.prefix??""}:${o.procedure}`,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[1]=l,e[2]=d,e[3]=i,e[4]=h,e[5]=r,e[6]=f}else f=e[6];return f},"StorageRulesPanel");export{Q as StorageRulesPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as V}from"./chunk-XNJNSCLM.js";import{g as w,h as A,i as E}from"./chunk-E75ANNWX.js";import{a as b}from"./chunk-JHKMUTIF.js";import{a as x,e as N,g as D,h as H}from"./chunk-RRCPZMC2.js";var g=N(D(),1);var d=N(H(),1);var y=x(k=>{let e=(0,g.c)(26),{className:u,error:t,testId:h}=k,o,l,i,s,a,r,n;if(e[0]!==u||e[1]!==t||e[2]!==h){let v=A(t),p;e[10]!==t?(p=E(t),e[10]=t,e[11]=p):p=e[11],l=p,o=V,i=u,s=h,a="destructive";let m;e[12]!==t?(m=w(t),e[12]=t,e[13]=m):m=e[13],e[14]!==m?(r=(0,d.jsxDEV)("p",{className:"font-medium",children:m},void 0,!1),e[14]=m,e[15]=r):r=e[15],n=v===void 0?null:(0,d.jsxDEV)("p",{className:"mt-1 whitespace-pre-wrap text-xs opacity-90",children:b(v)},void 0,!1),e[0]=u,e[1]=t,e[2]=h,e[3]=o,e[4]=l,e[5]=i,e[6]=s,e[7]=a,e[8]=r,e[9]=n}else o=e[3],l=e[4],i=e[5],s=e[6],a=e[7],r=e[8],n=e[9];let c;e[16]!==l?(c=l===void 0?null:(0,d.jsxDEV)("a",{"aria-label":"View documentation for this error",className:"mt-1 inline-block text-xs underline",href:l,rel:"noreferrer",target:"_blank",children:"View error docs"},void 0,!1),e[16]=l,e[17]=c):c=e[17];let f;return e[18]!==o||e[19]!==i||e[20]!==s||e[21]!==a||e[22]!==r||e[23]!==n||e[24]!==c?(f=(0,d.jsxDEV)(o,{className:i,testId:s,variant:a,children:[r,n,c]},void 0,!0),e[18]=o,e[19]=i,e[20]=s,e[21]=a,e[22]=r,e[23]=n,e[24]=c,e[25]=f):f=e[25],f},"ErrorAlert");export{y as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as s,c as m,f as S}from"./chunk-RRCPZMC2.js";var O=m(o=>{"use strict";(function(){function c(){}s(c,"noop");function y(t){return""+t}s(y,"testStringCoercion");function _(t,e,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{y(a);var l=!1}catch{l=!0}return l&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object"),y(a)),{$$typeof:E,key:a==null?null:""+a,children:t,containerInfo:e,implementation:r}}s(_,"createPortal$1");function d(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(d,"getCrossOriginStringAs");function i(t){return t===null?"`null`":t===void 0?"`undefined`":t===""?"an empty string":'something with type "'+typeof t+'"'}s(i,"getValueDescriptorExpectingObjectForWarning");function u(t){return t===null?"`null`":t===void 0?"`undefined`":t===""?"an empty string":typeof t=="string"?JSON.stringify(t):typeof t=="number"?"`"+t+"`":'something with type "'+typeof t+'"'}s(u,"getValueDescriptorExpectingEnumForWarning");function p(){var t=f.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
2
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
3
|
+
2. You might be breaking the Rules of Hooks
|
|
4
|
+
3. You might have more than one copy of React in the same app
|
|
5
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t}s(p,"resolveDispatcher"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var v=S(),n={d:{f:c,r:s(function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},"r"),D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},E=Symbol.for("react.portal"),f=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,o.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error("Target container is not a DOM element.");return _(t,e,null,r)},o.flushSync=function(t){var e=f.T,r=n.p;try{if(f.T=null,n.p=2,t)return t()}finally{f.T=e,n.p=r,n.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},o.preconnect=function(t,e){typeof t=="string"&&t?e!=null&&typeof e!="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",u(e)):e!=null&&typeof e.crossOrigin!="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",i(e.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(t)),typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,n.d.C(t,e))},o.prefetchDNS=function(t){if(typeof t!="string"||!t)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(t));else if(1<arguments.length){var e=arguments[1];typeof e=="object"&&e.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(e)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(e))}typeof t=="string"&&n.d.D(t)},o.preinit=function(t,e){if(typeof t=="string"&&t?e==null||typeof e!="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",u(e)):e.as!=="style"&&e.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',u(e.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",i(t)),typeof t=="string"&&e&&typeof e.as=="string"){var r=e.as,a=d(r,e.crossOrigin),l=typeof e.integrity=="string"?e.integrity:void 0,g=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;r==="style"?n.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:a,integrity:l,fetchPriority:g}):r==="script"&&n.d.X(t,{crossOrigin:a,integrity:l,fetchPriority:g,nonce:typeof e.nonce=="string"?e.nonce:void 0})}},o.preinitModule=function(t,e){var r="";typeof t=="string"&&t||(r+=" The `href` argument encountered was "+i(t)+"."),e!==void 0&&typeof e!="object"?r+=" The `options` argument encountered was "+i(e)+".":e&&"as"in e&&e.as!=="script"&&(r+=" The `as` option encountered was "+u(e.as)+"."),r?console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",r):(r=e&&typeof e.as=="string"?e.as:"script",r)==="script"||(r=u(r),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',r,t)),typeof t=="string"&&(typeof e=="object"&&e!==null?(e.as==null||e.as==="script")&&(r=d(e.as,e.crossOrigin),n.d.M(t,{crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})):e==null&&n.d.M(t))},o.preload=function(t,e){var r="";if(typeof t=="string"&&t||(r+=" The `href` argument encountered was "+i(t)+"."),e==null||typeof e!="object"?r+=" The `options` argument encountered was "+i(e)+".":typeof e.as=="string"&&e.as||(r+=" The `as` option encountered was "+i(e.as)+"."),r&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',r),typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){r=e.as;var a=d(r,e.crossOrigin);n.d.L(t,r,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}},o.preloadModule=function(t,e){var r="";typeof t=="string"&&t||(r+=" The `href` argument encountered was "+i(t)+"."),e!==void 0&&typeof e!="object"?r+=" The `options` argument encountered was "+i(e)+".":e&&"as"in e&&typeof e.as!="string"&&(r+=" The `as` option encountered was "+i(e.as)+"."),r&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',r),typeof t=="string"&&(e?(r=d(e.as,e.crossOrigin),n.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:r,integrity:typeof e.integrity=="string"?e.integrity:void 0})):n.d.m(t))},o.requestFormReset=function(t){n.d.r(t)},o.unstable_batchedUpdates=function(t,e){return t(e)},o.useFormState=function(t,e,r){return p().useFormState(t,e,r)},o.useFormStatus=function(){return p().useHostTransitionStatus()},o.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var b=m((R,h)=>{"use strict";h.exports=O()});export{b as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as le}from"./chunk-UGUEC6BC.js";import{a as Y}from"./chunk-2K47A3P6.js";import{a as Z}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as ee,b as te,c as re,d as j,e as o,f as i}from"./chunk-GTM65MVX.js";import{a as X}from"./chunk-UKDJ4H7I.js";import"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import{c as V}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as J}from"./chunk-BOXSWNXZ.js";import{a as U}from"./chunk-TAD43CG5.js";import{b as G}from"./chunk-RHZ4M2NZ.js";import{a as z,e as Q}from"./chunk-SEU5V7I6.js";import{b as O}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as H,o as W}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a,e as L,f as fe,g as me,h as ue,j as P}from"./chunk-RRCPZMC2.js";var ae=L(me(),1),q=L(fe(),1);var t=L(ue(),1);var he={action:"outline",mutation:"default",query:"secondary"},se=a(r=>r<1e3?`${r<10?r.toFixed(1):Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,"formatMs"),ve=a(r=>r.calls===0?"\u2014":r.errors===0?"0":`${r.errors.toString()} (${(r.errors/r.calls*100).toFixed(1)}%)`,"errorCell"),pe=a(r=>{let e=r.conflicts??0;return r.calls===0?"\u2014":e===0?"0":`${e.toString()} (${(e/r.calls*100).toFixed(1)}%)`},"conflictCell"),xe={calls:a((r,e)=>e.calls-r.calls,"calls"),recent:a((r,e)=>e.lastCalledAt-r.lastCalledAt,"recent"),slowest:a((r,e)=>e.maxDurationMs-r.maxDurationMs,"slowest")},Ie=a(r=>{let e=(0,ae.c)(47),{functions:I,initialShardKey:oe}=r,s=H(),[n,ie]=(0,q.useState)(oe??""),[d,ne]=(0,q.useState)("recent"),C;e[0]!==n?(C=n.trim(),e[0]=n,e[1]=C):C=e[1];let F=Y(C,400),M;e[2]===Symbol.for("react.memo_cache_sentinel")?(M={},e[2]=M):M=e[2];let T;e[3]!==F?(T={live:!0,shardKey:F},e[3]=F,e[4]=T):T=e[4];let{data:de,error:c,errorSource:N,liveError:b}=G(J.getFunctionStats,M,T),S=de?.functions??null,w;e[5]!==I?(w=new Map((I??[]).map(ge)),e[5]=I,e[6]=w):w=e[6];let K=w,E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=a(k=>{ne(k.currentTarget.dataset.sort)},"t5"),e[7]=E):E=e[7];let ce=E,$;if(e[8]!==c||e[9]!==N||e[10]!==K||e[11]!==b||e[12]!==n||e[13]!==d||e[14]!==S||e[15]!==s){let k=S===null?[]:S.toSorted(xe[d]),f;e[17]!==s?(f=s("Recent"),e[17]=s,e[18]=f):f=e[18];let m;e[19]!==f?(m={key:"recent",label:f},e[19]=f,e[20]=m):m=e[20];let u;e[21]!==s?(u=s("Most called"),e[21]=s,e[22]=u):u=e[22];let h;e[23]!==u?(h={key:"calls",label:u},e[23]=u,e[24]=h):h=e[24];let v;e[25]!==s?(v=s("Slowest"),e[25]=s,e[26]=v):v=e[26];let p;e[27]!==v?(p={key:"slowest",label:v},e[27]=v,e[28]=p):p=e[28];let A;e[29]!==h||e[30]!==p||e[31]!==m?(A=[m,h,p],e[29]=h,e[30]=p,e[31]=m,e[32]=A):A=e[32];let _=A,x;e[33]!==n?(x=(0,t.jsxDEV)(X,{onChange:ie,testId:"fs-shard-input",value:n},void 0,!1),e[33]=n,e[34]=x):x=e[34];let g;e[35]!==b?(g=(0,t.jsxDEV)(le,{message:b,prefix:"fs"},void 0,!1),e[35]=b,e[36]=g):g=e[36];let y;e[37]!==_||e[38]!==d?(y=(0,t.jsxDEV)("div",{className:"ml-auto flex items-center gap-1",role:"group",children:_.map(l=>(0,t.jsxDEV)(V,{"data-sort":l.key,"data-testid":`fs-sort-${l.key}`,onClick:ce,size:"sm",type:"button",variant:d===l.key?"secondary":"ghost",children:l.label},l.key,!1))},void 0,!1),e[37]=_,e[38]=d,e[39]=y):y=e[39];let B;e[40]!==x||e[41]!==g||e[42]!==y?(B=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[x,g,y]},void 0,!0),e[40]=x,e[41]=g,e[42]=y,e[43]=B):B=e[43];let D;e[44]!==c||e[45]!==N?(D=c!==null&&(0,t.jsxDEV)(Z,{error:N,testId:"fs-error"},void 0,!1),e[44]=c,e[45]=N,e[46]=D):D=e[46],$=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-stats",children:[B,D,S!==null&&k.length===0&&c===null&&(0,t.jsxDEV)(U,{description:s("Per-function call counts, error rates, and latency land here after your first request."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,t.jsxDEV)("path",{d:"M3 3v18h18"},void 0,!1),(0,t.jsxDEV)("path",{d:"M7 14l4-4 3 3 5-6"},void 0,!1)]},void 0,!0),testId:"fs-empty",title:s("No functions have run on this shard yet.")},void 0,!1),k.length>0&&(0,t.jsxDEV)(z,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(Q,{className:"px-0",children:(0,t.jsxDEV)(ee,{"data-testid":"fs-table",children:[(0,t.jsxDEV)(te,{children:(0,t.jsxDEV)(j,{children:[(0,t.jsxDEV)(o,{children:s("function")},void 0,!1),(0,t.jsxDEV)(o,{children:s("kind")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("calls")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("errors")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("conflicts")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("avg")},void 0,!1),(0,t.jsxDEV)(o,{className:"text-right",children:s("max")},void 0,!1),(0,t.jsxDEV)(o,{children:s("last run")},void 0,!1),(0,t.jsxDEV)(o,{children:s("last error")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(re,{children:k.map(l=>{let R=K.get(l.path);return(0,t.jsxDEV)(j,{"data-testid":`fs-row-${l.path}`,children:[(0,t.jsxDEV)(i,{className:"font-medium",children:l.path},void 0,!1),(0,t.jsxDEV)(i,{children:R===void 0?(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1):(0,t.jsxDEV)(O,{variant:he[R],children:R},void 0,!1)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls},void 0,!1),(0,t.jsxDEV)(i,{className:P("text-right tabular-nums",l.errors>0&&"text-destructive"),children:ve(l)},void 0,!1),(0,t.jsxDEV)(i,{className:P("text-right tabular-nums",(l.conflicts??0)>0&&"text-warning"),children:pe(l)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls===0?"\u2014":se(l.totalDurationMs/l.calls)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-right tabular-nums",children:l.calls===0?"\u2014":se(l.maxDurationMs)},void 0,!1),(0,t.jsxDEV)(i,{className:"text-muted-foreground",children:W(l.lastCalledAt,"\u2014")},void 0,!1),(0,t.jsxDEV)(i,{className:"max-w-[24ch] truncate text-destructive",title:l.lastErrorMessage??void 0,children:l.lastErrorMessage??(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},l.path,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[8]=c,e[9]=N,e[10]=K,e[11]=b,e[12]=n,e[13]=d,e[14]=S,e[15]=s,e[16]=$}else $=e[16];return $},"FunctionStatsPanel");function ge(r){return[r.path,r.kind]}a(ge,"_temp");export{Ie as FunctionStatsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k,b as j}from"./chunk-KJJ3WM6H.js";import{a as D}from"./chunk-UGUEC6BC.js";import{a as O}from"./chunk-2K47A3P6.js";import{a as V}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as _,b as z,c as B,d as f,e as l,f as n}from"./chunk-GTM65MVX.js";import{a as M}from"./chunk-UKDJ4H7I.js";import"./chunk-TBMYIZIO.js";import{R as L}from"./chunk-3CJW6NWG.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as H}from"./chunk-BOXSWNXZ.js";import{a as I}from"./chunk-TAD43CG5.js";import{b as A}from"./chunk-RHZ4M2NZ.js";import{a as y,e as E}from"./chunk-SEU5V7I6.js";import{b as T}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as C,o as R}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as i,e as w,f as ee,h as te}from"./chunk-RRCPZMC2.js";var o=w(ee(),1);var e=w(te(),1);var K=80,ae=i(s=>{if(s===void 0)return"";let t=JSON.stringify(s);return t.length>K?`${t.slice(0,K)}\u2026`:t},"formatDetail"),re=41,F=480,U=5,oe=i((s,t)=>k(s,d=>{t(d.height>0?d:{height:F,width:d.width})}),"observeViewportRect"),Se=i(({initialShardKey:s})=>{let t=C(),[d,G]=(0,o.useState)(s??""),[m,W]=(0,o.useState)(""),q=O(d.trim(),400),{data:v,error:p,errorSource:J,isLoading:P,liveError:Q}=A(H.getAuditLog,{},{live:!0,shardKey:q}),u=(0,o.useMemo)(()=>v?.entries??[],[v]),c=(0,o.useMemo)(()=>{let r=m.trim().toLowerCase();return r===""?u:u.filter(a=>a.op.toLowerCase().includes(r)||(a.table??"").toLowerCase().includes(r)||(a.id??"").toLowerCase().includes(r))},[u,m]),g=(0,o.useRef)(null),x=j({count:c.length,estimateSize:i(()=>re,"estimateSize"),getScrollElement:i(()=>g.current,"getScrollElement"),initialRect:{height:F,width:800},observeElementRect:oe,overscan:8}),h=x.getVirtualItems(),X=x.getTotalSize(),S=h[0]?.start??0,b=X-(h.at(-1)?.end??0),Z={height:S},$={height:b},Y=i(r=>{W(r.target.value)},"onSearchChange");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(M,{onChange:G,testId:"au-shard-input",value:d},void 0,!1),(0,e.jsxDEV)(D,{message:Q,prefix:"au"},void 0,!1),(0,e.jsxDEV)(L,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:Y,placeholder:t("filter op, table, id"),value:m},void 0,!1)]},void 0,!0),p!==null&&(0,e.jsxDEV)(V,{error:J,testId:"au-error"},void 0,!1),p===null&&!P&&c.length===0&&(0,e.jsxDEV)(I,{description:t("State-changing admin operations are recorded here."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsxDEV)("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"},void 0,!1)},void 0,!1),testId:"au-empty",title:t("No audit entries.")},void 0,!1),c.length>0&&(0,e.jsxDEV)(y,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(E,{className:"max-h-[30rem] overflow-auto px-0",ref:g,children:(0,e.jsxDEV)(_,{"data-testid":"au-table",children:[(0,e.jsxDEV)(z,{children:(0,e.jsxDEV)(f,{children:[(0,e.jsxDEV)(l,{children:t("time")},void 0,!1),(0,e.jsxDEV)(l,{children:t("op")},void 0,!1),(0,e.jsxDEV)(l,{children:t("table")},void 0,!1),(0,e.jsxDEV)(l,{children:t("id")},void 0,!1),(0,e.jsxDEV)(l,{children:t("detail")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(B,{children:[S>0&&(0,e.jsxDEV)("tr",{"aria-hidden":"true",children:(0,e.jsxDEV)("td",{colSpan:U,style:Z},void 0,!1)},void 0,!1),h.map(r=>{let a=c[r.index],N=ae(a.detail);return(0,e.jsxDEV)(f,{"data-testid":"au-row",children:[(0,e.jsxDEV)(n,{className:"text-muted-foreground tabular-nums",children:R(a.ts,"\u2014")},void 0,!1),(0,e.jsxDEV)(n,{children:(0,e.jsxDEV)(T,{variant:"secondary",children:a.op},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"font-medium",children:a.table??(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"max-w-[20ch] truncate font-mono text-xs",children:a.id??(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:N||void 0,children:N||(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.seq,!0)}),b>0&&(0,e.jsxDEV)("tr",{"aria-hidden":"true",children:(0,e.jsxDEV)("td",{colSpan:U,style:$},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)},"AuditPanel");export{Se as AuditPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as V}from"./chunk-J6J54MBP.js";import{a as L}from"./chunk-2K47A3P6.js";import{a as W}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as O,b as Q,c as U,d as K,e as R,f as D}from"./chunk-GTM65MVX.js";import{a as j}from"./chunk-UKDJ4H7I.js";import"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as H}from"./chunk-BOXSWNXZ.js";import{a as B}from"./chunk-TAD43CG5.js";import{b as _}from"./chunk-RHZ4M2NZ.js";import{a as E}from"./chunk-SEU5V7I6.js";import{b as w}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as A}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as C,e as F,f as J,g as X,h as Y}from"./chunk-RRCPZMC2.js";var P=F(X(),1),G=F(J(),1);var t=F(Y(),1);var q=C(r=>`${r.toString()} ms`,"formatMs"),Z=C(r=>r.totalConnections===0&&r.shapePoke.passes===0&&r.whisper.passes===0,"isFanoutIdle"),$=C(r=>{let e=(0,P.c)(8),{label:o,testId:s,value:i}=r,l;e[0]!==o?(l=(0,t.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o},void 0,!1),e[0]=o,e[1]=l):l=e[1];let d;e[2]!==s||e[3]!==i?(d=(0,t.jsxDEV)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":s,children:i},void 0,!1),e[2]=s,e[3]=i,e[4]=d):d=e[4];let v;return e[5]!==l||e[6]!==d?(v=(0,t.jsxDEV)(E,{className:"gap-0 py-0",children:(0,t.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[l,d]},void 0,!0)},void 0,!1),e[5]=l,e[6]=d,e[7]=v):v=e[7],v},"StatCard"),z=C(r=>{let e=(0,P.c)(48),{counters:o,includeTiming:s,prefix:i,t:l,title:d}=r,v=`${i}-section`,h;e[0]!==d?(h=(0,t.jsxDEV)("h3",{className:"text-sm font-medium text-foreground",children:d},void 0,!1),e[0]=d,e[1]=h):h=e[1];let k=`${i}-stats`,a;e[2]!==l?(a=l("Passes"),e[2]=l,e[3]=a):a=e[3];let n=`${i}-passes`,g;e[4]!==o.passes||e[5]!==a||e[6]!==n?(g=(0,t.jsxDEV)($,{label:a,testId:n,value:o.passes},void 0,!1),e[4]=o.passes,e[5]=a,e[6]=n,e[7]=g):g=e[7];let N;e[8]!==l?(N=l("Sockets iterated"),e[8]=l,e[9]=N):N=e[9];let I=`${i}-iterated`,c;e[10]!==o.socketsIterated||e[11]!==N||e[12]!==I?(c=(0,t.jsxDEV)($,{label:N,testId:I,value:o.socketsIterated},void 0,!1),e[10]=o.socketsIterated,e[11]=N,e[12]=I,e[13]=c):c=e[13];let f;e[14]!==l?(f=l("Delivered"),e[14]=l,e[15]=f):f=e[15];let y=`${i}-delivered`,u;e[16]!==o.socketsDelivered||e[17]!==f||e[18]!==y?(u=(0,t.jsxDEV)($,{label:f,testId:y,value:o.socketsDelivered},void 0,!1),e[16]=o.socketsDelivered,e[17]=f,e[18]=y,e[19]=u):u=e[19];let m;e[20]!==l?(m=l("Peak width"),e[20]=l,e[21]=m):m=e[21];let b=`${i}-peak`,p;e[22]!==o.peakSocketsIterated||e[23]!==m||e[24]!==b?(p=(0,t.jsxDEV)($,{label:m,testId:b,value:o.peakSocketsIterated},void 0,!1),e[22]=o.peakSocketsIterated,e[23]=m,e[24]=b,e[25]=p):p=e[25];let x;e[26]!==o.totalMs||e[27]!==s||e[28]!==i||e[29]!==l?(x=s&&(0,t.jsxDEV)($,{label:l("Total time"),testId:`${i}-total-ms`,value:q(o.totalMs)},void 0,!1),e[26]=o.totalMs,e[27]=s,e[28]=i,e[29]=l,e[30]=x):x=e[30];let S;e[31]!==o.maxMs||e[32]!==s||e[33]!==i||e[34]!==l?(S=s&&(0,t.jsxDEV)($,{label:l("Max time"),testId:`${i}-max-ms`,value:q(o.maxMs)},void 0,!1),e[31]=o.maxMs,e[32]=s,e[33]=i,e[34]=l,e[35]=S):S=e[35];let T;e[36]!==u||e[37]!==p||e[38]!==x||e[39]!==S||e[40]!==k||e[41]!==g||e[42]!==c?(T=(0,t.jsxDEV)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":k,children:[g,c,u,p,x,S]},void 0,!0),e[36]=u,e[37]=p,e[38]=x,e[39]=S,e[40]=k,e[41]=g,e[42]=c,e[43]=T):T=e[43];let M;return e[44]!==v||e[45]!==T||e[46]!==h?(M=(0,t.jsxDEV)("section",{className:"flex flex-col gap-2","data-testid":v,children:[h,T]},void 0,!0),e[44]=v,e[45]=T,e[46]=h,e[47]=M):M=e[47],M},"PathCounters"),ue=C(r=>{let e=(0,P.c)(32),{initialShardKey:o}=r,s=A(),[i,l]=(0,G.useState)(o??""),d;e[0]!==i?(d=i.trim(),e[0]=i,e[1]=d):d=e[1];let v=L(d,400),h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];let k;e[3]!==v?(k={keepPreviousData:!0,shardKey:v},e[3]=v,e[4]=k):k=e[4];let{data:a,error:n,errorSource:g,refetch:N}=_(H.getFanoutMetrics,h,k);V(N,!0);let I;e[5]!==a?(I=a!==void 0&&Z(a),e[5]=a,e[6]=I):I=e[6];let c=I,f;e[7]!==i?(f=(0,t.jsxDEV)(j,{onChange:l,testId:"fanout-shard-input",value:i},void 0,!1),e[7]=i,e[8]=f):f=e[8];let y;e[9]!==a||e[10]!==s?(y=a!==void 0&&(0,t.jsxDEV)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"fanout-count",children:[a.promoted&&(0,t.jsxDEV)(w,{"data-testid":"fanout-promoted",variant:a.relayCount>=a.maxRelays?"destructive":"default",children:a.relayCount>=a.maxRelays?s("auto-scaled: {relayCount}/{maxRelays} relays (at ceiling)",{maxRelays:a.maxRelays,relayCount:a.relayCount}):s("auto-scaled: {relayCount}/{maxRelays} relays",{maxRelays:a.maxRelays,relayCount:a.relayCount})},void 0,!1),(0,t.jsxDEV)(w,{variant:"secondary",children:s("{count} connections",{count:a.totalConnections})},void 0,!1),(0,t.jsxDEV)(w,{variant:"secondary",children:s("peak {count} subscribers",{count:a.peakSubscribers})},void 0,!1)]},void 0,!0),e[9]=a,e[10]=s,e[11]=y):y=e[11];let u;e[12]!==f||e[13]!==y?(u=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[f,y]},void 0,!0),e[12]=f,e[13]=y,e[14]=u):u=e[14];let m;e[15]!==n||e[16]!==g?(m=n!==null&&(0,t.jsxDEV)(W,{error:g,testId:"fanout-error"},void 0,!1),e[15]=n,e[16]=g,e[17]=m):m=e[17];let b;e[18]!==n||e[19]!==c||e[20]!==s?(b=n===null&&c&&(0,t.jsxDEV)(B,{description:s("Realtime fan-out cost and per-topic subscriber counts for this shard."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsxDEV)("path",{d:"M4 12h4l3 7 4-14 3 7h2"},void 0,!1)},void 0,!1),testId:"fanout-empty",title:s("No fan-out activity yet.")},void 0,!1),e[18]=n,e[19]=c,e[20]=s,e[21]=b):b=e[21];let p;e[22]!==n||e[23]!==c||e[24]!==a||e[25]!==s?(p=n===null&&a!==void 0&&!c&&(0,t.jsxDEV)(t.Fragment,{children:[a.topics.length>0&&(0,t.jsxDEV)("section",{className:"flex flex-col gap-2","data-testid":"fanout-topics-section",children:[(0,t.jsxDEV)("h3",{className:"text-sm font-medium text-foreground",children:s("Hot topics")},void 0,!1),(0,t.jsxDEV)(E,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(O,{"data-testid":"fanout-topics-table",children:[(0,t.jsxDEV)(Q,{children:(0,t.jsxDEV)(K,{children:[(0,t.jsxDEV)(R,{children:s("Topic")},void 0,!1),(0,t.jsxDEV)(R,{children:s("Kind")},void 0,!1),(0,t.jsxDEV)(R,{className:"text-right",children:s("Subscribers")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(U,{children:a.topics.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("section",{className:"flex flex-col gap-3","data-testid":"fanout-cost",children:[(0,t.jsxDEV)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("Fan-out cost since this instance woke")},void 0,!1),(0,t.jsxDEV)(z,{counters:a.shapePoke,includeTiming:!0,prefix:"fanout-poke",t:s,title:s("Shape pokes")},void 0,!1),(0,t.jsxDEV)(z,{counters:a.whisper,includeTiming:!1,prefix:"fanout-whisper",t:s,title:s("Whisper broadcasts")},void 0,!1)]},void 0,!0)]},void 0,!0),e[22]=n,e[23]=c,e[24]=a,e[25]=s,e[26]=p):p=e[26];let x;return e[27]!==p||e[28]!==u||e[29]!==m||e[30]!==b?(x=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"fanout-panel",children:[u,m,b,p]},void 0,!0),e[27]=p,e[28]=u,e[29]=m,e[30]=b,e[31]=x):x=e[31],x},"FanoutPanel");function ee(r){return(0,t.jsxDEV)(K,{"data-testid":"fanout-topic-row",children:[(0,t.jsxDEV)(D,{className:"font-mono text-xs",children:r.topic},void 0,!1),(0,t.jsxDEV)(D,{children:(0,t.jsxDEV)(w,{variant:"outline",children:r.kind},void 0,!1)},void 0,!1),(0,t.jsxDEV)(D,{className:"text-right font-medium tabular-nums",children:r.subscribers},void 0,!1)]},`${r.kind}:${r.topic}`,!0)}C(ee,"_temp");export{ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as O}from"./chunk-J6J54MBP.js";import{a as j}from"./chunk-2K47A3P6.js";import{a as H}from"./chunk-HN6KJXYQ.js";import"./chunk-XNJNSCLM.js";import{a as P,b as F,c as L,d as k,e as u,f as m}from"./chunk-GTM65MVX.js";import{a as _}from"./chunk-UKDJ4H7I.js";import"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as R}from"./chunk-BOXSWNXZ.js";import{a as B}from"./chunk-TAD43CG5.js";import{b as K}from"./chunk-RHZ4M2NZ.js";import{a as M,e as $}from"./chunk-SEU5V7I6.js";import{b as y}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as D}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as S,e as T,f as U,g as V,h as X}from"./chunk-RRCPZMC2.js";var G=T(V(),1),J=T(U(),1);var t=T(X(),1);var W=80,Z=S(a=>{if(a===void 0)return"";let e=JSON.stringify(a);return e.length>W?`${e.slice(0,W)}\u2026`:e},"formatArguments"),q=S(a=>{let e=[];for(let n of a){let o=n.id.toString();if(n.subscriptions.length===0){e.push({admin:n.admin,connectionId:n.id,key:`c${o}`,subscription:null});continue}n.subscriptions.forEach((s,N)=>{e.push({admin:n.admin,connectionId:n.id,key:`c${o}-s${N.toString()}`,subscription:s})})}return e},"toRows"),w=(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1),de=S(a=>{let e=(0,G.c)(22),{initialShardKey:n}=a,o=D(),[s,N]=(0,J.useState)(n??""),f;e[0]!==s?(f=s.trim(),e[0]=s,e[1]=f):f=e[1];let A=j(f,400),h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={},e[2]=h):h=e[2];let p;e[3]!==A?(p={keepPreviousData:!0,shardKey:A},e[3]=A,e[4]=p):p=e[4];let{data:i,error:r,errorSource:c,refetch:Q}=K(R.listSubscriptions,h,p);O(Q,!0);let v;if(e[5]!==r||e[6]!==c||e[7]!==i||e[8]!==s||e[9]!==o){let C=i===void 0?[]:q(i.connections),l;e[11]!==s?(l=(0,t.jsxDEV)(_,{onChange:N,testId:"subs-shard-input",value:s},void 0,!1),e[11]=s,e[12]=l):l=e[12];let d;e[13]!==i||e[14]!==o?(d=i!==void 0&&(0,t.jsxDEV)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsxDEV)(y,{variant:"secondary",children:o("{count} connections",{count:i.totalConnections})},void 0,!1),(0,t.jsxDEV)(y,{variant:"secondary",children:o("{count} subscriptions",{count:i.totalSubscriptions})},void 0,!1)]},void 0,!0),e[13]=i,e[14]=o,e[15]=d):d=e[15];let b;e[16]!==l||e[17]!==d?(b=(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[l,d]},void 0,!0),e[16]=l,e[17]=d,e[18]=b):b=e[18];let g;e[19]!==r||e[20]!==c?(g=r!==null&&(0,t.jsxDEV)(H,{error:c,testId:"subs-error"},void 0,!1),e[19]=r,e[20]=c,e[21]=g):g=e[21],v=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[b,g,r===null&&i!==void 0&&C.length===0&&(0,t.jsxDEV)(B,{description:o("Active WebSocket subscriptions on this shard."),icon:(0,t.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsxDEV)("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"},void 0,!1)},void 0,!1),testId:"subs-empty",title:o("No active subscriptions.")},void 0,!1),r===null&&C.length>0&&(0,t.jsxDEV)(M,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)($,{className:"px-0",children:(0,t.jsxDEV)(P,{"data-testid":"subs-table",children:[(0,t.jsxDEV)(F,{children:(0,t.jsxDEV)(k,{children:[(0,t.jsxDEV)(u,{children:o("Connection")},void 0,!1),(0,t.jsxDEV)(u,{children:o("Function path")},void 0,!1),(0,t.jsxDEV)(u,{children:o("Table")},void 0,!1),(0,t.jsxDEV)(u,{children:o("Arguments")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(L,{children:C.map(x=>{let{subscription:I}=x,E=Z(I?.args);return(0,t.jsxDEV)(k,{"data-testid":"subs-row",children:[(0,t.jsxDEV)(m,{className:"font-medium tabular-nums",children:(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1.5",children:["#",x.connectionId,x.admin&&(0,t.jsxDEV)(y,{variant:"outline",children:o("admin")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(m,{className:"font-mono text-xs",children:I?.functionPath??w},void 0,!1),(0,t.jsxDEV)(m,{children:I?.table??w},void 0,!1),(0,t.jsxDEV)(m,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:E||void 0,children:E||w},void 0,!1)]},x.key,!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0),e[5]=r,e[6]=c,e[7]=i,e[8]=s,e[9]=o,e[10]=v}else v=e[10];return v},"SubscriptionsPanel");export{de as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as H}from"./chunk-J6J54MBP.js";import{a as R,b as _,c as $,d as N,e as o,f as r}from"./chunk-GTM65MVX.js";import{c as S}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{a as w}from"./chunk-TAD43CG5.js";import{a as E}from"./chunk-RHZ4M2NZ.js";import{a as C,e as k}from"./chunk-SEU5V7I6.js";import"./chunk-CKSHCYGC.js";import{f as A}from"./chunk-XLXNLJ4N.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as g,k as I,o as B}from"./chunk-E75ANNWX.js";import"./chunk-JHKMUTIF.js";import{a as m,e as T,g as j,h as z}from"./chunk-RRCPZMC2.js";var Q=T(j(),1);var t=T(z(),1);var L=200,K=m(()=>{let e=(0,Q.c)(21),d=A(),s=g(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=["lunora-auth-sessions",L],e[0]=u):u=e[0];let h;e[1]!==d?(h=m(()=>d.listAuthSessions({limit:L}),"t1"),e[1]=d,e[2]=h):h=e[2];let l=E(u,h),{error:v}=l,i=l.data?.rows??null,p;e[3]!==l?(p=m(()=>{l.refetch()},"t2"),e[3]=l,e[4]=p):p=e[4],H(p,!0);let x;e[5]!==d||e[6]!==l?(x=m(a=>{I((async()=>{await d.revokeAuthSession({sessionId:a}),l.refetch()})())},"t3"),e[5]=d,e[6]=l,e[7]=x):x=e[7];let y=x,n;e[8]!==v?(n=v!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"auth-sessions-error",role:"alert",children:v},void 0,!1),e[8]=v,e[9]=n):n=e[9];let c;e[10]!==i||e[11]!==s?(c=i!==null&&i.length===0&&(0,t.jsxDEV)(w,{testId:"auth-sessions-empty",title:s("No active sessions.")},void 0,!1),e[10]=i,e[11]=s,e[12]=c):c=e[12];let f;e[13]!==y||e[14]!==i||e[15]!==s?(f=i!==null&&i.length>0&&(0,t.jsxDEV)(C,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(k,{className:"px-0",children:(0,t.jsxDEV)(R,{"data-testid":"auth-sessions-table",children:[(0,t.jsxDEV)(_,{children:(0,t.jsxDEV)(N,{children:[(0,t.jsxDEV)(o,{children:s("user")},void 0,!1),(0,t.jsxDEV)(o,{children:s("expires")},void 0,!1),(0,t.jsxDEV)(o,{children:s("ip")},void 0,!1),(0,t.jsxDEV)(o,{children:s("user agent")},void 0,!1),(0,t.jsxDEV)(o,{children:s("impersonated by")},void 0,!1),(0,t.jsxDEV)(o,{"aria-label":s("Actions")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)($,{children:i.map(a=>(0,t.jsxDEV)(N,{"data-testid":`auth-session-${a.id}`,children:[(0,t.jsxDEV)(r,{className:"font-mono text-xs",children:a.userId},void 0,!1),(0,t.jsxDEV)(r,{className:"text-muted-foreground tabular-nums",children:B(a.expiresAt)},void 0,!1),(0,t.jsxDEV)(r,{children:a.ipAddress??""},void 0,!1),(0,t.jsxDEV)(r,{className:"max-w-40 truncate",children:a.userAgent??""},void 0,!1),(0,t.jsxDEV)(r,{className:"font-mono text-xs",children:a.impersonatedBy??""},void 0,!1),(0,t.jsxDEV)(r,{children:(0,t.jsxDEV)(S,{"data-testid":`auth-session-revoke-${a.id}`,onClick:m(()=>{y(a.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:s("Revoke")},void 0,!1)},void 0,!1)]},a.id,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),e[13]=y,e[14]=i,e[15]=s,e[16]=f):f=e[16];let b;return e[17]!==n||e[18]!==c||e[19]!==f?(b=(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"auth-sessions",children:[n,c,f]},void 0,!0),e[17]=n,e[18]=c,e[19]=f,e[20]=b):b=e[20],b},"AuthSessionsPanel");export{K as AuthSessionsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as a,J as j,Y as de,c as J,e as ce,f as le,g as pe,h as fe,ma as me,wa as ge}from"./chunk-KSKXW5PX.js";import{b as H}from"./chunk-5OIBXYZM.js";import{F as B,J as k,O as Y,P as z,h as ue,p as ae}from"./chunk-3CJW6NWG.js";import{a as P,c as F,i as ie,r as se}from"./chunk-O3NAGRTR.js";import{a as re}from"./chunk-HV7G6DFP.js";import{g as O,i as w}from"./chunk-CKSHCYGC.js";import{a as we}from"./chunk-3OA7PECS.js";import{a as r,e as b,f as q}from"./chunk-RRCPZMC2.js";var he=b(q(),1),Q=b(re(),1);function $e(e,t){let n=he.useRef(null);function o(u){Q.flushSync(()=>{e.setOpen(!1,z(Y.focusOut,u.nativeEvent,u.currentTarget))}),pe(n.current)?.focus()}r(o,"handlePreFocusGuardFocus");function c(u){let i=e.select("positionerElement");if(i&&fe(u,i))e.context.beforeContentFocusGuardRef.current?.focus();else{Q.flushSync(()=>{e.setOpen(!1,z(Y.focusOut,u.nativeEvent,u.currentTarget))});let s=le(e.context.triggerFocusTargetRef.current||t.current);for(;s!==null&&ae(i,s);){let m=s;if(s=ce(s),s===m)break}s?.focus()}}return r(c,"handleFocusTargetFocus"),{preFocusGuardRef:n,handlePreFocusGuardFocus:o,handleFocusTargetFocus:c}}r($e,"useTriggerFocusGuards");var l=b(q(),1),ve=b(re(),1);var M=b(q(),1);function X(e){let t=se(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,c=ie(e),u=c?e.offsetWidth:n,i=c?e.offsetHeight:o;return(J(n)!==u||J(o)!==i)&&(n=u,o=i),{width:n,height:o}}r(X,"getCssDimensions");function Re(e){let{popupElement:t,positionerElement:n,content:o,mounted:c,onMeasureLayout:u,onMeasureLayoutComplete:i,side:s,direction:m}=e,x=k(t,!0,!1),g=B(),p=M.useRef(null),D=M.useRef(!0),f=M.useRef(O),I=F(u),v=F(i),C=M.useMemo(()=>{let h=s==="top",R=s==="left";return m==="rtl"?(h=h||s==="inline-end",R=R||s==="inline-end"):(h=h||s==="inline-start",R=R||s==="inline-start"),h?{position:"absolute",[s==="top"?"bottom":"top"]:"0",[R?"right":"left"]:"0"}:w},[s,m]);P(()=>{if(!c){f.current=O,D.current=!0,p.current=null;return}if(!t||!n)return;f.current=ye(t,C),Z(t,"auto");let h=K(t,"position","static"),R=K(t,"transform","none"),U=K(t,"scale","1"),y=ye(n,{"--available-width":"max-content","--available-height":"max-content"});function T(){h(),R(),y()}r(T,"restoreMeasurementOverrides");function L(){T(),U()}if(r(L,"restoreMeasurementOverridesIncludingScale"),I?.(),D.current||p.current===null){G(n,"max-content");let E=X(t);return p.current=E,G(n,E),L(),v?.(null,E),D.current=!1,()=>{f.current(),f.current=O}}G(n,"max-content");let N=p.current,S=X(t);p.current=S,Z(t,N),L(),v?.(N,S),G(n,S);let $=new AbortController;return g.request(()=>{Z(t,S),x(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},$.signal)}),()=>{$.abort(),g.cancel(),f.current(),f.current=O}},[o,t,n,x,g,c,I,v,C])}r(Re,"usePopupAutoResize");function K(e,t,n){let o=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,o)}}r(K,"overrideElementStyle");function ye(e,t){let n=[];for(let[o,c]of Object.entries(t))n.push(K(e,o,c));return n.length?()=>{n.forEach(o=>o())}:O}r(ye,"applyElementStyles");function Z(e,t){let n=t==="auto"?"auto":`${t.width}px`,o=t==="auto"?"auto":`${t.height}px`;e.style.setProperty("--popup-width",n),e.style.setProperty("--popup-height",o)}r(Z,"setPopupCssSize");function G(e,t){let n=t==="max-content"?"max-content":`${t.width}px`,o=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty("--positioner-width",n),e.style.setProperty("--positioner-height",o)}r(G,"setPositionerCssSize");var A=b(we(),1);function pt(e){let{store:t,side:n,cssVars:o,children:c}=e,u=H(),i=t.useState("activeTriggerElement"),s=t.useState("activeTriggerId"),m=t.useState("open"),x=t.useState("payload"),g=t.useState("mounted"),p=t.useState("popupElement"),D=t.useState("positionerElement"),f=ge(m?i:null),I=Ae(s,x),v=l.useRef(null),[C,h]=l.useState(null),[R,U]=l.useState(null),y=l.useRef(null),T=l.useRef(null),L=k(y,!0,!1),N=B(),[S,$]=l.useState(null),[E,te]=l.useState(!1);P(()=>(t.set("hasViewport",!0),()=>{t.set("hasViewport",!1)}),[t]);let Te=F(()=>{y.current?.style.setProperty("animation","none"),y.current?.style.setProperty("transition","none"),T.current?.style.setProperty("display","none")}),Ee=F(d=>{y.current?.style.removeProperty("animation"),y.current?.style.removeProperty("transition"),T.current?.style.removeProperty("display"),d&&$(d)}),W=l.useRef(null);P(()=>{(!m||!g)&&(W.current=null)},[m,g]),P(()=>{if(i&&f&&i!==f&&W.current!==i&&v.current){h(v.current),te(!0);let d=Me(f,i);U(d),N.request(()=>{ve.flushSync(()=>{te(!1)}),L(()=>{h(null),$(null),v.current=null})}),W.current=i}},[i,f,C,L,N]),P(()=>{let d=y.current;if(!d)return;let oe=ue(d).createElement("div");for(let Oe of Array.from(d.childNodes))oe.appendChild(Oe.cloneNode(!0));v.current=oe});let ne=C!=null,_;ne?_=(0,A.jsxs)(l.Fragment,{children:[(0,A.jsx)("div",{"data-previous":!0,inert:me(!0),ref:T,style:{...S?{[o.popupWidth]:`${S.width}px`,[o.popupHeight]:`${S.height}px`}:null,position:"absolute"},"data-ending-style":E?void 0:""},"previous"),(0,A.jsx)("div",{"data-current":!0,ref:y,"data-starting-style":E?"":void 0,children:c},I)]}):_=(0,A.jsx)("div",{"data-current":!0,ref:y,children:c},I),P(()=>{let d=T.current;!d||!C||d.replaceChildren(...Array.from(C.childNodes))},[C]),Re({popupElement:p,positionerElement:D,mounted:g,content:x,onMeasureLayout:Te,onMeasureLayoutComplete:Ee,side:n,direction:u});let be={activationDirection:Fe(R),transitioning:ne};return{children:_,state:be}}r(pt,"usePopupViewport");function Fe(e){if(e)return`${Pe(e.horizontal,5,"right","left")} ${Pe(e.vertical,5,"down","up")}`}r(Fe,"getActivationDirection");function Pe(e,t,n,o){return e>t?n:e<-t?o:""}r(Pe,"getValueWithTolerance");function Me(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),c={x:n.left+n.width/2,y:n.top+n.height/2},u={x:o.left+o.width/2,y:o.top+o.height/2};return{horizontal:u.x-c.x,vertical:u.y-c.y}}r(Me,"calculateRelativePosition");function Ae(e,t){let[n,o]=l.useState(0),c=l.useRef(e),u=l.useRef(t),i=l.useRef(!1);return P(()=>{let s=c.current,m=u.current,x=e!==s,g=t!==m;x?(o(p=>p+1),i.current=!g):i.current&&g&&(o(p=>p+1),i.current=!1),c.current=e,u.current=t},[e,t]),`${e??"current"}-${n}`}r(Ae,"usePopupContentKey");function Ce(){return new j({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new de,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}r(Ce,"getEmptyRootContext");function St(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Ce(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:w,inactiveTriggerProps:w,popupProps:w}}r(St,"createInitialPopupStoreState");function xt(e,t,n=!1){return new j({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}r(xt,"createPopupFloatingRootContext");var V=a(e=>e.triggerIdProp??e.activeTriggerId),ee=a(e=>e.openProp??e.open),Se=a(e=>(e.popupElement?.id??e.floatingId)||void 0);function xe(e,t){return t!==void 0&&ee(e)&&V(e)===t}r(xe,"triggerOwnsOpenPopup");function De(e,t){return xe(e,t)?!0:t!==void 0&&ee(e)&&V(e)==null&&e.triggerCount===1}r(De,"triggerOwnsOpenPopupOrIsOnlyTrigger");var Tt={open:ee,mounted:a(e=>e.mounted),transitionStatus:a(e=>e.transitionStatus),floatingRootContext:a(e=>e.floatingRootContext),triggerCount:a(e=>e.triggerCount),preventUnmountingOnClose:a(e=>e.preventUnmountingOnClose),payload:a(e=>e.payload),activeTriggerId:V,activeTriggerElement:a(e=>e.mounted?e.activeTriggerElement:null),popupId:Se,isTriggerActive:a((e,t)=>t!==void 0&&V(e)===t),isOpenedByTrigger:a((e,t)=>xe(e,t)),isMountedByTrigger:a((e,t)=>t!==void 0&&V(e)===t&&e.mounted),triggerProps:a((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:a((e,t)=>De(e,t)?Se(e):void 0),popupProps:a(e=>e.popupProps),popupElement:a(e=>e.popupElement),positionerElement:a(e=>e.positionerElement)};export{St as a,xt as b,Tt as c,$e as d,pt as e};
|