dirigent-server 0.22.0__tar.gz → 0.23.0__tar.gz
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.
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/PKG-INFO +5 -5
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/pyproject.toml +5 -5
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/pyproject.toml.orig +5 -5
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/messages.py +4 -5
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/schemas.py +53 -16
- dirigent_server-0.22.0/src/dirigent_server/static/assets/AdminOnly-Di7pCILM.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/AdminOnly-CdJ1ded0.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Alerting-B5sI7bkS.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Blocks-Bv1m2JIH.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Breadcrumb-CctFxp-h.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Breadcrumb-w3EMx9zM.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/ConnectionFields-HTVyzXLM.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Connections-Cy5CmtxJ.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Dashboard-DQpEKL7c.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/ExamplePanel-B8fMMGHT.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/ExamplePanel-Bk9Am0Hf.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Examples-p3LtYgUq.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Examples-D_j1Eck8.js +2 -2
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Instant-9fAZuDCc.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Instant-CihfxyJ1.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/JsonBlock-BRHbezyM.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/ListTable-vD3vfJJc.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/ListTable-A_dkU0ci.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Overview-BA7fmDg4.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Overview-BD118wP-.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/PageState-Dqk77uol.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/PageState-CuZbHz6s.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Panel-CdiywbkF.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Panel-COl_eBj1.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Picker-DdukB8mz.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Picker-BUMFpPCz.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelineEditor-B3ym720q.js +2 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelineGraph-BZhB7E7N.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelinePreview-C4b75dOj.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/PipelineTab-DibWKiQR.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelineTab-CICtEZUo.js +2 -2
- dirigent_server-0.22.0/src/dirigent_server/static/assets/ProgramReference-BDstV6zZ.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/ProgramReference-BEfxZwxT.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Refusal-CkWHMyRD.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Refusal-3GHMZOnu.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/RunDetail-nkC4jwxI.js +3 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/RunGraph-B-FMnqWE.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/SchemaForm-ByfDLufz.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Schemas-PtKVK80Z.js +10 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/SettingsDialog-CdQvlI8u.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/StarterPicker-BJw1pafi.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/StarterPicker-Bsc3wsmp.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/StepPorts-DUfs-QPy.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/StepPorts-CBb-ntoM.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/TileCard-g50S83Uu.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Triggers-C23ermTW.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Users-DoAN95TI.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Users-BKibVm5A.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/WindowedPane-r-8QnCb_.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/WindowedPane-B5QHXRJT.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Workers-oOWO1UN0.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/Workers-CDXpyuHv.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/WorkersTable-BXjGStKj.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/WorkersTable-LugQKhcG.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/api-BE2JXton.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/api-B9HrzKUX.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/auth-DdhSYe4e.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/auth-QgZsjd0d.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/badge-D5itJPkc.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/badge-CzFHv2r3.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/blocks-DCUqC697.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/chevron-down-CxU_G9N3.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/connections-ENTr1Nsd.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/copy-Bu7JXtPR.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/copy-BXKuMpY5.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/dropdown-menu-DV7wG0Bs.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/dropdown-menu-BHh5eZwx.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/examples-NA2YGKLT.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/file-braces-C7psBXD2.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/file-braces-CTPaWRnZ.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/format-BtF8uNWf.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/format-D2kQLRJs.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/glyphs-Cc7B_n1T.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/glyphs-CaFpiNjJ.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/index-DZ7D7u3R.css +2 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/index-C1i6SZjT.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/index-DcrUT8O1.js +3 -3
- dirigent_server-0.22.0/src/dirigent_server/static/assets/input-CjUmiL3f.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/input-sbz1EN8t.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/labels-Dp8H1wzG.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/nav-OVPYHMkU.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/nav-kCAjFkWN.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/paging-C4feZMNQ.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/pipelines-Da2DZJX0.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/play-BR8D4K_V.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/play-BEK7f0g4.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/resolveAriaLabelledBy-P_cvqa1_.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/resolveAriaLabelledBy-oo0FwAnY.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/schemas-BJXljAsa.js +1 -0
- dirigent_server-0.22.0/src/dirigent_server/static/assets/status-BnsNd2jz.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/status-PejJT5B-.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/tooltip-BUMTCKGt.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/tooltip-Bas36yZU.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/triggers-BNxqzLIW.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/triggers-DD6LKQNg.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/users-7jLF2mM8.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/users-CgBtM5Vf.js +1 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/workers-BHK2ZmId.js → dirigent_server-0.23.0/src/dirigent_server/static/assets/workers-D21cApnc.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/x-C07Lrlf8.js +1 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/index.html +20 -20
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Alerting-CNkD2kQW.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Blocks-IZvOSgQU.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Connections-D7XEspuJ.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Dashboard-BIRNuuqI.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/JsonBlock-DLW6eaGe.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/PipelineEditor-Cci7EXN8.js +0 -2
- dirigent_server-0.22.0/src/dirigent_server/static/assets/PipelineGraph-D_Hoq5jt.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/PipelinePreview-DnTtggz_.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/RunDetail-DXrFy7RR.js +0 -3
- dirigent_server-0.22.0/src/dirigent_server/static/assets/RunGraph-B_ptUBM0.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/SchemaForm-DfQmkkf6.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Schemas-DwI-TOMn.js +0 -10
- dirigent_server-0.22.0/src/dirigent_server/static/assets/SettingsDialog-2ku_zJjo.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/TileCard-XVHftgGm.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/Triggers-CTV54kJX.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/blocks-Ch7prU7B.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/chevron-down-BEKQnX9p.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/connections-C45cNbZS.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/examples-BPba0gMX.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/index-BATxGpHo.css +0 -2
- dirigent_server-0.22.0/src/dirigent_server/static/assets/labels-D4COsPsJ.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/paging-DoahVifb.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/pipelines-BO9VNBsW.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/schemas-C-PU1-EJ.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/select-C8A0wT7K.js +0 -1
- dirigent_server-0.22.0/src/dirigent_server/static/assets/x-CIbrmauw.js +0 -1
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/LICENSE +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/README.md +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/THIRD_PARTY_NOTICES.md +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/__init__.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/app.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/dependencies.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/errors.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/health.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/logging.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/pagination.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/py.typed +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/__init__.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/alerts.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/auth.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/blocks.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/connections.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/examples.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/hooks.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/labels.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/pipelines.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/playground.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/runs.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/schema.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/system.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/trigger_documents.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/triggers.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/users.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/routes/workers.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/security.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/.gitkeep +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/CodeEditor-C4OnjBMt.css +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/CodeEditor-DsxK1EAQ.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/Description-C-byz7P3.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/KindChip-CwU_Xxdy.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/Mark-DQR2php6.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/Markdown-D4x5xD_I.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/Segmented-KaDiGiyr.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/chunk-OB3PAWPO-m4Sckj1b.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/codicon-DCmgc-ay.ttf +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/dist-CvOdB3Md.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/docs-CCoB3shg.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/editor.worker-CIvRzd4O.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/elk-engine-Bm7I_NRI.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/elk-worker.min-DfmSo98M.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/identity-BNZxCf_y.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/idle-DnO3aHK7.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/json.worker-fczZDBja.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/jsonMode-DzxZa00C.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/panels-D1Fnei43.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/preferences-SNZNX5Se.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/preload-helper-BZ1Pz5am.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/rolldown-runtime-Dd_uD5pT.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/shell-CC2rA5mh.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/sql-NEE52Syq.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/starters-DexsdOaG.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/store-D-5yFBN1.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/textarea-D86x5ut1.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/twig-De2hgUGE.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/use-heartbeat-C3WWagro.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/use-store-CZcp6jmY.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/utils-CT7ZGLfR.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/yaml-D-Hjyunz.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/assets/yaml.worker-B2SaT_wA.js +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/favicon-32.png +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/static/logo.png +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/transactions.py +0 -0
- {dirigent_server-0.22.0 → dirigent_server-0.23.0}/src/dirigent_server/ui.py +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dirigent-server
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.23.0
|
|
4
4
|
Summary: Dirigent FastAPI server: the REST API, its authentication, and the health probes.
|
|
5
5
|
License-Expression: LicenseRef-Proprietary
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
License-File: THIRD_PARTY_NOTICES.md
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
-
Requires-Dist: dirigent-client==0.
|
|
11
|
-
Requires-Dist: dirigent-common==0.
|
|
12
|
-
Requires-Dist: dirigent-core==0.
|
|
13
|
-
Requires-Dist: dirigent-examples==0.
|
|
10
|
+
Requires-Dist: dirigent-client==0.23.0
|
|
11
|
+
Requires-Dist: dirigent-common==0.23.0
|
|
12
|
+
Requires-Dist: dirigent-core==0.23.0
|
|
13
|
+
Requires-Dist: dirigent-examples==0.23.0
|
|
14
14
|
Requires-Dist: fastapi>=0.141.1
|
|
15
15
|
Requires-Python: >=3.13
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dirigent-server"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.23.0"
|
|
4
4
|
description = "Dirigent FastAPI server: the REST API, its authentication, and the health probes."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -14,10 +14,10 @@ classifiers = [
|
|
|
14
14
|
"Programming Language :: Python :: 3.13",
|
|
15
15
|
]
|
|
16
16
|
dependencies = [
|
|
17
|
-
"dirigent-client==0.
|
|
18
|
-
"dirigent-common==0.
|
|
19
|
-
"dirigent-core==0.
|
|
20
|
-
"dirigent-examples==0.
|
|
17
|
+
"dirigent-client==0.23.0",
|
|
18
|
+
"dirigent-common==0.23.0",
|
|
19
|
+
"dirigent-core==0.23.0",
|
|
20
|
+
"dirigent-examples==0.23.0",
|
|
21
21
|
"fastapi>=0.141.1",
|
|
22
22
|
]
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dirigent-server"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.23.0"
|
|
4
4
|
description = "Dirigent FastAPI server: the REST API, its authentication, and the health probes."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -11,10 +11,10 @@ classifiers = [
|
|
|
11
11
|
"Programming Language :: Python :: 3.13",
|
|
12
12
|
]
|
|
13
13
|
dependencies = [
|
|
14
|
-
"dirigent-client==0.
|
|
15
|
-
"dirigent-common==0.
|
|
16
|
-
"dirigent-core==0.
|
|
17
|
-
"dirigent-examples==0.
|
|
14
|
+
"dirigent-client==0.23.0",
|
|
15
|
+
"dirigent-common==0.23.0",
|
|
16
|
+
"dirigent-core==0.23.0",
|
|
17
|
+
"dirigent-examples==0.23.0",
|
|
18
18
|
"fastapi>=0.141.1",
|
|
19
19
|
]
|
|
20
20
|
|
|
@@ -102,18 +102,17 @@ PLAYGROUND_BAD_KNOB = SERVER.define("playground_bad_knob", "{detail}")
|
|
|
102
102
|
|
|
103
103
|
PLAYGROUND_HEADER_REFUSED = SERVER.define(
|
|
104
104
|
"playground_header_refused",
|
|
105
|
-
"the playground will not set {header} on itself:
|
|
106
|
-
"this origin to another site, or weakens what a browser enforces here
|
|
105
|
+
"the playground will not set {header} on itself: it sets no header that plants a cookie, "
|
|
106
|
+
"opens this origin to another site, or weakens what a browser enforces here",
|
|
107
107
|
)
|
|
108
108
|
|
|
109
109
|
PLAYGROUND_OFF_INSTANCE = SERVER.define(
|
|
110
110
|
"playground_off_instance",
|
|
111
|
-
"{to} is not a path on this instance
|
|
112
|
-
"open redirect is a phishing tool wearing this instance's own domain",
|
|
111
|
+
"{to} is not a path on this instance: the playground redirects only to paths on this instance",
|
|
113
112
|
)
|
|
114
113
|
|
|
115
114
|
PLAYGROUND_UNAUTHENTICATED = SERVER.define(
|
|
116
115
|
"playground_unauthenticated",
|
|
117
116
|
"this route wants a credential: the basic pair {username}/{username}, or the documented "
|
|
118
|
-
"bearer token. Both are public constants
|
|
117
|
+
"bearer token. Both are public constants",
|
|
119
118
|
)
|
|
@@ -7,16 +7,25 @@ read from its own keywords -- ``$id`` for the code, ``title`` for the name, ``de
|
|
|
7
7
|
for the description -- when a write does not give one, so what is stored is a portable
|
|
8
8
|
schema rather than a wrapper around one. A stored body is checked to be a valid JSON Schema
|
|
9
9
|
(Draft 2020-12) before anything lands.
|
|
10
|
+
|
|
11
|
+
A stored schema is named from inside a pipeline document's JSON -- under ``requires.schemas``,
|
|
12
|
+
and in every step config field its block declares as a schema reference -- so there is no row
|
|
13
|
+
to hang a foreign key on. The pipelines naming a code are read from each stored pipeline's
|
|
14
|
+
current version and ride on every response as ``used_by``. Removing a schema that has any is
|
|
15
|
+
refused; changing one is not, and the answer carries them so the caller decides with them in
|
|
16
|
+
view.
|
|
10
17
|
"""
|
|
11
18
|
|
|
19
|
+
from collections.abc import Sequence
|
|
20
|
+
|
|
12
21
|
import sqlalchemy as sa
|
|
13
22
|
from fastapi import APIRouter, Response, status
|
|
14
23
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
15
24
|
|
|
16
25
|
from dirigent_client.schemas import Page, SchemaIn, SchemaOut, SchemaUpdate
|
|
17
26
|
from dirigent_core.models import Schema
|
|
18
|
-
from dirigent_core.schemas import check_valid_schema, resolve_identity
|
|
19
|
-
from dirigent_server.dependencies import SessionDep
|
|
27
|
+
from dirigent_core.schemas import SchemaInUse, check_valid_schema, resolve_identity, schema_users
|
|
28
|
+
from dirigent_server.dependencies import ServicesDep, SessionDep
|
|
20
29
|
from dirigent_server.errors import Refusal
|
|
21
30
|
from dirigent_server.messages import NO_SCHEMA, SCHEMA_EXISTS
|
|
22
31
|
from dirigent_server.pagination import DEFAULT_PAGE, AfterParam, LimitParam, clip
|
|
@@ -26,8 +35,8 @@ from dirigent_server.transactions import Transactional
|
|
|
26
35
|
router = APIRouter(route_class=Transactional, tags=["schemas"])
|
|
27
36
|
|
|
28
37
|
|
|
29
|
-
def render(row: Schema) -> SchemaOut:
|
|
30
|
-
"""Render a stored schema for a response."""
|
|
38
|
+
def render(row: Schema, used_by: Sequence[str] = ()) -> SchemaOut:
|
|
39
|
+
"""Render a stored schema for a response, with the pipelines that name it."""
|
|
31
40
|
return SchemaOut(
|
|
32
41
|
id=row.id,
|
|
33
42
|
code=row.code,
|
|
@@ -36,6 +45,7 @@ def render(row: Schema) -> SchemaOut:
|
|
|
36
45
|
body=row.body,
|
|
37
46
|
created_at=row.created_at,
|
|
38
47
|
updated_at=row.updated_at,
|
|
48
|
+
used_by=list(used_by),
|
|
39
49
|
)
|
|
40
50
|
|
|
41
51
|
|
|
@@ -50,16 +60,18 @@ async def find(session: AsyncSession, code: str) -> Schema:
|
|
|
50
60
|
@router.get("/schemas", operation_id="listSchemas", summary="List schemas", response_model=Page[SchemaOut])
|
|
51
61
|
async def list_schemas(
|
|
52
62
|
session: SessionDep,
|
|
63
|
+
services: ServicesDep,
|
|
53
64
|
principal: PrincipalDep,
|
|
54
65
|
after: AfterParam = None,
|
|
55
66
|
limit: LimitParam = DEFAULT_PAGE,
|
|
56
67
|
) -> Page[SchemaOut]:
|
|
57
|
-
"""List every schema the instance holds."""
|
|
68
|
+
"""List every schema the instance holds, each with the pipelines that name it."""
|
|
58
69
|
statement = sa.select(Schema).order_by(Schema.code).limit(limit + 1)
|
|
59
70
|
if after is not None:
|
|
60
71
|
statement = statement.where(Schema.code > after)
|
|
61
72
|
rows = await session.execute(statement)
|
|
62
|
-
|
|
73
|
+
users = await schema_users(session, services.host.catalog())
|
|
74
|
+
found = [render(row, users.get(row.code, ())) for row in rows.scalars()]
|
|
63
75
|
items, following = clip(found, limit, lambda row: row.code)
|
|
64
76
|
return Page(items=items, next=following)
|
|
65
77
|
|
|
@@ -71,7 +83,9 @@ async def list_schemas(
|
|
|
71
83
|
response_model=SchemaOut,
|
|
72
84
|
status_code=status.HTTP_201_CREATED,
|
|
73
85
|
)
|
|
74
|
-
async def create_schema(
|
|
86
|
+
async def create_schema(
|
|
87
|
+
payload: SchemaIn, session: SessionDep, services: ServicesDep, principal: AdminDep
|
|
88
|
+
) -> SchemaOut:
|
|
75
89
|
"""Store a JSON Schema, taking its identity from its own keywords when the write gives none."""
|
|
76
90
|
check_valid_schema(payload.body)
|
|
77
91
|
code, name, description = resolve_identity(
|
|
@@ -83,21 +97,32 @@ async def create_schema(payload: SchemaIn, session: SessionDep, principal: Admin
|
|
|
83
97
|
row = Schema(code=code, name=name, description=description, body=payload.body)
|
|
84
98
|
session.add(row)
|
|
85
99
|
await session.flush()
|
|
86
|
-
|
|
100
|
+
users = await schema_users(session, services.host.catalog())
|
|
101
|
+
return render(row, users.get(row.code, ()))
|
|
87
102
|
|
|
88
103
|
|
|
89
104
|
@router.get("/schemas/{code}", operation_id="getSchema", summary="Read a schema", response_model=SchemaOut)
|
|
90
|
-
async def get_schema(code: str, session: SessionDep, principal: PrincipalDep) -> SchemaOut:
|
|
91
|
-
"""Read one schema by its code."""
|
|
92
|
-
|
|
105
|
+
async def get_schema(code: str, session: SessionDep, services: ServicesDep, principal: PrincipalDep) -> SchemaOut:
|
|
106
|
+
"""Read one schema by its code, with the pipelines that name it."""
|
|
107
|
+
row = await find(session, code)
|
|
108
|
+
users = await schema_users(session, services.host.catalog())
|
|
109
|
+
return render(row, users.get(code, ()))
|
|
93
110
|
|
|
94
111
|
|
|
95
112
|
@router.patch("/schemas/{code}", operation_id="updateSchema", summary="Update a schema", response_model=SchemaOut)
|
|
96
|
-
async def update_schema(
|
|
113
|
+
async def update_schema(
|
|
114
|
+
code: str, payload: SchemaUpdate, session: SessionDep, services: ServicesDep, principal: AdminDep
|
|
115
|
+
) -> SchemaOut:
|
|
97
116
|
"""Replace a schema's body or its labels; the code is fixed once minted.
|
|
98
117
|
|
|
99
118
|
A field left out is left alone; a name or description sent as null is cleared. A body
|
|
100
119
|
sent replaces the stored schema and is checked the same way a create's is.
|
|
120
|
+
|
|
121
|
+
An edit is never refused for being depended on. Correcting a shape every pipeline should
|
|
122
|
+
now validate against is what editing a stored schema is for, the code cannot be changed,
|
|
123
|
+
and whether a new body still admits what a dependent pipeline sends is not a question a
|
|
124
|
+
schema can be asked. So the answer carries the pipelines that name it and the caller
|
|
125
|
+
decides; what is refused is removing the shape from under them, not changing it.
|
|
101
126
|
"""
|
|
102
127
|
row = await find(session, code)
|
|
103
128
|
if payload.changing("name"):
|
|
@@ -108,7 +133,8 @@ async def update_schema(code: str, payload: SchemaUpdate, session: SessionDep, p
|
|
|
108
133
|
check_valid_schema(payload.body)
|
|
109
134
|
row.body = payload.body
|
|
110
135
|
await session.flush()
|
|
111
|
-
|
|
136
|
+
users = await schema_users(session, services.host.catalog())
|
|
137
|
+
return render(row, users.get(code, ()))
|
|
112
138
|
|
|
113
139
|
|
|
114
140
|
@router.delete(
|
|
@@ -117,7 +143,18 @@ async def update_schema(code: str, payload: SchemaUpdate, session: SessionDep, p
|
|
|
117
143
|
summary="Delete a schema",
|
|
118
144
|
status_code=status.HTTP_204_NO_CONTENT,
|
|
119
145
|
)
|
|
120
|
-
async def delete_schema(code: str, session: SessionDep, principal: AdminDep) -> Response:
|
|
121
|
-
"""Remove a schema.
|
|
122
|
-
|
|
146
|
+
async def delete_schema(code: str, session: SessionDep, services: ServicesDep, principal: AdminDep) -> Response:
|
|
147
|
+
"""Remove a schema, refusing one a stored pipeline still names.
|
|
148
|
+
|
|
149
|
+
Applying a document that names a schema the instance does not hold is already refused, so
|
|
150
|
+
a delete that went through here would leave behind exactly the state no apply is allowed
|
|
151
|
+
to create -- and the next apply of an untouched pipeline, or the next attempt of a run in
|
|
152
|
+
flight, would be what discovered it. No foreign key can say so: a schema is named from
|
|
153
|
+
inside a document's JSON, not by a row.
|
|
154
|
+
"""
|
|
155
|
+
row = await find(session, code)
|
|
156
|
+
named = (await schema_users(session, services.host.catalog())).get(code, [])
|
|
157
|
+
if named:
|
|
158
|
+
raise SchemaInUse(code, named)
|
|
159
|
+
await session.delete(row)
|
|
123
160
|
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./labels-
|
|
1
|
+
import{t as e}from"./labels-Dp8H1wzG.js";import{n as t}from"./PageState-CuZbHz6s.js";import{r as n}from"./utils-CT7ZGLfR.js";import{t as r}from"./use-store-CZcp6jmY.js";import{n as i,t as a}from"./auth-QgZsjd0d.js";var o=n(),s={status:403,title:e.refusal.admin_only,code:`server.forbidden`,params:{},detail:e.refusal.shut,problems:[],instance:null};function c({children:e}){let n=r(a);return i(n)?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsx)(t,{loading:!1,problem:s,empty:!1,children:null})}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{a as n,n as r,t as i}from"./labels-Dp8H1wzG.js";import{n as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{i as o,r as s}from"./api-B9HrzKUX.js";import{N as c}from"./dropdown-menu-BHh5eZwx.js";import{r as l}from"./glyphs-CaFpiNjJ.js";import{l as u,n as d,t as f,u as p}from"./PageState-CuZbHz6s.js";import{i as m,t as h}from"./ListTable-A_dkU0ci.js";import{t as g}from"./WindowedPane-B5QHXRJT.js";import{r as _,t as v}from"./utils-CT7ZGLfR.js";import{i as y,n as b,t as x}from"./tooltip-Bas36yZU.js";import{d as S,h as C}from"./paging-C4feZMNQ.js";import{t as w}from"./input-sbz1EN8t.js";import{a as ee,o as T,r as te}from"./panels-D1Fnei43.js";import{l as E}from"./format-D2kQLRJs.js";import{t as D}from"./identity-BNZxCf_y.js";import{r as O,t as k,u as A}from"./pipelines-Da2DZJX0.js";import{A as j,At as ne,E as M,Ft as re,It as N,Lt as P,Mt as ie,Nt as F,Pt as ae,S as oe,b as I,ct as L,ft as R,gt as z,it as se,jt as ce,rt as le,v as ue,x as B}from"./index-DcrUT8O1.js";import{t as de}from"./Description-C-byz7P3.js";import{c as fe,f as pe,n as me,o as he}from"./connections-ENTr1Nsd.js";import{n as V,t as H}from"./Refusal-3GHMZOnu.js";import{t as U}from"./Instant-CihfxyJ1.js";import{t as W}from"./Segmented-KaDiGiyr.js";import{t as G}from"./Mark-DQR2php6.js";import{t as ge}from"./ProgramReference-BEfxZwxT.js";import{t as _e}from"./Picker-BUMFpPCz.js";import{t as ve}from"./AdminOnly-CdJ1ded0.js";var ye={name:`bell-plus`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M15 8h6`,key:`8ybuxh`}],[`path`,{d:`M18 5v6`,key:`g5ayrv`}],[`path`,{d:`M20.002 14.464a9 9 0 0 0 .738.863A1 1 0 0 1 20 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 8.75-5.332`,key:`1abcvy`}]]};ye.node;var be=n(ye),xe={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};xe.node;var Se=n(xe),K=e(t(),1),Ce=[`run_failed`,`run_completed_with_errors`,`run_succeeded`,`run_stuck`],we=[`pending`,`sending`,`sent`,`failed`],Te=`0s`;function Ee(e){return e===Te?i.word.none:e}function De(e){return e.scope===`pipeline`&&e.pipeline!==null?e.pipeline:i.alerting.every_pipeline}function Oe(e){return e===null?null:i.alerting.importance_floor(e)}function ke(e){return e.active&&!e.paused}function Ae(e){return e===`sent`||e===`failed`}function je(e,t=50){let n=new URLSearchParams({limit:String(t)});return e!==null&&n.set(`after`,e),`/alert-rules?${n.toString()}`}function Me(e){return s(je(e))}function Ne(e){return o(`/alert-rules`,`POST`,e)}function Pe(e,t){return o(`/alert-rules/${encodeURIComponent(e)}`,`PATCH`,t)}function Fe(e,t){return Pe(e,{paused:t})}function Ie(e){return s(`/alert-rules/${encodeURIComponent(e)}`,{method:`DELETE`})}var Le={status:``,notifier:``};function Re(e){return e.status!==``||e.notifier!==``}function ze(e,t,n=50){let r=new URLSearchParams({limit:String(n)});return e.status!==``&&r.set(`status`,e.status),e.notifier!==``&&r.set(`notifier`,e.notifier),t!==null&&r.set(`after`,t),`/notifications?${r.toString()}`}function Be(e,t){return s(ze(e,t))}function Ve(e){return s(`/notifications/${encodeURIComponent(e)}`)}function He(e){return o(`/notifications/${encodeURIComponent(e)}/$retry`,`POST`,{})}function Ue(e){return o(`/alert-rules/$test`,`POST`,e)}async function We(){return(await s(`/blocks`)).notifiers.map(e=>e.id)}function Ge(e,t){let n=[];for(let r of e){if(r===`log`){n.push({id:r,notifier:r,connection:null,reachable:!0,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}let e=t.filter(e=>e.kind===r);if(e.length===0){n.push({id:r,notifier:r,connection:null,reachable:!1,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}for(let t of e)n.push({id:`${r}:${t.code}`,notifier:r,connection:t.code,reachable:!0,last_check_at:t.last_check_at,last_check_healthy:t.last_check_healthy,last_check_detail:t.last_check_detail})}return Ye(n)}function Ke(e){return e.connection??e.notifier}function qe(e){return e.connection===null?e.notifier===`log`?null:fe(e.notifier):me(e.connection)}function q(e){if(e.notifier===`log`)return{tone:`good`,label:i.alerting.channel.ready,detail:null};if(!e.reachable)return{tone:`quiet`,label:i.alerting.channel.not_set_up,detail:null};let t=he(e);return{tone:t.tone??`quiet`,label:t.label,detail:t.detail}}var Je={good:0,critical:1,quiet:2};function Ye(e){return e.toSorted((e,t)=>{let n=Je[q(e).tone]-Je[q(t).tone];if(n!==0)return n;let r=e.notifier.localeCompare(t.notifier);return r===0?(e.connection??``).localeCompare(t.connection??``):r})}var Xe=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/u,Ze=/^(?:\d+(?:ms|s|m|h|d|w))+$/u,Qe=i.alerting.subject_references,$e=i.alerting.subject_hint(Qe),et=i.alerting.body_hint,J=`text/x-jinja`;function Y(e){let t=e.trim();return t===``?null:t}var tt=[{value:`global`,label:i.alerting.scope.global},{value:`pipeline`,label:i.alerting.scope.pipeline}],nt=[{value:``,label:i.alerting.importance_any},...k.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))];function rt(e){return e===``?null:e}function it(e){return e===``?null:e}var at=i.alerting.log_target;function ot(e,t){let n=t.filter(t=>t.kind!==`log`&&e.includes(t.kind)).map(e=>({row:e,heading:D(e)})).toSorted((e,t)=>e.row.kind.localeCompare(t.row.kind)||e.heading.title.localeCompare(t.heading.title));return[{value:``,label:at,aside:``,mark:l(`log`)},...n.map(({row:e,heading:t})=>({value:e.code,label:`${t.title} · ${e.kind}`,aside:t.code??``,mark:l(e.kind)}))]}function st(e){if(e.code.trim()===``)return i.alerting.unready.code_missing;if(!Xe.test(e.code.trim()))return i.alerting.unready.code_shape;if(e.scope===`pipeline`&&e.pipeline===``)return i.alerting.unready.pipeline_missing;if(!Ze.test(e.throttle.trim()))return i.alerting.unready.throttle_shape}var X=_();function ct({rule:e,onChanged:t,onDeleted:n,onTest:r}){let[a,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(null),l=s===e.code,d=B(),f=Oe(e.importance),p=(0,K.useCallback)(e=>Be(Le,e),[]),{state:m}=I(p,dt),h=m.rows.filter(t=>t.rule===e.code);return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsxs)(gt,{thing:e,children:[e.paused&&(0,X.jsx)(ht,{children:i.state.armed.paused}),!e.active&&(0,X.jsx)(ht,{children:i.state.armed.off})]}),(0,X.jsx)(de,{text:e.description}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[(0,X.jsx)(Z,{label:i.word.event,children:i.alerting.event[e.event]}),(0,X.jsx)(Z,{label:i.word.scope,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[De(e),f!==null&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f})]})}),(0,X.jsx)(Z,{label:i.word.delivers_through,children:(0,X.jsx)(ft,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Z,{label:i.word.throttle,children:Ee(e.throttle)}),l?(0,X.jsx)(lt,{rule:e,onDone:()=>{c(null)},onSaved:e=>{t(e),c(null)}},e.code):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{label:i.word.subject,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-2`,children:[e.template===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.none}):(0,X.jsx)(`span`,{className:`font-mono text-xs break-all`,children:e.template}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`ghost`,size:`xs`,disabled:!d.may,title:d.why,onClick:()=>{c(e.code)},children:i.action.edit})})]})}),e.body!==null&&(0,X.jsx)(Z,{label:i.word.body,children:(0,X.jsx)(`span`,{className:`line-clamp-3 font-mono text-xs break-words whitespace-pre-wrap`,children:e.body})})]}),(0,X.jsx)(Z,{label:i.alerting.last_sent,children:e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.never}):(0,X.jsx)(U,{at:e.last_sent_at})})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:a||!d.may,title:d.why,onClick:()=>{o(!0),Fe(e.code,!e.paused).then(t,V).finally(()=>{o(!1)})},children:e.paused?i.action.resume:i.action.pause})}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:!d.may,title:d.why,onClick:r,children:i.action.send_test})}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,className:`destructive-action ml-auto`,disabled:a||!d.may,title:d.why,onClick:()=>{o(!0),Ie(e.code).then(n,V).finally(()=>{o(!1)})},children:i.action.delete.verb})})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.alerting.recent_deliveries}),!m.read&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.shell.reading}),m.read&&h.length===0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.deliveries_empty}),(0,X.jsx)(`ul`,{className:`divide-y divide-border`,children:h.map(e=>(0,X.jsxs)(`li`,{className:`row-hover -mx-4 flex items-center gap-2 px-4 py-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:e.subject}),(0,X.jsx)(U,{className:`shrink-0 text-xs text-faint`,at:e.created_at})]},e.id))})]})]})}function lt({rule:e,onDone:t,onSaved:n}){let[r,a]=(0,K.useState)(e.template??``),[o,s]=(0,K.useState)(e.body??``),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),f=`alert-rule/${e.code}/body`,p=`rule-${e.code}-subject`;return(0,X.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-secondary/30 p-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:p,children:i.word.subject}),(0,X.jsx)(w,{id:p,className:`font-mono`,spellCheck:!1,autoComplete:`off`,value:r,placeholder:i.alerting.subject_placeholder,onChange:e=>{a(e.target.value)}}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:$e})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.body}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:et}),(0,X.jsx)(g,{name:i.alerting.body_pane,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,X.jsx)(ge,{mediaType:J}),windowed:(0,X.jsx)(L,{value:o,mediaType:J,path:f,label:i.alerting.body_pane_windowed(i.alerting.body_pane),className:`min-h-0 flex-1`,onChange:s}),children:(0,X.jsx)(L,{value:o,mediaType:J,path:f,label:i.alerting.body_pane,placeholder:i.alerting.body_placeholder,className:`h-40 min-h-32`,onChange:s})})]}),c!==null&&(0,X.jsx)(H,{problem:c}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(C,{variant:`ghost`,size:`sm`,onClick:t,children:i.action.cancel}),(0,X.jsx)(C,{size:`sm`,disabled:u,onClick:()=>{let i={};if(Y(r)!==e.template&&(i.template=Y(r)),Y(o)!==e.body&&(i.body=Y(o)),Object.keys(i).length===0){t();return}d(!0),l(null),Pe(e.code,i).then(n,e=>{l(S(e))}).finally(()=>{d(!1)})},children:u?i.action.save.busy:i.action.save.verb})]})]})}function ut({notification:e,onChanged:t}){let[n,r]=(0,K.useState)(!1),o=B();return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsx)(`div`,{className:`space-y-1`,children:(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm font-semibold`,children:e.subject})]})}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[e.rule===null?(0,X.jsx)(Z,{label:i.alerting.raised_by,children:(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.alerting.raised_by_test})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{label:i.word.event,children:i.alerting.event[e.event]}),(0,X.jsx)(Z,{label:i.word.rule.label,children:(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:e.rule})})]}),(0,X.jsx)(Z,{label:i.word.delivers_through,children:(0,X.jsx)(pt,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Z,{label:i.word.run.label,children:(0,X.jsx)(mt,{notification:e})}),(0,X.jsx)(Z,{label:i.alerting.queued_at,children:(0,X.jsx)(U,{at:e.created_at})}),e.status===`sent`?(0,X.jsx)(Z,{label:i.alerting.sent_at,children:(0,X.jsx)(U,{at:e.sent_at})}):(0,X.jsx)(Z,{label:i.alerting.next_try,children:(0,X.jsx)(U,{at:e.available_at})}),(0,X.jsx)(Z,{label:i.word.attempt.heading,children:i.alerting.attempts_of.bare(e.attempt,e.max_attempts)})]}),e.error!==null&&(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.alerting.channel_said}),(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.latest_refusal_only})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(u,{why:o.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:n||!o.may,title:o.why,onClick:()=>{r(!0),He(e.id).then(t,V).finally(()=>{r(!1)})},children:i.action.retry_now})}),e.run_id!==null&&(0,X.jsx)(C,{variant:`outline`,size:`sm`,render:(0,X.jsx)(a,{to:`/runs/${e.run_id}`}),children:i.alerting.open_run})]})]})}var dt=e=>e.id;function ft({notifier:e,connection:t}){return(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(G,{glyph:l(e)}),(0,X.jsx)(`span`,{className:t===null?`text-sm`:`font-mono text-xs`,children:t??e})]})}function pt({notifier:e,connection:t}){return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:e}),t!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t})]})}function mt({notification:e}){if(e.run_id===null)return(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.alerting.no_run});let t=e.run_pipeline??i.alerting.a_run;return(0,X.jsxs)(a,{className:`text-primary-ink hover:underline`,to:`/runs/${e.run_id}`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:t}),e.run_started_at!==null&&(0,X.jsx)(U,{className:`ml-1.5 text-xs text-muted-foreground`,at:e.run_started_at})]})}function ht({children:e}){return(0,X.jsx)(`span`,{className:`rounded-sm border border-border px-1.5 text-xs text-muted-foreground`,children:e})}function gt({thing:e,children:t}){let n=D(e);return(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:n.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:n.title}),t,n.code!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:n.code})]})}function Z({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(`dt`,{className:`w-32 shrink-0 text-xs text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}var _t={good:`var(--good)`,critical:`var(--critical)`,quiet:`var(--faint)`},vt=`flex min-h-9 items-center gap-2 rounded-full border border-border bg-card py-1 pr-3 pl-2.5 transition-colors`,Q=`hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`;function yt({channels:e,read:t}){let n=p(),r=bt(e.length,t);return n?(0,X.jsx)(Ct,{channels:e,note:r}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.alerting.channels_heading}),r===null?(0,X.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,X.jsx)(`li`,{className:`flex`,children:(0,X.jsx)(xt,{channel:e})},e.id))}):(0,X.jsx)(`p`,{className:r.tone,children:r.text})]})}function bt(e,t){return t?e===0?{text:i.alerting.channels_none,tone:`text-sm text-muted-foreground`}:null:{text:i.shell.reading,tone:`text-sm text-faint`}}function xt({channel:e}){let t=q(e),n=qe(e),r=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(G,{glyph:l(e.notifier)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ke(e)}),(0,X.jsx)(Tt,{tone:t.tone})]}),i=n===null?(0,X.jsx)(`button`,{type:`button`,className:v(vt,Q),children:r}):(0,X.jsx)(a,{to:n,className:v(vt,Q),children:r});return(0,X.jsxs)(x,{children:[(0,X.jsx)(y,{render:i}),(0,X.jsx)(b,{className:`flex-col items-start gap-1`,side:`bottom`,children:(0,X.jsx)(St,{channel:e,view:t})})]})}function St({channel:e,view:t}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`font-medium`,children:[e.notifier,` · `,t.label,e.last_check_at!==null&&(0,X.jsxs)(`span`,{className:`font-normal opacity-70`,children:[` `,E(e.last_check_at)]})]}),e.connection!==null&&(0,X.jsx)(`span`,{className:`font-mono`,children:e.connection}),t.detail!==null&&(0,X.jsx)(`span`,{className:`opacity-70`,children:t.detail})]})}function Ct({channels:e,note:t}){let[n,r]=(0,K.useState)(!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{r(!n)},className:v(`flex min-h-finger w-full items-center gap-2.5 border-b border-border px-1 text-left`,Q),children:[(0,X.jsx)(c,{className:v(`size-4 shrink-0 text-muted-foreground`,n&&`rotate-90`),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-sm font-semibold`,children:i.alerting.channels_heading}),(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-1.5`,"aria-hidden":!0,children:e.map(e=>(0,X.jsx)(Tt,{tone:q(e).tone},e.id))})]}),n&&(t===null?(0,X.jsx)(`table`,{className:`w-full text-sm`,children:(0,X.jsx)(`tbody`,{children:e.map(e=>(0,X.jsx)(wt,{channel:e},e.id))})}):(0,X.jsx)(`p`,{className:t.tone,children:t.text}))]})}function wt({channel:e}){let t=q(e),n=qe(e),r=(0,X.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(G,{glyph:l(e.notifier)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ke(e)})]});return(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-b-0`,children:[(0,X.jsx)(`td`,{className:`w-0 py-2 pr-2 align-middle`,children:(0,X.jsx)(Tt,{tone:t.tone})}),(0,X.jsx)(`td`,{className:`min-w-0 py-2 align-middle`,children:e.connection===null||n===null?r:(0,X.jsx)(a,{to:n,className:v(`control-link flex items-center rounded-md px-1`,Q),children:r})}),(0,X.jsx)(`td`,{className:`w-0 py-2 pl-2 text-right align-middle whitespace-nowrap`,children:t.label===i.alerting.channel.not_set_up&&n!==null?(0,X.jsx)(a,{to:n,className:v(`control-link inline-flex items-center rounded-md text-xs text-primary-ink`,Q),children:i.alerting.set_up_channel(e.notifier)}):e.last_check_at!==null&&(0,X.jsx)(`span`,{className:`text-xs text-faint`,children:E(e.last_check_at)})})]})}function Tt({tone:e}){return(0,X.jsx)(`span`,{className:`status-dot`,style:{"--chip":_t[e]}})}function $({id:e,label:t,value:n,onChange:r,placeholder:i,mono:a,hint:o}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:e,children:t}),(0,X.jsx)(w,{id:e,className:a===!0?`font-mono`:void 0,spellCheck:!1,autoComplete:`off`,value:n,placeholder:i,onChange:e=>{r(e.target.value)}}),o!==void 0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:o})]})}function Et({id:e,options:t,value:n,onChange:r}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:e,children:i.word.delivers_through}),(0,X.jsx)(_e,{id:e,label:i.word.delivers_through,value:n,options:t,placeholder:i.alerting.target_search,onChange:r})]})}var Dt=`0s`,Ot=`alert-rule/new/body`,kt=i.alerting.body_pane;function At({open:e,onOpenChange:t,notifiers:n,connections:r,onCreated:a}){let[o,s]=(0,K.useState)(``),[c,l]=(0,K.useState)(``),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(`run_failed`),[h,_]=(0,K.useState)(`global`),[v,y]=(0,K.useState)(``),[b,x]=(0,K.useState)(``),[w,ee]=(0,K.useState)(``),[T,te]=(0,K.useState)(``),[E,D]=(0,K.useState)(``),[O,k]=(0,K.useState)(Dt),[A,M]=(0,K.useState)(null),[P,F]=(0,K.useState)(!1),I=jt(e),R=B(),z=oe(R.why,st({code:o,scope:h,pipeline:v,throttle:O}));return(0,X.jsx)(ne,{open:e,onOpenChange:t,children:(0,X.jsxs)(ie,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-3xl`,showCloseButton:!1,children:[(0,X.jsx)(re,{children:(0,X.jsx)(N,{children:i.alerting.new_rule.button})}),(0,X.jsxs)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsx)($,{id:`rule-code`,label:i.word.code,value:o,onChange:s,placeholder:i.alerting.code_placeholder,mono:!0}),(0,X.jsx)($,{id:`rule-name`,label:i.word.name.label,value:c,onChange:l,placeholder:i.alerting.name_placeholder})]}),(0,X.jsx)($,{id:`rule-description`,label:i.word.description,value:d,onChange:f,placeholder:i.alerting.description_placeholder}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.event}),(0,X.jsx)(W,{label:i.word.event,size:`md`,value:p,options:Ce.map(e=>({value:e,label:i.alerting.event[e]})),onChoose:m})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.scope}),(0,X.jsx)(W,{label:i.word.scope,size:`md`,value:h,options:tt,onChoose:_})]}),h===`pipeline`&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:`rule-pipeline`,children:i.word.pipeline.label}),(0,X.jsx)(_e,{id:`rule-pipeline`,label:i.word.pipeline.label,value:v,options:I,placeholder:i.alerting.pipeline_search,onChange:y})]})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.importance}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.importance_hint}),(0,X.jsx)(W,{label:i.word.importance,size:`md`,value:b,options:nt,onChoose:x})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,X.jsx)(Et,{id:`rule-connection`,options:ot(n,r),value:w,onChange:ee})}),(0,X.jsx)($,{id:`rule-subject`,label:i.word.subject,value:T,onChange:te,placeholder:i.alerting.subject_placeholder,mono:!0,hint:$e}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.body}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:et}),(0,X.jsx)(g,{name:kt,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,X.jsx)(ge,{mediaType:J}),windowed:(0,X.jsx)(L,{value:E,mediaType:J,path:Ot,label:i.alerting.body_pane_windowed(kt),className:`min-h-0 flex-1`,onChange:D}),children:(0,X.jsx)(L,{value:E,mediaType:J,path:Ot,label:kt,placeholder:i.alerting.body_placeholder,className:`h-40 min-h-32`,onChange:D})})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,X.jsx)($,{id:`rule-throttle`,label:i.word.throttle,value:O,onChange:k,placeholder:i.alerting.throttle_placeholder,mono:!0})})]}),A!==null&&(0,X.jsx)(H,{problem:A}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(`p`,{className:`mr-auto self-center text-xs text-muted-foreground`,children:i.alerting.declare_only}),(0,X.jsx)(ce,{render:(0,X.jsx)(C,{variant:`ghost`}),children:i.action.close}),(0,X.jsx)(u,{why:z,children:(0,X.jsx)(C,{disabled:P||z!==void 0,title:z,onClick:()=>{F(!0),M(null),Ne({code:o.trim(),name:Y(c),description:Y(d),event:p,scope:h,pipeline:h===`pipeline`?v:null,importance:rt(b),connection:it(w),template:Y(T),body:Y(E),throttle:O.trim()}).then(()=>{a(),s(``),l(``),f(``),te(``),D(``),t(!1)},e=>{M(S(e))}).finally(()=>{F(!1)})},children:P?i.action.create.busy:i.action.create.verb})})]})]})})}function jt(e){let[t,n]=(0,K.useState)([]);return(0,K.useEffect)(()=>{if(!e)return;let t=!0;return A().then(e=>{t&&n(e.toSorted(O).map(e=>{let t=D(e);return{value:e.code,label:t.title,aside:t.code??``}}))},()=>{t&&n([])}),()=>{t=!1}},[e]),t}var Mt=1e3,Nt=6e4,Pt={connection:``,subject:``};function Ft({open:e,draft:t,onOpenChange:n,notifiers:r,connections:a,onQueued:o,onOpenQueue:s}){let[c,l]=(0,K.useState)(t.connection),[d,f]=(0,K.useState)(t.subject),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1),y=Lt(p),b=B(),x=y!==null&&Ae(y.status)?y.id:null;(0,K.useEffect)(()=>{x!==null&&o()},[x]);let w=b.why;return(0,X.jsx)(ne,{open:e,onOpenChange:n,children:(0,X.jsxs)(ie,{className:`sm:max-w-lg`,showCloseButton:!1,children:[(0,X.jsxs)(re,{children:[(0,X.jsx)(N,{children:i.action.send_test}),(0,X.jsx)(F,{children:i.alerting.test_explained})]}),(0,X.jsx)(Et,{id:`test-connection`,options:ot(r,a),value:c,onChange:l}),(0,X.jsx)($,{id:`test-subject`,label:i.word.subject,value:d,onChange:f,placeholder:i.alerting.test_subject}),h!==null&&(0,X.jsx)(H,{problem:h}),y!==null&&(0,X.jsx)(It,{row:y}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(ce,{render:(0,X.jsx)(C,{variant:`ghost`}),children:i.action.close}),p!==null&&(0,X.jsx)(C,{variant:`outline`,onClick:()=>{s(p)},children:i.alerting.open_in_queue}),(0,X.jsx)(u,{why:w,children:(0,X.jsx)(C,{disabled:_||w!==void 0,title:w,onClick:()=>{v(!0),g(null),m(null),Ue({connection:it(c),subject:d.trim()===``?i.alerting.test_subject:d.trim()}).then(e=>{m(e.notification_id),o()},e=>{g(S(e))}).finally(()=>{v(!1)})},children:p===null?i.alerting.send:i.alerting.send_again})})]})]})})}function It({row:e}){return(0,X.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border bg-secondary/40 p-3`,"data-testid":`test-delivery`,"aria-live":`polite`,children:[(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm`,children:e.subject})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.status===`sent`?(0,X.jsxs)(X.Fragment,{children:[i.alerting.delivered,` `,(0,X.jsx)(U,{at:e.sent_at}),`.`]}):e.status===`failed`?r(e.max_attempts,i.alerting.delivery_stopped)(e.attempt,e.max_attempts):e.attempt===0?i.alerting.queued_for_worker:(0,X.jsxs)(X.Fragment,{children:[i.alerting.attempt_of(e.attempt,e.max_attempts),` `,(0,X.jsx)(U,{at:e.available_at}),`.`]})}),e.error!==null&&(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error})]})}function Lt(e){let[t,n]=(0,K.useState)(null);return(0,K.useEffect)(()=>{if(e===null)return;let t=!0,r,i=Date.now()+Nt,a=()=>{Ve(e).then(o=>{t&&(n({id:e,row:o}),!(Ae(o.status)||Date.now()>i)&&(r=setTimeout(a,Mt)))},()=>{})};return a(),()=>{t=!1,r!==void 0&&clearTimeout(r)}},[e]),t!==null&&t.id===e?t.row:null}var Rt=e=>e.id,zt=e=>e.id;function Bt(){return(0,X.jsx)(ve,{children:(0,X.jsx)(Vt,{})})}function Vt(){let[e,t]=(0,K.useState)(!1),[n,r]=(0,K.useState)(null),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)({status:``,notifier:``}),[p,g]=(0,K.useState)({}),[_,v]=(0,K.useState)({}),y=I((0,K.useCallback)(e=>Me(e),[]),Rt),b=I((0,K.useCallback)(e=>Be(l,e),[l]),zt),x=Wt(),{reload:S}=y,{reload:C}=b,w=(0,K.useMemo)(()=>y.state.rows.map(e=>p[e.id]??e),[p,y.state.rows]),E=(0,K.useMemo)(()=>b.state.rows.map(e=>_[e.id]??e),[_,b.state.rows]),D=w.find(e=>e.id===a)??null,O=E.find(e=>e.id===s)??null,k=(0,K.useCallback)(e=>{r(t=>({draft:e,opened:(t?.opened??0)+1}))},[]);(0,K.useEffect)(()=>(se({note:null,tone:`quiet`,identifier:null}),le),[]),(0,K.useEffect)(()=>{if(D!==null){let e=D;return ee([{id:`rule`,label:i.word.rule.label,render:()=>(0,X.jsx)(ct,{rule:e,onChanged:e=>{g(t=>({...t,[e.id]:e}))},onDeleted:()=>{o(null),S()},onTest:()=>{k({connection:e.connection??``,subject:``})}})}],{screen:`alerting`})}if(O!==null){let e=O;return ee([{id:`notification`,label:i.word.notification.label,render:()=>(0,X.jsx)(ut,{notification:e,onChanged:e=>{v(t=>({...t,[e.id]:e}))}})}],{screen:`alerting`})}},[O,D,k,S]);let A=B(`admin`),j=A.may;(0,K.useEffect)(()=>z([...j?[{id:`alerting:rule`,title:i.alerting.new_rule.palette,group:R,screen:!0,icon:be,keywords:[`alert`,`event`,`create`],run:()=>{t(!0)}},{id:`alerting:test`,title:i.alerting.palette.send_test,group:R,screen:!0,icon:Se,keywords:[`alert`,`notification`,`try`],run:()=>{k(Pt)}}]:[],{id:`alerting:reload`,title:i.alerting.palette.reload,group:R,screen:!0,icon:P,keywords:[`refresh`,`reload`],run:()=>{S(),C()}}]),[j,k,C,S]);let ne=e=>{c(null),o(e.id),T()},re=e=>{o(null),c(e.id),T()},N=()=>{o(null),c(null),te()};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(f,{title:i.screen.alerting.name,aside:(0,X.jsx)(m,{tag:`alerts`}),actions:[{id:`test`,label:i.action.send_test,icon:Se,variant:`outline`,disabled:!A.may,why:A.why,onClick:()=>{k(Pt)}},{id:`rule`,label:i.alerting.new_rule.button,icon:be,disabled:!A.may,why:A.why,onClick:()=>{t(!0)}}]}),(0,X.jsx)(`section`,{className:`mb-6 space-y-2`,children:(0,X.jsx)(yt,{channels:x.rows,read:x.read})}),(0,X.jsxs)(`section`,{className:`space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.word.rule.heading}),(0,X.jsx)(d,{loading:!y.state.read,problem:y.state.problem,empty:w.length===0,emptyMessage:i.alerting.rules_empty,children:(0,X.jsx)(h,{columns:Kt,rows:w,rowKey:Rt,rowClassName:e=>ke(e)?void 0:`opacity-60`,reading:y.state.reading,next:y.state.next,onMore:y.more,noun:i.word.rule.count,onSelect:ne,selected:e=>e.id===a,onClose:N})})]}),(0,X.jsxs)(`section`,{className:`mt-8 space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.word.notification.heading}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(ue,{label:i.word.status,value:l.status,anything:i.alerting.any_status,options:we.map(e=>({value:e,label:e,mark:(0,X.jsx)(M,{status:e})})),onChange:e=>{u(t=>({...t,status:e}))}}),(0,X.jsx)(ue,{label:i.alerting.notifier,value:l.notifier,anything:i.alerting.any_notifier,options:Ut(x.rows),onChange:e=>{u(t=>({...t,notifier:e}))}})]})]}),(0,X.jsx)(d,{loading:!b.state.read,problem:b.state.problem,empty:E.length===0,emptyMessage:Re(l)?i.alerting.notifications_empty_filtered:i.alerting.notifications_empty,children:(0,X.jsx)(h,{columns:qt,rows:E,rowKey:zt,reading:b.state.reading,next:b.state.next,onMore:b.more,noun:i.word.notification.count,onSelect:re,selected:e=>e.id===s,onClose:N})})]}),(0,X.jsx)(At,{open:e,onOpenChange:t,notifiers:Ht(x.rows),connections:x.connections,onCreated:S}),(0,X.jsx)(Ft,{open:n!==null,draft:n?.draft??Pt,onOpenChange:e=>{e||r(null)},notifiers:Ht(x.rows),connections:x.connections,onQueued:C,onOpenQueue:e=>{r(null),o(null),c(e),C(),T()}},n?.opened??0)]})}function Ht(e){return[...new Set(e.map(e=>e.notifier))]}function Ut(e){return Ht(e).map(e=>({value:e,label:e}))}function Wt(){let[e,t]=(0,K.useState)(null),[n,r]=(0,K.useState)(null);return(0,K.useEffect)(()=>{let e=!0;return We().then(n=>{e&&t(n)},()=>{e&&t([])}),pe().then(t=>{e&&r(t.items)},()=>{e&&r([])}),()=>{e=!1}},[]),{rows:(0,K.useMemo)(()=>Ge(e??[],n??[]),[n,e]),connections:n??[],read:e!==null&&n!==null}}function Gt({rule:e}){let t=Oe(e.importance);return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,X.jsx)(`span`,{className:e.scope===`pipeline`?`font-mono text-xs`:`text-sm`,children:De(e)}),t!==null&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})}var Kt=[{id:`rule`,header:i.word.rule.label,kind:`title`,cell:e=>{let t=D(e);return(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:v(`truncate`,t.named?`text-sm font-medium`:`font-mono text-sm font-medium`),title:t.title,children:t.title}),t.code!==null&&(0,X.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,title:t.code,children:t.code})]})}},{id:`event`,header:i.word.event,cell:e=>(0,X.jsx)(`span`,{className:`text-sm`,children:i.alerting.event[e.event]})},{id:`scope`,header:i.word.scope,cell:e=>(0,X.jsx)(Gt,{rule:e})},{id:`delivers`,header:i.word.delivers_through,cell:e=>(0,X.jsx)(ft,{notifier:e.notifier,connection:e.connection})},{id:`throttle`,header:i.word.throttle,className:`font-mono text-xs`,cell:e=>(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:Ee(e.throttle)})},{id:`sent`,header:i.alerting.last_sent,className:`text-xs`,cell:e=>e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.never}):(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.last_sent_at})},{id:`live`,header:i.word.state,cell:e=>e.paused?(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i.state.armed.paused}):e.active?(0,X.jsx)(`span`,{className:`text-xs text-good`,children:i.state.armed.active}):(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i.state.armed.off})}],qt=[{id:`status`,header:i.word.status,cell:e=>(0,X.jsx)(M,{status:e.status})},{id:`subject`,header:i.word.subject,kind:`prose`,cell:e=>(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm`,title:e.subject,children:e.subject}),e.error!==null&&(0,X.jsx)(`span`,{className:`truncate text-xs text-critical`,title:e.error,children:e.error})]})},{id:`delivers`,header:i.word.delivers_through,cell:e=>(0,X.jsx)(pt,{notifier:e.notifier,connection:e.connection})},{id:`run`,header:i.word.run.label,cell:e=>(0,X.jsx)(mt,{notification:e})},{id:`queued`,header:i.alerting.queued_at,className:`text-xs`,cell:e=>(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.created_at})},{id:`sent`,header:i.alerting.sent_at,className:`text-xs`,cell:e=>e.status===`sent`?(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.sent_at}):e.attempt>0?(0,X.jsx)(`span`,{className:`text-faint`,children:r(e.max_attempts,i.alerting.attempts_of.counted)(e.attempt,e.max_attempts)}):null}];export{Bt as AdminAlerting};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{n,t as r}from"./labels-Dp8H1wzG.js";import{n as i}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{n as a,t as o}from"./PageState-CuZbHz6s.js";import{i as s,t as c}from"./ListTable-A_dkU0ci.js";import{r as l}from"./utils-CT7ZGLfR.js";import{a as u,o as d,r as f}from"./panels-D1Fnei43.js";import{T as p,it as m,rt as h,y as g}from"./index-DcrUT8O1.js";import{t as _}from"./Markdown-D4x5xD_I.js";import{n as v,r as y}from"./Panel-COl_eBj1.js";import{i as b,l as x,o as S,r as C,s as w,t as T,u as E}from"./blocks-DCUqC697.js";import{b as D}from"./connections-ENTr1Nsd.js";import{l as O,r as k}from"./examples-NA2YGKLT.js";import{t as A}from"./KindChip-CwU_Xxdy.js";var j=e(t(),1),M=l(),N=e=>e.id,P=[{key:`scheme`,title:r.blocks.registry.scheme.title,noun:r.blocks.registry.scheme.noun},{key:`notifier`,title:r.blocks.registry.notifier.title,noun:r.blocks.registry.notifier.noun},{key:`connection`,title:r.blocks.registry.connection.title,noun:r.blocks.registry.connection.noun}],F=e=>t=>`${e}:${t.id}`,I=()=>{};function L(){let[e,t]=(0,j.useState)(``),[n,i]=(0,j.useState)(null),{value:l,problem:_,read:v}=g(x),y=g(O),b=(0,j.useMemo)(()=>k(y.value??[]),[y.value]),C=(0,j.useMemo)(()=>l?.blocks??[],[l]),E=(0,j.useMemo)(()=>S(C,e),[C,e]),D=(0,j.useMemo)(()=>T(E),[E]),A=(0,j.useMemo)(()=>w(l?.storage_schemes??[],e),[l,e]),L=(0,j.useMemo)(()=>w(l?.notifiers??[],e),[l,e]),z=(0,j.useMemo)(()=>w(l?.connection_kinds??[],e),[l,e]),U=(0,j.useMemo)(()=>R(b),[b]),W=C.find(e=>`block:${e.id}`===n)??null,G={scheme:A,notifier:L,connection:z},K=P.flatMap(e=>G[e.key].map(t=>({registry:e,entry:t}))).find(({registry:e,entry:t})=>F(e.key)(t)===n)??null;(0,j.useEffect)(()=>{if(v)return m({note:null,tone:`quiet`,identifier:null}),h},[C,v,l]),(0,j.useEffect)(()=>{if(W!==null)return u([{id:`block`,label:r.word.block.label,render:()=>(0,M.jsx)(H,{entry:W})}],{screen:`blocks`});if(K!==null){let{registry:e,entry:t}=K;return u([{id:`entry`,label:e.title,render:()=>(0,M.jsx)(V,{entry:t})}],{screen:`blocks`})}},[W,K]);let q=(0,j.useCallback)(e=>{i(`block:${e.id}`),d()},[]),J=(0,j.useCallback)(()=>{i(null),f()},[]);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o,{title:r.screen.blocks.name,aside:(0,M.jsx)(s,{tag:`blocks`})}),(0,M.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:(0,M.jsx)(p,{value:e,label:r.blocks.search,onChange:t})}),(0,M.jsx)(a,{loading:!v,problem:_,empty:E.length===0&&A.length===0&&L.length===0&&z.length===0,emptyMessage:C.length===0?r.blocks.empty:r.blocks.empty_filtered,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[D.map(([e,t])=>(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e}),(0,M.jsx)(c,{chrome:{footer:!1},columns:U,rows:t,rowKey:N,reading:!1,next:null,onMore:I,noun:r.word.block.count,onSelect:q,selected:e=>`block:${e.id}`===n,onClose:J})]},e)),P.map(e=>{let t=G[e.key];return t.length===0?null:(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e.title}),(0,M.jsx)(c,{chrome:{footer:!1},columns:B(e.key),rows:t,rowKey:F(e.key),reading:!1,next:null,onMore:I,noun:e.noun,onSelect:t=>{i(F(e.key)(t)),d()},selected:t=>F(e.key)(t)===n,onClose:J})]},e.key)})]})})]})}function R(e){return[{id:`block`,header:r.word.block.label,kind:`title`,cell:e=>(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,M.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:e.summary,children:e.summary})]})},{id:`kind`,header:r.word.kind.label,className:`min-w-32 whitespace-nowrap`,cell:e=>(0,M.jsx)(A,{kind:e.kind})},{id:`examples`,header:r.word.example.heading,className:`min-w-28 whitespace-nowrap`,cell:t=>(0,M.jsx)(z,{id:t.id,many:e.get(t.id)??0})},{id:`plugin`,header:r.word.plugin.label,className:`min-w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function z({id:e,many:t}){if(t===0)return(0,M.jsx)(`span`,{className:`text-xs text-faint`,children:r.word.none});let a=n(t,r.blocks.example_count)(String(t));return(0,M.jsx)(i,{className:`text-xs text-primary-ink hover:underline`,to:`/examples?block=${encodeURIComponent(e)}`,title:r.blocks.example_link(e),onClick:e=>{e.stopPropagation()},children:a})}function B(e){let t=e===`scheme`?`storage`:e;return[{id:`entry`,header:r.blocks.entry_header,kind:`title`,cell:e=>{let t=typeof e.config_schema.description==`string`?e.config_schema.description:``;return(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,M.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:t,children:t})]})}},{id:`kind`,header:r.word.kind.label,className:`min-w-32 whitespace-nowrap`,cell:()=>(0,M.jsx)(A,{kind:t})},{id:`plugin`,header:r.word.plugin.label,className:`min-w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function V({entry:e}){let t=(0,j.useMemo)(()=>D(e.config_schema),[e]),n=typeof e.config_schema.description==`string`?e.config_schema.description:null;return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),n!==null&&(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n}),(0,M.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:(0,M.jsx)(v,{term:r.blocks.fact.term.plugin,detail:e.plugin})})]}),(0,M.jsx)(y,{title:r.word.config,children:t.length===0?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r.form.no_configuration}):(0,M.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,M.jsx)(U,{field:e},e.name))})})]})}function H({entry:e}){let t=(0,j.useMemo)(()=>D(e.config_schema),[e]),n=b(e);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,M.jsx)(`p`,{children:(0,M.jsx)(A,{kind:e.kind})}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.summary})]}),(0,M.jsx)(y,{title:r.blocks.facts_section,children:(0,M.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:n.map(e=>(0,M.jsx)(v,{term:e.term,detail:e.detail},e.term))})}),(0,M.jsx)(y,{title:r.word.config,children:t.length===0?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r.form.no_configuration}):(0,M.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,M.jsx)(U,{field:e},e.name))})})]})}function U({field:e}){let t=C(e);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,M.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:E(e)}),e.required&&(0,M.jsx)(`span`,{className:`text-xs text-primary-ink`,children:r.blocks.field_required}),e.hint!==null&&(0,M.jsx)(`span`,{className:`text-xs text-faint`,children:e.hint}),t!==null&&(0,M.jsxs)(`span`,{className:`text-xs text-faint`,children:[r.blocks.field_default,` `,t]})]}),e.options.length>0&&(0,M.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:e.options.map(e=>e.label).join(` · `)}),e.help!==null&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,M.jsx)(_,{text:e.help})})]})}export{L as Blocks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-Dp8H1wzG.js";import{n as r}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{r as i,t as a}from"./utils-CT7ZGLfR.js";var o=e(t(),1),s=i();function c({trail:e,code:t}){return(0,s.jsxs)(`nav`,{className:`flex min-w-0 items-center gap-1.5 text-sm`,"aria-label":n.shell.breadcrumb,title:e.map(e=>e.label).join(` / `),children:[e.map((t,n)=>{let i=n===e.length-1,c=i||t.keep===!0,l=e.slice(0,n).some(e=>e.keep===!0);return(0,s.jsxs)(o.Fragment,{children:[n>0&&(0,s.jsx)(`span`,{className:a(`text-faint`,!(c&&l)&&`hidden md:inline`),"aria-hidden":!0,children:`/`}),t.to===void 0?(0,s.jsx)(`span`,{title:t.title,className:a(`min-w-0 truncate`,i&&`font-medium`,t.mono===!0&&`font-mono`,!c&&`hidden md:inline`),children:t.label}):(0,s.jsx)(r,{to:t.to,title:t.title,className:a(`min-w-0 truncate text-muted-foreground hover:text-foreground`,t.mono===!0&&`font-mono`,!c&&`hidden md:inline`),children:t.label})]},`${t.label}-${String(n)}`)}),t!=null&&(0,s.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:t})]})}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-Dp8H1wzG.js";import{a as r,i,n as a,o,r as s}from"./JsonBlock-BRHbezyM.js";import{r as c}from"./glyphs-CaFpiNjJ.js";import{r as l}from"./utils-CT7ZGLfR.js";import{d as u}from"./paging-C4feZMNQ.js";import{t as d}from"./input-sbz1EN8t.js";import{t as f}from"./SchemaForm-ByfDLufz.js";import{t as p}from"./textarea-D86x5ut1.js";import{t as m}from"./use-store-CZcp6jmY.js";import{A as h,S as g,j as _,x as v}from"./index-DcrUT8O1.js";import{C as y,I as b,L as x,a as S,p as C,s as w}from"./connections-ENTr1Nsd.js";import{t as T}from"./Refusal-3GHMZOnu.js";import{t as E}from"./Mark-DQR2php6.js";var D=l();function O({id:e,name:t,stored:r,value:i,onChange:a}){return(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(h,{htmlFor:e,className:`font-mono text-sm font-medium`,children:t}),(0,D.jsx)(d,{id:e,type:`password`,autoComplete:`new-password`,value:i,onChange:e=>{a(e.target.value)},placeholder:r?n.connections.secret_stored:n.connections.secret_unset})]})}var k=e(t(),1),A={code:``,kind:``,name:``,description:``,values:{},secrets:{}};function j(e,t){return{...A,code:e,kind:t??``}}function M(e,t){return{...e,kind:t,values:{},secrets:{}}}function N(e,t,n){let r={...e.values};return n===void 0?delete r[t]:r[t]=n,{...e,values:r}}function P(e,t,n){return{...e,secrets:{...e.secrets,[t]:n}}}function F(e){return{code:e.code.trim(),name:L(e.name),kind:e.kind,description:L(e.description),config:w(e.values,e.secrets)}}function I(e,t,r){if(e.code.trim()===``)return n.connections.needs_code;if(e.kind===``)return n.connections.needs_kind;if(r.size>0)return n.connections.unreadable_setting;if(!y(t,r))return n.connections.settings_refused}function L(e){let t=e.trim();return t===``?null:t}function R(e,t=``,r=null){let[i,a]=(0,k.useState)(()=>j(t,r)),[o,s]=(0,k.useState)(()=>new Set),[c,l]=(0,k.useState)(()=>new Set),[d,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(null),[h,_]=(0,k.useState)(!1),y=v(`admin`),w=e.find(e=>e.id===i.kind)??null,T=(0,k.useMemo)(()=>C(w?.config_schema??null,w?.secret_fields??[]),[w]),E=(0,k.useMemo)(()=>b(T,i.values),[T,i.values]);return{draft:i,chosen:w,fields:T,problems:E,stated:d?void 0:o,shut:g(y.why,I(i,E,c),i.kind!==``&&w===null?n.connections.kind_unknown(i.kind):void 0),busy:h,problem:p,setCode:e=>{a(t=>({...t,code:e}))},chooseKind:e=>{a(t=>M(t,e)),s(new Set),l(new Set),f(!1)},setName:e=>{a(t=>({...t,name:e}))},setDescription:e=>{a(t=>({...t,description:e}))},setSetting:(e,t)=>{a(n=>N(n,e,t))},setSecret:(e,t)=>{a(n=>P(n,e,t))},touch:e=>{s(t=>t.has(e)?t:new Set(t).add(e))},markUnreadable:(e,t)=>{l(n=>x(n,e,t))},create:e=>{f(!0),_(!0),m(null),S(F(i)).then(n=>{a(j(t,r)),s(new Set),l(new Set),f(!1),e(n)},e=>{m(u(e))}).finally(()=>{_(!1)})}}}function z({form:e,kinds:t,decided:r,ids:i}){let{draft:a,chosen:o}=e,s=r===void 0||r.kind===null;return(0,D.jsxs)(D.Fragment,{children:[r===void 0?(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${i}-code`,children:n.word.code}),(0,D.jsx)(d,{id:`${i}-code`,className:`font-mono`,value:a.code,onChange:t=>{e.setCode(t.target.value)},placeholder:n.connections.code_placeholder})]}),(0,D.jsx)(B,{form:e,kinds:t,ids:i})]}):s&&(0,D.jsx)(B,{form:e,kinds:t,ids:i}),r===void 0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${i}-name`,children:n.word.name.label}),(0,D.jsx)(d,{id:`${i}-name`,value:a.name,onChange:t=>{e.setName(t.target.value)}})]}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${i}-description`,children:n.word.description}),(0,D.jsx)(p,{id:`${i}-description`,className:`h-24`,value:a.description,onChange:t=>{e.setDescription(t.target.value)},placeholder:n.connections.description_placeholder})]})]}),o!==null&&(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:n.connections.settings_heading}),(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(f,{fields:e.fields,values:a.values,problems:e.problems,stated:e.stated,fold:r!==void 0,onChange:e.setSetting,onTouch:e.touch,onUnreadable:e.markUnreadable}),o.secret_fields.map(t=>(0,D.jsx)(O,{id:`${i}-secret-${t}`,name:t,stored:!1,value:a.secrets[t]??``,onChange:n=>{e.setSecret(t,n)}},t))]})]}),e.problem!==null&&(0,D.jsx)(T,{problem:e.problem})]})}function B({form:e,kinds:t,ids:c}){let l=e.chosen;return(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${c}-kind`,children:n.word.kind.label}),(0,D.jsxs)(a,{value:e.draft.kind,onValueChange:t=>{e.chooseKind(String(t))},children:[(0,D.jsx)(r,{id:`${c}-kind`,className:`w-full font-mono`,children:(0,D.jsx)(o,{placeholder:n.connections.choose_kind,children:l===null?void 0:()=>(0,D.jsx)(V,{kind:l.id})})}),(0,D.jsx)(s,{children:t.map(e=>(0,D.jsx)(i,{value:e.id,className:`font-mono`,children:(0,D.jsx)(V,{kind:e.id})},e.id))})]})]})}function V({kind:e}){let t=m(_);return(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(E,{glyph:c(e,t)}),e]})}export{R as n,O as r,z as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{a as n,t as r}from"./labels-Dp8H1wzG.js";import{c as i,l as a,u as o}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{r as s}from"./glyphs-CaFpiNjJ.js";import{l as c,n as l,t as u}from"./PageState-CuZbHz6s.js";import{i as d,n as f,t as p}from"./ListTable-A_dkU0ci.js";import{r as m,t as h}from"./utils-CT7ZGLfR.js";import{i as g,n as _,t as v}from"./tooltip-Bas36yZU.js";import{d as y,h as b}from"./paging-C4feZMNQ.js";import{t as x}from"./input-sbz1EN8t.js";import{t as S}from"./SchemaForm-ByfDLufz.js";import{t as C}from"./textarea-D86x5ut1.js";import{t as w}from"./use-store-CZcp6jmY.js";import{a as T,o as E,r as D}from"./panels-D1Fnei43.js";import{d as O,l as k,s as A}from"./format-D2kQLRJs.js";import{t as j}from"./identity-BNZxCf_y.js";import{A as M,At as N,Ft as P,It as F,Lt as I,Mt as L,Nt as R,Pt as z,S as B,b as ee,gt as te,it as ne,j as V,jt as re,mt as H,rt as U,x as W,y as ie}from"./index-DcrUT8O1.js";import{t as ae}from"./Description-C-byz7P3.js";import{C as oe,I as se,L as ce,d as le,f as ue,g as de,h as fe,i as pe,l as me,n as he,o as G,p as ge,t as _e,u as ve}from"./connections-ENTr1Nsd.js";import{n as ye,t as be}from"./Refusal-3GHMZOnu.js";import{t as xe}from"./KindChip-CwU_Xxdy.js";import{t as K}from"./Instant-CihfxyJ1.js";import{t as q}from"./Mark-DQR2php6.js";import{n as Se,r as Ce,t as we}from"./ConnectionFields-HTVyzXLM.js";var J={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};J.node;var Y=n(J),X=e(t(),1),Z=m(),Te={good:`var(--good)`,critical:`var(--critical)`};function Ee(e){return e===null?`var(--faint)`:Te[e]}function Q({view:e,className:t}){return(0,Z.jsxs)(`span`,{className:h(`flex items-center gap-2 text-xs`,t),children:[(0,Z.jsx)(`span`,{className:`status-dot`,style:{"--chip":Ee(e.tone)},"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:h(`whitespace-nowrap`,e.tone===null&&`text-faint`),children:e.label})]})}function De({connection:e,schema:t,onSaved:n}){let i=w(V),[a,o]=(0,X.useState)(e.name??``),[l,u]=(0,X.useState)(e.description??``),[d,f]=(0,X.useState)(()=>Ae(e)),[p,m]=(0,X.useState)({}),[h,g]=(0,X.useState)(()=>new Set),[_,v]=(0,X.useState)(null),[T,E]=(0,X.useState)(!1),[D,k]=(0,X.useState)(!1),A=j(e),N=(0,X.useMemo)(()=>ke(e,t),[e,t]),P=(0,X.useMemo)(()=>se(N,d),[N,d]),F=W(`admin`),I=B(F.why,oe(P,h)?void 0:r.connections.settings_refused);return(0,Z.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(q,{glyph:s(e.kind,i)}),(0,Z.jsx)(`span`,{className:A.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:A.title}),A.code!==null&&(0,Z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:A.code}),(0,Z.jsx)(xe,{kind:e.kind})]}),(0,Z.jsxs)(`p`,{className:`text-xs text-faint`,children:[r.word.created.label,` `,(0,Z.jsx)(K,{at:e.created_at}),O(e.created_at,e.updated_at)&&(0,Z.jsxs)(Z.Fragment,{children:[r.connections.also_updated,(0,Z.jsx)(K,{at:e.updated_at})]})]}),(0,Z.jsx)(Oe,{connection:e}),(0,Z.jsx)(ae,{text:e.description})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(M,{htmlFor:`connection-name`,children:r.word.name.label}),(0,Z.jsx)(x,{id:`connection-name`,value:a,onChange:e=>{o(e.target.value),k(!1)}}),(0,Z.jsx)(`p`,{className:`text-xs text-faint`,children:r.connections.name_hint(e.code)})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(M,{htmlFor:`connection-description`,children:r.word.description}),(0,Z.jsx)(C,{id:`connection-description`,className:`h-24`,value:l,onChange:e=>{u(e.target.value),k(!1)},placeholder:r.connections.description_placeholder})]}),(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:r.connections.settings_heading}),(0,Z.jsx)(S,{fields:N,values:d,problems:P,onChange:(e,t)=>{f(n=>({...n,[e]:t})),k(!1)},onUnreadable:(e,t)=>{g(n=>ce(n,e,t))}}),e.secret_fields.map(t=>(0,Z.jsx)(Ce,{id:`secret-${t}`,name:t,stored:je(e.config[t]),value:p[t]??``,onChange:e=>{m(n=>({...n,[t]:e})),k(!1)}},t))]}),_!==null&&(0,Z.jsx)(be,{problem:_}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(c,{why:I,children:(0,Z.jsx)(b,{size:`sm`,onClick:()=>{let t=me(e,Me(e,d,p),$(a),$(l));if(t===null){k(!0);return}E(!0),v(null),fe(e.code,t).then(e=>{m({}),k(!0),n(e)},e=>{v(y(e))}).finally(()=>{E(!1)})},disabled:T||I!==void 0,title:I,children:T?r.action.save.busy:r.action.save.verb})}),D&&(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r.action.save.done})]})]})}function Oe({connection:e}){let t=G(e);return(0,Z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{view:t}),t.checkedAt!==null&&(0,Z.jsxs)(`span`,{className:`text-xs text-faint`,children:[r.word.checked.term,` `,(0,Z.jsx)(K,{at:t.checkedAt})]})]}),t.detail!==null&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.detail})]})}function ke(e,t){let n=new Set(e.secret_fields);return t===null?Object.keys(e.config).filter(e=>!n.has(e)).map(t=>({name:t,kind:typeof e.config[t]==`string`?`text`:`json`,help:null,required:!1,nullable:!0,fallback:void 0,options:[],mediaType:null,refers:null,hint:null,placeholder:``,bounds:{},accepts:[],holds:[]})):ge(t,e.secret_fields)}function Ae(e){let t=new Set(e.secret_fields),n={};for(let[r,i]of Object.entries(e.config))t.has(r)||(n[r]=i);return n}function je(e){return e!=null}function $(e){let t=e.trim();return t===``?null:t}function Me(e,t,n){let r={};for(let[n,i]of Object.entries(t))Object.is(i,e.config[n])||(r[n]=i);for(let[e,t]of Object.entries(n))t!==``&&(r[e]=t);return r}function Ne({open:e,kinds:t,startKind:n=``,onOpenChange:i,onCreated:a}){let o=Se(t,``,n);return(0,Z.jsx)(N,{open:e,onOpenChange:i,children:(0,Z.jsxs)(L,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-xl`,showCloseButton:!1,children:[(0,Z.jsxs)(P,{children:[(0,Z.jsx)(F,{children:r.connections.new}),(0,Z.jsx)(R,{children:r.connections.sealed})]}),(0,Z.jsx)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:(0,Z.jsx)(we,{form:o,kinds:t,ids:`connection-new`})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(re,{render:(0,Z.jsx)(b,{variant:`ghost`}),children:r.action.close}),(0,Z.jsx)(c,{why:o.shut,children:(0,Z.jsx)(b,{disabled:o.busy||o.shut!==void 0,title:o.shut,onClick:()=>{o.create(e=>{a(e),i(!1)})},children:o.busy?r.action.create.busy:r.action.create.verb})})]})]})})}var Pe=e=>e.code;function Fe(){let{code:e=null}=a(),t=i(),[n,s]=o(),f=n.get(`new`),[m,h]=(0,X.useState)(!1),g=m||f!==null,[_,v]=(0,X.useState)({}),[y,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(null),{state:w,more:O,reload:k}=ee(ue,Pe),A=(0,X.useMemo)(()=>w.rows.map(e=>_[e.code]??e),[_,w.rows]),j=A.find(t=>t.code===e)??null,M=(0,X.useCallback)(()=>e===null||j!==null?Promise.resolve(null):ve(e),[e,j]),N=ie(M).value,P=j??(N===null?null:_[N.code]??N);(0,X.useEffect)(()=>{e!==null&&E()},[e]);let F=(0,X.useCallback)(e=>{v(t=>({...t,[e.code]:e}))},[]),L=(0,X.useCallback)(e=>{x(e.code),_e(e.code).then(t=>{F(de(e,t,new Date().toISOString()))},ye).finally(()=>{x(null)})},[F]),R=e!==null||g;(0,X.useEffect)(()=>{if(!R||S!==null)return;let e=!0;return le().then(t=>{e&&C(t)},()=>{}),()=>{e=!1}},[S,R]),(0,X.useEffect)(()=>{let e=pe(A);if(e===null){U();return}return ne({note:e,tone:`quiet`,identifier:null}),U},[A]),(0,X.useEffect)(()=>{if(P===null)return;let e=S?.find(e=>e.id===P.kind)?.config_schema??null;return T([{id:`connection`,label:r.word.connection.label,render:()=>(0,Z.jsx)(De,{connection:P,schema:e,onSaved:F},P.code)}],{screen:`connections`})},[F,S,P]);let z=W(`admin`),B=z.may;(0,X.useEffect)(()=>te([...B?[{id:`connections:new`,title:r.connections.new,group:H,screen:!0,icon:Y,keywords:[`credential`,`create`,`add`],run:()=>{h(!0)}}]:[],{id:`connections:reload`,title:r.connections.reload,group:H,screen:!0,icon:I,keywords:[`refresh`,`reload`],run:k}]),[B,k]);let V=(0,X.useMemo)(()=>Ie(L,y,z.why),[L,y,z.why]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{title:r.screen.connections.name,aside:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{tag:`connections`}),(0,Z.jsx)(c,{why:z.why,children:(0,Z.jsxs)(b,{size:`sm`,"aria-label":r.connections.new,disabled:!z.may,title:z.why,onClick:()=>{h(!0)},children:[(0,Z.jsx)(Y,{"aria-hidden":!0}),r.action.new]})})]})}),(0,Z.jsx)(l,{loading:!w.read,problem:w.problem,empty:A.length===0,emptyMessage:r.connections.empty,children:(0,Z.jsx)(p,{columns:V,rows:A,rowKey:Pe,reading:w.reading,next:w.next,onMore:O,noun:r.word.connection.count,onSelect:e=>{t(he(e.code),{replace:!0})},selected:t=>t.code===e,onClose:()=>{t(`/connections`,{replace:!0}),D()}})}),(0,Z.jsx)(Ne,{open:g,kinds:S??[],startKind:f??``,onOpenChange:e=>{h(e),!e&&f!==null&&(n.delete(`new`),s(n,{replace:!0}))},onCreated:()=>{k()}},f??``)]})}function Ie(e,t,n){return[{id:`connection`,header:r.word.connection.label,kind:`title`,cell:e=>(0,Z.jsx)(Le,{row:e})},{id:`health`,header:r.word.health,cell:e=>(0,Z.jsx)(Re,{row:e})},{id:`checked`,header:r.word.checked.label,className:`text-xs`,cell:e=>e.last_check_at===null?null:(0,Z.jsx)(ze,{at:e.last_check_at})},{id:`check`,header:``,className:`py-1 text-right`,cell:i=>(0,Z.jsx)(c,{why:n,children:(0,Z.jsx)(b,{variant:`outline`,size:`icon-lg`,"aria-label":r.connections.check_row(i.code),disabled:t===i.code||n!==void 0,title:n??r.action.check,onClick:t=>{t.stopPropagation(),e(i)},children:(0,Z.jsx)(I,{className:h(t===i.code&&`animate-spin`),"aria-hidden":!0})})})}]}function Le({row:e}){let t=j(e),n=w(V);return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(q,{glyph:s(e.kind,n)}),(0,Z.jsx)(`span`,{className:h(`truncate font-semibold`,!t.named&&`font-mono`),title:t.title,children:t.title}),t.code!==null&&(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,title:t.code,children:t.code}),(0,Z.jsx)(xe,{kind:e.kind})]})}function Re({row:e}){let t=G(e),n=f();return t.detail===null||n?(0,Z.jsx)(Q,{view:t}):(0,Z.jsxs)(v,{children:[(0,Z.jsx)(g,{render:(0,Z.jsx)(`button`,{type:`button`,className:`rounded-sm focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(Q,{view:t})})}),(0,Z.jsx)(_,{side:`bottom`,children:t.detail})]})}function ze({at:e}){return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,title:A(e),children:k(e)})}export{Fe as Connections};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{n,t as r}from"./labels-Dp8H1wzG.js";import{c as i,n as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{n as o,r as s}from"./glyphs-CaFpiNjJ.js";import{i as c,n as l,r as u,t as d}from"./PageState-CuZbHz6s.js";import{i as f,t as p}from"./ListTable-A_dkU0ci.js";import{r as m,t as h}from"./utils-CT7ZGLfR.js";import{t as g}from"./use-store-CZcp6jmY.js";import{t as _}from"./auth-QgZsjd0d.js";import{v}from"./format-D2kQLRJs.js";import{t as ee}from"./use-heartbeat-C3WWagro.js";import{t as y}from"./identity-BNZxCf_y.js";import{m as b}from"./pipelines-Da2DZJX0.js";import{E as x,Lt as S,gt as C,h as w,j as T,l as E,pt as te,t as D,u as O,y as k}from"./index-DcrUT8O1.js";import{f as A,i as j,o as M,r as N}from"./connections-ENTr1Nsd.js";import{t as P}from"./Instant-CihfxyJ1.js";import{t as F}from"./Mark-DQR2php6.js";import{f as ne,i as I,p as re,r as ie,s as ae,t as oe,u as se}from"./TileCard-g50S83Uu.js";import{a as ce,i as L,r as R}from"./workers-D21cApnc.js";import{f as z,s as B}from"./triggers-DD6LKQNg.js";var V=e(t(),1),H=m(),U={neutral:`bg-muted-foreground`,good:`bg-good`,info:`bg-info`,warning:`bg-warning`,critical:`bg-critical`};function W({rows:e,note:t,reading:n}){let i=g(_).identity?.role??null;return(0,H.jsx)(u,{className:`gap-0 p-0`,children:(0,H.jsxs)(c,{className:`flex h-full flex-col p-0`,children:[(0,H.jsxs)(`div`,{className:`space-y-1 px-3 py-3`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:r.word.health}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?r.shell.reading:r.dashboard.health.hint})]}),(0,H.jsx)(`ul`,{className:`max-h-64 grow overflow-y-auto`,children:e.map(e=>{let t=e.kind===`connection`?`/connections`:i===`admin`?`/admin/workers`:null,n=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-full`,U[e.tone]),"aria-hidden":!0}),e.mark===null?(0,H.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,H.jsx)(F,{glyph:e.mark})]}),(0,H.jsx)(`span`,{className:`max-w-[55%] min-w-[6ch] truncate font-mono text-xs`,title:e.label,children:e.label}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline justify-end gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,title:e.detail,children:e.detail}),e.at!==null&&(0,H.jsx)(P,{className:`shrink-0 text-xs text-faint`,at:e.at})]})]});return(0,H.jsx)(`li`,{className:`border-t border-border`,children:t===null?(0,H.jsx)(`span`,{className:`flex min-w-0 items-center gap-2 px-3 py-1.5`,children:n}):(0,H.jsx)(a,{to:t,className:`control-link flex min-w-0 items-center gap-2 px-3 py-1.5 hover:bg-accent/60`,children:n})},`${e.kind}:${e.id}`)})}),(0,H.jsx)(`p`,{className:`border-t border-border px-3 py-2 text-xs text-muted-foreground`,children:t})]})})}function G(e,t){return`${String(e)}${t.next===null?``:`+`}`}function K(e,t){return e===0?`neutral`:t}function le(e,t){return e.items.filter(e=>e.status===t).length}function ue(e,t,n){let i=(t,n,r)=>{if(e===null)return null;let i=le(e,t);return{id:t,label:n,value:G(i,e),note:``,tone:K(i,r),to:O({...D,status:t,since:`24h`})}},a=(e,t,n,r,i)=>{if(i===null)return null;let a=i.items.length;return{id:e,label:t,value:G(a,i),note:a===0?``:r,tone:K(a,n),to:O({...D,status:e})}};return[{id:`runs`,tile:e===null?null:{id:`runs`,label:r.screen.runs.name,value:G(e.items.length,e),note:r.dashboard.tile.runs_window,tone:`neutral`,to:O({...D,since:`24h`})}},{id:`succeeded`,tile:i(`succeeded`,r.state.run.succeeded.tile,`good`)},{id:`failed`,tile:i(`failed`,r.state.run.failed.tile,`critical`)},{id:`completed_with_errors`,tile:i(`completed_with_errors`,r.state.run.completed_with_errors.tile,`warning`)},{id:`running`,tile:a(`running`,r.state.run.running.tile,`info`,r.state.run.running.sentence,t)},{id:`queued`,tile:a(`queued`,r.state.run.queued.tile,`neutral`,r.state.run.queued.sentence,n)}]}var q=36e5,J=864e5;function de(e,t){let n=e+t*6e4;return Math.floor(n/q)*q-t*6e4}function fe(e,t){let n=e+t*6e4;return Math.floor((n%J+J)%J/q)}function pe(e,t,n,r=24){let i=de(t.getTime(),n)-(r-1)*q,a=Array.from({length:r},(e,t)=>{let r=i+t*q;return{start:r,hour:fe(r,n),succeeded:0,withErrors:0,failed:0,total:0}});for(let t of e){let e=Date.parse(t.created_at);if(Number.isNaN(e))continue;let n=Math.floor((e-i)/q);if(n<0||n>=r)continue;let o=a[n];o.total+=1,t.status===`succeeded`?o.succeeded+=1:t.status===`completed_with_errors`?o.withErrors+=1:t.status===`failed`&&(o.failed+=1)}return a}function Y(e){return e.succeeded+e.withErrors+e.failed}function me(e){return e.reduce((e,t)=>Math.max(e,Y(t)),0)}function he(e){let t=t=>e.reduce((e,n)=>e+t(n),0),i=t(e=>e.total);if(i===0)return r.dashboard.chart.summary_empty;let a=r.dashboard.counted,o=[a(String(t(e=>e.succeeded)),r.state.run.succeeded.chip),a(String(t(e=>e.withErrors)),r.state.run.completed_with_errors.sentence),a(String(t(e=>e.failed)),r.state.run.failed.chip)];return n(i,r.dashboard.chart.summary)(String(i),o.join(`, `))}function ge(e,t,i=o){let a=e.map(e=>{let t=R(e);return{id:e.id,kind:`worker`,mark:null,label:e.name,tone:t===null?`good`:I(t),detail:t===null?n(e.concurrency,r.dashboard.health.worker)(String(e.concurrency)):L(t),at:t===null?null:e.last_seen_at}}),c=t.map(e=>{let t=M(e);return{id:e.id,kind:`connection`,mark:s(e.kind,i),label:e.code,tone:t.tone??`neutral`,detail:_e(t),at:e.last_check_at}});return[...a,...c]}function _e(e){switch(e.state){case`unchecked`:return r.state.health.unchecked;case`unverified`:return r.state.health.unverified;case`healthy`:return e.detail??r.state.health.healthy;case`failed`:return e.detail??r.state.health.failed.sentence}}function ve(e,t){let i=e.filter(e=>R(e)===null).length,{healthy:a,total:o}=N(t),s=[];if(e.length===0?s.push(r.dashboard.health.no_worker):i<e.length&&s.push(n(e.length,r.dashboard.health.workers_healthy)(String(i),String(e.length))),a<o){let e=j(t,r.word.connection.count);e!==null&&s.push(e)}if(s.length>0){let e=s.join(` · `);return`${e.charAt(0).toUpperCase()}${e.slice(1)}.`}return t.length===0?r.dashboard.health.every_worker_well:r.dashboard.health.all_well}function ye(e,t,n=6){return[...e,...t].toSorted((e,t)=>Date.parse(t.created_at)-Date.parse(e.created_at)).slice(0,n)}function be(e,t=6){return e.flatMap(e=>{let t=B(e.schedule);return t.kind===`due`?[{...e,at:t.at}]:[]}).toSorted((e,t)=>Date.parse(e.at)-Date.parse(t.at)).slice(0,t)}async function xe(e){let t=e.filter(e=>e.schedules>0);return(await Promise.all(t.map(async e=>(await z(e.code,null)).items.map(t=>({pipeline:e.code,schedule:t}))))).flat()}async function Se(){let e=await b(null);return{pipelines:e.items,schedules:await xe(e.items)}}var Ce=6,X=[{id:`failed`,label:r.state.run.failed.tile,fill:`bg-status-failed/80`},{id:`withErrors`,label:r.state.run.completed_with_errors.tile,fill:`bg-status-completed-with-errors/80`},{id:`succeeded`,label:r.state.run.succeeded.tile,fill:`bg-status-succeeded/75`}];function we(e){let t=`${String(e.hour).padStart(2,`0`)}:00`;if(e.total===0)return r.dashboard.chart.hour_empty(t);let n=X.filter(t=>e[t.id]>0).map(t=>r.dashboard.counted(String(e[t.id]),t.label.toLowerCase())),i=n.length===0?r.dashboard.chart.none_settled:n.join(`, `);return r.dashboard.chart.hour(t,String(e.total),i)}function Te({buckets:e,reading:t,className:n}){let i=me(e);return(0,H.jsx)(u,{className:h(`gap-0 p-0`,n),children:(0,H.jsxs)(c,{className:`space-y-3 p-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:r.dashboard.chart.title}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t?r.shell.reading:r.dashboard.chart.hint})]}),(0,H.jsx)(`ul`,{className:`flex items-center gap-3`,children:X.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-sm`,e.fill),"aria-hidden":!0}),e.label]},e.id))})]}),(0,H.jsx)(`div`,{className:`flex h-32 items-end gap-px`,role:`img`,"aria-label":he(e),children:e.map(e=>(0,H.jsxs)(`div`,{className:`flex h-full flex-1 flex-col justify-end rounded-sm hover:bg-accent/40`,title:we(e),children:[X.map(t=>e[t.id]===0?null:(0,H.jsx)(`div`,{className:h(`min-h-0.5 w-full`,t.fill),style:{height:`${String(e[t.id]/Math.max(i,1)*100)}%`}},t.id)),Y(e)===0&&(0,H.jsx)(`div`,{className:`h-px w-full bg-border`})]},e.start))}),(0,H.jsx)(`div`,{className:`flex gap-px font-mono text-xs text-faint`,"aria-hidden":!0,children:e.map((e,t)=>(0,H.jsx)(`span`,{className:`flex-1 text-center`,children:t%Ce===0?`${String(e.hour).padStart(2,`0`)}`:``},e.start))})]})})}function Z(){let e=g(T),t=k((0,V.useCallback)(()=>E({...D,since:`24h`},null,500),[])),n=k((0,V.useCallback)(()=>E({...D,status:`running`},null),[])),a=k((0,V.useCallback)(()=>E({...D,status:`queued`},null),[])),o=k((0,V.useCallback)(()=>E({...D,status:`failed`},null),[])),s=k((0,V.useCallback)(()=>E({...D,status:`completed_with_errors`},null),[])),c=k(Se),u=k((0,V.useCallback)(()=>ce(null),[])),m=k((0,V.useCallback)(()=>A(null),[])),{again:_}=t,{again:y}=n,{again:b}=a,{again:x}=o,{again:O}=s,{again:j}=c,{again:M}=u,{again:N}=m,P=(0,V.useCallback)(()=>{_(),y(),b(),x(),O(),j(),M(),N()},[j,N,_,x,O,b,y,M]);(0,V.useEffect)(()=>C([{id:`dashboard:refresh`,title:r.dashboard.refresh,group:te,screen:!0,icon:S,keywords:[`refresh`,`reload`,`home`],run:P}]),[P]);let F=i();ee(P,g(w));let I=ye(n.value?.items??[],a.value?.items??[]),L=se(ae(o.value?.items??[],s.value?.items??[]),c.value?.pipelines??[]),R=be(c.value?.schedules??[]),z=ue(t.value,n.value,a.value),B=new Date,U=pe(t.value?.items??[],B,v(B)),G=u.problem===null&&m.problem===null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(d,{title:r.screen.dashboard.name,aside:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{tag:`runs`}),(0,H.jsx)(re,{onRefresh:P})]})}),(0,H.jsx)(`div`,{className:`mb-3 grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6`,children:z.map(e=>e.tile===null?(0,H.jsx)(ie,{},e.id):(0,H.jsx)(oe,{tile:e.tile},e.id))}),(0,H.jsxs)(`div`,{className:`mb-6 grid gap-3 xl:grid-cols-3`,children:[(0,H.jsx)(`div`,{className:h(G?`xl:col-span-2`:`xl:col-span-3`),children:t.problem===null?(0,H.jsx)(Te,{buckets:U,reading:!t.read}):(0,H.jsx)(l,{loading:!1,problem:t.problem,empty:!1,children:null})}),G&&(0,H.jsx)(W,{rows:ge(u.value?.items??[],m.value?.items??[],e),note:ve(u.value?.items??[],m.value?.items??[]),reading:!u.read||!m.read})]}),(0,H.jsx)(Q,{title:r.word.in_flight.heading,to:`/runs`,children:(0,H.jsx)(l,{loading:!n.read||!a.read,problem:n.problem??a.problem,empty:I.length===0,emptyMessage:r.dashboard.nothing_in_flight,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:Ee,rows:I,rowKey:e=>e.id,reading:!1,next:null,onMore:$,noun:r.word.run.count,onSelect:e=>void F(`/runs/${e.id}`)})})}),(0,H.jsx)(Q,{title:r.dashboard.troubled_runs,to:`/runs`,children:(0,H.jsx)(l,{loading:!o.read||!s.read,problem:o.problem??s.problem,empty:L.length===0,emptyMessage:r.dashboard.nothing_troubled,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:ne,rows:L,rowKey:e=>e.run.id,reading:!1,next:null,onMore:$,noun:r.word.run.count,onSelect:e=>void F(`/runs/${e.run.id}`)})})}),(0,H.jsx)(Q,{title:r.dashboard.next_firings,to:`/triggers`,children:(0,H.jsx)(l,{loading:!c.read,problem:c.problem,empty:R.length===0,emptyMessage:r.dashboard.no_fire_due,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:De,rows:R,rowKey:e=>`${e.pipeline}:${e.schedule.code}`,reading:!1,next:null,onMore:$,noun:r.word.firing.count,onSelect:e=>void F(`/pipelines/${encodeURIComponent(e.pipeline)}`)})})})]})}function Q({title:e,to:t,children:n}){return(0,H.jsxs)(`section`,{className:`mb-6 space-y-2 last:mb-0`,children:[(0,H.jsx)(`div`,{className:`space-y-1`,children:(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:(0,H.jsx)(a,{to:t,className:`hover:text-primary-ink`,children:e})})}),n]})}var $=()=>{},Ee=[{id:`status`,header:r.word.status,cell:e=>(0,H.jsx)(x,{status:e.status})},{id:`pipeline`,header:r.word.pipeline.label,cell:e=>(0,H.jsx)(`span`,{className:`font-mono text-sm`,children:y({code:e.pipeline}).title})},{id:`since`,header:r.dashboard.column.since,className:`text-right`,cell:e=>(0,H.jsx)(P,{className:`text-xs text-faint`,at:e.started_at??e.created_at})}],De=[{id:`pipeline`,header:r.word.pipeline.label,cell:e=>(0,H.jsx)(`span`,{className:`font-mono text-sm`,children:y({code:e.pipeline}).title})},{id:`schedule`,header:r.word.schedule.label,cell:e=>{let t=y(e.schedule);return(0,H.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,H.jsx)(`span`,{className:h(`truncate text-xs`,t.named?`text-foreground`:`font-mono`),children:t.title}),t.code!==null&&(0,H.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:t.code})]})}},{id:`fires`,header:r.word.next,className:`text-right`,cell:e=>(0,H.jsx)(P,{className:`text-xs text-faint`,at:e.at})}];export{Z as Dashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-Dp8H1wzG.js";import{n as r}from"./PageState-CuZbHz6s.js";import{t as i}from"./WindowedPane-B5QHXRJT.js";import{r as a,t as o}from"./utils-CT7ZGLfR.js";import{h as s}from"./paging-C4feZMNQ.js";import{t as c}from"./identity-BNZxCf_y.js";import{ct as l,k as u,y as d}from"./index-DcrUT8O1.js";import{t as f}from"./Description-C-byz7P3.js";import{n as p,r as m}from"./Panel-COl_eBj1.js";import{t as h}from"./badge-CzFHv2r3.js";import{f as g,n as _,u as v}from"./examples-NA2YGKLT.js";import{t as y}from"./starters-DexsdOaG.js";var b=e(t(),1),x=a(),S=n.examples.source_pane,C=n.examples.use_as_starter,w=n.examples.requirement.line;function T({example:e,holdings:t,onUse:a}){let T=e.code,O=d((0,b.useCallback)(()=>v(T),[T])),k=c(e),A=(0,b.useMemo)(()=>g(e.requires,t),[e.requires,t]),j=_(e),M=e.tags.filter(e=>e!==y),N=O.value?.source??``;return(0,x.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,x.jsxs)(`div`,{className:`space-y-1`,children:[(0,x.jsx)(`h2`,{className:o(`text-sm font-semibold`,!k.named&&`font-mono`),children:k.title}),k.code!==null&&(0,x.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:k.code}),(e.starter||j!==null)&&(0,x.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[e.starter&&(0,x.jsx)(h,{variant:`outline`,children:n.examples.starter_badge}),j!==null&&(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:j})]}),(0,x.jsx)(f,{text:e.description})]}),M.length>0&&(0,x.jsx)(`p`,{className:`flex flex-wrap items-center gap-1`,children:M.map(e=>(0,x.jsx)(u,{tag:e},e))}),(0,x.jsx)(m,{title:n.examples.facts,children:(0,x.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,x.jsx)(p,{term:n.examples.fact.plugin,detail:e.plugin}),(0,x.jsx)(p,{term:n.examples.fact.shelf,detail:e.shelf===``?n.examples.root_shelf:e.shelf}),O.value!==null&&(0,x.jsx)(p,{term:n.examples.fact.path,detail:(0,x.jsx)(`span`,{className:`font-mono break-all`,children:O.value.path})})]})}),(0,x.jsx)(m,{title:n.word.requires,children:A.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.examples.requires_nothing}):(0,x.jsx)(`ul`,{className:`space-y-1 text-xs`,children:A.map(e=>(0,x.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,x.jsx)(`span`,{className:`text-faint`,children:w[e.kind]}),(0,x.jsx)(`span`,{className:`font-mono break-all`,children:e.name}),(0,x.jsx)(`span`,{className:o(`ml-auto shrink-0`,D(e)),children:E(e)})]},`${e.kind}:${e.name}`))})}),(0,x.jsx)(m,{title:n.word.source,children:!O.read||O.problem!==null?(0,x.jsx)(r,{loading:!O.read,problem:O.problem,empty:!1,children:null}):(0,x.jsx)(i,{name:S,className:`overflow-hidden rounded-md border border-border bg-background`,windowed:(0,x.jsx)(l,{value:N,path:`example-${T}-window`,label:n.examples.source_pane_windowed(S),className:`min-h-0 flex-1`,readOnly:!0}),children:(0,x.jsx)(l,{value:N,path:`example-${T}`,label:S,className:`h-72 min-h-40`,readOnly:!0})})}),e.starter&&(0,x.jsx)(s,{size:`sm`,className:`self-start`,disabled:O.value===null,onClick:()=>{a(N,T)},children:C})]})}function E(e){return e.met===null?n.examples.requirement.unchecked:e.met?n.examples.requirement.here:n.examples.requirement.missing_word}function D(e){return e.met===null?`text-faint`:e.met?`text-good`:`text-critical`}export{T as ExamplePanel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExamplePanel-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExamplePanel-Bk9Am0Hf.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/store-D-5yFBN1.js","assets/labels-Dp8H1wzG.js","assets/PageState-CuZbHz6s.js","assets/dropdown-menu-BHh5eZwx.js","assets/api-B9HrzKUX.js","assets/utils-CT7ZGLfR.js","assets/paging-C4feZMNQ.js","assets/WindowedPane-B5QHXRJT.js","assets/index-DcrUT8O1.js","assets/dist-CvOdB3Md.js","assets/preload-helper-BZ1Pz5am.js","assets/chunk-OB3PAWPO-m4Sckj1b.js","assets/nav-kCAjFkWN.js","assets/play-BEK7f0g4.js","assets/file-braces-CTPaWRnZ.js","assets/chevron-down-CxU_G9N3.js","assets/glyphs-CaFpiNjJ.js","assets/ListTable-A_dkU0ci.js","assets/panels-D1Fnei43.js","assets/docs-CCoB3shg.js","assets/x-C07Lrlf8.js","assets/tooltip-Bas36yZU.js","assets/input-sbz1EN8t.js","assets/textarea-D86x5ut1.js","assets/use-store-CZcp6jmY.js","assets/auth-QgZsjd0d.js","assets/idle-DnO3aHK7.js","assets/format-D2kQLRJs.js","assets/status-PejJT5B-.js","assets/use-heartbeat-C3WWagro.js","assets/identity-BNZxCf_y.js","assets/pipelines-Da2DZJX0.js","assets/index-DZ7D7u3R.css","assets/Description-C-byz7P3.js","assets/Panel-COl_eBj1.js","assets/copy-BXKuMpY5.js","assets/badge-CzFHv2r3.js","assets/examples-NA2YGKLT.js","assets/blocks-DCUqC697.js","assets/connections-ENTr1Nsd.js","assets/schemas-BJXljAsa.js","assets/starters-DexsdOaG.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-Dp8H1wzG.js";import{t as r}from"./preload-helper-BZ1Pz5am.js";import{c as i,u as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{n as o}from"./nav-kCAjFkWN.js";import{n as s,t as c}from"./PageState-CuZbHz6s.js";import{i as l,t as u}from"./ListTable-A_dkU0ci.js";import{r as d,t as f}from"./utils-CT7ZGLfR.js";import{a as p,r as m,s as h}from"./panels-D1Fnei43.js";import{n as g,t as _}from"./identity-BNZxCf_y.js";import{C as v,Lt as ee,O as y,T as b,gt as x,it as S,k as C,mt as w,rt as te,v as T,y as E,zt as D}from"./index-DcrUT8O1.js";import{t as O}from"./badge-CzFHv2r3.js";import{_ as k,a as A,c as j,d as M,f as N,h as P,i as F,l as I,n as L,o as R,p as z,s as ne,t as B}from"./examples-NA2YGKLT.js";import{n as V,t as H}from"./starters-DexsdOaG.js";import{t as U}from"./Segmented-KaDiGiyr.js";var W=e(t(),1),G=d(),K=(0,W.lazy)(()=>r(()=>import(`./ExamplePanel-Bk9Am0Hf.js`).then(e=>({default:e.ExamplePanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))),q=`example`,J=()=>{},Y=e=>e.code,X=[{value:`all`,label:n.examples.which.all},{value:`starters`,label:n.examples.which.starters}];function Z(){let e=i(),[t,r]=a(),[d,f]=(0,W.useState)(null),g=(0,W.useMemo)(()=>F(t),[t]),_=(0,W.useCallback)(e=>{r(j(e),{replace:!0})},[r]),v=E(I),O=E(M),A=(0,W.useMemo)(()=>O.value??{blocks:null,connections:null,schemas:null},[O.value]),N=(0,W.useMemo)(()=>v.value??[],[v.value]),L=(0,W.useMemo)(()=>R(N,g),[g,N]),z=(0,W.useMemo)(()=>P(N),[N]),H=(0,W.useMemo)(()=>ne(N),[N]),Z=(0,W.useMemo)(()=>k(N),[N]),Q=(0,W.useCallback)(e=>{g.tags.includes(e)||_({...g,tags:[...g.tags,e]})},[_,g]),ae=(0,W.useMemo)(()=>ie(A,H,Q),[Q,A,H]),$=(0,W.useCallback)((t,n)=>{e(o,{state:{document:V(t,n)}})},[e]);return(0,W.useEffect)(()=>(S({note:null,tone:`quiet`,identifier:null}),te),[N.length]),(0,W.useEffect)(()=>x([{id:`examples:starters`,title:n.examples.show_starters,group:w,screen:!0,icon:D,keywords:[`starter`,`copy`,`new`],run:()=>{_({...g,starters:!0})}},{id:`examples:clear`,title:n.examples.clear_filters,group:w,screen:!0,icon:ee,keywords:[`reset`,`all`],run:()=>{_({needle:``,tags:[],shelf:``,plugin:``,starters:!1,block:``})}}]),[_,g]),(0,W.useEffect)(()=>{if(d!==null)return p([{id:q,label:n.word.example.label,render:()=>(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(re,{}),children:(0,G.jsx)(K,{example:d,holdings:A,onUse:$},d.code)})}],{screen:`examples`})},[d,A,$]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(c,{title:n.screen.examples.name,aside:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(l,{tag:`examples`}),L.length!==N.length&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.examples.counted_of(String(L.length),String(N.length))})]})}),(0,G.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(b,{value:g.needle,label:n.examples.search,onChange:e=>{_({...g,needle:e})}}),(0,G.jsx)(U,{label:n.examples.which.label,value:g.starters?`starters`:`all`,options:X,onChoose:e=>{_({...g,starters:e===`starters`})}}),(0,G.jsx)(y,{chosen:g.tags,offered:Z,onChange:e=>{_({...g,tags:e})}}),(0,G.jsx)(T,{label:n.word.shelf,value:g.shelf,anything:n.examples.any_shelf,options:z.map(e=>({value:e,label:e})),onChange:e=>{_({...g,shelf:e===``?``:e})}}),H.length>1&&(0,G.jsx)(T,{label:n.word.plugin.label,value:g.plugin,anything:n.examples.any_plugin,options:H.map(e=>({value:e,label:e})),onChange:e=>{_({...g,plugin:e===``?``:e})}}),g.block!==``&&(0,G.jsx)(C,{tag:g.block,label:n.examples.stop_narrowing(g.block),onSelect:()=>{_({...g,block:``})}})]}),(0,G.jsx)(s,{loading:!v.read,problem:v.problem,empty:L.length===0,emptyMessage:N.length===0?n.examples.none_installed:B(g)?n.examples.none_match:n.examples.empty,children:(0,G.jsx)(u,{columns:ae,rows:L,rowKey:Y,reading:!1,next:null,onMore:J,noun:n.word.example.count,onSelect:e=>{f(e),h(q)},selected:e=>e.code===d?.code,onClose:()=>{f(null),m()}})})]})}function re(){return(0,G.jsx)(`div`,{className:`p-4`,children:(0,G.jsx)(s,{loading:!0,problem:null,empty:!1,children:null})})}function ie(e,t,r){return[{id:`example`,header:n.word.example.label,kind:`title`,cell:e=>{let t=_(e),r=L(e);return(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:f(`truncate font-semibold`,`max-lg:overflow-visible max-lg:whitespace-normal`,!t.named&&`font-mono`),title:t.title,children:t.title}),e.starter&&(0,G.jsx)(O,{variant:`outline`,className:`shrink-0`,children:n.examples.starter_badge}),r!==null&&(0,G.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,title:n.examples.carries_hint,children:r})]}),(0,G.jsxs)(`p`,{className:`flex items-center gap-2 text-xs`,children:[t.code!==null&&(0,G.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:t.code}),e.description!==null&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:g(e.description),children:g(e.description)})]})]})}},{id:`tags`,header:n.word.tags,cell:e=>{let t=e.tags.filter(e=>e!==H);return t.length===0?null:(0,G.jsx)(v,{tags:t,onSelect:r})}},{id:`requires`,header:n.word.requires,className:`whitespace-nowrap`,cell:t=>{let n=N(t.requires,e),r=z(n);return r===null?null:(0,G.jsx)(`span`,{className:f(`text-xs`,A(n)===0?`text-muted-foreground`:`text-critical`),children:r})}},...t.length>1?[{id:`plugin`,header:n.word.plugin.label,className:`w-32 font-mono text-xs whitespace-nowrap`,cell:e=>(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]:[]]}export{Z as Examples};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-CT7ZGLfR.js";import{l as t,s as n}from"./format-
|
|
1
|
+
import{r as e}from"./utils-CT7ZGLfR.js";import{l as t,s as n}from"./format-D2kQLRJs.js";var r=e();function i({at:e,className:i}){return(0,r.jsx)(`span`,{className:i,title:e?n(e):void 0,children:t(e)})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{a as n,t as r}from"./labels-Dp8H1wzG.js";import{$ as i,$n as a,$t as o,Ar as s,Br as c,Dn as l,Fn as u,Fr as d,Gn as f,Gt as p,Ir as m,J as h,Jt as g,K as _,Ln as v,Mr as y,N as b,Nr as x,O as S,On as C,Pr as w,Q as T,Qt as E,Rn as D,Tr as ee,Xt as O,Yt as k,Z as A,Zt as j,an as M,bn as N,d as P,dt as F,en as I,f as L,ft as R,gn as z,lr as B,lt as te,m as ne,nn as V,ot as H,rn as U,w as re,y as ie,yr as ae,zr as oe}from"./api-B9HrzKUX.js";import{t as se}from"./chevron-down-CxU_G9N3.js";import{A as ce,C as le,_ as ue,b as de,d as fe,f as pe,g as W,h as me,j as he,p as G,v as ge,w as _e,x as K,y as ve}from"./dropdown-menu-BHh5eZwx.js";import{t as ye}from"./WindowedPane-B5QHXRJT.js";import{r as be,t as q}from"./utils-CT7ZGLfR.js";import{_ as xe,a as Se,c as Ce,d as we,f as Te,h as Ee,l as J,m as De,o as Oe,p as ke,r as Ae,s as je,t as Me,u as Ne,v as Pe}from"./resolveAriaLabelledBy-oo0FwAnY.js";import{a as Fe,c as Ie,i as Le,n as Re,r as ze,u as Be}from"./input-sbz1EN8t.js";import{ct as Ve,ut as He}from"./index-DcrUT8O1.js";var Ue={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Ue.node;var We=n(Ue),Y=e(t(),1);function Ge(e){let[t,n]=Y.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var X=be(),Ke=Y.createContext(void 0),qe={disableStyleElements:!1};function Z(){return Y.useContext(Ke)??qe}var Je=Y.createContext(void 0),Ye=Y.createContext(void 0),Xe=Y.createContext(void 0);function Q(){let e=Y.useContext(Je);if(e===void 0)throw Error(y(60));return e}function Ze(){let e=Y.useContext(Ye);if(e===void 0)throw Error(y(101));return e}function Qe(){let e=Y.useContext(Xe);if(e===void 0)throw Error(y(61));return e}var $e={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Ce(t,r)!==``},hasNullItemLabel:(e,t)=>t?Ae(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>J(t,e,n)):J(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function et(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function tt(e,t){return Math.max(0,e-t)}function nt(e,t){if(t<=0)return 0;let n=et(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function rt(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:c,name:l,form:u,autoComplete:f,disabled:p=!1,readOnly:v=!1,required:y=!1,modal:S=!0,actionsRef:C,inputRef:D,onOpenChangeComplete:ee,items:O,multiple:j=!1,itemToStringLabel:M,itemToStringValue:F,isItemEqualToValue:z=Ne,highlightItemOnHover:B=!0,children:te}=e,{clearErrors:ne}=Fe(),{setDirty:V,setTouched:H,setFocused:re,validityData:ie,setFilled:ae,name:se,disabled:ce,validation:de,validationMode:fe}=Ie(),pe=ze({id:t}),W=ce||p,me=se??l,[G,ge]=P({controlled:n,default:j?r??w:r,name:`Select`,state:`value`}),[K,ve]=P({controlled:a,default:s,name:`Select`,state:`open`}),ye=Y.useRef([]),be=Y.useRef([]),q=Y.useRef(null),Se=Y.useRef(null),we=Y.useRef(0),Ee=Y.useRef(null),J=Y.useRef([]),De=Y.useRef(!1),Oe=Y.useRef(null),Ae=Y.useRef(null),Me=Y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Le=Y.useRef(!1),Be=Y.useRef(G),{mounted:Ve,setMounted:Ue,transitionStatus:We}=h(K),{openMethod:Ke,triggerProps:qe}=ue(K),Z=oe(()=>new A({id:pe,labelId:void 0,modal:S,multiple:j,itemToStringLabel:M,itemToStringValue:F,isItemEqualToValue:z,value:G,open:K,mounted:Ve,transitionStatus:We,items:O,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:d,triggerProps:d,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:m,setOpen:m,handleScrollArrowVisibility:m,onOpenChangeComplete:m,listRef:ye,popupRef:q,scrollHandlerRef:Se,scrollArrowsMountedCountRef:we,valueRef:Ee,valuesRef:J,labelsRef:be,typingRef:De,selectionRef:Me,firstItemTextRef:Oe,selectedItemTextRef:Ae,alignItemWithTriggerActiveRef:Le,initialValueRef:Be},$e)).current,Q=Z.useState(`activeIndex`),Ze=Z.useState(`selectedIndex`),Qe=Z.useState(`triggerElement`),et=Z.useState(`positionerElement`),rt=Ge(Ke),it=Ke??rt,at=Y.useMemo(()=>j?``:Ce(G,F),[j,G,F]),ot=Y.useMemo(()=>j&&Array.isArray(G)?G.map(e=>Ce(e,F)):Ce(G,F),[j,G,F]),st=o(Qe),ct=E(()=>ot);Re(st,pe,G,ct,!W,l);let lt=j?Array.isArray(G)&&G.length>0:G!=null&&at!==``;x(()=>{ae(lt)},[lt,ae]),x(function(){let e=Te(J.current,G,z,j);e===null&&(Ae.current=null),!K&&Z.set(`selectedIndex`,e)},[j,K,G,z,Z]),L(G,()=>{ne(me),V(ke(G,ie.initialValue,z)),de.change(G)});let ut=E((e,t)=>{c?.(e,t),!t.isCanceled&&(ve(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(H(!0),re(!1),fe===`onBlur`&&de.commit(G)))}),dt=E(()=>{Ue(!1),Z.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),ee?.(!1)});_({enabled:!C,open:K,ref:q,onComplete(){K||dt()}}),Y.useImperativeHandle(C,()=>({unmount:dt}),[dt]);let ft=E((e,t)=>{i?.(e,t),!t.isCanceled&&ge(e)}),pt=E(e=>{let t=tt(e.scrollHeight,e.clientHeight),n=nt(e.scrollTop,t),r=n>0,i=n<t;Z.set(`scrollUpArrowVisible`,r),Z.set(`scrollDownArrowVisible`,i)}),$=Pe({open:K,onOpenChange:ut,elements:{reference:Qe,floating:et}}),mt=he($,{enabled:!W,event:`mousedown`}),ht=T($),gt=_e($,{enabled:!W,listRef:ye,activeIndex:Q,selectedIndex:Ze,disabledIndices:w,onNavigate(e){(e!==null||K)&&Z.set(`activeIndex`,e)},focusItemOnHover:B}),_t=le($,{enabled:!W&&(K||!v&&!j),listRef:be,activeIndex:Q,selectedIndex:Ze,disabledIndices:e=>He(ye.current[e]),onMatch(e){K?Z.set(`activeIndex`,e):ft(J.current[e],U(N))},onTyping(e){De.current=e}}),vt=Y.useMemo(()=>R(_t.reference,gt.reference,ht.reference,mt.reference,qe),[mt.reference,_t.reference,gt.reference,ht.reference,qe]),yt=Y.useMemo(()=>R(b,_t.floating,gt.floating,ht.floating),[_t.floating,gt.floating,ht.floating]),bt=gt.item??d;Z.useContextCallback(`setValue`,ft),Z.useContextCallback(`setOpen`,ut),Z.useContextCallback(`handleScrollArrowVisibility`,pt),Z.useContextCallback(`onOpenChangeComplete`,ee),xe(()=>{Z.update({popupProps:yt,triggerProps:vt})}),Z.useSyncedValues({id:pe,modal:S,multiple:j,value:G,open:K,mounted:Ve,transitionStatus:We,popupProps:yt,triggerProps:vt,items:O,itemToStringLabel:M,itemToStringValue:F,isItemEqualToValue:z,openMethod:it});let xt=Y.useMemo(()=>({disabled:W,readOnly:v,required:y,multiple:j,highlightItemOnHover:B,itemProps:bt}),[W,v,y,j,B,bt]),St=I(D,de.inputRef),Ct=j?void 0:me,wt=Y.useMemo(()=>!j||!Array.isArray(G)||!me?null:G.map(e=>{let t=Ce(e,F);return(0,X.jsx)(`input`,{type:`hidden`,form:u,name:me,value:t,disabled:W},t)}),[j,G,u,me,F,W]);return(0,X.jsxs)(Je.Provider,{value:Z,children:[(0,X.jsx)(Ye.Provider,{value:xt,children:(0,X.jsx)(Xe.Provider,{value:$,children:te})}),(0,X.jsx)(`input`,{...de.getValidationProps(W,{onFocus(){Z.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||W||v)return;let t=e.currentTarget.value,n=U(N,e.nativeEvent);function r(){if(j)return;let e=t.toLowerCase(),r=J.current.findIndex(t=>Ce(t,F).toLowerCase()===e||je(t,M).toLowerCase()===e);r===-1&&(r=J.current.findIndex((t,n)=>{let r=be.current[n];return r!=null&&r.toLowerCase()===e}));let i=J.current[r];i!=null&&ft(i,n)}Z.set(`forceMount`,!0),queueMicrotask(r)}}),id:pe&&Ct==null?`${pe}-hidden-input`:void 0,form:u,name:Ct,autoComplete:f,value:at,disabled:W,required:y&&!(j&<),readOnly:v,ref:St,style:me?k:g,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),wt]})}var it=`data-popup-side`,at=400,ot={...v,...Be,popupSide:e=>e?{[it]:e}:null,value:()=>null},st=Y.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:c=!1,nativeButton:l=!0,style:u,...d}=e,{setTouched:f,setFocused:p,validationMode:m,validation:h,state:g,disabled:_}=Ie(),{labelId:v}=Le(),y=Q(),{readOnly:b,required:x,disabled:S}=Ze(),w=_||S||c,T=y.useState(`open`),E=y.useState(`mounted`),D=y.useState(`value`),ee=y.useState(`triggerProps`),k=y.useState(`positionerElement`),A=y.useState(`listElement`),j=y.useState(`popupSide`),P=y.useState(`id`),I=y.useState(`labelId`),L=y.useState(`hasSelectedValue`),z=E&&k?j:null,B=i??P,te=Me(v,I);ze({id:i});let ne=o(k),V=Y.useRef(null),{getButtonProps:H,buttonRef:ie}=re({disabled:w,native:l}),ae=y.useStateSetter(`triggerElement`),oe=s(),se=s(),ce=s();Y.useEffect(()=>{if(T)return ce.start(at,()=>{y.context.selectionRef.current.allowUnselectedMouseUp=!0,y.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ce.clear()};y.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},se.clear()},[T,y,se,ce]);let le=R(ee,{id:B,role:`combobox`,"aria-expanded":T,"aria-haspopup":`listbox`,"aria-controls":T?A?.id??C(k)?.id:void 0,"aria-labelledby":te,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:w?-1:0,onFocus(e){p(!0),T&&y.context.alignItemWithTriggerActiveRef.current&&y.context.setOpen(!1,U(N,e.nativeEvent)),oe.start(0,()=>{y.set(`forceMount`,!0)})},onBlur(e){a(k,e.relatedTarget)||(f(!0),p(!1),m===`onBlur`&&h.commit(D))},onMouseDown(e){if(T)return;let t=O(e.currentTarget);function n(e){if(!V.current)return;let t=e.target;a(V.current,t)||a(ne.current,t)||fe(e,V.current)||y.context.setOpen(!1,U(M,e))}se.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},d,H),ue=h.getValidationProps(w,le);ue.role=`combobox`;let de={...g,open:T,disabled:w,value:D,readOnly:b,popupSide:z,placeholder:!L};return F(`button`,e,{ref:[t,V,ie,ae],state:de,stateAttributesMapping:ot,props:ue})}),ct={value:()=>null},lt=Y.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Q(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?Se(l,u,d):Oe(l,u,d)),F(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:ct})}),ut=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o={open:Q().useState(`open`)};return F(`span`,e,{state:o,ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:D})}),dt=Y.forwardRef(function(e,t){let n=Q(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,X.jsx)(H,{ref:t,...e}):null}),ft=Y.createContext(void 0);function pt(){let e=Y.useContext(ft);if(!e)throw Error(y(59));return e}function $(e,t){e&&Object.assign(e.style,t)}var mt={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},ht={position:`fixed`},gt=Y.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=te,style:_,...v}=e,y=Q(),b=Qe(),C=y.useState(`open`),w=y.useState(`mounted`),T=y.useState(`modal`),D=y.useState(`value`),ee=y.useState(`openMethod`),O=y.useState(`positionerElement`),k=y.useState(`triggerElement`),A=y.useState(`isItemEqualToValue`),j=y.useState(`transitionStatus`),M=Y.useRef(null),P=Y.useRef(null),[F,I]=Y.useState(h),L=w&&F&&ee!==`touch`;!w&&F!==h&&I(h),Y.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>L),pe((L||T)&&C,ee===`touch`,O,k);let R=de({anchor:n,floatingRootContext:b,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??L,collisionAvoidance:g,keepMounted:!0}),z=L?`none`:R.side,B=L?ht:R.positionerStyles,V={open:C,side:z,align:R.align,anchorHidden:R.anchorHidden};x(()=>{y.set(`popupSide`,R.side)},[y,R.side]);let H=y.useStateSetter(`positionerElement`),re=ge(e,V,{styles:B,transitionStatus:j,props:v,refs:[t,H],hidden:!w,inert:!C}),ie=Y.useRef(0),ae=E(e=>{if(y.context.valuesRef.current.length===0)return;let t=ie.current;ie.current=e.size;let n=U(N);if(t!==0&&!y.state.multiple&&D!==null&&we(y.context.valuesRef.current,D,A)===-1){let e=y.context.initialValueRef.current,t=e!=null&&we(y.context.valuesRef.current,e,A)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(D)){let e=D.filter(e=>we(y.context.valuesRef.current,e,A)!==-1);e.length!==D.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(C&&L){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};$(O,e),$(y.context.popupRef.current,e)}}),oe=Y.useMemo(()=>({...R,side:z,alignItemWithTriggerActive:L,setControlledAlignItemWithTrigger:I,scrollUpArrowRef:M,scrollDownArrowRef:P}),[R,z,L,I]);return(0,X.jsx)(W,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ae,children:(0,X.jsxs)(ft.Provider,{value:oe,children:[w&&T&&(0,X.jsx)(ne,{inert:S(!C),cutout:k}),re]})})}),_t=`base-ui-disable-scrollbar`,vt={className:_t,getElement(e){return(0,X.jsx)(`style`,{nonce:e,href:_t,precedence:`base-ui:low`,children:`.${_t}{scrollbar-width:none}.${_t}::-webkit-scrollbar{display:none}`})}},yt=`--transform-origin`,bt={...u,...f},xt=Y.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,...s}=e,c=Q(),{multiple:u,readOnly:d,highlightItemOnHover:f}=Ze(),p=Qe(),{side:m,align:h,alignItemWithTriggerActive:g,isPositioned:v,setControlledAlignItemWithTrigger:y}=pt(),b=G(!0)!=null,S=K(),{nonce:C,disableStyleElements:w}=Z(),T=c.useState(`id`),D=c.useState(`open`),k=c.useState(`openMethod`),A=c.useState(`mounted`),M=c.useState(`popupProps`),N=c.useState(`transitionStatus`),P=c.useState(`triggerElement`),I=c.useState(`positionerElement`),L=c.useState(`listElement`),R=Y.useRef(!1),z=Y.useRef(!1),te=Y.useRef({}),ne=j(),H=E(e=>{if(!I||!c.context.popupRef.current||!z.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(R.current||!g||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=wt(I),i=Tt(I.getBoundingClientRect().height,`y`,r),a=O(I),o=B(I),s=o.getComputedStyle(I),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=St(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=Ct(e),h=null,_=e=>{I.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=et(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(R.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?h=t?1/0:0:n&&p<m&&(h=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),h!=null){let t=et(h,0,Ct(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(R.current=!0),c.context.handleScrollArrowVisibility(e)});Y.useImperativeHandle(c.context.scrollHandlerRef,()=>H,[H]),_({open:D,ref:c.context.popupRef,onComplete(){D&&c.context.onOpenChangeComplete(!0)}});let re={open:D,transitionStatus:N,side:m,align:h};x(()=>{I&&c.context.popupRef.current&&!Object.keys(te.current).length&&(te.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),x(()=>{D||g||(z.current=!1,R.current=!1,$(I,te.current))},[D,g,I]),x(()=>{let e=c.context.popupRef.current;if(!D||!P||!I||!e||g&&!v||c.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty(yt),!g){ne.request(()=>c.context.handleScrollArrowVisibility(L||e));return}let t=Ot(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=B(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=O(P),s=wt(P),l=Et(P.getBoundingClientRect(),s),u=Et(I.getBoundingClientRect(),s),d=l.height,p=L||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,_=parseFloat(i.marginBottom)||10,v=parseFloat(i.minHeight)||100,b=St(a),x=o.documentElement.clientHeight-g-_,C=o.documentElement.clientWidth,w=x-l.bottom+d,T,E=S===`rtl`?l.right-u.width:l.left,D=0;if(t&&n){let e=Et(n.getBoundingClientRect(),s);T=Et(t.getBoundingClientRect(),s),E=u.left+(S===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-u.top+T.height/2-r}let k=w+D+_+h,A=Math.min(x,k),j=x-g-_,M=k-A,N=C-5;I.style.left=`${et(E,5,N-u.width)}px`,I.style.height=`${A}px`,I.style.maxHeight=`none`,I.style.marginTop=`${g}px`,I.style.marginBottom=`${_}px`,e.style.height=`100%`;let F=Ct(p),z=M>=F-1;z&&(A=Math.min(x,u.height)-(M-F));let ne=l.top<20||l.bottom>x-20||Math.ceil(A)+1<Math.min(m,v),V=(r.visualViewport?.scale??1)!==1&ⅇif(ne||V){$(I,te.current),y(!1);return}let H=Math.max(v,A);if(z){let e=Math.max(0,x-k);I.style.top=u.height>=j?`0`:`${e}px`,I.style.height=`${A}px`,p.scrollTop=Ct(p)}else I.style.bottom=`0`,p.scrollTop=M;if(T){let t=u.top,n=u.height,r=T.top+T.height/2,i=et(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(yt,`50% ${i}%`)}(H===x||A>=b)&&(R.current=!0),c.context.handleScrollArrowVisibility(p),f&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,D,I,P,g,y,ne,L,f,S,v]),Y.useEffect(()=>{if(!g||!I||!D)return;let e=B(I);function t(e){c.context.setOpen(!1,U(l,e))}return V(e,`resize`,t)},[c,g,I,D]);let ae={...L?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":u||void 0,"aria-readonly":d||void 0,id:`${T}-list`},onKeyDown(e){b&&ie.has(e.key)&&e.stopPropagation()},onScroll(e){L||H(e.currentTarget)},...g&&{style:L?{height:`100%`}:mt},className:!L&&g?vt.className:void 0},oe=F(`div`,e,{ref:[t,c.context.popupRef],state:re,stateAttributesMapping:bt,props:[M,ae,ve(N),s]});return(0,X.jsxs)(Y.Fragment,{children:[!w&&vt.getElement(C),(0,X.jsx)(i,{context:p,modal:!1,disabled:!A,openInteractionType:k,returnFocus:o,restoreFocus:!0,children:oe})]})});function St(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Ct(e){return tt(e.scrollHeight,e.clientHeight)}function wt(e){return ce.getScale(e)}function Tt(e,t,n){return e/n[t]}function Et(e,t){return p({x:Tt(e.x,`x`,t),y:Tt(e.y,`y`,t),width:Tt(e.width,`x`,t),height:Tt(e.height,`y`,t)})}var Dt=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Ot(e){let{style:t}=e,n={};for(let[e,r]of Dt)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Dt){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var kt=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Q(),{multiple:s,readOnly:c}=Ze(),{alignItemWithTriggerActive:l}=pt(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:mt},className:u&&d!==`touch`?vt.className:void 0},p=o.useStateSetter(`listElement`);return F(`div`,e,{ref:[t,p],props:[f,a]})}),At=Y.createContext(void 0);function jt(){let e=Y.useContext(At);if(!e)throw Error(y(57));return e}var Mt=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=Y.useRef(null),d=me({guess:!0,label:o,textRef:u}),f=Q(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=Ze(),_=h||s,v=f.useState(`isActive`,d.index),y=f.useState(`open`),b=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=f.useState(`isItemEqualToValue`),w=d.index,T=Y.useRef(null);x(()=>{let e=f.context.valuesRef.current;return e[w]=a,()=>{delete e[w]}},[w,a,f]),x(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=Ee(w,a,f.context.valuesRef.current,e,C,t),r=n===w,w===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&J(a,e,C),r&&(n=w)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[w,m,C,f,a]);let E=Y.useRef(`mouse`),D=Y.useRef(!1),{getButtonProps:ee,buttonRef:O}=re({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:_,selected:b,highlighted:v};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=b?De(n,a,C):[...n,a];f.context.setValue(r,U(z,e))}else f.context.setValue(a,U(z,e)),f.context.setOpen(!1,U(z,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":b,tabIndex:y&&v?0:-1,onKeyDown(e){f.set(`activeIndex`,w),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&ae(e.nativeEvent)&&(n!==void 0||v),i=t&&!r&&!D.current;D.current=!1,!(_||i)&&A(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,j()},onMouseUp(){if(j(),_||E.current===`touch`||D.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&b,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!b;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},N=F(`div`,e,{ref:[O,t,d.ref,T],state:k,props:[p,M,l,ee]}),P=Y.useMemo(()=>({selected:b,index:w,textRef:u,selectedByFocus:S}),[b,w,u,S]);return(0,X.jsx)(At.Provider,{value:P,children:N})})),Nt=Y.forwardRef(function(e,t){let{selected:n}=jt();return e.keepMounted||n?(0,X.jsx)(Pt,{...e,ref:t}):null}),Pt=Y.memo(Y.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=jt(),c=Y.useRef(null),{transitionStatus:l,setMounted:u}=h(s),d=F(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:f});return _({batch:!0,enabled:!s,open:s,ref:c,onComplete(){s||u(!1)}}),d})),Ft=Y.memo(Y.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=jt(),a=Q(),{render:o,className:s,style:c,...l}=e,u=Y.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]);return F(`div`,e,{ref:[u,t,r],props:l})})),It=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...c}=e,l=a===`up`,u=Q(),{side:d,scrollDownArrowRef:p,scrollUpArrowRef:m}=pt(),g=l?`scrollUpArrowVisible`:`scrollDownArrowVisible`,v=u.useState(g),y=u.useState(`openMethod`),b=v&&y!==`touch`,S=s(),C=l?m:p,{mounted:w,transitionStatus:T,setMounted:E}=h(b);x(()=>(u.context.scrollArrowsMountedCountRef.current+=1,u.set(`hasScrollArrows`,!0),()=>{u.context.scrollArrowsMountedCountRef.current=Math.max(0,u.context.scrollArrowsMountedCountRef.current-1),u.context.scrollArrowsMountedCountRef.current===0&&u.set(`hasScrollArrows`,!1)}),[u]),_({open:b,ref:C,onComplete(){b||E(!1)}});let D=F(`div`,e,{ref:[t,C],state:{direction:a,visible:b,side:d,transitionStatus:T},props:[{"aria-hidden":!0,children:l?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||S.isStarted())return;u.set(`activeIndex`,null);function t(){let e=u.state.listElement??u.context.popupRef.current;if(!e)return;u.set(`activeIndex`,null),u.context.handleScrollArrowVisibility(e);let n=tt(e.scrollHeight,e.clientHeight),r=nt(e.scrollTop,n),i=r===(l?0:n),a=u.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i){S.clear();return}if(a.length>0){let t=C.current?.offsetHeight||0;e.scrollTop=Lt(a,l,r,e.clientHeight,t,n)}S.start(40,t)}S.start(40,t)},onMouseLeave(){S.clear()}},c],stateAttributesMapping:f});return w||o?D:null});function Lt(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?nt(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?nt(l.offsetTop+l.offsetHeight-r+i,a):a}var Rt=Y.forwardRef(function(e,t){return(0,X.jsx)(It,{...e,ref:t,direction:`down`})}),zt=Y.forwardRef(function(e,t){return(0,X.jsx)(It,{...e,ref:t,direction:`up`})}),Bt=rt;function Vt({className:e,...t}){return(0,X.jsx)(lt,{"data-slot":`select-value`,className:q(`flex flex-1 text-left`,e),...t})}function Ht({className:e,size:t=`default`,children:n,...r}){return(0,X.jsxs)(st,{"data-slot":`select-trigger`,"data-size":t,className:q(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-field py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *: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: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),...r,children:[n,(0,X.jsx)(ut,{render:(0,X.jsx)(se,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Ut({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,X.jsx)(dt,{children:(0,X.jsx)(gt,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,X.jsxs)(xt,{"data-slot":`select-content`,"data-align-trigger":o,className:q(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover 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-left-2 data-[side=inline-start]:slide-in-from-right-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`,e),...s,children:[(0,X.jsx)(Gt,{}),(0,X.jsx)(kt,{children:t}),(0,X.jsx)(Kt,{})]})})})}function Wt({className:e,children:t,...n}){return(0,X.jsxs)(Mt,{"data-slot":`select-item`,className:q(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm 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`,e),...n,children:[(0,X.jsx)(Ft,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,X.jsx)(Nt,{render:(0,X.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,X.jsx)(c,{className:`pointer-events-none`})})]})}function Gt({className:e,...t}){return(0,X.jsx)(zt,{"data-slot":`select-scroll-up-button`,className:q(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,X.jsx)(We,{})})}function Kt({className:e,...t}){return(0,X.jsx)(Rt,{"data-slot":`select-scroll-down-button`,className:q(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,X.jsx)(se,{})})}var qt=/("(?:[^"\\]|\\.)*")(\s*:)?|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(true|false|null)/g;function Jt(e){let t=[],n=0;for(let r of e.matchAll(qt)){r.index>n&&t.push({kind:`punctuation`,text:e.slice(n,r.index)});let[,i,a,o,s]=r;i===void 0?o===void 0?s!==void 0&&t.push({kind:`literal`,text:s}):t.push({kind:`number`,text:o}):(t.push({kind:a===void 0?`string`:`key`,text:i}),a!==void 0&&t.push({kind:`punctuation`,text:a})),n=r.index+r[0].length}return n<e.length&&t.push({kind:`punctuation`,text:e.slice(n)}),t}var Yt={key:`text-info-ink`,string:`text-good-ink`,number:`text-warning-ink`,literal:`text-warning-ink`,punctuation:`text-muted-foreground`};function Xt({title:e,text:t,className:n}){let i=(0,Y.useMemo)(()=>Jt(t),[t]);return(0,X.jsx)(ye,{name:e,className:`rounded-lg border border-border bg-background`,windowed:(0,X.jsx)(Ve,{value:t,mediaType:`application/json`,path:`window/${e}`,label:r.shell.in_window(e),readOnly:!0,className:`min-h-0 flex-1`}),children:(0,X.jsx)(`pre`,{className:q(`max-h-72 overflow-auto rounded-t-lg p-2 font-mono text-xs`,n),children:i.map((e,t)=>(0,X.jsx)(`span`,{className:Yt[e.kind],children:e.text},t))})})}export{Ht as a,Wt as i,Bt as n,Vt as o,Ut as r,Xt as t};
|