mage-ai 0.9.68__py3-none-any.whl → 0.9.70__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.

Potentially problematic release.


This version of mage-ai might be problematic. Click here for more details.

Files changed (316) hide show
  1. mage_ai/api/policies/BackfillPolicy.py +1 -0
  2. mage_ai/api/policies/PipelinePolicy.py +1 -0
  3. mage_ai/api/policies/WorkspacePolicy.py +1 -0
  4. mage_ai/api/presenters/BackfillPresenter.py +1 -0
  5. mage_ai/api/resources/GitBranchResource.py +56 -23
  6. mage_ai/api/resources/GitCustomBranchResource.py +29 -1
  7. mage_ai/api/resources/OauthResource.py +1 -1
  8. mage_ai/api/resources/PipelineResource.py +11 -5
  9. mage_ai/api/resources/PipelineRunResource.py +41 -4
  10. mage_ai/api/resources/PipelineScheduleResource.py +4 -0
  11. mage_ai/api/resources/PullRequestResource.py +6 -4
  12. mage_ai/api/resources/SeedResource.py +2 -1
  13. mage_ai/api/resources/SessionResource.py +13 -1
  14. mage_ai/api/resources/WorkspaceResource.py +5 -4
  15. mage_ai/authentication/permissions/constants.py +2 -0
  16. mage_ai/authentication/permissions/seed.py +32 -21
  17. mage_ai/authentication/providers/active_directory.py +4 -3
  18. mage_ai/authentication/providers/okta.py +22 -83
  19. mage_ai/cache/block_action_object/__init__.py +1 -1
  20. mage_ai/cluster_manager/kubernetes/workload_manager.py +52 -1
  21. mage_ai/cluster_manager/workspace/base.py +6 -0
  22. mage_ai/cluster_manager/workspace/kubernetes.py +22 -1
  23. mage_ai/command_center/applications/utils.py +2 -2
  24. mage_ai/command_center/presenters/text.py +1 -1
  25. mage_ai/data_preparation/executors/k8s_block_executor.py +30 -7
  26. mage_ai/data_preparation/executors/k8s_pipeline_executor.py +30 -7
  27. mage_ai/data_preparation/executors/streaming_pipeline_executor.py +78 -8
  28. mage_ai/data_preparation/git/__init__.py +50 -22
  29. mage_ai/data_preparation/git/api.py +62 -7
  30. mage_ai/data_preparation/git/utils.py +45 -21
  31. mage_ai/data_preparation/models/block/__init__.py +31 -8
  32. mage_ai/data_preparation/models/block/data_integration/mixins.py +16 -5
  33. mage_ai/data_preparation/models/block/dynamic/child.py +3 -0
  34. mage_ai/data_preparation/models/block/dynamic/utils.py +9 -4
  35. mage_ai/data_preparation/models/block/dynamic/variables.py +2 -2
  36. mage_ai/data_preparation/models/block/extension/utils.py +1 -0
  37. mage_ai/data_preparation/models/block/global_data_product/__init__.py +25 -2
  38. mage_ai/data_preparation/models/block/integration/__init__.py +1 -1
  39. mage_ai/data_preparation/models/block/remote/__init__.py +0 -0
  40. mage_ai/data_preparation/models/block/remote/models.py +58 -0
  41. mage_ai/data_preparation/models/block/sql/__init__.py +1 -1
  42. mage_ai/data_preparation/models/block/utils.py +38 -0
  43. mage_ai/data_preparation/models/constants.py +2 -0
  44. mage_ai/data_preparation/models/global_data_product/__init__.py +12 -0
  45. mage_ai/data_preparation/models/pipeline.py +31 -11
  46. mage_ai/data_preparation/models/triggers/__init__.py +4 -2
  47. mage_ai/data_preparation/models/utils.py +6 -0
  48. mage_ai/data_preparation/models/variable.py +18 -4
  49. mage_ai/data_preparation/repo_manager.py +3 -2
  50. mage_ai/data_preparation/shared/utils.py +1 -1
  51. mage_ai/data_preparation/storage/local_storage.py +12 -6
  52. mage_ai/data_preparation/templates/data_exporters/mysql.py +2 -2
  53. mage_ai/data_preparation/templates/data_exporters/oracledb.py +27 -0
  54. mage_ai/data_preparation/templates/repo/metadata.yaml +1 -0
  55. mage_ai/io/bigquery.py +131 -58
  56. mage_ai/io/mysql.py +38 -6
  57. mage_ai/io/snowflake.py +152 -29
  58. mage_ai/orchestration/db/migrations/versions/42a14d6143f1_update_token_column_type.py +54 -0
  59. mage_ai/orchestration/db/models/oauth.py +14 -13
  60. mage_ai/orchestration/db/models/schedules.py +30 -2
  61. mage_ai/orchestration/job_manager.py +6 -0
  62. mage_ai/orchestration/notification/sender.py +37 -15
  63. mage_ai/orchestration/pipeline_scheduler_original.py +48 -31
  64. mage_ai/orchestration/queue/celery_queue.py +8 -1
  65. mage_ai/orchestration/queue/process_queue.py +67 -4
  66. mage_ai/orchestration/queue/queue.py +8 -0
  67. mage_ai/orchestration/triggers/api.py +29 -1
  68. mage_ai/orchestration/triggers/global_data_product.py +9 -4
  69. mage_ai/orchestration/triggers/utils.py +10 -1
  70. mage_ai/orchestration/utils/resources.py +3 -0
  71. mage_ai/server/api/downloads.py +4 -1
  72. mage_ai/server/api/runs.py +151 -0
  73. mage_ai/server/constants.py +1 -1
  74. mage_ai/server/frontend_dist/404.html +6 -6
  75. mage_ai/server/frontend_dist/_next/static/{i8pymuJDTVHdWjUP1QSh1 → RhDiJSkcjCsh4xxX4BFBk}/_buildManifest.js +1 -1
  76. mage_ai/server/frontend_dist/_next/static/chunks/1557-b3502f3f1aa92ac7.js +1 -0
  77. mage_ai/server/frontend_dist/_next/static/chunks/2717-d9200be634dd6766.js +1 -0
  78. mage_ai/server/frontend_dist/_next/static/chunks/3548-9d26185b3fb663b1.js +1 -0
  79. mage_ai/server/frontend_dist/_next/static/chunks/5699-6d708c6b2153ea08.js +1 -0
  80. mage_ai/server/frontend_dist/_next/static/chunks/7361-8a23dd8360593e7a.js +1 -0
  81. mage_ai/server/frontend_dist/_next/static/chunks/7966-b9b85ba10667e654.js +1 -0
  82. mage_ai/server/frontend_dist/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
  83. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +1 -0
  84. mage_ai/server/frontend_dist/_next/static/chunks/pages/index-4e12783b064c1cfe.js +1 -0
  85. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
  86. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-a66b4c7641ae03eb.js → frontend_dist/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
  87. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7181b086c93784d2.js +1 -0
  88. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
  89. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +1 -0
  90. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +1 -0
  91. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
  92. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-cb88fd075a357fcf.js → triggers-4612d15a65c35912.js} +1 -1
  93. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-3591d035bb3bb2b8.js +1 -0
  94. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js +1 -0
  95. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js +1 -0
  96. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +1 -0
  97. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +1 -0
  98. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-86814e581acaf5db.js → users-a4db8710f703c729.js} +1 -1
  99. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-09414a8b66fb6f06.js +1 -0
  100. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/triggers-9cba3211434a8966.js → frontend_dist/_next/static/chunks/pages/triggers-a599c6ac89be8c8d.js} +1 -1
  101. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +1 -0
  102. mage_ai/server/frontend_dist/block-layout.html +2 -2
  103. mage_ai/server/frontend_dist/compute.html +2 -2
  104. mage_ai/server/frontend_dist/files.html +2 -2
  105. mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
  106. mage_ai/server/frontend_dist/global-data-products.html +2 -2
  107. mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
  108. mage_ai/server/frontend_dist/global-hooks.html +2 -2
  109. mage_ai/server/frontend_dist/index.html +2 -2
  110. mage_ai/server/frontend_dist/manage/files.html +2 -2
  111. mage_ai/server/frontend_dist/manage/settings.html +2 -2
  112. mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
  113. mage_ai/server/frontend_dist/manage/users/new.html +2 -2
  114. mage_ai/server/frontend_dist/manage/users.html +2 -2
  115. mage_ai/server/frontend_dist/manage.html +2 -2
  116. mage_ai/server/frontend_dist/oauth.html +2 -2
  117. mage_ai/server/frontend_dist/overview.html +2 -2
  118. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  119. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  120. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  121. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
  122. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  123. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  124. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  125. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  126. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  127. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  128. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  129. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  130. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  131. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  132. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  133. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  134. mage_ai/server/frontend_dist/pipelines.html +2 -2
  135. mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +2 -2
  136. mage_ai/server/frontend_dist/platform/global-hooks.html +2 -2
  137. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  138. mage_ai/server/frontend_dist/settings/platform/preferences.html +2 -2
  139. mage_ai/server/frontend_dist/settings/platform/settings.html +2 -2
  140. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
  141. mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
  142. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  143. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
  144. mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
  145. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  146. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
  147. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  148. mage_ai/server/frontend_dist/settings.html +2 -2
  149. mage_ai/server/frontend_dist/sign-in.html +6 -6
  150. mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
  151. mage_ai/server/frontend_dist/templates.html +2 -2
  152. mage_ai/server/frontend_dist/terminal.html +2 -2
  153. mage_ai/server/frontend_dist/test.html +2 -2
  154. mage_ai/server/frontend_dist/triggers.html +2 -2
  155. mage_ai/server/frontend_dist/version-control.html +2 -2
  156. mage_ai/server/frontend_dist_base_path_template/404.html +6 -6
  157. mage_ai/server/frontend_dist_base_path_template/_next/static/{CKCvjsYCf2imD2X8zAOBf → TdpLLFome13qvM0gXvpHs}/_buildManifest.js +1 -1
  158. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-b3502f3f1aa92ac7.js +1 -0
  159. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-d9200be634dd6766.js +1 -0
  160. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-9d26185b3fb663b1.js +1 -0
  161. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-6d708c6b2153ea08.js +1 -0
  162. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-8a23dd8360593e7a.js +1 -0
  163. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-b9b85ba10667e654.js +1 -0
  164. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
  165. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +1 -0
  166. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-4e12783b064c1cfe.js +1 -0
  167. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
  168. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipeline-runs-a66b4c7641ae03eb.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
  169. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7181b086c93784d2.js +1 -0
  170. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
  171. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +1 -0
  172. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +1 -0
  173. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
  174. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-cb88fd075a357fcf.js → triggers-4612d15a65c35912.js} +1 -1
  175. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-3591d035bb3bb2b8.js +1 -0
  176. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js +1 -0
  177. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js +1 -0
  178. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +1 -0
  179. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +1 -0
  180. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-86814e581acaf5db.js → users-a4db8710f703c729.js} +1 -1
  181. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-09414a8b66fb6f06.js +1 -0
  182. mage_ai/server/{frontend_dist/_next/static/chunks/pages/triggers-9cba3211434a8966.js → frontend_dist_base_path_template/_next/static/chunks/pages/triggers-a599c6ac89be8c8d.js} +1 -1
  183. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +1 -0
  184. mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
  185. mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
  186. mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
  187. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
  188. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
  189. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +2 -2
  190. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +2 -2
  191. mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
  192. mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
  193. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
  194. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
  195. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
  196. mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
  197. mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
  198. mage_ai/server/frontend_dist_base_path_template/oauth.html +2 -2
  199. mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
  200. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
  201. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  202. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
  203. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
  204. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
  205. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
  206. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  207. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  208. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
  209. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
  210. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
  211. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
  212. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
  213. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  214. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
  215. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
  216. mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
  217. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +2 -2
  218. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +2 -2
  219. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
  220. mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +2 -2
  221. mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +2 -2
  222. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
  223. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
  224. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
  225. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
  226. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
  227. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
  228. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
  229. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
  230. mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
  231. mage_ai/server/frontend_dist_base_path_template/sign-in.html +6 -6
  232. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
  233. mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
  234. mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
  235. mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
  236. mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
  237. mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
  238. mage_ai/server/scheduler_manager.py +9 -0
  239. mage_ai/server/server.py +47 -17
  240. mage_ai/server/utils/output_display.py +2 -2
  241. mage_ai/server/websocket_server.py +1 -0
  242. mage_ai/services/aws/ecs/ecs.py +1 -0
  243. mage_ai/services/k8s/config.py +4 -4
  244. mage_ai/services/k8s/utils.py +97 -0
  245. mage_ai/settings/keys/auth.py +2 -0
  246. mage_ai/settings/server.py +1 -1
  247. mage_ai/shared/parsers.py +6 -1
  248. mage_ai/streaming/sources/influxdb.py +2 -0
  249. mage_ai/streaming/sources/kafka.py +1 -1
  250. mage_ai/tests/api/endpoints/mixins.py +10 -9
  251. mage_ai/tests/api/endpoints/test_seeds.py +24 -0
  252. mage_ai/tests/api/operations/base/mixins.py +1 -1
  253. mage_ai/tests/api/operations/test_sessions.py +53 -2
  254. mage_ai/tests/api/resources/test_pipeline_resource.py +2 -2
  255. mage_ai/tests/authentication/oauth/test_utils.py +1 -1
  256. mage_ai/tests/authentication/providers/test_okta.py +43 -0
  257. mage_ai/tests/data_preparation/models/block/test_global_data_product.py +2 -0
  258. mage_ai/tests/orchestration/db/models/test_oauth.py +3 -3
  259. mage_ai/tests/orchestration/queue/test_process_queue.py +1 -0
  260. mage_ai/tests/orchestration/triggers/test_global_data_product.py +138 -136
  261. mage_ai/tests/server/test_server.py +27 -4
  262. mage_ai/tests/services/k8s/test_job_manager.py +9 -6
  263. mage_ai/version_control/branch/utils.py +2 -1
  264. mage_ai/version_control/models.py +3 -2
  265. {mage_ai-0.9.68.dist-info → mage_ai-0.9.70.dist-info}/METADATA +5 -5
  266. {mage_ai-0.9.68.dist-info → mage_ai-0.9.70.dist-info}/RECORD +272 -264
  267. mage_ai/server/frontend_dist/_next/static/chunks/1557-01f0843dc6ac4971.js +0 -1
  268. mage_ai/server/frontend_dist/_next/static/chunks/2717-b5f9575799b594d5.js +0 -1
  269. mage_ai/server/frontend_dist/_next/static/chunks/3548-961ff79ca70038c7.js +0 -1
  270. mage_ai/server/frontend_dist/_next/static/chunks/5699-6efc749f2f8ddd20.js +0 -1
  271. mage_ai/server/frontend_dist/_next/static/chunks/7361-18d9d8be96e1ce97.js +0 -1
  272. mage_ai/server/frontend_dist/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
  273. mage_ai/server/frontend_dist/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
  274. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-08790743315de36a.js +0 -1
  275. mage_ai/server/frontend_dist/_next/static/chunks/pages/index-13760bb72d823b69.js +0 -1
  276. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
  277. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
  278. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
  279. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-bd0aff5a5ed8888c.js +0 -1
  280. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-d1ee961387c58b7f.js +0 -1
  281. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
  282. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-ceb06e1616ee9610.js +0 -1
  283. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-8ff16ef9566e911a.js +0 -1
  284. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-74d76300942dcee8.js +0 -1
  285. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-d7a8bc51bb7a1082.js +0 -1
  286. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-79a4cf66a623e667.js +0 -1
  287. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-f59d34429fe022ee.js +0 -1
  288. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
  289. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-01f0843dc6ac4971.js +0 -1
  290. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-b5f9575799b594d5.js +0 -1
  291. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-961ff79ca70038c7.js +0 -1
  292. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-6efc749f2f8ddd20.js +0 -1
  293. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-18d9d8be96e1ce97.js +0 -1
  294. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
  295. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
  296. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-08790743315de36a.js +0 -1
  297. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-13760bb72d823b69.js +0 -1
  298. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
  299. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
  300. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
  301. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-bd0aff5a5ed8888c.js +0 -1
  302. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-d1ee961387c58b7f.js +0 -1
  303. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
  304. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-ceb06e1616ee9610.js +0 -1
  305. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-8ff16ef9566e911a.js +0 -1
  306. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-74d76300942dcee8.js +0 -1
  307. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-d7a8bc51bb7a1082.js +0 -1
  308. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-79a4cf66a623e667.js +0 -1
  309. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-f59d34429fe022ee.js +0 -1
  310. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
  311. /mage_ai/server/frontend_dist/_next/static/{i8pymuJDTVHdWjUP1QSh1 → RhDiJSkcjCsh4xxX4BFBk}/_ssgManifest.js +0 -0
  312. /mage_ai/server/frontend_dist_base_path_template/_next/static/{CKCvjsYCf2imD2X8zAOBf → TdpLLFome13qvM0gXvpHs}/_ssgManifest.js +0 -0
  313. {mage_ai-0.9.68.dist-info → mage_ai-0.9.70.dist-info}/LICENSE +0 -0
  314. {mage_ai-0.9.68.dist-info → mage_ai-0.9.70.dist-info}/WHEEL +0 -0
  315. {mage_ai-0.9.68.dist-info → mage_ai-0.9.70.dist-info}/entry_points.txt +0 -0
  316. {mage_ai-0.9.68.dist-info → mage_ai-0.9.70.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2717],{8916:function(e,n,t){t.d(n,{FS:function(){return s},JZ:function(){return v},Tt:function(){return d},e7:function(){return h},wx:function(){return a}});var i=t(75582),r=t(82394),l=t(83784),o=t(30229);function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e){return"string"===typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(i=t.variables)||void 0===i?void 0:i.map((function(e){var n=e.value;return c(c({},e),{},{value:s(n)})}))}function d(e){var n;return null===(n=a(e,(function(e){return e.uuid===l.C})))||void 0===n?void 0:n.reduce((function(e,n){var t=n.uuid,i=n.value;return c(c({},e),{},(0,r.Z)({},t,i))}),{})}function v(e,n){return n===o.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===o.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function h(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),l=t[0],o=t[1],u=o;try{u=JSON.parse(o)}catch(s){}return c(c({},e),{},(0,r.Z)({},l,u))}),{}):e}},81334:function(e,n,t){t.d(n,{Z:function(){return _}});var i=t(82394),r=t(82684),l=t(27277),o=t(31882),u=t(38276),c=t(48381),s=t(30160),a=t(17488),d=t(25976),v=t(44897),h=t(42631),p=t(47041),f=t(70515),m=d.default.div.withConfig({displayName:"indexstyle__DropdownStyle",componentId:"sc-suwkha-0"})([""," border-radius:","px;max-height:","px;overflow:auto;position:absolute;width:100%;z-index:1;"," ",""],p.w5,h.BG,40*f.iI,(function(e){return"\n background-color: ".concat((e.theme.background||v.Z.background).popup,";\n box-shadow: ").concat((e.theme.shadow||v.Z.shadow).popup,";\n ")}),(function(e){return e.topOffset&&"\n top: ".concat(e.topOffset-.5*f.iI,"px;\n ")})),j=d.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-suwkha-1"})(["padding:","px;position:relative;z-index:2;&:hover{cursor:pointer;}",""],.5*f.iI,(function(e){return e.highlighted&&"\n background-color: ".concat((e.theme.interactive||v.Z.interactive).hoverBackground,";\n ")})),x=t(39643),g=t(95924),Z=t(86735),b=t(44688),y=t(28598);function P(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?P(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _=function(e){var n,t=e.removeTag,i=e.selectTag,d=e.selectedTags,v=void 0===d?[]:d,h=e.tags,p=void 0===h?[]:h,f=e.uuid,P=(0,r.useRef)(null),_=(0,r.useState)(!1),k=_[0],S=_[1],w=(0,r.useState)(null),C=w[0],I=w[1],T=(0,r.useMemo)((function(){return(0,Z.YC)(p||[],"uuid")}),[p]),E=(0,r.useMemo)((function(){return null===T||void 0===T?void 0:T.map((function(e){return{itemObject:e,searchQueries:[e.uuid],value:e.uuid}}))}),[T]),M=(0,r.useMemo)((function(){return(null===C||void 0===C?void 0:C.length)>=1?E.concat({itemObject:{uuid:C},searchQueries:[C],value:"Add tag: ".concat(C)}):E}),[E,C]),D=(0,b.y)(),N=D.registerOnKeyDown,A=D.unregisterOnKeyDown;return(0,r.useEffect)((function(){return function(){return A(f)}}),[A,f]),null===N||void 0===N||N(f,(function(e,n){var t;k&&n[x.vP]&&(S(!1),null===P||void 0===P||null===(t=P.current)||void 0===t||t.blur())}),[k,P]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(c.Z,{onClickTag:t,tags:v}),(0,y.jsxs)(u.Z,{mt:1,style:{position:"relative"},children:[(0,y.jsx)(a.Z,{onBlur:function(){return setTimeout((function(){return S(!1)}),150)},onChange:function(e){return I(e.target.value)},onFocus:function(){return S(!0)},ref:P,value:C||""}),(0,y.jsx)(m,{topOffset:null===P||void 0===P||null===(n=P.current)||void 0===n?void 0:n.getBoundingClientRect().height,children:(0,y.jsx)(l.Z,{eventProperties:{eventParameters:{item_type:"tag"}},itemGroups:[{items:k?M:[],renderItem:function(e,n){var t=e.value;return(0,y.jsx)(j,O(O({},n),{},{onClick:function(e){var t;(0,g.j)(e),null===n||void 0===n||null===(t=n.onClick)||void 0===t||t.call(n,e)},children:(0,y.jsx)(o.Z,{small:!0,children:(0,y.jsx)(s.ZP,{children:t})})}))}}],onSelectItem:function(e){var n=e.itemObject;null===i||void 0===i||i(n),I(null)},searchQuery:C,uuid:f})})]})]})}},71610:function(e,n,t){var i=t(82394),r=t(75582),l=t(12691),o=t.n(l),u=t(25976),c=t(82684),s=t(32013),a=t(98777),d=t(15338),v=t(48670),h=t(88543),p=t(38276),f=t(4190),m=t(75499),j=t(30160),x=t(35686),g=t(70515),Z=t(30229),b=t(32080),y=t(81728),P=t(3917),O=t(55283),_=t(70320),k=t(28598);function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function w(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?S(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):S(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var C={large:!1};n.Z=function(e){var n=e.bookmarkValues,t=e.originalBookmarkValues,l=e.setBookmarkValues,S=e.pipeline,I=(0,c.useContext)(u.ThemeContext),T=(0,_.qB)(),E=(0,c.useState)(null),M=E[0],D=E[1],N=(0,c.useMemo)((function(){return null!==S&&void 0!==S&&S.blocks?(0,b.n)(S):null}),[S]),A=(0,c.useMemo)((function(){return Object.keys(N||{})||[]}),[N]),L=x.ZP.integration_sources.pipelines.list(null===S||void 0===S?void 0:S.uuid,{block_uuid:A},{},{pauseFetch:!(null!==A&&void 0!==A&&A.length)}).data,H=(0,c.useMemo)((function(){return null===L||void 0===L?void 0:L.integration_sources}),[L]);return(0,c.useEffect)((function(){if((null===H||void 0===H?void 0:H.length)>=1&&(!n||!M)){var e={};null===H||void 0===H||H.map((function(n){var t,i=n.block,l=n.streams,o=null===i||void 0===i?void 0:i.uuid;e[o]={},null===(t=Object.entries(l||{}))||void 0===t||t.forEach((function(n){var t,i,l=(0,r.Z)(n,2),u=l[0],c=l[1];e[o][u]=null===c||void 0===c||null===(t=c.state)||void 0===t||null===(i=t.bookmarks)||void 0===i?void 0:i[u]}))})),n||l(e),M||D(e)}}),[n,M,l,D,H]),(0,k.jsxs)(p.Z,{p:g.cd,children:[!L&&(0,k.jsx)(f.Z,{inverted:!0,small:!0}),null===H||void 0===H?void 0:H.map((function(e){var u=e.block,f=e.pipeline_run,x=e.pipeline_schedule,b=e.streams,_=null===u||void 0===u?void 0:u.uuid;return(0,k.jsx)(h.Z,{title:(0,k.jsx)(j.ZP,{color:(0,O.qn)(null===u||void 0===u?void 0:u.type,{blockColor:null===u||void 0===u?void 0:u.color,theme:I}).accent,monospace:!0,children:_}),children:(0,k.jsx)(s.Z,{noBorder:!0,noBoxShadow:!0,children:Object.entries(b||{}).map((function(e){var u,s,b,O,I=(0,r.Z)(e,2),E=I[0],D=I[1],N=D.record,A=D.state,L=(null===A||void 0===A||null===(u=A.bookmarks)||void 0===u?void 0:u[E])||{};return(0,k.jsxs)(a.Z,{noBorderRadius:!0,noPaddingContent:!0,title:(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:E}),titleXPadding:g.cd*g.iI,titleYPadding:g.cd*g.iI,children:[(0,k.jsx)(h.S,w(w({},C),{},{title:"Last pipeline run started at",children:(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:(null===f||void 0===f?void 0:f.started_at)&&(0,P.XG)(null===f||void 0===f?void 0:f.started_at,T)})})),(0,k.jsx)(d.Z,{light:!0}),(0,k.jsx)(h.S,w(w({},C),{},{title:"Last pipeline run completed at",children:(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:(null===f||void 0===f?void 0:f.completed_at)&&(0,P.XG)(null===f||void 0===f?void 0:f.completed_at,T)})})),(0,k.jsx)(d.Z,{light:!0}),(0,k.jsx)(d.Z,{light:!0}),(0,k.jsx)(h.S,w(w({},C),{},{title:"Trigger",children:(0,k.jsx)(o(),{as:"/pipelines/".concat(null===S||void 0===S?void 0:S.uuid,"/triggers/").concat(null===x||void 0===x?void 0:x.id),href:"/pipelines/[pipeline]/triggers/[...slug]",passHref:!0,children:(0,k.jsx)(v.Z,{block:!0,default:!0,openNewWindow:!0,children:(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:null===x||void 0===x?void 0:x.name})})})})),(0,k.jsx)(d.Z,{light:!0}),(0,k.jsx)(h.S,w(w({},C),{},{title:"Type",children:(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:(0,y.kC)((null===(s=Z.Z4[null===x||void 0===x?void 0:x.schedule_type])||void 0===s?void 0:s.call(Z.Z4))||"")})})),(0,k.jsx)(d.Z,{light:!0}),(0,k.jsx)(h.S,w(w({},C),{},{title:"Frequency",children:(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:null===x||void 0===x?void 0:x.schedule_interval})})),(0,k.jsx)(d.Z,{light:!0}),(0,k.jsxs)(p.Z,{p:g.cd,children:[(0,k.jsx)(j.ZP,{bold:!0,large:!0,children:"Bookmark values"}),(0,k.jsx)(p.Z,{mt:1,children:(0,k.jsxs)(j.ZP,{muted:!0,small:!0,children:["Overriding the bookmark values will be applied to all pipeline runs",(0,k.jsx)("br",{}),"for this trigger until there is at least 1 successful pipeline run in this trigger."]})})]}),(0,k.jsx)(d.Z,{light:!0,short:!0}),!(null!==(b=Object.values(L||{}))&&void 0!==b&&b.length)&&(0,k.jsx)(p.Z,{p:g.cd,children:(0,k.jsx)(j.ZP,{muted:!0,children:"There are currently no bookmark values for this stream."})}),Object.entries(L||{}).map((function(e){var o,u,s,a,d,v,p=(0,r.Z)(e,2),f=p[0],m=(p[1],null===n||void 0===n||null===(o=n[_])||void 0===o||null===(u=o[E])||void 0===u?void 0:u[f]),x=(null===t||void 0===t||null===(s=t[_])||void 0===s||null===(a=s[E])||void 0===a||a[f],null===M||void 0===M||null===(d=M[_])||void 0===d||null===(v=d[E])||void 0===v?void 0:v[f]);return(0,c.createElement)(h.S,w(w({},C),{},{title:(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:f}),description:x&&x!==m&&(0,k.jsxs)(j.ZP,{muted:!0,small:!0,children:["Original bookmark value from the last pipeline run: ",(0,k.jsx)(j.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:x})]}),key:"".concat(_,"-bookmark-values-").concat(f),textInput:{monospace:!0,onChange:function(e){return l((function(t){var r;return w(w({},t),{},(0,i.Z)({},_,w(w({},null===n||void 0===n?void 0:n[_]),{},(0,i.Z)({},E,w(w({},null===n||void 0===n||null===(r=n[_])||void 0===r?void 0:r[E]),{},(0,i.Z)({},f,e.target.value))))))}))},value:String(m||"")}}))})),(0,k.jsx)(d.Z,{light:!0}),(0,c.createElement)(h.S,w(w({},C),{},{title:"Record",description:"The most recently synced record.",key:"block-uuid-".concat(_,"-").concat(E)}),(0,k.jsx)(m.Z,{columnFlex:[1,null],columns:[{uuid:"Column"},{uuid:"Value"}],rows:null===(O=Object.entries(N||{}))||void 0===O?void 0:O.map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:t},t),(0,k.jsx)(j.ZP,{default:!0,monospace:!0,children:String(i)},"".concat(t,"-").concat(i))]}))}))]})}))})})}))]})}},88785:function(e,n,t){t.d(n,{J:function(){return c},U:function(){return u}});var i=t(25976),r=t(44897),l=t(42631),o=t(70515),u=i.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-m7tlau-0"})(["border-radius:","px;border-style:solid;border-width:2px;height:","px;margin-right:","px;padding:","px;width:","px;"," ",""],l.TR,14*o.iI,o.cd*o.iI,o.cd*o.iI,40*o.iI,(function(e){return!e.selected&&"\n border-color: ".concat((e.theme.borders||r.Z.borders).light,";\n ")}),(function(e){return e.selected&&"\n border-color: ".concat((e.theme.interactive||r.Z.interactive).linkPrimary,";\n ")})),c=i.default.div.withConfig({displayName:"indexstyle__DateSelectionContainer",componentId:"sc-m7tlau-1"})(["border-radius:","px;padding:","px;"," "," ",""],l.n_,o.tr,(function(e){return"\n background-color: ".concat((e.theme.interactive||r.Z.interactive).defaultBackground,";\n ")}),(function(e){return e.absolute&&"\n position: absolute;\n z-index: 2;\n right: 0;\n top: ".concat(2.5*o.iI,"px;\n ")}),(function(e){return e.topPosition&&"\n top: -".concat(42*o.iI,"px;\n ")}))},12717:function(e,n,t){t.d(n,{Z:function(){return ze}});var i=t(21831),r=t(82394),l=t(75582),o=t(12691),u=t.n(o),c=t(82684),s=t(20026),a=t.n(s),d=t(92083),v=t.n(d),h=t(21764),p=t(69864),f=t(34376),m=t(71610),j=t(71180),x=t(90299),g=t(14805),Z=t(70652),b=t(50724),y=t(9134),P=t(39457),O=t(25976),_=t(39867),k=t(55485),S=t(85854),w=t(38276),C=t(75499),I=t(30160),T=t(17488),E=t(12468),M=t(44375),D=t(70515),N=t(55283),A=t(86735),L=t(28598);function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function q(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?H(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):H(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var z=function(e){var n=e.blocks,t=e.updateVariables,i=e.variables,l=(0,c.useContext)(O.ThemeContext),o=(0,c.useCallback)((function(e,n){return t((function(){var t=(null===i||void 0===i?void 0:i.__mage_variables)||{},l=(null===t||void 0===t?void 0:t.blocks)||{},o=l[e]||{},u=(null===o||void 0===o?void 0:o.configuration)||{};return q(q({},i),{},{__mage_variables:q(q({},t),{},{blocks:q(q({},l),{},(0,r.Z)({},e,q(q({},o),{},{configuration:q(q({},u),n)})))})})}))}),[t,i]);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(S.Z,{children:"dbt runtime settings"}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsx)(C.Z,{columnFlex:[1,null,null,null],columns:[{uuid:"Block"},{uuid:"Flags"},{uuid:"Prefix"},{uuid:"Suffix"}],compact:!0,rows:null===n||void 0===n?void 0:n.map((function(e){var n,t,r,u=e.type,c=e.uuid,s=(0,M.IU)(e).name,a=(0,N.qn)(u,{blockColor:e.color,theme:l}).accent,d=null===i||void 0===i||null===(n=i.__mage_variables)||void 0===n||null===(t=n.blocks)||void 0===t||null===(r=t[c])||void 0===r?void 0:r.configuration,v=d||{},h=v.prefix,p=v.suffix,f=(null===d||void 0===d?void 0:d.flags)||[],m=!(null===f||void 0===f||!f.includes(M.Dy));return[(0,L.jsx)(E.Z,{block:!0,label:(0,L.jsx)(I.ZP,{monospace:!0,small:!0,children:c}),size:null,widthFitContent:!0,children:(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(_.Z,{color:a,size:1.5*D.iI,square:!0}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsxs)(I.ZP,{monospace:!0,small:!0,children:[h&&(0,L.jsx)(I.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:h}),s,p&&(0,L.jsx)(I.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:p})]})]})},"uuid-".concat(c)),(0,L.jsx)(k.ZP,{alignItems:"center",children:(0,L.jsx)(Z.Z,{checked:m,label:M.Dy,monospace:!0,onClick:function(){return o(c,{flags:m?(0,A.Od)(f,(function(e){return M.Dy===e})):f.concat(M.Dy)})},small:!0})},"flags-".concat(c)),(0,L.jsx)(T.Z,{compact:!0,monospace:!0,onChange:function(e){return o(c,{prefix:e.target.value})},placeholder:"N+, +",small:!0,value:h,width:10*D.iI},"prefix-".concat(c)),(0,L.jsx)(T.Z,{compact:!0,monospace:!0,onChange:function(e){return o(c,{suffix:e.target.value})},placeholder:"+, +N",small:!0,value:p,width:10*D.iI},"suffix-".concat(c))]}))})})]})},U=t(97196),F=t(15338),R=t(97618),V=t(48670),W=t(26304),B=t(44897),Y=t(95363),X=t(61896),J=["children","large","lineHeight","ordered"];function G(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function K(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?G(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):G(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Q=(0,O.css)([""," "," "," "," "," "," "," "," "," ",""],(function(e){return!e.muted&&"\n color: ".concat((e.theme.content||B.Z.content).default,";\n ")}),(function(e){return e.muted&&"\n color: ".concat((e.theme.content||B.Z.content).muted,";\n ")}),(function(e){return e.inverted&&"\n color: ".concat((e.theme.content||B.Z.content).inverted,";\n ")}),(function(e){return e.color&&"\n color: ".concat(e.color,";\n ")}),(function(e){return!e.monospace&&"\n font-family: ".concat(Y.ry,";\n ")}),(function(e){return e.monospace&&"\n font-family: ".concat(Y.Vp,";\n ")}),(function(e){return e.large&&"\n ".concat(X.x_,"\n ")}),(function(e){return!e.large&&!e.small&&"\n ".concat(X.i3,"\n ")}),(function(e){return e.small&&"\n ".concat(X.J5,"\n ")}),(function(e){return e.lineHeight&&"\n line-height: ".concat(e.lineHeight,"px !important;\n ")})),$=O.default.ul.withConfig({displayName:"List__UnorderedListStyle",componentId:"sc-1f6yhbi-0"})(["",""],Q),ee=O.default.ol.withConfig({displayName:"List__OrderedListStyle",componentId:"sc-1f6yhbi-1"})(["",""],Q),ne=O.default.li.withConfig({displayName:"List__ListItemStyle",componentId:"sc-1f6yhbi-2"})(["",""],(function(e){return e.large&&e.marginTop&&"\n margin-top: ".concat(1*D.iI,"px;\n ")}));var te,ie=function(e){var n=e.children,t=e.large,i=e.lineHeight,r=e.ordered,l=(0,W.Z)(e,J),o=r?ee:$;return(0,L.jsx)(o,K(K({large:t,lineHeight:i},l),{},{children:c.Children.map(n,(function(e,n){var i;return(0,L.jsx)(ne,K(K({large:t,marginTop:n>=1},l),{},{children:c.cloneElement(e)}),(null===(i=e.props)||void 0===i?void 0:i.key)||n)}))}))},re=t(37899),le=t(75457),oe=t(30229),ue=t(57653),ce=t(83784),se=t(44085),ae=t(81334),de=t(69650),ve=t(81769),he=t(54193),pe=t(72473),fe=t(81728),me=t(16488),je=t(70320),xe=(te={},(0,r.Z)(te,he.zj.DATE,pe.CalendarDate),(0,r.Z)(te,he.zj.DATETIME,pe.Schedule),(0,r.Z)(te,he.zj.DICTIONARY,pe.DocumentIcon),(0,r.Z)(te,he.zj.FLOAT,pe.NumberWithDecimalHash),(0,r.Z)(te,he.zj.INTEGER,pe.NumberHash),(0,r.Z)(te,he.zj.LIST,pe.TodoList),(0,r.Z)(te,he.zj.STRING,pe.Alphabet),te);var ge=function(e){var n,t,i,r=e.containerRef,o=e.date,u=e.interactions,s=e.pipeline,a=e.pipelineInteraction,d=e.pipelineSchedule,v=e.setVariables,h=e.showSummary,p=e.time,f=e.triggerTypes,m=e.variables,j=(0,c.useMemo)((function(){return(0,A.HK)(u||[],(function(e){return e.uuid}))}),[u]),x=(0,c.useMemo)((function(){return(null===s||void 0===s?void 0:s.blocks)||[]}),[s]),g=(0,c.useMemo)((function(){return(null===a||void 0===a?void 0:a.blocks)||{}}),[a]),Z=(0,c.useMemo)((function(){var e=[];null===x||void 0===x||x.length;return null===x||void 0===x||x.map((function(n,t){var i=(n||{uuid:null}).uuid,l=(null===g||void 0===g?void 0:g[i])||[];null===l||void 0===l||l.length;e.push((0,L.jsx)(w.Z,{p:D.cd,children:null===l||void 0===l?void 0:l.map((function(e,n){return(0,L.jsx)(w.Z,{mt:n>=1?2*D.cd:0,children:(0,L.jsx)(ve.Z,{blockInteraction:e,containerRef:r,interaction:null===j||void 0===j?void 0:j[null===e||void 0===e?void 0:e.uuid],setVariables:v,variables:m})},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))}))})),e}),[x,r,j,v,m]),b=(0,je.qB)(),y=(0,c.useMemo)((function(){return o&&null!==p&&void 0!==p&&p.hour&&null!==p&&void 0!==p&&p.minute?(0,me.XM)(o,p,{convertToUtc:b,includeSeconds:!0,localTimezone:b}):null}),[o,b,p]),P=(0,c.useMemo)((function(){var e=[];null===x||void 0===x||x.length;return null===x||void 0===x||x.map((function(n,t){var i=(n||{uuid:null}).uuid,r=(null===g||void 0===g?void 0:g[i])||[];null===r||void 0===r||r.forEach((function(n,r){var o=null===j||void 0===j?void 0:j[null===n||void 0===n?void 0:n.uuid];Object.entries((null===o||void 0===o?void 0:o.variables)||{}).forEach((function(n,o){var u,c=(0,l.Z)(n,2),s=c[0],a=c[1],d=a.name,v=a.required,h=a.types,p=null===m||void 0===m?void 0:m[s],f="undefined"===typeof p,j=v&&f,x=(null===xe||void 0===xe?void 0:xe[h[0]])||pe.Alphabet,g=[];"undefined"!==typeof p?p&&Array.isArray(p||[])?null===p||void 0===p||p.forEach((function(e){g.push(e&&"object"===typeof e?g.push(JSON.stringify(e)):g.push(String(e)))})):p&&"object"===typeof p?Object.entries(p||{}).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0];n[1]&&g.push(String(t))})):g.push(String(p)):g.push(p||""),e.push([(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(x,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,monospace:!0,children:s})]},"".concat(i,"-").concat(s,"-label-").concat(d,"-").concat(t,"-").concat(r,"-").concat(o)),(0,L.jsx)(w.Z,{py:D.cd,children:(0,L.jsxs)(I.ZP,{danger:j,monospace:!j,muted:f,children:[f&&!j&&"-",j&&"This is required",!f&&!j&&(null===g||void 0===g||null===(u=g.map((function(e){return String(e)})))||void 0===u?void 0:u.join(", "))]})},"".concat(i,"-").concat(s,"-value-").concat(d,"-").concat(p,"-").concat(t,"-").concat(r,"-").concat(o))])}))}))})),(0,L.jsx)(C.Z,{columnFlex:[null,1],rows:e})}),[x,j,m]);return(0,L.jsxs)(L.Fragment,{children:[!h&&Z,h&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.Z,{p:D.cd,children:(0,L.jsx)(S.Z,{children:"Settings"})}),(0,L.jsx)(F.Z,{light:!0,short:!0}),(0,L.jsx)(C.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Lightning,{default:!0}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Trigger type"})]},"trigger_type"),(0,L.jsx)(w.Z,{py:D.cd,children:(0,L.jsx)(I.ZP,{danger:!(null!==d&&void 0!==d&&d.schedule_type),monospace:!0,children:null!==d&&void 0!==d&&d.schedule_type?null===f||void 0===f||null===(n=f.find((function(e){return e.uuid===(null===d||void 0===d?void 0:d.schedule_type)})))||void 0===n||null===(t=n.label)||void 0===t?void 0:t.call(n):"This is required"})},"trigger_type_input")],[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Alphabet,{default:!0}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Trigger name"})]},"trigger_name"),(0,L.jsx)(w.Z,{py:D.cd,children:(0,L.jsx)(I.ZP,{danger:!(null!==d&&void 0!==d&&d.name),monospace:!0,children:(null===d||void 0===d?void 0:d.name)||"This is required"})},"trigger_name_input")],[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Alphabet,{default:!0}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Trigger description"})]},"trigger_description"),(0,L.jsx)(w.Z,{py:D.cd,children:(0,L.jsx)(I.ZP,{monospace:!0,muted:!(null!==d&&void 0!==d&&d.description),children:(null===d||void 0===d?void 0:d.description)||"-"})},"trigger_description_input")],[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Schedule,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Frequency"})]},"frequency"),(0,L.jsx)(w.Z,{py:D.cd,children:(0,L.jsxs)(I.ZP,{danger:!(null!==d&&void 0!==d&&d.schedule_interval),monospace:!0,muted:!(null!==d&&void 0!==d&&d.schedule_interval),children:[(null===d||void 0===d?void 0:d.schedule_interval)&&(0,fe.vg)((null===d||void 0===d||null===(i=d.schedule_interval)||void 0===i?void 0:i.substring(1))||""),!(null!==d&&void 0!==d&&d.schedule_interval)&&"This is required"]})},"frequency_input")],[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.CalendarDate,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Start date and time"})]},"start_time"),(0,L.jsx)(w.Z,{py:D.cd,children:(0,L.jsx)(I.ZP,{danger:!y,monospace:!!y,muted:!y,children:y||"This is required"})},"start_time_input")]]}),(0,L.jsx)(w.Z,{p:D.cd,children:(0,L.jsx)(S.Z,{children:"Customize"})}),(0,L.jsx)(F.Z,{light:!0,short:!0}),P]})]})},Ze=t(35686),be=t(77417),ye=t(44425),Pe=t(88785),Oe=t(3917),_e=t(82359),ke=t(28795),Se=t(41143),we={label:function(){return"CUSTOMIZE"},uuid:"customize"},Ce={label:function(){return"SETTINGS"},uuid:"settings"},Ie={label:function(){return"REVIEW"},uuid:"review"},Te=[Ce,we,Ie],Ee=t(32080),Me=t(22286),De=t(79500),Ne=t(8916),Ae=t(42122),Le=t(72619);function He(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function qe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?He(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):He(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ze=function(e){var n=e.creatingWithLimitation,t=e.errors,o=e.fetchPipelineSchedule,s=e.onCancel,d=e.pipeline,O=e.pipelineSchedule,_=e.setErrors,E=e.variables,M=e.useCreateScheduleMutation,H=(0,be.Z)().project,q=(0,c.useRef)(null),W=(0,f.useRouter)(),B=(0,je.qB)(),Y=null===d||void 0===d?void 0:d.uuid,X=(0,c.useMemo)((function(){return null===O||void 0===O?void 0:O.id}),[O]),J=(null===d||void 0===d?void 0:d.type)===ue.qL.STREAMING,G=(0,c.useMemo)((function(){var e;return null===O||void 0===O||null===(e=O.variables)||void 0===e?void 0:e[oe.PN]}),[O]),K=(0,c.useState)(G?"string"===typeof G&&(0,fe.Pb)(G)?JSON.stringify(G):G:null),Q=K[0],$=K[1],ee=(0,c.useState)([]),ne=ee[0],te=ee[1],ve=(0,c.useState)(!0),he=ve[0],xe=ve[1],He=(0,c.useState)(!1),ze=He[0],Ue=He[1],Fe=(0,c.useState)(!1),Re=Fe[0],Ve=Fe[1],We=(0,c.useState)(null),Be=We[0],Ye=We[1],Xe=(0,c.useState)({}),Je=Xe[0],Ge=Xe[1],Ke=(0,c.useState)(null),Qe=Ke[0],$e=Ke[1],en=(0,c.useState)(null),nn=en[0],tn=en[1],rn=(0,c.useState)(!1),ln=rn[0],on=rn[1],un=(0,c.useState)(null),cn=un[0],sn=un[1],an=(0,c.useState)(Te[0].uuid),dn=an[0],vn=an[1],hn=(0,c.useMemo)((function(){var e;return!(null===H||void 0===H||null===(e=H.features)||void 0===e||!e[_e.d.INTERACTIONS])}),[null===H||void 0===H?void 0:H.features]),pn=(0,c.useMemo)((function(){return!X&&n}),[n,X]),fn=Ze.ZP.pipeline_interactions.detail(hn&&Y,{filter_for_permissions:1}).data,mn=Ze.ZP.interactions.pipeline_interactions.list(hn&&Y).data,jn=(0,c.useMemo)((function(){return(null===fn||void 0===fn?void 0:fn.pipeline_interaction)||{}}),[fn]),xn=(0,c.useMemo)((function(){return(null===mn||void 0===mn?void 0:mn.interactions)||[]}),[mn]),gn=(0,c.useMemo)((function(){var e;return hn&&(null===(e=Object.keys((null===jn||void 0===jn?void 0:jn.blocks)||{}))||void 0===e?void 0:e.length)>=1}),[hn,jn]),Zn=(0,c.useMemo)((function(){return!!X&&gn}),[gn,X]),bn=(0,c.useMemo)((function(){var e,n={};return null===jn||void 0===jn||null===(e=jn.permissions)||void 0===e||e.forEach((function(e){var t=e.triggers;null===t||void 0===t||t.forEach((function(e){var t=e.schedule_interval,i=e.schedule_type;null!==n&&void 0!==n&&n[i]||(n[i]={}),t&&(n[i][t]=!0)}))})),n}),[jn]),yn=(0,c.useMemo)((function(){return(0,Ne.wx)(E,(function(e){return e.uuid===ce.C}))}),[E]),Pn=(0,c.useMemo)((function(){return Qe||{}}),[Qe]),On=Pn.description,_n=Pn.name,kn=Pn.schedule_interval,Sn=Pn.schedule_type,wn=Pn.settings,Cn=Pn.start_time,In=Pn.tags,Tn=Pn.variables,En=void 0===Tn?{}:Tn;(0,c.useEffect)((function(){!Be&&wn&&Ye(wn)}),[Be,wn]);var Mn=(0,c.useState)(null),Dn=Mn[0],Nn=Mn[1],An=(0,c.useState)({hour:"00",minute:"00"}),Ln=An[0],Hn=An[1],qn=(0,c.useState)({dayOfMonth:null,dayOfWeek:null,hour:null,minute:null,second:null}),zn=qn[0],Un=qn[1],Fn=Ze.ZP.event_rules.detail(oe.Xm.EVENT===Sn?"aws":null).data,Rn=(0,c.useMemo)((function(){var e;return(null===Fn||void 0===Fn||null===(e=Fn.event_rule)||void 0===e?void 0:e.rules)||[]}),[Fn]),Vn=(0,c.useMemo)((function(){return(0,A.HK)(Rn,(function(e){return e.name}))}),[Rn]),Wn=(0,p.Db)(Ze.ZP.pipeline_schedules.useUpdate(X),{onSuccess:function(e){return(0,Le.wD)(e,{callback:function(){null===o||void 0===o||o(),W.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(Y,"/triggers/").concat(X))},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}}),Bn=(0,l.Z)(Wn,2),Yn=Bn[0],Xn=Bn[1].isLoading,Jn=(0,c.useMemo)((function(){return En||{}}),[En]);(0,c.useEffect)((function(){var e=v().utc().format(Oe.TD),n=(0,De.a)(Cn||e,{localTimezone:B});if(Nn(null===n||void 0===n?void 0:n.date),Hn(null===n||void 0===n?void 0:n.time),Cn){var t=v()(Cn).utc();Un({dayOfMonth:t.date(),dayOfWeek:t.day(),hour:t.hours(),minute:t.minutes(),second:t.seconds()})}}),[B,Cn]),(0,c.useEffect)((function(){Jn&&Object.keys(Jn).length>0&&xe(!0)}),[Jn]),(0,c.useEffect)((function(){Ge(he?null===yn||void 0===yn?void 0:yn.reduce((function(e,n){var t=n.uuid,i=n.value;return qe(qe({},e),{},(0,r.Z)({},t,Jn[t]||i))}),{}):null)}),[yn,he,Jn]);var Gn=(0,c.useMemo)((function(){return(0,me._U)(kn)}),[kn]),Kn=(0,c.useMemo)((function(){return Gn&&cn?a().toString(cn,{throwExceptionOnParseError:!1}):""}),[cn,Gn]),Qn=(0,c.useMemo)((function(){return null===Kn||void 0===Kn?void 0:Kn.toLowerCase().includes("error")}),[Kn]);(0,c.useEffect)((function(){if(O&&!Qe){if(te(O.event_matchers),(0,me._U)(null===O||void 0===O?void 0:O.schedule_interval)){var e=B?(0,me.lO)(null===O||void 0===O?void 0:O.schedule_interval):null===O||void 0===O?void 0:O.schedule_interval;sn(e),$e(qe(qe({},O),{},{schedule_interval:"custom"}))}else $e(J?qe(qe({},O),{},{schedule_interval:oe.U5.ONCE}):O);var n=O.sla;if(n){Ue(!0);var t=(0,me.gU)(n),i=t.time,r=t.unit;$e((function(e){return qe(qe({},e),{},{slaAmount:i,slaUnit:r})}))}}}),[B,J,O,Qe,kn]);var $n=(0,c.useMemo)((function(){return!(null===Be||void 0===Be||!Be.landing_time_enabled)}),[Be]),et=(0,c.useMemo)((function(){return oe.Xm.TIME!==Sn||![oe.U5.DAILY,oe.U5.HOURLY,oe.U5.MONTHLY,oe.U5.WEEKLY].includes(kn)}),[kn,Sn]),nt=(0,c.useMemo)((function(){return $n&&!et}),[et,$n]),tt=(0,c.useCallback)((function(){var e=qe(qe({},(0,Ae.GL)(Qe,["name","description","schedule_type","tags"])),{},{event_matchers:[],schedule_interval:null,start_time:null,variables:(0,Ne.e7)(qe(qe({},Je),Q?(0,r.Z)({},oe.PN,Q):{}))});if(nt){var n=zn.dayOfMonth,t=zn.dayOfWeek,i=zn.hour,l=zn.minute,o=zn.second,u=v()("2023-07-01").utc();(0,fe.HW)(n)&&(u=u.date(n)),(0,fe.HW)(t)&&(u=u.day(t)),(0,fe.HW)(i)&&(u=u.hours(i)),(0,fe.HW)(l)&&(u=u.minutes(l)),(0,fe.HW)(o)&&(u=u.seconds(o)),e.schedule_interval=Gn?cn:Qe.schedule_interval,e.start_time=u.toISOString()}else oe.Xm.EVENT===Qe.schedule_type?e.event_matchers=ne:(e.schedule_interval=Gn?B&&!Qn&&cn?(0,me.lO)(cn,!0):cn:Qe.schedule_interval,e.start_time=Dn&&null!==Ln&&void 0!==Ln&&Ln.hour&&null!==Ln&&void 0!==Ln&&Ln.minute?(0,me.XM)(Dn,Ln,{convertToUtc:B,includeSeconds:!0,localTimezone:B}):null);if(ze){var c=null===Qe||void 0===Qe?void 0:Qe.slaAmount,s=null===Qe||void 0===Qe?void 0:Qe.slaUnit;if(!c||isNaN(c)||!s)return void h.Am.error("Please enter a valid SLA",{position:h.Am.POSITION.BOTTOM_RIGHT,toastId:"sla_error"});e.sla=(0,me.vJ)(c,s)}else null!==O&&void 0!==O&&O.sla&&(e.sla=0);e.settings=Be,Yn({pipeline_schedule:qe(qe({},e),{},{variables:nn||(null===e||void 0===e?void 0:e.variables)})})}),[Q,Qn,cn,Dn,B,ze,ne,Gn,zn,O,Je,Qe,Be,nt,Ln,Yn,nn]),it=(0,c.useMemo)((function(){if(null===O||void 0===O||!O.runtime_average)return"Trigger doesn\u2019t have enough history to estimate runtime.";var e=Number(null===O||void 0===O?void 0:O.runtime_average),n=Math.max(Math.floor(e/3600),0),t=Math.max(Math.floor((e-60*n*60)/60),0),i=Math.max(Math.floor(e-(60*n*60+60*t)),0),r=[];return n>=1&&r.push((0,fe._6)("hour",n,!0)),t>=1&&r.push((0,fe._6)("minute",t,!0)),i>=1&&r.push((0,fe._6)("second",i,!0)),r.join(" ")}),[O]),rt=(0,c.useMemo)((function(){if(!nt)return null;var e=[(0,L.jsxs)(w.Z,{mr:1,children:[(0,L.jsx)(w.Z,{mb:1,children:(0,L.jsx)(I.ZP,{bold:!0,default:!0,small:!0,children:"Minute"})}),(0,L.jsxs)(se.Z,{compact:!0,monospace:!0,onChange:function(e){Un((function(n){return qe(qe({},n),{},{minute:e.target.value})}))},value:(null===zn||void 0===zn?void 0:zn.minute)||"",children:[(0,L.jsx)("option",{value:""}),(0,A.w6)(60).map((function(e,n){return(0,L.jsx)("option",{value:n,children:n>=10?String(n):"0".concat(n)},n)}))]})]},"Minute"),(0,L.jsxs)(w.Z,{mr:1,children:[(0,L.jsx)(w.Z,{mb:1,children:(0,L.jsx)(I.ZP,{bold:!0,default:!0,small:!0,children:"Second"})}),(0,L.jsxs)(se.Z,{compact:!0,monospace:!0,onChange:function(e){Un((function(n){return qe(qe({},n),{},{second:e.target.value})}))},value:(null===zn||void 0===zn?void 0:zn.second)||"",children:[(0,L.jsx)("option",{value:""}),(0,A.w6)(60).map((function(e,n){return(0,L.jsx)("option",{value:n,children:n>=10?String(n):"0".concat(n)},n)}))]})]},"Second")];return[oe.U5.DAILY,oe.U5.MONTHLY,oe.U5.WEEKLY].includes(kn)&&e.unshift((0,L.jsxs)(w.Z,{mr:1,children:[(0,L.jsx)(w.Z,{mb:1,children:(0,L.jsx)(I.ZP,{bold:!0,default:!0,small:!0,children:"Hour"})}),(0,L.jsxs)(se.Z,{compact:!0,monospace:!0,onChange:function(e){Un((function(n){return qe(qe({},n),{},{hour:e.target.value})}))},value:(null===zn||void 0===zn?void 0:zn.hour)||"",children:[(0,L.jsx)("option",{value:""}),(0,A.w6)(24).map((function(e,n){return(0,L.jsx)("option",{value:n,children:n>=10?String(n):"0".concat(n)},n)}))]})]},"Hour")),oe.U5.WEEKLY===kn?e.unshift((0,L.jsxs)(w.Z,{mr:1,children:[(0,L.jsx)(w.Z,{mb:1,children:(0,L.jsx)(I.ZP,{bold:!0,default:!0,small:!0,children:"Day of the week"})}),(0,L.jsxs)(se.Z,{compact:!0,monospace:!0,onChange:function(e){Un((function(n){return qe(qe({},n),{},{dayOfWeek:e.target.value})}))},value:(null===zn||void 0===zn?void 0:zn.dayOfWeek)||"",children:[(0,L.jsx)("option",{value:""}),(0,L.jsx)("option",{value:6,children:"Sunday"}),(0,L.jsx)("option",{value:0,children:"Monday"}),(0,L.jsx)("option",{value:1,children:"Tuesday"}),(0,L.jsx)("option",{value:2,children:"Wednesday"}),(0,L.jsx)("option",{value:3,children:"Thursday"}),(0,L.jsx)("option",{value:4,children:"Friday"}),(0,L.jsx)("option",{value:5,children:"Saturday"})]})]},"Day of the week")):oe.U5.MONTHLY===kn&&e.unshift((0,L.jsxs)(w.Z,{mr:1,children:[(0,L.jsx)(w.Z,{mb:1,children:(0,L.jsx)(I.ZP,{bold:!0,default:!0,small:!0,children:"Day of the month"})}),(0,L.jsxs)(se.Z,{compact:!0,monospace:!0,onChange:function(e){Un((function(n){return qe(qe({},n),{},{dayOfMonth:e.target.value})}))},value:(null===zn||void 0===zn?void 0:zn.dayOfMonth)||"",children:[(0,L.jsx)("option",{value:""}),(0,A.w6)(31).map((function(e,n){return(0,L.jsx)("option",{value:n+1,children:n+1>=10?String(n+1):"0".concat(n+1)},n+1)}))]})]},"Day of the month")),(0,L.jsx)(k.ZP,{children:e})}),[zn,kn,nt]),lt=(0,c.useMemo)((function(){return[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Alphabet,{default:!0}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Trigger name"})]},"trigger_name"),(0,L.jsx)(T.Z,{monospace:!0,onChange:function(e){e.preventDefault(),$e((function(n){return qe(qe({},n),{},{name:e.target.value})}))},placeholder:"Name this trigger",value:_n},"trigger_name_input")]}),[_n]),ot=(0,c.useMemo)((function(){return[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Alphabet,{default:!0}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Trigger description"})]},"trigger_description"),(0,L.jsx)(T.Z,{monospace:!0,onChange:function(e){e.preventDefault(),$e((function(n){return qe(qe({},n),{},{description:e.target.value})}))},placeholder:"Description",value:On},"trigger_description_input")]}),[On]),ut=(0,c.useMemo)((function(){var e=[lt,ot,[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Schedule,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Frequency"})]},"frequency"),(0,L.jsxs)("div",{children:[(0,L.jsxs)(se.Z,{monospace:!0,onChange:function(e){e.preventDefault();var n=e.target.value;$e((function(e){return qe(qe({},e),{},{schedule_interval:n})}))},placeholder:"Choose the frequency to run",value:kn,children:[Object.values(oe.U5).reduce((function(e,n){var t;return!pn||null!==bn&&void 0!==bn&&null!==(t=bn[oe.Xm.TIME])&&void 0!==t&&t[n]?e.concat((0,L.jsx)("option",{value:n,children:n.substring(1)},n)):e}),[]),!pn&&(0,L.jsx)("option",{value:"custom",children:"custom"},"custom")]}),!pn&&(0,L.jsx)(w.Z,{mt:1,p:1,children:(0,L.jsxs)(I.ZP,{muted:!0,small:!0,children:["If you don't see the frequency option you need, select ",(0,L.jsx)(I.ZP,{inline:!0,monospace:!0,small:!0,children:"custom"})," and enter CRON syntax."]})})]},"frequency_input")]];return pn||e.push([(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Switch,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Enable landing time"})]},"frequency"),(0,L.jsxs)("div",{children:[(0,L.jsx)(de.Z,{checked:$n,disabled:et,onCheck:function(){Ye((function(e){return qe(qe({},e),{},{landing_time_enabled:!$n})}))}}),(0,L.jsxs)(w.Z,{mt:1,p:1,children:[et&&(0,L.jsxs)(I.ZP,{muted:!0,small:!0,children:["In order to enable landing time, the trigger\u2019s frequency must be ",(0,L.jsx)(I.ZP,{inline:!0,monospace:!0,small:!0,children:oe.U5.HOURLY}),", ",(0,L.jsx)(I.ZP,{inline:!0,monospace:!0,small:!0,children:oe.U5.DAILY}),", ",(0,L.jsx)(I.ZP,{inline:!0,monospace:!0,small:!0,children:oe.U5.WEEKLY}),", or ",(0,L.jsx)(I.ZP,{inline:!0,monospace:!0,small:!0,children:oe.U5.MONTHLY}),"."]}),!et&&(0,L.jsx)(I.ZP,{muted:!0,small:!0,children:"Instead of starting at a specific time, this trigger will schedule pipeline runs at a time where it will finish by the specified time below."})]})]},"frequency_input")]),nt&&e.push([(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Schedule,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Average runtime"})]},"runtime_average"),(0,L.jsx)(k.ZP,{alignItems:"center",style:{minHeight:"".concat(5.75*D.iI,"px")},children:(0,L.jsx)(I.ZP,{monospace:!0,children:it})},"runtime_average_value")]),e.push([(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.CalendarDate,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsxs)(I.ZP,{default:!0,children:[nt&&"Pipeline complete by",!nt&&"Start date and time"]})]},"start_time"),nt?rt:(0,L.jsxs)("div",{style:{minHeight:"".concat(5.75*D.iI,"px")},children:[!ln&&(0,L.jsx)(T.Z,{monospace:!0,onClick:function(){return on((function(e){return!e}))},placeholder:"YYYY-MM-DD HH:MM",value:Dn?(0,me.XM)(Dn,Ln,{localTimezone:B}):""}),(0,L.jsx)("div",{style:{width:"400px"},children:(0,L.jsx)(b.Z,{disableEscape:!0,onClickOutside:function(){return on(!1)},open:ln,style:{position:"relative"},children:(0,L.jsx)(g.Z,{localTime:B,selectedDate:Dn,selectedTime:Ln,setSelectedDate:Nn,setSelectedTime:Hn,topPosition:!0})})})]},"start_time_input")]),J&&e.splice(2,2),Gn&&e.splice(2,0,[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.Code,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"Cron expression"})]},"cron_expression"),(0,L.jsxs)("div",{children:[(0,L.jsx)(T.Z,{monospace:!0,onChange:function(e){e.preventDefault(),sn(e.target.value)},placeholder:"* * * * *",value:cn}),(0,L.jsxs)(w.Z,{mt:1,p:1,children:[(0,L.jsx)(I.ZP,{monospace:!0,xsmall:!0,children:"[minute] [hour] [day(month)] [month] [day(week)]"}),(0,L.jsx)(w.Z,{mb:"2px"}),cn?(0,L.jsx)(I.ZP,{danger:Qn,muted:!0,small:!0,children:Qn?"Invalid cron expression. Please check the cron syntax.":(0,L.jsxs)(L.Fragment,{children:['"',Kn,'"']})}):null,B&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(I.ZP,{bold:!0,inline:!0,small:!0,warning:!0,children:"Note:\xa0"}),(0,L.jsxs)(I.ZP,{inline:!0,small:!0,children:["If you have the display_local_timezone setting enabled, the local cron expression above will match your local timezone only",(0,L.jsx)("br",{}),"if the minute and hour values are single values without any special characters, such as the comma, hyphen, or slash.",(0,L.jsx)("br",{}),"You can still use cron expressions with special characters for the minute/hour values, but it will be based in UTC time."]})]})]})]},"cron_expression_input")]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.Z,{mb:2,px:D.cd,children:(0,L.jsx)(S.Z,{children:"Settings"})}),(0,L.jsx)(F.Z,{light:!0,short:!0}),(0,L.jsx)(C.Z,{columnFlex:[null,1],rows:e})]})}),[Qn,cn,Dn,B,pn,Gn,J,et,$n,rt,bn,Kn,it,kn,ln,nt,Ln,lt,ot]),ct=(0,c.useCallback)((function(e,n){te((function(t){return Object.entries(n).forEach((function(n){var i=(0,l.Z)(n,2),r=i[0],o=i[1];t[e][r]=o})),(0,i.Z)(t)}))}),[te]),st=(0,c.useMemo)((function(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.Z,{mb:D.cd,px:D.cd,children:(0,L.jsx)(S.Z,{children:"Settings"})}),(0,L.jsx)(F.Z,{light:!0,short:!0}),(0,L.jsx)(C.Z,{columnFlex:[null,1],rows:[lt,ot]}),(0,L.jsxs)(w.Z,{mb:2,mt:5,px:D.cd,children:[(0,L.jsx)(S.Z,{children:"Events"}),(0,L.jsxs)(I.ZP,{muted:!0,children:["Add 1 or more event that will trigger this pipeline to run.",(0,L.jsx)("br",{}),"If you add more than 1 event, this pipeline will trigger if any of the events are received."]}),(0,L.jsxs)(w.Z,{mt:D.Mq,children:[(0,L.jsx)(I.ZP,{bold:!0,large:!0,children:"AWS events"}),(0,L.jsxs)(I.ZP,{muted:!0,children:["In order to retrieve all the possible AWS events you can trigger your pipeline from,",(0,L.jsx)("br",{}),"you\u2019ll need to set 3 environment variables (",(0,L.jsx)(V.Z,{href:"https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html",openNewWindow:!0,underline:!0,children:"more info here"}),"):"]}),(0,L.jsx)(w.Z,{mt:1,children:(0,L.jsxs)(ie,{monospace:!0,ordered:!0,children:[(0,L.jsx)(I.ZP,{monospace:!0,children:"AWS_REGION_NAME"}),(0,L.jsx)(I.ZP,{monospace:!0,children:"AWS_ACCESS_KEY_ID"}),(0,L.jsx)(I.ZP,{monospace:!0,children:"AWS_SECRET_ACCESS_KEY"})]})})]})]}),(0,L.jsx)(F.Z,{light:!0,short:!0}),(null===ne||void 0===ne?void 0:ne.length)>=1&&(0,L.jsx)(C.Z,{alignTop:!0,columnFlex:[1,1,2,null],columns:[{uuid:"Provider"},{uuid:"Event"},{uuid:"Pattern"},{label:function(){return""},uuid:"delete"}],rows:null===ne||void 0===ne?void 0:ne.map((function(e,n){var t=e.event_type,i=e.name,r=e.pattern,l=e.id||"".concat(t,"-").concat(i,"-").concat(n,"-").concat(JSON.stringify(r)),o=[];return r&&JSON.stringify(r,null,2).split("\n").forEach((function(e){o.push(" ".concat(e))})),[(0,L.jsx)(se.Z,{monospace:!0,onChange:function(e){return ct(n,{event_type:e.target.value})},placeholder:"Event provider",value:t||"",children:U.S5.map((function(e){var n=e.label,t=e.uuid;return(0,L.jsx)("option",{value:t,children:n()},t)}))},"event-provider-".concat(l)),(0,L.jsx)(se.Z,{monospace:!0,onChange:function(e){var t,i=e.target.value,r=null===(t=Vn[i])||void 0===t?void 0:t.event_pattern;ct(n,{name:i,pattern:r?JSON.parse(r):null})},placeholder:"Event name",value:i,children:Rn.map((function(e){var n=e.name;return(0,L.jsx)("option",{value:n,children:n},n)}))},"event-name-".concat(l)),r&&(0,L.jsx)(y.Z,{language:"json",small:!0,source:o.join("\n")}),(0,L.jsx)(j.ZP,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(){return te((function(e){return(0,A.oM)(e,n)}))},children:(0,L.jsx)(pe.Trash,{default:!0,size:2*D.iI})},"remove_event")]}))}),(0,L.jsx)(w.Z,{p:D.cd,children:(0,L.jsx)(j.ZP,{beforeIcon:(0,L.jsx)(pe.Add,{size:2*D.iI}),onClick:function(){return te((function(e){return e.concat({})}))},outline:!0,children:"Add event matcher"})})]})}),[ne,Rn,Vn,lt,ot,ct]),at=(0,c.useMemo)((function(){var e=(0,me.M8)(O,Re);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.Z,{mb:D.cd,px:D.cd,children:(0,L.jsx)(S.Z,{children:"Settings"})}),(0,L.jsx)(F.Z,{light:!0,short:!0}),(0,L.jsx)(C.Z,{columnFlex:[null,1],rows:[lt,ot]}),(0,L.jsxs)(w.Z,{mb:2,mt:5,px:D.cd,children:[(0,L.jsx)(S.Z,{children:"Endpoint"}),(0,L.jsxs)(I.ZP,{muted:!0,children:["Make a ",(0,L.jsx)(I.ZP,{bold:!0,inline:!0,monospace:!0,children:"POST"})," request to the following endpoint:"]}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsx)(P.Z,{copiedText:e,linkText:e,monospace:!0,withCopyIcon:!0})}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(w.Z,{mr:1,children:(0,L.jsx)(de.Z,{checked:Re,onCheck:function(){return Ve(!Re)}})}),(0,L.jsx)(I.ZP,{muted:!0,children:"Show alternative endpoint to pass token in headers"})]})})]}),Re&&(0,L.jsxs)(w.Z,{mb:2,mt:5,px:D.cd,children:[(0,L.jsx)(S.Z,{children:"Headers"}),(0,L.jsx)(I.ZP,{muted:!0,children:"You will need to include the following headers in your request to authenticate with the server."}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsx)(P.Z,{copiedText:"Content-Type: application/json\n Authorization: Bearer ".concat(null===O||void 0===O?void 0:O.token,"\n "),withCopyIcon:!0,children:(0,L.jsx)(y.Z,{language:"json",small:!0,source:"\n Content-Type: application/json\n Authorization: Bearer ".concat(null===O||void 0===O?void 0:O.token,"\n ")})})})]}),(0,L.jsxs)(w.Z,{mb:2,mt:5,px:D.cd,children:[(0,L.jsx)(S.Z,{children:"Payload"}),(0,L.jsx)(I.ZP,{muted:!0,children:"You can optionally include runtime variables in your request payload. These runtime variables are accessible from within each pipeline block."}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsx)(P.Z,{copiedText:'{\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n}\n',withCopyIcon:!0,children:(0,L.jsx)(y.Z,{language:"json",small:!0,source:'\n {\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n }\n'})})})]}),(0,L.jsxs)(w.Z,{mb:2,mt:5,px:D.cd,children:[(0,L.jsx)(S.Z,{children:"Sample cURL command"}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsx)(y.Z,{language:"bash",small:!0,source:Re?"\n curl -X POST ".concat(e," \\\n --header 'Content-Type: application/json' \\\n --header 'Authorization: Bearer ").concat(null===O||void 0===O?void 0:O.token,'\' \\\n --data \'\n {\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n }\'\n '):"\n curl -X POST ".concat(e,' \\\n --header \'Content-Type: application/json\' \\\n --data \'\n {\n "pipeline_run": {\n "variables": {\n "key1": "value1",\n "key2": "value2"\n }\n }\n }\'\n')})})]})]})}),[O,Ve,ot,lt,Re]),dt=!Sn||oe.Xm.TIME===Sn&&!(J&&Dn||!J&&Dn&&kn)||oe.Xm.EVENT===Sn&&(!(null!==ne&&void 0!==ne&&ne.length)||!ne.every((function(e){var n=e.event_type,t=e.name;return n&&t}))),vt=(0,c.useMemo)((function(){var e;return(null===d||void 0===d||null===(e=d.blocks)||void 0===e?void 0:e.filter((function(e){var n=e.type;return ye.tf.DBT===n})))||[]}),[d]),ht=(0,c.useMemo)((function(){return null!==d&&void 0!==d&&d.blocks?(0,Ee.n)(d):null}),[d]),pt=(0,c.useMemo)((function(){var e,n;return(0,L.jsxs)(w.Z,{py:D.cd,children:[(0,L.jsxs)(w.Z,{mb:D.HN,px:D.cd,children:[(0,L.jsx)(S.Z,{children:"Run settings"}),(0,L.jsxs)(w.Z,{mt:D.Mq,children:[!J&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(w.Z,{mb:D.Mq,children:[(0,L.jsx)(I.ZP,{children:"Set a timeout for each run of this trigger (optional)"}),(0,L.jsx)(w.Z,{mb:1}),(0,L.jsx)(T.Z,{label:"Timeout (in seconds)",onChange:function(e){return Ye((function(n){return qe(qe({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:null===Be||void 0===Be?void 0:Be.timeout})]}),(0,L.jsxs)(w.Z,{mb:D.Mq,children:[(0,L.jsx)(I.ZP,{children:"Status for runs that exceed the timeout (default: failed)"}),(0,L.jsx)(w.Z,{mb:1}),(0,L.jsxs)(se.Z,{fullWidth:!0,monospace:!0,onChange:function(e){e.preventDefault(),Ye((function(n){return qe(qe({},n),{},{timeout_status:e.target.value})}))},placeholder:"Timeout status",value:null===Be||void 0===Be?void 0:Be.timeout_status,children:[(0,L.jsx)("option",{value:Se.V.FAILED,children:"Failed"}),(0,L.jsx)("option",{value:Se.V.CANCELLED,children:"Cancelled"})]})]})]}),(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(w.Z,{mr:2,children:(0,L.jsx)(de.Z,{checked:ze,onCheck:function(e){Ue(e),e||$e((function(e){return qe(qe({},e),{},{slaAmount:0})}))}})}),(0,L.jsx)(I.ZP,{default:!0,monospace:!0,children:"Configure trigger SLA"})]}),ze&&(0,L.jsx)(C.Z,{columnFlex:[null,1],rows:[[(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(pe.CalendarDate,{default:!0,size:1.5*D.iI}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:!0,children:"SLA"})]},"sla_detail"),(0,L.jsxs)(k.ZP,{children:[(0,L.jsx)(R.Z,{flex:1,children:(0,L.jsx)(T.Z,{fullWidth:!0,monospace:!0,noBorder:!0,onChange:function(e){e.preventDefault(),$e((function(n){return qe(qe({},n),{},{slaAmount:e.target.value})}))},placeholder:"Time",value:null===Qe||void 0===Qe?void 0:Qe.slaAmount})}),(0,L.jsx)(R.Z,{flex:1,children:(0,L.jsx)(se.Z,{fullWidth:!0,monospace:!0,noBorder:!0,onChange:function(e){e.preventDefault(),$e((function(n){return qe(qe({},n),{},{slaUnit:e.target.value})}))},placeholder:"Select time unit",small:!0,value:null===Qe||void 0===Qe?void 0:Qe.slaUnit,children:Object.keys(me.tL).map((function(e){return(0,L.jsx)("option",{value:e,children:"".concat(e,"(s)")},e)}))})})]},"sla_input_detail")]]})]}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsx)(k.ZP,{alignItems:"center",children:(0,L.jsx)(Z.Z,{checked:null===Be||void 0===Be?void 0:Be.allow_blocks_to_fail,label:"Keep running pipeline even if blocks fail",onClick:function(){return Ye((function(e){return qe(qe({},e),{},{allow_blocks_to_fail:!(null!==Be&&void 0!==Be&&Be.allow_blocks_to_fail)})}))}})})}),oe.Xm.TIME===Sn&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.Z,{mt:D.cd,children:(0,L.jsx)(k.ZP,{alignItems:"center",children:(0,L.jsx)(Z.Z,{checked:null===Be||void 0===Be?void 0:Be.skip_if_previous_running,label:"Skip run if previous run still in progress",onClick:function(){return Ye((function(e){return qe(qe({},e),{},{skip_if_previous_running:!(null!==Be&&void 0!==Be&&Be.skip_if_previous_running)})}))}})})}),(0,L.jsx)(w.Z,{mt:D.cd,children:(0,L.jsx)(k.ZP,{alignItems:"center",children:(0,L.jsx)(Z.Z,{checked:null===Be||void 0===Be?void 0:Be.create_initial_pipeline_run,label:"Create initial pipeline run if start date is before current execution period",onClick:function(){return Ye((function(e){return qe(qe({},e),{},{create_initial_pipeline_run:!(null!==Be&&void 0!==Be&&Be.create_initial_pipeline_run)})}))}})})})]})]}),(0,L.jsxs)(w.Z,{mb:D.HN,children:[(0,L.jsxs)(w.Z,{px:D.cd,children:[(0,L.jsx)(S.Z,{children:"Runtime variables"}),(0,Ae.Qr)(yn)&&(0,L.jsxs)(w.Z,{mt:1,children:[(0,L.jsx)(I.ZP,{default:!0,children:"This pipeline has no runtime variables."}),(0,L.jsx)(u(),{as:"/pipelines/".concat(Y,"/edit?sideview=variables"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,L.jsx)(V.Z,{primary:!0,children:"Click here"})})," ",(0,L.jsx)(I.ZP,{default:!0,inline:!0,children:"to add variables to this pipeline."})]})]}),(0,L.jsx)(w.Z,{mt:D.Mq,children:(0,L.jsx)(re.Z,{enableVariablesOverwrite:!0,originalVariables:null===O||void 0===O?void 0:O.variables,runtimeVariables:Je,setRuntimeVariables:Ge})})]}),ht&&(null===(e=Object.keys(ht||{}))||void 0===e?void 0:e.length)>=1&&(0,L.jsxs)(w.Z,{mb:D.HN,children:[(0,L.jsx)(w.Z,{px:D.cd,children:(0,L.jsx)(S.Z,{children:"Override bookmark values"})}),(0,L.jsx)(m.Z,{bookmarkValues:Q,originalBookmarkValues:null===O||void 0===O||null===(n=O.variables)||void 0===n?void 0:n[oe.PN],pipeline:d,setBookmarkValues:$})]}),(null===vt||void 0===vt?void 0:vt.length)>=1&&(0,L.jsx)(w.Z,{mb:D.HN,children:(0,L.jsx)(z,{blocks:vt,updateVariables:Ge,variables:qe(qe({},Jn),Je)})})]})}),[ht,Q,vt,ze,yn,J,d,null===O||void 0===O?void 0:O.variables,Y,Je,Qe,Sn,Jn,$,Ue,Ge,Be]),ft=Ze.ZP.tags.list().data,mt=(0,c.useMemo)((function(){return((null===ft||void 0===ft?void 0:ft.tags)||[]).filter((function(e){var n=e.uuid;return!(null!==In&&void 0!==In&&In.includes(n))}))}),[ft,In]),jt=(0,c.useMemo)((function(){return(0,me.ri)(J)}),[J]),xt=(0,c.useMemo)((function(){return(0,L.jsx)(ge,{containerRef:q,date:Dn,interactions:xn,pipeline:d,pipelineInteraction:jn,pipelineSchedule:Qe,setVariables:function(e){$e((function(n){var t=qe({},e((null===n||void 0===n?void 0:n.variables)||{})),i=qe({},t);return null===xn||void 0===xn||xn.forEach((function(e){Object.entries((null===e||void 0===e?void 0:e.variables)||{}).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],r=n[1].types;i&&t in i&&(i[t]=(0,Me.M)(i[t],r))}))})),tn(i),qe(qe({},n),{},{variables:t})}))},showSummary:Ie.uuid===dn,time:Ln,triggerTypes:jt,variables:null===Qe||void 0===Qe?void 0:Qe.variables})}),[q,Dn,xn,d,jn,Qe,dn,$e,tn,Ln,jt]),gt=(0,c.useMemo)((function(){return oe.fq.ACTIVE===(null===Qe||void 0===Qe?void 0:Qe.status)}),[Qe]),Zt=M?null===M||void 0===M?void 0:M((function(e){return W.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(null===d||void 0===d?void 0:d.uuid,"/triggers/").concat(e))})):[null,{isLoading:!1}],bt=(0,l.Z)(Zt,2),yt=bt[0],Pt=bt[1].isLoading,Ot=(0,c.useCallback)((function(){null===yt||void 0===yt||yt({pipeline_schedule:qe(qe({},Qe),{},{variables:nn||(null===Qe||void 0===Qe?void 0:Qe.variables)})})}),[yt,nn,Qe]),_t=(0,c.useMemo)((function(){var e,n;return X?(e=(0,L.jsx)(j.ZP,{linkProps:{as:"/pipelines/".concat(Y,"/triggers/").concat(X),href:"/pipelines/[pipeline]/triggers/[...slug]"},noHoverUnderline:!0,outline:!0,sameColorAsText:!0,children:"Cancel and go back"}),n=(0,L.jsx)(j.ZP,{onClick:tt,primary:!0,children:"Save trigger"})):Ce.uuid===dn?(e=(0,L.jsx)(j.ZP,{onClick:function(){return null===s||void 0===s?void 0:s()},secondary:!0,children:"Cancel and go back"}),n=(0,L.jsx)(j.ZP,{afterIcon:(0,L.jsx)(pe.PaginateArrowRight,{}),onClick:function(){return vn(we.uuid)},primary:!0,children:"Next: Customize"})):we.uuid===dn?(e=(0,L.jsx)(j.ZP,{beforeIcon:(0,L.jsx)(pe.PaginateArrowLeft,{}),onClick:function(){return vn(Ce.uuid)},secondary:!0,children:"Back: Settings"}),n=(0,L.jsx)(j.ZP,{afterIcon:(0,L.jsx)(pe.PaginateArrowRight,{}),onClick:function(){return vn(Ie.uuid)},primary:!0,children:"Next: Review"})):Ie.uuid===dn&&(e=(0,L.jsx)(j.ZP,{beforeIcon:(0,L.jsx)(pe.PaginateArrowLeft,{}),onClick:function(){return vn(we.uuid)},secondary:!0,children:"Back: Customize"}),n=(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(j.ZP,{beforeIcon:(0,L.jsx)(pe.Lightning,{}),loading:Pt,onClick:function(){return Ot()},primary:!0,children:X?"Save trigger":"Create trigger"}),!X&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.Z,{mr:D.cd}),(0,L.jsx)(de.Z,{checked:gt,compact:!0,onCheck:function(e){return $e((function(n){return qe(qe({},n),{},{status:e(gt)?oe.fq.ACTIVE:oe.fq.INACTIVE})}))}}),(0,L.jsx)(w.Z,{mr:1}),(0,L.jsx)(I.ZP,{default:gt,muted:!gt,small:!0,children:"Set trigger to be active immediately after creating"})]})]})),(0,L.jsx)(w.Z,{p:D.cd,children:(0,L.jsxs)(k.ZP,{alignItems:"center",children:[e,e&&n&&(0,L.jsx)(w.Z,{mr:D.cd}),n]})})}),[Ot,Pt,gt,s,tt,X,Y,dn,vn]),kt=(0,c.useMemo)((function(){var e,n,t,i,r,l,o;return"undefined"===typeof(null===d||void 0===d||null===(e=d.settings)||void 0===e||null===(n=e.triggers)||void 0===n?void 0:n.save_in_code_automatically)?null===H||void 0===H||null===(t=H.pipelines)||void 0===t||null===(i=t.settings)||void 0===i||null===(r=i.triggers)||void 0===r?void 0:r.save_in_code_automatically:null===d||void 0===d||null===(l=d.settings)||void 0===l||null===(o=l.triggers)||void 0===o?void 0:o.save_in_code_automatically}),[d,H]);return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(le.Z,{after:!pn&&pt,afterHidden:pn,breadcrumbs:[{label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(Y,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{label:function(){return null===O||void 0===O?void 0:O.name},linkProps:{as:"/pipelines/".concat(Y,"/triggers/").concat(X),href:"/pipelines/[pipeline]/triggers/[...slug]"}}],errors:t,pageName:ke.M.TRIGGERS,pipeline:d,setErrors:_,subheader:pn||Zn?(0,L.jsx)(w.Z,{px:D.cd,children:(0,L.jsx)(x.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return vn(n)},regularSizeText:!0,selectedTabUUID:dn,tabs:Te,underlineColor:(0,N.qn)(ye.tf.DATA_LOADER).accent,underlineStyle:!0})}):(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(j.ZP,{disabled:dt,loading:Xn,onClick:tt,outline:!0,primary:!0,children:"Save changes"}),(0,L.jsx)(w.Z,{mr:D.cd}),(0,L.jsx)(j.ZP,{linkProps:{as:"/pipelines/".concat(Y,"/triggers/").concat(X),href:"/pipelines/[pipeline]/triggers/[...slug]"},noHoverUnderline:!0,outline:!0,sameColorAsText:!0,children:"Cancel"}),kt&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(w.Z,{mr:D.cd}),(0,L.jsxs)(I.ZP,{default:!0,xsmall:!0,children:["This trigger will automatically be persisted in code.",(0,L.jsx)("br",{}),"To change this behavior, update the ",(0,L.jsx)(u(),{as:"/pipelines/".concat(Y,"/settings"),href:"/pipelines/[pipeline]/settings",passHref:!0,children:(0,L.jsx)(V.Z,{openNewWindow:!0,xsmall:!0,children:"pipeline\u2019s settings"})})," or ",(0,L.jsx)(u(),{as:"/settings/workspace/preferences",href:"/settings/workspace/preferences",passHref:!0,children:(0,L.jsx)(V.Z,{openNewWindow:!0,xsmall:!0,children:"project settings"})}),"."]})]})]}),subheaderNoPadding:pn||Zn,title:function(){return null!==O&&void 0!==O&&O.name?"Edit ".concat(null===O||void 0===O?void 0:O.name):"New trigger"},uuid:"triggers/edit",children:(0,L.jsxs)("div",{ref:q,children:[(pn||Zn)&&(0,L.jsx)(F.Z,{light:!0}),(pn||Zn)&&(we.uuid===dn||Ie.uuid===dn)&&xt,(!pn||Ce.uuid===dn)&&(!Zn||Ce.uuid===dn)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(w.Z,{p:D.cd,children:[(0,L.jsxs)(w.Z,{mb:2,children:[(0,L.jsx)(S.Z,{children:"Trigger type"}),(0,L.jsx)(I.ZP,{muted:!0,children:"How would you like this pipeline to be triggered?"})]}),(0,L.jsx)(k.ZP,{children:jt.reduce((function(e,n){var t=n.label,i=n.description,r=n.uuid,l=Sn===r,o=Sn&&!l;return!pn||null!==bn&&void 0!==bn&&bn[r]?e.concat((0,L.jsx)(j.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){oe.Xm.EVENT!==r||null!==ne&&void 0!==ne&&ne.length||te([{}]),$e((function(e){return qe(qe({},e),{},{schedule_type:r})}))},children:(0,L.jsx)(Pe.U,{selected:l,children:(0,L.jsxs)(k.ZP,{alignItems:"center",children:[(0,L.jsx)(R.Z,{children:(0,L.jsx)("input",{checked:l,type:"radio"})}),(0,L.jsx)(w.Z,{mr:D.cd}),(0,L.jsxs)(R.Z,{alignItems:"flex-start",flexDirection:"column",children:[(0,L.jsx)(S.Z,{bold:!0,default:!l&&!o,level:5,muted:!l&&o,children:t()}),(0,L.jsx)(I.ZP,{default:!l&&!o,leftAligned:!0,muted:o,children:i()})]})]})})},r)):e}),[])})]}),(0,L.jsxs)(w.Z,{mt:D.HN,children:[oe.Xm.TIME===Sn&&ut,oe.Xm.EVENT===Sn&&st,oe.Xm.API===Sn&&at]}),!pn&&(0,L.jsxs)(w.Z,{mt:D.HN,px:D.cd,children:[(0,L.jsxs)(w.Z,{mb:2,children:[(0,L.jsx)(S.Z,{children:"Tags"}),(0,L.jsx)(I.ZP,{muted:!0,children:"Add or remove tags from this trigger."})]}),(0,L.jsx)(ae.Z,{removeTag:function(e){$e((function(n){return qe(qe({},n),{},{tags:null===In||void 0===In?void 0:In.filter((function(n){return n!==e.uuid}))})}))},selectTag:function(e){$e((function(n){return qe(qe({},n),{},{tags:(0,A.$C)(e.uuid,In,(function(n){return n===e.uuid}))})}))},selectedTags:null===In||void 0===In?void 0:In.map((function(e){return{uuid:e}})),tags:mt,uuid:"TagsAutocompleteInputField-trigger-".concat(X)})]})]}),(pn||Zn)&&_t]})})})}},37899:function(e,n,t){var i=t(82394),r=t(75582),l=t(82684),o=t(71180),u=t(15338),c=t(97618),s=t(55485),a=t(38276),d=t(75499),v=t(30160),h=t(35576),p=t(17488),f=t(72473),m=t(70515),j=t(42122),x=t(81728),g=t(28598);function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function b(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){e.borderless,e.compact;var n=e.enableVariablesOverwrite,t=e.originalVariables,Z=e.runtimeVariables,y=(e.setEnableVariablesOverwrite,e.setRuntimeVariables),P=(0,l.useState)({}),O=P[0],_=P[1],k=(0,l.useState)(null),S=k[0],w=k[1],C=(0,l.useState)(null),I=C[0],T=C[1];(0,l.useEffect)((function(){var e=Object.entries(Z||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),l=t[0],o=t[1],u=(0,x.Pb)(o)&&"object"===typeof JSON.parse(o)&&!Array.isArray(JSON.parse(o))&&null!==JSON.parse(o);return b(b({},e),{},(0,i.Z)({},l,u))}),{});_(e)}),[]);var E=function(e,n){var t={borderless:!0,key:"variable_uuid_input_".concat(e),monospace:!0,onChange:function(n){n.preventDefault(),y((function(t){return b(b({},t),{},(0,i.Z)({},e,n.target.value))}))},paddingHorizontal:0,placeholder:"Variable value",value:n};return O[e]?(0,g.jsx)(h.Z,b(b({},t),{},{rows:1,value:n})):(0,g.jsx)(p.Z,b({},t))};return(0,g.jsxs)(g.Fragment,{children:[n&&Z&&Object.entries(Z).length>0&&(0,g.jsx)(d.Z,{columnFlex:[null,1,null],columns:[{uuid:"Variable"},{uuid:"Value"},{label:function(){return""},uuid:"Action"}],rows:Object.entries(Z).map((function(e){var n=(0,r.Z)(e,2),i=n[0],l=n[1];return[(0,g.jsx)(v.ZP,{default:!0,monospace:!0,children:i},"variable_".concat(i)),E(i,l),!(null!==t&&void 0!==t&&t[i])&&(0,g.jsx)(o.ZP,{iconOnly:!0,onClick:function(){y((function(e){return(0,j.gR)(e,[i])}))},children:(0,g.jsx)(f.Trash,{default:!0})})]}))}),(0,g.jsx)(a.Z,{p:m.cd,children:(0,g.jsxs)(s.ZP,{alignItems:"center",children:[(0,g.jsx)(c.Z,{flex:1,children:(0,g.jsx)(p.Z,{fullWidth:!0,monospace:!0,onChange:function(e){return w(e.target.value)},placeholder:"New variable UUID",value:S||""})}),(0,g.jsx)(a.Z,{mr:1}),(0,g.jsx)(c.Z,{flex:1,children:(0,g.jsx)(p.Z,{fullWidth:!0,monospace:!0,onChange:function(e){return T(e.target.value)},placeholder:"Variable value",value:I||""})}),(0,g.jsx)(a.Z,{mr:1}),(0,g.jsx)(o.ZP,{beforeIcon:(0,g.jsx)(f.Add,{}),disabled:!S||!I,onClick:function(){y((function(e){return b(b({},e),{},(0,i.Z)({},S,I))})),w(null),T(null)},children:"Add runtime variable"})]})}),(0,g.jsx)(u.Z,{light:!0})]})}},97196:function(e,n,t){t.d(n,{S5:function(){return l},_P:function(){return o}});var i,r=t(86735);!function(e){e.AWS="aws_event"}(i||(i={}));var l=[{label:function(){return"AWS"},uuid:i.AWS}],o=(0,r.HK)(l,(function(e){return e.uuid}))},83784:function(e,n,t){t.d(n,{C:function(){return i}});var i="global"},14805:function(e,n,t){var i=t(82394),r=t(44495),l=t(55485),o=t(44085),u=t(38276),c=t(30160),s=t(88785),a=t(70515),d=t(86735),v=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function p(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.localTime,t=e.selectedDate,i=e.selectedTime,h=e.setSelectedDate,f=e.setSelectedTime,m=e.topPosition;return(0,v.jsxs)(s.J,{absolute:!0,topPosition:m,children:[(0,v.jsx)(r.ZP,{onChange:h,value:t}),(0,v.jsx)(u.Z,{mb:2}),(0,v.jsxs)(l.ZP,{alignItems:"center",children:[(0,v.jsxs)(c.ZP,{default:!0,large:!0,children:["Time (",n?"Local":"UTC","):"]}),(0,v.jsx)(u.Z,{pr:2}),(0,v.jsx)(o.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),f((function(n){return p(p({},n),{},{hour:e.target.value})}))},paddingRight:5*a.iI,placeholder:"HH",value:null===i||void 0===i?void 0:i.hour,children:(0,d.m5)(24,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,v.jsx)("option",{value:e,children:e},"hour_".concat(e))}))}),(0,v.jsx)(u.Z,{px:1,children:(0,v.jsx)(c.ZP,{bold:!0,large:!0,children:":"})}),(0,v.jsx)(o.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),f((function(n){return p(p({},n),{},{minute:e.target.value})}))},paddingRight:5*a.iI,placeholder:"MM",value:null===i||void 0===i?void 0:i.minute,children:(0,d.m5)(60,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,v.jsx)("option",{value:e,children:e},"minute_".concat(e))}))})]})]})}},79500:function(e,n,t){t.d(n,{a:function(){return l}});var i=t(16488),r=t(3917);function l(e,n){var t,l;if(null!==n&&void 0!==n&&n.localTimezone)t=(0,r.n$)(e),l={hour:(0,r.lJ)(String(t.getHours())),minute:(0,r.lJ)(String(t.getMinutes()))};else{var o=e.split(" ")[1];t=(0,i.eI)(e),l={hour:o.substring(0,2),minute:o.substring(3,5)}}return{date:t,time:l}}},9134:function(e,n,t){var i=t(82684),r=t(21124),l=t(68432),o=t(25976),u=t(65292),c=t(44897),s=t(95363),a=t(70515),d=t(28598);n.Z=function(e){var n=e.language,t=e.maxWidth,v=e.showLineNumbers,h=e.small,p=e.source,f=e.wrapLines,m=(0,i.useContext)(o.ThemeContext);function j(e){var i=e.value;return(0,d.jsx)(l.Z,{customStyle:{backgroundColor:(m.background||c.Z.background).popup,border:"none",borderRadius:"none",boxShadow:"none",fontFamily:s.Vp,fontSize:h?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*a.iI,paddingTop:2*a.iI},language:n,lineNumberStyle:{color:(m.content||c.Z.content).muted},showLineNumbers:v,style:u._4,useInlineStyles:!0,wrapLines:f,children:i})}return(0,d.jsx)(r.D,{components:{code:function(e){var n=e.children;return(0,d.jsx)(j,{value:n})}},children:p})}},32080:function(e,n,t){t.d(n,{n:function(){return l}});var i=t(44425),r=t(61599);function l(e){var n,t={};return null===e||void 0===e||null===(n=e.blocks)||void 0===n||n.forEach((function(e){var n=e.catalog,l=e.type,o=e.uuid;if(i.tf.DATA_LOADER===l&&null!==n&&void 0!==n&&n.streams){var u,c=null===n||void 0===n||null===(u=n.streams)||void 0===u?void 0:u.filter((function(e){var n=e.replication_method;return r._B.INCREMENTAL===n}));(null===c||void 0===c?void 0:c.length)>=1&&(o in t||(t[o]={block:e,streams:[]}),t[o].streams.push(c))}})),t}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3548],{4015:function(e,n,t){t.d(n,{$b:function(){return s},I5:function(){return l},Nk:function(){return d},gI:function(){return a}});var i=t(25976),o=t(44897),r=t(42631),c=t(70515),d=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*c.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),l=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;"," ",""],2.5*c.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.lightBackground&&"\n background-color: ".concat((e.theme.background||o.Z.background).panel,"\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-h093u4-2"})(["align-items:center;justify-content:space-between;"," "," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*c.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(c.cd*c.iI,"px;\n padding-top: ").concat(1*c.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")}),(function(e){return e.columnFlex&&"\n display: flex;\n flex-direction: column;\n "}),(function(e){return e.lightBackground&&"\n background-color: ".concat((e.theme.background||o.Z.background).panel,"\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;"," ",""],2.5*c.iI,2*c.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom-left-radius: ").concat(r.n_,"px;\n border-bottom-right-radius: ").concat(r.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.topBorder&&"\n border-top: 1px solid ".concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")}))},55729:function(e,n,t){t.d(n,{Z:function(){return M}});var i=t(82394),o=t(75582),r=t(82684),c=t(69864),d=t(71180),l=t(15338),a=t(97618),s=t(55485),u=t(85854),p=t(48670),v=t(65956),h=t(82359),m=t(88543),g=t(38276),f=t(30160),x=t(17488),j=t(69650),b=t(12468),Z=t(35686),_=t(77417),y=t(25976),k=t(44897),P=t(42631),w=t(70515),O=y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],P.n_,w.cd*w.iI,(function(e){return"\n background-color: ".concat((e.theme.background||k.Z.background).codeArea,";\n ")})),C=t(72473),I=t(72191),N=t(70320),S=t(81728),B=t(42122),E=t(72619),A=t(23780),D=t(28598);function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function H(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?L(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var M=function(e){var n,t,y,k=e.cancelButtonText,P=e.contained,L=e.header,M=e.onCancel,F=e.onSaveSuccess,V=e.rootProject,T=(0,A.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),U=(0,o.Z)(T,1)[0],R=(0,r.useState)(null),W=R[0],q=R[1],z=(0,r.useState)(!1),G=z[0],K=z[1],Y=(0,_.Z)(),$=Y.fetchProjects,J=Y.project,Q=Y.projectPlatformActivated,X=Y.rootProject,ee=(0,r.useMemo)((function(){return V?X:J}),[J,X,V]),ne=ee||{},te=ne.name,ie=ne.openai_api_key,oe=ne.project_uuid,re=(0,r.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,r.useEffect)((function(){W||q(ee)}),[ee,W]);var ce=(0,c.Db)(Z.ZP.projects.useUpdate(te),{onSuccess:function(e){return(0,E.wD)(e,{callback:function(e){var n,t=e.project;$(),q(t),K(!1),(0,N.hY)(null===t||void 0===t||null===(n=t.features)||void 0===n?void 0:n[h.d.LOCAL_TIMEZONE]),F&&(null===F||void 0===F||F(t))},onErrorCallback:function(e,n){return U({errors:n,response:e})}})}}),de=(0,o.Z)(ce,2),le=de[0],ae=de[1].isLoading,se=(0,r.useCallback)((function(e){return le({project:H(H({},e),{},{root_project:V})})}),[V,le]),ue=(0,D.jsxs)(D.Fragment,{children:[L,(0,D.jsxs)(v.Z,{noPadding:!0,children:[(0,D.jsxs)(g.Z,{p:w.cd,children:[(0,D.jsx)(g.Z,{mb:1,children:(0,D.jsx)(u.Z,{level:5,children:"Project name"})}),(0,D.jsx)(f.ZP,{default:!0,monospace:!0,children:te})]}),(0,D.jsx)(l.Z,{light:!0}),(0,D.jsxs)(g.Z,{p:w.cd,children:[(0,D.jsx)(g.Z,{mb:1,children:(0,D.jsx)(u.Z,{level:5,children:"Project UUID"})}),(0,D.jsx)(f.ZP,{default:!!oe,monospace:!0,muted:!oe,children:oe||"Not required"})]}),(0,D.jsx)(l.Z,{light:!0}),(0,D.jsx)(g.Z,{p:w.cd,children:(0,D.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,D.jsxs)(a.Z,{flexDirection:"column",children:[(0,D.jsx)(g.Z,{mb:1,children:(0,D.jsx)(u.Z,{level:5,children:"Help improve Mage"})}),(0,D.jsxs)(f.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,D.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,D.jsx)(g.Z,{mr:w.cd}),(0,D.jsx)(j.Z,{checked:null===W||void 0===W?void 0:W.help_improve_mage,compact:!0,id:"help_improve_mage_toggle",onCheck:function(){return q((function(e){return H(H({},e),{},{help_improve_mage:!(null!==W&&void 0!==W&&W.help_improve_mage)})}))}})]})})]}),(0,D.jsx)(g.Z,{mt:w.HN}),(0,D.jsx)(m.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,D.jsx)(m.S,{description:"Every time a trigger is created or updated in this pipeline, automatically persist it in code.",title:"Save triggers in code automatically",toggleSwitch:{checked:!(null===W||void 0===W||null===(n=W.pipelines)||void 0===n||null===(t=n.settings)||void 0===t||null===(y=t.triggers)||void 0===y||!y.save_in_code_automatically),onCheck:function(e){return q((function(n){var t,i,o,r,c,d;return H(H({},n),{},{pipelines:H(H({},null===n||void 0===n?void 0:n.pipelines),{},{settings:H(H({},null===n||void 0===n||null===(t=n.pipelines)||void 0===t?void 0:t.settings),{},{triggers:H(H({},null===n||void 0===n||null===(i=n.pipelines)||void 0===i||null===(o=i.settings)||void 0===o?void 0:o.triggers),{},{save_in_code_automatically:e(null===n||void 0===n||null===(r=n.pipelines)||void 0===r||null===(c=r.settings)||void 0===c||null===(d=c.triggers)||void 0===d?void 0:d.save_in_code_automatically)})})})})}))}}})}),(0,D.jsx)(g.Z,{mt:w.HN}),(0,D.jsx)(v.Z,{noPadding:!0,overflowVisible:!0,children:(0,D.jsxs)(g.Z,{p:w.cd,children:[(0,D.jsx)(g.Z,{mb:1,children:(0,D.jsxs)(u.Z,{level:5,children:["Features\xa0",(0,D.jsx)(p.Z,{bold:!0,href:"https://docs.mage.ai/development/project/features",largeSm:!0,openNewWindow:!0,children:"(docs)"})]})}),Object.entries((0,B.gR)(null===W||void 0===W?void 0:W.features,[h.d.CODE_BLOCK_V2])||{}).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],c=t[1],d=Q&&!V&&(null===ee||void 0===ee?void 0:ee.features_override)&&r in(null===ee||void 0===ee?void 0:ee.features_override);return(0,D.jsx)(g.Z,{mt:0===n?0:1,children:(0,D.jsxs)(s.ZP,{alignItems:"center",children:[(0,D.jsxs)(a.Z,{flex:1,children:[(0,D.jsx)(j.Z,{disabled:d,checked:!!c,compact:!0,onCheck:function(){return q((function(e){return H(H({},e),{},{features:H(H({},null===W||void 0===W?void 0:W.features),{},(0,i.Z)({},r,!c))})}))}}),(0,D.jsx)(g.Z,{mr:w.cd}),(0,D.jsxs)(a.Z,{children:[(0,D.jsx)(f.ZP,{default:!c,monospace:!0,children:(0,S.vg)(r)}),r===h.d.LOCAL_TIMEZONE&&(0,D.jsx)(g.Z,{ml:1,children:(0,D.jsx)(b.Z,H({},N.EB))})]})]}),d&&(0,D.jsx)(f.ZP,{monospace:!0,muted:!0,small:!0,children:"overridden"})]})},r)}))]})}),(0,D.jsx)(g.Z,{mt:w.HN}),(0,D.jsx)(v.Z,{noPadding:!0,children:(0,D.jsxs)(g.Z,{p:w.cd,children:[(0,D.jsx)(g.Z,{mb:1,children:(0,D.jsx)(u.Z,{level:5,children:"OpenAI"})}),ie&&!G?(0,D.jsxs)(s.ZP,H(H({},s.A0),{},{children:[(0,D.jsx)(f.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,D.jsx)(d.ZP,{iconOnly:!0,onClick:function(){return K(!0)},secondary:!0,title:"Edit",children:(0,D.jsx)(C.Edit,{size:I.bL})})]})):(0,D.jsx)(x.Z,{disabled:re,label:re?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return q((function(n){return H(H({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===W||void 0===W?void 0:W.openai_api_key)||""})]})}),(0,D.jsx)(g.Z,{mt:w.HN}),(0,D.jsxs)(s.ZP,{alignItems:"center",children:[(0,D.jsx)(d.ZP,{id:"save-project-settings",loading:ae,onClick:function(){var e={features:null===W||void 0===W?void 0:W.features,help_improve_mage:null===W||void 0===W?void 0:W.help_improve_mage,openai_api_key:null===W||void 0===W?void 0:W.openai_api_key,pipelines:null===W||void 0===W?void 0:W.pipelines};!0===(null===ee||void 0===ee?void 0:ee.help_improve_mage)&&!1===(null===W||void 0===W?void 0:W.help_improve_mage)&&(e.deny_improve_mage=!0),se(e)},primary:!0,children:"Save project settings"}),M&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(g.Z,{mr:w.cd}),(0,D.jsx)(d.ZP,{onClick:M,secondary:!0,children:k||"Cancel"})]})]})]});return P?(0,D.jsx)(O,{children:ue}):ue}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5699],{94629:function(e,t,r){r.d(t,{Z:function(){return w}});var n=r(82394),o=r(21831),i=r(82684),c=r(50724),u=r(1402),s=r(97618),a=r(70613),f=r(31557),d=r(68899),l=r(28598);function p(e,t){var r=e.children,n=e.noPadding;return(0,l.jsx)(d.HS,{noPadding:n,ref:t,children:r})}var h=i.forwardRef(p),b=r(62547),v=r(82571),m=r(77417),O=r(46684),y=r(75375);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t){e.addProjectBreadcrumbToCustomBreadcrumbs;var r=e.after,n=e.afterHeader,i=e.afterHidden,p=e.afterWidth,g=e.afterWidthOverride,P=e.appendBreadcrumbs,w=e.before,k=e.beforeHeader,x=e.beforeWidth,A=e.breadcrumbs,S=e.children,Z=e.contained,I=e.errors,E=e.headerMenuItems,R=e.headerOffset,C=e.hideAfterCompletely,W=e.mainContainerHeader,M=e.navigationItems,H=e.setAfterHidden,B=e.setAfterWidth,_=e.setBeforeWidth,N=e.setErrors,D=e.subheaderChildren,T=e.subheaderNoPadding,U=e.title,G=e.uuid,F=(0,y.Z)(G,{beforeResizeOffset:y.H,setWidthAfter:B,setWidthBefore:_,widthAfter:p,widthBefore:x,widthOverrideAfter:g}),L=F.mainContainerRef,z=F.mousedownActiveAfter,Y=F.mousedownActiveBefore,q=F.setMousedownActiveAfter,J=F.setMousedownActiveBefore,K=F.setWidthAfter,Q=F.setWidthBefore,V=F.widthAfter,X=F.widthBefore,$=(0,m.Z)().project,ee=[];return A&&ee.push.apply(ee,(0,o.Z)(A)),null!==A&&void 0!==A&&A.length&&!P||!$||null!==A&&void 0!==A&&A.length||ee.unshift({bold:!P,label:function(){return U}}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Z,{title:U}),(0,l.jsx)(f.Z,{breadcrumbs:ee,menuItems:E}),(0,l.jsxs)(d.Nk,{ref:t,children:[0!==(null===M||void 0===M?void 0:M.length)&&(0,l.jsx)(d.lm,{showMore:!0,children:(0,l.jsx)(v.Z,{navigationItems:M,showMore:!0})}),(0,l.jsx)(s.Z,{flex:1,flexDirection:"column",children:(0,l.jsxs)(b.Z,{after:r,afterHeader:n,afterHeightOffset:O.Mz,afterHidden:i,afterMousedownActive:z,afterWidth:V,before:w,beforeHeader:k,beforeHeightOffset:O.Mz,beforeMousedownActive:Y,beforeWidth:w?X:d.k1,contained:Z,headerOffset:R,hideAfterCompletely:!r||C,leftOffset:w?d.k1:null,mainContainerHeader:W,mainContainerRef:L,setAfterHidden:H,setAfterMousedownActive:q,setAfterWidth:K,setBeforeMousedownActive:J,setBeforeWidth:Q,children:[D&&(0,l.jsx)(h,{noPadding:T,children:D}),S]})})]}),I&&(0,l.jsx)(c.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===N||void 0===N?void 0:N(null)},children:(0,l.jsx)(u.Z,j(j({},I),{},{onClose:function(){return null===N||void 0===N?void 0:N(null)}}))})]})}var w=i.forwardRef(P)},74395:function(e,t,r){r.d(t,{M:function(){return c},W:function(){return i}});var n=r(25976),o=r(46684),i=34*r(70515).iI,c=n.default.div.withConfig({displayName:"indexstyle__BeforeStyle",componentId:"sc-12ee2ib-0"})(["min-height:calc(100vh - ","px);"],o.Mz)},24755:function(e,t,r){r.d(t,{B2:function(){return o},DQ:function(){return l},HY:function(){return a},Pl:function(){return n},SA:function(){return p},WH:function(){return f},fF:function(){return s},tC:function(){return d}});var n,o,i=r(19452),c=r(50178),u=r(72473),s="Git settings",a="Preferences",f="Workspace";!function(e){e.PROJECT_PLATFORM="Platform",e.WORKSPACE="Workspace",e.USER_MANAGEMENT="User management"}(n||(n={})),function(e){e.PERMISSIONS="Permissions",e.PREFERENCES="Preferences",e.ROLES="Roles",e.SETTINGS="Settings",e.USERS="Users"}(o||(o={}));var d="Account",l="Profile",p=function(e,t){var r=e.owner,p=e.roles,h=e.project_access,b=(t||{projectPlatformActivated:!1}).projectPlatformActivated,v=r||p===i.No.ADMIN||0!==(3&h),m=[{items:[{Icon:u.WorkspacesIcon,linkProps:{href:"/settings/workspace/preferences"},uuid:a},{Icon:u.Settings,linkProps:{href:"/settings/workspace/sync-data"},uuid:s}],uuid:f}];if((0,c.YB)()&&v){var O=[{Icon:u.WorkspacesUsersIcon,linkProps:{href:"/settings/workspace/users"},uuid:o.USERS}];(0,c.Bw)()&&O.push.apply(O,[{Icon:u.VisibleEye,linkProps:{href:"/settings/workspace/roles"},uuid:o.ROLES},{Icon:u.Locked,linkProps:{href:"/settings/workspace/permissions"},uuid:o.PERMISSIONS}]),m.push({items:O,uuid:n.USER_MANAGEMENT})}return!b||(0,c.YB)()&&!v||m.push({items:[{Icon:u.BlocksSeparated,linkProps:{href:"/settings/platform/preferences"},uuid:o.PREFERENCES},{Icon:u.SettingsWithKnobs,linkProps:{href:"/settings/platform/settings"},uuid:o.SETTINGS}],uuid:n.PROJECT_PLATFORM}),(0,c.YB)()?m.concat([{items:[{Icon:u.Sun,linkProps:{href:"/settings/account/profile"},uuid:l}],uuid:d}]):m}},28274:function(e,t,r){r.d(t,{Z:function(){return A}});var n=r(94629),o=r(82394),i=r(12691),c=r.n(i),u=r(55485),s=r(48670),a=r(38276),f=r(30160),d=r(25976),l=r(44897),p=r(70515),h=r(91437),b=(p.iI,d.default.div.withConfig({displayName:"indexstyle__SectionTitleStyle",componentId:"sc-1y8dyue-0"})(["padding:","px ","px;"],1*p.iI,2.5*p.iI)),v=d.default.div.withConfig({displayName:"indexstyle__ItemStyle",componentId:"sc-1y8dyue-1"})([""," padding:","px ","px;"," ",""],(0,h.eR)(),1.5*p.iI,2.5*p.iI,(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.background||l.Z.background).codeArea,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||l.Z.background).codeTextarea,";\n ")})),m=r(28598),O=r(82684);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(e){var t=e.isItemSelected,r=e.sections;return(0,m.jsx)(a.Z,{py:p.Gg,children:null===r||void 0===r?void 0:r.map((function(e){var r=e.items,n=e.title,o=e.uuid;return(0,m.jsxs)(a.Z,{children:[(0,m.jsx)(b,{children:(0,m.jsx)(f.ZP,{bold:!0,muted:!0,small:!0,uppercase:!0,children:n?n():o})}),null===r||void 0===r?void 0:r.map((function(e){var r=e.Icon,n=e.label,i=e.linkProps,f=e.onClick,d=e.uuid,l=null===t||void 0===t?void 0:t(g(g({},e),{},{uuidWorkspace:o})),h=n?n():d,b=(0,m.jsx)(v,{selected:l,children:(0,m.jsxs)(u.ZP,{alignItems:"center",children:[r&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r,{default:!l,size:1.75*p.iI}),(0,m.jsx)(a.Z,{mr:1})]}),h]})});return i?(0,O.createElement)(c(),g(g({},i),{},{key:d,passHref:!0}),(0,m.jsx)(s.Z,{block:!0,default:!l,noHoverUnderline:!0,noOutline:!0,sameColorAsText:l,children:b})):(0,m.jsx)(s.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:f,preventDefault:!0,sameColorAsText:!0,children:b},d)}))]},o)}))})},P=r(77417),w=r(74395),k=r(24755),x=r(50178);var A=function(e){var t=e.after,r=e.afterHeader,o=e.afterHidden,i=e.afterWidth,c=e.appendBreadcrumbs,u=e.breadcrumbs,s=e.children,a=e.hideAfterCompletely,f=e.setAfterHidden,d=e.title,l=e.uuidItemSelected,h=e.uuidWorkspaceSelected,b=(0,x.PR)()||{},v=(0,P.Z)().projectPlatformActivated;return(0,m.jsx)(n.Z,{after:t,afterHeader:r,afterHidden:!t||o,afterWidth:t?i||50*p.iI:0,afterWidthOverride:!0,appendBreadcrumbs:c,before:(0,m.jsx)(w.M,{children:(0,m.jsx)(j,{isItemSelected:function(e){var t=e.uuid,r=e.uuidWorkspace;return h===r&&l===t},sections:(0,k.SA)(b,{projectPlatformActivated:v})})}),beforeWidth:w.W,breadcrumbs:u,hideAfterCompletely:a,setAfterHidden:f,title:d||"Settings",uuid:"".concat(d||"settings","/index"),children:s})}},93808:function(e,t,r){r.d(t,{Z:function(){return S}});var n=r(77837),o=r(26304),i=r(62243),c=r(29385),u=r(80022),s=r(13692),a=r(93189),f=r(15544),d=r(82394),l=r(38860),p=r.n(l),h=r(82684),b=r(56663),v=r.n(b),m=r(40761),O=r(34661),y=r(36105),g=r(50178),j=r(69419),P=r(28598),w=["auth"];function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){(0,d.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function A(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,f.Z)(e);if(t){var o=(0,f.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.Z)(this,r)}}function S(e){return function(t){(0,s.Z)(a,t);var r=A(a);function a(){var e;(0,i.Z)(this,a);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=r.call.apply(r,[this].concat(n)),(0,d.Z)((0,u.Z)(e),"state",{auth:new m.Z(e.props.token)}),e}return(0,c.Z)(a,[{key:"componentDidMount",value:function(){this.setState({auth:new m.Z(this.props.token)})}},{key:"render",value:function(){var t=this.props,r=(t.auth,(0,o.Z)(t,w));return(0,P.jsx)(e,x({auth:this.state.auth},r))}}],[{key:"getInitialProps",value:function(){var t=(0,n.Z)(p().mark((function t(r){var n,o,i,c,u,s,a,f,d;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=v()(r),o=(0,g.ex)(r),i=o.id,c=n[O.Mv],u=n[y.qt],s=new m.Z(c),a=x(x({},r),{},{auth:s,currentGroupId:i,theme:u}),(0,g.YB)(r)&&s.isExpired&&(console.log("OAuth token has expired."),f=x(x({},r.query),{},{redirect_url:r.asPath}),(0,j.nL)("/sign-in?".concat((0,j.uM)(f)),r.res)),!e.getInitialProps){t.next=12;break}return t.next=10,e.getInitialProps(a);case 10:return d=t.sent,t.abrupt("return",x(x({},d),{},{auth:s,currentGroupId:i,theme:u}));case 12:return t.abrupt("return",a);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),a}(h.Component)}},80022:function(e,t,r){function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},15544:function(e,t,r){function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:function(){return n}})},13692:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(61049);function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(0,n.Z)(e,t)}},93189:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(12539),o=r(80022);function i(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7361],{37361:function(e,n,r){r.d(n,{X:function(){return k}});var i=r(21831),l=r(75582),s=r(82394),t=r(21764),o=r(82684),d=r(69864),a=r(34376),c=r(71180),u=r(70652),E=r(15338),f=r(97618),v=r(55485),I=r(85854),j=r(65956),m=r(28274),p=r(38276),Z=r(75499),x=r(30160),h=r(17488),g=r(35686),A=r(8193),L=r(72473),_=r(70515),S=r(24755),D=r(3917),R=r(76417),P=r(36717),T=r(50178),O=r(86735),b=r(42122),C=r(72619),B=r(95924),w=r(28598);function N(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,i)}return r}function y(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?N(Object(r),!0).forEach((function(n){(0,s.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var k,W=2*_.iI;!function(e){e.PERMISSIONS="Permissions",e.ROLES="Roles"}(k||(k={})),n.Z=function(e){var n,r,s,N=e.contained,M=e.disableFields,U=e.onCancel,H=e.slug,Y=(0,T.PR)()||{},z=Y.id,Q=Y.owner,V=(0,a.useRouter)(),q=(0,o.useState)(!0),F=q[0],G=q[1],K=(0,o.useState)(null),$=K[0],X=K[1],J=(0,o.useState)({}),ee=J[0],ne=J[1],re=(0,o.useState)(null),ie=re[0],le=re[1],se=(0,o.useCallback)((function(e,n,r){le(y(y({},e),{},{rolesMapping:(0,O.HK)(n||[],(function(e){return e.id})),permissionsMapping:(0,O.HK)(r||[],(function(e){return e.id}))}))}),[le]),te=(0,o.useCallback)((function(e){ne((function(n){return y(y({},n),e)})),le((function(n){return y(y({},n),e)}))}),[ne,le]),oe=g.ZP.users.detail(H,{},{revalidateOnFocus:!1}).data,de=(0,o.useMemo)((function(){return null===oe||void 0===oe?void 0:oe.user}),[oe]);(0,o.useEffect)((function(){de&&se(de,null===de||void 0===de?void 0:de.roles_new,null===de||void 0===de?void 0:de.permissions)}),[se,de]);var ae=(0,d.Db)(de?g.ZP.users.useUpdate(H):g.ZP.users.useCreate(),{onSuccess:function(e){return(0,C.wD)(e,{callback:function(e){var n=e.user;ne({}),se(n,null===n||void 0===n?void 0:n.roles_new,null===n||void 0===n?void 0:n.permissions),de||V.push("/settings/workspace/users/".concat(null===n||void 0===n?void 0:n.id)),String(null===n||void 0===n?void 0:n.id)===String(z)&&(0,T.av)(y(y({},(0,T.PR)()),{},{avatar:null===n||void 0===n?void 0:n.avatar,first_name:null===n||void 0===n?void 0:n.first_name,last_name:null===n||void 0===n?void 0:n.last_name,username:null===n||void 0===n?void 0:n.username})),t.Am.success(de?"User profile successfully updated.":"New user created successfully.",{position:t.Am.POSITION.BOTTOM_RIGHT,toastId:"user-update-success-".concat(n.id)})},onErrorCallback:function(e){var n=e.error,r=n.errors,i=n.exception,l=n.message,s=n.type;t.Am.error((null===r||void 0===r?void 0:r.error)||i||l,{position:t.Am.POSITION.BOTTOM_RIGHT,toastId:s})}})}}),ce=(0,l.Z)(ae,2),ue=ce[0],Ee=ce[1].isLoading,fe=(0,d.Db)(g.ZP.users.useDelete(null===de||void 0===de?void 0:de.id),{onSuccess:function(e){return(0,C.wD)(e,{callback:function(){V.push("/settings/workspace/users"),t.Am.success("User successfully delete.",{position:t.Am.POSITION.BOTTOM_RIGHT,toastId:"user-delete-success-".concat(null===de||void 0===de?void 0:de.id)})},onErrorCallback:function(e){var n=e.error,r=n.errors,i=n.exception,l=n.message,s=n.type;t.Am.error((null===r||void 0===r?void 0:r.error)||i||l,{position:t.Am.POSITION.BOTTOM_RIGHT,toastId:s})}})}}),ve=(0,l.Z)(fe,2),Ie=ve[0],je=ve[1].isLoading,me=g.ZP.roles.list().data,pe=(0,o.useMemo)((function(){return(0,O.YC)((null===me||void 0===me?void 0:me.roles)||[],"name")}),[me]),Ze=(0,o.useMemo)((function(){return(null===ie||void 0===ie?void 0:ie.rolesMapping)||{}}),[ie]),xe=(0,o.useMemo)((function(){return(0,O.YC)(Object.values(Ze),"name")}),[Ze]),he=g.ZP.permissions.list({_limit:1e3}).data,ge=((0,o.useMemo)((function(){return(0,O.YC)((null===he||void 0===he?void 0:he.permissions)||[],"entity_name")}),[he]),(0,o.useMemo)((function(){return(null===ie||void 0===ie?void 0:ie.permissionsMapping)||{}}),[ie])),Ae=(0,o.useMemo)((function(){return(0,O.YC)(Object.values(ge),"entity_name")}),[ge]),Le=(0,o.useMemo)((function(){return(null===xe||void 0===xe?void 0:xe.length)>=1}),[xe]),_e=(0,o.useMemo)((function(){return(0,w.jsx)(c.ZP,{beforeIcon:(0,w.jsx)(L.Add,{}),compact:!0,onClick:function(){X(k.ROLES),G(!1)},primary:!Le,secondary:Le,small:!0,children:"Add roles"})}),[Le,X,G]),Se=(0,o.useMemo)((function(){return(null===Ae||void 0===Ae?void 0:Ae.length)>=1}),[Ae]),De=((0,o.useMemo)((function(){return(0,w.jsx)(c.ZP,{beforeIcon:(0,w.jsx)(L.Add,{}),compact:!0,onClick:function(){X(k.PERMISSIONS),G(!1)},primary:!Se,secondary:Se,small:!0,children:"Add permission"})}),[Se,X,G]),(0,o.useCallback)((function(e,n,r){return(0,w.jsx)(Z.Z,{columnFlex:[].concat((0,i.Z)(r?[]:[null]),[1]),columns:[].concat((0,i.Z)(r?[]:[{label:function(){var n=null===e||void 0===e?void 0:e.every((function(e){var n=e.id;return null===Ze||void 0===Ze?void 0:Ze[n]}));return(0,w.jsx)(u.Z,{checked:n,onClick:function(r){(0,B.j)(r),te(n?{rolesMapping:{}}:{rolesMapping:(0,O.HK)(e,(function(e){return e.id}))})}},"checkbox")},uuid:"actions"}]),[{uuid:"Role"}]),onClickRow:n&&!r?function(n){var r=e[n];r&&window.open("/settings/workspace/roles/".concat(null===r||void 0===r?void 0:r.id),"_blank").focus()}:null,rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.name,l=e.id,s=!(null===Ze||void 0===Ze||!Ze[l]);return[].concat((0,i.Z)(r?[]:[(0,w.jsx)(u.Z,{checked:s,onClick:function(n){(0,B.j)(n);var r=y({},Ze);s?null===r||void 0===r||delete r[l]:r[l]=e,te({rolesMapping:r})}},"checkbox")]),[(0,w.jsx)(x.ZP,{monospace:!0,children:n},"name")])})),uuid:"roles"})}),[Ze,te])),Re=(0,o.useCallback)((function(e,n,r){return(0,w.jsx)(Z.Z,{columnFlex:[null,2,1,1,6],columns:[{uuid:"ID"},{uuid:"Entity"},{uuid:"Subtype"},{uuid:"Entity ID"},{rightAligned:!0,uuid:"Access"}],onClickRow:n&&!r?function(n){var r=e[n];r&&window.open("/settings/workspace/permissions/".concat(null===r||void 0===r?void 0:r.id),"_blank").focus()}:null,rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.access,r=e.entity,i=e.entity_id,l=e.entity_name,s=e.entity_type,t=e.id,o=n?(0,P.q)(n):[],d=(null===o||void 0===o?void 0:o.length)||0;return[(0,w.jsx)(x.ZP,{default:!0,monospace:!0,children:t},"id"),(0,w.jsx)(x.ZP,{monospace:!0,children:l||r},"entityName"),(0,w.jsx)(x.ZP,{default:!0,monospace:!!s,children:s||"-"},"entityType"),(0,w.jsx)(x.ZP,{default:!0,monospace:!!i,children:i||"-"},"entityID"),(0,w.jsx)("div",{children:d>=1&&(0,w.jsx)(v.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:null===o||void 0===o?void 0:o.map((function(e,n){return(0,w.jsx)("div",{children:(0,w.jsxs)(x.ZP,{default:!0,monospace:!0,small:!0,children:[e,d>=2&&n<d-1&&(0,w.jsx)(x.ZP,{inline:!0,muted:!0,small:!0,children:",\xa0"})]})},e)}))})},"access")]})),uuid:"permissions"})}),[]),Pe=(0,o.useMemo)((function(){return De(pe)}),[De,pe]),Te=(0,o.useMemo)((function(){var e;return De(xe,!0,null===(e=M||[])||void 0===e?void 0:e.includes(k.ROLES))}),[De,M,xe]),Oe=(0,o.useMemo)((function(){var e;return Re(Ae,!0,null===(e=M||[])||void 0===e?void 0:e.includes(k.PERMISSIONS))}),[Re,M,Ae]),be=(0,w.jsxs)(A.N,{children:[(0,w.jsxs)(j.Z,{noPadding:!0,children:[(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsx)(I.Z,{level:4,children:"Profile"})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsx)(x.ZP,{default:!0,large:!0,children:"Avatar"}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Edit,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({avatar:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"Add initials or an emoji",value:(null===ie||void 0===ie?void 0:ie.avatar)||""})})]})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsxs)(x.ZP,{danger:"username"in ee&&!(null!==ie&&void 0!==ie&&ie.username),default:!0,large:!0,children:["Username ","username"in ee&&!(null!==ie&&void 0!==ie&&ie.username)&&(0,w.jsx)(x.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Edit,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({username:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Mage Supreme",value:(null===ie||void 0===ie?void 0:ie.username)||""})})]})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsx)(x.ZP,{default:!0,large:!0,children:"First name"}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Edit,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({first_name:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Urza",value:(null===ie||void 0===ie?void 0:ie.first_name)||""})})]})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsx)(x.ZP,{default:!0,large:!0,children:"Last name"}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Edit,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({last_name:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Andromeda",value:(null===ie||void 0===ie?void 0:ie.last_name)||""})})]})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[de&&(0,w.jsx)(x.ZP,{default:!0,large:!0,children:"Email"}),!de&&(0,w.jsxs)(x.ZP,{danger:"email"in ee&&!(null!==ie&&void 0!==ie&&ie.email),default:!0,large:!0,children:["Email ","email"in ee&&!(null!==ie&&void 0!==ie&&ie.email)&&(0,w.jsx)(x.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,w.jsx)(p.Z,{mr:_.cd}),de&&(0,w.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,w.jsx)(x.ZP,{large:!0,muted:!0,children:null===ie||void 0===ie?void 0:ie.email}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(L.Alphabet,{muted:!0,size:W}),(0,w.jsx)(p.Z,{mr:1})]}),!de&&(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Alphabet,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({email:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. mage@power.com",type:"email",value:(null===ie||void 0===ie?void 0:ie.email)||""})})]})})]}),(0,w.jsx)(p.Z,{mb:_.HN}),(0,w.jsxs)(j.Z,{noPadding:!0,children:[(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsx)(I.Z,{level:4,children:"Authentication"})}),(0,w.jsx)(E.Z,{light:!0}),de&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsxs)(x.ZP,{danger:"password_current"in ee&&!(null!==ie&&void 0!==ie&&ie.password_current),default:!0,large:!0,children:["Current password ","password_current"in ee&&!(null!==ie&&void 0!==ie&&ie.password_current)&&(0,w.jsx)(x.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Edit,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({password_current:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"* * * * * * * *",type:"password",value:(null===ie||void 0===ie?void 0:ie.password_current)||""})})]})}),(0,w.jsx)(E.Z,{light:!0})]}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsxs)(x.ZP,{danger:"password"in ee&&!(null!==ie&&void 0!==ie&&ie.password),default:!0,large:!0,children:[de?"New password":"Password"," ","password"in ee&&!(null!==ie&&void 0!==ie&&ie.password)&&(0,w.jsx)(x.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Edit,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({password:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"* * * * * * * *",type:"password",value:(null===ie||void 0===ie?void 0:ie.password)||""})})]})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsxs)(x.ZP,{danger:"password_confirmation"in ee&&!(null!==ie&&void 0!==ie&&ie.password_confirmation),default:!0,large:!0,children:["Confirm ",de?"new password":"password"," ","password_confirmation"in ee&&!(null!==ie&&void 0!==ie&&ie.password_confirmation)&&(0,w.jsx)(x.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(f.Z,{flex:1,children:(0,w.jsx)(h.Z,{afterIcon:(0,w.jsx)(L.Edit,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:W,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return te({password_confirmation:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"* * * * * * * *",type:"password",value:(null===ie||void 0===ie?void 0:ie.password_confirmation)||""})})]})})]}),(0,w.jsx)(p.Z,{mb:_.HN}),de&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(j.Z,{noPadding:!0,children:[(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(I.Z,{level:4,children:"Roles"}),(0,w.jsx)(p.Z,{mr:_.cd}),Le&&!(null!==(n=M||[])&&void 0!==n&&n.includes(k.ROLES))&&(0,w.jsx)(v.ZP,{alignItems:"center",children:_e})]})}),(0,w.jsx)(E.Z,{light:!0}),!Le&&!(null!==(r=M||[])&&void 0!==r&&r.includes(k.ROLES))&&(0,w.jsxs)(p.Z,{p:_.cd,children:[(0,w.jsx)(p.Z,{mb:_.cd,children:(0,w.jsx)(x.ZP,{default:!0,children:"This user currently has no roles attached."})}),(0,w.jsx)(v.ZP,{alignItems:"center",children:_e})]}),Le&&(0,w.jsx)(p.Z,{pb:_.Mq,children:Te})]}),(0,w.jsx)(p.Z,{mb:_.HN}),(0,w.jsxs)(j.Z,{noPadding:!0,children:[(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsx)(v.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,w.jsx)(I.Z,{level:4,children:"Permissions"})})}),(0,w.jsx)(E.Z,{light:!0}),!Se&&(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsx)(x.ZP,{default:!0,children:"This user currently has no permissions."})}),Se&&(0,w.jsx)(p.Z,{pb:_.Mq,children:Oe})]}),(0,w.jsx)(p.Z,{mb:_.HN}),(0,w.jsxs)(j.Z,{noPadding:!0,children:[(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsx)(I.Z,{level:4,children:"Metadata"})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsx)(x.ZP,{default:!0,large:!0,children:"Last updated"}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,w.jsx)(x.ZP,{large:!0,monospace:!0,muted:!0,children:(null===ie||void 0===ie?void 0:ie.updated_at)&&(0,D.d$)(null===ie||void 0===ie?void 0:ie.updated_at,{includeSeconds:!0})}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(L.Schedule,{muted:!0,size:W}),(0,w.jsx)(p.Z,{mr:1})]})]})}),(0,w.jsx)(E.Z,{light:!0}),(0,w.jsx)(p.Z,{p:_.cd,children:(0,w.jsxs)(v.ZP,{alignItems:"center",children:[(0,w.jsx)(x.ZP,{default:!0,large:!0,children:"Created at"}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,w.jsx)(x.ZP,{large:!0,monospace:!0,muted:!0,children:(null===ie||void 0===ie?void 0:ie.created_at)&&(0,D.d$)(null===ie||void 0===ie?void 0:ie.created_at,{includeSeconds:!0})}),(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(L.Schedule,{muted:!0,size:W}),(0,w.jsx)(p.Z,{mr:1})]})]})})]}),(0,w.jsx)(p.Z,{mb:_.HN})]}),(0,w.jsxs)(v.ZP,{children:[(0,w.jsx)(c.ZP,{beforeIcon:(0,w.jsx)(L.Save,{}),disabled:!ee||!(null!==(s=Object.keys(ee))&&void 0!==s&&s.length),loading:Ee,onClick:function(){return ue({user:y(y({},(0,b.GL)(ie,["avatar","first_name","last_name","password","password_confirmation","password_current","username"].concat(de?[]:"email"),{include_blanks:!0})),null!==M&&void 0!==M&&M.includes(k.ROLES)?{}:{role_ids:Object.keys((null===ie||void 0===ie?void 0:ie.rolesMapping)||{}).map((function(e){return Number(e)}))})})},primary:!0,children:de?"Save changes":"Create new user"}),U&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(c.ZP,{onClick:function(){return null===U||void 0===U?void 0:U()},secondary:!0,children:"Cancel and go back"})]}),de&&String(z)!==String(H)&&Q&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(p.Z,{mr:_.cd}),(0,w.jsx)(c.ZP,{beforeIcon:(0,w.jsx)(L.Trash,{}),danger:!0,loading:je,onClick:function(){return Ie()},children:"Delete user"})]})]})]});return N?be:(0,w.jsx)(m.Z,{after:Pe,afterHeader:(0,w.jsx)(p.Z,{px:_.cd,children:(0,w.jsx)(x.ZP,{bold:!0,children:$})}),afterHidden:F,afterWidth:60*_.iI,appendBreadcrumbs:!0,breadcrumbs:[{label:function(){return"Users"},linkProps:{href:"/settings/workspace/users"}},{bold:!0,label:function(){return(0,R.s)(ie)}}],setAfterHidden:G,title:de?(0,R.s)(de):"New user",uuidItemSelected:S.B2.USERS,uuidWorkspaceSelected:S.Pl.USER_MANAGEMENT,children:de&&be})}},36288:function(e,n,r){r.d(n,{Fy:function(){return v},G9:function(){return c},H1:function(){return I},K4:function(){return d},ND:function(){return a},Pt:function(){return u},WG:function(){return s},hl:function(){return f},m_:function(){return t},oO:function(){return E}});var i,l,s,t,o=r(82394);!function(e){e[e.OWNER=1]="OWNER",e[e.ADMIN=2]="ADMIN",e[e.EDITOR=4]="EDITOR",e[e.VIEWER=8]="VIEWER",e[e.LIST=16]="LIST",e[e.DETAIL=32]="DETAIL",e[e.CREATE=64]="CREATE",e[e.UPDATE=128]="UPDATE",e[e.DELETE=512]="DELETE",e[e.OPERATION_ALL=1024]="OPERATION_ALL",e[e.QUERY=2048]="QUERY",e[e.QUERY_ALL=4096]="QUERY_ALL",e[e.READ=8192]="READ",e[e.READ_ALL=16384]="READ_ALL",e[e.WRITE=32768]="WRITE",e[e.WRITE_ALL=65536]="WRITE_ALL",e[e.ALL=131072]="ALL",e[e.DISABLE_LIST=262144]="DISABLE_LIST",e[e.DISABLE_DETAIL=524288]="DISABLE_DETAIL",e[e.DISABLE_CREATE=1048576]="DISABLE_CREATE",e[e.DISABLE_UPDATE=2097152]="DISABLE_UPDATE",e[e.DISABLE_DELETE=4194304]="DISABLE_DELETE",e[e.DISABLE_OPERATION_ALL=8388608]="DISABLE_OPERATION_ALL",e[e.DISABLE_QUERY=16777216]="DISABLE_QUERY",e[e.DISABLE_QUERY_ALL=33554432]="DISABLE_QUERY_ALL",e[e.DISABLE_READ=67108864]="DISABLE_READ",e[e.DISABLE_READ_ALL=134217728]="DISABLE_READ_ALL",e[e.DISABLE_WRITE=268435456]="DISABLE_WRITE",e[e.DISABLE_WRITE_ALL=536870912]="DISABLE_WRITE_ALL",e[e.DISABLE_UNLESS_CONDITIONS=1073741824]="DISABLE_UNLESS_CONDITIONS"}(s||(s={})),function(e){e.HAS_NOTEBOOK_EDIT_ACCESS="HAS_NOTEBOOK_EDIT_ACCESS",e.HAS_PIPELINE_EDIT_ACCESS="HAS_PIPELINE_EDIT_ACCESS",e.USER_OWNS_ENTITY="USER_OWNS_ENTITY"}(t||(t={}));var d=(i={},(0,o.Z)(i,s.OWNER,"Owner"),(0,o.Z)(i,s.ADMIN,"Admin"),(0,o.Z)(i,s.EDITOR,"Editor"),(0,o.Z)(i,s.VIEWER,"Viewer"),(0,o.Z)(i,s.LIST,"List"),(0,o.Z)(i,s.DETAIL,"Detail"),(0,o.Z)(i,s.CREATE,"Create"),(0,o.Z)(i,s.UPDATE,"Update"),(0,o.Z)(i,s.DELETE,"Delete"),(0,o.Z)(i,s.OPERATION_ALL,"All operations"),(0,o.Z)(i,s.QUERY,"Query"),(0,o.Z)(i,s.QUERY_ALL,"Query all attributes"),(0,o.Z)(i,s.READ,"Read"),(0,o.Z)(i,s.READ_ALL,"Read all attributes"),(0,o.Z)(i,s.WRITE,"Write"),(0,o.Z)(i,s.WRITE_ALL,"Write all attributes"),(0,o.Z)(i,s.ALL,"All"),(0,o.Z)(i,s.DISABLE_LIST,"Disable list"),(0,o.Z)(i,s.DISABLE_DETAIL,"Disable detail"),(0,o.Z)(i,s.DISABLE_CREATE,"Disable create"),(0,o.Z)(i,s.DISABLE_UPDATE,"Disable update"),(0,o.Z)(i,s.DISABLE_DELETE,"Disable delete"),(0,o.Z)(i,s.DISABLE_OPERATION_ALL,"Disable all operations"),(0,o.Z)(i,s.DISABLE_QUERY,"Disable query"),(0,o.Z)(i,s.DISABLE_QUERY_ALL,"Disable all query parameters"),(0,o.Z)(i,s.DISABLE_READ,"Disable read"),(0,o.Z)(i,s.DISABLE_READ_ALL,"Disable all read attributes"),(0,o.Z)(i,s.DISABLE_WRITE,"Disable write"),(0,o.Z)(i,s.DISABLE_WRITE_ALL,"Disable all write attributes"),i),a=(l={},(0,o.Z)(l,t.HAS_NOTEBOOK_EDIT_ACCESS,"Disable unless user has notebook edit access"),(0,o.Z)(l,t.HAS_PIPELINE_EDIT_ACCESS,"Disable unless user has pipeline edit access"),(0,o.Z)(l,t.USER_OWNS_ENTITY,"Disable unless user owns the current entity"),l),c=[s.OWNER,s.ADMIN,s.EDITOR,s.VIEWER,s.ALL],u=[s.LIST,s.DETAIL,s.CREATE,s.UPDATE,s.DELETE,s.OPERATION_ALL],E=[s.DISABLE_LIST,s.DISABLE_DETAIL,s.DISABLE_CREATE,s.DISABLE_UPDATE,s.DISABLE_DELETE,s.DISABLE_OPERATION_ALL],f=[s.QUERY,s.QUERY_ALL,s.DISABLE_QUERY,s.DISABLE_QUERY_ALL],v=[s.READ,s.READ_ALL,s.DISABLE_READ,s.DISABLE_READ_ALL],I=[s.WRITE,s.WRITE_ALL,s.DISABLE_WRITE,s.DISABLE_WRITE_ALL]},36717:function(e,n,r){r.d(n,{q:function(){return s}});var i=r(75582),l=r(36288);function s(e){return Object.entries(l.K4).reduce((function(n,r){var l=(0,i.Z)(r,2),s=l[0],t=l[1];return e&Number(s)?n.concat(t):n}),[])}},76417:function(e,n,r){function i(e){return null!==e&&void 0!==e&&e.first_name?[null===e||void 0===e?void 0:e.first_name,null===e||void 0===e?void 0:e.last_name].filter((function(e){return e})).join(" "):null===e||void 0===e?void 0:e.username}r.d(n,{s:function(){return i}})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7966],{27966:function(e,n,t){t.d(n,{Z:function(){return Q}});var i=t(82394),r=t(75582),l=t(12691),u=t.n(l),o=t(69864),c=t(82684),s=t(34376),a=t(71180),d=t(70652),p=t(50724),f=t(97618),h=t(55485),v=t(48670),m=t(44265),g=t(89515),b=t(38276),_=t(4190),x=t(75499),j=t(48381),O=t(30160),w=t(35686),y=t(44897),P=t(42631),Z=t(72473),C=t(81655),k=t(72191),E=t(39643),D=t(25976),I=t(70515),R=D.default.div.withConfig({displayName:"Tablestyle__PopupContainerStyle",componentId:"sc-8ammqd-0"})(["position:absolute;max-height:","px;z-index:10;border-radius:","px;padding:","px;"," "," "," ",""],58*I.iI,P.TR,2*I.iI,(function(e){return"\n box-shadow: ".concat((e.theme.shadow||y.Z.shadow).popup,";\n background-color: ").concat((e.theme.interactive||y.Z.interactive).defaultBackground,";\n ")}),(function(e){return e.leftOffset&&"\n left: ".concat(e.leftOffset,"px;\n ")}),(function(e){return e.topOffset&&"\n top: ".concat(e.topOffset,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),N=t(30229),L=t(31608),S=t(16488),V=t(86735),T=t(50178),F=t(72619),A=t(95924),U=t(69419),B=t(70320),M=t(3917),z=t(44688),H=t(28598);function X(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function K(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?X(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):X(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var G={monospace:!0,small:!0};function Y(e){var n=e.cancelingRunId,t=e.disabled,i=e.isLoadingCancelPipeline,l=e.onCancel,u=e.onSuccess,s=e.pipelineRun,d=e.setCancelingRunId,f=e.setErrors,v=e.setShowConfirmationId,g=e.showConfirmationId,x=(0,T.Ct)(),j=s||{},C=j.id,E=j.pipeline_schedule_id,D=j.pipeline_schedule_token,I=j.pipeline_schedule_type,L=j.status,S=i&&C===n&&m.VO.RUNNING===L,V=(0,U.iV)(),A=(0,c.useMemo)((function(){return(null!==V&&void 0!==V&&V.page?+V.page:0)>0}),[null===V||void 0===V?void 0:V.page]),B=(0,o.Db)(N.Xm.API===I&&D?w.ZP.pipeline_runs.pipeline_schedules.useCreateWithParent(E,D):w.ZP.pipeline_runs.pipeline_schedules.useCreate(E),{onSuccess:function(e){return(0,F.wD)(e,{callback:function(){u()},onErrorCallback:function(e,n){return null===f||void 0===f?void 0:f({errors:n,response:e})}})}}),M=(0,r.Z)(B,1)[0],z=(0,c.useCallback)((function(){v(null),M({pipeline_run:{backfill_id:null===s||void 0===s?void 0:s.backfill_id,event_variables:(null===s||void 0===s?void 0:s.event_variables)||{},execution_date:null===s||void 0===s?void 0:s.execution_date,pipeline_schedule_id:null===s||void 0===s?void 0:s.pipeline_schedule_id,pipeline_uuid:null===s||void 0===s?void 0:s.pipeline_uuid,variables:(null===s||void 0===s?void 0:s.variables)||{}}})}),[M,s,v]),X=(0,c.useCallback)((function(){v(null),d(C),l({id:C,status:m.VO.CANCELLED})}),[l,C,d,v]);return(0,H.jsxs)("div",{style:{position:"relative"},children:[(0,H.jsx)(a.ZP,{backgroundColor:S&&y.Z.accent.yellow,beforeIcon:m.VO.INITIAL!==L&&!t&&(0,H.jsxs)(H.Fragment,{children:[m.VO.COMPLETED===L&&(0,H.jsx)(Z.Check,{size:k.bL}),[m.VO.FAILED,m.VO.CANCELLED].includes(L)&&(0,H.jsx)(Z.PlayButtonFilled,{inverted:m.VO.CANCELLED===L&&!x,size:k.bL}),[m.VO.RUNNING].includes(L)&&(0,H.jsx)(_.Z,{color:S?y.Z.status.negative:y.Z.monotone.white,small:!0})]}),borderRadius:"".concat(P.D7,"px"),danger:m.VO.FAILED===L&&!x,default:m.VO.INITIAL===L,disabled:t||x,loading:!s,onClick:function(e){e.stopPropagation(),v(C)},padding:"6px",primary:m.VO.RUNNING===L&&!S&&!x,warning:m.VO.CANCELLED===L&&!x,children:t?"Ready":S?"Canceling":m.Do[L]}),(0,H.jsx)(p.Z,{onClickOutside:function(){return v(null)},open:g===C,children:(0,H.jsxs)(R,{children:[[m.VO.RUNNING,m.VO.INITIAL].includes(L)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(O.ZP,{bold:!0,color:"#9ECBFF",children:"Run is in progress"}),(0,H.jsx)(b.Z,{mb:1}),(0,H.jsxs)(O.ZP,{children:["This pipeline run is currently ongoing. Retrying will cancel",(0,H.jsx)("br",{}),"the current pipeline run."]}),(0,H.jsx)(O.ZP,{}),(0,H.jsx)(b.Z,{mt:1,children:(0,H.jsxs)(h.ZP,{children:[(0,H.jsx)(a.ZP,{onClick:function(){X(),z()},children:"Retry run"}),(0,H.jsx)(b.Z,{ml:1}),(0,H.jsx)(a.ZP,{onClick:X,children:"Cancel run"})]})})]}),[m.VO.CANCELLED,m.VO.FAILED,m.VO.COMPLETED].includes(L)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(O.ZP,{bold:!0,color:"#9ECBFF",children:["Run ",L]}),(0,H.jsx)(b.Z,{mb:1}),(0,H.jsxs)(O.ZP,{children:["Retry the run with changes you have made to the pipeline.",A?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("br",{}),"Note that the retried run may appear on a previous page."]}):null]}),(0,H.jsx)(b.Z,{mb:1}),(0,H.jsx)(a.ZP,{onClick:z,children:"Retry run"})]})]})})]})}var Q=function(e){var n=e.allowBulkSelect,t=e.allowDelete,l=e.deletePipelineRun,_=e.disableKeyboardNav,y=e.disableRowSelect,D=e.emptyMessage,R=void 0===D?"No runs available":D,N=e.fetchPipelineRuns,U=e.hidePipelineColumn,X=e.hideTriggerColumn,Q=e.includePipelineTags,q=e.onClickRow,J=e.pipelineRuns,$=e.selectedRun,W=e.selectedRuns,ee=e.setSelectedRun,ne=e.setSelectedRuns,te=e.setErrors,ie=(0,s.useRouter)(),re=(0,T.Ct)(),le=(0,B.qB)(),ue=(0,c.useRef)({}),oe=(0,c.useState)(null),ce=oe[0],se=oe[1],ae=(0,c.useState)(null),de=ae[0],pe=ae[1],fe=(0,c.useState)(null),he=fe[0],ve=fe[1],me=(0,c.useState)(0),ge=me[0],be=me[1],_e=(0,c.useState)(0),xe=_e[0],je=_e[1],Oe=(0,o.Db)((function(e){var n=e.id,t=e.status;return w.ZP.pipeline_runs.useUpdate(n)({pipeline_run:{status:t}})}),{onSuccess:function(e){return(0,F.wD)(e,{callback:function(){se(null),null===N||void 0===N||N()},onErrorCallback:function(e,n){se(null),null===te||void 0===te||te({errors:n,response:e})}})}}),we=(0,r.Z)(Oe,2),ye=we[0],Pe=we[1].isLoading,Ze="PipelineDetail/Runs/Table",Ce="pipeline-runs",ke=(0,c.useCallback)((function(e){if(!e)return null;var n=J.findIndex((function(n){return n.id===e.id}));return n>=0?n:null}),[J]),Ee=(0,z.y)(),De=Ee.registerOnKeyDown,Ie=Ee.unregisterOnKeyDown;(0,c.useEffect)((function(){return function(){Ie(Ze)}}),[Ie,Ze]),De(Ze,(function(e,n){var t=n[E.Bu],i=n[E.kD];ee&&!_&&(t||i)&&ee((function(n){var r=ke(n);if(null!==r){if(e.repeat)return e.preventDefault(),n;if(t){var l=r-1;return l<0&&(l=J.length-1),J[l]}if(i){var u=r+1;return u>=J.length&&(u=0),J[u]}}return n}))}),[J,ee]),(0,c.useEffect)((function(){var e=ke($);if(null!==e){var n=(0,C.w4)({rowIndex:e,uuid:Ce}),t=document.getElementById(n);t&&t.scrollIntoView({behavior:"smooth",block:"center"})}}),[ke,$]);var Re=le?C.O$:{},Ne=[null,null,null,null],Le=[{uuid:"Status"},{center:!0,uuid:"Logs"},{center:!0,uuid:"ID"},{uuid:"Block runs"}];U||(Ne.push(1),Le.push({uuid:"Pipeline"})),X||(Ne.push(1),Le.push({uuid:"Trigger"})),Q&&(Ne.push(null),Le.push({uuid:"Pipeline tags"})),Ne.push.apply(Ne,[1,1,1,null,null]),Le.push.apply(Le,[K(K({},Re),{},{uuid:"Execution date"}),K(K({},Re),{},{uuid:"Started at"}),K(K({},Re),{},{uuid:"Completed at"}),{uuid:"Execution time"}]),t&&!re&&(Ne.push.apply(Ne,[null]),Le.push({label:function(){return""},uuid:"Delete"}));var Se=(0,c.useMemo)((function(){return J.every((function(e){var n=e.id;return!(null===W||void 0===W||!W[n])}))}),[J,W]);n&&(Ne.unshift(null),Le.unshift({label:function(){return(0,H.jsx)(d.Z,{checked:Se,onClick:function(){var e=(0,V.HK)(J||[],(function(e){return e.id}));ne(Se?{}:e)}})},uuid:"Selected"})),!y&&q&&(Ne.push(null),Le.push({label:function(){return""},uuid:"action"}));var Ve=(0,c.useCallback)((function(e,n){if(q&&ne&&n&&n.metaKey){var t=J[e];ne((function(e){var n=!(null===e||void 0===e||!e[t.id]);return K(K({},e),{},(0,i.Z)({},t.id,n?null:t))}))}else q&&q(e)}),[q,J,ne]);return(0,H.jsx)(L.cl,{minHeight:30*I.iI,overflowVisible:!!de,children:0===(null===J||void 0===J?void 0:J.length)?(0,H.jsx)(b.Z,{px:3,py:1,children:(0,H.jsx)(O.ZP,{bold:!0,default:!0,monospace:!0,muted:!0,children:R})}):(0,H.jsx)(x.Z,{columnFlex:Ne,columns:Le,isSelectedRow:function(e){return!y&&J[e].id===(null===$||void 0===$?void 0:$.id)},onClickRow:y?null:Ve,rowVerticalPadding:6,rows:null===J||void 0===J?void 0:J.map((function(e,r){var o=e.block_runs_count,s=e.completed_block_runs_count,_=e.completed_at,x=e.execution_date,w=e.id,E=e.pipeline_schedule_id,D=e.pipeline_schedule_name,I=e.pipeline_tags,R=e.pipeline_uuid,L=e.started_at,V=e.status;ue.current[w]=(0,c.createRef)();var T,F,B=!w&&!V,z="".concat(s," out of ").concat(o," block runs completed"),$=(0,H.jsx)(j.Z,{tags:null===I||void 0===I?void 0:I.map((function(e){return{uuid:e}}))},"row_pipeline_tags_".concat(r)),ee=[];r>0&&J[r-1].execution_date===e.execution_date&&J[r-1].pipeline_schedule_id===e.pipeline_schedule_id?(ee=[(0,H.jsx)(b.Z,{ml:1,children:(0,H.jsxs)(h.ZP,{alignItems:"center",children:[(0,H.jsx)(Z.Subitem,{size:k.bL,useStroke:!0}),(0,H.jsx)(a.ZP,{borderRadius:"".concat(P.D7,"px"),notClickable:!0,padding:"6px",children:(0,H.jsx)(O.ZP,{muted:!0,children:m.Do[V]})})]})},"row_status"),(0,H.jsx)(a.ZP,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(e){e.stopPropagation(),ie.push("/pipelines/".concat(R,"/logs?pipeline_run_id[]=").concat(w))},children:(0,H.jsx)(Z.Logs,{default:!0,size:k.bL})},"row_logs"),(0,H.jsx)(O.ZP,{center:!0,default:!0,monospace:!0,muted:!0,children:null===e||void 0===e?void 0:e.id},"row_id"),(0,H.jsx)(u(),{as:"/pipelines/".concat(R,"/runs/").concat(w),href:"/pipelines/[pipeline]/runs/[run]",passHref:!0,children:(0,H.jsx)(v.Z,{bold:!0,block:!0,centerAlign:!0,muted:!0,title:z,children:"".concat(s," / ").concat(o)})},"row_block_runs")],U||ee.push((0,H.jsx)(O.ZP,{default:!0,monospace:!0,muted:!0,children:R},"row_pipeline_uuid")),X||ee.push((0,H.jsx)(O.ZP,{default:!0,monospace:!0,muted:!0,children:"-"},"row_trigger_retry")),Q&&ee.push($),(T=ee).push.apply(T,[(0,H.jsx)(O.ZP,{default:!0,monospace:!0,muted:!0,children:"-"},"row_date_retry"),(0,c.createElement)(O.ZP,K(K({},G),{},{key:"row_started_at",muted:!0,title:L?(0,M._6)(L):null}),L?(0,S.Uc)(L,le):(0,H.jsx)(H.Fragment,{children:"\u2014"})),(0,c.createElement)(O.ZP,K(K({},G),{},{key:"row_completed_at",muted:!0,title:_?(0,M._6)(_):null}),_?(0,S.Uc)(_,le):(0,H.jsx)(H.Fragment,{children:"\u2014"})),(0,c.createElement)(O.ZP,K(K({},G),{},{default:!0,key:"row_execution_time",title:L&&_?(0,M.Qf)({endDatetime:_,showFullFormat:!0,startDatetime:L}):null}),L&&_?(0,M.Qf)({endDatetime:_,startDatetime:L}):(0,H.jsx)(H.Fragment,{children:"\u2014"}))])):(ee=[(0,H.jsx)(Y,{cancelingRunId:ce,disabled:B,isLoadingCancelPipeline:Pe,onCancel:ye,onSuccess:N,pipelineRun:e,setCancelingRunId:se,setErrors:te,setShowConfirmationId:pe,showConfirmationId:de},"row_retry_button"),(0,H.jsx)(a.ZP,{default:!0,disabled:B,iconOnly:!0,noBackground:!0,onClick:function(e){e.stopPropagation(),ie.push("/pipelines/".concat(R,"/logs?pipeline_run_id[]=").concat(w))},children:(0,H.jsx)(Z.Logs,{default:!0,size:k.bL})},"row_logs"),(0,H.jsx)(O.ZP,{center:!0,default:!0,monospace:!0,muted:!0,children:null===e||void 0===e?void 0:e.id},"row_id"),(0,H.jsx)(u(),{as:"/pipelines/".concat(R,"/runs/").concat(w),href:"/pipelines/[pipeline]/runs/[run]",passHref:!0,children:(0,H.jsx)(v.Z,{bold:!0,block:!0,centerAlign:!0,disabled:B,sky:!0,title:z,children:B?"":"".concat(s," / ").concat(o)})},"row_block_runs")],U||ee.push((0,H.jsx)(O.ZP,{default:!0,monospace:!0,children:R},"row_pipeline_uuid")),X||ee.push((0,H.jsx)(u(),{as:"/pipelines/".concat(R,"/triggers/").concat(E),href:"/pipelines/[pipeline]/triggers/[...slug]",passHref:!0,children:(0,H.jsx)(v.Z,{bold:!0,sky:!0,children:D})},"row_trigger")),Q&&ee.push($),(F=ee).push.apply(F,[(0,c.createElement)(O.ZP,K(K({},G),{},{default:!0,key:"row_date",title:x?(0,M._6)(x):null}),x?(0,S.Uc)(x,le):(0,H.jsx)(H.Fragment,{children:"\u2014"})),(0,c.createElement)(O.ZP,K(K({},G),{},{default:!0,key:"row_started_at",title:L?(0,M._6)(L):null}),L?(0,S.Uc)(L,le):(0,H.jsx)(H.Fragment,{children:"\u2014"})),(0,c.createElement)(O.ZP,K(K({},G),{},{default:!0,key:"row_completed_at",title:_?(0,M._6)(_):null}),_?(0,S.Uc)(_,le):(0,H.jsx)(H.Fragment,{children:"\u2014"})),(0,c.createElement)(O.ZP,K(K({},G),{},{default:!0,key:"row_execution_time",title:L&&_?(0,M.Qf)({endDatetime:_,showFullFormat:!0,startDatetime:L}):null}),L&&_?(0,M.Qf)({endDatetime:_,startDatetime:L}):(0,H.jsx)(H.Fragment,{children:"\u2014"}))]));if(t&&!re&&ee.push((0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(a.ZP,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(e){var n,t,i,r;(0,A.j)(e),ve(w),be((null===(n=ue.current[w])||void 0===n||null===(t=n.current)||void 0===t?void 0:t.offsetTop)||0),je((null===(i=ue.current[w])||void 0===i||null===(r=i.current)||void 0===r?void 0:r.offsetLeft)||0)},ref:ue.current[w],title:"Delete",children:(0,H.jsx)(Z.Trash,{default:!0,size:k.bL})}),(0,H.jsx)(p.Z,{onClickOutside:function(){return ve(null)},open:he===w,children:(0,H.jsx)(g.Z,{danger:!0,left:(xe||0)-C.nH,onCancel:function(){return ve(null)},onClick:function(){ve(null),l(w)},title:"Are you sure you want to delete this run (id ".concat(w,' for trigger "').concat(D,'")?'),top:(ge||0)-(r<=1?C.oz:C.OK),width:C.Xx})})]})),n){var oe=!(null===W||void 0===W||!W[w]);ee.unshift((0,H.jsx)(d.Z,{checked:oe,onClick:function(n){n.stopPropagation(),ne((function(n){return K(K({},n),{},(0,i.Z)({},w,oe?null:e))}))}},"selected-pipeline-run-".concat(w)))}return!y&&q&&ee.push((0,H.jsx)(f.Z,{flex:1,justifyContent:"flex-end",children:(0,H.jsx)(Z.ChevronRight,{default:!0,size:k.bL})})),ee})),uuid:Ce})})}},16488:function(e,n,t){t.d(n,{IJ:function(){return v},M8:function(){return P},Uc:function(){return x},XM:function(){return y},_U:function(){return h},eI:function(){return _},gU:function(){return O},lO:function(){return D},ri:function(){return g},tL:function(){return j},vJ:function(){return w},xH:function(){return b}});var i,r=t(82394),l=t(92083),u=t.n(l),o=t(3917),c=t(4383),s=t(30229),a=t(42122),d=t(86735);function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var h=function(e){return!!e&&!Object.values(s.U5).includes(e)};function v(e){return null===e||void 0===e?void 0:e.reduce((function(e,n){var t=n.block_uuid,i=n.completed_at,l=n.started_at,o=n.status,c=null;l&&i&&(c=u()(i).valueOf()-u()(l).valueOf());return f(f({},e),{},(0,r.Z)({},t,{runtime:c,status:o}))}),{})}var m,g=function(e){var n=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:s.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:s.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:s.Xm.API}];return e?n.slice(0,1):n};function b(e){var n=(0,a.gR)(e,[s.gm.INTERVAL,s.gm.TYPE]),t=e[s.gm.INTERVAL];t&&(n["schedule_interval[]"]=encodeURIComponent(t));var i=e[s.gm.TYPE];return i&&(n["schedule_type[]"]=i),n}function _(e){return e?new Date(u()(e).valueOf()):null}function x(e,n){return n?(0,o.XG)(e,n):function(e){if("string"!==typeof e)return e;var n=e.split("+")[0];return u()(_(n)).format(o.Nx)}(e)}!function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second"}(m||(m={}));var j=(i={},(0,r.Z)(i,m.DAY,86400),(0,r.Z)(i,m.HOUR,3600),(0,r.Z)(i,m.MINUTE,60),(0,r.Z)(i,m.SECOND,1),i);function O(e){var n=m.SECOND,t=e;return e%86400===0?(t/=86400,n=m.DAY):e%3600===0?(t/=3600,n=m.HOUR):e%60===0&&(t/=60,n=m.MINUTE),{time:t,unit:n}}function w(e,n){return e*j[n]}function y(e,n,t){var i,r=u()(e);return r.set("hour",+(null===n||void 0===n?void 0:n.hour)||0),r.set("minute",+(null===n||void 0===n?void 0:n.minute)||0),r.set("second",0),i=r.format(o.TD),null!==t&&void 0!==t&&t.includeSeconds&&(i=i.concat(":00")),null!==t&&void 0!==t&&t.localTimezone&&(i=r.format(o.lE),null!==t&&void 0!==t&&t.convertToUtc&&(i=(0,o.d$)(i,{includeSeconds:null===t||void 0===t?void 0:t.includeSeconds,utcFormat:!0}))),i}function P(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t="",i=!0;if(i){var r=(0,c.XF)();n?t="".concat(r,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/api_trigger"):(t="".concat(r,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/pipeline_runs"),null!==e&&void 0!==e&&e.token&&(t="".concat(t,"/").concat(e.token)))}return t}function Z(e,n,t){return e.match(/[*,-/]/)?{additionalOffset:0,cronValue:e}:function(e,n,t){var i=t.indexOf(e),r=0;if(n<0)for(var l=0;l>n;l--)0===i?(i=t.length-1,r-=1):i-=1;else if(n>0)for(var u=0;u<n;u++)i===t.length-1?(i=0,r+=1):i+=1;var o="number"===typeof t[i]?t[i]:e;return{additionalOffset:r,cronValue:String(o)}}(+e,n,t)}var C=(0,d.m5)(60),k=(0,d.m5)(24),E=(0,o.Cs)();function D(e,n){if(!e)return e;var t=u()().local().format("Z"),i=t.split(":"),r="-"===t[0],l=3===i[0].length?Number(i[0].slice(1)):Number(i[0]),o=Number(i[1]);(r&&!n||!r&&n)&&(l=-l,o=-o);var c=e.split(" "),s=c[0],a=c[1],d=c[2],p=Z(s,o,C),f=Z(a,l+p.additionalOffset,k);if(c[0]=p.cronValue,c[1]=f.cronValue,0!==(null===f||void 0===f?void 0:f.additionalOffset)){var h=Z(d,f.additionalOffset,E);c[2]=h.cronValue}return c.join(" ")}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9624],{29624:function(e,n,t){t.d(n,{Z:function(){return Q}});var i=t(82394),l=t(75582),r=t(12691),u=t.n(r),o=t(82684),c=t(69864),s=t(34376),p=t(71180),d=t(50724),a=t(30160),h=t(44897),f=t(42631),g=t(70515),v=t(25976),_=v.default.div.withConfig({displayName:"indexstyle__ModalStyle",componentId:"sc-qldrgc-0"})(["position:absolute;"," "," display:flex;flex-direction:column;width:","px;overflow:hidden;background-color:",";border:1px solid ",";border-radius:","px;box-shadow:",";"],(function(e){return e.top&&"\n top: ".concat(e.top,"px;\n ")}),(function(e){return e.left&&"\n left: ".concat(e.left,"px;\n ")}),39*g.iI,(function(e){return(e.theme||h.Z).background.dashboard}),(function(e){return(e.theme||h.Z).borders.darkLight}),f.n_,(function(e){return(e.theme||h.Z).shadow.popup})),x=v.default.div.withConfig({displayName:"indexstyle__ContentStyle",componentId:"sc-qldrgc-1"})(["display:flex;flex-direction:column;gap:","px;padding:","px ","px;"],2*g.iI,2.5*g.iI,2*g.iI),y=v.default.div.withConfig({displayName:"indexstyle__ActionsStyle",componentId:"sc-qldrgc-2"})(["display:flex;gap:","px;padding:","px;background-color:",";border-top:1px solid ",";& > *{flex:1;}"],g.iI,2*g.iI,(function(e){return(e.theme||h.Z).background.panel}),(function(e){return(e.theme||h.Z).borders.darkLight})),j=t(72473),b=t(72191),m=t(79633),Z=t(81728),C=t(28598);var P=function(e){var n=e.inProgressRunsCount,t=e.left,i=void 0===t?0:t,l=e.onAllow,r=e.onStop,u=e.pipelineScheduleId,c=e.pipelineUuid,s=e.top,d=void 0===s?0:s,h=e.topOffset,f=void 0===h?0:h,v=(0,o.useRef)(null),P=(0,o.useState)(d+f),k=P[0],w=P[1];return(0,o.useEffect)((function(){var e=null!==v&&void 0!==v&&v.current?v.current.getBoundingClientRect().height:32*g.iI,n=d+f+e>window.innerHeight;w(n?d-e:d+f)}),[i,d,f]),(0,C.jsxs)(_,{left:i,ref:v,top:k,children:[(0,C.jsxs)(x,{children:[(0,C.jsx)(j.AlertTriangle,{fill:m.$R,size:b.nz}),(0,C.jsx)(a.ZP,{bold:!0,large:!0,warning:!0,children:"There ".concat(1===n?"is":"are"," currently ").concat((0,Z._6)("run",n,!0)," in progress.")}),(0,C.jsx)(a.ZP,{large:!0,children:"Do you want to stop or allow the ".concat((0,Z._6)("run",n,!0,!0)," to complete?")})]}),(0,C.jsxs)(y,{children:[(0,C.jsx)(p.ZP,{large:!0,onClick:function(){return r(u,c)},children:"Stop"}),(0,C.jsx)(p.ZP,{large:!0,onClick:function(){return l(u)},children:"Allow"})]})]})},k=t(55485),w=t(48670),I=t(30229),O=t(89515),S=t(38276),R=t(75499),E=t(48381),A=t(69650),D=t(12468),N=t(35686),T=t(77417),q=t(19698),L=t(81655),U=t(41143),z=t(31608),B=t(16488),V=t(3917),F=t(50178),H=t(72619),X=t(95924),$=t(70320),G=t(89538);function K(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?K(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):K(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var J=1.5*g.iI;var Q=function(e){var n=e.disableActions,t=e.fetchPipelineSchedules,i=e.highlightRowOnHover,r=e.includeCreatedAtColumn,h=e.includePipelineColumn,f=e.pipeline,v=e.pipelineSchedules,_=e.pipelineTriggersByName,x=e.selectedSchedule,y=e.setErrors,m=e.setSelectedSchedule,Z=e.stickyHeader,K=null===f||void 0===f?void 0:f.uuid,Q=(0,s.useRouter)(),W=(0,T.Z)().projectPlatformActivated,Y=(0,q.Z)().status,ee=(0,o.useRef)({}),ne=(0,o.useRef)({}),te=(0,o.useState)(null),ie=te[0],le=te[1],re=(0,o.useState)(0),ue=re[0],oe=re[1],ce=(0,o.useState)(0),se=ce[0],pe=ce[1],de=(0,$.qB)(),ae=de?L.O$:{},he=(0,c.Db)((function(e){return N.ZP.pipelines.useUpdate(e.uuid)({pipeline:e})}),{onSuccess:function(e){return(0,H.wD)(e,{callback:function(){null===t||void 0===t||t()},onErrorCallback:function(e,n){return null===y||void 0===y?void 0:y({errors:n,response:e})}})}}),fe=(0,l.Z)(he,1)[0],ge=(0,c.Db)((function(e){return N.ZP.pipeline_schedules.useUpdate(e.id)({pipeline_schedule:e})}),{onSuccess:function(e){return(0,H.wD)(e,{callback:function(){null===t||void 0===t||t()},onErrorCallback:function(e,n){return null===y||void 0===y?void 0:y({errors:n,response:e})}})}}),ve=(0,l.Z)(ge,1)[0],_e=(0,c.Db)((function(e){return N.ZP.pipeline_schedules.useDelete(e)()}),{onSuccess:function(e){return(0,H.wD)(e,{callback:function(){null===t||void 0===t||t(),K?Q.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(K,"/triggers")):null===t||void 0===t||t()},onErrorCallback:function(e,n){return y({errors:n,response:e})}})}}),xe=(0,l.Z)(_e,1)[0],ye=[],je=[];n||(ye.push.apply(ye,[null]),je.push.apply(je,[{uuid:"Active"}])),ye.push.apply(ye,[1]),je.push.apply(je,[{uuid:"Name"}]),n||(ye.push.apply(ye,[null]),je.push.apply(je,[{center:!0,uuid:"Logs"}]),W&&(ye.push.apply(ye,[null]),je.push.apply(je,[{uuid:"Project"}])),h&&(ye.push.apply(ye,[1]),je.push.apply(je,[{uuid:"Pipeline"}])),ye.push.apply(ye,[null,null]),je.push.apply(je,[{uuid:"Type"},{uuid:"Frequency"}])),ye.push.apply(ye,[1,1,null,null]),je.push.apply(je,[{uuid:"Latest status"},M(M({},ae),{},{uuid:"Next run date"}),{uuid:"Runs"},{uuid:"Description"}]),n||(ye.push.apply(ye,[1]),je.push.apply(je,[{uuid:"Tags"}]),r&&(ye.push.apply(ye,[null]),je.push.apply(je,[M(M({},ae),{},{uuid:"Created at"})])),(0,F.Ct)()||(ye.push.apply(ye,[null]),je.push.apply(je,[{label:function(){return""},uuid:"edit/delete"}])));var be=(0,G.dd)((function(e){var n=e.inProgressRunsCount,t=e.left,i=e.pipelineScheduleId,l=e.pipelineUuid,r=e.top,u=e.topOffset;return(0,C.jsx)(P,{inProgressRunsCount:n,left:t,onAllow:function(e){Ce(),ve({id:e,status:I.fq.INACTIVE})},onStop:function(e,n){Ce(),fe({pipeline_schedule_id:e,status:U.V.CANCELLED,uuid:n}),ve({id:e,status:I.fq.INACTIVE})},pipelineScheduleId:i,pipelineUuid:l,top:r,topOffset:u})}),{},[],{background:!0,uuid:"disable_trigger"}),me=(0,l.Z)(be,2),Ze=me[0],Ce=me[1];return(0,C.jsx)(z.cl,{overflowVisible:!0,children:0===v.length?(0,C.jsx)(S.Z,{px:3,py:1,children:(0,C.jsx)(a.ZP,{bold:!0,default:!0,monospace:!0,muted:!0,children:"No triggers available"})}):(0,C.jsx)(R.Z,{columnFlex:ye,columns:je,highlightRowOnHover:i,isSelectedRow:function(e){return v[e].id===(null===x||void 0===x?void 0:x.id)},onClickRow:m?function(e){return null===m||void 0===m?void 0:m(v[e])}:null,rowVerticalPadding:6,rows:v.map((function(e,t){var i=e.id,l=e.created_at,c=e.description,s=e.next_pipeline_run_date,f=e.pipeline_in_progress_runs_count,v=e.pipeline_runs_count,x=e.pipeline_uuid,y=e.last_pipeline_run_status,m=e.name,Z=e.repo_path,P=e.schedule_interval,R=e.status,N=e.tags,T=I.fq.ACTIVE===R,q=(0,B._U)(P),U=K||x;ee.current[i]=(0,o.createRef)(),ne.current[i]=(0,o.createRef)();var z=null!==_&&void 0!==_&&_[m]?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(S.Z,{mr:1}),(0,C.jsx)(D.Z,{block:!0,label:"This trigger is saved in code.",size:J,widthFitContent:!0,children:(0,C.jsx)(j.Code,{default:!0,size:J})})]}):null,H=[];if(n?H.push.apply(H,[(0,C.jsxs)(k.ZP,{alignItems:"center",children:[(0,C.jsx)(a.ZP,{bold:!0,children:m}),z]},"trigger_name_".concat(t))]):H.push.apply(H,[(0,C.jsx)(D.Z,{block:!0,label:R,size:20,widthFitContent:!0,children:(0,C.jsx)("div",{ref:ee.current[i],style:{position:"relative"},children:(0,C.jsx)(A.Z,{checked:T,compact:!0,onCheck:function(e){return function(e){var n=e.event,t=e.inProgressRunsCount,i=e.pipelineIsActive,l=e.pipelineScheduleId,r=e.pipelineUuid;if((0,X.j)(n),i&&t>0){var u,o=null===(u=ee.current[l])||void 0===u?void 0:u.current,c=null===o||void 0===o?void 0:o.getBoundingClientRect(),s=c.height,p=c.left,d=c.top;Ze({inProgressRunsCount:t,left:p,pipelineScheduleId:l,pipelineUuid:r,top:d,topOffset:s})}else ve({id:l,status:i?I.fq.INACTIVE:I.fq.ACTIVE})}({event:e,inProgressRunsCount:f,pipelineIsActive:T,pipelineScheduleId:i,pipelineUuid:x})},purpleBackground:!0})})},"trigger_enabled_".concat(t)),(0,C.jsxs)(k.ZP,{alignItems:"center",children:[(0,C.jsx)(u(),{as:"/pipelines/".concat(U,"/triggers/").concat(i),href:"/pipelines/[pipeline]/triggers/[...slug]",passHref:!0,children:(0,C.jsx)(w.Z,{bold:!0,onClick:function(e){(0,X.j)(e),Q.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(U,"/triggers/").concat(i))},sky:!0,children:m})}),z]},"trigger_name_".concat(t))]),!n){var $,G;if(H.push((0,C.jsx)(p.ZP,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(){return Q.push("/pipelines/".concat(U,"/logs?pipeline_schedule_id[]=").concat(i))},children:(0,C.jsx)(j.Logs,{default:!0,size:b.bL})},"logs_button_".concat(t))),W)H.push.apply(H,[(0,C.jsx)(a.ZP,{default:!0,monospace:!0,children:null===Z||void 0===Z||null===(G=Z.replace((null===Y||void 0===Y?void 0:Y.repo_path_root)||"",""))||void 0===G?void 0:G.slice(1)},"project_".concat(t))]);h&&H.push((0,C.jsx)(a.ZP,{default:!0,monospace:!0,children:U},"pipeline_name_".concat(t))),H.push.apply(H,[(0,C.jsx)(a.ZP,{default:!0,monospace:!0,children:null===($=I.Z4[e.schedule_type])||void 0===$?void 0:$.call(I.Z4)},"trigger_type_".concat(t)),(0,C.jsx)(a.ZP,{default:!0,monospace:!0,children:de&&q?(0,B.lO)(P):P},"trigger_frequency_".concat(t))])}return H.push.apply(H,[(0,o.createElement)(a.ZP,M(M({},(0,L.NC)(y)),{},{key:"latest_run_status_".concat(t)}),y||"\u2014"),(0,C.jsx)(a.ZP,{monospace:!0,small:!0,title:s?"UTC: ".concat(s.slice(0,19)):null,children:s?de?(0,V.XG)(s,de):(0,V.d$)(s,{includeSeconds:!0,utcFormat:!0}):(0,C.jsx)(C.Fragment,{children:"\u2014"})},"trigger_next_run_date_".concat(t)),(0,C.jsx)(a.ZP,{default:!0,monospace:!0,children:v||"0"},"trigger_run_count_".concat(t)),(0,C.jsx)(a.ZP,{default:!0,title:c,width:40*g.iI,children:c},"trigger_description_".concat(t))]),n||(H.push((0,C.jsx)("div",{children:(0,C.jsx)(E.Z,{tags:null===N||void 0===N?void 0:N.map((function(e){return{uuid:e}}))})},"pipeline_tags_".concat(t))),r&&H.push((0,C.jsx)(a.ZP,{default:!0,monospace:!0,small:!0,title:l?(0,V._6)(l):null,children:(0,V.XG)(null===l||void 0===l?void 0:l.slice(0,19),de)},"created_at_".concat(t))),(0,F.Ct)()||H.push((0,C.jsxs)(k.ZP,{children:[(0,C.jsx)(p.ZP,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(){return Q.push("/pipelines/".concat(U,"/triggers/").concat(i,"/edit"))},title:"Edit",children:(0,C.jsx)(j.Edit,{default:!0,size:b.bL})}),(0,C.jsx)(S.Z,{mr:1}),(0,C.jsx)(p.ZP,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(){var e,n,t,l;le(i),oe((null===(e=ne.current[i])||void 0===e||null===(n=e.current)||void 0===n?void 0:n.offsetTop)||0),pe((null===(t=ne.current[i])||void 0===t||null===(l=t.current)||void 0===l?void 0:l.offsetLeft)||0)},ref:ne.current[i],title:"Delete",children:(0,C.jsx)(j.Trash,{default:!0,size:b.bL})}),(0,C.jsx)(d.Z,{onClickOutside:function(){return le(null)},open:ie===i,children:(0,C.jsx)(O.Z,{danger:!0,left:(se||0)-L.nH,onCancel:function(){return le(null)},onClick:function(){le(null),xe(i)},title:"Are you sure you want to delete the trigger ".concat(m,"?"),top:(ue||0)-(t<=1?L.oz:L.OK),width:L.Xx})})]},"edit_delete_buttons_".concat(t)))),H})),stickyHeader:Z,uuid:"pipeline-triggers"})})}}}]);