dirigent-server 0.18.0__tar.gz → 0.18.2__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.
Files changed (181) hide show
  1. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/PKG-INFO +5 -5
  2. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/pyproject.toml +5 -5
  3. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/pyproject.toml.orig +5 -5
  4. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/alerts.py +12 -10
  5. dirigent_server-0.18.2/src/dirigent_server/static/assets/Alerting-CcBb0wRa.js +1 -0
  6. dirigent_server-0.18.0/src/dirigent_server/static/assets/Blocks-CcA-SwCs.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Blocks-NviC0OXF.js +1 -1
  7. dirigent_server-0.18.2/src/dirigent_server/static/assets/Connections-BgdtNffu.js +1 -0
  8. dirigent_server-0.18.2/src/dirigent_server/static/assets/Dashboard-BN57Qzdj.js +1 -0
  9. dirigent_server-0.18.0/src/dirigent_server/static/assets/ExamplePanel-D3yktwnO.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/ExamplePanel-CRFoKDQb.js +1 -1
  10. dirigent_server-0.18.0/src/dirigent_server/static/assets/Examples-ag6cQ9RR.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Examples-m_jw_Dn6.js +2 -2
  11. dirigent_server-0.18.0/src/dirigent_server/static/assets/JsonBlock-DxbyAXYR.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/JsonBlock-CkieF-4k.js +1 -1
  12. dirigent_server-0.18.2/src/dirigent_server/static/assets/Mark-DQR2php6.js +1 -0
  13. dirigent_server-0.18.0/src/dirigent_server/static/assets/Overview-B80kW7iv.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Overview-Dhpg9hCZ.js +1 -1
  14. dirigent_server-0.18.2/src/dirigent_server/static/assets/Picker-9y5l9djZ.js +1 -0
  15. dirigent_server-0.18.2/src/dirigent_server/static/assets/PipelineEditor-C1-I6Bej.js +2 -0
  16. dirigent_server-0.18.0/src/dirigent_server/static/assets/PipelineGraph-Dz_0z78o.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/PipelineGraph-BuxdVBP6.js +1 -1
  17. dirigent_server-0.18.2/src/dirigent_server/static/assets/PipelinePreview-HADZRm5L.js +1 -0
  18. dirigent_server-0.18.0/src/dirigent_server/static/assets/PipelineTab-BepoiZgc.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/PipelineTab-Bhm8M_NG.js +2 -2
  19. dirigent_server-0.18.0/src/dirigent_server/static/assets/Refusal-DFh6LEQQ.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Refusal-uzV5VL19.js +1 -1
  20. dirigent_server-0.18.2/src/dirigent_server/static/assets/RunDetail-SL6w9BZ1.js +3 -0
  21. dirigent_server-0.18.0/src/dirigent_server/static/assets/RunGraph-BSylHYqX.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/RunGraph-Bj8VAXbe.js +1 -1
  22. dirigent_server-0.18.2/src/dirigent_server/static/assets/SchemaForm-C-Wc8YiX.js +1 -0
  23. dirigent_server-0.18.0/src/dirigent_server/static/assets/Schemas-BDfRA4q1.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Schemas-COYqGVZM.js +2 -2
  24. dirigent_server-0.18.2/src/dirigent_server/static/assets/Segmented-KaDiGiyr.js +1 -0
  25. dirigent_server-0.18.2/src/dirigent_server/static/assets/SettingsDialog-BDKhHaNj.js +1 -0
  26. dirigent_server-0.18.2/src/dirigent_server/static/assets/StarterPicker-Be7o1w9Q.js +1 -0
  27. dirigent_server-0.18.0/src/dirigent_server/static/assets/TileCard-gP1CtcIG.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/TileCard-CkZS_VSw.js +1 -1
  28. dirigent_server-0.18.0/src/dirigent_server/static/assets/Triggers-Can3egyv.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Triggers-CwtRten7.js +1 -1
  29. dirigent_server-0.18.0/src/dirigent_server/static/assets/Users-D2en-Umj.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Users-DL4AzW5v.js +1 -1
  30. dirigent_server-0.18.0/src/dirigent_server/static/assets/WindowedPane-DJe_7m8A.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/WindowedPane-CZpOBqK6.js +1 -1
  31. dirigent_server-0.18.0/src/dirigent_server/static/assets/Workers-BL1rSMN9.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/Workers-2_dwra03.js +1 -1
  32. dirigent_server-0.18.0/src/dirigent_server/static/assets/WorkersTable-CSwkoqDd.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/WorkersTable-CBWZYznS.js +1 -1
  33. dirigent_server-0.18.0/src/dirigent_server/static/assets/connections-BuMoMUFi.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/connections-DsdoSARb.js +1 -1
  34. dirigent_server-0.18.0/src/dirigent_server/static/assets/examples-vNFNdfIm.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/examples-DDWkSZ2u.js +1 -1
  35. dirigent_server-0.18.2/src/dirigent_server/static/assets/index-BDhFNSYw.css +2 -0
  36. dirigent_server-0.18.2/src/dirigent_server/static/assets/index-MYZXi-9R.js +53 -0
  37. dirigent_server-0.18.2/src/dirigent_server/static/assets/pipelines-Pi3WL8R6.js +1 -0
  38. dirigent_server-0.18.0/src/dirigent_server/static/assets/select-CH0-4odb.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/select-C9VBesB_.js +1 -1
  39. dirigent_server-0.18.0/src/dirigent_server/static/assets/triggers-B42obFCk.js → dirigent_server-0.18.2/src/dirigent_server/static/assets/triggers-BetQ4Leu.js +1 -1
  40. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/index.html +3 -3
  41. dirigent_server-0.18.0/src/dirigent_server/static/assets/Alerting-BVadHTDd.js +0 -1
  42. dirigent_server-0.18.0/src/dirigent_server/static/assets/Connections-DL-8wF-b.js +0 -1
  43. dirigent_server-0.18.0/src/dirigent_server/static/assets/Dashboard-B66W8OTk.js +0 -1
  44. dirigent_server-0.18.0/src/dirigent_server/static/assets/Picker-CY13BPS4.js +0 -1
  45. dirigent_server-0.18.0/src/dirigent_server/static/assets/PipelineEditor-CipvUPp0.js +0 -2
  46. dirigent_server-0.18.0/src/dirigent_server/static/assets/PipelinePreview-DNLVNGi8.js +0 -1
  47. dirigent_server-0.18.0/src/dirigent_server/static/assets/RunDetail-3uWgAAeF.js +0 -3
  48. dirigent_server-0.18.0/src/dirigent_server/static/assets/SchemaForm-D3RjadEM.js +0 -1
  49. dirigent_server-0.18.0/src/dirigent_server/static/assets/Segmented-u0lpCZgQ.js +0 -1
  50. dirigent_server-0.18.0/src/dirigent_server/static/assets/SettingsDialog-DhpjiaMQ.js +0 -1
  51. dirigent_server-0.18.0/src/dirigent_server/static/assets/StarterPicker-CkSY39C5.js +0 -1
  52. dirigent_server-0.18.0/src/dirigent_server/static/assets/index-Cf-yM9K1.css +0 -2
  53. dirigent_server-0.18.0/src/dirigent_server/static/assets/index-DBX30PmL.js +0 -53
  54. dirigent_server-0.18.0/src/dirigent_server/static/assets/pipelines-DaeuXRxg.js +0 -1
  55. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/LICENSE +0 -0
  56. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/README.md +0 -0
  57. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/THIRD_PARTY_NOTICES.md +0 -0
  58. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/__init__.py +0 -0
  59. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/app.py +0 -0
  60. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/dependencies.py +0 -0
  61. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/errors.py +0 -0
  62. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/health.py +0 -0
  63. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/logging.py +0 -0
  64. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/messages.py +0 -0
  65. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/pagination.py +0 -0
  66. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/py.typed +0 -0
  67. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/__init__.py +0 -0
  68. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/auth.py +0 -0
  69. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/blocks.py +0 -0
  70. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/connections.py +0 -0
  71. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/examples.py +0 -0
  72. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/hooks.py +0 -0
  73. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/pipelines.py +0 -0
  74. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/runs.py +0 -0
  75. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/schema.py +0 -0
  76. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/schemas.py +0 -0
  77. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/system.py +0 -0
  78. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/trigger_documents.py +0 -0
  79. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/triggers.py +0 -0
  80. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/users.py +0 -0
  81. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/routes/workers.py +0 -0
  82. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/security.py +0 -0
  83. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/.gitkeep +0 -0
  84. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/AdminOnly-922QAPCr.js +0 -0
  85. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/Breadcrumb-x6p00HyX.js +0 -0
  86. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/CodeEditor-0KFNLzta.js +0 -0
  87. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/CodeEditor-C4OnjBMt.css +0 -0
  88. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/Description-MmXUnb-9.js +0 -0
  89. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/Instant-mr1E5jAK.js +0 -0
  90. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/KindChip-CwU_Xxdy.js +0 -0
  91. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ListTable-BykeouTl.js +0 -0
  92. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/Markdown-roa7jpVu.js +0 -0
  93. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/PageState-CGVhOaOE.js +0 -0
  94. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/Panel-CqrOYByl.js +0 -0
  95. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ProgramReference-DF37mMAT.js +0 -0
  96. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/StepPorts-KFpmX5hF.js +0 -0
  97. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/api-Bm1JZLuC.js +0 -0
  98. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/auth-CHgfcdt9.js +0 -0
  99. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/badge-BovCxjd1.js +0 -0
  100. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/blocks-CclbVd8c.js +0 -0
  101. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/chevron-down-DAO3SUWv.js +0 -0
  102. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/chunk-OB3PAWPO-DOp4K52_.js +0 -0
  103. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/codicon-DCmgc-ay.ttf +0 -0
  104. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/copy-BeBwg8IR.js +0 -0
  105. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/dist-DD8kpv1W.js +0 -0
  106. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/docs-CCoB3shg.js +0 -0
  107. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/dropdown-menu-B-6CcHKw.js +0 -0
  108. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/editor.worker-CIvRzd4O.js +0 -0
  109. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/file-braces-Ep8AP5Yq.js +0 -0
  110. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/format-B5YbYOY-.js +0 -0
  111. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  112. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  113. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  114. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  115. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  116. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  117. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  118. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  119. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  120. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  121. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  122. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  123. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  124. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  125. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  126. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  127. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  128. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  129. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  130. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  131. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  132. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  133. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  134. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  135. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  136. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  137. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  138. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  139. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  140. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  141. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
  142. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
  143. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
  144. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  145. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  146. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
  147. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/identity-BNZxCf_y.js +0 -0
  148. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/input-1fShkFXn.js +0 -0
  149. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/json.worker-fczZDBja.js +0 -0
  150. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/jsonMode-tILOm4tQ.js +0 -0
  151. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/maximize-2-BdFIT4cn.js +0 -0
  152. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/nav-i7bJ0lrA.js +0 -0
  153. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/paging-CpRIkEky.js +0 -0
  154. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/play-CPVSEWx6.js +0 -0
  155. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/preferences-DsqSnjg9.js +0 -0
  156. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/preload-helper-BZ1Pz5am.js +0 -0
  157. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/react-CQOZoUwg.js +0 -0
  158. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/resolveAriaLabelledBy-ClHvyYLK.js +0 -0
  159. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/rolldown-runtime-Dd_uD5pT.js +0 -0
  160. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/schemas-7KY_7aIc.js +0 -0
  161. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/shell-CC2rA5mh.js +0 -0
  162. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/sql-NEE52Syq.js +0 -0
  163. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/starters-CgC7I45V.js +0 -0
  164. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/status-Ctx8x8Mf.js +0 -0
  165. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/store-C2zgoyrT.js +0 -0
  166. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/textarea-ljIbN_md.js +0 -0
  167. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/tooltip-D7_KwbOU.js +0 -0
  168. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/twig-De2hgUGE.js +0 -0
  169. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/use-heartbeat-CBT8848s.js +0 -0
  170. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/use-store-CfRquqZF.js +0 -0
  171. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/users-CTGHiHMA.js +0 -0
  172. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/utils-CT7ZGLfR.js +0 -0
  173. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/with-selector-BXYKoaOE.js +0 -0
  174. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/workers-BH2Za19E.js +0 -0
  175. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/x-Dltw6Vbs.js +0 -0
  176. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/yaml-DSCysg4a.js +0 -0
  177. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/assets/yaml.worker-B2SaT_wA.js +0 -0
  178. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/favicon-32.png +0 -0
  179. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/static/logo.png +0 -0
  180. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/src/dirigent_server/transactions.py +0 -0
  181. {dirigent_server-0.18.0 → dirigent_server-0.18.2}/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.18.0
3
+ Version: 0.18.2
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.18.0
11
- Requires-Dist: dirigent-common==0.18.0
12
- Requires-Dist: dirigent-core==0.18.0
13
- Requires-Dist: dirigent-examples==0.18.0
10
+ Requires-Dist: dirigent-client==0.18.2
11
+ Requires-Dist: dirigent-common==0.18.2
12
+ Requires-Dist: dirigent-core==0.18.2
13
+ Requires-Dist: dirigent-examples==0.18.2
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.18.0"
3
+ version = "0.18.2"
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.0",
18
- "dirigent-common==0.18.0",
19
- "dirigent-core==0.18.0",
20
- "dirigent-examples==0.18.0",
17
+ "dirigent-client==0.18.2",
18
+ "dirigent-common==0.18.2",
19
+ "dirigent-core==0.18.2",
20
+ "dirigent-examples==0.18.2",
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.18.0"
3
+ version = "0.18.2"
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.18.0",
15
- "dirigent-common==0.18.0",
16
- "dirigent-core==0.18.0",
17
- "dirigent-examples==0.18.0",
14
+ "dirigent-client==0.18.2",
15
+ "dirigent-common==0.18.2",
16
+ "dirigent-core==0.18.2",
17
+ "dirigent-examples==0.18.2",
18
18
  "fastapi>=0.141.1",
19
19
  ]
20
20
 
@@ -50,6 +50,7 @@ def render(rule: AlertRule, pipeline: str | None, connection: str | None = None)
50
50
  event=rule.event,
51
51
  scope=rule.scope,
52
52
  pipeline=pipeline,
53
+ importance=rule.importance,
53
54
  notifier=rule.notifier,
54
55
  connection=connection,
55
56
  template=rule.template,
