@lunora/studio 1.0.0-alpha.9 → 1.0.0-alpha.90
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/dist/index.d.ts +822 -781
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/AdvisorHealthPanel.js +1 -0
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +6 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/migrations-route.js +1 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-4aE59aDq.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-DLMeLZ5-.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-9q8BbJl-.js +1 -0
- package/dist/packem_shared/CommandPalette--SQwfTW1.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-CZZ_WkJ-.js +1 -0
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DpkjHfDg.js +1 -0
- package/dist/packem_shared/HomePanel-3baDsDBU.js +1 -0
- package/dist/packem_shared/MigrationsPanel-dygzHUvg.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-qOZcWXMs.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-D8kBZWBu.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-forQt-PC.js +1 -0
- package/dist/packem_shared/StudioApp-B1AWsBzi.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-Pa8HLtBv.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-DW7yZsfu.d.ts +252 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-DraN_srt.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-Dmg86v1D.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-DcxyIXwG.js +1 -0
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-t6cpEi0z.js +1 -0
- package/dist/packem_shared/grid-features-jnrD0SpX.js +6 -0
- package/dist/packem_shared/home-panel-CeeqqV0z.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-BSIsQVC6.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
- package/dist/packem_shared/recording-client-DRAZEmzE.js +1 -0
- package/dist/packem_shared/reference-view-DnYYWr7I.js +12 -0
- package/dist/packem_shared/result-chart-DzJOVsaw.js +1 -0
- package/dist/packem_shared/schema-diagram-cg-bz_VL.js +2 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-CgjeUU2I.js +1 -0
- package/dist/packem_shared/stat-card-fm_TF1mo.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BtC7WPbz.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-D9Bd4qgi.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-QJ-ibl5u.js +1 -0
- package/dist/packem_shared/use-async-submit-q3ymBJkD.js +1 -0
- package/dist/packem_shared/use-auth-config-BObBpdsi.js +1 -0
- package/dist/packem_shared/use-shard-key-B2JtNa5m.js +1 -0
- package/dist/packem_shared/use-sql-assistant-C6dl2_Ty.js +1 -0
- package/dist/packem_shared/useDebounced-CU-uftxO.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-24JLZ2Z5.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2QSHLBCO.js +1 -0
- package/dist/standalone/chunk-3AV5CV6K.js +1 -0
- package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
- package/dist/standalone/chunk-3CWGJYBB.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4COKHD2C.js +1 -0
- package/dist/standalone/chunk-4LCY5XUR.js +1 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-53KJRSHE.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-5ZXDB6LB.js +13 -0
- package/dist/standalone/chunk-62EKHKTS.js +1 -0
- package/dist/standalone/chunk-67DKQC23.js +1 -0
- package/dist/standalone/chunk-6MKDYZ7A.js +1 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-6VTLIGVX.js +1 -0
- package/dist/standalone/chunk-7H7LZRLP.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-AQX2QFCN.js +1 -0
- package/dist/standalone/chunk-ARP36PTE.js +1 -0
- package/dist/standalone/chunk-AUQKJYHL.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-AZAGCJVI.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BL6NO3U3.js +1 -0
- package/dist/standalone/chunk-BRQMMGOS.js +1 -0
- package/dist/standalone/chunk-BUTBQGUU.js +1 -0
- package/dist/standalone/chunk-C3HXK3A5.js +3 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-CT6ZDXLL.js +1 -0
- package/dist/standalone/chunk-CTNB2KIA.js +1 -0
- package/dist/standalone/chunk-D3HXVA33.js +1 -0
- package/dist/standalone/chunk-DG7YINFM.js +1 -0
- package/dist/standalone/chunk-DMCYISRF.js +1 -0
- package/dist/standalone/chunk-E7TB4USI.js +1 -0
- package/dist/standalone/chunk-EQZTSISX.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-FURI47Z2.js +1 -0
- package/dist/standalone/chunk-FW75RYZU.js +1 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-GKSRVABT.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GSKOAKQ2.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-I6A5C46N.js +1 -0
- package/dist/standalone/chunk-IAKPXGTQ.js +8 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IC64YIX5.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JFW3YNVQ.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-LAHYLAT4.js +1 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LJIFMW67.js +1 -0
- package/dist/standalone/chunk-LJISXTZJ.js +1 -0
- package/dist/standalone/chunk-LQAKPCFX.js +1 -0
- package/dist/standalone/chunk-MHAXZQVO.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-MV4A2PAK.js +1 -0
- package/dist/standalone/chunk-OG2AMGOC.js +1 -0
- package/dist/standalone/chunk-OG4N2XHD.js +19 -0
- package/dist/standalone/chunk-PB7FNRDB.js +1 -0
- package/dist/standalone/chunk-PGC523I2.js +1 -0
- package/dist/standalone/chunk-PM37X2V3.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QLQADHFE.js +1 -0
- package/dist/standalone/chunk-QP7IQOKF.js +1 -0
- package/dist/standalone/chunk-QV6KV4SD.js +1 -0
- package/dist/standalone/chunk-QWBRD6PX.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QXXIJAD5.js +1 -0
- package/dist/standalone/chunk-QYIOW7CD.js +4 -0
- package/dist/standalone/chunk-S3DWUXGY.js +62 -0
- package/dist/standalone/chunk-S4ILMYP5.js +4 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SF4MF2FT.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SHMNA6UL.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-SP5SBO2W.js +3 -0
- package/dist/standalone/chunk-T6OAYQTX.js +1 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-TBBJPPZ3.js +2 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-U6TNNM5U.js +1 -0
- package/dist/standalone/chunk-ULCZDGWQ.js +1 -0
- package/dist/standalone/chunk-UU2QJMGJ.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V2U5CL3S.js +11 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VDW32UET.js +1 -0
- package/dist/standalone/chunk-VFQDHG7I.js +4 -0
- package/dist/standalone/chunk-WB5IUUUU.js +1 -0
- package/dist/standalone/chunk-WLZ7YPBH.js +6 -0
- package/dist/standalone/chunk-X665E2HU.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XF2B7P5A.js +1 -0
- package/dist/standalone/chunk-XNGYYOLS.js +14 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XR7RBXKA.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-XZSGE5ST.js +1 -0
- package/dist/standalone/chunk-Y7JXGNXD.js +1 -0
- package/dist/standalone/chunk-YOUKADZH.js +1 -0
- package/dist/standalone/chunk-YU5CI2FD.js +6 -0
- package/dist/standalone/chunk-Z7G74IH4.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/chunk-ZPLWCC4I.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +16 -14
- package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +0 -46
- package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-rwttyQ1-.js +0 -251
- package/dist/packem_shared/AuditPanel-BqXZAsu_.js +0 -212
- package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-BtT2NYcR.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-Dq6rj0tI.js +0 -193
- package/dist/packem_shared/FileBrowser-0pCpdKPE.js +0 -2932
- package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-Cn_EBpDy.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-CQ4LzVET.js +0 -640
- package/dist/packem_shared/HomePanel-CP0lN1eF.js +0 -1273
- package/dist/packem_shared/InsightsPanel-B1BaHaPL.js +0 -431
- package/dist/packem_shared/LogsPanel-C3W0mabf.js +0 -839
- package/dist/packem_shared/MailPanel-DozizrvV.js +0 -447
- package/dist/packem_shared/MetricsPanel-CujtUfpl.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-RX5qIFSr.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-LJGNP_IX.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
- package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-Bn2yq05G.js +0 -79
- package/dist/packem_shared/SettingsPanel-CBXQpYQA.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +0 -13
- package/dist/packem_shared/Studio-CccqZ-J1.js +0 -33
- package/dist/packem_shared/StudioApp-CQbULfaH.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-Df_5NPaF.js +0 -371
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-Nbhpihxv.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-Smfl_FDF.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-D93XGB-i.js +0 -10413
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G}from"./chunk-7QIFDWQV.js";import{a as u,e as N,f as Y}from"./chunk-3XIESWL4.js";function K(l,h,t){let e=new Array(l);return new Proxy(e,{get(s,n,o){if(typeof n=="string"){let i=n.charCodeAt(0);if(i>=48&&i<=57){let r=+n;if(Number.isInteger(r)&&r>=0&&r<l){let d=s[r];if(!d){let a=h[r*2];d=s[r]={index:r,key:t(r),start:a,size:h[r*2+1],end:a+h[r*2+1],lane:0}}return d}}if(n==="length")return l}return Reflect.get(s,n,o)}})}u(K,"createLazyMeasurementsView");function _(l,h,t){let e=t.initialDeps??[],s,n=!0;function o(){var i;let d=0,a=l();if(!(a.length!==e.length||a.some((g,S)=>e[S]!==g)))return s;e=a;let c=0;return s=h(...a),t?.onChange&&!(n&&t.skipInitialOnChange)&&t.onChange(s),n=!1,s}return u(o,"memoizedFunction"),o.updateDeps=i=>{e=i},o}u(_,"memo");function W(l,h){if(l===void 0)throw new Error(`Unexpected undefined${h?`: ${h}`:""}`);return l}u(W,"notUndefined");var P=u((l,h)=>Math.abs(l-h)<1.01,"approxEqual"),B=u((l,h,t)=>{let e;return function(...s){l.clearTimeout(e),e=l.setTimeout(()=>h.apply(this,s),t)}},"debounce");var A,k=u(()=>{if(A!==void 0)return A;if(typeof navigator>"u")return A=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return A=!0;let l=navigator.maxTouchPoints;return A=navigator.platform==="MacIntel"&&l!==void 0&&l>0},"isIOSWebKit");var $=u(l=>{let{offsetWidth:h,offsetHeight:t}=l;return{width:h,height:t}},"getRect"),Q=u(l=>l,"defaultKeyExtractor"),Z=u(l=>{let h=Math.max(l.startIndex-l.overscan,0),e=Math.min(l.endIndex+l.overscan,l.count-1)-h+1,s=new Array(e);for(let n=0;n<e;n++)s[n]=h+n;return s},"defaultRangeExtractor"),H=u((l,h)=>{let t=l.scrollElement;if(!t)return;let e=l.targetWindow;if(!e)return;let s=u(o=>{let{width:i,height:r}=o;h({width:Math.round(i),height:Math.round(r)})},"handler");if(s($(t)),!e.ResizeObserver)return()=>{};let n=new e.ResizeObserver(o=>{let i=u(()=>{let r=o[0];if(r?.borderBoxSize){let d=r.borderBoxSize[0];if(d){s({width:d.inlineSize,height:d.blockSize});return}}s($(t))},"run");l.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return n.observe(t,{box:"border-box"}),()=>{n.unobserve(t)}},"observeElementRect"),R={passive:!0};var tt=typeof window>"u"?!0:"onscrollend"in window,et=u((l,h,t)=>{let e=l.scrollElement;if(!e)return;let s=l.targetWindow;if(!s)return;let n=l.options.useScrollendEvent&&tt,o=0,i=n?null:B(s,()=>h(o,!1),l.options.isScrollingResetDelay),r=u(f=>()=>{o=t(e),i?.(),h(o,f)},"createHandler"),d=r(!0),a=r(!1);return e.addEventListener("scroll",d,R),n&&e.addEventListener("scrollend",a,R),()=>{e.removeEventListener("scroll",d),n&&e.removeEventListener("scrollend",a)}},"observeOffset"),J=u((l,h)=>et(l,h,t=>{let{horizontal:e,isRtl:s}=l.options;return e?t.scrollLeft*(s&&-1||1):t.scrollTop}),"observeElementOffset");var st=u((l,h,t)=>{if(t.options.useCachedMeasurements){let e=t.indexFromElement(l),s=t.options.getItemKey(e);return t.itemSizeCache.get(s)??t.options.estimateSize(e)}if(h?.borderBoxSize){let e=h.borderBoxSize[0];if(e)return Math.round(e[t.options.horizontal?"inlineSize":"blockSize"])}if(!h){let e=t.indexFromElement(l),s=t.options.getItemKey(e),n=t.itemSizeCache.get(s);if(n!==void 0)return n}return l[t.options.horizontal?"offsetWidth":"offsetHeight"]},"measureElement"),nt=u((l,{adjustments:h=0,behavior:t},e)=>{var s,n;(n=(s=e.scrollElement)==null?void 0:s.scrollTo)==null||n.call(s,{[e.options.horizontal?"left":"top"]:l+h,behavior:t})},"scrollWithAdjustments");var q=nt,F=class{static{u(this,"Virtualizer")}constructor(h){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,e,s;return((s=(e=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:e.now)==null?void 0:s.call(e))??Date.now()},this.observer=(()=>{let t=null,e=u(()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(n=>{let o=u(()=>{let i=n.target,r=this.indexFromElement(i);if(!i.isConnected){this.observer.unobserve(i);for(let[d,a]of this.elementsCache)if(a===i){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(i,n,this))},"run");this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})})),"get");return{disconnect:u(()=>{var s;(s=e())==null||s.disconnect(),t=null},"disconnect"),observe:u(s=>{var n;return(n=e())==null?void 0:n.observe(s,{box:"border-box"})},"observe"),unobserve:u(s=>{var n;return(n=e())==null?void 0:n.unobserve(s)},"unobserve")}})(),this.range=null,this.setOptions=t=>{var e,s;let n={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Q,rangeExtractor:Z,onChange:u(()=>{},"onChange"),measureElement:st,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let c in t){let g=t[c];g!==void 0&&(n[c]=g)}let o=this.options,i=null,r=null,d=!1;if(o!==void 0&&o.enabled&&n.enabled&&n.anchorTo==="end"&&this.scrollElement!==null){let c=o.count,g=n.count,S=this.getMeasurements(),v=c>0?((e=S[0])==null?void 0:e.key)??o.getItemKey(0):null,b=c>0?((s=S[c-1])==null?void 0:s.key)??o.getItemKey(c-1):null;if(g!==c||c>0&&g>0&&(n.getItemKey(0)!==v||n.getItemKey(g-1)!==b)){d=!0;let E=c>0?this.getVirtualItemForOffset(this.getScrollOffset())??S[0]:null;E&&(i=[E.key,this.getScrollOffset()-E.start]);let x=n.followOnAppend===!0?"auto":n.followOnAppend||null;x&&g>c&&this.isAtEnd(o.scrollEndThreshold)&&(c===0||n.getItemKey(g-1)!==b)&&(r=x)}}this.options=n,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let a=!1,f=0;if(i&&this.scrollOffset!==null){let[c,g]=i,S=this.getMeasurements(),{count:v,getItemKey:b}=this.options,m=0;for(;m<v&&b(m)!==c;)m++;if(m<v){let p=S[m];if(p){let E=Math.max(0,p.start+g);E!==this.scrollOffset&&(f=E-this.scrollOffset,this.scrollOffset=E,a=!0)}}}(a||r)&&(this.pendingScrollAnchor=[a?i[0]:null,a?i[1]:0,r,f])},this.notify=t=>{var e,s;(s=(e=this.options).onChange)==null||s.call(e,this,t)},this.maybeNotify=_(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:u(()=>this.options.debug,"debug"),initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,o)=>{if(o&&this._intendedScrollOffset===null&&n===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(n-this._intendedScrollOffset)<1.5&&(n=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let i=this.getScrollOffset();this.scrollDirection=o?i===n?this.scrollDirection:i<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=o,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){let n=this.scrollElement,o=u(()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},"onTouchStart"),i=u(()=>{this._iosTouching=!1,!(!k()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))},"onTouchEnd");n.addEventListener("touchstart",o,R),n.addEventListener("touchend",i,R),this.unsubs.push(()=>{n.removeEventListener("touchstart",o),n.removeEventListener("touchend",i),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){let[n,o,i,r]=s;n!==null&&!i&&(k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?r!==0&&(this._iosDeferredAdjustment+=r):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),i&&this.scrollToEnd({behavior:i})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let t=this.getScrollOffset(),e=this.getMaxScrollOffset();if(t<0||t>e)return;if(this._iosDeferredAdjustment<0&&t>=e-1){this._iosDeferredAdjustment=0;return}let s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=_(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,e,s,n,o,i,r,d)=>(this.prevLanes!==void 0&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMin=null,{count:t,paddingStart:e,scrollMargin:s,getItemKey:n,enabled:o,lanes:i,laneAssignmentMode:r,gap:d}),{key:!1}),this.getMeasurements=_(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:e,scrollMargin:s,getItemKey:n,enabled:o,lanes:i,laneAssignmentMode:r,gap:d},a)=>{let f=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(let m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));let c=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),i===1){let m=t*2,p=this._flatMeasurements;if(!p||p.length<m){let O=new Float64Array(m);p&&c>0&&O.set(p.subarray(0,c*2)),p=O,this._flatMeasurements=p}let E;if(c===0)E=e+s;else{let O=c-1;E=p[O*2]+p[O*2+1]+d}for(let O=c;O<t;O++){let C=n(O),y=f.get(C),T=typeof y=="number"?y:this.options.estimateSize(O);p[O*2]=E,p[O*2+1]=T,E+=T+d}let x=K(t,p,n);return this.measurementsCache=x,x}let g=this.measurementsCache.slice(0,c),S=new Array(i).fill(void 0),v=new Float64Array(i),b=0;for(let m=0;m<c;m++){let p=g[m];p&&(S[p.lane]===void 0&&b++,S[p.lane]=m,v[p.lane]=p.end)}for(let m=c;m<t;m++){let p=n(m),E=this.laneAssignments.get(m),x,O,C=r==="estimate"||f.has(p);if(E!==void 0&&this.options.lanes>1){x=E;let M=S[x],I=M!==void 0?g[M]:void 0;O=I?I.end+d:e+s}else if(b===i){let M=0,I=v[0],V=S[0];for(let z=1;z<i;z++){let D=v[z];(D<I||D===I&&S[z]<V)&&(M=z,I=D,V=S[z])}x=M,O=I+d,C&&this.laneAssignments.set(m,x)}else x=m%this.options.lanes,O=e+s,C&&this.laneAssignments.set(m,x);let y=f.get(p),T=typeof y=="number"?y:this.options.estimateSize(m),L=O+T;g[m]={index:m,start:O,size:T,end:L,key:p,lane:x},S[x]===void 0&&b++,S[x]=m,v[x]=L}return this.measurementsCache=g,g},{key:!1,debug:u(()=>this.options.debug,"debug")}),this.calculateRange=_(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,e,s,n)=>t.length===0||e===0?(this.range=null,null):(this.range=ot(t,e,s,n,n===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:u(()=>this.options.debug,"debug")}),this.getVirtualIndexes=_(()=>{let t=null,e=null,s=this.calculateRange();return s&&(t=s.startIndex,e=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,e]},(t,e,s,n,o)=>n===null||o===null?[]:t({startIndex:n,endIndex:o,overscan:e,count:s}),{key:!1,debug:u(()=>this.options.debug,"debug")}),this.indexFromElement=t=>{let e=this.options.indexAttribute,s=t.getAttribute(e);return s?parseInt(s,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var e;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let s=this.scrollState.index??((e=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:e.index);if(s!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,s-n),i=Math.min(this.options.count-1,s+n);return t>=o&&t<=i}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,i)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(i))});return}let e=this.indexFromElement(t),s=this.options.getItemKey(e),n=this.elementsCache.get(s);n!==t&&(n&&this.observer.unobserve(n),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(e)&&this.resizeItem(e,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,e)=>{var s,n;if(t<0||t>=this.options.count)return;let o,i,r,d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)r=this.options.getItemKey(t),i=d[t*2],o=d[t*2+1];else{let c=this.measurementsCache[t];if(!c)return;r=c.key,i=c.start,o=c.size}let a=this.itemSizeCache.get(r)??o,f=e-a;if(f!==0){let c=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=c?this.getTotalSize():0,S=this.getScrollOffset()+this.scrollAdjustments,b=!this.itemSizeCache.has(r)?i<S:i+a<=S&&this.scrollDirection!=="backward",m=((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:r,start:i,size:o,end:i+o,lane:0},f,this):b);(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(r,e),this.itemSizeCacheVersion++,c?this.applyScrollAdjustment(this.getTotalSize()-g):m&&this.applyScrollAdjustment(f),this.notify(!1)}},this.getVirtualItems=_(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,e)=>{let s=[];for(let n=0,o=t.length;n<o;n++){let i=t[n],r=e[i];s.push(r)}return s},{key:!1,debug:u(()=>this.options.debug,"debug")}),this.getVirtualItemForOffset=t=>{let e=this.getMeasurements();if(e.length===0)return;let s=this._flatMeasurements,n=this.options.lanes===1&&s!=null,o=U(0,e.length-1,n?i=>s[i*2]:i=>W(e[i]).start,t);return W(e[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,e,s=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),o=this.getScrollOffset();e==="auto"&&(e=t>=o+n?"end":"start"),e==="center"?t+=(s-n)/2:e==="end"&&(t-=n);let i=this.getMaxScrollOffset();return Math.max(Math.min(i,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));let s=this.getSize(),n=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if(e==="auto")if(o.end>=n+s-this.options.scrollPaddingEnd)e="end";else if(o.start<=n+this.options.scrollPaddingStart)e="start";else return[n,e];if(e==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),e];let i=e==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,e,o.size),e]},this.scrollToOffset=(t,{align:e="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;let n=this.getOffsetForAlignment(t,e),o=this.now();this.scrollState={index:null,align:e,behavior:s,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:e="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,t=Math.max(0,Math.min(t,this.options.count-1));let n=this.getOffsetForIndex(t,e);if(!n)return;let[o,i]=n,r=this.now();this.scrollState={index:t,align:i,behavior:s,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:e="auto"}={})=>{let s=this.getScrollOffset()+t,n=this.now();this.scrollState={index:null,align:"start",behavior:e,startedAt:n,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;let e=this.getMeasurements(),s;if(e.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,o=this._flatMeasurements;o!=null?s=o[n*2]+o[n*2+1]:s=((t=e[n])==null?void 0:t.end)??0}else{let n=Array(this.options.lanes).fill(null),o=e.length-1;for(;o>=0&&n.some(i=>i===null);){let i=e[o];n[i.lane]===null&&(n[i.lane]=i.end),o--}s=Math.max(...n.filter(i=>i!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let t=[];if(this.itemSizeCache.size===0)return t;let e=this.getMeasurements();for(let s of e)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:e,behavior:s})=>{this._intendedScrollOffset=t+(e??0),this.options.scrollToFn(t,{behavior:s,adjustments:e},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(h)}applyScrollAdjustment(h,t){h!==0&&(k()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=h:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=h,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=e?e[0]:this.scrollState.lastTargetOffset,n=1,o=s!==this.scrollState.lastTargetOffset;if(!o&&P(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=n){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){let i=this.getSize()||600,r=Math.abs(s-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&r>i;this.scrollState.lastTargetOffset=s,d||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}},U=u((l,h,t,e)=>{for(;l<=h;){let s=(l+h)/2|0,n=t(s);if(n<e)l=s+1;else if(n>e)h=s-1;else return s}return l>0?l-1:0},"findNearestBinarySearch");function it(l,h,t){let e=0;for(;e<=h;){let s=(e+h)/2|0,n=l[s*2];if(n<t)e=s+1;else if(n>t)h=s-1;else return s}return e>0?e-1:0}u(it,"findNearestBinarySearchFlat");function ot(l,h,t,e,s){let n=l.length-1;if(l.length<=e)return{startIndex:0,endIndex:n};if(e===1&&s!==null){let d=it(s,n,t),a=d,f=t+h;for(;a<n&&s[a*2]+s[a*2+1]<f;)a++;return{startIndex:d,endIndex:a}}let i=U(0,n,u(d=>l[d].start,"getStart"),t),r=i;if(e===1)for(;r<n&&l[r].end<t+h;)r++;else if(e>1){let d=Array(e).fill(0);for(;r<n&&d.some(f=>f<t+h);){let f=l[r];d[f.lane]=f.end,r++}let a=Array(e).fill(t+h);for(;i>=0&&a.some(f=>f>=t);){let f=l[i];a[f.lane]=f.start,i--}i=Math.max(0,i-i%e),r=Math.min(n,r+(e-1-r%e))}return{startIndex:i,endIndex:r}}u(ot,"calculateRangeImpl");var w=N(Y(),1),X=N(G(),1);var j=typeof document<"u"?w.useLayoutEffect:w.useEffect;function lt({useFlushSync:l=!0,directDomUpdates:h=!1,directDomUpdatesMode:t="transform",...e}){let s=w.useReducer(a=>a+1,0)[1],n=w.useRef({enabled:h,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});n.current.enabled=h,n.current.mode=t;let o=u(a=>{let f=n.current;if(!f.enabled||!f.container)return;let c=a.getTotalSize();if(c!==f.lastSize){f.lastSize=c;let g=a.options.horizontal?"width":"height";f.container.style[g]=`${c}px`}},"applyContainerSize"),i=u(a=>{let f=n.current;if(!f.enabled||!f.container)return;o(a);let c=!!a.options.horizontal,g=f.mode==="transform",S=c?"left":"top",v=a.options.scrollMargin,b=a.getVirtualItems();for(let m of b){let p=m.start-v,E=a.elementsCache.get(m.key);E&&f.lastPositions.get(E)!==p&&(f.lastPositions.set(E,p),g?E.style.transform=c?`translate3d(${p}px, 0, 0)`:`translate3d(0, ${p}px, 0)`:E.style[S]=`${p}px`)}},"applyDirectStyles"),r={...e,onChange:u((a,f)=>{var c;let g=n.current,S=!0;if(g.enabled){i(a);let v=a.range,b=g.prevRange;S=!b||b.isScrolling!==a.isScrolling||b.startIndex!==v?.startIndex||b.endIndex!==v?.endIndex,S&&(g.prevRange=v?{startIndex:v.startIndex,endIndex:v.endIndex,isScrolling:a.isScrolling}:null)}S&&(l&&f?(0,X.flushSync)(s):s()),(c=e.onChange)==null||c.call(e,a,f)},"onChange")},[d]=w.useState(()=>{let a=new F(r);return Object.assign(a,{containerRef:u(f=>{let c=n.current;if(c.container=f,c.lastSize=null,f&&c.enabled){let g=a.getTotalSize();c.lastSize=g;let S=a.options.horizontal?"width":"height";f.style[S]=`${g}px`}},"containerRef")})});return d.setOptions(r),j(()=>d._didMount(),[]),j(()=>(o(d),d._willUpdate())),j(()=>{i(d)}),d}u(lt,"useVirtualizerBase");function Et(l){return lt({observeElementRect:H,observeElementOffset:J,scrollToFn:q,...l})}u(Et,"useVirtualizer");export{H as a,Et as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as B}from"./chunk-XF2B7P5A.js";import{b as A}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as P}from"./chunk-LJIFMW67.js";import"./chunk-XXQUMVWH.js";import"./chunk-QWBRD6PX.js";import"./chunk-QLQADHFE.js";import{a as M}from"./chunk-VDW32UET.js";import{c as F}from"./chunk-SHMNA6UL.js";import"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as R,b as q,c as z,d as K,e as _,f as C}from"./chunk-MIQTKZAR.js";import{a as D,e as j}from"./chunk-UZERI5YC.js";import{d as V}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as k,e as O,g as H,h as W}from"./chunk-3XIESWL4.js";var G=O(H(),1);var t=O(W(),1);var $={binding:"outline",secret:"destructive",var:"secondary"},J=k((n,e)=>{if(n===void 0)return[];let m=[];return n.workerUrl!==void 0&&m.push({label:e("URL"),value:n.workerUrl}),n.environment!==void 0&&m.push({label:e("Environment"),value:n.environment}),n.deploymentId!==void 0&&m.push({label:e("Deployment"),value:n.deploymentId}),n.versionTag!==void 0&&m.push({label:e("Version"),value:n.versionTag}),m},"B"),le=k(n=>{let e=(0,G.c)(52),{initialShardKey:m}=n,r=V(),w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w={},e[0]=w):w=e[0];let E=m??"",S;e[1]!==E?(S={shardKey:E},e[1]=E,e[2]=S):S=e[2];let{data:s,error:l,errorSource:b,isLoading:U}=F(M.getSettings,w,S),a,c,p,d,o,i,u;if(e[3]!==l||e[4]!==b||e[5]!==s?.deploy||e[6]!==s?.settings||e[7]!==r){let L=J(s?.deploy,r),T;e[15]!==s?.settings?(T=s?.settings??[],e[15]=s?.settings,e[16]=T):T=e[16],a=T,c="flex flex-col gap-4",p="lunora-settings";let y;e[17]!==r?(y=r("Open in Cloudflare"),e[17]=r,e[18]=y):y=e[18],e[19]!==y?(d=(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:B,rel:"noreferrer",target:"_blank",children:y})}),e[19]=y,e[20]=d):d=e[20];let N;e[21]!==r?(N=r("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[21]=r,e[22]=N):N=e[22],e[23]!==N?(o=(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:N}),e[23]=N,e[24]=o):o=e[24],e[25]!==l||e[26]!==b?(i=l!==null&&(0,t.jsx)(P,{error:b,testId:"set-error"}),e[25]=l,e[26]=b,e[27]=i):i=e[27],u=L.length>0&&(0,t.jsxs)(D,{className:"py-0","data-testid":"set-deploy",children:[(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r("Deployment")})}),(0,t.jsx)(j,{className:"py-3",children:(0,t.jsx)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:L.map(Q)})})]}),e[3]=l,e[4]=b,e[5]=s?.deploy,e[6]=s?.settings,e[7]=r,e[8]=a,e[9]=c,e[10]=p,e[11]=d,e[12]=o,e[13]=i,e[14]=u}else a=e[8],c=e[9],p=e[10],d=e[11],o=e[12],i=e[13],u=e[14];let h;e[28]!==r?(h=r("Environment & bindings"),e[28]=r,e[29]=h):h=e[29];let f;e[30]!==h?(f=(0,t.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h})}),e[30]=h,e[31]=f):f=e[31];let g;e[32]!==l||e[33]!==U||e[34]!==a.length||e[35]!==r?(g=l===null&&!U&&a.length===0&&(0,t.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:r("No environment variables or bindings.")}),e[32]=l,e[33]=U,e[34]=a.length,e[35]=r,e[36]=g):g=e[36];let x;e[37]!==a||e[38]!==r?(x=a.length>0&&(0,t.jsx)(j,{className:"px-0 py-0",children:(0,t.jsxs)(R,{"data-testid":"set-table",children:[(0,t.jsx)(q,{children:(0,t.jsxs)(K,{children:[(0,t.jsx)(_,{children:r("name")}),(0,t.jsx)(_,{children:r("kind")}),(0,t.jsx)(_,{children:r("value")})]})}),(0,t.jsx)(z,{children:a.map(X)})]})}),e[37]=a,e[38]=r,e[39]=x):x=e[39];let v;e[40]!==f||e[41]!==g||e[42]!==x?(v=(0,t.jsxs)(D,{className:"py-0",children:[f,g,x]}),e[40]=f,e[41]=g,e[42]=x,e[43]=v):v=e[43];let I;return e[44]!==v||e[45]!==c||e[46]!==p||e[47]!==d||e[48]!==o||e[49]!==i||e[50]!==u?(I=(0,t.jsxs)("div",{className:c,"data-testid":p,children:[d,o,i,u,v]}),e[44]=v,e[45]=c,e[46]=p,e[47]=d,e[48]=o,e[49]=i,e[50]=u,e[51]=I):I=e[51],I},"le");function Q(n){return(0,t.jsxs)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,t.jsx)("dt",{className:"text-muted-foreground",children:n.label}),(0,t.jsx)("dd",{className:"truncate font-mono text-xs",title:n.value,children:n.value})]},n.label)}k(Q,"G");function X(n){return(0,t.jsxs)(K,{"data-testid":"set-row",children:[(0,t.jsx)(C,{className:"font-mono text-xs font-medium",children:n.name}),(0,t.jsx)(C,{children:(0,t.jsx)(A,{variant:$[n.kind],children:n.bindingType??n.kind})}),(0,t.jsx)(C,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:n.value??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})})]},n.name)}k(X,"H");export{le as SettingsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,e as c,f as s}from"./chunk-3XIESWL4.js";function d(n,o,r,i){return n.addEventListener(o,r,i),()=>{n.removeEventListener(o,r,i)}}e(d,"addEventListener");var t=c(s(),1);var x=t.createContext(void 0);function f(){return t.useContext(x)?.direction??"ltr"}e(f,"useDirection");export{d as a,f as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as k}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as q}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as F}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as B}from"./chunk-LJIFMW67.js";import"./chunk-XXQUMVWH.js";import"./chunk-QWBRD6PX.js";import"./chunk-QLQADHFE.js";import{a as U}from"./chunk-VDW32UET.js";import{c as R}from"./chunk-SHMNA6UL.js";import"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as M}from"./chunk-XQCVZAGU.js";import{a as G,b as H,c as J,d as P,e as x,f as w}from"./chunk-MIQTKZAR.js";import{a as z,e as D}from"./chunk-UZERI5YC.js";import{d as T,q as O}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as L,e as j,f as V,g as X,h as Y}from"./chunk-3XIESWL4.js";var K=j(X(),1),W=j(V(),1);var t=j(Y(),1);var de=L(()=>{let e=(0,K.c)(39),r=T(),[s,$]=(0,W.useState)(""),y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={},e[0]=y):y=e[0];let{data:b,error:i,errorSource:S,isLoading:_,refetch:E}=R(U.getAuthAuditLog,y),A;if(e[1]!==b?.entries||e[2]!==s){let a=b?.entries??[],v=s.trim().toLowerCase();A=v===""?a:a.filter(N=>N.event.toLowerCase().includes(v)||(N.actorId??"").toLowerCase().includes(v)||(N.actorEmail??"").toLowerCase().includes(v)||(N.ip??"").toLowerCase().includes(v)||N.outcome.toLowerCase().includes(v)),e[1]=b?.entries,e[2]=s,e[3]=A}else A=e[3];let o=A,C;e[4]===Symbol.for("react.memo_cache_sentinel")?(C=L(a=>{$(a.target.value)},"I"),e[4]=C):C=e[4];let Q=C,l;e[5]!==r?(l=r("Filter security events"),e[5]=r,e[6]=l):l=e[6];let n;e[7]!==r?(n=r("filter event, actor, IP"),e[7]=r,e[8]=n):n=e[8];let c;e[9]!==s||e[10]!==l||e[11]!==n?(c=(0,t.jsx)(k,{"aria-label":l,className:"h-8 w-56","data-testid":"aa-search",onChange:Q,placeholder:n,value:s}),e[9]=s,e[10]=l,e[11]=n,e[12]=c):c=e[12];let d;e[13]!==E?(d=L(()=>{E()},"m"),e[13]=E,e[14]=d):d=e[14];let m;e[15]!==r?(m=r("Refresh"),e[15]=r,e[16]=m):m=e[16];let u;e[17]!==d||e[18]!==m?(u=(0,t.jsx)(q,{"data-testid":"aa-refresh",onClick:d,size:"xs",type:"button",variant:"ghost",children:m}),e[17]=d,e[18]=m,e[19]=u):u=e[19];let h;e[20]!==c||e[21]!==u?(h=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,u]}),e[20]=c,e[21]=u,e[22]=h):h=e[22];let f;e[23]!==i||e[24]!==S?(f=i!==null&&(0,t.jsx)(B,{error:S,testId:"aa-error"}),e[23]=i,e[24]=S,e[25]=f):f=e[25];let p;e[26]!==i||e[27]!==o.length||e[28]!==_||e[29]!==r?(p=i===null&&!_&&o.length===0&&(0,t.jsx)(M,{description:r("Authentication and security events are recorded here."),testId:"aa-empty",title:r("No security events.")}),e[26]=i,e[27]=o.length,e[28]=_,e[29]=r,e[30]=p):p=e[30];let g;e[31]!==o||e[32]!==r?(g=o.length>0&&(0,t.jsx)(z,{className:"overflow-hidden py-0",children:(0,t.jsx)(D,{className:"max-h-[30rem] overflow-auto px-0",children:(0,t.jsxs)(G,{"data-testid":"aa-table",children:[(0,t.jsx)(H,{children:(0,t.jsxs)(P,{children:[(0,t.jsx)(x,{children:r("time")}),(0,t.jsx)(x,{children:r("event")}),(0,t.jsx)(x,{children:r("actor")}),(0,t.jsx)(x,{children:r("ip / user agent")}),(0,t.jsx)(x,{children:r("outcome")})]})}),(0,t.jsx)(J,{children:o.map(a=>(0,t.jsxs)(P,{"data-testid":"aa-row",children:[(0,t.jsx)(w,{className:"text-muted-foreground tabular-nums",children:O(a.ts,"\u2014")}),(0,t.jsx)(w,{children:(0,t.jsx)(F,{variant:"secondary",children:a.event})}),(0,t.jsx)(w,{className:"max-w-[24ch] truncate font-mono text-xs",title:a.actorId??void 0,children:a.actorEmail??a.actorId??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"})}),(0,t.jsxs)(w,{className:"max-w-[28ch] truncate text-xs text-muted-foreground",title:a.userAgent??void 0,children:[a.ip??(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),a.userAgent!==void 0&&(0,t.jsxs)("span",{className:"ml-1 opacity-70",children:["\xB7 ",a.userAgent]})]}),(0,t.jsx)(w,{children:(0,t.jsx)(F,{variant:a.outcome==="failure"?"destructive":"outline",children:r(a.outcome)})})]},a.seq))})]})})}),e[31]=o,e[32]=r,e[33]=g):g=e[33];let I;return e[34]!==f||e[35]!==p||e[36]!==g||e[37]!==h?(I=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-auth-audit",children:[h,f,p,g]}),e[34]=f,e[35]=p,e[36]=g,e[37]=h,e[38]=I):I=e[38],I},"ce");export{de as AuthAuditPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as He}from"./chunk-IAKPXGTQ.js";import{a as Me,b as Ve}from"./chunk-GMR677FL.js";import"./chunk-7H7LZRLP.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as we}from"./chunk-5Y3QLNWX.js";import"./chunk-I6A5C46N.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import"./chunk-4UOFSGUS.js";import{a as Ze}from"./chunk-3CWGJYBB.js";import{a as Xe}from"./chunk-X665E2HU.js";import{b as We}from"./chunk-GRL5MG3Z.js";import{e as Ue}from"./chunk-SMIESS7P.js";import"./chunk-7T7UOTYK.js";import{R as Ae}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as me}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as ze}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as je}from"./chunk-VDW32UET.js";import{f as Be}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as Je}from"./chunk-XQCVZAGU.js";import{a as qe,b as Ke,c as Pe,d as Ge,e as Le}from"./chunk-UZERI5YC.js";import{d as Fe,f as Ee,g as Oe,h as $e,m as ue}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as r,e as De,f as at,g as nt,h as st,j as Re}from"./chunk-3XIESWL4.js";var Ce=De(nt(),1);var x=De(at(),1);var t=De(st(),1);var rt=Ee(je.listTables),ot=Ee(je.listTableIndexes),it=Ee(je.readTablePage),dt=Ee(je.describeTables),ct={},Qe=[],mt=r(s=>{let e=(0,Ce.c)(74),{initialShardKey:u,initialTable:n}=s,l=Be(),[a,m]=(0,x.useState)("graph"),{queryShardKey:c,setShardKey:d,shardKey:b}=Ze(u),[o,p]=(0,x.useState)(""),[i,v]=(0,x.useState)(null),[g,K]=(0,x.useState)(null),_;e[0]===Symbol.for("react.memo_cache_sentinel")?(_={},e[0]=_):_=e[0];let[L,y]=(0,x.useState)(_),P;e[1]===Symbol.for("react.memo_cache_sentinel")?(P={},e[1]=P):P=e[1];let[E,M]=(0,x.useState)(P),[T,C]=(0,x.useState)(null),F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={},e[2]=F):F=e[2];let[O,he]=(0,x.useState)(F),H;e[3]===Symbol.for("react.memo_cache_sentinel")?(H={},e[3]=H):H=e[3];let[I,G]=(0,x.useState)(H),[k,pe]=(0,x.useState)(null),[D,oe]=(0,x.useState)(null),Q;e[4]===Symbol.for("react.memo_cache_sentinel")?(Q={},e[4]=Q):Q=e[4];let[J,xe]=(0,x.useState)(Q),[W,ie]=(0,x.useState)(null),ve;e[5]!==l?(ve=r(async h=>{K(null);try{let w=await l.query(rt,{},Oe(h));We(h),v(w),y({}),M({}),C(null),he(N=>Object.fromEntries(Object.entries(N).filter(q=>{let[A]=q;return A!==h}))),G(N=>Object.fromEntries(Object.entries(N).filter(q=>{let[A]=q;return A!==h})))}catch(w){let N=w;v(null),K($e(N))}},"ve"),e[5]=l,e[6]=ve):ve=e[6];let $=ve,Y;e[7]!==l?(Y=r(async()=>{oe(null);try{pe(await l.listGlobalTables())}catch(h){let w=h;pe(null),oe($e(w))}},"Q"),e[7]=l,e[8]=Y):Y=e[8];let ee=Y,de,R;e[9]!==c||e[10]!==$||e[11]!==ee?(de=r(()=>{ue($(c)),ue(ee())},"de"),R=[$,ee,c],e[9]=c,e[10]=$,e[11]=ee,e[12]=de,e[13]=R):(de=e[12],R=e[13]),(0,x.useEffect)(de,R);let te;e[14]!==l||e[15]!==L||e[16]!==T||e[17]!==c?(te=r(async h=>{if(T===h){C(null);return}C(h);let w=`${c}:${h}`;if(L[w]!==void 0)return;let[N,q]=await Promise.allSettled([l.query(it,{limit:1,offset:0,table:h},Oe(c)),l.query(ot,{table:h},Oe(c))]);N.status==="fulfilled"?y(A=>({...A,[w]:N.value.columns})):K($e(N.reason)),q.status==="fulfilled"&&M(A=>({...A,[w]:q.value.indexes}))},"te"),e[14]=l,e[15]=L,e[16]=T,e[17]=c,e[18]=te):te=e[18];let j=te,ye;e[19]!==l||e[20]!==J||e[21]!==W?(ye=r(async h=>{if(W===h){ie(null);return}if(ie(h),J[h]===void 0)try{let w=await l.readGlobalTablePage({limit:1,offset:0,table:h});xe(N=>({...N,[h]:w.columns}))}catch(w){oe($e(w))}},"ye"),e[19]=l,e[20]=J,e[21]=W,e[22]=ye):ye=e[22];let ce=ye,ge=(0,x.useRef)(void 0),V,X;e[23]!==n||e[24]!==i||e[25]!==j?(V=r(()=>{n===void 0||i===null||ge.current===n||i.some(h=>h.name===n)&&(ge.current=n,ue(j(n)))},"V"),X=[n,i,j],e[23]=n,e[24]=i,e[25]=j,e[26]=V,e[27]=X):(V=e[26],X=e[27]),(0,x.useEffect)(V,X);let B;e[28]!==l?(B=r(async(h,w,N)=>{let[q,A]=await Promise.all([Promise.allSettled([l.query(dt,{tables:[...w,...N]},Oe(h))]),Promise.all(N.map(async S=>{let be=await Promise.allSettled([l.readGlobalTablePage({limit:1,offset:0,table:S})]),Ie=be[0].status==="fulfilled"?be[0].value:void 0;return{columns:Ie?.columns??[],refs:Ie?.refs??{},table:S}}))]),Se=q[0].status==="fulfilled"?q[0].value?.columnsByTable??{}:{},Te=q[0].status==="rejected",_e=new Map(A.map(ut)),ke=[...w,...N].map(S=>{let be=Se[S]??[];return[S,be.length>0?be:_e.get(S)??[]]});he(S=>({...S,[h]:Object.fromEntries(ke)})),G(S=>({...S,[h]:Te}))},"B"),e[28]=l,e[29]=B):B=e[29];let le=B,U,ae;e[30]!==D||e[31]!==k||e[32]!==le||e[33]!==c||e[34]!==O||e[35]!==i||e[36]!==a?(U=r(()=>{a!=="graph"||i===null||k===null&&D===null||O[c]!==void 0||ue(le(c,i.map(ht),(k??[]).map(pt)))},"U"),ae=[a,i,k,D,c,O,le],e[30]=D,e[31]=k,e[32]=le,e[33]=c,e[34]=O,e[35]=i,e[36]=a,e[37]=U,e[38]=ae):(U=e[37],ae=e[38]),(0,x.useEffect)(U,ae);let z=O[c]??ct,ne;if(e[39]!==z||e[40]!==k||e[41]!==i){let h;e[43]!==z?(h=r(A=>({columns:z[A.name]??Qe,name:A.name,tier:"shard"}),"u"),e[43]=z,e[44]=h):h=e[44];let w=(i??[]).map(h),N;e[45]!==z?(N=r(A=>({columns:z[A.name]??Qe,name:A.name,tier:"global"}),"y"),e[45]=z,e[46]=N):N=e[46];let q=(k??[]).map(N);ne=[...w,...q],e[39]=z,e[40]=k,e[41]=i,e[42]=ne}else ne=e[42];let se=ne,f;if(e[47]!==o||e[48]!==i){let h=o.trim().toLowerCase();f=(i??[]).filter(w=>w.name.toLowerCase().includes(h)),e[47]=o,e[48]=i,e[49]=f}else f=e[49];let re=f,Z;if(e[50]!==k||e[51]!==o){let h=o.trim().toLowerCase();Z=(k??[]).filter(w=>w.name.toLowerCase().includes(h)),e[50]=k,e[51]=o,e[52]=Z}else Z=e[52];let Ne=Z,fe;return e[53]!==L||e[54]!==se||e[55]!==g||e[56]!==T||e[57]!==Ne||e[58]!==re||e[59]!==J||e[60]!==D||e[61]!==W||e[62]!==k||e[63]!==E||e[64]!==$||e[65]!==d||e[66]!==I||e[67]!==b||e[68]!==o||e[69]!==i||e[70]!==j||e[71]!==ce||e[72]!==a?(fe={columns:L,diagramTables:se,error:g,expanded:T,filteredGlobalTables:Ne,filteredTables:re,globalColumns:J,globalError:D,globalExpanded:W,globalTables:k,indexes:E,refresh:$,setShardKey:d,setTableFilter:p,setView:m,shardColumnsError:I,shardKey:b,tableFilter:o,tables:i,toggle:j,toggleGlobal:ce,view:a},e[53]=L,e[54]=se,e[55]=g,e[56]=T,e[57]=Ne,e[58]=re,e[59]=J,e[60]=D,e[61]=W,e[62]=k,e[63]=E,e[64]=$,e[65]=d,e[66]=I,e[67]=b,e[68]=o,e[69]=i,e[70]=j,e[71]=ce,e[72]=a,e[73]=fe):fe=e[73],fe},"ct");function ut(s){let{columns:e,refs:u,table:n}=s;return[n,e.map(l=>{let a=u[l];return a===void 0?{name:l,optional:!1,type:""}:{name:l,optional:!1,ref:a,type:"id"}})]}r(ut,"mt");function ht(s){return s.name}r(ht,"ut");function pt(s){return s.name}r(pt,"ht");var gt="/__lunora/schema-edit",ft=r(async s=>{let e=await fetch(gt,{body:JSON.stringify(s),headers:{"Content-Type":"application/json","X-Lunora-Studio":"1"},method:"POST"}),u=await e.json();return u.needsMigration===!0?{kind:"needs-migration",message:u.message??"This edit needs a migration."}:e.ok&&u.tables!==void 0?{diagnostics:u.diagnostics??[],kind:"ok",tables:u.tables}:{kind:"error",message:u.error??`schema edit failed (${String(e.status)})`}},"gt"),bt=r(s=>{let e=(0,Ce.c)(32),{hasTables:u,mode:n,onAddColumn:l,onAddIndex:a,onAddTable:m,onDestructive:c}=s,d=Fe(),b=n==="addTable"?"default":"outline",o;e[0]!==d?(o=d("Add table"),e[0]=d,e[1]=o):o=e[1];let p;e[2]!==m||e[3]!==b||e[4]!==o?(p=(0,t.jsx)(me,{"data-testid":"sc-editor-add-table",onClick:m,size:"xs",type:"button",variant:b,children:o}),e[2]=m,e[3]=b,e[4]=o,e[5]=p):p=e[5];let i=!u,v=n==="addColumn"?"default":"outline",g;e[6]!==d?(g=d("Add column"),e[6]=d,e[7]=g):g=e[7];let K;e[8]!==l||e[9]!==i||e[10]!==v||e[11]!==g?(K=(0,t.jsx)(me,{"data-testid":"sc-editor-add-column",disabled:i,onClick:l,size:"xs",type:"button",variant:v,children:g}),e[8]=l,e[9]=i,e[10]=v,e[11]=g,e[12]=K):K=e[12];let _=!u,L=n==="addIndex"?"default":"outline",y;e[13]!==d?(y=d("Add index"),e[13]=d,e[14]=y):y=e[14];let P;e[15]!==a||e[16]!==y||e[17]!==_||e[18]!==L?(P=(0,t.jsx)(me,{"data-testid":"sc-editor-add-index",disabled:_,onClick:a,size:"xs",type:"button",variant:L,children:y}),e[15]=a,e[16]=y,e[17]=_,e[18]=L,e[19]=P):P=e[19];let E=!u,M=n==="destructive"?"default":"ghost",T;e[20]!==d?(T=d("Rename / drop / change type\u2026"),e[20]=d,e[21]=T):T=e[21];let C;e[22]!==c||e[23]!==E||e[24]!==M||e[25]!==T?(C=(0,t.jsx)(me,{"data-testid":"sc-editor-destructive",disabled:E,onClick:c,size:"xs",type:"button",variant:M,children:T}),e[22]=c,e[23]=E,e[24]=M,e[25]=T,e[26]=C):C=e[26];let F;return e[27]!==P||e[28]!==C||e[29]!==p||e[30]!==K?(F=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[p,K,P,C]}),e[27]=P,e[28]=C,e[29]=p,e[30]=K,e[31]=F):F=e[31],F},"bt"),xt=r(s=>{let e=(0,Ce.c)(28),{onOpenMigrations:u,result:n}=s,l=Fe();if(n===null){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[0]=o):o=e[0],o}if(n.kind==="error"){let o;return e[1]!==n.message?(o=(0,t.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"sc-editor-error",role:"alert",children:n.message}),e[1]=n.message,e[2]=o):o=e[2],o}if(n.kind==="needs-migration"){let o;e[3]!==n.message||e[4]!==l?(o=n.message===""?l("This edit changes stored data and must go through a migration. Review the migration before applying."):n.message,e[3]=n.message,e[4]=l,e[5]=o):o=e[5];let p;e[6]!==o?(p=(0,t.jsx)("p",{className:"text-sm text-warning",role:"alert",children:o}),e[6]=o,e[7]=p):p=e[7];let i;e[8]!==l?(i=l("Open Migrations"),e[8]=l,e[9]=i):i=e[9];let v;e[10]!==u||e[11]!==i?(v=(0,t.jsx)(me,{className:"self-start","data-testid":"sc-editor-open-migrations",onClick:u,size:"xs",type:"button",variant:"outline",children:i}),e[10]=u,e[11]=i,e[12]=v):v=e[12];let g;return e[13]!==p||e[14]!==v?(g=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2","data-testid":"sc-editor-needs-migration",children:[p,v]}),e[13]=p,e[14]=v,e[15]=g):g=e[15],g}if(n.diagnostics.length===0){let o;return e[16]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(t.Fragment,{}),e[16]=o):o=e[16],o}let a;e[17]!==l?(a=l("Codegen reported diagnostics:"),e[17]=l,e[18]=a):a=e[18];let m;e[19]!==a?(m=(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:a}),e[19]=a,e[20]=m):m=e[20];let c;e[21]!==n.diagnostics?(c=n.diagnostics.map(vt),e[21]=n.diagnostics,e[22]=c):c=e[22];let d;e[23]!==c?(d=(0,t.jsx)("ul",{className:"flex flex-col gap-0.5",children:c}),e[23]=c,e[24]=d):d=e[24];let b;return e[25]!==m||e[26]!==d?(b=(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"sc-editor-diagnostics",children:[m,d]}),e[25]=m,e[26]=d,e[27]=b):b=e[27],b},"ft");function vt(s){return(0,t.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:s},s)}r(vt,"xt");var yt=[{label:"string",validator:"v.string()"},{label:"number",validator:"v.number()"},{label:"boolean",validator:"v.boolean()"},{label:"bigint",validator:"v.int64()"},{label:"bytes",validator:"v.bytes()"},{label:"any",validator:"v.any()"}],Nt="v.string()",Ct=r(s=>s.split(",").map(e=>e.trim()).filter(e=>e!==""),"Nt"),wt=r(s=>{let e=(0,Ce.c)(83),{onApplied:u,tableNames:n}=s,l=Fe(),a=Ue(),[m,c]=(0,x.useState)(null),[d,b]=(0,x.useState)(!1),[o,p]=(0,x.useState)(null),[i,v]=(0,x.useState)(""),[g,K]=(0,x.useState)(""),[_,L]=(0,x.useState)(Nt),[y,P]=(0,x.useState)(n[0]??""),[E,M]=(0,x.useState)(""),[T,C]=(0,x.useState)(""),[F,O]=(0,x.useState)(!1),he;e[0]===Symbol.for("react.memo_cache_sentinel")?(he=r(()=>{c(null),v(""),K(""),M(""),C(""),O(!1)},"me"),e[0]=he):he=e[0];let H=he,I;e[1]!==u?(I=r(async S=>{b(!0),p(null);try{let be=await ft(S);p(be),be.kind==="ok"&&(u(be.tables),H())}catch(be){let Ie=be;p({kind:"error",message:Ie instanceof Error?Ie.message:String(Ie)})}b(!1)},"k"),e[1]=u,e[2]=I):I=e[2];let G=I,k;e[3]!==G||e[4]!==i?(k=r(()=>{ue(G({kind:"addTable",table:i.trim()}))},"_"),e[3]=G,e[4]=i,e[5]=k):k=e[5];let pe=k,D;e[6]!==g||e[7]!==G||e[8]!==y||e[9]!==_?(D=r(()=>{ue(G({column:g.trim(),kind:"addOptionalColumn",table:y,validator:_}))},"D"),e[6]=g,e[7]=G,e[8]=y,e[9]=_,e[10]=D):D=e[10];let oe=D,Q;e[11]!==T||e[12]!==E||e[13]!==G||e[14]!==y||e[15]!==F?(Q=r(()=>{ue(G({fields:Ct(T),kind:"addIndex",name:E.trim(),table:y,unique:F}))},"H"),e[11]=T,e[12]=E,e[13]=G,e[14]=y,e[15]=F,e[16]=Q):Q=e[16];let J=Q,xe;e[17]===Symbol.for("react.memo_cache_sentinel")?(xe=r(()=>{p(null),c("addTable")},"xe"),e[17]=xe):xe=e[17];let W=xe,ie;e[18]===Symbol.for("react.memo_cache_sentinel")?(ie=r(()=>{p(null),c("addColumn")},"ie"),e[18]=ie):ie=e[18];let ve=ie,$;e[19]===Symbol.for("react.memo_cache_sentinel")?($=r(()=>{p(null),c("addIndex")},"q"),e[19]=$):$=e[19];let Y=$,ee;e[20]!==l?(ee=r(()=>{c("destructive"),p({kind:"needs-migration",message:l("This edit changes stored data and must go through a migration. Review the migration before applying.")})},"ee"),e[20]=l,e[21]=ee):ee=e[21];let de=ee,R;e[22]===Symbol.for("react.memo_cache_sentinel")?(R=r(S=>{v(S.target.value)},"R"),e[22]=R):R=e[22];let te=R,j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=r(S=>{K(S.target.value)},"z"),e[23]=j):j=e[23];let ye=j,ce;e[24]===Symbol.for("react.memo_cache_sentinel")?(ce=r(S=>{L(S.target.value)},"ce"),e[24]=ce):ce=e[24];let ge=ce,V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=r(S=>{P(S.target.value)},"V"),e[25]=V):V=e[25];let X=V,B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=r(S=>{M(S.target.value)},"B"),e[26]=B):B=e[26];let le=B,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=r(S=>{C(S.target.value)},"U"),e[27]=U):U=e[27];let ae=U,z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=r(S=>{O(S.target.checked)},"E"),e[28]=z):z=e[28];let ne=z,se;e[29]!==a?(se=r(()=>{ue(a({to:"/migrations"}))},"se"),e[29]=a,e[30]=se):se=e[30];let f=se,re;e[31]!==l?(re=l("Edit schema"),e[31]=l,e[32]=re):re=e[32];let Z;e[33]!==re?(Z=(0,t.jsx)(Pe,{children:re}),e[33]=re,e[34]=Z):Z=e[34];let Ne;e[35]!==l?(Ne=l("Adds a table, column, or index to lunora/schema.ts and reruns codegen."),e[35]=l,e[36]=Ne):Ne=e[36];let fe;e[37]!==Ne?(fe=(0,t.jsx)(Ge,{children:Ne}),e[37]=Ne,e[38]=fe):fe=e[38];let h;e[39]!==Z||e[40]!==fe?(h=(0,t.jsxs)(Ke,{children:[Z,fe]}),e[39]=Z,e[40]=fe,e[41]=h):h=e[41];let w=n.length>0,N;e[42]!==m||e[43]!==de||e[44]!==w?(N=(0,t.jsx)(bt,{hasTables:w,mode:m,onAddColumn:ve,onAddIndex:Y,onAddTable:W,onDestructive:de}),e[42]=m,e[43]=de,e[44]=w,e[45]=N):N=e[45];let q;e[46]!==d||e[47]!==m||e[48]!==pe||e[49]!==l||e[50]!==i?(q=m==="addTable"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-table-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-table-name",children:l("Table name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-table-name",id:"sc-editor-table-name",onChange:te,value:i})]}),(0,t.jsx)(me,{"data-testid":"sc-editor-table-apply",disabled:d||i.trim()==="",onClick:pe,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:H,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[46]=d,e[47]=m,e[48]=pe,e[49]=l,e[50]=i,e[51]=q):q=e[51];let A;e[52]!==d||e[53]!==g||e[54]!==m||e[55]!==oe||e[56]!==l||e[57]!==n||e[58]!==y||e[59]!==_?(A=m==="addColumn"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-column-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-table",id:"sc-editor-column-table",onChange:X,value:y,children:n.map(St)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-name",children:l("Column name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-column-name",id:"sc-editor-column-name",onChange:ye,value:g})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-column-type",children:l("Column type")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-column-type",id:"sc-editor-column-type",onChange:ge,value:_,children:yt.map(Tt)})]}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:l("Optional")}),(0,t.jsx)(me,{"data-testid":"sc-editor-column-apply",disabled:d||g.trim()===""||y==="",onClick:oe,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:H,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[52]=d,e[53]=g,e[54]=m,e[55]=oe,e[56]=l,e[57]=n,e[58]=y,e[59]=_,e[60]=A):A=e[60];let Se;e[61]!==d||e[62]!==T||e[63]!==E||e[64]!==m||e[65]!==J||e[66]!==l||e[67]!==n||e[68]!==y||e[69]!==F?(Se=m==="addIndex"&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"sc-editor-index-form",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-table",children:l("Table name")}),(0,t.jsx)("select",{className:"h-8 rounded-md border border-input bg-transparent px-2 text-xs","data-testid":"sc-editor-index-table",id:"sc-editor-index-table",onChange:X,value:y,children:n.map(_t)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-name",children:l("Index name")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-name",id:"sc-editor-index-name",onChange:le,value:E})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,t.jsx)(we,{htmlFor:"sc-editor-index-fields",children:l("Index fields (comma-separated)")}),(0,t.jsx)(Ae,{"data-testid":"sc-editor-index-fields",id:"sc-editor-index-fields",onChange:ae,value:T})]}),(0,t.jsxs)(we,{className:"flex items-center gap-1 text-xs",htmlFor:"sc-editor-index-unique",children:[(0,t.jsx)("input",{checked:F,"data-testid":"sc-editor-index-unique",id:"sc-editor-index-unique",onChange:ne,type:"checkbox"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:l("Unique")})]}),(0,t.jsx)(me,{"data-testid":"sc-editor-index-apply",disabled:d||E.trim()===""||T.trim()==="",onClick:J,size:"xs",type:"button",children:l(d?"Applying\u2026":"Apply")}),(0,t.jsx)(me,{onClick:H,size:"xs",type:"button",variant:"ghost",children:l("Cancel")})]}),e[61]=d,e[62]=T,e[63]=E,e[64]=m,e[65]=J,e[66]=l,e[67]=n,e[68]=y,e[69]=F,e[70]=Se):Se=e[70];let Te;e[71]!==f||e[72]!==o?(Te=(0,t.jsx)(xt,{onOpenMigrations:f,result:o}),e[71]=f,e[72]=o,e[73]=Te):Te=e[73];let _e;e[74]!==N||e[75]!==q||e[76]!==A||e[77]!==Se||e[78]!==Te?(_e=(0,t.jsxs)(Le,{children:[N,q,A,Se,Te]}),e[74]=N,e[75]=q,e[76]=A,e[77]=Se,e[78]=Te,e[79]=_e):_e=e[79];let ke;return e[80]!==h||e[81]!==_e?(ke=(0,t.jsxs)(qe,{"data-testid":"sc-editor",size:"sm",children:[h,_e]}),e[80]=h,e[81]=_e,e[82]=ke):ke=e[82],ke},"Ct");function St(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(St,"Tt");function Tt(s){return(0,t.jsx)("option",{value:s.validator,children:s.label},s.validator)}r(Tt,"wt");function _t(s){return(0,t.jsx)("option",{value:s,children:s},s)}r(_t,"St");var Ye=[],kt=r(s=>{let e=(0,Ce.c)(5),{open:u}=s,n=u&&"rotate-90",l;e[0]!==n?(l=Re("size-3.5 shrink-0 text-muted-foreground transition-transform duration-150",n),e[0]=n,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[2]=a):a=e[2];let m;return e[3]!==l?(m=(0,t.jsx)("svg",{"aria-hidden":"true",className:l,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:a}),e[3]=l,e[4]=m):m=e[4],m},"_t"),et=r(s=>{let e=(0,Ce.c)(20),{children:u,expanded:n,name:l,onToggle:a,rowCount:m,rowTestId:c,toggleTestId:d}=s,b;e[0]!==n?(b=(0,t.jsx)(kt,{open:n}),e[0]=n,e[1]=b):b=e[1];let o;e[2]!==l?(o=(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l,children:l}),e[2]=l,e[3]=o):o=e[3];let p;e[4]!==m?(p=(0,t.jsxs)("span",{className:"ms-auto shrink-0 text-xs text-muted-foreground tabular-nums",children:["(",m,")"]}),e[4]=m,e[5]=p):p=e[5];let i;e[6]!==n||e[7]!==a||e[8]!==b||e[9]!==o||e[10]!==p||e[11]!==d?(i=(0,t.jsxs)("button",{"aria-expanded":n,className:"flex w-full items-center gap-2 px-3 py-2 text-start transition-colors hover:bg-muted/50 aria-expanded:bg-muted/40","data-testid":d,onClick:a,type:"button",children:[b,o," ",p]}),e[6]=n,e[7]=a,e[8]=b,e[9]=o,e[10]=p,e[11]=d,e[12]=i):i=e[12];let v;e[13]!==u||e[14]!==n?(v=n&&(0,t.jsx)("div",{className:"px-3 pb-3 ps-8",children:u}),e[13]=u,e[14]=n,e[15]=v):v=e[15];let g;return e[16]!==c||e[17]!==i||e[18]!==v?(g=(0,t.jsxs)("li",{className:"border-t border-border/60 first:border-t-0","data-testid":c,children:[i,v]}),e[16]=c,e[17]=i,e[18]=v,e[19]=g):g=e[19],g},"Xe"),tt=r(s=>{let e=(0,Ce.c)(5),{columns:u,testId:n}=s,l;e[0]!==u?(l=u.map(At),e[0]=u,e[1]=l):l=e[1];let a;return e[2]!==l||e[3]!==n?(a=(0,t.jsx)("ul",{className:"flex flex-wrap gap-1.5 pt-1","data-testid":n,children:l}),e[2]=l,e[3]=n,e[4]=a):a=e[4],a},"Ye"),It=r(s=>{let e=(0,Ce.c)(10),{heading:u,indexes:n,testId:l}=s,a;e[0]!==u?(a=(0,t.jsx)("p",{className:"mb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:u}),e[0]=u,e[1]=a):a=e[1];let m;e[2]!==n?(m=n.map(Ft),e[2]=n,e[3]=m):m=e[3];let c;e[4]!==m||e[5]!==l?(c=(0,t.jsx)("ul",{className:"flex flex-col gap-1","data-testid":l,children:m}),e[4]=m,e[5]=l,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==c?(d=(0,t.jsxs)("div",{className:"pt-3",children:[a,c]}),e[7]=a,e[8]=c,e[9]=d):d=e[9],d},"$t"),lt=r(s=>Re("border-b-2 px-3 py-2 font-mono text-[11px] tracking-widest uppercase outline-none transition-colors",s?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"Je"),Xt=r(s=>{let e=(0,Ce.c)(85),{initialShardKey:u,initialTable:n,schemaEditable:l}=s,a=Fe(),m;e[0]!==u||e[1]!==n?(m={initialShardKey:u,initialTable:n},e[0]=u,e[1]=n,e[2]=m):m=e[2];let{columns:c,diagramTables:d,error:b,expanded:o,filteredGlobalTables:p,filteredTables:i,globalColumns:v,globalError:g,globalExpanded:K,globalTables:_,indexes:L,refresh:y,setShardKey:P,setTableFilter:E,setView:M,shardColumnsError:T,shardKey:C,tableFilter:F,tables:O,toggle:he,toggleGlobal:H,view:I}=mt(m),G;e[3]!==M?(G=r(()=>{M("list")},"G"),e[3]=M,e[4]=G):G=e[4];let k=G,pe;e[5]!==M?(pe=r(()=>{M("graph")},"ue"),e[5]=M,e[6]=pe):pe=e[6];let D=pe,oe;e[7]!==E?(oe=r(f=>{E(f.target.value)},"oe"),e[7]=E,e[8]=oe):oe=e[8];let Q=oe,J;e[9]!==y||e[10]!==C?(J=r(f=>{ue(y(C))},"X"),e[9]=y,e[10]=C,e[11]=J):J=e[11];let xe=J,W;e[12]!==O?(W=O??[],e[12]=O,e[13]=W):W=e[13];let ie;e[14]!==W?(ie=W.map(zt),e[14]=W,e[15]=ie):ie=e[15];let ve=ie,$;e[16]!==P||e[17]!==C?($=(0,t.jsx)(Xe,{onChange:P,testId:"sc-shard-input",value:C}),e[16]=P,e[17]=C,e[18]=$):$=e[18];let Y;e[19]!==a?(Y=a("Schema view"),e[19]=a,e[20]=Y):Y=e[20];let ee=I==="graph",de=I==="graph",R;e[21]!==de?(R=lt(de),e[21]=de,e[22]=R):R=e[22];let te;e[23]!==a?(te=a("Graph"),e[23]=a,e[24]=te):te=e[24];let j;e[25]!==D||e[26]!==ee||e[27]!==R||e[28]!==te?(j=(0,t.jsx)("button",{"aria-selected":ee,className:R,"data-testid":"sc-view-graph",onClick:D,role:"tab",type:"button",children:te}),e[25]=D,e[26]=ee,e[27]=R,e[28]=te,e[29]=j):j=e[29];let ye=I==="list",ce=I==="list",ge;e[30]!==ce?(ge=lt(ce),e[30]=ce,e[31]=ge):ge=e[31];let V;e[32]!==a?(V=a("Table list"),e[32]=a,e[33]=V):V=e[33];let X;e[34]!==k||e[35]!==ye||e[36]!==ge||e[37]!==V?(X=(0,t.jsx)("button",{"aria-selected":ye,className:ge,"data-testid":"sc-view-list",onClick:k,role:"tab",type:"button",children:V}),e[34]=k,e[35]=ye,e[36]=ge,e[37]=V,e[38]=X):X=e[38];let B;e[39]!==j||e[40]!==X||e[41]!==Y?(B=(0,t.jsxs)("div",{"aria-label":Y,className:"flex items-center gap-1","data-testid":"sc-view-toggle",role:"tablist",children:[j,X]}),e[39]=j,e[40]=X,e[41]=Y,e[42]=B):B=e[42];let le;e[43]!==B||e[44]!==$?(le=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[$,B]}),e[43]=B,e[44]=$,e[45]=le):le=e[45];let U;e[46]!==xe||e[47]!==l||e[48]!==ve?(U=l===!0&&(0,t.jsx)(wt,{onApplied:xe,tableNames:ve}),e[46]=xe,e[47]=l,e[48]=ve,e[49]=U):U=e[49];let ae;e[50]!==Q||e[51]!==a||e[52]!==F||e[53]!==I?(ae=I==="list"&&(0,t.jsx)(Ae,{"aria-label":a("Filter tables"),className:"h-8 max-w-xs","data-testid":"sc-filter",onChange:Q,placeholder:a("Filter tables"),value:F}),e[50]=Q,e[51]=a,e[52]=F,e[53]=I,e[54]=ae):ae=e[54];let z;e[55]!==d||e[56]!==b||e[57]!==g||e[58]!==T||e[59]!==C||e[60]!==I?(z=I==="graph"&&(0,t.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"sc-graph-view",children:[b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:b}),g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:g}),(0,t.jsx)(He,{columnsError:T[C]===!0,tables:d,testIdPrefix:"sc-graph"})]}),e[55]=d,e[56]=b,e[57]=g,e[58]=T,e[59]=C,e[60]=I,e[61]=z):z=e[61];let ne;e[62]!==c||e[63]!==b||e[64]!==o||e[65]!==p||e[66]!==i||e[67]!==v||e[68]!==g||e[69]!==K||e[70]!==_||e[71]!==L||e[72]!==C||e[73]!==a||e[74]!==O||e[75]!==he||e[76]!==H||e[77]!==I?(ne=I==="list"&&(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)(qe,{"data-testid":"sc-shard-section",size:"sm",children:[(0,t.jsxs)(Ke,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Ve,{tier:"shard"}),(0,t.jsx)(Pe,{children:a("Shard tables")}),O!==null&&(0,t.jsx)(ze,{className:"ms-auto tabular-nums",variant:"outline",children:i.length})]}),(0,t.jsx)(Ge,{children:Me.shard.hint})]}),(0,t.jsxs)(Le,{children:[b!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-error",role:"alert",children:b}),O!==null&&O.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-empty",children:a("No tables in this shard.")}),O!==null&&O.length>0&&i.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-no-match",children:a("No tables match your filter.")}),i.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-table-list",children:i.map(f=>{let re=`${C}:${f.name}`,Z=L[re]??[];return(0,t.jsxs)(et,{expanded:o===f.name,name:f.name,onToggle:r(()=>{ue(he(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-table-${f.name}`,toggleTestId:`sc-toggle-${f.name}`,children:[(0,t.jsx)(tt,{columns:c[re]??Ye,testId:`sc-columns-${f.name}`}),Z.length>0&&(0,t.jsx)(It,{heading:a("Indexes"),indexes:Z,testId:`sc-indexes-${f.name}`})]},f.name)})})]})]}),(0,t.jsxs)(qe,{"data-testid":"sc-global-section",size:"sm",children:[(0,t.jsxs)(Ke,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Ve,{tier:"global"}),(0,t.jsx)(Pe,{children:a("Global tables (D1)")}),_!==null&&(0,t.jsx)(ze,{className:"ms-auto tabular-nums",variant:"outline",children:p.length})]}),(0,t.jsx)(Ge,{children:Me.global.hint})]}),(0,t.jsxs)(Le,{children:[g!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"sc-global-error",role:"alert",children:g}),_!==null&&_.length===0&&(0,t.jsx)(Je,{description:Me.global.hint,testId:"sc-global-empty",title:a("No global tables.")}),_!==null&&_.length>0&&p.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"sc-global-no-match",children:a("No tables match your filter.")}),p.length>0&&(0,t.jsx)("ul",{className:"-mx-3 overflow-hidden border-t border-border","data-testid":"sc-global-table-list",children:p.map(f=>(0,t.jsx)(et,{expanded:K===f.name,name:f.name,onToggle:r(()=>{ue(H(f.name))},"onToggle"),rowCount:f.rowCount,rowTestId:`sc-global-table-${f.name}`,toggleTestId:`sc-global-toggle-${f.name}`,children:(0,t.jsx)(tt,{columns:v[f.name]??Ye,testId:`sc-global-columns-${f.name}`})},f.name))})]})]})]}),e[62]=c,e[63]=b,e[64]=o,e[65]=p,e[66]=i,e[67]=v,e[68]=g,e[69]=K,e[70]=_,e[71]=L,e[72]=C,e[73]=a,e[74]=O,e[75]=he,e[76]=H,e[77]=I,e[78]=ne):ne=e[78];let se;return e[79]!==le||e[80]!==U||e[81]!==ae||e[82]!==z||e[83]!==ne?(se=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-schema",children:[le,U,ae,z,ne]}),e[79]=le,e[80]=U,e[81]=ae,e[82]=z,e[83]=ne,e[84]=se):se=e[84],se},"Zt");function At(s){return(0,t.jsx)("li",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:s},s)}r(At,"kt");function Ft(s){return(0,t.jsxs)("li",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,t.jsx)("span",{className:"font-mono",children:s.name}),(0,t.jsx)(ze,{variant:"outline",children:s.type}),s.unique===!0&&(0,t.jsx)(ze,{variant:"secondary",children:"unique"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:s.fields.join(", ")})]},`${s.type}:${s.name}`)}r(Ft,"It");function zt(s){return s.name}r(zt,"At");export{Xt as SchemaViewer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as h}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{b as S}from"./chunk-SHMNA6UL.js";import{f as k}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as y,e as A}from"./chunk-UZERI5YC.js";import{d as I}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as u,e as w,g as $,h as j}from"./chunk-3XIESWL4.js";var N=w($(),1);var a=w(j(),1);var z=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],v=u(e=>{if(e===void 0)return"\u2014";let i=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,d]of i)if(e>=t&&e%t===0)return`${String(e/t)}${d}`;return`${String(e)}s`},"v"),g=u(e=>{let i=(0,N.c)(8),{children:t,heading:d,testId:r}=e,l;i[0]!==d?(l=(0,a.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:d})}),i[0]=d,i[1]=l):l=i[1];let n;i[2]!==t?(n=(0,a.jsx)(A,{className:"p-3",children:t}),i[2]=t,i[3]=n):n=i[3];let c;return i[4]!==l||i[5]!==n||i[6]!==r?(c=(0,a.jsxs)(y,{className:"gap-0 py-0","data-testid":r,children:[l,n]}),i[4]=l,i[5]=n,i[6]=r,i[7]=c):c=i[7],c},"h"),o=u(e=>{let i=(0,N.c)(7),{label:t,value:d}=e,r;i[0]!==t?(r=(0,a.jsx)("span",{className:"text-sm",children:t}),i[0]=t,i[1]=r):r=i[1];let l;i[2]!==d?(l=(0,a.jsx)("span",{className:"text-sm text-muted-foreground tabular-nums",children:d}),i[2]=d,i[3]=l):l=i[3];let n;return i[4]!==r||i[5]!==l?(n=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[r,l]}),i[4]=r,i[5]=l,i[6]=n):n=i[6],n},"c"),T=u(()=>{let e=(0,N.c)(20),i=k(),t=I(),d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=["lunora-auth-config"],e[0]=d):d=e[0];let r;e[1]!==i?(r=u(()=>i.getAuthConfig(),"s"),e[1]=i,e[2]=r):r=e[2];let{data:l,error:n}=S(d,r),c;e[3]!==t?(c=u(s=>(0,a.jsx)(h,{variant:s?"success":"outline",children:t(s?"Enabled":"Disabled")}),"u"),e[3]=t,e[4]=c):c=e[4];let m=c,p;e[5]!==n?(p=n!==null&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:n}),e[5]=n,e[6]=p):p=e[6];let f;e[7]!==l||e[8]!==n||e[9]!==t?(f=n===null&&l===void 0&&(0,a.jsx)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")}),e[7]=l,e[8]=n,e[9]=t,e[10]=f):f=e[10];let x;e[11]!==l||e[12]!==n||e[13]!==m||e[14]!==t?(x=n===null&&l!==void 0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:z.map(s=>{let P=l.capabilities[s.key];return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${s.key}`,children:[(0,a.jsx)("span",{className:"text-sm",children:t(s.label)}),m(P)]},s.key)})})}),(0,a.jsx)(g,{heading:t("Plugins"),testId:"auth-config-plugins",children:l.plugins.length===0?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")}):(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.plugins.map(L)})}),(0,a.jsx)(g,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Email & password"),value:m(l.emailAndPassword)}),(0,a.jsx)(o,{label:t("Social providers"),value:l.socialProviders.length===0?t("None"):(0,a.jsx)("span",{className:"flex flex-wrap justify-end gap-1",children:l.socialProviders.map(q)})})]})}),l.organization.enabled&&(0,a.jsx)(g,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Teams"),value:m(l.organization.teams)}),(0,a.jsx)(o,{label:t("Custom roles"),value:m(l.organization.roles)})]})}),(0,a.jsx)(g,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Expires in"),value:v(l.session.expiresIn)}),(0,a.jsx)(o,{label:t("Refresh after"),value:v(l.session.updateAge)}),(0,a.jsx)(o,{label:t("Fresh window"),value:v(l.session.freshAge)}),(0,a.jsx)(o,{label:t("Cookie cache"),value:m(l.session.cookieCache===!0)})]})}),(0,a.jsx)(g,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(o,{label:t("Status"),value:m(l.rateLimit.enabled)}),l.rateLimit.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o,{label:t("Max requests"),value:l.rateLimit.max??"\u2014"}),(0,a.jsx)(o,{label:t("Window"),value:v(l.rateLimit.window)})]})]})}),l.userFields.length>0&&(0,a.jsx)(g,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsx)("ul",{className:"flex flex-col gap-2",children:l.userFields.map(s=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${s.name}`,children:[(0,a.jsxs)("span",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:s.name}),s.plugin!==void 0&&(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:s.plugin})]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h,{variant:"outline",children:s.type}),s.required&&(0,a.jsx)(h,{variant:"secondary",children:t("required")}),s.unique&&(0,a.jsx)(h,{variant:"secondary",children:t("unique")})]})]},s.name))})}),(0,a.jsx)(y,{className:"gap-0 py-0",children:(0,a.jsx)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")})})]}),e[11]=l,e[12]=n,e[13]=m,e[14]=t,e[15]=x):x=e[15];let b;return e[16]!==p||e[17]!==f||e[18]!==x?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[p,f,x]}),e[16]=p,e[17]=f,e[18]=x,e[19]=b):b=e[19],b},"M");function L(e){return(0,a.jsx)(h,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e)}u(L,"P");function q(e){return(0,a.jsx)(h,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e)}u(q,"z");export{T as AuthConfigPanel};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as ye}from"./chunk-V53KNYRN.js";import{a as we}from"./chunk-QXXIJAD5.js";import{a as Ne}from"./chunk-X665E2HU.js";import{b as pe}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as ge}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{a as H}from"./chunk-VDW32UET.js";import{d as be}from"./chunk-SHMNA6UL.js";import{f as xe}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as ne,e as ie}from"./chunk-UZERI5YC.js";import{d as he,f as ce,g as de,h as ee,m as me}from"./chunk-OG4N2XHD.js";import{c as ae}from"./chunk-XNGYYOLS.js";import{a,e as se,f as ve,g as je,h as Ee}from"./chunk-3XIESWL4.js";var Se=se(je(),1);var b=se(ve(),1);var r=se(Ee(),1);var Ce=ce(H.exportShard),Oe=ce(H.importShard),Te=a(x=>x.map(e=>JSON.stringify(e)).join(`
|
|
2
|
+
`),"je"),Ae=a(x=>{let e=[],te=x.split(`
|
|
3
|
+
`);for(let[n,N]of te.entries()){let t=N.trim();if(t==="")continue;let o=JSON.parse(t);if(typeof o!="object"||o===null)throw new ae("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);let h=o;if(typeof h.table!="string"||typeof h.doc!="object"||h.doc===null||Array.isArray(h.doc))throw new ae("INTERNAL",`line ${(n+1).toString()}: expected a { table, doc } object`);e.push(h)}return e},"$e"),Me=a(x=>{let e=(0,Se.c)(94),{initialShardKey:te}=x,n=xe(),N=be(),t=he(),[o,h]=(0,b.useState)(te??""),[l,ue]=(0,b.useState)(""),[d,K]=(0,b.useState)(!1),[Q,M]=(0,b.useState)(null),[i,re]=(0,b.useState)(null),[w,fe]=(0,b.useState)(null),V;e[0]!==n||e[1]!==o?(V=a(async()=>{K(!0),M(null),re(null);try{let c=await n.query(Ce,{},de(o));pe(o),ue(Te(c.rows)),fe(c.rows.length)}catch(c){M(ee(c))}K(!1)},"Q"),e[0]=n,e[1]=o,e[2]=V):V=e[2];let z=V,W;e[3]!==n||e[4]!==N||e[5]!==l||e[6]!==o||e[7]!==t?(W=a(async()=>{K(!0),M(null),re(null),fe(null);let c;try{c=Ae(l)}catch(s){M(t("Invalid NDJSON: {message}",{message:ee(s)})),K(!1);return}try{let s=await n.query(Oe,{rows:c},de(o));pe(o),re(s),N(H.readTablePage),N(H.listTables)}catch(s){M(ee(s))}K(!1)},"V"),e[3]=n,e[4]=N,e[5]=l,e[6]=o,e[7]=t,e[8]=W):W=e[8];let G=W,y,S,I,m,v,p,u,j,E,f,C;if(e[9]!==d||e[10]!==w||e[11]!==z||e[12]!==i||e[13]!==G||e[14]!==l||e[15]!==o||e[16]!==t){let c=i===null?0:Object.values(i.inserted).reduce(Le,0),s;e[28]!==z?(s=a(()=>{me(z())},"s"),e[28]=z,e[29]=s):s=e[29];let oe=s,Y;e[30]!==G?(Y=a(()=>{me(G())},"X"),e[30]=G,e[31]=Y):Y=e[31];let le=Y,Z;e[32]===Symbol.for("react.memo_cache_sentinel")?(Z=a(g=>{ue(g.target.value)},"Y"),e[32]=Z):Z=e[32];let Ie=Z;C="flex flex-col gap-4",I="lunora-export-import";let L;e[33]!==t?(L=t("Export"),e[33]=t,e[34]=L):L=e[34];let $;e[35]!==L?($=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:L})}),e[35]=L,e[36]=$):$=e[36];let J;e[37]!==o?(J=(0,r.jsx)(Ne,{onChange:h,testId:"ei-shard-input",value:o}),e[37]=o,e[38]=J):J=e[38];let k;e[39]!==t?(k=t("Export"),e[39]=t,e[40]=k):k=e[40];let D;e[41]!==d||e[42]!==oe||e[43]!==k?(D=(0,r.jsx)(ge,{"data-testid":"ei-export",disabled:d,onClick:oe,type:"button",children:k}),e[41]=d,e[42]=oe,e[43]=k,e[44]=D):D=e[44];let _;e[45]!==J||e[46]!==D?(_=(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[J,D]}),e[45]=J,e[46]=D,e[47]=_):_=e[47];let q;e[48]!==w||e[49]!==t?(q=w!==null&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:t("Exported {count} rows.",{count:w})}),e[48]=w,e[49]=t,e[50]=q):q=e[50];let B;e[51]!==_||e[52]!==q?(B=(0,r.jsxs)(ie,{className:"flex flex-col gap-3 p-4",children:[_,q]}),e[51]=_,e[52]=q,e[53]=B):B=e[53],e[54]!==$||e[55]!==B?(m=(0,r.jsxs)(ne,{className:"rounded-xl border border-border bg-card shadow-xs",children:[$,B]}),e[54]=$,e[55]=B,e[56]=m):m=e[56],S=ne,E="rounded-xl border border-border bg-card shadow-xs";let P;e[57]!==t?(P=t("Import"),e[57]=t,e[58]=P):P=e[58],e[59]!==P?(f=(0,r.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:P})}),e[59]=P,e[60]=f):f=e[60],y=ie,v="flex flex-col gap-3 p-4",e[61]!==l?(p=(0,r.jsx)(ye,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:Ie,placeholder:'{"table":"messages","doc":{\u2026}}',value:l}),e[61]=l,e[62]=p):p=e[62];let R;e[63]!==t?(R=t("Import (writes rows)?"),e[63]=t,e[64]=R):R=e[64];let U;e[65]!==d||e[66]!==l?(U=d||l.trim()==="",e[65]=d,e[66]=l,e[67]=U):U=e[67];let F;e[68]!==t?(F=t("Import"),e[68]=t,e[69]=F):F=e[69],e[70]!==le||e[71]!==R||e[72]!==U||e[73]!==F?(u=(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,r.jsx)(we,{confirmLabel:R,disabled:U,onConfirm:le,testId:"ei-import",children:F})}),e[70]=le,e[71]=R,e[72]=U,e[73]=F,e[74]=u):u=e[74],j=i!==null&&(0,r.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:i.conflicts,errors:i.errors.length,inserted:c})}),i.errors.length>0&&(0,r.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:i.errors.map(g=>(0,r.jsx)("li",{className:"text-xs text-destructive",children:t("line {line} ({table}): {message}",{line:g.line,message:g.message,table:g.table})},`${g.table}-${g.line.toString()}`))})]}),e[9]=d,e[10]=w,e[11]=z,e[12]=i,e[13]=G,e[14]=l,e[15]=o,e[16]=t,e[17]=y,e[18]=S,e[19]=I,e[20]=m,e[21]=v,e[22]=p,e[23]=u,e[24]=j,e[25]=E,e[26]=f,e[27]=C}else y=e[17],S=e[18],I=e[19],m=e[20],v=e[21],p=e[22],u=e[23],j=e[24],E=e[25],f=e[26],C=e[27];let O;e[75]!==y||e[76]!==v||e[77]!==p||e[78]!==u||e[79]!==j?(O=(0,r.jsxs)(y,{className:v,children:[p,u,j]}),e[75]=y,e[76]=v,e[77]=p,e[78]=u,e[79]=j,e[80]=O):O=e[80];let T;e[81]!==S||e[82]!==O||e[83]!==E||e[84]!==f?(T=(0,r.jsxs)(S,{className:E,children:[f,O]}),e[81]=S,e[82]=O,e[83]=E,e[84]=f,e[85]=T):T=e[85];let A;e[86]!==Q?(A=Q!==null&&(0,r.jsx)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:Q}),e[86]=Q,e[87]=A):A=e[87];let X;return e[88]!==I||e[89]!==m||e[90]!==T||e[91]!==A||e[92]!==C?(X=(0,r.jsxs)("div",{className:C,"data-testid":I,children:[m,T,A]}),e[88]=I,e[89]=m,e[90]=T,e[91]=A,e[92]=C,e[93]=X):X=e[93],X},"Be");function Le(x,e){return x+e}a(Le,"Ee");export{Me as ExportImportPanel};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as hr}from"./chunk-7QIFDWQV.js";import{a as D,b as It,c as F,h as ve,i as Ce,j as yt}from"./chunk-2OUPA2WJ.js";import{a as Et,c as ue,d as z,g as V,i as de,j as $}from"./chunk-6ST5ECQA.js";import{a as r,d as te,e as g,f as y,g as vr,h as re,j as Ct}from"./chunk-3XIESWL4.js";var mr=g(vr(),1),Ba=g(y(),1);var dr=g(y(),1);var qe={};te(qe,{Control:()=>sr,Description:()=>tr,Error:()=>Zt,Item:()=>ur,Label:()=>Gt,Root:()=>qt,Validity:()=>lr});var A=g(y(),1);var Ee=g(y(),1);var He=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});var oe={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},fe={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ft={disabled:!1,...fe},W={valid(e){return e===null?null:e?{[He.valid]:""}:{[He.invalid]:""}}};var Cr={invalid:void 0,name:void 0,validityData:{state:oe,errors:[],error:"",value:"",initialValue:null},setValidityData:V,disabled:void 0,touched:fe.touched,setTouched:V,dirty:fe.dirty,setDirty:V,filled:fe.filled,setFilled:V,focused:fe.focused,setFocused:V,validate:r(()=>null,"validate"),validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:r(()=>!1,"shouldValidateOnChange"),state:Ft,markedDirtyRef:{current:!1},registerFieldControl:V,validation:{getValidationProps:r((e,t=de)=>t,"getValidationProps"),inputRef:{current:null},registerInput:V,commit:r(async()=>{},"commit"),change:V}},Je=Ee.createContext(Cr);function B(e=!0){let t=Ee.useContext(Je);if(t.setValidityData===V&&!e)throw new Error(ue(28));return t}r(B,"useFieldRootContext");var Ie=g(y(),1);var Er=Ie.createContext(void 0);function Tt(e=!1){let t=Ie.useContext(Er);if(!t&&!e)throw new Error(ue(86));return t}r(Tt,"useFieldsetRootContext");var ye=g(y(),1);var Ir=ye.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:V,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function H(){return ye.useContext(Ir)}r(H,"useFormContext");var Q=g(y(),1);var Fe=g(y(),1);var Dt=0;function yr(e,t="mui"){let[o,n]=Fe.useState(e),i=e||o;return Fe.useEffect(()=>{o==null&&(Dt+=1,n(`${t}-${Dt}`))},[o,t]),i}r(yr,"useGlobalId");var St=It.useId;function At(e,t){if(St!==void 0){let o=St();return e??(t?`${t}-${o}`:o)}return yr(e,t)}r(At,"useId");function J(e){return At(e,"base-ui")}r(J,"useBaseUiId");var Te=g(y(),1);var Xe=Te.createContext({controlId:void 0,registerControlId:V,labelId:void 0,setLabelId:V,messageIds:[],setMessageIds:V,getDescriptionProps:r(e=>e,"getDescriptionProps")});function P(){return Te.useContext(Xe)}r(P,"useLabelableContext");var Vt=g(re(),1);var De=r(function(t){let o=J(),n=t.controlId===void 0?o:t.controlId,[i,s]=Q.useState(n),[l,a]=Q.useState(t.labelId),[u,d]=Q.useState([]),m=z(()=>new Map),{messageIds:f}=P(),h=F((R,T)=>{let N=m.current;if(T===void 0){N.delete(R);return}N.set(R,T),s(C=>{if(N.size===0)return;let k;for(let c of N.values()){if(C!==void 0&&c===C)return C;k===void 0&&(k=c)}return k})}),p=Q.useCallback(R=>{let T=R["aria-describedby"]?R["aria-describedby"].split(" "):[];return T.push(...f,...u),{...R,"aria-describedby":Array.from(new Set(T)).join(" ")||void 0}},[f,u]),v=Q.useMemo(()=>({controlId:i,registerControlId:h,labelId:l,setLabelId:a,messageIds:u,setMessageIds:d,getDescriptionProps:p}),[i,h,l,a,u,d,p]);return(0,Vt.jsx)(Xe.Provider,{value:v,children:t.children})},"LabelableProvider");var be=g(y(),1);function Nt(e={}){let{id:t,implicit:o=!1,controlRef:n}=e,{controlId:i,registerControlId:s}=P(),l=J(t),a=o?i:void 0,u=z(()=>Symbol("labelable-control")),d=be.useRef(!1),m=be.useRef(t!=null),f=F(()=>{!d.current||s===V||(d.current=!1,s(u.current,void 0))});return D(()=>{if(s===V)return;let h;if(o){let p=n?.current;ve(p)&&p.closest("label")!=null?h=t??null:h=a??l}else if(t!=null)m.current=!0,h=t;else if(m.current)h=l;else{f();return}if(h===void 0){f();return}d.current=!0,s(u.current,h)},[t,n,a,s,o,l,u,f]),be.useEffect(()=>f,[f]),i??l}r(Nt,"useLabelableId");function Se(e){return e?.ownerDocument||document}r(Se,"ownerDocument");var Ae={};te(Ae,{engine:()=>rt,env:()=>nt,os:()=>et,screenReader:()=>ot});var et={};te(et,{android:()=>_t,apple:()=>Ze,ios:()=>Qe,linux:()=>Ar,mac:()=>Ot,windows:()=>Sr});function Fr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}r(Fr,"readRawData");var{userAgent:Tr,platform:Dr,maxTouchPoints:wt}=Fr(),ne=Tr.toLowerCase(),ie=Dr.toLowerCase();var Qe=/^i(os$|p)/.test(ie)||ie==="macintel"&&wt>1,Lt="android",_t=ie===Lt||ne.includes(Lt),Ot=!Qe&&ie.startsWith("mac"),Sr=ie.startsWith("win"),Ar=!_t&&/^(linux|chrome os)/.test(ie),Ze=Ot||Qe;var rt={};te(rt,{blink:()=>Nr,gecko:()=>Vr,webkit:()=>tt});var tt=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),Vr=!tt&&ne.includes("firefox"),Nr=!tt&&ne.includes("chrom");var ot={};te(ot,{voiceOver:()=>wr});var wr=Ze;var nt={};te(nt,{jsdom:()=>Lr});var Lr=/jsdom|happydom/.test(ne);var it="data-base-ui-focusable";var st="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Fn="ArrowLeft",Tn="ArrowRight",Dn="ArrowUp",Sn="ArrowDown";function at(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}r(at,"activeElement");function Mt(e,t){if(!e||!t)return!1;let o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&yt(o)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}r(Mt,"contains");function lt(e){return"composedPath"in e?e.composedPath()[0]:e.target}r(lt,"getTarget");function Pn(e,t){if(!ve(e))return!1;let o=e;if(t.hasElement(o))return!o.hasAttribute("data-trigger-disabled");for(let[,n]of t.entries())if(Mt(n,o))return!n.hasAttribute("data-trigger-disabled");return!1}r(Pn,"isTargetInsideEnabledTrigger");function kn(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let o=e;return o.target!=null&&t.contains(o.target)}r(kn,"isEventTargetWithin");function Un(e){return e.matches("html,body")}r(Un,"isRootElement");function _r(e){return Ce(e)&&e.matches(st)}r(_r,"isTypeableElement");function jn(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${st}`)!=null}r(jn,"isInteractiveElement");function Bn(e){return e?e.getAttribute("role")==="combobox"&&_r(e):!1}r(Bn,"isTypeableCombobox");function $n(e){if(!e||Ae.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}r($n,"matchesFocusVisible");function Wn(e){return e?e.hasAttribute(it)?e:e.querySelector(`[${it}]`)||e:null}r(Wn,"getFloatingFocusElement");function Pt(e,t){let o=J(e);return D(()=>(t(o),()=>{t(void 0)}),[o,t]),o}r(Pt,"useRegisteredLabelId");function kt(e={}){let{id:t,fallbackControlId:o,native:n=!1,setLabelId:i,focusControl:s}=e,{controlId:l,setLabelId:a}=P(),u=F(p=>{a(p),i?.(p)}),d=Pt(t,u),m=l??o;function f(p){if(s){s(p,m);return}if(!m)return;let v=Se(p.currentTarget).getElementById(m);Ce(v)&&Or(v)}r(f,"focusControl");function h(p){lt(p.nativeEvent)?.closest("button,input,select,textarea")||(!p.defaultPrevented&&p.detail>1&&p.preventDefault(),!n&&f(p))}return r(h,"handleInteraction"),n?{id:d,htmlFor:m??void 0,onMouseDown:h}:{id:d,onClick:h,onPointerDown(p){p.preventDefault()}}}r(kt,"useLabel");function Or(e){e.focus({focusVisible:!0})}r(Or,"focusElementWithVisible");var Z=g(y(),1);var Ut=g(y(),1);var Mr=[];function Ve(e){Ut.useEffect(e,Mr)}r(Ve,"useOnMount");var xe=0,ct=class e{static{r(this,"Timeout")}static create(){return new e}currentId=xe;start(t,o){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xe,o()},t)}isStarted(){return this.currentId!==xe}clear=r(()=>{this.currentId!==xe&&(clearTimeout(this.currentId),this.currentId=xe)},"clear");disposeEffect=r(()=>this.clear,"disposeEffect")};function jt(){let e=z(ct.create).current;return Ve(e.disposeEffect),e}r(jt,"useTimeout");function se(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}r(se,"getCombinedFieldValidityData");var Ne=Object.keys(oe);function Pr(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let o of Ne)o!=="valid"&&(o==="valueMissing"?t=e[o]:e[o]&&(t=!1));return t}r(Pr,"isOnlyValueMissing");function kr(e){let t=null;for(let o of e)if(!o.disabled){if(!o.validity.valid)return o;t??=o}return t}r(kr,"findRepresentativeInput");function Bt(e,t){let o=!1;for(let n of t)n.setCustomValidity(""),o||=n===e;o||e.setCustomValidity("")}r(Bt,"clearCustomValidity");function $t(e){let{formRef:t}=H(),{setValidityData:o,validate:n,validityData:i,validationDebounceTime:s,invalid:l,markedDirtyRef:a,state:u,shouldValidateOnChange:d,getRegisteredFieldId:m}=e,{controlId:f,getDescriptionProps:h}=P(),p=jt(),v=Z.useRef(null),R=z(()=>new Set).current,T=Z.useRef(0),N=Z.useCallback(b=>{if(b)return R.add(b),()=>{R.delete(b)}},[R]),C=F(async(b,w=!1)=>{let E=kr(R)??v.current;if(!E)return;T.current+=1;let ee=T.current;function q(M,S=l){let _=m()??f;if(_==null)return;let x=t.current.fields.get(_);if(!x)return;let K=se(M,S);t.current.fields.set(_,{...x,validityData:K})}if(r(q,"updateRegisteredFieldValidity"),w){if(u.valid!==!1)return;let M=E.validity;if(!M.valueMissing){let _={value:b,state:{...oe,valid:!0},error:"",errors:[],initialValue:i.initialValue};Bt(E,R),q(_,!1),o(_);return}let S=Ne.reduce((_,x)=>(_[x]=M[x],_),{});if(!S.valid&&!Pr(S))return}function G(M){let S=Ne.reduce((x,K)=>(x[K]=M.validity[K],x),{}),_=!1;for(let x of Ne)if(x!=="valid"){if(x==="valueMissing"&&S[x])_=!0;else if(S[x])return S}return _&&!a.current&&(S.valid=!0,S.valueMissing=!1),S}r(G,"getState"),p.clear();let I=null,O=[],U=G(E),j,Y=d();if(E.validationMessage&&!Y)j=E.validationMessage,O=[E.validationMessage];else{let M=Array.from(t.current.fields.values()).reduce((_,x)=>(x.name&&(_[x.name]=x.getValue()),_),{}),S=n(b,M);if(typeof S=="object"&&S!==null&&"then"in S){if(I=await S,ee!==T.current)return}else I=S;I!==null?(U.valid=!1,U.customError=!0,Array.isArray(I)?(O=I,E.setCustomValidity(I.join(`
|
|
2
|
+
`))):I&&(O=[I],E.setCustomValidity(I))):Y&&(Bt(E,R),U.customError=!1,E.validationMessage?(j=E.validationMessage,O=[E.validationMessage]):E.validity.valid&&!U.valid&&(U.valid=!0))}let L={value:b,state:U,error:j??(Array.isArray(I)?I[0]:I??""),errors:O,initialValue:i.initialValue};q(L),o(L)}),k=F(b=>{p.clear();let w=d();w&&b!==""&&s?(T.current+=1,p.start(s,()=>{C(b)})):C(b,!w)}),c=Z.useCallback((b,w={})=>Et(h(w),u.valid===!1&&!u.disabled&&!b?{"aria-invalid":!0}:de),[h,u.disabled,u.valid]);return Z.useMemo(()=>({getValidationProps:c,inputRef:v,registerInput:N,commit:C,change:k}),[c,N,C,k])}r($t,"useFieldValidation");var we=g(y(),1);function Wt(e){let{commit:t,invalid:o,markedDirtyRef:n,name:i,setRegisteredFieldName:s,setRegisteredFieldId:l,setValidityData:a,validityData:u}=e,{formRef:d}=H(),m=we.useRef(null),f=we.useRef(null),h=we.useRef(null),p=F(()=>{let c=f.current;if(c)return c.getValue?c.getValue():c.value});function v(c){return c.value===void 0?p():c.value}r(v,"getRegistrationValue");let R=F(()=>{let c=f.current;if(n.current=!0,!c){t(u.value);return}t(v(c))});function T(){let c=f.current;!c||!c.id||d.current.fields.set(c.id,{getValue:p,name:i??c.name,controlRef:c.controlRef??h,validityData:se(u,o),validate:R})}r(T,"refreshRegistration");function N(c=f.current?.id){c&&d.current.fields.delete(c)}r(N,"deleteRegistration");function C(){let c=f.current;if(!c)return;let b=v(c);u.initialValue===null&&b!==null&&a(w=>({...w,initialValue:b}))}r(C,"syncInitialValue"),D(()=>{let c=f.current;!c||!c.id||(s(i?void 0:c.name),d.current.fields.set(c.id,{getValue:p,name:i??c.name,controlRef:c.controlRef??h,validityData:se(u,o),validate:R}))},[d,p,o,i,s,R,u]),D(()=>{let c=d.current.fields;return()=>{let b=f.current?.id;b&&c.delete(b)}},[d]);let k=F((c,b)=>{if(!b){m.current===c&&(m.current=null,N(),f.current=null,s(void 0),l(void 0));return}let w=f.current?.id;m.current=c,f.current=b,i||s(b.name),l(b.id),w&&w!==b.id&&N(w),C(),T()});return[R,k]}r(Wt,"useFieldControlRegistration");var Le=g(re(),1);var Ur=A.forwardRef(r(function(t,o){let{errors:n,validationMode:i,submitAttemptedRef:s}=H(),{render:l,className:a,validate:u,validationDebounceTime:d=0,validationMode:m=i,name:f,disabled:h=!1,invalid:p,dirty:v,touched:R,actionsRef:T,style:N,...C}=t,k=Tt(!0)?.disabled,c=F(u||(()=>null)),b=k||h,[w,E]=A.useState(!1),[ee,q]=A.useState(!1),[G,I]=A.useState(!1),[O,U]=A.useState(!1),j=v??ee,Y=R??w,L=A.useRef(j),M=A.useRef(void 0),[S,_]=A.useState(),x=f??S;D(()=>{v!==void 0&&(L.current=v)},[v]);let K=A.useCallback(()=>M.current,[]),br=A.useCallback(ce=>{M.current=ce},[]),xt=F(ce=>{v===void 0&&(ce&&(L.current=!0),q(ce))}),gt=F(ce=>{R===void 0&&E(ce)}),Ge=F(()=>m==="onChange"||m==="onSubmit"&&s.current),Ye=x&&Object.hasOwn(n,x)?n[x]:null,xr=!!(Array.isArray(Ye)?Ye.length:Ye),me=p===!0||xr,[pe,Ke]=A.useState({state:oe,error:"",errors:[],value:null,initialValue:null}),Rt=b?null:!me&&pe.state.valid,he=A.useMemo(()=>({disabled:b,touched:Y,dirty:j,valid:Rt,filled:G,focused:O}),[b,Y,j,Rt,G,O]),ze=$t({setValidityData:Ke,validate:c,validityData:pe,validationDebounceTime:d,invalid:me,markedDirtyRef:L,state:he,shouldValidateOnChange:Ge,getRegisteredFieldId:K}),[ht,vt]=Wt({commit:ze.commit,invalid:me,markedDirtyRef:L,name:f,setRegisteredFieldName:_,setRegisteredFieldId:br,setValidityData:Ke,validityData:pe});A.useImperativeHandle(T,()=>({validate:ht}),[ht]);let gr=A.useMemo(()=>({invalid:me,name:x,validityData:pe,setValidityData:Ke,disabled:b,touched:Y,setTouched:gt,dirty:j,setDirty:xt,filled:G,setFilled:I,focused:O,setFocused:U,validate:c,validationMode:m,validationDebounceTime:d,shouldValidateOnChange:Ge,state:he,markedDirtyRef:L,registerFieldControl:vt,validation:ze}),[me,x,pe,b,Y,gt,j,xt,G,I,O,U,c,m,d,Ge,he,vt,ze]),Rr=$("div",t,{ref:o,state:he,props:C,stateAttributesMapping:W});return(0,Le.jsx)(Je.Provider,{value:gr,children:Rr})},"FieldRootInner")),qt=A.forwardRef(r(function(t,o){return(0,Le.jsx)(De,{children:(0,Le.jsx)(Ur,{...t,ref:o})})},"FieldRoot"));var ge=g(y(),1);var _e=g(y(),1);var ut=_e.createContext({disabled:!1});function Oe(){return _e.useContext(ut)}r(Oe,"useFieldItemContext");var Gt=ge.forwardRef(r(function(t,o){let{render:n,className:i,style:s,id:l,nativeLabel:a=!0,...u}=t,d=B(!1),m=Oe(),{labelId:f}=P(),h={...d.state,disabled:d.disabled||m.disabled},p=ge.useRef(null),v=kt({id:f??l,native:a});return $("label",t,{ref:[o,p],state:h,props:[v,u],stateAttributesMapping:W})},"FieldLabel"));var ae=g(y(),1);var Xt=g(y(),1);var Ht=g(hr(),1);var Me=null,Zi=globalThis.requestAnimationFrame,dt=class{static{r(this,"Scheduler")}callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=r(t=>{this.isScheduled=!1;let o=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let i=0;i<o.length;i+=1)o[i]?.(t)},"tick");request(t){let o=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),o}cancel(t){let o=t-this.startId;o<0||o>=this.callbacks.length||(this.callbacks[o]=null,this.callbacksCount-=1)}},Pe=new dt,X=class e{static{r(this,"AnimationFrame")}static create(){return new e}static request(t){return Pe.request(t)}static cancel(t){return Pe.cancel(t)}currentId=Me;request(t){this.cancel(),this.currentId=Pe.request(()=>{this.currentId=Me,t()})}cancel=r(()=>{this.currentId!==Me&&(Pe.cancel(this.currentId),this.currentId=Me)},"cancel");disposeEffect=r(()=>this.cancel,"disposeEffect")};function Yt(){let e=z(X.create).current;return Ve(e.disposeEffect),e}r(Yt,"useAnimationFrame");function Kt(e){return e==null?e:"current"in e?e.current:e}r(Kt,"resolveRef");var ke=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({}),jr={[ke.startingStyle]:""},Br={[ke.endingStyle]:""},zt={transitionStatus(e){return e==="starting"?jr:e==="ending"?Br:null}};function Jt(e,t=!1,o=!0){let n=Yt();return F((i,s=null)=>{n.cancel();let l=Kt(e);if(l==null)return;let a=l,u=r(()=>{Ht.flushSync(i)},"done");if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function d(){Promise.all(a.getAnimations().map(m=>m.finished)).then(()=>{s?.aborted||u()}).catch(()=>{if(o){s?.aborted||u();return}let m=a.getAnimations();!s?.aborted&&m.length>0&&m.some(f=>f.pending||f.playState!=="finished")&&d()})}if(r(d,"exec"),t){let m=ke.startingStyle;if(!a.hasAttribute(m)){n.request(d);return}let f=new MutationObserver(()=>{a.hasAttribute(m)||(f.disconnect(),d())});f.observe(a,{attributes:!0,attributeFilter:[m]}),s?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}n.request(d)})}r(Jt,"useAnimationsFinished");function Qt(e){let{enabled:t=!0,open:o,ref:n,onComplete:i}=e,s=F(i),l=Jt(n,o,!1);Xt.useEffect(()=>{if(!t)return;let a=new AbortController;return l(s,a.signal),()=>{a.abort()}},[t,o,s,l])}r(Qt,"useOpenChangeComplete");var ft=g(y(),1);function Ue(e,t=!1,o=!1){let[n,i]=ft.useState(e&&t?"idle":void 0),[s,l]=ft.useState(e);return e&&!s&&(l(!0),i("starting")),!e&&s&&n!=="ending"&&!o&&i("ending"),!e&&!s&&n==="ending"&&i(void 0),D(()=>{if(!e&&s&&n!=="ending"&&o){let a=X.request(()=>{i("ending")});return()=>{X.cancel(a)}}},[e,s,n,o]),D(()=>{if(!e||t)return;let a=X.request(()=>{i(void 0)});return()=>{X.cancel(a)}},[t,e]),D(()=>{if(!e||!t)return;e&&s&&n!=="idle"&&i("starting");let a=X.request(()=>{i("idle")});return()=>{X.cancel(a)}},[t,e,s,n]),{mounted:s,setMounted:l,transitionStatus:n}}r(Ue,"useTransitionStatus");var mt=g(re(),1);var $r={...W,...zt},Zt=ae.forwardRef(r(function(t,o){let{render:n,id:i,className:s,match:l,style:a,...u}=t,d=J(i),{validityData:m,state:f,name:h}=B(!1),{setMessageIds:p}=P(),{errors:v}=H(),R=h&&Object.hasOwn(v,h)?v[h]:null,T=!!(Array.isArray(R)?R.length:R),N=typeof l=="string",C=!1;l===!0?C=!0:f.disabled?C=!1:N?C=!!m.state[l]:C=T||m.state.valid===!1;let{mounted:k,transitionStatus:c,setMounted:b}=Ue(C);D(()=>{if(!(!C||!d))return p(L=>L.concat(d)),()=>{p(L=>L.filter(M=>M!==d))}},[C,d,p]);let w=ae.useRef(null),[E,ee]=ae.useState(null),[q,G]=ae.useState(null),I=m.error;!N&&T?I=R:m.errors.length>1&&(I=m.errors);let O=I??"";Array.isArray(I)&&(O=I.length>1?(0,mt.jsx)("ul",{children:I.map(L=>(0,mt.jsx)("li",{children:L},L))}):I[0]??"");let U=Array.isArray(I)?JSON.stringify(I):I;C&&U!==q&&(G(U),ee(O)),Qt({open:C,ref:w,onComplete(){C||b(!1)}});let j={...f,transitionStatus:c},Y=$("div",t,{ref:[o,w],state:j,props:[{id:d,children:C?O:E},u],stateAttributesMapping:$r,enabled:k});return k?Y:null},"FieldError"));var er=g(y(),1);var tr=er.forwardRef(r(function(t,o){let{render:n,id:i,className:s,style:l,...a}=t,u=J(i),d=B(!1),m=Oe(),{setMessageIds:f}=P(),h={...d.state,disabled:d.disabled||m.disabled};return D(()=>{if(u)return f(v=>v.concat(u)),()=>{f(v=>v.filter(R=>R!==u))}},[u,f]),$("p",t,{ref:o,state:h,props:[{id:u},a],stateAttributesMapping:W})},"FieldDescription"));var Be=g(y(),1);var le=g(y(),1);function rr({controlled:e,default:t,name:o,state:n="value"}){let{current:i}=le.useRef(e!==void 0),[s,l]=le.useState(t),a=i?e:s,u=le.useCallback(d=>{i||l(d)},[]);return[a,u]}r(rr,"useControlled");var or=g(y(),1);function nr(e,t,o,n,i=!0,s){let{registerFieldControl:l}=B(),a=or.useRef(null);a.current||(a.current=Symbol()),D(()=>{let u=a.current;return!u||!i?void 0:(l(u,{controlRef:e,getValue:n,id:t,name:s,value:o}),()=>{l(u,void 0)})},[e,i,n,t,s,l,o])}r(nr,"useRegisterFieldControl");var je={};te(je,{cancelOpen:()=>go,chipRemovePress:()=>Qr,clearPress:()=>Xr,closePress:()=>Hr,closeWatcher:()=>co,decrementPress:()=>to,disabled:()=>ho,drag:()=>po,escapeKey:()=>lo,focusOut:()=>ao,imperativeAction:()=>Eo,incrementPress:()=>eo,initial:()=>Co,inputBlur:()=>no,inputChange:()=>ro,inputClear:()=>oo,inputPaste:()=>io,inputPress:()=>so,itemPress:()=>zr,keyboard:()=>fo,linkPress:()=>Jr,listNavigation:()=>uo,missing:()=>vo,none:()=>Wr,outsidePress:()=>Kr,pointer:()=>mo,scrub:()=>xo,siblingOpen:()=>Ro,swipe:()=>Io,trackPress:()=>Zr,triggerFocus:()=>Yr,triggerHover:()=>Gr,triggerPress:()=>qr,wheel:()=>bo,windowResize:()=>yo});var Wr="none",qr="trigger-press",Gr="trigger-hover",Yr="trigger-focus",Kr="outside-press",zr="item-press",Hr="close-press",Jr="link-press",Xr="clear-press",Qr="chip-remove-press",Zr="track-press",eo="increment-press",to="decrement-press",ro="input-change",oo="input-clear",no="input-blur",io="input-paste",so="input-press",ao="focus-out",lo="escape-key",co="close-watcher",uo="list-navigation",fo="keyboard",mo="pointer",po="drag",bo="wheel",xo="scrub",go="cancel-open",Ro="sibling-open",ho="disabled",vo="missing",Co="initial",Eo="imperative-action",Io="swipe",yo="window-resize";function ir(e,t,o,n){let i=!1,s=!1,l=n??de;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:o,...l}}r(ir,"createChangeEventDetails");var sr=Be.forwardRef(r(function(t,o){let{render:n,className:i,id:s,name:l,value:a,disabled:u=!1,onValueChange:d,defaultValue:m,autoFocus:f=!1,style:h,...p}=t,{state:v,name:R,disabled:T,setTouched:N,setDirty:C,validityData:k,setFocused:c,setFilled:b,validationMode:w,validation:E}=B(),{clearErrors:ee}=H(),q=T||u,G=R??l,I={...v,disabled:q},{labelId:O}=P(),U=Nt({id:s});D(()=>{let x=a!=null;E.inputRef.current?.value||x&&a!==""?b(!0):x&&a===""&&b(!1)},[E.inputRef,b,a]);let j=Be.useRef(null);D(()=>{f&&j.current===at(Se(j.current))&&c(!0)},[f,c]);let[Y]=rr({controlled:a,default:m,name:"FieldControl",state:"value"}),L=a!==void 0,M=L?Y:void 0,S=F(()=>E.inputRef.current?.value);return nr(E.inputRef,U,M,S,!q,l),$("input",t,{ref:[o,j],state:I,props:[{id:U,disabled:q,name:G,ref:E.inputRef,"aria-labelledby":O,autoFocus:f,...L?{value:M}:{defaultValue:m},onChange(x){let K=x.currentTarget.value;d?.(K,ir(je.none,x.nativeEvent)),C(K!==k.initialValue),b(K!==""),x.nativeEvent.defaultPrevented||(ee(G),E.change(K))},onFocus(){c(!0)},onBlur(x){N(!0),c(!1),w==="onBlur"&&E.commit(x.currentTarget.value)},onKeyDown(x){x.currentTarget.tagName==="INPUT"&&x.key==="Enter"&&(N(!0),E.commit(x.currentTarget.value))}},p,x=>E.getValidationProps(q,x)],stateAttributesMapping:W})},"FieldControl"));var Re=g(y(),1);var ar=g(re(),1);var lr=r(function(t){let{children:o}=t,{validityData:n,invalid:i}=B(!1),s=Re.useMemo(()=>se(n,i),[n,i]),l=s.state.valid===!1,{transitionStatus:a}=Ue(l),u=Re.useMemo(()=>({...s,validity:s.state,transitionStatus:a}),[s,a]);return(0,ar.jsx)(Re.Fragment,{children:o(u)})},"FieldValidity");var We=g(y(),1);var $e=g(y(),1);var Fo=$e.createContext(void 0);function cr(e=!0){let t=$e.useContext(Fo);if(t===void 0&&!e)throw new Error(ue(3));return t}r(cr,"useCheckboxGroupContext");var pt=g(re(),1);var ur=We.forwardRef(r(function(t,o){let{render:n,className:i,style:s,disabled:l=!1,...a}=t,{state:u,disabled:d}=B(!1),m=d||l,f={...u,disabled:m},h=cr(),v=h?.allValues!==void 0?h?.parent.id:void 0,R=We.useMemo(()=>({disabled:m}),[m]),T=$("div",t,{ref:o,state:f,props:a,stateAttributesMapping:W});return(0,pt.jsx)(De,{controlId:v,children:(0,pt.jsx)(ut.Provider,{value:R,children:T})})},"FieldItem"));var fr=g(re(),1);var bt=dr.forwardRef(r(function(t,o){return(0,fr.jsx)(qe.Control,{ref:o,...t})},"Input"));var pr=g(re(),1);function qa(e){let t=(0,mr.c)(10),o,n,i;t[0]!==e?({className:o,type:i,...n}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=i):(o=t[1],n=t[2],i=t[3]);let s;t[4]!==o?(s=Ct("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",o),t[4]=o,t[5]=s):s=t[5];let l;return t[6]!==n||t[7]!==s||t[8]!==i?(l=(0,pr.jsx)(bt,{type:i,"data-slot":"input",className:s,...n}),t[6]=n,t[7]=s,t[8]=i,t[9]=l):l=t[9],l}r(qa,"g");export{W as a,B as b,H as c,At as d,J as e,P as f,Nt as g,Se as h,Ae as i,it as j,Fn as k,Tn as l,Dn as m,Sn as n,at as o,Mt as p,lt as q,Pn as r,kn as s,Un as t,_r as u,jn as v,Bn as w,$n as x,Wn as y,kt as z,Ve as A,ct as B,jt as C,Oe as D,X as E,Yt as F,Kt as G,ke as H,zt as I,Jt as J,Qt as K,Ue as L,rr as M,nr as N,je as O,ir as P,cr as Q,qa as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as E}from"./chunk-54MMVNPT.js";import{c as w}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import"./chunk-6ST5ECQA.js";import{b as $}from"./chunk-SHMNA6UL.js";import{f as b}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as j}from"./chunk-XQCVZAGU.js";import{a as z,b as B,c as C,d as g,e as n,f as i}from"./chunk-MIQTKZAR.js";import{a as S,e as I}from"./chunk-UZERI5YC.js";import{d as k,m as R,q as _}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as h,e as y,g as O,h as P}from"./chunk-3XIESWL4.js";var L=y(O(),1);var s=y(P(),1);var T=200,U=h(()=>{let e=(0,L.c)(21),l=b(),t=k(),u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=["lunora-auth-sessions",T],e[0]=u):u=e[0];let p;e[1]!==l?(p=h(()=>l.listAuthSessions({limit:T}),"u"),e[1]=l,e[2]=p):p=e[2];let o=$(u,p),{error:f}=o,a=o.data?.rows??null,x;e[3]!==o?(x=h(()=>{o.refetch()},"f"),e[3]=o,e[4]=x):x=e[4],E(x,!0);let N;e[5]!==l||e[6]!==o?(N=h(r=>{R((async()=>{await l.revokeAuthSession({sessionId:r}),o.refetch()})())},"x"),e[5]=l,e[6]=o,e[7]=N):N=e[7];let A=N,d;e[8]!==f?(d=f!==null&&(0,s.jsx)("p",{className:"text-sm text-destructive","data-testid":"auth-sessions-error",role:"alert",children:f}),e[8]=f,e[9]=d):d=e[9];let c;e[10]!==a||e[11]!==t?(c=a!==null&&a.length===0&&(0,s.jsx)(j,{testId:"auth-sessions-empty",title:t("No active sessions.")}),e[10]=a,e[11]=t,e[12]=c):c=e[12];let m;e[13]!==A||e[14]!==a||e[15]!==t?(m=a!==null&&a.length>0&&(0,s.jsx)(S,{className:"overflow-hidden py-0",children:(0,s.jsx)(I,{className:"px-0",children:(0,s.jsxs)(z,{"data-testid":"auth-sessions-table",children:[(0,s.jsx)(B,{children:(0,s.jsxs)(g,{children:[(0,s.jsx)(n,{children:t("user")}),(0,s.jsx)(n,{children:t("expires")}),(0,s.jsx)(n,{children:t("ip")}),(0,s.jsx)(n,{children:t("user agent")}),(0,s.jsx)(n,{children:t("impersonated by")}),(0,s.jsx)(n,{"aria-label":t("Actions")})]})}),(0,s.jsx)(C,{children:a.map(r=>(0,s.jsxs)(g,{"data-testid":`auth-session-${r.id}`,children:[(0,s.jsx)(i,{className:"font-mono text-xs",children:r.userId}),(0,s.jsx)(i,{className:"text-muted-foreground tabular-nums",children:_(r.expiresAt)}),(0,s.jsx)(i,{children:r.ipAddress??""}),(0,s.jsx)(i,{className:"max-w-40 truncate",children:r.userAgent??""}),(0,s.jsx)(i,{className:"font-mono text-xs",children:r.impersonatedBy??""}),(0,s.jsx)(i,{children:(0,s.jsx)(w,{"data-testid":`auth-session-revoke-${r.id}`,onClick:h(()=>{A(r.id)},"onClick"),size:"xs",type:"button",variant:"ghost",children:t("Revoke")})})]},r.id))})]})})}),e[13]=A,e[14]=a,e[15]=t,e[16]=m):m=e[16];let v;return e[17]!==d||e[18]!==c||e[19]!==m?(v=(0,s.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"auth-sessions",children:[d,c,m]}),e[17]=d,e[18]=c,e[19]=m,e[20]=v):v=e[20],v},"Q");export{U as AuthSessionsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as p}from"./chunk-QLQADHFE.js";import{d as f}from"./chunk-OG4N2XHD.js";import{a as v,e as d,g,h}from"./chunk-3XIESWL4.js";var x=d(g(),1);var c=d(h(),1);var y=v(b=>{let e=(0,x.c)(14),{message:i,prefix:n}=b,r=f(),t=p(),l;e[0]!==t?(l=v(()=>{t?.openConsole({errorsOnly:!0})},"l"),e[0]=t,e[1]=l):l=e[1];let u=l;if(i===void 0)return null;let m=`${n}-live-error`,o;e[2]!==i||e[3]!==r?(o=r("Live unavailable: {liveError}",{liveError:i}),e[2]=i,e[3]=r,e[4]=o):o=e[4];let s;e[5]!==t||e[6]!==n||e[7]!==u||e[8]!==r?(s=t===void 0?null:(0,c.jsx)("button",{className:"underline outline-none focus-visible:ring-1 focus-visible:ring-ring","data-testid":`${n}-live-error-console`,onClick:u,type:"button",children:r("Show in console")}),e[5]=t,e[6]=n,e[7]=u,e[8]=r,e[9]=s):s=e[9];let a;return e[10]!==m||e[11]!==o||e[12]!==s?(a=(0,c.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-destructive","data-testid":m,role:"status",children:[o,s]}),e[10]=m,e[11]=o,e[12]=s,e[13]=a):a=e[13],a},"C");export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as q}from"./chunk-54MMVNPT.js";import{a as F}from"./chunk-3CWGJYBB.js";import{a as D}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import"./chunk-2OUPA2WJ.js";import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as L}from"./chunk-LJIFMW67.js";import"./chunk-XXQUMVWH.js";import"./chunk-QWBRD6PX.js";import"./chunk-QLQADHFE.js";import{a as _}from"./chunk-VDW32UET.js";import{c as T}from"./chunk-SHMNA6UL.js";import"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as E}from"./chunk-XQCVZAGU.js";import{a as O,b as P,c as W,d as w,e as h,f as p}from"./chunk-MIQTKZAR.js";import{a as $,e as j}from"./chunk-UZERI5YC.js";import{d as M}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as S,e as A,g as G,h as U}from"./chunk-3XIESWL4.js";var J=A(G(),1);var t=A(U(),1);var B=80,Z=S(a=>{if(a===void 0)return"";let e=JSON.stringify(a);return e.length>B?`${e.slice(0,B)}\u2026`:e},"B"),z=S(a=>{let e=[];for(let r of a){let n=r.id.toString();if(r.subscriptions.length===0){e.push({admin:r.admin,connectionId:r.id,key:`c${n}`,subscription:null});continue}r.subscriptions.forEach((l,i)=>{e.push({admin:r.admin,connectionId:r.id,key:`c${n}-s${i.toString()}`,subscription:l})})}return e},"G"),C=(0,t.jsx)("span",{className:"text-muted-foreground",children:"\u2014"}),oe=S(a=>{let e=(0,J.c)(22),{initialShardKey:r}=a,n=M(),{queryShardKey:l,setShardKey:i,shardKey:u}=F(r),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={},e[0]=f):f=e[0];let b;e[1]!==l?(b={keepPreviousData:!0,shardKey:l},e[1]=l,e[2]=b):b=e[2];let{data:s,error:o,errorSource:m,refetch:R}=T(_.listSubscriptions,f,b);q(R,!0);let x;if(e[3]!==o||e[4]!==m||e[5]!==s||e[6]!==i||e[7]!==u||e[8]!==n){let k=s===void 0?[]:z(s.connections),c;e[10]!==i||e[11]!==u?(c=(0,t.jsx)(D,{onChange:i,testId:"subs-shard-input",value:u}),e[10]=i,e[11]=u,e[12]=c):c=e[12];let d;e[13]!==s||e[14]!==n?(d=s!==void 0&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground","data-testid":"subs-count",children:[(0,t.jsx)(y,{variant:"secondary",children:n("{count} connections",{count:s.totalConnections})}),(0,t.jsx)(y,{variant:"secondary",children:n("{count} subscriptions",{count:s.totalSubscriptions})})]}),e[13]=s,e[14]=n,e[15]=d):d=e[15];let g;e[16]!==c||e[17]!==d?(g=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[16]=c,e[17]=d,e[18]=g):g=e[18];let v;e[19]!==o||e[20]!==m?(v=o!==null&&(0,t.jsx)(L,{error:m,testId:"subs-error"}),e[19]=o,e[20]=m,e[21]=v):v=e[21],x=(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"subs-panel",children:[g,v,o===null&&s!==void 0&&k.length===0&&(0,t.jsx)(E,{description:n("Active WebSocket subscriptions on this shard."),icon:(0,t.jsx)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"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"})}),testId:"subs-empty",title:n("No active subscriptions.")}),o===null&&k.length>0&&(0,t.jsx)($,{className:"overflow-hidden py-0",children:(0,t.jsx)(j,{className:"px-0",children:(0,t.jsxs)(O,{"data-testid":"subs-table",children:[(0,t.jsx)(P,{children:(0,t.jsxs)(w,{children:[(0,t.jsx)(h,{children:n("Connection")}),(0,t.jsx)(h,{children:n("Function path")}),(0,t.jsx)(h,{children:n("Table")}),(0,t.jsx)(h,{children:n("Arguments")})]})}),(0,t.jsx)(W,{children:k.map(N=>{let{subscription:I}=N,K=Z(I?.args);return(0,t.jsxs)(w,{"data-testid":"subs-row",children:[(0,t.jsx)(p,{className:"font-medium tabular-nums",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:["#",N.connectionId,N.admin&&(0,t.jsx)(y,{variant:"outline",children:n("admin")})]})}),(0,t.jsx)(p,{className:"font-mono text-xs",children:I?.functionPath??C}),(0,t.jsx)(p,{children:I?.table??C}),(0,t.jsx)(p,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:K||void 0,children:K||C})]},N.key)})})]})})})]}),e[3]=o,e[4]=m,e[5]=s,e[6]=i,e[7]=u,e[8]=n,e[9]=x}else x=e[9];return x},"oe");export{oe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G}from"./chunk-V53KNYRN.js";import{a as g}from"./chunk-5Y3QLNWX.js";import{a as B}from"./chunk-X665E2HU.js";import{b as U}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as O}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as h}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as w}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as M}from"./chunk-VDW32UET.js";import{f as D}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{d as K,e as _,f as z,h as P,m as q,q as E}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as s,e as T,f as ie,h as oe}from"./chunk-3XIESWL4.js";var i=T(ie(),1);var e=T(oe(),1);var de=s(r=>r.kind==="id"?r.table===void 0?"id":`id<${r.table}>`:r.kind==="array"?r.element===void 0?"array":`${r.element}[]`:r.kind,"ie"),le=s(r=>r===void 0||r.length===0?"()":`(${r.map(o=>`${o.name}${o.optional?"?":""}: ${de(o)}`).join(", ")})`,"oe"),ue=s(r=>{switch(r){case"array":return[];case"bigint":case"number":return 0;case"boolean":return!1;case"object":case"record":return{};default:return""}},"de"),ce=s(r=>{let o={};for(let a of r??[])a.optional||(o[a.name]=ue(a.kind));return JSON.stringify(o,void 0,2)},"le"),me=z(M.runAs),fe=10,pe=s(r=>r===void 0?"undefined":JSON.stringify(r,null,2),"me"),Fe=s(({functions:r,runAsIdentity:o=!1}={})=>{let a=K(),c=D(),[H,Q]=(0,i.useState)(null),[k,V]=(0,i.useState)(null),x=r??H??[],[I,S]=(0,i.useState)(""),[m,b]=(0,i.useState)("{}"),[u,F]=(0,i.useState)(""),[f,W]=(0,i.useState)(""),[v,p]=(0,i.useState)("idle"),[X,y]=(0,i.useState)(void 0),[C,N]=(0,i.useState)(null),[$,Y]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(r!==void 0)return;let t=!1;return c.listFunctions().then(d=>(t||Q(d),d)).catch(d=>{t||V(P(d))}),()=>{t=!0}},[c,r]);let j=I===""?x[0]?.path??"":I,n=x.find(t=>t.path===j),Z=s(async()=>{if(!n)return;let t;try{t=m.trim()===""?{}:JSON.parse(m)}catch(l){p("error"),y(void 0),N(a("Invalid JSON args: {message}",{message:l.message}));return}let d={__lunoraRef:n.path},R=u.trim()===""?{}:{shardKey:u.trim()},A=o?f.trim():"",J=s(l=>{Y(L=>[{argsText:m,at:Date.now(),id:(L[0]?.id??0)+1,kind:n.kind,path:n.path,shardKey:u,status:l},...L].slice(0,fe))},"A");p("running"),N(null);try{let l=A===""?await _(c,n.kind,d,t,R):await c.query(me,{args:t,functionPath:n.path,userId:A},R);U(u),y(l),p("success"),J("success")}catch(l){y(void 0),N(l.message),p("error"),J("error")}},"_"),ee=s(t=>{S(t.path),b(t.argsText),F(t.shardKey)},"q"),te=s(t=>{S(t.target.value)},"B"),re=s(t=>{b(t.target.value)},"D"),ae=s(t=>{W(t.target.value)},"E"),se=s(()=>{q(Z())},"U"),ne=s(()=>{b(ce(n?.args))},"X");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-function-runner",children:[k!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"function-discover-error",role:"alert",children:k}),(0,e.jsxs)("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(g,{htmlFor:"function-select",children:a("Function")}),(0,e.jsx)("select",{"aria-label":a("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"function-select",id:"function-select",onChange:te,value:j,children:x.map(t=>(0,e.jsxs)("option",{value:t.path,children:[t.path," (",t.kind,")"]},t.path))}),n!==void 0&&(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"mr-1.5 font-medium",children:a("Signature")}),(0,e.jsx)("code",{className:"font-mono","data-testid":"function-signature",children:le(n.args)})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(g,{htmlFor:"args-input",children:a("Arguments")}),(0,e.jsx)(h,{"data-testid":"prefill-button",disabled:n===void 0,onClick:ne,size:"xs",type:"button",variant:"ghost",children:a("Prefill")})]}),(0,e.jsx)(G,{"aria-label":a("Arguments"),className:"font-mono text-xs","data-testid":"args-input",id:"args-input",onChange:re,value:m})]}),(0,e.jsx)(B,{onChange:F,testId:"shard-input",value:u}),o&&(0,e.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"run-as-field",children:[(0,e.jsx)(g,{htmlFor:"run-as-input",children:a("Run as identity (userId)")}),(0,e.jsx)(O,{"aria-label":a("Run as identity (userId)"),className:"font-mono text-xs","data-testid":"run-as-input",id:"run-as-input",onChange:ae,placeholder:a("Leave empty to run as admin"),value:f}),(0,e.jsx)("p",{className:"text-[11px] text-muted-foreground",children:a("Dev only: runs the function as this user so you can test auth and RLS. Forged over the admin gate.")})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(h,{"data-testid":"run-button",disabled:v==="running"||n===void 0,onClick:se,type:"button",children:a("Run")}),n!==void 0&&(0,e.jsx)(w,{variant:"outline",children:n.kind}),o&&f.trim()!==""&&(0,e.jsx)(w,{"data-testid":"run-as-badge",variant:"secondary",children:a("as {userId}",{userId:f.trim()})})]})]}),v==="error"&&C!==null&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs text-destructive","data-testid":"error",role:"alert",children:C}),v==="success"&&(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"result",children:pe(X)}),$.length>0&&(0,e.jsx)("ul",{className:"flex flex-col overflow-hidden rounded-xl border border-border","data-testid":"fn-history",children:$.map((t,d)=>(0,e.jsxs)("li",{className:"flex flex-wrap items-center gap-2 border-b border-border px-3 py-2 text-sm last:border-b-0","data-testid":"fn-history-row",children:[(0,e.jsx)("span",{className:t.status==="success"?"text-success":"text-destructive","data-testid":`fn-history-status-${d.toString()}`,children:t.status==="success"?"\u2713":"\u2717"})," ",(0,e.jsxs)("span",{className:"font-mono text-xs",children:[t.path," (",t.kind,")"]})," ",(0,e.jsx)("time",{className:"text-xs text-muted-foreground",children:E(t.at)})," ",(0,e.jsx)(h,{className:"ml-auto","data-testid":`fn-history-load-${d.toString()}`,onClick:s(()=>{ee(t)},"onClick"),size:"xs",type:"button",variant:"ghost",children:a("Load")})]},t.id))})]})},"Ie");export{Fe as FunctionRunner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as y}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as v}from"./chunk-LJIFMW67.js";import"./chunk-XXQUMVWH.js";import"./chunk-QWBRD6PX.js";import"./chunk-QLQADHFE.js";import{a as R}from"./chunk-VDW32UET.js";import{c as $}from"./chunk-SHMNA6UL.js";import"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as w}from"./chunk-XQCVZAGU.js";import{a as A,b as I,c as j,d as x,e as n,f as c}from"./chunk-MIQTKZAR.js";import{a as k,e as S}from"./chunk-UZERI5YC.js";import{d as b}from"./chunk-OG4N2XHD.js";import"./chunk-XNGYYOLS.js";import{a as f,e as N,g as E,h as _}from"./chunk-3XIESWL4.js";var T=N(E(),1);var r=N(_(),1);var D=f((e,t)=>({delete:e("Delete"),list:e("List"),read:e("Read"),write:e("Write")})[t],"C"),C={delete:2,list:3,read:0,write:1},O=f(e=>[...e].toSorted((t,a)=>t.bucket.localeCompare(a.bucket)||C[t.on]-C[a.on]||(t.prefix??"").localeCompare(a.prefix??"")),"T"),W=f(()=>{let e=(0,T.c)(14),t=b(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];let{data:l,error:i,errorSource:d}=$(R.storageRules,a),h=l!==void 0,m;if(e[1]!==l||e[2]!==i||e[3]!==d||e[4]!==h||e[5]!==t){let g=O(Array.isArray(l?.rules)?l.rules:[]),u;e[7]!==i||e[8]!==d?(u=i!==null&&(0,r.jsx)(v,{error:d,testId:"storage-rules-error"}),e[7]=i,e[8]=d,e[9]=u):u=e[9];let o;e[10]!==t?(o=t("Storage rules are declared in code with defineStorageRule and gate ctx.storage access per bucket. This view is read-only."),e[10]=t,e[11]=o):o=e[11];let p;e[12]!==o?(p=(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"storage-rules-note",children:o}),e[12]=o,e[13]=p):p=e[13],m=(0,r.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-storage-rules-panel",children:[u,p,h&&g.length===0?(0,r.jsx)(w,{description:t("No defineStorageRule is wired through .use(storageRules(...)) in this deployment. Add one to gate object access by key prefix."),testId:"storage-rules-empty",title:t("No storage rules defined")}):(0,r.jsx)(k,{className:"overflow-hidden py-0",children:(0,r.jsx)(S,{className:"px-0",children:(0,r.jsxs)(A,{"data-testid":"storage-rules-table",children:[(0,r.jsx)(I,{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(n,{children:t("Bucket")}),(0,r.jsx)(n,{children:t("Operation")}),(0,r.jsx)(n,{children:t("Key prefix")}),(0,r.jsx)(n,{children:t("Guarded by")})]})}),(0,r.jsx)(j,{children:g.map(s=>(0,r.jsxs)(x,{"data-testid":`storage-rule-${s.bucket}-${s.on}-${s.prefix??""}`,children:[(0,r.jsx)(c,{className:"font-mono text-xs",children:s.bucket}),(0,r.jsx)(c,{children:(0,r.jsx)(y,{variant:"secondary",children:D(t,s.on)})}),(0,r.jsx)(c,{className:"font-mono text-xs",children:s.prefix??(0,r.jsx)("span",{className:"text-muted-foreground",children:t("(whole bucket)")})}),(0,r.jsx)(c,{className:"font-mono text-xs text-muted-foreground",children:s.procedure})]},`${s.bucket}:${s.on}:${s.prefix??""}:${s.procedure}`))})]})})})]}),e[1]=l,e[2]=i,e[3]=d,e[4]=h,e[5]=t,e[6]=m}else m=e[6];return m},"U");export{W as StorageRulesPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as We,b as De,c as Fe,d as Oe,e as be}from"./chunk-UU2QJMGJ.js";import"./chunk-2PJNAWB3.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as qe}from"./chunk-U6TNNM5U.js";import{a as Ve}from"./chunk-CTNB2KIA.js";import"./chunk-2QSHLBCO.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import"./chunk-QBWRC5YX.js";import{a as ze}from"./chunk-3CWGJYBB.js";import{a as _e}from"./chunk-X665E2HU.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as ke}from"./chunk-CFPZYHPY.js";import"./chunk-T6VMSOBB.js";import"./chunk-7QIFDWQV.js";import{c as ie}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as me}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import"./chunk-QLQADHFE.js";import{a as D}from"./chunk-VDW32UET.js";import{c as Te}from"./chunk-SHMNA6UL.js";import{f as Ne}from"./chunk-V2U5CL3S.js";import"./chunk-XBDKZZ67.js";import{a as Ce}from"./chunk-XQCVZAGU.js";import{a as Le,b as je,c as Re,d as pe,e as W,f as L}from"./chunk-MIQTKZAR.js";import{a as Me,e as Ae}from"./chunk-UZERI5YC.js";import{d as ue,f as le,g as we,h as Ke,m as re,q as Ee}from"./chunk-OG4N2XHD.js";import{a as Ie,b as $e}from"./chunk-XNGYYOLS.js";import{a as d,e as ye,f as Be,g as Ge,h as He}from"./chunk-3XIESWL4.js";var ge=ye(Ge(),1);var ne=ye(Be(),1);var t=ye(He(),1);var Se="none",Pe=["all","open","resolved","ignored"],Je=["critical","high","medium","low"],Qe=le(D.resolveIssue),Xe=le(D.ignoreIssue),Ue=le(D.assignIssue),Ye=le(D.setIssueSeverity),Ze=le(D.explainIssue),es=d(n=>Array.isArray(n?.issues)?n.issues:[],"Ye"),ss=d(n=>n==="resolved"?"success":n==="ignored"?"secondary":"warning","Ze"),ts=d(n=>n==="critical"?"destructive":n==="high"?"warning":n==="medium"?"info":"secondary","Pe"),as=d(n=>{let e=(0,ge.c)(44),{expanded:u,issue:s,shardKey:$}=n,i=Ne(),r=ue(),[a,o]=(0,ne.useState)(void 0),{busy:_,error:C,run:j}=qe(),K;e[0]!==i||e[1]!==s||e[2]!==j||e[3]!==$?(K=d(()=>{o(void 0),j(async()=>{let g={culprit:s.culprit,sampleMessage:s.sampleMessage,title:s.title},I=await i.query(Ze,g,we($));o(I)})},"K"),e[0]=i,e[1]=s,e[2]=j,e[3]=$,e[4]=K):K=e[4];let z=K;if(!u)return null;let k;if(e[5]!==s.sampleMessage){let g=$e(s.sampleMessage);k=g===void 0?void 0:Ie(g.body),e[5]=s.sampleMessage,e[6]=k}else k=e[6];let E=k,T=`issues-detail-${s.hash}`,h;e[7]!==s.sampleMessage?(h=(0,t.jsx)("p",{className:"whitespace-pre-wrap font-mono text-xs text-muted-foreground",children:s.sampleMessage}),e[7]=s.sampleMessage,e[8]=h):h=e[8];let x;e[9]!==r?(x=r("Suggested fix"),e[9]=r,e[10]=x):x=e[10];let M;e[11]!==x?(M=(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:x}),e[11]=x,e[12]=M):M=e[12];let v;e[13]!==E||e[14]!==s.hash||e[15]!==r?(v=E===void 0?(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":`issues-hint-empty-${s.hash}`,children:r("No known fix for this error yet.")}):(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm","data-testid":`issues-hint-${s.hash}`,children:E}),e[13]=E,e[14]=s.hash,e[15]=r,e[16]=v):v=e[16];let y;e[17]!==M||e[18]!==v?(y=(0,t.jsxs)("div",{children:[M,v]}),e[17]=M,e[18]=v,e[19]=y):y=e[19];let w=`issues-explain-${s.hash}`,b;e[20]!==_||e[21]!==r?(b=r(_?"Explaining\u2026":"Explain in plain language"),e[20]=_,e[21]=r,e[22]=b):b=e[22];let m;e[23]!==_||e[24]!==z||e[25]!==b||e[26]!==w?(m=(0,t.jsx)("div",{children:(0,t.jsx)(ie,{"data-testid":w,disabled:_,onClick:z,size:"sm",type:"button",variant:"outline",children:b})}),e[23]=_,e[24]=z,e[25]=b,e[26]=w,e[27]=m):m=e[27];let f;e[28]!==C||e[29]!==s.hash?(f=C!==null&&(0,t.jsx)("p",{className:"text-xs text-destructive","data-testid":`issues-explain-error-${s.hash}`,role:"alert",children:C}),e[28]=C,e[29]=s.hash,e[30]=f):f=e[30];let p;e[31]!==a||e[32]!==s.hash||e[33]!==r?(p=a!==void 0&&(a.degraded?(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":`issues-degraded-${s.hash}`,children:a.reason==="no-ai-binding"?r("No AI binding is configured. Wire an AI binding to enable plain-language explanations \u2014 the suggested fix above is always available."):r("The AI model could not explain this error right now. The suggested fix above still applies.")}):(0,t.jsxs)("div",{"data-testid":`issues-explanation-${s.hash}`,children:[(0,t.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:r("AI explanation")}),(0,t.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm",children:a.explanation}),a.groundedId===void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":`issues-ungrounded-${s.hash}`,children:r("No catalog fix matched this error, so this explanation is the model's own reading of the message. Verify before acting on it.")}),(0,t.jsx)("p",{className:"mt-1 text-[0.7rem] text-muted-foreground",children:r("Generated by {model}",{model:a.model})})]})),e[31]=a,e[32]=s.hash,e[33]=r,e[34]=p):p=e[34];let c;e[35]!==m||e[36]!==f||e[37]!==p||e[38]!==h||e[39]!==y?(c=(0,t.jsx)(L,{className:"bg-muted/30",colSpan:7,children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 py-1",children:[h,y,m,f,p]})}),e[35]=m,e[36]=f,e[37]=p,e[38]=h,e[39]=y,e[40]=c):c=e[40];let S;return e[41]!==c||e[42]!==T?(S=(0,t.jsx)(pe,{"data-testid":T,children:c}),e[41]=c,e[42]=T,e[43]=S):S=e[43],S},"es"),is=d(n=>{let e=(0,ge.c)(119),{busy:u,issue:s,rowError:$,runTriage:i,shardKey:r}=n,a=ue(),[o,_]=(0,ne.useState)(!1),C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=d(()=>{_(ls)},"C"),e[0]=C):C=e[0];let j=C,K;e[1]!==s.hash||e[2]!==i?(K=d(ae=>{let ce=ae===null||ae===Se?null:ae;re(i(s.hash,Ye,{severity:ce}))},"K"),e[1]=s.hash,e[2]=i,e[3]=K):K=e[3];let z=K,k;e[4]!==s.hash||e[5]!==i?(k=d(ae=>{if(ae.key!=="Enter")return;let ce=ae.currentTarget.value.trim();re(i(s.hash,Ue,{assignee:ce===""?null:ce}))},"k"),e[4]=s.hash,e[5]=i,e[6]=k):k=e[6];let E=k,T=`issues-row-${s.hash}`,h;e[7]!==a?(h=a("Toggle issue details"),e[7]=a,e[8]=h):h=e[8];let x=`issues-toggle-${s.hash}`,M=`mt-1 size-3 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(0,t.jsx)("path",{d:"m9 6 6 6-6 6"}),e[9]=v):v=e[9];let y;e[10]!==M?(y=(0,t.jsx)("svg",{"aria-hidden":"true",className:M,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:v}),e[10]=M,e[11]=y):y=e[11];let w;e[12]!==s.title?(w=(0,t.jsx)("span",{className:"block truncate font-medium",title:s.title,children:s.title}),e[12]=s.title,e[13]=w):w=e[13];let b;e[14]!==s.culprit?(b=(0,t.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit}),e[14]=s.culprit,e[15]=b):b=e[15];let m;e[16]!==w||e[17]!==b?(m=(0,t.jsxs)("span",{className:"min-w-0",children:[w,b]}),e[16]=w,e[17]=b,e[18]=m):m=e[18];let f;e[19]!==o||e[20]!==m||e[21]!==h||e[22]!==x||e[23]!==y?(f=(0,t.jsxs)("button",{"aria-expanded":o,"aria-label":h,className:"flex w-full items-start gap-2 text-left","data-testid":x,onClick:j,type:"button",children:[y,m]}),e[19]=o,e[20]=m,e[21]=h,e[22]=x,e[23]=y,e[24]=f):f=e[24];let p;e[25]!==s.hash||e[26]!==$?(p=$!==void 0&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive","data-testid":`issues-action-error-${s.hash}`,role:"alert",children:$}),e[25]=s.hash,e[26]=$,e[27]=p):p=e[27];let c;e[28]!==f||e[29]!==p?(c=(0,t.jsxs)(L,{className:"max-w-80",children:[f,p]}),e[28]=f,e[29]=p,e[30]=c):c=e[30];let S=`issues-status-${s.hash}`,g;e[31]!==s.status?(g=ss(s.status),e[31]=s.status,e[32]=g):g=e[32];let I;e[33]!==s.status||e[34]!==S||e[35]!==g?(I=(0,t.jsx)(L,{children:(0,t.jsx)(me,{"data-testid":S,variant:g,children:s.status})}),e[33]=s.status,e[34]=S,e[35]=g,e[36]=I):I=e[36];let R=s.severity??Se,l;e[37]!==a?(l=a("Set severity"),e[37]=a,e[38]=l):l=e[38];let oe=`issues-severity-${s.hash}`,q;e[39]!==a?(q=a("\u2014"),e[39]=a,e[40]=q):q=e[40];let N;e[41]!==s.severity||e[42]!==a?(N=s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(me,{variant:ts(s.severity),children:s.severity}),e[41]=s.severity,e[42]=a,e[43]=N):N=e[43];let A;e[44]!==q||e[45]!==N?(A=(0,t.jsx)(De,{placeholder:q,children:N}),e[44]=q,e[45]=N,e[46]=A):A=e[46];let V;e[47]!==l||e[48]!==oe||e[49]!==A?(V=(0,t.jsx)(Fe,{"aria-label":l,className:"h-7 w-[110px]","data-testid":oe,children:A}),e[47]=l,e[48]=oe,e[49]=A,e[50]=V):V=e[50];let de;e[51]===Symbol.for("react.memo_cache_sentinel")?(de=Je.map(rs),e[51]=de):de=e[51];let F;e[52]!==a?(F=a("Clear"),e[52]=a,e[53]=F):F=e[53];let O;e[54]!==F?(O=(0,t.jsxs)(Oe,{children:[de,(0,t.jsx)(be,{value:Se,children:F})]}),e[54]=F,e[55]=O):O=e[55];let U;e[56]!==u||e[57]!==z||e[58]!==R||e[59]!==V||e[60]!==O?(U=(0,t.jsx)(L,{children:(0,t.jsxs)(We,{disabled:u,onValueChange:z,value:R,children:[V,O]})}),e[56]=u,e[57]=z,e[58]=R,e[59]=V,e[60]=O,e[61]=U):U=e[61];let B;e[62]!==a?(B=a("Assignee"),e[62]=a,e[63]=B):B=e[63];let fe=`issues-assignee-${s.hash}`,xe=s.assignee??"",ve=s.assignee??"",G;e[64]!==a?(G=a("Unassigned"),e[64]=a,e[65]=G):G=e[65];let H;e[66]!==u||e[67]!==E||e[68]!==B||e[69]!==fe||e[70]!==xe||e[71]!==ve||e[72]!==G?(H=(0,t.jsx)(L,{children:(0,t.jsx)(ke,{"aria-label":B,className:"h-7 w-32","data-testid":fe,defaultValue:xe,disabled:u,onKeyDown:E,placeholder:G},ve)}),e[66]=u,e[67]=E,e[68]=B,e[69]=fe,e[70]=xe,e[71]=ve,e[72]=G,e[73]=H):H=e[73];let P;e[74]!==s.count?(P=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsx)(me,{variant:"secondary",children:s.count})}),e[74]=s.count,e[75]=P):P=e[75];let J;e[76]!==s.lastSeen?(J=Ee(s.lastSeen),e[76]=s.lastSeen,e[77]=J):J=e[77];let Q;e[78]!==J?(Q=(0,t.jsx)(L,{className:"text-xs tabular-nums text-muted-foreground",children:J}),e[78]=J,e[79]=Q):Q=e[79];let X;e[80]!==u||e[81]!==s.hash||e[82]!==s.status||e[83]!==i||e[84]!==a?(X=s.status!=="resolved"&&(0,t.jsx)(ie,{"data-testid":`issues-resolve-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Qe,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),e[80]=u,e[81]=s.hash,e[82]=s.status,e[83]=i,e[84]=a,e[85]=X):X=e[85];let Y;e[86]!==u||e[87]!==s.hash||e[88]!==s.status||e[89]!==i||e[90]!==a?(Y=s.status!=="ignored"&&(0,t.jsx)(ie,{"data-testid":`issues-ignore-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Xe,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),e[86]=u,e[87]=s.hash,e[88]=s.status,e[89]=i,e[90]=a,e[91]=Y):Y=e[91];let Z;e[92]!==u||e[93]!==s.assignee||e[94]!==s.hash||e[95]!==s.status||e[96]!==i||e[97]!==a?(Z=s.status!=="open"&&(0,t.jsx)(ie,{"data-testid":`issues-reopen-${s.hash}`,disabled:u,onClick:d(()=>{re(i(s.hash,Ue,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")}),e[92]=u,e[93]=s.assignee,e[94]=s.hash,e[95]=s.status,e[96]=i,e[97]=a,e[98]=Z):Z=e[98];let ee;e[99]!==X||e[100]!==Y||e[101]!==Z?(ee=(0,t.jsx)(L,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[X,Y,Z]})}),e[99]=X,e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let se;e[103]!==c||e[104]!==I||e[105]!==U||e[106]!==H||e[107]!==P||e[108]!==Q||e[109]!==T||e[110]!==ee?(se=(0,t.jsxs)(pe,{"data-testid":T,children:[c,I,U,H,P,Q,ee]}),e[103]=c,e[104]=I,e[105]=U,e[106]=H,e[107]=P,e[108]=Q,e[109]=T,e[110]=ee,e[111]=se):se=e[111];let te;e[112]!==o||e[113]!==s||e[114]!==r?(te=(0,t.jsx)(as,{expanded:o,issue:s,shardKey:r},s.sampleMessage),e[112]=o,e[113]=s,e[114]=r,e[115]=te):te=e[115];let he;return e[116]!==se||e[117]!==te?(he=(0,t.jsxs)(t.Fragment,{children:[se,te]}),e[116]=se,e[117]=te,e[118]=he):he=e[118],he},"ss"),ks=d(n=>{let e=(0,ge.c)(38),{initialShardKey:u}=n,s=ue(),$=Ne(),{queryShardKey:i,setShardKey:r,shardKey:a}=ze(u),[o,_]=(0,ne.useState)("all"),[C,j]=(0,ne.useState)(ns),[K,z]=(0,ne.useState)(os),k;e[0]!==o?(k=o==="all"?{}:{status:o},e[0]=o,e[1]=k):k=e[1];let E;e[2]!==i?(E={live:!0,shardKey:i},e[2]=i,e[3]=E):E=e[3];let{data:T,error:h,liveError:x}=Te(D.getIssues,k,E),M=T!==void 0,v;if(e[4]!==K||e[5]!==C||e[6]!==$||e[7]!==T||e[8]!==h||e[9]!==x||e[10]!==M||e[11]!==i||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==s){let y=es(T),w;e[17]!==$||e[18]!==i?(w=d(async(l,oe,q)=>{z(N=>{if(!N.has(l))return N;let A=new Map(N);return A.delete(l),A}),j(N=>new Set(N).add(l));try{await $.query(oe,{...q,hash:l},we(i))}catch(N){let A=Ke(N);z(V=>new Map(V).set(l,A))}j(N=>{let A=new Set(N);return A.delete(l),A})},"N"),e[17]=$,e[18]=i,e[19]=w):w=e[19];let b=w,m;e[20]!==s?(m=d(l=>s(l==="all"?"All":l==="open"?"Open":l==="resolved"?"Resolved":"Ignored"),"u"),e[20]=s,e[21]=m):m=e[21];let f=m,p;e[22]!==h?(p=h!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:h}),e[22]=h,e[23]=p):p=e[23];let c;e[24]!==r||e[25]!==a?(c=(0,t.jsx)(_e,{onChange:r,testId:"issues-shard-input",value:a}),e[24]=r,e[25]=a,e[26]=c):c=e[26];let S;e[27]!==x?(S=(0,t.jsx)(Ve,{message:x,prefix:"issues"}),e[27]=x,e[28]=S):S=e[28];let g;e[29]!==o||e[30]!==f?(g=Pe.map(l=>(0,t.jsx)(ie,{"data-active":o===l?"":void 0,"data-testid":`issues-filter-${l}`,onClick:d(()=>{_(l)},"onClick"),size:"xs",variant:o===l?"default":"outline",children:f(l)},l)),e[29]=o,e[30]=f,e[31]=g):g=e[31];let I;e[32]!==g?(I=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:g}),e[32]=g,e[33]=I):I=e[33];let R;e[34]!==I||e[35]!==c||e[36]!==S?(R=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[c,S,I]}),e[34]=I,e[35]=c,e[36]=S,e[37]=R):R=e[37],v=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[p,R,M&&y.length===0?(0,t.jsx)(Ce,{description:s("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:s("No issues")}):(0,t.jsx)(Me,{className:"overflow-hidden py-0",children:(0,t.jsx)(Ae,{className:"px-0",children:(0,t.jsxs)(Le,{"data-testid":"issues-table",children:[(0,t.jsx)(je,{children:(0,t.jsxs)(pe,{children:[(0,t.jsx)(W,{children:s("Issue")}),(0,t.jsx)(W,{children:s("Status")}),(0,t.jsx)(W,{children:s("Severity")}),(0,t.jsx)(W,{children:s("Assignee")}),(0,t.jsx)(W,{className:"text-right",children:s("Events")}),(0,t.jsx)(W,{children:s("Last seen")}),(0,t.jsx)(W,{className:"text-right",children:s("Actions")})]})}),(0,t.jsx)(Re,{children:y.map(l=>(0,t.jsx)(is,{busy:C.has(l.hash),issue:l,rowError:K.get(l.hash),runTriage:b,shardKey:i},l.hash))})]})})})]}),e[4]=K,e[5]=C,e[6]=$,e[7]=T,e[8]=h,e[9]=x,e[10]=M,e[11]=i,e[12]=r,e[13]=a,e[14]=o,e[15]=s,e[16]=v}else v=e[16];return v},"ks");function ls(n){return!n}d(ls,"ts");function rs(n){return(0,t.jsx)(be,{value:n,children:n},n)}d(rs,"as");function ns(){return new Set}d(ns,"is");function os(){return new Map}d(os,"rs");export{ks as IssuesPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u}from"./chunk-UZERI5YC.js";import{a as x,e as f,g as h,h as N}from"./chunk-3XIESWL4.js";var b=f(h(),1);var t=f(N(),1);var v=x(g=>{let e=(0,b.c)(16),{chart:c,footer:n,label:i,testId:m,value:p}=g,r;e[0]!==i?(r=(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i}),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==m||e[3]!==p?(a=(0,t.jsx)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":m,children:p}),e[2]=m,e[3]=p,e[4]=a):a=e[4];let s;e[5]!==c||e[6]!==a?(s=(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[5]=c,e[6]=a,e[7]=s):s=e[7];let l;e[8]!==r||e[9]!==s?(l=(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 p-4",children:[r,s]}),e[8]=r,e[9]=s,e[10]=l):l=e[10];let o;e[11]!==n?(o=n!=null&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:n}),e[11]=n,e[12]=o):o=e[12];let d;return e[13]!==l||e[14]!==o?(d=(0,t.jsxs)(u,{className:"justify-between gap-0 py-0",children:[l,o]}),e[13]=l,e[14]=o,e[15]=d):d=e[15],d},"j");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,e as v,g as j,h as I,j as k}from"./chunk-3XIESWL4.js";var y=v(j(),1);var h=v(I(),1);var z={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"},C={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=i(N=>{let e=(0,y.c)(18),{className:n,children:c,label:b,onClose:r,panelTestId:f,testId:g,variant:u}=N,o;e[0]!==r?(o=i(s=>{s.target===s.currentTarget&&r()},"t"),e[0]=r,e[1]=o):o=e[1];let m=o,t;e[2]!==r?(t=i(s=>{s.key==="Escape"&&r()},"a"),e[2]=r,e[3]=t):t=e[3];let p=t,x=z[u],w=C[u],l;e[4]!==n||e[5]!==w?(l=k(w,n),e[4]=n,e[5]=w,e[6]=l):l=e[6];let a;e[7]!==c||e[8]!==b||e[9]!==f||e[10]!==l?(a=(0,h.jsx)("div",{"aria-label":b,className:l,"data-testid":f,role:"dialog",children:c}),e[7]=c,e[8]=b,e[9]=f,e[10]=l,e[11]=a):a=e[11];let d;return e[12]!==m||e[13]!==p||e[14]!==x||e[15]!==a||e[16]!==g?(d=(0,h.jsx)("div",{className:x,"data-testid":g,onClick:m,onKeyDown:p,role:"presentation",children:a}),e[12]=m,e[13]=p,e[14]=x,e[15]=a,e[16]=g,e[17]=d):d=e[17],d},"I");export{D as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,e as m,f as T,g as b}from"./chunk-3XIESWL4.js";var f=m(b(),1),r=m(T(),1);var x=i(function(t,n,s){let e=(0,f.c)(4),u=n===void 0?300:n,[d,o]=(0,r.useState)(t),[l,p]=(0,r.useState)(s);s!==void 0&&s!==l&&(p(s),o(t));let a,c;return e[0]!==u||e[1]!==t?(a=i(()=>{let v=setTimeout(()=>{o(t)},u);return()=>{clearTimeout(v)}},"u"),c=[t,u],e[0]=u,e[1]=t,e[2]=a,e[3]=c):(a=e[2],c=e[3]),(0,r.useEffect)(a,c),d},"b");export{x as a};
|