mage-ai 0.9.69__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 (243) 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/WorkspaceResource.py +5 -4
  13. mage_ai/cache/block_action_object/__init__.py +1 -1
  14. mage_ai/cluster_manager/kubernetes/workload_manager.py +52 -1
  15. mage_ai/cluster_manager/workspace/base.py +6 -0
  16. mage_ai/cluster_manager/workspace/kubernetes.py +22 -1
  17. mage_ai/command_center/applications/utils.py +2 -2
  18. mage_ai/command_center/presenters/text.py +1 -1
  19. mage_ai/data_preparation/executors/k8s_block_executor.py +30 -7
  20. mage_ai/data_preparation/executors/k8s_pipeline_executor.py +30 -7
  21. mage_ai/data_preparation/executors/streaming_pipeline_executor.py +1 -1
  22. mage_ai/data_preparation/git/__init__.py +50 -22
  23. mage_ai/data_preparation/git/api.py +62 -7
  24. mage_ai/data_preparation/git/utils.py +45 -21
  25. mage_ai/data_preparation/models/block/__init__.py +24 -5
  26. mage_ai/data_preparation/models/block/dynamic/utils.py +9 -4
  27. mage_ai/data_preparation/models/block/global_data_product/__init__.py +25 -2
  28. mage_ai/data_preparation/models/block/remote/__init__.py +0 -0
  29. mage_ai/data_preparation/models/block/remote/models.py +58 -0
  30. mage_ai/data_preparation/models/block/utils.py +38 -0
  31. mage_ai/data_preparation/models/constants.py +2 -0
  32. mage_ai/data_preparation/models/global_data_product/__init__.py +12 -0
  33. mage_ai/data_preparation/models/pipeline.py +9 -5
  34. mage_ai/data_preparation/models/triggers/__init__.py +4 -2
  35. mage_ai/data_preparation/storage/local_storage.py +12 -6
  36. mage_ai/orchestration/db/migrations/versions/42a14d6143f1_update_token_column_type.py +54 -0
  37. mage_ai/orchestration/db/models/oauth.py +10 -9
  38. mage_ai/orchestration/db/models/schedules.py +21 -0
  39. mage_ai/orchestration/notification/sender.py +37 -15
  40. mage_ai/orchestration/pipeline_scheduler_original.py +32 -25
  41. mage_ai/orchestration/triggers/api.py +29 -1
  42. mage_ai/orchestration/triggers/global_data_product.py +9 -4
  43. mage_ai/orchestration/triggers/utils.py +10 -1
  44. mage_ai/orchestration/utils/resources.py +3 -0
  45. mage_ai/server/api/downloads.py +4 -1
  46. mage_ai/server/api/runs.py +151 -0
  47. mage_ai/server/constants.py +1 -1
  48. mage_ai/server/frontend_dist/404.html +6 -6
  49. mage_ai/server/frontend_dist/_next/static/{_krrrgup_C-dPOpX36S8I → RhDiJSkcjCsh4xxX4BFBk}/_buildManifest.js +1 -1
  50. mage_ai/server/frontend_dist/_next/static/chunks/1557-b3502f3f1aa92ac7.js +1 -0
  51. mage_ai/server/frontend_dist/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
  52. mage_ai/server/frontend_dist/_next/static/chunks/7966-b9b85ba10667e654.js +1 -0
  53. mage_ai/server/frontend_dist/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
  54. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +1 -0
  55. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
  56. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
  57. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7181b086c93784d2.js +1 -0
  58. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
  59. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +1 -0
  60. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
  61. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
  62. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js +1 -0
  63. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +1 -0
  64. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +1 -0
  65. 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
  66. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +1 -0
  67. mage_ai/server/frontend_dist/block-layout.html +2 -2
  68. mage_ai/server/frontend_dist/compute.html +2 -2
  69. mage_ai/server/frontend_dist/files.html +2 -2
  70. mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
  71. mage_ai/server/frontend_dist/global-data-products.html +2 -2
  72. mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
  73. mage_ai/server/frontend_dist/global-hooks.html +2 -2
  74. mage_ai/server/frontend_dist/index.html +2 -2
  75. mage_ai/server/frontend_dist/manage/files.html +2 -2
  76. mage_ai/server/frontend_dist/manage/settings.html +2 -2
  77. mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
  78. mage_ai/server/frontend_dist/manage/users/new.html +2 -2
  79. mage_ai/server/frontend_dist/manage/users.html +2 -2
  80. mage_ai/server/frontend_dist/manage.html +2 -2
  81. mage_ai/server/frontend_dist/oauth.html +2 -2
  82. mage_ai/server/frontend_dist/overview.html +2 -2
  83. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  84. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  85. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  86. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
  87. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  88. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  89. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  90. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  91. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  92. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  93. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  94. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  95. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  96. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  97. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  98. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  99. mage_ai/server/frontend_dist/pipelines.html +2 -2
  100. mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +2 -2
  101. mage_ai/server/frontend_dist/platform/global-hooks.html +2 -2
  102. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  103. mage_ai/server/frontend_dist/settings/platform/preferences.html +2 -2
  104. mage_ai/server/frontend_dist/settings/platform/settings.html +2 -2
  105. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
  106. mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
  107. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  108. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
  109. mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
  110. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  111. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
  112. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  113. mage_ai/server/frontend_dist/settings.html +2 -2
  114. mage_ai/server/frontend_dist/sign-in.html +6 -6
  115. mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
  116. mage_ai/server/frontend_dist/templates.html +2 -2
  117. mage_ai/server/frontend_dist/terminal.html +2 -2
  118. mage_ai/server/frontend_dist/test.html +2 -2
  119. mage_ai/server/frontend_dist/triggers.html +2 -2
  120. mage_ai/server/frontend_dist/version-control.html +2 -2
  121. mage_ai/server/frontend_dist_base_path_template/404.html +6 -6
  122. mage_ai/server/frontend_dist_base_path_template/_next/static/{KLL5mirre9d7_ZeEpaw3s → TdpLLFome13qvM0gXvpHs}/_buildManifest.js +1 -1
  123. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-b3502f3f1aa92ac7.js +1 -0
  124. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
  125. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-b9b85ba10667e654.js +1 -0
  126. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
  127. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +1 -0
  128. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
  129. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
  130. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7181b086c93784d2.js +1 -0
  131. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
  132. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +1 -0
  133. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
  134. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
  135. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js +1 -0
  136. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +1 -0
  137. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +1 -0
  138. 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
  139. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +1 -0
  140. mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
  141. mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
  142. mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
  143. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
  144. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
  145. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +2 -2
  146. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +2 -2
  147. mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
  148. mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
  149. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
  150. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
  151. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
  152. mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
  153. mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
  154. mage_ai/server/frontend_dist_base_path_template/oauth.html +2 -2
  155. mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
  156. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
  157. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  158. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
  159. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
  160. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
  161. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
  162. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  163. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  164. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
  165. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
  166. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
  167. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
  168. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
  169. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  170. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
  171. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
  172. mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
  173. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +2 -2
  174. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +2 -2
  175. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
  176. mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +2 -2
  177. mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +2 -2
  178. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
  179. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
  180. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
  181. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
  182. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
  183. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
  184. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
  185. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
  186. mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
  187. mage_ai/server/frontend_dist_base_path_template/sign-in.html +6 -6
  188. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
  189. mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
  190. mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
  191. mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
  192. mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
  193. mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
  194. mage_ai/server/scheduler_manager.py +3 -1
  195. mage_ai/server/server.py +35 -12
  196. mage_ai/server/utils/output_display.py +2 -2
  197. mage_ai/services/aws/ecs/ecs.py +1 -0
  198. mage_ai/services/k8s/config.py +4 -4
  199. mage_ai/services/k8s/utils.py +97 -0
  200. mage_ai/shared/parsers.py +6 -1
  201. mage_ai/tests/api/operations/base/mixins.py +1 -1
  202. mage_ai/tests/api/resources/test_pipeline_resource.py +2 -2
  203. mage_ai/tests/authentication/oauth/test_utils.py +1 -1
  204. mage_ai/tests/data_preparation/models/block/test_global_data_product.py +2 -0
  205. mage_ai/tests/orchestration/triggers/test_global_data_product.py +138 -136
  206. mage_ai/tests/server/test_server.py +19 -0
  207. mage_ai/tests/services/k8s/test_job_manager.py +9 -6
  208. mage_ai/version_control/branch/utils.py +2 -1
  209. mage_ai/version_control/models.py +3 -2
  210. {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/METADATA +2 -2
  211. {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/RECORD +217 -212
  212. mage_ai/server/frontend_dist/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
  213. mage_ai/server/frontend_dist/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
  214. mage_ai/server/frontend_dist/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
  215. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
  216. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
  217. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
  218. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
  219. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
  220. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
  221. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
  222. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
  223. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
  224. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
  225. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
  226. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
  227. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
  228. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
  229. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
  230. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
  231. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
  232. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
  233. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
  234. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
  235. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
  236. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
  237. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
  238. /mage_ai/server/frontend_dist/_next/static/{_krrrgup_C-dPOpX36S8I → RhDiJSkcjCsh4xxX4BFBk}/_ssgManifest.js +0 -0
  239. /mage_ai/server/frontend_dist_base_path_template/_next/static/{KLL5mirre9d7_ZeEpaw3s → TdpLLFome13qvM0gXvpHs}/_ssgManifest.js +0 -0
  240. {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/LICENSE +0 -0
  241. {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/WHEEL +0 -0
  242. {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/entry_points.txt +0 -0
  243. {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[643],{74395:function(e,n,i){"use strict";i.d(n,{M:function(){return s},W:function(){return l}});var t=i(25976),r=i(46684),l=34*i(70515).iI,s=t.default.div.withConfig({displayName:"indexstyle__BeforeStyle",componentId:"sc-12ee2ib-0"})(["min-height:calc(100vh - ","px);"],r.Mz)},8955:function(e,n,i){"use strict";i.d(n,{G7:function(){return b},ZP:function(){return P},u$:function(){return m}});var t=i(75582),r=i(82394),l=i(26304),s=i(90299),o=i(9134),c=i(24138),u=i(38276),a=i(30160),d=i(75499),p=i(70515),g=i(16488),h=i(42122),f=i(28598),v=["height","heightOffset","pipeline","selectedRun","selectedTab","setSelectedTab"];function x(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function j(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?x(Object(i),!0).forEach((function(n){(0,r.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var m=44,Z={uuid:"Run details"},_={uuid:"Dependency tree"},b=[_,Z];function P(e){var n=e.height,i=e.heightOffset,r=e.pipeline,x=e.selectedRun,P=e.selectedTab,y=e.setSelectedTab,O=j({},(0,l.Z)(e,v));x?O.blockStatus=(0,g.IJ)(null===x||void 0===x?void 0:x.block_runs):O.noStatus=!0;var k=(0,h.Kn)(null===x||void 0===x?void 0:x.variables)?j({},null===x||void 0===x?void 0:x.variables):(null===x||void 0===x?void 0:x.variables)||{},w=null===x||void 0===x?void 0:x.event_variables;if(w&&(0,h.Kn)(w)&&!(0,h.Qr)(w))if((0,h.Kn)(k)&&k.hasOwnProperty("event")){var I=(0,h.Kn)(k.event)?k.event:{};k.event=j(j({},I),w)}else k.event=j({},w);var S=[];k&&JSON.stringify(k,null,2).split("\n").forEach((function(e){S.push(" ".concat(e))}));var C=x&&[["Run ID",null===x||void 0===x?void 0:x.id],["Variables",(0,f.jsx)(o.Z,{language:"json",small:!0,source:S.join("\n")},"variable_value")]],E=x&&(0,f.jsx)(u.Z,{pb:p.cd,px:p.cd,children:(0,f.jsx)(d.Z,{alignTop:!0,columnFlex:[null,1],columnMaxWidth:function(e){return 1===e?"100px":null},rows:C.map((function(e,n){var i=(0,t.Z)(e,2),r=i[0],l=i[1];return[(0,f.jsx)(a.ZP,{monospace:!0,muted:!0,children:r},"key_".concat(n)),(0,f.jsx)(a.ZP,{monospace:!0,textOverflow:!0,children:l},"val_".concat(n))]})),uuid:"LogDetail"})}),D=P&&y;return(0,f.jsxs)(f.Fragment,{children:[D&&(0,f.jsx)(s.Z,{onClickTab:y,selectedTabUUID:null===P||void 0===P?void 0:P.uuid,tabs:b,underlineStyle:!0}),(!D||_.uuid===(null===P||void 0===P?void 0:P.uuid))&&(0,f.jsx)(c.ZP,j(j({},O),{},{height:n,heightOffset:(i||0)+(D?m:0),pipeline:r})),Z.uuid===(null===P||void 0===P?void 0:P.uuid)&&E]})}},55072:function(e,n,i){"use strict";i.d(n,{Et:function(){return p},Q:function(){return d}});i(82684);var t=i(71180),r=i(55485),l=i(38276),s=i(31748),o=i(72473),c=i(79633),u=i(70515),a=i(28598),d=30,p=9;n.ZP=function(e){var n=e.page,i=e.maxPages,d=e.onUpdate,p=e.totalPages,g=[],h=i;if(h>p)g=Array.from({length:p},(function(e,n){return n}));else{var f=Math.floor(h/2),v=n-f;n+f>=p?(v=p-h+2,h-=2):n-f<=0?(v=0,h-=2):(h-=4,v=n-Math.floor(h/2)),g=Array.from({length:h},(function(e,n){return n+v}))}return(0,a.jsx)(a.Fragment,{children:p>0&&(0,a.jsxs)(r.ZP,{alignItems:"center",children:[(0,a.jsx)(t.ZP,{disabled:0===n,onClick:function(){return d(n-1)},children:(0,a.jsx)(o.PaginateArrowLeft,{size:1.5*u.iI,stroke:s.Av})}),!g.includes(0)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Z,{ml:1,children:(0,a.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(0)},children:1})},0),!g.includes(1)&&(0,a.jsx)(l.Z,{ml:1,children:(0,a.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0)]}),g.map((function(e){return(0,a.jsx)(l.Z,{ml:1,children:(0,a.jsx)(t.ZP,{backgroundColor:e===n&&c.a$,borderLess:!0,noBackground:!0,notClickable:e===n,onClick:function(){e!==n&&d(e)},children:e+1})},e)})),!g.includes(p-1)&&(0,a.jsxs)(a.Fragment,{children:[!g.includes(p-2)&&(0,a.jsx)(l.Z,{ml:1,children:(0,a.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0),(0,a.jsx)(l.Z,{ml:1,children:(0,a.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(p-1)},children:p})},p-1)]}),(0,a.jsx)(l.Z,{ml:1}),(0,a.jsx)(t.ZP,{disabled:n===p-1,onClick:function(){return d(n+1)},children:(0,a.jsx)(o.PaginateArrowRight,{size:1.5*u.iI,stroke:s.Av})})]})})}},36604:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return ge}});var t=i(75582),r=i(77837),l=i(82394),s=i(38860),o=i.n(s),c=i(82684),u=i(12691),a=i.n(u),d=i(25976),p=i(69864),g=i(34376),h=i(71180),f=i(39457),v=i(15338),x=i(55485),j=i(85854),m=i(48670),Z=i(55072),_=i(75457),b=i(27966),P=i(44265),y=i(30229),O=i(57653),k=i(83784),w=i(44085),I=i(38276),S=i(4190),C=i(75499),E=i(48381),D=i(30160),M=i(12468),T=i(35686),N=i(8955),A=i(77417),F=i(74395),R=i(44425),L=i(72473),U=i(72191),z=i(70515),H=i(28795),q=i(97196),X=i(8916),B=i(16488),G=i(3917),W=i(55283),K=i(44375),V=i(15610),$=i(86735),J=i(42122),Q=i(50178),Y=i(72619),ee=i(95924),ne=i(69419),ie=i(70320),te=i(28598);function re(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function le(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?re(Object(i),!0).forEach((function(n){(0,l.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):re(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var se=function(e){var n=e.errors,i=e.fetchPipelineSchedule,r=e.pipeline,l=e.pipelineSchedule,s=e.setErrors,o=e.variables,u=(0,c.useContext)(d.ThemeContext),re=(0,A.Z)().project,se=(0,g.useRouter)(),oe=(0,Q.Ct)(),ce=(0,ie.qB)(),ue=(0,c.useMemo)((function(){return(0,$.HK)((null===r||void 0===r?void 0:r.blocks)||[],(function(e){return e.uuid}))}),[r]),ae=r||{},de=ae.uuid,pe=ae.type,ge=l||{},he=ge.description,fe=ge.id,ve=ge.event_matchers,xe=ge.last_enabled_at,je=ge.name,me=ge.next_pipeline_run_date,Ze=ge.schedule_interval,_e=ge.schedule_type,be=ge.settings,Pe=ge.sla,ye=ge.start_time,Oe=ge.status,ke=ge.tags,we=ge.variables,Ie=void 0===we?{}:we,Se=(0,c.useMemo)((function(){return(0,B._U)(Ze)}),[Ze]),Ce=(0,ne.iV)(),Ee={_limit:30,_offset:30*(null!==Ce&&void 0!==Ce&&Ce.page?Ce.page:0)};null!==Ce&&void 0!==Ce&&Ce.status&&(Ee.status=Ce.status),null!==l&&void 0!==l&&l.global_data_product_uuid&&(Ee.global_data_product_uuid=null===l||void 0===l?void 0:l.global_data_product_uuid);var De=T.ZP.pipeline_runs.pipeline_schedules.list(fe,Ee,{refreshInterval:3e3,revalidateOnFocus:!0}),Me=De.data,Te=De.mutate,Ne=(0,c.useMemo)((function(){return(null===Me||void 0===Me?void 0:Me.pipeline_runs)||[]}),[Me]),Ae=(0,c.useMemo)((function(){var e;return(null===Me||void 0===Me||null===(e=Me.metadata)||void 0===e?void 0:e.count)||[]}),[Me]),Fe=(0,c.useState)(null),Re=Fe[0],Le=Fe[1],Ue=(0,c.useMemo)((function(){var e=null!==Ce&&void 0!==Ce&&Ce.page?Ce.page:0;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(b.Z,{fetchPipelineRuns:Te,onClickRow:function(e){return Le((function(n){var i=Ne[e];return(null===n||void 0===n?void 0:n.id)!==i.id?i:null}))},pipelineRuns:Ne,selectedRun:Re,setErrors:s,setSelectedRun:Le}),(0,te.jsx)(I.Z,{p:2,children:(0,te.jsx)(Z.ZP,{maxPages:9,onUpdate:function(e){var n=Number(e),i=le(le({},Ce),{},{page:n>=0?n:0});se.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(de,"/triggers/").concat(fe,"?").concat((0,ne.uM)(i)))},page:Number(e),totalPages:Math.ceil(Ae/30)})})]})}),[Te,Ne,fe,de,Ce,se,Re,s,Ae]),ze=(0,c.useState)(N.G7[0]),He=ze[0],qe=ze[1],Xe=(0,p.Db)((function(e){return T.ZP.pipeline_schedules.useUpdate(e.id)({pipeline_schedule:(0,J.gR)(e,["id"])})}),{onSuccess:function(e){return(0,Y.wD)(e,{callback:function(){i()},onErrorCallback:function(e,n){return null===s||void 0===s?void 0:s({errors:n,response:e})}})}}),Be=(0,t.Z)(Xe,2),Ge=Be[0],We=Be[1].isLoading,Ke=T.ZP.pipeline_triggers.pipelines.list(de),Ve=Ke.data,$e=Ke.mutate,Je=(0,c.useMemo)((function(){return(0,$.HK)((null===Ve||void 0===Ve?void 0:Ve.pipeline_triggers)||[],(function(e){return e.name}))}),[Ve]),Qe=(0,c.useMemo)((function(){return!(null===Je||void 0===Je||!Je[null===l||void 0===l?void 0:l.name])}),[l,Je]),Ye=(0,p.Db)(T.ZP.pipeline_triggers.pipelines.useCreate(de),{onSuccess:function(e){return(0,Y.wD)(e,{callback:function(){$e()},onErrorCallback:function(e,n){return null===s||void 0===s?void 0:s({errors:n,response:e})}})}}),en=(0,t.Z)(Ye,2),nn=en[0],tn=en[1].isLoading,rn=(0,p.Db)(T.ZP.pipeline_runs.pipeline_schedules.useCreate(fe),{onSuccess:function(e){return(0,Y.wD)(e,{callback:function(){Te()},onErrorCallback:function(e,n){return null===s||void 0===s?void 0:s({errors:n,response:e})}})}}),ln=(0,t.Z)(rn,2),sn=ln[0],on=ln[1].isLoading,cn=(0,c.useMemo)((function(){return y.fq.ACTIVE===Oe}),[Oe]),un=(0,c.useMemo)((function(){return!cn&&!(_e===y.Xm.TIME&&Ze===y.U5.ONCE)}),[cn,Ze,_e]),an=(0,c.useMemo)((function(){var e,n,i,t={default:!0,size:1.5*z.iI},r=[[(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.MultiShare,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Trigger type"})]},"trigger_type_label"),(0,te.jsx)(D.ZP,{monospace:!0,children:null===(e=y.Z4[_e])||void 0===e?void 0:e.call(y.Z4)},"trigger_type")],[(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.Switch,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Status"})]},"trigger_status_label"),(0,te.jsx)(D.ZP,{danger:!cn,monospace:!0,success:cn,children:Oe},"trigger_status")]];if(he&&r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.Alphabet,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Description"})]},"trigger_description_label"),(0,te.jsx)(D.ZP,{children:he},"trigger_description")]),Pe){var s=(0,B.gU)(Pe),o=s.time,c=s.unit,u=1===o?c:"".concat(c,"s");r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.Info,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"SLA"})]},"trigger_sla_label"),(0,te.jsx)(D.ZP,{monospace:!0,children:"".concat(o," ").concat(u)},"trigger_sla")])}if(Ze&&r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.Schedule,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Frequency"})]},"trigger_frequency_label"),(0,te.jsx)(D.ZP,{monospace:!0,children:ce&&Se?(0,B.lO)(Ze):Ze.replace("@","")},"trigger_frequency")],[(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.CalendarDate,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Next run date"})]},"trigger_next_run_date_label"),(0,te.jsx)(D.ZP,{monospace:!0,children:me?ce?(0,G.XG)(me,ce):(0,G.d$)(me,{includeSeconds:!0,utcFormat:!0}):"N/A"},"trigger_next_run_date")]),ye&&r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.CalendarDate,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Start date"})]},"trigger_start_date_label"),(0,te.jsx)(D.ZP,{monospace:!0,children:ce?(0,G.XG)(ye,ce):ye},"trigger_start_date")]),xe&&r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.CalendarDate,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Last enabled at"})]},"trigger_last_enabled_at_label"),(0,te.jsx)(D.ZP,{monospace:!0,children:ce?(0,G.XG)(xe,ce):(0,G.d$)(xe,{includeSeconds:!0})},"trigger_last_enabled_at")]),y.Xm.API===_e){var a=(0,B.M8)(l);r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(L.PlugAPI,le({},t)),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"API endpoint"})]},"trigger_api_endpoint_label"),(0,te.jsx)(f.Z,{copiedText:a,children:(0,te.jsx)(D.ZP,{monospace:!0,small:!0,children:a})},"trigger_api_endpoint")])}if(null!==be&&void 0!==be&&be.timeout){var d=(0,B.gU)(null===be||void 0===be?void 0:be.timeout),p=d.time,g=d.unit,h=1===p?g:"".concat(g,"s");r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(M.Z,{default:!0,label:"Timeout set for runs of this trigger",size:U.gt,widthFitContent:!0}),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Timeout"})]},"trigger_timeout"),(0,te.jsx)(D.ZP,{monospace:!0,children:"".concat(p," ").concat(h)},"trigger_timeout_label")])}null!==be&&void 0!==be&&be.skip_if_previous_running&&r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(M.Z,{default:!0,label:"Skip current run if any previous runs are still in progress",size:U.gt,widthFitContent:!0}),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Skip if running"})]},"trigger_skip_if_running"),(0,te.jsx)(D.ZP,{monospace:!0,children:null===(n=be.skip_if_previous_running)||void 0===n?void 0:n.toString()},"trigger_skip_if_running_label")]);(null!==be&&void 0!==be&&be.allow_blocks_to_fail&&r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(M.Z,{default:!0,label:"Trigger runs will continue running blocks if other unrelated blocks fail",size:U.gt,widthFitContent:!0}),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Allow blocks to fail"})]},"trigger_allow_blocks_to_fail"),(0,te.jsx)(D.ZP,{monospace:!0,children:be.allow_blocks_to_fail.toString()},"trigger_allow_blocks_to_fail_label")]),null!==be&&void 0!==be&&be.create_initial_pipeline_run)&&r.push([(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(M.Z,{default:!0,label:"Create initial pipeline run if start date is before current execution period",maxWidth:32*z.iI,size:U.gt}),(0,te.jsx)(I.Z,{mr:1}),(0,te.jsx)(D.ZP,{default:!0,children:"Create initial run"})]},"trigger_create_initial_pipeline_run"),(0,te.jsx)(D.ZP,{monospace:!0,children:null===(i=be.create_initial_pipeline_run)||void 0===i?void 0:i.toString()},"trigger_create_initial_pipeline_run_label")]);return(0,te.jsx)(C.Z,{columnFlex:[null,1],rows:r})}),[he,ce,cn,Se,me,l,Ze,_e,be,Pe,ye,Oe]),dn=(0,c.useMemo)((function(){return Ie||{}}),[Ie]),pn=(0,c.useMemo)((function(){var e,n=[];return(0,J.Qr)(dn)?n=(0,X.wx)(o,(function(e){return e.uuid===k.C})):Object.entries(dn).forEach((function(e){var i=(0,t.Z)(e,2),r=i[0],l=i[1];[P.sZ,y.PN].includes(r)||n.push({uuid:r,value:(0,X.FS)(l)})})),"undefined"!==typeof(n=(0,X.JZ)(n||[],_e))&&null!==(e=n)&&void 0!==e&&e.length?(0,te.jsx)(C.Z,{columnFlex:[null,1],rows:n.map((function(e){var n=e.uuid,i=e.value;return[(0,te.jsx)(D.ZP,{default:!0,monospace:!0,children:n},"settings_variable_label_".concat(n)),(0,te.jsx)(D.ZP,{monospace:!0,children:i},"settings_variable_".concat(n))]}))}):null}),[_e,dn,o]),gn=(0,c.useMemo)((function(){var e=null===dn||void 0===dn?void 0:dn[y.PN];return e?(0,te.jsx)(te.Fragment,{children:Object.entries(e||{}).map((function(e){var n,i=(0,t.Z)(e,2),r=i[0],l=i[1],s=null===ue||void 0===ue?void 0:ue[r];return(0,te.jsxs)(I.Z,{mt:1,children:[(0,te.jsx)(I.Z,{pb:1,px:z.cd,children:(0,te.jsx)(D.ZP,{color:(0,W.qn)(null===s||void 0===s?void 0:s.type,{blockColor:null===s||void 0===s?void 0:s.color,theme:u}).accent,monospace:!0,children:r})}),(0,te.jsx)(v.Z,{light:!0}),null===(n=Object.entries(l||{}))||void 0===n?void 0:n.map((function(e,n){var i=(0,t.Z)(e,2),r=i[0],l=i[1];return(0,te.jsx)("div",{children:(0,te.jsx)(C.Z,{columnFlex:[null,1],rows:[[(0,te.jsx)(D.ZP,{default:!0,monospace:!0,children:"Stream"},"stream_title_".concat(n)),(0,te.jsx)(D.ZP,{monospace:!0,rightAligned:!0,children:r},"stream_id_".concat(n))]].concat(Object.entries(l||{}).map((function(e){var n=(0,t.Z)(e,2),i=n[0],r=n[1];return[(0,te.jsx)(D.ZP,{default:!0,monospace:!0,children:i},"settings_variable_label_".concat(i)),(0,te.jsx)(D.ZP,{monospace:!0,rightAligned:!0,children:r},"settings_variable_".concat(i))]})))})},r)}))]},r)}))}):null}),[ue,dn,u]),hn=(0,c.useMemo)((function(){var e,n,i=[],t=null===dn||void 0===dn||null===(e=dn[P.sZ])||void 0===e?void 0:e.blocks;return null===r||void 0===r||null===(n=r.blocks)||void 0===n||n.forEach((function(e){var n=e.type,r=e.uuid;if(R.tf.DBT===n){var l,s=(null===t||void 0===t||null===(l=t[r])||void 0===l?void 0:l.configuration)||{},o=s.flags,c=s.prefix,u=s.suffix,a=(0,K.IU)(e).name;(o||c||u)&&i.push({flags:o,prefix:c,suffix:u,uuid:a})}})),"undefined"!==typeof i&&null!==i&&void 0!==i&&i.length?(0,te.jsx)(C.Z,{columnFlex:[1,null],rows:i.map((function(e){var n=e.flags,i=e.prefix,t=e.suffix,r=e.uuid;return[(0,te.jsxs)(D.ZP,{monospace:!0,small:!0,children:[i&&(0,te.jsx)(D.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:i}),r,t&&(0,te.jsx)(D.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:t})]},"settings_variable_label_".concat(r)),(0,te.jsx)(D.ZP,{monospace:!0,muted:!0,small:!0,children:n&&n.join(", ")},"settings_variable_".concat(r))]}))}):null}),[r,dn]),fn=(0,c.useMemo)((function(){return(0,te.jsx)(C.Z,{columnFlex:[null,1],columns:[{uuid:"Provider"},{uuid:"Event"}],rows:null===ve||void 0===ve?void 0:ve.map((function(e,n){var i=e.event_type,t=e.name;return[(0,te.jsx)(D.ZP,{default:!0,monospace:!0,children:q._P[i].label()},"".concat(i,"_").concat(n,"_label")),(0,te.jsx)(D.ZP,{monospace:!0,children:t},"".concat(i,"_").concat(n,"_name"))]}))})}),[ve]),vn=(0,c.useMemo)((function(){var e,n,i,t,l,s,o;return"undefined"===typeof(null===r||void 0===r||null===(e=r.settings)||void 0===e||null===(n=e.triggers)||void 0===n?void 0:n.save_in_code_automatically)?null===re||void 0===re||null===(i=re.pipelines)||void 0===i||null===(t=i.settings)||void 0===t||null===(l=t.triggers)||void 0===l?void 0:l.save_in_code_automatically:null===r||void 0===r||null===(s=r.settings)||void 0===s||null===(o=s.triggers)||void 0===o?void 0:o.save_in_code_automatically}),[r,re]);return(0,te.jsxs)(_.Z,{afterHidden:!Re,before:(0,te.jsxs)(F.M,{children:[(0,te.jsxs)(I.Z,{mb:z.HN,pt:z.cd,px:z.cd,children:[(0,te.jsxs)(I.Z,{mb:z.cd,children:[y.Xm.TIME===_e&&(0,te.jsx)(L.Sun,{size:5*z.iI}),y.Xm.EVENT===_e&&(0,te.jsx)(L.MusicNotes,{size:5*z.iI}),y.Xm.API===_e&&(0,te.jsx)(L.Lightning,{size:5*z.iI}),!_e&&(0,te.jsx)(L.MultiShare,{size:5*z.iI})]}),(0,te.jsx)(j.Z,{children:je})]}),(0,te.jsx)(I.Z,{px:z.cd,children:(0,te.jsx)(j.Z,{level:5,children:"Settings"})}),(0,te.jsx)(v.Z,{light:!0,mt:1,short:!0}),an,(null===ve||void 0===ve?void 0:ve.length)>=1&&(0,te.jsxs)(I.Z,{my:z.HN,children:[(0,te.jsx)(I.Z,{px:z.cd,children:(0,te.jsx)(j.Z,{level:5,children:"Events"})}),(0,te.jsx)(v.Z,{light:!0,mt:1,short:!0}),fn]}),pn&&(0,te.jsxs)(I.Z,{my:z.HN,children:[(0,te.jsx)(I.Z,{px:z.cd,children:(0,te.jsx)(j.Z,{level:5,children:"Runtime variables"})}),(0,te.jsx)(v.Z,{light:!0,mt:1,short:!0}),pn]}),gn&&(0,te.jsxs)(I.Z,{my:z.HN,children:[(0,te.jsx)(I.Z,{px:z.cd,children:(0,te.jsx)(j.Z,{level:5,children:"Bookmark values"})}),(0,te.jsx)(v.Z,{light:!0,mt:1,short:!0}),gn]}),hn&&(0,te.jsxs)(I.Z,{my:z.HN,children:[(0,te.jsx)(I.Z,{px:z.cd,children:(0,te.jsx)(j.Z,{level:5,children:"dbt runtime settings"})}),(0,te.jsx)(v.Z,{light:!0,mt:1,short:!0}),hn]}),(null===ke||void 0===ke?void 0:ke.length)>=1&&(0,te.jsxs)(I.Z,{my:z.HN,children:[(0,te.jsx)(I.Z,{px:z.cd,children:(0,te.jsx)(j.Z,{level:5,children:"Tags"})}),(0,te.jsx)(v.Z,{light:!0,mt:1,short:!0}),(0,te.jsx)(I.Z,{mt:z.cd,px:z.cd,children:(0,te.jsx)(E.Z,{tags:null===ke||void 0===ke?void 0:ke.map((function(e){return{uuid:e}}))})})]}),"\\",(0,te.jsx)(I.Z,{my:z.HN,children:(0,te.jsxs)(I.Z,{px:z.cd,children:[(0,te.jsxs)(j.Z,{level:5,children:[Qe&&"Trigger exists in code",!Qe&&"Store trigger in code"]}),(0,te.jsxs)(I.Z,{mt:1,children:[vn&&(0,te.jsxs)(D.ZP,{default:!0,children:["This trigger will automatically be persisted in code. To change this behavior, update the ",(0,te.jsx)(a(),{as:"/pipelines/".concat(de,"/settings"),href:"/pipelines/[pipeline]/settings",passHref:!0,children:(0,te.jsx)(m.Z,{openNewWindow:!0,children:"pipeline\u2019s settings"})})," or ",(0,te.jsx)(a(),{as:"/settings/workspace/preferences",href:"/settings/workspace/preferences",passHref:!0,children:(0,te.jsx)(m.Z,{openNewWindow:!0,children:"project settings"})}),"."]}),!vn&&(0,te.jsxs)(D.ZP,{default:!0,children:["Save or update the trigger and its settings in the pipeline\u2019s metadata and version control the trigger using Git. For more information, please read the ",(0,te.jsx)(m.Z,{href:"https://docs.mage.ai/guides/triggers/configure-triggers-in-code",openNewWindow:!0,children:"documentation"}),"."]})]}),!vn&&(0,te.jsxs)(I.Z,{mt:z.cd,children:[!Ve&&(0,te.jsx)(S.Z,{inverted:!0}),Ve&&(0,te.jsxs)(h.ZP,{disabled:!(null!==l&&void 0!==l&&l.id),loading:tn,onClick:function(){nn({pipeline_trigger:{pipeline_schedule_id:null===l||void 0===l?void 0:l.id}})},secondary:!0,children:[Qe&&"Update trigger in code",!Qe&&"Save trigger in code"]})]})]})})]}),beforeWidth:F.W,breadcrumbs:[{label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(de,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{label:function(){return je},linkProps:{as:"/pipelines/".concat(de,"/triggers/").concat(fe),href:"/pipelines/[pipeline]/triggers/[...slug]"}}],buildSidekick:function(e){return(0,N.ZP)(le(le({},e),{},{selectedRun:Re,selectedTab:He,setSelectedTab:qe}))},errors:n,pageName:H.M.TRIGGERS,pipeline:r,setErrors:s,subheader:(0,te.jsxs)(x.ZP,{alignItems:"center",children:[(0,te.jsx)(h.ZP,{beforeIcon:cn?(0,te.jsx)(L.LightningOff,{size:U.bL}):(0,te.jsx)(L.Lightning,{inverted:!oe,size:U.bL}),danger:cn&&!oe,loading:We,onClick:function(e){(0,ee.j)(e),Ge({id:fe,status:cn?y.fq.INACTIVE:y.fq.ACTIVE})},outline:!0,success:!cn&&!oe,children:cn?"Disable trigger":"Enable trigger"}),(0,te.jsx)(I.Z,{mr:z.cd}),pe!==O.qL.STREAMING&&(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(h.ZP,{beforeIcon:(0,te.jsx)(L.Once,{size:U.bL}),disabled:un,loading:on,onClick:function(){return sn({pipeline_run:{pipeline_schedule_id:fe,pipeline_uuid:de,variables:dn}})},outline:!0,title:un?"Trigger must be enabled to run@once":"Manually run pipeline once immediately",children:(0,te.jsx)(D.ZP,{disabled:un,children:"Run@once"})}),(0,te.jsx)(I.Z,{mr:z.cd})]}),!oe&&(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(h.ZP,{beforeIcon:(0,te.jsx)(L.Edit,{size:U.bL}),linkProps:{as:"/pipelines/".concat(de,"/triggers/").concat(fe,"/edit"),href:"/pipelines/[pipeline]/triggers/[...slug]"},noHoverUnderline:!0,outline:!0,sameColorAsText:!0,children:"Edit trigger"}),(0,te.jsx)(I.Z,{mr:z.cd})]}),(0,te.jsxs)(w.Z,{compact:!0,defaultColor:!0,onChange:function(e){e.preventDefault(),"all"===e.target.value?se.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(de,"/triggers/").concat(fe)):(0,V.u)({page:0,status:e.target.value})},paddingRight:4*z.iI,placeholder:"Select run status",value:(null===Ce||void 0===Ce?void 0:Ce.status)||"all",children:[(0,te.jsx)("option",{value:"all",children:"All statuses"},"all_statuses"),P.IK.map((function(e){return(0,te.jsx)("option",{value:e,children:P.Do[e]},e)}))]})]}),title:function(){return je},uuid:"triggers/detail",children:[(0,te.jsx)(I.Z,{mt:z.cd,px:z.cd,children:(0,te.jsx)(j.Z,{level:5,children:"Runs for this trigger"})}),(0,te.jsx)(v.Z,{light:!0,mt:z.cd,short:!0}),Ue]})},oe=i(12717),ce=i(93808),ue=i(92709);function ae(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function de(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ae(Object(i),!0).forEach((function(n){(0,l.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ae(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}function pe(e){var n=e.pipelineScheduleId,i=e.pipelineUUID,t=e.subpath,r=ue.b7===t,l=(0,c.useState)(null),s=l[0],o=l[1],u=T.ZP.variables.pipelines.list(i,{},{revalidateOnFocus:!1}).data,a=null===u||void 0===u?void 0:u.variables,d={};r&&(d._format="with_runtime_average");var p=T.ZP.pipeline_schedules.detail("undefined"!==typeof n&&n,d),g=p.data,h=p.mutate,f=null===g||void 0===g?void 0:g.pipeline_schedule,v=T.ZP.pipelines.detail(i,{includes_content:!1,includes_outputs:!1},{revalidateOnFocus:!1}).data,x=de(de({},null===v||void 0===v?void 0:v.pipeline),{},{uuid:i});return r?(0,te.jsx)(oe.Z,{errors:s,fetchPipelineSchedule:h,pipeline:x,pipelineSchedule:f,setErrors:o,variables:a}):(0,te.jsx)(se,{errors:s,fetchPipelineSchedule:h,pipeline:x,pipelineSchedule:f,setErrors:o,variables:a})}pe.getInitialProps=function(){var e=(0,r.Z)(o().mark((function e(n){var i,r,l,s,c,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.query,r=i.pipeline,l=i.slug,!Array.isArray(l)){e.next=4;break}return s=(0,t.Z)(l,2),c=s[0],u=s[1],e.abrupt("return",{pipelineScheduleId:c,pipelineUUID:r,subpath:u});case 4:return e.abrupt("return",{pipelineUUID:r});case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var ge=(0,ce.Z)(pe)},95488:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers/[...slug]",function(){return i(36604)}])}},function(e){e.O(0,[9161,7674,26,1557,3782,7966,2717,9774,2888,179],(function(){return n=95488,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3605],{55729:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(82394),i=n(75582),o=n(82684),c=n(69864),l=n(71180),s=n(15338),d=n(97618),u=n(55485),a=n(85854),p=n(48670),j=n(65956),f=n(82359),v=n(88543),h=n(38276),g=n(30160),m=n(17488),Z=n(69650),x=n(12468),y=n(35686),b=n(77417),O=n(25976),_=n(44897),P=n(42631),w=n(70515),k=O.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||_.Z.background).codeArea,";\n ")})),C=n(72473),E=n(72191),S=n(70320),D=n(81728),I=n(42122),N=n(72619),L=n(23780),A=n(28598);function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=function(e){var t,n,O,_=e.cancelButtonText,P=e.contained,H=e.header,M=e.onCancel,T=e.onSaveSuccess,F=e.rootProject,B=(0,L.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),U=(0,i.Z)(B,1)[0],V=(0,o.useState)(null),W=V[0],X=V[1],q=(0,o.useState)(!1),z=q[0],G=q[1],J=(0,b.Z)(),K=J.fetchProjects,Y=J.project,Q=J.projectPlatformActivated,$=J.rootProject,ee=(0,o.useMemo)((function(){return F?$:Y}),[Y,$,F]),te=ee||{},ne=te.name,re=te.openai_api_key,ie=te.project_uuid,oe=(0,o.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,o.useEffect)((function(){W||X(ee)}),[ee,W]);var ce=(0,c.Db)(y.ZP.projects.useUpdate(ne),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(e){var t,n=e.project;K(),X(n),G(!1),(0,S.hY)(null===n||void 0===n||null===(t=n.features)||void 0===t?void 0:t[f.d.LOCAL_TIMEZONE]),T&&(null===T||void 0===T||T(n))},onErrorCallback:function(e,t){return U({errors:t,response:e})}})}}),le=(0,i.Z)(ce,2),se=le[0],de=le[1].isLoading,ue=(0,o.useCallback)((function(e){return se({project:R(R({},e),{},{root_project:F})})}),[F,se]),ae=(0,A.jsxs)(A.Fragment,{children:[H,(0,A.jsxs)(j.Z,{noPadding:!0,children:[(0,A.jsxs)(h.Z,{p:w.cd,children:[(0,A.jsx)(h.Z,{mb:1,children:(0,A.jsx)(a.Z,{level:5,children:"Project name"})}),(0,A.jsx)(g.ZP,{default:!0,monospace:!0,children:ne})]}),(0,A.jsx)(s.Z,{light:!0}),(0,A.jsxs)(h.Z,{p:w.cd,children:[(0,A.jsx)(h.Z,{mb:1,children:(0,A.jsx)(a.Z,{level:5,children:"Project UUID"})}),(0,A.jsx)(g.ZP,{default:!!ie,monospace:!0,muted:!ie,children:ie||"Not required"})]}),(0,A.jsx)(s.Z,{light:!0}),(0,A.jsx)(h.Z,{p:w.cd,children:(0,A.jsxs)(u.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,A.jsxs)(d.Z,{flexDirection:"column",children:[(0,A.jsx)(h.Z,{mb:1,children:(0,A.jsx)(a.Z,{level:5,children:"Help improve Mage"})}),(0,A.jsxs)(g.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,A.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,A.jsx)(h.Z,{mr:w.cd}),(0,A.jsx)(Z.Z,{checked:null===W||void 0===W?void 0:W.help_improve_mage,compact:!0,id:"help_improve_mage_toggle",onCheck:function(){return X((function(e){return R(R({},e),{},{help_improve_mage:!(null!==W&&void 0!==W&&W.help_improve_mage)})}))}})]})})]}),(0,A.jsx)(h.Z,{mt:w.HN}),(0,A.jsx)(v.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,A.jsx)(v.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===(t=W.pipelines)||void 0===t||null===(n=t.settings)||void 0===n||null===(O=n.triggers)||void 0===O||!O.save_in_code_automatically),onCheck:function(e){return X((function(t){var n,r,i,o,c,l;return R(R({},t),{},{pipelines:R(R({},null===t||void 0===t?void 0:t.pipelines),{},{settings:R(R({},null===t||void 0===t||null===(n=t.pipelines)||void 0===n?void 0:n.settings),{},{triggers:R(R({},null===t||void 0===t||null===(r=t.pipelines)||void 0===r||null===(i=r.settings)||void 0===i?void 0:i.triggers),{},{save_in_code_automatically:e(null===t||void 0===t||null===(o=t.pipelines)||void 0===o||null===(c=o.settings)||void 0===c||null===(l=c.triggers)||void 0===l?void 0:l.save_in_code_automatically)})})})})}))}}})}),(0,A.jsx)(h.Z,{mt:w.HN}),(0,A.jsx)(j.Z,{noPadding:!0,overflowVisible:!0,children:(0,A.jsxs)(h.Z,{p:w.cd,children:[(0,A.jsx)(h.Z,{mb:1,children:(0,A.jsx)(a.Z,{level:5,children:"Features"})}),Object.entries((0,I.gR)(null===W||void 0===W?void 0:W.features,[f.d.CODE_BLOCK_V2])||{}).map((function(e,t){var n=(0,i.Z)(e,2),o=n[0],c=n[1],l=Q&&!F&&(null===ee||void 0===ee?void 0:ee.features_override)&&o in(null===ee||void 0===ee?void 0:ee.features_override);return(0,A.jsx)(h.Z,{mt:0===t?0:1,children:(0,A.jsxs)(u.ZP,{alignItems:"center",children:[(0,A.jsxs)(d.Z,{flex:1,children:[(0,A.jsx)(Z.Z,{disabled:l,checked:!!c,compact:!0,onCheck:function(){return X((function(e){return R(R({},e),{},{features:R(R({},null===W||void 0===W?void 0:W.features),{},(0,r.Z)({},o,!c))})}))}}),(0,A.jsx)(h.Z,{mr:w.cd}),(0,A.jsxs)(d.Z,{children:[(0,A.jsx)(g.ZP,{default:!c,monospace:!0,children:(0,D.vg)(o)}),o===f.d.LOCAL_TIMEZONE&&(0,A.jsx)(h.Z,{ml:1,children:(0,A.jsx)(x.Z,R({},S.EB))})]})]}),l&&(0,A.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"overridden"})]})},o)}))]})}),(0,A.jsx)(h.Z,{mt:w.HN}),(0,A.jsx)(j.Z,{noPadding:!0,children:(0,A.jsxs)(h.Z,{p:w.cd,children:[(0,A.jsx)(h.Z,{mb:1,children:(0,A.jsx)(a.Z,{level:5,children:"OpenAI"})}),re&&!z?(0,A.jsxs)(u.ZP,R(R({},u.A0),{},{children:[(0,A.jsx)(g.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,A.jsx)(l.ZP,{iconOnly:!0,onClick:function(){return G(!0)},secondary:!0,title:"Edit",children:(0,A.jsx)(C.Edit,{size:E.bL})})]})):(0,A.jsx)(m.Z,{disabled:oe,label:oe?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return X((function(t){return R(R({},t),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===W||void 0===W?void 0:W.openai_api_key)||""})]})}),(0,A.jsx)(h.Z,{mt:w.HN}),(0,A.jsxs)(u.ZP,{alignItems:"center",children:[(0,A.jsx)(l.ZP,{id:"save-project-settings",loading:de,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),ue(e)},primary:!0,children:"Save project settings"}),M&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(h.Z,{mr:w.cd}),(0,A.jsx)(l.ZP,{onClick:M,secondary:!0,children:_||"Cancel"})]})]})]});return P?(0,A.jsx)(k,{children:ae}):ae}},46568:function(e,t,n){"use strict";var r=n(82394),i=n(26304),o=(n(82684),n(33591)),c=n(28598),l=["children","fullHeight","gutter","style"];function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e){var t=e.children,n=e.fullHeight,r=e.gutter,s=e.style,u=void 0===s?{}:s,a=(0,i.Z)(e,l),p=d({},u);return r&&(p.paddingLeft=r,p.paddingRight=p.paddingLeft),n&&(p.height="100%"),(0,c.jsx)(o.Col,d(d({},a),{},{style:p,children:t}))}},82682:function(e,t,n){"use strict";var r=n(82394),i=n(26304),o=n(82684),c=n(33591),l=n(28598),s=["children","fullHeight","gutter","justifyContent","style"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e){var t=e.children,n=e.fullHeight,r=e.gutter,d=e.justifyContent,a=e.style,p=void 0===a?{}:a,j=(0,i.Z)(e,s),f=u({},p);return r&&(f.marginLeft=-1*r,f.marginRight=f.marginLeft),n&&(f.height="100%"),(0,l.jsx)(c.Row,u(u({},j),{},{justifyContent:d,style:f,children:o.Children.map(t,(function(e,t){return e&&o.cloneElement(e,{gutter:r,key:t})}))}))}},70791:function(e,t,n){"use strict";n.r(t);var r=n(77837),i=n(38860),o=n.n(i),c=n(46568),l=n(55729),s=n(93808),d=n(82682),u=n(28274),a=n(38276),p=n(70515),j=n(24755),f=n(28598);function v(){return(0,f.jsx)(u.Z,{uuidItemSelected:j.B2.PREFERENCES,uuidWorkspaceSelected:j.Pl.PROJECT_PLATFORM,children:(0,f.jsx)(a.Z,{p:p.cd,children:(0,f.jsx)(d.Z,{justifyContent:"center",children:(0,f.jsx)(c.Z,{xl:8,xxl:6,children:(0,f.jsx)(l.Z,{rootProject:!0})})})})})}v.getInitialProps=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),t.default=(0,s.Z)(v)},8071:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/platform/preferences",function(){return n(70791)}])}},function(e){e.O(0,[1557,5699,9774,2888,179],(function(){return t=8071,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3853],{55729:function(e,n,t){"use strict";t.d(n,{Z:function(){return T}});var r=t(82394),i=t(75582),o=t(82684),c=t(69864),l=t(71180),s=t(15338),d=t(97618),u=t(55485),a=t(85854),p=t(48670),j=t(65956),f=t(82359),v=t(88543),h=t(38276),g=t(30160),m=t(17488),Z=t(69650),x=t(12468),y=t(35686),b=t(77417),O=t(25976),_=t(44897),P=t(42631),w=t(70515),k=O.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||_.Z.background).codeArea,";\n ")})),C=t(72473),E=t(72191),S=t(70320),D=t(81728),I=t(42122),N=t(72619),L=t(23780),H=t(28598);function A(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?A(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var T=function(e){var n,t,O,_=e.cancelButtonText,P=e.contained,A=e.header,T=e.onCancel,R=e.onSaveSuccess,B=e.rootProject,F=(0,L.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),U=(0,i.Z)(F,1)[0],V=(0,o.useState)(null),W=V[0],X=V[1],Y=(0,o.useState)(!1),q=Y[0],z=Y[1],G=(0,b.Z)(),K=G.fetchProjects,J=G.project,Q=G.projectPlatformActivated,$=G.rootProject,ee=(0,o.useMemo)((function(){return B?$:J}),[J,$,B]),ne=ee||{},te=ne.name,re=ne.openai_api_key,ie=ne.project_uuid,oe=(0,o.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,o.useEffect)((function(){W||X(ee)}),[ee,W]);var ce=(0,c.Db)(y.ZP.projects.useUpdate(te),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(e){var n,t=e.project;K(),X(t),z(!1),(0,S.hY)(null===t||void 0===t||null===(n=t.features)||void 0===n?void 0:n[f.d.LOCAL_TIMEZONE]),R&&(null===R||void 0===R||R(t))},onErrorCallback:function(e,n){return U({errors:n,response:e})}})}}),le=(0,i.Z)(ce,2),se=le[0],de=le[1].isLoading,ue=(0,o.useCallback)((function(e){return se({project:M(M({},e),{},{root_project:B})})}),[B,se]),ae=(0,H.jsxs)(H.Fragment,{children:[A,(0,H.jsxs)(j.Z,{noPadding:!0,children:[(0,H.jsxs)(h.Z,{p:w.cd,children:[(0,H.jsx)(h.Z,{mb:1,children:(0,H.jsx)(a.Z,{level:5,children:"Project name"})}),(0,H.jsx)(g.ZP,{default:!0,monospace:!0,children:te})]}),(0,H.jsx)(s.Z,{light:!0}),(0,H.jsxs)(h.Z,{p:w.cd,children:[(0,H.jsx)(h.Z,{mb:1,children:(0,H.jsx)(a.Z,{level:5,children:"Project UUID"})}),(0,H.jsx)(g.ZP,{default:!!ie,monospace:!0,muted:!ie,children:ie||"Not required"})]}),(0,H.jsx)(s.Z,{light:!0}),(0,H.jsx)(h.Z,{p:w.cd,children:(0,H.jsxs)(u.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(d.Z,{flexDirection:"column",children:[(0,H.jsx)(h.Z,{mb:1,children:(0,H.jsx)(a.Z,{level:5,children:"Help improve Mage"})}),(0,H.jsxs)(g.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,H.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,H.jsx)(h.Z,{mr:w.cd}),(0,H.jsx)(Z.Z,{checked:null===W||void 0===W?void 0:W.help_improve_mage,compact:!0,id:"help_improve_mage_toggle",onCheck:function(){return X((function(e){return M(M({},e),{},{help_improve_mage:!(null!==W&&void 0!==W&&W.help_improve_mage)})}))}})]})})]}),(0,H.jsx)(h.Z,{mt:w.HN}),(0,H.jsx)(v.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,H.jsx)(v.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===(O=t.triggers)||void 0===O||!O.save_in_code_automatically),onCheck:function(e){return X((function(n){var t,r,i,o,c,l;return M(M({},n),{},{pipelines:M(M({},null===n||void 0===n?void 0:n.pipelines),{},{settings:M(M({},null===n||void 0===n||null===(t=n.pipelines)||void 0===t?void 0:t.settings),{},{triggers:M(M({},null===n||void 0===n||null===(r=n.pipelines)||void 0===r||null===(i=r.settings)||void 0===i?void 0:i.triggers),{},{save_in_code_automatically:e(null===n||void 0===n||null===(o=n.pipelines)||void 0===o||null===(c=o.settings)||void 0===c||null===(l=c.triggers)||void 0===l?void 0:l.save_in_code_automatically)})})})})}))}}})}),(0,H.jsx)(h.Z,{mt:w.HN}),(0,H.jsx)(j.Z,{noPadding:!0,overflowVisible:!0,children:(0,H.jsxs)(h.Z,{p:w.cd,children:[(0,H.jsx)(h.Z,{mb:1,children:(0,H.jsx)(a.Z,{level:5,children:"Features"})}),Object.entries((0,I.gR)(null===W||void 0===W?void 0:W.features,[f.d.CODE_BLOCK_V2])||{}).map((function(e,n){var t=(0,i.Z)(e,2),o=t[0],c=t[1],l=Q&&!B&&(null===ee||void 0===ee?void 0:ee.features_override)&&o in(null===ee||void 0===ee?void 0:ee.features_override);return(0,H.jsx)(h.Z,{mt:0===n?0:1,children:(0,H.jsxs)(u.ZP,{alignItems:"center",children:[(0,H.jsxs)(d.Z,{flex:1,children:[(0,H.jsx)(Z.Z,{disabled:l,checked:!!c,compact:!0,onCheck:function(){return X((function(e){return M(M({},e),{},{features:M(M({},null===W||void 0===W?void 0:W.features),{},(0,r.Z)({},o,!c))})}))}}),(0,H.jsx)(h.Z,{mr:w.cd}),(0,H.jsxs)(d.Z,{children:[(0,H.jsx)(g.ZP,{default:!c,monospace:!0,children:(0,D.vg)(o)}),o===f.d.LOCAL_TIMEZONE&&(0,H.jsx)(h.Z,{ml:1,children:(0,H.jsx)(x.Z,M({},S.EB))})]})]}),l&&(0,H.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"overridden"})]})},o)}))]})}),(0,H.jsx)(h.Z,{mt:w.HN}),(0,H.jsx)(j.Z,{noPadding:!0,children:(0,H.jsxs)(h.Z,{p:w.cd,children:[(0,H.jsx)(h.Z,{mb:1,children:(0,H.jsx)(a.Z,{level:5,children:"OpenAI"})}),re&&!q?(0,H.jsxs)(u.ZP,M(M({},u.A0),{},{children:[(0,H.jsx)(g.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,H.jsx)(l.ZP,{iconOnly:!0,onClick:function(){return z(!0)},secondary:!0,title:"Edit",children:(0,H.jsx)(C.Edit,{size:E.bL})})]})):(0,H.jsx)(m.Z,{disabled:oe,label:oe?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return X((function(n){return M(M({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===W||void 0===W?void 0:W.openai_api_key)||""})]})}),(0,H.jsx)(h.Z,{mt:w.HN}),(0,H.jsxs)(u.ZP,{alignItems:"center",children:[(0,H.jsx)(l.ZP,{id:"save-project-settings",loading:de,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),ue(e)},primary:!0,children:"Save project settings"}),T&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(h.Z,{mr:w.cd}),(0,H.jsx)(l.ZP,{onClick:T,secondary:!0,children:_||"Cancel"})]})]})]});return P?(0,H.jsx)(k,{children:ae}):ae}},46568:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=(t(82684),t(33591)),c=t(28598),l=["children","fullHeight","gutter","style"];function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function d(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,r.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}n.Z=function(e){var n=e.children,t=e.fullHeight,r=e.gutter,s=e.style,u=void 0===s?{}:s,a=(0,i.Z)(e,l),p=d({},u);return r&&(p.paddingLeft=r,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,c.jsx)(o.Col,d(d({},a),{},{style:p,children:n}))}},82682:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=t(82684),c=t(33591),l=t(28598),s=["children","fullHeight","gutter","justifyContent","style"];function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,r=e.gutter,d=e.justifyContent,a=e.style,p=void 0===a?{}:a,j=(0,i.Z)(e,s),f=u({},p);return r&&(f.marginLeft=-1*r,f.marginRight=f.marginLeft),t&&(f.height="100%"),(0,l.jsx)(c.Row,u(u({},j),{},{justifyContent:d,style:f,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:r,key:n})}))}))}},61316:function(e,n,t){"use strict";t.r(n);var r=t(77837),i=t(38860),o=t.n(i),c=t(46568),l=t(55729),s=t(93808),d=t(82682),u=t(28274),a=t(38276),p=t(70515),j=t(24755),f=t(28598);function v(){return(0,f.jsx)(u.Z,{uuidItemSelected:j.HY,uuidWorkspaceSelected:j.WH,children:(0,f.jsx)(a.Z,{p:p.cd,children:(0,f.jsx)(d.Z,{justifyContent:"center",children:(0,f.jsx)(c.Z,{xl:8,xxl:6,children:(0,f.jsx)(l.Z,{})})})})})}v.getInitialProps=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),n.default=(0,s.Z)(v)},33323:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/workspace/preferences",function(){return t(61316)}])}},function(e){e.O(0,[1557,5699,9774,2888,179],(function(){return n=33323,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2403],{60480:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return G}});var r,i=t(77837),s=t(82394),o=t(75582),l=t(38860),c=t.n(l),u=t(82684),a=t(12691),d=t.n(a),h=t(21764),p=t(69864),m=t(71180),y=t(70652),b=t(50724),f=t(1402),v=t(55485),j=t(85854),x=t(48670),_=t(93808),Z=t(44085),g=t(28274),k=t(38276);!function(e){e.SSH="ssh",e.HTTPS="https"}(r||(r={}));var w=[{autoComplete:"remote_repo_link",label:"Remote repo url",required:!0,uuid:"remote_repo_link"},{autoComplete:"repo_path",label:"Local directory path",labelDescription:"Defaults to Python's os.getcwd() if omitted. Mage will create this local directory if it doesn't already exist.",uuid:"repo_path"}],P=[{autoComplete:"username",label:"Username",uuid:"username"},{autoComplete:"email",label:"Email",uuid:"email"},{autoComplete:"ssh_public_key",label:"SSH public key in base64",type:"password",uuid:"ssh_public_key"},{autoComplete:"ssh_private_key",label:"SSH private key in base64",type:"password",uuid:"ssh_private_key"}],O=[{autoComplete:"username",label:"Username",required:!0,uuid:"username"},{autoComplete:"email",label:"Email",required:!0,uuid:"email"},{autoComplete:"access_token",label:"Access token",labelDescription:"Add your Git access token to authenticate with your provided username. The access token will be stored as a Mage secret.",required:!0,type:"password",uuid:"access_token"}],C=[{autoComplete:"branch",label:"Branch name",required:!0,uuid:"branch"}],S=t(30160),T=t(17488),I=t(35686),M=t(70515),q=t(24755),H=t(72619),A=t(28598);function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?D(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function N(){var e=I.ZP.syncs.list().data,n=(0,u.useState)(null),t=n[0],i=n[1],l=(0,u.useState)(null),c=l[0],a=l[1],_=(0,u.useState)(null),D=_[0],N=_[1],G=(0,u.useState)(null),R=G[0],B=G[1];(0,u.useEffect)((function(){if(e){var n,t=null===e||void 0===e||null===(n=e.syncs)||void 0===n?void 0:n[0];a(null===t||void 0===t?void 0:t.user_git_settings),i(t),B(!(null===t||void 0===t||!t.branch))}}),[e]);var F=(0,u.useMemo)((function(){if(e){var n,t=null===e||void 0===e||null===(n=e.syncs)||void 0===n?void 0:n[0];return!(null===t||void 0===t||!t.branch)}return!1}),[e]),U=(0,p.Db)(I.ZP.syncs.useCreate(),{onSuccess:function(e){return(0,H.wD)(e,{callback:function(e){var n=e.sync;n&&(i(n),window.location.reload(),h.Am.success("Sync saved",{position:h.Am.POSITION.BOTTOM_RIGHT,toastId:"data_sync_success"}))},onErrorCallback:function(e,n){return N({errors:n,response:e})}})}}),W=(0,o.Z)(U,2),L=W[0],z=W[1].isLoading,X=(0,p.Db)(I.ZP.syncs.useUpdate("git"),{onSuccess:function(e){return(0,H.wD)(e,{callback:function(e){e.sync&&h.Am.success("Success!",{position:h.Am.POSITION.BOTTOM_RIGHT,toastId:"data_sync_success"})},onErrorCallback:function(e,n){return N({errors:n,response:e})}})}}),Y=(0,o.Z)(X,2),J=Y[0],K=Y[1].isLoading,Q=(0,u.useMemo)((function(){return(null===t||void 0===t?void 0:t.auth_type)||r.SSH}),[null===t||void 0===t?void 0:t.auth_type]),V=(0,u.useMemo)((function(){return Q===r.HTTPS?O:P}),[Q]),$=I.ZP.statuses.list().data,ee=(0,u.useMemo)((function(){var e,n;return null===$||void 0===$||null===(e=$.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.require_user_authentication}),[$]),ne=(0,u.useMemo)((function(){var e=i,n=t;return!R&&ee&&(e=a,n=c),(0,A.jsx)("form",{children:V.map((function(t){var r,i,o=t.autoComplete,l=t.disabled,c=t.label,u=t.labelDescription,a=t.required,d=t.type,p=t.uuid;return i="ssh_public_key"===p?(0,A.jsx)(k.Z,{mb:1,children:(0,A.jsxs)(S.ZP,{small:!0,children:["Run ",(0,A.jsx)(x.Z,{onClick:function(){navigator.clipboard.writeText("cat ~/.ssh/id_ed25519.pub | base64 | tr -d \\\\n && echo"),h.Am.success("Successfully copied to clipboard.",{position:h.Am.POSITION.BOTTOM_RIGHT,toastId:p})},small:!0,children:"cat ~/.ssh/id_ed25519.pub | base64 | tr -d \\\\n && echo"})," in terminal to get base64 encoded public key and paste the result here. The key will be stored as a Mage secret."]})}):"ssh_private_key"===p?(0,A.jsx)(k.Z,{mb:1,children:(0,A.jsxs)(S.ZP,{small:!0,children:["Follow same steps as the public key, but run ",(0,A.jsx)(x.Z,{onClick:function(){navigator.clipboard.writeText("cat ~/.ssh/id_ed25519 | base64 | tr -d \\\\n && echo"),h.Am.success("Successfully copied to clipboard.",{position:h.Am.POSITION.BOTTOM_RIGHT,toastId:p})},small:!0,children:"cat ~/.ssh/id_ed25519 | base64 | tr -d \\\\n && echo"})," instead. The key will be stored as a Mage secret."]})}):u&&(0,A.jsx)(k.Z,{mb:1,children:(0,A.jsx)(S.ZP,{small:!0,children:u})}),(0,A.jsxs)(k.Z,{mt:2,children:[i,(0,A.jsx)(T.Z,{autoComplete:o,disabled:l,label:c,onChange:function(n){e((function(e){return E(E({},e),{},(0,s.Z)({},p,n.target.value))}))},primary:!0,required:a,setContentOnMount:!0,type:d,value:(null===(r=n)||void 0===r?void 0:r[p])||""})]},p)}))})}),[V,ee,a,i,R,t,c]);return(0,A.jsx)(g.Z,{uuidItemSelected:q.fF,uuidWorkspaceSelected:q.WH,children:(0,A.jsxs)(k.Z,{p:M.cd,style:{width:"600px"},children:[(0,A.jsx)(j.Z,{children:"Git repository settings"}),(0,A.jsxs)(S.ZP,{children:["If you are using Github and want to use a more feature rich integration, you can check out the ",(0,A.jsx)(d(),{as:"/version-control",href:"/version-control",children:(0,A.jsx)(x.Z,{inline:!0,children:"version control app"})}),"."]}),(0,A.jsx)(x.Z,{}),(0,A.jsx)(k.Z,{mt:1,children:(0,A.jsx)(S.ZP,{bold:!0,children:"Authentication type"})}),(0,A.jsx)(k.Z,{mt:1,children:(0,A.jsx)(Z.Z,{compact:!0,label:"Authentication type",onChange:function(e){var n=e.target.value;i((function(e){return E(E({},e),{},{auth_type:n})}))},value:Q,children:Object.entries(r).map((function(e){var n=(0,o.Z)(e,2),t=n[0],r=n[1];return(0,A.jsx)("option",{value:r,children:t},r)}))})}),(0,A.jsx)(k.Z,{mt:M.Mq,children:Q===r.SSH&&(0,A.jsxs)(S.ZP,{bold:!0,children:["You will need to ",(0,A.jsx)(x.Z,{href:"https://docs.mage.ai/development/git/configure#generate-ssh-token",openNewWindow:!0,children:"set up your SSH key"})," if you have not done so already."]})}),(0,A.jsx)("form",{children:w.map((function(e){var n=e.autoComplete,r=e.disabled,o=e.label,l=e.labelDescription,c=e.required,u=e.type,a=e.uuid;return(0,A.jsxs)(k.Z,{mt:2,children:[l&&(0,A.jsx)(k.Z,{mb:1,children:(0,A.jsx)(S.ZP,{small:!0,children:l})}),(0,A.jsx)(T.Z,{autoComplete:n,disabled:r,label:o,onChange:function(e){i((function(n){return E(E({},n),{},(0,s.Z)({},a,e.target.value))}))},primary:!0,required:c,setContentOnMount:!0,type:u,value:(null===t||void 0===t?void 0:t[a])||""})]},a)}))}),(0,A.jsx)(k.Z,{mt:M.Mq,children:(0,A.jsxs)(v.ZP,{alignItems:"center",children:[(0,A.jsx)(k.Z,{mr:1,children:(0,A.jsx)(y.Z,{checked:!!R,onClick:function(){return B((function(e){var n=!e;return n||i((function(e){return E(E({},e),{},{branch:null,sync_on_executor_start:!1,sync_on_pipeline_run:!1,sync_on_start:!1,sync_submodules:!1})})),n}))}})}),(0,A.jsxs)(S.ZP,{bold:!0,children:["Use ",(0,A.jsx)(x.Z,{bold:!0,href:"https://docs.mage.ai/production/data-sync/git-sync",openNewWindow:!0,children:"One-way git sync"})," (Click link for more info)"]})]})}),R?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(k.Z,{mt:M.Mq,children:(0,A.jsx)(S.ZP,{bold:!0,children:"Sync with a specified branch. These settings will be saved at the project level."})}),(0,A.jsx)("form",{children:C.map((function(e){var n=e.autoComplete,r=e.disabled,o=e.label,l=e.required,c=e.type,u=e.uuid;return(0,A.jsx)(k.Z,{mt:2,children:(0,A.jsx)(T.Z,{autoComplete:n,disabled:r,label:o,onChange:function(e){i((function(n){return E(E({},n),{},(0,s.Z)({},u,e.target.value))}))},primary:!0,required:l,setContentOnMount:!0,type:c,value:(null===t||void 0===t?void 0:t[u])||""})},u)}))}),(0,A.jsx)(v.ZP,{alignItems:"center",children:(0,A.jsx)(k.Z,{mt:2,children:(0,A.jsx)(y.Z,{checked:null===t||void 0===t?void 0:t.sync_submodules,label:"Include submodules",onClick:function(){i((function(e){return E(E({},e),{},{sync_submodules:!(null!==t&&void 0!==t&&t.sync_submodules)})}))}})})}),(0,A.jsx)(k.Z,{mt:2,children:(0,A.jsx)(j.Z,{level:5,children:"Additional sync settings"})}),(0,A.jsx)(v.ZP,{alignItems:"center",children:(0,A.jsx)(k.Z,{mt:2,children:(0,A.jsx)(y.Z,{checked:null===t||void 0===t?void 0:t.sync_on_pipeline_run,label:"Sync before each trigger run",onClick:function(){i((function(e){return E(E({},e),{},{sync_on_pipeline_run:!(null!==t&&void 0!==t&&t.sync_on_pipeline_run)})}))}})})}),(0,A.jsx)(v.ZP,{alignItems:"center",children:(0,A.jsx)(k.Z,{mt:2,children:(0,A.jsx)(y.Z,{checked:null===t||void 0===t?void 0:t.sync_on_start,label:"Sync on server start up",onClick:function(){i((function(e){return E(E({},e),{},{sync_on_start:!(null!==t&&void 0!==t&&t.sync_on_start)})}))}})})}),(0,A.jsx)(k.Z,{mt:M.Mq,children:(0,A.jsx)(S.ZP,{bold:!0,children:"Configure the Git authentication credentials that will be used to sync with the specified Git repository."})}),ne]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(k.Z,{mt:M.Mq,children:(0,A.jsx)(S.ZP,{bold:!0,children:"These fields are required to help Mage configure your Git settings. These settings will be specific to your user."})}),ne]}),(0,A.jsx)(k.Z,{mt:2,children:(0,A.jsx)(m.ZP,{loading:z,onClick:function(){return L({sync:E(E({},t),{},{user_git_settings:c})})},primary:!0,children:"Save repository settings"})}),D&&(0,A.jsx)(b.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===N||void 0===N?void 0:N(null)},children:(0,A.jsx)(f.Z,E(E({},D),{},{onClose:function(){return null===N||void 0===N?void 0:N(null)}}))}),F&&(0,A.jsxs)(k.Z,{mt:M.HN,children:[(0,A.jsx)(j.Z,{children:"Synchronize code from remote repository"}),(0,A.jsxs)(k.Z,{mt:1,children:[(0,A.jsxs)(S.ZP,{children:["Running the sync from this page will run a one time sync with the remote repository.",(0,A.jsx)("br",{}),"This may ",(0,A.jsx)(S.ZP,{bold:!0,danger:!0,inline:!0,children:"overwrite"})," your existing data, so make sure you\u2019ve committed or backed up your current changes."]}),(0,A.jsx)(k.Z,{mt:2}),(0,A.jsxs)(S.ZP,{children:["Reset will tell Mage to try to clone your repository from remote. This will also ",(0,A.jsx)(S.ZP,{bold:!0,danger:!0,inline:!0,children:"overwrite"})," all your local changes and reset any settings you may have configured for your local Git repo. This may be helpful if you are having issues syncing your repository."]})]}),(0,A.jsx)(k.Z,{mt:2,children:(0,A.jsxs)(v.ZP,{children:[(0,A.jsx)(m.ZP,{loading:K,onClick:function(){return J({sync:{action_type:"sync_data"}})},warning:!0,children:"Synchronize code"}),(0,A.jsx)(k.Z,{ml:2}),(0,A.jsx)(m.ZP,{danger:!0,loading:K,onClick:function(){return J({sync:{action_type:"reset"}})},children:"Reset repository"})]})})]})]})})}N.getInitialProps=(0,i.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var G=(0,_.Z)(N)},37056:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/workspace/sync-data",function(){return t(60480)}])}},function(e){e.O(0,[1557,5699,9774,2888,179],(function(){return n=37056,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2858],{94629:function(e,n,t){"use strict";t.d(n,{Z:function(){return C}});var r=t(82394),o=t(21831),i=t(82684),l=t(50724),s=t(1402),c=t(97618),u=t(70613),a=t(31557),d=t(68899),h=t(28598);function f(e,n){var t=e.children,r=e.noPadding;return(0,h.jsx)(d.HS,{noPadding:r,ref:n,children:t})}var m=i.forwardRef(f),v=t(62547),j=t(82571),p=t(77417),x=t(46684),b=t(75375);function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function g(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,r.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}function y(e,n){e.addProjectBreadcrumbToCustomBreadcrumbs;var t=e.after,r=e.afterHeader,i=e.afterHidden,f=e.afterWidth,Z=e.afterWidthOverride,y=e.appendBreadcrumbs,C=e.before,P=e.beforeHeader,_=e.beforeWidth,w=e.breadcrumbs,O=e.children,k=e.contained,M=e.errors,I=e.headerMenuItems,S=e.headerOffset,H=e.hideAfterCompletely,E=e.mainContainerHeader,A=e.navigationItems,D=e.setAfterHidden,R=e.setAfterWidth,F=e.setBeforeWidth,B=e.setErrors,N=e.subheaderChildren,V=e.subheaderNoPadding,T=e.title,U=e.uuid,L=(0,b.Z)(U,{beforeResizeOffset:b.H,setWidthAfter:R,setWidthBefore:F,widthAfter:f,widthBefore:_,widthOverrideAfter:Z}),q=L.mainContainerRef,G=L.mousedownActiveAfter,z=L.mousedownActiveBefore,W=L.setMousedownActiveAfter,Q=L.setMousedownActiveBefore,K=L.setWidthAfter,Y=L.setWidthBefore,X=L.widthAfter,J=L.widthBefore,$=(0,p.Z)().project,ee=[];return w&&ee.push.apply(ee,(0,o.Z)(w)),null!==w&&void 0!==w&&w.length&&!y||!$||null!==w&&void 0!==w&&w.length||ee.unshift({bold:!y,label:function(){return T}}),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u.Z,{title:T}),(0,h.jsx)(a.Z,{breadcrumbs:ee,menuItems:I}),(0,h.jsxs)(d.Nk,{ref:n,children:[0!==(null===A||void 0===A?void 0:A.length)&&(0,h.jsx)(d.lm,{showMore:!0,children:(0,h.jsx)(j.Z,{navigationItems:A,showMore:!0})}),(0,h.jsx)(c.Z,{flex:1,flexDirection:"column",children:(0,h.jsxs)(v.Z,{after:t,afterHeader:r,afterHeightOffset:x.Mz,afterHidden:i,afterMousedownActive:G,afterWidth:X,before:C,beforeHeader:P,beforeHeightOffset:x.Mz,beforeMousedownActive:z,beforeWidth:C?J:d.k1,contained:k,headerOffset:S,hideAfterCompletely:!t||H,leftOffset:C?d.k1:null,mainContainerHeader:E,mainContainerRef:q,setAfterHidden:D,setAfterMousedownActive:W,setAfterWidth:K,setBeforeMousedownActive:Q,setBeforeWidth:Y,children:[N&&(0,h.jsx)(m,{noPadding:V,children:N}),O]})})]}),M&&(0,h.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===B||void 0===B?void 0:B(null)},children:(0,h.jsx)(s.Z,g(g({},M),{},{onClose:function(){return null===B||void 0===B?void 0:B(null)}}))})]})}var C=i.forwardRef(y)},93808:function(e,n,t){"use strict";t.d(n,{Z:function(){return O}});var r=t(77837),o=t(26304),i=t(62243),l=t(29385),s=t(80022),c=t(13692),u=t(93189),a=t(15544),d=t(82394),h=t(38860),f=t.n(h),m=t(82684),v=t(56663),j=t.n(v),p=t(40761),x=t(34661),b=t(36105),Z=t(50178),g=t(69419),y=t(28598),C=["auth"];function P(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function _(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,d.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}function w(e){var n=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 t,r=(0,a.Z)(e);if(n){var o=(0,a.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)}}function O(e){return function(n){(0,c.Z)(u,n);var t=w(u);function u(){var e;(0,i.Z)(this,u);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=t.call.apply(t,[this].concat(r)),(0,d.Z)((0,s.Z)(e),"state",{auth:new p.Z(e.props.token)}),e}return(0,l.Z)(u,[{key:"componentDidMount",value:function(){this.setState({auth:new p.Z(this.props.token)})}},{key:"render",value:function(){var n=this.props,t=(n.auth,(0,o.Z)(n,C));return(0,y.jsx)(e,_({auth:this.state.auth},t))}}],[{key:"getInitialProps",value:function(){var n=(0,r.Z)(f().mark((function n(t){var r,o,i,l,s,c,u,a,d;return f().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=j()(t),o=(0,Z.ex)(t),i=o.id,l=r[x.Mv],s=r[b.qt],c=new p.Z(l),u=_(_({},t),{},{auth:c,currentGroupId:i,theme:s}),(0,Z.YB)(t)&&c.isExpired&&(console.log("OAuth token has expired."),a=_(_({},t.query),{},{redirect_url:t.asPath}),(0,g.nL)("/sign-in?".concat((0,g.uM)(a)),t.res)),!e.getInitialProps){n.next=12;break}return n.next=10,e.getInitialProps(u);case 10:return d=n.sent,n.abrupt("return",_(_({},d),{},{auth:c,currentGroupId:i,theme:s}));case 12:return n.abrupt("return",u);case 13:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}]),u}(m.Component)}},91769:function(e,n,t){"use strict";t.d(n,{f:function(){return x},h:function(){return j}});var r=t(82394),o=t(82684),i=t(34376),l=t(68562),s=t(72473),c=t(70515),u=t(69419),a=t(53808),d=t(28598);var h=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),h=r.url,f=r.redirect_query_params,m=void 0===f?{}:f;return(0,d.jsx)(d.Fragment,{children:h&&(0,d.jsx)(l.ZP,{beforeElement:(0,d.jsx)(s.GoogleIcon,{size:2*c.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(h).state;(0,a.t8)(e,m),t.push(h)},uuid:"SignForm/google",children:"Sign in with Google"})})};var f=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),h=r.url,f=r.redirect_query_params,m=void 0===f?{}:f;return(0,d.jsx)(d.Fragment,{children:h&&(0,d.jsx)(l.ZP,{beforeElement:(0,d.jsx)(s.MicrosoftIcon,{size:2*c.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(h).state;m&&(0,a.t8)(e,m),t.push(h)},uuid:"SignForm/active_directory",children:"Sign in with Microsoft"})})};var m=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),s=r.url,c=r.redirect_query_params,h=void 0===c?{}:c;return(0,d.jsx)(d.Fragment,{children:s&&(0,d.jsx)(l.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(s).state;(0,a.t8)(e,h),t.push(s)},uuid:"SignForm/oidc_generic",children:"Sign in with OIDC"})})};var v,j,p=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),s=r.url,c=r.redirect_query_params,h=void 0===c?{}:c;return(0,d.jsx)(d.Fragment,{children:s&&(0,d.jsx)(l.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(s).state;(0,a.t8)(e,h),t.push(s)},uuid:"SignForm/okta",children:"Sign in with Okta"})})};!function(e){e.ACTIVE_DIRECTORY="active_directory",e.AZURE_DEVOPS="azure_devops",e.BITBUCKET="bitbucket",e.GITHUB="github",e.GITLAB="gitlab",e.GOOGLE="google",e.OIDC_GENERIC="oidc_generic",e.OKTA="okta"}(j||(j={}));var x=(v={},(0,r.Z)(v,j.ACTIVE_DIRECTORY,f),(0,r.Z)(v,j.GOOGLE,h),(0,r.Z)(v,j.OIDC_GENERIC,m),(0,r.Z)(v,j.OKTA,p),v)},37520:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ne}});var r=t(77837),o=t(38860),i=t.n(o),l=t(93808),s=t(82394),c=t(75582),u=t(82684),a=t(69864),d=t(71180),h=t(15338),f=t(55485),m=t(85854),v=t(44085),j=t(38276),p=t(4190),x=t(30160),b=t(35576),Z=t(17488),g=t(12468),y=t(35686),C=t(72473),P="clone",_="delete",w="fetch",O="merge",k="pull",M="push",I="rebase",S="git_remote_name",H="git_repository_name",E={uuid:"Branches"},A={uuid:"Commit"},D={uuid:"Push & Pull Requests"},R={uuid:"Remote & Auth"},F=[R,E,A,D],B=t(70515),N=t(81728),V=t(72619),T=t(28598);var U=function(e){var n=e.actionRemoteName,t=e.branch,r=e.branches,o=e.fetchBranch,i=e.fetchBranches,l=e.remotes,s=e.setActionRemoteName,P=e.showError,w=(0,u.useState)(""),k=w[0],M=w[1],S=(0,u.useState)(null),H=S[0],E=S[1],D=(0,u.useState)(null),F=D[0],U=D[1],L=(0,u.useState)(null),q=L[0],G=L[1],z=(0,u.useState)(""),W=z[0],Q=z[1],K=(0,u.useMemo)((function(){return null===l||void 0===l?void 0:l.find((function(e){return e.name===n}))}),[n,l]),Y=(0,u.useMemo)((function(){return(null===r||void 0===r?void 0:r.concat((null===K||void 0===K?void 0:K.refs)||[]))||[]}),[r,K]),X=(0,a.Db)(y.ZP.git_custom_branches.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){o(),i(),Q("")},onErrorCallback:function(e,n){return P({errors:n,response:e})}})}}),J=(0,c.Z)(X,2),$=J[0],ee=J[1].isLoading,ne=(0,a.Db)(y.ZP.git_custom_branches.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){o(),window.location.reload()},onErrorCallback:function(e,n){return P({errors:n,response:e})}})}}),te=(0,c.Z)(ne,2),re=te[0],oe=te[1].isLoading,ie=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===t||void 0===t?void 0:t.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(e){var n=e.git_custom_branch.progress;o(),M(""),E(""),U(n),G("")},onErrorCallback:function(e,n){return P({errors:n,response:e})}})}}),le=(0,c.Z)(ie,2),se=le[0],ce=le[1].isLoading;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsxs)(m.Z,{children:["Branches",r?" (".concat(null===r||void 0===r?void 0:r.length,")"):""]}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Remote"})}),(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.MultiShare,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return s(e.target.value)},placeholder:"Choose a remote",value:n||"",children:null===l||void 0===l?void 0:l.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(g.Z,{fullSize:!0,label:"Choose a different branch to switch branches",widthFitContent:!0,children:(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{muted:!1}),beforeIconSize:2*B.iI,monospace:!0,onChange:function(e){return re({git_custom_branch:{name:e.target.value,remote:n}})},value:null===t||void 0===t?void 0:t.name,children:(null===t||void 0===t?void 0:t.name)&&(null===Y||void 0===Y?void 0:Y.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)})))})}),(0,T.jsx)(j.Z,{mr:B.cd}),oe&&(0,T.jsx)(p.Z,{inverted:!0})]})]})]})}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(Z.Z,{label:"New branch name",monospace:!0,onChange:function(e){var n;return Q(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:W||""}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Add,{size:2*B.iI}),disabled:!W,loading:ee,onClick:function(){$({git_custom_branch:{name:W}})},primary:!0,children:"Create new branch"})]})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(m.Z,{children:"Actions"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(j.Z,{mb:B.Mq,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),(null===t||void 0===t?void 0:t.name)&&(0,T.jsx)(x.ZP,{monospace:!0,children:null===t||void 0===t?void 0:t.name})]}),(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Base branch"})}),(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return G(e.target.value)},placeholder:"Choose a branch",value:q,children:null===Y||void 0===Y?void 0:Y.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Action"})}),(0,T.jsxs)(v.Z,{onChange:function(e){return E(e.target.value)},placeholder:"Choose action",value:H||"",children:[(0,T.jsx)("option",{value:O,children:(0,N.vg)(O)}),(0,T.jsx)("option",{value:I,children:(0,N.vg)(I)}),(0,T.jsx)("option",{value:_,children:(0,N.vg)(_)})]})]})]}),H&&[O,I].includes(H)&&(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsxs)(x.ZP,{bold:!0,muted:!0,children:["Message for ",H]})}),(0,T.jsx)(b.Z,{monospace:!0,onChange:function(e){return M(e.target.value)},value:k||""})]}),(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!H||!q,loading:ce,onClick:function(){(_!==H||"undefined"!==typeof location&&window.confirm("Are you sure you want to delete branch ".concat(q,"?")))&&se({git_custom_branch:{action_payload:{base_branch:q},action_type:H,message:k}})},primary:!0,children:H?(0,N.vg)(H):"Execute action"}),F&&(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(x.ZP,{default:!0,monospace:!0,preWrap:!0,children:F})})]})]})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsxs)(f.ZP,{children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(encodeURIComponent(R.uuid))},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:R.uuid}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)(d.ZP,{afterIcon:(0,T.jsx)(C.PaginateArrowRight,{}),linkProps:{href:"/version-control?tab=".concat(A.uuid)},noHoverUnderline:!0,sameColorAsText:!0,secondary:!0,children:["Next: ",A.uuid]})]})]})]})},L=t(90299),q=t(32013),G=t(98777),z=t(48670),W=t(75499);function Q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function K(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Q(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Q(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Y={base_branch:null,body:null,compare_branch:null,repository:null,title:null};var X=function(e){var n=e.actionRemoteName,t=e.branch,r=e.branches,o=e.fetchBranch,i=e.loading,l=e.remotes,s=e.repositories,g=e.repositoryName,P=e.setActionRemoteName,_=e.setRepositoryName,w=e.showError,O=(0,u.useState)((null===t||void 0===t?void 0:t.name)||""),k=O[0],I=O[1],S=(0,u.useState)(null),H=S[0],E=S[1],D=(0,u.useState)(null),R=D[0],F=D[1],U=(0,u.useState)(Y),L=U[0],Q=U[1],X=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===t||void 0===t?void 0:t.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(e){var n=e.git_custom_branch,t=n.error,r=n.progress;t?(E(t),F(null)):(o(),E(null),F(r))},onErrorCallback:function(e,n){return w({errors:n,response:e})}})}}),J=(0,c.Z)(X,2),$=J[0],ee=J[1].isLoading,ne=(0,u.useMemo)((function(){var e;return null===s||void 0===s||null===(e=s.find((function(e){return e.name===g})))||void 0===e?void 0:e.url}),[s,g]),te=y.ZP.pull_requests.list({remote_url:ne,repository:g},{},{pauseFetch:!g}),re=te.data,oe=te.mutate,ie=(0,u.useMemo)((function(){return(null===re||void 0===re?void 0:re.pull_requests)||[]}),[re]),le=(0,u.useMemo)((function(){return(0,T.jsx)(W.Z,{columnFlex:[null,null,null,null],columns:[{uuid:"Title"},{uuid:"Author"},{uuid:"Created"},{uuid:"Last modified"}],onClickRow:function(e){var n,t=null===ie||void 0===ie||null===(n=ie[e])||void 0===n?void 0:n.url;t&&window.open(t,"_blank")},rows:null===ie||void 0===ie?void 0:ie.map((function(e){var n=e.created_at,t=e.last_modified,r=e.title,o=e.url,i=e.user;return[(0,T.jsx)(z.Z,{default:!0,href:o,monospace:!0,openNewWindow:!0,small:!0,children:r},"title"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:i},"user"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:n},"createdAt"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:t||"-"},"lastModified")]})),uuid:"pull-requests"})}),[ie]),se=y.ZP.git_custom_branches.list({remote_url:ne,repository:g},{},{pauseFetch:!g}).data,ce=(0,u.useMemo)((function(){return(null===se||void 0===se?void 0:se.git_custom_branches)||[]}),[se]);(0,u.useEffect)((function(){null!==L&&void 0!==L&&L.compare_branch||null===ce||void 0===ce||!ce.find((function(e){return e.name===(null===t||void 0===t?void 0:t.name)}))||Q((function(e){return K(K({},e),{},{compare_branch:null===t||void 0===t?void 0:t.name})}))}),[t,ce,L]);var ue=(0,a.Db)(y.ZP.pull_requests.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){oe(),Q(Y)},onErrorCallback:function(e,n){return w({errors:n,response:e})}})}}),ae=(0,c.Z)(ue,2),de=ae[0],he=ae[1].isLoading;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(m.Z,{children:(0,N.vg)(M)})}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Remote"})}),i&&(0,T.jsx)(p.Z,{inverted:!0}),!i&&(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.MultiShare,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return P(e.target.value)},placeholder:"Choose remote",value:n||"",children:null===l||void 0===l?void 0:l.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Branch"})}),(0,T.jsxs)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return I(e.target.value)},placeholder:"Choose branch",value:k||"",children:[(0,T.jsx)("option",{value:""}),null===r||void 0===r?void 0:r.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsxs)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!n||!k,loading:ee,onClick:function(){F(null),$({git_custom_branch:{action_payload:{branch:k,remote:n},action_type:M}})},primary:!0,children:[(0,N.vg)(M)," ",n," ",n&&k]})}),(R||H)&&(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(x.ZP,{danger:!!H,default:!!R,monospace:!0,preWrap:!0,children:R||H})})]})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(m.Z,{children:"Create pull request"})}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[i&&(0,T.jsx)(p.Z,{inverted:!0}),!i&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Repository"})}),(0,T.jsx)(v.Z,{monospace:!0,onChange:function(e){return _(e.target.value)},placeholder:"Choose repository",value:g||"",children:null===s||void 0===s?void 0:s.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Base branch"})}),g&&!se&&(0,T.jsx)(p.Z,{inverted:!0}),(!g||se)&&(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,disabled:!g,monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{base_branch:e.target.value})}))},placeholder:"Choose branch",value:(null===L||void 0===L?void 0:L.base_branch)||"",children:null===ce||void 0===ce?void 0:ce.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),g&&!se&&(0,T.jsx)(p.Z,{inverted:!0}),(!g||se||(null===L||void 0===L?void 0:L.compare_branch))&&(0,T.jsxs)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,disabled:!g,monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{compare_branch:e.target.value})}))},placeholder:"Choose branch",value:(null===L||void 0===L?void 0:L.compare_branch)||"",children:[!(null!==ce&&void 0!==ce&&ce.length)&&(null===L||void 0===L?void 0:L.compare_branch)&&(0,T.jsx)("option",{value:null===L||void 0===L?void 0:L.compare_branch,children:null===L||void 0===L?void 0:L.compare_branch}),null===ce||void 0===ce?void 0:ce.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(Z.Z,{label:"Title",monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{title:e.target.value})}))},value:(null===L||void 0===L?void 0:L.title)||""})}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(b.Z,{label:"Description",monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{body:e.target.value})}))},value:(null===L||void 0===L?void 0:L.body)||""})}),(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!g||!(null!==L&&void 0!==L&&L.title)||!(null!==L&&void 0!==L&&L.base_branch)||!(null!==L&&void 0!==L&&L.compare_branch),loading:he,onClick:function(){de({pull_request:K(K({},L),{},{remote_url:ne,repository:g})})},primary:!0,children:"Create new pull request"})})]})]}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsx)(q.Z,{visibleMapping:{0:!g},children:(0,T.jsxs)(G.Z,{noPaddingContent:!0,title:re?"Pull requests (".concat(null===ie||void 0===ie?void 0:ie.length,")"):"Pull requests",children:[!g&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(x.ZP,{muted:!0,children:"Please select a repository to view open pull requests."})}),g&&(0,T.jsxs)(T.Fragment,{children:[!re&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(p.Z,{inverted:!0})}),re&&le]})]})})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(f.ZP,{children:(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(A.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:A.uuid})})]})]})},J=t(94629),$=t(78650),ee=t(70652),ne=t(97618),te=t(25976),re=te.default.div.withConfig({displayName:"indexstyle__SpacingStyle",componentId:"sc-el09vr-0"})(["margin-top:","px;"],.5*B.iI),oe=t(42122);function ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function le(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ie(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var se,ce=function(e){var n=e.branch,t=e.fetchBranch,r=e.modifiedFiles,o=e.setSelectedFilePath,i=e.showError,l=e.stagedFiles,s=e.untrackedFiles,v=(0,u.useRef)(null),Z=(0,u.useState)(""),g=Z[0],P=Z[1],_=(0,u.useState)({}),w=_[0],O=_[1],k=(0,u.useState)({}),M=k[0],I=k[1],S=(0,u.useMemo)((function(){return Object.keys(r).concat(Object.keys(s)).sort()}),[r,s]),H=(0,u.useMemo)((function(){return Object.keys(l||{})}),[l]),A=(0,u.useMemo)((function(){return H.length}),[H]),R=(0,u.useMemo)((function(){return Object.keys(w).length===(null===S||void 0===S?void 0:S.length)}),[w,S]),F=(0,u.useMemo)((function(){return Object.keys(M).length===(null===H||void 0===H?void 0:H.length)}),[M,H]),U=(0,u.useMemo)((function(){return{onErrorCallback:function(e,n){return i({errors:n,response:e})}}}),[i]),L=(0,u.useMemo)((function(){return{onSuccess:function(e){return(0,V.wD)(e,le({callback:function(){t(),O({})}},U))}}}),[t,U]),Q=(0,u.useMemo)((function(){return y.ZP.git_custom_branches.useUpdate(null===n||void 0===n?void 0:n.name)}),[n]),K=(0,a.Db)(Q,L),Y=(0,c.Z)(K,2),X=Y[0],J=Y[1].isLoading,$=(0,a.Db)(Q,L),te=(0,c.Z)($,2),ie=te[0],se=te[1].isLoading,ce=(0,a.Db)(Q,{onSuccess:function(e){return(0,V.wD)(e,le({callback:function(){t(),I({})}},U))}}),ue=(0,c.Z)(ce,2),ae=ue[0],de=ue[1].isLoading,he=(0,u.useCallback)((function(e,n,t,r,o){var i=(null===e||void 0===e?void 0:e.length)>=1;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(z.Z,{block:!0,noHoverUnderline:!0,onClick:function(){t(o?{}:r)},preventDefault:!0,children:(0,T.jsxs)(f.ZP,{alignItems:"center",flexDirection:"row",children:[(0,T.jsx)(ee.Z,{checked:i&&o,disabled:!i}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(x.ZP,{bold:!0,children:i&&o?"Unselect all":"Select all"})]})}),e.map((function(e){return(0,T.jsx)(re,{children:(0,T.jsx)(z.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return t((function(n){var t=le({},n);return!(null!==t&&void 0!==t&&t[e])?t[e]=!0:delete t[e],t}))},preventDefault:!0,children:(0,T.jsxs)(f.ZP,{alignItems:"center",flexDirection:"row",children:[(0,T.jsx)(ee.Z,{checked:!(null===n||void 0===n||!n[e])}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,children:e})]})})},e)}))]})}),[]),fe=(0,u.useMemo)((function(){return(0,oe.Qr)(w)}),[w]),me=y.ZP.git_custom_branches.detail("with_logs",{_format:"with_logs"}),ve=me.data,je=me.mutate,pe=(0,u.useMemo)((function(){var e;return(null===ve||void 0===ve||null===(e=ve.git_custom_branch)||void 0===e?void 0:e.logs)||[]}),[ve]),xe=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){je(),t(),P("")},onErrorCallback:function(e,n){return i({errors:n,response:e})}})}}),be=(0,c.Z)(xe,2),Ze=be[0],ge=be[1].isLoading,ye=(0,u.useMemo)((function(){return(0,T.jsx)(W.Z,{columnFlex:[1,1,1],columns:[{uuid:"Author"},{uuid:"Date"},{uuid:"Message"}],rows:pe.map((function(e){var n=e.author,t=e.date,r=e.message;return[(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===n||void 0===n?void 0:n.name},"author"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:t},"date"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:r},"message")]})),uuid:"git-branch-logs"})}),[pe]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)(ne.Z,{flex:1,flexDirection:"column",children:[(0,T.jsxs)(m.Z,{children:["Not staged ",(null===S||void 0===S?void 0:S.length)>=1&&"(".concat(null===S||void 0===S?void 0:S.length,")")]}),(0,T.jsx)(j.Z,{my:B.cd,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(j.Z,{mb:B.cd,children:(0,T.jsxs)(f.ZP,{flexDirection:"row",children:[(0,T.jsx)(d.ZP,{compact:!0,disabled:fe||de||se,loading:J,onClick:function(){X({git_custom_branch:{action_type:"add",files:Object.keys(w)}}).then((function(e){var n,t=e.data;null!==t&&void 0!==t&&t.git_custom_branch&&(null===v||void 0===v||null===(n=v.current)||void 0===n||n.focus())}))},primary:!0,children:"Add files"}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{compact:!0,disabled:fe||J||de,loading:se,noBackground:!0,onClick:function(){"undefined"!==typeof location&&window.confirm("Are you sure you want to undo all changes in the selected files?")&&ie({git_custom_branch:{action_type:"checkout",files:Object.keys(w)}})},children:"Checkout files"})]})}),he(S,w,O,le(le({},r),s),R)]}),(0,T.jsx)(j.Z,{mr:B.cd}),(0,T.jsxs)(ne.Z,{flex:1,flexDirection:"column",children:[(0,T.jsxs)(m.Z,{children:["Staged files ",(null===H||void 0===H?void 0:H.length)>=1&&"(".concat(null===H||void 0===H?void 0:H.length,")")]}),(0,T.jsx)(j.Z,{my:B.cd,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(j.Z,{mb:B.cd,children:(0,T.jsx)(f.ZP,{flexDirection:"row",children:(0,T.jsx)(d.ZP,{compact:!0,disabled:(0,oe.Qr)(M)||J||se,loading:de,onClick:function(){ae({git_custom_branch:{action_type:"reset",files:Object.keys(M)}})},secondary:!0,children:"Reset files"})})}),he(H,M,I,l,F)]})]})}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(m.Z,{children:"Commit"})}),(0,T.jsx)(j.Z,{mb:B.cd,children:(0,T.jsx)(q.Z,{children:(0,T.jsx)(G.Z,{noPaddingContent:!0,title:A>=1?"Staged files (".concat(A,")"):"No staged files",children:null===H||void 0===H?void 0:H.map((function(e){return(0,T.jsx)(j.Z,{my:1,px:B.cd,children:(0,T.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,T.jsx)(z.Z,{default:!0,monospace:!0,onClick:function(){return o((function(n){return n===e?null:e}))},warning:null===r||void 0===r?void 0:r[e],children:e}),(0,T.jsx)(j.Z,{mr:1}),(null===r||void 0===r?void 0:r[e])&&(0,T.jsx)(x.ZP,{warning:!0,children:"Modified after staging"})]})},e)}))})})}),(0,T.jsx)(b.Z,{label:"Commit message",monospace:!0,onChange:function(e){return P(e.target.value)},ref:v,value:g||""}),(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsxs)(d.ZP,{disabled:0===A||!((null===g||void 0===g?void 0:g.length)>=1),loading:ge,onClick:function(){Ze({git_custom_branch:{action_type:"commit",message:g}})},primary:!0,children:["Commit ",(0,N._6)("file",A,!0)," with message"]}),0===A&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(x.ZP,{danger:!0,small:!0,children:"Please stage at least 1 file before committing."})]})]})})]}),(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(q.Z,{children:(0,T.jsxs)(G.Z,{noPaddingContent:!0,title:"Logs",children:[!ve&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(p.Z,{inverted:!0})}),ve&&ye]})})}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsxs)(f.ZP,{children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(E.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:E.uuid}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)(d.ZP,{afterIcon:(0,T.jsx)(C.PaginateArrowRight,{}),linkProps:fe?{href:"/version-control?tab=".concat(encodeURIComponent(D.uuid))}:null,noHoverUnderline:!0,primary:fe,sameColorAsText:!0,secondary:!fe,children:["Next: ",D.uuid]})]})]})]})},ue=t(23531),ae=t(12691),de=t.n(ae),he=t(34376),fe=t(63403),me=te.default.svg.withConfig({displayName:"BitbucketWithText__SVGStyle",componentId:"sc-wdje9z-0"})([""]),ve=function(e){var n=e.fill,t=e.opacity,r=e.size,o=void 0===r?fe.C:r,i=e.style,l=e.viewBox,s=void 0===l?"0 0 299 42":l;return(0,T.jsxs)(me,{fill:n,height:o,opacity:t,style:i,viewBox:s,width:o,children:[(0,T.jsx)("path",{d:"M63.3372 2.9978H79.5353C87.4335 2.9978 91.2488 6.77741 91.2488 12.8379C91.2488 17.3994 89.1068 20.2016 84.756 21.179C90.4455 22.0914 93.3237 25.1542 93.3237 30.4978C93.3237 36.4931 89.1737 40.6637 80.4724 40.6637H63.3372V2.9978ZM68.625 19.0939H78.799C83.8191 19.0939 85.894 16.8782 85.894 13.2289C85.894 9.57954 83.6852 7.82008 78.799 7.82008H68.625V19.0939ZM68.625 23.7206V35.4504H80.673C85.7601 35.4504 88.036 33.6909 88.036 29.9113C88.036 25.871 85.827 23.7206 80.5393 23.7206H68.625Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M101.958 0.977783C104.033 0.977783 105.506 2.21592 105.506 4.43157C105.506 6.58205 104.033 7.88536 101.958 7.88536C99.8833 7.88536 98.4106 6.6472 98.4106 4.43157C98.4106 2.21592 99.8833 0.977783 101.958 0.977783ZM99.3478 11.9907H104.435V40.6638H99.3478V11.9907Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M123.779 36.0376C124.984 36.0376 126.055 35.7769 126.992 35.6466V40.4037C126.121 40.6643 125.117 40.8599 123.578 40.8599C117.286 40.8599 114.207 37.2756 114.207 31.9321V16.5529H109.455V11.9912H114.207V5.93091H119.16V11.9912H126.992V16.5529H119.16V31.7367C119.093 34.2781 120.633 36.0376 123.779 36.0376Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M138.504 35.5806V40.5982H133.417V0H138.504V17.1386C140.378 13.359 143.926 11.4039 148.477 11.4039C156.309 11.4039 160.258 17.8554 160.258 26.3271C160.258 34.4076 156.108 41.25 147.875 41.25C143.524 41.25 140.244 39.3602 138.504 35.5806ZM147.072 16.0309C142.52 16.0309 138.504 18.8329 138.504 25.2191V27.5001C138.504 33.8863 142.186 36.6883 146.536 36.6883C152.226 36.6883 155.171 33.0392 155.171 26.3921C155.171 19.4194 152.36 16.0309 147.072 16.0309Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M165.546 11.991H170.633V29.3252C170.633 34.4733 172.775 36.7541 177.594 36.7541C182.279 36.7541 185.559 33.6913 185.559 27.8915V11.991H190.647V40.664H185.559V35.972C183.685 39.3607 180.204 41.2505 176.255 41.2505C169.495 41.2505 165.613 36.6888 165.613 28.8039V11.991H165.546Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M219.027 39.8814C217.287 40.7938 214.542 41.1847 211.864 41.1847C201.355 41.1847 196.469 34.9941 196.469 26.1967C196.469 17.5296 201.355 11.3389 211.864 11.3389C214.542 11.3389 216.55 11.6647 218.892 12.7072V17.2689C217.019 16.4218 215.011 15.9006 212.266 15.9006C204.636 15.9006 201.49 20.5924 201.49 26.1967C201.49 31.8009 204.702 36.4929 212.401 36.4929C215.412 36.4929 217.287 36.1018 219.092 35.4502V39.8814H219.027Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M224.783 40.6635V0H229.87V25.4147L242.52 11.9904H249.147L235.29 26.0664L249.681 40.6635H242.789L229.802 27.2392V40.6635H224.783Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M266.483 41.2506C255.437 41.2506 250.619 35.0599 250.619 26.2624C250.619 17.5954 255.572 11.4045 264.541 11.4045C273.644 11.4045 277.259 17.5302 277.259 26.2624V28.4781H255.773C256.51 33.3655 259.722 36.4935 266.684 36.4935C270.096 36.4935 272.974 35.8418 275.652 34.9296V39.4911C273.175 40.7944 269.494 41.2506 266.483 41.2506ZM255.706 24.2423H272.172C271.904 18.8987 269.427 15.9012 264.34 15.9012C258.919 15.9012 256.242 19.2897 255.706 24.2423Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M294.929 36.0376C296.134 36.0376 297.205 35.7769 298.142 35.6466V40.4037C297.272 40.6643 296.267 40.8599 294.728 40.8599C288.437 40.8599 285.359 37.2756 285.359 31.9321V16.5529H280.606V11.9912H285.359V5.93091H290.311V11.9912H298.142V16.5529H290.311V31.7367C290.245 34.2781 291.784 36.0376 294.929 36.0376Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M1.36497 4.1062C0.556341 4.1062 -0.117513 4.82301 0.0172582 5.605L5.74501 39.1654C5.87979 40.0127 6.62103 40.6642 7.56442 40.6642H34.9903C35.6641 40.6642 36.2032 40.208 36.338 39.5565L42.0658 5.605C42.2006 4.82301 41.594 4.1062 40.718 4.1062H1.36497ZM25.4889 28.3479H16.7288L14.3704 16.3573H27.6453L25.4889 28.3479Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M40.2462 16.3572H27.5775L25.4886 28.3478H16.7286L6.3512 40.2079C6.3512 40.2079 6.82289 40.6641 7.56413 40.6641H34.99C35.6639 40.6641 36.2029 40.2079 36.3377 39.5562L40.2462 16.3572Z",fill:"url(#paint0_linear_13549_1163)"}),(0,T.jsx)("defs",{children:(0,T.jsxs)("linearGradient",{gradientUnits:"userSpaceOnUse",id:"paint0_linear_13549_1163",x1:"43.1513",x2:"22.7826",y1:"19.7256",y2:"36.1667",children:[(0,T.jsx)("stop",{offset:"0.176",stopColor:"#0052CC"}),(0,T.jsx)("stop",{offset:"1",stopColor:"#2684FF"})]})})]})},je=t(91769),pe=t(69419),xe=t(53808),be=(se={},(0,s.Z)(se,je.h.AZURE_DEVOPS,C.DevOpsWithText),(0,s.Z)(se,je.h.BITBUCKET,ve),(0,s.Z)(se,je.h.GITHUB,C.GitHubWithTextIcon),(0,s.Z)(se,je.h.GITLAB,C.GitLabWithTextIcon),se);function Ze(e){var n=e.isLoadingCreateOauth,t=e.oauth,r=e.provider,o=e.showError,i=(0,he.useRouter)(),l=(0,a.Db)(y.ZP.oauths.useUpdate(r),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){return window.location.href=window.location.href.split("?")[0]},onErrorCallback:function(e,n){return o({errors:n,response:e})}})}}),s=(0,c.Z)(l,2),u=s[0],h=s[1].isLoading,m=be[r];return(0,T.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,T.jsx)(ne.Z,{children:(0,T.jsx)(m,{size:12*B.iI})}),(0,T.jsx)(ne.Z,{alignItems:"center",children:null!==t&&void 0!==t&&t.authenticated?(0,T.jsx)(d.ZP,{loading:h,onClick:function(){return u({oauth:{action_type:"reset"}})},warning:!0,children:"Reset"}):(0,T.jsx)(d.ZP,{loading:n,onClick:function(){var e=null===t||void 0===t?void 0:t.url,n=(0,pe.iV)(e).state;(0,xe.t8)(n,(null===t||void 0===t?void 0:t.redirect_query_params)||{}),i.push(e)},primary:!0,children:"Authenticate"})})]})}var ge=function(e){var n=e.branch,t=e.isLoadingCreateOauth,r=e.showError,o=y.ZP.oauths.list({type:"git",redirect_uri:encodeURIComponent(window.location.href)}),i=o.data,l=(o.mutate,y.ZP.oauths.detail(je.h.GITHUB,{redirect_uri:encodeURIComponent(window.location.href)})),s=l.data,a=(l.mutate,(0,u.useMemo)((function(){return(null===s||void 0===s?void 0:s.oauth)||{}}),[s])),f=(0,u.useMemo)((function(){return null===n||void 0===n?void 0:n.access_token_exists}),[n]),v=(0,u.useMemo)((function(){var e,n=(null===i||void 0===i||null===(e=i.oauths)||void 0===e?void 0:e.reduce((function(e,n){return e[n.provider]=n,e}),{}))||{};return a&&(n[je.h.GITHUB]=a),n}),[i,a]),p=(0,u.useMemo)((function(){return Object.values(v).some((function(e){return null===e||void 0===e?void 0:e.authenticated}))}),[v]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(m.Z,{children:"Authentication"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[f&&!p&&(0,T.jsxs)(j.Z,{mb:2,children:[(0,T.jsx)(d.ZP,{disabled:!0,children:"Using access token from Git Settings"}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(x.ZP,{muted:!0,children:"Some features may not work unless you authenticate with a Git client."})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.Mq,children:(0,T.jsx)(x.ZP,{muted:!0,children:"Authenticating with the apps below will allow you to easily pull, push, and create pull requests."})}),(0,T.jsxs)(j.Z,{mb:B.Mq,style:{maxWidth:"600px"},children:[(0,T.jsx)(h.Z,{muted:!0}),Object.entries(v||{}).map((function(e){var n=(0,c.Z)(e,2),o=n[0],i=n[1];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ze,{isLoadingCreateOauth:t,oauth:i,provider:o,showError:r},o),(0,T.jsx)(h.Z,{muted:!0})]})}))]})]})]})]})},ye=t(77417);var Ce=function(e){var n,t,r,o,i=e.actionRemoteName,l=e.branch,s=e.fetchBranch,b=e.loading,g=e.remotes,_=e.setActionRemoteName,O=e.showError,M=(0,he.useRouter)(),I=(0,ye.Z)().project,S=(0,u.useRef)(null),H=(0,u.useState)(null),A=H[0],D=H[1],R=(0,u.useState)(null),F=R[0],U=R[1],L=(0,u.useState)(null),Q=L[0],K=L[1],Y=(0,u.useState)(null),X=Y[0],J=Y[1],$=(0,u.useState)(!1),ee=$[0],te=$[1],re=(0,u.useState)(null),oe=re[0],ie=re[1],le=(0,u.useState)(""),se=le[0],ce=le[1],ue=(0,u.useState)(""),ae=ue[0],fe=ue[1],me=(0,u.useState)(null),ve=me[0],xe=me[1],be=(0,u.useMemo)((function(){return!(null===l||void 0===l||!l.name)}),[l]);(0,u.useEffect)((function(){var e,n;!ve&&(null!==l&&void 0!==l&&null!==(e=l.sync_config)&&void 0!==e&&e.repo_path||null!==I&&void 0!==I&&I.repo_path)&&xe((null===l||void 0===l||null===(n=l.sync_config)||void 0===n?void 0:n.repo_path)||(null===I||void 0===I?void 0:I.repo_path))}),[l,I,ve]);var Ze=(0,u.useMemo)((function(){var e,n;return null===g||void 0===g||null===(e=g.find((function(e){return e.name===i})))||void 0===e||null===(n=e.refs)||void 0===n?void 0:n.map((function(e){var n=e.name.split("/");return{name:n[n.length-1]}}))}),[i,g]),Ce=(0,a.Db)(y.ZP.syncs.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){s(),te(!1)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}}),Pe=(0,c.Z)(Ce,2),_e=Pe[0],we=Pe[1].isLoading,Oe=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===l||void 0===l?void 0:l.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(e){var n=e.git_custom_branch,t=n.error,r=n.progress;t?(U(t),J(null)):(s(),D(null),U(null),K(null),J(r))},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}}),ke=(0,c.Z)(Oe,2),Me=ke[0],Ie=ke[1].isLoading,Se=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===l||void 0===l?void 0:l.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){s(),ce(""),fe("")},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}}),He=(0,c.Z)(Se,2),Ee=He[0],Ae=He[1].isLoading,De=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===l||void 0===l?void 0:l.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){s(),ie(null)},onErrorCallback:function(e,n){ie(null),O({errors:n,response:e})}})}}),Re=(0,c.Z)(De,2),Fe=Re[0],Be=Re[1].isLoading,Ne=(0,a.Db)(y.ZP.oauths.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){return window.location.href="".concat(M.basePath,"/version-control")},onErrorCallback:function(e,n){O({errors:n,response:e})}})}}),Ve=(0,c.Z)(Ne,2),Te=Ve[0],Ue=Ve[1].isLoading,Le=(0,pe.iV)()||{},qe=Le.access_token,Ge=Le.provider,ze=Le.refresh_token,We=Le.expires_in;(0,u.useEffect)((function(){qe&&Te({oauth:{expires_in:We,provider:Ge||je.h.GITHUB,refresh_token:ze,token:qe}})}),[qe,Te,We,Ge,ze]);var Qe=(0,u.useMemo)((function(){return null===g||void 0===g?void 0:g.map((function(e){var n=e.name,t=e.refs,r=e.urls;return(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,T.jsxs)(ne.Z,{alignItems:"center",children:[(0,T.jsx)(x.ZP,{bold:!0,children:n}),(0,T.jsx)(j.Z,{mx:1,children:(0,T.jsx)(C.ChevronRight,{muted:!0})}),null===r||void 0===r?void 0:r.map((function(e){return(0,T.jsx)(j.Z,{mr:1,children:(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:e})},e)}))]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{compact:!0,disabled:Be&&oe!==n,iconOnly:!0,loading:Be&&oe===n,noBackground:!0,onClick:function(){"undefined"!==typeof location&&window.confirm("Are you sure you want to remove remote ".concat(n,"?"))&&(ie(n),Fe({git_custom_branch:{action_type:"remove_remote",action_payload:{name:n}}}).then((function(){i===n&&_(null)})))},small:!0,title:"Remote remote ".concat(n),children:(0,T.jsx)(C.Trash,{})})]})}),(0,T.jsx)(q.Z,{children:(0,T.jsxs)(G.Z,{noPaddingContent:!0,smallTitle:!0,title:"Refs (".concat(null===t||void 0===t?void 0:t.length,")"),children:[0===(null===t||void 0===t?void 0:t.length)&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(x.ZP,{muted:!0,children:"This remote has no refs."})}),(null===t||void 0===t?void 0:t.length)>=1&&(0,T.jsx)(W.Z,{columnFlex:[1,1,1],columns:[{uuid:"Ref"},{uuid:"Author"},{uuid:"Date"},{uuid:"Message"}],rows:t.map((function(e){var n,t=e.commit,r=e.name;return[(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:r},"ref-name"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===t||void 0===t||null===(n=t.author)||void 0===n?void 0:n.name},"author"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===t||void 0===t?void 0:t.date},"date"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===t||void 0===t?void 0:t.message},"message")]})),uuid:"git-branch-remotes-refs"})]})}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsx)(h.Z,{light:!0})})]},n)}))}),[Be,oe,g,Fe]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(m.Z,{children:"Setup"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(j.Z,{mb:1,children:[(0,T.jsx)(x.ZP,{bold:!0,large:!0,children:be?"Git init directory":"Initialize Git directory"}),!be&&(0,T.jsxs)(x.ZP,{muted:!0,children:["Enter the directory you want to initialize git in.",(0,T.jsx)("br",{}),"The current project directoy is filled in for you. If you want to use that, click the save button."]}),be&&(0,T.jsxs)(x.ZP,{muted:!0,children:["If the directory below is blank, then the current working directory will be used to initialize git.",(0,T.jsx)("br",{}),"If git hasn\u2019t been initialized in the directory below, Mage will automatically run git init for you."]})]}),(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(Z.Z,{disabled:be&&!ee,fullWidth:!0,label:"Git directory",maxWidth:400,monospace:!0,onChange:function(e){return xe(e.target.value)},ref:S,value:ve||""}),(0,T.jsx)(j.Z,{mr:1}),(!be||ee)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(d.ZP,{compact:!0,disabled:!be&&!ve,loading:we,onClick:function(){_e({sync:{repo_path:ve}})},primary:!0,small:!0,children:"Save"}),be&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(z.Z,{onClick:function(){return te(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Cancel"})]})]}),be&&!ee&&(0,T.jsx)(z.Z,{onClick:function(){te(!0),setTimeout((function(){var e;return null===S||void 0===S||null===(e=S.current)||void 0===e?void 0:e.focus()}),1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Edit"})]})]})]}),(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(ge,{branch:l,isLoadingCreateOauth:Ue,showError:O})}),be&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsxs)(m.Z,{children:["Remotes",!b&&g?" (".concat(null===g||void 0===g?void 0:g.length,")"):""]}),b&&(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsx)(p.Z,{inverted:!0})}),!b&&Qe,(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsxs)(f.ZP,{alignItems:"flex-start",children:[(0,T.jsx)(Z.Z,{label:"New remote name",monospace:!0,onChange:function(e){var n;return ce(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:se||""}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)(f.ZP,{flexDirection:"column",children:[(0,T.jsx)(Z.Z,{label:"Remote URL",monospace:!0,onChange:function(e){var n;return fe(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:ae||""}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["Use the https URL if you",(0,T.jsx)("br",{}),"authenticated with GitHub above."]})})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Add,{size:2*B.iI}),disabled:!se||!ae,loading:Ae,onClick:function(){Ee({git_custom_branch:{action_type:"add_remote",action_payload:{name:se,url:ae}}})},primary:!0,children:"Create new remote"})]})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(m.Z,{children:"Actions"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(j.Z,{mb:B.Mq,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(null===l||void 0===l?void 0:l.name)&&(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(x.ZP,{monospace:!0,children:null===l||void 0===l?void 0:l.name}),(0,T.jsx)(j.Z,{mr:B.cd}),(0,T.jsx)(de(),{href:"/version-control?tab=".concat(E.uuid),passHref:!0,children:(0,T.jsx)(z.Z,{small:!0,children:"Switch branch"})})]})]}),(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)(v.Z,{onChange:function(e){return K(e.target.value)},placeholder:"Action",value:Q||"",children:[(0,T.jsx)("option",{value:w,children:(0,N.vg)(w)}),(0,T.jsx)("option",{value:k,children:(0,N.vg)(k)}),(0,T.jsx)("option",{value:"reset",children:(0,N.vg)("reset --hard")}),(0,T.jsx)("option",{value:P,children:(0,N.vg)(P)})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.MultiShare,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return _(e.target.value)},placeholder:"Remote",value:i||"",children:null===g||void 0===g?void 0:g.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))}),![w,P].includes(Q)&&(0,T.jsx)(j.Z,{ml:1,children:(0,T.jsxs)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return D(e.target.value)},value:A||"",children:[(0,T.jsx)("option",{value:"",children:"All branches"}),null===Ze||void 0===Ze?void 0:Ze.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))]})})]}),P===Q&&(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["Cloning a branch will copy all the files and folders from the remote repository and put them into the Git directory configured above:",(0,T.jsx)("br",{}),(0,T.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:null===l||void 0===l||null===(n=l.sync_config)||void 0===n?void 0:n.repo_path}),"."]}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(x.ZP,{muted:!0,small:!0,children:"Cloning won\u2019t automatically create a folder that is named after the remote repository."})}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["For example, if you have a file named ",(0,T.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:"magic.py"})," in a remote repository named ",(0,T.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:"project_romeo"}),(0,T.jsx)("br",{}),"then that file will be cloned here ",(0,T.jsxs)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:[null===l||void 0===l||null===(t=l.sync_config)||void 0===t?void 0:t.repo_path,"/magic.py"]}),(0,T.jsx)("br",{}),"as opposed to ",(0,T.jsxs)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:[null===l||void 0===l||null===(r=l.sync_config)||void 0===r?void 0:r.repo_path,"/project_romeo/magic.py"]}),"."]})}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["If you want to clone the content of a remote repository into a folder named after the remote repository, then change the Git init directoy above to",(0,T.jsx)("br",{}),(0,T.jsxs)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:[null===l||void 0===l||null===(o=l.sync_config)||void 0===o?void 0:o.repo_path,"/",(0,T.jsx)(x.ZP,{inline:!0,monospace:!0,small:!0,children:"[remote repository name]"})]})]})})]}),(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!Q||!i,loading:Ie,onClick:function(){J(null),(Q!==P||"undefined"!==typeof location&&window.confirm("Are you sure you want to clone remote ".concat(i,"? This will ")+"overwrite all your local changes and may reset any settings you may have configured for your local Git repo. This action cannot be undone."))&&Me({git_custom_branch:{action_payload:{branch:A,remote:i},action_type:Q}})},primary:!0,children:Q?(0,N.vg)(Q):"Execute action"}),(X||F)&&(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(x.ZP,{danger:!!F,default:!!X,monospace:!0,preWrap:!0,children:X||F})})]})]})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(f.ZP,{children:(0,T.jsxs)(d.ZP,{afterIcon:(0,T.jsx)(C.PaginateArrowRight,{}),linkProps:{href:"/version-control?tab=".concat(E.uuid)},noHoverUnderline:!0,sameColorAsText:!0,secondary:!0,children:["Next: ",E.uuid]})})]})]})]})},Pe=t(93528),_e=t(98464),we=t(46684),Oe=t(53005),ke=t(15610),Me=(t(17717),t(74401)),Ie=t(86735);function Se(e,n){var t=(0,Me.a9)(e),r=Object.keys(n)||[];return null===r||void 0===r?void 0:r.find((function(e){return null===t||void 0===t?void 0:t.endsWith(e)}))}var He=t(23780);function Ee(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var De="version_control/index",Re=30*B.iI;var Fe=function(){var e=(0,u.useRef)(null),n=(0,u.useRef)(null),t=(0,He.VI)(null,{},[],{uuid:"VersionControlPage"}),r=(0,c.Z)(t,1)[0],o=(0,u.useState)(!0),i=o[0],l=o[1],d=(0,u.useState)(Re),f=d[0],m=d[1],b="layout_before_".concat(De,"_width"),Z=(0,xe.U2)(b,Re),C=(0,u.useState)(Z),P=C[0],_=C[1],w=(0,u.useState)({}),O=w[0],k=w[1],M=(0,u.useState)(null),I=M[0],N=M[1],V=(0,u.useState)(null),q=V[0],G=V[1],z=(0,u.useState)(F[0]),W=z[0],Q=z[1],K=(0,u.useState)({"All projects":{uuid:"All projects"},"Git directory":{uuid:"Git directory"}}),Y=K[0],ee=K[1],ne=(0,pe.iV)();(0,u.useEffect)((function(){null!==ne&&void 0!==ne&&ne.tab&&Q(F.find((function(e){return e.uuid===(null===ne||void 0===ne?void 0:ne.tab)})))}),[ne]);var te=y.ZP.git_custom_branches.list({include_remote_branches:1}),re=te.data,ie=te.mutate,le=(0,u.useMemo)((function(){return null===re||void 0===re?void 0:re.git_custom_branches}),[re]);(0,u.useEffect)((function(){var e,n;!I&&(null===le||void 0===le?void 0:le.length)>=1&&null!==(e=le[0])&&void 0!==e&&e.name&&N(null===(n=le[0])||void 0===n?void 0:n.name)}),[I,le]);var se=y.ZP.git_custom_branches.detail("current",{_format:"with_files"}),ae=se.data,de=se.mutate,he=(0,u.useMemo)((function(){return(null===ae||void 0===ae?void 0:ae.git_custom_branch)||{}}),[ae]),fe=(0,u.useMemo)((function(){return(null===he||void 0===he?void 0:he.files)||[]}),[he]),me=y.ZP.git_custom_branches.detail("with_remotes",{_format:"with_remotes"}),ve=me.data,je=me.mutate,be=(0,u.useMemo)((function(){return null===ve||void 0===ve?void 0:ve.git_custom_branch}),[ve]),Ze=(0,u.useMemo)((function(){return(null===be||void 0===be?void 0:be.remotes)||[]}),[be]),ge=(0,u.useState)(null),ye=ge[0],Me=ge[1],Ee=(0,u.useCallback)((function(e){(0,xe.t8)(S,e),Me(e)}),[]);(0,u.useEffect)((function(){var e=(0,xe.U2)(S,null);if(ve&&e){var n=null===Ze||void 0===Ze?void 0:Ze.find((function(n){return n.name===e}));Ee(n?null===n||void 0===n?void 0:n.name:null)}}),[ve,Ze,Ee]);var Fe=(0,u.useState)((0,xe.U2)(H,"")),Be=Fe[0],Ne=Fe[1],Ve=(0,u.useCallback)((function(e){(0,xe.t8)(H,e),Ne(e)}),[]),Te=(0,u.useMemo)((function(){return(0,Ie.Tw)(Ze.reduce((function(e,n){var t;return e.concat((null===n||void 0===n||null===(t=n.repository_names)||void 0===t?void 0:t.map((function(e){var t;return{name:e,url:null===n||void 0===n||null===(t=n.urls)||void 0===t?void 0:t[0]}})))||[])}),[]),(function(e){return e.name}))}),[Ze]);(0,u.useEffect)((function(){var e=(0,xe.U2)(H,null);if(ve&&e){var n=null===Te||void 0===Te?void 0:Te.find((function(n){return n.name===e}));Ve(n?null===n||void 0===n?void 0:n.name:null)}}),[ve,Te,Ve]);var Ue=y.ZP.git_files.detail(q?encodeURIComponent(q):null,{base_branch:I}),Le=Ue.data,qe=Ue.mutate,Ge=(0,u.useMemo)((function(){return null===Le||void 0===Le?void 0:Le.git_file}),[Le]),ze=(0,_e.Z)(Ge);(0,u.useEffect)((function(){if(Ge!==ze){var e,n=null===he||void 0===he||null===(e=he.files_absolute_path)||void 0===e?void 0:e[q];k((function(e){var t;return Ae(Ae({},e),{},(0,s.Z)({},n,Ae(Ae({},Ge),{},{fullPath:n,relativePath:q,repoPath:null===he||void 0===he||null===(t=he.sync_config)||void 0===t?void 0:t.repo_path})))}))}}),[he,Ge,ze]),(0,u.useEffect)((function(){I&&qe()}),[I,qe]),(0,u.useEffect)((function(){null!==Le&&void 0!==Le&&Le.error&&r({errors:null===Le||void 0===Le?void 0:Le.error,response:Le})}),[Le,r]);var We=(0,u.useMemo)((function(){var e,n,t;return{modifiedFiles:null===he||void 0===he||null===(e=he.modified_files)||void 0===e?void 0:e.reduce((function(e,n){return Ae(Ae({},e),{},(0,s.Z)({},n,!0))}),{}),stagedFiles:null===he||void 0===he||null===(n=he.staged_files)||void 0===n?void 0:n.reduce((function(e,n){return Ae(Ae({},e),{},(0,s.Z)({},n,!0))}),{}),untrackedFiles:null===he||void 0===he||null===(t=he.untracked_files)||void 0===t?void 0:t.reduce((function(e,n){return Ae(Ae({},e),{},(0,s.Z)({},n,!0))}),{})}}),[he]),Qe=We.modifiedFiles,Ke=void 0===Qe?{}:Qe,Ye=We.stagedFiles,Xe=void 0===Ye?{}:Ye,Je=We.untrackedFiles,$e=void 0===Je?{}:Je;(0,u.useEffect)((function(){q&&(0,oe.Qr)(Ke)&&(0,oe.Qr)(Xe)&&(0,oe.Qr)($e)&&G(null)}),[Ke,q,Xe,$e]);var en=(0,u.useMemo)((function(){return(null===fe||void 0===fe?void 0:fe.length)>=1?(0,T.jsx)($.Z,{allowEmptyFolders:!0,disableContextMenu:!0,fetchFiles:de,files:fe,isFileDisabled:function(){return!1},onClickFile:function(e,t){G((function(t){if(!t||t!==e){var r;if(!I)null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus();return e}return null})),qe()},ref:e,renderAfterContent:function(e){var n,t,r=e.children,o=(null===r||void 0===r?void 0:r.length)>=1,i=(0,Oe.a9)(e);o&&(i="".concat(i,"/"));var l={};return Se(e,Ke)?(n="M",t="Modified",l.warning=!0):Se(e,$e)?(n="U",t="Untracked",l.danger=!0):Se(e,Xe)&&(n="S",t="Staged",l.success=!0),o&&!n?null:(0,T.jsx)(j.Z,{mx:1,children:(0,T.jsx)(g.Z,{appearBefore:!0,label:t,widthFitContent:!0,children:(0,T.jsx)(x.ZP,Ae(Ae({},l),{},{monospace:!0,rightAligned:!0,small:!0,children:n}))})})},useRootFolder:!0,uuid:"pages/VersionControl"}):(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(x.ZP,{monospace:!0,muted:!0,children:"No files modified"})})}),[I,de,qe,e,fe,Ke,n,G,Xe,$e]),nn=((0,u.useMemo)((function(){return!Le||!Ge||q&&(null===Ge||void 0===Ge?void 0:Ge.filename)!==q}),[Le,Ge,q]),(0,u.useMemo)((function(){return ae&&null!==he&&void 0!==he&&he.name?F:F.slice(0,1)}),[he,ae])),tn=(0,u.useMemo)((function(){return(0,T.jsxs)("div",{style:{marginTop:5},children:[(0,T.jsx)(L.Z,{onClickTab:function(e){var n=e.uuid;(0,ke.u)({tab:n})},selectedTabUUID:null===W||void 0===W?void 0:W.uuid,tabs:nn,underlineStyle:!0}),(0,T.jsx)(h.Z,{light:!0})]})}),[W,nn]),rn=(0,u.useMemo)((function(){return(0,T.jsx)(Ce,{actionRemoteName:ye,branch:he,fetchBranch:function(){de(),je()},loading:!ve,remotes:Ze,setActionRemoteName:Ee,showError:r})}),[ye,he,ve,de,je,Ze,Ee,r]),on=(0,u.useMemo)((function(){return(0,T.jsx)(U,{actionRemoteName:ye,branch:he,branches:le,fetchBranch:de,fetchBranches:ie,remotes:Ze,setActionRemoteName:Ee,showError:r})}),[ye,he,le,de,ie,Ze,Ee,r]),ln=(0,u.useMemo)((function(){return(0,T.jsx)(ce,{branch:he,fetchBranch:de,modifiedFiles:Ke,setSelectedFilePath:G,showError:r,stagedFiles:Xe,untrackedFiles:$e})}),[he,de,Ke,G,r,Xe,$e]),sn=(0,u.useMemo)((function(){return(0,T.jsx)(X,{actionRemoteName:ye,branch:he,branches:le,fetchBranch:de,loading:!ve,modifiedFiles:Ke,remotes:Ze,repositories:Te,repositoryName:Be,setActionRemoteName:Ee,setRepositoryName:Ve,showError:r,stagedFiles:Xe})}),[ye,he,le,ve,de,Ke,Ze,Te,Be,Ee,Ve,r,Xe]),cn=(0,u.useMemo)((function(){return(0,T.jsx)(L.Z,{allowScroll:!0,onClickTab:function(e){ee((function(n){return Ae(Ae({},(0,oe.gR)(n,[null===e||void 0===e?void 0:e.uuid])),null!==n&&void 0!==n&&n[null===e||void 0===e?void 0:e.uuid]?{}:(0,s.Z)({},null===e||void 0===e?void 0:e.uuid,e))}))},selectedTabUUIDs:Y,tabs:[{uuid:"All projects"},{uuid:"Git directory"}],underlineStyle:!0})}),[Y]),un=(0,u.useCallback)((function(){qe()}),[qe]),an=(0,u.useCallback)((function(){de()}),[de]),dn=(0,u.useMemo)((function(){var e;if(q)return null===he||void 0===he||null===(e=he.files_absolute_path)||void 0===e?void 0:e[q]}),[he,q]),hn=(0,u.useCallback)((function(e){k((function(n){return(0,oe.gR)(n,[e])}))}),[]),fn=(0,Pe.ZP)({codeEditorMaximumHeightOffset:2*we.Mz+10,onClickTabClose:hn,onCreateFile:an,onUpdateFileSuccess:un,originalContent:O,selectedFilePath:dn,showHiddenFilesSetting:!0,uuid:"pages/VersionControlPage"}),mn=fn.browser,vn=fn.controller,jn=fn.filePaths,pn=(fn.menu,fn.selectedFilePath),xn=fn.tabs,bn=(0,a.Db)((function(e){var n=e.filePath,t=e.query;return y.ZP.git_files.detailAsync(encodeURIComponent(n),t)})),Zn=(0,c.Z)(bn,2),gn=Zn[0];Zn[1].isLoading,(0,u.useEffect)((function(){pn&&gn({filePath:pn,query:{base_branch:I,derive:!0}}).then((function(e){return k((function(n){var t;return Ae(Ae({},n),{},(0,s.Z)({},pn,null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.git_file))}))}))}),[pn]),(0,u.useEffect)((function(){(null===jn||void 0===jn?void 0:jn.length)>=1&&l(!1)}),[jn]);var yn=(0,u.useMemo)((function(){var e=[];return"All projects"in Y&&e.push([{render:function(e){var n=e.columnWidth;return(0,T.jsx)("div",{style:{width:"".concat(n,"px")},children:mn})}}]),"Git directory"in Y&&e.push([{render:function(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{p:1,children:(0,T.jsx)(v.Z,{compact:!0,label:"Base branch",onChange:function(e){return N(e.target.value)},ref:n,small:!0,value:I||"",children:null===le||void 0===le?void 0:le.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})}),en]})}}]),(0,T.jsx)(ue.Z,{columnsOfItems:e,fullHeight:!0,heightOffset:2*we.Mz,uuid:"version-control-all-modified-files",width:P})}),[I,le,mn,P,en,Y]);return(0,T.jsx)(J.Z,{after:vn,afterHeader:xn,afterHidden:i,afterWidth:f,before:yn,beforeHeader:cn,beforeWidth:P,mainContainerHeader:tn,setAfterHidden:l,setAfterWidth:m,setBeforeWidth:_,title:"Version control",uuid:De,children:(0,T.jsxs)(j.Z,{p:B.cd,children:[!ae&&(0,T.jsx)(p.Z,{inverted:!0}),ae&&(0,T.jsxs)(T.Fragment,{children:[R.uuid===(null===W||void 0===W?void 0:W.uuid)&&rn,E.uuid===(null===W||void 0===W?void 0:W.uuid)&&on,A.uuid===(null===W||void 0===W?void 0:W.uuid)&&ln,D.uuid===(null===W||void 0===W?void 0:W.uuid)&&sn]})]})})};function Be(){return(0,T.jsx)(Fe,{})}Be.getInitialProps=(0,r.Z)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Ne=(0,l.Z)(Be)},75302:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/version-control",function(){return t(37520)}])},80022:function(e,n,t){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}t.d(n,{Z:function(){return r}})},15544:function(e,n,t){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}t.d(n,{Z:function(){return r}})},13692:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var r=t(61049);function o(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&(0,r.Z)(e,n)}},93189:function(e,n,t){"use strict";t.d(n,{Z:function(){return i}});var r=t(12539),o=t(80022);function i(e,n){if(n&&("object"===r(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}}},function(e){e.O(0,[1557,9774,2888,179],(function(){return n=75302,e(e.s=n);var n}));var n=e.O();_N_E=n}]);