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.
- mage_ai/api/policies/BackfillPolicy.py +1 -0
- mage_ai/api/policies/PipelinePolicy.py +1 -0
- mage_ai/api/policies/WorkspacePolicy.py +1 -0
- mage_ai/api/presenters/BackfillPresenter.py +1 -0
- mage_ai/api/resources/GitBranchResource.py +56 -23
- mage_ai/api/resources/GitCustomBranchResource.py +29 -1
- mage_ai/api/resources/OauthResource.py +1 -1
- mage_ai/api/resources/PipelineResource.py +11 -5
- mage_ai/api/resources/PipelineRunResource.py +41 -4
- mage_ai/api/resources/PipelineScheduleResource.py +4 -0
- mage_ai/api/resources/PullRequestResource.py +6 -4
- mage_ai/api/resources/WorkspaceResource.py +5 -4
- mage_ai/cache/block_action_object/__init__.py +1 -1
- mage_ai/cluster_manager/kubernetes/workload_manager.py +52 -1
- mage_ai/cluster_manager/workspace/base.py +6 -0
- mage_ai/cluster_manager/workspace/kubernetes.py +22 -1
- mage_ai/command_center/applications/utils.py +2 -2
- mage_ai/command_center/presenters/text.py +1 -1
- mage_ai/data_preparation/executors/k8s_block_executor.py +30 -7
- mage_ai/data_preparation/executors/k8s_pipeline_executor.py +30 -7
- mage_ai/data_preparation/executors/streaming_pipeline_executor.py +1 -1
- mage_ai/data_preparation/git/__init__.py +50 -22
- mage_ai/data_preparation/git/api.py +62 -7
- mage_ai/data_preparation/git/utils.py +45 -21
- mage_ai/data_preparation/models/block/__init__.py +24 -5
- mage_ai/data_preparation/models/block/dynamic/utils.py +9 -4
- mage_ai/data_preparation/models/block/global_data_product/__init__.py +25 -2
- mage_ai/data_preparation/models/block/remote/__init__.py +0 -0
- mage_ai/data_preparation/models/block/remote/models.py +58 -0
- mage_ai/data_preparation/models/block/utils.py +38 -0
- mage_ai/data_preparation/models/constants.py +2 -0
- mage_ai/data_preparation/models/global_data_product/__init__.py +12 -0
- mage_ai/data_preparation/models/pipeline.py +9 -5
- mage_ai/data_preparation/models/triggers/__init__.py +4 -2
- mage_ai/data_preparation/storage/local_storage.py +12 -6
- mage_ai/orchestration/db/migrations/versions/42a14d6143f1_update_token_column_type.py +54 -0
- mage_ai/orchestration/db/models/oauth.py +10 -9
- mage_ai/orchestration/db/models/schedules.py +21 -0
- mage_ai/orchestration/notification/sender.py +37 -15
- mage_ai/orchestration/pipeline_scheduler_original.py +32 -25
- mage_ai/orchestration/triggers/api.py +29 -1
- mage_ai/orchestration/triggers/global_data_product.py +9 -4
- mage_ai/orchestration/triggers/utils.py +10 -1
- mage_ai/orchestration/utils/resources.py +3 -0
- mage_ai/server/api/downloads.py +4 -1
- mage_ai/server/api/runs.py +151 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +6 -6
- mage_ai/server/frontend_dist/_next/static/{_krrrgup_C-dPOpX36S8I → RhDiJSkcjCsh4xxX4BFBk}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1557-b3502f3f1aa92ac7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7966-b9b85ba10667e654.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- 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
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7181b086c93784d2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +1 -0
- 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
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +2 -2
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/oauth.html +2 -2
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/settings.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +6 -6
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/_next/static/{KLL5mirre9d7_ZeEpaw3s → TdpLLFome13qvM0gXvpHs}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-b3502f3f1aa92ac7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-b9b85ba10667e654.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- 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
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7181b086c93784d2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +1 -0
- 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
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/oauth.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
- mage_ai/server/scheduler_manager.py +3 -1
- mage_ai/server/server.py +35 -12
- mage_ai/server/utils/output_display.py +2 -2
- mage_ai/services/aws/ecs/ecs.py +1 -0
- mage_ai/services/k8s/config.py +4 -4
- mage_ai/services/k8s/utils.py +97 -0
- mage_ai/shared/parsers.py +6 -1
- mage_ai/tests/api/operations/base/mixins.py +1 -1
- mage_ai/tests/api/resources/test_pipeline_resource.py +2 -2
- mage_ai/tests/authentication/oauth/test_utils.py +1 -1
- mage_ai/tests/data_preparation/models/block/test_global_data_product.py +2 -0
- mage_ai/tests/orchestration/triggers/test_global_data_product.py +138 -136
- mage_ai/tests/server/test_server.py +19 -0
- mage_ai/tests/services/k8s/test_job_manager.py +9 -6
- mage_ai/version_control/branch/utils.py +2 -1
- mage_ai/version_control/models.py +3 -2
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/METADATA +2 -2
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/RECORD +217 -212
- mage_ai/server/frontend_dist/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{_krrrgup_C-dPOpX36S8I → RhDiJSkcjCsh4xxX4BFBk}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{KLL5mirre9d7_ZeEpaw3s → TdpLLFome13qvM0gXvpHs}/_ssgManifest.js +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.70.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
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"})}),T=P&&y;return(0,f.jsxs)(f.Fragment,{children:[T&&(0,f.jsx)(s.Z,{onClickTab:y,selectedTabUUID:null===P||void 0===P?void 0:P.uuid,tabs:b,underlineStyle:!0}),(!T||_.uuid===(null===P||void 0===P?void 0:P.uuid))&&(0,f.jsx)(c.ZP,j(j({},O),{},{height:n,heightOffset:(i||0)+(T?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),T=i(30160),D=i(12468),M=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 Te=M.ZP.pipeline_runs.pipeline_schedules.list(fe,Ee,{refreshInterval:3e3,revalidateOnFocus:!0}),De=Te.data,Me=Te.mutate,Ne=(0,c.useMemo)((function(){return(null===De||void 0===De?void 0:De.pipeline_runs)||[]}),[De]),Ae=(0,c.useMemo)((function(){var e;return(null===De||void 0===De||null===(e=De.metadata)||void 0===e?void 0:e.count)||[]}),[De]),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:Me,hideTriggerColumn:!0,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)})})]})}),[Me,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 M.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=M.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)(M.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)(M.ZP.pipeline_runs.pipeline_schedules.useCreate(fe),{onSuccess:function(e){return(0,Y.wD)(e,{callback:function(){Me()},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)(T.ZP,{default:!0,children:"Trigger type"})]},"trigger_type_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"Status"})]},"trigger_status_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"Description"})]},"trigger_description_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"SLA"})]},"trigger_sla_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"Frequency"})]},"trigger_frequency_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"Next run date"})]},"trigger_next_run_date_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"Start date"})]},"trigger_start_date_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"Last enabled at"})]},"trigger_last_enabled_at_label"),(0,te.jsx)(T.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)(T.ZP,{default:!0,children:"API endpoint"})]},"trigger_api_endpoint_label"),(0,te.jsx)(f.Z,{copiedText:a,children:(0,te.jsx)(T.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)(D.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)(T.ZP,{default:!0,children:"Timeout"})]},"trigger_timeout"),(0,te.jsx)(T.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)(D.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)(T.ZP,{default:!0,children:"Skip if running"})]},"trigger_skip_if_running"),(0,te.jsx)(T.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)(D.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)(T.ZP,{default:!0,children:"Allow blocks to fail"})]},"trigger_allow_blocks_to_fail"),(0,te.jsx)(T.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)(D.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)(T.ZP,{default:!0,children:"Create initial run"})]},"trigger_create_initial_pipeline_run"),(0,te.jsx)(T.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)(T.ZP,{default:!0,monospace:!0,children:n},"settings_variable_label_".concat(n)),(0,te.jsx)(T.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)(T.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)(T.ZP,{default:!0,monospace:!0,children:"Stream"},"stream_title_".concat(n)),(0,te.jsx)(T.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)(T.ZP,{default:!0,monospace:!0,children:i},"settings_variable_label_".concat(i)),(0,te.jsx)(T.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)(T.ZP,{monospace:!0,small:!0,children:[i&&(0,te.jsx)(T.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:i}),r,t&&(0,te.jsx)(T.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:t})]},"settings_variable_label_".concat(r)),(0,te.jsx)(T.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)(T.ZP,{default:!0,monospace:!0,children:q._P[i].label()},"".concat(i,"_").concat(n,"_label")),(0,te.jsx)(T.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)(T.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)(T.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)(T.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=M.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=M.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=M.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 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4249],{16488:function(e,n,r){"use strict";r.d(n,{IJ:function(){return h},M8:function(){return P},Uc:function(){return j},XM:function(){return Z},_U:function(){return v},eI:function(){return b},gU:function(){return y},lO:function(){return S},ri:function(){return m},tL:function(){return w},vJ:function(){return O},xH:function(){return x}});var t,i=r(82394),o=r(92083),l=r.n(o),u=r(3917),c=r(4383),a=r(30229),d=r(42122),s=r(86735);function p(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function f(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){(0,i.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var v=function(e){return!!e&&!Object.values(a.U5).includes(e)};function h(e){return null===e||void 0===e?void 0:e.reduce((function(e,n){var r=n.block_uuid,t=n.completed_at,o=n.started_at,u=n.status,c=null;o&&t&&(c=l()(t).valueOf()-l()(o).valueOf());return f(f({},e),{},(0,i.Z)({},r,{runtime:c,status:u}))}),{})}var g,m=function(e){var n=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:a.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:a.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:a.Xm.API}];return e?n.slice(0,1):n};function x(e){var n=(0,d.gR)(e,[a.gm.INTERVAL,a.gm.TYPE]),r=e[a.gm.INTERVAL];r&&(n["schedule_interval[]"]=encodeURIComponent(r));var t=e[a.gm.TYPE];return t&&(n["schedule_type[]"]=t),n}function b(e){return e?new Date(l()(e).valueOf()):null}function j(e,n){return n?(0,u.XG)(e,n):function(e){if("string"!==typeof e)return e;var n=e.split("+")[0];return l()(b(n)).format(u.Nx)}(e)}!function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second"}(g||(g={}));var w=(t={},(0,i.Z)(t,g.DAY,86400),(0,i.Z)(t,g.HOUR,3600),(0,i.Z)(t,g.MINUTE,60),(0,i.Z)(t,g.SECOND,1),t);function y(e){var n=g.SECOND,r=e;return e%86400===0?(r/=86400,n=g.DAY):e%3600===0?(r/=3600,n=g.HOUR):e%60===0&&(r/=60,n=g.MINUTE),{time:r,unit:n}}function O(e,n){return e*w[n]}function Z(e,n,r){var t,i=l()(e);return i.set("hour",+(null===n||void 0===n?void 0:n.hour)||0),i.set("minute",+(null===n||void 0===n?void 0:n.minute)||0),i.set("second",0),t=i.format(u.TD),null!==r&&void 0!==r&&r.includeSeconds&&(t=t.concat(":00")),null!==r&&void 0!==r&&r.localTimezone&&(t=i.format(u.lE),null!==r&&void 0!==r&&r.convertToUtc&&(t=(0,u.d$)(t,{includeSeconds:null===r||void 0===r?void 0:r.includeSeconds,utcFormat:!0}))),t}function P(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",t=!0;if(t){var i=(0,c.XF)();n?r="".concat(i,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/api_trigger"):(r="".concat(i,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/pipeline_runs"),null!==e&&void 0!==e&&e.token&&(r="".concat(r,"/").concat(e.token)))}return r}function _(e,n,r){return e.match(/[*,-/]/)?{additionalOffset:0,cronValue:e}:function(e,n,r){var t=r.indexOf(e),i=0;if(n<0)for(var o=0;o>n;o--)0===t?(t=r.length-1,i-=1):t-=1;else if(n>0)for(var l=0;l<n;l++)t===r.length-1?(t=0,i+=1):t+=1;var u="number"===typeof r[t]?r[t]:e;return{additionalOffset:i,cronValue:String(u)}}(+e,n,r)}var I=(0,s.m5)(60),k=(0,s.m5)(24),C=(0,u.Cs)();function S(e,n){if(!e)return e;var r=l()().local().format("Z"),t=r.split(":"),i="-"===r[0],o=3===t[0].length?Number(t[0].slice(1)):Number(t[0]),u=Number(t[1]);(i&&!n||!i&&n)&&(o=-o,u=-u);var c=e.split(" "),a=c[0],d=c[1],s=c[2],p=_(a,u,I),f=_(d,o+p.additionalOffset,k);if(c[0]=p.cronValue,c[1]=f.cronValue,0!==(null===f||void 0===f?void 0:f.additionalOffset)){var v=_(s,f.additionalOffset,C);c[2]=v.cronValue}return c.join(" ")}},38415:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return Ce}});var t=r(77837),i=r(75582),o=r(82394),l=r(38860),u=r.n(l),c=r(12691),a=r.n(c),d=r(82684),s=r(69864),p=r(34376),f=r(24138),v=r(15338),h=r(68562),g=r(48670),m=r(55072),x=r(75457),b=r(30229),j=r(93808),w=r(82359),y=r(71610),O=r(71180),Z=r(90299),P=r(55485),_=r(85854),I=r(37899),k=r(65956),C=r(38276),S=r(30160),E=r(44897),T=r(70515),M={uuid:"RUNTIME VARIABLES"},R={uuid:"BOOKMARK VALUES"},N=r(32080),B=r(8916),D=r(81728),A=r(28598);function V(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function U(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?V(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var F="".concat(T.iI,"px ").concat(3*T.iI,"px");var H=function(e){var n=e.initialPipelineSchedulePayload,r=e.onCancel,t=e.onSuccess,i=e.pipeline,l=e.variables,u=(0,d.useState)(null),c=u[0],a=u[1],s=(0,d.useState)(!0),p=s[0],f=s[1],h=(0,d.useState)(l||{}),g=h[0],m=h[1],x=(0,d.useState)(null),j=x[0],w=x[1],V=(0,d.useMemo)((function(){return U(U({},n),{},{name:(0,D.Y6)(),variables:p?(0,B.e7)(U(U({},g),c?(0,o.Z)({},b.PN,c):{})):null})}),[c,n,p,g]),H=(0,d.useMemo)((function(){return null!==i&&void 0!==i&&i.blocks?(0,N.n)(i):null}),[i]),G=(0,d.useMemo)((function(){var e;return H&&(null===(e=Object.keys(H||{}))||void 0===e?void 0:e.length)>=1?[M,R]:null}),[H]);(0,d.useEffect)((function(){(null===G||void 0===G?void 0:G.length)>=1&&!j&&w(null===G||void 0===G?void 0:G[0])}),[j,w,G]);var L=(0,d.useMemo)((function(){return null!==G&&void 0!==G&&G.length?(0,A.jsx)(Z.Z,{onClickTab:function(e){w(e)},selectedTabUUID:null===j||void 0===j?void 0:j.uuid,tabs:G,underlineStyle:!0}):null}),[j,w,G]);return(0,A.jsxs)(k.Z,{noPadding:!0,footer:(0,A.jsxs)(P.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,A.jsx)(O.ZP,{onClick:function(){t({pipeline_schedule:V}),r()},padding:F,primaryAlternate:!0,children:"Run now"}),(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(O.ZP,{borderColor:E.Z.background.page,onClick:r,padding:F,secondary:!0,children:"Cancel"})]}),header:(0,A.jsx)(_.Z,{level:5,children:"Run pipeline now"}),maxHeight:"90vh",minWidth:85*T.iI,subtitle:(0,A.jsxs)(A.Fragment,{children:[!(null!==G&&void 0!==G&&G.length)&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(null===G||void 0===G?void 0:G.length)>=1&&L,(0,A.jsx)(v.Z,{light:!0})]}),children:[(!(null!==G&&void 0!==G&&G.length)||M.uuid===(null===j||void 0===j?void 0:j.uuid))&&(0,A.jsxs)(A.Fragment,{children:[(null===G||void 0===G?void 0:G.length)>=1&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(0,A.jsx)(I.Z,{enableVariablesOverwrite:p,originalVariables:l,runtimeVariables:g,setEnableVariablesOverwrite:f,setRuntimeVariables:m})]}),R.uuid===(null===j||void 0===j?void 0:j.uuid)&&(0,A.jsx)(y.Z,{bookmarkValues:c,pipeline:i,setBookmarkValues:a})]})},G=r(97618),L=r(72473),Y=r(25976),X=r(42631),z=r(47041),q=r(91437),Q=Y.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-pu8csx-0"})([""," overflow-y:auto;position:relative;width:100%;z-index:3;border-radius:","px;"," "," "," ",""],z.w5,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.flex&&"\n flex: 1;\n "}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),W=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderRowStyle",componentId:"sc-pu8csx-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;position:sticky;top:0;width:100%;z-index:2;"," "," ",""],X.n_,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).panel,";\n ")}),(function(e){return!e.noBorder&&"\n border: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),J=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderCellStyle",componentId:"sc-pu8csx-2"})([""," ",""],(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),K=Y.default.div.withConfig({displayName:"indexstyle__RowTitleStyle",componentId:"sc-pu8csx-3"})([""," "," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).header,";\n border: 1px solid ").concat((e.theme.interative||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),$=Y.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-pu8csx-4"})([""," "," "," ",""],(0,q.eR)(),(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n border-top: none;\n border-bottom: none;\n ")}),(function(e){return!e.noBorder&&"\n border-bottom: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.finalRow&&!e.noBorderRadius&&"\n border-bottom-left-radius: ".concat(X.n_,"px;\n border-bottom-right-radius: ").concat(X.n_,"px;\n ")})),ee=Y.default.div.withConfig({displayName:"indexstyle__TextStyle",componentId:"sc-pu8csx-5"})(["p{cursor:pointer;}"]),ne=Y.default.div.withConfig({displayName:"indexstyle__RowCellStyle",componentId:"sc-pu8csx-6"})(["width:100%;z-index:0;"," "," "," "," ",""],(function(e){return!e.first&&"\n border-left: 1px solid ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.textColor&&"\n & p {\n color: ".concat(e.textColor,";\n }\n ")}),(function(e){return e.vanish&&"\n border: none;\n padding: 0 !important;\n width: 0% !important;\n height: 100% !important;\n background-color: ".concat((e.theme.background||E.Z.background).page," !important;\n ")})),re=r(35185);var te=function(e){var n,r=e.cellIndex,t=e.danger,i=e.flex,o=e.render,l=e.rowGroupIndex,u=e.rowIndex,c=e.selected,a=e.small,s=e.showBackground,p=e.showProgress,f=e.textColor,v=e.value,h=e.vanish,m=(0,d.useState)(!1),x=m[0],b=m[1],j=Array.isArray(v);return n=o?o(v):"function"===typeof v?v({selected:c}):j?(0,A.jsxs)(G.Z,{alignItems:"start",flexDirection:"row",justifyContent:"space-between",children:[(0,A.jsxs)(S.ZP,{small:a,textOverflow:!0,title:v[0],children:[x&&(0,A.jsx)(A.Fragment,{children:"".concat(v[0]," & ").concat(v.length-1," more")}),!x&&(0,A.jsx)(A.Fragment,{children:v.map((function(e){return(0,A.jsx)("div",{children:e},e)}))})]}),(0,A.jsxs)(g.Z,{onClick:function(){return b(!x)},children:[x&&(0,A.jsx)(L.ArrowDown,{muted:!0,size:2*T.iI}),!x&&(0,A.jsx)(L.ArrowRight,{muted:!0,size:2*T.iI})]})]}):p?(0,A.jsx)(P.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:(0,A.jsx)(re.Z,{danger:v<80,progress:v})}):(0,A.jsx)(S.ZP,{bold:t,danger:t,small:a,textOverflow:!0,title:v,children:v}),(0,A.jsx)(G.Z,{flex:i,textOverflow:!0,children:(0,A.jsx)(ne,{first:0===r,showBackground:s,small:a,textColor:f,vanish:h,children:!h&&(0,A.jsxs)(A.Fragment,{children:[n," "]})})},"cell-".concat(l,"-").concat(u,"-").concat(r,"-").concat(v))};var ie=function(e){var n=e.columnFlexNumbers,r=e.columnHeaders,t=e.height,i=e.isTextSelectionRequired,o=e.noBorder,l=e.noBorderRadius,u=e.onClickRow,c=e.onHoverRow,a=e.renderRowCellByIndex,s=e.rowGroupData,p=void 0===s?[]:s,f=e.selectedRowIndexes,v=e.small,h=e.flex,m=e.warnings,x=void 0===m?[]:m,b=(0,d.useMemo)((function(){return p.length}),[p]);return(0,A.jsxs)(Q,{flex:h,height:t,noBorder:o,noBorderRadius:l,noScrollbarTrackBackground:!0,children:[(0,A.jsx)(W,{noBorder:o,noBorderRadius:l,children:(0,A.jsx)(P.ZP,{alignItems:"center",children:r.map((function(e,r){var t=e.Icon,i=e.label;return(0,A.jsx)(G.Z,{flex:n[r],children:(0,A.jsx)(J,{first:0===r,small:v,children:(0,A.jsxs)(P.ZP,{alignItems:"center",children:[t&&(0,A.jsx)(L.Check,{}),t&&(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(S.ZP,{bold:!0,children:i})]})})},i)}))})}),p&&p.map((function(e,r){var t,d=e.title,s=e.rowData,p=d||r,h=[];d&&(t=(0,A.jsx)(K,{small:v,children:(0,A.jsx)(S.ZP,{bold:!0,children:d})}));var m=null===s||void 0===s?void 0:s.length;return null===s||void 0===s||s.forEach((function(e,t){var d=e.columnTextColors,s=e.columnValues,j=e.danger,w=e.uuid,y=(null===f||void 0===f?void 0:f[0])===r&&(null===f||void 0===f?void 0:f[1])===t,O=[],Z=x.find((function(e){return e.name===s[0]})),_=Z&&(0,D.HD)(s[1])?(0,D.Tz)(s[1]):s[1],I=Z&&Z.compare(_,Z.val);null===s||void 0===s||s.forEach((function(e,i,o){var l=null===a||void 0===a?void 0:a[i],u=d?d[i]:void 0;Array.isArray(e)?O.push((0,A.jsx)(te,{cellIndex:i,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,showProgress:e[0],small:v,textColor:u,value:e[1]},i)):"undefined"===typeof e?(O.pop(),i=o.length+1,O.push((0,A.jsx)(te,{cellIndex:i,danger:j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e,vanish:!0},i))):O.push((0,A.jsx)(te,{cellIndex:i,danger:I||j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e},i))}));var k=(0,A.jsx)(P.ZP,{textOverflow:!0,children:O});h.push((0,A.jsxs)($,{finalRow:b-1===r&&m-1===t,hasHover:!!c,noBorder:o,noBorderRadius:l,onMouseEnter:function(){return null===c||void 0===c?void 0:c({rowGroupIndex:r,rowIndex:t,uuid:w})},selected:y,children:[u&&(i?(0,A.jsx)(ee,{onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},role:"cell",children:k}):(0,A.jsx)(g.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},preventDefault:!0,children:k})),!u&&k]},"row-group-".concat(p,"-row-").concat(t)))})),(0,A.jsxs)("div",{children:[t,h]},p)}))]})},oe=Y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1xgfh62-0"})(["display:flex;flex-direction:column;height:","px;border-bottom:1px solid ",";"," "," ",""],(function(e){return e.height}),E.Z.borders.medium,(function(e){return e.includePadding&&"\n padding: ".concat(T.tr,"px;\n ")}),(function(e){return e.overflow&&"\n overflow: auto;\n "}),z.w5),le=r(79633);var ue=function(e){var n=e.height,r=e.scheduleType,t=e.variables,o=e.variablesOverride,l=[];Object.entries(t).forEach((function(e){var n=(0,i.Z)(e,2),r=n[0],t=n[1],u=null===o||void 0===o?void 0:o[r];l.push({uuid:r,value:(0,B.FS)(u||t)})})),(0,B.JZ)(l,r);var u=Object.keys(t).length;return(0,A.jsx)(oe,{height:n,children:t&&(0,A.jsx)(ie,{columnFlexNumbers:[1,1],columnHeaders:[{label:"Runtime variable (".concat(u,")")},{label:"Value"}],noBorderRadius:!0,rowGroupData:[{rowData:l.map((function(e){var n=e.uuid,r=e.value;return{columnTextColors:[le.Or,void 0],columnValues:[n,r],uuid:n}}))}],small:!0})})},ce=r(4190),ae=r(12717),de=r(85544),se=r(29624),pe=r(35686),fe=r(72191),ve=r(28795),he=r(81066),ge=r(24944),me=r(3917),xe=r(69419),be=r(16488),je=r(86735),we=r(42122),ye=r(50178),Oe=r(72619),Ze=r(70320),Pe=r(89538);function _e(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function Ie(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function ke(e){var n=e.pipeline,r=(0,p.useRouter)(),t=(0,ye.Ct)(),l=n.uuid,u=pe.ZP.pipelines.detail(l,{includes_outputs:!1},{revalidateOnFocus:!1}).data,c=(0,d.useMemo)((function(){return(null===u||void 0===u?void 0:u.pipeline)||n}),[null===u||void 0===u?void 0:u.pipeline,n]),j=(0,d.useState)(null),y=j[0],O=j[1],Z=(0,d.useState)(null),P=Z[0],_=Z[1],I=(0,d.useState)(!1),k=I[0],E=I[1],T=pe.ZP.projects.list().data,M=(0,d.useMemo)((function(){var e;return null===T||void 0===T||null===(e=T.projects)||void 0===e?void 0:e[0]}),[T]),R=((0,d.useMemo)((function(){var e;return(0,Ze.hY)(null===M||void 0===M||null===(e=M.features)||void 0===e?void 0:e[w.d.LOCAL_TIMEZONE])}),[null===M||void 0===M?void 0:M.features]),pe.ZP.client_pages.detail("pipeline_schedule:create",{"pipelines[]":[l]},{},{key:"Triggers/Edit/".concat(l)}).data),N=(0,d.useMemo)((function(){return null===R||void 0===R?void 0:R.client_page}),[R]),V=(0,d.useMemo)((function(){var e,n;return null===N||void 0===N||null===(e=N.components)||void 0===e||null===(n=e.find((function(e){return"create_with_interactions_component"===e.uuid})))||void 0===n?void 0:n.enabled}),[N]),U=(0,d.useMemo)((function(){return null===N||void 0===N?void 0:N.disabled}),[N]),F=pe.ZP.variables.pipelines.list(l,{global_only:!0},{revalidateOnFocus:!1}).data,G=null===F||void 0===F?void 0:F.variables,Y=(0,xe.iV)(),X=(0,d.useMemo)((function(){return(0,xe.DQ)(Y,[b.gm.INTERVAL,b.gm.STATUS,b.gm.TAG,b.gm.TYPE])}),[Y]),z=(0,be.xH)(X),q=null!==Y&&void 0!==Y&&Y.page?Y.page:0,Q=pe.ZP.pipeline_schedules.pipelines.list(l,Ie(Ie({},z),{},{_limit:m.Q,_offset:(null!==Y&&void 0!==Y&&Y.page?Y.page:0)*m.Q}),{refreshInterval:7500}),W=Q.data,J=Q.mutate,K=(0,d.useMemo)((function(){return(null===W||void 0===W?void 0:W.pipeline_schedules)||[]}),[W]),$=function(e){return(0,s.Db)(pe.ZP.pipeline_schedules.pipelines.useCreate(l),{onSuccess:function(n){return(0,Oe.wD)(n,{callback:function(n){var r=n.pipeline_schedule.id;null===e||void 0===e||e(r)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}})},ee=$((function(e){return r.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(null===c||void 0===c?void 0:c.uuid,"/triggers/").concat(e,"/edit"))})),ne=(0,i.Z)(ee,2),re=ne[0],te=ne[1].isLoading,ie=$(J),le=(0,i.Z)(ie,2),_e=le[0],ke=le[1].isLoading,Ce=(0,d.useMemo)((function(){return(0,B.Tt)(G)}),[G]),Se=(0,D.Y6)(),Ee=(0,d.useMemo)((function(){return{name:Se,schedule_interval:b.U5.ONCE,schedule_type:b.Xm.TIME,start_time:(0,me.d$)((new Date).toISOString(),{dayAgo:!0,utcFormat:!0}),status:b.fq.ACTIVE}}),[Se]),Te=(0,Pe.dd)((function(){return(0,A.jsx)(H,{initialPipelineSchedulePayload:Ee,onCancel:Ne,onSuccess:_e,pipeline:c,variables:Ce})}),{},[G,c,Ce],{background:!0,uuid:"run_pipeline_now_popup"}),Me=(0,i.Z)(Te,2),Re=Me[0],Ne=Me[1],Be=(0,d.useState)(),De=Be[0],Ae=Be[1],Ve=(0,d.useMemo)((function(){var e=null===De||void 0===De?void 0:De.variables,n=!(0,we.Qr)(Ce);return function(r){var i=80;if(n){var o=Object.keys(Ce).length;i=46+43*Math.min(5,o)+1}var u=r.height-i;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(f.ZP,Ie(Ie({},r),{},{enablePorts:!1,height:u,noStatus:!0})),n&&(0,A.jsx)(ue,{height:i+1,scheduleType:null===De||void 0===De?void 0:De.schedule_type,variables:Ce,variablesOverride:e}),!n&&(0,A.jsxs)(oe,{height:i+1,includePadding:!0,overflow:!0,children:[(0,A.jsx)(S.ZP,{children:"This pipeline has no runtime variables."}),!t&&(0,A.jsxs)(C.Z,{mt:1,children:[(0,A.jsx)(a(),{as:"/pipelines/".concat(l,"/edit?sideview=variables"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,A.jsx)(g.Z,{primary:!0,children:"Click here"})})," ",(0,A.jsx)(S.ZP,{inline:!0,children:"to add variables to this pipeline."})]})]})]})}}),[t,l,null===De||void 0===De?void 0:De.schedule_type,null===De||void 0===De?void 0:De.variables,Ce]),Ue=(0,d.useMemo)((function(){var e;return(null===W||void 0===W||null===(e=W.metadata)||void 0===e?void 0:e.count)||[]}),[W]),Fe=pe.ZP.pipeline_triggers.pipelines.list(l).data,He=(0,d.useMemo)((function(){return(0,je.HK)((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[],(function(e){return e.name}))}),[Fe]);(0,d.useEffect)((function(){var e=((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[]).find((function(e){var n=e.settings;return null===n||void 0===n?void 0:n.invalid_schedule_interval}));_(e?{displayMessage:'Schedule interval for Trigger (in code) "'.concat(null===e||void 0===e?void 0:e.name,'"')+" is invalid. Please check your cron expression\u2019s syntax in the pipeline\u2019s triggers.yaml file."}:null)}),[null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers]);var Ge=pe.ZP.tags.list().data,Le=(0,d.useMemo)((function(){return(0,je.YC)((null===Ge||void 0===Ge?void 0:Ge.tags)||[],(function(e){return e.uuid}))}),[Ge]),Ye=pe.ZP.pipeline_interactions.detail(V&&l,{filter_for_permissions:1}).data,Xe=pe.ZP.interactions.pipeline_interactions.list(V&&l).data,ze=pe.ZP.pipelines.detail(V&&l).data,qe=(0,d.useMemo)((function(){return(null===Ye||void 0===Ye?void 0:Ye.pipeline_interaction)||{}}),[Ye]),Qe=((0,d.useMemo)((function(){return(null===Xe||void 0===Xe?void 0:Xe.interactions)||[]}),[Xe]),(0,d.useMemo)((function(){var e;return V&&(null===(e=Object.keys((null===qe||void 0===qe?void 0:qe.blocks)||{}))||void 0===e?void 0:e.length)>=1}),[V,qe])),We=(0,d.useMemo)((function(){return Qe&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(ge.lZ,{}),(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(h.ZP,Ie(Ie({},he.B),{},{Icon:L.Interactions,inline:!0,onClick:function(){return E(!0)},uuid:"Create trigger with no-code",children:"Create trigger with no-code"}))]})}),[Qe,E]),Je=(0,d.useMemo)((function(){return(0,A.jsx)(de.Z,{addButtonProps:!U&&{isLoading:te,label:"New trigger",onClick:function(){return re({pipeline_schedule:{name:(0,D.Y6)()}})}},filterOptions:{frequency:Object.values(b.U5),status:Object.values(b.fq),tag:Le.map((function(e){return e.uuid})),type:Object.values(b.Xm)},filterValueLabelMapping:{status:Object.values(b.fq).reduce((function(e,n){return Ie(Ie({},e),{},(0,o.Z)({},n,(0,D.kC)(n)))}),{}),tag:Le.reduce((function(e,n){var r=n.uuid;return Ie(Ie({},e),{},(0,o.Z)({},r,r))}),{}),type:b.Z4},onClickFilterDefaults:function(){r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers"))},query:X,resetPageOnFilterApply:!0,secondaryButtonProps:!U&&{beforeIcon:(0,A.jsx)(L.Once,{size:fe.bL}),disabled:t,isLoading:ke,label:"Run@once",onClick:Re,tooltip:"Creates an @once trigger and runs pipeline immediately"},showDivider:!U,children:We})}),[re,U,te,ke,t,We,l,r,Re,Le]),Ke=(0,d.useMemo)((function(){var e=[];return k?e.push.apply(e,[{label:function(){return"Triggers"},onClick:function(){return E(!1)}},{bold:!0,label:function(){return"New trigger"}}]):e.push({label:function(){return"Triggers"}}),e}),[k,E]);return k?(0,A.jsx)(ae.Z,{creatingWithLimitation:!0,errors:y,onCancel:function(){return E(!1)},pipeline:null===ze||void 0===ze?void 0:ze.pipeline,setErrors:O,useCreateScheduleMutation:$}):(0,A.jsx)(x.Z,{breadcrumbs:Ke,buildSidekick:!k&&Ve,errors:y||P,pageName:ve.M.TRIGGERS,pipeline:c,setErrors:O,subheader:!k&&Je,title:function(e){var n=e.name;return"".concat(n," triggers")},uuid:"".concat(ve.M.TRIGGERS,"_").concat(l),children:!k&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(v.Z,{light:!0}),W?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(se.Z,{fetchPipelineSchedules:J,pipeline:c,pipelineSchedules:K,pipelineTriggersByName:He,selectedSchedule:De,setErrors:O,setSelectedSchedule:Ae}),(0,A.jsx)(C.Z,{p:2,children:(0,A.jsx)(m.ZP,{maxPages:9,onUpdate:function(e){var n=Number(e),t=Ie(Ie({},Y),{},{page:n>=0?n:0});r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers?").concat((0,xe.uM)(t)))},page:Number(q),totalPages:Math.ceil(Ue/m.Q)})})]}):(0,A.jsx)(C.Z,{m:2,children:(0,A.jsx)(ce.Z,{inverted:!0,large:!0})})]})})}ke.getInitialProps=function(){var e=(0,t.Z)(u().mark((function e(n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Ce=(0,j.Z)(ke)},40183:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers",function(){return r(38415)}])}},function(e){e.O(0,[9161,7674,26,1557,3782,5544,9624,2717,9774,2888,179],(function(){return n=40183,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4249],{16488:function(e,n,r){"use strict";r.d(n,{IJ:function(){return h},M8:function(){return P},Uc:function(){return j},XM:function(){return Z},_U:function(){return v},eI:function(){return b},gU:function(){return y},lO:function(){return S},ri:function(){return m},tL:function(){return w},vJ:function(){return O},xH:function(){return x}});var t,i=r(82394),o=r(92083),l=r.n(o),u=r(3917),c=r(4383),a=r(30229),d=r(42122),s=r(86735);function p(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function f(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){(0,i.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var v=function(e){return!!e&&!Object.values(a.U5).includes(e)};function h(e){return null===e||void 0===e?void 0:e.reduce((function(e,n){var r=n.block_uuid,t=n.completed_at,o=n.started_at,u=n.status,c=null;o&&t&&(c=l()(t).valueOf()-l()(o).valueOf());return f(f({},e),{},(0,i.Z)({},r,{runtime:c,status:u}))}),{})}var g,m=function(e){var n=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:a.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:a.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:a.Xm.API}];return e?n.slice(0,1):n};function x(e){var n=(0,d.gR)(e,[a.gm.INTERVAL,a.gm.TYPE]),r=e[a.gm.INTERVAL];r&&(n["schedule_interval[]"]=encodeURIComponent(r));var t=e[a.gm.TYPE];return t&&(n["schedule_type[]"]=t),n}function b(e){return e?new Date(l()(e).valueOf()):null}function j(e,n){return n?(0,u.XG)(e,n):function(e){if("string"!==typeof e)return e;var n=e.split("+")[0];return l()(b(n)).format(u.Nx)}(e)}!function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second"}(g||(g={}));var w=(t={},(0,i.Z)(t,g.DAY,86400),(0,i.Z)(t,g.HOUR,3600),(0,i.Z)(t,g.MINUTE,60),(0,i.Z)(t,g.SECOND,1),t);function y(e){var n=g.SECOND,r=e;return e%86400===0?(r/=86400,n=g.DAY):e%3600===0?(r/=3600,n=g.HOUR):e%60===0&&(r/=60,n=g.MINUTE),{time:r,unit:n}}function O(e,n){return e*w[n]}function Z(e,n,r){var t,i=l()(e);return i.set("hour",+(null===n||void 0===n?void 0:n.hour)||0),i.set("minute",+(null===n||void 0===n?void 0:n.minute)||0),i.set("second",0),t=i.format(u.TD),null!==r&&void 0!==r&&r.includeSeconds&&(t=t.concat(":00")),null!==r&&void 0!==r&&r.localTimezone&&(t=i.format(u.lE),null!==r&&void 0!==r&&r.convertToUtc&&(t=(0,u.d$)(t,{includeSeconds:null===r||void 0===r?void 0:r.includeSeconds,utcFormat:!0}))),t}function P(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",t=!0;if(t){var i=(0,c.XF)();n?r="".concat(i,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/api_trigger"):(r="".concat(i,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/pipeline_runs"),null!==e&&void 0!==e&&e.token&&(r="".concat(r,"/").concat(e.token)))}return r}function _(e,n,r){return e.match(/[*,-/]/)?{additionalOffset:0,cronValue:e}:function(e,n,r){var t=r.indexOf(e),i=0;if(n<0)for(var o=0;o>n;o--)0===t?(t=r.length-1,i-=1):t-=1;else if(n>0)for(var l=0;l<n;l++)t===r.length-1?(t=0,i+=1):t+=1;var u="number"===typeof r[t]?r[t]:e;return{additionalOffset:i,cronValue:String(u)}}(+e,n,r)}var I=(0,s.m5)(60),k=(0,s.m5)(24),C=(0,u.Cs)();function S(e,n){if(!e)return e;var r=l()().local().format("Z"),t=r.split(":"),i="-"===r[0],o=3===t[0].length?Number(t[0].slice(1)):Number(t[0]),u=Number(t[1]);(i&&!n||!i&&n)&&(o=-o,u=-u);var c=e.split(" "),a=c[0],d=c[1],s=c[2],p=_(a,u,I),f=_(d,o+p.additionalOffset,k);if(c[0]=p.cronValue,c[1]=f.cronValue,0!==(null===f||void 0===f?void 0:f.additionalOffset)){var v=_(s,f.additionalOffset,C);c[2]=v.cronValue}return c.join(" ")}},38415:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return Ce}});var t=r(77837),i=r(75582),o=r(82394),l=r(38860),u=r.n(l),c=r(12691),a=r.n(c),d=r(82684),s=r(69864),p=r(34376),f=r(24138),v=r(15338),h=r(68562),g=r(48670),m=r(55072),x=r(75457),b=r(30229),j=r(93808),w=r(82359),y=r(71610),O=r(71180),Z=r(90299),P=r(55485),_=r(85854),I=r(37899),k=r(65956),C=r(38276),S=r(30160),E=r(44897),T=r(70515),M={uuid:"RUNTIME VARIABLES"},R={uuid:"BOOKMARK VALUES"},N=r(32080),B=r(8916),D=r(81728),A=r(28598);function V(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function U(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?V(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var F="".concat(T.iI,"px ").concat(3*T.iI,"px");var H=function(e){var n=e.initialPipelineSchedulePayload,r=e.onCancel,t=e.onSuccess,i=e.pipeline,l=e.variables,u=(0,d.useState)(null),c=u[0],a=u[1],s=(0,d.useState)(!0),p=s[0],f=s[1],h=(0,d.useState)(l||{}),g=h[0],m=h[1],x=(0,d.useState)(null),j=x[0],w=x[1],V=(0,d.useMemo)((function(){return U(U({},n),{},{name:(0,D.Y6)(),variables:p?(0,B.e7)(U(U({},g),c?(0,o.Z)({},b.PN,c):{})):null})}),[c,n,p,g]),H=(0,d.useMemo)((function(){return null!==i&&void 0!==i&&i.blocks?(0,N.n)(i):null}),[i]),G=(0,d.useMemo)((function(){var e;return H&&(null===(e=Object.keys(H||{}))||void 0===e?void 0:e.length)>=1?[M,R]:null}),[H]);(0,d.useEffect)((function(){(null===G||void 0===G?void 0:G.length)>=1&&!j&&w(null===G||void 0===G?void 0:G[0])}),[j,w,G]);var L=(0,d.useMemo)((function(){return null!==G&&void 0!==G&&G.length?(0,A.jsx)(Z.Z,{onClickTab:function(e){w(e)},selectedTabUUID:null===j||void 0===j?void 0:j.uuid,tabs:G,underlineStyle:!0}):null}),[j,w,G]);return(0,A.jsxs)(k.Z,{noPadding:!0,footer:(0,A.jsxs)(P.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,A.jsx)(O.ZP,{onClick:function(){t({pipeline_schedule:V}),r()},padding:F,primaryAlternate:!0,children:"Run now"}),(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(O.ZP,{borderColor:E.Z.background.page,onClick:r,padding:F,secondary:!0,children:"Cancel"})]}),header:(0,A.jsx)(_.Z,{level:5,children:"Run pipeline now"}),maxHeight:"90vh",minWidth:85*T.iI,subtitle:(0,A.jsxs)(A.Fragment,{children:[!(null!==G&&void 0!==G&&G.length)&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(null===G||void 0===G?void 0:G.length)>=1&&L,(0,A.jsx)(v.Z,{light:!0})]}),children:[(!(null!==G&&void 0!==G&&G.length)||M.uuid===(null===j||void 0===j?void 0:j.uuid))&&(0,A.jsxs)(A.Fragment,{children:[(null===G||void 0===G?void 0:G.length)>=1&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(0,A.jsx)(I.Z,{enableVariablesOverwrite:p,originalVariables:l,runtimeVariables:g,setEnableVariablesOverwrite:f,setRuntimeVariables:m})]}),R.uuid===(null===j||void 0===j?void 0:j.uuid)&&(0,A.jsx)(y.Z,{bookmarkValues:c,pipeline:i,setBookmarkValues:a})]})},G=r(97618),L=r(72473),Y=r(25976),X=r(42631),z=r(47041),q=r(91437),Q=Y.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-pu8csx-0"})([""," overflow-y:auto;position:relative;width:100%;z-index:3;border-radius:","px;"," "," "," ",""],z.w5,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.flex&&"\n flex: 1;\n "}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),W=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderRowStyle",componentId:"sc-pu8csx-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;position:sticky;top:0;width:100%;z-index:2;"," "," ",""],X.n_,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).panel,";\n ")}),(function(e){return!e.noBorder&&"\n border: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),J=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderCellStyle",componentId:"sc-pu8csx-2"})([""," ",""],(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),K=Y.default.div.withConfig({displayName:"indexstyle__RowTitleStyle",componentId:"sc-pu8csx-3"})([""," "," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).header,";\n border: 1px solid ").concat((e.theme.interative||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),$=Y.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-pu8csx-4"})([""," "," "," ",""],(0,q.eR)(),(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n border-top: none;\n border-bottom: none;\n ")}),(function(e){return!e.noBorder&&"\n border-bottom: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.finalRow&&!e.noBorderRadius&&"\n border-bottom-left-radius: ".concat(X.n_,"px;\n border-bottom-right-radius: ").concat(X.n_,"px;\n ")})),ee=Y.default.div.withConfig({displayName:"indexstyle__TextStyle",componentId:"sc-pu8csx-5"})(["p{cursor:pointer;}"]),ne=Y.default.div.withConfig({displayName:"indexstyle__RowCellStyle",componentId:"sc-pu8csx-6"})(["width:100%;z-index:0;"," "," "," "," ",""],(function(e){return!e.first&&"\n border-left: 1px solid ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.textColor&&"\n & p {\n color: ".concat(e.textColor,";\n }\n ")}),(function(e){return e.vanish&&"\n border: none;\n padding: 0 !important;\n width: 0% !important;\n height: 100% !important;\n background-color: ".concat((e.theme.background||E.Z.background).page," !important;\n ")})),re=r(35185);var te=function(e){var n,r=e.cellIndex,t=e.danger,i=e.flex,o=e.render,l=e.rowGroupIndex,u=e.rowIndex,c=e.selected,a=e.small,s=e.showBackground,p=e.showProgress,f=e.textColor,v=e.value,h=e.vanish,m=(0,d.useState)(!1),x=m[0],b=m[1],j=Array.isArray(v);return n=o?o(v):"function"===typeof v?v({selected:c}):j?(0,A.jsxs)(G.Z,{alignItems:"start",flexDirection:"row",justifyContent:"space-between",children:[(0,A.jsxs)(S.ZP,{small:a,textOverflow:!0,title:v[0],children:[x&&(0,A.jsx)(A.Fragment,{children:"".concat(v[0]," & ").concat(v.length-1," more")}),!x&&(0,A.jsx)(A.Fragment,{children:v.map((function(e){return(0,A.jsx)("div",{children:e},e)}))})]}),(0,A.jsxs)(g.Z,{onClick:function(){return b(!x)},children:[x&&(0,A.jsx)(L.ArrowDown,{muted:!0,size:2*T.iI}),!x&&(0,A.jsx)(L.ArrowRight,{muted:!0,size:2*T.iI})]})]}):p?(0,A.jsx)(P.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:(0,A.jsx)(re.Z,{danger:v<80,progress:v})}):(0,A.jsx)(S.ZP,{bold:t,danger:t,small:a,textOverflow:!0,title:v,children:v}),(0,A.jsx)(G.Z,{flex:i,textOverflow:!0,children:(0,A.jsx)(ne,{first:0===r,showBackground:s,small:a,textColor:f,vanish:h,children:!h&&(0,A.jsxs)(A.Fragment,{children:[n," "]})})},"cell-".concat(l,"-").concat(u,"-").concat(r,"-").concat(v))};var ie=function(e){var n=e.columnFlexNumbers,r=e.columnHeaders,t=e.height,i=e.isTextSelectionRequired,o=e.noBorder,l=e.noBorderRadius,u=e.onClickRow,c=e.onHoverRow,a=e.renderRowCellByIndex,s=e.rowGroupData,p=void 0===s?[]:s,f=e.selectedRowIndexes,v=e.small,h=e.flex,m=e.warnings,x=void 0===m?[]:m,b=(0,d.useMemo)((function(){return p.length}),[p]);return(0,A.jsxs)(Q,{flex:h,height:t,noBorder:o,noBorderRadius:l,noScrollbarTrackBackground:!0,children:[(0,A.jsx)(W,{noBorder:o,noBorderRadius:l,children:(0,A.jsx)(P.ZP,{alignItems:"center",children:r.map((function(e,r){var t=e.Icon,i=e.label;return(0,A.jsx)(G.Z,{flex:n[r],children:(0,A.jsx)(J,{first:0===r,small:v,children:(0,A.jsxs)(P.ZP,{alignItems:"center",children:[t&&(0,A.jsx)(L.Check,{}),t&&(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(S.ZP,{bold:!0,children:i})]})})},i)}))})}),p&&p.map((function(e,r){var t,d=e.title,s=e.rowData,p=d||r,h=[];d&&(t=(0,A.jsx)(K,{small:v,children:(0,A.jsx)(S.ZP,{bold:!0,children:d})}));var m=null===s||void 0===s?void 0:s.length;return null===s||void 0===s||s.forEach((function(e,t){var d=e.columnTextColors,s=e.columnValues,j=e.danger,w=e.uuid,y=(null===f||void 0===f?void 0:f[0])===r&&(null===f||void 0===f?void 0:f[1])===t,O=[],Z=x.find((function(e){return e.name===s[0]})),_=Z&&(0,D.HD)(s[1])?(0,D.Tz)(s[1]):s[1],I=Z&&Z.compare(_,Z.val);null===s||void 0===s||s.forEach((function(e,i,o){var l=null===a||void 0===a?void 0:a[i],u=d?d[i]:void 0;Array.isArray(e)?O.push((0,A.jsx)(te,{cellIndex:i,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,showProgress:e[0],small:v,textColor:u,value:e[1]},i)):"undefined"===typeof e?(O.pop(),i=o.length+1,O.push((0,A.jsx)(te,{cellIndex:i,danger:j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e,vanish:!0},i))):O.push((0,A.jsx)(te,{cellIndex:i,danger:I||j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e},i))}));var k=(0,A.jsx)(P.ZP,{textOverflow:!0,children:O});h.push((0,A.jsxs)($,{finalRow:b-1===r&&m-1===t,hasHover:!!c,noBorder:o,noBorderRadius:l,onMouseEnter:function(){return null===c||void 0===c?void 0:c({rowGroupIndex:r,rowIndex:t,uuid:w})},selected:y,children:[u&&(i?(0,A.jsx)(ee,{onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},role:"cell",children:k}):(0,A.jsx)(g.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},preventDefault:!0,children:k})),!u&&k]},"row-group-".concat(p,"-row-").concat(t)))})),(0,A.jsxs)("div",{children:[t,h]},p)}))]})},oe=Y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1xgfh62-0"})(["display:flex;flex-direction:column;height:","px;border-bottom:1px solid ",";"," "," ",""],(function(e){return e.height}),E.Z.borders.medium,(function(e){return e.includePadding&&"\n padding: ".concat(T.tr,"px;\n ")}),(function(e){return e.overflow&&"\n overflow: auto;\n "}),z.w5),le=r(79633);var ue=function(e){var n=e.height,r=e.scheduleType,t=e.variables,o=e.variablesOverride,l=[];Object.entries(t).forEach((function(e){var n=(0,i.Z)(e,2),r=n[0],t=n[1],u=null===o||void 0===o?void 0:o[r];l.push({uuid:r,value:(0,B.FS)(u||t)})})),(0,B.JZ)(l,r);var u=Object.keys(t).length;return(0,A.jsx)(oe,{height:n,children:t&&(0,A.jsx)(ie,{columnFlexNumbers:[1,1],columnHeaders:[{label:"Runtime variable (".concat(u,")")},{label:"Value"}],noBorderRadius:!0,rowGroupData:[{rowData:l.map((function(e){var n=e.uuid,r=e.value;return{columnTextColors:[le.Or,void 0],columnValues:[n,r],uuid:n}}))}],small:!0})})},ce=r(4190),ae=r(12717),de=r(85544),se=r(29624),pe=r(35686),fe=r(72191),ve=r(28795),he=r(81066),ge=r(24944),me=r(3917),xe=r(69419),be=r(16488),je=r(86735),we=r(42122),ye=r(50178),Oe=r(72619),Ze=r(70320),Pe=r(89538);function _e(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function Ie(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function ke(e){var n=e.pipeline,r=(0,p.useRouter)(),t=(0,ye.Ct)(),l=n.uuid,u=pe.ZP.pipelines.detail(l,{includes_outputs:!1},{revalidateOnFocus:!1}).data,c=(0,d.useMemo)((function(){return(null===u||void 0===u?void 0:u.pipeline)||n}),[null===u||void 0===u?void 0:u.pipeline,n]),j=(0,d.useState)(null),y=j[0],O=j[1],Z=(0,d.useState)(null),P=Z[0],_=Z[1],I=(0,d.useState)(!1),k=I[0],E=I[1],T=pe.ZP.projects.list().data,M=(0,d.useMemo)((function(){var e;return null===T||void 0===T||null===(e=T.projects)||void 0===e?void 0:e[0]}),[T]),R=((0,d.useMemo)((function(){var e;return(0,Ze.hY)(null===M||void 0===M||null===(e=M.features)||void 0===e?void 0:e[w.d.LOCAL_TIMEZONE])}),[null===M||void 0===M?void 0:M.features]),pe.ZP.client_pages.detail("pipeline_schedule:create",{"pipelines[]":[l]},{},{key:"Triggers/Edit/".concat(l)}).data),N=(0,d.useMemo)((function(){return null===R||void 0===R?void 0:R.client_page}),[R]),V=(0,d.useMemo)((function(){var e,n;return null===N||void 0===N||null===(e=N.components)||void 0===e||null===(n=e.find((function(e){return"create_with_interactions_component"===e.uuid})))||void 0===n?void 0:n.enabled}),[N]),U=(0,d.useMemo)((function(){return null===N||void 0===N?void 0:N.disabled}),[N]),F=pe.ZP.variables.pipelines.list(l,{global_only:!0},{revalidateOnFocus:!1}).data,G=null===F||void 0===F?void 0:F.variables,Y=(0,xe.iV)(),X=(0,d.useMemo)((function(){return(0,xe.DQ)(Y,[b.gm.INTERVAL,b.gm.STATUS,b.gm.TAG,b.gm.TYPE])}),[Y]),z=(0,be.xH)(X),q=null!==Y&&void 0!==Y&&Y.page?Y.page:0,Q=pe.ZP.pipeline_schedules.pipelines.list(l,Ie(Ie({},z),{},{_limit:m.Q,_offset:(null!==Y&&void 0!==Y&&Y.page?Y.page:0)*m.Q}),{refreshInterval:7500}),W=Q.data,J=Q.mutate,K=(0,d.useMemo)((function(){return(null===W||void 0===W?void 0:W.pipeline_schedules)||[]}),[W]),$=function(e){return(0,s.Db)(pe.ZP.pipeline_schedules.pipelines.useCreate(l),{onSuccess:function(n){return(0,Oe.wD)(n,{callback:function(n){var r=n.pipeline_schedule.id;null===e||void 0===e||e(r)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}})},ee=$((function(e){return r.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(null===c||void 0===c?void 0:c.uuid,"/triggers/").concat(e,"/edit"))})),ne=(0,i.Z)(ee,2),re=ne[0],te=ne[1].isLoading,ie=$(J),le=(0,i.Z)(ie,2),_e=le[0],ke=le[1].isLoading,Ce=(0,d.useMemo)((function(){return(0,B.Tt)(G)}),[G]),Se=(0,D.Y6)(),Ee=(0,d.useMemo)((function(){return{name:Se,schedule_interval:b.U5.ONCE,schedule_type:b.Xm.TIME,start_time:(0,me.d$)((new Date).toISOString(),{dayAgo:!0,utcFormat:!0}),status:b.fq.ACTIVE}}),[Se]),Te=(0,Pe.dd)((function(){return(0,A.jsx)(H,{initialPipelineSchedulePayload:Ee,onCancel:Ne,onSuccess:_e,pipeline:c,variables:Ce})}),{},[G,c,Ce],{background:!0,uuid:"run_pipeline_now_popup"}),Me=(0,i.Z)(Te,2),Re=Me[0],Ne=Me[1],Be=(0,d.useState)(),De=Be[0],Ae=Be[1],Ve=(0,d.useMemo)((function(){var e=null===De||void 0===De?void 0:De.variables,n=!(0,we.Qr)(Ce);return function(r){var i=80;if(n){var o=Object.keys(Ce).length;i=46+43*Math.min(5,o)+1}var u=r.height-i;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(f.ZP,Ie(Ie({},r),{},{enablePorts:!1,height:u,noStatus:!0})),n&&(0,A.jsx)(ue,{height:i+1,scheduleType:null===De||void 0===De?void 0:De.schedule_type,variables:Ce,variablesOverride:e}),!n&&(0,A.jsxs)(oe,{height:i+1,includePadding:!0,overflow:!0,children:[(0,A.jsx)(S.ZP,{children:"This pipeline has no runtime variables."}),!t&&(0,A.jsxs)(C.Z,{mt:1,children:[(0,A.jsx)(a(),{as:"/pipelines/".concat(l,"/edit?sideview=variables"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,A.jsx)(g.Z,{primary:!0,children:"Click here"})})," ",(0,A.jsx)(S.ZP,{inline:!0,children:"to add variables to this pipeline."})]})]})]})}}),[t,l,null===De||void 0===De?void 0:De.schedule_type,null===De||void 0===De?void 0:De.variables,Ce]),Ue=(0,d.useMemo)((function(){var e;return(null===W||void 0===W||null===(e=W.metadata)||void 0===e?void 0:e.count)||[]}),[W]),Fe=pe.ZP.pipeline_triggers.pipelines.list(l).data,He=(0,d.useMemo)((function(){return(0,je.HK)((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[],(function(e){return e.name}))}),[Fe]);(0,d.useEffect)((function(){var e=((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[]).find((function(e){var n=e.settings;return null===n||void 0===n?void 0:n.invalid_schedule_interval}));_(e?{displayMessage:'Schedule interval for Trigger (in code) "'.concat(null===e||void 0===e?void 0:e.name,'"')+" is invalid. Please check your cron expression\u2019s syntax in the pipeline\u2019s triggers.yaml file."}:null)}),[null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers]);var Ge=pe.ZP.tags.list().data,Le=(0,d.useMemo)((function(){return(0,je.YC)((null===Ge||void 0===Ge?void 0:Ge.tags)||[],(function(e){return e.uuid}))}),[Ge]),Ye=pe.ZP.pipeline_interactions.detail(V&&l,{filter_for_permissions:1}).data,Xe=pe.ZP.interactions.pipeline_interactions.list(V&&l).data,ze=pe.ZP.pipelines.detail(V&&l).data,qe=(0,d.useMemo)((function(){return(null===Ye||void 0===Ye?void 0:Ye.pipeline_interaction)||{}}),[Ye]),Qe=((0,d.useMemo)((function(){return(null===Xe||void 0===Xe?void 0:Xe.interactions)||[]}),[Xe]),(0,d.useMemo)((function(){var e;return V&&(null===(e=Object.keys((null===qe||void 0===qe?void 0:qe.blocks)||{}))||void 0===e?void 0:e.length)>=1}),[V,qe])),We=(0,d.useMemo)((function(){return Qe&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(ge.lZ,{}),(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(h.ZP,Ie(Ie({},he.B),{},{Icon:L.Interactions,inline:!0,onClick:function(){return E(!0)},uuid:"Create trigger with no-code",children:"Create trigger with no-code"}))]})}),[Qe,E]),Je=(0,d.useMemo)((function(){return(0,A.jsx)(de.Z,{addButtonProps:!U&&{isLoading:te,label:"New trigger",onClick:function(){return re({pipeline_schedule:{name:(0,D.Y6)()}})}},filterOptions:{frequency:Object.values(b.U5),status:Object.values(b.fq),tag:Le.map((function(e){return e.uuid})),type:Object.values(b.Xm)},filterValueLabelMapping:{status:Object.values(b.fq).reduce((function(e,n){return Ie(Ie({},e),{},(0,o.Z)({},n,(0,D.kC)(n)))}),{}),tag:Le.reduce((function(e,n){var r=n.uuid;return Ie(Ie({},e),{},(0,o.Z)({},r,r))}),{}),type:b.Z4},onClickFilterDefaults:function(){r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers"))},query:X,resetPageOnFilterApply:!0,secondaryButtonProps:!U&&{beforeIcon:(0,A.jsx)(L.Once,{size:fe.bL}),disabled:t,isLoading:ke,label:"Run@once",onClick:Re,tooltip:"Creates an @once trigger and runs pipeline immediately"},showDivider:!U,children:We})}),[re,U,te,ke,t,We,l,r,Re,Le]),Ke=(0,d.useMemo)((function(){var e=[];return k?e.push.apply(e,[{label:function(){return"Triggers"},onClick:function(){return E(!1)}},{bold:!0,label:function(){return"New trigger"}}]):e.push({label:function(){return"Triggers"}}),e}),[k,E]);return k?(0,A.jsx)(ae.Z,{creatingWithLimitation:!0,errors:y,onCancel:function(){return E(!1)},pipeline:null===ze||void 0===ze?void 0:ze.pipeline,setErrors:O,useCreateScheduleMutation:$}):(0,A.jsx)(x.Z,{breadcrumbs:Ke,buildSidekick:!k&&Ve,errors:y||P,pageName:ve.M.TRIGGERS,pipeline:c,setErrors:O,subheader:!k&&Je,title:function(e){var n=e.name;return"".concat(n," triggers")},uuid:"".concat(ve.M.TRIGGERS,"_").concat(l),children:!k&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(v.Z,{light:!0}),W?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(se.Z,{fetchPipelineSchedules:J,includeCreatedAtColumn:!0,pipeline:c,pipelineSchedules:K,pipelineTriggersByName:He,selectedSchedule:De,setErrors:O,setSelectedSchedule:Ae}),(0,A.jsx)(C.Z,{p:2,children:(0,A.jsx)(m.ZP,{maxPages:9,onUpdate:function(e){var n=Number(e),t=Ie(Ie({},Y),{},{page:n>=0?n:0});r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers?").concat((0,xe.uM)(t)))},page:Number(q),totalPages:Math.ceil(Ue/m.Q)})})]}):(0,A.jsx)(C.Z,{m:2,children:(0,A.jsx)(ce.Z,{inverted:!0,large:!0})})]})})}ke.getInitialProps=function(){var e=(0,t.Z)(u().mark((function e(n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Ce=(0,j.Z)(ke)},40183:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers",function(){return r(38415)}])}},function(e){e.O(0,[9161,7674,26,1557,3782,5544,9624,2717,9774,2888,179],(function(){return n=40183,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|
|
@@ -0,0 +1 @@
|
|
|
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),h=n(88543),v=n(38276),g=n(30160),m=n(17488),Z=n(69650),x=n(12468),b=n(35686),y=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),N=n(42122),I=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,y.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)(b.ZP.projects.useUpdate(ne),{onSuccess:function(e){return(0,I.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)(v.Z,{p:w.cd,children:[(0,A.jsx)(v.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)(v.Z,{p:w.cd,children:[(0,A.jsx)(v.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)(v.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)(v.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)(v.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)(v.Z,{mt:w.HN}),(0,A.jsx)(h.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,A.jsx)(h.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)(v.Z,{mt:w.HN}),(0,A.jsx)(j.Z,{noPadding:!0,overflowVisible:!0,children:(0,A.jsxs)(v.Z,{p:w.cd,children:[(0,A.jsx)(v.Z,{mb:1,children:(0,A.jsxs)(a.Z,{level:5,children:["Features\xa0",(0,A.jsx)(p.Z,{bold:!0,href:"https://docs.mage.ai/development/project/features",largeSm:!0,openNewWindow:!0,children:"(docs)"})]})}),Object.entries((0,N.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)(v.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)(v.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)(v.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)(v.Z,{mt:w.HN}),(0,A.jsx)(j.Z,{noPadding:!0,children:(0,A.jsxs)(v.Z,{p:w.cd,children:[(0,A.jsx)(v.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)(v.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)(v.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 h(){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})})})})})}h.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)(h)},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}]);
|
|
@@ -0,0 +1 @@
|
|
|
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),h=t(88543),v=t(38276),g=t(30160),m=t(17488),Z=t(69650),x=t(12468),b=t(35686),y=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,W=e.rootProject,B=(0,L.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),F=(0,i.Z)(B,1)[0],U=(0,o.useState)(null),V=U[0],X=U[1],Y=(0,o.useState)(!1),q=Y[0],z=Y[1],G=(0,y.Z)(),K=G.fetchProjects,J=G.project,Q=G.projectPlatformActivated,$=G.rootProject,ee=(0,o.useMemo)((function(){return W?$:J}),[J,$,W]),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(){V||X(ee)}),[ee,V]);var ce=(0,c.Db)(b.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 F({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:W})})}),[W,se]),ae=(0,H.jsxs)(H.Fragment,{children:[A,(0,H.jsxs)(j.Z,{noPadding:!0,children:[(0,H.jsxs)(v.Z,{p:w.cd,children:[(0,H.jsx)(v.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)(v.Z,{p:w.cd,children:[(0,H.jsx)(v.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)(v.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)(v.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)(v.Z,{mr:w.cd}),(0,H.jsx)(Z.Z,{checked:null===V||void 0===V?void 0:V.help_improve_mage,compact:!0,id:"help_improve_mage_toggle",onCheck:function(){return X((function(e){return M(M({},e),{},{help_improve_mage:!(null!==V&&void 0!==V&&V.help_improve_mage)})}))}})]})})]}),(0,H.jsx)(v.Z,{mt:w.HN}),(0,H.jsx)(h.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,H.jsx)(h.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===V||void 0===V||null===(n=V.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)(v.Z,{mt:w.HN}),(0,H.jsx)(j.Z,{noPadding:!0,overflowVisible:!0,children:(0,H.jsxs)(v.Z,{p:w.cd,children:[(0,H.jsx)(v.Z,{mb:1,children:(0,H.jsxs)(a.Z,{level:5,children:["Features\xa0",(0,H.jsx)(p.Z,{bold:!0,href:"https://docs.mage.ai/development/project/features",largeSm:!0,openNewWindow:!0,children:"(docs)"})]})}),Object.entries((0,I.gR)(null===V||void 0===V?void 0:V.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&&!W&&(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)(v.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===V||void 0===V?void 0:V.features),{},(0,r.Z)({},o,!c))})}))}}),(0,H.jsx)(v.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)(v.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)(v.Z,{mt:w.HN}),(0,H.jsx)(j.Z,{noPadding:!0,children:(0,H.jsxs)(v.Z,{p:w.cd,children:[(0,H.jsx)(v.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===V||void 0===V?void 0:V.openai_api_key)||""})]})}),(0,H.jsx)(v.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===V||void 0===V?void 0:V.features,help_improve_mage:null===V||void 0===V?void 0:V.help_improve_mage,openai_api_key:null===V||void 0===V?void 0:V.openai_api_key,pipelines:null===V||void 0===V?void 0:V.pipelines};!0===(null===ee||void 0===ee?void 0:ee.help_improve_mage)&&!1===(null===V||void 0===V?void 0:V.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)(v.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 h(){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,{})})})})})}h.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)(h)},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}]);
|
|
@@ -0,0 +1 @@
|
|
|
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 z}});var i,r=t(77837),s=t(82394),o=t(75582),l=t(38860),u=t.n(l),c=t(82684),a=t(12691),d=t.n(a),h=t(21764),p=t(69864),m=t(71180),y=t(90299),b=t(70652),f=t(50724),v=t(15338),j=t(1402),x=t(55485),Z=t(85854),_=t(48670),g=t(93808),w=t(44085),k=t(28274),O=t(38276);!function(e){e.SSH="ssh",e.HTTPS="https"}(i||(i={}));var P=[{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"}],C=[{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"}],S=[{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"}],T=[{autoComplete:"branch",label:"Branch name",required:!0,uuid:"branch"}],M=t(30160),I=t(17488),q=t(35686),A=t(70515),E=t(24755),G=t(15610),N=t(72619),H=t(69419),D=t(28598);function R(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function B(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?R(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):R(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var W={label:function(){return"One-way Git Sync"},uuid:"git_sync"},F={label:function(){return"Git Actions"},uuid:"git_integration"},U=[W,F];function L(){var e=q.ZP.syncs.list().data,n=(0,c.useState)(null),t=n[0],r=n[1],l=(0,c.useState)(null),u=l[0],a=l[1],g=(0,c.useState)(null),R=g[0],L=g[1];(0,c.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),r(t)}}),[e]);var z=(0,c.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]),X=q.ZP.git_branches.detail("test",{_format:"with_basic_details"},{revalidateOnFocus:!1}),V=X.data,Y=(X.mutate,(0,c.useMemo)((function(){return(null===V||void 0===V?void 0:V.git_branch)||{}}),[V]).is_git_integration_enabled),J=(0,p.Db)(q.ZP.syncs.useCreate(),{onSuccess:function(e){return(0,N.wD)(e,{callback:function(e){var n=e.sync;n&&(r(n),window.location.reload(),h.Am.success("Sync saved",{position:h.Am.POSITION.BOTTOM_RIGHT,toastId:"data_sync_success"}))},onErrorCallback:function(e,n){return L({errors:n,response:e})}})}}),K=(0,o.Z)(J,2),Q=K[0],$=K[1].isLoading,ee=(0,p.Db)(q.ZP.syncs.useUpdate("git"),{onSuccess:function(e){return(0,N.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 L({errors:n,response:e})}})}}),ne=(0,o.Z)(ee,2),te=ne[0],ie=ne[1].isLoading,re=(0,c.useMemo)((function(){return(null===t||void 0===t?void 0:t.auth_type)||i.SSH}),[null===t||void 0===t?void 0:t.auth_type]),se=(0,c.useMemo)((function(){return re===i.HTTPS?S:C}),[re]),oe=q.ZP.statuses.list().data,le=(0,c.useMemo)((function(){var e,n;return null===oe||void 0===oe||null===(e=oe.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.require_user_authentication}),[oe]),ue=(0,c.useMemo)((function(){return U}),[]),ce=(0,c.useState)(),ae=ce[0],de=ce[1];(0,c.useEffect)((function(){ae||de(Y?F:W)}),[Y,ae]);var he=(0,c.useMemo)((function(){var e=r,n=t;return(null===ae||void 0===ae?void 0:ae.uuid)===F.uuid&&le&&(e=a,n=u),(0,D.jsx)("form",{children:se.map((function(t){var i,r,o=t.autoComplete,l=t.disabled,u=t.label,c=t.labelDescription,a=t.required,d=t.type,p=t.uuid;return r="ssh_public_key"===p?(0,D.jsx)(O.Z,{mb:1,children:(0,D.jsxs)(M.ZP,{small:!0,children:["Run ",(0,D.jsx)(_.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,D.jsx)(O.Z,{mb:1,children:(0,D.jsxs)(M.ZP,{small:!0,children:["Follow same steps as the public key, but run ",(0,D.jsx)(_.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."]})}):c&&(0,D.jsx)(O.Z,{mb:1,children:(0,D.jsx)(M.ZP,{small:!0,children:c})}),(0,D.jsxs)(O.Z,{mt:2,children:[r,(0,D.jsx)(I.Z,{autoComplete:o,disabled:l,label:u,onChange:function(n){e((function(e){return B(B({},e),{},(0,s.Z)({},p,n.target.value))}))},primary:!0,required:a,setContentOnMount:!0,type:d,value:(null===(i=n)||void 0===i?void 0:i[p])||""})]},p)}))})}),[se,le,ae,a,r,t,u]),pe=(0,H.iV)();(0,c.useEffect)((function(){null!==pe&&void 0!==pe&&pe.tab&&de(ue.find((function(e){return e.uuid===(null===pe||void 0===pe?void 0:pe.tab)})))}),[pe,ue]);var me=(0,c.useMemo)((function(){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(O.Z,{mt:A.Mq,children:[(0,D.jsxs)(M.ZP,{inline:!0,children:["To learn more about One-way git sync, click"," "]}),(0,D.jsx)(_.Z,{bold:!0,href:"https://docs.mage.ai/production/data-sync/git-sync",openNewWindow:!0,children:"here"})]}),(0,D.jsx)(O.Z,{mt:A.Mq,children:(0,D.jsx)(M.ZP,{bold:!0,children:"Sync with a specified branch. These settings will be saved at the project level."})}),(0,D.jsx)("form",{children:T.map((function(e){var n=e.autoComplete,i=e.disabled,o=e.label,l=e.required,u=e.type,c=e.uuid;return(0,D.jsx)(O.Z,{mt:2,children:(0,D.jsx)(I.Z,{autoComplete:n,disabled:i,label:o,onChange:function(e){r((function(n){return B(B({},n),{},(0,s.Z)({},c,e.target.value))}))},primary:!0,required:l,setContentOnMount:!0,type:u,value:(null===t||void 0===t?void 0:t[c])||""})},c)}))}),(0,D.jsx)(x.ZP,{alignItems:"center",children:(0,D.jsx)(O.Z,{mt:2,children:(0,D.jsx)(b.Z,{checked:null===t||void 0===t?void 0:t.sync_submodules,label:"Include submodules",onClick:function(){r((function(e){return B(B({},e),{},{sync_submodules:!(null!==t&&void 0!==t&&t.sync_submodules)})}))}})})}),(0,D.jsx)(O.Z,{mt:2,children:(0,D.jsx)(Z.Z,{level:5,children:"Additional sync settings"})}),(0,D.jsx)(x.ZP,{alignItems:"center",children:(0,D.jsx)(O.Z,{mt:2,children:(0,D.jsx)(b.Z,{checked:null===t||void 0===t?void 0:t.sync_on_pipeline_run,label:"Sync before each trigger run",onClick:function(){r((function(e){return B(B({},e),{},{sync_on_pipeline_run:!(null!==t&&void 0!==t&&t.sync_on_pipeline_run)})}))}})})}),(0,D.jsx)(x.ZP,{alignItems:"center",children:(0,D.jsx)(O.Z,{mt:2,children:(0,D.jsx)(b.Z,{checked:null===t||void 0===t?void 0:t.sync_on_start,label:"Sync on server start up",onClick:function(){r((function(e){return B(B({},e),{},{sync_on_start:!(null!==t&&void 0!==t&&t.sync_on_start)})}))}})})}),(0,D.jsx)(O.Z,{mt:A.Mq,children:(0,D.jsx)(M.ZP,{bold:!0,children:"Configure the Git authentication credentials that will be used to sync with the specified Git repository."})}),he]})}),[t,he]),ye=(0,c.useMemo)((function(){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(O.Z,{mt:A.Mq,children:[!Y&&(0,D.jsx)(O.Z,{mb:1,children:(0,D.jsx)(M.ZP,{bold:!0,warning:!0,children:"When One-way git sync is enabled, you will be unable to access the Git Actions modal. If you want to bypass this safeguard, set the GIT_ENABLE_GIT_INTEGRATION environment variable."})}),(0,D.jsxs)(M.ZP,{bold:!0,children:["We recommend using the ",(0,D.jsx)(d(),{as:"/version-control",href:"/version-control",children:(0,D.jsx)(_.Z,{bold:!0,inline:!0,children:"version control app"})})," unless you have a specific need to use the Git Actions modal."]})]}),(0,D.jsx)(O.Z,{mt:A.Mq,children:(0,D.jsx)(M.ZP,{children:"These fields are required to help Mage configure your Git settings. These settings will be specific to your user."})}),he]})}),[Y,he]);return(0,D.jsx)(k.Z,{uuidItemSelected:E.fF,uuidWorkspaceSelected:E.WH,children:(0,D.jsxs)(O.Z,{p:A.cd,style:{width:"600px"},children:[(0,D.jsx)(Z.Z,{children:"Git repository settings"}),(0,D.jsx)(O.Z,{mt:1,children:(0,D.jsx)(M.ZP,{bold:!0,children:"Authentication type"})}),(0,D.jsx)(O.Z,{mt:1,children:(0,D.jsx)(w.Z,{compact:!0,label:"Authentication type",onChange:function(e){var n=e.target.value;r((function(e){return B(B({},e),{},{auth_type:n})}))},value:re,children:Object.entries(i).map((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,D.jsx)("option",{value:i,children:t},i)}))})}),(0,D.jsx)(O.Z,{mt:A.Mq,children:re===i.SSH&&(0,D.jsxs)(M.ZP,{bold:!0,children:["You will need to ",(0,D.jsx)(_.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,D.jsx)("form",{children:P.map((function(e){var n=e.autoComplete,i=e.disabled,o=e.label,l=e.labelDescription,u=e.required,c=e.type,a=e.uuid;return(0,D.jsxs)(O.Z,{mt:2,children:[l&&(0,D.jsx)(O.Z,{mb:1,children:(0,D.jsx)(M.ZP,{small:!0,children:l})}),(0,D.jsx)(I.Z,{autoComplete:n,disabled:i,label:o,onChange:function(e){r((function(n){return B(B({},n),{},(0,s.Z)({},a,e.target.value))}))},primary:!0,required:u,setContentOnMount:!0,type:c,value:(null===t||void 0===t?void 0:t[a])||""})]},a)}))}),(0,D.jsx)(O.Z,{mt:A.Mq,children:(0,D.jsx)(v.Z,{light:!0})}),(0,D.jsx)(y.Z,{onClickTab:function(e){var n=e.uuid;(0,G.u)({tab:n})},selectedTabUUID:null===ae||void 0===ae?void 0:ae.uuid,tabs:ue,underlineStyle:!0}),(0,D.jsx)(v.Z,{light:!0}),(0,D.jsxs)(O.Z,{ml:2,children:[W.uuid===(null===ae||void 0===ae?void 0:ae.uuid)&&me,F.uuid===(null===ae||void 0===ae?void 0:ae.uuid)&&ye]}),(0,D.jsx)(O.Z,{mt:A.HN,children:(0,D.jsx)(m.ZP,{loading:$,onClick:function(){return Q({sync:B(B({},t),{},{user_git_settings:u})})},primary:!0,children:"Save repository settings"})}),R&&(0,D.jsx)(f.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===L||void 0===L?void 0:L(null)},children:(0,D.jsx)(j.Z,B(B({},R),{},{onClose:function(){return null===L||void 0===L?void 0:L(null)}}))}),z&&(0,D.jsxs)(O.Z,{mt:A.HN,children:[(0,D.jsx)(Z.Z,{children:"Synchronize code from remote repository"}),(0,D.jsxs)(O.Z,{mt:1,children:[(0,D.jsxs)(M.ZP,{children:["Running the sync from this page will run a one time sync with the remote repository.",(0,D.jsx)("br",{}),"This may ",(0,D.jsx)(M.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,D.jsx)(O.Z,{mt:2}),(0,D.jsxs)(M.ZP,{children:["Reset will tell Mage to try to clone your repository from remote. This will also ",(0,D.jsx)(M.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,D.jsx)(O.Z,{mt:2,children:(0,D.jsxs)(x.ZP,{children:[(0,D.jsx)(m.ZP,{loading:ie,onClick:function(){return te({sync:{action_type:"sync_data"}})},warning:!0,children:"Synchronize code"}),(0,D.jsx)(O.Z,{ml:2}),(0,D.jsx)(m.ZP,{danger:!0,loading:ie,onClick:function(){return te({sync:{action_type:"reset"}})},children:"Reset repository"})]})})]})]})})}L.getInitialProps=(0,r.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var z=(0,g.Z)(L)},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 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[585],{94629:function(e,t,r){"use strict";r.d(t,{Z:function(){return Z}});var n=r(82394),o=r(21831),i=r(82684),u=r(50724),c=r(1402),s=r(97618),a=r(70613),l=r(31557),f=r(68899),d=r(28598);function p(e,t){var r=e.children,n=e.noPadding;return(0,d.jsx)(f.HS,{noPadding:n,ref:t,children:r})}var h=i.forwardRef(p),v=r(62547),b=r(82571),O=r(77417),g=r(46684),m=r(75375);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t){e.addProjectBreadcrumbToCustomBreadcrumbs;var r=e.after,n=e.afterHeader,i=e.afterHidden,p=e.afterWidth,j=e.afterWidthOverride,P=e.appendBreadcrumbs,Z=e.before,w=e.beforeHeader,x=e.beforeWidth,k=e.breadcrumbs,A=e.children,E=e.contained,C=e.errors,_=e.headerMenuItems,D=e.headerOffset,I=e.hideAfterCompletely,M=e.mainContainerHeader,R=e.navigationItems,T=e.setAfterHidden,S=e.setAfterWidth,N=e.setBeforeWidth,B=e.setErrors,H=e.subheaderChildren,U=e.subheaderNoPadding,W=e.title,L=e.uuid,V=(0,m.Z)(L,{beforeResizeOffset:m.H,setWidthAfter:S,setWidthBefore:N,widthAfter:p,widthBefore:x,widthOverrideAfter:j}),X=V.mainContainerRef,F=V.mousedownActiveAfter,Y=V.mousedownActiveBefore,z=V.setMousedownActiveAfter,J=V.setMousedownActiveBefore,Q=V.setWidthAfter,G=V.setWidthBefore,q=V.widthAfter,$=V.widthBefore,K=(0,O.Z)().project,ee=[];return k&&ee.push.apply(ee,(0,o.Z)(k)),null!==k&&void 0!==k&&k.length&&!P||!K||null!==k&&void 0!==k&&k.length||ee.unshift({bold:!P,label:function(){return W}}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.Z,{title:W}),(0,d.jsx)(l.Z,{breadcrumbs:ee,menuItems:_}),(0,d.jsxs)(f.Nk,{ref:t,children:[0!==(null===R||void 0===R?void 0:R.length)&&(0,d.jsx)(f.lm,{showMore:!0,children:(0,d.jsx)(b.Z,{navigationItems:R,showMore:!0})}),(0,d.jsx)(s.Z,{flex:1,flexDirection:"column",children:(0,d.jsxs)(v.Z,{after:r,afterHeader:n,afterHeightOffset:g.Mz,afterHidden:i,afterMousedownActive:F,afterWidth:q,before:Z,beforeHeader:w,beforeHeightOffset:g.Mz,beforeMousedownActive:Y,beforeWidth:Z?$:f.k1,contained:E,headerOffset:D,hideAfterCompletely:!r||I,leftOffset:Z?f.k1:null,mainContainerHeader:M,mainContainerRef:X,setAfterHidden:T,setAfterMousedownActive:z,setAfterWidth:Q,setBeforeMousedownActive:J,setBeforeWidth:G,children:[H&&(0,d.jsx)(h,{noPadding:U,children:H}),A]})})]}),C&&(0,d.jsx)(u.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===B||void 0===B?void 0:B(null)},children:(0,d.jsx)(c.Z,y(y({},C),{},{onClose:function(){return null===B||void 0===B?void 0:B(null)}}))})]})}var Z=i.forwardRef(P)},16488:function(e,t,r){"use strict";r.d(t,{IJ:function(){return v},M8:function(){return x},Uc:function(){return j},XM:function(){return w},_U:function(){return h},eI:function(){return m},gU:function(){return P},lO:function(){return _},ri:function(){return O},tL:function(){return y},vJ:function(){return Z},xH:function(){return g}});var n,o=r(82394),i=r(92083),u=r.n(i),c=r(3917),s=r(4383),a=r(30229),l=r(42122),f=r(86735);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(e){return!!e&&!Object.values(a.U5).includes(e)};function v(e){return null===e||void 0===e?void 0:e.reduce((function(e,t){var r=t.block_uuid,n=t.completed_at,i=t.started_at,c=t.status,s=null;i&&n&&(s=u()(n).valueOf()-u()(i).valueOf());return p(p({},e),{},(0,o.Z)({},r,{runtime:s,status:c}))}),{})}var b,O=function(e){var t=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:a.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:a.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:a.Xm.API}];return e?t.slice(0,1):t};function g(e){var t=(0,l.gR)(e,[a.gm.INTERVAL,a.gm.TYPE]),r=e[a.gm.INTERVAL];r&&(t["schedule_interval[]"]=encodeURIComponent(r));var n=e[a.gm.TYPE];return n&&(t["schedule_type[]"]=n),t}function m(e){return e?new Date(u()(e).valueOf()):null}function j(e,t){return t?(0,c.XG)(e,t):function(e){if("string"!==typeof e)return e;var t=e.split("+")[0];return u()(m(t)).format(c.Nx)}(e)}!function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second"}(b||(b={}));var y=(n={},(0,o.Z)(n,b.DAY,86400),(0,o.Z)(n,b.HOUR,3600),(0,o.Z)(n,b.MINUTE,60),(0,o.Z)(n,b.SECOND,1),n);function P(e){var t=b.SECOND,r=e;return e%86400===0?(r/=86400,t=b.DAY):e%3600===0?(r/=3600,t=b.HOUR):e%60===0&&(r/=60,t=b.MINUTE),{time:r,unit:t}}function Z(e,t){return e*y[t]}function w(e,t,r){var n,o=u()(e);return o.set("hour",+(null===t||void 0===t?void 0:t.hour)||0),o.set("minute",+(null===t||void 0===t?void 0:t.minute)||0),o.set("second",0),n=o.format(c.TD),null!==r&&void 0!==r&&r.includeSeconds&&(n=n.concat(":00")),null!==r&&void 0!==r&&r.localTimezone&&(n=o.format(c.lE),null!==r&&void 0!==r&&r.convertToUtc&&(n=(0,c.d$)(n,{includeSeconds:null===r||void 0===r?void 0:r.includeSeconds,utcFormat:!0}))),n}function x(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n=!0;if(n){var o=(0,s.XF)();t?r="".concat(o,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/api_trigger"):(r="".concat(o,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/pipeline_runs"),null!==e&&void 0!==e&&e.token&&(r="".concat(r,"/").concat(e.token)))}return r}function k(e,t,r){return e.match(/[*,-/]/)?{additionalOffset:0,cronValue:e}:function(e,t,r){var n=r.indexOf(e),o=0;if(t<0)for(var i=0;i>t;i--)0===n?(n=r.length-1,o-=1):n-=1;else if(t>0)for(var u=0;u<t;u++)n===r.length-1?(n=0,o+=1):n+=1;var c="number"===typeof r[n]?r[n]:e;return{additionalOffset:o,cronValue:String(c)}}(+e,t,r)}var A=(0,f.m5)(60),E=(0,f.m5)(24),C=(0,c.Cs)();function _(e,t){if(!e)return e;var r=u()().local().format("Z"),n=r.split(":"),o="-"===r[0],i=3===n[0].length?Number(n[0].slice(1)):Number(n[0]),c=Number(n[1]);(o&&!t||!o&&t)&&(i=-i,c=-c);var s=e.split(" "),a=s[0],l=s[1],f=s[2],d=k(a,c,A),p=k(l,i+d.additionalOffset,E);if(s[0]=d.cronValue,s[1]=p.cronValue,0!==(null===p||void 0===p?void 0:p.additionalOffset)){var h=k(f,p.additionalOffset,C);s[2]=h.cronValue}return s.join(" ")}},55072:function(e,t,r){"use strict";r.d(t,{Et:function(){return d},Q:function(){return f}});r(82684);var n=r(71180),o=r(55485),i=r(38276),u=r(31748),c=r(72473),s=r(79633),a=r(70515),l=r(28598),f=30,d=9;t.ZP=function(e){var t=e.page,r=e.maxPages,f=e.onUpdate,d=e.totalPages,p=[],h=r;if(h>d)p=Array.from({length:d},(function(e,t){return t}));else{var v=Math.floor(h/2),b=t-v;t+v>=d?(b=d-h+2,h-=2):t-v<=0?(b=0,h-=2):(h-=4,b=t-Math.floor(h/2)),p=Array.from({length:h},(function(e,t){return t+b}))}return(0,l.jsx)(l.Fragment,{children:d>0&&(0,l.jsxs)(o.ZP,{alignItems:"center",children:[(0,l.jsx)(n.ZP,{disabled:0===t,onClick:function(){return f(t-1)},children:(0,l.jsx)(c.PaginateArrowLeft,{size:1.5*a.iI,stroke:u.Av})}),!p.includes(0)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return f(0)},children:1})},0),!p.includes(1)&&(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0)]}),p.map((function(e){return(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{backgroundColor:e===t&&s.a$,borderLess:!0,noBackground:!0,notClickable:e===t,onClick:function(){e!==t&&f(e)},children:e+1})},e)})),!p.includes(d-1)&&(0,l.jsxs)(l.Fragment,{children:[!p.includes(d-2)&&(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0),(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return f(d-1)},children:d})},d-1)]}),(0,l.jsx)(i.Z,{ml:1}),(0,l.jsx)(n.ZP,{disabled:t===d-1,onClick:function(){return f(t+1)},children:(0,l.jsx)(c.PaginateArrowRight,{size:1.5*a.iI,stroke:u.Av})})]})})}},93808:function(e,t,r){"use strict";r.d(t,{Z:function(){return A}});var n=r(77837),o=r(26304),i=r(62243),u=r(29385),c=r(80022),s=r(13692),a=r(93189),l=r(15544),f=r(82394),d=r(38860),p=r.n(d),h=r(82684),v=r(56663),b=r.n(v),O=r(40761),g=r(34661),m=r(36105),j=r(50178),y=r(69419),P=r(28598),Z=["auth"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){(0,f.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.Z)(this,r)}}function A(e){return function(t){(0,s.Z)(a,t);var r=k(a);function a(){var e;(0,i.Z)(this,a);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=r.call.apply(r,[this].concat(n)),(0,f.Z)((0,c.Z)(e),"state",{auth:new O.Z(e.props.token)}),e}return(0,u.Z)(a,[{key:"componentDidMount",value:function(){this.setState({auth:new O.Z(this.props.token)})}},{key:"render",value:function(){var t=this.props,r=(t.auth,(0,o.Z)(t,Z));return(0,P.jsx)(e,x({auth:this.state.auth},r))}}],[{key:"getInitialProps",value:function(){var t=(0,n.Z)(p().mark((function t(r){var n,o,i,u,c,s,a,l,f;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=b()(r),o=(0,j.ex)(r),i=o.id,u=n[g.Mv],c=n[m.qt],s=new O.Z(u),a=x(x({},r),{},{auth:s,currentGroupId:i,theme:c}),(0,j.YB)(r)&&s.isExpired&&(console.log("OAuth token has expired."),l=x(x({},r.query),{},{redirect_url:r.asPath}),(0,y.nL)("/sign-in?".concat((0,y.uM)(l)),r.res)),!e.getInitialProps){t.next=12;break}return t.next=10,e.getInitialProps(a);case 10:return f=t.sent,t.abrupt("return",x(x({},f),{},{auth:s,currentGroupId:i,theme:c}));case 12:return t.abrupt("return",a);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),a}(h.Component)}},77174:function(e,t,r){"use strict";r.r(t);var n=r(77837),o=r(82394),i=r(75582),u=r(38860),c=r.n(u),s=r(82684),a=r(34376),l=r(94629),f=r(55485),d=r(55072),p=r(93808),h=r(82359),v=r(44085),b=r(38276),O=r(30160),g=r(29624),m=r(35686),j=r(30229),y=r(70515),P=r(15610),Z=r(69419),w=r(70320),x=r(28598);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function E(){var e=(0,a.useRouter)(),t=(0,s.useState)(null),r=t[0],n=t[1],o=(0,Z.iV)(),u=null!==o&&void 0!==o&&o.page?o.page:0,c=(null===o||void 0===o?void 0:o.order_by)||j.kJ.CREATED_AT,p=m.ZP.projects.list().data,k=(0,s.useMemo)((function(){var e;return null===p||void 0===p||null===(e=p.projects)||void 0===e?void 0:e[0]}),[p]),E=((0,s.useMemo)((function(){var e;return(0,w.hY)(null===k||void 0===k||null===(e=k.features)||void 0===e?void 0:e[h.d.LOCAL_TIMEZONE])}),[null===k||void 0===k?void 0:k.features]),{_limit:d.Q,_offset:u*d.Q,order_by:c}),C=m.ZP.pipeline_schedules.list(E,{refreshInterval:7500,revalidateOnFocus:!0}),_=C.data,D=C.mutate,I=(0,s.useMemo)((function(){return(null===_||void 0===_?void 0:_.pipeline_schedules)||[]}),[_]),M=(0,s.useMemo)((function(){var e;return(null===_||void 0===_||null===(e=_.metadata)||void 0===e?void 0:e.count)||[]}),[_]);return(0,x.jsxs)(l.Z,{errors:r,setErrors:n,title:"Triggers",uuid:"triggers/index",children:[(0,x.jsx)(b.Z,{mx:2,my:1,children:(0,x.jsxs)(f.ZP,{alignItems:"center",children:[(0,x.jsx)(O.ZP,{bold:!0,default:!0,large:!0,children:"Sort runs by:"}),(0,x.jsx)(b.Z,{mr:1}),(0,x.jsx)(v.Z,{compact:!0,defaultColor:!0,fitContent:!0,onChange:function(e){e.preventDefault(),(0,P.u)({order_by:e.target.value,page:0})},paddingRight:4*y.iI,placeholder:"Select column",value:c||j.kJ.CREATED_AT,children:Object.entries(j.TR).map((function(e){var t=(0,i.Z)(e,2),r=t[0],n=t[1];return(0,x.jsx)("option",{value:r,children:n},r)}))})]})}),(0,x.jsx)(g.Z,{fetchPipelineSchedules:D,highlightRowOnHover:!0,includeCreatedAtColumn:!0,includePipelineColumn:!0,pipelineSchedules:I,setErrors:n,stickyHeader:!0}),(0,x.jsx)(b.Z,{p:2,children:(0,x.jsx)(d.ZP,{maxPages:9,onUpdate:function(t){var r=Number(t),n=A(A({},o),{},{page:r>=0?r:0});e.push("/triggers","/triggers?".concat((0,Z.uM)(n)))},page:Number(u),totalPages:Math.ceil(M/d.Q)})})]})}E.getInitialProps=(0,n.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)}))),t.default=(0,p.Z)(E)},59733:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/triggers",function(){return r(77174)}])},80022:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},15544:function(e,t,r){"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:function(){return n}})},13692:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(61049);function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(0,n.Z)(e,t)}},93189:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(12539),o=r(80022);function i(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}}},function(e){e.O(0,[1557,9624,9774,2888,179],(function(){return t=59733,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[585],{94629:function(e,t,r){"use strict";r.d(t,{Z:function(){return Z}});var n=r(82394),o=r(21831),i=r(82684),u=r(50724),c=r(1402),s=r(97618),a=r(70613),l=r(31557),f=r(68899),d=r(28598);function p(e,t){var r=e.children,n=e.noPadding;return(0,d.jsx)(f.HS,{noPadding:n,ref:t,children:r})}var h=i.forwardRef(p),v=r(62547),b=r(82571),O=r(77417),g=r(46684),m=r(75375);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t){e.addProjectBreadcrumbToCustomBreadcrumbs;var r=e.after,n=e.afterHeader,i=e.afterHidden,p=e.afterWidth,j=e.afterWidthOverride,P=e.appendBreadcrumbs,Z=e.before,w=e.beforeHeader,x=e.beforeWidth,k=e.breadcrumbs,A=e.children,E=e.contained,C=e.errors,_=e.headerMenuItems,D=e.headerOffset,I=e.hideAfterCompletely,M=e.mainContainerHeader,R=e.navigationItems,T=e.setAfterHidden,S=e.setAfterWidth,N=e.setBeforeWidth,B=e.setErrors,H=e.subheaderChildren,U=e.subheaderNoPadding,W=e.title,L=e.uuid,V=(0,m.Z)(L,{beforeResizeOffset:m.H,setWidthAfter:S,setWidthBefore:N,widthAfter:p,widthBefore:x,widthOverrideAfter:j}),F=V.mainContainerRef,X=V.mousedownActiveAfter,Y=V.mousedownActiveBefore,z=V.setMousedownActiveAfter,J=V.setMousedownActiveBefore,Q=V.setWidthAfter,G=V.setWidthBefore,q=V.widthAfter,$=V.widthBefore,K=(0,O.Z)().project,ee=[];return k&&ee.push.apply(ee,(0,o.Z)(k)),null!==k&&void 0!==k&&k.length&&!P||!K||null!==k&&void 0!==k&&k.length||ee.unshift({bold:!P,label:function(){return W}}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.Z,{title:W}),(0,d.jsx)(l.Z,{breadcrumbs:ee,menuItems:_}),(0,d.jsxs)(f.Nk,{ref:t,children:[0!==(null===R||void 0===R?void 0:R.length)&&(0,d.jsx)(f.lm,{showMore:!0,children:(0,d.jsx)(b.Z,{navigationItems:R,showMore:!0})}),(0,d.jsx)(s.Z,{flex:1,flexDirection:"column",children:(0,d.jsxs)(v.Z,{after:r,afterHeader:n,afterHeightOffset:g.Mz,afterHidden:i,afterMousedownActive:X,afterWidth:q,before:Z,beforeHeader:w,beforeHeightOffset:g.Mz,beforeMousedownActive:Y,beforeWidth:Z?$:f.k1,contained:E,headerOffset:D,hideAfterCompletely:!r||I,leftOffset:Z?f.k1:null,mainContainerHeader:M,mainContainerRef:F,setAfterHidden:T,setAfterMousedownActive:z,setAfterWidth:Q,setBeforeMousedownActive:J,setBeforeWidth:G,children:[H&&(0,d.jsx)(h,{noPadding:U,children:H}),A]})})]}),C&&(0,d.jsx)(u.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===B||void 0===B?void 0:B(null)},children:(0,d.jsx)(c.Z,y(y({},C),{},{onClose:function(){return null===B||void 0===B?void 0:B(null)}}))})]})}var Z=i.forwardRef(P)},16488:function(e,t,r){"use strict";r.d(t,{IJ:function(){return v},M8:function(){return x},Uc:function(){return j},XM:function(){return w},_U:function(){return h},eI:function(){return m},gU:function(){return P},lO:function(){return _},ri:function(){return O},tL:function(){return y},vJ:function(){return Z},xH:function(){return g}});var n,o=r(82394),i=r(92083),u=r.n(i),c=r(3917),s=r(4383),a=r(30229),l=r(42122),f=r(86735);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(e){return!!e&&!Object.values(a.U5).includes(e)};function v(e){return null===e||void 0===e?void 0:e.reduce((function(e,t){var r=t.block_uuid,n=t.completed_at,i=t.started_at,c=t.status,s=null;i&&n&&(s=u()(n).valueOf()-u()(i).valueOf());return p(p({},e),{},(0,o.Z)({},r,{runtime:s,status:c}))}),{})}var b,O=function(e){var t=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:a.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:a.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:a.Xm.API}];return e?t.slice(0,1):t};function g(e){var t=(0,l.gR)(e,[a.gm.INTERVAL,a.gm.TYPE]),r=e[a.gm.INTERVAL];r&&(t["schedule_interval[]"]=encodeURIComponent(r));var n=e[a.gm.TYPE];return n&&(t["schedule_type[]"]=n),t}function m(e){return e?new Date(u()(e).valueOf()):null}function j(e,t){return t?(0,c.XG)(e,t):function(e){if("string"!==typeof e)return e;var t=e.split("+")[0];return u()(m(t)).format(c.Nx)}(e)}!function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second"}(b||(b={}));var y=(n={},(0,o.Z)(n,b.DAY,86400),(0,o.Z)(n,b.HOUR,3600),(0,o.Z)(n,b.MINUTE,60),(0,o.Z)(n,b.SECOND,1),n);function P(e){var t=b.SECOND,r=e;return e%86400===0?(r/=86400,t=b.DAY):e%3600===0?(r/=3600,t=b.HOUR):e%60===0&&(r/=60,t=b.MINUTE),{time:r,unit:t}}function Z(e,t){return e*y[t]}function w(e,t,r){var n,o=u()(e);return o.set("hour",+(null===t||void 0===t?void 0:t.hour)||0),o.set("minute",+(null===t||void 0===t?void 0:t.minute)||0),o.set("second",0),n=o.format(c.TD),null!==r&&void 0!==r&&r.includeSeconds&&(n=n.concat(":00")),null!==r&&void 0!==r&&r.localTimezone&&(n=o.format(c.lE),null!==r&&void 0!==r&&r.convertToUtc&&(n=(0,c.d$)(n,{includeSeconds:null===r||void 0===r?void 0:r.includeSeconds,utcFormat:!0}))),n}function x(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n=!0;if(n){var o=(0,s.XF)();t?r="".concat(o,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/api_trigger"):(r="".concat(o,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/pipeline_runs"),null!==e&&void 0!==e&&e.token&&(r="".concat(r,"/").concat(e.token)))}return r}function k(e,t,r){return e.match(/[*,-/]/)?{additionalOffset:0,cronValue:e}:function(e,t,r){var n=r.indexOf(e),o=0;if(t<0)for(var i=0;i>t;i--)0===n?(n=r.length-1,o-=1):n-=1;else if(t>0)for(var u=0;u<t;u++)n===r.length-1?(n=0,o+=1):n+=1;var c="number"===typeof r[n]?r[n]:e;return{additionalOffset:o,cronValue:String(c)}}(+e,t,r)}var A=(0,f.m5)(60),E=(0,f.m5)(24),C=(0,c.Cs)();function _(e,t){if(!e)return e;var r=u()().local().format("Z"),n=r.split(":"),o="-"===r[0],i=3===n[0].length?Number(n[0].slice(1)):Number(n[0]),c=Number(n[1]);(o&&!t||!o&&t)&&(i=-i,c=-c);var s=e.split(" "),a=s[0],l=s[1],f=s[2],d=k(a,c,A),p=k(l,i+d.additionalOffset,E);if(s[0]=d.cronValue,s[1]=p.cronValue,0!==(null===p||void 0===p?void 0:p.additionalOffset)){var h=k(f,p.additionalOffset,C);s[2]=h.cronValue}return s.join(" ")}},55072:function(e,t,r){"use strict";r.d(t,{Et:function(){return d},Q:function(){return f}});r(82684);var n=r(71180),o=r(55485),i=r(38276),u=r(31748),c=r(72473),s=r(79633),a=r(70515),l=r(28598),f=30,d=9;t.ZP=function(e){var t=e.page,r=e.maxPages,f=e.onUpdate,d=e.totalPages,p=[],h=r;if(h>d)p=Array.from({length:d},(function(e,t){return t}));else{var v=Math.floor(h/2),b=t-v;t+v>=d?(b=d-h+2,h-=2):t-v<=0?(b=0,h-=2):(h-=4,b=t-Math.floor(h/2)),p=Array.from({length:h},(function(e,t){return t+b}))}return(0,l.jsx)(l.Fragment,{children:d>0&&(0,l.jsxs)(o.ZP,{alignItems:"center",children:[(0,l.jsx)(n.ZP,{disabled:0===t,onClick:function(){return f(t-1)},children:(0,l.jsx)(c.PaginateArrowLeft,{size:1.5*a.iI,stroke:u.Av})}),!p.includes(0)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return f(0)},children:1})},0),!p.includes(1)&&(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0)]}),p.map((function(e){return(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{backgroundColor:e===t&&s.a$,borderLess:!0,noBackground:!0,notClickable:e===t,onClick:function(){e!==t&&f(e)},children:e+1})},e)})),!p.includes(d-1)&&(0,l.jsxs)(l.Fragment,{children:[!p.includes(d-2)&&(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0),(0,l.jsx)(i.Z,{ml:1,children:(0,l.jsx)(n.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return f(d-1)},children:d})},d-1)]}),(0,l.jsx)(i.Z,{ml:1}),(0,l.jsx)(n.ZP,{disabled:t===d-1,onClick:function(){return f(t+1)},children:(0,l.jsx)(c.PaginateArrowRight,{size:1.5*a.iI,stroke:u.Av})})]})})}},93808:function(e,t,r){"use strict";r.d(t,{Z:function(){return A}});var n=r(77837),o=r(26304),i=r(62243),u=r(29385),c=r(80022),s=r(13692),a=r(93189),l=r(15544),f=r(82394),d=r(38860),p=r.n(d),h=r(82684),v=r(56663),b=r.n(v),O=r(40761),g=r(34661),m=r(36105),j=r(50178),y=r(69419),P=r(28598),Z=["auth"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){(0,f.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.Z)(this,r)}}function A(e){return function(t){(0,s.Z)(a,t);var r=k(a);function a(){var e;(0,i.Z)(this,a);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=r.call.apply(r,[this].concat(n)),(0,f.Z)((0,c.Z)(e),"state",{auth:new O.Z(e.props.token)}),e}return(0,u.Z)(a,[{key:"componentDidMount",value:function(){this.setState({auth:new O.Z(this.props.token)})}},{key:"render",value:function(){var t=this.props,r=(t.auth,(0,o.Z)(t,Z));return(0,P.jsx)(e,x({auth:this.state.auth},r))}}],[{key:"getInitialProps",value:function(){var t=(0,n.Z)(p().mark((function t(r){var n,o,i,u,c,s,a,l,f;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=b()(r),o=(0,j.ex)(r),i=o.id,u=n[g.Mv],c=n[m.qt],s=new O.Z(u),a=x(x({},r),{},{auth:s,currentGroupId:i,theme:c}),(0,j.YB)(r)&&s.isExpired&&(console.log("OAuth token has expired."),l=x(x({},r.query),{},{redirect_url:r.asPath}),(0,y.nL)("/sign-in?".concat((0,y.uM)(l)),r.res)),!e.getInitialProps){t.next=12;break}return t.next=10,e.getInitialProps(a);case 10:return f=t.sent,t.abrupt("return",x(x({},f),{},{auth:s,currentGroupId:i,theme:c}));case 12:return t.abrupt("return",a);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),a}(h.Component)}},77174:function(e,t,r){"use strict";r.r(t);var n=r(77837),o=r(82394),i=r(75582),u=r(38860),c=r.n(u),s=r(82684),a=r(34376),l=r(94629),f=r(55485),d=r(55072),p=r(93808),h=r(82359),v=r(44085),b=r(38276),O=r(4190),g=r(30160),m=r(29624),j=r(35686),y=r(30229),P=r(70515),Z=r(15610),w=r(69419),x=r(70320),k=r(28598);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){(0,o.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function C(){var e=(0,a.useRouter)(),t=(0,s.useState)(null),r=t[0],n=t[1],o=(0,w.iV)(),u=null!==o&&void 0!==o&&o.page?o.page:0,c=(null===o||void 0===o?void 0:o.order_by)||y.kJ.CREATED_AT,p=j.ZP.projects.list().data,A=(0,s.useMemo)((function(){var e;return null===p||void 0===p||null===(e=p.projects)||void 0===e?void 0:e[0]}),[p]),C=((0,s.useMemo)((function(){var e;return(0,x.hY)(null===A||void 0===A||null===(e=A.features)||void 0===e?void 0:e[h.d.LOCAL_TIMEZONE])}),[null===A||void 0===A?void 0:A.features]),{_limit:d.Q,_offset:u*d.Q,order_by:c}),_=j.ZP.pipeline_schedules.list(C,{refreshInterval:7500,revalidateOnFocus:!0}),D=_.data,I=_.mutate,M=(0,s.useMemo)((function(){return(null===D||void 0===D?void 0:D.pipeline_schedules)||[]}),[D]),R=(0,s.useMemo)((function(){var e;return(null===D||void 0===D||null===(e=D.metadata)||void 0===e?void 0:e.count)||[]}),[D]);return(0,k.jsxs)(l.Z,{errors:r,setErrors:n,title:"Triggers",uuid:"triggers/index",children:[(0,k.jsx)(b.Z,{mx:2,my:1,children:(0,k.jsxs)(f.ZP,{alignItems:"center",children:[(0,k.jsx)(g.ZP,{bold:!0,default:!0,large:!0,children:"Sort by:"}),(0,k.jsx)(b.Z,{mr:1}),(0,k.jsx)(v.Z,{compact:!0,defaultColor:!0,fitContent:!0,onChange:function(e){e.preventDefault(),(0,Z.u)({order_by:e.target.value,page:0})},paddingRight:4*P.iI,placeholder:"Select column",value:c||y.kJ.CREATED_AT,children:Object.entries(y.TR).map((function(e){var t=(0,i.Z)(e,2),r=t[0],n=t[1];return(0,k.jsx)("option",{value:r,children:n},r)}))})]})}),D?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(m.Z,{fetchPipelineSchedules:I,highlightRowOnHover:!0,includeCreatedAtColumn:!0,includePipelineColumn:!0,pipelineSchedules:M,setErrors:n,stickyHeader:!0}),(0,k.jsx)(b.Z,{p:2,children:(0,k.jsx)(d.ZP,{maxPages:9,onUpdate:function(t){var r=Number(t),n=E(E({},o),{},{page:r>=0?r:0});e.push("/triggers","/triggers?".concat((0,w.uM)(n)))},page:Number(u),totalPages:Math.ceil(R/d.Q)})})]}):(0,k.jsx)(b.Z,{m:2,children:(0,k.jsx)(O.Z,{inverted:!0,large:!0})})]})}C.getInitialProps=(0,n.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)}))),t.default=(0,p.Z)(C)},59733:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/triggers",function(){return r(77174)}])},80022:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},15544:function(e,t,r){"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:function(){return n}})},13692:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(61049);function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(0,n.Z)(e,t)}},93189:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(12539),o=r(80022);function i(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}}},function(e){e.O(0,[1557,9624,9774,2888,179],(function(){return t=59733,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
|
|
@@ -0,0 +1 @@
|
|
|
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,I=e.errors,M=e.headerMenuItems,S=e.headerOffset,H=e.hideAfterCompletely,E=e.mainContainerHeader,A=e.navigationItems,R=e.setAfterHidden,D=e.setAfterWidth,F=e.setBeforeWidth,B=e.setErrors,N=e.subheaderChildren,U=e.subheaderNoPadding,V=e.title,T=e.uuid,L=(0,b.Z)(T,{beforeResizeOffset:b.H,setWidthAfter:D,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 V}}),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u.Z,{title:V}),(0,h.jsx)(a.Z,{breadcrumbs:ee,menuItems:M}),(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:R,setAfterMousedownActive:W,setAfterWidth:K,setBeforeMousedownActive:Q,setBeforeWidth:Y,children:[N&&(0,h.jsx)(m,{noPadding:U,children:N}),O]})})]}),I&&(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({},I),{},{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",I="push",M="rebase",S="git_remote_name",H="git_repository_name",E={uuid:"Branches"},A={uuid:"Commit"},R={uuid:"Push & Pull Requests"},D={uuid:"Remote & Auth"},F=[D,E,A,R],B=t(70515),N=t(81728),U=t(72619),V=t(28598);var T=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],I=w[1],S=(0,u.useState)(null),H=S[0],E=S[1],R=(0,u.useState)(null),F=R[0],T=R[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,U.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,U.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(encodeURIComponent(null===t||void 0===t?void 0:t.name)),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){var n=e.git_custom_branch.progress;o(),I(""),E(""),T(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,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsxs)(m.Z,{children:["Branches",r?" (".concat(null===r||void 0===r?void 0:r.length,")"):""]}),(0,V.jsx)(j.Z,{mt:B.Mq,children:(0,V.jsxs)(f.ZP,{children:[(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Remote"})}),(0,V.jsx)(v.Z,{beforeIcon:(0,V.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,V.jsx)("option",{value:n,children:n},n)}))})]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(0,V.jsxs)(f.ZP,{alignItems:"center",children:[(0,V.jsx)(g.Z,{fullSize:!0,label:"Choose a different branch to switch branches",widthFitContent:!0,children:(0,V.jsx)(v.Z,{beforeIcon:(0,V.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,V.jsx)("option",{value:n,children:n},n)})))})}),(0,V.jsx)(j.Z,{mr:B.cd}),oe&&(0,V.jsx)(p.Z,{inverted:!0})]})]})]})}),(0,V.jsx)(j.Z,{mt:B.Mq,children:(0,V.jsxs)(f.ZP,{alignItems:"center",children:[(0,V.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,V.jsx)(j.Z,{mr:1}),(0,V.jsx)(d.ZP,{beforeIcon:(0,V.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,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(m.Z,{children:"Actions"}),(0,V.jsxs)(j.Z,{mt:B.Mq,children:[(0,V.jsxs)(j.Z,{mb:B.Mq,children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),(null===t||void 0===t?void 0:t.name)&&(0,V.jsx)(x.ZP,{monospace:!0,children:null===t||void 0===t?void 0:t.name})]}),(0,V.jsxs)(f.ZP,{alignItems:"center",children:[(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Base branch"})}),(0,V.jsx)(v.Z,{beforeIcon:(0,V.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,V.jsx)("option",{value:n,children:n},n)}))})]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Action"})}),(0,V.jsxs)(v.Z,{onChange:function(e){return E(e.target.value)},placeholder:"Choose action",value:H||"",children:[(0,V.jsx)("option",{value:O,children:(0,N.vg)(O)}),(0,V.jsx)("option",{value:M,children:(0,N.vg)(M)}),(0,V.jsx)("option",{value:_,children:(0,N.vg)(_)})]})]})]}),H&&[O,M].includes(H)&&(0,V.jsxs)(j.Z,{mt:B.cd,children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsxs)(x.ZP,{bold:!0,muted:!0,children:["Message for ",H]})}),(0,V.jsx)(b.Z,{monospace:!0,onChange:function(e){return I(e.target.value)},value:k||""})]}),(0,V.jsxs)(j.Z,{mt:B.cd,children:[(0,V.jsx)(d.ZP,{beforeIcon:(0,V.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,V.jsx)(j.Z,{mt:B.cd,children:(0,V.jsx)(x.ZP,{default:!0,monospace:!0,preWrap:!0,children:F})})]})]})]}),(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:B.HN,children:(0,V.jsx)(h.Z,{light:!0})}),(0,V.jsxs)(f.ZP,{children:[(0,V.jsx)(d.ZP,{beforeIcon:(0,V.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(encodeURIComponent(D.uuid))},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:D.uuid}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)(d.ZP,{afterIcon:(0,V.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],M=O[1],S=(0,u.useState)(null),H=S[0],E=S[1],R=(0,u.useState)(null),D=R[0],F=R[1],T=(0,u.useState)(Y),L=T[0],Q=T[1],X=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(encodeURIComponent(null===t||void 0===t?void 0:t.name)),{onSuccess:function(e){return(0,U.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,V.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,V.jsx)(z.Z,{default:!0,href:o,monospace:!0,openNewWindow:!0,small:!0,children:r},"title"),(0,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:i},"user"),(0,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:n},"createdAt"),(0,V.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,U.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,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(m.Z,{children:(0,N.vg)(I)})}),(0,V.jsxs)(j.Z,{mt:B.Mq,children:[(0,V.jsxs)(f.ZP,{children:[(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Remote"})}),i&&(0,V.jsx)(p.Z,{inverted:!0}),!i&&(0,V.jsx)(v.Z,{beforeIcon:(0,V.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,V.jsx)("option",{value:n,children:n},n)}))})]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Branch"})}),(0,V.jsxs)(v.Z,{beforeIcon:(0,V.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return M(e.target.value)},placeholder:"Choose branch",value:k||"",children:[(0,V.jsx)("option",{value:""}),null===r||void 0===r?void 0:r.map((function(e){var n=e.name;return(0,V.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,V.jsx)(j.Z,{mt:B.cd,children:(0,V.jsxs)(d.ZP,{beforeIcon:(0,V.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:I}})},primary:!0,children:[(0,N.vg)(I)," ",n," ",n&&k]})}),(D||H)&&(0,V.jsx)(j.Z,{mt:B.cd,children:(0,V.jsx)(x.ZP,{danger:!!H,default:!!D,monospace:!0,preWrap:!0,children:D||H})})]})]}),(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(m.Z,{children:"Create pull request"})}),(0,V.jsxs)(j.Z,{mt:B.Mq,children:[i&&(0,V.jsx)(p.Z,{inverted:!0}),!i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(f.ZP,{children:[(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Repository"})}),(0,V.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,V.jsx)("option",{value:n,children:n},n)}))})]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Base branch"})}),g&&!se&&(0,V.jsx)(p.Z,{inverted:!0}),(!g||se)&&(0,V.jsx)(v.Z,{beforeIcon:(0,V.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,V.jsx)("option",{value:n,children:n},n)}))})]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)("div",{children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),g&&!se&&(0,V.jsx)(p.Z,{inverted:!0}),(!g||se||(null===L||void 0===L?void 0:L.compare_branch))&&(0,V.jsxs)(v.Z,{beforeIcon:(0,V.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,V.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,V.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,V.jsx)(j.Z,{mt:1,children:(0,V.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,V.jsx)(j.Z,{mt:1,children:(0,V.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,V.jsx)(j.Z,{mt:B.cd,children:(0,V.jsx)(d.ZP,{beforeIcon:(0,V.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,V.jsx)(j.Z,{mt:B.Mq,children:(0,V.jsx)(q.Z,{visibleMapping:{0:!g},children:(0,V.jsxs)(G.Z,{noPaddingContent:!0,title:re?"Pull requests (".concat(null===ie||void 0===ie?void 0:ie.length,")"):"Pull requests",children:[!g&&(0,V.jsx)(j.Z,{p:B.cd,children:(0,V.jsx)(x.ZP,{muted:!0,children:"Please select a repository to view open pull requests."})}),g&&(0,V.jsxs)(V.Fragment,{children:[!re&&(0,V.jsx)(j.Z,{p:B.cd,children:(0,V.jsx)(p.Z,{inverted:!0})}),re&&le]})]})})})]}),(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:B.HN,children:(0,V.jsx)(h.Z,{light:!0})}),(0,V.jsx)(f.ZP,{children:(0,V.jsx)(d.ZP,{beforeIcon:(0,V.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)({}),I=k[0],M=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]),D=(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(I).length===(null===H||void 0===H?void 0:H.length)}),[I,H]),T=(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,U.wD)(e,le({callback:function(){t(),O({})}},T))}}}),[t,T]),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,U.wD)(e,le({callback:function(){t(),M({})}},T))}}),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,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(z.Z,{block:!0,noHoverUnderline:!0,onClick:function(){t(o?{}:r)},preventDefault:!0,children:(0,V.jsxs)(f.ZP,{alignItems:"center",flexDirection:"row",children:[(0,V.jsx)(ee.Z,{checked:i&&o,disabled:!i}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsx)(x.ZP,{bold:!0,children:i&&o?"Unselect all":"Select all"})]})}),e.map((function(e){return(0,V.jsx)(re,{children:(0,V.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,V.jsxs)(f.ZP,{alignItems:"center",flexDirection:"row",children:[(0,V.jsx)(ee.Z,{checked:!(null===n||void 0===n||!n[e])}),(0,V.jsx)(j.Z,{mr:1}),(0,V.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,U.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,V.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,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===n||void 0===n?void 0:n.name},"author"),(0,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:t},"date"),(0,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:r},"message")]})),uuid:"git-branch-logs"})}),[pe]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(j.Z,{mb:B.HN,children:(0,V.jsxs)(f.ZP,{children:[(0,V.jsxs)(ne.Z,{flex:1,flexDirection:"column",children:[(0,V.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,V.jsx)(j.Z,{my:B.cd,children:(0,V.jsx)(h.Z,{light:!0})}),(0,V.jsx)(j.Z,{mb:B.cd,children:(0,V.jsxs)(f.ZP,{flexDirection:"row",children:[(0,V.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,V.jsx)(j.Z,{mr:1}),(0,V.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),D)]}),(0,V.jsx)(j.Z,{mr:B.cd}),(0,V.jsxs)(ne.Z,{flex:1,flexDirection:"column",children:[(0,V.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,V.jsx)(j.Z,{my:B.cd,children:(0,V.jsx)(h.Z,{light:!0})}),(0,V.jsx)(j.Z,{mb:B.cd,children:(0,V.jsx)(f.ZP,{flexDirection:"row",children:(0,V.jsx)(d.ZP,{compact:!0,disabled:(0,oe.Qr)(I)||J||se,loading:de,onClick:function(){ae({git_custom_branch:{action_type:"reset",files:Object.keys(I)}})},secondary:!0,children:"Reset files"})})}),he(H,I,M,l,F)]})]})}),(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(m.Z,{children:"Commit"})}),(0,V.jsx)(j.Z,{mb:B.cd,children:(0,V.jsx)(q.Z,{children:(0,V.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,V.jsx)(j.Z,{my:1,px:B.cd,children:(0,V.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,V.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,V.jsx)(j.Z,{mr:1}),(null===r||void 0===r?void 0:r[e])&&(0,V.jsx)(x.ZP,{warning:!0,children:"Modified after staging"})]})},e)}))})})}),(0,V.jsx)(b.Z,{label:"Commit message",monospace:!0,onChange:function(e){return P(e.target.value)},ref:v,value:g||""}),(0,V.jsx)(j.Z,{mt:B.cd,children:(0,V.jsxs)(f.ZP,{alignItems:"center",children:[(0,V.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,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(j.Z,{mr:1}),(0,V.jsx)(x.ZP,{danger:!0,small:!0,children:"Please stage at least 1 file before committing."})]})]})})]}),(0,V.jsx)(j.Z,{mb:B.HN,children:(0,V.jsx)(q.Z,{children:(0,V.jsxs)(G.Z,{noPaddingContent:!0,title:"Logs",children:[!ve&&(0,V.jsx)(j.Z,{p:B.cd,children:(0,V.jsx)(p.Z,{inverted:!0})}),ve&&ye]})})}),(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:B.HN,children:(0,V.jsx)(h.Z,{light:!0})}),(0,V.jsxs)(f.ZP,{children:[(0,V.jsx)(d.ZP,{beforeIcon:(0,V.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(E.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:E.uuid}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)(d.ZP,{afterIcon:(0,V.jsx)(C.PaginateArrowRight,{}),linkProps:fe?{href:"/version-control?tab=".concat(encodeURIComponent(R.uuid))}:null,noHoverUnderline:!0,primary:fe,sameColorAsText:!0,secondary:!fe,children:["Next: ",R.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,V.jsxs)(me,{fill:n,height:o,opacity:t,style:i,viewBox:s,width:o,children:[(0,V.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,V.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,V.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,V.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,V.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,V.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,V.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,V.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,V.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,V.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,V.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,V.jsx)("defs",{children:(0,V.jsxs)("linearGradient",{gradientUnits:"userSpaceOnUse",id:"paint0_linear_13549_1163",x1:"43.1513",x2:"22.7826",y1:"19.7256",y2:"36.1667",children:[(0,V.jsx)("stop",{offset:"0.176",stopColor:"#0052CC"}),(0,V.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,U.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,V.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,V.jsx)(ne.Z,{children:(0,V.jsx)(m,{size:12*B.iI})}),(0,V.jsx)(ne.Z,{alignItems:"center",children:null!==t&&void 0!==t&&t.authenticated?(0,V.jsx)(d.ZP,{loading:h,onClick:function(){return u({oauth:{action_type:"reset"}})},warning:!0,children:"Reset"}):(0,V.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,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(m.Z,{children:"Authentication"}),(0,V.jsxs)(j.Z,{mt:B.Mq,children:[f&&!p&&(0,V.jsxs)(j.Z,{mb:2,children:[(0,V.jsx)(d.ZP,{disabled:!0,children:"Using access token from Git Settings"}),(0,V.jsx)(j.Z,{mt:1,children:(0,V.jsx)(x.ZP,{muted:!0,children:"Some features may not work unless you authenticate with a Git client."})})]}),(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:B.Mq,children:(0,V.jsx)(x.ZP,{muted:!0,children:"Authenticating with the apps below will allow you to easily pull, push, and create pull requests."})}),(0,V.jsxs)(j.Z,{mb:B.Mq,style:{maxWidth:"600px"},children:[(0,V.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,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ze,{isLoadingCreateOauth:t,oauth:i,provider:o,showError:r},o),(0,V.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,I=(0,he.useRouter)(),M=(0,ye.Z)().project,S=(0,u.useRef)(null),H=(0,u.useState)(null),A=H[0],R=H[1],D=(0,u.useState)(null),F=D[0],T=D[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!==M&&void 0!==M&&M.repo_path)&&xe((null===l||void 0===l||null===(n=l.sync_config)||void 0===n?void 0:n.repo_path)||(null===M||void 0===M?void 0:M.repo_path))}),[l,M,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){return{name:e.name.substring(i.length+1)}}))}),[i,g]),Ce=(0,a.Db)(y.ZP.syncs.useCreate(),{onSuccess:function(e){return(0,U.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(encodeURIComponent(null===l||void 0===l?void 0:l.name)),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){var n=e.git_custom_branch,t=n.error,r=n.progress;t?(T(t),J(null)):(s(),R(null),T(null),K(null),J(r))},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}}),ke=(0,c.Z)(Oe,2),Ie=ke[0],Me=ke[1].isLoading,Se=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(encodeURIComponent(null===l||void 0===l?void 0:l.name)),{onSuccess:function(e){return(0,U.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,Re=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(encodeURIComponent(null===l||void 0===l?void 0:l.name)),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(){s(),ie(null)},onErrorCallback:function(e,n){ie(null),O({errors:n,response:e})}})}}),De=(0,c.Z)(Re,2),Fe=De[0],Be=De[1].isLoading,Ne=(0,a.Db)(y.ZP.oauths.useCreate(),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(){return window.location.href="".concat(I.basePath,"/version-control")},onErrorCallback:function(e,n){O({errors:n,response:e})}})}}),Ue=(0,c.Z)(Ne,2),Ve=Ue[0],Te=Ue[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&&Ve({oauth:{expires_in:We,provider:Ge||je.h.GITHUB,refresh_token:ze,token:qe}})}),[qe,Ve,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,V.jsxs)(j.Z,{mt:B.Mq,children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,V.jsxs)(ne.Z,{alignItems:"center",children:[(0,V.jsx)(x.ZP,{bold:!0,children:n}),(0,V.jsx)(j.Z,{mx:1,children:(0,V.jsx)(C.ChevronRight,{muted:!0})}),null===r||void 0===r?void 0:r.map((function(e){return(0,V.jsx)(j.Z,{mr:1,children:(0,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:e})},e)}))]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.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,V.jsx)(C.Trash,{})})]})}),(0,V.jsx)(q.Z,{children:(0,V.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,V.jsx)(j.Z,{p:B.cd,children:(0,V.jsx)(x.ZP,{muted:!0,children:"This remote has no refs."})}),(null===t||void 0===t?void 0:t.length)>=1&&(0,V.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,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:r},"ref-name"),(0,V.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,V.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===t||void 0===t?void 0:t.date},"date"),(0,V.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,V.jsx)(j.Z,{mt:B.Mq,children:(0,V.jsx)(h.Z,{light:!0})})]},n)}))}),[Be,oe,g,Fe]);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(m.Z,{children:"Setup"}),(0,V.jsxs)(j.Z,{mt:B.Mq,children:[(0,V.jsxs)(j.Z,{mb:1,children:[(0,V.jsx)(x.ZP,{bold:!0,large:!0,children:be?"Git init directory":"Initialize Git directory"}),!be&&(0,V.jsxs)(x.ZP,{muted:!0,children:["Enter the directory you want to initialize git in.",(0,V.jsx)("br",{}),"The current project directoy is filled in for you. If you want to use that, click the save button."]}),be&&(0,V.jsxs)(x.ZP,{muted:!0,children:["If the directory below is blank, then the current working directory will be used to initialize git.",(0,V.jsx)("br",{}),"If git hasn\u2019t been initialized in the directory below, Mage will automatically run git init for you."]})]}),(0,V.jsxs)(f.ZP,{alignItems:"center",children:[(0,V.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,V.jsx)(j.Z,{mr:1}),(!be||ee)&&(0,V.jsxs)(V.Fragment,{children:[(0,V.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,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(j.Z,{mr:1}),(0,V.jsx)(z.Z,{onClick:function(){return te(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Cancel"})]})]}),be&&!ee&&(0,V.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,V.jsx)(j.Z,{mb:B.HN,children:(0,V.jsx)(ge,{branch:l,isLoadingCreateOauth:Te,showError:O})}),be&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsxs)(m.Z,{children:["Remotes",!b&&g?" (".concat(null===g||void 0===g?void 0:g.length,")"):""]}),b&&(0,V.jsx)(j.Z,{mt:B.Mq,children:(0,V.jsx)(p.Z,{inverted:!0})}),!b&&Qe,(0,V.jsx)(j.Z,{mt:B.Mq,children:(0,V.jsxs)(f.ZP,{alignItems:"flex-start",children:[(0,V.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,V.jsx)(j.Z,{mr:1}),(0,V.jsxs)(f.ZP,{flexDirection:"column",children:[(0,V.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,V.jsx)(j.Z,{mt:1,children:(0,V.jsxs)(x.ZP,{muted:!0,small:!0,children:["Use the https URL if you",(0,V.jsx)("br",{}),"authenticated with GitHub above."]})})]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsx)(d.ZP,{beforeIcon:(0,V.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,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(m.Z,{children:"Actions"}),(0,V.jsxs)(j.Z,{mt:B.Mq,children:[(0,V.jsxs)(j.Z,{mb:B.Mq,children:[(0,V.jsx)(j.Z,{mb:1,children:(0,V.jsx)(x.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(null===l||void 0===l?void 0:l.name)&&(0,V.jsxs)(f.ZP,{alignItems:"center",children:[(0,V.jsx)(x.ZP,{monospace:!0,children:null===l||void 0===l?void 0:l.name}),(0,V.jsx)(j.Z,{mr:B.cd}),(0,V.jsx)(de(),{href:"/version-control?tab=".concat(E.uuid),passHref:!0,children:(0,V.jsx)(z.Z,{small:!0,children:"Switch branch"})})]})]}),(0,V.jsxs)(f.ZP,{children:[(0,V.jsxs)(v.Z,{onChange:function(e){return K(e.target.value)},placeholder:"Action",value:Q||"",children:[(0,V.jsx)("option",{value:w,children:(0,N.vg)(w)}),(0,V.jsx)("option",{value:k,children:(0,N.vg)(k)}),(0,V.jsx)("option",{value:"reset",children:(0,N.vg)("reset --hard")}),(0,V.jsx)("option",{value:P,children:(0,N.vg)(P)})]}),(0,V.jsx)(j.Z,{mr:1}),(0,V.jsx)(v.Z,{beforeIcon:(0,V.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,V.jsx)("option",{value:n,children:n},n)}))}),![w,P].includes(Q)&&(0,V.jsx)(j.Z,{ml:1,children:(0,V.jsxs)(v.Z,{beforeIcon:(0,V.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return R(e.target.value)},value:A||"",children:[(0,V.jsx)("option",{value:"",children:"All branches"}),null===Ze||void 0===Ze?void 0:Ze.map((function(e){var n=e.name;return(0,V.jsx)("option",{value:n,children:n},n)}))]})})]}),P===Q&&(0,V.jsxs)(j.Z,{mt:B.cd,children:[(0,V.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,V.jsx)("br",{}),(0,V.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,V.jsx)(j.Z,{mt:1,children:(0,V.jsx)(x.ZP,{muted:!0,small:!0,children:"Cloning won\u2019t automatically create a folder that is named after the remote repository."})}),(0,V.jsx)(j.Z,{mt:1,children:(0,V.jsxs)(x.ZP,{muted:!0,small:!0,children:["For example, if you have a file named ",(0,V.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:"magic.py"})," in a remote repository named ",(0,V.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:"project_romeo"}),(0,V.jsx)("br",{}),"then that file will be cloned here ",(0,V.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,V.jsx)("br",{}),"as opposed to ",(0,V.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,V.jsx)(j.Z,{mt:1,children:(0,V.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,V.jsx)("br",{}),(0,V.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,V.jsx)(x.ZP,{inline:!0,monospace:!0,small:!0,children:"[remote repository name]"})]})]})})]}),(0,V.jsxs)(j.Z,{mt:B.cd,children:[(0,V.jsx)(d.ZP,{beforeIcon:(0,V.jsx)(C.Lightning,{size:2*B.iI}),disabled:!Q||!i,loading:Me,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."))&&Ie({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,V.jsx)(j.Z,{mt:B.cd,children:(0,V.jsx)(x.ZP,{danger:!!F,default:!!X,monospace:!0,preWrap:!0,children:X||F})})]})]})]}),(0,V.jsxs)(j.Z,{mb:B.HN,children:[(0,V.jsx)(j.Z,{mb:B.HN,children:(0,V.jsx)(h.Z,{light:!0})}),(0,V.jsx)(f.ZP,{children:(0,V.jsxs)(d.ZP,{afterIcon:(0,V.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),Ie=(t(17717),t(74401)),Me=t(86735);function Se(e,n){var t=(0,Ie.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 Re="version_control/index",De=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)(De),f=d[0],m=d[1],b="layout_before_".concat(Re,"_width"),Z=(0,xe.U2)(b,De),C=(0,u.useState)(Z),P=C[0],_=C[1],w=(0,u.useState)({}),O=w[0],k=w[1],I=(0,u.useState)(null),M=I[0],N=I[1],U=(0,u.useState)(null),q=U[0],G=U[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;!M&&(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)}),[M,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],Ie=ge[1],Ee=(0,u.useCallback)((function(e){(0,xe.t8)(S,e),Ie(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],Ue=(0,u.useCallback)((function(e){(0,xe.t8)(H,e),Ne(e)}),[]),Ve=(0,u.useMemo)((function(){return(0,Me.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===Ve||void 0===Ve?void 0:Ve.find((function(n){return n.name===e}));Ue(n?null===n||void 0===n?void 0:n.name:null)}}),[ve,Ve,Ue]);var Te=y.ZP.git_files.detail(q?encodeURIComponent(q):null,{base_branch:M}),Le=Te.data,qe=Te.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(){M&&qe()}),[M,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,V.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(!M)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,V.jsx)(j.Z,{mx:1,children:(0,V.jsx)(g.Z,{appearBefore:!0,label:t,widthFitContent:!0,children:(0,V.jsx)(x.ZP,Ae(Ae({},l),{},{monospace:!0,rightAligned:!0,small:!0,children:n}))})})},useRootFolder:!0,uuid:"pages/VersionControl"}):(0,V.jsx)(j.Z,{p:B.cd,children:(0,V.jsx)(x.ZP,{monospace:!0,muted:!0,children:"No files modified"})})}),[M,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,V.jsxs)("div",{style:{marginTop:5},children:[(0,V.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,V.jsx)(h.Z,{light:!0})]})}),[W,nn]),rn=(0,u.useMemo)((function(){return(0,V.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,V.jsx)(T,{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,V.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,V.jsx)(X,{actionRemoteName:ye,branch:he,branches:le,fetchBranch:de,loading:!ve,modifiedFiles:Ke,remotes:Ze,repositories:Ve,repositoryName:Be,setActionRemoteName:Ee,setRepositoryName:Ue,showError:r,stagedFiles:Xe})}),[ye,he,le,ve,de,Ke,Ze,Ve,Be,Ee,Ue,r,Xe]),cn=(0,u.useMemo)((function(){return(0,V.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:M,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,V.jsx)("div",{style:{width:"".concat(n,"px")},children:mn})}}]),"Git directory"in Y&&e.push([{render:function(){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(j.Z,{p:1,children:(0,V.jsx)(v.Z,{compact:!0,label:"Base branch",onChange:function(e){return N(e.target.value)},ref:n,small:!0,value:M||"",children:null===le||void 0===le?void 0:le.map((function(e){var n=e.name;return(0,V.jsx)("option",{value:n,children:n},n)}))})}),en]})}}]),(0,V.jsx)(ue.Z,{columnsOfItems:e,fullHeight:!0,heightOffset:2*we.Mz,uuid:"version-control-all-modified-files",width:P})}),[M,le,mn,P,en,Y]);return(0,V.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:Re,children:(0,V.jsxs)(j.Z,{p:B.cd,children:[!ae&&(0,V.jsx)(p.Z,{inverted:!0}),ae&&(0,V.jsxs)(V.Fragment,{children:[D.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,R.uuid===(null===W||void 0===W?void 0:W.uuid)&&sn]})]})})};function Be(){return(0,V.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}]);
|