@lunora/studio 1.0.0-alpha.6 → 1.0.0-alpha.60
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 +762 -779
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- 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/MigrationsPanel.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 +2 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +4 -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/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-BYNSbBVE.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
- package/dist/packem_shared/CommandPalette-CVIaY3j8.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-B8J5lHjP.js +1 -0
- package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
- package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
- package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-DaCX9Jy5.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-bRPJhby-.d.ts +254 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-AryFCeoa.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-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
- package/dist/packem_shared/data-view-params-C8T3bW1z.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-B59DnrDI.js +1 -0
- package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
- package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CGW2JHf_.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/reference-view-KvhektwF.js +12 -0
- package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -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-DtcZoU48.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.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-Di3fLE8H.js +1 -0
- package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.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-23HKRH5H.js +13 -0
- package/dist/standalone/chunk-2A4RKII2.js +1 -0
- package/dist/standalone/chunk-3DTM4GI5.js +1 -0
- package/dist/standalone/chunk-3MHKT76P.js +1 -0
- package/dist/standalone/chunk-46IB4C4Q.js +1 -0
- package/dist/standalone/chunk-4AYEV5UN.js +1 -0
- package/dist/standalone/chunk-4FNHHFWR.js +1 -0
- package/dist/standalone/chunk-6CLVIOCB.js +1 -0
- package/dist/standalone/chunk-6I62RSI5.js +1 -0
- package/dist/standalone/chunk-6OKDCV7J.js +1 -0
- package/dist/standalone/chunk-6P7HIPUE.js +1 -0
- package/dist/standalone/chunk-6UYILUSX.js +1 -0
- package/dist/standalone/chunk-725RLB7D.js +1 -0
- package/dist/standalone/chunk-7AZZ7OJO.js +1 -0
- package/dist/standalone/chunk-7CRLAMGB.js +1 -0
- package/dist/standalone/chunk-7Z5QEFR4.js +2 -0
- package/dist/standalone/chunk-AGVJJQFL.js +1 -0
- package/dist/standalone/chunk-AKTGRZXN.js +1 -0
- package/dist/standalone/chunk-BAIN7UJ4.js +1 -0
- package/dist/standalone/chunk-BHWSIIDT.js +1 -0
- package/dist/standalone/chunk-C4O5UR4Y.js +1 -0
- package/dist/standalone/chunk-C4VURT57.js +1 -0
- package/dist/standalone/chunk-CKO3F55C.js +4 -0
- package/dist/standalone/chunk-CVMRZUF5.js +4 -0
- package/dist/standalone/chunk-CWWGDW4V.js +1 -0
- package/dist/standalone/chunk-CYET4BRZ.js +1 -0
- package/dist/standalone/chunk-CZEUVNCQ.js +1 -0
- package/dist/standalone/chunk-FXFK4M4E.js +1 -0
- package/dist/standalone/chunk-FYAJPWE7.js +1 -0
- package/dist/standalone/chunk-GS7OBQO5.js +1 -0
- package/dist/standalone/chunk-GTXVH7I5.js +1 -0
- package/dist/standalone/chunk-GXZAXNZI.js +1 -0
- package/dist/standalone/chunk-H6SIM4BT.js +1 -0
- package/dist/standalone/chunk-H6WOFY6A.js +8 -0
- package/dist/standalone/chunk-HA34GYEX.js +1 -0
- package/dist/standalone/chunk-HMIOF5GV.js +1 -0
- package/dist/standalone/chunk-HY46NTNW.js +6 -0
- package/dist/standalone/chunk-IBCKC2BO.js +1 -0
- package/dist/standalone/chunk-ICKBVXPP.js +1 -0
- package/dist/standalone/chunk-IE4ROTQD.js +1 -0
- package/dist/standalone/chunk-IYYTWZ2E.js +2 -0
- package/dist/standalone/chunk-J2LMP2A7.js +1 -0
- package/dist/standalone/chunk-JC6WYIHM.js +1 -0
- package/dist/standalone/chunk-JKPK25JO.js +1 -0
- package/dist/standalone/chunk-JLFCXBNQ.js +1 -0
- package/dist/standalone/chunk-JRWBGR5B.js +1 -0
- package/dist/standalone/chunk-K5PFWU5J.js +1 -0
- package/dist/standalone/chunk-KJTLW5W2.js +11 -0
- package/dist/standalone/chunk-KLLYGWNF.js +19 -0
- package/dist/standalone/chunk-KNN3ZEQ7.js +1 -0
- package/dist/standalone/chunk-KOC5KV3E.js +1 -0
- package/dist/standalone/chunk-KSRXMTBV.js +1 -0
- package/dist/standalone/chunk-KYCAYNXM.js +1 -0
- package/dist/standalone/chunk-KZ2YUNMR.js +1 -0
- package/dist/standalone/chunk-LKHUVEHX.js +1 -0
- package/dist/standalone/chunk-LPOKAJT4.js +4 -0
- package/dist/standalone/chunk-MZEK4SGD.js +1 -0
- package/dist/standalone/chunk-NCCUM26H.js +1 -0
- package/dist/standalone/chunk-O62HJZV3.js +1 -0
- package/dist/standalone/chunk-OTJOI23O.js +62 -0
- package/dist/standalone/chunk-P2NBOUGZ.js +1 -0
- package/dist/standalone/chunk-P4J6XNG3.js +1 -0
- package/dist/standalone/chunk-PGDWFWH5.js +1 -0
- package/dist/standalone/chunk-PR2SE2MD.js +1 -0
- package/dist/standalone/chunk-PTTDIYGP.js +1 -0
- package/dist/standalone/chunk-PWDMXMRD.js +1 -0
- package/dist/standalone/chunk-Q34MSC2F.js +1 -0
- package/dist/standalone/chunk-Q5WXTZWX.js +1 -0
- package/dist/standalone/chunk-QC5HCNJZ.js +4 -0
- package/dist/standalone/chunk-QJKRHZYV.js +1 -0
- package/dist/standalone/chunk-R43KHQDA.js +1 -0
- package/dist/standalone/chunk-RC2K5RBE.js +1 -0
- package/dist/standalone/chunk-RE6UWCMG.js +1 -0
- package/dist/standalone/chunk-RUP3M2GF.js +3 -0
- package/dist/standalone/chunk-SA6MBPBL.js +1 -0
- package/dist/standalone/chunk-SEDZDNQF.js +1 -0
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SKJZDOHG.js +1 -0
- package/dist/standalone/chunk-SNDYNCAA.js +1 -0
- package/dist/standalone/chunk-SZUHZ2OG.js +1 -0
- package/dist/standalone/chunk-TAE2H7PU.js +1 -0
- package/dist/standalone/chunk-TEIBKU46.js +1 -0
- package/dist/standalone/chunk-TO6NLVFD.js +1 -0
- package/dist/standalone/chunk-TYTJDFX2.js +1 -0
- package/dist/standalone/chunk-UDZY7MKE.js +13 -0
- package/dist/standalone/chunk-UHHTEBC3.js +1 -0
- package/dist/standalone/chunk-UNDFOYRI.js +1 -0
- package/dist/standalone/chunk-UNN4CESU.js +1 -0
- package/dist/standalone/chunk-UNXX5GQH.js +1 -0
- package/dist/standalone/chunk-UREY4GLG.js +1 -0
- package/dist/standalone/chunk-UWF5DOGV.js +1 -0
- package/dist/standalone/chunk-UY2Y5CXB.js +1 -0
- package/dist/standalone/chunk-UZYGEOWY.js +1 -0
- package/dist/standalone/chunk-V66TSUKV.js +1 -0
- package/dist/standalone/chunk-VEFNSN7P.js +1 -0
- package/dist/standalone/chunk-VUJGR4PB.js +1 -0
- package/dist/standalone/chunk-VUXJER3D.js +1 -0
- package/dist/standalone/chunk-W572365D.js +1 -0
- package/dist/standalone/chunk-WYFLGXZ3.js +3 -0
- package/dist/standalone/chunk-XDKFPBIL.js +1 -0
- package/dist/standalone/chunk-XRKCGQM2.js +1 -0
- package/dist/standalone/chunk-YNBJ6ICE.js +1 -0
- package/dist/standalone/chunk-YQ5PILIJ.js +1 -0
- package/dist/standalone/chunk-YT7VXQVX.js +1 -0
- package/dist/standalone/chunk-Z7MUQMLE.js +1 -0
- package/dist/standalone/chunk-ZFWEPGWG.js +1 -0
- package/dist/standalone/chunk-ZMFZRGAN.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +17 -15
- package/dist/packem_shared/ADMIN_FUNCTIONS-DmBqMZ-z.js +0 -45
- package/dist/packem_shared/ApiDocsPanel-C5-yJ1p7.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-W3no0KOj.js +0 -251
- package/dist/packem_shared/AuditPanel-Bq4o_IqT.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-CtBe1So9.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-dxY56TDF.js +0 -193
- package/dist/packem_shared/FileBrowser-Dhy4zES8.js +0 -2932
- package/dist/packem_shared/FunctionRunner--fQJRPAD.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BjRUA_G3.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-PxclMWmA.js +0 -640
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/InsightsPanel-CWS_C-xW.js +0 -423
- package/dist/packem_shared/LogsPanel-CTW8CFcM.js +0 -839
- package/dist/packem_shared/MailPanel-BwkvfIHF.js +0 -447
- package/dist/packem_shared/MetricsPanel-BLuOhZQ4.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-DT3lnwHF.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CdErL7EJ.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-LJDcmNIO.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-C_ETsPih.js +0 -79
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
- package/dist/packem_shared/StudioApp-D4azxYBu.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-ChfUOZec.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-CCmwDEVs.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-BFRpzj6r.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
- 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 Nt,b as Ve,c as dt,d as gt,e as Tt,f as dr}from"./chunk-HA34GYEX.js";import{a as ar,b as cr,c as ur,d as pr,e as mr}from"./chunk-PR2SE2MD.js";import{a as fr}from"./chunk-CZEUVNCQ.js";import{A as _o,B as Uo,C as ko,D as P,G as a,H as Fo,L as Bo,Z as Ho,a as Eo,ca as jo,d as wo,da as zo,ha as Wo,ia as Go,ja as mt,k as Ht,la as qo,ma as $o,n as Vo,oa as Ko,pa as Jo,q as Oo,qa as Zo,ra as Qo,ta as er,ua as tr,va as or,wa as rr,x as Do,y as Lo}from"./chunk-PWDMXMRD.js";import{a as To,b as Xo}from"./chunk-YNBJ6ICE.js";import{a as Po,b as Mo,c as Yo}from"./chunk-C4O5UR4Y.js";import{a as nr,b as sr,i as lr,j as ir,k as At}from"./chunk-KOC5KV3E.js";import{C as pt,F as Ao,I as _e,K as Xe,L as ft,M as ro,N as No,O as ge,P as xe,a as Ut,b as ut,c as Ro,e as bo,f as yo,g as Ft,h as Ct,i as Io,p as Bt,y as vo,z as Co}from"./chunk-7Z5QEFR4.js";import{b as jt}from"./chunk-UY2Y5CXB.js";import{a as ee,c as de,e as kt}from"./chunk-ZFWEPGWG.js";import{a as wt,c as je,d as So,e as ho,h as oo,i as xo,j as O}from"./chunk-4FNHHFWR.js";import{a as r,d as mn,e as I,f as _,g as dn,h as Me,j as ot}from"./chunk-UHHTEBC3.js";var Ot=I(dn(),1),Ec=I(_(),1);var me={};mn(me,{Arrow:()=>Zr,Backdrop:()=>kr,Group:()=>cn,GroupLabel:()=>pn,Icon:()=>Or,Item:()=>qr,ItemIndicator:()=>Xr,ItemText:()=>Kr,Label:()=>Nr,List:()=>Gr,Popup:()=>zr,Portal:()=>_r,Positioner:()=>Fr,Root:()=>Er,ScrollDownArrow:()=>on,ScrollUpArrow:()=>sn,Separator:()=>fr,Trigger:()=>Tr,Value:()=>Mr});var j=I(_(),1);var St=I(_(),1);var no=St.createContext(null),so=St.createContext(null);function U(){let e=St.useContext(no);if(e===null)throw new Error(je(60));return e}r(U,"useSelectRootContext");function zt(){let e=St.useContext(so);if(e===null)throw new Error(je(61));return e}r(zt,"useSelectFloatingContext");var gr=r((e,t)=>Object.is(e,t),"defaultItemEquality");function Ue(e,t,o){return e==null||t==null?Object.is(e,t):o(e,t)}r(Ue,"compareItemEquality");function Sr(e,t,o){return!e||e.length===0?!1:e.some(n=>n===void 0?!1:Ue(t,n,o))}r(Sr,"selectedValueIncludes");function rt(e,t,o){return!e||e.length===0?-1:e.findIndex(n=>n===void 0?!1:Ue(n,t,o))}r(rt,"findItemIndex");function hr(e,t,o){return e.filter(n=>!Ue(t,n,o))}r(hr,"removeItem");var xr=I(_(),1);function Wt(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}r(Wt,"serializeValue");var Rr=I(Me(),1);function br(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}r(br,"isGroupedItems");function yr(e){if(!Array.isArray(e))return e!=null&&"null"in e;let t=e;if(br(t)){for(let o of t)for(let n of o.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(let o of t)if(o&&o.value==null&&o.label!=null)return!0;return!1}r(yr,"hasNullItemLabel");function lo(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Wt(e)}r(lo,"stringifyAsLabel");function ze(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Wt(e.value):Wt(e)}r(ze,"stringifyAsValue");function io(e,t,o){function n(){return lo(e,o)}if(r(n,"fallback"),o&&e!=null)return o(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??n();if(Array.isArray(t)){let l=t,c=br(l)?l.flatMap(s=>s.items):l;if(e==null||typeof e!="object"){let s=c.find(m=>m.value===e);return s&&s.label!=null?s.label:n()}if("value"in e){let s=c.find(m=>m&&m.value===e.value);if(s&&s.label!=null)return s.label}}return n()}r(io,"resolveSelectedLabel");function Ir(e,t,o){return e.reduce((n,l,c)=>(c>0&&n.push(", "),n.push((0,Rr.jsx)(xr.Fragment,{children:io(l,t,o)},c)),n),[])}r(Ir,"resolveMultipleLabels");var i={id:P(e=>e.id),labelId:P(e=>e.labelId),modal:P(e=>e.modal),multiple:P(e=>e.multiple),items:P(e=>e.items),itemToStringLabel:P(e=>e.itemToStringLabel),itemToStringValue:P(e=>e.itemToStringValue),isItemEqualToValue:P(e=>e.isItemEqualToValue),value:P(e=>e.value),hasSelectedValue:P(e=>{let{value:t,multiple:o,itemToStringValue:n}=e;return t==null?!1:o&&Array.isArray(t)?t.length>0:ze(t,n)!==""}),hasNullItemLabel:P((e,t)=>t?yr(e.items):!1),open:P(e=>e.open),mounted:P(e=>e.mounted),forceMount:P(e=>e.forceMount),transitionStatus:P(e=>e.transitionStatus),openMethod:P(e=>e.openMethod),activeIndex:P(e=>e.activeIndex),selectedIndex:P(e=>e.selectedIndex),isActive:P((e,t)=>e.activeIndex===t),isSelected:P((e,t)=>{let o=e.isItemEqualToValue,n=e.value;return e.multiple?Array.isArray(n)&&n.some(l=>Ue(t,l,o)):Ue(t,n,o)}),isSelectedByFocus:P((e,t)=>e.selectedIndex===t),popupProps:P(e=>e.popupProps),triggerProps:P(e=>e.triggerProps),triggerElement:P(e=>e.triggerElement),positionerElement:P(e=>e.positionerElement),listElement:P(e=>e.listElement),popupSide:P(e=>e.popupSide),scrollUpArrowVisible:P(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:P(e=>e.scrollDownArrowVisible),hasScrollArrows:P(e=>e.hasScrollArrows)};function vr(e,t,o=(n,l)=>n===l){return e.length===t.length&&e.every((n,l)=>o(n,t[l]))}r(vr,"areArraysEqual");var ht=I(Me(),1);function Er(e){let{id:t,value:o,defaultValue:n=null,onValueChange:l,open:c,defaultOpen:s=!1,onOpenChange:m,name:p,form:f,autoComplete:g,disabled:h=!1,readOnly:R=!1,required:v=!1,modal:C=!0,actionsRef:k,inputRef:x,onOpenChangeComplete:J,items:B,multiple:A=!1,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M=gr,highlightItemOnHover:ae=!0,children:te}=e,{clearErrors:$}=Ro(),{setDirty:se,setTouched:Se,setFocused:Re,validityData:z,setFilled:X,name:D,disabled:ce,validation:N,validationMode:Z}=ut(),H=Ft({id:t}),V=ce||h,u=D??p,[S,le]=ro({controlled:o,default:A?n??oo:n,name:"Select",state:"value"}),[F,be]=ro({controlled:c,default:s,name:"Select",state:"open"}),he=j.useRef([]),d=j.useRef([]),w=j.useRef(null),ue=j.useRef(null),Ae=j.useRef(0),T=j.useRef(null),K=j.useRef([]),W=j.useRef(!1),Ie=j.useRef(null),ie=j.useRef(null),pe=j.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=j.useRef(!1),{mounted:oe,setMounted:Ne,transitionStatus:Q}=ft(F),{openMethod:G,triggerProps:re}=qo(F),y=So(()=>new Fo({id:H,labelId:void 0,modal:C,multiple:A,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M,value:S,open:F,mounted:oe,transitionStatus:Q,items:B,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,We=a(y,i.activeIndex),Te=a(y,i.selectedIndex),Oe=a(y,i.triggerElement),ke=a(y,i.positionerElement),Ge=rr(G),Je=G??Ge??null,It=j.useMemo(()=>A?"":ze(S,L),[A,S,L]),Fe=j.useMemo(()=>A&&Array.isArray(S)?S.map(E=>ze(E,L)):ze(S,L),[A,S,L]),Ze=Ht(y.state.triggerElement),ne=de(()=>Fe);No(Ze,H,S,ne,!V,p);let Be=j.useRef(S),He=A?Array.isArray(S)&&S.length>0:S!=null&&ze(S,L)!=="";ee(()=>{S!==Be.current&&y.set("forceMount",!0)},[y,S]),ee(()=>{X(He)},[He,X]),ee(r(function(){let Y=K.current,ve;if(A){let ye=Array.isArray(S)?S:[];if(ye.length===0)ve=null;else{let $e=ye[ye.length-1],tt=rt(Y,$e,M);ve=tt===-1?null:tt}}else{let ye=rt(Y,S,M);ve=ye===-1?null:ye}ve===null&&(ie.current=null),!F&&y.set("selectedIndex",ve)},"syncSelectedIndex"),[He,A,F,S,K,M,y,ie]);function De(E){let Y=z.initialValue;return Array.isArray(E)&&Array.isArray(Y)?!vr(E,Y,(ve,ye)=>Ue(ve,ye,M)):E!==Y}r(De,"isSelectedValueDirty"),Yo(S,()=>{$(u),se(De(S)),N.change(S)});let st=de((E,Y)=>{m?.(E,Y),!Y.isCanceled&&(be(E),!E&&(Y.reason===ge.focusOut||Y.reason===ge.outsidePress)&&(Se(!0),Re(!1),Z==="onBlur"&&N.commit(S)))}),lt=de(()=>{Ne(!1),y.update({activeIndex:null,openMethod:null}),J?.(!1)});Xe({enabled:!k,open:F,ref:w,onComplete(){F||lt()}}),j.useImperativeHandle(k,()=>({unmount:lt}),[lt]);let Ye=de((E,Y)=>{l?.(E,Y),!Y.isCanceled&&le(E)}),Le=de(()=>{let E=y.state.listElement||w.current;if(!E)return;let Y=dt(E.scrollHeight,E.clientHeight),ve=gt(E.scrollTop,Y),ye=ve>0,$e=ve<Y;y.state.scrollUpArrowVisible!==ye&&y.set("scrollUpArrowVisible",ye),y.state.scrollDownArrowVisible!==$e&&y.set("scrollDownArrowVisible",$e)}),Qe=Ho({open:F,onOpenChange:st,elements:{reference:Oe,floating:ke}}),it=Lo(Qe,{enabled:!R&&!V,event:"mousedown"}),at=_o(Qe),qe=jo(Qe,{enabled:!R&&!V,listRef:he,activeIndex:We,selectedIndex:Te,disabledIndices:oo,onNavigate(E){E===null&&!F||y.set("activeIndex",E)},focusItemOnHover:ae}),et=zo(Qe,{enabled:!R&&!V&&(F||!A),listRef:d,activeIndex:We,selectedIndex:Te,disabledIndices:r(E=>mr(he.current[E]),"disabledIndices"),onMatch(E){F?y.set("activeIndex",E):Ye(K.current[E],xe("none"))},onTyping(E){W.current=E}}),vt=j.useMemo(()=>{let E=wt(et.reference,qe.reference,at.reference,it.reference,re);return H&&(E.id=H),E},[it.reference,et.reference,qe.reference,at.reference,re,H]),Et=j.useMemo(()=>wt(Bo,et.floating,qe.floating,at.floating),[et.floating,qe.floating,at.floating]),Dt=qe.item??xo;ko(()=>{y.update({popupProps:Et,triggerProps:vt})}),ee(()=>{y.update({id:H,modal:C,multiple:A,value:S,open:F,mounted:oe,transitionStatus:Q,popupProps:Et,triggerProps:vt,items:B,itemToStringLabel:b,itemToStringValue:L,isItemEqualToValue:M,openMethod:Je})},[y,H,C,A,S,F,oe,Q,Et,vt,B,b,L,M,Je]);let Pe=j.useMemo(()=>({store:y,name:u,required:v,disabled:V,readOnly:R,multiple:A,highlightItemOnHover:ae,setValue:Ye,setOpen:st,listRef:he,popupRef:w,scrollHandlerRef:ue,handleScrollArrowVisibility:Le,scrollArrowsMountedCountRef:Ae,itemProps:Dt,valueRef:T,valuesRef:K,labelsRef:d,typingRef:W,selectionRef:pe,firstItemTextRef:Ie,selectedItemTextRef:ie,validation:N,onOpenChangeComplete:J,alignItemWithTriggerActiveRef:fe,initialValueRef:Be}),[y,u,v,V,R,A,ae,Ye,st,Dt,N,J,Le]),ct=ho(x,N.inputRef),Lt=A&&Array.isArray(S)&&S.length>0,_t=A?void 0:u,eo=j.useMemo(()=>!A||!Array.isArray(S)||!u?null:S.map(E=>{let Y=ze(E,L);return(0,ht.jsx)("input",{type:"hidden",form:f,name:u,value:Y,disabled:V},Y)}),[A,S,f,u,L,V]);return(0,ht.jsx)(no.Provider,{value:Pe,children:(0,ht.jsxs)(so.Provider,{value:Qe,children:[te,(0,ht.jsx)("input",{...N.getValidationProps(V,{onFocus(){y.state.triggerElement?.focus({focusVisible:!0})},onChange(E){if(E.nativeEvent.defaultPrevented||V||R)return;let Y=E.currentTarget.value,ve=xe(ge.none,E.nativeEvent);function ye(){if(A)return;let $e=Y.toLowerCase(),tt=K.current.findIndex(to=>ze(to,L).toLowerCase()===$e||lo(to,b).toLowerCase()===$e);tt===-1&&(tt=K.current.findIndex((to,fn)=>{let go=d.current[fn];return go!=null&&go.toLowerCase()===$e}));let mo=tt===-1?void 0:K.current[tt];mo!=null&&Ye(mo,ve)}r(ye,"handleChange"),y.set("forceMount",!0),queueMicrotask(ye)}}),id:H&&_t==null?`${H}-hidden-input`:void 0,form:f,name:_t,autoComplete:g,value:It,disabled:V,required:v&&!Lt,readOnly:R,ref:ct,style:u?Mo:Po,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),eo]})})}r(Er,"SelectRoot");var Ar=I(_(),1);function wr(e){return e==null?void 0:`${e}-label`}r(wr,"getDefaultLabelId");function Cr(e,t){return e??t}r(Cr,"resolveAriaLabelledBy");var Nr=Ar.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,m=s;delete m.id;let p=ut(),{store:f}=U(),g=a(f,i.triggerElement),h=a(f,i.id),R=wr(h),v=Co({id:R,fallbackControlId:g?.id??h,setLabelId(C){f.set("labelId",C)}});return O("div",t,{ref:o,state:p.state,props:[v,s],stateAttributesMapping:Ut})},"SelectLabel"));var xt=I(_(),1);var Gt=2,gn=400,Sn={...Go,...Ut,popupSide:r(e=>e?{"data-popup-side":e}:null,"popupSide"),value:r(()=>null,"value")},Tr=xt.forwardRef(r(function(t,o){let{render:n,className:l,id:c,disabled:s=!1,nativeButton:m=!0,style:p,...f}=t,{setTouched:g,setFocused:h,validationMode:R,state:v,disabled:C}=ut(),{labelId:k}=yo(),{store:x,setOpen:J,selectionRef:B,validation:A,readOnly:b,required:L,alignItemWithTriggerActiveRef:M,disabled:ae}=U(),te=C||ae||s,$=a(x,i.open),se=a(x,i.mounted),Se=a(x,i.value),Re=a(x,i.triggerProps),z=a(x,i.positionerElement),X=a(x,i.listElement),D=a(x,i.popupSide),ce=a(x,i.id),N=a(x,i.labelId),Z=a(x,i.hasSelectedValue),H=se&&z?D:null,V=c??ce,u=Cr(k,N);Ft({id:V});let S=Ht(z),le=xt.useRef(null),{getButtonProps:F,buttonRef:be}=jt({disabled:te,native:m}),he=de(W=>{x.set("triggerElement",W)}),d=pt(),w=pt(),ue=pt();xt.useEffect(()=>{if($)return ue.start(gn,()=>{B.current.allowUnselectedMouseUp=!0,B.current.allowSelectedMouseUp=!0}),()=>{ue.clear()};B.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},w.clear()},[$,B,w,ue]);let Ae=wt(Re,{id:V,role:"combobox","aria-expanded":$?"true":"false","aria-haspopup":"listbox","aria-controls":$?X?.id??vo(z)?.id:void 0,"aria-labelledby":u,"aria-readonly":b||void 0,"aria-required":L||void 0,tabIndex:te?-1:0,onFocus(W){h(!0),$&&M.current&&J(!1,xe(ge.none,W.nativeEvent)),d.start(0,()=>{x.set("forceMount",!0)})},onBlur(W){Bt(z,W.relatedTarget)||(g(!0),h(!1),R==="onBlur"&&A.commit(Se))},onMouseDown(W){if($)return;let Ie=Ct(W.currentTarget);function ie(pe){if(!le.current)return;let fe=pe.target;if(Bt(le.current,fe)||Bt(S.current,fe))return;let oe=pr(le.current);pe.clientX>=oe.left-Gt&&pe.clientX<=oe.right+Gt&&pe.clientY>=oe.top-Gt&&pe.clientY<=oe.bottom+Gt||J(!1,xe(ge.cancelOpen,pe))}r(ie,"handleMouseUp"),w.start(0,()=>{Ie.addEventListener("mouseup",ie,{once:!0})})}},f,F),T=A.getValidationProps(te,Ae);T.role="combobox";let K={...v,open:$,disabled:te,value:Se,readOnly:b,popupSide:H,placeholder:!Z};return O("button",t,{ref:[o,le,be,he],state:K,stateAttributesMapping:Sn,props:T})},"SelectTrigger"));var Pr=I(_(),1);var hn={value:r(()=>null,"value")},Mr=Pr.forwardRef(r(function(t,o){let{className:n,render:l,children:c,placeholder:s,style:m,...p}=t,{store:f,valueRef:g}=U(),h=a(f,i.value),R=a(f,i.items),v=a(f,i.itemToStringLabel),C=a(f,i.hasSelectedValue),k=!C&&s!=null&&c==null,x=a(f,i.hasNullItemLabel,k),J={value:h,placeholder:!C},B=null;return typeof c=="function"?B=c(h):c!=null?B=c:!C&&s!=null&&!x?B=s:Array.isArray(h)?B=Ir(h,R,v):B=io(h,R,v),O("span",t,{state:J,ref:[o,g],props:[{children:B},p],stateAttributesMapping:hn})},"SelectValue"));var Vr=I(_(),1);var Or=Vr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),f={open:a(m,i.open)};return O("span",t,{state:f,ref:o,props:[{"aria-hidden":!0,children:"\u25BC"},s],stateAttributesMapping:Wo})},"SelectIcon"));var Lr=I(_(),1);var ao=I(_(),1);var Dr=ao.createContext(void 0);var co=I(Me(),1);var _r=Lr.forwardRef(r(function(t,o){let{store:n}=U(),l=a(n,i.mounted),c=a(n,i.forceMount);return l||c?(0,co.jsx)(Dr.Provider,{value:!0,children:(0,co.jsx)(Oo,{ref:o,...t})}):null},"SelectPortal"));var Ur=I(_(),1);var xn={...mt,..._e},kr=Ur.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),p=a(m,i.open),f=a(m,i.mounted),g=a(m,i.transitionStatus);return O("div",t,{state:{open:p,transitionStatus:g},ref:o,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:xn})},"SelectBackdrop"));var Ee=I(_(),1);var Yt=I(_(),1);var uo=Yt.createContext(void 0);function Ke(){let e=Yt.useContext(uo);if(!e)throw new Error(je(59));return e}r(Ke,"useSelectPositionerContext");function Rt(e,t){e&&Object.assign(e.style,t)}r(Rt,"clearStyles");var qt={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var Pt=I(Me(),1);var Rn={position:"fixed"},Fr=Ee.forwardRef(r(function(t,o){let{anchor:n,positionMethod:l="absolute",className:c,render:s,side:m="bottom",align:p="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:h="clipping-ancestors",collisionPadding:R,arrowPadding:v=5,sticky:C=!1,disableAnchorTracking:k,alignItemWithTrigger:x=!0,collisionAvoidance:J=Vo,style:B,...A}=t,{store:b,listRef:L,labelsRef:M,alignItemWithTriggerActiveRef:ae,selectedItemTextRef:te,valuesRef:$,initialValueRef:se,popupRef:Se,setValue:Re}=U(),z=zt(),X=a(b,i.open),D=a(b,i.mounted),ce=a(b,i.modal),N=a(b,i.value),Z=a(b,i.openMethod),H=a(b,i.positionerElement),V=a(b,i.triggerElement),u=a(b,i.isItemEqualToValue),S=a(b,i.transitionStatus),le=Ee.useRef(null),F=Ee.useRef(null),[be,he]=Ee.useState(x),d=D&&be&&Z!=="touch";!D&&be!==x&&he(x),ee(()=>{D||(i.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),i.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,D]),Ee.useImperativeHandle(ae,()=>d),er((d||ce)&&X,Z==="touch",H,V);let w=Ko({anchor:n,floatingRootContext:z,positionMethod:l,mounted:D,side:m,sideOffset:f,align:p,alignOffset:g,arrowPadding:v,collisionBoundary:h,collisionPadding:R,sticky:C,disableAnchorTracking:k??d,collisionAvoidance:J,keepMounted:!0}),ue=d?"none":w.side,Ae=d?Rn:w.positionerStyles,T={open:X,side:ue,align:w.align,anchorHidden:w.anchorHidden};ee(()=>{b.set("popupSide",w.side)},[b,w.side]);let K=de(fe=>{b.set("positionerElement",fe)}),W=Qo(t,T,{styles:Ae,transitionStatus:S,props:A,refs:[o,K],hidden:!D,inert:!X}),Ie=Ee.useRef(0),ie=de(fe=>{if(fe.size===0&&Ie.current===0||$.current.length===0)return;let oe=Ie.current;if(Ie.current=fe.size,fe.size===oe)return;let Ne=xe(ge.none);if(oe!==0&&!b.state.multiple&&N!==null&&rt($.current,N,u)===-1){let G=se.current,y=G!=null&&rt($.current,G,u)!==-1?G:null;Re(y,Ne),y===null&&(b.set("selectedIndex",null),te.current=null)}if(oe!==0&&b.state.multiple&&Array.isArray(N)){let Q=r(re=>rt($.current,re,u)!==-1,"hasVisibleItem"),G=N.filter(re=>Q(re));(G.length!==N.length||G.some(re=>!Sr(N,re,u)))&&(Re(G,Ne),G.length===0&&(b.set("selectedIndex",null),te.current=null))}if(X&&d){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let Q={height:""};Rt(H,Q),Rt(Se.current,Q)}}),pe=Ee.useMemo(()=>({...w,side:ue,alignItemWithTriggerActive:d,setControlledAlignItemWithTrigger:he,scrollUpArrowRef:le,scrollDownArrowRef:F}),[w,ue,d,he]);return(0,Pt.jsx)(ur,{elementsRef:L,labelsRef:M,onMapChange:ie,children:(0,Pt.jsxs)(uo.Provider,{value:pe,children:[D&&ce&&(0,Pt.jsx)(Jo,{inert:$o(!X),cutout:V}),W]})})},"SelectPositioner"));var we=I(_(),1);var Kt=I(Me(),1);var bn={...mt,..._e},zr=we.forwardRef(r(function(t,o){let{render:n,className:l,style:c,finalFocus:s,...m}=t,{store:p,popupRef:f,onOpenChangeComplete:g,setOpen:h,valueRef:R,firstItemTextRef:v,selectedItemTextRef:C,multiple:k,handleScrollArrowVisibility:x,scrollHandlerRef:J,listRef:B,highlightItemOnHover:A}=U(),{side:b,align:L,alignItemWithTriggerActive:M,isPositioned:ae,setControlledAlignItemWithTrigger:te}=Ke(),$=or(!0)!=null,se=zt(),Se=Xo(),{nonce:Re,disableStyleElements:z}=dr(),X=a(p,i.id),D=a(p,i.open),ce=a(p,i.openMethod),N=a(p,i.mounted),Z=a(p,i.popupProps),H=a(p,i.transitionStatus),V=a(p,i.triggerElement),u=a(p,i.positionerElement),S=a(p,i.listElement),le=we.useRef(!1),F=we.useRef(!1),be=we.useRef({}),he=Ao(),d=de(T=>{if(!u||!f.current||!F.current)return;if(le.current||!M){x();return}let K=u.style.top==="0px",W=u.style.bottom==="0px";if(!K&&!W){x();return}let Ie=Hr(u),ie=Mt(u.getBoundingClientRect().height,"y",Ie),pe=Ct(u),fe=kt(u),oe=fe.getComputedStyle(u),Ne=parseFloat(oe.marginTop),Q=parseFloat(oe.marginBottom),G=Br(fe.getComputedStyle(f.current)),re=Math.min(pe.documentElement.clientHeight-Ne-Q,G),y=T.scrollTop,We=$t(T),Te=0,Oe=null,ke=!1,Ge=!1,Je=r(ne=>{u.style.height=`${ne}px`},"setHeight"),It=r((ne,Be)=>{let He=Nt(ne,0,re-ie);He>0&&Je(ie+He),T.scrollTop=Be,re-(ie+He)<=Ve&&(le.current=!0),x()},"handleSmallDiff"),Fe=K?We-y:y,Ze=Math.min(ie+Fe,re);if(Te=Ze,Fe<=Ve){It(Fe,K?We:0);return}if(re-Ze>Ve)K?Ge=!0:Oe=0;else if(ke=!0,W&&y<We){let ne=ie+Fe-re;Oe=y-(Fe-ne)}if(Te=Math.ceil(Te),Te!==0&&Je(Te),Ge||Oe!=null){let ne=$t(T),Be=Ge?ne:Nt(Oe,0,ne);Math.abs(T.scrollTop-Be)>Ve&&(T.scrollTop=Be)}(ke||Te>=re-Ve)&&(le.current=!0),x()});we.useImperativeHandle(J,()=>d,[d]),Xe({open:D,ref:f,onComplete(){D&&g?.(!0)}});let w={open:D,transitionStatus:H,side:b,align:L};ee(()=>{!u||!f.current||Object.keys(be.current).length||(be.current={top:u.style.top||"0",left:u.style.left||"0",right:u.style.right,height:u.style.height,bottom:u.style.bottom,minHeight:u.style.minHeight,maxHeight:u.style.maxHeight,marginTop:u.style.marginTop,marginBottom:u.style.marginBottom})},[f,u]),ee(()=>{D||M||(F.current=!1,le.current=!1,Rt(u,be.current))},[D,M,u,f]),ee(()=>{let T=f.current;if(!D||!V||!u||!T||M&&!ae||p.state.transitionStatus==="ending")return;if(!M){F.current=!0,he.request(x),T.style.removeProperty("--transform-origin");return}let K=yn(T);T.style.removeProperty("--transform-origin");try{let W=C.current;W?.isConnected||(W=!i.hasSelectedValue(p.state)&&v.current?.isConnected?v.current:null);let Ie=R.current,ie=kt(u),pe=ie.getComputedStyle(u),fe=ie.getComputedStyle(T),oe=Ct(V),Ne=Hr(V),Q=Xt(V.getBoundingClientRect(),Ne),G=Xt(u.getBoundingClientRect(),Ne),re=Q.height,y=S||T,We=y.scrollHeight,Te=parseFloat(fe.borderBottomWidth),Oe=parseFloat(pe.marginTop)||10,ke=parseFloat(pe.marginBottom)||10,Ge=parseFloat(pe.minHeight)||100,Je=Br(fe),It=5,Fe=5,Ze=20,ne=oe.documentElement.clientHeight-Oe-ke,Be=oe.documentElement.clientWidth,He=ne-Q.bottom+re,De,st=Se==="rtl"?Q.right-G.width:Q.left,lt=0;if(W&&Ie){let Pe=Xt(Ie.getBoundingClientRect(),Ne);De=Xt(W.getBoundingClientRect(),Ne),st=G.left+(Se==="rtl"?Pe.right-De.right:Pe.left-De.left);let ct=Pe.top-Q.top+Pe.height/2;lt=De.top-G.top+De.height/2-ct}let Ye=He+lt+ke+Te,Le=Math.min(ne,Ye),Qe=ne-Oe-ke,it=Ye-Le,at=Be-Fe;u.style.left=`${Nt(st,It,at-G.width)}px`,u.style.height=`${Le}px`,u.style.maxHeight="none",u.style.marginTop=`${Oe}px`,u.style.marginBottom=`${ke}px`,T.style.height="100%";let qe=$t(y),et=it>=qe-Ve;et&&(Le=Math.min(ne,G.height)-(it-qe));let vt=Q.top<Ze||Q.bottom>ne-Ze||Math.ceil(Le)+Ve<Math.min(We,Ge),Et=(ie.visualViewport?.scale??1)!==1&&Io.engine.webkit;if(vt||Et){F.current=!0,Rt(u,be.current),te(!1);return}let Dt=Math.max(Ge,Le);if(et){let Pe=Math.max(0,ne-Ye);u.style.top=G.height>=Qe?"0":`${Pe}px`,u.style.height=`${Le}px`,y.scrollTop=$t(y)}else u.style.bottom="0",y.scrollTop=it;if(De){let Pe=G.top,ct=G.height,Lt=De.top+De.height/2,_t=ct>0?(Lt-Pe)/ct*100:50,eo=Nt(_t,0,100);T.style.setProperty("--transform-origin",`50% ${eo}%`)}(Dt===ne||Le>=Je)&&(le.current=!0),x(),A&&p.state.selectedIndex===null&&p.state.activeIndex===null&&B.current[0]!=null&&p.set("activeIndex",0),F.current=!0}finally{K()}},[p,D,u,V,R,v,C,f,x,M,te,he,S,B,A,Se,ae]),we.useEffect(()=>{if(!M||!u||!D)return;let T=kt(u);function K(W){h(!1,xe(ge.windowResize,W))}return r(K,"handleResize"),To(T,"resize",K)},[h,M,u,D]);let ue={...S?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":k||void 0,id:`${X}-list`},onKeyDown(T){$&&tr.has(T.key)&&T.stopPropagation()},onScroll(T){S||d(T.currentTarget)},...M&&{style:S?{height:"100%"}:qt}},Ae=O("div",t,{ref:[o,f],state:w,stateAttributesMapping:bn,props:[Z,ue,Zo(H),{className:!S&&M?Tt.className:void 0},m]});return(0,Kt.jsxs)(we.Fragment,{children:[!z&&Tt.getElement(Re),(0,Kt.jsx)(Do,{context:se,modal:!1,disabled:!N,openInteractionType:ce,returnFocus:s,restoreFocus:!0,children:Ae})]})},"SelectPopup"));function Br(e){let t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}r(Br,"getMaxPopupHeight");function $t(e){return dt(e.scrollHeight,e.clientHeight)}r($t,"getMaxScrollTop");function Hr(e){return Uo.getScale(e)}r(Hr,"getScale");function Mt(e,t,o){return e/o[t]}r(Mt,"normalizeSize");function Xt(e,t){return wo({x:Mt(e.x,"x",t),y:Mt(e.y,"y",t),width:Mt(e.width,"x",t),height:Mt(e.height,"y",t)})}r(Xt,"normalizeRect");var jr=[["transform","none"],["scale","1"],["translate","0 0"]];function yn(e){let{style:t}=e,o={};for(let[n,l]of jr)o[n]=t.getPropertyValue(n),t.setProperty(n,l,"important");return()=>{for(let[n]of jr){let l=o[n];l?t.setProperty(n,l):t.removeProperty(n)}}}r(yn,"unsetTransformStyles");var Wr=I(_(),1);var Gr=Wr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m,scrollHandlerRef:p}=U(),{alignItemWithTriggerActive:f}=Ke(),g=a(m,i.hasScrollArrows),h=a(m,i.openMethod),R=a(m,i.multiple),C={id:`${a(m,i.id)}-list`,role:"listbox","aria-multiselectable":R||void 0,onScroll(x){p.current?.(x.currentTarget)},...f&&{style:qt},className:g&&h!=="touch"?Tt.className:void 0},k=de(x=>{m.set("listElement",x)});return O("div",t,{ref:[o,k],props:[C,s]})},"SelectList"));var Ce=I(_(),1);var Jt=I(_(),1);var po=Jt.createContext(void 0);function Vt(){let e=Jt.useContext(po);if(!e)throw new Error(je(57));return e}r(Vt,"useSelectItemContext");var Yr=I(Me(),1);var qr=Ce.memo(Ce.forwardRef(r(function(t,o){let{render:n,className:l,style:c,value:s=null,label:m,disabled:p=!1,nativeButton:f=!1,...g}=t,h=Ce.useRef(null),R=cr({label:m,textRef:h,indexGuessBehavior:ar.GuessFromOrder}),{store:v,itemProps:C,setOpen:k,setValue:x,selectionRef:J,typingRef:B,valuesRef:A,multiple:b,selectedItemTextRef:L,disabled:M,readOnly:ae}=U(),te=a(v,i.isActive,R.index),$=a(v,i.open),se=a(v,i.isSelected,s),Se=a(v,i.isSelectedByFocus,R.index),Re=a(v,i.isItemEqualToValue),z=R.index,X=z!==-1,D=Ce.useRef(null);ee(()=>{if(!X)return;let d=A.current;return d[z]=s,()=>{delete d[z]}},[X,z,s,A]),ee(()=>{if(!X)return;let d=v.state.value,w=d;b&&Array.isArray(d)&&(w=d.length>0?d[d.length-1]:void 0),w!==void 0&&Ue(s,w,Re)&&(v.set("selectedIndex",z),h.current&&(L.current=h.current))},[X,z,b,Re,v,s,L]);let ce=Ce.useRef(null),N=Ce.useRef("mouse"),Z=Ce.useRef(!1),{getButtonProps:H,buttonRef:V}=jt({disabled:p,focusableWhenDisabled:!0,native:f,composite:!0}),u={disabled:p,selected:se,highlighted:te};function S(d){if(M||ae)return;let w=v.state.value;if(b){let ue=Array.isArray(w)?w:[],Ae=se?hr(ue,s,Re):[...ue,s];x(Ae,xe(ge.itemPress,d))}else x(s,xe(ge.itemPress,d)),k(!1,xe(ge.itemPress,d))}r(S,"commitSelection");function le(){J.current.dragY=0}r(le,"resetDragMovement");let F={role:"option","aria-selected":se,tabIndex:$&&te?0:-1,onKeyDown(d){ce.current=d.key,v.set("activeIndex",z),d.key===" "&&B.current&&d.preventDefault()},onClick(d){let w=d.type==="click"&&N.current!=="touch",ue=d.nativeEvent.pointerType,Ae=w&&Eo(d.nativeEvent)&&(ue!==void 0||te),T=w&&!Ae&&!Z.current;Z.current=!1,!(d.type==="keydown"&&ce.current===null)&&(p||d.type==="keydown"&&ce.current===" "&&B.current||T||(ce.current=null,S(d.nativeEvent)))},onPointerEnter(d){N.current=d.pointerType},onPointerMove(d){if(d.pointerType==="mouse"&&d.buttons===1){let w=J.current;w.dragY+=d.movementY,w.dragY**2>=64&&(w.allowUnselectedMouseUp=!0)}},onPointerDown(d){N.current=d.pointerType,Z.current=!0,le()},onMouseUp(){if(le(),p||N.current==="touch"||Z.current)return;let d=!J.current.allowSelectedMouseUp&&se,w=!J.current.allowUnselectedMouseUp&&!se;d||w||(Z.current=!0,D.current?.click(),Z.current=!1)}},be=O("div",t,{ref:[V,o,R.ref,D],state:u,props:[C,F,g,H]}),he=Ce.useMemo(()=>({selected:se,index:z,textRef:h,selectedByFocus:Se,hasRegistered:X}),[se,z,h,Se,X]);return(0,Yr.jsx)(po.Provider,{value:he,children:be})},"SelectItem")));var nt=I(_(),1);var $r=I(Me(),1);var Xr=nt.forwardRef(r(function(t,o){let n=t.keepMounted??!1,{selected:l}=Vt();return n||l?(0,$r.jsx)(In,{...t,ref:o}):null},"SelectItemIndicator")),In=nt.memo(nt.forwardRef((e,t)=>{let{render:o,className:n,style:l,keepMounted:c,...s}=e,{selected:m}=Vt(),p=nt.useRef(null),{transitionStatus:f,setMounted:g}=ft(m),R=O("span",e,{ref:[t,p],state:{selected:m,transitionStatus:f},props:[{"aria-hidden":!0,children:"\u2714\uFE0F"},s],stateAttributesMapping:_e});return Xe({open:m,ref:p,onComplete(){m||g(!1)}}),R}));var bt=I(_(),1);var Kr=bt.memo(bt.forwardRef(r(function(t,o){let{index:n,textRef:l,selectedByFocus:c,hasRegistered:s}=Vt(),{firstItemTextRef:m,selectedItemTextRef:p}=U(),{render:f,className:g,style:h,...R}=t,v=bt.useCallback(k=>{k&&(s&&n===0&&(m.current=k),s&&c&&(p.current=k))},[m,p,n,c,s]);return O("div",t,{ref:[v,o,l],props:R})},"SelectItemText")));var Jr=I(_(),1);var vn={...mt,..._e},Zr=Jr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,{store:m}=U(),{side:p,align:f,arrowRef:g,arrowStyles:h,arrowUncentered:R,alignItemWithTriggerActive:v}=Ke(),k={open:a(m,i.open),side:p,align:f,uncentered:R},x=O("div",t,{state:k,ref:[g,o],props:[{style:h,"aria-hidden":!0},s],stateAttributesMapping:vn});return v?null:x},"SelectArrow"));var en=I(_(),1);var Qr=I(_(),1);var Zt=Qr.forwardRef(r(function(t,o){let{render:n,className:l,style:c,direction:s,keepMounted:m=!1,...p}=t,f=s==="up",{store:g,popupRef:h,listRef:R,handleScrollArrowVisibility:v,scrollArrowsMountedCountRef:C}=U(),{side:k,scrollDownArrowRef:x,scrollUpArrowRef:J}=Ke(),B=f?i.scrollUpArrowVisible:i.scrollDownArrowVisible,A=a(g,B),b=a(g,i.openMethod),L=A&&b!=="touch",M=pt(),ae=f?J:x,{mounted:te,transitionStatus:$,setMounted:se}=ft(L);ee(()=>(C.current+=1,g.state.hasScrollArrows||g.set("hasScrollArrows",!0),()=>{C.current=Math.max(0,C.current-1),C.current===0&&g.state.hasScrollArrows&&g.set("hasScrollArrows",!1)}),[g,C]),Xe({open:L,ref:ae,onComplete(){L||se(!1)}});let z=O("div",t,{ref:[o,ae],state:{direction:s,visible:L,side:k,transitionStatus:$},props:[{"aria-hidden":!0,children:f?"\u25B2":"\u25BC",style:{position:"absolute"},onMouseMove(D){if(D.movementX===0&&D.movementY===0||M.isStarted())return;g.set("activeIndex",null);function ce(){let N=g.state.listElement??h.current;if(!N)return;g.set("activeIndex",null),v();let Z=dt(N.scrollHeight,N.clientHeight),H=gt(N.scrollTop,Z),V=H===(f?0:Z),u=R.current;if(H!==N.scrollTop&&(N.scrollTop=H),u.length===0&&g.set(f?"scrollUpArrowVisible":"scrollDownArrowVisible",!V),V){M.clear();return}if(u.length>0){let S=ae.current?.offsetHeight||0;N.scrollTop=En(u,f,H,N.clientHeight,S,Z)}M.start(40,ce)}r(ce,"scrollNextItem"),M.start(40,ce)},onMouseLeave(){M.clear()}},p],stateAttributesMapping:_e});return te||m?z:null},"SelectScrollArrow"));function En(e,t,o,n,l,c){if(t){let g=0,h=o+l-Ve;for(let C=0;C<e.length;C+=1){let k=e[C];if(k&&k.offsetTop>=h){g=C;break}}let R=Math.max(0,g-1),v=e[R];return R<g&&v?gt(v.offsetTop-l,c):0}let s=e.length-1,m=o+n-l+Ve;for(let g=0;g<e.length;g+=1){let h=e[g];if(h&&h.offsetTop+h.offsetHeight>m){s=Math.max(0,g-1);break}}let p=Math.min(e.length-1,s+1),f=e[p];return p>s&&f?gt(f.offsetTop+f.offsetHeight-n+l,c):c}r(En,"getTargetScrollTop");var tn=I(Me(),1);var on=en.forwardRef(r(function(t,o){return(0,tn.jsx)(Zt,{...t,ref:o,direction:"down"})},"SelectScrollDownArrow"));var rn=I(_(),1);var nn=I(Me(),1);var sn=rn.forwardRef(r(function(t,o){return(0,nn.jsx)(Zt,{...t,ref:o,direction:"up"})},"SelectScrollUpArrow"));var yt=I(_(),1);var Qt=I(_(),1);var fo=Qt.createContext(void 0);function ln(){let e=Qt.useContext(fo);if(e===void 0)throw new Error(je(56));return e}r(ln,"useSelectGroupContext");var an=I(Me(),1);var cn=yt.forwardRef(r(function(t,o){let{render:n,className:l,style:c,...s}=t,[m,p]=yt.useState(),f=yt.useMemo(()=>({labelId:m,setLabelId:p}),[m,p]),g=O("div",t,{ref:o,props:[{role:"group","aria-labelledby":m},s]});return(0,an.jsx)(fo.Provider,{value:f,children:g})},"SelectGroup"));var un=I(_(),1);var pn=un.forwardRef(r(function(t,o){let{render:n,className:l,style:c,id:s,...m}=t,{setLabelId:p}=ln(),f=bo(s);return ee(()=>{p(f)},[f,p]),O("div",t,{ref:o,props:[{id:f},m]})},"SelectGroupLabel"));var q=I(Me(),1);var Tc=me.Root;function Pc(e){let t=(0,Ot.c)(8),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("flex flex-1 text-start",o),t[3]=o,t[4]=l):l=t[4];let c;return t[5]!==n||t[6]!==l?(c=(0,q.jsx)(me.Value,{"data-slot":"select-value",className:l,...n}),t[5]=n,t[6]=l,t[7]=c):c=t[7],c}r(Pc,"W");function Mc({className:e,size:t="default",children:o,...n}){return(0,q.jsxs)(me.Trigger,{"data-slot":"select-trigger","data-size":t,className:ot("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pe-2 ps-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-md *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[o,(0,q.jsx)(me.Icon,{render:(0,q.jsx)(At,{icon:ir,strokeWidth:2,className:"pointer-events-none size-4 text-muted-foreground"})})]})}r(Mc,"T");function Vc({className:e,children:t,side:o="bottom",sideOffset:n=4,align:l="center",alignOffset:c=0,alignItemWithTrigger:s=!0,...m}){return(0,q.jsx)(me.Portal,{children:(0,q.jsx)(me.Positioner,{side:o,sideOffset:n,align:l,alignOffset:c,alignItemWithTrigger:s,className:"isolate z-50",children:(0,q.jsxs)(me.Popup,{"data-slot":"select-content","data-align-trigger":s,className:ot("isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!",e),...m,children:[(0,q.jsx)(wn,{}),(0,q.jsx)(me.List,{children:t}),(0,q.jsx)(Cn,{})]})})})}r(Vc,"$");function Oc(e){let t=(0,Ot.c)(13),o,n,l;t[0]!==e?({className:n,children:o,...l}=e,t[0]=e,t[1]=o,t[2]=n,t[3]=l):(o=t[1],n=t[2],l=t[3]);let c;t[4]!==n?(c=ot("relative flex w-full cursor-default items-center gap-2 rounded-md py-2 pe-8 ps-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),t[4]=n,t[5]=c):c=t[5];let s;t[6]!==o?(s=(0,q.jsx)(me.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:o}),t[6]=o,t[7]=s):s=t[7];let m;t[8]===Symbol.for("react.memo_cache_sentinel")?(m=(0,q.jsx)(me.ItemIndicator,{render:(0,q.jsx)("span",{className:"pointer-events-none absolute end-2 flex size-4 items-center justify-center"}),children:(0,q.jsx)(At,{icon:lr,strokeWidth:2,className:"pointer-events-none"})}),t[8]=m):m=t[8];let p;return t[9]!==l||t[10]!==c||t[11]!==s?(p=(0,q.jsxs)(me.Item,{"data-slot":"select-item",className:c,...l,children:[s,m]}),t[9]=l,t[10]=c,t[11]=s,t[12]=p):p=t[12],p}r(Oc,"A");function wn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,q.jsx)(At,{icon:sr,strokeWidth:2}),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,q.jsx)(me.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:l,...n,children:c}),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(wn,"x");function Cn(e){let t=(0,Ot.c)(9),o,n;t[0]!==e?({className:o,...n}=e,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]);let l;t[3]!==o?(l=ot("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",o),t[3]=o,t[4]=l):l=t[4];let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=(0,q.jsx)(At,{icon:nr,strokeWidth:2}),t[5]=c):c=t[5];let s;return t[6]!==n||t[7]!==l?(s=(0,q.jsx)(me.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:l,...n,children:c}),t[6]=n,t[7]=l,t[8]=s):s=t[8],s}r(Cn,"w");export{Tc as a,Pc as b,Mc as c,Vc as d,Oc as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ue,b as me,c as pe,d as ve,e as W}from"./chunk-UNDFOYRI.js";import"./chunk-HA34GYEX.js";import{a as he}from"./chunk-6I62RSI5.js";import"./chunk-PR2SE2MD.js";import"./chunk-CZEUVNCQ.js";import"./chunk-PWDMXMRD.js";import"./chunk-YNBJ6ICE.js";import"./chunk-C4O5UR4Y.js";import{a as ne}from"./chunk-YQ5PILIJ.js";import"./chunk-KSRXMTBV.js";import{b as re}from"./chunk-SKJZDOHG.js";import{a as oe,b as de,c as ce,d as P,e as h,f as u}from"./chunk-Q5WXTZWX.js";import{a as Z,e as ee}from"./chunk-JKPK25JO.js";import"./chunk-KOC5KV3E.js";import{a as le}from"./chunk-V66TSUKV.js";import"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import{R as Y}from"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as S}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import{b as V}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as I}from"./chunk-GXZAXNZI.js";import{f as J}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as se}from"./chunk-6OKDCV7J.js";import{d as Q,f as C,g as te,h as ae,m as N,q as ie}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as l,e as M,f as Se,g as Ce,h as $e}from"./chunk-UHHTEBC3.js";var fe=M(Ce(),1);var $=M(Se(),1);var t=M($e(),1);var X="none",Ae=["all","open","resolved","ignored"],ke=["critical","high","medium","low"],Ee=C(I.resolveIssue),ze=C(I.ignoreIssue),ge=C(I.assignIssue),Ke=C(I.setIssueSeverity),Re=l(i=>Array.isArray(i?.issues)?i.issues:[],"Ee"),Te=l(i=>i==="resolved"?"success":i==="ignored"?"secondary":"warning","ke"),je=l(i=>i==="critical"?"destructive":i==="high"?"warning":i==="medium"?"info":"secondary","Re"),Qe=l(i=>{let e=(0,fe.c)(44),{initialShardKey:xe}=i,a=Q(),w=J(),[d,ye]=(0,$.useState)(xe??""),[n,Ne]=(0,$.useState)("all"),[_,B]=(0,$.useState)(null),[m,G]=(0,$.useState)(null),A;e[0]!==d?(A=d.trim(),e[0]=d,e[1]=A):A=e[1];let c=ne(A,400),k;e[2]!==n?(k=n==="all"?{}:{status:n},e[2]=n,e[3]=k):k=e[3];let E;e[4]!==c?(E={live:!0,shardKey:c},e[4]=c,e[5]=E):E=e[5];let{data:z,error:p,liveError:b}=re(I.getIssues,k,E),q=z!==void 0,K;if(e[6]!==m||e[7]!==_||e[8]!==w||e[9]!==z||e[10]!==c||e[11]!==p||e[12]!==b||e[13]!==q||e[14]!==d||e[15]!==n||e[16]!==a){let H=Re(z),R;e[18]!==w||e[19]!==c?(R=l(async(s,r,y)=>{G(null),B(s);try{await w.query(r,{...y,hash:s},te(c))}catch(be){G(ae(be))}B(null)},"k"),e[18]=w,e[19]=c,e[20]=R):R=e[20];let o=R,T;e[21]!==o?(T=l(s=>r=>{if(r.key!=="Enter")return;let y=r.currentTarget.value.trim();N(o(s.hash,ge,{assignee:y===""?null:y}))},"R"),e[21]=o,e[22]=T):T=e[22];let Ie=T,j;e[23]!==o?(j=l(s=>r=>{let y=r===null||r===X?null:r;N(o(s.hash,Ke,{severity:y}))},"T"),e[23]=o,e[24]=j):j=e[24];let we=j,L;e[25]!==a?(L=l(s=>a(s==="all"?"All":s==="open"?"Open":s==="resolved"?"Resolved":"Ignored"),"z"),e[25]=a,e[26]=L):L=e[26];let F=L,D;e[27]!==p?(D=p!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-error",role:"alert",children:p}),e[27]=p,e[28]=D):D=e[28];let O;e[29]!==m?(O=m!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"issues-action-error",role:"alert",children:m}),e[29]=m,e[30]=O):O=e[30];let v;e[31]!==d?(v=(0,t.jsx)(le,{onChange:ye,testId:"issues-shard-input",value:d}),e[31]=d,e[32]=v):v=e[32];let g;e[33]!==b?(g=(0,t.jsx)(he,{message:b,prefix:"issues"}),e[33]=b,e[34]=g):g=e[34];let f;e[35]!==n||e[36]!==F?(f=Ae.map(s=>(0,t.jsx)(S,{"data-active":n===s?"":void 0,"data-testid":`issues-filter-${s}`,onClick:l(()=>{Ne(s)},"onClick"),size:"xs",variant:n===s?"default":"outline",children:F(s)},s)),e[35]=n,e[36]=F,e[37]=f):f=e[37];let x;e[38]!==f?(x=(0,t.jsx)("div",{className:"ms-auto flex items-center gap-1","data-testid":"issues-status-filter",role:"group",children:f}),e[38]=f,e[39]=x):x=e[39];let U;e[40]!==v||e[41]!==g||e[42]!==x?(U=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[v,g,x]}),e[40]=v,e[41]=g,e[42]=x,e[43]=U):U=e[43],K=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-issues-panel",children:[D,O,U,q&&H.length===0?(0,t.jsx)(se,{description:a("No grouped errors yet. When a function throws or a container crashes, matching errors fold into a single issue here."),testId:"issues-empty",title:a("No issues")}):(0,t.jsx)(Z,{className:"overflow-hidden py-0",children:(0,t.jsx)(ee,{className:"px-0",children:(0,t.jsxs)(oe,{"data-testid":"issues-table",children:[(0,t.jsx)(de,{children:(0,t.jsxs)(P,{children:[(0,t.jsx)(h,{children:a("Issue")}),(0,t.jsx)(h,{children:a("Status")}),(0,t.jsx)(h,{children:a("Severity")}),(0,t.jsx)(h,{children:a("Assignee")}),(0,t.jsx)(h,{className:"text-right",children:a("Events")}),(0,t.jsx)(h,{children:a("Last seen")}),(0,t.jsx)(h,{className:"text-right",children:a("Actions")})]})}),(0,t.jsx)(ce,{children:H.map(s=>{let r=_===s.hash;return(0,t.jsxs)(P,{"data-testid":`issues-row-${s.hash}`,children:[(0,t.jsxs)(u,{className:"max-w-80",children:[(0,t.jsx)("div",{className:"truncate font-medium",title:s.title,children:s.title}),(0,t.jsx)("div",{className:"truncate font-mono text-xs text-muted-foreground",title:s.culprit,children:s.culprit})]}),(0,t.jsx)(u,{children:(0,t.jsx)(V,{"data-testid":`issues-status-${s.hash}`,variant:Te(s.status),children:s.status})}),(0,t.jsx)(u,{children:(0,t.jsxs)(ue,{disabled:r,onValueChange:we(s),value:s.severity??X,children:[(0,t.jsx)(pe,{"aria-label":a("Set severity"),className:"h-7 w-[110px]","data-testid":`issues-severity-${s.hash}`,children:(0,t.jsx)(me,{placeholder:a("\u2014"),children:s.severity===void 0?(0,t.jsx)("span",{className:"text-muted-foreground",children:a("\u2014")}):(0,t.jsx)(V,{variant:je(s.severity),children:s.severity})})}),(0,t.jsxs)(ve,{children:[ke.map(Le),(0,t.jsx)(W,{value:X,children:a("Clear")})]})]})}),(0,t.jsx)(u,{children:(0,t.jsx)(Y,{"aria-label":a("Assignee"),className:"h-7 w-32","data-testid":`issues-assignee-${s.hash}`,defaultValue:s.assignee??"",disabled:r,onKeyDown:Ie(s),placeholder:a("Unassigned")},s.assignee??"")}),(0,t.jsx)(u,{className:"text-right",children:(0,t.jsx)(V,{variant:"secondary",children:s.count})}),(0,t.jsx)(u,{className:"text-xs tabular-nums text-muted-foreground",children:ie(s.lastSeen)}),(0,t.jsx)(u,{className:"text-right",children:(0,t.jsxs)("div",{className:"flex justify-end gap-1",children:[s.status!=="resolved"&&(0,t.jsx)(S,{"data-testid":`issues-resolve-${s.hash}`,disabled:r,onClick:l(()=>{N(o(s.hash,Ee,{}))},"onClick"),size:"xs",variant:"outline",children:a("Resolve")}),s.status!=="ignored"&&(0,t.jsx)(S,{"data-testid":`issues-ignore-${s.hash}`,disabled:r,onClick:l(()=>{N(o(s.hash,ze,{}))},"onClick"),size:"xs",variant:"ghost",children:a("Ignore")}),s.status!=="open"&&(0,t.jsx)(S,{"data-testid":`issues-reopen-${s.hash}`,disabled:r,onClick:l(()=>{N(o(s.hash,ge,{assignee:s.assignee??null}))},"onClick"),size:"xs",variant:"ghost",children:a("Reopen")})]})})]},s.hash)})})]})})})]}),e[6]=m,e[7]=_,e[8]=w,e[9]=z,e[10]=c,e[11]=p,e[12]=b,e[13]=q,e[14]=d,e[15]=n,e[16]=a,e[17]=K}else K=e[17];return K},"Xe");function Le(i){return(0,t.jsx)(W,{value:i,children:i},i)}l(Le,"Te");export{Qe as IssuesPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G}from"./chunk-UZYGEOWY.js";import{a as g}from"./chunk-YT7VXQVX.js";import{a as B}from"./chunk-V66TSUKV.js";import{b as U}from"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import{R as O}from"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as h}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import{b as w}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as M}from"./chunk-GXZAXNZI.js";import{f as D}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{d as K,e as _,f as z,h as P,m as q,q as E}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as s,e as T,f as ie,h as oe}from"./chunk-UHHTEBC3.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{a as r,i as y}from"./chunk-UHHTEBC3.js";var V=r(e=>typeof e=="boolean"?`${e}`:e===0?"0":e,"falsyToString"),N=y,j=r((e,l)=>n=>{var s;if(l?.variants==null)return N(e,n?.class,n?.className);let{variants:v,defaultVariants:d}=l,f=Object.keys(v).map(t=>{let a=n?.[t],u=d?.[t];if(a===null)return null;let i=V(a)||V(u);return v[t][i]}),c=n&&Object.entries(n).reduce((t,a)=>{let[u,i]=a;return i===void 0||(t[u]=i),t},{}),C=l==null||(s=l.compoundVariants)===null||s===void 0?void 0:s.reduce((t,a)=>{let{class:u,className:i,...x}=a;return Object.entries(x).every(O=>{let[m,o]=O;return Array.isArray(o)?o.includes({...d,...c}[m]):{...d,...c}[m]===o})?[...t,u,i]:t},[]);return N(e,f,C,n?.class,n?.className)},"cva");export{j as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as o,c as i}from"./chunk-PTTDIYGP.js";import{a as t}from"./chunk-UHHTEBC3.js";var a="lunora-studio-recent-shards",l=10,n=t(()=>o(a,"session").filter(s=>typeof s=="string"),"t"),u=t(s=>{let r=s.trim();if(r==="")return n();let e=[r,...n().filter(c=>c!==r)].slice(0,l);return i(a,e,"session"),e},"d");export{n as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as K,c as W,i as V}from"./chunk-ZFWEPGWG.js";import{a as O,b as B,c as U,j as S}from"./chunk-4FNHHFWR.js";import{a as M}from"./chunk-UREY4GLG.js";import{a as s,e as g,f as v,h as Y,j as _}from"./chunk-UHHTEBC3.js";var $=g(v(),1);var b=g(v(),1);var h=g(v(),1);var Z=h.createContext(void 0);function H(n=!1){let t=h.useContext(Z);if(t===void 0&&!n)throw new Error(U(16));return t}s(H,"useCompositeRootContext");var A=g(v(),1);function F(n){let{focusableWhenDisabled:t,disabled:r,composite:u=!1,tabIndex:o=0,isNativeButton:i}=n,p=u&&t!==!1,f=u&&t===!1;return{props:A.useMemo(()=>{let a={onKeyDown(d){r&&t&&d.key!=="Tab"&&d.preventDefault()}};return u||(a.tabIndex=o,!i&&r&&(a.tabIndex=t?o:-1)),(i&&(t||p)||!i&&r)&&(a["aria-disabled"]=r),i&&(!t||f)&&(a.disabled=r),a},[u,r,t,p,f,i,o])}}s(F,"useFocusableWhenDisabled");function L(n={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:u=0,native:o=!0,composite:i}=n,p=b.useRef(null),f=H(!0),c=i??f!==void 0,{props:a}=F({focusableWhenDisabled:r,disabled:t,composite:c,tabIndex:u,isNativeButton:o}),d=b.useCallback(()=>{let l=p.current;C(l)&&c&&t&&a.disabled===void 0&&l.disabled&&(l.disabled=!1)},[t,a.disabled,c]);K(d,[d]);let k=b.useCallback((l={})=>{let{onClick:m,onMouseDown:R,onKeyUp:q,onKeyDown:G,onPointerDown:J,...Q}=l;return O({onClick(e){if(t){e.preventDefault();return}m?.(e)},onMouseDown(e){t||R?.(e)},onKeyDown(e){if(t||(B(e),G?.(e),e.baseUIHandlerPrevented))return;let N=e.target===e.currentTarget,x=e.currentTarget,E=C(x),z=!o&&ee(x),P=N&&(o?E:!z),T=e.key==="Enter",I=e.key===" ",y=x.getAttribute("role"),X=y?.startsWith("menuitem")||y==="option"||y==="gridcell";if(N&&c&&I){if(e.defaultPrevented&&X)return;e.preventDefault(),z||o&&E?(x.click(),e.preventBaseUIHandler()):P&&(m?.(e),e.preventBaseUIHandler());return}P&&(!o&&(I||T)&&e.preventDefault(),!o&&T&&m?.(e))},onKeyUp(e){if(!t){if(B(e),q?.(e),e.target===e.currentTarget&&o&&c&&C(e.currentTarget)&&e.key===" "){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!o&&!c&&e.key===" "&&m?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}J?.(e)}},o?{type:"button"}:{role:"button"},a,Q)},[t,a,c,o]),w=W(l=>{p.current=l,d()});return{getButtonProps:k,buttonRef:w}}s(L,"useButton");function C(n){return V(n)&&n.tagName==="BUTTON"}s(C,"isButtonElement");function ee(n){return!!(n?.tagName==="A"&&n?.href)}s(ee,"isValidLinkElement");var D=$.forwardRef(s(function(t,r){let{render:u,className:o,disabled:i=!1,focusableWhenDisabled:p=!1,nativeButton:f=!0,style:c,...a}=t,{getButtonProps:d,buttonRef:k}=L({disabled:i,focusableWhenDisabled:p,native:f});return S("button",t,{state:{disabled:i},ref:[r,k],props:[a,d]})},"Button"));var j=g(Y(),1);var te=M("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Ce({className:n,variant:t="default",size:r="default",...u}){return(0,j.jsx)(D,{"data-slot":"button",className:_(te({variant:t,size:r,className:n})),...u})}s(Ce,"g");export{H as a,L as b,Ce as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,e as o,f as c,g as b,h as p,j as s}from"./chunk-UHHTEBC3.js";var l=o(b(),1),g=o(c(),1);var u=o(p(),1);function v(d){let i=(0,l.c)(8),r,e;i[0]!==d?({className:r,...e}=d,i[0]=d,i[1]=r,i[2]=e):(r=i[1],e=i[2]);let t;i[3]!==r?(t=s("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 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",r),i[3]=r,i[4]=t):t=i[4];let a;return i[5]!==e||i[6]!==t?(a=(0,u.jsx)("textarea",{"data-slot":"textarea",className:t,...e}),i[5]=e,i[6]=t,i[7]=a):a=i[7],a}n(v,"p");export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as y}from"./chunk-UWF5DOGV.js";import{R as k}from"./chunk-7Z5QEFR4.js";import{d as j}from"./chunk-KLLYGWNF.js";import{a as m,e as b,f as w,g as F,h as $}from"./chunk-UHHTEBC3.js";var C=b(F(),1),h=b(w(),1);var a=b($(),1);var B=m(i=>{let t=(0,C.c)(21),{id:f,onChange:g,testId:e,value:v}=i,r=j(),u=(0,h.useId)(),[d]=(0,h.useState)(A),c;t[0]!==g?(c=m(S=>{g(S.target.value)},"m"),t[0]=g,t[1]=c):c=t[1];let x=c,s;t[2]!==r?(s=r("Shard key"),t[2]=r,t[3]=s):s=t[3];let I=d.length>0?u:void 0,o;t[4]!==r?(o=r("shard key (optional)"),t[4]=r,t[5]=o):o=t[5];let l;t[6]!==f||t[7]!==x||t[8]!==s||t[9]!==I||t[10]!==o||t[11]!==e||t[12]!==v?(l=(0,a.jsx)(k,{"aria-label":s,className:"h-8 w-48","data-testid":e,id:f,list:I,onChange:x,placeholder:o,value:v}),t[6]=f,t[7]=x,t[8]=s,t[9]=I,t[10]=o,t[11]=e,t[12]=v,t[13]=l):l=t[13];let n;t[14]!==u||t[15]!==d||t[16]!==e?(n=d.length>0&&(0,a.jsx)("datalist",{"data-testid":`${e}-recents`,id:u,children:d.map(N)}),t[14]=u,t[15]=d,t[16]=e,t[17]=n):n=t[17];let p;return t[18]!==l||t[19]!==n?(p=(0,a.jsxs)(a.Fragment,{children:[l,n]}),t[18]=l,t[19]=n,t[20]=p):p=t[20],p},"A");function A(){return y()}m(A,"F");function N(i){return(0,a.jsx)("option",{"aria-label":i,value:i},i)}m(N,"w");export{B as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,e as v,g as j,h as I,j as k}from"./chunk-UHHTEBC3.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 se}from"./chunk-6I62RSI5.js";import{a as te}from"./chunk-Q34MSC2F.js";import"./chunk-4AYEV5UN.js";import{b as O}from"./chunk-SKJZDOHG.js";import{a as ae,b as re,c as le,d as Y,e as M,f as q}from"./chunk-Q5WXTZWX.js";import{a as U,b as G,c as H,d as Q,e as W}from"./chunk-JKPK25JO.js";import{a as ie}from"./chunk-UZYGEOWY.js";import{a as w}from"./chunk-YT7VXQVX.js";import{a as ee}from"./chunk-V66TSUKV.js";import"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import{R as _}from"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as k}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import{b as F}from"./chunk-K5PFWU5J.js";import"./chunk-4FNHHFWR.js";import{a as R}from"./chunk-GXZAXNZI.js";import{f as J}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as K}from"./chunk-6OKDCV7J.js";import{d as z,f as V,g as X,h as Z,m as j}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as n,e as D,f as he,g as xe,h as ye}from"./chunk-UHHTEBC3.js";var c=D(he(),1);var de=D(xe(),1);var e=D(ye(),1);var oe=["read","insert","update","delete"],ge=n((a,t)=>({delete:a("Delete"),insert:a("Insert"),read:a("Read"),update:a("Update")})[t],"xe"),be=n(a=>{let t=new Set;for(let s of a?.advisories??[])if(s.name==="rls_uncovered_table"){let{table:i}=s.metadata;typeof i=="string"&&i!==""&&t.add(i)}return t},"ye"),ve=n((a,t,s)=>{let i=new Map,r=n(l=>{let d=i.get(l);if(d!==void 0)return d;let o={cells:{delete:{},insert:{},read:{},update:{}},maskedColumns:[],table:l,uncovered:s.has(l)};return i.set(l,o),o},"r");for(let l of a)r(l.table).cells[l.on]={procedure:l.procedure};for(let l of t){let d=r(l.table);d.maskedColumns.includes(l.column)||d.maskedColumns.push(l.column)}for(let l of s)r(l);return[...i.values()].toSorted((l,d)=>l.table.localeCompare(d.table))},"ge"),Ne=n(a=>{let t=(0,de.c)(17),s;t[0]!==a?(s=a===void 0?{}:a,t[0]=a,t[1]=s):s=t[1];let{onProbe:i}=s,r=z(),l,d;t[2]===Symbol.for("react.memo_cache_sentinel")?(l={},d={live:!0},t[2]=l,t[3]=d):(l=t[2],d=t[3]);let o=O(R.rlsPolicies,l,d),y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y={},t[4]=y):y=t[4];let u=O(R.maskPolicies,y),h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h={},t[5]=h):h=t[5];let v=O(R.getAdvisories,h),N;if(t[6]!==v.data||t[7]!==u.data||t[8]!==i||t[9]!==o||t[10]!==r){let b=null;o.data!==void 0&&(b=Array.isArray(o.data.policies)?o.data.policies:[]);let E=Array.isArray(u.data?.columns)?u.data.columns:[],T=v.data??null,{error:x,errorSource:f,liveError:S}=o,I=b===null?[]:ve(b,E,be(T)),A;t[12]!==S?(A=(0,e.jsx)("div",{className:"flex items-center justify-end",children:(0,e.jsx)(se,{message:S,prefix:"pm"})}),t[12]=S,t[13]=A):A=t[13];let g;t[14]!==x||t[15]!==f?(g=x!==null&&(0,e.jsx)(te,{error:f,testId:"pm-error"}),t[14]=x,t[15]=f,t[16]=g):g=t[16],N=(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-matrix",children:[A,g,b!==null&&I.length===0?(0,e.jsx)(K,{description:r("Add a `definePolicy` and wire it through `.use(rls(...))` to populate this matrix."),testId:"pm-empty",title:r("No policy")}):(0,e.jsxs)(ae,{"data-testid":"pm-table",children:[(0,e.jsx)(re,{children:(0,e.jsxs)(Y,{children:[(0,e.jsx)(M,{children:r("Table")}),oe.map(p=>(0,e.jsx)(M,{children:ge(r,p)},p)),(0,e.jsx)(M,{children:r("Masked columns")})]})}),(0,e.jsx)(le,{children:I.map(p=>(0,e.jsxs)(Y,{"data-testid":`pm-row-${p.table}`,children:[(0,e.jsx)(q,{className:"font-mono text-xs",children:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[p.table,p.uncovered&&(0,e.jsx)(F,{"data-testid":`pm-uncovered-${p.table}`,title:r("Uncovered \u2014 reachable without a policy"),variant:"destructive",children:r("Uncovered \u2014 reachable without a policy")})]})}),oe.map(C=>{let $=p.cells[C];return(0,e.jsx)(q,{"data-testid":`pm-cell-${p.table}-${C}`,children:$.procedure===void 0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:r("No policy")}):(0,e.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,e.jsx)(F,{variant:"secondary",children:r("Covered by {procedure}",{procedure:$.procedure})}),i!==void 0&&(0,e.jsx)(k,{className:"h-auto justify-start p-0 text-[11px]","data-testid":`pm-probe-${p.table}-${C}`,onClick:n(()=>{i(p.table,C,$.procedure??"")},"onClick"),size:"xs",type:"button",variant:"ghost",children:r("Probe this")})]})},C)}),(0,e.jsx)(q,{children:p.maskedColumns.length===0?(0,e.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\u2014"}):(0,e.jsx)("span",{className:"flex flex-wrap gap-1",children:p.maskedColumns.map(ke)})})]},p.table))})]})]}),t[6]=v.data,t[7]=u.data,t[8]=i,t[9]=o,t[10]=r,t[11]=N}else N=t[11];return N},"be");function ke(a){return(0,e.jsx)(F,{variant:"outline",children:a},a)}n(ke,"ve");var we=V(R.runAs),Ce=n(()=>{let a=J();return async({args:t,functionPath:s,shardKey:i="",userId:r})=>{let l=we;try{return{kind:"allowed",value:await a.query(l,{args:t,functionPath:s,userId:r},X(i))}}catch(d){return{kind:"denied",message:d instanceof Error?d.message:String(d)}}}},"we"),Pe=n(a=>a===void 0?"undefined":JSON.stringify(a,null,2),"ke"),Se=n(({functions:a,prefill:t,runAsIdentity:s=!1}={})=>{let i=J(),r=z(),l=Ce(),[d,o]=(0,c.useState)(null),[y,u]=(0,c.useState)(null),h=a??d??[],[v,N]=(0,c.useState)(""),[b,E]=(0,c.useState)("{}"),[T,x]=(0,c.useState)(""),[f,S]=(0,c.useState)(""),[I,A]=(0,c.useState)(!1),[g,p]=(0,c.useState)(null),[C,$]=(0,c.useState)(null),B=(0,c.useRef)(-1);(0,c.useEffect)(()=>{if(a!==void 0)return;let m=!1;return i.listFunctions().then(P=>(m||o(P),P)).catch(P=>{m||u(Z(P))}),()=>{m=!0}},[i,a]),(0,c.useEffect)(()=>{if(t===void 0||B.current===t.nonce)return;B.current=t.nonce;let m=t.functionPath;queueMicrotask(()=>{N(m),p(null)})},[t]);let L=v===""?h[0]?.path??"":v,ce=n(async()=>{if(L==="")return;let m;try{m=b.trim()===""?{}:JSON.parse(b)}catch(P){$(r("Invalid JSON args: {message}",{message:P.message})),p(null);return}$(null),A(!0);try{let P=await l({args:m,functionPath:L,shardKey:T.trim(),userId:f.trim()});p(P)}finally{A(!1)}},"Q"),me=n(()=>{j(ce())},"V"),pe=n(m=>{N(m.target.value)},"X"),fe=n(m=>{E(m.target.value)},"Z"),ue=n(m=>{S(m.target.value)},"ee");return(0,e.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-permissions-playground",children:[y!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-discover-error",role:"alert",children:y}),!s&&(0,e.jsx)(K,{description:r("Dev only: runs the selected function as this user over the admin gate so you can test auth and RLS."),testId:"pp-gate",title:r("Set `runAsIdentity` to forge an identity and probe access.")}),(0,e.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border border-border p-3",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(w,{htmlFor:"pp-function",children:r("Function")}),(0,e.jsx)("select",{"aria-label":r("Function"),className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","data-testid":"pp-function",id:"pp-function",onChange:pe,value:L,children:h.map(m=>(0,e.jsxs)("option",{value:m.path,children:[m.path," (",m.kind,")"]},m.path))})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(w,{htmlFor:"pp-args",children:r("Arguments")}),(0,e.jsx)(ie,{"aria-label":r("Arguments"),className:"font-mono text-xs","data-testid":"pp-args",id:"pp-args",onChange:fe,value:b})]}),(0,e.jsx)(ee,{onChange:x,testId:"pp-shard",value:T}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)(w,{htmlFor:"pp-user",children:r("Run as (userId)")}),(0,e.jsx)(_,{"aria-label":r("Identity (userId) to run as"),className:"font-mono text-xs","data-testid":"pp-user",id:"pp-user",onChange:ue,placeholder:r("Leave empty to run as admin"),value:f})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(k,{"data-testid":"pp-run",disabled:!s||I||L==="",onClick:me,type:"button",children:r(I?"Probing\u2026":"Run probe")}),f.trim()!==""&&(0,e.jsx)(F,{"data-testid":"pp-as-badge",variant:"secondary",children:r("as {userId}",{userId:f.trim()})})]})]}),C!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"pp-args-error",role:"alert",children:C}),g!==null&&g.kind==="allowed"&&(0,e.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-allowed",children:[(0,e.jsx)(F,{variant:"secondary",children:r("Allowed")}),(0,e.jsx)("pre",{className:"overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-xs","data-testid":"pp-result",children:Pe(g.value)})]}),g!==null&&g.kind==="denied"&&(0,e.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"pp-outcome-denied",children:[(0,e.jsx)(F,{variant:"destructive",children:r("Denied")}),(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":"pp-denied",role:"alert",children:g.message})]})]})},"Pe"),Ie="/__lunora/policy-scaffold",Ae={"already-wired":"That procedure already has an rls(...) policy wired in.","file-exists":"A policy file with that name already exists \u2014 pick another name or edit it by hand.","invalid-identifier":"Name, table, and policy-set must be plain identifiers (letters, digits, _ or $).","unknown-procedure":"No exported procedure was found at that file path.","unsupported-procedure-shape":"That procedure uses the bare query({\u2026}) form \u2014 convert it to the builder form (c.use(\u2026).query(\u2026)) before wiring RLS."},Fe=n(async a=>{let t=await fetch(Ie,{body:JSON.stringify(a),headers:{"Content-Type":"application/json"},method:"POST"}),s=await t.json();if(s.needsManualEdit===!0)return{kind:"needs-manual-edit",message:s.message??"This change must be made by hand."};if(t.ok)return{diagnostics:s.diagnostics??[],kind:"ok",label:s.fileName??s.exportName??""};let i=s.error;return{kind:"error",message:i===void 0?`policy scaffold failed (${String(t.status)})`:Ae[i]??i}},"Ie"),ne={exportName:"",filePath:"",policyName:"",policies:"",tableName:""},_e=n(()=>{let a=z(),[t,s]=(0,c.useState)(null),[i,r]=(0,c.useState)(!1),[l,d]=(0,c.useState)(null),[o,y]=(0,c.useState)(ne),u=n(x=>{let f=x.target.name,{value:S}=x.target;y(I=>({...I,[f]:S}))},"f"),h=n(()=>{s(null),y(ne)},"h"),v=n(async x=>{r(!0),d(null);try{let f=await Fe(x);d(f),f.kind==="ok"&&h()}catch(f){d({kind:"error",message:f instanceof Error?f.message:String(f)})}finally{r(!1)}},"v"),N=n(()=>{j(v({kind:"scaffoldPolicy",name:o.policyName.trim(),table:o.tableName.trim()}))},"N"),b=n(()=>{j(v({exportName:o.exportName.trim(),filePath:o.filePath.trim(),kind:"wireRls",policies:o.policies.trim()}))},"b"),E=n(()=>{d(null),s("scaffold")},"_"),T=n(()=>{d(null),s("wire")},"A");return(0,e.jsxs)(U,{"data-testid":"policy-scaffolder",size:"sm",children:[(0,e.jsxs)(G,{children:[(0,e.jsx)(H,{children:a("Scaffold access rules")}),(0,e.jsx)(Q,{children:a("Writes a new deny-by-default policy file under lunora/, or wires one into a procedure, then reruns codegen. Local dev only.")})]}),(0,e.jsxs)(W,{children:[(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,e.jsx)(k,{"data-testid":"policy-scaffolder-new",onClick:E,size:"xs",type:"button",variant:t==="scaffold"?"default":"outline",children:a("New policy file")}),(0,e.jsx)(k,{"data-testid":"policy-scaffolder-wire",onClick:T,size:"xs",type:"button",variant:t==="wire"?"default":"outline",children:a("Wire into a procedure")})]}),t==="scaffold"&&(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-new-form",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,e.jsx)(w,{htmlFor:"policy-scaffolder-name",children:a("Policy name")}),(0,e.jsx)(_,{"data-testid":"policy-scaffolder-name",id:"policy-scaffolder-name",name:"policyName",onChange:u,value:o.policyName})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,e.jsx)(w,{htmlFor:"policy-scaffolder-table",children:a("Table name")}),(0,e.jsx)(_,{"data-testid":"policy-scaffolder-table",id:"policy-scaffolder-table",name:"tableName",onChange:u,value:o.tableName})]}),(0,e.jsx)(k,{"data-testid":"policy-scaffolder-create",disabled:i||o.policyName.trim()===""||o.tableName.trim()==="",onClick:N,size:"xs",type:"button",children:a(i?"Creating\u2026":"Create policy file")}),(0,e.jsx)(k,{onClick:h,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),t==="wire"&&(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-end gap-2","data-testid":"policy-scaffolder-wire-form",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,e.jsx)(w,{htmlFor:"policy-scaffolder-file",children:a("Procedure file path")}),(0,e.jsx)(_,{"data-testid":"policy-scaffolder-file",id:"policy-scaffolder-file",name:"filePath",onChange:u,value:o.filePath})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,e.jsx)(w,{htmlFor:"policy-scaffolder-export",children:a("Exported procedure")}),(0,e.jsx)(_,{"data-testid":"policy-scaffolder-export",id:"policy-scaffolder-export",name:"exportName",onChange:u,value:o.exportName})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1 text-xs",children:[(0,e.jsx)(w,{htmlFor:"policy-scaffolder-policies",children:a("Policy set identifier")}),(0,e.jsx)(_,{"data-testid":"policy-scaffolder-policies",id:"policy-scaffolder-policies",name:"policies",onChange:u,value:o.policies})]}),(0,e.jsx)(k,{"data-testid":"policy-scaffolder-apply",disabled:i||o.filePath.trim()===""||o.exportName.trim()===""||o.policies.trim()==="",onClick:b,size:"xs",type:"button",children:a(i?"Wiring\u2026":"Wire RLS")}),(0,e.jsx)(k,{onClick:h,size:"xs",type:"button",variant:"ghost",children:a("Cancel")})]}),l?.kind==="error"&&(0,e.jsx)("p",{className:"mt-3 text-sm text-destructive","data-testid":"policy-scaffolder-error",role:"alert",children:l.message}),l?.kind==="needs-manual-edit"&&(0,e.jsx)("p",{className:"mt-3 text-sm text-amber-600 dark:text-amber-500","data-testid":"policy-scaffolder-manual",role:"alert",children:a("This change must be made by hand \u2014 the scaffolder only adds new, deny-by-default rules.")}),l?.kind==="ok"&&(0,e.jsxs)("div",{className:"mt-3 flex flex-col gap-1","data-testid":"policy-scaffolder-ok",children:[(0,e.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-500",children:a("Scaffolded {label} and reran codegen. Fill in the `when` predicates before relying on it.",{label:l.label})}),l.diagnostics.length>0&&(0,e.jsx)("ul",{className:"flex flex-col gap-0.5","data-testid":"policy-scaffolder-diagnostics",children:l.diagnostics.map(x=>(0,e.jsx)("li",{className:"font-mono text-[11px] text-destructive",children:x},x))})]})]})]})},"$e"),Be=n(({functions:a,runAsIdentity:t=!1,schemaEditable:s=!1}={})=>{let i=z(),[r,l]=(0,c.useState)(void 0),d=n((o,y,u)=>{u!==""&&l(h=>({functionPath:u,nonce:(h?.nonce??0)+1}))},"d");return(0,e.jsxs)("div",{className:"flex flex-col gap-8","data-testid":"lunora-permissions",children:[(0,e.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i("Permissions")})}),(0,e.jsx)(Ne,{onProbe:d})]}),(0,e.jsx)("section",{className:"flex flex-col gap-3",children:(0,e.jsxs)(U,{className:"gap-0 py-0",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i("Probe")})}),(0,e.jsxs)(W,{className:"px-4 py-4",children:[(0,e.jsx)("p",{className:"mb-3 text-sm text-muted-foreground",children:i("Pick a function and an identity, then run it to see the access outcome.")}),(0,e.jsx)(Se,{functions:a,prefill:r,runAsIdentity:t})]})]})}),s&&(0,e.jsx)("section",{className:"flex flex-col gap-2",children:(0,e.jsx)(_e,{})})]})},"Ye");export{Be as PermissionsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as v,l as f}from"./chunk-KLLYGWNF.js";import{a as b,e as N,g,h as k}from"./chunk-UHHTEBC3.js";var w=N(g(),1);var r=N(k(),1);var L=b(p=>{let e=(0,w.c)(8),{value:d}=p;if(d==null){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,r.jsx)("span",{className:"text-muted-foreground/50 italic",children:"NULL"}),e[0]=a):a=e[0],a}let t;e[1]!==d?(t=f(d),e[1]=d,e[2]=t):t=e[2];let o;e[3]!==d?(o=f(d),e[3]=d,e[4]=o):o=e[4];let l;return e[5]!==t||e[6]!==o?(l=(0,r.jsx)("span",{title:t,children:o}),e[5]=t,e[6]=o,e[7]=l):l=e[7],l},"y"),z=b(p=>{let e=(0,w.c)(22),{columns:d,rows:t}=p,o=v(),l;e[0]!==o?(l=o("Field"),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==l?(a=(0,r.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase text-muted-foreground",children:l}),e[2]=l,e[3]=a):a=e[3];let n;if(e[4]!==t||e[5]!==o){let s;e[7]!==o?(s=b((x,h)=>(0,r.jsx)("th",{className:"border-b border-border px-3 py-1.5 text-start font-mono text-[11px] tracking-wide uppercase tabular-nums text-muted-foreground",children:o("Row {n}",{n:h+1})},h),"s"),e[7]=o,e[8]=s):s=e[8],n=t.map(s),e[4]=t,e[5]=o,e[6]=n}else n=e[6];let c;e[9]!==a||e[10]!==n?(c=(0,r.jsx)("thead",{className:"sticky top-0 z-10 bg-muted",children:(0,r.jsxs)("tr",{children:[a,n]})}),e[9]=a,e[10]=n,e[11]=c):c=e[11];let i;if(e[12]!==d||e[13]!==t){let s;e[15]!==t?(s=b(x=>(0,r.jsxs)("tr",{className:"hover:bg-muted/40",children:[(0,r.jsx)("th",{className:"border-b border-e border-border px-3 py-1.5 text-start font-mono font-medium whitespace-nowrap",scope:"row",children:x}),t.map((h,y)=>(0,r.jsx)("td",{className:"max-w-md truncate border-b border-border px-3 py-1.5 font-mono",children:(0,r.jsx)(L,{value:h[x]})},y))]},x),"s"),e[15]=t,e[16]=s):s=e[16],i=d.map(s),e[12]=d,e[13]=t,e[14]=i}else i=e[14];let m;e[17]!==i?(m=(0,r.jsx)("tbody",{children:i}),e[17]=i,e[18]=m):m=e[18];let u;return e[19]!==c||e[20]!==m?(u=(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-auto","data-testid":"db-transposed",children:(0,r.jsxs)("table",{className:"border-collapse text-xs",children:[c,m]})}),e[19]=c,e[20]=m,e[21]=u):u=e[21],u},"L"),F=b(({children:p,layout:e="card",testId:d})=>(0,r.jsx)("div",{className:e==="fill"?"flex min-h-0 flex-1 flex-col overflow-hidden border-t border-border":"overflow-x-auto border border-border bg-card","data-testid":d,children:p}),"z");export{L as a,z as b,F as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C}from"./chunk-SA6MBPBL.js";import{a as _}from"./chunk-SKJZDOHG.js";import{a as $,b as z,c as B,d as g,e as n,f as i}from"./chunk-Q5WXTZWX.js";import{a as S,e as I}from"./chunk-JKPK25JO.js";import{c as w}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import"./chunk-4FNHHFWR.js";import{f as b}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{a as j}from"./chunk-6OKDCV7J.js";import{d as k,m as R,q as T}from"./chunk-KLLYGWNF.js";import"./chunk-UDZY7MKE.js";import{a as h,e as y,g as P,h as Q}from"./chunk-UHHTEBC3.js";var L=y(P(),1);var s=y(Q(),1);var E=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",E],e[0]=u):u=e[0];let p;e[1]!==l?(p=h(()=>l.listAuthSessions({limit:E}),"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],C(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)($,{"data-testid":"auth-sessions-table",children:[(0,s.jsx)(z,{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)(B,{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:T(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,3 @@
|
|
|
1
|
+
import{a as q}from"./chunk-C4VURT57.js";import{c as k}from"./chunk-SKJZDOHG.js";import{a as y,e as w}from"./chunk-JKPK25JO.js";import{a as P}from"./chunk-UZYGEOWY.js";import{a as D}from"./chunk-V66TSUKV.js";import{b as j}from"./chunk-UWF5DOGV.js";import"./chunk-PTTDIYGP.js";import"./chunk-7Z5QEFR4.js";import"./chunk-46IB4C4Q.js";import{c as $}from"./chunk-UY2Y5CXB.js";import"./chunk-ZFWEPGWG.js";import"./chunk-4FNHHFWR.js";import{a as f}from"./chunk-GXZAXNZI.js";import{f as L}from"./chunk-KJTLW5W2.js";import"./chunk-UREY4GLG.js";import{d as J,f as I,g as S,h as b,m as v}from"./chunk-KLLYGWNF.js";import{b as N}from"./chunk-UDZY7MKE.js";import{a,e as A,f as U,h as z}from"./chunk-UHHTEBC3.js";var c=A(U(),1);var e=A(z(),1);var X=I(f.exportShard),G=I(f.importShard),H=a(m=>m.map(s=>JSON.stringify(s)).join(`
|
|
2
|
+
`),"X"),Q=a(m=>{let s=[],x=m.split(`
|
|
3
|
+
`);for(let[t,l]of x.entries()){let h=l.trim();if(h==="")continue;let n=JSON.parse(h);if(typeof n!="object"||n===null)throw new N("INTERNAL",`line ${(t+1).toString()}: expected a { table, doc } object`);let o=n;if(typeof o.table!="string"||typeof o.doc!="object"||o.doc===null||Array.isArray(o.doc))throw new N("INTERNAL",`line ${(t+1).toString()}: expected a { table, doc } object`);s.push(o)}return s},"z"),ie=a(({initialShardKey:m})=>{let s=L(),x=k(),t=J(),[l,h]=(0,c.useState)(m??""),[n,o]=(0,c.useState)(""),[E,p]=(0,c.useState)(!1),[C,u]=(0,c.useState)(null),[i,g]=(0,c.useState)(null),[O,T]=(0,c.useState)(null),R=a(async()=>{p(!0),u(null),g(null);try{let r=await s.query(X,{},S(l));j(l),o(H(r.rows)),T(r.rows.length)}catch(r){u(b(r))}finally{p(!1)}},"T"),_=a(async()=>{p(!0),u(null),g(null),T(null);let r;try{r=Q(n)}catch(d){u(t("Invalid NDJSON: {message}",{message:b(d)})),p(!1);return}try{let d=await s.query(G,{rows:r},S(l));j(l),g(d),x(f.readTablePage),x(f.listTables)}catch(d){u(b(d))}finally{p(!1)}},"C"),B=i===null?0:Object.values(i.inserted).reduce((r,d)=>r+d,0),F=a(()=>{v(R())},"k"),K=a(()=>{v(_())},"J"),M=a(r=>{o(r.target.value)},"q");return(0,e.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"lunora-export-import",children:[(0,e.jsxs)(y,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Export")})}),(0,e.jsxs)(w,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)(D,{onChange:h,testId:"ei-shard-input",value:l}),(0,e.jsx)($,{"data-testid":"ei-export",disabled:E,onClick:F,type:"button",children:t("Export")})]}),O!==null&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"ei-export-result",children:t("Exported {count} rows.",{count:O})})]})]}),(0,e.jsxs)(y,{className:"rounded-xl border border-border bg-card shadow-xs",children:[(0,e.jsx)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsx)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Import")})}),(0,e.jsxs)(w,{className:"flex flex-col gap-3 p-4",children:[(0,e.jsx)(P,{"aria-label":"NDJSON",className:"font-mono text-xs min-h-40 rounded-md","data-testid":"ei-ndjson",onChange:M,placeholder:'{"table":"messages","doc":{\u2026}}',value:n}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,e.jsx)(q,{confirmLabel:t("Import (writes rows)?"),disabled:E||n.trim()==="",onConfirm:K,testId:"ei-import",children:t("Import")})}),i!==null&&(0,e.jsxs)("div",{className:"flex flex-col gap-2","data-testid":"ei-import-result",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t("Inserted {inserted}, {conflicts} conflicts, {errors} errors.",{conflicts:i.conflicts,errors:i.errors.length,inserted:B})}),i.errors.length>0&&(0,e.jsx)("ul",{className:"flex flex-col gap-1","data-testid":"ei-import-errors",children:i.errors.map(r=>(0,e.jsx)("li",{className:"text-xs text-destructive",children:t("line {line} ({table}): {message}",{line:r.line,message:r.message,table:r.table})},`${r.table}-${r.line.toString()}`))})]})]})]}),C!==null&&(0,e.jsx)("p",{className:"text-sm text-destructive","data-testid":"ei-error",role:"alert",children:C})]})},"ne");export{ie as ExportImportPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h}from"./chunk-725RLB7D.js";import{a as t}from"./chunk-UHHTEBC3.js";var s=t((o,i,m)=>h(o,e=>{i(e.height>0?e:{height:m,width:e.width})}),"m");export{s as a};
|