prefect 3.6.15__py3-none-any.whl → 3.6.16.dev3__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 (259) hide show
  1. prefect/__init__.py +20 -0
  2. prefect/_build_info.py +3 -3
  3. prefect/_internal/analytics/__init__.py +80 -0
  4. prefect/_internal/analytics/_config.py +2 -0
  5. prefect/_internal/analytics/ci_detection.py +39 -0
  6. prefect/_internal/analytics/client.py +132 -0
  7. prefect/_internal/analytics/device_id.py +55 -0
  8. prefect/_internal/analytics/emit.py +90 -0
  9. prefect/_internal/analytics/enabled.py +33 -0
  10. prefect/_internal/analytics/events.py +14 -0
  11. prefect/_internal/analytics/milestones.py +177 -0
  12. prefect/_internal/analytics/notice.py +60 -0
  13. prefect/_internal/analytics/service.py +238 -0
  14. prefect/analytics/__init__.py +67 -0
  15. prefect/deployments/runner.py +20 -0
  16. prefect/flow_engine.py +16 -0
  17. prefect/flows.py +8 -0
  18. prefect/logging/formatters.py +24 -1
  19. prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js → artifact-card-BclosG8t.js} +2 -2
  20. prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js.map → artifact-card-BclosG8t.js.map} +1 -1
  21. prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js +2 -0
  22. prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js.map +1 -0
  23. prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js → automation-wizard-Bmgt6nn8.js} +2 -2
  24. prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js.map → automation-wizard-Bmgt6nn8.js.map} +1 -1
  25. prefect/server/ui-v2/assets/automation._id-Ccke3KJz.js +2 -0
  26. prefect/server/ui-v2/assets/{automation._id-Dn7jABys.js.map → automation._id-Ccke3KJz.js.map} +1 -1
  27. prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js → automation_._id.edit-BlKPUTVf.js} +2 -2
  28. prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js.map → automation_._id.edit-BlKPUTVf.js.map} +1 -1
  29. prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js → automations-header-Df2zw3SC.js} +2 -2
  30. prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js.map → automations-header-Df2zw3SC.js.map} +1 -1
  31. prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js → base-job-template-form-section-oZD6U-RW.js} +2 -2
  32. prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js.map → base-job-template-form-section-oZD6U-RW.js.map} +1 -1
  33. prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js → block-type-details-CYrdaLot.js} +2 -2
  34. prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js.map → block-type-details-CYrdaLot.js.map} +1 -1
  35. prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js +2 -0
  36. prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js.map +1 -0
  37. prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js → block._id-CBgHrpTP.js} +2 -2
  38. prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js.map → block._id-CBgHrpTP.js.map} +1 -1
  39. prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js → block_._id.edit-CW-kdi4O.js} +2 -2
  40. prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js.map → block_._id.edit-CW-kdi4O.js.map} +1 -1
  41. prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js → catalog-Brh0kn1I.js} +2 -2
  42. prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js.map → catalog-Brh0kn1I.js.map} +1 -1
  43. prefect/server/ui-v2/assets/catalog_._slug-MCgzguIZ.js +2 -0
  44. prefect/server/ui-v2/assets/{catalog_._slug-Bl2J2oI3.js.map → catalog_._slug-MCgzguIZ.js.map} +1 -1
  45. prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js → catalog_._slug_.create-DBaeHi9Q.js} +2 -2
  46. prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js.map → catalog_._slug_.create-DBaeHi9Q.js.map} +1 -1
  47. prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js → collapsible-B_NJS0uJ.js} +2 -2
  48. prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js.map → collapsible-B_NJS0uJ.js.map} +1 -1
  49. prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js → concurrency-limit._id-qzNUQzQa.js} +2 -2
  50. prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js.map → concurrency-limit._id-qzNUQzQa.js.map} +1 -1
  51. prefect/server/ui-v2/assets/create-BwXG6EIb.js +2 -0
  52. prefect/server/ui-v2/assets/{create-D--LHaji.js.map → create-BwXG6EIb.js.map} +1 -1
  53. prefect/server/ui-v2/assets/{create-BycfZHGQ.js → create-MoiIE9Ms.js} +2 -2
  54. prefect/server/ui-v2/assets/{create-BycfZHGQ.js.map → create-MoiIE9Ms.js.map} +1 -1
  55. prefect/server/ui-v2/assets/data-table-CPkppyg6.js +2 -0
  56. prefect/server/ui-v2/assets/data-table-CPkppyg6.js.map +1 -0
  57. prefect/server/ui-v2/assets/delete-confirmation-dialog-CwDK_2QS.js +2 -0
  58. prefect/server/ui-v2/assets/{delete-confirmation-dialog-DHkm2p8m.js.map → delete-confirmation-dialog-CwDK_2QS.js.map} +1 -1
  59. prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js → deployment-action-header-Vp9YsCJO.js} +2 -2
  60. prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js.map → deployment-action-header-Vp9YsCJO.js.map} +1 -1
  61. prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js → deployment-form-CJcg_6DJ.js} +3 -3
  62. prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js.map → deployment-form-CJcg_6DJ.js.map} +1 -1
  63. prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js → deployment-links-CIkJIuHh.js} +2 -2
  64. prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js.map → deployment-links-CIkJIuHh.js.map} +1 -1
  65. prefect/server/ui-v2/assets/deployment._id-C6XrGMp_.js +2 -0
  66. prefect/server/ui-v2/assets/{deployment._id-Ci9zge5n.js.map → deployment._id-C6XrGMp_.js.map} +1 -1
  67. prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js → deployment._id-CWgTYmTG.js} +2 -2
  68. prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js.map → deployment._id-CWgTYmTG.js.map} +1 -1
  69. prefect/server/ui-v2/assets/deployment_._id.duplicate-Bg0s0ZJn.js +2 -0
  70. prefect/server/ui-v2/assets/{deployment_._id.duplicate-D9ZWkh8H.js.map → deployment_._id.duplicate-Bg0s0ZJn.js.map} +1 -1
  71. prefect/server/ui-v2/assets/deployment_._id.edit-CnoB0UeG.js +2 -0
  72. prefect/server/ui-v2/assets/{deployment_._id.edit-CS7sObzC.js.map → deployment_._id.edit-CnoB0UeG.js.map} +1 -1
  73. prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js → deployment_._id.run-BqPK6rTB.js} +2 -2
  74. prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js.map → deployment_._id.run-BqPK6rTB.js.map} +1 -1
  75. prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js → dropdown-menu-D7Gwbd15.js} +2 -2
  76. prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js.map → dropdown-menu-D7Gwbd15.js.map} +1 -1
  77. prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js → event-resource-display-CDRgVKd4.js} +2 -2
  78. prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js.map → event-resource-display-CDRgVKd4.js.map} +1 -1
  79. prefect/server/ui-v2/assets/event._eventDate._eventId-C73GMDkK.js +2 -0
  80. prefect/server/ui-v2/assets/{event._eventDate._eventId-D7Twzb22.js.map → event._eventDate._eventId-C73GMDkK.js.map} +1 -1
  81. prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js → flow-run-graph-ckiE3mA9.js} +2 -2
  82. prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js.map → flow-run-graph-ckiE3mA9.js.map} +1 -1
  83. prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js → flow-run._id-BukrNCAq.js} +2 -2
  84. prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js.map → flow-run._id-BukrNCAq.js.map} +1 -1
  85. prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js → flow-run._id-CtI5VZ2M.js} +2 -2
  86. prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js.map → flow-run._id-CtI5VZ2M.js.map} +1 -1
  87. prefect/server/ui-v2/assets/flow-run._id-s1UJuakA.js +4 -0
  88. prefect/server/ui-v2/assets/{flow-run._id-RLy2kBh0.js.map → flow-run._id-s1UJuakA.js.map} +1 -1
  89. prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js → flow-runs-pagination-SLbYtvaR.js} +2 -2
  90. prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js.map → flow-runs-pagination-SLbYtvaR.js.map} +1 -1
  91. prefect/server/ui-v2/assets/flow._id-CZ5P0v4N.js +2 -0
  92. prefect/server/ui-v2/assets/{flow._id-BdQGWPKP.js.map → flow._id-CZ5P0v4N.js.map} +1 -1
  93. prefect/server/ui-v2/assets/{form-DLrbC7rV.js → form-mws4law8.js} +2 -2
  94. prefect/server/ui-v2/assets/{form-DLrbC7rV.js.map → form-mws4law8.js.map} +1 -1
  95. prefect/server/ui-v2/assets/{header-BTAWyeXv.js → header-Bes1LmY7.js} +2 -2
  96. prefect/server/ui-v2/assets/{header-BTAWyeXv.js.map → header-Bes1LmY7.js.map} +1 -1
  97. prefect/server/ui-v2/assets/{header-ChFAx5uR.js → header-Bj_zBR-a.js} +2 -2
  98. prefect/server/ui-v2/assets/{header-ChFAx5uR.js.map → header-Bj_zBR-a.js.map} +1 -1
  99. prefect/server/ui-v2/assets/{header-CyQqOj1w.js → header-CPxTHSvz.js} +2 -2
  100. prefect/server/ui-v2/assets/{header-CyQqOj1w.js.map → header-CPxTHSvz.js.map} +1 -1
  101. prefect/server/ui-v2/assets/{index-m48E4KcG.js → index-B8vo2Lrg.js} +5 -5
  102. prefect/server/ui-v2/assets/{index-m48E4KcG.js.map → index-B8vo2Lrg.js.map} +1 -1
  103. prefect/server/ui-v2/assets/{index-D5RT-SAp.js → index-BBeh-3Nh.js} +2 -2
  104. prefect/server/ui-v2/assets/{index-D5RT-SAp.js.map → index-BBeh-3Nh.js.map} +1 -1
  105. prefect/server/ui-v2/assets/index-BLnEvHia.js +2 -0
  106. prefect/server/ui-v2/assets/{index-7i4X9TeK.js.map → index-BLnEvHia.js.map} +1 -1
  107. prefect/server/ui-v2/assets/index-BpKoubXu.js +2 -0
  108. prefect/server/ui-v2/assets/index-BpKoubXu.js.map +1 -0
  109. prefect/server/ui-v2/assets/index-By6YGqR3.js +2 -0
  110. prefect/server/ui-v2/assets/index-By6YGqR3.js.map +1 -0
  111. prefect/server/ui-v2/assets/index-CEi3BlKI.js +2 -0
  112. prefect/server/ui-v2/assets/index-CEi3BlKI.js.map +1 -0
  113. prefect/server/ui-v2/assets/{index-BaWDC4da.js → index-CS-zxv7Z.js} +2 -2
  114. prefect/server/ui-v2/assets/{index-BaWDC4da.js.map → index-CS-zxv7Z.js.map} +1 -1
  115. prefect/server/ui-v2/assets/{index-kP_I5Qfd.js → index-CToHKh4q.js} +2 -2
  116. prefect/server/ui-v2/assets/{index-kP_I5Qfd.js.map → index-CToHKh4q.js.map} +1 -1
  117. prefect/server/ui-v2/assets/{index-CKGj5lSu.js → index-CUVvZndW.js} +2 -2
  118. prefect/server/ui-v2/assets/{index-CKGj5lSu.js.map → index-CUVvZndW.js.map} +1 -1
  119. prefect/server/ui-v2/assets/{index-CxUfZRkN.js → index-CYVn-I3i.js} +2 -2
  120. prefect/server/ui-v2/assets/{index-CxUfZRkN.js.map → index-CYVn-I3i.js.map} +1 -1
  121. prefect/server/ui-v2/assets/{index-CnlN-VC_.js → index-Cun0JN4t.js} +2 -2
  122. prefect/server/ui-v2/assets/{index-CnlN-VC_.js.map → index-Cun0JN4t.js.map} +1 -1
  123. prefect/server/ui-v2/assets/{index-BwCLKpNb.js → index-D6ynV6U7.js} +2 -2
  124. prefect/server/ui-v2/assets/{index-BwCLKpNb.js.map → index-D6ynV6U7.js.map} +1 -1
  125. prefect/server/ui-v2/assets/{index-CHf6xi9j.js → index-DdNUJLRW.js} +2 -2
  126. prefect/server/ui-v2/assets/{index-CHf6xi9j.js.map → index-DdNUJLRW.js.map} +1 -1
  127. prefect/server/ui-v2/assets/{index-CQnWiUE5.js → index-DlHOXQhu.js} +2 -2
  128. prefect/server/ui-v2/assets/{index-CQnWiUE5.js.map → index-DlHOXQhu.js.map} +1 -1
  129. prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js → index-DyVw8YE8.js} +2 -2
  130. prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js.map → index-DyVw8YE8.js.map} +1 -1
  131. prefect/server/ui-v2/assets/{index-Btb_-PDp.js → index-DzRz7D2P.js} +2 -2
  132. prefect/server/ui-v2/assets/{index-Btb_-PDp.js.map → index-DzRz7D2P.js.map} +1 -1
  133. prefect/server/ui-v2/assets/{index-DQGif3jm.js → index-DzUcVNZg.js} +2 -2
  134. prefect/server/ui-v2/assets/{index-DQGif3jm.js.map → index-DzUcVNZg.js.map} +1 -1
  135. prefect/server/ui-v2/assets/{index-DNh9ZBy4.js → index-IBvMMs6S.js} +2 -2
  136. prefect/server/ui-v2/assets/{index-DNh9ZBy4.js.map → index-IBvMMs6S.js.map} +1 -1
  137. prefect/server/ui-v2/assets/index-_kpA__te.js +2 -0
  138. prefect/server/ui-v2/assets/{index-CiSFHkhI.js.map → index-_kpA__te.js.map} +1 -1
  139. prefect/server/ui-v2/assets/index-m9O-nIOl.css +1 -0
  140. prefect/server/ui-v2/assets/{index-lyQav_XM.js → index-wOvyf10b.js} +2 -2
  141. prefect/server/ui-v2/assets/{index-lyQav_XM.js.map → index-wOvyf10b.js.map} +1 -1
  142. prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js → json-input-Ce-HlRqa.js} +2 -2
  143. prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js.map → json-input-Ce-HlRqa.js.map} +1 -1
  144. prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js → key-value-XHEZOtZX.js} +2 -2
  145. prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js.map → key-value-XHEZOtZX.js.map} +1 -1
  146. prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js → key._key-LpsMf3zD.js} +2 -2
  147. prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js.map → key._key-LpsMf3zD.js.map} +1 -1
  148. prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js → lazy-markdown-1Hz0xzca.js} +2 -2
  149. prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js.map → lazy-markdown-1Hz0xzca.js.map} +1 -1
  150. prefect/server/ui-v2/assets/{login-DxMF9Jvj.js → login-D5uepl9L.js} +2 -2
  151. prefect/server/ui-v2/assets/{login-DxMF9Jvj.js.map → login-D5uepl9L.js.map} +1 -1
  152. prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js → markdown-input-CG6M9zD0.js} +2 -2
  153. prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js.map → markdown-input-CG6M9zD0.js.map} +1 -1
  154. prefect/server/ui-v2/assets/python-example-snippet-DRHcUlCX.js +3 -0
  155. prefect/server/ui-v2/assets/{python-example-snippet-DfCFYPN_.js.map → python-example-snippet-DRHcUlCX.js.map} +1 -1
  156. prefect/server/ui-v2/assets/{python-input-mr6GD840.js → python-input-BsUS8fw1.js} +2 -2
  157. prefect/server/ui-v2/assets/{python-input-mr6GD840.js.map → python-input-BsUS8fw1.js.map} +1 -1
  158. prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js → radio-group-BUsmwdrt.js} +2 -2
  159. prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js.map → radio-group-BUsmwdrt.js.map} +1 -1
  160. prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js → route-error-state-BFBpiIhD.js} +2 -2
  161. prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js.map → route-error-state-BFBpiIhD.js.map} +1 -1
  162. prefect/server/ui-v2/assets/{schema-form-CWDHSME9.js → schema-form-BwTmkvJk.js} +2 -2
  163. prefect/server/ui-v2/assets/schema-form-BwTmkvJk.js.map +1 -0
  164. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js → schema-form-input-string-format-datetime-nrb3g-JJ.js} +4 -4
  165. prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js.map → schema-form-input-string-format-datetime-nrb3g-JJ.js.map} +1 -1
  166. prefect/server/ui-v2/assets/{settings-DU5y6tJE.js → settings-CUBtK5aW.js} +2 -2
  167. prefect/server/ui-v2/assets/{settings-DU5y6tJE.js.map → settings-CUBtK5aW.js.map} +1 -1
  168. prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js → sort-filter-Cv8zAXMp.js} +2 -2
  169. prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js.map → sort-filter-Cv8zAXMp.js.map} +1 -1
  170. prefect/server/ui-v2/assets/{table-bBL6C0ZK.js → table-BBNGfPra.js} +2 -2
  171. prefect/server/ui-v2/assets/{table-bBL6C0ZK.js.map → table-BBNGfPra.js.map} +1 -1
  172. prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js → tags-input-DHrnkwjQ.js} +2 -2
  173. prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js.map → tags-input-DHrnkwjQ.js.map} +1 -1
  174. prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js +2 -0
  175. prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-S69sih55.js.map → task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js.map} +1 -1
  176. prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js → task-run._id-BY58gqs2.js} +2 -2
  177. prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js.map → task-run._id-BY58gqs2.js.map} +1 -1
  178. prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js → task-run._id-u73Jxfqw.js} +3 -3
  179. prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js.map → task-run._id-u73Jxfqw.js.map} +1 -1
  180. prefect/server/ui-v2/assets/task-runs-pagination-DUy3147A.js +2 -0
  181. prefect/server/ui-v2/assets/{task-runs-pagination-VdR-LO4r.js.map → task-runs-pagination-DUy3147A.js.map} +1 -1
  182. prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js → textarea-DUhh6-kq.js} +2 -2
  183. prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js.map → textarea-DUhh6-kq.js.map} +1 -1
  184. prefect/server/ui-v2/assets/timezone-select-D4Q6VBtD.js +2 -0
  185. prefect/server/ui-v2/assets/{timezone-select-BuPYznge.js.map → timezone-select-D4Q6VBtD.js.map} +1 -1
  186. prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js → toggle-group-7WUJn2Tx.js} +2 -2
  187. prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js.map → toggle-group-7WUJn2Tx.js.map} +1 -1
  188. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-D4AD5Ndf.js +2 -0
  189. prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DpdsLH4t.js.map → use-delete-automation-confirmation-dialog-D4AD5Ndf.js.map} +1 -1
  190. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js → use-delete-block-document-confirmation-dialog-DnwWEGUY.js} +2 -2
  191. prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js.map → use-delete-block-document-confirmation-dialog-DnwWEGUY.js.map} +1 -1
  192. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js → use-flow-runs-selected-rows-C-tehPRB.js} +2 -2
  193. prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js.map → use-flow-runs-selected-rows-C-tehPRB.js.map} +1 -1
  194. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js → use-get-artifacts-flow-task-runs-DRWRrmrb.js} +2 -2
  195. prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js.map → use-get-artifacts-flow-task-runs-DRWRrmrb.js.map} +1 -1
  196. prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js → use-quick-run-B4Xj-YQQ.js} +2 -2
  197. prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js.map → use-quick-run-B4Xj-YQQ.js.map} +1 -1
  198. prefect/server/ui-v2/assets/use-state-favicon-au2TZdMV.js +2 -0
  199. prefect/server/ui-v2/assets/{use-state-favicon-M09DmrNy.js.map → use-state-favicon-au2TZdMV.js.map} +1 -1
  200. prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js → use-stepper-DyIb3vlq.js} +2 -2
  201. prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js.map → use-stepper-DyIb3vlq.js.map} +1 -1
  202. prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js → utilities-D9Y2wo66.js} +2 -2
  203. prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js.map → utilities-D9Y2wo66.js.map} +1 -1
  204. prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js +34 -0
  205. prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js.map +1 -0
  206. prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js → work-pool-filter-CSOATj2D.js} +2 -2
  207. prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js.map → work-pool-filter-CSOATj2D.js.map} +1 -1
  208. prefect/server/ui-v2/assets/work-pool-queue-toggle-Dh7B1zMo.js +2 -0
  209. prefect/server/ui-v2/assets/{work-pool-queue-toggle-BQ9b-Wxy.js.map → work-pool-queue-toggle-Dh7B1zMo.js.map} +1 -1
  210. prefect/server/ui-v2/assets/work-pool._workPoolName-B_NFWXKS.js +2 -0
  211. prefect/server/ui-v2/assets/{work-pool._workPoolName-C_LiL3SE.js.map → work-pool._workPoolName-B_NFWXKS.js.map} +1 -1
  212. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js → work-pool_._workPoolName.edit-Cyzn8g-S.js} +2 -2
  213. prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js.map → work-pool_._workPoolName.edit-Cyzn8g-S.js.map} +1 -1
  214. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js} +2 -2
  215. prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js.map → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js.map} +1 -1
  216. prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js → work-queue-icon-text-BOpcJ8YU.js} +2 -2
  217. prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js.map → work-queue-icon-text-BOpcJ8YU.js.map} +1 -1
  218. prefect/server/ui-v2/index.html +3 -3
  219. {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/METADATA +2 -1
  220. {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/RECORD +223 -211
  221. prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js +0 -2
  222. prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js.map +0 -1
  223. prefect/server/ui-v2/assets/automation._id-Dn7jABys.js +0 -2
  224. prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js +0 -2
  225. prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js.map +0 -1
  226. prefect/server/ui-v2/assets/catalog_._slug-Bl2J2oI3.js +0 -2
  227. prefect/server/ui-v2/assets/create-D--LHaji.js +0 -2
  228. prefect/server/ui-v2/assets/data-table-rlbkLcrY.js +0 -2
  229. prefect/server/ui-v2/assets/data-table-rlbkLcrY.js.map +0 -1
  230. prefect/server/ui-v2/assets/delete-confirmation-dialog-DHkm2p8m.js +0 -2
  231. prefect/server/ui-v2/assets/deployment._id-Ci9zge5n.js +0 -2
  232. prefect/server/ui-v2/assets/deployment_._id.duplicate-D9ZWkh8H.js +0 -2
  233. prefect/server/ui-v2/assets/deployment_._id.edit-CS7sObzC.js +0 -2
  234. prefect/server/ui-v2/assets/event._eventDate._eventId-D7Twzb22.js +0 -2
  235. prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js +0 -4
  236. prefect/server/ui-v2/assets/flow._id-BdQGWPKP.js +0 -2
  237. prefect/server/ui-v2/assets/index-7i4X9TeK.js +0 -2
  238. prefect/server/ui-v2/assets/index-BkiGTHwU.js +0 -2
  239. prefect/server/ui-v2/assets/index-BkiGTHwU.js.map +0 -1
  240. prefect/server/ui-v2/assets/index-COouj_0-.css +0 -1
  241. prefect/server/ui-v2/assets/index-CiSFHkhI.js +0 -2
  242. prefect/server/ui-v2/assets/index-DATPYZfT.js +0 -2
  243. prefect/server/ui-v2/assets/index-DATPYZfT.js.map +0 -1
  244. prefect/server/ui-v2/assets/index-VH4TnZ4e.js +0 -2
  245. prefect/server/ui-v2/assets/index-VH4TnZ4e.js.map +0 -1
  246. prefect/server/ui-v2/assets/python-example-snippet-DfCFYPN_.js +0 -3
  247. prefect/server/ui-v2/assets/schema-form-CWDHSME9.js.map +0 -1
  248. prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-S69sih55.js +0 -2
  249. prefect/server/ui-v2/assets/task-runs-pagination-VdR-LO4r.js +0 -2
  250. prefect/server/ui-v2/assets/timezone-select-BuPYznge.js +0 -2
  251. prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DpdsLH4t.js +0 -2
  252. prefect/server/ui-v2/assets/use-state-favicon-M09DmrNy.js +0 -2
  253. prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js +0 -34
  254. prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js.map +0 -1
  255. prefect/server/ui-v2/assets/work-pool-queue-toggle-BQ9b-Wxy.js +0 -2
  256. prefect/server/ui-v2/assets/work-pool._workPoolName-C_LiL3SE.js +0 -2
  257. {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/WHEEL +0 -0
  258. {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/entry_points.txt +0 -0
  259. {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/licenses/LICENSE +0 -0
@@ -1,2 +0,0 @@
1
- import{j as e,r as n,L as h,s as T}from"./vendor-tanstack-BcZfOOfy.js";import{B as f,g,h as j,bs as p,bB as b,D,al as x,q as v,I as N,y as L,O as _,aM as m,ar as S,bn as k,dz as C,dy as M}from"./index-m48E4KcG.js";import{a as A}from"./use-get-artifacts-flow-task-runs-DTwcWiqW.js";import{L as w}from"./lazy-markdown-Du2Xu3Yp.js";import{u as B,E as F}from"./vendor-codemirror-LnHkUyAP.js";import{T as I,a as $,b as y,c as z,d as E,e as H}from"./table-bBL6C0ZK.js";import{K as r}from"./key-value-DkSKn6jE.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./vendor-date-wwuDAncJ.js";const O=({artifact:s})=>{let a=e.jsx(e.Fragment,{});return s.key?a=e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(f,{children:e.jsxs(g,{children:[e.jsx(j,{children:e.jsx(p,{to:"/artifacts/key/$key",params:{key:s.key},className:"text-xl font-semibold",children:s.key})}),e.jsx(b,{}),e.jsx(j,{className:"text-xl font-semibold",children:s.id})]})})}):a=e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(f,{children:e.jsxs(g,{children:[s.flow_run&&e.jsxs(e.Fragment,{children:[e.jsx(j,{children:e.jsx(p,{to:"/runs/flow-run/$id",params:{id:s.flow_run_id??""},className:"text-xl font-semibold",children:s.flow_run.name})}),e.jsx(b,{})]}),s.task_run&&e.jsxs(e.Fragment,{children:[e.jsx(j,{children:e.jsx(p,{to:"/runs/task-run/$id",params:{id:s.task_run_id??""},className:"text-xl font-semibold",children:s.task_run.name})}),e.jsx(b,{})]}),e.jsx(j,{className:"text-xl font-semibold",children:s.id})]})})}),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[a,e.jsx(D,{id:"artifacts-guide",label:"Documentation"})]}),s.description&&e.jsx("div",{className:"",children:e.jsx(x,{variant:"h2",className:"my-4 font-bold prose lg:prose-xl",children:e.jsx(w,{children:s.description})})}),e.jsx("hr",{})]})},G=({artifact:s})=>{const[a,t]=n.useState(!1),i=()=>{t(u=>!u)},d=n.useRef(null),o={highlightActiveLine:!1,foldGutter:!1,highlightActiveLineGutter:!1},{setContainer:l}=B({container:d.current,extensions:[F.lineWrapping],value:String(s.data),indentWithTab:!1,editable:!0,basicSetup:o});n.useEffect(()=>{d.current&&l(d.current)},[l]);const c=u=>{L.success("Copied to clipboard"),navigator.clipboard.writeText(u)};return e.jsxs("div",{className:"flex flex-col justify-center items-center",children:[e.jsxs(v,{"data-testid":"show-raw-data-button",variant:"outline",onClick:i,className:"my-4",children:[a?"Hide":"Show"," Raw Data"]}),e.jsx("div",{className:"rounded-md border shadow-xs focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative",style:{display:a?"block":"none"},ref:u=>{d.current=u},"data-testid":"raw-data-display",children:e.jsx(v,{onClick:()=>c(s.data),variant:"ghost",size:"icon",className:"absolute top-0 right-0 z-10","aria-label":"copy",children:e.jsx(N,{id:"Copy",className:"size-2"})})})]})},P=({url:s})=>e.jsxs("div",{"data-testid":s,className:"prose mt-2",children:[e.jsx("img",{"data-testid":`image-${s}`,src:s,alt:"artifact-image",className:"w-full"}),e.jsxs(x,{variant:"bodyLarge",children:["Image URL:"," ",e.jsx("a",{className:"text-blue-700 hover:underline",target:"_blank",href:s,rel:"noreferrer",children:s})]})]}),K=({markdown:s})=>e.jsx("div",{"data-testid":"markdown-display",className:"mt-4 prose",children:e.jsx(w,{children:s})}),U=({progress:s})=>e.jsxs(x,{"data-testid":"progress-display",variant:"bodyLarge",children:["Progress: ",s,"%"]}),W=({tableData:s})=>{const a=JSON.parse(s),t=Object.keys(a[0]),[i,d]=n.useState(""),o=n.useMemo(()=>a.filter(l=>Object.values(l).some(c=>String(c).toLowerCase().includes(i.toLowerCase()))),[i,a]);return e.jsxs("div",{"data-testid":"table-display",className:"mt-4",children:[e.jsx("div",{className:"flex flex-row justify-end items-center mb-2",children:e.jsx("div",{children:e.jsx(_,{placeholder:"Search",value:i,onChange:l=>d(l.target.value)})})}),e.jsx("div",{className:"rounded-md border",children:e.jsxs(I,{children:[e.jsx($,{className:"bg-muted",children:e.jsx(y,{children:t.map(l=>e.jsx(z,{className:"py-2 text-foreground",children:l},l))})}),e.jsx(E,{children:o.map(l=>e.jsx(y,{children:t.map(c=>e.jsx(H,{children:l[c]},c))},l.id))})]})})]})},J=({artifact:s})=>{const a=n.useMemo(()=>s.created?m(s.created,"dateTime"):null,[s.created]);return e.jsxs("div",{className:"mt-4",children:[e.jsx(x,{variant:"bodyLarge",className:"font-bold",children:"Artifact"}),e.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[e.jsx(r,{label:"Key",value:e.jsx("span",{className:"font-mono",children:s.key??"None"})}),e.jsx(r,{label:"Type",value:e.jsx("span",{className:"font-mono",children:s.type??"None"})}),e.jsx(r,{label:"Created",value:e.jsx("span",{className:"font-mono",children:a??"None"})})]})]})},Q=({flowRun:s})=>{const a=n.useMemo(()=>s.start_time?m(s.start_time,"dateTime"):null,[s.start_time]),t=n.useMemo(()=>s.estimated_run_time?S(Math.ceil(s.estimated_run_time)*1e3):null,[s.estimated_run_time]),i=n.useMemo(()=>s.created?m(s.created,"dateTime"):null,[s.created]),d=n.useMemo(()=>s.updated?m(s.updated,"dateTime"):null,[s.updated]);return e.jsxs("div",{className:"mt-4",children:[e.jsx(x,{variant:"bodyLarge",className:"font-bold",children:"Flow Run"}),e.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[e.jsx(r,{label:"Start time",value:e.jsxs("span",{className:"font-mono flex items-center",children:[e.jsx(N,{id:"Calendar",className:"inline w-4 mr-2"}),a??"None"]})}),e.jsx(r,{label:"Duration",value:e.jsxs("span",{className:"font-mono flex items-center",children:[e.jsx(N,{id:"Clock",className:"inline w-4 mr-2"}),t??"None"]})}),e.jsx(r,{label:"Created",value:e.jsx("span",{className:"font-mono",children:i??"None"})}),e.jsx(r,{label:"Last Updated",value:e.jsx("span",{className:"font-mono",children:d??"None"})}),e.jsx(r,{label:"Tags",value:s.tags&&s.tags.length>0?e.jsx("div",{className:"flex flex-wrap",children:s.tags.map(o=>e.jsx(k,{tag:o},o))}):e.jsx("span",{className:"font-mono",children:"None"})}),e.jsx(r,{label:"State Message",value:e.jsx("span",{className:"font-mono",children:s.state?.message??"None"})})]})]})},V=({artifact:s})=>{const{flow_run:a,task_run:t}=s;return s.key||a||t?e.jsxs("div",{className:"flex flex-col gap-2",children:[s.key&&e.jsx(r,{label:"Artifact",value:e.jsx(h,{to:"/artifacts/key/$key",params:{key:s.key},className:"text-blue-500 hover:underline",children:s.key})}),a&&e.jsx(r,{label:"Flow Run",value:e.jsx(h,{to:"/runs/flow-run/$id",params:{id:a.id},className:"text-blue-500 hover:underline",children:a.name})}),t&&e.jsx(r,{label:"Task Run",value:e.jsx(h,{to:"/runs/task-run/$id",params:{id:t.id},className:"text-blue-500 hover:underline",children:t.name})}),e.jsx("hr",{className:"mt-2 border-border"})]}):null},q=({taskRun:s})=>{const a=n.useMemo(()=>s.created?m(s.created,"dateTime"):null,[s.created]),t=n.useMemo(()=>s.updated?m(s.updated,"dateTime"):null,[s.updated]);return e.jsxs("div",{className:"mt-4",children:[e.jsx(x,{variant:"bodyLarge",className:"font-bold",children:"Task Run"}),e.jsxs("div",{className:"mt-3 flex flex-col gap-3",children:[e.jsx(r,{label:"Created",value:e.jsx("span",{className:"font-mono",children:a??"None"})}),e.jsx(r,{label:"Last Updated",value:e.jsx("span",{className:"font-mono",children:t??"None"})}),e.jsx(r,{label:"Tags",value:s.tags&&s.tags.length>0?e.jsx("div",{className:"flex flex-wrap",children:s.tags.map(i=>e.jsx(k,{tag:i},i))}):e.jsx("span",{className:"font-mono",children:"None"})})]})]})},X=({artifact:s})=>{const{flow_run:a,task_run:t}=s;return e.jsxs("div",{className:"w-[250px] shrink-0 pt-4",children:[e.jsx(V,{artifact:s}),e.jsx(J,{artifact:s}),(a||t)&&e.jsx("hr",{className:"mt-4 border-border"}),a&&e.jsx(Q,{flowRun:a}),a&&t&&e.jsx("hr",{className:"mt-4 border-border"}),t&&e.jsx(q,{taskRun:t})]})},Y=({artifact:s})=>{const a=n.useMemo(()=>{switch(s.type){case"markdown":case"link":return e.jsx(K,{markdown:s.data});case"image":return e.jsx(P,{url:s.data});case"progress":return e.jsx(U,{progress:s.data});case"table":return e.jsx(W,{tableData:s.data});default:return e.jsx("pre",{children:JSON.stringify(s.data,null,2)})}},[s]);return e.jsxs("div",{children:[e.jsx(O,{artifact:s}),e.jsxs("div",{className:"flex flex-row gap-4 justify-between",children:[e.jsxs("div",{className:"flex-grow min-w-0",children:[a,e.jsx(G,{artifact:s})]}),e.jsx(X,{artifact:s})]})]})};function ce(){const{id:s}=C.useParams(),{data:a}=T(M(s)),t=A(s);return e.jsx(Y,{artifact:t??a})}export{ce as component};
2
- //# sourceMappingURL=artifact._id-BFdf1WUA.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact._id-BFdf1WUA.js","sources":["../../src/components/artifacts/artifact/artifact-detail-header.tsx","../../src/components/artifacts/artifact/artifact-raw-data-display.tsx","../../src/components/artifacts/artifact/detail-image.tsx","../../src/components/artifacts/artifact/detail-markdown.tsx","../../src/components/artifacts/artifact/detail-progress.tsx","../../src/components/artifacts/artifact/detail-table.tsx","../../src/components/artifacts/artifact/metadata-sidebar/artifact-section.tsx","../../src/components/artifacts/artifact/metadata-sidebar/flow-run-section.tsx","../../src/components/artifacts/artifact/metadata-sidebar/links-section.tsx","../../src/components/artifacts/artifact/metadata-sidebar/task-run-section.tsx","../../src/components/artifacts/artifact/metadata-sidebar/index.tsx","../../src/components/artifacts/artifact/artifact-detail-page.tsx","../../src/routes/artifacts/artifact.$id.tsx?tsr-split=component"],"sourcesContent":["import type { ArtifactWithFlowRunAndTaskRun } from \"@/api/artifacts\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbLink,\n\tBreadcrumbList,\n\tBreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport { LazyMarkdown } from \"@/components/ui/lazy-markdown\";\nimport { Typography } from \"@/components/ui/typography\";\n\nexport type ArtifactDetailHeaderProps = {\n\tartifact: ArtifactWithFlowRunAndTaskRun;\n};\n\nexport const ArtifactDetailHeader = ({\n\tartifact,\n}: ArtifactDetailHeaderProps) => {\n\tlet header = <></>;\n\tif (artifact.key) {\n\t\theader = (\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Breadcrumb>\n\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\t\t\tto=\"/artifacts/key/$key\"\n\t\t\t\t\t\t\t\tparams={{ key: artifact.key }}\n\t\t\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{artifact.key}\n\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\t\t{artifact.id}\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t</Breadcrumb>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\theader = (\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Breadcrumb>\n\t\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t\t{artifact.flow_run && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\t\t\t\t\tto=\"/runs/flow-run/$id\"\n\t\t\t\t\t\t\t\t\t\tparams={{ id: artifact.flow_run_id ?? \"\" }}\n\t\t\t\t\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{artifact.flow_run.name}\n\t\t\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{artifact.task_run && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<BreadcrumbItem>\n\t\t\t\t\t\t\t\t\t<BreadcrumbLink\n\t\t\t\t\t\t\t\t\t\tto=\"/runs/task-run/$id\"\n\t\t\t\t\t\t\t\t\t\tparams={{ id: artifact.task_run_id ?? \"\" }}\n\t\t\t\t\t\t\t\t\t\tclassName=\"text-xl font-semibold\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{artifact.task_run.name}\n\t\t\t\t\t\t\t\t\t</BreadcrumbLink>\n\t\t\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t\t\t\t<BreadcrumbSeparator />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\t\t{artifact.id}\n\t\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t\t</BreadcrumbList>\n\t\t\t\t</Breadcrumb>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<>\n\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t{header}\n\t\t\t\t<DocsLink id=\"artifacts-guide\" label=\"Documentation\" />\n\t\t\t</div>\n\t\t\t{artifact.description && (\n\t\t\t\t<div className=\"\">\n\t\t\t\t\t<Typography variant=\"h2\" className=\"my-4 font-bold prose lg:prose-xl\">\n\t\t\t\t\t\t<LazyMarkdown>{artifact.description}</LazyMarkdown>\n\t\t\t\t\t</Typography>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<hr />\n\t\t</>\n\t);\n};\n","import { EditorView, useCodeMirror } from \"@uiw/react-codemirror\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { toast } from \"sonner\";\nimport type { ArtifactWithFlowRunAndTaskRun } from \"@/api/artifacts\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype ArtifactDataDisplayProps = {\n\tartifact: ArtifactWithFlowRunAndTaskRun;\n};\n\nexport const ArtifactDataDisplay = ({ artifact }: ArtifactDataDisplayProps) => {\n\tconst [showData, setShowData] = useState(false);\n\n\tconst toggleShowData = () => {\n\t\tsetShowData((val) => !val);\n\t};\n\n\tconst editor = useRef<HTMLDivElement | null>(null);\n\tconst basicSetup = {\n\t\thighlightActiveLine: false,\n\t\tfoldGutter: false,\n\t\thighlightActiveLineGutter: false,\n\t};\n\tconst { setContainer } = useCodeMirror({\n\t\tcontainer: editor.current,\n\t\textensions: [EditorView.lineWrapping],\n\t\tvalue: String(artifact.data),\n\t\tindentWithTab: false,\n\t\teditable: true,\n\t\tbasicSetup,\n\t});\n\n\tuseEffect(() => {\n\t\tif (editor.current) {\n\t\t\tsetContainer(editor.current);\n\t\t}\n\t}, [setContainer]);\n\n\tconst handleCopy = (_value: string) => {\n\t\ttoast.success(\"Copied to clipboard\");\n\t\tvoid navigator.clipboard.writeText(_value);\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col justify-center items-center\">\n\t\t\t<Button\n\t\t\t\tdata-testid=\"show-raw-data-button\"\n\t\t\t\tvariant={\"outline\"}\n\t\t\t\tonClick={toggleShowData}\n\t\t\t\tclassName=\"my-4\"\n\t\t\t>\n\t\t\t\t{showData ? \"Hide\" : \"Show\"} Raw Data\n\t\t\t</Button>\n\n\t\t\t<div\n\t\t\t\tclassName=\"rounded-md border shadow-xs focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring relative\"\n\t\t\t\tstyle={{\n\t\t\t\t\tdisplay: showData ? \"block\" : \"none\",\n\t\t\t\t}}\n\t\t\t\tref={(node) => {\n\t\t\t\t\teditor.current = node;\n\t\t\t\t}}\n\t\t\t\tdata-testid=\"raw-data-display\"\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={() => handleCopy(artifact.data as string)}\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\tclassName=\"absolute top-0 right-0 z-10\"\n\t\t\t\t\taria-label=\"copy\"\n\t\t\t\t>\n\t\t\t\t\t<Icon id=\"Copy\" className=\"size-2\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\n\nexport type DetailImageProps = {\n\turl: string;\n};\n\nexport const DetailImage = ({ url }: DetailImageProps) => {\n\treturn (\n\t\t<div data-testid={url} className=\"prose mt-2\">\n\t\t\t<img\n\t\t\t\tdata-testid={`image-${url}`}\n\t\t\t\tsrc={url}\n\t\t\t\talt=\"artifact-image\"\n\t\t\t\tclassName=\"w-full\"\n\t\t\t/>\n\n\t\t\t<Typography variant=\"bodyLarge\">\n\t\t\t\tImage URL:{\" \"}\n\t\t\t\t<a\n\t\t\t\t\tclassName=\"text-blue-700 hover:underline\"\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\thref={url}\n\t\t\t\t\trel=\"noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t{url}\n\t\t\t\t</a>\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n","import { LazyMarkdown } from \"@/components/ui/lazy-markdown\";\n\nexport type DetailMarkdownProps = {\n\tmarkdown: string;\n};\n\nexport const DetailMarkdown = ({ markdown }: DetailMarkdownProps) => {\n\treturn (\n\t\t<div data-testid=\"markdown-display\" className=\"mt-4 prose\">\n\t\t\t<LazyMarkdown>{markdown}</LazyMarkdown>\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\n\nexport type DetailProgressProps = {\n\tprogress: number;\n};\n\nexport const DetailProgress = ({ progress }: DetailProgressProps) => {\n\treturn (\n\t\t<Typography data-testid=\"progress-display\" variant=\"bodyLarge\">\n\t\t\tProgress: {progress}%\n\t\t</Typography>\n\t);\n};\n","import { useMemo, useState } from \"react\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport {\n\tTable,\n\tTableBody,\n\tTableCell,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n} from \"@/components/ui/table\";\n\nexport type DetailTableProps = {\n\ttableData: string;\n};\n\nexport const DetailTable = ({ tableData }: DetailTableProps) => {\n\tconst table = JSON.parse(tableData) as Record<string, string>[];\n\tconst headers = Object.keys(table[0]);\n\tconst [input, setInput] = useState<string>(\"\");\n\n\tconst filteredTable = useMemo(() => {\n\t\treturn table.filter((row) => {\n\t\t\treturn Object.values(row).some((value: string) =>\n\t\t\t\tString(value).toLowerCase().includes(input.toLowerCase()),\n\t\t\t);\n\t\t});\n\t}, [input, table]);\n\n\treturn (\n\t\t<div data-testid=\"table-display\" className=\"mt-4\">\n\t\t\t<div className=\"flex flex-row justify-end items-center mb-2\">\n\t\t\t\t<div>\n\t\t\t\t\t<SearchInput\n\t\t\t\t\t\tplaceholder=\"Search\"\n\t\t\t\t\t\tvalue={input}\n\t\t\t\t\t\tonChange={(e) => setInput(e.target.value)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"rounded-md border\">\n\t\t\t\t<Table>\n\t\t\t\t\t<TableHeader className=\"bg-muted\">\n\t\t\t\t\t\t<TableRow>\n\t\t\t\t\t\t\t{headers.map((header) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<TableHead key={header} className=\"py-2 text-foreground\">\n\t\t\t\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t\t\t</TableHead>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t</TableHeader>\n\t\t\t\t\t<TableBody>\n\t\t\t\t\t\t{filteredTable.map((row) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<TableRow key={row.id}>\n\t\t\t\t\t\t\t\t\t{headers.map((header) => {\n\t\t\t\t\t\t\t\t\t\treturn <TableCell key={header}>{row[header]}</TableCell>;\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</TableBody>\n\t\t\t\t</Table>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { useMemo } from \"react\";\nimport type { ArtifactWithFlowRunAndTaskRun } from \"@/api/artifacts\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { formatDate } from \"@/utils/date\";\n\ntype ArtifactSectionProps = {\n\tartifact: ArtifactWithFlowRunAndTaskRun;\n};\n\nexport const ArtifactSection = ({ artifact }: ArtifactSectionProps) => {\n\tconst createdDate = useMemo(() => {\n\t\tif (!artifact.created) return null;\n\t\treturn formatDate(artifact.created, \"dateTime\");\n\t}, [artifact.created]);\n\n\treturn (\n\t\t<div className=\"mt-4\">\n\t\t\t<Typography variant=\"bodyLarge\" className=\"font-bold\">\n\t\t\t\tArtifact\n\t\t\t</Typography>\n\n\t\t\t<div className=\"mt-3 flex flex-col gap-3\">\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Key\"\n\t\t\t\t\tvalue={<span className=\"font-mono\">{artifact.key ?? \"None\"}</span>}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Type\"\n\t\t\t\t\tvalue={<span className=\"font-mono\">{artifact.type ?? \"None\"}</span>}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<span className=\"font-mono\">{createdDate ?? \"None\"}</span>}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import humanizeDuration from \"humanize-duration\";\nimport { useMemo } from \"react\";\nimport type { FlowRun } from \"@/api/flow-runs\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport { TagBadge } from \"@/components/ui/tag-badge\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { formatDate } from \"@/utils/date\";\n\ntype FlowRunSectionProps = {\n\tflowRun: FlowRun;\n};\n\nexport const FlowRunSection = ({ flowRun }: FlowRunSectionProps) => {\n\tconst startTime = useMemo(() => {\n\t\tif (!flowRun.start_time) return null;\n\t\treturn formatDate(flowRun.start_time, \"dateTime\");\n\t}, [flowRun.start_time]);\n\n\tconst duration = useMemo(() => {\n\t\tif (!flowRun.estimated_run_time) return null;\n\t\treturn humanizeDuration(Math.ceil(flowRun.estimated_run_time) * 1000);\n\t}, [flowRun.estimated_run_time]);\n\n\tconst createdDate = useMemo(() => {\n\t\tif (!flowRun.created) return null;\n\t\treturn formatDate(flowRun.created, \"dateTime\");\n\t}, [flowRun.created]);\n\n\tconst updatedDate = useMemo(() => {\n\t\tif (!flowRun.updated) return null;\n\t\treturn formatDate(flowRun.updated, \"dateTime\");\n\t}, [flowRun.updated]);\n\n\treturn (\n\t\t<div className=\"mt-4\">\n\t\t\t<Typography variant=\"bodyLarge\" className=\"font-bold\">\n\t\t\t\tFlow Run\n\t\t\t</Typography>\n\n\t\t\t<div className=\"mt-3 flex flex-col gap-3\">\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Start time\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<span className=\"font-mono flex items-center\">\n\t\t\t\t\t\t\t<Icon id=\"Calendar\" className=\"inline w-4 mr-2\" />\n\t\t\t\t\t\t\t{startTime ?? \"None\"}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Duration\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<span className=\"font-mono flex items-center\">\n\t\t\t\t\t\t\t<Icon id=\"Clock\" className=\"inline w-4 mr-2\" />\n\t\t\t\t\t\t\t{duration ?? \"None\"}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<span className=\"font-mono\">{createdDate ?? \"None\"}</span>}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Last Updated\"\n\t\t\t\t\tvalue={<span className=\"font-mono\">{updatedDate ?? \"None\"}</span>}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Tags\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\tflowRun.tags && flowRun.tags.length > 0 ? (\n\t\t\t\t\t\t\t<div className=\"flex flex-wrap\">\n\t\t\t\t\t\t\t\t{flowRun.tags.map((tag) => (\n\t\t\t\t\t\t\t\t\t<TagBadge key={tag} tag={tag} />\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"font-mono\">None</span>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"State Message\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<span className=\"font-mono\">\n\t\t\t\t\t\t\t{flowRun.state?.message ?? \"None\"}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { Link } from \"@tanstack/react-router\";\nimport type { ArtifactWithFlowRunAndTaskRun } from \"@/api/artifacts\";\nimport { KeyValue } from \"@/components/ui/key-value\";\n\ntype LinksSectionProps = {\n\tartifact: ArtifactWithFlowRunAndTaskRun;\n};\n\nexport const LinksSection = ({ artifact }: LinksSectionProps) => {\n\tconst { flow_run, task_run } = artifact;\n\tconst hasLinks = artifact.key || flow_run || task_run;\n\n\tif (!hasLinks) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t{artifact.key && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Artifact\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tto=\"/artifacts/key/$key\"\n\t\t\t\t\t\t\tparams={{ key: artifact.key }}\n\t\t\t\t\t\t\tclassName=\"text-blue-500 hover:underline\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{artifact.key}\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{flow_run && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Flow Run\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tto=\"/runs/flow-run/$id\"\n\t\t\t\t\t\t\tparams={{ id: flow_run.id }}\n\t\t\t\t\t\t\tclassName=\"text-blue-500 hover:underline\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{flow_run.name}\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{task_run && (\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Task Run\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tto=\"/runs/task-run/$id\"\n\t\t\t\t\t\t\tparams={{ id: task_run.id }}\n\t\t\t\t\t\t\tclassName=\"text-blue-500 hover:underline\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{task_run.name}\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t<hr className=\"mt-2 border-border\" />\n\t\t</div>\n\t);\n};\n","import { useMemo } from \"react\";\nimport type { TaskRun } from \"@/api/task-runs\";\nimport { KeyValue } from \"@/components/ui/key-value\";\nimport { TagBadge } from \"@/components/ui/tag-badge\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { formatDate } from \"@/utils/date\";\n\ntype TaskRunSectionProps = {\n\ttaskRun: TaskRun;\n};\n\nexport const TaskRunSection = ({ taskRun }: TaskRunSectionProps) => {\n\tconst createdDate = useMemo(() => {\n\t\tif (!taskRun.created) return null;\n\t\treturn formatDate(taskRun.created, \"dateTime\");\n\t}, [taskRun.created]);\n\n\tconst updatedDate = useMemo(() => {\n\t\tif (!taskRun.updated) return null;\n\t\treturn formatDate(taskRun.updated, \"dateTime\");\n\t}, [taskRun.updated]);\n\n\treturn (\n\t\t<div className=\"mt-4\">\n\t\t\t<Typography variant=\"bodyLarge\" className=\"font-bold\">\n\t\t\t\tTask Run\n\t\t\t</Typography>\n\n\t\t\t<div className=\"mt-3 flex flex-col gap-3\">\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Created\"\n\t\t\t\t\tvalue={<span className=\"font-mono\">{createdDate ?? \"None\"}</span>}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Last Updated\"\n\t\t\t\t\tvalue={<span className=\"font-mono\">{updatedDate ?? \"None\"}</span>}\n\t\t\t\t/>\n\n\t\t\t\t<KeyValue\n\t\t\t\t\tlabel=\"Tags\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\ttaskRun.tags && taskRun.tags.length > 0 ? (\n\t\t\t\t\t\t\t<div className=\"flex flex-wrap\">\n\t\t\t\t\t\t\t\t{taskRun.tags.map((tag) => (\n\t\t\t\t\t\t\t\t\t<TagBadge key={tag} tag={tag} />\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"font-mono\">None</span>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import type { ArtifactWithFlowRunAndTaskRun } from \"@/api/artifacts\";\nimport { ArtifactSection } from \"./artifact-section\";\nimport { FlowRunSection } from \"./flow-run-section\";\nimport { LinksSection } from \"./links-section\";\nimport { TaskRunSection } from \"./task-run-section\";\n\nexport type MetadataSidebarProps = {\n\tartifact: ArtifactWithFlowRunAndTaskRun;\n};\n\nexport const MetadataSidebar = ({ artifact }: MetadataSidebarProps) => {\n\tconst { flow_run, task_run } = artifact;\n\n\treturn (\n\t\t<div className=\"w-[250px] shrink-0 pt-4\">\n\t\t\t<LinksSection artifact={artifact} />\n\n\t\t\t<ArtifactSection artifact={artifact} />\n\n\t\t\t{(flow_run || task_run) && <hr className=\"mt-4 border-border\" />}\n\n\t\t\t{flow_run && <FlowRunSection flowRun={flow_run} />}\n\n\t\t\t{flow_run && task_run && <hr className=\"mt-4 border-border\" />}\n\n\t\t\t{task_run && <TaskRunSection taskRun={task_run} />}\n\t\t</div>\n\t);\n};\n","import { useMemo } from \"react\";\nimport type { ArtifactWithFlowRunAndTaskRun } from \"@/api/artifacts\";\nimport { ArtifactDetailHeader } from \"./artifact-detail-header\";\nimport { ArtifactDataDisplay } from \"./artifact-raw-data-display\";\nimport { DetailImage } from \"./detail-image\";\nimport { DetailMarkdown } from \"./detail-markdown\";\nimport { DetailProgress } from \"./detail-progress\";\nimport { DetailTable } from \"./detail-table\";\nimport { MetadataSidebar } from \"./metadata-sidebar\";\n\nexport type ArtifactDetailPageProps = {\n\tartifact: ArtifactWithFlowRunAndTaskRun;\n};\n\nexport const ArtifactDetailPage = ({ artifact }: ArtifactDetailPageProps) => {\n\tconst mapArtifactHoc = useMemo(() => {\n\t\tswitch (artifact.type) {\n\t\t\tcase \"markdown\":\n\t\t\tcase \"link\":\n\t\t\t\treturn <DetailMarkdown markdown={artifact.data as string} />;\n\t\t\tcase \"image\":\n\t\t\t\treturn <DetailImage url={artifact.data as string} />;\n\t\t\tcase \"progress\":\n\t\t\t\treturn <DetailProgress progress={artifact.data as number} />;\n\t\t\tcase \"table\":\n\t\t\t\treturn <DetailTable tableData={artifact.data as string} />;\n\t\t\tdefault:\n\t\t\t\treturn <pre>{JSON.stringify(artifact.data, null, 2)}</pre>;\n\t\t}\n\t}, [artifact]);\n\treturn (\n\t\t<div>\n\t\t\t<ArtifactDetailHeader artifact={artifact} />\n\t\t\t<div className=\"flex flex-row gap-4 justify-between\">\n\t\t\t\t<div className=\"flex-grow min-w-0\">\n\t\t\t\t\t{mapArtifactHoc}\n\t\t\t\t\t<ArtifactDataDisplay artifact={artifact} />\n\t\t\t\t</div>\n\t\t\t\t<MetadataSidebar artifact={artifact} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { createFileRoute } from \"@tanstack/react-router\";\nimport { buildGetArtifactQuery } from \"@/api/artifacts\";\nimport { useGetArtifactFlowTaskRuns } from \"@/api/artifacts/use-get-artifacts-flow-task-runs/use-get-artifacts-flow-task-runs\";\nimport { ArtifactDetailPage } from \"@/components/artifacts/artifact/artifact-detail-page\";\n\nexport const Route = createFileRoute(\"/artifacts/artifact/$id\")({\n\tcomponent: RouteComponent,\n\tloader: async ({ context, params }) => {\n\t\tconst { id } = params;\n\n\t\tconst artifact = await context.queryClient.ensureQueryData(\n\t\t\tbuildGetArtifactQuery(id),\n\t\t);\n\n\t\treturn { artifact };\n\t},\n});\n\nfunction RouteComponent() {\n\tconst { id } = Route.useParams();\n\n\tconst { data: artifact } = useSuspenseQuery(buildGetArtifactQuery(id));\n\n\tconst artifactWithMetadata = useGetArtifactFlowTaskRuns(id);\n\n\treturn <ArtifactDetailPage artifact={artifactWithMetadata ?? artifact} />;\n}\n"],"names":["ArtifactDetailHeader","artifact","header","jsx","Fragment","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","BreadcrumbSeparator","jsxs","DocsLink","Typography","LazyMarkdown","ArtifactDataDisplay","showData","setShowData","useState","toggleShowData","val","editor","useRef","basicSetup","setContainer","useCodeMirror","EditorView","useEffect","handleCopy","_value","toast","Button","node","Icon","DetailImage","url","DetailMarkdown","markdown","DetailProgress","progress","DetailTable","tableData","table","headers","input","setInput","filteredTable","useMemo","row","value","SearchInput","e","Table","TableHeader","TableRow","TableHead","TableBody","TableCell","ArtifactSection","createdDate","formatDate","KeyValue","FlowRunSection","flowRun","startTime","duration","humanizeDuration","updatedDate","tag","TagBadge","LinksSection","flow_run","task_run","Link","TaskRunSection","taskRun","MetadataSidebar","ArtifactDetailPage","mapArtifactHoc","RouteComponent","id","Route","useParams","data","useSuspenseQuery","buildGetArtifactQuery","artifactWithMetadata","useGetArtifactFlowTaskRuns"],"mappings":"4qBAgBO,MAAMA,EAAuB,CAAC,CACpC,SAAAC,CACD,IAAiC,CAChC,IAAIC,EAASC,EAAAA,IAAAC,EAAAA,SAAA,EAAE,EACf,OAAIH,EAAS,IACZC,QACE,MAAA,CAAI,UAAU,0BACd,SAAAC,MAACE,EAAA,CACA,gBAACC,EAAA,CACA,SAAA,CAAAH,MAACI,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CACA,GAAG,sBACH,OAAQ,CAAE,IAAKP,EAAS,GAAA,EACxB,UAAU,wBAET,SAAAA,EAAS,GAAA,CAAA,EAEZ,QACCQ,EAAA,EAAoB,EACrBN,EAAAA,IAACI,EAAA,CAAe,UAAU,wBACxB,WAAS,EAAA,CACX,CAAA,CAAA,CACD,EACD,EACD,EAGDL,QACE,MAAA,CAAI,UAAU,0BACd,SAAAC,MAACE,EAAA,CACA,gBAACC,EAAA,CACC,SAAA,CAAAL,EAAS,UACTS,EAAAA,KAAAN,EAAAA,SAAA,CACC,SAAA,CAAAD,MAACI,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CACA,GAAG,qBACH,OAAQ,CAAE,GAAIP,EAAS,aAAe,EAAA,EACtC,UAAU,wBAET,WAAS,SAAS,IAAA,CAAA,EAErB,QACCQ,EAAA,CAAA,CAAoB,CAAA,EACtB,EAEAR,EAAS,UACTS,EAAAA,KAAAN,EAAAA,SAAA,CACC,SAAA,CAAAD,MAACI,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CACA,GAAG,qBACH,OAAQ,CAAE,GAAIP,EAAS,aAAe,EAAA,EACtC,UAAU,wBAET,WAAS,SAAS,IAAA,CAAA,EAErB,QACCQ,EAAA,CAAA,CAAoB,CAAA,EACtB,EAEDN,EAAAA,IAACI,EAAA,CAAe,UAAU,wBACxB,WAAS,EAAA,CACX,CAAA,CAAA,CACD,EACD,EACD,EAIDG,EAAAA,KAAAN,WAAA,CACC,SAAA,CAAAM,EAAAA,KAAC,MAAA,CAAI,UAAU,oCACb,SAAA,CAAAR,EACDC,EAAAA,IAACQ,EAAA,CAAS,GAAG,kBAAkB,MAAM,eAAA,CAAgB,CAAA,EACtD,EACCV,EAAS,aACTE,MAAC,MAAA,CAAI,UAAU,GACd,SAAAA,EAAAA,IAACS,EAAA,CAAW,QAAQ,KAAK,UAAU,mCAClC,SAAAT,EAAAA,IAACU,GAAc,SAAAZ,EAAS,YAAY,EACrC,CAAA,CACD,QAEA,KAAA,CAAA,CAAG,CAAA,EACL,CAEF,ECxFaa,EAAsB,CAAC,CAAE,SAAAb,KAAyC,CAC9E,KAAM,CAACc,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAK,EAExCC,EAAiB,IAAM,CAC5BF,EAAaG,GAAQ,CAACA,CAAG,CAC1B,EAEMC,EAASC,EAAAA,OAA8B,IAAI,EAC3CC,EAAa,CAClB,oBAAqB,GACrB,WAAY,GACZ,0BAA2B,EAAA,EAEtB,CAAE,aAAAC,CAAA,EAAiBC,EAAc,CACtC,UAAWJ,EAAO,QAClB,WAAY,CAACK,EAAW,YAAY,EACpC,MAAO,OAAOxB,EAAS,IAAI,EAC3B,cAAe,GACf,SAAU,GACV,WAAAqB,CAAA,CACA,EAEDI,EAAAA,UAAU,IAAM,CACXN,EAAO,SACVG,EAAaH,EAAO,OAAO,CAE7B,EAAG,CAACG,CAAY,CAAC,EAEjB,MAAMI,EAAcC,GAAmB,CACtCC,EAAM,QAAQ,qBAAqB,EAC9B,UAAU,UAAU,UAAUD,CAAM,CAC1C,EAEA,OACClB,EAAAA,KAAC,MAAA,CAAI,UAAU,4CACd,SAAA,CAAAA,EAAAA,KAACoB,EAAA,CACA,cAAY,uBACZ,QAAS,UACT,QAASZ,EACT,UAAU,OAET,SAAA,CAAAH,EAAW,OAAS,OAAO,WAAA,CAAA,CAAA,EAG7BZ,EAAAA,IAAC,MAAA,CACA,UAAU,8GACV,MAAO,CACN,QAASY,EAAW,QAAU,MAAA,EAE/B,IAAMgB,GAAS,CACdX,EAAO,QAAUW,CAClB,EACA,cAAY,mBAEZ,SAAA5B,EAAAA,IAAC2B,EAAA,CACA,QAAS,IAAMH,EAAW1B,EAAS,IAAc,EACjD,QAAQ,QACR,KAAK,OACL,UAAU,8BACV,aAAW,OAEX,SAAAE,EAAAA,IAAC6B,EAAA,CAAK,GAAG,OAAO,UAAU,QAAA,CAAS,CAAA,CAAA,CACpC,CAAA,CACD,EACD,CAEF,ECvEaC,EAAc,CAAC,CAAE,IAAAC,KAE5BxB,EAAAA,KAAC,MAAA,CAAI,cAAawB,EAAK,UAAU,aAChC,SAAA,CAAA/B,EAAAA,IAAC,MAAA,CACA,cAAa,SAAS+B,CAAG,GACzB,IAAKA,EACL,IAAI,iBACJ,UAAU,QAAA,CAAA,EAGXxB,EAAAA,KAACE,EAAA,CAAW,QAAQ,YAAY,SAAA,CAAA,aACpB,IACXT,EAAAA,IAAC,IAAA,CACA,UAAU,gCACV,OAAO,SACP,KAAM+B,EACN,IAAI,aAEH,SAAAA,CAAA,CAAA,CACF,CAAA,CACD,CAAA,EACD,ECrBWC,EAAiB,CAAC,CAAE,SAAAC,KAE/BjC,EAAAA,IAAC,OAAI,cAAY,mBAAmB,UAAU,aAC7C,SAAAA,EAAAA,IAACU,EAAA,CAAc,SAAAuB,CAAA,CAAS,CAAA,CACzB,ECJWC,EAAiB,CAAC,CAAE,SAAAC,KAE/B5B,EAAAA,KAACE,EAAA,CAAW,cAAY,mBAAmB,QAAQ,YAAY,SAAA,CAAA,aACnD0B,EAAS,GAAA,EACrB,ECKWC,EAAc,CAAC,CAAE,UAAAC,KAAkC,CAC/D,MAAMC,EAAQ,KAAK,MAAMD,CAAS,EAC5BE,EAAU,OAAO,KAAKD,EAAM,CAAC,CAAC,EAC9B,CAACE,EAAOC,CAAQ,EAAI3B,EAAAA,SAAiB,EAAE,EAEvC4B,EAAgBC,EAAAA,QAAQ,IACtBL,EAAM,OAAQM,GACb,OAAO,OAAOA,CAAG,EAAE,KAAMC,GAC/B,OAAOA,CAAK,EAAE,cAAc,SAASL,EAAM,YAAA,CAAa,CAAA,CAEzD,EACC,CAACA,EAAOF,CAAK,CAAC,EAEjB,OACC/B,EAAAA,KAAC,MAAA,CAAI,cAAY,gBAAgB,UAAU,OAC1C,SAAA,CAAAP,MAAC,MAAA,CAAI,UAAU,8CACd,SAAAA,MAAC,MAAA,CACA,SAAAA,EAAAA,IAAC8C,EAAA,CACA,YAAY,SACZ,MAAON,EACP,SAAWO,GAAMN,EAASM,EAAE,OAAO,KAAK,CAAA,CAAA,EAE1C,CAAA,CACD,EACA/C,MAAC,MAAA,CAAI,UAAU,oBACd,gBAACgD,EAAA,CACA,SAAA,CAAAhD,EAAAA,IAACiD,EAAA,CAAY,UAAU,WACtB,SAAAjD,EAAAA,IAACkD,GACC,SAAAX,EAAQ,IAAKxC,GAEZC,EAAAA,IAACmD,EAAA,CAAuB,UAAU,uBAChC,YADcpD,CAEhB,CAED,EACF,EACD,EACAC,EAAAA,IAACoD,EAAA,CACC,SAAAV,EAAc,IAAKE,GAElB5C,EAAAA,IAACkD,EAAA,CACC,SAAAX,EAAQ,IAAKxC,GACNC,EAAAA,IAACqD,EAAA,CAAwB,SAAAT,EAAI7C,CAAM,GAAnBA,CAAqB,CAC5C,CAAA,EAHa6C,EAAI,EAInB,CAED,CAAA,CACF,CAAA,CAAA,CACD,CAAA,CACD,CAAA,EACD,CAEF,ECzDaU,EAAkB,CAAC,CAAE,SAAAxD,KAAqC,CACtE,MAAMyD,EAAcZ,EAAAA,QAAQ,IACtB7C,EAAS,QACP0D,EAAW1D,EAAS,QAAS,UAAU,EADhB,KAE5B,CAACA,EAAS,OAAO,CAAC,EAErB,OACCS,EAAAA,KAAC,MAAA,CAAI,UAAU,OACd,SAAA,CAAAP,MAACS,EAAA,CAAW,QAAQ,YAAY,UAAU,YAAY,SAAA,WAEtD,EAEAF,EAAAA,KAAC,MAAA,CAAI,UAAU,2BACd,SAAA,CAAAP,EAAAA,IAACyD,EAAA,CACA,MAAM,MACN,MAAOzD,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,SAAAF,EAAS,KAAO,MAAA,CAAO,CAAA,CAAA,EAG5DE,EAAAA,IAACyD,EAAA,CACA,MAAM,OACN,MAAOzD,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,SAAAF,EAAS,MAAQ,MAAA,CAAO,CAAA,CAAA,EAG7DE,EAAAA,IAACyD,EAAA,CACA,MAAM,UACN,MAAOzD,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,YAAe,MAAA,CAAO,CAAA,CAAA,CAC3D,CAAA,CACD,CAAA,EACD,CAEF,EC3Ba0D,EAAiB,CAAC,CAAE,QAAAC,KAAmC,CACnE,MAAMC,EAAYjB,EAAAA,QAAQ,IACpBgB,EAAQ,WACNH,EAAWG,EAAQ,WAAY,UAAU,EADhB,KAE9B,CAACA,EAAQ,UAAU,CAAC,EAEjBE,EAAWlB,EAAAA,QAAQ,IACnBgB,EAAQ,mBACNG,EAAiB,KAAK,KAAKH,EAAQ,kBAAkB,EAAI,GAAI,EAD5B,KAEtC,CAACA,EAAQ,kBAAkB,CAAC,EAEzBJ,EAAcZ,EAAAA,QAAQ,IACtBgB,EAAQ,QACNH,EAAWG,EAAQ,QAAS,UAAU,EADhB,KAE3B,CAACA,EAAQ,OAAO,CAAC,EAEdI,EAAcpB,EAAAA,QAAQ,IACtBgB,EAAQ,QACNH,EAAWG,EAAQ,QAAS,UAAU,EADhB,KAE3B,CAACA,EAAQ,OAAO,CAAC,EAEpB,OACCpD,EAAAA,KAAC,MAAA,CAAI,UAAU,OACd,SAAA,CAAAP,MAACS,EAAA,CAAW,QAAQ,YAAY,UAAU,YAAY,SAAA,WAEtD,EAEAF,EAAAA,KAAC,MAAA,CAAI,UAAU,2BACd,SAAA,CAAAP,EAAAA,IAACyD,EAAA,CACA,MAAM,aACN,MACClD,EAAAA,KAAC,OAAA,CAAK,UAAU,8BACf,SAAA,CAAAP,EAAAA,IAAC6B,EAAA,CAAK,GAAG,WAAW,UAAU,kBAAkB,EAC/C+B,GAAa,MAAA,CAAA,CACf,CAAA,CAAA,EAIF5D,EAAAA,IAACyD,EAAA,CACA,MAAM,WACN,MACClD,EAAAA,KAAC,OAAA,CAAK,UAAU,8BACf,SAAA,CAAAP,EAAAA,IAAC6B,EAAA,CAAK,GAAG,QAAQ,UAAU,kBAAkB,EAC5CgC,GAAY,MAAA,CAAA,CACd,CAAA,CAAA,EAIF7D,EAAAA,IAACyD,EAAA,CACA,MAAM,UACN,MAAOzD,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,YAAe,MAAA,CAAO,CAAA,CAAA,EAG3DA,EAAAA,IAACyD,EAAA,CACA,MAAM,eACN,MAAOzD,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,YAAe,MAAA,CAAO,CAAA,CAAA,EAG3DA,EAAAA,IAACyD,EAAA,CACA,MAAM,OACN,MACCE,EAAQ,MAAQA,EAAQ,KAAK,OAAS,EACrC3D,EAAAA,IAAC,MAAA,CAAI,UAAU,iBACb,SAAA2D,EAAQ,KAAK,IAAKK,GAClBhE,EAAAA,IAACiE,EAAA,CAAmB,IAAAD,CAAA,EAALA,CAAe,CAC9B,CAAA,CACF,EAEAhE,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAY,SAAA,MAAA,CAAI,CAAA,CAAA,EAKnCA,EAAAA,IAACyD,EAAA,CACA,MAAM,gBACN,YACE,OAAA,CAAK,UAAU,YACd,SAAAE,EAAQ,OAAO,SAAW,MAAA,CAC5B,CAAA,CAAA,CAEF,CAAA,CACD,CAAA,EACD,CAEF,ECzFaO,EAAe,CAAC,CAAE,SAAApE,KAAkC,CAChE,KAAM,CAAE,SAAAqE,EAAU,SAAAC,CAAA,EAAatE,EAG/B,OAFiBA,EAAS,KAAOqE,GAAYC,EAO5C7D,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACb,SAAA,CAAAT,EAAS,KACTE,EAAAA,IAACyD,EAAA,CACA,MAAM,WACN,MACCzD,EAAAA,IAACqE,EAAA,CACA,GAAG,sBACH,OAAQ,CAAE,IAAKvE,EAAS,GAAA,EACxB,UAAU,gCAET,SAAAA,EAAS,GAAA,CAAA,CACX,CAAA,EAKFqE,GACAnE,EAAAA,IAACyD,EAAA,CACA,MAAM,WACN,MACCzD,EAAAA,IAACqE,EAAA,CACA,GAAG,qBACH,OAAQ,CAAE,GAAIF,EAAS,EAAA,EACvB,UAAU,gCAET,SAAAA,EAAS,IAAA,CAAA,CACX,CAAA,EAKFC,GACApE,EAAAA,IAACyD,EAAA,CACA,MAAM,WACN,MACCzD,EAAAA,IAACqE,EAAA,CACA,GAAG,qBACH,OAAQ,CAAE,GAAID,EAAS,EAAA,EACvB,UAAU,gCAET,SAAAA,EAAS,IAAA,CAAA,CACX,CAAA,EAKHpE,EAAAA,IAAC,KAAA,CAAG,UAAU,oBAAA,CAAqB,CAAA,EACpC,EAnDO,IAqDT,ECvDasE,EAAiB,CAAC,CAAE,QAAAC,KAAmC,CACnE,MAAMhB,EAAcZ,EAAAA,QAAQ,IACtB4B,EAAQ,QACNf,EAAWe,EAAQ,QAAS,UAAU,EADhB,KAE3B,CAACA,EAAQ,OAAO,CAAC,EAEdR,EAAcpB,EAAAA,QAAQ,IACtB4B,EAAQ,QACNf,EAAWe,EAAQ,QAAS,UAAU,EADhB,KAE3B,CAACA,EAAQ,OAAO,CAAC,EAEpB,OACChE,EAAAA,KAAC,MAAA,CAAI,UAAU,OACd,SAAA,CAAAP,MAACS,EAAA,CAAW,QAAQ,YAAY,UAAU,YAAY,SAAA,WAEtD,EAEAF,EAAAA,KAAC,MAAA,CAAI,UAAU,2BACd,SAAA,CAAAP,EAAAA,IAACyD,EAAA,CACA,MAAM,UACN,MAAOzD,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,YAAe,MAAA,CAAO,CAAA,CAAA,EAG3DA,EAAAA,IAACyD,EAAA,CACA,MAAM,eACN,MAAOzD,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAa,YAAe,MAAA,CAAO,CAAA,CAAA,EAG3DA,EAAAA,IAACyD,EAAA,CACA,MAAM,OACN,MACCc,EAAQ,MAAQA,EAAQ,KAAK,OAAS,EACrCvE,EAAAA,IAAC,MAAA,CAAI,UAAU,iBACb,SAAAuE,EAAQ,KAAK,IAAKP,GAClBhE,EAAAA,IAACiE,EAAA,CAAmB,IAAAD,CAAA,EAALA,CAAe,CAC9B,CAAA,CACF,EAEAhE,EAAAA,IAAC,OAAA,CAAK,UAAU,YAAY,SAAA,MAAA,CAAI,CAAA,CAAA,CAGnC,CAAA,CACD,CAAA,EACD,CAEF,EC9CawE,EAAkB,CAAC,CAAE,SAAA1E,KAAqC,CACtE,KAAM,CAAE,SAAAqE,EAAU,SAAAC,CAAA,EAAatE,EAE/B,OACCS,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACd,SAAA,CAAAP,MAACkE,GAAa,SAAApE,EAAoB,EAElCE,MAACsD,GAAgB,SAAAxD,EAAoB,GAEnCqE,GAAYC,IAAapE,EAAAA,IAAC,KAAA,CAAG,UAAU,qBAAqB,EAE7DmE,GAAYnE,EAAAA,IAAC0D,EAAA,CAAe,QAASS,CAAA,CAAU,EAE/CA,GAAYC,GAAYpE,EAAAA,IAAC,KAAA,CAAG,UAAU,qBAAqB,EAE3DoE,GAAYpE,EAAAA,IAACsE,EAAA,CAAe,QAASF,CAAA,CAAU,CAAA,EACjD,CAEF,ECdaK,EAAqB,CAAC,CAAE,SAAA3E,KAAwC,CAC5E,MAAM4E,EAAiB/B,EAAAA,QAAQ,IAAM,CACpC,OAAQ7C,EAAS,KAAA,CAChB,IAAK,WACL,IAAK,OACJ,OAAOE,EAAAA,IAACgC,EAAA,CAAe,SAAUlC,EAAS,IAAA,CAAgB,EAC3D,IAAK,QACJ,OAAOE,EAAAA,IAAC8B,EAAA,CAAY,IAAKhC,EAAS,IAAA,CAAgB,EACnD,IAAK,WACJ,OAAOE,EAAAA,IAACkC,EAAA,CAAe,SAAUpC,EAAS,IAAA,CAAgB,EAC3D,IAAK,QACJ,OAAOE,EAAAA,IAACoC,EAAA,CAAY,UAAWtC,EAAS,IAAA,CAAgB,EACzD,QACC,OAAOE,MAAC,OAAK,SAAA,KAAK,UAAUF,EAAS,KAAM,KAAM,CAAC,CAAA,CAAE,CAAA,CAEvD,EAAG,CAACA,CAAQ,CAAC,EACb,cACE,MAAA,CACA,SAAA,CAAAE,MAACH,GAAqB,SAAAC,EAAoB,EAC1CS,EAAAA,KAAC,MAAA,CAAI,UAAU,sCACd,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,oBACb,SAAA,CAAAmE,EACD1E,MAACW,GAAoB,SAAAb,CAAA,CAAoB,CAAA,EAC1C,EACAE,MAACwE,GAAgB,SAAA1E,CAAA,CAAoB,CAAA,CAAA,CACtC,CAAA,EACD,CAEF,ECvBA,SAAS6E,IAAiB,CACzB,KAAM,CAAEC,GAAAA,CAAAA,EAAOC,EAAMC,UAAAA,EAEf,CAAEC,KAAMjF,CAAAA,EAAakF,EAAiBC,EAAsBL,CAAE,CAAC,EAE/DM,EAAuBC,EAA2BP,CAAE,EAE1D,OAAO5E,EAAAA,IAACyE,EAAA,CAAmB,SAAUS,GAAwBpF,CAAAA,CAAS,CACvE"}
@@ -1,2 +0,0 @@
1
- import{s as n,j as t}from"./vendor-tanstack-BcZfOOfy.js";import{d7 as m,B as l,g as c,h as a,bs as u,bB as d,bD as x,dv as j}from"./index-m48E4KcG.js";import{D as p}from"./delete-confirmation-dialog-DHkm2p8m.js";import{u as f,A as b,a as g,b as h,c as A,d as D}from"./use-delete-automation-confirmation-dialog-DpdsLH4t.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./vendor-date-wwuDAncJ.js";import"./work-queue-icon-text-D4BWBVDN.js";import"./index-CKGj5lSu.js";import"./dropdown-menu-0atiOSFo.js";import"./use-delete-confirmation-dialog-CUdii6Lo.js";const B=({id:s})=>{const[o,i]=f(),{data:e}=n(m(s)),r=()=>i(e,{shouldNavigate:!0});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(N,{automation:e}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(b,{automation:e}),t.jsx(g,{id:e.id,onDelete:r})]})]}),t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(h,{automation:e}),t.jsx(A,{automation:e}),t.jsx(D,{automation:e})]})]}),t.jsx(p,{...o})]})},N=({automation:s})=>t.jsx(l,{children:t.jsxs(c,{children:[t.jsx(a,{children:t.jsx(u,{to:"/automations",className:"text-xl font-semibold",children:"Automations"})}),t.jsx(d,{}),t.jsx(a,{className:"text-xl font-semibold",children:t.jsx(x,{children:s.name})})]})});function G(){const{id:s}=j.useParams();return t.jsx(B,{id:s})}export{G as component};
2
- //# sourceMappingURL=automation._id-Dn7jABys.js.map
@@ -1,2 +0,0 @@
1
- import{j as a}from"./vendor-tanstack-BcZfOOfy.js";import{cB as e}from"./index-m48E4KcG.js";const c=({alt:o,logoUrl:s,size:r="sm"})=>a.jsx("img",{alt:o,src:s??void 0,className:i({size:r})}),i=e("border-4 bg-gray-200 rounded",{variants:{size:{sm:"size-8",lg:"size-14"}}});export{c as B};
2
- //# sourceMappingURL=block-type-logo-Cbpfxded.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block-type-logo-Cbpfxded.js","sources":["../../src/components/block-type-logo/block-type-logo.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { BlockType } from \"@/api/block-types\";\n\ntype BlockTypeLogoProps = {\n\talt?: string;\n\tlogoUrl: BlockType[\"logo_url\"];\n\tsize?: \"sm\" | \"lg\";\n};\n\nexport const BlockTypeLogo = ({\n\talt,\n\tlogoUrl,\n\tsize = \"sm\",\n}: BlockTypeLogoProps) => (\n\t<img\n\t\talt={alt}\n\t\tsrc={logoUrl ?? undefined}\n\t\tclassName={blockTypeLogoVariant({ size })}\n\t/>\n);\n\nconst blockTypeLogoVariant = cva(\"border-4 bg-gray-200 rounded\", {\n\tvariants: {\n\t\tsize: {\n\t\t\tsm: \"size-8\",\n\t\t\tlg: \"size-14\",\n\t\t},\n\t},\n});\n"],"names":["BlockTypeLogo","alt","logoUrl","size","jsx","blockTypeLogoVariant","cva"],"mappings":"2FASO,MAAMA,EAAgB,CAAC,CAC7B,IAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,IACR,IACCC,EAAAA,IAAC,MAAA,CACA,IAAAH,EACA,IAAKC,GAAW,OAChB,UAAWG,EAAqB,CAAE,KAAAF,CAAA,CAAM,CAAA,CACzC,EAGKE,EAAuBC,EAAI,+BAAgC,CAChE,SAAU,CACT,KAAM,CACL,GAAI,SACJ,GAAI,SAAA,CACL,CAEF,CAAC"}
@@ -1,2 +0,0 @@
1
- import{j as s,L as l,s as c}from"./vendor-tanstack-BcZfOOfy.js";import{B as d,g as m,h as t,bs as o,bB as n,C as x,al as i,q as u,dt as p,df as j}from"./index-m48E4KcG.js";import{B as h}from"./block-type-logo-Cbpfxded.js";import{P as f}from"./python-example-snippet-DfCFYPN_.js";import{L as g}from"./lazy-markdown-Du2Xu3Yp.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./vendor-date-wwuDAncJ.js";const B=({blockType:e})=>s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(N,{blockType:e}),s.jsx(v,{blockType:e})]});function N({blockType:e}){return s.jsx(d,{children:s.jsxs(m,{children:[s.jsx(t,{children:s.jsx(o,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),s.jsx(n,{}),s.jsx(t,{children:s.jsx(o,{to:"/blocks/catalog",className:"text-xl font-semibold",children:"Catalog"})}),s.jsx(n,{}),s.jsx(t,{className:"text-xl font-semibold",children:e.slug})]})})}function v({blockType:e}){return s.jsx("div",{children:s.jsxs(x,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(h,{size:"lg",logoUrl:e.logo_url}),s.jsx(i,{variant:"h3",children:e.name})]}),e.description&&s.jsx(L,{description:e.description,documentationUrl:e.documentation_url}),e.code_example&&s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(i,{variant:"h4",children:"Example"}),s.jsx(f,{codeExample:e.code_example,name:e.name})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(u,{children:s.jsx(l,{to:"/blocks/catalog/$slug/create",params:{slug:e.slug},children:"Create"})})})]})})}function L({description:e,documentationUrl:a}){let r=e;return a&&(r=`${r} [Documentation](${a})`),s.jsx("div",{className:"prose max-w-none",children:s.jsx(g,{children:r})})}function $(){const{slug:e}=p.useParams(),{data:a}=c(j(e));return s.jsx(B,{blockType:a})}export{$ as component};
2
- //# sourceMappingURL=catalog_._slug-Bl2J2oI3.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,s as E,r as V,g as I}from"./vendor-tanstack-BcZfOOfy.js";import{a as R}from"./zod-Cuos7J7w.js";import{g as B,o as P,n as D,s as N,r as U,u as q,c as A}from"./vendor-forms-ClCIacbh.js";import{p as _,C as T,o as F,bw as $,aW as S,bx as J,by as z,H as G,bz as H,m as M,n as O,q as v,y as w}from"./index-m48E4KcG.js";import{b as x,c as f,d as h,e as j,a as b,F as Q}from"./form-DLrbC7rV.js";import{u as K,S as X}from"./use-stepper-CDucnvzp.js";import{T as Y}from"./textarea-B3_TtPRi.js";import"./schema-form-input-string-format-datetime-BSWlW_aQ.js";import"./toggle-group-Cn07UIim.js";import{B as Z}from"./base-job-template-form-section-De2ACYbw.js";import{R as ee,a as te}from"./radio-group-Co3cN0Kv.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-date-wwuDAncJ.js";import"./use-debounce-callback-CSs1BjLI.js";import"./timezone-select-BuPYznge.js";import"./dropdown-menu-0atiOSFo.js";import"./schema-form-CWDHSME9.js";import"./block-type-logo-Cbpfxded.js";function re(){const a=B();return e.jsxs(e.Fragment,{children:[e.jsx(x,{control:a.control,name:"name",render:({field:o})=>e.jsxs(f,{children:[e.jsx(h,{children:"Name"}),e.jsx(j,{children:e.jsx(_,{...o})}),e.jsx(b,{})]})}),e.jsx(x,{control:a.control,name:"description",render:({field:o})=>e.jsxs(f,{children:[e.jsx(h,{children:"Description (Optional)"}),e.jsx(j,{children:e.jsx(Y,{...o,value:o.value??"",rows:7,placeholder:"Enter a description for your work pool"})}),e.jsx(b,{})]})}),e.jsx(x,{control:a.control,name:"concurrencyLimit",render:({field:o})=>e.jsxs(f,{children:[e.jsx(h,{children:"Flow Run Concurrency (Optional)"}),e.jsx(j,{children:e.jsx(_,{...o,type:"number",min:0,placeholder:"Unlimited",value:o.value??"",onChange:i=>{const n=i.target.value;o.onChange(n===""?null:Number(n))}})}),e.jsx(b,{})]})})]})}const se=P({name:N().min(1,"Name is required").refine(a=>!a.toLowerCase().startsWith("prefect"),"Work pools starting with 'prefect' are reserved for internal use."),description:N().nullable().optional(),concurrencyLimit:D().min(0).nullable().optional()});function oe(){const a=B(),o=a.watch("baseJobTemplate");return e.jsxs("div",{className:"space-y-6",children:[e.jsx(T,{children:e.jsx(F,{children:e.jsxs($,{children:["The fields below control the default values for the base job template. These values can be overridden by deployments.",e.jsx("br",{}),e.jsx("br",{}),"A work pools job template controls infrastructure configuration for all flow runs in the work pool, and specifies the configuration that can be overridden by deployments."]})})}),e.jsx(Z,{baseJobTemplate:o,onBaseJobTemplateChange:i=>{a.setValue("baseJobTemplate",i)}})]})}const ae=P({baseJobTemplate:U(q()).optional()}),k={sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12"},ne=({url:a,alt:o,size:i="md",className:n})=>a?e.jsx("img",{src:a,alt:o,className:S("rounded border bg-background/50 backdrop-blur-sm object-contain",k[i],n),onError:t=>{const r=t.target,s=document.createElement("div");s.className=S("rounded border bg-muted flex items-center justify-center text-muted-foreground text-xs",k[i],n),s.textContent=o.charAt(0).toUpperCase(),r.parentNode?.replaceChild(s,r)}}):e.jsx("div",{className:S("rounded border bg-muted flex items-center justify-center text-muted-foreground text-xs",k[i],n),children:o.charAt(0).toUpperCase()});function ie(){const a=B(),{data:o={}}=E(J()),i=V.useMemo(()=>{const n=[];return Object.values(o).forEach(t=>{t&&typeof t=="object"&&Object.values(t).forEach(r=>{if(r&&typeof r=="object"&&"type"in r){const{type:s,display_name:u,description:d,logo_url:m,documentation_url:y,is_beta:g}=r;s&&m&&d&&n.push({label:u||z(s),value:s,logoUrl:m,description:d,documentationUrl:y,isBeta:g||!1})}})}),n.sort((t,r)=>t.isBeta&&!r.isBeta?1:!t.isBeta&&r.isBeta?-1:t.label.localeCompare(r.label))},[o]);return e.jsx(x,{control:a.control,name:"type",render:({field:n,fieldState:t})=>e.jsxs(f,{children:[e.jsx(h,{className:"text-base font-medium",children:"Select the infrastructure you want to use to execute your flow runs"}),e.jsx(j,{children:e.jsx(ee,{value:n.value,onValueChange:r=>n.onChange(r),className:"space-y-3",children:i.map(({label:r,value:s,logoUrl:u,description:d,isBeta:m})=>e.jsxs("div",{className:"flex items-center space-x-3 p-4 rounded-lg border hover:bg-accent/50",children:[e.jsx(te,{value:s,id:s}),e.jsx("label",{htmlFor:s,className:"flex-1 cursor-pointer",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ne,{url:u,alt:r,size:"md"}),e.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[e.jsxs("p",{className:"text-base font-medium flex items-center",children:[r,m&&e.jsx(G,{variant:"secondary",className:"ml-2 text-xs",children:"Beta"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d})]})]})})]},s))})}),t.error&&e.jsx(b,{children:t.error.message})]})})}const W=["Infrastructure Type","Details","Configuration"],ce=P({type:N().min(1,"Infrastructure type is required"),...se.shape,...ae.shape});function le(){const a=I(),{createWorkPool:o,isPending:i}=H(),{data:n={}}=E(J()),t=K(W.length),r=A({resolver:R(ce),defaultValues:{description:null,concurrencyLimit:null}}),s=r.watch("type");V.useEffect(()=>{const c=Object.values(n).find(l=>l&&typeof l=="object"&&Object.values(l).find(p=>p&&typeof p=="object"&&"type"in p&&p.type===s));c&&s in c&&typeof c[s]=="object"&&c[s]&&"default_base_job_configuration"in c[s]&&r.setValue("baseJobTemplate",c[s].default_base_job_configuration)},[n,r,s]);const u=async()=>{const c=g(t.currentStep);await r.trigger(c)&&(t.isFinalStep?await y():t.incrementStep())},d=()=>{t.decrementStep()},m=()=>{a.navigate({to:"/work-pools"})},y=async()=>{if(!await r.trigger())return;const l=r.getValues();if(!l.name||!l.type){w.error("Please fill in all required fields");return}const p={name:l.name,type:l.type,description:l.description,is_paused:!1,concurrency_limit:l.concurrencyLimit,base_job_template:l.baseJobTemplate||{}};o(p,{onSuccess:C=>{w.success(`Work pool "${l.name}" created successfully`),a.navigate({to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:C.data?.name||l.name}})},onError:C=>{w.error(`Failed to create work pool: ${C.message}`)}})},g=c=>{switch(c){case 0:return["type"];case 1:return["name","description","concurrencyLimit"];case 2:return["baseJobTemplate"];default:return[]}},L=()=>{switch(t.currentStep){case 0:return e.jsx(ie,{});case 1:return e.jsx(re,{});case 2:return e.jsx(oe,{});default:return null}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(T,{children:[e.jsx(M,{children:e.jsx(O,{children:"Create Work Pool"})}),e.jsx(F,{children:e.jsx(X,{currentStepNum:t.currentStep,steps:W,onClick:({stepNum:c})=>{t.visitedStepsSet.has(c)&&t.changeStep(c)},completedSteps:t.completedStepsSet,visitedSteps:t.visitedStepsSet})})]}),e.jsx(T,{children:e.jsx(F,{className:"pt-6",children:e.jsx(Q,{...r,children:e.jsx("form",{className:"space-y-6",children:L()})})})}),e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("div",{children:[!t.isStartingStep&&e.jsx(v,{variant:"outline",onClick:d,disabled:i,children:"Back"}),e.jsx(v,{variant:"ghost",onClick:m,disabled:i,className:"ml-2",children:"Cancel"})]}),e.jsx(v,{onClick:()=>{u()},disabled:i,children:i?"Creating...":t.isFinalStep?"Create Work Pool":"Next"})]})]})}const Pe=le;export{Pe as component};
2
- //# sourceMappingURL=create-D--LHaji.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,K as r}from"./vendor-tanstack-BcZfOOfy.js";import{S as h,a as j,b as f,c as p,e as l,b6 as P,aW as C,b7 as S,b8 as o,cC as D,b9 as v,ba as N,cD as T}from"./index-m48E4KcG.js";import{T as z,a as b,b as c,c as w,d as M,e as x}from"./table-bBL6C0ZK.js";function k({table:n,onPrefetchPage:i}){return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"rounded-md border",children:e.jsxs(z,{children:[e.jsx(b,{children:n.getHeaderGroups().map(a=>e.jsx(c,{children:a.headers.map(s=>e.jsx(w,{style:{...s.column.columnDef.maxSize&&{maxWidth:`${s.column.columnDef.maxSize}px`},...s.column.columnDef.size&&{width:`${s.column.columnDef.size}px`}},children:s.isPlaceholder?null:r(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(M,{children:n.getRowModel().rows?.length?n.getRowModel().rows.map(a=>e.jsx(c,{"data-state":a.getIsSelected()&&"selected",children:a.getVisibleCells().map(s=>e.jsx(x,{style:{...s.column.columnDef.maxSize&&{maxWidth:`${s.column.columnDef.maxSize}px`},...s.column.columnDef.size&&{width:`${s.column.columnDef.size}px`}},children:r(s.column.columnDef.cell,s.getContext())},s.id))},a.id)):e.jsx(c,{children:e.jsx(x,{colSpan:n.getAllColumns().length,className:"h-24 text-center",children:"No results."})})})]})}),e.jsxs("div",{className:"flex flex-row justify-between items-center",children:[e.jsx(I,{table:n}),e.jsx(y,{table:n,onPrefetchPage:i})]})]})}function I({table:n}){return e.jsxs("div",{className:"flex flex-row items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{className:"whitespace-nowrap",children:"Items per page"}),e.jsxs(h,{value:n.getState().pagination.pageSize.toString(),onValueChange:i=>{n.setPageSize(Number(i))},children:[e.jsx(j,{"aria-label":"Items per page",children:e.jsx(f,{placeholder:"Theme"})}),e.jsxs(p,{children:[e.jsx(l,{value:"5",children:"5"}),e.jsx(l,{value:"10",children:"10"}),e.jsx(l,{value:"25",children:"25"}),e.jsx(l,{value:"50",children:"50"})]})]})]})}function y({table:n,className:i,onPrefetchPage:a}){const s=n.getPageCount(),t=Math.min(Math.ceil(n.getState().pagination.pageIndex+1),s),d=()=>{t>1&&a?.(1)},m=()=>{t>1&&a?.(t-1)},u=()=>{t<s&&a?.(t+1)},g=()=>{t<s&&a?.(s)};return e.jsx(P,{className:C("justify-end",i),children:e.jsxs(S,{children:[e.jsxs(o,{children:[e.jsx(D,{onClick:()=>n.firstPage(),onMouseEnter:d,disabled:!n.getCanPreviousPage()}),e.jsx(v,{onClick:()=>n.previousPage(),onMouseEnter:m,disabled:!n.getCanPreviousPage()})]}),e.jsxs(o,{className:"text-sm",children:["Page ",t," of ",s]}),e.jsx(o,{children:e.jsx(N,{onClick:()=>n.nextPage(),onMouseEnter:u,disabled:!n.getCanNextPage()})}),e.jsx(o,{children:e.jsx(T,{onClick:()=>n.lastPage(),onMouseEnter:g,disabled:!n.getCanNextPage()})})]})})}export{k as D};
2
- //# sourceMappingURL=data-table-rlbkLcrY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-table-rlbkLcrY.js","sources":["../../src/components/ui/data-table.tsx"],"sourcesContent":["import { flexRender, type Table as TanstackTable } from \"@tanstack/react-table\";\nimport {\n\tPagination,\n\tPaginationContent,\n\tPaginationFirstButton,\n\tPaginationItem,\n\tPaginationLastButton,\n\tPaginationNextButton,\n\tPaginationPreviousButton,\n} from \"@/components/ui/pagination\";\nimport {\n\tSelect,\n\tSelectContent,\n\tSelectItem,\n\tSelectTrigger,\n\tSelectValue,\n} from \"@/components/ui/select\";\nimport {\n\tTable,\n\tTableBody,\n\tTableCell,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n} from \"@/components/ui/table\";\nimport { cn } from \"@/utils\";\n\nexport function DataTable<TData>({\n\ttable,\n\tonPrefetchPage,\n}: {\n\ttable: TanstackTable<TData>;\n\tonPrefetchPage?: (page: number) => void;\n}) {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<div className=\"rounded-md border\">\n\t\t\t\t<Table>\n\t\t\t\t\t<TableHeader>\n\t\t\t\t\t\t{table.getHeaderGroups().map((headerGroup) => (\n\t\t\t\t\t\t\t<TableRow key={headerGroup.id}>\n\t\t\t\t\t\t\t\t{headerGroup.headers.map((header) => (\n\t\t\t\t\t\t\t\t\t<TableHead\n\t\t\t\t\t\t\t\t\t\tkey={header.id}\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t...(header.column.columnDef.maxSize && {\n\t\t\t\t\t\t\t\t\t\t\t\tmaxWidth: `${header.column.columnDef.maxSize}px`,\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t...(header.column.columnDef.size && {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: `${header.column.columnDef.size}px`,\n\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{header.isPlaceholder\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: flexRender(\n\t\t\t\t\t\t\t\t\t\t\t\t\theader.column.columnDef.header,\n\t\t\t\t\t\t\t\t\t\t\t\t\theader.getContext(),\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</TableHead>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</TableHeader>\n\t\t\t\t\t<TableBody>\n\t\t\t\t\t\t{table.getRowModel().rows?.length ? (\n\t\t\t\t\t\t\ttable.getRowModel().rows.map((row) => (\n\t\t\t\t\t\t\t\t<TableRow\n\t\t\t\t\t\t\t\t\tkey={row.id}\n\t\t\t\t\t\t\t\t\tdata-state={row.getIsSelected() && \"selected\"}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{row.getVisibleCells().map((cell) => (\n\t\t\t\t\t\t\t\t\t\t<TableCell\n\t\t\t\t\t\t\t\t\t\t\tkey={cell.id}\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t...(cell.column.columnDef.maxSize && {\n\t\t\t\t\t\t\t\t\t\t\t\t\tmaxWidth: `${cell.column.columnDef.maxSize}px`,\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t\t...(cell.column.columnDef.size && {\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: `${cell.column.columnDef.size}px`,\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{flexRender(\n\t\t\t\t\t\t\t\t\t\t\t\tcell.column.columnDef.cell,\n\t\t\t\t\t\t\t\t\t\t\t\tcell.getContext(),\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</TableCell>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t\t\t))\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<TableRow>\n\t\t\t\t\t\t\t\t<TableCell\n\t\t\t\t\t\t\t\t\tcolSpan={table.getAllColumns().length}\n\t\t\t\t\t\t\t\t\tclassName=\"h-24 text-center\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tNo results.\n\t\t\t\t\t\t\t\t</TableCell>\n\t\t\t\t\t\t\t</TableRow>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</TableBody>\n\t\t\t\t</Table>\n\t\t\t</div>\n\t\t\t<div className=\"flex flex-row justify-between items-center\">\n\t\t\t\t<DataTablePageSize table={table} />\n\t\t\t\t<DataTablePagination table={table} onPrefetchPage={onPrefetchPage} />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\ninterface DataTablePageSizeProps<TData> {\n\ttable: TanstackTable<TData>;\n}\n\nfunction DataTablePageSize<TData>({ table }: DataTablePageSizeProps<TData>) {\n\treturn (\n\t\t<div className=\"flex flex-row items-center gap-2 text-xs text-muted-foreground\">\n\t\t\t<span className=\"whitespace-nowrap\">Items per page</span>\n\t\t\t<Select\n\t\t\t\tvalue={table.getState().pagination.pageSize.toString()}\n\t\t\t\tonValueChange={(value) => {\n\t\t\t\t\ttable.setPageSize(Number(value));\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<SelectTrigger aria-label=\"Items per page\">\n\t\t\t\t\t<SelectValue placeholder=\"Theme\" />\n\t\t\t\t</SelectTrigger>\n\t\t\t\t<SelectContent>\n\t\t\t\t\t<SelectItem value=\"5\">5</SelectItem>\n\t\t\t\t\t<SelectItem value=\"10\">10</SelectItem>\n\t\t\t\t\t<SelectItem value=\"25\">25</SelectItem>\n\t\t\t\t\t<SelectItem value=\"50\">50</SelectItem>\n\t\t\t\t</SelectContent>\n\t\t\t</Select>\n\t\t</div>\n\t);\n}\n\ninterface DataTablePaginationProps<TData> {\n\ttable: TanstackTable<TData>;\n\tclassName?: string;\n\tonPrefetchPage?: (page: number) => void;\n}\n\nexport function DataTablePagination<TData>({\n\ttable,\n\tclassName,\n\tonPrefetchPage,\n}: DataTablePaginationProps<TData>) {\n\tconst totalPages = table.getPageCount();\n\tconst currentPage = Math.min(\n\t\tMath.ceil(table.getState().pagination.pageIndex + 1),\n\t\ttotalPages,\n\t);\n\n\tconst handlePrefetchFirstPage = () => {\n\t\tif (currentPage > 1) onPrefetchPage?.(1);\n\t};\n\tconst handlePrefetchPreviousPage = () => {\n\t\tif (currentPage > 1) onPrefetchPage?.(currentPage - 1);\n\t};\n\tconst handlePrefetchNextPage = () => {\n\t\tif (currentPage < totalPages) onPrefetchPage?.(currentPage + 1);\n\t};\n\tconst handlePrefetchLastPage = () => {\n\t\tif (currentPage < totalPages) onPrefetchPage?.(totalPages);\n\t};\n\n\treturn (\n\t\t<Pagination className={cn(\"justify-end\", className)}>\n\t\t\t<PaginationContent>\n\t\t\t\t<PaginationItem>\n\t\t\t\t\t<PaginationFirstButton\n\t\t\t\t\t\tonClick={() => table.firstPage()}\n\t\t\t\t\t\tonMouseEnter={handlePrefetchFirstPage}\n\t\t\t\t\t\tdisabled={!table.getCanPreviousPage()}\n\t\t\t\t\t/>\n\t\t\t\t\t<PaginationPreviousButton\n\t\t\t\t\t\tonClick={() => table.previousPage()}\n\t\t\t\t\t\tonMouseEnter={handlePrefetchPreviousPage}\n\t\t\t\t\t\tdisabled={!table.getCanPreviousPage()}\n\t\t\t\t\t/>\n\t\t\t\t</PaginationItem>\n\t\t\t\t<PaginationItem className=\"text-sm\">\n\t\t\t\t\tPage {currentPage} of {totalPages}\n\t\t\t\t</PaginationItem>\n\t\t\t\t<PaginationItem>\n\t\t\t\t\t<PaginationNextButton\n\t\t\t\t\t\tonClick={() => table.nextPage()}\n\t\t\t\t\t\tonMouseEnter={handlePrefetchNextPage}\n\t\t\t\t\t\tdisabled={!table.getCanNextPage()}\n\t\t\t\t\t/>\n\t\t\t\t</PaginationItem>\n\t\t\t\t<PaginationItem>\n\t\t\t\t\t<PaginationLastButton\n\t\t\t\t\t\tonClick={() => table.lastPage()}\n\t\t\t\t\t\tonMouseEnter={handlePrefetchLastPage}\n\t\t\t\t\t\tdisabled={!table.getCanNextPage()}\n\t\t\t\t\t/>\n\t\t\t\t</PaginationItem>\n\t\t\t</PaginationContent>\n\t\t</Pagination>\n\t);\n}\n"],"names":["DataTable","table","onPrefetchPage","jsxs","jsx","Table","TableHeader","headerGroup","TableRow","header","TableHead","flexRender","TableBody","row","cell","TableCell","DataTablePageSize","DataTablePagination","Select","value","SelectTrigger","SelectValue","SelectContent","SelectItem","className","totalPages","currentPage","handlePrefetchFirstPage","handlePrefetchPreviousPage","handlePrefetchNextPage","handlePrefetchLastPage","Pagination","cn","PaginationContent","PaginationItem","PaginationFirstButton","PaginationPreviousButton","PaginationNextButton","PaginationLastButton"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import{r as g,j as e}from"./vendor-tanstack-BcZfOOfy.js";import{cg as x,ch as u,ci as C,cj as m,ck as A,i as f,p as v,cl as b,cm as k,cn as y}from"./index-m48E4KcG.js";const I=({isOpen:i,title:r,description:o,onConfirm:c,onClose:d,confirmText:l,isLoading:a=!1,loadingText:h="Deleting..."})=>{const[t,s]=g.useState(""),n=()=>{s(""),d()},j=()=>{c(),s("")},p=a||!!l&&t!==l;return e.jsx(x,{open:i,onOpenChange:n,children:e.jsxs(u,{children:[e.jsxs(C,{children:[e.jsx(m,{children:r}),e.jsx(A,{children:o})]}),l&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs(f,{htmlFor:"confirm-text",children:["Type ",e.jsx("strong",{children:l})," to confirm:"]}),e.jsx(v,{id:"confirm-text",value:t,onChange:D=>s(D.target.value),placeholder:l})]}),e.jsxs(b,{children:[e.jsx(k,{onClick:n,children:"Cancel"}),e.jsx(y,{variant:"destructive",onClick:j,disabled:p,children:a?h:"Delete"})]})]})})};export{I as D};
2
- //# sourceMappingURL=delete-confirmation-dialog-DHkm2p8m.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,L as C,t as B,r as c,F as q,C as Oe,G as $e,D as Be,B as Qe,s as de}from"./vendor-tanstack-BcZfOOfy.js";import{O as ue,q as j,I,y as F,B as We,g as He,h as ae,bs as Ge,bB as Je,bD as Xe,al as k,L as re,aN as qe,ab as he,aE as Ke,cO as Ye,ct as J,N as Ze,aw as me,ax as xe,az as L,ay as P,X as es,aW as pe,p as je,cP as ge,cQ as K,G as U,a3 as Y,bh as Z,_ as fe,$ as ve,a0 as Se,a1 as Ce,S as ss,a as ns,b as ts,c as as,e as rs,cR as os,cS as ls,aM as is,cT as cs,cU as ds,ar as us,cV as hs,bU as De,bR as we,bS as ye,bT as be,C as ms,cW as xs,cX as ps,b5 as js,cr as gs,cY as fs,aL as oe,aA as le}from"./index-m48E4KcG.js";import{D as _e}from"./delete-confirmation-dialog-DHkm2p8m.js";import{D as ee,a as se,b as ne,c as Ne,d as E,f as vs}from"./dropdown-menu-0atiOSFo.js";import{L as Ss}from"./lazy-markdown-Du2Xu3Yp.js";import{D as Cs,W as Ds}from"./work-pool-filter-C2tpSS-w.js";import{S as ws}from"./sort-filter-DpuWNkQo.js";import{S as ys,a as Te,F as Re}from"./flow-runs-pagination-BATUweRV.js";import{u as Ee,F as Fe}from"./use-flow-runs-selected-rows-DmQSWBTu.js";import{D as bs}from"./data-table-rlbkLcrY.js";import{D as _s}from"./deployment-links-6iugOgDh.js";import{S as Ns}from"./index-CKGj5lSu.js";import{a as ke}from"./zod-Cuos7J7w.js";import{a0 as Ts,$ as Rs}from"./vendor-date-wwuDAncJ.js";import{c as Me,o as b,b as X,s as A,d as Es,e as V,n as z,f as Fs,a as ie}from"./vendor-forms-ClCIacbh.js";import{c as ks}from"./vendor-recharts-BAN776s_.js";import{c as Ie}from"./cronstrue-Bevg0uGw.js";import{F as Le,a as f,b as _,c as N,d as T,e as R}from"./form-DLrbC7rV.js";import{T as Pe}from"./timezone-select-BuPYznge.js";import{ao as Ms}from"./vendor-radix-BTiKGWfR.js";import{u as Is}from"./use-delete-confirmation-dialog-CUdii6Lo.js";import{u as Ls,a as Ps}from"./use-quick-run-CPempwLh.js";import"./vendor-react-Bce9NwRC.js";import"./table-bBL6C0ZK.js";import"./work-queue-icon-text-D4BWBVDN.js";const Ve=({search:s,sort:n,stateFilter:r,deploymentFilter:a,workPoolFilter:t})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 pr-2 border-r-2",children:[e.jsx("div",{className:"min-w-56",children:e.jsx(ue,{"aria-label":"search by run name",placeholder:"Search by run name",value:s.value,onChange:i=>s.onChange(i.target.value)})}),e.jsx("div",{className:"min-w-56",children:e.jsx(ys,{selectedFilters:r.value,onSelectFilter:r.onSelect})}),a&&e.jsx("div",{className:"min-w-56",children:e.jsx(Cs,{selectedDeployments:a.value,onSelectDeployments:a.onSelect})}),t&&e.jsx("div",{className:"min-w-56",children:e.jsx(Ds,{selectedWorkPools:t.value,onSelectWorkPools:t.onSelect})})]}),e.jsx(ws,{value:n.value,onSelect:n.onSelect})]}),Vs=({id:s,onDelete:n})=>{const r=a=>{navigator.clipboard.writeText(a),F.success("ID copied")};return e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(j,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(I,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(ne,{align:"end",children:[e.jsx(Ne,{children:"Actions"}),e.jsx(E,{onClick:()=>r(s),children:"Copy ID"}),e.jsx(C,{to:"/deployments/deployment/$id/edit",params:{id:s},children:e.jsx(E,{children:"Edit"})}),e.jsx(E,{onClick:n,children:"Delete"}),e.jsx(C,{to:"/deployments/deployment/$id/duplicate",params:{id:s},children:e.jsx(E,{children:"Duplicate"})})]})]})},As=({deployment:s})=>e.jsx(We,{children:e.jsxs(He,{children:[e.jsx(ae,{children:e.jsx(Ge,{to:"/deployments",className:"text-xl font-semibold",children:"Deployments"})}),e.jsx(Je,{}),e.jsx(ae,{className:"text-xl font-semibold",children:e.jsx(Xe,{children:s.name})})]})}),zs=({deployment:s})=>{const n=JSON.stringify(s.job_variables??{},null,2),r=JSON.stringify(s.pull_steps??[],null,2);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(k,{variant:"h4",children:"Job Variables"}),e.jsx(re,{copy:!0,disabled:!0,hideLineNumbers:!0,value:n}),e.jsx(k,{variant:"h4",children:"Pull Steps "}),e.jsx(re,{copy:!0,disabled:!0,hideLineNumbers:!0,value:r})]})},Us=({deployment:s})=>e.jsx("div",{className:"prose max-w-none",children:e.jsx(Ss,{children:s.description??""})}),Os=s=>{const{data:n,error:r}=B(qe(s)),a=c.useMemo(()=>n?n.map(o=>o.flow_id):[],[n]),{data:t,error:i}=B(he({flows:{id:{any_:a},operator:"and_"},offset:0,sort:"CREATED_DESC"},{enabled:a.length>0})),d=c.useMemo(()=>t?new Map(t.map(o=>[o.id,o])):new Map,[t]);return n&&n.length===0?{status:"success",error:null,data:[]}:n&&d.size>0?{status:"success",error:null,data:n.map(o=>{const u=d.get(o.flow_id);return{...o,flow:u}})}:r||i?{status:"error",error:r||i,data:void 0}:{status:"pending",error:null,data:void 0}},Ae=s=>{const{data:n,error:r}=B(Ke(s)),a=c.useMemo(()=>n?n.results.map(o=>o.flow_id):[],[n]),{data:t,error:i}=B(he({flows:{id:{any_:a},operator:"and_"},offset:0,sort:"CREATED_DESC"},{enabled:a.length>0})),d=c.useMemo(()=>t?new Map(t.map(o=>[o.id,o])):new Map,[t]);return n&&n.results.length===0?{status:"success",error:null,data:{...n,results:[]}}:n&&d.size>0?{status:"success",error:null,data:{...n,results:n.results.map(o=>{const u=d.get(o.flow_id);return{...o,flow:u}})}}:r||i?{status:"error",error:r||i,data:void 0}:{status:"pending",error:null,data:void 0}},D=q("/deployments/deployment/$id"),$s=({deployment:s})=>{const[n,r,{clearSet:a,onSelectRow:t}]=Ee(),[i,d]=Ws(),[o,u]=Hs(),[l,m]=Gs(),[h,x]=Js(),y=Qs(),{data:g}=Ae({deployments:{operator:"and_",id:{any_:[s.id]}},flow_runs:{name:{like_:o||void 0},state:{name:{any_:h.length===0?void 0:h},operator:"or_"},operator:"and_"},limit:i.limit,page:i.page,sort:l}),p=c.useMemo(()=>{if(g)return{...g,results:g.results.map(Ue=>({...Ue,deployment:s}))}},[g,s]),Q=y?()=>{y(),a()}:void 0,O=Bs(s);return e.jsxs("div",{className:"flex flex-col gap-2",children:[O&&e.jsxs("div",{className:"flex flex-col gap-2 border-b py-2",children:[e.jsx(k,{variant:"bodyLarge",children:"Next Run"}),e.jsx(Ye,{flowRun:O})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Fe,{count:p?.count,results:p?.results,selectedRows:n,setSelectedRows:r}),e.jsx(Ve,{search:{value:o,onChange:u},sort:{value:l,onSelect:m},stateFilter:{value:new Set(h),onSelect:x}})]}),e.jsx(Te,{flowRuns:p?.results,selectedRows:n,onSelect:t,onClearFilters:Q}),p&&e.jsx(Re,{count:p.count,pagination:i,onChangePagination:d,pages:p.pages})]})]})};function Bs(s){const{data:n}=Os({deployments:{id:{any_:[s.id]},operator:"and_"},flow_runs:{state:{name:{any_:["Scheduled"]},operator:"and_"},operator:"and_"},sort:"EXPECTED_START_TIME_ASC",limit:1,offset:0});return c.useMemo(()=>{if(!(!n||!n[0]))return{...n[0],deployment:s}},[n,s])}function Qs(){const{runs:s}=D.useSearch(),n=D.useNavigate(),r=c.useCallback(()=>{n({to:".",search:t=>({...t,runs:void 0}),replace:!0})},[n]);return c.useMemo(()=>!!s,[s])?r:void 0}function Ws(){const{runs:s}=D.useSearch(),n=D.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,runs:{...s,...t}}),replace:!0})},[n,s]);return[c.useMemo(()=>({page:s?.page??1,limit:s?.limit??10}),[s?.limit,s?.page]),r]}function Hs(){const{runs:s}=D.useSearch(),n=D.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,runs:{...s,flowRuns:{...s?.flowRuns,name:t}}}),replace:!0})},[n,s]);return[c.useMemo(()=>s?.flowRuns?.name??"",[s?.flowRuns?.name]),r]}function Gs(){const{runs:s}=D.useSearch(),n=D.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,runs:{...s,sort:t}}),replace:!0})},[n,s]);return[c.useMemo(()=>s?.sort??"START_TIME_DESC",[s?.sort]),r]}function Js(){const{runs:s}=D.useSearch(),n=D.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,runs:{...s,flowRuns:{...s?.flowRuns,state:t?Array.from(t):void 0}}}),replace:!0})},[n,s]);return[c.useMemo(()=>s?.flowRuns?.state??J,[s?.flowRuns?.state]),r]}const w=q("/deployments/deployment/$id"),Xs=({deployment:s})=>{const[n,r,{clearSet:a,onSelectRow:t}]=Ee(),[i,d]=Ks(),[o,u]=Ys(),[l,m]=Zs(),[h,x]=en(),y=qs(),{data:g}=Ae({deployments:{operator:"and_",id:{any_:[s.id]}},flow_runs:{name:{like_:o||void 0},state:{name:{any_:h.length===0?void 0:h},operator:"or_"},operator:"and_"},limit:i.limit,page:i.page,sort:l}),p=c.useMemo(()=>{if(g)return{...g,results:g.results.map(O=>({...O,deployment:s}))}},[g,s]),Q=y?()=>{y(),a()}:void 0;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Fe,{count:p?.count,results:p?.results,selectedRows:n,setSelectedRows:r}),e.jsx(Ve,{search:{value:o,onChange:u},sort:{value:l,onSelect:m},stateFilter:{value:new Set(h),onSelect:x}})]}),e.jsx(Te,{flowRuns:p?.results,selectedRows:n,onSelect:t,onClearFilters:Q}),p&&p.results.length>0&&e.jsx(Re,{count:p.count,pagination:i,onChangePagination:d,pages:p.pages})]})};function qs(){const{upcoming:s}=w.useSearch(),n=w.useNavigate(),r=c.useCallback(()=>{n({to:".",search:t=>({...t,upcoming:void 0}),replace:!0})},[n]);return c.useMemo(()=>!!s,[s])?r:void 0}function Ks(){const{upcoming:s}=w.useSearch(),n=w.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,upcoming:{...s,...t}}),replace:!0})},[n,s]);return[c.useMemo(()=>({page:s?.page??1,limit:s?.limit??5}),[s?.limit,s?.page]),r]}function Ys(){const{upcoming:s}=w.useSearch(),n=w.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,upcoming:{...s,flowRuns:{...s?.flowRuns,name:t}}}),replace:!0})},[n,s]);return[c.useMemo(()=>s?.flowRuns?.name??"",[s?.flowRuns?.name]),r]}function Zs(){const{upcoming:s}=w.useSearch(),n=w.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,upcoming:{...s,sort:t}}),replace:!0})},[n,s]);return[c.useMemo(()=>s?.sort??"START_TIME_ASC",[s?.sort]),r]}function en(){const{upcoming:s}=w.useSearch(),n=w.useNavigate(),r=c.useCallback(t=>{n({to:".",search:i=>({...i,upcoming:{...s,flowRuns:{...s?.flowRuns,state:t?Array.from(t):void 0}}}),replace:!0})},[n,s]);return[c.useMemo(()=>s?.flowRuns?.state??["Scheduled"],[s?.flowRuns?.state]),r]}const $=Qe(),sn=[$.accessor("key",{header:"Key"}),$.accessor("value",{header:"Override"}),$.accessor("defaultValue",{header:"Default"}),$.accessor("type",{header:"Type"})],nn=s=>c.useMemo(()=>{if(!s.parameter_openapi_schema)return[];const n=s.parameter_openapi_schema.properties,r=s.parameters;return Object.keys(n).sort((a,t)=>n[a].position-n[t].position).map(a=>{const t=n[a];return{key:a,value:r[a],defaultValue:t.default,type:t.type}})},[s]),tn=({deployment:s})=>{const[n,r]=c.useState(""),a=nn(s),t=c.useDeferredValue(n),i=c.useMemo(()=>a.filter(o=>o.key.toLowerCase().includes(t.toLowerCase())||o.value?.toString().toLowerCase().includes(t.toLowerCase())||o.defaultValue?.toString().toLowerCase().includes(t.toLowerCase())||o.type?.toString().toLowerCase().includes(t.toLowerCase())),[a,t]),d=Oe({data:i,columns:sn,getCoreRowModel:Be(),defaultColumn:{maxSize:300},getPaginationRowModel:$e()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(k,{variant:"bodySmall",className:"text-muted-foreground",children:[i.length," ",Ze(i.length,"parameter")]}),e.jsx("div",{className:"sm:col-span-2 md:col-span-2 lg:col-span-3",children:e.jsx(ue,{className:"sm:col-span-2 md:col-span-2 lg:col-span-3",placeholder:"Search parameters",value:n,onChange:o=>r(o.target.value)})})]}),e.jsx(bs,{table:d})]})},an=q("/deployments/deployment/$id"),rn=({deployment:s})=>{const{tab:n}=an.useSearch(),r=on(s);return e.jsxs(me,{defaultValue:r[0].value,value:n,children:[e.jsx(xe,{children:r.map(({value:a,LinkComponent:t})=>e.jsx(t,{},a))}),r.map(({value:a,ViewComponent:t})=>e.jsx(t,{},a))]})};function on(s){return c.useMemo(()=>[{value:"Runs",LinkComponent:()=>e.jsx(C,{to:".",search:{tab:"Runs"},children:e.jsx(P,{value:"Runs",children:"Runs"})}),ViewComponent:()=>e.jsx(L,{value:"Runs",children:e.jsx($s,{deployment:s})})},{value:"Upcoming",LinkComponent:()=>e.jsx(C,{to:".",search:{tab:"Upcoming"},children:e.jsx(P,{value:"Upcoming",children:"Upcoming"})}),ViewComponent:()=>e.jsx(L,{value:"Upcoming",children:e.jsx(Xs,{deployment:s})})},{value:"Parameters",LinkComponent:()=>e.jsx(C,{to:".",search:{tab:"Parameters"},children:e.jsx(P,{value:"Parameters",children:"Parameters"})}),ViewComponent:()=>e.jsx(L,{value:"Parameters",children:e.jsx(tn,{deployment:s})})},{value:"Configuration",LinkComponent:()=>e.jsx(C,{to:".",search:{tab:"Configuration"},children:e.jsx(P,{value:"Configuration",children:"Configuration"})}),ViewComponent:()=>e.jsx(L,{value:"Configuration",children:e.jsx(zs,{deployment:s})})},{value:"Description",LinkComponent:()=>e.jsx(C,{to:".",search:{tab:"Description"},children:e.jsx(P,{value:"Description",children:"Description"})}),ViewComponent:()=>e.jsx(L,{value:"Description",children:e.jsx(Us,{deployment:s})})}],[s])}const v=()=>e.jsx("dd",{className:"text-muted-foreground text-sm",children:"None"}),ce=({children:s})=>e.jsx("dt",{className:"text-sm text-muted-foreground",children:s}),S=({className:s,children:n})=>e.jsx("dd",{className:pe("text-sm",s),children:n}),ln=({deployment:s})=>{const n=[{field:"Status",ComponentValue:()=>s.status?e.jsx("dd",{children:e.jsx(Ns,{status:s.status})}):e.jsx(v,{})},{field:"Created",ComponentValue:()=>s.created?e.jsx(S,{className:"font-mono",children:s.created}):e.jsx(v,{})},{field:"Updated",ComponentValue:()=>s.updated?e.jsx(S,{className:"font-mono",children:s.updated}):e.jsx(v,{})},{field:"Entrypoint",ComponentValue:()=>s.entrypoint?e.jsx(S,{children:s.entrypoint}):e.jsx(v,{})},{field:"Path",ComponentValue:()=>s.path?e.jsx(S,{children:s.path}):e.jsx(v,{})},{field:"Concurrency Limit",ComponentValue:()=>s.global_concurrency_limit?e.jsx(S,{children:s.global_concurrency_limit.limit}):e.jsx(v,{})}],r=[{field:"Flow ID",ComponentValue:()=>e.jsx(S,{children:s.flow_id})},{field:"Deployment ID",ComponentValue:()=>e.jsx(S,{children:s.id})},{field:"Deployment Version",ComponentValue:()=>s.version?e.jsx(S,{children:s.version}):e.jsx(v,{})},{field:"Storage Document ID",ComponentValue:()=>s.storage_document_id?e.jsx(S,{children:s.storage_document_id}):e.jsx(v,{})},{field:"Infrastructure Document ID",ComponentValue:()=>s.infrastructure_document_id?e.jsx(S,{children:s.infrastructure_document_id}):e.jsx(v,{})},{field:"Tags",ComponentValue:()=>s.tags&&s.tags.length>0?e.jsx("dd",{children:e.jsx(es,{tags:s.tags,maxTagsDisplayed:4})}):e.jsx(v,{})}];return e.jsxs("div",{children:[e.jsx("ul",{className:"flex flex-col gap-3",children:n.map(({field:a,ComponentValue:t})=>e.jsx("li",{children:e.jsxs("dl",{children:[e.jsx(ce,{children:a}),e.jsx(t,{})]})},a))}),e.jsx("hr",{className:"my-3"}),e.jsx("ul",{className:"flex flex-col gap-3",children:r.map(({field:a,ComponentValue:t})=>e.jsx("li",{children:e.jsxs("dl",{children:[e.jsx(ce,{children:a}),e.jsx(t,{})]})},a))})]})};var ze=Ts();const W=s=>{let n="",r=!1;try{ze.CronExpressionParser.parse(s),n=Ie.toString(s),r=!0}catch{r=!1,n="Invalid expression"}return{description:n,isCronValid:r}},cn=({onChange:s,...n})=>{const[r,a]=c.useState(W(String(n.value)).description),[t,i]=c.useState(W(String(n.value)).isCronValid),d=o=>{if(s){s(o);const{description:u,isCronValid:l}=W(o.target.value);a(u),i(l)}};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(je,{...n,onChange:d}),e.jsx(k,{variant:"bodySmall",className:ks(t?"text-muted-foreground":"text-red-500"),children:r})]})},dn=s=>{try{return ze.CronExpressionParser.parse(s),!0}catch{return!1}},un=b({active:X(),schedule:b({cron:A().refine(dn),timezone:A().default("Etc/UTC"),day_or:X().default(!0)})}),H={active:!0,schedule:{cron:"* * * * *",timezone:"Etc/UTC",day_or:!0}},hn=({deployment_id:s,scheduleToEdit:n,onSubmit:r})=>{const{createDeploymentSchedule:a,isPending:t}=ge(),{updateDeploymentSchedule:i,isPending:d}=K(),o=Me({resolver:ke(un),defaultValues:H});c.useEffect(()=>{if(n){const{active:l,schedule:m}=n;if("cron"in m){const{cron:h,day_or:x,timezone:y}=m;o.reset({active:l,schedule:{cron:h,day_or:x,timezone:y??"Etc/UTC"}})}}else o.reset(H)},[o,n]);const u=l=>{const m=()=>{o.reset(H),r()};n?i({deployment_id:s,schedule_id:n.id,...l},{onSuccess:()=>{F.success("Deployment schedule updated")},onError:h=>{const x=h.message||"Unknown error while updating deployment schedule.";o.setError("root",{message:x})},onSettled:m}):a({deployment_id:s,...l},{onSuccess:()=>{F.success("Deployment schedule created")},onError:h=>{const x=h.message||"Unknown error while creating deployment schedule.";o.setError("root",{message:x})},onSettled:m})};return e.jsx(Le,{...o,children:e.jsxs("form",{onSubmit:l=>{o.handleSubmit(u)(l)},className:"space-y-4",children:[e.jsx(f,{children:o.formState.errors.root?.message}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(_,{control:o.control,name:"active",render:({field:l})=>e.jsxs(N,{children:[e.jsx(T,{children:"Active"}),e.jsx(R,{children:e.jsx(U,{className:"block",checked:l.value,onCheckedChange:l.onChange})}),e.jsx(f,{})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"w-3/4",children:e.jsx(_,{control:o.control,name:"schedule.cron",render:({field:l})=>e.jsxs(N,{children:[e.jsx(T,{children:"Value"}),e.jsx(R,{children:e.jsx(cn,{...l})}),e.jsx(f,{})]})})}),e.jsx(_,{control:o.control,name:"schedule.day_or",render:({field:l})=>e.jsxs(N,{children:[e.jsxs(T,{"aria-label":"Day Or",children:["Day Or ",e.jsx(mn,{})]}),e.jsx(R,{children:e.jsx(U,{className:"block",checked:l.value,onCheckedChange:l.onChange})}),e.jsx(f,{})]})})]}),e.jsx(_,{control:o.control,name:"schedule.timezone",render:({field:l})=>e.jsxs(N,{children:[e.jsx(T,{children:"Timezone"}),e.jsx(R,{children:e.jsx(Pe,{selectedValue:l.value,onSelect:l.onChange})}),e.jsx(f,{})]})})]}),e.jsxs(Y,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(j,{variant:"outline",children:"Close"})}),e.jsx(j,{type:"submit",loading:t||d,children:"Save"})]})]})})},mn=()=>e.jsxs(fe,{children:[e.jsx(Z,{asChild:!0,children:e.jsx("button",{type:"button",className:"cursor-help",children:e.jsx(I,{id:"Info",className:"size-4 inline"})})}),e.jsxs(ve,{"aria-describedby":void 0,children:[e.jsx(Se,{children:e.jsx(Ce,{children:"Day Or"})}),e.jsx(k,{children:'When the "Day Or" value is off, this schedule will connect day of the month and day of the week entries using OR logic; when on it will connect them using AND logic.'})]})]}),xn=[{label:"Seconds",value:"seconds"},{label:"Minutes",value:"minutes"},{label:"Hours",value:"hours"},{label:"Days",value:"days"}],M={seconds:1,minutes:60,hours:3600,days:24*3600},pn=s=>{let n=s;const r=Math.floor(s/M.days);if(n%=M.days,n===0)return{interval_value:r,interval_time:"days"};const a=Math.floor(s/M.hours);if(n%=M.hours,n===0)return{interval_value:a,interval_time:"hours"};const t=Math.floor(s/M.minutes);return n%=M.minutes,n===0?{interval_value:t,interval_time:"minutes"}:{interval_value:n,interval_time:"seconds"}},jn=b({active:X(),schedule:b({interval_value:z().or(A()).pipe(Fs.number()),interval_time:V(["seconds","minutes","hours","days"]),anchor_date:Es(),timezone:A().default("Etc/UTC")})}),G={active:!0,schedule:{interval_value:60,interval_time:"minutes",anchor_date:new Date,timezone:"Etc/UTC"}},gn=({deployment_id:s,scheduleToEdit:n,onSubmit:r})=>{const{createDeploymentSchedule:a,isPending:t}=ge(),{updateDeploymentSchedule:i,isPending:d}=K(),o=Me({resolver:ke(jn),defaultValues:G});c.useEffect(()=>{if(n){const{active:l,schedule:m}=n;if("interval"in m){const{interval:h,anchor_date:x,timezone:y}=m,{interval_value:g,interval_time:p}=pn(h);o.reset({active:l,schedule:{interval_value:g,interval_time:p,anchor_date:x?new Date(x):new Date,timezone:y??"Etc/UTC"}})}}else o.reset(G)},[o,n]);const u=l=>{const m=()=>{o.reset(G),r()};n?i({deployment_id:s,schedule_id:n.id,active:l.active,schedule:{interval:l.schedule.interval_value*M[l.schedule.interval_time],anchor_date:l.schedule.anchor_date.toISOString(),timezone:l.schedule.timezone}},{onSuccess:()=>{F.success("Deployment schedule updated")},onError:h=>{const x=h.message||"Unknown error while updating deployment schedule.";o.setError("root",{message:x})},onSettled:m}):a({deployment_id:s,active:l.active,schedule:{interval:l.schedule.interval_value*M[l.schedule.interval_time],anchor_date:l.schedule.anchor_date.toISOString(),timezone:l.schedule.timezone}},{onSuccess:()=>{F.success("Deployment schedule created")},onError:h=>{const x=h.message||"Unknown error while creating deployment schedule.";o.setError("root",{message:x})},onSettled:m})};return e.jsx(Le,{...o,children:e.jsxs("form",{onSubmit:l=>{o.handleSubmit(u)(l)},className:"space-y-4",children:[e.jsx(f,{children:o.formState.errors.root?.message}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(_,{control:o.control,name:"active",render:({field:l})=>e.jsxs(N,{children:[e.jsx(T,{children:"Active"}),e.jsx(R,{children:e.jsx(U,{className:"block",checked:l.value,onCheckedChange:l.onChange})}),e.jsx(f,{})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"w-3/4",children:e.jsx(_,{control:o.control,name:"schedule.interval_value",render:({field:l})=>e.jsxs(N,{children:[e.jsx(T,{children:"Value"}),e.jsx(R,{children:e.jsx(je,{...l})}),e.jsx(f,{})]})})}),e.jsx(_,{control:o.control,name:"schedule.interval_time",render:({field:l})=>e.jsxs(N,{children:[e.jsx(T,{children:"Interval"}),e.jsxs(ss,{onValueChange:l.onChange,defaultValue:l.value,value:l.value,children:[e.jsx(R,{children:e.jsx(ns,{children:e.jsx(ts,{placeholder:"Select interval"})})}),e.jsx(as,{children:xn.map(({label:m,value:h})=>e.jsx(rs,{value:h,children:m},h))})]}),e.jsx(f,{})]})})]}),e.jsx(_,{control:o.control,name:"schedule.anchor_date",render:({field:l})=>e.jsxs(N,{className:"flex flex-col",children:[e.jsx(T,{children:"Anchor date"}),e.jsxs(os,{children:[e.jsx(ls,{asChild:!0,children:e.jsx(R,{children:e.jsxs(j,{variant:"outline",className:pe("w-full",!l.value&&"text-muted-foreground"),children:[is(l.value,"dateTime"),e.jsx(I,{id:"Calendar",className:"ml-auto size-4 opacity-50"})]})})}),e.jsx(cs,{className:"w-auto p-0",align:"start",children:e.jsx(ds,{mode:"single",selected:l.value,onSelect:l.onChange})})]}),e.jsx(f,{})]})}),e.jsx(_,{control:o.control,name:"schedule.timezone",render:({field:l})=>e.jsxs(N,{children:[e.jsx(T,{children:"Timezone"}),e.jsx(R,{children:e.jsx(Pe,{selectedValue:l.value,onSelect:l.onChange})}),e.jsx(f,{})]})})]}),e.jsxs(Y,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(j,{variant:"outline",children:"Close"})}),e.jsx(j,{type:"submit",loading:t||d,children:"Save"})]})]})})},fn=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(k,{children:"Sorry, modifying RRule schedules via the UI is currently unsupported; select a different schedule type above or modify your schedule in code."}),e.jsxs(Y,{children:[e.jsx(Ms,{asChild:!0,children:e.jsx(j,{variant:"outline",children:"Close"})}),e.jsx(j,{disabled:!0,children:"Save"})]})]}),vn=({deploymentId:s,onOpenChange:n,open:r,scheduleToEdit:a,onSubmit:t})=>{const[i,d]=c.useState("interval");c.useEffect(()=>{if(!a)return;const{schedule:u}=a;"interval"in u?d("interval"):"cron"in u?d("cron"):d("rrule")},[a]);const o=[{value:"interval",label:"Interval",Component:()=>e.jsx(gn,{deployment_id:s,onSubmit:t,scheduleToEdit:a})},{value:"cron",label:"Cron",Component:()=>e.jsx(hn,{deployment_id:s,onSubmit:t,scheduleToEdit:a})},{value:"rrule",label:"RRule",Component:()=>e.jsx(fn,{})}];return e.jsx(fe,{open:r,onOpenChange:n,children:e.jsxs(ve,{"aria-describedby":void 0,children:[e.jsx(Se,{children:e.jsxs(Ce,{children:[a?"Edit":"Add"," Schedule"]})}),e.jsxs(me,{defaultValue:o[0].value,value:i,children:[e.jsx(xe,{children:o.map(({value:u,label:l})=>e.jsx(P,{value:u,onClick:()=>d(u),children:l},u))}),o.map(({value:u,Component:l})=>e.jsx(L,{value:u,children:e.jsx(l,{})},u))]})]})})},te=s=>{const{schedule:n}=s;return"interval"in n?`Every ${us(n.interval*1e3)}`:"cron"in n?Ie.toString(n.cron):Rs(n.rrule).toText()},Sn=()=>{const[s,n]=Is(),{deleteDeploymentSchedule:r}=hs();return[s,t=>n({title:"Delete Schedule",description:`Are you sure you want to delete ${te(t)} schedule?`,onConfirm:()=>{const{id:i,deployment_id:d}=t;if(!d)throw new Error("'deployment_id' expected");r({deployment_id:d,schedule_id:i},{onSuccess:()=>F.success("Schedule deleted"),onError:o=>{const u=o.message||"Unknown error while deleting schedule.";console.error(u)}})}})]},Cn=({deploymentSchedule:s,onEditSchedule:n})=>{const[r,a]=Sn(),t=o=>{navigator.clipboard.writeText(o),F.success("ID copied")},i=()=>a(s),d=()=>n(s.id);return e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(j,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(I,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(ne,{align:"end",children:[e.jsx(Ne,{children:"Actions"}),e.jsx(E,{onClick:()=>t(s.id),children:"Copy ID"}),e.jsx(E,{onClick:d,children:"Edit"}),e.jsx(E,{onClick:i,children:"Delete"})]})]}),e.jsx(_e,{...r})]})},Dn=({deploymentSchedule:s,disabled:n})=>{const{updateDeploymentSchedule:r}=K(),a=t=>{const{id:i,deployment_id:d}=s;if(!d)throw new Error("'deployment_id' expected");r({schedule_id:i,deployment_id:d,active:t},{onSuccess:()=>F.success(`Deployment schedule ${t?"active":"paused"}`),onError:o=>{const u=o.message||"Unknown error while updating deployment schedule.";console.error(u)}})};return e.jsx(De,{children:e.jsxs(we,{children:[e.jsx(ye,{asChild:!0,children:e.jsx("div",{children:e.jsx(U,{"aria-label":`toggle ${te(s)}`,checked:s.active,onCheckedChange:a,disabled:n})})}),n&&e.jsx(be,{children:"Pause or resume this schedule"})]})})},wn=({deploymentSchedule:s,disabled:n,onEditSchedule:r})=>e.jsx(ms,{className:"p-3",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(k,{children:te(s)}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx(Dn,{deploymentSchedule:s,disabled:n}),e.jsx(Cn,{deploymentSchedule:s,onEditSchedule:r})]})]})}),yn=({deployment:s})=>{const{updateDeployment:n}=xs(),r=t=>{n({id:s.id,paused:!t},{onSuccess:()=>{F.success(`Deployment ${t?"active":"paused"}`)},onError:i=>{const d=i.message||"Unknown error while updating deployment";console.error(d)}})},a=s.entrypoint===""||s.entrypoint===null;return e.jsx(De,{children:e.jsxs(we,{children:[e.jsx(ye,{asChild:!0,children:e.jsx("div",{children:e.jsx(U,{"aria-label":"Pause or resume all schedules",disabled:a,onCheckedChange:r,checked:!s.paused})})}),e.jsx(be,{children:"Pause or resume all schedules"})]})})},bn=3,_n=({deployment:s,onAddSchedule:n,onEditSchedule:r})=>{const a=c.useMemo(()=>s.schedules?s.schedules.sort((t,i)=>t.created?i.created?Date.parse(t.created)-Date.parse(i.created):1:-1):[],[s.schedules]);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(k,{variant:"bodySmall",className:"text-muted-foreground",children:"Schedules"}),(a.length>bn||s.paused)&&e.jsx(yn,{deployment:s})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[a.map(t=>e.jsx(wn,{disabled:s.paused,deploymentSchedule:t,onEditSchedule:r},t.id)),e.jsx("div",{children:e.jsxs(j,{size:"sm",onClick:n,children:[e.jsx(I,{id:"Plus",className:"mr-2 size-4"})," Schedule"]})})]})]})},Nn=({deployment:s})=>e.jsx(c.Suspense,{fallback:e.jsx(En,{numSkeletons:2}),children:e.jsx(Tn,{deployment:s})}),Tn=({deployment:s})=>{const{data:n}=de(ps(`prefect.deployment.${s.id}`));return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Triggers"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Rn,{automations:n}),e.jsx(C,{to:"/automations/create",search:{actions:{type:"run-deployment",deploymentId:s.id,parameters:s.parameters}},children:e.jsxs(j,{size:"sm",children:[e.jsx(I,{id:"Plus",className:"mr-2 size-4"})," Add"]})})]})]})},Rn=({automations:s})=>e.jsx("ul",{className:"flex flex-col gap-1",children:s.map(n=>e.jsx("li",{children:e.jsxs(C,{to:"/automations/automation/$id",params:{id:n.id},className:"flex items-center text-xs",children:[e.jsx(I,{id:"Bot",className:"mr-1 size-4"}),e.jsx("div",{children:n.name})]})},n.id))}),En=({numSkeletons:s=1})=>e.jsx("ul",{className:"flex flex-col gap-1",children:Array.from({length:s}).map((n,r)=>e.jsx("li",{children:e.jsx(js,{className:"h-4 w-full"})},r))}),Fn=({deployment:s})=>{const{onQuickRun:n,isPending:r}=Ls();return e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(j,{loading:r,children:["Run ",e.jsx(I,{className:"ml-1 size-4",id:"Play"})]})}),e.jsx(ne,{children:e.jsxs(vs,{children:[e.jsx(E,{onClick:()=>n(s.id),children:"Quick run"}),e.jsx(C,{to:"/deployments/deployment/$id/run",params:{id:s.id},search:{parameters:s.parameters},children:e.jsx(E,{children:"Custom run"})})]})})]})},kn=({id:s})=>{const[n,r]=c.useState({open:!1,scheduleIdToEdit:""}),{data:a}=de(gs(s)),[t,i]=Ps(),d=c.useMemo(()=>{if(!(!a.schedules||!n.scheduleIdToEdit))return a.schedules.find(h=>h.id===n.scheduleIdToEdit)},[a.schedules,n.scheduleIdToEdit]),o=()=>r({open:!0,scheduleIdToEdit:""}),u=h=>r({open:!0,scheduleIdToEdit:h}),l=()=>r({open:!1,scheduleIdToEdit:""}),m=h=>{h||l()};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex align-middle justify-between",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(As,{deployment:a}),e.jsx(_s,{deployment:a})]}),e.jsxs("div",{className:"flex align-middle gap-2",children:[e.jsx(Fn,{deployment:a}),e.jsx(Vs,{id:s,onDelete:()=>i(a,{shouldNavigate:!0})})]})]}),e.jsxs("div",{className:"grid gap-4",style:{gridTemplateColumns:"5fr 1fr"},children:[e.jsx("div",{className:"flex flex-col gap-5",children:e.jsx(rn,{deployment:a})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(_n,{deployment:a,onAddSchedule:o,onEditSchedule:u}),e.jsx(Nn,{deployment:a}),e.jsx("hr",{}),e.jsx(ln,{deployment:a})]})]})]}),e.jsx(vn,{deploymentId:s,open:n.open,onOpenChange:m,scheduleToEdit:d,onSubmit:l}),e.jsx(_e,{...t})]})};b({tab:V(["Runs","Upcoming","Parameters","Configuration","Description"]).default("Runs"),runs:b({flowRuns:b({name:A().optional(),state:ie(V(le)).optional().default(J).catch(J)}).optional(),page:z().int().positive().optional().default(1).catch(1),limit:z().int().positive().optional().default(10).catch(10),sort:V(oe).optional().default("START_TIME_DESC").catch("START_TIME_DESC")}).optional(),upcoming:b({flowRuns:b({name:A().optional(),state:ie(V(le)).optional().default(["Scheduled"]).catch(["Scheduled"])}).optional(),page:z().int().positive().optional().default(1).catch(1),limit:z().int().positive().optional().default(5).catch(5),sort:V(oe).optional().default("START_TIME_ASC").catch("START_TIME_ASC")}).optional()});function at(){const{id:s}=fs.useParams();return e.jsx(kn,{id:s})}export{at as component};
2
- //# sourceMappingURL=deployment._id-Ci9zge5n.js.map
@@ -1,2 +0,0 @@
1
- import{s as m,j as o}from"./vendor-tanstack-BcZfOOfy.js";import{cr as r,dM as p}from"./index-m48E4KcG.js";import{D as i}from"./deployment-action-header-D5GOooPm.js";import{D as s}from"./deployment-form-wfg6HeAJ.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./vendor-date-wwuDAncJ.js";import"./schema-form-input-string-format-datetime-BSWlW_aQ.js";import"./zod-Cuos7J7w.js";import"./use-debounce-callback-CSs1BjLI.js";import"./toggle-group-Cn07UIim.js";import"./timezone-select-BuPYznge.js";import"./dropdown-menu-0atiOSFo.js";import"./form-DLrbC7rV.js";import"./tags-input-BLPMVWpZ.js";const n=({id:t})=>{const{data:e}=m(r(t));return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx(i,{deployment:e,action:"Duplicate"}),o.jsx(s,{deployment:e,mode:"duplicate"})]})};function A(){const{id:t}=p.useParams();return o.jsx(n,{id:t})}export{A as component};
2
- //# sourceMappingURL=deployment_._id.duplicate-D9ZWkh8H.js.map
@@ -1,2 +0,0 @@
1
- import{s as m,j as o}from"./vendor-tanstack-BcZfOOfy.js";import{cr as r,dJ as i}from"./index-m48E4KcG.js";import{D as p}from"./deployment-action-header-D5GOooPm.js";import{D as s}from"./deployment-form-wfg6HeAJ.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";import"./vendor-date-wwuDAncJ.js";import"./schema-form-input-string-format-datetime-BSWlW_aQ.js";import"./zod-Cuos7J7w.js";import"./use-debounce-callback-CSs1BjLI.js";import"./toggle-group-Cn07UIim.js";import"./timezone-select-BuPYznge.js";import"./dropdown-menu-0atiOSFo.js";import"./form-DLrbC7rV.js";import"./tags-input-BLPMVWpZ.js";const n=({id:t})=>{const{data:e}=m(r(t));return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx(p,{deployment:e,action:"Edit"}),o.jsx(s,{deployment:e,mode:"edit"})]})};function v(){const{id:t}=i.useParams();return o.jsx(n,{id:t})}export{v as component};
2
- //# sourceMappingURL=deployment_._id.edit-CS7sObzC.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,L as y,s as D}from"./vendor-tanstack-BcZfOOfy.js";import{q as E,I as o,y as R,H as C,B as w,g as T,h as x,bs as I,bB as L,bD as B,aw as M,ax as S,ay as p,az as h,bG as O,C as z,o as V,dC as i}from"./index-m48E4KcG.js";import"./automation-schema-BIBsyp0j.js";import"./form-DLrbC7rV.js";import"./radio-group-Co3cN0Kv.js";import{f as k}from"./event-to-trigger-BEzU9b5I.js";import{D as F,a as P,b as A,d as j}from"./dropdown-menu-0atiOSFo.js";import{f as J,J as _}from"./utilities-BRCNRcQl.js";import{E as G,p as H,a as Q,b as U,R as q}from"./event-resource-display-DHiAb1Up.js";import{f as Y}from"./vendor-date-wwuDAncJ.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-forms-ClCIacbh.js";function Z({event:s}){const t=()=>{navigator.clipboard.writeText(s.id),R.success("ID copied")};return e.jsxs(F,{children:[e.jsx(P,{asChild:!0,children:e.jsxs(E,{variant:"outline",className:"size-8 p-0","aria-label":"Event actions",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(o,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(A,{align:"end",children:[e.jsx(y,{to:"/automations/create",search:{eventId:s.id,eventDate:k(s.occurred)},children:e.jsxs(j,{children:[e.jsx(o,{id:"Zap",className:"mr-2 size-4"}),"Automate"]})}),e.jsxs(j,{onClick:t,children:[e.jsx(o,{id:"Copy",className:"mr-2 size-4"}),"Copy ID"]})]})]})}const d=({children:s})=>e.jsx("dt",{className:"text-sm font-medium",children:s}),f=({children:s})=>e.jsx("dd",{className:"text-sm",children:s});function g(s){return s["prefect.resource.role"]||null}function v(s){return s["prefect.resource.id"]||""}function K(s){return s["prefect.resource.name"]||s["prefect.name"]||s["prefect-cloud.name"]||null}function W({event:s}){const t=Y(new Date(s.occurred),"yyyy/MM/dd hh:mm:ss a"),n=(s.related??[]).filter(a=>g(a)!=="tag"),c=(s.related??[]).filter(a=>g(a)==="tag");return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("dl",{children:[e.jsx(d,{children:"Event"}),e.jsx(f,{children:s.event})]}),e.jsxs("dl",{children:[e.jsx(d,{children:"Occurred"}),e.jsx(f,{children:t})]}),e.jsx(G,{event:s}),(n.length>0||c.length>0)&&e.jsxs("dl",{children:[e.jsx(d,{children:"Related Resources"}),e.jsxs("dd",{className:"flex flex-col gap-2 text-sm",children:[n.map(a=>{const r=v(a),l=K(a),u=H(r),b=q[u],m=U[u],N=l||r.split(".").pop()||r;return e.jsxs(Q,{resource:a,relatedResources:s.related??[],className:"flex items-center gap-2 hover:underline",children:[m&&e.jsx("span",{children:m}),e.jsx(o,{id:b,className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:N})]},r)}),c.length>0&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{children:"Tags"}),c.map(a=>{const r=v(a),l=r.split(".").pop()||r;return e.jsx(C,{variant:"secondary",children:l},r)})]})]})]})]})}function X({event:s}){const t=J(s.event);return e.jsx(w,{children:e.jsxs(T,{children:[e.jsx(x,{children:e.jsx(I,{to:"/events",className:"text-xl font-semibold",children:"Event Feed"})}),e.jsx(L,{}),e.jsx(x,{className:"text-xl font-semibold",children:e.jsx(B,{children:t})})]})})}function $({event:s,defaultTab:t="details",onTabChange:n}){return e.jsxs(M,{defaultValue:t,onValueChange:n,children:[e.jsxs(S,{children:[e.jsx(p,{value:"details",children:"Details"}),e.jsx(p,{value:"raw",children:"Raw"})]}),e.jsx(h,{value:"details",className:"pt-4",children:e.jsx(W,{event:s})}),e.jsx(h,{value:"raw",className:"pt-4",children:e.jsx(_,{value:JSON.stringify(s,null,2),className:"max-h-[600px] overflow-auto"})})]})}function ee({eventId:s,eventDate:t,defaultTab:n,onTabChange:c}){const{data:a}=D(O(s,t));return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(X,{event:a}),e.jsx(Z,{event:a})]}),e.jsx(z,{children:e.jsx(V,{children:e.jsx($,{event:a,defaultTab:n,onTabChange:c})})})]})}function se(s){const[t,n,c]=s.split("-").map(Number);return new Date(t,n-1,c)}function je(){const{eventDate:s,eventId:t}=i.useParams(),n=i.useSearch(),c=i.useNavigate(),a=se(s),r=l=>{c({to:".",search:{tab:l},replace:!0})};return e.jsx(ee,{eventId:t,eventDate:a,defaultTab:n.tab,onTabChange:r})}export{je as component};
2
- //# sourceMappingURL=event._eventDate._eventId-D7Twzb22.js.map
@@ -1,4 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/flow-run-graph-BhzuSJLm.js","assets/vendor-tanstack-BcZfOOfy.js","assets/vendor-react-Bce9NwRC.js","assets/vendor-graphs-_sWgqfe-.js","assets/index-m48E4KcG.js","assets/vendor-radix-BTiKGWfR.js","assets/vendor-recharts-BAN776s_.js","assets/vendor-forms-ClCIacbh.js","assets/vendor-date-wwuDAncJ.js","assets/index-COouj_0-.css","assets/state-colors-CAAf0Eg3.js","assets/key-value-DkSKn6jE.js","assets/event-resource-display-DHiAb1Up.js"])))=>i.map(i=>d[i]);
2
- import{j as e,r as n,s as $,t as D,L as G,I as Ge,n as J,g as Qe,d as Ve}from"./vendor-tanstack-BcZfOOfy.js";import{b5 as x,cc as qe,cd as $e,q as b,ce as Be,aW as K,bv as We,C as he,o as pe,c6 as He,bM as te,X as je,cf as B,aN as ge,cg as fe,ch as ye,ci as Ne,cj as ve,ck as _e,aq as C,ak as q,i as be,cl as Se,cm as Ce,cn as we,y,_ as X,$ as Y,a0 as Z,a1 as ee,a2 as se,p as Je,co as ke,a3 as ae,cp as De,cq as re,cr as Ke,aD as Fe,B as Xe,g as Ye,h as le,bs as Ze,bB as es,bD as ss,H as as,I as _,aM as ts,c5 as rs,bQ as ls,bR as ns,bS as is,bT as os,cs,c8 as ds,S as Te,a as Ee,c as Ae,e as H,b as us,bN as Le,aC as ms,aE as ne,ab as xs,al as U,O as Pe,ct as ie,cu as W,aF as oe,an as hs,cv as ps,cw as js,cx as gs,cy as fs,cz as ys,L as ce,aw as Ns,ax as vs,ay as L,az as P,cA as de}from"./index-m48E4KcG.js";import{R as _s,b as bs,C as Ss,a as Cs,u as ws}from"./use-state-favicon-M09DmrNy.js";import{A as ks}from"./artifact-card-BBzQR-Cj.js";import{T as Ds,a as ue}from"./toggle-group-Cn07UIim.js";import{K as S}from"./key-value-DkSKn6jE.js";import{u as Fs,L as Ts}from"./schema-form-input-string-format-datetime-BSWlW_aQ.js";import{L as Es}from"./lazy-markdown-Du2Xu3Yp.js";import{D as As}from"./delete-confirmation-dialog-DHkm2p8m.js";import{u as Ls}from"./use-delete-confirmation-dialog-CUdii6Lo.js";import{D as Ie,a as ze,b as Me,d as w,e as Ps}from"./dropdown-menu-0atiOSFo.js";import{S as Is}from"./sort-filter-DpuWNkQo.js";import{S as zs,a as Ms,F as Rs}from"./flow-runs-pagination-BATUweRV.js";import{T as Os,b as Us,a as Gs}from"./task-runs-pagination-VdR-LO4r.js";import{T as Qs}from"./tags-input-BLPMVWpZ.js";import{o as Vs,e as qs}from"./vendor-forms-ClCIacbh.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-date-wwuDAncJ.js";import"./index-BwCLKpNb.js";import"./zod-Cuos7J7w.js";import"./use-debounce-callback-CSs1BjLI.js";import"./timezone-select-BuPYznge.js";import"./form-DLrbC7rV.js";const $s=["RUNNING","SCHEDULED","PENDING","PAUSED"],Bs=["COMPLETED","FAILED","CANCELLED","CRASHED"];function Ws(s){return s!=null&&$s.includes(s)}function Hs(s){return s==="RUNNING"}function Js(s){return s==="PAUSED"}function Ks(s){return s!=null&&Bs.includes(s)}const Xs=n.lazy(()=>qe(()=>import("./flow-run-graph-BhzuSJLm.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(s=>({default:s.FlowRunGraph})));function Ys(s){return e.jsx(n.Suspense,{fallback:e.jsx(x,{className:"h-[500px] w-full"}),children:e.jsx(Xs,{...s})})}class Q extends n.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){if(this.state.hasError){const{fallback:t}=this.props;return typeof t=="function"?t(this.state.error??new Error("Unknown error")):t}return this.props.children}}function V({error:s,onRetry:t,isRetrying:a}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[e.jsx("div",{className:"rounded-full bg-destructive/10 p-2 mb-3",children:e.jsx($e,{className:"size-6 text-destructive"})}),e.jsxs("div",{className:"space-y-1 mb-4",children:[e.jsx("p",{className:"font-medium",children:s.message}),s.details&&e.jsx("p",{className:"text-xs text-muted-foreground max-w-sm",children:s.details})]}),t&&e.jsxs(b,{variant:"outline",size:"sm",onClick:t,disabled:a,className:"gap-2",children:[e.jsx(Be,{className:K("size-3",a&&"animate-spin")}),a?"Retrying...":"Retry"]})]})}const Zs=({flowRun:s})=>{const[t,a]=n.useState("grid"),{data:c}=$(We({artifacts:{operator:"and_",flow_run_id:{any_:[s.id]},type:{not_any_:["result"]}},sort:"ID_DESC",offset:0}));return c.length===0?e.jsx(he,{children:e.jsx(pe,{className:"text-center",children:e.jsxs("p",{children:["This flow run did not produce any artifacts; for more information on creating artifacts, see the"," ",e.jsx("a",{href:"https://docs.prefect.io/v3/develop/artifacts",target:"_blank",rel:"noopener noreferrer",className:"text-blue-500",children:"documentation"}),"."]})})}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(Ds,{type:"single",variant:"outline",value:t,onValueChange:r=>a(r),children:[e.jsx(ue,{value:"grid","aria-label":"Grid view",children:e.jsx(He,{className:"w-4 h-4"})}),e.jsx(ue,{value:"list","aria-label":"List view",children:e.jsx(_s,{className:"w-4 h-4"})})]})}),e.jsx("div",{className:K("grid",t==="grid"?"grid-cols-1 lg:grid-cols-2 xl:grid-cols-3":"grid-cols-1","gap-4"),"data-testid":"flow-run-artifacts-grid",children:c.map(r=>e.jsx(ks,{artifact:r,compact:t==="list"},r.id))})]})};function ea({flowRun:s}){return s?e.jsxs("div",{className:"space-y-4",children:[e.jsx(S,{label:"Run Count",value:s.run_count}),e.jsx(S,{label:"Created",value:e.jsx(te,{date:s.created})}),s.created_by?.display_value&&e.jsx(S,{label:"Created By",value:s.created_by.display_value}),e.jsx(S,{label:"Last Updated",value:e.jsx(te,{date:s.updated})}),s.idempotency_key&&e.jsx(S,{label:"Idempotency Key",value:s.idempotency_key}),s.tags&&s.tags.length>0&&e.jsx(S,{label:"Tags",value:e.jsx(je,{tags:s.tags})}),e.jsx(S,{label:"Flow Run ID",value:s.id,copyable:!0}),s.state?.message&&e.jsx(S,{label:"State Message",value:s.state.message}),s.flow_version&&e.jsx(S,{label:"Flow Version",value:s.flow_version}),s.empirical_policy?.retries!=null&&e.jsxs(e.Fragment,{children:[e.jsx(S,{label:"Retries",value:s.empirical_policy.retries}),e.jsx(S,{label:"Retry Delay",value:s.empirical_policy.retry_delay})]})]}):e.jsx("div",{className:"flex flex-col gap-2 bg-gray-100 p-4 rounded-md",children:e.jsx("span",{className:"text-gray-500",children:"No flow run details available"})})}const sa=({flowRun:s,open:t,onOpenChange:a})=>{const[c,r]=n.useState(!1),{setFlowRunState:m,isPending:o}=B(),{data:d=[]}=D({...ge({flow_runs:{operator:"and_",parent_flow_run_id:{operator:"and_",any_:[s.id]},state:{operator:"and_",type:{any_:["RUNNING","SCHEDULED","PENDING","PAUSED"]}}},sort:"START_TIME_DESC",limit:100,offset:0}),enabled:t}),i=d.length>0,j=u=>{for(const h of d)m({id:h.id,state:{type:"CANCELLING",name:"Cancelling"},force:!0},{onError:()=>{u.push(h.name??h.id)}})},l=()=>{m({id:s.id,state:{type:"CANCELLING",name:"Cancelling"},force:!0},{onSuccess:()=>{if(c&&d.length>0){const u=[];j(u),u.length>0?y.error(`Failed to cancel some sub-flows: ${u.join(", ")}`):y.success(`Flow run and ${d.length} sub-flow${d.length===1?"":"s"} cancelled`)}else y.success("Flow run cancelled");a(!1)},onError:u=>{y.error(u.message||"Failed to cancel flow run")}})};return e.jsx(fe,{open:t,onOpenChange:a,children:e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ve,{children:"Cancel Flow Run"}),e.jsx(_e,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Are you sure you want to cancel"," ",e.jsx("span",{className:"font-medium",children:s.name}),"?"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Will become:"}),e.jsx(C,{type:"CANCELLING",name:"Cancelling"})]})]})})]}),i&&e.jsxs("div",{className:"flex items-center space-x-2 py-2",children:[e.jsx(q,{id:"cancel-subflows",checked:c,onCheckedChange:u=>r(u===!0)}),e.jsxs(be,{htmlFor:"cancel-subflows",className:"text-sm cursor-pointer",children:["Also cancel ",d.length," sub-flow run",d.length===1?"":"s"]})]}),e.jsxs(Se,{children:[e.jsx(Ce,{disabled:o,children:"Cancel"}),e.jsx(we,{onClick:u=>{u.preventDefault(),l()},disabled:o,children:o?"Cancelling...":"Cancel Flow Run"})]})]})})},aa=({flowRun:s,open:t,onOpenChange:a})=>{const[c,r]=n.useState(300),{setFlowRunState:m,isPending:o}=B(),d=()=>{const j=new Date(Date.now()+c*1e3).toISOString();m({id:s.id,state:{type:"PAUSED",name:"Suspended",state_details:{pause_timeout:j,pause_reschedule:!0,deferred:!1,untrackable_result:!1}},force:!0},{onSuccess:()=>{y.success("Flow run paused"),a(!1)},onError:l=>{y.error(l.message||"Failed to pause flow run")}})},i=c>=5;return e.jsx(X,{open:t,onOpenChange:a,children:e.jsxs(Y,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Pause Flow Run"}),e.jsx(se,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Pause ",e.jsx("span",{className:"font-medium",children:s.name})," for a specified duration. The flow will automatically resume after the timeout."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Will become:"}),e.jsx(C,{type:"PAUSED",name:"Suspended"})]})]})})]}),e.jsxs("div",{className:"space-y-2 py-4",children:[e.jsx(be,{htmlFor:"timeout",children:"Timeout (seconds)"}),e.jsx(Je,{id:"timeout",type:"number",min:5,value:c,onChange:j=>r(Number.parseInt(j.target.value,10)||5)}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Will pause for ",ke(c),". Minimum 5 seconds."]})]}),e.jsxs(ae,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:o,children:"Cancel"}),e.jsx(b,{onClick:d,disabled:o||!i,loading:o,children:"Pause Flow Run"})]})]})})},ta=({flowRun:s,open:t,onOpenChange:a})=>{const c=s.state?.state_details?.run_input_keyset;return c&&c.schema?e.jsx(X,{open:t,onOpenChange:a,children:e.jsx(Y,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:e.jsx(n.Suspense,{fallback:e.jsx(Re,{}),children:e.jsx(la,{flowRun:s,keyset:c,onOpenChange:a})})})}):e.jsx(ra,{flowRun:s,open:t,onOpenChange:a})},ra=({flowRun:s,open:t,onOpenChange:a})=>{const{resumeFlowRun:c,isPending:r}=De(),m=()=>{c({id:s.id},{onSuccess:()=>{y.success("Flow run resumed"),a(!1)},onError:o=>{y.error(o.message||"Failed to resume flow run")}})};return e.jsx(X,{open:t,onOpenChange:a,children:e.jsxs(Y,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Resume Flow Run"}),e.jsx(se,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Resume the paused flow run"," ",e.jsx("span",{className:"font-medium",children:s.name}),"?"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]})]})})]}),e.jsxs(ae,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:r,children:"Cancel"}),e.jsx(b,{onClick:m,disabled:r,loading:r,children:"Resume"})]})]})})},la=({flowRun:s,keyset:t,onOpenChange:a})=>{const{resumeFlowRun:c,isPending:r}=De(),{values:m,setValues:o,errors:d,validateForm:i}=Fs(),{data:j}=D({...re(s.id,t.schema),select:h=>h}),{data:l}=D({...re(s.id,t.description??""),enabled:!!t.description,select:h=>h});n.useEffect(()=>{o({})},[o]);const u=async()=>{if(j)try{if(await i({schema:m}),d.length>0)return;c({id:s.id,runInput:m},{onSuccess:()=>{y.success("Flow run resumed"),a(!1)},onError:h=>{y.error(h.message||"Failed to resume flow run")}})}catch{y.error("Failed to validate input")}};return j?e.jsxs(e.Fragment,{children:[e.jsxs(Z,{children:[e.jsx(ee,{children:"Resume Flow Run"}),e.jsx(se,{asChild:!0,children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:["Provide input to resume"," ",e.jsx("span",{className:"font-medium",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]})]})})]}),l&&e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none py-2 px-3 bg-muted/50 rounded-md",children:e.jsx(Es,{children:l})}),e.jsx("div",{className:"py-4",children:e.jsx(Ts,{schema:j,values:m,onValuesChange:o,errors:d,kinds:["json"]})}),e.jsxs(ae,{children:[e.jsx(b,{type:"button",variant:"outline",onClick:()=>a(!1),disabled:r,children:"Cancel"}),e.jsx(b,{onClick:()=>{u()},disabled:r,loading:r,children:"Resume"})]})]}):e.jsx(Re,{})},Re=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(x,{className:"h-6 w-48"}),e.jsx(x,{className:"h-4 w-full"}),e.jsx(x,{className:"h-32 w-full"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(x,{className:"h-10 w-20"}),e.jsx(x,{className:"h-10 w-20"})]})]}),na=({flowRun:s,open:t,onOpenChange:a})=>{const{setFlowRunState:c,isPending:r}=B(),m=()=>{c({id:s.id,state:{type:"SCHEDULED",name:"AwaitingRetry",message:"Retry from the UI"},force:!0},{onSuccess:()=>{y.success("Flow run scheduled for retry"),a(!1)},onError:o=>{y.error(o.message||"Failed to retry flow run")}})};return e.jsx(fe,{open:t,onOpenChange:a,children:e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ve,{children:"Retry Flow Run"}),e.jsx(_e,{asChild:!0,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["Retry the flow run"," ",e.jsx("span",{className:"font-medium",children:s.name}),"?"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Current state:"}),s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Will become:"}),e.jsx(C,{type:"SCHEDULED",name:"AwaitingRetry"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Task runs with persisted results will use cached values. Task runs without persisted results will be re-executed."})]})})]}),e.jsxs(Se,{children:[e.jsx(Ce,{disabled:r,children:"Cancel"}),e.jsx(we,{onClick:o=>{o.preventDefault(),m()},disabled:r,children:r?"Retrying...":"Retry"})]})]})})};function ia({flowRun:s,onDeleteClick:t}){const[a,c]=Ls(),{open:r,onOpenChange:m,openDialog:o}=bs(),[d,i]=n.useState(!1),[j,l]=n.useState(!1),[u,h]=n.useState(!1),[v,g]=n.useState(!1),{setFlowRunState:F,isPending:T}=B(),E=s.state_type&&["COMPLETED","FAILED","CANCELLED","CRASHED"].includes(s.state_type),A=Ws(s.state_type)&&s.deployment_id,I=Hs(s.state_type)&&s.deployment_id,z=Js(s.state_type),M=Ks(s.state_type)&&s.deployment_id,R=k=>{F({id:s.id,state:{type:k.type,name:k.type.charAt(0)+k.type.slice(1).toLowerCase(),message:k.message},force:!0},{onSuccess:()=>{y.success("Flow run state changed"),m(!1)},onError:Ue=>{y.error(Ue.message||"Failed to change state")}})},{data:N}=D({...Ke(s.deployment_id??""),enabled:!!s.deployment_id}),{data:p}=D({...Fe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s.id],is_null_:!1}}})}),{data:f}=D({...ge({sort:"START_TIME_DESC",offset:0,limit:1,task_runs:{operator:"and_",id:{any_:[s.parent_task_run_id??""]}}}),enabled:!!s.parent_task_run_id}),O=f?.[0],Oe=k=>k===void 0?"...":k===0?"None":`${k} Task run${k===1?"":"s"}`;return e.jsxs("div",{className:"flex flex-row justify-between",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{children:e.jsxs(Ye,{children:[e.jsx(le,{children:e.jsx(Ze,{to:"/runs",className:"text-xl font-semibold",children:"Runs"})}),e.jsx(es,{}),e.jsxs(le,{className:"text-xl",children:[e.jsx(ss,{className:"font-semibold",children:s.name}),s.work_pool_name&&e.jsx(as,{variant:"outline",className:"ml-2",children:s.work_pool_name}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"ml-2",children:e.jsx(je,{tags:s.tags,maxTagsDisplayed:3})})]})]})}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[s.state_type&&s.state_name&&e.jsx(C,{type:s.state_type,name:s.state_name}),s.start_time&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(_,{id:"Calendar",className:"size-4"}),e.jsx("span",{children:ts(s.start_time,"dateTimeNumeric")})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(_,{id:"Clock",className:"size-4"}),e.jsx("span",{children:ke(s.total_run_time??0)})]}),e.jsxs("div",{className:`flex items-center gap-1 ${p===0?"text-muted-foreground/60":""}`,children:[e.jsx(_,{id:"ListTodo",className:"size-4"}),e.jsx("span",{children:Oe(p)})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm flex-wrap",children:[s.flow_id&&e.jsx(rs,{flowId:s.flow_id}),s.deployment_id&&e.jsxs(G,{to:"/deployments/deployment/$id",params:{id:s.deployment_id},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"Rocket",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Deployment"}),e.jsx("span",{children:N?.name??"..."})]}),s.work_pool_name&&e.jsxs(G,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:s.work_pool_name},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"Server",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Work Pool"}),e.jsx("span",{children:s.work_pool_name})]}),s.work_pool_name&&s.work_queue_name&&e.jsxs(G,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:s.work_pool_name},search:{tab:"Work Queues"},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"ListOrdered",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Work Queue"}),e.jsx("span",{children:s.work_queue_name})]}),O&&e.jsxs(G,{to:"/runs/flow-run/$id",params:{id:O.id},className:"flex items-center gap-1 hover:underline",children:[e.jsx(_,{id:"Workflow",className:"size-4"}),e.jsx("span",{className:"text-muted-foreground",children:"Parent Run"}),e.jsx("span",{children:O.name??"..."})]})]})]}),e.jsxs(Ie,{children:[e.jsx(ze,{asChild:!0,children:e.jsx(b,{variant:"outline",className:"p-2",children:e.jsx(ls,{className:"w-4 h-4"})})}),e.jsxs(Me,{children:[A&&e.jsx(w,{onClick:()=>i(!0),children:"Cancel"}),I&&e.jsx(w,{onClick:()=>l(!0),children:"Pause"}),z&&e.jsx(w,{onClick:()=>h(!0),children:"Resume"}),M&&e.jsx(w,{onClick:()=>g(!0),children:"Retry"}),E&&e.jsx(w,{onClick:o,children:"Change state"}),(A||I||z||M||E)&&e.jsx(Ps,{}),e.jsx(w,{onClick:()=>{navigator.clipboard.writeText(s.id),y.success("Copied flow run ID to clipboard")},children:"Copy ID"}),e.jsx(w,{onClick:()=>c({title:"Delete Flow Run",description:`Are you sure you want to delete flow run ${s.name}?`,onConfirm:t}),children:"Delete"})]})]}),e.jsx(As,{...a}),e.jsx(Ss,{open:r,onOpenChange:m,currentState:s.state?{type:s.state.type,name:s.state.name??s.state.type.charAt(0)+s.state.type.slice(1).toLowerCase()}:null,label:"Flow Run",onConfirm:R,isLoading:T}),e.jsx(sa,{flowRun:s,open:d,onOpenChange:i}),e.jsx(aa,{flowRun:s,open:j,onOpenChange:l}),e.jsx(ta,{flowRun:s,open:u,onOpenChange:h}),e.jsx(na,{flowRun:s,open:v,onOpenChange:g})]})}function oa({flowRun:s}){const[t,a]=n.useState(!1),c=async()=>{a(!0);try{const m=await(await cs()).GET("/flow_runs/{id}/logs/download",{params:{path:{id:s.id}},parseAs:"blob"});if(!m.data)throw new Error("No data received from server");const o=URL.createObjectURL(m.data),d=document.createElement("a"),i=s.name??"logs";d.href=o,d.setAttribute("download",`${i}.csv`),d.click(),URL.revokeObjectURL(o)}catch(r){console.error(r),y.error("Failed to download logs")}finally{a(!1)}};return e.jsxs(ns,{children:[e.jsx(is,{asChild:!0,children:e.jsx(b,{variant:"outline",size:"icon",onClick:()=>{c()},disabled:t,"aria-label":"Download logs",children:t?e.jsx(_,{id:"Loader2",className:"size-4 animate-spin"}):e.jsx(_,{id:"Download",className:"size-4"})})}),e.jsx(os,{children:"Download all logs as CSV"})]})}const ca=({flowRun:s,virtualize:t=!0})=>{const[a,c]=n.useState(0),[r,m]=n.useState("TIMESTAMP_ASC"),o=n.useMemo(()=>({...ds({limit:50,sort:r,logs:{operator:"and_",level:{ge_:a},flow_run_id:{any_:[s.id]}}}),refetchInterval:s.state_type==="RUNNING"?5e3:!1}),[a,r,s.id,s.state_type]),{data:d,hasNextPage:i,fetchNextPage:j,isFetchingNextPage:l}=Ge(o),u=d.pages.length===1&&d.pages[0].length===0;let h="This run did not produce any logs.";return u&&(a>0?h="No logs match your filter criteria":s.state_type==="SCHEDULED"&&s.state_name==="Scheduled"?h="Run has not yet started. Check back soon for logs.":s.state_type==="RUNNING"&&(h="Waiting for logs...")),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-row gap-2 justify-end",children:[e.jsx(da,{levelFilter:a,setLevelFilter:c}),e.jsx(ua,{sortOrder:r,setSortOrder:m}),e.jsx(oa,{flowRun:s})]}),u?e.jsx("div",{className:"flex flex-col gap-2 text-center bg-muted p-2 rounded-md",children:e.jsx("span",{className:"text-muted-foreground",children:h})}):e.jsx("div",{className:"rounded-md",children:e.jsx(Cs,{logs:d.pages.flat(),onBottomReached:()=>{i&&!l&&j().catch(v=>{console.error(v)})},className:"max-h-[85vh]",virtualize:t})})]})},me=[{label:"All",value:0},{label:"Critical only",value:50},{label:"Error and above",value:40},{label:"Warning and above",value:30},{label:"Info and above",value:20},{label:"Debug and above",value:10}],da=({levelFilter:s,setLevelFilter:t})=>e.jsxs(Te,{value:s.toString(),onValueChange:a=>t(Number(a)),children:[e.jsx(Ee,{"aria-label":"log level filter",children:e.jsx("span",{children:`Level:
3
- ${me.find(a=>a.value===s)?.label}`})}),e.jsx(Ae,{children:me.map(a=>e.jsx(H,{value:a.value.toString(),children:a.label},a.value))})]}),ua=({sortOrder:s,setSortOrder:t})=>e.jsxs(Te,{value:s,onValueChange:a=>t(a),children:[e.jsx(Ee,{"aria-label":"log sort order",children:e.jsx(us,{placeholder:"Sort log order"})}),e.jsxs(Ae,{children:[e.jsx(H,{value:"TIMESTAMP_ASC",children:"Oldest to newest"}),e.jsx(H,{value:"TIMESTAMP_DESC",children:"Newest to oldest"})]})]}),ma=({parentFlowRunId:s})=>{const t=J(),[a,c]=n.useState(""),[r,m]=n.useState(new Set),[o,d]=n.useState("START_TIME_DESC"),[i,j]=n.useState({page:1,limit:10}),l=Le(a,300),u=n.useMemo(()=>({flow_runs:{operator:"and_",parent_flow_run_id:{operator:"and_",any_:[s]}}}),[s]),{data:h}=$(ms(u,3e4)),v=n.useMemo(()=>({page:i.page,limit:i.limit,sort:o,flow_runs:{operator:"and_",parent_flow_run_id:{operator:"and_",any_:[s]},name:l?{like_:l}:void 0,state:r.size>0?{operator:"and_",name:{any_:Array.from(r)}}:void 0}}),[s,i,o,l,r]),{data:g}=D(ne(v,3e4)),F=n.useMemo(()=>[...new Set((g?.results??[]).map(p=>p.flow_id))],[g?.results]),{data:T}=D(xs({flows:{operator:"and_",id:{any_:F}},offset:0,sort:"NAME_ASC"},{enabled:F.length>0})),E=n.useMemo(()=>{if(!g?.results)return[];const p=new Map(T?.map(f=>[f.id,f])??[]);return g.results.map(f=>{const O=p.get(f.flow_id);return O?{...f,flow:O}:{...f,flow:void 0}}).filter(f=>f!==null)},[g?.results,T]),A=p=>{c(p.target.value),j(f=>({...f,page:1}))},I=p=>{m(p),j(f=>({...f,page:1}))},z=p=>{d(p),j(f=>({...f,page:1}))},M=()=>{c(""),m(new Set),j(p=>({...p,page:1}))},R=p=>{t.prefetchQuery(ne({...v,page:p},3e4))},N=a||r.size>0;return h===0?e.jsx("div",{className:"flex items-center justify-center h-48 border rounded-lg bg-muted/50",children:e.jsx(U,{className:"text-muted-foreground",children:"No subflow runs found for this flow run."})}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-12 items-center gap-2",children:[e.jsx("div",{className:"flex flex-col gap-1 xl:col-span-3 md:col-span-12 col-span-6 md:order-0 order-2",children:e.jsxs(U,{variant:"bodySmall",className:"text-muted-foreground",children:[h," Subflow run",h!==1?"s":""]})}),e.jsx("div",{className:"xl:col-span-4 col-span-12 md:order-1 order-0",children:e.jsx(Pe,{value:a,onChange:A,placeholder:"Search by run name","aria-label":"Search by run name",debounceMs:300})}),e.jsx("div",{className:"xl:col-span-3 md:col-span-6 col-span-12 md:order-2 order-1",children:e.jsx(zs,{selectedFilters:r,onSelectFilter:I})}),e.jsx("div",{className:"xl:border-l xl:border-border xl:pl-2 xl:col-span-2 md:col-span-6 col-span-6 md:order-3 order-3",children:e.jsx(Is,{value:o,onSelect:z})})]}),e.jsx(Ms,{flowRuns:E,onClearFilters:N?M:void 0}),g&&g.pages>0&&e.jsx(Rs,{pagination:i,onChangePagination:j,count:g.count,pages:g.pages,onPrefetchPage:R})]})},xe=2,xa=({selectedFilters:s,onSelectFilter:t,className:a})=>{const[c,r]=n.useState(!1),m=n.useMemo(()=>{const l=new Set(ie);return s.has("Scheduled")||l.size!==s.size?!1:Array.from(s).every(u=>l.has(u))},[s]),o=()=>{t(new Set(ie))},d=()=>{t(new Set)},i=l=>{if(m){t(new Set([l]));return}const u=new Set(s);s.has(l)?u.delete(l):u.add(l),t(u)},j=()=>{if(s.size===0)return"All run states";if(m)return"All except scheduled";const l=Array.from(s),u=l.slice(0,xe),h=l.length-xe;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:u.map(v=>e.jsx(C,{name:v,type:W[v]},v))}),h>0&&e.jsxs(U,{variant:"bodySmall",className:"shrink-0",children:["+ ",h]})]})};return e.jsxs(Ie,{open:c,onOpenChange:r,children:[e.jsx(ze,{asChild:!0,children:e.jsxs(b,{variant:"outline",className:K("justify-between w-full",a),children:[e.jsx("span",{className:"flex-1 min-w-0",children:j()}),e.jsx(_,{id:"ChevronDown",className:"ml-2 size-4 shrink-0"})]})}),e.jsxs(Me,{className:"max-h-96 overflow-x-hidden overflow-y-auto",children:[e.jsxs(w,{onSelect:l=>{l.preventDefault(),o()},children:[e.jsx(q,{checked:m,className:"mr-2"}),"All except scheduled"]}),e.jsxs(w,{onSelect:l=>{l.preventDefault(),d()},children:[e.jsx(q,{checked:s.size===0,className:"mr-2"}),"All run states"]}),Object.keys(W).map(l=>e.jsxs(w,{"aria-label":l,onSelect:u=>{u.preventDefault(),i(l)},children:[e.jsx(q,{"aria-label":l,className:"mr-2",checked:!m&&s.has(l)}),e.jsx(C,{name:l,type:W[l]})]},l))]})]})},ha=({flowRunId:s})=>{const t=J(),[a,c]=n.useState(""),[r,m]=n.useState(new Set),[o,d]=n.useState(new Set),[i,j]=n.useState("EXPECTED_START_TIME_DESC"),[l,u]=n.useState({page:1,limit:20}),h=Le(a,300),{data:v}=$(Fe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s],is_null_:!1},subflow_runs:{exists_:!1}}},3e4)),{data:g}=D(oe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s],is_null_:!1},subflow_runs:{exists_:!1},name:h?{like_:h}:void 0,state:r.size>0?{operator:"and_",name:{any_:Array.from(r)}}:void 0,tags:o.size>0?{operator:"and_",all_:Array.from(o)}:void 0},sort:i,page:l.page,limit:l.limit},3e4)),F=N=>{c(N.target.value),u(p=>({...p,page:1}))},T=N=>{m(N),u(p=>({...p,page:1}))},E=N=>{j(N),u(p=>({...p,page:1}))},A=N=>{const p=Array.isArray(N)?N:[];d(new Set(p)),u(f=>({...f,page:1}))},I=()=>{c(""),m(new Set),d(new Set),u(N=>({...N,page:1}))},z=N=>{t.prefetchQuery(oe({task_runs:{operator:"and_",flow_run_id:{operator:"and_",any_:[s],is_null_:!1},subflow_runs:{exists_:!1},name:h?{like_:h}:void 0,state:r.size>0?{operator:"and_",name:{any_:Array.from(r)}}:void 0,tags:o.size>0?{operator:"and_",all_:Array.from(o)}:void 0},sort:i,page:N,limit:l.limit},3e4))},M=a||r.size>0||o.size>0,R=n.useMemo(()=>{if(!g?.results)return null;const N=new Map;for(const p of g.results){const f=String(p.state?.name??"Unknown");N.set(f,(N.get(f)??0)+1)}return Array.from(N.entries()).map(([p,f])=>`${f} ${p}`).join(", ")},[g?.results]);return v===0?e.jsx("div",{className:"flex items-center justify-center h-48 border rounded-lg bg-muted/50",children:e.jsx(U,{className:"text-muted-foreground",children:"No task runs found for this flow run."})}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-12 items-center gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1 xl:col-span-3 md:col-span-12 col-span-6 md:order-0 order-3",children:[e.jsxs(U,{variant:"bodySmall",className:"text-muted-foreground",children:[v," Task run",v!==1?"s":""]}),R&&e.jsxs(U,{variant:"bodySmall",className:"text-muted-foreground text-xs capitalize",children:["(",R,")"]})]}),e.jsx("div",{className:"xl:col-span-3 md:col-span-6 col-span-12 md:order-1 order-0",children:e.jsx(Pe,{value:a,onChange:F,placeholder:"Search by run name","aria-label":"Search by run name",debounceMs:300})}),e.jsx("div",{className:"xl:col-span-2 md:col-span-6 col-span-12 md:order-2 order-1",children:e.jsx(xa,{selectedFilters:r,onSelectFilter:T})}),e.jsx("div",{className:"xl:col-span-2 md:col-span-6 col-span-12 md:order-3 order-2",children:e.jsx(Qs,{value:Array.from(o),onChange:A,placeholder:"All tags"})}),e.jsx("div",{className:"xl:border-l xl:border-border xl:pl-2 xl:col-span-2 md:col-span-6 col-span-6 md:order-4 order-4",children:e.jsx(Os,{value:i,onSelect:E})})]}),e.jsx(Us,{taskRuns:g?.results,onClearFilters:M?I:void 0}),g&&g.pages>0&&e.jsx(Gs,{pagination:l,onChangePagination:u,count:g.count,pages:g.pages,onPrefetchPage:z})]})},pa=({id:s,tab:t,onTabChange:a})=>{const[c,r]=n.useState(!1),[m,o]=n.useState(!1),d=J(),{data:i}=$({...hs(s),refetchInterval:c}),{deleteFlowRun:j}=ps(),{navigate:l}=Qe(),u=i.state_type==="PENDING";ws(i?.state_type),n.useEffect(()=>{i.state_type==="RUNNING"||i.state_type==="PENDING"?r(5e3):r(!1)},[i]);const h=()=>{j(i.id,{onSuccess:()=>{r(!1),y.success("Flow run deleted"),l({to:"/runs",replace:!0})},onError:E=>{const A=E.message||"Unknown error while deleting flow run.";y.error(A)}})},v=n.useCallback(()=>{d.invalidateQueries({queryKey:js.all()})},[d]),g=n.useCallback(()=>{d.invalidateQueries({queryKey:gs.all()})},[d]),F=n.useCallback(()=>{d.invalidateQueries({queryKey:fs.lists()})},[d]),T=n.useCallback(()=>{d.invalidateQueries({queryKey:ys.all()})},[d]);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-col gap-2",children:e.jsx(ia,{flowRun:i,onDeleteClick:h})}),!u&&e.jsx(he,{className:"py-0",children:e.jsx(pe,{className:"p-0",children:e.jsx(Ys,{flowRunId:i.id,stateType:i.state_type??void 0,fullscreen:m,onFullscreenChange:o})})}),e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(ja,{currentTab:t,onTabChange:a,flowRun:i,logsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load logs",details:"An error occurred while loading log data. Please try again."},onRetry:v}),children:e.jsx(n.Suspense,{fallback:e.jsx(ga,{}),children:e.jsx(ca,{flowRun:i})})}),taskRunsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load task runs",details:"An error occurred while loading task run data. Please try again."},onRetry:g}),children:e.jsx(n.Suspense,{fallback:e.jsx(fa,{}),children:e.jsx(ha,{flowRunId:s})})}),subflowRunsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load subflow runs",details:"An error occurred while loading subflow run data. Please try again."},onRetry:F}),children:e.jsx(n.Suspense,{fallback:e.jsx(Na,{}),children:e.jsx(ma,{parentFlowRunId:s})})}),artifactsContent:e.jsx(Q,{fallback:e.jsx(V,{error:{type:"unknown-error",message:"Failed to load artifacts",details:"An error occurred while loading artifact data. Please try again."},onRetry:T}),children:e.jsx(n.Suspense,{fallback:e.jsx(ya,{}),children:e.jsx(Zs,{flowRun:i})})}),detailsContent:e.jsx(n.Suspense,{fallback:e.jsx(va,{}),children:e.jsx(ea,{flowRun:i})}),parametersContent:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{y.success("Copied parameters to clipboard"),navigator.clipboard.writeText(JSON.stringify(i.parameters??{},null,2))},children:[e.jsx(_,{id:"Copy",className:"size-4 mr-2"}),"Copy parameters"]})}),e.jsx(ce,{value:JSON.stringify(i.parameters??{},null,2),disabled:!0})]}),jobVariablesContent:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{y.success("Copied job variables to clipboard"),navigator.clipboard.writeText(JSON.stringify(i.job_variables??{},null,2))},children:[e.jsx(_,{id:"Copy",className:"size-4 mr-2"}),"Copy job variables"]})}),e.jsx(ce,{value:JSON.stringify(i.job_variables??{},null,2),disabled:!0})]})})})]})},ja=({currentTab:s,onTabChange:t,flowRun:a,logsContent:c,taskRunsContent:r,subflowRunsContent:m,artifactsContent:o,detailsContent:d,parametersContent:i,jobVariablesContent:j})=>e.jsxs(Ns,{value:s,onValueChange:l=>t(l),children:[e.jsxs(vs,{children:[e.jsx(L,{value:"Details",children:"Details"}),e.jsx(L,{value:"Logs",children:"Logs"}),a.state_type!=="PENDING"&&e.jsx(L,{value:"TaskRuns",children:"Task Runs"}),a.state_type!=="PENDING"&&e.jsx(L,{value:"SubflowRuns",children:"Subflow Runs"}),e.jsx(L,{value:"Artifacts",children:"Artifacts"}),e.jsx(L,{value:"Parameters",children:"Parameters"}),e.jsx(L,{value:"JobVariables",children:"Job Variables"})]}),e.jsx(P,{value:"Details",children:d}),e.jsx(P,{value:"Logs",children:c}),e.jsx(P,{value:"TaskRuns",children:r}),e.jsx(P,{value:"SubflowRuns",children:m}),e.jsx(P,{value:"Artifacts",children:o}),e.jsx(P,{value:"Parameters",children:i}),e.jsx(P,{value:"JobVariables",children:j})]}),ga=()=>e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-row gap-2 justify-end",children:[e.jsx(x,{className:"h-8 w-25"}),e.jsx(x,{className:"h-8 w-32"}),e.jsx(x,{className:"h-8 w-8"})," "]}),e.jsx(x,{className:"h-32"})]}),fa=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(x,{className:"h-4 w-24"})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx(x,{className:"h-9 flex-1"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{className:"h-9 w-48"}),e.jsx(x,{className:"h-9 w-40"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"})]})]}),ya=()=>e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(x,{className:"h-8 w-12"})}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3",children:[e.jsx(x,{className:"h-40"}),e.jsx(x,{className:"h-40"}),e.jsx(x,{className:"h-40"}),e.jsx(x,{className:"h-40"})]})]}),Na=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(x,{className:"h-4 w-24"})}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx(x,{className:"h-9 flex-1"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{className:"h-9 w-48"}),e.jsx(x,{className:"h-9 w-40"})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"}),e.jsx(x,{className:"h-24"})]})]}),va=()=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-20"}),e.jsx(x,{className:"h-5 w-12"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-16"}),e.jsx(x,{className:"h-5 w-32"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-24"}),e.jsx(x,{className:"h-5 w-32"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(x,{className:"h-4 w-24"}),e.jsx(x,{className:"h-5 w-64"})]})]});Vs({tab:qs(["Logs","TaskRuns","SubflowRuns","Artifacts","Details","Parameters","JobVariables"]).default("Logs").catch("Logs")});function Wa(){const{id:s}=de.useParams(),{tab:t}=de.useSearch(),a=Ve(),c=r=>{a({to:".",search:m=>({...m,tab:r})})};return e.jsx(pa,{id:s,tab:t,onTabChange:c})}export{Wa as component};
4
- //# sourceMappingURL=flow-run._id-RLy2kBh0.js.map
@@ -1,2 +0,0 @@
1
- import{d as oe,j as e,r as o,t as z,C as Se,D as we,E as G,n as Ne}from"./vendor-tanstack-BcZfOOfy.js";import{aS as Re,y as H,bN as re,aN as ie,aR as ce,ak as V,q as E,I as de,cE as Fe,al as q,bO as Te,O as ue,S as ke,a as _e,b as Ae,c as Ee,e as Be,c4 as me,_ as Oe,$ as Pe,a0 as Me,a1 as Ie,a2 as Le,a3 as ze,bM as U,B as He,g as Qe,h as Y,bs as Ge,bB as We,bD as Ke,aD as O,cF as $e,cG as Ve,cH as qe,cI as Ue,cJ as Ye,cK as Ze,C as pe,m as he,n as ge,o as xe,aX as Je,aC as Xe,cL as es,cM as ss,b5 as as,aw as ts,ax as ns,ay as I,az as L,cN as m,ao as ls,be as os,aE as Z,aH as J,aL as rs}from"./index-m48E4KcG.js";import{S as is}from"./sort-filter-DpuWNkQo.js";import{S as cs,a as ds,F as us}from"./flow-runs-pagination-BATUweRV.js";import{u as ms,F as ps}from"./use-flow-runs-selected-rows-DmQSWBTu.js";import{D as hs}from"./delete-confirmation-dialog-DHkm2p8m.js";import{D as gs}from"./data-table-rlbkLcrY.js";import{T as xs}from"./tags-input-BLPMVWpZ.js";import{D as fe,a as ye,b as je,d as Q,c as fs}from"./dropdown-menu-0atiOSFo.js";import{S as ys}from"./index-CQnWiUE5.js";import{S as js}from"./index-CKGj5lSu.js";import{s as bs,U as vs,_ as Cs}from"./vendor-date-wwuDAncJ.js";import{A as Ds,b as X}from"./vendor-recharts-BAN776s_.js";import{u as Ss}from"./use-page-title-DEH55Ovu.js";import{o as ws,e as P,a as ee,s as M,n as _,d as se}from"./vendor-forms-ClCIacbh.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./use-delete-confirmation-dialog-CUdii6Lo.js";import"./table-bBL6C0ZK.js";import"./cronstrue-Bevg0uGw.js";import"./use-is-overflowing-CpSV4NPP.js";const Ns=({flow:s,open:a,onOpenChange:t,onDeleted:n})=>{const l=oe(),{deleteFlow:r,isPending:c}=Re(),d=()=>{r(s.id,{onSuccess:()=>{H.success("Flow deleted"),n?.(),l({to:"/flows"})},onError:()=>{H.error("Failed to delete flow")}})};return e.jsx(hs,{isOpen:a,title:"Delete Flow",description:`Are you sure you want to delete ${s.name}? This action cannot be undone.`,isLoading:c,loadingText:"Deleting...",onConfirm:d,onClose:()=>t(!1)})},ae=4,Rs=2,Fs=({deploymentId:s})=>{const[a,t]=o.useState(0),n=re(a,150),l=o.useCallback(u=>{if(!u)return;const p=()=>{const h=u.getBoundingClientRect().width;t(Math.floor(h/(ae+Rs)))};p();const x=new ResizeObserver(p);return x.observe(u),()=>{x.disconnect()}},[]),r=n||a,{data:c}=z(ie({deployments:{operator:"and_",id:{any_:[s]}},limit:Math.min(60,r||60),sort:"START_TIME_DESC",offset:0})),d=c?.map(u=>({...u}))??[];return e.jsx("div",{className:"w-full",ref:l,children:e.jsx(ce,{enrichedFlowRuns:d,startDate:bs(new Date,vs),endDate:new Date,barWidth:ae,numberOfBars:r,className:"h-8 w-full",chartId:`deployment-${s}`})})},Ts=[{id:"select",header:({table:s})=>e.jsx(V,{checked:s.getIsAllPageRowsSelected(),onCheckedChange:a=>s.toggleAllPageRowsSelected(!!a),"aria-label":"Select all"}),cell:({row:s})=>e.jsx(V,{checked:s.getIsSelected(),onCheckedChange:a=>s.toggleSelected(!!a),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1,maxSize:20,minSize:20},{accessorKey:"name",header:"Name",cell:({row:s})=>s.original.name},{accessorKey:"status",header:"Status",cell:({row:s})=>{const a=s.original.paused?"PAUSED":s.original.status??"NOT_READY";return e.jsx(js,{status:a})}},{accessorKey:"tags",header:"Tags",cell:({row:s})=>e.jsx("div",{className:"flex flex-wrap gap-1",children:s.original.tags?.map(a=>e.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs font-medium px-2 py-0.5 rounded",children:a},a))})},{accessorKey:"schedules",header:"Schedules",cell:({row:s})=>{const a=s.original.schedules;return!a||a.length===0?null:e.jsx(ys,{schedules:a})},size:150},{accessorKey:"activity",header:"Activity",cell:({row:s})=>s.original.id?e.jsx(Fs,{deploymentId:s.original.id}):null},{id:"actions",cell:({row:s})=>s.original.id?e.jsxs(fe,{children:[e.jsx(ye,{asChild:!0,children:e.jsxs(E,{variant:"ghost",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(de,{id:"MoreHorizontal",className:"size-4"})]})}),e.jsx(je,{align:"end",children:e.jsx(Q,{onClick:()=>{navigator.clipboard.writeText(s.original.id)},children:"Copy ID"})})]}):null,minSize:30,maxSize:30}],ks=[{label:"Created",value:"CREATED_DESC"},{label:"A to Z",value:"NAME_ASC"},{label:"Z to A",value:"NAME_DESC"}],_s=({deployments:s,deploymentsCount:a,deploymentsPages:t,deploymentSearch:n,onDeploymentSearchChange:l,deploymentTags:r,onDeploymentTagsChange:c,deploymentSort:d,onDeploymentSortChange:u,deploymentPagination:p,onDeploymentPaginationChange:x})=>{const[h,y]=o.useState({}),[g,f]=o.useState(!1),{deleteDeployment:j}=Fe(),b=o.useCallback(i=>{const v={pageIndex:p.page-1,pageSize:p.limit},w=typeof i=="function"?i(v):i;x({page:w.pageIndex+1,limit:w.pageSize}),y({})},[p,x]),R=Se({data:s,columns:Ts,getCoreRowModel:we(),manualPagination:!0,pageCount:t,state:{rowSelection:h,pagination:{pageIndex:p.page-1,pageSize:p.limit}},onRowSelectionChange:y,onPaginationChange:b,getRowId:i=>i.id}),C=Object.keys(h).length,D=o.useCallback(()=>{const i=Object.keys(h);for(const v of i)j(v);y({}),f(!1)},[h,j]),S=o.useCallback(i=>{Array.isArray(i)&&c(i)},[c]);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid grid-cols-12 items-center gap-2",children:[e.jsx("div",{className:"flex flex-col gap-1 xl:col-span-3 md:col-span-12 col-span-6 md:order-0 order-3",children:C>0?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(q,{variant:"bodySmall",className:"text-muted-foreground",children:[C," selected"]}),e.jsx(E,{variant:"ghost",size:"icon",className:"h-6 w-6 text-destructive hover:text-destructive",onClick:()=>f(!0),"aria-label":"Delete selected deployments",children:e.jsx(Te,{className:"h-4 w-4"})})]}):e.jsxs(q,{variant:"bodySmall",className:"text-muted-foreground",children:[a," Deployment",a!==1?"s":""]})}),e.jsx("div",{className:"xl:col-span-4 md:col-span-6 col-span-12 md:order-1 order-0",children:e.jsx(ue,{placeholder:"Search deployments...",value:n??"",onChange:i=>l(i.target.value),"aria-label":"Search deployments",debounceMs:300})}),e.jsx("div",{className:"xl:col-span-3 md:col-span-6 col-span-12 md:order-2 order-1",children:e.jsx(xs,{placeholder:"Filter by tags",value:r,onChange:S})}),e.jsx("div",{className:"xl:border-l xl:border-border xl:pl-2 xl:col-span-2 md:col-span-6 col-span-6 md:order-3 order-2",children:e.jsxs(ke,{value:d,onValueChange:i=>u(i),children:[e.jsx(_e,{className:"w-full","aria-label":"Sort deployments",children:e.jsx(Ae,{placeholder:"Sort by"})}),e.jsx(Ee,{children:ks.map(i=>e.jsx(Be,{value:i.value,children:i.label},i.value))})]})})]}),e.jsx(me,{children:e.jsx("div",{className:"[&_[data-slot=table-container]]:overflow-visible",children:e.jsx(gs,{table:R})})}),e.jsx(Oe,{open:g,onOpenChange:f,children:e.jsxs(Pe,{children:[e.jsxs(Me,{children:[e.jsx(Ie,{children:"Delete Deployments"}),e.jsxs(Le,{children:["Are you sure you want to delete ",C," deployment",C!==1?"s":"","? This action cannot be undone."]})]}),e.jsxs(ze,{children:[e.jsx(E,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),e.jsx(E,{variant:"destructive",onClick:D,children:"Delete"})]})]})})]})},As=({flow:s})=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("dl",{className:"flex flex-col gap-2",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Flow ID"}),e.jsx("dd",{className:"text-sm font-medium leading-none font-mono",children:s.id})]}),e.jsxs("dl",{className:"flex flex-col gap-2",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Created"}),e.jsx("dd",{className:"text-sm font-medium leading-none font-mono",children:s.created?e.jsx(U,{date:s.created,format:"absolute"}):"N/A"})]}),e.jsxs("dl",{className:"flex flex-col gap-2",children:[e.jsx("dt",{className:"text-muted-foreground",children:"Updated"}),e.jsx("dd",{className:"text-sm font-medium leading-none font-mono",children:s.updated?e.jsx(U,{date:s.updated,format:"absolute"}):"N/A"})]})]}),Es=({flow:s,onDelete:a})=>{const t=()=>{navigator.clipboard.writeText(s.id),H.success("ID copied")};return e.jsxs(fe,{children:[e.jsx(ye,{asChild:!0,children:e.jsxs(E,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(de,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(je,{align:"end",children:[e.jsx(fs,{children:"Actions"}),e.jsx(Q,{onClick:t,children:"Copy ID"}),e.jsx(Q,{variant:"destructive",onClick:a,children:"Delete"})]})]})};function Bs({flow:s,onDelete:a}){return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(He,{children:e.jsxs(Qe,{children:[e.jsx(Y,{children:e.jsx(Ge,{to:"/flows",className:"text-xl font-semibold",children:"Flows"})}),e.jsx(We,{}),e.jsx(Y,{className:"text-xl font-semibold",children:e.jsx(Ke,{children:s.name})})]})}),e.jsx(Es,{flow:s,onDelete:a})]})}const A=3e4,Os={completed:{label:"Completed",color:"hsl(142.1 76.2% 36.3%)"},failed:{label:"Failed",color:"hsl(0 84.2% 60.2%)"}},Ps=s=>{const a=[];let t=0,n=0;for(const l of s){let r=0,c=0;for(const d of l.states)d.state_type==="COMPLETED"?r+=d.count_runs:(d.state_type==="FAILED"||d.state_type==="CRASHED")&&(c+=d.count_runs);t+=r,n+=c,a.push({timestamp:l.interval_start,completed:t,failed:n})}return a};function Ms({flowId:s}){const[{data:a},{data:t},{data:n},{data:l},{data:r}]=G({queries:[O(Ve(s),A),O(qe(s),A),O(Ue(s),A),O(Ye(s),A),$e(Ze(s),A)]}),c=o.useMemo(()=>Ps(r),[r]),d=c.some(h=>h.failed>0),u=a-l,p=u>0?(t/u*100).toFixed(0):"0",x=u>0?(n/u*100).toFixed(1):"0";return e.jsxs(pe,{className:"flex-1 relative overflow-hidden pb-20",children:[e.jsx(he,{className:"pb-2",children:e.jsx(ge,{children:"Task Runs"})}),e.jsx(xe,{children:e.jsxs("div",{className:"grid gap-1",children:[e.jsx("div",{className:"inline-flex items-end gap-1 text-base",children:e.jsx("span",{className:"font-semibold",children:a})}),l>0&&e.jsxs("div",{className:"inline-flex items-end gap-1 text-sm",children:[e.jsx("span",{className:"font-semibold text-blue-600",children:l}),e.jsx("span",{className:"text-muted-foreground",children:"Running"})]}),e.jsxs("div",{className:"inline-flex items-end gap-1 text-sm",children:[e.jsx("span",{className:"font-semibold text-green-600",children:t}),e.jsx("span",{className:"text-muted-foreground",children:"Completed"}),e.jsxs("span",{className:"text-green-600",children:[p,"%"]})]}),n>0&&e.jsxs("div",{className:"inline-flex items-end gap-1 text-sm",children:[e.jsx("span",{className:"font-semibold text-red-600",children:n}),e.jsx("span",{className:"text-muted-foreground",children:"Failed"}),e.jsxs("span",{className:"text-red-600",children:[x,"%"]})]})]})}),e.jsx("div",{className:"absolute bottom-4 left-0 right-0 h-16",children:e.jsx(Je,{config:Os,className:"h-full w-full",children:e.jsxs(Ds,{data:c,margin:{top:0,right:0,bottom:0,left:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"completedGradientFlow",x1:"0",y1:"1",x2:"0",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-completed)",stopOpacity:0}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-completed)",stopOpacity:.3})]}),e.jsxs("linearGradient",{id:"failedGradientFlow",x1:"0",y1:"1",x2:"0",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--color-failed)",stopOpacity:0}),e.jsx("stop",{offset:"100%",stopColor:"var(--color-failed)",stopOpacity:.3})]})]}),d&&e.jsx(X,{type:"monotone",dataKey:"failed",stroke:"var(--color-failed)",strokeWidth:2,activeDot:!1,fill:"url(#failedGradientFlow)",dot:!1,isAnimationActive:!1}),e.jsx(X,{type:"monotone",dataKey:"completed",stroke:"var(--color-completed)",strokeWidth:2,activeDot:!1,fill:"url(#completedGradientFlow)",dot:!1,isAnimationActive:!1})]})})})]})}const te=8,Is=4,ne=3e4;function Ls({flowId:s,flow:a}){const[t,n]=o.useState(0),l=re(t,150),r=o.useCallback(g=>{if(!g)return;const f=()=>{const b=g.getBoundingClientRect().width;n(Math.floor(b/(te+Is)))};f();const j=new ResizeObserver(f);return j.observe(g),()=>j.disconnect()},[]),c=l||t,d=60,[{data:u},{data:p}]=G({queries:[ie(es(s,d),ne),Xe(ss(s),ne)]}),x=o.useMemo(()=>u.map(g=>({...g,flow:a})),[u,a]),{startDate:h,endDate:y}=o.useMemo(()=>{const g=new Date;return{startDate:Cs(g),endDate:g}},[]);return e.jsxs(pe,{className:"flex-1",children:[e.jsxs(he,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(ge,{children:"Flow Runs"}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[p," total"]})]}),e.jsx(xe,{children:e.jsx("div",{className:"h-24",ref:r,children:c===0?e.jsx(as,{className:"h-full w-full"}):e.jsx(me,{children:e.jsx(ce,{enrichedFlowRuns:x,startDate:h,endDate:y,numberOfBars:c,barWidth:te,className:"h-full w-full"})})})})]})}function zs({flowId:s,flow:a}){return e.jsxs("div",{className:"grid gap-5 md:grid-cols-[2fr_1fr]",children:[e.jsx(Ls,{flowId:s,flow:a}),e.jsx(Ms,{flowId:s})]})}function Hs({flow:s,flowRuns:a,flowRunsCount:t,flowRunsPages:n,deployments:l,deploymentsCount:r,deploymentsPages:c,tab:d="runs",pagination:u,onPaginationChange:p,onPrefetchPage:x,sort:h,onSortChange:y,flowRunSearch:g,onFlowRunSearchChange:f,selectedStates:j,onSelectFilter:b,deploymentSearch:R,onDeploymentSearchChange:C,deploymentTags:D,onDeploymentTagsChange:S,deploymentSort:i,onDeploymentSortChange:v,deploymentPagination:w,onDeploymentPaginationChange:N}){const F=oe(),[W,T]=o.useState(!1),[B,be,{onSelectRow:ve,clearSet:K}]=ms(),$=a.map(k=>({...k,flow:s})),Ce=o.useCallback(()=>{f(""),b(new Set),K()},[f,b,K]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"container mx-auto flex flex-col gap-4",children:[e.jsx(Bs,{flow:s,onDelete:()=>T(!0)}),e.jsx(zs,{flowId:s.id,flow:s}),e.jsxs(ts,{value:d,onValueChange:k=>{F({to:".",search:De=>({...De,tab:k})})},children:[e.jsxs(ns,{children:[e.jsx(I,{value:"runs",children:"Runs"}),e.jsx(I,{value:"deployments",children:"Deployments"}),e.jsx(I,{value:"details",children:"Details"})]}),e.jsxs(L,{value:"runs",className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ps,{count:t,results:$,selectedRows:B,setSelectedRows:be}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ue,{placeholder:"Search by run name",value:g??"",onChange:k=>f(k.target.value),className:"w-64"}),e.jsx(cs,{selectedFilters:j,onSelectFilter:b}),e.jsx(is,{value:h,onSelect:y})]})]}),e.jsx(ds,{flowRuns:$,selectedRows:B,onSelect:ve,onClearFilters:Ce}),e.jsx(us,{count:t,pages:n,pagination:u,onChangePagination:p,onPrefetchPage:x})]}),e.jsx(L,{value:"deployments",children:e.jsx(_s,{deployments:l,deploymentsCount:r,deploymentsPages:c,deploymentSearch:R,onDeploymentSearchChange:C,deploymentTags:D,onDeploymentTagsChange:S,deploymentSort:i,onDeploymentSortChange:v,deploymentPagination:w,onDeploymentPaginationChange:N})}),e.jsx(L,{value:"details",children:e.jsx(As,{flow:s})})]})]}),e.jsx(Ns,{flow:s,open:W,onOpenChange:T})]})}ws({tab:P(["runs","deployments","details"]).optional().default("runs"),"runs.page":_().int().positive().optional().default(1),"runs.limit":_().int().positive().max(100).optional().default(10),"runs.sort":P(rs).optional().default("START_TIME_DESC"),"runs.flowRuns.nameLike":M().optional().default(""),"runs.flowRuns.state.name":ee(M()).optional(),type:P(["span","range"]).optional(),seconds:_().int().positive().optional(),startDateTime:se().optional(),endDateTime:se().optional(),"deployments.page":_().int().positive().optional().default(1),"deployments.limit":_().int().positive().optional().default(10),"deployments.nameLike":M().optional(),"deployments.tags":ee(M()).optional(),"deployments.sort":P(["CREATED_DESC","UPDATED_DESC","NAME_ASC","NAME_DESC"]).optional().default("NAME_ASC")}).optional().default({});const le=(s,a)=>{const t=s["runs.flowRuns.nameLike"],n=s["runs.flowRuns.state.name"]??[],r=t||n.length>0?{operator:"and_",...t&&{name:{like_:t}},...n.length>0&&{state:{operator:"and_",name:{any_:n}}}}:void 0;return{page:s["runs.page"],limit:s["runs.limit"],sort:s["runs.sort"],flow_runs:r,flows:{operator:"and_",id:{any_:[a]}}}},Qs=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useMemo(()=>({page:s["runs.page"],limit:s["runs.limit"]}),[s["runs.page"],s["runs.limit"]]),n=o.useCallback(l=>{a({to:".",search:r=>({...r,"runs.page":l.page,"runs.limit":l.limit}),replace:!0})},[a]);return[t,n]},Gs=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useCallback(n=>{a({to:".",search:l=>({...l,"runs.sort":n,"runs.page":1}),replace:!0})},[a]);return[s["runs.sort"],t]},Ws=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useCallback(n=>{a({to:".",search:l=>({...l,"runs.flowRuns.nameLike":n,"runs.page":1}),replace:!0})},[a]);return[s["runs.flowRuns.nameLike"],t]},Ks=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useMemo(()=>new Set(s["runs.flowRuns.state.name"]||[]),[s["runs.flowRuns.state.name"]]),n=o.useCallback(l=>{a({to:".",search:r=>({...r,"runs.flowRuns.state.name":Array.from(l),"runs.page":1}),replace:!0})},[a]);return{selectedStates:t,onSelectFilter:n}},$s=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useCallback(n=>{a({to:".",search:l=>({...l,"deployments.nameLike":n||void 0,"deployments.page":1}),replace:!0})},[a]);return[s["deployments.nameLike"],t]},Vs=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useCallback(n=>{a({to:".",search:l=>({...l,"deployments.tags":n.length>0?n:void 0,"deployments.page":1}),replace:!0})},[a]);return[s["deployments.tags"]??[],t]},qs=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useCallback(n=>{a({to:".",search:l=>({...l,"deployments.sort":n,"deployments.page":1}),replace:!0})},[a]);return[s["deployments.sort"],t]},Us=()=>{const s=m.useSearch(),a=m.useNavigate(),t=o.useMemo(()=>({page:s["deployments.page"],limit:s["deployments.limit"]}),[s["deployments.page"],s["deployments.limit"]]),n=o.useCallback(l=>{a({to:".",search:r=>({...r,"deployments.page":l.page,"deployments.limit":l.limit}),replace:!0})},[a]);return[t,n]},fa=()=>{const s=Ne(),{id:a}=m.useParams(),t=m.useSearch(),[n,l]=Qs(),[r,c]=Gs(),[d,u]=Ws(),{selectedStates:p,onSelectFilter:x}=Ks(),[h,y]=$s(),[g,f]=Vs(),[j,b]=qs(),[R,C]=Us(),[{data:D}]=G({queries:[ls(a)]}),{data:S}=z(os({sort:t["deployments.sort"],page:t["deployments.page"],limit:t["deployments.limit"],flows:{operator:"and_",id:{any_:[a]}},deployments:{operator:"and_",flow_or_deployment_name:{like_:t["deployments.nameLike"]},tags:{operator:"and_",all_:t["deployments.tags"]||[]}}}));Ss(D?.name?`Flow: ${D.name}`:"Flow");const{data:i}=z(Z(le(t,a),3e4)),v=i?.results??[];o.useEffect(()=>{const N=v.map(F=>F.id);N.length>0&&s.prefetchQuery(J(N))},[s,v]);const w=o.useCallback(N=>{const F=le({...t,"runs.page":N},a);(async()=>{const T=(await s.ensureQueryData(Z(F,3e4)))?.results?.map(B=>B.id)??[];T.length>0&&s.prefetchQuery(J(T))})()},[s,t,a]);return e.jsx(Hs,{flow:D,flowRuns:v,flowRunsCount:i?.count??0,flowRunsPages:i?.pages??0,deployments:S?.results??[],deploymentsCount:S?.count??0,deploymentsPages:S?.pages??0,tab:t.tab,pagination:n,onPaginationChange:l,onPrefetchPage:w,sort:r,onSortChange:c,flowRunSearch:d,onFlowRunSearchChange:u,selectedStates:p,onSelectFilter:x,deploymentSearch:h,onDeploymentSearchChange:y,deploymentTags:g,onDeploymentTagsChange:f,deploymentSort:j,onDeploymentSortChange:b,deploymentPagination:R,onDeploymentPaginationChange:C})};export{fa as component};
2
- //# sourceMappingURL=flow._id-BdQGWPKP.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,F as N,r as p,C as Q,G as W,D as X,B as Y,L as he}from"./vendor-tanstack-BcZfOOfy.js";import{q as d,I as k,y as v,bf as Z,G as ee,O as se,E as ne,t as ae,v as re,w as te,x as ce,D as oe,B as _,g as V,h as E,bg as xe,_ as G,$ as M,a0 as F,a1 as I,p as C,a3 as O,bh as P,bi as je,a2 as ge,bj as ye,bk as pe,bl as be,aw as Ce,ax as ve,ay as $,az as U}from"./index-m48E4KcG.js";import{D as ie}from"./data-table-rlbkLcrY.js";import{D as fe,a as we,b as Le,c as Se,d as T}from"./dropdown-menu-0atiOSFo.js";import{F as le,a as u,b as x,c as j,d as g,e as y}from"./form-DLrbC7rV.js";import{a as de}from"./zod-Cuos7J7w.js";import{c as ue,o as z,n as L,s as h,b as ke,f as S,e as De}from"./vendor-forms-ClCIacbh.js";import{T as Re,a as Te,b as Ae}from"./task-run-concurrency-limits-reset-dialog-S69sih55.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BAN776s_.js";import"./vendor-date-wwuDAncJ.js";import"./table-bBL6C0ZK.js";const Ne=({onEditRow:s,onDeleteRow:n,...a})=>{const r=i=>{navigator.clipboard.writeText(i),v.success("ID copied")},t=a.row.original;return e.jsxs(fe,{children:[e.jsx(we,{asChild:!0,children:e.jsxs(d,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(k,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(Le,{align:"end",children:[e.jsx(Se,{children:"Actions"}),e.jsx(T,{onClick:()=>r(t.id),children:"Copy ID"}),e.jsx(T,{onClick:()=>n(t),children:"Delete"}),e.jsx(T,{onClick:()=>s(t),children:"Edit"})]})]})},_e=s=>{const{updateGlobalConcurrencyLimit:n}=Z(),a=(i,c)=>{n({id_or_name:c,active:i},{onSuccess:()=>{v.success("Concurrency limit updated")},onError:o=>{const l=o.message||"Unknown error while updating active field.";console.error(l)}})},r=s.getValue(),t=s.row.original.id;return e.jsx(ee,{"aria-label":"toggle active",checked:r,onCheckedChange:i=>a(i,t)})},B=N("/concurrency-limits/"),b=Y(),Ve=({onEditRow:s,onDeleteRow:n})=>[b.accessor("name",{header:"Name"}),b.accessor("limit",{header:"Limit"}),b.accessor("active_slots",{header:"Active Slots"}),b.accessor("slot_decay_per_second",{header:"Slots Decay Per Second"}),b.accessor("active",{header:"Active",cell:_e}),b.display({id:"actions",cell:a=>e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Ne,{...a,onEditRow:s,onDeleteRow:n})})})],Ee=({data:s,onEditRow:n,onDeleteRow:a})=>{const r=B.useNavigate(),{search:t}=B.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.name.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Ge,{data:c,onDeleteRow:a,onEditRow:n,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Ge({data:s,onDeleteRow:n,onEditRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:Ve({onDeleteRow:n,onEditRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search global concurrency limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Me=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"AlignVerticalJustifyStart"}),e.jsx(re,{children:"Add a concurrency limit"}),e.jsx(te,{children:"Global concurrency limits can be applied to flow runs, task runs and any operation where you want to control concurrency."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"global-concurrency-guide"})]})]}),Fe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Global Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add global concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),Ie=z({active:ke().default(!0),denied_slots:L().default(0).or(h()).pipe(S.number()),limit:L().default(0).or(h()).pipe(S.number()),name:h().min(2,{message:"Name must be at least 2 characters"}).default(""),slot_decay_per_second:L().default(0).or(h()).pipe(S.number()),active_slots:L().default(0).or(h()).pipe(S.number())}),A={active:!0,name:"",limit:0,slot_decay_per_second:0,denied_slots:0,active_slots:0},Oe=({limitToUpdate:s,onSubmit:n})=>{const{createGlobalConcurrencyLimit:a,status:r}=xe(),{updateGlobalConcurrencyLimit:t,status:i}=Z(),c=ue({resolver:de(Ie),defaultValues:A});return p.useEffect(()=>{if(s){const{active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me}=s;c.reset({active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me})}else c.reset(A)},[c,s]),{form:c,saveOrUpdate:l=>{const D=()=>{c.reset(A),n()};s?.id?t({id_or_name:s.id,...l},{onSuccess:()=>{v.success("Limit updated")},onError:f=>{const w=f.message||"Unknown error while updating limit.";c.setError("root",{message:w})},onSettled:D}):a(l,{onSuccess:()=>{v.success("Limit created")},onError:f=>{const w=f.message||"Unknown error while creating variable.";c.setError("root",{message:w})},onSettled:D})},isLoading:r==="pending"||i==="pending"}},H=({limitToUpdate:s,onOpenChange:n,onSubmit:a})=>{const{form:r,isLoading:t,saveOrUpdate:i}=Oe({limitToUpdate:s,onSubmit:a}),c=s?`Update ${s.name}`:"Add Concurrency Limit";return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:c})}),e.jsx(le,{...r,children:e.jsxs("form",{onSubmit:o=>{r.handleSubmit(i)(o)},className:"space-y-4",children:[e.jsx(u,{children:r.formState.errors.root?.message}),e.jsx(x,{control:r.control,name:"name",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Name"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"limit",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"slot_decay_per_second",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Slot Decay Per Second"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),s&&e.jsx(x,{control:r.control,name:"active_slots",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active Slots"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"active",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active"}),e.jsx(y,{children:e.jsx(ee,{className:"block",checked:o.value,onCheckedChange:o.onChange})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:t,children:s?"Update":"Save"})]})]})})]})})},Pe=({limit:s,onOpenChange:n,onDelete:a})=>{const{deleteGlobalConcurrencyLimit:r,isPending:t}=je(),i=c=>{r(c,{onSuccess:()=>{v.success("Concurrency limit deleted")},onError:o=>{const l=o.message||"Unknown error while deleting concurrency limit.";console.error(l)},onSettled:a})};return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{children:[e.jsx(F,{children:e.jsx(I,{children:"Delete Concurrency Limit"})}),e.jsxs(ge,{children:["Are you sure you want to delete ",s.name]}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{variant:"destructive",onClick:()=>i(s.id),loading:t,children:"Delete"})]})]})})},ze=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(H,{onOpenChange:a,onSubmit:n});case"delete":return e.jsx(Pe,{limit:t,onOpenChange:a,onDelete:n});case"edit":return e.jsx(H,{onOpenChange:a,limitToUpdate:t,onSubmit:n});default:return null}},$e=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=ye(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"edit",data:l}),i=l=>n({dialog:"delete",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Fe,{onAdd:r}),a.length===0?e.jsx(Me,{onAdd:r}):e.jsx(Ee,{data:a,onEditRow:t,onDeleteRow:i}),e.jsx(ze,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},Ue=s=>{const a=s.getValue().length;return a===0?"None":a},Be=s=>{const n=s.getValue(),a=s.row.original.id;return e.jsx(he,{params:{id:a},to:"/concurrency-limits/concurrency-limit/$id",children:n})},q=N("/concurrency-limits/"),R=Y(),He=({onDeleteRow:s,onResetRow:n})=>[R.accessor("tag",{header:"Tag",cell:Be}),R.accessor("concurrency_limit",{header:"Slots"}),R.accessor("active_slots",{header:"Active Task Runs",cell:Ue}),R.display({id:"actions",cell:a=>{const r=a.row.original;return e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Re,{id:r.id,onDelete:()=>s(r),onReset:()=>n(r)})})}})],qe=({data:s,onDeleteRow:n,onResetRow:a})=>{const r=q.useNavigate(),{search:t}=q.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.tag.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Je,{data:c,onDeleteRow:n,onResetRow:a,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Je({data:s,onDeleteRow:n,onResetRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:He({onDeleteRow:n,onResetRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search active task limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Ke=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"CircleArrowOutUpRight"}),e.jsx(re,{children:"Add a concurrency limit for your task runs"}),e.jsx(te,{children:"Creating a limit allows you to limit the number of tasks running simultaneously with a given tag."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"task-concurrency-guide"})]})]}),Qe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Task Run Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add task run concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),We=z({tag:h().min(1),concurrency_limit:L().default(0).or(h()).pipe(S.number())}),J={tag:"",concurrency_limit:0},Xe=({onOpenChange:s,onSubmit:n})=>{const{createTaskRunConcurrencyLimit:a,isPending:r}=pe(),t=ue({resolver:de(We),defaultValues:J}),i=c=>{a(c,{onSuccess:()=>{v.success("Concurrency limit added")},onError:o=>{const l=o.message||"Unknown error while updating limit.";t.setError("root",{message:l})},onSettled:()=>{t.reset(J),n()}})};return e.jsx(G,{open:!0,onOpenChange:s,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:"Add Task Run Concurrency Limit"})}),e.jsx(le,{...t,children:e.jsxs("form",{onSubmit:c=>{t.handleSubmit(i)(c)},className:"space-y-4",children:[e.jsx(u,{children:t.formState.errors.root?.message}),e.jsx(x,{control:t.control,name:"tag",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Tag"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...c})}),e.jsx(u,{})]})}),e.jsx(x,{control:t.control,name:"concurrency_limit",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...c})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:r,children:"Add"})]})]})})]})})},Ye=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(Xe,{onOpenChange:a,onSubmit:n});case"reset":return e.jsx(Ae,{data:t,onOpenChange:a,onReset:n});case"delete":return e.jsx(Te,{data:t,onOpenChange:a,onDelete:n});default:return null}},Ze=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=be(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"delete",data:l}),i=l=>n({dialog:"reset",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Qe,{onAdd:r}),a.length===0?e.jsx(Ke,{onAdd:r}):e.jsx(qe,{data:a,onDeleteRow:t,onResetRow:i}),e.jsx(Ye,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},K=N("/concurrency-limits/"),m={global:{tabSearchValue:"global",displayValue:"Global"},"task-run":{tabSearchValue:"task-run",displayValue:"Task Run"}},es=({globalView:s,taskRunView:n})=>{const{tab:a}=K.useSearch(),r=K.useNavigate();return e.jsxs(Ce,{defaultValue:"Global",value:a,children:[e.jsxs(ve,{children:[e.jsx($,{value:m.global.tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m.global.tabSearchValue}})},children:m.global.displayValue}),e.jsx($,{value:m["task-run"].tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m["task-run"].tabSearchValue}})},children:m["task-run"].displayValue})]}),e.jsx(U,{value:m.global.tabSearchValue,children:s}),e.jsx(U,{value:m["task-run"].tabSearchValue,children:n})]})},ss=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(ns,{}),e.jsx(es,{globalView:e.jsx($e,{}),taskRunView:e.jsx(Ze,{})})]}),ns=()=>e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Concurrency"})})})});z({search:h().optional(),tab:De(["global","task-run"]).default("global")});const gs=ss;export{gs as component};
2
- //# sourceMappingURL=index-7i4X9TeK.js.map