@@ -94,7 +95,7 @@ async def rules(
94
95
  async def add_rule(
95
96
  payload: AlertRuleIn, session: SessionDep, services: ServicesDep, principal: OperatorDep
96
97
  ) -> AlertRuleOut:
97
- """Declare an alert rule, refusing a notifier or a pipeline this instance does not have."""
98
+ """Declare an alert rule, refusing a target or a pipeline this instance does not have."""
98
99
  rule = await create_rule(
99
100
  session,
100
101
  services,
@@ -103,9 +104,9 @@ async def add_rule(
103
104
  name=payload.name,
104
105
  description=payload.description,
105
106
  event=payload.event,
106
- notifier=payload.notifier,
107
107
  scope=payload.scope,
108
108
  pipeline=payload.pipeline,
109
+ importance=payload.importance,
109
110
  connection=payload.connection,
110
111
  template=payload.template,
111
112
  body=payload.body,
@@ -121,15 +122,17 @@ async def add_rule(
121
122
  summary="Change an alert rule",
122
123
  response_model=AlertRuleOut,
123
124
  )
124
- async def change_rule(code: str, payload: AlertRuleUpdate, session: SessionDep, principal: OperatorDep) -> AlertRuleOut:
125
- """Hold a rule's deliveries, let them resume, or rewrite what it says.
125
+ async def change_rule(
126
+ code: str, payload: AlertRuleUpdate, session: SessionDep, services: ServicesDep, principal: OperatorDep
127
+ ) -> AlertRuleOut:
128
+ """Hold a rule's deliveries, let them resume, rewrite what it says, or re-point it.
126
129
 
127
130
  Pausing is instance state on the row rather than something the rule declares, so a rule an
128
131
  operator held keeps holding when the document that declared it is applied again. A field
129
132
  the caller left out is left as it was.
130
133
  """
131
134
  rule = await _rule_or_404(session, code)
132
- await update_rule(session, rule, payload.model_dump(exclude_unset=True))
135
+ await update_rule(session, services, rule, payload.model_dump(exclude_unset=True))
133
136
  return render(rule, await _pipeline_code(session, rule), await _connection_code(session, rule.connection_id))
134
137
 
135
138
 
@@ -147,19 +150,18 @@ async def remove_rule(code: str, session: SessionDep, principal: OperatorDep) ->
147
150
 
148
151
  @router.post(
149
152
  "/alert-rules/$test",
150
- operation_id="testNotifier",
151
- summary="Send a test message through a notifier",
153
+ operation_id="sendTest",
154
+ summary="Send a test message through a target",
152
155
  response_model=TestQueued,
153
156
  status_code=status.HTTP_202_ACCEPTED,
154
157
  )
155
- async def test_notifier(
158
+ async def send_test(
156
159
  payload: TestRequest, session: SessionDep, services: ServicesDep, principal: OperatorDep
157
160
  ) -> TestQueued:
158
- """Queue one message through a channel, on the same path a real alert takes."""
161
+ """Queue one message through the target a rule would name, on the path a real alert takes."""
159
162
  notification = await queue_test_message(
160
163
  session,
161
164
  services,
162
- notifier=payload.notifier,
163
165
  connection=payload.connection,
164
166
  subject=payload.subject,
165
167
  body=payload.body,
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{r as n}from"./with-selector-BXYKoaOE.js";import{n as r}from"./chunk-OB3PAWPO-DOp4K52_.js";import{i,r as a}from"./api-Bm1JZLuC.js";import{N as o}from"./dropdown-menu-B-6CcHKw.js";import{c as s,n as c,o as l,t as u}from"./PageState-CGVhOaOE.js";import{r as d,t as f}from"./ListTable-BykeouTl.js";import{r as p,t as m}from"./utils-CT7ZGLfR.js";import{i as h,n as g,t as _}from"./tooltip-D7_KwbOU.js";import{d as v,f as y}from"./paging-CpRIkEky.js";import{t as b}from"./input-1fShkFXn.js";import{l as x}from"./format-B5YbYOY-.js";import{t as S}from"./identity-BNZxCf_y.js";import{r as C,t as w,u as T}from"./pipelines-Pi3WL8R6.js";import{$ as E,At as D,E as O,It as k,Mt as A,Nt as j,Ot as ee,Pt as te,S as M,b as ne,et as re,g as N,it as P,jt as ie,kt as ae,mt as F,ot as I,pt as oe,st as L,ut as R,v as se,y as z}from"./index-MYZXi-9R.js";import{t as ce}from"./Description-MmXUnb-9.js";import{t as le}from"./WindowedPane-CZpOBqK6.js";import{c as ue,f as de,n as fe,o as pe}from"./connections-DsdoSARb.js";import{n as B,t as V}from"./Refusal-uzV5VL19.js";import{t as H}from"./Instant-mr1E5jAK.js";import{t as me}from"./Segmented-KaDiGiyr.js";import{t as he}from"./Mark-DQR2php6.js";import{t as ge}from"./ProgramReference-DF37mMAT.js";import{t as _e}from"./Picker-9y5l9djZ.js";import{t as ve}from"./AdminOnly-922QAPCr.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),U=e(t(),1),Ce=[`run_failed`,`run_completed_with_errors`,`run_succeeded`,`run_stuck`],W={run_failed:`Failed`,run_completed_with_errors:`Completed with errors`,run_succeeded:`Succeeded`,run_stuck:`Stuck`},we=[`pending`,`sending`,`sent`,`failed`],Te=`0s`;function Ee(e){return e===Te?`none`:e}function De(e){return e.scope===`pipeline`&&e.pipeline!==null?e.pipeline:`every pipeline`}function Oe(e){return e===null?null:`${e} and above`}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 a(je(e))}function Ne(e){return i(`/alert-rules`,`POST`,e)}function Pe(e,t){return i(`/alert-rules/${encodeURIComponent(e)}`,`PATCH`,t)}function Fe(e,t){return Pe(e,{paused:t})}function Ie(e){return a(`/alert-rules/${encodeURIComponent(e)}`,{method:`DELETE`})}var Le={status:``,notifier:``};function Re(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 ze(e,t){return a(Re(e,t))}function Be(e){return a(`/notifications/${encodeURIComponent(e)}`)}function Ve(e){return i(`/notifications/${encodeURIComponent(e)}/$retry`,`POST`,{})}function He(e){return i(`/alert-rules/$test`,`POST`,e)}async function Ue(){return(await a(`/blocks`)).notifiers.map(e=>e.id)}function We(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 Je(n)}function Ge(e){return e.connection??e.notifier}function Ke(e){return e.connection===null?e.notifier===`log`?null:ue(e.notifier):fe(e.connection)}function G(e){if(e.notifier===`log`)return{tone:`good`,label:`ready`,detail:null};if(!e.reachable)return{tone:`quiet`,label:`not set up`,detail:null};let t=pe(e);return{tone:t.tone??`quiet`,label:t.label,detail:t.detail}}var qe={good:0,critical:1,quiet:2};function Je(e){return e.toSorted((e,t)=>{let n=qe[G(e).tone]-qe[G(t).tone];if(n!==0)return n;let r=e.notifier.localeCompare(t.notifier);return r===0?(e.connection??``).localeCompare(t.connection??``):r})}var Ye=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/u,Xe=/^(?:\d+(?:ms|s|m|h|d|w))+$/u,Ze=`A Jinja template: {{ run.* }} reads the run's pipeline, status, id, error, trigger, duration_ms and url.`,Qe=`A Jinja template over the run's facts; report is the run's report document when it has one.`,K=`text/x-jinja`;function q(e){let t=e.trim();return t===``?null:t}var $e=[{value:`global`,label:`Every pipeline`},{value:`pipeline`,label:`One pipeline`}],et=[{value:``,label:`Any`},...w.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))];function tt(e){return e===``?null:e}function nt(e){return e===``?null:e}var rt=`The process log`;function it(e,t){let n=t.filter(t=>t.kind!==`log`&&e.includes(t.kind)).map(e=>({row:e,heading:S(e)})).toSorted((e,t)=>e.row.kind.localeCompare(t.row.kind)||e.heading.title.localeCompare(t.heading.title));return[{value:``,label:rt,aside:``,mark:F(`log`)},...n.map(({row:e,heading:t})=>({value:e.code,label:`${t.title} · ${e.kind}`,aside:t.code??``,mark:F(e.kind)}))]}function at(e){if(e.code.trim()===``)return`A rule is addressed by its code, and this one has none.`;if(!Ye.test(e.code.trim()))return`A code is lowercase words joined by - or _.`;if(e.scope===`pipeline`&&e.pipeline===``)return`A rule watching one pipeline names that pipeline, and this one names none.`;if(!Xe.test(e.throttle.trim()))return`A throttle is a duration, such as 15m.`}var J=p();function ot({rule:e,onChanged:t,onDeleted:n,onTest:r}){let[i,a]=(0,U.useState)(!1),[o,s]=(0,U.useState)(null),c=o===e.code,u=z(),d=Oe(e.importance),f=(0,U.useCallback)(e=>ze(Le,e),[]),{state:p}=se(f,lt),m=p.rows.filter(t=>t.rule===e.code);return(0,J.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,J.jsxs)(mt,{thing:e,children:[e.paused&&(0,J.jsx)(pt,{children:`paused`}),!e.active&&(0,J.jsx)(pt,{children:`off`})]}),(0,J.jsx)(ce,{text:e.description}),(0,J.jsxs)(`dl`,{className:`space-y-1.5`,children:[(0,J.jsx)(Y,{label:`Event`,children:W[e.event]}),(0,J.jsx)(Y,{label:`Scope`,children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[De(e),d!==null&&(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d})]})}),(0,J.jsx)(Y,{label:`Delivers through`,children:(0,J.jsx)(ut,{notifier:e.notifier,connection:e.connection})}),(0,J.jsx)(Y,{label:`Throttle`,children:Ee(e.throttle)}),c?(0,J.jsx)(st,{rule:e,onDone:()=>{s(null)},onSaved:e=>{t(e),s(null)}},e.code):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Y,{label:`Subject`,children:(0,J.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-2`,children:[e.template===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`none`}):(0,J.jsx)(`span`,{className:`font-mono text-xs break-all`,children:e.template}),(0,J.jsx)(l,{why:u.why,children:(0,J.jsx)(y,{variant:`ghost`,size:`xs`,disabled:!u.may,title:u.why,onClick:()=>{s(e.code)},children:`Edit`})})]})}),e.body!==null&&(0,J.jsx)(Y,{label:`Body`,children:(0,J.jsx)(`span`,{className:`line-clamp-3 font-mono text-xs break-words whitespace-pre-wrap`,children:e.body})})]}),(0,J.jsx)(Y,{label:`Last sent`,children:e.last_sent_at===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`never`}):(0,J.jsx)(H,{at:e.last_sent_at})})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsx)(l,{why:u.why,children:(0,J.jsx)(y,{variant:`outline`,size:`sm`,disabled:i||!u.may,title:u.why,onClick:()=>{a(!0),Fe(e.code,!e.paused).then(t,B).finally(()=>{a(!1)})},children:e.paused?`Resume`:`Pause`})}),(0,J.jsx)(l,{why:u.why,children:(0,J.jsx)(y,{variant:`outline`,size:`sm`,disabled:!u.may,title:u.why,onClick:r,children:`Send a test`})}),(0,J.jsx)(l,{why:u.why,children:(0,J.jsx)(y,{variant:`outline`,size:`sm`,className:`destructive-action ml-auto`,disabled:i||!u.may,title:u.why,onClick:()=>{a(!0),Ie(e.code).then(n,B).finally(()=>{a(!1)})},children:`Delete`})})]}),(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent deliveries`}),!p.read&&(0,J.jsx)(`p`,{className:`text-xs text-faint`,children:`Reading from the server`}),p.read&&m.length===0&&(0,J.jsx)(`p`,{className:`text-xs text-faint`,children:`Nothing sent.`}),(0,J.jsx)(`ul`,{className:`divide-y divide-border`,children:m.map(e=>(0,J.jsxs)(`li`,{className:`row-hover -mx-4 flex items-center gap-2 px-4 py-2`,children:[(0,J.jsx)(M,{status:e.status}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:e.subject}),(0,J.jsx)(H,{className:`shrink-0 text-xs text-faint`,at:e.created_at})]},e.id))})]})]})}function st({rule:e,onDone:t,onSaved:n}){let[r,i]=(0,U.useState)(e.template??``),[a,o]=(0,U.useState)(e.body??``),[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)(!1),d=`alert-rule/${e.code}/body`,f=`rule-${e.code}-subject`;return(0,J.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-secondary/30 p-3`,children:[(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{htmlFor:f,children:`Subject`}),(0,J.jsx)(b,{id:f,className:`font-mono`,spellCheck:!1,autoComplete:`off`,value:r,placeholder:`{{ run.pipeline }} run {{ run.status }}`,onChange:e=>{i(e.target.value)}}),(0,J.jsx)(`p`,{className:`text-xs text-faint`,children:Ze})]}),(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{children:`Body`}),(0,J.jsx)(`p`,{className:`text-xs text-faint`,children:Qe}),(0,J.jsx)(le,{name:`body`,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,J.jsx)(ge,{mediaType:K}),windowed:(0,J.jsx)(P,{value:a,mediaType:K,path:d,label:`body, in a window`,className:`min-h-0 flex-1`,onChange:o}),children:(0,J.jsx)(P,{value:a,mediaType:K,path:d,label:`body`,placeholder:`{{ run.pipeline }} ended {{ run.status }}: {{ run.url }}`,className:`h-40 min-h-32`,onChange:o})})]}),s!==null&&(0,J.jsx)(V,{problem:s}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,J.jsx)(y,{variant:`ghost`,size:`sm`,onClick:t,children:`Cancel`}),(0,J.jsx)(y,{size:`sm`,disabled:l,onClick:()=>{let i={};if(q(r)!==e.template&&(i.template=q(r)),q(a)!==e.body&&(i.body=q(a)),Object.keys(i).length===0){t();return}u(!0),c(null),Pe(e.code,i).then(n,e=>{c(v(e))}).finally(()=>{u(!1)})},children:l?`Saving`:`Save`})]})]})}function ct({notification:e,onChanged:t}){let[n,i]=(0,U.useState)(!1),a=z();return(0,J.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,J.jsx)(`div`,{className:`space-y-1`,children:(0,J.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(M,{status:e.status}),(0,J.jsx)(`span`,{className:`text-sm font-semibold`,children:e.subject})]})}),(0,J.jsxs)(`dl`,{className:`space-y-1.5`,children:[e.rule===null?(0,J.jsx)(Y,{label:`Raised by`,children:(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`a test, not a rule`})}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Y,{label:`Event`,children:W[e.event]}),(0,J.jsx)(Y,{label:`Rule`,children:(0,J.jsx)(`span`,{className:`font-mono text-xs`,children:e.rule})})]}),(0,J.jsx)(Y,{label:`Delivers through`,children:(0,J.jsx)(dt,{notifier:e.notifier,connection:e.connection})}),(0,J.jsx)(Y,{label:`Run`,children:(0,J.jsx)(ft,{notification:e})}),(0,J.jsx)(Y,{label:`Queued`,children:(0,J.jsx)(H,{at:e.created_at})}),e.status===`sent`?(0,J.jsx)(Y,{label:`Sent`,children:(0,J.jsx)(H,{at:e.sent_at})}):(0,J.jsx)(Y,{label:`Next try`,children:(0,J.jsx)(H,{at:e.available_at})}),(0,J.jsxs)(Y,{label:`Attempts`,children:[e.attempt,` of `,e.max_attempts]})]}),e.error!==null&&(0,J.jsxs)(`div`,{className:`space-y-1`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`What the channel said`}),(0,J.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error}),(0,J.jsx)(`p`,{className:`text-xs text-faint`,children:`Only the latest refusal is kept. Earlier attempts are counted, not stored.`})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsx)(l,{why:a.why,children:(0,J.jsx)(y,{variant:`outline`,size:`sm`,disabled:n||!a.may,title:a.why,onClick:()=>{i(!0),Ve(e.id).then(t,B).finally(()=>{i(!1)})},children:`Retry now`})}),e.run_id!==null&&(0,J.jsx)(y,{variant:`outline`,size:`sm`,render:(0,J.jsx)(r,{to:`/runs/${e.run_id}`}),children:`Open the run`})]})]})}var lt=e=>e.id;function ut({notifier:e,connection:t}){return(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(he,{glyph:F(e)}),(0,J.jsx)(`span`,{className:t===null?`text-sm`:`font-mono text-xs`,children:t??e})]})}function dt({notifier:e,connection:t}){return(0,J.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:`text-sm`,children:e}),t!==null&&(0,J.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t})]})}function ft({notification:e}){if(e.run_id===null)return(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`no run`});let t=e.run_pipeline??`a run`;return(0,J.jsxs)(r,{className:`text-primary hover:underline`,to:`/runs/${e.run_id}`,children:[(0,J.jsx)(`span`,{className:`text-sm`,children:t}),e.run_started_at!==null&&(0,J.jsx)(H,{className:`ml-1.5 text-xs text-muted-foreground`,at:e.run_started_at})]})}function pt({children:e}){return(0,J.jsx)(`span`,{className:`rounded-sm border border-border px-1.5 text-xs text-muted-foreground`,children:e})}function mt({thing:e,children:t}){let n=S(e);return(0,J.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(`span`,{className:n.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:n.title}),t,n.code!==null&&(0,J.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:n.code})]})}function Y({label:e,children:t}){return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsx)(`dt`,{className:`w-32 shrink-0 text-xs text-muted-foreground`,children:e}),(0,J.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}var ht={good:`var(--good)`,critical:`var(--critical)`,quiet:`var(--faint)`},gt=`flex min-h-9 items-center gap-2 rounded-full border border-border bg-card py-1 pr-3 pl-2.5 transition-colors`,X=`hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`;function _t({channels:e,read:t}){let n=s(),r=vt(e.length,t);return n?(0,J.jsx)(xt,{channels:e,note:r}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Channels`}),r===null?(0,J.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,J.jsx)(`li`,{className:`flex`,children:(0,J.jsx)(yt,{channel:e})},e.id))}):(0,J.jsx)(`p`,{className:r.tone,children:r.text})]})}function vt(e,t){return t?e===0?{text:`No channel is installed.`,tone:`text-sm text-muted-foreground`}:null:{text:`Reading from the server`,tone:`text-sm text-faint`}}function yt({channel:e}){let t=G(e),n=Ke(e),i=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(he,{glyph:F(e.notifier)}),(0,J.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ge(e)}),(0,J.jsx)(Ct,{tone:t.tone})]}),a=n===null?(0,J.jsx)(`button`,{type:`button`,className:m(gt,X),children:i}):(0,J.jsx)(r,{to:n,className:m(gt,X),children:i});return(0,J.jsxs)(_,{children:[(0,J.jsx)(h,{render:a}),(0,J.jsx)(g,{className:`flex-col items-start gap-1`,side:`bottom`,children:(0,J.jsx)(bt,{channel:e,view:t})})]})}function bt({channel:e,view:t}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`span`,{className:`font-medium`,children:[e.notifier,` · `,t.label,e.last_check_at!==null&&(0,J.jsxs)(`span`,{className:`font-normal opacity-70`,children:[` `,x(e.last_check_at)]})]}),e.connection!==null&&(0,J.jsx)(`span`,{className:`font-mono`,children:e.connection}),t.detail!==null&&(0,J.jsx)(`span`,{className:`opacity-70`,children:t.detail})]})}function xt({channels:e,note:t}){let[n,r]=(0,U.useState)(!1);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{r(!n)},className:m(`flex min-h-finger w-full items-center gap-2.5 border-b border-border px-1 text-left`,X),children:[(0,J.jsx)(o,{className:m(`size-4 shrink-0 text-muted-foreground`,n&&`rotate-90`),"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`text-sm font-semibold`,children:`Channels`}),(0,J.jsx)(`span`,{className:`ml-auto flex items-center gap-1.5`,"aria-hidden":!0,children:e.map(e=>(0,J.jsx)(Ct,{tone:G(e).tone},e.id))})]}),n&&(t===null?(0,J.jsx)(`table`,{className:`w-full text-sm`,children:(0,J.jsx)(`tbody`,{children:e.map(e=>(0,J.jsx)(St,{channel:e},e.id))})}):(0,J.jsx)(`p`,{className:t.tone,children:t.text}))]})}function St({channel:e}){let t=G(e),n=Ke(e),i=(0,J.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,J.jsx)(he,{glyph:F(e.notifier)}),(0,J.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ge(e)})]});return(0,J.jsxs)(`tr`,{className:`border-b border-border last:border-b-0`,children:[(0,J.jsx)(`td`,{className:`w-0 py-2 pr-2 align-middle`,children:(0,J.jsx)(Ct,{tone:t.tone})}),(0,J.jsx)(`td`,{className:`min-w-0 py-2 align-middle`,children:e.connection===null||n===null?i:(0,J.jsx)(r,{to:n,className:m(`control-link flex items-center rounded-md px-1`,X),children:i})}),(0,J.jsx)(`td`,{className:`w-0 py-2 pl-2 text-right align-middle whitespace-nowrap`,children:t.label===`not set up`&&n!==null?(0,J.jsxs)(r,{to:n,className:m(`control-link inline-flex items-center rounded-md text-xs text-primary-ink`,X),children:[`Set up `,e.notifier]}):e.last_check_at!==null&&(0,J.jsx)(`span`,{className:`text-xs text-faint`,children:x(e.last_check_at)})})]})}function Ct({tone:e}){return(0,J.jsx)(`span`,{className:`status-dot`,style:{"--chip":ht[e]}})}function Z({id:e,label:t,value:n,onChange:r,placeholder:i,mono:a,hint:o}){return(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{htmlFor:e,children:t}),(0,J.jsx)(b,{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,J.jsx)(`p`,{className:`text-xs text-faint`,children:o})]})}function wt({id:e,options:t,value:n,onChange:r}){return(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{htmlFor:e,children:`Deliver through`}),(0,J.jsx)(_e,{id:e,label:`Deliver through`,value:n,options:t,placeholder:`Search the channels this instance has`,onChange:r})]})}var Tt=`0s`,Et=`alert-rule/new/body`,Q=`body`;function Dt({open:e,onOpenChange:t,notifiers:n,connections:r,onCreated:i}){let[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(``),[u,d]=(0,U.useState)(``),[f,p]=(0,U.useState)(`run_failed`),[m,h]=(0,U.useState)(`global`),[g,_]=(0,U.useState)(``),[b,x]=(0,U.useState)(``),[S,C]=(0,U.useState)(``),[w,T]=(0,U.useState)(``),[E,k]=(0,U.useState)(``),[M,re]=(0,U.useState)(Tt),[N,ie]=(0,U.useState)(null),[F,I]=(0,U.useState)(!1),oe=Ot(e),L=z(),R=ne(L.why,at({code:a,scope:m,pipeline:g,throttle:M}));return(0,J.jsx)(ee,{open:e,onOpenChange:t,children:(0,J.jsxs)(D,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-3xl`,showCloseButton:!1,children:[(0,J.jsx)(j,{children:(0,J.jsx)(te,{children:`New rule`})}),(0,J.jsxs)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsx)(Z,{id:`rule-code`,label:`Code`,value:a,onChange:o,placeholder:`ops-slack-failed`,mono:!0}),(0,J.jsx)(Z,{id:`rule-name`,label:`Name`,value:s,onChange:c,placeholder:`Tell the ops channel`})]}),(0,J.jsx)(Z,{id:`rule-description`,label:`Description`,value:u,onChange:d,placeholder:`What this rule is for`}),(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{children:`Event`}),(0,J.jsx)(me,{label:`Event`,size:`md`,value:f,options:Ce.map(e=>({value:e,label:W[e]})),onChoose:p})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{children:`Scope`}),(0,J.jsx)(me,{label:`Scope`,size:`md`,value:m,options:$e,onChoose:h})]}),m===`pipeline`&&(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{htmlFor:`rule-pipeline`,children:`Pipeline`}),(0,J.jsx)(_e,{id:`rule-pipeline`,label:`Pipeline`,value:g,options:oe,placeholder:`Search by name or code`,onChange:_})]})]}),(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{children:`Importance`}),(0,J.jsx)(`p`,{className:`text-xs text-faint`,children:`Only pipelines that matter at least this much.`}),(0,J.jsx)(me,{label:`Importance`,size:`md`,value:b,options:et,onChoose:x})]}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,J.jsx)(wt,{id:`rule-connection`,options:it(n,r),value:S,onChange:C})}),(0,J.jsx)(Z,{id:`rule-subject`,label:`Subject`,value:w,onChange:T,placeholder:`{{ run.pipeline }} run {{ run.status }}`,mono:!0,hint:Ze}),(0,J.jsxs)(`div`,{className:`space-y-2`,children:[(0,J.jsx)(O,{children:`Body`}),(0,J.jsx)(`p`,{className:`text-xs text-faint`,children:Qe}),(0,J.jsx)(le,{name:Q,className:`overflow-hidden rounded-md border border-border`,aside:(0,J.jsx)(ge,{mediaType:K}),windowed:(0,J.jsx)(P,{value:E,mediaType:K,path:Et,label:`${Q}, in a window`,className:`min-h-0 flex-1`,onChange:k}),children:(0,J.jsx)(P,{value:E,mediaType:K,path:Et,label:Q,placeholder:`{{ run.pipeline }} ended {{ run.status }}: {{ run.url }}`,className:`h-40 min-h-32`,onChange:k})})]}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,J.jsx)(Z,{id:`rule-throttle`,label:`Throttle`,value:M,onChange:re,placeholder:`15m`,mono:!0})})]}),N!==null&&(0,J.jsx)(V,{problem:N}),(0,J.jsxs)(A,{children:[(0,J.jsx)(`p`,{className:`mr-auto self-center text-xs text-muted-foreground`,children:`A rule fires when a run settles. Nothing is sent now.`}),(0,J.jsx)(ae,{render:(0,J.jsx)(y,{variant:`ghost`}),children:`Close`}),(0,J.jsx)(l,{why:R,children:(0,J.jsx)(y,{disabled:F||R!==void 0,title:R,onClick:()=>{I(!0),ie(null),Ne({code:a.trim(),name:q(s),description:q(u),event:f,scope:m,pipeline:m===`pipeline`?g:null,importance:tt(b),connection:nt(S),template:q(w),body:q(E),throttle:M.trim()}).then(()=>{i(),o(``),c(``),d(``),T(``),k(``),t(!1)},e=>{ie(v(e))}).finally(()=>{I(!1)})},children:F?`Creating`:`Create`})})]})]})})}function Ot(e){let[t,n]=(0,U.useState)([]);return(0,U.useEffect)(()=>{if(!e)return;let t=!0;return T().then(e=>{t&&n(e.toSorted(C).map(e=>{let t=S(e);return{value:e.code,label:t.title,aside:t.code??``}}))},()=>{t&&n([])}),()=>{t=!1}},[e]),t}var kt=1e3,At=6e4,jt=`dirigent test alert`,Mt={connection:``,subject:``};function Nt({open:e,draft:t,onOpenChange:n,notifiers:r,connections:i,onQueued:a,onOpenQueue:o}){let[s,c]=(0,U.useState)(t.connection),[u,d]=(0,U.useState)(t.subject),[f,p]=(0,U.useState)(null),[m,h]=(0,U.useState)(null),[g,_]=(0,U.useState)(!1),b=Ft(f),x=z(),S=b!==null&&Ae(b.status)?b.id:null;(0,U.useEffect)(()=>{S!==null&&a()},[S]);let C=x.why;return(0,J.jsx)(ee,{open:e,onOpenChange:n,children:(0,J.jsxs)(D,{className:`sm:max-w-lg`,showCloseButton:!1,children:[(0,J.jsxs)(j,{children:[(0,J.jsx)(te,{children:`Send a test`}),(0,J.jsx)(ie,{children:`The message goes through the same queue a real alert does, and a worker delivers it.`})]}),(0,J.jsx)(wt,{id:`test-connection`,options:it(r,i),value:s,onChange:c}),(0,J.jsx)(Z,{id:`test-subject`,label:`Subject`,value:u,onChange:d,placeholder:jt}),m!==null&&(0,J.jsx)(V,{problem:m}),b!==null&&(0,J.jsx)(Pt,{row:b}),(0,J.jsxs)(A,{children:[(0,J.jsx)(ae,{render:(0,J.jsx)(y,{variant:`ghost`}),children:`Close`}),f!==null&&(0,J.jsx)(y,{variant:`outline`,onClick:()=>{o(f)},children:`Open in the queue`}),(0,J.jsx)(l,{why:C,children:(0,J.jsx)(y,{disabled:g||C!==void 0,title:C,onClick:()=>{_(!0),h(null),p(null),He({connection:nt(s),...u.trim()===``?{}:{subject:u.trim()}}).then(e=>{p(e.notification_id),a()},e=>{h(v(e))}).finally(()=>{_(!1)})},children:f===null?`Send`:`Send again`})})]})]})})}function Pt({row:e}){return(0,J.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,J.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsx)(M,{status:e.status}),(0,J.jsx)(`span`,{className:`text-sm`,children:e.subject})]}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.status===`sent`?(0,J.jsxs)(J.Fragment,{children:[`Delivered `,(0,J.jsx)(H,{at:e.sent_at}),`.`]}):e.status===`failed`?(0,J.jsxs)(J.Fragment,{children:[`Given up after `,e.attempt,` of `,e.max_attempts,` attempts.`]}):e.attempt===0?`Queued for the next worker pass.`:(0,J.jsxs)(J.Fragment,{children:[`Attempt `,e.attempt,` of `,e.max_attempts,`, next try`,` `,(0,J.jsx)(H,{at:e.available_at}),`.`]})}),e.error!==null&&(0,J.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error})]})}function Ft(e){let[t,n]=(0,U.useState)(null);return(0,U.useEffect)(()=>{if(e===null)return;let t=!0,r,i=Date.now()+At,a=()=>{Be(e).then(o=>{t&&(n({id:e,row:o}),!(Ae(o.status)||Date.now()>i)&&(r=setTimeout(a,kt)))},()=>{})};return a(),()=>{t=!1,r!==void 0&&clearTimeout(r)}},[e]),t!==null&&t.id===e?t.row:null}var It=e=>e.id,Lt=e=>e.id;function Rt(){return(0,J.jsx)(ve,{children:(0,J.jsx)(zt,{})})}function zt(){let[e,t]=(0,U.useState)(!1),[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(null),[l,p]=(0,U.useState)({status:``,notifier:``}),[m,h]=(0,U.useState)({}),[g,_]=(0,U.useState)({}),v=se((0,U.useCallback)(e=>Me(e),[]),It),y=se((0,U.useCallback)(e=>ze(l,e),[l]),Lt),b=Vt(),{reload:x}=v,{reload:S}=y,C=(0,U.useMemo)(()=>v.state.rows.map(e=>m[e.id]??e),[m,v.state.rows]),w=(0,U.useMemo)(()=>y.state.rows.map(e=>g[e.id]??e),[g,y.state.rows]),T=C.find(e=>e.id===i)??null,D=w.find(e=>e.id===o)??null,O=(0,U.useCallback)(e=>{r(t=>({draft:e,opened:(t?.opened??0)+1}))},[]);(0,U.useEffect)(()=>(re({note:null,tone:`quiet`,identifier:null}),E),[]),(0,U.useEffect)(()=>{if(T!==null){let e=T;return I([{id:`rule`,label:`Rule`,render:()=>(0,J.jsx)(ot,{rule:e,onChanged:e=>{h(t=>({...t,[e.id]:e}))},onDeleted:()=>{a(null),x()},onTest:()=>{O({connection:e.connection??``,subject:``})}})}],{screen:`alerting`})}if(D!==null){let e=D;return I([{id:`notification`,label:`Notification`,render:()=>(0,J.jsx)(ct,{notification:e,onChanged:e=>{_(t=>({...t,[e.id]:e}))}})}],{screen:`alerting`})}},[D,T,O,x]);let A=z(`admin`),j=A.may;return(0,U.useEffect)(()=>oe([...j?[{id:`alerting:rule`,title:`New alert rule`,group:R,screen:!0,icon:be,keywords:[`alert`,`event`,`create`],run:()=>{t(!0)}},{id:`alerting:test`,title:`Send a test through a channel`,group:R,screen:!0,icon:Se,keywords:[`alert`,`notification`,`try`],run:()=>{O(Mt)}}]:[],{id:`alerting:reload`,title:`Read the alert rules again`,group:R,screen:!0,icon:k,keywords:[`refresh`,`reload`],run:()=>{x(),S()}}]),[j,O,S,x]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u,{title:`Alerting`,aside:(0,J.jsx)(d,{tag:`alerts`}),actions:[{id:`test`,label:`Send a test`,icon:Se,variant:`outline`,disabled:!A.may,why:A.why,onClick:()=>{O(Mt)}},{id:`rule`,label:`New rule`,icon:be,disabled:!A.may,why:A.why,onClick:()=>{t(!0)}}]}),(0,J.jsx)(`section`,{className:`mb-6 space-y-2`,children:(0,J.jsx)(_t,{channels:b.rows,read:b.read})}),(0,J.jsxs)(`section`,{className:`space-y-2`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Rules`}),(0,J.jsx)(c,{loading:!v.state.read,problem:v.state.problem,empty:C.length===0,emptyMessage:`No rules.`,children:(0,J.jsx)(f,{columns:Ut,rows:C,rowKey:It,rowClassName:e=>ke(e)?void 0:`opacity-60`,reading:v.state.reading,next:v.state.next,onMore:v.more,noun:`rules`,onSelect:e=>{s(null),a(e.id),L()},selected:e=>e.id===i})})]}),(0,J.jsxs)(`section`,{className:`mt-8 space-y-2`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Notifications`}),(0,J.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,J.jsx)(N,{label:`Status`,value:l.status,anything:`Any status`,options:we.map(e=>({value:e,label:e,mark:(0,J.jsx)(M,{status:e})})),onChange:e=>{p(t=>({...t,status:e}))}}),(0,J.jsx)(N,{label:`Notifier`,value:l.notifier,anything:`Any notifier`,options:Bt(b.rows),onChange:e=>{p(t=>({...t,notifier:e}))}})]})]}),(0,J.jsx)(c,{loading:!y.state.read,problem:y.state.problem,empty:w.length===0,emptyMessage:`Nothing queued.`,children:(0,J.jsx)(f,{columns:Wt,rows:w,rowKey:Lt,reading:y.state.reading,next:y.state.next,onMore:y.more,noun:`notifications`,onSelect:e=>{a(null),s(e.id),L()},selected:e=>e.id===o})})]}),(0,J.jsx)(Dt,{open:e,onOpenChange:t,notifiers:$(b.rows),connections:b.connections,onCreated:x}),(0,J.jsx)(Nt,{open:n!==null,draft:n?.draft??Mt,onOpenChange:e=>{e||r(null)},notifiers:$(b.rows),connections:b.connections,onQueued:S,onOpenQueue:e=>{r(null),a(null),s(e),S(),L()}},n?.opened??0)]})}function $(e){return[...new Set(e.map(e=>e.notifier))]}function Bt(e){return $(e).map(e=>({value:e,label:e}))}function Vt(){let[e,t]=(0,U.useState)(null),[n,r]=(0,U.useState)(null);return(0,U.useEffect)(()=>{let e=!0;return Ue().then(n=>{e&&t(n)},()=>{e&&t([])}),de().then(t=>{e&&r(t.items)},()=>{e&&r([])}),()=>{e=!1}},[]),{rows:(0,U.useMemo)(()=>We(e??[],n??[]),[n,e]),connections:n??[],read:e!==null&&n!==null}}function Ht({rule:e}){let t=Oe(e.importance);return(0,J.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,J.jsx)(`span`,{className:e.scope===`pipeline`?`font-mono text-xs`:`text-sm`,children:De(e)}),t!==null&&(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})}var Ut=[{id:`rule`,header:`Rule`,cell:e=>{let t=S(e);return(0,J.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,J.jsx)(`span`,{className:t.named?`text-sm font-medium`:`font-mono text-sm font-medium`,children:t.title}),t.code!==null&&(0,J.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t.code})]})}},{id:`event`,header:`Event`,cell:e=>(0,J.jsx)(`span`,{className:`text-sm`,children:W[e.event]})},{id:`scope`,header:`Scope`,cell:e=>(0,J.jsx)(Ht,{rule:e})},{id:`delivers`,header:`Delivers through`,cell:e=>(0,J.jsx)(ut,{notifier:e.notifier,connection:e.connection})},{id:`throttle`,header:`Throttle`,className:`font-mono text-xs`,cell:e=>(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:Ee(e.throttle)})},{id:`sent`,header:`Last sent`,className:`text-xs`,cell:e=>e.last_sent_at===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`never`}):(0,J.jsx)(H,{className:`text-muted-foreground`,at:e.last_sent_at})},{id:`live`,header:`State`,cell:e=>e.paused?(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`paused`}):e.active?(0,J.jsx)(`span`,{className:`text-xs text-good`,children:`active`}):(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`off`})}],Wt=[{id:`status`,header:`Status`,cell:e=>(0,J.jsx)(M,{status:e.status})},{id:`subject`,header:`Subject`,cell:e=>(0,J.jsxs)(`span`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{className:`text-sm`,children:e.subject}),e.error!==null&&(0,J.jsx)(`span`,{className:`max-w-96 truncate text-xs text-critical`,title:e.error,children:e.error})]})},{id:`delivers`,header:`Delivers through`,cell:e=>(0,J.jsx)(dt,{notifier:e.notifier,connection:e.connection})},{id:`run`,header:`Run`,cell:e=>(0,J.jsx)(ft,{notification:e})},{id:`queued`,header:`Queued`,className:`text-xs`,cell:e=>(0,J.jsx)(H,{className:`text-muted-foreground`,at:e.created_at})},{id:`sent`,header:`Sent`,className:`text-xs`,cell:e=>e.status===`sent`?(0,J.jsx)(H,{className:`text-muted-foreground`,at:e.sent_at}):e.attempt>0?(0,J.jsxs)(`span`,{className:`text-faint`,children:[e.attempt,` of `,e.max_attempts,` attempts`]}):null}];export{Rt as AdminAlerting};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{n}from"./chunk-OB3PAWPO-DOp4K52_.js";import{n as r,t as i}from"./PageState-CGVhOaOE.js";import{r as a,t as o}from"./ListTable-BykeouTl.js";import{r as s}from"./utils-CT7ZGLfR.js";import{t as c}from"./input-1fShkFXn.js";import{$ as l,_ as u,et as d,ot as f,st as p}from"./index-DBX30PmL.js";import{t as m}from"./Markdown-roa7jpVu.js";import{n as h,r as g}from"./Panel-CqrOYByl.js";import{a as _,c as v,l as y,n as b,o as x,r as S,t as C}from"./blocks-CclbVd8c.js";import{_ as w}from"./connections-BuMoMUFi.js";import{l as T,r as E}from"./examples-vNFNdfIm.js";import{t as D}from"./KindChip-CwU_Xxdy.js";var O=e(t(),1),k=s(),A=e=>e.id,j=[{key:`scheme`,title:`Storage schemes`,noun:`schemes`},{key:`notifier`,title:`Notifiers`,noun:`notifiers`},{key:`connection`,title:`Connection kinds`,noun:`connection kinds`}],M=e=>t=>`${e}:${t.id}`,N=()=>{};function P(){let[e,t]=(0,O.useState)(``),[n,s]=(0,O.useState)(null),{value:m,problem:h,read:g}=u(v),y=u(T),b=(0,O.useMemo)(()=>E(y.value??[]),[y.value]),S=(0,O.useMemo)(()=>m?.blocks??[],[m]),w=(0,O.useMemo)(()=>_(S,e),[S,e]),D=(0,O.useMemo)(()=>C(w),[w]),P=(0,O.useMemo)(()=>x(m?.storage_schemes??[],e),[m,e]),I=(0,O.useMemo)(()=>x(m?.notifiers??[],e),[m,e]),B=(0,O.useMemo)(()=>x(m?.connection_kinds??[],e),[m,e]),V=(0,O.useMemo)(()=>F(b),[b]),H=S.find(e=>`block:${e.id}`===n)??null,U={scheme:P,notifier:I,connection:B},W=j.flatMap(e=>U[e.key].map(t=>({registry:e,entry:t}))).find(({registry:e,entry:t})=>M(e.key)(t)===n)??null;(0,O.useEffect)(()=>{if(g)return d({note:null,tone:`quiet`,identifier:null}),l},[S,g,m]),(0,O.useEffect)(()=>{if(H!==null)return f([{id:`block`,label:`Block`,render:()=>(0,k.jsx)(z,{entry:H})}],{screen:`blocks`});if(W!==null){let{registry:e,entry:t}=W;return f([{id:`entry`,label:e.title,render:()=>(0,k.jsx)(R,{entry:t})}],{screen:`blocks`})}},[H,W]);let G=(0,O.useCallback)(e=>{s(`block:${e.id}`),p()},[]);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(i,{title:`Blocks`,aside:(0,k.jsx)(a,{tag:`blocks`})}),(0,k.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:(0,k.jsx)(c,{className:`w-56`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search blocks`,"aria-label":`Search blocks by id or summary`})}),(0,k.jsx)(r,{loading:!g,problem:h,empty:w.length===0&&P.length===0&&I.length===0&&B.length===0,emptyMessage:S.length===0?`No blocks installed — plugins contribute them.`:`Nothing in the catalog matches that.`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[D.map(([e,t])=>(0,k.jsxs)(`section`,{children:[(0,k.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e}),(0,k.jsx)(o,{chrome:{footer:!1},fixed:!0,columns:V,rows:t,rowKey:A,reading:!1,next:null,onMore:N,noun:`blocks`,onSelect:G,selected:e=>`block:${e.id}`===n})]},e)),j.map(e=>{let t=U[e.key];return t.length===0?null:(0,k.jsxs)(`section`,{children:[(0,k.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e.title}),(0,k.jsx)(o,{chrome:{footer:!1},fixed:!0,columns:L(e.key),rows:t,rowKey:M(e.key),reading:!1,next:null,onMore:N,noun:e.noun,onSelect:t=>{s(M(e.key)(t)),p()},selected:t=>M(e.key)(t)===n})]},e.key)})]})})]})}function F(e){return[{id:`block`,header:`Block`,className:`w-full max-w-0`,cell:e=>(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:e.summary,children:e.summary})]})},{id:`kind`,header:`Kind`,className:`w-32 whitespace-nowrap`,cell:e=>(0,k.jsx)(D,{kind:e.kind})},{id:`examples`,header:`Examples`,className:`w-28 whitespace-nowrap`,cell:t=>(0,k.jsx)(I,{id:t.id,many:e.get(t.id)??0})},{id:`plugin`,header:`Plugin`,className:`w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function I({id:e,many:t}){if(t===0)return(0,k.jsx)(`span`,{className:`text-xs text-faint`,children:`none`});let r=`${String(t)} ${t===1?`example`:`examples`}`;return(0,k.jsx)(n,{className:`text-xs text-primary-ink hover:underline`,to:`/examples?block=${encodeURIComponent(e)}`,title:`The shipped documents that require ${e}`,onClick:e=>{e.stopPropagation()},children:r})}function L(e){let t=e===`scheme`?`storage`:e;return[{id:`entry`,header:`Entry`,className:`w-full max-w-0`,cell:e=>{let t=typeof e.config_schema.description==`string`?e.config_schema.description:``;return(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:t,children:t})]})}},{id:`kind`,header:`Kind`,className:`w-32 whitespace-nowrap`,cell:()=>(0,k.jsx)(D,{kind:t})},{id:`plugin`,header:`Plugin`,className:`w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function R({entry:e}){let t=(0,O.useMemo)(()=>w(e.config_schema),[e]),n=typeof e.config_schema.description==`string`?e.config_schema.description:null;return(0,k.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),n!==null&&(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n}),(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:(0,k.jsx)(h,{term:`plugin`,detail:e.plugin})})]}),(0,k.jsx)(g,{title:`Config`,children:t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This takes no configuration.`}):(0,k.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,k.jsx)(B,{field:e},e.name))})})]})}function z({entry:e}){let t=(0,O.useMemo)(()=>w(e.config_schema),[e]),n=S(e);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{children:(0,k.jsx)(D,{kind:e.kind})}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.summary})]}),(0,k.jsx)(g,{title:`Facts`,children:(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:n.map(e=>(0,k.jsx)(h,{term:e.term,detail:e.detail},e.term))})}),(0,k.jsx)(g,{title:`Config`,children:t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This block takes no configuration.`}):(0,k.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,k.jsx)(B,{field:e},e.name))})})]})}function B({field:e}){let t=b(e);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:y(e)}),e.required&&(0,k.jsx)(`span`,{className:`text-xs text-primary`,children:`required`}),e.hint!==null&&(0,k.jsx)(`span`,{className:`text-xs text-faint`,children:e.hint}),t!==null&&(0,k.jsxs)(`span`,{className:`text-xs text-faint`,children:[`default `,t]})]}),e.options.length>0&&(0,k.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:e.options.map(e=>e.label).join(` · `)}),e.help!==null&&(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,k.jsx)(m,{text:e.help})})]})}export{P as Blocks};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{n}from"./chunk-OB3PAWPO-DOp4K52_.js";import{n as r,t as i}from"./PageState-CGVhOaOE.js";import{r as a,t as o}from"./ListTable-BykeouTl.js";import{r as s}from"./utils-CT7ZGLfR.js";import{t as c}from"./input-1fShkFXn.js";import{$ as l,_ as u,et as d,ot as f,st as p}from"./index-MYZXi-9R.js";import{t as m}from"./Markdown-roa7jpVu.js";import{n as h,r as g}from"./Panel-CqrOYByl.js";import{a as _,c as v,l as y,n as b,o as x,r as S,t as C}from"./blocks-CclbVd8c.js";import{y as w}from"./connections-DsdoSARb.js";import{l as T,r as E}from"./examples-DDWkSZ2u.js";import{t as D}from"./KindChip-CwU_Xxdy.js";var O=e(t(),1),k=s(),A=e=>e.id,j=[{key:`scheme`,title:`Storage schemes`,noun:`schemes`},{key:`notifier`,title:`Notifiers`,noun:`notifiers`},{key:`connection`,title:`Connection kinds`,noun:`connection kinds`}],M=e=>t=>`${e}:${t.id}`,N=()=>{};function P(){let[e,t]=(0,O.useState)(``),[n,s]=(0,O.useState)(null),{value:m,problem:h,read:g}=u(v),y=u(T),b=(0,O.useMemo)(()=>E(y.value??[]),[y.value]),S=(0,O.useMemo)(()=>m?.blocks??[],[m]),w=(0,O.useMemo)(()=>_(S,e),[S,e]),D=(0,O.useMemo)(()=>C(w),[w]),P=(0,O.useMemo)(()=>x(m?.storage_schemes??[],e),[m,e]),I=(0,O.useMemo)(()=>x(m?.notifiers??[],e),[m,e]),B=(0,O.useMemo)(()=>x(m?.connection_kinds??[],e),[m,e]),V=(0,O.useMemo)(()=>F(b),[b]),H=S.find(e=>`block:${e.id}`===n)??null,U={scheme:P,notifier:I,connection:B},W=j.flatMap(e=>U[e.key].map(t=>({registry:e,entry:t}))).find(({registry:e,entry:t})=>M(e.key)(t)===n)??null;(0,O.useEffect)(()=>{if(g)return d({note:null,tone:`quiet`,identifier:null}),l},[S,g,m]),(0,O.useEffect)(()=>{if(H!==null)return f([{id:`block`,label:`Block`,render:()=>(0,k.jsx)(z,{entry:H})}],{screen:`blocks`});if(W!==null){let{registry:e,entry:t}=W;return f([{id:`entry`,label:e.title,render:()=>(0,k.jsx)(R,{entry:t})}],{screen:`blocks`})}},[H,W]);let G=(0,O.useCallback)(e=>{s(`block:${e.id}`),p()},[]);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(i,{title:`Blocks`,aside:(0,k.jsx)(a,{tag:`blocks`})}),(0,k.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:(0,k.jsx)(c,{className:`w-56`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search blocks`,"aria-label":`Search blocks by id or summary`})}),(0,k.jsx)(r,{loading:!g,problem:h,empty:w.length===0&&P.length===0&&I.length===0&&B.length===0,emptyMessage:S.length===0?`No blocks installed — plugins contribute them.`:`Nothing in the catalog matches that.`,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[D.map(([e,t])=>(0,k.jsxs)(`section`,{children:[(0,k.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e}),(0,k.jsx)(o,{chrome:{footer:!1},fixed:!0,columns:V,rows:t,rowKey:A,reading:!1,next:null,onMore:N,noun:`blocks`,onSelect:G,selected:e=>`block:${e.id}`===n})]},e)),j.map(e=>{let t=U[e.key];return t.length===0?null:(0,k.jsxs)(`section`,{children:[(0,k.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e.title}),(0,k.jsx)(o,{chrome:{footer:!1},fixed:!0,columns:L(e.key),rows:t,rowKey:M(e.key),reading:!1,next:null,onMore:N,noun:e.noun,onSelect:t=>{s(M(e.key)(t)),p()},selected:t=>M(e.key)(t)===n})]},e.key)})]})})]})}function F(e){return[{id:`block`,header:`Block`,className:`w-full max-w-0`,cell:e=>(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:e.summary,children:e.summary})]})},{id:`kind`,header:`Kind`,className:`w-32 whitespace-nowrap`,cell:e=>(0,k.jsx)(D,{kind:e.kind})},{id:`examples`,header:`Examples`,className:`w-28 whitespace-nowrap`,cell:t=>(0,k.jsx)(I,{id:t.id,many:e.get(t.id)??0})},{id:`plugin`,header:`Plugin`,className:`w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function I({id:e,many:t}){if(t===0)return(0,k.jsx)(`span`,{className:`text-xs text-faint`,children:`none`});let r=`${String(t)} ${t===1?`example`:`examples`}`;return(0,k.jsx)(n,{className:`text-xs text-primary-ink hover:underline`,to:`/examples?block=${encodeURIComponent(e)}`,title:`The shipped documents that require ${e}`,onClick:e=>{e.stopPropagation()},children:r})}function L(e){let t=e===`scheme`?`storage`:e;return[{id:`entry`,header:`Entry`,className:`w-full max-w-0`,cell:e=>{let t=typeof e.config_schema.description==`string`?e.config_schema.description:``;return(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:t,children:t})]})}},{id:`kind`,header:`Kind`,className:`w-32 whitespace-nowrap`,cell:()=>(0,k.jsx)(D,{kind:t})},{id:`plugin`,header:`Plugin`,className:`w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,k.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function R({entry:e}){let t=(0,O.useMemo)(()=>w(e.config_schema),[e]),n=typeof e.config_schema.description==`string`?e.config_schema.description:null;return(0,k.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),n!==null&&(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n}),(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:(0,k.jsx)(h,{term:`plugin`,detail:e.plugin})})]}),(0,k.jsx)(g,{title:`Config`,children:t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This takes no configuration.`}):(0,k.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,k.jsx)(B,{field:e},e.name))})})]})}function z({entry:e}){let t=(0,O.useMemo)(()=>w(e.config_schema),[e]),n=S(e);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,k.jsx)(`p`,{children:(0,k.jsx)(D,{kind:e.kind})}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.summary})]}),(0,k.jsx)(g,{title:`Facts`,children:(0,k.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:n.map(e=>(0,k.jsx)(h,{term:e.term,detail:e.detail},e.term))})}),(0,k.jsx)(g,{title:`Config`,children:t.length===0?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This block takes no configuration.`}):(0,k.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,k.jsx)(B,{field:e},e.name))})})]})}function B({field:e}){let t=b(e);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,k.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:y(e)}),e.required&&(0,k.jsx)(`span`,{className:`text-xs text-primary`,children:`required`}),e.hint!==null&&(0,k.jsx)(`span`,{className:`text-xs text-faint`,children:e.hint}),t!==null&&(0,k.jsxs)(`span`,{className:`text-xs text-faint`,children:[`default `,t]})]}),e.options.length>0&&(0,k.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:e.options.map(e=>e.label).join(` · `)}),e.help!==null&&(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,k.jsx)(m,{text:e.help})})]})}export{P as Blocks};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{r as n}from"./with-selector-BXYKoaOE.js";import{c as r,l as i,u as a}from"./chunk-OB3PAWPO-DOp4K52_.js";import{a as o,i as s,n as c,r as l,t as u}from"./select-C9VBesB_.js";import{n as d,o as f,s as p,t as m}from"./PageState-CGVhOaOE.js";import{r as h,t as g}from"./ListTable-BykeouTl.js";import{r as _,t as v}from"./utils-CT7ZGLfR.js";import{i as y,n as b,t as x}from"./tooltip-D7_KwbOU.js";import{d as S,f as C}from"./paging-CpRIkEky.js";import{t as w}from"./input-1fShkFXn.js";import{t as T}from"./SchemaForm-C-Wc8YiX.js";import{t as E}from"./textarea-ljIbN_md.js";import{d as D,l as O,s as k}from"./format-B5YbYOY-.js";import{t as A}from"./identity-BNZxCf_y.js";import{$ as j,At as M,E as N,It as P,Mt as F,Nt as I,Ot as L,Pt as ee,_ as R,b as te,et as z,ft as B,jt as ne,kt as re,mt as V,ot as H,pt as U,st as W,v as G,y as K}from"./index-MYZXi-9R.js";import{t as ie}from"./Description-MmXUnb-9.js";import{F as ae,P as oe,S as q,a as se,d as J,f as ce,g as le,h as ue,i as de,l as fe,n as pe,o as me,p as he,s as ge,t as _e,u as ve}from"./connections-DsdoSARb.js";import{n as ye,t as be}from"./Refusal-uzV5VL19.js";import{t as xe}from"./KindChip-CwU_Xxdy.js";import{t as Y}from"./Instant-mr1E5jAK.js";import{t as X}from"./Mark-DQR2php6.js";var Se={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`]};Se.node;var Ce=n(Se),Z=e(t(),1),Q=_(),we={good:`var(--good)`,critical:`var(--critical)`};function Te(e){return e===null?`var(--faint)`:we[e]}function $({view:e,className:t}){return(0,Q.jsxs)(`span`,{className:v(`flex items-center gap-2 text-xs`,t),children:[(0,Q.jsx)(`span`,{className:`status-dot`,style:{"--chip":Te(e.tone)},"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:v(`whitespace-nowrap`,e.tone===null&&`text-faint`),children:e.label})]})}function Ee({id:e,name:t,stored:n,value:r,onChange:i}){return(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(N,{htmlFor:e,className:`font-mono text-sm font-medium`,children:t}),(0,Q.jsx)(w,{id:e,type:`password`,autoComplete:`new-password`,value:r,onChange:e=>{i(e.target.value)},placeholder:n?`stored — typing replaces it, blank keeps it`:`not set — type to set one`})]})}function De({connection:e,schema:t,onSaved:n}){let[r,i]=(0,Z.useState)(e.name??``),[a,o]=(0,Z.useState)(e.description??``),[s,c]=(0,Z.useState)(()=>Ae(e)),[l,u]=(0,Z.useState)({}),[d,p]=(0,Z.useState)(()=>new Set),[m,h]=(0,Z.useState)(null),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),b=A(e),x=(0,Z.useMemo)(()=>ke(e,t),[e,t]),O=(0,Z.useMemo)(()=>oe(x,s),[x,s]),k=K(`admin`),j=te(k.why,q(O,d)?void 0:`A setting above is not what this kind accepts.`);return(0,Q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(X,{glyph:V(e.kind)}),(0,Q.jsx)(`span`,{className:b.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:b.title}),b.code!==null&&(0,Q.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:b.code}),(0,Q.jsx)(xe,{kind:e.kind})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-faint`,children:[`Created `,(0,Q.jsx)(Y,{at:e.created_at}),D(e.created_at,e.updated_at)&&(0,Q.jsxs)(Q.Fragment,{children:[` · updated `,(0,Q.jsx)(Y,{at:e.updated_at})]})]}),(0,Q.jsx)(Oe,{connection:e}),(0,Q.jsx)(ie,{text:e.description})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(N,{htmlFor:`connection-name`,children:`Name`}),(0,Q.jsx)(w,{id:`connection-name`,value:r,onChange:e=>{i(e.target.value),y(!1)},placeholder:`What to call this on screen`}),(0,Q.jsxs)(`p`,{className:`text-xs text-faint`,children:[`Display only. Every reference to this credential is by its code, `,e.code,`.`]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(N,{htmlFor:`connection-description`,children:`Description`}),(0,Q.jsx)(E,{id:`connection-description`,className:`h-24`,value:a,onChange:e=>{o(e.target.value),y(!1)},placeholder:`What this credential is for. Markdown is rendered.`})]}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:`Settings`}),(0,Q.jsx)(T,{fields:x,values:s,problems:O,onChange:(e,t)=>{c(n=>({...n,[e]:t})),y(!1)},onUnreadable:(e,t)=>{p(n=>ae(n,e,t))}}),e.secret_fields.map(t=>(0,Q.jsx)(Ee,{id:`secret-${t}`,name:t,stored:je(e.config[t]),value:l[t]??``,onChange:e=>{u(n=>({...n,[t]:e})),y(!1)}},t))]}),m!==null&&(0,Q.jsx)(be,{problem:m}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(f,{why:j,children:(0,Q.jsx)(C,{size:`sm`,onClick:()=>{let t=fe(e,Ne(e,s,l),Me(r),Me(a));if(t===null){y(!0);return}_(!0),h(null),ue(e.code,t).then(e=>{u({}),y(!0),n(e)},e=>{h(S(e))}).finally(()=>{_(!1)})},disabled:g||j!==void 0,title:j,children:g?`Saving`:`Save`})}),v&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Saved.`})]})]})}function Oe({connection:e}){let t=me(e);return(0,Q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)($,{view:t}),t.checkedAt!==null&&(0,Q.jsxs)(`span`,{className:`text-xs text-faint`,children:[`checked `,(0,Q.jsx)(Y,{at:t.checkedAt})]})]}),t.detail!==null&&(0,Q.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:[]})):he(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 Me(e){let t=e.trim();return t===``?null:t}function Ne(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 Pe({open:e,kinds:t,startKind:n=``,onOpenChange:r,onCreated:i}){let[a,d]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(n),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)({}),[x,D]=(0,Z.useState)({}),[O,k]=(0,Z.useState)(()=>new Set),[A,j]=(0,Z.useState)(()=>new Set),[P,R]=(0,Z.useState)(!1),[z,B]=(0,Z.useState)(null),[V,H]=(0,Z.useState)(!1),U=t.find(e=>e.id===h)??null,W=he(U?.config_schema??null,U?.secret_fields??[]),G=oe(W,y),ie=P?void 0:O,q=K(`admin`),J=te(q.why,Ie(a,h,G,A));return(0,Q.jsx)(L,{open:e,onOpenChange:r,children:(0,Q.jsxs)(M,{className:`sm:max-w-xl`,showCloseButton:!1,children:[(0,Q.jsxs)(I,{children:[(0,Q.jsx)(ee,{children:`New connection`}),(0,Q.jsx)(ne,{children:`Secret fields are sealed on the way in and never read back out.`})]}),(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(N,{htmlFor:`connection-code`,children:`Code`}),(0,Q.jsx)(w,{id:`connection-code`,className:`font-mono`,value:a,onChange:e=>{d(e.target.value)},placeholder:`postman-echo`})]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(N,{htmlFor:`connection-kind`,children:`Kind`}),(0,Q.jsxs)(u,{value:h,onValueChange:e=>{g(String(e)),b({}),D({}),k(new Set),j(new Set),R(!1)},children:[(0,Q.jsx)(s,{id:`connection-kind`,className:`w-full font-mono`,children:(0,Q.jsx)(o,{placeholder:`Choose a kind`,children:U===null?void 0:()=>(0,Q.jsx)(Fe,{kind:U.id})})}),(0,Q.jsx)(c,{children:t.map(e=>(0,Q.jsx)(l,{value:e.id,className:`font-mono`,children:(0,Q.jsx)(Fe,{kind:e.id})},e.id))})]})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(N,{htmlFor:`connection-name-new`,children:`Name`}),(0,Q.jsx)(w,{id:`connection-name-new`,value:p,onChange:e=>{m(e.target.value)},placeholder:`What to call it on screen. Optional; nothing references it.`})]}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(N,{htmlFor:`connection-description-new`,children:`Description`}),(0,Q.jsx)(E,{id:`connection-description-new`,className:`h-24`,value:_,onChange:e=>{v(e.target.value)},placeholder:`What this credential is for. Markdown is rendered.`})]}),U!==null&&(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:`Settings`}),(0,Q.jsxs)(`div`,{className:`max-h-[40vh] space-y-3 overflow-y-auto pr-1`,children:[(0,Q.jsx)(T,{fields:W,values:y,problems:G,stated:ie,onChange:(e,t)=>{b(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r})},onTouch:e=>{k(t=>t.has(e)?t:new Set(t).add(e))},onUnreadable:(e,t)=>{j(n=>ae(n,e,t))}}),U.secret_fields.map(e=>(0,Q.jsx)(Ee,{id:`new-secret-${e}`,name:e,stored:!1,value:x[e]??``,onChange:t=>{D(n=>({...n,[e]:t}))}},e))]})]}),z!==null&&(0,Q.jsx)(be,{problem:z}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(re,{render:(0,Q.jsx)(C,{variant:`ghost`}),children:`Close`}),(0,Q.jsx)(f,{why:J,children:(0,Q.jsx)(C,{disabled:V||J!==void 0,title:J,onClick:()=>{R(!0),H(!0),B(null),se({code:a.trim(),name:Le(p),kind:h,description:Le(_),config:ge(y,x)}).then(e=>{i(e),d(``),m(``),v(``),g(n),b({}),D({}),k(new Set),j(new Set),R(!1),r(!1)},e=>{B(S(e))}).finally(()=>{H(!1)})},children:V?`Creating`:`Create`})})]})]})})}function Fe({kind:e}){return(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(X,{glyph:V(e)}),e]})}function Ie(e,t,n,r){if(e.trim()===``)return`A connection is addressed by its code, and this one has none.`;if(t===``)return`No kind is chosen, and a connection is a credential of one kind.`;if(r.size>0)return`A setting below holds text that is not a value.`;if(!q(n,r))return`A setting below is not what its kind accepts.`}function Le(e){let t=e.trim();return t===``?null:t}var Re=e=>e.code;function ze(){let{code:e=null}=i(),t=r(),[n,o]=a(),s=n.get(`new`),[c,l]=(0,Z.useState)(!1),u=c||s!==null,[p,_]=(0,Z.useState)({}),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(null),{state:S,more:w,reload:T}=G(ce,Re),E=(0,Z.useMemo)(()=>S.rows.map(e=>p[e.code]??e),[p,S.rows]),D=E.find(t=>t.code===e)??null,O=(0,Z.useCallback)(()=>e===null||D!==null?Promise.resolve(null):ve(e),[e,D]),k=R(O).value,A=D??(k===null?null:p[k.code]??k);(0,Z.useEffect)(()=>{e!==null&&W()},[e]);let M=(0,Z.useCallback)(e=>{_(t=>({...t,[e.code]:e}))},[]),N=(0,Z.useCallback)(e=>{y(e.code),_e(e.code).then(t=>{M(le(e,t,new Date().toISOString()))},ye).finally(()=>{y(null)})},[M]),F=e!==null||u;(0,Z.useEffect)(()=>{if(!F||b!==null)return;let e=!0;return J().then(t=>{e&&x(t)},()=>{}),()=>{e=!1}},[b,F]),(0,Z.useEffect)(()=>{let e=de(E);if(e===null){j();return}return z({note:e,tone:`quiet`,identifier:null}),j},[E]),(0,Z.useEffect)(()=>{if(A===null)return;let e=b?.find(e=>e.id===A.kind)?.config_schema??null;return H([{id:`connection`,label:`Connection`,render:()=>(0,Q.jsx)(De,{connection:A,schema:e,onSaved:M},A.code)}],{screen:`connections`})},[M,b,A]);let I=K(`admin`),L=I.may;(0,Z.useEffect)(()=>U([...L?[{id:`connections:new`,title:`New connection`,group:B,screen:!0,icon:Ce,keywords:[`credential`,`create`,`add`],run:()=>{l(!0)}}]:[],{id:`connections:reload`,title:`Read the connections listing again`,group:B,screen:!0,icon:P,keywords:[`refresh`,`reload`],run:T}]),[L,T]);let ee=(0,Z.useMemo)(()=>Be(N,v,I.why),[N,v,I.why]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(m,{title:`Connections`,aside:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{tag:`connections`}),(0,Q.jsx)(f,{why:I.why,children:(0,Q.jsxs)(C,{size:`sm`,"aria-label":`New connection`,disabled:!I.may,title:I.why,onClick:()=>{l(!0)},children:[(0,Q.jsx)(Ce,{"aria-hidden":!0}),`New`]})})]})}),(0,Q.jsx)(d,{loading:!S.read,problem:S.problem,empty:E.length===0,emptyMessage:`No connections.`,children:(0,Q.jsx)(g,{columns:ee,rows:E,rowKey:Re,reading:S.reading,next:S.next,onMore:w,noun:`connections`,onSelect:e=>{t(pe(e.code),{replace:!0})},selected:t=>t.code===e})}),(0,Q.jsx)(Pe,{open:u,kinds:b??[],startKind:s??``,onOpenChange:e=>{l(e),!e&&s!==null&&(n.delete(`new`),o(n,{replace:!0}))},onCreated:()=>{T()}},s??``)]})}function Be(e,t,n){return[{id:`connection`,header:`Connection`,className:`w-full max-w-0 lg:min-w-[50cqi]`,cell:e=>(0,Q.jsx)(Ve,{row:e})},{id:`health`,header:`Health`,cell:e=>(0,Q.jsx)(He,{row:e})},{id:`checked`,header:`Checked`,className:`text-xs`,cell:e=>e.last_check_at===null?null:(0,Q.jsx)(Ue,{at:e.last_check_at})},{id:`check`,header:``,className:`py-1 text-right`,cell:r=>(0,Q.jsx)(f,{why:n,children:(0,Q.jsx)(C,{variant:`outline`,size:`icon-lg`,"aria-label":`Check ${r.code}`,disabled:t===r.code||n!==void 0,title:n??`Check now`,onClick:t=>{t.stopPropagation(),e(r)},children:(0,Q.jsx)(P,{className:v(t===r.code&&`animate-spin`),"aria-hidden":!0})})})}]}function Ve({row:e}){let t=A(e);return(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(X,{glyph:V(e.kind)}),(0,Q.jsx)(`span`,{className:v(`truncate font-semibold`,!t.named&&`font-mono`),title:t.title,children:t.title}),t.code!==null&&(0,Q.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,title:t.code,children:t.code}),(0,Q.jsx)(xe,{kind:e.kind})]})}function He({row:e}){let t=me(e),n=p();return t.detail===null||n?(0,Q.jsx)($,{view:t}):(0,Q.jsxs)(x,{children:[(0,Q.jsx)(y,{render:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-sm focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Q.jsx)($,{view:t})})}),(0,Q.jsx)(b,{side:`bottom`,children:t.detail})]})}function Ue({at:e}){return(0,Q.jsx)(`span`,{className:`text-muted-foreground`,title:k(e),children:O(e)})}export{ze as Connections};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{c as n,n as r}from"./chunk-OB3PAWPO-DOp4K52_.js";import{i,n as a,r as o,t as s}from"./PageState-CGVhOaOE.js";import{r as c,t as l}from"./ListTable-BykeouTl.js";import{r as u,t as d}from"./utils-CT7ZGLfR.js";import{t as f}from"./use-store-CfRquqZF.js";import{t as p}from"./auth-CHgfcdt9.js";import{v as m}from"./format-B5YbYOY-.js";import{t as h}from"./use-heartbeat-CBT8848s.js";import{t as g}from"./identity-BNZxCf_y.js";import{m as _}from"./pipelines-Pi3WL8R6.js";import{It as ee,S as v,_ as y,dt as b,l as x,m as S,mt as C,pt as w,t as T,u as E}from"./index-MYZXi-9R.js";import{f as D,i as O,o as k,r as A}from"./connections-DsdoSARb.js";import{t as j}from"./Instant-mr1E5jAK.js";import{t as M}from"./Mark-DQR2php6.js";import{f as N,i as P,p as te,r as ne,s as re,t as ie,u as ae}from"./TileCard-CkZS_VSw.js";import{a as oe,i as F,r as I}from"./workers-BH2Za19E.js";import{f as L,s as R}from"./triggers-BetQ4Leu.js";var z=e(t(),1),B=u(),V={neutral:`bg-muted-foreground`,good:`bg-good`,info:`bg-info`,warning:`bg-warning`,critical:`bg-critical`};function H({rows:e,note:t,reading:n}){let a=f(p).identity?.role??null;return(0,B.jsx)(o,{className:`gap-0 p-0`,children:(0,B.jsxs)(i,{className:`flex h-full flex-col p-0`,children:[(0,B.jsxs)(`div`,{className:`space-y-1 px-3 py-3`,children:[(0,B.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Health`}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?`Reading from the server`:`The workers claiming work, and every connection.`})]}),(0,B.jsx)(`ul`,{className:`max-h-64 grow overflow-y-auto`,children:e.map(e=>{let t=e.kind===`connection`?`/connections`:a===`admin`?`/admin/workers`:null,n=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,B.jsx)(`span`,{className:d(`size-2 shrink-0 rounded-full`,V[e.tone]),"aria-hidden":!0}),e.mark===null?(0,B.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,B.jsx)(M,{glyph:e.mark})]}),(0,B.jsx)(`span`,{className:`max-w-[55%] shrink-0 truncate font-mono text-xs`,title:e.label,children:e.label}),(0,B.jsxs)(`span`,{className:`ml-auto flex min-w-0 items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,title:e.detail,children:e.detail}),e.at!==null&&(0,B.jsx)(j,{className:`shrink-0 text-xs text-faint`,at:e.at})]})]});return(0,B.jsx)(`li`,{className:`border-t border-border`,children:t===null?(0,B.jsx)(`span`,{className:`flex items-center gap-2 px-3 py-1.5`,children:n}):(0,B.jsx)(r,{to:t,className:`control-link flex items-center gap-2 px-3 py-1.5 hover:bg-accent/60`,children:n})},`${e.kind}:${e.id}`)})}),(0,B.jsx)(`p`,{className:`border-t border-border px-3 py-2 text-xs text-muted-foreground`,children:t})]})})}function U(e,t){return`${String(e)}${t.next===null?``:`+`}`}function W(e,t){return e===0?`neutral`:t}function G(e,t){return e.items.filter(e=>e.status===t).length}function K(e,t,n){let r=(t,n,r)=>{if(e===null)return null;let i=G(e,t);return{id:t,label:n,value:U(i,e),note:``,tone:W(i,r),to:E({...T,status:t,since:`24h`})}},i=(e,t,n,r,i)=>{if(i===null)return null;let a=i.items.length;return{id:e,label:t,value:U(a,i),note:a===0?``:r,tone:W(a,n),to:E({...T,status:e})}};return[{id:`runs`,tile:e===null?null:{id:`runs`,label:`Runs`,value:U(e.items.length,e),note:`Last 24 hours.`,tone:`neutral`,to:E({...T,since:`24h`})}},{id:`succeeded`,tile:r(`succeeded`,`Succeeded`,`good`)},{id:`failed`,tile:r(`failed`,`Failed`,`critical`)},{id:`completed_with_errors`,tile:r(`completed_with_errors`,`With errors`,`warning`)},{id:`running`,tile:i(`running`,`Running`,`info`,`Being worked on now.`,t)},{id:`queued`,tile:i(`queued`,`Queued`,`neutral`,`Waiting for a worker.`,n)}]}var q=36e5,J=864e5;function se(e,t){let n=e+t*6e4;return Math.floor(n/q)*q-t*6e4}function ce(e,t){let n=e+t*6e4;return Math.floor((n%J+J)%J/q)}function le(e,t,n,r=24){let i=se(t.getTime(),n)-(r-1)*q,a=Array.from({length:r},(e,t)=>{let r=i+t*q;return{start:r,hour:ce(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 ue(e){return e.reduce((e,t)=>Math.max(e,Y(t)),0)}function de(e){let t=t=>e.reduce((e,n)=>e+t(n),0),n=t(e=>e.total);if(n===0)return`No run was started in the last 24 hours.`;let r=[`${String(t(e=>e.succeeded))} succeeded`,`${String(t(e=>e.withErrors))} finished with errors`,`${String(t(e=>e.failed))} failed`];return`${String(n)} runs started in the last 24 hours, by the hour: ${r.join(`, `)}.`}function fe(e,t){let n=e.map(e=>{let t=I(e);return{id:e.id,kind:`worker`,mark:null,label:e.name,tone:t===null?`good`:P(t),detail:t===null?`worker · ${String(e.concurrency)} ${e.concurrency===1?`slot`:`slots`}`:F(t),at:t===null?null:e.last_seen_at}}),r=t.map(e=>{let t=k(e);return{id:e.id,kind:`connection`,mark:C(e.kind),label:e.code,tone:t.tone??`neutral`,detail:pe(t),at:e.last_check_at}});return[...n,...r]}function pe(e){switch(e.state){case`unchecked`:return`never checked`;case`unverified`:return`not verified`;case`healthy`:return e.detail??`healthy`;case`failed`:return e.detail??`did not answer`}}function me(e,t){let n=e.filter(e=>I(e)===null).length,{healthy:r,total:i}=A(t),a=[];if(e.length===0?a.push(`no worker has registered`):n<e.length&&a.push(`${String(n)} of ${String(e.length)} workers healthy`),r<i){let e=O(t,`connections`);e!==null&&a.push(e)}if(a.length>0){let e=a.join(` · `);return`${e.charAt(0).toUpperCase()}${e.slice(1)}.`}return t.length===0?`Every worker is healthy, and this instance holds no connections.`:`Every worker and every connection is healthy.`}function he(e,t,n=6){return[...e,...t].toSorted((e,t)=>Date.parse(t.created_at)-Date.parse(e.created_at)).slice(0,n)}function ge(e,t=6){return e.flatMap(e=>{let t=R(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 X(e){let t=e.filter(e=>e.schedules>0);return(await Promise.all(t.map(async e=>(await L(e.code,null)).items.map(t=>({pipeline:e.code,schedule:t}))))).flat()}async function _e(){let e=await _(null);return{pipelines:e.items,schedules:await X(e.items)}}var ve=6,Z=[{id:`failed`,label:`Failed`,fill:`bg-status-failed/80`},{id:`withErrors`,label:`With errors`,fill:`bg-status-completed-with-errors/80`},{id:`succeeded`,label:`Succeeded`,fill:`bg-status-succeeded/75`}];function ye(e){let t=`${String(e.hour).padStart(2,`0`)}:00`;if(e.total===0)return`${t} — nothing ran`;let n=Z.filter(t=>e[t.id]>0).map(t=>`${String(e[t.id])} ${t.label.toLowerCase()}`),r=n.length===0?`none finished`:n.join(`, `);return`${t} — ${String(e.total)} started, ${r}`}function be({buckets:e,reading:t,className:n}){let r=ue(e);return(0,B.jsx)(o,{className:d(`gap-0 p-0`,n),children:(0,B.jsxs)(i,{className:`space-y-3 p-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Runs over time`}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t?`Reading from the server`:`Every run started in the last 24 hours, by the hour it started in.`})]}),(0,B.jsx)(`ul`,{className:`flex items-center gap-3`,children:Z.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:d(`size-2 shrink-0 rounded-sm`,e.fill),"aria-hidden":!0}),e.label]},e.id))})]}),(0,B.jsx)(`div`,{className:`flex h-32 items-end gap-px`,role:`img`,"aria-label":de(e),children:e.map(e=>(0,B.jsxs)(`div`,{className:`flex h-full flex-1 flex-col justify-end rounded-sm hover:bg-accent/40`,title:ye(e),children:[Z.map(t=>e[t.id]===0?null:(0,B.jsx)(`div`,{className:d(`min-h-0.5 w-full`,t.fill),style:{height:`${String(e[t.id]/Math.max(r,1)*100)}%`}},t.id)),Y(e)===0&&(0,B.jsx)(`div`,{className:`h-px w-full bg-border`})]},e.start))}),(0,B.jsx)(`div`,{className:`flex gap-px font-mono text-xs text-faint`,"aria-hidden":!0,children:e.map((e,t)=>(0,B.jsx)(`span`,{className:`flex-1 text-center`,children:t%ve===0?`${String(e.hour).padStart(2,`0`)}`:``},e.start))})]})})}function xe(){let e=y((0,z.useCallback)(()=>x({...T,since:`24h`},null,500),[])),t=y((0,z.useCallback)(()=>x({...T,status:`running`},null),[])),r=y((0,z.useCallback)(()=>x({...T,status:`queued`},null),[])),i=y((0,z.useCallback)(()=>x({...T,status:`failed`},null),[])),o=y((0,z.useCallback)(()=>x({...T,status:`completed_with_errors`},null),[])),u=y(_e),p=y((0,z.useCallback)(()=>oe(null),[])),g=y((0,z.useCallback)(()=>D(null),[])),{again:_}=e,{again:v}=t,{again:C}=r,{again:E}=i,{again:O}=o,{again:k}=u,{again:A}=p,{again:j}=g,M=(0,z.useCallback)(()=>{_(),v(),C(),E(),O(),k(),A(),j()},[k,j,_,E,O,C,v,A]);(0,z.useEffect)(()=>w([{id:`dashboard:refresh`,title:`Refresh the dashboard`,group:b,screen:!0,icon:ee,keywords:[`refresh`,`reload`,`home`],run:M}]),[M]);let P=n();h(M,f(S));let F=he(t.value?.items??[],r.value?.items??[]),I=ae(re(i.value?.items??[],o.value?.items??[]),u.value?.pipelines??[]),L=ge(u.value?.schedules??[]),R=K(e.value,t.value,r.value),V=new Date,U=le(e.value?.items??[],V,m(V)),W=p.problem===null&&g.problem===null;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(s,{title:`Dashboard`,aside:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(c,{tag:`runs`}),(0,B.jsx)(te,{onRefresh:M})]})}),(0,B.jsx)(`div`,{className:`mb-3 grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6`,children:R.map(e=>e.tile===null?(0,B.jsx)(ne,{},e.id):(0,B.jsx)(ie,{tile:e.tile},e.id))}),(0,B.jsxs)(`div`,{className:`mb-6 grid gap-3 lg:grid-cols-3`,children:[(0,B.jsx)(`div`,{className:d(W?`lg:col-span-2`:`lg:col-span-3`),children:e.problem===null?(0,B.jsx)(be,{buckets:U,reading:!e.read}):(0,B.jsx)(a,{loading:!1,problem:e.problem,empty:!1,children:null})}),W&&(0,B.jsx)(H,{rows:fe(p.value?.items??[],g.value?.items??[]),note:me(p.value?.items??[],g.value?.items??[]),reading:!p.read||!g.read})]}),(0,B.jsx)(Q,{title:`Right now`,to:`/runs`,children:(0,B.jsx)(a,{loading:!t.read||!r.read,problem:t.problem??r.problem,empty:F.length===0,emptyMessage:`Nothing is running and nothing is waiting.`,children:(0,B.jsx)(l,{chrome:{footer:!1},columns:Se,rows:F,rowKey:e=>e.id,reading:!1,next:null,onMore:$,noun:`runs`,onSelect:e=>void P(`/runs/${e.id}`)})})}),(0,B.jsx)(Q,{title:`Needs a look`,to:`/runs`,children:(0,B.jsx)(a,{loading:!i.read||!o.read,problem:i.problem??o.problem,empty:I.length===0,emptyMessage:`Nothing has failed or finished with errors.`,children:(0,B.jsx)(l,{chrome:{footer:!1},columns:N,rows:I,rowKey:e=>e.run.id,reading:!1,next:null,onMore:$,noun:`runs`,onSelect:e=>void P(`/runs/${e.run.id}`)})})}),(0,B.jsx)(Q,{title:`Next fires`,to:`/triggers`,children:(0,B.jsx)(a,{loading:!u.read,problem:u.problem,empty:L.length===0,emptyMessage:`No schedule is due to fire.`,children:(0,B.jsx)(l,{chrome:{footer:!1},columns:Ce,rows:L,rowKey:e=>`${e.pipeline}:${e.schedule.code}`,reading:!1,next:null,onMore:$,noun:`firings`,onSelect:e=>void P(`/pipelines/${encodeURIComponent(e.pipeline)}`)})})})]})}function Q({title:e,to:t,children:n}){return(0,B.jsxs)(`section`,{className:`mb-6 space-y-2 last:mb-0`,children:[(0,B.jsx)(`div`,{className:`space-y-1`,children:(0,B.jsx)(`h2`,{className:`text-sm font-semibold`,children:(0,B.jsx)(r,{to:t,className:`hover:text-primary`,children:e})})}),n]})}var $=()=>{},Se=[{id:`status`,header:`Status`,cell:e=>(0,B.jsx)(v,{status:e.status})},{id:`pipeline`,header:`Pipeline`,cell:e=>(0,B.jsx)(`span`,{className:`font-mono text-sm`,children:g({code:e.pipeline}).title})},{id:`since`,header:`Since`,className:`text-right`,cell:e=>(0,B.jsx)(j,{className:`text-xs text-faint`,at:e.started_at??e.created_at})}],Ce=[{id:`pipeline`,header:`Pipeline`,cell:e=>(0,B.jsx)(`span`,{className:`font-mono text-sm`,children:g({code:e.pipeline}).title})},{id:`schedule`,header:`Schedule`,cell:e=>{let t=g(e.schedule);return(0,B.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,B.jsx)(`span`,{className:d(`truncate text-xs`,t.named?`text-foreground`:`font-mono`),children:t.title}),t.code!==null&&(0,B.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:t.code})]})}},{id:`fires`,header:`Fires`,className:`text-right`,cell:e=>(0,B.jsx)(j,{className:`text-xs text-faint`,at:e.at})}];export{xe as Dashboard};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{n}from"./PageState-CGVhOaOE.js";import{r,t as i}from"./utils-CT7ZGLfR.js";import{f as a}from"./paging-CpRIkEky.js";import{t as o}from"./identity-BNZxCf_y.js";import{T as s,_ as c,it as l}from"./index-DBX30PmL.js";import{t as u}from"./Description-MmXUnb-9.js";import{n as d,r as f}from"./Panel-CqrOYByl.js";import{t as p}from"./badge-BovCxjd1.js";import{t as m}from"./WindowedPane-DJe_7m8A.js";import{f as h,n as g,u as _}from"./examples-vNFNdfIm.js";import{t as v}from"./starters-CgC7I45V.js";var y=e(t(),1),b=r(),x=`The document`,S={connection:`connection`,schema:`schema`,block:`block`,pipeline:`pipeline`,storage:`storage`,worker:`worker tag`};function C({example:e,holdings:t,onUse:r}){let C=e.code,E=c((0,y.useCallback)(()=>_(C),[C])),D=o(e),O=(0,y.useMemo)(()=>h(e.requires,t),[e.requires,t]),k=g(e),A=e.tags.filter(e=>e!==v),j=E.value?.source??``;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,b.jsxs)(`div`,{className:`space-y-1`,children:[(0,b.jsx)(`h2`,{className:i(`text-sm font-semibold`,!D.named&&`font-mono`),children:D.title}),D.code!==null&&(0,b.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:D.code}),(e.starter||k!==null)&&(0,b.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[e.starter&&(0,b.jsx)(p,{variant:`outline`,children:`Starter`}),k!==null&&(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:k})]}),(0,b.jsx)(u,{text:e.description})]}),A.length>0&&(0,b.jsx)(`p`,{className:`flex flex-wrap items-center gap-1`,children:A.map(e=>(0,b.jsx)(s,{tag:e},e))}),(0,b.jsx)(f,{title:`Facts`,children:(0,b.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,b.jsx)(d,{term:`plugin`,detail:e.plugin}),(0,b.jsx)(d,{term:`shelf`,detail:e.shelf===``?`the root`:e.shelf}),E.value!==null&&(0,b.jsx)(d,{term:`path`,detail:(0,b.jsx)(`span`,{className:`font-mono break-all`,children:E.value.path})})]})}),(0,b.jsx)(f,{title:`Requires`,children:O.length===0?(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This document requires nothing in particular of an instance.`}):(0,b.jsx)(`ul`,{className:`space-y-1 text-xs`,children:O.map(e=>(0,b.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,b.jsx)(`span`,{className:`text-faint`,children:S[e.kind]}),(0,b.jsx)(`span`,{className:`font-mono break-all`,children:e.name}),(0,b.jsx)(`span`,{className:i(`ml-auto shrink-0`,T(e)),children:w(e)})]},`${e.kind}:${e.name}`))})}),(0,b.jsx)(f,{title:`Source`,children:!E.read||E.problem!==null?(0,b.jsx)(n,{loading:!E.read,problem:E.problem,empty:!1,children:null}):(0,b.jsx)(m,{name:x,className:`overflow-hidden rounded-md border border-border`,windowed:(0,b.jsx)(l,{value:j,path:`example-${C}-window`,label:`${x}, in a window`,className:`min-h-0 flex-1`,readOnly:!0}),children:(0,b.jsx)(l,{value:j,path:`example-${C}`,label:x,className:`h-72 min-h-40`,readOnly:!0})})}),e.starter&&(0,b.jsx)(a,{size:`sm`,className:`self-start`,disabled:E.value===null,onClick:()=>{r(j,C)},children:`Use as starter`})]})}function w(e){return e.met===null?`not checked`:e.met?`here`:`missing`}function T(e){return e.met===null?`text-faint`:e.met?`text-good`:`text-critical`}export{C as ExamplePanel};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{n}from"./PageState-CGVhOaOE.js";import{r,t as i}from"./utils-CT7ZGLfR.js";import{f as a}from"./paging-CpRIkEky.js";import{t as o}from"./identity-BNZxCf_y.js";import{T as s,_ as c,it as l}from"./index-MYZXi-9R.js";import{t as u}from"./Description-MmXUnb-9.js";import{n as d,r as f}from"./Panel-CqrOYByl.js";import{t as p}from"./badge-BovCxjd1.js";import{t as m}from"./WindowedPane-CZpOBqK6.js";import{f as h,n as g,u as _}from"./examples-DDWkSZ2u.js";import{t as v}from"./starters-CgC7I45V.js";var y=e(t(),1),b=r(),x=`The document`,S={connection:`connection`,schema:`schema`,block:`block`,pipeline:`pipeline`,storage:`storage`,worker:`worker tag`};function C({example:e,holdings:t,onUse:r}){let C=e.code,E=c((0,y.useCallback)(()=>_(C),[C])),D=o(e),O=(0,y.useMemo)(()=>h(e.requires,t),[e.requires,t]),k=g(e),A=e.tags.filter(e=>e!==v),j=E.value?.source??``;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,b.jsxs)(`div`,{className:`space-y-1`,children:[(0,b.jsx)(`h2`,{className:i(`text-sm font-semibold`,!D.named&&`font-mono`),children:D.title}),D.code!==null&&(0,b.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:D.code}),(e.starter||k!==null)&&(0,b.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[e.starter&&(0,b.jsx)(p,{variant:`outline`,children:`Starter`}),k!==null&&(0,b.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:k})]}),(0,b.jsx)(u,{text:e.description})]}),A.length>0&&(0,b.jsx)(`p`,{className:`flex flex-wrap items-center gap-1`,children:A.map(e=>(0,b.jsx)(s,{tag:e},e))}),(0,b.jsx)(f,{title:`Facts`,children:(0,b.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,b.jsx)(d,{term:`plugin`,detail:e.plugin}),(0,b.jsx)(d,{term:`shelf`,detail:e.shelf===``?`the root`:e.shelf}),E.value!==null&&(0,b.jsx)(d,{term:`path`,detail:(0,b.jsx)(`span`,{className:`font-mono break-all`,children:E.value.path})})]})}),(0,b.jsx)(f,{title:`Requires`,children:O.length===0?(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This document requires nothing in particular of an instance.`}):(0,b.jsx)(`ul`,{className:`space-y-1 text-xs`,children:O.map(e=>(0,b.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,b.jsx)(`span`,{className:`text-faint`,children:S[e.kind]}),(0,b.jsx)(`span`,{className:`font-mono break-all`,children:e.name}),(0,b.jsx)(`span`,{className:i(`ml-auto shrink-0`,T(e)),children:w(e)})]},`${e.kind}:${e.name}`))})}),(0,b.jsx)(f,{title:`Source`,children:!E.read||E.problem!==null?(0,b.jsx)(n,{loading:!E.read,problem:E.problem,empty:!1,children:null}):(0,b.jsx)(m,{name:x,className:`overflow-hidden rounded-md border border-border`,windowed:(0,b.jsx)(l,{value:j,path:`example-${C}-window`,label:`${x}, in a window`,className:`min-h-0 flex-1`,readOnly:!0}),children:(0,b.jsx)(l,{value:j,path:`example-${C}`,label:x,className:`h-72 min-h-40`,readOnly:!0})})}),e.starter&&(0,b.jsx)(a,{size:`sm`,className:`self-start`,disabled:E.value===null,onClick:()=>{r(j,C)},children:`Use as starter`})]})}function w(e){return e.met===null?`not checked`:e.met?`here`:`missing`}function T(e){return e.met===null?`text-faint`:e.met?`text-good`:`text-critical`}export{C as ExamplePanel};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExamplePanel-D3yktwnO.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/react-CQOZoUwg.js","assets/PageState-CGVhOaOE.js","assets/with-selector-BXYKoaOE.js","assets/dropdown-menu-B-6CcHKw.js","assets/api-Bm1JZLuC.js","assets/utils-CT7ZGLfR.js","assets/paging-CpRIkEky.js","assets/identity-BNZxCf_y.js","assets/index-DBX30PmL.js","assets/dist-DD8kpv1W.js","assets/preload-helper-BZ1Pz5am.js","assets/chunk-OB3PAWPO-DOp4K52_.js","assets/nav-i7bJ0lrA.js","assets/play-CPVSEWx6.js","assets/file-braces-Ep8AP5Yq.js","assets/chevron-down-DAO3SUWv.js","assets/ListTable-BykeouTl.js","assets/docs-CCoB3shg.js","assets/x-Dltw6Vbs.js","assets/tooltip-D7_KwbOU.js","assets/input-1fShkFXn.js","assets/textarea-ljIbN_md.js","assets/use-store-CfRquqZF.js","assets/store-C2zgoyrT.js","assets/auth-CHgfcdt9.js","assets/format-B5YbYOY-.js","assets/status-Ctx8x8Mf.js","assets/use-heartbeat-CBT8848s.js","assets/pipelines-DaeuXRxg.js","assets/index-Cf-yM9K1.css","assets/Description-MmXUnb-9.js","assets/Panel-CqrOYByl.js","assets/copy-BeBwg8IR.js","assets/badge-BovCxjd1.js","assets/WindowedPane-DJe_7m8A.js","assets/maximize-2-BdFIT4cn.js","assets/examples-vNFNdfIm.js","assets/blocks-CclbVd8c.js","assets/connections-BuMoMUFi.js","assets/schemas-7KY_7aIc.js","assets/starters-CgC7I45V.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./preload-helper-BZ1Pz5am.js";import{c as r,u as i}from"./chunk-OB3PAWPO-DOp4K52_.js";import{n as a}from"./nav-i7bJ0lrA.js";import{n as o,t as s}from"./PageState-CGVhOaOE.js";import{r as c,t as l}from"./ListTable-BykeouTl.js";import{r as u,t as d}from"./utils-CT7ZGLfR.js";import{t as f}from"./input-1fShkFXn.js";import{n as p,t as m}from"./identity-BNZxCf_y.js";import{$ as h,Ft as ee,Lt as g,T as _,_ as v,ct as y,et as b,ft as x,g as S,ot as C,pt as w,w as te,x as T}from"./index-DBX30PmL.js";import{t as E}from"./badge-BovCxjd1.js";import{_ as D,a as O,c as k,d as A,f as j,h as M,i as N,l as P,n as F,o as I,p as L,s as R,t as z}from"./examples-vNFNdfIm.js";import{n as B,t as V}from"./starters-CgC7I45V.js";import{t as H}from"./Segmented-u0lpCZgQ.js";var U=e(t(),1),W=u(),G=(0,U.lazy)(()=>n(()=>import(`./ExamplePanel-D3yktwnO.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]))),K=`example`,q=()=>{},J=e=>e.code,Y=[{value:`all`,label:`All`},{value:`starters`,label:`Starters`}];function X(){let e=r(),[t,n]=i(),[u,d]=(0,U.useState)(null),p=(0,U.useMemo)(()=>N(t),[t]),m=(0,U.useCallback)(e=>{n(k(e),{replace:!0})},[n]),T=v(P),E=v(A),O=(0,U.useMemo)(()=>E.value??{blocks:null,connections:null,schemas:null},[E.value]),j=(0,U.useMemo)(()=>T.value??[],[T.value]),F=(0,U.useMemo)(()=>I(j,p),[p,j]),L=(0,U.useMemo)(()=>M(j),[j]),V=(0,U.useMemo)(()=>R(j),[j]),X=(0,U.useMemo)(()=>D(j),[j]),Q=(0,U.useCallback)(e=>{p.tags.includes(e)||m({...p,tags:[...p.tags,e]})},[m,p]),re=(0,U.useMemo)(()=>ne(O,V,Q),[Q,O,V]),$=(0,U.useCallback)((t,n)=>{e(a,{state:{document:B(t,n)}})},[e]);return(0,U.useEffect)(()=>(b({note:null,tone:`quiet`,identifier:null}),h),[j.length]),(0,U.useEffect)(()=>w([{id:`examples:starters`,title:`Show only the starters`,group:x,screen:!0,icon:g,keywords:[`starter`,`copy`,`new`],run:()=>{m({...p,starters:!0})}},{id:`examples:clear`,title:`Clear the filters on the examples listing`,group:x,screen:!0,icon:ee,keywords:[`reset`,`all`],run:()=>{m({needle:``,tags:[],shelf:``,plugin:``,starters:!1,block:``})}}]),[m,p]),(0,U.useEffect)(()=>{if(u!==null)return C([{id:K,label:`Example`,render:()=>(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(G,{example:u,holdings:O,onUse:$},u.code)})}],{screen:`examples`})},[u,O,$]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(s,{title:`Examples`,aside:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(c,{tag:`examples`}),F.length!==j.length&&(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[String(F.length),` of `,String(j.length)]})]})}),(0,W.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(f,{className:`w-56`,value:p.needle,onChange:e=>{m({...p,needle:e.target.value})},placeholder:`Search examples`,"aria-label":`Search examples by code, name, description or tag`}),(0,W.jsx)(H,{label:`Which documents`,value:p.starters?`starters`:`all`,options:Y,onChoose:e=>{m({...p,starters:e===`starters`})}}),(0,W.jsx)(te,{chosen:p.tags,offered:X,onChange:e=>{m({...p,tags:e})}}),(0,W.jsx)(S,{label:`Shelf`,value:p.shelf,anything:`Any shelf`,options:L.map(e=>({value:e,label:e})),onChange:e=>{m({...p,shelf:e===``?``:e})}}),V.length>1&&(0,W.jsx)(S,{label:`Plugin`,value:p.plugin,anything:`Any plugin`,options:V.map(e=>({value:e,label:e})),onChange:e=>{m({...p,plugin:e===``?``:e})}}),p.block!==``&&(0,W.jsx)(_,{tag:p.block,label:`Stop narrowing to ${p.block}`,onSelect:()=>{m({...p,block:``})}})]}),(0,W.jsx)(o,{loading:!T.read,problem:T.problem,empty:F.length===0,emptyMessage:j.length===0?`No examples installed — plugins contribute them.`:z(p)?`Nothing in the corpus matches that.`:`No examples.`,children:(0,W.jsx)(l,{columns:re,rows:F,rowKey:J,reading:!1,next:null,onMore:q,noun:`examples`,onSelect:e=>{d(e),y(K)},selected:e=>e.code===u?.code})})]})}function Z(){return(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsx)(o,{loading:!0,problem:null,empty:!1,children:null})})}function ne(e,t,n){return[{id:`example`,header:`Example`,className:`w-full max-w-0`,cell:e=>{let t=m(e),n=F(e);return(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:d(`truncate font-semibold`,`max-lg:overflow-visible max-lg:whitespace-normal`,!t.named&&`font-mono`),title:t.title,children:t.title}),e.starter&&(0,W.jsx)(E,{variant:`outline`,className:`shrink-0`,children:`Starter`}),n!==null&&(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,title:`An instance refuses a document that carries these, so a copy names them under requires instead.`,children:n})]}),(0,W.jsxs)(`p`,{className:`flex items-center gap-2 text-xs`,children:[t.code!==null&&(0,W.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:t.code}),e.description!==null&&(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:p(e.description),children:p(e.description)})]})]})}},{id:`tags`,header:`Tags`,cell:e=>(0,W.jsx)(T,{tags:e.tags.filter(e=>e!==V),onSelect:n})},{id:`requires`,header:`Requires`,className:`whitespace-nowrap`,cell:t=>(0,W.jsx)(Q,{example:t,holdings:e})},...t.length>1?[{id:`plugin`,header:`Plugin`,className:`w-32 font-mono text-xs whitespace-nowrap`,cell:e=>(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]:[]]}function Q({example:e,holdings:t}){let n=j(e.requires,t),r=L(n);if(r===null)return null;let i=O(n);return(0,W.jsx)(`span`,{className:d(`text-xs`,i===0?`text-muted-foreground`:`text-critical`),children:r})}export{X as Examples};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExamplePanel-CRFoKDQb.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/react-CQOZoUwg.js","assets/PageState-CGVhOaOE.js","assets/with-selector-BXYKoaOE.js","assets/dropdown-menu-B-6CcHKw.js","assets/api-Bm1JZLuC.js","assets/utils-CT7ZGLfR.js","assets/paging-CpRIkEky.js","assets/identity-BNZxCf_y.js","assets/index-MYZXi-9R.js","assets/dist-DD8kpv1W.js","assets/preload-helper-BZ1Pz5am.js","assets/chunk-OB3PAWPO-DOp4K52_.js","assets/nav-i7bJ0lrA.js","assets/play-CPVSEWx6.js","assets/file-braces-Ep8AP5Yq.js","assets/chevron-down-DAO3SUWv.js","assets/ListTable-BykeouTl.js","assets/docs-CCoB3shg.js","assets/x-Dltw6Vbs.js","assets/tooltip-D7_KwbOU.js","assets/input-1fShkFXn.js","assets/textarea-ljIbN_md.js","assets/use-store-CfRquqZF.js","assets/store-C2zgoyrT.js","assets/auth-CHgfcdt9.js","assets/format-B5YbYOY-.js","assets/status-Ctx8x8Mf.js","assets/use-heartbeat-CBT8848s.js","assets/pipelines-Pi3WL8R6.js","assets/index-BDhFNSYw.css","assets/Description-MmXUnb-9.js","assets/Panel-CqrOYByl.js","assets/copy-BeBwg8IR.js","assets/badge-BovCxjd1.js","assets/WindowedPane-CZpOBqK6.js","assets/maximize-2-BdFIT4cn.js","assets/examples-DDWkSZ2u.js","assets/blocks-CclbVd8c.js","assets/connections-DsdoSARb.js","assets/schemas-7KY_7aIc.js","assets/starters-CgC7I45V.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./preload-helper-BZ1Pz5am.js";import{c as r,u as i}from"./chunk-OB3PAWPO-DOp4K52_.js";import{n as a}from"./nav-i7bJ0lrA.js";import{n as o,t as s}from"./PageState-CGVhOaOE.js";import{r as c,t as l}from"./ListTable-BykeouTl.js";import{r as u,t as d}from"./utils-CT7ZGLfR.js";import{t as f}from"./input-1fShkFXn.js";import{n as p,t as m}from"./identity-BNZxCf_y.js";import{$ as h,It as ee,Rt as g,T as _,_ as v,ct as y,et as b,ft as x,g as S,ot as C,pt as w,w as te,x as T}from"./index-MYZXi-9R.js";import{t as E}from"./badge-BovCxjd1.js";import{_ as D,a as O,c as k,d as A,f as j,h as M,i as N,l as P,n as F,o as I,p as L,s as R,t as z}from"./examples-DDWkSZ2u.js";import{n as B,t as V}from"./starters-CgC7I45V.js";import{t as H}from"./Segmented-KaDiGiyr.js";var U=e(t(),1),W=u(),G=(0,U.lazy)(()=>n(()=>import(`./ExamplePanel-CRFoKDQb.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]))),K=`example`,q=()=>{},J=e=>e.code,Y=[{value:`all`,label:`All`},{value:`starters`,label:`Starters`}];function X(){let e=r(),[t,n]=i(),[u,d]=(0,U.useState)(null),p=(0,U.useMemo)(()=>N(t),[t]),m=(0,U.useCallback)(e=>{n(k(e),{replace:!0})},[n]),T=v(P),E=v(A),O=(0,U.useMemo)(()=>E.value??{blocks:null,connections:null,schemas:null},[E.value]),j=(0,U.useMemo)(()=>T.value??[],[T.value]),F=(0,U.useMemo)(()=>I(j,p),[p,j]),L=(0,U.useMemo)(()=>M(j),[j]),V=(0,U.useMemo)(()=>R(j),[j]),X=(0,U.useMemo)(()=>D(j),[j]),Q=(0,U.useCallback)(e=>{p.tags.includes(e)||m({...p,tags:[...p.tags,e]})},[m,p]),re=(0,U.useMemo)(()=>ne(O,V,Q),[Q,O,V]),$=(0,U.useCallback)((t,n)=>{e(a,{state:{document:B(t,n)}})},[e]);return(0,U.useEffect)(()=>(b({note:null,tone:`quiet`,identifier:null}),h),[j.length]),(0,U.useEffect)(()=>w([{id:`examples:starters`,title:`Show only the starters`,group:x,screen:!0,icon:g,keywords:[`starter`,`copy`,`new`],run:()=>{m({...p,starters:!0})}},{id:`examples:clear`,title:`Clear the filters on the examples listing`,group:x,screen:!0,icon:ee,keywords:[`reset`,`all`],run:()=>{m({needle:``,tags:[],shelf:``,plugin:``,starters:!1,block:``})}}]),[m,p]),(0,U.useEffect)(()=>{if(u!==null)return C([{id:K,label:`Example`,render:()=>(0,W.jsx)(U.Suspense,{fallback:(0,W.jsx)(Z,{}),children:(0,W.jsx)(G,{example:u,holdings:O,onUse:$},u.code)})}],{screen:`examples`})},[u,O,$]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(s,{title:`Examples`,aside:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(c,{tag:`examples`}),F.length!==j.length&&(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[String(F.length),` of `,String(j.length)]})]})}),(0,W.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(f,{className:`w-56`,value:p.needle,onChange:e=>{m({...p,needle:e.target.value})},placeholder:`Search examples`,"aria-label":`Search examples by code, name, description or tag`}),(0,W.jsx)(H,{label:`Which documents`,value:p.starters?`starters`:`all`,options:Y,onChoose:e=>{m({...p,starters:e===`starters`})}}),(0,W.jsx)(te,{chosen:p.tags,offered:X,onChange:e=>{m({...p,tags:e})}}),(0,W.jsx)(S,{label:`Shelf`,value:p.shelf,anything:`Any shelf`,options:L.map(e=>({value:e,label:e})),onChange:e=>{m({...p,shelf:e===``?``:e})}}),V.length>1&&(0,W.jsx)(S,{label:`Plugin`,value:p.plugin,anything:`Any plugin`,options:V.map(e=>({value:e,label:e})),onChange:e=>{m({...p,plugin:e===``?``:e})}}),p.block!==``&&(0,W.jsx)(_,{tag:p.block,label:`Stop narrowing to ${p.block}`,onSelect:()=>{m({...p,block:``})}})]}),(0,W.jsx)(o,{loading:!T.read,problem:T.problem,empty:F.length===0,emptyMessage:j.length===0?`No examples installed — plugins contribute them.`:z(p)?`Nothing in the corpus matches that.`:`No examples.`,children:(0,W.jsx)(l,{columns:re,rows:F,rowKey:J,reading:!1,next:null,onMore:q,noun:`examples`,onSelect:e=>{d(e),y(K)},selected:e=>e.code===u?.code})})]})}function Z(){return(0,W.jsx)(`div`,{className:`p-4`,children:(0,W.jsx)(o,{loading:!0,problem:null,empty:!1,children:null})})}function ne(e,t,n){return[{id:`example`,header:`Example`,className:`w-full max-w-0`,cell:e=>{let t=m(e),n=F(e);return(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:d(`truncate font-semibold`,`max-lg:overflow-visible max-lg:whitespace-normal`,!t.named&&`font-mono`),title:t.title,children:t.title}),e.starter&&(0,W.jsx)(E,{variant:`outline`,className:`shrink-0`,children:`Starter`}),n!==null&&(0,W.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,title:`An instance refuses a document that carries these, so a copy names them under requires instead.`,children:n})]}),(0,W.jsxs)(`p`,{className:`flex items-center gap-2 text-xs`,children:[t.code!==null&&(0,W.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:t.code}),e.description!==null&&(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:p(e.description),children:p(e.description)})]})]})}},{id:`tags`,header:`Tags`,cell:e=>(0,W.jsx)(T,{tags:e.tags.filter(e=>e!==V),onSelect:n})},{id:`requires`,header:`Requires`,className:`whitespace-nowrap`,cell:t=>(0,W.jsx)(Q,{example:t,holdings:e})},...t.length>1?[{id:`plugin`,header:`Plugin`,className:`w-32 font-mono text-xs whitespace-nowrap`,cell:e=>(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]:[]]}function Q({example:e,holdings:t}){let n=j(e.requires,t),r=L(n);if(r===null)return null;let i=O(n);return(0,W.jsx)(`span`,{className:d(`text-xs`,i===0?`text-muted-foreground`:`text-critical`),children:r})}export{X as Examples};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./maximize-2-BdFIT4cn.js";import{r,t as i}from"./utils-CT7ZGLfR.js";import{f as a}from"./paging-CpRIkEky.js";import{Dt as o,Nt as s,it as c,kt as l}from"./index-DBX30PmL.js";var u=e(t(),1),d=r();function f({title:e,text:t,mediaType:r,path:i}){let[f,p]=(0,u.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a,{variant:`ghost`,size:`icon`,"aria-label":`Open ${e} in a window`,className:`absolute top-1.5 right-3.5 size-6 rounded-md border border-border bg-background/90 text-faint`,onClick:()=>{p(!0)},children:(0,d.jsx)(n,{className:`size-3.5`,"aria-hidden":!0})}),(0,d.jsx)(o,{open:f,onOpenChange:p,children:(0,d.jsxs)(l,{finalFocus:!1,className:`flex h-[85vh] w-[min(64rem,90vw)] max-w-[min(64rem,90vw)] flex-col gap-3 sm:max-w-[min(64rem,90vw)]`,children:[(0,d.jsx)(s,{className:`font-mono text-sm`,children:e}),(0,d.jsx)(c,{value:t,mediaType:r,path:i,label:e,readOnly:!0,className:`min-h-0 flex-1`})]})})]})}var p=/("(?:[^"\\]|\\.)*")(\s*:)?|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(true|false|null)/g;function m(e){let t=[],n=0;for(let r of e.matchAll(p)){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 h={key:`text-info-ink`,string:`text-good-ink`,number:`text-warning-ink`,literal:`text-warning-ink`,punctuation:`text-muted-foreground`};function g({title:e,text:t,className:n}){let r=(0,u.useMemo)(()=>m(t),[t]);return(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(`pre`,{className:i(`overflow-auto rounded-lg border border-border bg-background p-2 font-mono text-xs`,n),children:r.map((e,t)=>(0,d.jsx)(`span`,{className:h[e.kind],children:e.text},t))}),(0,d.jsx)(f,{title:e,text:t,mediaType:`application/json`,path:`window/${e}`})]})}export{g as t};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./maximize-2-BdFIT4cn.js";import{r,t as i}from"./utils-CT7ZGLfR.js";import{f as a}from"./paging-CpRIkEky.js";import{At as o,Ot as s,Pt as c,it as l}from"./index-MYZXi-9R.js";var u=e(t(),1),d=r();function f({title:e,text:t,mediaType:r,path:i}){let[f,p]=(0,u.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a,{variant:`ghost`,size:`icon`,"aria-label":`Open ${e} in a window`,className:`absolute top-1.5 right-3.5 size-6 rounded-md border border-border bg-background/90 text-faint`,onClick:()=>{p(!0)},children:(0,d.jsx)(n,{className:`size-3.5`,"aria-hidden":!0})}),(0,d.jsx)(s,{open:f,onOpenChange:p,children:(0,d.jsxs)(o,{finalFocus:!1,className:`flex h-[85vh] w-[min(64rem,90vw)] max-w-[min(64rem,90vw)] flex-col gap-3 sm:max-w-[min(64rem,90vw)]`,children:[(0,d.jsx)(c,{className:`font-mono text-sm`,children:e}),(0,d.jsx)(l,{value:t,mediaType:r,path:i,label:e,readOnly:!0,className:`min-h-0 flex-1`})]})})]})}var p=/("(?:[^"\\]|\\.)*")(\s*:)?|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(true|false|null)/g;function m(e){let t=[],n=0;for(let r of e.matchAll(p)){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 h={key:`text-info-ink`,string:`text-good-ink`,number:`text-warning-ink`,literal:`text-warning-ink`,punctuation:`text-muted-foreground`};function g({title:e,text:t,className:n}){let r=(0,u.useMemo)(()=>m(t),[t]);return(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(`pre`,{className:i(`overflow-auto rounded-lg border border-border bg-background p-2 font-mono text-xs`,n),children:r.map((e,t)=>(0,d.jsx)(`span`,{className:h[e.kind],children:e.text},t))}),(0,d.jsx)(f,{title:e,text:t,mediaType:`application/json`,path:`window/${e}`})]})}export{g as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./utils-CT7ZGLfR.js";var t=e();function n({glyph:e}){return(0,t.jsx)(e,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0,"data-slot":`mark`})}export{n as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{c as n}from"./chunk-OB3PAWPO-DOp4K52_.js";import{n as r,t as i}from"./PageState-CGVhOaOE.js";import{r as a,t as o}from"./ListTable-BykeouTl.js";import{r as s}from"./utils-CT7ZGLfR.js";import{t as c}from"./use-store-CfRquqZF.js";import{t as l}from"./use-heartbeat-CBT8848s.js";import{d as u}from"./pipelines-DaeuXRxg.js";import{$ as d,Ft as f,_ as p,et as m,l as h,m as g,pt as _,t as v,ut as y,v as b}from"./index-DBX30PmL.js";import{u as x}from"./connections-BuMoMUFi.js";import{a as S,c as ee,d as C,f as w,l as T,n as E,o as D,p as O,r as k,s as A,u as j}from"./TileCard-gP1CtcIG.js";import{a as M}from"./workers-BH2Za19E.js";import{t as N}from"./AdminOnly-922QAPCr.js";import{t as P}from"./WorkersTable-CSwkoqDd.js";var F=e(t(),1),I=s(),L=e=>e.id,R=()=>{};function z(){return(0,I.jsx)(N,{children:(0,I.jsx)(B,{})})}function B(){let e=p((0,F.useCallback)(()=>h({...v,since:`24h`},null,500),[])),t=p((0,F.useCallback)(()=>h({...v,status:`failed`},null),[])),s=p((0,F.useCallback)(()=>h({...v,status:`completed_with_errors`},null),[])),N=p((0,F.useCallback)(()=>x(null),[])),z=p((0,F.useCallback)(()=>u(null,[],500),[])),B=b((0,F.useCallback)(e=>M(e),[]),L),{again:V,value:H,problem:U,read:W}=e,{again:G}=t,{again:K}=s,{again:q}=N,{again:J}=z,{reload:Y}=B,X=(0,F.useCallback)(()=>{V(),G(),K(),q(),J(),Y()},[q,V,G,K,J,Y]),Z=n();l(X,c(g)),(0,F.useEffect)(()=>(m({note:null,tone:`quiet`,identifier:null}),d),[]),(0,F.useEffect)(()=>_([{id:`admin:reload`,title:`Refresh the overview`,group:y,screen:!0,icon:f,keywords:[`refresh`,`reload`,`dashboard`],run:X}]),[X]);let Q=[{id:`day`,tile:H===null?null:D(H)},{id:`now`,tile:H===null?null:ee(H)},{id:`workers`,tile:B.state.read?C({items:B.state.rows,next:B.state.next}):null},{id:`connections`,tile:N.value===null?null:S(N.value)},{id:`schedules`,tile:z.value===null?null:T(z.value)}],$=j(A(t.value?.items??[],s.value?.items??[]),z.value?.items??[]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(i,{title:`Overview`,aside:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{tag:`system`}),(0,I.jsx)(O,{onRefresh:X})]})}),(0,I.jsx)(`div`,{className:`mb-6 grid gap-3 sm:grid-cols-2 xl:grid-cols-5`,children:Q.map(e=>e.tile===null?(0,I.jsx)(k,{},e.id):(0,I.jsx)(E,{tile:e.tile},e.id))}),W&&U!==null&&(0,I.jsx)(r,{loading:!1,problem:U,empty:!1,children:null}),(0,I.jsxs)(`section`,{className:`mb-6 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Needs a look`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every run that failed or finished with errors, newest first.`})]}),(0,I.jsx)(r,{loading:!t.read||!s.read,problem:t.problem??s.problem,empty:$.length===0,emptyMessage:`Nothing has failed or finished with errors.`,children:(0,I.jsx)(o,{chrome:{footer:!1},columns:w,rows:$,rowKey:e=>e.run.id,reading:!1,next:null,onMore:R,noun:`runs`,onSelect:e=>void Z(`/runs/${e.run.id}`)})})]}),(0,I.jsxs)(`section`,{className:`space-y-2`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Workers`}),(0,I.jsx)(P,{state:B.state,more:B.more,empty:`No workers. Start one with dg worker; nothing is claimed until one registers.`})]})]})}export{z as AdminOverview};
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{c as n}from"./chunk-OB3PAWPO-DOp4K52_.js";import{n as r,t as i}from"./PageState-CGVhOaOE.js";import{r as a,t as o}from"./ListTable-BykeouTl.js";import{r as s}from"./utils-CT7ZGLfR.js";import{t as c}from"./use-store-CfRquqZF.js";import{t as l}from"./use-heartbeat-CBT8848s.js";import{m as u}from"./pipelines-Pi3WL8R6.js";import{$ as d,It as f,_ as p,et as m,l as h,m as g,pt as _,t as v,ut as y,v as b}from"./index-MYZXi-9R.js";import{f as x}from"./connections-DsdoSARb.js";import{a as S,c as ee,d as C,f as w,l as T,n as E,o as D,p as O,r as k,s as A,u as j}from"./TileCard-CkZS_VSw.js";import{a as M}from"./workers-BH2Za19E.js";import{t as N}from"./AdminOnly-922QAPCr.js";import{t as P}from"./WorkersTable-CBWZYznS.js";var F=e(t(),1),I=s(),L=e=>e.id,R=()=>{};function z(){return(0,I.jsx)(N,{children:(0,I.jsx)(B,{})})}function B(){let e=p((0,F.useCallback)(()=>h({...v,since:`24h`},null,500),[])),t=p((0,F.useCallback)(()=>h({...v,status:`failed`},null),[])),s=p((0,F.useCallback)(()=>h({...v,status:`completed_with_errors`},null),[])),N=p((0,F.useCallback)(()=>x(null),[])),z=p((0,F.useCallback)(()=>u(null,[],500),[])),B=b((0,F.useCallback)(e=>M(e),[]),L),{again:V,value:H,problem:U,read:W}=e,{again:G}=t,{again:K}=s,{again:q}=N,{again:J}=z,{reload:Y}=B,X=(0,F.useCallback)(()=>{V(),G(),K(),q(),J(),Y()},[q,V,G,K,J,Y]),Z=n();l(X,c(g)),(0,F.useEffect)(()=>(m({note:null,tone:`quiet`,identifier:null}),d),[]),(0,F.useEffect)(()=>_([{id:`admin:reload`,title:`Refresh the overview`,group:y,screen:!0,icon:f,keywords:[`refresh`,`reload`,`dashboard`],run:X}]),[X]);let Q=[{id:`day`,tile:H===null?null:D(H)},{id:`now`,tile:H===null?null:ee(H)},{id:`workers`,tile:B.state.read?C({items:B.state.rows,next:B.state.next}):null},{id:`connections`,tile:N.value===null?null:S(N.value)},{id:`schedules`,tile:z.value===null?null:T(z.value)}],$=j(A(t.value?.items??[],s.value?.items??[]),z.value?.items??[]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(i,{title:`Overview`,aside:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{tag:`system`}),(0,I.jsx)(O,{onRefresh:X})]})}),(0,I.jsx)(`div`,{className:`mb-6 grid gap-3 sm:grid-cols-2 xl:grid-cols-5`,children:Q.map(e=>e.tile===null?(0,I.jsx)(k,{},e.id):(0,I.jsx)(E,{tile:e.tile},e.id))}),W&&U!==null&&(0,I.jsx)(r,{loading:!1,problem:U,empty:!1,children:null}),(0,I.jsxs)(`section`,{className:`mb-6 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Needs a look`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every run that failed or finished with errors, newest first.`})]}),(0,I.jsx)(r,{loading:!t.read||!s.read,problem:t.problem??s.problem,empty:$.length===0,emptyMessage:`Nothing has failed or finished with errors.`,children:(0,I.jsx)(o,{chrome:{footer:!1},columns:w,rows:$,rowKey:e=>e.run.id,reading:!1,next:null,onMore:R,noun:`runs`,onSelect:e=>void Z(`/runs/${e.run.id}`)})})]}),(0,I.jsxs)(`section`,{className:`space-y-2`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Workers`}),(0,I.jsx)(P,{state:B.state,more:B.more,empty:`No workers. Start one with dg worker; nothing is claimed until one registers.`})]})]})}export{z as AdminOverview};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{i as n}from"./with-selector-BXYKoaOE.js";import{$ as r,$n as i,$t as a,Ar as o,Br as s,Dr as c,Er as l,Et as u,Fn as d,Fr as ee,Gn as f,Ir as p,J as m,Jt as h,K as g,Ln as _,Mr as v,N as y,Nr as b,O as te,Pr as x,Q as S,Qt as C,Rn as w,Sn as ne,St as T,Xt as E,Yt as re,Z as ie,_n as ae,an as D,bn as oe,d as O,dt as se,en as k,er as ce,f as A,fr as le,ft as ue,gn as de,hn as fe,in as pe,k as me,ln as he,lt as j,m as ge,mn as M,on as _e,ot as ve,pn as ye,rn as N,sn as be,sr as xe,tr as Se,vn as Ce,w as we,wr as Te,xr as P,zr as Ee}from"./api-Bm1JZLuC.js";import{t as F}from"./chevron-down-DAO3SUWv.js";import{C as De,_ as Oe,b as ke,d as Ae,f as je,g as I,h as Me,j as Ne,v as Pe,w as Fe,x as Ie,y as Le}from"./dropdown-menu-B-6CcHKw.js";import{t as Re}from"./x-Dltw6Vbs.js";import{r as ze,t as Be}from"./utils-CT7ZGLfR.js";import{_ as Ve,c as He,d as Ue,f as We,g as Ge,h as Ke,i as qe,l as Je,m as Ye,n as Xe,p as Ze,r as Qe,s as $e,t as et,u as tt,v as nt}from"./resolveAriaLabelledBy-ClHvyYLK.js";import"./paging-CpRIkEky.js";import{a as rt,c as it,i as at,l as ot,n as st,o as ct,r as lt,s as ut,u as dt}from"./input-1fShkFXn.js";import{Dt as ft,Et as pt,Tt as mt,wt as L}from"./index-MYZXi-9R.js";import{t as R}from"./Mark-DQR2php6.js";var z=e(t(),1),ht=e(n(),1),B=ze();function gt(e,t,n,r,i,a,o,s,c,l=2){let d=T(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return u(n.current,d)?void 0:d}var _t=z.createContext(void 0),vt=z.createContext(void 0),yt=z.createContext(void 0),bt=z.createContext(!1),xt=z.createContext(``);function V(){let e=z.useContext(_t);if(!e)throw Error(v(22));return e}function St(){let e=z.useContext(vt);if(!e)throw Error(v(23));return e}function Ct(){let e=z.useContext(yt);if(!e)throw Error(v(24));return e}function wt(){return z.useContext(xt)}function Tt(){return z.useContext(bt)}var Et={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?Qe(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>Je(t,e,n)):Je(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function Dt(e){return e==null?void 0:`${e}-popup`}function Ot(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function kt(e){return Array.isArray(e)?e.map(e=>kt(e)).join(`,`):e==null?``:String(e)}var H=new Map;function At(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${kt(e.locale)}|${JSON.stringify(t)}`,r=H.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=$e(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=$e(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=$e(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return H.set(n,a),a}var jt=At;function Mt(e,t=!1){let{overflowY:n}=Se(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var Nt=Symbol(`none`),Pt={value:Nt,index:-1};function Ft(e,t,n){let r=e.get(t);if(r!==void 0||n===tt)return r;for(let[r,i]of e)if(Je(r,t,n))return i}function It(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:s,defaultInputValue:c,inputValue:l,open:u,defaultOpen:d=!1,selectionMode:f,onItemHighlighted:_,name:te,form:w,disabled:T=!1,readOnly:E=!1,required:D=!1,inputRef:se,grid:me=!1,items:he,filteredItems:j,filter:ge,filterQuery:_e,openOnInputClick:ve=!0,autoHighlight:be=!1,keepHighlight:Se=!1,highlightItemOnHover:Ce=!0,loopFocus:we=!0,itemToStringLabel:Te,itemToStringValue:P,isItemEqualToValue:F=tt,virtualized:De=!1,inline:ke=!1,fillInputOnItemPress:Ae=!0,modal:je=!1,limit:I=-1,autoComplete:Me=`list`,formAutoComplete:Pe,locale:Le,submitOnItemClick:Re=!1}=e,{clearErrors:ze}=rt(),{setDirty:Be,validityData:Ke,setFilled:Qe,name:et,disabled:at,setTouched:ot,setFocused:ct,validationMode:ut,validation:dt}=it(),ft=Ie(),pt=lt({id:t}),mt=jt({locale:Le}),L=Array.isArray(he)?null:he;if(L&&typeof L.label!=`function`)throw Error(v(100));let R=L?L.data:he,ht=L?.value,V=ht?void 0:R,St=z.useMemo(()=>{if(!j||!ht)return;let e=Xe(j),t=e.map(ht),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return Ft(n,r,i)}}},[j,ht]),Ct=z.useMemo(()=>L?e=>L.label(e,F,e=>{let t=St?.findItem(e,F);return t==null?$e(e,Te):L.itemLabel(t)}):Te,[L,Te,St,F]),wt=z.useMemo(()=>L?Object.assign(e=>L.itemLabel(e),{selected:e=>$e(e,Ct)}):Te,[L,Ct,Te]);function Tt(e){return $e(e,Ct)}let[Dt,kt]=z.useState(!1),[H,At]=z.useState(null),It=z.useRef(H),Lt=z.useRef([]),Rt=z.useRef([]),zt=z.useRef(null),U=z.useRef(null),Bt=z.useRef(null),Vt=z.useRef(null),Ht=z.useRef(null),Ut=z.useRef(!0),Wt=z.useRef(!1),Gt=z.useRef(null),Kt=z.useRef(null),qt=z.useRef(null),Jt=z.useRef(Pt),Yt=z.useRef(null),Xt=z.useRef([]),Zt=z.useRef(null),Qt=at||T,$t=et??te,W=f===`multiple`,en=f===`single`,tn=l!==void 0||c!==void 0,G=R!==void 0,nn=j!==void 0,K;K=be===`always`?`always`:be?`input-change`:!1;let[q,rn]=O({controlled:o,default:W?r??x:r,name:`Combobox`,state:`selectedValue`}),an=z.useMemo(()=>ge===null?()=>!0:ge===void 0?Ot(mt,wt):ge,[ge,mt,wt]),on=Ee(()=>tn?c??``:en?Tt(q):``).current,[J,sn]=O({controlled:l,default:on,name:`Combobox`,state:`inputValue`}),[Y,cn]=O({controlled:u,default:d,name:`Combobox`,state:`open`}),ln=qe(R),X=!Y&&H!==null?H:String(J).trim(),un=en?Tt(q):``,dn=en&&!Dt&&X!==``&&un.length===X.length&&mt.contains(un,X),fn=dn?``:_e??X,pn=G&&nn&&dn&&(!L||L.hasValue(q,F)),mn=z.useMemo(()=>R?Xe(R):x,[R]),hn=z.useMemo(()=>{if(j&&!pn)return j;if(!R)return x;if(ln){let e=R,t=[],n=0;for(let r of e){if(I>-1&&n>=I)break;let e=I>-1?I-n:1/0,i=fn===``?r.items.slice(0,e):[];if(fn!==``)for(let t of r.items){if(i.length>=e)break;an(t,fn,wt)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(fn===``)return I>-1?mn.slice(0,I):mn;let e=[];for(let t of mn){if(I>-1&&e.length>=I)break;an(t,fn,wt)&&e.push(t)}return e},[j,pn,R,ln,fn,I,an,wt,mn]),Z=z.useMemo(()=>{if(St&&hn===j)return St.values;let e=Xe(hn);return ht?e.map(e=>ht(e)):e},[hn,j,St,ht]),Q=Ee(()=>{let e=null;return ke&&Y&&G&&f!==`none`&&(e=We(Z,q,F,W)),new ie({id:pt,labelId:void 0,selectedValue:q,open:Y,items:V,selectionMode:f,name:$t,form:w,disabled:Qt,readOnly:E,required:D,grid:me,virtualized:De,openOnInputClick:ve,itemToStringLabel:Ct,isItemEqualToValue:F,modal:je,autoHighlight:K,submitOnItemClick:Re,hasInputValue:tn,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:ke,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:ee,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:f===`none`},{onOpenChangeComplete:p,setOpen:p,setInputValue:p,setSelectedValue:p,setIndices:p,handleSelection:p,forceMount:p,requestSubmit:p,listRef:Lt,labelsRef:Rt,popupRef:zt,emptyRef:Ht,inputRef:U,startDismissRef:Bt,endDismissRef:Vt,keyboardActiveRef:Ut,chipsContainerRef:Gt,clearRef:Kt,valuesRef:Xt,pointerDownItemRef:Zt,selectionEventRef:qt},Et)}).current,gn=f===`none`?J:q,_n=z.useMemo(()=>f===`none`?gn:Array.isArray(q)?q.map(e=>He(e,P)):He(q,P),[gn,P,f,q]),vn=C(_),yn=C(n),bn=Q.useState(`activeIndex`),xn=Q.useState(`selectedIndex`),Sn=Q.useState(`positionerElement`),Cn=Q.useState(`listElement`),wn=Q.useState(`triggerElement`),Tn=Q.useState(`inputElement`),En=Q.useState(`inputGroupElement`),$=Q.useState(`inline`),Dn=Q.useState(`inputInsidePopup`),On=Q.useState(`inputOwnsFormValue`),kn=en&&!Dn&&J===un,An=a(wn),{mounted:jn,setMounted:Mn,transitionStatus:Nn}=m(Y),{openMethod:Pn,triggerProps:Fn}=Oe(Y),In=C(()=>_n);st(Dn?An:U,pt,gn,In,!Qt,te);let Ln=C(()=>{R?Rt.current=Z.map(Tt):Q.set(`forceMounted`,!0)}),Rn=C((e,t,n)=>{if(t===-1){if(Jt.current===Pt)return;Jt.current=Pt}else Jt.current={value:e,index:t};vn(e,pe(n,void 0,{index:t}))}),zn=C(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),Q.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Rn(void 0,-1,r):Rn(Xt.current[n],n,r)}),Bn=C((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Wt.current=n.reason===M,n.reason===`input-change`){Y&&H!==null&&At(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&kt(!0),Yt.current={hasQuery:e};let n=Q.state.listElement;if(!Q.state.virtualized&&n){let e=zt.current;for(let t of xe(n.firstElementChild??n)){if(!le(t)||(e?!i(e,t):t.getAttribute(`role`)===`dialog`))break;if(Mt(t)){t.scrollTop=0;break}}}e&&K&&Q.state.activeIndex==null&&(Y||$)&&Q.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&Q.state.inputInsidePopup&&(Yt.current={hasQuery:!1,selection:!0});sn(t)}}),Vn=C(e=>{let t=!e&&Dn&&!$&&J!==``&&(String(J).trim()===H||J===un);!e&&(t||J===``||kn)&&kt(!1),At(null),t&&Bn(``,N(M))}),Hn=C((t,n)=>{if(Y!==t&&(n.reason===`escape-key`&&G&&Z.length===0&&!Ht.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&H!==null&&Vn(n.reason===ye),!t&&Dt&&(en?($||At(X),X===``&&kt(!1)):W&&($||At(X),Dn&&zn({activeIndex:null}),(!Dn||$)&&Bn(``,N(M,n.event,void 0,{isItemPress:n.reason===de})))),cn(t),!t&&Dn&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(ot(!0),ct(!1),ut===`onBlur`)))){let e=f===`none`?J:q;dt.commit(e)}}),Un=C((e,t)=>{s?.(e,t),!t.isCanceled&&(rn(e),(f===`none`&&zt.current&&Ae||en&&!Q.state.inputInsidePopup)&&Bn(Tt(e),N(t.reason,t.event)))}),Wn=C((e,t)=>{let n=ce(e),r=qt.current??e;qt.current=null;let i=N(de,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Hn(!1,i);return}if(W){let e=Array.isArray(q)?q:[],n=Ge(e,t,F),r=n?Ye(e,t,F):[...e,t];if(Un(r,i),i.isCanceled||!(U.current&&U.current.value.trim()!==``))return;if(Q.state.inputInsidePopup){Bn(``,N(M,i.event,void 0,{isItemPress:!0}));let e=Yt.current;e&&!n&&(e.toggledValue=t)}else Hn(!1,i)}else{if(Un(t,i),i.isCanceled)return;Hn(!1,i)}}),Gn=C(()=>{let e=dt.inputRef.current?.form??Q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Kn=C(()=>{if(Mn(!1),yn?.(!1),kt(!1),At(null),zn(f===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),W&&U.current&&U.current.value!==``&&!Wt.current&&Bn(``,N(M)),en){if(Q.state.inputInsidePopup)U.current&&U.current.value!==``&&Bn(``,N(M));else{let e=Tt(q);U.current&&U.current.value!==e&&Bn(e,N(e===``?M:oe))}}}),qn=z.useMemo(()=>$&&Sn?{current:Sn.closest(`[role="dialog"]`)}:zt,[$,Sn]);g({enabled:!e.actionsRef,open:Y,ref:qn,onComplete(){Y||Kn()}}),z.useImperativeHandle(e.actionsRef,()=>({unmount:Kn}),[Kn]),b(function(){let e=It.current!==null&&H===null;if(It.current=H,Y&&(!e||!G)||(Y||(Zt.current=null),f===`none`))return;let t=G?Z:Xt.current;zn({selectedIndex:We(t,q,F,W)})},[Y,H,q,f,W,G,Z,F,zn]),b(()=>{R&&(Xt.current=Z,Lt.current.length=Z.length)},[R,Z]),b(()=>{let e=Yt.current;if(e){let t=Y||$||Q.state.positionerElement?.hidden===!1;if(e.hasQuery)K&&t&&Q.set(`activeIndex`,0),Yt.current=null;else if(String(J).trim()===``&&(Yt.current=null,t)){let t=e.selection;K===`always`&&!t&&Q.state.selectionMode===`none`&&Q.set(`activeIndex`,0),queueMicrotask(()=>{if(!Q.state.open&&!Q.state.inline||U.current&&U.current.value.trim()!==``)return;let n=Q.state.selectedValue,r=Q.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:Q.state.selectionMode!==`none`&&n!=null){let t=G||nn?Z:Xt.current,i=Ue(t,e.toggledValue,Q.state.isItemEqualToValue);Q.set(`activeIndex`,i===-1?We(t,n,Q.state.isItemEqualToValue,r):i)}else t?Q.set(`activeIndex`,null):K===`always`&&Q.set(`activeIndex`,0)})}}if(!Y&&!$)return;let t=G||nn?Z:Xt.current,n=Q.state.activeIndex;if(n==null){if(K===`always`&&t.length>0){Q.set(`activeIndex`,0);return}Rn(void 0,-1,oe);return}if(n>=t.length){Rn(void 0,-1,oe),Q.set(`activeIndex`,null);return}let r=t[n],i=Jt.current.value,a=i!==Nt&&Je(r,i,Q.state.isItemEqualToValue);(Jt.current.index!==n||!a)&&Rn(r,n,oe)},[bn,K,Rn,nn,G,Z,$,Y,Q,J]),b(()=>{if(f===`none`){Qe(String(J)!==``);return}Qe(W?Array.isArray(q)&&q.length>0:q!=null)},[Qe,f,J,q,W]),z.useEffect(()=>{G&&K&&Z.length===0&&zn({activeIndex:null})},[G,K,Z.length,zn]);function Jn(){Y&&X!==``&&X!==String(on)&&!kn&&kt(!0)}function Yn(){Y&&H!==null&&Vn(!1)}let Xn=!1;function Zn(){!Xn&&J!==un&&(Xn=!0,Bn(un,N(oe)))}function Qn(){f!==`none`&&(ze($t),Be(Ze(q,Ke.initialValue,F)),dt.change(q),en&&!tn&&!Dn&&Zn())}function $n(){en&&!tn&&!Dn&&!Dt&&Zn()}function er(){f===`none`&&(ze($t),Be(J!==Ke.initialValue),dt.change(J))}A(X,Jn),A(Y,Yn),A(q,Qn),A(un,$n),A(R,$n),A(J,er);let tr=nt({open:$?!0:Y,onOpenChange:Hn,elements:{reference:Dn?wn:Tn,floating:Sn}}),nr=me?`grid`:`listbox`,rr=Y||$,ir=rr?`true`:`false`,ar=z.useMemo(()=>{let e=Tn?.tagName===`INPUT`,t=Tn==null||e,n=t||rr,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=ir,r[`aria-haspopup`]=nr,r[`aria-controls`]=rr?Cn?.id:void 0,r[`aria-autocomplete`]=E?`none`:Me),{reference:r,floating:{role:`presentation`}}},[Tn,rr,ir,nr,Cn?.id,Me,E]),or=Ne(tr,{enabled:!Qt&&ve,event:`mousedown-only`,toggle:!1,touchOpenDelay:Dn?0:100,reason:fe}),sr=S(tr,{enabled:!Qt&&!$,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:$?!0:void 0,outsidePress(e){let t=ce(e);return!i(wn,t)&&!i(Kt.current,t)&&!i(Gt.current,t)&&!i(En,t)}}),cr=Fe(tr,{enabled:!Qt,id:pt,listRef:Lt,activeIndex:bn,selectedIndex:xn,virtual:!0,loopFocus:we,allowEscape:we&&!K,focusItemOnOpen:Dt||f===`none`&&!K?!1:`auto`,focusItemOnHover:Ce,resetOnPointerLeave:!Se,orientation:me?`horizontal`:void 0,rtl:ft===`rtl`,disabledIndices:x,grid:me?gt:void 0,onNavigate(e,t){(t||Y)&&Nn!==`ending`&&zn(t?{activeIndex:e,type:Ut.current?ae:ne}:{activeIndex:e})}}),lr=z.useMemo(()=>ue(cr.reference,{onKeyDown(e){me&&Q.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},sr.reference,or.reference,ar.reference),[cr.reference,sr.reference,or.reference,ar.reference,me,Q]),ur=z.useMemo(()=>ue(y,sr.floating),[sr.floating]),dr=z.useMemo(()=>ue(cr.floating,ar.floating),[cr.floating,ar.floating]),fr=z.useMemo(()=>{let e=cr.item;return e?{...e,onFocus:void 0}:ee},[cr.item]);Q.useContextCallback(`setOpen`,Hn),Q.useContextCallback(`setInputValue`,Bn),Q.useContextCallback(`setSelectedValue`,Un),Q.useContextCallback(`setIndices`,zn),Q.useContextCallback(`handleSelection`,Wn),Q.useContextCallback(`forceMount`,Ln),Q.useContextCallback(`requestSubmit`,Gn),Q.useContextCallback(`onOpenChangeComplete`,n),Ve(()=>{Q.update({inline:ke,popupProps:ur,listProps:dr,inputProps:lr,triggerProps:Fn,itemProps:fr})});let pr={id:pt,selectedValue:q,open:Y,mounted:jn,transitionStatus:Nn,items:V,inline:ke,popupProps:ur,listProps:dr,inputProps:lr,triggerProps:Fn,itemProps:fr,openMethod:Pn,selectionMode:f,name:$t,form:w,disabled:Qt,readOnly:E,required:D,grid:me,virtualized:De,openOnInputClick:ve,itemToStringLabel:Ct,modal:je,autoHighlight:K,isItemEqualToValue:F,submitOnItemClick:Re,hasInputValue:tn};b(()=>{Q.update({...pr,inputOwnsFormValue:f===`none`&&(ke||!Q.state.inputInsidePopup)})},[Q,...Object.values(pr)]);let mr=k(se,dt.inputRef),hr=z.useMemo(()=>({query:X,hasItems:G,filteredItems:hn,flatFilteredValues:Z}),[X,G,hn,Z]),gr=z.useMemo(()=>Array.isArray(gn)?``:He(gn,P),[gn,P]),_r=W&&Array.isArray(q)&&q.length>0,vr=W||f===`none`&&On?void 0:$t,yr=z.useMemo(()=>!W||!Array.isArray(q)||!$t?null:q.map(e=>{let t=He(e,P);return(0,B.jsx)(`input`,{type:`hidden`,form:w,name:$t,value:t,disabled:Qt},t)}),[W,q,w,$t,P,Qt]),br=(0,B.jsxs)(z.Fragment,{children:[e.children,(0,B.jsx)(`input`,{...dt.getValidationProps(Qt,{onFocus(){if(Dn){wn?.focus();return}(U.current||wn)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Qt||E)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=N(oe,e.nativeEvent),i=()=>Xt.current.findIndex(e=>He(e,P).toLowerCase()===n||Tt(e).toLowerCase()===n);function a(){if(W)return;if(f===`none`){Bn(t,r);return}let e=i();e===-1&&(e=Xt.current.findIndex((e,t)=>{let r=Rt.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Xt.current[e];a!=null&&Un?.(a,r)}en&&(Ln(),R&&i()===-1&&Q.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:pt&&vr==null?`${pt}-hidden-input`:void 0,form:w,name:vr,autoComplete:Pe,disabled:Qt,required:D&&!_r,readOnly:E,value:gr,ref:mr,style:vr?re:h,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),yr]});return(0,B.jsx)(_t.Provider,{value:Q,children:(0,B.jsx)(vt.Provider,{value:tr,children:(0,B.jsx)(bt.Provider,{value:G,children:(0,B.jsx)(yt.Provider,{value:hr,children:(0,B.jsx)(xt.Provider,{value:J,children:br})})})})})}var Lt=`data-popup-side`,Rt=`data-list-empty`,zt={..._,...dt,popupSide:e=>e?{[Lt]:e}:null,listEmpty:e=>e?{[Rt]:``}:null};function U(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function Bt(){return Ct().filteredItems.length===0}function Vt(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function Ht(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function Ut(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var Wt=z.forwardRef(function(e,t){let{render:n,className:r,nativeButton:a=!0,disabled:s=!1,id:c,style:l,...u}=e,{state:d,disabled:ee,setTouched:f,setFocused:p,validationMode:m,validation:h}=it(),{labelId:g}=at(),_=V(),v=_.useState(`selectionMode`),y=_.useState(`disabled`),b=_.useState(`readOnly`),te=_.useState(`required`),x=_.useState(`positionerElement`),S=_.useState(`listElement`),w=_.useState(`popupId`),ne=_.useState(`triggerProps`),T=_.useState(`inputInsidePopup`),re=_.useState(`id`),ie=_.useState(`labelId`),ae=_.useState(`open`),O=_.useState(`selectedValue`),k=_.useState(`activeIndex`),A=_.useState(`selectedIndex`),le=_.useState(`hasSelectedValue`),ue=St(),de=wt(),fe=o(),pe=ee||y||s,me=Bt(),he=U(_);lt({id:T?c:void 0});let j=T?c??re:c,ge=et(g,ie),M;ae&&T?M=w??Dt(re):ae&&(M=S?.id);let _e=z.useRef(``);function ve(e){_e.current=e.pointerType}let{reference:ye}=De(ue,{enabled:!ae&&!b&&!y&&v===`single`,listRef:_.context.labelsRef,activeIndex:k,selectedIndex:A,onMatch(e){let t=_.context.valuesRef.current[e];t!==void 0&&_.context.setSelectedValue(t,N(oe))}}),{reference:be}=Ne(ue,{enabled:!y,event:`mousedown`}),{buttonRef:xe,getButtonProps:Se}=we({native:a,disabled:pe}),Te={...d,readOnly:b,open:ae,disabled:pe,popupSide:he,listEmpty:me,placeholder:v!==`none`&&!le},Ee=C(e=>{_.set(`triggerElement`,e)});return se(`button`,e,{ref:[t,xe,Ee],state:Te,props:[ne,be,ye,{id:j,tabIndex:T?0:-1,role:T?`combobox`:void 0,"aria-expanded":ae,"aria-haspopup":T?`dialog`:`listbox`,"aria-controls":M,"aria-required":T&&te||void 0,"aria-readonly":T&&b||void 0,"aria-labelledby":ge,onPointerDown:ve,onPointerEnter:ve,onFocus(){p(!0),!pe&&fe.start(0,_.context.forceMount)},onBlur(e){if(!i(x,e.relatedTarget)&&(f(!0),p(!1),m===`onBlur`)){let e=v===`none`?de:O;h.commit(e)}},onMouseDown(e){if(pe||(T||ue.set(`domReferenceElement`,e.currentTarget),_.context.forceMount(),_e.current!==`touch`&&(_.context.inputRef.current?.focus(),T||e.preventDefault()),ae))return;let t=E(e.currentTarget);function n(e){let t=_.state.triggerElement;if(!t)return;let n=ce(e),r=_.state.positionerElement,a=_.state.listElement;i(t,n)||i(r,n)||i(a,n)||Ae(e,t)||_.context.setOpen(!1,N(D,e))}T&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(P(e),_.context.setOpen(!0,N(Ce,e.nativeEvent)),_.context.inputRef.current?.focus())}},h.getValidationProps(pe,u),Se],stateAttributesMapping:zt})}),Gt=z.createContext(void 0);function Kt(){return z.useContext(Gt)}var qt=z.createContext(void 0);function Jt(e){let t=z.useContext(qt);if(t===void 0&&!e)throw Error(v(21));return t}var Yt=z.forwardRef(function(e,t){let n=V(),{buttonRef:r,getButtonProps:i}=we({native:!1}),a=k(t,r);function o(e){n.context.setOpen(!1,N(be,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,B.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:re})}),Xt=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:u,setTouched:d,setFocused:ee,validationMode:f,validation:p}=it(),{labelId:m}=at(),h=Kt(),g=!!Jt(!0),_=V(),v=wt(),y=Ie(),b=_.useState(`required`),te=_.useState(`disabled`),x=_.useState(`readOnly`),S=_.useState(`name`),w=_.useState(`form`),T=_.useState(`selectionMode`),E=_.useState(`autoHighlight`),re=_.useState(`inputProps`),ie=_.useState(`triggerProps`),D=_.useState(`open`),O=_.useState(`mounted`),k=_.useState(`selectedValue`),ce=_.useState(`id`),A=_.useState(`inline`),le=_.useState(`modal`),ue=!!E,de=U(_),fe=u||te||i,pe=Bt(),j=g||A,ge=!j||le,_e=me(a??(j?void 0:ce)),ve=g?ot:c,[be,xe]=z.useState(null),Se=z.useRef(!1),Ce=z.useRef(null),we=z.useRef(!1),Ee=T===`none`&&!g,F=C(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.context.setInputValue(``,N(oe)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:Ee})}),De=g?s:p.getValidationProps(fe,s);function Oe(){_.context.setIndices({activeIndex:null,selectedIndex:null,type:_.context.keyboardActiveRef.current?ae:ne})}function ke(){_.context.keyboardActiveRef.current=!1}let Ae={...ve,open:D,disabled:fe,readOnly:x,popupSide:de,listEmpty:pe};function je(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=Vt(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&k.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=Ht(n,k.length),Oe()),t)}let I=se(`input`,e,{state:Ae,ref:[t,_.context.inputRef,F],props:[re,ie,{value:be??v,"aria-readonly":x||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:fe,readOnly:x,required:T===`none`?b:void 0,form:w,...Ee&&S&&{name:S},id:_e,onFocus(){if(ee(!0),!A||!we.current)return;we.current=!1;let e=Ce.current;e!=null&&Object.hasOwn(_.context.valuesRef.current,e)&&_.context.setIndices({activeIndex:e})},onBlur(){d(!0),ee(!1);let e=_.state.activeIndex;if(A&&e!==null&&E!==`always`&&(Ce.current=e,we.current=!0,_.context.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:k;p.commit(e)}},onCompositionStart(e){l||(Se.current=!0,xe(e.currentTarget.value))},onCompositionEnd(e){Se.current=!1;let t=e.currentTarget.value;xe(null),_.context.setInputValue(t,N(ye,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=Se.current||!r;function a(e){!x&&!fe&&e&&i&&(_.context.setOpen(!0,N(ye,t)),ue||Oe())}if(Se.current){let n=e.currentTarget.value;xe(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.context.setOpen(!1,N(M,t));let r=n.trim(),i=ue&&r!==``;a(r),D&&_.state.activeIndex!==null&&!i&&Oe();return}let o=N(ye,t);if(_.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=N(M,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.context.setSelectedValue(null,c),_.state.openOnInputClick||_.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),D&&_.state.activeIndex!==null&&!ue&&Oe()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(_.context.keyboardActiveRef.current=!0,fe||x){x&&e.key===`Enter`&&D&&_.state.activeIndex!==null&&P(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){P(e);let n=Te&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){P(e);let i=Te&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!O&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(k)?k.length===0:k===null,n=N(he,e.nativeEvent),r=T===`multiple`?[]:null;_.context.setInputValue(``,n),_.context.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(k)&&k.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:k.length-1,r=k.filter((e,t)=>t!==n);Oe(),_.context.setSelectedValue(r,N(oe,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=je(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.context.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&D){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(A)return;_.context.setOpen(!1,N(oe,n));return}P(e),Ut(_,t,n)}},onPointerMove:ke,onPointerDown:ke},De],stateAttributesMapping:zt}),Me=g?(0,B.jsx)(ut.Provider,{value:ct,children:I}):I;return(0,B.jsxs)(z.Fragment,{children:[D&&ge&&(0,B.jsx)(Yt,{ref:_.context.startDismissRef}),Me]})}),Zt={...f,...w},Qt=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=it(),u=V(),d=u.useState(`selectionMode`),ee=u.useState(`disabled`),f=u.useState(`readOnly`),p=u.useState(`open`),h=u.useState(`selectedValue`),_=u.useState(`hasSelectionChips`),v=wt(),y=!1;y=d===`none`?v!==``:d===`single`?h!=null:_;let b=l||ee||i,{buttonRef:te,getButtonProps:x}=we({native:a,disabled:b}),{mounted:S,transitionStatus:C,setMounted:w}=m(y),T={disabled:b,visible:y,open:p,transitionStatus:C};g({open:y,ref:u.context.clearRef,onComplete(){y||w(!1)}});let E=se(`button`,e,{state:T,ref:[t,te,u.context.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(b||f)return;let t=u.context.keyboardActiveRef.current?ae:ne;u.context.setInputValue(``,N(_e,e.nativeEvent)),d===`none`?u.context.setIndices({activeIndex:null,type:t}):(u.context.setSelectedValue(Array.isArray(h)?[]:null,N(_e,e.nativeEvent)),u.context.setIndices({activeIndex:null,selectedIndex:null,type:t})),u.context.inputRef.current?.focus()}},c,x],stateAttributesMapping:Zt});return o||S?E:null}),$t=z.createContext(null);function W(){return z.useContext($t)}function en(e){let{children:t}=e,{filteredItems:n}=Ct(),r=W(),i=r?r.items:n;return(0,B.jsx)(z.Fragment,{children:i.map(t)})}var tn=z.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=V(),l=St(),u=!!Jt(!0),{filteredItems:d,hasItems:ee}=Ct(),f=c.useState(`selectionMode`),p=c.useState(`grid`),m=c.useState(`readOnly`),h=c.useState(`listProps`),g=c.useState(`virtualized`),_=c.useState(`forceMounted`),v=f===`multiple`,y=d.length===0,b=C(e=>{c.set(`positionerElement`,e)}),te=C(e=>{c.set(`listElement`,e)}),x=z.useMemo(()=>typeof o==`function`?n||=(0,B.jsx)(en,{children:o}):o,[o]),S={empty:y},w=l.useState(`floatingId`),ne=se(`div`,e,{state:S,ref:[t,te,u?null:b],props:[h,{children:x,tabIndex:-1,id:w,role:p?`grid`:`listbox`,"aria-multiselectable":v?`true`:void 0,"aria-readonly":!p&&m?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;P(e),Ut(c,t,e.nativeEvent)}},onKeyDownCapture(){c.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.context.keyboardActiveRef.current=!1}},s]});if(g)return ne;let T=ee&&!_?void 0:c.context.labelsRef;return(0,B.jsx)(I,{elementsRef:c.context.listRef,labelsRef:T,children:ne})}),G=`⁠`;function nn(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function K(){let e=o(),t=z.useRef(null);return z.useEffect(()=>{if(c)return;let n=t.current;if(n==null)return;let r=nn(n);if(r==null)return;let i=r.data,a=`${i}${G}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var q=z.createContext(void 0);function rn(){let e=z.useContext(q);if(e===void 0)throw Error(v(20));return e}var an=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=V(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,B.jsx)(q.Provider,{value:n,children:(0,B.jsx)(ve,{ref:t,...r})}):null}),on=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:ee,sticky:f,disableAnchorTracking:p=!1,collisionAvoidance:m=j,style:h,...g}=e,_=V(),v=St(),y=rn(),x=_.useState(`modal`),S=_.useState(`open`),w=_.useState(`mounted`),ne=_.useState(`openMethod`),T=_.useState(`positionerElement`),E=_.useState(`triggerElement`),re=_.useState(`inputElement`),ie=_.useState(`inputGroupElement`),ae=_.useState(`inputInsidePopup`),D=_.useState(`transitionStatus`),oe=Bt(),O=ke({anchor:i??(ae?E:ie??re),floatingRootContext:v,positionMethod:a,mounted:w,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:ee,collisionBoundary:u,collisionPadding:d,sticky:f,disableAnchorTracking:p,keepMounted:y,collisionAvoidance:m,lazyFlip:!0});je(S&&x,ne===`touch`,T,E);let se={open:S,side:O.side,align:O.align,anchorHidden:O.anchorHidden,empty:oe};b(()=>{_.set(`popupSide`,O.side)},[_,O.side]);let k=C(e=>{_.set(`positionerElement`,e)}),ce=Pe(e,se,{styles:O.positionerStyles,transitionStatus:D,props:g,refs:[t,k],hidden:!w,inert:!S});return(0,B.jsxs)(qt.Provider,{value:O,children:[w&&x&&(0,B.jsx)(ge,{inert:te(!S),cutout:ie??re??E}),ce]})}),J={...d,...f},sn=z.forwardRef(function(e,t){let{render:n,className:a,style:o,initialFocus:s,finalFocus:c,...l}=e,u=V(),d=Jt(),ee=St(),f=u.useState(`mounted`),p=u.useState(`open`),m=u.useState(`openMethod`),h=u.useState(`popupProps`),_=u.useState(`transitionStatus`),v=u.useState(`inputInsidePopup`),y=u.useState(`inputElement`),te=u.useState(`modal`),x=u.useState(`id`),S=Bt(),C=l.id??(v?Dt(x):void 0);b(()=>(u.set(`popupId`,u.context.popupRef.current?.id||C),()=>{u.set(`popupId`,void 0)}),[u,C]),g({open:p,ref:u.context.popupRef,onComplete(){p&&u.context.onOpenChangeComplete(!0)}});let w={open:p,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:_,empty:S},ne=se(`div`,e,{state:w,ref:[t,u.context.popupRef],props:[h,{id:C,role:v?`dialog`:`presentation`,onFocus(e){let t=ce(e.nativeEvent);m!==`touch`&&(i(u.state.listElement,t)||t===e.currentTarget)&&u.context.inputRef.current?.focus()}},Le(_),l],stateAttributesMapping:J}),T=s===void 0?v?e=>e===`touch`?u.context.popupRef.current:y:!1:s,E;E=c??(v?void 0:!1);let re=!v||te;return(0,B.jsx)(r,{context:ee,disabled:!f,modal:re,openInteractionType:m,initialFocus:T,returnFocus:E,getInsideElements:()=>[u.context.startDismissRef.current,u.context.endDismissRef.current],children:(0,B.jsxs)(z.Fragment,{children:[ne,re&&(0,B.jsx)(Yt,{ref:u.context.endDismissRef})]})})}),Y=z.createContext(void 0);function cn(){let e=z.useContext(Y);if(!e)throw Error(v(19));return e}var ln=z.createContext(!1);function X(){return z.useContext(ln)}function un(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...ee}=t,f=z.useRef(null),p=Me({guess:!0,index:l,textRef:f}),m=V(),h=X(),g=Tt(),_=m.useState(`selectionMode`),v=m.useState(`disabled`),y=m.useState(`readOnly`),te=m.useState(`isItemEqualToValue`),x=v||u,S=_!==`none`,C=l??i??p.index,w=C!==-1,ne=m.useState(`id`),T=m.useState(`isActive`,C),E=m.useState(`isSelected`,c),re=m.useState(`itemProps`),ie=z.useRef(null),ae=ne!=null&&w?`${ne}-${C}`:void 0,D=E&&S;b(()=>{if(!w||!r&&l==null)return;let e=m.context.listRef.current;return e[C]=ie.current,()=>{delete e[C]}},[w,r,C,l,m]),b(()=>{if(!w||g)return;let e=m.context.valuesRef.current;return e[C]=c,()=>{delete e[C]}},[w,g,C,c,m]),b(()=>{if(!w||g)return;let e=m.state.selectedValue,t=m.state.selectedIndex;m.state.selectionMode===`multiple`&&Array.isArray(e)?t=Ke(C,c,m.context.valuesRef.current,e,te,t):Je(c,e,te)&&(t=C),m.set(`selectedIndex`,t)},[w,g,m,C,c,te]);let{getButtonProps:oe,buttonRef:O}=we({disabled:x,focusableWhenDisabled:!0,native:d,composite:!0}),k={disabled:x,selected:D,highlighted:T};function ce(e){function t(){m.context.handleSelection(e,c)}m.state.submitOnItemClick?(ht.flushSync(t),m.context.requestSubmit()):t()}let A={id:ae,role:h?`gridcell`:`option`,"aria-selected":S?D:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(m.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){x||y||ce(e.nativeEvent)},onMouseUp(e){let t=m.context.pointerDownItemRef.current===e.currentTarget;m.context.pointerDownItemRef.current=null,!(x||y||e.button!==0||t||!T)&&ce(e.nativeEvent)}},le=se(`div`,t,{ref:[O,n,p.ref,ie],state:k,props:[re,A,ee,oe]}),ue=z.useMemo(()=>({selected:D,textRef:f}),[D,f]);return(0,B.jsx)(Y.Provider,{value:ue,children:le})}function dn(e){let{componentProps:t,forwardedRef:n}=e,r=V().useState(`isItemEqualToValue`),{flatFilteredValues:i}=Ct(),a=t.value??null,o=Ue(i,a,r);return(0,B.jsx)(un,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:o})}var fn=z.memo(z.forwardRef(function(e,t){let n=V().useState(`virtualized`);return n&&e.index==null?(0,B.jsx)(dn,{componentProps:e,forwardedRef:t}):(0,B.jsx)(un,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),pn=z.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=Ct(),c=V(),l=K(),u=s.length===0?a:null;return se(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})});function mn(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,B.jsx)(It,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var hn=z.forwardRef(function(e,t){let{selected:n}=cn();return e.keepMounted||n?(0,B.jsx)(Z,{...e,ref:t}):null}),Z=z.memo(z.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=cn(),c=z.useRef(null),{transitionStatus:l,setMounted:u}=m(s),d=se(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:f});return g({batch:!0,enabled:!s,open:s,ref:c,onComplete(){s||u(!1)}}),d})),Q=mn;function gn({className:e,children:t,...n}){return(0,B.jsxs)(Wt,{"data-slot":`combobox-trigger`,className:Be(`[&_svg:not([class*='size-'])]:size-4`,e),...n,children:[t,(0,B.jsx)(F,{className:`pointer-events-none size-4 text-muted-foreground`})]})}function _n({className:e,...t}){return(0,B.jsx)(Qt,{"data-slot":`combobox-clear`,render:(0,B.jsx)(pt,{variant:`ghost`,size:`icon-xs`}),className:Be(e),...t,children:(0,B.jsx)(Re,{className:`pointer-events-none`})})}function vn({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return(0,B.jsxs)(L,{className:Be(`w-auto`,e),children:[(0,B.jsx)(Xt,{render:(0,B.jsx)(ft,{disabled:n}),...a}),(0,B.jsxs)(mt,{align:`inline-end`,children:[r&&(0,B.jsx)(pt,{size:`icon-xs`,variant:`ghost`,render:(0,B.jsx)(gn,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:n}),i&&(0,B.jsx)(_n,{disabled:n})]}),t]})}function yn({className:e,side:t=`bottom`,sideOffset:n=6,align:r=`start`,alignOffset:i=0,anchor:a,...o}){return(0,B.jsx)(an,{children:(0,B.jsx)(on,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:`isolate z-50`,children:(0,B.jsx)(sn,{"data-slot":`combobox-content`,"data-chips":!!a,className:Be(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) 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-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}function bn({className:e,...t}){return(0,B.jsx)(tn,{"data-slot":`combobox-list`,className:Be(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,e),...t})}function xn({className:e,children:t,...n}){return(0,B.jsxs)(fn,{"data-slot":`combobox-item`,className:Be(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**: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`,e),...n,children:[t,(0,B.jsx)(hn,{render:(0,B.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,B.jsx)(s,{className:`pointer-events-none`})})]})}function Sn({className:e,...t}){return(0,B.jsx)(pn,{"data-slot":`combobox-empty`,className:Be(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,e),...t})}function Cn(e,t){let n=t.toLowerCase().split(/\s+/u).filter(Boolean),r=`${e.label} ${e.aside}`.toLowerCase();return n.every(e=>r.includes(e))}function wn({id:e,value:t,options:n,placeholder:r,label:i,onChange:a}){let o=n.find(e=>e.value===t)??null;return(0,B.jsxs)(Q,{items:n,value:o,itemToStringLabel:e=>e.label,filter:(e,t)=>Cn(e,t),onValueChange:e=>{a(e===null?``:e.value)},children:[(0,B.jsxs)(vn,{id:e,"aria-label":i,placeholder:r,className:`bg-field dark:bg-field`,showTrigger:!1,children:[o?.mark!==void 0&&(0,B.jsx)(mt,{align:`inline-start`,children:(0,B.jsx)(R,{glyph:o.mark})}),(0,B.jsxs)(mt,{align:`inline-end`,children:[o!==null&&o.aside!==``&&(0,B.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:o.aside}),(0,B.jsx)(pt,{size:`icon-xs`,variant:`ghost`,render:(0,B.jsx)(gn,{})})]})]}),(0,B.jsxs)(yn,{children:[(0,B.jsx)(Sn,{children:`No match.`}),(0,B.jsx)(bn,{children:e=>(0,B.jsxs)(xn,{value:e,children:[e.mark!==void 0&&(0,B.jsx)(R,{glyph:e.mark}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label}),e.aside!==``&&(0,B.jsx)(`span`,{className:`ml-auto font-mono text-xs whitespace-nowrap text-muted-foreground`,children:e.aside})]},e.value)})]})]})}export{wn as t};