prefect 3.6.12__py3-none-any.whl → 3.6.13__py3-none-any.whl

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 (266) hide show
  1. prefect/_build_info.py +3 -3
  2. prefect/_internal/compatibility/blocks.py +18 -0
  3. prefect/_internal/urls.py +29 -0
  4. prefect/_states.py +4 -1
  5. prefect/client/orchestration/_concurrency_limits/client.py +16 -16
  6. prefect/client/schemas/filters.py +24 -0
  7. prefect/client/subscriptions.py +1 -1
  8. prefect/events/clients.py +52 -13
  9. prefect/flow_engine.py +192 -10
  10. prefect/flows.py +61 -2
  11. prefect/results.py +262 -21
  12. prefect/runner/runner.py +29 -82
  13. prefect/runner/storage.py +6 -25
  14. prefect/server/schemas/filters.py +45 -0
  15. prefect/server/ui-v2/assets/{artifact-card-Ds2tntMW.js → artifact-card-CUEaRDGw.js} +2 -2
  16. prefect/server/ui-v2/assets/{artifact-card-Ds2tntMW.js.map → artifact-card-CUEaRDGw.js.map} +1 -1
  17. prefect/server/ui-v2/assets/{artifact._id-erPNL0a8.js → artifact._id-Ca6VCUS0.js} +2 -2
  18. prefect/server/ui-v2/assets/{artifact._id-erPNL0a8.js.map → artifact._id-Ca6VCUS0.js.map} +1 -1
  19. prefect/server/ui-v2/assets/{automation-wizard-Bx9AQxRV.js → automation-wizard-z26pICBl.js} +2 -2
  20. prefect/server/ui-v2/assets/{automation-wizard-Bx9AQxRV.js.map → automation-wizard-z26pICBl.js.map} +1 -1
  21. prefect/server/ui-v2/assets/automation._id-DuodjY5t.js +2 -0
  22. prefect/server/ui-v2/assets/{automation._id-IHh5QJwE.js.map → automation._id-DuodjY5t.js.map} +1 -1
  23. prefect/server/ui-v2/assets/{automation_._id.edit-Ds8vO0c5.js → automation_._id.edit-CcuJhc-y.js} +2 -2
  24. prefect/server/ui-v2/assets/{automation_._id.edit-Ds8vO0c5.js.map → automation_._id.edit-CcuJhc-y.js.map} +1 -1
  25. prefect/server/ui-v2/assets/{automations-header-C6aUe5Tw.js → automations-header-CgOWwuc6.js} +2 -2
  26. prefect/server/ui-v2/assets/{automations-header-C6aUe5Tw.js.map → automations-header-CgOWwuc6.js.map} +1 -1
  27. prefect/server/ui-v2/assets/{base-job-template-form-section-a-9TFMcW.js → base-job-template-form-section-DN9HyjM5.js} +2 -2
  28. prefect/server/ui-v2/assets/{base-job-template-form-section-a-9TFMcW.js.map → base-job-template-form-section-DN9HyjM5.js.map} +1 -1
  29. prefect/server/ui-v2/assets/{block-type-details-eq3Wg2ht.js → block-type-details-rrToxL5r.js} +2 -2
  30. prefect/server/ui-v2/assets/{block-type-details-eq3Wg2ht.js.map → block-type-details-rrToxL5r.js.map} +1 -1
  31. prefect/server/ui-v2/assets/block-type-logo-DURScH8H.js +2 -0
  32. prefect/server/ui-v2/assets/{block-type-logo-B31LJm5H.js.map → block-type-logo-DURScH8H.js.map} +1 -1
  33. prefect/server/ui-v2/assets/{block._id-OVdz3htC.js → block._id-Bue6lnrN.js} +2 -2
  34. prefect/server/ui-v2/assets/{block._id-OVdz3htC.js.map → block._id-Bue6lnrN.js.map} +1 -1
  35. prefect/server/ui-v2/assets/block_._id.edit-QY0OzN_b.js +2 -0
  36. prefect/server/ui-v2/assets/{block_._id.edit-CIhIBJrm.js.map → block_._id.edit-QY0OzN_b.js.map} +1 -1
  37. prefect/server/ui-v2/assets/catalog-CGjRGWv6.js +2 -0
  38. prefect/server/ui-v2/assets/{catalog-CfniU0UV.js.map → catalog-CGjRGWv6.js.map} +1 -1
  39. prefect/server/ui-v2/assets/catalog_._slug-BMFNZhEb.js +2 -0
  40. prefect/server/ui-v2/assets/{catalog_._slug-C9p86T4s.js.map → catalog_._slug-BMFNZhEb.js.map} +1 -1
  41. prefect/server/ui-v2/assets/catalog_._slug_.create-CuFA3kUC.js +2 -0
  42. prefect/server/ui-v2/assets/{catalog_._slug_.create-BhSunL__.js.map → catalog_._slug_.create-CuFA3kUC.js.map} +1 -1
  43. prefect/server/ui-v2/assets/{collapsible-DBD7wjpi.js → collapsible-Ell2FjrX.js} +2 -2
  44. prefect/server/ui-v2/assets/{collapsible-DBD7wjpi.js.map → collapsible-Ell2FjrX.js.map} +1 -1
  45. prefect/server/ui-v2/assets/{concurrency-limit._id-C-XWq7Tf.js → concurrency-limit._id-Rr1ysUct.js} +2 -2
  46. prefect/server/ui-v2/assets/{concurrency-limit._id-C-XWq7Tf.js.map → concurrency-limit._id-Rr1ysUct.js.map} +1 -1
  47. prefect/server/ui-v2/assets/{create-noFojqGL.js → create-CQK8-uO1.js} +2 -2
  48. prefect/server/ui-v2/assets/{create-noFojqGL.js.map → create-CQK8-uO1.js.map} +1 -1
  49. prefect/server/ui-v2/assets/{create-Bj2t5YQq.js → create-ewA3uq_h.js} +2 -2
  50. prefect/server/ui-v2/assets/{create-Bj2t5YQq.js.map → create-ewA3uq_h.js.map} +1 -1
  51. prefect/server/ui-v2/assets/{data-table-BjFlVIyC.js → data-table-Bx1uYX_M.js} +2 -2
  52. prefect/server/ui-v2/assets/{data-table-BjFlVIyC.js.map → data-table-Bx1uYX_M.js.map} +1 -1
  53. prefect/server/ui-v2/assets/delete-confirmation-dialog-CqKsUEj_.js +2 -0
  54. prefect/server/ui-v2/assets/{delete-confirmation-dialog-COdZmNfa.js.map → delete-confirmation-dialog-CqKsUEj_.js.map} +1 -1
  55. prefect/server/ui-v2/assets/{deployment-action-header-C6v2kZ6V.js → deployment-action-header-Bz5COdER.js} +2 -2
  56. prefect/server/ui-v2/assets/{deployment-action-header-C6v2kZ6V.js.map → deployment-action-header-Bz5COdER.js.map} +1 -1
  57. prefect/server/ui-v2/assets/{deployment-form-D9d5sZM2.js → deployment-form-CrlZlNoj.js} +3 -3
  58. prefect/server/ui-v2/assets/{deployment-form-D9d5sZM2.js.map → deployment-form-CrlZlNoj.js.map} +1 -1
  59. prefect/server/ui-v2/assets/{deployment-links-Dy-M1Que.js → deployment-links-D9ZR_vmp.js} +2 -2
  60. prefect/server/ui-v2/assets/{deployment-links-Dy-M1Que.js.map → deployment-links-D9ZR_vmp.js.map} +1 -1
  61. prefect/server/ui-v2/assets/deployment._id-BV0rSqba.js +2 -0
  62. prefect/server/ui-v2/assets/{deployment._id-DVmqclRz.js.map → deployment._id-BV0rSqba.js.map} +1 -1
  63. prefect/server/ui-v2/assets/{deployment._id-CZlY9261.js → deployment._id-DvHhx-qN.js} +2 -2
  64. prefect/server/ui-v2/assets/{deployment._id-CZlY9261.js.map → deployment._id-DvHhx-qN.js.map} +1 -1
  65. prefect/server/ui-v2/assets/deployment_._id.duplicate-BrEOenqP.js +2 -0
  66. prefect/server/ui-v2/assets/{deployment_._id.duplicate-DVMjpk5m.js.map → deployment_._id.duplicate-BrEOenqP.js.map} +1 -1
  67. prefect/server/ui-v2/assets/deployment_._id.edit-BbYKPK42.js +2 -0
  68. prefect/server/ui-v2/assets/{deployment_._id.edit-Ck_P6KDn.js.map → deployment_._id.edit-BbYKPK42.js.map} +1 -1
  69. prefect/server/ui-v2/assets/{deployment_._id.run-Cht7AHDG.js → deployment_._id.run-Dv7S_MJR.js} +2 -2
  70. prefect/server/ui-v2/assets/{deployment_._id.run-Cht7AHDG.js.map → deployment_._id.run-Dv7S_MJR.js.map} +1 -1
  71. prefect/server/ui-v2/assets/{dropdown-menu-xZ_3w9OP.js → dropdown-menu-e0Fqb6aw.js} +2 -2
  72. prefect/server/ui-v2/assets/{dropdown-menu-xZ_3w9OP.js.map → dropdown-menu-e0Fqb6aw.js.map} +1 -1
  73. prefect/server/ui-v2/assets/{event._eventDate._eventId-CpexuXd6.js → event._eventDate._eventId-Cp4UmGqq.js} +2 -2
  74. prefect/server/ui-v2/assets/{event._eventDate._eventId-CpexuXd6.js.map → event._eventDate._eventId-Cp4UmGqq.js.map} +1 -1
  75. prefect/server/ui-v2/assets/flow-run-graph-BrqoR3E2.js +2 -0
  76. prefect/server/ui-v2/assets/flow-run-graph-BrqoR3E2.js.map +1 -0
  77. prefect/server/ui-v2/assets/{flow-run._id-ZBlKBwPO.js → flow-run._id-BOp38Pbq.js} +2 -2
  78. prefect/server/ui-v2/assets/{flow-run._id-ZBlKBwPO.js.map → flow-run._id-BOp38Pbq.js.map} +1 -1
  79. prefect/server/ui-v2/assets/flow-run._id-DJnTDEN_.js +2 -0
  80. prefect/server/ui-v2/assets/{flow-run._id-OL0YhyLW.js.map → flow-run._id-DJnTDEN_.js.map} +1 -1
  81. prefect/server/ui-v2/assets/flow-run._id-D_wY_rBe.js +4 -0
  82. prefect/server/ui-v2/assets/flow-run._id-D_wY_rBe.js.map +1 -0
  83. prefect/server/ui-v2/assets/flow-runs-pagination-Bq2ZUzM6.js +2 -0
  84. prefect/server/ui-v2/assets/flow-runs-pagination-Bq2ZUzM6.js.map +1 -0
  85. prefect/server/ui-v2/assets/flow._id-eCBL95rg.js +2 -0
  86. prefect/server/ui-v2/assets/{flow._id-DhrCicwR.js.map → flow._id-eCBL95rg.js.map} +1 -1
  87. prefect/server/ui-v2/assets/{form-BTub_PhK.js → form-DNerk3LS.js} +2 -2
  88. prefect/server/ui-v2/assets/{form-BTub_PhK.js.map → form-DNerk3LS.js.map} +1 -1
  89. prefect/server/ui-v2/assets/{header-6wmrKLU3.js → header-B0ejRncu.js} +2 -2
  90. prefect/server/ui-v2/assets/{header-6wmrKLU3.js.map → header-B0ejRncu.js.map} +1 -1
  91. prefect/server/ui-v2/assets/{header-Dp9qi8fq.js → header-DwagHBlF.js} +2 -2
  92. prefect/server/ui-v2/assets/{header-Dp9qi8fq.js.map → header-DwagHBlF.js.map} +1 -1
  93. prefect/server/ui-v2/assets/{header-B75eb688.js → header-huSvwxKI.js} +2 -2
  94. prefect/server/ui-v2/assets/{header-B75eb688.js.map → header-huSvwxKI.js.map} +1 -1
  95. prefect/server/ui-v2/assets/{index-DSaSov8V.js → index-BO3SOwdV.js} +2 -2
  96. prefect/server/ui-v2/assets/{index-DSaSov8V.js.map → index-BO3SOwdV.js.map} +1 -1
  97. prefect/server/ui-v2/assets/{index-DOkFJdYY.js → index-BTPE3vs7.js} +2 -2
  98. prefect/server/ui-v2/assets/{index-DOkFJdYY.js.map → index-BTPE3vs7.js.map} +1 -1
  99. prefect/server/ui-v2/assets/index-BU4yZRd3.js +2 -0
  100. prefect/server/ui-v2/assets/{index-Cs8eFQKw.js.map → index-BU4yZRd3.js.map} +1 -1
  101. prefect/server/ui-v2/assets/index-BhALpenO.js +2 -0
  102. prefect/server/ui-v2/assets/{index-qPlIYf3i.js.map → index-BhALpenO.js.map} +1 -1
  103. prefect/server/ui-v2/assets/index-BzN9bQeM.js +2 -0
  104. prefect/server/ui-v2/assets/{index-CT_nG86y.js.map → index-BzN9bQeM.js.map} +1 -1
  105. prefect/server/ui-v2/assets/{index-zpb5iSCL.js → index-CBhi1P9g.js} +2 -2
  106. prefect/server/ui-v2/assets/{index-zpb5iSCL.js.map → index-CBhi1P9g.js.map} +1 -1
  107. prefect/server/ui-v2/assets/{index-UN2Tx4jH.js → index-CRDz4nhM.js} +2 -2
  108. prefect/server/ui-v2/assets/{index-UN2Tx4jH.js.map → index-CRDz4nhM.js.map} +1 -1
  109. prefect/server/ui-v2/assets/index-CTnoa3Ho.js +2 -0
  110. prefect/server/ui-v2/assets/index-CTnoa3Ho.js.map +1 -0
  111. prefect/server/ui-v2/assets/{index-DzMGV8GV.js → index-CWkbSdxY.js} +2 -2
  112. prefect/server/ui-v2/assets/{index-DzMGV8GV.js.map → index-CWkbSdxY.js.map} +1 -1
  113. prefect/server/ui-v2/assets/index-CgOsOj5t.js +2 -0
  114. prefect/server/ui-v2/assets/{index-7ThYp9SY.js.map → index-CgOsOj5t.js.map} +1 -1
  115. prefect/server/ui-v2/assets/{index-CGWoVV2s.js → index-CnIJUujl.js} +2 -2
  116. prefect/server/ui-v2/assets/{index-CGWoVV2s.js.map → index-CnIJUujl.js.map} +1 -1
  117. prefect/server/ui-v2/assets/{index-D08xgmV0.js → index-Cutg_A1j.js} +2 -2
  118. prefect/server/ui-v2/assets/{index-D08xgmV0.js.map → index-Cutg_A1j.js.map} +1 -1
  119. prefect/server/ui-v2/assets/index-D5RdrxkU.js +17 -0
  120. prefect/server/ui-v2/assets/index-D5RdrxkU.js.map +1 -0
  121. prefect/server/ui-v2/assets/{index-DfiNsXba.js → index-DDiyFpIV.js} +2 -2
  122. prefect/server/ui-v2/assets/{index-DfiNsXba.js.map → index-DDiyFpIV.js.map} +1 -1
  123. prefect/server/ui-v2/assets/{index-BA7ACCoL.js → index-DI2DC5gd.js} +2 -2
  124. prefect/server/ui-v2/assets/{index-BA7ACCoL.js.map → index-DI2DC5gd.js.map} +1 -1
  125. prefect/server/ui-v2/assets/index-Dg_duvDx.js +2 -0
  126. prefect/server/ui-v2/assets/{index-B_3f8Hcb.js.map → index-Dg_duvDx.js.map} +1 -1
  127. prefect/server/ui-v2/assets/index-Dspw5HFj.js +2 -0
  128. prefect/server/ui-v2/assets/{index-7-r4ia_S.js.map → index-Dspw5HFj.js.map} +1 -1
  129. prefect/server/ui-v2/assets/index-NY089eTx.css +1 -0
  130. prefect/server/ui-v2/assets/{index-DYOACRXY.js → index-VOOLxiSE.js} +2 -2
  131. prefect/server/ui-v2/assets/{index-DYOACRXY.js.map → index-VOOLxiSE.js.map} +1 -1
  132. prefect/server/ui-v2/assets/{index-HGoNWFfP.js → index-Wfs7Cjew.js} +2 -2
  133. prefect/server/ui-v2/assets/{index-HGoNWFfP.js.map → index-Wfs7Cjew.js.map} +1 -1
  134. prefect/server/ui-v2/assets/index-dSUEBAqg.js +2 -0
  135. prefect/server/ui-v2/assets/{index-H6bwm6L6.js.map → index-dSUEBAqg.js.map} +1 -1
  136. prefect/server/ui-v2/assets/{index-D3ILnEzm.js → index-uvH5a3zO.js} +2 -2
  137. prefect/server/ui-v2/assets/{index-D3ILnEzm.js.map → index-uvH5a3zO.js.map} +1 -1
  138. prefect/server/ui-v2/assets/{json-input-9UPGqxTw.js → json-input-gXz7BuJj.js} +2 -2
  139. prefect/server/ui-v2/assets/{json-input-9UPGqxTw.js.map → json-input-gXz7BuJj.js.map} +1 -1
  140. prefect/server/ui-v2/assets/{key._key-CTFfXO_k.js → key._key-CJPbLXwU.js} +2 -2
  141. prefect/server/ui-v2/assets/{key._key-CTFfXO_k.js.map → key._key-CJPbLXwU.js.map} +1 -1
  142. prefect/server/ui-v2/assets/{lazy-markdown-BHwIrC8E.js → lazy-markdown-wPid80zf.js} +2 -2
  143. prefect/server/ui-v2/assets/{lazy-markdown-BHwIrC8E.js.map → lazy-markdown-wPid80zf.js.map} +1 -1
  144. prefect/server/ui-v2/assets/{login-kqmT29n7.js → login-DC63bGXK.js} +2 -2
  145. prefect/server/ui-v2/assets/{login-kqmT29n7.js.map → login-DC63bGXK.js.map} +1 -1
  146. prefect/server/ui-v2/assets/{markdown-input-BesmAbLS.js → markdown-input-BhqrU6Eo.js} +2 -2
  147. prefect/server/ui-v2/assets/{markdown-input-BesmAbLS.js.map → markdown-input-BhqrU6Eo.js.map} +1 -1
  148. prefect/server/ui-v2/assets/{python-example-snippet-COTWYn1Y.js → python-example-snippet-3jtXWQZN.js} +3 -3
  149. prefect/server/ui-v2/assets/{python-example-snippet-COTWYn1Y.js.map → python-example-snippet-3jtXWQZN.js.map} +1 -1
  150. prefect/server/ui-v2/assets/{python-input-Bjccebi0.js → python-input-ZVi-v324.js} +2 -2
  151. prefect/server/ui-v2/assets/{python-input-Bjccebi0.js.map → python-input-ZVi-v324.js.map} +1 -1
  152. prefect/server/ui-v2/assets/{radio-group-DkAK0M2h.js → radio-group-BBMLpHGc.js} +2 -2
  153. prefect/server/ui-v2/assets/{radio-group-DkAK0M2h.js.map → radio-group-BBMLpHGc.js.map} +1 -1
  154. prefect/server/ui-v2/assets/route-error-state-BJXl8qkX.js +2 -0
  155. prefect/server/ui-v2/assets/{route-error-state-ALftyvGl.js.map → route-error-state-BJXl8qkX.js.map} +1 -1
  156. prefect/server/ui-v2/assets/{schema-form-BR4E-WXE.js → schema-form-BEqYjsM-.js} +2 -2
  157. prefect/server/ui-v2/assets/{schema-form-BR4E-WXE.js.map → schema-form-BEqYjsM-.js.map} +1 -1
  158. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BhL8C5NS.js → schema-form-input-string-format-datetime-l3xt3PWf.js} +4 -4
  159. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BhL8C5NS.js.map → schema-form-input-string-format-datetime-l3xt3PWf.js.map} +1 -1
  160. prefect/server/ui-v2/assets/settings-txD0dR5Q.js +2 -0
  161. prefect/server/ui-v2/assets/settings-txD0dR5Q.js.map +1 -0
  162. prefect/server/ui-v2/assets/{sort-filter-BD4vwJXt.js → sort-filter-DHPFdKZ2.js} +2 -2
  163. prefect/server/ui-v2/assets/{sort-filter-BD4vwJXt.js.map → sort-filter-DHPFdKZ2.js.map} +1 -1
  164. prefect/server/ui-v2/assets/state-colors-CAAf0Eg3.js +2 -0
  165. prefect/server/ui-v2/assets/state-colors-CAAf0Eg3.js.map +1 -0
  166. prefect/server/ui-v2/assets/table-ULfpXJXB.js +2 -0
  167. prefect/server/ui-v2/assets/table-ULfpXJXB.js.map +1 -0
  168. prefect/server/ui-v2/assets/tags-input-BLzMOTDb.js +2 -0
  169. prefect/server/ui-v2/assets/tags-input-BLzMOTDb.js.map +1 -0
  170. prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-BpeKHk7g.js +2 -0
  171. prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CG3den1B.js.map → task-run-concurrency-limits-reset-dialog-BpeKHk7g.js.map} +1 -1
  172. prefect/server/ui-v2/assets/{task-run._id-DOcIzVi0.js → task-run._id-CkOl9MJs.js} +3 -3
  173. prefect/server/ui-v2/assets/{task-run._id-DOcIzVi0.js.map → task-run._id-CkOl9MJs.js.map} +1 -1
  174. prefect/server/ui-v2/assets/task-run._id-udkz1lhh.js +2 -0
  175. prefect/server/ui-v2/assets/{task-run._id-CnIVqU6v.js.map → task-run._id-udkz1lhh.js.map} +1 -1
  176. prefect/server/ui-v2/assets/task-runs-pagination-B7D5K_FM.js +2 -0
  177. prefect/server/ui-v2/assets/{task-runs-pagination-DLSAz-Ur.js.map → task-runs-pagination-B7D5K_FM.js.map} +1 -1
  178. prefect/server/ui-v2/assets/{textarea-D8LjlIx7.js → textarea-C4bdj7Jk.js} +2 -2
  179. prefect/server/ui-v2/assets/{textarea-D8LjlIx7.js.map → textarea-C4bdj7Jk.js.map} +1 -1
  180. prefect/server/ui-v2/assets/{timezone-select-BG3cL3-U.js → timezone-select-AdlSRQxZ.js} +2 -2
  181. prefect/server/ui-v2/assets/{timezone-select-BG3cL3-U.js.map → timezone-select-AdlSRQxZ.js.map} +1 -1
  182. prefect/server/ui-v2/assets/{toggle-group-D3zeurIL.js → toggle-group-C-vxYz4l.js} +2 -2
  183. prefect/server/ui-v2/assets/{toggle-group-D3zeurIL.js.map → toggle-group-C-vxYz4l.js.map} +1 -1
  184. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-Cqhaqtqe.js +2 -0
  185. prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-Bzy2ML2T.js.map → use-delete-automation-confirmation-dialog-Cqhaqtqe.js.map} +1 -1
  186. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DRAP-Tnu.js → use-delete-block-document-confirmation-dialog-GjNhFxZe.js} +2 -2
  187. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-DRAP-Tnu.js.map → use-delete-block-document-confirmation-dialog-GjNhFxZe.js.map} +1 -1
  188. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D4yWonR8.js → use-flow-runs-selected-rows-DfwmswyR.js} +2 -2
  189. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-D4yWonR8.js.map → use-flow-runs-selected-rows-DfwmswyR.js.map} +1 -1
  190. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DZeBiVd9.js → use-get-artifacts-flow-task-runs-BEBpG_5J.js} +2 -2
  191. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DZeBiVd9.js.map → use-get-artifacts-flow-task-runs-BEBpG_5J.js.map} +1 -1
  192. prefect/server/ui-v2/assets/{use-quick-run-BxAMqZDM.js → use-quick-run-BYBRcDwC.js} +2 -2
  193. prefect/server/ui-v2/assets/{use-quick-run-BxAMqZDM.js.map → use-quick-run-BYBRcDwC.js.map} +1 -1
  194. prefect/server/ui-v2/assets/{use-stepper-T3wAKNvM.js → use-stepper-Bk97vOTm.js} +2 -2
  195. prefect/server/ui-v2/assets/{use-stepper-T3wAKNvM.js.map → use-stepper-Bk97vOTm.js.map} +1 -1
  196. prefect/server/ui-v2/assets/{utilities-B2JMf8iI.js → utilities-BQwGFLk5.js} +2 -2
  197. prefect/server/ui-v2/assets/{utilities-B2JMf8iI.js.map → utilities-BQwGFLk5.js.map} +1 -1
  198. prefect/server/ui-v2/assets/{work-pool-filter-CZz0AJlt.js → work-pool-filter-Ddhp_M-L.js} +2 -2
  199. prefect/server/ui-v2/assets/{work-pool-filter-CZz0AJlt.js.map → work-pool-filter-Ddhp_M-L.js.map} +1 -1
  200. prefect/server/ui-v2/assets/work-pool-queue-toggle-DX3eV3R_.js +2 -0
  201. prefect/server/ui-v2/assets/{work-pool-queue-toggle-D4eeo-hi.js.map → work-pool-queue-toggle-DX3eV3R_.js.map} +1 -1
  202. prefect/server/ui-v2/assets/{work-pool._workPoolName-DrWddu9K.js → work-pool._workPoolName-BaRIsXBX.js} +2 -2
  203. prefect/server/ui-v2/assets/{work-pool._workPoolName-DrWddu9K.js.map → work-pool._workPoolName-BaRIsXBX.js.map} +1 -1
  204. prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-dhS_Xz32.js +2 -0
  205. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CA0ePjCk.js.map → work-pool_._workPoolName.edit-dhS_Xz32.js.map} +1 -1
  206. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DpUnE86v.js → work-pool_._workPoolName.queue._workQueueName-BlstL9Se.js} +2 -2
  207. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DpUnE86v.js.map → work-pool_._workPoolName.queue._workQueueName-BlstL9Se.js.map} +1 -1
  208. prefect/server/ui-v2/assets/{work-queue-icon-text-BjiA7vAW.js → work-queue-icon-text-_Ez8e2dw.js} +2 -2
  209. prefect/server/ui-v2/assets/{work-queue-icon-text-BjiA7vAW.js.map → work-queue-icon-text-_Ez8e2dw.js.map} +1 -1
  210. prefect/server/ui-v2/index.html +2 -2
  211. prefect/settings/models/flows.py +14 -1
  212. prefect/settings/models/runner.py +16 -6
  213. prefect/task_engine.py +17 -3
  214. prefect/task_worker.py +99 -17
  215. prefect/tasks.py +2 -2
  216. prefect/testing/fixtures.py +41 -6
  217. {prefect-3.6.12.dist-info → prefect-3.6.13.dist-info}/METADATA +1 -1
  218. {prefect-3.6.12.dist-info → prefect-3.6.13.dist-info}/RECORD +221 -220
  219. prefect/server/ui-v2/assets/automation._id-IHh5QJwE.js +0 -2
  220. prefect/server/ui-v2/assets/block-type-logo-B31LJm5H.js +0 -2
  221. prefect/server/ui-v2/assets/block_._id.edit-CIhIBJrm.js +0 -2
  222. prefect/server/ui-v2/assets/catalog-CfniU0UV.js +0 -2
  223. prefect/server/ui-v2/assets/catalog_._slug-C9p86T4s.js +0 -2
  224. prefect/server/ui-v2/assets/catalog_._slug_.create-BhSunL__.js +0 -2
  225. prefect/server/ui-v2/assets/delete-confirmation-dialog-COdZmNfa.js +0 -2
  226. prefect/server/ui-v2/assets/deployment._id-DVmqclRz.js +0 -2
  227. prefect/server/ui-v2/assets/deployment_._id.duplicate-DVMjpk5m.js +0 -2
  228. prefect/server/ui-v2/assets/deployment_._id.edit-Ck_P6KDn.js +0 -2
  229. prefect/server/ui-v2/assets/flow-run-graph-CfoPEAgQ.js +0 -2
  230. prefect/server/ui-v2/assets/flow-run-graph-CfoPEAgQ.js.map +0 -1
  231. prefect/server/ui-v2/assets/flow-run._id-C-qxwEBp.js +0 -4
  232. prefect/server/ui-v2/assets/flow-run._id-C-qxwEBp.js.map +0 -1
  233. prefect/server/ui-v2/assets/flow-run._id-OL0YhyLW.js +0 -2
  234. prefect/server/ui-v2/assets/flow-runs-pagination-DnwkJapB.js +0 -2
  235. prefect/server/ui-v2/assets/flow-runs-pagination-DnwkJapB.js.map +0 -1
  236. prefect/server/ui-v2/assets/flow._id-DhrCicwR.js +0 -2
  237. prefect/server/ui-v2/assets/index-7-r4ia_S.js +0 -2
  238. prefect/server/ui-v2/assets/index-7ThYp9SY.js +0 -2
  239. prefect/server/ui-v2/assets/index-B7zHzWQW.css +0 -1
  240. prefect/server/ui-v2/assets/index-B_3f8Hcb.js +0 -2
  241. prefect/server/ui-v2/assets/index-BiCd-Iuz.js +0 -2
  242. prefect/server/ui-v2/assets/index-BiCd-Iuz.js.map +0 -1
  243. prefect/server/ui-v2/assets/index-CT_nG86y.js +0 -2
  244. prefect/server/ui-v2/assets/index-Cs8eFQKw.js +0 -2
  245. prefect/server/ui-v2/assets/index-H6bwm6L6.js +0 -2
  246. prefect/server/ui-v2/assets/index-WYPZo52S.js +0 -17
  247. prefect/server/ui-v2/assets/index-WYPZo52S.js.map +0 -1
  248. prefect/server/ui-v2/assets/index-qPlIYf3i.js +0 -2
  249. prefect/server/ui-v2/assets/route-error-state-ALftyvGl.js +0 -2
  250. prefect/server/ui-v2/assets/settings-BL0X8cDU.js +0 -2
  251. prefect/server/ui-v2/assets/settings-BL0X8cDU.js.map +0 -1
  252. prefect/server/ui-v2/assets/table-CEAx-qHs.js +0 -2
  253. prefect/server/ui-v2/assets/table-CEAx-qHs.js.map +0 -1
  254. prefect/server/ui-v2/assets/tags-input-D1RJZEUA.js +0 -2
  255. prefect/server/ui-v2/assets/tags-input-D1RJZEUA.js.map +0 -1
  256. prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-CG3den1B.js +0 -2
  257. prefect/server/ui-v2/assets/task-run._id-CnIVqU6v.js +0 -2
  258. prefect/server/ui-v2/assets/task-runs-pagination-DLSAz-Ur.js +0 -2
  259. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-Bzy2ML2T.js +0 -2
  260. prefect/server/ui-v2/assets/use-local-storage-CpxMp5wR.js +0 -2
  261. prefect/server/ui-v2/assets/use-local-storage-CpxMp5wR.js.map +0 -1
  262. prefect/server/ui-v2/assets/work-pool-queue-toggle-D4eeo-hi.js +0 -2
  263. prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-CA0ePjCk.js +0 -2
  264. {prefect-3.6.12.dist-info → prefect-3.6.13.dist-info}/WHEEL +0 -0
  265. {prefect-3.6.12.dist-info → prefect-3.6.13.dist-info}/entry_points.txt +0 -0
  266. {prefect-3.6.12.dist-info → prefect-3.6.13.dist-info}/licenses/LICENSE +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index-7ThYp9SY.js","sources":["../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state/global-concurrency-limits-empty-state.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/global-conccurency-limits-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state/task-run-concurrency-limits-empty-state.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-concurrency-limits-header.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/task-run-concurrency-limit-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx","../../src/components/concurrency/concurrency-limits-tabs.tsx","../../src/components/concurrency/concurrency-limits-page.tsx","../../src/routes/concurrency-limits/index.tsx?tsr-split=component"],"sourcesContent":["import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype ActionsCellProps = CellContext<GlobalConcurrencyLimit, unknown> & {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const ActionsCell = ({\n\tonEditRow,\n\tonDeleteRow,\n\t...props\n}: ActionsCellProps) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\tconst row = props.row.original;\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(row.id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onDeleteRow(row)}>\n\t\t\t\t\tDelete\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onEditRow(row)}>Edit</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Switch } from \"@/components/ui/switch\";\n\nexport const ActiveCell = (\n\tprops: CellContext<GlobalConcurrencyLimit, boolean>,\n) => {\n\tconst { updateGlobalConcurrencyLimit } = useUpdateGlobalConcurrencyLimit();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateGlobalConcurrencyLimit(\n\t\t\t{\n\t\t\t\tid_or_name: id,\n\t\t\t\tactive: checked,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Concurrency limit updated\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating active field.\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\tconst rowActive = props.getValue();\n\tconst rowId = props.row.original.id;\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle active\"\n\t\t\tchecked={rowActive}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, rowId)}\n\t\t/>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport { ActionsCell } from \"./actions-cell\";\nimport { ActiveCell } from \"./active-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\nconst columnHelper = createColumnHelper<GlobalConcurrencyLimit>();\n\nconst createColumns = ({\n\tonEditRow,\n\tonDeleteRow,\n}: {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"name\", {\n\t\theader: \"Name\",\n\t}),\n\tcolumnHelper.accessor(\"limit\", {\n\t\theader: \"Limit\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Slots\",\n\t}),\n\tcolumnHelper.accessor(\"slot_decay_per_second\", {\n\t\theader: \"Slots Decay Per Second\",\n\t}),\n\tcolumnHelper.accessor(\"active\", {\n\t\theader: \"Active\",\n\t\tcell: ActiveCell,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => (\n\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t<ActionsCell\n\t\t\t\t\t{...props}\n\t\t\t\t\tonEditRow={onEditRow}\n\t\t\t\t\tonDeleteRow={onDeleteRow}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t),\n\t}),\n];\n\ntype GlobalConcurrencyLimitsDataTableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const GlobalConcurrencyLimitsDataTable = ({\n\tdata,\n\tonEditRow,\n\tonDeleteRow,\n}: GlobalConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonEditRow={onEditRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonEditRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onEditRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search global concurrency limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const GlobalConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"AlignVerticalJustifyStart\" />\n\t\t<EmptyStateTitle>Add a concurrency limit</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tGlobal concurrency limits can be applied to flow runs, task runs and any\n\t\t\toperation where you want to control concurrency.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"global-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const GlobalConcurrencyLimitsHeader = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tGlobal Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add global concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useEffect } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseCreateGlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\n\nconst formSchema = z.object({\n\tactive: z.boolean().default(true),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tdenied_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tlimit: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\tname: z\n\t\t.string()\n\t\t.min(2, { message: \"Name must be at least 2 characters\" })\n\t\t.default(\"\"),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tslot_decay_per_second: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n\t/** Additional fields post creation. Coerce to solve common issue of transforming a string number to a number type */\n\tactive_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\tactive: true,\n\tname: \"\",\n\tlimit: 0,\n\tslot_decay_per_second: 0,\n\tdenied_slots: 0,\n\tactive_slots: 0,\n} as const;\n\ntype UseCreateOrEditGlobalConcurrencyLimitFormOptions = {\n\t/** Limit to edit. Pass undefined if creating a new limit */\n\tlimitToUpdate: GlobalConcurrencyLimit | undefined;\n\t/** Callback after hitting Save or Update */\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditGlobalConcurrencyLimitForm = ({\n\tlimitToUpdate,\n\tonSubmit,\n}: UseCreateOrEditGlobalConcurrencyLimitFormOptions) => {\n\tconst { createGlobalConcurrencyLimit, status: createStatus } =\n\t\tuseCreateGlobalConcurrencyLimit();\n\tconst { updateGlobalConcurrencyLimit, status: updateStatus } =\n\t\tuseUpdateGlobalConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with limit-to-edit data\n\tuseEffect(() => {\n\t\tif (limitToUpdate) {\n\t\t\tconst { active, name, limit, slot_decay_per_second, active_slots } =\n\t\t\t\tlimitToUpdate;\n\t\t\tform.reset({ active, name, limit, slot_decay_per_second, active_slots });\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, limitToUpdate]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst onSettled = () => {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\tonSubmit();\n\t\t};\n\n\t\tif (limitToUpdate?.id) {\n\t\t\tupdateGlobalConcurrencyLimit(\n\t\t\t\t{\n\t\t\t\t\tid_or_name: limitToUpdate.id,\n\t\t\t\t\t...values,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Limit updated\");\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while updating limit.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t\tonSettled,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateGlobalConcurrencyLimit(values, {\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Limit created\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while creating variable.\";\n\t\t\t\t\tform.setError(\"root\", {\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonSettled,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: createStatus === \"pending\" || updateStatus === \"pending\",\n\t};\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Input } from \"@/components/ui/input\";\nimport { Switch } from \"@/components/ui/switch\";\n\nimport { useCreateOrEditGlobalConcurrencyLimitForm } from \"./use-create-or-edit-global-concurrency-limit-form\";\n\ntype GlobalConcurrencyLimitsCreateOrEditDialogProps = {\n\tlimitToUpdate?: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const GlobalConcurrencyLimitsCreateOrEditDialog = ({\n\tlimitToUpdate,\n\tonOpenChange,\n\tonSubmit,\n}: GlobalConcurrencyLimitsCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } =\n\t\tuseCreateOrEditGlobalConcurrencyLimitForm({\n\t\t\tlimitToUpdate,\n\t\t\tonSubmit,\n\t\t});\n\n\tconst dialogTitle = limitToUpdate\n\t\t? `Update ${limitToUpdate.name}`\n\t\t: \"Add Concurrency Limit\";\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{dialogTitle}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(saveOrUpdate)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Name</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Concurrency Limit</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"slot_decay_per_second\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Slot Decay Per Second</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{limitToUpdate && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\t\tname=\"active_slots\"\n\t\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t\t<FormLabel>Active Slots</FormLabel>\n\t\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"active\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Active</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\t\t\t\t\t\t\tchecked={field.value}\n\t\t\t\t\t\t\t\t\t\t\tonCheckedChange={field.onChange}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isLoading}>\n\t\t\t\t\t\t\t\t{limitToUpdate ? \"Update\" : \"Save\"}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import { toast } from \"sonner\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseDeleteGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\n\ntype GlobalConcurrencyLimitsDeleteDialogProps = {\n\tlimit: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonDelete: () => void;\n};\n\nexport const GlobalConcurrencyLimitsDeleteDialog = ({\n\tlimit,\n\tonOpenChange,\n\tonDelete,\n}: GlobalConcurrencyLimitsDeleteDialogProps) => {\n\tconst { deleteGlobalConcurrencyLimit, isPending } =\n\t\tuseDeleteGlobalConcurrencyLimit();\n\n\tconst handleOnClick = (id: string) => {\n\t\tdeleteGlobalConcurrencyLimit(id, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit deleted\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message =\n\t\t\t\t\terror.message || \"Unknown error while deleting concurrency limit.\";\n\t\t\t\tconsole.error(message);\n\t\t\t},\n\t\t\tonSettled: onDelete,\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Delete Concurrency Limit</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<DialogDescription>\n\t\t\t\t\tAre you sure you want to delete {limit.name}\n\t\t\t\t</DialogDescription>\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"destructive\"\n\t\t\t\t\t\tonClick={() => handleOnClick(limit.id)}\n\t\t\t\t\t\tloading={isPending}\n\t\t\t\t\t>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsCreateOrEditDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog\";\nimport { GlobalConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"delete\" | \"edit\";\n\t\t\tdata: GlobalConcurrencyLimit;\n\t };\n\nexport const GlobalConcurrencyLimitsDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsDeleteDialog\n\t\t\t\t\tlimit={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"edit\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tlimitToUpdate={data}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseListGlobalConcurrencyLimits,\n} from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsDataTable } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table\";\nimport { GlobalConcurrencyLimitsEmptyState } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state\";\nimport { GlobalConcurrencyLimitsHeader } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-header\";\n\nimport {\n\ttype DialogState,\n\tGlobalConcurrencyLimitsDialog,\n} from \"./global-conccurency-limits-dialog\";\n\nexport const GlobalConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListGlobalConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleEditRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"edit\", data });\n\n\tconst handleDeleteRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<GlobalConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<GlobalConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<GlobalConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonEditRow={handleEditRow}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<GlobalConcurrencyLimitsDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype ActiveTaskRunCellsProps = CellContext<\n\tTaskRunConcurrencyLimit,\n\tArray<string>\n>;\n\nexport const ActiveTaskRunCells = (props: ActiveTaskRunCellsProps) => {\n\tconst activeTaskRuns = props.getValue();\n\tconst numActiveTaskRuns = activeTaskRuns.length;\n\tif (numActiveTaskRuns === 0) {\n\t\treturn \"None\";\n\t}\n\treturn numActiveTaskRuns;\n};\n","import { Link } from \"@tanstack/react-router\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype TagCellProps = CellContext<TaskRunConcurrencyLimit, string>;\n\nexport const TagCell = (props: TagCellProps) => {\n\tconst tag = props.getValue();\n\tconst id = props.row.original.id;\n\treturn (\n\t\t<Link params={{ id }} to={\"/concurrency-limits/concurrency-limit/$id\"}>\n\t\t\t{tag}\n\t\t</Link>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsActionsMenu } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\n\nimport { ActiveTaskRunCells } from \"./active-task-runs-cell\";\nimport { TagCell } from \"./tag-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\nconst columnHelper = createColumnHelper<TaskRunConcurrencyLimit>();\n\nconst createColumns = ({\n\tonDeleteRow,\n\tonResetRow,\n}: {\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"tag\", {\n\t\theader: \"Tag\",\n\t\tcell: TagCell,\n\t}),\n\tcolumnHelper.accessor(\"concurrency_limit\", {\n\t\theader: \"Slots\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Task Runs\",\n\t\tcell: ActiveTaskRunCells,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => {\n\t\t\tconst row = props.row.original;\n\t\t\treturn (\n\t\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t\t<TaskRunConcurrencyLimitsActionsMenu\n\t\t\t\t\t\tid={row.id}\n\t\t\t\t\t\tonDelete={() => onDeleteRow(row)}\n\t\t\t\t\t\tonReset={() => onResetRow(row)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t}),\n];\n\ntype TaskRunConcurrencyLimitsDataTableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n};\n\nexport const TaskRunConcurrencyLimitsDataTable = ({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n}: TaskRunConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.tag.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonResetRow={onResetRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onResetRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search active task limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const TaskRunConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"CircleArrowOutUpRight\" />\n\t\t<EmptyStateTitle>\n\t\t\tAdd a concurrency limit for your task runs\n\t\t</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tCreating a limit allows you to limit the number of tasks running\n\t\t\tsimultaneously with a given tag.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"task-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsHeader = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tTask Run Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add task run concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport { useCreateTaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Input } from \"@/components/ui/input\";\n\nconst formSchema = z.object({\n\ttag: z.string().min(1),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tconcurrency_limit: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\ttag: \"\",\n\tconcurrency_limit: 0,\n} as const;\n\ntype TaskRunConcurrencyLimitsCreateDialogProps = {\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsCreateDialog = ({\n\tonOpenChange,\n\tonSubmit,\n}: TaskRunConcurrencyLimitsCreateDialogProps) => {\n\tconst { createTaskRunConcurrencyLimit, isPending } =\n\t\tuseCreateTaskRunConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\tconst handleAddLimit = (values: z.infer<typeof formSchema>) => {\n\t\tcreateTaskRunConcurrencyLimit(values, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit added\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message = error.message || \"Unknown error while updating limit.\";\n\t\t\t\tform.setError(\"root\", { message });\n\t\t\t},\n\t\t\tonSettled: () => {\n\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\tonSubmit();\n\t\t\t},\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Add Task Run Concurrency Limit</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(handleAddLimit)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"tag\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Tag</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"concurrency_limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Concurrency Limit</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isPending}>\n\t\t\t\t\t\t\t\tAdd\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsCreateDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog\";\nimport { TaskRunConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog\";\nimport { TaskRunConcurrencyLimitsResetDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"reset\" | \"delete\";\n\t\t\tdata: TaskRunConcurrencyLimit;\n\t };\n\nexport const TaskRunConcurrencyLimitDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsCreateDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"reset\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsResetDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonReset={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsDeleteDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype TaskRunConcurrencyLimit,\n\tuseListTaskRunConcurrencyLimits,\n} from \"@/api/task-run-concurrency-limits\";\n\nimport { TaskRunConcurrencyLimitsDataTable } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table\";\nimport { TaskRunConcurrencyLimitsEmptyState } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state\";\nimport { TaskRunConcurrencyLimitsHeader } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header\";\nimport {\n\ttype DialogState,\n\tTaskRunConcurrencyLimitDialog,\n} from \"./task-run-concurrency-limit-dialog\";\n\nexport const TaskRunConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListTaskRunConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleDeleteRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleResetRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"reset\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<TaskRunConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<TaskRunConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<TaskRunConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t\tonResetRow={handleResetRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<TaskRunConcurrencyLimitDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport type { JSX } from \"react\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport type { TabOptions } from \"@/routes/concurrency-limits\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\ntype TabOptionValues = {\n\t/** Value of search value in url */\n\ttabSearchValue: TabOptions;\n\t/** Display value for the UI */\n\tdisplayValue: string;\n};\n\n/** Maps url tab option to visual name */\nconst TAB_OPTIONS: Record<TabOptions, TabOptionValues> = {\n\tglobal: {\n\t\ttabSearchValue: \"global\",\n\t\tdisplayValue: \"Global\",\n\t},\n\t\"task-run\": {\n\t\ttabSearchValue: \"task-run\",\n\t\tdisplayValue: \"Task Run\",\n\t},\n} as const;\n\ntype ConcurrencyLimitsTabsProps = {\n\tglobalView: React.ReactNode;\n\ttaskRunView: React.ReactNode;\n};\n\n// TODO: Move Tabs for navigation to a generic styled component\n\nexport const ConcurrencyLimitsTabs = ({\n\tglobalView,\n\ttaskRunView,\n}: ConcurrencyLimitsTabsProps): JSX.Element => {\n\tconst { tab } = routeApi.useSearch();\n\tconst navigate = routeApi.useNavigate();\n\n\treturn (\n\t\t<Tabs defaultValue=\"Global\" value={tab}>\n\t\t\t<TabsList>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS.global.tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS.global.tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS.global.displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS[\"task-run\"].tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS[\"task-run\"].tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS[\"task-run\"].displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t</TabsList>\n\t\t\t<TabsContent value={TAB_OPTIONS.global.tabSearchValue}>\n\t\t\t\t{globalView}\n\t\t\t</TabsContent>\n\t\t\t<TabsContent value={TAB_OPTIONS[\"task-run\"].tabSearchValue}>\n\t\t\t\t{taskRunView}\n\t\t\t</TabsContent>\n\t\t</Tabs>\n\t);\n};\n","import { GlobalConcurrencyLimitsView } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-view\";\nimport { TaskRunConcurrencyLimitsView } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\n\nimport { ConcurrencyLimitsTabs } from \"./concurrency-limits-tabs\";\n\nexport const ConcurrencyLimitsPage = () => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<ConcurrencyLimitTitle />\n\t\t\t<ConcurrencyLimitsTabs\n\t\t\t\tglobalView={<GlobalConcurrencyLimitsView />}\n\t\t\t\ttaskRunView={<TaskRunConcurrencyLimitsView />}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nconst ConcurrencyLimitTitle = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\tConcurrency\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t</div>\n);\n","import { createFileRoute } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { buildListGlobalConcurrencyLimitsQuery } from \"@/api/global-concurrency-limits\";\nimport { buildListTaskRunConcurrencyLimitsQuery } from \"@/api/task-run-concurrency-limits\";\nimport { ConcurrencyLimitsPage } from \"@/components/concurrency/concurrency-limits-page\";\n\n/**\n * Schema for validating URL search parameters for the Concurrency Limits page.\n * @property {string} search used to filter data table\n * @property {'global' | 'task-run'} tab used designate which tab view to display\n */\nconst searchParams = z.object({\n\tsearch: z.string().optional(),\n\ttab: z.enum([\"global\", \"task-run\"]).default(\"global\"),\n});\n\nexport type TabOptions = z.infer<typeof searchParams>[\"tab\"];\n\nexport const Route = createFileRoute(\"/concurrency-limits/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: ConcurrencyLimitsPage,\n\twrapInSuspense: true,\n\tloader: ({ context }) =>\n\t\tPromise.all([\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListGlobalConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListTaskRunConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t]),\n});\n"],"names":["ActionsCell","onEditRow","onDeleteRow","props","handleCopyId","id","toast","row","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","ActiveCell","updateGlobalConcurrencyLimit","useUpdateGlobalConcurrencyLimit","handleCheckedChange","checked","error","message","rowActive","rowId","Switch","routeApi","getRouteApi","columnHelper","createColumnHelper","createColumns","GlobalConcurrencyLimitsDataTable","data","navigate","search","deferredSearch","useDeferredValue","filteredData","useMemo","Table","value","prev","onSearchChange","searchValue","table","useReactTable","getCoreRowModel","getPaginationRowModel","SearchInput","e","DataTable","GlobalConcurrencyLimitsEmptyState","onAdd","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","GlobalConcurrencyLimitsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","formSchema","z.object","z.boolean","z.number","z.string","z.coerce","DEFAULT_VALUES","useCreateOrEditGlobalConcurrencyLimitForm","limitToUpdate","onSubmit","createGlobalConcurrencyLimit","createStatus","useCreateGlobalConcurrencyLimit","updateStatus","form","useForm","zodResolver","useEffect","active","name","limit","slot_decay_per_second","active_slots","values","onSettled","GlobalConcurrencyLimitsCreateOrEditDialog","onOpenChange","isLoading","saveOrUpdate","dialogTitle","Dialog","DialogContent","DialogHeader","DialogTitle","Form","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","DialogFooter","DialogTrigger","GlobalConcurrencyLimitsDeleteDialog","onDelete","deleteGlobalConcurrencyLimit","isPending","useDeleteGlobalConcurrencyLimit","handleOnClick","DialogDescription","GlobalConcurrencyLimitsDialog","openDialog","onCloseDialog","dialog","GlobalConcurrencyLimitsView","setOpenDialog","useState","useListGlobalConcurrencyLimits","handleAddRow","handleEditRow","handleDeleteRow","handleCloseDialog","handleOpenChange","open","ActiveTaskRunCells","numActiveTaskRuns","TagCell","tag","Link","onResetRow","TaskRunConcurrencyLimitsActionsMenu","TaskRunConcurrencyLimitsDataTable","TaskRunConcurrencyLimitsEmptyState","TaskRunConcurrencyLimitsHeader","TaskRunConcurrencyLimitsCreateDialog","createTaskRunConcurrencyLimit","useCreateTaskRunConcurrencyLimit","handleAddLimit","TaskRunConcurrencyLimitDialog","TaskRunConcurrencyLimitsResetDialog","TaskRunConcurrencyLimitsDeleteDialog","TaskRunConcurrencyLimitsView","useListTaskRunConcurrencyLimits","handleResetRow","TAB_OPTIONS","ConcurrencyLimitsTabs","globalView","taskRunView","tab","Tabs","TabsList","TabsTrigger","TabsContent","ConcurrencyLimitsPage","ConcurrencyLimitTitle","z","string","optional","default","SplitComponent"],"mappings":"q9BAkBO,MAAMA,GAAc,CAAC,CAC3B,UAAAC,EACA,YAAAC,EACA,GAAGC,CACJ,IAAwB,CACvB,MAAMC,EAAgBC,GAAe,CAC/B,UAAU,UAAU,UAAUA,CAAE,EACrCC,EAAM,QAAQ,WAAW,CAC1B,EAEMC,EAAMJ,EAAM,IAAI,SAEtB,cACEK,GAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,GAAA,CAAoB,QAAO,GAC3B,SAAAC,EAAAA,KAACC,GAAO,QAAQ,UAAU,UAAU,aACnC,SAAA,CAAAH,EAAAA,IAAC,OAAA,CAAK,UAAU,UAAU,SAAA,YAAS,EACnCA,EAAAA,IAACI,EAAA,CAAK,GAAG,eAAe,UAAU,QAAA,CAAS,CAAA,CAAA,CAC5C,CAAA,CACD,EACAF,EAAAA,KAACG,GAAA,CAAoB,MAAM,MAC1B,SAAA,CAAAL,EAAAA,IAACM,IAAkB,SAAA,SAAA,CAAO,EAC1BN,MAACO,GAAiB,QAAS,IAAMZ,EAAaG,EAAI,EAAE,EAAG,SAAA,UAEvD,QACCS,EAAA,CAAiB,QAAS,IAAMd,EAAYK,CAAG,EAAG,SAAA,SAEnD,QACCS,EAAA,CAAiB,QAAS,IAAMf,EAAUM,CAAG,EAAG,SAAA,MAAA,CAAI,CAAA,CAAA,CACtD,CAAA,EACD,CAEF,EC1CaU,GACZd,GACI,CACJ,KAAM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,CACA,CACF,EAEC,WAAY,OAAO,YAAA,CAAA,EAErB5I,EAAAA,IAACmJ,EAAA,CACA,MAAOP,EAAY,UAAU,EAAE,eAC/B,QAAS,IAAM,CACTnH,EAAS,CACb,GAAI,sBACJ,OAAQ,CACP,IAAKmH,EAAY,UAAU,EAAE,cAAA,CAC9B,CACA,CACF,EAEC,SAAAA,EAAY,UAAU,EAAE,YAAA,CAAA,CAC1B,EACD,QACCQ,EAAA,CAAY,MAAOR,EAAY,OAAO,eACrC,SAAAE,EACF,QACCM,EAAA,CAAY,MAAOR,EAAY,UAAU,EAAE,eAC1C,SAAAG,CAAA,CACF,CAAA,EACD,CAEF,ECpEaM,GAAwB,IAEnCnJ,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAF,EAAAA,IAACsJ,GAAA,EAAsB,EACvBtJ,EAAAA,IAAC6I,GAAA,CACA,iBAAa/B,GAAA,EAA4B,EACzC,kBAAc2B,GAAA,CAAA,CAA6B,CAAA,CAAA,CAC5C,EACD,EAIIa,GAAwB,IAC7BtJ,EAAAA,IAAC,MAAA,CAAI,UAAU,0BACd,SAAAA,EAAAA,IAACoD,EAAA,CACA,SAAApD,EAAAA,IAACqD,EAAA,CACA,eAACC,EAAA,CAAe,UAAU,wBAAwB,SAAA,aAAA,CAElD,EACD,EACD,CAAA,CACD,ECnBoBiG,EAAS,CAC7B7H,OAAQ6H,EAAEC,EAASC,SAAAA,EACnBT,IAAKO,GAAO,CAAC,SAAU,UAAU,CAAC,EAAEG,QAAQ,QAAQ,CACrD,CAAC,EAE4D,MAAAC,GAZpDN"}
1
+ {"version":3,"file":"index-CgOsOj5t.js","sources":["../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state/global-concurrency-limits-empty-state.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/global-conccurency-limits-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state/task-run-concurrency-limits-empty-state.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-concurrency-limits-header.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/task-run-concurrency-limit-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx","../../src/components/concurrency/concurrency-limits-tabs.tsx","../../src/components/concurrency/concurrency-limits-page.tsx","../../src/routes/concurrency-limits/index.tsx?tsr-split=component"],"sourcesContent":["import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype ActionsCellProps = CellContext<GlobalConcurrencyLimit, unknown> & {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const ActionsCell = ({\n\tonEditRow,\n\tonDeleteRow,\n\t...props\n}: ActionsCellProps) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\tconst row = props.row.original;\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(row.id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onDeleteRow(row)}>\n\t\t\t\t\tDelete\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onEditRow(row)}>Edit</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Switch } from \"@/components/ui/switch\";\n\nexport const ActiveCell = (\n\tprops: CellContext<GlobalConcurrencyLimit, boolean>,\n) => {\n\tconst { updateGlobalConcurrencyLimit } = useUpdateGlobalConcurrencyLimit();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateGlobalConcurrencyLimit(\n\t\t\t{\n\t\t\t\tid_or_name: id,\n\t\t\t\tactive: checked,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Concurrency limit updated\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating active field.\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\tconst rowActive = props.getValue();\n\tconst rowId = props.row.original.id;\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle active\"\n\t\t\tchecked={rowActive}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, rowId)}\n\t\t/>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport { ActionsCell } from \"./actions-cell\";\nimport { ActiveCell } from \"./active-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\nconst columnHelper = createColumnHelper<GlobalConcurrencyLimit>();\n\nconst createColumns = ({\n\tonEditRow,\n\tonDeleteRow,\n}: {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"name\", {\n\t\theader: \"Name\",\n\t}),\n\tcolumnHelper.accessor(\"limit\", {\n\t\theader: \"Limit\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Slots\",\n\t}),\n\tcolumnHelper.accessor(\"slot_decay_per_second\", {\n\t\theader: \"Slots Decay Per Second\",\n\t}),\n\tcolumnHelper.accessor(\"active\", {\n\t\theader: \"Active\",\n\t\tcell: ActiveCell,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => (\n\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t<ActionsCell\n\t\t\t\t\t{...props}\n\t\t\t\t\tonEditRow={onEditRow}\n\t\t\t\t\tonDeleteRow={onDeleteRow}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t),\n\t}),\n];\n\ntype GlobalConcurrencyLimitsDataTableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const GlobalConcurrencyLimitsDataTable = ({\n\tdata,\n\tonEditRow,\n\tonDeleteRow,\n}: GlobalConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonEditRow={onEditRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonEditRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onEditRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search global concurrency limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const GlobalConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"AlignVerticalJustifyStart\" />\n\t\t<EmptyStateTitle>Add a concurrency limit</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tGlobal concurrency limits can be applied to flow runs, task runs and any\n\t\t\toperation where you want to control concurrency.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"global-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const GlobalConcurrencyLimitsHeader = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tGlobal Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add global concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useEffect } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseCreateGlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\n\nconst formSchema = z.object({\n\tactive: z.boolean().default(true),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tdenied_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tlimit: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\tname: z\n\t\t.string()\n\t\t.min(2, { message: \"Name must be at least 2 characters\" })\n\t\t.default(\"\"),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tslot_decay_per_second: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n\t/** Additional fields post creation. Coerce to solve common issue of transforming a string number to a number type */\n\tactive_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\tactive: true,\n\tname: \"\",\n\tlimit: 0,\n\tslot_decay_per_second: 0,\n\tdenied_slots: 0,\n\tactive_slots: 0,\n} as const;\n\ntype UseCreateOrEditGlobalConcurrencyLimitFormOptions = {\n\t/** Limit to edit. Pass undefined if creating a new limit */\n\tlimitToUpdate: GlobalConcurrencyLimit | undefined;\n\t/** Callback after hitting Save or Update */\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditGlobalConcurrencyLimitForm = ({\n\tlimitToUpdate,\n\tonSubmit,\n}: UseCreateOrEditGlobalConcurrencyLimitFormOptions) => {\n\tconst { createGlobalConcurrencyLimit, status: createStatus } =\n\t\tuseCreateGlobalConcurrencyLimit();\n\tconst { updateGlobalConcurrencyLimit, status: updateStatus } =\n\t\tuseUpdateGlobalConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with limit-to-edit data\n\tuseEffect(() => {\n\t\tif (limitToUpdate) {\n\t\t\tconst { active, name, limit, slot_decay_per_second, active_slots } =\n\t\t\t\tlimitToUpdate;\n\t\t\tform.reset({ active, name, limit, slot_decay_per_second, active_slots });\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, limitToUpdate]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst onSettled = () => {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\tonSubmit();\n\t\t};\n\n\t\tif (limitToUpdate?.id) {\n\t\t\tupdateGlobalConcurrencyLimit(\n\t\t\t\t{\n\t\t\t\t\tid_or_name: limitToUpdate.id,\n\t\t\t\t\t...values,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Limit updated\");\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while updating limit.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t\tonSettled,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateGlobalConcurrencyLimit(values, {\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Limit created\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while creating variable.\";\n\t\t\t\t\tform.setError(\"root\", {\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonSettled,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: createStatus === \"pending\" || updateStatus === \"pending\",\n\t};\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Input } from \"@/components/ui/input\";\nimport { Switch } from \"@/components/ui/switch\";\n\nimport { useCreateOrEditGlobalConcurrencyLimitForm } from \"./use-create-or-edit-global-concurrency-limit-form\";\n\ntype GlobalConcurrencyLimitsCreateOrEditDialogProps = {\n\tlimitToUpdate?: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const GlobalConcurrencyLimitsCreateOrEditDialog = ({\n\tlimitToUpdate,\n\tonOpenChange,\n\tonSubmit,\n}: GlobalConcurrencyLimitsCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } =\n\t\tuseCreateOrEditGlobalConcurrencyLimitForm({\n\t\t\tlimitToUpdate,\n\t\t\tonSubmit,\n\t\t});\n\n\tconst dialogTitle = limitToUpdate\n\t\t? `Update ${limitToUpdate.name}`\n\t\t: \"Add Concurrency Limit\";\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{dialogTitle}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(saveOrUpdate)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Name</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Concurrency Limit</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"slot_decay_per_second\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Slot Decay Per Second</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{limitToUpdate && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\t\tname=\"active_slots\"\n\t\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t\t<FormLabel>Active Slots</FormLabel>\n\t\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"active\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Active</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\t\t\t\t\t\t\tchecked={field.value}\n\t\t\t\t\t\t\t\t\t\t\tonCheckedChange={field.onChange}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isLoading}>\n\t\t\t\t\t\t\t\t{limitToUpdate ? \"Update\" : \"Save\"}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import { toast } from \"sonner\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseDeleteGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\n\ntype GlobalConcurrencyLimitsDeleteDialogProps = {\n\tlimit: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonDelete: () => void;\n};\n\nexport const GlobalConcurrencyLimitsDeleteDialog = ({\n\tlimit,\n\tonOpenChange,\n\tonDelete,\n}: GlobalConcurrencyLimitsDeleteDialogProps) => {\n\tconst { deleteGlobalConcurrencyLimit, isPending } =\n\t\tuseDeleteGlobalConcurrencyLimit();\n\n\tconst handleOnClick = (id: string) => {\n\t\tdeleteGlobalConcurrencyLimit(id, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit deleted\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message =\n\t\t\t\t\terror.message || \"Unknown error while deleting concurrency limit.\";\n\t\t\t\tconsole.error(message);\n\t\t\t},\n\t\t\tonSettled: onDelete,\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Delete Concurrency Limit</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<DialogDescription>\n\t\t\t\t\tAre you sure you want to delete {limit.name}\n\t\t\t\t</DialogDescription>\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"destructive\"\n\t\t\t\t\t\tonClick={() => handleOnClick(limit.id)}\n\t\t\t\t\t\tloading={isPending}\n\t\t\t\t\t>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsCreateOrEditDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog\";\nimport { GlobalConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"delete\" | \"edit\";\n\t\t\tdata: GlobalConcurrencyLimit;\n\t };\n\nexport const GlobalConcurrencyLimitsDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsDeleteDialog\n\t\t\t\t\tlimit={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"edit\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tlimitToUpdate={data}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseListGlobalConcurrencyLimits,\n} from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsDataTable } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table\";\nimport { GlobalConcurrencyLimitsEmptyState } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state\";\nimport { GlobalConcurrencyLimitsHeader } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-header\";\n\nimport {\n\ttype DialogState,\n\tGlobalConcurrencyLimitsDialog,\n} from \"./global-conccurency-limits-dialog\";\n\nexport const GlobalConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListGlobalConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleEditRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"edit\", data });\n\n\tconst handleDeleteRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<GlobalConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<GlobalConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<GlobalConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonEditRow={handleEditRow}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<GlobalConcurrencyLimitsDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype ActiveTaskRunCellsProps = CellContext<\n\tTaskRunConcurrencyLimit,\n\tArray<string>\n>;\n\nexport const ActiveTaskRunCells = (props: ActiveTaskRunCellsProps) => {\n\tconst activeTaskRuns = props.getValue();\n\tconst numActiveTaskRuns = activeTaskRuns.length;\n\tif (numActiveTaskRuns === 0) {\n\t\treturn \"None\";\n\t}\n\treturn numActiveTaskRuns;\n};\n","import { Link } from \"@tanstack/react-router\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype TagCellProps = CellContext<TaskRunConcurrencyLimit, string>;\n\nexport const TagCell = (props: TagCellProps) => {\n\tconst tag = props.getValue();\n\tconst id = props.row.original.id;\n\treturn (\n\t\t<Link params={{ id }} to={\"/concurrency-limits/concurrency-limit/$id\"}>\n\t\t\t{tag}\n\t\t</Link>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsActionsMenu } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\n\nimport { ActiveTaskRunCells } from \"./active-task-runs-cell\";\nimport { TagCell } from \"./tag-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\nconst columnHelper = createColumnHelper<TaskRunConcurrencyLimit>();\n\nconst createColumns = ({\n\tonDeleteRow,\n\tonResetRow,\n}: {\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"tag\", {\n\t\theader: \"Tag\",\n\t\tcell: TagCell,\n\t}),\n\tcolumnHelper.accessor(\"concurrency_limit\", {\n\t\theader: \"Slots\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Task Runs\",\n\t\tcell: ActiveTaskRunCells,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => {\n\t\t\tconst row = props.row.original;\n\t\t\treturn (\n\t\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t\t<TaskRunConcurrencyLimitsActionsMenu\n\t\t\t\t\t\tid={row.id}\n\t\t\t\t\t\tonDelete={() => onDeleteRow(row)}\n\t\t\t\t\t\tonReset={() => onResetRow(row)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t}),\n];\n\ntype TaskRunConcurrencyLimitsDataTableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n};\n\nexport const TaskRunConcurrencyLimitsDataTable = ({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n}: TaskRunConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.tag.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonResetRow={onResetRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onResetRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search active task limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const TaskRunConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"CircleArrowOutUpRight\" />\n\t\t<EmptyStateTitle>\n\t\t\tAdd a concurrency limit for your task runs\n\t\t</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tCreating a limit allows you to limit the number of tasks running\n\t\t\tsimultaneously with a given tag.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"task-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsHeader = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tTask Run Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add task run concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport { useCreateTaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Input } from \"@/components/ui/input\";\n\nconst formSchema = z.object({\n\ttag: z.string().min(1),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tconcurrency_limit: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\ttag: \"\",\n\tconcurrency_limit: 0,\n} as const;\n\ntype TaskRunConcurrencyLimitsCreateDialogProps = {\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsCreateDialog = ({\n\tonOpenChange,\n\tonSubmit,\n}: TaskRunConcurrencyLimitsCreateDialogProps) => {\n\tconst { createTaskRunConcurrencyLimit, isPending } =\n\t\tuseCreateTaskRunConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\tconst handleAddLimit = (values: z.infer<typeof formSchema>) => {\n\t\tcreateTaskRunConcurrencyLimit(values, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit added\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message = error.message || \"Unknown error while updating limit.\";\n\t\t\t\tform.setError(\"root\", { message });\n\t\t\t},\n\t\t\tonSettled: () => {\n\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\tonSubmit();\n\t\t\t},\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Add Task Run Concurrency Limit</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(handleAddLimit)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"tag\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Tag</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"concurrency_limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Concurrency Limit</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isPending}>\n\t\t\t\t\t\t\t\tAdd\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsCreateDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog\";\nimport { TaskRunConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog\";\nimport { TaskRunConcurrencyLimitsResetDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"reset\" | \"delete\";\n\t\t\tdata: TaskRunConcurrencyLimit;\n\t };\n\nexport const TaskRunConcurrencyLimitDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsCreateDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"reset\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsResetDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonReset={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsDeleteDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype TaskRunConcurrencyLimit,\n\tuseListTaskRunConcurrencyLimits,\n} from \"@/api/task-run-concurrency-limits\";\n\nimport { TaskRunConcurrencyLimitsDataTable } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table\";\nimport { TaskRunConcurrencyLimitsEmptyState } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state\";\nimport { TaskRunConcurrencyLimitsHeader } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header\";\nimport {\n\ttype DialogState,\n\tTaskRunConcurrencyLimitDialog,\n} from \"./task-run-concurrency-limit-dialog\";\n\nexport const TaskRunConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListTaskRunConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleDeleteRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleResetRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"reset\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<TaskRunConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<TaskRunConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<TaskRunConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t\tonResetRow={handleResetRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<TaskRunConcurrencyLimitDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport type { JSX } from \"react\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport type { TabOptions } from \"@/routes/concurrency-limits\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\ntype TabOptionValues = {\n\t/** Value of search value in url */\n\ttabSearchValue: TabOptions;\n\t/** Display value for the UI */\n\tdisplayValue: string;\n};\n\n/** Maps url tab option to visual name */\nconst TAB_OPTIONS: Record<TabOptions, TabOptionValues> = {\n\tglobal: {\n\t\ttabSearchValue: \"global\",\n\t\tdisplayValue: \"Global\",\n\t},\n\t\"task-run\": {\n\t\ttabSearchValue: \"task-run\",\n\t\tdisplayValue: \"Task Run\",\n\t},\n} as const;\n\ntype ConcurrencyLimitsTabsProps = {\n\tglobalView: React.ReactNode;\n\ttaskRunView: React.ReactNode;\n};\n\n// TODO: Move Tabs for navigation to a generic styled component\n\nexport const ConcurrencyLimitsTabs = ({\n\tglobalView,\n\ttaskRunView,\n}: ConcurrencyLimitsTabsProps): JSX.Element => {\n\tconst { tab } = routeApi.useSearch();\n\tconst navigate = routeApi.useNavigate();\n\n\treturn (\n\t\t<Tabs defaultValue=\"Global\" value={tab}>\n\t\t\t<TabsList>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS.global.tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS.global.tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS.global.displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS[\"task-run\"].tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS[\"task-run\"].tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS[\"task-run\"].displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t</TabsList>\n\t\t\t<TabsContent value={TAB_OPTIONS.global.tabSearchValue}>\n\t\t\t\t{globalView}\n\t\t\t</TabsContent>\n\t\t\t<TabsContent value={TAB_OPTIONS[\"task-run\"].tabSearchValue}>\n\t\t\t\t{taskRunView}\n\t\t\t</TabsContent>\n\t\t</Tabs>\n\t);\n};\n","import { GlobalConcurrencyLimitsView } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-view\";\nimport { TaskRunConcurrencyLimitsView } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\n\nimport { ConcurrencyLimitsTabs } from \"./concurrency-limits-tabs\";\n\nexport const ConcurrencyLimitsPage = () => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<ConcurrencyLimitTitle />\n\t\t\t<ConcurrencyLimitsTabs\n\t\t\t\tglobalView={<GlobalConcurrencyLimitsView />}\n\t\t\t\ttaskRunView={<TaskRunConcurrencyLimitsView />}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nconst ConcurrencyLimitTitle = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\tConcurrency\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t</div>\n);\n","import { createFileRoute } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { buildListGlobalConcurrencyLimitsQuery } from \"@/api/global-concurrency-limits\";\nimport { buildListTaskRunConcurrencyLimitsQuery } from \"@/api/task-run-concurrency-limits\";\nimport { ConcurrencyLimitsPage } from \"@/components/concurrency/concurrency-limits-page\";\n\n/**\n * Schema for validating URL search parameters for the Concurrency Limits page.\n * @property {string} search used to filter data table\n * @property {'global' | 'task-run'} tab used designate which tab view to display\n */\nconst searchParams = z.object({\n\tsearch: z.string().optional(),\n\ttab: z.enum([\"global\", \"task-run\"]).default(\"global\"),\n});\n\nexport type TabOptions = z.infer<typeof searchParams>[\"tab\"];\n\nexport const Route = createFileRoute(\"/concurrency-limits/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: ConcurrencyLimitsPage,\n\twrapInSuspense: true,\n\tloader: ({ context }) =>\n\t\tPromise.all([\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListGlobalConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListTaskRunConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t]),\n});\n"],"names":["ActionsCell","onEditRow","onDeleteRow","props","handleCopyId","id","toast","row","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","ActiveCell","updateGlobalConcurrencyLimit","useUpdateGlobalConcurrencyLimit","handleCheckedChange","checked","error","message","rowActive","rowId","Switch","routeApi","getRouteApi","columnHelper","createColumnHelper","createColumns","GlobalConcurrencyLimitsDataTable","data","navigate","search","deferredSearch","useDeferredValue","filteredData","useMemo","Table","value","prev","onSearchChange","searchValue","table","useReactTable","getCoreRowModel","getPaginationRowModel","SearchInput","e","DataTable","GlobalConcurrencyLimitsEmptyState","onAdd","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","GlobalConcurrencyLimitsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","formSchema","z.object","z.boolean","z.number","z.string","z.coerce","DEFAULT_VALUES","useCreateOrEditGlobalConcurrencyLimitForm","limitToUpdate","onSubmit","createGlobalConcurrencyLimit","createStatus","useCreateGlobalConcurrencyLimit","updateStatus","form","useForm","zodResolver","useEffect","active","name","limit","slot_decay_per_second","active_slots","values","onSettled","GlobalConcurrencyLimitsCreateOrEditDialog","onOpenChange","isLoading","saveOrUpdate","dialogTitle","Dialog","DialogContent","DialogHeader","DialogTitle","Form","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","DialogFooter","DialogTrigger","GlobalConcurrencyLimitsDeleteDialog","onDelete","deleteGlobalConcurrencyLimit","isPending","useDeleteGlobalConcurrencyLimit","handleOnClick","DialogDescription","GlobalConcurrencyLimitsDialog","openDialog","onCloseDialog","dialog","GlobalConcurrencyLimitsView","setOpenDialog","useState","useListGlobalConcurrencyLimits","handleAddRow","handleEditRow","handleDeleteRow","handleCloseDialog","handleOpenChange","open","ActiveTaskRunCells","numActiveTaskRuns","TagCell","tag","Link","onResetRow","TaskRunConcurrencyLimitsActionsMenu","TaskRunConcurrencyLimitsDataTable","TaskRunConcurrencyLimitsEmptyState","TaskRunConcurrencyLimitsHeader","TaskRunConcurrencyLimitsCreateDialog","createTaskRunConcurrencyLimit","useCreateTaskRunConcurrencyLimit","handleAddLimit","TaskRunConcurrencyLimitDialog","TaskRunConcurrencyLimitsResetDialog","TaskRunConcurrencyLimitsDeleteDialog","TaskRunConcurrencyLimitsView","useListTaskRunConcurrencyLimits","handleResetRow","TAB_OPTIONS","ConcurrencyLimitsTabs","globalView","taskRunView","tab","Tabs","TabsList","TabsTrigger","TabsContent","ConcurrencyLimitsPage","ConcurrencyLimitTitle","z","string","optional","default","SplitComponent"],"mappings":"s9BAkBO,MAAMA,GAAc,CAAC,CAC3B,UAAAC,EACA,YAAAC,EACA,GAAGC,CACJ,IAAwB,CACvB,MAAMC,EAAgBC,GAAe,CAC/B,UAAU,UAAU,UAAUA,CAAE,EACrCC,EAAM,QAAQ,WAAW,CAC1B,EAEMC,EAAMJ,EAAM,IAAI,SAEtB,cACEK,GAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,GAAA,CAAoB,QAAO,GAC3B,SAAAC,EAAAA,KAACC,GAAO,QAAQ,UAAU,UAAU,aACnC,SAAA,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IAACoD,EAAA,CACA,SAAApD,EAAAA,IAACqD,EAAA,CACA,eAACC,EAAA,CAAe,UAAU,wBAAwB,SAAA,aAAA,CAElD,EACD,EACD,CAAA,CACD,ECnBoBiG,EAAS,CAC7B7H,OAAQ6H,EAAEC,EAASC,SAAAA,EACnBT,IAAKO,GAAO,CAAC,SAAU,UAAU,CAAC,EAAEG,QAAQ,QAAQ,CACrD,CAAC,EAE4D,MAAAC,GAZpDN"}
@@ -1,2 +1,2 @@
1
- import{r as l,j as e,L as W,s as N}from"./vendor-tanstack-BK8oseNA.js";import{aU as b,aV as U,aW as X,ab as T,ac as I,ad as _,ae as O,ag as F,af as M,ah as A,ai as S,C as B,l as z,p as q,aX as K,n as Y,I as V,G as Z,aY as ee,aj as C,ak as Q,aZ as te,a_ as se,a$ as ne,b0 as ae,b1 as E,b2 as re,B as oe,g as le,h as ce,i as P,b3 as v,a8 as ie,E as de,s as ue,t as me,v as xe,b4 as fe,b5 as he,b6 as w,b7 as pe,b8 as ge,b9 as k}from"./index-WYPZo52S.js";import{A as je,X as ve,Y as be,b as Ne}from"./vendor-recharts-D4imLXNl.js";import{f as y}from"./vendor-date-7GxEwcQM.js";import{u as ye,C as we,a as Se,b as Ce}from"./collapsible-DBD7wjpi.js";import{E as Ee,J as Pe,p as $,R as G,f as ke,a as Re,b as De,g as Le}from"./utilities-B2JMf8iI.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-forms-DxqqmhL5.js";const Te=({active:t,payload:s})=>{if(!t||!s||!s.length)return null;const n=s[0]?.payload;return!n||typeof n.time!="number"||typeof n.count!="number"?null:e.jsxs("div",{className:"bg-popover border rounded-lg p-2 shadow-md",children:[e.jsxs("div",{className:"text-sm font-medium",children:[n.count," events"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:y(new Date(n.time),"PPp")})]})},Ie={count:{label:"Events",color:"hsl(262.1 83.3% 57.8%)"}},_e=l.forwardRef(function({data:s,className:a,showAxis:n=!0,startDate:o,endDate:c,onCursorChange:m},d){const x=l.useRef(null);l.useImperativeHandle(d,()=>({clearSelection:()=>{}}));const i=l.useMemo(()=>{const r=s.map(u=>({time:new Date(u.start_time).getTime(),count:u.count,label:u.label}));if(o&&c){const u=o.getTime(),j=c.getTime();(r.length===0||r[0].time>u)&&r.unshift({time:u,count:0,label:""}),(r.length===0||r[r.length-1].time<j)&&r.push({time:j,count:0,label:""})}return r},[s,o,c]),f=r=>{if(r.activeLabel!==void 0&&m){const u=typeof r.activeLabel=="number"?r.activeLabel:Number(r.activeLabel);Number.isNaN(u)||m(new Date(u))}},h=()=>{m?.(null)};return e.jsx("div",{ref:x,className:b("relative",a),children:e.jsx(U,{config:Ie,className:"h-full w-[calc(100%+3rem)] -mx-6",children:e.jsxs(je,{data:i,margin:{top:0,right:0,bottom:0,left:0},onMouseMove:f,onMouseLeave:h,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"eventsGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-count)",stopOpacity:.3}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-count)",stopOpacity:0})]})}),e.jsx(ve,{dataKey:"time",tickFormatter:r=>y(new Date(r),"HH:mm"),tick:{fontSize:12},axisLine:!1,tickLine:!1,domain:["dataMin","dataMax"],hide:!n}),e.jsx(be,{hide:!0,domain:[0,r=>Math.max(1,r)]}),e.jsx(X,{content:e.jsx(Te,{})}),e.jsx(Ne,{type:"monotone",dataKey:"count",stroke:"var(--color-count)",strokeWidth:2,fill:"url(#eventsGradient)",dot:!1,activeDot:!1,isAnimationActive:!1})]})})})});function Oe({data:t,className:s,startDate:a,endDate:n}){return e.jsx("div",{className:b("relative",s),children:e.jsx(_e,{data:t,className:"h-full w-full",showAxis:!1,startDate:a,endDate:n})})}const Fe={automation:"Automation",block:"Block",deployment:"Deployment",flow:"Flow","work-pool":"Work Pool","work-queue":"Work Queue"};function Me(t){return e.jsx(l.Suspense,{children:e.jsx(Ae,{...t})})}function Ae({selectedResourceIds:t,onResourceIdsChange:s}){const[a,n]=l.useState(""),o=l.useDeferredValue(a),{resourceOptions:c}=ye(),m=l.useMemo(()=>o?c.filter(i=>i.name.toLowerCase().includes(o.toLowerCase())):c,[c,o]),d=l.useMemo(()=>{const i={automation:[],block:[],deployment:[],flow:[],"work-pool":[],"work-queue":[]};for(const f of m)i[f.type].push(f);return i},[m]),x=i=>{const f=t.includes(i);s(f?t.filter(h=>h!==i):[...t,i]),n("")};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by resource",selected:t.length>0,children:t.length>0?`${t.length} resource${t.length===1?"":"s"} selected`:"All resources"}),e.jsxs(_,{children:[e.jsx(O,{value:a,onValueChange:n,placeholder:"Search resources..."}),e.jsx(F,{children:"No resources found"}),e.jsx(M,{children:Object.entries(d).map(([i,f])=>f.length>0?e.jsx(A,{heading:Fe[i],children:f.map(h=>e.jsx(S,{value:h.resourceId,selected:t.includes(h.resourceId),onSelect:x,closeOnSelect:!1,children:h.name},h.resourceId))},i):null)})]})]})}function Be({occurred:t}){const s=new Date(t),a=y(s,"h:mm:ss a"),n=y(s,"MMM do, yyyy");return e.jsxs("div",{className:"flex flex-col text-right text-sm w-24 shrink-0",children:[e.jsx("span",{children:a}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function Ye({event:t,isLast:s}){const a=t.resource["prefect.resource.id"]||"",n=$(a),o=G[n];return e.jsxs("div",{className:"relative flex items-start justify-center w-10 h-full",children:[e.jsx("div",{className:b("absolute left-1/2 w-px -translate-x-1/2 bg-border",s?"top-0 h-5":"top-0 bottom-0"),style:{top:"-1rem",bottom:s?"auto":"-1rem"}}),e.jsx("div",{className:"relative flex items-center justify-center w-10 h-10 rounded-full bg-background border border-border",children:e.jsx(V,{id:o,className:"h-5 w-5 text-muted-foreground"})})]})}function Ve(t){const s=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${a}-${n}`}function Qe({eventId:t,eventName:s,occurred:a}){const n=ke(s),o=Ve(new Date(a));return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx(W,{to:"/events/event/$eventDate/$eventId",params:{eventDate:o,eventId:t},className:"text-left font-medium hover:underline",children:n}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:s})]})}function $e(t){return t["prefect.resource.role"]}function R(t){return t["prefect.resource.id"]||""}function D(t){return t["prefect.resource.name"]||t["prefect.name"]||t["prefect-cloud.name"]||null}function Ge({related:t}){if(!t||t.length===0)return null;const s=[],a=[];for(const n of t)$e(n)==="tag"?s.push(n):a.push(n);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Related Resources"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.map(n=>{const o=R(n),m=D(n)||o,d=$(o),x=De[d],i=G[d];return e.jsxs(Re,{resource:n,relatedResources:t,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground hover:underline",children:[x&&e.jsx("span",{children:x}),e.jsx(V,{id:i,className:"h-4 w-4"}),e.jsx("span",{children:m})]},o)}),s.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:s.map(n=>{const o=R(n),c=D(n)||o.split(".").pop();return e.jsx(Z,{variant:"secondary",children:c},o)})})]})]})}function He({event:t,isLast:s}){const[a,n]=l.useState(!1);return e.jsxs("div",{className:"grid grid-cols-[6rem_2.5rem_1fr] gap-4 items-start py-4",children:[e.jsx(Be,{occurred:t.occurred}),e.jsx(Ye,{event:t,isLast:s}),e.jsx(we,{open:a,onOpenChange:n,children:e.jsxs(B,{className:"py-4",children:[e.jsx(z,{className:"py-0",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Qe,{eventId:t.id,eventName:t.event,occurred:t.occurred}),e.jsx(Ee,{event:t}),t.related&&t.related.length>0&&e.jsx(Ge,{related:t.related})]})}),e.jsx("div",{className:"px-6 pt-2",children:e.jsx(Se,{asChild:!0,children:e.jsxs(q,{variant:"ghost",size:"sm",className:"w-full justify-center gap-2 text-muted-foreground","aria-label":a?"Collapse event details":"Expand event details",children:[e.jsx(K,{className:b("h-4 w-4 transition-transform duration-200",a&&"rotate-180")}),e.jsx("span",{className:"text-xs",children:a?"Hide raw event":"Show raw event"})]})})}),e.jsx(Ce,{children:e.jsx(Y,{className:"pt-4",children:e.jsx(Pe,{value:JSON.stringify(t,null,2),className:"max-h-96 overflow-auto"})})})]})})]})}function Je({events:t,className:s}){return!t||t.length===0?null:e.jsx("ol",{className:b("list-none p-0 m-0",s),children:t.map((a,n)=>e.jsx("li",{children:e.jsx(He,{event:a,isLast:n===t.length-1})},a.id))})}const L=2;function We({filter:t,selectedEventTypes:s,onEventTypesChange:a}){const[n,o]=l.useState(""),c=l.useDeferredValue(n),{data:m=[]}=N(ee("event",t)),d=l.useMemo(()=>{const r=new Set;for(const u of m){const j=Le(u.value);for(const p of j)r.add(p)}return Array.from(r).sort()},[m]),x=l.useMemo(()=>c?d.filter(r=>r.toLowerCase().includes(c.toLowerCase())):d,[d,c]),i=r=>{const u=s.includes(r);a(u?s.filter(j=>j!==r):[...s,r])},f=()=>{a([])},h=()=>{if(s.length===0)return"All event types";const r=s.slice(0,L),u=s.length-L;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:r.join(", ")})}),u>0&&e.jsxs(Q,{variant:"bodySmall",className:"shrink-0",children:["+ ",u]})]})};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by event type",selected:s.length===0,children:h()}),e.jsxs(_,{children:[e.jsx(O,{value:n,onValueChange:o,placeholder:"Search event types..."}),e.jsxs(M,{children:[e.jsx(F,{children:"No event types found"}),e.jsxs(A,{children:[e.jsxs(S,{"aria-label":"All event types",onSelect:f,closeOnSelect:!1,value:"__all__",children:[e.jsx(C,{checked:s.length===0}),"All event types"]}),x.map(r=>e.jsxs(S,{"aria-label":r,onSelect:()=>i(r),closeOnSelect:!1,value:r,children:[e.jsx(C,{checked:s.includes(r)}),r]},r))]})]})]})]})}const Ue=50;function Xe({filter:t}){const[s,a]=l.useState(1),n=l.useRef(new Map),o=l.useRef(JSON.stringify(t));l.useEffect(()=>{const p=JSON.stringify(t);o.current!==p&&(n.current.clear(),a(1),o.current=p)},[t]);const c=N(te(t));l.useEffect(()=>{c.data?.next_page&&n.current.set(1,c.data.next_page)},[c.data?.next_page]);const m=s>1?n.current.get(s-1):null,d=N({...se(m??""),enabled:s>1&&!!m});l.useEffect(()=>{d.data?.next_page&&s>1&&n.current.set(s,d.data.next_page)},[d.data?.next_page,s]);const x=c.data?.total??0,i=Math.ceil(x/Ue),f=s===1?c.data?.events??[]:d.data?.events??c.data?.events??[],h=s>1&&d.isLoading;return{events:f,currentPage:s,totalPages:i,total:x,isLoadingNextPage:h,goToPage:p=>{p<1||p>i||p>1&&!n.current.has(p-1)||a(p)},goToNextPage:()=>{s<i&&n.current.has(s)&&a(s+1)},goToPreviousPage:()=>{s>1&&a(s-1)}}}function ze({search:t,onSearchChange:s}){const a=ne(t),n=ae(t),o=E({...t,rangeType:"range",start:a.from,end:a.to}),c=E({resource:t.resource,rangeType:"range",start:a.from,end:a.to}),{events:m,currentPage:d,totalPages:x,isLoadingNextPage:i,goToNextPage:f,goToPreviousPage:h}=Xe({filter:n}),{data:r}=N(re(o)),u=g=>{s({resource:g})},j=g=>{s({event:g})},p=g=>{g?.type==="span"?s({rangeType:"span",seconds:g.seconds}):g?.type==="range"&&s({rangeType:"range",start:g.startDate.toISOString(),end:g.endDate.toISOString()})},[H,J]=l.useState(!1);return l.useEffect(()=>{const g=()=>{J(window.scrollY>100)};return window.addEventListener("scroll",g),()=>window.removeEventListener("scroll",g)},[]),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(oe,{children:e.jsx(le,{children:e.jsx(ce,{className:"text-xl font-semibold",children:"Event Feed"})})})})}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-[2fr_1fr]",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Resource"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(Me,{selectedResourceIds:t.resource??[],onResourceIdsChange:u})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Events"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(We,{filter:c,selectedEventTypes:t.event??[],onEventTypesChange:j})})]})]}),e.jsx(B,{className:b("sticky top-0 z-10 transition-shadow",H&&"shadow-lg"),children:e.jsxs(Y,{className:"pt-6",children:[e.jsx(Oe,{data:r??[],className:"h-32",startDate:new Date(a.from),endDate:new Date(a.to)}),e.jsx("div",{className:"flex justify-center pt-3",children:e.jsx(ie,{value:t.rangeType==="range"&&t.start&&t.end?{type:"range",startDate:new Date(t.start),endDate:new Date(t.end)}:{type:"span",seconds:t.seconds??-86400},onValueChange:p})})]})}),m.length===0?e.jsxs(de,{children:[e.jsx(ue,{id:"Calendar"}),e.jsx(me,{children:"No events found"}),e.jsx(xe,{children:"No events match your current filters. Try adjusting your date range or filters."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Je,{events:m}),x>1&&e.jsx("div",{className:"flex items-center justify-center gap-2",children:e.jsx(fe,{children:e.jsxs(he,{children:[e.jsx(w,{children:e.jsx(pe,{onClick:h,disabled:d<=1})}),e.jsx(w,{children:e.jsxs(Q,{variant:"bodySmall",className:"px-2",children:["Page ",d," of ",x]})}),e.jsx(w,{children:e.jsx(ge,{onClick:f,disabled:d>=x})})]})})}),i&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(v,{className:"h-8 w-32"})})]})]})}function qe(){return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(v,{className:"h-8 w-48"}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"})]}),e.jsx(v,{className:"h-32 w-full"}),e.jsx(v,{className:"h-64 w-full"})]})}function lt(){const t=k.useSearch(),s=k.useNavigate(),a=n=>{s({to:".",search:o=>({...o,...n}),replace:!0})};return e.jsx(l.Suspense,{fallback:e.jsx(qe,{}),children:e.jsx(ze,{search:t,onSearchChange:a})})}export{lt as component};
2
- //# sourceMappingURL=index-CGWoVV2s.js.map
1
+ import{r as l,j as e,L as W,s as N}from"./vendor-tanstack-BK8oseNA.js";import{aW as b,aX as X,aY as q,ac as T,ad as I,ae as _,af as O,ah as F,ag as M,ai as A,aj as S,C as B,m as z,q as U,aZ as K,o as Y,I as Q,H as Z,a_ as ee,ak as C,al as V,a$ as te,b0 as se,b1 as ne,b2 as ae,b3 as E,b4 as re,B as oe,g as le,h as ce,i as P,b5 as v,a9 as ie,E as de,t as ue,v as me,w as xe,b6 as fe,b7 as he,b8 as w,b9 as pe,ba as ge,bb as k}from"./index-D5RdrxkU.js";import{A as je,X as ve,Y as be,b as Ne}from"./vendor-recharts-D4imLXNl.js";import{f as y}from"./vendor-date-7GxEwcQM.js";import{u as ye,C as we,a as Se,b as Ce}from"./collapsible-Ell2FjrX.js";import{E as Ee,J as Pe,p as $,R as H,f as ke,a as Re,b as De,g as Le}from"./utilities-BQwGFLk5.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CznP1SOq.js";import"./vendor-forms-DxqqmhL5.js";const Te=({active:t,payload:s})=>{if(!t||!s||!s.length)return null;const n=s[0]?.payload;return!n||typeof n.time!="number"||typeof n.count!="number"?null:e.jsxs("div",{className:"bg-popover border rounded-lg p-2 shadow-md",children:[e.jsxs("div",{className:"text-sm font-medium",children:[n.count," events"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:y(new Date(n.time),"PPp")})]})},Ie={count:{label:"Events",color:"hsl(262.1 83.3% 57.8%)"}},_e=l.forwardRef(function({data:s,className:a,showAxis:n=!0,startDate:o,endDate:c,onCursorChange:m},d){const x=l.useRef(null);l.useImperativeHandle(d,()=>({clearSelection:()=>{}}));const i=l.useMemo(()=>{const r=s.map(u=>({time:new Date(u.start_time).getTime(),count:u.count,label:u.label}));if(o&&c){const u=o.getTime(),j=c.getTime();(r.length===0||r[0].time>u)&&r.unshift({time:u,count:0,label:""}),(r.length===0||r[r.length-1].time<j)&&r.push({time:j,count:0,label:""})}return r},[s,o,c]),f=r=>{if(r.activeLabel!==void 0&&m){const u=typeof r.activeLabel=="number"?r.activeLabel:Number(r.activeLabel);Number.isNaN(u)||m(new Date(u))}},h=()=>{m?.(null)};return e.jsx("div",{ref:x,className:b("relative",a),children:e.jsx(X,{config:Ie,className:"h-full w-[calc(100%+3rem)] -mx-6",children:e.jsxs(je,{data:i,margin:{top:0,right:0,bottom:0,left:0},onMouseMove:f,onMouseLeave:h,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"eventsGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-count)",stopOpacity:.3}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-count)",stopOpacity:0})]})}),e.jsx(ve,{dataKey:"time",tickFormatter:r=>y(new Date(r),"HH:mm"),tick:{fontSize:12},axisLine:!1,tickLine:!1,domain:["dataMin","dataMax"],hide:!n}),e.jsx(be,{hide:!0,domain:[0,r=>Math.max(1,r)]}),e.jsx(q,{content:e.jsx(Te,{})}),e.jsx(Ne,{type:"monotone",dataKey:"count",stroke:"var(--color-count)",strokeWidth:2,fill:"url(#eventsGradient)",dot:!1,activeDot:!1,isAnimationActive:!1})]})})})});function Oe({data:t,className:s,startDate:a,endDate:n}){return e.jsx("div",{className:b("relative",s),children:e.jsx(_e,{data:t,className:"h-full w-full",showAxis:!1,startDate:a,endDate:n})})}const Fe={automation:"Automation",block:"Block",deployment:"Deployment",flow:"Flow","work-pool":"Work Pool","work-queue":"Work Queue"};function Me(t){return e.jsx(l.Suspense,{children:e.jsx(Ae,{...t})})}function Ae({selectedResourceIds:t,onResourceIdsChange:s}){const[a,n]=l.useState(""),o=l.useDeferredValue(a),{resourceOptions:c}=ye(),m=l.useMemo(()=>o?c.filter(i=>i.name.toLowerCase().includes(o.toLowerCase())):c,[c,o]),d=l.useMemo(()=>{const i={automation:[],block:[],deployment:[],flow:[],"work-pool":[],"work-queue":[]};for(const f of m)i[f.type].push(f);return i},[m]),x=i=>{const f=t.includes(i);s(f?t.filter(h=>h!==i):[...t,i]),n("")};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by resource",selected:t.length>0,children:t.length>0?`${t.length} resource${t.length===1?"":"s"} selected`:"All resources"}),e.jsxs(_,{children:[e.jsx(O,{value:a,onValueChange:n,placeholder:"Search resources..."}),e.jsx(F,{children:"No resources found"}),e.jsx(M,{children:Object.entries(d).map(([i,f])=>f.length>0?e.jsx(A,{heading:Fe[i],children:f.map(h=>e.jsx(S,{value:h.resourceId,selected:t.includes(h.resourceId),onSelect:x,closeOnSelect:!1,children:h.name},h.resourceId))},i):null)})]})]})}function Be({occurred:t}){const s=new Date(t),a=y(s,"h:mm:ss a"),n=y(s,"MMM do, yyyy");return e.jsxs("div",{className:"flex flex-col text-right text-sm w-24 shrink-0",children:[e.jsx("span",{children:a}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function Ye({event:t,isLast:s}){const a=t.resource["prefect.resource.id"]||"",n=$(a),o=H[n];return e.jsxs("div",{className:"relative flex items-start justify-center w-10 h-full",children:[e.jsx("div",{className:b("absolute left-1/2 w-px -translate-x-1/2 bg-border",s?"top-0 h-5":"top-0 bottom-0"),style:{top:"-1rem",bottom:s?"auto":"-1rem"}}),e.jsx("div",{className:"relative flex items-center justify-center w-10 h-10 rounded-full bg-background border border-border",children:e.jsx(Q,{id:o,className:"h-5 w-5 text-muted-foreground"})})]})}function Qe(t){const s=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${a}-${n}`}function Ve({eventId:t,eventName:s,occurred:a}){const n=ke(s),o=Qe(new Date(a));return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx(W,{to:"/events/event/$eventDate/$eventId",params:{eventDate:o,eventId:t},className:"text-left font-medium hover:underline",children:n}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:s})]})}function $e(t){return t["prefect.resource.role"]}function R(t){return t["prefect.resource.id"]||""}function D(t){return t["prefect.resource.name"]||t["prefect.name"]||t["prefect-cloud.name"]||null}function He({related:t}){if(!t||t.length===0)return null;const s=[],a=[];for(const n of t)$e(n)==="tag"?s.push(n):a.push(n);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:"Related Resources"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.map(n=>{const o=R(n),m=D(n)||o,d=$(o),x=De[d],i=H[d];return e.jsxs(Re,{resource:n,relatedResources:t,className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground hover:underline",children:[x&&e.jsx("span",{children:x}),e.jsx(Q,{id:i,className:"h-4 w-4"}),e.jsx("span",{children:m})]},o)}),s.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:s.map(n=>{const o=R(n),c=D(n)||o.split(".").pop();return e.jsx(Z,{variant:"secondary",children:c},o)})})]})]})}function Ge({event:t,isLast:s}){const[a,n]=l.useState(!1);return e.jsxs("div",{className:"grid grid-cols-[6rem_2.5rem_1fr] gap-4 items-start py-4",children:[e.jsx(Be,{occurred:t.occurred}),e.jsx(Ye,{event:t,isLast:s}),e.jsx(we,{open:a,onOpenChange:n,children:e.jsxs(B,{className:"py-4",children:[e.jsx(z,{className:"py-0",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Ve,{eventId:t.id,eventName:t.event,occurred:t.occurred}),e.jsx(Ee,{event:t}),t.related&&t.related.length>0&&e.jsx(He,{related:t.related})]})}),e.jsx("div",{className:"px-6 pt-2",children:e.jsx(Se,{asChild:!0,children:e.jsxs(U,{variant:"ghost",size:"sm",className:"w-full justify-center gap-2 text-muted-foreground","aria-label":a?"Collapse event details":"Expand event details",children:[e.jsx(K,{className:b("h-4 w-4 transition-transform duration-200",a&&"rotate-180")}),e.jsx("span",{className:"text-xs",children:a?"Hide raw event":"Show raw event"})]})})}),e.jsx(Ce,{children:e.jsx(Y,{className:"pt-4",children:e.jsx(Pe,{value:JSON.stringify(t,null,2),className:"max-h-96 overflow-auto"})})})]})})]})}function Je({events:t,className:s}){return!t||t.length===0?null:e.jsx("ol",{className:b("list-none p-0 m-0",s),children:t.map((a,n)=>e.jsx("li",{children:e.jsx(Ge,{event:a,isLast:n===t.length-1})},a.id))})}const L=2;function We({filter:t,selectedEventTypes:s,onEventTypesChange:a}){const[n,o]=l.useState(""),c=l.useDeferredValue(n),{data:m=[]}=N(ee("event",t)),d=l.useMemo(()=>{const r=new Set;for(const u of m){const j=Le(u.value);for(const p of j)r.add(p)}return Array.from(r).sort()},[m]),x=l.useMemo(()=>c?d.filter(r=>r.toLowerCase().includes(c.toLowerCase())):d,[d,c]),i=r=>{const u=s.includes(r);a(u?s.filter(j=>j!==r):[...s,r])},f=()=>{a([])},h=()=>{if(s.length===0)return"All event types";const r=s.slice(0,L),u=s.length-L;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:r.join(", ")})}),u>0&&e.jsxs(V,{variant:"bodySmall",className:"shrink-0",children:["+ ",u]})]})};return e.jsxs(T,{children:[e.jsx(I,{"aria-label":"Filter by event type",selected:s.length===0,children:h()}),e.jsxs(_,{children:[e.jsx(O,{value:n,onValueChange:o,placeholder:"Search event types..."}),e.jsxs(M,{children:[e.jsx(F,{children:"No event types found"}),e.jsxs(A,{children:[e.jsxs(S,{"aria-label":"All event types",onSelect:f,closeOnSelect:!1,value:"__all__",children:[e.jsx(C,{checked:s.length===0}),"All event types"]}),x.map(r=>e.jsxs(S,{"aria-label":r,onSelect:()=>i(r),closeOnSelect:!1,value:r,children:[e.jsx(C,{checked:s.includes(r)}),r]},r))]})]})]})]})}const Xe=50;function qe({filter:t}){const[s,a]=l.useState(1),n=l.useRef(new Map),o=l.useRef(JSON.stringify(t));l.useEffect(()=>{const p=JSON.stringify(t);o.current!==p&&(n.current.clear(),a(1),o.current=p)},[t]);const c=N(te(t));l.useEffect(()=>{c.data?.next_page&&n.current.set(1,c.data.next_page)},[c.data?.next_page]);const m=s>1?n.current.get(s-1):null,d=N({...se(m??""),enabled:s>1&&!!m});l.useEffect(()=>{d.data?.next_page&&s>1&&n.current.set(s,d.data.next_page)},[d.data?.next_page,s]);const x=c.data?.total??0,i=Math.ceil(x/Xe),f=s===1?c.data?.events??[]:d.data?.events??c.data?.events??[],h=s>1&&d.isLoading;return{events:f,currentPage:s,totalPages:i,total:x,isLoadingNextPage:h,goToPage:p=>{p<1||p>i||p>1&&!n.current.has(p-1)||a(p)},goToNextPage:()=>{s<i&&n.current.has(s)&&a(s+1)},goToPreviousPage:()=>{s>1&&a(s-1)}}}function ze({search:t,onSearchChange:s}){const a=ne(t),n=ae(t),o=E({...t,rangeType:"range",start:a.from,end:a.to}),c=E({resource:t.resource,rangeType:"range",start:a.from,end:a.to}),{events:m,currentPage:d,totalPages:x,isLoadingNextPage:i,goToNextPage:f,goToPreviousPage:h}=qe({filter:n}),{data:r}=N(re(o)),u=g=>{s({resource:g})},j=g=>{s({event:g})},p=g=>{g?.type==="span"?s({rangeType:"span",seconds:g.seconds}):g?.type==="range"&&s({rangeType:"range",start:g.startDate.toISOString(),end:g.endDate.toISOString()})},[G,J]=l.useState(!1);return l.useEffect(()=>{const g=()=>{J(window.scrollY>100)};return window.addEventListener("scroll",g),()=>window.removeEventListener("scroll",g)},[]),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(oe,{children:e.jsx(le,{children:e.jsx(ce,{className:"text-xl font-semibold",children:"Event Feed"})})})})}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-[2fr_1fr]",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Resource"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(Me,{selectedResourceIds:t.resource??[],onResourceIdsChange:u})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(P,{children:"Events"}),e.jsx(l.Suspense,{fallback:e.jsx(v,{className:"h-10 w-full"}),children:e.jsx(We,{filter:c,selectedEventTypes:t.event??[],onEventTypesChange:j})})]})]}),e.jsx(B,{className:b("sticky top-0 z-10 transition-shadow",G&&"shadow-lg"),children:e.jsxs(Y,{className:"pt-6",children:[e.jsx(Oe,{data:r??[],className:"h-32",startDate:new Date(a.from),endDate:new Date(a.to)}),e.jsx("div",{className:"flex justify-center pt-3",children:e.jsx(ie,{value:t.rangeType==="range"&&t.start&&t.end?{type:"range",startDate:new Date(t.start),endDate:new Date(t.end)}:{type:"span",seconds:t.seconds??-86400},onValueChange:p})})]})}),m.length===0?e.jsxs(de,{children:[e.jsx(ue,{id:"Calendar"}),e.jsx(me,{children:"No events found"}),e.jsx(xe,{children:"No events match your current filters. Try adjusting your date range or filters."})]}):e.jsxs(e.Fragment,{children:[e.jsx(Je,{events:m}),x>1&&e.jsx("div",{className:"flex items-center justify-center gap-2",children:e.jsx(fe,{children:e.jsxs(he,{children:[e.jsx(w,{children:e.jsx(pe,{onClick:h,disabled:d<=1})}),e.jsx(w,{children:e.jsxs(V,{variant:"bodySmall",className:"px-2",children:["Page ",d," of ",x]})}),e.jsx(w,{children:e.jsx(ge,{onClick:f,disabled:d>=x})})]})})}),i&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(v,{className:"h-8 w-32"})})]})]})}function Ue(){return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(v,{className:"h-8 w-48"}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"}),e.jsx(v,{className:"h-10 w-48"})]}),e.jsx(v,{className:"h-32 w-full"}),e.jsx(v,{className:"h-64 w-full"})]})}function lt(){const t=k.useSearch(),s=k.useNavigate(),a=n=>{s({to:".",search:o=>({...o,...n}),replace:!0})};return e.jsx(l.Suspense,{fallback:e.jsx(Ue,{}),children:e.jsx(ze,{search:t,onSearchChange:a})})}export{lt as component};
2
+ //# sourceMappingURL=index-CnIJUujl.js.map